blip-ds 1.213.2 → 1.213.3
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-input-chips.entry.js +20 -0
- package/dist/blip-ds/bds-input-chips.system.entry.js +1 -1
- package/dist/blip-ds/{p-316a2e16.system.entry.js → p-4d9c3a9e.system.entry.js} +1 -1
- package/dist/blip-ds/p-72db17e0.system.js +1 -1
- package/dist/blip-ds/p-b795bc15.entry.js +1 -0
- package/dist/cjs/bds-input-chips.cjs.entry.js +20 -0
- package/dist/collection/components/input-chips/input-chips.js +20 -0
- package/dist/esm/bds-input-chips.entry.js +20 -0
- package/dist/esm-es5/bds-input-chips.entry.js +1 -1
- package/dist/types/components/input-chips/input-chips.d.ts +1 -0
- package/package.json +1 -1
- package/dist/blip-ds/p-fa76c37e.entry.js +0 -1
|
@@ -32,6 +32,7 @@ const InputChips = class {
|
|
|
32
32
|
this.keyPressWrapper = (event) => {
|
|
33
33
|
switch (event.key) {
|
|
34
34
|
case 'Enter':
|
|
35
|
+
this.handleDelimiters();
|
|
35
36
|
this.setChip(this.value);
|
|
36
37
|
this.value = '';
|
|
37
38
|
break;
|
|
@@ -134,6 +135,25 @@ const InputChips = class {
|
|
|
134
135
|
getLastChip() {
|
|
135
136
|
return this.internalChips[this.internalChips.length - 1];
|
|
136
137
|
}
|
|
138
|
+
handleDelimiters() {
|
|
139
|
+
const value = this.nativeInput.value;
|
|
140
|
+
this.value = value ? value.trim() : '';
|
|
141
|
+
if (value.length === 0)
|
|
142
|
+
return;
|
|
143
|
+
const existTerm = value.match(this.delimiters);
|
|
144
|
+
if (!existTerm)
|
|
145
|
+
return;
|
|
146
|
+
const newValue = this.verifyAndSubstituteDelimiters(value);
|
|
147
|
+
if (!newValue) {
|
|
148
|
+
this.clearInputValues();
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const words = newValue.split(this.delimiters);
|
|
152
|
+
words.forEach((word) => {
|
|
153
|
+
this.setChip(word);
|
|
154
|
+
});
|
|
155
|
+
this.clearInputValues();
|
|
156
|
+
}
|
|
137
157
|
verifyAndSubstituteDelimiters(value) {
|
|
138
158
|
if (value.length === 1 && value[0].match(this.delimiters)) {
|
|
139
159
|
return '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(i,t,e,n){function s(i){return i instanceof e?i:new e((function(t){t(i)}))}return new(e||(e=Promise))((function(e,r){function p(i){try{o(n.next(i))}catch(t){r(t)}}function a(i){try{o(n["throw"](i))}catch(t){r(t)}}function o(i){i.done?e(i.value):s(i.value).then(p,a)}o((n=n.apply(i,t||[])).next())}))};var __generator=this&&this.__generator||function(i,t){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,p;return p={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(p[Symbol.iterator]=function(){return this}),p;function a(i){return function(t){return o([i,t])}}function o(p){if(n)throw new TypeError("Generator is already executing.");while(e)try{if(n=1,s&&(r=p[0]&2?s["return"]:p[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,p[1])).done)return r;if(s=0,r)p=[p[0]&2,r.value];switch(p[0]){case 0:case 1:r=p;break;case 4:e.label++;return{value:p[1],done:false};case 5:e.label++;s=p[1];p=[0];continue;case 7:p=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(p[0]===6||p[0]===2)){e=0;continue}if(p[0]===3&&(!r||p[1]>r[0]&&p[1]<r[3])){e.label=p[1];break}if(p[0]===6&&e.label<r[1]){e.label=r[1];r=p;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(p);break}if(r[2])e.ops.pop();e.trys.pop();continue}p=t.call(i,e)}catch(a){p=[6,a];s=0}finally{n=r=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(i,t,e){if(e||arguments.length===2)for(var n=0,s=t.length,r;n<s;n++){if(r||!(n in t)){if(!r)r=Array.prototype.slice.call(t,0,n);r[n]=t[n]}}return i.concat(r||Array.prototype.slice.call(t))};System.register(["./index-67dbc5f4.system.js","./validations-8d4fb12a.system.js"],(function(i){"use strict";var t,e,n,s,r,p;return{setters:[function(i){t=i.r;e=i.e;n=i.h;s=i.f},function(i){r=i.w;p=i.e}],execute:function(){var a='.sc-bds-input-chips-h{display:display}.element_input.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%}.element_input.sc-bds-input-chips input.sc-bds-input-chips{-webkit-box-shadow:inherit;box-shadow:inherit}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-moz-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips:-ms-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-ms-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.input.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:8px 4px 9px 12px;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;background:#ffffff}.input--state-primary.sc-bds-input-chips{border:1px solid #d2dfe6;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.sc-bds-input-chips:hover{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.input--pressed.sc-bds-input-chips{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4);box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4)}.input--state-primary.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#3f7de8;background-color:#e8f2ff}.input--state-primary.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#8ca0b3}.input--state-primary.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#3f7de8}.input--state-primary.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#3f7de8;color:#202c44}.input--state-danger.sc-bds-input-chips{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.sc-bds-input-chips:hover{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.input--pressed.sc-bds-input-chips{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #ffa5a5;box-shadow:0 0 0 2px #ffa5a5}.input--state-danger.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#ff4c4c;background-color:#ffa5a5}.input--state-danger.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#8ca0b3}.input--state-danger.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#ff4c4c}.input--state-danger.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#ff4c4c;color:#202c44}.input--state-disabled.sc-bds-input-chips{cursor:not-allowed;border:1px solid #e7edf4;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;background:#f3f6fa}.input--state-disabled.sc-bds-input-chips:hover{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;border:1px solid #e7edf4;box-sizing:border-box;border-radius:8px}.input--state-disabled.input--pressed.sc-bds-input-chips{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #e7edf4;box-shadow:0 0 0 2px #e7edf4}.input--state-disabled.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#b9cbd3;background-color:#f8fbfb}.input--state-disabled.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#b9cbd3}.input--state-disabled.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#b9cbd3}.input--state-disabled.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#b9cbd3;color:#b9cbd3}.input--label.sc-bds-input-chips{padding:7px 4px 8px 12px}.input__icon.sc-bds-input-chips{cursor:inherit;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:8px;margin-right:8px;padding:2.5px}.input__icon--large.sc-bds-input-chips{padding:4px}.input__container.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;width:100%}.input__container__wrapper.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.input__container__wrapper__chips.sc-bds-input-chips{display:inline;max-height:100px;overflow:auto}.input__container__wrapper__chips.sc-bds-input-chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__wrapper__chips.sc-bds-input-chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__container__label.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input__container__text.sc-bds-input-chips{display:inline-block;margin:0;border:0;padding:0;width:auto;vertical-align:middle;white-space:normal;line-height:inherit;background:none;color:inherit;font-size:inherit;font-family:inherit;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;font-family:"Nunito Sans", "Tahoma", "Helvetica", "Arial", sans-serif;font-size:0.875rem;line-height:150%;resize:none;cursor:inherit}.input__container__text.sc-bds-input-chips:focus{outline:0}.input__container__text.sc-bds-input-chips::-webkit-file-upload-button{padding:0;border:0;background:none}.input__container__text.sc-bds-input-chips:focus{outline:0}.input__container__text[type=checkbox].sc-bds-input-chips,.input__container__text[type=radio].sc-bds-input-chips{width:13px;height:13px}.input__container__text[type=search].sc-bds-input-chips{-webkit-appearance:textfield;-webkit-box-sizing:content-box}.sc-bds-input-chips::-webkit-search-decoration{display:none}.input__container__text[type=reset].sc-bds-input-chips,.input__container__text[type=button].sc-bds-input-chips,.input__container__text[type=submit].sc-bds-input-chips{overflow:visible}.input__container__text.sc-bds-input-chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__text.sc-bds-input-chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__message.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;height:20px;margin:3.7px 2.5px;-webkit-transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);color:#8ca0b3;word-break:break-word;height:auto;min-height:20px}.input__message.sc-bds-input-chips bds-typo.sc-bds-input-chips{margin-top:0px;-ms-flex-item-align:self-start;align-self:self-start}.input__message__icon.sc-bds-input-chips{display:-ms-flexbox;display:flex;padding-right:4px;margin-top:0px;padding-top:2px}.input__message--danger.sc-bds-input-chips{color:#ff4c4c}.inside-input-left.sc-bds-input-chips{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:8px}.input-chips__chip.sc-bds-input-chips{margin:2px 4px 2px 0px}.input-chips__chips.sc-bds-input-chips{-ms-flex:1;flex:1}';var o=i("bds_input_chips",function(){function i(i){var n=this;t(this,i);this.bdsChange=e(this,"bdsChange",7);this.bdsChangeChips=e(this,"bdsChangeChips",7);this.bdsInputChipsFocus=e(this,"bdsInputChipsFocus",7);this.bdsBlur=e(this,"bdsBlur",7);this.bdsInputChipsInput=e(this,"bdsInputChipsInput",7);this.bdsSubmit=e(this,"bdsSubmit",7);this.onClickWrapper=function(){n.onFocus();if(n.nativeInput){n.nativeInput.focus()}};this.onFocus=function(){n.bdsInputChipsFocus.emit();n.isPressed=true};this.onInput=function(i){var t=i.target;if(t){n.value=t.value||""}n.bdsInputChipsInput.emit(i)};this.keyPressWrapper=function(i){switch(i.key){case"Enter":n.setChip(n.value);n.value="";break;case"Backspace"||"Delete":if((n.value===null||n.value.length<=0)&&n.internalChips.length){n.removeLastChip();n.bdsChangeChips.emit({data:n.internalChips})}break}};this.validationDanger=false;this.isPressed=false;this.validationMesage="";this.internalChips=[];this.chips=[];this.type="text";this.label="";this.maxlength=undefined;this.icon="";this.delimiters=/,|;/;this.errorMessage="";this.danger=false;this.value="";this.duplicated=false;this.disableSubmit=false;this.disabled=false;this.helperMessage="";this.inputName="";this.placeholder="";this.dataTest=null}i.prototype.valueChanged=function(){if(this.chips){if(typeof this.chips==="string"){try{this.internalChips=JSON.parse(this.chips)}catch(i){this.internalChips=[]}}else{this.internalChips=this.chips}}else{this.internalChips=[]}};i.prototype.internalValueChanged=function(){this.bdsChangeChips.emit({data:this.internalChips,value:this.getLastChip()})};i.prototype.isValid=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this.validateChips()]}))}))};i.prototype.get=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this.internalChips]}))}))};i.prototype.clear=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.internalChips=[];this.value="";return[2]}))}))};i.prototype.add=function(i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.setChip(i);return[2]}))}))};i.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.nativeInput.focus();return[2]}))}))};i.prototype.removeFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.nativeInput.blur();return[2]}))}))};i.prototype.componentWillLoad=function(){this.valueChanged()};i.prototype.validateChips=function(){var i=this;if(this.type==="email"){return!this.internalChips.some((function(t){return!i.validateChip(t)}))}else{return true}};i.prototype.handleOnBlur=function(){this.bdsBlur.emit(this.internalChips);this.isPressed=false};i.prototype.getLastChip=function(){return this.internalChips[this.internalChips.length-1]};i.prototype.verifyAndSubstituteDelimiters=function(i){if(i.length===1&&i[0].match(this.delimiters)){return""}var t=i.replace(/;/g,",").replace(/\,+|;+/g,",");if(t[0].match(this.delimiters)){t=t.substring(1)}return t};i.prototype.handleChange=function(i){return __awaiter(this,void 0,void 0,(function(){var t,e,n,s;var r=this;return __generator(this,(function(p){t=i.detail.value;this.value=t?t.trim():"";if(t.length===0)return[2];e=t.match(this.delimiters);if(!e)return[2];n=this.verifyAndSubstituteDelimiters(t);if(!n){this.clearInputValues();return[2]}s=n.split(this.delimiters);s.forEach((function(i){r.setChip(i)}));this.clearInputValues();return[2]}))}))};i.prototype.clearInputValues=function(i){if(i===void 0){i=""}this.nativeInput.value=i;this.value=i};i.prototype.setChip=function(i){if(!this.duplicated){var t=this.internalChips.some((function(t){return t.toLowerCase()===i.toLowerCase()}));if(t)return}if(!r(i)){return}this.internalChips=__spreadArray(__spreadArray([],this.internalChips,true),[i],false)};i.prototype.validateChip=function(i){var t=i.trim();if(this.type==="email"&&p(t)){return false}return true};i.prototype.removeLastChip=function(){this.internalChips=this.internalChips.slice(0,this.internalChips.length-1)};i.prototype.removeChip=function(i){var t=i.detail.id;this.internalChips=this.internalChips.filter((function(i,e){return e.toString()!==t}))};i.prototype.renderChips=function(){var i=this;if(!this.internalChips.length){return[]}return this.internalChips.map((function(t,e){var s=e.toString();return n("bds-chip-clickable",{id:s,key:s,color:"default",close:!i.disabled,onChipClickableClose:function(t){return i.removeChip(t)}},t)}))};i.prototype.renderIcon=function(){return this.icon&&n("div",{class:{input__icon:true,"input__icon--large":!!this.label}},n("bds-icon",{size:this.label?"medium":"small",name:this.icon,color:"inherit"}))};i.prototype.renderLabel=function(){return this.label&&n("label",{class:{input__container__label:true,"input__container__label--pressed":this.isPressed&&!this.disabled}},n("bds-typo",{variant:"fs-12",bold:"bold"},this.label))};i.prototype.renderMessage=function(){var i=this.danger?"error":"info";var t=this.danger?this.errorMessage:this.helperMessage;if(!t&&this.validationDanger)t=this.validationMesage;var e=this.danger||this.validationDanger?"input__message input__message--danger":"input__message";if(t){return n("div",{class:e,part:"input__message"},n("div",{class:"input__message__icon"},n("bds-icon",{size:"x-small",name:i,theme:"solid",color:"inherit"})),n("bds-typo",{variant:"fs-12"},t))}return undefined};i.prototype.render=function(){var i=this;var t=this.isPressed&&!this.disabled;return n(s,null,n("div",{class:{element_input:true},"aria-disabled":this.disabled?"true":null},n("div",{class:{input:true,"input--state-primary":!this.danger&&!this.validationDanger,"input--state-danger":this.danger||this.validationDanger,"input--state-disabled":this.disabled,"input--label":!!this.label,"input--pressed":t},onClick:this.onClickWrapper,onKeyDown:this.keyPressWrapper,part:"input-container"},this.renderIcon(),n("div",{class:"input__container"},this.renderLabel(),n("div",{class:{input__container__wrapper:true}},this.internalChips.length>0&&n("span",{class:"inside-input-left"},this.renderChips()),n("input",{ref:function(t){return i.nativeInput=t},class:{input__container__text:true},name:this.inputName,maxlength:this.maxlength,placeholder:this.placeholder,onInput:this.onInput,onFocus:this.onFocus,onBlur:function(){return i.handleOnBlur()},onChange:function(){return i.handleChange},value:this.value,disabled:this.disabled,"data-test":this.dataTest}))),n("slot",{name:"input-right"})),this.renderMessage()))};Object.defineProperty(i,"watchers",{get:function(){return{chips:["valueChanged"],internalChips:["internalValueChanged"]}},enumerable:false,configurable:true});return i}());o.style=a}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(i,t,e,n){function s(i){return i instanceof e?i:new e((function(t){t(i)}))}return new(e||(e=Promise))((function(e,r){function a(i){try{o(n.next(i))}catch(t){r(t)}}function p(i){try{o(n["throw"](i))}catch(t){r(t)}}function o(i){i.done?e(i.value):s(i.value).then(a,p)}o((n=n.apply(i,t||[])).next())}))};var __generator=this&&this.__generator||function(i,t){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,a;return a={next:p(0),throw:p(1),return:p(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function p(i){return function(t){return o([i,t])}}function o(a){if(n)throw new TypeError("Generator is already executing.");while(e)try{if(n=1,s&&(r=a[0]&2?s["return"]:a[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,a[1])).done)return r;if(s=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:e.label++;return{value:a[1],done:false};case 5:e.label++;s=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){e.label=a[1];break}if(a[0]===6&&e.label<r[1]){e.label=r[1];r=a;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(a);break}if(r[2])e.ops.pop();e.trys.pop();continue}a=t.call(i,e)}catch(p){a=[6,p];s=0}finally{n=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(i,t,e){if(e||arguments.length===2)for(var n=0,s=t.length,r;n<s;n++){if(r||!(n in t)){if(!r)r=Array.prototype.slice.call(t,0,n);r[n]=t[n]}}return i.concat(r||Array.prototype.slice.call(t))};System.register(["./index-67dbc5f4.system.js","./validations-8d4fb12a.system.js"],(function(i){"use strict";var t,e,n,s,r,a;return{setters:[function(i){t=i.r;e=i.e;n=i.h;s=i.f},function(i){r=i.w;a=i.e}],execute:function(){var p='.sc-bds-input-chips-h{display:display}.element_input.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%}.element_input.sc-bds-input-chips input.sc-bds-input-chips{-webkit-box-shadow:inherit;box-shadow:inherit}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-moz-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips:-ms-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-ms-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.input.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:8px 4px 9px 12px;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;background:#ffffff}.input--state-primary.sc-bds-input-chips{border:1px solid #d2dfe6;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.sc-bds-input-chips:hover{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.input--pressed.sc-bds-input-chips{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4);box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4)}.input--state-primary.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#3f7de8;background-color:#e8f2ff}.input--state-primary.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#8ca0b3}.input--state-primary.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#3f7de8}.input--state-primary.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#3f7de8;color:#202c44}.input--state-danger.sc-bds-input-chips{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.sc-bds-input-chips:hover{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.input--pressed.sc-bds-input-chips{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #ffa5a5;box-shadow:0 0 0 2px #ffa5a5}.input--state-danger.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#ff4c4c;background-color:#ffa5a5}.input--state-danger.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#8ca0b3}.input--state-danger.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#ff4c4c}.input--state-danger.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#ff4c4c;color:#202c44}.input--state-disabled.sc-bds-input-chips{cursor:not-allowed;border:1px solid #e7edf4;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;background:#f3f6fa}.input--state-disabled.sc-bds-input-chips:hover{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;border:1px solid #e7edf4;box-sizing:border-box;border-radius:8px}.input--state-disabled.input--pressed.sc-bds-input-chips{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #e7edf4;box-shadow:0 0 0 2px #e7edf4}.input--state-disabled.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#b9cbd3;background-color:#f8fbfb}.input--state-disabled.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#b9cbd3}.input--state-disabled.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#b9cbd3}.input--state-disabled.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#b9cbd3;color:#b9cbd3}.input--label.sc-bds-input-chips{padding:7px 4px 8px 12px}.input__icon.sc-bds-input-chips{cursor:inherit;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:8px;margin-right:8px;padding:2.5px}.input__icon--large.sc-bds-input-chips{padding:4px}.input__container.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;width:100%}.input__container__wrapper.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.input__container__wrapper__chips.sc-bds-input-chips{display:inline;max-height:100px;overflow:auto}.input__container__wrapper__chips.sc-bds-input-chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__wrapper__chips.sc-bds-input-chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__container__label.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input__container__text.sc-bds-input-chips{display:inline-block;margin:0;border:0;padding:0;width:auto;vertical-align:middle;white-space:normal;line-height:inherit;background:none;color:inherit;font-size:inherit;font-family:inherit;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;font-family:"Nunito Sans", "Tahoma", "Helvetica", "Arial", sans-serif;font-size:0.875rem;line-height:150%;resize:none;cursor:inherit}.input__container__text.sc-bds-input-chips:focus{outline:0}.input__container__text.sc-bds-input-chips::-webkit-file-upload-button{padding:0;border:0;background:none}.input__container__text.sc-bds-input-chips:focus{outline:0}.input__container__text[type=checkbox].sc-bds-input-chips,.input__container__text[type=radio].sc-bds-input-chips{width:13px;height:13px}.input__container__text[type=search].sc-bds-input-chips{-webkit-appearance:textfield;-webkit-box-sizing:content-box}.sc-bds-input-chips::-webkit-search-decoration{display:none}.input__container__text[type=reset].sc-bds-input-chips,.input__container__text[type=button].sc-bds-input-chips,.input__container__text[type=submit].sc-bds-input-chips{overflow:visible}.input__container__text.sc-bds-input-chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__text.sc-bds-input-chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__message.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;height:20px;margin:3.7px 2.5px;-webkit-transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);color:#8ca0b3;word-break:break-word;height:auto;min-height:20px}.input__message.sc-bds-input-chips bds-typo.sc-bds-input-chips{margin-top:0px;-ms-flex-item-align:self-start;align-self:self-start}.input__message__icon.sc-bds-input-chips{display:-ms-flexbox;display:flex;padding-right:4px;margin-top:0px;padding-top:2px}.input__message--danger.sc-bds-input-chips{color:#ff4c4c}.inside-input-left.sc-bds-input-chips{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:8px}.input-chips__chip.sc-bds-input-chips{margin:2px 4px 2px 0px}.input-chips__chips.sc-bds-input-chips{-ms-flex:1;flex:1}';var o=i("bds_input_chips",function(){function i(i){var n=this;t(this,i);this.bdsChange=e(this,"bdsChange",7);this.bdsChangeChips=e(this,"bdsChangeChips",7);this.bdsInputChipsFocus=e(this,"bdsInputChipsFocus",7);this.bdsBlur=e(this,"bdsBlur",7);this.bdsInputChipsInput=e(this,"bdsInputChipsInput",7);this.bdsSubmit=e(this,"bdsSubmit",7);this.onClickWrapper=function(){n.onFocus();if(n.nativeInput){n.nativeInput.focus()}};this.onFocus=function(){n.bdsInputChipsFocus.emit();n.isPressed=true};this.onInput=function(i){var t=i.target;if(t){n.value=t.value||""}n.bdsInputChipsInput.emit(i)};this.keyPressWrapper=function(i){switch(i.key){case"Enter":n.handleDelimiters();n.setChip(n.value);n.value="";break;case"Backspace"||"Delete":if((n.value===null||n.value.length<=0)&&n.internalChips.length){n.removeLastChip();n.bdsChangeChips.emit({data:n.internalChips})}break}};this.validationDanger=false;this.isPressed=false;this.validationMesage="";this.internalChips=[];this.chips=[];this.type="text";this.label="";this.maxlength=undefined;this.icon="";this.delimiters=/,|;/;this.errorMessage="";this.danger=false;this.value="";this.duplicated=false;this.disableSubmit=false;this.disabled=false;this.helperMessage="";this.inputName="";this.placeholder="";this.dataTest=null}i.prototype.valueChanged=function(){if(this.chips){if(typeof this.chips==="string"){try{this.internalChips=JSON.parse(this.chips)}catch(i){this.internalChips=[]}}else{this.internalChips=this.chips}}else{this.internalChips=[]}};i.prototype.internalValueChanged=function(){this.bdsChangeChips.emit({data:this.internalChips,value:this.getLastChip()})};i.prototype.isValid=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this.validateChips()]}))}))};i.prototype.get=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this.internalChips]}))}))};i.prototype.clear=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.internalChips=[];this.value="";return[2]}))}))};i.prototype.add=function(i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.setChip(i);return[2]}))}))};i.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.nativeInput.focus();return[2]}))}))};i.prototype.removeFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.nativeInput.blur();return[2]}))}))};i.prototype.componentWillLoad=function(){this.valueChanged()};i.prototype.validateChips=function(){var i=this;if(this.type==="email"){return!this.internalChips.some((function(t){return!i.validateChip(t)}))}else{return true}};i.prototype.handleOnBlur=function(){this.bdsBlur.emit(this.internalChips);this.isPressed=false};i.prototype.getLastChip=function(){return this.internalChips[this.internalChips.length-1]};i.prototype.handleDelimiters=function(){var i=this;var t=this.nativeInput.value;this.value=t?t.trim():"";if(t.length===0)return;var e=t.match(this.delimiters);if(!e)return;var n=this.verifyAndSubstituteDelimiters(t);if(!n){this.clearInputValues();return}var s=n.split(this.delimiters);s.forEach((function(t){i.setChip(t)}));this.clearInputValues()};i.prototype.verifyAndSubstituteDelimiters=function(i){if(i.length===1&&i[0].match(this.delimiters)){return""}var t=i.replace(/;/g,",").replace(/\,+|;+/g,",");if(t[0].match(this.delimiters)){t=t.substring(1)}return t};i.prototype.handleChange=function(i){return __awaiter(this,void 0,void 0,(function(){var t,e,n,s;var r=this;return __generator(this,(function(a){t=i.detail.value;this.value=t?t.trim():"";if(t.length===0)return[2];e=t.match(this.delimiters);if(!e)return[2];n=this.verifyAndSubstituteDelimiters(t);if(!n){this.clearInputValues();return[2]}s=n.split(this.delimiters);s.forEach((function(i){r.setChip(i)}));this.clearInputValues();return[2]}))}))};i.prototype.clearInputValues=function(i){if(i===void 0){i=""}this.nativeInput.value=i;this.value=i};i.prototype.setChip=function(i){if(!this.duplicated){var t=this.internalChips.some((function(t){return t.toLowerCase()===i.toLowerCase()}));if(t)return}if(!r(i)){return}this.internalChips=__spreadArray(__spreadArray([],this.internalChips,true),[i],false)};i.prototype.validateChip=function(i){var t=i.trim();if(this.type==="email"&&a(t)){return false}return true};i.prototype.removeLastChip=function(){this.internalChips=this.internalChips.slice(0,this.internalChips.length-1)};i.prototype.removeChip=function(i){var t=i.detail.id;this.internalChips=this.internalChips.filter((function(i,e){return e.toString()!==t}))};i.prototype.renderChips=function(){var i=this;if(!this.internalChips.length){return[]}return this.internalChips.map((function(t,e){var s=e.toString();return n("bds-chip-clickable",{id:s,key:s,color:"default",close:!i.disabled,onChipClickableClose:function(t){return i.removeChip(t)}},t)}))};i.prototype.renderIcon=function(){return this.icon&&n("div",{class:{input__icon:true,"input__icon--large":!!this.label}},n("bds-icon",{size:this.label?"medium":"small",name:this.icon,color:"inherit"}))};i.prototype.renderLabel=function(){return this.label&&n("label",{class:{input__container__label:true,"input__container__label--pressed":this.isPressed&&!this.disabled}},n("bds-typo",{variant:"fs-12",bold:"bold"},this.label))};i.prototype.renderMessage=function(){var i=this.danger?"error":"info";var t=this.danger?this.errorMessage:this.helperMessage;if(!t&&this.validationDanger)t=this.validationMesage;var e=this.danger||this.validationDanger?"input__message input__message--danger":"input__message";if(t){return n("div",{class:e,part:"input__message"},n("div",{class:"input__message__icon"},n("bds-icon",{size:"x-small",name:i,theme:"solid",color:"inherit"})),n("bds-typo",{variant:"fs-12"},t))}return undefined};i.prototype.render=function(){var i=this;var t=this.isPressed&&!this.disabled;return n(s,null,n("div",{class:{element_input:true},"aria-disabled":this.disabled?"true":null},n("div",{class:{input:true,"input--state-primary":!this.danger&&!this.validationDanger,"input--state-danger":this.danger||this.validationDanger,"input--state-disabled":this.disabled,"input--label":!!this.label,"input--pressed":t},onClick:this.onClickWrapper,onKeyDown:this.keyPressWrapper,part:"input-container"},this.renderIcon(),n("div",{class:"input__container"},this.renderLabel(),n("div",{class:{input__container__wrapper:true}},this.internalChips.length>0&&n("span",{class:"inside-input-left"},this.renderChips()),n("input",{ref:function(t){return i.nativeInput=t},class:{input__container__text:true},name:this.inputName,maxlength:this.maxlength,placeholder:this.placeholder,onInput:this.onInput,onFocus:this.onFocus,onBlur:function(){return i.handleOnBlur()},onChange:function(){return i.handleChange},value:this.value,disabled:this.disabled,"data-test":this.dataTest}))),n("slot",{name:"input-right"})),this.renderMessage()))};Object.defineProperty(i,"watchers",{get:function(){return{chips:["valueChanged"],internalChips:["internalValueChanged"]}},enumerable:false,configurable:true});return i}());o.style=p}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(i,t,e,n){function s(i){return i instanceof e?i:new e((function(t){t(i)}))}return new(e||(e=Promise))((function(e,r){function p(i){try{o(n.next(i))}catch(t){r(t)}}function a(i){try{o(n["throw"](i))}catch(t){r(t)}}function o(i){i.done?e(i.value):s(i.value).then(p,a)}o((n=n.apply(i,t||[])).next())}))};var __generator=this&&this.__generator||function(i,t){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,p;return p={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(p[Symbol.iterator]=function(){return this}),p;function a(i){return function(t){return o([i,t])}}function o(p){if(n)throw new TypeError("Generator is already executing.");while(e)try{if(n=1,s&&(r=p[0]&2?s["return"]:p[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,p[1])).done)return r;if(s=0,r)p=[p[0]&2,r.value];switch(p[0]){case 0:case 1:r=p;break;case 4:e.label++;return{value:p[1],done:false};case 5:e.label++;s=p[1];p=[0];continue;case 7:p=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(p[0]===6||p[0]===2)){e=0;continue}if(p[0]===3&&(!r||p[1]>r[0]&&p[1]<r[3])){e.label=p[1];break}if(p[0]===6&&e.label<r[1]){e.label=r[1];r=p;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(p);break}if(r[2])e.ops.pop();e.trys.pop();continue}p=t.call(i,e)}catch(a){p=[6,a];s=0}finally{n=r=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(i,t,e){if(e||arguments.length===2)for(var n=0,s=t.length,r;n<s;n++){if(r||!(n in t)){if(!r)r=Array.prototype.slice.call(t,0,n);r[n]=t[n]}}return i.concat(r||Array.prototype.slice.call(t))};System.register(["./p-5ce34965.system.js","./p-c5060283.system.js"],(function(i){"use strict";var t,e,n,s,r,p;return{setters:[function(i){t=i.r;e=i.c;n=i.h;s=i.H},function(i){r=i.w;p=i.e}],execute:function(){var a='.sc-bds-input-chips-h{display:display}.element_input.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%}.element_input.sc-bds-input-chips input.sc-bds-input-chips{-webkit-box-shadow:inherit;box-shadow:inherit}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-moz-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips:-ms-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-ms-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.input.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:8px 4px 9px 12px;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;background:#ffffff}.input--state-primary.sc-bds-input-chips{border:1px solid #d2dfe6;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.sc-bds-input-chips:hover{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.input--pressed.sc-bds-input-chips{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4);box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4)}.input--state-primary.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#3f7de8;background-color:#e8f2ff}.input--state-primary.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#8ca0b3}.input--state-primary.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#3f7de8}.input--state-primary.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#3f7de8;color:#202c44}.input--state-danger.sc-bds-input-chips{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.sc-bds-input-chips:hover{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.input--pressed.sc-bds-input-chips{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #ffa5a5;box-shadow:0 0 0 2px #ffa5a5}.input--state-danger.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#ff4c4c;background-color:#ffa5a5}.input--state-danger.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#8ca0b3}.input--state-danger.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#ff4c4c}.input--state-danger.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#ff4c4c;color:#202c44}.input--state-disabled.sc-bds-input-chips{cursor:not-allowed;border:1px solid #e7edf4;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;background:#f3f6fa}.input--state-disabled.sc-bds-input-chips:hover{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;border:1px solid #e7edf4;box-sizing:border-box;border-radius:8px}.input--state-disabled.input--pressed.sc-bds-input-chips{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #e7edf4;box-shadow:0 0 0 2px #e7edf4}.input--state-disabled.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#b9cbd3;background-color:#f8fbfb}.input--state-disabled.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#b9cbd3}.input--state-disabled.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#b9cbd3}.input--state-disabled.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#b9cbd3;color:#b9cbd3}.input--label.sc-bds-input-chips{padding:7px 4px 8px 12px}.input__icon.sc-bds-input-chips{cursor:inherit;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:8px;margin-right:8px;padding:2.5px}.input__icon--large.sc-bds-input-chips{padding:4px}.input__container.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;width:100%}.input__container__wrapper.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.input__container__wrapper__chips.sc-bds-input-chips{display:inline;max-height:100px;overflow:auto}.input__container__wrapper__chips.sc-bds-input-chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__wrapper__chips.sc-bds-input-chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__container__label.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input__container__text.sc-bds-input-chips{display:inline-block;margin:0;border:0;padding:0;width:auto;vertical-align:middle;white-space:normal;line-height:inherit;background:none;color:inherit;font-size:inherit;font-family:inherit;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;font-family:"Nunito Sans", "Tahoma", "Helvetica", "Arial", sans-serif;font-size:0.875rem;line-height:150%;resize:none;cursor:inherit}.input__container__text.sc-bds-input-chips:focus{outline:0}.input__container__text.sc-bds-input-chips::-webkit-file-upload-button{padding:0;border:0;background:none}.input__container__text.sc-bds-input-chips:focus{outline:0}.input__container__text[type=checkbox].sc-bds-input-chips,.input__container__text[type=radio].sc-bds-input-chips{width:13px;height:13px}.input__container__text[type=search].sc-bds-input-chips{-webkit-appearance:textfield;-webkit-box-sizing:content-box}.sc-bds-input-chips::-webkit-search-decoration{display:none}.input__container__text[type=reset].sc-bds-input-chips,.input__container__text[type=button].sc-bds-input-chips,.input__container__text[type=submit].sc-bds-input-chips{overflow:visible}.input__container__text.sc-bds-input-chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__text.sc-bds-input-chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__message.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;height:20px;margin:3.7px 2.5px;-webkit-transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);color:#8ca0b3;word-break:break-word;height:auto;min-height:20px}.input__message.sc-bds-input-chips bds-typo.sc-bds-input-chips{margin-top:0px;-ms-flex-item-align:self-start;align-self:self-start}.input__message__icon.sc-bds-input-chips{display:-ms-flexbox;display:flex;padding-right:4px;margin-top:0px;padding-top:2px}.input__message--danger.sc-bds-input-chips{color:#ff4c4c}.inside-input-left.sc-bds-input-chips{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:8px}.input-chips__chip.sc-bds-input-chips{margin:2px 4px 2px 0px}.input-chips__chips.sc-bds-input-chips{-ms-flex:1;flex:1}';var o=i("bds_input_chips",function(){function i(i){var n=this;t(this,i);this.bdsChange=e(this,"bdsChange",7);this.bdsChangeChips=e(this,"bdsChangeChips",7);this.bdsInputChipsFocus=e(this,"bdsInputChipsFocus",7);this.bdsBlur=e(this,"bdsBlur",7);this.bdsInputChipsInput=e(this,"bdsInputChipsInput",7);this.bdsSubmit=e(this,"bdsSubmit",7);this.onClickWrapper=function(){n.onFocus();if(n.nativeInput){n.nativeInput.focus()}};this.onFocus=function(){n.bdsInputChipsFocus.emit();n.isPressed=true};this.onInput=function(i){var t=i.target;if(t){n.value=t.value||""}n.bdsInputChipsInput.emit(i)};this.keyPressWrapper=function(i){switch(i.key){case"Enter":n.setChip(n.value);n.value="";break;case"Backspace":if((n.value===null||n.value.length<=0)&&n.internalChips.length){n.removeLastChip();n.bdsChangeChips.emit({data:n.internalChips})}break}};this.validationDanger=false;this.isPressed=false;this.validationMesage="";this.internalChips=[];this.chips=[];this.type="text";this.label="";this.maxlength=undefined;this.icon="";this.delimiters=/,|;/;this.errorMessage="";this.danger=false;this.value="";this.duplicated=false;this.disableSubmit=false;this.disabled=false;this.helperMessage="";this.inputName="";this.placeholder="";this.dataTest=null}i.prototype.valueChanged=function(){if(this.chips){if(typeof this.chips==="string"){try{this.internalChips=JSON.parse(this.chips)}catch(i){this.internalChips=[]}}else{this.internalChips=this.chips}}else{this.internalChips=[]}};i.prototype.internalValueChanged=function(){this.bdsChangeChips.emit({data:this.internalChips,value:this.getLastChip()})};i.prototype.isValid=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this.validateChips()]}))}))};i.prototype.get=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this.internalChips]}))}))};i.prototype.clear=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.internalChips=[];this.value="";return[2]}))}))};i.prototype.add=function(i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.setChip(i);return[2]}))}))};i.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.nativeInput.focus();return[2]}))}))};i.prototype.removeFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.nativeInput.blur();return[2]}))}))};i.prototype.componentWillLoad=function(){this.valueChanged()};i.prototype.validateChips=function(){var i=this;if(this.type==="email"){return!this.internalChips.some((function(t){return!i.validateChip(t)}))}else{return true}};i.prototype.handleOnBlur=function(){this.bdsBlur.emit(this.internalChips);this.isPressed=false};i.prototype.getLastChip=function(){return this.internalChips[this.internalChips.length-1]};i.prototype.verifyAndSubstituteDelimiters=function(i){if(i.length===1&&i[0].match(this.delimiters)){return""}var t=i.replace(/;/g,",").replace(/\,+|;+/g,",");if(t[0].match(this.delimiters)){t=t.substring(1)}return t};i.prototype.handleChange=function(i){return __awaiter(this,void 0,void 0,(function(){var t,e,n,s;var r=this;return __generator(this,(function(p){t=i.detail.value;this.value=t?t.trim():"";if(t.length===0)return[2];e=t.match(this.delimiters);if(!e)return[2];n=this.verifyAndSubstituteDelimiters(t);if(!n){this.clearInputValues();return[2]}s=n.split(this.delimiters);s.forEach((function(i){r.setChip(i)}));this.clearInputValues();return[2]}))}))};i.prototype.clearInputValues=function(i){if(i===void 0){i=""}this.nativeInput.value=i;this.value=i};i.prototype.setChip=function(i){if(!this.duplicated){var t=this.internalChips.some((function(t){return t.toLowerCase()===i.toLowerCase()}));if(t)return}if(!r(i)){return}this.internalChips=__spreadArray(__spreadArray([],this.internalChips,true),[i],false)};i.prototype.validateChip=function(i){var t=i.trim();if(this.type==="email"&&p(t)){return false}return true};i.prototype.removeLastChip=function(){this.internalChips=this.internalChips.slice(0,this.internalChips.length-1)};i.prototype.removeChip=function(i){var t=i.detail.id;this.internalChips=this.internalChips.filter((function(i,e){return e.toString()!==t}))};i.prototype.renderChips=function(){var i=this;if(!this.internalChips.length){return[]}return this.internalChips.map((function(t,e){var s=e.toString();return n("bds-chip-clickable",{id:s,key:s,color:"default",close:!i.disabled,onChipClickableClose:function(t){return i.removeChip(t)}},t)}))};i.prototype.renderIcon=function(){return this.icon&&n("div",{class:{input__icon:true,"input__icon--large":!!this.label}},n("bds-icon",{size:this.label?"medium":"small",name:this.icon,color:"inherit"}))};i.prototype.renderLabel=function(){return this.label&&n("label",{class:{input__container__label:true,"input__container__label--pressed":this.isPressed&&!this.disabled}},n("bds-typo",{variant:"fs-12",bold:"bold"},this.label))};i.prototype.renderMessage=function(){var i=this.danger?"error":"info";var t=this.danger?this.errorMessage:this.helperMessage;if(!t&&this.validationDanger)t=this.validationMesage;var e=this.danger||this.validationDanger?"input__message input__message--danger":"input__message";if(t){return n("div",{class:e,part:"input__message"},n("div",{class:"input__message__icon"},n("bds-icon",{size:"x-small",name:i,theme:"solid",color:"inherit"})),n("bds-typo",{variant:"fs-12"},t))}return undefined};i.prototype.render=function(){var i=this;var t=this.isPressed&&!this.disabled;return n(s,null,n("div",{class:{element_input:true},"aria-disabled":this.disabled?"true":null},n("div",{class:{input:true,"input--state-primary":!this.danger&&!this.validationDanger,"input--state-danger":this.danger||this.validationDanger,"input--state-disabled":this.disabled,"input--label":!!this.label,"input--pressed":t},onClick:this.onClickWrapper,onKeyDown:this.keyPressWrapper,part:"input-container"},this.renderIcon(),n("div",{class:"input__container"},this.renderLabel(),n("div",{class:{input__container__wrapper:true}},this.internalChips.length>0&&n("span",{class:"inside-input-left"},this.renderChips()),n("input",{ref:function(t){return i.nativeInput=t},class:{input__container__text:true},name:this.inputName,maxlength:this.maxlength,placeholder:this.placeholder,onInput:this.onInput,onFocus:this.onFocus,onBlur:function(){return i.handleOnBlur()},onChange:function(){return i.handleChange},value:this.value,disabled:this.disabled,"data-test":this.dataTest}))),n("slot",{name:"input-right"})),this.renderMessage()))};Object.defineProperty(i,"watchers",{get:function(){return{chips:["valueChanged"],internalChips:["internalValueChanged"]}},enumerable:false,configurable:true});return i}());o.style=a}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(i,t,e,n){function s(i){return i instanceof e?i:new e((function(t){t(i)}))}return new(e||(e=Promise))((function(e,r){function p(i){try{o(n.next(i))}catch(t){r(t)}}function a(i){try{o(n["throw"](i))}catch(t){r(t)}}function o(i){i.done?e(i.value):s(i.value).then(p,a)}o((n=n.apply(i,t||[])).next())}))};var __generator=this&&this.__generator||function(i,t){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,p;return p={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(p[Symbol.iterator]=function(){return this}),p;function a(i){return function(t){return o([i,t])}}function o(p){if(n)throw new TypeError("Generator is already executing.");while(e)try{if(n=1,s&&(r=p[0]&2?s["return"]:p[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,p[1])).done)return r;if(s=0,r)p=[p[0]&2,r.value];switch(p[0]){case 0:case 1:r=p;break;case 4:e.label++;return{value:p[1],done:false};case 5:e.label++;s=p[1];p=[0];continue;case 7:p=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(p[0]===6||p[0]===2)){e=0;continue}if(p[0]===3&&(!r||p[1]>r[0]&&p[1]<r[3])){e.label=p[1];break}if(p[0]===6&&e.label<r[1]){e.label=r[1];r=p;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(p);break}if(r[2])e.ops.pop();e.trys.pop();continue}p=t.call(i,e)}catch(a){p=[6,a];s=0}finally{n=r=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(i,t,e){if(e||arguments.length===2)for(var n=0,s=t.length,r;n<s;n++){if(r||!(n in t)){if(!r)r=Array.prototype.slice.call(t,0,n);r[n]=t[n]}}return i.concat(r||Array.prototype.slice.call(t))};System.register(["./p-5ce34965.system.js","./p-c5060283.system.js"],(function(i){"use strict";var t,e,n,s,r,p;return{setters:[function(i){t=i.r;e=i.c;n=i.h;s=i.H},function(i){r=i.w;p=i.e}],execute:function(){var a='.sc-bds-input-chips-h{display:display}.element_input.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%}.element_input.sc-bds-input-chips input.sc-bds-input-chips{-webkit-box-shadow:inherit;box-shadow:inherit}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-moz-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips:-ms-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-ms-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.input.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:8px 4px 9px 12px;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;background:#ffffff}.input--state-primary.sc-bds-input-chips{border:1px solid #d2dfe6;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.sc-bds-input-chips:hover{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.input--pressed.sc-bds-input-chips{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4);box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4)}.input--state-primary.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#3f7de8;background-color:#e8f2ff}.input--state-primary.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#8ca0b3}.input--state-primary.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#3f7de8}.input--state-primary.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#3f7de8;color:#202c44}.input--state-danger.sc-bds-input-chips{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.sc-bds-input-chips:hover{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.input--pressed.sc-bds-input-chips{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #ffa5a5;box-shadow:0 0 0 2px #ffa5a5}.input--state-danger.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#ff4c4c;background-color:#ffa5a5}.input--state-danger.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#8ca0b3}.input--state-danger.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#ff4c4c}.input--state-danger.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#ff4c4c;color:#202c44}.input--state-disabled.sc-bds-input-chips{cursor:not-allowed;border:1px solid #e7edf4;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;background:#f3f6fa}.input--state-disabled.sc-bds-input-chips:hover{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;border:1px solid #e7edf4;box-sizing:border-box;border-radius:8px}.input--state-disabled.input--pressed.sc-bds-input-chips{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #e7edf4;box-shadow:0 0 0 2px #e7edf4}.input--state-disabled.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#b9cbd3;background-color:#f8fbfb}.input--state-disabled.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#b9cbd3}.input--state-disabled.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#b9cbd3}.input--state-disabled.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#b9cbd3;color:#b9cbd3}.input--label.sc-bds-input-chips{padding:7px 4px 8px 12px}.input__icon.sc-bds-input-chips{cursor:inherit;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:8px;margin-right:8px;padding:2.5px}.input__icon--large.sc-bds-input-chips{padding:4px}.input__container.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;width:100%}.input__container__wrapper.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.input__container__wrapper__chips.sc-bds-input-chips{display:inline;max-height:100px;overflow:auto}.input__container__wrapper__chips.sc-bds-input-chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__wrapper__chips.sc-bds-input-chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__container__label.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input__container__text.sc-bds-input-chips{display:inline-block;margin:0;border:0;padding:0;width:auto;vertical-align:middle;white-space:normal;line-height:inherit;background:none;color:inherit;font-size:inherit;font-family:inherit;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;font-family:"Nunito Sans", "Tahoma", "Helvetica", "Arial", sans-serif;font-size:0.875rem;line-height:150%;resize:none;cursor:inherit}.input__container__text.sc-bds-input-chips:focus{outline:0}.input__container__text.sc-bds-input-chips::-webkit-file-upload-button{padding:0;border:0;background:none}.input__container__text.sc-bds-input-chips:focus{outline:0}.input__container__text[type=checkbox].sc-bds-input-chips,.input__container__text[type=radio].sc-bds-input-chips{width:13px;height:13px}.input__container__text[type=search].sc-bds-input-chips{-webkit-appearance:textfield;-webkit-box-sizing:content-box}.sc-bds-input-chips::-webkit-search-decoration{display:none}.input__container__text[type=reset].sc-bds-input-chips,.input__container__text[type=button].sc-bds-input-chips,.input__container__text[type=submit].sc-bds-input-chips{overflow:visible}.input__container__text.sc-bds-input-chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__text.sc-bds-input-chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__message.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;height:20px;margin:3.7px 2.5px;-webkit-transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);color:#8ca0b3;word-break:break-word;height:auto;min-height:20px}.input__message.sc-bds-input-chips bds-typo.sc-bds-input-chips{margin-top:0px;-ms-flex-item-align:self-start;align-self:self-start}.input__message__icon.sc-bds-input-chips{display:-ms-flexbox;display:flex;padding-right:4px;margin-top:0px;padding-top:2px}.input__message--danger.sc-bds-input-chips{color:#ff4c4c}.inside-input-left.sc-bds-input-chips{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:8px}.input-chips__chip.sc-bds-input-chips{margin:2px 4px 2px 0px}.input-chips__chips.sc-bds-input-chips{-ms-flex:1;flex:1}';var o=i("bds_input_chips",function(){function i(i){var n=this;t(this,i);this.bdsChange=e(this,"bdsChange",7);this.bdsChangeChips=e(this,"bdsChangeChips",7);this.bdsInputChipsFocus=e(this,"bdsInputChipsFocus",7);this.bdsBlur=e(this,"bdsBlur",7);this.bdsInputChipsInput=e(this,"bdsInputChipsInput",7);this.bdsSubmit=e(this,"bdsSubmit",7);this.onClickWrapper=function(){n.onFocus();if(n.nativeInput){n.nativeInput.focus()}};this.onFocus=function(){n.bdsInputChipsFocus.emit();n.isPressed=true};this.onInput=function(i){var t=i.target;if(t){n.value=t.value||""}n.bdsInputChipsInput.emit(i)};this.keyPressWrapper=function(i){switch(i.key){case"Enter":n.handleDelimiters();n.setChip(n.value);n.value="";break;case"Backspace":if((n.value===null||n.value.length<=0)&&n.internalChips.length){n.removeLastChip();n.bdsChangeChips.emit({data:n.internalChips})}break}};this.validationDanger=false;this.isPressed=false;this.validationMesage="";this.internalChips=[];this.chips=[];this.type="text";this.label="";this.maxlength=undefined;this.icon="";this.delimiters=/,|;/;this.errorMessage="";this.danger=false;this.value="";this.duplicated=false;this.disableSubmit=false;this.disabled=false;this.helperMessage="";this.inputName="";this.placeholder="";this.dataTest=null}i.prototype.valueChanged=function(){if(this.chips){if(typeof this.chips==="string"){try{this.internalChips=JSON.parse(this.chips)}catch(i){this.internalChips=[]}}else{this.internalChips=this.chips}}else{this.internalChips=[]}};i.prototype.internalValueChanged=function(){this.bdsChangeChips.emit({data:this.internalChips,value:this.getLastChip()})};i.prototype.isValid=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this.validateChips()]}))}))};i.prototype.get=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this.internalChips]}))}))};i.prototype.clear=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.internalChips=[];this.value="";return[2]}))}))};i.prototype.add=function(i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.setChip(i);return[2]}))}))};i.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.nativeInput.focus();return[2]}))}))};i.prototype.removeFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.nativeInput.blur();return[2]}))}))};i.prototype.componentWillLoad=function(){this.valueChanged()};i.prototype.validateChips=function(){var i=this;if(this.type==="email"){return!this.internalChips.some((function(t){return!i.validateChip(t)}))}else{return true}};i.prototype.handleOnBlur=function(){this.bdsBlur.emit(this.internalChips);this.isPressed=false};i.prototype.getLastChip=function(){return this.internalChips[this.internalChips.length-1]};i.prototype.handleDelimiters=function(){var i=this;var t=this.nativeInput.value;this.value=t?t.trim():"";if(t.length===0)return;var e=t.match(this.delimiters);if(!e)return;var n=this.verifyAndSubstituteDelimiters(t);if(!n){this.clearInputValues();return}var s=n.split(this.delimiters);s.forEach((function(t){i.setChip(t)}));this.clearInputValues()};i.prototype.verifyAndSubstituteDelimiters=function(i){if(i.length===1&&i[0].match(this.delimiters)){return""}var t=i.replace(/;/g,",").replace(/\,+|;+/g,",");if(t[0].match(this.delimiters)){t=t.substring(1)}return t};i.prototype.handleChange=function(i){return __awaiter(this,void 0,void 0,(function(){var t,e,n,s;var r=this;return __generator(this,(function(p){t=i.detail.value;this.value=t?t.trim():"";if(t.length===0)return[2];e=t.match(this.delimiters);if(!e)return[2];n=this.verifyAndSubstituteDelimiters(t);if(!n){this.clearInputValues();return[2]}s=n.split(this.delimiters);s.forEach((function(i){r.setChip(i)}));this.clearInputValues();return[2]}))}))};i.prototype.clearInputValues=function(i){if(i===void 0){i=""}this.nativeInput.value=i;this.value=i};i.prototype.setChip=function(i){if(!this.duplicated){var t=this.internalChips.some((function(t){return t.toLowerCase()===i.toLowerCase()}));if(t)return}if(!r(i)){return}this.internalChips=__spreadArray(__spreadArray([],this.internalChips,true),[i],false)};i.prototype.validateChip=function(i){var t=i.trim();if(this.type==="email"&&p(t)){return false}return true};i.prototype.removeLastChip=function(){this.internalChips=this.internalChips.slice(0,this.internalChips.length-1)};i.prototype.removeChip=function(i){var t=i.detail.id;this.internalChips=this.internalChips.filter((function(i,e){return e.toString()!==t}))};i.prototype.renderChips=function(){var i=this;if(!this.internalChips.length){return[]}return this.internalChips.map((function(t,e){var s=e.toString();return n("bds-chip-clickable",{id:s,key:s,color:"default",close:!i.disabled,onChipClickableClose:function(t){return i.removeChip(t)}},t)}))};i.prototype.renderIcon=function(){return this.icon&&n("div",{class:{input__icon:true,"input__icon--large":!!this.label}},n("bds-icon",{size:this.label?"medium":"small",name:this.icon,color:"inherit"}))};i.prototype.renderLabel=function(){return this.label&&n("label",{class:{input__container__label:true,"input__container__label--pressed":this.isPressed&&!this.disabled}},n("bds-typo",{variant:"fs-12",bold:"bold"},this.label))};i.prototype.renderMessage=function(){var i=this.danger?"error":"info";var t=this.danger?this.errorMessage:this.helperMessage;if(!t&&this.validationDanger)t=this.validationMesage;var e=this.danger||this.validationDanger?"input__message input__message--danger":"input__message";if(t){return n("div",{class:e,part:"input__message"},n("div",{class:"input__message__icon"},n("bds-icon",{size:"x-small",name:i,theme:"solid",color:"inherit"})),n("bds-typo",{variant:"fs-12"},t))}return undefined};i.prototype.render=function(){var i=this;var t=this.isPressed&&!this.disabled;return n(s,null,n("div",{class:{element_input:true},"aria-disabled":this.disabled?"true":null},n("div",{class:{input:true,"input--state-primary":!this.danger&&!this.validationDanger,"input--state-danger":this.danger||this.validationDanger,"input--state-disabled":this.disabled,"input--label":!!this.label,"input--pressed":t},onClick:this.onClickWrapper,onKeyDown:this.keyPressWrapper,part:"input-container"},this.renderIcon(),n("div",{class:"input__container"},this.renderLabel(),n("div",{class:{input__container__wrapper:true}},this.internalChips.length>0&&n("span",{class:"inside-input-left"},this.renderChips()),n("input",{ref:function(t){return i.nativeInput=t},class:{input__container__text:true},name:this.inputName,maxlength:this.maxlength,placeholder:this.placeholder,onInput:this.onInput,onFocus:this.onFocus,onBlur:function(){return i.handleOnBlur()},onChange:function(){return i.handleChange},value:this.value,disabled:this.disabled,"data-test":this.dataTest}))),n("slot",{name:"input-right"})),this.renderMessage()))};Object.defineProperty(i,"watchers",{get:function(){return{chips:["valueChanged"],internalChips:["internalValueChanged"]}},enumerable:false,configurable:true});return i}());o.style=a}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-5ce34965.system.js"],(function(e,t){"use strict";var a,s,n,i,r,o;return{setters:[function(e){a=e.p;s=e.w;n=e.d;i=e.N;r=e.a;o=e.b}],execute:function(){var e=function(e){return"__sc_import_".concat(e.replace(/\s|-/g,"_"))};var d=function(){{a.$cssShim$=s.__cssshim}var e=Array.from(n.querySelectorAll("script")).find((function(e){return new RegExp("/".concat(i,"(\\.esm)?\\.js($|\\?|#)")).test(e.src)||e.getAttribute("data-stencil-namespace")===i}));var o=e["data-opts"]||{};if("onbeforeload"in e&&!history.scrollRestoration){return{then:function(){}}}{o.resourcesUrl=new URL(".",new URL(e.getAttribute("data-resources-url")||e.src,s.location.href)).href;{l(o.resourcesUrl,e)}if(!s.customElements){return t.import("./p-233debd0.system.js").then((function(){return o}))}}return r(o)};var l=function(t,a){var r=e(i);try{s[r]=new Function("w","return import(w);//".concat(Math.random()))}catch(d){var o=new Map;s[r]=function(e){var i=new URL(e,t).href;var d=o.get(i);if(!d){var l=n.createElement("script");l.type="module";l.crossOrigin=a.crossOrigin;l.src=URL.createObjectURL(new Blob(["import * as m from '".concat(i,"'; window.").concat(r,".m = m;")],{type:"application/javascript"}));d=new Promise((function(e){l.onload=function(){e(s[r].m);l.remove()}}));o.set(i,d);n.head.appendChild(l)}return d}}};d().then((function(e){return o(JSON.parse('[["p-fb96eb3f.system",[[1,"bds-icon",{"color":[1],"ariaLabel":[1537,"aria-label"],"flipRtl":[4,"flip-rtl"],"name":[1],"src":[1],"icon":[8],"size":[1],"lazy":[4],"theme":[513],"type":[1],"dataTest":[1,"data-test"],"svgContent":[32],"isVisible":[32]}],[1,"bds-typo",{"variant":[1],"lineHeight":[1,"line-height"],"bold":[1],"italic":[4],"noWrap":[4,"no-wrap"],"paragraph":[4],"margin":[4],"tag":[1],"dataTest":[1,"data-test"]}]]],["p-31402363.system",[[0,"bds-datepicker",{"typeOfDate":[1,"type-of-date"],"startDateLimit":[1537,"start-date-limit"],"endDateLimit":[1537,"end-date-limit"],"message":[1],"language":[1],"disabled":[1540],"valueDateSelected":[1537,"value-date-selected"],"valueEndDateSelected":[1537,"value-end-date-selected"],"open":[32],"stateSelect":[32],"dateSelected":[32],"endDateSelected":[32],"errorMsgDate":[32],"errorMsgEndDate":[32],"intoView":[32],"scrollingTop":[32],"menupositionTop":[32],"menupositionLeft":[32]}]]],["p-c37a8bdd.system",[[1,"bds-toast",{"icon":[513],"actionType":[1,"action-type"],"variant":[1],"toastTitle":[1,"toast-title"],"toastText":[1,"toast-text"],"buttonText":[1,"button-text"],"duration":[2],"buttonAction":[1,"button-action"],"show":[4],"hide":[4],"position":[1],"create":[64],"close":[64]}]]],["p-37a53188.system",[[6,"bds-select-chips",{"options":[1025],"chips":[1025],"newPrefix":[513,"new-prefix"],"value":[1025],"danger":[1540],"maxlength":[2],"errorMessage":[1025,"error-message"],"disabled":[516],"label":[1],"icon":[513],"duplicated":[4],"canAddNew":[4,"can-add-new"],"notFoundMessage":[1,"not-found-message"],"type":[1],"delimiters":[16],"disableSubmit":[4,"disable-submit"],"helperMessage":[1,"helper-message"],"inputName":[1,"input-name"],"placeholder":[1],"dataTest":[1,"data-test"],"internalOptions":[32],"isOpen":[32],"validationDanger":[32],"isPressed":[32],"validationMesage":[32],"internalChips":[32],"isValid":[64],"getChips":[64],"clear":[64],"add":[64],"setFocus":[64],"removeFocus":[64]},[[9,"mousedown","handleWindow"]]]]],["p-316a2e16.system",[[6,"bds-input-chips",{"chips":[1025],"type":[1],"label":[1],"maxlength":[2],"icon":[513],"delimiters":[16],"errorMessage":[1025,"error-message"],"danger":[1540],"value":[1537],"duplicated":[4],"disableSubmit":[4,"disable-submit"],"disabled":[516],"helperMessage":[1,"helper-message"],"inputName":[1,"input-name"],"placeholder":[1],"dataTest":[1,"data-test"],"validationDanger":[32],"isPressed":[32],"validationMesage":[32],"internalChips":[32],"isValid":[64],"get":[64],"clear":[64],"add":[64],"setFocus":[64],"removeFocus":[64]}]]],["p-dadf7231.system",[[1,"bds-pagination",{"pages":[2],"startedPage":[2,"started-page"],"value":[32],"openSelect":[32],"paginationNumbers":[32]}]]],["p-91177850.system",[[1,"bds-upload",{"language":[1],"titleName":[1,"title-name"],"subtitle":[1],"error":[1],"multiple":[4],"accept":[1],"files":[32],"haveFiles":[32],"hover":[32],"background":[32],"size":[32]}]]],["p-2bda6747.system",[[1,"bds-accordion-header",{"accordionTitle":[1,"accordion-title"],"icon":[1],"avatarName":[1,"avatar-name"],"avatarThumb":[1,"avatar-thumb"],"isOpen":[32],"btToggleIsfocus":[32],"numberElement":[32],"toggle":[64],"close":[64]}]]],["p-818978e5.system",[[1,"bds-autocomplete",{"options":[1],"value":[1025],"selected":[1040],"danger":[516],"disabled":[516],"searchOnlyTitle":[516,"search-only-title"],"label":[1],"icon":[513],"placeholder":[1],"optionsPosition":[1,"options-position"],"clearIconOnFocus":[4,"clear-icon-on-focus"],"dataTest":[1,"data-test"],"isPressed":[32],"isOpen":[32],"text":[32],"internalOptions":[32],"isFocused":[32]},[[9,"mousedown","handleWindow"]]]]],["p-55c0ef0e.system",[[4,"bds-avatar-group",{"size":[1],"users":[1],"canClick":[4,"can-click"],"internalUsers":[32],"leftoversUsers":[32]}]]],["p-0538ba6c.system",[[6,"bds-input-phone-number",{"options":[16],"text":[1],"value":[1025],"danger":[1540],"disabled":[516],"required":[4],"helperMessage":[1,"helper-message"],"errorMessage":[1025,"error-message"],"requiredErrorMessage":[1,"required-error-message"],"numberErrorMessage":[1,"number-error-message"],"dataTest":[1,"data-test"],"label":[1],"icon":[513],"isOpen":[32],"selectedCountry":[32],"isPressed":[32],"validationDanger":[32],"validationMesage":[32],"removeFocus":[64]},[[9,"mousedown","handleWindow"]]]]],["p-b1a681eb.system",[[1,"bds-menu-exibition",{"avatarName":[1,"avatar-name"],"avatarThumbnail":[1,"avatar-thumbnail"],"avatarSize":[1,"avatar-size"],"value":[1],"subtitle":[1]}]]],["p-67e09509.system",[[1,"bds-select",{"options":[1],"value":[1032],"danger":[516],"disabled":[516],"label":[1],"icon":[513],"placeholder":[1],"helperMessage":[1,"helper-message"],"errorMessage":[1,"error-message"],"optionsPosition":[1,"options-position"],"dataTest":[1,"data-test"],"isOpen":[32],"text":[32],"validationDanger":[32],"isPressed":[32],"validationMesage":[32],"internalOptions":[32]},[[9,"mousedown","handleWindow"]]]]],["p-a9127707.system",[[1,"bds-table",{"options":[1],"column":[1],"avatar":[4],"sorting":[4],"headerData":[32],"tableData":[32],"sortAscending":[32],"headerActive":[32]}]]],["p-7fe22fc8.system",[[1,"bds-alert-header",{"variant":[1],"icon":[513]}]]],["p-23d40342.system",[[1,"bds-checkbox",{"refer":[1],"label":[1],"name":[1],"checked":[1540],"disabled":[4],"dataTest":[1,"data-test"],"checkBoxId":[32],"getInputElement":[64],"getValue":[64]}]]],["p-41d4aa43.system",[[1,"bds-chip-selected",{"icon":[1],"color":[1],"size":[1],"selected":[4],"disabled":[4],"dataTest":[1,"data-test"],"isSelected":[32]},[[2,"click","handleClick"]]]]],["p-1e3f5748.system",[[1,"bds-chip-tag",{"icon":[1],"color":[1]}]]],["p-fbef02b9.system",[[1,"bds-input-editable",{"size":[1],"expand":[4],"dataTest":[1,"data-test"],"inputName":[1,"input-name"],"value":[1537],"requiredErrorMessage":[1,"required-error-message"],"minlength":[2],"minlengthErrorMessage":[1,"minlength-error-message"],"maxlength":[2],"errorMessage":[1,"error-message"],"helperMessage":[1,"helper-message"],"placeholder":[1],"danger":[1540],"oldValue":[32],"isEditing":[32],"isValid":[32],"isPressed":[32],"isFocused":[32],"validationMesage":[32],"validationDanger":[32]}]]],["p-ea7dd4db.system",[[2,"bds-input-password",{"openEyes":[4,"open-eyes"],"value":[1537],"label":[1],"inputName":[1,"input-name"],"max":[1],"maxlength":[2],"min":[1],"minlength":[2],"readonly":[4],"helperMessage":[1,"helper-message"],"errorMessage":[1,"error-message"],"danger":[516],"icon":[513],"disabled":[4],"autoCapitalize":[1,"auto-capitalize"],"autoComplete":[1,"auto-complete"],"placeholder":[1],"dataTest":[1,"data-test"],"validationDanger":[32],"isPressed":[32],"validationMesage":[32]}]]],["p-6b64dc93.system",[[1,"bds-menu-action",{"buttonText":[1,"button-text"],"subMenu":[4,"sub-menu"],"iconLeft":[1,"icon-left"],"lipstick":[4],"openSubMenu":[32],"stateSubMenu":[32],"delaySubMenu":[32],"zIndex":[32],"delay":[32]}]]],["p-6df0b44f.system",[[1,"bds-menu-list-item",{"color":[1],"icon":[513]}]]],["p-581c22f9.system",[[1,"bds-sidebar",{"isOpen":[1540,"is-open"],"sidebarPosition":[1,"sidebar-position"],"InnerSpacing":[32],"toggle":[64]}]]],["p-ed29f5b2.system",[[1,"bds-step",{"last":[4],"completed":[4],"active":[4],"disabled":[4],"index":[2],"pointer":[4]}]]],["p-b9cc2863.system",[[4,"bds-tabs",{"align":[1]},[[0,"scrollButtonClick","onScrollButtonClick"],[16,"bdsTabChange","onSelectedTab"]]]]],["p-2f30968d.system",[[1,"bds-warning"]]],["p-3419c616.system",[[1,"bds-alert-body"]]],["p-602cb304.system",[[1,"bds-card-color",{"name":[1],"hex":[1],"gradient":[4],"variable":[1],"lightText":[4,"light-text"]}]]],["p-5c379cc7.system",[[1,"bds-chip",{"icon":[1],"size":[1],"variant":[1],"danger":[516],"filter":[4],"clickable":[4],"deletable":[4],"disabled":[4]}]]],["p-ba7ef632.system",[[1,"bds-expansion-panel-header",{"text":[1]}]]],["p-6b78b378.system",[[1,"bds-menu-separation",{"value":[1],"size":[1]}]]],["p-6611754a.system",[[1,"bds-modal",{"open":[1540],"closeButton":[1540,"close-button"],"size":[1537],"toggle":[64]}]]],["p-97f5d1a2.system",[[1,"bds-modal-close-button",{"active":[1540]}]]],["p-5b4bef06.system",[[1,"bds-progress-bar",{"percent":[2],"size":[1],"color":[1],"text":[1]}]]],["p-3bf0b766.system",[[1,"bds-radio",{"refer":[1],"label":[1],"value":[1],"name":[1],"checked":[1540],"disabled":[4],"dataTest":[1,"data-test"],"radioId":[32],"getInputElement":[64],"getValue":[64]}]]],["p-a7339fd1.system",[[0,"bds-tab",{"group":[1],"label":[1],"active":[4],"isActive":[32]},[[16,"bdsTabChange","handleTabChange"],[16,"bdsTabInit","handleTabChange"]]]]],["p-b14369bf.system",[[4,"bds-tab-panel",{"group":[1],"isActive":[32]},[[16,"bdsTabChange","handleTabChange"],[16,"bdsTabInit","handleTabChange"]]]]],["p-30789210.system",[[1,"bds-tooltip",{"tooltipText":[1,"tooltip-text"],"disabled":[516],"position":[1],"dataTest":[1,"data-test"],"isMouseOver":[32]}]]],["p-e2faaa12.system",[[1,"bds-accordion",{"isOpen":[32],"numberElement":[32],"toggle":[64],"close":[64],"reciveNumber":[64]}]]],["p-d2d7880b.system",[[1,"bds-accordion-body",{"isOpen":[32],"heightContainer":[32],"numberElement":[32],"toggle":[64],"close":[64]}]]],["p-85a908cd.system",[[1,"bds-accordion-group",{"collapse":[1],"closeAll":[64]}]]],["p-313c18fb.system",[[1,"bds-alert",{"open":[1540],"dataTest":[1,"data-test"],"toggle":[64]}]]],["p-50bf866a.system",[[1,"bds-alert-actions"]]],["p-1cc9e1f1.system",[[1,"bds-banner-link",{"link":[1]}]]],["p-1cffbd3d.system",[[1,"bds-expansion-panel"]]],["p-30a106bf.system",[[1,"bds-expansion-panel-body",{"open":[4],"text":[1]}]]],["p-dc44375d.system",[[6,"bds-grid",{"direction":[1],"justifyContent":[1,"justify-content"],"flexWrap":[1,"flex-wrap"],"alignItems":[1,"align-items"],"container":[4],"xxs":[1],"xs":[1],"sm":[1],"md":[1],"lg":[1],"xg":[1],"xxsOffset":[1,"xxs-offset"],"xsOffset":[1,"xs-offset"],"smOffset":[1,"sm-offset"],"mdOffset":[1,"md-offset"],"lgOffset":[1,"lg-offset"],"xgOffset":[1,"xg-offset"],"gap":[1],"padding":[1],"margin":[1]}]]],["p-eb7ccfe0.system",[[1,"bds-illustration",{"type":[1],"name":[1],"dataTest":[1,"data-test"],"IllustrationContent":[32]}]]],["p-63eaa64d.system",[[1,"bds-loading-bar",{"percent":[2],"size":[1],"text":[1],"dataTest":[1,"data-test"]}]]],["p-a02213dd.system",[[1,"bds-loading-page",{"dataTest":[1,"data-test"],"svgContent":[32]}]]],["p-0697d74b.system",[[1,"bds-menu",{"menu":[1],"position":[1],"open":[1540],"refElement":[32],"intoView":[32],"menupositionTop":[32],"menupositionLeft":[32],"toggle":[64]}]]],["p-657ee3c4.system",[[1,"bds-menu-list"]]],["p-803f1d62.system",[[1,"bds-modal-action"]]],["p-aa9e3a94.system",[[6,"bds-radio-group",{"value":[1537]}]]],["p-666ad8c5.system",[[4,"bds-stepper",{"setActiveStep":[64],"setCompletedStep":[64],"getActiveStep":[64],"resetActiveSteps":[64],"resetCompletedSteps":[64]}]]],["p-e6b75084.system",[[1,"bds-switch",{"refer":[1],"size":[1],"name":[1],"checked":[1540],"disabled":[4],"dataTest":[1,"data-test"],"switchId":[32],"getInputElement":[64],"getValue":[64]}]]],["p-c9d2e2f6.system",[[1,"bds-button-icon",{"disabled":[4],"size":[1],"variant":[1],"icon":[513],"dataTest":[1,"data-test"]}]]],["p-e62e0224.system",[[1,"bds-banner",{"bannerAlign":[1,"banner-align"],"buttonClose":[1,"button-close"],"context":[1],"variant":[1],"visible":[32],"toggle":[64]}]]],["p-d6d9184d.system",[[1,"bds-paper",{"elevation":[1],"dataTest":[1,"data-test"]}]]],["p-4b4ea065.system",[[6,"bds-toast-container"]]],["p-4f1dc181.system",[[1,"bds-chip-clickable",{"icon":[1],"avatar":[1],"color":[1],"size":[1],"clickable":[4],"close":[4],"disabled":[4],"dataTest":[1,"data-test"],"visible":[32]}]]],["p-36c645eb.system",[[0,"bds-counter-text",{"length":[1026],"max":[2],"active":[1028],"warning":[1040],"delete":[1040]}]]],["p-aab249f1.system",[[1,"bds-datepicker-period",{"startDate":[16],"endDate":[16],"startDateSelect":[1040],"endDateSelect":[1040],"language":[1],"stateSelect":[1537,"state-select"],"week":[32],"months":[32],"years":[32],"monthActivated":[32],"yearActivated":[32],"animatePrev":[32],"animateNext":[32],"activeSelectYear":[32],"openSelectMonth":[32],"openSelectYear":[32],"monthsSlide":[32],"loadingSlide":[32],"clear":[64]}],[1,"bds-datepicker-single",{"endDate":[16],"startDate":[16],"dateSelect":[1040],"language":[1],"week":[32],"months":[32],"years":[32],"monthActivated":[32],"yearActivated":[32],"animatePrev":[32],"animateNext":[32],"openSelectMonth":[32],"openSelectYear":[32],"monthsSlide":[32],"loadingSlide":[32],"clear":[64]}],[1,"bds-input",{"inputName":[1,"input-name"],"type":[513],"label":[1],"placeholder":[1],"autoCapitalize":[1,"auto-capitalize"],"autoComplete":[1,"auto-complete"],"max":[1],"maxlength":[2],"min":[1],"minlength":[2],"readonly":[4],"required":[4],"pattern":[1],"helperMessage":[1,"helper-message"],"errorMessage":[1025,"error-message"],"icon":[513],"disabled":[1540],"danger":[1540],"value":[1025],"counterLength":[4,"counter-length"],"counterLengthRule":[16],"isSubmit":[4,"is-submit"],"isTextarea":[4,"is-textarea"],"rows":[2],"cols":[2],"requiredErrorMessage":[1,"required-error-message"],"minlengthErrorMessage":[1,"minlength-error-message"],"minErrorMessage":[1,"min-error-message"],"maxErrorMessage":[1,"max-error-message"],"emailErrorMessage":[1,"email-error-message"],"numberErrorMessage":[1,"number-error-message"],"chips":[4],"dataTest":[1,"data-test"],"isPressed":[32],"isPassword":[32],"validationMesage":[32],"validationDanger":[32],"setFocus":[64],"removeFocus":[64],"getInputElement":[64],"isValid":[64],"clear":[64]}]]],["p-6d0be323.system",[[1,"bds-button",{"disabled":[4],"size":[1],"variant":[1],"icon":[513],"arrow":[4],"type":[1],"typeIcon":[513,"type-icon"],"bdsLoading":[4,"bds-loading"],"bdsLoadingVariant":[1,"bds-loading-variant"],"bdsLoadingColor":[1,"bds-loading-color"],"dataTest":[1,"data-test"]}],[1,"bds-loading-spinner",{"variant":[1],"size":[1],"color":[1],"dataTest":[1,"data-test"],"svgContent":[32]}]]],["p-93c327e3.system",[[1,"bds-avatar",{"name":[1],"thumbnail":[1],"size":[1],"upload":[4],"ellipsis":[2],"dataTest":[1,"data-test"]}]]],["p-b7e4c602.system",[[6,"bds-select-option",{"value":[8],"selected":[4],"disabled":[4],"invisible":[1540],"danger":[1540],"bulkOption":[1,"bulk-option"],"slotAlign":[1,"slot-align"],"titleText":[1,"title-text"],"status":[1],"dataTest":[1,"data-test"]}]]]]'),e)}))}}}));
|
|
1
|
+
System.register(["./p-5ce34965.system.js"],(function(e,t){"use strict";var a,s,n,i,r,o;return{setters:[function(e){a=e.p;s=e.w;n=e.d;i=e.N;r=e.a;o=e.b}],execute:function(){var e=function(e){return"__sc_import_".concat(e.replace(/\s|-/g,"_"))};var d=function(){{a.$cssShim$=s.__cssshim}var e=Array.from(n.querySelectorAll("script")).find((function(e){return new RegExp("/".concat(i,"(\\.esm)?\\.js($|\\?|#)")).test(e.src)||e.getAttribute("data-stencil-namespace")===i}));var o=e["data-opts"]||{};if("onbeforeload"in e&&!history.scrollRestoration){return{then:function(){}}}{o.resourcesUrl=new URL(".",new URL(e.getAttribute("data-resources-url")||e.src,s.location.href)).href;{l(o.resourcesUrl,e)}if(!s.customElements){return t.import("./p-233debd0.system.js").then((function(){return o}))}}return r(o)};var l=function(t,a){var r=e(i);try{s[r]=new Function("w","return import(w);//".concat(Math.random()))}catch(d){var o=new Map;s[r]=function(e){var i=new URL(e,t).href;var d=o.get(i);if(!d){var l=n.createElement("script");l.type="module";l.crossOrigin=a.crossOrigin;l.src=URL.createObjectURL(new Blob(["import * as m from '".concat(i,"'; window.").concat(r,".m = m;")],{type:"application/javascript"}));d=new Promise((function(e){l.onload=function(){e(s[r].m);l.remove()}}));o.set(i,d);n.head.appendChild(l)}return d}}};d().then((function(e){return o(JSON.parse('[["p-fb96eb3f.system",[[1,"bds-icon",{"color":[1],"ariaLabel":[1537,"aria-label"],"flipRtl":[4,"flip-rtl"],"name":[1],"src":[1],"icon":[8],"size":[1],"lazy":[4],"theme":[513],"type":[1],"dataTest":[1,"data-test"],"svgContent":[32],"isVisible":[32]}],[1,"bds-typo",{"variant":[1],"lineHeight":[1,"line-height"],"bold":[1],"italic":[4],"noWrap":[4,"no-wrap"],"paragraph":[4],"margin":[4],"tag":[1],"dataTest":[1,"data-test"]}]]],["p-31402363.system",[[0,"bds-datepicker",{"typeOfDate":[1,"type-of-date"],"startDateLimit":[1537,"start-date-limit"],"endDateLimit":[1537,"end-date-limit"],"message":[1],"language":[1],"disabled":[1540],"valueDateSelected":[1537,"value-date-selected"],"valueEndDateSelected":[1537,"value-end-date-selected"],"open":[32],"stateSelect":[32],"dateSelected":[32],"endDateSelected":[32],"errorMsgDate":[32],"errorMsgEndDate":[32],"intoView":[32],"scrollingTop":[32],"menupositionTop":[32],"menupositionLeft":[32]}]]],["p-c37a8bdd.system",[[1,"bds-toast",{"icon":[513],"actionType":[1,"action-type"],"variant":[1],"toastTitle":[1,"toast-title"],"toastText":[1,"toast-text"],"buttonText":[1,"button-text"],"duration":[2],"buttonAction":[1,"button-action"],"show":[4],"hide":[4],"position":[1],"create":[64],"close":[64]}]]],["p-37a53188.system",[[6,"bds-select-chips",{"options":[1025],"chips":[1025],"newPrefix":[513,"new-prefix"],"value":[1025],"danger":[1540],"maxlength":[2],"errorMessage":[1025,"error-message"],"disabled":[516],"label":[1],"icon":[513],"duplicated":[4],"canAddNew":[4,"can-add-new"],"notFoundMessage":[1,"not-found-message"],"type":[1],"delimiters":[16],"disableSubmit":[4,"disable-submit"],"helperMessage":[1,"helper-message"],"inputName":[1,"input-name"],"placeholder":[1],"dataTest":[1,"data-test"],"internalOptions":[32],"isOpen":[32],"validationDanger":[32],"isPressed":[32],"validationMesage":[32],"internalChips":[32],"isValid":[64],"getChips":[64],"clear":[64],"add":[64],"setFocus":[64],"removeFocus":[64]},[[9,"mousedown","handleWindow"]]]]],["p-4d9c3a9e.system",[[6,"bds-input-chips",{"chips":[1025],"type":[1],"label":[1],"maxlength":[2],"icon":[513],"delimiters":[16],"errorMessage":[1025,"error-message"],"danger":[1540],"value":[1537],"duplicated":[4],"disableSubmit":[4,"disable-submit"],"disabled":[516],"helperMessage":[1,"helper-message"],"inputName":[1,"input-name"],"placeholder":[1],"dataTest":[1,"data-test"],"validationDanger":[32],"isPressed":[32],"validationMesage":[32],"internalChips":[32],"isValid":[64],"get":[64],"clear":[64],"add":[64],"setFocus":[64],"removeFocus":[64]}]]],["p-dadf7231.system",[[1,"bds-pagination",{"pages":[2],"startedPage":[2,"started-page"],"value":[32],"openSelect":[32],"paginationNumbers":[32]}]]],["p-91177850.system",[[1,"bds-upload",{"language":[1],"titleName":[1,"title-name"],"subtitle":[1],"error":[1],"multiple":[4],"accept":[1],"files":[32],"haveFiles":[32],"hover":[32],"background":[32],"size":[32]}]]],["p-2bda6747.system",[[1,"bds-accordion-header",{"accordionTitle":[1,"accordion-title"],"icon":[1],"avatarName":[1,"avatar-name"],"avatarThumb":[1,"avatar-thumb"],"isOpen":[32],"btToggleIsfocus":[32],"numberElement":[32],"toggle":[64],"close":[64]}]]],["p-818978e5.system",[[1,"bds-autocomplete",{"options":[1],"value":[1025],"selected":[1040],"danger":[516],"disabled":[516],"searchOnlyTitle":[516,"search-only-title"],"label":[1],"icon":[513],"placeholder":[1],"optionsPosition":[1,"options-position"],"clearIconOnFocus":[4,"clear-icon-on-focus"],"dataTest":[1,"data-test"],"isPressed":[32],"isOpen":[32],"text":[32],"internalOptions":[32],"isFocused":[32]},[[9,"mousedown","handleWindow"]]]]],["p-55c0ef0e.system",[[4,"bds-avatar-group",{"size":[1],"users":[1],"canClick":[4,"can-click"],"internalUsers":[32],"leftoversUsers":[32]}]]],["p-0538ba6c.system",[[6,"bds-input-phone-number",{"options":[16],"text":[1],"value":[1025],"danger":[1540],"disabled":[516],"required":[4],"helperMessage":[1,"helper-message"],"errorMessage":[1025,"error-message"],"requiredErrorMessage":[1,"required-error-message"],"numberErrorMessage":[1,"number-error-message"],"dataTest":[1,"data-test"],"label":[1],"icon":[513],"isOpen":[32],"selectedCountry":[32],"isPressed":[32],"validationDanger":[32],"validationMesage":[32],"removeFocus":[64]},[[9,"mousedown","handleWindow"]]]]],["p-b1a681eb.system",[[1,"bds-menu-exibition",{"avatarName":[1,"avatar-name"],"avatarThumbnail":[1,"avatar-thumbnail"],"avatarSize":[1,"avatar-size"],"value":[1],"subtitle":[1]}]]],["p-67e09509.system",[[1,"bds-select",{"options":[1],"value":[1032],"danger":[516],"disabled":[516],"label":[1],"icon":[513],"placeholder":[1],"helperMessage":[1,"helper-message"],"errorMessage":[1,"error-message"],"optionsPosition":[1,"options-position"],"dataTest":[1,"data-test"],"isOpen":[32],"text":[32],"validationDanger":[32],"isPressed":[32],"validationMesage":[32],"internalOptions":[32]},[[9,"mousedown","handleWindow"]]]]],["p-a9127707.system",[[1,"bds-table",{"options":[1],"column":[1],"avatar":[4],"sorting":[4],"headerData":[32],"tableData":[32],"sortAscending":[32],"headerActive":[32]}]]],["p-7fe22fc8.system",[[1,"bds-alert-header",{"variant":[1],"icon":[513]}]]],["p-23d40342.system",[[1,"bds-checkbox",{"refer":[1],"label":[1],"name":[1],"checked":[1540],"disabled":[4],"dataTest":[1,"data-test"],"checkBoxId":[32],"getInputElement":[64],"getValue":[64]}]]],["p-41d4aa43.system",[[1,"bds-chip-selected",{"icon":[1],"color":[1],"size":[1],"selected":[4],"disabled":[4],"dataTest":[1,"data-test"],"isSelected":[32]},[[2,"click","handleClick"]]]]],["p-1e3f5748.system",[[1,"bds-chip-tag",{"icon":[1],"color":[1]}]]],["p-fbef02b9.system",[[1,"bds-input-editable",{"size":[1],"expand":[4],"dataTest":[1,"data-test"],"inputName":[1,"input-name"],"value":[1537],"requiredErrorMessage":[1,"required-error-message"],"minlength":[2],"minlengthErrorMessage":[1,"minlength-error-message"],"maxlength":[2],"errorMessage":[1,"error-message"],"helperMessage":[1,"helper-message"],"placeholder":[1],"danger":[1540],"oldValue":[32],"isEditing":[32],"isValid":[32],"isPressed":[32],"isFocused":[32],"validationMesage":[32],"validationDanger":[32]}]]],["p-ea7dd4db.system",[[2,"bds-input-password",{"openEyes":[4,"open-eyes"],"value":[1537],"label":[1],"inputName":[1,"input-name"],"max":[1],"maxlength":[2],"min":[1],"minlength":[2],"readonly":[4],"helperMessage":[1,"helper-message"],"errorMessage":[1,"error-message"],"danger":[516],"icon":[513],"disabled":[4],"autoCapitalize":[1,"auto-capitalize"],"autoComplete":[1,"auto-complete"],"placeholder":[1],"dataTest":[1,"data-test"],"validationDanger":[32],"isPressed":[32],"validationMesage":[32]}]]],["p-6b64dc93.system",[[1,"bds-menu-action",{"buttonText":[1,"button-text"],"subMenu":[4,"sub-menu"],"iconLeft":[1,"icon-left"],"lipstick":[4],"openSubMenu":[32],"stateSubMenu":[32],"delaySubMenu":[32],"zIndex":[32],"delay":[32]}]]],["p-6df0b44f.system",[[1,"bds-menu-list-item",{"color":[1],"icon":[513]}]]],["p-581c22f9.system",[[1,"bds-sidebar",{"isOpen":[1540,"is-open"],"sidebarPosition":[1,"sidebar-position"],"InnerSpacing":[32],"toggle":[64]}]]],["p-ed29f5b2.system",[[1,"bds-step",{"last":[4],"completed":[4],"active":[4],"disabled":[4],"index":[2],"pointer":[4]}]]],["p-b9cc2863.system",[[4,"bds-tabs",{"align":[1]},[[0,"scrollButtonClick","onScrollButtonClick"],[16,"bdsTabChange","onSelectedTab"]]]]],["p-2f30968d.system",[[1,"bds-warning"]]],["p-3419c616.system",[[1,"bds-alert-body"]]],["p-602cb304.system",[[1,"bds-card-color",{"name":[1],"hex":[1],"gradient":[4],"variable":[1],"lightText":[4,"light-text"]}]]],["p-5c379cc7.system",[[1,"bds-chip",{"icon":[1],"size":[1],"variant":[1],"danger":[516],"filter":[4],"clickable":[4],"deletable":[4],"disabled":[4]}]]],["p-ba7ef632.system",[[1,"bds-expansion-panel-header",{"text":[1]}]]],["p-6b78b378.system",[[1,"bds-menu-separation",{"value":[1],"size":[1]}]]],["p-6611754a.system",[[1,"bds-modal",{"open":[1540],"closeButton":[1540,"close-button"],"size":[1537],"toggle":[64]}]]],["p-97f5d1a2.system",[[1,"bds-modal-close-button",{"active":[1540]}]]],["p-5b4bef06.system",[[1,"bds-progress-bar",{"percent":[2],"size":[1],"color":[1],"text":[1]}]]],["p-3bf0b766.system",[[1,"bds-radio",{"refer":[1],"label":[1],"value":[1],"name":[1],"checked":[1540],"disabled":[4],"dataTest":[1,"data-test"],"radioId":[32],"getInputElement":[64],"getValue":[64]}]]],["p-a7339fd1.system",[[0,"bds-tab",{"group":[1],"label":[1],"active":[4],"isActive":[32]},[[16,"bdsTabChange","handleTabChange"],[16,"bdsTabInit","handleTabChange"]]]]],["p-b14369bf.system",[[4,"bds-tab-panel",{"group":[1],"isActive":[32]},[[16,"bdsTabChange","handleTabChange"],[16,"bdsTabInit","handleTabChange"]]]]],["p-30789210.system",[[1,"bds-tooltip",{"tooltipText":[1,"tooltip-text"],"disabled":[516],"position":[1],"dataTest":[1,"data-test"],"isMouseOver":[32]}]]],["p-e2faaa12.system",[[1,"bds-accordion",{"isOpen":[32],"numberElement":[32],"toggle":[64],"close":[64],"reciveNumber":[64]}]]],["p-d2d7880b.system",[[1,"bds-accordion-body",{"isOpen":[32],"heightContainer":[32],"numberElement":[32],"toggle":[64],"close":[64]}]]],["p-85a908cd.system",[[1,"bds-accordion-group",{"collapse":[1],"closeAll":[64]}]]],["p-313c18fb.system",[[1,"bds-alert",{"open":[1540],"dataTest":[1,"data-test"],"toggle":[64]}]]],["p-50bf866a.system",[[1,"bds-alert-actions"]]],["p-1cc9e1f1.system",[[1,"bds-banner-link",{"link":[1]}]]],["p-1cffbd3d.system",[[1,"bds-expansion-panel"]]],["p-30a106bf.system",[[1,"bds-expansion-panel-body",{"open":[4],"text":[1]}]]],["p-dc44375d.system",[[6,"bds-grid",{"direction":[1],"justifyContent":[1,"justify-content"],"flexWrap":[1,"flex-wrap"],"alignItems":[1,"align-items"],"container":[4],"xxs":[1],"xs":[1],"sm":[1],"md":[1],"lg":[1],"xg":[1],"xxsOffset":[1,"xxs-offset"],"xsOffset":[1,"xs-offset"],"smOffset":[1,"sm-offset"],"mdOffset":[1,"md-offset"],"lgOffset":[1,"lg-offset"],"xgOffset":[1,"xg-offset"],"gap":[1],"padding":[1],"margin":[1]}]]],["p-eb7ccfe0.system",[[1,"bds-illustration",{"type":[1],"name":[1],"dataTest":[1,"data-test"],"IllustrationContent":[32]}]]],["p-63eaa64d.system",[[1,"bds-loading-bar",{"percent":[2],"size":[1],"text":[1],"dataTest":[1,"data-test"]}]]],["p-a02213dd.system",[[1,"bds-loading-page",{"dataTest":[1,"data-test"],"svgContent":[32]}]]],["p-0697d74b.system",[[1,"bds-menu",{"menu":[1],"position":[1],"open":[1540],"refElement":[32],"intoView":[32],"menupositionTop":[32],"menupositionLeft":[32],"toggle":[64]}]]],["p-657ee3c4.system",[[1,"bds-menu-list"]]],["p-803f1d62.system",[[1,"bds-modal-action"]]],["p-aa9e3a94.system",[[6,"bds-radio-group",{"value":[1537]}]]],["p-666ad8c5.system",[[4,"bds-stepper",{"setActiveStep":[64],"setCompletedStep":[64],"getActiveStep":[64],"resetActiveSteps":[64],"resetCompletedSteps":[64]}]]],["p-e6b75084.system",[[1,"bds-switch",{"refer":[1],"size":[1],"name":[1],"checked":[1540],"disabled":[4],"dataTest":[1,"data-test"],"switchId":[32],"getInputElement":[64],"getValue":[64]}]]],["p-c9d2e2f6.system",[[1,"bds-button-icon",{"disabled":[4],"size":[1],"variant":[1],"icon":[513],"dataTest":[1,"data-test"]}]]],["p-e62e0224.system",[[1,"bds-banner",{"bannerAlign":[1,"banner-align"],"buttonClose":[1,"button-close"],"context":[1],"variant":[1],"visible":[32],"toggle":[64]}]]],["p-d6d9184d.system",[[1,"bds-paper",{"elevation":[1],"dataTest":[1,"data-test"]}]]],["p-4b4ea065.system",[[6,"bds-toast-container"]]],["p-4f1dc181.system",[[1,"bds-chip-clickable",{"icon":[1],"avatar":[1],"color":[1],"size":[1],"clickable":[4],"close":[4],"disabled":[4],"dataTest":[1,"data-test"],"visible":[32]}]]],["p-36c645eb.system",[[0,"bds-counter-text",{"length":[1026],"max":[2],"active":[1028],"warning":[1040],"delete":[1040]}]]],["p-aab249f1.system",[[1,"bds-datepicker-period",{"startDate":[16],"endDate":[16],"startDateSelect":[1040],"endDateSelect":[1040],"language":[1],"stateSelect":[1537,"state-select"],"week":[32],"months":[32],"years":[32],"monthActivated":[32],"yearActivated":[32],"animatePrev":[32],"animateNext":[32],"activeSelectYear":[32],"openSelectMonth":[32],"openSelectYear":[32],"monthsSlide":[32],"loadingSlide":[32],"clear":[64]}],[1,"bds-datepicker-single",{"endDate":[16],"startDate":[16],"dateSelect":[1040],"language":[1],"week":[32],"months":[32],"years":[32],"monthActivated":[32],"yearActivated":[32],"animatePrev":[32],"animateNext":[32],"openSelectMonth":[32],"openSelectYear":[32],"monthsSlide":[32],"loadingSlide":[32],"clear":[64]}],[1,"bds-input",{"inputName":[1,"input-name"],"type":[513],"label":[1],"placeholder":[1],"autoCapitalize":[1,"auto-capitalize"],"autoComplete":[1,"auto-complete"],"max":[1],"maxlength":[2],"min":[1],"minlength":[2],"readonly":[4],"required":[4],"pattern":[1],"helperMessage":[1,"helper-message"],"errorMessage":[1025,"error-message"],"icon":[513],"disabled":[1540],"danger":[1540],"value":[1025],"counterLength":[4,"counter-length"],"counterLengthRule":[16],"isSubmit":[4,"is-submit"],"isTextarea":[4,"is-textarea"],"rows":[2],"cols":[2],"requiredErrorMessage":[1,"required-error-message"],"minlengthErrorMessage":[1,"minlength-error-message"],"minErrorMessage":[1,"min-error-message"],"maxErrorMessage":[1,"max-error-message"],"emailErrorMessage":[1,"email-error-message"],"numberErrorMessage":[1,"number-error-message"],"chips":[4],"dataTest":[1,"data-test"],"isPressed":[32],"isPassword":[32],"validationMesage":[32],"validationDanger":[32],"setFocus":[64],"removeFocus":[64],"getInputElement":[64],"isValid":[64],"clear":[64]}]]],["p-6d0be323.system",[[1,"bds-button",{"disabled":[4],"size":[1],"variant":[1],"icon":[513],"arrow":[4],"type":[1],"typeIcon":[513,"type-icon"],"bdsLoading":[4,"bds-loading"],"bdsLoadingVariant":[1,"bds-loading-variant"],"bdsLoadingColor":[1,"bds-loading-color"],"dataTest":[1,"data-test"]}],[1,"bds-loading-spinner",{"variant":[1],"size":[1],"color":[1],"dataTest":[1,"data-test"],"svgContent":[32]}]]],["p-93c327e3.system",[[1,"bds-avatar",{"name":[1],"thumbnail":[1],"size":[1],"upload":[4],"ellipsis":[2],"dataTest":[1,"data-test"]}]]],["p-b7e4c602.system",[[6,"bds-select-option",{"value":[8],"selected":[4],"disabled":[4],"invisible":[1540],"danger":[1540],"bulkOption":[1,"bulk-option"],"slotAlign":[1,"slot-align"],"titleText":[1,"title-text"],"status":[1],"dataTest":[1,"data-test"]}]]]]'),e)}))}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as s,h as t,H as e}from"./p-fc42d972.js";import{w as n,e as p}from"./p-7d00c003.js";const r=class{constructor(t){i(this,t),this.bdsChange=s(this,"bdsChange",7),this.bdsChangeChips=s(this,"bdsChangeChips",7),this.bdsInputChipsFocus=s(this,"bdsInputChipsFocus",7),this.bdsBlur=s(this,"bdsBlur",7),this.bdsInputChipsInput=s(this,"bdsInputChipsInput",7),this.bdsSubmit=s(this,"bdsSubmit",7),this.onClickWrapper=()=>{this.onFocus(),this.nativeInput&&this.nativeInput.focus()},this.onFocus=()=>{this.bdsInputChipsFocus.emit(),this.isPressed=!0},this.onInput=i=>{const s=i.target;s&&(this.value=s.value||""),this.bdsInputChipsInput.emit(i)},this.keyPressWrapper=i=>{switch(i.key){case"Enter":this.handleDelimiters(),this.setChip(this.value),this.value="";break;case"Backspace":(null===this.value||this.value.length<=0)&&this.internalChips.length&&(this.removeLastChip(),this.bdsChangeChips.emit({data:this.internalChips}))}},this.validationDanger=!1,this.isPressed=!1,this.validationMesage="",this.internalChips=[],this.chips=[],this.type="text",this.label="",this.maxlength=void 0,this.icon="",this.delimiters=/,|;/,this.errorMessage="",this.danger=!1,this.value="",this.duplicated=!1,this.disableSubmit=!1,this.disabled=!1,this.helperMessage="",this.inputName="",this.placeholder="",this.dataTest=null}valueChanged(){if(this.chips)if("string"==typeof this.chips)try{this.internalChips=JSON.parse(this.chips)}catch(i){this.internalChips=[]}else this.internalChips=this.chips;else this.internalChips=[]}internalValueChanged(){this.bdsChangeChips.emit({data:this.internalChips,value:this.getLastChip()})}async isValid(){return this.validateChips()}async get(){return this.internalChips}async clear(){this.internalChips=[],this.value=""}async add(i){this.setChip(i)}async setFocus(){this.nativeInput.focus()}async removeFocus(){this.nativeInput.blur()}componentWillLoad(){this.valueChanged()}validateChips(){return"email"!==this.type||!this.internalChips.some((i=>!this.validateChip(i)))}handleOnBlur(){this.bdsBlur.emit(this.internalChips),this.isPressed=!1}getLastChip(){return this.internalChips[this.internalChips.length-1]}handleDelimiters(){const i=this.nativeInput.value;if(this.value=i?i.trim():"",0===i.length)return;if(!i.match(this.delimiters))return;const s=this.verifyAndSubstituteDelimiters(i);s?(s.split(this.delimiters).forEach((i=>{this.setChip(i)})),this.clearInputValues()):this.clearInputValues()}verifyAndSubstituteDelimiters(i){if(1===i.length&&i[0].match(this.delimiters))return"";let s=i.replace(/;/g,",").replace(/\,+|;+/g,",");return s[0].match(this.delimiters)&&(s=s.substring(1)),s}async handleChange(i){const{detail:{value:s}}=i;if(this.value=s?s.trim():"",0===s.length)return;if(!s.match(this.delimiters))return;const t=this.verifyAndSubstituteDelimiters(s);t?(t.split(this.delimiters).forEach((i=>{this.setChip(i)})),this.clearInputValues()):this.clearInputValues()}clearInputValues(i=""){this.nativeInput.value=i,this.value=i}setChip(i){!this.duplicated&&this.internalChips.some((s=>s.toLowerCase()===i.toLowerCase()))||n(i)&&(this.internalChips=[...this.internalChips,i])}validateChip(i){const s=i.trim();return"email"!==this.type||!p(s)}removeLastChip(){this.internalChips=this.internalChips.slice(0,this.internalChips.length-1)}removeChip(i){const{detail:{id:s}}=i;this.internalChips=this.internalChips.filter(((i,t)=>t.toString()!==s))}renderChips(){return this.internalChips.length?this.internalChips.map(((i,s)=>{const e=s.toString();return t("bds-chip-clickable",{id:e,key:e,color:"default",close:!this.disabled,onChipClickableClose:i=>this.removeChip(i)},i)})):[]}renderIcon(){return this.icon&&t("div",{class:{input__icon:!0,"input__icon--large":!!this.label}},t("bds-icon",{size:this.label?"medium":"small",name:this.icon,color:"inherit"}))}renderLabel(){return this.label&&t("label",{class:{input__container__label:!0,"input__container__label--pressed":this.isPressed&&!this.disabled}},t("bds-typo",{variant:"fs-12",bold:"bold"},this.label))}renderMessage(){let i=this.danger?this.errorMessage:this.helperMessage;if(!i&&this.validationDanger&&(i=this.validationMesage),i)return t("div",{class:this.danger||this.validationDanger?"input__message input__message--danger":"input__message",part:"input__message"},t("div",{class:"input__message__icon"},t("bds-icon",{size:"x-small",name:this.danger?"error":"info",theme:"solid",color:"inherit"})),t("bds-typo",{variant:"fs-12"},i))}render(){return t(e,null,t("div",{class:{element_input:!0},"aria-disabled":this.disabled?"true":null},t("div",{class:{input:!0,"input--state-primary":!this.danger&&!this.validationDanger,"input--state-danger":this.danger||this.validationDanger,"input--state-disabled":this.disabled,"input--label":!!this.label,"input--pressed":this.isPressed&&!this.disabled},onClick:this.onClickWrapper,onKeyDown:this.keyPressWrapper,part:"input-container"},this.renderIcon(),t("div",{class:"input__container"},this.renderLabel(),t("div",{class:{input__container__wrapper:!0}},this.internalChips.length>0&&t("span",{class:"inside-input-left"},this.renderChips()),t("input",{ref:i=>this.nativeInput=i,class:{input__container__text:!0},name:this.inputName,maxlength:this.maxlength,placeholder:this.placeholder,onInput:this.onInput,onFocus:this.onFocus,onBlur:()=>this.handleOnBlur(),onChange:()=>this.handleChange,value:this.value,disabled:this.disabled,"data-test":this.dataTest}))),t("slot",{name:"input-right"})),this.renderMessage()))}static get watchers(){return{chips:["valueChanged"],internalChips:["internalValueChanged"]}}};r.style='.sc-bds-input-chips-h{display:display}.element_input.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%}.element_input.sc-bds-input-chips input.sc-bds-input-chips{-webkit-box-shadow:inherit;box-shadow:inherit}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-moz-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips:-ms-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-ms-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.input.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:8px 4px 9px 12px;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;background:#ffffff}.input--state-primary.sc-bds-input-chips{border:1px solid #d2dfe6;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.sc-bds-input-chips:hover{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.input--pressed.sc-bds-input-chips{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4);box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4)}.input--state-primary.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#3f7de8;background-color:#e8f2ff}.input--state-primary.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#8ca0b3}.input--state-primary.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#3f7de8}.input--state-primary.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#3f7de8;color:#202c44}.input--state-danger.sc-bds-input-chips{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.sc-bds-input-chips:hover{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.input--pressed.sc-bds-input-chips{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #ffa5a5;box-shadow:0 0 0 2px #ffa5a5}.input--state-danger.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#ff4c4c;background-color:#ffa5a5}.input--state-danger.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#8ca0b3}.input--state-danger.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#ff4c4c}.input--state-danger.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#ff4c4c;color:#202c44}.input--state-disabled.sc-bds-input-chips{cursor:not-allowed;border:1px solid #e7edf4;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;background:#f3f6fa}.input--state-disabled.sc-bds-input-chips:hover{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;border:1px solid #e7edf4;box-sizing:border-box;border-radius:8px}.input--state-disabled.input--pressed.sc-bds-input-chips{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #e7edf4;box-shadow:0 0 0 2px #e7edf4}.input--state-disabled.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#b9cbd3;background-color:#f8fbfb}.input--state-disabled.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#b9cbd3}.input--state-disabled.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#b9cbd3}.input--state-disabled.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#b9cbd3;color:#b9cbd3}.input--label.sc-bds-input-chips{padding:7px 4px 8px 12px}.input__icon.sc-bds-input-chips{cursor:inherit;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:8px;margin-right:8px;padding:2.5px}.input__icon--large.sc-bds-input-chips{padding:4px}.input__container.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;width:100%}.input__container__wrapper.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.input__container__wrapper__chips.sc-bds-input-chips{display:inline;max-height:100px;overflow:auto}.input__container__wrapper__chips.sc-bds-input-chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__wrapper__chips.sc-bds-input-chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__container__label.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input__container__text.sc-bds-input-chips{display:inline-block;margin:0;border:0;padding:0;width:auto;vertical-align:middle;white-space:normal;line-height:inherit;background:none;color:inherit;font-size:inherit;font-family:inherit;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;font-family:"Nunito Sans", "Tahoma", "Helvetica", "Arial", sans-serif;font-size:0.875rem;line-height:150%;resize:none;cursor:inherit}.input__container__text.sc-bds-input-chips:focus{outline:0}.input__container__text.sc-bds-input-chips::-webkit-file-upload-button{padding:0;border:0;background:none}.input__container__text.sc-bds-input-chips:focus{outline:0}.input__container__text[type=checkbox].sc-bds-input-chips,.input__container__text[type=radio].sc-bds-input-chips{width:13px;height:13px}.input__container__text[type=search].sc-bds-input-chips{-webkit-appearance:textfield;-webkit-box-sizing:content-box}.sc-bds-input-chips::-webkit-search-decoration{display:none}.input__container__text[type=reset].sc-bds-input-chips,.input__container__text[type=button].sc-bds-input-chips,.input__container__text[type=submit].sc-bds-input-chips{overflow:visible}.input__container__text.sc-bds-input-chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__text.sc-bds-input-chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__message.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;height:20px;margin:3.7px 2.5px;-webkit-transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);color:#8ca0b3;word-break:break-word;height:auto;min-height:20px}.input__message.sc-bds-input-chips bds-typo.sc-bds-input-chips{margin-top:0px;-ms-flex-item-align:self-start;align-self:self-start}.input__message__icon.sc-bds-input-chips{display:-ms-flexbox;display:flex;padding-right:4px;margin-top:0px;padding-top:2px}.input__message--danger.sc-bds-input-chips{color:#ff4c4c}.inside-input-left.sc-bds-input-chips{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:8px}.input-chips__chip.sc-bds-input-chips{margin:2px 4px 2px 0px}.input-chips__chips.sc-bds-input-chips{-ms-flex:1;flex:1}';export{r as bds_input_chips}
|
|
@@ -36,6 +36,7 @@ const InputChips = class {
|
|
|
36
36
|
this.keyPressWrapper = (event) => {
|
|
37
37
|
switch (event.key) {
|
|
38
38
|
case 'Enter':
|
|
39
|
+
this.handleDelimiters();
|
|
39
40
|
this.setChip(this.value);
|
|
40
41
|
this.value = '';
|
|
41
42
|
break;
|
|
@@ -138,6 +139,25 @@ const InputChips = class {
|
|
|
138
139
|
getLastChip() {
|
|
139
140
|
return this.internalChips[this.internalChips.length - 1];
|
|
140
141
|
}
|
|
142
|
+
handleDelimiters() {
|
|
143
|
+
const value = this.nativeInput.value;
|
|
144
|
+
this.value = value ? value.trim() : '';
|
|
145
|
+
if (value.length === 0)
|
|
146
|
+
return;
|
|
147
|
+
const existTerm = value.match(this.delimiters);
|
|
148
|
+
if (!existTerm)
|
|
149
|
+
return;
|
|
150
|
+
const newValue = this.verifyAndSubstituteDelimiters(value);
|
|
151
|
+
if (!newValue) {
|
|
152
|
+
this.clearInputValues();
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const words = newValue.split(this.delimiters);
|
|
156
|
+
words.forEach((word) => {
|
|
157
|
+
this.setChip(word);
|
|
158
|
+
});
|
|
159
|
+
this.clearInputValues();
|
|
160
|
+
}
|
|
141
161
|
verifyAndSubstituteDelimiters(value) {
|
|
142
162
|
if (value.length === 1 && value[0].match(this.delimiters)) {
|
|
143
163
|
return '';
|
|
@@ -22,6 +22,7 @@ export class InputChips {
|
|
|
22
22
|
this.keyPressWrapper = (event) => {
|
|
23
23
|
switch (event.key) {
|
|
24
24
|
case 'Enter':
|
|
25
|
+
this.handleDelimiters();
|
|
25
26
|
this.setChip(this.value);
|
|
26
27
|
this.value = '';
|
|
27
28
|
break;
|
|
@@ -124,6 +125,25 @@ export class InputChips {
|
|
|
124
125
|
getLastChip() {
|
|
125
126
|
return this.internalChips[this.internalChips.length - 1];
|
|
126
127
|
}
|
|
128
|
+
handleDelimiters() {
|
|
129
|
+
const value = this.nativeInput.value;
|
|
130
|
+
this.value = value ? value.trim() : '';
|
|
131
|
+
if (value.length === 0)
|
|
132
|
+
return;
|
|
133
|
+
const existTerm = value.match(this.delimiters);
|
|
134
|
+
if (!existTerm)
|
|
135
|
+
return;
|
|
136
|
+
const newValue = this.verifyAndSubstituteDelimiters(value);
|
|
137
|
+
if (!newValue) {
|
|
138
|
+
this.clearInputValues();
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const words = newValue.split(this.delimiters);
|
|
142
|
+
words.forEach((word) => {
|
|
143
|
+
this.setChip(word);
|
|
144
|
+
});
|
|
145
|
+
this.clearInputValues();
|
|
146
|
+
}
|
|
127
147
|
verifyAndSubstituteDelimiters(value) {
|
|
128
148
|
if (value.length === 1 && value[0].match(this.delimiters)) {
|
|
129
149
|
return '';
|
|
@@ -32,6 +32,7 @@ const InputChips = class {
|
|
|
32
32
|
this.keyPressWrapper = (event) => {
|
|
33
33
|
switch (event.key) {
|
|
34
34
|
case 'Enter':
|
|
35
|
+
this.handleDelimiters();
|
|
35
36
|
this.setChip(this.value);
|
|
36
37
|
this.value = '';
|
|
37
38
|
break;
|
|
@@ -134,6 +135,25 @@ const InputChips = class {
|
|
|
134
135
|
getLastChip() {
|
|
135
136
|
return this.internalChips[this.internalChips.length - 1];
|
|
136
137
|
}
|
|
138
|
+
handleDelimiters() {
|
|
139
|
+
const value = this.nativeInput.value;
|
|
140
|
+
this.value = value ? value.trim() : '';
|
|
141
|
+
if (value.length === 0)
|
|
142
|
+
return;
|
|
143
|
+
const existTerm = value.match(this.delimiters);
|
|
144
|
+
if (!existTerm)
|
|
145
|
+
return;
|
|
146
|
+
const newValue = this.verifyAndSubstituteDelimiters(value);
|
|
147
|
+
if (!newValue) {
|
|
148
|
+
this.clearInputValues();
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const words = newValue.split(this.delimiters);
|
|
152
|
+
words.forEach((word) => {
|
|
153
|
+
this.setChip(word);
|
|
154
|
+
});
|
|
155
|
+
this.clearInputValues();
|
|
156
|
+
}
|
|
137
157
|
verifyAndSubstituteDelimiters(value) {
|
|
138
158
|
if (value.length === 1 && value[0].match(this.delimiters)) {
|
|
139
159
|
return '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(i,t,e,n){function s(i){return i instanceof e?i:new e((function(t){t(i)}))}return new(e||(e=Promise))((function(e,r){function a(i){try{o(n.next(i))}catch(t){r(t)}}function p(i){try{o(n["throw"](i))}catch(t){r(t)}}function o(i){i.done?e(i.value):s(i.value).then(a,p)}o((n=n.apply(i,t||[])).next())}))};var __generator=this&&this.__generator||function(i,t){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,a;return a={next:p(0),throw:p(1),return:p(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function p(i){return function(t){return o([i,t])}}function o(a){if(n)throw new TypeError("Generator is already executing.");while(e)try{if(n=1,s&&(r=a[0]&2?s["return"]:a[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,a[1])).done)return r;if(s=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:e.label++;return{value:a[1],done:false};case 5:e.label++;s=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){e.label=a[1];break}if(a[0]===6&&e.label<r[1]){e.label=r[1];r=a;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(a);break}if(r[2])e.ops.pop();e.trys.pop();continue}a=t.call(i,e)}catch(p){a=[6,p];s=0}finally{n=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(i,t,e){if(e||arguments.length===2)for(var n=0,s=t.length,r;n<s;n++){if(r||!(n in t)){if(!r)r=Array.prototype.slice.call(t,0,n);r[n]=t[n]}}return i.concat(r||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-eb4d612c.js";import{w as whitespaceValidation,e as emailValidation}from"./validations-6d914b78.js";var inputChipsCss='.sc-bds-input-chips-h{display:display}.element_input.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%}.element_input.sc-bds-input-chips input.sc-bds-input-chips{-webkit-box-shadow:inherit;box-shadow:inherit}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-moz-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips:-ms-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-ms-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.input.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:8px 4px 9px 12px;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;background:#ffffff}.input--state-primary.sc-bds-input-chips{border:1px solid #d2dfe6;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.sc-bds-input-chips:hover{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.input--pressed.sc-bds-input-chips{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4);box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4)}.input--state-primary.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#3f7de8;background-color:#e8f2ff}.input--state-primary.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#8ca0b3}.input--state-primary.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#3f7de8}.input--state-primary.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#3f7de8;color:#202c44}.input--state-danger.sc-bds-input-chips{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.sc-bds-input-chips:hover{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.input--pressed.sc-bds-input-chips{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #ffa5a5;box-shadow:0 0 0 2px #ffa5a5}.input--state-danger.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#ff4c4c;background-color:#ffa5a5}.input--state-danger.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#8ca0b3}.input--state-danger.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#ff4c4c}.input--state-danger.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#ff4c4c;color:#202c44}.input--state-disabled.sc-bds-input-chips{cursor:not-allowed;border:1px solid #e7edf4;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;background:#f3f6fa}.input--state-disabled.sc-bds-input-chips:hover{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;border:1px solid #e7edf4;box-sizing:border-box;border-radius:8px}.input--state-disabled.input--pressed.sc-bds-input-chips{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #e7edf4;box-shadow:0 0 0 2px #e7edf4}.input--state-disabled.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#b9cbd3;background-color:#f8fbfb}.input--state-disabled.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#b9cbd3}.input--state-disabled.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#b9cbd3}.input--state-disabled.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#b9cbd3;color:#b9cbd3}.input--label.sc-bds-input-chips{padding:7px 4px 8px 12px}.input__icon.sc-bds-input-chips{cursor:inherit;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:8px;margin-right:8px;padding:2.5px}.input__icon--large.sc-bds-input-chips{padding:4px}.input__container.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;width:100%}.input__container__wrapper.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.input__container__wrapper__chips.sc-bds-input-chips{display:inline;max-height:100px;overflow:auto}.input__container__wrapper__chips.sc-bds-input-chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__wrapper__chips.sc-bds-input-chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__container__label.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input__container__text.sc-bds-input-chips{display:inline-block;margin:0;border:0;padding:0;width:auto;vertical-align:middle;white-space:normal;line-height:inherit;background:none;color:inherit;font-size:inherit;font-family:inherit;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;font-family:"Nunito Sans", "Tahoma", "Helvetica", "Arial", sans-serif;font-size:0.875rem;line-height:150%;resize:none;cursor:inherit}.input__container__text.sc-bds-input-chips:focus{outline:0}.input__container__text.sc-bds-input-chips::-webkit-file-upload-button{padding:0;border:0;background:none}.input__container__text.sc-bds-input-chips:focus{outline:0}.input__container__text[type=checkbox].sc-bds-input-chips,.input__container__text[type=radio].sc-bds-input-chips{width:13px;height:13px}.input__container__text[type=search].sc-bds-input-chips{-webkit-appearance:textfield;-webkit-box-sizing:content-box}.sc-bds-input-chips::-webkit-search-decoration{display:none}.input__container__text[type=reset].sc-bds-input-chips,.input__container__text[type=button].sc-bds-input-chips,.input__container__text[type=submit].sc-bds-input-chips{overflow:visible}.input__container__text.sc-bds-input-chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__text.sc-bds-input-chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__message.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;height:20px;margin:3.7px 2.5px;-webkit-transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);color:#8ca0b3;word-break:break-word;height:auto;min-height:20px}.input__message.sc-bds-input-chips bds-typo.sc-bds-input-chips{margin-top:0px;-ms-flex-item-align:self-start;align-self:self-start}.input__message__icon.sc-bds-input-chips{display:-ms-flexbox;display:flex;padding-right:4px;margin-top:0px;padding-top:2px}.input__message--danger.sc-bds-input-chips{color:#ff4c4c}.inside-input-left.sc-bds-input-chips{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:8px}.input-chips__chip.sc-bds-input-chips{margin:2px 4px 2px 0px}.input-chips__chips.sc-bds-input-chips{-ms-flex:1;flex:1}';var InputChips=function(){function i(i){var t=this;registerInstance(this,i);this.bdsChange=createEvent(this,"bdsChange",7);this.bdsChangeChips=createEvent(this,"bdsChangeChips",7);this.bdsInputChipsFocus=createEvent(this,"bdsInputChipsFocus",7);this.bdsBlur=createEvent(this,"bdsBlur",7);this.bdsInputChipsInput=createEvent(this,"bdsInputChipsInput",7);this.bdsSubmit=createEvent(this,"bdsSubmit",7);this.onClickWrapper=function(){t.onFocus();if(t.nativeInput){t.nativeInput.focus()}};this.onFocus=function(){t.bdsInputChipsFocus.emit();t.isPressed=true};this.onInput=function(i){var e=i.target;if(e){t.value=e.value||""}t.bdsInputChipsInput.emit(i)};this.keyPressWrapper=function(i){switch(i.key){case"Enter":t.setChip(t.value);t.value="";break;case"Backspace":if((t.value===null||t.value.length<=0)&&t.internalChips.length){t.removeLastChip();t.bdsChangeChips.emit({data:t.internalChips})}break}};this.validationDanger=false;this.isPressed=false;this.validationMesage="";this.internalChips=[];this.chips=[];this.type="text";this.label="";this.maxlength=undefined;this.icon="";this.delimiters=/,|;/;this.errorMessage="";this.danger=false;this.value="";this.duplicated=false;this.disableSubmit=false;this.disabled=false;this.helperMessage="";this.inputName="";this.placeholder="";this.dataTest=null}i.prototype.valueChanged=function(){if(this.chips){if(typeof this.chips==="string"){try{this.internalChips=JSON.parse(this.chips)}catch(i){this.internalChips=[]}}else{this.internalChips=this.chips}}else{this.internalChips=[]}};i.prototype.internalValueChanged=function(){this.bdsChangeChips.emit({data:this.internalChips,value:this.getLastChip()})};i.prototype.isValid=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this.validateChips()]}))}))};i.prototype.get=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this.internalChips]}))}))};i.prototype.clear=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.internalChips=[];this.value="";return[2]}))}))};i.prototype.add=function(i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.setChip(i);return[2]}))}))};i.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.nativeInput.focus();return[2]}))}))};i.prototype.removeFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.nativeInput.blur();return[2]}))}))};i.prototype.componentWillLoad=function(){this.valueChanged()};i.prototype.validateChips=function(){var i=this;if(this.type==="email"){return!this.internalChips.some((function(t){return!i.validateChip(t)}))}else{return true}};i.prototype.handleOnBlur=function(){this.bdsBlur.emit(this.internalChips);this.isPressed=false};i.prototype.getLastChip=function(){return this.internalChips[this.internalChips.length-1]};i.prototype.verifyAndSubstituteDelimiters=function(i){if(i.length===1&&i[0].match(this.delimiters)){return""}var t=i.replace(/;/g,",").replace(/\,+|;+/g,",");if(t[0].match(this.delimiters)){t=t.substring(1)}return t};i.prototype.handleChange=function(i){return __awaiter(this,void 0,void 0,(function(){var t,e,n,s;var r=this;return __generator(this,(function(a){t=i.detail.value;this.value=t?t.trim():"";if(t.length===0)return[2];e=t.match(this.delimiters);if(!e)return[2];n=this.verifyAndSubstituteDelimiters(t);if(!n){this.clearInputValues();return[2]}s=n.split(this.delimiters);s.forEach((function(i){r.setChip(i)}));this.clearInputValues();return[2]}))}))};i.prototype.clearInputValues=function(i){if(i===void 0){i=""}this.nativeInput.value=i;this.value=i};i.prototype.setChip=function(i){if(!this.duplicated){var t=this.internalChips.some((function(t){return t.toLowerCase()===i.toLowerCase()}));if(t)return}if(!whitespaceValidation(i)){return}this.internalChips=__spreadArray(__spreadArray([],this.internalChips,true),[i],false)};i.prototype.validateChip=function(i){var t=i.trim();if(this.type==="email"&&emailValidation(t)){return false}return true};i.prototype.removeLastChip=function(){this.internalChips=this.internalChips.slice(0,this.internalChips.length-1)};i.prototype.removeChip=function(i){var t=i.detail.id;this.internalChips=this.internalChips.filter((function(i,e){return e.toString()!==t}))};i.prototype.renderChips=function(){var i=this;if(!this.internalChips.length){return[]}return this.internalChips.map((function(t,e){var n=e.toString();return h("bds-chip-clickable",{id:n,key:n,color:"default",close:!i.disabled,onChipClickableClose:function(t){return i.removeChip(t)}},t)}))};i.prototype.renderIcon=function(){return this.icon&&h("div",{class:{input__icon:true,"input__icon--large":!!this.label}},h("bds-icon",{size:this.label?"medium":"small",name:this.icon,color:"inherit"}))};i.prototype.renderLabel=function(){return this.label&&h("label",{class:{input__container__label:true,"input__container__label--pressed":this.isPressed&&!this.disabled}},h("bds-typo",{variant:"fs-12",bold:"bold"},this.label))};i.prototype.renderMessage=function(){var i=this.danger?"error":"info";var t=this.danger?this.errorMessage:this.helperMessage;if(!t&&this.validationDanger)t=this.validationMesage;var e=this.danger||this.validationDanger?"input__message input__message--danger":"input__message";if(t){return h("div",{class:e,part:"input__message"},h("div",{class:"input__message__icon"},h("bds-icon",{size:"x-small",name:i,theme:"solid",color:"inherit"})),h("bds-typo",{variant:"fs-12"},t))}return undefined};i.prototype.render=function(){var i=this;var t=this.isPressed&&!this.disabled;return h(Host,null,h("div",{class:{element_input:true},"aria-disabled":this.disabled?"true":null},h("div",{class:{input:true,"input--state-primary":!this.danger&&!this.validationDanger,"input--state-danger":this.danger||this.validationDanger,"input--state-disabled":this.disabled,"input--label":!!this.label,"input--pressed":t},onClick:this.onClickWrapper,onKeyDown:this.keyPressWrapper,part:"input-container"},this.renderIcon(),h("div",{class:"input__container"},this.renderLabel(),h("div",{class:{input__container__wrapper:true}},this.internalChips.length>0&&h("span",{class:"inside-input-left"},this.renderChips()),h("input",{ref:function(t){return i.nativeInput=t},class:{input__container__text:true},name:this.inputName,maxlength:this.maxlength,placeholder:this.placeholder,onInput:this.onInput,onFocus:this.onFocus,onBlur:function(){return i.handleOnBlur()},onChange:function(){return i.handleChange},value:this.value,disabled:this.disabled,"data-test":this.dataTest}))),h("slot",{name:"input-right"})),this.renderMessage()))};Object.defineProperty(i,"watchers",{get:function(){return{chips:["valueChanged"],internalChips:["internalValueChanged"]}},enumerable:false,configurable:true});return i}();InputChips.style=inputChipsCss;export{InputChips as bds_input_chips};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(i,t,e,n){function s(i){return i instanceof e?i:new e((function(t){t(i)}))}return new(e||(e=Promise))((function(e,r){function a(i){try{o(n.next(i))}catch(t){r(t)}}function p(i){try{o(n["throw"](i))}catch(t){r(t)}}function o(i){i.done?e(i.value):s(i.value).then(a,p)}o((n=n.apply(i,t||[])).next())}))};var __generator=this&&this.__generator||function(i,t){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,a;return a={next:p(0),throw:p(1),return:p(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function p(i){return function(t){return o([i,t])}}function o(a){if(n)throw new TypeError("Generator is already executing.");while(e)try{if(n=1,s&&(r=a[0]&2?s["return"]:a[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,a[1])).done)return r;if(s=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:e.label++;return{value:a[1],done:false};case 5:e.label++;s=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){e.label=a[1];break}if(a[0]===6&&e.label<r[1]){e.label=r[1];r=a;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(a);break}if(r[2])e.ops.pop();e.trys.pop();continue}a=t.call(i,e)}catch(p){a=[6,p];s=0}finally{n=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(i,t,e){if(e||arguments.length===2)for(var n=0,s=t.length,r;n<s;n++){if(r||!(n in t)){if(!r)r=Array.prototype.slice.call(t,0,n);r[n]=t[n]}}return i.concat(r||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-eb4d612c.js";import{w as whitespaceValidation,e as emailValidation}from"./validations-6d914b78.js";var inputChipsCss='.sc-bds-input-chips-h{display:display}.element_input.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%}.element_input.sc-bds-input-chips input.sc-bds-input-chips{-webkit-box-shadow:inherit;box-shadow:inherit}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-moz-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips:-ms-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-ms-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.input.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:8px 4px 9px 12px;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;background:#ffffff}.input--state-primary.sc-bds-input-chips{border:1px solid #d2dfe6;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.sc-bds-input-chips:hover{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.input--pressed.sc-bds-input-chips{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4);box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4)}.input--state-primary.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#3f7de8;background-color:#e8f2ff}.input--state-primary.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#8ca0b3}.input--state-primary.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#3f7de8}.input--state-primary.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#3f7de8;color:#202c44}.input--state-danger.sc-bds-input-chips{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.sc-bds-input-chips:hover{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.input--pressed.sc-bds-input-chips{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #ffa5a5;box-shadow:0 0 0 2px #ffa5a5}.input--state-danger.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#ff4c4c;background-color:#ffa5a5}.input--state-danger.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#8ca0b3}.input--state-danger.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#ff4c4c}.input--state-danger.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#ff4c4c;color:#202c44}.input--state-disabled.sc-bds-input-chips{cursor:not-allowed;border:1px solid #e7edf4;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;background:#f3f6fa}.input--state-disabled.sc-bds-input-chips:hover{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;border:1px solid #e7edf4;box-sizing:border-box;border-radius:8px}.input--state-disabled.input--pressed.sc-bds-input-chips{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #e7edf4;box-shadow:0 0 0 2px #e7edf4}.input--state-disabled.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#b9cbd3;background-color:#f8fbfb}.input--state-disabled.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#b9cbd3}.input--state-disabled.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#b9cbd3}.input--state-disabled.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#b9cbd3;color:#b9cbd3}.input--label.sc-bds-input-chips{padding:7px 4px 8px 12px}.input__icon.sc-bds-input-chips{cursor:inherit;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:8px;margin-right:8px;padding:2.5px}.input__icon--large.sc-bds-input-chips{padding:4px}.input__container.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;width:100%}.input__container__wrapper.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.input__container__wrapper__chips.sc-bds-input-chips{display:inline;max-height:100px;overflow:auto}.input__container__wrapper__chips.sc-bds-input-chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__wrapper__chips.sc-bds-input-chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__container__label.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input__container__text.sc-bds-input-chips{display:inline-block;margin:0;border:0;padding:0;width:auto;vertical-align:middle;white-space:normal;line-height:inherit;background:none;color:inherit;font-size:inherit;font-family:inherit;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;font-family:"Nunito Sans", "Tahoma", "Helvetica", "Arial", sans-serif;font-size:0.875rem;line-height:150%;resize:none;cursor:inherit}.input__container__text.sc-bds-input-chips:focus{outline:0}.input__container__text.sc-bds-input-chips::-webkit-file-upload-button{padding:0;border:0;background:none}.input__container__text.sc-bds-input-chips:focus{outline:0}.input__container__text[type=checkbox].sc-bds-input-chips,.input__container__text[type=radio].sc-bds-input-chips{width:13px;height:13px}.input__container__text[type=search].sc-bds-input-chips{-webkit-appearance:textfield;-webkit-box-sizing:content-box}.sc-bds-input-chips::-webkit-search-decoration{display:none}.input__container__text[type=reset].sc-bds-input-chips,.input__container__text[type=button].sc-bds-input-chips,.input__container__text[type=submit].sc-bds-input-chips{overflow:visible}.input__container__text.sc-bds-input-chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__text.sc-bds-input-chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__message.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;height:20px;margin:3.7px 2.5px;-webkit-transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);color:#8ca0b3;word-break:break-word;height:auto;min-height:20px}.input__message.sc-bds-input-chips bds-typo.sc-bds-input-chips{margin-top:0px;-ms-flex-item-align:self-start;align-self:self-start}.input__message__icon.sc-bds-input-chips{display:-ms-flexbox;display:flex;padding-right:4px;margin-top:0px;padding-top:2px}.input__message--danger.sc-bds-input-chips{color:#ff4c4c}.inside-input-left.sc-bds-input-chips{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:8px}.input-chips__chip.sc-bds-input-chips{margin:2px 4px 2px 0px}.input-chips__chips.sc-bds-input-chips{-ms-flex:1;flex:1}';var InputChips=function(){function i(i){var t=this;registerInstance(this,i);this.bdsChange=createEvent(this,"bdsChange",7);this.bdsChangeChips=createEvent(this,"bdsChangeChips",7);this.bdsInputChipsFocus=createEvent(this,"bdsInputChipsFocus",7);this.bdsBlur=createEvent(this,"bdsBlur",7);this.bdsInputChipsInput=createEvent(this,"bdsInputChipsInput",7);this.bdsSubmit=createEvent(this,"bdsSubmit",7);this.onClickWrapper=function(){t.onFocus();if(t.nativeInput){t.nativeInput.focus()}};this.onFocus=function(){t.bdsInputChipsFocus.emit();t.isPressed=true};this.onInput=function(i){var e=i.target;if(e){t.value=e.value||""}t.bdsInputChipsInput.emit(i)};this.keyPressWrapper=function(i){switch(i.key){case"Enter":t.handleDelimiters();t.setChip(t.value);t.value="";break;case"Backspace":if((t.value===null||t.value.length<=0)&&t.internalChips.length){t.removeLastChip();t.bdsChangeChips.emit({data:t.internalChips})}break}};this.validationDanger=false;this.isPressed=false;this.validationMesage="";this.internalChips=[];this.chips=[];this.type="text";this.label="";this.maxlength=undefined;this.icon="";this.delimiters=/,|;/;this.errorMessage="";this.danger=false;this.value="";this.duplicated=false;this.disableSubmit=false;this.disabled=false;this.helperMessage="";this.inputName="";this.placeholder="";this.dataTest=null}i.prototype.valueChanged=function(){if(this.chips){if(typeof this.chips==="string"){try{this.internalChips=JSON.parse(this.chips)}catch(i){this.internalChips=[]}}else{this.internalChips=this.chips}}else{this.internalChips=[]}};i.prototype.internalValueChanged=function(){this.bdsChangeChips.emit({data:this.internalChips,value:this.getLastChip()})};i.prototype.isValid=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this.validateChips()]}))}))};i.prototype.get=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this.internalChips]}))}))};i.prototype.clear=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.internalChips=[];this.value="";return[2]}))}))};i.prototype.add=function(i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.setChip(i);return[2]}))}))};i.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.nativeInput.focus();return[2]}))}))};i.prototype.removeFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.nativeInput.blur();return[2]}))}))};i.prototype.componentWillLoad=function(){this.valueChanged()};i.prototype.validateChips=function(){var i=this;if(this.type==="email"){return!this.internalChips.some((function(t){return!i.validateChip(t)}))}else{return true}};i.prototype.handleOnBlur=function(){this.bdsBlur.emit(this.internalChips);this.isPressed=false};i.prototype.getLastChip=function(){return this.internalChips[this.internalChips.length-1]};i.prototype.handleDelimiters=function(){var i=this;var t=this.nativeInput.value;this.value=t?t.trim():"";if(t.length===0)return;var e=t.match(this.delimiters);if(!e)return;var n=this.verifyAndSubstituteDelimiters(t);if(!n){this.clearInputValues();return}var s=n.split(this.delimiters);s.forEach((function(t){i.setChip(t)}));this.clearInputValues()};i.prototype.verifyAndSubstituteDelimiters=function(i){if(i.length===1&&i[0].match(this.delimiters)){return""}var t=i.replace(/;/g,",").replace(/\,+|;+/g,",");if(t[0].match(this.delimiters)){t=t.substring(1)}return t};i.prototype.handleChange=function(i){return __awaiter(this,void 0,void 0,(function(){var t,e,n,s;var r=this;return __generator(this,(function(a){t=i.detail.value;this.value=t?t.trim():"";if(t.length===0)return[2];e=t.match(this.delimiters);if(!e)return[2];n=this.verifyAndSubstituteDelimiters(t);if(!n){this.clearInputValues();return[2]}s=n.split(this.delimiters);s.forEach((function(i){r.setChip(i)}));this.clearInputValues();return[2]}))}))};i.prototype.clearInputValues=function(i){if(i===void 0){i=""}this.nativeInput.value=i;this.value=i};i.prototype.setChip=function(i){if(!this.duplicated){var t=this.internalChips.some((function(t){return t.toLowerCase()===i.toLowerCase()}));if(t)return}if(!whitespaceValidation(i)){return}this.internalChips=__spreadArray(__spreadArray([],this.internalChips,true),[i],false)};i.prototype.validateChip=function(i){var t=i.trim();if(this.type==="email"&&emailValidation(t)){return false}return true};i.prototype.removeLastChip=function(){this.internalChips=this.internalChips.slice(0,this.internalChips.length-1)};i.prototype.removeChip=function(i){var t=i.detail.id;this.internalChips=this.internalChips.filter((function(i,e){return e.toString()!==t}))};i.prototype.renderChips=function(){var i=this;if(!this.internalChips.length){return[]}return this.internalChips.map((function(t,e){var n=e.toString();return h("bds-chip-clickable",{id:n,key:n,color:"default",close:!i.disabled,onChipClickableClose:function(t){return i.removeChip(t)}},t)}))};i.prototype.renderIcon=function(){return this.icon&&h("div",{class:{input__icon:true,"input__icon--large":!!this.label}},h("bds-icon",{size:this.label?"medium":"small",name:this.icon,color:"inherit"}))};i.prototype.renderLabel=function(){return this.label&&h("label",{class:{input__container__label:true,"input__container__label--pressed":this.isPressed&&!this.disabled}},h("bds-typo",{variant:"fs-12",bold:"bold"},this.label))};i.prototype.renderMessage=function(){var i=this.danger?"error":"info";var t=this.danger?this.errorMessage:this.helperMessage;if(!t&&this.validationDanger)t=this.validationMesage;var e=this.danger||this.validationDanger?"input__message input__message--danger":"input__message";if(t){return h("div",{class:e,part:"input__message"},h("div",{class:"input__message__icon"},h("bds-icon",{size:"x-small",name:i,theme:"solid",color:"inherit"})),h("bds-typo",{variant:"fs-12"},t))}return undefined};i.prototype.render=function(){var i=this;var t=this.isPressed&&!this.disabled;return h(Host,null,h("div",{class:{element_input:true},"aria-disabled":this.disabled?"true":null},h("div",{class:{input:true,"input--state-primary":!this.danger&&!this.validationDanger,"input--state-danger":this.danger||this.validationDanger,"input--state-disabled":this.disabled,"input--label":!!this.label,"input--pressed":t},onClick:this.onClickWrapper,onKeyDown:this.keyPressWrapper,part:"input-container"},this.renderIcon(),h("div",{class:"input__container"},this.renderLabel(),h("div",{class:{input__container__wrapper:true}},this.internalChips.length>0&&h("span",{class:"inside-input-left"},this.renderChips()),h("input",{ref:function(t){return i.nativeInput=t},class:{input__container__text:true},name:this.inputName,maxlength:this.maxlength,placeholder:this.placeholder,onInput:this.onInput,onFocus:this.onFocus,onBlur:function(){return i.handleOnBlur()},onChange:function(){return i.handleChange},value:this.value,disabled:this.disabled,"data-test":this.dataTest}))),h("slot",{name:"input-right"})),this.renderMessage()))};Object.defineProperty(i,"watchers",{get:function(){return{chips:["valueChanged"],internalChips:["internalValueChanged"]}},enumerable:false,configurable:true});return i}();InputChips.style=inputChipsCss;export{InputChips as bds_input_chips};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,c as s,h as t,H as e}from"./p-fc42d972.js";import{w as n,e as p}from"./p-7d00c003.js";const r=class{constructor(t){i(this,t),this.bdsChange=s(this,"bdsChange",7),this.bdsChangeChips=s(this,"bdsChangeChips",7),this.bdsInputChipsFocus=s(this,"bdsInputChipsFocus",7),this.bdsBlur=s(this,"bdsBlur",7),this.bdsInputChipsInput=s(this,"bdsInputChipsInput",7),this.bdsSubmit=s(this,"bdsSubmit",7),this.onClickWrapper=()=>{this.onFocus(),this.nativeInput&&this.nativeInput.focus()},this.onFocus=()=>{this.bdsInputChipsFocus.emit(),this.isPressed=!0},this.onInput=i=>{const s=i.target;s&&(this.value=s.value||""),this.bdsInputChipsInput.emit(i)},this.keyPressWrapper=i=>{switch(i.key){case"Enter":this.setChip(this.value),this.value="";break;case"Backspace":(null===this.value||this.value.length<=0)&&this.internalChips.length&&(this.removeLastChip(),this.bdsChangeChips.emit({data:this.internalChips}))}},this.validationDanger=!1,this.isPressed=!1,this.validationMesage="",this.internalChips=[],this.chips=[],this.type="text",this.label="",this.maxlength=void 0,this.icon="",this.delimiters=/,|;/,this.errorMessage="",this.danger=!1,this.value="",this.duplicated=!1,this.disableSubmit=!1,this.disabled=!1,this.helperMessage="",this.inputName="",this.placeholder="",this.dataTest=null}valueChanged(){if(this.chips)if("string"==typeof this.chips)try{this.internalChips=JSON.parse(this.chips)}catch(i){this.internalChips=[]}else this.internalChips=this.chips;else this.internalChips=[]}internalValueChanged(){this.bdsChangeChips.emit({data:this.internalChips,value:this.getLastChip()})}async isValid(){return this.validateChips()}async get(){return this.internalChips}async clear(){this.internalChips=[],this.value=""}async add(i){this.setChip(i)}async setFocus(){this.nativeInput.focus()}async removeFocus(){this.nativeInput.blur()}componentWillLoad(){this.valueChanged()}validateChips(){return"email"!==this.type||!this.internalChips.some((i=>!this.validateChip(i)))}handleOnBlur(){this.bdsBlur.emit(this.internalChips),this.isPressed=!1}getLastChip(){return this.internalChips[this.internalChips.length-1]}verifyAndSubstituteDelimiters(i){if(1===i.length&&i[0].match(this.delimiters))return"";let s=i.replace(/;/g,",").replace(/\,+|;+/g,",");return s[0].match(this.delimiters)&&(s=s.substring(1)),s}async handleChange(i){const{detail:{value:s}}=i;if(this.value=s?s.trim():"",0===s.length)return;if(!s.match(this.delimiters))return;const t=this.verifyAndSubstituteDelimiters(s);t?(t.split(this.delimiters).forEach((i=>{this.setChip(i)})),this.clearInputValues()):this.clearInputValues()}clearInputValues(i=""){this.nativeInput.value=i,this.value=i}setChip(i){!this.duplicated&&this.internalChips.some((s=>s.toLowerCase()===i.toLowerCase()))||n(i)&&(this.internalChips=[...this.internalChips,i])}validateChip(i){const s=i.trim();return"email"!==this.type||!p(s)}removeLastChip(){this.internalChips=this.internalChips.slice(0,this.internalChips.length-1)}removeChip(i){const{detail:{id:s}}=i;this.internalChips=this.internalChips.filter(((i,t)=>t.toString()!==s))}renderChips(){return this.internalChips.length?this.internalChips.map(((i,s)=>{const e=s.toString();return t("bds-chip-clickable",{id:e,key:e,color:"default",close:!this.disabled,onChipClickableClose:i=>this.removeChip(i)},i)})):[]}renderIcon(){return this.icon&&t("div",{class:{input__icon:!0,"input__icon--large":!!this.label}},t("bds-icon",{size:this.label?"medium":"small",name:this.icon,color:"inherit"}))}renderLabel(){return this.label&&t("label",{class:{input__container__label:!0,"input__container__label--pressed":this.isPressed&&!this.disabled}},t("bds-typo",{variant:"fs-12",bold:"bold"},this.label))}renderMessage(){let i=this.danger?this.errorMessage:this.helperMessage;if(!i&&this.validationDanger&&(i=this.validationMesage),i)return t("div",{class:this.danger||this.validationDanger?"input__message input__message--danger":"input__message",part:"input__message"},t("div",{class:"input__message__icon"},t("bds-icon",{size:"x-small",name:this.danger?"error":"info",theme:"solid",color:"inherit"})),t("bds-typo",{variant:"fs-12"},i))}render(){return t(e,null,t("div",{class:{element_input:!0},"aria-disabled":this.disabled?"true":null},t("div",{class:{input:!0,"input--state-primary":!this.danger&&!this.validationDanger,"input--state-danger":this.danger||this.validationDanger,"input--state-disabled":this.disabled,"input--label":!!this.label,"input--pressed":this.isPressed&&!this.disabled},onClick:this.onClickWrapper,onKeyDown:this.keyPressWrapper,part:"input-container"},this.renderIcon(),t("div",{class:"input__container"},this.renderLabel(),t("div",{class:{input__container__wrapper:!0}},this.internalChips.length>0&&t("span",{class:"inside-input-left"},this.renderChips()),t("input",{ref:i=>this.nativeInput=i,class:{input__container__text:!0},name:this.inputName,maxlength:this.maxlength,placeholder:this.placeholder,onInput:this.onInput,onFocus:this.onFocus,onBlur:()=>this.handleOnBlur(),onChange:()=>this.handleChange,value:this.value,disabled:this.disabled,"data-test":this.dataTest}))),t("slot",{name:"input-right"})),this.renderMessage()))}static get watchers(){return{chips:["valueChanged"],internalChips:["internalValueChanged"]}}};r.style='.sc-bds-input-chips-h{display:display}.element_input.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%}.element_input.sc-bds-input-chips input.sc-bds-input-chips{-webkit-box-shadow:inherit;box-shadow:inherit}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-moz-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips:-ms-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-ms-input-placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::placeholder{color:#b9cbd3;opacity:1}.element_input.sc-bds-input-chips input.sc-bds-input-chips::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.input.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:8px 4px 9px 12px;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;background:#ffffff}.input--state-primary.sc-bds-input-chips{border:1px solid #d2dfe6;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.sc-bds-input-chips:hover{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.input--pressed.sc-bds-input-chips{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4);box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4)}.input--state-primary.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#3f7de8;background-color:#e8f2ff}.input--state-primary.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#8ca0b3}.input--state-primary.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#3f7de8}.input--state-primary.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#3f7de8;color:#202c44}.input--state-danger.sc-bds-input-chips{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.sc-bds-input-chips:hover{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.input--pressed.sc-bds-input-chips{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #ffa5a5;box-shadow:0 0 0 2px #ffa5a5}.input--state-danger.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#ff4c4c;background-color:#ffa5a5}.input--state-danger.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#8ca0b3}.input--state-danger.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#ff4c4c}.input--state-danger.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#ff4c4c;color:#202c44}.input--state-disabled.sc-bds-input-chips{cursor:not-allowed;border:1px solid #e7edf4;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;background:#f3f6fa}.input--state-disabled.sc-bds-input-chips:hover{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;border:1px solid #e7edf4;box-sizing:border-box;border-radius:8px}.input--state-disabled.input--pressed.sc-bds-input-chips{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #e7edf4;box-shadow:0 0 0 2px #e7edf4}.input--state-disabled.sc-bds-input-chips .input__icon.sc-bds-input-chips{color:#b9cbd3;background-color:#f8fbfb}.input--state-disabled.sc-bds-input-chips .input__container__label.sc-bds-input-chips{color:#b9cbd3}.input--state-disabled.sc-bds-input-chips .input__container__label--pressed.sc-bds-input-chips{color:#b9cbd3}.input--state-disabled.sc-bds-input-chips .input__container__text.sc-bds-input-chips{caret-color:#b9cbd3;color:#b9cbd3}.input--label.sc-bds-input-chips{padding:7px 4px 8px 12px}.input__icon.sc-bds-input-chips{cursor:inherit;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:8px;margin-right:8px;padding:2.5px}.input__icon--large.sc-bds-input-chips{padding:4px}.input__container.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;width:100%}.input__container__wrapper.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.input__container__wrapper__chips.sc-bds-input-chips{display:inline;max-height:100px;overflow:auto}.input__container__wrapper__chips.sc-bds-input-chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__wrapper__chips.sc-bds-input-chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__container__label.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input__container__text.sc-bds-input-chips{display:inline-block;margin:0;border:0;padding:0;width:auto;vertical-align:middle;white-space:normal;line-height:inherit;background:none;color:inherit;font-size:inherit;font-family:inherit;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;font-family:"Nunito Sans", "Tahoma", "Helvetica", "Arial", sans-serif;font-size:0.875rem;line-height:150%;resize:none;cursor:inherit}.input__container__text.sc-bds-input-chips:focus{outline:0}.input__container__text.sc-bds-input-chips::-webkit-file-upload-button{padding:0;border:0;background:none}.input__container__text.sc-bds-input-chips:focus{outline:0}.input__container__text[type=checkbox].sc-bds-input-chips,.input__container__text[type=radio].sc-bds-input-chips{width:13px;height:13px}.input__container__text[type=search].sc-bds-input-chips{-webkit-appearance:textfield;-webkit-box-sizing:content-box}.sc-bds-input-chips::-webkit-search-decoration{display:none}.input__container__text[type=reset].sc-bds-input-chips,.input__container__text[type=button].sc-bds-input-chips,.input__container__text[type=submit].sc-bds-input-chips{overflow:visible}.input__container__text.sc-bds-input-chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__text.sc-bds-input-chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__message.sc-bds-input-chips{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;height:20px;margin:3.7px 2.5px;-webkit-transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);color:#8ca0b3;word-break:break-word;height:auto;min-height:20px}.input__message.sc-bds-input-chips bds-typo.sc-bds-input-chips{margin-top:0px;-ms-flex-item-align:self-start;align-self:self-start}.input__message__icon.sc-bds-input-chips{display:-ms-flexbox;display:flex;padding-right:4px;margin-top:0px;padding-top:2px}.input__message--danger.sc-bds-input-chips{color:#ff4c4c}.inside-input-left.sc-bds-input-chips{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:8px}.input-chips__chip.sc-bds-input-chips{margin:2px 4px 2px 0px}.input-chips__chips.sc-bds-input-chips{-ms-flex:1;flex:1}';export{r as bds_input_chips}
|