From 2b32a6252ecc4a8bc6c5fe12f2afe277b50cd96e Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Thu, 3 Jan 2019 14:53:01 +0530 Subject: [PATCH 01/14] black listing some key parameters from the request bag and server bag and post bag --- config/app.php | 18 ++++++ config/datagrid.php | 19 ++++++ .../Admin/src/DataGrids/CategoryDataGrid.php | 20 ++++++- packages/Webkul/Ui/src/DataGrid/DataGrid.php | 60 +++++++------------ 4 files changed, 74 insertions(+), 43 deletions(-) create mode 100644 config/datagrid.php diff --git a/config/app.php b/config/app.php index e56125308..ead795227 100644 --- a/config/app.php +++ b/config/app.php @@ -146,6 +146,24 @@ return [ */ 'editor' =>'vscode', + /** + * Debug blacklisting + */ + 'debug_blacklist' => [ + '_ENV' => [ + 'APP_KEY', + 'DB_PASSWORD', + ], + + '_SERVER' => [ + 'APP_KEY', + 'DB_PASSWORD', + ], + + '_POST' => [ + 'password', + ], + ], 'providers' => [ diff --git a/config/datagrid.php b/config/datagrid.php new file mode 100644 index 000000000..9927b01ac --- /dev/null +++ b/config/datagrid.php @@ -0,0 +1,19 @@ + [ + 'column' => 'id', + 'direction' => 'desc' + ], + + /** + * Select distinct records only + * + * @type True || False + */ + 'distinct' => true +]; \ No newline at end of file diff --git a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php index 313cec54d..e44ac9269 100644 --- a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php @@ -27,6 +27,7 @@ class CategoryDataGrid 'select' => 'cat.id', 'perpage' => 10, 'aliased' => true, //use this with false as default and true in case of joins + 'alias' => 'cat', 'massoperations' =>[ // [ @@ -34,7 +35,7 @@ class CategoryDataGrid // 'method' => 'DELETE', // 'label' => 'Delete', // 'type' => 'button', - // ], + // ] ], 'actions' => [ @@ -48,7 +49,7 @@ class CategoryDataGrid 'route' => 'admin.catalog.categories.delete', 'confirm_text' => 'Do you really want to delete this record?', 'icon' => 'icon trash-icon', - ], + ] ], 'join' => [ @@ -58,7 +59,20 @@ class CategoryDataGrid 'primaryKey' => 'cat.id', 'condition' => '=', 'secondaryKey' => 'ct.category_id', - ], + ], [ + 'join' => 'leftjoin', + 'table' => 'product_categories as pc', + 'primaryKey' => 'cat.id', + 'condition' => '=', + 'secondaryKey' => 'pc.category_id', + // 'conditions' => [ + // [ + // 'columnFirst' => 'ct.', + // 'condition' => '', + // 'columnSecond' => '' + // ] + // ] + ] ], //use aliasing on secodary columns if join is performed diff --git a/packages/Webkul/Ui/src/DataGrid/DataGrid.php b/packages/Webkul/Ui/src/DataGrid/DataGrid.php index bff625c7f..066511e99 100644 --- a/packages/Webkul/Ui/src/DataGrid/DataGrid.php +++ b/packages/Webkul/Ui/src/DataGrid/DataGrid.php @@ -20,8 +20,6 @@ use URL; * * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ - - class DataGrid { @@ -135,14 +133,14 @@ class DataGrid */ protected $parsed; - /* - public function __construct( + /* + public function __construct ( $name = null , $table = null , array $join = [], Collection $columns = null, Pagination $pagination = null - ){ + ) { $this->make( $name, $table, @@ -175,7 +173,7 @@ class DataGrid array $searchable = [], array $massoperations = [], bool $aliased = false, - $perpage = 0, + int $perpage = 0, $table = null, array $join = [], array $columns = null, @@ -186,11 +184,11 @@ class DataGrid ) { $this->request = Request::capture(); $this->setName($name); + $this->setAlias($aliased); $this->setSelect($select); $this->setFilterable($filterable); $this->setSearchable($filterable); $this->setMassOperations($massoperations); - $this->setAlias($aliased); $this->setPerPage($perpage); $this->setTable($table); $this->setJoin($join); @@ -219,7 +217,6 @@ class DataGrid * * @return $this */ - public function setSelect($select) { $this->select = $select ? : false; @@ -230,7 +227,6 @@ class DataGrid * Set Filterable * @return $this */ - public function setFilterable(array $filterable) { $this->filterable = $filterable ? : []; @@ -241,7 +237,6 @@ class DataGrid * Set Searchable columns * @return $this */ - public function setSearchable($searchable) { $this->searchable = $searchable ? : []; @@ -252,7 +247,6 @@ class DataGrid * Set mass operations * @return $this */ - public function setMassOperations($massops) { $this->massoperations = $massops ? : []; @@ -260,13 +254,10 @@ class DataGrid } /** - * Set alias parameter - * to know whether - * aliasing is true or not. + * Set alias parameter to know whether aliasing is true or not. * * @return $this. */ - public function setAlias(bool $aliased) { $this->aliased = $aliased ? : false; @@ -274,13 +265,10 @@ class DataGrid } /** - * Set the default - * pagination for - * data grid. + * Set the default pagination for data grid. * * @return $this */ - public function setPerPage($perpage) { $this->perpage = $perpage ? : 5; @@ -288,12 +276,10 @@ class DataGrid } /** - * Set table name in front - * of query scope. + * Set table name in front of query scope. * * @return $this */ - public function setTable(string $table) { $this->table = $table ?: false; @@ -301,12 +287,10 @@ class DataGrid } /** - * Set join bag if - * present. + * Set join bag if present. * * @return $this */ - public function setJoin(array $join) { $this->join = $join ?: []; @@ -315,9 +299,9 @@ class DataGrid /** * Adds the custom css rules - * @retun $this + * + * @return $this */ - private function setCss($css = []) { $this->css = new Css($css); @@ -326,9 +310,9 @@ class DataGrid /** * setFilterableColumns + * * @return $this */ - // public function setFilterableColumns($filterable_columns = []) // { // $this->join = $filterable_columns ?: []; @@ -336,11 +320,10 @@ class DataGrid // } /** - * Section actions bag - * here. + * Section actions bag here. + * * @return $this */ - public function setActions($actions = []) { $this->actions = $actions ?: []; return $this; @@ -351,7 +334,6 @@ class DataGrid * * @return $this */ - public function addColumns($columns = [], $reCreate = false) { if ($reCreate) { @@ -370,7 +352,6 @@ class DataGrid * * @return $this */ - public function addColumn($column = []) { if ($column instanceof Column) { @@ -384,12 +365,10 @@ class DataGrid } /** - * Add ColumnMultiple. - * Currently is not - * of any use. + * Add multiple columns, not being used currently + * * @return $this */ - private function addColumnMultiple($column = [], $multiple = false) { if ($column instanceof Column) { @@ -626,7 +605,6 @@ class DataGrid } else { //this is the case for the non aliasing. foreach ($parsed as $key => $value) { - if ($key=="sort") { //case that don't need any resolving @@ -783,9 +761,11 @@ class DataGrid $this->getQueryWithFilters(); } - if ($pagination == 'true') { + if ($pagination == 'true' && config('datagrid.distinct')) { + $this->results = $this->query->orderBy($this->select, 'desc')->distinct()->paginate($this->perpage)->appends(request()->except('page')); + } else if($pagination == 'true' && !config('datagrid.distinct')) { $this->results = $this->query->orderBy($this->select, 'desc')->paginate($this->perpage)->appends(request()->except('page')); - } else { + }else { $this->results = $this->query->orderBy($this->select, 'desc')->get(); } From 7117038287d86748e2a9cca7afade500b9eab4fa Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Thu, 3 Jan 2019 15:43:47 +0530 Subject: [PATCH 02/14] datagrid operator bag dependency removed , now operators are already there in Datagrid classes --- config/app.php | 6 +- config/datagrid.php | 13 +++- packages/Webkul/Ui/src/DataGrid/DataGrid.php | 70 ++++++++++++------- .../src/DataGrid/Helpers/AbstractFillable.php | 2 +- 4 files changed, 59 insertions(+), 32 deletions(-) diff --git a/config/app.php b/config/app.php index ead795227..9461ece41 100644 --- a/config/app.php +++ b/config/app.php @@ -152,16 +152,16 @@ return [ 'debug_blacklist' => [ '_ENV' => [ 'APP_KEY', - 'DB_PASSWORD', + 'DB_PASSWORD' ], '_SERVER' => [ 'APP_KEY', - 'DB_PASSWORD', + 'DB_PASSWORD' ], '_POST' => [ - 'password', + 'password' ], ], diff --git a/config/datagrid.php b/config/datagrid.php index 9927b01ac..8a99c7595 100644 --- a/config/datagrid.php +++ b/config/datagrid.php @@ -4,6 +4,8 @@ return [ /** * Default OrderBy + * + * * Accepted Values = Array */ 'defaultOrder' => [ 'column' => 'id', @@ -13,7 +15,14 @@ return [ /** * Select distinct records only * - * @type True || False + * Accepted Values = True || False */ - 'distinct' => true + 'distinct' => true, + + /** + * Default pagination + * + * Accepted Values = integer + */ + 'pagination' => 10 ]; \ 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 066511e99..f94526732 100644 --- a/packages/Webkul/Ui/src/DataGrid/DataGrid.php +++ b/packages/Webkul/Ui/src/DataGrid/DataGrid.php @@ -1,4 +1,5 @@ build($name, $select, $filterable, $searchable, $massoperations, $aliased, $perpage, $table, $join, $columns, $css, $operators,$actions); + + return $this->build($name, $select, $filterable, $searchable, $massoperations, $aliased, $perpage, $table, $join, $columns, $css, $actions); } //This assigns the private and public properties of the datagrid classes from make functions public function build( - $name = null, - $select = false, + string $name = null, + string $select = null, array $filterable = [], array $searchable = [], array $massoperations = [], bool $aliased = false, int $perpage = 0, - $table = null, + string $table = null, array $join = [], array $columns = null, array $css = [], - array $operators = [], array $actions = [], Pagination $pagination = null ) { @@ -194,9 +194,10 @@ class DataGrid $this->setJoin($join); $this->addColumns($columns, true); $this->setCss($css); - $this->setOperators($operators); + $this->setOperators(); $this->setActions($actions); // $this->addPagination($pagination); + return $this; } @@ -205,10 +206,9 @@ class DataGrid * * @return $this */ - public function setName(string $name) { - $this->name = $name ?: 'Default' . time(); + $this->name = $name ? : 'Default' . time(); return $this; } @@ -225,6 +225,7 @@ class DataGrid /** * Set Filterable + * * @return $this */ public function setFilterable(array $filterable) @@ -235,6 +236,7 @@ class DataGrid /** * Set Searchable columns + * * @return $this */ public function setSearchable($searchable) @@ -245,6 +247,7 @@ class DataGrid /** * Set mass operations + * * @return $this */ public function setMassOperations($massops) @@ -308,6 +311,31 @@ class DataGrid return $this->css; } + + /** + * Adds operands to be used for query condition + * + * @return $this + */ + public function setOperators() + { + $operands = [ + 'eq' => "=", + 'lt' => "<", + 'gt' => ">", + 'lte' => "<=", + 'gte' => ">=", + 'neqs' => "<>", + 'neqn' => "!=", + 'like' => "like", + 'nlike' => "not like", + ]; + + $this->operators = $operands; + + return $this; + } + /** * setFilterableColumns * @@ -398,16 +426,6 @@ class DataGrid return $this; } - /** - * Adds expressional verbs to be used - * @return $this - */ - public function setOperators(array $operators) - { - $this->operators = $operators ?: []; - return $this; - } - /** * Add Pagination. * diff --git a/packages/Webkul/Ui/src/DataGrid/Helpers/AbstractFillable.php b/packages/Webkul/Ui/src/DataGrid/Helpers/AbstractFillable.php index 5d67b68be..30bc9cd83 100644 --- a/packages/Webkul/Ui/src/DataGrid/Helpers/AbstractFillable.php +++ b/packages/Webkul/Ui/src/DataGrid/Helpers/AbstractFillable.php @@ -94,7 +94,7 @@ abstract class AbstractFillable break; } - if($error) throw new \Exception($error); + if ($error) throw new \Exception($error); $this->{$key} = $value; } From cb0a50233c28382ec88c194aa71375a45fb8caba Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Thu, 3 Jan 2019 16:54:13 +0530 Subject: [PATCH 03/14] Datagrid now fault tolerant on not passing select key in its configuration --- config/datagrid.php | 7 +- .../Admin/src/DataGrids/CategoryDataGrid.php | 3 +- packages/Webkul/Ui/src/DataGrid/DataGrid.php | 65 ++++++++++++++----- .../Ui/src/DataGrid/Helpers/Pagination.php | 2 +- 4 files changed, 55 insertions(+), 22 deletions(-) diff --git a/config/datagrid.php b/config/datagrid.php index 8a99c7595..19d690e0e 100644 --- a/config/datagrid.php +++ b/config/datagrid.php @@ -2,12 +2,17 @@ return [ + /** + * Default Select Value + */ + 'select' => 'id', + /** * Default OrderBy * * * Accepted Values = Array */ - 'defaultOrder' => [ + 'order' => [ 'column' => 'id', 'direction' => 'desc' ], diff --git a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php index e44ac9269..e4323eb02 100644 --- a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php @@ -24,10 +24,9 @@ class CategoryDataGrid return DataGrid::make([ 'name' => 'Categories', 'table' => 'categories as cat', - 'select' => 'cat.id', + 'select' => '', 'perpage' => 10, 'aliased' => true, //use this with false as default and true in case of joins - 'alias' => 'cat', 'massoperations' =>[ // [ diff --git a/packages/Webkul/Ui/src/DataGrid/DataGrid.php b/packages/Webkul/Ui/src/DataGrid/DataGrid.php index f94526732..81764dd19 100644 --- a/packages/Webkul/Ui/src/DataGrid/DataGrid.php +++ b/packages/Webkul/Ui/src/DataGrid/DataGrid.php @@ -167,7 +167,7 @@ class DataGrid } //This assigns the private and public properties of the datagrid classes from make functions - public function build( + public function build ( string $name = null, string $select = null, array $filterable = [], @@ -185,12 +185,12 @@ class DataGrid $this->request = Request::capture(); $this->setName($name); $this->setAlias($aliased); + $this->setTable($table); $this->setSelect($select); $this->setFilterable($filterable); $this->setSearchable($filterable); $this->setMassOperations($massoperations); $this->setPerPage($perpage); - $this->setTable($table); $this->setJoin($join); $this->addColumns($columns, true); $this->setCss($css); @@ -219,7 +219,18 @@ class DataGrid */ public function setSelect($select) { - $this->select = $select ? : false; + if (!$select) { + $select = config('datagrid.select'); + + if ($this->aliased) { + $alias = $this->findTableAlias(); + + $select = $alias.'.'.$select; + } + } + + $this->select = $select; + return $this; } @@ -347,6 +358,21 @@ class DataGrid // return $this; // } + /** + * get alias of the leftmost table + * + * @return null|string + */ + public function findTableAlias() { + if($this->aliased) { + $alias = trim(explode('as', $this->table)[1]); + } else { + $alias = null; + } + + return $alias; + } + /** * Section actions bag here. * @@ -367,11 +393,13 @@ class DataGrid if ($reCreate) { $this->columns = new Collection(); } + if ($columns) { foreach ($columns as $column) { $this->addColumn($column); } } + return $this; } @@ -440,27 +468,28 @@ class DataGrid } else { throw new \Exception("DataGrid: Pagination argument is not valid!"); } + return $this; } /** - * Used for selecting - * the columns got in - * make from controller. + * Used for selecting the columns got in make from controller. + * * @return $this */ private function getSelect() { $select = []; + + if ($this->select) { + $this->query->addselect($this->select); + } + foreach ($this->columns as $column) { $this->query->addselect(DB::raw($column->name.' as '.$column->alias)); } // $this->query->select(...$select); - - if ($this->select) { - $this->query->addselect($this->select); - } } /** @@ -470,7 +499,7 @@ class DataGrid * name. * @return string */ - public function findAlias($column_alias) { + public function findColumnAlias($column_alias) { foreach($this->columns as $column) { if($column->alias == $column_alias) { return $column->name; @@ -485,7 +514,7 @@ class DataGrid * name. * @return string */ - public function findType($column_alias) { + public function findColumnType($column_alias) { foreach($this->columns as $column) { if($column->alias == $column_alias) { return $column->type; @@ -564,13 +593,13 @@ class DataGrid if ($this->aliased) { //aliasing is expected in this case or it will be changed to presence of join bag foreach ($parsed as $key=>$value) { - $column_name = $this->findAlias($key); - $column_type = $this->findType($key); + $column_name = $this->findColumnAlias($key); + $column_type = $this->findColumnType($key); if ($key == "sort") { //resolve the case with the column helper class if(substr_count($key,'_') >= 1) - $column_name = $this->findAlias($key); + $column_name = $this->findColumnAlias($key); //case that don't need any resolving $count_keys = count(array_keys($value)); @@ -592,7 +621,7 @@ class DataGrid } }); } else { - $column_name = $this->findAlias($key); + $column_name = $this->findColumnAlias($key); if (array_keys($value)[0]=="like" || array_keys($value)[0]=="nlike") { foreach ($value as $condition => $filter_value) { $this->query->where( @@ -650,8 +679,8 @@ class DataGrid } else { // $column_name = $key; - $column_name = $this->findAlias($key); - $column_type = $this->findType($key); + $column_name = $this->findColumnAlias($key); + $column_type = $this->findColumnType($key); if (array_keys($value)[0]=="like" || array_keys($value)[0]=="nlike") { foreach ($value as $condition => $filter_value) { diff --git a/packages/Webkul/Ui/src/DataGrid/Helpers/Pagination.php b/packages/Webkul/Ui/src/DataGrid/Helpers/Pagination.php index f1f276680..1cd6f044e 100644 --- a/packages/Webkul/Ui/src/DataGrid/Helpers/Pagination.php +++ b/packages/Webkul/Ui/src/DataGrid/Helpers/Pagination.php @@ -17,7 +17,7 @@ use Illuminate\Pagination\Paginator; class Pagination extends Paginator { - const LIMIT = 20; + const LIMIT = 10; const OFFSET = 0; const VIEW = ''; From 926158cc0d36e7ec43ca53032ab4fef39be363c7 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Mon, 7 Jan 2019 13:37:35 +0530 Subject: [PATCH 04/14] datagrid refactored from backend to frontend, remaining is filters, sorts and searches to be refactored into vue components --- config/datagrid.php | 58 +- .../Admin/src/DataGrids/CategoryDataGrid.php | 22 +- .../Admin/src/DataGrids/TestDataGrid.php | 106 + .../Http/Controllers/DataGridController.php | 22 +- packages/Webkul/Admin/src/Http/routes.php | 4 + .../Admin/src/Resources/assets/sass/app.scss | 16 +- .../views/catalog/categories/test.blade.php | 24 + .../views/catalog/products/index.blade.php | 9 +- .../Resources/views/layouts/master.blade.php | 2 +- packages/Webkul/Admin/webpack.mix.js | 4 +- .../Http/Controllers/ProductController.php | 1 + .../Webkul/Ui/publishable/assets/css/ui.css | 1598 ++++- .../publishable/assets/images/Icon-star.svg | 10 + .../Webkul/Ui/publishable/assets/js/ui.js | 5981 ++++++++++++++++- .../Ui/publishable/assets/mix-manifest.json | 6 +- packages/Webkul/Ui/src/DataGrid/AbsGrid.php | 150 + packages/Webkul/Ui/src/DataGrid/DataGrid.php | 19 +- .../Webkul/Ui/src/DataGrid/Helpers/Column.php | 1 - .../Ui/src/Resources/assets/sass/app.scss | 3 +- .../Resources/views/testgrid/body.blade.php | 16 + .../views/testgrid/filters.blade.php | 3 + .../Resources/views/testgrid/head.blade.php | 14 + .../Resources/views/testgrid/table.blade.php | 381 ++ 23 files changed, 8410 insertions(+), 40 deletions(-) create mode 100644 packages/Webkul/Admin/src/DataGrids/TestDataGrid.php create mode 100644 packages/Webkul/Admin/src/Resources/views/catalog/categories/test.blade.php create mode 100644 packages/Webkul/Ui/publishable/assets/images/Icon-star.svg create mode 100644 packages/Webkul/Ui/src/DataGrid/AbsGrid.php create mode 100644 packages/Webkul/Ui/src/Resources/views/testgrid/body.blade.php create mode 100644 packages/Webkul/Ui/src/Resources/views/testgrid/filters.blade.php create mode 100644 packages/Webkul/Ui/src/Resources/views/testgrid/head.blade.php create mode 100644 packages/Webkul/Ui/src/Resources/views/testgrid/table.blade.php diff --git a/config/datagrid.php b/config/datagrid.php index 19d690e0e..6a64430b6 100644 --- a/config/datagrid.php +++ b/config/datagrid.php @@ -29,5 +29,61 @@ return [ * * Accepted Values = integer */ - 'pagination' => 10 + // 'pagination' => 10, + + 'operators' => [ + 'eq' => "=", + 'lt' => "<", + 'gt' => ">", + 'lte' => "<=", + 'gte' => ">=", + 'neqs' => "<>", + 'neqn' => "!=", + 'eqo' => "<=>", + 'like' => "like", + 'blike' => "like binary", + 'nlike' => "not like", + 'ilike' => "ilike", + 'and' => "&", + 'bor' => "|", + 'regex' => "regexp", + 'notregex' => "not regexp", + // 14 => "^", + // 15 => "<<", + // 16 => ">>", + // 17 => "rlike", + // 20 => "~", + // 21 => "~*", + // 22 => "!~", + // 23 => "!~*", + // 24 => "similar to", + // 25 => "not similar to", + // 26 => "not ilike", + // 27 => "~~*", + // 28 => "!~~*" + ], + + 'bindings' => [ + 0 => "select", + 1 => "from", + 2 => "join", + 3 => "where", + 4 => "having", + 5 => "order", + 6 => "union" + ], + + 'selectcomponents' => [ + 0 => "aggregate", + 1 => "columns", + 2 => "from", + 3 => "joins", + 4 => "wheres", + 5 => "groups", + 6 => "havings", + 7 => "orders", + 8 => "limit", + 9 => "offset", + 10 => "lock", + ] ]; \ No newline at end of file diff --git a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php index e4323eb02..d50599b20 100644 --- a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php @@ -24,7 +24,7 @@ class CategoryDataGrid return DataGrid::make([ 'name' => 'Categories', 'table' => 'categories as cat', - 'select' => '', + 'select' => 'cat.id', 'perpage' => 10, 'aliased' => true, //use this with false as default and true in case of joins @@ -58,19 +58,15 @@ class CategoryDataGrid 'primaryKey' => 'cat.id', 'condition' => '=', 'secondaryKey' => 'ct.category_id', + 'conditions' => [ + 'condition' => ['ct.locale', app()->getLocale()] + ] ], [ 'join' => 'leftjoin', 'table' => 'product_categories as pc', 'primaryKey' => 'cat.id', 'condition' => '=', - 'secondaryKey' => 'pc.category_id', - // 'conditions' => [ - // [ - // 'columnFirst' => 'ct.', - // 'condition' => '', - // 'columnSecond' => '' - // ] - // ] + 'secondaryKey' => 'pc.category_id' ] ], @@ -113,10 +109,10 @@ class CategoryDataGrid 'type' => 'string', 'label' => 'Locale', 'sortable' => true, - 'filter' => [ - 'function' => 'orWhere', - 'condition' => ['ct.locale', app()->getLocale()] - ], + // 'filter' => [ + // 'function' => 'orWhere', + // 'condition' => ['ct.locale', app()->getLocale()] + // ], ] ], diff --git a/packages/Webkul/Admin/src/DataGrids/TestDataGrid.php b/packages/Webkul/Admin/src/DataGrids/TestDataGrid.php new file mode 100644 index 000000000..263f9b12a --- /dev/null +++ b/packages/Webkul/Admin/src/DataGrids/TestDataGrid.php @@ -0,0 +1,106 @@ + @prashant-webkul + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class TestDataGrid extends AbsGrid +{ + public $allColumns = []; + + public function prepareQueryBuilder() + { + $queryBuilder = DB::table('products_grid')->addSelect($this->columns)->leftJoin('products', 'products_grid.product_id', '=', 'products.id')->where('products.parent_id', '=', null); + + $this->setQueryBuilder($queryBuilder); + } + + public function addColumns() + { + $this->addColumn([ + 'column' => 'products_grid.product_id', + 'alias' => 'productid', + 'label' => 'ID', + 'type' => 'number', + 'searchable' => true, + 'sortable' => true, + 'width' => '40px' + ]); + + $this->addColumn([ + 'column' => 'products_grid.sku', + 'alias' => 'productsku', + 'label' => 'SKU', + 'type' => 'string', + 'searchable' => true, + 'sortable' => true, + 'width' => '100px' + ]); + + $this->addColumn([ + 'column' => 'products_grid.name', + 'alias' => 'productname', + 'label' => 'Name', + 'type' => 'string', + 'searchable' => true, + 'sortable' => true, + 'width' => '100px' + ]); + + $this->addColumn([ + 'column' => 'products.type', + 'alias' => 'producttype', + 'label' => 'Type', + 'type' => 'string', + 'sortable' => true, + 'searchable' => true, + 'width' => '100px' + ]); + + $this->addColumn([ + 'column' => 'products_grid.status', + 'alias' => 'productstatus', + 'label' => 'Status', + 'type' => 'boolean', + 'sortable' => true, + 'searchable' => true, + 'width' => '100px' + ]); + + $this->addColumn([ + 'column' => 'products_grid.price', + 'alias' => 'productprice', + 'label' => 'Price', + 'type' => 'number', + 'sortable' => true, + 'searchable' => true, + 'width' => '100px' + ]); + + $this->addColumn([ + 'column' => 'products_grid.quantity', + 'alias' => 'productqty', + 'label' => 'Quantity', + 'type' => 'number', + 'sortable' => true, + 'searchable' => true, + 'width' => '100px' + ]); + } + + public function render() + { + $this->addColumns(); + + $this->prepareQueryBuilder(); + + return view('ui::testgrid.table')->with('results', ['records' => $this->getCollection(), 'columns' => $this->allColumns]); + } +} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Http/Controllers/DataGridController.php b/packages/Webkul/Admin/src/Http/Controllers/DataGridController.php index 8ffcb9388..ae6a5299a 100644 --- a/packages/Webkul/Admin/src/Http/Controllers/DataGridController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/DataGridController.php @@ -4,11 +4,11 @@ namespace Webkul\Admin\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Http\Response; -use Illuminate\Routing\Controller; -use Webkul\Ui\DataGrid\Facades\DataGrid; +use Webkul\Admin\Http\Controllers\Controller; +use Webkul\Admin\DataGrids\TestDataGrid; /** - * DataGrid controller + * TestDataGrid controller * * @author Nikhil Malik @ysmnikhil * @author Prashant Singh @prashant-webkul @@ -16,6 +16,18 @@ use Webkul\Ui\DataGrid\Facades\DataGrid; */ class DataGridController extends Controller { + protected $_config; + protected $testgrid; + + public function __construct(TestDataGrid $testgrid) + { + $this->middleware('admin'); + + $this->_config = request('_config'); + + $this->testgrid = $testgrid; + } + public function massDelete() { dd(request()->all()); } @@ -23,4 +35,8 @@ class DataGridController extends Controller public function massUpdate() { dd(request()->all()); } + + public function testGrid() { + return $this->testgrid->render(); + } } diff --git a/packages/Webkul/Admin/src/Http/routes.php b/packages/Webkul/Admin/src/Http/routes.php index 7a2f0a56c..fb6330ce7 100644 --- a/packages/Webkul/Admin/src/Http/routes.php +++ b/packages/Webkul/Admin/src/Http/routes.php @@ -7,6 +7,10 @@ Route::group(['middleware' => ['web']], function () { 'view' => 'admin::users.sessions.create' ])->name('admin.session.create'); + Route::get('/testgrid', 'Webkul\Admin\Http\Controllers\DataGridController@testGrid')->defaults('_config', [ + 'view' => 'admin::catalog.categories.test' + ]); + //login post route to admin auth controller Route::post('/login', 'Webkul\User\Http\Controllers\SessionController@store')->defaults('_config', [ 'redirect' => 'admin.dashboard.index' diff --git a/packages/Webkul/Admin/src/Resources/assets/sass/app.scss b/packages/Webkul/Admin/src/Resources/assets/sass/app.scss index efed33611..4e1464a90 100644 --- a/packages/Webkul/Admin/src/Resources/assets/sass/app.scss +++ b/packages/Webkul/Admin/src/Resources/assets/sass/app.scss @@ -15,6 +15,20 @@ body { min-height: 100%; } +::-webkit-scrollbar { + width: 12px; +} + +::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 6px rgba(255, 255, 255, 0.3); + border-radius: 10px; +} + +::-webkit-scrollbar-thumb { + border-radius: 10px; + -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); +} + .navbar-top { height: 60px; background: #ffffff; @@ -157,7 +171,7 @@ body { } .content { - padding: 25px 0; + margin-top: 25px; &.full-page { padding: 25px; diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/categories/test.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/categories/test.blade.php new file mode 100644 index 000000000..40c3316c7 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/catalog/categories/test.blade.php @@ -0,0 +1,24 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.customers.customers.title') }} +@stop + +@section('content') +
+ + +
+

Test the grid here

+
+
+@endsection \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/products/index.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/products/index.blade.php index b51469de3..545d72f9c 100644 --- a/packages/Webkul/Admin/src/Resources/views/catalog/products/index.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/products/index.blade.php @@ -5,7 +5,7 @@ @stop @section('content') -
+
@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/layouts/master.blade.php b/packages/Webkul/Admin/src/Resources/views/layouts/master.blade.php index 8adc8b98b..9f4ee570c 100644 --- a/packages/Webkul/Admin/src/Resources/views/layouts/master.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/layouts/master.blade.php @@ -17,7 +17,7 @@ - +
diff --git a/packages/Webkul/Admin/webpack.mix.js b/packages/Webkul/Admin/webpack.mix.js index 92e3d593b..3f72c18c8 100644 --- a/packages/Webkul/Admin/webpack.mix.js +++ b/packages/Webkul/Admin/webpack.mix.js @@ -1,8 +1,8 @@ const { mix } = require("laravel-mix"); require("laravel-mix-merge-manifest"); -var publicPath = 'publishable/assets'; -// var publicPath = "../../../public/vendor/webkul/admin/assets"; +// var publicPath = 'publishable/assets'; +var publicPath = "../../../public/vendor/webkul/admin/assets"; mix.setPublicPath(publicPath).mergeManifest(); mix.disableNotifications(); diff --git a/packages/Webkul/Product/src/Http/Controllers/ProductController.php b/packages/Webkul/Product/src/Http/Controllers/ProductController.php index 5d9734689..2981fe093 100644 --- a/packages/Webkul/Product/src/Http/Controllers/ProductController.php +++ b/packages/Webkul/Product/src/Http/Controllers/ProductController.php @@ -11,6 +11,7 @@ use Webkul\Product\Repositories\ProductGridRepository as ProductGrid; use Webkul\Attribute\Repositories\AttributeFamilyRepository as AttributeFamily; use Webkul\Category\Repositories\CategoryRepository as Category; use Webkul\Inventory\Repositories\InventorySourceRepository as InventorySource; +use Webkul\Admin\DataGrids\TestDataGrid; /** * Product controller diff --git a/packages/Webkul/Ui/publishable/assets/css/ui.css b/packages/Webkul/Ui/publishable/assets/css/ui.css index ff92d073e..085e072c4 100644 --- a/packages/Webkul/Ui/publishable/assets/css/ui.css +++ b/packages/Webkul/Ui/publishable/assets/css/ui.css @@ -1 +1,1597 @@ -.active.configuration-icon,.catalog-icon,.configuration-icon,.customer-icon,.dashboard-icon,.sales-icon,.settings-icon{width:48px;height:48px;display:inline-block;background-size:cover}.icon{display:inline-block;background-size:cover}.dashboard-icon{background-image:url("../images/Icon-Dashboard.svg")}.sales-icon{background-image:url("../images/Icon-Sales.svg")}.catalog-icon{background-image:url("../images/Icon-Catalog.svg")}.customer-icon{background-image:url("../images/Icon-Customers.svg")}.configuration-icon{background-image:url("../images/Icon-Configure.svg")}.settings-icon{background-image:url("../images/Icon-Settings.svg")}.angle-right-icon{background-image:url("../images/Angle-Right.svg");width:17px;height:17px}.angle-left-icon{background-image:url("../images/Angle-Left.svg");width:17px;height:17px}.arrow-down-icon{background-image:url("../images/Arrow-Down-Light.svg");width:14px;height:8px}.arrow-right-icon{background-image:url("../images/Arrow-Right.svg");width:18px;height:18px}.white-cross-sm-icon{background-image:url("../images/Icon-Sm-Cross-White.svg");width:18px;height:18px}.accordian-up-icon{background-image:url("../images/Accordion-Arrow-Up.svg");width:24px;height:24px}.accordian-down-icon{background-image:url("../images/Accordion-Arrow-Down.svg");width:24px;height:24px}.cross-icon{background-image:url("../images/Icon-Crossed.svg");width:18px;height:18px}.trash-icon{background-image:url("../images/Icon-Trash.svg");width:24px;height:24px}.remove-icon{background-image:url("../images/Icon-remove.svg");width:24px;height:24px}.pencil-lg-icon{background-image:url("../images/Icon-Pencil-Large.svg");width:24px;height:24px}.eye-icon{background-image:url("../images/Icon-eye.svg");width:24px;height:24px}.search-icon{background-image:url("../images/icon-search.svg");width:24px;height:24px}.sortable-icon{background-image:url("../images/Icon-Sortable.svg");width:24px;height:24px}.sort-down-icon,.sort-up-icon{background-image:url("../images/Icon-Sort-Down.svg");width:18px;height:18px}.sort-up-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.primary-back-icon{background-image:url("../images/Icon-Back-Primary.svg");width:24px;height:24px}.checkbox-dash-icon{background-image:url("../images/Checkbox-Dash.svg");width:24px;height:24px}.account-icon{background-image:url("../images/icon-account.svg");width:24px;height:24px}.expand-icon{background-image:url("../images/Expand-Light.svg");width:18px;height:18px}.expand-on-icon{background-image:url("../images/Expand-Light-On.svg");width:18px;height:18px}.dark-left-icon{background-image:url("../images/arrow-left-dark.svg");width:18px;height:18px}.light-right-icon{background-image:url("../images/arrow-right-light.svg");width:18px;height:18px}.folder-icon{background-image:url("../images/Folder-Icon.svg");width:24px;height:24px}.star-icon{background-image:url("../images/Star-Icon.svg");width:24px;height:24px}.arrow-down-white-icon{background-image:url("../images/down-arrow-white.svg");width:17px;height:13px}.arrow-up-white-icon{background-image:url("../images/up-arrow-white.svg");width:17px;height:13px}.profile-pic-icon{background-image:url("../images/Profile-Pic.svg");width:60px;height:60px}.graph-up-icon{background-image:url("../images/Icon-Graph-Green.svg");width:24px;height:24px}.graph-down-icon{background-image:url("../images/Icon-Graph-Red.svg");width:24px;height:24px}.no-result-icon{background-image:url("../images/limited-icon.svg");width:52px;height:47px}.active .dashboard-icon{background-image:url("../images/Icon-Dashboard-Active.svg")}.active .sales-icon{background-image:url("../images/Icon-Sales-Active.svg")}.active .catalog-icon{background-image:url("../images/Icon-Catalog-Active.svg")}.active .customer-icon{background-image:url("../images/Icon-Customers-Active.svg")}.active .settings-icon{background-image:url("../images/Icon-Settings-Active.svg")}.active .configuration-icon{background-image:url("../images/Icon-Configure-Active.svg")}.active>.arrow-down-icon{background-image:url("../images/Arrow-Down.svg");width:14px;height:8px}.active>.expand-icon{background-image:url("../images/Expand-Light-On.svg")}.active.dashboard-icon{background-image:url("../images/Icon-Dashboard-Active.svg")}.active.customer-icon{background-image:url("../images/Icon-Customers-Active.svg")}.active.sales-icon{background-image:url("../images/Icon-Sales-Active.svg")}.active.settings-icon{background-image:url("../images/Icon-Settings-Active.svg")}.active.configuration-icon{background-image:url("../images/Icon-Configure-Active.svg")}.active.arrow-down-icon{background-image:url("../images/Arrow-Down.svg");width:14px;height:8px}.active.expand-icon{background-image:url("../images/Expand-Light-On.svg")}.icon-404{background-image:url("../images/404-image.svg");width:255px;height:255px}.export-icon{background-image:url("../images/Icon-Export.svg");width:32px;height:32px}.grid-container .filter-wrapper{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}.grid-container .filter-wrapper .filter-row-one,.grid-container .filter-wrapper .filter-row-two{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.grid-container .filter-wrapper .filter-row-one{height:40px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.grid-container .filter-wrapper .filter-row-one .search-filter .control{font-family:montserrat,sans-serif;padding-left:10px;width:380px;height:36px;border:2px solid #c7c7c7;border-radius:3px;border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;font-size:14px}.grid-container .filter-wrapper .filter-row-one .search-filter .ic-wrapper{display:block;height:36px;width:36px;border:2px solid #c7c7c7;border-left:none;border-radius:2px}.grid-container .filter-wrapper .filter-row-one .search-filter .ic-wrapper .search-icon{margin-left:4px;margin-top:4px;height:24px;width:24px}.grid-container .filter-wrapper .filter-row-one .dropdown-filters{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-toggle{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;font-family:montserrat,sans-serif;padding-left:5px;height:36px;width:150px;border:2px solid #c7c7c7;border-radius:2px;background-color:#fff;color:#8e8e8e;font-size:14px}.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-toggle,.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-toggle .dropdown-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-toggle .dropdown-header{width:100%;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-toggle .dropdown-header .arrow-down-icon{margin-right:5px}.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul li.filter-column-dropdown .filter-column-select,.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul li input,.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul li select{width:100%;background:#fff;border:2px solid #c7c7c7;border-radius:3px;height:36px;display:inline-block;vertical-align:middle;-webkit-transition:.2s cubic-bezier(.4,0,.2,1);transition:.2s cubic-bezier(.4,0,.2,1);padding:0 5px;font-family:montserrat,sans-serif;margin-top:10px;margin-bottom:5px}.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul .filter-condition-dropdown-boolean,.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul .filter-condition-dropdown-datetime,.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul .filter-condition-dropdown-number,.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul .filter-condition-dropdown-string,.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul .filter-response-boolean,.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul .filter-response-datetime,.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul .filter-response-number,.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul .filter-response-string{display:none}.grid-container .filter-wrapper .filter-row-two{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-top:6px;margin-bottom:6px}.grid-container .filter-wrapper .filter-row-two .filter-one{margin-right:10px}.grid-container .filter-wrapper .filter-row-two .filter-one .filter-name{margin-right:5px}.grid-container .filter-wrapper .filter-row-two .filter-one .filter-value{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;background:#e7e7e7;padding-left:5px;color:#000311;vertical-align:middle}.grid-container .filter-wrapper .filter-row-two .filter-one .filter-value .f-value{margin:auto}.grid-container .filter-wrapper .filter-row-two .filter-one .filter-value .cross-icon{margin:5px;height:18px!important;width:18px!important;cursor:pointer}.grid-container .table thead .mass-action-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.grid-container .table thead .mass-action-wrapper .massaction-remove{margin-top:4px;margin-right:10px}.grid-container .table thead .mass-action-wrapper .selected-items{margin-right:15px}.grid-container .table thead tr th.grid_head .sort-down-icon,.grid-container .table thead tr th.grid_head .sort-up-icon{margin-left:5px;margin-top:-3px;vertical-align:middle}.grid-container .table thead tr th.grid_head.sortable{cursor:pointer}.grid-container .table thead tr th{text-transform:capitalize}.grid-container .table tbody td.action a:first-child{margin-right:10px}.grid-container .table .pagination{margin-top:20px}@-webkit-keyframes jelly{0%{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:0}70%{-webkit-transform:translateY(5px) scale(1.05);transform:translateY(5px) scale(1.05);opacity:1}to{-webkit-transform:translateY(0) scale(1);transform:translateY(0) scale(1);opacity:1}}@keyframes jelly{0%{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:0}70%{-webkit-transform:translateY(5px) scale(1.05);transform:translateY(5px) scale(1.05);opacity:1}to{-webkit-transform:translateY(0) scale(1);transform:translateY(0) scale(1);opacity:1}}@-webkit-keyframes jelly-out{0%{-webkit-transform:translateY(0) scale(1);transform:translateY(0) scale(1);opacity:1}30%{-webkit-transform:translateY(-5px) scale(1.05);transform:translateY(-5px) scale(1.05);opacity:1}to{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:0}}@keyframes jelly-out{0%{-webkit-transform:translateY(0) scale(1);transform:translateY(0) scale(1);opacity:1}30%{-webkit-transform:translateY(-5px) scale(1.05);transform:translateY(-5px) scale(1.05);opacity:1}to{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:0}}*{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:focus{outline:none}a:active,a:focus,a:hover,a:link,a:visited{text-decoration:none;color:#0041ff}textarea{resize:none}ul{margin:0;padding:0;list-style:none}h1{font-size:28px;margin-top:0}h1,h2{color:#3a3a3a}h2{font-size:18px}.tooltip{position:relative;border-bottom:1px solid #000}.tooltip .tooltiptext{visibility:hidden;width:120px;background-color:#000;color:#fff;text-align:center;border-radius:6px;padding:5px 0;position:absolute;z-index:1}.tooltip:hover .tooltiptext{visibility:visible}.hide{display:none!important}.btn{-webkit-box-shadow:0 1px 4px 0 rgba(0,0,0,.2),0 0 8px 0 rgba(0,0,0,.1);box-shadow:0 1px 4px 0 rgba(0,0,0,.2),0 0 8px 0 rgba(0,0,0,.1);border-radius:3px;border:none;color:#fff;cursor:pointer;-webkit-transition:.2s cubic-bezier(.4,0,.2,1);transition:.2s cubic-bezier(.4,0,.2,1);font:inherit;display:inline-block}.btn:active,.btn:focus,.btn:hover{opacity:.75;border:none}.btn.btn-sm{padding:6px 12px}.btn.btn-md{padding:8px 16px}.btn.btn-lg{padding:10px 20px}.btn.btn-xl{padding:12px 24px;font-size:16px}.btn.btn-primary{background:#0041ff;color:#fff}.btn.btn-black{background:#000;color:#fff}.btn:disabled,.btn[disabled=disabled],.btn[disabled=disabled]:active,.btn[disabled=disabled]:hover{cursor:not-allowed;background:#b1b1ae;-webkit-box-shadow:none;box-shadow:none;opacity:1}.dropdown-open{position:relative}.dropdown-list{width:200px;margin-bottom:20px;-webkit-box-shadow:0 2px 4px 0 rgba(0,0,0,.16),0 0 9px 0 rgba(0,0,0,.16);box-shadow:0 2px 4px 0 rgba(0,0,0,.16),0 0 9px 0 rgba(0,0,0,.16);border-radius:3px;background-color:#fff;position:absolute;display:none;z-index:10;text-align:left}.dropdown-list.bottom-left{top:42px;left:0}.dropdown-list.bottom-right{top:42px;right:0}.dropdown-list.top-left{bottom:42px;left:0}.dropdown-list.top-right{bottom:42px;right:0}.dropdown-list .search-box{padding:20px;border-bottom:1px solid hsla(0,0%,64%,.2)}.dropdown-list .search-box .control{background:#fff;border:2px solid #c7c7c7;border-radius:3px;width:100%;height:36px;display:inline-block;vertical-align:middle;-webkit-transition:.2s cubic-bezier(.4,0,.2,1);transition:.2s cubic-bezier(.4,0,.2,1);padding:0 10px;font-size:15px}.dropdown-list .search-box .control:focus{border-color:#0041ff}.dropdown-list .dropdown-container{padding:20px;overflow-y:auto;max-height:280px}.dropdown-list .dropdown-container label{font-size:15px;display:inline-block;text-transform:uppercase;color:#9e9e9e;font-weight:700;padding-bottom:5px}.dropdown-list .dropdown-container ul{margin:0;list-style-type:none;padding:0}.dropdown-list .dropdown-container ul li{padding:5px 0}.dropdown-list .dropdown-container ul li a:active,.dropdown-list .dropdown-container ul li a:focus,.dropdown-list .dropdown-container ul li a:link,.dropdown-list .dropdown-container ul li a:visited{color:#333;display:block}.dropdown-list .dropdown-container ul li a:hover{color:#0041ff}.dropdown-list .dropdown-container ul li .checkbox{margin:0}.dropdown-list .dropdown-container ul li .control-group label{color:#3a3a3a;font-size:15px;font-weight:500;text-transform:capitalize;width:100%}.dropdown-list .dropdown-container .btn{width:100%;margin-top:10px}.table{width:100%;overflow-x:auto}.table table{width:100%;border-collapse:collapse;text-align:left}.table table thead th{font-weight:700;padding:12px 10px;background:#f8f9fa;color:#3a3a3a}.table table tbody td{padding:10px;border-bottom:1px solid #d3d3d3;color:#3a3a3a;vertical-align:top}.table table tbody td.actions{text-align:right}.table table tbody td.actions .icon{cursor:pointer;vertical-align:middle}.table table tbody td.empty{text-align:center}.table table tbody tr:last-child td{border-bottom:none}.table .control-group{width:100%;margin-bottom:0}.table .control-group .control{width:100%;margin:0}.dropdown-btn{min-width:150px;text-align:left;background:#fff;border:2px solid #c7c7c7;border-radius:3px;font-size:14px;padding:8px 35px 8px 10px;cursor:pointer;position:relative}.dropdown-btn:active,.dropdown-btn:focus,.dropdown-btn:hover{opacity:.75;border:2px solid #c7c7c7}.dropdown-btn .icon{position:absolute;right:10px;top:50%;margin-top:-4px}.pagination .page-item{background:#fff;border:2px solid #c7c7c7;border-radius:3px;padding:7px 14px;margin-right:5px;font-size:16px;display:inline-block;color:#8e8e8e;vertical-align:middle;text-decoration:none}.pagination .page-item.next,.pagination .page-item.previous{padding:6px 9px}.pagination .page-item.active{background:#0041ff;color:#fff;border-color:#0041ff}.pagination .page-item .icon{vertical-align:middle;margin-bottom:3px}.checkbox{position:relative;display:block;vertical-align:middle;margin:0 5px 5px 0}.checkbox input{left:0;opacity:0;position:absolute;top:0;height:24px;width:24px;z-index:100}.checkbox .checkbox-view{background-image:url("../images/Checkbox.svg");height:24px;width:24px;margin:0;display:inline-block!important;vertical-align:middle;margin-right:5px}.checkbox input:checked+.checkbox-view{background-image:url("../images/Checkbox-Checked.svg")}.checkbox input:disabled+.checkbox-view{opacity:.5;cursor:not-allowed}.radio{position:relative;display:block;margin:10px 5px 5px 0}.radio input{left:0;opacity:0;position:absolute;top:0;z-index:100}.radio .radio-view{background-image:url("../images/controls.svg");background-position:-21px 0;height:20px;width:20px;margin:0;display:inline-block!important;vertical-align:middle;margin-right:5px}.radio input:checked+.radio-view{background-position:-21px -21px}.radio input:disabled+.radio-view{opacity:.5;cursor:not-allowed}.control-group{display:block;margin-bottom:25px;font-size:15px;color:#333;width:750px;max-width:100%;position:relative}.control-group label{display:block;color:#3a3a3a}.control-group label.required:after{content:"*";color:#fc6868;font-weight:700;display:inline-block}.control-group textarea.control{height:100px;padding:10px}.control-group .control{background:#fff;border:2px solid #c7c7c7;border-radius:3px;width:70%;height:36px;display:inline-block;vertical-align:middle;-webkit-transition:.2s cubic-bezier(.4,0,.2,1);transition:.2s cubic-bezier(.4,0,.2,1);padding:0 10px;font-size:15px;margin-top:10px;margin-bottom:5px}.control-group .control:focus{border-color:#0041ff}.control-group .control[disabled=disabled]{border-color:#d3d3d3;background-color:#d3d3d3;cursor:not-allowed}.control-group .control[multiple]{height:100px}.control-group.date:after,.control-group.datetime:after{background-image:url("../images/Icon-Calendar.svg");width:24px;height:24px;content:"";display:inline-block;vertical-align:middle;margin-left:-34px;margin-top:2px;pointer-events:none}.control-group .control-info{display:block;font-style:italic;color:#6f6f6f}.control-group .control-error{display:none;color:#ff5656;margin-top:5px}.control-group.has-error .control{border-color:#fc6868}.control-group.has-error .control-error{display:block}.control-group.price .currency-code{vertical-align:middle;display:inline-block}.button-group{margin-top:20px;margin-bottom:20px}.alert-wrapper{width:300px;top:10px;right:10px;position:fixed;z-index:6;text-align:left}.alert-wrapper .alert{width:300px;padding:15px;border-radius:3px;display:inline-block;-webkit-box-shadow:0 4px 15.36px .64px rgba(0,0,0,.1),0 2px 6px 0 rgba(0,0,0,.12);box-shadow:0 4px 15.36px .64px rgba(0,0,0,.1),0 2px 6px 0 rgba(0,0,0,.12);position:relative;-webkit-animation:jelly .5s ease-in-out;animation:jelly .5s ease-in-out;-webkit-transform-origin:center top;transform-origin:center top;z-index:500;margin-bottom:10px}.alert-wrapper .alert.alert-error{background:#fc6868}.alert-wrapper .alert.alert-info{background:#204d74}.alert-wrapper .alert.alert-success{background:#4caf50}.alert-wrapper .alert.alert-warning{background:#ffc107}.alert-wrapper .alert .icon{position:absolute;right:10px;top:10px;cursor:pointer}.alert-wrapper .alert p{color:#fff;margin:0;padding:0;font-size:15px}.tabs ul{border-bottom:1px solid hsla(0,0%,64%,.2)}.tabs ul li{display:inline-block}.tabs ul li a{padding:15px 20px;cursor:pointer;margin:0 2px;text-align:center;color:#000311;display:block}.tabs ul li.active a{border-bottom:3px solid #0041ff}.accordian,accordian{display:inline-block;width:100%}.accordian .accordian-header,.accordian div[slot*=header],accordian .accordian-header,accordian div[slot*=header]{width:100%;display:inline-block;font-size:18px;color:#3a3a3a;border-bottom:1px solid hsla(0,0%,64%,.2);padding:20px 15px;cursor:pointer}.accordian .accordian-header .expand-icon,.accordian div[slot*=header] .expand-icon,accordian .accordian-header .expand-icon,accordian div[slot*=header] .expand-icon{background-image:url("../images/Expand-Light.svg");margin-right:10px;margin-top:3px}.accordian .accordian-header h1,.accordian div[slot*=header] h1,accordian .accordian-header h1,accordian div[slot*=header] h1{margin:0;font-size:20px;display:inline-block}.accordian .accordian-header .icon,.accordian div[slot*=header] .icon,accordian .accordian-header .icon,accordian div[slot*=header] .icon{float:right}.accordian .accordian-header .icon.left,.accordian div[slot*=header] .icon.left,accordian .accordian-header .icon.left,accordian div[slot*=header] .icon.left{float:left}.accordian .accordian-content,.accordian div[slot*=body],accordian .accordian-content,accordian div[slot*=body]{width:100%;padding:20px 15px;display:none;-webkit-transition:all .3s ease;transition:all .3s ease}.accordian.active>.accordian-content,accordian.active>.accordian-content{display:inline-block}.accordian.active>.accordian-header .expand-icon,accordian.active>.accordian-header .expand-icon{background-image:url("../images/Expand-Light-On.svg")}.tree-container .tree-item{padding-left:30px;display:inline-block;margin-top:10px;width:100%}.tree-container .tree-item>.tree-item{display:none}.tree-container .tree-item.active>.tree-item{display:inline-block}.tree-container .tree-item .checkbox,.tree-container .tree-item .radio{margin:0;display:inline-block}.tree-container .tree-item .expand-icon{display:inline-block;margin-right:10px;cursor:pointer;background-image:url("../images/Expand-Light.svg");width:18px;height:18px;vertical-align:middle}.tree-container .tree-item .folder-icon{vertical-align:middle;margin-right:10px}.tree-container .tree-item.active>.expand-icon{background-image:url("../images/Expand-Light-On.svg")}.tree-container>.tree-item{padding-left:0}.panel{-webkit-box-shadow:0 2px 25px 0 rgba(0,0,0,.15);box-shadow:0 2px 25px 0 rgba(0,0,0,.15);border-radius:5px;background:#fff}.panel .panel-content{padding:20px}modal{display:none}.modal-open{overflow:hidden}.modal-overlay{display:none;overflow-y:auto;z-index:10;top:0;right:0;bottom:0;left:0;position:fixed;background:#000;opacity:.75}.modal-open .modal-overlay{display:block}.modal-container{-webkit-animation:fade-in-white .3s ease-in-out;animation:fade-in-white .3s ease-in-out;z-index:11;margin-left:-350px;width:600px;max-width:80%;background:#fff;position:fixed;left:50%;top:100px;margin-bottom:100px;-webkit-box-shadow:0 15px 25px 0 rgba(0,0,0,.03),0 20px 45px 5px rgba(0,0,0,.2);box-shadow:0 15px 25px 0 rgba(0,0,0,.03),0 20px 45px 5px rgba(0,0,0,.2);-webkit-animation:jelly .5s ease-in-out;animation:jelly .5s ease-in-out;border-radius:5px}.modal-container .modal-header{padding:20px}.modal-container .modal-header h3{display:inline-block;font-size:20px;color:#3a3a3a;margin:0}.modal-container .modal-header .icon{float:right;cursor:pointer}.modal-container .modal-body{padding:20px}.modal-container .modal-body .control-group .control{width:100%}.label{background:#e7e7e7;border-radius:2px;padding:8px;color:#000311;display:inline-block}.label.label-sm{padding:5px}.label.label-md{padding:8px}.label.label-lg{padding:11px}.label.label-xl{padding:14px}.badge{border-radius:50px;color:#fff;padding:8px;white-space:nowrap}.badge.badge-sm{padding:5px}.badge.badge-md{padding:3px 10px}.badge.badge-lg{padding:11px}.badge.badge-xl{padding:14px}.badge.badge-success{background-color:#4caf50}.badge.badge-info{background-color:#0041ff}.badge.badge-danger{background-color:#fc6868}.badge.badge-warning{background-color:#ffc107}.image-wrapper{margin-bottom:20px;margin-top:10px;display:inline-block;width:100%}.image-wrapper .image-item{width:200px;height:200px;margin-right:20px;background:#f8f9fa;border-radius:3px;display:inline-block;position:relative;background-image:url("../images/placeholder-icon.svg");background-repeat:no-repeat;background-position:50%;margin-bottom:20px}.image-wrapper .image-item img.preview{width:100%;height:100%}.image-wrapper .image-item input{display:none}.image-wrapper .image-item .remove-image{background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,.08)),to(rgba(0,0,0,.24)));background-image:linear-gradient(-180deg,rgba(0,0,0,.08),rgba(0,0,0,.24));border-radius:0 0 4px 4px;position:absolute;bottom:0;width:100%;padding:10px;text-align:center;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.24);margin-right:20px;cursor:pointer}.image-wrapper .image-item:hover .remove-image{display:block}.image-wrapper .image-item.has-image{background-image:none}.cp-spinner{width:48px;height:48px;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box}.cp-round:before{border-radius:50%;border:6px solid #bababa}.cp-round:after,.cp-round:before{content:" ";width:48px;height:48px;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;top:0;left:0}.cp-round:after{border-radius:50%;border-top:6px solid #0041ff;border-right:6px solid transparent;border-bottom:6px solid transparent;border-left:6px solid transparent;-webkit-animation:spin 1s ease-in-out infinite;animation:spin 1s ease-in-out infinite}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}} \ No newline at end of file +.dashboard-icon, .sales-icon, .catalog-icon, .customer-icon, .configuration-icon, .settings-icon, .active.configuration-icon { + width: 48px; + height: 48px; + display: inline-block; + background-size: cover; +} + +.icon { + display: inline-block; + background-size: cover; +} + +.dashboard-icon { + background-image: url("../images/Icon-Dashboard.svg"); +} + +.sales-icon { + background-image: url("../images/Icon-Sales.svg"); +} + +.catalog-icon { + background-image: url("../images/Icon-Catalog.svg"); +} + +.customer-icon { + background-image: url("../images/Icon-Customers.svg"); +} + +.configuration-icon { + background-image: url("../images/Icon-Configure.svg"); +} + +.settings-icon { + background-image: url("../images/Icon-Settings.svg"); +} + +.angle-right-icon { + background-image: url("../images/Angle-Right.svg"); + width: 17px; + height: 17px; +} + +.angle-left-icon { + background-image: url("../images/Angle-Left.svg"); + width: 17px; + height: 17px; +} + +.arrow-down-icon { + background-image: url("../images/Arrow-Down-Light.svg"); + width: 14px; + height: 8px; +} + +.arrow-right-icon { + background-image: url("../images/Arrow-Right.svg"); + width: 18px; + height: 18px; +} + +.white-cross-sm-icon { + background-image: url("../images/Icon-Sm-Cross-White.svg"); + width: 18px; + height: 18px; +} + +.accordian-up-icon { + background-image: url("../images/Accordion-Arrow-Up.svg"); + width: 24px; + height: 24px; +} + +.accordian-down-icon { + background-image: url("../images/Accordion-Arrow-Down.svg"); + width: 24px; + height: 24px; +} + +.cross-icon { + background-image: url("../images/Icon-Crossed.svg"); + width: 18px; + height: 18px; +} + +.trash-icon { + background-image: url("../images/Icon-Trash.svg"); + width: 24px; + height: 24px; +} + +.remove-icon { + background-image: url("../images/Icon-remove.svg"); + width: 24px; + height: 24px; +} + +.pencil-lg-icon { + background-image: url("../images/Icon-Pencil-Large.svg"); + width: 24px; + height: 24px; +} + +.eye-icon { + background-image: url("../images/Icon-eye.svg"); + width: 24px; + height: 24px; +} + +.search-icon { + background-image: url("../images/icon-search.svg"); + width: 24px; + height: 24px; +} + +.sortable-icon { + background-image: url("../images/Icon-Sortable.svg"); + width: 24px; + height: 24px; +} + +.sort-down-icon { + background-image: url("../images/Icon-Sort-Down.svg"); + width: 18px; + height: 18px; +} + +.sort-up-icon { + background-image: url("../images/Icon-Sort-Down.svg"); + width: 18px; + height: 18px; + -webkit-transform: rotate(180deg); + transform: rotate(180deg); +} + +.primary-back-icon { + background-image: url("../images/Icon-Back-Primary.svg"); + width: 24px; + height: 24px; +} + +.checkbox-dash-icon { + background-image: url("../images/Checkbox-Dash.svg"); + width: 24px; + height: 24px; +} + +.account-icon { + background-image: url("../images/icon-account.svg"); + width: 24px; + height: 24px; +} + +.expand-icon { + background-image: url("../images/Expand-Light.svg"); + width: 18px; + height: 18px; +} + +.expand-on-icon { + background-image: url("../images/Expand-Light-On.svg"); + width: 18px; + height: 18px; +} + +.dark-left-icon { + background-image: url("../images/arrow-left-dark.svg"); + width: 18px; + height: 18px; +} + +.light-right-icon { + background-image: url("../images/arrow-right-light.svg"); + width: 18px; + height: 18px; +} + +.folder-icon { + background-image: url("../images/Folder-Icon.svg"); + width: 24px; + height: 24px; +} + +.star-icon { + background-image: url("../images/Star-Icon.svg"); + width: 24px; + height: 24px; +} + +.arrow-down-white-icon { + background-image: url("../images/down-arrow-white.svg"); + width: 17px; + height: 13px; +} + +.arrow-up-white-icon { + background-image: url("../images/up-arrow-white.svg"); + width: 17px; + height: 13px; +} + +.profile-pic-icon { + background-image: url("../images/Profile-Pic.svg"); + width: 60px; + height: 60px; +} + +.graph-up-icon { + background-image: url("../images/Icon-Graph-Green.svg"); + width: 24px; + height: 24px; +} + +.graph-down-icon { + background-image: url("../images/Icon-Graph-Red.svg"); + width: 24px; + height: 24px; +} + +.no-result-icon { + background-image: url("../images/limited-icon.svg"); + width: 52px; + height: 47px; +} + +.active .dashboard-icon { + background-image: url("../images/Icon-Dashboard-Active.svg"); +} + +.active .sales-icon { + background-image: url("../images/Icon-Sales-Active.svg"); +} + +.active .catalog-icon { + background-image: url("../images/Icon-Catalog-Active.svg"); +} + +.active .customer-icon { + background-image: url("../images/Icon-Customers-Active.svg"); +} + +.active .settings-icon { + background-image: url("../images/Icon-Settings-Active.svg"); +} + +.active .configuration-icon { + background-image: url("../images/Icon-Configure-Active.svg"); +} + +.active > .arrow-down-icon { + background-image: url("../images/Arrow-Down.svg"); + width: 14px; + height: 8px; +} + +.active > .expand-icon { + background-image: url("../images/Expand-Light-On.svg"); +} + +.active.dashboard-icon { + background-image: url("../images/Icon-Dashboard-Active.svg"); +} + +.active.customer-icon { + background-image: url("../images/Icon-Customers-Active.svg"); +} + +.active.sales-icon { + background-image: url("../images/Icon-Sales-Active.svg"); +} + +.active.settings-icon { + background-image: url("../images/Icon-Settings-Active.svg"); +} + +.active.configuration-icon { + background-image: url("../images/Icon-Configure-Active.svg"); +} + +.active.arrow-down-icon { + background-image: url("../images/Arrow-Down.svg"); + width: 14px; + height: 8px; +} + +.active.expand-icon { + background-image: url("../images/Expand-Light-On.svg"); +} + +.icon-404 { + background-image: url("../images/404-image.svg"); + width: 255px; + height: 255px; +} + +.export-icon { + background-image: url("../images/Icon-Export.svg"); + width: 32px; + height: 32px; +} + +.star-blue-icon { + width: 17px; + height: 17px; + background-image: url("../images/Icon-star.svg"); +} + +/* Data grid css starts here */ +.grid-container .filter-wrapper { + display: block; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +.grid-container .filter-wrapper .filter-row-one, +.grid-container .filter-wrapper .filter-row-two { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; +} + +.grid-container .filter-wrapper .filter-row-one { + height: 40px; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; +} + +.grid-container .filter-wrapper .filter-row-one .search-filter .control { + font-family: "montserrat", sans-serif; + padding-left: 10px; + width: 380px; + height: 36px; + border: 2px solid #C7C7C7; + border-radius: 3px; + border-right: 0px; + border-top-right-radius: 0px; + border-bottom-right-radius: 0px; + font-size: 14px; +} + +.grid-container .filter-wrapper .filter-row-one .search-filter .ic-wrapper { + display: block; + height: 36px; + width: 36px; + border: 2px solid #C7C7C7; + border-left: none; + border-radius: 2px; +} + +.grid-container .filter-wrapper .filter-row-one .search-filter .ic-wrapper .search-icon { + margin-left: 4px; + margin-top: 4px; + height: 24px; + width: 24px; +} + +.grid-container .filter-wrapper .filter-row-one .dropdown-filters { + display: -webkit-inline-box; + display: -ms-inline-flexbox; + display: inline-flex; +} + +.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-toggle { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + font-family: "montserrat", sans-serif; + padding-left: 5px; + height: 36px; + width: 150px; + border: 2px solid #C7C7C7; + border-radius: 2px; + background-color: #ffffff; + color: #8e8e8e; + font-size: 14px; +} + +.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-toggle .dropdown-header { + width: 100%; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; +} + +.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-toggle .dropdown-header .arrow-down-icon { + margin-right: 5px; +} + +.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul li.filter-column-dropdown .filter-column-select { + width: 100%; + background: #ffffff; + border: 2px solid #C7C7C7; + border-radius: 3px; + height: 36px; + display: inline-block; + vertical-align: middle; + -webkit-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); + transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); + padding: 0px 5px; + font-family: "montserrat", sans-serif; + margin-top: 10px; + margin-bottom: 5px; +} + +.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul li select { + background: #ffffff; + border: 2px solid #C7C7C7; + border-radius: 3px; + height: 36px; + width: 100%; + display: inline-block; + vertical-align: middle; + -webkit-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); + transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); + padding: 0px 5px; + font-family: "montserrat", sans-serif; + margin-top: 10px; + margin-bottom: 5px; +} + +.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul li input { + background: #fff; + border: 2px solid #c7c7c7; + border-radius: 3px; + height: 36px; + width: 100%; + display: inline-block; + vertical-align: middle; + -webkit-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); + transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); + padding: 0px 5px; + font-family: "montserrat", sans-serif; + margin-top: 10px; + margin-bottom: 5px; +} + +.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul .filter-condition-dropdown-string { + display: none; +} + +.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul .filter-condition-dropdown-number { + display: none; +} + +.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul .filter-condition-dropdown-datetime { + display: none; +} + +.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul .filter-condition-dropdown-boolean { + display: none; +} + +.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul .filter-response-string { + display: none; +} + +.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul .filter-response-boolean { + display: none; +} + +.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul .filter-response-datetime { + display: none; +} + +.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul .filter-response-number { + display: none; +} + +.grid-container .filter-wrapper .filter-row-two { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + margin-top: 6px; + margin-bottom: 6px; +} + +.grid-container .filter-wrapper .filter-row-two .filter-one { + margin-right: 10px; +} + +.grid-container .filter-wrapper .filter-row-two .filter-one .filter-name { + margin-right: 5px; +} + +.grid-container .filter-wrapper .filter-row-two .filter-one .filter-value { + display: -webkit-inline-box; + display: -ms-inline-flexbox; + display: inline-flex; + background: #e7e7e7; + padding-left: 5px; + color: #000311; + vertical-align: middle; +} + +.grid-container .filter-wrapper .filter-row-two .filter-one .filter-value .f-value { + margin: auto; +} + +.grid-container .filter-wrapper .filter-row-two .filter-one .filter-value .cross-icon { + margin: 5px; + height: 18px !important; + width: 18px !important; + cursor: pointer; +} + +.grid-container .table thead .mass-action-wrapper { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + -webkit-box-pack: start; + -ms-flex-pack: start; + justify-content: flex-start; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.grid-container .table thead .mass-action-wrapper .massaction-remove { + margin-top: 4px; + margin-right: 10px; +} + +.grid-container .table thead .mass-action-wrapper .selected-items { + margin-right: 15px; +} + +.grid-container .table thead tr th.grid_head .sort-down-icon, .grid-container .table thead tr th.grid_head .sort-up-icon { + margin-left: 5px; + margin-top: -3px; + vertical-align: middle; +} + +.grid-container .table thead tr th.grid_head.sortable { + cursor: pointer; +} + +.grid-container .table thead tr th { + text-transform: capitalize; +} + +.grid-container .table tbody td.action a:first-child { + margin-right: 10px; +} + +.grid-container .table .pagination { + margin-top: 20px; +} + +/* DataGrid css ends in here */ +@-webkit-keyframes jelly { + 0% { + -webkit-transform: translateY(0px) scale(0.7); + transform: translateY(0px) scale(0.7); + opacity: 0; + } + 70% { + -webkit-transform: translateY(5px) scale(1.05); + transform: translateY(5px) scale(1.05); + opacity: 1; + } + 100% { + -webkit-transform: translateY(0px) scale(1); + transform: translateY(0px) scale(1); + opacity: 1; + } +} +@keyframes jelly { + 0% { + -webkit-transform: translateY(0px) scale(0.7); + transform: translateY(0px) scale(0.7); + opacity: 0; + } + 70% { + -webkit-transform: translateY(5px) scale(1.05); + transform: translateY(5px) scale(1.05); + opacity: 1; + } + 100% { + -webkit-transform: translateY(0px) scale(1); + transform: translateY(0px) scale(1); + opacity: 1; + } +} + +@-webkit-keyframes jelly-out { + 0% { + -webkit-transform: translateY(0px) scale(1); + transform: translateY(0px) scale(1); + opacity: 1; + } + 30% { + -webkit-transform: translateY(-5px) scale(1.05); + transform: translateY(-5px) scale(1.05); + opacity: 1; + } + 100% { + -webkit-transform: translateY(0px) scale(0.7); + transform: translateY(0px) scale(0.7); + opacity: 0; + } +} + +@keyframes jelly-out { + 0% { + -webkit-transform: translateY(0px) scale(1); + transform: translateY(0px) scale(1); + opacity: 1; + } + 30% { + -webkit-transform: translateY(-5px) scale(1.05); + transform: translateY(-5px) scale(1.05); + opacity: 1; + } + 100% { + -webkit-transform: translateY(0px) scale(0.7); + transform: translateY(0px) scale(0.7); + opacity: 0; + } +} + +* { + -webkit-box-sizing: border-box; + box-sizing: border-box; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +*:focus { + outline: none; +} + +a:link, +a:hover, +a:visited, +a:focus, +a:active { + text-decoration: none; + color: #0041FF; +} + +textarea { + resize: none; +} + +ul { + margin: 0; + padding: 0; + list-style: none; +} + +h1 { + font-size: 28px; + color: #3a3a3a; + margin-top: 0; +} + +h2 { + font-size: 18px; + color: #3a3a3a; +} + +.tooltip { + position: relative; + border-bottom: 1px solid black; +} + +.tooltip .tooltiptext { + visibility: hidden; + width: 120px; + background-color: black; + color: #fff; + text-align: center; + border-radius: 6px; + padding: 5px 0; + /* Position the tooltip */ + position: absolute; + z-index: 1; +} + +.tooltip:hover .tooltiptext { + visibility: visible; +} + +.hide { + display: none !important; +} + +.btn { + -webkit-box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.2), 0 0 8px 0 rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.2), 0 0 8px 0 rgba(0, 0, 0, 0.1); + border-radius: 3px; + border: none; + color: #fff; + cursor: pointer; + -webkit-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); + transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); + font: inherit; + display: inline-block; +} + +.btn:hover, .btn:active, .btn:focus { + opacity: 0.75; + border: none; +} + +.btn.btn-sm { + padding: 6px 12px; +} + +.btn.btn-md { + padding: 8px 16px; +} + +.btn.btn-lg { + padding: 10px 20px; +} + +.btn.btn-xl { + padding: 12px 24px; + font-size: 16px; +} + +.btn.btn-primary { + background: #0041FF; + color: #ffffff; +} + +.btn.btn-black { + background: #000; + color: #ffffff; +} + +.btn:disabled, .btn[disabled="disabled"], .btn[disabled="disabled"]:hover, .btn[disabled="disabled"]:active { + cursor: not-allowed; + background: #b1b1ae; + -webkit-box-shadow: none; + box-shadow: none; + opacity: 1; +} + +.dropdown-open { + position: relative; +} + +.dropdown-list { + width: 200px; + margin-bottom: 20px; + -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.16), 0 0 9px 0 rgba(0, 0, 0, 0.16); + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.16), 0 0 9px 0 rgba(0, 0, 0, 0.16); + border-radius: 3px; + background-color: #ffffff; + position: absolute; + display: none; + z-index: 10; + text-align: left; +} + +.dropdown-list.bottom-left { + top: 42px; + left: 0px; +} + +.dropdown-list.bottom-right { + top: 42px; + right: 0px; +} + +.dropdown-list.top-left { + bottom: 42px; + left: 0px; +} + +.dropdown-list.top-right { + bottom: 42px; + right: 0px; +} + +.dropdown-list .search-box { + padding: 20px; + border-bottom: 1px solid rgba(162, 162, 162, 0.2); +} + +.dropdown-list .search-box .control { + background: #fff; + border: 2px solid #C7C7C7; + border-radius: 3px; + width: 100%; + height: 36px; + display: inline-block; + vertical-align: middle; + -webkit-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); + transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); + padding: 0px 10px; + font-size: 15px; +} + +.dropdown-list .search-box .control:focus { + border-color: #0041FF; +} + +.dropdown-list .dropdown-container { + padding: 20px; + overflow-y: auto; + max-height: 280px; +} + +.dropdown-list .dropdown-container label { + font-size: 15px; + display: inline-block; + text-transform: uppercase; + color: #9e9e9e; + font-weight: 700; + padding-bottom: 5px; +} + +.dropdown-list .dropdown-container ul { + margin: 0px; + list-style-type: none; + padding: 0px; +} + +.dropdown-list .dropdown-container ul li { + padding: 5px 0px; +} + +.dropdown-list .dropdown-container ul li a:link, +.dropdown-list .dropdown-container ul li a:active, +.dropdown-list .dropdown-container ul li a:visited, +.dropdown-list .dropdown-container ul li a:focus { + color: #333333; + display: block; +} + +.dropdown-list .dropdown-container ul li a:hover { + color: #0041FF; +} + +.dropdown-list .dropdown-container ul li .checkbox { + margin: 0; +} + +.dropdown-list .dropdown-container ul li .control-group label { + color: #3a3a3a; + font-size: 15px; + font-weight: 500; + text-transform: capitalize; + width: 100%; +} + +.dropdown-list .dropdown-container .btn { + width: 100%; + margin-top: 10px; +} + +.table { + width: 100%; + overflow-x: auto; +} + +.table table { + width: 100%; + border-collapse: collapse; + text-align: left; +} + +.table table thead th { + font-weight: 700; + padding: 12px 10px; + background: #f8f9fa; + color: #3a3a3a; +} + +.table table tbody td { + padding: 10px; + border-bottom: solid 1px #d3d3d3; + color: #3a3a3a; + vertical-align: top; +} + +.table table tbody td.actions { + text-align: right; +} + +.table table tbody td.actions .icon { + cursor: pointer; + vertical-align: middle; +} + +.table table tbody td.empty { + text-align: center; +} + +.table table tbody tr:last-child td { + border-bottom: none; +} + +.table .control-group { + width: 100%; + margin-bottom: 0; +} + +.table .control-group .control { + width: 100%; + margin: 0; +} + +.dropdown-btn { + min-width: 150px; + text-align: left; + background: #ffffff; + border: 2px solid #C7C7C7; + border-radius: 3px; + font-size: 14px; + padding: 8px 35px 8px 10px; + cursor: pointer; + position: relative; +} + +.dropdown-btn:hover, .dropdown-btn:active, .dropdown-btn:focus { + opacity: 0.75; + border: 2px solid #C7C7C7; +} + +.dropdown-btn .icon { + position: absolute; + right: 10px; + top: 50%; + margin-top: -4px; +} + +.pagination .page-item { + background: #ffffff; + border: 2px solid #C7C7C7; + border-radius: 3px; + padding: 7px 14px; + margin-right: 5px; + font-size: 16px; + display: inline-block; + color: #8e8e8e; + vertical-align: middle; + text-decoration: none; +} + +.pagination .page-item.previous, .pagination .page-item.next { + padding: 6px 9px; +} + +.pagination .page-item.active { + background: #0041ff; + color: #fff; + border-color: #0041ff; +} + +.pagination .page-item .icon { + vertical-align: middle; + margin-bottom: 3px; +} + +.checkbox { + position: relative; + display: block; +} + +.checkbox input { + left: 0; + opacity: 0; + position: absolute; + top: 0; + height: 24px; + width: 24px; + z-index: 100; +} + +.checkbox .checkbox-view { + background-image: url("../images/Checkbox.svg"); + height: 24px; + width: 24px; + margin: 0; + display: inline-block !important; + vertical-align: middle; + margin-right: 5px; +} + +.checkbox input:checked + .checkbox-view { + background-image: url("../images/Checkbox-Checked.svg"); +} + +.checkbox input:disabled + .checkbox-view { + opacity: 0.5; + cursor: not-allowed; +} + +.radio { + position: relative; + display: block; + margin: 10px 5px 5px 0px; +} + +.radio input { + left: 0; + opacity: 0; + position: absolute; + top: 0; + z-index: 100; +} + +.radio .radio-view { + background-image: url("../images/controls.svg"); + background-position: -21px 0px; + height: 20px; + width: 20px; + margin: 0; + display: inline-block !important; + vertical-align: middle; + margin-right: 5px; +} + +.radio input:checked + .radio-view { + background-position: -21px -21px; +} + +.radio input:disabled + .radio-view { + opacity: 0.5; + cursor: not-allowed; +} + +.control-group { + display: block; + margin-bottom: 25px; + font-size: 15px; + color: #333333; + width: 750px; + max-width: 100%; + position: relative; +} + +.control-group label { + display: block; + color: #3a3a3a; +} + +.control-group label.required::after { + content: "*"; + color: #FC6868; + font-weight: 700; + display: inline-block; +} + +.control-group textarea.control { + height: 100px; + padding: 10px; +} + +.control-group .control { + background: #fff; + border: 2px solid #C7C7C7; + border-radius: 3px; + width: 70%; + height: 36px; + display: inline-block; + vertical-align: middle; + -webkit-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); + transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); + padding: 0px 10px; + font-size: 15px; + margin-top: 10px; + margin-bottom: 5px; +} + +.control-group .control:focus { + border-color: #0041FF; +} + +.control-group .control[disabled="disabled"] { + border-color: #d3d3d3; + background-color: #d3d3d3; + cursor: not-allowed; +} + +.control-group .control[multiple] { + height: 100px; +} + +.control-group.date::after, .control-group.datetime::after { + background-image: url("../images/Icon-Calendar.svg"); + width: 24px; + height: 24px; + content: ''; + display: inline-block; + vertical-align: middle; + margin-left: -34px; + margin-top: 2px; + pointer-events: none; +} + +.control-group .control-info { + display: block; + font-style: italic; + color: #6f6f6f; +} + +.control-group .control-error { + display: none; + color: #ff5656; + margin-top: 5px; +} + +.control-group.has-error .control { + border-color: #FC6868; +} + +.control-group.has-error .control-error { + display: block; +} + +.control-group.price .currency-code { + vertical-align: middle; + display: inline-block; +} + +.button-group { + margin-top: 20px; + margin-bottom: 20px; +} + +.alert-wrapper { + width: 300px; + top: 10px; + right: 10px; + position: fixed; + z-index: 6; + text-align: left; +} + +.alert-wrapper .alert { + width: 300px; + padding: 15px; + border-radius: 3px; + display: inline-block; + -webkit-box-shadow: 0px 4px 15.36px 0.64px rgba(0, 0, 0, 0.1), 0px 2px 6px 0px rgba(0, 0, 0, 0.12); + box-shadow: 0px 4px 15.36px 0.64px rgba(0, 0, 0, 0.1), 0px 2px 6px 0px rgba(0, 0, 0, 0.12); + position: relative; + -webkit-animation: jelly 0.5s ease-in-out; + animation: jelly 0.5s ease-in-out; + -webkit-transform-origin: center top; + transform-origin: center top; + z-index: 500; + margin-bottom: 10px; +} + +.alert-wrapper .alert.alert-error { + background: #FC6868; +} + +.alert-wrapper .alert.alert-info { + background: #204d74; +} + +.alert-wrapper .alert.alert-success { + background: #4CAF50; +} + +.alert-wrapper .alert.alert-warning { + background: #FFC107; +} + +.alert-wrapper .alert .icon { + position: absolute; + right: 10px; + top: 10px; + cursor: pointer; +} + +.alert-wrapper .alert p { + color: #ffffff; + margin: 0px; + padding: 0px; + font-size: 15px; +} + +.tabs ul { + border-bottom: solid 1px rgba(162, 162, 162, 0.2); +} + +.tabs ul li { + display: inline-block; +} + +.tabs ul li a { + padding: 15px 20px; + cursor: pointer; + margin: 0px 2px; + text-align: center; + color: #000311; + display: block; +} + +.tabs ul li.active a { + border-bottom: 3px solid #0041FF; +} + +.accordian, accordian { + display: inline-block; + width: 100%; +} + +.accordian .accordian-header, .accordian div[slot*="header"], accordian .accordian-header, accordian div[slot*="header"] { + width: 100%; + display: inline-block; + font-size: 18px; + color: #3a3a3a; + border-bottom: solid 1px rgba(162, 162, 162, 0.2); + padding: 20px 15px; + cursor: pointer; +} + +.accordian .accordian-header .expand-icon, .accordian div[slot*="header"] .expand-icon, accordian .accordian-header .expand-icon, accordian div[slot*="header"] .expand-icon { + background-image: url("../images/Expand-Light.svg"); + margin-right: 10px; + margin-top: 3px; +} + +.accordian .accordian-header h1, .accordian div[slot*="header"] h1, accordian .accordian-header h1, accordian div[slot*="header"] h1 { + margin: 0; + font-size: 20px; + display: inline-block; +} + +.accordian .accordian-header .icon, .accordian div[slot*="header"] .icon, accordian .accordian-header .icon, accordian div[slot*="header"] .icon { + float: right; +} + +.accordian .accordian-header .icon.left, .accordian div[slot*="header"] .icon.left, accordian .accordian-header .icon.left, accordian div[slot*="header"] .icon.left { + float: left; +} + +.accordian .accordian-content, .accordian div[slot*="body"], accordian .accordian-content, accordian div[slot*="body"] { + width: 100%; + padding: 20px 15px; + display: none; + -webkit-transition: 0.3s ease all; + transition: 0.3s ease all; +} + +.accordian.active > .accordian-content, accordian.active > .accordian-content { + display: inline-block; +} + +.accordian.active > .accordian-header .expand-icon, accordian.active > .accordian-header .expand-icon { + background-image: url("../images/Expand-Light-On.svg"); +} + +.tree-container .tree-item { + padding-left: 30px; + display: inline-block; + margin-top: 10px; + width: 100%; +} + +.tree-container .tree-item > .tree-item { + display: none; +} + +.tree-container .tree-item.active > .tree-item { + display: inline-block; +} + +.tree-container .tree-item .checkbox { + margin: 0; + display: inline-block; +} + +.tree-container .tree-item .radio { + margin: 0; + display: inline-block; +} + +.tree-container .tree-item .expand-icon { + display: inline-block; + margin-right: 10px; + cursor: pointer; + background-image: url("../images/Expand-Light.svg"); + width: 18px; + height: 18px; + vertical-align: middle; +} + +.tree-container .tree-item .folder-icon { + vertical-align: middle; + margin-right: 10px; +} + +.tree-container .tree-item.active > .expand-icon { + background-image: url("../images/Expand-Light-On.svg"); +} + +.tree-container > .tree-item { + padding-left: 0; +} + +.panel { + -webkit-box-shadow: 0 2px 25px 0 rgba(0, 0, 0, 0.15); + box-shadow: 0 2px 25px 0 rgba(0, 0, 0, 0.15); + border-radius: 5px; + background: #fff; +} + +.panel .panel-content { + padding: 20px; +} + +modal { + display: none; +} + +.modal-open { + overflow: hidden; +} + +.modal-overlay { + display: none; + overflow-y: auto; + z-index: 10; + top: 0px; + right: 0px; + bottom: 0px; + left: 0px; + position: fixed; + background: #000; + opacity: 0.75; +} + +.modal-open .modal-overlay { + display: block; +} + +.modal-container { + -webkit-animation: fade-in-white 0.3s ease-in-out; + animation: fade-in-white 0.3s ease-in-out; + z-index: 11; + margin-left: -350px; + width: 600px; + max-width: 80%; + background: #ffffff; + position: fixed; + left: 50%; + top: 100px; + margin-bottom: 100px; + -webkit-box-shadow: 0px 15px 25px 0px rgba(0, 0, 0, 0.03), 0px 20px 45px 5px rgba(0, 0, 0, 0.2); + box-shadow: 0px 15px 25px 0px rgba(0, 0, 0, 0.03), 0px 20px 45px 5px rgba(0, 0, 0, 0.2); + -webkit-animation: jelly 0.5s ease-in-out; + animation: jelly 0.5s ease-in-out; + border-radius: 5px; +} + +.modal-container .modal-header { + padding: 20px; +} + +.modal-container .modal-header h3 { + display: inline-block; + font-size: 20px; + color: #3a3a3a; + margin: 0; +} + +.modal-container .modal-header .icon { + float: right; + cursor: pointer; +} + +.modal-container .modal-body { + padding: 20px; +} + +.modal-container .modal-body .control-group .control { + width: 100%; +} + +.label { + background: #E7E7E7; + border-radius: 2px; + padding: 8px; + color: #000311; + display: inline-block; +} + +.label.label-sm { + padding: 5px; +} + +.label.label-md { + padding: 8px; +} + +.label.label-lg { + padding: 11px; +} + +.label.label-xl { + padding: 14px; +} + +.badge { + border-radius: 50px; + color: white; + padding: 8px; + white-space: nowrap; +} + +.badge.badge-sm { + padding: 5px; +} + +.badge.badge-md { + padding: 3px 10px; +} + +.badge.badge-lg { + padding: 11px; +} + +.badge.badge-xl { + padding: 14px; +} + +.badge.badge-success { + background-color: #4CAF50; +} + +.badge.badge-info { + background-color: #0041FF; +} + +.badge.badge-danger { + background-color: #FC6868; +} + +.badge.badge-warning { + background-color: #FFC107; +} + +.image-wrapper { + margin-bottom: 20px; + margin-top: 10px; + display: inline-block; + width: 100%; +} + +.image-wrapper .image-item { + width: 200px; + height: 200px; + margin-right: 20px; + background: #F8F9FA; + border-radius: 3px; + display: inline-block; + position: relative; + background-image: url("../images/placeholder-icon.svg"); + background-repeat: no-repeat; + background-position: center; + margin-bottom: 20px; +} + +.image-wrapper .image-item img.preview { + width: 100%; + height: 100%; +} + +.image-wrapper .image-item input { + display: none; +} + +.image-wrapper .image-item .remove-image { + background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.08)), to(rgba(0, 0, 0, 0.24))); + background-image: linear-gradient(-180deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.24) 100%); + border-radius: 0 0 4px 4px; + position: absolute; + bottom: 0; + width: 100%; + padding: 10px; + text-align: center; + color: #fff; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.24); + margin-right: 20px; + cursor: pointer; +} + +.image-wrapper .image-item:hover .remove-image { + display: block; +} + +.image-wrapper .image-item.has-image { + background-image: none; +} + +.cp-spinner { + width: 48px; + height: 48px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +.cp-round:before { + border-radius: 50%; + content: " "; + width: 48px; + height: 48px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + border-top: solid 6px #bababa; + border-right: solid 6px #bababa; + border-bottom: solid 6px #bababa; + border-left: solid 6px #bababa; + position: absolute; + top: 0; + left: 0; +} + +.cp-round:after { + border-radius: 50%; + content: " "; + width: 48px; + height: 48px; + display: inline-block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + border-top: solid 6px #0041FF; + border-right: solid 6px transparent; + border-bottom: solid 6px transparent; + border-left: solid 6px transparent; + position: absolute; + top: 0; + left: 0; + -webkit-animation: spin 1s ease-in-out infinite; + animation: spin 1s ease-in-out infinite; +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@keyframes spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} diff --git a/packages/Webkul/Ui/publishable/assets/images/Icon-star.svg b/packages/Webkul/Ui/publishable/assets/images/Icon-star.svg new file mode 100644 index 000000000..441bc282d --- /dev/null +++ b/packages/Webkul/Ui/publishable/assets/images/Icon-star.svg @@ -0,0 +1,10 @@ + + + + Icon-star + Created with Sketch. + + + + + \ No newline at end of file diff --git a/packages/Webkul/Ui/publishable/assets/js/ui.js b/packages/Webkul/Ui/publishable/assets/js/ui.js index d522d3ea5..606535f9d 100644 --- a/packages/Webkul/Ui/publishable/assets/js/ui.js +++ b/packages/Webkul/Ui/publishable/assets/js/ui.js @@ -1 +1,5980 @@ -!function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=0)}({"+wdr":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={data:function(){return{sample:"",image_file:"",file:null,newImage:""}},mounted:function(){this.sample="";var e=this.$el.getElementsByTagName("input")[0],t=this;e.onchange=function(){var n=new FileReader;n.readAsDataURL(e.files[0]),n.onload=function(e){this.img=document.getElementsByTagName("input")[0],this.img.src=e.target.result,t.newImage=this.img.src,t.changePreview()}}},methods:{removePreviewImage:function(){this.sample=""},changePreview:function(){this.sample=this.newImage}},computed:{getInputImage:function(){console.log(this.imageData)}}}},0:function(e,t,n){n("J66Q"),n("Oy72"),e.exports=n("MT9B")},"13ON":function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticClass:"tabs"},[n("ul",e._l(e.tabs,function(t){return n("li",{class:{active:t.isActive},on:{click:function(n){e.selectTab(t)}}},[n("a",[e._v(e._s(t.name))])])}))]),e._v(" "),n("div",{staticClass:"tabs-content"},[e._t("default")],2)])},staticRenderFns:[]}},"2JMG":function(e,t,n){var i=n("VU/8")(n("G3lE"),null,!1,null,null,null);e.exports=i.exports},"31/P":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default={name:"tree-view",inheritAttrs:!1,props:{inputType:String,nameField:String,idField:String,captionField:String,childrenField:String,valueField:String,items:{type:[Array,String,Object],required:!1,default:null},value:{type:Array,required:!1,default:null},behavior:{type:String,required:!1,default:"reactive"},savedValues:{type:Array,required:!1,default:null}},created:function(){-1!==this.savedValues.indexOf(this.items[this.valueField])&&this.value.push(this.items)},computed:{caption:function(){return this.items[this.captionField]},allChildren:function(){var e=this,t=[];return function n(a){if(a[e.childrenField]&&e.getLength(a[e.childrenField])>0)if("object"==i(a[e.childrenField]))for(var r in a[e.childrenField])n(a[e.childrenField][r]);else a[e.childrenField].forEach(function(e){return n(e)});else t.push(a)}(this.items),t},hasChildren:function(){return!!this.items[this.childrenField]&&this.getLength(this.items[this.childrenField])>0},hasSelection:function(){return!!this.value&&this.value.length>0},isAllChildrenSelected:function(){var e=this;return this.hasChildren&&this.hasSelection&&this.allChildren.every(function(t){return e.value.some(function(n){return n[e.idField]===t[e.idField]})})},isSomeChildrenSelected:function(){var e=this;return this.hasChildren&&this.hasSelection&&this.allChildren.some(function(t){return e.value.some(function(n){return n[e.idField]===t[e.idField]})})}},methods:{getLength:function(e){if("object"==(void 0===e?"undefined":i(e))){var t=0;for(var n in e)t++;return t}return e.length},generateRoot:function(){var e=this;return"checkbox"==this.inputType?"reactive"==this.behavior?this.$createElement("tree-checkbox",{props:{id:this.items[this.idField],label:this.caption,nameField:this.nameField,modelValue:this.items[this.valueField],inputValue:this.hasChildren?this.isSomeChildrenSelected:this.value,value:this.hasChildren?this.isAllChildrenSelected:this.items},on:{change:function(t){e.hasChildren?(e.isAllChildrenSelected?e.allChildren.forEach(function(t){var n=e.value.indexOf(t);e.value.splice(n,1)}):e.allChildren.forEach(function(t){var n=!1;e.value.forEach(function(e){e.key==t.key&&(n=!0)}),n||e.value.push(t)}),e.$emit("input",e.value)):e.$emit("input",t)}}}):this.$createElement("tree-checkbox",{props:{id:this.items[this.idField],label:this.caption,nameField:this.nameField,modelValue:this.items[this.valueField],inputValue:this.value,value:this.items}}):"radio"==this.inputType?this.$createElement("tree-radio",{props:{id:this.items[this.idField],label:this.caption,nameField:this.nameField,modelValue:this.items[this.valueField],value:this.savedValues}}):void 0},generateChild:function(e){var t=this;return this.$createElement("tree-item",{on:{input:function(e){t.$emit("input",e)}},props:{items:e,value:this.value,savedValues:this.savedValues,nameField:this.nameField,inputType:this.inputType,captionField:this.captionField,childrenField:this.childrenField,valueField:this.valueField,idField:this.idField,behavior:this.behavior}})},generateChildren:function(){var e=this,t=[];if(this.items[this.childrenField])if("object"==i(this.items[this.childrenField]))for(var n in this.items[this.childrenField])t.push(this.generateChild(this.items[this.childrenField][n]));else this.items[this.childrenField].forEach(function(n){t.push(e.generateChild(n))});return t},generateIcon:function(){var e=this;return this.$createElement("i",{class:["expand-icon"],on:{click:function(t){e.$el.classList.toggle("active")}}})},generateFolderIcon:function(){return this.$createElement("i",{class:["icon","folder-icon"]})}},render:function(e){return e("div",{class:["tree-item","active",this.hasChildren?"has-children":""]},[this.generateIcon(),this.generateFolderIcon(),this.generateRoot()].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0},attrs:{for:e._uid}},[n("input",{attrs:{type:"hidden",name:e.finalInputName}}),e._v(" "),n("input",{directives:[{name:"validate",rawName:"v-validate",value:"mimes:image/*",expression:"'mimes:image/*'"}],ref:"imageInput",attrs:{type:"file",accept:"image/*",name:e.finalInputName,id:e._uid},on:{change:function(t){e.addImageView(t)}}}),e._v(" "),e.imageData.length>0?n("img",{staticClass:"preview",attrs:{src:e.imageData}}):e._e(),e._v(" "),n("label",{staticClass:"remove-image",on:{click:function(t){e.removeImage()}}},[e._v(e._s(e.removeButtonLabel))])])},staticRenderFns:[]}},"44Sb":function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",{staticClass:"radio"},[n("input",{attrs:{type:"radio",id:e.id,name:e.nameField},domProps:{value:e.modelValue,checked:e.isActive}}),e._v(" "),n("label",{staticClass:"radio-view",attrs:{for:e.id}}),e._v(" "),n("span",{attrs:{for:e.id}},[e._v(e._s(e.label))])])},staticRenderFns:[]}},"6wXy":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:{title:String,id:String,className:String,active:Boolean},inject:["$validator"],data:function(){return{isActive:!1,imageData:""}},mounted:function(){this.isActive=this.active},methods:{toggleAccordion:function(){this.isActive=!this.isActive}},computed:{iconClass:function(){return{"accordian-down-icon":!this.isActive,"accordian-up-icon":this.isActive}}}}},"7aQn":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"tree-view",inheritAttrs:!1,props:{inputType:{type:String,required:!1,default:"checkbox"},nameField:{type:String,required:!1,default:"permissions"},idField:{type:String,required:!1,default:"id"},valueField:{type:String,required:!1,default:"value"},captionField:{type:String,required:!1,default:"name"},childrenField:{type:String,required:!1,default:"children"},items:{type:[Array,String,Object],required:!1,default:function(){return[]}},behavior:{type:String,required:!1,default:"reactive"},value:{type:[Array,String,Object],required:!1,default:function(){return[]}}},data:function(){return{finalValues:[]}},computed:{savedValues:function(){return this.value?"radio"==this.inputType?[this.value]:"string"==typeof this.value?JSON.parse(this.value):this.value:[]}},methods:{generateChildren:function(){var e=[],t="string"==typeof this.items?JSON.parse(this.items):this.items;for(var n in t)e.push(this.generateTreeItem(t[n]));return e},generateTreeItem:function(e){var t=this;return this.$createElement("tree-item",{props:{items:e,value:this.finalValues,savedValues:this.savedValues,nameField:this.nameField,inputType:this.inputType,captionField:this.captionField,childrenField:this.childrenField,valueField:this.valueField,idField:this.idField,behavior:this.behavior},on:{input:function(e){t.finalValues=e}}})}},render:function(e){return e("div",{class:["tree-container"]},[this.generateChildren()])}}},"7z1m":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={data:function(){return{uid:1,flashes:[]}},methods:{addFlash:function(e){e.uid=this.uid++,this.flashes.push(e)},removeFlash:function(e){var t=this.flashes.indexOf(e);this.flashes.splice(t,1)}}}},"8skS":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:{inputName:{type:String,required:!1,default:"attachments"},removeButtonLabel:{type:String},image:{type:Object,required:!1,default:null}},data:function(){return{imageData:""}},mounted:function(){this.image.id&&this.image.url&&(this.imageData=this.image.url)},computed:{finalInputName:function(){return this.inputName+"["+this.image.id+"]"}},methods:{addImageView:function(){var e=this,t=this.$refs.imageInput;if(t.files&&t.files[0])if(t.files[0].type.includes("image/")){var n=new FileReader;n.onload=function(t){e.imageData=t.target.result},n.readAsDataURL(t.files[0])}else t.value="",alert("Only images (.jpeg, .jpg, .png, ..) are allowed.")},removeImage:function(){this.$emit("onRemoveImage",this.image)}}}},"9yns":function(e,t,n){var i=n("VU/8")(n("EsN/"),n("wq5e"),!1,null,null,null);e.exports=i.exports},AOOz:function(e,t){e.exports={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"alert",class:this.flash.type},[t("span",{staticClass:"icon white-cross-sm-icon",on:{click:this.remove}}),this._v(" "),t("p",[this._v(this._s(this.flash.message))])])},staticRenderFns:[]}},C2Px:function(e,t,n){var i=n("VU/8")(n("G8Iw"),n("rsIj"),!1,null,null,null);e.exports=i.exports},EZgW:function(e,t,n){var i=n("VU/8")(n("+wdr"),n("fXJ7"),!1,function(e){n("KJcg")},null,null);e.exports=i.exports},"EsN/":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n("GxBP"),a=n.n(i);t.default={props:{name:String,value:String},data:function(){return{datepicker:null}},mounted:function(){var e=this,t=this.$el.getElementsByTagName("input")[0];this.datepicker=new a.a(t,{allowInput:!0,altFormat:"Y-m-d H:i:s",dateFormat:"Y-m-d H:i:s",enableTime:!0,onChange:function(t,n,i){e.$emit("onChange",n)}})}}},"FZ+f":function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var a=(o=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),r=i.sources.map(function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"});return[n].concat(r).concat([a]).join("\n")}var o;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var i={},a=0;a11)]},M:function(e,t){return r(e.getMonth(),!0,t)},S:function(t){return e(t.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return e.getFullYear()},d:function(t){return e(t.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(t){return e(t.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(t){return e(t.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},c={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year"},d=function(e){var t=e.config,n=void 0===t?g:t,i=e.l10n,a=void 0===i?c:i;return function(e,t,i){var r=i||a;return void 0!==n.formatDate?n.formatDate(e,t,r):t.split("").map(function(t,i,a){return s[t]&&"\\"!==a[i-1]?s[t](e,r,n):"\\"!==t?t:""}).join("")}},u=function(e){var t=e.config,n=void 0===t?g:t,i=e.l10n,a=void 0===i?c:i;return function(e,t,i,r){if(0===e||e){var s,c=r||a,d=e;if(e instanceof Date)s=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)s=new Date(e);else if("string"==typeof e){var u=t||(n||g).dateFormat,f=String(e).trim();if("today"===f)s=new Date,i=!0;else if(/Z$/.test(f)||/GMT$/.test(f))s=new Date(e);else if(n&&n.parseDate)s=n.parseDate(e,u);else{s=n&&n.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0);for(var p,h=[],m=0,v=0,b="";mMath.min(t,n)&&e",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1};function v(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function b(e,t,n){var i=window.document.createElement(e);return t=t||"",n=n||"",i.className=t,void 0!==n&&(i.textContent=n),i}function y(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function w(e,t){var n=b("div","numInputWrapper"),i=b("input","numInput "+e),a=b("span","arrowUp"),r=b("span","arrowDown");if(i.type="text",i.pattern="\\d*",void 0!==t)for(var o in t)i.setAttribute(o,t[o]);return n.appendChild(i),n.appendChild(a),n.appendChild(r),n}"function"!=typeof Object.assign&&(Object.assign=function(e){if(!e)throw TypeError("Cannot convert undefined or null to object");for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;io&&(u=a===s.hourElement?u-o-t(!s.amPM):r,p&&N(void 0,1,s.hourElement)),s.amPM&&f&&(1===l?u+c===23:Math.abs(u-c)>l)&&(s.amPM.textContent=s.l10n.amPM[t(s.amPM.textContent===s.l10n.amPM[0])]),a.value=e(u)}}(n);var i=s._input.value;M(),me(),s._input.value!==i&&s._debouncedChange()}}function M(){if(void 0!==s.hourElement&&void 0!==s.minuteElement){var e,n,i=(parseInt(s.hourElement.value.slice(-2),10)||0)%24,a=(parseInt(s.minuteElement.value,10)||0)%60,r=void 0!==s.secondElement?(parseInt(s.secondElement.value,10)||0)%60:0;void 0!==s.amPM&&(e=i,n=s.amPM.textContent,i=e%12+12*t(n===s.l10n.amPM[1]));var o=void 0!==s.config.minTime||s.config.minDate&&s.minDateHasTime&&s.latestSelectedDateObj&&0===f(s.latestSelectedDateObj,s.config.minDate,!0);if(void 0!==s.config.maxTime||s.config.maxDate&&s.maxDateHasTime&&s.latestSelectedDateObj&&0===f(s.latestSelectedDateObj,s.config.maxDate,!0)){var l=void 0!==s.config.maxTime?s.config.maxTime:s.config.maxDate;(i=Math.min(i,l.getHours()))===l.getHours()&&(a=Math.min(a,l.getMinutes())),a===l.getMinutes()&&(r=Math.min(r,l.getSeconds()))}if(o){var c=void 0!==s.config.minTime?s.config.minTime:s.config.minDate;(i=Math.max(i,c.getHours()))===c.getHours()&&(a=Math.max(a,c.getMinutes())),a===c.getMinutes()&&(r=Math.max(r,c.getSeconds()))}T(i,a,r)}}function _(e){var t=e||s.latestSelectedDateObj;t&&T(t.getHours(),t.getMinutes(),t.getSeconds())}function E(){var e=s.config.defaultHour,t=s.config.defaultMinute,n=s.config.defaultSeconds;if(void 0!==s.config.minDate){var i=s.config.minDate.getHours(),a=s.config.minDate.getMinutes();(e=Math.max(e,i))===i&&(t=Math.max(a,t)),e===i&&t===a&&(n=s.config.minDate.getSeconds())}if(void 0!==s.config.maxDate){var r=s.config.maxDate.getHours(),o=s.config.maxDate.getMinutes();(e=Math.min(e,r))===r&&(t=Math.min(o,t)),e===r&&t===o&&(n=s.config.maxDate.getSeconds())}T(e,t,n)}function T(n,i,a){void 0!==s.latestSelectedDateObj&&s.latestSelectedDateObj.setHours(n%24,i,a||0,0),s.hourElement&&s.minuteElement&&!s.isMobile&&(s.hourElement.value=e(s.config.time_24hr?n:(12+n)%12+12*t(n%12==0)),s.minuteElement.value=e(i),void 0!==s.amPM&&(s.amPM.textContent=s.l10n.amPM[t(n>=12)]),void 0!==s.secondElement&&(s.secondElement.value=e(a)))}function I(e){var t=parseInt(e.target.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&Z(t)}function F(e,t,n,i){return t instanceof Array?t.forEach(function(t){return F(e,t,n,i)}):e instanceof Array?e.forEach(function(e){return F(e,t,n,i)}):(e.addEventListener(t,n,i),void s._handlers.push({element:e,event:t,handler:n,options:i}))}function S(e){return function(t){1===t.which&&e(t)}}function O(){de("onChange")}function A(e){var t=void 0!==e?s.parseDate(e):s.latestSelectedDateObj||(s.config.minDate&&s.config.minDate>s.now?s.config.minDate:s.config.maxDate&&s.config.maxDate=0&&f(e,s.selectedDates[1])<=0}(t)&&!fe(t)&&r.classList.add("inRange"),s.weekNumbers&&1===s.config.showMonths&&"prevMonthDay"!==e&&n%7==1&&s.weekNumbers.insertAdjacentHTML("beforeend",""+s.config.getWeek(t)+""),de("onDayCreate",r),r}function P(e){e.focus(),"range"===s.config.mode&&Q(e)}function L(e){for(var t=e>0?0:s.config.showMonths-1,n=e>0?s.config.showMonths:-1,i=t;i!=n;i+=e)for(var a=s.daysContainer.children[i],r=e>0?0:a.children.length-1,o=e>0?a.children.length:-1,l=r;l!=o;l+=e){var c=a.children[l];if(-1===c.className.indexOf("hidden")&&K(c.dateObj))return c}}function Y(e,t){var n=G(document.activeElement||document.body),i=void 0!==e?e:n?document.activeElement:void 0!==s.selectedDateElem&&G(s.selectedDateElem)?s.selectedDateElem:void 0!==s.todayDateElem&&G(s.todayDateElem)?s.todayDateElem:L(t>0?1:-1);return void 0===i?s._input.focus():n?void function(e,t){for(var n=-1===e.className.indexOf("Month")?e.dateObj.getMonth():s.currentMonth,i=t>0?s.config.showMonths:-1,a=t>0?1:-1,r=n-s.currentMonth;r!=i;r+=a)for(var o=s.daysContainer.children[r],l=n-s.currentMonth===r?e.$i+t:t<0?o.children.length-1:0,c=o.children.length,d=l;d>=0&&d0?c:-1);d+=a){var u=o.children[d];if(-1===u.className.indexOf("hidden")&&K(u.dateObj)&&Math.abs(e.$i-d)>=Math.abs(t))return P(u)}s.changeMonth(a),Y(L(a),0)}(i,t):P(i)}function V(e,t){for(var n=(new Date(e,t,1).getDay()-s.l10n.firstDayOfWeek+7)%7,i=s.utils.getDaysInMonth((t-1+12)%12),a=s.utils.getDaysInMonth(t),r=window.document.createDocumentFragment(),o=s.config.showMonths>1,l=o?"prevMonthDay hidden":"prevMonthDay",c=o?"nextMonthDay hidden":"nextMonthDay",d=i+1-n,u=0;d<=i;d++,u++)r.appendChild(R(l,new Date(e,t-1,d),d,u));for(d=1;d<=a;d++,u++)r.appendChild(R("",new Date(e,t,d),d,u));for(var f=a+1;f<=42-n&&(1===s.config.showMonths||u%7!=0);f++,u++)r.appendChild(R(c,new Date(e,t+1,f%a),f,u));var p=b("div","dayContainer");return p.appendChild(r),p}function H(){if(void 0!==s.daysContainer){y(s.daysContainer),s.weekNumbers&&y(s.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t0&&e\n "+t.join("")+"\n \n "}function q(e,t){void 0===t&&(t=!0);var n=t?e:e-s.currentMonth;n<0&&!0===s._hidePrevMonthArrow||n>0&&!0===s._hideNextMonthArrow||(s.currentMonth+=n,(s.currentMonth<0||s.currentMonth>11)&&(s.currentYear+=s.currentMonth>11?1:-1,s.currentMonth=(s.currentMonth+12)%12,de("onYearChange")),H(),de("onMonthChange"),pe())}function z(e){return!(!s.config.appendTo||!s.config.appendTo.contains(e))||s.calendarContainer.contains(e)}function J(e){if(s.isOpen&&!s.config.inline){var t=z(e.target),n=e.target===s.input||e.target===s.altInput||s.element.contains(e.target)||e.path&&e.path.indexOf&&(~e.path.indexOf(s.input)||~e.path.indexOf(s.altInput)),i="blur"===e.type?n&&e.relatedTarget&&!z(e.relatedTarget):!n&&!t,a=!s.config.ignoredFocusElements.some(function(t){return t.contains(e.target)});i&&a&&(s.close(),"range"===s.config.mode&&1===s.selectedDates.length&&(s.clear(!1),s.redraw()))}}function Z(e){if(!(!e||s.config.minDate&&es.config.maxDate.getFullYear())){var t=e,n=s.currentYear!==t;s.currentYear=t||s.currentYear,s.config.maxDate&&s.currentYear===s.config.maxDate.getFullYear()?s.currentMonth=Math.min(s.config.maxDate.getMonth(),s.currentMonth):s.config.minDate&&s.currentYear===s.config.minDate.getFullYear()&&(s.currentMonth=Math.max(s.config.minDate.getMonth(),s.currentMonth)),n&&(s.redraw(),de("onYearChange"))}}function K(e,t){void 0===t&&(t=!0);var n=s.parseDate(e,void 0,t);if(s.config.minDate&&n&&f(n,s.config.minDate,void 0!==t?t:!s.minDateHasTime)<0||s.config.maxDate&&n&&f(n,s.config.maxDate,void 0!==t?t:!s.maxDateHasTime)>0)return!1;if(0===s.config.enable.length&&0===s.config.disable.length)return!0;if(void 0===n)return!1;for(var i,a=s.config.enable.length>0,r=a?s.config.enable:s.config.disable,o=0;o=i.from.getTime()&&n.getTime()<=i.to.getTime())return a}return!a}function G(e){return void 0!==s.daysContainer&&(-1===e.className.indexOf("hidden")&&s.daysContainer.contains(e))}function X(e){var t=e.target===s._input,n=s.config.allowInput,i=s.isOpen&&(!n||!t),a=s.config.inline&&t&&!n;if(13===e.keyCode&&t){if(n)return s.setDate(s._input.value,!0,e.target===s.altInput?s.config.altFormat:s.config.dateFormat),e.target.blur();s.open()}else if(z(e.target)||i||a){var r=!!s.timeContainer&&s.timeContainer.contains(e.target);switch(e.keyCode){case 13:r?C():oe(e);break;case 27:e.preventDefault(),re();break;case 8:case 46:t&&!s.config.allowInput&&(e.preventDefault(),s.clear());break;case 37:case 39:if(r)s.hourElement&&s.hourElement.focus();else if(e.preventDefault(),void 0!==s.daysContainer&&(!1===n||G(document.activeElement))){var o=39===e.keyCode?1:-1;e.ctrlKey?(q(o),Y(L(1),0)):Y(void 0,o)}break;case 38:case 40:e.preventDefault();var l=40===e.keyCode?1:-1;s.daysContainer&&void 0!==e.target.$i?e.ctrlKey?(Z(s.currentYear-l),Y(L(1),0)):r||Y(void 0,7*l):s.config.enableTime&&(!r&&s.hourElement&&s.hourElement.focus(),C(e),s._debouncedChange());break;case 9:if(!r){s.element.focus();break}var c=[s.hourElement,s.minuteElement,s.secondElement,s.amPM].filter(function(e){return e}),d=c.indexOf(e.target);if(-1!==d){var u=c[d+(e.shiftKey?-1:1)];void 0!==u?(e.preventDefault(),u.focus()):s.element.focus()}}}if(void 0!==s.amPM&&e.target===s.amPM)switch(e.key){case s.l10n.amPM[0].charAt(0):case s.l10n.amPM[0].charAt(0).toLowerCase():s.amPM.textContent=s.l10n.amPM[0],M(),me();break;case s.l10n.amPM[1].charAt(0):case s.l10n.amPM[1].charAt(0).toLowerCase():s.amPM.textContent=s.l10n.amPM[1],M(),me()}de("onKeyDown",e)}function Q(e){if(1===s.selectedDates.length&&(!e||e.classList.contains("flatpickr-day")&&!e.classList.contains("disabled"))){for(var t=e?e.dateObj.getTime():s.days.firstElementChild.dateObj.getTime(),n=s.parseDate(s.selectedDates[0],void 0,!0).getTime(),i=Math.min(t,s.selectedDates[0].getTime()),a=Math.max(t,s.selectedDates[0].getTime()),r=s.daysContainer.lastChild.lastChild.dateObj.getTime(),o=!1,l=0,c=0,d=i;di&&dl)?l=d:d>n&&(!c||d0&&d0&&d>c;return h?(r.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(e){r.classList.remove(e)}),"continue"):o&&!h?"continue":(["startRange","inRange","endRange","notAllowed"].forEach(function(e){r.classList.remove(e)}),void(void 0!==e&&(e.classList.add(t0&&m&&m.lastChild.dateObj.getTime()>=d||(nt&&d===n&&r.classList.add("endRange"),d>=l&&(0===c||d<=c)&&p(d,n,t)&&r.classList.add("inRange")))))},v=0,b=f.children.length;v0||n.getMinutes()>0||n.getSeconds()>0),s.selectedDates&&(s.selectedDates=s.selectedDates.filter(function(e){return K(e)}),s.selectedDates.length||"min"!==e||_(n),me()),s.daysContainer&&(ae(),void 0!==n?s.currentYearElement[e]=n.getFullYear().toString():s.currentYearElement.removeAttribute(e),s.currentYearElement.disabled=!!i&&void 0!==n&&i.getFullYear()===n.getFullYear())}}function ne(){"object"!=typeof s.config.locale&&void 0===D.l10ns[s.config.locale]&&s.config.errorHandler(new Error("flatpickr: invalid locale "+s.config.locale)),s.l10n=Object.assign({},D.l10ns.default,"object"==typeof s.config.locale?s.config.locale:"default"!==s.config.locale?D.l10ns[s.config.locale]:void 0),l.K="("+s.l10n.amPM[0]+"|"+s.l10n.amPM[1]+"|"+s.l10n.amPM[0].toLowerCase()+"|"+s.l10n.amPM[1].toLowerCase()+")",s.formatDate=d(s),s.parseDate=u({config:s.config,l10n:s.l10n})}function ie(e){if(void 0!==s.calendarContainer){de("onPreCalendarPosition");var t=e||s._positionElement,n=Array.prototype.reduce.call(s.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),i=s.calendarContainer.offsetWidth,a=s.config.position.split(" "),r=a[0],o=a.length>1?a[1]:null,l=t.getBoundingClientRect(),c=window.innerHeight-l.bottom,d="above"===r||"below"!==r&&cn,u=window.pageYOffset+l.top+(d?-n-2:t.offsetHeight+2);if(v(s.calendarContainer,"arrowTop",!d),v(s.calendarContainer,"arrowBottom",d),!s.config.inline){var f=window.pageXOffset+l.left-(null!=o&&"center"===o?(i-l.width)/2:0),p=window.document.body.offsetWidth-l.right,h=f+i>window.document.body.offsetWidth;v(s.calendarContainer,"rightMost",h),s.config.static||(s.calendarContainer.style.top=u+"px",h?(s.calendarContainer.style.left="auto",s.calendarContainer.style.right=p+"px"):(s.calendarContainer.style.left=f+"px",s.calendarContainer.style.right="auto"))}}}function ae(){s.config.noCalendar||s.isMobile||(pe(),H())}function re(){s._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(s.close,0):s.close()}function oe(e){e.preventDefault(),e.stopPropagation();var t=function e(t,n){return n(t)?t:t.parentNode?e(t.parentNode,n):void 0}(e.target,function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("disabled")&&!e.classList.contains("notAllowed")});if(void 0!==t){var n=t,i=s.latestSelectedDateObj=new Date(n.dateObj.getTime()),a=(i.getMonth()s.currentMonth+s.config.showMonths-1)&&"range"!==s.config.mode;if(s.selectedDateElem=n,"single"===s.config.mode)s.selectedDates=[i];else if("multiple"===s.config.mode){var r=fe(i);r?s.selectedDates.splice(parseInt(r),1):s.selectedDates.push(i)}else"range"===s.config.mode&&(2===s.selectedDates.length&&s.clear(!1),s.selectedDates.push(i),0!==f(i,s.selectedDates[0],!0)&&s.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(M(),a){var o=s.currentYear!==i.getFullYear();s.currentYear=i.getFullYear(),s.currentMonth=i.getMonth(),o&&de("onYearChange"),de("onMonthChange")}if(pe(),H(),me(),s.config.enableTime&&setTimeout(function(){return s.showTimeInput=!0},50),a||"range"===s.config.mode||1!==s.config.showMonths?s.selectedDateElem&&s.selectedDateElem.focus():P(n),void 0!==s.hourElement&&setTimeout(function(){return void 0!==s.hourElement&&s.hourElement.select()},451),s.config.closeOnSelect){var l="single"===s.config.mode&&!s.config.enableTime,c="range"===s.config.mode&&2===s.selectedDates.length&&!s.config.enableTime;(l||c)&&re()}O()}}s.parseDate=u({config:s.config,l10n:s.l10n}),s._handlers=[],s._bind=F,s._setHoursFromDate=_,s._positionCalendar=ie,s.changeMonth=q,s.changeYear=Z,s.clear=function(e){void 0===e&&(e=!0);s.input.value="",void 0!==s.altInput&&(s.altInput.value="");void 0!==s.mobileInput&&(s.mobileInput.value="");s.selectedDates=[],s.latestSelectedDateObj=void 0,s.showTimeInput=!1,!0===s.config.enableTime&&E();s.redraw(),e&&de("onChange")},s.close=function(){s.isOpen=!1,s.isMobile||(s.calendarContainer.classList.remove("open"),s._input.classList.remove("active"));de("onClose")},s._createElement=b,s.destroy=function(){void 0!==s.config&&de("onDestroy");for(var e=s._handlers.length;e--;){var t=s._handlers[e];t.element.removeEventListener(t.event,t.handler,t.options)}if(s._handlers=[],s.mobileInput)s.mobileInput.parentNode&&s.mobileInput.parentNode.removeChild(s.mobileInput),s.mobileInput=void 0;else if(s.calendarContainer&&s.calendarContainer.parentNode)if(s.config.static&&s.calendarContainer.parentNode){var n=s.calendarContainer.parentNode;if(n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else s.calendarContainer.parentNode.removeChild(s.calendarContainer);s.altInput&&(s.input.type="text",s.altInput.parentNode&&s.altInput.parentNode.removeChild(s.altInput),delete s.altInput);s.input&&(s.input.type=s.input._type,s.input.classList.remove("flatpickr-input"),s.input.removeAttribute("readonly"),s.input.value="");["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete s[e]}catch(e){}})},s.isEnabled=K,s.jumpToDate=A,s.open=function(e,t){void 0===t&&(t=s._positionElement);if(!0===s.isMobile)return e&&(e.preventDefault(),e.target&&e.target.blur()),void 0!==s.mobileInput&&(s.mobileInput.focus(),s.mobileInput.click()),void de("onOpen");if(s._input.disabled||s.config.inline)return;var n=s.isOpen;s.isOpen=!0,n||(s.calendarContainer.classList.add("open"),s._input.classList.add("active"),de("onOpen"),ie(t));!0===s.config.enableTime&&!0===s.config.noCalendar&&(0===s.selectedDates.length&&(s.setDate(void 0!==s.config.minDate?new Date(s.config.minDate.getTime()):new Date,!1),E(),me()),!1!==s.config.allowInput||void 0!==e&&s.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return s.hourElement.select()},50))},s.redraw=ae,s.set=function(e,t){null!==e&&"object"==typeof e?Object.assign(s.config,e):(s.config[e]=t,void 0!==le[e]?le[e].forEach(function(e){return e()}):m.indexOf(e)>-1&&(s.config[e]=i(t)));s.redraw(),A(),me(!1)},s.setDate=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=s.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return s.clear(t);se(e,n),s.showTimeInput=s.selectedDates.length>0,s.latestSelectedDateObj=s.selectedDates[0],s.redraw(),A(),_(),me(t),t&&de("onChange")},s.toggle=function(e){if(!0===s.isOpen)return s.close();s.open(e)};var le={locale:[ne,B],showMonths:[U,k,W]};function se(e,t){var n=[];if(e instanceof Array)n=e.map(function(e){return s.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)n=[s.parseDate(e,t)];else if("string"==typeof e)switch(s.config.mode){case"single":case"time":n=[s.parseDate(e,t)];break;case"multiple":n=e.split(s.config.conjunction).map(function(e){return s.parseDate(e,t)});break;case"range":n=e.split(s.l10n.rangeSeparator).map(function(e){return s.parseDate(e,t)})}else s.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));s.selectedDates=n.filter(function(e){return e instanceof Date&&K(e,!1)}),"range"===s.config.mode&&s.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function ce(e){return e.slice().map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?s.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:s.parseDate(e.from,void 0),to:s.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function de(e,t){if(void 0!==s.config){var n=s.config[e];if(void 0!==n&&n.length>0)for(var i=0;n[i]&&is.config.maxDate.getMonth():s.currentYear>s.config.maxDate.getFullYear()))}function he(e){return s.selectedDates.map(function(t){return s.formatDate(t,e)}).filter(function(e,t,n){return"range"!==s.config.mode||s.config.enableTime||n.indexOf(e)===t}).join("range"!==s.config.mode?s.config.conjunction:s.l10n.rangeSeparator)}function me(e){if(void 0===e&&(e=!0),0===s.selectedDates.length)return s.clear(e);void 0!==s.mobileInput&&s.mobileFormatStr&&(s.mobileInput.value=void 0!==s.latestSelectedDateObj?s.formatDate(s.latestSelectedDateObj,s.mobileFormatStr):""),s.input.value=he(s.config.dateFormat),void 0!==s.altInput&&(s.altInput.value=he(s.config.altFormat)),!1!==e&&de("onValueUpdate")}function ge(e){e.preventDefault();var t=s.prevMonthNav.contains(e.target),n=s.nextMonthNav.contains(e.target);t||n?q(t?-1:1):s.yearElements.indexOf(e.target)>=0?e.target.select():e.target.classList.contains("arrowUp")?s.changeYear(s.currentYear+1):e.target.classList.contains("arrowDown")&&s.changeYear(s.currentYear-1)}return function(){s.element=s.input=a,s.isOpen=!1,function(){var e=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],t=Object.assign({},o,JSON.parse(JSON.stringify(a.dataset||{}))),n={};s.config.parseDate=t.parseDate,s.config.formatDate=t.formatDate,Object.defineProperty(s.config,"enable",{get:function(){return s.config._enable},set:function(e){s.config._enable=ce(e)}}),Object.defineProperty(s.config,"disable",{get:function(){return s.config._disable},set:function(e){s.config._disable=ce(e)}});var r="time"===t.mode;t.dateFormat||!t.enableTime&&!r||(n.dateFormat=t.noCalendar||r?"H:i"+(t.enableSeconds?":S":""):D.defaultConfig.dateFormat+" H:i"+(t.enableSeconds?":S":"")),t.altInput&&(t.enableTime||r)&&!t.altFormat&&(n.altFormat=t.noCalendar||r?"h:i"+(t.enableSeconds?":S K":" K"):D.defaultConfig.altFormat+" h:i"+(t.enableSeconds?":S":"")+" K"),Object.defineProperty(s.config,"minDate",{get:function(){return s.config._minDate},set:te("min")}),Object.defineProperty(s.config,"maxDate",{get:function(){return s.config._maxDate},set:te("max")});var l=function(e){return function(t){s.config["min"===e?"_minTime":"_maxTime"]=s.parseDate(t,"H:i")}};Object.defineProperty(s.config,"minTime",{get:function(){return s.config._minTime},set:l("min")}),Object.defineProperty(s.config,"maxTime",{get:function(){return s.config._maxTime},set:l("max")}),"time"===t.mode&&(s.config.noCalendar=!0,s.config.enableTime=!0),Object.assign(s.config,n,t);for(var c=0;c-1?s.config[f]=i(u[f]).map(g).concat(s.config[f]):void 0===t[f]&&(s.config[f]=u[f])}de("onParseConfig")}(),ne(),s.input=s.config.wrap?a.querySelector("[data-input]"):a,s.input?(s.input._type=s.input.type,s.input.type="text",s.input.classList.add("flatpickr-input"),s._input=s.input,s.config.altInput&&(s.altInput=b(s.input.nodeName,s.input.className+" "+s.config.altInputClass),s._input=s.altInput,s.altInput.placeholder=s.input.placeholder,s.altInput.disabled=s.input.disabled,s.altInput.required=s.input.required,s.altInput.tabIndex=s.input.tabIndex,s.altInput.type="text",s.input.setAttribute("type","hidden"),!s.config.static&&s.input.parentNode&&s.input.parentNode.insertBefore(s.altInput,s.input.nextSibling)),s.config.allowInput||s._input.setAttribute("readonly","readonly"),s._positionElement=s.config.positionElement||s._input):s.config.errorHandler(new Error("Invalid input element specified")),function(){s.selectedDates=[],s.now=s.parseDate(s.config.now)||new Date;var e=s.config.defaultDate||("INPUT"!==s.input.nodeName&&"TEXTAREA"!==s.input.nodeName||!s.input.placeholder||s.input.value!==s.input.placeholder?s.input.value:null);e&&se(e,s.config.dateFormat);var t=s.selectedDates.length>0?s.selectedDates[0]:s.config.minDate&&s.config.minDate.getTime()>s.now.getTime()?s.config.minDate:s.config.maxDate&&s.config.maxDate.getTime()0&&(s.latestSelectedDateObj=s.selectedDates[0]),void 0!==s.config.minTime&&(s.config.minTime=s.parseDate(s.config.minTime,"H:i")),void 0!==s.config.maxTime&&(s.config.maxTime=s.parseDate(s.config.maxTime,"H:i")),s.minDateHasTime=!!s.config.minDate&&(s.config.minDate.getHours()>0||s.config.minDate.getMinutes()>0||s.config.minDate.getSeconds()>0),s.maxDateHasTime=!!s.config.maxDate&&(s.config.maxDate.getHours()>0||s.config.maxDate.getMinutes()>0||s.config.maxDate.getSeconds()>0),Object.defineProperty(s,"showTimeInput",{get:function(){return s._showTimeInput},set:function(e){s._showTimeInput=e,s.calendarContainer&&v(s.calendarContainer,"showTimeInput",e),s.isOpen&&ie()}})}(),s.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=s.currentMonth),void 0===t&&(t=s.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:s.l10n.daysInMonth[e]}},s.isMobile||function(){var n=window.document.createDocumentFragment();if(s.calendarContainer=b("div","flatpickr-calendar"),s.calendarContainer.tabIndex=-1,!s.config.noCalendar){if(n.appendChild((s.monthNav=b("div","flatpickr-months"),s.yearElements=[],s.monthElements=[],s.prevMonthNav=b("span","flatpickr-prev-month"),s.prevMonthNav.innerHTML=s.config.prevArrow,s.nextMonthNav=b("span","flatpickr-next-month"),s.nextMonthNav.innerHTML=s.config.nextArrow,U(),Object.defineProperty(s,"_hidePrevMonthArrow",{get:function(){return s.__hidePrevMonthArrow},set:function(e){s.__hidePrevMonthArrow!==e&&(v(s.prevMonthNav,"disabled",e),s.__hidePrevMonthArrow=e)}}),Object.defineProperty(s,"_hideNextMonthArrow",{get:function(){return s.__hideNextMonthArrow},set:function(e){s.__hideNextMonthArrow!==e&&(v(s.nextMonthNav,"disabled",e),s.__hideNextMonthArrow=e)}}),s.currentYearElement=s.yearElements[0],pe(),s.monthNav)),s.innerContainer=b("div","flatpickr-innerContainer"),s.config.weekNumbers){var i=function(){s.calendarContainer.classList.add("hasWeeks");var e=b("div","flatpickr-weekwrapper");e.appendChild(b("span","flatpickr-weekday",s.l10n.weekAbbreviation));var t=b("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),a=i.weekWrapper,r=i.weekNumbers;s.innerContainer.appendChild(a),s.weekNumbers=r,s.weekWrapper=a}s.rContainer=b("div","flatpickr-rContainer"),s.rContainer.appendChild(W()),s.daysContainer||(s.daysContainer=b("div","flatpickr-days"),s.daysContainer.tabIndex=-1),H(),s.rContainer.appendChild(s.daysContainer),s.innerContainer.appendChild(s.rContainer),n.appendChild(s.innerContainer)}s.config.enableTime&&n.appendChild(function(){s.calendarContainer.classList.add("hasTime"),s.config.noCalendar&&s.calendarContainer.classList.add("noCalendar"),s.timeContainer=b("div","flatpickr-time"),s.timeContainer.tabIndex=-1;var n=b("span","flatpickr-time-separator",":"),i=w("flatpickr-hour");s.hourElement=i.getElementsByTagName("input")[0];var a=w("flatpickr-minute");if(s.minuteElement=a.getElementsByTagName("input")[0],s.hourElement.tabIndex=s.minuteElement.tabIndex=-1,s.hourElement.value=e(s.latestSelectedDateObj?s.latestSelectedDateObj.getHours():s.config.time_24hr?s.config.defaultHour:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(s.config.defaultHour)),s.minuteElement.value=e(s.latestSelectedDateObj?s.latestSelectedDateObj.getMinutes():s.config.defaultMinute),s.hourElement.setAttribute("data-step",s.config.hourIncrement.toString()),s.minuteElement.setAttribute("data-step",s.config.minuteIncrement.toString()),s.hourElement.setAttribute("data-min",s.config.time_24hr?"0":"1"),s.hourElement.setAttribute("data-max",s.config.time_24hr?"23":"12"),s.minuteElement.setAttribute("data-min","0"),s.minuteElement.setAttribute("data-max","59"),s.timeContainer.appendChild(i),s.timeContainer.appendChild(n),s.timeContainer.appendChild(a),s.config.time_24hr&&s.timeContainer.classList.add("time24hr"),s.config.enableSeconds){s.timeContainer.classList.add("hasSeconds");var r=w("flatpickr-second");s.secondElement=r.getElementsByTagName("input")[0],s.secondElement.value=e(s.latestSelectedDateObj?s.latestSelectedDateObj.getSeconds():s.config.defaultSeconds),s.secondElement.setAttribute("data-step",s.minuteElement.getAttribute("data-step")),s.secondElement.setAttribute("data-min",s.minuteElement.getAttribute("data-min")),s.secondElement.setAttribute("data-max",s.minuteElement.getAttribute("data-max")),s.timeContainer.appendChild(b("span","flatpickr-time-separator",":")),s.timeContainer.appendChild(r)}return s.config.time_24hr||(s.amPM=b("span","flatpickr-am-pm",s.l10n.amPM[t((s.latestSelectedDateObj?s.hourElement.value:s.config.defaultHour)>11)]),s.amPM.title=s.l10n.toggleTitle,s.amPM.tabIndex=-1,s.timeContainer.appendChild(s.amPM)),s.timeContainer}()),v(s.calendarContainer,"rangeMode","range"===s.config.mode),v(s.calendarContainer,"animate",!0===s.config.animate),v(s.calendarContainer,"multiMonth",s.config.showMonths>1),s.calendarContainer.appendChild(n);var o=void 0!==s.config.appendTo&&void 0!==s.config.appendTo.nodeType;if((s.config.inline||s.config.static)&&(s.calendarContainer.classList.add(s.config.inline?"inline":"static"),s.config.inline&&(!o&&s.element.parentNode?s.element.parentNode.insertBefore(s.calendarContainer,s._input.nextSibling):void 0!==s.config.appendTo&&s.config.appendTo.appendChild(s.calendarContainer)),s.config.static)){var l=b("div","flatpickr-wrapper");s.element.parentNode&&s.element.parentNode.insertBefore(l,s.element),l.appendChild(s.element),s.altInput&&l.appendChild(s.altInput),l.appendChild(s.calendarContainer)}s.config.static||s.config.inline||(void 0!==s.config.appendTo?s.config.appendTo:window.document.body).appendChild(s.calendarContainer)}(),function(){if(s.config.wrap&&["open","close","toggle","clear"].forEach(function(e){Array.prototype.forEach.call(s.element.querySelectorAll("[data-"+e+"]"),function(t){return F(t,"click",s[e])})}),s.isMobile)!function(){var e=s.config.enableTime?s.config.noCalendar?"time":"datetime-local":"date";s.mobileInput=b("input",s.input.className+" flatpickr-mobile"),s.mobileInput.step=s.input.getAttribute("step")||"any",s.mobileInput.tabIndex=1,s.mobileInput.type=e,s.mobileInput.disabled=s.input.disabled,s.mobileInput.required=s.input.required,s.mobileInput.placeholder=s.input.placeholder,s.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",s.selectedDates.length>0&&(s.mobileInput.defaultValue=s.mobileInput.value=s.formatDate(s.selectedDates[0],s.mobileFormatStr)),s.config.minDate&&(s.mobileInput.min=s.formatDate(s.config.minDate,"Y-m-d")),s.config.maxDate&&(s.mobileInput.max=s.formatDate(s.config.maxDate,"Y-m-d")),s.input.type="hidden",void 0!==s.altInput&&(s.altInput.type="hidden");try{s.input.parentNode&&s.input.parentNode.insertBefore(s.mobileInput,s.input.nextSibling)}catch(e){}F(s.mobileInput,"change",function(e){s.setDate(e.target.value,!1,s.mobileFormatStr),de("onChange"),de("onClose")})}();else{var e=n(ee,50);s._debouncedChange=n(O,x),s.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&F(s.daysContainer,"mouseover",function(e){"range"===s.config.mode&&Q(e.target)}),F(window.document.body,"keydown",X),s.config.static||F(s._input,"keydown",X),s.config.inline||s.config.static||F(window,"resize",e),void 0!==window.ontouchstart?F(window.document,"click",J):F(window.document,"mousedown",S(J)),F(window.document,"focus",J,{capture:!0}),!0===s.config.clickOpens&&(F(s._input,"focus",s.open),F(s._input,"mousedown",S(s.open))),void 0!==s.daysContainer&&(F(s.monthNav,"mousedown",S(ge)),F(s.monthNav,["keyup","increment"],I),F(s.daysContainer,"mousedown",S(oe))),void 0!==s.timeContainer&&void 0!==s.minuteElement&&void 0!==s.hourElement&&(F(s.timeContainer,["increment"],C),F(s.timeContainer,"blur",C,{capture:!0}),F(s.timeContainer,"mousedown",S(j)),F([s.hourElement,s.minuteElement],["focus","click"],function(e){return e.target.select()}),void 0!==s.secondElement&&F(s.secondElement,"focus",function(){return s.secondElement&&s.secondElement.select()}),void 0!==s.amPM&&F(s.amPM,"mousedown",S(function(e){C(e),O()})))}}(),(s.selectedDates.length||s.config.noCalendar)&&(s.config.enableTime&&_(s.config.noCalendar?s.latestSelectedDateObj||s.config.minDate:void 0),me(!1)),k(),s.showTimeInput=s.selectedDates.length>0||s.config.noCalendar;var r=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!s.isMobile&&r&&ie(),de("onReady")}(),s}function C(e,t){for(var n=Array.prototype.slice.call(e),i=[],a=0;a=0&&d.splice(t,1)}function g(e){var t=document.createElement("style");return e.attrs.type="text/css",v(t,e.attrs),h(e,t),t}function v(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function b(e,t){var n,i,a,r;if(t.transform&&e.css){if(!(r=t.transform(e.css)))return function(){};e.css=r}if(t.singleton){var o=c++;n=s||(s=g(t)),i=x.bind(null,n,o,!1),a=x.bind(null,n,o,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",v(t,e.attrs),h(e,t),t}(t),i=function(e,t,n){var i=n.css,a=n.sourceMap,r=void 0===t.convertToAbsoluteUrls&&a;(t.convertToAbsoluteUrls||r)&&(i=u(i));a&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */");var o=new Blob([i],{type:"text/css"}),l=e.href;e.href=URL.createObjectURL(o),l&&URL.revokeObjectURL(l)}.bind(null,n,t),a=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(t),i=function(e,t){var n=t.css,i=t.media;i&&e.setAttribute("media",i);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),a=function(){m(n)});return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else a()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||(t.singleton=o()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=p(e,t);return f(n,t),function(e){for(var i=[],a=0;ae||heightn.parts.length&&(i.parts.length=n.parts.length)}else{var o=[];for(a=0;a 11)]; + }, + M: function M(date, locale) { + return monthToStr(date.getMonth(), true, locale); + }, + S: function S(date) { + return pad(date.getSeconds()); + }, + U: function U(date) { + return date.getTime() / 1000; + }, + W: function W(date, _, options) { + return options.getWeek(date); + }, + Y: function Y(date) { + return date.getFullYear(); + }, + d: function d(date) { + return pad(date.getDate()); + }, + h: function h(date) { + return date.getHours() % 12 ? date.getHours() % 12 : 12; + }, + i: function i(date) { + return pad(date.getMinutes()); + }, + j: function j(date) { + return date.getDate(); + }, + l: function l(date, locale) { + return locale.weekdays.longhand[date.getDay()]; + }, + m: function m(date) { + return pad(date.getMonth() + 1); + }, + n: function n(date) { + return date.getMonth() + 1; + }, + s: function s(date) { + return date.getSeconds(); + }, + w: function w(date) { + return date.getDay(); + }, + y: function y(date) { + return String(date.getFullYear()).substring(2); + } + }; + + var english = { + weekdays: { + shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + longhand: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + }, + months: { + shorthand: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + longhand: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] + }, + daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], + firstDayOfWeek: 0, + ordinal: function ordinal(nth) { + var s = nth % 100; + if (s > 3 && s < 21) return "th"; + + switch (s % 10) { + case 1: + return "st"; + + case 2: + return "nd"; + + case 3: + return "rd"; + + default: + return "th"; + } + }, + rangeSeparator: " to ", + weekAbbreviation: "Wk", + scrollTitle: "Scroll to increment", + toggleTitle: "Click to toggle", + amPM: ["AM", "PM"], + yearAriaLabel: "Year" + }; + + var createDateFormatter = function createDateFormatter(_ref) { + var _ref$config = _ref.config, + config = _ref$config === void 0 ? defaults : _ref$config, + _ref$l10n = _ref.l10n, + l10n = _ref$l10n === void 0 ? english : _ref$l10n; + return function (dateObj, frmt, overrideLocale) { + var locale = overrideLocale || l10n; + + if (config.formatDate !== undefined) { + return config.formatDate(dateObj, frmt, locale); + } + + return frmt.split("").map(function (c, i, arr) { + return formats[c] && arr[i - 1] !== "\\" ? formats[c](dateObj, locale, config) : c !== "\\" ? c : ""; + }).join(""); + }; + }; + var createDateParser = function createDateParser(_ref2) { + var _ref2$config = _ref2.config, + config = _ref2$config === void 0 ? defaults : _ref2$config, + _ref2$l10n = _ref2.l10n, + l10n = _ref2$l10n === void 0 ? english : _ref2$l10n; + return function (date, givenFormat, timeless, customLocale) { + if (date !== 0 && !date) return undefined; + var locale = customLocale || l10n; + var parsedDate; + var date_orig = date; + if (date instanceof Date) parsedDate = new Date(date.getTime());else if (typeof date !== "string" && date.toFixed !== undefined) parsedDate = new Date(date);else if (typeof date === "string") { + var format = givenFormat || (config || defaults).dateFormat; + var datestr = String(date).trim(); + + if (datestr === "today") { + parsedDate = new Date(); + timeless = true; + } else if (/Z$/.test(datestr) || /GMT$/.test(datestr)) parsedDate = new Date(date);else if (config && config.parseDate) parsedDate = config.parseDate(date, format);else { + parsedDate = !config || !config.noCalendar ? new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0) : new Date(new Date().setHours(0, 0, 0, 0)); + var matched, + ops = []; + + for (var i = 0, matchIndex = 0, regexStr = ""; i < format.length; i++) { + var token = format[i]; + var isBackSlash = token === "\\"; + var escaped = format[i - 1] === "\\" || isBackSlash; + + if (tokenRegex[token] && !escaped) { + regexStr += tokenRegex[token]; + var match = new RegExp(regexStr).exec(date); + + if (match && (matched = true)) { + ops[token !== "Y" ? "push" : "unshift"]({ + fn: revFormat[token], + val: match[++matchIndex] + }); + } + } else if (!isBackSlash) regexStr += "."; + + ops.forEach(function (_ref3) { + var fn = _ref3.fn, + val = _ref3.val; + return parsedDate = fn(parsedDate, val, locale) || parsedDate; + }); + } + + parsedDate = matched ? parsedDate : undefined; + } + } + + if (!(parsedDate instanceof Date && !isNaN(parsedDate.getTime()))) { + config.errorHandler(new Error("Invalid date provided: " + date_orig)); + return undefined; + } + + if (timeless === true) parsedDate.setHours(0, 0, 0, 0); + return parsedDate; + }; + }; + function compareDates(date1, date2, timeless) { + if (timeless === void 0) { + timeless = true; + } + + if (timeless !== false) { + return new Date(date1.getTime()).setHours(0, 0, 0, 0) - new Date(date2.getTime()).setHours(0, 0, 0, 0); + } + + return date1.getTime() - date2.getTime(); + } + var getWeek = function getWeek(givenDate) { + var date = new Date(givenDate.getTime()); + date.setHours(0, 0, 0, 0); + date.setDate(date.getDate() + 3 - (date.getDay() + 6) % 7); + var week1 = new Date(date.getFullYear(), 0, 4); + return 1 + Math.round(((date.getTime() - week1.getTime()) / 86400000 - 3 + (week1.getDay() + 6) % 7) / 7); + }; + var isBetween = function isBetween(ts, ts1, ts2) { + return ts > Math.min(ts1, ts2) && ts < Math.max(ts1, ts2); + }; + var duration = { + DAY: 86400000 + }; + + var HOOKS = ["onChange", "onClose", "onDayCreate", "onDestroy", "onKeyDown", "onMonthChange", "onOpen", "onParseConfig", "onReady", "onValueUpdate", "onYearChange", "onPreCalendarPosition"]; + var defaults = { + _disable: [], + _enable: [], + allowInput: false, + altFormat: "F j, Y", + altInput: false, + altInputClass: "form-control input", + animate: typeof window === "object" && window.navigator.userAgent.indexOf("MSIE") === -1, + ariaDateFormat: "F j, Y", + clickOpens: true, + closeOnSelect: true, + conjunction: ", ", + dateFormat: "Y-m-d", + defaultHour: 12, + defaultMinute: 0, + defaultSeconds: 0, + disable: [], + disableMobile: false, + enable: [], + enableSeconds: false, + enableTime: false, + errorHandler: function errorHandler(err) { + return typeof console !== "undefined" && console.warn(err); + }, + getWeek: getWeek, + hourIncrement: 1, + ignoredFocusElements: [], + inline: false, + locale: "default", + minuteIncrement: 5, + mode: "single", + nextArrow: "", + noCalendar: false, + now: new Date(), + onChange: [], + onClose: [], + onDayCreate: [], + onDestroy: [], + onKeyDown: [], + onMonthChange: [], + onOpen: [], + onParseConfig: [], + onReady: [], + onValueUpdate: [], + onYearChange: [], + onPreCalendarPosition: [], + plugins: [], + position: "auto", + positionElement: undefined, + prevArrow: "", + shorthandCurrentMonth: false, + showMonths: 1, + static: false, + time_24hr: false, + weekNumbers: false, + wrap: false + }; + + function toggleClass(elem, className, bool) { + if (bool === true) return elem.classList.add(className); + elem.classList.remove(className); + } + function createElement(tag, className, content) { + var e = window.document.createElement(tag); + className = className || ""; + content = content || ""; + e.className = className; + if (content !== undefined) e.textContent = content; + return e; + } + function clearNode(node) { + while (node.firstChild) { + node.removeChild(node.firstChild); + } + } + function findParent(node, condition) { + if (condition(node)) return node;else if (node.parentNode) return findParent(node.parentNode, condition); + return undefined; + } + function createNumberInput(inputClassName, opts) { + var wrapper = createElement("div", "numInputWrapper"), + numInput = createElement("input", "numInput " + inputClassName), + arrowUp = createElement("span", "arrowUp"), + arrowDown = createElement("span", "arrowDown"); + numInput.type = "text"; + numInput.pattern = "\\d*"; + if (opts !== undefined) for (var key in opts) { + numInput.setAttribute(key, opts[key]); + } + wrapper.appendChild(numInput); + wrapper.appendChild(arrowUp); + wrapper.appendChild(arrowDown); + return wrapper; + } + + if (typeof Object.assign !== "function") { + Object.assign = function (target) { + if (!target) { + throw TypeError("Cannot convert undefined or null to object"); + } + + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var _loop = function _loop() { + var source = args[_i]; + + if (source) { + Object.keys(source).forEach(function (key) { + return target[key] = source[key]; + }); + } + }; + + for (var _i = 0; _i < args.length; _i++) { + _loop(); + } + + return target; + }; + } + + var DEBOUNCED_CHANGE_MS = 300; + + function FlatpickrInstance(element, instanceConfig) { + var self = { + config: Object.assign({}, flatpickr.defaultConfig), + l10n: english + }; + self.parseDate = createDateParser({ + config: self.config, + l10n: self.l10n + }); + self._handlers = []; + self._bind = bind; + self._setHoursFromDate = setHoursFromDate; + self._positionCalendar = positionCalendar; + self.changeMonth = changeMonth; + self.changeYear = changeYear; + self.clear = clear; + self.close = close; + self._createElement = createElement; + self.destroy = destroy; + self.isEnabled = isEnabled; + self.jumpToDate = jumpToDate; + self.open = open; + self.redraw = redraw; + self.set = set; + self.setDate = setDate; + self.toggle = toggle; + + function setupHelperFunctions() { + self.utils = { + getDaysInMonth: function getDaysInMonth(month, yr) { + if (month === void 0) { + month = self.currentMonth; + } + + if (yr === void 0) { + yr = self.currentYear; + } + + if (month === 1 && (yr % 4 === 0 && yr % 100 !== 0 || yr % 400 === 0)) return 29; + return self.l10n.daysInMonth[month]; + } + }; + } + + function init() { + self.element = self.input = element; + self.isOpen = false; + parseConfig(); + setupLocale(); + setupInputs(); + setupDates(); + setupHelperFunctions(); + if (!self.isMobile) build(); + bindEvents(); + + if (self.selectedDates.length || self.config.noCalendar) { + if (self.config.enableTime) { + setHoursFromDate(self.config.noCalendar ? self.latestSelectedDateObj || self.config.minDate : undefined); + } + + updateValue(false); + } + + setCalendarWidth(); + self.showTimeInput = self.selectedDates.length > 0 || self.config.noCalendar; + var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); + + if (!self.isMobile && isSafari) { + positionCalendar(); + } + + triggerEvent("onReady"); + } + + function bindToInstance(fn) { + return fn.bind(self); + } + + function setCalendarWidth() { + var config = self.config; + if (config.weekNumbers === false && config.showMonths === 1) return;else if (config.noCalendar !== true) { + window.requestAnimationFrame(function () { + self.calendarContainer.style.visibility = "hidden"; + self.calendarContainer.style.display = "block"; + + if (self.daysContainer !== undefined) { + var daysWidth = (self.days.offsetWidth + 1) * config.showMonths; + self.daysContainer.style.width = daysWidth + "px"; + self.calendarContainer.style.width = daysWidth + (self.weekWrapper !== undefined ? self.weekWrapper.offsetWidth : 0) + "px"; + self.calendarContainer.style.removeProperty("visibility"); + self.calendarContainer.style.removeProperty("display"); + } + }); + } + } + + function updateTime(e) { + if (self.selectedDates.length === 0) return; + + if (e !== undefined && e.type !== "blur") { + timeWrapper(e); + } + + var prevValue = self._input.value; + setHoursFromInputs(); + updateValue(); + + if (self._input.value !== prevValue) { + self._debouncedChange(); + } + } + + function ampm2military(hour, amPM) { + return hour % 12 + 12 * int(amPM === self.l10n.amPM[1]); + } + + function military2ampm(hour) { + switch (hour % 24) { + case 0: + case 12: + return 12; + + default: + return hour % 12; + } + } + + function setHoursFromInputs() { + if (self.hourElement === undefined || self.minuteElement === undefined) return; + var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, + minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, + seconds = self.secondElement !== undefined ? (parseInt(self.secondElement.value, 10) || 0) % 60 : 0; + + if (self.amPM !== undefined) { + hours = ampm2military(hours, self.amPM.textContent); + } + + var limitMinHours = self.config.minTime !== undefined || self.config.minDate && self.minDateHasTime && self.latestSelectedDateObj && compareDates(self.latestSelectedDateObj, self.config.minDate, true) === 0; + var limitMaxHours = self.config.maxTime !== undefined || self.config.maxDate && self.maxDateHasTime && self.latestSelectedDateObj && compareDates(self.latestSelectedDateObj, self.config.maxDate, true) === 0; + + if (limitMaxHours) { + var maxTime = self.config.maxTime !== undefined ? self.config.maxTime : self.config.maxDate; + hours = Math.min(hours, maxTime.getHours()); + if (hours === maxTime.getHours()) minutes = Math.min(minutes, maxTime.getMinutes()); + if (minutes === maxTime.getMinutes()) seconds = Math.min(seconds, maxTime.getSeconds()); + } + + if (limitMinHours) { + var minTime = self.config.minTime !== undefined ? self.config.minTime : self.config.minDate; + hours = Math.max(hours, minTime.getHours()); + if (hours === minTime.getHours()) minutes = Math.max(minutes, minTime.getMinutes()); + if (minutes === minTime.getMinutes()) seconds = Math.max(seconds, minTime.getSeconds()); + } + + setHours(hours, minutes, seconds); + } + + function setHoursFromDate(dateObj) { + var date = dateObj || self.latestSelectedDateObj; + if (date) setHours(date.getHours(), date.getMinutes(), date.getSeconds()); + } + + function setDefaultHours() { + var hours = self.config.defaultHour; + var minutes = self.config.defaultMinute; + var seconds = self.config.defaultSeconds; + + if (self.config.minDate !== undefined) { + var min_hr = self.config.minDate.getHours(); + var min_minutes = self.config.minDate.getMinutes(); + hours = Math.max(hours, min_hr); + if (hours === min_hr) minutes = Math.max(min_minutes, minutes); + if (hours === min_hr && minutes === min_minutes) seconds = self.config.minDate.getSeconds(); + } + + if (self.config.maxDate !== undefined) { + var max_hr = self.config.maxDate.getHours(); + var max_minutes = self.config.maxDate.getMinutes(); + hours = Math.min(hours, max_hr); + if (hours === max_hr) minutes = Math.min(max_minutes, minutes); + if (hours === max_hr && minutes === max_minutes) seconds = self.config.maxDate.getSeconds(); + } + + setHours(hours, minutes, seconds); + } + + function setHours(hours, minutes, seconds) { + if (self.latestSelectedDateObj !== undefined) { + self.latestSelectedDateObj.setHours(hours % 24, minutes, seconds || 0, 0); + } + + if (!self.hourElement || !self.minuteElement || self.isMobile) return; + self.hourElement.value = pad(!self.config.time_24hr ? (12 + hours) % 12 + 12 * int(hours % 12 === 0) : hours); + self.minuteElement.value = pad(minutes); + if (self.amPM !== undefined) self.amPM.textContent = self.l10n.amPM[int(hours >= 12)]; + if (self.secondElement !== undefined) self.secondElement.value = pad(seconds); + } + + function onYearInput(event) { + var year = parseInt(event.target.value) + (event.delta || 0); + + if (year / 1000 > 1 || event.key === "Enter" && !/[^\d]/.test(year.toString())) { + changeYear(year); + } + } + + function bind(element, event, handler, options) { + if (event instanceof Array) return event.forEach(function (ev) { + return bind(element, ev, handler, options); + }); + if (element instanceof Array) return element.forEach(function (el) { + return bind(el, event, handler, options); + }); + element.addEventListener(event, handler, options); + + self._handlers.push({ + element: element, + event: event, + handler: handler, + options: options + }); + } + + function onClick(handler) { + return function (evt) { + evt.which === 1 && handler(evt); + }; + } + + function triggerChange() { + triggerEvent("onChange"); + } + + function bindEvents() { + if (self.config.wrap) { + ["open", "close", "toggle", "clear"].forEach(function (evt) { + Array.prototype.forEach.call(self.element.querySelectorAll("[data-" + evt + "]"), function (el) { + return bind(el, "click", self[evt]); + }); + }); + } + + if (self.isMobile) { + setupMobile(); + return; + } + + var debouncedResize = debounce(onResize, 50); + self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS); + if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent)) bind(self.daysContainer, "mouseover", function (e) { + if (self.config.mode === "range") onMouseOver(e.target); + }); + bind(window.document.body, "keydown", onKeyDown); + if (!self.config.static) bind(self._input, "keydown", onKeyDown); + if (!self.config.inline && !self.config.static) bind(window, "resize", debouncedResize); + if (window.ontouchstart !== undefined) bind(window.document, "click", documentClick);else bind(window.document, "mousedown", onClick(documentClick)); + bind(window.document, "focus", documentClick, { + capture: true + }); + + if (self.config.clickOpens === true) { + bind(self._input, "focus", self.open); + bind(self._input, "mousedown", onClick(self.open)); + } + + if (self.daysContainer !== undefined) { + bind(self.monthNav, "mousedown", onClick(onMonthNavClick)); + bind(self.monthNav, ["keyup", "increment"], onYearInput); + bind(self.daysContainer, "mousedown", onClick(selectDate)); + } + + if (self.timeContainer !== undefined && self.minuteElement !== undefined && self.hourElement !== undefined) { + var selText = function selText(e) { + return e.target.select(); + }; + + bind(self.timeContainer, ["increment"], updateTime); + bind(self.timeContainer, "blur", updateTime, { + capture: true + }); + bind(self.timeContainer, "mousedown", onClick(timeIncrement)); + bind([self.hourElement, self.minuteElement], ["focus", "click"], selText); + if (self.secondElement !== undefined) bind(self.secondElement, "focus", function () { + return self.secondElement && self.secondElement.select(); + }); + + if (self.amPM !== undefined) { + bind(self.amPM, "mousedown", onClick(function (e) { + updateTime(e); + triggerChange(); + })); + } + } + } + + function jumpToDate(jumpDate) { + var jumpTo = jumpDate !== undefined ? self.parseDate(jumpDate) : self.latestSelectedDateObj || (self.config.minDate && self.config.minDate > self.now ? self.config.minDate : self.config.maxDate && self.config.maxDate < self.now ? self.config.maxDate : self.now); + + try { + if (jumpTo !== undefined) { + self.currentYear = jumpTo.getFullYear(); + self.currentMonth = jumpTo.getMonth(); + } + } catch (e) { + e.message = "Invalid date supplied: " + jumpTo; + self.config.errorHandler(e); + } + + self.redraw(); + } + + function timeIncrement(e) { + if (~e.target.className.indexOf("arrow")) incrementNumInput(e, e.target.classList.contains("arrowUp") ? 1 : -1); + } + + function incrementNumInput(e, delta, inputElem) { + var target = e && e.target; + var input = inputElem || target && target.parentNode && target.parentNode.firstChild; + var event = createEvent("increment"); + event.delta = delta; + input && input.dispatchEvent(event); + } + + function build() { + var fragment = window.document.createDocumentFragment(); + self.calendarContainer = createElement("div", "flatpickr-calendar"); + self.calendarContainer.tabIndex = -1; + + if (!self.config.noCalendar) { + fragment.appendChild(buildMonthNav()); + self.innerContainer = createElement("div", "flatpickr-innerContainer"); + + if (self.config.weekNumbers) { + var _buildWeeks = buildWeeks(), + weekWrapper = _buildWeeks.weekWrapper, + weekNumbers = _buildWeeks.weekNumbers; + + self.innerContainer.appendChild(weekWrapper); + self.weekNumbers = weekNumbers; + self.weekWrapper = weekWrapper; + } + + self.rContainer = createElement("div", "flatpickr-rContainer"); + self.rContainer.appendChild(buildWeekdays()); + + if (!self.daysContainer) { + self.daysContainer = createElement("div", "flatpickr-days"); + self.daysContainer.tabIndex = -1; + } + + buildDays(); + self.rContainer.appendChild(self.daysContainer); + self.innerContainer.appendChild(self.rContainer); + fragment.appendChild(self.innerContainer); + } + + if (self.config.enableTime) { + fragment.appendChild(buildTime()); + } + + toggleClass(self.calendarContainer, "rangeMode", self.config.mode === "range"); + toggleClass(self.calendarContainer, "animate", self.config.animate === true); + toggleClass(self.calendarContainer, "multiMonth", self.config.showMonths > 1); + self.calendarContainer.appendChild(fragment); + var customAppend = self.config.appendTo !== undefined && self.config.appendTo.nodeType !== undefined; + + if (self.config.inline || self.config.static) { + self.calendarContainer.classList.add(self.config.inline ? "inline" : "static"); + + if (self.config.inline) { + if (!customAppend && self.element.parentNode) self.element.parentNode.insertBefore(self.calendarContainer, self._input.nextSibling);else if (self.config.appendTo !== undefined) self.config.appendTo.appendChild(self.calendarContainer); + } + + if (self.config.static) { + var wrapper = createElement("div", "flatpickr-wrapper"); + if (self.element.parentNode) self.element.parentNode.insertBefore(wrapper, self.element); + wrapper.appendChild(self.element); + if (self.altInput) wrapper.appendChild(self.altInput); + wrapper.appendChild(self.calendarContainer); + } + } + + if (!self.config.static && !self.config.inline) (self.config.appendTo !== undefined ? self.config.appendTo : window.document.body).appendChild(self.calendarContainer); + } + + function createDay(className, date, dayNumber, i) { + var dateIsEnabled = isEnabled(date, true), + dayElement = createElement("span", "flatpickr-day " + className, date.getDate().toString()); + dayElement.dateObj = date; + dayElement.$i = i; + dayElement.setAttribute("aria-label", self.formatDate(date, self.config.ariaDateFormat)); + + if (className.indexOf("hidden") === -1 && compareDates(date, self.now) === 0) { + self.todayDateElem = dayElement; + dayElement.classList.add("today"); + dayElement.setAttribute("aria-current", "date"); + } + + if (dateIsEnabled) { + dayElement.tabIndex = -1; + + if (isDateSelected(date)) { + dayElement.classList.add("selected"); + self.selectedDateElem = dayElement; + + if (self.config.mode === "range") { + toggleClass(dayElement, "startRange", self.selectedDates[0] && compareDates(date, self.selectedDates[0], true) === 0); + toggleClass(dayElement, "endRange", self.selectedDates[1] && compareDates(date, self.selectedDates[1], true) === 0); + if (className === "nextMonthDay") dayElement.classList.add("inRange"); + } + } + } else { + dayElement.classList.add("disabled"); + } + + if (self.config.mode === "range") { + if (isDateInRange(date) && !isDateSelected(date)) dayElement.classList.add("inRange"); + } + + if (self.weekNumbers && self.config.showMonths === 1 && className !== "prevMonthDay" && dayNumber % 7 === 1) { + self.weekNumbers.insertAdjacentHTML("beforeend", "" + self.config.getWeek(date) + ""); + } + + triggerEvent("onDayCreate", dayElement); + return dayElement; + } + + function focusOnDayElem(targetNode) { + targetNode.focus(); + if (self.config.mode === "range") onMouseOver(targetNode); + } + + function getFirstAvailableDay(delta) { + var startMonth = delta > 0 ? 0 : self.config.showMonths - 1; + var endMonth = delta > 0 ? self.config.showMonths : -1; + + for (var m = startMonth; m != endMonth; m += delta) { + var month = self.daysContainer.children[m]; + var startIndex = delta > 0 ? 0 : month.children.length - 1; + var endIndex = delta > 0 ? month.children.length : -1; + + for (var i = startIndex; i != endIndex; i += delta) { + var c = month.children[i]; + if (c.className.indexOf("hidden") === -1 && isEnabled(c.dateObj)) return c; + } + } + + return undefined; + } + + function getNextAvailableDay(current, delta) { + var givenMonth = current.className.indexOf("Month") === -1 ? current.dateObj.getMonth() : self.currentMonth; + var endMonth = delta > 0 ? self.config.showMonths : -1; + var loopDelta = delta > 0 ? 1 : -1; + + for (var m = givenMonth - self.currentMonth; m != endMonth; m += loopDelta) { + var month = self.daysContainer.children[m]; + var startIndex = givenMonth - self.currentMonth === m ? current.$i + delta : delta < 0 ? month.children.length - 1 : 0; + var numMonthDays = month.children.length; + + for (var i = startIndex; i >= 0 && i < numMonthDays && i != (delta > 0 ? numMonthDays : -1); i += loopDelta) { + var c = month.children[i]; + if (c.className.indexOf("hidden") === -1 && isEnabled(c.dateObj) && Math.abs(current.$i - i) >= Math.abs(delta)) return focusOnDayElem(c); + } + } + + self.changeMonth(loopDelta); + focusOnDay(getFirstAvailableDay(loopDelta), 0); + return undefined; + } + + function focusOnDay(current, offset) { + var dayFocused = isInView(document.activeElement || document.body); + var startElem = current !== undefined ? current : dayFocused ? document.activeElement : self.selectedDateElem !== undefined && isInView(self.selectedDateElem) ? self.selectedDateElem : self.todayDateElem !== undefined && isInView(self.todayDateElem) ? self.todayDateElem : getFirstAvailableDay(offset > 0 ? 1 : -1); + if (startElem === undefined) return self._input.focus(); + if (!dayFocused) return focusOnDayElem(startElem); + getNextAvailableDay(startElem, offset); + } + + function buildMonthDays(year, month) { + var firstOfMonth = (new Date(year, month, 1).getDay() - self.l10n.firstDayOfWeek + 7) % 7; + var prevMonthDays = self.utils.getDaysInMonth((month - 1 + 12) % 12); + var daysInMonth = self.utils.getDaysInMonth(month), + days = window.document.createDocumentFragment(), + isMultiMonth = self.config.showMonths > 1, + prevMonthDayClass = isMultiMonth ? "prevMonthDay hidden" : "prevMonthDay", + nextMonthDayClass = isMultiMonth ? "nextMonthDay hidden" : "nextMonthDay"; + var dayNumber = prevMonthDays + 1 - firstOfMonth, + dayIndex = 0; + + for (; dayNumber <= prevMonthDays; dayNumber++, dayIndex++) { + days.appendChild(createDay(prevMonthDayClass, new Date(year, month - 1, dayNumber), dayNumber, dayIndex)); + } + + for (dayNumber = 1; dayNumber <= daysInMonth; dayNumber++, dayIndex++) { + days.appendChild(createDay("", new Date(year, month, dayNumber), dayNumber, dayIndex)); + } + + for (var dayNum = daysInMonth + 1; dayNum <= 42 - firstOfMonth && (self.config.showMonths === 1 || dayIndex % 7 !== 0); dayNum++, dayIndex++) { + days.appendChild(createDay(nextMonthDayClass, new Date(year, month + 1, dayNum % daysInMonth), dayNum, dayIndex)); + } + + var dayContainer = createElement("div", "dayContainer"); + dayContainer.appendChild(days); + return dayContainer; + } + + function buildDays() { + if (self.daysContainer === undefined) { + return; + } + + clearNode(self.daysContainer); + if (self.weekNumbers) clearNode(self.weekNumbers); + var frag = document.createDocumentFragment(); + + for (var i = 0; i < self.config.showMonths; i++) { + var d = new Date(self.currentYear, self.currentMonth, 1); + d.setMonth(self.currentMonth + i); + frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth())); + } + + self.daysContainer.appendChild(frag); + self.days = self.daysContainer.firstChild; + + if (self.config.mode === "range" && self.selectedDates.length === 1) { + onMouseOver(); + } + } + + function buildMonth() { + var container = createElement("div", "flatpickr-month"); + var monthNavFragment = window.document.createDocumentFragment(); + var monthElement = createElement("span", "cur-month"); + var yearInput = createNumberInput("cur-year", { + tabindex: "-1" + }); + var yearElement = yearInput.getElementsByTagName("input")[0]; + yearElement.setAttribute("aria-label", self.l10n.yearAriaLabel); + if (self.config.minDate) yearElement.setAttribute("data-min", self.config.minDate.getFullYear().toString()); + + if (self.config.maxDate) { + yearElement.setAttribute("data-max", self.config.maxDate.getFullYear().toString()); + yearElement.disabled = !!self.config.minDate && self.config.minDate.getFullYear() === self.config.maxDate.getFullYear(); + } + + var currentMonth = createElement("div", "flatpickr-current-month"); + currentMonth.appendChild(monthElement); + currentMonth.appendChild(yearInput); + monthNavFragment.appendChild(currentMonth); + container.appendChild(monthNavFragment); + return { + container: container, + yearElement: yearElement, + monthElement: monthElement + }; + } + + function buildMonths() { + clearNode(self.monthNav); + self.monthNav.appendChild(self.prevMonthNav); + + for (var m = self.config.showMonths; m--;) { + var month = buildMonth(); + self.yearElements.push(month.yearElement); + self.monthElements.push(month.monthElement); + self.monthNav.appendChild(month.container); + } + + self.monthNav.appendChild(self.nextMonthNav); + } + + function buildMonthNav() { + self.monthNav = createElement("div", "flatpickr-months"); + self.yearElements = []; + self.monthElements = []; + self.prevMonthNav = createElement("span", "flatpickr-prev-month"); + self.prevMonthNav.innerHTML = self.config.prevArrow; + self.nextMonthNav = createElement("span", "flatpickr-next-month"); + self.nextMonthNav.innerHTML = self.config.nextArrow; + buildMonths(); + Object.defineProperty(self, "_hidePrevMonthArrow", { + get: function get() { + return self.__hidePrevMonthArrow; + }, + set: function set(bool) { + if (self.__hidePrevMonthArrow !== bool) { + toggleClass(self.prevMonthNav, "disabled", bool); + self.__hidePrevMonthArrow = bool; + } + } + }); + Object.defineProperty(self, "_hideNextMonthArrow", { + get: function get() { + return self.__hideNextMonthArrow; + }, + set: function set(bool) { + if (self.__hideNextMonthArrow !== bool) { + toggleClass(self.nextMonthNav, "disabled", bool); + self.__hideNextMonthArrow = bool; + } + } + }); + self.currentYearElement = self.yearElements[0]; + updateNavigationCurrentMonth(); + return self.monthNav; + } + + function buildTime() { + self.calendarContainer.classList.add("hasTime"); + if (self.config.noCalendar) self.calendarContainer.classList.add("noCalendar"); + self.timeContainer = createElement("div", "flatpickr-time"); + self.timeContainer.tabIndex = -1; + var separator = createElement("span", "flatpickr-time-separator", ":"); + var hourInput = createNumberInput("flatpickr-hour"); + self.hourElement = hourInput.getElementsByTagName("input")[0]; + var minuteInput = createNumberInput("flatpickr-minute"); + self.minuteElement = minuteInput.getElementsByTagName("input")[0]; + self.hourElement.tabIndex = self.minuteElement.tabIndex = -1; + self.hourElement.value = pad(self.latestSelectedDateObj ? self.latestSelectedDateObj.getHours() : self.config.time_24hr ? self.config.defaultHour : military2ampm(self.config.defaultHour)); + self.minuteElement.value = pad(self.latestSelectedDateObj ? self.latestSelectedDateObj.getMinutes() : self.config.defaultMinute); + self.hourElement.setAttribute("data-step", self.config.hourIncrement.toString()); + self.minuteElement.setAttribute("data-step", self.config.minuteIncrement.toString()); + self.hourElement.setAttribute("data-min", self.config.time_24hr ? "0" : "1"); + self.hourElement.setAttribute("data-max", self.config.time_24hr ? "23" : "12"); + self.minuteElement.setAttribute("data-min", "0"); + self.minuteElement.setAttribute("data-max", "59"); + self.timeContainer.appendChild(hourInput); + self.timeContainer.appendChild(separator); + self.timeContainer.appendChild(minuteInput); + if (self.config.time_24hr) self.timeContainer.classList.add("time24hr"); + + if (self.config.enableSeconds) { + self.timeContainer.classList.add("hasSeconds"); + var secondInput = createNumberInput("flatpickr-second"); + self.secondElement = secondInput.getElementsByTagName("input")[0]; + self.secondElement.value = pad(self.latestSelectedDateObj ? self.latestSelectedDateObj.getSeconds() : self.config.defaultSeconds); + self.secondElement.setAttribute("data-step", self.minuteElement.getAttribute("data-step")); + self.secondElement.setAttribute("data-min", self.minuteElement.getAttribute("data-min")); + self.secondElement.setAttribute("data-max", self.minuteElement.getAttribute("data-max")); + self.timeContainer.appendChild(createElement("span", "flatpickr-time-separator", ":")); + self.timeContainer.appendChild(secondInput); + } + + if (!self.config.time_24hr) { + self.amPM = createElement("span", "flatpickr-am-pm", self.l10n.amPM[int((self.latestSelectedDateObj ? self.hourElement.value : self.config.defaultHour) > 11)]); + self.amPM.title = self.l10n.toggleTitle; + self.amPM.tabIndex = -1; + self.timeContainer.appendChild(self.amPM); + } + + return self.timeContainer; + } + + function buildWeekdays() { + if (!self.weekdayContainer) self.weekdayContainer = createElement("div", "flatpickr-weekdays");else clearNode(self.weekdayContainer); + + for (var i = self.config.showMonths; i--;) { + var container = createElement("div", "flatpickr-weekdaycontainer"); + self.weekdayContainer.appendChild(container); + } + + updateWeekdays(); + return self.weekdayContainer; + } + + function updateWeekdays() { + var firstDayOfWeek = self.l10n.firstDayOfWeek; + var weekdays = self.l10n.weekdays.shorthand.concat(); + + if (firstDayOfWeek > 0 && firstDayOfWeek < weekdays.length) { + weekdays = weekdays.splice(firstDayOfWeek, weekdays.length).concat(weekdays.splice(0, firstDayOfWeek)); + } + + for (var i = self.config.showMonths; i--;) { + self.weekdayContainer.children[i].innerHTML = "\n \n " + weekdays.join("") + "\n \n "; + } + } + + function buildWeeks() { + self.calendarContainer.classList.add("hasWeeks"); + var weekWrapper = createElement("div", "flatpickr-weekwrapper"); + weekWrapper.appendChild(createElement("span", "flatpickr-weekday", self.l10n.weekAbbreviation)); + var weekNumbers = createElement("div", "flatpickr-weeks"); + weekWrapper.appendChild(weekNumbers); + return { + weekWrapper: weekWrapper, + weekNumbers: weekNumbers + }; + } + + function changeMonth(value, is_offset) { + if (is_offset === void 0) { + is_offset = true; + } + + var delta = is_offset ? value : value - self.currentMonth; + if (delta < 0 && self._hidePrevMonthArrow === true || delta > 0 && self._hideNextMonthArrow === true) return; + self.currentMonth += delta; + + if (self.currentMonth < 0 || self.currentMonth > 11) { + self.currentYear += self.currentMonth > 11 ? 1 : -1; + self.currentMonth = (self.currentMonth + 12) % 12; + triggerEvent("onYearChange"); + } + + buildDays(); + triggerEvent("onMonthChange"); + updateNavigationCurrentMonth(); + } + + function clear(triggerChangeEvent) { + if (triggerChangeEvent === void 0) { + triggerChangeEvent = true; + } + + self.input.value = ""; + if (self.altInput !== undefined) self.altInput.value = ""; + if (self.mobileInput !== undefined) self.mobileInput.value = ""; + self.selectedDates = []; + self.latestSelectedDateObj = undefined; + self.showTimeInput = false; + + if (self.config.enableTime === true) { + setDefaultHours(); + } + + self.redraw(); + if (triggerChangeEvent) triggerEvent("onChange"); + } + + function close() { + self.isOpen = false; + + if (!self.isMobile) { + self.calendarContainer.classList.remove("open"); + + self._input.classList.remove("active"); + } + + triggerEvent("onClose"); + } + + function destroy() { + if (self.config !== undefined) triggerEvent("onDestroy"); + + for (var i = self._handlers.length; i--;) { + var h = self._handlers[i]; + h.element.removeEventListener(h.event, h.handler, h.options); + } + + self._handlers = []; + + if (self.mobileInput) { + if (self.mobileInput.parentNode) self.mobileInput.parentNode.removeChild(self.mobileInput); + self.mobileInput = undefined; + } else if (self.calendarContainer && self.calendarContainer.parentNode) { + if (self.config.static && self.calendarContainer.parentNode) { + var wrapper = self.calendarContainer.parentNode; + wrapper.lastChild && wrapper.removeChild(wrapper.lastChild); + + if (wrapper.parentNode) { + while (wrapper.firstChild) { + wrapper.parentNode.insertBefore(wrapper.firstChild, wrapper); + } + + wrapper.parentNode.removeChild(wrapper); + } + } else self.calendarContainer.parentNode.removeChild(self.calendarContainer); + } + + if (self.altInput) { + self.input.type = "text"; + if (self.altInput.parentNode) self.altInput.parentNode.removeChild(self.altInput); + delete self.altInput; + } + + if (self.input) { + self.input.type = self.input._type; + self.input.classList.remove("flatpickr-input"); + self.input.removeAttribute("readonly"); + self.input.value = ""; + } + + ["_showTimeInput", "latestSelectedDateObj", "_hideNextMonthArrow", "_hidePrevMonthArrow", "__hideNextMonthArrow", "__hidePrevMonthArrow", "isMobile", "isOpen", "selectedDateElem", "minDateHasTime", "maxDateHasTime", "days", "daysContainer", "_input", "_positionElement", "innerContainer", "rContainer", "monthNav", "todayDateElem", "calendarContainer", "weekdayContainer", "prevMonthNav", "nextMonthNav", "currentMonthElement", "currentYearElement", "navigationCurrentMonth", "selectedDateElem", "config"].forEach(function (k) { + try { + delete self[k]; + } catch (_) {} + }); + } + + function isCalendarElem(elem) { + if (self.config.appendTo && self.config.appendTo.contains(elem)) return true; + return self.calendarContainer.contains(elem); + } + + function documentClick(e) { + if (self.isOpen && !self.config.inline) { + var isCalendarElement = isCalendarElem(e.target); + var isInput = e.target === self.input || e.target === self.altInput || self.element.contains(e.target) || e.path && e.path.indexOf && (~e.path.indexOf(self.input) || ~e.path.indexOf(self.altInput)); + var lostFocus = e.type === "blur" ? isInput && e.relatedTarget && !isCalendarElem(e.relatedTarget) : !isInput && !isCalendarElement; + var isIgnored = !self.config.ignoredFocusElements.some(function (elem) { + return elem.contains(e.target); + }); + + if (lostFocus && isIgnored) { + self.close(); + + if (self.config.mode === "range" && self.selectedDates.length === 1) { + self.clear(false); + self.redraw(); + } + } + } + } + + function changeYear(newYear) { + if (!newYear || self.config.minDate && newYear < self.config.minDate.getFullYear() || self.config.maxDate && newYear > self.config.maxDate.getFullYear()) return; + var newYearNum = newYear, + isNewYear = self.currentYear !== newYearNum; + self.currentYear = newYearNum || self.currentYear; + + if (self.config.maxDate && self.currentYear === self.config.maxDate.getFullYear()) { + self.currentMonth = Math.min(self.config.maxDate.getMonth(), self.currentMonth); + } else if (self.config.minDate && self.currentYear === self.config.minDate.getFullYear()) { + self.currentMonth = Math.max(self.config.minDate.getMonth(), self.currentMonth); + } + + if (isNewYear) { + self.redraw(); + triggerEvent("onYearChange"); + } + } + + function isEnabled(date, timeless) { + if (timeless === void 0) { + timeless = true; + } + + var dateToCheck = self.parseDate(date, undefined, timeless); + if (self.config.minDate && dateToCheck && compareDates(dateToCheck, self.config.minDate, timeless !== undefined ? timeless : !self.minDateHasTime) < 0 || self.config.maxDate && dateToCheck && compareDates(dateToCheck, self.config.maxDate, timeless !== undefined ? timeless : !self.maxDateHasTime) > 0) return false; + if (self.config.enable.length === 0 && self.config.disable.length === 0) return true; + if (dateToCheck === undefined) return false; + var bool = self.config.enable.length > 0, + array = bool ? self.config.enable : self.config.disable; + + for (var i = 0, d; i < array.length; i++) { + d = array[i]; + if (typeof d === "function" && d(dateToCheck)) return bool;else if (d instanceof Date && dateToCheck !== undefined && d.getTime() === dateToCheck.getTime()) return bool;else if (typeof d === "string" && dateToCheck !== undefined) { + var parsed = self.parseDate(d, undefined, true); + return parsed && parsed.getTime() === dateToCheck.getTime() ? bool : !bool; + } else if (typeof d === "object" && dateToCheck !== undefined && d.from && d.to && dateToCheck.getTime() >= d.from.getTime() && dateToCheck.getTime() <= d.to.getTime()) return bool; + } + + return !bool; + } + + function isInView(elem) { + if (self.daysContainer !== undefined) return elem.className.indexOf("hidden") === -1 && self.daysContainer.contains(elem); + return false; + } + + function onKeyDown(e) { + var isInput = e.target === self._input; + var allowInput = self.config.allowInput; + var allowKeydown = self.isOpen && (!allowInput || !isInput); + var allowInlineKeydown = self.config.inline && isInput && !allowInput; + + if (e.keyCode === 13 && isInput) { + if (allowInput) { + self.setDate(self._input.value, true, e.target === self.altInput ? self.config.altFormat : self.config.dateFormat); + return e.target.blur(); + } else self.open(); + } else if (isCalendarElem(e.target) || allowKeydown || allowInlineKeydown) { + var isTimeObj = !!self.timeContainer && self.timeContainer.contains(e.target); + + switch (e.keyCode) { + case 13: + if (isTimeObj) updateTime();else selectDate(e); + break; + + case 27: + e.preventDefault(); + focusAndClose(); + break; + + case 8: + case 46: + if (isInput && !self.config.allowInput) { + e.preventDefault(); + self.clear(); + } + + break; + + case 37: + case 39: + if (!isTimeObj) { + e.preventDefault(); + + if (self.daysContainer !== undefined && (allowInput === false || isInView(document.activeElement))) { + var _delta = e.keyCode === 39 ? 1 : -1; + + if (!e.ctrlKey) focusOnDay(undefined, _delta);else { + changeMonth(_delta); + focusOnDay(getFirstAvailableDay(1), 0); + } + } + } else if (self.hourElement) self.hourElement.focus(); + + break; + + case 38: + case 40: + e.preventDefault(); + var delta = e.keyCode === 40 ? 1 : -1; + + if (self.daysContainer && e.target.$i !== undefined) { + if (e.ctrlKey) { + changeYear(self.currentYear - delta); + focusOnDay(getFirstAvailableDay(1), 0); + } else if (!isTimeObj) focusOnDay(undefined, delta * 7); + } else if (self.config.enableTime) { + if (!isTimeObj && self.hourElement) self.hourElement.focus(); + updateTime(e); + + self._debouncedChange(); + } + + break; + + case 9: + if (!isTimeObj) { + self.element.focus(); + break; + } + + var elems = [self.hourElement, self.minuteElement, self.secondElement, self.amPM].filter(function (x) { + return x; + }); + var i = elems.indexOf(e.target); + + if (i !== -1) { + var target = elems[i + (e.shiftKey ? -1 : 1)]; + + if (target !== undefined) { + e.preventDefault(); + target.focus(); + } else { + self.element.focus(); + } + } + + break; + + default: + break; + } + } + + if (self.amPM !== undefined && e.target === self.amPM) { + switch (e.key) { + case self.l10n.amPM[0].charAt(0): + case self.l10n.amPM[0].charAt(0).toLowerCase(): + self.amPM.textContent = self.l10n.amPM[0]; + setHoursFromInputs(); + updateValue(); + break; + + case self.l10n.amPM[1].charAt(0): + case self.l10n.amPM[1].charAt(0).toLowerCase(): + self.amPM.textContent = self.l10n.amPM[1]; + setHoursFromInputs(); + updateValue(); + break; + } + } + + triggerEvent("onKeyDown", e); + } + + function onMouseOver(elem) { + if (self.selectedDates.length !== 1 || elem && (!elem.classList.contains("flatpickr-day") || elem.classList.contains("disabled"))) return; + var hoverDate = elem ? elem.dateObj.getTime() : self.days.firstElementChild.dateObj.getTime(), + initialDate = self.parseDate(self.selectedDates[0], undefined, true).getTime(), + rangeStartDate = Math.min(hoverDate, self.selectedDates[0].getTime()), + rangeEndDate = Math.max(hoverDate, self.selectedDates[0].getTime()), + lastDate = self.daysContainer.lastChild.lastChild.dateObj.getTime(); + var containsDisabled = false; + var minRange = 0, + maxRange = 0; + + for (var t = rangeStartDate; t < lastDate; t += duration.DAY) { + if (!isEnabled(new Date(t), true)) { + containsDisabled = containsDisabled || t > rangeStartDate && t < rangeEndDate; + if (t < initialDate && (!minRange || t > minRange)) minRange = t;else if (t > initialDate && (!maxRange || t < maxRange)) maxRange = t; + } + } + + for (var m = 0; m < self.config.showMonths; m++) { + var month = self.daysContainer.children[m]; + var prevMonth = self.daysContainer.children[m - 1]; + + var _loop = function _loop(i, l) { + var dayElem = month.children[i], + date = dayElem.dateObj; + var timestamp = date.getTime(); + var outOfRange = minRange > 0 && timestamp < minRange || maxRange > 0 && timestamp > maxRange; + + if (outOfRange) { + dayElem.classList.add("notAllowed"); + ["inRange", "startRange", "endRange"].forEach(function (c) { + dayElem.classList.remove(c); + }); + return "continue"; + } else if (containsDisabled && !outOfRange) return "continue"; + + ["startRange", "inRange", "endRange", "notAllowed"].forEach(function (c) { + dayElem.classList.remove(c); + }); + + if (elem !== undefined) { + elem.classList.add(hoverDate < self.selectedDates[0].getTime() ? "startRange" : "endRange"); + + if (month.contains(elem) || !(m > 0 && prevMonth && prevMonth.lastChild.dateObj.getTime() >= timestamp)) { + if (initialDate < hoverDate && timestamp === initialDate) dayElem.classList.add("startRange");else if (initialDate > hoverDate && timestamp === initialDate) dayElem.classList.add("endRange"); + if (timestamp >= minRange && (maxRange === 0 || timestamp <= maxRange) && isBetween(timestamp, initialDate, hoverDate)) dayElem.classList.add("inRange"); + } + } + }; + + for (var i = 0, l = month.children.length; i < l; i++) { + var _ret = _loop(i, l); + + if (_ret === "continue") continue; + } + } + } + + function onResize() { + if (self.isOpen && !self.config.static && !self.config.inline) positionCalendar(); + } + + function open(e, positionElement) { + if (positionElement === void 0) { + positionElement = self._positionElement; + } + + if (self.isMobile === true) { + if (e) { + e.preventDefault(); + e.target && e.target.blur(); + } + + if (self.mobileInput !== undefined) { + self.mobileInput.focus(); + self.mobileInput.click(); + } + + triggerEvent("onOpen"); + return; + } + + if (self._input.disabled || self.config.inline) return; + var wasOpen = self.isOpen; + self.isOpen = true; + + if (!wasOpen) { + self.calendarContainer.classList.add("open"); + + self._input.classList.add("active"); + + triggerEvent("onOpen"); + positionCalendar(positionElement); + } + + if (self.config.enableTime === true && self.config.noCalendar === true) { + if (self.selectedDates.length === 0) { + self.setDate(self.config.minDate !== undefined ? new Date(self.config.minDate.getTime()) : new Date(), false); + setDefaultHours(); + updateValue(); + } + + if (self.config.allowInput === false && (e === undefined || !self.timeContainer.contains(e.relatedTarget))) { + setTimeout(function () { + return self.hourElement.select(); + }, 50); + } + } + } + + function minMaxDateSetter(type) { + return function (date) { + var dateObj = self.config["_" + type + "Date"] = self.parseDate(date, self.config.dateFormat); + var inverseDateObj = self.config["_" + (type === "min" ? "max" : "min") + "Date"]; + + if (dateObj !== undefined) { + self[type === "min" ? "minDateHasTime" : "maxDateHasTime"] = dateObj.getHours() > 0 || dateObj.getMinutes() > 0 || dateObj.getSeconds() > 0; + } + + if (self.selectedDates) { + self.selectedDates = self.selectedDates.filter(function (d) { + return isEnabled(d); + }); + if (!self.selectedDates.length && type === "min") setHoursFromDate(dateObj); + updateValue(); + } + + if (self.daysContainer) { + redraw(); + if (dateObj !== undefined) self.currentYearElement[type] = dateObj.getFullYear().toString();else self.currentYearElement.removeAttribute(type); + self.currentYearElement.disabled = !!inverseDateObj && dateObj !== undefined && inverseDateObj.getFullYear() === dateObj.getFullYear(); + } + }; + } + + function parseConfig() { + var boolOpts = ["wrap", "weekNumbers", "allowInput", "clickOpens", "time_24hr", "enableTime", "noCalendar", "altInput", "shorthandCurrentMonth", "inline", "static", "enableSeconds", "disableMobile"]; + var userConfig = Object.assign({}, instanceConfig, JSON.parse(JSON.stringify(element.dataset || {}))); + var formats$$1 = {}; + self.config.parseDate = userConfig.parseDate; + self.config.formatDate = userConfig.formatDate; + Object.defineProperty(self.config, "enable", { + get: function get() { + return self.config._enable; + }, + set: function set(dates) { + self.config._enable = parseDateRules(dates); + } + }); + Object.defineProperty(self.config, "disable", { + get: function get() { + return self.config._disable; + }, + set: function set(dates) { + self.config._disable = parseDateRules(dates); + } + }); + var timeMode = userConfig.mode === "time"; + + if (!userConfig.dateFormat && (userConfig.enableTime || timeMode)) { + formats$$1.dateFormat = userConfig.noCalendar || timeMode ? "H:i" + (userConfig.enableSeconds ? ":S" : "") : flatpickr.defaultConfig.dateFormat + " H:i" + (userConfig.enableSeconds ? ":S" : ""); + } + + if (userConfig.altInput && (userConfig.enableTime || timeMode) && !userConfig.altFormat) { + formats$$1.altFormat = userConfig.noCalendar || timeMode ? "h:i" + (userConfig.enableSeconds ? ":S K" : " K") : flatpickr.defaultConfig.altFormat + (" h:i" + (userConfig.enableSeconds ? ":S" : "") + " K"); + } + + Object.defineProperty(self.config, "minDate", { + get: function get() { + return self.config._minDate; + }, + set: minMaxDateSetter("min") + }); + Object.defineProperty(self.config, "maxDate", { + get: function get() { + return self.config._maxDate; + }, + set: minMaxDateSetter("max") + }); + + var minMaxTimeSetter = function minMaxTimeSetter(type) { + return function (val) { + self.config[type === "min" ? "_minTime" : "_maxTime"] = self.parseDate(val, "H:i"); + }; + }; + + Object.defineProperty(self.config, "minTime", { + get: function get() { + return self.config._minTime; + }, + set: minMaxTimeSetter("min") + }); + Object.defineProperty(self.config, "maxTime", { + get: function get() { + return self.config._maxTime; + }, + set: minMaxTimeSetter("max") + }); + + if (userConfig.mode === "time") { + self.config.noCalendar = true; + self.config.enableTime = true; + } + + Object.assign(self.config, formats$$1, userConfig); + + for (var i = 0; i < boolOpts.length; i++) { + self.config[boolOpts[i]] = self.config[boolOpts[i]] === true || self.config[boolOpts[i]] === "true"; + } + + HOOKS.filter(function (hook) { + return self.config[hook] !== undefined; + }).forEach(function (hook) { + self.config[hook] = arrayify(self.config[hook] || []).map(bindToInstance); + }); + self.isMobile = !self.config.disableMobile && !self.config.inline && self.config.mode === "single" && !self.config.disable.length && !self.config.enable.length && !self.config.weekNumbers && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); + + for (var _i = 0; _i < self.config.plugins.length; _i++) { + var pluginConf = self.config.plugins[_i](self) || {}; + + for (var key in pluginConf) { + if (HOOKS.indexOf(key) > -1) { + self.config[key] = arrayify(pluginConf[key]).map(bindToInstance).concat(self.config[key]); + } else if (typeof userConfig[key] === "undefined") self.config[key] = pluginConf[key]; + } + } + + triggerEvent("onParseConfig"); + } + + function setupLocale() { + if (typeof self.config.locale !== "object" && typeof flatpickr.l10ns[self.config.locale] === "undefined") self.config.errorHandler(new Error("flatpickr: invalid locale " + self.config.locale)); + self.l10n = Object.assign({}, flatpickr.l10ns.default, typeof self.config.locale === "object" ? self.config.locale : self.config.locale !== "default" ? flatpickr.l10ns[self.config.locale] : undefined); + tokenRegex.K = "(" + self.l10n.amPM[0] + "|" + self.l10n.amPM[1] + "|" + self.l10n.amPM[0].toLowerCase() + "|" + self.l10n.amPM[1].toLowerCase() + ")"; + self.formatDate = createDateFormatter(self); + self.parseDate = createDateParser({ + config: self.config, + l10n: self.l10n + }); + } + + function positionCalendar(customPositionElement) { + if (self.calendarContainer === undefined) return; + triggerEvent("onPreCalendarPosition"); + var positionElement = customPositionElement || self._positionElement; + var calendarHeight = Array.prototype.reduce.call(self.calendarContainer.children, function (acc, child) { + return acc + child.offsetHeight; + }, 0), + calendarWidth = self.calendarContainer.offsetWidth, + configPos = self.config.position.split(" "), + configPosVertical = configPos[0], + configPosHorizontal = configPos.length > 1 ? configPos[1] : null, + inputBounds = positionElement.getBoundingClientRect(), + distanceFromBottom = window.innerHeight - inputBounds.bottom, + showOnTop = configPosVertical === "above" || configPosVertical !== "below" && distanceFromBottom < calendarHeight && inputBounds.top > calendarHeight; + var top = window.pageYOffset + inputBounds.top + (!showOnTop ? positionElement.offsetHeight + 2 : -calendarHeight - 2); + toggleClass(self.calendarContainer, "arrowTop", !showOnTop); + toggleClass(self.calendarContainer, "arrowBottom", showOnTop); + if (self.config.inline) return; + var left = window.pageXOffset + inputBounds.left - (configPosHorizontal != null && configPosHorizontal === "center" ? (calendarWidth - inputBounds.width) / 2 : 0); + var right = window.document.body.offsetWidth - inputBounds.right; + var rightMost = left + calendarWidth > window.document.body.offsetWidth; + toggleClass(self.calendarContainer, "rightMost", rightMost); + if (self.config.static) return; + self.calendarContainer.style.top = top + "px"; + + if (!rightMost) { + self.calendarContainer.style.left = left + "px"; + self.calendarContainer.style.right = "auto"; + } else { + self.calendarContainer.style.left = "auto"; + self.calendarContainer.style.right = right + "px"; + } + } + + function redraw() { + if (self.config.noCalendar || self.isMobile) return; + updateNavigationCurrentMonth(); + buildDays(); + } + + function focusAndClose() { + self._input.focus(); + + if (window.navigator.userAgent.indexOf("MSIE") !== -1 || navigator.msMaxTouchPoints !== undefined) { + setTimeout(self.close, 0); + } else { + self.close(); + } + } + + function selectDate(e) { + e.preventDefault(); + e.stopPropagation(); + + var isSelectable = function isSelectable(day) { + return day.classList && day.classList.contains("flatpickr-day") && !day.classList.contains("disabled") && !day.classList.contains("notAllowed"); + }; + + var t = findParent(e.target, isSelectable); + if (t === undefined) return; + var target = t; + var selectedDate = self.latestSelectedDateObj = new Date(target.dateObj.getTime()); + var shouldChangeMonth = (selectedDate.getMonth() < self.currentMonth || selectedDate.getMonth() > self.currentMonth + self.config.showMonths - 1) && self.config.mode !== "range"; + self.selectedDateElem = target; + if (self.config.mode === "single") self.selectedDates = [selectedDate];else if (self.config.mode === "multiple") { + var selectedIndex = isDateSelected(selectedDate); + if (selectedIndex) self.selectedDates.splice(parseInt(selectedIndex), 1);else self.selectedDates.push(selectedDate); + } else if (self.config.mode === "range") { + if (self.selectedDates.length === 2) self.clear(false); + self.selectedDates.push(selectedDate); + if (compareDates(selectedDate, self.selectedDates[0], true) !== 0) self.selectedDates.sort(function (a, b) { + return a.getTime() - b.getTime(); + }); + } + setHoursFromInputs(); + + if (shouldChangeMonth) { + var isNewYear = self.currentYear !== selectedDate.getFullYear(); + self.currentYear = selectedDate.getFullYear(); + self.currentMonth = selectedDate.getMonth(); + if (isNewYear) triggerEvent("onYearChange"); + triggerEvent("onMonthChange"); + } + + updateNavigationCurrentMonth(); + buildDays(); + updateValue(); + if (self.config.enableTime) setTimeout(function () { + return self.showTimeInput = true; + }, 50); + if (!shouldChangeMonth && self.config.mode !== "range" && self.config.showMonths === 1) focusOnDayElem(target);else self.selectedDateElem && self.selectedDateElem.focus(); + if (self.hourElement !== undefined) setTimeout(function () { + return self.hourElement !== undefined && self.hourElement.select(); + }, 451); + + if (self.config.closeOnSelect) { + var single = self.config.mode === "single" && !self.config.enableTime; + var range = self.config.mode === "range" && self.selectedDates.length === 2 && !self.config.enableTime; + + if (single || range) { + focusAndClose(); + } + } + + triggerChange(); + } + + var CALLBACKS = { + locale: [setupLocale, updateWeekdays], + showMonths: [buildMonths, setCalendarWidth, buildWeekdays] + }; + + function set(option, value) { + if (option !== null && typeof option === "object") Object.assign(self.config, option);else { + self.config[option] = value; + if (CALLBACKS[option] !== undefined) CALLBACKS[option].forEach(function (x) { + return x(); + });else if (HOOKS.indexOf(option) > -1) self.config[option] = arrayify(value); + } + self.redraw(); + jumpToDate(); + updateValue(false); + } + + function setSelectedDate(inputDate, format) { + var dates = []; + if (inputDate instanceof Array) dates = inputDate.map(function (d) { + return self.parseDate(d, format); + });else if (inputDate instanceof Date || typeof inputDate === "number") dates = [self.parseDate(inputDate, format)];else if (typeof inputDate === "string") { + switch (self.config.mode) { + case "single": + case "time": + dates = [self.parseDate(inputDate, format)]; + break; + + case "multiple": + dates = inputDate.split(self.config.conjunction).map(function (date) { + return self.parseDate(date, format); + }); + break; + + case "range": + dates = inputDate.split(self.l10n.rangeSeparator).map(function (date) { + return self.parseDate(date, format); + }); + break; + + default: + break; + } + } else self.config.errorHandler(new Error("Invalid date supplied: " + JSON.stringify(inputDate))); + self.selectedDates = dates.filter(function (d) { + return d instanceof Date && isEnabled(d, false); + }); + if (self.config.mode === "range") self.selectedDates.sort(function (a, b) { + return a.getTime() - b.getTime(); + }); + } + + function setDate(date, triggerChange, format) { + if (triggerChange === void 0) { + triggerChange = false; + } + + if (format === void 0) { + format = self.config.dateFormat; + } + + if (date !== 0 && !date || date instanceof Array && date.length === 0) return self.clear(triggerChange); + setSelectedDate(date, format); + self.showTimeInput = self.selectedDates.length > 0; + self.latestSelectedDateObj = self.selectedDates[0]; + self.redraw(); + jumpToDate(); + setHoursFromDate(); + updateValue(triggerChange); + if (triggerChange) triggerEvent("onChange"); + } + + function parseDateRules(arr) { + return arr.slice().map(function (rule) { + if (typeof rule === "string" || typeof rule === "number" || rule instanceof Date) { + return self.parseDate(rule, undefined, true); + } else if (rule && typeof rule === "object" && rule.from && rule.to) return { + from: self.parseDate(rule.from, undefined), + to: self.parseDate(rule.to, undefined) + }; + + return rule; + }).filter(function (x) { + return x; + }); + } + + function setupDates() { + self.selectedDates = []; + self.now = self.parseDate(self.config.now) || new Date(); + var preloadedDate = self.config.defaultDate || ((self.input.nodeName === "INPUT" || self.input.nodeName === "TEXTAREA") && self.input.placeholder && self.input.value === self.input.placeholder ? null : self.input.value); + if (preloadedDate) setSelectedDate(preloadedDate, self.config.dateFormat); + var initialDate = self.selectedDates.length > 0 ? self.selectedDates[0] : self.config.minDate && self.config.minDate.getTime() > self.now.getTime() ? self.config.minDate : self.config.maxDate && self.config.maxDate.getTime() < self.now.getTime() ? self.config.maxDate : self.now; + self.currentYear = initialDate.getFullYear(); + self.currentMonth = initialDate.getMonth(); + if (self.selectedDates.length > 0) self.latestSelectedDateObj = self.selectedDates[0]; + if (self.config.minTime !== undefined) self.config.minTime = self.parseDate(self.config.minTime, "H:i"); + if (self.config.maxTime !== undefined) self.config.maxTime = self.parseDate(self.config.maxTime, "H:i"); + self.minDateHasTime = !!self.config.minDate && (self.config.minDate.getHours() > 0 || self.config.minDate.getMinutes() > 0 || self.config.minDate.getSeconds() > 0); + self.maxDateHasTime = !!self.config.maxDate && (self.config.maxDate.getHours() > 0 || self.config.maxDate.getMinutes() > 0 || self.config.maxDate.getSeconds() > 0); + Object.defineProperty(self, "showTimeInput", { + get: function get() { + return self._showTimeInput; + }, + set: function set(bool) { + self._showTimeInput = bool; + if (self.calendarContainer) toggleClass(self.calendarContainer, "showTimeInput", bool); + self.isOpen && positionCalendar(); + } + }); + } + + function setupInputs() { + self.input = self.config.wrap ? element.querySelector("[data-input]") : element; + + if (!self.input) { + self.config.errorHandler(new Error("Invalid input element specified")); + return; + } + + self.input._type = self.input.type; + self.input.type = "text"; + self.input.classList.add("flatpickr-input"); + self._input = self.input; + + if (self.config.altInput) { + self.altInput = createElement(self.input.nodeName, self.input.className + " " + self.config.altInputClass); + self._input = self.altInput; + self.altInput.placeholder = self.input.placeholder; + self.altInput.disabled = self.input.disabled; + self.altInput.required = self.input.required; + self.altInput.tabIndex = self.input.tabIndex; + self.altInput.type = "text"; + self.input.setAttribute("type", "hidden"); + if (!self.config.static && self.input.parentNode) self.input.parentNode.insertBefore(self.altInput, self.input.nextSibling); + } + + if (!self.config.allowInput) self._input.setAttribute("readonly", "readonly"); + self._positionElement = self.config.positionElement || self._input; + } + + function setupMobile() { + var inputType = self.config.enableTime ? self.config.noCalendar ? "time" : "datetime-local" : "date"; + self.mobileInput = createElement("input", self.input.className + " flatpickr-mobile"); + self.mobileInput.step = self.input.getAttribute("step") || "any"; + self.mobileInput.tabIndex = 1; + self.mobileInput.type = inputType; + self.mobileInput.disabled = self.input.disabled; + self.mobileInput.required = self.input.required; + self.mobileInput.placeholder = self.input.placeholder; + self.mobileFormatStr = inputType === "datetime-local" ? "Y-m-d\\TH:i:S" : inputType === "date" ? "Y-m-d" : "H:i:S"; + + if (self.selectedDates.length > 0) { + self.mobileInput.defaultValue = self.mobileInput.value = self.formatDate(self.selectedDates[0], self.mobileFormatStr); + } + + if (self.config.minDate) self.mobileInput.min = self.formatDate(self.config.minDate, "Y-m-d"); + if (self.config.maxDate) self.mobileInput.max = self.formatDate(self.config.maxDate, "Y-m-d"); + self.input.type = "hidden"; + if (self.altInput !== undefined) self.altInput.type = "hidden"; + + try { + if (self.input.parentNode) self.input.parentNode.insertBefore(self.mobileInput, self.input.nextSibling); + } catch (_a) {} + + bind(self.mobileInput, "change", function (e) { + self.setDate(e.target.value, false, self.mobileFormatStr); + triggerEvent("onChange"); + triggerEvent("onClose"); + }); + } + + function toggle(e) { + if (self.isOpen === true) return self.close(); + self.open(e); + } + + function triggerEvent(event, data) { + if (self.config === undefined) return; + var hooks = self.config[event]; + + if (hooks !== undefined && hooks.length > 0) { + for (var i = 0; hooks[i] && i < hooks.length; i++) { + hooks[i](self.selectedDates, self.input.value, self, data); + } + } + + if (event === "onChange") { + self.input.dispatchEvent(createEvent("change")); + self.input.dispatchEvent(createEvent("input")); + } + } + + function createEvent(name) { + var e = document.createEvent("Event"); + e.initEvent(name, true, true); + return e; + } + + function isDateSelected(date) { + for (var i = 0; i < self.selectedDates.length; i++) { + if (compareDates(self.selectedDates[i], date) === 0) return "" + i; + } + + return false; + } + + function isDateInRange(date) { + if (self.config.mode !== "range" || self.selectedDates.length < 2) return false; + return compareDates(date, self.selectedDates[0]) >= 0 && compareDates(date, self.selectedDates[1]) <= 0; + } + + function updateNavigationCurrentMonth() { + if (self.config.noCalendar || self.isMobile || !self.monthNav) return; + self.yearElements.forEach(function (yearElement, i) { + var d = new Date(self.currentYear, self.currentMonth, 1); + d.setMonth(self.currentMonth + i); + self.monthElements[i].textContent = monthToStr(d.getMonth(), self.config.shorthandCurrentMonth, self.l10n) + " "; + yearElement.value = d.getFullYear().toString(); + }); + self._hidePrevMonthArrow = self.config.minDate !== undefined && (self.currentYear === self.config.minDate.getFullYear() ? self.currentMonth <= self.config.minDate.getMonth() : self.currentYear < self.config.minDate.getFullYear()); + self._hideNextMonthArrow = self.config.maxDate !== undefined && (self.currentYear === self.config.maxDate.getFullYear() ? self.currentMonth + 1 > self.config.maxDate.getMonth() : self.currentYear > self.config.maxDate.getFullYear()); + } + + function getDateStr(format) { + return self.selectedDates.map(function (dObj) { + return self.formatDate(dObj, format); + }).filter(function (d, i, arr) { + return self.config.mode !== "range" || self.config.enableTime || arr.indexOf(d) === i; + }).join(self.config.mode !== "range" ? self.config.conjunction : self.l10n.rangeSeparator); + } + + function updateValue(triggerChange) { + if (triggerChange === void 0) { + triggerChange = true; + } + + if (self.selectedDates.length === 0) return self.clear(triggerChange); + + if (self.mobileInput !== undefined && self.mobileFormatStr) { + self.mobileInput.value = self.latestSelectedDateObj !== undefined ? self.formatDate(self.latestSelectedDateObj, self.mobileFormatStr) : ""; + } + + self.input.value = getDateStr(self.config.dateFormat); + + if (self.altInput !== undefined) { + self.altInput.value = getDateStr(self.config.altFormat); + } + + if (triggerChange !== false) triggerEvent("onValueUpdate"); + } + + function onMonthNavClick(e) { + e.preventDefault(); + var isPrevMonth = self.prevMonthNav.contains(e.target); + var isNextMonth = self.nextMonthNav.contains(e.target); + + if (isPrevMonth || isNextMonth) { + changeMonth(isPrevMonth ? -1 : 1); + } else if (self.yearElements.indexOf(e.target) >= 0) { + e.target.select(); + } else if (e.target.classList.contains("arrowUp")) { + self.changeYear(self.currentYear + 1); + } else if (e.target.classList.contains("arrowDown")) { + self.changeYear(self.currentYear - 1); + } + } + + function timeWrapper(e) { + e.preventDefault(); + var isKeyDown = e.type === "keydown", + input = e.target; + + if (self.amPM !== undefined && e.target === self.amPM) { + self.amPM.textContent = self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])]; + } + + var min = parseFloat(input.getAttribute("data-min")), + max = parseFloat(input.getAttribute("data-max")), + step = parseFloat(input.getAttribute("data-step")), + curValue = parseInt(input.value, 10), + delta = e.delta || (isKeyDown ? e.which === 38 ? 1 : -1 : 0); + var newValue = curValue + step * delta; + + if (typeof input.value !== "undefined" && input.value.length === 2) { + var isHourElem = input === self.hourElement, + isMinuteElem = input === self.minuteElement; + + if (newValue < min) { + newValue = max + newValue + int(!isHourElem) + (int(isHourElem) && int(!self.amPM)); + if (isMinuteElem) incrementNumInput(undefined, -1, self.hourElement); + } else if (newValue > max) { + newValue = input === self.hourElement ? newValue - max - int(!self.amPM) : min; + if (isMinuteElem) incrementNumInput(undefined, 1, self.hourElement); + } + + if (self.amPM && isHourElem && (step === 1 ? newValue + curValue === 23 : Math.abs(newValue - curValue) > step)) { + self.amPM.textContent = self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])]; + } + + input.value = pad(newValue); + } + } + + init(); + return self; + } + + function _flatpickr(nodeList, config) { + var nodes = Array.prototype.slice.call(nodeList); + var instances = []; + + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + + try { + if (node.getAttribute("data-fp-omit") !== null) continue; + + if (node._flatpickr !== undefined) { + node._flatpickr.destroy(); + + node._flatpickr = undefined; + } + + node._flatpickr = FlatpickrInstance(node, config || {}); + instances.push(node._flatpickr); + } catch (e) { + console.error(e); + } + } + + return instances.length === 1 ? instances[0] : instances; + } + + if (typeof HTMLElement !== "undefined") { + HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function (config) { + return _flatpickr(this, config); + }; + + HTMLElement.prototype.flatpickr = function (config) { + return _flatpickr([this], config); + }; + } + + var flatpickr = function flatpickr(selector, config) { + if (selector instanceof NodeList) return _flatpickr(selector, config);else if (typeof selector === "string") return _flatpickr(window.document.querySelectorAll(selector), config); + return _flatpickr([selector], config); + }; + + flatpickr.defaultConfig = defaults; + flatpickr.l10ns = { + en: Object.assign({}, english), + default: Object.assign({}, english) + }; + + flatpickr.localize = function (l10n) { + flatpickr.l10ns.default = Object.assign({}, flatpickr.l10ns.default, l10n); + }; + + flatpickr.setDefaults = function (config) { + flatpickr.defaultConfig = Object.assign({}, flatpickr.defaultConfig, config); + }; + + flatpickr.parseDate = createDateParser({}); + flatpickr.formatDate = createDateFormatter({}); + flatpickr.compareDates = compareDates; + + if (typeof jQuery !== "undefined") { + jQuery.fn.flatpickr = function (config) { + return _flatpickr(this, config); + }; + } + + Date.prototype.fp_incr = function (days) { + return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof days === "string" ? parseInt(days, 10) : days)); + }; + + if (typeof window !== "undefined") { + window.flatpickr = flatpickr; + } + + return flatpickr; + +}))); + + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(4); +__webpack_require__(62); +module.exports = __webpack_require__(63); + + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +Vue.component("flash-wrapper", __webpack_require__(5)); +Vue.component("flash", __webpack_require__(8)); +Vue.component("tabs", __webpack_require__(11)); +Vue.component("tab", __webpack_require__(14)); +Vue.component("accordian", __webpack_require__(17)); +Vue.component("tree-view", __webpack_require__(20)); +Vue.component("tree-item", __webpack_require__(22)); +Vue.component("tree-checkbox", __webpack_require__(24)); +Vue.component("tree-radio", __webpack_require__(27)); +Vue.component("modal", __webpack_require__(30)); +Vue.component("image-upload", __webpack_require__(33)); +Vue.component("image-wrapper", __webpack_require__(40)); +Vue.component("image-item", __webpack_require__(43)); +Vue.directive("slugify", __webpack_require__(46)); +Vue.directive("code", __webpack_require__(48)); +Vue.directive("alert", __webpack_require__(50)); +Vue.component("datetime", __webpack_require__(52)); +Vue.component("date", __webpack_require__(55)); + +__webpack_require__(58); + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +var disposed = false +var normalizeComponent = __webpack_require__(0) +/* script */ +var __vue_script__ = __webpack_require__(6) +/* template */ +var __vue_template__ = __webpack_require__(7) +/* template functional */ +var __vue_template_functional__ = false +/* styles */ +var __vue_styles__ = null +/* scopeId */ +var __vue_scopeId__ = null +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __vue_script__, + __vue_template__, + __vue_template_functional__, + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) +Component.options.__file = "src/Resources/assets/js/components/flash-wrapper.vue" + +/* hot reload */ +if (false) {(function () { + var hotAPI = require("vue-hot-reload-api") + hotAPI.install(require("vue"), false) + if (!hotAPI.compatible) return + module.hot.accept() + if (!module.hot.data) { + hotAPI.createRecord("data-v-34b58a1a", Component.options) + } else { + hotAPI.reload("data-v-34b58a1a", Component.options) + } + module.hot.dispose(function (data) { + disposed = true + }) +})()} + +module.exports = Component.exports + + +/***/ }), +/* 6 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +/* harmony default export */ __webpack_exports__["default"] = ({ + data: function data() { + return { + uid: 1, + + flashes: [] + }; + }, + + methods: { + addFlash: function addFlash(flash) { + flash.uid = this.uid++; + this.flashes.push(flash); + }, + + removeFlash: function removeFlash(flash) { + var index = this.flashes.indexOf(flash); + + this.flashes.splice(index, 1); + } + } +}); + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "transition-group", + { + staticClass: "alert-wrapper", + attrs: { tag: "div", name: "flash-wrapper" } + }, + _vm._l(_vm.flashes, function(flash) { + return _c("flash", { + key: flash.uid, + attrs: { flash: flash }, + on: { + onRemoveFlash: function($event) { + _vm.removeFlash($event) + } + } + }) + }), + 1 + ) +} +var staticRenderFns = [] +render._withStripped = true +module.exports = { render: render, staticRenderFns: staticRenderFns } +if (false) { + module.hot.accept() + if (module.hot.data) { + require("vue-hot-reload-api") .rerender("data-v-34b58a1a", module.exports) + } +} + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +var disposed = false +var normalizeComponent = __webpack_require__(0) +/* script */ +var __vue_script__ = __webpack_require__(9) +/* template */ +var __vue_template__ = __webpack_require__(10) +/* template functional */ +var __vue_template_functional__ = false +/* styles */ +var __vue_styles__ = null +/* scopeId */ +var __vue_scopeId__ = null +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __vue_script__, + __vue_template__, + __vue_template_functional__, + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) +Component.options.__file = "src/Resources/assets/js/components/flash.vue" + +/* hot reload */ +if (false) {(function () { + var hotAPI = require("vue-hot-reload-api") + hotAPI.install(require("vue"), false) + if (!hotAPI.compatible) return + module.hot.accept() + if (!module.hot.data) { + hotAPI.createRecord("data-v-feee1d58", Component.options) + } else { + hotAPI.reload("data-v-feee1d58", Component.options) + } + module.hot.dispose(function (data) { + disposed = true + }) +})()} + +module.exports = Component.exports + + +/***/ }), +/* 9 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +// +// +// +// +// +// +// + +/* harmony default export */ __webpack_exports__["default"] = ({ + props: ['flash'], + + created: function created() { + var this_this = this; + setTimeout(function () { + this_this.$emit('onRemoveFlash', this_this.flash); + }, 5000); + }, + + methods: { + remove: function remove() { + this.$emit('onRemoveFlash', this.flash); + } + } +}); + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("div", { staticClass: "alert", class: _vm.flash.type }, [ + _c("span", { + staticClass: "icon white-cross-sm-icon", + on: { click: _vm.remove } + }), + _vm._v(" "), + _c("p", [_vm._v(_vm._s(_vm.flash.message))]) + ]) +} +var staticRenderFns = [] +render._withStripped = true +module.exports = { render: render, staticRenderFns: staticRenderFns } +if (false) { + module.hot.accept() + if (module.hot.data) { + require("vue-hot-reload-api") .rerender("data-v-feee1d58", module.exports) + } +} + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +var disposed = false +var normalizeComponent = __webpack_require__(0) +/* script */ +var __vue_script__ = __webpack_require__(12) +/* template */ +var __vue_template__ = __webpack_require__(13) +/* template functional */ +var __vue_template_functional__ = false +/* styles */ +var __vue_styles__ = null +/* scopeId */ +var __vue_scopeId__ = null +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __vue_script__, + __vue_template__, + __vue_template_functional__, + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) +Component.options.__file = "src/Resources/assets/js/components/tabs/tabs.vue" + +/* hot reload */ +if (false) {(function () { + var hotAPI = require("vue-hot-reload-api") + hotAPI.install(require("vue"), false) + if (!hotAPI.compatible) return + module.hot.accept() + if (!module.hot.data) { + hotAPI.createRecord("data-v-7e97b353", Component.options) + } else { + hotAPI.reload("data-v-7e97b353", Component.options) + } + module.hot.dispose(function (data) { + disposed = true + }) +})()} + +module.exports = Component.exports + + +/***/ }), +/* 12 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +/* harmony default export */ __webpack_exports__["default"] = ({ + data: function data() { + return { + tabs: [] + }; + }, + + created: function created() { + this.tabs = this.$children; + }, + + + methods: { + selectTab: function selectTab(selectedTab) { + this.tabs.forEach(function (tab) { + tab.isActive = tab.name == selectedTab.name; + }); + } + } +}); + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("div", [ + _c("div", { staticClass: "tabs" }, [ + _c( + "ul", + _vm._l(_vm.tabs, function(tab) { + return _c( + "li", + { + class: { active: tab.isActive }, + on: { + click: function($event) { + _vm.selectTab(tab) + } + } + }, + [_c("a", [_vm._v(_vm._s(tab.name))])] + ) + }), + 0 + ) + ]), + _vm._v(" "), + _c("div", { staticClass: "tabs-content" }, [_vm._t("default")], 2) + ]) +} +var staticRenderFns = [] +render._withStripped = true +module.exports = { render: render, staticRenderFns: staticRenderFns } +if (false) { + module.hot.accept() + if (module.hot.data) { + require("vue-hot-reload-api") .rerender("data-v-7e97b353", module.exports) + } +} + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +var disposed = false +var normalizeComponent = __webpack_require__(0) +/* script */ +var __vue_script__ = __webpack_require__(15) +/* template */ +var __vue_template__ = __webpack_require__(16) +/* template functional */ +var __vue_template_functional__ = false +/* styles */ +var __vue_styles__ = null +/* scopeId */ +var __vue_scopeId__ = null +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __vue_script__, + __vue_template__, + __vue_template_functional__, + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) +Component.options.__file = "src/Resources/assets/js/components/tabs/tab.vue" + +/* hot reload */ +if (false) {(function () { + var hotAPI = require("vue-hot-reload-api") + hotAPI.install(require("vue"), false) + if (!hotAPI.compatible) return + module.hot.accept() + if (!module.hot.data) { + hotAPI.createRecord("data-v-299e3060", Component.options) + } else { + hotAPI.reload("data-v-299e3060", Component.options) + } + module.hot.dispose(function (data) { + disposed = true + }) +})()} + +module.exports = Component.exports + + +/***/ }), +/* 15 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +// +// +// +// +// +// + +/* harmony default export */ __webpack_exports__["default"] = ({ + props: { + name: { + required: true + }, + + selected: { + default: false + } + }, + + data: function data() { + return { + isActive: false + }; + }, + mounted: function mounted() { + this.isActive = this.selected; + } +}); + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + { + directives: [ + { + name: "show", + rawName: "v-show", + value: _vm.isActive, + expression: "isActive" + } + ] + }, + [_vm._t("default")], + 2 + ) +} +var staticRenderFns = [] +render._withStripped = true +module.exports = { render: render, staticRenderFns: staticRenderFns } +if (false) { + module.hot.accept() + if (module.hot.data) { + require("vue-hot-reload-api") .rerender("data-v-299e3060", module.exports) + } +} + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +var disposed = false +var normalizeComponent = __webpack_require__(0) +/* script */ +var __vue_script__ = __webpack_require__(18) +/* template */ +var __vue_template__ = __webpack_require__(19) +/* template functional */ +var __vue_template_functional__ = false +/* styles */ +var __vue_styles__ = null +/* scopeId */ +var __vue_scopeId__ = null +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __vue_script__, + __vue_template__, + __vue_template_functional__, + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) +Component.options.__file = "src/Resources/assets/js/components/accordian.vue" + +/* hot reload */ +if (false) {(function () { + var hotAPI = require("vue-hot-reload-api") + hotAPI.install(require("vue"), false) + if (!hotAPI.compatible) return + module.hot.accept() + if (!module.hot.data) { + hotAPI.createRecord("data-v-d9e5880c", Component.options) + } else { + hotAPI.reload("data-v-d9e5880c", Component.options) + } + module.hot.dispose(function (data) { + disposed = true + }) +})()} + +module.exports = Component.exports + + +/***/ }), +/* 18 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +/* harmony default export */ __webpack_exports__["default"] = ({ + props: { + title: String, + id: String, + className: String, + active: Boolean + }, + + inject: ['$validator'], + + data: function data() { + return { + isActive: false, + imageData: '' + }; + }, + + mounted: function mounted() { + this.isActive = this.active; + }, + + methods: { + toggleAccordion: function toggleAccordion() { + this.isActive = !this.isActive; + } + }, + + computed: { + iconClass: function iconClass() { + return { + 'accordian-down-icon': !this.isActive, + 'accordian-up-icon': this.isActive + }; + } + } +}); + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + { + staticClass: "accordian", + class: [_vm.isActive ? "active" : "", _vm.className], + attrs: { id: _vm.id } + }, + [ + _c( + "div", + { + staticClass: "accordian-header", + on: { + click: function($event) { + _vm.toggleAccordion() + } + } + }, + [ + _vm._t("header", [ + _vm._v("\n " + _vm._s(_vm.title) + "\n "), + _c("i", { staticClass: "icon", class: _vm.iconClass }) + ]) + ], + 2 + ), + _vm._v(" "), + _c("div", { staticClass: "accordian-content" }, [_vm._t("body")], 2) + ] + ) +} +var staticRenderFns = [] +render._withStripped = true +module.exports = { render: render, staticRenderFns: staticRenderFns } +if (false) { + module.hot.accept() + if (module.hot.data) { + require("vue-hot-reload-api") .rerender("data-v-d9e5880c", module.exports) + } +} + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +var disposed = false +var normalizeComponent = __webpack_require__(0) +/* script */ +var __vue_script__ = __webpack_require__(21) +/* template */ +var __vue_template__ = null +/* template functional */ +var __vue_template_functional__ = false +/* styles */ +var __vue_styles__ = null +/* scopeId */ +var __vue_scopeId__ = null +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __vue_script__, + __vue_template__, + __vue_template_functional__, + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) +Component.options.__file = "src/Resources/assets/js/components/tree-view/tree-view.vue" + +/* hot reload */ +if (false) {(function () { + var hotAPI = require("vue-hot-reload-api") + hotAPI.install(require("vue"), false) + if (!hotAPI.compatible) return + module.hot.accept() + if (!module.hot.data) { + hotAPI.createRecord("data-v-2c07aa7d", Component.options) + } else { + hotAPI.reload("data-v-2c07aa7d", Component.options) + } + module.hot.dispose(function (data) { + disposed = true + }) +})()} + +module.exports = Component.exports + + +/***/ }), +/* 21 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); + + +/* harmony default export */ __webpack_exports__["default"] = ({ + name: 'tree-view', + + inheritAttrs: false, + + props: { + inputType: { + type: String, + required: false, + default: 'checkbox' + }, + + nameField: { + type: String, + required: false, + default: 'permissions' + }, + + idField: { + type: String, + required: false, + default: 'id' + }, + + valueField: { + type: String, + required: false, + default: 'value' + }, + + captionField: { + type: String, + required: false, + default: 'name' + }, + + childrenField: { + type: String, + required: false, + default: 'children' + }, + + items: { + type: [Array, String, Object], + required: false, + default: function _default() { + return []; + } + }, + + behavior: { + type: String, + required: false, + default: 'reactive' + }, + + value: { + type: [Array, String, Object], + required: false, + default: function _default() { + return []; + } + } + }, + + data: function data() { + return { + finalValues: [] + }; + }, + + computed: { + savedValues: function savedValues() { + if (!this.value) return []; + + if (this.inputType == 'radio') return [this.value]; + + return typeof this.value == 'string' ? JSON.parse(this.value) : this.value; + } + }, + + methods: { + generateChildren: function generateChildren() { + var childElements = []; + + var items = typeof this.items == 'string' ? JSON.parse(this.items) : this.items; + + for (var key in items) { + childElements.push(this.generateTreeItem(items[key])); + } + + return childElements; + }, + generateTreeItem: function generateTreeItem(item) { + var _this = this; + + return this.$createElement('tree-item', { + props: { + items: item, + value: this.finalValues, + savedValues: this.savedValues, + nameField: this.nameField, + inputType: this.inputType, + captionField: this.captionField, + childrenField: this.childrenField, + valueField: this.valueField, + idField: this.idField, + behavior: this.behavior + }, + on: { + input: function input(selection) { + _this.finalValues = selection; + } + } + }); + } + }, + + render: function render(createElement) { + return createElement('div', { + class: ['tree-container'] + }, [this.generateChildren()]); + } +}); + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +var disposed = false +var normalizeComponent = __webpack_require__(0) +/* script */ +var __vue_script__ = __webpack_require__(23) +/* template */ +var __vue_template__ = null +/* template functional */ +var __vue_template_functional__ = false +/* styles */ +var __vue_styles__ = null +/* scopeId */ +var __vue_scopeId__ = null +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __vue_script__, + __vue_template__, + __vue_template_functional__, + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) +Component.options.__file = "src/Resources/assets/js/components/tree-view/tree-item.vue" + +/* hot reload */ +if (false) {(function () { + var hotAPI = require("vue-hot-reload-api") + hotAPI.install(require("vue"), false) + if (!hotAPI.compatible) return + module.hot.accept() + if (!module.hot.data) { + hotAPI.createRecord("data-v-2af003eb", Component.options) + } else { + hotAPI.reload("data-v-2af003eb", Component.options) + } + module.hot.dispose(function (data) { + disposed = true + }) +})()} + +module.exports = Component.exports + + +/***/ }), +/* 23 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +/* harmony default export */ __webpack_exports__["default"] = ({ + name: 'tree-view', + + inheritAttrs: false, + + props: { + inputType: String, + + nameField: String, + + idField: String, + + captionField: String, + + childrenField: String, + + valueField: String, + + items: { + type: [Array, String, Object], + required: false, + default: null + }, + + value: { + type: Array, + required: false, + default: null + }, + + behavior: { + type: String, + required: false, + default: 'reactive' + }, + + savedValues: { + type: Array, + required: false, + default: null + } + }, + + created: function created() { + var index = this.savedValues.indexOf(this.items[this.valueField]); + if (index !== -1) { + this.value.push(this.items); + } + }, + + + computed: { + caption: function caption() { + return this.items[this.captionField]; + }, + allChildren: function allChildren() { + var _this = this; + + var leafs = []; + var searchTree = function searchTree(items) { + if (!!items[_this.childrenField] && _this.getLength(items[_this.childrenField]) > 0) { + if (_typeof(items[_this.childrenField]) == 'object') { + for (var key in items[_this.childrenField]) { + searchTree(items[_this.childrenField][key]); + } + } else { + items[_this.childrenField].forEach(function (child) { + return searchTree(child); + }); + } + } else { + leafs.push(items); + } + }; + + searchTree(this.items); + + return leafs; + }, + hasChildren: function hasChildren() { + return !!this.items[this.childrenField] && this.getLength(this.items[this.childrenField]) > 0; + }, + hasSelection: function hasSelection() { + return !!this.value && this.value.length > 0; + }, + isAllChildrenSelected: function isAllChildrenSelected() { + var _this2 = this; + + return this.hasChildren && this.hasSelection && this.allChildren.every(function (leaf) { + return _this2.value.some(function (sel) { + return sel[_this2.idField] === leaf[_this2.idField]; + }); + }); + }, + isSomeChildrenSelected: function isSomeChildrenSelected() { + var _this3 = this; + + return this.hasChildren && this.hasSelection && this.allChildren.some(function (leaf) { + return _this3.value.some(function (sel) { + return sel[_this3.idField] === leaf[_this3.idField]; + }); + }); + } + }, + + methods: { + getLength: function getLength(items) { + if ((typeof items === 'undefined' ? 'undefined' : _typeof(items)) == 'object') { + var length = 0; + + for (var item in items) { + length++; + } + + return length; + } + + return items.length; + }, + generateRoot: function generateRoot() { + var _this4 = this; + + if (this.inputType == 'checkbox') { + if (this.behavior == 'reactive') { + return this.$createElement('tree-checkbox', { + props: { + id: this.items[this.idField], + label: this.caption, + nameField: this.nameField, + modelValue: this.items[this.valueField], + inputValue: this.hasChildren ? this.isSomeChildrenSelected : this.value, + value: this.hasChildren ? this.isAllChildrenSelected : this.items + }, + on: { + change: function change(selection) { + if (_this4.hasChildren) { + if (_this4.isAllChildrenSelected) { + _this4.allChildren.forEach(function (leaf) { + var index = _this4.value.indexOf(leaf); + _this4.value.splice(index, 1); + }); + } else { + _this4.allChildren.forEach(function (leaf) { + var exists = false; + _this4.value.forEach(function (item) { + if (item['key'] == leaf['key']) { + exists = true; + } + }); + + if (!exists) { + _this4.value.push(leaf); + } + }); + } + + _this4.$emit('input', _this4.value); + } else { + _this4.$emit('input', selection); + } + } + } + }); + } else { + return this.$createElement('tree-checkbox', { + props: { + id: this.items[this.idField], + label: this.caption, + nameField: this.nameField, + modelValue: this.items[this.valueField], + inputValue: this.value, + value: this.items + } + }); + } + } else if (this.inputType == 'radio') { + return this.$createElement('tree-radio', { + props: { + id: this.items[this.idField], + label: this.caption, + nameField: this.nameField, + modelValue: this.items[this.valueField], + value: this.savedValues + } + }); + } + }, + generateChild: function generateChild(child) { + var _this5 = this; + + return this.$createElement('tree-item', { + on: { + input: function input(selection) { + _this5.$emit('input', selection); + } + }, + props: { + items: child, + value: this.value, + savedValues: this.savedValues, + nameField: this.nameField, + inputType: this.inputType, + captionField: this.captionField, + childrenField: this.childrenField, + valueField: this.valueField, + idField: this.idField, + behavior: this.behavior + } + }); + }, + generateChildren: function generateChildren() { + var _this6 = this; + + var childElements = []; + if (this.items[this.childrenField]) { + if (_typeof(this.items[this.childrenField]) == 'object') { + for (var key in this.items[this.childrenField]) { + childElements.push(this.generateChild(this.items[this.childrenField][key])); + } + } else { + this.items[this.childrenField].forEach(function (child) { + childElements.push(_this6.generateChild(child)); + }); + } + } + + return childElements; + }, + generateIcon: function generateIcon() { + var _this7 = this; + + return this.$createElement('i', { + class: ['expand-icon'], + on: { + click: function click(selection) { + _this7.$el.classList.toggle("active"); + } + } + }); + }, + generateFolderIcon: function generateFolderIcon() { + return this.$createElement('i', { + class: ['icon', 'folder-icon'] + }); + } + }, + + render: function render(createElement) { + return createElement('div', { + class: ['tree-item', 'active', this.hasChildren ? 'has-children' : ''] + }, [this.generateIcon(), this.generateFolderIcon(), this.generateRoot()].concat(_toConsumableArray(this.generateChildren()))); + } +}); + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +var disposed = false +var normalizeComponent = __webpack_require__(0) +/* script */ +var __vue_script__ = __webpack_require__(25) +/* template */ +var __vue_template__ = __webpack_require__(26) +/* template functional */ +var __vue_template_functional__ = false +/* styles */ +var __vue_styles__ = null +/* scopeId */ +var __vue_scopeId__ = null +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __vue_script__, + __vue_template__, + __vue_template_functional__, + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) +Component.options.__file = "src/Resources/assets/js/components/tree-view/tree-checkbox.vue" + +/* hot reload */ +if (false) {(function () { + var hotAPI = require("vue-hot-reload-api") + hotAPI.install(require("vue"), false) + if (!hotAPI.compatible) return + module.hot.accept() + if (!module.hot.data) { + hotAPI.createRecord("data-v-0c27ec9b", Component.options) + } else { + hotAPI.reload("data-v-0c27ec9b", Component.options) + } + module.hot.dispose(function (data) { + disposed = true + }) +})()} + +module.exports = Component.exports + + +/***/ }), +/* 25 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +// +// +// +// +// +// +// +// + +/* harmony default export */ __webpack_exports__["default"] = ({ + name: 'tree-checkbox', + + props: ['id', 'label', 'nameField', 'modelValue', 'inputValue', 'value'], + + computed: { + isMultiple: function isMultiple() { + return Array.isArray(this.internalValue); + }, + isActive: function isActive() { + var _this = this; + + var value = this.value; + var input = this.internalValue; + + if (this.isMultiple) { + return input.some(function (item) { + return _this.valueComparator(item, value); + }); + } + + return value ? this.valueComparator(value, input) : Boolean(input); + }, + + + internalValue: { + get: function get() { + return this.lazyValue; + }, + set: function set(val) { + this.lazyValue = val; + this.$emit('input', val); + } + } + }, + + data: function data(vm) { + return { + lazyValue: vm.inputValue + }; + }, + + watch: { + inputValue: function inputValue(val) { + this.internalValue = val; + } + }, + + methods: { + inputChanged: function inputChanged() { + var _this2 = this; + + var value = this.value; + var input = this.internalValue; + + if (this.isMultiple) { + var length = input.length; + + input = input.filter(function (item) { + return !_this2.valueComparator(item, value); + }); + + if (input.length === length) { + input.push(value); + } + } else { + input = !input; + } + + this.$emit('change', input); + }, + valueComparator: function valueComparator(a, b) { + var _this3 = this; + + if (a === b) return true; + + if (a !== Object(a) || b !== Object(b)) { + return false; + } + + var props = Object.keys(a); + + if (props.length !== Object.keys(b).length) { + return false; + } + + return props.every(function (p) { + return _this3.valueComparator(a[p], b[p]); + }); + } + } +}); + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("span", { staticClass: "checkbox" }, [ + _c("input", { + attrs: { type: "checkbox", id: _vm.id, name: [_vm.nameField + "[]"] }, + domProps: { value: _vm.modelValue, checked: _vm.isActive }, + on: { + change: function($event) { + _vm.inputChanged() + } + } + }), + _vm._v(" "), + _c("label", { staticClass: "checkbox-view", attrs: { for: _vm.id } }), + _vm._v(" "), + _c("span", { attrs: { for: _vm.id } }, [_vm._v(_vm._s(_vm.label))]) + ]) +} +var staticRenderFns = [] +render._withStripped = true +module.exports = { render: render, staticRenderFns: staticRenderFns } +if (false) { + module.hot.accept() + if (module.hot.data) { + require("vue-hot-reload-api") .rerender("data-v-0c27ec9b", module.exports) + } +} + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +var disposed = false +var normalizeComponent = __webpack_require__(0) +/* script */ +var __vue_script__ = __webpack_require__(28) +/* template */ +var __vue_template__ = __webpack_require__(29) +/* template functional */ +var __vue_template_functional__ = false +/* styles */ +var __vue_styles__ = null +/* scopeId */ +var __vue_scopeId__ = null +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __vue_script__, + __vue_template__, + __vue_template_functional__, + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) +Component.options.__file = "src/Resources/assets/js/components/tree-view/tree-radio.vue" + +/* hot reload */ +if (false) {(function () { + var hotAPI = require("vue-hot-reload-api") + hotAPI.install(require("vue"), false) + if (!hotAPI.compatible) return + module.hot.accept() + if (!module.hot.data) { + hotAPI.createRecord("data-v-7b7bb153", Component.options) + } else { + hotAPI.reload("data-v-7b7bb153", Component.options) + } + module.hot.dispose(function (data) { + disposed = true + }) +})()} + +module.exports = Component.exports + + +/***/ }), +/* 28 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +// +// +// +// +// +// +// +// + +/* harmony default export */ __webpack_exports__["default"] = ({ + name: 'tree-radio', + + props: ['id', 'label', 'nameField', 'modelValue', 'value'], + + computed: { + isActive: function isActive() { + if (this.value.length) { + return this.value[0] == this.modelValue ? true : false; + } + + return false; + } + } +}); + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("span", { staticClass: "radio" }, [ + _c("input", { + attrs: { type: "radio", id: _vm.id, name: _vm.nameField }, + domProps: { value: _vm.modelValue, checked: _vm.isActive } + }), + _vm._v(" "), + _c("label", { staticClass: "radio-view", attrs: { for: _vm.id } }), + _vm._v(" "), + _c("span", { attrs: { for: _vm.id } }, [_vm._v(_vm._s(_vm.label))]) + ]) +} +var staticRenderFns = [] +render._withStripped = true +module.exports = { render: render, staticRenderFns: staticRenderFns } +if (false) { + module.hot.accept() + if (module.hot.data) { + require("vue-hot-reload-api") .rerender("data-v-7b7bb153", module.exports) + } +} + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +var disposed = false +var normalizeComponent = __webpack_require__(0) +/* script */ +var __vue_script__ = __webpack_require__(31) +/* template */ +var __vue_template__ = __webpack_require__(32) +/* template functional */ +var __vue_template_functional__ = false +/* styles */ +var __vue_styles__ = null +/* scopeId */ +var __vue_scopeId__ = null +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __vue_script__, + __vue_template__, + __vue_template_functional__, + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) +Component.options.__file = "src/Resources/assets/js/components/modal.vue" + +/* hot reload */ +if (false) {(function () { + var hotAPI = require("vue-hot-reload-api") + hotAPI.install(require("vue"), false) + if (!hotAPI.compatible) return + module.hot.accept() + if (!module.hot.data) { + hotAPI.createRecord("data-v-463f5591", Component.options) + } else { + hotAPI.reload("data-v-463f5591", Component.options) + } + module.hot.dispose(function (data) { + disposed = true + }) +})()} + +module.exports = Component.exports + + +/***/ }), +/* 31 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +/* harmony default export */ __webpack_exports__["default"] = ({ + props: ['id', 'isOpen'], + + created: function created() { + this.closeModal(); + }, + + + computed: { + isModalOpen: function isModalOpen() { + this.addClassToBody(); + + return this.isOpen; + } + }, + + methods: { + closeModal: function closeModal() { + this.$root.$set(this.$root.modalIds, this.id, false); + }, + addClassToBody: function addClassToBody() { + var body = document.querySelector("body"); + if (this.isOpen) { + body.classList.add("modal-open"); + } else { + body.classList.remove("modal-open"); + } + } + } +}); + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _vm.isModalOpen + ? _c("div", { staticClass: "modal-container" }, [ + _c( + "div", + { staticClass: "modal-header" }, + [ + _vm._t("header", [ + _vm._v("\n Default header\n ") + ]), + _vm._v(" "), + _c("i", { + staticClass: "icon remove-icon", + on: { click: _vm.closeModal } + }) + ], + 2 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "modal-body" }, + [_vm._t("body", [_vm._v("\n Default body\n ")])], + 2 + ) + ]) + : _vm._e() +} +var staticRenderFns = [] +render._withStripped = true +module.exports = { render: render, staticRenderFns: staticRenderFns } +if (false) { + module.hot.accept() + if (module.hot.data) { + require("vue-hot-reload-api") .rerender("data-v-463f5591", module.exports) + } +} + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +var disposed = false +function injectStyle (ssrContext) { + if (disposed) return + __webpack_require__(34) +} +var normalizeComponent = __webpack_require__(0) +/* script */ +var __vue_script__ = __webpack_require__(38) +/* template */ +var __vue_template__ = __webpack_require__(39) +/* template functional */ +var __vue_template_functional__ = false +/* styles */ +var __vue_styles__ = injectStyle +/* scopeId */ +var __vue_scopeId__ = null +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __vue_script__, + __vue_template__, + __vue_template_functional__, + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) +Component.options.__file = "src/Resources/assets/js/components/image/image-upload.vue" + +/* hot reload */ +if (false) {(function () { + var hotAPI = require("vue-hot-reload-api") + hotAPI.install(require("vue"), false) + if (!hotAPI.compatible) return + module.hot.accept() + if (!module.hot.data) { + hotAPI.createRecord("data-v-5431fa9a", Component.options) + } else { + hotAPI.reload("data-v-5431fa9a", Component.options) + } + module.hot.dispose(function (data) { + disposed = true + }) +})()} + +module.exports = Component.exports + + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +// style-loader: Adds some css to the DOM by adding a