diff --git a/composer.json b/composer.json
index 75737c25f..e8c256c1c 100644
--- a/composer.json
+++ b/composer.json
@@ -1,6 +1,6 @@
{
- "name": "jitendra-webkul/bagisto",
- "description": "The Laravel Framework.",
+ "name": "bagisto/bagisto",
+ "description": "Bagisto Ecommerce",
"keywords": [
"framework",
"laravel"
diff --git a/config/app.php b/config/app.php
index 8f3b0c274..863daad76 100644
--- a/config/app.php
+++ b/config/app.php
@@ -65,7 +65,7 @@ return [
|
*/
- 'timezone' => 'UTC',
+ 'timezone' => 'Asia/Kolkata',
/*
|--------------------------------------------------------------------------
diff --git a/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php b/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php
index 982033ebc..50a5dd83f 100644
--- a/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php
+++ b/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php
@@ -29,7 +29,7 @@ class AttributeDataGrid
'name' => 'Attributes',
'table' => 'attributes',
'select' => 'id',
- 'perpage' => 5,
+ 'perpage' => 10,
'aliased' => true,
'massoperations' => [
diff --git a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php
index 461e208b1..2f4d0f9eb 100644
--- a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php
+++ b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php
@@ -62,12 +62,6 @@ class CategoryDataGrid
'primaryKey' => 'cat.id',
'condition' => '=',
'secondaryKey' => 'ct.category_id',
- ], [
- 'join' => 'leftjoin',
- 'table' => 'category_translations as cta',
- 'primaryKey' => 'cat.parent_id',
- 'condition' => '=',
- 'secondaryKey' => 'cta.category_id',
],
],
@@ -92,13 +86,15 @@ class CategoryDataGrid
'type' => 'string',
'label' => 'Category Position',
'sortable' => false,
- ], [
- 'name' => 'cta.name',
- 'alias' => 'parent_name',
- 'type' => 'string',
- 'label' => 'Parent Name',
- 'sortable' => true,
- ], [
+ ],
+ // [
+ // 'name' => 'cta.name',
+ // 'alias' => 'parent_name',
+ // 'type' => 'string',
+ // 'label' => 'Parent Name',
+ // 'sortable' => true,
+ // ],
+ [
'name' => 'cat.status',
'alias' => 'cat_status',
'type' => 'string',
@@ -110,15 +106,16 @@ class CategoryDataGrid
else
return "True";
},
- ], [
- 'name' => 'cta.locale',
+ ],
+ [
+ 'name' => 'ct.locale',
'alias' => 'cat_locale',
'type' => 'string',
'label' => 'Locale',
'sortable' => true,
'filter' => [
- 'function' => 'where',
- 'condition' => ['cta.locale', app()->getLocale()]
+ 'function' => 'orWhere',
+ 'condition' => ['ct.locale', app()->getLocale()]
],
]
],
@@ -134,12 +131,14 @@ class CategoryDataGrid
'alias' => 'catName',
'type' => 'string',
'label' => 'Category Name',
- ], [
- 'column' => 'cta.name',
- 'alias' => 'parentName',
- 'type' => 'string',
- 'label' => 'Parent Name',
- ], [
+ ],
+ // [
+ // 'column' => 'cta.name',
+ // 'alias' => 'parentName',
+ // 'type' => 'string',
+ // 'label' => 'Parent Name',
+ // ],
+ [
'column' => 'cat.status',
'alias' => 'catStatus',
'type' => 'string',
diff --git a/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php
index fcb325618..6d2c9243c 100644
--- a/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php
+++ b/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php
@@ -29,7 +29,7 @@ class ChannelDataGrid
'name' => 'Channels',
'table' => 'channels',
'select' => 'id',
- 'perpage' => 5,
+ 'perpage' => 10,
'aliased' => false, //use this with false as default and true in case of joins
'massoperations' =>[
diff --git a/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php
index e672a7fe0..a4c81b178 100644
--- a/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php
+++ b/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php
@@ -28,7 +28,7 @@ class CurrencyDataGrid
'name' => 'Currencies',
'table' => 'currencies',
'select' => 'id',
- 'perpage' => 5,
+ 'perpage' => 10,
'aliased' => false, //use this with false as default and true in case of joins
'massoperations' =>[
diff --git a/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php
index 9171064dd..aae8fa614 100644
--- a/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php
+++ b/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php
@@ -29,7 +29,7 @@ class ExchangeRatesDataGrid
'name' => 'Exchange Rates',
'table' => 'currency_exchange_rates as cer',
'select' => 'cer.id',
- 'perpage' => 5,
+ 'perpage' => 10,
'aliased' => true, //use this with false as default and true in case of joins
'massoperations' =>[
diff --git a/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php
index 85d091a3b..54dce8ae1 100644
--- a/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php
+++ b/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php
@@ -27,7 +27,7 @@ class InventorySourcesDataGrid
'name' => 'Inventory Sources',
'table' => 'inventory_sources',
'select' => 'id',
- 'perpage' => 5,
+ 'perpage' => 10,
'aliased' => false, //use this with false as default and true in case of joins
'massoperations' =>[
diff --git a/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php
index 1f53304e4..d9f3d051c 100644
--- a/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php
+++ b/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php
@@ -28,7 +28,7 @@ class LocalesDataGrid
'name' => 'Locales',
'table' => 'locales',
'select' => 'id',
- 'perpage' => 5,
+ 'perpage' => 10,
'aliased' => false, //use this with false as default and true in case of joins
'massoperations' =>[
diff --git a/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php
index 477d5dde3..9325c1d3d 100644
--- a/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php
+++ b/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php
@@ -27,7 +27,7 @@ class OrderDataGrid
'name' => 'orders',
'table' => 'orders as or',
'select' => 'or.id',
- 'perpage' => 5,
+ 'perpage' => 10,
'aliased' => false,
//True in case of joins else aliasing key required on all cases
diff --git a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php
index 3f81843f0..4c2fdc94d 100644
--- a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php
+++ b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php
@@ -26,7 +26,7 @@ class ProductDataGrid
'name' => 'Products',
'table' => 'products_grid as prods',
'select' => 'prods.product_id',
- 'perpage' => 5,
+ 'perpage' => 10,
'aliased' => true, //use this with false as default and true in case of joins
'massoperations' =>[
diff --git a/packages/Webkul/Admin/src/DataGrids/RolesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/RolesDataGrid.php
index 7bfeb06cc..74cc41cac 100644
--- a/packages/Webkul/Admin/src/DataGrids/RolesDataGrid.php
+++ b/packages/Webkul/Admin/src/DataGrids/RolesDataGrid.php
@@ -29,7 +29,7 @@ class RolesDataGrid
'name' => 'Roles',
'table' => 'roles',
'select' => 'id',
- 'perpage' => 5,
+ 'perpage' => 10,
'aliased' => false, //use this with false as default and true in case of joins
'massoperations' =>[
diff --git a/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php b/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php
index 759fb0f45..766dbfff2 100644
--- a/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php
+++ b/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php
@@ -28,7 +28,7 @@ class SliderDataGrid
'name' => 'Sliders',
'table' => 'sliders as s',
'select' => 's.id',
- 'perpage' => 5,
+ 'perpage' => 10,
'aliased' => true, //use this with false as default and true in case of joins
'massoperations' =>[
diff --git a/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php b/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php
index bb42e8bba..ad35971d1 100644
--- a/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php
+++ b/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php
@@ -29,7 +29,7 @@ class UserDataGrid
'name' => 'Admins',
'table' => 'admins as u',
'select' => 'u.id',
- 'perpage' => 5,
+ 'perpage' => 10,
'aliased' => true, //use this with false as default and true in case of joins
'massoperations' =>[
diff --git a/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php b/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php
index bee17a769..c2ba72402 100644
--- a/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php
+++ b/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php
@@ -180,6 +180,7 @@ class DashboardController extends Controller
'stock_threshold' => $this->getStockThreshold(),
];
+
foreach (core()->getTimeInterval($this->startDate, $this->endDate) as $interval) {
$statistics['sale_graph']['label'][] = $interval['start']->format('d M');
diff --git a/packages/Webkul/Admin/src/Listeners/Product.php b/packages/Webkul/Admin/src/Listeners/Product.php
index 59648f121..97a7d0776 100644
--- a/packages/Webkul/Admin/src/Listeners/Product.php
+++ b/packages/Webkul/Admin/src/Listeners/Product.php
@@ -43,26 +43,127 @@ class Product {
$this->price = $price;
}
+ /**
+ * Prepare the data from the product created
+ *
+ * @return array $data
+ */
+ public function prepareData($product) {
+ $gridObject = [];
+ $gridObject = [
+ 'product_id' => $product->id,
+ 'sku' => $product->sku,
+ 'type' => $product->type,
+ 'attribute_family_name' => $product->attribute_family->name,
+ ];
+
+ $variantObjects = [];
+
+ if($this->productGrid->findOneByField('product_id', $product->id)) {
+ $gridObject['name'] = $product->name;
+ $gridObject['status'] = $product->status;
+
+ if($product->type == 'configurable') {
+ $gridObject['quantity'] = 0;
+ $gridObject['price'] = $this->price->getMinimalPrice($product);
+
+ $variants = $product->variants;
+
+ if(count($variants)) {
+ foreach($variants as $variant) {
+ $variantObject = [
+ 'product_id' => $variant->id,
+ 'sku' => $variant->sku,
+ 'type' => $variant->type,
+ 'attribute_family_name' => $variant->toArray()['attribute_family']['name'],
+ 'name' => $variant->name,
+ 'status' => $variant->status,
+ ];
+
+ $qty = 1;
+
+ foreach($variant->toArray()['inventories'] as $inventorySource) {
+ $qty = $qty + $inventorySource['qty'];
+ }
+
+ $variantObject['price'] = $product->price;
+ $variantObject['quantity'] = $qty;
+
+ array_push($variantObjects, $variantObject);
+
+ $qty = 0;
+ }
+ }
+ } else {
+ $qty = 0;
+
+ foreach($product->toArray()['inventories'] as $inventorySource) {
+ $qty = $qty + $inventorySource['qty'];
+ }
+
+ $gridObject['price'] = $product->price;
+ $gridObject['quantity'] = $qty;
+
+ $qty = 0;
+ }
+ }
+ // dd($gridObject, $variantObjects);
+ return [
+ 'parent' => $gridObject,
+ 'variants' => $variantObjects
+ ];
+ }
+
/**
* Creates a new entry in the product grid whenever a new product is created.
*
* @return boolean
*/
public function afterProductCreated($product) {
- $gridObject = [];
+ $data = $this->prepareData($product);
- $gridObject = [
- 'product_id' => $product->id,
- 'sku' => $product->sku,
- 'type' => $product->type,
- 'attribute_family_name' => $product->toArray()['attribute_family']['name'],
- ];
+ $result = $this->saveProduct($product, $data);
- if($this->productGrid->create($gridObject)) {
- return true;
+ return $result;
+ }
+
+ /**
+ * Save the product to the product as the product data grid instance
+ *
+ * @return boolean
+ */
+ public function saveProduct($product, $data) {
+
+ $productGridObject = $this->productGrid->findOneByField('product_id', $product->id);
+ // dd($product, $data, $productGridObject);
+ if (!is_null($productGridObject)) {
+ if($product->type == 'simple') {
+ $r = $productGridObject->update($data['parent']);
+ } else {
+ $productGridObject->update($data['parent']);
+ if(count($data['variants'])) {
+ dd($data['variants']);
+ foreach($data['variants'] as $variant) {
+ $variantObject = $this->productGrid->findOneByField('product_id', $variant['product_id']);
+ if(!is_null($variantObject)) {
+ $variantObject->update($variant);
+ } else {
+ $this->productGrid->create($variant);
+ }
+ }
+ }
+ }
} else {
- return false;
+ $this->productGrid->create($data['parent']);
+
+ //no need for tese lines
+ if(count($data['variants'])) {
+ foreach($data['variants'] as $variant) {
+ $this->productGrid->create($variant);
+ }
+ }
}
+ return true;
}
/**
diff --git a/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php b/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php
index c1f2078ef..4388a8f6b 100644
--- a/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php
+++ b/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php
@@ -45,7 +45,7 @@ class NewInvoiceNotification extends Mailable
$order = $this->invoice->order;
return $this->to($order->customer_email, $order->customer_full_name)
- ->subject(trans('admin::app.mail.invoice.subject', ['order_id' => $order->id]))
+ ->subject(trans('shop::app.mail.invoice.subject', ['order_id' => $order->id]))
->view('shop::emails.sales.new-invoice');
}
}
diff --git a/packages/Webkul/Admin/src/Mail/NewOrderNotification.php b/packages/Webkul/Admin/src/Mail/NewOrderNotification.php
index daa5c7a2d..d656499c7 100644
--- a/packages/Webkul/Admin/src/Mail/NewOrderNotification.php
+++ b/packages/Webkul/Admin/src/Mail/NewOrderNotification.php
@@ -42,7 +42,7 @@ class NewOrderNotification extends Mailable
public function build()
{
return $this->to($this->order->customer_email, $this->order->customer_full_name)
- ->subject(trans('admin::app.mail.order.subject'))
+ ->subject(trans('shop::app.mail.order.subject'))
->view('shop::emails.sales.new-order');
}
}
diff --git a/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php b/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php
index 34c89da2d..005ba74a9 100644
--- a/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php
+++ b/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php
@@ -45,7 +45,7 @@ class NewShipmentNotification extends Mailable
$order = $this->shipment->order;
return $this->to($order->customer_email, $order->customer_full_name)
- ->subject(trans('admin::app.mail.shipment.subject', ['order_id' => $order->id]))
+ ->subject(trans('shop::app.mail.shipment.subject', ['order_id' => $order->id]))
->view('shop::emails.sales.new-shipment');
}
}
diff --git a/packages/Webkul/Admin/src/Resources/views/sales/invoices/create.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/invoices/create.blade.php
index 7c68bba07..c556936cd 100644
--- a/packages/Webkul/Admin/src/Resources/views/sales/invoices/create.blade.php
+++ b/packages/Webkul/Admin/src/Resources/views/sales/invoices/create.blade.php
@@ -219,7 +219,13 @@
@if ($item->qty_to_invoice > 0)
| {{ $item->type == 'configurable' ? $item->child->sku : $item->sku }} |
- {{ $item->name }} |
+
+ {{ $item->name }}
+
+ @if ($html = $item->getOptionDetailHtml())
+ {{ $html }}
+ @endif
+ |
{{ $item->qty_ordered }} |
diff --git a/packages/Webkul/Admin/src/Resources/views/sales/invoices/view.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/invoices/view.blade.php
index 9c90f8c52..4da8ee888 100644
--- a/packages/Webkul/Admin/src/Resources/views/sales/invoices/view.blade.php
+++ b/packages/Webkul/Admin/src/Resources/views/sales/invoices/view.blade.php
@@ -218,7 +218,13 @@
@foreach ($invoice->items as $item)
| {{ $item->child ? $item->child->sku : $item->sku }} |
- {{ $item->name }} |
+
+ {{ $item->name }}
+
+ @if ($html = $item->getOptionDetailHtml())
+ {{ $html }}
+ @endif
+ |
{{ core()->formatBasePrice($item->base_price) }} |
{{ $item->qty }} |
{{ core()->formatBasePrice($item->base_total) }} |
diff --git a/packages/Webkul/Admin/src/Resources/views/sales/orders/view.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/orders/view.blade.php
index 7e64b6e95..779755f02 100644
--- a/packages/Webkul/Admin/src/Resources/views/sales/orders/view.blade.php
+++ b/packages/Webkul/Admin/src/Resources/views/sales/orders/view.blade.php
@@ -232,7 +232,13 @@
{{ $item->type == 'configurable' ? $item->child->sku : $item->sku }}
|
- {{ $item->name }} |
+
+ {{ $item->name }}
+
+ @if ($html = $item->getOptionDetailHtml())
+ {{ $html }}
+ @endif
+ |
{{ core()->formatBasePrice($item->base_price) }} |
{{ $item->qty_ordered }} |
diff --git a/packages/Webkul/Admin/src/Resources/views/sales/shipments/create.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/shipments/create.blade.php
index 481384e26..7b1772f23 100644
--- a/packages/Webkul/Admin/src/Resources/views/sales/shipments/create.blade.php
+++ b/packages/Webkul/Admin/src/Resources/views/sales/shipments/create.blade.php
@@ -235,7 +235,13 @@
@if ($item->qty_to_ship > 0)
|
| {{ $item->type == 'configurable' ? $item->child->sku : $item->sku }} |
- {{ $item->name }} |
+
+ {{ $item->name }}
+
+ @if ($html = $item->getOptionDetailHtml())
+ {{ $html }}
+ @endif
+ |
{{ $item->qty_ordered }} |
diff --git a/packages/Webkul/Admin/src/Resources/views/sales/shipments/view.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/shipments/view.blade.php
index fd8c5ae50..666ebb18d 100644
--- a/packages/Webkul/Admin/src/Resources/views/sales/shipments/view.blade.php
+++ b/packages/Webkul/Admin/src/Resources/views/sales/shipments/view.blade.php
@@ -233,7 +233,13 @@
@foreach ($shipment->items as $item)
| {{ $item->sku }} |
- {{ $item->name }} |
+
+ {{ $item->name }}
+
+ @if ($html = $item->getOptionDetailHtml())
+ {{ $html }}
+ @endif
+ |
{{ $item->qty }} |
@endforeach
diff --git a/packages/Webkul/Attribute/src/Database/Seeders/AttributeFamilyTableSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/AttributeFamilyTableSeeder.php
index 564504e84..c93bec117 100644
--- a/packages/Webkul/Attribute/src/Database/Seeders/AttributeFamilyTableSeeder.php
+++ b/packages/Webkul/Attribute/src/Database/Seeders/AttributeFamilyTableSeeder.php
@@ -3,153 +3,16 @@
namespace Webkul\Attribute\Database\Seeders;
use Illuminate\Database\Seeder;
-use Webkul\Attribute\Repositories\AttributeFamilyRepository;
+use DB;
class AttributeFamilyTableSeeder extends Seeder
{
- /**
- * @var array
- */
- protected $rawData = [
- [
- "code" => "default",
- "name" => "Default",
- "is_user_defined" => 0,
- 'attribute_groups' => [
- [
- "name" => "General",
- "is_user_defined" => 0,
- "position" => 1,
- "custom_attributes" => [
- [
- 'code' => 'sku',
- 'position' => 1
- ], [
- 'code' => 'name',
- 'position' => 2
- ], [
- 'code' => 'url_key',
- 'position' => 3
- ], [
- 'code' => 'tax_category_id',
- 'position' => 4
- ], [
- 'code' => 'new',
- 'position' => 5
- ], [
- 'code' => 'featured',
- 'position' => 6
- ], [
- 'code' => 'visible_individually',
- 'position' => 7
- ], [
- 'code' => 'status',
- 'position' => 8
- ], [
- 'code' => 'color',
- 'position' => 9
- ], [
- 'code' => 'size',
- 'position' => 10
- ]
- ]
- ], [
- "name" => "Description",
- "is_user_defined" => 0,
- "position" => 2,
- "custom_attributes" => [
- [
- 'code' => 'short_description',
- 'position' => 1
- ], [
- 'code' => 'description',
- 'position' => 2
- ]
- ]
- ], [
- "name" => "Meta Description",
- "is_user_defined" => 0,
- "position" => 3,
- "custom_attributes" => [
- [
- 'code' => 'meta_title',
- 'position' => 1
- ], [
- 'code' => 'meta_keywords',
- 'position' => 2
- ], [
- 'code' => 'meta_description',
- 'position' => 3
- ]
- ]
- ], [
- "name" => "Price",
- "is_user_defined" => 0,
- "position" => 4,
- "custom_attributes" => [
- [
- 'code' => 'price',
- 'position' => 1
- ], [
- 'code' => 'cost',
- 'position' => 2
- ], [
- 'code' => 'special_price',
- 'position' => 3
- ], [
- 'code' => 'special_price_from',
- 'position' => 4
- ], [
- 'code' => 'special_price_to',
- 'position' => 5
- ]
- ]
- ], [
- "name" => "Shipping",
- "is_user_defined" => 0,
- "position" => 5,
- "custom_attributes" => [
- [
- 'code' => 'width',
- 'position' => 1
- ], [
- 'code' => 'height',
- 'position' => 2
- ], [
- 'code' => 'depth',
- 'position' => 3
- ], [
- 'code' => 'weight',
- 'position' => 4
- ]
- ]
- ]
- ]
- ]
- ];
-
- /**
- * AttributeFamilyRepository object
- *
- * @var array
- */
- protected $attributeFamily;
-
- /**
- * Create a new controller instance.
- *
- * @param Webkul\Attribute\Repositories\AttributeFamilyRepository $attributeFamily
- * @return void
- */
- public function __construct(AttributeFamilyRepository $attributeFamily)
- {
- $this->attributeFamily = $attributeFamily;
- }
-
public function run()
{
- foreach($this->rawData as $row) {
- $this->attributeFamily->create($row);
- }
+ DB::table('attribute_families')->delete();
+
+ DB::table('attribute_families')->insert([
+ ['id' => '1','code' => 'default','name' => 'Default','status' => '0','is_user_defined' => '1']
+ ]);
}
}
\ No newline at end of file
diff --git a/packages/Webkul/Attribute/src/Database/Seeders/AttributeGroupTableSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/AttributeGroupTableSeeder.php
new file mode 100644
index 000000000..78d719819
--- /dev/null
+++ b/packages/Webkul/Attribute/src/Database/Seeders/AttributeGroupTableSeeder.php
@@ -0,0 +1,49 @@
+delete();
+
+ DB::table('attribute_groups')->insert([
+ ['id' => '1','name' => 'General','position' => '1','is_user_defined' => '0','attribute_family_id' => '1'],
+ ['id' => '2','name' => 'Description','position' => '2','is_user_defined' => '0','attribute_family_id' => '1'],
+ ['id' => '3','name' => 'Meta Description','position' => '3','is_user_defined' => '0','attribute_family_id' => '1'],
+ ['id' => '4','name' => 'Price','position' => '4','is_user_defined' => '0','attribute_family_id' => '1'],
+ ['id' => '5','name' => 'Shipping','position' => '5','is_user_defined' => '0','attribute_family_id' => '1']
+ ]);
+
+ DB::table('attribute_group_mappings')->insert([
+ ['attribute_id' => '1','attribute_group_id' => '1','position' => '1'],
+ ['attribute_id' => '2','attribute_group_id' => '1','position' => '2'],
+ ['attribute_id' => '3','attribute_group_id' => '1','position' => '3'],
+ ['attribute_id' => '4','attribute_group_id' => '1','position' => '4'],
+ ['attribute_id' => '5','attribute_group_id' => '1','position' => '5'],
+ ['attribute_id' => '6','attribute_group_id' => '1','position' => '6'],
+ ['attribute_id' => '7','attribute_group_id' => '1','position' => '7'],
+ ['attribute_id' => '8','attribute_group_id' => '1','position' => '8'],
+ ['attribute_id' => '9','attribute_group_id' => '2','position' => '1'],
+ ['attribute_id' => '10','attribute_group_id' => '2','position' => '2'],
+ ['attribute_id' => '11','attribute_group_id' => '4','position' => '1'],
+ ['attribute_id' => '12','attribute_group_id' => '4','position' => '2'],
+ ['attribute_id' => '13','attribute_group_id' => '4','position' => '3'],
+ ['attribute_id' => '14','attribute_group_id' => '4','position' => '4'],
+ ['attribute_id' => '15','attribute_group_id' => '4','position' => '5'],
+ ['attribute_id' => '16','attribute_group_id' => '3','position' => '1'],
+ ['attribute_id' => '17','attribute_group_id' => '3','position' => '2'],
+ ['attribute_id' => '18','attribute_group_id' => '3','position' => '3'],
+ ['attribute_id' => '19','attribute_group_id' => '5','position' => '1'],
+ ['attribute_id' => '20','attribute_group_id' => '5','position' => '2'],
+ ['attribute_id' => '21','attribute_group_id' => '5','position' => '3'],
+ ['attribute_id' => '22','attribute_group_id' => '5','position' => '4'],
+ ['attribute_id' => '23','attribute_group_id' => '1','position' => '9'],
+ ['attribute_id' => '24','attribute_group_id' => '1','position' => '10']
+ ]);
+ }
+}
\ No newline at end of file
diff --git a/packages/Webkul/Attribute/src/Database/Seeders/AttributeOptionTableSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/AttributeOptionTableSeeder.php
new file mode 100644
index 000000000..0135f6e76
--- /dev/null
+++ b/packages/Webkul/Attribute/src/Database/Seeders/AttributeOptionTableSeeder.php
@@ -0,0 +1,39 @@
+delete();
+
+ DB::table('attribute_options')->insert([
+ ['id' => '1','admin_name' => 'Red','sort_order' => '1','attribute_id' => '23'],
+ ['id' => '2','admin_name' => 'Green','sort_order' => '2','attribute_id' => '23'],
+ ['id' => '3','admin_name' => 'Yellow','sort_order' => '3','attribute_id' => '23'],
+ ['id' => '4','admin_name' => 'Black','sort_order' => '4','attribute_id' => '23'],
+ ['id' => '5','admin_name' => 'White','sort_order' => '5','attribute_id' => '23'],
+ ['id' => '6','admin_name' => 'S','sort_order' => '1','attribute_id' => '24'],
+ ['id' => '7','admin_name' => 'M','sort_order' => '2','attribute_id' => '24'],
+ ['id' => '8','admin_name' => 'L','sort_order' => '3','attribute_id' => '24'],
+ ['id' => '9','admin_name' => 'XL','sort_order' => '4','attribute_id' => '24']
+ ]);
+
+ DB::table('attribute_option_translations')->insert([
+ ['id' => '1','locale' => 'en','label' => 'Red','attribute_option_id' => '1'],
+ ['id' => '2','locale' => 'en','label' => 'Green','attribute_option_id' => '2'],
+ ['id' => '3','locale' => 'en','label' => 'Yellow','attribute_option_id' => '3'],
+ ['id' => '4','locale' => 'en','label' => 'Black','attribute_option_id' => '4'],
+ ['id' => '5','locale' => 'en','label' => 'White','attribute_option_id' => '5'],
+ ['id' => '6','locale' => 'en','label' => 'S','attribute_option_id' => '6'],
+ ['id' => '7','locale' => 'en','label' => 'M','attribute_option_id' => '7'],
+ ['id' => '8','locale' => 'en','label' => 'L','attribute_option_id' => '8'],
+ ['id' => '9','locale' => 'en','label' => 'XL','attribute_option_id' => '9']
+ ]);
+ }
+}
\ No newline at end of file
diff --git a/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php
index 2968c37c4..0a949203d 100644
--- a/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php
+++ b/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php
@@ -3,444 +3,71 @@
namespace Webkul\Attribute\Database\Seeders;
use Illuminate\Database\Seeder;
-use Webkul\Attribute\Repositories\AttributeRepository;
+use DB;
+use Carbon\Carbon;
class AttributeTableSeeder extends Seeder
{
- /**
- * @var array
- */
- protected $rawData = [
- [
- 'code' => 'sku',
- 'admin_name' => 'SKU',
- 'en' => [
- 'name' => 'SKU'
- ],
- 'type' => 'text',
- 'position' => 1,
- 'is_unique' => 1,
- 'is_required' => 1,
- 'value_per_locale' => 0,
- 'value_per_channel' => 0,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 0
- ], [
- 'code' => 'name',
- 'admin_name' => 'Name',
- 'en' => [
- 'name' => 'Name'
- ],
- 'type' => 'text',
- 'position' => 2,
- 'is_required' => 1,
- 'value_per_locale' => 1,
- 'value_per_channel' => 1,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 0
- ], [
- 'code' => 'url_key',
- 'admin_name' => 'URL Key',
- 'en' => [
- 'name' => 'URL Key'
- ],
- 'type' => 'text',
- 'position' => 3,
- 'is_unique' => 1,
- 'is_required' => 1,
- 'value_per_locale' => 0,
- 'value_per_channel' => 0,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 0
- ], [
- 'code' => 'tax_category_id',
- 'admin_name' => 'Tax Category',
- 'en' => [
- 'name' => 'Tax Category'
- ],
- 'type' => 'select',
- 'position' => 4,
- 'is_unique' => 0,
- 'is_required' => 0,
- 'value_per_locale' => 0,
- 'value_per_channel' => 1,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 0
- ], [
- 'code' => 'new',
- 'admin_name' => 'New',
- 'en' => [
- 'name' => 'New'
- ],
- 'type' => 'boolean',
- 'position' => 5,
- 'is_required' => 0,
- 'value_per_locale' => 0,
- 'value_per_channel' => 0,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 0
- ], [
- 'code' => 'featured',
- 'admin_name' => 'Featured',
- 'en' => [
- 'name' => 'Featured'
- ],
- 'type' => 'boolean',
- 'position' => 6,
- 'is_required' => 0,
- 'value_per_locale' => 0,
- 'value_per_channel' => 0,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 0
- ], [
- 'code' => 'visible_individually',
- 'admin_name' => 'Visible Individually',
- 'en' => [
- 'name' => 'Visible Individually'
- ],
- 'type' => 'boolean',
- 'position' => 7,
- 'is_required' => 1,
- 'value_per_locale' => 0,
- 'value_per_channel' => 0,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 0
- ], [
- 'code' => 'status',
- 'admin_name' => 'Status',
- 'en' => [
- 'name' => 'Status'
- ],
- 'type' => 'boolean',
- 'position' => 8,
- 'is_required' => 1,
- 'value_per_locale' => 0,
- 'value_per_channel' => 0,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 0
- ], [
- 'code' => 'short_description',
- 'admin_name' => 'Short Description',
- 'en' => [
- 'name' => 'Short Description'
- ],
- 'type' => 'textarea',
- 'position' => 9,
- 'is_required' => 1,
- 'value_per_locale' => 1,
- 'value_per_channel' => 1,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 0
- ], [
- 'code' => 'description',
- 'admin_name' => 'Description',
- 'en' => [
- 'name' => 'Description'
- ],
- 'type' => 'textarea',
- 'position' => 10,
- 'is_required' => 1,
- 'value_per_locale' => 1,
- 'value_per_channel' => 1,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 0
- ], [
- 'code' => 'price',
- 'admin_name' => 'Price',
- 'en' => [
- 'name' => 'Price'
- ],
- 'type' => 'price',
- 'position' => 11,
- 'is_required' => 1,
- 'value_per_locale' => 0,
- 'value_per_channel' => 0,
- 'is_filterable' => 1,
- 'is_configurable' => 0,
- 'is_user_defined' => 0
- ], [
- 'code' => 'cost',
- 'admin_name' => 'Cost',
- 'en' => [
- 'name' => 'Cost'
- ],
- 'type' => 'price',
- 'position' => 12,
- 'is_required' => 0,
- 'value_per_locale' => 0,
- 'value_per_channel' => 1,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 1
- ], [
- 'code' => 'special_price',
- 'admin_name' => 'Special Price',
- 'en' => [
- 'name' => 'Special Price'
- ],
- 'type' => 'price',
- 'position' => 13,
- 'is_required' => 0,
- 'value_per_locale' => 0,
- 'value_per_channel' => 0,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 0
- ], [
- 'code' => 'special_price_from',
- 'admin_name' => 'Special Price From',
- 'en' => [
- 'name' => 'Special Price From'
- ],
- 'type' => 'date',
- 'position' => 14,
- 'is_required' => 0,
- 'value_per_locale' => 0,
- 'value_per_channel' => 1,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 0
- ], [
- 'code' => 'special_price_to',
- 'admin_name' => 'Special Price To',
- 'en' => [
- 'name' => 'Special Price To'
- ],
- 'type' => 'date',
- 'position' => 15,
- 'is_required' => 0,
- 'value_per_locale' => 0,
- 'value_per_channel' => 1,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 0
- ], [
- 'code' => 'meta_title',
- 'admin_name' => 'Meta Title',
- 'en' => [
- 'name' => 'Meta Description'
- ],
- 'type' => 'textarea',
- 'position' => 16,
- 'is_required' => 0,
- 'value_per_locale' => 1,
- 'value_per_channel' => 1,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 0
- ], [
- 'code' => 'meta_keywords',
- 'admin_name' => 'Meta Keywords',
- 'en' => [
- 'name' => 'Meta Keywords'
- ],
- 'type' => 'textarea',
- 'position' => 17,
- 'is_required' => 0,
- 'value_per_locale' => 1,
- 'value_per_channel' => 1,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 0
- ], [
- 'code' => 'meta_description',
- 'admin_name' => 'Meta Description',
- 'en' => [
- 'name' => 'Meta Description'
- ],
- 'type' => 'textarea',
- 'position' => 18,
- 'is_required' => 0,
- 'value_per_locale' => 1,
- 'value_per_channel' => 1,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 1
- ], [
- 'code' => 'width',
- 'admin_name' => 'Width',
- 'en' => [
- 'name' => 'Width'
- ],
- 'type' => 'text',
- 'validation' => 'numeric',
- 'position' => 19,
- 'is_required' => 0,
- 'value_per_locale' => 0,
- 'value_per_channel' => 0,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 1
- ], [
- 'code' => 'height',
- 'admin_name' => 'Height',
- 'en' => [
- 'name' => 'Height'
- ],
- 'type' => 'text',
- 'validation' => 'numeric',
- 'position' => 20,
- 'is_required' => 0,
- 'value_per_locale' => 0,
- 'value_per_channel' => 0,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 1
- ], [
- 'code' => 'depth',
- 'admin_name' => 'Depth',
- 'en' => [
- 'name' => 'Depth'
- ],
- 'type' => 'text',
- 'validation' => 'numeric',
- 'position' => 21,
- 'is_required' => 0,
- 'value_per_locale' => 0,
- 'value_per_channel' => 0,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 1
- ], [
- 'code' => 'weight',
- 'admin_name' => 'Weight',
- 'en' => [
- 'name' => 'Weight'
- ],
- 'type' => 'text',
- 'validation' => 'numeric',
- 'position' => 22,
- 'is_required' => 1,
- 'value_per_locale' => 0,
- 'value_per_channel' => 0,
- 'is_filterable' => 0,
- 'is_configurable' => 0,
- 'is_user_defined' => 0
- ], [
- 'code' => 'color',
- 'admin_name' => 'Color',
- 'en' => [
- 'name' => 'Color'
- ],
- 'type' => 'select',
- 'position' => 23,
- 'is_required' => 0,
- 'value_per_locale' => 0,
- 'value_per_channel' => 0,
- 'is_filterable' => 1,
- 'is_configurable' => 1,
- 'is_user_defined' => 1,
- 'options' => [
- [
- 'admin_name' => 'Red',
- 'en' => [
- 'label' => 'Red'
- ],
- 'sort_order' => 1
- ], [
- 'admin_name' => 'Green',
- 'en' => [
- 'label' => 'Green'
- ],
- 'sort_order' => 2
- ], [
- 'admin_name' => 'Yellow',
- 'en' => [
- 'label' => 'Yellow'
- ],
- 'sort_order' => 3
- ], [
- 'admin_name' => 'Black',
- 'en' => [
- 'label' => 'Black'
- ],
- 'sort_order' => 4
- ], [
- 'admin_name' => 'White',
- 'en' => [
- 'label' => 'White'
- ],
- 'sort_order' => 5
- ]
- ]
- ], [
- 'code' => 'size',
- 'admin_name' => 'Size',
- 'en' => [
- 'name' => 'Size'
- ],
- 'type' => 'select',
- 'position' => 24,
- 'is_required' => 0,
- 'value_per_locale' => 0,
- 'value_per_channel' => 0,
- 'is_filterable' => 1,
- 'is_configurable' => 1,
- 'is_user_defined' => 1,
- 'options' => [
- [
- 'admin_name' => 'S',
- 'en' => [
- 'label' => 'S'
- ],
- 'sort_order' => 1
- ], [
- 'admin_name' => 'M',
- 'en' => [
- 'label' => 'M'
- ],
- 'sort_order' => 2
- ], [
- 'admin_name' => 'L',
- 'en' => [
- 'label' => 'L'
- ],
- 'sort_order' => 3
- ], [
- 'admin_name' => 'XL',
- 'en' => [
- 'label' => 'XL'
- ],
- 'sort_order' => 4
- ]
- ]
- ]
- ];
-
- /**
- * AttributeRepository object
- *
- * @var array
- */
- protected $attribute;
-
- /**
- * Create a new controller instance.
- *
- * @param Webkul\Attribute\Repositories\AttributeRepository $attribute
- * @return void
- */
- public function __construct(AttributeRepository $attribute)
- {
- $this->attribute = $attribute;
- }
public function run()
{
- \Illuminate\Database\Eloquent\Model::reguard();
+ DB::table('attributes')->delete();
- foreach($this->rawData as $row) {
- $this->attribute->create($row);
- }
+ $now = Carbon::now();
+
+ DB::table('attributes')->insert([
+ ['id' => '1','code' => 'sku','admin_name' => 'SKU','type' => 'text','validation' => NULL,'position' => '1','is_required' => '1','is_unique' => '1','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '2','code' => 'name','admin_name' => 'Name','type' => 'text','validation' => NULL,'position' => '2','is_required' => '1','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '3','code' => 'url_key','admin_name' => 'URL Key','type' => 'text','validation' => NULL,'position' => '3','is_required' => '1','is_unique' => '1','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '4','code' => 'tax_category_id','admin_name' => 'Tax Category','type' => 'select','validation' => NULL,'position' => '4','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '5','code' => 'new','admin_name' => 'New','type' => 'boolean','validation' => NULL,'position' => '5','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '6','code' => 'featured','admin_name' => 'Featured','type' => 'boolean','validation' => NULL,'position' => '6','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '7','code' => 'visible_individually','admin_name' => 'Visible Individually','type' => 'boolean','validation' => NULL,'position' => '7','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '8','code' => 'status','admin_name' => 'Status','type' => 'boolean','validation' => NULL,'position' => '8','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '9','code' => 'short_description','admin_name' => 'Short Description','type' => 'textarea','validation' => NULL,'position' => '9','is_required' => '1','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '10','code' => 'description','admin_name' => 'Description','type' => 'textarea','validation' => NULL,'position' => '10','is_required' => '1','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '11','code' => 'price','admin_name' => 'Price','type' => 'price','validation' => NULL,'position' => '11','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '12','code' => 'cost','admin_name' => 'Cost','type' => 'price','validation' => NULL,'position' => '12','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '13','code' => 'special_price','admin_name' => 'Special Price','type' => 'price','validation' => NULL,'position' => '13','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '14','code' => 'special_price_from','admin_name' => 'Special Price From','type' => 'date','validation' => NULL,'position' => '14','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '15','code' => 'special_price_to','admin_name' => 'Special Price To','type' => 'date','validation' => NULL,'position' => '15','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '16','code' => 'meta_title','admin_name' => 'Meta Title','type' => 'textarea','validation' => NULL,'position' => '16','is_required' => '0','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '17','code' => 'meta_keywords','admin_name' => 'Meta Keywords','type' => 'textarea','validation' => NULL,'position' => '17','is_required' => '0','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '18','code' => 'meta_description','admin_name' => 'Meta Description','type' => 'textarea','validation' => NULL,'position' => '18','is_required' => '0','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '19','code' => 'width','admin_name' => 'Width','type' => 'text','validation' => NULL,'position' => '19','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '20','code' => 'height','admin_name' => 'Height','type' => 'text','validation' => NULL,'position' => '20','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '21','code' => 'depth','admin_name' => 'Depth','type' => 'text','validation' => NULL,'position' => '21','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '22','code' => 'weight','admin_name' => 'Weight','type' => 'text','validation' => NULL,'position' => '22','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '23','code' => 'color','admin_name' => 'Color','type' => 'select','validation' => NULL,'position' => '23','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '1','is_user_defined' => '1','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '24','code' => 'size','admin_name' => 'Size','type' => 'select','validation' => NULL,'position' => '24','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '1','is_user_defined' => '1','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now]
+ ]);
+
+
+ DB::table('attribute_translations')->insert([
+ ['id' => '1','locale' => 'en','name' => 'SKU','attribute_id' => '1'],
+ ['id' => '2','locale' => 'en','name' => 'Name','attribute_id' => '2'],
+ ['id' => '3','locale' => 'en','name' => 'URL Key','attribute_id' => '3'],
+ ['id' => '4','locale' => 'en','name' => 'Tax Category','attribute_id' => '4'],
+ ['id' => '5','locale' => 'en','name' => 'New','attribute_id' => '5'],
+ ['id' => '6','locale' => 'en','name' => 'Featured','attribute_id' => '6'],
+ ['id' => '7','locale' => 'en','name' => 'Visible Individually','attribute_id' => '7'],
+ ['id' => '8','locale' => 'en','name' => 'Status','attribute_id' => '8'],
+ ['id' => '9','locale' => 'en','name' => 'Short Description','attribute_id' => '9'],
+ ['id' => '10','locale' => 'en','name' => 'Description','attribute_id' => '10'],
+ ['id' => '11','locale' => 'en','name' => 'Price','attribute_id' => '11'],
+ ['id' => '12','locale' => 'en','name' => 'Cost','attribute_id' => '12'],
+ ['id' => '13','locale' => 'en','name' => 'Special Price','attribute_id' => '13'],
+ ['id' => '14','locale' => 'en','name' => 'Special Price From','attribute_id' => '14'],
+ ['id' => '15','locale' => 'en','name' => 'Special Price To','attribute_id' => '15'],
+ ['id' => '16','locale' => 'en','name' => 'Meta Description','attribute_id' => '16'],
+ ['id' => '17','locale' => 'en','name' => 'Meta Keywords','attribute_id' => '17'],
+ ['id' => '18','locale' => 'en','name' => 'Meta Description','attribute_id' => '18'],
+ ['id' => '19','locale' => 'en','name' => 'Width','attribute_id' => '19'],
+ ['id' => '20','locale' => 'en','name' => 'Height','attribute_id' => '20'],
+ ['id' => '21','locale' => 'en','name' => 'Depth','attribute_id' => '21'],
+ ['id' => '22','locale' => 'en','name' => 'Weight','attribute_id' => '22'],
+ ['id' => '23','locale' => 'en','name' => 'Color','attribute_id' => '23'],
+ ['id' => '24','locale' => 'en','name' => 'Size','attribute_id' => '24']
+ ]);
}
}
\ No newline at end of file
diff --git a/packages/Webkul/Attribute/src/Database/Seeders/DatabaseSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/DatabaseSeeder.php
index 6e3cff806..b1f9df4a8 100644
--- a/packages/Webkul/Attribute/src/Database/Seeders/DatabaseSeeder.php
+++ b/packages/Webkul/Attribute/src/Database/Seeders/DatabaseSeeder.php
@@ -14,6 +14,8 @@ class DatabaseSeeder extends Seeder
public function run()
{
$this->call(AttributeTableSeeder::class);
+ $this->call(AttributeOptionTableSeeder::class);
$this->call(AttributeFamilyTableSeeder::class);
+ $this->call(AttributeGroupTableSeeder::class);
}
}
diff --git a/packages/Webkul/Category/src/Database/Seeders/CategoryTableSeeder.php b/packages/Webkul/Category/src/Database/Seeders/CategoryTableSeeder.php
new file mode 100644
index 000000000..20a3315be
--- /dev/null
+++ b/packages/Webkul/Category/src/Database/Seeders/CategoryTableSeeder.php
@@ -0,0 +1,37 @@
+delete();
+
+ $now = Carbon::now();
+
+ DB::table('categories')->insert([
+ ['id' => '1','position' => '1','image' => NULL,'status' => '1','_lft' => '1','_rgt' => '14','parent_id' => NULL, 'created_at' => $now, 'updated_at' => $now],
+ ['id' => '2','position' => '1','image' => NULL,'status' => '1','_lft' => '2','_rgt' => '7','parent_id' => '1', 'created_at' => $now, 'updated_at' => $now],
+ ['id' => '3','position' => '2','image' => NULL,'status' => '1','_lft' => '8','_rgt' => '13','parent_id' => '1', 'created_at' => $now, 'updated_at' => $now],
+ ['id' => '4','position' => '1','image' => NULL,'status' => '1','_lft' => '5','_rgt' => '6','parent_id' => '2', 'created_at' => $now, 'updated_at' => $now],
+ ['id' => '5','position' => '2','image' => NULL,'status' => '1','_lft' => '3','_rgt' => '4','parent_id' => '2', 'created_at' => $now, 'updated_at' => $now],
+ ['id' => '6','position' => '1','image' => NULL,'status' => '1','_lft' => '9','_rgt' => '10','parent_id' => '3', 'created_at' => $now, 'updated_at' => $now],
+ ['id' => '7','position' => '2','image' => NULL,'status' => '1','_lft' => '11','_rgt' => '12','parent_id' => '3', 'created_at' => $now, 'updated_at' => $now]
+ ]);
+
+ DB::table('category_translations')->insert([
+ ['id' => '1','name' => 'Root','slug' => 'root','description' => 'Root','meta_title' => '','meta_description' => '','meta_keywords' => '','category_id' => '1','locale' => 'en'],
+ ['id' => '2','name' => 'Women','slug' => 'women','description' => 'Women','meta_title' => '','meta_description' => '','meta_keywords' => '','category_id' => '2','locale' => 'en'],
+ ['id' => '3','name' => 'Men','slug' => 'men','description' => 'Men','meta_title' => '','meta_description' => '','meta_keywords' => '','category_id' => '3','locale' => 'en'],
+ ['id' => '4','name' => 'Tops','slug' => 'tops-women','description' => 'Tops','meta_title' => '','meta_description' => '','meta_keywords' => '','category_id' => '4','locale' => 'en'],
+ ['id' => '5','name' => 'Bottoms','slug' => 'bottoms-women','description' => 'Bottoms','meta_title' => '','meta_description' => '','meta_keywords' => '','category_id' => '5','locale' => 'en'],
+ ['id' => '6','name' => 'Tops','slug' => 'tops-men','description' => 'Tops','meta_title' => '','meta_description' => '','meta_keywords' => '','category_id' => '6','locale' => 'en'],
+ ['id' => '7','name' => 'Bottoms','slug' => 'bottoms-men','description' => 'Bottoms','meta_title' => '','meta_description' => '','meta_keywords' => '','category_id' => '7','locale' => 'en']
+ ]);
+ }
+}
\ No newline at end of file
diff --git a/packages/Webkul/Category/src/Database/Seeders/DatabaseSeeder.php b/packages/Webkul/Category/src/Database/Seeders/DatabaseSeeder.php
new file mode 100644
index 000000000..c0f0edbc1
--- /dev/null
+++ b/packages/Webkul/Category/src/Database/Seeders/DatabaseSeeder.php
@@ -0,0 +1,18 @@
+call(CategoryTableSeeder::class);
+ }
+}
\ No newline at end of file
diff --git a/packages/Webkul/Category/src/Http/Controllers/CategoryController.php b/packages/Webkul/Category/src/Http/Controllers/CategoryController.php
index 5d6e9d446..351be4f2b 100644
--- a/packages/Webkul/Category/src/Http/Controllers/CategoryController.php
+++ b/packages/Webkul/Category/src/Http/Controllers/CategoryController.php
@@ -73,7 +73,7 @@ class CategoryController extends Controller
public function store()
{
$this->validate(request(), [
- 'slug' => ['required', 'unique:category_translations,slug', new \Webkul\Core\Contracts\Validations\Code],
+ 'slug' => ['required', 'unique:category_translations,slug', new \Webkul\Core\Contracts\Validations\Slug],
'name' => 'required'
]);
diff --git a/packages/Webkul/Checkout/src/Cart.php b/packages/Webkul/Checkout/src/Cart.php
index c4840f822..fb95af4d1 100644
--- a/packages/Webkul/Checkout/src/Cart.php
+++ b/packages/Webkul/Checkout/src/Cart.php
@@ -121,18 +121,16 @@ class Cart {
}
$child = $childData = null;
+ $additional = [];
if($product->type == 'configurable') {
$child = $this->product->findOneByField('id', $data['selected_configurable_option']);
- $productAddtionalData = $this->getProductAttributeOptionDetails($child);
+ $additional = $this->getProductAttributeOptionDetails($child);
- unset($productAddtionalData['html']);
+ unset($additional['html']);
- $additional = [
- 'request' => $data,
- 'variant_id' => $data['selected_configurable_option'],
- 'attributes' => $productAddtionalData
- ];
+ $additional['request'] = $data;
+ $additional['variant_id'] = $data['selected_configurable_option'];
$childData = [
'product_id' => $data['selected_configurable_option'],
@@ -157,7 +155,7 @@ class Cart {
'weight' => $weight = ($product->type == 'configurable' ? $child->weight : $product->weight),
'total_weight' => $weight * $data['quantity'],
'base_total_weight' => $weight * $data['quantity'],
- 'additional' => json_encode($additional)
+ 'additional' => $additional
];
return ['parent' => $parentData, 'child' => $childData];
@@ -175,8 +173,7 @@ class Cart {
{
if($prepared == false) {
$itemData = $this->prepareItemData($id, $data);
- }
- else {
+ } else {
$itemData = $preparedData;
}
diff --git a/packages/Webkul/Core/src/Core.php b/packages/Webkul/Core/src/Core.php
index 5862a86d4..9fefbae2d 100644
--- a/packages/Webkul/Core/src/Core.php
+++ b/packages/Webkul/Core/src/Core.php
@@ -521,8 +521,8 @@ class Core
public function getTimeInterval($startDate, $endDate) {
$timeIntervals = [];
- $totalDays = $startDate->diffInDays($endDate);
- $totalMonths = $startDate->diffInMonths($endDate);
+ $totalDays = $startDate->diffInDays($endDate) + 1;
+ $totalMonths = $startDate->diffInMonths($endDate) + 1;
$startWeekDay = Carbon::createFromTimeString($this->xWeekRange($startDate, 0) . ' 00:00:01');
$endWeekDay = Carbon::createFromTimeString($this->xWeekRange($endDate, 1) . ' 23:59:59');
diff --git a/packages/Webkul/Customer/src/Database/migrations/2018_10_03_025230_create_wishlist_table.php b/packages/Webkul/Customer/src/Database/migrations/2018_10_03_025230_create_wishlist_table.php
index 29ccc32c6..f2708933c 100644
--- a/packages/Webkul/Customer/src/Database/migrations/2018_10_03_025230_create_wishlist_table.php
+++ b/packages/Webkul/Customer/src/Database/migrations/2018_10_03_025230_create_wishlist_table.php
@@ -16,10 +16,10 @@ class CreateWishlistTable extends Migration
Schema::create('wishlist', function (Blueprint $table) {
$table->increments('id');
$table->integer('channel_id')->unsigned();
- $table->foreign('channel_id')->references('id')->on('channels');
+ $table->foreign('channel_id')->references('id')->on('channels')->onDelete('cascade');
$table->integer('product_id')->unsigned();
- $table->foreign('product_id')->references('id')->on('products');
+ $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
$table->integer('customer_id')->unsigned();
$table->foreign('customer_id')->references('id')->on('customers')->onDelete('cascade');
diff --git a/packages/Webkul/Product/src/Database/Seeders/DatabaseSeeder.php b/packages/Webkul/Product/src/Database/Seeders/DatabaseSeeder.php
new file mode 100644
index 000000000..919833da8
--- /dev/null
+++ b/packages/Webkul/Product/src/Database/Seeders/DatabaseSeeder.php
@@ -0,0 +1,18 @@
+call(ProductTableSeeder::class);
+ }
+}
diff --git a/packages/Webkul/Product/src/Database/Seeders/ProductTableSeeder.php b/packages/Webkul/Product/src/Database/Seeders/ProductTableSeeder.php
new file mode 100644
index 000000000..3c5fbb0ae
--- /dev/null
+++ b/packages/Webkul/Product/src/Database/Seeders/ProductTableSeeder.php
@@ -0,0 +1,13 @@
+images as $image) {
- if(!Storage::has($image->path))
- continue;
+ if($product) {
+ foreach($product->images as $image) {
+ if(!Storage::has($image->path))
+ continue;
- $images[] = [
- 'small_image_url' => url('cache/small/' . $image->path),
- 'medium_image_url' => url('cache/medium/' . $image->path),
- 'large_image_url' => url('cache/large/' . $image->path),
- 'original_image_url' => url('cache/original/' . $image->path),
- ];
+ $images[] = [
+ 'small_image_url' => url('cache/small/' . $image->path),
+ 'medium_image_url' => url('cache/medium/' . $image->path),
+ 'large_image_url' => url('cache/large/' . $image->path),
+ 'original_image_url' => url('cache/original/' . $image->path),
+ ];
+ }
}
- if(!$product->parent_id && !count($images)) {
+ if(!$product || (!$product->parent_id && !count($images))) {
$images[] = [
'small_image_url' => bagisto_asset('images/product/small-product-placeholder.png'),
'medium_image_url' => bagisto_asset('images/product/meduim-product-placeholder.png'),
@@ -49,9 +51,8 @@ class ProductImage extends AbstractProduct
*/
public function getProductBaseImage($product)
{
- $images = $product->images;
-
- if($images->count()) {
+ if($product && $product->images->count()) {
+ $images = $product->images;
$image = [
'small_image_url' => url('cache/small/' . $images[0]->path),
'medium_image_url' => url('cache/medium/' . $images[0]->path),
diff --git a/packages/Webkul/Product/src/Helpers/Review.php b/packages/Webkul/Product/src/Helpers/Review.php
index 8e62a4b0d..fcb360c54 100644
--- a/packages/Webkul/Product/src/Helpers/Review.php
+++ b/packages/Webkul/Product/src/Helpers/Review.php
@@ -58,7 +58,7 @@ class Review extends AbstractProduct
public function getPercentageRating($product)
{
$reviews = $product->reviews()->where('status','approved')
- ->select('rating', DB::raw ('count(*) as total'))
+ ->select('rating', DB::raw('count(*) as total'))
->groupBy('rating')
->orderBy('rating','desc')
->get();
diff --git a/packages/Webkul/Product/src/Http/Controllers/ProductController.php b/packages/Webkul/Product/src/Http/Controllers/ProductController.php
index 44a88fd5b..4a85a2143 100644
--- a/packages/Webkul/Product/src/Http/Controllers/ProductController.php
+++ b/packages/Webkul/Product/src/Http/Controllers/ProductController.php
@@ -182,10 +182,10 @@ class ProductController extends Controller
// before update of product
// Event::fire('product.update.before', $id);
- $this->product->update(request()->all(), $id);
+ $product = $this->product->update(request()->all(), $id);
//after update of product
- Event::fire('product.update.after', $this->product->find($id));
+ Event::fire('product.save.after', $product);
session()->flash('success', 'Product updated successfully.');
diff --git a/packages/Webkul/Product/src/Repositories/ProductAttributeValueRepository.php b/packages/Webkul/Product/src/Repositories/ProductAttributeValueRepository.php
index ca7aaf449..847571422 100644
--- a/packages/Webkul/Product/src/Repositories/ProductAttributeValueRepository.php
+++ b/packages/Webkul/Product/src/Repositories/ProductAttributeValueRepository.php
@@ -1,7 +1,7 @@
-update($data);
- if(isset($data['categories']))
+ if(isset($data['categories'])) {
$product->categories()->sync($data['categories']);
+ }
$attributes = $product->attribute_family->custom_attributes;
foreach ($attributes as $attribute) {
if(!isset($data[$attribute->code]) || ($attribute->code == 'boolean' && !$data[$attribute->code]))
continue;
-
+
$attributeValue = $this->attributeValue->findOneWhere([
'product_id' => $product->id,
'attribute_id' => $attribute->id,
@@ -172,16 +173,17 @@ class ProductRepository extends Repository
if(!$attributeValue) {
$this->attributeValue->create([
- 'product_id' => $product->id,
- 'attribute_id' => $attribute->id,
- 'value' => $data[$attribute->code],
- 'channel' => $attribute->value_per_channel ? $data['channel'] : null,
- 'locale' => $attribute->value_per_locale ? $data['locale'] : null
- ]);
+ 'product_id' => $product->id,
+ 'attribute_id' => $attribute->id,
+ 'value' => $data[$attribute->code],
+ 'channel' => $attribute->value_per_channel ? $data['channel'] : null,
+ 'locale' => $attribute->value_per_locale ? $data['locale'] : null
+ ]);
} else {
$this->attributeValue->update([
- ProductAttributeValue::$attributeTypeFields[$attribute->type] => $data[$attribute->code]
- ], $attributeValue->id);
+ ProductAttributeValue::$attributeTypeFields[$attribute->type] => $data[$attribute->code]
+ ], $attributeValue->id
+ );
}
}
diff --git a/packages/Webkul/Sales/src/Models/InvoiceItem.php b/packages/Webkul/Sales/src/Models/InvoiceItem.php
index d59513356..33e7dfbf4 100644
--- a/packages/Webkul/Sales/src/Models/InvoiceItem.php
+++ b/packages/Webkul/Sales/src/Models/InvoiceItem.php
@@ -8,6 +8,10 @@ use Webkul\Sales\Contracts\InvoiceItem as InvoiceItemContract;
class InvoiceItem extends Model implements InvoiceItemContract
{
protected $guarded = ['id', 'created_at', 'updated_at'];
+
+ protected $casts = [
+ 'additional' => 'array',
+ ];
/**
* Get the invoice record associated with the invoice item.
@@ -40,4 +44,21 @@ class InvoiceItem extends Model implements InvoiceItemContract
{
return $this->hasOne(InvoiceItemProxy::modelClass(), 'parent_id');
}
+
+ /**
+ * Returns configurable option html
+ */
+ public function getOptionDetailHtml()
+ {
+
+ if($this->type == 'configurable' && isset($this->additional['attributes'])) {
+ $labels = [];
+
+ foreach($this->additional['attributes'] as $attribute) {
+ $labels[] = $attribute['attribute_name'] . ' : ' . $attribute['option_label'];
+ }
+
+ return implode(', ', $labels);
+ }
+ }
}
\ No newline at end of file
diff --git a/packages/Webkul/Sales/src/Models/OrderItem.php b/packages/Webkul/Sales/src/Models/OrderItem.php
index ee4ca55b2..f07aecd7e 100644
--- a/packages/Webkul/Sales/src/Models/OrderItem.php
+++ b/packages/Webkul/Sales/src/Models/OrderItem.php
@@ -10,6 +10,10 @@ class OrderItem extends Model implements OrderItemContract
{
protected $guarded = ['id', 'child', 'created_at', 'updated_at'];
+ protected $casts = [
+ 'additional' => 'array',
+ ];
+
/**
* Get remaining qty for shipping.
*/
@@ -75,4 +79,21 @@ class OrderItem extends Model implements OrderItemContract
public function shipment_items() {
return $this->hasMany(ShipmentItemProxy::modelClass());
}
+
+ /**
+ * Returns configurable option html
+ */
+ public function getOptionDetailHtml()
+ {
+
+ if($this->type == 'configurable' && isset($this->additional['attributes'])) {
+ $labels = [];
+
+ foreach($this->additional['attributes'] as $attribute) {
+ $labels[] = $attribute['attribute_name'] . ' : ' . $attribute['option_label'];
+ }
+
+ return implode(', ', $labels);
+ }
+ }
}
\ No newline at end of file
diff --git a/packages/Webkul/Sales/src/Models/ShipmentItem.php b/packages/Webkul/Sales/src/Models/ShipmentItem.php
index d9a4cc2d8..26efd355b 100644
--- a/packages/Webkul/Sales/src/Models/ShipmentItem.php
+++ b/packages/Webkul/Sales/src/Models/ShipmentItem.php
@@ -8,6 +8,10 @@ use Webkul\Sales\Contracts\ShipmentItem as ShipmentItemContract;
class ShipmentItem extends Model implements ShipmentItemContract
{
protected $guarded = ['id', 'child', 'created_at', 'updated_at'];
+
+ protected $casts = [
+ 'additional' => 'array',
+ ];
/**
* Get the shipment record associated with the shipment item.
@@ -40,4 +44,21 @@ class ShipmentItem extends Model implements ShipmentItemContract
{
return $this->belongsTo(ShipmentItemProxy::modelClass(), 'parent_id');
}
+
+ /**
+ * Returns configurable option html
+ */
+ public function getOptionDetailHtml()
+ {
+
+ if($this->type == 'configurable' && isset($this->additional['attributes'])) {
+ $labels = [];
+
+ foreach($this->additional['attributes'] as $attribute) {
+ $labels[] = $attribute['attribute_name'] . ' : ' . $attribute['option_label'];
+ }
+
+ return implode(', ', $labels);
+ }
+ }
}
\ No newline at end of file
diff --git a/packages/Webkul/Shop/src/Resources/views/emails/sales/new-invoice.blade.php b/packages/Webkul/Shop/src/Resources/views/emails/sales/new-invoice.blade.php
index 7ea441fc1..8210ff1f5 100644
--- a/packages/Webkul/Shop/src/Resources/views/emails/sales/new-invoice.blade.php
+++ b/packages/Webkul/Shop/src/Resources/views/emails/sales/new-invoice.blade.php
@@ -97,7 +97,7 @@
@foreach ($invoice->items as $item)
-
+
{{ $item->name }}
@@ -120,11 +120,13 @@
-
-
-
+ @if ($html = $item->getOptionDetailHtml())
+
+
+
+ @endif
@endforeach
diff --git a/packages/Webkul/Shop/src/Resources/views/emails/sales/new-order.blade.php b/packages/Webkul/Shop/src/Resources/views/emails/sales/new-order.blade.php
index e23539d93..ecc1fb9e0 100644
--- a/packages/Webkul/Shop/src/Resources/views/emails/sales/new-order.blade.php
+++ b/packages/Webkul/Shop/src/Resources/views/emails/sales/new-order.blade.php
@@ -95,7 +95,7 @@
@foreach ($order->items as $item)
-
+
{{ $item->name }}
@@ -118,11 +118,13 @@
-
-
-
+ @if ($html = $item->getOptionDetailHtml())
+
+
+
+ @endif
@endforeach
diff --git a/packages/Webkul/Shop/src/Resources/views/emails/sales/new-shipment.blade.php b/packages/Webkul/Shop/src/Resources/views/emails/sales/new-shipment.blade.php
index ddaa25cfa..d279b8c2a 100644
--- a/packages/Webkul/Shop/src/Resources/views/emails/sales/new-shipment.blade.php
+++ b/packages/Webkul/Shop/src/Resources/views/emails/sales/new-shipment.blade.php
@@ -107,7 +107,7 @@
@foreach ($shipment->items as $item)
-
+
{{ $item->name }}
@@ -130,11 +130,13 @@
-
-
-
+ @if ($html = $item->getOptionDetailHtml())
+
+
+
+ @endif
@endforeach
diff --git a/packages/Webkul/Shop/src/Resources/views/products/view/reviews.blade.php b/packages/Webkul/Shop/src/Resources/views/products/view/reviews.blade.php
index f67cd116f..18565602c 100644
--- a/packages/Webkul/Shop/src/Resources/views/products/view/reviews.blade.php
+++ b/packages/Webkul/Shop/src/Resources/views/products/view/reviews.blade.php
@@ -1,79 +1,84 @@
@inject ('reviewHelper', 'Webkul\Product\Helpers\Review')
+
@if ($total = $reviewHelper->getTotalReviews($product))
-
-
-
-
-
-
-
- {{ $reviewHelper->getAverageRating($product) }}
-
-
-
- @for ($i = 1; $i <= round($reviewHelper->getAverageRating($product)); $i++)
-
-
-
- @endfor
-
-
-
- {{ __('shop::app.products.total-reviews', ['total' => $total]) }}
-
-
+
+
- @if(!is_null($customer))
-
- {{ __('shop::app.products.write-review-btn') }}
-
- @endif
+
+
-
-
-
-
- @foreach ($reviewHelper->getReviews($product)->paginate(10) as $review)
-
-
- {{ $review->title }}
-
+
+ {{ $reviewHelper->getAverageRating($product) }}
+
- @for ($i = 1; $i <= $review->rating; $i++)
+ @for ($i = 1; $i <= round($reviewHelper->getAverageRating($product)); $i++)
@endfor
-
- {{ $review->comment }}
+
+ {{ __('shop::app.products.total-reviews', ['total' => $total]) }}
-
-
- {{ __('shop::app.products.by', ['name' => $review->customer->name]) }},
-
-
-
- {{ core()->formatDate($review->created_at) }}
-
-
- @endforeach
- View All
+ @if(!is_null($customer))
+
+ {{ __('shop::app.products.write-review-btn') }}
+
+ @endif
+
+
+
+
+ @foreach ($reviewHelper->getReviews($product)->paginate(10) as $review)
+
+
+ {{ $review->title }}
+
+
+
+ @for ($i = 1; $i <= $review->rating; $i++)
+
+
+
+ @endfor
+
+
+
+ {{ $review->comment }}
+
+
+
+
+ {{ __('shop::app.products.by', ['name' => $review->customer->name]) }},
+
+
+
+ {{ core()->formatDate($review->created_at) }}
+
+
+
+ @endforeach
+
+ View All
+
+
-
@else
@if(!is_null($customer))
-
- {{ __('shop::app.products.write-review-btn') }}
-
+
+
+
@endif
@endif
\ No newline at end of file
diff --git a/packages/Webkul/Ui/src/DataGrid/DataGrid.php b/packages/Webkul/Ui/src/DataGrid/DataGrid.php
index f70d531e9..150456884 100644
--- a/packages/Webkul/Ui/src/DataGrid/DataGrid.php
+++ b/packages/Webkul/Ui/src/DataGrid/DataGrid.php
@@ -774,7 +774,7 @@ class DataGrid
$this->results = $this->query->get();
- $this->results = $this->query->distinct()->paginate($this->perpage)->appends(request()->except('page'));
+ $this->results = $this->query->paginate($this->perpage)->appends(request()->except('page'));
return $this->results;
diff --git a/packages/Webkul/Ui/src/Resources/assets/sass/app.scss b/packages/Webkul/Ui/src/Resources/assets/sass/app.scss
index 6c17b8aac..253f9b632 100644
--- a/packages/Webkul/Ui/src/Resources/assets/sass/app.scss
+++ b/packages/Webkul/Ui/src/Resources/assets/sass/app.scss
@@ -81,6 +81,7 @@ h2 {
cursor: pointer;
transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
font: inherit;
+ display: inline-block;
&:hover,
&:active,
@@ -586,11 +587,11 @@ h2 {
}
}
-.accordian {
+.accordian, accordian {
display: inline-block;
width: 100%;
- .accordian-header {
+ .accordian-header, div[slot*="header"] {
width: 100%;
display: inline-block;
font-size: 18px;
@@ -620,7 +621,7 @@ h2 {
}
}
- .accordian-content {
+ .accordian-content, div[slot*="body"] {
width: 100%;
padding: 20px 15px;
display: none;
diff --git a/public/themes/default/assets/js/shop.js b/public/themes/default/assets/js/shop.js
index 1cf13eb2d..55eef2e99 100644
--- a/public/themes/default/assets/js/shop.js
+++ b/public/themes/default/assets/js/shop.js
@@ -11535,7 +11535,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.
*/
@@ -16624,7 +16624,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext
});
-Vue.version = '2.5.17';
+Vue.version = '2.5.16';
/* */
@@ -31506,6 +31506,7 @@ if (false) {
/* 50 */
/***/ (function(module, exports, __webpack_require__) {
+<<<<<<< HEAD
<<<<<<< HEAD
!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},startAnimation:{type:Boolean,default:!1},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(t this.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),this.keydownFlag&&this.$emit("on-keypress",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-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>>>>>> 710b3cb95d8f98c034fee1d224eed22c3510e4f7
>>>>>>> 99a0590c690e0c44eb648c2ae7232163c66b4133
+=======
+!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>>>>>> ee38c2be7fd50750aaeb761dce1f145006d42046
+>>>>>>> fb6c9c8a7915463a1ca32999443bc30dc72251c0
/***/ }),
/* 51 */
diff --git a/public/themes/default/assets/mix-manifest.json b/public/themes/default/assets/mix-manifest.json
index b7e923adb..2141a2aae 100644
--- a/public/themes/default/assets/mix-manifest.json
+++ b/public/themes/default/assets/mix-manifest.json
@@ -1,4 +1,4 @@
{
"/js/shop.js": "/js/shop.js",
"/css/shop.css": "/css/shop.css"
-}
+}
\ No newline at end of file
| |