@avakhula/ui 0.0.349 → 0.0.351
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/index.js +6 -6
- package/dist/index.umd.cjs +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/App.vue +34 -106
- package/src/components/Form/Input/Input.vue +1 -1
- package/src/components/Form/PhoneInput/PhoneInput.vue +9 -5
- package/src/components/TreeSelect/Option.vue +8 -2
package/dist/index.js
CHANGED
|
@@ -3105,7 +3105,7 @@ function id(t, n, e, r, o, i) {
|
|
|
3105
3105
|
]),
|
|
3106
3106
|
_: 1
|
|
3107
3107
|
}, 8, ["disabled", "help-text", "onClick", "onKeypress"])), [
|
|
3108
|
-
[Ke, (h = o.actualValue) == null ? void 0 : h.length]
|
|
3108
|
+
[Ke, (h = o.actualValue) == null ? void 0 : h.toString().length]
|
|
3109
3109
|
]) : he("", !0),
|
|
3110
3110
|
e.type === "password" ? Me((G(), Ce(u, {
|
|
3111
3111
|
key: 2,
|
|
@@ -3155,7 +3155,7 @@ function id(t, n, e, r, o, i) {
|
|
|
3155
3155
|
], 2)
|
|
3156
3156
|
]);
|
|
3157
3157
|
}
|
|
3158
|
-
const Ia = /* @__PURE__ */ Ae(ed, [["render", id], ["__scopeId", "data-v-
|
|
3158
|
+
const Ia = /* @__PURE__ */ Ae(ed, [["render", id], ["__scopeId", "data-v-610352e2"]]);
|
|
3159
3159
|
const rd = {
|
|
3160
3160
|
name: "IbCheckbox",
|
|
3161
3161
|
model: {
|
|
@@ -3485,11 +3485,11 @@ const Od = {
|
|
|
3485
3485
|
}
|
|
3486
3486
|
},
|
|
3487
3487
|
mounted() {
|
|
3488
|
-
this.option.hasOwnProperty("children") && this.option.children && this.checkParent();
|
|
3488
|
+
this.option.hasOwnProperty("children") && this.option.children && this.checkParent(), this.option.showTooltipByDefault && (this.showTooltip = !0);
|
|
3489
3489
|
},
|
|
3490
3490
|
updated() {
|
|
3491
3491
|
this.$nextTick(() => {
|
|
3492
|
-
Ma(this.$el.querySelector(".option-label")) && (this.showTooltip = !0);
|
|
3492
|
+
this.option.showTooltipByDefault ? this.showTooltip = !0 : Ma(this.$el.querySelector(".option-label")) && (this.showTooltip = !0);
|
|
3493
3493
|
});
|
|
3494
3494
|
},
|
|
3495
3495
|
data() {
|
|
@@ -3697,7 +3697,7 @@ function Ad(t, n, e, r, o, i) {
|
|
|
3697
3697
|
[Ke, i.hasVisibleChildren && e.option.isChildrenVisible]
|
|
3698
3698
|
]) : he("", !0)
|
|
3699
3699
|
], 42, Cd)), [
|
|
3700
|
-
[h, o.showTooltip ? e.option.title : ""]
|
|
3700
|
+
[h, o.showTooltip ? e.option.isDisabled ? e.option.disableTooltip : e.option.title : ""]
|
|
3701
3701
|
])
|
|
3702
3702
|
]);
|
|
3703
3703
|
}
|
|
@@ -11127,7 +11127,7 @@ const A1 = {
|
|
|
11127
11127
|
countryChanged(t) {
|
|
11128
11128
|
this.$globalEvents.$on("countrySelectValue", (n) => {
|
|
11129
11129
|
this.vueTel.choose(n);
|
|
11130
|
-
}),
|
|
11130
|
+
}), this.phone = "+" + t.dialCode, this.dialCode = t.dialCode;
|
|
11131
11131
|
},
|
|
11132
11132
|
clickOutside() {
|
|
11133
11133
|
this.vueTel.open && this.vueTel.clickedOutside();
|
package/dist/index.umd.cjs
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
top: ${a-p-c/2+f+12}px!important`;break;case"rightCenter":d=d+`left: ${l+5}px!important;
|
|
20
20
|
top: ${a+f-p/2-c/2}px!important;`;break;case"rightBottom":d=d+`left: ${l+5}px!important;
|
|
21
21
|
top: ${a+f-c/2-12}px!important`;break;default:d=d+`left: ${r+s/2-h/2}px!important;
|
|
22
|
-
top: ${i-p+f-5}px!important`;break}return d}getClassList(n){return n?bo[n]:bo.topCenter}}const Gt=new _o,cd=(t,n)=>{var a;Gt.getTooltipContainer()&&Gt.destroyTooltip();const e=Object.keys(n.modifiers)[0]||n.arg,i={title:((a=n.value)==null?void 0:a.title)||"",text:typeof n.value=="object"?n.value.text:n.value};Gt.createTooltip(t,i,e)},ud=(t,n)=>{const e=Gt.getId();if(n.getAttribute("aria-describedby")!==e)return;const i=Gt.getTooltipContainer(),a=n!==t.target&&!n.contains(t.target),r=i!==t.target&&!(i!=null&&i.contains(t.target));a&&r&&Gt.destroyTooltip(n)},$o=(t,n)=>{t.__tooltip_create=()=>cd(t,n),t.__tooltip_destroy=e=>ud(e,t),t.addEventListener("mouseenter",t.__tooltip_create),document.addEventListener("mousemove",t.__tooltip_destroy)},wo=t=>{Gt.destroyTooltip(t),t.removeEventListener("mouseenter",t.__tooltip_create),document.removeEventListener("mousemove",t.__tooltip_destroy)},nr={mounted(t,n){$o(t,n)},updated(t,n){wo(t),$o(t,n)},beforeUnmount(t){wo(t)}},z0="",fd={name:"IbSorting",props:{tooltipTitle:{type:String,default:""},hideSortingButton:{type:Boolean,default:!1},tooltipText:{type:String},tooltipPosition:{type:String},tooltipIconPosition:{type:String},tooltipIconSorting:{type:String},toggleTipTitle:{type:String},title:{type:String,default:""},sort:{type:String,default:null},view:{type:String,required:!0},disable:{type:Boolean,default:!1},tableName:{type:String,required:!0}},mounted(){this.$globalEvents.$on(`sorting:update:${this.tableName}`,t=>{this.$el.contains(t.$el)||(this.currentTypeSort=null)})},data(){return{isOpenToggleTip:!1,sortingTypes:dd,sortingTypesView:sd,currentTypeSort:this.sort}},methods:{clickHandler(){this.currentTypeSort?this.currentTypeSort===this.sortingTypes.TYPE_ASC?this.currentTypeSort=this.sortingTypes.TYPE_DESC:this.currentTypeSort=null:this.currentTypeSort=this.sortingTypes.TYPE_ASC,this.updateTypeSorting()},updateTypeSorting(){this.$globalEvents.$emit(`sorting:update:${this.tableName}`,this),this.$emit("update-sorting",this.currentTypeSort)}},computed:{iconType(){return this.currentTypeSort===this.sortingTypes.TYPE_ASC?"arrow-up":this.currentTypeSort===this.sortingTypes.TYPE_DESC?"arrow-down":this.view!==this.sortingTypesView.GRID_VIEW?"swap-vertical":null},sortingTooltipPosition(){return this.hasToggleTip?"bottomCenter":this.tooltipPosition},sortingTooltipContent(){var t;return this.hasToggleTip?lang("click_to_view_details",(t=this.langComponents)==null?void 0:t.COMPONENT_SYSTEM):this.tooltipContent},tooltipIconText(){var t,n,e;return this.currentTypeSort===this.sortingTypes.TYPE_ASC?lang("sort_descending",(t=this.langComponents)==null?void 0:t.COMPONENT_SELECT):this.currentTypeSort===this.sortingTypes.TYPE_DESC?lang("reset_sorting",(n=this.langComponents)==null?void 0:n.COMPONENT_SELECT):this.view!==this.sortingTypesView.GRID_VIEW?lang("sort_ascending",(e=this.langComponents)==null?void 0:e.COMPONENT_SELECT):""},tooltipContent(){return this.tooltipTitle.length?{title:this.tooltipTitle,text:this.tooltipText}:this.tooltipText},hasToggleTip(){return this.toggleTipTitle&&this.$slots.toggleTipBody&&this.$slots.toggleTipButtons}},directives:{Tooltip:nr},components:{IbIcon:Le,IbIconButton:ht,IbToggleTip:fo}},hd={class:"sorting-wrapper"},pd=["name"],md=["aria-label"];function gd(t,n,e,i,a,r){var p;const l=o.resolveComponent("ib-toggle-tip"),s=o.resolveComponent("ib-icon-button"),c=o.resolveComponent("ib-icon"),h=o.resolveDirective("tooltip");return o.openBlock(),o.createElementBlock("div",hd,[e.view===a.sortingTypesView.TABLE_VIEW?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["table-sorting-wrapper",{active:a.currentTypeSort,disabled:e.disable}])},[o.createElementVNode("div",null,[o.withDirectives((o.openBlock(),o.createElementBlock("button",{class:o.normalizeClass(["sorting-label",{"sorting-label-active":a.isOpenToggleTip&&r.hasToggleTip,"has-action":((p=e.tooltipText)==null?void 0:p.length)||r.hasToggleTip}]),type:"button",onClick:n[0]||(n[0]=f=>a.isOpenToggleTip=!a.isOpenToggleTip)},[o.createTextVNode(o.toDisplayString(e.title),1)],2)),[[h,r.sortingTooltipContent,r.sortingTooltipPosition]]),r.hasToggleTip?(o.openBlock(),o.createBlock(l,{key:0,position:"bottom-center","is-open":a.isOpenToggleTip,title:e.toggleTipTitle,onClose:n[1]||(n[1]=f=>a.isOpenToggleTip=!1)},{buttons:o.withCtx(()=>[o.renderSlot(t.$slots,"toggleTipButtons",{},void 0,!0)]),default:o.withCtx(()=>[o.renderSlot(t.$slots,"toggleTipBody",{},void 0,!0)]),_:3},8,["is-open","title"])):o.createCommentVNode("",!0)]),e.hideSortingButton?o.createCommentVNode("",!0):o.withDirectives((o.openBlock(),o.createBlock(s,{key:0,kind:"white",size:"s",onClick:r.clickHandler},{default:o.withCtx(()=>[o.createElementVNode("ion-icon",{name:r.iconType},null,8,pd)]),_:1},8,["onClick"])),[[h,r.tooltipIconText,e.tooltipIconPosition]])],2)):o.withDirectives((o.openBlock(),o.createElementBlock("button",{key:1,class:o.normalizeClass(["sorting-button",{active:a.currentTypeSort,disabled:e.disable}]),type:"button",onClick:n[2]||(n[2]=(...f)=>r.clickHandler&&r.clickHandler(...f)),"aria-label":e.sort},[o.createTextVNode(o.toDisplayString(e.title)+" ",1),r.iconType?(o.openBlock(),o.createBlock(c,{key:0,name:r.iconType},null,8,["name"])):o.createCommentVNode("",!0)],10,md)),[[h,e.tooltipText,e.tooltipPosition]])])}const yd=_e(fd,[["render",gd],["__scopeId","data-v-a4394881"]]),U0="",vd={name:"IbBreadcrumbs",props:{items:{type:Array,default:()=>[]},tooltipTextContext:{type:String}},computed:{last(){return this.items.length?this.items.length-1:null},initContextMenu(){return this.items.length>4},setItemsContextMenu(){return this.items.slice(0,-3)}},components:{IbIcon:Le,IbIconButton:ht,IbDropdownItem:Lr,IbDropdownList:tr,IbTooltip:an}},bd={"aria-label":"breadcrumb"},_d={class:"breadcrumb"},$d=["href"],wd={key:1},kd=["href"];function Cd(t,n,e,i,a,r){const l=o.resolveComponent("ib-icon"),s=o.resolveComponent("ib-tooltip"),c=o.resolveComponent("ib-icon-button"),h=o.resolveComponent("ib-dropdown-item"),p=o.resolveComponent("ib-dropdown-list");return o.openBlock(),o.createElementBlock("nav",bd,[o.createElementVNode("ul",_d,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.items,(f,d)=>(o.openBlock(),o.createElementBlock("li",{class:o.normalizeClass(["breadcrumb-item",d===r.last?"active":""]),"aria-current":"page",key:d},[d!==r.last&&d>e.items.length-4||d===0?(o.openBlock(),o.createElementBlock("a",{key:0,class:"ib-link",href:f.url},o.toDisplayString(f.title),9,$d)):o.createCommentVNode("",!0),d===r.last?(o.openBlock(),o.createElementBlock("p",wd,o.toDisplayString(f.title),1)):o.createCommentVNode("",!0),r.initContextMenu&&d===e.items.length-4?(o.openBlock(),o.createBlock(p,{key:2,horizontal:"center"},{trigger:o.withCtx(()=>[o.createVNode(c,{kind:"ghost"},{default:o.withCtx(()=>[o.createVNode(l,{name:"ellipsis-horizontal-sharp"}),e.tooltipTextContext?(o.openBlock(),o.createBlock(s,{key:0,text:e.tooltipTextContext},null,8,["text"])):o.createCommentVNode("",!0)]),_:1})]),body:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.setItemsContextMenu,(u,_)=>(o.openBlock(),o.createBlock(h,{key:_},{default:o.withCtx(()=>[o.createElementVNode("a",{class:"context-breadcrums",href:u.url},o.toDisplayString(u.title),9,kd)]),_:2},1024))),128))]),_:2},1024)):o.createCommentVNode("",!0),d!==r.last&&d>e.items.length-5||d===0?(o.openBlock(),o.createBlock(l,{key:3,name:"chevron-forward-outline"})):o.createCommentVNode("",!0)],2))),128))])])}const Od=_e(vd,[["render",Cd],["__scopeId","data-v-5ef772a9"]]),K0="",Ed={name:"IbLabel",props:{for:{type:String},required:{type:Boolean,default:!1},infoText:{type:String,default:""},tooltipPosition:{type:String}},mounted(){this.$globalEvents.$on(`label:disabled:${this.for}`,t=>{this.disabled=t})},data(){return{disabled:!1}},computed:{classes(){const t=["ib-label"];return this.infoText.length&&t.push("has-info-text"),this.disabled&&t.push("label-disabled"),t}},components:{IbIconButton:ht,IbIcon:Le},directives:{Tooltip:nr}},Sd=["for"],xd={key:0,class:"required"};function Td(t,n,e,i,a,r){const l=o.resolveComponent("ib-icon"),s=o.resolveComponent("ib-icon-button"),c=o.resolveDirective("tooltip");return o.openBlock(),o.createElementBlock("label",{class:o.normalizeClass(r.classes),for:e.for},[e.required?(o.openBlock(),o.createElementBlock("span",xd,"* ")):o.createCommentVNode("",!0),o.renderSlot(t.$slots,"default",{},void 0,!0),e.infoText.length?o.withDirectives((o.openBlock(),o.createBlock(s,{key:1,size:"xs",class:"info-button",kind:"ghost",type:"button"},{default:o.withCtx(()=>[o.createVNode(l,{name:"information-circle-outline"})]),_:1})),[[c,e.infoText,e.tooltipPosition]]):o.createCommentVNode("",!0)],10,Sd)}const wn=_e(Ed,[["render",Td],["__scopeId","data-v-524ad0fb"]]),Rr={text:"text",password:"password",email:"email",number:"number"},G0="",Nd={name:"IbInput",props:{type:{type:String,default:Rr.text,validator:t=>Object.keys(Rr).includes(t)},disabled:{type:Boolean,required:!1,default:!1},error:{type:Boolean,default:!1},errorMessage:{type:String,default:""},id:{type:[String],default(){return mt()}},debounce:{type:[Number,String]},showIcon:{type:Boolean,default:!1},showClearButton:{type:Boolean,default:!0},clearButtonMessage:{type:String,default:""},settingsButtonMessage:{type:String,default:""},showPasswordMessage:{type:String,default:""},hidePasswordMessage:{type:String,default:""},value:{type:[String,Number],default:""},modelValue:{type:[String,Number]},settingsVerticalPosition:{type:String,default:Qn.bottom},settingsHorizontalPosition:{type:String,default:$n.right},readonly:{type:Boolean,default:!1},autocomplete:{type:String}},data(){return{actualValue:this.modelValue||this.value,showPassword:!1}},mounted(){setTimeout(()=>{this.$globalEvents.$emit(`label:disabled:${this.id}`,this.disabled)},10)},methods:{toggleShowPassword(){this.showPassword=!this.showPassword},clearInput(){this.actualValue="",this.$emit("update:modelValue",this.actualValue),this.$emit("input",this.actualValue),this.$emit("clear")},onBlur(){this.$emit("blur",this.actualValue)},onFocus(){this.$emit("focus",this.actualValue)},onInput(){this.debounce?this.delayedInput(this.actualValue):(this.$emit("update:modelValue",this.actualValue),this.$emit("input",this.actualValue))},delayedInput(t){this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(()=>{this.$emit("update:modelValue",t),this.$emit("input",t)},this.debounce)},focus(){this.$refs.field.focus()}},computed:{hasSettings(){return!!this.$slots.settings},classes(){const t=["ib-input"];return this.hasErrorState&&t.push("ib-error"),this.showIcon&&t.push("ib-input-has-icon"),t},attrs(){let t=Ar({...this.$attrs},["onInput","onBlur"]);return t.type=this.type===Rr.password?this.showPassword?"text":"password":this.type,t},hasErrorState(){return this.error||this.errorMessage.length}},watch:{value(t){this.actualValue=t},modelValue(t){this.actualValue=t},disabled(t){this.$globalEvents.$emit(`label:disabled:${this.id}`,t)}},emits:["input","blur","focus","clear","update:modelValue",`label:disabled:${globalThis==null?void 0:globalThis.id}`],components:{IbAlert:qt,IbIconButton:ht,IbIcon:Le,IbDropdown:er},inheritAttrs:!1},Ad=["aria-invalid","readonly","disabled","id","autocomplete"],Dd={class:"settings-wrapper"};function Id(t,n,e,i,a,r){var p,f;const l=o.resolveComponent("ib-alert"),s=o.resolveComponent("ib-icon"),c=o.resolveComponent("ib-icon-button"),h=o.resolveComponent("ib-dropdown");return o.openBlock(),o.createElementBlock("div",null,[e.errorMessage?(o.openBlock(),o.createBlock(l,{key:0},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.errorMessage),1)]),_:1})):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["ib-input-wrapper",{"has-settings":r.hasSettings}])},[e.showIcon?(o.openBlock(),o.createBlock(s,{key:0,class:"icon-search",name:"search-outline"})):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("input",o.mergeProps(r.attrs,{"onUpdate:modelValue":n[0]||(n[0]=d=>a.actualValue=d),ref:"field","aria-invalid":!!r.hasErrorState,readonly:e.readonly,disabled:e.disabled,id:e.id,autocomplete:e.autocomplete,class:r.classes,onInput:n[1]||(n[1]=d=>r.onInput(d)),onBlur:n[2]||(n[2]=d=>r.onBlur(d)),onFocus:n[3]||(n[3]=d=>r.onFocus(d))}),null,16,Ad),[[o.vModelDynamic,a.actualValue]]),e.type!=="password"&&e.showClearButton?o.withDirectives((o.openBlock(),o.createBlock(c,{key:1,kind:"ghost",class:"button-clear",disabled:e.readonly||e.disabled,"help-text":e.clearButtonMessage,"prevent-default":"",type:"button",onClick:r.clearInput,onKeypress:o.withKeys(r.clearInput,["enter"])},{default:o.withCtx(()=>[o.createVNode(s,{name:"close-outline"})]),_:1},8,["disabled","help-text","onClick","onKeypress"])),[[o.vShow,(p=a.actualValue)==null?void 0:p.length]]):o.createCommentVNode("",!0),e.type==="password"?o.withDirectives((o.openBlock(),o.createBlock(c,{key:2,kind:"ghost",class:"toggle-password","prevent-default":"",type:"button",disabled:e.readonly||e.disabled,"help-text":a.showPassword?e.hidePasswordMessage:e.showPasswordMessage,onClick:o.withModifiers(r.toggleShowPassword,["prevent"])},{default:o.withCtx(()=>[o.createVNode(s,{name:a.showPassword?"eye-off-outline":"eye-outline"},null,8,["name"])]),_:1},8,["disabled","help-text","onClick"])),[[o.vShow,(f=a.actualValue)==null?void 0:f.length]]):o.createCommentVNode("",!0),r.hasSettings?(o.openBlock(),o.createBlock(h,{key:3,class:"settings-dropdown-wrapper",horizontal:e.settingsHorizontalPosition,vertical:e.settingsVerticalPosition},{trigger:o.withCtx(()=>[o.createVNode(c,{"prevent-default":"","help-text":e.settingsButtonMessage,class:"options-trigger",kind:"ghost"},{default:o.withCtx(()=>[o.createVNode(s,{name:"options"})]),_:1},8,["help-text"])]),body:o.withCtx(()=>[o.createElementVNode("div",Dd,[o.renderSlot(t.$slots,"settings",{},void 0,!0)])]),_:3},8,["horizontal","vertical"])):o.createCommentVNode("",!0)],2)])}const jr=_e(Nd,[["render",Id],["__scopeId","data-v-2abf13f4"]]),W0="",Pd={name:"IbCheckbox",model:{event:"input"},props:{label:String,error:{type:[Boolean,null],default:!1},name:String,id:{type:String,default(){return mt()}},value:{default:1},modelValue:{type:Boolean},isChecked:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},disableFocus:{type:Boolean,default:!1},required:{type:Boolean,default:!1},labelPosition:{type:String,default:"right"}},watch:{isChecked(t){this.checked=t},modelValue(t){this.$emit("update:modelValue",this.modelValue),this.checked=t}},data(){return{checked:this.modelValue?this.modelValue:this.isChecked}},methods:{onChange(t){this.disabled||this.readonly||(this.checked=!this.checked,this.$emit("update:modelValue",this.checked),this.$emit("input",this.checked))}},computed:{classes(){return{"ib-checkbox":!0,"ib-has-error":this.error,"ib-checkbox-filled":this.checked,"ib-checkbox-disabled":this.disabled,"ib-checkbox-readonly":this.readonly,"ib-checkbox-indeterminate":this.indeterminate}},indeterminate(){return this.isChecked===null},attrs(){const t={...Ar({...this.$attrs})};return delete t.class,t.class=this.classes,t}},components:{IbIcon:Le},inheritAttrs:!1},Md=["aria-checked"],Bd=["for","tabindex"],Ld=["name","id","value","disabled","required"],Rd={class:"ib-checkbox-body"},jd={key:0,class:"required"},Vd={class:"ib-checkbox-input"},Fd={key:1,class:"ib-checkbox-label"},qd={key:0,class:"required"};function Hd(t,n,e,i,a,r){var s;const l=o.resolveComponent("ib-icon");return o.openBlock(),o.createElementBlock("div",{role:"checkbox",class:o.normalizeClass(["ib-checkbox-wrapper",this.$attrs.class]),"aria-checked":!!a.checked},[o.createElementVNode("label",o.mergeProps(r.attrs,{for:e.id,tabindex:e.disabled|e.disableFocus?-1:0,onClick:n[2]||(n[2]=o.withModifiers((...c)=>r.onChange&&r.onChange(...c),["prevent","stop"])),onKeypress:n[3]||(n[3]=o.withModifiers((...c)=>r.onChange&&r.onChange(...c),["prevent"]))}),[o.withDirectives(o.createElementVNode("input",{tabindex:"-1",type:"checkbox",name:e.name,id:e.id,value:e.value,disabled:e.disabled,required:e.required,"onUpdate:modelValue":n[0]||(n[0]=c=>a.checked=c),onClick:n[1]||(n[1]=(...c)=>r.onChange&&r.onChange(...c))},null,8,Ld),[[o.vModelCheckbox,a.checked]]),o.createElementVNode("div",Rd,[e.labelPosition==="left"&&e.label.length?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["ib-checkbox-label",{"ib-checkbox-label-left":e.labelPosition==="left"}])},[e.required?(o.openBlock(),o.createElementBlock("span",jd,"*")):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(e.label),1)],2)):o.createCommentVNode("",!0),o.createElementVNode("span",Vd,[o.withDirectives(o.createVNode(l,{name:"checkmark-sharp"},null,512),[[o.vShow,a.checked&&!r.indeterminate]]),o.withDirectives(o.createVNode(l,{class:o.normalizeClass("checkbox-undeterminate-icon"),name:"remove-sharp"},null,512),[[o.vShow,r.indeterminate]])]),e.labelPosition==="right"&&((s=e.label)!=null&&s.length)?(o.openBlock(),o.createElementBlock("span",Fd,[e.required?(o.openBlock(),o.createElementBlock("span",qd,"*")):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(e.label),1)])):o.createCommentVNode("",!0)])],16,Bd)],10,Md)}const Vr=_e(Pd,[["render",Hd],["__scopeId","data-v-d0930a45"]]),Y0="",zd={name:"IbToggle",model:{prop:"isChecked",event:"input"},props:{isChecked:{type:Boolean,required:!1},id:{type:String,default:()=>mt()},disabled:{type:Boolean,default:!1},name:{type:String,default:"active"},label:{type:String,default:""},error:{type:Boolean,default:!1},labelPosition:{type:String,default:"right"},helpMessage:{type:String,default:""},helpMessageOff:{type:String,default:""}},watch:{isChecked(t){this.checked=t}},data(){return{checked:this.isChecked}},methods:{onChange(){this.disabled||(this.checked=!this.checked,this.$emit("input",this.checked))}},computed:{classes(){return{"ib-toggle-container":!0,"has-error":this.error,"toggle-on":this.checked,"toggle-disabled":this.disabled,"label-position-left":this.labelPosition==="left"}}},components:{IbIcon:Le,IbTooltip:an}},Ud=["aria-checked","tabindex"],Kd={class:"toggle-wrapper",ref:"wrapper"},Gd={class:"toggle",ref:"toggle"},Wd=["name","checked","id","disabled"],Yd=o.createElementVNode("span",{class:"toggle-slider round"},null,-1),Zd={key:0,class:"toggle-label"};function Jd(t,n,e,i,a,r){const l=o.resolveComponent("ib-icon"),s=o.resolveComponent("ib-tooltip");return o.openBlock(),o.createElementBlock("label",{role:"switch","aria-checked":a.checked,tabindex:e.disabled?-1:0,class:o.normalizeClass(r.classes),onKeypress:[n[2]||(n[2]=o.withKeys(o.withModifiers((...c)=>r.onChange&&r.onChange(...c),["prevent"]),["space"])),n[3]||(n[3]=o.withKeys(o.withModifiers((...c)=>r.onChange&&r.onChange(...c),["prevent"]),["enter"]))]},[o.createElementVNode("div",Kd,[o.createElementVNode("div",Gd,[o.createElementVNode("input",{tabindex:"-1",type:"checkbox",value:"1",name:e.name,checked:a.checked,id:e.id,disabled:e.disabled,onClick:n[0]||(n[0]=(...c)=>r.onChange&&r.onChange(...c)),onInput:n[1]||(n[1]=o.withModifiers(()=>{},["stop"]))},null,40,Wd),Yd,o.createVNode(l,{class:"checked-icon",name:"checkmark"}),o.createVNode(l,{class:"unchecked-icon",name:"close"})],512)],512),e.label.length?(o.openBlock(),o.createElementBlock("span",Zd,o.toDisplayString(e.label),1)):o.createCommentVNode("",!0),e.helpMessage.length?(o.openBlock(),o.createBlock(s,{key:1,text:a.checked?e.helpMessage:e.helpMessageOff.length?e.helpMessageOff:e.helpMessage},null,8,["text"])):o.createCommentVNode("",!0)],42,Ud)}const ko=_e(zd,[["render",Jd]]);function Co(t){return t.scrollHeight>t.clientHeight}const Z0="",Xd={name:"select-option",props:{option:{type:Object},name:String,parentAutoCheck:{type:Boolean,default:!1},isMultiple:{type:Boolean,default:!0},uid:{type:String,default:""},onlyEndNodes:{type:Boolean,default:!1},htmlTitle:{type:Boolean,default:!1},showInput:{type:Boolean,default:!0},isBookmarkable:{type:Boolean,default:!1},isBookmarked:{type:Boolean,default:!1},isToggle:{type:Boolean,default:!1}},mounted(){this.option.hasOwnProperty("children")&&this.option.children&&this.checkParent()},updated(){this.$nextTick(()=>{Co(this.$el.querySelector(".option-label"))&&(this.showTooltip=!0)})},data(){return{showTooltip:!1}},methods:{onKeydown(t){t.keyCode===ho&&(t.preventDefault(),this.onChange()),this.hasVisibleChildren&&(t.keyCode===hs&&(this.option.isChildrenVisible=!0),t.keyCode===fs&&(this.option.isChildrenVisible=!1))},onChange(){var t,n;!this.isMultiple&&!this.isChecked(this.option)&&((t=this.$refs.component)==null||t.onChange()),this.isMultiple&&((n=this.$refs.component)==null||n.onChange())},toggle(t,n=!0){this.check(this.option,t,!0,n)},check(t,n,e,i){this.$emit("check",t,n,e),i&&t.children&&t.children.forEach(a=>{this.check(a,n,!1,!0)})},toggleChildrenVisibility(){this.option.isChildrenVisible=!this.option.isChildrenVisible},checkChildren(t,n,e){e&&this.isMultiple&&this.$nextTick(()=>{this.checkParent()}),this.$emit("check",t,n,!1)},checkParent(){const t=this.option.children.filter(e=>e.checked).length,n=t>=this.option.children.length;(!this.option.checked&&n&&this.parentAutoCheck||this.option.checked&&!n)&&this.toggle(!this.option.checked,!1)},calculateChildren(t,n,e=!1){let i=0;return t.children&&t.children.forEach(a=>{(!n||n(a))&&i++,e&&(i+=this.calculateChildren(a,n,e))}),i},isChecked(t){if(this.hasChildren)if(this.childrenSelectedCount){if(this.childrenSelectedCount>0&&this.countOfAllChildren>this.childrenSelectedCount)return null}else return!1;return t.checked?!0:t.isIndeterminate?null:!1}},computed:{component(){return this.isMultiple&&this.isToggle?ko:Vr},hasChildren(){return!!(this.option.children&&this.option.children.length)},hasVisibleChildren(){return this.calculateChildren(this.option,t=>t.visible)},iconName(){return this.option.isChildrenVisible?"chevron-down":"chevron-forward"},id(){return this.uid+"_"+this.option.id},actualName(){return this.onlyEndNodes&&this.option.children&&this.option.children.length?"":this.name},childrenSelectedCount(){return this.calculateChildren(this.option,t=>t.checked,!0)},countOfAllChildren(){return this.calculateChildren(this.option,()=>!0,!0)}},components:{IbIcon:Le,List:Br,IbIconButton:ht},directives:{Tooltip:nr}},Qd=["aria-selected","aria-label","id"],ec={key:0,class:"option-label"},tc={key:1,class:"option-label"},nc=["innerHTML"],rc=["innerHTML"],ic={key:2,class:"option-label"};function oc(t,n,e,i,a,r){const l=o.resolveComponent("ib-icon"),s=o.resolveComponent("ib-icon-button"),c=o.resolveComponent("select-option"),h=o.resolveComponent("list"),p=o.resolveDirective("tooltip");return o.openBlock(),o.createElementBlock("li",null,[o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["tree-select-option",{"tree-select-option-checked":r.isChecked(e.option),"tree-select-option-margin":r.hasVisibleChildren,active:e.option.isChildrenVisible,"is-multiple":e.isMultiple,"is-not-multiple":!e.isMultiple,"tree-select-option-toggle":this.isToggle&&this.isMultiple}]),tabindex:"0",role:"option","aria-selected":r.isChecked(e.option),"aria-label":e.option.title,id:"option-"+r.id,onKeydown:n[3]||(n[3]=o.withModifiers((...f)=>r.onKeydown&&r.onKeydown(...f),["self"])),onFocus:n[4]||(n[4]=f=>t.$emit("onFocus",`option-${r.id}`))},[o.withDirectives(o.createVNode(s,{"disabled-focus":!0,kind:"ghost",class:"toggle-children",onClick:r.toggleChildrenVisibility},{default:o.withCtx(()=>[o.createVNode(l,{name:r.iconName},null,8,["name"])]),_:1},8,["onClick"]),[[o.vShow,r.hasVisibleChildren]]),o.createElementVNode("div",{onClick:n[1]||(n[1]=o.withModifiers((...f)=>r.onChange&&r.onChange(...f),["prevent"])),class:o.normalizeClass({disabled:e.option.isDisabled,"tree-select-option-label":!0,"tree-select-option-has-children":r.hasVisibleChildren,active:!e.showInput&&e.option.checked})},[o.withDirectives((o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),{ref:"component",tabindex:"-1","disable-focus":"","aria-label":e.option.title,name:r.actualName,value:e.option.id,id:"input"+r.id,"is-checked":r.isChecked(e.option),disabled:e.option.isDisabled,readonly:e.option.readonly,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",onInput:r.toggle},null,40,["aria-label","name","value","id","is-checked","disabled","readonly","onInput"])),[[o.vShow,e.showInput]]),e.isBookmarkable?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass("bookmarkable-option-title "+(e.isBookmarked?"bookmarked":""))},[r.hasChildren?(o.openBlock(),o.createElementBlock("span",tc,o.toDisplayString(e.option.title),1)):(o.openBlock(),o.createElementBlock("span",ec,[o.createTextVNode(o.toDisplayString(e.option.title)+" ",1),o.createVNode(l,{name:"star",onClick:n[0]||(n[0]=o.withModifiers(f=>t.$emit("toggle-bookmark",e.option),["stop","prevent"]))})]))],2)):e.htmlTitle?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[r.hasChildren?(o.openBlock(),o.createElementBlock("span",{key:1,class:"option-label",innerHTML:e.option.title},null,8,rc)):(o.openBlock(),o.createElementBlock("span",{key:0,class:"option-label",innerHTML:e.option.title},null,8,nc))],64)):(o.openBlock(),o.createElementBlock("span",ic,o.toDisplayString(e.option.title),1))],2),r.hasChildren?o.withDirectives((o.openBlock(),o.createBlock(h,{key:0},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.option.children,f=>o.withDirectives((o.openBlock(),o.createBlock(c,{key:f.value,option:f,name:e.name,"parent-auto-check":e.parentAutoCheck,"is-multiple":e.isMultiple,"show-input":e.showInput,onCheck:r.checkChildren,onToggleBookmark:n[2]||(n[2]=d=>t.$emit("toggle-bookmark",d)),uid:e.uid,"is-bookmarkable":e.isBookmarkable},null,8,["option","name","parent-auto-check","is-multiple","show-input","onCheck","uid","is-bookmarkable"])),[[o.vShow,f.visible]])),128))]),_:1},512)),[[o.vShow,r.hasVisibleChildren&&e.option.isChildrenVisible]]):o.createCommentVNode("",!0)],42,Qd)),[[p,a.showTooltip?e.option.title:""]])])}const ac=_e(Xd,[["render",oc]]);var Fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Oo={exports:{}};/*!***************************************************
|
|
22
|
+
top: ${i-p+f-5}px!important`;break}return d}getClassList(n){return n?bo[n]:bo.topCenter}}const Gt=new _o,cd=(t,n)=>{var a;Gt.getTooltipContainer()&&Gt.destroyTooltip();const e=Object.keys(n.modifiers)[0]||n.arg,i={title:((a=n.value)==null?void 0:a.title)||"",text:typeof n.value=="object"?n.value.text:n.value};Gt.createTooltip(t,i,e)},ud=(t,n)=>{const e=Gt.getId();if(n.getAttribute("aria-describedby")!==e)return;const i=Gt.getTooltipContainer(),a=n!==t.target&&!n.contains(t.target),r=i!==t.target&&!(i!=null&&i.contains(t.target));a&&r&&Gt.destroyTooltip(n)},$o=(t,n)=>{t.__tooltip_create=()=>cd(t,n),t.__tooltip_destroy=e=>ud(e,t),t.addEventListener("mouseenter",t.__tooltip_create),document.addEventListener("mousemove",t.__tooltip_destroy)},wo=t=>{Gt.destroyTooltip(t),t.removeEventListener("mouseenter",t.__tooltip_create),document.removeEventListener("mousemove",t.__tooltip_destroy)},nr={mounted(t,n){$o(t,n)},updated(t,n){wo(t),$o(t,n)},beforeUnmount(t){wo(t)}},z0="",fd={name:"IbSorting",props:{tooltipTitle:{type:String,default:""},hideSortingButton:{type:Boolean,default:!1},tooltipText:{type:String},tooltipPosition:{type:String},tooltipIconPosition:{type:String},tooltipIconSorting:{type:String},toggleTipTitle:{type:String},title:{type:String,default:""},sort:{type:String,default:null},view:{type:String,required:!0},disable:{type:Boolean,default:!1},tableName:{type:String,required:!0}},mounted(){this.$globalEvents.$on(`sorting:update:${this.tableName}`,t=>{this.$el.contains(t.$el)||(this.currentTypeSort=null)})},data(){return{isOpenToggleTip:!1,sortingTypes:dd,sortingTypesView:sd,currentTypeSort:this.sort}},methods:{clickHandler(){this.currentTypeSort?this.currentTypeSort===this.sortingTypes.TYPE_ASC?this.currentTypeSort=this.sortingTypes.TYPE_DESC:this.currentTypeSort=null:this.currentTypeSort=this.sortingTypes.TYPE_ASC,this.updateTypeSorting()},updateTypeSorting(){this.$globalEvents.$emit(`sorting:update:${this.tableName}`,this),this.$emit("update-sorting",this.currentTypeSort)}},computed:{iconType(){return this.currentTypeSort===this.sortingTypes.TYPE_ASC?"arrow-up":this.currentTypeSort===this.sortingTypes.TYPE_DESC?"arrow-down":this.view!==this.sortingTypesView.GRID_VIEW?"swap-vertical":null},sortingTooltipPosition(){return this.hasToggleTip?"bottomCenter":this.tooltipPosition},sortingTooltipContent(){var t;return this.hasToggleTip?lang("click_to_view_details",(t=this.langComponents)==null?void 0:t.COMPONENT_SYSTEM):this.tooltipContent},tooltipIconText(){var t,n,e;return this.currentTypeSort===this.sortingTypes.TYPE_ASC?lang("sort_descending",(t=this.langComponents)==null?void 0:t.COMPONENT_SELECT):this.currentTypeSort===this.sortingTypes.TYPE_DESC?lang("reset_sorting",(n=this.langComponents)==null?void 0:n.COMPONENT_SELECT):this.view!==this.sortingTypesView.GRID_VIEW?lang("sort_ascending",(e=this.langComponents)==null?void 0:e.COMPONENT_SELECT):""},tooltipContent(){return this.tooltipTitle.length?{title:this.tooltipTitle,text:this.tooltipText}:this.tooltipText},hasToggleTip(){return this.toggleTipTitle&&this.$slots.toggleTipBody&&this.$slots.toggleTipButtons}},directives:{Tooltip:nr},components:{IbIcon:Le,IbIconButton:ht,IbToggleTip:fo}},hd={class:"sorting-wrapper"},pd=["name"],md=["aria-label"];function gd(t,n,e,i,a,r){var p;const l=o.resolveComponent("ib-toggle-tip"),s=o.resolveComponent("ib-icon-button"),c=o.resolveComponent("ib-icon"),h=o.resolveDirective("tooltip");return o.openBlock(),o.createElementBlock("div",hd,[e.view===a.sortingTypesView.TABLE_VIEW?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["table-sorting-wrapper",{active:a.currentTypeSort,disabled:e.disable}])},[o.createElementVNode("div",null,[o.withDirectives((o.openBlock(),o.createElementBlock("button",{class:o.normalizeClass(["sorting-label",{"sorting-label-active":a.isOpenToggleTip&&r.hasToggleTip,"has-action":((p=e.tooltipText)==null?void 0:p.length)||r.hasToggleTip}]),type:"button",onClick:n[0]||(n[0]=f=>a.isOpenToggleTip=!a.isOpenToggleTip)},[o.createTextVNode(o.toDisplayString(e.title),1)],2)),[[h,r.sortingTooltipContent,r.sortingTooltipPosition]]),r.hasToggleTip?(o.openBlock(),o.createBlock(l,{key:0,position:"bottom-center","is-open":a.isOpenToggleTip,title:e.toggleTipTitle,onClose:n[1]||(n[1]=f=>a.isOpenToggleTip=!1)},{buttons:o.withCtx(()=>[o.renderSlot(t.$slots,"toggleTipButtons",{},void 0,!0)]),default:o.withCtx(()=>[o.renderSlot(t.$slots,"toggleTipBody",{},void 0,!0)]),_:3},8,["is-open","title"])):o.createCommentVNode("",!0)]),e.hideSortingButton?o.createCommentVNode("",!0):o.withDirectives((o.openBlock(),o.createBlock(s,{key:0,kind:"white",size:"s",onClick:r.clickHandler},{default:o.withCtx(()=>[o.createElementVNode("ion-icon",{name:r.iconType},null,8,pd)]),_:1},8,["onClick"])),[[h,r.tooltipIconText,e.tooltipIconPosition]])],2)):o.withDirectives((o.openBlock(),o.createElementBlock("button",{key:1,class:o.normalizeClass(["sorting-button",{active:a.currentTypeSort,disabled:e.disable}]),type:"button",onClick:n[2]||(n[2]=(...f)=>r.clickHandler&&r.clickHandler(...f)),"aria-label":e.sort},[o.createTextVNode(o.toDisplayString(e.title)+" ",1),r.iconType?(o.openBlock(),o.createBlock(c,{key:0,name:r.iconType},null,8,["name"])):o.createCommentVNode("",!0)],10,md)),[[h,e.tooltipText,e.tooltipPosition]])])}const yd=_e(fd,[["render",gd],["__scopeId","data-v-a4394881"]]),U0="",vd={name:"IbBreadcrumbs",props:{items:{type:Array,default:()=>[]},tooltipTextContext:{type:String}},computed:{last(){return this.items.length?this.items.length-1:null},initContextMenu(){return this.items.length>4},setItemsContextMenu(){return this.items.slice(0,-3)}},components:{IbIcon:Le,IbIconButton:ht,IbDropdownItem:Lr,IbDropdownList:tr,IbTooltip:an}},bd={"aria-label":"breadcrumb"},_d={class:"breadcrumb"},$d=["href"],wd={key:1},kd=["href"];function Cd(t,n,e,i,a,r){const l=o.resolveComponent("ib-icon"),s=o.resolveComponent("ib-tooltip"),c=o.resolveComponent("ib-icon-button"),h=o.resolveComponent("ib-dropdown-item"),p=o.resolveComponent("ib-dropdown-list");return o.openBlock(),o.createElementBlock("nav",bd,[o.createElementVNode("ul",_d,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.items,(f,d)=>(o.openBlock(),o.createElementBlock("li",{class:o.normalizeClass(["breadcrumb-item",d===r.last?"active":""]),"aria-current":"page",key:d},[d!==r.last&&d>e.items.length-4||d===0?(o.openBlock(),o.createElementBlock("a",{key:0,class:"ib-link",href:f.url},o.toDisplayString(f.title),9,$d)):o.createCommentVNode("",!0),d===r.last?(o.openBlock(),o.createElementBlock("p",wd,o.toDisplayString(f.title),1)):o.createCommentVNode("",!0),r.initContextMenu&&d===e.items.length-4?(o.openBlock(),o.createBlock(p,{key:2,horizontal:"center"},{trigger:o.withCtx(()=>[o.createVNode(c,{kind:"ghost"},{default:o.withCtx(()=>[o.createVNode(l,{name:"ellipsis-horizontal-sharp"}),e.tooltipTextContext?(o.openBlock(),o.createBlock(s,{key:0,text:e.tooltipTextContext},null,8,["text"])):o.createCommentVNode("",!0)]),_:1})]),body:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.setItemsContextMenu,(u,_)=>(o.openBlock(),o.createBlock(h,{key:_},{default:o.withCtx(()=>[o.createElementVNode("a",{class:"context-breadcrums",href:u.url},o.toDisplayString(u.title),9,kd)]),_:2},1024))),128))]),_:2},1024)):o.createCommentVNode("",!0),d!==r.last&&d>e.items.length-5||d===0?(o.openBlock(),o.createBlock(l,{key:3,name:"chevron-forward-outline"})):o.createCommentVNode("",!0)],2))),128))])])}const Od=_e(vd,[["render",Cd],["__scopeId","data-v-5ef772a9"]]),K0="",Ed={name:"IbLabel",props:{for:{type:String},required:{type:Boolean,default:!1},infoText:{type:String,default:""},tooltipPosition:{type:String}},mounted(){this.$globalEvents.$on(`label:disabled:${this.for}`,t=>{this.disabled=t})},data(){return{disabled:!1}},computed:{classes(){const t=["ib-label"];return this.infoText.length&&t.push("has-info-text"),this.disabled&&t.push("label-disabled"),t}},components:{IbIconButton:ht,IbIcon:Le},directives:{Tooltip:nr}},Sd=["for"],xd={key:0,class:"required"};function Td(t,n,e,i,a,r){const l=o.resolveComponent("ib-icon"),s=o.resolveComponent("ib-icon-button"),c=o.resolveDirective("tooltip");return o.openBlock(),o.createElementBlock("label",{class:o.normalizeClass(r.classes),for:e.for},[e.required?(o.openBlock(),o.createElementBlock("span",xd,"* ")):o.createCommentVNode("",!0),o.renderSlot(t.$slots,"default",{},void 0,!0),e.infoText.length?o.withDirectives((o.openBlock(),o.createBlock(s,{key:1,size:"xs",class:"info-button",kind:"ghost",type:"button"},{default:o.withCtx(()=>[o.createVNode(l,{name:"information-circle-outline"})]),_:1})),[[c,e.infoText,e.tooltipPosition]]):o.createCommentVNode("",!0)],10,Sd)}const wn=_e(Ed,[["render",Td],["__scopeId","data-v-524ad0fb"]]),Rr={text:"text",password:"password",email:"email",number:"number"},G0="",Nd={name:"IbInput",props:{type:{type:String,default:Rr.text,validator:t=>Object.keys(Rr).includes(t)},disabled:{type:Boolean,required:!1,default:!1},error:{type:Boolean,default:!1},errorMessage:{type:String,default:""},id:{type:[String],default(){return mt()}},debounce:{type:[Number,String]},showIcon:{type:Boolean,default:!1},showClearButton:{type:Boolean,default:!0},clearButtonMessage:{type:String,default:""},settingsButtonMessage:{type:String,default:""},showPasswordMessage:{type:String,default:""},hidePasswordMessage:{type:String,default:""},value:{type:[String,Number],default:""},modelValue:{type:[String,Number]},settingsVerticalPosition:{type:String,default:Qn.bottom},settingsHorizontalPosition:{type:String,default:$n.right},readonly:{type:Boolean,default:!1},autocomplete:{type:String}},data(){return{actualValue:this.modelValue||this.value,showPassword:!1}},mounted(){setTimeout(()=>{this.$globalEvents.$emit(`label:disabled:${this.id}`,this.disabled)},10)},methods:{toggleShowPassword(){this.showPassword=!this.showPassword},clearInput(){this.actualValue="",this.$emit("update:modelValue",this.actualValue),this.$emit("input",this.actualValue),this.$emit("clear")},onBlur(){this.$emit("blur",this.actualValue)},onFocus(){this.$emit("focus",this.actualValue)},onInput(){this.debounce?this.delayedInput(this.actualValue):(this.$emit("update:modelValue",this.actualValue),this.$emit("input",this.actualValue))},delayedInput(t){this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(()=>{this.$emit("update:modelValue",t),this.$emit("input",t)},this.debounce)},focus(){this.$refs.field.focus()}},computed:{hasSettings(){return!!this.$slots.settings},classes(){const t=["ib-input"];return this.hasErrorState&&t.push("ib-error"),this.showIcon&&t.push("ib-input-has-icon"),t},attrs(){let t=Ar({...this.$attrs},["onInput","onBlur"]);return t.type=this.type===Rr.password?this.showPassword?"text":"password":this.type,t},hasErrorState(){return this.error||this.errorMessage.length}},watch:{value(t){this.actualValue=t},modelValue(t){this.actualValue=t},disabled(t){this.$globalEvents.$emit(`label:disabled:${this.id}`,t)}},emits:["input","blur","focus","clear","update:modelValue",`label:disabled:${globalThis==null?void 0:globalThis.id}`],components:{IbAlert:qt,IbIconButton:ht,IbIcon:Le,IbDropdown:er},inheritAttrs:!1},Ad=["aria-invalid","readonly","disabled","id","autocomplete"],Dd={class:"settings-wrapper"};function Id(t,n,e,i,a,r){var p,f;const l=o.resolveComponent("ib-alert"),s=o.resolveComponent("ib-icon"),c=o.resolveComponent("ib-icon-button"),h=o.resolveComponent("ib-dropdown");return o.openBlock(),o.createElementBlock("div",null,[e.errorMessage?(o.openBlock(),o.createBlock(l,{key:0},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.errorMessage),1)]),_:1})):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["ib-input-wrapper",{"has-settings":r.hasSettings}])},[e.showIcon?(o.openBlock(),o.createBlock(s,{key:0,class:"icon-search",name:"search-outline"})):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("input",o.mergeProps(r.attrs,{"onUpdate:modelValue":n[0]||(n[0]=d=>a.actualValue=d),ref:"field","aria-invalid":!!r.hasErrorState,readonly:e.readonly,disabled:e.disabled,id:e.id,autocomplete:e.autocomplete,class:r.classes,onInput:n[1]||(n[1]=d=>r.onInput(d)),onBlur:n[2]||(n[2]=d=>r.onBlur(d)),onFocus:n[3]||(n[3]=d=>r.onFocus(d))}),null,16,Ad),[[o.vModelDynamic,a.actualValue]]),e.type!=="password"&&e.showClearButton?o.withDirectives((o.openBlock(),o.createBlock(c,{key:1,kind:"ghost",class:"button-clear",disabled:e.readonly||e.disabled,"help-text":e.clearButtonMessage,"prevent-default":"",type:"button",onClick:r.clearInput,onKeypress:o.withKeys(r.clearInput,["enter"])},{default:o.withCtx(()=>[o.createVNode(s,{name:"close-outline"})]),_:1},8,["disabled","help-text","onClick","onKeypress"])),[[o.vShow,(p=a.actualValue)==null?void 0:p.toString().length]]):o.createCommentVNode("",!0),e.type==="password"?o.withDirectives((o.openBlock(),o.createBlock(c,{key:2,kind:"ghost",class:"toggle-password","prevent-default":"",type:"button",disabled:e.readonly||e.disabled,"help-text":a.showPassword?e.hidePasswordMessage:e.showPasswordMessage,onClick:o.withModifiers(r.toggleShowPassword,["prevent"])},{default:o.withCtx(()=>[o.createVNode(s,{name:a.showPassword?"eye-off-outline":"eye-outline"},null,8,["name"])]),_:1},8,["disabled","help-text","onClick"])),[[o.vShow,(f=a.actualValue)==null?void 0:f.length]]):o.createCommentVNode("",!0),r.hasSettings?(o.openBlock(),o.createBlock(h,{key:3,class:"settings-dropdown-wrapper",horizontal:e.settingsHorizontalPosition,vertical:e.settingsVerticalPosition},{trigger:o.withCtx(()=>[o.createVNode(c,{"prevent-default":"","help-text":e.settingsButtonMessage,class:"options-trigger",kind:"ghost"},{default:o.withCtx(()=>[o.createVNode(s,{name:"options"})]),_:1},8,["help-text"])]),body:o.withCtx(()=>[o.createElementVNode("div",Dd,[o.renderSlot(t.$slots,"settings",{},void 0,!0)])]),_:3},8,["horizontal","vertical"])):o.createCommentVNode("",!0)],2)])}const jr=_e(Nd,[["render",Id],["__scopeId","data-v-610352e2"]]),W0="",Pd={name:"IbCheckbox",model:{event:"input"},props:{label:String,error:{type:[Boolean,null],default:!1},name:String,id:{type:String,default(){return mt()}},value:{default:1},modelValue:{type:Boolean},isChecked:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},disableFocus:{type:Boolean,default:!1},required:{type:Boolean,default:!1},labelPosition:{type:String,default:"right"}},watch:{isChecked(t){this.checked=t},modelValue(t){this.$emit("update:modelValue",this.modelValue),this.checked=t}},data(){return{checked:this.modelValue?this.modelValue:this.isChecked}},methods:{onChange(t){this.disabled||this.readonly||(this.checked=!this.checked,this.$emit("update:modelValue",this.checked),this.$emit("input",this.checked))}},computed:{classes(){return{"ib-checkbox":!0,"ib-has-error":this.error,"ib-checkbox-filled":this.checked,"ib-checkbox-disabled":this.disabled,"ib-checkbox-readonly":this.readonly,"ib-checkbox-indeterminate":this.indeterminate}},indeterminate(){return this.isChecked===null},attrs(){const t={...Ar({...this.$attrs})};return delete t.class,t.class=this.classes,t}},components:{IbIcon:Le},inheritAttrs:!1},Md=["aria-checked"],Bd=["for","tabindex"],Ld=["name","id","value","disabled","required"],Rd={class:"ib-checkbox-body"},jd={key:0,class:"required"},Vd={class:"ib-checkbox-input"},Fd={key:1,class:"ib-checkbox-label"},qd={key:0,class:"required"};function Hd(t,n,e,i,a,r){var s;const l=o.resolveComponent("ib-icon");return o.openBlock(),o.createElementBlock("div",{role:"checkbox",class:o.normalizeClass(["ib-checkbox-wrapper",this.$attrs.class]),"aria-checked":!!a.checked},[o.createElementVNode("label",o.mergeProps(r.attrs,{for:e.id,tabindex:e.disabled|e.disableFocus?-1:0,onClick:n[2]||(n[2]=o.withModifiers((...c)=>r.onChange&&r.onChange(...c),["prevent","stop"])),onKeypress:n[3]||(n[3]=o.withModifiers((...c)=>r.onChange&&r.onChange(...c),["prevent"]))}),[o.withDirectives(o.createElementVNode("input",{tabindex:"-1",type:"checkbox",name:e.name,id:e.id,value:e.value,disabled:e.disabled,required:e.required,"onUpdate:modelValue":n[0]||(n[0]=c=>a.checked=c),onClick:n[1]||(n[1]=(...c)=>r.onChange&&r.onChange(...c))},null,8,Ld),[[o.vModelCheckbox,a.checked]]),o.createElementVNode("div",Rd,[e.labelPosition==="left"&&e.label.length?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["ib-checkbox-label",{"ib-checkbox-label-left":e.labelPosition==="left"}])},[e.required?(o.openBlock(),o.createElementBlock("span",jd,"*")):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(e.label),1)],2)):o.createCommentVNode("",!0),o.createElementVNode("span",Vd,[o.withDirectives(o.createVNode(l,{name:"checkmark-sharp"},null,512),[[o.vShow,a.checked&&!r.indeterminate]]),o.withDirectives(o.createVNode(l,{class:o.normalizeClass("checkbox-undeterminate-icon"),name:"remove-sharp"},null,512),[[o.vShow,r.indeterminate]])]),e.labelPosition==="right"&&((s=e.label)!=null&&s.length)?(o.openBlock(),o.createElementBlock("span",Fd,[e.required?(o.openBlock(),o.createElementBlock("span",qd,"*")):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(e.label),1)])):o.createCommentVNode("",!0)])],16,Bd)],10,Md)}const Vr=_e(Pd,[["render",Hd],["__scopeId","data-v-d0930a45"]]),Y0="",zd={name:"IbToggle",model:{prop:"isChecked",event:"input"},props:{isChecked:{type:Boolean,required:!1},id:{type:String,default:()=>mt()},disabled:{type:Boolean,default:!1},name:{type:String,default:"active"},label:{type:String,default:""},error:{type:Boolean,default:!1},labelPosition:{type:String,default:"right"},helpMessage:{type:String,default:""},helpMessageOff:{type:String,default:""}},watch:{isChecked(t){this.checked=t}},data(){return{checked:this.isChecked}},methods:{onChange(){this.disabled||(this.checked=!this.checked,this.$emit("input",this.checked))}},computed:{classes(){return{"ib-toggle-container":!0,"has-error":this.error,"toggle-on":this.checked,"toggle-disabled":this.disabled,"label-position-left":this.labelPosition==="left"}}},components:{IbIcon:Le,IbTooltip:an}},Ud=["aria-checked","tabindex"],Kd={class:"toggle-wrapper",ref:"wrapper"},Gd={class:"toggle",ref:"toggle"},Wd=["name","checked","id","disabled"],Yd=o.createElementVNode("span",{class:"toggle-slider round"},null,-1),Zd={key:0,class:"toggle-label"};function Jd(t,n,e,i,a,r){const l=o.resolveComponent("ib-icon"),s=o.resolveComponent("ib-tooltip");return o.openBlock(),o.createElementBlock("label",{role:"switch","aria-checked":a.checked,tabindex:e.disabled?-1:0,class:o.normalizeClass(r.classes),onKeypress:[n[2]||(n[2]=o.withKeys(o.withModifiers((...c)=>r.onChange&&r.onChange(...c),["prevent"]),["space"])),n[3]||(n[3]=o.withKeys(o.withModifiers((...c)=>r.onChange&&r.onChange(...c),["prevent"]),["enter"]))]},[o.createElementVNode("div",Kd,[o.createElementVNode("div",Gd,[o.createElementVNode("input",{tabindex:"-1",type:"checkbox",value:"1",name:e.name,checked:a.checked,id:e.id,disabled:e.disabled,onClick:n[0]||(n[0]=(...c)=>r.onChange&&r.onChange(...c)),onInput:n[1]||(n[1]=o.withModifiers(()=>{},["stop"]))},null,40,Wd),Yd,o.createVNode(l,{class:"checked-icon",name:"checkmark"}),o.createVNode(l,{class:"unchecked-icon",name:"close"})],512)],512),e.label.length?(o.openBlock(),o.createElementBlock("span",Zd,o.toDisplayString(e.label),1)):o.createCommentVNode("",!0),e.helpMessage.length?(o.openBlock(),o.createBlock(s,{key:1,text:a.checked?e.helpMessage:e.helpMessageOff.length?e.helpMessageOff:e.helpMessage},null,8,["text"])):o.createCommentVNode("",!0)],42,Ud)}const ko=_e(zd,[["render",Jd]]);function Co(t){return t.scrollHeight>t.clientHeight}const Z0="",Xd={name:"select-option",props:{option:{type:Object},name:String,parentAutoCheck:{type:Boolean,default:!1},isMultiple:{type:Boolean,default:!0},uid:{type:String,default:""},onlyEndNodes:{type:Boolean,default:!1},htmlTitle:{type:Boolean,default:!1},showInput:{type:Boolean,default:!0},isBookmarkable:{type:Boolean,default:!1},isBookmarked:{type:Boolean,default:!1},isToggle:{type:Boolean,default:!1}},mounted(){this.option.hasOwnProperty("children")&&this.option.children&&this.checkParent(),this.option.showTooltipByDefault&&(this.showTooltip=!0)},updated(){this.$nextTick(()=>{this.option.showTooltipByDefault?this.showTooltip=!0:Co(this.$el.querySelector(".option-label"))&&(this.showTooltip=!0)})},data(){return{showTooltip:!1}},methods:{onKeydown(t){t.keyCode===ho&&(t.preventDefault(),this.onChange()),this.hasVisibleChildren&&(t.keyCode===hs&&(this.option.isChildrenVisible=!0),t.keyCode===fs&&(this.option.isChildrenVisible=!1))},onChange(){var t,n;!this.isMultiple&&!this.isChecked(this.option)&&((t=this.$refs.component)==null||t.onChange()),this.isMultiple&&((n=this.$refs.component)==null||n.onChange())},toggle(t,n=!0){this.check(this.option,t,!0,n)},check(t,n,e,i){this.$emit("check",t,n,e),i&&t.children&&t.children.forEach(a=>{this.check(a,n,!1,!0)})},toggleChildrenVisibility(){this.option.isChildrenVisible=!this.option.isChildrenVisible},checkChildren(t,n,e){e&&this.isMultiple&&this.$nextTick(()=>{this.checkParent()}),this.$emit("check",t,n,!1)},checkParent(){const t=this.option.children.filter(e=>e.checked).length,n=t>=this.option.children.length;(!this.option.checked&&n&&this.parentAutoCheck||this.option.checked&&!n)&&this.toggle(!this.option.checked,!1)},calculateChildren(t,n,e=!1){let i=0;return t.children&&t.children.forEach(a=>{(!n||n(a))&&i++,e&&(i+=this.calculateChildren(a,n,e))}),i},isChecked(t){if(this.hasChildren)if(this.childrenSelectedCount){if(this.childrenSelectedCount>0&&this.countOfAllChildren>this.childrenSelectedCount)return null}else return!1;return t.checked?!0:t.isIndeterminate?null:!1}},computed:{component(){return this.isMultiple&&this.isToggle?ko:Vr},hasChildren(){return!!(this.option.children&&this.option.children.length)},hasVisibleChildren(){return this.calculateChildren(this.option,t=>t.visible)},iconName(){return this.option.isChildrenVisible?"chevron-down":"chevron-forward"},id(){return this.uid+"_"+this.option.id},actualName(){return this.onlyEndNodes&&this.option.children&&this.option.children.length?"":this.name},childrenSelectedCount(){return this.calculateChildren(this.option,t=>t.checked,!0)},countOfAllChildren(){return this.calculateChildren(this.option,()=>!0,!0)}},components:{IbIcon:Le,List:Br,IbIconButton:ht},directives:{Tooltip:nr}},Qd=["aria-selected","aria-label","id"],ec={key:0,class:"option-label"},tc={key:1,class:"option-label"},nc=["innerHTML"],rc=["innerHTML"],ic={key:2,class:"option-label"};function oc(t,n,e,i,a,r){const l=o.resolveComponent("ib-icon"),s=o.resolveComponent("ib-icon-button"),c=o.resolveComponent("select-option"),h=o.resolveComponent("list"),p=o.resolveDirective("tooltip");return o.openBlock(),o.createElementBlock("li",null,[o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["tree-select-option",{"tree-select-option-checked":r.isChecked(e.option),"tree-select-option-margin":r.hasVisibleChildren,active:e.option.isChildrenVisible,"is-multiple":e.isMultiple,"is-not-multiple":!e.isMultiple,"tree-select-option-toggle":this.isToggle&&this.isMultiple}]),tabindex:"0",role:"option","aria-selected":r.isChecked(e.option),"aria-label":e.option.title,id:"option-"+r.id,onKeydown:n[3]||(n[3]=o.withModifiers((...f)=>r.onKeydown&&r.onKeydown(...f),["self"])),onFocus:n[4]||(n[4]=f=>t.$emit("onFocus",`option-${r.id}`))},[o.withDirectives(o.createVNode(s,{"disabled-focus":!0,kind:"ghost",class:"toggle-children",onClick:r.toggleChildrenVisibility},{default:o.withCtx(()=>[o.createVNode(l,{name:r.iconName},null,8,["name"])]),_:1},8,["onClick"]),[[o.vShow,r.hasVisibleChildren]]),o.createElementVNode("div",{onClick:n[1]||(n[1]=o.withModifiers((...f)=>r.onChange&&r.onChange(...f),["prevent"])),class:o.normalizeClass({disabled:e.option.isDisabled,"tree-select-option-label":!0,"tree-select-option-has-children":r.hasVisibleChildren,active:!e.showInput&&e.option.checked})},[o.withDirectives((o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),{ref:"component",tabindex:"-1","disable-focus":"","aria-label":e.option.title,name:r.actualName,value:e.option.id,id:"input"+r.id,"is-checked":r.isChecked(e.option),disabled:e.option.isDisabled,readonly:e.option.readonly,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",onInput:r.toggle},null,40,["aria-label","name","value","id","is-checked","disabled","readonly","onInput"])),[[o.vShow,e.showInput]]),e.isBookmarkable?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass("bookmarkable-option-title "+(e.isBookmarked?"bookmarked":""))},[r.hasChildren?(o.openBlock(),o.createElementBlock("span",tc,o.toDisplayString(e.option.title),1)):(o.openBlock(),o.createElementBlock("span",ec,[o.createTextVNode(o.toDisplayString(e.option.title)+" ",1),o.createVNode(l,{name:"star",onClick:n[0]||(n[0]=o.withModifiers(f=>t.$emit("toggle-bookmark",e.option),["stop","prevent"]))})]))],2)):e.htmlTitle?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[r.hasChildren?(o.openBlock(),o.createElementBlock("span",{key:1,class:"option-label",innerHTML:e.option.title},null,8,rc)):(o.openBlock(),o.createElementBlock("span",{key:0,class:"option-label",innerHTML:e.option.title},null,8,nc))],64)):(o.openBlock(),o.createElementBlock("span",ic,o.toDisplayString(e.option.title),1))],2),r.hasChildren?o.withDirectives((o.openBlock(),o.createBlock(h,{key:0},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.option.children,f=>o.withDirectives((o.openBlock(),o.createBlock(c,{key:f.value,option:f,name:e.name,"parent-auto-check":e.parentAutoCheck,"is-multiple":e.isMultiple,"show-input":e.showInput,onCheck:r.checkChildren,onToggleBookmark:n[2]||(n[2]=d=>t.$emit("toggle-bookmark",d)),uid:e.uid,"is-bookmarkable":e.isBookmarkable},null,8,["option","name","parent-auto-check","is-multiple","show-input","onCheck","uid","is-bookmarkable"])),[[o.vShow,f.visible]])),128))]),_:1},512)),[[o.vShow,r.hasVisibleChildren&&e.option.isChildrenVisible]]):o.createCommentVNode("",!0)],42,Qd)),[[p,a.showTooltip?e.option.isDisabled?e.option.disableTooltip:e.option.title:""]])])}const ac=_e(Xd,[["render",oc]]);var Fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Oo={exports:{}};/*!***************************************************
|
|
23
23
|
* mark.js v8.11.1
|
|
24
24
|
* https://markjs.io/
|
|
25
25
|
* Copyright (c) 2014–2018, Julian Kühnel
|
|
@@ -86,7 +86,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
86
86
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jf(t,n){if(t){if(typeof t=="string")return ta(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ta(t,n)}}function ta(t,n){(n==null||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}var Vf=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function ni(t,n,e){if(n=n||{},!(!t.country&&!t.countryCallingCode)){e=new et(e),e.selectNumberingPlan(t.country,t.countryCallingCode);var i=n.v2?t.nationalNumber:t.phone;if(Dt(i,e.nationalNumberPattern())){if(ri(i,"FIXED_LINE",e))return e.type("MOBILE")&&e.type("MOBILE").pattern()===""||!e.type("MOBILE")||ri(i,"MOBILE",e)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE";for(var a=Rf(Vf),r;!(r=a()).done;){var l=r.value;if(ri(i,l,e))return l}}}}function ri(t,n,e){return n=e.type(n),!n||!n.pattern()||n.possibleLengths()&&n.possibleLengths().indexOf(t.length)<0?!1:Dt(t,n.pattern())}function Ff(t,n,e){if(n=n||{},e=new et(e),e.selectNumberingPlan(t.country,t.countryCallingCode),e.hasTypes())return ni(t,n,e.metadata)!==void 0;var i=n.v2?t.nationalNumber:t.phone;return Dt(i,e.nationalNumberPattern())}function qf(t,n,e){var i=new et(e),a=i.getCountryCodesForCallingCode(t);return a?a.filter(function(r){return Hf(n,r,e)}):[]}function Hf(t,n,e){var i=new et(e);return i.selectNumberingPlan(n),i.numberingPlan.possibleLengths().indexOf(t.length)>=0}function zf(t){return t.replace(new RegExp("[".concat(sr,"]+"),"g")," ").trim()}var Uf=/(\$\d)/;function Kf(t,n,e){var i=e.useInternationalFormat,a=e.withNationalPrefix;e.carrierCode,e.metadata;var r=t.replace(new RegExp(n.pattern()),i?n.internationalFormat():a&&n.nationalPrefixFormattingRule()?n.format().replace(Uf,n.nationalPrefixFormattingRule()):n.format());return i?zf(r):r}var Gf=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function Wf(t,n,e){var i=new et(e);if(i.selectNumberingPlan(t,n),i.defaultIDDPrefix())return i.defaultIDDPrefix();if(Gf.test(i.IDDPrefix()))return i.IDDPrefix()}function Yf(t){var n=t.number,e=t.ext;if(!n)return"";if(n[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(n).concat(e?";ext="+e:"")}function Zf(t,n){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=Jf(t))||n&&t&&typeof t.length=="number"){e&&(t=e);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
87
87
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jf(t,n){if(t){if(typeof t=="string")return na(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return na(t,n)}}function na(t,n){(n==null||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function ra(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),e.push.apply(e,i)}return e}function ia(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?ra(Object(e),!0).forEach(function(i){Xf(t,i,e[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ra(Object(e)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))})}return t}function Xf(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var oa={formatExtension:function(t,n,e){return"".concat(t).concat(e.ext()).concat(n)}};function Qf(t,n,e,i){if(e?e=ia(ia({},oa),e):e=oa,i=new et(i),t.country&&t.country!=="001"){if(!i.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));i.country(t.country)}else if(t.countryCallingCode)i.selectNumberingPlan(t.countryCallingCode);else return t.phone||"";var a=i.countryCallingCode(),r=e.v2?t.nationalNumber:t.phone,l;switch(n){case"NATIONAL":return r?(l=fr(r,t.carrierCode,"NATIONAL",i,e),ii(l,t.ext,i,e.formatExtension)):"";case"INTERNATIONAL":return r?(l=fr(r,null,"INTERNATIONAL",i,e),l="+".concat(a," ").concat(l),ii(l,t.ext,i,e.formatExtension)):"+".concat(a);case"E.164":return"+".concat(a).concat(r);case"RFC3966":return Yf({number:"+".concat(a).concat(r),ext:t.ext});case"IDD":if(!e.fromCountry)return;var s=th(r,t.carrierCode,a,e.fromCountry,i);return ii(s,t.ext,i,e.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(n,'"'))}}function fr(t,n,e,i,a){var r=eh(i.formats(),t);return r?Kf(t,r,{useInternationalFormat:e==="INTERNATIONAL",withNationalPrefix:!(r.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&a&&a.nationalPrefix===!1),carrierCode:n,metadata:i}):t}function eh(t,n){for(var e=Zf(t),i;!(i=e()).done;){var a=i.value;if(a.leadingDigitsPatterns().length>0){var r=a.leadingDigitsPatterns()[a.leadingDigitsPatterns().length-1];if(n.search(r)!==0)continue}if(Dt(n,a.pattern()))return a}}function ii(t,n,e,i){return n?i(t,n,e):t}function th(t,n,e,i,a){var r=ei(i,a.metadata);if(r===e){var l=fr(t,n,"NATIONAL",a);return e==="1"?e+" "+l:l}var s=Wf(i,void 0,a.metadata);if(s)return"".concat(s," ").concat(e," ").concat(fr(t,null,"INTERNATIONAL",a))}function aa(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),e.push.apply(e,i)}return e}function la(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?aa(Object(e),!0).forEach(function(i){nh(t,i,e[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):aa(Object(e)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))})}return t}function nh(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function rh(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function sa(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function ih(t,n,e){return n&&sa(t.prototype,n),e&&sa(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var oh=function(){function t(n,e,i){if(rh(this,t),!n)throw new TypeError("`country` or `countryCallingCode` not passed");if(!e)throw new TypeError("`nationalNumber` not passed");if(!i)throw new TypeError("`metadata` not passed");var a=lh(n,i),r=a.country,l=a.countryCallingCode;this.country=r,this.countryCallingCode=l,this.nationalNumber=e,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return i}}return ih(t,[{key:"setExt",value:function(n){this.ext=n}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:qf(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return Lf(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return Ff(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var n=new et(this.getMetadata());return n.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(n){return this.number===n.number&&this.ext===n.ext}},{key:"getType",value:function(){return ni(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(n,e){return Qf(this,n,e?la(la({},e),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(n){return this.format("NATIONAL",n)}},{key:"formatInternational",value:function(n){return this.format("INTERNATIONAL",n)}},{key:"getURI",value:function(n){return this.format("RFC3966",n)}}]),t}(),ah=function(t){return/^[A-Z]{2}$/.test(t)};function lh(t,n){var e,i,a=new et(n);return ah(t)?(e=t,a.selectNumberingPlan(e),i=a.countryCallingCode()):i=t,{country:e,countryCallingCode:i}}var sh=new RegExp("(["+gt+"])");function dh(t,n,e,i){if(n){var a=new et(i);a.selectNumberingPlan(n,e);var r=new RegExp(a.IDDPrefix());if(t.search(r)===0){t=t.slice(t.match(r)[0].length);var l=t.match(sh);if(!(l&&l[1]!=null&&l[1].length>0&&l[1]==="0"))return t}}}function ch(t,n){if(t&&n.numberingPlan.nationalPrefixForParsing()){var e=new RegExp("^(?:"+n.numberingPlan.nationalPrefixForParsing()+")"),i=e.exec(t);if(i){var a,r,l=i.length-1,s=l>0&&i[l];if(n.nationalPrefixTransformRule()&&s)a=t.replace(e,n.nationalPrefixTransformRule()),l>1&&(r=i[1]);else{var c=i[0];a=t.slice(c.length),s&&(r=i[1])}var h;if(s){var p=t.indexOf(i[1]),f=t.slice(0,p);f===n.numberingPlan.nationalPrefix()&&(h=n.numberingPlan.nationalPrefix())}else h=i[0];return{nationalNumber:a,nationalPrefix:h,carrierCode:r}}}return{nationalNumber:t}}function oi(t,n){var e=ch(t,n),i=e.carrierCode,a=e.nationalNumber;if(a!==t){if(!uh(t,a,n))return{nationalNumber:t};if(n.possibleLengths()&&!fh(a,n))return{nationalNumber:t}}return{nationalNumber:a,carrierCode:i}}function uh(t,n,e){return!(Dt(t,e.nationalNumberPattern())&&!Dt(n,e.nationalNumberPattern()))}function fh(t,n){switch(ti(t,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function hh(t,n,e,i){var a=n?ei(n,i):e;if(t.indexOf(a)===0){i=new et(i),i.selectNumberingPlan(n,e);var r=t.slice(a.length),l=oi(r,i),s=l.nationalNumber,c=oi(t,i),h=c.nationalNumber;if(!Dt(h,i.nationalNumberPattern())&&Dt(s,i.nationalNumberPattern())||ti(h,i)==="TOO_LONG")return{countryCallingCode:a,number:r}}return{number:t}}function ph(t,n,e,i){if(!t)return{};var a;if(t[0]!=="+"){var r=dh(t,n,e,i);if(r&&r!==t)a=!0,t="+"+r;else{if(n||e){var l=hh(t,n,e,i),s=l.countryCallingCode,c=l.number;if(s)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:s,number:c}}return{number:t}}}if(t[1]==="0")return{};i=new et(i);for(var h=2;h-1<=nf&&h<=t.length;){var p=t.slice(1,h);if(i.hasCallingCode(p))return i.selectNumberingPlan(p),{countryCallingCodeSource:a?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:p,number:t.slice(h)};h++}return{}}function mh(t,n){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=gh(t))||n&&t&&typeof t.length=="number"){e&&(t=e);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
88
88
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gh(t,n){if(t){if(typeof t=="string")return da(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return da(t,n)}}function da(t,n){(n==null||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function yh(t,n){var e=n.countries,i=n.defaultCountry,a=n.metadata;a=new et(a);for(var r=[],l=mh(e),s;!(s=l()).done;){var c=s.value;if(a.country(c),a.leadingDigits()){if(t&&t.search(a.leadingDigits())===0)return c}else if(ni({phone:t,country:c},void 0,a.metadata))if(i){if(c===i)return c;r.push(c)}else return c}if(r.length>0)return r[0]}function vh(t,n){var e=n.nationalNumber,i=n.defaultCountry,a=n.metadata,r=a.getCountryCodesForCallingCode(t);if(r)return r.length===1?r[0]:yh(e,{countries:r,defaultCountry:i,metadata:a.metadata})}var ca="+",bh="[\\-\\.\\(\\)]?",ua="(["+gt+"]|"+bh+")",_h="^\\"+ca+ua+"*["+gt+"]"+ua+"*$",$h=new RegExp(_h,"g"),ai=gt,wh="["+ai+"]+((\\-)*["+ai+"])*",kh="a-zA-Z",Ch="["+kh+"]+((\\-)*["+ai+"])*",Oh="^("+wh+"\\.)*"+Ch+"\\.?$",Eh=new RegExp(Oh,"g"),fa="tel:",li=";phone-context=",Sh=";isub=";function xh(t){var n=t.indexOf(li);if(n<0)return null;var e=n+li.length;if(e>=t.length)return"";var i=t.indexOf(";",e);return i>=0?t.substring(e,i):t.substring(e)}function Th(t){return t===null?!0:t.length===0?!1:$h.test(t)||Eh.test(t)}function Nh(t,n){var e=n.extractFormattedPhoneNumber,i=xh(t);if(!Th(i))throw new At("NOT_A_NUMBER");var a;if(i===null)a=e(t)||"";else{a="",i.charAt(0)===ca&&(a+=i);var r=t.indexOf(fa),l;r>=0?l=r+fa.length:l=0;var s=t.indexOf(li);a+=t.substring(l,s)}var c=a.indexOf(Sh);if(c>0&&(a=a.substring(0,c)),a!=="")return a}var Ah=250,Dh=new RegExp("["+Xr+gt+"]"),Ih=new RegExp("[^"+gt+"#]+$");function Ph(t,n,e){if(n=n||{},e=new et(e),n.defaultCountry&&!e.hasCountry(n.defaultCountry))throw n.v2?new At("INVALID_COUNTRY"):new Error("Unknown country: ".concat(n.defaultCountry));var i=Bh(t,n.v2,n.extract),a=i.number,r=i.ext,l=i.error;if(!a){if(n.v2)throw l==="TOO_SHORT"?new At("TOO_SHORT"):new At("NOT_A_NUMBER");return{}}var s=Rh(a,n.defaultCountry,n.defaultCallingCode,e),c=s.country,h=s.nationalNumber,p=s.countryCallingCode,f=s.countryCallingCodeSource,d=s.carrierCode;if(!e.hasSelectedNumberingPlan()){if(n.v2)throw new At("INVALID_COUNTRY");return{}}if(!h||h.length<Jr){if(n.v2)throw new At("TOO_SHORT");return{}}if(h.length>tf){if(n.v2)throw new At("TOO_LONG");return{}}if(n.v2){var u=new oh(p,h,e.metadata);return c&&(u.country=c),d&&(u.carrierCode=d),r&&(u.ext=r),u.__countryCallingCodeSource=f,u}var _=(n.extended?e.hasSelectedNumberingPlan():c)?Dt(h,e.nationalNumberPattern()):!1;return n.extended?{country:c,countryCallingCode:p,carrierCode:d,valid:_,possible:_?!0:!!(n.extended===!0&&e.possibleLengths()&&ea(h,e)),phone:h,ext:r}:_?Lh(c,h,r):{}}function Mh(t,n,e){if(t){if(t.length>Ah){if(e)throw new At("TOO_LONG");return}if(n===!1)return t;var i=t.search(Dh);if(!(i<0))return t.slice(i).replace(Ih,"")}}function Bh(t,n,e){var i=Nh(t,{extractFormattedPhoneNumber:function(r){return Mh(r,e,n)}});if(!i)return{};if(!Ef(i))return Sf(i)?{error:"TOO_SHORT"}:{};var a=xf(i);return a.ext?a:{number:i}}function Lh(t,n,e){var i={country:t,phone:n};return e&&(i.ext=e),i}function Rh(t,n,e,i){var a=ph(Jo(t),n,e,i.metadata),r=a.countryCallingCodeSource,l=a.countryCallingCode,s=a.number,c;if(l)i.selectNumberingPlan(l);else if(s&&(n||e))i.selectNumberingPlan(n,e),n&&(c=n),l=e||ei(n,i.metadata);else return{};if(!s)return{countryCallingCodeSource:r,countryCallingCode:l};var h=oi(Jo(s),i),p=h.nationalNumber,f=h.carrierCode,d=vh(l,{nationalNumber:p,defaultCountry:n,metadata:i});return d&&(c=d,d==="001"||i.country(c)),{country:c,countryCallingCode:l,countryCallingCodeSource:r,nationalNumber:p,carrierCode:f}}function ha(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),e.push.apply(e,i)}return e}function pa(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?ha(Object(e),!0).forEach(function(i){jh(t,i,e[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ha(Object(e)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))})}return t}function jh(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function Vh(t,n,e){return Ph(t,pa(pa({},n),{},{v2:!0}),e)}function ma(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),e.push.apply(e,i)}return e}function Fh(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?ma(Object(e),!0).forEach(function(i){qh(t,i,e[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ma(Object(e)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))})}return t}function qh(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function Hh(t,n){return Gh(t)||Kh(t,n)||Uh(t,n)||zh()}function zh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
89
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uh(t,n){if(t){if(typeof t=="string")return ga(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ga(t,n)}}function ga(t,n){(n==null||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Kh(t,n){var e=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(e!=null){var i=[],a=!0,r=!1,l,s;try{for(e=e.call(t);!(a=(l=e.next()).done)&&(i.push(l.value),!(n&&i.length===n));a=!0);}catch(c){r=!0,s=c}finally{try{!a&&e.return!=null&&e.return()}finally{if(r)throw s}}return i}}function Gh(t){if(Array.isArray(t))return t}function Wh(t){var n=Array.prototype.slice.call(t),e=Hh(n,4),i=e[0],a=e[1],r=e[2],l=e[3],s,c,h;if(typeof i=="string")s=i;else throw new TypeError("A text for parsing must be a string.");if(!a||typeof a=="string")l?(c=r,h=l):(c=void 0,h=r),a&&(c=Fh({defaultCountry:a},c));else if(dr(a))r?(c=a,h=r):h=a;else throw new Error("Invalid second argument: ".concat(a));return{text:s,options:c,metadata:h}}function ya(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),e.push.apply(e,i)}return e}function va(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?ya(Object(e),!0).forEach(function(i){Yh(t,i,e[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ya(Object(e)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))})}return t}function Yh(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function Zh(t,n,e){n&&n.defaultCountry&&!bf(n.defaultCountry,e)&&(n=va(va({},n),{},{defaultCountry:void 0}));try{return Vh(t,n,e)}catch(i){if(!(i instanceof At))throw i}}function Jh(){var t=Wh(arguments),n=t.text,e=t.options,i=t.metadata;return Zh(n,e,i)}function si(){return Wu(Jh,arguments)}const Xh={beforeMount(t,n,e){if(typeof n.value!="function"){const i=e.context.name;let a=`[Vue-click-outside:] provided expression ${n.expression} is not a function, but has to be`;i&&(a+=`Found in component ${i}`),console.warn(a)}t.clickOutsideEvent=function(i){const a=i.composedPath?i.composedPath():i.path;t===i.target||t.contains(i.target)||a.includes(t)||n.value(i,t)},document.body.addEventListener("click",t.clickOutsideEvent)},unmounted(t){document.body.removeEventListener("click",t.clickOutsideEvent)}},Qh=(t,n)=>{const e=t.__vccOpts||t;for(const[i,a]of n)e[i]=a;return e};function tt(t){const n=Ro.options[t];return typeof n>"u"?Ro.options[t]:n}const e1={name:"VueTelInput",directives:{clickOutside:Xh},props:{modelValue:{type:String,default:""},allCountries:{type:Array,default:()=>tt("allCountries")},autoFormat:{type:Boolean,default:()=>tt("autoFormat")},customValidate:{type:[Boolean,RegExp],default:()=>tt("customValidate")},defaultCountry:{type:[String,Number],default:()=>tt("defaultCountry")},disabled:{type:Boolean,default:()=>tt("disabled")},autoDefaultCountry:{type:Boolean,default:()=>tt("autoDefaultCountry")},dropdownOptions:{type:Object,default:()=>tt("dropdownOptions")},ignoredCountries:{type:Array,default:()=>tt("ignoredCountries")},inputOptions:{type:Object,default:()=>tt("inputOptions")},invalidMsg:{type:String,default:()=>tt("invalidMsg")},mode:{type:String,default:()=>tt("mode")},onlyCountries:{type:Array,default:()=>tt("onlyCountries")},preferredCountries:{type:Array,default:()=>tt("preferredCountries")},validCharactersOnly:{type:Boolean,default:()=>tt("validCharactersOnly")},styleClasses:{type:[String,Array,Object],default:()=>tt("styleClasses")}},data(){return{phone:"",activeCountryCode:"",open:!1,finishMounted:!1,selectedIndex:null,typeToFindInput:"",typeToFindTimer:null,dropdownOpenDirection:"below",parsedPlaceholder:this.inputOptions.placeholder,searchQuery:""}},computed:{activeCountry(){return this.findCountry(this.activeCountryCode)},parsedMode(){return this.mode==="auto"?!this.phone||this.phone[0]!=="+"?"national":"international":["international","national"].includes(this.mode)?this.mode:(console.error('Invalid value of prop "mode"'),"international")},filteredCountries(){return this.onlyCountries.length?this.allCountries.filter(({iso2:t})=>this.onlyCountries.some(n=>n.toUpperCase()===t)):this.ignoredCountries.length?this.allCountries.filter(({iso2:t})=>!this.ignoredCountries.includes(t.toUpperCase())&&!this.ignoredCountries.includes(t.toLowerCase())):this.allCountries},sortedCountries(){const t=[...this.getCountries(this.preferredCountries).map(e=>({...e,preferred:!0})),...this.filteredCountries];if(!this.dropdownOptions.showSearchBox)return t;const n=this.searchQuery.replace(/[~`!@#$%^&*()+={}\[\];:\'\"<>.,\/\\\?-_]/g,"");return t.filter(e=>new RegExp(n,"i").test(e.name)||new RegExp(n,"i").test(e.iso2)||new RegExp(n,"i").test(e.dialCode))},phoneObject(){var t,n,e;let i;((t=this.phone)==null?void 0:t[0])==="+"?i=si(this.phone)||{}:i=si(this.phone,this.activeCountryCode)||{};const{metadata:a,...r}=i;let l=(n=i.isValid)==null?void 0:n.call(i),s=this.phone;return l&&(s=(e=i.format)==null?void 0:e.call(i,this.parsedMode.toUpperCase())),i.country&&(this.ignoredCountries.length||this.onlyCountries.length)&&(this.findCountry(i.country)||(l=!1,Object.assign(i,{country:null}))),Object.assign(r,{countryCode:i.country,valid:l,country:this.activeCountry,formatted:s}),r}},watch:{activeCountry(t,n){if(!t&&n!=null&&n.iso2){this.activeCountryCode=n.iso2;return}t!=null&&t.iso2&&this.$emit("country-changed",t)},"phoneObject.countryCode":function(t){this.activeCountryCode=t||""},"phoneObject.valid":function(){this.$emit("validate",this.phoneObject)},"phoneObject.formatted":function(t){!this.autoFormat||this.customValidate||(this.emitInput(t),this.$nextTick(()=>{t&&!this.modelValue&&(this.phone=t)}))},"inputOptions.placeholder":function(){this.resetPlaceholder()},modelValue(t,n){this.testCharacters()?this.phone=t:this.$nextTick(()=>{this.phone=n,this.onInput()})},open(t){t?(this.setDropdownPosition(),this.$emit("open")):this.$emit("close")}},mounted(){this.modelValue&&(this.phone=this.modelValue.trim()),this.cleanInvalidCharacters(),this.initializeCountry().then(()=>{var t;!this.phone&&(t=this.inputOptions)!=null&&t.showDialCode&&this.activeCountryCode&&(this.phone=`+${this.activeCountryCode}`),this.$emit("validate",this.phoneObject)}).catch(console.error).then(()=>{this.finishMounted=!0})},methods:{resetPlaceholder(){this.parsedPlaceholder=this.inputOptions.placeholder},initializeCountry(){return new Promise(t=>{var n;if(((n=this.phone)==null?void 0:n[0])==="+"){t();return}if(this.defaultCountry){if(typeof this.defaultCountry=="string"){this.choose(this.defaultCountry),t();return}if(typeof this.defaultCountry=="number"){const i=this.findCountryByDialCode(this.defaultCountry);if(i){this.choose(i.iso2),t();return}}}const e=this.preferredCountries[0]||this.filteredCountries[0];this.autoDefaultCountry?Hu().then(i=>{this.choose(i||this.activeCountryCode)}).catch(i=>{console.warn(i),this.choose(e)}).then(()=>{t()}):(this.choose(e),t())})},getCountries(t=[]){return t.map(n=>this.findCountry(n)).filter(Boolean)},findCountry(t=""){return this.filteredCountries.find(n=>n.iso2===t.toUpperCase())},findCountryByDialCode(t){return this.filteredCountries.find(n=>Number(n.dialCode)===t)},getItemClass(t,n){const e=this.selectedIndex===t,i=t===this.preferredCountries.length-1,a=this.preferredCountries.some(r=>r.toUpperCase()===n);return{highlighted:e,"last-preferred":i,preferred:a}},choose(t){var n,e;let i=t;if(typeof i=="string"&&(i=this.findCountry(i)),!!i){if(((n=this.phone)==null?void 0:n[0])==="+"&&i.iso2&&this.phoneObject.nationalNumber){this.activeCountryCode=i.iso2,this.phone=si(this.phoneObject.nationalNumber,i.iso2).formatInternational();return}if((e=this.inputOptions)!=null&&e.showDialCode&&i){this.phone=`+${i.dialCode}`,this.activeCountryCode=i.iso2||"";return}this.activeCountryCode=i.iso2||"",this.emitInput(this.phone)}},cleanInvalidCharacters(){const t=this.phone;if(this.validCharactersOnly){const n=this.phone.match(/[()\-+0-9\s]*/g);this.phone=n.join("")}if(this.customValidate&&this.customValidate instanceof RegExp){const n=this.phone.match(this.customValidate);this.phone=n.join("")}t!==this.phone&&this.emitInput(this.phone)},testCharacters(){return this.validCharactersOnly&&!/^[()\-+0-9\s]*$/.test(this.phone)?!1:this.customValidate?this.testCustomValidate():!0},testCustomValidate(){return this.customValidate instanceof RegExp?this.customValidate.test(this.phone):!1},onInput(){this.$refs.input.setCustomValidity(this.phoneObject.valid?"":this.invalidMsg),this.emitInput(this.phone)},emitInput(t){this.$emit("update:modelValue",t),this.$emit("on-input",t,this.phoneObject,this.$refs.input)},onBlur(){this.$emit("blur")},onFocus(){zu(this.$refs.input,this.phone.length),this.$emit("focus")},onEnter(){this.$emit("enter")},onSpace(){this.$emit("space")},focus(){this.$refs.input.focus()},toggleDropdown(){this.disabled||this.dropdownOptions.disabled||(this.searchQuery="",this.open=!this.open)},clickedOutside(){this.open=!1},keyboardNav(t){if(t.keyCode===40){t.preventDefault(),this.open=!0,this.selectedIndex===null?this.selectedIndex=0:this.selectedIndex=Math.min(this.sortedCountries.length-1,this.selectedIndex+1);const n=this.$refs.list.children[this.selectedIndex];n.focus(),n.offsetTop+n.clientHeight>this.$refs.list.scrollTop+this.$refs.list.clientHeight&&(this.$refs.list.scrollTop=n.offsetTop-this.$refs.list.clientHeight+n.clientHeight)}else if(t.keyCode===38){t.preventDefault(),this.open=!0,this.selectedIndex===null?this.selectedIndex=this.sortedCountries.length-1:this.selectedIndex=Math.max(0,this.selectedIndex-1);const n=this.$refs.list.children[this.selectedIndex];n.focus(),n.offsetTop<this.$refs.list.scrollTop&&(this.$refs.list.scrollTop=n.offsetTop)}else if(t.keyCode===13)this.selectedIndex!==null&&this.choose(this.sortedCountries[this.selectedIndex]),this.open=!this.open;else{this.typeToFindInput+=t.key,clearTimeout(this.typeToFindTimer),this.typeToFindTimer=setTimeout(()=>{this.typeToFindInput=""},700);const n=this.sortedCountries.slice(this.preferredCountries.length).findIndex(e=>e.name.toLowerCase().startsWith(this.typeToFindInput));if(n>=0){this.selectedIndex=this.preferredCountries.length+n;const e=this.$refs.list.children[this.selectedIndex],i=e.offsetTop<this.$refs.list.scrollTop,a=e.offsetTop+e.clientHeight>this.$refs.list.scrollTop+this.$refs.list.clientHeight;(i||a)&&(this.$refs.list.scrollTop=e.offsetTop-this.$refs.list.clientHeight/2)}}},reset(){this.selectedIndex=this.sortedCountries.map(t=>t.iso2).indexOf(this.activeCountryCode),this.open=!1},setDropdownPosition(){window.innerHeight-this.$el.getBoundingClientRect().bottom>200?this.dropdownOpenDirection="below":this.dropdownOpenDirection="above"}}},t1=["aria-expanded","tabindex"],n1={class:"vti__selection"},r1={key:1,class:"vti__country-code"},i1={class:"vti__dropdown-arrow"},o1=["placeholder"],a1=["onClick","onMousemove","aria-selected"],l1={key:1},s1=["type","autocomplete","autofocus","disabled","id","maxlength","name","placeholder","readonly","required","tabindex","value","aria-describedby"];function d1(t,n,e,i,a,r){const l=o.resolveDirective("click-outside");return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["vue-tel-input",e.styleClasses,{disabled:e.disabled}])},[o.withDirectives((o.openBlock(),o.createElementBlock("div",{"aria-label":"Country Code Selector","aria-haspopup":"listbox","aria-expanded":a.open,role:"button",class:o.normalizeClass(["vti__dropdown",{open:a.open,disabled:e.dropdownOptions.disabled}]),tabindex:e.dropdownOptions.tabindex,onKeydown:[n[2]||(n[2]=(...s)=>r.keyboardNav&&r.keyboardNav(...s)),n[4]||(n[4]=o.withKeys((...s)=>r.toggleDropdown&&r.toggleDropdown(...s),["space"])),n[5]||(n[5]=o.withKeys((...s)=>r.reset&&r.reset(...s),["esc"])),n[6]||(n[6]=o.withKeys((...s)=>r.reset&&r.reset(...s),["tab"]))],onClick:n[3]||(n[3]=(...s)=>r.toggleDropdown&&r.toggleDropdown(...s))},[o.createElementVNode("span",n1,[e.dropdownOptions.showFlags?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["vti__flag",a.activeCountryCode.toLowerCase()])},null,2)):o.createCommentVNode("",!0),e.dropdownOptions.showDialCodeInSelection?(o.openBlock(),o.createElementBlock("span",r1," +"+o.toDisplayString(r.activeCountry&&r.activeCountry.dialCode),1)):o.createCommentVNode("",!0),o.renderSlot(t.$slots,"arrow-icon",{open:a.open},()=>[o.createElementVNode("span",i1,o.toDisplayString(a.open?"▲":"▼"),1)])]),a.open?(o.openBlock(),o.createElementBlock("ul",{key:0,ref:"list",class:o.normalizeClass(["vti__dropdown-list",a.dropdownOpenDirection]),role:"listbox"},[e.dropdownOptions.showSearchBox?o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:0,class:"vti__input vti__search_box","aria-label":"Search by country name or country code",placeholder:r.sortedCountries.length?r.sortedCountries[0].name:"",type:"text","onUpdate:modelValue":n[0]||(n[0]=s=>a.searchQuery=s),onClick:n[1]||(n[1]=o.withModifiers(()=>{},["stop"]))},null,8,o1)),[[o.vModelText,a.searchQuery]]):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.sortedCountries,(s,c)=>(o.openBlock(),o.createElementBlock("li",{role:"option",class:o.normalizeClass(["vti__dropdown-item",r.getItemClass(c,s.iso2)]),key:s.iso2+(s.preferred?"-preferred":""),tabindex:"-1",onClick:h=>r.choose(s),onMousemove:h=>a.selectedIndex=c,"aria-selected":a.activeCountryCode===s.iso2&&!s.preferred},[e.dropdownOptions.showFlags?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["vti__flag",s.iso2.toLowerCase()])},null,2)):o.createCommentVNode("",!0),o.createElementVNode("strong",null,o.toDisplayString(s.name),1),e.dropdownOptions.showDialCodeInList?(o.openBlock(),o.createElementBlock("span",l1," +"+o.toDisplayString(s.dialCode),1)):o.createCommentVNode("",!0)],42,a1))),128))],2)):o.createCommentVNode("",!0)],42,t1)),[[l,r.clickedOutside]]),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":n[7]||(n[7]=s=>a.phone=s),ref:"input",type:e.inputOptions.type,autocomplete:e.inputOptions.autocomplete,autofocus:e.inputOptions.autofocus,class:o.normalizeClass(["vti__input",e.inputOptions.styleClasses]),disabled:e.disabled,id:e.inputOptions.id,maxlength:e.inputOptions.maxlength,name:e.inputOptions.name,placeholder:a.parsedPlaceholder,readonly:e.inputOptions.readonly,required:e.inputOptions.required,tabindex:e.inputOptions.tabindex,value:e.modelValue,"aria-describedby":e.inputOptions["aria-describedby"],onBlur:n[8]||(n[8]=(...s)=>r.onBlur&&r.onBlur(...s)),onFocus:n[9]||(n[9]=(...s)=>r.onFocus&&r.onFocus(...s)),onInput:n[10]||(n[10]=(...s)=>r.onInput&&r.onInput(...s)),onKeyup:[n[11]||(n[11]=o.withKeys((...s)=>r.onEnter&&r.onEnter(...s),["enter"])),n[12]||(n[12]=o.withKeys((...s)=>r.onSpace&&r.onSpace(...s),["space"]))]},null,42,s1),[[o.vModelDynamic,a.phone]]),o.renderSlot(t.$slots,"icon-right")],2)}const c1=Qh(e1,[["render",d1]]),fp="",hp="",u1={directives:{Outside:Xn},props:{inputName:{type:String,default:"phone"},autoDefaultCountry:{type:Boolean,default:!0},value:{type:String,default:""},ignoredCountries:{type:Array,default:()=>[]},error:{type:Boolean,default:!1},errorMessage:{type:String,default:""}},components:{VueTelInput:c1,IbAlert:qt,IbIcon:Le},data(){return{vueTel:null,phone:"",dialCode:"",defaultCountry:"US"}},mounted(){this.vueTel=this.$refs.vueTel,this.value&&(this.phone=this.value[0]==="+"?this.value:"+"+this.value)},methods:{countryChanged(t){this.$globalEvents.$on("countrySelectValue",n=>{this.vueTel.choose(n)}),!this.phone||this.phone.length-1<this.dialCode.length?this.phone="+"+t.dialCode:this.dialCode&&(this.phone=this.phone.replace(this.dialCode,t.dialCode)),this.dialCode=t.dialCode},clickOutside(){this.vueTel.open&&this.vueTel.clickedOutside()}}};function f1(t,n,e,i,a,r){const l=o.resolveComponent("ib-alert"),s=o.resolveComponent("ib-icon"),c=o.resolveComponent("vue-tel-input"),h=o.resolveDirective("outside");return o.openBlock(),o.createElementBlock(o.Fragment,null,[e.errorMessage.length?(o.openBlock(),o.createBlock(l,{key:0,class:"ib-phone-error-message"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.errorMessage),1)]),_:1})):o.createCommentVNode("",!0),o.withDirectives((o.openBlock(),o.createBlock(c,o.mergeProps({modelValue:a.phone,"onUpdate:modelValue":n[0]||(n[0]=p=>a.phone=p)},t.$attrs,{onCountryChanged:r.countryChanged,"input-options":{name:e.inputName,id:e.inputName},"auto-default-country":e.autoDefaultCountry,"dropdown-options":{showSearchBox:!0,showFlags:!0},defaultCountry:a.defaultCountry,ignoredCountries:e.ignoredCountries,class:{error:e.error||e.errorMessage.length},"style-classes":"ib-phone-input",ref:"vueTel"}),{"arrow-icon":o.withCtx(()=>[o.createVNode(s,{name:"chevron-down-outline"})]),_:1},16,["modelValue","onCountryChanged","input-options","auto-default-country","defaultCountry","ignoredCountries","class"])),[[h,r.clickOutside]])],64)}const h1=_e(u1,[["render",f1]]);var ba={exports:{}};/*!
|
|
89
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uh(t,n){if(t){if(typeof t=="string")return ga(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ga(t,n)}}function ga(t,n){(n==null||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Kh(t,n){var e=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(e!=null){var i=[],a=!0,r=!1,l,s;try{for(e=e.call(t);!(a=(l=e.next()).done)&&(i.push(l.value),!(n&&i.length===n));a=!0);}catch(c){r=!0,s=c}finally{try{!a&&e.return!=null&&e.return()}finally{if(r)throw s}}return i}}function Gh(t){if(Array.isArray(t))return t}function Wh(t){var n=Array.prototype.slice.call(t),e=Hh(n,4),i=e[0],a=e[1],r=e[2],l=e[3],s,c,h;if(typeof i=="string")s=i;else throw new TypeError("A text for parsing must be a string.");if(!a||typeof a=="string")l?(c=r,h=l):(c=void 0,h=r),a&&(c=Fh({defaultCountry:a},c));else if(dr(a))r?(c=a,h=r):h=a;else throw new Error("Invalid second argument: ".concat(a));return{text:s,options:c,metadata:h}}function ya(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),e.push.apply(e,i)}return e}function va(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?ya(Object(e),!0).forEach(function(i){Yh(t,i,e[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ya(Object(e)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))})}return t}function Yh(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function Zh(t,n,e){n&&n.defaultCountry&&!bf(n.defaultCountry,e)&&(n=va(va({},n),{},{defaultCountry:void 0}));try{return Vh(t,n,e)}catch(i){if(!(i instanceof At))throw i}}function Jh(){var t=Wh(arguments),n=t.text,e=t.options,i=t.metadata;return Zh(n,e,i)}function si(){return Wu(Jh,arguments)}const Xh={beforeMount(t,n,e){if(typeof n.value!="function"){const i=e.context.name;let a=`[Vue-click-outside:] provided expression ${n.expression} is not a function, but has to be`;i&&(a+=`Found in component ${i}`),console.warn(a)}t.clickOutsideEvent=function(i){const a=i.composedPath?i.composedPath():i.path;t===i.target||t.contains(i.target)||a.includes(t)||n.value(i,t)},document.body.addEventListener("click",t.clickOutsideEvent)},unmounted(t){document.body.removeEventListener("click",t.clickOutsideEvent)}},Qh=(t,n)=>{const e=t.__vccOpts||t;for(const[i,a]of n)e[i]=a;return e};function tt(t){const n=Ro.options[t];return typeof n>"u"?Ro.options[t]:n}const e1={name:"VueTelInput",directives:{clickOutside:Xh},props:{modelValue:{type:String,default:""},allCountries:{type:Array,default:()=>tt("allCountries")},autoFormat:{type:Boolean,default:()=>tt("autoFormat")},customValidate:{type:[Boolean,RegExp],default:()=>tt("customValidate")},defaultCountry:{type:[String,Number],default:()=>tt("defaultCountry")},disabled:{type:Boolean,default:()=>tt("disabled")},autoDefaultCountry:{type:Boolean,default:()=>tt("autoDefaultCountry")},dropdownOptions:{type:Object,default:()=>tt("dropdownOptions")},ignoredCountries:{type:Array,default:()=>tt("ignoredCountries")},inputOptions:{type:Object,default:()=>tt("inputOptions")},invalidMsg:{type:String,default:()=>tt("invalidMsg")},mode:{type:String,default:()=>tt("mode")},onlyCountries:{type:Array,default:()=>tt("onlyCountries")},preferredCountries:{type:Array,default:()=>tt("preferredCountries")},validCharactersOnly:{type:Boolean,default:()=>tt("validCharactersOnly")},styleClasses:{type:[String,Array,Object],default:()=>tt("styleClasses")}},data(){return{phone:"",activeCountryCode:"",open:!1,finishMounted:!1,selectedIndex:null,typeToFindInput:"",typeToFindTimer:null,dropdownOpenDirection:"below",parsedPlaceholder:this.inputOptions.placeholder,searchQuery:""}},computed:{activeCountry(){return this.findCountry(this.activeCountryCode)},parsedMode(){return this.mode==="auto"?!this.phone||this.phone[0]!=="+"?"national":"international":["international","national"].includes(this.mode)?this.mode:(console.error('Invalid value of prop "mode"'),"international")},filteredCountries(){return this.onlyCountries.length?this.allCountries.filter(({iso2:t})=>this.onlyCountries.some(n=>n.toUpperCase()===t)):this.ignoredCountries.length?this.allCountries.filter(({iso2:t})=>!this.ignoredCountries.includes(t.toUpperCase())&&!this.ignoredCountries.includes(t.toLowerCase())):this.allCountries},sortedCountries(){const t=[...this.getCountries(this.preferredCountries).map(e=>({...e,preferred:!0})),...this.filteredCountries];if(!this.dropdownOptions.showSearchBox)return t;const n=this.searchQuery.replace(/[~`!@#$%^&*()+={}\[\];:\'\"<>.,\/\\\?-_]/g,"");return t.filter(e=>new RegExp(n,"i").test(e.name)||new RegExp(n,"i").test(e.iso2)||new RegExp(n,"i").test(e.dialCode))},phoneObject(){var t,n,e;let i;((t=this.phone)==null?void 0:t[0])==="+"?i=si(this.phone)||{}:i=si(this.phone,this.activeCountryCode)||{};const{metadata:a,...r}=i;let l=(n=i.isValid)==null?void 0:n.call(i),s=this.phone;return l&&(s=(e=i.format)==null?void 0:e.call(i,this.parsedMode.toUpperCase())),i.country&&(this.ignoredCountries.length||this.onlyCountries.length)&&(this.findCountry(i.country)||(l=!1,Object.assign(i,{country:null}))),Object.assign(r,{countryCode:i.country,valid:l,country:this.activeCountry,formatted:s}),r}},watch:{activeCountry(t,n){if(!t&&n!=null&&n.iso2){this.activeCountryCode=n.iso2;return}t!=null&&t.iso2&&this.$emit("country-changed",t)},"phoneObject.countryCode":function(t){this.activeCountryCode=t||""},"phoneObject.valid":function(){this.$emit("validate",this.phoneObject)},"phoneObject.formatted":function(t){!this.autoFormat||this.customValidate||(this.emitInput(t),this.$nextTick(()=>{t&&!this.modelValue&&(this.phone=t)}))},"inputOptions.placeholder":function(){this.resetPlaceholder()},modelValue(t,n){this.testCharacters()?this.phone=t:this.$nextTick(()=>{this.phone=n,this.onInput()})},open(t){t?(this.setDropdownPosition(),this.$emit("open")):this.$emit("close")}},mounted(){this.modelValue&&(this.phone=this.modelValue.trim()),this.cleanInvalidCharacters(),this.initializeCountry().then(()=>{var t;!this.phone&&(t=this.inputOptions)!=null&&t.showDialCode&&this.activeCountryCode&&(this.phone=`+${this.activeCountryCode}`),this.$emit("validate",this.phoneObject)}).catch(console.error).then(()=>{this.finishMounted=!0})},methods:{resetPlaceholder(){this.parsedPlaceholder=this.inputOptions.placeholder},initializeCountry(){return new Promise(t=>{var n;if(((n=this.phone)==null?void 0:n[0])==="+"){t();return}if(this.defaultCountry){if(typeof this.defaultCountry=="string"){this.choose(this.defaultCountry),t();return}if(typeof this.defaultCountry=="number"){const i=this.findCountryByDialCode(this.defaultCountry);if(i){this.choose(i.iso2),t();return}}}const e=this.preferredCountries[0]||this.filteredCountries[0];this.autoDefaultCountry?Hu().then(i=>{this.choose(i||this.activeCountryCode)}).catch(i=>{console.warn(i),this.choose(e)}).then(()=>{t()}):(this.choose(e),t())})},getCountries(t=[]){return t.map(n=>this.findCountry(n)).filter(Boolean)},findCountry(t=""){return this.filteredCountries.find(n=>n.iso2===t.toUpperCase())},findCountryByDialCode(t){return this.filteredCountries.find(n=>Number(n.dialCode)===t)},getItemClass(t,n){const e=this.selectedIndex===t,i=t===this.preferredCountries.length-1,a=this.preferredCountries.some(r=>r.toUpperCase()===n);return{highlighted:e,"last-preferred":i,preferred:a}},choose(t){var n,e;let i=t;if(typeof i=="string"&&(i=this.findCountry(i)),!!i){if(((n=this.phone)==null?void 0:n[0])==="+"&&i.iso2&&this.phoneObject.nationalNumber){this.activeCountryCode=i.iso2,this.phone=si(this.phoneObject.nationalNumber,i.iso2).formatInternational();return}if((e=this.inputOptions)!=null&&e.showDialCode&&i){this.phone=`+${i.dialCode}`,this.activeCountryCode=i.iso2||"";return}this.activeCountryCode=i.iso2||"",this.emitInput(this.phone)}},cleanInvalidCharacters(){const t=this.phone;if(this.validCharactersOnly){const n=this.phone.match(/[()\-+0-9\s]*/g);this.phone=n.join("")}if(this.customValidate&&this.customValidate instanceof RegExp){const n=this.phone.match(this.customValidate);this.phone=n.join("")}t!==this.phone&&this.emitInput(this.phone)},testCharacters(){return this.validCharactersOnly&&!/^[()\-+0-9\s]*$/.test(this.phone)?!1:this.customValidate?this.testCustomValidate():!0},testCustomValidate(){return this.customValidate instanceof RegExp?this.customValidate.test(this.phone):!1},onInput(){this.$refs.input.setCustomValidity(this.phoneObject.valid?"":this.invalidMsg),this.emitInput(this.phone)},emitInput(t){this.$emit("update:modelValue",t),this.$emit("on-input",t,this.phoneObject,this.$refs.input)},onBlur(){this.$emit("blur")},onFocus(){zu(this.$refs.input,this.phone.length),this.$emit("focus")},onEnter(){this.$emit("enter")},onSpace(){this.$emit("space")},focus(){this.$refs.input.focus()},toggleDropdown(){this.disabled||this.dropdownOptions.disabled||(this.searchQuery="",this.open=!this.open)},clickedOutside(){this.open=!1},keyboardNav(t){if(t.keyCode===40){t.preventDefault(),this.open=!0,this.selectedIndex===null?this.selectedIndex=0:this.selectedIndex=Math.min(this.sortedCountries.length-1,this.selectedIndex+1);const n=this.$refs.list.children[this.selectedIndex];n.focus(),n.offsetTop+n.clientHeight>this.$refs.list.scrollTop+this.$refs.list.clientHeight&&(this.$refs.list.scrollTop=n.offsetTop-this.$refs.list.clientHeight+n.clientHeight)}else if(t.keyCode===38){t.preventDefault(),this.open=!0,this.selectedIndex===null?this.selectedIndex=this.sortedCountries.length-1:this.selectedIndex=Math.max(0,this.selectedIndex-1);const n=this.$refs.list.children[this.selectedIndex];n.focus(),n.offsetTop<this.$refs.list.scrollTop&&(this.$refs.list.scrollTop=n.offsetTop)}else if(t.keyCode===13)this.selectedIndex!==null&&this.choose(this.sortedCountries[this.selectedIndex]),this.open=!this.open;else{this.typeToFindInput+=t.key,clearTimeout(this.typeToFindTimer),this.typeToFindTimer=setTimeout(()=>{this.typeToFindInput=""},700);const n=this.sortedCountries.slice(this.preferredCountries.length).findIndex(e=>e.name.toLowerCase().startsWith(this.typeToFindInput));if(n>=0){this.selectedIndex=this.preferredCountries.length+n;const e=this.$refs.list.children[this.selectedIndex],i=e.offsetTop<this.$refs.list.scrollTop,a=e.offsetTop+e.clientHeight>this.$refs.list.scrollTop+this.$refs.list.clientHeight;(i||a)&&(this.$refs.list.scrollTop=e.offsetTop-this.$refs.list.clientHeight/2)}}},reset(){this.selectedIndex=this.sortedCountries.map(t=>t.iso2).indexOf(this.activeCountryCode),this.open=!1},setDropdownPosition(){window.innerHeight-this.$el.getBoundingClientRect().bottom>200?this.dropdownOpenDirection="below":this.dropdownOpenDirection="above"}}},t1=["aria-expanded","tabindex"],n1={class:"vti__selection"},r1={key:1,class:"vti__country-code"},i1={class:"vti__dropdown-arrow"},o1=["placeholder"],a1=["onClick","onMousemove","aria-selected"],l1={key:1},s1=["type","autocomplete","autofocus","disabled","id","maxlength","name","placeholder","readonly","required","tabindex","value","aria-describedby"];function d1(t,n,e,i,a,r){const l=o.resolveDirective("click-outside");return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["vue-tel-input",e.styleClasses,{disabled:e.disabled}])},[o.withDirectives((o.openBlock(),o.createElementBlock("div",{"aria-label":"Country Code Selector","aria-haspopup":"listbox","aria-expanded":a.open,role:"button",class:o.normalizeClass(["vti__dropdown",{open:a.open,disabled:e.dropdownOptions.disabled}]),tabindex:e.dropdownOptions.tabindex,onKeydown:[n[2]||(n[2]=(...s)=>r.keyboardNav&&r.keyboardNav(...s)),n[4]||(n[4]=o.withKeys((...s)=>r.toggleDropdown&&r.toggleDropdown(...s),["space"])),n[5]||(n[5]=o.withKeys((...s)=>r.reset&&r.reset(...s),["esc"])),n[6]||(n[6]=o.withKeys((...s)=>r.reset&&r.reset(...s),["tab"]))],onClick:n[3]||(n[3]=(...s)=>r.toggleDropdown&&r.toggleDropdown(...s))},[o.createElementVNode("span",n1,[e.dropdownOptions.showFlags?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["vti__flag",a.activeCountryCode.toLowerCase()])},null,2)):o.createCommentVNode("",!0),e.dropdownOptions.showDialCodeInSelection?(o.openBlock(),o.createElementBlock("span",r1," +"+o.toDisplayString(r.activeCountry&&r.activeCountry.dialCode),1)):o.createCommentVNode("",!0),o.renderSlot(t.$slots,"arrow-icon",{open:a.open},()=>[o.createElementVNode("span",i1,o.toDisplayString(a.open?"▲":"▼"),1)])]),a.open?(o.openBlock(),o.createElementBlock("ul",{key:0,ref:"list",class:o.normalizeClass(["vti__dropdown-list",a.dropdownOpenDirection]),role:"listbox"},[e.dropdownOptions.showSearchBox?o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:0,class:"vti__input vti__search_box","aria-label":"Search by country name or country code",placeholder:r.sortedCountries.length?r.sortedCountries[0].name:"",type:"text","onUpdate:modelValue":n[0]||(n[0]=s=>a.searchQuery=s),onClick:n[1]||(n[1]=o.withModifiers(()=>{},["stop"]))},null,8,o1)),[[o.vModelText,a.searchQuery]]):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.sortedCountries,(s,c)=>(o.openBlock(),o.createElementBlock("li",{role:"option",class:o.normalizeClass(["vti__dropdown-item",r.getItemClass(c,s.iso2)]),key:s.iso2+(s.preferred?"-preferred":""),tabindex:"-1",onClick:h=>r.choose(s),onMousemove:h=>a.selectedIndex=c,"aria-selected":a.activeCountryCode===s.iso2&&!s.preferred},[e.dropdownOptions.showFlags?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["vti__flag",s.iso2.toLowerCase()])},null,2)):o.createCommentVNode("",!0),o.createElementVNode("strong",null,o.toDisplayString(s.name),1),e.dropdownOptions.showDialCodeInList?(o.openBlock(),o.createElementBlock("span",l1," +"+o.toDisplayString(s.dialCode),1)):o.createCommentVNode("",!0)],42,a1))),128))],2)):o.createCommentVNode("",!0)],42,t1)),[[l,r.clickedOutside]]),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":n[7]||(n[7]=s=>a.phone=s),ref:"input",type:e.inputOptions.type,autocomplete:e.inputOptions.autocomplete,autofocus:e.inputOptions.autofocus,class:o.normalizeClass(["vti__input",e.inputOptions.styleClasses]),disabled:e.disabled,id:e.inputOptions.id,maxlength:e.inputOptions.maxlength,name:e.inputOptions.name,placeholder:a.parsedPlaceholder,readonly:e.inputOptions.readonly,required:e.inputOptions.required,tabindex:e.inputOptions.tabindex,value:e.modelValue,"aria-describedby":e.inputOptions["aria-describedby"],onBlur:n[8]||(n[8]=(...s)=>r.onBlur&&r.onBlur(...s)),onFocus:n[9]||(n[9]=(...s)=>r.onFocus&&r.onFocus(...s)),onInput:n[10]||(n[10]=(...s)=>r.onInput&&r.onInput(...s)),onKeyup:[n[11]||(n[11]=o.withKeys((...s)=>r.onEnter&&r.onEnter(...s),["enter"])),n[12]||(n[12]=o.withKeys((...s)=>r.onSpace&&r.onSpace(...s),["space"]))]},null,42,s1),[[o.vModelDynamic,a.phone]]),o.renderSlot(t.$slots,"icon-right")],2)}const c1=Qh(e1,[["render",d1]]),fp="",hp="",u1={directives:{Outside:Xn},props:{inputName:{type:String,default:"phone"},autoDefaultCountry:{type:Boolean,default:!0},value:{type:String,default:""},ignoredCountries:{type:Array,default:()=>[]},error:{type:Boolean,default:!1},errorMessage:{type:String,default:""}},components:{VueTelInput:c1,IbAlert:qt,IbIcon:Le},data(){return{vueTel:null,phone:"",dialCode:"",defaultCountry:"US"}},mounted(){this.vueTel=this.$refs.vueTel,this.value&&(this.phone=this.value[0]==="+"?this.value:"+"+this.value)},methods:{countryChanged(t){this.$globalEvents.$on("countrySelectValue",n=>{this.vueTel.choose(n)}),this.phone="+"+t.dialCode,this.dialCode=t.dialCode},clickOutside(){this.vueTel.open&&this.vueTel.clickedOutside()}}};function f1(t,n,e,i,a,r){const l=o.resolveComponent("ib-alert"),s=o.resolveComponent("ib-icon"),c=o.resolveComponent("vue-tel-input"),h=o.resolveDirective("outside");return o.openBlock(),o.createElementBlock(o.Fragment,null,[e.errorMessage.length?(o.openBlock(),o.createBlock(l,{key:0,class:"ib-phone-error-message"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.errorMessage),1)]),_:1})):o.createCommentVNode("",!0),o.withDirectives((o.openBlock(),o.createBlock(c,o.mergeProps({modelValue:a.phone,"onUpdate:modelValue":n[0]||(n[0]=p=>a.phone=p)},t.$attrs,{onCountryChanged:r.countryChanged,"input-options":{name:e.inputName,id:e.inputName},"auto-default-country":e.autoDefaultCountry,"dropdown-options":{showSearchBox:!0,showFlags:!0},defaultCountry:a.defaultCountry,ignoredCountries:e.ignoredCountries,class:{error:e.error||e.errorMessage.length},"style-classes":"ib-phone-input",ref:"vueTel"}),{"arrow-icon":o.withCtx(()=>[o.createVNode(s,{name:"chevron-down-outline"})]),_:1},16,["modelValue","onCountryChanged","input-options","auto-default-country","defaultCountry","ignoredCountries","class"])),[[h,r.clickOutside]])],64)}const h1=_e(u1,[["render",f1]]);var ba={exports:{}};/*!
|
|
90
90
|
* Quill Editor v1.3.7
|
|
91
91
|
* https://quilljs.com/
|
|
92
92
|
* Copyright (c) 2014, Jason Chen
|