@fkui/vue 5.36.0 → 5.36.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,7 +47,7 @@ isIndex(key,length)))){result.push(key);}}return result;}var _arrayLikeKeys=arra
47
47
  * 1. Header
48
48
  * 2. First interactive element within content
49
49
  * 3. Content
50
- */resolveFocusElement(){const titleElement=findElementFromVueRef(this.$refs.modalTitle);if(titleElement){return titleElement;}const contentElement=getHTMLElementFromVueRef(this.$refs.modalContent);const tabbableChildren=logic.findTabbableElements(contentElement);const firstTabbableChildElement=tabbableChildren.length?tabbableChildren[0]:void 0;return firstTabbableChildElement!==null&&firstTabbableChildElement!==void 0?firstTabbableChildElement:contentElement;},restoreState(){if(this.savedFocus){var _this$savedScroll;const root2=document.documentElement;root2.classList.remove("modal__open");root2.style.removeProperty("top");root2.scrollTop=(_this$savedScroll=this.savedScroll)!==null&&_this$savedScroll!==void 0?_this$savedScroll:0;logic.popFocus(this.savedFocus);this.savedFocus=null;this.savedScroll=null;}},onFocusFirst(){const tabbableElements=logic.findTabbableElements(this.$refs.modalDialogContainer);const lastTabbableElement=tabbableElements[tabbableElements.length-2];focusElement(lastTabbableElement,this.$el);},onFocusLast(){const tabbableElements=logic.findTabbableElements(this.$refs.modalDialogContainer);const firstTabbableElement=tabbableElements[1];focusElement(firstTabbableElement,this.$el);}}});const _hoisted_1$T=["id"];const _hoisted_2$F={class:"modal__backdrop"};const _hoisted_3$z={class:"modal__inner-container"};const _hoisted_4$t={class:"modal__dialog"};const _hoisted_5$p={class:"modal__dialog-inner"};const _hoisted_6$l={class:"modal__header"};const _hoisted_7$g={key:0,ref:"modalTitle",class:"modal__title",tabindex:"-1"};const _hoisted_8$b={ref:"modalContent",class:"modal__content",tabindex:"-1"};const _hoisted_9$7={class:"modal__footer"};const _hoisted_10$7={class:"modal__shelf"};const _hoisted_11$3=["aria-label"];function _sfc_render$11(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return _ctx.isOpen?(vue.openBlock(),vue.createElementBlock("div",{key:0,id:_ctx.id,class:vue.normalizeClass(["modal",_ctx.modalClass])},[vue.createElementVNode("div",_hoisted_2$F,[vue.createElementVNode("div",{class:"modal__outer-container scroll-target",tabindex:"-1",role:"dialog","aria-modal":"true",onKeyup:_cache[3]||(_cache[3]=vue.withKeys((...args)=>_ctx.onClose&&_ctx.onClose(...args),["esc"]))},[vue.createElementVNode("div",_hoisted_3$z,[vue.createElementVNode("div",{ref:"modalDialogContainer",class:vue.normalizeClass(["modal__dialog-container",_ctx.containerClasses])},[vue.createElementVNode("div",_hoisted_4$t,[vue.createElementVNode("div",_hoisted_5$p,[vue.createElementVNode("div",_hoisted_6$l,[vue.createElementVNode("div",{tabindex:"0",onFocus:_cache[0]||(_cache[0]=(...args)=>_ctx.onFocusFirst&&_ctx.onFocusFirst(...args))},null,32/* NEED_HYDRATION */),vue.createTextVNode(),_ctx.hasHeaderSlot?(vue.openBlock(),vue.createElementBlock("h1",_hoisted_7$g,[vue.renderSlot(_ctx.$slots,"header")],512/* NEED_PATCH */)):vue.createCommentVNode("v-if",true)]),vue.createTextVNode(),vue.createElementVNode("div",_hoisted_8$b,[vue.renderSlot(_ctx.$slots,"content")],512/* NEED_PATCH */),vue.createTextVNode(),vue.createElementVNode("div",_hoisted_9$7,[vue.renderSlot(_ctx.$slots,"footer")])]),vue.createTextVNode(),vue.createElementVNode("div",_hoisted_10$7,[vue.createElementVNode("button",{type:"button",class:"close-button","aria-label":_ctx.ariaCloseText,onClick:_cache[1]||(_cache[1]=(...args)=>_ctx.onClose&&_ctx.onClose(...args))},[vue.createElementVNode("span",null,vue.toDisplayString(_ctx.$t("fkui.modal.close","Stäng")),1/* TEXT */),vue.createTextVNode(),vue.createVNode(_component_f_icon,{name:"close"})],8,_hoisted_11$3),vue.createTextVNode(),vue.createElementVNode("div",{tabindex:"0",onFocus:_cache[2]||(_cache[2]=(...args)=>_ctx.onFocusLast&&_ctx.onFocusLast(...args))},null,32/* NEED_HYDRATION */)])])],2/* CLASS */)])],32/* NEED_HYDRATION */)])],10,_hoisted_1$T)):vue.createCommentVNode("v-if",true);}const FModal=/* @__PURE__ */_export_sfc(_sfc_main$1b,[["render",_sfc_render$11]]);function prepareButtonList(src,buttonOrder=config.buttonOrder){const list=src.map(it=>{var _it$event,_ref2,_it$reason,_it$type;return{label:it.label,screenreader:it.screenreader,event:(_it$event=it.event)!==null&&_it$event!==void 0?_it$event:"dismiss",reason:(_ref2=(_it$reason=it.reason)!==null&&_it$reason!==void 0?_it$reason:it.event)!==null&&_ref2!==void 0?_ref2:"dismiss",classlist:["button",`button--${(_it$type=it.type)!==null&&_it$type!==void 0?_it$type:"secondary"}`],buttonType:it.submitButton?"submit":"button"};});switch(buttonOrder){case FKUIConfigButtonOrder.LEFT_TO_RIGHT:return list;case FKUIConfigButtonOrder.RIGHT_TO_LEFT:return list.reverse();}}const defaultButtons=[{label:"Primärknapp",event:"confirm",type:"primary"},{label:"Sekundärknapp",event:"dismiss",type:"secondary"}];const _sfc_main$1a=vue.defineComponent({name:"FConfirmModal",components:{FModal},inheritAttrs:true,props:{/**
50
+ */resolveFocusElement(){const titleElement=findElementFromVueRef(this.$refs.modalTitle);if(titleElement){return titleElement;}const contentElement=getHTMLElementFromVueRef(this.$refs.modalContent);const tabbableChildren=logic.findTabbableElements(contentElement);const firstTabbableChildElement=tabbableChildren.length?tabbableChildren[0]:void 0;return firstTabbableChildElement!==null&&firstTabbableChildElement!==void 0?firstTabbableChildElement:contentElement;},restoreState(){if(this.savedFocus){var _this$savedScroll;const root2=document.documentElement;root2.classList.remove("modal__open");root2.style.removeProperty("top");root2.scrollTop=(_this$savedScroll=this.savedScroll)!==null&&_this$savedScroll!==void 0?_this$savedScroll:0;logic.popFocus(this.savedFocus);this.savedFocus=null;this.savedScroll=null;}},onFocusFirst(){const tabbableElements=logic.findTabbableElements(this.$refs.modalDialogContainer);const lastTabbableElement=tabbableElements[tabbableElements.length-2];focusElement(lastTabbableElement,this.$el);},onFocusLast(){const tabbableElements=logic.findTabbableElements(this.$refs.modalDialogContainer);const firstTabbableElement=tabbableElements[1];focusElement(firstTabbableElement,this.$el);}}});const _hoisted_1$T=["id"];const _hoisted_2$F={class:"modal__backdrop"};const _hoisted_3$z={class:"modal__inner-container"};const _hoisted_4$t={class:"modal__dialog"};const _hoisted_5$p={class:"modal__dialog-inner"};const _hoisted_6$k={class:"modal__header"};const _hoisted_7$g={key:0,ref:"modalTitle",class:"modal__title",tabindex:"-1"};const _hoisted_8$b={ref:"modalContent",class:"modal__content",tabindex:"-1"};const _hoisted_9$7={class:"modal__footer"};const _hoisted_10$7={class:"modal__shelf"};const _hoisted_11$3=["aria-label"];function _sfc_render$11(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return _ctx.isOpen?(vue.openBlock(),vue.createElementBlock("div",{key:0,id:_ctx.id,class:vue.normalizeClass(["modal",_ctx.modalClass])},[vue.createElementVNode("div",_hoisted_2$F,[vue.createElementVNode("div",{class:"modal__outer-container scroll-target",tabindex:"-1",role:"dialog","aria-modal":"true",onKeyup:_cache[3]||(_cache[3]=vue.withKeys((...args)=>_ctx.onClose&&_ctx.onClose(...args),["esc"]))},[vue.createElementVNode("div",_hoisted_3$z,[vue.createElementVNode("div",{ref:"modalDialogContainer",class:vue.normalizeClass(["modal__dialog-container",_ctx.containerClasses])},[vue.createElementVNode("div",_hoisted_4$t,[vue.createElementVNode("div",_hoisted_5$p,[vue.createElementVNode("div",_hoisted_6$k,[vue.createElementVNode("div",{tabindex:"0",onFocus:_cache[0]||(_cache[0]=(...args)=>_ctx.onFocusFirst&&_ctx.onFocusFirst(...args))},null,32/* NEED_HYDRATION */),vue.createTextVNode(),_ctx.hasHeaderSlot?(vue.openBlock(),vue.createElementBlock("h1",_hoisted_7$g,[vue.renderSlot(_ctx.$slots,"header")],512/* NEED_PATCH */)):vue.createCommentVNode("v-if",true)]),vue.createTextVNode(),vue.createElementVNode("div",_hoisted_8$b,[vue.renderSlot(_ctx.$slots,"content")],512/* NEED_PATCH */),vue.createTextVNode(),vue.createElementVNode("div",_hoisted_9$7,[vue.renderSlot(_ctx.$slots,"footer")])]),vue.createTextVNode(),vue.createElementVNode("div",_hoisted_10$7,[vue.createElementVNode("button",{type:"button",class:"close-button","aria-label":_ctx.ariaCloseText,onClick:_cache[1]||(_cache[1]=(...args)=>_ctx.onClose&&_ctx.onClose(...args))},[vue.createElementVNode("span",null,vue.toDisplayString(_ctx.$t("fkui.modal.close","Stäng")),1/* TEXT */),vue.createTextVNode(),vue.createVNode(_component_f_icon,{name:"close"})],8,_hoisted_11$3),vue.createTextVNode(),vue.createElementVNode("div",{tabindex:"0",onFocus:_cache[2]||(_cache[2]=(...args)=>_ctx.onFocusLast&&_ctx.onFocusLast(...args))},null,32/* NEED_HYDRATION */)])])],2/* CLASS */)])],32/* NEED_HYDRATION */)])],10,_hoisted_1$T)):vue.createCommentVNode("v-if",true);}const FModal=/* @__PURE__ */_export_sfc(_sfc_main$1b,[["render",_sfc_render$11]]);function prepareButtonList(src,buttonOrder=config.buttonOrder){const list=src.map(it=>{var _it$event,_ref2,_it$reason,_it$type;return{label:it.label,screenreader:it.screenreader,event:(_it$event=it.event)!==null&&_it$event!==void 0?_it$event:"dismiss",reason:(_ref2=(_it$reason=it.reason)!==null&&_it$reason!==void 0?_it$reason:it.event)!==null&&_ref2!==void 0?_ref2:"dismiss",classlist:["button",`button--${(_it$type=it.type)!==null&&_it$type!==void 0?_it$type:"secondary"}`],buttonType:it.submitButton?"submit":"button"};});switch(buttonOrder){case FKUIConfigButtonOrder.LEFT_TO_RIGHT:return list;case FKUIConfigButtonOrder.RIGHT_TO_LEFT:return list.reverse();}}const defaultButtons=[{label:"Primärknapp",event:"confirm",type:"primary"},{label:"Sekundärknapp",event:"dismiss",type:"secondary"}];const _sfc_main$1a=vue.defineComponent({name:"FConfirmModal",components:{FModal},inheritAttrs:true,props:{/**
51
51
  * Enable fullscreen mode in mobile.
52
52
  */fullscreen:{type:Boolean,required:false,default:false},/**
53
53
  * Prop for opening modal
@@ -106,7 +106,7 @@ isIndex(key,length)))){result.push(key);}}return result;}var _arrayLikeKeys=arra
106
106
  * Display bullets in list.
107
107
  */bullets:{type:Boolean,required:false,default:false},/**
108
108
  * Optional callback for performing actions before navigation.
109
- */beforeNavigate:{type:Function,required:false,default(){return()=>{};}}},computed:{hasTitleSlot(){return hasSlot(this,"title");}},methods:{liClasses(errorItem){const classes=[];if(!this.bullets&&errorItem.id){classes.push("error-list__link");}return classes;},async onClickItem(item){await this.beforeNavigate(item);focusError(item);}}});const _hoisted_1$R={class:"error-list"};const _hoisted_2$D={key:0};const _hoisted_3$x={class:"error-list__list error-list--list-style-none"};const _hoisted_4$s=["onClick"];const _hoisted_5$o=/* @__PURE__ */vue.createElementVNode("span",{class:"error-list__bullet","aria-hidden":"true"},null,-1/* HOISTED */);const _hoisted_6$k={class:"error-list__link"};const _hoisted_7$f=/* @__PURE__ */vue.createElementVNode("span",{class:"error-list__bullet","aria-hidden":"true"},null,-1/* HOISTED */);function _sfc_render$Z(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");const _component_i_flex_item=vue.resolveComponent("i-flex-item");const _component_i_flex=vue.resolveComponent("i-flex");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$R,[vue.createVNode(_component_i_flex,null,{default:vue.withCtx(()=>[_ctx.hasTitleSlot?(vue.openBlock(),vue.createBlock(_component_i_flex_item,{key:0,shrink:""},{default:vue.withCtx(()=>[vue.createVNode(_component_f_icon,{class:"error-list__icon",name:"error"})]),_:1/* STABLE */})):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.hasTitleSlot?(vue.openBlock(),vue.createBlock(_component_i_flex_item,{key:1,shrink:""},{default:vue.withCtx(()=>[vue.createTextVNode(" ")]),_:1/* STABLE */})):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createVNode(_component_i_flex_item,{grow:""},{default:vue.withCtx(()=>[_ctx.hasTitleSlot?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$D,[vue.renderSlot(_ctx.$slots,"title")])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createElementVNode("ul",_hoisted_3$x,[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.items,item=>{return vue.openBlock(),vue.createElementBlock("li",{key:item.id,class:vue.normalizeClass(_ctx.liClasses(item))},[item.id?(vue.openBlock(),vue.createElementBlock("a",{key:0,href:"javascript:",onClick:vue.withModifiers($event=>_ctx.onClickItem(item),["prevent"])},[_ctx.bullets?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[_hoisted_5$o,vue.createTextVNode(),vue.createElementVNode("span",_hoisted_6$k,vue.toDisplayString(item.title),1/* TEXT */)],64/* STABLE_FRAGMENT */)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createTextVNode(vue.toDisplayString(item.title),1/* TEXT */)],64/* STABLE_FRAGMENT */))],8,_hoisted_4$s)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[_ctx.bullets?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[_hoisted_7$f,vue.createTextVNode(),vue.createElementVNode("span",null,vue.toDisplayString(item.title),1/* TEXT */)],64/* STABLE_FRAGMENT */)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createTextVNode(vue.toDisplayString(item.title),1/* TEXT */)],64/* STABLE_FRAGMENT */))],64/* STABLE_FRAGMENT */))],2/* CLASS */);}),128/* KEYED_FRAGMENT */))])]),_:3/* FORWARDED */})]),_:3/* FORWARDED */})]);}const FErrorList=/* @__PURE__ */_export_sfc(_sfc_main$17,[["render",_sfc_render$Z]]);function cleanUpElements(vm){return new Promise(resolve=>{window.setTimeout(()=>{Object.keys(vm.components).forEach(id=>{const domElement=vm.$el.querySelector(`#${id}`);if(!domElement){delete vm.components[id];}});resolve();},0);});}function sortComponentsWithErrorsOnDOMOrder(componentList){const errorList=Object.values(componentList).filter(component=>{const validity=component instanceof logic.Reference?component.ref.isValid:component.validityMode;return typeof validity==="boolean"?validity===false:validity==="ERROR";});errorList.sort((a,b)=>{const elementToCompareA=a instanceof logic.Reference?document.querySelector(`#${a.ref.id}`):a.target;const elementToCompareB=b instanceof logic.Reference?document.querySelector(`#${b.ref.id}`):b.target;return logic.documentOrderComparator(elementToCompareA,elementToCompareB);});return errorList;}function isFormStepReference(reference){return"isOpen"in reference.ref;}const _sfc_main$16=vue.defineComponent({name:"FValidationGroup",props:{/**
109
+ */beforeNavigate:{type:Function,required:false,default(){return()=>{};}}},computed:{hasTitleSlot(){return hasSlot(this,"title");}},methods:{liClasses(errorItem){const classes=[];if(!this.bullets&&errorItem.id){classes.push("error-list__link");}return classes;},async onClickItem(item){await this.beforeNavigate(item);focusError(item);}}});const _hoisted_1$R={class:"error-list"};const _hoisted_2$D={key:0};const _hoisted_3$x={class:"error-list__list error-list--list-style-none"};const _hoisted_4$s=["onClick"];const _hoisted_5$o=/* @__PURE__ */vue.createElementVNode("span",{class:"error-list__bullet","aria-hidden":"true"},null,-1/* HOISTED */);const _hoisted_6$j={class:"error-list__link"};const _hoisted_7$f=/* @__PURE__ */vue.createElementVNode("span",{class:"error-list__bullet","aria-hidden":"true"},null,-1/* HOISTED */);function _sfc_render$Z(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");const _component_i_flex_item=vue.resolveComponent("i-flex-item");const _component_i_flex=vue.resolveComponent("i-flex");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$R,[vue.createVNode(_component_i_flex,null,{default:vue.withCtx(()=>[_ctx.hasTitleSlot?(vue.openBlock(),vue.createBlock(_component_i_flex_item,{key:0,shrink:""},{default:vue.withCtx(()=>[vue.createVNode(_component_f_icon,{class:"error-list__icon",name:"error"})]),_:1/* STABLE */})):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.hasTitleSlot?(vue.openBlock(),vue.createBlock(_component_i_flex_item,{key:1,shrink:""},{default:vue.withCtx(()=>[vue.createTextVNode(" ")]),_:1/* STABLE */})):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createVNode(_component_i_flex_item,{grow:""},{default:vue.withCtx(()=>[_ctx.hasTitleSlot?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$D,[vue.renderSlot(_ctx.$slots,"title")])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createElementVNode("ul",_hoisted_3$x,[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.items,item=>{return vue.openBlock(),vue.createElementBlock("li",{key:item.id,class:vue.normalizeClass(_ctx.liClasses(item))},[item.id?(vue.openBlock(),vue.createElementBlock("a",{key:0,href:"javascript:",onClick:vue.withModifiers($event=>_ctx.onClickItem(item),["prevent"])},[_ctx.bullets?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[_hoisted_5$o,vue.createTextVNode(),vue.createElementVNode("span",_hoisted_6$j,vue.toDisplayString(item.title),1/* TEXT */)],64/* STABLE_FRAGMENT */)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createTextVNode(vue.toDisplayString(item.title),1/* TEXT */)],64/* STABLE_FRAGMENT */))],8,_hoisted_4$s)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[_ctx.bullets?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[_hoisted_7$f,vue.createTextVNode(),vue.createElementVNode("span",null,vue.toDisplayString(item.title),1/* TEXT */)],64/* STABLE_FRAGMENT */)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createTextVNode(vue.toDisplayString(item.title),1/* TEXT */)],64/* STABLE_FRAGMENT */))],64/* STABLE_FRAGMENT */))],2/* CLASS */);}),128/* KEYED_FRAGMENT */))])]),_:3/* FORWARDED */})]),_:3/* FORWARDED */})]);}const FErrorList=/* @__PURE__ */_export_sfc(_sfc_main$17,[["render",_sfc_render$Z]]);function cleanUpElements(vm){return new Promise(resolve=>{window.setTimeout(()=>{Object.keys(vm.components).forEach(id=>{const domElement=vm.$el.querySelector(`#${id}`);if(!domElement){delete vm.components[id];}});resolve();},0);});}function sortComponentsWithErrorsOnDOMOrder(componentList){const errorList=Object.values(componentList).filter(component=>{const validity=component instanceof logic.Reference?component.ref.isValid:component.validityMode;return typeof validity==="boolean"?validity===false:validity==="ERROR";});errorList.sort((a,b)=>{const elementToCompareA=a instanceof logic.Reference?document.querySelector(`#${a.ref.id}`):a.target;const elementToCompareB=b instanceof logic.Reference?document.querySelector(`#${b.ref.id}`):b.target;return logic.documentOrderComparator(elementToCompareA,elementToCompareB);});return errorList;}function isFormStepReference(reference){return"isOpen"in reference.ref;}const _sfc_main$16=vue.defineComponent({name:"FValidationGroup",props:{/**
110
110
  * A `GroupValidityEvent` object containing:
111
111
  *
112
112
  * `isValid`: the aggregated validity of underlying components
@@ -166,12 +166,12 @@ isIndex(key,length)))){result.push(key);}}return result;}var _arrayLikeKeys=arra
166
166
  * Min date.
