diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 706c00313..64e2c2f45 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -3,7 +3,6 @@ namespace App\Providers; use Illuminate\Support\ServiceProvider; -use Illuminate\Support\Facades\Schema; class AppServiceProvider extends ServiceProvider { @@ -14,7 +13,6 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { - Schema::defaultStringLength(191); } /** diff --git a/config/database.php b/config/database.php index cab5d068f..e486bd20d 100644 --- a/config/database.php +++ b/config/database.php @@ -51,7 +51,7 @@ return [ 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'strict' => true, - 'engine' => null, + 'engine' => 'InnoDB ROW_FORMAT=DYNAMIC', ], 'pgsql' => [ diff --git a/packages/Webkul/Cart/src/Cart.php b/packages/Webkul/Cart/src/Cart.php index 0d9342e41..a580a8789 100644 --- a/packages/Webkul/Cart/src/Cart.php +++ b/packages/Webkul/Cart/src/Cart.php @@ -32,57 +32,186 @@ class Cart { protected $customer; - public function __construct(CartRepository $cart, CartProductRepository $cartProduct, CustomerRepository $customer) { + //Cookie expiry limit in minutes + protected $minutes = 150; + + public function __construct(CartRepository $cart, CartProductRepository $cartProduct, CustomerRepository $customer ,$minutes = 150) { $this->customer = $customer; $this->cart = $cart; $this->cartProduct = $cartProduct; + + $this->minutes = $minutes; } public function guestUnitAdd($id) { + //empty array for storing the products $products = array(); - $minutes = 10; - - if(Cookie::get('current_session_id')) { + if(Cookie::has('cart_session_id')) { + //getting the cart session id from cookie $cart_session_id = Cookie::get('cart_session_id'); - $cart = $this->cart->getOneByField('session_id'. $cart_session_id); + //finding current cart instance in the database table. + $current_cart = $this->cart->findOneByField('session_id', $cart_session_id); - $cartId = $cart->id ?? $cart['id'] ; + //check there is any cart or not + if(isset($current_cart)) { + $current_cart_id = $current_cart['id'] ?? $current_cart->id; - $products = $this->getProducts($id); - - foreach($products as $key => $value) { - if($value == $id) { - dd('product already in the cart'); - - return redirect()->back(); - } + $current_cart_session_id = $current_cart['session_id'] ?? $current_cart->session_id; + } else { + //if someone deleted then take the flow to the normal + $this->repairCart($cart_session_id, $id); } - if($this->cartProduct->create($id)) { - session()->flash('Success', 'Product Added To Cart'); + //matching the session id present in the cookie and database are same or not. + if((session()->get('cart_session_id') == Cookie::get('cart_session_id')) && ($current_cart_session_id == session()->get('cart_session_id'))) { + $current_cart_products = array(); + + $current_cart_products = $this->cart->getProducts($current_cart_id); + + //checking new product coming in the cart is new or previously added item. + foreach($current_cart_products as $key => $value) { + + $product_id = $value['id'] ?? $value->id; + + if($product_id == $id) { + //create status code to communicate with session flash + session()->flash('error', 'Item Already In Cart'); + + //remove this its temporary + dump('Item Already In Cart'); + + return redirect()->back(); + } + } + + //cart data being attached to the instace. + $cart_data = $this->cart->attach($current_cart_id, $id, 1); + + //getting the products after being attached to cart instance + $cart_products = $this->cart->getProducts($current_cart_id); + + //storing the information in session. + session()->put('cart_data', [$current_cart, $cart_products]); + + session()->flash('Success', 'Item Added To Cart Successfully'); + + dump($cart_products); + + //return the control to the controller + return redirect()->back(); + + } else { + //repair the cart, will remake the session + //and add the product in the new cart instance. + $this->repairCart($cart_session_id, $id); + } + } else { + //function call + $this->createNewCart($id); + } + } + + /*helpers*/ + + /** + * Create New Cart + * Cart, Cookie & + * Session. + * + * @return mixed + */ + + public function createNewCart($id) { + + $fresh_cart_session_id = session()->getId(); + + $data['session_id'] = $fresh_cart_session_id; + + $data['channel_id'] = core()->getCurrentChannel()->id; + + if($cart = $this->cart->create($data)) { + + $this->makeCartSession($fresh_cart_session_id); + + $new_cart_id = $cart->id ?? $cart['id']; + + $cart_product['product_id'] = $id; + + $cart_product['quantity'] = 1; + + $cart_product['cart_id'] = $new_cart_id; + + if($cart_product = $this->cart->attach($new_cart_id, $cart_product['product_id'], $cart_product['quantity'])) { + + session()->put('cart_data', [$cart, $cart_product]); + + session()->flash('success', 'Item Added To Cart Successfully'); + return redirect()->back(); } - return redirect()->back(); + } + session()->flash('error', 'Some Error Occured'); - } else { - Cookie::queue('cart_session_id', session()->id(), $minutes); + return redirect()->back(); + } - $data['session_id'] = Cookie::get('cart_session_id'); + /** + * This makes session + * cart. + */ + public function makeCartSession($cart_session_id) { + + $fresh_cart_session_id = $cart_session_id; + + Cookie::queue('cart_session_id', $fresh_cart_session_id, $this->minutes); + + session()->put('cart_session_id', $fresh_cart_session_id); + } + + + /** + * Reset Session and + * Cookie values + * and sync database + * if present. + * + * @return mixed + */ + public function repairCart($cart_session_id ="null", $product_id = 0) { + + if($cart_session_id == session()->get('cart_session_id')) { + $data['session_id'] = $cart_session_id; $data['channel_id'] = core()->getCurrentChannel()->id; - if($this->cart->create($data)) { - if($this->cartProduct->create($product)) { - session()->flash('Success', 'Product Added To Cart'); - } - } + $cart = $this->cart->create($data); + + $cart_id = $cart['id'] ?? $cart->id; + + $this->cart->attach($cart_id, $product_id, 1); + + session()->flash('success', 'Item Added To Cart Successfully'); + + return redirect()->back(); + + } else { + + Cookie::queue(Cookie::forget('cart_session_id')); + + session()->forget('cart_session_id'); + + session()->regenerate(); + + session()->flash('error', 'Please Try Adding Product Again.'); + + return redirect()->back(); } } @@ -96,8 +225,8 @@ class Cart { public function guestUnitRemove($id) { //remove the products here - if(Cookie::has('session_c')) { - $products = unserialize(Cookie::get('session_c')); + if(Cookie::has('session_cart_id')) { + $products = unserialize(Cookie::get('session_cart_id')); foreach($products as $key => $value) { if($value == $id) { @@ -105,7 +234,7 @@ class Cart { array_push($products, $id); - Cookie::queue('session_c', serialize($products)); + Cookie::queue('session_cart_id', serialize($products)); return redirect()->back(); } @@ -123,149 +252,81 @@ class Cart { $products = array(); - // $customerLoggedIn = auth()->guard('customer')->check(); - - // //customer is authenticated - // if ($customerLoggedIn) { - //assuming that there is data in cookie and customer's cart also. + if(!auth()->guard('customer')->check()) { + throw new \Exception('This function is protected for auth customers only.'); + } $data['customer_id'] = auth()->guard('customer')->user()->id; $data['channel_id'] = core()->getCurrentChannel()->id; - $customerCart = $this->cart->findOneByField('customer_id', $data['customer_id']); + $customer_cart = $this->cart->findOneByField('customer_id', $data['customer_id']); //if there are products already in cart of that customer. - $customerCartId = $customerCart->id ?? $customerCart['id']; + $customer_cart_id = $customer_cart->id ?? $customer_cart['id']; - $customerCartProducts = $this->cart->getProducts($customerCartId); + /** + * Check if their any + * instance of current + * customer in the cart + * table. + */ + if(isset($customer_cart)) { + $customer_cart_products = $this->cart->getProducts($customer_cart_id); - if (isset($customerCartProducts)) { + if (isset($customer_cart_products)) { - foreach ($customerCartProducts as $previousCartProduct) { + foreach ($customer_cart_products as $customer_cart_product) { + if($customer_cart_product->id == $id) { + dump('Item already exists in cart'); - if($previousCartProduct->id == $id) { - dd('product already exists in cart'); + session()->flash('error', 'Item already exists in cart'); - session()->flash('error', 'Product already exists in cart'); + return redirect()->back(); - return redirect()->back(); + //maybe increase the quantity in here + } } + //add the product in the cart + + $this->cart->attach($customer_cart_id, $id, 1); + + session()->flash('success', 'Item Added To Cart Successfully'); + + return redirect()->back(); + } else { + $this->cart->destroy($customer_cart_id); + + session()->flash('error', 'Try Adding The Item Again'); + + dd('cart instance without any product found, delete it and create a new one for the current product id'); + + return redirect()->back(); } - //add the product in the cart + } else { + /** + * this will work + * for logged in users + * and they do not have + * any cart instance + * found in the database. + */ - $product['product_id'] = $id; + if($new_cart = $this->cart->create($data)) { + $new_cart_id = $new_cart->id ?? $new_cart['id']; - $product['quantity'] = 1; + $this->cart->attach($new_cart_id, $id, 1); - $product['cart_id'] = $customerCartId; + session()->flash('success', 'Item Added To Cart Successfully'); - $this->cartProduct->create($product); + return redirect()->back(); - return redirect()->back(); + } else { + session()->flash('error', 'Cannot Add Item in Cart'); + + return redirect()->back(); + } } - // } - - // //case when cookie has products and customer also have data in cart tables - // if(isset($customerCart) && isset($cartCookie)) { - // //for unsetting the cookie for the cart uncomment after all done - // // Cookie::queue(Cookie::forget('session_c')); - - // //check if there is any repetition in the products - // $customerCartId = $customerCart->id ?? $customerCart['id']; - - // //to check if the customer is also having some products saved in the pivot - // //for the products. - // $customerCartProducts = $this->cart->getProducts($customerCartId); - - // //if there are products already in cart of that customer - // if(isset($customerCartProducts)) { - - // foreach($customerCartProducts as $previousCartProduct) { - - // dump($customerCartProducts); - - // foreach($cookieProducts as $key => $cookieProduct) { - - // if($previousCartProduct->id == $cookieProduct) { - - // unset($cookieProducts[$key]); - // } - // } - // } - // } - - // /*if the above block executes it will remove duplicates - // else product in cookies will be stored in the database.*/ - - // foreach($cookieProducts as $key => $cookieProduct) { - - // $product['product_id'] = $cookieProduct; - - // $product['quantity'] = 1; - - // $product['cart_id'] = $customerCartId; - - // $this->cartProduct->create($product); - // } - - // dump('Products in the cart synced.'); - - // return redirect()->back(); - - // } else if(isset($customerCart) && !isset($cartCookie)) { - // //case when there is no data in guest's cart - - // $customerCartId = $customerCart->id ?? $customerCart['id']; - - // $customerCartProducts = $this->cart->getProducts($customerCartId); - - // foreach($customerCartProducts as $previousCartProduct) { - - // if($previousCartProduct->id == $id) { - - // dd('product already in the cart::AUTH'); - - // return redirect()->back(); - // } - // } - // $product['product_id'] = $id; - - // $product['quantity'] = 1; - - // $product['cart_id'] = $customerCartId; - - // $this->cartProduct->create($product); - - // dump('new item added in the cart'); - - // return redirect()->back(); - - // } else if(!isset($customerCart) && isset($cartCookie)) { - - // $products = unserialize(Cookie::get('session_c')); - - // if ($cart = $this->cart->create($data)) { - - // foreach($products as $product) { - - // $product['product_id'] = $id; - - // $product['quantity'] = 1; - - // $product['cart_id'] = $cart; - - // $this->cartProduct->create($product); - // } - // return redirect()->back(); - - // } else { - // session()->flash('error', 'Cannot Add Your Items To Cart'); - - // return redirect()->back(); - // } - // } - // } } /** @@ -284,78 +345,84 @@ class Cart { * and sync the cookies products * with the existing data of cart * in the cart tables; - */ - public function handleMerge() { + */ - // $productsInCookie = unserialize(Cookie::get('session_c')); + public function mergeCart() { + //considering cookie as a source of truth. + if(Cookie::has('cart_session_id')) { + /* + Check for previous cart of customer and + pull products from that cart instance + and then check for unique products + and delete the record with session id + and increase the quantity of the products + that are added again before deleting the + guest cart record. + */ - $cart_session_id = Cookie::get('cart_session_id'); + //To hold the customer ID which is currently logged in + $customer_id = auth()->guard('customer')->user()->id; - $cart = $this->cart->findOneByField('session_id'); + //having the session id saved in the cart. + $cart_session_id = Cookie::get('cart_session_id'); - $cartId = $cart->id ?? $cart['id']; + //pull the record from cart table for above session id. + $guest_cart = $this->cart->findOneByField('session_id', $cart_session_id); - $data['customer_id'] = auth()->guard('customer')->user()->id; + if(!isset($guest_cart)) { + dd('Some One Deleted Cart or it wasn\'t there from the start'); - $data['channel_id'] = core()->getCurrentChannel()->id; + return redirect()->back(); + } - $customerCart = $this->cart->findOneByField('customer_id', $data['customer_id']); + $guest_cart_products = $this->cart->getProducts($guest_cart->id); - if(isset($customerCart)) { + //check if the current logged in customer is also + //having any previously saved cart instances. + $customer_cart = $this->cart->findOneByField('customer_id', $customer_id); - $customerCartId = $customerCart->id ?? $customerCart['id']; + if(isset($customer_cart)) { + $customer_cart_products = $this->cart->getProducts($customer_cart->id); - $customerCartProducts = $this->cart->getProducts($customerCartId); + foreach($guest_cart_products as $key => $guest_cart_product) { - if(isset($customerCartProducts)) { + foreach($customer_cart_products as $customer_cart_product) { - foreach($customerCartProducts as $previousCartProduct) { + if($guest_cart_product->id == $customer_cart_product->id) { - foreach($productsInCookie as $key => $productInCookie) { + $quantity = $guest_cart_product->toArray()['pivot']['quantity'] + 1; - if($previousCartProduct->id == $productInCookie) { + $pivot = $guest_cart_product->toArray()['pivot']; - unset($productsInCookie[$key]); + $saveQuantity = $this->cart->updateRelatedForMerge($pivot, 'quantity', $quantity); + + unset($guest_cart_products[$key]); } } } - } - /*if the above block executes it will remove duplicates - else product in cookies will be stored in the database.*/ + //insert the new products here. + foreach ($guest_cart_products as $key => $guest_cart_product) { + $product = $guest_cart_product->toArray(); - foreach($productsInCookie as $key => $cookieProduct) { - - $product['product_id'] = $cookieProduct; - - $product['quantity'] = 1; - - $product['cart_id'] = $customerCartId; - - $this->cartProduct->create($product); - } - - //forget that cookie here. - Cookie::queue(Cookie::forget('session_c')); - } else { - - if($cart = $this->cart->create($data)) { - - foreach($productsInCookie as $productInCookie) { - - $product['product_id'] = $cookieProduct; - - $product['quantity'] = 1; - - $product['cart_id'] = $cart->id; - - $this->cartProduct->create($product); + $this->cart->updateRelatedForMerge($product['pivot'], 'cart_id', $customer_cart->id); } - } - //forget the Cookie - Cookie::queue(Cookie::forget('session_c')); - return redirect()->back(); + //detach with guest cart records + $this->cart->detachAndDeleteParent($guest_cart->id); + + Cookie::queue(Cookie::forget('cart_session_id')); + + return redirect()->back(); + } else { + //this will just update the customer id column in the cart table + $this->cart->update(['customer_id' => $customer_id], $guest_cart->id); + + Cookie::queue(Cookie::forget('cart_session_id')); + + return redirect()->back(); + } } + return redirect()->back(); } } \ No newline at end of file diff --git a/packages/Webkul/Cart/src/Http/Controllers/CartController.php b/packages/Webkul/Cart/src/Http/Controllers/CartController.php index cbb144943..101d28b9a 100644 --- a/packages/Webkul/Cart/src/Http/Controllers/CartController.php +++ b/packages/Webkul/Cart/src/Http/Controllers/CartController.php @@ -42,7 +42,7 @@ class CartController extends Controller public function __construct(CartRepository $cart, CartProductRepository $cartProduct, CustomerRepository $customer) { - $this->middleware('customer')->except(['add', 'remove']); + $this->middleware('customer')->except(['add', 'remove', 'test']); $this->customer = $customer; @@ -66,6 +66,8 @@ class CartController extends Controller } else { Cart::guestUnitAdd($id); } + + return redirect()->back(); } public function remove($id) { @@ -75,5 +77,24 @@ class CartController extends Controller } else { Cart::guestUnitRemove($id); } + + return redirect()->back(); } + + // public function test() { + // $cookie = Cookie::get('cart_session_id'); + + // $cart = $this->cart->findOneByField('session_id', $cookie); + + // $cart_products = $this->cart->getProducts($cart->id); + + // foreach($cart_products as $cart_product) { + // $quantity = $cart_product->toArray()['pivot']['quantity'] + 1; + + // $pivot = $cart_product->toArray()['pivot']; + + // $saveQuantity = $this->cart->saveRelated($pivot, 'quantity', $quantity+1); + // } + // dd('done'); + // } } \ No newline at end of file diff --git a/packages/Webkul/Cart/src/Http/ViewComposers/CartComposer.php b/packages/Webkul/Cart/src/Http/ViewComposers/CartComposer.php new file mode 100644 index 000000000..a216c1d5c --- /dev/null +++ b/packages/Webkul/Cart/src/Http/ViewComposers/CartComposer.php @@ -0,0 +1,59 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ + +class CartComposer +{ + + /** + * The cart implementation + * for shop bundle's navigation + * menu + */ + protected $cart; + + /** + * Bind data to the view. + * + * @param View $view + * @return void + */ + public function __construct(CartRepository $cart) { + $this->cart = $cart; + } + + public function compose(View $view) { + if(auth()->guard('customer')->check()) { + $cart = $this->cart->findOneByField('customer_id', auth()->guard('customer')->user()->id); + + $cart_products = $this->cart->getProducts($cart['id']); + + // dd($cart_products); + + $view->with('cart', $cart_products); + + } else { + if(Cookie::has('cart_session_id')) { + $cart = $this->cart->findOneByField('session_id', Cookie::get('cart_session_id')); + + $cart_products = $this->cart->getProducts($cart['id']); + + $view->with('cart', $cart_products); + } + } + } +} diff --git a/packages/Webkul/Cart/src/Models/Cart.php b/packages/Webkul/Cart/src/Models/Cart.php index f03c3a82f..f1591cdb4 100644 --- a/packages/Webkul/Cart/src/Models/Cart.php +++ b/packages/Webkul/Cart/src/Models/Cart.php @@ -10,11 +10,12 @@ class Cart extends Model { protected $table = 'cart'; - protected $fillable = ['customer_id','session_id','channel_id','coupon_code','is_gift']; + protected $fillable = ['customer_id', 'session_id', 'channel_id', 'coupon_code', 'is_gift']; protected $hidden = ['coupon_code']; public function with_products() { - return $this->belongsToMany(Product::class, 'cart_products'); + + return $this->belongsToMany(Product::class, 'cart_products')->withPivot('id', 'product_id','quantity', 'cart_id'); } } diff --git a/packages/Webkul/Cart/src/Providers/CartServiceProvider.php b/packages/Webkul/Cart/src/Providers/CartServiceProvider.php index 28755d917..d1ba3b051 100644 --- a/packages/Webkul/Cart/src/Providers/CartServiceProvider.php +++ b/packages/Webkul/Cart/src/Providers/CartServiceProvider.php @@ -8,8 +8,8 @@ use Illuminate\Routing\Router; use Illuminate\Foundation\AliasLoader; use Webkul\User\Http\Middleware\RedirectIfNotAdmin; use Webkul\Customer\Http\Middleware\RedirectIfNotCustomer; -use Webkul\Cart\Cart; -use Webkul\Cart\Facades\Cart as CartFacade; +use Webkul\Cart\Facades\Cart; +use Webkul\Cart\Providers\ComposerServiceProvider; class CartServiceProvider extends ServiceProvider { @@ -18,7 +18,11 @@ class CartServiceProvider extends ServiceProvider { $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); - $this->register(EventServiceProvider::class); + $router->aliasMiddleware('admin', RedirectIfNotAdmin::class); + + $router->aliasMiddleware('customer', RedirectIfNotCustomer::class); + + $this->app->register(ComposerServiceProvider::class); } /** @@ -38,6 +42,9 @@ class CartServiceProvider extends ServiceProvider */ protected function registerFacades() { + + //to make the cart facade and bind the + //alias to the class needed to be called. $loader = AliasLoader::getInstance(); $loader->alias('cart', CartFacade::class); diff --git a/packages/Webkul/Cart/src/Providers/ComposerServiceProvider.php b/packages/Webkul/Cart/src/Providers/ComposerServiceProvider.php new file mode 100644 index 000000000..3f62d51c7 --- /dev/null +++ b/packages/Webkul/Cart/src/Providers/ComposerServiceProvider.php @@ -0,0 +1,32 @@ + $value) { + return $this->model->findOrFail($cart_id)->with_products()->attach($cart_id, ['product_id' => $product_id, 'cart_id' => $cart_id, 'quantity' => $quantity]); - // $this->model->findOrFail($id)->tax_rates()->attach($id, ['tax_category_id' => $id, 'tax_rate_id' => $value]); - // } - // } + } + /** + * This will update the + * quantity of product + * for the customer, + * in case of merge. + * + * @return Mixed + */ + public function updateRelatedForMerge($pivot, $column, $value) { + $cart_product = $this->model->findOrFail($pivot['cart_id']); + + return $cart_product->with_products()->updateExistingPivot($pivot['product_id'], array($column => $value)); + } /** * Method to detach - * and attach the - * associations + * associations. * - * @return mixed - */ - // public function syncAndDetach($id, $taxRates) { - // $this->model->findOrFail($id)->tax_rates()->detach(); + * Use this only with + * guest cart only. + * + * @return Mixed + */ + public function detachAndDeleteParent($cart_id) { + $cart = $this->model->find($cart_id); - // foreach($taxRates as $key => $value) { - // $this->model->findOrFail($id)->tax_rates()->attach($id, ['tax_category_id' => $id, 'tax_rate_id' => $value]); - // } - // } + //apply strict check for verifying guest ownership on this record. + $cart->with_products()->detach(); + + return $this->model->destroy($cart_id); + } } \ No newline at end of file diff --git a/packages/Webkul/Customer/src/Http/Controllers/SessionController.php b/packages/Webkul/Customer/src/Http/Controllers/SessionController.php index d3017ed64..1ad764b39 100644 --- a/packages/Webkul/Customer/src/Http/Controllers/SessionController.php +++ b/packages/Webkul/Customer/src/Http/Controllers/SessionController.php @@ -71,6 +71,9 @@ class SessionController extends Controller public function destroy($id) { auth()->guard('customer')->logout(); + + Event::fire('customer.after.logout', 1); + return redirect()->route($this->_config['redirect']); } } \ No newline at end of file diff --git a/packages/Webkul/Customer/src/Http/Listeners/CustomerEventsHandler.php b/packages/Webkul/Customer/src/Http/Listeners/CustomerEventsHandler.php index d4b4e26b1..bb6bba8ec 100644 --- a/packages/Webkul/Customer/src/Http/Listeners/CustomerEventsHandler.php +++ b/packages/Webkul/Customer/src/Http/Listeners/CustomerEventsHandler.php @@ -27,7 +27,11 @@ class CustomerEventsHandler { * check emptiness and then * do the appropriate actions. */ - Cart::handleMerge(); + Cart::mergeCart(); + } + + //use this when there is very uttermost need to use it. + public function onCustomerLogout($event) { } /** @@ -39,5 +43,7 @@ class CustomerEventsHandler { public function subscribe($events) { $events->listen('customer.after.login', 'Webkul\Customer\Http\Listeners\CustomerEventsHandler@onCustomerLogin'); + + $events->listen('customer.after.logout', 'Webkul\Customer\Http\Listeners\CustomerEventsHandler@onCustomerLogout'); } } \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Http/routes.php b/packages/Webkul/Shop/src/Http/routes.php index 906226fe4..7d8361989 100644 --- a/packages/Webkul/Shop/src/Http/routes.php +++ b/packages/Webkul/Shop/src/Http/routes.php @@ -23,19 +23,12 @@ Route::group(['middleware' => ['web']], function () { // //Routes for product cart - Route::post('products/guest/cart/add/{id}', 'Webkul\Cart\Http\Controllers\CartController@add')->name('cart.add'); + Route::post('products/add/{id}', 'Webkul\Cart\Http\Controllers\CartController@add')->name('cart.add'); - Route::post('product/guest/cart/remove/{id}', 'Webkul\Cart\Http\Controllers\CartController@remove')->name('cart.remove'); - - // Route::post('product/customer/cart/add/{id}', 'Webkul\Cart\Http\Controllers\CartController@add')->name('cart.customer.add'); - - // Route::post('product/customer/cart/remove/{id}', 'Webkul\Cart\Http\Controllers\CartController@remove')->name('cart.customer.remove'); - - Route::get('product/customer/cart/merge', 'Webkul\Cart\Http\Controllers\CartController@handleMerge')->name('cart.merge'); + Route::post('product/remove/{id}', 'Webkul\Cart\Http\Controllers\CartController@remove')->name('cart.remove'); //Routes for product cart ends - // Product Review routes Route::get('/reviews/{slug}', 'Webkul\Shop\Http\Controllers\ReviewController@show')->defaults('_config', [ 'view' => 'shop::products.reviews.index' @@ -53,13 +46,6 @@ Route::group(['middleware' => ['web']], function () { 'redirect' => 'admin.reviews.index' ])->name('admin.reviews.store'); - // Route::post('/reviews/create/{slug}', 'Webkul\Core\Http\Controllers\ReviewController@store')->defaults('_config', [ - // 'redirect' => 'admin.reviews.index' - // ])->name('admin.reviews.store'); - - - // Route::view('/products/{slug}', 'shop::store.product.details.index'); - Route::view('/cart', 'shop::store.product.view.cart.index'); //customer routes starts here Route::prefix('customer')->group(function () { @@ -90,12 +76,6 @@ Route::group(['middleware' => ['web']], function () { 'redirect' => 'customer.session.index' ])->name('customer.session.destroy'); - Route::view('/cart', 'shop::store.product.cart.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 () { diff --git a/packages/Webkul/Shop/src/Resources/assets/js/app.js b/packages/Webkul/Shop/src/Resources/assets/js/app.js index 0e18520bc..1507aa2da 100644 --- a/packages/Webkul/Shop/src/Resources/assets/js/app.js +++ b/packages/Webkul/Shop/src/Resources/assets/js/app.js @@ -10,6 +10,7 @@ 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")); Vue.component("vue-slider", require("vue-slider-component")); +Vue.component("cart-dropdown", require("./components/cart-dropdown.vue")); $(document).ready(function () { @@ -52,6 +53,7 @@ $(document).ready(function () { const flashes = this.$refs.flashes; flashMessages.forEach(function (flash) { + console.log(flash); flashes.addFlash(flash); }, this); }, diff --git a/packages/Webkul/Shop/src/Resources/assets/js/components/cart-dropdown.vue b/packages/Webkul/Shop/src/Resources/assets/js/components/cart-dropdown.vue new file mode 100644 index 000000000..9b27c8634 --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/assets/js/components/cart-dropdown.vue @@ -0,0 +1,156 @@ + + + \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/assets/sass/app.scss b/packages/Webkul/Shop/src/Resources/assets/sass/app.scss index b0a0e43c1..16a6e521e 100644 --- a/packages/Webkul/Shop/src/Resources/assets/sass/app.scss +++ b/packages/Webkul/Shop/src/Resources/assets/sass/app.scss @@ -8,6 +8,8 @@ body { margin: 0; padding: 0; font-weight: 500; + max-width: 100%; + width: auto; color: $font-color; font-size: $font-size-base; } @@ -19,12 +21,13 @@ body { .header { margin-top: 16px; margin-bottom: 21px; + user-select: none; .header-top { margin-bottom: 16px; display: flex; - max-width: 80%; - width: 100%; + max-width: 100%; + width: auto; margin-left: auto; margin-right: auto; align-items: center; @@ -187,7 +190,8 @@ body { display: block; font-size:16px; height: 48px; - width: 80%; + max-width: 100%; + width: auto; margin-left: auto; margin-right: auto; } @@ -290,7 +294,6 @@ body { .nav li li:hover > a:first-child:nth-last-child(2):before { right: 10px; } - } } @@ -307,7 +310,7 @@ body { .header-top { margin-bottom: 16px; display: flex; - max-width: 92%; + // max-width: 92%; width: 100%; margin-left: auto; margin-right: auto; @@ -479,7 +482,7 @@ body { .header-top { margin-bottom: 16px; display: flex; - max-width: 92%; + // max-width: 92%; width: 100%; margin-left: auto; margin-right: auto; @@ -610,10 +613,11 @@ body { section.slider-block { display: block; + margin-left: auto; + margin-right: auto; margin-bottom: 5%; div.slider-content { - width: 80%; height: 500px; margin-left: auto; margin-right: auto; @@ -763,54 +767,42 @@ section.slider-block { .main-container-wrapper { - margin-left: 10%; - margin-right: 10%; + max-width: 80%; + width: auto; + margin-left: auto; + margin-right: auto; .content-container { display: inline-block; width: 100%; } - .main { - display: inline-block; - width: 75% - } - .product-grid { display: grid; grid-gap: 30px; &.max-2-col { - grid-template-columns: repeat(2, minmax(250px, 1fr)); + grid-template-columns: repeat(2, minmax(auto, 1fr)); } &.max-3-col { - grid-template-columns: repeat(3, minmax(250px, 1fr)); + grid-template-columns: repeat(3, minmax(auto, 1fr)); } &.max-4-col { - grid-template-columns: repeat(4, minmax(250px, 1fr)); - } - - .product-card { - display: flex; - flex-flow: column; - justify-content: center; + grid-template-columns: repeat(4, minmax(auto, 1fr)); } } .product-card { .product-image { - background: #F2F2F2; margin-bottom: 10px; - // width: 380px; - // max-width: 100%; - // text-align: center; img { align-self: center; - width: 100%; + max-width: 100%; + width: auto; margin-bottom: 14px; } } @@ -1015,6 +1007,27 @@ section.slider-block { } } +//responsive for main-container-wrapper + +@media all and (max-width: 480px) { + .main-container-wrapper { + width: 100% !important; + margin-left: auto; + margin-right: auto; + } +} + +@media all and (min-width: 481px) and (max-width: 920px) { + .main-container-wrapper { + width: 90%; + margin-left: auto; + margin-right: auto; + } +} + + + + .product-price { font-size: 16px; margin-bottom: 14px; @@ -1321,347 +1334,343 @@ section.product-detail { } div.layouter { + display: block; margin-top: 20px; margin-bottom: 20px; - display: inline-block; - width: 100%; - .mixed-group { + form { + display: flex; + flex-direction: row; + justify-content: space-between; + width: 100%; - .single-image { - padding: 2px; + div.product-image-group { + margin-right: 36px; - img { - height: 280px; - width: 280px; + div { + display: flex; + flex-direction: row; + + .thumb-list { + display: flex; + flex-direction: column; + margin-right: 4px; + height: 480px; + width: 120px; + overflow: hidden; + position: relative; + justify-content: flex-start; + + .thumb-frame { + border: 2px solid transparent; + background: #F2F2F2; + max-width: 120px; + width: auto; + height: 120px; + + &.active { + border-color: #979797; + } + + img { + width: 100%; + height: 100%; + } + } + + .gallery-control { + width: 100%; + position: absolute; + text-align: center; + cursor: pointer; + z-index: 1; + + .overlay { + opacity: 0.3; + background: #000000; + width: 100%; + height: 18px; + position: absolute; + left: 0; + z-index: -1; + } + + .icon { + z-index: 2; + } + + &.top { + top: 0; + } + + &.bottom { + bottom: 0; + } + } + } + + .product-hero-image { + display: block; + position: relative; + background: #F2F2F2; + width: 480px; + max-height: 480px; + + .wishlist { + position: absolute; + top: 10px; + right: 12px; + } + + .share { + position: absolute; + top: 10px; + right: 45px; + } + } + } + + .cart-fav-seg { + display: block; + float: right; + + .wishlist { + position: absolute; + margin-top: -500px; + margin-right: -100px; + } } } .details { - - .product-name { - margin-top: 20px; - font-size: 24px; - margin-bottom: 20px; - } + width: 50%; .product-price { margin-bottom: 14px; } - } - } - .rating-reviews { - margin-top: 0px; - width: 50%; - margin-left: 20px; - - .title-inline { - display: inline-flex; - align-items: center; - justify-content: space-between; - margin-bottom: 20px; - width: 100%; - - button { - float: right; - border-radius: 0px !important; - } - } - - .overall { - display: flex; - flex-direction: row; - align-items: center; - justify-content: space-between; - height: 150px; - - .left-side { + .product-ratings { margin-bottom: 20px; - .number{ - font-size: 34px; - } - } - - .right-side { - display: block; - - .rater { - display: inline-flex; - align-items: center; - - .star { - width: 50px; - height: 20px; - padding: 1px; - margin-right: 8px; - } - - .line-bar { - height: 4px; - width: 158px; - margin-right: 12px; - background: $bar-color; - - .line-value { - background-color: $dark-blue-shade; - } - } - } - } - } - - .reviews { - margin-top: 34px; - margin-bottom: 90px; - - .review { - margin-bottom: 25px; - - .title { - margin-bottom: 5px; - } - - .stars { - margin-bottom: 15px; - } - .message { - margin-bottom: 10px; - } - } - .view-all { - margin-top:15px; - color: $logo-color; - margin-bottom:15px; - } - } - } - - div.product-image-group { - width: 43%; - float: left; - min-height: 1px; - position: relative; - - .thumb-list { - display: flex; - flex-direction: column; - margin-right: 4px; - height: 480px; - overflow: hidden; - position: relative; - float: left; - - .thumb-frame { - border: 2px solid transparent; - background: #F2F2F2; - width: 120px; - height: 120px; - - &.active { - border-color: #979797; - } - - img { - width: 100%; - height: 100%; - } - } - - .gallery-control { - width: 100%; - position: absolute; - text-align: center; - cursor: pointer; - z-index: 1; - - .overlay { - opacity: 0.3; - background: #000000; - width: 100%; - height: 18px; - position: absolute; - left: 0; - z-index: -1; - } - .icon { - z-index: 2; + width: 16px; + height: 16px; } - &.top { - top: 0; - } - - &.bottom { - bottom: 0; + .total-reviews { + display: inline-block; + margin-left: 15px; } } - } - .product-hero-image { - display: block; - position: relative; - background: #F2F2F2; - width: 480px; - max-height: 480px; - float: left; - - .wishlist { - position: absolute; - top: 10px; - right: 12px; - } - - .share { - position: absolute; - top: 10px; - right: 45px; - } - } - } - - .details { - width: 57%; - float: left; - - .product-price { - margin-bottom: 14px; - } - - .product-ratings { - margin-bottom: 20px; - - .icon { - width: 16px; - height: 16px; - } - - .total-reviews { - display: inline-block; - margin-left: 15px; - } - } - - .product-heading { - font-size: 24px; - color: $product-font-color; - margin-bottom: 15px; - } - - .product-price { - margin-bottom: 15px; - font-size: 24px; - - .special-price { + .product-heading { font-size: 24px; + color: $product-font-color; + margin-bottom: 15px; } - } - .stock-status { - margin-bottom: 15px; - } + .product-price { + margin-bottom: 15px; + font-size: 24px; - .description { - margin-bottom: 15px; - padding-bottom: 15px; - border-bottom: solid 1px rgba(162, 162, 162, 0.2) - } - - .full-specifications { - td { - padding: 10px 0; - color: #5E5E5E; - - &:first-child { - padding-right: 40px; + .special-price { + font-size: 24px; } } + + .stock-status { + margin-bottom: 15px; + } + + .description { + margin-bottom: 15px; + padding-bottom: 15px; + border-bottom: solid 1px rgba(162, 162, 162, 0.2) + } + + .full-specifications { + td { + padding: 10px 0; + color: #5E5E5E; + + &:first-child { + padding-right: 40px; + } + } + } + + .accordian .accordian-header { + font-size: 16px; + padding-left: 0; + font-weight: 600; + } + + .attributes { + display: block; + width: 100%; + border-bottom: solid 1px rgba(162, 162, 162, 0.2); + } + + .full-description { + font-size: 16px; + } } - .accordian .accordian-header { - font-size: 16px; - padding-left: 0; - font-weight: 600; - } + // .rating-reviews { + // margin-top: 0px; + // width: 50%; + // margin-left: 20px; + + // .title-inline { + // display: inline-flex; + // align-items: center; + // justify-content: space-between; + // margin-bottom: 20px; + // width: 100%; + + // button { + // float: right; + // border-radius: 0px !important; + // } + // } + + // .overall { + // display: flex; + // flex-direction: row; + // align-items: center; + // justify-content: space-between; + // height: 150px; + + // .left-side { + // margin-bottom: 20px; + + // .number{ + // font-size: 34px; + // } + // } + + // .right-side { + // display: block; + + // .rater { + // display: inline-flex; + // align-items: center; + + // .star { + // width: 50px; + // height: 20px; + // padding: 1px; + // margin-right: 8px; + // } + + // .line-bar { + // height: 4px; + // width: 158px; + // margin-right: 12px; + // background: $bar-color; + + // .line-value { + // background-color: $dark-blue-shade; + // } + // } + // } + // } + // } + + // .reviews { + // margin-top: 34px; + // margin-bottom: 90px; + + // .review { + // margin-bottom: 25px; + + // .title { + // margin-bottom: 5px; + // } + + // .stars { + // margin-bottom: 15px; + // } + // .message { + // margin-bottom: 10px; + // } + // } + // .view-all { + // margin-top:15px; + // color: $logo-color; + // margin-bottom:15px; + // } + // } + // } - .attributes { - display: block; - width: 100%; - border-bottom: solid 1px rgba(162, 162, 162, 0.2); - } - .full-description { - font-size: 16px; - } } } } -.rating-reviews { +// .rating-reviews { - .rating-header { - font-weight: 600; - padding: 20px 0; - } +// .rating-header { +// font-weight: 600; +// padding: 20px 0; +// } - .stars { - .icon { - width: 16px; - height: 16px; - } - } +// .stars { +// .icon { +// width: 16px; +// height: 16px; +// } +// } - .overall { - display: flex; - flex-direction: row; - align-items: center; - justify-content: space-between; +// .overall { +// display: flex; +// flex-direction: row; +// align-items: center; +// justify-content: space-between; - .review-info { - .number { - font-size: 34px; - } +// .review-info { +// .number { +// font-size: 34px; +// } - .total-reviews { - margin-top: 10px; - } - } - } +// .total-reviews { +// margin-top: 10px; +// } +// } +// } - .reviews { - margin-top: 40px; - margin-bottom: 40px; +// .reviews { +// margin-top: 40px; +// margin-bottom: 40px; - .review { - margin-bottom: 25px; +// .review { +// margin-bottom: 25px; - .title { - margin-bottom: 5px; - } +// .title { +// margin-bottom: 5px; +// } - .stars { - margin-bottom: 15px; - display: inline-block; - } +// .stars { +// margin-bottom: 15px; +// display: inline-block; +// } - .message { - margin-bottom: 10px; - } +// .message { +// margin-bottom: 10px; +// } - .reviewer-details { - color: #5E5E5E; - } - } +// .reviewer-details { +// color: #5E5E5E; +// } +// } - .view-all { - margin-top:15px; - color: $logo-color; - margin-bottom:15px; - } - } -} +// .view-all { +// margin-top:15px; +// color: $logo-color; +// margin-bottom:15px; +// } +// } +// } /* cart pages and elements css begins here */ section.cart { diff --git a/packages/Webkul/Shop/src/Resources/assets/sass/icons.scss b/packages/Webkul/Shop/src/Resources/assets/sass/icons.scss index e8ce2979e..762f456ae 100644 --- a/packages/Webkul/Shop/src/Resources/assets/sass/icons.scss +++ b/packages/Webkul/Shop/src/Resources/assets/sass/icons.scss @@ -3,7 +3,7 @@ background-size: cover; } -.dropdown-right-icon{ +.dropdown-right-icon { background-image:URL('../images/icon-dropdown-left.svg'); width: 8px; height: 8px; @@ -11,6 +11,14 @@ margin-bottom: 2px; } +.icon-menu-close { + background-image:URL('../images/icon-menu-close.svg'); + width: 8px; + height: 8px; + margin-left:auto; + margin-bottom: 2px; +} + .grid-view-icon { background-image:URL('../images/icon-grid-view.svg'); width: 24px; 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 d15ab5888..0fdee9e33 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 @@ -1,7 +1,5 @@ @push('scripts') - - - @endpush \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/products/add-to.blade.php b/packages/Webkul/Shop/src/Resources/views/products/add-to.blade.php index 1839cb16b..1ebdd16b1 100644 --- a/packages/Webkul/Shop/src/Resources/views/products/add-to.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/add-to.blade.php @@ -1,7 +1,7 @@
- + @include ('shop::products.add-to-cart', ['product' => $product]) - - + +
\ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/products/view.blade.php b/packages/Webkul/Shop/src/Resources/views/products/view.blade.php index 41fa4d005..c0b2786b9 100644 --- a/packages/Webkul/Shop/src/Resources/views/products/view.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/view.blade.php @@ -13,7 +13,6 @@
- {{-- {{ dd(session()->getId()) }} --}}
@csrf() diff --git a/packages/Webkul/Shop/src/Resources/views/products/view/gallery.blade.php b/packages/Webkul/Shop/src/Resources/views/products/view/gallery.blade.php index e495bdae6..e5ddae8a6 100644 --- a/packages/Webkul/Shop/src/Resources/views/products/view/gallery.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/view/gallery.blade.php @@ -5,9 +5,7 @@
- @include ('shop::products.add-to') -
@push('scripts') diff --git a/packages/Webkul/Ui/src/Resources/assets/js/components/flash-wrapper.vue b/packages/Webkul/Ui/src/Resources/assets/js/components/flash-wrapper.vue index f22019967..902807869 100644 --- a/packages/Webkul/Ui/src/Resources/assets/js/components/flash-wrapper.vue +++ b/packages/Webkul/Ui/src/Resources/assets/js/components/flash-wrapper.vue @@ -5,7 +5,7 @@ class='alert-wrapper' > {!! $column->sorting() !!} @endif @endforeach - @if(isset($attribute_columns)) + {{-- @if(isset($attribute_columns)) @foreach($attribute_columns as $key => $value) {{ $value }} @endforeach - @endif + @endif --}} Actions @@ -131,11 +131,11 @@ {!! $column->render($result) !!} @endforeach - @if(isset($attribute_columns)) + {{-- @if(isset($attribute_columns)) @foreach ($attribute_columns as $atc) {{ $result->{$atc} }} @endforeach - @endif + @endif --}} @foreach($actions as $action) diff --git a/packages/Webkul/Ui/webpack.mix.js b/packages/Webkul/Ui/webpack.mix.js index 32804fbcc..4fa81616a 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 diff --git a/public/themes/default/assets/css/shop.css b/public/themes/default/assets/css/shop.css index c5ec4b8b6..4be3042bb 100644 --- a/public/themes/default/assets/css/shop.css +++ b/public/themes/default/assets/css/shop.css @@ -11,6 +11,14 @@ margin-bottom: 2px; } +.icon-menu-close { + background-image: URL("../images/icon-menu-close.svg"); + width: 8px; + height: 8px; + margin-left: auto; + margin-bottom: 2px; +} + .grid-view-icon { background-image: URL("../images/icon-grid-view.svg"); width: 24px; @@ -27,6 +35,8 @@ body { margin: 0; padding: 0; font-weight: 500; + max-width: 100%; + width: auto; color: #242424; font-size: 16px; } @@ -38,6 +48,10 @@ body { .header { margin-top: 16px; margin-bottom: 21px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } .header .header-top { @@ -45,8 +59,8 @@ body { display: -webkit-box; display: -ms-flexbox; display: flex; - max-width: 80%; - width: 100%; + max-width: 100%; + width: auto; margin-left: auto; margin-right: auto; -webkit-box-align: center; @@ -260,7 +274,8 @@ body { display: block; font-size: 16px; height: 48px; - width: 80%; + max-width: 100%; + width: auto; margin-left: auto; margin-right: auto; } @@ -377,7 +392,6 @@ body { display: -webkit-box; display: -ms-flexbox; display: flex; - max-width: 92%; width: 100%; margin-left: auto; margin-right: auto; @@ -530,7 +544,6 @@ body { display: -webkit-box; display: -ms-flexbox; display: flex; - max-width: 92%; width: 100%; margin-left: auto; margin-right: auto; @@ -645,11 +658,12 @@ body { section.slider-block { display: block; + margin-left: auto; + margin-right: auto; margin-bottom: 5%; } section.slider-block div.slider-content { - width: 80%; height: 500px; margin-left: auto; margin-right: auto; @@ -806,8 +820,10 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { } .main-container-wrapper { - margin-left: 10%; - margin-right: 10%; + max-width: 80%; + width: auto; + margin-left: auto; + margin-right: auto; } .main-container-wrapper .content-container { @@ -815,50 +831,32 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { width: 100%; } -.main-container-wrapper .main { - display: inline-block; - width: 75%; -} - .main-container-wrapper .product-grid { display: grid; grid-gap: 30px; } .main-container-wrapper .product-grid.max-2-col { - grid-template-columns: repeat(2, minmax(250px, 1fr)); + grid-template-columns: repeat(2, minmax(auto, 1fr)); } .main-container-wrapper .product-grid.max-3-col { - grid-template-columns: repeat(3, minmax(250px, 1fr)); + grid-template-columns: repeat(3, minmax(auto, 1fr)); } .main-container-wrapper .product-grid.max-4-col { - grid-template-columns: repeat(4, minmax(250px, 1fr)); -} - -.main-container-wrapper .product-grid .product-card { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-orient: vertical; - -webkit-box-direction: normal; - -ms-flex-flow: column; - flex-flow: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; + grid-template-columns: repeat(4, minmax(auto, 1fr)); } .main-container-wrapper .product-card .product-image { - background: #F2F2F2; margin-bottom: 10px; } .main-container-wrapper .product-card .product-image img { -ms-flex-item-align: center; align-self: center; - width: 100%; + max-width: 100%; + width: auto; margin-bottom: 14px; } @@ -1069,6 +1067,22 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { width: 100%; } +@media all and (max-width: 480px) { + .main-container-wrapper { + width: 100% !important; + margin-left: auto; + margin-right: auto; + } +} + +@media all and (min-width: 481px) and (max-width: 920px) { + .main-container-wrapper { + width: 90%; + margin-left: auto; + margin-right: auto; + } +} + .product-price { font-size: 16px; margin-bottom: 14px; @@ -1390,57 +1404,12 @@ section.product-detail div.category-breadcrumbs { } section.product-detail div.layouter { + display: block; margin-top: 20px; margin-bottom: 20px; - display: inline-block; - width: 100%; } -section.product-detail div.layouter .mixed-group .single-image { - padding: 2px; -} - -section.product-detail div.layouter .mixed-group .single-image img { - height: 280px; - width: 280px; -} - -section.product-detail div.layouter .mixed-group .details .product-name { - margin-top: 20px; - font-size: 24px; - margin-bottom: 20px; -} - -section.product-detail div.layouter .mixed-group .details .product-price { - margin-bottom: 14px; -} - -section.product-detail div.layouter .rating-reviews { - margin-top: 0px; - width: 50%; - margin-left: 20px; -} - -section.product-detail div.layouter .rating-reviews .title-inline { - display: -webkit-inline-box; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: justify; - -ms-flex-pack: justify; - justify-content: space-between; - margin-bottom: 20px; - width: 100%; -} - -section.product-detail div.layouter .rating-reviews .title-inline button { - float: right; - border-radius: 0px !important; -} - -section.product-detail div.layouter .rating-reviews .overall { +section.product-detail div.layouter form { display: -webkit-box; display: -ms-flexbox; display: flex; @@ -1448,89 +1417,27 @@ section.product-detail div.layouter .rating-reviews .overall { -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; - height: 150px; + width: 100%; } -section.product-detail div.layouter .rating-reviews .overall .left-side { - margin-bottom: 20px; +section.product-detail div.layouter form div.product-image-group { + margin-right: 36px; } -section.product-detail div.layouter .rating-reviews .overall .left-side .number { - font-size: 34px; +section.product-detail div.layouter form div.product-image-group div { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; } -section.product-detail div.layouter .rating-reviews .overall .right-side { - display: block; -} - -section.product-detail div.layouter .rating-reviews .overall .right-side .rater { - display: -webkit-inline-box; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -section.product-detail div.layouter .rating-reviews .overall .right-side .rater .star { - width: 50px; - height: 20px; - padding: 1px; - margin-right: 8px; -} - -section.product-detail div.layouter .rating-reviews .overall .right-side .rater .line-bar { - height: 4px; - width: 158px; - margin-right: 12px; - background: #D8D8D8; -} - -section.product-detail div.layouter .rating-reviews .overall .right-side .rater .line-bar .line-value { - background-color: #0031F0; -} - -section.product-detail div.layouter .rating-reviews .reviews { - margin-top: 34px; - margin-bottom: 90px; -} - -section.product-detail div.layouter .rating-reviews .reviews .review { - margin-bottom: 25px; -} - -section.product-detail div.layouter .rating-reviews .reviews .review .title { - margin-bottom: 5px; -} - -section.product-detail div.layouter .rating-reviews .reviews .review .stars { - margin-bottom: 15px; -} - -section.product-detail div.layouter .rating-reviews .reviews .review .message { - margin-bottom: 10px; -} - -section.product-detail div.layouter .rating-reviews .reviews .view-all { - margin-top: 15px; - color: #0031f0; - margin-bottom: 15px; -} - -section.product-detail div.layouter div.product-image-group { - width: 43%; - float: left; - min-height: 1px; - position: relative; -} - -section.product-detail div.layouter div.product-image-group .thumb-list { +section.product-detail div.layouter form div.product-image-group div .thumb-list { display: -webkit-box; display: -ms-flexbox; display: flex; @@ -1540,28 +1447,32 @@ section.product-detail div.layouter div.product-image-group .thumb-list { flex-direction: column; margin-right: 4px; height: 480px; + width: 120px; overflow: hidden; position: relative; - float: left; + -webkit-box-pack: start; + -ms-flex-pack: start; + justify-content: flex-start; } -section.product-detail div.layouter div.product-image-group .thumb-list .thumb-frame { +section.product-detail div.layouter form div.product-image-group div .thumb-list .thumb-frame { border: 2px solid transparent; background: #F2F2F2; - width: 120px; + max-width: 120px; + width: auto; height: 120px; } -section.product-detail div.layouter div.product-image-group .thumb-list .thumb-frame.active { +section.product-detail div.layouter form div.product-image-group div .thumb-list .thumb-frame.active { border-color: #979797; } -section.product-detail div.layouter div.product-image-group .thumb-list .thumb-frame img { +section.product-detail div.layouter form div.product-image-group div .thumb-list .thumb-frame img { width: 100%; height: 100%; } -section.product-detail div.layouter div.product-image-group .thumb-list .gallery-control { +section.product-detail div.layouter form div.product-image-group div .thumb-list .gallery-control { width: 100%; position: absolute; text-align: center; @@ -1569,7 +1480,7 @@ section.product-detail div.layouter div.product-image-group .thumb-list .gallery z-index: 1; } -section.product-detail div.layouter div.product-image-group .thumb-list .gallery-control .overlay { +section.product-detail div.layouter form div.product-image-group div .thumb-list .gallery-control .overlay { opacity: 0.3; background: #000000; width: 100%; @@ -1579,178 +1490,121 @@ section.product-detail div.layouter div.product-image-group .thumb-list .gallery z-index: -1; } -section.product-detail div.layouter div.product-image-group .thumb-list .gallery-control .icon { +section.product-detail div.layouter form div.product-image-group div .thumb-list .gallery-control .icon { z-index: 2; } -section.product-detail div.layouter div.product-image-group .thumb-list .gallery-control.top { +section.product-detail div.layouter form div.product-image-group div .thumb-list .gallery-control.top { top: 0; } -section.product-detail div.layouter div.product-image-group .thumb-list .gallery-control.bottom { +section.product-detail div.layouter form div.product-image-group div .thumb-list .gallery-control.bottom { bottom: 0; } -section.product-detail div.layouter div.product-image-group .product-hero-image { +section.product-detail div.layouter form div.product-image-group div .product-hero-image { display: block; position: relative; background: #F2F2F2; width: 480px; max-height: 480px; - float: left; } -section.product-detail div.layouter div.product-image-group .product-hero-image .wishlist { +section.product-detail div.layouter form div.product-image-group div .product-hero-image .wishlist { position: absolute; top: 10px; right: 12px; } -section.product-detail div.layouter div.product-image-group .product-hero-image .share { +section.product-detail div.layouter form div.product-image-group div .product-hero-image .share { position: absolute; top: 10px; right: 45px; } -section.product-detail div.layouter .details { - width: 57%; - float: left; +section.product-detail div.layouter form div.product-image-group .cart-fav-seg { + display: block; + float: right; } -section.product-detail div.layouter .details .product-price { +section.product-detail div.layouter form div.product-image-group .cart-fav-seg .wishlist { + position: absolute; + margin-top: -500px; + margin-right: -100px; +} + +section.product-detail div.layouter form .details { + width: 50%; +} + +section.product-detail div.layouter form .details .product-price { margin-bottom: 14px; } -section.product-detail div.layouter .details .product-ratings { +section.product-detail div.layouter form .details .product-ratings { margin-bottom: 20px; } -section.product-detail div.layouter .details .product-ratings .icon { +section.product-detail div.layouter form .details .product-ratings .icon { width: 16px; height: 16px; } -section.product-detail div.layouter .details .product-ratings .total-reviews { +section.product-detail div.layouter form .details .product-ratings .total-reviews { display: inline-block; margin-left: 15px; } -section.product-detail div.layouter .details .product-heading { +section.product-detail div.layouter form .details .product-heading { font-size: 24px; color: #242424; margin-bottom: 15px; } -section.product-detail div.layouter .details .product-price { +section.product-detail div.layouter form .details .product-price { margin-bottom: 15px; font-size: 24px; } -section.product-detail div.layouter .details .product-price .special-price { +section.product-detail div.layouter form .details .product-price .special-price { font-size: 24px; } -section.product-detail div.layouter .details .stock-status { +section.product-detail div.layouter form .details .stock-status { margin-bottom: 15px; } -section.product-detail div.layouter .details .description { +section.product-detail div.layouter form .details .description { margin-bottom: 15px; padding-bottom: 15px; border-bottom: solid 1px rgba(162, 162, 162, 0.2); } -section.product-detail div.layouter .details .full-specifications td { +section.product-detail div.layouter form .details .full-specifications td { padding: 10px 0; color: #5E5E5E; } -section.product-detail div.layouter .details .full-specifications td:first-child { +section.product-detail div.layouter form .details .full-specifications td:first-child { padding-right: 40px; } -section.product-detail div.layouter .details .accordian .accordian-header { +section.product-detail div.layouter form .details .accordian .accordian-header { font-size: 16px; padding-left: 0; font-weight: 600; } -section.product-detail div.layouter .details .attributes { +section.product-detail div.layouter form .details .attributes { display: block; width: 100%; border-bottom: solid 1px rgba(162, 162, 162, 0.2); } -section.product-detail div.layouter .details .full-description { +section.product-detail div.layouter form .details .full-description { font-size: 16px; } -.rating-reviews .rating-header { - font-weight: 600; - padding: 20px 0; -} - -.rating-reviews .stars .icon { - width: 16px; - height: 16px; -} - -.rating-reviews .overall { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-orient: horizontal; - -webkit-box-direction: normal; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: justify; - -ms-flex-pack: justify; - justify-content: space-between; -} - -.rating-reviews .overall .review-info .number { - font-size: 34px; -} - -.rating-reviews .overall .review-info .total-reviews { - margin-top: 10px; -} - -.rating-reviews .reviews { - margin-top: 40px; - margin-bottom: 40px; -} - -.rating-reviews .reviews .review { - margin-bottom: 25px; -} - -.rating-reviews .reviews .review .title { - margin-bottom: 5px; -} - -.rating-reviews .reviews .review .stars { - margin-bottom: 15px; - display: inline-block; -} - -.rating-reviews .reviews .review .message { - margin-bottom: 10px; -} - -.rating-reviews .reviews .review .reviewer-details { - color: #5E5E5E; -} - -.rating-reviews .reviews .view-all { - margin-top: 15px; - color: #0031f0; - margin-bottom: 15px; -} - /* cart pages and elements css begins here */ section.cart { color: #242424; diff --git a/public/themes/default/assets/js/shop.js b/public/themes/default/assets/js/shop.js index 90d771820..ea917445b 100644 --- a/public/themes/default/assets/js/shop.js +++ b/public/themes/default/assets/js/shop.js @@ -214,15 +214,14 @@ module.exports = __webpack_require__(25); window.jQuery = window.$ = $ = __webpack_require__(4); window.Vue = __webpack_require__(5); window.VeeValidate = __webpack_require__(9); -window.axios = __webpack_require__(36); Vue.use(VeeValidate); -Vue.prototype.$http = axios; Vue.component("category-nav", __webpack_require__(10)); Vue.component("category-item", __webpack_require__(13)); Vue.component("image-slider", __webpack_require__(16)); Vue.component("vue-slider", __webpack_require__(24)); +Vue.component("cart-dropdown", __webpack_require__(29)); $(document).ready(function () { @@ -265,6 +264,7 @@ $(document).ready(function () { var flashes = this.$refs.flashes; flashMessages.forEach(function (flash) { + console.log(flash); flashes.addFlash(flash); }, this); }, @@ -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'; /* */ @@ -29913,7 +29913,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 undefined - * typeof document -> undefined - * - * react-native: - * navigator.product -> 'ReactNative' - */ -function isStandardBrowserEnv() { - if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') { - return false; - } - return ( - typeof window !== 'undefined' && - typeof document !== 'undefined' - ); -} - -/** - * Iterate over an Array or an Object invoking a function for each item. - * - * If `obj` is an Array callback will be called passing - * the value, index, and complete array for each item. - * - * If 'obj' is an Object callback will be called passing - * the value, key, and complete object for each property. - * - * @param {Object|Array} obj The object to iterate - * @param {Function} fn The callback to invoke for each item - */ -function forEach(obj, fn) { - // Don't bother if no value provided - if (obj === null || typeof obj === 'undefined') { - return; - } - - // Force an array if not already something iterable - if (typeof obj !== 'object') { - /*eslint no-param-reassign:0*/ - obj = [obj]; - } - - if (isArray(obj)) { - // Iterate over array values - for (var i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - // Iterate over object keys - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - fn.call(null, obj[key], key, obj); - } - } - } -} - -/** - * Accepts varargs expecting each argument to be an object, then - * immutably merges the properties of each object and returns result. - * - * When multiple objects contain the same key the later object in - * the arguments list will take precedence. - * - * Example: - * - * ```js - * var result = merge({foo: 123}, {foo: 456}); - * console.log(result.foo); // outputs 456 - * ``` - * - * @param {Object} obj1 Object to merge - * @returns {Object} Result of all merge properties - */ -function merge(/* obj1, obj2, obj3, ... */) { - var result = {}; - function assignValue(val, key) { - if (typeof result[key] === 'object' && typeof val === 'object') { - result[key] = merge(result[key], val); - } else { - result[key] = val; - } - } - - for (var i = 0, l = arguments.length; i < l; i++) { - forEach(arguments[i], assignValue); - } - return result; -} - -/** - * Extends object a by mutably adding to it the properties of object b. - * - * @param {Object} a The object to be extended - * @param {Object} b The object to copy properties from - * @param {Object} thisArg The object to bind function to - * @return {Object} The resulting value of object a - */ -function extend(a, b, thisArg) { - forEach(b, function assignValue(val, key) { - if (thisArg && typeof val === 'function') { - a[key] = bind(val, thisArg); - } else { - a[key] = val; - } - }); - return a; -} - -module.exports = { - isArray: isArray, - isArrayBuffer: isArrayBuffer, - isBuffer: isBuffer, - isFormData: isFormData, - isArrayBufferView: isArrayBufferView, - isString: isString, - isNumber: isNumber, - isObject: isObject, - isUndefined: isUndefined, - isDate: isDate, - isFile: isFile, - isBlob: isBlob, - isFunction: isFunction, - isStream: isStream, - isURLSearchParams: isURLSearchParams, - isStandardBrowserEnv: isStandardBrowserEnv, - forEach: forEach, - merge: merge, - extend: extend, - trim: trim -}; +module.exports = Component.exports /***/ }), /* 30 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(process) { +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// -var utils = __webpack_require__(29); -var normalizeHeaderName = __webpack_require__(40); -var DEFAULT_CONTENT_TYPE = { - 'Content-Type': 'application/x-www-form-urlencoded' -}; +// define the item component -function setContentTypeIfUnset(headers, value) { - if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { - headers['Content-Type'] = value; - } -} +/* harmony default export */ __webpack_exports__["default"] = ({ + props: { + items: Array + }, -function getDefaultAdapter() { - var adapter; - if (typeof XMLHttpRequest !== 'undefined') { - // For browsers use XHR adapter - adapter = __webpack_require__(32); - } else if (typeof process !== 'undefined') { - // For node use HTTP adapter - adapter = __webpack_require__(32); - } - return adapter; -} + data: function data() { + return { + toggle: true, + totalitems: 0, + cart_items: [] + }; + }, -var defaults = { - adapter: getDefaultAdapter(), - transformRequest: [function transformRequest(data, headers) { - normalizeHeaderName(headers, 'Content-Type'); - if (utils.isFormData(data) || - utils.isArrayBuffer(data) || - utils.isBuffer(data) || - utils.isStream(data) || - utils.isFile(data) || - utils.isBlob(data) - ) { - return data; + computed: { + makeDropdown: function makeDropdown() {} + }, + + mounted: function mounted() { + if (this.items != undefined) this.initializeDropdown(); + }, + + methods: { + dropOrHide: function dropOrHide() { + if (this.toggle == false) { + this.toggle = true; + } else { + this.toggle = false; + } + }, + + initializeDropdown: function initializeDropdown() { + this.totalitems = this.items.length; + } } - if (utils.isArrayBufferView(data)) { - return data.buffer; - } - if (utils.isURLSearchParams(data)) { - setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); - return data.toString(); - } - if (utils.isObject(data)) { - setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); - return JSON.stringify(data); - } - return data; - }], - - transformResponse: [function transformResponse(data) { - /*eslint no-param-reassign:0*/ - if (typeof data === 'string') { - try { - data = JSON.parse(data); - } catch (e) { /* Ignore */ } - } - return data; - }], - - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', - - maxContentLength: -1, - - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - } -}; - -defaults.headers = { - common: { - 'Accept': 'application/json, text/plain, */*' - } -}; - -utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { - defaults.headers[method] = {}; }); -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); -}); - -module.exports = defaults; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8))) - /***/ }), /* 31 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; - - -module.exports = function bind(fn, thisArg) { - return function wrap() { - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - return fn.apply(thisArg, args); - }; -}; - +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("div", [ + _c("ul", { staticClass: "cart-dropdown", on: { click: _vm.dropOrHide } }, [ + _c("li", { staticClass: "cart-summary" }, [ + _c("span", { staticClass: "icon cart-icon" }), + _vm._v(" "), + _c("span", { staticClass: "cart" }, [ + _vm.totalitems > 0 + ? _c("span", { staticClass: "cart-count" }, [ + _vm._v(_vm._s(_vm.totalitems)) + ]) + : _vm._e(), + _vm._v("Products") + ]), + _vm._v(" "), + _c("span", { staticClass: "icon arrow-down-icon" }) + ]) + ]), + _vm._v(" "), + _c("div", { staticClass: "dropdown-cart", class: { show: _vm.toggle } }, [ + _c("div", { staticClass: "dropdown-header" }, [ + _c("p", { staticClass: "heading" }, [_vm._v("Cart Subtotal - $80")]), + _vm._v(" "), + _c("i", { + staticClass: "icon icon-menu-close", + on: { click: _vm.dropOrHide } + }) + ]), + _vm._v(" "), + _vm._m(0), + _vm._v(" "), + _vm._m(1) + ]) + ]) +} +var staticRenderFns = [ + function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("div", { staticClass: "dropdown-content" }, [ + _c("div", { staticClass: "item" }, [ + _c("div", { staticClass: "item-image" }, [_c("img")]), + _vm._v(" "), + _c("div", { staticClass: "item-details" }, [ + _c("div", { staticClass: "item-name" }, [_vm._v("Some Item Name")]), + _vm._v(" "), + _c("div", { staticClass: "item-price" }, [_vm._v("$ Some Price")]), + _vm._v(" "), + _c("div", { staticClass: "item-qty" }, [_vm._v("Some Quantity")]) + ]) + ]) + ]) + }, + function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("div", { staticClass: "dropdown-footer" }, [ + _c("a", { attrs: { href: "/" } }, [_vm._v("View Shopping Cart")]), + _vm._v(" "), + _c("button", { staticClass: "btn btn-primary btn-lg" }, [ + _vm._v("CHECKOUT") + ]) + ]) + } +] +render._withStripped = true +module.exports = { render: render, staticRenderFns: staticRenderFns } +if (false) { + module.hot.accept() + if (module.hot.data) { + require("vue-hot-reload-api") .rerender("data-v-0f947e82", module.exports) + } +} /***/ }), /* 32 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; - - -var utils = __webpack_require__(29); -var settle = __webpack_require__(41); -var buildURL = __webpack_require__(43); -var parseHeaders = __webpack_require__(44); -var isURLSameOrigin = __webpack_require__(45); -var createError = __webpack_require__(33); -var btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || __webpack_require__(46); - -module.exports = function xhrAdapter(config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - var requestData = config.data; - var requestHeaders = config.headers; - - if (utils.isFormData(requestData)) { - delete requestHeaders['Content-Type']; // Let the browser set it - } - - var request = new XMLHttpRequest(); - var loadEvent = 'onreadystatechange'; - var xDomain = false; - - // For IE 8/9 CORS support - // Only supports POST and GET calls and doesn't returns the response headers. - // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest. - if ("development" !== 'test' && - typeof window !== 'undefined' && - window.XDomainRequest && !('withCredentials' in request) && - !isURLSameOrigin(config.url)) { - request = new window.XDomainRequest(); - loadEvent = 'onload'; - xDomain = true; - request.onprogress = function handleProgress() {}; - request.ontimeout = function handleTimeout() {}; - } - - // HTTP basic authentication - if (config.auth) { - var username = config.auth.username || ''; - var password = config.auth.password || ''; - requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); - } - - request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true); - - // Set the request timeout in MS - request.timeout = config.timeout; - - // Listen for ready state - request[loadEvent] = function handleLoad() { - if (!request || (request.readyState !== 4 && !xDomain)) { - return; - } - - // The request errored out and we didn't get a response, this will be - // handled by onerror instead - // With one exception: request that using file: protocol, most browsers - // will return status as 0 even though it's a successful request - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { - return; - } - - // Prepare the response - var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; - var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; - var response = { - data: responseData, - // IE sends 1223 instead of 204 (https://github.com/axios/axios/issues/201) - status: request.status === 1223 ? 204 : request.status, - statusText: request.status === 1223 ? 'No Content' : request.statusText, - headers: responseHeaders, - config: config, - request: request - }; - - settle(resolve, reject, response); - - // Clean up request - request = null; - }; - - // Handle low level network errors - request.onerror = function handleError() { - // Real errors are hidden from us by the browser - // onerror should only fire if it's a network error - reject(createError('Network Error', config, null, request)); - - // Clean up request - request = null; - }; - - // Handle timeout - request.ontimeout = function handleTimeout() { - reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', - request)); - - // Clean up request - request = null; - }; - - // Add xsrf header - // This is only done if running in a standard browser environment. - // Specifically not if we're in a web worker, or react-native. - if (utils.isStandardBrowserEnv()) { - var cookies = __webpack_require__(47); - - // Add xsrf header - var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ? - cookies.read(config.xsrfCookieName) : - undefined; - - if (xsrfValue) { - requestHeaders[config.xsrfHeaderName] = xsrfValue; - } - } - - // Add headers to the request - if ('setRequestHeader' in request) { - utils.forEach(requestHeaders, function setRequestHeader(val, key) { - if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { - // Remove Content-Type if data is undefined - delete requestHeaders[key]; - } else { - // Otherwise add header to the request - request.setRequestHeader(key, val); - } - }); - } - - // Add withCredentials to request if needed - if (config.withCredentials) { - request.withCredentials = true; - } - - // Add responseType to request if needed - if (config.responseType) { - try { - request.responseType = config.responseType; - } catch (e) { - // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2. - // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function. - if (config.responseType !== 'json') { - throw e; - } - } - } - - // Handle progress if needed - if (typeof config.onDownloadProgress === 'function') { - request.addEventListener('progress', config.onDownloadProgress); - } - - // Not all browsers support upload events - if (typeof config.onUploadProgress === 'function' && request.upload) { - request.upload.addEventListener('progress', config.onUploadProgress); - } - - if (config.cancelToken) { - // Handle cancellation - config.cancelToken.promise.then(function onCanceled(cancel) { - if (!request) { - return; - } - - request.abort(); - reject(cancel); - // Clean up request - request = null; - }); - } - - if (requestData === undefined) { - requestData = null; - } - - // Send the request - request.send(requestData); - }); -}; +// style-loader: Adds some css to the DOM by adding a