From 01d5cc1f3b1d26a193dc35f18d42f30348825a11 Mon Sep 17 00:00:00 2001 From: prashant-webkul Date: Wed, 22 Aug 2018 12:58:54 +0530 Subject: [PATCH 01/12] Before merge with master --- .../Admin/src/DataGrids/ProductDataGrid.php | 2 +- packages/Webkul/Admin/src/Datagrids/User.php | 151 ------------------ .../Webkul/Ui/src/DataGrid/ProductGrid.php | 85 +++++----- .../Ui/src/Resources/assets/sass/app.scss | 9 +- .../views/datagrid/table/default.blade.php | 8 +- packages/Webkul/Ui/webpack.mix.js | 2 +- 6 files changed, 53 insertions(+), 204 deletions(-) delete mode 100644 packages/Webkul/Admin/src/Datagrids/User.php diff --git a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php index 63287c074..881c820f6 100644 --- a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php @@ -156,7 +156,7 @@ class ProductDataGrid [ 'name' => 'pi.qty', 'alias' => 'ProductQuantity', - 'type' => 'string', + 'type' => 'number', 'label' => 'Product Quatity', ], ], diff --git a/packages/Webkul/Admin/src/Datagrids/User.php b/packages/Webkul/Admin/src/Datagrids/User.php deleted file mode 100644 index dcc975ea8..000000000 --- a/packages/Webkul/Admin/src/Datagrids/User.php +++ /dev/null @@ -1,151 +0,0 @@ - 'Admins', - 'table' => 'admins as u', - 'select' => 'u.id', - 'perpage' => 5, - 'aliased' => true, //use this with false as default and true in case of joins - - 'massoperations' => [ - [ - 'route' => route('admin.datagrid.delete'), - 'method' => 'DELETE', - 'label' => 'Delete', - 'type' => 'button', - ] - ], - 'actions' => [ - [ - 'type' => 'Edit', - 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', - 'icon' => 'icon pencil-lg-icon', - ], [ - 'type' => 'Delete', - 'route' => route('admin.datagrid.delete'), - 'confirm_text' => 'Do you really want to do this?', - 'icon' => 'icon trash-icon', - ], - ], - 'join' => [ - [ - 'join' => 'leftjoin', - 'table' => 'roles as r', - 'primaryKey' => 'u.role_id', - 'condition' => '=', - 'secondaryKey' => 'r.id', - ] - ], - - //use aliasing on secodary columns if join is performed - 'columns' => [ - [ - 'name' => 'u.id', - 'alias' => 'ID', - 'type' => 'string', - 'label' => 'Admin ID', - 'sortable' => true, - 'wrapper' => function ($value, $object) { - return '' . $object->ID . ''; - }, - ], [ - 'name' => 'u.name', - 'alias' => 'Name', - 'type' => 'string', - 'label' => 'Name', - 'sortable' => true, - 'wrapper' => function ($value, $object) { - return '' . $object->Name . ''; - }, - ], [ - 'name' => 'u.email', - 'alias' => 'Email', - 'type' => 'string', - 'label' => 'E-Mail', - 'sortable' => true, - ], [ - 'name' => 'r.name', - 'alias' => 'xa', - 'type' => 'string', - 'label' => 'Role Name', - 'sortable' => true, - ], [ - 'name' => 'r.id', - 'alias' => 'xc', - 'type' => 'string', - 'label' => 'Role ID', - 'sortable' => true, - ] - ], - //don't use aliasing in case of filters - 'filterable' => [ - [ - 'column' => 'u.name', - 'alias' => 'Name', - 'type' => 'string', - 'label' => 'Name' - ], [ - 'column' => 'u.email', - 'alias' => 'Email', - 'type' => 'string', - 'label' => 'Email' - ], [ - 'column' => 'u.id', - 'alias' => 'ID', - 'type' => 'number', - 'label' => 'Admin ID' - ], [ - 'column' => 'r.id', - 'alias' => 'Role_ID', - 'type' => 'number', - 'label' => 'Role ID' - ] - ], - //don't use aliasing in case of searchables - 'searchable' => [ - [ - 'column' => 'u.email', - 'type' => 'string', - 'label' => 'E-Mail' - ], [ - 'column' => 'u.name', - 'type' => 'string', - 'label' => 'Name' - ] - ], - 'operators' => [ - 'eq' => "=", - 'lt' => "<", - 'gt' => ">", - 'lte' => "<=", - 'gte' => ">=", - 'neqs' => "<>", - 'neqn' => "!=", - 'like' => "like", - 'nlike' => "not like", - ], - ]); - } - - public function render() - { - return $this->createDatagrid()->render(); - } -} \ No newline at end of file diff --git a/packages/Webkul/Ui/src/DataGrid/ProductGrid.php b/packages/Webkul/Ui/src/DataGrid/ProductGrid.php index 2bbd665e0..64a354dce 100644 --- a/packages/Webkul/Ui/src/DataGrid/ProductGrid.php +++ b/packages/Webkul/Ui/src/DataGrid/ProductGrid.php @@ -169,6 +169,17 @@ class ProductGrid protected $parsed; + /** + * To store the + * attribute columns aliases + * for search, filter and + * sort. + * + * @var attributeAliases + */ + + private $attributeAliases = []; + //Prepares the input parameters passed as the configuration for datagrid. public function make($args) { @@ -555,59 +566,48 @@ class ProductGrid private function parse() { $parsed = []; + $unparsed = url()->full(); + if (count(explode('?', $unparsed))>1) { + $to_be_parsed = explode('?', $unparsed)[1]; + parse_str($to_be_parsed, $parsed); + unset($parsed['page']); + return $parsed; } else { + return $parsed; + } } - public function getProducts() { - $qb = DB::table('products')->addSelect('products.*'); + /** + * Getting all attributes from the repository instance + * type hinted in the contructor of product grid. + * + * @return $this + */ + public function getAttributes() { - $channel = core()->getCurrentChannelCode(); - $locale = app()->getLocale(); + return $this->attributes->all(); + } - foreach (['name', 'description', 'short_description', 'price'] as $code) { - $attribute = $this->attributes->findBy('code', $code); + public function filterProductByAttributes($attributes) { - $productValueAlias = 'pav_' . $attribute->code; + foreach($attributes as $key => $value) { - $qb->leftJoin('product_attribute_values as ' . $productValueAlias, function($leftJoin) use($channel, $locale, $attribute, $productValueAlias) { + $filterAlias = 'filter_' . $attribute->code; - $leftJoin->on('products.id', $productValueAlias . '.product_id'); + $qb->leftJoin('product_attribute_values as ' . $filterAlias, 'products.id', '=', $filterAlias . '.product_id'); + + $qb->where($filterAlias . '.' . ProductAttributeValue::$attributeTypeFields[$attribute->type], 'Product Name'); - if($attribute->value_per_channel) { - if($attribute->value_per_locale) { - $leftJoin->where($productValueAlias . '.channel', $channel) - ->where($productValueAlias . '.locale', $locale); - } else { - $leftJoin->where($productValueAlias . '.channel', $channel); - } - } else { - if($attribute->value_per_locale) { - $leftJoin->where($productValueAlias . '.locale', $locale); - } } - $leftJoin->where($productValueAlias . '.attribute_id', $attribute->id); - }); - - - $qb->addSelect($productValueAlias . '.' . ProductAttributeValue::$attributeTypeFields[$attribute->type] . ' as ' . $code); - - - if($code == 'name') { - $filterAlias = 'filter_' . $attribute->code; - - $qb->leftJoin('product_attribute_values as ' . $filterAlias, 'products.id', '=', $filterAlias . '.product_id'); - $qb->where($filterAlias . '.' . ProductAttributeValue::$attributeTypeFields[$attribute->type], 'Product Name'); - } - } } /** @@ -623,14 +623,15 @@ class ProductGrid if(array_key_exists('withAttributes',$join)) { $qb = $this->query; - $channel = $this->channel; $locale = $this->locale; foreach ($this->attributeColumns as $code) { $attribute = $this->attributes->findBy('code', $code); - $productValueAlias = 'pav_' . $attribute->code; + $productValueAlias = 'pavxxx' . $attribute->code; + + array_push($this->attributeAliases, $productValueAlias); $qb->leftJoin('product_attribute_values as ' . $productValueAlias, function ($leftJoin) use ($channel, $locale, $attribute, $productValueAlias) { $leftJoin->on('prods.id', $productValueAlias . '.product_id'); @@ -950,21 +951,11 @@ class ProductGrid 'results' => $this->results, 'columns' => $this->columns, 'attribute_columns' => $this->attributeColumns, + 'attributeAliases' => $this->attributeAliases, 'filterable' =>$this->filterable, 'operators' => $this->operators, 'massoperations' => $this->massoperations, 'actions' => $this->actions, ]); } - - /** - * Getting all attributes from the repository instance - * type hinted in the contructor of product grid. - * - * @return $this - */ - public function getAttributes() { - // dd($this->attributes->all()); - return $this->attributes->all(); - } } \ No newline at end of file diff --git a/packages/Webkul/Ui/src/Resources/assets/sass/app.scss b/packages/Webkul/Ui/src/Resources/assets/sass/app.scss index 289562d52..5b8623280 100644 --- a/packages/Webkul/Ui/src/Resources/assets/sass/app.scss +++ b/packages/Webkul/Ui/src/Resources/assets/sass/app.scss @@ -633,7 +633,10 @@ h2 { } } +/* Data grid css starts here */ .grid-container { + user-select: none; + .filter-wrapper { display: block; box-sizing: border-box; @@ -642,7 +645,6 @@ h2 { .filter-row-two { display: flex; flex-direction: row; - // flex-wrap: wrap; } .filter-row-one { height: 40px; @@ -696,7 +698,7 @@ h2 { width: 150px; border: 2px solid $control-border-color; border-radius: 2px; - background-color: white; + background-color: $color-white; color: $filter-toggle-color; font-size: 14px; @@ -866,6 +868,9 @@ h2 { } } + th { + text-transform: capitalize; + } } } diff --git a/packages/Webkul/Ui/src/Resources/views/datagrid/table/default.blade.php b/packages/Webkul/Ui/src/Resources/views/datagrid/table/default.blade.php index 05417c7df..e76ebe627 100644 --- a/packages/Webkul/Ui/src/Resources/views/datagrid/table/default.blade.php +++ b/packages/Webkul/Ui/src/Resources/views/datagrid/table/default.blade.php @@ -108,8 +108,12 @@ @endforeach @if(isset($attribute_columns)) @foreach($attribute_columns as $key => $value) - - {{ $value }} + + {{ $value }} @endforeach @endif diff --git a/packages/Webkul/Ui/webpack.mix.js b/packages/Webkul/Ui/webpack.mix.js index 4fa81616a..32804fbcc 100644 --- a/packages/Webkul/Ui/webpack.mix.js +++ b/packages/Webkul/Ui/webpack.mix.js @@ -14,7 +14,7 @@ mix.js( ], "js/ui.js" ) - .copy(__dirname + "/src/Resources/assets/images", publicPath + "/images") + // .copy(__dirname + "/src/Resources/assets/images", publicPath + "/images") .sass(__dirname + "/src/Resources/assets/sass/app.scss", "css/ui.css") .options({ processCssUrls: false From 4403fedc899d943ae7ce63347c40d84ff38e295b Mon Sep 17 00:00:00 2001 From: prashant-webkul Date: Wed, 22 Aug 2018 15:16:27 +0530 Subject: [PATCH 02/12] Before merge --- .../Controllers/RegistrationController.php | 13 +++-- .../src/Repositories/CustomerRepository.php | 54 +++++++++++++++++++ .../customers/account/profile/edit.blade.php | 27 ++++++---- .../views/customers/session/index.blade.php | 4 +- .../views/customers/signup/index.blade.php | 8 +-- public/themes/default/assets/js/shop.js | 6 +-- 6 files changed, 91 insertions(+), 21 deletions(-) create mode 100644 packages/Webkul/Customer/src/Repositories/CustomerRepository.php diff --git a/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php b/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php index 7274614e0..9a5a4c374 100644 --- a/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php +++ b/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php @@ -5,7 +5,7 @@ namespace Webkul\Customer\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Routing\Controller; -use Webkul\Customer\Models\Customer; +use Webkul\Customer\Repositories\CustomerRepository; /** * Dashboard controller @@ -45,23 +45,30 @@ class RegistrationController extends Controller { // return $request->except('_token'); //don't let csrf token to be openly printed $request->validate([ + 'first_name' => 'string|required', 'last_name' => 'string|required', 'email' => 'email|required', - 'password' => 'confirmed|min:8|required' + 'password' => 'confirmed|min:6|required' + ]); + $customer = new \Webkul\Customer\Models\Customer(); $customer->first_name = $request->first_name; $customer->last_name = $request->last_name; $customer->email = $request->email; $customer->password = bcrypt($request->password); - // dd('hello1'); + if ($customer->save()) { + session()->flash('success', 'Account created successfully.'); return redirect()->route($this->_config['redirect']); + } else { + session()->flash('error', 'Cannot Create Your Account.'); return redirect()->back(); + } } } diff --git a/packages/Webkul/Customer/src/Repositories/CustomerRepository.php b/packages/Webkul/Customer/src/Repositories/CustomerRepository.php new file mode 100644 index 000000000..94a26a67d --- /dev/null +++ b/packages/Webkul/Customer/src/Repositories/CustomerRepository.php @@ -0,0 +1,54 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ + +class CustomerRepository extends Repository +{ + /** + * Specify Model class name + * + * @return mixed + */ + + function model() + { + return 'Webkul\Customer\Models\Customer'; + } + + /** + * @param array $data + * @return mixed + */ + + public function create(array $data) + { + $customer = $this->model->create($data); + + return $customer; + } + + /** + * @param array $data + * @param $id + * @param string $attribute + * @return mixed + */ + + public function update(array $data, $id, $attribute = "id") + { + $customer = $this->findOrFail($id); + + $customer->update($data); + + return $customer; + } +} \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/customers/account/profile/edit.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/account/profile/edit.blade.php index 1bcb3ee50..c28a6d0ef 100644 --- a/packages/Webkul/Shop/src/Resources/views/customers/account/profile/edit.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/customers/account/profile/edit.blade.php @@ -12,50 +12,59 @@
- + {{ csrf_field() }}
- {{-- @{{ errors.first('first_name') }} --}} + + @{{ errors.first('first_name') }}
- {{-- @{{ errors.first('last_name') }} --}} + + @{{ errors.first('last_name') }}
- {{-- @{{ errors.first('email') }} --}} + + @{{ errors.first('email') }}
{{-- @{{ errors.first('gender') }} --}} + + + + @{{ errors.first('gender') }}
- {{-- @{{ errors.first('first_name') }} --}} + + @{{ errors.first('first_name') }}
- {{-- @{{ errors.first('phone') }} --}} + + @{{ errors.first('phone') }}
+ @{{ errors.first('password') }}
+
+ @{{ errors.first('password') }}
diff --git a/packages/Webkul/Shop/src/Resources/views/customers/session/index.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/session/index.blade.php index 888a8f13a..1a87bfa2d 100644 --- a/packages/Webkul/Shop/src/Resources/views/customers/session/index.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/customers/session/index.blade.php @@ -18,13 +18,13 @@
- + @{{ errors.first('email') }}
- + @{{ errors.first('password') }}
diff --git a/packages/Webkul/Shop/src/Resources/views/customers/signup/index.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/signup/index.blade.php index 5b9f5a043..ecc0e4564 100644 --- a/packages/Webkul/Shop/src/Resources/views/customers/signup/index.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/customers/signup/index.blade.php @@ -18,25 +18,25 @@
- + @{{ errors.first('first_name') }}
- + @{{ errors.first('last_name') }}
- + @{{ errors.first('email') }}
- + @{{ errors.first('password') }}
diff --git a/public/themes/default/assets/js/shop.js b/public/themes/default/assets/js/shop.js index 1e1f19f52..87f8eea4e 100644 --- a/public/themes/default/assets/js/shop.js +++ b/public/themes/default/assets/js/shop.js @@ -10650,7 +10650,7 @@ return jQuery; "use strict"; /* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*! - * Vue.js v2.5.17 + * Vue.js v2.5.16 * (c) 2014-2018 Evan You * Released under the MIT License. */ @@ -15739,7 +15739,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', { value: FunctionalRenderContext }); -Vue.version = '2.5.17'; +Vue.version = '2.5.16'; /* */ @@ -29910,7 +29910,7 @@ if (false) { /* 24 */ /***/ (function(module, exports, __webpack_require__) { -!function(t,e){ true?module.exports=e():"function"==typeof define&&define.amd?define("vue-slider-component",[],e):"object"==typeof exports?exports["vue-slider-component"]=e():t["vue-slider-component"]=e()}(this,function(){return function(t){function e(s){if(i[s])return i[s].exports;var r=i[s]={i:s,l:!1,exports:{}};return t[s].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var i={};return e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,s){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:s})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=2)}([function(t,e,i){i(7);var s=i(5)(i(1),i(6),null,null);t.exports=s.exports},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=function(){var t="undefined"!=typeof window?window.devicePixelRatio||1:1;return function(e){return Math.round(e*t)/t}}();e.default={name:"VueSliderComponent",props:{width:{type:[Number,String],default:"auto"},height:{type:[Number,String],default:6},data:{type:Array,default:null},dotSize:{type:Number,default:16},dotWidth:{type:Number,required:!1},dotHeight:{type:Number,required:!1},min:{type:Number,default:0},max:{type:Number,default:100},interval:{type:Number,default:1},show:{type:Boolean,default:!0},disabled:{type:[Boolean,Array],default:!1},piecewise:{type:Boolean,default:!1},tooltip:{type:[String,Boolean],default:"always"},eventType:{type:String,default:"auto"},direction:{type:String,default:"horizontal"},reverse:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},clickable:{type:Boolean,default:!0},speed:{type:Number,default:.5},realTime:{type:Boolean,default:!1},stopPropagation:{type:Boolean,default:!1},value:{type:[String,Number,Array,Object],default:0},piecewiseLabel:{type:Boolean,default:!1},debug:{type:Boolean,default:!0},fixed:{type:Boolean,default:!1},processDragable:{type:Boolean,default:!1},useKeyboard:{type:Boolean,default:!1},actionsKeyboard:{type:Array,default:function(){return[function(t){return t-1},function(t){return t+1}]}},tooltipMerge:{type:Boolean,default:!0},sliderStyle:[Array,Object,Function],focusStyle:[Array,Object,Function],tooltipDir:[Array,String],formatter:[String,Function],mergeFormatter:[String,Function],piecewiseStyle:Object,disabledStyle:Object,piecewiseActiveStyle:Object,processStyle:Object,bgStyle:Object,tooltipStyle:[Array,Object,Function],disabledDotStyle:[Array,Object,Function],labelStyle:Object,labelActiveStyle:Object},data:function(){return{flag:!1,keydownFlag:null,focusFlag:!1,processFlag:!1,processSign:null,size:0,fixedValue:0,focusSlider:0,currentValue:0,currentSlider:0,isComponentExists:!0,isMounted:!1}},computed:{dotWidthVal:function(){return"number"==typeof this.dotWidth?this.dotWidth:this.dotSize},dotHeightVal:function(){return"number"==typeof this.dotHeight?this.dotHeight:this.dotSize},flowDirection:function(){return"vue-slider-"+this.direction+(this.reverse?"-reverse":"")},tooltipMergedPosition:function(){if(!this.isMounted)return{};var t=this.tooltipDirection[0];if(this.$refs.dot0){if("vertical"===this.direction){var e={};return e[t]="-"+(this.dotHeightVal/2-this.width/2+9)+"px",e}var i={};return i[t]="-"+(this.dotWidthVal/2-this.height/2+9)+"px",i.left="50%",i}},tooltipDirection:function(){var t=this.tooltipDir||("vertical"===this.direction?"left":"top");return Array.isArray(t)?this.isRange?t:t[1]:this.isRange?[t,t]:t},tooltipStatus:function(){return"hover"===this.tooltip&&this.flag?"vue-slider-always":this.tooltip?"vue-slider-"+this.tooltip:""},tooltipClass:function(){return["vue-slider-tooltip-"+this.tooltipDirection,"vue-slider-tooltip"]},disabledArray:function(){return Array.isArray(this.disabled)?this.disabled:[this.disabled,this.disabled]},boolDisabled:function(){return this.disabledArray.every(function(t){return!0===t})},isDisabled:function(){return"none"===this.eventType||this.boolDisabled},disabledClass:function(){return this.boolDisabled?"vue-slider-disabled":""},stateClass:function(){return{"vue-slider-state-process-drag":this.processFlag,"vue-slider-state-drag":this.flag&&!this.processFlag&&!this.keydownFlag,"vue-slider-state-focus":this.focusFlag}},isRange:function(){return Array.isArray(this.value)},slider:function(){return this.isRange?[this.$refs.dot0,this.$refs.dot1]:this.$refs.dot},minimum:function(){return this.data?0:this.min},val:{get:function(){return this.data?this.isRange?[this.data[this.currentValue[0]],this.data[this.currentValue[1]]]:this.data[this.currentValue]:this.currentValue},set:function(t){if(this.data)if(this.isRange){var e=this.data.indexOf(t[0]),i=this.data.indexOf(t[1]);e>-1&&i>-1&&(this.currentValue=[e,i])}else{var s=this.data.indexOf(t);s>-1&&(this.currentValue=s)}else this.currentValue=t}},currentIndex:function(){return this.isRange?this.data?this.currentValue:[this.getIndexByValue(this.currentValue[0]),this.getIndexByValue(this.currentValue[1])]:this.getIndexByValue(this.currentValue)},indexRange:function(){return this.isRange?this.currentIndex:[0,this.currentIndex]},maximum:function(){return this.data?this.data.length-1:this.max},multiple:function(){var t=(""+this.interval).split(".")[1];return t?Math.pow(10,t.length):1},spacing:function(){return this.data?1:this.interval},total:function(){return this.data?this.data.length-1:(Math.floor((this.maximum-this.minimum)*this.multiple)%(this.interval*this.multiple)!=0&&this.printError("Prop[interval] is illegal, Please make sure that the interval can be divisible"),(this.maximum-this.minimum)/this.interval)},gap:function(){return this.size/this.total},position:function(){return this.isRange?[(this.currentValue[0]-this.minimum)/this.spacing*this.gap,(this.currentValue[1]-this.minimum)/this.spacing*this.gap]:(this.currentValue-this.minimum)/this.spacing*this.gap},limit:function(){return this.isRange?this.fixed?[[0,(this.total-this.fixedValue)*this.gap],[this.fixedValue*this.gap,this.size]]:[[0,this.position[1]],[this.position[0],this.size]]:[0,this.size]},valueLimit:function(){return this.isRange?this.fixed?[[this.minimum,this.maximum-this.fixedValue*(this.spacing*this.multiple)/this.multiple],[this.minimum+this.fixedValue*(this.spacing*this.multiple)/this.multiple,this.maximum]]:[[this.minimum,this.currentValue[1]],[this.currentValue[0],this.maximum]]:[this.minimum,this.maximum]},idleSlider:function(){return 0===this.currentSlider?1:0},wrapStyles:function(){return"vertical"===this.direction?{height:"number"==typeof this.height?this.height+"px":this.height,padding:this.dotHeightVal/2+"px "+this.dotWidthVal/2+"px"}:{width:"number"==typeof this.width?this.width+"px":this.width,padding:this.dotHeightVal/2+"px "+this.dotWidthVal/2+"px"}},sliderStyles:function(){return Array.isArray(this.sliderStyle)?this.isRange?this.sliderStyle:this.sliderStyle[1]:"function"==typeof this.sliderStyle?this.sliderStyle(this.val,this.currentIndex):this.isRange?[this.sliderStyle,this.sliderStyle]:this.sliderStyle},focusStyles:function(){return Array.isArray(this.focusStyle)?this.isRange?this.focusStyle:this.focusStyle[1]:"function"==typeof this.focusStyle?this.focusStyle(this.val,this.currentIndex):this.isRange?[this.focusStyle,this.focusStyle]:this.focusStyle},disabledDotStyles:function(){var t=this.disabledDotStyle;if(Array.isArray(t))return t;if("function"==typeof t){var e=t(this.val,this.currentIndex);return Array.isArray(e)?e:[e,e]}return t?[t,t]:[{backgroundColor:"#ccc"},{backgroundColor:"#ccc"}]},tooltipStyles:function(){return Array.isArray(this.tooltipStyle)?this.isRange?this.tooltipStyle:this.tooltipStyle[1]:"function"==typeof this.tooltipStyle?this.tooltipStyle(this.val,this.currentIndex):this.isRange?[this.tooltipStyle,this.tooltipStyle]:this.tooltipStyle},elemStyles:function(){return"vertical"===this.direction?{width:this.width+"px",height:"100%"}:{height:this.height+"px"}},dotStyles:function(){return"vertical"===this.direction?{width:this.dotWidthVal+"px",height:this.dotHeightVal+"px",left:-(this.dotWidthVal-this.width)/2+"px"}:{width:this.dotWidthVal+"px",height:this.dotHeightVal+"px",top:-(this.dotHeightVal-this.height)/2+"px"}},piecewiseDotStyle:function(){return"vertical"===this.direction?{width:this.width+"px",height:this.width+"px"}:{width:this.height+"px",height:this.height+"px"}},piecewiseDotWrap:function(){if(!this.piecewise&&!this.piecewiseLabel)return!1;for(var t=[],e=0;e<=this.total;e++){var i="vertical"===this.direction?{bottom:this.gap*e-this.width/2+"px",left:0}:{left:this.gap*e-this.height/2+"px",top:0},s=this.reverse?this.total-e:e,r=this.data?this.data[s]:this.spacing*s+this.min;t.push({style:i,label:this.formatter?this.formatting(r):r,inRange:s>=this.indexRange[0]&&s<=this.indexRange[1]})}return t}},watch:{value:function(t){this.flag||this.setValue(t,!0)},max:function(t){if(tthis.max)return this.printError("The minimum value can not be greater than the maximum value.");var e=this.limitValue(this.val);this.setValue(e),this.refresh()},show:function(t){var e=this;t&&!this.size&&this.$nextTick(function(){e.refresh()})},fixed:function(){this.computedFixedValue()}},methods:{bindEvents:function(){document.addEventListener("touchmove",this.moving,{passive:!1}),document.addEventListener("touchend",this.moveEnd,{passive:!1}),document.addEventListener("mousedown",this.blurSlider),document.addEventListener("mousemove",this.moving),document.addEventListener("mouseup",this.moveEnd),document.addEventListener("mouseleave",this.moveEnd),document.addEventListener("keydown",this.handleKeydown),document.addEventListener("keyup",this.handleKeyup),window.addEventListener("resize",this.refresh),this.isRange&&this.tooltipMerge&&(this.$refs.dot0.addEventListener("transitionend",this.handleOverlapTooltip),this.$refs.dot1.addEventListener("transitionend",this.handleOverlapTooltip))},unbindEvents:function(){document.removeEventListener("touchmove",this.moving),document.removeEventListener("touchend",this.moveEnd),document.removeEventListener("mousedown",this.blurSlider),document.removeEventListener("mousemove",this.moving),document.removeEventListener("mouseup",this.moveEnd),document.removeEventListener("mouseleave",this.moveEnd),document.removeEventListener("keydown",this.handleKeydown),document.removeEventListener("keyup",this.handleKeyup),window.removeEventListener("resize",this.refresh),this.isRange&&this.tooltipMerge&&(this.$refs.dot0.removeEventListener("transitionend",this.handleOverlapTooltip),this.$refs.dot1.removeEventListener("transitionend",this.handleOverlapTooltip))},handleKeydown:function(t){if(!this.useKeyboard||!this.focusFlag)return!1;switch(t.keyCode){case 37:case 40:t.preventDefault(),this.keydownFlag=!0,this.flag=!0,this.changeFocusSlider(this.actionsKeyboard[0]);break;case 38:case 39:t.preventDefault(),this.keydownFlag=!0,this.flag=!0,this.changeFocusSlider(this.actionsKeyboard[1])}},handleKeyup:function(){this.keydownFlag&&(this.keydownFlag=!1,this.flag=!1)},changeFocusSlider:function(t){var e=this;if(this.isRange){var i=this.currentIndex.map(function(i,s){if(s===e.focusSlider||e.fixed){var r=t(i),o=e.fixed?e.valueLimit[s]:[0,e.total];if(r<=o[1]&&r>=o[0])return r}return i});i[0]>i[1]&&(this.focusSlider=0===this.focusSlider?1:0,i=i.reverse()),this.setIndex(i)}else this.setIndex(t(this.currentIndex))},blurSlider:function(t){var e=this.isRange?this.$refs["dot"+this.focusSlider]:this.$refs.dot;if(!e||e===t.target)return!1;this.focusFlag=!1},formatting:function(t){return"string"==typeof this.formatter?this.formatter.replace(/\{value\}/,t):this.formatter(t)},mergeFormatting:function(t,e){return"string"==typeof this.mergeFormatter?this.mergeFormatter.replace(/\{(value1|value2)\}/g,function(i,s){return"value1"===s?t:e}):this.mergeFormatter(t,e)},getPos:function(t){return this.realTime&&this.getStaticData(),"vertical"===this.direction?this.reverse?t.pageY-this.offset:this.size-(t.pageY-this.offset):this.reverse?this.size-(t.clientX-this.offset):t.clientX-this.offset},processClick:function(t){this.fixed&&t.stopPropagation()},wrapClick:function(t){var e=this;if(this.isDisabled||!this.clickable||this.processFlag)return!1;var i=this.getPos(t);if(this.isRange)if(this.disabledArray.every(function(t){return!1===t}))this.currentSlider=i>(this.position[1]-this.position[0])/2+this.position[0]?1:0;else if(this.disabledArray[0]){if(ithis.position[1])return!1;this.currentSlider=0}if(this.disabledArray[this.currentSlider])return!1;if(this.setValueOnPos(i),this.isRange&&this.tooltipMerge){var s=setInterval(function(){return e.handleOverlapTooltip()},16.7);setTimeout(function(){return window.clearInterval(s)},1e3*this.speed)}},moveStart:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments[2];if(this.disabledArray[e])return!1;if(this.stopPropagation&&t.stopPropagation(),this.isRange&&(this.currentSlider=e,i)){if(!this.processDragable)return!1;this.processFlag=!0,this.processSign={pos:this.position,start:this.getPos(t.targetTouches&&t.targetTouches[0]?t.targetTouches[0]:t)}}!i&&this.useKeyboard&&(this.focusFlag=!0,this.focusSlider=e),this.flag=!0,this.$emit("drag-start",this)},moving:function(t){if(this.stopPropagation&&t.stopPropagation(),!this.flag)return!1;t.preventDefault(),t.targetTouches&&t.targetTouches[0]&&(t=t.targetTouches[0]),this.processFlag?(this.currentSlider=0,this.setValueOnPos(this.processSign.pos[0]+this.getPos(t)-this.processSign.start,!0),this.currentSlider=1,this.setValueOnPos(this.processSign.pos[1]+this.getPos(t)-this.processSign.start,!0)):this.setValueOnPos(this.getPos(t),!0),this.isRange&&this.tooltipMerge&&this.handleOverlapTooltip()},moveEnd:function(t){var e=this;if(this.stopPropagation&&t.stopPropagation(),!this.flag)return!1;this.$emit("drag-end",this),this.lazy&&this.isDiff(this.val,this.value)&&this.syncValue(),this.flag=!1,window.setTimeout(function(){e.processFlag=!1},0),this.setPosition()},setValueOnPos:function(t,e){var i=this.isRange?this.limit[this.currentSlider]:this.limit,s=this.isRange?this.valueLimit[this.currentSlider]:this.valueLimit;if(t>=i[0]&&t<=i[1]){this.setTransform(t);var r=this.getValueByIndex(Math.round(t/this.gap));this.setCurrentValue(r,e),this.isRange&&this.fixed&&(this.setTransform(t+this.fixedValue*this.gap*(0===this.currentSlider?1:-1),!0),this.setCurrentValue((r*this.multiple+this.fixedValue*this.spacing*this.multiple*(0===this.currentSlider?1:-1))/this.multiple,e,!0))}else tthis.maximum)return!1;this.isRange?this.isDiff(this.currentValue[s],t)&&(this.currentValue.splice(s,1,t),this.lazy&&this.flag||this.syncValue()):this.isDiff(this.currentValue,t)&&(this.currentValue=t,this.lazy&&this.flag||this.syncValue()),e||this.setPosition()},getValueByIndex:function(t){return(this.spacing*this.multiple*t+this.minimum*this.multiple)/this.multiple},getIndexByValue:function(t){return Math.round((t-this.minimum)*this.multiple)/(this.spacing*this.multiple)},setIndex:function(t){if(Array.isArray(t)&&this.isRange){var e=void 0;e=this.data?[this.data[t[0]],this.data[t[1]]]:[this.getValueByIndex(t[0]),this.getValueByIndex(t[1])],this.setValue(e)}else t=this.getValueByIndex(t),this.isRange&&(this.currentSlider=t>(this.currentValue[1]-this.currentValue[0])/2+this.currentValue[0]?1:0),this.setCurrentValue(t)},setValue:function(t,e,i){var s=this;if(this.isDiff(this.val,t)){var r=this.limitValue(t);this.val=this.isRange?r.concat():r,this.computedFixedValue(),this.syncValue(e)}this.$nextTick(function(){return s.setPosition(i)})},computedFixedValue:function(){if(!this.fixed)return this.fixedValue=0,!1;this.fixedValue=this.currentIndex[1]-this.currentIndex[0]},setPosition:function(t){this.flag||this.setTransitionTime(void 0===t?this.speed:t),this.isRange?(this.setTransform(this.position[0],1===this.currentSlider),this.setTransform(this.position[1],0===this.currentSlider)):this.setTransform(this.position),this.flag||this.setTransitionTime(0)},setTransform:function(t,e){var i=e?this.idleSlider:this.currentSlider,r=s(("vertical"===this.direction?this.dotHeightVal/2-t:t-this.dotWidthVal/2)*(this.reverse?-1:1)),o="vertical"===this.direction?"translateY("+r+"px)":"translateX("+r+"px)",n=this.fixed?this.fixedValue*this.gap+"px":(0===i?this.position[1]-t:t-this.position[0])+"px",l=this.fixed?(0===i?t:t-this.fixedValue*this.gap)+"px":(0===i?t:this.position[0])+"px";this.isRange?(this.slider[i].style.transform=o,this.slider[i].style.WebkitTransform=o,this.slider[i].style.msTransform=o,"vertical"===this.direction?(this.$refs.process.style.height=n,this.$refs.process.style[this.reverse?"top":"bottom"]=l):(this.$refs.process.style.width=n,this.$refs.process.style[this.reverse?"right":"left"]=l)):(this.slider.style.transform=o,this.slider.style.WebkitTransform=o,this.slider.style.msTransform=o,"vertical"===this.direction?(this.$refs.process.style.height=t+"px",this.$refs.process.style[this.reverse?"top":"bottom"]=0):(this.$refs.process.style.width=t+"px",this.$refs.process.style[this.reverse?"right":"left"]=0))},setTransitionTime:function(t){if(t||this.$refs.process.offsetWidth,this.isRange){for(var e=0;ee.max?(e.printError("The value of the slider is "+t+", the maximum value is "+e.max+", the value of this slider can not be greater than the maximum value"),e.max):i};return this.isRange?t.map(function(t){return i(t)}):i(t)},syncValue:function(t){var e=this.isRange?this.val.concat():this.val;this.$emit("input",e),t||this.$emit("callback",e)},getValue:function(){return this.val},getIndex:function(){return this.currentIndex},getStaticData:function(){this.$refs.elem&&(this.size="vertical"===this.direction?this.$refs.elem.offsetHeight:this.$refs.elem.offsetWidth,this.offset="vertical"===this.direction?this.$refs.elem.getBoundingClientRect().top+window.pageYOffset||document.documentElement.scrollTop:this.$refs.elem.getBoundingClientRect().left)},refresh:function(){this.$refs.elem&&(this.getStaticData(),this.computedFixedValue(),this.setPosition())},printError:function(t){this.debug&&console.error("[VueSlider error]: "+t)},handleOverlapTooltip:function(){var t=this.tooltipDirection[0]===this.tooltipDirection[1];if(this.isRange&&t){var e=this.reverse?this.$refs.tooltip1:this.$refs.tooltip0,i=this.reverse?this.$refs.tooltip0:this.$refs.tooltip1,s=e.getBoundingClientRect().right,r=i.getBoundingClientRect().left,o=e.getBoundingClientRect().y,n=i.getBoundingClientRect().y+i.getBoundingClientRect().height,l="horizontal"===this.direction&&s>r,a="vertical"===this.direction&&n>o;l||a?this.handleDisplayMergedTooltip(!0):this.handleDisplayMergedTooltip(!1)}},handleDisplayMergedTooltip:function(t){var e=this.$refs.tooltip0,i=this.$refs.tooltip1,s=this.$refs.process.getElementsByClassName("vue-merged-tooltip")[0];t?(e.style.visibility="hidden",i.style.visibility="hidden",s.style.visibility="visible"):(e.style.visibility="visible",i.style.visibility="visible",s.style.visibility="hidden")}},mounted:function(){var t=this;if(this.isComponentExists=!0,"undefined"==typeof window||"undefined"==typeof document)return this.printError("window or document is undefined, can not be initialization.");this.$nextTick(function(){t.isComponentExists&&(t.getStaticData(),t.setValue(t.limitValue(t.value),!0,0),t.bindEvents())}),this.isMounted=!0},beforeDestroy:function(){this.isComponentExists=!1,this.unbindEvents()}}},function(t,e,i){"use strict";var s=i(0);t.exports=s},function(t,e,i){e=t.exports=i(4)(),e.push([t.i,'.vue-slider-component{position:relative;box-sizing:border-box;-ms-user-select:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-o-user-select:none}.vue-slider-component.vue-slider-disabled{opacity:.5;cursor:not-allowed}.vue-slider-component.vue-slider-has-label{margin-bottom:15px}.vue-slider-component.vue-slider-disabled .vue-slider-dot{cursor:not-allowed}.vue-slider-component .vue-slider{position:relative;display:block;border-radius:15px;background-color:#ccc}.vue-slider-component .vue-slider:after{content:"";position:absolute;left:0;top:0;width:100%;height:100%;z-index:2}.vue-slider-component .vue-slider-process{position:absolute;border-radius:15px;background-color:#3498db;transition:all 0s;z-index:1}.vue-slider-component .vue-slider-process.vue-slider-process-dragable{cursor:pointer;z-index:3}.vue-slider-component.vue-slider-horizontal .vue-slider-process{width:0;height:100%;top:0;left:0;will-change:width}.vue-slider-component.vue-slider-vertical .vue-slider-process{width:100%;height:0;bottom:0;left:0;will-change:height}.vue-slider-component.vue-slider-horizontal-reverse .vue-slider-process{width:0;height:100%;top:0;right:0}.vue-slider-component.vue-slider-vertical-reverse .vue-slider-process{width:100%;height:0;top:0;left:0}.vue-slider-component .vue-slider-dot{position:absolute;border-radius:50%;background-color:#fff;box-shadow:.5px .5px 2px 1px rgba(0,0,0,.32);transition:all 0s;will-change:transform;cursor:pointer;z-index:5}.vue-slider-component .vue-slider-dot.vue-slider-dot-focus{box-shadow:0 0 2px 1px #3498db}.vue-slider-component .vue-slider-dot.vue-slider-dot-dragging{z-index:5}.vue-slider-component .vue-slider-dot.vue-slider-dot-disabled{z-index:4}.vue-slider-component.vue-slider-horizontal .vue-slider-dot{left:0}.vue-slider-component.vue-slider-vertical .vue-slider-dot{bottom:0}.vue-slider-component.vue-slider-horizontal-reverse .vue-slider-dot{right:0}.vue-slider-component.vue-slider-vertical-reverse .vue-slider-dot{top:0}.vue-slider-component .vue-slider-tooltip-wrap{display:none;position:absolute;z-index:9}.vue-slider-component .vue-slider-tooltip{display:block;font-size:14px;white-space:nowrap;padding:2px 5px;min-width:20px;text-align:center;color:#fff;border-radius:5px;border:1px solid #3498db;background-color:#3498db}.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-top{top:-9px;left:50%;-webkit-transform:translate(-50%,-100%);transform:translate(-50%,-100%)}.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-bottom{bottom:-9px;left:50%;-webkit-transform:translate(-50%,100%);transform:translate(-50%,100%)}.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-left{top:50%;left:-9px;-webkit-transform:translate(-100%,-50%);transform:translate(-100%,-50%)}.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-right{top:50%;right:-9px;-webkit-transform:translate(100%,-50%);transform:translate(100%,-50%)}.vue-slider-component .vue-slider-tooltip-top .vue-merged-tooltip .vue-slider-tooltip:before,.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-top .vue-slider-tooltip:before{content:"";position:absolute;bottom:-10px;left:50%;width:0;height:0;border:5px solid transparent;border:6px solid transparent\\0;border-top-color:inherit;-webkit-transform:translate(-50%);transform:translate(-50%)}.vue-slider-component .vue-slider-tooltip-wrap.vue-merged-tooltip{display:block;visibility:hidden}.vue-slider-component .vue-slider-tooltip-bottom .vue-merged-tooltip .vue-slider-tooltip:before,.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-bottom .vue-slider-tooltip:before{content:"";position:absolute;top:-10px;left:50%;width:0;height:0;border:5px solid transparent;border:6px solid transparent\\0;border-bottom-color:inherit;-webkit-transform:translate(-50%);transform:translate(-50%)}.vue-slider-component .vue-slider-tooltip-left .vue-merged-tooltip .vue-slider-tooltip:before,.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-left .vue-slider-tooltip:before{content:"";position:absolute;top:50%;right:-10px;width:0;height:0;border:5px solid transparent;border:6px solid transparent\\0;border-left-color:inherit;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.vue-slider-component .vue-slider-tooltip-right .vue-merged-tooltip .vue-slider-tooltip:before,.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-right .vue-slider-tooltip:before{content:"";position:absolute;top:50%;left:-10px;width:0;height:0;border:5px solid transparent;border:6px solid transparent\\0;border-right-color:inherit;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.vue-slider-component .vue-slider-dot.vue-slider-hover:hover .vue-slider-tooltip-wrap{display:block}.vue-slider-component .vue-slider-dot.vue-slider-always .vue-slider-tooltip-wrap{display:block!important}.vue-slider-component .vue-slider-piecewise{position:absolute;width:100%;padding:0;margin:0;left:0;top:0;height:100%;list-style:none}.vue-slider-component .vue-slider-piecewise-item{position:absolute;width:8px;height:8px}.vue-slider-component .vue-slider-piecewise-dot{position:absolute;left:50%;top:50%;width:100%;height:100%;display:inline-block;background-color:rgba(0,0,0,.16);border-radius:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);z-index:2;transition:all .3s}.vue-slider-component .vue-slider-piecewise-item:first-child .vue-slider-piecewise-dot,.vue-slider-component .vue-slider-piecewise-item:last-child .vue-slider-piecewise-dot{visibility:hidden}.vue-slider-component.vue-slider-horizontal-reverse .vue-slider-piecewise-label,.vue-slider-component.vue-slider-horizontal .vue-slider-piecewise-label{position:absolute;display:inline-block;top:100%;left:50%;white-space:nowrap;font-size:12px;color:#333;-webkit-transform:translate(-50%,8px);transform:translate(-50%,8px);visibility:visible}.vue-slider-component.vue-slider-vertical-reverse .vue-slider-piecewise-label,.vue-slider-component.vue-slider-vertical .vue-slider-piecewise-label{position:absolute;display:inline-block;top:50%;left:100%;white-space:nowrap;font-size:12px;color:#333;-webkit-transform:translate(8px,-50%);transform:translate(8px,-50%);visibility:visible}.vue-slider-component .vue-slider-sr-only{clip:rect(1px,1px,1px,1px);height:1px;width:1px;overflow:hidden;position:absolute!important}',""])},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;ei.parts.length&&(s.parts.length=i.parts.length)}else{for(var n=[],r=0;r-1&&i>-1&&(this.currentValue=[e,i])}else{var s=this.data.indexOf(t);s>-1&&(this.currentValue=s)}else this.currentValue=t}},currentIndex:function(){return this.isRange?this.data?this.currentValue:[this.getIndexByValue(this.currentValue[0]),this.getIndexByValue(this.currentValue[1])]:this.getIndexByValue(this.currentValue)},indexRange:function(){return this.isRange?this.currentIndex:[0,this.currentIndex]},maximum:function(){return this.data?this.data.length-1:this.max},multiple:function(){var t=(""+this.interval).split(".")[1];return t?Math.pow(10,t.length):1},spacing:function(){return this.data?1:this.interval},total:function(){return this.data?this.data.length-1:(Math.floor((this.maximum-this.minimum)*this.multiple)%(this.interval*this.multiple)!=0&&this.printError("Prop[interval] is illegal, Please make sure that the interval can be divisible"),(this.maximum-this.minimum)/this.interval)},gap:function(){return this.size/this.total},position:function(){return this.isRange?[(this.currentValue[0]-this.minimum)/this.spacing*this.gap,(this.currentValue[1]-this.minimum)/this.spacing*this.gap]:(this.currentValue-this.minimum)/this.spacing*this.gap},limit:function(){return this.isRange?this.fixed?[[0,(this.total-this.fixedValue)*this.gap],[this.fixedValue*this.gap,this.size]]:[[0,this.position[1]],[this.position[0],this.size]]:[0,this.size]},valueLimit:function(){return this.isRange?this.fixed?[[this.minimum,this.maximum-this.fixedValue*(this.spacing*this.multiple)/this.multiple],[this.minimum+this.fixedValue*(this.spacing*this.multiple)/this.multiple,this.maximum]]:[[this.minimum,this.currentValue[1]],[this.currentValue[0],this.maximum]]:[this.minimum,this.maximum]},idleSlider:function(){return 0===this.currentSlider?1:0},wrapStyles:function(){return"vertical"===this.direction?{height:"number"==typeof this.height?this.height+"px":this.height,padding:this.dotHeightVal/2+"px "+this.dotWidthVal/2+"px"}:{width:"number"==typeof this.width?this.width+"px":this.width,padding:this.dotHeightVal/2+"px "+this.dotWidthVal/2+"px"}},sliderStyles:function(){return Array.isArray(this.sliderStyle)?this.isRange?this.sliderStyle:this.sliderStyle[1]:"function"==typeof this.sliderStyle?this.sliderStyle(this.val,this.currentIndex):this.isRange?[this.sliderStyle,this.sliderStyle]:this.sliderStyle},focusStyles:function(){return Array.isArray(this.focusStyle)?this.isRange?this.focusStyle:this.focusStyle[1]:"function"==typeof this.focusStyle?this.focusStyle(this.val,this.currentIndex):this.isRange?[this.focusStyle,this.focusStyle]:this.focusStyle},disabledDotStyles:function(){var t=this.disabledDotStyle;if(Array.isArray(t))return t;if("function"==typeof t){var e=t(this.val,this.currentIndex);return Array.isArray(e)?e:[e,e]}return t?[t,t]:[{backgroundColor:"#ccc"},{backgroundColor:"#ccc"}]},tooltipStyles:function(){return Array.isArray(this.tooltipStyle)?this.isRange?this.tooltipStyle:this.tooltipStyle[1]:"function"==typeof this.tooltipStyle?this.tooltipStyle(this.val,this.currentIndex):this.isRange?[this.tooltipStyle,this.tooltipStyle]:this.tooltipStyle},elemStyles:function(){return"vertical"===this.direction?{width:this.width+"px",height:"100%"}:{height:this.height+"px"}},dotStyles:function(){return"vertical"===this.direction?{width:this.dotWidthVal+"px",height:this.dotHeightVal+"px",left:-(this.dotWidthVal-this.width)/2+"px"}:{width:this.dotWidthVal+"px",height:this.dotHeightVal+"px",top:-(this.dotHeightVal-this.height)/2+"px"}},piecewiseDotStyle:function(){return"vertical"===this.direction?{width:this.width+"px",height:this.width+"px"}:{width:this.height+"px",height:this.height+"px"}},piecewiseDotWrap:function(){if(!this.piecewise&&!this.piecewiseLabel)return!1;for(var t=[],e=0;e<=this.total;e++){var i="vertical"===this.direction?{bottom:this.gap*e-this.width/2+"px",left:0}:{left:this.gap*e-this.height/2+"px",top:0},s=this.reverse?this.total-e:e,r=this.data?this.data[s]:this.spacing*s+this.min;t.push({style:i,label:this.formatter?this.formatting(r):r,inRange:s>=this.indexRange[0]&&s<=this.indexRange[1]})}return t}},watch:{value:function(t){this.flag||this.setValue(t,!0)},max:function(t){if(tthis.max)return this.printError("The minimum value can not be greater than the maximum value.");var e=this.limitValue(this.val);this.setValue(e),this.refresh()},show:function(t){var e=this;t&&!this.size&&this.$nextTick(function(){e.refresh()})},fixed:function(){this.computedFixedValue()}},methods:{bindEvents:function(){document.addEventListener("touchmove",this.moving,{passive:!1}),document.addEventListener("touchend",this.moveEnd,{passive:!1}),document.addEventListener("mousedown",this.blurSlider),document.addEventListener("mousemove",this.moving),document.addEventListener("mouseup",this.moveEnd),document.addEventListener("mouseleave",this.moveEnd),document.addEventListener("keydown",this.handleKeydown),document.addEventListener("keyup",this.handleKeyup),window.addEventListener("resize",this.refresh),this.isRange&&this.tooltipMerge&&(this.$refs.dot0.addEventListener("transitionend",this.handleOverlapTooltip),this.$refs.dot1.addEventListener("transitionend",this.handleOverlapTooltip))},unbindEvents:function(){document.removeEventListener("touchmove",this.moving),document.removeEventListener("touchend",this.moveEnd),document.removeEventListener("mousedown",this.blurSlider),document.removeEventListener("mousemove",this.moving),document.removeEventListener("mouseup",this.moveEnd),document.removeEventListener("mouseleave",this.moveEnd),document.removeEventListener("keydown",this.handleKeydown),document.removeEventListener("keyup",this.handleKeyup),window.removeEventListener("resize",this.refresh),this.isRange&&this.tooltipMerge&&(this.$refs.dot0.removeEventListener("transitionend",this.handleOverlapTooltip),this.$refs.dot1.removeEventListener("transitionend",this.handleOverlapTooltip))},handleKeydown:function(t){if(!this.useKeyboard||!this.focusFlag)return!1;switch(t.keyCode){case 37:case 40:t.preventDefault(),this.keydownFlag=!0,this.flag=!0,this.changeFocusSlider(this.actionsKeyboard[0]);break;case 38:case 39:t.preventDefault(),this.keydownFlag=!0,this.flag=!0,this.changeFocusSlider(this.actionsKeyboard[1])}},handleKeyup:function(){this.keydownFlag&&(this.keydownFlag=!1,this.flag=!1)},changeFocusSlider:function(t){var e=this;if(this.isRange){var i=this.currentIndex.map(function(i,s){if(s===e.focusSlider||e.fixed){var r=t(i),o=e.fixed?e.valueLimit[s]:[0,e.total];if(r<=o[1]&&r>=o[0])return r}return i});i[0]>i[1]&&(this.focusSlider=0===this.focusSlider?1:0,i=i.reverse()),this.setIndex(i)}else this.setIndex(t(this.currentIndex))},blurSlider:function(t){var e=this.isRange?this.$refs["dot"+this.focusSlider]:this.$refs.dot;if(!e||e===t.target)return!1;this.focusFlag=!1},formatting:function(t){return"string"==typeof this.formatter?this.formatter.replace(/\{value\}/,t):this.formatter(t)},mergeFormatting:function(t,e){return"string"==typeof this.mergeFormatter?this.mergeFormatter.replace(/\{(value1|value2)\}/g,function(i,s){return"value1"===s?t:e}):this.mergeFormatter(t,e)},getPos:function(t){return this.realTime&&this.getStaticData(),"vertical"===this.direction?this.reverse?t.pageY-this.offset:this.size-(t.pageY-this.offset):this.reverse?this.size-(t.clientX-this.offset):t.clientX-this.offset},processClick:function(t){this.fixed&&t.stopPropagation()},wrapClick:function(t){var e=this;if(this.isDisabled||!this.clickable||this.processFlag)return!1;var i=this.getPos(t);if(this.isRange)if(this.disabledArray.every(function(t){return!1===t}))this.currentSlider=i>(this.position[1]-this.position[0])/2+this.position[0]?1:0;else if(this.disabledArray[0]){if(ithis.position[1])return!1;this.currentSlider=0}if(this.disabledArray[this.currentSlider])return!1;if(this.setValueOnPos(i),this.isRange&&this.tooltipMerge){var s=setInterval(function(){return e.handleOverlapTooltip()},16.7);setTimeout(function(){return window.clearInterval(s)},1e3*this.speed)}},moveStart:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments[2];if(this.disabledArray[e])return!1;if(this.stopPropagation&&t.stopPropagation(),this.isRange&&(this.currentSlider=e,i)){if(!this.processDragable)return!1;this.processFlag=!0,this.processSign={pos:this.position,start:this.getPos(t.targetTouches&&t.targetTouches[0]?t.targetTouches[0]:t)}}!i&&this.useKeyboard&&(this.focusFlag=!0,this.focusSlider=e),this.flag=!0,this.$emit("drag-start",this)},moving:function(t){if(this.stopPropagation&&t.stopPropagation(),!this.flag)return!1;t.preventDefault(),t.targetTouches&&t.targetTouches[0]&&(t=t.targetTouches[0]),this.processFlag?(this.currentSlider=0,this.setValueOnPos(this.processSign.pos[0]+this.getPos(t)-this.processSign.start,!0),this.currentSlider=1,this.setValueOnPos(this.processSign.pos[1]+this.getPos(t)-this.processSign.start,!0)):this.setValueOnPos(this.getPos(t),!0),this.isRange&&this.tooltipMerge&&this.handleOverlapTooltip()},moveEnd:function(t){var e=this;if(this.stopPropagation&&t.stopPropagation(),!this.flag)return!1;this.$emit("drag-end",this),this.lazy&&this.isDiff(this.val,this.value)&&this.syncValue(),this.flag=!1,window.setTimeout(function(){e.processFlag=!1},0),this.setPosition()},setValueOnPos:function(t,e){var i=this.isRange?this.limit[this.currentSlider]:this.limit,s=this.isRange?this.valueLimit[this.currentSlider]:this.valueLimit;if(t>=i[0]&&t<=i[1]){this.setTransform(t);var r=this.getValueByIndex(Math.round(t/this.gap));this.setCurrentValue(r,e),this.isRange&&this.fixed&&(this.setTransform(t+this.fixedValue*this.gap*(0===this.currentSlider?1:-1),!0),this.setCurrentValue((r*this.multiple+this.fixedValue*this.spacing*this.multiple*(0===this.currentSlider?1:-1))/this.multiple,e,!0))}else tthis.maximum)return!1;this.isRange?this.isDiff(this.currentValue[s],t)&&(this.currentValue.splice(s,1,t),this.lazy&&this.flag||this.syncValue()):this.isDiff(this.currentValue,t)&&(this.currentValue=t,this.lazy&&this.flag||this.syncValue()),e||this.setPosition()},getValueByIndex:function(t){return(this.spacing*this.multiple*t+this.minimum*this.multiple)/this.multiple},getIndexByValue:function(t){return Math.round((t-this.minimum)*this.multiple)/(this.spacing*this.multiple)},setIndex:function(t){if(Array.isArray(t)&&this.isRange){var e=void 0;e=this.data?[this.data[t[0]],this.data[t[1]]]:[this.getValueByIndex(t[0]),this.getValueByIndex(t[1])],this.setValue(e)}else t=this.getValueByIndex(t),this.isRange&&(this.currentSlider=t>(this.currentValue[1]-this.currentValue[0])/2+this.currentValue[0]?1:0),this.setCurrentValue(t)},setValue:function(t,e,i){var s=this;if(this.isDiff(this.val,t)){var r=this.limitValue(t);this.val=this.isRange?r.concat():r,this.computedFixedValue(),this.syncValue(e)}this.$nextTick(function(){return s.setPosition(i)})},computedFixedValue:function(){if(!this.fixed)return this.fixedValue=0,!1;this.fixedValue=this.currentIndex[1]-this.currentIndex[0]},setPosition:function(t){this.flag||this.setTransitionTime(void 0===t?this.speed:t),this.isRange?(this.setTransform(this.position[0],1===this.currentSlider),this.setTransform(this.position[1],0===this.currentSlider)):this.setTransform(this.position),this.flag||this.setTransitionTime(0)},setTransform:function(t,e){var i=e?this.idleSlider:this.currentSlider,r=s(("vertical"===this.direction?this.dotHeightVal/2-t:t-this.dotWidthVal/2)*(this.reverse?-1:1)),o="vertical"===this.direction?"translateY("+r+"px)":"translateX("+r+"px)",n=this.fixed?this.fixedValue*this.gap+"px":(0===i?this.position[1]-t:t-this.position[0])+"px",l=this.fixed?(0===i?t:t-this.fixedValue*this.gap)+"px":(0===i?t:this.position[0])+"px";this.isRange?(this.slider[i].style.transform=o,this.slider[i].style.WebkitTransform=o,this.slider[i].style.msTransform=o,"vertical"===this.direction?(this.$refs.process.style.height=n,this.$refs.process.style[this.reverse?"top":"bottom"]=l):(this.$refs.process.style.width=n,this.$refs.process.style[this.reverse?"right":"left"]=l)):(this.slider.style.transform=o,this.slider.style.WebkitTransform=o,this.slider.style.msTransform=o,"vertical"===this.direction?(this.$refs.process.style.height=t+"px",this.$refs.process.style[this.reverse?"top":"bottom"]=0):(this.$refs.process.style.width=t+"px",this.$refs.process.style[this.reverse?"right":"left"]=0))},setTransitionTime:function(t){if(t||this.$refs.process.offsetWidth,this.isRange){for(var e=0;ee.max?(e.printError("The value of the slider is "+t+", the maximum value is "+e.max+", the value of this slider can not be greater than the maximum value"),e.max):i};return this.isRange?t.map(function(t){return i(t)}):i(t)},syncValue:function(t){var e=this.isRange?this.val.concat():this.val;this.$emit("input",e),t||this.$emit("callback",e)},getValue:function(){return this.val},getIndex:function(){return this.currentIndex},getStaticData:function(){this.$refs.elem&&(this.size="vertical"===this.direction?this.$refs.elem.offsetHeight:this.$refs.elem.offsetWidth,this.offset="vertical"===this.direction?this.$refs.elem.getBoundingClientRect().top+window.pageYOffset||document.documentElement.scrollTop:this.$refs.elem.getBoundingClientRect().left)},refresh:function(){this.$refs.elem&&(this.getStaticData(),this.computedFixedValue(),this.setPosition())},printError:function(t){this.debug&&console.error("[VueSlider error]: "+t)},handleOverlapTooltip:function(){var t=this.tooltipDirection[0]===this.tooltipDirection[1];if(this.isRange&&t){var e=this.reverse?this.$refs.tooltip1:this.$refs.tooltip0,i=this.reverse?this.$refs.tooltip0:this.$refs.tooltip1,s=e.getBoundingClientRect().right,r=i.getBoundingClientRect().left,o=e.getBoundingClientRect().y,n=i.getBoundingClientRect().y+i.getBoundingClientRect().height,l="horizontal"===this.direction&&s>r,a="vertical"===this.direction&&n>o;l||a?this.handleDisplayMergedTooltip(!0):this.handleDisplayMergedTooltip(!1)}},handleDisplayMergedTooltip:function(t){var e=this.$refs.tooltip0,i=this.$refs.tooltip1,s=this.$refs.process.getElementsByClassName("vue-merged-tooltip")[0];t?(e.style.visibility="hidden",i.style.visibility="hidden",s.style.visibility="visible"):(e.style.visibility="visible",i.style.visibility="visible",s.style.visibility="hidden")}},mounted:function(){var t=this;if(this.isComponentExists=!0,"undefined"==typeof window||"undefined"==typeof document)return this.printError("window or document is undefined, can not be initialization.");this.$nextTick(function(){t.isComponentExists&&(t.getStaticData(),t.setValue(t.limitValue(t.value),!0,t.startAnimation?t.speed:0),t.bindEvents())}),this.isMounted=!0},beforeDestroy:function(){this.isComponentExists=!1,this.unbindEvents()}}},function(t,e,i){"use strict";var s=i(0);t.exports=s},function(t,e,i){e=t.exports=i(4)(),e.push([t.i,'.vue-slider-component{position:relative;box-sizing:border-box;-ms-user-select:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-o-user-select:none}.vue-slider-component.vue-slider-disabled{opacity:.5;cursor:not-allowed}.vue-slider-component.vue-slider-has-label{margin-bottom:15px}.vue-slider-component.vue-slider-disabled .vue-slider-dot{cursor:not-allowed}.vue-slider-component .vue-slider{position:relative;display:block;border-radius:15px;background-color:#ccc}.vue-slider-component .vue-slider:after{content:"";position:absolute;left:0;top:0;width:100%;height:100%;z-index:2}.vue-slider-component .vue-slider-process{position:absolute;border-radius:15px;background-color:#3498db;transition:all 0s;z-index:1}.vue-slider-component .vue-slider-process.vue-slider-process-dragable{cursor:pointer;z-index:3}.vue-slider-component.vue-slider-horizontal .vue-slider-process{width:0;height:100%;top:0;left:0;will-change:width}.vue-slider-component.vue-slider-vertical .vue-slider-process{width:100%;height:0;bottom:0;left:0;will-change:height}.vue-slider-component.vue-slider-horizontal-reverse .vue-slider-process{width:0;height:100%;top:0;right:0}.vue-slider-component.vue-slider-vertical-reverse .vue-slider-process{width:100%;height:0;top:0;left:0}.vue-slider-component .vue-slider-dot{position:absolute;border-radius:50%;background-color:#fff;box-shadow:.5px .5px 2px 1px rgba(0,0,0,.32);transition:all 0s;will-change:transform;cursor:pointer;z-index:5}.vue-slider-component .vue-slider-dot.vue-slider-dot-focus{box-shadow:0 0 2px 1px #3498db}.vue-slider-component .vue-slider-dot.vue-slider-dot-dragging{z-index:5}.vue-slider-component .vue-slider-dot.vue-slider-dot-disabled{z-index:4}.vue-slider-component.vue-slider-horizontal .vue-slider-dot{left:0}.vue-slider-component.vue-slider-vertical .vue-slider-dot{bottom:0}.vue-slider-component.vue-slider-horizontal-reverse .vue-slider-dot{right:0}.vue-slider-component.vue-slider-vertical-reverse .vue-slider-dot{top:0}.vue-slider-component .vue-slider-tooltip-wrap{display:none;position:absolute;z-index:9}.vue-slider-component .vue-slider-tooltip{display:block;font-size:14px;white-space:nowrap;padding:2px 5px;min-width:20px;text-align:center;color:#fff;border-radius:5px;border:1px solid #3498db;background-color:#3498db}.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-top{top:-9px;left:50%;transform:translate(-50%,-100%)}.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-bottom{bottom:-9px;left:50%;transform:translate(-50%,100%)}.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-left{top:50%;left:-9px;transform:translate(-100%,-50%)}.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-right{top:50%;right:-9px;transform:translate(100%,-50%)}.vue-slider-component .vue-slider-tooltip-top .vue-merged-tooltip .vue-slider-tooltip:before,.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-top .vue-slider-tooltip:before{content:"";position:absolute;bottom:-10px;left:50%;width:0;height:0;border:5px solid transparent;border:6px solid transparent\\0;border-top-color:inherit;transform:translate(-50%)}.vue-slider-component .vue-slider-tooltip-wrap.vue-merged-tooltip{display:block;visibility:hidden}.vue-slider-component .vue-slider-tooltip-bottom .vue-merged-tooltip .vue-slider-tooltip:before,.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-bottom .vue-slider-tooltip:before{content:"";position:absolute;top:-10px;left:50%;width:0;height:0;border:5px solid transparent;border:6px solid transparent\\0;border-bottom-color:inherit;transform:translate(-50%)}.vue-slider-component .vue-slider-tooltip-left .vue-merged-tooltip .vue-slider-tooltip:before,.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-left .vue-slider-tooltip:before{content:"";position:absolute;top:50%;right:-10px;width:0;height:0;border:5px solid transparent;border:6px solid transparent\\0;border-left-color:inherit;transform:translateY(-50%)}.vue-slider-component .vue-slider-tooltip-right .vue-merged-tooltip .vue-slider-tooltip:before,.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-right .vue-slider-tooltip:before{content:"";position:absolute;top:50%;left:-10px;width:0;height:0;border:5px solid transparent;border:6px solid transparent\\0;border-right-color:inherit;transform:translateY(-50%)}.vue-slider-component .vue-slider-dot.vue-slider-hover:hover .vue-slider-tooltip-wrap{display:block}.vue-slider-component .vue-slider-dot.vue-slider-always .vue-slider-tooltip-wrap{display:block!important}.vue-slider-component .vue-slider-piecewise{position:absolute;width:100%;padding:0;margin:0;left:0;top:0;height:100%;list-style:none}.vue-slider-component .vue-slider-piecewise-item{position:absolute;width:8px;height:8px}.vue-slider-component .vue-slider-piecewise-dot{position:absolute;left:50%;top:50%;width:100%;height:100%;display:inline-block;background-color:rgba(0,0,0,.16);border-radius:50%;transform:translate(-50%,-50%);z-index:2;transition:all .3s}.vue-slider-component .vue-slider-piecewise-item:first-child .vue-slider-piecewise-dot,.vue-slider-component .vue-slider-piecewise-item:last-child .vue-slider-piecewise-dot{visibility:hidden}.vue-slider-component.vue-slider-horizontal-reverse .vue-slider-piecewise-label,.vue-slider-component.vue-slider-horizontal .vue-slider-piecewise-label{position:absolute;display:inline-block;top:100%;left:50%;white-space:nowrap;font-size:12px;color:#333;transform:translate(-50%,8px);visibility:visible}.vue-slider-component.vue-slider-vertical-reverse .vue-slider-piecewise-label,.vue-slider-component.vue-slider-vertical .vue-slider-piecewise-label{position:absolute;display:inline-block;top:50%;left:100%;white-space:nowrap;font-size:12px;color:#333;transform:translate(8px,-50%);visibility:visible}.vue-slider-component .vue-slider-sr-only{clip:rect(1px,1px,1px,1px);height:1px;width:1px;overflow:hidden;position:absolute!important}',""])},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;ei.parts.length&&(s.parts.length=i.parts.length)}else{for(var n=[],r=0;r Date: Thu, 23 Aug 2018 18:41:56 +0530 Subject: [PATCH 03/12] Customer Account Section Mostly Completed Upto 80% --- .../Resources/views/account/edit.blade.php | 2 +- .../src/Repositories/SliderRepository.php | 2 +- .../Http/Controllers/AddressController.php | 132 ++++++++++++++++++ .../Http/Controllers/CustomerController.php | 104 ++++++++++++-- .../src/Http/Controllers/OrdersController.php | 59 ++++++++ .../Controllers/RegistrationController.php | 17 ++- .../Http/Controllers/ReviewsController.php | 59 ++++++++ .../Http/Controllers/SessionController.php | 5 +- .../Http/Controllers/WishlistController.php | 59 ++++++++ packages/Webkul/Customer/src/Menu.php | 22 +++ .../Webkul/Customer/src/Models/Customer.php | 1 + .../src/Providers/EventServiceProvider.php | 13 +- .../CustomerAddressRepository.php | 54 +++++++ .../src/Repositories/CustomerRepository.php | 4 +- .../src/Http/Controllers/HomeController.php | 4 +- packages/Webkul/Shop/src/Http/routes.php | 73 ++++++++-- .../src/Providers/EventServiceProvider.php | 41 ------ .../Shop/src/Resources/assets/js/app.js | 2 - .../assets/js/components/category-nav.vue | 2 +- .../Shop/src/Resources/assets/sass/app.scss | 30 +++- .../account/address/address.blade.php | 63 +++++++++ .../account/address/create.blade.php | 59 ++++++++ .../customers/account/address/edit.blade.php | 59 ++++++++ .../views/customers/account/index.blade.php | 7 + .../customers/account/orders/orders.blade.php | 1 + .../account/partials/sidemenu.blade.php | 4 +- .../customers/account/profile/edit.blade.php | 70 +++++----- .../account/reviews/reviews.blade.php | 1 + .../account/wishlist/wishlist.blade.php | 1 + .../src/Resources/views/home/slider.blade.php | 2 +- .../views/layouts/header/index.blade.php | 48 +++++-- .../{view => cart}/cart/index.blade.php | 0 .../product/{view => cart}/compare.blade.php | 0 .../{view => cart}/sharelinks.blade.php | 0 .../store/product/view/wishlist.blade.php | 0 public/themes/default/assets/css/shop.css | 31 +++- public/themes/default/assets/js/shop.js | 7 +- 37 files changed, 904 insertions(+), 134 deletions(-) create mode 100644 packages/Webkul/Customer/src/Http/Controllers/AddressController.php create mode 100644 packages/Webkul/Customer/src/Http/Controllers/OrdersController.php create mode 100644 packages/Webkul/Customer/src/Http/Controllers/ReviewsController.php create mode 100644 packages/Webkul/Customer/src/Http/Controllers/WishlistController.php create mode 100644 packages/Webkul/Customer/src/Repositories/CustomerAddressRepository.php delete mode 100644 packages/Webkul/Shop/src/Providers/EventServiceProvider.php create mode 100644 packages/Webkul/Shop/src/Resources/views/customers/account/address/address.blade.php create mode 100644 packages/Webkul/Shop/src/Resources/views/customers/account/address/create.blade.php create mode 100644 packages/Webkul/Shop/src/Resources/views/customers/account/address/edit.blade.php create mode 100644 packages/Webkul/Shop/src/Resources/views/customers/account/index.blade.php create mode 100644 packages/Webkul/Shop/src/Resources/views/customers/account/orders/orders.blade.php create mode 100644 packages/Webkul/Shop/src/Resources/views/customers/account/reviews/reviews.blade.php create mode 100644 packages/Webkul/Shop/src/Resources/views/customers/account/wishlist/wishlist.blade.php rename packages/Webkul/Shop/src/Resources/views/store/product/{view => cart}/cart/index.blade.php (100%) rename packages/Webkul/Shop/src/Resources/views/store/product/{view => cart}/compare.blade.php (100%) rename packages/Webkul/Shop/src/Resources/views/store/product/{view => cart}/sharelinks.blade.php (100%) delete mode 100644 packages/Webkul/Shop/src/Resources/views/store/product/view/wishlist.blade.php diff --git a/packages/Webkul/Admin/src/Resources/views/account/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/account/edit.blade.php index 75f44f617..5eed7df25 100644 --- a/packages/Webkul/Admin/src/Resources/views/account/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/account/edit.blade.php @@ -18,7 +18,7 @@
- +
@csrf() diff --git a/packages/Webkul/Core/src/Repositories/SliderRepository.php b/packages/Webkul/Core/src/Repositories/SliderRepository.php index 6c6bff0c0..766a0bcd8 100644 --- a/packages/Webkul/Core/src/Repositories/SliderRepository.php +++ b/packages/Webkul/Core/src/Repositories/SliderRepository.php @@ -28,7 +28,7 @@ class SliderRepository extends Repository */ public function create(array $data) { - $image = request()->hasFile('image'); + $image = request()->file('image'); $image_name = uniqid(20).'.'.$image->getClientOriginalExtension(); diff --git a/packages/Webkul/Customer/src/Http/Controllers/AddressController.php b/packages/Webkul/Customer/src/Http/Controllers/AddressController.php new file mode 100644 index 000000000..1b2915b31 --- /dev/null +++ b/packages/Webkul/Customer/src/Http/Controllers/AddressController.php @@ -0,0 +1,132 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class AddressController extends Controller +{ + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + protected $_config; + protected $customer; + protected $address; + + + public function __construct(CustomerRepository $customer, CustomerAddressRepository $address) + { + + $this->middleware('auth:customer'); + $this->_config = request('_config'); + $this->customer = $customer; + $this->address = $address; + + } + + /** + * Getting logged in + * customer helper + * @return Array + */ + private function getCustomer($id) { + $customer = collect($this->customer->findOneWhere(['id'=>$id])); + + return $customer; + } + + /** + * Getting logged in + * customer address + * helper + * @return Array + */ + private function getAddress($id) { + $address = collect($this->address->findOneWhere(['id'=>$id])); + + return $address; + } + + + /** + * Address Route + * index page + * @return View + */ + public function index() { + $id = auth()->guard('customer')->user()->id; + + $customer = $this->getCustomer($id); + + $address = $this->getAddress($id); + + if(count($address)==0) + return view($this->_config['view'])->with('address', 'You don\'t have any addresses saved yet, create new.'); + else + return view($this->_config['view'])->with('address', $address); + } + + /** + * Show the address + * create form + * @return View + */ + public function show() { + return view($this->_config['view']); + } + + /** + * Create a new + * address for + * customer. + * + * @return View + */ + public function create() { + + $id = auth()->guard('customer')->user()->id; + + $this->validate(request(), [ + + 'address1' => 'string|required', + 'address1' => 'string|required', + 'country' => 'string|required', + 'state' => 'string|required', + 'city' => 'string|required', + 'pincode' => 'numeric|required', + + ]); + + $data = collect(request()->input())->except('_token')->toArray(); + dd($data); + + } + + /** + * For editing the + * existing address + * of the customer + * + * @return View + */ + public function edit() { + + return view($this->_config['view']); + + } +} diff --git a/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php b/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php index 026436d4e..dd73d4904 100644 --- a/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php +++ b/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php @@ -4,8 +4,9 @@ namespace Webkul\Customer\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Http\Response; -use Illuminate\Routing\Controller; +use Webkul\Customer\Repositories\CustomerRepository; use Webkul\Customer\Models\Customer; +use Auth; /** * Customer controlller for the customer @@ -24,10 +25,14 @@ class CustomerController extends Controller * @return \Illuminate\Http\Response */ protected $_config; + protected $customer; - public function __construct() + + public function __construct(CustomerRepository $customer) { $this->_config = request('_config'); + $this->customer = $customer; + $this->middleware('auth:customer'); } /** @@ -36,23 +41,104 @@ class CustomerController extends Controller * authentication * @return view */ - private function getCustomer($id) - { - $customer = collect(Customer::find($id)); + private function getCustomer($id) { + $customer = collect($this->customer->findOneWhere(['id'=>$id])); return $customer; } - public function profile() - { + /** + * Taking the customer + * to profile details + * page + * @return View + */ + public function index() { $id = auth()->guard('customer')->user()->id; + $customer = $this->getCustomer($id); + return view($this->_config['view'])->with('customer', $customer); } - public function editProfile() - { + /** + * For loading the + * edit form page. + * + * @return View + */ + public function editIndex() { $id = auth()->guard('customer')->user()->id; + $customer = $this->getCustomer($id); + return view($this->_config['view'])->with('customer', $customer); } + + /** + * Edit function + * for editing customer + * profile. + * + * @return Redirect. + */ + public function edit() { + + $id = auth()->guard('customer')->user()->id; + + $this->validate(request(), [ + + 'first_name' => 'string', + 'last_name' => 'string', + 'gender' => 'required', + 'date_of_birth' => 'date', + 'phone' => 'string|size:10', + 'email' => 'email|unique:customers,email,'.$id, + 'password' => 'confirmed|required_if:oldpassword,!=,null' + + ]); + + $data = collect(request()->input())->except('_token')->toArray(); + + if($data['oldpassword'] == null) { + + $data = collect(request()->input())->except(['_token','password','password_confirmation','oldpassword'])->toArray(); + if($this->customer->update($data, $id)) { + Session()->flash('success','Profile Updated Successfully'); + return redirect()->back(); + } else { + Session()->flash('success','Profile Updated Successfully'); + return redirect()->back(); + } + + } else { + + $data = collect(request()->input())->except(['_token','oldpassword'])->toArray(); + + $data['password'] = bcrypt($data['password']); + + if($this->customer->update($data, $id)) { + Session()->flash('success','Profile Updated Successfully'); + return redirect()->back(); + } else { + Session()->flash('success','Profile Updated Successfully'); + return redirect()->back(); + } + } + } + + public function orders() { + return view($this->_config['view']); + } + + public function wishlist() { + return view($this->_config['view']); + } + + public function reviews() { + return view($this->_config['view']); + } + + public function address() { + return view($this->_config['view']); + } } diff --git a/packages/Webkul/Customer/src/Http/Controllers/OrdersController.php b/packages/Webkul/Customer/src/Http/Controllers/OrdersController.php new file mode 100644 index 000000000..460b1a201 --- /dev/null +++ b/packages/Webkul/Customer/src/Http/Controllers/OrdersController.php @@ -0,0 +1,59 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class OrdersController extends Controller +{ + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + protected $_config; + protected $customer; + + + public function __construct(CustomerRepository $customer) + { + $this->_config = request('_config'); + $this->customer = $customer; + $this->middleware('auth:customer'); + } + + /** + * For taking the customer + * to the dashboard after + * authentication + * @return view + */ + private function getCustomer($id) { + $customer = collect($this->customer->findOneWhere(['id'=>$id])); + return $customer; + } + + public function index() { + $id = auth()->guard('customer')->user()->id; + + $customer = $this->getCustomer($id); + + return view($this->_config['view'])->with('customer', $customer); + } + + public function orders() { + return view($this->_config['view']); + } +} diff --git a/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php b/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php index 9a5a4c374..c06755239 100644 --- a/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php +++ b/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php @@ -8,7 +8,7 @@ use Illuminate\Routing\Controller; use Webkul\Customer\Repositories\CustomerRepository; /** - * Dashboard controller + * Registration controller * * @author Prashant Singh * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) @@ -21,10 +21,13 @@ class RegistrationController extends Controller * @return \Illuminate\Http\Response */ protected $_config; + protected $customer; - public function __construct() + + public function __construct(CustomerRepository $customer) { $this->_config = request('_config'); + $this->customer = $customer; } /** @@ -43,7 +46,7 @@ class RegistrationController extends Controller */ public function create(Request $request) { - // return $request->except('_token'); //don't let csrf token to be openly printed + $request->validate([ 'first_name' => 'string|required', @@ -53,13 +56,9 @@ class RegistrationController extends Controller ]); - $customer = new \Webkul\Customer\Models\Customer(); - $customer->first_name = $request->first_name; - $customer->last_name = $request->last_name; - $customer->email = $request->email; - $customer->password = bcrypt($request->password); + $registrationData = $request->except('_token'); - if ($customer->save()) { + if ($this->customer->create($registrationData)) { session()->flash('success', 'Account created successfully.'); return redirect()->route($this->_config['redirect']); diff --git a/packages/Webkul/Customer/src/Http/Controllers/ReviewsController.php b/packages/Webkul/Customer/src/Http/Controllers/ReviewsController.php new file mode 100644 index 000000000..15492c13c --- /dev/null +++ b/packages/Webkul/Customer/src/Http/Controllers/ReviewsController.php @@ -0,0 +1,59 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class ReviewsController extends Controller +{ + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + protected $_config; + protected $customer; + + + public function __construct(CustomerRepository $customer) + { + $this->_config = request('_config'); + $this->customer = $customer; + $this->middleware('auth:customer'); + } + + /** + * For taking the customer + * to the dashboard after + * authentication + * @return view + */ + private function getCustomer($id) { + $customer = collect($this->customer->findOneWhere(['id'=>$id])); + return $customer; + } + + public function index() { + $id = auth()->guard('customer')->user()->id; + + $customer = $this->getCustomer($id); + + return view($this->_config['view'])->with('customer', $customer); + } + + public function reviews() { + return view($this->_config['view']); + } +} diff --git a/packages/Webkul/Customer/src/Http/Controllers/SessionController.php b/packages/Webkul/Customer/src/Http/Controllers/SessionController.php index 81c56d2b5..f796cd66b 100644 --- a/packages/Webkul/Customer/src/Http/Controllers/SessionController.php +++ b/packages/Webkul/Customer/src/Http/Controllers/SessionController.php @@ -25,6 +25,7 @@ class SessionController extends Controller public function __construct() { $this->_config = request('_config'); + $this->middleware('auth:customer')->except(['show','create']); } public function show() @@ -39,11 +40,9 @@ class SessionController extends Controller 'password' => 'required' ]); - // $remember = request('remember'); if (!auth()->guard('customer')->attempt(request(['email', 'password']))) { - dd('cannot be authorized'); - session()->flash('error', 'Please check your credentials and try again.'); + session()->flash('error', 'Please check your credentials and try again.'); return back(); } diff --git a/packages/Webkul/Customer/src/Http/Controllers/WishlistController.php b/packages/Webkul/Customer/src/Http/Controllers/WishlistController.php new file mode 100644 index 000000000..b9682baae --- /dev/null +++ b/packages/Webkul/Customer/src/Http/Controllers/WishlistController.php @@ -0,0 +1,59 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class WishlistController extends Controller +{ + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + protected $_config; + protected $customer; + + + public function __construct(CustomerRepository $customer) + { + $this->_config = request('_config'); + $this->customer = $customer; + $this->middleware('auth:customer'); + } + + /** + * For taking the customer + * to the dashboard after + * authentication + * @return view + */ + private function getCustomer($id) { + $customer = collect($this->customer->findOneWhere(['id'=>$id])); + return $customer; + } + + public function index() { + $id = auth()->guard('customer')->user()->id; + + $customer = $this->getCustomer($id); + + return view($this->_config['view'])->with('customer', $customer); + } + + public function wishlist() { + return view($this->_config['view']); + } +} diff --git a/packages/Webkul/Customer/src/Menu.php b/packages/Webkul/Customer/src/Menu.php index 1c367d27f..c4438b884 100644 --- a/packages/Webkul/Customer/src/Menu.php +++ b/packages/Webkul/Customer/src/Menu.php @@ -9,6 +9,13 @@ use Illuminate\Support\Facades\URL; class Menu { public $items = array(); + public $current; + public $currentKey; + + public function __construct() { + $this->current = Request::url(); + } + public static function create($callback) { @@ -26,4 +33,19 @@ class Menu ]; array_push($this->items, $item); } + + /** + * Method to find the active links + * + * @param array $item Item that + * needs to be checked if active + * @return string + */ + public function getActive($item) + { + $url = trim($item['url'], '/'); + if ((strpos($this->current, $url) !== false) || (strpos($this->currentKey, $item['key']) === 0)) { + return 'active'; + } + } } diff --git a/packages/Webkul/Customer/src/Models/Customer.php b/packages/Webkul/Customer/src/Models/Customer.php index a60bcb687..d75c7d0cc 100644 --- a/packages/Webkul/Customer/src/Models/Customer.php +++ b/packages/Webkul/Customer/src/Models/Customer.php @@ -15,5 +15,6 @@ class Customer extends Authenticatable use Notifiable; protected $table = 'customers'; + protected $fillable = ['first_name','last_name','gender','date_of_birth','phone','email','password']; protected $hidden = ['password','remember_token']; } diff --git a/packages/Webkul/Customer/src/Providers/EventServiceProvider.php b/packages/Webkul/Customer/src/Providers/EventServiceProvider.php index fbf04f319..b322a94b0 100644 --- a/packages/Webkul/Customer/src/Providers/EventServiceProvider.php +++ b/packages/Webkul/Customer/src/Providers/EventServiceProvider.php @@ -34,8 +34,17 @@ class EventServiceProvider extends ServiceProvider }); Event::listen('customer.menu.build', function ($menu) { - $menu->add('customer.account.profile', 'Profile'); - $menu->add('customer.account.profile', 'Wishlist'); + + $menu->add('customer.profile.index', 'Profile'); + + $menu->add('customer.orders.index', 'Orders'); + + $menu->add('customer.address.index', 'Address'); + + $menu->add('customer.reviews.index', 'Reviews'); + + $menu->add('customer.wishlist.index', 'Wishlist'); + }); } } diff --git a/packages/Webkul/Customer/src/Repositories/CustomerAddressRepository.php b/packages/Webkul/Customer/src/Repositories/CustomerAddressRepository.php new file mode 100644 index 000000000..b766536a4 --- /dev/null +++ b/packages/Webkul/Customer/src/Repositories/CustomerAddressRepository.php @@ -0,0 +1,54 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ + +class CustomerAddressRepository extends Repository +{ + /** + * Specify Model class name + * + * @return mixed + */ + + function model() + { + return 'Webkul\Customer\Models\CustomersAddress'; + } + + /** + * @param array $data + * @return mixed + */ + + public function create(array $data) + { + $address = $this->model->create($data); + + return $address; + } + + /** + * @param array $data + * @param $id + * @param string $attribute + * @return mixed + */ + + public function update(array $data, $id, $attribute = "id") + { + $address = $this->find($id); + + $address->update($data); + + return $address; + } +} \ No newline at end of file diff --git a/packages/Webkul/Customer/src/Repositories/CustomerRepository.php b/packages/Webkul/Customer/src/Repositories/CustomerRepository.php index 94a26a67d..c341fb4cb 100644 --- a/packages/Webkul/Customer/src/Repositories/CustomerRepository.php +++ b/packages/Webkul/Customer/src/Repositories/CustomerRepository.php @@ -2,7 +2,7 @@ namespace Webkul\Customer\Repositories; -use Webkul\Customer\Eloquent\Repository; +use Webkul\Core\Eloquent\Repository; /** * Customer Reposotory @@ -45,7 +45,7 @@ class CustomerRepository extends Repository public function update(array $data, $id, $attribute = "id") { - $customer = $this->findOrFail($id); + $customer = $this->find($id); $customer->update($data); diff --git a/packages/Webkul/Shop/src/Http/Controllers/HomeController.php b/packages/Webkul/Shop/src/Http/Controllers/HomeController.php index 10a2d086d..8547cf847 100644 --- a/packages/Webkul/Shop/src/Http/Controllers/HomeController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/HomeController.php @@ -31,8 +31,8 @@ use Webkul\Channel\Channel as Channel; $current_channel = core()->getCurrentChannel(); - $all_sliders = $this->sliders->findOneWhere(['channel_id'=>$current_channel['id']]); + $all_sliders = $this->sliders->findWhere(['channel_id'=>$current_channel['id']]); - return view($this->_config['view'])->with('data',$all_sliders); + return view($this->_config['view'])->with('sliderData',$all_sliders->toArray()); } } diff --git a/packages/Webkul/Shop/src/Http/routes.php b/packages/Webkul/Shop/src/Http/routes.php index fb4f35c5e..69ad8d0ae 100644 --- a/packages/Webkul/Shop/src/Http/routes.php +++ b/packages/Webkul/Shop/src/Http/routes.php @@ -4,14 +4,12 @@ Route::group(['middleware' => ['web']], function () { Route::get('/', 'Webkul\Shop\Http\Controllers\HomeController@index')->defaults('_config', [ 'view' => 'shop::home.index' - ]); + ])->name('store.home'); Route::get('/categories/{slug}', 'Webkul\Shop\Http\Controllers\CategoryController@index')->defaults('_config', [ 'view' => 'shop::products.index' ]); - Route::view('/cart', 'shop::store.product.view.cart.index'); - Route::view('/products/{slug}', 'shop::store.product.details.index'); //customer routes starts here @@ -23,7 +21,7 @@ Route::group(['middleware' => ['web']], function () { ])->name('customer.session.index'); Route::post('login', 'Webkul\Customer\Http\Controllers\SessionController@create')->defaults('_config', [ - 'redirect' => 'customer.account.profile' + 'redirect' => 'customer.account.index' ])->name('customer.session.create'); @@ -33,7 +31,7 @@ Route::group(['middleware' => ['web']], function () { ])->name('customer.register.index'); Route::post('register', 'Webkul\Customer\Http\Controllers\RegistrationController@create')->defaults('_config', [ - 'redirect' => 'customer.account.profile', + 'redirect' => 'customer.account.index', ])->name('customer.register.create'); //redirect attribute will get changed immediately to account.index when account's index page will be made // Auth Routes @@ -44,16 +42,75 @@ Route::group(['middleware' => ['web']], function () { 'redirect' => 'customer.session.index' ])->name('customer.session.destroy'); + Route::view('/cart', 'shop::store.product.view.cart.index')->name('customer.cart'); + + Route::view('/product', 'shop::store.product.details.home.index')->name('customer.product'); + + Route::view('/product/review', 'shop::store.product.review.index')->name('customer.product.review'); + //customer account Route::prefix('account')->group(function () { - Route::get('profile', 'Webkul\Customer\Http\Controllers\CustomerController@profile')->defaults('_config', [ + + Route::get('account/index', 'Webkul\Customer\Http\Controllers\AccountController@index')->defaults('_config', [ + 'view' => 'shop::customers.account.index' + ])->name('customer.account.index'); + + + /* Profile Routes Starts Here */ + Route::get('profile', 'Webkul\Customer\Http\Controllers\CustomerController@index')->defaults('_config', [ 'view' => 'shop::customers.account.profile.index' - ])->name('customer.account.profile'); + ])->name('customer.profile.index'); //profile edit - Route::get('profile/edit', 'Webkul\Customer\Http\Controllers\CustomerController@editProfile')->defaults('_config', [ + Route::get('profile/edit', 'Webkul\Customer\Http\Controllers\CustomerController@editIndex')->defaults('_config', [ 'view' => 'shop::customers.account.profile.edit' ])->name('customer.profile.edit'); + + Route::post('profile/edit', 'Webkul\Customer\Http\Controllers\CustomerController@edit')->defaults('_config', [ + 'view' => 'shop::customers.account.profile.edit' + ])->name('customer.profile.edit'); + /* Profile Routes Ends Here */ + + + /* Routes for Addresses */ + + Route::get('address/index', 'Webkul\Customer\Http\Controllers\AddressController@index')->defaults('_config', [ + 'view' => 'shop::customers.account.address.address' + ])->name('customer.address.index'); + + Route::get('address/create', 'Webkul\Customer\Http\Controllers\AddressController@show')->defaults('_config', [ + 'view' => 'shop::customers.account.address.create' + ])->name('customer.address.create'); + + Route::post('address/create', 'Webkul\Customer\Http\Controllers\AddressController@create')->defaults('_config', [ + 'view' => 'shop::customers.account.address.address' + ])->name('customer.address.create'); + + Route::get('address/edit', 'Webkul\Customer\Http\Controllers\AddressController@edit')->defaults('_config', [ + 'view' => 'shop::customers.account.address.address' + ])->name('customer.address.edit'); + + Route::post('address/edit', 'Webkul\Customer\Http\Controllers\AddressController@edit')->defaults('_config', [ + 'view' => 'shop::customers.account.address.address' + ])->name('customer.address.edit'); + + /* Routes for Addresses ends here */ + + /* Wishlist route */ + Route::get('wishlist', 'Webkul\Customer\Http\Controllers\WishlistController@wishlist')->defaults('_config', [ + 'view' => 'shop::customers.account.wishlist.wishlist' + ])->name('customer.wishlist.index'); + + /* Orders route */ + Route::get('orders', 'Webkul\Customer\Http\Controllers\OrdersController@orders')->defaults('_config', [ + 'view' => 'shop::customers.account.orders.orders' + ])->name('customer.orders.index'); + + /* Reviews route */ + Route::get('reviews', 'Webkul\Customer\Http\Controllers\CustomerController@reviews')->defaults('_config', [ + 'view' => 'shop::customers.account.reviews.reviews' + ])->name('customer.reviews.index'); + }); }); }); diff --git a/packages/Webkul/Shop/src/Providers/EventServiceProvider.php b/packages/Webkul/Shop/src/Providers/EventServiceProvider.php deleted file mode 100644 index c7d186ceb..000000000 --- a/packages/Webkul/Shop/src/Providers/EventServiceProvider.php +++ /dev/null @@ -1,41 +0,0 @@ -createStoreNavigationMenu(); - } - - /** - * This method fires an event for menu creation, any package can add their menu item by listening to the customer.menu.build event - * - * @return void - */ - - public function createStoreNavigationMenu() - { - Event::listen('shop.navmenu.create', function () { - return Menu::create(function ($menu) { - Event::fire('shop.navmenu.build', $menu); - }); - }); - - Event::listen('shop.navmenu.build', function ($menu) { - $menu->add('customer.account.profile', 'Profile'); - $menu->add('customer.account.profile', 'Wishlist'); - }); - } -} diff --git a/packages/Webkul/Shop/src/Resources/assets/js/app.js b/packages/Webkul/Shop/src/Resources/assets/js/app.js index abf46b3f1..320d65719 100644 --- a/packages/Webkul/Shop/src/Resources/assets/js/app.js +++ b/packages/Webkul/Shop/src/Resources/assets/js/app.js @@ -4,8 +4,6 @@ window.VeeValidate = require("vee-validate"); Vue.use(VeeValidate); -//pure JS for resizing of browser purposes only - Vue.component("category-nav", require("./components/category-nav.vue")); Vue.component("category-item", require("./components/category-item.vue")); Vue.component("image-slider", require("./components/image-slider.vue")); diff --git a/packages/Webkul/Shop/src/Resources/assets/js/components/category-nav.vue b/packages/Webkul/Shop/src/Resources/assets/js/components/category-nav.vue index d879344c0..9be108eb3 100644 --- a/packages/Webkul/Shop/src/Resources/assets/js/components/category-nav.vue +++ b/packages/Webkul/Shop/src/Resources/assets/js/components/category-nav.vue @@ -9,7 +9,7 @@ :parent="index">
  • - + Offer Zone
  • diff --git a/packages/Webkul/Shop/src/Resources/assets/sass/app.scss b/packages/Webkul/Shop/src/Resources/assets/sass/app.scss index e64447c18..370ec7785 100644 --- a/packages/Webkul/Shop/src/Resources/assets/sass/app.scss +++ b/packages/Webkul/Shop/src/Resources/assets/sass/app.scss @@ -849,11 +849,12 @@ section.slider-block { //edit form .edit-form-content { + padding: 0px 25px; margin-left: 5.5%; margin-top: 1%; width: 100%; - .edit-text { + .title { margin-bottom: 2%; margin-left: auto; margin-right: auto; @@ -863,13 +864,36 @@ section.slider-block { .edit-form { display: flex; background: $background-color; - border: 1px solid $border-color; flex-direction: column; min-height: 345px; - padding: 25px; + // padding: 25px; } } //edit form ends + + //address form + .address-form-content { + padding: 0px 25px; + margin-left: 5.5%; + margin-top: 1%; + width: 100%; + + .title { + margin-bottom: 2%; + margin-left: auto; + margin-right: auto; + font-size: 24px; + } + + .address-form { + display: flex; + background: $background-color; + flex-direction: column; + min-height: 345px; + // padding: 25px; + } + } + //address form ends } //account ends here diff --git a/packages/Webkul/Shop/src/Resources/views/customers/account/address/address.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/account/address/address.blade.php new file mode 100644 index 000000000..fe36c39c2 --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/views/customers/account/address/address.blade.php @@ -0,0 +1,63 @@ +@extends('shop::layouts.master') + +@section('content-wrapper') + + +@endsection diff --git a/packages/Webkul/Shop/src/Resources/views/customers/account/address/create.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/account/address/create.blade.php new file mode 100644 index 000000000..fdaa493b2 --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/views/customers/account/address/create.blade.php @@ -0,0 +1,59 @@ +@extends('shop::layouts.master') +@section('content-wrapper') + +@endsection \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/customers/account/address/edit.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/account/address/edit.blade.php new file mode 100644 index 000000000..a4e388ae6 --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/views/customers/account/address/edit.blade.php @@ -0,0 +1,59 @@ +@extends('shop::layouts.master') +@section('content-wrapper') + +@endsection \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/customers/account/index.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/account/index.blade.php new file mode 100644 index 000000000..32640604a --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/views/customers/account/index.blade.php @@ -0,0 +1,7 @@ +@extends('shop::layouts.master') +@section('content-wrapper') + +@endsection \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/customers/account/orders/orders.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/account/orders/orders.blade.php new file mode 100644 index 000000000..2cff69535 --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/views/customers/account/orders/orders.blade.php @@ -0,0 +1 @@ +

    Customer past orders page

    \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/customers/account/partials/sidemenu.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/account/partials/sidemenu.blade.php index b2be2cd51..89f5c97b0 100644 --- a/packages/Webkul/Shop/src/Resources/views/customers/account/partials/sidemenu.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/customers/account/partials/sidemenu.blade.php @@ -1,5 +1,7 @@ diff --git a/packages/Webkul/Shop/src/Resources/views/customers/account/profile/edit.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/account/profile/edit.blade.php index c28a6d0ef..8ca2f9afd 100644 --- a/packages/Webkul/Shop/src/Resources/views/customers/account/profile/edit.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/customers/account/profile/edit.blade.php @@ -7,63 +7,67 @@
    -
    Edit Profile
    +
    Edit Profile
    -
    +
    + @csrf - {{ csrf_field() }} - -
    +
    - @{{ errors.first('first_name') }} + @{{ errors.first('first_name') }}
    -
    +
    - @{{ errors.first('last_name') }} + @{{ errors.first('last_name') }}
    -
    +
    + + + @{{ errors.first('gender') }} +
    + +
    + + + @{{ errors.first('date_of_birth') }} +
    + +
    + + + @{{ errors.first('phone') }} +
    + +
    - @{{ errors.first('email') }} + @{{ errors.first('email') }}
    -
    - - - @{{ errors.first('gender') }} +
    + + + @{{ errors.first('oldpassword') }}
    -
    - - - @{{ errors.first('first_name') }} -
    - -
    - - - @{{ errors.first('phone') }} -
    - -
    +
    - @{{ errors.first('password') }} + @{{ errors.first('password') }}
    -
    - + @{{ errors.first('password') }}
    diff --git a/packages/Webkul/Shop/src/Resources/views/customers/account/reviews/reviews.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/account/reviews/reviews.blade.php new file mode 100644 index 000000000..3f4fd72c8 --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/views/customers/account/reviews/reviews.blade.php @@ -0,0 +1 @@ +

    Customer Reviews page

    \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/customers/account/wishlist/wishlist.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/account/wishlist/wishlist.blade.php new file mode 100644 index 000000000..739f3967f --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/views/customers/account/wishlist/wishlist.blade.php @@ -0,0 +1 @@ +

    Wishlist page here

    \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/home/slider.blade.php b/packages/Webkul/Shop/src/Resources/views/home/slider.blade.php index 28489f1a9..b63b8efad 100644 --- a/packages/Webkul/Shop/src/Resources/views/home/slider.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/home/slider.blade.php @@ -1,3 +1,3 @@
    - +
    diff --git a/packages/Webkul/Shop/src/Resources/views/layouts/header/index.blade.php b/packages/Webkul/Shop/src/Resources/views/layouts/header/index.blade.php index 858add8ec..7e6bb5bcc 100644 --- a/packages/Webkul/Shop/src/Resources/views/layouts/header/index.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/layouts/header/index.blade.php @@ -7,7 +7,7 @@ @@ -48,20 +48,42 @@
    -