167
167
  */minDate:{type:Object,required:true},/**
168
168
  * Max date.
169
- */maxDate:{type:Object,required:true}},emits:["change","update:modelValue"],computed:{previousDisabled(){return isInvalidMonth(this.modelValue.addMonths(-1),this.minDate,this.maxDate);},nextDisabled(){return isInvalidMonth(this.modelValue.addMonths(1),this.minDate,this.maxDate);},previousValue(){return this.modelValue.addMonths(-1);},nextValue(){return this.modelValue.addMonths(1);},currentText(){return this.getDateText(this.modelValue);},previousSrText(){return this.$t("fkui.calendar-navbar.previous","Föregående månad");},nextSrText(){return this.$t("fkui.calendar-navbar.next","Nästa månad");},previousIconClasses(){return{"calendar-navbar__icon":true,"calendar-navbar__icon--disabled":this.previousDisabled};},nextIconClasses(){return{"calendar-navbar__icon":true,"calendar-navbar__icon--disabled":this.nextDisabled};}},methods:{onClickPreviousButton(){if(!this.previousDisabled){this.$emit("update:modelValue",this.previousValue);this.$emit("change",this.previousValue);const previousMonth=this.getDateText(this.previousValue);const previousMonthText=this.$t("fkui.calendar-navbar.previous-month","{{ previousMonth }} visas",{previousMonth});logic.alertScreenReader(previousMonthText,{assertive:true});return;}const message=getMessage(this.$t,this.previousValue,this.minDate,this.maxDate);if(message){logic.alertScreenReader(message,{assertive:true});}},onClickNextButton(){if(!this.nextDisabled){this.$emit("update:modelValue",this.nextValue);this.$emit("change",this.nextValue);const nextMonth=this.getDateText(this.nextValue);const nextMonthText=this.$t("fkui.calendar-navbar.next-month","{{ nextMonth }} visas",{nextMonth});logic.alertScreenReader(nextMonthText,{assertive:true});return;}const message=getMessage(this.$t,this.nextValue,this.minDate,this.maxDate);if(message){logic.alertScreenReader(message,{assertive:true});}},getDateText(value){return`${value.monthName} ${value.year}`;},isFocused(ref){return document.activeElement===this.$refs[ref];}}});const _hoisted_1$N={class:"calendar-navbar"};const _hoisted_2$z={class:"calendar-navbar__month",tabindex:"-1"};const _hoisted_3$u=["aria-disabled","aria-live"];const _hoisted_4$p={class:"sr-only"};const _hoisted_5$n=["aria-disabled","aria-live"];const _hoisted_6$j={class:"sr-only"};function _sfc_render$T(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$N,[vue.createElementVNode("div",_hoisted_2$z,vue.toDisplayString(_ctx.currentText),1/* TEXT */),vue.createTextVNode(),vue.createElementVNode("button",{ref:"previousButton",class:"calendar-navbar__arrow calendar-navbar__arrow--previous",type:"button","aria-disabled":_ctx.previousDisabled,"aria-live":_ctx.isFocused("previousButton")?"polite":"off",onClick:_cache[0]||(_cache[0]=vue.withModifiers((...args)=>_ctx.onClickPreviousButton&&_ctx.onClickPreviousButton(...args),["stop"]))},[vue.createElementVNode("span",_hoisted_4$p,vue.toDisplayString(_ctx.previousSrText),1/* TEXT */),vue.createTextVNode(),vue.createVNode(_component_f_icon,{class:vue.normalizeClass(_ctx.previousIconClasses),name:"arrow-right"},null,8,["class"])],8,_hoisted_3$u),vue.createTextVNode(),vue.createElementVNode("button",{ref:"nextButton",class:"calendar-navbar__arrow calendar-navbar__arrow--next",type:"button","aria-disabled":_ctx.nextDisabled,"aria-live":_ctx.isFocused("nextButton")?"polite":"off",onClick:_cache[1]||(_cache[1]=vue.withModifiers((...args)=>_ctx.onClickNextButton&&_ctx.onClickNextButton(...args),["stop"]))},[vue.createElementVNode("span",_hoisted_6$j,vue.toDisplayString(_ctx.nextSrText),1/* TEXT */),vue.createTextVNode(),vue.createVNode(_component_f_icon,{class:vue.normalizeClass(_ctx.nextIconClasses),name:"arrow-right"},null,8,["class"])],8,_hoisted_5$n)]);}const ICalendarNavbar=/* @__PURE__ */_export_sfc(_sfc_main$11,[["render",_sfc_render$T]]);function getDayStartOffset(days){return days[0].weekDay-1;}function getDayEndOffset(days){return 7-days[days.length-1].weekDay;}const _sfc_main$10=vue.defineComponent({name:"ICalendarMonthGrid",props:{/**
169
+ */maxDate:{type:Object,required:true}},emits:["change","update:modelValue"],computed:{previousDisabled(){return isInvalidMonth(this.modelValue.addMonths(-1),this.minDate,this.maxDate);},nextDisabled(){return isInvalidMonth(this.modelValue.addMonths(1),this.minDate,this.maxDate);},previousValue(){return this.modelValue.addMonths(-1);},nextValue(){return this.modelValue.addMonths(1);},currentText(){return this.getDateText(this.modelValue);},previousSrText(){return this.$t("fkui.calendar-navbar.previous","Föregående månad");},nextSrText(){return this.$t("fkui.calendar-navbar.next","Nästa månad");},previousIconClasses(){return{"calendar-navbar__icon":true,"calendar-navbar__icon--disabled":this.previousDisabled};},nextIconClasses(){return{"calendar-navbar__icon":true,"calendar-navbar__icon--disabled":this.nextDisabled};}},methods:{onClickPreviousButton(){if(!this.previousDisabled){this.$emit("update:modelValue",this.previousValue);this.$emit("change",this.previousValue);const previousMonth=this.getDateText(this.previousValue);const previousMonthText=this.$t("fkui.calendar-navbar.previous-month","{{ previousMonth }} visas",{previousMonth});logic.alertScreenReader(previousMonthText,{assertive:true});return;}const message=getMessage(this.$t,this.previousValue,this.minDate,this.maxDate);if(message){logic.alertScreenReader(message,{assertive:true});}},onClickNextButton(){if(!this.nextDisabled){this.$emit("update:modelValue",this.nextValue);this.$emit("change",this.nextValue);const nextMonth=this.getDateText(this.nextValue);const nextMonthText=this.$t("fkui.calendar-navbar.next-month","{{ nextMonth }} visas",{nextMonth});logic.alertScreenReader(nextMonthText,{assertive:true});return;}const message=getMessage(this.$t,this.nextValue,this.minDate,this.maxDate);if(message){logic.alertScreenReader(message,{assertive:true});}},getDateText(value){return`${value.monthName} ${value.year}`;},isFocused(ref){return document.activeElement===this.$refs[ref];}}});const _hoisted_1$N={class:"calendar-navbar"};const _hoisted_2$z={class:"calendar-navbar__month",tabindex:"-1"};const _hoisted_3$u=["aria-disabled","aria-live"];const _hoisted_4$p={class:"sr-only"};const _hoisted_5$n=["aria-disabled","aria-live"];const _hoisted_6$i={class:"sr-only"};function _sfc_render$T(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$N,[vue.createElementVNode("div",_hoisted_2$z,vue.toDisplayString(_ctx.currentText),1/* TEXT */),vue.createTextVNode(),vue.createElementVNode("button",{ref:"previousButton",class:"calendar-navbar__arrow calendar-navbar__arrow--previous",type:"button","aria-disabled":_ctx.previousDisabled,"aria-live":_ctx.isFocused("previousButton")?"polite":"off",onClick:_cache[0]||(_cache[0]=vue.withModifiers((...args)=>_ctx.onClickPreviousButton&&_ctx.onClickPreviousButton(...args),["stop"]))},[vue.createElementVNode("span",_hoisted_4$p,vue.toDisplayString(_ctx.previousSrText),1/* TEXT */),vue.createTextVNode(),vue.createVNode(_component_f_icon,{class:vue.normalizeClass(_ctx.previousIconClasses),name:"arrow-right"},null,8,["class"])],8,_hoisted_3$u),vue.createTextVNode(),vue.createElementVNode("button",{ref:"nextButton",class:"calendar-navbar__arrow calendar-navbar__arrow--next",type:"button","aria-disabled":_ctx.nextDisabled,"aria-live":_ctx.isFocused("nextButton")?"polite":"off",onClick:_cache[1]||(_cache[1]=vue.withModifiers((...args)=>_ctx.onClickNextButton&&_ctx.onClickNextButton(...args),["stop"]))},[vue.createElementVNode("span",_hoisted_6$i,vue.toDisplayString(_ctx.nextSrText),1/* TEXT */),vue.createTextVNode(),vue.createVNode(_component_f_icon,{class:vue.normalizeClass(_ctx.nextIconClasses),name:"arrow-right"},null,8,["class"])],8,_hoisted_5$n)]);}const ICalendarNavbar=/* @__PURE__ */_export_sfc(_sfc_main$11,[["render",_sfc_render$T]]);function getDayStartOffset(days){return days[0].weekDay-1;}function getDayEndOffset(days){return 7-days[days.length-1].weekDay;}const _sfc_main$10=vue.defineComponent({name:"ICalendarMonthGrid",props:{/**
170
170
  * Focused month.
171
171
  * @model
172
172
  */value:{type:Object,required:true},/**
173
173
  * Hide week numbers.
174
- */hideWeekNumbers:{type:Boolean,required:false,default:false}},data(){return{weekdays:date.getWeekdayNamings(),focused:false,resizeObserver:void 0,internalHideWeekNumbers:false,showShortWeekdays:false};},computed:{totalCols(){return this.hideWeekNumbers?7:8;},weeks(){return date.groupByWeek(this.value.startOfMonth(),this.value.endOfMonth());}},mounted(){this.resizeObserver=new ResizeObserver(logic.debounce(this.onResize,100));this.resizeObserver.observe(this.$el);this.onResize();},unmounted(){if(this.resizeObserver){this.resizeObserver.disconnect();}},methods:{onResize(){const component=this.$el;this.internalHideWeekNumbers=this.hideWeekNumbers||component.offsetWidth<320;this.showShortWeekdays=component.offsetWidth<640;},onFocusin(){this.focused=true;},onFocusout(e){const component=this.$el;const relatedTarget=e.relatedTarget;if(!component.contains(relatedTarget)){this.focused=false;}},getDayStartOffset,getDayEndOffset}});const _hoisted_1$M={key:0,class:"calendar-month__col--week"};const _hoisted_2$y=/* @__PURE__ */vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_3$t=/* @__PURE__ */vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_4$o=/* @__PURE__ */vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_5$m=/* @__PURE__ */vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_6$i=/* @__PURE__ */vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_7$e=/* @__PURE__ */vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_8$a=/* @__PURE__ */vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_9$6={role:"presentation"};const _hoisted_10$6={role:"presentation"};const _hoisted_11$2={key:0,scope:"col","aria-hidden":"true",class:"calendar-month__header-cell"};const _hoisted_12$2=["title"];const _hoisted_13$2={role:"presentation"};const _hoisted_14$2={key:0,class:"calendar-month__cell calendar-month__cell--week-number","aria-hidden":"true"};const _hoisted_15$2=["colspan"];const _hoisted_16$1=["colspan"];const _hoisted_17$1={key:0,"aria-hidden":"true"};const _hoisted_18$1=["colspan"];const _hoisted_19$1={key:1,"aria-hidden":"true"};const _hoisted_20$1=["colspan"];function _sfc_render$S(_ctx,_cache,$props,$setup,$data,$options){return vue.openBlock(),vue.createElementBlock("table",{class:"calendar-month__table",role:"application",onFocusin:_cache[0]||(_cache[0]=(...args)=>_ctx.onFocusin&&_ctx.onFocusin(...args)),onFocusout:_cache[1]||(_cache[1]=(...args)=>_ctx.onFocusout&&_ctx.onFocusout(...args))},[vue.createElementVNode("colgroup",null,[!_ctx.internalHideWeekNumbers?(vue.openBlock(),vue.createElementBlock("col",_hoisted_1$M)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_hoisted_2$y,vue.createTextVNode(),_hoisted_3$t,vue.createTextVNode(),_hoisted_4$o,vue.createTextVNode(),_hoisted_5$m,vue.createTextVNode(),_hoisted_6$i,vue.createTextVNode(),_hoisted_7$e,vue.createTextVNode(),_hoisted_8$a]),vue.createTextVNode(),vue.createElementVNode("thead",_hoisted_9$6,[vue.createElementVNode("tr",_hoisted_10$6,[!_ctx.internalHideWeekNumbers?(vue.openBlock(),vue.createElementBlock("th",_hoisted_11$2)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.weekdays,weekday=>{return vue.openBlock(),vue.createElementBlock("th",{key:weekday.name,scope:"col",role:"presentation",class:"calendar-month__header-cell"},[vue.createElementVNode("abbr",{"aria-hidden":"true",title:weekday.name},vue.toDisplayString(_ctx.showShortWeekdays?weekday.shortName:weekday.name),9,_hoisted_12$2)]);}),128/* KEYED_FRAGMENT */))])]),vue.createTextVNode(),vue.createElementVNode("tbody",_hoisted_13$2,[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.weeks,week=>{return vue.openBlock(),vue.createElementBlock("tr",{key:week.week,role:"presentation"},[!_ctx.internalHideWeekNumbers?(vue.openBlock(),vue.createElementBlock("td",_hoisted_14$2,vue.toDisplayString(week.week),1/* TEXT */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.getDayStartOffset(week.days)?(vue.openBlock(),vue.createElementBlock("td",{key:1,class:"calendar-month__cell",colspan:_ctx.getDayStartOffset(week.days),"aria-hidden":"true"},null,8,_hoisted_15$2)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(week.days,day=>{return vue.openBlock(),vue.createElementBlock("td",{key:day.toString(),class:"calendar-month__cell",role:"presentation"},[vue.renderSlot(_ctx.$slots,"default",{date:day,focused:_ctx.focused})]);}),128/* KEYED_FRAGMENT */)),vue.createTextVNode(),_ctx.getDayEndOffset(week.days)?(vue.openBlock(),vue.createElementBlock("td",{key:2,class:"calendar-month__cell",colspan:_ctx.getDayEndOffset(week.days),"aria-hidden":"true"},null,8,_hoisted_16$1)):vue.createCommentVNode("v-if",true)]);}),128/* KEYED_FRAGMENT */)),vue.createTextVNode(),_ctx.weeks.length<5?(vue.openBlock(),vue.createElementBlock("tr",_hoisted_17$1,[vue.createElementVNode("td",{class:"calendar-month__cell",colspan:_ctx.totalCols,"aria-hidden":"true"},null,8,_hoisted_18$1)])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.weeks.length<6?(vue.openBlock(),vue.createElementBlock("tr",_hoisted_19$1,[vue.createElementVNode("td",{class:"calendar-month__cell",colspan:_ctx.totalCols,"aria-hidden":"true"},null,8,_hoisted_20$1)])):vue.createCommentVNode("v-if",true)])],32/* NEED_HYDRATION */);}const ICalendarMonthGrid=/* @__PURE__ */_export_sfc(_sfc_main$10,[["render",_sfc_render$S]]);const DayStep={ArrowRight:1,ArrowLeft:-1,ArrowUp:-7,ArrowDown:7};function isDayStepKey(e){return Object.keys(DayStep).includes(e.code);}function getDayStep(keyBoardEvent){return DayStep[keyBoardEvent.code];}function isSameMonth(a,b){return a.startOfMonth().equals(b.startOfMonth());}function getDayTabindex(date2,active,entry){const ref=active!==null&&active!==void 0?active:entry;if(ref&&isSameMonth(ref,date2)){return date2.equals(ref)?0:-1;}else{return date2.day===1?0:-1;}}const _sfc_main$$=vue.defineComponent({name:"ICalendarMonth",components:{ICalendarMonthGrid},mixins:[TranslationMixin],props:{/**
174
+ */hideWeekNumbers:{type:Boolean,required:false,default:false}},data(){return{weekdays:date.getWeekdayNamings(),focused:false,resizeObserver:void 0,internalHideWeekNumbers:false,showShortWeekdays:false};},computed:{totalCols(){return this.hideWeekNumbers?7:8;},weeks(){return date.groupByWeek(this.value.startOfMonth(),this.value.endOfMonth());}},mounted(){this.resizeObserver=new ResizeObserver(logic.debounce(this.onResize,100));this.resizeObserver.observe(this.$el);this.onResize();},unmounted(){if(this.resizeObserver){this.resizeObserver.disconnect();}},methods:{onResize(){const component=this.$el;this.internalHideWeekNumbers=this.hideWeekNumbers||component.offsetWidth<320;this.showShortWeekdays=component.offsetWidth<640;},onFocusin(){this.focused=true;},onFocusout(e){const component=this.$el;const relatedTarget=e.relatedTarget;if(!component.contains(relatedTarget)){this.focused=false;}},getDayStartOffset,getDayEndOffset}});const _hoisted_1$M={key:0,class:"calendar-month__col--week"};const _hoisted_2$y=/* @__PURE__ */vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_3$t=/* @__PURE__ */vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_4$o=/* @__PURE__ */vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_5$m=/* @__PURE__ */vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_6$h=/* @__PURE__ */vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_7$e=/* @__PURE__ */vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_8$a=/* @__PURE__ */vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_9$6={role:"presentation"};const _hoisted_10$6={role:"presentation"};const _hoisted_11$2={key:0,scope:"col","aria-hidden":"true",class:"calendar-month__header-cell"};const _hoisted_12$2=["title"];const _hoisted_13$2={role:"presentation"};const _hoisted_14$2={key:0,class:"calendar-month__cell calendar-month__cell--week-number","aria-hidden":"true"};const _hoisted_15$2=["colspan"];const _hoisted_16$1=["colspan"];const _hoisted_17$1={key:0,"aria-hidden":"true"};const _hoisted_18$1=["colspan"];const _hoisted_19$1={key:1,"aria-hidden":"true"};const _hoisted_20$1=["colspan"];function _sfc_render$S(_ctx,_cache,$props,$setup,$data,$options){return vue.openBlock(),vue.createElementBlock("table",{class:"calendar-month__table",role:"application",onFocusin:_cache[0]||(_cache[0]=(...args)=>_ctx.onFocusin&&_ctx.onFocusin(...args)),onFocusout:_cache[1]||(_cache[1]=(...args)=>_ctx.onFocusout&&_ctx.onFocusout(...args))},[vue.createElementVNode("colgroup",null,[!_ctx.internalHideWeekNumbers?(vue.openBlock(),vue.createElementBlock("col",_hoisted_1$M)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_hoisted_2$y,vue.createTextVNode(),_hoisted_3$t,vue.createTextVNode(),_hoisted_4$o,vue.createTextVNode(),_hoisted_5$m,vue.createTextVNode(),_hoisted_6$h,vue.createTextVNode(),_hoisted_7$e,vue.createTextVNode(),_hoisted_8$a]),vue.createTextVNode(),vue.createElementVNode("thead",_hoisted_9$6,[vue.createElementVNode("tr",_hoisted_10$6,[!_ctx.internalHideWeekNumbers?(vue.openBlock(),vue.createElementBlock("th",_hoisted_11$2)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.weekdays,weekday=>{return vue.openBlock(),vue.createElementBlock("th",{key:weekday.name,scope:"col",role:"presentation",class:"calendar-month__header-cell"},[vue.createElementVNode("abbr",{"aria-hidden":"true",title:weekday.name},vue.toDisplayString(_ctx.showShortWeekdays?weekday.shortName:weekday.name),9,_hoisted_12$2)]);}),128/* KEYED_FRAGMENT */))])]),vue.createTextVNode(),vue.createElementVNode("tbody",_hoisted_13$2,[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.weeks,week=>{return vue.openBlock(),vue.createElementBlock("tr",{key:week.week,role:"presentation"},[!_ctx.internalHideWeekNumbers?(vue.openBlock(),vue.createElementBlock("td",_hoisted_14$2,vue.toDisplayString(week.week),1/* TEXT */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.getDayStartOffset(week.days)?(vue.openBlock(),vue.createElementBlock("td",{key:1,class:"calendar-month__cell",colspan:_ctx.getDayStartOffset(week.days),"aria-hidden":"true"},null,8,_hoisted_15$2)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(week.days,day=>{return vue.openBlock(),vue.createElementBlock("td",{key:day.toString(),class:"calendar-month__cell",role:"presentation"},[vue.renderSlot(_ctx.$slots,"default",{date:day,focused:_ctx.focused})]);}),128/* KEYED_FRAGMENT */)),vue.createTextVNode(),_ctx.getDayEndOffset(week.days)?(vue.openBlock(),vue.createElementBlock("td",{key:2,class:"calendar-month__cell",colspan:_ctx.getDayEndOffset(week.days),"aria-hidden":"true"},null,8,_hoisted_16$1)):vue.createCommentVNode("v-if",true)]);}),128/* KEYED_FRAGMENT */)),vue.createTextVNode(),_ctx.weeks.length<5?(vue.openBlock(),vue.createElementBlock("tr",_hoisted_17$1,[vue.createElementVNode("td",{class:"calendar-month__cell",colspan:_ctx.totalCols,"aria-hidden":"true"},null,8,_hoisted_18$1)])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.weeks.length<6?(vue.openBlock(),vue.createElementBlock("tr",_hoisted_19$1,[vue.createElementVNode("td",{class:"calendar-month__cell",colspan:_ctx.totalCols,"aria-hidden":"true"},null,8,_hoisted_20$1)])):vue.createCommentVNode("v-if",true)])],32/* NEED_HYDRATION */);}const ICalendarMonthGrid=/* @__PURE__ */_export_sfc(_sfc_main$10,[["render",_sfc_render$S]]);const DayStep={ArrowRight:1,ArrowLeft:-1,ArrowUp:-7,ArrowDown:7};function isDayStepKey(e){return Object.keys(DayStep).includes(e.code);}function getDayStep(keyBoardEvent){return DayStep[keyBoardEvent.code];}function isSameMonth(a,b){return a.startOfMonth().equals(b.startOfMonth());}function getDayTabindex(date2,active,entry){const ref=active!==null&&active!==void 0?active:entry;if(ref&&isSameMonth(ref,date2)){return date2.equals(ref)?0:-1;}else{return date2.day===1?0:-1;}}const _sfc_main$$=vue.defineComponent({name:"ICalendarMonth",components:{ICalendarMonthGrid},mixins:[TranslationMixin],props:{/**
175
175
  * Active month.
176
176
  * @model
177
177
  */modelValue:{type:Object,required:true},/**
@@ -250,7 +250,7 @@ isIndex(key,length)))){result.push(key);}}return result;}var _arrayLikeKeys=arra
250
250
  /* include undefined (see comment on line above) */modelValue:{type:anyType$1,required:false},/**
251
251
  * The value for the input.
252
252
  */value:{type:anyType$1,required:true}},emits:["change","update:modelValue"],setup(){return{showDetails:vue.inject("showDetails","never"),getFieldsetLabelText:vue.inject("getFieldsetLabelText",()=>"")};},data(){return{expanded:false,height:0,initialStyle:{overflow:"hidden",transition:"height 400ms cubic-bezier(0.46, 0.03, 0.52, 0.96)"},hiddenStyle:{height:"auto",position:"absolute",visibility:"hidden"},visibleStyle:{width:"",position:"",visibility:"",height:"0px"},openedStyle:{height:"auto"}};},computed:{attrs(){let checked;if(Array.isArray(this.modelValue)){checked=this.modelValue.findIndex(it=>lodash.isEqual(vue.toValue(it),vue.toValue(this.value)))>=0;}else{checked=this.value===this.modelValue;}return{...this.$attrs,value:this.value,checked,onChange:event=>{if(event.target instanceof HTMLInputElement){this.emitVModelEvent(event);}},onInput:event=>{event.target.focus();}};},disabledClass(){return this.disabled?"disabled":"";},// eslint-disable-next-line @typescript-eslint/no-explicit-any -- technical debt, nore sure whats going on here
253
- injected(){return this;}},methods:{updateExpandedFlag(){const checkboxInput=getHTMLElementFromVueRef(this.$refs["checkboxInput"]);this.expanded=checkboxInput.checked;},emitVModelEvent(event){let newModel;if(Array.isArray(this.modelValue)){newModel=[...this.modelValue].filter(it=>!lodash.isEqual(vue.toValue(it),vue.toValue(this.value)));if(this.modelValue.length<=newModel.length){newModel.push(this.value);}}else{if(this.value===this.modelValue){newModel=typeof this.value==="boolean"?false:void 0;}else{const target=event.target;newModel=target.value==="true"?true:this.value;}}this.$emit("update:modelValue",newModel);this.$emit("change",newModel);},onKeydown(event){event.stopPropagation();},onValidity({detail}){if(detail.target!==this.$el.querySelector("input")){return;}let errorMessage="";if(hasSlot(this,"default")){const labelText=this.injected.getFieldsetLabelText();if(labelText){errorMessage=`${labelText} ${renderSlotText(this.$slots.default)}`;}else{errorMessage=`${renderSlotText(this.$slots.default)}`;}}const element=this.$el.querySelector(`#${detail.elementId}`);if(element){dispatchComponentValidityEvent(element,{...detail,errorMessage,focusElementId:detail.elementId});}},enter(element){const htmlElement=getHTMLElementFromVueRef(element);const computedStyle=getComputedStyle(element);Object.assign(htmlElement.style,this.initialStyle);Object.assign(htmlElement.style,this.hiddenStyle);htmlElement.style.width=computedStyle.width;const height=computedStyle.height;Object.assign(htmlElement.style,this.visibleStyle);getComputedStyle(element).height;setTimeout(()=>{this.height=parseInt(height,10);htmlElement.style.height=height;});},afterEnter(element){const htmlElement=getHTMLElementFromVueRef(element);Object.assign(htmlElement.style,this.openedStyle);},leave(element){const htmlElement=getHTMLElementFromVueRef(element);const height=getComputedStyle(element).height;htmlElement.style.height=height;getComputedStyle(element).height;setTimeout(()=>{Object.assign(htmlElement.style,this.visibleStyle);});}}});const _hoisted_1$H=["id","disabled"];const _hoisted_2$v=["for"];const _hoisted_3$r={key:0,class:"checkbox__details"};const _hoisted_4$m=/* @__PURE__ */vue.createElementVNode("br",null,null,-1/* HOISTED */);const _hoisted_5$k={key:0,class:"checkbox__details"};const _hoisted_6$h=/* @__PURE__ */vue.createElementVNode("br",null,null,-1/* HOISTED */);function _sfc_render$M(_ctx,_cache,$props,$setup,$data,$options){return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["checkbox",_ctx.disabledClass]),onValidity:_cache[2]||(_cache[2]=(...args)=>_ctx.onValidity&&_ctx.onValidity(...args))},[vue.createElementVNode("input",vue.mergeProps({id:_ctx.id},_ctx.attrs,{ref:"checkboxInput",type:"checkbox",class:"checkbox__input",disabled:_ctx.disabled,onKeydown:_cache[0]||(_cache[0]=vue.withKeys((...args)=>_ctx.onKeydown&&_ctx.onKeydown(...args),["space"])),onChange:_cache[1]||(_cache[1]=$event=>_ctx.updateExpandedFlag())}),null,16,_hoisted_1$H),vue.createTextVNode(),vue.createElementVNode("label",{class:vue.normalizeClass(_ctx.$slots.details?"checkbox__label checkbox__width":"checkbox__label"),for:_ctx.id},[vue.renderSlot(_ctx.$slots,"default"),vue.createTextVNode(),_ctx.$slots.details?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[_ctx.showDetails==="always"?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$r,[_hoisted_4$m,vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"details")])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.showDetails==="when-selected"?(vue.openBlock(),vue.createBlock(vue.Transition,{key:1,onEnter:_ctx.enter,onAfterEnter:_ctx.afterEnter,onLeave:_ctx.leave},{default:vue.withCtx(()=>[_ctx.expanded?(vue.openBlock(),vue.createElementBlock("span",_hoisted_5$k,[_hoisted_6$h,vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"details",{height:_ctx.height})])):vue.createCommentVNode("v-if",true)]),_:3/* FORWARDED */},8,["onEnter","onAfterEnter","onLeave"])):vue.createCommentVNode("v-if",true)],64/* STABLE_FRAGMENT */)):vue.createCommentVNode("v-if",true)],10,_hoisted_2$v)],34/* CLASS, NEED_HYDRATION */);}const FCheckboxField=/* @__PURE__ */_export_sfc(_sfc_main$W,[["render",_sfc_render$M]]);const getFieldsetLabelText=Symbol("getFieldsetLabelText");function*labelClasses(options){const{labelClass}=options;yield"fieldset__label";yield labelClass;}function*contentClasses(options){const{hasRadiobutton,hasCheckbox,contentClass}=options;yield"fieldset__content";if(hasRadiobutton){yield"radio-button-group__content";}if(hasCheckbox){yield"checkbox-group__content";}yield contentClass;}const _sfc_main$V=vue.defineComponent({name:"FFieldset",components:{FIcon},mixins:[TranslationMixin],provide(){return{[getFieldsetLabelText]:()=>{return renderSlotText(this.$slots.label);},sharedName:this.name,showDetails:this.showDetails};},props:{/**
253
+ injected(){return this;}},methods:{updateExpandedFlag(){const checkboxInput=getHTMLElementFromVueRef(this.$refs["checkboxInput"]);this.expanded=checkboxInput.checked;},emitVModelEvent(event){let newModel;if(Array.isArray(this.modelValue)){newModel=[...this.modelValue].filter(it=>!lodash.isEqual(vue.toValue(it),vue.toValue(this.value)));if(this.modelValue.length<=newModel.length){newModel.push(this.value);}}else{if(this.value===this.modelValue){newModel=typeof this.value==="boolean"?false:void 0;}else{const target=event.target;newModel=target.value==="true"?true:this.value;}}this.$emit("update:modelValue",newModel);this.$emit("change",newModel);},onKeydown(event){event.stopPropagation();},onValidity({detail}){if(detail.target!==this.$el.querySelector("input")){return;}let errorMessage="";if(hasSlot(this,"default")){const labelText=this.injected.getFieldsetLabelText();if(labelText){errorMessage=`${labelText} ${renderSlotText(this.$slots.default)}`;}else{errorMessage=`${renderSlotText(this.$slots.default)}`;}}const element=this.$el.querySelector(`#${detail.elementId}`);if(element){dispatchComponentValidityEvent(element,{...detail,errorMessage,focusElementId:detail.elementId});}},enter(element){const htmlElement=getHTMLElementFromVueRef(element);const computedStyle=getComputedStyle(element);Object.assign(htmlElement.style,this.initialStyle);Object.assign(htmlElement.style,this.hiddenStyle);htmlElement.style.width=computedStyle.width;const height=computedStyle.height;Object.assign(htmlElement.style,this.visibleStyle);getComputedStyle(element).height;setTimeout(()=>{this.height=parseInt(height,10);htmlElement.style.height=height;});},afterEnter(element){const htmlElement=getHTMLElementFromVueRef(element);Object.assign(htmlElement.style,this.openedStyle);},leave(element){const htmlElement=getHTMLElementFromVueRef(element);const height=getComputedStyle(element).height;htmlElement.style.height=height;getComputedStyle(element).height;setTimeout(()=>{Object.assign(htmlElement.style,this.visibleStyle);});}}});const _hoisted_1$H=["id","disabled"];const _hoisted_2$v=["for"];const _hoisted_3$r={key:0,class:"checkbox__details"};const _hoisted_4$m=/* @__PURE__ */vue.createElementVNode("br",null,null,-1/* HOISTED */);const _hoisted_5$k={key:0,class:"checkbox__details"};const _hoisted_6$g=/* @__PURE__ */vue.createElementVNode("br",null,null,-1/* HOISTED */);function _sfc_render$M(_ctx,_cache,$props,$setup,$data,$options){return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["checkbox",_ctx.disabledClass]),onValidity:_cache[2]||(_cache[2]=(...args)=>_ctx.onValidity&&_ctx.onValidity(...args))},[vue.createElementVNode("input",vue.mergeProps({id:_ctx.id},_ctx.attrs,{ref:"checkboxInput",type:"checkbox",class:"checkbox__input",disabled:_ctx.disabled,onKeydown:_cache[0]||(_cache[0]=vue.withKeys((...args)=>_ctx.onKeydown&&_ctx.onKeydown(...args),["space"])),onChange:_cache[1]||(_cache[1]=$event=>_ctx.updateExpandedFlag())}),null,16,_hoisted_1$H),vue.createTextVNode(),vue.createElementVNode("label",{class:vue.normalizeClass(_ctx.$slots.details?"checkbox__label checkbox__width":"checkbox__label"),for:_ctx.id},[vue.renderSlot(_ctx.$slots,"default"),vue.createTextVNode(),_ctx.$slots.details?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[_ctx.showDetails==="always"?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$r,[_hoisted_4$m,vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"details")])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.showDetails==="when-selected"?(vue.openBlock(),vue.createBlock(vue.Transition,{key:1,onEnter:_ctx.enter,onAfterEnter:_ctx.afterEnter,onLeave:_ctx.leave},{default:vue.withCtx(()=>[_ctx.expanded?(vue.openBlock(),vue.createElementBlock("span",_hoisted_5$k,[_hoisted_6$g,vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"details",{height:_ctx.height})])):vue.createCommentVNode("v-if",true)]),_:3/* FORWARDED */},8,["onEnter","onAfterEnter","onLeave"])):vue.createCommentVNode("v-if",true)],64/* STABLE_FRAGMENT */)):vue.createCommentVNode("v-if",true)],10,_hoisted_2$v)],34/* CLASS, NEED_HYDRATION */);}const FCheckboxField=/* @__PURE__ */_export_sfc(_sfc_main$W,[["render",_sfc_render$M]]);const getFieldsetLabelText=Symbol("getFieldsetLabelText");function*labelClasses(options){const{labelClass}=options;yield"fieldset__label";yield labelClass;}function*contentClasses(options){const{hasRadiobutton,hasCheckbox,contentClass}=options;yield"fieldset__content";if(hasRadiobutton){yield"radio-button-group__content";}if(hasCheckbox){yield"checkbox-group__content";}yield contentClass;}const _sfc_main$V=vue.defineComponent({name:"FFieldset",components:{FIcon},mixins:[TranslationMixin],provide(){return{[getFieldsetLabelText]:()=>{return renderSlotText(this.$slots.label);},sharedName:this.name,showDetails:this.showDetails};},props:{/**
254
254
  * The id for the fieldset id attribute.
255
255
  * If the prop is not set a random value will be generated.
256
256
  */id:{type:String,required:false,default:()=>logic.ElementIdService.generateElementId()},/**
@@ -277,7 +277,7 @@ injected(){return this;}},methods:{updateExpandedFlag(){const checkboxInput=getH
277
277
  */showDetails:{type:String,default:"never",validator(value){return["never","when-selected","always"].includes(value);}}},data(){return{validity:{validityMode:"INITIAL"},descriptionClass:["label__description"],discreteDescriptionClass:["label__description","label__description--discrete"],validityElement:null,dispatchObject:{},detail:{},hasDocumentListener:false,legendKey:1,oldMessage:"",children:new Array(),hasCheckbox:false,hasRadiobutton:false};},computed:{hasError(){return this.validity.validityMode==="ERROR";},hasErrorMessageSlot(){return hasSlot(this,"error-message");},hasTooltipSlot(){return Boolean(this.$slots.tooltip);},hasDescriptionSlot(){return hasSlot(this,"description");},legendClass(){return this.hasTooltipSlot?["sr-only"]:this.groupLabelClass;},groupLabelClass(){return Array.from(labelClasses(this));},groupContentClass(){return Array.from(contentClasses(this));},classes(){const{hasRadiobutton,hasCheckbox,horizontal,chip,border}=this;return{"radio-button-group":hasRadiobutton,"radio-button-group--chip":chip&&hasRadiobutton,"radio-button-group--horizontal":horizontal&&hasRadiobutton,"radio-button-group--border":border&&hasRadiobutton,"checkbox-group":hasCheckbox,"checkbox-group--chip":chip&&hasCheckbox,"checkbox-group--horizontal":horizontal&&hasCheckbox,"checkbox-group--border":border&&hasCheckbox};},checkedChildren(){return this.children.filter(child=>child.checked);},debouncedUpdateChildren(){return logic.debounce(this.updateCheckboxChildren.bind(this),150);},checkboxCheckedScreenReaderText(){return this.checkedChildren.length===1?this.$t("fkui.checkbox-group.checkbox.checked","Kryssruta kryssad"):this.$t("fkui.checkbox-group.checkbox.not.checked","Kryssruta ej kryssad");},numberOfCheckboxesScreenReaderText(){return this.$t("fkui.checkbox-group.count","Grupp med {{ count }} kryssrutor",{count:String(this.children.length)});},numberOfCheckedCheckboxesScreenText(){return this.$t("fkui.checkbox-group.checked","{{ checked }} kryssad av {{ count }}",{checked:String(this.checkedChildren.length),count:String(this.children.length)});}},async mounted(){await this.$nextTick();const types=Array.from(this.$el.querySelectorAll(`input[type="checkbox"], input[type="radio"]`),it=>it.getAttribute("type"));this.hasCheckbox=types.includes("checkbox");this.hasRadiobutton=types.includes("radio");if(this.hasCheckbox){this.updateCheckboxChildren();}},updated(){if(this.hasCheckbox){this.debouncedUpdateChildren();}},methods:{async onValidity({detail}){var _renderSlotText2;if(detail.target!==this.$el){return;}this.detail=detail;await this.$nextTick();const errorMessage=(_renderSlotText2=renderSlotText(this.$slots.label))!==null&&_renderSlotText2!==void 0?_renderSlotText2:"";const firstFocusableElement=this.$el.querySelector("input:not(disabled), select:not(disabled), textarea:not(disabled)");const focusElementId=firstFocusableElement?firstFocusableElement.id:this.id;this.validityElement=this.$el;this.dispatchObject={...detail,errorMessage,focusElementId};this.validity=this.detail;if(this.validityElement){dispatchComponentValidityEvent(this.validityElement,this.dispatchObject);}const message=detail.validityMode==="INITIAL"?"":detail.validationMessage;if(message!==this.oldMessage){this.forceLegendUpdate();this.oldMessage=message;}},/**
278
278
  * Workaround for NVDA-bug. Force re rendering of legend element due to NVDA not recognizing innerHTML changes.
279
279
  * NVDA has closed the bug as it is related to the browser (works in FF): https://github.com/nvaccess/nvda/issues/13162
280
- */forceLegendUpdate(){this.legendKey++;},async updateCheckboxChildren(){await this.$nextTick();this.children=Array.from(this.$el.querySelectorAll('input[type="checkbox"]'));}}});const _hoisted_1$G=["id"];const _hoisted_2$u={key:0,class:"sr-only"};const _hoisted_3$q={key:0,class:"label__message label__message--error"};const _hoisted_4$l={key:0,"data-test":"checked-boxes",class:"sr-only","aria-live":"polite"};const _hoisted_5$j={key:0};const _hoisted_6$g={key:1};const _hoisted_7$d={class:"sr-separator"};const _hoisted_8$9={class:"tooltip-before","aria-hidden":"true"};const _hoisted_9$5={class:"label tooltip-before__label"};const _hoisted_10$5={key:0,class:"label__message label__message--error"};function _sfc_render$L(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("fieldset",{id:_ctx.id,class:vue.normalizeClass(["fieldset",_ctx.classes]),onValidity:_cache[0]||(_cache[0]=(...args)=>_ctx.onValidity&&_ctx.onValidity(...args))},[(vue.openBlock(),vue.createElementBlock("legend",{key:_ctx.legendKey,class:vue.normalizeClass(["label",_ctx.legendClass])},[vue.renderSlot(_ctx.$slots,"label"),vue.createTextVNode(),_ctx.hasCheckbox&&_ctx.children.length>1?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$u,[vue.createElementVNode("span",null,vue.toDisplayString(_ctx.numberOfCheckboxesScreenReaderText),1/* TEXT */)])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass:_ctx.descriptionClass,discreteDescriptionClass:_ctx.discreteDescriptionClass}))),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"error-message",vue.normalizeProps(vue.guardReactiveProps({hasError:_ctx.hasError,validationMessage:_ctx.validity.validationMessage})),()=>[_ctx.hasError?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$q,[vue.createVNode(_component_f_icon,{class:"label__icon--left",name:"error"}),vue.createTextVNode(" "+vue.toDisplayString(_ctx.validity.validationMessage),1/* TEXT */)])):vue.createCommentVNode("v-if",true)])],2/* CLASS */)),vue.createTextVNode(),_ctx.hasCheckbox?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$l,[_ctx.children.length===1?(vue.openBlock(),vue.createElementBlock("span",_hoisted_5$j,vue.toDisplayString(_ctx.checkboxCheckedScreenReaderText),1/* TEXT */)):(vue.openBlock(),vue.createElementBlock("span",_hoisted_6$g,vue.toDisplayString(_ctx.numberOfCheckedCheckboxesScreenText),1/* TEXT */))])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.hasTooltipSlot?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createElementVNode("div",_hoisted_7$d,[vue.createElementVNode("div",_hoisted_8$9,[vue.createElementVNode("div",_hoisted_9$5,[vue.renderSlot(_ctx.$slots,"label")])]),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"tooltip")]),vue.createTextVNode(),_ctx.hasDescriptionSlot||_ctx.hasErrorMessageSlot||_ctx.hasError?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["label",_ctx.groupLabelClass]),"aria-hidden":"true"},[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass:_ctx.descriptionClass,discreteDescriptionClass:_ctx.discreteDescriptionClass}))),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"error-message",vue.normalizeProps(vue.guardReactiveProps({hasError:_ctx.hasError,validationMessage:_ctx.validity.validationMessage})),()=>[_ctx.hasError?(vue.openBlock(),vue.createElementBlock("span",_hoisted_10$5,[vue.createVNode(_component_f_icon,{class:"label__icon--left",name:"error"}),vue.createTextVNode(" "+vue.toDisplayString(_ctx.validity.validationMessage),1/* TEXT */)])):vue.createCommentVNode("v-if",true)])],2/* CLASS */)):vue.createCommentVNode("v-if",true)],64/* STABLE_FRAGMENT */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createElementVNode("div",{class:vue.normalizeClass(_ctx.groupContentClass)},[vue.renderSlot(_ctx.$slots,"default")],2/* CLASS */)],42,_hoisted_1$G);}const FFieldset=/* @__PURE__ */_export_sfc(_sfc_main$V,[["render",_sfc_render$L]]);const _sfc_main$U=vue.defineComponent({name:"FCheckboxGroup",components:{FFieldset},mixins:[TranslationMixin],inheritAttrs:false,props:{/**
280
+ */forceLegendUpdate(){this.legendKey++;},async updateCheckboxChildren(){await this.$nextTick();this.children=Array.from(this.$el.querySelectorAll('input[type="checkbox"]'));}}});const _hoisted_1$G=["id"];const _hoisted_2$u={key:0,class:"sr-only"};const _hoisted_3$q={key:0,class:"label__message label__message--error"};const _hoisted_4$l={key:0,"data-test":"checked-boxes",class:"sr-only","aria-live":"polite"};const _hoisted_5$j={key:0};const _hoisted_6$f={key:1};const _hoisted_7$d={class:"sr-separator"};const _hoisted_8$9={class:"tooltip-before","aria-hidden":"true"};const _hoisted_9$5={class:"label tooltip-before__label"};const _hoisted_10$5={key:0,class:"label__message label__message--error"};function _sfc_render$L(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("fieldset",{id:_ctx.id,class:vue.normalizeClass(["fieldset",_ctx.classes]),onValidity:_cache[0]||(_cache[0]=(...args)=>_ctx.onValidity&&_ctx.onValidity(...args))},[(vue.openBlock(),vue.createElementBlock("legend",{key:_ctx.legendKey,class:vue.normalizeClass(["label",_ctx.legendClass])},[vue.renderSlot(_ctx.$slots,"label"),vue.createTextVNode(),_ctx.hasCheckbox&&_ctx.children.length>1?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$u,[vue.createElementVNode("span",null,vue.toDisplayString(_ctx.numberOfCheckboxesScreenReaderText),1/* TEXT */)])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass:_ctx.descriptionClass,discreteDescriptionClass:_ctx.discreteDescriptionClass}))),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"error-message",vue.normalizeProps(vue.guardReactiveProps({hasError:_ctx.hasError,validationMessage:_ctx.validity.validationMessage})),()=>[_ctx.hasError?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$q,[vue.createVNode(_component_f_icon,{class:"label__icon--left",name:"error"}),vue.createTextVNode(" "+vue.toDisplayString(_ctx.validity.validationMessage),1/* TEXT */)])):vue.createCommentVNode("v-if",true)])],2/* CLASS */)),vue.createTextVNode(),_ctx.hasCheckbox?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$l,[_ctx.children.length===1?(vue.openBlock(),vue.createElementBlock("span",_hoisted_5$j,vue.toDisplayString(_ctx.checkboxCheckedScreenReaderText),1/* TEXT */)):(vue.openBlock(),vue.createElementBlock("span",_hoisted_6$f,vue.toDisplayString(_ctx.numberOfCheckedCheckboxesScreenText),1/* TEXT */))])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.hasTooltipSlot?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createElementVNode("div",_hoisted_7$d,[vue.createElementVNode("div",_hoisted_8$9,[vue.createElementVNode("div",_hoisted_9$5,[vue.renderSlot(_ctx.$slots,"label")])]),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"tooltip")]),vue.createTextVNode(),_ctx.hasDescriptionSlot||_ctx.hasErrorMessageSlot||_ctx.hasError?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["label",_ctx.groupLabelClass]),"aria-hidden":"true"},[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass:_ctx.descriptionClass,discreteDescriptionClass:_ctx.discreteDescriptionClass}))),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"error-message",vue.normalizeProps(vue.guardReactiveProps({hasError:_ctx.hasError,validationMessage:_ctx.validity.validationMessage})),()=>[_ctx.hasError?(vue.openBlock(),vue.createElementBlock("span",_hoisted_10$5,[vue.createVNode(_component_f_icon,{class:"label__icon--left",name:"error"}),vue.createTextVNode(" "+vue.toDisplayString(_ctx.validity.validationMessage),1/* TEXT */)])):vue.createCommentVNode("v-if",true)])],2/* CLASS */)):vue.createCommentVNode("v-if",true)],64/* STABLE_FRAGMENT */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createElementVNode("div",{class:vue.normalizeClass(_ctx.groupContentClass)},[vue.renderSlot(_ctx.$slots,"default")],2/* CLASS */)],42,_hoisted_1$G);}const FFieldset=/* @__PURE__ */_export_sfc(_sfc_main$V,[["render",_sfc_render$L]]);const _sfc_main$U=vue.defineComponent({name:"FCheckboxGroup",components:{FFieldset},mixins:[TranslationMixin],inheritAttrs:false,props:{/**
281
281
  * The id for the fieldset id attribute.
282
282
  * If the prop is not set the id will be generated.
283
283
  */id:{type:String,required:false,default:()=>logic.ElementIdService.generateElementId()},/**
@@ -343,7 +343,7 @@ injected(){return this;}},methods:{updateExpandedFlag(){const checkboxInput=getH
343
343
  * - `"action"`: buttons to perform actions on row
344
344
  */type:{type:String,required:false,default:FTableColumnType.TEXT,validator(value){return isTableColumnType(value);}}},setup(){return FTableInjected();},computed:{classes(){return["table__column",`table__column--${this.type}`];},scope(){return this.rowHeader?"row":null;},tagName(){if(this.rowHeader){return"th";}else{return"td";}}},watch:{visible:{handler:function(){this.setVisibilityColumn(this.name,this.visible);}}},created(){if(this.shrink&&this.expand){throw new Error("Table cannot have both shrink and expand enabled at the same time");}const size=this.shrink?FTableColumnSize.SHRINK:FTableColumnSize.EXPAND;this.addColumn({name:this.name,title:this.title,description:this.description||void 0,id:logic.ElementIdService.generateElementId("column"),size,type:this.type,visible:this.visible,sortable:false,sort:FTableColumnSort.UNSORTED});}});const _hoisted_1$D=/* @__PURE__ */vue.createElementVNode("span",{class:"sr-only"}," ",-1/* HOISTED */);function _sfc_render$H(_ctx,_cache,$props,$setup,$data,$options){return _ctx.visible?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_ctx.tagName),vue.mergeProps({key:0,class:_ctx.classes,scope:_ctx.scope},_ctx.$attrs),{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default"),vue.createTextVNode(),_hoisted_1$D]),_:3/* FORWARDED */},16,["class","scope"])):vue.createCommentVNode("v-if",true);}const FTableColumn=/* @__PURE__ */_export_sfc(_sfc_main$R,[["render",_sfc_render$H]]);function FSortFilterDatasetInjected(){return{sort:vue.inject("sort",()=>void 0),registerCallbackOnSort:vue.inject("registerCallbackOnSort",()=>void 0),registerCallbackOnMount:vue.inject("registerCallbackOnMount",()=>void 0)};}const _sfc_main$Q=vue.defineComponent({name:"FLabel",components:{FIcon},props:{/**
345
345
  * The id for the form element the label is bound to.
346
- */for:{type:String,required:false,default:void 0}},data(){return{descriptionClass:["label__description"],discreteDescriptionClass:["label__description","label__description--discrete"]};},computed:{forProperty(){return this.for;},hasDefaultSlot(){return hasSlot(this,"default");},hasErrorMessageSlot(){return hasSlot(this,"error-message");},hasDescriptionSlot(){return hasSlot(this,"description");}}});const _hoisted_1$C={key:0};const _hoisted_2$s={key:0,class:"tooltip-before"};const _hoisted_3$p=["for"];const _hoisted_4$k=["for"];const _hoisted_5$i={key:0,class:"label__message label__message--error"};const _hoisted_6$f=["for"];const _hoisted_7$c={key:0,class:"label__message label__message--error"};function _sfc_render$G(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return _ctx.$slots.tooltip?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$C,[_ctx.hasDefaultSlot?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$s,[vue.createElementVNode("label",{class:"label tooltip-before__label",for:_ctx.forProperty},[vue.renderSlot(_ctx.$slots,"default")],8,_hoisted_3$p)])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"tooltip"),vue.createTextVNode(),_ctx.hasDescriptionSlot||_ctx.hasErrorMessageSlot?(vue.openBlock(),vue.createElementBlock("label",{key:1,class:"label sr-separator",for:_ctx.forProperty},[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass:_ctx.descriptionClass,discreteDescriptionClass:_ctx.discreteDescriptionClass}))),vue.createTextVNode(),_ctx.hasErrorMessageSlot?(vue.openBlock(),vue.createElementBlock("span",_hoisted_5$i,[vue.createVNode(_component_f_icon,{class:"label__icon--left",name:"error"}),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"error-message")])):vue.createCommentVNode("v-if",true)],8,_hoisted_4$k)):vue.createCommentVNode("v-if",true)])):(vue.openBlock(),vue.createElementBlock("label",{key:1,class:"label",for:_ctx.forProperty},[vue.renderSlot(_ctx.$slots,"default"),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass:_ctx.descriptionClass,discreteDescriptionClass:_ctx.discreteDescriptionClass}))),vue.createTextVNode(),_ctx.hasErrorMessageSlot?(vue.openBlock(),vue.createElementBlock("span",_hoisted_7$c,[vue.createVNode(_component_f_icon,{class:"label__icon--left",name:"error"}),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"error-message")])):vue.createCommentVNode("v-if",true)],8,_hoisted_6$f));}const FLabel=/* @__PURE__ */_export_sfc(_sfc_main$Q,[["render",_sfc_render$G]]);function resolveWidthClass$1(words,inline){return inline?void 0:words.split(" ").map(word=>`i-width-${word}`).join(" ");}const _sfc_main$P=vue.defineComponent({name:"FSelectField",components:{FIcon,FLabel},inheritAttrs:false,props:{/**
346
+ */for:{type:String,required:false,default:void 0}},data(){return{descriptionClass:["label__description"],discreteDescriptionClass:["label__description","label__description--discrete"]};},computed:{forProperty(){return this.for;},hasDefaultSlot(){return hasSlot(this,"default");},hasErrorMessageSlot(){return hasSlot(this,"error-message");},hasDescriptionSlot(){return hasSlot(this,"description");}}});const _hoisted_1$C={key:0};const _hoisted_2$s={key:0,class:"tooltip-before"};const _hoisted_3$p=["for"];const _hoisted_4$k=["for"];const _hoisted_5$i={key:0,class:"label__message label__message--error"};const _hoisted_6$e=["for"];const _hoisted_7$c={key:0,class:"label__message label__message--error"};function _sfc_render$G(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return _ctx.$slots.tooltip?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$C,[_ctx.hasDefaultSlot?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$s,[vue.createElementVNode("label",{class:"label tooltip-before__label",for:_ctx.forProperty},[vue.renderSlot(_ctx.$slots,"default")],8,_hoisted_3$p)])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"tooltip"),vue.createTextVNode(),_ctx.hasDescriptionSlot||_ctx.hasErrorMessageSlot?(vue.openBlock(),vue.createElementBlock("label",{key:1,class:"label sr-separator",for:_ctx.forProperty},[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass:_ctx.descriptionClass,discreteDescriptionClass:_ctx.discreteDescriptionClass}))),vue.createTextVNode(),_ctx.hasErrorMessageSlot?(vue.openBlock(),vue.createElementBlock("span",_hoisted_5$i,[vue.createVNode(_component_f_icon,{class:"label__icon--left",name:"error"}),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"error-message")])):vue.createCommentVNode("v-if",true)],8,_hoisted_4$k)):vue.createCommentVNode("v-if",true)])):(vue.openBlock(),vue.createElementBlock("label",{key:1,class:"label",for:_ctx.forProperty},[vue.renderSlot(_ctx.$slots,"default"),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass:_ctx.descriptionClass,discreteDescriptionClass:_ctx.discreteDescriptionClass}))),vue.createTextVNode(),_ctx.hasErrorMessageSlot?(vue.openBlock(),vue.createElementBlock("span",_hoisted_7$c,[vue.createVNode(_component_f_icon,{class:"label__icon--left",name:"error"}),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"error-message")])):vue.createCommentVNode("v-if",true)],8,_hoisted_6$e));}const FLabel=/* @__PURE__ */_export_sfc(_sfc_main$Q,[["render",_sfc_render$G]]);function resolveWidthClass$1(words,inline){return inline?void 0:words.split(" ").map(word=>`i-width-${word}`).join(" ");}const _sfc_main$P=vue.defineComponent({name:"FSelectField",components:{FIcon,FLabel},inheritAttrs:false,props:{/**
347
347
  * The id for the select id attribute.
348
348
  * The id for the label for attribute.
349
349
  * If the prop is not set a random value will be generated.
@@ -417,7 +417,7 @@ type:Function,required:false,default:void 0},/**
417
417
  * input-width="md-6 lg-3"
418
418
  * ```
419
419
  */inputWidth:{type:String,required:false,default:"sm-12"}},emits:["blur","change","update","update:modelValue"],setup(){return{textFieldTableMode:vue.inject("textFieldTableMode",false)};},data(){return{showErrorPopup:false,viewValue:"",lastModelValue:"",validationMessage:"",validityMode:"INITIAL",// internal default texts possible to override when extending component
420
- defaultText:"",descriptionText:"",descriptionScreenReaderText:"",discreteDescriptionText:"",discreteDescriptionScreenReaderText:""};},computed:{showPopupError(){return this.textFieldTableMode&&this.hasError&&this.showErrorPopup;},labelClass(){return this.textFieldTableMode?"sr-only":"";},isValid(){return this.validityMode==="VALID";},hasError(){return this.validityMode==="ERROR";},rootClass(){return{"text-field--error":this.hasError,"text-field--inline":this.inline,"text-field--table":this.textFieldTableMode};},labelWrapperClass(){return resolveWidthClass(this.labelWidth,this.inline);},inputWrapperClass(){return resolveWidthClass(this.inputWidth,this.inline);},isModelUpdatedProgrammatically(){return this.lastModelValue!==this.modelValue;}},watch:{modelValue:{immediate:true,handler:function(){if(this.modelValue===void 0||this.modelValue===null){this.viewValue="";return;}if(!this.isModelUpdatedProgrammatically){return;}this.setViewValueToFormattedValueOrFallbackToValue();this.lastModelValue=this.modelValue;}}},methods:{getErrorPopupAnchor(){return this.$refs.input;},closePopupError(){this.showErrorPopup=false;},async onChange(){if(!this.$refs.input.hasAttribute("data-validation")){this.$emit("update:modelValue",this.viewValue);this.$emit("update",this.viewValue);await this.$nextTick();this.$emit("change",this.viewValue);}},onFocus(){this.showErrorPopup=true;},async onBlur(){this.showErrorPopup=false;if(!this.$refs.input){return;}if(!this.$refs.input.hasAttribute("data-validation")){this.$emit("update:modelValue",this.viewValue);this.$emit("update",this.viewValue);await this.$nextTick();this.$emit("blur",this.viewValue);}},async onValidity({detail}){this.validationMessage=detail.validationMessage;this.validityMode=detail.validityMode;if(detail.nativeEvent==="change"||detail.nativeEvent==="blur"){let newModelValue;if(detail.isValid){newModelValue=this.resolveNewModelValue(this.viewValue);}else{newModelValue=this.viewValue;}this.lastModelValue=newModelValue;this.$emit("update:modelValue",newModelValue);this.$emit("update",newModelValue);await this.$nextTick();this.$emit(detail.nativeEvent,newModelValue);if(detail.isValid){this.syncViewValueAfterModelUpdate(newModelValue);}}this.triggerComponentValidityEvent(detail);},onPendingValidity(){this.validityMode="INITIAL";},resolveNewModelValue(viewValue){const trimmedViewValue=viewValue.trim();if(trimmedViewValue===""){return"";}else if(logic.isSet(this.parser)){var _this$parser;return(_this$parser=this.parser(trimmedViewValue))!==null&&_this$parser!==void 0?_this$parser:trimmedViewValue;}else if(logic.isSet(this.formatter)){var _this$formatter;return(_this$formatter=this.formatter(trimmedViewValue))!==null&&_this$formatter!==void 0?_this$formatter:trimmedViewValue;}else{return trimmedViewValue;}},syncViewValueAfterModelUpdate(newModelValue){if(newModelValue===""){this.viewValue="";}else if(logic.isSet(this.parser)){if(logic.isSet(this.formatter)){this.viewValue=String(this.formatter(newModelValue)||this.viewValue);}}else{this.viewValue=String(newModelValue);}},triggerComponentValidityEvent(validityEvent){var _renderSlotText4;const errorMessage=(_renderSlotText4=renderSlotText(this.$slots.default,{},{stripClasses:[]}))!==null&&_renderSlotText4!==void 0?_renderSlotText4:this.defaultText;const element=this.$el.querySelector(`#${validityEvent.elementId}`);if(element){dispatchComponentValidityEvent(element,{...validityEvent,errorMessage,focusElementId:validityEvent.elementId});}},setViewValueToFormattedValueOrFallbackToValue(){if(!logic.isSet(this.formatter)){this.viewValue=String(this.modelValue);return;}const parsedValue=logic.isSet(this.parser)&&typeof this.modelValue==="string"?this.parser(this.modelValue):this.modelValue;const formattedValue=logic.isSet(parsedValue)?this.formatter(parsedValue):void 0;this.viewValue=logic.isSet(formattedValue)?formattedValue:String(this.modelValue);}}});const _hoisted_1$z={key:0};const _hoisted_2$r={key:0,class:"sr-only"};const _hoisted_3$o={key:0,class:"sr-only"};const _hoisted_4$j={class:"text-field__icon-wrapper"};const _hoisted_5$h=["id","type"];const _hoisted_6$e={key:2,class:"text-field__append-inner"};function _sfc_render$D(_ctx,_cache,$props,$setup,$data,$options){const _component_f_label=vue.resolveComponent("f-label");const _component_f_icon=vue.resolveComponent("f-icon");const _component_i_popup_error=vue.resolveComponent("i-popup-error");return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["text-field",_ctx.rootClass])},[vue.createElementVNode("div",{class:vue.normalizeClass(_ctx.labelWrapperClass)},[vue.createVNode(_component_f_label,{for:_ctx.id,class:vue.normalizeClass(_ctx.labelClass)},vue.createSlots({default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default",{},()=>[_ctx.defaultText!==""?(vue.openBlock(),vue.createElementBlock("span",_hoisted_1$z,vue.toDisplayString(_ctx.defaultText),1/* TEXT */)):vue.createCommentVNode("v-if",true)])]),description:vue.withCtx(({descriptionClass,discreteDescriptionClass})=>[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass,discreteDescriptionClass})),()=>[_ctx.descriptionText?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(descriptionClass)},[_ctx.descriptionScreenReaderText?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$r,vue.toDisplayString(_ctx.descriptionScreenReaderText),1/* TEXT */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createElementVNode("span",null,vue.toDisplayString(_ctx.descriptionText),1/* TEXT */)],2/* CLASS */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.discreteDescriptionText?(vue.openBlock(),vue.createElementBlock("span",{key:1,class:vue.normalizeClass(discreteDescriptionClass)},[_ctx.discreteDescriptionScreenReaderText?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$o,vue.toDisplayString(_ctx.discreteDescriptionScreenReaderText),1/* TEXT */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createElementVNode("span",null,vue.toDisplayString(_ctx.discreteDescriptionText),1/* TEXT */)],2/* CLASS */)):vue.createCommentVNode("v-if",true)])]),"error-message":vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"error-message",vue.normalizeProps(vue.guardReactiveProps({hasError:_ctx.hasError,validationMessage:_ctx.validationMessage})),()=>[_ctx.hasError?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createTextVNode(vue.toDisplayString(_ctx.validationMessage),1/* TEXT */)],64/* STABLE_FRAGMENT */)):vue.createCommentVNode("v-if",true)])]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1032,["for","class"])],2/* CLASS */),vue.createTextVNode(),vue.createElementVNode("div",{class:vue.normalizeClass(["text-field__input-wrapper",_ctx.inputWrapperClass])},[vue.renderSlot(_ctx.$slots,"input-left"),vue.createTextVNode(),vue.createElementVNode("div",_hoisted_4$j,[vue.withDirectives(vue.createElementVNode("input",vue.mergeProps({id:_ctx.id,ref:"input","onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>_ctx.viewValue=$event),type:_ctx.type,class:"text-field__input"},_ctx.$attrs,{onBlur:_cache[1]||(_cache[1]=(...args)=>_ctx.onBlur&&_ctx.onBlur(...args)),onFocus:_cache[2]||(_cache[2]=(...args)=>_ctx.onFocus&&_ctx.onFocus(...args)),onChange:_cache[3]||(_cache[3]=(...args)=>_ctx.onChange&&_ctx.onChange(...args)),onValidity:_cache[4]||(_cache[4]=(...args)=>_ctx.onValidity&&_ctx.onValidity(...args)),onPendingValidity:_cache[5]||(_cache[5]=(...args)=>_ctx.onPendingValidity&&_ctx.onPendingValidity(...args))}),null,16,_hoisted_5$h),[[vue.vModelDynamic,_ctx.viewValue]]),vue.createTextVNode(),_ctx.hasError&&_ctx.textFieldTableMode?(vue.openBlock(),vue.createBlock(_component_f_icon,{key:0,ref:"icon",class:"text-field__icon input-icon text-field__append-inner text-field__error-popup-icon",name:"error"},null,512/* NEED_PATCH */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.textFieldTableMode?(vue.openBlock(),vue.createBlock(_component_i_popup_error,{key:1,anchor:_ctx.getErrorPopupAnchor(),"is-open":_ctx.showPopupError,"error-message":_ctx.validationMessage,onClose:_ctx.closePopupError},null,8,["anchor","is-open","error-message","onClose"])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.$slots["append-inner"]?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$e,[vue.renderSlot(_ctx.$slots,"append-inner")])):vue.createCommentVNode("v-if",true)]),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"input-right")],2/* CLASS */)],2/* CLASS */);}const FTextField=/* @__PURE__ */_export_sfc(_sfc_main$N,[["render",_sfc_render$D]]);const _sfc_main$M=vue.defineComponent({name:"FEmailTextField",components:{FTextField},mixins:[TranslationMixin],inheritAttrs:false,props:{/**
420
+ defaultText:"",descriptionText:"",descriptionScreenReaderText:"",discreteDescriptionText:"",discreteDescriptionScreenReaderText:""};},computed:{showPopupError(){return this.textFieldTableMode&&this.hasError&&this.showErrorPopup;},labelClass(){return this.textFieldTableMode?"sr-only":"";},isValid(){return this.validityMode==="VALID";},hasError(){return this.validityMode==="ERROR";},rootClass(){return{"text-field--error":this.hasError,"text-field--inline":this.inline,"text-field--table":this.textFieldTableMode};},labelWrapperClass(){return resolveWidthClass(this.labelWidth,this.inline);},inputWrapperClass(){return resolveWidthClass(this.inputWidth,this.inline);},isModelUpdatedProgrammatically(){return this.lastModelValue!==this.modelValue;}},watch:{modelValue:{immediate:true,handler:function(){if(this.modelValue===void 0||this.modelValue===null){this.viewValue="";return;}if(!this.isModelUpdatedProgrammatically){return;}this.setViewValueToFormattedValueOrFallbackToValue();this.lastModelValue=this.modelValue;}}},methods:{getErrorPopupAnchor(){return this.$refs.input;},closePopupError(){this.showErrorPopup=false;},async onChange(){if(!this.$refs.input.hasAttribute("data-validation")){this.$emit("update:modelValue",this.viewValue);this.$emit("update",this.viewValue);await this.$nextTick();this.$emit("change",this.viewValue);}},onFocus(){this.showErrorPopup=true;},async onBlur(){this.showErrorPopup=false;if(!this.$refs.input){return;}if(!this.$refs.input.hasAttribute("data-validation")){this.$emit("update:modelValue",this.viewValue);this.$emit("update",this.viewValue);await this.$nextTick();this.$emit("blur",this.viewValue);}},async onValidity({detail}){this.validationMessage=detail.validationMessage;this.validityMode=detail.validityMode;if(detail.nativeEvent==="change"||detail.nativeEvent==="blur"){let newModelValue;if(detail.isValid){newModelValue=this.resolveNewModelValue(this.viewValue);}else{newModelValue=this.viewValue;}this.lastModelValue=newModelValue;this.$emit("update:modelValue",newModelValue);this.$emit("update",newModelValue);await this.$nextTick();this.$emit(detail.nativeEvent,newModelValue);if(detail.isValid){this.syncViewValueAfterModelUpdate(newModelValue);}}this.triggerComponentValidityEvent(detail);},onPendingValidity(){this.validityMode="INITIAL";},resolveNewModelValue(viewValue){const trimmedViewValue=viewValue.trim();if(trimmedViewValue===""){return"";}else if(logic.isSet(this.parser)){var _this$parser;return(_this$parser=this.parser(trimmedViewValue))!==null&&_this$parser!==void 0?_this$parser:trimmedViewValue;}else if(logic.isSet(this.formatter)){var _this$formatter;return(_this$formatter=this.formatter(trimmedViewValue))!==null&&_this$formatter!==void 0?_this$formatter:trimmedViewValue;}else{return trimmedViewValue;}},syncViewValueAfterModelUpdate(newModelValue){if(newModelValue===""){this.viewValue="";}else if(logic.isSet(this.parser)){if(logic.isSet(this.formatter)){this.viewValue=String(this.formatter(newModelValue)||this.viewValue);}}else{this.viewValue=String(newModelValue);}},triggerComponentValidityEvent(validityEvent){var _renderSlotText4;const errorMessage=(_renderSlotText4=renderSlotText(this.$slots.default,{},{stripClasses:[]}))!==null&&_renderSlotText4!==void 0?_renderSlotText4:this.defaultText;const element=this.$el.querySelector(`#${validityEvent.elementId}`);if(element){dispatchComponentValidityEvent(element,{...validityEvent,errorMessage,focusElementId:validityEvent.elementId});}},setViewValueToFormattedValueOrFallbackToValue(){if(!logic.isSet(this.formatter)){this.viewValue=String(this.modelValue);return;}const parsedValue=logic.isSet(this.parser)&&typeof this.modelValue==="string"?this.parser(this.modelValue):this.modelValue;const formattedValue=logic.isSet(parsedValue)?this.formatter(parsedValue):void 0;this.viewValue=logic.isSet(formattedValue)?formattedValue:String(this.modelValue);}}});const _hoisted_1$z={key:0};const _hoisted_2$r={key:0,class:"sr-only"};const _hoisted_3$o={key:0,class:"sr-only"};const _hoisted_4$j={class:"text-field__icon-wrapper"};const _hoisted_5$h=["id","type"];const _hoisted_6$d={key:2,class:"text-field__append-inner"};function _sfc_render$D(_ctx,_cache,$props,$setup,$data,$options){const _component_f_label=vue.resolveComponent("f-label");const _component_f_icon=vue.resolveComponent("f-icon");const _component_i_popup_error=vue.resolveComponent("i-popup-error");return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["text-field",_ctx.rootClass])},[vue.createElementVNode("div",{class:vue.normalizeClass(_ctx.labelWrapperClass)},[vue.createVNode(_component_f_label,{for:_ctx.id,class:vue.normalizeClass(_ctx.labelClass)},vue.createSlots({default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default",{},()=>[_ctx.defaultText!==""?(vue.openBlock(),vue.createElementBlock("span",_hoisted_1$z,vue.toDisplayString(_ctx.defaultText),1/* TEXT */)):vue.createCommentVNode("v-if",true)])]),description:vue.withCtx(({descriptionClass,discreteDescriptionClass})=>[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass,discreteDescriptionClass})),()=>[_ctx.descriptionText?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(descriptionClass)},[_ctx.descriptionScreenReaderText?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$r,vue.toDisplayString(_ctx.descriptionScreenReaderText),1/* TEXT */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createElementVNode("span",null,vue.toDisplayString(_ctx.descriptionText),1/* TEXT */)],2/* CLASS */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.discreteDescriptionText?(vue.openBlock(),vue.createElementBlock("span",{key:1,class:vue.normalizeClass(discreteDescriptionClass)},[_ctx.discreteDescriptionScreenReaderText?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$o,vue.toDisplayString(_ctx.discreteDescriptionScreenReaderText),1/* TEXT */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createElementVNode("span",null,vue.toDisplayString(_ctx.discreteDescriptionText),1/* TEXT */)],2/* CLASS */)):vue.createCommentVNode("v-if",true)])]),"error-message":vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"error-message",vue.normalizeProps(vue.guardReactiveProps({hasError:_ctx.hasError,validationMessage:_ctx.validationMessage})),()=>[_ctx.hasError?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createTextVNode(vue.toDisplayString(_ctx.validationMessage),1/* TEXT */)],64/* STABLE_FRAGMENT */)):vue.createCommentVNode("v-if",true)])]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1032,["for","class"])],2/* CLASS */),vue.createTextVNode(),vue.createElementVNode("div",{class:vue.normalizeClass(["text-field__input-wrapper",_ctx.inputWrapperClass])},[vue.renderSlot(_ctx.$slots,"input-left"),vue.createTextVNode(),vue.createElementVNode("div",_hoisted_4$j,[vue.withDirectives(vue.createElementVNode("input",vue.mergeProps({id:_ctx.id,ref:"input","onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>_ctx.viewValue=$event),type:_ctx.type,class:"text-field__input"},_ctx.$attrs,{onBlur:_cache[1]||(_cache[1]=(...args)=>_ctx.onBlur&&_ctx.onBlur(...args)),onFocus:_cache[2]||(_cache[2]=(...args)=>_ctx.onFocus&&_ctx.onFocus(...args)),onChange:_cache[3]||(_cache[3]=(...args)=>_ctx.onChange&&_ctx.onChange(...args)),onValidity:_cache[4]||(_cache[4]=(...args)=>_ctx.onValidity&&_ctx.onValidity(...args)),onPendingValidity:_cache[5]||(_cache[5]=(...args)=>_ctx.onPendingValidity&&_ctx.onPendingValidity(...args))}),null,16,_hoisted_5$h),[[vue.vModelDynamic,_ctx.viewValue]]),vue.createTextVNode(),_ctx.hasError&&_ctx.textFieldTableMode?(vue.openBlock(),vue.createBlock(_component_f_icon,{key:0,ref:"icon",class:"text-field__icon input-icon text-field__append-inner text-field__error-popup-icon",name:"error"},null,512/* NEED_PATCH */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.textFieldTableMode?(vue.openBlock(),vue.createBlock(_component_i_popup_error,{key:1,anchor:_ctx.getErrorPopupAnchor(),"is-open":_ctx.showPopupError,"error-message":_ctx.validationMessage,onClose:_ctx.closePopupError},null,8,["anchor","is-open","error-message","onClose"])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.$slots["append-inner"]?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$d,[vue.renderSlot(_ctx.$slots,"append-inner")])):vue.createCommentVNode("v-if",true)]),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"input-right")],2/* CLASS */)],2/* CLASS */);}const FTextField=/* @__PURE__ */_export_sfc(_sfc_main$N,[["render",_sfc_render$D]]);const _sfc_main$M=vue.defineComponent({name:"FEmailTextField",components:{FTextField},mixins:[TranslationMixin],inheritAttrs:false,props:{/**
421
421
  * The id for the input id attribute.
422
422
  * The id for the label for attribute.
423
423
  * If the prop is not set a random value will be generated.
@@ -457,7 +457,7 @@ defaultText:"",descriptionText:"",descriptionScreenReaderText:"",discreteDescrip
457
457
  * Default is textkey "fkui.sort-filter-dataset.placeholder.filter"
458
458
  */placeholderFilter:{type:String,required:false,default:TranslationMixin.methods.$t("fkui.sort-filter-dataset.placeholder.filter","Sök")},/**
459
459
  * The order the data will be sorted by if defaultSortAttribute has been set.
460
- */defaultSortAscending:{type:Boolean,required:false,default:()=>true}},emits:["datasetSorted","usedSortAttributes"],data(){return{searchString:"",sortAttribute:{attribute:"",ascending:false},sortFilterResult:[],tableCallbackOnSort:()=>{return;},tableCallbackSortableColumns:()=>{return;}};},computed:{showClearButton(){return this.searchString.length>0;},sortOrders(){const arr=[];let id=0;Object.keys(this.sortableAttributes).forEach(key=>{arr.push({attribute:key,name:this.sortableAttributes[key],ascendingName:this.$t("fkui.sort-filter-dataset.label.ascending","stigande"),ascending:true,id:id++});arr.push({attribute:key,name:this.sortableAttributes[key],ascendingName:this.$t("fkui.sort-filter-dataset.label.descending","fallande"),ascending:false,id:id++});});return arr;},filterAttributes(){return Object.keys(this.sortableAttributes);}},watch:{data:{immediate:true,deep:true,handler:function(){if(this.defaultSortAttribute!==""){const foundAttribute=this.sortOrders.find(item=>item.attribute===this.defaultSortAttribute&&item.ascending===this.defaultSortAscending);if(foundAttribute){this.sortAttribute=foundAttribute;}}this.sortFilterData();}}},created(){this.debouncedFilterResultset=logic.debounce(this.filterResultset,250).bind(this);},mounted(){this.tableCallbackSortableColumns(Object.keys(this.sortableAttributes));},methods:{sortFilterData(){const filteredData=filter(this.data,this.filterAttributes,this.searchString);if(this.sortAttribute.attribute===""){this.sortFilterResult=filteredData;}else{this.sortFilterResult=sort([...filteredData],this.sortAttribute.attribute,this.sortAttribute.ascending);}this.$nextTick(()=>{this.tableCallbackOnSort(this.sortAttribute.attribute,this.sortAttribute.ascending);});this.$emit("datasetSorted",this.sortFilterResult);},onChangeSortAttribute(){this.sortFilterData();this.$emit("usedSortAttributes",this.sortAttribute);},onSearchInput(event){this.searchString=event.target.value;this.debouncedFilterResultset();},onClickClearSearch(){this.searchString="";this.sortFilterData();const input=this.$el.querySelector(".text-field--inline input");logic.focus(input);},debouncedFilterResultset(){},filterResultset(){this.sortFilterData();if(this.searchString===""){logic.alertScreenReader(this.$t("fkui.sort-filter-dataset.aria-live.empty","Sök redigera Sök tom"));}else{const searchAriaLive=this.$t("fkui.sort-filter-dataset.aria-live.search",`Din sökning på "{{ search }}" gav {{ result }} träffar.`,{result:this.sortFilterResult.length,search:this.searchString});logic.alertScreenReader(searchAriaLive);}}}});const _hoisted_1$w={class:"sort-filter-dataset"};const _hoisted_2$q={class:"sort-filter-dataset__search"};const _hoisted_3$n={class:"sr-only"};const _hoisted_4$i=["title"];const _hoisted_5$g={class:"sr-only"};const _hoisted_6$d={value:{attribute:"",ascending:false}};const _hoisted_7$b=["value"];function _sfc_render$z(_ctx,_cache,$props,$setup,$data,$options){const _component_i_flex_item=vue.resolveComponent("i-flex-item");const _component_f_icon=vue.resolveComponent("f-icon");const _component_f_text_field=vue.resolveComponent("f-text-field");const _component_f_select_field=vue.resolveComponent("f-select-field");const _component_i_flex=vue.resolveComponent("i-flex");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$w,[vue.createVNode(_component_i_flex,{collapse:"",gap:"3x",wrap:""},{default:vue.withCtx(()=>[vue.createVNode(_component_i_flex_item,{shrink:"",align:"center"},{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"header",vue.normalizeProps(vue.guardReactiveProps({slotClass:"sort-filter-dataset__toolbar__header"})))]),_:3/* FORWARDED */}),vue.createTextVNode(),vue.createVNode(_component_i_flex_item,{grow:""},{default:vue.withCtx(()=>[vue.createVNode(_component_i_flex,{collapse:"",float:"right"},{default:vue.withCtx(()=>[_ctx.showFilter?(vue.openBlock(),vue.createBlock(_component_i_flex_item,{key:0,shrink:"",align:"center"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$q,[vue.createVNode(_component_f_icon,{name:"search",class:"sort-filter-dataset__search__magnify-icon"}),vue.createTextVNode(),vue.createVNode(_component_f_text_field,{modelValue:_ctx.searchString,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>_ctx.searchString=$event),inline:"",placeholder:_ctx.placeholderFilter,maxlength:"64",onInput:_ctx.onSearchInput},{default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_3$n,vue.toDisplayString(_ctx.placeholderFilter),1/* TEXT */)]),_:1/* STABLE */},8,["modelValue","placeholder","onInput"]),vue.createTextVNode(),_ctx.showClearButton?(vue.openBlock(),vue.createElementBlock("button",{key:0,type:"button",class:"button button--discrete sort-filter-dataset__search__close-icon",title:_ctx.$t("fkui.sort-filter-dataset.clear.filter","Rensa sökfält"),onClick:_cache[1]||(_cache[1]=(...args)=>_ctx.onClickClearSearch&&_ctx.onClickClearSearch(...args))},[vue.createVNode(_component_f_icon,{name:"close"}),vue.createTextVNode(),vue.createElementVNode("span",_hoisted_5$g,vue.toDisplayString(_ctx.$t("fkui.sort-filter-dataset.clear.filter","Rensa sökfält")),1/* TEXT */)],8,_hoisted_4$i)):vue.createCommentVNode("v-if",true)])]),_:1/* STABLE */})):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.showSort?(vue.openBlock(),vue.createBlock(_component_i_flex_item,{key:1,shrink:"",align:"center"},{default:vue.withCtx(()=>[vue.createVNode(_component_f_select_field,{modelValue:_ctx.sortAttribute,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>_ctx.sortAttribute=$event),class:"sort-filter-dataset__sort",inline:"",onChange:_ctx.onChangeSortAttribute},{label:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.sort-filter-dataset.label.sort","Sortera på")),1/* TEXT */)]),default:vue.withCtx(()=>[vue.createTextVNode(),vue.createElementVNode("option",_hoisted_6$d,vue.toDisplayString(_ctx.$t("fkui.sort-filter-dataset.label.unsorted","Välj")),1/* TEXT */),vue.createTextVNode(),(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.sortOrders,sortOrder=>{return vue.openBlock(),vue.createElementBlock("option",{key:sortOrder.id,value:sortOrder},vue.toDisplayString(sortOrder.name)+" ("+vue.toDisplayString(sortOrder.ascendingName)+")\n ",9,_hoisted_7$b);}),128/* KEYED_FRAGMENT */))]),_:1/* STABLE */},8,["modelValue","onChange"])]),_:1/* STABLE */})):vue.createCommentVNode("v-if",true)]),_:1/* STABLE */})]),_:1/* STABLE */})]),_:3/* FORWARDED */}),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"default",vue.normalizeProps(vue.guardReactiveProps({sortFilterResult:_ctx.sortFilterResult})))]);}const FSortFilterDataset=/* @__PURE__ */_export_sfc(_sfc_main$z,[["render",_sfc_render$z]]);const _sfc_main$y=vue.defineComponent({name:"FDataTable",components:{FIcon},mixins:[TranslationMixin],provide(){return{addColumn:column=>{if(column.type===FTableColumnType.ACTION){throw new Error("Cannot use action column in FDataTable component");}this.columns=addColumn(this.columns,column);},setVisibilityColumn:(id,visible)=>{setVisibilityColumn(this.columns,id,visible);},textFieldTableMode:true};},inheritAttrs:false,props:{/**
460
+ */defaultSortAscending:{type:Boolean,required:false,default:()=>true}},emits:["datasetSorted","usedSortAttributes"],data(){return{searchString:"",sortAttribute:{attribute:"",ascending:false},sortFilterResult:[],tableCallbackOnSort:()=>{return;},tableCallbackSortableColumns:()=>{return;}};},computed:{showClearButton(){return this.searchString.length>0;},sortOrders(){const arr=[];let id=0;Object.keys(this.sortableAttributes).forEach(key=>{arr.push({attribute:key,name:this.sortableAttributes[key],ascendingName:this.$t("fkui.sort-filter-dataset.label.ascending","stigande"),ascending:true,id:id++});arr.push({attribute:key,name:this.sortableAttributes[key],ascendingName:this.$t("fkui.sort-filter-dataset.label.descending","fallande"),ascending:false,id:id++});});return arr;},filterAttributes(){return Object.keys(this.sortableAttributes);}},watch:{data:{immediate:true,deep:true,handler:function(){if(this.defaultSortAttribute!==""){const foundAttribute=this.sortOrders.find(item=>item.attribute===this.defaultSortAttribute&&item.ascending===this.defaultSortAscending);if(foundAttribute){this.sortAttribute=foundAttribute;}}this.sortFilterData();}}},created(){this.debouncedFilterResultset=logic.debounce(this.filterResultset,250).bind(this);},mounted(){this.tableCallbackSortableColumns(Object.keys(this.sortableAttributes));},methods:{sortFilterData(){const filteredData=filter(this.data,this.filterAttributes,this.searchString);if(this.sortAttribute.attribute===""){this.sortFilterResult=filteredData;}else{this.sortFilterResult=sort([...filteredData],this.sortAttribute.attribute,this.sortAttribute.ascending);}this.$nextTick(()=>{this.tableCallbackOnSort(this.sortAttribute.attribute,this.sortAttribute.ascending);});this.$emit("datasetSorted",this.sortFilterResult);},onChangeSortAttribute(){this.sortFilterData();this.$emit("usedSortAttributes",this.sortAttribute);},onSearchInput(event){this.searchString=event.target.value;this.debouncedFilterResultset();},onClickClearSearch(){this.searchString="";this.sortFilterData();const input=this.$el.querySelector(".text-field--inline input");logic.focus(input);},debouncedFilterResultset(){},filterResultset(){this.sortFilterData();if(this.searchString===""){logic.alertScreenReader(this.$t("fkui.sort-filter-dataset.aria-live.empty","Sök redigera Sök tom"));}else{const searchAriaLive=this.$t("fkui.sort-filter-dataset.aria-live.search",`Din sökning på "{{ search }}" gav {{ result }} träffar.`,{result:this.sortFilterResult.length,search:this.searchString});logic.alertScreenReader(searchAriaLive);}}}});const _hoisted_1$w={class:"sort-filter-dataset"};const _hoisted_2$q={class:"sort-filter-dataset__search"};const _hoisted_3$n={class:"sr-only"};const _hoisted_4$i=["title"];const _hoisted_5$g={class:"sr-only"};const _hoisted_6$c={value:{attribute:"",ascending:false}};const _hoisted_7$b=["value"];function _sfc_render$z(_ctx,_cache,$props,$setup,$data,$options){const _component_i_flex_item=vue.resolveComponent("i-flex-item");const _component_f_icon=vue.resolveComponent("f-icon");const _component_f_text_field=vue.resolveComponent("f-text-field");const _component_f_select_field=vue.resolveComponent("f-select-field");const _component_i_flex=vue.resolveComponent("i-flex");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$w,[vue.createVNode(_component_i_flex,{collapse:"",gap:"3x",wrap:""},{default:vue.withCtx(()=>[vue.createVNode(_component_i_flex_item,{shrink:"",align:"center"},{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"header",vue.normalizeProps(vue.guardReactiveProps({slotClass:"sort-filter-dataset__toolbar__header"})))]),_:3/* FORWARDED */}),vue.createTextVNode(),vue.createVNode(_component_i_flex_item,{grow:""},{default:vue.withCtx(()=>[vue.createVNode(_component_i_flex,{collapse:"",float:"right"},{default:vue.withCtx(()=>[_ctx.showFilter?(vue.openBlock(),vue.createBlock(_component_i_flex_item,{key:0,shrink:"",align:"center"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$q,[vue.createVNode(_component_f_icon,{name:"search",class:"sort-filter-dataset__search__magnify-icon"}),vue.createTextVNode(),vue.createVNode(_component_f_text_field,{modelValue:_ctx.searchString,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>_ctx.searchString=$event),inline:"",placeholder:_ctx.placeholderFilter,maxlength:"64",onInput:_ctx.onSearchInput},{default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_3$n,vue.toDisplayString(_ctx.placeholderFilter),1/* TEXT */)]),_:1/* STABLE */},8,["modelValue","placeholder","onInput"]),vue.createTextVNode(),_ctx.showClearButton?(vue.openBlock(),vue.createElementBlock("button",{key:0,type:"button",class:"button button--discrete sort-filter-dataset__search__close-icon",title:_ctx.$t("fkui.sort-filter-dataset.clear.filter","Rensa sökfält"),onClick:_cache[1]||(_cache[1]=(...args)=>_ctx.onClickClearSearch&&_ctx.onClickClearSearch(...args))},[vue.createVNode(_component_f_icon,{name:"close"}),vue.createTextVNode(),vue.createElementVNode("span",_hoisted_5$g,vue.toDisplayString(_ctx.$t("fkui.sort-filter-dataset.clear.filter","Rensa sökfält")),1/* TEXT */)],8,_hoisted_4$i)):vue.createCommentVNode("v-if",true)])]),_:1/* STABLE */})):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.showSort?(vue.openBlock(),vue.createBlock(_component_i_flex_item,{key:1,shrink:"",align:"center"},{default:vue.withCtx(()=>[vue.createVNode(_component_f_select_field,{modelValue:_ctx.sortAttribute,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>_ctx.sortAttribute=$event),class:"sort-filter-dataset__sort",inline:"",onChange:_ctx.onChangeSortAttribute},{label:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.sort-filter-dataset.label.sort","Sortera på")),1/* TEXT */)]),default:vue.withCtx(()=>[vue.createTextVNode(),vue.createElementVNode("option",_hoisted_6$c,vue.toDisplayString(_ctx.$t("fkui.sort-filter-dataset.label.unsorted","Välj")),1/* TEXT */),vue.createTextVNode(),(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.sortOrders,sortOrder=>{return vue.openBlock(),vue.createElementBlock("option",{key:sortOrder.id,value:sortOrder},vue.toDisplayString(sortOrder.name)+" ("+vue.toDisplayString(sortOrder.ascendingName)+")\n ",9,_hoisted_7$b);}),128/* KEYED_FRAGMENT */))]),_:1/* STABLE */},8,["modelValue","onChange"])]),_:1/* STABLE */})):vue.createCommentVNode("v-if",true)]),_:1/* STABLE */})]),_:1/* STABLE */})]),_:3/* FORWARDED */}),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"default",vue.normalizeProps(vue.guardReactiveProps({sortFilterResult:_ctx.sortFilterResult})))]);}const FSortFilterDataset=/* @__PURE__ */_export_sfc(_sfc_main$z,[["render",_sfc_render$z]]);const _sfc_main$y=vue.defineComponent({name:"FDataTable",components:{FIcon},mixins:[TranslationMixin],provide(){return{addColumn:column=>{if(column.type===FTableColumnType.ACTION){throw new Error("Cannot use action column in FDataTable component");}this.columns=addColumn(this.columns,column);},setVisibilityColumn:(id,visible)=>{setVisibilityColumn(this.columns,id,visible);},textFieldTableMode:true};},inheritAttrs:false,props:{/**
461
461
  * The rows to be listed.
462
462
  * The rows will be listed in the given array order.
463
463
  */rows:{type:Array,required:true},/**
@@ -473,7 +473,7 @@ defaultText:"",descriptionText:"",descriptionScreenReaderText:"",discreteDescrip
473
473
  * - `"vertical"`: Enables vertical scrolling
474
474
  * - `"both"`: Enables scrolling in both directions
475
475
  * - `"none"`: Disables scrolling (default)
476
- */scroll:{type:String,default:TableScroll.NONE,validator:function(value){const types=Object.values(TableScroll);return types.includes(value);}}},setup(){return FSortFilterDatasetInjected();},data(){return{columns:[],emptyRow:emptyTableRow()};},computed:{hasCaption(){return hasSlot(this,"caption");},tableClasses(){const classes=[];if(this.striped){classes.push("table--striped");}return classes;},isEmpty(){return this.rows.length===0;},visibleColumns(){return this.columns.filter(col=>col.visible);},hasInitiateColumns(){return this.columns.length>0;},wrapperClasses(){return tableScrollClasses(this.scroll);},tabindex(){return this.scroll!==TableScroll.NONE?0:void 0;}},mounted(){this.registerCallbackOnSort(this.callbackOnSort);this.registerCallbackOnMount(this.callbackSortableColumns);},methods:{rowKey(item){const key=item[this.keyAttribute];if(typeof key==="undefined"){throw new Error(`Key attribute [${this.keyAttribute}]' is missing in row`);}return String(key);},columnClasses(column){const classes=["table__column",`table__column--${column.type}`,column.size];if(column.sortable){classes.push("table__column--sortable");}return classes;},iconClasses(column){return getSortableIconClasses(column);},iconName(column){return getSortableIconName(column);},onClickColumnHeader(column){if(!column.sortable){return;}let columnName=column.name;if(column.sort===FTableColumnSort.DESCENDING){columnName="";column.sort=FTableColumnSort.UNSORTED;}this.sort(columnName,column.sort!==FTableColumnSort.ASCENDING);},callbackOnSort(columnName,ascending){updateSortOrder(this.columns,columnName,ascending);},callbackSortableColumns(columnNames){setSortableColumns(this.columns,columnNames);},escapeNewlines(value){return value.replace(/\n/g,"<br/>");}}});const _hoisted_1$v=["tabindex"];const _hoisted_2$p={key:0};const _hoisted_3$m={class:"table__row"};const _hoisted_4$h=["innerHTML"];const _hoisted_5$f={key:1,class:"table__column__description"};const _hoisted_6$c={key:0};const _hoisted_7$a={key:1};const _hoisted_8$8=["colspan"];function _sfc_render$y(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(_ctx.wrapperClasses)},[vue.createElementVNode("table",vue.mergeProps({class:["table",_ctx.tableClasses],tabindex:_ctx.tabindex},_ctx.$attrs),[_ctx.hasCaption?(vue.openBlock(),vue.createElementBlock("caption",_hoisted_2$p,[vue.renderSlot(_ctx.$slots,"caption")])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createElementVNode("colgroup",null,[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.columns,column=>{return vue.openBlock(),vue.createElementBlock("col",{key:column.id,class:vue.normalizeClass(column.size)},null,2/* CLASS */);}),128/* KEYED_FRAGMENT */))]),vue.createTextVNode(),vue.createElementVNode("thead",null,[vue.createElementVNode("tr",_hoisted_3$m,[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.visibleColumns,column=>{return vue.openBlock(),vue.createElementBlock("th",vue.mergeProps({key:column.id,scope:"col",class:_ctx.columnClasses(column)},vue.toHandlers(column.sortable?{click:()=>_ctx.onClickColumnHeader(column)}:{},true)),[vue.createElementVNode("span",{innerHTML:_ctx.escapeNewlines(column.title)},null,8,_hoisted_4$h),vue.createTextVNode(),column.sortable?(vue.openBlock(),vue.createBlock(_component_f_icon,{key:0,class:vue.normalizeClass(_ctx.iconClasses(column)),name:_ctx.iconName(column)},null,8,["class","name"])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),column.description?(vue.openBlock(),vue.createElementBlock("span",_hoisted_5$f,vue.toDisplayString(column.description),1/* TEXT */)):vue.createCommentVNode("v-if",true)],16/* FULL_PROPS */);}),128/* KEYED_FRAGMENT */))])]),vue.createTextVNode(),vue.createElementVNode("tbody",null,[!_ctx.hasInitiateColumns?(vue.openBlock(),vue.createElementBlock("tr",_hoisted_6$c,[vue.renderSlot(_ctx.$slots,"default",vue.normalizeProps(vue.guardReactiveProps({row:_ctx.emptyRow})))])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.isEmpty?(vue.openBlock(),vue.createElementBlock("tr",_hoisted_7$a,[vue.createElementVNode("td",{class:"table__column table__column--action",colspan:_ctx.columns.length},[vue.renderSlot(_ctx.$slots,"empty",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.data-table.empty","Tabellen är tom")),1/* TEXT */)])],8,_hoisted_8$8)])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.rows,row=>{return vue.openBlock(),vue.createElementBlock("tr",{key:_ctx.rowKey(row),class:"table__row"},[vue.renderSlot(_ctx.$slots,"default",vue.mergeProps({ref_for:true},{row}))]);}),128/* KEYED_FRAGMENT */))])],16,_hoisted_1$v)],2/* CLASS */);}const FDataTable=/* @__PURE__ */_export_sfc(_sfc_main$y,[["render",_sfc_render$y]]);function isDayEnabled(day,config2){return passesMinDate(day,config2.minDate)&&passesMaxDate(day,config2.maxDate)&&passesInvalidDates(day,config2.invalidDates)&&passesInvalidWeekdays(day,config2.invalidWeekdays);}function passesMinDate(day,config2){if(!config2){throw new Error("MinDate validator must be set");}if(!config2.limit){throw new Error("Invalid minDate config");}return config2.limit<=day.toString();}function passesMaxDate(day,config2){if(!config2){throw new Error("MaxDate validator must be set");}if(!config2.limit){throw new Error("Invalid maxDate config");}return day.toString()<=config2.limit;}function passesInvalidDates(day,config2){if(!config2){return true;}if(!logic.isInvalidDatesConfig(config2)){throw new Error("Invalid invalidDates config");}return!config2.dates.includes(day.toString());}function passesInvalidWeekdays(day,config2){if(!config2){return true;}if(!logic.isInvalidWeekdaysConfig(config2)){throw new Error("Invalid invalidWeekdays config");}return!config2.days.includes(day.weekDay);}function updateCalendarValue(newValue){const newCalendarValue=date.FDate.fromIso(newValue);if(!newCalendarValue.isValid()){this.calendarValue=void 0;}else if(isInvalidMonth(newCalendarValue,this.minDate,this.maxDate)){this.calendarValue=void 0;}else if(!this.isDateEnabled(newCalendarValue)){this.calendarValue=void 0;}else if(!this.calendarValue||!this.calendarValue.equals(newCalendarValue)){this.calendarValue=newCalendarValue;}}function getDisplayMonth(minDate,maxDate,selectedDate,initialMonth){let effectiveDate;if(selectedDate&&selectedDate.isValid()){effectiveDate=selectedDate;}else if(initialMonth&&initialMonth.isValid()){effectiveDate=initialMonth;}else{effectiveDate=date.FDate.now();}let month;if(!isInvalidMonth(effectiveDate,minDate,maxDate)){month=effectiveDate.startOfMonth();}else if(isMonthBefore(effectiveDate,minDate)){month=minDate==null?void 0:minDate.startOfMonth();}else if(isMonthAfter(effectiveDate,maxDate)){month=maxDate==null?void 0:maxDate.startOfMonth();}return month||date.FDate.now().startOfMonth();}const _sfc_main$x=vue.defineComponent({name:"FDatepickerField",components:{FCalendar,IPopup,FTextField,FIcon,FCalendarDay},mixins:[TranslationMixin],inheritAttrs:false,props:{/** Selected day.
476
+ */scroll:{type:String,default:TableScroll.NONE,validator:function(value){const types=Object.values(TableScroll);return types.includes(value);}}},setup(){return FSortFilterDatasetInjected();},data(){return{columns:[],emptyRow:emptyTableRow()};},computed:{hasCaption(){return hasSlot(this,"caption");},tableClasses(){const classes=[];if(this.striped){classes.push("table--striped");}return classes;},isEmpty(){return this.rows.length===0;},visibleColumns(){return this.columns.filter(col=>col.visible);},hasInitiateColumns(){return this.columns.length>0;},wrapperClasses(){return tableScrollClasses(this.scroll);},tabindex(){return this.scroll!==TableScroll.NONE?0:void 0;}},mounted(){this.registerCallbackOnSort(this.callbackOnSort);this.registerCallbackOnMount(this.callbackSortableColumns);},methods:{rowKey(item){const key=item[this.keyAttribute];if(typeof key==="undefined"){throw new Error(`Key attribute [${this.keyAttribute}]' is missing in row`);}return String(key);},columnClasses(column){const classes=["table__column",`table__column--${column.type}`,column.size];if(column.sortable){classes.push("table__column--sortable");}return classes;},iconClasses(column){return getSortableIconClasses(column);},iconName(column){return getSortableIconName(column);},onClickColumnHeader(column){if(!column.sortable){return;}let columnName=column.name;if(column.sort===FTableColumnSort.DESCENDING){columnName="";column.sort=FTableColumnSort.UNSORTED;}this.sort(columnName,column.sort!==FTableColumnSort.ASCENDING);},callbackOnSort(columnName,ascending){updateSortOrder(this.columns,columnName,ascending);},callbackSortableColumns(columnNames){setSortableColumns(this.columns,columnNames);},escapeNewlines(value){return value.replace(/\n/g,"<br/>");}}});const _hoisted_1$v=["tabindex"];const _hoisted_2$p={key:0};const _hoisted_3$m={class:"table__row"};const _hoisted_4$h=["innerHTML"];const _hoisted_5$f={key:1,class:"table__column__description"};const _hoisted_6$b={key:0};const _hoisted_7$a={key:1};const _hoisted_8$8=["colspan"];function _sfc_render$y(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(_ctx.wrapperClasses)},[vue.createElementVNode("table",vue.mergeProps({class:["table",_ctx.tableClasses],tabindex:_ctx.tabindex},_ctx.$attrs),[_ctx.hasCaption?(vue.openBlock(),vue.createElementBlock("caption",_hoisted_2$p,[vue.renderSlot(_ctx.$slots,"caption")])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createElementVNode("colgroup",null,[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.columns,column=>{return vue.openBlock(),vue.createElementBlock("col",{key:column.id,class:vue.normalizeClass(column.size)},null,2/* CLASS */);}),128/* KEYED_FRAGMENT */))]),vue.createTextVNode(),vue.createElementVNode("thead",null,[vue.createElementVNode("tr",_hoisted_3$m,[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.visibleColumns,column=>{return vue.openBlock(),vue.createElementBlock("th",vue.mergeProps({key:column.id,scope:"col",class:_ctx.columnClasses(column)},vue.toHandlers(column.sortable?{click:()=>_ctx.onClickColumnHeader(column)}:{},true)),[vue.createElementVNode("span",{innerHTML:_ctx.escapeNewlines(column.title)},null,8,_hoisted_4$h),vue.createTextVNode(),column.sortable?(vue.openBlock(),vue.createBlock(_component_f_icon,{key:0,class:vue.normalizeClass(_ctx.iconClasses(column)),name:_ctx.iconName(column)},null,8,["class","name"])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),column.description?(vue.openBlock(),vue.createElementBlock("span",_hoisted_5$f,vue.toDisplayString(column.description),1/* TEXT */)):vue.createCommentVNode("v-if",true)],16/* FULL_PROPS */);}),128/* KEYED_FRAGMENT */))])]),vue.createTextVNode(),vue.createElementVNode("tbody",null,[!_ctx.hasInitiateColumns?(vue.openBlock(),vue.createElementBlock("tr",_hoisted_6$b,[vue.renderSlot(_ctx.$slots,"default",vue.normalizeProps(vue.guardReactiveProps({row:_ctx.emptyRow})))])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.isEmpty?(vue.openBlock(),vue.createElementBlock("tr",_hoisted_7$a,[vue.createElementVNode("td",{class:"table__column table__column--action",colspan:_ctx.columns.length},[vue.renderSlot(_ctx.$slots,"empty",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.data-table.empty","Tabellen är tom")),1/* TEXT */)])],8,_hoisted_8$8)])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.rows,row=>{return vue.openBlock(),vue.createElementBlock("tr",{key:_ctx.rowKey(row),class:"table__row"},[vue.renderSlot(_ctx.$slots,"default",vue.mergeProps({ref_for:true},{row}))]);}),128/* KEYED_FRAGMENT */))])],16,_hoisted_1$v)],2/* CLASS */);}const FDataTable=/* @__PURE__ */_export_sfc(_sfc_main$y,[["render",_sfc_render$y]]);function isDayEnabled(day,config2){return passesMinDate(day,config2.minDate)&&passesMaxDate(day,config2.maxDate)&&passesInvalidDates(day,config2.invalidDates)&&passesInvalidWeekdays(day,config2.invalidWeekdays);}function passesMinDate(day,config2){if(!config2){throw new Error("MinDate validator must be set");}if(!config2.limit){throw new Error("Invalid minDate config");}return config2.limit<=day.toString();}function passesMaxDate(day,config2){if(!config2){throw new Error("MaxDate validator must be set");}if(!config2.limit){throw new Error("Invalid maxDate config");}return day.toString()<=config2.limit;}function passesInvalidDates(day,config2){if(!config2){return true;}if(!logic.isInvalidDatesConfig(config2)){throw new Error("Invalid invalidDates config");}return!config2.dates.includes(day.toString());}function passesInvalidWeekdays(day,config2){if(!config2){return true;}if(!logic.isInvalidWeekdaysConfig(config2)){throw new Error("Invalid invalidWeekdays config");}return!config2.days.includes(day.weekDay);}function updateCalendarValue(newValue){const newCalendarValue=date.FDate.fromIso(newValue);if(!newCalendarValue.isValid()){this.calendarValue=void 0;}else if(isInvalidMonth(newCalendarValue,this.minDate,this.maxDate)){this.calendarValue=void 0;}else if(!this.isDateEnabled(newCalendarValue)){this.calendarValue=void 0;}else if(!this.calendarValue||!this.calendarValue.equals(newCalendarValue)){this.calendarValue=newCalendarValue;}}function getDisplayMonth(minDate,maxDate,selectedDate,initialMonth){let effectiveDate;if(selectedDate&&selectedDate.isValid()){effectiveDate=selectedDate;}else if(initialMonth&&initialMonth.isValid()){effectiveDate=initialMonth;}else{effectiveDate=date.FDate.now();}let month;if(!isInvalidMonth(effectiveDate,minDate,maxDate)){month=effectiveDate.startOfMonth();}else if(isMonthBefore(effectiveDate,minDate)){month=minDate==null?void 0:minDate.startOfMonth();}else if(isMonthAfter(effectiveDate,maxDate)){month=maxDate==null?void 0:maxDate.startOfMonth();}return month||date.FDate.now().startOfMonth();}const _sfc_main$x=vue.defineComponent({name:"FDatepickerField",components:{FCalendar,IPopup,FTextField,FIcon,FCalendarDay},mixins:[TranslationMixin],inheritAttrs:false,props:{/** Selected day.
477
477
  * @model
478
478
  */modelValue:{type:String,required:false,default:""},/**
479
479
  * Initial month. Applies when no day is selected.
@@ -508,7 +508,7 @@ defaultText:"",descriptionText:"",descriptionScreenReaderText:"",discreteDescrip
508
508
  * Number of notifications present in panel.
509
509
  *
510
510
  * If set to zero (default) no notification badge will be displayed.
511
- */notifications:{type:Number,required:false,default:0},screenReaderNotificationTemplate:{type:String,required:false,default:"Du har %VALUE% notifieringar."}},emits:["toggle"],computed:{expandedClass(){return this.expanded?"expandable-panel--expanded":"expandable-panel--collapsed";},hasOutsideSlot(){return hasSlot(this,"outside");},haveNotifications(){return this.notifications>0;},screenReaderNotificationText(){return`${this.screenReaderNotificationTemplate.replace("%VALUE%",this.notifications.toString())}`;}},methods:{onClickHeadingButton(event){this.$emit("toggle",event);}}});const _hoisted_1$t=["aria-expanded","aria-controls"];const _hoisted_2$n={class:"expandable-panel__icon"};const _hoisted_3$k={class:"icon-stack"};const _hoisted_4$f=["title"];const _hoisted_5$e={class:"sr-only"};const _hoisted_6$b=["id"];const _hoisted_7$9={class:"expandable-panel__body"};const _hoisted_8$7={key:0,class:"expandable-panel__outside"};function _sfc_render$v(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");const _component_f_expand=vue.resolveComponent("f-expand");return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["expandable-panel",_ctx.expandedClass])},[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_ctx.headerTag),{class:"expandable-panel__heading"},{default:vue.withCtx(()=>[vue.createElementVNode("button",vue.mergeProps({type:"button","aria-expanded":_ctx.expanded?"true":"false","aria-controls":_ctx.id},_ctx.$attrs,{onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.onClickHeadingButton&&_ctx.onClickHeadingButton(...args))}),[vue.createElementVNode("span",_hoisted_2$n,[vue.createElementVNode("span",_hoisted_3$k,[vue.createVNode(_component_f_icon,{name:"dash"}),vue.createTextVNode(),vue.createVNode(_component_f_icon,{name:"dash"})])]),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"title"),vue.createTextVNode(),_ctx.haveNotifications?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:"expandable-panel__notification",title:_ctx.$t("fkui.expandable-panel.notification.title","{{ count }} notifiering{{ suffix }}",{count:_ctx.notifications,suffix:_ctx.notifications>1?"ar":""})},[vue.createElementVNode("span",_hoisted_5$e,vue.toDisplayString(_ctx.screenReaderNotificationText),1/* TEXT */),vue.createTextVNode(),vue.createVNode(_component_f_icon,{name:"bell"})],8,_hoisted_4$f)):vue.createCommentVNode("v-if",true)],16,_hoisted_1$t)]),_:3/* FORWARDED */})),vue.createTextVNode(),vue.createVNode(_component_f_expand,null,{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",{id:_ctx.id,class:"expandable-panel__content"},[vue.createElementVNode("div",_hoisted_7$9,[vue.renderSlot(_ctx.$slots,"default")]),vue.createTextVNode(),_ctx.hasOutsideSlot?(vue.openBlock(),vue.createElementBlock("div",_hoisted_8$7,[vue.renderSlot(_ctx.$slots,"outside")])):vue.createCommentVNode("v-if",true)],8,_hoisted_6$b),[[vue.vShow,_ctx.expanded]])]),_:3/* FORWARDED */})],2/* CLASS */);}const FExpandablePanel=/* @__PURE__ */_export_sfc(_sfc_main$v,[["render",_sfc_render$v]]);const _sfc_main$u=vue.defineComponent({name:"FExpandableParagraph",components:{FIcon,FExpand},inheritAttrs:false,props:{/**
511
+ */notifications:{type:Number,required:false,default:0},screenReaderNotificationTemplate:{type:String,required:false,default:"Du har %VALUE% notifieringar."}},emits:["toggle"],computed:{expandedClass(){return this.expanded?"expandable-panel--expanded":"expandable-panel--collapsed";},hasOutsideSlot(){return hasSlot(this,"outside");},haveNotifications(){return this.notifications>0;},screenReaderNotificationText(){return`${this.screenReaderNotificationTemplate.replace("%VALUE%",this.notifications.toString())}`;}},methods:{onClickHeadingButton(event){this.$emit("toggle",event);}}});const _hoisted_1$t=["aria-expanded","aria-controls"];const _hoisted_2$n={class:"expandable-panel__icon"};const _hoisted_3$k={class:"icon-stack"};const _hoisted_4$f=["title"];const _hoisted_5$e={class:"sr-only"};const _hoisted_6$a=["id"];const _hoisted_7$9={class:"expandable-panel__body"};const _hoisted_8$7={key:0,class:"expandable-panel__outside"};function _sfc_render$v(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");const _component_f_expand=vue.resolveComponent("f-expand");return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["expandable-panel",_ctx.expandedClass])},[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_ctx.headerTag),{class:"expandable-panel__heading"},{default:vue.withCtx(()=>[vue.createElementVNode("button",vue.mergeProps({type:"button","aria-expanded":_ctx.expanded?"true":"false","aria-controls":_ctx.id},_ctx.$attrs,{onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.onClickHeadingButton&&_ctx.onClickHeadingButton(...args))}),[vue.createElementVNode("span",_hoisted_2$n,[vue.createElementVNode("span",_hoisted_3$k,[vue.createVNode(_component_f_icon,{name:"dash"}),vue.createTextVNode(),vue.createVNode(_component_f_icon,{name:"dash"})])]),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"title"),vue.createTextVNode(),_ctx.haveNotifications?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:"expandable-panel__notification",title:_ctx.$t("fkui.expandable-panel.notification.title","{{ count }} notifiering{{ suffix }}",{count:_ctx.notifications,suffix:_ctx.notifications>1?"ar":""})},[vue.createElementVNode("span",_hoisted_5$e,vue.toDisplayString(_ctx.screenReaderNotificationText),1/* TEXT */),vue.createTextVNode(),vue.createVNode(_component_f_icon,{name:"bell"})],8,_hoisted_4$f)):vue.createCommentVNode("v-if",true)],16,_hoisted_1$t)]),_:3/* FORWARDED */})),vue.createTextVNode(),vue.createVNode(_component_f_expand,null,{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",{id:_ctx.id,class:"expandable-panel__content"},[vue.createElementVNode("div",_hoisted_7$9,[vue.renderSlot(_ctx.$slots,"default")]),vue.createTextVNode(),_ctx.hasOutsideSlot?(vue.openBlock(),vue.createElementBlock("div",_hoisted_8$7,[vue.renderSlot(_ctx.$slots,"outside")])):vue.createCommentVNode("v-if",true)],8,_hoisted_6$a),[[vue.vShow,_ctx.expanded]])]),_:3/* FORWARDED */})],2/* CLASS */);}const FExpandablePanel=/* @__PURE__ */_export_sfc(_sfc_main$v,[["render",_sfc_render$v]]);const _sfc_main$u=vue.defineComponent({name:"FExpandableParagraph",components:{FIcon,FExpand},inheritAttrs:false,props:{/**
512
512
  * Toggle expanded/collapsed state
513
513
  */expanded:{type:Boolean,required:false,default:false},/**
514
514
  * Element to render for the button elmement
@@ -522,7 +522,7 @@ defaultText:"",descriptionText:"",descriptionScreenReaderText:"",discreteDescrip
522
522
  */list:{type:Boolean,default:false,required:false},/**
523
523
  * The id for the content id attribute.
524
524
  * If the prop is not set the id will be generated.
525
- */id:{type:String,required:false,default:()=>logic.ElementIdService.generateElementId()}},emits:["toggle"],computed:{expandedClass(){return this.expanded?"expandable-paragraph--open":"expandable-paragraph--closed";},listClass(){return this.list?"expandable-paragraph--list":"";},relatedClass(){return this.hasRelatedSlot?"expandable-paragraph--related-information":"";},hasRelatedSlot(){return hasSlot(this,"related");},headerVisualClass(){return`heading--${this.headerVisualTag||"h4"}`;}},methods:{onClickMinimize(event){this.$emit("toggle",event);}}});const _hoisted_1$s=["aria-expanded","aria-controls"];const _hoisted_2$m={class:"expandable-paragraph__icon"};const _hoisted_3$j={class:"icon-stack"};const _hoisted_4$e={key:0,class:"expandable-paragraph__related-information"};const _hoisted_5$d=["id"];const _hoisted_6$a={class:"expandable-paragraph__content"};const _hoisted_7$8={key:0,class:"expandable-paragraph__separator"};function _sfc_render$u(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");const _component_f_expand=vue.resolveComponent("f-expand");return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["expandable-paragraph",[_ctx.expandedClass,_ctx.listClass]])},[vue.createElementVNode("div",{class:vue.normalizeClass(_ctx.relatedClass)},[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_ctx.headerTag),{class:vue.normalizeClass(["expandable-paragraph__heading",_ctx.headerVisualClass])},{default:vue.withCtx(()=>[vue.createElementVNode("button",vue.mergeProps({type:"button",class:"expandable-paragraph__button","aria-expanded":_ctx.expanded?"true":"false","aria-controls":_ctx.id},_ctx.$attrs,{onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.onClickMinimize&&_ctx.onClickMinimize(...args))}),[vue.createElementVNode("span",_hoisted_2$m,[vue.createElementVNode("span",_hoisted_3$j,[vue.createVNode(_component_f_icon,{name:"dash"}),vue.createTextVNode(),vue.createVNode(_component_f_icon,{name:"dash"})])]),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"title")],16,_hoisted_1$s)]),_:3/* FORWARDED */},8,["class"])),vue.createTextVNode(),_ctx.hasRelatedSlot?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$e,[vue.renderSlot(_ctx.$slots,"related")])):vue.createCommentVNode("v-if",true)],2/* CLASS */),vue.createTextVNode(),vue.createVNode(_component_f_expand,null,{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",{id:_ctx.id,class:"expandable-paragraph__container"},[vue.createElementVNode("div",_hoisted_6$a,[vue.renderSlot(_ctx.$slots,"default")]),vue.createTextVNode(),!_ctx.list?(vue.openBlock(),vue.createElementBlock("div",_hoisted_7$8)):vue.createCommentVNode("v-if",true)],8,_hoisted_5$d),[[vue.vShow,_ctx.expanded]])]),_:3/* FORWARDED */})],2/* CLASS */);}const FExpandableParagraph=/* @__PURE__ */_export_sfc(_sfc_main$u,[["render",_sfc_render$u]]);const DEFAULT_ICON="file";const iconMap={"image/*":"pic","application/msword":"doc","application/pdf":"pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.template":"doc"};const _sfc_main$t=vue.defineComponent({name:"FFileItem",components:{FIcon},inheritAttrs:false,props:{/**
525
+ */id:{type:String,required:false,default:()=>logic.ElementIdService.generateElementId()}},emits:["toggle"],computed:{expandedClass(){return this.expanded?"expandable-paragraph--open":"expandable-paragraph--closed";},listClass(){return this.list?"expandable-paragraph--list":"";},relatedClass(){return this.hasRelatedSlot?"expandable-paragraph--related-information":"";},hasRelatedSlot(){return hasSlot(this,"related");},headerVisualClass(){return`heading--${this.headerVisualTag||"h4"}`;}},methods:{onClickMinimize(event){this.$emit("toggle",event);}}});const _hoisted_1$s=["aria-expanded","aria-controls"];const _hoisted_2$m={class:"expandable-paragraph__icon"};const _hoisted_3$j={class:"icon-stack"};const _hoisted_4$e={key:0,class:"expandable-paragraph__related-information"};const _hoisted_5$d=["id"];const _hoisted_6$9={class:"expandable-paragraph__content"};const _hoisted_7$8={key:0,class:"expandable-paragraph__separator"};function _sfc_render$u(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");const _component_f_expand=vue.resolveComponent("f-expand");return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["expandable-paragraph",[_ctx.expandedClass,_ctx.listClass]])},[vue.createElementVNode("div",{class:vue.normalizeClass(_ctx.relatedClass)},[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_ctx.headerTag),{class:vue.normalizeClass(["expandable-paragraph__heading",_ctx.headerVisualClass])},{default:vue.withCtx(()=>[vue.createElementVNode("button",vue.mergeProps({type:"button",class:"expandable-paragraph__button","aria-expanded":_ctx.expanded?"true":"false","aria-controls":_ctx.id},_ctx.$attrs,{onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.onClickMinimize&&_ctx.onClickMinimize(...args))}),[vue.createElementVNode("span",_hoisted_2$m,[vue.createElementVNode("span",_hoisted_3$j,[vue.createVNode(_component_f_icon,{name:"dash"}),vue.createTextVNode(),vue.createVNode(_component_f_icon,{name:"dash"})])]),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"title")],16,_hoisted_1$s)]),_:3/* FORWARDED */},8,["class"])),vue.createTextVNode(),_ctx.hasRelatedSlot?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$e,[vue.renderSlot(_ctx.$slots,"related")])):vue.createCommentVNode("v-if",true)],2/* CLASS */),vue.createTextVNode(),vue.createVNode(_component_f_expand,null,{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",{id:_ctx.id,class:"expandable-paragraph__container"},[vue.createElementVNode("div",_hoisted_6$9,[vue.renderSlot(_ctx.$slots,"default")]),vue.createTextVNode(),!_ctx.list?(vue.openBlock(),vue.createElementBlock("div",_hoisted_7$8)):vue.createCommentVNode("v-if",true)],8,_hoisted_5$d),[[vue.vShow,_ctx.expanded]])]),_:3/* FORWARDED */})],2/* CLASS */);}const FExpandableParagraph=/* @__PURE__ */_export_sfc(_sfc_main$u,[["render",_sfc_render$u]]);const DEFAULT_ICON="file";const iconMap={"image/*":"pic","application/msword":"doc","application/pdf":"pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.template":"doc"};const _sfc_main$t=vue.defineComponent({name:"FFileItem",components:{FIcon},inheritAttrs:false,props:{/**
526
526
  * The id for the input id attribute.
527
527
  * The id for the label for attribute.
528
528
  * If the prop is not set a random value will be generated.
@@ -534,7 +534,7 @@ defaultText:"",descriptionText:"",descriptionScreenReaderText:"",discreteDescrip
534
534
  * The name of the file uploaded
535
535
  */originalMimeType:{type:String,required:false,default:void 0},/**
536
536
  * If file name changed, this info will be displayed, placeholder %before% and %after% will be replaced with originalMimeType and mimeType
537
- */changedMimeTypeText:{type:String,required:false,default:void 0}},computed:{isMimeTypeChanged(){return logic.isSet(this.originalMimeType)&&this.originalMimeType!==this.mimeType;},mimeTypeChangedText(){var _this$changedMimeType;const originalMimeType=(this.originalMimeType||"").split("/").pop()||"";const currentMimeType=(this.mimeType||"").split("/").pop()||"";const localChangedMimeTypeText=(_this$changedMimeType=this.changedMimeTypeText)!==null&&_this$changedMimeType!==void 0?_this$changedMimeType:this.$t("fkui.file-item.changed-mime-type.text","(%before% ändrad till %after%)");return localChangedMimeTypeText.replace("%before%",originalMimeType).replace("%after%",currentMimeType);},iconName(){const{mimeType}=this;if(!mimeType){return DEFAULT_ICON;}if(iconMap[mimeType]){return iconMap[mimeType];}const p=mimeType.split("/",1);const wildcard=[p[0],"*"].join("/");if(iconMap[wildcard]){return iconMap[wildcard];}return DEFAULT_ICON;}}});const _hoisted_1$r={class:"file-item"};const _hoisted_2$l={class:"file-item__row"};const _hoisted_3$i=["id"];const _hoisted_4$d={class:"icon-stack button__icon icon-stack--new-window"};const _hoisted_5$c={class:"file-item__file-name"};const _hoisted_6$9={class:"sr-only"};const _hoisted_7$7={key:0,class:"file-item__change-info"};const _hoisted_8$6=/* @__PURE__ */vue.createElementVNode("hr",{class:"file-item__separator"},null,-1/* HOISTED */);function _sfc_render$t(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$r,[vue.createElementVNode("div",_hoisted_2$l,[vue.createElementVNode("a",vue.mergeProps({id:_ctx.id,class:"file-item__file-open"},_ctx.$attrs),[vue.createElementVNode("div",_hoisted_4$d,[vue.createVNode(_component_f_icon,{name:"new-window"}),vue.createTextVNode(),vue.createVNode(_component_f_icon,{name:_ctx.iconName},null,8,["name"])]),vue.createTextVNode(),vue.createElementVNode("span",_hoisted_5$c,vue.toDisplayString(_ctx.fileName),1/* TEXT */),vue.createTextVNode(),vue.createElementVNode("span",_hoisted_6$9," "+vue.toDisplayString(_ctx.$t("fkui.file-item.file-open","öppnas i nytt fönster")),1/* TEXT */)],16,_hoisted_3$i),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"row")]),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"default"),vue.createTextVNode(),_ctx.isMimeTypeChanged?(vue.openBlock(),vue.createElementBlock("div",_hoisted_7$7,vue.toDisplayString(_ctx.mimeTypeChangedText),1/* TEXT */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_hoisted_8$6]);}const FFileItem=/* @__PURE__ */_export_sfc(_sfc_main$t,[["render",_sfc_render$t]]);const _sfc_main$s=vue.defineComponent({name:"FFileSelector",components:{FIcon},inheritAttrs:false,model:{prop:"files",event:"change"},props:{/**
537
+ */changedMimeTypeText:{type:String,required:false,default:void 0}},computed:{isMimeTypeChanged(){return logic.isSet(this.originalMimeType)&&this.originalMimeType!==this.mimeType;},mimeTypeChangedText(){var _this$changedMimeType;const originalMimeType=(this.originalMimeType||"").split("/").pop()||"";const currentMimeType=(this.mimeType||"").split("/").pop()||"";const localChangedMimeTypeText=(_this$changedMimeType=this.changedMimeTypeText)!==null&&_this$changedMimeType!==void 0?_this$changedMimeType:this.$t("fkui.file-item.changed-mime-type.text","(%before% ändrad till %after%)");return localChangedMimeTypeText.replace("%before%",originalMimeType).replace("%after%",currentMimeType);},iconName(){const{mimeType}=this;if(!mimeType){return DEFAULT_ICON;}if(iconMap[mimeType]){return iconMap[mimeType];}const p=mimeType.split("/",1);const wildcard=[p[0],"*"].join("/");if(iconMap[wildcard]){return iconMap[wildcard];}return DEFAULT_ICON;}}});const _hoisted_1$r={class:"file-item"};const _hoisted_2$l={class:"file-item__row"};const _hoisted_3$i=["id"];const _hoisted_4$d={class:"icon-stack button__icon icon-stack--new-window"};const _hoisted_5$c={class:"file-item__file-name"};const _hoisted_6$8={class:"sr-only"};const _hoisted_7$7={key:0,class:"file-item__change-info"};const _hoisted_8$6=/* @__PURE__ */vue.createElementVNode("hr",{class:"file-item__separator"},null,-1/* HOISTED */);function _sfc_render$t(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$r,[vue.createElementVNode("div",_hoisted_2$l,[vue.createElementVNode("a",vue.mergeProps({id:_ctx.id,class:"file-item__file-open"},_ctx.$attrs),[vue.createElementVNode("div",_hoisted_4$d,[vue.createVNode(_component_f_icon,{name:"new-window"}),vue.createTextVNode(),vue.createVNode(_component_f_icon,{name:_ctx.iconName},null,8,["name"])]),vue.createTextVNode(),vue.createElementVNode("span",_hoisted_5$c,vue.toDisplayString(_ctx.fileName),1/* TEXT */),vue.createTextVNode(),vue.createElementVNode("span",_hoisted_6$8," "+vue.toDisplayString(_ctx.$t("fkui.file-item.file-open","öppnas i nytt fönster")),1/* TEXT */)],16,_hoisted_3$i),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"row")]),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"default"),vue.createTextVNode(),_ctx.isMimeTypeChanged?(vue.openBlock(),vue.createElementBlock("div",_hoisted_7$7,vue.toDisplayString(_ctx.mimeTypeChangedText),1/* TEXT */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_hoisted_8$6]);}const FFileItem=/* @__PURE__ */_export_sfc(_sfc_main$t,[["render",_sfc_render$t]]);const _sfc_main$s=vue.defineComponent({name:"FFileSelector",components:{FIcon},inheritAttrs:false,model:{prop:"files",event:"change"},props:{/**
538
538
  * The id for the input id attribute.
539
539
  * The id for the label for attribute.
540
540
  * If the prop is not set a random value will be generated.
@@ -586,14 +586,14 @@ injected(){return this;},isSubmitted(){return this.self.ref.numberOfTimesSubmitt
586
586
  */id:{type:String,required:false,default:()=>logic.ElementIdService.generateElementId()},isOpen:Boolean,isAnyFieldTouched:Boolean,additionalScreenreaderText:{type:String,required:false,default:""}}});const _hoisted_1$m=["id","aria-expanded"];const _hoisted_2$i={class:"sr-only"};function _sfc_render$o(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("button",vue.mergeProps({id:_ctx.id,class:"button button--margin-bottom-0 button--large",type:"button"},_ctx.$attrs,{"aria-expanded":_ctx.isOpen?"true":"false","data-form-step-button":""}),[_ctx.isOpen?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(_component_f_icon,{name:"success",class:"button__icon"}),vue.createTextVNode(" "+vue.toDisplayString(_ctx.$t("fkui.form-step-button.close","OK")),1/* TEXT */)],64/* STABLE_FRAGMENT */)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createVNode(_component_f_icon,{name:"pen",class:"button__icon"}),vue.createTextVNode(" "+vue.toDisplayString(_ctx.isAnyFieldTouched?_ctx.$t("fkui.form-step-button.edit","Ändra"):_ctx.$t("fkui.form-step-button.open","Fyll i")),1/* TEXT */)],64/* STABLE_FRAGMENT */)),vue.createTextVNode(),vue.createElementVNode("span",_hoisted_2$i,vue.toDisplayString(_ctx.additionalScreenreaderText),1/* TEXT */)],16,_hoisted_1$m);}const FFormStepButton=/* @__PURE__ */_export_sfc(_sfc_main$o,[["render",_sfc_render$o]]);const _sfc_main$n=vue.defineComponent({name:"FCard",data(){return{headingClass:["card__header-label"]};},computed:{hasHeaderSlot(){return hasSlot(this,"header");},hasFooterSlot(){return hasSlot(this,"footer");}}});const _hoisted_1$l={class:"card card--default"};const _hoisted_2$h={key:0,class:"card__header"};const _hoisted_3$f={class:"card__content"};const _hoisted_4$c={key:1,class:"card__footer"};function _sfc_render$n(_ctx,_cache,$props,$setup,$data,$options){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$l,[_ctx.hasHeaderSlot?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$h,[vue.renderSlot(_ctx.$slots,"header",vue.normalizeProps(vue.guardReactiveProps({headingSlotClass:_ctx.headingClass})))])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createElementVNode("div",_hoisted_3$f,[vue.renderSlot(_ctx.$slots,"default")]),vue.createTextVNode(),_ctx.hasFooterSlot?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$c,[vue.renderSlot(_ctx.$slots,"footer")])):vue.createCommentVNode("v-if",true)]);}const FCard=/* @__PURE__ */_export_sfc(_sfc_main$n,[["render",_sfc_render$n]]);const _sfc_main$m=vue.defineComponent({name:"FLayoutApplicationTemplate",computed:{showHeader(){return this.hasSlot("header");},showTopNavigation(){return this.hasSlot("top-navigation");},showFooter(){return this.hasSlot("footer");}},mounted(){document.body.classList.add("layout-application-template__body");},beforeUnmount(){document.body.classList.remove("layout-application-template__body");},methods:{hasSlot(name){return logic.isSet(this.$slots[name]);}}});const _hoisted_1$k={class:"layout-application-template"};const _hoisted_2$g={key:0,ref:"header",class:"layout-application-template__header"};const _hoisted_3$e={key:1};const _hoisted_4$b={ref:"primary-content",class:"layout-application-template__main"};const _hoisted_5$b={key:0,class:"layout-application-template__footer"};function _sfc_render$m(_ctx,_cache,$props,$setup,$data,$options){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$k,[_ctx.showHeader||_ctx.showTopNavigation?(vue.openBlock(),vue.createElementBlock("header",_hoisted_2$g,[_ctx.showHeader?vue.renderSlot(_ctx.$slots,"header",{key:0}):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.showTopNavigation?(vue.openBlock(),vue.createElementBlock("nav",_hoisted_3$e,[vue.renderSlot(_ctx.$slots,"top-navigation")])):vue.createCommentVNode("v-if",true)],512/* NEED_PATCH */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createElementVNode("main",_hoisted_4$b,[vue.renderSlot(_ctx.$slots,"default"),vue.createTextVNode(),_ctx.showFooter?(vue.openBlock(),vue.createElementBlock("footer",_hoisted_5$b,[vue.renderSlot(_ctx.$slots,"footer")])):vue.createCommentVNode("v-if",true)],512/* NEED_PATCH */)]);}const FLayoutApplicationTemplate=/* @__PURE__ */_export_sfc(_sfc_main$m,[["render",_sfc_render$m]]);function getGridClasses(target){if(target===null){return{};}const width=typeof target==="number"?target:target.offsetWidth;return{"grid--force":true,"grid--force-sm":true,"grid--force-md":width>=640,"grid--force-lg":width>=1024,"grid--force-xl":width>=1280};}function useLayoutPanel(options){const growToRight=options.grow==="right";let borderDrag=false;let dragStart=0;let dragStartWidth=0;let preferredWidth=-1;let minWidth=150;let maxWidth=0.5;const panelWidth=vue.ref(0);const leftPrimaryClasses=vue.ref({});const rightPrimaryClasses=vue.ref({});function updateOptions(){var _options$initialWidth,_options$minWidth,_options$maxWidth;panelWidth.value=parseInt(vue.toValue((_options$initialWidth=options.initialWidth)!==null&&_options$initialWidth!==void 0?_options$initialWidth:"0"),10);minWidth=parseInt(vue.toValue((_options$minWidth=options.minWidth)!==null&&_options$minWidth!==void 0?_options$minWidth:"150"),10);maxWidth=vue.toValue((_options$maxWidth=options.maxWidth)!==null&&_options$maxWidth!==void 0?_options$maxWidth:0.5);}function disableEvent(event){event.preventDefault();}function onMouseUp(){document.body.style.cursor="";borderDrag=false;window.removeEventListener("selectstart",disableEvent);}function onMouseMove(event){if(borderDrag){const growDirection=growToRight?1:-1;preferredWidth=dragStartWidth+(event.screenX-dragStart)*growDirection;limitWidth();}}function onBorderMouseDown(event){document.body.style.cursor="w-resize";borderDrag=true;dragStart=event.screenX;dragStartWidth=panelWidth.value;window.addEventListener("selectstart",disableEvent);const selection=window.getSelection();if(selection){selection.removeAllRanges();}}function limitWidth(){if(preferredWidth===-1){preferredWidth=panelWidth.value;}let newWidth=preferredWidth;newWidth=Math.max(newWidth,minWidth);newWidth=Math.min(newWidth,window.innerWidth*maxWidth);panelWidth.value=newWidth;updatePrimaryGrid();}function updatePrimaryGrid(){const leftPrimaryElement=document.getElementById("layout-side-navigation__primary-content");const rightPrimaryElement=document.getElementById("layout-secondary__primary");leftPrimaryClasses.value=getGridClasses(leftPrimaryElement);rightPrimaryClasses.value=getGridClasses(rightPrimaryElement);}function gridClasses(){updatePrimaryGrid();return getGridClasses(preferredWidth);}vue.onMounted(()=>{window.addEventListener("mouseup",onMouseUp);window.addEventListener("mousemove",onMouseMove);window.addEventListener("resize",limitWidth);});vue.onUnmounted(()=>{window.removeEventListener("mouseup",onMouseUp);window.removeEventListener("mousemove",onMouseMove);window.removeEventListener("resize",limitWidth);});vue.watchEffect(()=>{updateOptions();});return{panelWidth,/* methods */onBorderMouseDown,updatePrimaryGrid,/* class getters */gridClasses,leftPrimaryClasses,rightPrimaryClasses};}const _sfc_main$l=vue.defineComponent({name:"FLayoutLeftPanel",components:{FIcon},props:{/**
587
587
  * The default width for the panel in pixels
588
588
  */initialWidth:{type:String,default:"320",validator(value){const parsed=parseInt(value,10);return!isNaN(parsed);}}},setup(props){const{initialWidth}=vue.toRefs(props);return useLayoutPanel({initialWidth,minWidth:"150",maxWidth:0.5,grow:"right"});},data(){return{isOpen:true,offsetTop:0};},computed:{navigationStyle(){if(this.isOpen){return{width:`${this.panelWidth}px`,top:`${this.offsetTop}px`};}else{return{top:`${this.offsetTop}px`};}},primaryStyle(){if(this.isOpen){return{"margin-left":`${this.panelWidth}px`};}else{return{"margin-left":`3.5rem`};}},// This is to make word-wrap work in IE11
589
- contentStyle(){return{"max-width":`${this.panelWidth-35}px`};}},mounted(){const headers=document.getElementsByClassName("layout-application-template__header");const header=headers.item(0);if(header){this.offsetTop=header.offsetHeight;}},methods:{toggleSideNavigation(){this.isOpen=!this.isOpen;window.setTimeout(()=>{this.updatePrimaryGrid();const ref=this.isOpen?"close-button":"open-button";const element=getElementFromVueRef(this.$refs[ref]);logic.focus(element);},0);}}});const _hoisted_1$j={class:"layout-navigation"};const _hoisted_2$f=["aria-expanded"];const _hoisted_3$d={class:"layout-navigation__navigation__inner"};const _hoisted_4$a=/* @__PURE__ */vue.createElementVNode("span",{class:"sr-only"},"Stäng navigationspanelen",-1/* HOISTED */);const _hoisted_5$a=/* @__PURE__ */vue.createElementVNode("div",null,[/* @__PURE__ */vue.createElementVNode("hr")],-1/* HOISTED */);const _hoisted_6$8={key:1,class:"layout-navigation__navigation__inner--minimized"};const _hoisted_7$6=/* @__PURE__ */vue.createElementVNode("span",{class:"sr-only"},"Öppna navigationspanelen",-1/* HOISTED */);const _hoisted_8$5=/* @__PURE__ */vue.createElementVNode("div",{class:"layout-navigation__navigation__border__dot"},null,-1/* HOISTED */);const _hoisted_9$4=/* @__PURE__ */vue.createElementVNode("div",{class:"layout-navigation__navigation__border__dot"},null,-1/* HOISTED */);const _hoisted_10$4=/* @__PURE__ */vue.createElementVNode("div",{class:"layout-navigation__navigation__border__dot"},null,-1/* HOISTED */);function _sfc_render$l(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$j,[vue.createElementVNode("nav",{id:"layout-navigation__navigation",class:"layout-navigation__navigation",style:vue.normalizeStyle(_ctx.navigationStyle),"aria-expanded":_ctx.isOpen},[vue.createElementVNode("div",_hoisted_3$d,[_ctx.isOpen?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createElementVNode("div",{class:"layout-navigation__navigation__inner__title",style:vue.normalizeStyle(_ctx.contentStyle)},[vue.renderSlot(_ctx.$slots,"heading"),vue.createTextVNode(),vue.createElementVNode("button",{ref:"close-button",class:"button button--tertiary button--small button--tertiary--black",type:"button",onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.toggleSideNavigation&&_ctx.toggleSideNavigation(...args))},[_hoisted_4$a,vue.createTextVNode(),vue.createVNode(_component_f_icon,{class:"button__icon",name:"chevrons-left"})],512/* NEED_PATCH */)],4/* STYLE */),vue.createTextVNode(),_hoisted_5$a,vue.createTextVNode(),vue.createElementVNode("div",{class:vue.normalizeClass(["layout-navigation__navigation__inner__content scroll-target",_ctx.gridClasses]),style:vue.normalizeStyle(_ctx.contentStyle)},[vue.renderSlot(_ctx.$slots,"content")],6/* CLASS, STYLE */)],64/* STABLE_FRAGMENT */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),!_ctx.isOpen?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$8,[vue.createElementVNode("button",{ref:"open-button",class:"button button--tertiary button--tertiary--black",type:"button",onClick:_cache[1]||(_cache[1]=(...args)=>_ctx.toggleSideNavigation&&_ctx.toggleSideNavigation(...args))},[_hoisted_7$6,vue.createTextVNode(),vue.createVNode(_component_f_icon,{class:"button__icon",name:"bars"})],512/* NEED_PATCH */)])):vue.createCommentVNode("v-if",true)]),vue.createTextVNode(),_ctx.isOpen?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"layout-navigation__navigation__border",onMousedown:_cache[2]||(_cache[2]=(...args)=>_ctx.onBorderMouseDown&&_ctx.onBorderMouseDown(...args))},[_hoisted_8$5,vue.createTextVNode(),_hoisted_9$4,vue.createTextVNode(),_hoisted_10$4],32/* NEED_HYDRATION */)):vue.createCommentVNode("v-if",true)],12,_hoisted_2$f),vue.createTextVNode(),vue.createElementVNode("div",{id:"layout-navigation__primary",class:vue.normalizeClass(["layout-navigation__primary",_ctx.leftPrimaryClasses]),style:vue.normalizeStyle(_ctx.primaryStyle)},[vue.renderSlot(_ctx.$slots,"default")],6/* CLASS, STYLE */)]);}const FLayoutLeftPanel=/* @__PURE__ */_export_sfc(_sfc_main$l,[["render",_sfc_render$l]]);class FRightPanelServiceImpl{constructor(){__publicField(this,"focusedElementBeforeOpenining",null);}open(){this.focusedElementBeforeOpenining=window.document.activeElement;this.emit("open");}openDialog(title){this.focusedElementBeforeOpenining=window.document.activeElement;this.emit("open-dialog",title);}close(){this.emit("close");if(this.focusedElementBeforeOpenining){this.focusedElementBeforeOpenining.focus();}}on(event,callback){EventBus.$on(`application-layout:${event}`,callback);}off(event,callback){EventBus.$off(`application-layout:${event}`,callback);}emit(event,arg){EventBus.$emit(`application-layout:${event}`,arg);}}const FLayoutRightPanelService=new FRightPanelServiceImpl();const _sfc_main$k=vue.defineComponent({name:"FLayoutRightPanel",components:{FIcon},props:{/**
589
+ contentStyle(){return{"max-width":`${this.panelWidth-35}px`};}},mounted(){const headers=document.getElementsByClassName("layout-application-template__header");const header=headers.item(0);if(header){this.offsetTop=header.offsetHeight;}},methods:{toggleSideNavigation(){this.isOpen=!this.isOpen;window.setTimeout(()=>{this.updatePrimaryGrid();const ref=this.isOpen?"close-button":"open-button";const element=getElementFromVueRef(this.$refs[ref]);logic.focus(element);},0);}}});const _hoisted_1$j={class:"layout-navigation"};const _hoisted_2$f=["aria-expanded"];const _hoisted_3$d={class:"layout-navigation__navigation__inner"};const _hoisted_4$a=/* @__PURE__ */vue.createElementVNode("span",{class:"sr-only"},"Stäng navigationspanelen",-1/* HOISTED */);const _hoisted_5$a=/* @__PURE__ */vue.createElementVNode("div",null,[/* @__PURE__ */vue.createElementVNode("hr")],-1/* HOISTED */);const _hoisted_6$7={key:1,class:"layout-navigation__navigation__inner--minimized"};const _hoisted_7$6=/* @__PURE__ */vue.createElementVNode("span",{class:"sr-only"},"Öppna navigationspanelen",-1/* HOISTED */);const _hoisted_8$5=/* @__PURE__ */vue.createElementVNode("div",{class:"layout-navigation__navigation__border__dot"},null,-1/* HOISTED */);const _hoisted_9$4=/* @__PURE__ */vue.createElementVNode("div",{class:"layout-navigation__navigation__border__dot"},null,-1/* HOISTED */);const _hoisted_10$4=/* @__PURE__ */vue.createElementVNode("div",{class:"layout-navigation__navigation__border__dot"},null,-1/* HOISTED */);function _sfc_render$l(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$j,[vue.createElementVNode("nav",{id:"layout-navigation__navigation",class:"layout-navigation__navigation",style:vue.normalizeStyle(_ctx.navigationStyle),"aria-expanded":_ctx.isOpen},[vue.createElementVNode("div",_hoisted_3$d,[_ctx.isOpen?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createElementVNode("div",{class:"layout-navigation__navigation__inner__title",style:vue.normalizeStyle(_ctx.contentStyle)},[vue.renderSlot(_ctx.$slots,"heading"),vue.createTextVNode(),vue.createElementVNode("button",{ref:"close-button",class:"button button--tertiary button--small button--tertiary--black",type:"button",onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.toggleSideNavigation&&_ctx.toggleSideNavigation(...args))},[_hoisted_4$a,vue.createTextVNode(),vue.createVNode(_component_f_icon,{class:"button__icon",name:"chevrons-left"})],512/* NEED_PATCH */)],4/* STYLE */),vue.createTextVNode(),_hoisted_5$a,vue.createTextVNode(),vue.createElementVNode("div",{class:vue.normalizeClass(["layout-navigation__navigation__inner__content scroll-target",_ctx.gridClasses]),style:vue.normalizeStyle(_ctx.contentStyle)},[vue.renderSlot(_ctx.$slots,"content")],6/* CLASS, STYLE */)],64/* STABLE_FRAGMENT */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),!_ctx.isOpen?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$7,[vue.createElementVNode("button",{ref:"open-button",class:"button button--tertiary button--tertiary--black",type:"button",onClick:_cache[1]||(_cache[1]=(...args)=>_ctx.toggleSideNavigation&&_ctx.toggleSideNavigation(...args))},[_hoisted_7$6,vue.createTextVNode(),vue.createVNode(_component_f_icon,{class:"button__icon",name:"bars"})],512/* NEED_PATCH */)])):vue.createCommentVNode("v-if",true)]),vue.createTextVNode(),_ctx.isOpen?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"layout-navigation__navigation__border",onMousedown:_cache[2]||(_cache[2]=(...args)=>_ctx.onBorderMouseDown&&_ctx.onBorderMouseDown(...args))},[_hoisted_8$5,vue.createTextVNode(),_hoisted_9$4,vue.createTextVNode(),_hoisted_10$4],32/* NEED_HYDRATION */)):vue.createCommentVNode("v-if",true)],12,_hoisted_2$f),vue.createTextVNode(),vue.createElementVNode("div",{id:"layout-navigation__primary",class:vue.normalizeClass(["layout-navigation__primary",_ctx.leftPrimaryClasses]),style:vue.normalizeStyle(_ctx.primaryStyle)},[vue.renderSlot(_ctx.$slots,"default")],6/* CLASS, STYLE */)]);}const FLayoutLeftPanel=/* @__PURE__ */_export_sfc(_sfc_main$l,[["render",_sfc_render$l]]);class FRightPanelServiceImpl{constructor(){__publicField(this,"focusedElementBeforeOpenining",null);}open(){this.focusedElementBeforeOpenining=window.document.activeElement;this.emit("open");}openDialog(title){this.focusedElementBeforeOpenining=window.document.activeElement;this.emit("open-dialog",title);}close(){this.emit("close");if(this.focusedElementBeforeOpenining){this.focusedElementBeforeOpenining.focus();}}on(event,callback){EventBus.$on(`application-layout:${event}`,callback);}off(event,callback){EventBus.$off(`application-layout:${event}`,callback);}emit(event,arg){EventBus.$emit(`application-layout:${event}`,arg);}}const FLayoutRightPanelService=new FRightPanelServiceImpl();const _sfc_main$k=vue.defineComponent({name:"FLayoutRightPanel",components:{FIcon},props:{/**
590
590
  * The default width for the panel in pixels
591
591
  */initialWidth:{type:String,default:"320"},/**
592
592
  * The default maximun width for the panel in percentage where 1 is 100% and 0 is 0%
593
593
  */maxWidth:{type:Number,default:0.5,validator(value){return typeof value==="number"&&value>0&&value<=1;}},/**
594
594
  * The default minium width for the panel in pixels
595
595
  */minWidth:{type:String,default:"150"}},setup(props){const{initialWidth,minWidth,maxWidth}=vue.toRefs(props);return useLayoutPanel({initialWidth,minWidth,maxWidth,grow:"left"});},data(){return{isAbsolutePositioned:false,isOpen:false,offsetTop:0};},computed:{secondaryStyle(){if(this.isOpen){return{width:`${this.panelWidth}px`,top:`${this.offsetTop}px`};}return{top:`${this.offsetTop}px`};},primaryStyle(){if(this.isOpen&&!this.isAbsolutePositioned){return{"margin-right":`${this.panelWidth}px`};}return{};},// This is to make word-wrap work in IE11
596
- contentStyle(){return{"max-width":`${this.panelWidth-35}px`};}},mounted(){const headers=document.getElementsByClassName("layout-application-template__header");const header=headers.item(0);if(header){this.offsetTop=header.offsetHeight;}FLayoutRightPanelService.on("open",this.onOpenSecondary);FLayoutRightPanelService.on("close",this.onCloseSecondary);window.addEventListener("resize",this.onResize);this.onResize();},unmounted(){FLayoutRightPanelService.off("open",this.onOpenSecondary);FLayoutRightPanelService.off("close",this.onCloseSecondary);},methods:{async onOpenSecondary(){this.isOpen=true;await this.$nextTick();const element=getElementFromVueRef(this.$refs["title"]);const heading=element.querySelector("h1, h2, h3, h4, h5, h6");logic.focus(heading,{force:true});},onCloseSecondary(){this.isOpen=false;},openSecondary(){FLayoutRightPanelService.open();},onClickCloseSecondary(){FLayoutRightPanelService.close();},onResize(){this.isAbsolutePositioned=window.innerWidth<1280;}}});const _hoisted_1$i={class:"layout-secondary"};const _hoisted_2$e=/* @__PURE__ */vue.createElementVNode("div",{class:"layout-secondary__secondary__border__dot"},null,-1/* HOISTED */);const _hoisted_3$c=/* @__PURE__ */vue.createElementVNode("div",{class:"layout-secondary__secondary__border__dot"},null,-1/* HOISTED */);const _hoisted_4$9=/* @__PURE__ */vue.createElementVNode("div",{class:"layout-secondary__secondary__border__dot"},null,-1/* HOISTED */);const _hoisted_5$9={class:"layout-secondary__secondary__inner"};const _hoisted_6$7=/* @__PURE__ */vue.createElementVNode("div",null,[/* @__PURE__ */vue.createElementVNode("hr",{"aria-hidden":"true"})],-1/* HOISTED */);const _hoisted_7$5=/* @__PURE__ */vue.createElementVNode("span",{class:"sr-only"},"Stäng sekundärpanelen",-1/* HOISTED */);function _sfc_render$k(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$i,[vue.createElementVNode("div",{id:"layout-secondary__primary",class:vue.normalizeClass(["layout-secondary__primary",_ctx.rightPrimaryClasses]),style:vue.normalizeStyle(_ctx.primaryStyle)},[vue.renderSlot(_ctx.$slots,"default")],6/* CLASS, STYLE */),vue.createTextVNode(),_ctx.isOpen?(vue.openBlock(),vue.createElementBlock("aside",{key:0,style:vue.normalizeStyle(_ctx.secondaryStyle),class:"layout-secondary__secondary"},[vue.createElementVNode("div",{class:"layout-secondary__secondary__border",onMousedown:_cache[0]||(_cache[0]=(...args)=>_ctx.onBorderMouseDown&&_ctx.onBorderMouseDown(...args))},[_hoisted_2$e,vue.createTextVNode(),_hoisted_3$c,vue.createTextVNode(),_hoisted_4$9],32/* NEED_HYDRATION */),vue.createTextVNode(),vue.createElementVNode("div",_hoisted_5$9,[vue.createElementVNode("div",{ref:"title",class:"layout-secondary__secondary__inner__title",style:vue.normalizeStyle(_ctx.contentStyle)},[vue.renderSlot(_ctx.$slots,"heading")],4/* STYLE */),vue.createTextVNode(),_hoisted_6$7,vue.createTextVNode(),vue.createElementVNode("div",{class:vue.normalizeClass(["layout-secondary__secondary__inner__content scroll-target",_ctx.gridClasses]),style:vue.normalizeStyle(_ctx.contentStyle)},[vue.renderSlot(_ctx.$slots,"content"),vue.createTextVNode(),vue.createElementVNode("button",{class:"button button--tertiary button--small button--tertiary--black layout-secondary__secondary__inner__close",type:"button",onClick:_cache[1]||(_cache[1]=(...args)=>_ctx.onClickCloseSecondary&&_ctx.onClickCloseSecondary(...args))},[_hoisted_7$5,vue.createTextVNode(),vue.createVNode(_component_f_icon,{class:"button__icon",name:"close"})])],6/* CLASS, STYLE */)])],4/* STYLE */)):vue.createCommentVNode("v-if",true)]);}const FLayoutRightPanel=/* @__PURE__ */_export_sfc(_sfc_main$k,[["render",_sfc_render$k]]);const _sfc_main$j=vue.defineComponent({name:"FList",components:{FCheckboxField},mixins:[TranslationMixin],props:{/**
596
+ contentStyle(){return{"max-width":`${this.panelWidth-35}px`};}},mounted(){const headers=document.getElementsByClassName("layout-application-template__header");const header=headers.item(0);if(header){this.offsetTop=header.offsetHeight;}FLayoutRightPanelService.on("open",this.onOpenSecondary);FLayoutRightPanelService.on("close",this.onCloseSecondary);window.addEventListener("resize",this.onResize);this.onResize();},unmounted(){FLayoutRightPanelService.off("open",this.onOpenSecondary);FLayoutRightPanelService.off("close",this.onCloseSecondary);},methods:{async onOpenSecondary(){this.isOpen=true;await this.$nextTick();const element=getElementFromVueRef(this.$refs["title"]);const heading=element.querySelector("h1, h2, h3, h4, h5, h6");logic.focus(heading,{force:true});},onCloseSecondary(){this.isOpen=false;},openSecondary(){FLayoutRightPanelService.open();},onClickCloseSecondary(){FLayoutRightPanelService.close();},onResize(){this.isAbsolutePositioned=window.innerWidth<1280;}}});const _hoisted_1$i={class:"layout-secondary"};const _hoisted_2$e=/* @__PURE__ */vue.createElementVNode("div",{class:"layout-secondary__secondary__border__dot"},null,-1/* HOISTED */);const _hoisted_3$c=/* @__PURE__ */vue.createElementVNode("div",{class:"layout-secondary__secondary__border__dot"},null,-1/* HOISTED */);const _hoisted_4$9=/* @__PURE__ */vue.createElementVNode("div",{class:"layout-secondary__secondary__border__dot"},null,-1/* HOISTED */);const _hoisted_5$9={class:"layout-secondary__secondary__inner"};const _hoisted_6$6=/* @__PURE__ */vue.createElementVNode("div",null,[/* @__PURE__ */vue.createElementVNode("hr",{"aria-hidden":"true"})],-1/* HOISTED */);const _hoisted_7$5=/* @__PURE__ */vue.createElementVNode("span",{class:"sr-only"},"Stäng sekundärpanelen",-1/* HOISTED */);function _sfc_render$k(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$i,[vue.createElementVNode("div",{id:"layout-secondary__primary",class:vue.normalizeClass(["layout-secondary__primary",_ctx.rightPrimaryClasses]),style:vue.normalizeStyle(_ctx.primaryStyle)},[vue.renderSlot(_ctx.$slots,"default")],6/* CLASS, STYLE */),vue.createTextVNode(),_ctx.isOpen?(vue.openBlock(),vue.createElementBlock("aside",{key:0,style:vue.normalizeStyle(_ctx.secondaryStyle),class:"layout-secondary__secondary"},[vue.createElementVNode("div",{class:"layout-secondary__secondary__border",onMousedown:_cache[0]||(_cache[0]=(...args)=>_ctx.onBorderMouseDown&&_ctx.onBorderMouseDown(...args))},[_hoisted_2$e,vue.createTextVNode(),_hoisted_3$c,vue.createTextVNode(),_hoisted_4$9],32/* NEED_HYDRATION */),vue.createTextVNode(),vue.createElementVNode("div",_hoisted_5$9,[vue.createElementVNode("div",{ref:"title",class:"layout-secondary__secondary__inner__title",style:vue.normalizeStyle(_ctx.contentStyle)},[vue.renderSlot(_ctx.$slots,"heading")],4/* STYLE */),vue.createTextVNode(),_hoisted_6$6,vue.createTextVNode(),vue.createElementVNode("div",{class:vue.normalizeClass(["layout-secondary__secondary__inner__content scroll-target",_ctx.gridClasses]),style:vue.normalizeStyle(_ctx.contentStyle)},[vue.renderSlot(_ctx.$slots,"content"),vue.createTextVNode(),vue.createElementVNode("button",{class:"button button--tertiary button--small button--tertiary--black layout-secondary__secondary__inner__close",type:"button",onClick:_cache[1]||(_cache[1]=(...args)=>_ctx.onClickCloseSecondary&&_ctx.onClickCloseSecondary(...args))},[_hoisted_7$5,vue.createTextVNode(),vue.createVNode(_component_f_icon,{class:"button__icon",name:"close"})])],6/* CLASS, STYLE */)])],4/* STYLE */)):vue.createCommentVNode("v-if",true)]);}const FLayoutRightPanel=/* @__PURE__ */_export_sfc(_sfc_main$k,[["render",_sfc_render$k]]);const _sfc_main$j=vue.defineComponent({name:"FList",components:{FCheckboxField},mixins:[TranslationMixin],props:{/**
597
597
  * The items to be listed.
598
598
  * The items will be listed in the given array order.
599
599
  */items:{type:Array,required:true},/**
@@ -619,7 +619,7 @@ getItemId(item){return`${this.elementId}_item_${this.itemKey(item)}`;},// Focus
619
619
  // By setting position to relative the
620
620
  // item and box-shadow is drawn with a higher z-index,
621
621
  // thus no focus border under other list items.
622
- onItemFocus(event){if(event&&event.target){event.target.style.position="relative";}},onItemBlur(event){if(event&&event.target){event.target.style.position="static";}},callbackAfterItemAdd(item){this.setActiveItem(item);},callbackBeforeItemDelete(item){if(this.items.length===0){return;}let targetIndex=this.items.indexOf(item)-1;if(targetIndex<0&&this.items.length>1){targetIndex=1;}else if(targetIndex<0){targetIndex=0;}this.setActiveItem(this.items[targetIndex]);if(this.getLiElements()[targetIndex]){this.getLiElements()[targetIndex].focus();}},isActive(item){return this.checkbox&&itemEquals(this.activeItem,item,this.keyAttribute);}}});const _hoisted_1$h={key:0,class:"list"};const _hoisted_2$d={key:0,class:"list__item"};const _hoisted_3$b={class:"list__item__itempane"};const _hoisted_4$8=["tabindex"];const _hoisted_5$8=["id","aria-labelledby","tabindex","onKeydown"];const _hoisted_6$6=["onClick"];const _hoisted_7$4={class:"list__item__selectpane__input"};const _hoisted_8$4=["id"];const _hoisted_9$3={key:0,class:"list__item"};const _hoisted_10$3={class:"list__item__itempane"};function _sfc_render$j(_ctx,_cache,$props,$setup,$data,$options){const _component_f_checkbox_field=vue.resolveComponent("f-checkbox-field");return!_ctx.selectable?(vue.openBlock(),vue.createElementBlock("ul",_hoisted_1$h,[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.items,item=>{return vue.openBlock(),vue.createElementBlock("li",{key:_ctx.itemKey(item),class:"list__item"},[vue.createElementVNode("div",{ref_for:true,ref:"listItemPanes",class:"list__item__itempane"},[vue.renderSlot(_ctx.$slots,"default",vue.mergeProps({ref_for:true},{item}))],512/* NEED_PATCH */)]);}),128/* KEYED_FRAGMENT */)),vue.createTextVNode(),_ctx.isEmpty?(vue.openBlock(),vue.createElementBlock("li",_hoisted_2$d,[vue.createElementVNode("div",_hoisted_3$b,[vue.renderSlot(_ctx.$slots,"empty",{},()=>[vue.createElementVNode("em",null,vue.toDisplayString(_ctx.$t("fkui.list.empty","Listan är tom")),1/* TEXT */)])])])):vue.createCommentVNode("v-if",true)])):(vue.openBlock(),vue.createElementBlock("ul",{key:1,ref:"ulElement",class:"list list--hover",tabindex:_ctx.checkbox?0:void 0},[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.items,(item,index)=>{return vue.openBlock(),vue.createElementBlock("li",{id:_ctx.getItemId(item),key:_ctx.itemKey(item),"aria-labelledby":_ctx.getItemId(item),class:vue.normalizeClass([_ctx.itemClasses(item),"list__item"]),tabindex:_ctx.checkbox?0:void 0,onKeydown:vue.withModifiers($event=>_ctx.onItemKeyDown($event,item),["self"]),onFocus:_cache[0]||(_cache[0]=vue.withModifiers((...args)=>_ctx.onItemFocus&&_ctx.onItemFocus(...args),["self"])),onBlur:_cache[1]||(_cache[1]=vue.withModifiers((...args)=>_ctx.onItemBlur&&_ctx.onItemBlur(...args),["self"]))},[_ctx.checkbox?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"list__item__selectpane",onClick:vue.withModifiers($event=>_ctx.onSelect(item),["self"])},[vue.createElementVNode("div",_hoisted_7$4,[vue.createVNode(_component_f_checkbox_field,{value:true,"model-value":_ctx.isSelected(item),onClick:vue.withModifiers($event=>_ctx.onSelect(item),["self"])},{default:vue.withCtx(()=>[vue.createElementVNode("span",{id:_ctx.getAriaLabelledbyId(item),class:"sr-only"},[vue.renderSlot(_ctx.$slots,"screenreader",vue.mergeProps({ref_for:true},{item}))],8,_hoisted_8$4)]),_:2/* DYNAMIC */},1032,["model-value","onClick"])])],8,_hoisted_6$6)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_ctx.checkbox?"div":"a"),{ref_for:true,ref:"listItemPanes",href:!_ctx.checkbox?"javascript:":void 0,class:"list__item__itempane",onClick:$event=>_ctx.onItemClick($event,index,item)},{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default",vue.mergeProps({ref_for:true},{item}))]),_:2/* DYNAMIC */},1032,["href","onClick"]))],42,_hoisted_5$8);}),128/* KEYED_FRAGMENT */)),vue.createTextVNode(),_ctx.isEmpty?(vue.openBlock(),vue.createElementBlock("li",_hoisted_9$3,[vue.createElementVNode("div",_hoisted_10$3,[vue.renderSlot(_ctx.$slots,"empty",{},()=>[vue.createElementVNode("em",null,vue.toDisplayString(_ctx.$t("fkui.list.empty","Listan är tom")),1/* TEXT */)])])])):vue.createCommentVNode("v-if",true)],8,_hoisted_4$8));}const FList=/* @__PURE__ */_export_sfc(_sfc_main$j,[["render",_sfc_render$j]]);const _sfc_main$i=vue.defineComponent({name:"FLoader",mixins:[TranslationMixin],inheritAttrs:false,props:{/* Aria-live must always be visible, hence v-if on component level is not possible, therefore we use show-prop *//**
622
+ onItemFocus(event){if(event&&event.target){event.target.style.position="relative";}},onItemBlur(event){if(event&&event.target){event.target.style.position="static";}},callbackAfterItemAdd(item){this.setActiveItem(item);},callbackBeforeItemDelete(item){if(this.items.length===0){return;}let targetIndex=this.items.indexOf(item)-1;if(targetIndex<0&&this.items.length>1){targetIndex=1;}else if(targetIndex<0){targetIndex=0;}this.setActiveItem(this.items[targetIndex]);if(this.getLiElements()[targetIndex]){this.getLiElements()[targetIndex].focus();}},isActive(item){return this.checkbox&&itemEquals(this.activeItem,item,this.keyAttribute);}}});const _hoisted_1$h={key:0,class:"list"};const _hoisted_2$d={key:0,class:"list__item"};const _hoisted_3$b={class:"list__item__itempane"};const _hoisted_4$8=["tabindex"];const _hoisted_5$8=["id","aria-labelledby","tabindex","onKeydown"];const _hoisted_6$5=["onClick"];const _hoisted_7$4={class:"list__item__selectpane__input"};const _hoisted_8$4=["id"];const _hoisted_9$3={key:0,class:"list__item"};const _hoisted_10$3={class:"list__item__itempane"};function _sfc_render$j(_ctx,_cache,$props,$setup,$data,$options){const _component_f_checkbox_field=vue.resolveComponent("f-checkbox-field");return!_ctx.selectable?(vue.openBlock(),vue.createElementBlock("ul",_hoisted_1$h,[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.items,item=>{return vue.openBlock(),vue.createElementBlock("li",{key:_ctx.itemKey(item),class:"list__item"},[vue.createElementVNode("div",{ref_for:true,ref:"listItemPanes",class:"list__item__itempane"},[vue.renderSlot(_ctx.$slots,"default",vue.mergeProps({ref_for:true},{item}))],512/* NEED_PATCH */)]);}),128/* KEYED_FRAGMENT */)),vue.createTextVNode(),_ctx.isEmpty?(vue.openBlock(),vue.createElementBlock("li",_hoisted_2$d,[vue.createElementVNode("div",_hoisted_3$b,[vue.renderSlot(_ctx.$slots,"empty",{},()=>[vue.createElementVNode("em",null,vue.toDisplayString(_ctx.$t("fkui.list.empty","Listan är tom")),1/* TEXT */)])])])):vue.createCommentVNode("v-if",true)])):(vue.openBlock(),vue.createElementBlock("ul",{key:1,ref:"ulElement",class:"list list--hover",tabindex:_ctx.checkbox?0:void 0},[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.items,(item,index)=>{return vue.openBlock(),vue.createElementBlock("li",{id:_ctx.getItemId(item),key:_ctx.itemKey(item),"aria-labelledby":_ctx.getItemId(item),class:vue.normalizeClass([_ctx.itemClasses(item),"list__item"]),tabindex:_ctx.checkbox?0:void 0,onKeydown:vue.withModifiers($event=>_ctx.onItemKeyDown($event,item),["self"]),onFocus:_cache[0]||(_cache[0]=vue.withModifiers((...args)=>_ctx.onItemFocus&&_ctx.onItemFocus(...args),["self"])),onBlur:_cache[1]||(_cache[1]=vue.withModifiers((...args)=>_ctx.onItemBlur&&_ctx.onItemBlur(...args),["self"]))},[_ctx.checkbox?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"list__item__selectpane",onClick:vue.withModifiers($event=>_ctx.onSelect(item),["self"])},[vue.createElementVNode("div",_hoisted_7$4,[vue.createVNode(_component_f_checkbox_field,{value:true,"model-value":_ctx.isSelected(item),onClick:vue.withModifiers($event=>_ctx.onSelect(item),["self"])},{default:vue.withCtx(()=>[vue.createElementVNode("span",{id:_ctx.getAriaLabelledbyId(item),class:"sr-only"},[vue.renderSlot(_ctx.$slots,"screenreader",vue.mergeProps({ref_for:true},{item}))],8,_hoisted_8$4)]),_:2/* DYNAMIC */},1032,["model-value","onClick"])])],8,_hoisted_6$5)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_ctx.checkbox?"div":"a"),{ref_for:true,ref:"listItemPanes",href:!_ctx.checkbox?"javascript:":void 0,class:"list__item__itempane",onClick:$event=>_ctx.onItemClick($event,index,item)},{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default",vue.mergeProps({ref_for:true},{item}))]),_:2/* DYNAMIC */},1032,["href","onClick"]))],42,_hoisted_5$8);}),128/* KEYED_FRAGMENT */)),vue.createTextVNode(),_ctx.isEmpty?(vue.openBlock(),vue.createElementBlock("li",_hoisted_9$3,[vue.createElementVNode("div",_hoisted_10$3,[vue.renderSlot(_ctx.$slots,"empty",{},()=>[vue.createElementVNode("em",null,vue.toDisplayString(_ctx.$t("fkui.list.empty","Listan är tom")),1/* TEXT */)])])])):vue.createCommentVNode("v-if",true)],8,_hoisted_4$8));}const FList=/* @__PURE__ */_export_sfc(_sfc_main$j,[["render",_sfc_render$j]]);const _sfc_main$i=vue.defineComponent({name:"FLoader",mixins:[TranslationMixin],inheritAttrs:false,props:{/* Aria-live must always be visible, hence v-if on component level is not possible, therefore we use show-prop *//**
623
623
  * Determine if the loader is visible or not
624
624
  */show:{type:Boolean,required:true,default:false},/**
625
625
  * If loader should be displayed as a fullscreen overlay.
@@ -689,7 +689,7 @@ onItemFocus(event){if(event&&event.target){event.target.style.position="relative
689
689
  * @event update:route
690
690
  * @param route
691
691
  * @type {string}
692
- */"update:route"],data(){return{overflowIndex:-1,ignoreNoOverflow:false,selectedMenuItemKey:"",selectedPopupItemKey:"",popupAnchor:this.$el,popupOpen:false,currentFocusedItemIndex:0,focusedMenuItemKey:"",focusedPopupMenuItemKey:"",initPopupNavigationIndex:true};},computed:{items(){return this.routes.map(i=>({label:i.label,key:i.route,href:i.href,target:i.target}));},visibleItems(){if(this.overflowIndex>-1){const visibleItems=this.items.slice(0,this.overflowIndex);visibleItems.push({label:this.$t("fkui.navigation-menu.more-text","Mer"),key:menuMoreKey,iconRight:"arrow-down",ariaHasPopup:true,srMenuMoreTextContents:this.menuMoreScreenReaderText,srMenuMoreTextSelectedContents:this.menuMoreWithSelectedItemsSrText()});return visibleItems;}else{return this.items;}},popupItems(){return this.overflowIndex>-1?this.items.slice(this.overflowIndex):[];},hasPopupMenuSelectedItems(){return this.selectedPopupItemKey!=="";}},watch:{route:{async handler(value){const itemIndex=logic.isSet(value)?this.indexOfItemByKey(this.items,value):-1;if(itemIndex<0){await this.activateItem(-1);return;}const isWithinMoreMenu=!this.findItemByKey(this.visibleItems,value);if(isWithinMoreMenu){const item=this.items[itemIndex];await this.activateInvisibleItem(item);}else{await this.activateItem(itemIndex);}},immediate:true}},mounted(){this.currentFocusedItemIndex=0;},methods:{selectedMenuItemSrText(){if(this.selectedMenuItemScreenReaderText===""){return this.$t("fkui.navigation-menu.current-page","Aktuell sida");}else{return this.selectedMenuItemScreenReaderText;}},menuMoreWithSelectedItemsSrText(){if(this.menuMoreWithSelectedItemsScreenReaderText===""){return this.$t("fkui.navigation-menu.more-selection","underliggande vald nu");}else{return this.menuMoreWithSelectedItemsScreenReaderText;}},findItemByKey(items,key){return items.find(it=>it.key===key);},indexOfItemByKey(items,key){return items.findIndex(it=>it.key===key);},async onOverflow(index){const ignore=this.ignoreNoOverflow;const shouldReset=index===-1&&ignore;const shouldIgnore=index>=0;if(shouldReset){this.ignoreNoOverflow=false;return;}if(shouldIgnore){this.ignoreNoOverflow=true;}this.updateOverflowIndex(index);await this.refreshSelectedItem();const shouldClosePopup=this.overflowIndex>-1&&!this.ignoreNoOverflow;if(shouldClosePopup){await this.setPopupOpen(false);}},async refreshSelectedItem(){const popupStatus=this.popupOpen;if(this.overflowIndex===-1){if(this.visibleItems.some(i=>i.key===this.selectedPopupItemKey)){this.selectedMenuItemKey=this.selectedPopupItemKey;this.selectedPopupItemKey="";}}else{if(this.popupItems.some(i=>i.key===this.selectedMenuItemKey)){var _ref3;this.selectedPopupItemKey=this.selectedMenuItemKey;const lastItem=this.visibleItems.at(-1);this.selectedMenuItemKey=(_ref3=lastItem==null?void 0:lastItem.key)!==null&&_ref3!==void 0?_ref3:"";}}await this.setPopupOpen(popupStatus);},async doSelectItem(key){if(key!==menuMoreKey){this.$emit("update:route",key);this.$emit("selectedRoute",key);}let index=-1;if(this.hasOverflow()){index=this.indexOfItemByKey(this.visibleItems,key);if(index===-1){index=this.indexOfItemByKey(this.items,key);}}else{index=this.indexOfItemByKey(this.items,key);}},async onSelectMenu(key){await this.doSelectItem(key);if(key!==menuMoreKey){if(this.findItemByKey(this.visibleItems,key)&&this.selectedPopupItemKey!==""){this.focusedPopupMenuItemKey="";this.selectedPopupItemKey="";}}else{const anchor=getHTMLElementFromVueRef(this.$refs.menu).querySelector("li:last-child");if(anchor){this.popupAnchor=anchor;}await this.setPopupOpen(true);}},async onSelectPopup(key){await this.setPopupOpen(false);await this.doSelectItem(key);},async onClosePopup(){await this.setPopupOpen(false);},async setPopupOpen(value){if(value){this.focusedPopupMenuItemKey="";}else{this.initPopupNavigationIndex=true;}this.popupOpen=value;await this.$nextTick();},updateOverflowIndex(index){this.overflowIndex=calcOverflowIndexFromIndex(index);},onKeyUp(event){if(preventKeys.includes(event.key)){event.preventDefault();}},doHandleMenuTabKey(action){if(this.hasOverflow()){if(action===MenuAction.MOVE_NEXT&&this.currentFocusedItemIndex+1===this.visibleItems.length){return true;}if(action===MenuAction.MOVE_PREV&&this.currentFocusedItemIndex-1===-1){return true;}}else{if(action===MenuAction.MOVE_NEXT&&this.currentFocusedItemIndex+1===this.items.length){return true;}if(action===MenuAction.MOVE_PREV&&this.currentFocusedItemIndex-1===-1){return true;}}return false;},async doHandlePopupMenuTabKey(action){if(action===MenuAction.MOVE_NEXT&&this.currentFocusedItemIndex+1===this.items.length){await this.setPopupOpen(false);return true;}else if(action===MenuAction.MOVE_NEXT&&this.currentFocusedItemIndex===this.overflowIndex){if(this.initPopupNavigationIndex){this.initPopupNavigationIndex=!this.initPopupNavigationIndex;this.setCurrentFocusedItemIndex(this.overflowIndex-1);return false;}}else if(action===MenuAction.MOVE_PREV&&this.currentFocusedItemIndex===this.overflowIndex){await this.setPopupOpen(false);this.setCurrentFocusedItemIndex(this.overflowIndex-1);return false;}return false;},setCurrentFocusedItemIndex(value){this.currentFocusedItemIndex=value;},doInitPopupNavigationIndex(event){if(keyDown.includes(event.key)||event.key==="Tab"){this.setCurrentFocusedItemIndex(this.overflowIndex-1);}else if(keyUp.includes(event.key)){this.setCurrentFocusedItemIndex(this.items.length+1);}},async onKeyDown(event){if(event.key==="Escape"){await this.setPopupOpen(false);return;}let action=actionFromKeyboardEvent(event);if(action===null){return;}if(!this.popupOpen){if(event.key==="Tab"&&this.doHandleMenuTabKey(action)){return;}event.preventDefault();await doMenuAction(action,this,0,this.visibleItems.length);}else{if(event.key==="Tab"&&(await this.doHandlePopupMenuTabKey(action))){return;}event.preventDefault();if(action===MenuAction.ACTIVATE&&this.focusedPopupMenuItemKey===""){action=null;await this.setPopupOpen(false);return;}if(this.initPopupNavigationIndex&&arrowKeys.includes(event.key)){this.initPopupNavigationIndex=!this.initPopupNavigationIndex;this.doInitPopupNavigationIndex(event);}await doMenuAction(action,this,this.overflowIndex,this.items.length);}},async setFocusOnItem(index){var _a,_b;this.setFocusedItemIndex(index);if(!this.hasOverflow()||!this.popupOpen&&index<=this.overflowIndex){this.setFocusedMenuItemKey(((_a=this.visibleItems[index])==null?void 0:_a.key)||"");}else{await this.setFocusedPopupMenuItemKey(((_b=this.items[index])==null?void 0:_b.key)||"");}},hasOverflow(){return this.overflowIndex!==-1;},async activateItem(index){var _a,_b;if(!this.hasOverflow()||!this.popupOpen&&index<=this.overflowIndex){const key=((_a=this.visibleItems[index])==null?void 0:_a.key)||"";await this.setSelectedMenuItemKey(key);await this.onSelectMenu(key);}else{const key=((_b=this.items[index])==null?void 0:_b.key)||"";this.selectedPopupItemKey=key;await this.onSelectPopup(key);}},async activateInvisibleItem(item){await this.setSelectedMenuItemKey(menuMoreKey);await this.onSelectMenu(menuMoreKey);this.selectedPopupItemKey=item.key;await this.onSelectPopup(item.key);if(item.href){const anchor=document.createElement("a");anchor.href=item.href;if(item.target){anchor.target=item.target;}anchor.click();}},setFocusedItemIndex(index){if(index<0){return;}if(!this.popupOpen&&this.hasOverflow()&&index>this.overflowIndex){this.setCurrentFocusedItemIndex(this.overflowIndex);}else{this.setCurrentFocusedItemIndex(index);}},async setFocusedPopupMenuItemKey(key){this.focusedPopupMenuItemKey="";if(key!==""){await this.$nextTick();this.focusedPopupMenuItemKey=key;}},setFocusedMenuItemKey(key){this.focusedMenuItemKey=key;},async setSelectedMenuItemKey(key){this.selectedMenuItemKey="";if(key!==""){await this.$nextTick();this.selectedMenuItemKey=key;}}}});function _sfc_render$f(_ctx,_cache,$props,$setup,$data,$options){const _component_i_menu=vue.resolveComponent("i-menu");const _component_i_popup_menu=vue.resolveComponent("i-popup-menu");return vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(_component_i_menu,{ref:"menu",modelValue:_ctx.selectedMenuItemKey,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>_ctx.selectedMenuItemKey=$event),items:_ctx.visibleItems,vertical:_ctx.vertical,"focused-item-key":_ctx.focusedMenuItemKey,"selected-menu-item-screen-reader-text":_ctx.selectedMenuItemSrText(),"has-menu-more-selected-items":_ctx.hasPopupMenuSelectedItems,"aria-label":_ctx.menuAriaLabel,onSelect:_ctx.onSelectMenu,onOverflow:_ctx.onOverflow,onKeyup:_ctx.onKeyUp,onKeydown:_ctx.onKeyDown},null,8,["modelValue","items","vertical","focused-item-key","selected-menu-item-screen-reader-text","has-menu-more-selected-items","aria-label","onSelect","onOverflow","onKeyup","onKeydown"]),vue.createTextVNode(),vue.createVNode(_component_i_popup_menu,{ref:"popupMenu",modelValue:_ctx.selectedPopupItemKey,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>_ctx.selectedPopupItemKey=$event),items:_ctx.popupItems,"is-open":_ctx.popupOpen,anchor:_ctx.popupAnchor,"focused-item-key":_ctx.focusedPopupMenuItemKey,"selected-menu-item-screen-reader-text":_ctx.selectedMenuItemSrText(),"aria-label":_ctx.popupAriaLabel,onSelect:_ctx.onSelectPopup,onClose:_ctx.onClosePopup,onKeyup:_ctx.onKeyUp,onKeydown:_ctx.onKeyDown},null,8,["modelValue","items","is-open","anchor","focused-item-key","selected-menu-item-screen-reader-text","aria-label","onSelect","onClose","onKeyup","onKeydown"])]);}const FNavigationMenu=/* @__PURE__ */_export_sfc(_sfc_main$f,[["render",_sfc_render$f]]);const EVENTS=["online","offline"];const _sfc_main$e=vue.defineComponent({name:"FOffline",components:{FIcon},data(){return{isOnline:navigator.onLine||false,role:"none",shouldNotRead:true};},created(){EVENTS.forEach(event=>{window.addEventListener(event,this.updateOnlineStatus);});},beforeUnmount(){EVENTS.forEach(event=>{window.removeEventListener(event,this.updateOnlineStatus);});},mounted(){document.body.prepend(getElementFromVueRef(this.$refs.offline));},methods:{updateOnlineStatus(event){switch(event.type){case"online":this.shouldNotRead=false;this.isOnline=true;break;case"offline":this.shouldNotRead=true;this.isOnline=false;break;default:this.shouldNotRead=true;this.isOnline=false;break;}this.role="alert";}}});const _hoisted_1$d=["role"];const _hoisted_2$9={key:0,class:"offline"};const _hoisted_3$7={class:"offline__icon"};const _hoisted_4$5={class:"icon-stack icon-stack--error"};const _hoisted_5$5={class:"offline__content"};const _hoisted_6$5=["aria-hidden"];function _sfc_render$e(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("div",{ref:"offline",class:"offline__wrapper",role:_ctx.role},[!_ctx.isOnline?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$9,[vue.createElementVNode("span",_hoisted_3$7,[vue.createElementVNode("span",_hoisted_4$5,[vue.createVNode(_component_f_icon,{name:"triangle"}),vue.createTextVNode(),vue.createVNode(_component_f_icon,{name:"alert"})])]),vue.createTextVNode(),vue.createElementVNode("p",_hoisted_5$5,[vue.renderSlot(_ctx.$slots,"default",{},()=>[vue.createTextVNode(" Det verkar som att du inte har någon internetuppkoppling just nu ")])])])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.withDirectives(vue.createElementVNode("span",{class:"sr-only","aria-hidden":_ctx.shouldNotRead?"true":void 0},"\n Din internetuppkoppling fungerar igen\n ",8,_hoisted_6$5),[[vue.vShow,_ctx.isOnline]])],8,_hoisted_1$d);}const FOffline=/* @__PURE__ */_export_sfc(_sfc_main$e,[["render",_sfc_render$e]]);const _sfc_main$d=vue.defineComponent({name:"FOutputField",components:{FLabel},inheritAttrs:false,props:{/**
692
+ */"update:route"],data(){return{overflowIndex:-1,ignoreNoOverflow:false,selectedMenuItemKey:"",selectedPopupItemKey:"",popupAnchor:this.$el,popupOpen:false,currentFocusedItemIndex:0,focusedMenuItemKey:"",focusedPopupMenuItemKey:"",initPopupNavigationIndex:true};},computed:{items(){return this.routes.map(i=>({label:i.label,key:i.route,href:i.href,target:i.target}));},visibleItems(){if(this.overflowIndex>-1){const visibleItems=this.items.slice(0,this.overflowIndex);visibleItems.push({label:this.$t("fkui.navigation-menu.more-text","Mer"),key:menuMoreKey,iconRight:"arrow-down",ariaHasPopup:true,srMenuMoreTextContents:this.menuMoreScreenReaderText,srMenuMoreTextSelectedContents:this.menuMoreWithSelectedItemsSrText()});return visibleItems;}else{return this.items;}},popupItems(){return this.overflowIndex>-1?this.items.slice(this.overflowIndex):[];},hasPopupMenuSelectedItems(){return this.selectedPopupItemKey!=="";}},watch:{route:{async handler(value){const itemIndex=logic.isSet(value)?this.indexOfItemByKey(this.items,value):-1;if(itemIndex<0){await this.activateItem(-1);return;}const isWithinMoreMenu=!this.findItemByKey(this.visibleItems,value);if(isWithinMoreMenu){const item=this.items[itemIndex];await this.activateInvisibleItem(item);}else{await this.activateItem(itemIndex);}},immediate:true}},mounted(){this.currentFocusedItemIndex=0;},methods:{selectedMenuItemSrText(){if(this.selectedMenuItemScreenReaderText===""){return this.$t("fkui.navigation-menu.current-page","Aktuell sida");}else{return this.selectedMenuItemScreenReaderText;}},menuMoreWithSelectedItemsSrText(){if(this.menuMoreWithSelectedItemsScreenReaderText===""){return this.$t("fkui.navigation-menu.more-selection","underliggande vald nu");}else{return this.menuMoreWithSelectedItemsScreenReaderText;}},findItemByKey(items,key){return items.find(it=>it.key===key);},indexOfItemByKey(items,key){return items.findIndex(it=>it.key===key);},async onOverflow(index){const ignore=this.ignoreNoOverflow;const shouldReset=index===-1&&ignore;const shouldIgnore=index>=0;if(shouldReset){this.ignoreNoOverflow=false;return;}if(shouldIgnore){this.ignoreNoOverflow=true;}this.updateOverflowIndex(index);await this.refreshSelectedItem();const shouldClosePopup=this.overflowIndex>-1&&!this.ignoreNoOverflow;if(shouldClosePopup){await this.setPopupOpen(false);}},async refreshSelectedItem(){const popupStatus=this.popupOpen;if(this.overflowIndex===-1){if(this.visibleItems.some(i=>i.key===this.selectedPopupItemKey)){this.selectedMenuItemKey=this.selectedPopupItemKey;this.selectedPopupItemKey="";}}else{if(this.popupItems.some(i=>i.key===this.selectedMenuItemKey)){var _ref3;this.selectedPopupItemKey=this.selectedMenuItemKey;const lastItem=this.visibleItems.at(-1);this.selectedMenuItemKey=(_ref3=lastItem==null?void 0:lastItem.key)!==null&&_ref3!==void 0?_ref3:"";}}await this.setPopupOpen(popupStatus);},async doSelectItem(key){if(key!==menuMoreKey){this.$emit("update:route",key);this.$emit("selectedRoute",key);}let index=-1;if(this.hasOverflow()){index=this.indexOfItemByKey(this.visibleItems,key);if(index===-1){index=this.indexOfItemByKey(this.items,key);}}else{index=this.indexOfItemByKey(this.items,key);}},async onSelectMenu(key){await this.doSelectItem(key);if(key!==menuMoreKey){if(this.findItemByKey(this.visibleItems,key)&&this.selectedPopupItemKey!==""){this.focusedPopupMenuItemKey="";this.selectedPopupItemKey="";}}else{const anchor=getHTMLElementFromVueRef(this.$refs.menu).querySelector("li:last-child");if(anchor){this.popupAnchor=anchor;}await this.setPopupOpen(true);}},async onSelectPopup(key){await this.setPopupOpen(false);await this.doSelectItem(key);},async onClosePopup(){await this.setPopupOpen(false);},async setPopupOpen(value){if(value){this.focusedPopupMenuItemKey="";}else{this.initPopupNavigationIndex=true;}this.popupOpen=value;await this.$nextTick();},updateOverflowIndex(index){this.overflowIndex=calcOverflowIndexFromIndex(index);},onKeyUp(event){if(preventKeys.includes(event.key)){event.preventDefault();}},doHandleMenuTabKey(action){if(this.hasOverflow()){if(action===MenuAction.MOVE_NEXT&&this.currentFocusedItemIndex+1===this.visibleItems.length){return true;}if(action===MenuAction.MOVE_PREV&&this.currentFocusedItemIndex-1===-1){return true;}}else{if(action===MenuAction.MOVE_NEXT&&this.currentFocusedItemIndex+1===this.items.length){return true;}if(action===MenuAction.MOVE_PREV&&this.currentFocusedItemIndex-1===-1){return true;}}return false;},async doHandlePopupMenuTabKey(action){if(action===MenuAction.MOVE_NEXT&&this.currentFocusedItemIndex+1===this.items.length){await this.setPopupOpen(false);return true;}else if(action===MenuAction.MOVE_NEXT&&this.currentFocusedItemIndex===this.overflowIndex){if(this.initPopupNavigationIndex){this.initPopupNavigationIndex=!this.initPopupNavigationIndex;this.setCurrentFocusedItemIndex(this.overflowIndex-1);return false;}}else if(action===MenuAction.MOVE_PREV&&this.currentFocusedItemIndex===this.overflowIndex){await this.setPopupOpen(false);this.setCurrentFocusedItemIndex(this.overflowIndex-1);return false;}return false;},setCurrentFocusedItemIndex(value){this.currentFocusedItemIndex=value;},doInitPopupNavigationIndex(event){if(keyDown.includes(event.key)||event.key==="Tab"){this.setCurrentFocusedItemIndex(this.overflowIndex-1);}else if(keyUp.includes(event.key)){this.setCurrentFocusedItemIndex(this.items.length+1);}},async onKeyDown(event){if(event.key==="Escape"){await this.setPopupOpen(false);return;}let action=actionFromKeyboardEvent(event);if(action===null){return;}if(!this.popupOpen){if(event.key==="Tab"&&this.doHandleMenuTabKey(action)){return;}event.preventDefault();await doMenuAction(action,this,0,this.visibleItems.length);}else{if(event.key==="Tab"&&(await this.doHandlePopupMenuTabKey(action))){return;}event.preventDefault();if(action===MenuAction.ACTIVATE&&this.focusedPopupMenuItemKey===""){action=null;await this.setPopupOpen(false);return;}if(this.initPopupNavigationIndex&&arrowKeys.includes(event.key)){this.initPopupNavigationIndex=!this.initPopupNavigationIndex;this.doInitPopupNavigationIndex(event);}await doMenuAction(action,this,this.overflowIndex,this.items.length);}},async setFocusOnItem(index){var _a,_b;this.setFocusedItemIndex(index);if(!this.hasOverflow()||!this.popupOpen&&index<=this.overflowIndex){this.setFocusedMenuItemKey(((_a=this.visibleItems[index])==null?void 0:_a.key)||"");}else{await this.setFocusedPopupMenuItemKey(((_b=this.items[index])==null?void 0:_b.key)||"");}},hasOverflow(){return this.overflowIndex!==-1;},async activateItem(index){var _a,_b;if(!this.hasOverflow()||!this.popupOpen&&index<=this.overflowIndex){const key=((_a=this.visibleItems[index])==null?void 0:_a.key)||"";await this.setSelectedMenuItemKey(key);await this.onSelectMenu(key);}else{const key=((_b=this.items[index])==null?void 0:_b.key)||"";this.selectedPopupItemKey=key;await this.onSelectPopup(key);}},async activateInvisibleItem(item){await this.setSelectedMenuItemKey(menuMoreKey);await this.onSelectMenu(menuMoreKey);this.selectedPopupItemKey=item.key;await this.onSelectPopup(item.key);if(item.href){const anchor=document.createElement("a");anchor.href=item.href;if(item.target){anchor.target=item.target;}anchor.click();}},setFocusedItemIndex(index){if(index<0){return;}if(!this.popupOpen&&this.hasOverflow()&&index>this.overflowIndex){this.setCurrentFocusedItemIndex(this.overflowIndex);}else{this.setCurrentFocusedItemIndex(index);}},async setFocusedPopupMenuItemKey(key){this.focusedPopupMenuItemKey="";if(key!==""){await this.$nextTick();this.focusedPopupMenuItemKey=key;}},setFocusedMenuItemKey(key){this.focusedMenuItemKey=key;},async setSelectedMenuItemKey(key){this.selectedMenuItemKey="";if(key!==""){await this.$nextTick();this.selectedMenuItemKey=key;}}}});function _sfc_render$f(_ctx,_cache,$props,$setup,$data,$options){const _component_i_menu=vue.resolveComponent("i-menu");const _component_i_popup_menu=vue.resolveComponent("i-popup-menu");return vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(_component_i_menu,{ref:"menu",modelValue:_ctx.selectedMenuItemKey,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>_ctx.selectedMenuItemKey=$event),items:_ctx.visibleItems,vertical:_ctx.vertical,"focused-item-key":_ctx.focusedMenuItemKey,"selected-menu-item-screen-reader-text":_ctx.selectedMenuItemSrText(),"has-menu-more-selected-items":_ctx.hasPopupMenuSelectedItems,"aria-label":_ctx.menuAriaLabel,onSelect:_ctx.onSelectMenu,onOverflow:_ctx.onOverflow,onKeyup:_ctx.onKeyUp,onKeydown:_ctx.onKeyDown},null,8,["modelValue","items","vertical","focused-item-key","selected-menu-item-screen-reader-text","has-menu-more-selected-items","aria-label","onSelect","onOverflow","onKeyup","onKeydown"]),vue.createTextVNode(),vue.createVNode(_component_i_popup_menu,{ref:"popupMenu",modelValue:_ctx.selectedPopupItemKey,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>_ctx.selectedPopupItemKey=$event),items:_ctx.popupItems,"is-open":_ctx.popupOpen,anchor:_ctx.popupAnchor,"focused-item-key":_ctx.focusedPopupMenuItemKey,"selected-menu-item-screen-reader-text":_ctx.selectedMenuItemSrText(),"aria-label":_ctx.popupAriaLabel,onSelect:_ctx.onSelectPopup,onClose:_ctx.onClosePopup,onKeyup:_ctx.onKeyUp,onKeydown:_ctx.onKeyDown},null,8,["modelValue","items","is-open","anchor","focused-item-key","selected-menu-item-screen-reader-text","aria-label","onSelect","onClose","onKeyup","onKeydown"])]);}const FNavigationMenu=/* @__PURE__ */_export_sfc(_sfc_main$f,[["render",_sfc_render$f]]);const EVENTS=["online","offline"];const _sfc_main$e=vue.defineComponent({name:"FOffline",components:{FIcon,IFlex,IFlexItem},data(){return{isOnline:navigator.onLine||false,role:"none",shouldNotRead:true};},created(){EVENTS.forEach(event=>{window.addEventListener(event,this.updateOnlineStatus);});},beforeUnmount(){EVENTS.forEach(event=>{window.removeEventListener(event,this.updateOnlineStatus);});},mounted(){document.body.prepend(getElementFromVueRef(this.$refs.offline));},methods:{updateOnlineStatus(event){switch(event.type){case"online":this.shouldNotRead=false;this.isOnline=true;break;case"offline":this.shouldNotRead=true;this.isOnline=false;break;default:this.shouldNotRead=true;this.isOnline=false;break;}this.role="alert";}}});const _hoisted_1$d=["role"];const _hoisted_2$9={key:0,class:"offline"};const _hoisted_3$7={class:"icon-stack icon-stack--error"};const _hoisted_4$5={class:"offline__content"};const _hoisted_5$5=["aria-hidden"];function _sfc_render$e(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");const _component_i_flex_item=vue.resolveComponent("i-flex-item");const _component_i_flex=vue.resolveComponent("i-flex");return vue.openBlock(),vue.createElementBlock("div",{ref:"offline",class:"offline__wrapper",role:_ctx.role},[!_ctx.isOnline?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$9,[vue.createVNode(_component_i_flex,{gap:"2x"},{default:vue.withCtx(()=>[vue.createVNode(_component_i_flex_item,{class:"offline__icon",shrink:"",align:"center"},{default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_3$7,[vue.createVNode(_component_f_icon,{name:"triangle"}),vue.createTextVNode(),vue.createVNode(_component_f_icon,{name:"alert"})])]),_:1/* STABLE */}),vue.createTextVNode(),vue.createVNode(_component_i_flex_item,{class:"offline_content",grow:"",align:"center"},{default:vue.withCtx(()=>[vue.createElementVNode("p",_hoisted_4$5,[vue.renderSlot(_ctx.$slots,"default",{},()=>[vue.createTextVNode(" Det verkar som att du inte har någon internetuppkoppling just nu ")])])]),_:3/* FORWARDED */})]),_:3/* FORWARDED */})])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.withDirectives(vue.createElementVNode("span",{class:"sr-only","aria-hidden":_ctx.shouldNotRead?"true":void 0},"\n Din internetuppkoppling fungerar igen\n ",8,_hoisted_5$5),[[vue.vShow,_ctx.isOnline]])],8,_hoisted_1$d);}const FOffline=/* @__PURE__ */_export_sfc(_sfc_main$e,[["render",_sfc_render$e]]);const _sfc_main$d=vue.defineComponent({name:"FOutputField",components:{FLabel},inheritAttrs:false,props:{/**
693
693
  * Associate the output field with one or more id's of the elements
694
694
  * contributing or affecting the result of this field. Multiple id's can
695
695
  * be set with a space-separated string or an array of strings.