@danielgindi/selectbox 2.0.26 → 2.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/selectbox.css +1 -1
- package/css/selectbox.css.map +1 -1
- package/dist/lib.cjs.js +76 -22
- package/dist/lib.cjs.js.map +1 -1
- package/dist/lib.cjs.min.js +2 -2
- package/dist/lib.cjs.min.js.map +1 -1
- package/dist/lib.es6.js +75 -21
- package/dist/lib.es6.js.map +1 -1
- package/dist/lib.es6.min.js +2 -2
- package/dist/lib.es6.min.js.map +1 -1
- package/dist/lib.umd.js +76 -22
- package/dist/lib.umd.js.map +1 -1
- package/dist/lib.umd.min.js +2 -2
- package/dist/lib.umd.min.js.map +1 -1
- package/lib/DropList.js +2 -2
- package/lib/SelectBox.js +72 -18
- package/package.json +1 -1
- package/scss/selectbox.scss +26 -4
- package/vue/DropList.vue +129 -127
- package/vue/SelectBox.vue +255 -230
package/css/selectbox.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
.selectbox{--selectbox-border-radius: 4px;--selectbox-open-indicator-spacing: 0.25em;--selectbox-open-indicator-width: 1.2em;--selectbox-spinner-spacing: 0.125em;--selectbox-spinner-width: 1.2em;--selectbox-clear-spacing: 0.125em;--selectbox-clear-width: 1.2em;--selectbox-horz-padding: 0.5em;--selectbox-single-top-padding: 0.1667em;--selectbox-single-bottom-padding: 0.3334em;--selectbox-multi-vert-padding: 0.357em;--selectbox-multi-item-border-width: 1px;--selectbox-multi-item-border-radius: 4px;--selectbox-multi-item-horz-spacing: 0.416em;--selectbox-multi-item-vert-spacing: 0.416em;--selectbox-multi-item-horz-padding: 0.416em;--selectbox-multi-item-top-padding: 0px;--selectbox-multi-item-remove-spacing: 0.153em;--selectbox-multi-item-bottom-padding: 0.2em;--selectbox-multi-search-top-offset: 0px;position:relative;box-sizing:border-box;display:inline-block;cursor:default;outline:0;line-height:1.2;user-select:none;-webkit-user-select:none;color:#000;background-color:#fff;border-radius:var(--selectbox-border-radius);border:solid #aaa 1px}.selectbox.selectbox__rtl{direction:rtl}.selectbox.selectbox__searchable{cursor:text}.selectbox[aria-disabled=true]{border:solid #aaa 1px;background-color:#eee;cursor:default}.selectbox[aria-disabled=true] *{cursor:default}.selectbox.has_droplist_above{border-top-left-radius:0;border-top-right-radius:0}.selectbox.has_droplist_below{border-bottom-left-radius:0;border-bottom-right-radius:0}.selectbox.selectbox__has_open_indicator:not(.selectbox__has_clear):not(.selectbox__has_spinner){padding-right:var(--selectbox-open-indicator-width)}.selectbox.selectbox__has_open_indicator:not(.selectbox__has_clear):not(.selectbox__has_spinner).selectbox__rtl,[dir=rtl] .selectbox.selectbox__has_open_indicator:not(.selectbox__has_clear):not(.selectbox__has_spinner):not(.selectbox__ltr){padding-right:0;padding-left:var(--selectbox-open-indicator-width)}.selectbox.selectbox__has_clear:not(.selectbox__has_open_indicator):not(.selectbox__has_spinner){padding-right:var(--selectbox-clear-width)}.selectbox.selectbox__has_clear:not(.selectbox__has_open_indicator):not(.selectbox__has_spinner).selectbox__rtl,[dir=rtl] .selectbox.selectbox__has_clear:not(.selectbox__has_open_indicator):not(.selectbox__has_spinner):not(.selectbox__ltr){padding-right:0;padding-left:var(--selectbox-clear-width)}.selectbox.selectbox__has_spinner:not(.selectbox__has_open_indicator):not(.selectbox__has_clear){padding-right:var(--selectbox-spinner-width)}.selectbox.selectbox__has_spinner:not(.selectbox__has_open_indicator):not(.selectbox__has_clear).selectbox__rtl,[dir=rtl] .selectbox.selectbox__has_spinner:not(.selectbox__has_open_indicator):not(.selectbox__has_clear):not(.selectbox__ltr){padding-right:0;padding-left:var(--selectbox-clear-width)}.selectbox.selectbox__has_open_indicator.selectbox__has_spinner:not(.selectbox__has_clear){padding-right:calc(var(--selectbox-open-indicator-width) + var(--selectbox-spinner-width))}.selectbox.selectbox__has_open_indicator.selectbox__has_spinner:not(.selectbox__has_clear).selectbox__rtl,[dir=rtl] .selectbox.selectbox__has_open_indicator.selectbox__has_spinner:not(.selectbox__has_clear):not(.selectbox__ltr){padding-right:0;padding-left:calc(var(--selectbox-open-indicator-width) + var(--selectbox-spinner-width))}.selectbox.selectbox__has_open_indicator.selectbox__has_clear:not(.selectbox__has_spinner){padding-right:calc(var(--selectbox-open-indicator-width) + var(--selectbox-clear-width))}.selectbox.selectbox__has_open_indicator.selectbox__has_clear:not(.selectbox__has_spinner).selectbox__rtl,[dir=rtl] .selectbox.selectbox__has_open_indicator.selectbox__has_clear:not(.selectbox__has_spinner):not(.selectbox__ltr){padding-right:0;padding-left:calc(var(--selectbox-open-indicator-width) + var(--selectbox-clear-width))}.selectbox.selectbox__has_clear.selectbox__has_spinner:not(.selectbox__has_open_indicator){padding-right:calc(var(--selectbox-clear-width) + var(--selectbox-spinner-width))}.selectbox.selectbox__has_clear.selectbox__has_spinner:not(.selectbox__has_open_indicator).selectbox__rtl,[dir=rtl] .selectbox.selectbox__has_clear.selectbox__has_spinner:not(.selectbox__has_open_indicator):not(.selectbox__ltr){padding-right:0;padding-left:calc(var(--selectbox-clear-width) + var(--selectbox-spinner-width))}.selectbox.selectbox__has_open_indicator.selectbox__has_clear.selectbox__has_spinner{padding-right:calc(var(--selectbox-open-indicator-width) + var(--selectbox-clear-width) + var(--selectbox-spinner-width))}.selectbox.selectbox__has_open_indicator.selectbox__has_clear.selectbox__has_spinner.selectbox__rtl,[dir=rtl] .selectbox.selectbox__has_open_indicator.selectbox__has_clear.selectbox__has_spinner:not(.selectbox__ltr){padding-right:0;padding-left:calc(var(--selectbox-open-indicator-width) + var(--selectbox-clear-width) + var(--selectbox-spinner-width))}.selectbox.selectbox__multi{padding-top:var(--selectbox-multi-vert-padding);padding-bottom:var(--selectbox-multi-vert-padding)}.selectbox__focus{border-color:#66afe9;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.selectbox__list{box-sizing:border-box;list-style:none none;display:inline-block;vertical-align:top;width:100%;margin:calc(0px - var(--selectbox-multi-item-vert-spacing)) 0 0;padding:0 var(--selectbox-horz-padding);text-overflow:ellipsis;white-space:nowrap}.selectbox__rtl .selectbox__list::before,[dir=rtl] .selectbox:not(.selectbox__ltr) .selectbox__list::before{float:left}.selectbox__open_indicator{position:absolute;right:var(--selectbox-open-indicator-spacing);top:50%;transform:translateY(-50%);z-index:2;font-size:1em;width:1em;height:.5em;overflow:hidden;direction:ltr;text-align:left;cursor:pointer}.selectbox__open_indicator::before{border-style:solid;border-color:#9d9d9d;border-width:1.5px 1.5px 0 0;content:"";display:inline-block;height:.45em;left:.2em;position:relative;top:-0.18em;transform:rotate(135deg);vertical-align:top;width:.45em;transition:transform 150ms cubic-bezier(1, -0.115, 0.975, 0.855)}.selectbox__open_list .selectbox__open_indicator::before{transform:translateY(50%) rotate(-45deg)}.selectbox__rtl .selectbox__open_indicator,[dir=rtl] .selectbox:not(.selectbox__ltr) .selectbox__open_indicator{right:auto;left:var(--selectbox-open-indicator-spacing)}.selectbox__rtl .selectbox__open_indicator::before,[dir=rtl] .selectbox:not(.selectbox__ltr) .selectbox__open_indicator::before{transform:rotate(-225deg)}.selectbox__rtl.selectbox__open_list .selectbox__open_indicator::before,[dir=rtl] .selectbox.selectbox__open_list:not(.selectbox__ltr) .selectbox__open_indicator::before{transform:translateY(50%) rotate(315deg)}.selectbox__clear{position:absolute;right:var(--selectbox-clear-spacing);top:50%;transform:translateY(-50%);z-index:2}.selectbox__clear>button{box-sizing:border-box;display:block;cursor:pointer;font-weight:bold;width:26px;text-align:center;font-size:13px;line-height:1.4;margin:0;padding:0;border:0;background:none}.selectbox__clear>button:before{content:"×"}.selectbox__clear>button:focus{outline:none;color:red}.selectbox__rtl .selectbox__clear,[dir=rtl] .selectbox:not(.selectbox__ltr) .selectbox__clear{right:auto;left:var(--selectbox-clear-spacing)}.selectbox__has_open_indicator.selectbox__has_clear .selectbox__clear{right:calc(var(--selectbox-clear-spacing) + var(--selectbox-open-indicator-width))}.selectbox__has_open_indicator.selectbox__has_clear.selectbox__rtl .selectbox__clear,[dir=rtl] .selectbox.selectbox__has_open_indicator.selectbox__has_clear:not(.selectbox__ltr) .selectbox__clear{right:auto;left:calc(var(--selectbox-clear-spacing) + var(--selectbox-open-indicator-width))}.selectbox[aria-disabled=true]>.selectbox__clear{display:none}.selectbox__spinner{position:absolute;right:var(--selectbox-spinner-spacing);top:50%;transform:translateY(-50%);z-index:2}.selectbox__spinner::before{content:"";display:block;font-size:1em;width:1em;height:1em;text-indent:-9999em;overflow:hidden;border-top:.3em solid rgba(100,100,100,.1);border-right:.3em solid rgba(100,100,100,.1);border-bottom:.3em solid rgba(100,100,100,.1);border-left:.3em solid rgba(60,60,60,.45);border-radius:50%;transform:translateZ(0);animation:selectbox__spinner_anim 1.1s infinite linear;transition:opacity .1s}.selectbox__rtl .selectbox__spinner,[dir=rtl] .selectbox:not(.selectbox__ltr) .selectbox__spinner{right:auto;left:var(--selectbox-spinner-spacing)}.selectbox__has_spinner.selectbox__has_open_indicator:not(.selectbox__has_clear) .selectbox__spinner{right:calc(var(--selectbox-spinner-spacing) + var(--selectbox-open-indicator-width))}.selectbox__has_spinner.selectbox__has_clear:not(.selectbox__has_open_indicator) .selectbox__spinner{right:calc(var(--selectbox-spinner-spacing) + var(--selectbox-clear-width))}.selectbox__has_spinner.selectbox__has_open_indicator.selectbox__has_clear .selectbox__spinner{right:calc(var(--selectbox-spinner-spacing) + var(--selectbox-clear-width) + var(--selectbox-open-indicator-width) + var(--selectbox-spinner-width))}.selectbox__has_spinner.selectbox__has_open_indicator:not(.selectbox__has_clear).selectbox__rtl .selectbox__spinner,[dir=rtl] .selectbox.selectbox__has_spinner.selectbox__has_open_indicator:not(.selectbox__has_clear):not(.selectbox__ltr) .selectbox__spinner{right:auto;left:var(var(--selectbox-spinner-spacing)--selectbox-open-indicator-width)}.selectbox__has_spinner.selectbox__has_clear:not(.selectbox__has_open_indicator).selectbox__rtl .selectbox__spinner,[dir=rtl] .selectbox.selectbox__has_spinner.selectbox__has_clear:not(.selectbox__has_open_indicator):not(.selectbox__ltr) .selectbox__spinner{right:auto;left:calc(var(--selectbox-spinner-spacing) + var(--selectbox-clear-width))}.selectbox__has_spinner.selectbox__has_clear.selectbox__has_open_indicator.selectbox__rtl .selectbox__spinner,[dir=rtl] .selectbox.selectbox__has_spinner.selectbox__has_clearselectbox__has_open_indicator:not(.selectbox__ltr) .selectbox__spinner{right:auto;left:calc(var(--selectbox-spinner-spacing) + var(--selectbox-clear-width) + var(--selectbox-open-indicator-width))}.selectbox__item{box-sizing:border-box;float:left;cursor:default;background-color:#e4e4e4;border:var(--selectbox-multi-item-border-width) solid #aaa;border-radius:var(--selectbox-multi-item-border-radius);margin-left:0;margin-right:var(--selectbox-multi-item-horz-spacing);margin-top:var(--selectbox-multi-item-vert-spacing);padding:var(--selectbox-multi-item-top-padding) var(--selectbox-multi-item-horz-padding) var(--selectbox-multi-item-bottom-padding);line-height:inherit}.selectbox__item span{vertical-align:top}.selectbox__item:focus{background-color:#ccc;outline:0}.selectbox__rtl .selectbox__item,[dir=rtl] .selectbox:not(.selectbox__ltr) .selectbox__item{float:right;margin-left:var(--selectbox-multi-item-horz-spacing);margin-right:0}.selectbox__item_remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-top:.2em;margin-right:var(--selectbox-multi-item-remove-spacing);font-size:13px}.selectbox__item_remove:before{content:"×"}.selectbox__rtl .selectbox__item_remove,[dir=rtl] .selectbox:not(.selectbox__ltr) .selectbox__item_remove{margin-left:var(--selectbox-multi-item-remove-spacing);margin-right:0}.selectbox__single_wrapper{position:relative;min-height:1em;max-width:100%;margin:0;padding:var(--selectbox-single-top-padding) var(--selectbox-horz-padding) var(--selectbox-single-bottom-padding) var(--selectbox-horz-padding);color:currentColor}.selectbox__single_wrapper:empty::after{content:""}.selectbox__empty_selection .selectbox__single_wrapper{width:12em}.selectbox__has_selection.selectbox__has_input .selectbox__single_wrapper{opacity:0}.selectbox__has_selection.selectbox__empty_input.has_droplist .selectbox__single_wrapper,.selectbox__has_selection.selectbox__empty_input.selectbox__focus .selectbox__single_wrapper{opacity:.5}.selectbox__search_wrapper{max-width:100%}.selectbox__multi .selectbox__search_wrapper{float:left;margin-top:calc(var(--selectbox-multi-item-vert-spacing) + var(--selectbox-multi-item-border-width) + var(--selectbox-multi-item-top-padding) + var(--selectbox-multi-search-top-offset))}.selectbox__single .selectbox__search_wrapper{position:absolute;z-index:1;left:0;top:var(--selectbox-single-top-padding)}.selectbox__multi.selectbox__rtl .selectbox__search_wrapper,[dir=rtl] .selectbox.selectbox__multi:not(.selectbox__ltr) .selectbox__search_wrapper{float:right}.selectbox__single.selectbox__rtl .selectbox__search_wrapper,[dir=rtl] .selectbox.selectbox__single:not(.selectbox__ltr) .selectbox__search_wrapper{right:0;left:auto}input.selectbox__search_field{box-sizing:border-box;display:inline-block;height:auto;max-width:100%;cursor:inherit;color:currentColor;-webkit-appearance:none;appearance:none;background:rgba(0,0,0,0);box-shadow:none;border:none;border-radius:0;outline:0;margin:0;padding:0;font-family:inherit;font-size:1em;line-height:normal}input.selectbox__search_field::-webkit-search-decoration,input.selectbox__search_field::-webkit-search-cancel-button,input.selectbox__search_field::-webkit-search-results-button,input.selectbox__search_field::-webkit-search-results-decoration{appearance:none;-webkit-appearance:none;width:0;height:0;margin:0;padding:0}input.selectbox__search_field::-ms-clear{appearance:none;-webkit-appearance:none;width:0;height:0;margin:0;padding:0}input.selectbox__search_field:focus{outline:0 !important;border:0 !important;box-shadow:none !important}.selectbox__single input.selectbox__search_field{padding:0 var(--selectbox-horz-padding)}.selectbox__multi input.selectbox__search_field{padding:0}.selectbox.has_droplist_above{border-top-left-radius:0;border-top-right-radius:0}.selectbox.has_droplist_below{border-bottom-left-radius:0;border-bottom-right-radius:0}@-webkit-keyframes selectbox__spinner_anim{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes selectbox__spinner_anim{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}
|
|
1
|
+
.selectbox{--selectbox-border-radius: 4px;--selectbox-open-indicator-spacing: 0.25em;--selectbox-open-indicator-width: 1.2em;--selectbox-spinner-spacing: 0.125em;--selectbox-spinner-width: 1.2em;--selectbox-clear-spacing: 0.125em;--selectbox-clear-width: 1.2em;--selectbox-horz-padding: 0.5em;--selectbox-single-top-padding: 0.1667em;--selectbox-single-bottom-padding: 0.3334em;--selectbox-multi-vert-padding: 0.357em;--selectbox-multi-item-border-width: 1px;--selectbox-multi-item-border-radius: 4px;--selectbox-multi-item-horz-spacing: 0.416em;--selectbox-multi-item-vert-spacing: 0.416em;--selectbox-multi-item-horz-padding: 0.416em;--selectbox-multi-item-top-padding: 0px;--selectbox-multi-item-remove-spacing: 0.153em;--selectbox-multi-item-bottom-padding: 0.2em;--selectbox-multi-search-top-offset: 0px;position:relative;box-sizing:border-box;display:inline-block;cursor:default;outline:0;line-height:1.2;user-select:none;-webkit-user-select:none;color:#000;background-color:#fff;border-radius:var(--selectbox-border-radius);border:solid #aaa 1px}.selectbox.selectbox__rtl{direction:rtl}.selectbox.selectbox__searchable{cursor:text}.selectbox[aria-disabled=true]{border:solid #aaa 1px;background-color:#eee;cursor:default}.selectbox[aria-disabled=true] *{cursor:default}.selectbox[aria-readonly=true]{cursor:default}.selectbox[aria-readonly=true] *{cursor:default}.selectbox.has_droplist_above{border-top-left-radius:0;border-top-right-radius:0}.selectbox.has_droplist_below{border-bottom-left-radius:0;border-bottom-right-radius:0}.selectbox.selectbox__has_open_indicator:not(.selectbox__has_clear):not(.selectbox__has_spinner){padding-right:var(--selectbox-open-indicator-width)}.selectbox.selectbox__has_open_indicator:not(.selectbox__has_clear):not(.selectbox__has_spinner).selectbox__rtl,[dir=rtl] .selectbox.selectbox__has_open_indicator:not(.selectbox__has_clear):not(.selectbox__has_spinner):not(.selectbox__ltr){padding-right:0;padding-left:var(--selectbox-open-indicator-width)}.selectbox.selectbox__has_clear:not(.selectbox__has_open_indicator):not(.selectbox__has_spinner){padding-right:var(--selectbox-clear-width)}.selectbox.selectbox__has_clear:not(.selectbox__has_open_indicator):not(.selectbox__has_spinner).selectbox__rtl,[dir=rtl] .selectbox.selectbox__has_clear:not(.selectbox__has_open_indicator):not(.selectbox__has_spinner):not(.selectbox__ltr){padding-right:0;padding-left:var(--selectbox-clear-width)}.selectbox.selectbox__has_spinner:not(.selectbox__has_open_indicator):not(.selectbox__has_clear){padding-right:var(--selectbox-spinner-width)}.selectbox.selectbox__has_spinner:not(.selectbox__has_open_indicator):not(.selectbox__has_clear).selectbox__rtl,[dir=rtl] .selectbox.selectbox__has_spinner:not(.selectbox__has_open_indicator):not(.selectbox__has_clear):not(.selectbox__ltr){padding-right:0;padding-left:var(--selectbox-clear-width)}.selectbox.selectbox__has_open_indicator.selectbox__has_spinner:not(.selectbox__has_clear){padding-right:calc(var(--selectbox-open-indicator-width) + var(--selectbox-spinner-width))}.selectbox.selectbox__has_open_indicator.selectbox__has_spinner:not(.selectbox__has_clear).selectbox__rtl,[dir=rtl] .selectbox.selectbox__has_open_indicator.selectbox__has_spinner:not(.selectbox__has_clear):not(.selectbox__ltr){padding-right:0;padding-left:calc(var(--selectbox-open-indicator-width) + var(--selectbox-spinner-width))}.selectbox.selectbox__has_open_indicator.selectbox__has_clear:not(.selectbox__has_spinner){padding-right:calc(var(--selectbox-open-indicator-width) + var(--selectbox-clear-width))}.selectbox.selectbox__has_open_indicator.selectbox__has_clear:not(.selectbox__has_spinner).selectbox__rtl,[dir=rtl] .selectbox.selectbox__has_open_indicator.selectbox__has_clear:not(.selectbox__has_spinner):not(.selectbox__ltr){padding-right:0;padding-left:calc(var(--selectbox-open-indicator-width) + var(--selectbox-clear-width))}.selectbox.selectbox__has_clear.selectbox__has_spinner:not(.selectbox__has_open_indicator){padding-right:calc(var(--selectbox-clear-width) + var(--selectbox-spinner-width))}.selectbox.selectbox__has_clear.selectbox__has_spinner:not(.selectbox__has_open_indicator).selectbox__rtl,[dir=rtl] .selectbox.selectbox__has_clear.selectbox__has_spinner:not(.selectbox__has_open_indicator):not(.selectbox__ltr){padding-right:0;padding-left:calc(var(--selectbox-clear-width) + var(--selectbox-spinner-width))}.selectbox.selectbox__has_open_indicator.selectbox__has_clear.selectbox__has_spinner{padding-right:calc(var(--selectbox-open-indicator-width) + var(--selectbox-clear-width) + var(--selectbox-spinner-width))}.selectbox.selectbox__has_open_indicator.selectbox__has_clear.selectbox__has_spinner.selectbox__rtl,[dir=rtl] .selectbox.selectbox__has_open_indicator.selectbox__has_clear.selectbox__has_spinner:not(.selectbox__ltr){padding-right:0;padding-left:calc(var(--selectbox-open-indicator-width) + var(--selectbox-clear-width) + var(--selectbox-spinner-width))}.selectbox.selectbox__multi{padding-top:var(--selectbox-multi-vert-padding);padding-bottom:var(--selectbox-multi-vert-padding)}.selectbox__focus{border-color:#66afe9;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.selectbox__list{box-sizing:border-box;list-style:none none;display:inline-block;vertical-align:top;width:100%;margin:calc(0px - var(--selectbox-multi-item-vert-spacing)) 0 0;padding:0 var(--selectbox-horz-padding);text-overflow:ellipsis;white-space:nowrap}.selectbox__rtl .selectbox__list::before,[dir=rtl] .selectbox:not(.selectbox__ltr) .selectbox__list::before{float:left}.selectbox__open_indicator{position:absolute;right:var(--selectbox-open-indicator-spacing);top:50%;transform:translateY(-50%);z-index:2;font-size:1em;width:1em;height:.5em;overflow:hidden;direction:ltr;text-align:left;cursor:pointer}.selectbox__open_indicator::before{border-style:solid;border-color:#9d9d9d;border-width:1.5px 1.5px 0 0;content:"";display:inline-block;height:.45em;left:.2em;position:relative;top:-0.18em;transform:rotate(135deg);vertical-align:top;width:.45em;transition:transform 150ms cubic-bezier(1, -0.115, 0.975, 0.855)}.selectbox__open_list .selectbox__open_indicator::before{transform:translateY(50%) rotate(-45deg)}.selectbox__rtl .selectbox__open_indicator,[dir=rtl] .selectbox:not(.selectbox__ltr) .selectbox__open_indicator{right:auto;left:var(--selectbox-open-indicator-spacing)}.selectbox__rtl .selectbox__open_indicator::before,[dir=rtl] .selectbox:not(.selectbox__ltr) .selectbox__open_indicator::before{transform:rotate(-225deg)}.selectbox__rtl.selectbox__open_list .selectbox__open_indicator::before,[dir=rtl] .selectbox.selectbox__open_list:not(.selectbox__ltr) .selectbox__open_indicator::before{transform:translateY(50%) rotate(315deg)}.selectbox__clear{position:absolute;right:var(--selectbox-clear-spacing);top:50%;transform:translateY(-50%);z-index:2}.selectbox__clear>button{box-sizing:border-box;display:block;cursor:pointer;font-weight:bold;width:26px;text-align:center;font-size:13px;line-height:1.4;margin:0;padding:0;border:0;background:none}.selectbox__clear>button:before{content:"×"}.selectbox__clear>button:focus{outline:none;color:red}.selectbox__rtl .selectbox__clear,[dir=rtl] .selectbox:not(.selectbox__ltr) .selectbox__clear{right:auto;left:var(--selectbox-clear-spacing)}.selectbox__has_open_indicator.selectbox__has_clear .selectbox__clear{right:calc(var(--selectbox-clear-spacing) + var(--selectbox-open-indicator-width))}.selectbox__has_open_indicator.selectbox__has_clear.selectbox__rtl .selectbox__clear,[dir=rtl] .selectbox.selectbox__has_open_indicator.selectbox__has_clear:not(.selectbox__ltr) .selectbox__clear{right:auto;left:calc(var(--selectbox-clear-spacing) + var(--selectbox-open-indicator-width))}.selectbox[aria-disabled=true]>.selectbox__clear,.selectbox[aria-readonly=true]>.selectbox__clear{display:none}.selectbox__spinner{position:absolute;right:var(--selectbox-spinner-spacing);top:50%;transform:translateY(-50%);z-index:2}.selectbox__spinner::before{content:"";display:block;font-size:1em;width:1em;height:1em;text-indent:-9999em;overflow:hidden;border-top:.3em solid rgba(100,100,100,.1);border-right:.3em solid rgba(100,100,100,.1);border-bottom:.3em solid rgba(100,100,100,.1);border-left:.3em solid rgba(60,60,60,.45);border-radius:50%;transform:translateZ(0);animation:selectbox__spinner_anim 1.1s infinite linear;transition:opacity .1s}.selectbox__rtl .selectbox__spinner,[dir=rtl] .selectbox:not(.selectbox__ltr) .selectbox__spinner{right:auto;left:var(--selectbox-spinner-spacing)}.selectbox__has_spinner.selectbox__has_open_indicator:not(.selectbox__has_clear) .selectbox__spinner{right:calc(var(--selectbox-spinner-spacing) + var(--selectbox-open-indicator-width))}.selectbox__has_spinner.selectbox__has_clear:not(.selectbox__has_open_indicator) .selectbox__spinner{right:calc(var(--selectbox-spinner-spacing) + var(--selectbox-clear-width))}.selectbox__has_spinner.selectbox__has_open_indicator.selectbox__has_clear .selectbox__spinner{right:calc(var(--selectbox-spinner-spacing) + var(--selectbox-clear-width) + var(--selectbox-open-indicator-width) + var(--selectbox-spinner-width))}.selectbox__has_spinner.selectbox__has_open_indicator:not(.selectbox__has_clear).selectbox__rtl .selectbox__spinner,[dir=rtl] .selectbox.selectbox__has_spinner.selectbox__has_open_indicator:not(.selectbox__has_clear):not(.selectbox__ltr) .selectbox__spinner{right:auto;left:var(var(--selectbox-spinner-spacing)--selectbox-open-indicator-width)}.selectbox__has_spinner.selectbox__has_clear:not(.selectbox__has_open_indicator).selectbox__rtl .selectbox__spinner,[dir=rtl] .selectbox.selectbox__has_spinner.selectbox__has_clear:not(.selectbox__has_open_indicator):not(.selectbox__ltr) .selectbox__spinner{right:auto;left:calc(var(--selectbox-spinner-spacing) + var(--selectbox-clear-width))}.selectbox__has_spinner.selectbox__has_clear.selectbox__has_open_indicator.selectbox__rtl .selectbox__spinner,[dir=rtl] .selectbox.selectbox__has_spinner.selectbox__has_clearselectbox__has_open_indicator:not(.selectbox__ltr) .selectbox__spinner{right:auto;left:calc(var(--selectbox-spinner-spacing) + var(--selectbox-clear-width) + var(--selectbox-open-indicator-width))}.selectbox__item{box-sizing:border-box;float:left;cursor:default;background-color:#e4e4e4;border:var(--selectbox-multi-item-border-width) solid #aaa;border-radius:var(--selectbox-multi-item-border-radius);margin-left:0;margin-right:var(--selectbox-multi-item-horz-spacing);margin-top:var(--selectbox-multi-item-vert-spacing);padding:var(--selectbox-multi-item-top-padding) var(--selectbox-multi-item-horz-padding) var(--selectbox-multi-item-bottom-padding);line-height:inherit}.selectbox__item span{vertical-align:top}.selectbox__item:focus{background-color:#ccc;outline:0}.selectbox__rtl .selectbox__item,[dir=rtl] .selectbox:not(.selectbox__ltr) .selectbox__item{float:right;margin-left:var(--selectbox-multi-item-horz-spacing);margin-right:0}.selectbox__item_remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-top:.2em;font-size:13px}.selectbox__item_remove:before{content:"×"}.selectbox__item_remove:first-child{margin-right:var(--selectbox-multi-item-remove-spacing)}.selectbox__item_remove:last-child{margin-left:var(--selectbox-multi-item-remove-spacing)}.selectbox__rtl .selectbox__item_remove:first-child,[dir=rtl] .selectbox:not(.selectbox__ltr) .selectbox__item_remove:first-child{margin-left:var(--selectbox-multi-item-remove-spacing);margin-right:0}.selectbox__rtl .selectbox__item_remove:last-child,[dir=rtl] .selectbox:not(.selectbox__ltr) .selectbox__item_remove:last-child{margin-right:var(--selectbox-multi-item-remove-spacing);margin-left:0}.selectbox__single_wrapper{position:relative;min-height:1em;max-width:100%;margin:0;padding:var(--selectbox-single-top-padding) var(--selectbox-horz-padding) var(--selectbox-single-bottom-padding) var(--selectbox-horz-padding);color:currentColor}.selectbox__single_wrapper:empty::after{content:""}.selectbox__empty_selection .selectbox__single_wrapper{width:12em}.selectbox__has_selection.selectbox__has_input .selectbox__single_wrapper{opacity:0}.selectbox__has_selection.selectbox__empty_input.has_droplist .selectbox__single_wrapper,.selectbox__has_selection.selectbox__empty_input.selectbox__focus .selectbox__single_wrapper{opacity:.5}.selectbox__search_wrapper{max-width:100%}.selectbox__multi .selectbox__search_wrapper{float:left;margin-top:calc(var(--selectbox-multi-item-vert-spacing) + var(--selectbox-multi-item-border-width) + var(--selectbox-multi-item-top-padding) + var(--selectbox-multi-search-top-offset))}.selectbox__single .selectbox__search_wrapper{position:absolute;z-index:1;left:0;top:var(--selectbox-single-top-padding)}.selectbox__multi.selectbox__rtl .selectbox__search_wrapper,[dir=rtl] .selectbox.selectbox__multi:not(.selectbox__ltr) .selectbox__search_wrapper{float:right}.selectbox__single.selectbox__rtl .selectbox__search_wrapper,[dir=rtl] .selectbox.selectbox__single:not(.selectbox__ltr) .selectbox__search_wrapper{right:0;left:auto}input.selectbox__search_field{box-sizing:border-box;display:inline-block;height:auto;max-width:100%;cursor:inherit;color:currentColor;-webkit-appearance:none;appearance:none;background:rgba(0,0,0,0);box-shadow:none;border:none;border-radius:0;outline:0;margin:0;padding:0;font-family:inherit;font-size:1em;line-height:normal}input.selectbox__search_field::-webkit-search-decoration,input.selectbox__search_field::-webkit-search-cancel-button,input.selectbox__search_field::-webkit-search-results-button,input.selectbox__search_field::-webkit-search-results-decoration{appearance:none;-webkit-appearance:none;width:0;height:0;margin:0;padding:0}input.selectbox__search_field::-ms-clear{appearance:none;-webkit-appearance:none;width:0;height:0;margin:0;padding:0}input.selectbox__search_field:focus{outline:0 !important;border:0 !important;box-shadow:none !important}.selectbox__single input.selectbox__search_field{padding:0 var(--selectbox-horz-padding)}.selectbox__multi input.selectbox__search_field{padding:0}.selectbox.has_droplist_above{border-top-left-radius:0;border-top-right-radius:0}.selectbox.has_droplist_below{border-bottom-left-radius:0;border-bottom-right-radius:0}@-webkit-keyframes selectbox__spinner_anim{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes selectbox__spinner_anim{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}
|
|
2
2
|
|
|
3
3
|
/*# sourceMappingURL=selectbox.css.map */
|
package/css/selectbox.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../scss/selectbox.scss"],"names":[],"mappings":"CAeA,WACI,+BACA,2CACA,wCACA,qCACA,iCACA,mCACA,+BACA,gCAEA,yCACA,4CAEA,wCACA,yCACA,0CACA,6CACA,6CACA,6CACA,wCACA,+CACA,6CACA,yCAEA,kBACA,sBACA,qBACA,eACA,UACA,gBAEA,iBACA,yBAEA,WACA,sBACA,6CACA,sBAEA,0BACI,cAGJ,iCACI,YAGP,+BACC,sBACA,sBACA,eAEA,iCACC,eAIF,8BACC,yBACA,0BAGD,8BACC,4BACA,6BAGE,iGACI,
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../scss/selectbox.scss"],"names":[],"mappings":"CAeA,WACI,+BACA,2CACA,wCACA,qCACA,iCACA,mCACA,+BACA,gCAEA,yCACA,4CAEA,wCACA,yCACA,0CACA,6CACA,6CACA,6CACA,wCACA,+CACA,6CACA,yCAEA,kBACA,sBACA,qBACA,eACA,UACA,gBAEA,iBACA,yBAEA,WACA,sBACA,6CACA,sBAEA,0BACI,cAGJ,iCACI,YAGP,+BACC,sBACA,sBACA,eAEA,iCACC,eAIF,+BACC,eAEA,iCACC,eAIF,8BACC,yBACA,0BAGD,8BACC,4BACA,6BAGE,iGACI,oDAvFJ,gPA0FQ,gBACA,mDAIR,iGACI,2CAhGJ,gPAmGQ,gBACA,0CAIR,iGACI,6CAzGJ,gPA4GQ,gBACA,0CAIR,2FACI,2FAlHJ,oOAqHQ,gBACA,0FAIR,2FACI,yFA3HJ,oOA8HQ,gBACA,wFAIR,2FACI,kFApIJ,oOAuIQ,gBACA,iFAIR,qFACI,0HA7IJ,wNAgJQ,gBACA,yHAIR,4BACI,gDACA,mDAIR,kBACI,qBACA,UAEA,WADM,8DAIV,iBACI,sBACA,qBACA,qBACA,mBAEA,WACA,gEACA,wCAEA,uBACA,mBAGI,4GACI,WAKZ,2BACI,kBACA,8CACA,QACA,2BACA,UACA,cACA,UACA,YACA,gBACA,cACA,gBACA,eAEA,mCACI,mBACA,qBACA,6BACA,WACA,qBACA,aACA,UACA,kBACA,YACA,yBACA,mBACA,YACA,iEAGJ,yDACI,yCAGJ,gHACI,WACA,6CAEA,gIACI,0BAKJ,0KACI,yCAKZ,kBACI,kBACA,qCACA,QACA,2BACA,UAEA,yBACI,sBACA,cACA,eACA,iBACA,WACA,kBACA,eACA,gBACA,SACA,UACA,SACA,gBAEA,gCACI,YAGJ,+BACI,aACA,UA7PR,8FAkQI,WACA,oCAGJ,sEACI,mFAGJ,oMAEI,WACA,kFAGJ,kGACI,aAIR,oBACI,kBACA,uCACA,QACA,2BACA,UAEA,4BACI,WACA,cACA,cACA,UACA,WACA,oBACA,gBACA,2CACA,6CACA,8CACA,0CACA,kBACA,wBACA,uDACA,uBA3SJ,kGA+SI,WACA,sCAGJ,qGACI,qFAGJ,qGACI,4EAGJ,+FACI,qJAGJ,kQAEI,WACA,2EAGJ,kQAEI,WACA,2EAGJ,qPAEI,WACA,mHAIR,iBACI,sBACA,WACA,eAEA,yBACA,2DACA,wDAEA,cACA,sDACA,oDACA,oIACA,oBAEH,sBACC,mBAGD,uBACC,sBACA,UAvWE,4FA2WI,YACA,qDACA,eAIR,wBACI,WACA,eACA,qBACA,iBACA,gBACH,eAEA,+BACC,YAGE,oCACI,wDAGJ,mCACI,uDAIA,kIACI,uDACA,eAGJ,gIACI,wDACA,cAKZ,2BACI,kBACA,eACA,eACA,SACA,+IACA,mBAEA,oDAEA,uDACI,WAGJ,0EACI,UAIR,sLAEI,WAGJ,2BACC,eAEG,6CACI,WACA,0LAMJ,8CACI,kBACA,UACA,OACA,wCAGJ,kJAEI,YAGJ,oJAEI,QACA,UAIR,8BACI,sBACH,qBACG,YACH,eACG,eACA,mBAEA,wBACA,gBACH,yBACG,gBACA,YACA,gBACA,UACA,SACA,UAEA,oBACA,cACA,mBAEA,mPAII,gBACA,wBACA,QACA,SACA,SACA,UAGJ,yCACI,gBACA,wBACA,QACA,SACA,SACA,UAGP,oCACC,qBACA,oBACA,2BAIF,iDACI,wCAGJ,gDACI,UAGJ,8BACI,yBACA,0BAGJ,8BACI,4BACA,6BAGJ,2CACI,GACI,uBAEJ,KACI,0BAIR,mCACI,GACI,uBAEJ,KACI","file":"selectbox.css"}
|
package/dist/lib.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @danielgindi/selectbox 2.0.
|
|
2
|
+
* @danielgindi/selectbox 2.0.28
|
|
3
3
|
* git://github.com/danielgindi/selectbox.git
|
|
4
4
|
*/
|
|
5
5
|
'use strict';
|
|
@@ -6371,7 +6371,7 @@ const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
|
6371
6371
|
/** */
|
|
6372
6372
|
|
|
6373
6373
|
/** @type {DropList.Options} */
|
|
6374
|
-
|
|
6374
|
+
const DefaultOptions$1 = {
|
|
6375
6375
|
baseClassName: 'droplist',
|
|
6376
6376
|
|
|
6377
6377
|
autoItemBlur: true,
|
|
@@ -6430,7 +6430,7 @@ class DropList {
|
|
|
6430
6430
|
* @param {DropList.Options} options
|
|
6431
6431
|
*/
|
|
6432
6432
|
constructor(options) {var _o$positionOptionsPro;
|
|
6433
|
-
const o = _objectSpread2({},
|
|
6433
|
+
const o = _objectSpread2({}, DefaultOptions$1);
|
|
6434
6434
|
|
|
6435
6435
|
for (let [key, value] of Object.entries(/**@type Object*/options))
|
|
6436
6436
|
if (value !== undefined)
|
|
@@ -9879,6 +9879,7 @@ const inputBackbufferCssProps = [
|
|
|
9879
9879
|
* @property {string|string[]} [additionalClasses]
|
|
9880
9880
|
* @property {'ltr'|'rtl'|'auto'} [direction='auto']
|
|
9881
9881
|
* @property {boolean} [disabled=false] Should start as disabled?
|
|
9882
|
+
* @property {boolean} [readonly=false] Should start as readonly?
|
|
9882
9883
|
* @property {boolean} [clearable=true] Has clear button?
|
|
9883
9884
|
* @property {boolean} [hasOpenIndicator=true] has open/close indicator?
|
|
9884
9885
|
* @property {string} [placeholder=''] Placeholder text
|
|
@@ -9897,6 +9898,7 @@ const inputBackbufferCssProps = [
|
|
|
9897
9898
|
* @property {string} [labelProp='label']
|
|
9898
9899
|
* @property {string} [valueProp='value']
|
|
9899
9900
|
* @property {string} [multiItemLabelProp='short_label']
|
|
9901
|
+
* @property {'after'|'before'|'none'} [multiItemRemovePosition='after']
|
|
9900
9902
|
* @property {number} [maxMultiItems] maximum number of multi items. The rest will get a single item to represent.
|
|
9901
9903
|
* @property {function(count: number, items: DropList.ItemBase[]):string} [multiItemsRestLabelProvider] label for the item representing the rest of the items.
|
|
9902
9904
|
* @property {DropList.ItemBase[]|null} [items] initial items
|
|
@@ -9919,10 +9921,11 @@ const inputBackbufferCssProps = [
|
|
|
9919
9921
|
* @property {boolean} [closeListWhenLoading] whether we should close the list automatically when loading
|
|
9920
9922
|
* @property {string[]} [clearInputWhen=['single_close','multi_select_single']] clear input box when closing the droplist or selecting <code>['single_close', 'multi_close', 'multi_select_single']</code>
|
|
9921
9923
|
* */
|
|
9922
|
-
const
|
|
9924
|
+
const DefaultOptions = {
|
|
9923
9925
|
el: null,
|
|
9924
9926
|
baseClassName: 'selectbox',
|
|
9925
9927
|
disabled: false,
|
|
9928
|
+
readonly: false,
|
|
9926
9929
|
clearable: true,
|
|
9927
9930
|
hasOpenIndicator: true,
|
|
9928
9931
|
placeholder: '',
|
|
@@ -9946,6 +9949,7 @@ const defaultOptions = {
|
|
|
9946
9949
|
labelProp: 'label',
|
|
9947
9950
|
valueProp: 'value',
|
|
9948
9951
|
multiItemLabelProp: 'short_label',
|
|
9952
|
+
multiItemRemovePosition: 'after',
|
|
9949
9953
|
maxMultiItems: null,
|
|
9950
9954
|
multiItemsRestLabelProvider: null,
|
|
9951
9955
|
items: [],
|
|
@@ -10004,7 +10008,7 @@ class SelectBox {
|
|
|
10004
10008
|
* @param {SelectBox.Options} options
|
|
10005
10009
|
*/
|
|
10006
10010
|
constructor(options) {
|
|
10007
|
-
const o = _objectSpread2({},
|
|
10011
|
+
const o = _objectSpread2({}, DefaultOptions);
|
|
10008
10012
|
|
|
10009
10013
|
for (let [key, value] of Object.entries(/**@type Object*/options))
|
|
10010
10014
|
if (value !== undefined)
|
|
@@ -10020,6 +10024,7 @@ class SelectBox {
|
|
|
10020
10024
|
listOptions: o.listOptions,
|
|
10021
10025
|
|
|
10022
10026
|
disabled: !!o.disabled,
|
|
10027
|
+
readonly: !!o.readonly,
|
|
10023
10028
|
clearable: !!o.clearable,
|
|
10024
10029
|
hasOpenIndicator: !!o.hasOpenIndicator,
|
|
10025
10030
|
placeholder: o.placeholder,
|
|
@@ -10042,6 +10047,7 @@ class SelectBox {
|
|
|
10042
10047
|
labelProp: o.labelProp,
|
|
10043
10048
|
valueProp: o.valueProp,
|
|
10044
10049
|
multiItemLabelProp: o.multiItemLabelProp,
|
|
10050
|
+
multiItemRemovePosition: o.multiItemRemovePosition,
|
|
10045
10051
|
|
|
10046
10052
|
maxMultiItems: o.maxMultiItems,
|
|
10047
10053
|
multiItemsRestLabelProvider: o.multiItemsRestLabelProvider,
|
|
@@ -10101,6 +10107,7 @@ class SelectBox {
|
|
|
10101
10107
|
p.multiItemEls = [];
|
|
10102
10108
|
|
|
10103
10109
|
this.enable(!p.disabled);
|
|
10110
|
+
this.setReadOnly(!p.readonly);
|
|
10104
10111
|
|
|
10105
10112
|
this._setupDropdownMenu();
|
|
10106
10113
|
|
|
@@ -10327,6 +10334,32 @@ class SelectBox {
|
|
|
10327
10334
|
return this._p.disabled;
|
|
10328
10335
|
}
|
|
10329
10336
|
|
|
10337
|
+
/**
|
|
10338
|
+
* Sets read only mode
|
|
10339
|
+
* @param {boolean=true} readonly Should the control be read only?
|
|
10340
|
+
* @returns {SelectBox}
|
|
10341
|
+
*/
|
|
10342
|
+
setReadOnly(readonly) {
|
|
10343
|
+
const p = this._p;
|
|
10344
|
+
|
|
10345
|
+
if (readonly === undefined) {
|
|
10346
|
+
readonly = true;
|
|
10347
|
+
}
|
|
10348
|
+
p.readonly = !readonly;
|
|
10349
|
+
p.el.setAttribute('aria-readonly', p.readonly.toString());
|
|
10350
|
+
p.input.readonly = !!p.readonly;
|
|
10351
|
+
|
|
10352
|
+
return this;
|
|
10353
|
+
}
|
|
10354
|
+
|
|
10355
|
+
/**
|
|
10356
|
+
* Is the control enabled?
|
|
10357
|
+
* @returns {boolean}
|
|
10358
|
+
*/
|
|
10359
|
+
isReadOnly() {
|
|
10360
|
+
return !this._p.readonly;
|
|
10361
|
+
}
|
|
10362
|
+
|
|
10330
10363
|
/**
|
|
10331
10364
|
* @param {string|string[]} classes
|
|
10332
10365
|
* @returns {SelectBox}
|
|
@@ -10954,6 +10987,18 @@ class SelectBox {
|
|
|
10954
10987
|
setMultiItemLabelProp(prop) {
|
|
10955
10988
|
const p = this._p;
|
|
10956
10989
|
p.multiItemLabelProp = prop;
|
|
10990
|
+
this._scheduleSync('render_items');
|
|
10991
|
+
return this;
|
|
10992
|
+
}
|
|
10993
|
+
|
|
10994
|
+
/**
|
|
10995
|
+
* @param {'before'|'after'|'none'} position
|
|
10996
|
+
* @returns {SelectBox}
|
|
10997
|
+
*/
|
|
10998
|
+
setMultiItemRemovePosition(position) {
|
|
10999
|
+
const p = this._p;
|
|
11000
|
+
p.multiItemRemovePosition = position;
|
|
11001
|
+
this._scheduleSync('render_items');
|
|
10957
11002
|
return this;
|
|
10958
11003
|
}
|
|
10959
11004
|
|
|
@@ -11476,7 +11521,7 @@ class SelectBox {
|
|
|
11476
11521
|
if (!Dom.closestUntil(evt.target, ".".concat(p.baseClassName, "__item_remove"), evt.currentTarget))
|
|
11477
11522
|
return;
|
|
11478
11523
|
|
|
11479
|
-
if (p.disabled) return;
|
|
11524
|
+
if (p.disabled || p.readonly) return;
|
|
11480
11525
|
|
|
11481
11526
|
this._removeMultiItemFromEvent(
|
|
11482
11527
|
/**@type Element*/
|
|
@@ -11529,6 +11574,7 @@ class SelectBox {
|
|
|
11529
11574
|
if (p.hasOpenIndicator) {
|
|
11530
11575
|
p.openIndicator = Dom.createElement('span', { class: "".concat(p.baseClassName, "__open_indicator") });
|
|
11531
11576
|
p.el.appendChild(p.openIndicator);
|
|
11577
|
+
p.el.classList.add("".concat(p.baseClassName, "__has_open_indicator"));
|
|
11532
11578
|
} else {
|
|
11533
11579
|
DomCompat.remove(p.openIndicator);
|
|
11534
11580
|
delete p.openIndicator;
|
|
@@ -11843,7 +11889,7 @@ class SelectBox {
|
|
|
11843
11889
|
|
|
11844
11890
|
setTimeout(() => {
|
|
11845
11891
|
if (this[DestroyedSymbol]) return; // destroyed by event handler
|
|
11846
|
-
if (p.disabled) return;
|
|
11892
|
+
if (p.disabled || p.readonly) return;
|
|
11847
11893
|
|
|
11848
11894
|
this._trigger('search:blur');
|
|
11849
11895
|
|
|
@@ -11986,7 +12032,8 @@ class SelectBox {
|
|
|
11986
12032
|
p.lastKeyAllowsNonTypeKeys &&
|
|
11987
12033
|
!p.multi &&
|
|
11988
12034
|
!dropList.hasFocusedItem() &&
|
|
11989
|
-
!p.disabled
|
|
12035
|
+
!p.disabled &&
|
|
12036
|
+
!p.readonly)
|
|
11990
12037
|
{
|
|
11991
12038
|
this.toggleList();
|
|
11992
12039
|
evt.preventDefault();
|
|
@@ -11998,20 +12045,20 @@ class SelectBox {
|
|
|
11998
12045
|
if (p.input) {
|
|
11999
12046
|
p.sink.
|
|
12000
12047
|
add(p.input, 'input.dropdown', () => {var _p$dropList9;
|
|
12001
|
-
if (p.disabled) return;
|
|
12048
|
+
if (p.disabled || p.readonly) return;
|
|
12002
12049
|
|
|
12003
12050
|
p.filterTerm = p.input.value.trim();
|
|
12004
12051
|
(_p$dropList9 = p.dropList) === null || _p$dropList9 === void 0 || _p$dropList9.setSearchTerm(p.filterTerm, true);
|
|
12005
12052
|
}).
|
|
12006
12053
|
add(p.input, 'click.dropdown', () => {
|
|
12007
|
-
if (p.disabled) return;
|
|
12054
|
+
if (p.disabled || p.readonly) return;
|
|
12008
12055
|
|
|
12009
12056
|
if (!p.multi && p.searchable) {
|
|
12010
12057
|
this.openList();
|
|
12011
12058
|
}
|
|
12012
12059
|
}).
|
|
12013
12060
|
add(p.input, 'focus.dropdown', () => {
|
|
12014
|
-
if (p.disabled) return;
|
|
12061
|
+
if (p.disabled || p.readonly) return;
|
|
12015
12062
|
|
|
12016
12063
|
this._trigger('search:focus');
|
|
12017
12064
|
|
|
@@ -12028,7 +12075,7 @@ class SelectBox {
|
|
|
12028
12075
|
|
|
12029
12076
|
p.sink.
|
|
12030
12077
|
add(p.el, 'mousedown.dropdown', () => {
|
|
12031
|
-
if (!p.multi && !p.searchable && !avoidToggleFromClick && !p.disabled) {
|
|
12078
|
+
if (!p.multi && !p.searchable && !avoidToggleFromClick && !p.disabled && !p.readonly) {
|
|
12032
12079
|
this.toggleList();
|
|
12033
12080
|
}
|
|
12034
12081
|
avoidToggleFromClick = false;
|
|
@@ -12037,7 +12084,7 @@ class SelectBox {
|
|
|
12037
12084
|
if (currentTouchId) return;
|
|
12038
12085
|
currentTouchId = evt.changedTouches[0].identifier;
|
|
12039
12086
|
|
|
12040
|
-
if (this.isDisabled())
|
|
12087
|
+
if (this.isDisabled() || this.isReadOnly())
|
|
12041
12088
|
return;
|
|
12042
12089
|
|
|
12043
12090
|
if (Dom.closestUntil(evt.target, ".".concat(p.baseClassName, "__item,.").concat(p.baseClassName, "__clear"), p.el))
|
|
@@ -12477,7 +12524,7 @@ class SelectBox {
|
|
|
12477
12524
|
p.el.classList.add("".concat(p.baseClassName, "__has_clear"));
|
|
12478
12525
|
|
|
12479
12526
|
p.sink.add(p.clearButton, 'click', () => {
|
|
12480
|
-
if (this.isDisabled()) return;
|
|
12527
|
+
if (this.isDisabled() || this.isReadOnly()) return;
|
|
12481
12528
|
this.clear();
|
|
12482
12529
|
});
|
|
12483
12530
|
}
|
|
@@ -12674,22 +12721,29 @@ class SelectBox {
|
|
|
12674
12721
|
if (label === false)
|
|
12675
12722
|
return null;
|
|
12676
12723
|
|
|
12724
|
+
const elRemove = Dom.createElement('span', {
|
|
12725
|
+
class: "".concat(p.baseClassName, "__item_remove"),
|
|
12726
|
+
role: 'presentation'
|
|
12727
|
+
});
|
|
12728
|
+
|
|
12677
12729
|
const itemEl = Dom.createElement('li',
|
|
12678
12730
|
{
|
|
12679
12731
|
class: "".concat(p.baseClassName, "__item"),
|
|
12680
12732
|
tabindex: '0',
|
|
12681
12733
|
title: label
|
|
12682
|
-
}
|
|
12683
|
-
[
|
|
12684
|
-
Dom.createElement('span', {
|
|
12685
|
-
class: "".concat(p.baseClassName, "__item_remove"),
|
|
12686
|
-
role: 'presentation'
|
|
12687
|
-
})]
|
|
12688
|
-
|
|
12734
|
+
}
|
|
12689
12735
|
);
|
|
12690
12736
|
|
|
12737
|
+
if (p.multiItemRemovePosition === 'before') {
|
|
12738
|
+
itemEl.appendChild(elRemove);
|
|
12739
|
+
}
|
|
12740
|
+
|
|
12691
12741
|
this._renderMultiItemContent(item, itemEl);
|
|
12692
12742
|
|
|
12743
|
+
if (p.multiItemRemovePosition === 'after') {
|
|
12744
|
+
itemEl.appendChild(elRemove);
|
|
12745
|
+
}
|
|
12746
|
+
|
|
12693
12747
|
itemEl[ItemSymbol] = item;
|
|
12694
12748
|
|
|
12695
12749
|
return itemEl;
|
|
@@ -13006,7 +13060,7 @@ class SelectBox {
|
|
|
13006
13060
|
_handleMultiKeydown(event) {
|
|
13007
13061
|
const p = this._p;
|
|
13008
13062
|
|
|
13009
|
-
if (p.disabled) return;
|
|
13063
|
+
if (p.disabled || p.readonly) return;
|
|
13010
13064
|
|
|
13011
13065
|
const isRtl = getComputedStyle(p.el).direction === 'rtl';
|
|
13012
13066
|
|