blip-ds 1.155.3 → 1.155.4
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/dist/blip-ds/bds-autocomplete.entry.js +5 -1
- package/dist/blip-ds/bds-autocomplete.system.entry.js +1 -1
- package/dist/blip-ds/blip-ds.esm.js +1 -1
- package/dist/blip-ds/blip-ds.system.js +1 -1
- package/dist/blip-ds/p-91b5765e.system.entry.js +1 -0
- package/dist/blip-ds/p-9a98b63f.system.js +1 -1
- package/dist/blip-ds/p-c88ce991.entry.js +1 -0
- package/dist/cjs/bds-autocomplete.cjs.entry.js +5 -1
- package/dist/cjs/blip-ds.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/autocomplete/autocomplete.js +23 -1
- package/dist/esm/bds-autocomplete.entry.js +5 -1
- package/dist/esm/blip-ds.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/bds-autocomplete.entry.js +1 -1
- package/dist/esm-es5/blip-ds.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/types/components/autocomplete/autocomplete.d.ts +4 -0
- package/dist/types/components.d.ts +8 -0
- package/package.json +1 -1
- package/dist/blip-ds/p-947fb267.system.entry.js +0 -1
- package/dist/blip-ds/p-ff2a76a6.entry.js +0 -1
|
@@ -103,6 +103,10 @@ export namespace Components {
|
|
|
103
103
|
* Add state danger on input, use for use feedback.
|
|
104
104
|
*/
|
|
105
105
|
"danger"?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Data test is the prop to specifically test the component action object.
|
|
108
|
+
*/
|
|
109
|
+
"dataTest"?: string;
|
|
106
110
|
/**
|
|
107
111
|
* Disabled input.
|
|
108
112
|
*/
|
|
@@ -1880,6 +1884,10 @@ declare namespace LocalJSX {
|
|
|
1880
1884
|
* Add state danger on input, use for use feedback.
|
|
1881
1885
|
*/
|
|
1882
1886
|
"danger"?: boolean;
|
|
1887
|
+
/**
|
|
1888
|
+
* Data test is the prop to specifically test the component action object.
|
|
1889
|
+
*/
|
|
1890
|
+
"dataTest"?: string;
|
|
1883
1891
|
/**
|
|
1884
1892
|
* Disabled input.
|
|
1885
1893
|
*/
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,i,n){function s(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,o){function r(t){try{a(n.next(t))}catch(e){o(e)}}function l(t){try{a(n["throw"](t))}catch(e){o(e)}}function a(t){t.done?i(t.value):s(t.value).then(r,l)}a((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,s,o,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(t){return function(e){return a([t,e])}}function a(r){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,s&&(o=r[0]&2?s["return"]:r[0]?s["throw"]||((o=s["return"])&&o.call(s),0):s.next)&&!(o=o.call(s,r[1])).done)return o;if(s=0,o)r=[r[0]&2,o.value];switch(r[0]){case 0:case 1:o=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;s=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!o||r[1]>o[0]&&r[1]<o[3])){i.label=r[1];break}if(r[0]===6&&i.label<o[1]){i.label=o[1];o=r;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(r);break}if(o[2])i.ops.pop();i.trys.pop();continue}r=e.call(t,i)}catch(l){r=[6,l];s=0}finally{n=o=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-660b44d1.system.js"],(function(t){"use strict";var e,i,n,s;return{setters:[function(t){e=t.r;i=t.c;n=t.h;s=t.g}],execute:function(){var o='@import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,200;0,300;0,400;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,600;1,700;1,800;1,900&display=swap"); :host{display:block}.select{position:relative;outline:none}.select__icon{color:#8ca0b3;display:-ms-flexbox;display:flex}.select__icon bds-icon{margin-left:10px}.select .icon-hidden{visibility:hidden}.select__options{background:#f8fbfb;width:100%;max-height:250px;position:absolute;top:99%;left:0;border-radius:8px;-webkit-box-shadow:0px 2px 8px rgba(96, 123, 153, 0.3);box-shadow:0px 2px 8px rgba(96, 123, 153, 0.3);overflow-y:auto;z-index:2;margin-top:4px;-webkit-transition:opacity 0.75s, visibility 0.75s, -webkit-transform 0.25s;transition:opacity 0.75s, visibility 0.75s, -webkit-transform 0.25s;transition:transform 0.25s, opacity 0.75s, visibility 0.75s;transition:transform 0.25s, opacity 0.75s, visibility 0.75s, -webkit-transform 0.25s;-webkit-transform-origin:top left;transform-origin:top left;-webkit-transform:scaleY(0);transform:scaleY(0);visibility:hidden;opacity:0;-webkit-box-shadow:0px 2px 12px 0 2px 8px rgba(96, 123, 153, 0.4);box-shadow:0px 2px 12px 0 2px 8px rgba(96, 123, 153, 0.4)}.select__options::-webkit-scrollbar{width:16px;background-color:transparent}.select__options::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.select__options--open{visibility:visible;-webkit-transform:scale(1);transform:scale(1);opacity:1}.select__options--position-top{top:auto;bottom:100%;-webkit-transform-origin:bottom left;transform-origin:bottom left}';var r=t("bds_autocomplete",function(){function t(t){var n=this;e(this,t);this.bdsChange=i(this,"bdsChange",7);this.bdsSelectedChange=i(this,"bdsSelectedChange",7);this.bdsInput=i(this,"bdsInput",7);this.bdsCancel=i(this,"bdsCancel",7);this.bdsFocus=i(this,"bdsFocus",7);this.bdsBlur=i(this,"bdsBlur",7);this.isOpen=false;this.text="";this.isFocused=false;this.danger=false;this.disabled=false;this.searchOnlyTitle=true;this.label="";this.icon="";this.placeholder="";this.optionsPosition="bottom";this.clearIconOnFocus=false;this.onInput=function(t){var e=t.target;if(e){n.value=e.value||""}n.bdsInput.emit(t)};this.refNativeInput=function(t){n.nativeInput=t};this.onFocus=function(){n.isFocused=true;n.bdsFocus.emit()};this.onFocusout=function(){if(!n.isOpen){n.nativeInput.value=n.getText()}};this.onBlur=function(){n.bdsBlur.emit();if(!n.isOpen){n.isFocused=false;n.nativeInput.value=n.getText()}};this.toggle=function(){if(!n.disabled){n.isOpen=!n.isOpen}};this.getTextFromOption=function(t){var e,i;if((t===null||t===void 0?void 0:t.status)||(t===null||t===void 0?void 0:t.bulkOption)){if(n.internalOptions){var s=n.internalOptions.find((function(e){return e.value==t.value}));if(s){return s.label}}return t.querySelector("#bds-typo-label-".concat(n.value)).textContent}return(t===null||t===void 0?void 0:t.titleText)?t.titleText:(i=(e=t===null||t===void 0?void 0:t.textContent)===null||e===void 0?void 0:e.trim())!==null&&i!==void 0?i:""};this.getText=function(){var t=n.childOptions.find((function(t){return t.value==n.value}));return n.getTextFromOption(t)};this.handler=function(t){var e=t.detail.value;n.value=e;n.toggle()};this.setFocusWrapper=function(){if(!n.disabled&&n.nativeInput){n.nativeInput.setFocus()}};this.removeFocusWrapper=function(t){var e=t.relatedTarget.localName==="bds-input";if(n.nativeInput&&!e){n.nativeInput.removeFocus()}};this.keyPressWrapper=function(t){var e,i;n.isOpen=true;switch(t.key){case"Enter":n.toggle();break;case"Tab":var s=n.findFocusedElementIndex();var o=n.sliceInvisible(s+1);var r=o[0];if(!r){n.toggle()}break;case"ArrowDown":var l=n.findFocusedElementIndex();var a=n.sliceInvisible(l+1);var u=a[0];(e=u===null||u===void 0?void 0:u.firstElementChild)===null||e===void 0?void 0:e.focus();break;case"ArrowUp":var c=n.findFocusedElementIndex();var p=n.childOptions.find((function(t){return!t.hasAttribute("invisible")}));if(n.childOptions[c]!=p){c=c>0?c:n.childOptions.length;var h=n.sliceInvisible(0,c);var d=h[h.length-1];(i=d===null||d===void 0?void 0:d.firstElementChild)===null||i===void 0?void 0:i.focus()}break}};this.cleanInputSelection=function(){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!!this.disabled)return[3,2];this.value="";this.nativeInput.value="";this.isOpen=false;return[4,this.resetFilterOptions()];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.changedInputValue=function(){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:this.bdsChange.emit({value:this.nativeInput.value});if(!this.nativeInput.value)return[3,2];return[4,this.filterOptions(this.nativeInput.value)];case 1:t.sent();return[3,5];case 2:this.value="";if(!this.isOpen)return[3,4];return[4,this.resetFilterOptions()];case 3:t.sent();return[3,5];case 4:this.setTimeoutFilter();t.label=5;case 5:if(this.isOpen===false){this.value=this.getSelectedValue();this.setTimeoutFilter()}return[2]}}))}))}}t.prototype.itemSelectedChanged=function(){this.bdsSelectedChange.emit(this.selected)};t.prototype.valueChanged=function(){for(var t=0,e=this.childOptions;t<e.length;t++){var i=e[t];i.selected=this.value===i.value}this.selected=this.childOptionSelected;this.text=this.getText()};t.prototype.handleWindow=function(t){if(!this.el.contains(t.target)){this.isOpen=false}};t.prototype.parseOptions=function(){if(this.options){this.resetFilterOptions();try{this.internalOptions=typeof this.options==="string"?JSON.parse(this.options):this.options}catch(t){this.internalOptions=[]}}};t.prototype.componentWillLoad=function(){this.options&&this.parseOptions()};t.prototype.componentDidLoad=function(){if(!this.options){for(var t=0,e=this.childOptions;t<e.length;t++){var i=e[t];i.selected=this.value===i.value;i.addEventListener("optionSelected",this.handler)}}this.text=this.getText()};Object.defineProperty(t.prototype,"childOptions",{get:function(){return this.options?Array.from(this.el.shadowRoot.querySelectorAll("bds-select-option")):Array.from(this.el.querySelectorAll("bds-select-option"))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"childOptionSelected",{get:function(){return this.options?Array.from(this.el.shadowRoot.querySelectorAll("bds-select-option")).find((function(t){return t.selected})):Array.from(this.el.querySelectorAll("bds-select-option")).find((function(t){return t.selected}))},enumerable:false,configurable:true});t.prototype.sliceInvisible=function(t,e){if(e===void 0){e=this.childOptions.length}return this.childOptions.slice(t,e).filter((function(t){return!t.hasAttribute("invisible")}))};t.prototype.findFocusedElementIndex=function(){return this.childOptions.findIndex((function(t){return t.firstElementChild.matches(":focus")}))};t.prototype.setTimeoutFilter=function(){var t=this;setTimeout((function(){t.resetFilterOptions()}),500)};t.prototype.filterOptions=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,n,s,o;return __generator(this,(function(r){switch(r.label){case 0:if(!!t)return[3,2];return[4,this.resetFilterOptions()];case 1:r.sent();r.label=2;case 2:for(e=0,i=this.childOptions;e<i.length;e++){n=i[e];s=this.searchOnlyTitle?this.getTextFromOption(n).toLowerCase():n.textContent.toLowerCase();o=t.toLowerCase();s.includes(o)?n.removeAttribute("invisible"):n.setAttribute("invisible","invisible")}return[2]}}))}))};t.prototype.resetFilterOptions=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i,n;return __generator(this,(function(s){t=this.childOptions;for(e=0,i=t;e<i.length;e++){n=i[e];n.removeAttribute("invisible")}return[2]}))}))};t.prototype.getSelectedValue=function(){var t;return(t=this.childOptionSelected)===null||t===void 0?void 0:t.value};t.prototype.render=function(){var t=this;var e=this.isOpen?"arrow-up":"arrow-down";return n("div",{class:"select",tabindex:"0",onFocus:this.setFocusWrapper,onBlur:this.removeFocusWrapper,onFocusout:this.onFocusout,onKeyDown:this.keyPressWrapper},n("bds-input",{icon:this.icon,label:this.label,ref:this.refNativeInput,onFocus:this.onFocus,onBlur:this.onBlur,onClick:this.toggle,value:this.text,danger:this.danger,disabled:this.disabled,placeholder:this.placeholder,onBdsChange:this.changedInputValue,onBdsInput:this.onInput,readonly:false},n("div",{slot:"input-right",class:"select__icon"},n("bds-icon",{size:"small",name:"error",theme:"solid",onClick:this.cleanInputSelection,class:{"icon-hidden":this.clearIconOnFocus&&(!this.isFocused||!this.isOpen)||!this.value}}),n("bds-icon",{size:"small",name:e,color:"inherit"}))),n("div",{class:{select__options:true,"select__options--position-top":this.optionsPosition==="top","select__options--open":this.isOpen}},this.internalOptions?this.internalOptions.map((function(e,i){return n("bds-select-option",{onOptionSelected:t.handler,selected:t.value===e.value,value:e.value,key:i,bulkOption:e.bulkOption,status:e.status},e.label)})):n("slot",null)))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{selected:["itemSelectedChanged"],value:["valueChanged"],options:["parseOptions"]}},enumerable:false,configurable:true});return t}());r.style=o}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,g as o}from"./p-cd485809.js";const e=class{constructor(s){t(this,s),this.bdsChange=i(this,"bdsChange",7),this.bdsSelectedChange=i(this,"bdsSelectedChange",7),this.bdsInput=i(this,"bdsInput",7),this.bdsCancel=i(this,"bdsCancel",7),this.bdsFocus=i(this,"bdsFocus",7),this.bdsBlur=i(this,"bdsBlur",7),this.isOpen=!1,this.text="",this.isFocused=!1,this.danger=!1,this.disabled=!1,this.searchOnlyTitle=!0,this.label="",this.icon="",this.placeholder="",this.optionsPosition="bottom",this.clearIconOnFocus=!1,this.onInput=t=>{const i=t.target;i&&(this.value=i.value||""),this.bdsInput.emit(t)},this.refNativeInput=t=>{this.nativeInput=t},this.onFocus=()=>{this.isFocused=!0,this.bdsFocus.emit()},this.onFocusout=()=>{this.isOpen||(this.nativeInput.value=this.getText())},this.onBlur=()=>{this.bdsBlur.emit(),this.isOpen||(this.isFocused=!1,this.nativeInput.value=this.getText())},this.toggle=()=>{this.disabled||(this.isOpen=!this.isOpen)},this.getTextFromOption=t=>{var i,s;if((null==t?void 0:t.status)||(null==t?void 0:t.bulkOption)){if(this.internalOptions){const i=this.internalOptions.find((i=>i.value==t.value));if(i)return i.label}return t.querySelector(`#bds-typo-label-${this.value}`).textContent}return(null==t?void 0:t.titleText)?t.titleText:null!==(s=null===(i=null==t?void 0:t.textContent)||void 0===i?void 0:i.trim())&&void 0!==s?s:""},this.getText=()=>{const t=this.childOptions.find((t=>t.value==this.value));return this.getTextFromOption(t)},this.handler=t=>{const{detail:{value:i}}=t;this.value=i,this.toggle()},this.setFocusWrapper=()=>{!this.disabled&&this.nativeInput&&this.nativeInput.setFocus()},this.removeFocusWrapper=t=>{this.nativeInput&&"bds-input"!==t.relatedTarget.localName&&this.nativeInput.removeFocus()},this.keyPressWrapper=t=>{var i,s;switch(this.isOpen=!0,t.key){case"Enter":this.toggle();break;case"Tab":const t=this.findFocusedElementIndex();this.sliceInvisible(t+1)[0]||this.toggle();break;case"ArrowDown":const o=this.findFocusedElementIndex(),e=this.sliceInvisible(o+1)[0];null===(i=null==e?void 0:e.firstElementChild)||void 0===i||i.focus();break;case"ArrowUp":let h=this.findFocusedElementIndex();const n=this.childOptions.find((t=>!t.hasAttribute("invisible")));if(this.childOptions[h]!=n){h=h>0?h:this.childOptions.length;const t=this.sliceInvisible(0,h),i=t[t.length-1];null===(s=null==i?void 0:i.firstElementChild)||void 0===s||s.focus()}}},this.cleanInputSelection=async()=>{this.disabled||(this.value="",this.nativeInput.value="",this.isOpen=!1,await this.resetFilterOptions())},this.changedInputValue=async()=>{this.bdsChange.emit({value:this.nativeInput.value}),this.nativeInput.value?await this.filterOptions(this.nativeInput.value):(this.value="",this.isOpen?await this.resetFilterOptions():this.setTimeoutFilter()),!1===this.isOpen&&(this.value=this.getSelectedValue(),this.setTimeoutFilter())}}itemSelectedChanged(){this.bdsSelectedChange.emit(this.selected)}valueChanged(){for(const t of this.childOptions)t.selected=this.value===t.value;this.selected=this.childOptionSelected,this.text=this.getText()}handleWindow(t){this.el.contains(t.target)||(this.isOpen=!1)}parseOptions(){if(this.options){this.resetFilterOptions();try{this.internalOptions="string"==typeof this.options?JSON.parse(this.options):this.options}catch(t){this.internalOptions=[]}}}componentWillLoad(){this.options&&this.parseOptions()}componentDidLoad(){if(!this.options)for(const t of this.childOptions)t.selected=this.value===t.value,t.addEventListener("optionSelected",this.handler);this.text=this.getText()}get childOptions(){return Array.from(this.options?this.el.shadowRoot.querySelectorAll("bds-select-option"):this.el.querySelectorAll("bds-select-option"))}get childOptionSelected(){return this.options?Array.from(this.el.shadowRoot.querySelectorAll("bds-select-option")).find((t=>t.selected)):Array.from(this.el.querySelectorAll("bds-select-option")).find((t=>t.selected))}sliceInvisible(t,i=this.childOptions.length){return this.childOptions.slice(t,i).filter((t=>!t.hasAttribute("invisible")))}findFocusedElementIndex(){return this.childOptions.findIndex((t=>t.firstElementChild.matches(":focus")))}setTimeoutFilter(){setTimeout((()=>{this.resetFilterOptions()}),500)}async filterOptions(t){t||await this.resetFilterOptions();for(const i of this.childOptions){const s=this.searchOnlyTitle?this.getTextFromOption(i).toLowerCase():i.textContent.toLowerCase(),o=t.toLowerCase();s.includes(o)?i.removeAttribute("invisible"):i.setAttribute("invisible","invisible")}}async resetFilterOptions(){const t=this.childOptions;for(const i of t)i.removeAttribute("invisible")}getSelectedValue(){var t;return null===(t=this.childOptionSelected)||void 0===t?void 0:t.value}render(){const t=this.isOpen?"arrow-up":"arrow-down";return s("div",{class:"select",tabindex:"0",onFocus:this.setFocusWrapper,onBlur:this.removeFocusWrapper,onFocusout:this.onFocusout,onKeyDown:this.keyPressWrapper},s("bds-input",{icon:this.icon,label:this.label,ref:this.refNativeInput,onFocus:this.onFocus,onBlur:this.onBlur,onClick:this.toggle,value:this.text,danger:this.danger,disabled:this.disabled,placeholder:this.placeholder,onBdsChange:this.changedInputValue,onBdsInput:this.onInput,readonly:!1},s("div",{slot:"input-right",class:"select__icon"},s("bds-icon",{size:"small",name:"error",theme:"solid",onClick:this.cleanInputSelection,class:{"icon-hidden":this.clearIconOnFocus&&(!this.isFocused||!this.isOpen)||!this.value}}),s("bds-icon",{size:"small",name:t,color:"inherit"}))),s("div",{class:{select__options:!0,"select__options--position-top":"top"===this.optionsPosition,"select__options--open":this.isOpen}},this.internalOptions?this.internalOptions.map(((t,i)=>s("bds-select-option",{onOptionSelected:this.handler,selected:this.value===t.value,value:t.value,key:i,bulkOption:t.bulkOption,status:t.status},t.label))):s("slot",null)))}get el(){return o(this)}static get watchers(){return{selected:["itemSelectedChanged"],value:["valueChanged"],options:["parseOptions"]}}};e.style='@import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,200;0,300;0,400;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,600;1,700;1,800;1,900&display=swap"); :host{display:block}.select{position:relative;outline:none}.select__icon{color:#8ca0b3;display:-ms-flexbox;display:flex}.select__icon bds-icon{margin-left:10px}.select .icon-hidden{visibility:hidden}.select__options{background:#f8fbfb;width:100%;max-height:250px;position:absolute;top:99%;left:0;border-radius:8px;-webkit-box-shadow:0px 2px 8px rgba(96, 123, 153, 0.3);box-shadow:0px 2px 8px rgba(96, 123, 153, 0.3);overflow-y:auto;z-index:2;margin-top:4px;-webkit-transition:opacity 0.75s, visibility 0.75s, -webkit-transform 0.25s;transition:opacity 0.75s, visibility 0.75s, -webkit-transform 0.25s;transition:transform 0.25s, opacity 0.75s, visibility 0.75s;transition:transform 0.25s, opacity 0.75s, visibility 0.75s, -webkit-transform 0.25s;-webkit-transform-origin:top left;transform-origin:top left;-webkit-transform:scaleY(0);transform:scaleY(0);visibility:hidden;opacity:0;-webkit-box-shadow:0px 2px 12px 0 2px 8px rgba(96, 123, 153, 0.4);box-shadow:0px 2px 12px 0 2px 8px rgba(96, 123, 153, 0.4)}.select__options::-webkit-scrollbar{width:16px;background-color:transparent}.select__options::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.select__options--open{visibility:visible;-webkit-transform:scale(1);transform:scale(1);opacity:1}.select__options--position-top{top:auto;bottom:100%;-webkit-transform-origin:bottom left;transform-origin:bottom left}';export{e as bds_autocomplete}
|