blip-ds 1.154.2 → 1.155.0
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 +13 -1
- package/dist/blip-ds/bds-input-chips.system.entry.js +1 -1
- package/dist/blip-ds/blip-ds.esm.js +1 -1
- package/dist/blip-ds/blip-ds.system.js +1 -1
- package/dist/blip-ds/p-040dcd88.system.entry.js +1 -0
- package/dist/blip-ds/p-9a98b63f.system.js +1 -1
- package/dist/blip-ds/p-ddac8637.entry.js +1 -0
- package/dist/cjs/bds-input-chips.cjs.entry.js +13 -1
- package/dist/cjs/blip-ds.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/input-chips/input-chips.js +67 -1
- package/dist/esm/bds-input-chips.entry.js +13 -1
- package/dist/esm/blip-ds.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/bds-input-chips.entry.js +1 -1
- package/dist/esm-es5/blip-ds.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/types/components/input-chips/input-chips.d.ts +12 -0
- package/dist/types/components.d.ts +24 -0
- package/package.json +1 -1
- package/dist/blip-ds/p-2aed270e.entry.js +0 -1
- package/dist/blip-ds/p-bab14f45.system.entry.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,i,e,n){function s(t){return t instanceof e?t:new e((function(i){i(t)}))}return new(e||(e=Promise))((function(e,r){function a(t){try{u(n.next(t))}catch(i){r(i)}}function h(t){try{u(n["throw"](t))}catch(i){r(i)}}function u(t){t.done?e(t.value):s(t.value).then(a,h)}u((n=n.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){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:h(0),throw:h(1),return:h(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function h(t){return function(i){return u([t,i])}}function u(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=i.call(t,e)}catch(h){a=[6,h];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(t,i,e){if(e||arguments.length===2)for(var n=0,s=i.length,r;n<s;n++){if(r||!(n in i)){if(!r)r=Array.prototype.slice.call(i,0,n);r[n]=i[n]}}return t.concat(r||Array.prototype.slice.call(i))};System.register(["./p-660b44d1.system.js","./p-c5060283.system.js"],(function(t){"use strict";var i,e,n,s,r,a;return{setters:[function(t){i=t.r;e=t.c;n=t.h;s=t.H},function(t){r=t.w;a=t.e}],execute:function(){var h='@import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,200;0.sc-bds-input-chips,300.sc-bds-input-chips;0.sc-bds-input-chips,400.sc-bds-input-chips;0.sc-bds-input-chips,600.sc-bds-input-chips;0.sc-bds-input-chips,700.sc-bds-input-chips;0.sc-bds-input-chips,800.sc-bds-input-chips;0.sc-bds-input-chips,900.sc-bds-input-chips;1.sc-bds-input-chips,200.sc-bds-input-chips;1.sc-bds-input-chips,300.sc-bds-input-chips;1.sc-bds-input-chips,400.sc-bds-input-chips;1.sc-bds-input-chips,600.sc-bds-input-chips;1.sc-bds-input-chips,700.sc-bds-input-chips;1.sc-bds-input-chips,800.sc-bds-input-chips;1.sc-bds-input-chips,900&display=swap").sc-bds-input-chips; .sc-bds-input-chips-h{display:block}.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 u=t("bds_input_chips",function(){function t(t){i(this,t);this.bdsChange=e(this,"bdsChange",7);this.bdsChangeChips=e(this,"bdsChangeChips",7);this.bdsBlur=e(this,"bdsBlur",7);this.bdsSubmit=e(this,"bdsSubmit",7);this.internalChips=[];this.chips=[];this.type="text";this.label="";this.icon="";this.delimiters=/,|;/;this.errorMessage="";this.danger=false;this.value="";this.duplicated=false;this.disableSubmit=false;this.disabled=false}t.prototype.valueChanged=function(){if(this.chips){if(typeof this.chips==="string"){try{this.internalChips=JSON.parse(this.chips)}catch(t){this.internalChips=[]}}else{this.internalChips=this.chips}}else{this.internalChips=[]}};t.prototype.internalValueChanged=function(){this.bdsChangeChips.emit({data:this.internalChips,value:this.getLastChip()})};t.prototype.isValid=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.validateChips()]}))}))};t.prototype.get=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.internalChips]}))}))};t.prototype.clear=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.internalChips=[];this.value="";return[2]}))}))};t.prototype.add=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.setChip(t);return[2]}))}))};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.nativeInput.setFocus();return[2]}))}))};t.prototype.removeFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.nativeInput.removeFocus();return[2]}))}))};t.prototype.componentWillLoad=function(){this.valueChanged()};t.prototype.validateChips=function(){var t=this;if(this.type==="email"){return!this.internalChips.some((function(i){return!t.validateChip(i)}))}else{return true}};t.prototype.handleOnBlur=function(){this.bdsBlur.emit(this.internalChips)};t.prototype.handleAddChip=function(t){if(this.disableSubmit){return}var i=t.detail.value;this.setChip(i);this.value=""};t.prototype.getLastChip=function(){return this.internalChips[this.internalChips.length-1]};t.prototype.handleBackRemove=function(t){var i=t.detail.value;if((i===null||i.length<=0)&&this.internalChips.length){this.removeLastChip();this.bdsChangeChips.emit({data:this.internalChips,value:i})}};t.prototype.verifyAndSubstituteDelimiters=function(t){if(t.length===1&&t[0].match(this.delimiters)){return""}var i=t.replace(/;/g,",").replace(/\,+|;+/g,",");if(i[0].match(this.delimiters)){i=i.substring(1)}return i};t.prototype.handleChange=function(t){return __awaiter(this,void 0,void 0,(function(){var i,e,n,s;var r=this;return __generator(this,(function(a){i=t.detail.value;this.value=i?i.trim():"";if(i.length===0)return[2];e=i.match(this.delimiters);if(!e)return[2];n=this.verifyAndSubstituteDelimiters(i);if(!n){this.clearInputValues();return[2]}s=n.split(this.delimiters);s.forEach((function(t){r.setChip(t)}));this.clearInputValues();return[2]}))}))};t.prototype.clearInputValues=function(t){if(t===void 0){t=""}this.nativeInput.value=t;this.value=t};t.prototype.setChip=function(t){if(!this.duplicated){var i=this.internalChips.some((function(i){return i.toLowerCase()===t.toLowerCase()}));if(i)return}if(!r(t)){return}this.internalChips=__spreadArray(__spreadArray([],this.internalChips,true),[t],false)};t.prototype.validateChip=function(t){var i=t.trim();if(this.type==="email"&&a(i)){return false}return true};t.prototype.removeLastChip=function(){this.internalChips=this.internalChips.slice(0,this.internalChips.length-1)};t.prototype.removeChip=function(t){var i=t.detail.id;this.internalChips=this.internalChips.filter((function(t,e){return e.toString()!==i}))};t.prototype.renderChips=function(){var t=this;if(!this.internalChips.length){return[]}return this.internalChips.map((function(i,e){var s=e.toString();return n("bds-chip",{class:"input-chips__chip",id:s,key:s,variant:"primary",danger:!t.validateChip(i),deletable:!t.disabled,onBdsDelete:function(i){return t.removeChip(i)}},i)}))};t.prototype.render=function(){var t=this;return n(s,null,n("bds-input",{ref:function(i){return t.nativeInput=i},icon:this.icon,label:this.label,onBdsKeyDownBackspace:function(i){return t.handleBackRemove(i)},onBdsSubmit:function(i){return t.handleAddChip(i)},onBdsOnBlur:function(){return t.handleOnBlur()},onBdsChange:function(i){return t.handleChange(i)},maxlength:this.maxlength,value:this.value,"error-message":this.errorMessage,danger:this.danger,chips:true,disabled:this.disabled},n("span",{slot:"inside-input-left"},this.renderChips()),n("div",{slot:"input-right"},n("slot",{name:"input-right"}))))};Object.defineProperty(t,"watchers",{get:function(){return{chips:["valueChanged"],internalChips:["internalValueChanged"]}},enumerable:false,configurable:true});return t}());u.style=h}}}));
|