add files
This commit is contained in:
188
assets/js/vendor/customselect/css/jquery.custom-select.css
vendored
Normal file
188
assets/js/vendor/customselect/css/jquery.custom-select.css
vendored
Normal file
@@ -0,0 +1,188 @@
|
||||
/*
|
||||
* Custom Select jQuery Plugin Base
|
||||
*/
|
||||
.custom-select {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.custom-select__option {
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
font-family: inherit;
|
||||
white-space: nowrap;
|
||||
text-align: left;
|
||||
text-overflow: ellipsis;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
.custom-select__option-wrap {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.custom-select__input {
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
border-width: 1px 0;
|
||||
border-style: solid;
|
||||
border-radius: 0;
|
||||
font-family: inherit;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
.custom-select__dropdown {
|
||||
position: absolute;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.custom-select--dropup .custom-select__dropdown {
|
||||
top: auto;
|
||||
bottom: 100%;
|
||||
}
|
||||
|
||||
/*
|
||||
* Custom Select jQuery Plugin Theme
|
||||
*/
|
||||
.custom-select__option {
|
||||
position: relative;
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 1rem;
|
||||
color: #212121;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.custom-select__option:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.custom-select__option:hover, .custom-select__option:focus {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.custom-select__option--value {
|
||||
padding-right: 1.875rem;
|
||||
background-color: #fff;
|
||||
border: 1px solid #e6e6e6;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.custom-select__option--value::after {
|
||||
position: absolute;
|
||||
box-sizing: border-box;
|
||||
width: 0;
|
||||
height: 0;
|
||||
top: 50%;
|
||||
right: 0.75rem;
|
||||
border-width: 0.3rem;
|
||||
border-bottom-width: 0;
|
||||
border-style: solid;
|
||||
border-color: currentColor transparent;
|
||||
transform: translateY(-50%);
|
||||
content: "";
|
||||
}
|
||||
|
||||
.custom-select--active .custom-select__option--value::after {
|
||||
transform: translateY(-50%) rotate(-180deg);
|
||||
}
|
||||
|
||||
.custom-select--active .custom-select__option--value {
|
||||
border-bottom-color: transparent;
|
||||
border-radius: 0.25rem 0.25rem 0 0;
|
||||
}
|
||||
|
||||
.custom-select--active .custom-select__option--value:hover, .custom-select--active .custom-select__option--value:focus {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.custom-select--dropup.custom-select--active .custom-select__option--value {
|
||||
border-top-color: transparent;
|
||||
border-bottom-color: #e6e6e6;
|
||||
border-radius: 0 0 0.25rem 0.25rem;
|
||||
}
|
||||
|
||||
.custom-select__option--selected {
|
||||
background-color: #fcfcfc;
|
||||
}
|
||||
|
||||
.custom-select__option[disabled] {
|
||||
color: #a1a1a1;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.custom-select__option[disabled]:hover, .custom-select__option[disabled]:focus {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.custom-select__option-wrap {
|
||||
overflow-y: auto;
|
||||
max-height: 11.25rem;
|
||||
}
|
||||
|
||||
.custom-select__option-wrap::-webkit-scrollbar {
|
||||
width: 16px;
|
||||
}
|
||||
|
||||
.custom-select__option-wrap::-webkit-scrollbar-thumb {
|
||||
background-color: #e6e6e6;
|
||||
background-clip: padding-box;
|
||||
border-width: 0 4px;
|
||||
border-style: solid;
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.custom-select__input {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
height: 2.25rem;
|
||||
margin-top: -1px;
|
||||
padding: 0 0.75rem;
|
||||
border-color: #e6e6e6;
|
||||
transform: translateY(1px);
|
||||
font-size: 1rem;
|
||||
color: #212121;
|
||||
}
|
||||
|
||||
.custom-select__input:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.custom-select--dropup .custom-select__input {
|
||||
border-top-width: 0;
|
||||
margin-top: 0;
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.custom-select__dropdown {
|
||||
overflow: hidden;
|
||||
z-index: 1;
|
||||
top: calc(100% - 1px);
|
||||
background-color: #fff;
|
||||
border-width: 0 1px 1px;
|
||||
border-style: solid;
|
||||
border-color: #e6e6e6;
|
||||
border-radius: 0 0 0.25rem 0.25rem;
|
||||
}
|
||||
|
||||
.custom-select--dropup .custom-select__dropdown {
|
||||
bottom: calc(100% - 1px);
|
||||
border-width: 1px 1px 0;
|
||||
border-radius: 0.25rem 0.25rem 0 0;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=jquery.custom-select.css.map */
|
||||
14
assets/js/vendor/customselect/css/jquery.custom-select.css.map
vendored
Normal file
14
assets/js/vendor/customselect/css/jquery.custom-select.css.map
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"version": 3,
|
||||
"file": "jquery.custom-select.css",
|
||||
"sources": [
|
||||
"../../sass/jquery.custom-select.scss",
|
||||
"../../sass/_base.scss"
|
||||
],
|
||||
"sourcesContent": [
|
||||
"@import \"base\";\r\n\r\n/*\r\n * Custom Select jQuery Plugin Theme\r\n */\r\n\r\n$white: #fff !default;\r\n\r\n.#{$custom-select-block} {\r\n $_gutter: 0.75rem;\r\n $_color: #212121;\r\n\r\n &__option {\r\n position: relative;\r\n padding: 0.375rem $_gutter;\r\n font-size: 1rem;\r\n color: $_color;\r\n line-height: 1.5;\r\n\r\n &:focus {\r\n outline: none;\r\n }\r\n\r\n &:hover,\r\n &:focus {\r\n background-color: darken($white, 2.5%);\r\n }\r\n\r\n &--value {\r\n padding-right: $_gutter * 2 + 0.375rem;\r\n background-color: $white;\r\n border: 1px solid darken($white, 10%);\r\n border-radius: 0.25rem;\r\n\r\n &::after {\r\n position: absolute;\r\n box-sizing: border-box;\r\n width: 0;\r\n height: 0;\r\n top: 50%;\r\n right: $_gutter;\r\n border-width: 0.3rem;\r\n border-bottom-width: 0;\r\n border-style: solid;\r\n border-color: currentColor transparent;\r\n transform: translateY(-50%);\r\n content: \"\";\r\n\r\n .#{$custom-select-block}--active & {\r\n transform: translateY(-50%) rotate(-180deg);\r\n }\r\n }\r\n\r\n .#{$custom-select-block}--active & {\r\n border-bottom-color: transparent;\r\n border-radius: 0.25rem 0.25rem 0 0;\r\n\r\n &:hover,\r\n &:focus {\r\n background-color: $white;\r\n }\r\n\r\n @at-root {\r\n .#{$custom-select-block}--dropup#{&} {\r\n border-top-color: transparent;\r\n border-bottom-color: darken($white, 10%);\r\n border-radius: 0 0 0.25rem 0.25rem;\r\n }\r\n }\r\n }\r\n }\r\n\r\n &--selected {\r\n background-color: darken($white, 1.25%);\r\n }\r\n\r\n &[disabled] {\r\n color: lighten($_color, 50%);\r\n cursor: default;\r\n\r\n &:hover,\r\n &:focus {\r\n background-color: transparent;\r\n }\r\n }\r\n }\r\n\r\n &__option-wrap {\r\n overflow-y: auto;\r\n max-height: (0.375rem * 2 + 1rem * 1.5) * 5;\r\n\r\n &::-webkit-scrollbar {\r\n width: 16px;\r\n }\r\n\r\n &::-webkit-scrollbar-thumb {\r\n background-color: darken($white, 10%);\r\n background-clip: padding-box;\r\n border-width: 0 4px;\r\n border-style: solid;\r\n border-color: transparent;\r\n }\r\n }\r\n\r\n &__input {\r\n position: relative;\r\n z-index: 1;\r\n height: 2.25rem;\r\n margin-top: -1px;\r\n padding: 0 $_gutter;\r\n border-color: darken($white, 10%);\r\n transform: translateY(1px);\r\n font-size: 1rem;\r\n color: $_color;\r\n\r\n &:focus {\r\n outline: none;\r\n }\r\n\r\n .#{$custom-select-block}--dropup & {\r\n border-top-width: 0;\r\n margin-top: 0;\r\n transform: translateY(0);\r\n }\r\n }\r\n\r\n &__dropdown {\r\n overflow: hidden;\r\n z-index: 1;\r\n top: calc(100% - 1px);\r\n background-color: $white;\r\n border-width: 0 1px 1px;\r\n border-style: solid;\r\n border-color: darken($white, 10%);\r\n border-radius: 0 0 0.25rem 0.25rem;\r\n\r\n .#{$custom-select-block}--dropup & {\r\n bottom: calc(100% - 1px);\r\n border-width: 1px 1px 0;\r\n border-radius: 0.25rem 0.25rem 0 0;\r\n }\r\n }\r\n}\r\n",
|
||||
"/*\r\n * Custom Select jQuery Plugin Base\r\n */\r\n\r\n$custom-select-block: \"custom-select\" !default;\r\n\r\n.#{$custom-select-block} {\r\n position: relative;\r\n\r\n &__option {\r\n overflow: hidden;\r\n box-sizing: border-box;\r\n display: block;\r\n width: 100%;\r\n padding: 0;\r\n background-color: transparent;\r\n border: 0;\r\n border-radius: 0;\r\n font-family: inherit;\r\n white-space: nowrap;\r\n text-align: left;\r\n text-overflow: ellipsis;\r\n cursor: pointer;\r\n user-select: none;\r\n -webkit-appearance: none;\r\n -moz-appearance: none;\r\n appearance: none;\r\n }\r\n\r\n &__option-wrap {\r\n position: relative;\r\n }\r\n\r\n &__input {\r\n box-sizing: border-box;\r\n display: block;\r\n width: 100%;\r\n padding: 0;\r\n border-width: 1px 0;\r\n border-style: solid;\r\n border-radius: 0;\r\n font-family: inherit;\r\n -webkit-appearance: none;\r\n -moz-appearance: none;\r\n appearance: none;\r\n }\r\n\r\n &__dropdown {\r\n position: absolute;\r\n box-sizing: border-box;\r\n width: 100%;\r\n top: 100%;\r\n left: 0;\r\n\r\n .#{$custom-select-block}--dropup & {\r\n top: auto;\r\n bottom: 100%;\r\n }\r\n }\r\n}\r\n"
|
||||
],
|
||||
"names": [],
|
||||
"mappings": "ACAA;;GAEG;AAIH,AA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E,KAAK;EACnB,YAAY,EAAE,OAAmB;EACjC,aAAa,EAAE,mBAAmB;CAOnC;;AALC,AAAA,sBAAsB,CAVvB,wBAAU,CAU0B;EACjC,MAAM,EAAE,gBAAgB;EACxB,YAAY,EAAE,SAAS;EACvB,aAAa,EAAE,mBAAmB;CACnC"
|
||||
}
|
||||
14
assets/js/vendor/customselect/css/jquery.custom-select.min.css.map
vendored
Normal file
14
assets/js/vendor/customselect/css/jquery.custom-select.min.css.map
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"version": 3,
|
||||
"file": "jquery.custom-select.min.css",
|
||||
"sources": [
|
||||
"../../sass/jquery.custom-select.scss",
|
||||
"../../sass/_base.scss"
|
||||
],
|
||||
"sourcesContent": [
|
||||
"@import \"base\";\r\n\r\n/*\r\n * Custom Select jQuery Plugin Theme\r\n */\r\n\r\n$white: #fff !default;\r\n\r\n.#{$custom-select-block} {\r\n $_gutter: 0.75rem;\r\n $_color: #212121;\r\n\r\n &__option {\r\n position: relative;\r\n padding: 0.375rem $_gutter;\r\n font-size: 1rem;\r\n color: $_color;\r\n line-height: 1.5;\r\n\r\n &:focus {\r\n outline: none;\r\n }\r\n\r\n &:hover,\r\n &:focus {\r\n background-color: darken($white, 2.5%);\r\n }\r\n\r\n &--value {\r\n padding-right: $_gutter * 2 + 0.375rem;\r\n background-color: $white;\r\n border: 1px solid darken($white, 10%);\r\n border-radius: 0.25rem;\r\n\r\n &::after {\r\n position: absolute;\r\n box-sizing: border-box;\r\n width: 0;\r\n height: 0;\r\n top: 50%;\r\n right: $_gutter;\r\n border-width: 0.3rem;\r\n border-bottom-width: 0;\r\n border-style: solid;\r\n border-color: currentColor transparent;\r\n transform: translateY(-50%);\r\n content: \"\";\r\n\r\n .#{$custom-select-block}--active & {\r\n transform: translateY(-50%) rotate(-180deg);\r\n }\r\n }\r\n\r\n .#{$custom-select-block}--active & {\r\n border-bottom-color: transparent;\r\n border-radius: 0.25rem 0.25rem 0 0;\r\n\r\n &:hover,\r\n &:focus {\r\n background-color: $white;\r\n }\r\n\r\n @at-root {\r\n .#{$custom-select-block}--dropup#{&} {\r\n border-top-color: transparent;\r\n border-bottom-color: darken($white, 10%);\r\n border-radius: 0 0 0.25rem 0.25rem;\r\n }\r\n }\r\n }\r\n }\r\n\r\n &--selected {\r\n background-color: darken($white, 1.25%);\r\n }\r\n\r\n &[disabled] {\r\n color: lighten($_color, 50%);\r\n cursor: default;\r\n\r\n &:hover,\r\n &:focus {\r\n background-color: transparent;\r\n }\r\n }\r\n }\r\n\r\n &__option-wrap {\r\n overflow-y: auto;\r\n max-height: (0.375rem * 2 + 1rem * 1.5) * 5;\r\n\r\n &::-webkit-scrollbar {\r\n width: 16px;\r\n }\r\n\r\n &::-webkit-scrollbar-thumb {\r\n background-color: darken($white, 10%);\r\n background-clip: padding-box;\r\n border-width: 0 4px;\r\n border-style: solid;\r\n border-color: transparent;\r\n }\r\n }\r\n\r\n &__input {\r\n position: relative;\r\n z-index: 1;\r\n height: 2.25rem;\r\n margin-top: -1px;\r\n padding: 0 $_gutter;\r\n border-color: darken($white, 10%);\r\n transform: translateY(1px);\r\n font-size: 1rem;\r\n color: $_color;\r\n\r\n &:focus {\r\n outline: none;\r\n }\r\n\r\n .#{$custom-select-block}--dropup & {\r\n border-top-width: 0;\r\n margin-top: 0;\r\n transform: translateY(0);\r\n }\r\n }\r\n\r\n &__dropdown {\r\n overflow: hidden;\r\n z-index: 1;\r\n top: calc(100% - 1px);\r\n background-color: $white;\r\n border-width: 0 1px 1px;\r\n border-style: solid;\r\n border-color: darken($white, 10%);\r\n border-radius: 0 0 0.25rem 0.25rem;\r\n\r\n .#{$custom-select-block}--dropup & {\r\n bottom: calc(100% - 1px);\r\n border-width: 1px 1px 0;\r\n border-radius: 0.25rem 0.25rem 0 0;\r\n }\r\n }\r\n}\r\n",
|
||||
"/*\r\n * Custom Select jQuery Plugin Base\r\n */\r\n\r\n$custom-select-block: \"custom-select\" !default;\r\n\r\n.#{$custom-select-block} {\r\n position: relative;\r\n\r\n &__option {\r\n overflow: hidden;\r\n box-sizing: border-box;\r\n display: block;\r\n width: 100%;\r\n padding: 0;\r\n background-color: transparent;\r\n border: 0;\r\n border-radius: 0;\r\n font-family: inherit;\r\n white-space: nowrap;\r\n text-align: left;\r\n text-overflow: ellipsis;\r\n cursor: pointer;\r\n user-select: none;\r\n -webkit-appearance: none;\r\n -moz-appearance: none;\r\n appearance: none;\r\n }\r\n\r\n &__option-wrap {\r\n position: relative;\r\n }\r\n\r\n &__input {\r\n box-sizing: border-box;\r\n display: block;\r\n width: 100%;\r\n padding: 0;\r\n border-width: 1px 0;\r\n border-style: solid;\r\n border-radius: 0;\r\n font-family: inherit;\r\n -webkit-appearance: none;\r\n -moz-appearance: none;\r\n appearance: none;\r\n }\r\n\r\n &__dropdown {\r\n position: absolute;\r\n box-sizing: border-box;\r\n width: 100%;\r\n top: 100%;\r\n left: 0;\r\n\r\n .#{$custom-select-block}--dropup & {\r\n top: auto;\r\n bottom: 100%;\r\n }\r\n }\r\n}\r\n"
|
||||
],
|
||||
"names": [],
|
||||
"mappings": "ACMA,AAAA,cAAc,AAAW,CACvB,QAAQ,CAAE,QAAQ,CAoDnB,AAlDE,AAAD,sBAAS,AAAC,CACR,QAAQ,CAAE,MAAM,CAChB,UAAU,CAAE,UAAU,CACtB,OAAO,CAAE,KAAK,CACd,KAAK,CAAE,IAAI,CACX,OAAO,CAAE,CAAC,CACV,gBAAgB,CAAE,WAAW,CAC7B,MAAM,CAAE,CAAC,CACT,aAAa,CAAE,CAAC,CAChB,WAAW,CAAE,OAAO,CACpB,WAAW,CAAE,MAAM,CACnB,UAAU,CAAE,IAAI,CAChB,aAAa,CAAE,QAAQ,CACvB,MAAM,CAAE,OAAO,CACf,WAAW,CAAE,IAAI,CACjB,kBAAkB,CAAE,IAAI,CACxB,eAAe,CAAE,IAAI,CACrB,UAAU,CAAE,IAAI,CACjB,AAEA,AAAD,2BAAc,AAAC,CACb,QAAQ,CAAE,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AK,CACnB,YAAY,CAAE,WAAW,CAC1B,AAGF,AAAD,qBAAQ,AAAC,CACP,QAAQ,CAAE,QAAQ,CAClB,OAAO,CAAE,CAAC,CACV,MAAM,CAAE,OAAO,CACf,UAAU,CAAE,IAAI,CAChB,OAAO,CAAE,CAAC,CApGF,MAAO,CAqGf,YAAY,CAAE,OAAmB,CACjC,SAAS,CAAE,eAAe,CAC1B,SAAS,CAAE,IAAI,CACf,KAAK,CAvGE,OAAO,CAkHf,AApBA,AAWC,qBAXM,AAWL,MAAM,AAAC,CACN,OAAO,CAAE,IAAI,CACd,AAED,AAAA,sBAAsB,CAfvB,qBAAO,AAe6B,CACjC,gBAAgB,CAAE,CAAC,CACnB,UAAU,CAAE,CAAC,CACb,SAAS,CAAE,aAAa,CACzB,AAGF,AAAD,wBAAW,AAAC,CACV,QAAQ,CAAE,MAAM,CAChB,OAAO,CAAE,CAAC,CACV,GAAG,CAAE,gBAAgB,CACrB,gBAAgB,CA5HZ,IAAI,CA6HR,YAAY,CAAE,SAAS,CACvB,YAAY,CAAE,KAAK,CACnB,YAAY,CAAE,OAAmB,CACjC,aAAa,CAAE,mBAAmB,CAOnC,AALC,AAAA,sBAAsB,CAVvB,wBAAU,AAU0B,CACjC,MAAM,CAAE,gBAAgB,CACxB,YAAY,CAAE,SAAS,CACvB,aAAa,CAAE,mBAAmB,CACnC"
|
||||
}
|
||||
558
assets/js/vendor/customselect/js/jquery.custom-select.js
vendored
Normal file
558
assets/js/vendor/customselect/js/jquery.custom-select.js
vendored
Normal file
@@ -0,0 +1,558 @@
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
/*!
|
||||
* Custom Select jQuery Plugin
|
||||
*/
|
||||
var CustomSelect = function ($) {
|
||||
var defaults = {
|
||||
block: 'custom-select',
|
||||
hideCallback: false,
|
||||
includeValue: false,
|
||||
keyboard: true,
|
||||
modifier: false,
|
||||
placeholder: false,
|
||||
search: false,
|
||||
showCallback: false,
|
||||
transition: 0
|
||||
};
|
||||
|
||||
var CustomSelect =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
/**
|
||||
* Custom Select
|
||||
*
|
||||
* @param {Element} select Original `<select>` DOM element to customize.
|
||||
* @param {(Object|string)=} options Settings object or method name.
|
||||
* @param {string=} options.block Custom select BEM block name.
|
||||
* @param {Function=} options.hideCallback Fires after dropdown closes.
|
||||
* @param {boolean=} options.includeValue Adds chosen value option to
|
||||
* dropdown. If enabled also cancels dropdown options rerender.
|
||||
* @param {boolean=} options.keyboard Enables keyboard control.
|
||||
* @param {string=} options.modifier Custom select block BEM modifier.
|
||||
* @param {string=} options.placeholder Placeholder hint, can be an HTML
|
||||
* string (appears only if there is no explicitly selected options).
|
||||
* @param {boolean=} options.search Adds input to filter options.
|
||||
* @param {Function=} options.showCallback Fires after dropdown opens.
|
||||
* @param {(number|string)=} options.transition jQuery slideUp/Down param.
|
||||
*/
|
||||
function CustomSelect(select, options) {
|
||||
this._$select = $(select);
|
||||
this._options = _extends({}, defaults, typeof options === 'object' ? options : {}); // Modifiers
|
||||
|
||||
this._activeModifier = this._options.block + "--active";
|
||||
this._dropupModifier = this._options.block + "--dropup";
|
||||
this._optionSelectedModifier = this._options.block + "__option--selected"; // Event handlers that can be removed
|
||||
|
||||
this._keydown = this._keydown.bind(this);
|
||||
this._dropup = this._dropup.bind(this);
|
||||
this._outside = this._outside.bind(this);
|
||||
|
||||
this._init();
|
||||
}
|
||||
/**
|
||||
* Resets custom select options.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
|
||||
|
||||
var _proto = CustomSelect.prototype;
|
||||
|
||||
_proto.reset = function reset() {
|
||||
this._$dropdown.hide().empty();
|
||||
|
||||
this._$value.off('click');
|
||||
|
||||
this._fill();
|
||||
}
|
||||
/**
|
||||
* Renders initial state of custom select & sets
|
||||
* options click event listeners.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
;
|
||||
|
||||
_proto._init = function _init() {
|
||||
this._$element = $("<div class=\"" + this._options.block + "\">\n <button class=\"" + this._options.block + "__option " + this._options.block + "__option--value\" type=\"button\"></button>\n <div class=\"" + this._options.block + "__dropdown\" style=\"display: none;\"></div>\n </div>");
|
||||
|
||||
this._$select.hide().after(this._$element);
|
||||
|
||||
if (this._options.modifier) {
|
||||
this._$element.addClass(this._options.modifier);
|
||||
}
|
||||
|
||||
this._$value = this._$element.find("." + this._options.block + "__option--value");
|
||||
this._$dropdown = this._$element.find("." + this._options.block + "__dropdown");
|
||||
|
||||
this._fill();
|
||||
}
|
||||
/**
|
||||
* Renders custom select options by original
|
||||
* select element options.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
;
|
||||
|
||||
_proto._fill = function _fill() {
|
||||
var _this = this;
|
||||
|
||||
this._$values = this._$select.find('option');
|
||||
this._values = [];
|
||||
var placeholder = this._options.placeholder;
|
||||
$.each(this._$values, function (i, option) {
|
||||
var el = $(option).text().trim();
|
||||
|
||||
_this._values.push(el);
|
||||
});
|
||||
|
||||
if (placeholder) {
|
||||
// Check explicitly selected option
|
||||
if (this._$select.find('[selected]').length) {
|
||||
placeholder = false;
|
||||
} else {
|
||||
this._$value.html(placeholder); // Set select value to null
|
||||
|
||||
|
||||
this._$select.prop('selectedIndex', -1);
|
||||
}
|
||||
}
|
||||
|
||||
$.each(this._values, function (i, el) {
|
||||
var cssClass = _this._$values.eq(i).attr('class');
|
||||
|
||||
var $option = $("<button class=\"" + _this._options.block + "__option\" type=\"button\">" + el + "</button>");
|
||||
|
||||
var $selected = _this._$select.find(':selected');
|
||||
|
||||
if (_this._$values.eq(i).attr('disabled')) {
|
||||
$option.prop('disabled', true);
|
||||
}
|
||||
|
||||
if (!$selected.length && i === 0 || el === $selected.text().trim()) {
|
||||
if (!placeholder) {
|
||||
_this._$value.text(el).removeClass(_this._$value.data('class')).removeData('class').addClass(cssClass).data('class', cssClass);
|
||||
}
|
||||
|
||||
if (_this._options.includeValue || placeholder) {
|
||||
$option.addClass(cssClass);
|
||||
$option.toggleClass(_this._optionSelectedModifier, _this._$values.eq(i).is('[selected]'));
|
||||
|
||||
_this._$dropdown.append($option);
|
||||
}
|
||||
} else {
|
||||
$option.addClass(cssClass);
|
||||
|
||||
_this._$dropdown.append($option);
|
||||
}
|
||||
});
|
||||
this._$options = this._$dropdown.find("." + this._options.block + "__option");
|
||||
|
||||
if (this._options.search) {
|
||||
this._search();
|
||||
}
|
||||
|
||||
this._$value.one('click', function (event) {
|
||||
_this._show(event);
|
||||
});
|
||||
|
||||
this._$value.prop('disabled', !this._$options.length);
|
||||
|
||||
this._$options.on('click', function (event) {
|
||||
_this._select(event);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Shows custom select dropdown & sets outside
|
||||
* click listener to hide.
|
||||
*
|
||||
* @param {Object} event Value click jQuery event.
|
||||
* @private
|
||||
*/
|
||||
;
|
||||
|
||||
_proto._show = function _show(event) {
|
||||
var _this2 = this;
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
this._dropup();
|
||||
|
||||
$(window).on('resize scroll', this._dropup);
|
||||
|
||||
this._$element.addClass(this._activeModifier);
|
||||
|
||||
this._$dropdown.slideDown(this._options.transition, function () {
|
||||
if (_this2._options.search) {
|
||||
_this2._$input.focus();
|
||||
|
||||
if (_this2._options.includeValue) {
|
||||
_this2._scroll();
|
||||
}
|
||||
} // Open callback
|
||||
|
||||
|
||||
if (typeof _this2._options.showCallback === 'function') {
|
||||
_this2._options.showCallback.call(_this2._$element[0]);
|
||||
}
|
||||
});
|
||||
|
||||
setTimeout(function () {
|
||||
$(document).on('touchstart click', _this2._outside);
|
||||
}, 0);
|
||||
|
||||
this._$value.one('click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
_this2._hide();
|
||||
});
|
||||
|
||||
if (this._options.keyboard) {
|
||||
this._options.index = -1;
|
||||
$(window).on('keydown', this._keydown);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Hides custom select dropdown & resets events
|
||||
* listeners to initial.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
;
|
||||
|
||||
_proto._hide = function _hide() {
|
||||
var _this3 = this;
|
||||
|
||||
if (this._options.search) {
|
||||
this._$input.val('').blur();
|
||||
|
||||
this._$options.show();
|
||||
|
||||
this._$wrap.scrollTop(0);
|
||||
}
|
||||
|
||||
this._$dropdown.slideUp(this._options.transition, function () {
|
||||
_this3._$element.removeClass(_this3._activeModifier).removeClass(_this3._dropupModifier); // Close callback
|
||||
|
||||
|
||||
if (typeof _this3._options.hideCallback === 'function') {
|
||||
_this3._options.hideCallback.call(_this3._$element[0]);
|
||||
}
|
||||
|
||||
_this3._$value.off('click').one('click', function (event) {
|
||||
_this3._show(event);
|
||||
});
|
||||
|
||||
$(document).off('touchstart click', _this3._outside);
|
||||
$(window).off('resize scroll', _this3._dropup);
|
||||
});
|
||||
|
||||
if (this._options.keyboard) {
|
||||
this._$options.blur();
|
||||
|
||||
$(window).off('keydown', this._keydown);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Centers chosen option in scrollable element
|
||||
* of dropdown.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
;
|
||||
|
||||
_proto._scroll = function _scroll() {
|
||||
var _this4 = this;
|
||||
|
||||
$.each(this._$options, function (i, option) {
|
||||
var $option = $(option);
|
||||
|
||||
if ($option.text() === _this4._$value.text()) {
|
||||
var top = $option.position().top;
|
||||
|
||||
var height = _this4._$wrap.outerHeight();
|
||||
|
||||
var center = height / 2 - $option.outerHeight() / 2;
|
||||
|
||||
if (top > center) {
|
||||
_this4._$wrap.scrollTop(top - center);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Changes value of custom select & `<select>`
|
||||
* by chosen option.
|
||||
*
|
||||
* @param {Object} event Option click jQuery event.
|
||||
* @private
|
||||
*/
|
||||
;
|
||||
|
||||
_proto._select = function _select(event) {
|
||||
var _this5 = this;
|
||||
|
||||
event.preventDefault();
|
||||
var choice = $(event.currentTarget).text().trim();
|
||||
var values = [].concat(this._values);
|
||||
|
||||
this._$value.text(choice).removeClass(this._$value.data('class'));
|
||||
|
||||
this._$values.prop('selected', false);
|
||||
|
||||
$.each(values, function (i, el) {
|
||||
if (!_this5._options.includeValue && el === choice) {
|
||||
values.splice(i, 1);
|
||||
}
|
||||
|
||||
$.each(_this5._$values, function (i, option) {
|
||||
var $option = $(option);
|
||||
|
||||
if ($option.text().trim() === choice) {
|
||||
var cssClass = $option.attr('class');
|
||||
$option.prop('selected', true);
|
||||
|
||||
_this5._$value.addClass(cssClass).data('class', cssClass);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
this._hide();
|
||||
|
||||
if (!this._options.includeValue) {
|
||||
// Update dropdown options content
|
||||
if (this._$options.length > values.length) {
|
||||
var last = this._$options.eq(values.length);
|
||||
|
||||
last.remove();
|
||||
this._$options = this._$options.not(last);
|
||||
|
||||
if (!this._$options.length) {
|
||||
this._$value.prop('disabled', true);
|
||||
}
|
||||
}
|
||||
|
||||
$.each(this._$options, function (i, option) {
|
||||
var $option = $(option);
|
||||
$option.text(values[i]); // Reset option class
|
||||
|
||||
$option.attr('class', _this5._options.block + "__option");
|
||||
$.each(_this5._$values, function () {
|
||||
var $this = $(this);
|
||||
|
||||
if ($this.text().trim() === values[i]) {
|
||||
$option.addClass($this.attr('class'));
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// Select chosen option
|
||||
this._$options.removeClass(this._optionSelectedModifier);
|
||||
|
||||
$.each(this._$options, function (i, option) {
|
||||
var $option = $(option);
|
||||
|
||||
if ($option.text().trim() === choice) {
|
||||
$option.addClass(_this5._optionSelectedModifier);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (typeof event.originalEvent !== 'undefined') {
|
||||
this._$select.trigger('change');
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Wraps options by wrap element, adds search
|
||||
* input to dropdown.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
;
|
||||
|
||||
_proto._search = function _search() {
|
||||
var _this6 = this;
|
||||
|
||||
this._$input = $("<input class=\"" + this._options.block + "__input\" autocomplete=\"off\">");
|
||||
|
||||
this._$dropdown.prepend(this._$input); // Add scrollable wrap
|
||||
|
||||
|
||||
this._$options.wrapAll("<div class=\"" + this._options.block + "__option-wrap\"></div>");
|
||||
|
||||
this._$wrap = this._$element.find("." + this._options.block + "__option-wrap");
|
||||
|
||||
this._$input.on('focus', function () {
|
||||
_this6._options.index = -1;
|
||||
});
|
||||
|
||||
this._$input.on('keyup', function () {
|
||||
var query = _this6._$input.val().trim();
|
||||
|
||||
if (query.length) {
|
||||
_this6._$wrap.scrollTop(0);
|
||||
|
||||
setTimeout(function () {
|
||||
if (query === _this6._$input.val().trim()) {
|
||||
$.each(_this6._$options, function (i, option) {
|
||||
var $option = $(option);
|
||||
var text = $option.text().trim().toLowerCase();
|
||||
var match = text.indexOf(query.toLowerCase()) !== -1;
|
||||
$option.toggle(match);
|
||||
});
|
||||
}
|
||||
}, 300);
|
||||
} else {
|
||||
_this6._$options.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Toggles custom select dropup modifier based
|
||||
* on space for dropdown below.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
;
|
||||
|
||||
_proto._dropup = function _dropup() {
|
||||
var bottom = this._$element[0].getBoundingClientRect().bottom;
|
||||
|
||||
var up = $(window).height() - bottom < this._$dropdown.height();
|
||||
|
||||
this._$element.toggleClass(this._dropupModifier, up);
|
||||
}
|
||||
/**
|
||||
* Hides dropdown if target of event (e.g. click
|
||||
* on `$window`) is not custom select.
|
||||
*
|
||||
* @param {Object} event Outside "click" jQuery event.
|
||||
* @private
|
||||
*/
|
||||
;
|
||||
|
||||
_proto._outside = function _outside(event) {
|
||||
var $target = $(event.target);
|
||||
|
||||
if (!$target.parents().is(this._$element) && !$target.is(this._$element)) {
|
||||
this._hide();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Controls navigation from keyboard by custom
|
||||
* select options.
|
||||
*
|
||||
* @param {Object} event Keydown jQuery event.
|
||||
* @private
|
||||
*/
|
||||
;
|
||||
|
||||
_proto._keydown = function _keydown(event) {
|
||||
var $visible = this._$options.filter(':visible').not('[disabled]');
|
||||
|
||||
switch (event.which) {
|
||||
// Down
|
||||
case 40:
|
||||
event.preventDefault();
|
||||
var next = $visible.eq(this._options.index + 1).length;
|
||||
|
||||
if (next) {
|
||||
this._options.index += 1;
|
||||
} else {
|
||||
this._options.index = 0;
|
||||
}
|
||||
|
||||
$visible.eq(this._options.index).focus();
|
||||
break;
|
||||
// Up
|
||||
|
||||
case 38:
|
||||
event.preventDefault();
|
||||
var prev = $visible.eq(this._options.index - 1).length;
|
||||
|
||||
if (prev && this._options.index - 1 >= 0) {
|
||||
this._options.index -= 1;
|
||||
} else {
|
||||
this._options.index = $visible.length - 1;
|
||||
}
|
||||
|
||||
$visible.eq(this._options.index).focus();
|
||||
break;
|
||||
// Enter
|
||||
|
||||
case 13: // Space
|
||||
|
||||
case 32:
|
||||
if (!this._$input || !this._$input.is(':focus')) {
|
||||
event.preventDefault();
|
||||
|
||||
var $option = this._$options.add(this._$value).filter(':focus');
|
||||
|
||||
$option.trigger('click');
|
||||
|
||||
if (!$option.is(this._$value)) {
|
||||
this._$select.trigger('change');
|
||||
}
|
||||
|
||||
this._$value.focus();
|
||||
}
|
||||
|
||||
break;
|
||||
// Esc
|
||||
|
||||
case 27:
|
||||
event.preventDefault();
|
||||
|
||||
this._hide();
|
||||
|
||||
this._$value.focus();
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Creates jQuery plugin function.
|
||||
*
|
||||
* @param {(Object|string)=} config Options or method.
|
||||
* @returns {Function} jQuery plugin.
|
||||
*/
|
||||
;
|
||||
|
||||
CustomSelect._jQueryPlugin = function _jQueryPlugin(config) {
|
||||
return this.each(function () {
|
||||
var $this = $(this);
|
||||
var data = $this.data('custom-select');
|
||||
|
||||
if (!data) {
|
||||
if (typeof config !== 'string') {
|
||||
data = new CustomSelect(this, config);
|
||||
$this.data('custom-select', data);
|
||||
}
|
||||
} else {
|
||||
if (config === 'reset') {
|
||||
data.reset();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return CustomSelect;
|
||||
}();
|
||||
|
||||
$.fn['customSelect'] = CustomSelect._jQueryPlugin;
|
||||
|
||||
$.fn['customSelect'].noConflict = function () {
|
||||
return $.fn['customSelect'];
|
||||
};
|
||||
|
||||
return CustomSelect;
|
||||
}($);
|
||||
//# sourceMappingURL=jquery.custom-select.js.map
|
||||
1
assets/js/vendor/customselect/js/jquery.custom-select.js.map
vendored
Normal file
1
assets/js/vendor/customselect/js/jquery.custom-select.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
assets/js/vendor/customselect/js/jquery.custom-select.min.js.map
vendored
Normal file
1
assets/js/vendor/customselect/js/jquery.custom-select.min.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user