@fkui/vue 5.37.2 → 5.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +51 -51
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/esm/index.esm.js +52 -52
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/types/index.d.ts +16333 -4754
- package/htmlvalidate/elements/components.js +5 -1
- package/package.json +10 -10
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
* - `90`
|
|
24
24
|
* - `180`
|
|
25
25
|
* - `270`
|
|
26
|
-
*/rotate:{type:String,default:null,required:false,validator(value){return Rotate.includes(value);}}},computed:{spriteKey(){return`${this.library}-icon-${this.name}`;},spriteId(){return`#${this.spriteKey}`;},modifiers(){const classes=[];if(this.flip){classes.push(`icon--flip-${this.flip}`);}if(this.rotate){classes.push(`icon--rotate-${this.rotate}`);}return classes;},ariaHidden(){const slotUsed=Boolean(this.$slots.default);const ariaLabel=this.$attrs["aria-label"]!==void 0;const ariaLabelledby=this.$attrs["aria-labelledby"]!==void 0;const ariaDescription=this.$attrs["aria-description"]!==void 0;const ariaDescribedby=this.$attrs["aria-describedby"]!==void 0;const hasText=slotUsed||ariaLabel||ariaLabelledby||ariaDescription||ariaDescribedby;return hasText?void 0:"true";}}});const _hoisted_1$U=["aria-hidden"];const _hoisted_2$G=["xlink:href"];function _sfc_render$12(_ctx,_cache,$props,$setup,$data,$options){return vue.openBlock(),vue.createElementBlock("svg",vue.mergeProps(_ctx.$attrs,{focusable:"false",class:["icon",[_ctx.spriteKey,..._ctx.modifiers]],"aria-hidden":_ctx.ariaHidden}),[vue.renderSlot(_ctx.$slots,"default"),vue.createTextVNode(),vue.createElementVNode("use",{"xlink:href":_ctx.spriteId},null,8,_hoisted_2$G)],16,_hoisted_1$U);}const FIcon=/* @__PURE__ */_export_sfc(_sfc_main$1c,[["render",_sfc_render$12]]);const DATA_TEST_ATTRIBUTE_NAME="data-test";function throwErrorIfEmpty(value){if(!value){throw new Error(`Did you forgot to add a value to v-test?`);}}const TestDirective={mounted(el,{value}){throwErrorIfEmpty(value);el.setAttribute(DATA_TEST_ATTRIBUTE_NAME,value);},updated(el,{value}){throwErrorIfEmpty(value);el.setAttribute(DATA_TEST_ATTRIBUTE_NAME,value);}};const TestPlugin={install(app){app.directive("test",TestDirective);}};function translate(key,defaultValueOrArgs,args){const{provider}=logic.TranslationService;return provider.translate(key,defaultValueOrArgs,args);}const TranslationMixin={methods:{$t:translate}};const TranslationPlugin={install(app){app.mixin(TranslationMixin);}};function useTranslate(){return translate;}var commonjsGlobal=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x["default"]:x;}function listCacheClear$1(){this.__data__=[];this.size=0;}var _listCacheClear=listCacheClear$1;function eq$2(value,other){return value===other||value!==value&&other!==other;}var eq_1=eq$2;var eq$1=eq_1;function assocIndexOf$4(array,key){var length=array.length;while(length--){if(eq$1(array[length][0],key)){return length;}}return-1;}var _assocIndexOf=assocIndexOf$4;var assocIndexOf$3=_assocIndexOf;var arrayProto=Array.prototype;var splice=arrayProto.splice;function listCacheDelete$1(key){var data=this.__data__,index=assocIndexOf$3(data,key);if(index<0){return false;}var lastIndex=data.length-1;if(index==lastIndex){data.pop();}else{splice.call(data,index,1);}--this.size;return true;}var _listCacheDelete=listCacheDelete$1;var assocIndexOf$2=_assocIndexOf;function listCacheGet$1(key){var data=this.__data__,index=assocIndexOf$2(data,key);return index<0?void 0:data[index][1];}var _listCacheGet=listCacheGet$1;var assocIndexOf$1=_assocIndexOf;function listCacheHas$1(key){return assocIndexOf$1(this.__data__,key)>-1;}var _listCacheHas=listCacheHas$1;var assocIndexOf=_assocIndexOf;function listCacheSet$1(key,value){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){++this.size;data.push([key,value]);}else{data[index][1]=value;}return this;}var _listCacheSet=listCacheSet$1;var listCacheClear=_listCacheClear,listCacheDelete=_listCacheDelete,listCacheGet=_listCacheGet,listCacheHas=_listCacheHas,listCacheSet=_listCacheSet;function ListCache$4(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}ListCache$4.prototype.clear=listCacheClear;ListCache$4.prototype["delete"]=listCacheDelete;ListCache$4.prototype.get=listCacheGet;ListCache$4.prototype.has=listCacheHas;ListCache$4.prototype.set=listCacheSet;var _ListCache=ListCache$4;var ListCache$3=_ListCache;function stackClear$1(){this.__data__=new ListCache$3();this.size=0;}var _stackClear=stackClear$1;function stackDelete$1(key){var data=this.__data__,result=data["delete"](key);this.size=data.size;return result;}var _stackDelete=stackDelete$1;function stackGet$1(key){return this.__data__.get(key);}var _stackGet=stackGet$1;function stackHas$1(key){return this.__data__.has(key);}var _stackHas=stackHas$1;var freeGlobal$1=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal;var _freeGlobal=freeGlobal$1;var freeGlobal=_freeGlobal;var freeSelf=typeof self=="object"&&self&&self.Object===Object&&self;var root$8=freeGlobal||freeSelf||Function("return this")();var _root=root$8;var root$7=_root;var Symbol$4=root$7.Symbol;var _Symbol=Symbol$4;var Symbol$3=_Symbol;var objectProto$b=Object.prototype;var hasOwnProperty$8=objectProto$b.hasOwnProperty;var nativeObjectToString$1=objectProto$b.toString;var symToStringTag$1=Symbol$3?Symbol$3.toStringTag:void 0;function getRawTag$1(value){var isOwn=hasOwnProperty$8.call(value,symToStringTag$1),tag=value[symToStringTag$1];try{value[symToStringTag$1]=void 0;var unmasked=true;}catch(e){}var result=nativeObjectToString$1.call(value);if(unmasked){if(isOwn){value[symToStringTag$1]=tag;}else{delete value[symToStringTag$1];}}return result;}var _getRawTag=getRawTag$1;var objectProto$a=Object.prototype;var nativeObjectToString=objectProto$a.toString;function objectToString$1(value){return nativeObjectToString.call(value);}var _objectToString=objectToString$1;var Symbol$2=_Symbol,getRawTag=_getRawTag,objectToString=_objectToString;var nullTag="[object Null]",undefinedTag="[object Undefined]";var symToStringTag=Symbol$2?Symbol$2.toStringTag:void 0;function baseGetTag$4(value){if(value==null){return value===void 0?undefinedTag:nullTag;}return symToStringTag&&symToStringTag in Object(value)?getRawTag(value):objectToString(value);}var _baseGetTag=baseGetTag$4;function isObject$2(value){var type=typeof value;return value!=null&&(type=="object"||type=="function");}var isObject_1=isObject$2;var baseGetTag$3=_baseGetTag,isObject$1=isObject_1;var asyncTag="[object AsyncFunction]",funcTag$1="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$2(value){if(!isObject$1(value)){return false;}var tag=baseGetTag$3(value);return tag==funcTag$1||tag==genTag||tag==asyncTag||tag==proxyTag;}var isFunction_1=isFunction$2;var root$6=_root;var coreJsData$1=root$6["__core-js_shared__"];var _coreJsData=coreJsData$1;var coreJsData=_coreJsData;var maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:"";}();function isMasked$1(func){return!!maskSrcKey&&maskSrcKey in func;}var _isMasked=isMasked$1;var funcProto$1=Function.prototype;var funcToString$1=funcProto$1.toString;function toSource$2(func){if(func!=null){try{return funcToString$1.call(func);}catch(e){}try{return func+"";}catch(e){}}return"";}var _toSource=toSource$2;var isFunction$1=isFunction_1,isMasked=_isMasked,isObject=isObject_1,toSource$1=_toSource;var reRegExpChar=/[\\^$.*+?()[\]{}|]/g;var reIsHostCtor=/^\[object .+?Constructor\]$/;var funcProto=Function.prototype,objectProto$9=Object.prototype;var funcToString=funcProto.toString;var hasOwnProperty$7=objectProto$9.hasOwnProperty;var reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$7).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative$1(value){if(!isObject(value)||isMasked(value)){return false;}var pattern=isFunction$1(value)?reIsNative:reIsHostCtor;return pattern.test(toSource$1(value));}var _baseIsNative=baseIsNative$1;function getValue$1(object,key){return object==null?void 0:object[key];}var _getValue=getValue$1;var baseIsNative=_baseIsNative,getValue=_getValue;function getNative$6(object,key){var value=getValue(object,key);return baseIsNative(value)?value:void 0;}var _getNative=getNative$6;var getNative$5=_getNative,root$5=_root;var Map$4=getNative$5(root$5,"Map");var _Map=Map$4;var getNative$4=_getNative;var nativeCreate$4=getNative$4(Object,"create");var _nativeCreate=nativeCreate$4;var nativeCreate$3=_nativeCreate;function hashClear$1(){this.__data__=nativeCreate$3?nativeCreate$3(null):{};this.size=0;}var _hashClear=hashClear$1;function hashDelete$1(key){var result=this.has(key)&&delete this.__data__[key];this.size-=result?1:0;return result;}var _hashDelete=hashDelete$1;var nativeCreate$2=_nativeCreate;var HASH_UNDEFINED$2="__lodash_hash_undefined__";var objectProto$8=Object.prototype;var hasOwnProperty$6=objectProto$8.hasOwnProperty;function hashGet$1(key){var data=this.__data__;if(nativeCreate$2){var result=data[key];return result===HASH_UNDEFINED$2?void 0:result;}return hasOwnProperty$6.call(data,key)?data[key]:void 0;}var _hashGet=hashGet$1;var nativeCreate$1=_nativeCreate;var objectProto$7=Object.prototype;var hasOwnProperty$5=objectProto$7.hasOwnProperty;function hashHas$1(key){var data=this.__data__;return nativeCreate$1?data[key]!==void 0:hasOwnProperty$5.call(data,key);}var _hashHas=hashHas$1;var nativeCreate=_nativeCreate;var HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet$1(key,value){var data=this.__data__;this.size+=this.has(key)?0:1;data[key]=nativeCreate&&value===void 0?HASH_UNDEFINED$1:value;return this;}var _hashSet=hashSet$1;var hashClear=_hashClear,hashDelete=_hashDelete,hashGet=_hashGet,hashHas=_hashHas,hashSet=_hashSet;function Hash$1(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}Hash$1.prototype.clear=hashClear;Hash$1.prototype["delete"]=hashDelete;Hash$1.prototype.get=hashGet;Hash$1.prototype.has=hashHas;Hash$1.prototype.set=hashSet;var _Hash=Hash$1;var Hash=_Hash,ListCache$2=_ListCache,Map$3=_Map;function mapCacheClear$1(){this.size=0;this.__data__={"hash":new Hash(),"map":new(Map$3||ListCache$2)(),"string":new Hash()};}var _mapCacheClear=mapCacheClear$1;function isKeyable$1(value){var type=typeof value;return type=="string"||type=="number"||type=="symbol"||type=="boolean"?value!=="__proto__":value===null;}var _isKeyable=isKeyable$1;var isKeyable=_isKeyable;function getMapData$4(map,key){var data=map.__data__;return isKeyable(key)?data[typeof key=="string"?"string":"hash"]:data.map;}var _getMapData=getMapData$4;var getMapData$3=_getMapData;function mapCacheDelete$1(key){var result=getMapData$3(this,key)["delete"](key);this.size-=result?1:0;return result;}var _mapCacheDelete=mapCacheDelete$1;var getMapData$2=_getMapData;function mapCacheGet$1(key){return getMapData$2(this,key).get(key);}var _mapCacheGet=mapCacheGet$1;var getMapData$1=_getMapData;function mapCacheHas$1(key){return getMapData$1(this,key).has(key);}var _mapCacheHas=mapCacheHas$1;var getMapData=_getMapData;function mapCacheSet$1(key,value){var data=getMapData(this,key),size=data.size;data.set(key,value);this.size+=data.size==size?0:1;return this;}var _mapCacheSet=mapCacheSet$1;var mapCacheClear=_mapCacheClear,mapCacheDelete=_mapCacheDelete,mapCacheGet=_mapCacheGet,mapCacheHas=_mapCacheHas,mapCacheSet=_mapCacheSet;function MapCache$2(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}MapCache$2.prototype.clear=mapCacheClear;MapCache$2.prototype["delete"]=mapCacheDelete;MapCache$2.prototype.get=mapCacheGet;MapCache$2.prototype.has=mapCacheHas;MapCache$2.prototype.set=mapCacheSet;var _MapCache=MapCache$2;var ListCache$1=_ListCache,Map$2=_Map,MapCache$1=_MapCache;var LARGE_ARRAY_SIZE=200;function stackSet$1(key,value){var data=this.__data__;if(data instanceof ListCache$1){var pairs=data.__data__;if(!Map$2||pairs.length<LARGE_ARRAY_SIZE-1){pairs.push([key,value]);this.size=++data.size;return this;}data=this.__data__=new MapCache$1(pairs);}data.set(key,value);this.size=data.size;return this;}var _stackSet=stackSet$1;var ListCache=_ListCache,stackClear=_stackClear,stackDelete=_stackDelete,stackGet=_stackGet,stackHas=_stackHas,stackSet=_stackSet;function Stack$1(entries){var data=this.__data__=new ListCache(entries);this.size=data.size;}Stack$1.prototype.clear=stackClear;Stack$1.prototype["delete"]=stackDelete;Stack$1.prototype.get=stackGet;Stack$1.prototype.has=stackHas;Stack$1.prototype.set=stackSet;var _Stack=Stack$1;var HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd$1(value){this.__data__.set(value,HASH_UNDEFINED);return this;}var _setCacheAdd=setCacheAdd$1;function setCacheHas$1(value){return this.__data__.has(value);}var _setCacheHas=setCacheHas$1;var MapCache=_MapCache,setCacheAdd=_setCacheAdd,setCacheHas=_setCacheHas;function SetCache$1(values){var index=-1,length=values==null?0:values.length;this.__data__=new MapCache();while(++index<length){this.add(values[index]);}}SetCache$1.prototype.add=SetCache$1.prototype.push=setCacheAdd;SetCache$1.prototype.has=setCacheHas;var _SetCache=SetCache$1;function arraySome$1(array,predicate){var index=-1,length=array==null?0:array.length;while(++index<length){if(predicate(array[index],index,array)){return true;}}return false;}var _arraySome=arraySome$1;function cacheHas$1(cache,key){return cache.has(key);}var _cacheHas=cacheHas$1;var SetCache=_SetCache,arraySome=_arraySome,cacheHas=_cacheHas;var COMPARE_PARTIAL_FLAG$3=1,COMPARE_UNORDERED_FLAG$1=2;function equalArrays$2(array,other,bitmask,customizer,equalFunc,stack){var isPartial=bitmask&COMPARE_PARTIAL_FLAG$3,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength)){return false;}var arrStacked=stack.get(array);var othStacked=stack.get(other);if(arrStacked&&othStacked){return arrStacked==other&&othStacked==array;}var index=-1,result=true,seen=bitmask&COMPARE_UNORDERED_FLAG$1?new SetCache():void 0;stack.set(array,other);stack.set(other,array);while(++index<arrLength){var arrValue=array[index],othValue=other[index];if(customizer){var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);}if(compared!==void 0){if(compared){continue;}result=false;break;}if(seen){if(!arraySome(other,function(othValue2,othIndex){if(!cacheHas(seen,othIndex)&&(arrValue===othValue2||equalFunc(arrValue,othValue2,bitmask,customizer,stack))){return seen.push(othIndex);}})){result=false;break;}}else if(!(arrValue===othValue||equalFunc(arrValue,othValue,bitmask,customizer,stack))){result=false;break;}}stack["delete"](array);stack["delete"](other);return result;}var _equalArrays=equalArrays$2;var root$4=_root;var Uint8Array$1=root$4.Uint8Array;var _Uint8Array=Uint8Array$1;function mapToArray$1(map){var index=-1,result=Array(map.size);map.forEach(function(value,key){result[++index]=[key,value];});return result;}var _mapToArray=mapToArray$1;function setToArray$1(set){var index=-1,result=Array(set.size);set.forEach(function(value){result[++index]=value;});return result;}var _setToArray=setToArray$1;var Symbol$1=_Symbol,Uint8Array2=_Uint8Array,eq=eq_1,equalArrays$1=_equalArrays,mapToArray=_mapToArray,setToArray=_setToArray;var COMPARE_PARTIAL_FLAG$2=1,COMPARE_UNORDERED_FLAG=2;var boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",mapTag$2="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$2="[object Set]",stringTag$1="[object String]",symbolTag="[object Symbol]";var arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$2="[object DataView]";var symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function equalByTag$1(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case dataViewTag$2:if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset){return false;}object=object.buffer;other=other.buffer;case arrayBufferTag$1:if(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array2(object),new Uint8Array2(other))){return false;}return true;case boolTag$1:case dateTag$1:case numberTag$1:return eq(+object,+other);case errorTag$1:return object.name==other.name&&object.message==other.message;case regexpTag$1:case stringTag$1:return object==other+"";case mapTag$2:var convert=mapToArray;case setTag$2:var isPartial=bitmask&COMPARE_PARTIAL_FLAG$2;convert||(convert=setToArray);if(object.size!=other.size&&!isPartial){return false;}var stacked=stack.get(object);if(stacked){return stacked==other;}bitmask|=COMPARE_UNORDERED_FLAG;stack.set(object,other);var result=equalArrays$1(convert(object),convert(other),bitmask,customizer,equalFunc,stack);stack["delete"](object);return result;case symbolTag:if(symbolValueOf){return symbolValueOf.call(object)==symbolValueOf.call(other);}}return false;}var _equalByTag=equalByTag$1;function arrayPush$1(array,values){var index=-1,length=values.length,offset2=array.length;while(++index<length){array[offset2+index]=values[index];}return array;}var _arrayPush=arrayPush$1;var isArray$3=Array.isArray;var isArray_1=isArray$3;var arrayPush=_arrayPush,isArray$2=isArray_1;function baseGetAllKeys$1(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray$2(object)?result:arrayPush(result,symbolsFunc(object));}var _baseGetAllKeys=baseGetAllKeys$1;function arrayFilter$1(array,predicate){var index=-1,length=array==null?0:array.length,resIndex=0,result=[];while(++index<length){var value=array[index];if(predicate(value,index,array)){result[resIndex++]=value;}}return result;}var _arrayFilter=arrayFilter$1;function stubArray$1(){return[];}var stubArray_1=stubArray$1;var arrayFilter=_arrayFilter,stubArray=stubArray_1;var objectProto$6=Object.prototype;var propertyIsEnumerable$1=objectProto$6.propertyIsEnumerable;var nativeGetSymbols=Object.getOwnPropertySymbols;var getSymbols$1=!nativeGetSymbols?stubArray:function(object){if(object==null){return[];}object=Object(object);return arrayFilter(nativeGetSymbols(object),function(symbol){return propertyIsEnumerable$1.call(object,symbol);});};var _getSymbols=getSymbols$1;function baseTimes$1(n,iteratee){var index=-1,result=Array(n);while(++index<n){result[index]=iteratee(index);}return result;}var _baseTimes=baseTimes$1;function isObjectLike$4(value){return value!=null&&typeof value=="object";}var isObjectLike_1=isObjectLike$4;var baseGetTag$2=_baseGetTag,isObjectLike$3=isObjectLike_1;var argsTag$2="[object Arguments]";function baseIsArguments$1(value){return isObjectLike$3(value)&&baseGetTag$2(value)==argsTag$2;}var _baseIsArguments=baseIsArguments$1;var baseIsArguments=_baseIsArguments,isObjectLike$2=isObjectLike_1;var objectProto$5=Object.prototype;var hasOwnProperty$4=objectProto$5.hasOwnProperty;var propertyIsEnumerable=objectProto$5.propertyIsEnumerable;var isArguments$1=baseIsArguments(/* @__PURE__ */function(){return arguments;}())?baseIsArguments:function(value){return isObjectLike$2(value)&&hasOwnProperty$4.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee");};var isArguments_1=isArguments$1;var isBuffer$2={exports:{}};function stubFalse(){return false;}var stubFalse_1=stubFalse;isBuffer$2.exports;(function(module2,exports2){var root2=_root,stubFalse2=stubFalse_1;var freeExports=exports2&&!exports2.nodeType&&exports2;var freeModule=freeExports&&true&&module2&&!module2.nodeType&&module2;var moduleExports=freeModule&&freeModule.exports===freeExports;var Buffer2=moduleExports?root2.Buffer:void 0;var nativeIsBuffer=Buffer2?Buffer2.isBuffer:void 0;var isBuffer2=nativeIsBuffer||stubFalse2;module2.exports=isBuffer2;})(isBuffer$2,isBuffer$2.exports);var isBufferExports=isBuffer$2.exports;var MAX_SAFE_INTEGER$1=9007199254740991;var reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex$1(value,length){var type=typeof value;length=length==null?MAX_SAFE_INTEGER$1:length;return!!length&&(type=="number"||type!="symbol"&&reIsUint.test(value))&&value>-1&&value%1==0&&value<length;}var _isIndex=isIndex$1;var MAX_SAFE_INTEGER=9007199254740991;function isLength$2(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER;}var isLength_1=isLength$2;var baseGetTag$1=_baseGetTag,isLength$1=isLength_1,isObjectLike$1=isObjectLike_1;var argsTag$1="[object Arguments]",arrayTag$1="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",mapTag$1="[object Map]",numberTag="[object Number]",objectTag$2="[object Object]",regexpTag="[object RegExp]",setTag$1="[object Set]",stringTag="[object String]",weakMapTag$1="[object WeakMap]";var arrayBufferTag="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]";var typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=true;typedArrayTags[argsTag$1]=typedArrayTags[arrayTag$1]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag$1]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag$1]=typedArrayTags[numberTag]=typedArrayTags[objectTag$2]=typedArrayTags[regexpTag]=typedArrayTags[setTag$1]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag$1]=false;function baseIsTypedArray$1(value){return isObjectLike$1(value)&&isLength$1(value.length)&&!!typedArrayTags[baseGetTag$1(value)];}var _baseIsTypedArray=baseIsTypedArray$1;function baseUnary$1(func){return function(value){return func(value);};}var _baseUnary=baseUnary$1;var _nodeUtil={exports:{}};_nodeUtil.exports;(function(module2,exports2){var freeGlobal2=_freeGlobal;var freeExports=exports2&&!exports2.nodeType&&exports2;var freeModule=freeExports&&true&&module2&&!module2.nodeType&&module2;var moduleExports=freeModule&&freeModule.exports===freeExports;var freeProcess=moduleExports&&freeGlobal2.process;var nodeUtil2=function(){try{var types=freeModule&&freeModule.require&&freeModule.require("util").types;if(types){return types;}return freeProcess&&freeProcess.binding&&freeProcess.binding("util");}catch(e){}}();module2.exports=nodeUtil2;})(_nodeUtil,_nodeUtil.exports);var _nodeUtilExports=_nodeUtil.exports;var baseIsTypedArray=_baseIsTypedArray,baseUnary=_baseUnary,nodeUtil=_nodeUtilExports;var nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;var isTypedArray$2=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;var isTypedArray_1=isTypedArray$2;var baseTimes=_baseTimes,isArguments=isArguments_1,isArray$1=isArray_1,isBuffer$1=isBufferExports,isIndex=_isIndex,isTypedArray$1=isTypedArray_1;var objectProto$4=Object.prototype;var hasOwnProperty$3=objectProto$4.hasOwnProperty;function arrayLikeKeys$1(value,inherited){var isArr=isArray$1(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer$1(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray$1(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?baseTimes(value.length,String):[],length=result.length;for(var key in value){if((inherited||hasOwnProperty$3.call(value,key))&&!(skipIndexes&&(// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
26
|
+
*/rotate:{type:String,default:null,required:false,validator(value){return Rotate.includes(value);}}},computed:{spriteKey(){return`${this.library}-icon-${this.name}`;},spriteId(){return`#${this.spriteKey}`;},modifiers(){const classes=[];if(this.flip){classes.push(`icon--flip-${this.flip}`);}if(this.rotate){classes.push(`icon--rotate-${this.rotate}`);}return classes;},ariaHidden(){const slotUsed=Boolean(this.$slots.default);const ariaLabel=this.$attrs["aria-label"]!==void 0;const ariaLabelledby=this.$attrs["aria-labelledby"]!==void 0;const ariaDescription=this.$attrs["aria-description"]!==void 0;const ariaDescribedby=this.$attrs["aria-describedby"]!==void 0;const hasText=slotUsed||ariaLabel||ariaLabelledby||ariaDescription||ariaDescribedby;return hasText?void 0:"true";}}});const _hoisted_1$T=["aria-hidden"];const _hoisted_2$F=["xlink:href"];function _sfc_render$12(_ctx,_cache,$props,$setup,$data,$options){return vue.openBlock(),vue.createElementBlock("svg",vue.mergeProps(_ctx.$attrs,{focusable:"false",class:["icon",[_ctx.spriteKey,..._ctx.modifiers]],"aria-hidden":_ctx.ariaHidden}),[vue.renderSlot(_ctx.$slots,"default"),_cache[0]||(_cache[0]=vue.createTextVNode()),vue.createElementVNode("use",{"xlink:href":_ctx.spriteId},null,8,_hoisted_2$F)],16,_hoisted_1$T);}const FIcon=/* @__PURE__ */_export_sfc(_sfc_main$1c,[["render",_sfc_render$12]]);const DATA_TEST_ATTRIBUTE_NAME="data-test";function throwErrorIfEmpty(value){if(!value){throw new Error(`Did you forgot to add a value to v-test?`);}}const TestDirective={mounted(el,{value}){throwErrorIfEmpty(value);el.setAttribute(DATA_TEST_ATTRIBUTE_NAME,value);},updated(el,{value}){throwErrorIfEmpty(value);el.setAttribute(DATA_TEST_ATTRIBUTE_NAME,value);}};const TestPlugin={install(app){app.directive("test",TestDirective);}};function translate(key,defaultValueOrArgs,args){const{provider}=logic.TranslationService;return provider.translate(key,defaultValueOrArgs,args);}const TranslationMixin={methods:{$t:translate}};const TranslationPlugin={install(app){app.mixin(TranslationMixin);}};function useTranslate(){return translate;}var commonjsGlobal=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x["default"]:x;}function listCacheClear$1(){this.__data__=[];this.size=0;}var _listCacheClear=listCacheClear$1;function eq$2(value,other){return value===other||value!==value&&other!==other;}var eq_1=eq$2;var eq$1=eq_1;function assocIndexOf$4(array,key){var length=array.length;while(length--){if(eq$1(array[length][0],key)){return length;}}return-1;}var _assocIndexOf=assocIndexOf$4;var assocIndexOf$3=_assocIndexOf;var arrayProto=Array.prototype;var splice=arrayProto.splice;function listCacheDelete$1(key){var data=this.__data__,index=assocIndexOf$3(data,key);if(index<0){return false;}var lastIndex=data.length-1;if(index==lastIndex){data.pop();}else{splice.call(data,index,1);}--this.size;return true;}var _listCacheDelete=listCacheDelete$1;var assocIndexOf$2=_assocIndexOf;function listCacheGet$1(key){var data=this.__data__,index=assocIndexOf$2(data,key);return index<0?void 0:data[index][1];}var _listCacheGet=listCacheGet$1;var assocIndexOf$1=_assocIndexOf;function listCacheHas$1(key){return assocIndexOf$1(this.__data__,key)>-1;}var _listCacheHas=listCacheHas$1;var assocIndexOf=_assocIndexOf;function listCacheSet$1(key,value){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){++this.size;data.push([key,value]);}else{data[index][1]=value;}return this;}var _listCacheSet=listCacheSet$1;var listCacheClear=_listCacheClear,listCacheDelete=_listCacheDelete,listCacheGet=_listCacheGet,listCacheHas=_listCacheHas,listCacheSet=_listCacheSet;function ListCache$4(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}ListCache$4.prototype.clear=listCacheClear;ListCache$4.prototype["delete"]=listCacheDelete;ListCache$4.prototype.get=listCacheGet;ListCache$4.prototype.has=listCacheHas;ListCache$4.prototype.set=listCacheSet;var _ListCache=ListCache$4;var ListCache$3=_ListCache;function stackClear$1(){this.__data__=new ListCache$3();this.size=0;}var _stackClear=stackClear$1;function stackDelete$1(key){var data=this.__data__,result=data["delete"](key);this.size=data.size;return result;}var _stackDelete=stackDelete$1;function stackGet$1(key){return this.__data__.get(key);}var _stackGet=stackGet$1;function stackHas$1(key){return this.__data__.has(key);}var _stackHas=stackHas$1;var freeGlobal$1=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal;var _freeGlobal=freeGlobal$1;var freeGlobal=_freeGlobal;var freeSelf=typeof self=="object"&&self&&self.Object===Object&&self;var root$8=freeGlobal||freeSelf||Function("return this")();var _root=root$8;var root$7=_root;var Symbol$4=root$7.Symbol;var _Symbol=Symbol$4;var Symbol$3=_Symbol;var objectProto$b=Object.prototype;var hasOwnProperty$8=objectProto$b.hasOwnProperty;var nativeObjectToString$1=objectProto$b.toString;var symToStringTag$1=Symbol$3?Symbol$3.toStringTag:void 0;function getRawTag$1(value){var isOwn=hasOwnProperty$8.call(value,symToStringTag$1),tag=value[symToStringTag$1];try{value[symToStringTag$1]=void 0;var unmasked=true;}catch(e){}var result=nativeObjectToString$1.call(value);if(unmasked){if(isOwn){value[symToStringTag$1]=tag;}else{delete value[symToStringTag$1];}}return result;}var _getRawTag=getRawTag$1;var objectProto$a=Object.prototype;var nativeObjectToString=objectProto$a.toString;function objectToString$1(value){return nativeObjectToString.call(value);}var _objectToString=objectToString$1;var Symbol$2=_Symbol,getRawTag=_getRawTag,objectToString=_objectToString;var nullTag="[object Null]",undefinedTag="[object Undefined]";var symToStringTag=Symbol$2?Symbol$2.toStringTag:void 0;function baseGetTag$4(value){if(value==null){return value===void 0?undefinedTag:nullTag;}return symToStringTag&&symToStringTag in Object(value)?getRawTag(value):objectToString(value);}var _baseGetTag=baseGetTag$4;function isObject$2(value){var type=typeof value;return value!=null&&(type=="object"||type=="function");}var isObject_1=isObject$2;var baseGetTag$3=_baseGetTag,isObject$1=isObject_1;var asyncTag="[object AsyncFunction]",funcTag$1="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$2(value){if(!isObject$1(value)){return false;}var tag=baseGetTag$3(value);return tag==funcTag$1||tag==genTag||tag==asyncTag||tag==proxyTag;}var isFunction_1=isFunction$2;var root$6=_root;var coreJsData$1=root$6["__core-js_shared__"];var _coreJsData=coreJsData$1;var coreJsData=_coreJsData;var maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:"";}();function isMasked$1(func){return!!maskSrcKey&&maskSrcKey in func;}var _isMasked=isMasked$1;var funcProto$1=Function.prototype;var funcToString$1=funcProto$1.toString;function toSource$2(func){if(func!=null){try{return funcToString$1.call(func);}catch(e){}try{return func+"";}catch(e){}}return"";}var _toSource=toSource$2;var isFunction$1=isFunction_1,isMasked=_isMasked,isObject=isObject_1,toSource$1=_toSource;var reRegExpChar=/[\\^$.*+?()[\]{}|]/g;var reIsHostCtor=/^\[object .+?Constructor\]$/;var funcProto=Function.prototype,objectProto$9=Object.prototype;var funcToString=funcProto.toString;var hasOwnProperty$7=objectProto$9.hasOwnProperty;var reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$7).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative$1(value){if(!isObject(value)||isMasked(value)){return false;}var pattern=isFunction$1(value)?reIsNative:reIsHostCtor;return pattern.test(toSource$1(value));}var _baseIsNative=baseIsNative$1;function getValue$1(object,key){return object==null?void 0:object[key];}var _getValue=getValue$1;var baseIsNative=_baseIsNative,getValue=_getValue;function getNative$6(object,key){var value=getValue(object,key);return baseIsNative(value)?value:void 0;}var _getNative=getNative$6;var getNative$5=_getNative,root$5=_root;var Map$4=getNative$5(root$5,"Map");var _Map=Map$4;var getNative$4=_getNative;var nativeCreate$4=getNative$4(Object,"create");var _nativeCreate=nativeCreate$4;var nativeCreate$3=_nativeCreate;function hashClear$1(){this.__data__=nativeCreate$3?nativeCreate$3(null):{};this.size=0;}var _hashClear=hashClear$1;function hashDelete$1(key){var result=this.has(key)&&delete this.__data__[key];this.size-=result?1:0;return result;}var _hashDelete=hashDelete$1;var nativeCreate$2=_nativeCreate;var HASH_UNDEFINED$2="__lodash_hash_undefined__";var objectProto$8=Object.prototype;var hasOwnProperty$6=objectProto$8.hasOwnProperty;function hashGet$1(key){var data=this.__data__;if(nativeCreate$2){var result=data[key];return result===HASH_UNDEFINED$2?void 0:result;}return hasOwnProperty$6.call(data,key)?data[key]:void 0;}var _hashGet=hashGet$1;var nativeCreate$1=_nativeCreate;var objectProto$7=Object.prototype;var hasOwnProperty$5=objectProto$7.hasOwnProperty;function hashHas$1(key){var data=this.__data__;return nativeCreate$1?data[key]!==void 0:hasOwnProperty$5.call(data,key);}var _hashHas=hashHas$1;var nativeCreate=_nativeCreate;var HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet$1(key,value){var data=this.__data__;this.size+=this.has(key)?0:1;data[key]=nativeCreate&&value===void 0?HASH_UNDEFINED$1:value;return this;}var _hashSet=hashSet$1;var hashClear=_hashClear,hashDelete=_hashDelete,hashGet=_hashGet,hashHas=_hashHas,hashSet=_hashSet;function Hash$1(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}Hash$1.prototype.clear=hashClear;Hash$1.prototype["delete"]=hashDelete;Hash$1.prototype.get=hashGet;Hash$1.prototype.has=hashHas;Hash$1.prototype.set=hashSet;var _Hash=Hash$1;var Hash=_Hash,ListCache$2=_ListCache,Map$3=_Map;function mapCacheClear$1(){this.size=0;this.__data__={"hash":new Hash(),"map":new(Map$3||ListCache$2)(),"string":new Hash()};}var _mapCacheClear=mapCacheClear$1;function isKeyable$1(value){var type=typeof value;return type=="string"||type=="number"||type=="symbol"||type=="boolean"?value!=="__proto__":value===null;}var _isKeyable=isKeyable$1;var isKeyable=_isKeyable;function getMapData$4(map,key){var data=map.__data__;return isKeyable(key)?data[typeof key=="string"?"string":"hash"]:data.map;}var _getMapData=getMapData$4;var getMapData$3=_getMapData;function mapCacheDelete$1(key){var result=getMapData$3(this,key)["delete"](key);this.size-=result?1:0;return result;}var _mapCacheDelete=mapCacheDelete$1;var getMapData$2=_getMapData;function mapCacheGet$1(key){return getMapData$2(this,key).get(key);}var _mapCacheGet=mapCacheGet$1;var getMapData$1=_getMapData;function mapCacheHas$1(key){return getMapData$1(this,key).has(key);}var _mapCacheHas=mapCacheHas$1;var getMapData=_getMapData;function mapCacheSet$1(key,value){var data=getMapData(this,key),size=data.size;data.set(key,value);this.size+=data.size==size?0:1;return this;}var _mapCacheSet=mapCacheSet$1;var mapCacheClear=_mapCacheClear,mapCacheDelete=_mapCacheDelete,mapCacheGet=_mapCacheGet,mapCacheHas=_mapCacheHas,mapCacheSet=_mapCacheSet;function MapCache$2(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}MapCache$2.prototype.clear=mapCacheClear;MapCache$2.prototype["delete"]=mapCacheDelete;MapCache$2.prototype.get=mapCacheGet;MapCache$2.prototype.has=mapCacheHas;MapCache$2.prototype.set=mapCacheSet;var _MapCache=MapCache$2;var ListCache$1=_ListCache,Map$2=_Map,MapCache$1=_MapCache;var LARGE_ARRAY_SIZE=200;function stackSet$1(key,value){var data=this.__data__;if(data instanceof ListCache$1){var pairs=data.__data__;if(!Map$2||pairs.length<LARGE_ARRAY_SIZE-1){pairs.push([key,value]);this.size=++data.size;return this;}data=this.__data__=new MapCache$1(pairs);}data.set(key,value);this.size=data.size;return this;}var _stackSet=stackSet$1;var ListCache=_ListCache,stackClear=_stackClear,stackDelete=_stackDelete,stackGet=_stackGet,stackHas=_stackHas,stackSet=_stackSet;function Stack$1(entries){var data=this.__data__=new ListCache(entries);this.size=data.size;}Stack$1.prototype.clear=stackClear;Stack$1.prototype["delete"]=stackDelete;Stack$1.prototype.get=stackGet;Stack$1.prototype.has=stackHas;Stack$1.prototype.set=stackSet;var _Stack=Stack$1;var HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd$1(value){this.__data__.set(value,HASH_UNDEFINED);return this;}var _setCacheAdd=setCacheAdd$1;function setCacheHas$1(value){return this.__data__.has(value);}var _setCacheHas=setCacheHas$1;var MapCache=_MapCache,setCacheAdd=_setCacheAdd,setCacheHas=_setCacheHas;function SetCache$1(values){var index=-1,length=values==null?0:values.length;this.__data__=new MapCache();while(++index<length){this.add(values[index]);}}SetCache$1.prototype.add=SetCache$1.prototype.push=setCacheAdd;SetCache$1.prototype.has=setCacheHas;var _SetCache=SetCache$1;function arraySome$1(array,predicate){var index=-1,length=array==null?0:array.length;while(++index<length){if(predicate(array[index],index,array)){return true;}}return false;}var _arraySome=arraySome$1;function cacheHas$1(cache,key){return cache.has(key);}var _cacheHas=cacheHas$1;var SetCache=_SetCache,arraySome=_arraySome,cacheHas=_cacheHas;var COMPARE_PARTIAL_FLAG$3=1,COMPARE_UNORDERED_FLAG$1=2;function equalArrays$2(array,other,bitmask,customizer,equalFunc,stack){var isPartial=bitmask&COMPARE_PARTIAL_FLAG$3,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength)){return false;}var arrStacked=stack.get(array);var othStacked=stack.get(other);if(arrStacked&&othStacked){return arrStacked==other&&othStacked==array;}var index=-1,result=true,seen=bitmask&COMPARE_UNORDERED_FLAG$1?new SetCache():void 0;stack.set(array,other);stack.set(other,array);while(++index<arrLength){var arrValue=array[index],othValue=other[index];if(customizer){var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);}if(compared!==void 0){if(compared){continue;}result=false;break;}if(seen){if(!arraySome(other,function(othValue2,othIndex){if(!cacheHas(seen,othIndex)&&(arrValue===othValue2||equalFunc(arrValue,othValue2,bitmask,customizer,stack))){return seen.push(othIndex);}})){result=false;break;}}else if(!(arrValue===othValue||equalFunc(arrValue,othValue,bitmask,customizer,stack))){result=false;break;}}stack["delete"](array);stack["delete"](other);return result;}var _equalArrays=equalArrays$2;var root$4=_root;var Uint8Array$1=root$4.Uint8Array;var _Uint8Array=Uint8Array$1;function mapToArray$1(map){var index=-1,result=Array(map.size);map.forEach(function(value,key){result[++index]=[key,value];});return result;}var _mapToArray=mapToArray$1;function setToArray$1(set){var index=-1,result=Array(set.size);set.forEach(function(value){result[++index]=value;});return result;}var _setToArray=setToArray$1;var Symbol$1=_Symbol,Uint8Array2=_Uint8Array,eq=eq_1,equalArrays$1=_equalArrays,mapToArray=_mapToArray,setToArray=_setToArray;var COMPARE_PARTIAL_FLAG$2=1,COMPARE_UNORDERED_FLAG=2;var boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",mapTag$2="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$2="[object Set]",stringTag$1="[object String]",symbolTag="[object Symbol]";var arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$2="[object DataView]";var symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function equalByTag$1(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case dataViewTag$2:if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset){return false;}object=object.buffer;other=other.buffer;case arrayBufferTag$1:if(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array2(object),new Uint8Array2(other))){return false;}return true;case boolTag$1:case dateTag$1:case numberTag$1:return eq(+object,+other);case errorTag$1:return object.name==other.name&&object.message==other.message;case regexpTag$1:case stringTag$1:return object==other+"";case mapTag$2:var convert=mapToArray;case setTag$2:var isPartial=bitmask&COMPARE_PARTIAL_FLAG$2;convert||(convert=setToArray);if(object.size!=other.size&&!isPartial){return false;}var stacked=stack.get(object);if(stacked){return stacked==other;}bitmask|=COMPARE_UNORDERED_FLAG;stack.set(object,other);var result=equalArrays$1(convert(object),convert(other),bitmask,customizer,equalFunc,stack);stack["delete"](object);return result;case symbolTag:if(symbolValueOf){return symbolValueOf.call(object)==symbolValueOf.call(other);}}return false;}var _equalByTag=equalByTag$1;function arrayPush$1(array,values){var index=-1,length=values.length,offset2=array.length;while(++index<length){array[offset2+index]=values[index];}return array;}var _arrayPush=arrayPush$1;var isArray$3=Array.isArray;var isArray_1=isArray$3;var arrayPush=_arrayPush,isArray$2=isArray_1;function baseGetAllKeys$1(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray$2(object)?result:arrayPush(result,symbolsFunc(object));}var _baseGetAllKeys=baseGetAllKeys$1;function arrayFilter$1(array,predicate){var index=-1,length=array==null?0:array.length,resIndex=0,result=[];while(++index<length){var value=array[index];if(predicate(value,index,array)){result[resIndex++]=value;}}return result;}var _arrayFilter=arrayFilter$1;function stubArray$1(){return[];}var stubArray_1=stubArray$1;var arrayFilter=_arrayFilter,stubArray=stubArray_1;var objectProto$6=Object.prototype;var propertyIsEnumerable$1=objectProto$6.propertyIsEnumerable;var nativeGetSymbols=Object.getOwnPropertySymbols;var getSymbols$1=!nativeGetSymbols?stubArray:function(object){if(object==null){return[];}object=Object(object);return arrayFilter(nativeGetSymbols(object),function(symbol){return propertyIsEnumerable$1.call(object,symbol);});};var _getSymbols=getSymbols$1;function baseTimes$1(n,iteratee){var index=-1,result=Array(n);while(++index<n){result[index]=iteratee(index);}return result;}var _baseTimes=baseTimes$1;function isObjectLike$4(value){return value!=null&&typeof value=="object";}var isObjectLike_1=isObjectLike$4;var baseGetTag$2=_baseGetTag,isObjectLike$3=isObjectLike_1;var argsTag$2="[object Arguments]";function baseIsArguments$1(value){return isObjectLike$3(value)&&baseGetTag$2(value)==argsTag$2;}var _baseIsArguments=baseIsArguments$1;var baseIsArguments=_baseIsArguments,isObjectLike$2=isObjectLike_1;var objectProto$5=Object.prototype;var hasOwnProperty$4=objectProto$5.hasOwnProperty;var propertyIsEnumerable=objectProto$5.propertyIsEnumerable;var isArguments$1=baseIsArguments(/* @__PURE__ */function(){return arguments;}())?baseIsArguments:function(value){return isObjectLike$2(value)&&hasOwnProperty$4.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee");};var isArguments_1=isArguments$1;var isBuffer$2={exports:{}};function stubFalse(){return false;}var stubFalse_1=stubFalse;isBuffer$2.exports;(function(module2,exports2){var root2=_root,stubFalse2=stubFalse_1;var freeExports=exports2&&!exports2.nodeType&&exports2;var freeModule=freeExports&&true&&module2&&!module2.nodeType&&module2;var moduleExports=freeModule&&freeModule.exports===freeExports;var Buffer2=moduleExports?root2.Buffer:void 0;var nativeIsBuffer=Buffer2?Buffer2.isBuffer:void 0;var isBuffer2=nativeIsBuffer||stubFalse2;module2.exports=isBuffer2;})(isBuffer$2,isBuffer$2.exports);var isBufferExports=isBuffer$2.exports;var MAX_SAFE_INTEGER$1=9007199254740991;var reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex$1(value,length){var type=typeof value;length=length==null?MAX_SAFE_INTEGER$1:length;return!!length&&(type=="number"||type!="symbol"&&reIsUint.test(value))&&value>-1&&value%1==0&&value<length;}var _isIndex=isIndex$1;var MAX_SAFE_INTEGER=9007199254740991;function isLength$2(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER;}var isLength_1=isLength$2;var baseGetTag$1=_baseGetTag,isLength$1=isLength_1,isObjectLike$1=isObjectLike_1;var argsTag$1="[object Arguments]",arrayTag$1="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",mapTag$1="[object Map]",numberTag="[object Number]",objectTag$2="[object Object]",regexpTag="[object RegExp]",setTag$1="[object Set]",stringTag="[object String]",weakMapTag$1="[object WeakMap]";var arrayBufferTag="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]";var typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=true;typedArrayTags[argsTag$1]=typedArrayTags[arrayTag$1]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag$1]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag$1]=typedArrayTags[numberTag]=typedArrayTags[objectTag$2]=typedArrayTags[regexpTag]=typedArrayTags[setTag$1]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag$1]=false;function baseIsTypedArray$1(value){return isObjectLike$1(value)&&isLength$1(value.length)&&!!typedArrayTags[baseGetTag$1(value)];}var _baseIsTypedArray=baseIsTypedArray$1;function baseUnary$1(func){return function(value){return func(value);};}var _baseUnary=baseUnary$1;var _nodeUtil={exports:{}};_nodeUtil.exports;(function(module2,exports2){var freeGlobal2=_freeGlobal;var freeExports=exports2&&!exports2.nodeType&&exports2;var freeModule=freeExports&&true&&module2&&!module2.nodeType&&module2;var moduleExports=freeModule&&freeModule.exports===freeExports;var freeProcess=moduleExports&&freeGlobal2.process;var nodeUtil2=function(){try{var types=freeModule&&freeModule.require&&freeModule.require("util").types;if(types){return types;}return freeProcess&&freeProcess.binding&&freeProcess.binding("util");}catch(e){}}();module2.exports=nodeUtil2;})(_nodeUtil,_nodeUtil.exports);var _nodeUtilExports=_nodeUtil.exports;var baseIsTypedArray=_baseIsTypedArray,baseUnary=_baseUnary,nodeUtil=_nodeUtilExports;var nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;var isTypedArray$2=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;var isTypedArray_1=isTypedArray$2;var baseTimes=_baseTimes,isArguments=isArguments_1,isArray$1=isArray_1,isBuffer$1=isBufferExports,isIndex=_isIndex,isTypedArray$1=isTypedArray_1;var objectProto$4=Object.prototype;var hasOwnProperty$3=objectProto$4.hasOwnProperty;function arrayLikeKeys$1(value,inherited){var isArr=isArray$1(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer$1(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray$1(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?baseTimes(value.length,String):[],length=result.length;for(var key in value){if((inherited||hasOwnProperty$3.call(value,key))&&!(skipIndexes&&(// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
27
27
|
key=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
28
28
|
isBuff&&(key=="offset"||key=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
29
29
|
isType&&(key=="buffer"||key=="byteLength"||key=="byteOffset")||// Skip index properties.
|
|
30
|
-
isIndex(key,length)))){result.push(key);}}return result;}var _arrayLikeKeys=arrayLikeKeys$1;var objectProto$3=Object.prototype;function isPrototype$1(value){var Ctor=value&&value.constructor,proto=typeof Ctor=="function"&&Ctor.prototype||objectProto$3;return value===proto;}var _isPrototype=isPrototype$1;function overArg$1(func,transform){return function(arg){return func(transform(arg));};}var _overArg=overArg$1;var overArg=_overArg;var nativeKeys$1=overArg(Object.keys,Object);var _nativeKeys=nativeKeys$1;var isPrototype=_isPrototype,nativeKeys=_nativeKeys;var objectProto$2=Object.prototype;var hasOwnProperty$2=objectProto$2.hasOwnProperty;function baseKeys$1(object){if(!isPrototype(object)){return nativeKeys(object);}var result=[];for(var key in Object(object)){if(hasOwnProperty$2.call(object,key)&&key!="constructor"){result.push(key);}}return result;}var _baseKeys=baseKeys$1;var isFunction=isFunction_1,isLength=isLength_1;function isArrayLike$1(value){return value!=null&&isLength(value.length)&&!isFunction(value);}var isArrayLike_1=isArrayLike$1;var arrayLikeKeys=_arrayLikeKeys,baseKeys=_baseKeys,isArrayLike=isArrayLike_1;function keys$1(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object);}var keys_1=keys$1;var baseGetAllKeys=_baseGetAllKeys,getSymbols=_getSymbols,keys=keys_1;function getAllKeys$1(object){return baseGetAllKeys(object,keys,getSymbols);}var _getAllKeys=getAllKeys$1;var getAllKeys=_getAllKeys;var COMPARE_PARTIAL_FLAG$1=1;var objectProto$1=Object.prototype;var hasOwnProperty$1=objectProto$1.hasOwnProperty;function equalObjects$1(object,other,bitmask,customizer,equalFunc,stack){var isPartial=bitmask&COMPARE_PARTIAL_FLAG$1,objProps=getAllKeys(object),objLength=objProps.length,othProps=getAllKeys(other),othLength=othProps.length;if(objLength!=othLength&&!isPartial){return false;}var index=objLength;while(index--){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty$1.call(other,key))){return false;}}var objStacked=stack.get(object);var othStacked=stack.get(other);if(objStacked&&othStacked){return objStacked==other&&othStacked==object;}var result=true;stack.set(object,other);stack.set(other,object);var skipCtor=isPartial;while(++index<objLength){key=objProps[index];var objValue=object[key],othValue=other[key];if(customizer){var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);}if(!(compared===void 0?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=false;break;}skipCtor||(skipCtor=key=="constructor");}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;if(objCtor!=othCtor&&"constructor"in object&&"constructor"in other&&!(typeof objCtor=="function"&&objCtor instanceof objCtor&&typeof othCtor=="function"&&othCtor instanceof othCtor)){result=false;}}stack["delete"](object);stack["delete"](other);return result;}var _equalObjects=equalObjects$1;var getNative$3=_getNative,root$3=_root;var DataView$1=getNative$3(root$3,"DataView");var _DataView=DataView$1;var getNative$2=_getNative,root$2=_root;var Promise$2=getNative$2(root$2,"Promise");var _Promise=Promise$2;var getNative$1=_getNative,root$1=_root;var Set$1=getNative$1(root$1,"Set");var _Set=Set$1;var getNative=_getNative,root=_root;var WeakMap$1=getNative(root,"WeakMap");var _WeakMap=WeakMap$1;var DataView=_DataView,Map$1=_Map,Promise$1=_Promise,Set=_Set,WeakMap=_WeakMap,baseGetTag=_baseGetTag,toSource=_toSource;var mapTag="[object Map]",objectTag$1="[object Object]",promiseTag="[object Promise]",setTag="[object Set]",weakMapTag="[object WeakMap]";var dataViewTag="[object DataView]";var dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map$1),promiseCtorString=toSource(Promise$1),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap);var getTag$1=baseGetTag;if(DataView&&getTag$1(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map$1&&getTag$1(new Map$1())!=mapTag||Promise$1&&getTag$1(Promise$1.resolve())!=promiseTag||Set&&getTag$1(new Set())!=setTag||WeakMap&&getTag$1(new WeakMap())!=weakMapTag){getTag$1=function(value){var result=baseGetTag(value),Ctor=result==objectTag$1?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):"";if(ctorString){switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag;}}return result;};}var _getTag=getTag$1;var Stack=_Stack,equalArrays=_equalArrays,equalByTag=_equalByTag,equalObjects=_equalObjects,getTag=_getTag,isArray=isArray_1,isBuffer=isBufferExports,isTypedArray=isTypedArray_1;var COMPARE_PARTIAL_FLAG=1;var argsTag="[object Arguments]",arrayTag="[object Array]",objectTag="[object Object]";var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;function baseIsEqualDeep$1(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?arrayTag:getTag(object),othTag=othIsArr?arrayTag:getTag(other);objTag=objTag==argsTag?objectTag:objTag;othTag=othTag==argsTag?objectTag:othTag;var objIsObj=objTag==objectTag,othIsObj=othTag==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other)){return false;}objIsArr=true;objIsObj=false;}if(isSameTag&&!objIsObj){stack||(stack=new Stack());return objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):equalByTag(object,other,objTag,bitmask,customizer,equalFunc,stack);}if(!(bitmask&COMPARE_PARTIAL_FLAG)){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;stack||(stack=new Stack());return equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack);}}if(!isSameTag){return false;}stack||(stack=new Stack());return equalObjects(object,other,bitmask,customizer,equalFunc,stack);}var _baseIsEqualDeep=baseIsEqualDeep$1;var baseIsEqualDeep=_baseIsEqualDeep,isObjectLike=isObjectLike_1;function baseIsEqual$1(value,other,bitmask,customizer,stack){if(value===other){return true;}if(value==null||other==null||!isObjectLike(value)&&!isObjectLike(other)){return value!==value&&other!==other;}return baseIsEqualDeep(value,other,bitmask,customizer,baseIsEqual$1,stack);}var _baseIsEqual=baseIsEqual$1;var baseIsEqual=_baseIsEqual;function isEqual(value,other){return baseIsEqual(value,other);}var isEqual_1=isEqual;const isEqual$1=/* @__PURE__ */getDefaultExportFromCjs(isEqual_1);function itemEquals(item1,item2,compareAttribute){if(!logic.isSet(item1)||!logic.isSet(item2)){return false;}if(item1===item2){return true;}return item1[compareAttribute]===item2[compareAttribute];}function includeItem(item,itemList,compareAttribute){if(!logic.isSet(item)||!logic.isSet(itemList)){return false;}const itemCompareValue=item[compareAttribute];const match=itemList.find(it=>{return it[compareAttribute]===itemCompareValue;});return Boolean(match);}function handleKeyboardFocusNavigation(key,focusedElement,focusableElements){let tabPosition=focusableElements.indexOf(focusedElement);const keyDown2=["ArrowDown","Down"];const keyUp2=["ArrowUp","Up"];if(keyDown2.includes(key)){tabPosition++;if(tabPosition===focusableElements.length){tabPosition=0;}}if(keyUp2.includes(key)){tabPosition--;if(tabPosition===-1){tabPosition=focusableElements.length-1;}}if(focusableElements[tabPosition]){focusableElements[tabPosition].focus();}}var TableScroll=/* @__PURE__ */(TableScroll2=>{TableScroll2["HORIZONTAL"]="horizontal";TableScroll2["VERTICAL"]="vertical";TableScroll2["BOTH"]="both";TableScroll2["NONE"]="none";return TableScroll2;})(TableScroll||{});const scrollClasses={["horizontal"/* HORIZONTAL */]:["table__scroll","table__scroll--horizontal"],["vertical"/* VERTICAL */]:["table__scroll","table__scroll--vertical"],["both"/* BOTH */]:["table__scroll","table__scroll--horizontal","table__scroll--vertical"],["none"/* NONE */]:[]};function tableScrollClasses(val){return scrollClasses[val];}const defaultOptions={stripClasses:["sr-only"]};function collapseWhitespace(text){return text.replace(/\s+/gm," ").replace(/(^ | $)/g,"");}function intersection(a,b){return a.filter(it=>b.includes(it));}function excludeClass(exclude){return node=>{var _a;if(typeof((_a=node.props)==null?void 0:_a.class)!=="string"){return true;}const classes=node.props.class.split(/\s+/);const matches=intersection(classes,exclude);return matches.length===0;};}function excludeComment(node){return node.type!==vue.Comment;}function getTextContent(children,options){return children.filter(vue.isVNode).filter(excludeComment).filter(excludeClass(options.stripClasses)).map(child=>{if(Array.isArray(child.children)){return getTextContent(child.children,options);}if(typeof child.children==="string"){return child.children;}}).join("");}function renderSlotText(render,props={},options){if(!render){return void 0;}const nodes=render(props);if(nodes.length===0){return void 0;}return collapseWhitespace(getTextContent(nodes,{...defaultOptions,...options}));}function getTextFromScopedSlot(slot){var _renderSlotText;return(_renderSlotText=renderSlotText(slot))!==null&&_renderSlotText!==void 0?_renderSlotText:"";}function dispatchComponentValidityEvent(element,detail){element.dispatchEvent(new CustomEvent("component-validity",{detail,bubbles:true}));}function dispatchComponentUnmountEvent(element){const event=new CustomEvent("component-unmount",{detail:{elementId:element.id},bubbles:true});element.dispatchEvent(event);}function refIsElement(value){return value instanceof Element;}function refIsElementArray(value){return Array.isArray(value)&&value.length>0&&value[0]instanceof Element;}function refIsHTMLElementArray(value){return Array.isArray(value)&&value.length>0&&value[0]instanceof HTMLElement;}function refIsVue(value){return(value==null?void 0:value.$el)!==void 0;}function refIsVueArray(value){return Array.isArray(value)&&value.length>0&&refIsVue(value[0]);}function getElementsFromVueRef(ref){let result=[];if(refIsVueArray(ref)){result=ref.map(vueRef=>vueRef.$el);}else if(refIsElementArray(ref)){result=ref;}else if(logic.isSet(ref)){result=[getElementFromVueRef(ref)];}return result;}function getSortedHTMLElementsFromVueRef(ref){const htmlElements=getHTMLElementsFromVueRef(ref);htmlElements.sort((lhs,rhs)=>{const lhsIndex=parseIntOrDefault(lhs.dataset.refIndex,-Infinity);const rhsIndex=parseIntOrDefault(rhs.dataset.refIndex,-Infinity);return lhsIndex===rhsIndex?0:lhsIndex-rhsIndex;});return htmlElements;}function parseIntOrDefault(value,defaultValue){if(typeof value==="string"){const parsed=parseInt(value,10);if(!isNaN(parsed)){return parsed;}}return defaultValue;}function getHTMLElementsFromVueRef(ref){let result=[];if(isEmptyArray(ref)){result=[];}else if(refIsVueArray(ref)){result=ref.map(vueRef=>vueRef.$el);}else if(refIsHTMLElementArray(ref)){result=[...ref];}else if(logic.isSet(ref)){result=[getHTMLElementFromVueRef(ref)];}return result;}function isEmptyArray(value){return Array.isArray(value)&&value.length===0;}function findElementFromVueRef(ref){if(refIsElement(ref)){return ref;}else if(refIsVue(ref)){return ref.$el;}}function findHTMLElementFromVueRef(ref){const result=findElementFromVueRef(ref);if(result instanceof HTMLElement){return result;}return void 0;}function getElementFromVueRef(ref){const element=findElementFromVueRef(ref);if(!logic.isSet(element)){throw new Error(`Unable to find element from ${ref}.`);}return element;}function getHTMLElementFromVueRef(ref){const element=findElementFromVueRef(ref);if(!logic.isSet(element)){throw new Error(`Unable to find element from ${ref}.`);}if(element instanceof HTMLElement){return element;}throw new Error(`Not instance of HTMLELement ${ref}.`);}function emptyTableRow(textContent=""){function toPrimitive(hint){if(hint==="string"){return textContent;}else{return null;}}function toString(){return textContent;}const proxy=new Proxy(()=>textContent,{apply(){return textContent;},get(_target,prop){switch(prop){case Symbol.toPrimitive:return toPrimitive;case"toString":return toString;case"__v_isRef":return false;default:return proxy;}}});return proxy;}function lazyLoad(fn2){let cache;return()=>{var _cache2;return(_cache2=cache)!==null&&_cache2!==void 0?_cache2:cache=fn2();};}const eventTarget=lazyLoad(()=>new EventTarget());const fn=/* @__PURE__ */new Map();function $emit(type,...args){const event=new CustomEvent(type,{detail:args});eventTarget().dispatchEvent(event);}function $on(type,callback){fn.set(callback,event=>callback(...event.detail));eventTarget().addEventListener(type,fn.get(callback));}function $off(type,callback){eventTarget().removeEventListener(type,fn.get(callback));fn.delete(callback);}const EventBus={$emit,$on,$off};var FKUIConfigButtonOrder=/* @__PURE__ */(FKUIConfigButtonOrder2=>{FKUIConfigButtonOrder2[FKUIConfigButtonOrder2["LEFT_TO_RIGHT"]=0]="LEFT_TO_RIGHT";FKUIConfigButtonOrder2[FKUIConfigButtonOrder2["RIGHT_TO_LEFT"]=1]="RIGHT_TO_LEFT";return FKUIConfigButtonOrder2;})(FKUIConfigButtonOrder||{});let popupContainer=document.body;let production=true;const config={buttonOrder:FKUIConfigButtonOrder.LEFT_TO_RIGHT,teleportTarget:document.body,modalTarget:null,popupTarget:null,get popupContainer(){if(typeof popupContainer==="string"){const element=document.querySelector(popupContainer);if(!element){throw new Error(`Failed to find popupContainer element from selector "${popupContainer}"`);}return element;}else{return popupContainer;}},set popupContainer(value){popupContainer=value;},set production(value){production=value;logic.configLogic.production=value;},get production(){return production;}};function setRunningContext(app){const fkuiContext={appContext:app._context};app.config.globalProperties.$fkui=fkuiContext;}function getRunningContext(callingInstance){if(!callingInstance.$fkui){throw new Error("Application running context is unset. Call `setRunningContext(app)` after `app = createApp(..)`.");}return callingInstance.$fkui;}function getTargetElement(target){if(!target){return document.body;}if(typeof target!=="string"){return target;}const element=document.querySelector(target);if(!element){throw new Error(`mountComponent(..) requires a target element (selector "${target}" returned no element)`);}return element;}function createContainer(options){const{attachTo,attachFirst}=options;const parent=getTargetElement(attachTo);const element=document.createElement("div");if(attachFirst){parent.insertBefore(element,parent.firstChild);}else{parent.appendChild(element);}return element;}function mountComponent(callingInstance,Component,options={}){if(!Component){throw new Error("mountComponent(..) called without a component");}const{attachTo,attachFirst=false,...data}=options;const el=createContainer({attachTo,attachFirst});const app=vue.createApp(Component,data);const fkuiContext=getRunningContext(callingInstance);if(fkuiContext){Object.assign(app._context,fkuiContext.appContext);}app.mount(el);const unmount=app.unmount;app.unmount=()=>{unmount.call(app);if(el.parentNode){el.parentNode.removeChild(el);}};return app;}function unpackPayload(event,src){const defaultPayload={};const{reason=event,data:rawData}=src!==null&&src!==void 0?src:defaultPayload;const data=rawData;return{reason,data};}function openModal(callingInstance,Component,options){var _config$modalTarget;if(typeof options==="string"){return openModal(callingInstance,Component,{props:{content:options}});}const defaultOptions2={attachTo:(_config$modalTarget=config.modalTarget)!==null&&_config$modalTarget!==void 0?_config$modalTarget:config.teleportTarget,props:{}};const{attachTo,props}={...defaultOptions2,...options};return new Promise((resolve,reject)=>{const terminate=(event,payload)=>{try{const result=unpackPayload(event,payload);app.unmount();resolve(result);}catch(err){console.error(err);reject(err);}};const app=mountComponent(callingInstance,Component,{attachTo,isOpen:true,onClose(data){terminate("close",data);},...props});});}async function formModal(callingInstance,Component,options){var _ref;const props={size:(_ref=options==null?void 0:options.size)!==null&&_ref!==void 0?_ref:"",beforeSubmit:options==null?void 0:options.beforeSubmit,...(options==null?void 0:options.props)};const result=await openModal(callingInstance,Component,{props});if(result.reason==="submit"){return result.data;}else{return Promise.reject("cancel");}}var ModalReason=/* @__PURE__ */(ModalReason2=>{ModalReason2["CONFIRM"]="confirm";ModalReason2["DISMISS"]="dismiss";return ModalReason2;})(ModalReason||{});const sizes=["","small","medium","large","fullscreen","fullwidth"];function sizeClass(size){if(!sizes.includes(size)){throw new Error(`"${size}" is not a valid size`);}if(!size){return[];}else if(size==="fullscreen"){return[`modal__dialog-container--fullwidth`];}else{return[`modal__dialog-container--${size}`];}}function focusElement(element,container){if(elementIsRadioButton(element)){focusRadioButtonGroup(element,container);}else{logic.focus(element);}}function focusRadioButtonGroup(element,container){const radioGroupInputs=container.querySelectorAll(`input[type="radio"][name="${element.name}"]`);const checkedRadioButton=Array.from(radioGroupInputs).find(inputEl=>inputEl.checked);if(checkedRadioButton){logic.focus(checkedRadioButton);}else{logic.focus(element);}}function elementIsRadioButton(element){return isHTMLInputElement(element)&&element.type==="radio";}function isHTMLInputElement(element){return element instanceof HTMLInputElement;}const _sfc_main$1b=vue.defineComponent({name:"FModal",components:{FIcon},mixins:[TranslationMixin],inheritAttrs:true,props:{/**
|
|
30
|
+
isIndex(key,length)))){result.push(key);}}return result;}var _arrayLikeKeys=arrayLikeKeys$1;var objectProto$3=Object.prototype;function isPrototype$1(value){var Ctor=value&&value.constructor,proto=typeof Ctor=="function"&&Ctor.prototype||objectProto$3;return value===proto;}var _isPrototype=isPrototype$1;function overArg$1(func,transform){return function(arg){return func(transform(arg));};}var _overArg=overArg$1;var overArg=_overArg;var nativeKeys$1=overArg(Object.keys,Object);var _nativeKeys=nativeKeys$1;var isPrototype=_isPrototype,nativeKeys=_nativeKeys;var objectProto$2=Object.prototype;var hasOwnProperty$2=objectProto$2.hasOwnProperty;function baseKeys$1(object){if(!isPrototype(object)){return nativeKeys(object);}var result=[];for(var key in Object(object)){if(hasOwnProperty$2.call(object,key)&&key!="constructor"){result.push(key);}}return result;}var _baseKeys=baseKeys$1;var isFunction=isFunction_1,isLength=isLength_1;function isArrayLike$1(value){return value!=null&&isLength(value.length)&&!isFunction(value);}var isArrayLike_1=isArrayLike$1;var arrayLikeKeys=_arrayLikeKeys,baseKeys=_baseKeys,isArrayLike=isArrayLike_1;function keys$1(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object);}var keys_1=keys$1;var baseGetAllKeys=_baseGetAllKeys,getSymbols=_getSymbols,keys=keys_1;function getAllKeys$1(object){return baseGetAllKeys(object,keys,getSymbols);}var _getAllKeys=getAllKeys$1;var getAllKeys=_getAllKeys;var COMPARE_PARTIAL_FLAG$1=1;var objectProto$1=Object.prototype;var hasOwnProperty$1=objectProto$1.hasOwnProperty;function equalObjects$1(object,other,bitmask,customizer,equalFunc,stack){var isPartial=bitmask&COMPARE_PARTIAL_FLAG$1,objProps=getAllKeys(object),objLength=objProps.length,othProps=getAllKeys(other),othLength=othProps.length;if(objLength!=othLength&&!isPartial){return false;}var index=objLength;while(index--){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty$1.call(other,key))){return false;}}var objStacked=stack.get(object);var othStacked=stack.get(other);if(objStacked&&othStacked){return objStacked==other&&othStacked==object;}var result=true;stack.set(object,other);stack.set(other,object);var skipCtor=isPartial;while(++index<objLength){key=objProps[index];var objValue=object[key],othValue=other[key];if(customizer){var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);}if(!(compared===void 0?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=false;break;}skipCtor||(skipCtor=key=="constructor");}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;if(objCtor!=othCtor&&"constructor"in object&&"constructor"in other&&!(typeof objCtor=="function"&&objCtor instanceof objCtor&&typeof othCtor=="function"&&othCtor instanceof othCtor)){result=false;}}stack["delete"](object);stack["delete"](other);return result;}var _equalObjects=equalObjects$1;var getNative$3=_getNative,root$3=_root;var DataView$1=getNative$3(root$3,"DataView");var _DataView=DataView$1;var getNative$2=_getNative,root$2=_root;var Promise$2=getNative$2(root$2,"Promise");var _Promise=Promise$2;var getNative$1=_getNative,root$1=_root;var Set$1=getNative$1(root$1,"Set");var _Set=Set$1;var getNative=_getNative,root=_root;var WeakMap$1=getNative(root,"WeakMap");var _WeakMap=WeakMap$1;var DataView=_DataView,Map$1=_Map,Promise$1=_Promise,Set=_Set,WeakMap=_WeakMap,baseGetTag=_baseGetTag,toSource=_toSource;var mapTag="[object Map]",objectTag$1="[object Object]",promiseTag="[object Promise]",setTag="[object Set]",weakMapTag="[object WeakMap]";var dataViewTag="[object DataView]";var dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map$1),promiseCtorString=toSource(Promise$1),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap);var getTag$1=baseGetTag;if(DataView&&getTag$1(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map$1&&getTag$1(new Map$1())!=mapTag||Promise$1&&getTag$1(Promise$1.resolve())!=promiseTag||Set&&getTag$1(new Set())!=setTag||WeakMap&&getTag$1(new WeakMap())!=weakMapTag){getTag$1=function(value){var result=baseGetTag(value),Ctor=result==objectTag$1?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):"";if(ctorString){switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag;}}return result;};}var _getTag=getTag$1;var Stack=_Stack,equalArrays=_equalArrays,equalByTag=_equalByTag,equalObjects=_equalObjects,getTag=_getTag,isArray=isArray_1,isBuffer=isBufferExports,isTypedArray=isTypedArray_1;var COMPARE_PARTIAL_FLAG=1;var argsTag="[object Arguments]",arrayTag="[object Array]",objectTag="[object Object]";var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;function baseIsEqualDeep$1(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?arrayTag:getTag(object),othTag=othIsArr?arrayTag:getTag(other);objTag=objTag==argsTag?objectTag:objTag;othTag=othTag==argsTag?objectTag:othTag;var objIsObj=objTag==objectTag,othIsObj=othTag==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other)){return false;}objIsArr=true;objIsObj=false;}if(isSameTag&&!objIsObj){stack||(stack=new Stack());return objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):equalByTag(object,other,objTag,bitmask,customizer,equalFunc,stack);}if(!(bitmask&COMPARE_PARTIAL_FLAG)){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;stack||(stack=new Stack());return equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack);}}if(!isSameTag){return false;}stack||(stack=new Stack());return equalObjects(object,other,bitmask,customizer,equalFunc,stack);}var _baseIsEqualDeep=baseIsEqualDeep$1;var baseIsEqualDeep=_baseIsEqualDeep,isObjectLike=isObjectLike_1;function baseIsEqual$1(value,other,bitmask,customizer,stack){if(value===other){return true;}if(value==null||other==null||!isObjectLike(value)&&!isObjectLike(other)){return value!==value&&other!==other;}return baseIsEqualDeep(value,other,bitmask,customizer,baseIsEqual$1,stack);}var _baseIsEqual=baseIsEqual$1;var baseIsEqual=_baseIsEqual;function isEqual(value,other){return baseIsEqual(value,other);}var isEqual_1=isEqual;const isEqual$1=/* @__PURE__ */getDefaultExportFromCjs(isEqual_1);function itemEquals(item1,item2,compareAttribute){if(!logic.isSet(item1)||!logic.isSet(item2)){return false;}if(item1===item2){return true;}return item1[compareAttribute]===item2[compareAttribute];}function includeItem(item,itemList,compareAttribute){if(!logic.isSet(item)||!logic.isSet(itemList)){return false;}const itemCompareValue=item[compareAttribute];const match=itemList.find(it=>{return it[compareAttribute]===itemCompareValue;});return Boolean(match);}function handleKeyboardFocusNavigation(key,focusedElement,focusableElements){let tabPosition=focusableElements.indexOf(focusedElement);const keyDown2=["ArrowDown","Down"];const keyUp2=["ArrowUp","Up"];if(keyDown2.includes(key)){tabPosition++;if(tabPosition===focusableElements.length){tabPosition=0;}}if(keyUp2.includes(key)){tabPosition--;if(tabPosition===-1){tabPosition=focusableElements.length-1;}}if(focusableElements[tabPosition]){focusableElements[tabPosition].focus();}}var TableScroll=/* @__PURE__ */(TableScroll2=>{TableScroll2["HORIZONTAL"]="horizontal";TableScroll2["VERTICAL"]="vertical";TableScroll2["BOTH"]="both";TableScroll2["NONE"]="none";return TableScroll2;})(TableScroll||{});const scrollClasses={["horizontal"/* HORIZONTAL */]:["table__scroll","table__scroll--horizontal"],["vertical"/* VERTICAL */]:["table__scroll","table__scroll--vertical"],["both"/* BOTH */]:["table__scroll","table__scroll--horizontal","table__scroll--vertical"],["none"/* NONE */]:[]};function tableScrollClasses(val){return scrollClasses[val];}const defaultOptions={stripClasses:["sr-only"]};function collapseWhitespace(text){return text.replace(/\s+/gm," ").replace(/(^ | $)/g,"");}function intersection(a,b){return a.filter(it=>b.includes(it));}function excludeClass(exclude){return node=>{var _a;if(typeof((_a=node.props)==null?void 0:_a.class)!=="string"){return true;}const classes=node.props.class.split(/\s+/);const matches=intersection(classes,exclude);return matches.length===0;};}function excludeComment(node){return node.type!==vue.Comment;}function getTextContent(children,options){return children.filter(vue.isVNode).filter(excludeComment).filter(excludeClass(options.stripClasses)).map(child=>{if(Array.isArray(child.children)){return getTextContent(child.children,options);}if(typeof child.children==="string"){return child.children;}}).join("");}function renderSlotText(render,props={},options){if(!render){return void 0;}const nodes=render(props);if(nodes.length===0){return void 0;}return collapseWhitespace(getTextContent(nodes,{...defaultOptions,...options}));}function getTextFromScopedSlot(slot){var _renderSlotText;return(_renderSlotText=renderSlotText(slot))!==null&&_renderSlotText!==void 0?_renderSlotText:"";}function dispatchComponentValidityEvent(element,detail){element.dispatchEvent(new CustomEvent("component-validity",{detail,bubbles:true}));}function dispatchComponentUnmountEvent(element){const event=new CustomEvent("component-unmount",{detail:{elementId:element.id},bubbles:true});element.dispatchEvent(event);}function refIsElement(value){return value instanceof Element;}function refIsElementArray(value){return Array.isArray(value)&&value.length>0&&value[0]instanceof Element;}function refIsHTMLElementArray(value){return Array.isArray(value)&&value.length>0&&value[0]instanceof HTMLElement;}function refIsVue(value){return(value==null?void 0:value.$el)!==void 0;}function refIsVueArray(value){return Array.isArray(value)&&value.length>0&&refIsVue(value[0]);}function getElementsFromVueRef(ref){let result=[];if(refIsVueArray(ref)){result=ref.map(vueRef=>vueRef.$el);}else if(refIsElementArray(ref)){result=ref;}else if(logic.isSet(ref)){result=[getElementFromVueRef(ref)];}return result;}function getSortedHTMLElementsFromVueRef(ref){const htmlElements=getHTMLElementsFromVueRef(ref);htmlElements.sort((lhs,rhs)=>{const lhsIndex=parseIntOrDefault(lhs.dataset.refIndex,-Infinity);const rhsIndex=parseIntOrDefault(rhs.dataset.refIndex,-Infinity);return lhsIndex===rhsIndex?0:lhsIndex-rhsIndex;});return htmlElements;}function parseIntOrDefault(value,defaultValue){if(typeof value==="string"){const parsed=parseInt(value,10);if(!isNaN(parsed)){return parsed;}}return defaultValue;}function getHTMLElementsFromVueRef(ref){let result=[];if(isEmptyArray(ref)){result=[];}else if(refIsVueArray(ref)){result=ref.map(vueRef=>vueRef.$el);}else if(refIsHTMLElementArray(ref)){result=[...ref];}else if(logic.isSet(ref)){result=[getHTMLElementFromVueRef(ref)];}return result;}function isEmptyArray(value){return Array.isArray(value)&&value.length===0;}function findElementFromVueRef(ref){if(refIsElement(ref)){return ref;}else if(refIsVue(ref)){return ref.$el;}}function findHTMLElementFromVueRef(ref){const result=findElementFromVueRef(ref);if(result instanceof HTMLElement){return result;}return void 0;}function getElementFromVueRef(ref){const element=findElementFromVueRef(ref);if(!logic.isSet(element)){throw new Error(`Unable to find element from ${ref}.`);}return element;}function getHTMLElementFromVueRef(ref){const element=findElementFromVueRef(ref);if(!logic.isSet(element)){throw new Error(`Unable to find element from ${ref}.`);}if(element instanceof HTMLElement){return element;}throw new Error(`Not instance of HTMLELement ${ref}.`);}function lazyLoad(fn2){let cache;return()=>{var _cache2;return(_cache2=cache)!==null&&_cache2!==void 0?_cache2:cache=fn2();};}const eventTarget=lazyLoad(()=>new EventTarget());const fn=/* @__PURE__ */new Map();function $emit(type,...args){const event=new CustomEvent(type,{detail:args});eventTarget().dispatchEvent(event);}function $on(type,callback){fn.set(callback,event=>callback(...event.detail));eventTarget().addEventListener(type,fn.get(callback));}function $off(type,callback){eventTarget().removeEventListener(type,fn.get(callback));fn.delete(callback);}const EventBus={$emit,$on,$off};var FKUIConfigButtonOrder=/* @__PURE__ */(FKUIConfigButtonOrder2=>{FKUIConfigButtonOrder2[FKUIConfigButtonOrder2["LEFT_TO_RIGHT"]=0]="LEFT_TO_RIGHT";FKUIConfigButtonOrder2[FKUIConfigButtonOrder2["RIGHT_TO_LEFT"]=1]="RIGHT_TO_LEFT";return FKUIConfigButtonOrder2;})(FKUIConfigButtonOrder||{});let popupContainer=document.body;let production=true;const config={buttonOrder:FKUIConfigButtonOrder.LEFT_TO_RIGHT,teleportTarget:document.body,modalTarget:null,popupTarget:null,get popupContainer(){if(typeof popupContainer==="string"){const element=document.querySelector(popupContainer);if(!element){throw new Error(`Failed to find popupContainer element from selector "${popupContainer}"`);}return element;}else{return popupContainer;}},set popupContainer(value){popupContainer=value;},set production(value){production=value;logic.configLogic.production=value;},get production(){return production;}};function setRunningContext(app){const fkuiContext={appContext:app._context};app.config.globalProperties.$fkui=fkuiContext;}function getRunningContext(callingInstance){if(!callingInstance.$fkui){throw new Error("Application running context is unset. Call `setRunningContext(app)` after `app = createApp(..)`.");}return callingInstance.$fkui;}function getTargetElement(target){if(!target){return document.body;}if(typeof target!=="string"){return target;}const element=document.querySelector(target);if(!element){throw new Error(`mountComponent(..) requires a target element (selector "${target}" returned no element)`);}return element;}function createContainer(options){const{attachTo,attachFirst}=options;const parent=getTargetElement(attachTo);const element=document.createElement("div");if(attachFirst){parent.insertBefore(element,parent.firstChild);}else{parent.appendChild(element);}return element;}function mountComponent(callingInstance,Component,options={}){if(!Component){throw new Error("mountComponent(..) called without a component");}const{attachTo,attachFirst=false,...data}=options;const el=createContainer({attachTo,attachFirst});const app=vue.createApp(Component,data);const fkuiContext=getRunningContext(callingInstance);if(fkuiContext){Object.assign(app._context,fkuiContext.appContext);}app.mount(el);const unmount=app.unmount;app.unmount=()=>{unmount.call(app);if(el.parentNode){el.parentNode.removeChild(el);}};return app;}function unpackPayload(event,src){const defaultPayload={};const{reason=event,data:rawData}=src!==null&&src!==void 0?src:defaultPayload;const data=rawData;return{reason,data};}function openModal(callingInstance,Component,options){var _config$modalTarget;if(typeof options==="string"){return openModal(callingInstance,Component,{props:{content:options}});}const defaultOptions2={attachTo:(_config$modalTarget=config.modalTarget)!==null&&_config$modalTarget!==void 0?_config$modalTarget:config.teleportTarget,props:{}};const{attachTo,props}={...defaultOptions2,...options};return new Promise((resolve,reject)=>{const terminate=(event,payload)=>{try{const result=unpackPayload(event,payload);app.unmount();resolve(result);}catch(err){console.error(err);reject(err);}};const app=mountComponent(callingInstance,Component,{attachTo,isOpen:true,onClose(data){terminate("close",data);},...props});});}async function formModal(callingInstance,Component,options){var _ref;const props={size:(_ref=options==null?void 0:options.size)!==null&&_ref!==void 0?_ref:"",beforeSubmit:options==null?void 0:options.beforeSubmit,...(options==null?void 0:options.props)};const result=await openModal(callingInstance,Component,{props});if(result.reason==="submit"){return result.data;}else{return Promise.reject("cancel");}}var ModalReason=/* @__PURE__ */(ModalReason2=>{ModalReason2["CONFIRM"]="confirm";ModalReason2["DISMISS"]="dismiss";return ModalReason2;})(ModalReason||{});const sizes=["","small","medium","large","fullscreen","fullwidth"];function sizeClass(size){if(!sizes.includes(size)){throw new Error(`"${size}" is not a valid size`);}if(!size){return[];}else if(size==="fullscreen"){return[`modal__dialog-container--fullwidth`];}else{return[`modal__dialog-container--${size}`];}}function focusElement(element,container){if(elementIsRadioButton(element)){focusRadioButtonGroup(element,container);}else{logic.focus(element);}}function focusRadioButtonGroup(element,container){const radioGroupInputs=container.querySelectorAll(`input[type="radio"][name="${element.name}"]`);const checkedRadioButton=Array.from(radioGroupInputs).find(inputEl=>inputEl.checked);if(checkedRadioButton){logic.focus(checkedRadioButton);}else{logic.focus(element);}}function elementIsRadioButton(element){return isHTMLInputElement(element)&&element.type==="radio";}function isHTMLInputElement(element){return element instanceof HTMLInputElement;}const _sfc_main$1b=vue.defineComponent({name:"FModal",components:{FIcon},mixins:[TranslationMixin],inheritAttrs:true,props:{/**
|
|
31
31
|
* The id for the root element id attribute.
|
|
32
32
|
* If the prop is not set a random value will be generated.
|
|
33
33
|
*/id:{type:String,required:false,default:()=>logic.ElementIdService.generateElementId()},/**
|
|
@@ -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$
|
|
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$S=["id"];const _hoisted_2$E={class:"modal__backdrop"};const _hoisted_3$w={class:"modal__inner-container"};const _hoisted_4$r={class:"modal__dialog"};const _hoisted_5$l={class:"modal__dialog-inner"};const _hoisted_6$f={class:"modal__header"};const _hoisted_7$d={key:0,ref:"modalTitle",class:"modal__title",tabindex:"-1"};const _hoisted_8$9={ref:"modalContent",class:"modal__content",tabindex:"-1"};const _hoisted_9$6={class:"modal__footer"};const _hoisted_10$6={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$E,[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$w,[vue.createElementVNode("div",{ref:"modalDialogContainer",class:vue.normalizeClass(["modal__dialog-container",_ctx.containerClasses])},[vue.createElementVNode("div",_hoisted_4$r,[vue.createElementVNode("div",_hoisted_5$l,[vue.createElementVNode("div",_hoisted_6$f,[vue.createElementVNode("div",{tabindex:"0",onFocus:_cache[0]||(_cache[0]=(...args)=>_ctx.onFocusFirst&&_ctx.onFocusFirst(...args))},null,32/* NEED_HYDRATION */),_cache[4]||(_cache[4]=vue.createTextVNode()),_ctx.hasHeaderSlot?(vue.openBlock(),vue.createElementBlock("h1",_hoisted_7$d,[vue.renderSlot(_ctx.$slots,"header")],512/* NEED_PATCH */)):vue.createCommentVNode("v-if",true)]),_cache[5]||(_cache[5]=vue.createTextVNode()),vue.createElementVNode("div",_hoisted_8$9,[vue.renderSlot(_ctx.$slots,"content")],512/* NEED_PATCH */),_cache[6]||(_cache[6]=vue.createTextVNode()),vue.createElementVNode("div",_hoisted_9$6,[vue.renderSlot(_ctx.$slots,"footer")])]),_cache[9]||(_cache[9]=vue.createTextVNode()),vue.createElementVNode("div",_hoisted_10$6,[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 */),_cache[7]||(_cache[7]=vue.createTextVNode()),vue.createVNode(_component_f_icon,{name:"close"})],8,_hoisted_11$3),_cache[8]||(_cache[8]=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$S)):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
|
|
@@ -61,7 +61,7 @@ isIndex(key,length)))){result.push(key);}}return result;}var _arrayLikeKeys=arra
|
|
|
61
61
|
* The aria-label attribute text for the top right close button.
|
|
62
62
|
*/ariaCloseText:{type:String,required:false,default:void 0},/**
|
|
63
63
|
* List of buttons
|
|
64
|
-
*/buttons:{type:Array,required:false,default:()=>{return defaultButtons;}}},emits:["close",...defaultButtons.map(it=>{var _it$event2;return(_it$event2=it.event)!==null&&_it$event2!==void 0?_it$event2:"";})],computed:{preparedButtons(){return prepareButtonList(this.buttons);}},methods:{onClose(){this.$emit("close",{reason:"close"});},onClick(button){this.$emit(button.event);this.$emit("close",{reason:button.reason});}}});const _hoisted_1$
|
|
64
|
+
*/buttons:{type:Array,required:false,default:()=>{return defaultButtons;}}},emits:["close",...defaultButtons.map(it=>{var _it$event2;return(_it$event2=it.event)!==null&&_it$event2!==void 0?_it$event2:"";})],computed:{preparedButtons(){return prepareButtonList(this.buttons);}},methods:{onClose(){this.$emit("close",{reason:"close"});},onClick(button){this.$emit(button.event);this.$emit("close",{reason:button.reason});}}});const _hoisted_1$R={class:"button-group"};const _hoisted_2$D=["onClick"];const _hoisted_3$v={key:0,class:"sr-only"};function _sfc_render$10(_ctx,_cache,$props,$setup,$data,$options){const _component_f_modal=vue.resolveComponent("f-modal");return vue.openBlock(),vue.createBlock(_component_f_modal,{fullscreen:_ctx.fullscreen,"is-open":_ctx.isOpen,"aria-close-text":_ctx.ariaCloseText,type:"warning",size:_ctx.size,onClose:_ctx.onClose},{header:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"heading",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.heading),1/* TEXT */)])]),content:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"content",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.content),1/* TEXT */)])]),footer:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$R,[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.preparedButtons,button=>{return vue.openBlock(),vue.createElementBlock("button",{key:button.label,type:"button",class:vue.normalizeClass([button.classlist,"button-group__item"]),onClick:$event=>_ctx.onClick(button)},[vue.createElementVNode("span",null,vue.toDisplayString(button.label),1/* TEXT */),_cache[0]||(_cache[0]=vue.createTextVNode()),button.screenreader?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$v," "+vue.toDisplayString(button.screenreader),1/* TEXT */)):vue.createCommentVNode("v-if",true)],10,_hoisted_2$D);}),128/* KEYED_FRAGMENT */))])]),_:3/* FORWARDED */},8,["fullscreen","is-open","aria-close-text","size","onClose"]);}const FConfirmModal=/* @__PURE__ */_export_sfc(_sfc_main$1a,[["render",_sfc_render$10]]);const GAP=["1x","2x","3x","4x","5x","6x","7x","8x"];const ALIGNMENT=["top","center","bottom"];const FLOAT=["left","center","right"];const _sfc_main$19=vue.defineComponent({name:"IFlex",inheritAttrs:true,props:{/**
|
|
65
65
|
* Set gap (gutter) between items.
|
|
66
66
|
*
|
|
67
67
|
* Must be one of:
|
|
@@ -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$
|
|
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$Q={class:"error-list"};const _hoisted_2$C={key:0};const _hoisted_3$u={class:"error-list__list error-list--list-style-none"};const _hoisted_4$q=["onClick"];const _hoisted_5$k={class:"error-list__link"};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$Q,[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),_cache[6]||(_cache[6]=vue.createTextVNode()),_ctx.hasTitleSlot?(vue.openBlock(),vue.createBlock(_component_i_flex_item,{key:1,shrink:""},{default:vue.withCtx(()=>_cache[0]||(_cache[0]=[vue.createTextVNode(" ")])),_:1/* STABLE */})):vue.createCommentVNode("v-if",true),_cache[7]||(_cache[7]=vue.createTextVNode()),vue.createVNode(_component_i_flex_item,{grow:""},{default:vue.withCtx(()=>[_ctx.hasTitleSlot?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$C,[vue.renderSlot(_ctx.$slots,"title")])):vue.createCommentVNode("v-if",true),_cache[5]||(_cache[5]=vue.createTextVNode()),vue.createElementVNode("ul",_hoisted_3$u,[(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},[_cache[1]||(_cache[1]=vue.createElementVNode("span",{class:"error-list__bullet","aria-hidden":"true"},null,-1/* HOISTED */)),_cache[2]||(_cache[2]=vue.createTextVNode()),vue.createElementVNode("span",_hoisted_5$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$q)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[_ctx.bullets?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[_cache[3]||(_cache[3]=vue.createElementVNode("span",{class:"error-list__bullet","aria-hidden":"true"},null,-1/* HOISTED */)),_cache[4]||(_cache[4]=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
|
|
@@ -140,7 +140,7 @@ isIndex(key,length)))){result.push(key);}}return result;}var _arrayLikeKeys=arra
|
|
|
140
140
|
* Display bullets in the error list component.
|
|
141
141
|
*/errorListBullets:{type:Boolean,required:false,default:true},/**
|
|
142
142
|
*Optional callback function to the error list component for performing actions before navigation.
|
|
143
|
-
*/errorListBeforeNavigate:{type:Function,required:false,default(){return()=>{};}}},emits:["submit"],data(){return{validity:{isValid:true,componentsWithError:[],componentCount:0},submitted:false};},computed:{groupKey(){return`${this.id}-group`;},errors(){return this.validity.componentsWithError.map(c=>({id:c.elementId,focusElementId:c.focusElementId,title:c.errorMessage}));},displayErrors(){return this.useErrorList&&this.submitted&&this.errors.length>0;}},methods:{async hasFormErrors(){logic.ValidationService.setSubmitted(this.id);await logic.ValidationService.validateAllElements(this.id);await this.$nextTick();await new Promise(resolve=>window.setTimeout(resolve,0));if(this.validity.isValid){return false;}if(this.useErrorList){logic.focus(this.$refs.errors);}else{const firstError=this.validity.componentsWithError[0];const element=document.getElementById(firstError.focusElementId);logic.focus(element);}return true;},async onSubmit(event){this.submitted=true;const beforeValidation=this.beforeValidation?await this.beforeValidation():void 0;if(beforeValidation===FValidationFormAction.CANCEL){return;}if(await this.hasFormErrors()){return;}const beforeAction=this.beforeSubmit?await this.beforeSubmit():void 0;if(beforeAction===FValidationFormAction.CANCEL){return;}if(await this.hasFormErrors()){return;}this.$emit("submit",event);}}});const _hoisted_1$
|
|
143
|
+
*/errorListBeforeNavigate:{type:Function,required:false,default(){return()=>{};}}},emits:["submit"],data(){return{validity:{isValid:true,componentsWithError:[],componentCount:0},submitted:false};},computed:{groupKey(){return`${this.id}-group`;},errors(){return this.validity.componentsWithError.map(c=>({id:c.elementId,focusElementId:c.focusElementId,title:c.errorMessage}));},displayErrors(){return this.useErrorList&&this.submitted&&this.errors.length>0;}},methods:{async hasFormErrors(){logic.ValidationService.setSubmitted(this.id);await logic.ValidationService.validateAllElements(this.id);await this.$nextTick();await new Promise(resolve=>window.setTimeout(resolve,0));if(this.validity.isValid){return false;}if(this.useErrorList){logic.focus(this.$refs.errors);}else{const firstError=this.validity.componentsWithError[0];const element=document.getElementById(firstError.focusElementId);logic.focus(element);}return true;},async onSubmit(event){this.submitted=true;const beforeValidation=this.beforeValidation?await this.beforeValidation():void 0;if(beforeValidation===FValidationFormAction.CANCEL){return;}if(await this.hasFormErrors()){return;}const beforeAction=this.beforeSubmit?await this.beforeSubmit():void 0;if(beforeAction===FValidationFormAction.CANCEL){return;}if(await this.hasFormErrors()){return;}this.$emit("submit",event);}}});const _hoisted_1$P=["id"];const _hoisted_2$B={key:0,ref:"errors",tabindex:"-1",role:"group"};function _sfc_render$X(_ctx,_cache,$props,$setup,$data,$options){const _component_f_error_list=vue.resolveComponent("f-error-list");const _component_f_validation_group=vue.resolveComponent("f-validation-group");return vue.openBlock(),vue.createBlock(_component_f_validation_group,{key:_ctx.groupKey,modelValue:_ctx.validity,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>_ctx.validity=$event),"stop-propagation":true},{default:vue.withCtx(()=>[vue.createElementVNode("form",vue.mergeProps({id:_ctx.id},_ctx.$attrs,{novalidate:"",autocomplete:"off",onSubmit:_cache[0]||(_cache[0]=vue.withModifiers((...args)=>_ctx.onSubmit&&_ctx.onSubmit(...args),["prevent"]))}),[_ctx.displayErrors?(vue.openBlock(),vue.createElementBlock("nav",_hoisted_2$B,[vue.createVNode(_component_f_error_list,{items:_ctx.errors,bullets:_ctx.errorListBullets,"before-navigate":_ctx.errorListBeforeNavigate},{title:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"error-message")]),_:3/* FORWARDED */},8,["items","bullets","before-navigate"])],512/* NEED_PATCH */)):vue.createCommentVNode("v-if",true),_cache[2]||(_cache[2]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"default")],16,_hoisted_1$P)]),_:3/* FORWARDED */},8,["modelValue"]);}const FValidationForm=/* @__PURE__ */_export_sfc(_sfc_main$15,[["render",_sfc_render$X]]);const _sfc_main$14=vue.defineComponent({name:"FFormModal",components:{FModal,FValidationForm},mixins:[TranslationMixin],inheritAttrs:true,props:{/**
|
|
144
144
|
* Enable fullscreen mode in mobile.
|
|
145
145
|
*/fullscreen:{type:Boolean,required:false,default:true},/**
|
|
146
146
|
* If the modal is open.
|
|
@@ -164,18 +164,18 @@ isIndex(key,length)))){result.push(key);}}return result;}var _arrayLikeKeys=arra
|
|
|
164
164
|
*/beforeSubmit:{type:Function,required:false,default(){}},/**
|
|
165
165
|
* If given, this function is called before the form data is validated and the [[submit]] event is emitted.
|
|
166
166
|
* See <f-validation-form> `beforeValidation` props for more info.
|
|
167
|
-
*/beforeValidation:{type:Function,required:false,default(){}},buttons:{type:Array,required:false,default:()=>[{label:logic.TranslationService.provider.translate("fkui.form-modal.button.submit.text","Spara"),event:"submit",type:"primary",submitButton:true},{label:logic.TranslationService.provider.translate("fkui.form-modal.button.cancel.text","Avbryt"),event:"dismiss",type:"secondary"}]}},emits:["cancel","close","submit"],data(){return{};},computed:{preparedButtons(){return prepareButtonList(this.buttons,FKUIConfigButtonOrder.LEFT_TO_RIGHT);},hasDeprecatedSlots(){return hasSlot(this,"cancel-button-text")||hasSlot(this,"submit-button-text");}},methods:{onClose(){logic.ValidationService.resetState(this.$el);this.$emit("cancel");this.$emit("close",{reason:"close"});},async onSubmit(){logic.ValidationService.resetState(this.$el);this.$emit("submit",{data:this.value});this.$emit("close",{reason:"submit",data:this.value});},onCancel(){logic.ValidationService.resetState(this.$el);this.$emit("cancel");this.$emit("close",{reason:"close"});}}});const _hoisted_1$P={class:"button-group"};const _hoisted_2$B=["type","form","onClick"];const _hoisted_3$w={key:0,class:"sr-only"};const _hoisted_4$r=["form"];function _sfc_render$W(_ctx,_cache,$props,$setup,$data,$options){const _component_f_validation_form=vue.resolveComponent("f-validation-form");const _component_f_modal=vue.resolveComponent("f-modal");return vue.openBlock(),vue.createBlock(_component_f_modal,{"data-test":_ctx.dataTest,fullscreen:_ctx.fullscreen,"is-open":_ctx.isOpen,size:_ctx.size,"aria-close-text":_ctx.ariaCloseText,onClose:_ctx.onClose},{header:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"header")]),content:vue.withCtx(()=>[vue.createElementVNode("div",null,[vue.renderSlot(_ctx.$slots,"default")]),vue.createTextVNode(),vue.createVNode(_component_f_validation_form,{id:_ctx.formId,"before-submit":_ctx.beforeSubmit,"before-validation":_ctx.beforeValidation,"use-error-list":_ctx.useErrorList,onSubmit:_ctx.onSubmit,onCancel:_ctx.onCancel},{"error-message":vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"error-message")]),default:vue.withCtx(()=>[vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"input-text-fields")]),_:3/* FORWARDED */},8,["id","before-submit","before-validation","use-error-list","onSubmit","onCancel"])]),footer:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$P,[!_ctx.hasDeprecatedSlots?(vue.openBlock(true),vue.createElementBlock(vue.Fragment,{key:0},vue.renderList(_ctx.preparedButtons,button=>{return vue.openBlock(),vue.createElementBlock("button",{key:button.label,type:button.buttonType,class:vue.normalizeClass([button.classlist,"button-group__item"]),form:button.buttonType==="submit"?_ctx.formId:void 0,onClick:$event=>button.buttonType==="button"?_ctx.onCancel():false},[vue.createElementVNode("span",null,vue.toDisplayString(button.label),1/* TEXT */),vue.createTextVNode(),button.screenreader?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$w," "+vue.toDisplayString(button.screenreader),1/* TEXT */)):vue.createCommentVNode("v-if",true)],10,_hoisted_2$B);}),128/* KEYED_FRAGMENT */)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createElementVNode("button",{form:_ctx.formId,"data-test":"submit-button",type:"submit",class:"button button--primary button-group__item button--large"},[vue.renderSlot(_ctx.$slots,"submit-button-text",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.form-modal.button.submit.text","Spara")),1/* TEXT */)])],8,_hoisted_4$r),vue.createTextVNode(),vue.createElementVNode("button",{"data-test":"cancel-button",type:"button",class:"button button--secondary button-group__item button--large",onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.onCancel&&_ctx.onCancel(...args))},[vue.renderSlot(_ctx.$slots,"cancel-button-text",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.form-modal.button.cancel.text","Avbryt")),1/* TEXT */)])])],64/* STABLE_FRAGMENT */))])]),_:3/* FORWARDED */},8,["data-test","fullscreen","is-open","size","aria-close-text","onClose"]);}const FFormModal=/* @__PURE__ */_export_sfc(_sfc_main$14,[["render",_sfc_render$W]]);async function confirmModal(callingInstance,modalData){const buttons=[{label:modalData.confirm,event:"confirm",type:"primary"},{label:modalData.dismiss,event:"dismiss",type:"secondary"}];const{reason}=await openModal(callingInstance,FConfirmModal,{props:{heading:modalData.heading,content:modalData.content,buttons}});return reason==="confirm";}function isVueComponent(element){return Boolean(element&&typeof element==="object"&&"$el"in element);}function focus(element,options={}){if(Array.isArray(element)){return focus(element[0],options);}if(isVueComponent(element)){var _element$focusTarget;const targetElement=(_element$focusTarget=element.focusTarget)!==null&&_element$focusTarget!==void 0?_element$focusTarget:element.$el;return focus(targetElement,options);}if(element instanceof HTMLElement){logic.focus(element,options);return true;}return false;}function getInputElement(vm){const inputElement=vm.$el.querySelector("input");if(!inputElement){const id=vm.$el.id;const tag=vm.$el.tagName.toLowerCase();throw new Error(`Could not find input element from element "${tag}#${id}"`);}return inputElement;}function hasSlot(vm,name,props={},options={}){const slot=vm.$slots[name];return Boolean(renderSlotText(slot,props,options));}function findParentByName(vm,name){let current=vm;while(current){if(current.$options.name===name){return current;}current=current.$parent;}return void 0;}function getParentByName(vm,name){const parentVm=findParentByName(vm,name);if(parentVm===void 0){throw new Error(`Unable to find parent component by given name '${name}'.`);}return parentVm;}function hasParentByName(vm,name){return findParentByName(vm,name)!==void 0;}class ErrorData{constructor(error,vm,info){__publicField(this,"error");__publicField(this,"vm");__publicField(this,"info");this.error=error;this.vm=vm;this.info=info;}}class ErrorViewData{constructor(hasError=false,payload){__publicField(this,"hasError");__publicField(this,"payload");this.hasError=hasError;this.payload=payload;}}class FormErrorList{constructor(fields){__publicField(this,"focusElementId","");__publicField(this,"id","");__publicField(this,"isValid",false);__publicField(this,"numberOfTimesSubmitted",0);__publicField(this,"title","");Object.assign(this,fields);}}class FormStep{constructor(fields){__publicField(this,"isOpen",false);__publicField(this,"isAnyFieldTouched",false);__publicField(this,"focusElementId","");__publicField(this,"id","");__publicField(this,"isValid",false);__publicField(this,"numberOfTimesSubmitted",0);__publicField(this,"title","");Object.assign(this,fields);}}var MenuAction=/* @__PURE__ */(MenuAction2=>{MenuAction2[MenuAction2["MOVE_NEXT"]=0]="MOVE_NEXT";MenuAction2[MenuAction2["MOVE_PREV"]=1]="MOVE_PREV";MenuAction2[MenuAction2["MOVE_FIRST"]=2]="MOVE_FIRST";MenuAction2[MenuAction2["MOVE_LAST"]=3]="MOVE_LAST";MenuAction2[MenuAction2["ACTIVATE"]=4]="ACTIVATE";return MenuAction2;})(MenuAction||{});function actionFromKeyboardEvent(event){switch(event.key){case"End":return MenuAction.MOVE_LAST;case"Home":return MenuAction.MOVE_FIRST;case"Up":case"ArrowUp":return MenuAction.MOVE_PREV;case"Down":case"ArrowDown":return MenuAction.MOVE_NEXT;case"Left":case"ArrowLeft":return MenuAction.MOVE_PREV;case"Right":case"ArrowRight":return MenuAction.MOVE_NEXT;case"Tab":if(event.shiftKey){return MenuAction.MOVE_PREV;}return MenuAction.MOVE_NEXT;case" ":case"Spacebar":case"Enter":return MenuAction.ACTIVATE;default:return null;}}function getValidatableElement(element){if(logic.isValidatableHTMLElement(element)){return element;}const validatableInsideElement=element.querySelector("input, textarea, select");if(validatableInsideElement){return validatableInsideElement;}else{throw new Error(`Couldn't find any validatable element`);}}function triggerInitialValidationToSupportFFormStepValidation(el){const target=getValidatableElement(el);logic.ValidationService.validateElement(target);}function registerValidators(el,binding){const{modifiers:bindingModifiers={},value:bindingValue={}}=binding;const target=getValidatableElement(el);Object.keys(bindingValue).forEach(validatorName=>{if(!bindingModifiers[validatorName]){throw new Error(`Have you forget to add '${validatorName}' to v-validation.${validatorName}?`);}});const validatorConfigs={};Object.keys(bindingModifiers).forEach(validatorName=>{validatorConfigs[validatorName]=bindingValue[validatorName]||{};});logic.ValidationService.addValidatorsToElement(target,validatorConfigs);}const ValidationDirective={beforeMount(el,binding){registerValidators(el,binding);},beforeUnmount(el,_binding){const validatableElement=getValidatableElement(el);dispatchComponentUnmountEvent(validatableElement);logic.ValidationService.removeValidatorsFromElement(validatableElement);},updated(el,binding){if(!isEqual$1(binding.value,binding.oldValue)){registerValidators(el,binding);}},mounted(el){triggerInitialValidationToSupportFFormStepValidation(el);}};const ValidationPrefixDirective={beforeMount(el,binding){el.addEventListener("component-validity",event=>{const e=event;e.detail.errorMessage=`${binding.value}${e.detail.errorMessage}`;});}};const ValidationPlugin={install(app){app.directive("validation",ValidationDirective);app.directive("validationPrefix",ValidationPrefixDirective);}};const UNHANDLED_ERROR_EVENT="unhandled-error";const defaults={captureWarnings:true,logToConsole:true};function errorHandler(options,error,vm,info){if(options.logToConsole){const consoleOutput=info?[`Error in ${info}:`,error,vm]:[error,vm];console.error(...consoleOutput);}if(error instanceof Error){EventBus.$emit(UNHANDLED_ERROR_EVENT,new ErrorData(error,vm,info));}else{EventBus.$emit(UNHANDLED_ERROR_EVENT,new ErrorData(new Error(String(error)),vm,info));}}function warnHandler(options,msg,vm,trace){if(options.logToConsole){console.warn(`Warning:`,msg,trace);}const error={name:"warning",message:msg,stack:trace};EventBus.$emit(UNHANDLED_ERROR_EVENT,new ErrorData(error,vm,"warning"));}const ErrorPlugin={install(app,options){const config2={...defaults,...options};app.config.errorHandler=errorHandler.bind(void 0,config2);if(config2.captureWarnings){app.config.warnHandler=warnHandler.bind(void 0,config2);}}};const _sfc_main$13=vue.defineComponent({name:"FErrorPage",props:{payload:{type:Object,required:false,default:null}}});const _hoisted_1$O={"data-test":"f-error-page"};const _hoisted_2$A=/* @__PURE__ */vue.createElementVNode("h1",null,"Fel",-1/* HOISTED */);const _hoisted_3$v=/* @__PURE__ */vue.createElementVNode("p",null,"Ett fel har uppstått.",-1/* HOISTED */);const _hoisted_4$q=/* @__PURE__ */vue.createElementVNode("a",{href:"/"},"Gå till startsidan",-1/* HOISTED */);function _sfc_render$V(_ctx,_cache,$props,$setup,$data,$options){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$O,[_hoisted_2$A,vue.createTextVNode(),_hoisted_3$v,vue.createTextVNode(),_hoisted_4$q]);}const FErrorPage=/* @__PURE__ */_export_sfc(_sfc_main$13,[["render",_sfc_render$V]]);const _sfc_main$12=vue.defineComponent({name:"FErrorHandlingApp",props:{defaultComponent:{type:[Function,Object],required:false,default:void 0},errorComponent:{type:[Function,Object],required:false,default:FErrorPage}},data(){return new ErrorViewData();},watch:{$route(){this.hasError=false;}},created(){EventBus.$on(UNHANDLED_ERROR_EVENT,payload=>{this.hasError=true;this.payload=payload;});}});function _sfc_render$U(_ctx,_cache,$props,$setup,$data,$options){return vue.openBlock(),vue.createElementBlock("div",null,[_ctx.hasError?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_ctx.errorComponent),{key:0,payload:_ctx.payload},null,8,["payload"])):_ctx.defaultComponent?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_ctx.defaultComponent),{key:1})):vue.renderSlot(_ctx.$slots,"default",{key:2})]);}const FErrorHandlingApp=/* @__PURE__ */_export_sfc(_sfc_main$12,[["render",_sfc_render$U]]);function isMonthBefore(date2,minDate){return Boolean(minDate&&date2.isBefore(minDate.startOfMonth()));}function isMonthAfter(date2,maxDate){return Boolean(maxDate&&date2.isAfter(maxDate.endOfMonth()));}function isInvalidMonth(date2,minDate,maxDate){const startOfMonth=date2.startOfMonth();return isMonthBefore(startOfMonth,minDate)||isMonthAfter(startOfMonth,maxDate);}function getMessage($t,date2,minDate,maxDate){const invalidMonth=isInvalidMonth(date2,minDate,maxDate);if(!invalidMonth){return void 0;}if(date2.isBefore(minDate)){const{day,monthName,year}=minDate;return $t("fkui.calendar.error.below-min-date","Du kan inte välja en dag före {{day}} {{month}} {{year}}",{day,month:monthName,year});}if(date2.isAfter(maxDate)){const{day,monthName,year}=maxDate;return $t("fkui.calendar.error.above-max-date","Du kan inte välja en dag efter {{day}} {{month}} {{year}}",{day,month:monthName,year});}}const _sfc_main$11=vue.defineComponent({name:"ICalendarNavbar",components:{FIcon},mixins:[TranslationMixin],props:{/**
|
|
167
|
+
*/beforeValidation:{type:Function,required:false,default(){}},buttons:{type:Array,required:false,default:()=>[{label:logic.TranslationService.provider.translate("fkui.form-modal.button.submit.text","Spara"),event:"submit",type:"primary",submitButton:true},{label:logic.TranslationService.provider.translate("fkui.form-modal.button.cancel.text","Avbryt"),event:"dismiss",type:"secondary"}]}},emits:["cancel","close","submit"],data(){return{};},computed:{preparedButtons(){return prepareButtonList(this.buttons,FKUIConfigButtonOrder.LEFT_TO_RIGHT);},hasDeprecatedSlots(){return hasSlot(this,"cancel-button-text")||hasSlot(this,"submit-button-text");}},methods:{onClose(){logic.ValidationService.resetState(this.$el);this.$emit("cancel");this.$emit("close",{reason:"close"});},async onSubmit(){logic.ValidationService.resetState(this.$el);this.$emit("submit",{data:this.value});this.$emit("close",{reason:"submit",data:this.value});},onCancel(){logic.ValidationService.resetState(this.$el);this.$emit("cancel");this.$emit("close",{reason:"close"});}}});const _hoisted_1$O={class:"button-group"};const _hoisted_2$A=["type","form","onClick"];const _hoisted_3$t={key:0,class:"sr-only"};const _hoisted_4$p=["form"];function _sfc_render$W(_ctx,_cache,$props,$setup,$data,$options){const _component_f_validation_form=vue.resolveComponent("f-validation-form");const _component_f_modal=vue.resolveComponent("f-modal");return vue.openBlock(),vue.createBlock(_component_f_modal,{"data-test":_ctx.dataTest,fullscreen:_ctx.fullscreen,"is-open":_ctx.isOpen,size:_ctx.size,"aria-close-text":_ctx.ariaCloseText,onClose:_ctx.onClose},{header:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"header")]),content:vue.withCtx(()=>[vue.createElementVNode("div",null,[vue.renderSlot(_ctx.$slots,"default")]),_cache[2]||(_cache[2]=vue.createTextVNode()),vue.createVNode(_component_f_validation_form,{id:_ctx.formId,"before-submit":_ctx.beforeSubmit,"before-validation":_ctx.beforeValidation,"use-error-list":_ctx.useErrorList,onSubmit:_ctx.onSubmit,onCancel:_ctx.onCancel},{"error-message":vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"error-message")]),default:vue.withCtx(()=>[_cache[1]||(_cache[1]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"input-text-fields")]),_:3/* FORWARDED */},8,["id","before-submit","before-validation","use-error-list","onSubmit","onCancel"])]),footer:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$O,[!_ctx.hasDeprecatedSlots?(vue.openBlock(true),vue.createElementBlock(vue.Fragment,{key:0},vue.renderList(_ctx.preparedButtons,button=>{return vue.openBlock(),vue.createElementBlock("button",{key:button.label,type:button.buttonType,class:vue.normalizeClass([button.classlist,"button-group__item"]),form:button.buttonType==="submit"?_ctx.formId:void 0,onClick:$event=>button.buttonType==="button"?_ctx.onCancel():false},[vue.createElementVNode("span",null,vue.toDisplayString(button.label),1/* TEXT */),_cache[3]||(_cache[3]=vue.createTextVNode()),button.screenreader?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$t," "+vue.toDisplayString(button.screenreader),1/* TEXT */)):vue.createCommentVNode("v-if",true)],10,_hoisted_2$A);}),128/* KEYED_FRAGMENT */)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createElementVNode("button",{form:_ctx.formId,"data-test":"submit-button",type:"submit",class:"button button--primary button-group__item button--large"},[vue.renderSlot(_ctx.$slots,"submit-button-text",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.form-modal.button.submit.text","Spara")),1/* TEXT */)])],8,_hoisted_4$p),_cache[4]||(_cache[4]=vue.createTextVNode()),vue.createElementVNode("button",{"data-test":"cancel-button",type:"button",class:"button button--secondary button-group__item button--large",onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.onCancel&&_ctx.onCancel(...args))},[vue.renderSlot(_ctx.$slots,"cancel-button-text",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.form-modal.button.cancel.text","Avbryt")),1/* TEXT */)])])],64/* STABLE_FRAGMENT */))])]),_:3/* FORWARDED */},8,["data-test","fullscreen","is-open","size","aria-close-text","onClose"]);}const FFormModal=/* @__PURE__ */_export_sfc(_sfc_main$14,[["render",_sfc_render$W]]);async function confirmModal(callingInstance,texts){const buttons=[{label:texts.confirm,event:"confirm",type:"primary"},{label:texts.dismiss,event:"dismiss",type:"secondary"}];const{reason}=await openModal(callingInstance,FConfirmModal,{props:{heading:texts.heading,content:texts.content,buttons}});return reason==="confirm";}function isVueComponent(element){return Boolean(element&&typeof element==="object"&&"$el"in element);}function focus(element,options={}){if(Array.isArray(element)){return focus(element[0],options);}if(isVueComponent(element)){var _element$focusTarget;const targetElement=(_element$focusTarget=element.focusTarget)!==null&&_element$focusTarget!==void 0?_element$focusTarget:element.$el;return focus(targetElement,options);}if(element instanceof HTMLElement){logic.focus(element,options);return true;}return false;}function getInputElement(vm){const inputElement=vm.$el.querySelector("input");if(!inputElement){const id=vm.$el.id;const tag=vm.$el.tagName.toLowerCase();throw new Error(`Could not find input element from element "${tag}#${id}"`);}return inputElement;}function hasSlot(vm,name,props={},options={}){const slot=vm.$slots[name];return Boolean(renderSlotText(slot,props,options));}function useModal(){const instance=vue.getCurrentInstance();if(!instance){throw new Error(`useModal(..) used outside component scope`);}const context={$fkui:instance};return{openModal(component,options){return openModal(context,component,options);},confirmModal(texts){return confirmModal(context,texts);},formModal(component,options){return formModal(context,component,options);}};}function findParentByName(vm,name){let current=vm;while(current){if(current.$options.name===name){return current;}current=current.$parent;}return void 0;}function getParentByName(vm,name){const parentVm=findParentByName(vm,name);if(parentVm===void 0){throw new Error(`Unable to find parent component by given name '${name}'.`);}return parentVm;}function hasParentByName(vm,name){return findParentByName(vm,name)!==void 0;}class ErrorData{constructor(error,vm,info){__publicField(this,"error");__publicField(this,"vm");__publicField(this,"info");this.error=error;this.vm=vm;this.info=info;}}class ErrorViewData{constructor(hasError=false,payload){__publicField(this,"hasError");__publicField(this,"payload");this.hasError=hasError;this.payload=payload;}}class FormErrorList{constructor(fields){__publicField(this,"focusElementId","");__publicField(this,"id","");__publicField(this,"isValid",false);__publicField(this,"numberOfTimesSubmitted",0);__publicField(this,"title","");Object.assign(this,fields);}}class FormStep{constructor(fields){__publicField(this,"isOpen",false);__publicField(this,"isAnyFieldTouched",false);__publicField(this,"focusElementId","");__publicField(this,"id","");__publicField(this,"isValid",false);__publicField(this,"numberOfTimesSubmitted",0);__publicField(this,"title","");Object.assign(this,fields);}}var MenuAction=/* @__PURE__ */(MenuAction2=>{MenuAction2[MenuAction2["MOVE_NEXT"]=0]="MOVE_NEXT";MenuAction2[MenuAction2["MOVE_PREV"]=1]="MOVE_PREV";MenuAction2[MenuAction2["MOVE_FIRST"]=2]="MOVE_FIRST";MenuAction2[MenuAction2["MOVE_LAST"]=3]="MOVE_LAST";MenuAction2[MenuAction2["ACTIVATE"]=4]="ACTIVATE";return MenuAction2;})(MenuAction||{});function actionFromKeyboardEvent(event){switch(event.key){case"End":return MenuAction.MOVE_LAST;case"Home":return MenuAction.MOVE_FIRST;case"Up":case"ArrowUp":return MenuAction.MOVE_PREV;case"Down":case"ArrowDown":return MenuAction.MOVE_NEXT;case"Left":case"ArrowLeft":return MenuAction.MOVE_PREV;case"Right":case"ArrowRight":return MenuAction.MOVE_NEXT;case"Tab":if(event.shiftKey){return MenuAction.MOVE_PREV;}return MenuAction.MOVE_NEXT;case" ":case"Spacebar":case"Enter":return MenuAction.ACTIVATE;default:return null;}}function getValidatableElement(element){if(logic.isValidatableHTMLElement(element)){return element;}const validatableInsideElement=element.querySelector("input, textarea, select");if(validatableInsideElement){return validatableInsideElement;}else{throw new Error(`Couldn't find any validatable element`);}}function triggerInitialValidationToSupportFFormStepValidation(el){const target=getValidatableElement(el);logic.ValidationService.validateElement(target);}function registerValidators(el,binding){const{modifiers:bindingModifiers={},value:bindingValue={}}=binding;const target=getValidatableElement(el);Object.keys(bindingValue).forEach(validatorName=>{if(!bindingModifiers[validatorName]){throw new Error(`Have you forget to add '${validatorName}' to v-validation.${validatorName}?`);}});const validatorConfigs={};Object.keys(bindingModifiers).forEach(validatorName=>{validatorConfigs[validatorName]=bindingValue[validatorName]||{};});logic.ValidationService.addValidatorsToElement(target,validatorConfigs);}const ValidationDirective={beforeMount(el,binding){registerValidators(el,binding);},beforeUnmount(el,_binding){const validatableElement=getValidatableElement(el);dispatchComponentUnmountEvent(validatableElement);logic.ValidationService.removeValidatorsFromElement(validatableElement);},updated(el,binding){if(!isEqual$1(binding.value,binding.oldValue)){registerValidators(el,binding);}},mounted(el){triggerInitialValidationToSupportFFormStepValidation(el);}};const ValidationPrefixDirective={beforeMount(el,binding){el.addEventListener("component-validity",event=>{const e=event;e.detail.errorMessage=`${binding.value}${e.detail.errorMessage}`;});}};const ValidationPlugin={install(app){app.directive("validation",ValidationDirective);app.directive("validationPrefix",ValidationPrefixDirective);}};const UNHANDLED_ERROR_EVENT="unhandled-error";const defaults={captureWarnings:true,logToConsole:true};function errorHandler(options,error,vm,info){if(options.logToConsole){const consoleOutput=info?[`Error in ${info}:`,error,vm]:[error,vm];console.error(...consoleOutput);}if(error instanceof Error){EventBus.$emit(UNHANDLED_ERROR_EVENT,new ErrorData(error,vm,info));}else{EventBus.$emit(UNHANDLED_ERROR_EVENT,new ErrorData(new Error(String(error)),vm,info));}}function warnHandler(options,msg,vm,trace){if(options.logToConsole){console.warn(`Warning:`,msg,trace);}const error={name:"warning",message:msg,stack:trace};EventBus.$emit(UNHANDLED_ERROR_EVENT,new ErrorData(error,vm,"warning"));}const ErrorPlugin={install(app,options){const config2={...defaults,...options};app.config.errorHandler=errorHandler.bind(void 0,config2);if(config2.captureWarnings){app.config.warnHandler=warnHandler.bind(void 0,config2);}}};const _sfc_main$13=vue.defineComponent({name:"FErrorPage",props:{payload:{type:Object,required:false,default:null}}});const _hoisted_1$N={"data-test":"f-error-page"};function _sfc_render$V(_ctx,_cache,$props,$setup,$data,$options){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$N,_cache[0]||(_cache[0]=[vue.createElementVNode("h1",null,"Fel",-1/* HOISTED */),vue.createTextVNode(),vue.createElementVNode("p",null,"Ett fel har uppstått.",-1/* HOISTED */),vue.createTextVNode(),vue.createElementVNode("a",{href:"/"},"Gå till startsidan",-1/* HOISTED */)]));}const FErrorPage=/* @__PURE__ */_export_sfc(_sfc_main$13,[["render",_sfc_render$V]]);const _sfc_main$12=vue.defineComponent({name:"FErrorHandlingApp",props:{defaultComponent:{type:[Function,Object],required:false,default:void 0},errorComponent:{type:[Function,Object],required:false,default:FErrorPage}},data(){return new ErrorViewData();},watch:{$route(){this.hasError=false;}},created(){EventBus.$on(UNHANDLED_ERROR_EVENT,payload=>{this.hasError=true;this.payload=payload;});}});function _sfc_render$U(_ctx,_cache,$props,$setup,$data,$options){return vue.openBlock(),vue.createElementBlock("div",null,[_ctx.hasError?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_ctx.errorComponent),{key:0,payload:_ctx.payload},null,8,["payload"])):_ctx.defaultComponent?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_ctx.defaultComponent),{key:1})):vue.renderSlot(_ctx.$slots,"default",{key:2})]);}const FErrorHandlingApp=/* @__PURE__ */_export_sfc(_sfc_main$12,[["render",_sfc_render$U]]);function isMonthBefore(date2,minDate){return Boolean(minDate&&date2.isBefore(minDate.startOfMonth()));}function isMonthAfter(date2,maxDate){return Boolean(maxDate&&date2.isAfter(maxDate.endOfMonth()));}function isInvalidMonth(date2,minDate,maxDate){const startOfMonth=date2.startOfMonth();return isMonthBefore(startOfMonth,minDate)||isMonthAfter(startOfMonth,maxDate);}function getMessage($t,date2,minDate,maxDate){const invalidMonth=isInvalidMonth(date2,minDate,maxDate);if(!invalidMonth){return void 0;}if(date2.isBefore(minDate)){const{day,monthName,year}=minDate;return $t("fkui.calendar.error.below-min-date","Du kan inte välja en dag före {{day}} {{month}} {{year}}",{day,month:monthName,year});}if(date2.isAfter(maxDate)){const{day,monthName,year}=maxDate;return $t("fkui.calendar.error.above-max-date","Du kan inte välja en dag efter {{day}} {{month}} {{year}}",{day,month:monthName,year});}}const _sfc_main$11=vue.defineComponent({name:"ICalendarNavbar",components:{FIcon},mixins:[TranslationMixin],props:{/**
|
|
168
168
|
* Focused month.
|
|
169
169
|
*/modelValue:{type:Object,required:true},/**
|
|
170
170
|
* Min date.
|
|
171
171
|
*/minDate:{type:Object,required:true},/**
|
|
172
172
|
* Max date.
|
|
173
|
-
*/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$
|
|
173
|
+
*/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$M={class:"calendar-navbar"};const _hoisted_2$z={class:"calendar-navbar__month",tabindex:"-1"};const _hoisted_3$s=["aria-disabled","aria-live"];const _hoisted_4$o={class:"sr-only"};const _hoisted_5$j=["aria-disabled","aria-live"];const _hoisted_6$e={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$M,[vue.createElementVNode("div",_hoisted_2$z,vue.toDisplayString(_ctx.currentText),1/* TEXT */),_cache[4]||(_cache[4]=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$o,vue.toDisplayString(_ctx.previousSrText),1/* TEXT */),_cache[2]||(_cache[2]=vue.createTextVNode()),vue.createVNode(_component_f_icon,{class:vue.normalizeClass(_ctx.previousIconClasses),name:"arrow-right"},null,8,["class"])],8,_hoisted_3$s),_cache[5]||(_cache[5]=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$e,vue.toDisplayString(_ctx.nextSrText),1/* TEXT */),_cache[3]||(_cache[3]=vue.createTextVNode()),vue.createVNode(_component_f_icon,{class:vue.normalizeClass(_ctx.nextIconClasses),name:"arrow-right"},null,8,["class"])],8,_hoisted_5$j)]);}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:{/**
|
|
174
174
|
* Focused month.
|
|
175
175
|
* @model
|
|
176
176
|
*/value:{type:Object,required:true},/**
|
|
177
177
|
* Hide week numbers.
|
|
178
|
-
*/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$
|
|
178
|
+
*/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$L={key:0,class:"calendar-month__col--week"};const _hoisted_2$y={role:"presentation"};const _hoisted_3$r={role:"presentation"};const _hoisted_4$n={key:0,scope:"col","aria-hidden":"true",class:"calendar-month__header-cell"};const _hoisted_5$i=["title"];const _hoisted_6$d={role:"presentation"};const _hoisted_7$c={key:0,class:"calendar-month__cell calendar-month__cell--week-number","aria-hidden":"true"};const _hoisted_8$8=["colspan"];const _hoisted_9$5=["colspan"];const _hoisted_10$5={key:0,"aria-hidden":"true"};const _hoisted_11$2=["colspan"];const _hoisted_12$2={key:1,"aria-hidden":"true"};const _hoisted_13$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$L)):vue.createCommentVNode("v-if",true),_cache[2]||(_cache[2]=vue.createTextVNode()),_cache[3]||(_cache[3]=vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */)),_cache[4]||(_cache[4]=vue.createTextVNode()),_cache[5]||(_cache[5]=vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */)),_cache[6]||(_cache[6]=vue.createTextVNode()),_cache[7]||(_cache[7]=vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */)),_cache[8]||(_cache[8]=vue.createTextVNode()),_cache[9]||(_cache[9]=vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */)),_cache[10]||(_cache[10]=vue.createTextVNode()),_cache[11]||(_cache[11]=vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */)),_cache[12]||(_cache[12]=vue.createTextVNode()),_cache[13]||(_cache[13]=vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */)),_cache[14]||(_cache[14]=vue.createTextVNode()),_cache[15]||(_cache[15]=vue.createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */))]),_cache[22]||(_cache[22]=vue.createTextVNode()),vue.createElementVNode("thead",_hoisted_2$y,[vue.createElementVNode("tr",_hoisted_3$r,[!_ctx.internalHideWeekNumbers?(vue.openBlock(),vue.createElementBlock("th",_hoisted_4$n)):vue.createCommentVNode("v-if",true),_cache[16]||(_cache[16]=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_5$i)]);}),128/* KEYED_FRAGMENT */))])]),_cache[23]||(_cache[23]=vue.createTextVNode()),vue.createElementVNode("tbody",_hoisted_6$d,[(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_7$c,vue.toDisplayString(week.week),1/* TEXT */)):vue.createCommentVNode("v-if",true),_cache[17]||(_cache[17]=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_8$8)):vue.createCommentVNode("v-if",true),_cache[18]||(_cache[18]=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 */)),_cache[19]||(_cache[19]=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_9$5)):vue.createCommentVNode("v-if",true)]);}),128/* KEYED_FRAGMENT */)),_cache[20]||(_cache[20]=vue.createTextVNode()),_ctx.weeks.length<5?(vue.openBlock(),vue.createElementBlock("tr",_hoisted_10$5,[vue.createElementVNode("td",{class:"calendar-month__cell",colspan:_ctx.totalCols,"aria-hidden":"true"},null,8,_hoisted_11$2)])):vue.createCommentVNode("v-if",true),_cache[21]||(_cache[21]=vue.createTextVNode()),_ctx.weeks.length<6?(vue.openBlock(),vue.createElementBlock("tr",_hoisted_12$2,[vue.createElementVNode("td",{class:"calendar-month__cell",colspan:_ctx.totalCols,"aria-hidden":"true"},null,8,_hoisted_13$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:{/**
|
|
179
179
|
* Active month.
|
|
180
180
|
* @model
|
|
181
181
|
*/modelValue:{type:Object,required:true},/**
|
|
@@ -187,7 +187,7 @@ isIndex(key,length)))){result.push(key);}}return result;}var _arrayLikeKeys=arra
|
|
|
187
187
|
* Min date.
|
|
188
188
|
*/minDate:{type:Object,required:true},/**
|
|
189
189
|
* Max date.
|
|
190
|
-
*/maxDate:{type:Object,required:true}},emits:["change","click","update:modelValue"],methods:{onClickDay(date2){this.$emit("click",date2);},async onKeydownDay(date2,event){if(!isDayStepKey(event)){return;}event.preventDefault();const dayStep=getDayStep(event);const navigatedDay=date2.addDays(dayStep);const navigatedMonth=navigatedDay.startOfMonth();const message=getMessage(this.$t,navigatedDay,this.minDate,this.maxDate);if(message){logic.alertScreenReader(message,{assertive:true});return;}this.$emit("update:modelValue",navigatedMonth);this.$emit("change",navigatedMonth);if(navigatedDay.month!==date2.month){await this.$nextTick();}this.$forceUpdate();const navigatedDayRef=this.$refs[navigatedDay.toString()];if(navigatedDayRef){const navigatedDayElement=getHTMLElementFromVueRef(navigatedDayRef);logic.focus(navigatedDayElement);}},isDayFocused(date2){return document.activeElement===this.$refs[date2.toString()];},getTabindex(date$1){let activeDate=void 0;if(document.activeElement instanceof HTMLElement){const activeString=document.activeElement.dataset.date;activeDate=activeString?date.FDate.fromIso(activeString):void 0;}return getDayTabindex(date$1,activeDate,this.tabDate);}}});const _hoisted_1$
|
|
190
|
+
*/maxDate:{type:Object,required:true}},emits:["change","click","update:modelValue"],methods:{onClickDay(date2){this.$emit("click",date2);},async onKeydownDay(date2,event){if(!isDayStepKey(event)){return;}event.preventDefault();const dayStep=getDayStep(event);const navigatedDay=date2.addDays(dayStep);const navigatedMonth=navigatedDay.startOfMonth();const message=getMessage(this.$t,navigatedDay,this.minDate,this.maxDate);if(message){logic.alertScreenReader(message,{assertive:true});return;}this.$emit("update:modelValue",navigatedMonth);this.$emit("change",navigatedMonth);if(navigatedDay.month!==date2.month){await this.$nextTick();}this.$forceUpdate();const navigatedDayRef=this.$refs[navigatedDay.toString()];if(navigatedDayRef){const navigatedDayElement=getHTMLElementFromVueRef(navigatedDayRef);logic.focus(navigatedDayElement);}},isDayFocused(date2){return document.activeElement===this.$refs[date2.toString()];},getTabindex(date$1){let activeDate=void 0;if(document.activeElement instanceof HTMLElement){const activeString=document.activeElement.dataset.date;activeDate=activeString?date.FDate.fromIso(activeString):void 0;}return getDayTabindex(date$1,activeDate,this.tabDate);}}});const _hoisted_1$K=["data-date","tabindex","onClick","onKeydown"];function _sfc_render$R(_ctx,_cache,$props,$setup,$data,$options){const _component_i_calendar_month_grid=vue.resolveComponent("i-calendar-month-grid");return vue.openBlock(),vue.createBlock(_component_i_calendar_month_grid,{value:_ctx.modelValue},{default:vue.withCtx(({date:date2})=>[vue.createElementVNode("button",{ref:date2.toString(),class:"calendar-month__button","data-test":"select-day-button","data-date":date2.toString(),tabindex:_ctx.getTabindex(date2),type:"button",onClick:vue.withModifiers($event=>_ctx.onClickDay(date2),["stop","prevent"]),onKeydown:$event=>_ctx.onKeydownDay(date2,$event)},[vue.renderSlot(_ctx.$slots,"default",{date:date2,isFocused:_ctx.isDayFocused(date2)})],40,_hoisted_1$K)]),_:3/* FORWARDED */},8,["value"]);}const ICalendarMonth=/* @__PURE__ */_export_sfc(_sfc_main$$,[["render",_sfc_render$R]]);const _sfc_main$_=vue.defineComponent({name:"FCalendar",components:{ICalendarNavbar,ICalendarMonth},props:{/**
|
|
191
191
|
* Active month.
|
|
192
192
|
* @model
|
|
193
193
|
*/modelValue:{type:Object,required:true},/**
|
|
@@ -199,7 +199,7 @@ isIndex(key,length)))){result.push(key);}}return result;}var _arrayLikeKeys=arra
|
|
|
199
199
|
* Min date.
|
|
200
200
|
*/minDate:{type:Object,required:true},/**
|
|
201
201
|
* Max date.
|
|
202
|
-
*/maxDate:{type:Object,required:true}},emits:["click","change","update:modelValue"],methods:{onClickDay(date2){this.$emit("click",date2);},onChangeMonth(date2){this.$emit("update:modelValue",date2);this.$emit("change",date2);}}});const _hoisted_1$
|
|
202
|
+
*/maxDate:{type:Object,required:true}},emits:["click","change","update:modelValue"],methods:{onClickDay(date2){this.$emit("click",date2);},onChangeMonth(date2){this.$emit("update:modelValue",date2);this.$emit("change",date2);}}});const _hoisted_1$J={class:"calendar__wrapper"};function _sfc_render$Q(_ctx,_cache,$props,$setup,$data,$options){const _component_i_calendar_navbar=vue.resolveComponent("i-calendar-navbar");const _component_i_calendar_month=vue.resolveComponent("i-calendar-month");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$J,[vue.createVNode(_component_i_calendar_navbar,{"model-value":_ctx.modelValue,"min-date":_ctx.minDate,"max-date":_ctx.maxDate,"onUpdate:modelValue":_ctx.onChangeMonth},null,8,["model-value","min-date","max-date","onUpdate:modelValue"]),_cache[0]||(_cache[0]=vue.createTextVNode()),vue.createVNode(_component_i_calendar_month,{"model-value":_ctx.modelValue,"min-date":_ctx.minDate,"max-date":_ctx.maxDate,"tab-date":_ctx.tabDate,onClick:_ctx.onClickDay,"onUpdate:modelValue":_ctx.onChangeMonth},{default:vue.withCtx(({date:date2,focused})=>[vue.renderSlot(_ctx.$slots,"default",{date:date2,isFocused:focused})]),_:3/* FORWARDED */},8,["model-value","min-date","max-date","tab-date","onClick","onUpdate:modelValue"])]);}const FCalendar=/* @__PURE__ */_export_sfc(_sfc_main$_,[["render",_sfc_render$Q]]);function getCalendarDaySrText(day,enabled,selected,t){const parts=[];if(!enabled){parts.push(t("fkui.calendar.day.unselectable","inte valbar"));}else if(selected){parts.push(t("fkui.calendar.day.selected","vald dag"));}const today=date.FDate.now();if(day.equals(today)){parts.push(t("fkui.calendar.day.today","idag"));}else if(day.equals(today.addDays(-1))){parts.push(t("fkui.calendar.day.yesterday","igår"));}else if(day.equals(today.addDays(1))){parts.push(t("fkui.calendar.day.tomorrow","imorgon"));}parts.push(day.toString(date.DateFormat.FULL));return parts.join(" ");}const _sfc_main$Z=vue.defineComponent({name:"FCalendarDay",mixins:[TranslationMixin],props:{/**
|
|
203
203
|
* Day to render.
|
|
204
204
|
*/day:{type:Object,required:true},/**
|
|
205
205
|
* Set to `true` if day is enabled.
|
|
@@ -209,7 +209,7 @@ isIndex(key,length)))){result.push(key);}}return result;}var _arrayLikeKeys=arra
|
|
|
209
209
|
* Set to `true` if day is selected.
|
|
210
210
|
*/selected:{type:Boolean,required:false,default:false},/**
|
|
211
211
|
* Set to `true` if day should be highlighted.
|
|
212
|
-
*/highlight:{type:Boolean,required:false,default:false}},computed:{srText(){return getCalendarDaySrText(this.day,this.enabled,this.selected,this.$t);},dayClasses(){const component="calendar-day";const classes=[component];if(this.highlight){classes.push(`${component}--highlight`);}if(this.enabled){if(this.selected){classes.push(`${component}--selected`);}}else{classes.push(`${component}--disabled`);}return classes;}}});const _hoisted_1$
|
|
212
|
+
*/highlight:{type:Boolean,required:false,default:false}},computed:{srText(){return getCalendarDaySrText(this.day,this.enabled,this.selected,this.$t);},dayClasses(){const component="calendar-day";const classes=[component];if(this.highlight){classes.push(`${component}--highlight`);}if(this.enabled){if(this.selected){classes.push(`${component}--selected`);}}else{classes.push(`${component}--disabled`);}return classes;}}});const _hoisted_1$I={"aria-hidden":"true"};const _hoisted_2$x={class:"sr-only"};function _sfc_render$P(_ctx,_cache,$props,$setup,$data,$options){return vue.openBlock(),vue.createElementBlock("span",{class:vue.normalizeClass(_ctx.dayClasses)},[vue.createElementVNode("span",_hoisted_1$I,vue.toDisplayString(_ctx.day.day),1/* TEXT */),_cache[0]||(_cache[0]=vue.createTextVNode()),vue.createElementVNode("span",_hoisted_2$x,vue.toDisplayString(_ctx.srText),1/* TEXT */)],2/* CLASS */);}const FCalendarDay=/* @__PURE__ */_export_sfc(_sfc_main$Z,[["render",_sfc_render$P]]);function offset(page,el){const rect=el.getBoundingClientRect();return{top:rect.top+page.pageYOffset,left:rect.left+page.pageXOffset};}function getElement(anchor){if(!anchor){return null;}if(typeof anchor==="string"){return document.getElementById(anchor);}else{return anchor;}}var Placement=/* @__PURE__ */(Placement2=>{Placement2["A"]="A";Placement2["B"]="B";Placement2["C"]="C";Placement2["D"]="D";Placement2["E"]="E";Placement2["F"]="F";Placement2["G"]="G";Placement2["H"]="H";Placement2["I"]="I";Placement2["Fallback"]="Fallback";Placement2["NotCalculated"]="NotCalculated";return Placement2;})(Placement||{});var CandidateOrder=/* @__PURE__ */(CandidateOrder2=>{CandidateOrder2["Default"]="Default";CandidateOrder2["IPopupError"]="IPopupError";return CandidateOrder2;})(CandidateOrder||{});function getCandidates(anchor,target,clippedArea,spacing,candidateOrder){const dw=target.width-anchor.width;const a={placement:"A",x:anchor.x,y:anchor.y+anchor.height+spacing,width:target.width,height:target.height,direction:1/* Vertical */};const b={placement:"B",x:anchor.x-dw,y:anchor.y+anchor.height+spacing,width:target.width,height:target.height,direction:1/* Vertical */};const c={placement:"C",x:anchor.x,y:anchor.y-target.height-spacing,width:target.width,height:target.height,direction:1/* Vertical */};const d={placement:"D",x:anchor.x-dw,y:anchor.y-target.height-spacing,width:target.width,height:target.height,direction:1/* Vertical */};const e={placement:"E",x:anchor.x+anchor.width+spacing,y:anchor.y+anchor.height/2-target.height/2,width:target.width,height:target.height,direction:0/* Horizontal */};const f={placement:"F",x:anchor.x-(target.width+spacing),y:anchor.y+anchor.height/2-target.height/2,width:target.width,height:target.height,direction:0/* Horizontal */};const g={placement:"G",x:anchor.x+anchor.width+spacing,y:clippedArea.y+spacing,width:target.width,height:target.height,direction:2/* Both */};const h={placement:"H",x:anchor.x-(target.width+spacing),y:clippedArea.y+spacing,width:target.width,height:target.height,direction:2/* Both */};const i={placement:"I",x:clippedArea.x+(clippedArea.width-target.width)/2,y:clippedArea.y+(clippedArea.height-target.height)/2,width:target.width,height:target.height,direction:3/* None */};if(candidateOrder==="IPopupError"){return[b,a,d,c,e,f,f,f,f];}else{return[a,b,c,d,e,f,g,h,i];}}function isInside(outer,inner,spacing){const isHorizontalDirection=inner.direction===0||inner.direction===2;const xSpacing=isHorizontalDirection?spacing:0;const isVerticalDirection=inner.direction===1||inner.direction===2;const ySpacing=isVerticalDirection?spacing:0;const ax=[inner.x,inner.x+inner.width];const ay=[inner.y,inner.y+inner.height];const bx=[outer.x+xSpacing,outer.x+outer.width-xSpacing];const by=[outer.y+ySpacing,outer.y+outer.height-ySpacing];if(ax[0]<bx[0]||ax[1]>bx[1]){return false;}if(ay[0]<by[0]||ay[1]>by[1]){return false;}return true;}function isElementOptions(options){return options.target instanceof HTMLElement;}function clipRect(src,clip){if(!clip){return src;}const x=Math.max(src.x,clip.x);const y=Math.max(src.y,clip.y);const width=Math.min(src.x+src.width,clip.x+clip.width)-x;const height=Math.min(src.y+src.height,clip.y+clip.height)-y;return{x,y,width,height};}function getAbsolutePosition(src){if(!src){return void 0;}const isRoot=src.isSameNode(document.documentElement);if(isRoot){return{x:window.pageXOffset,y:window.pageYOffset,width:src.clientWidth,height:src.clientHeight};}const rect=src.getBoundingClientRect();return{x:Math.floor(rect.left+window.pageXOffset),y:Math.floor(rect.top+window.pageYOffset),width:Math.floor(rect.width),height:Math.floor(rect.height)};}function fitInsideArea(options){var _a;if(isElementOptions(options)){const{area:areaElement,anchor:anchorElement,target:targetElement,viewport:viewportElement,spacing:spacing2,candidateOrder}=options;const area2=getAbsolutePosition(areaElement);const anchor2=getAbsolutePosition(anchorElement);const target2=getAbsolutePosition(targetElement);const viewport2=getAbsolutePosition(viewportElement);const result=fitInsideArea({area:area2,target:target2,anchor:anchor2,viewport:viewport2,spacing:spacing2,candidateOrder});const offset2=(_a=targetElement.offsetParent)==null?void 0:_a.getBoundingClientRect();if(!offset2){return result;}return{...result,x:result.x-(offset2.left+window.pageXOffset),y:result.y-(offset2.top+window.pageYOffset)};}const{anchor,target,area,viewport,spacing}=options;const clippedArea=clipRect(area,viewport);const candidates=getCandidates(anchor,target,clippedArea,spacing,options.candidateOrder);const index=candidates.findIndex(it=>isInside(clippedArea,it,spacing));if(index>=0){const match=candidates[index];return{x:match.x,y:match.y,placement:match.placement};}return{...getFallbackPosition(anchor,target,clippedArea,spacing),placement:"Fallback"/* Fallback */};}function getScrollToPopup(param){const popupOffset=offset({pageXOffset:0,pageYOffset:param.scrollTop},param.popup);const popupHeight=param.popup.offsetHeight;const neededScroll=popupOffset.top-param.windowInnerHeight+popupHeight+param.spacing;if(neededScroll>param.scrollTop){return neededScroll;}else{return param.scrollTop;}}function getFallbackPosition(anchor,target,clippedArea,spacing){const x=anchor.x-(target.width+spacing);const y=anchor.y+anchor.height+spacing;if(x>=clippedArea.x){return{x,y};}else{return{x:clippedArea.x+spacing,y};}}function getContainer(element,prop){if(prop){return prop;}const parent=element.closest(".popup__container");if(parent){return parent;}return config.popupContainer;}function getFocusableElement(rootElement,callback){var _elements$;if(callback){return callback();}const popupElement=getHTMLElementFromVueRef(rootElement);const elements=logic.findTabbableElements(popupElement);return(_elements$=elements[0])!==null&&_elements$!==void 0?_elements$:null;}const MIN_DESKTOP_WIDTH=640;const POPUP_SPACING$1=20;function isTeleportDisabled(options){const{window:window2,placement,forceInline,forceOverlay}=options;const isMobileSize=window2.innerWidth<MIN_DESKTOP_WIDTH;let disableTeleport=isMobileSize||placement===Placement.Fallback;if(forceInline){disableTeleport=true;}else if(forceOverlay){disableTeleport=false;}return disableTeleport;}const _sfc_main$Y=vue.defineComponent({name:"IPopup",inheritAttrs:false,props:{/**
|
|
213
213
|
* Toggle open/closed popup.
|
|
214
214
|
*/isOpen:{type:Boolean,required:true},/**
|
|
215
215
|
* DOM element to position popup at.
|
|
@@ -239,7 +239,7 @@ isIndex(key,length)))){result.push(key);}}return result;}var _arrayLikeKeys=arra
|
|
|
239
239
|
* The items to be diplayed in the menu
|
|
240
240
|
*/items:{type:Array,required:true},/**
|
|
241
241
|
* Unique accessible name for navigation landmark.
|
|
242
|
-
*/ariaLabel:{type:String,required:false,default:"Kontextuell meny"}},emits:["close","select"],setup(){return{contextmenu:vue.ref(null)};},data(){return{selectedItem:"",currentFocusedItemIndex:-1};},computed:{popupItems(){return this.items.filter(isContextMenuTextItem);},separatorPositions(){const res=[];if(this.items.length>1){this.items.forEach((it,i)=>{if(isContextMenuSeparatorItem(it)){const pos=i-1-res.length;if(pos>=0&&pos<this.items.length-1){res.push(pos);}}});}return res;},hasIcons(){return this.items.some(it=>isContextMenuTextItem(it)&&it.icon);}},watch:{isOpen:{immediate:true,async handler(){if(this.isOpen){this.currentFocusedItemIndex=-1;this.selectedItem="";}}}},methods:{hasSeparatorAfterItemAt(index){return this.separatorPositions.includes(index);},closePopup(){this.$emit("close");},onClickItem(item){if(isContextMenuTextItem(item)&&item.key){this.selectedItem=item.key;this.$emit("select",this.selectedItem);this.closePopup();}},tabIndex(index){return index===this.currentFocusedItemIndex?0:-1;},onKeyUp(event){if(preventKeys$3.includes(event.key)){event.preventDefault();}},doHandlePopupMenuTabKey(action){if(action===MenuAction.MOVE_NEXT&&this.currentFocusedItemIndex+1===this.popupItems.length){this.closePopup();return true;}else if(action===MenuAction.MOVE_PREV&&(this.currentFocusedItemIndex===0||this.currentFocusedItemIndex===-1)){this.closePopup();return false;}return false;},async onKeyDown(event){if(!preventKeys$3.includes(event.key)){return;}if(event.key==="Escape"){this.$emit("close");return;}const action=actionFromKeyboardEvent(event);if(action===null){return;}if(event.key==="Tab"&&this.doHandlePopupMenuTabKey(action)){return;}if(keyUp$1.includes(event.key)&&this.currentFocusedItemIndex===-1){this.currentFocusedItemIndex=this.popupItems.length>0?this.popupItems.length:1;}event.preventDefault();await doMenuAction$3(action,this);},async setFocusOnItem(index){if(index<0||index>=this.popupItems.length){return;}this.currentFocusedItemIndex=index;await this.$nextTick();if(!this.isOpen){return;}const items=getHTMLElementsFromVueRef(this.$refs.items);if(items.length>0){const popupMenuItem=items[index];logic.focus(popupMenuItem,{preventScroll:true});}},async activateItem(index){if(index<0||index>=this.popupItems.length){return;}if(index!==this.currentFocusedItemIndex){await this.setFocusOnItem(index);}this.onClickItem(this.popupItems[this.currentFocusedItemIndex]);}}});const _hoisted_1$
|
|
242
|
+
*/ariaLabel:{type:String,required:false,default:"Kontextuell meny"}},emits:["close","select"],setup(){return{contextmenu:vue.ref(null)};},data(){return{selectedItem:"",currentFocusedItemIndex:-1};},computed:{popupItems(){return this.items.filter(isContextMenuTextItem);},separatorPositions(){const res=[];if(this.items.length>1){this.items.forEach((it,i)=>{if(isContextMenuSeparatorItem(it)){const pos=i-1-res.length;if(pos>=0&&pos<this.items.length-1){res.push(pos);}}});}return res;},hasIcons(){return this.items.some(it=>isContextMenuTextItem(it)&&it.icon);}},watch:{isOpen:{immediate:true,async handler(){if(this.isOpen){this.currentFocusedItemIndex=-1;this.selectedItem="";}}}},methods:{hasSeparatorAfterItemAt(index){return this.separatorPositions.includes(index);},closePopup(){this.$emit("close");},onClickItem(item){if(isContextMenuTextItem(item)&&item.key){this.selectedItem=item.key;this.$emit("select",this.selectedItem);this.closePopup();}},tabIndex(index){return index===this.currentFocusedItemIndex?0:-1;},onKeyUp(event){if(preventKeys$3.includes(event.key)){event.preventDefault();}},doHandlePopupMenuTabKey(action){if(action===MenuAction.MOVE_NEXT&&this.currentFocusedItemIndex+1===this.popupItems.length){this.closePopup();return true;}else if(action===MenuAction.MOVE_PREV&&(this.currentFocusedItemIndex===0||this.currentFocusedItemIndex===-1)){this.closePopup();return false;}return false;},async onKeyDown(event){if(!preventKeys$3.includes(event.key)){return;}if(event.key==="Escape"){this.$emit("close");return;}const action=actionFromKeyboardEvent(event);if(action===null){return;}if(event.key==="Tab"&&this.doHandlePopupMenuTabKey(action)){return;}if(keyUp$1.includes(event.key)&&this.currentFocusedItemIndex===-1){this.currentFocusedItemIndex=this.popupItems.length>0?this.popupItems.length:1;}event.preventDefault();await doMenuAction$3(action,this);},async setFocusOnItem(index){if(index<0||index>=this.popupItems.length){return;}this.currentFocusedItemIndex=index;await this.$nextTick();if(!this.isOpen){return;}const items=getHTMLElementsFromVueRef(this.$refs.items);if(items.length>0){const popupMenuItem=items[index];logic.focus(popupMenuItem,{preventScroll:true});}},async activateItem(index){if(index<0||index>=this.popupItems.length){return;}if(index!==this.currentFocusedItemIndex){await this.setFocusOnItem(index);}this.onClickItem(this.popupItems[this.currentFocusedItemIndex]);}}});const _hoisted_1$H=["aria-label"];const _hoisted_2$w={ref:"contextmenu",role:"menu",tabindex:"-1",class:"contextmenu__list"};const _hoisted_3$q=["onClick"];const _hoisted_4$m=["tabindex"];const _hoisted_5$h={key:0,class:"contextmenu__separator"};function _sfc_render$N(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");const _component_i_popup=vue.resolveComponent("i-popup");return vue.openBlock(),vue.createBlock(_component_i_popup,{"is-open":_ctx.isOpen,"keyboard-trap":false,anchor:_ctx.anchor,"set-focus":true,"focus-element":()=>_ctx.contextmenu,inline:"never",onClose:_cache[2]||(_cache[2]=$event=>_ctx.$emit("close"))},{default:vue.withCtx(()=>[vue.createElementVNode("nav",{class:"contextmenu","aria-label":_ctx.ariaLabel,onKeyup:_cache[0]||(_cache[0]=(...args)=>_ctx.onKeyUp&&_ctx.onKeyUp(...args)),onKeydown:_cache[1]||(_cache[1]=(...args)=>_ctx.onKeyDown&&_ctx.onKeyDown(...args))},[vue.createElementVNode("ul",_hoisted_2$w,[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.popupItems,(item,index)=>{return vue.openBlock(),vue.createElementBlock("li",{key:item.key,role:"menuitem",onClick:$event=>_ctx.onClickItem(item)},[vue.createElementVNode("div",{ref_for:true,ref:"items",tabindex:_ctx.tabIndex(index),class:"contextmenu__list__item"},[_ctx.hasIcons?(vue.openBlock(),vue.createBlock(_component_f_icon,{key:0,class:"contextmenu__lefticon",name:item.icon?item.icon:"",library:item.iconLibrary?item.iconLibrary:"f"},null,8,["name","library"])):vue.createCommentVNode("v-if",true),_cache[3]||(_cache[3]=vue.createTextVNode()),vue.createElementVNode("a",{ref_for:true,ref:"anchors"},vue.toDisplayString(item.label),513/* TEXT, NEED_PATCH */)],8,_hoisted_4$m),_cache[4]||(_cache[4]=vue.createTextVNode()),_ctx.hasSeparatorAfterItemAt(index)?(vue.openBlock(),vue.createElementBlock("hr",_hoisted_5$h)):vue.createCommentVNode("v-if",true)],8,_hoisted_3$q);}),128/* KEYED_FRAGMENT */))],512/* NEED_PATCH */)],40,_hoisted_1$H)]),_:1/* STABLE */},8,["is-open","anchor","focus-element"]);}const FContextMenu=/* @__PURE__ */_export_sfc(_sfc_main$X,[["render",_sfc_render$N]]);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 injectionKeys={sharedName:Symbol("sharedName"),showDetails:Symbol("showDetails"),getFieldsetLabelText:Symbol("getFieldsetLabelText")};function useFieldset(){return{sharedName:vue.inject(injectionKeys.sharedName,void 0),showDetails:vue.inject(injectionKeys.showDetails,"never"),getFieldsetLabelText:vue.inject(injectionKeys.getFieldsetLabelText,()=>void 0)};}const _sfc_main$W=vue.defineComponent({name:"FFieldset",components:{FIcon},mixins:[TranslationMixin],props:{/**
|
|
243
243
|
* The id for the fieldset id attribute.
|
|
244
244
|
* If the prop is not set a random value will be generated.
|
|
245
245
|
*/id:{type:String,required:false,default:()=>logic.ElementIdService.generateElementId()},/**
|
|
@@ -266,7 +266,7 @@ isIndex(key,length)))){result.push(key);}}return result;}var _arrayLikeKeys=arra
|
|
|
266
266
|
*/showDetails:{type:String,default:"never",validator(value){return["never","when-selected","always"].includes(value);}}},setup(props){const slots=vue.useSlots();vue.provide(injectionKeys.sharedName,props.name);vue.provide(injectionKeys.showDetails,props.showDetails);vue.provide(injectionKeys.getFieldsetLabelText,()=>{return renderSlotText(slots.label);});},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;}},/**
|
|
267
267
|
* Workaround for NVDA-bug. Force re rendering of legend element due to NVDA not recognizing innerHTML changes.
|
|
268
268
|
* NVDA has closed the bug as it is related to the browser (works in FF): https://github.com/nvaccess/nvda/issues/13162
|
|
269
|
-
*/forceLegendUpdate(){this.legendKey++;},async updateCheckboxChildren(){await this.$nextTick();this.children=Array.from(this.$el.querySelectorAll('input[type="checkbox"]'));}}});const _hoisted_1$
|
|
269
|
+
*/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$v={key:0,class:"sr-only"};const _hoisted_3$p={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$g={key:0};const _hoisted_6$c={key:1};const _hoisted_7$b={class:"sr-separator"};const _hoisted_8$7={class:"tooltip-before","aria-hidden":"true"};const _hoisted_9$4={class:"label tooltip-before__label"};const _hoisted_10$4={key:0,class:"label__message label__message--error"};function _sfc_render$M(_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"),_cache[1]||(_cache[1]=vue.createTextVNode()),_ctx.hasCheckbox&&_ctx.children.length>1?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$v,[vue.createElementVNode("span",null,vue.toDisplayString(_ctx.numberOfCheckboxesScreenReaderText),1/* TEXT */)])):vue.createCommentVNode("v-if",true),_cache[2]||(_cache[2]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass:_ctx.descriptionClass,discreteDescriptionClass:_ctx.discreteDescriptionClass}))),_cache[3]||(_cache[3]=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$p,[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 */)),_cache[7]||(_cache[7]=vue.createTextVNode()),_ctx.hasCheckbox?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$l,[_ctx.children.length===1?(vue.openBlock(),vue.createElementBlock("span",_hoisted_5$g,vue.toDisplayString(_ctx.checkboxCheckedScreenReaderText),1/* TEXT */)):(vue.openBlock(),vue.createElementBlock("span",_hoisted_6$c,vue.toDisplayString(_ctx.numberOfCheckedCheckboxesScreenText),1/* TEXT */))])):vue.createCommentVNode("v-if",true),_cache[8]||(_cache[8]=vue.createTextVNode()),_ctx.hasTooltipSlot?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createElementVNode("div",_hoisted_7$b,[vue.createElementVNode("div",_hoisted_8$7,[vue.createElementVNode("div",_hoisted_9$4,[vue.renderSlot(_ctx.$slots,"label")])]),_cache[4]||(_cache[4]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"tooltip")]),_cache[6]||(_cache[6]=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}))),_cache[5]||(_cache[5]=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$4,[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),_cache[9]||(_cache[9]=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$W,[["render",_sfc_render$M]]);const anyType$1=[String,Object,Array,Number,Date,Boolean];const _sfc_main$V=vue.defineComponent({name:"FCheckboxField",inheritAttrs:false,props:{/**
|
|
270
270
|
* Set to `true`, empty string `""` or string `"disabled"` to disable this input field.
|
|
271
271
|
*/disabled:{type:Boolean,required:false,default:false},/**
|
|
272
272
|
* The id for the input id attribute.
|
|
@@ -281,12 +281,12 @@ isIndex(key,length)))){result.push(key);}}return result;}var _arrayLikeKeys=arra
|
|
|
281
281
|
/* include undefined (see comment on line above) */modelValue:{type:anyType$1,required:false},/**
|
|
282
282
|
* The value for the input.
|
|
283
283
|
*/value:{type:anyType$1,required:true}},emits:["change","update:modelValue"],setup(){const{showDetails,getFieldsetLabelText}=useFieldset();return{showDetails,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
|
|
284
|
-
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$
|
|
284
|
+
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$F=["id","disabled"];const _hoisted_2$u=["for"];const _hoisted_3$o={key:0,class:"checkbox__details"};const _hoisted_4$k={key:0,class:"checkbox__details"};function _sfc_render$L(_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$F),_cache[9]||(_cache[9]=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"),_cache[8]||(_cache[8]=vue.createTextVNode()),_ctx.$slots.details?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[_ctx.showDetails==="always"?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$o,[_cache[3]||(_cache[3]=vue.createElementVNode("br",null,null,-1/* HOISTED */)),_cache[4]||(_cache[4]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"details")])):vue.createCommentVNode("v-if",true),_cache[7]||(_cache[7]=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_4$k,[_cache[5]||(_cache[5]=vue.createElementVNode("br",null,null,-1/* HOISTED */)),_cache[6]||(_cache[6]=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$u)],34/* CLASS, NEED_HYDRATION */);}const FCheckboxField=/* @__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:{/**
|
|
285
285
|
* The id for the fieldset id attribute.
|
|
286
286
|
* If the prop is not set the id will be generated.
|
|
287
287
|
*/id:{type:String,required:false,default:()=>logic.ElementIdService.generateElementId()},/**
|
|
288
288
|
* The name of the checkbox group.
|
|
289
|
-
*/name:{type:String,required:true}}});function _sfc_render$K(_ctx,_cache,$props,$setup,$data,$options){const _component_f_fieldset=vue.resolveComponent("f-fieldset");return vue.openBlock(),vue.createBlock(_component_f_fieldset,vue.mergeProps({id:_ctx.id,name:_ctx.name},_ctx.$attrs),vue.createSlots({label:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"label")]),description:vue.withCtx(({descriptionClass,discreteDescriptionClass})=>[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),"error-message":vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"error-message")]),default:vue.withCtx(()=>[vue.createTextVNode(),vue.createTextVNode(),vue.createTextVNode(),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"default")]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1040,["id","name"]);}const FCheckboxGroup=/* @__PURE__ */_export_sfc(_sfc_main$U,[["render",_sfc_render$K]]);var Operation=/* @__PURE__ */(Operation2=>{Operation2[Operation2["ADD"]=0]="ADD";Operation2[Operation2["DELETE"]=1]="DELETE";Operation2[Operation2["MODIFY"]=2]="MODIFY";Operation2[Operation2["NONE"]=3]="NONE";return Operation2;})(Operation||{});const _sfc_main$T=vue.defineComponent({name:"FCrudDataset",components:{FFormModal,FConfirmModal,FIcon},mixins:[TranslationMixin],provide(){return{delete:item=>{this.deleteItem(item);},modify:item=>{this.updateItem(item);},registerCallbackAfterItemAdd:callback=>{this.callbackAfterItemAdd=callback;},registerCallbackBeforeItemDelete:callback=>{this.callbackBeforeItemDelete=callback;}};},props:{/**
|
|
289
|
+
*/name:{type:String,required:true}}});function _sfc_render$K(_ctx,_cache,$props,$setup,$data,$options){const _component_f_fieldset=vue.resolveComponent("f-fieldset");return vue.openBlock(),vue.createBlock(_component_f_fieldset,vue.mergeProps({id:_ctx.id,name:_ctx.name},_ctx.$attrs),vue.createSlots({label:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"label")]),description:vue.withCtx(({descriptionClass,discreteDescriptionClass})=>[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),"error-message":vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"error-message")]),default:vue.withCtx(()=>[_cache[0]||(_cache[0]=vue.createTextVNode()),_cache[1]||(_cache[1]=vue.createTextVNode()),_cache[2]||(_cache[2]=vue.createTextVNode()),_cache[3]||(_cache[3]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"default")]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1040,["id","name"]);}const FCheckboxGroup=/* @__PURE__ */_export_sfc(_sfc_main$U,[["render",_sfc_render$K]]);var Operation=/* @__PURE__ */(Operation2=>{Operation2[Operation2["ADD"]=0]="ADD";Operation2[Operation2["DELETE"]=1]="DELETE";Operation2[Operation2["MODIFY"]=2]="MODIFY";Operation2[Operation2["NONE"]=3]="NONE";return Operation2;})(Operation||{});const _sfc_main$T=vue.defineComponent({name:"FCrudDataset",components:{FFormModal,FConfirmModal,FIcon},mixins:[TranslationMixin],provide(){return{delete:item=>{this.deleteItem(item);},modify:item=>{this.updateItem(item);},registerCallbackAfterItemAdd:callback=>{this.callbackAfterItemAdd=callback;},registerCallbackBeforeItemDelete:callback=>{this.callbackBeforeItemDelete=callback;}};},props:{/**
|
|
290
290
|
* The list of items that should be deleted, modified or added to.
|
|
291
291
|
* If the prop is not set an empty array will be used.
|
|
292
292
|
* @model
|
|
@@ -309,7 +309,7 @@ injected(){return this;}},methods:{updateExpandedFlag(){const checkboxInput=getH
|
|
|
309
309
|
* Property for changing the "modify" modal heading
|
|
310
310
|
*/modifyModalHeader:{type:String,required:false,default:logic.TranslationService.provider.translate("fkui.crud-dataset.modal.header.modify","Ändra rad")},/**
|
|
311
311
|
* Property for changing the "delete" modal heading
|
|
312
|
-
*/deleteModalHeader:{type:String,required:false,default:logic.TranslationService.provider.translate("fkui.crud-dataset.modal.header.delete","Är du säker på att du vill ta bort raden?")}},emits:["change","created","deleted","updated","update:modelValue"],data(){return{result:[],Operation,operation:Operation.NONE,item:null,originalItemToUpdate:null,isFormModalOpen:false,isConfirmModalOpen:false,callbackAfterItemAdd(){},callbackBeforeItemDelete(){}};},computed:{confirmButtonText(){return this.operation===Operation.ADD?this.$t("fkui.crud-dataset.modal.confirm.add","Lägg till"):this.$t("fkui.crud-dataset.modal.confirm.modify","Spara");},cancelButtonText(){return this.operation===Operation.ADD?this.$t("fkui.crud-dataset.modal.cancel.add","Avbryt"):this.$t("fkui.crud-dataset.modal.cancel.modify","Avbryt");},confirmDeleteButtons(){return[{label:this.$t("fkui.crud-dataset.modal.confirm.delete","Ja, ta bort"),type:"primary",event:"confirm"},{label:this.$t("fkui.crud-dataset.modal.cancel.delete","Nej, avbryt"),type:"secondary"}];},hasAddSlot(){return Boolean(this.$slots.add);},hasDeleteSlot(){return Boolean(this.$slots.delete);},hasModifySlot(){return Boolean(this.$slots.modify);},formModalHeader(){return this.operation===Operation.ADD?this.addNewModalHeader:this.modifyModalHeader;}},watch:{modelValue:{immediate:true,deep:true,handler(data){this.result=[...data];}}},mounted(){if(!this.hasAddSlot&&!this.hasDeleteSlot&&!this.hasModifySlot){throw Error("Atleast one template of the following must be defined. #add, #delete or #modify");}},methods:{createItem(){if(!this.hasAddSlot){throw Error("No template is defined for #add");}this.operation=Operation.ADD;this.item=this.beforeCreate?this.beforeCreate():{};this.isFormModalOpen=true;},deleteItem(item){if(!this.hasDeleteSlot){throw Error("No template is defined for #delete");}this.operation=Operation.DELETE;this.item=item;this.isConfirmModalOpen=true;},onDeleteConfirm(){if(!this.item){return;}this.callbackBeforeItemDelete(this.item);this.result=this.result.filter(item=>item!==this.item);this.$emit("deleted",this.item);this.$emit("update:modelValue",this.result);this.$emit("change",this.result);logic.alertScreenReader(this.$t("fkui.crud-dataset.aria-live.delete","Raden har tagits bort"),{assertive:true});},onDeleteClose(e){this.onModalClose();if(e.reason==="close"&&this.onCancel){this.onCancel();}},onModalClose(){this.isFormModalOpen=false;this.isConfirmModalOpen=false;},onFormModalSubmit(){if(!this.item){return;}if(this.operation===Operation.ADD){this.result.push(this.item);this.$emit("created",this.item);this.$emit("update:modelValue",this.result);this.$emit("change",this.result);this.callbackAfterItemAdd(this.item);logic.alertScreenReader(this.$t("fkui.crud-dataset.aria-live.add","En rad har lagts till"),{assertive:true});}else if(this.operation===Operation.MODIFY){if(this.originalItemToUpdate){Object.assign(this.originalItemToUpdate,this.item);}else{this.originalItemToUpdate=this.item;}this.$emit("updated",this.originalItemToUpdate);this.$emit("update:modelValue",this.result);this.$emit("change",this.result);logic.alertScreenReader(this.$t("fkui.crud-dataset.aria-live.modify","Raden har ändrats"),{assertive:true});}this.isFormModalOpen=false;},updateItem(item){if(!this.hasModifySlot){throw Error("No template is defined for #modify");}this.operation=Operation.MODIFY;this.originalItemToUpdate=item;this.item=logic.deepClone(item);this.isFormModalOpen=true;}}});const _hoisted_1$F={class:"crud-dataset"};const _hoisted_2$t={key:0};function _sfc_render$J(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");const _component_f_form_modal=vue.resolveComponent("f-form-modal");const _component_f_confirm_modal=vue.resolveComponent("f-confirm-modal");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$F,[vue.renderSlot(_ctx.$slots,"default"),vue.createTextVNode(),_ctx.hasAddSlot?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$t,[vue.createElementVNode("button",{"data-test":"f-crud-dataset-add-button",type:"button",class:"button button--tertiary crud-dataset__add-button",onClick:_cache[0]||(_cache[0]=$event=>_ctx.createItem())},[vue.createVNode(_component_f_icon,{class:"button__icon",name:"plus"}),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"add-button",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.crud-dataset.button.add","Lägg till ny")),1/* TEXT */)])])])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createVNode(_component_f_form_modal,{"is-open":_ctx.isFormModalOpen,"aria-close-text":_ctx.$t("fkui.crud-dataset.modal.close","Stäng"),"use-error-list":false,"before-submit":_ctx.beforeSubmit,"before-validation":_ctx.beforeValidation,"on-cancel":_ctx.onCancel,onClose:_ctx.onModalClose,onCancel:_ctx.onCancel,onSubmit:_ctx.onFormModalSubmit},{header:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(_ctx.formModalHeader),1/* TEXT */)]),"input-text-fields":vue.withCtx(()=>[_ctx.operation===_ctx.Operation.ADD?vue.renderSlot(_ctx.$slots,"add",vue.normalizeProps(vue.mergeProps({key:0},{item:_ctx.item}))):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.operation===_ctx.Operation.MODIFY?vue.renderSlot(_ctx.$slots,"modify",vue.normalizeProps(vue.mergeProps({key:1},{item:_ctx.item}))):vue.createCommentVNode("v-if",true)]),"submit-button-text":vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(_ctx.confirmButtonText),1/* TEXT */)]),"cancel-button-text":vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(_ctx.cancelButtonText),1/* TEXT */)]),_:3/* FORWARDED */},8,["is-open","aria-close-text","before-submit","before-validation","on-cancel","onClose","onCancel","onSubmit"]),vue.createTextVNode(),vue.createVNode(_component_f_confirm_modal,{"is-open":_ctx.isConfirmModalOpen,buttons:_ctx.confirmDeleteButtons,onConfirm:_ctx.onDeleteConfirm,onClose:_ctx.onDeleteClose},{heading:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(_ctx.deleteModalHeader),1/* TEXT */)]),content:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"delete",vue.normalizeProps(vue.guardReactiveProps({item:_ctx.item})))]),_:3/* FORWARDED */},8,["is-open","buttons","onConfirm","onClose"])]);}const FCrudDataset=/* @__PURE__ */_export_sfc(_sfc_main$T,[["render",_sfc_render$J]]);function FCrudDatasetInjected(){return{delete:vue.inject("delete"),modify:vue.inject("modify")};}const _sfc_main$S=vue.defineComponent({name:"FCrudButton",components:{FIcon},mixins:[TranslationMixin],props:{action:{type:String,required:true,validator(value){return["delete","modify"].includes(value);}},icon:{type:Boolean,default:false},item:{type:Object,required:true},label:{type:Boolean,default:false}},setup(){return FCrudDatasetInjected();},computed:{iconName(){if(this.action==="delete"){return"trashcan";}else{return"pen";}},buttonText(){if(this.action==="delete"){return this.$t("fkui.crud-button.delete","Ta bort");}else{return this.$t("fkui.crud-button.modify","Ändra");}}},methods:{executeAction(){if(this.action==="delete"){this.delete(this.item);}else{this.modify(this.item);}}}});const _hoisted_1$E={key:1,class:"sr-only"};function _sfc_render$I(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("button",{type:"button",class:"button button--small button--tertiary",onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.executeAction&&_ctx.executeAction(...args))},[_ctx.icon?(vue.openBlock(),vue.createBlock(_component_f_icon,{key:0,class:"button__icon",name:_ctx.iconName},null,8,["name"])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),!_ctx.label?(vue.openBlock(),vue.createElementBlock("span",_hoisted_1$E,[vue.renderSlot(_ctx.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.buttonText),1/* TEXT */)])])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.label?vue.renderSlot(_ctx.$slots,"default",{key:2},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.buttonText),1/* TEXT */)]):vue.createCommentVNode("v-if",true)]);}const FCrudButton=/* @__PURE__ */_export_sfc(_sfc_main$S,[["render",_sfc_render$I]]);function ActivateItemInjected(){return{registerCallbackAfterItemAdd:vue.inject("registerCallbackAfterItemAdd",()=>void 0),registerCallbackBeforeItemDelete:vue.inject("registerCallbackBeforeItemDelete",()=>void 0)};}var FTableColumnType=/* @__PURE__ */(FTableColumnType2=>{FTableColumnType2["TEXT"]="text";FTableColumnType2["DATE"]="date";FTableColumnType2["NUMERIC"]="numeric";FTableColumnType2["ACTION"]="action";return FTableColumnType2;})(FTableColumnType||{});var FTableColumnSize=/* @__PURE__ */(FTableColumnSize2=>{FTableColumnSize2["EXPAND"]="table__column--expand";FTableColumnSize2["SHRINK"]="table__column--shrink";return FTableColumnSize2;})(FTableColumnSize||{});var FTableColumnSort=/* @__PURE__ */(FTableColumnSort2=>{FTableColumnSort2["UNSORTED"]="unsorted";FTableColumnSort2["ASCENDING"]="ascending";FTableColumnSort2["DESCENDING"]="descending";return FTableColumnSort2;})(FTableColumnSort||{});function addColumn(src,column){if(!src.some(col=>col.name===column.name)){return[...src,column];}return src;}function setVisibilityColumn(src,id,visible){const column=src.find(col=>col.name===id);if(column){column.visible=visible;}}function updateSortOrder(src,columnName,ascending){src.forEach(column=>{if(column.name===columnName){column.sort=ascending?"ascending":"descending";}else{column.sort="unsorted";}});}function setSortableColumns(src,columnNames){for(const columnName of columnNames){const foundColumn=src.find(col=>col.name===columnName);if(foundColumn){foundColumn.sortable=true;}}}function getSortableIconName(column){switch(column.sort){case"unsorted":return"sort";case"ascending":return"caret-up";case"descending":return"caret-down";default:return"";}}function getSortableIconClasses(column){const classes=["table__column__header__icon"];if(column.sort==="unsorted"){classes.push("table__column__header__icon--discrete");}return classes;}function isTableColumnType(value){return["text","date","numeric","action"].includes(value);}function FTableInjected(){return{addColumn:vue.inject("addColumn"),setVisibilityColumn:vue.inject("setVisibilityColumn"),textFieldTableMode:true};}const _sfc_main$R=vue.defineComponent({name:"FTableColumn",inheritAttrs:false,props:{/**
|
|
312
|
+
*/deleteModalHeader:{type:String,required:false,default:logic.TranslationService.provider.translate("fkui.crud-dataset.modal.header.delete","Är du säker på att du vill ta bort raden?")}},emits:["change","created","deleted","updated","update:modelValue"],data(){return{result:[],Operation,operation:Operation.NONE,item:null,originalItemToUpdate:null,isFormModalOpen:false,isConfirmModalOpen:false,callbackAfterItemAdd(){},callbackBeforeItemDelete(){}};},computed:{confirmButtonText(){return this.operation===Operation.ADD?this.$t("fkui.crud-dataset.modal.confirm.add","Lägg till"):this.$t("fkui.crud-dataset.modal.confirm.modify","Spara");},cancelButtonText(){return this.operation===Operation.ADD?this.$t("fkui.crud-dataset.modal.cancel.add","Avbryt"):this.$t("fkui.crud-dataset.modal.cancel.modify","Avbryt");},confirmDeleteButtons(){return[{label:this.$t("fkui.crud-dataset.modal.confirm.delete","Ja, ta bort"),type:"primary",event:"confirm"},{label:this.$t("fkui.crud-dataset.modal.cancel.delete","Nej, avbryt"),type:"secondary"}];},hasAddSlot(){return Boolean(this.$slots.add);},hasDeleteSlot(){return Boolean(this.$slots.delete);},hasModifySlot(){return Boolean(this.$slots.modify);},formModalHeader(){return this.operation===Operation.ADD?this.addNewModalHeader:this.modifyModalHeader;}},watch:{modelValue:{immediate:true,deep:true,handler(data){this.result=[...data];}}},mounted(){if(!this.hasAddSlot&&!this.hasDeleteSlot&&!this.hasModifySlot){throw Error("Atleast one template of the following must be defined. #add, #delete or #modify");}},methods:{createItem(){if(!this.hasAddSlot){throw Error("No template is defined for #add");}this.operation=Operation.ADD;this.item=this.beforeCreate?this.beforeCreate():{};this.isFormModalOpen=true;},deleteItem(item){if(!this.hasDeleteSlot){throw Error("No template is defined for #delete");}this.operation=Operation.DELETE;this.item=item;this.isConfirmModalOpen=true;},onDeleteConfirm(){if(!this.item){return;}this.callbackBeforeItemDelete(this.item);this.result=this.result.filter(item=>item!==this.item);this.$emit("deleted",this.item);this.$emit("update:modelValue",this.result);this.$emit("change",this.result);logic.alertScreenReader(this.$t("fkui.crud-dataset.aria-live.delete","Raden har tagits bort"),{assertive:true});},onDeleteClose(e){this.onModalClose();if(e.reason==="close"&&this.onCancel){this.onCancel();}},onModalClose(){this.isFormModalOpen=false;this.isConfirmModalOpen=false;},onFormModalSubmit(){if(!this.item){return;}if(this.operation===Operation.ADD){this.result.push(this.item);this.$emit("created",this.item);this.$emit("update:modelValue",this.result);this.$emit("change",this.result);this.callbackAfterItemAdd(this.item);logic.alertScreenReader(this.$t("fkui.crud-dataset.aria-live.add","En rad har lagts till"),{assertive:true});}else if(this.operation===Operation.MODIFY){if(this.originalItemToUpdate){Object.assign(this.originalItemToUpdate,this.item);}else{this.originalItemToUpdate=this.item;}this.$emit("updated",this.originalItemToUpdate);this.$emit("update:modelValue",this.result);this.$emit("change",this.result);logic.alertScreenReader(this.$t("fkui.crud-dataset.aria-live.modify","Raden har ändrats"),{assertive:true});}this.isFormModalOpen=false;},updateItem(item){if(!this.hasModifySlot){throw Error("No template is defined for #modify");}this.operation=Operation.MODIFY;this.originalItemToUpdate=item;this.item=logic.deepClone(item);this.isFormModalOpen=true;}}});const _hoisted_1$E={class:"crud-dataset"};const _hoisted_2$t={key:0};function _sfc_render$J(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");const _component_f_form_modal=vue.resolveComponent("f-form-modal");const _component_f_confirm_modal=vue.resolveComponent("f-confirm-modal");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$E,[vue.renderSlot(_ctx.$slots,"default"),_cache[7]||(_cache[7]=vue.createTextVNode()),_ctx.hasAddSlot?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$t,[vue.createElementVNode("button",{"data-test":"f-crud-dataset-add-button",type:"button",class:"button button--tertiary crud-dataset__add-button",onClick:_cache[0]||(_cache[0]=$event=>_ctx.createItem())},[vue.createVNode(_component_f_icon,{class:"button__icon",name:"plus"}),_cache[1]||(_cache[1]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"add-button",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.crud-dataset.button.add","Lägg till ny")),1/* TEXT */)])])])):vue.createCommentVNode("v-if",true),_cache[8]||(_cache[8]=vue.createTextVNode()),vue.createVNode(_component_f_form_modal,{"is-open":_ctx.isFormModalOpen,"aria-close-text":_ctx.$t("fkui.crud-dataset.modal.close","Stäng"),"use-error-list":false,"before-submit":_ctx.beforeSubmit,"before-validation":_ctx.beforeValidation,"on-cancel":_ctx.onCancel,onClose:_ctx.onModalClose,onCancel:_ctx.onCancel,onSubmit:_ctx.onFormModalSubmit},{header:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(_ctx.formModalHeader),1/* TEXT */)]),"input-text-fields":vue.withCtx(()=>[_ctx.operation===_ctx.Operation.ADD?vue.renderSlot(_ctx.$slots,"add",vue.normalizeProps(vue.mergeProps({key:0},{item:_ctx.item}))):vue.createCommentVNode("v-if",true),_cache[2]||(_cache[2]=vue.createTextVNode()),_ctx.operation===_ctx.Operation.MODIFY?vue.renderSlot(_ctx.$slots,"modify",vue.normalizeProps(vue.mergeProps({key:1},{item:_ctx.item}))):vue.createCommentVNode("v-if",true)]),"submit-button-text":vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(_ctx.confirmButtonText),1/* TEXT */)]),"cancel-button-text":vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(_ctx.cancelButtonText),1/* TEXT */)]),_:3/* FORWARDED */},8,["is-open","aria-close-text","before-submit","before-validation","on-cancel","onClose","onCancel","onSubmit"]),_cache[9]||(_cache[9]=vue.createTextVNode()),vue.createVNode(_component_f_confirm_modal,{"is-open":_ctx.isConfirmModalOpen,buttons:_ctx.confirmDeleteButtons,onConfirm:_ctx.onDeleteConfirm,onClose:_ctx.onDeleteClose},{heading:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(_ctx.deleteModalHeader),1/* TEXT */)]),content:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"delete",vue.normalizeProps(vue.guardReactiveProps({item:_ctx.item})))]),_:3/* FORWARDED */},8,["is-open","buttons","onConfirm","onClose"])]);}const FCrudDataset=/* @__PURE__ */_export_sfc(_sfc_main$T,[["render",_sfc_render$J]]);function FCrudDatasetInjected(){return{delete:vue.inject("delete"),modify:vue.inject("modify")};}const _sfc_main$S=vue.defineComponent({name:"FCrudButton",components:{FIcon},mixins:[TranslationMixin],props:{action:{type:String,required:true,validator(value){return["delete","modify"].includes(value);}},icon:{type:Boolean,default:false},item:{type:Object,required:true},label:{type:Boolean,default:false}},setup(){return FCrudDatasetInjected();},computed:{iconName(){if(this.action==="delete"){return"trashcan";}else{return"pen";}},buttonText(){if(this.action==="delete"){return this.$t("fkui.crud-button.delete","Ta bort");}else{return this.$t("fkui.crud-button.modify","Ändra");}}},methods:{executeAction(){if(this.action==="delete"){this.delete(this.item);}else{this.modify(this.item);}}}});const _hoisted_1$D={key:1,class:"sr-only"};function _sfc_render$I(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("button",{type:"button",class:"button button--small button--tertiary",onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.executeAction&&_ctx.executeAction(...args))},[_ctx.icon?(vue.openBlock(),vue.createBlock(_component_f_icon,{key:0,class:"button__icon",name:_ctx.iconName},null,8,["name"])):vue.createCommentVNode("v-if",true),_cache[1]||(_cache[1]=vue.createTextVNode()),!_ctx.label?(vue.openBlock(),vue.createElementBlock("span",_hoisted_1$D,[vue.renderSlot(_ctx.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.buttonText),1/* TEXT */)])])):vue.createCommentVNode("v-if",true),_cache[2]||(_cache[2]=vue.createTextVNode()),_ctx.label?vue.renderSlot(_ctx.$slots,"default",{key:2},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.buttonText),1/* TEXT */)]):vue.createCommentVNode("v-if",true)]);}const FCrudButton=/* @__PURE__ */_export_sfc(_sfc_main$S,[["render",_sfc_render$I]]);function ActivateItemInjected(){return{registerCallbackAfterItemAdd:vue.inject("registerCallbackAfterItemAdd",()=>void 0),registerCallbackBeforeItemDelete:vue.inject("registerCallbackBeforeItemDelete",()=>void 0)};}var FTableColumnType=/* @__PURE__ */(FTableColumnType2=>{FTableColumnType2["TEXT"]="text";FTableColumnType2["DATE"]="date";FTableColumnType2["NUMERIC"]="numeric";FTableColumnType2["ACTION"]="action";return FTableColumnType2;})(FTableColumnType||{});var FTableColumnSize=/* @__PURE__ */(FTableColumnSize2=>{FTableColumnSize2["EXPAND"]="table__column--expand";FTableColumnSize2["SHRINK"]="table__column--shrink";return FTableColumnSize2;})(FTableColumnSize||{});var FTableColumnSort=/* @__PURE__ */(FTableColumnSort2=>{FTableColumnSort2["UNSORTED"]="unsorted";FTableColumnSort2["ASCENDING"]="ascending";FTableColumnSort2["DESCENDING"]="descending";return FTableColumnSort2;})(FTableColumnSort||{});function addColumn(src,column){if(!src.some(col=>col.name===column.name)){return[...src,column];}return src;}function setVisibilityColumn(src,id,visible){const column=src.find(col=>col.name===id);if(column){column.visible=visible;}}function updateSortOrder(src,columnName,ascending){src.forEach(column=>{if(column.name===columnName){column.sort=ascending?"ascending":"descending";}else{column.sort="unsorted";}});}function setSortableColumns(src,columnNames){for(const columnName of columnNames){const foundColumn=src.find(col=>col.name===columnName);if(foundColumn){foundColumn.sortable=true;}}}function getSortableIconName(column){switch(column.sort){case"unsorted":return"sort";case"ascending":return"caret-up";case"descending":return"caret-down";default:return"";}}function getSortableIconClasses(column){const classes=["table__column__header__icon"];if(column.sort==="unsorted"){classes.push("table__column__header__icon--discrete");}return classes;}function isTableColumnType(value){return["text","date","numeric","action"].includes(value);}function FTableInjected(){return{addColumn:vue.inject("addColumn"),setVisibilityColumn:vue.inject("setVisibilityColumn"),textFieldTableMode:true,renderColumns:vue.inject("renderColumns",false)};}const _sfc_main$R=vue.defineComponent({name:"FTableColumn",inheritAttrs:false,props:{/**
|
|
313
313
|
* Unique (per-table) identifier.
|
|
314
314
|
*
|
|
315
315
|
* Typically set to the row property displayed but any unique string can
|
|
@@ -345,9 +345,9 @@ injected(){return this;}},methods:{updateExpandedFlag(){const checkboxInput=getH
|
|
|
345
345
|
* - `"date"`: date (should be YYYY-MM-DD)
|
|
346
346
|
* - `"numeric"`: numeric data
|
|
347
347
|
* - `"action"`: buttons to perform actions on row
|
|
348
|
-
*/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});}});
|
|
348
|
+
*/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});}});function _sfc_render$H(_ctx,_cache,$props,$setup,$data,$options){return _ctx.renderColumns&&_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"),_cache[0]||(_cache[0]=vue.createTextVNode()),_cache[1]||(_cache[1]=vue.createElementVNode("span",{class:"sr-only"}," ",-1/* HOISTED */))]),_: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:{/**
|
|
349
349
|
* The id for the form element the label is bound to.
|
|
350
|
-
*/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$
|
|
350
|
+
*/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$n=["for"];const _hoisted_4$j=["for"];const _hoisted_5$f={key:0,class:"label__message label__message--error"};const _hoisted_6$b=["for"];const _hoisted_7$a={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$n)])):vue.createCommentVNode("v-if",true),_cache[2]||(_cache[2]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"tooltip"),_cache[3]||(_cache[3]=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}))),_cache[1]||(_cache[1]=vue.createTextVNode()),_ctx.hasErrorMessageSlot?(vue.openBlock(),vue.createElementBlock("span",_hoisted_5$f,[vue.createVNode(_component_f_icon,{class:"label__icon--left",name:"error"}),_cache[0]||(_cache[0]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"error-message")])):vue.createCommentVNode("v-if",true)],8,_hoisted_4$j)):vue.createCommentVNode("v-if",true)])):(vue.openBlock(),vue.createElementBlock("label",{key:1,class:"label",for:_ctx.forProperty},[vue.renderSlot(_ctx.$slots,"default"),_cache[5]||(_cache[5]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass:_ctx.descriptionClass,discreteDescriptionClass:_ctx.discreteDescriptionClass}))),_cache[6]||(_cache[6]=vue.createTextVNode()),_ctx.hasErrorMessageSlot?(vue.openBlock(),vue.createElementBlock("span",_hoisted_7$a,[vue.createVNode(_component_f_icon,{class:"label__icon--left",name:"error"}),_cache[4]||(_cache[4]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"error-message")])):vue.createCommentVNode("v-if",true)],8,_hoisted_6$b));}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:{/**
|
|
351
351
|
* The id for the select id attribute.
|
|
352
352
|
* The id for the label for attribute.
|
|
353
353
|
* If the prop is not set a random value will be generated.
|
|
@@ -370,13 +370,13 @@ injected(){return this;}},methods:{updateExpandedFlag(){const checkboxInput=getH
|
|
|
370
370
|
* select-width="md-6 lg-3"
|
|
371
371
|
* ```
|
|
372
372
|
*/selectWidth:{type:String,required:false,default:"sm-12"}},emits:["change","update:modelValue"],setup(){return{textFieldTableMode:vue.inject("textFieldTableMode",false)};},data(){return{validityMode:"INITIAL",validationMessage:""};},computed:{attrs(){return{...this.$attrs,// Disable change
|
|
373
|
-
onChange:()=>void 0};},hasError(){return this.validityMode==="ERROR";},rootClass(){return{["select-field--error"]:this.hasError,["select-field--inline"]:this.inline,["text-field--table"]:this.textFieldTableMode,["select-field--table-error"]:this.textFieldTableMode&&this.hasError};},labelClass(){return this.textFieldTableMode?"sr-only":"";},labelWrapperClass(){return resolveWidthClass$1(this.labelWidth,this.inline);},selectWrapperClass(){return resolveWidthClass$1(this.selectWidth,this.inline);},vModel:{get(){return this.modelValue;},set(value){this.$emit("update:modelValue",value);this.$emit("change",value);}}},methods:{async onValidity({detail}){var _renderSlotText3;this.validationMessage=detail.validationMessage;this.validityMode=detail.validityMode;await this.$nextTick();const errorMessage=(_renderSlotText3=renderSlotText(this.$slots.label))!==null&&_renderSlotText3!==void 0?_renderSlotText3:"";const element=this.$el.querySelector(`#${detail.elementId}`);if(element){dispatchComponentValidityEvent(element,{...detail,errorMessage,focusElementId:detail.elementId});}}}});const _hoisted_1$B=["id"];function _sfc_render$F(_ctx,_cache,$props,$setup,$data,$options){const _component_f_label=vue.resolveComponent("f-label");const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["select-field",_ctx.rootClass]),onValidity:_cache[1]||(_cache[1]=(...args)=>_ctx.onValidity&&_ctx.onValidity(...args))},[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,"label")]),description:vue.withCtx(({descriptionClass,discreteDescriptionClass})=>[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),"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(["select-field__icon-wrapper",_ctx.selectWrapperClass])},[vue.withDirectives(vue.createElementVNode("select",vue.mergeProps({id:_ctx.id,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>_ctx.vModel=$event),class:"select-field__select"},_ctx.attrs),[vue.renderSlot(_ctx.$slots,"default")],16,_hoisted_1$B),[[vue.vModelSelect,_ctx.vModel]]),vue.createTextVNode(),_ctx.hasError&&_ctx.textFieldTableMode?(vue.openBlock(),vue.createBlock(_component_f_icon,{key:0,ref:"icon",class:"text-field__icon input-icon select-field__error-popup-icon",name:"error"},null,512/* NEED_PATCH */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createVNode(_component_f_icon,{class:"select-field__icon",name:"arrow-down"})],2/* CLASS */)],34/* CLASS, NEED_HYDRATION */);}const FSelectField=/* @__PURE__ */_export_sfc(_sfc_main$P,[["render",_sfc_render$F]]);function computeArrowOffset(placement,inputIconRect,wrapperRect){switch(placement){case Placement.A:{const wrapperRightX=wrapperRect.x+wrapperRect.width;const iconCenterX=inputIconRect.x+inputIconRect.width/2;const offset2=wrapperRightX-iconCenterX;return{position:"top",offset:offset2};}case Placement.B:{const offset2=wrapperRect.x+wrapperRect.width-(inputIconRect.x+inputIconRect.width/2);return{position:"top",offset:offset2};}case Placement.C:{const wrapperRightX=wrapperRect.x+wrapperRect.width;const iconCenterX=inputIconRect.x+inputIconRect.width/2;const offset2=wrapperRightX-iconCenterX;return{position:"bottom",offset:offset2};}case Placement.D:{const offset2=wrapperRect.x+wrapperRect.width-(inputIconRect.x+inputIconRect.width/2);return{position:"bottom",offset:offset2};}case Placement.E:{const offset2=wrapperRect.y+wrapperRect.height-(inputIconRect.y+inputIconRect.height/2);return{position:"left",offset:offset2};}case Placement.F:{const offset2=wrapperRect.y+wrapperRect.height-(inputIconRect.y+inputIconRect.height/2);return{position:"right",offset:offset2};}case Placement.G:case Placement.H:case Placement.I:case Placement.Fallback:case Placement.NotCalculated:{const offset2=wrapperRect.x+wrapperRect.width-(inputIconRect.x+inputIconRect.width/2);return{position:"top",offset:offset2};}}}const POPUP_SPACING=10;const _sfc_main$O=vue.defineComponent({name:"IPopupError",components:{FIcon},inheritAttrs:false,props:{/**
|
|
373
|
+
onChange:()=>void 0};},hasError(){return this.validityMode==="ERROR";},rootClass(){return{["select-field--error"]:this.hasError,["select-field--inline"]:this.inline,["text-field--table"]:this.textFieldTableMode,["select-field--table-error"]:this.textFieldTableMode&&this.hasError};},labelClass(){return this.textFieldTableMode?"sr-only":"";},labelWrapperClass(){return resolveWidthClass$1(this.labelWidth,this.inline);},selectWrapperClass(){return resolveWidthClass$1(this.selectWidth,this.inline);},vModel:{get(){return this.modelValue;},set(value){this.$emit("update:modelValue",value);this.$emit("change",value);}}},methods:{async onValidity({detail}){var _renderSlotText3;this.validationMessage=detail.validationMessage;this.validityMode=detail.validityMode;await this.$nextTick();const errorMessage=(_renderSlotText3=renderSlotText(this.$slots.label))!==null&&_renderSlotText3!==void 0?_renderSlotText3:"";const element=this.$el.querySelector(`#${detail.elementId}`);if(element){dispatchComponentValidityEvent(element,{...detail,errorMessage,focusElementId:detail.elementId});}}}});const _hoisted_1$B=["id"];function _sfc_render$F(_ctx,_cache,$props,$setup,$data,$options){const _component_f_label=vue.resolveComponent("f-label");const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["select-field",_ctx.rootClass]),onValidity:_cache[1]||(_cache[1]=(...args)=>_ctx.onValidity&&_ctx.onValidity(...args))},[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,"label")]),description:vue.withCtx(({descriptionClass,discreteDescriptionClass})=>[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),"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 */),_cache[7]||(_cache[7]=vue.createTextVNode()),vue.createElementVNode("div",{class:vue.normalizeClass(["select-field__icon-wrapper",_ctx.selectWrapperClass])},[vue.withDirectives(vue.createElementVNode("select",vue.mergeProps({id:_ctx.id,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>_ctx.vModel=$event),class:"select-field__select"},_ctx.attrs),[vue.renderSlot(_ctx.$slots,"default")],16,_hoisted_1$B),[[vue.vModelSelect,_ctx.vModel]]),_cache[5]||(_cache[5]=vue.createTextVNode()),_ctx.hasError&&_ctx.textFieldTableMode?(vue.openBlock(),vue.createBlock(_component_f_icon,{key:0,ref:"icon",class:"text-field__icon input-icon select-field__error-popup-icon",name:"error"},null,512/* NEED_PATCH */)):vue.createCommentVNode("v-if",true),_cache[6]||(_cache[6]=vue.createTextVNode()),vue.createVNode(_component_f_icon,{class:"select-field__icon",name:"arrow-down"})],2/* CLASS */)],34/* CLASS, NEED_HYDRATION */);}const FSelectField=/* @__PURE__ */_export_sfc(_sfc_main$P,[["render",_sfc_render$F]]);function computeArrowOffset(placement,inputIconRect,wrapperRect){switch(placement){case Placement.A:{const wrapperRightX=wrapperRect.x+wrapperRect.width;const iconCenterX=inputIconRect.x+inputIconRect.width/2;const offset2=wrapperRightX-iconCenterX;return{position:"top",offset:offset2};}case Placement.B:{const offset2=wrapperRect.x+wrapperRect.width-(inputIconRect.x+inputIconRect.width/2);return{position:"top",offset:offset2};}case Placement.C:{const wrapperRightX=wrapperRect.x+wrapperRect.width;const iconCenterX=inputIconRect.x+inputIconRect.width/2;const offset2=wrapperRightX-iconCenterX;return{position:"bottom",offset:offset2};}case Placement.D:{const offset2=wrapperRect.x+wrapperRect.width-(inputIconRect.x+inputIconRect.width/2);return{position:"bottom",offset:offset2};}case Placement.E:{const offset2=wrapperRect.y+wrapperRect.height-(inputIconRect.y+inputIconRect.height/2);return{position:"left",offset:offset2};}case Placement.F:{const offset2=wrapperRect.y+wrapperRect.height-(inputIconRect.y+inputIconRect.height/2);return{position:"right",offset:offset2};}case Placement.G:case Placement.H:case Placement.I:case Placement.Fallback:case Placement.NotCalculated:{const offset2=wrapperRect.x+wrapperRect.width-(inputIconRect.x+inputIconRect.width/2);return{position:"top",offset:offset2};}}}const POPUP_SPACING=10;const _sfc_main$O=vue.defineComponent({name:"IPopupError",components:{FIcon},inheritAttrs:false,props:{/**
|
|
374
374
|
* Toggle open/closed error popup.
|
|
375
375
|
*/isOpen:{type:Boolean,required:true},/**
|
|
376
376
|
* Message to display
|
|
377
377
|
*/errorMessage:{type:String,required:false,default:"Error"},/**
|
|
378
378
|
* DOM element to position error popup at.
|
|
379
|
-
*/anchor:{type:HTMLElement,required:false,default:void 0}},emits:["close"],data(){return{teleportDisabled:false,placement:Placement.NotCalculated,arrowPosition:"top",arrowOffset:24};},computed:{popupClasses(){const forceInline=this.teleportDisabled||this.placement===Placement.Fallback;const popupState=forceInline?["popup-error--inline"]:["popup-error--overlay"];return["popup-error",...popupState];},arrowClass(){return`popup-error popup-error--arrow popup-error--${this.arrowPosition}`;},errorStyle(){return`--i-popup-error-offset: ${this.arrowOffset}px`;}},watch:{anchor:{immediate:true,handler(anchor){if(anchor){anchor.addEventListener("keyup",this.onKeyEsc);window.addEventListener("resize",this.onResize);}}},isOpen:{immediate:true,async handler(value){await this.toggleIsOpen(value);}}},unmounted(){var _a;(_a=this.anchor)==null?void 0:_a.removeEventListener("keyup",this.onKeyEsc);window.removeEventListener("resize",this.onResize);},methods:{onResize(){this.toggleIsOpen(this.isOpen);},onKeyEsc(event){if(event.key==="Escape"){this.$emit("close");}},onClose(){this.$emit("close");},setArrowOffset(){var _a;const wrapper=this.$refs["wrapper"];const inputIcon=(_a=this.anchor)==null?void 0:_a.nextElementSibling;if(!inputIcon||!wrapper){return;}const inputIconRect=inputIcon.getBoundingClientRect();const wrapperRect=wrapper.getBoundingClientRect();const arrow=computeArrowOffset(this.placement,inputIconRect,wrapperRect);this.arrowOffset=arrow.offset;this.arrowPosition=arrow.position;},async toggleIsOpen(isOpen){if(!isOpen){this.placement=Placement.NotCalculated;return;}await this.$nextTick();const wrapper=this.$refs["wrapper"];if(!this.anchor){throw new Error("No anchor element found");}const area=document.body;const viewport=document.documentElement;const result=fitInsideArea({area,anchor:this.anchor,target:wrapper,viewport,spacing:POPUP_SPACING,candidateOrder:CandidateOrder.IPopupError});this.placement=result.placement;if(result.placement!==Placement.Fallback){this.teleportDisabled=false;wrapper.style.left=`${result.x}px`;wrapper.style.top=`${result.y}px`;await this.setArrowOffset();return;}await this.setArrowOffset();this.teleportDisabled=true;wrapper.style.removeProperty("left");wrapper.style.removeProperty("top");}}});const _hoisted_1$A={ref:"wrapper",class:"popup-error__wrapper"};function _sfc_render$E(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return _ctx.isOpen?(vue.openBlock(),vue.createBlock(vue.Teleport,{key:0,to:"body",disabled:_ctx.teleportDisabled},[vue.createElementVNode("div",{ref:"popup",class:vue.normalizeClass(_ctx.popupClasses),"aria-hidden":"true"},[vue.createElementVNode("div",_hoisted_1$A,[vue.createElementVNode("div",{class:vue.normalizeClass(_ctx.arrowClass),style:vue.normalizeStyle(_ctx.errorStyle)},[vue.createElementVNode("span",null,vue.toDisplayString(_ctx.errorMessage),1/* TEXT */),vue.createTextVNode(),vue.createElementVNode("button",{tabindex:"-1",type:"button",class:"button button--discrete button--discrete--black modal__close-button popup-error__button","aria-label":"Stäng",onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.onClose&&_ctx.onClose(...args))},[vue.createVNode(_component_f_icon,{name:"close",class:"button__icon"})])],6/* CLASS, STYLE */)],512/* NEED_PATCH */)],2/* CLASS */)],8,["disabled"])):vue.createCommentVNode("v-if",true);}const IPopupError=/* @__PURE__ */_export_sfc(_sfc_main$O,[["render",_sfc_render$E]]);function resolveWidthClass(words,inline){return inline?void 0:words.split(" ").map(word=>`i-width-${word}`).join(" ");}const _sfc_main$N=vue.defineComponent({name:"FTextField",components:{FLabel,FIcon,IPopupError},inheritAttrs:false,props:{/**
|
|
379
|
+
*/anchor:{type:HTMLElement,required:false,default:void 0}},emits:["close"],data(){return{teleportDisabled:false,placement:Placement.NotCalculated,arrowPosition:"top",arrowOffset:24};},computed:{popupClasses(){const forceInline=this.teleportDisabled||this.placement===Placement.Fallback;const popupState=forceInline?["popup-error--inline"]:["popup-error--overlay"];return["popup-error",...popupState];},arrowClass(){return`popup-error popup-error--arrow popup-error--${this.arrowPosition}`;},errorStyle(){return`--i-popup-error-offset: ${this.arrowOffset}px`;}},watch:{anchor:{immediate:true,handler(anchor){if(anchor){anchor.addEventListener("keyup",this.onKeyEsc);window.addEventListener("resize",this.onResize);}}},isOpen:{immediate:true,async handler(value){await this.toggleIsOpen(value);}}},unmounted(){var _a;(_a=this.anchor)==null?void 0:_a.removeEventListener("keyup",this.onKeyEsc);window.removeEventListener("resize",this.onResize);},methods:{onResize(){this.toggleIsOpen(this.isOpen);},onKeyEsc(event){if(event.key==="Escape"){this.$emit("close");}},onClose(){this.$emit("close");},setArrowOffset(){var _a;const wrapper=this.$refs["wrapper"];const inputIcon=(_a=this.anchor)==null?void 0:_a.nextElementSibling;if(!inputIcon||!wrapper){return;}const inputIconRect=inputIcon.getBoundingClientRect();const wrapperRect=wrapper.getBoundingClientRect();const arrow=computeArrowOffset(this.placement,inputIconRect,wrapperRect);this.arrowOffset=arrow.offset;this.arrowPosition=arrow.position;},async toggleIsOpen(isOpen){if(!isOpen){this.placement=Placement.NotCalculated;return;}await this.$nextTick();const wrapper=this.$refs["wrapper"];if(!this.anchor){throw new Error("No anchor element found");}const area=document.body;const viewport=document.documentElement;const result=fitInsideArea({area,anchor:this.anchor,target:wrapper,viewport,spacing:POPUP_SPACING,candidateOrder:CandidateOrder.IPopupError});this.placement=result.placement;if(result.placement!==Placement.Fallback){this.teleportDisabled=false;wrapper.style.left=`${result.x}px`;wrapper.style.top=`${result.y}px`;await this.setArrowOffset();return;}await this.setArrowOffset();this.teleportDisabled=true;wrapper.style.removeProperty("left");wrapper.style.removeProperty("top");}}});const _hoisted_1$A={ref:"wrapper",class:"popup-error__wrapper"};function _sfc_render$E(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return _ctx.isOpen?(vue.openBlock(),vue.createBlock(vue.Teleport,{key:0,to:"body",disabled:_ctx.teleportDisabled},[vue.createElementVNode("div",{ref:"popup",class:vue.normalizeClass(_ctx.popupClasses),"aria-hidden":"true"},[vue.createElementVNode("div",_hoisted_1$A,[vue.createElementVNode("div",{class:vue.normalizeClass(_ctx.arrowClass),style:vue.normalizeStyle(_ctx.errorStyle)},[vue.createElementVNode("span",null,vue.toDisplayString(_ctx.errorMessage),1/* TEXT */),_cache[1]||(_cache[1]=vue.createTextVNode()),vue.createElementVNode("button",{tabindex:"-1",type:"button",class:"button button--discrete button--discrete--black modal__close-button popup-error__button","aria-label":"Stäng",onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.onClose&&_ctx.onClose(...args))},[vue.createVNode(_component_f_icon,{name:"close",class:"button__icon"})])],6/* CLASS, STYLE */)],512/* NEED_PATCH */)],2/* CLASS */)],8,["disabled"])):vue.createCommentVNode("v-if",true);}const IPopupError=/* @__PURE__ */_export_sfc(_sfc_main$O,[["render",_sfc_render$E]]);function resolveWidthClass(words,inline){return inline?void 0:words.split(" ").map(word=>`i-width-${word}`).join(" ");}const _sfc_main$N=vue.defineComponent({name:"FTextField",components:{FLabel,FIcon,IPopupError},inheritAttrs:false,props:{/**
|
|
380
380
|
* The id for the input id attribute.
|
|
381
381
|
* The id for the label for attribute.
|
|
382
382
|
* If the prop is not set a random value will be generated.
|
|
@@ -421,7 +421,7 @@ type:Function,required:false,default:void 0},/**
|
|
|
421
421
|
* input-width="md-6 lg-3"
|
|
422
422
|
* ```
|
|
423
423
|
*/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
|
|
424
|
-
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$
|
|
424
|
+
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$m={key:0,class:"sr-only"};const _hoisted_4$i={class:"text-field__icon-wrapper"};const _hoisted_5$e=["id","type"];const _hoisted_6$a={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),_cache[6]||(_cache[6]=vue.createTextVNode()),vue.createElementVNode("span",null,vue.toDisplayString(_ctx.descriptionText),1/* TEXT */)],2/* CLASS */)):vue.createCommentVNode("v-if",true),_cache[8]||(_cache[8]=vue.createTextVNode()),_ctx.discreteDescriptionText?(vue.openBlock(),vue.createElementBlock("span",{key:1,class:vue.normalizeClass(discreteDescriptionClass)},[_ctx.discreteDescriptionScreenReaderText?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$m,vue.toDisplayString(_ctx.discreteDescriptionScreenReaderText),1/* TEXT */)):vue.createCommentVNode("v-if",true),_cache[7]||(_cache[7]=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 */),_cache[17]||(_cache[17]=vue.createTextVNode()),vue.createElementVNode("div",{class:vue.normalizeClass(["text-field__input-wrapper",_ctx.inputWrapperClass])},[vue.renderSlot(_ctx.$slots,"input-left"),_cache[15]||(_cache[15]=vue.createTextVNode()),vue.createElementVNode("div",_hoisted_4$i,[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$e),[[vue.vModelDynamic,_ctx.viewValue]]),_cache[12]||(_cache[12]=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),_cache[13]||(_cache[13]=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),_cache[14]||(_cache[14]=vue.createTextVNode()),_ctx.$slots["append-inner"]?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$a,[vue.renderSlot(_ctx.$slots,"append-inner")])):vue.createCommentVNode("v-if",true)]),_cache[16]||(_cache[16]=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:{/**
|
|
425
425
|
* The id for the input id attribute.
|
|
426
426
|
* The id for the label for attribute.
|
|
427
427
|
* If the prop is not set a random value will be generated.
|
|
@@ -432,7 +432,7 @@ defaultText:"",descriptionText:"",descriptionScreenReaderText:"",discreteDescrip
|
|
|
432
432
|
*/modelValue:{type:String,required:false,default:void 0},maxLength:{type:Number,default:80},extendedValidation:{type:Boolean,default:false},/**
|
|
433
433
|
* The error message to be displayed on paste
|
|
434
434
|
* If the prop is not set the default text "Du kan inte kopiera mejladressen. Du måste skriva in den igen." will be set
|
|
435
|
-
*/pasteErrorText:{type:String,required:false,default:logic.TranslationService.provider.translate("fkui.email-text-field.error.pasting","Du kan inte kopiera mejladressen. Du måste skriva in den igen.")}},emits:["blur","change","update","update:modelValue"],data(){return{validityMode:"INITIAL",secondEmail:"",showPasteErrorMessage:false,defaultText:this.$t("fkui.email-text-field.label","Mejladress")};},mounted(){this.configureValidators();},methods:{onChange(event){this.$emit("change",event);},onBlur(event){this.$emit("blur",event);},onUpdate(event){this.$emit("update:modelValue",event);this.$emit("update",event);},onPaste(event){this.showPasteErrorMessage=true;event.preventDefault();return false;},onValidity({detail}){var _renderSlotText5;this.showPasteErrorMessage=false;this.validityMode=detail.validityMode;const errorMessage=(_renderSlotText5=renderSlotText(this.$slots.default))!==null&&_renderSlotText5!==void 0?_renderSlotText5:this.defaultText;const element=this.$el.querySelector(`#${detail.elementId}`);if(element){dispatchComponentValidityEvent(element,{...detail,errorMessage,focusElementId:detail.elementId});}},onPendingValidity(){this.validityMode="INITIAL";},configureValidators(){const elements=Array.from(this.$el.querySelectorAll("input"));const validatorEmailConfig={email:{}};logic.ValidationService.addValidatorsToElement(elements[0],validatorEmailConfig,true);if(this.extendedValidation){this.configureExtendedValidation(elements);}},configureExtendedValidation(elements){const validatorEmailMatchesConfig={required:{enabled:elements[0].hasAttribute("required")},email:{},matches:{id:elements[0].id}};logic.ValidationService.addValidatorsToElement(elements[1],validatorEmailMatchesConfig,true);}}});const _hoisted_1$y={key:0};function _sfc_render$C(_ctx,_cache,$props,$setup,$data,$options){const _component_f_text_field=vue.resolveComponent("f-text-field");return vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(_component_f_text_field,vue.mergeProps({id:_ctx.id,type:"email",maxlength:_ctx.maxLength},_ctx.$attrs,{"model-value":_ctx.modelValue,onChange:_ctx.onChange,onBlur:_ctx.onBlur,onUpdate:_ctx.onUpdate,onValidity:_ctx.onValidity,onPendingValidity:_ctx.onPendingValidity}),{"error-message":vue.withCtx(()=>[_ctx.showPasteErrorMessage?(vue.openBlock(),vue.createElementBlock("span",_hoisted_1$y,vue.toDisplayString(_ctx.pasteErrorText),1/* TEXT */)):vue.createCommentVNode("v-if",true)]),default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.defaultText),1/* TEXT */)]),vue.createTextVNode()]),_:3/* FORWARDED */},16,["id","maxlength","model-value","onChange","onBlur","onUpdate","onValidity","onPendingValidity"]),vue.createTextVNode(),_ctx.extendedValidation?(vue.openBlock(),vue.createBlock(_component_f_text_field,{key:0,modelValue:_ctx.secondEmail,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>_ctx.secondEmail=$event),type:"email",maxlength:_ctx.maxLength,onPaste:_ctx.onPaste,onBlur:_cache[1]||(_cache[1]=$event=>_ctx.showPasteErrorMessage=false)},{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"extended-label",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.email-text-field.label.repeat","Upprepa mejladress")),1/* TEXT */)])]),_:3/* FORWARDED */},8,["modelValue","maxlength","onPaste"])):vue.createCommentVNode("v-if",true)]);}const FEmailTextField=/* @__PURE__ */_export_sfc(_sfc_main$M,[["render",_sfc_render$C]]);const _sfc_main$L=vue.defineComponent({name:"FPhoneTextField",components:{FTextField},mixins:[TranslationMixin],inheritAttrs:false,props:{/**
|
|
435
|
+
*/pasteErrorText:{type:String,required:false,default:logic.TranslationService.provider.translate("fkui.email-text-field.error.pasting","Du kan inte kopiera mejladressen. Du måste skriva in den igen.")}},emits:["blur","change","update","update:modelValue"],data(){return{validityMode:"INITIAL",secondEmail:"",showPasteErrorMessage:false,defaultText:this.$t("fkui.email-text-field.label","Mejladress")};},mounted(){this.configureValidators();},methods:{onChange(event){this.$emit("change",event);},onBlur(event){this.$emit("blur",event);},onUpdate(event){this.$emit("update:modelValue",event);this.$emit("update",event);},onPaste(event){this.showPasteErrorMessage=true;event.preventDefault();return false;},onValidity({detail}){var _renderSlotText5;this.showPasteErrorMessage=false;this.validityMode=detail.validityMode;const errorMessage=(_renderSlotText5=renderSlotText(this.$slots.default))!==null&&_renderSlotText5!==void 0?_renderSlotText5:this.defaultText;const element=this.$el.querySelector(`#${detail.elementId}`);if(element){dispatchComponentValidityEvent(element,{...detail,errorMessage,focusElementId:detail.elementId});}},onPendingValidity(){this.validityMode="INITIAL";},configureValidators(){const elements=Array.from(this.$el.querySelectorAll("input"));const validatorEmailConfig={email:{}};logic.ValidationService.addValidatorsToElement(elements[0],validatorEmailConfig,true);if(this.extendedValidation){this.configureExtendedValidation(elements);}},configureExtendedValidation(elements){const validatorEmailMatchesConfig={required:{enabled:elements[0].hasAttribute("required")},email:{},matches:{id:elements[0].id}};logic.ValidationService.addValidatorsToElement(elements[1],validatorEmailMatchesConfig,true);}}});const _hoisted_1$y={key:0};function _sfc_render$C(_ctx,_cache,$props,$setup,$data,$options){const _component_f_text_field=vue.resolveComponent("f-text-field");return vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(_component_f_text_field,vue.mergeProps({id:_ctx.id,type:"email",maxlength:_ctx.maxLength},_ctx.$attrs,{"model-value":_ctx.modelValue,onChange:_ctx.onChange,onBlur:_ctx.onBlur,onUpdate:_ctx.onUpdate,onValidity:_ctx.onValidity,onPendingValidity:_ctx.onPendingValidity}),{"error-message":vue.withCtx(()=>[_ctx.showPasteErrorMessage?(vue.openBlock(),vue.createElementBlock("span",_hoisted_1$y,vue.toDisplayString(_ctx.pasteErrorText),1/* TEXT */)):vue.createCommentVNode("v-if",true)]),default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.defaultText),1/* TEXT */)]),_cache[2]||(_cache[2]=vue.createTextVNode())]),_:3/* FORWARDED */},16,["id","maxlength","model-value","onChange","onBlur","onUpdate","onValidity","onPendingValidity"]),_cache[3]||(_cache[3]=vue.createTextVNode()),_ctx.extendedValidation?(vue.openBlock(),vue.createBlock(_component_f_text_field,{key:0,modelValue:_ctx.secondEmail,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>_ctx.secondEmail=$event),type:"email",maxlength:_ctx.maxLength,onPaste:_ctx.onPaste,onBlur:_cache[1]||(_cache[1]=$event=>_ctx.showPasteErrorMessage=false)},{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"extended-label",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.email-text-field.label.repeat","Upprepa mejladress")),1/* TEXT */)])]),_:3/* FORWARDED */},8,["modelValue","maxlength","onPaste"])):vue.createCommentVNode("v-if",true)]);}const FEmailTextField=/* @__PURE__ */_export_sfc(_sfc_main$M,[["render",_sfc_render$C]]);const _sfc_main$L=vue.defineComponent({name:"FPhoneTextField",components:{FTextField},mixins:[TranslationMixin],inheritAttrs:false,props:{/**
|
|
436
436
|
* The id for the input id attribute.
|
|
437
437
|
* The id for the label for attribute.
|
|
438
438
|
* If the prop is not set a random value will be generated.
|
|
@@ -440,7 +440,7 @@ defaultText:"",descriptionText:"",descriptionScreenReaderText:"",discreteDescrip
|
|
|
440
440
|
* The value for the input.
|
|
441
441
|
* If the prop is not set undefined will be used.
|
|
442
442
|
* @model
|
|
443
|
-
*/modelValue:{type:String,required:false,default:void 0},maxLength:{type:Number,default:80},extendedValidation:{type:Boolean,default:false}},emits:["blur","change","update","update:modelValue"],data(){return{validityMode:"INITIAL",secondPhone:"",defaultText:this.$t("fkui.phone-text-field.label","Telefonnummer")};},mounted(){this.configureValidators();},methods:{onChange(event){this.$emit("change",event);},onBlur(event){this.$emit("blur",event);},onUpdate(event){this.$emit("update:modelValue",event);this.$emit("update",event);},onValidity({detail}){var _renderSlotText6;this.validityMode=detail.validityMode;const errorMessage=(_renderSlotText6=renderSlotText(this.$slots.default))!==null&&_renderSlotText6!==void 0?_renderSlotText6:this.defaultText;const element=this.$el.querySelector(`#${detail.elementId}`);if(element){dispatchComponentValidityEvent(element,{...detail,errorMessage,focusElementId:detail.elementId});}},onPendingValidity(){this.validityMode="INITIAL";},configureValidators(){const elements=Array.from(this.$el.querySelectorAll("input"));const validatorPhoneConfig={phoneNumber:{}};logic.ValidationService.addValidatorsToElement(elements[0],validatorPhoneConfig,true);if(this.extendedValidation){this.configureExtendedValidation(elements);}},configureExtendedValidation(elements){const validatorPhoneMatchesConfig={required:{enabled:elements[0].hasAttribute("required")},phoneNumber:{},matches:{id:elements[0].id}};logic.ValidationService.addValidatorsToElement(elements[1],validatorPhoneMatchesConfig,true);}}});function _sfc_render$B(_ctx,_cache,$props,$setup,$data,$options){const _component_f_text_field=vue.resolveComponent("f-text-field");return vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(_component_f_text_field,vue.mergeProps({id:_ctx.id,type:"tel",maxlength:_ctx.maxLength},_ctx.$attrs,{"model-value":_ctx.modelValue,onChange:_ctx.onChange,onBlur:_ctx.onBlur,onUpdate:_ctx.onUpdate,onValidity:_ctx.onValidity,onPendingValidity:_ctx.onPendingValidity}),{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.defaultText),1/* TEXT */)])]),_:3/* FORWARDED */},16,["id","maxlength","model-value","onChange","onBlur","onUpdate","onValidity","onPendingValidity"]),vue.createTextVNode(),_ctx.extendedValidation?(vue.openBlock(),vue.createBlock(_component_f_text_field,{key:0,modelValue:_ctx.secondPhone,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>_ctx.secondPhone=$event),type:"tel",maxlength:_ctx.maxLength},{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"extendedLabel",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.phone-text-field.label.repeat","Upprepa telefonnumret")),1/* TEXT */)])]),_:3/* FORWARDED */},8,["modelValue","maxlength"])):vue.createCommentVNode("v-if",true)]);}const FPhoneTextField=/* @__PURE__ */_export_sfc(_sfc_main$L,[["render",_sfc_render$B]]);const _sfc_main$K=vue.defineComponent({name:"FCurrencyTextField",extends:FTextField,mixins:[TranslationMixin],props:{formatter:{type:Function,required:false,default:logic.formatNumber},parser:{type:Function,required:false,default:logic.parseNumber}},setup(){return{textFieldTableMode:vue.inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.currency-text-field.label","Pengar")};},mounted(){const inputElement=getInputElement(this);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","20");logic.ValidationService.addValidatorsToElement(inputElement,{currency:{},integer:{}},true);logic.ValidationService.validateElement(inputElement);}});const _sfc_main$J=vue.defineComponent({name:"FSearchTextField",components:{FTextField,FIcon},props:{id:{type:String,required:false,default:()=>logic.ElementIdService.generateElementId()},modelValue:{type:String,required:false,default:""},clearableScreenReaderText:{type:String,required:false,default:logic.TranslationService.provider.translate("fkui.search-text-field.search-screen-reader","Töm inmatningsfält")},maxLength:{type:Number,default:80}},emits:["blur","change","update","update:modelValue"],data(){return{defaultText:this.$t("fkui.search-text-field.label","Sök")};},computed:{canClear(){return this.modelValue!=="";}},methods:{clear(){logic.alertScreenReader(this.$t("fkui.search-text-field.aria-live.clear","Inmatningsfältet har tömts"),{assertive:true});this.$emit("update:modelValue","");this.$el.querySelector("input").focus();},onInput(event){this.$emit("update:modelValue",event.target.value);},onChange(event){this.$emit("change",event);},onBlur(event){this.$emit("blur",event);},onUpdate(event){this.$emit("update:modelValue",event);}}});const _hoisted_1$x={class:"sr-only"};function _sfc_render$A(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");const _component_f_text_field=vue.resolveComponent("f-text-field");return vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(_component_f_text_field,vue.mergeProps({id:_ctx.id,maxlength:_ctx.maxLength,"model-value":_ctx.modelValue},_ctx.$attrs,{type:"search",class:"text-field--search",onChange:_ctx.onChange,onInput:_ctx.onInput,onBlur:_ctx.onBlur,onUpdate:_ctx.onUpdate}),vue.createSlots({"input-right":vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"input-right")]),"input-left":vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"input-left")]),"error-message":vue.withCtx(({hasError,validationMessage})=>[vue.renderSlot(_ctx.$slots,"error-message",vue.normalizeProps(vue.guardReactiveProps({hasError,validationMessage})))]),description:vue.withCtx(({descriptionClass,discreteDescriptionClass})=>[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.defaultText),1/* TEXT */)]),vue.createTextVNode(),vue.createTextVNode(),vue.createTextVNode(),vue.createTextVNode(),vue.createTextVNode(),vue.createTextVNode()]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0,_ctx.canClear?{name:"append-inner",fn:vue.withCtx(()=>[vue.createElementVNode("button",{class:"text-field__icon clear-button",type:"button",onClick:_cache[0]||(_cache[0]=vue.withModifiers((...args)=>_ctx.clear&&_ctx.clear(...args),["self"]))},[vue.createVNode(_component_f_icon,{name:"cross",class:"clear-button__icon"}),vue.createTextVNode(),vue.createElementVNode("span",_hoisted_1$x,vue.toDisplayString(_ctx.clearableScreenReaderText),1/* TEXT */)])]),key:"1"}:void 0]),1040,["id","maxlength","model-value","onChange","onInput","onBlur","onUpdate"])]);}const FSearchTextField=/* @__PURE__ */_export_sfc(_sfc_main$J,[["render",_sfc_render$A]]);const _sfc_main$I=vue.defineComponent({name:"FBankAccountNumberTextField",extends:FTextField,mixins:[TranslationMixin],props:{parser:{type:Function,required:false,default:logic.parseBankAccountNumber}},setup(){return{textFieldTableMode:vue.inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.bank-account-number-text-field.label","Kontonummer")};},mounted(){const inputElement=getInputElement(this);logic.ValidationService.addValidatorsToElement(inputElement,{bankAccountNumber:{}},true);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","40");logic.ValidationService.validateElement(inputElement);}});const _sfc_main$H=vue.defineComponent({name:"FBankgiroTextField",extends:FTextField,mixins:[TranslationMixin],props:{formatter:{type:Function,required:false,default:logic.parseBankgiro}},setup(){return{textFieldTableMode:vue.inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.bankgiro-text-field.label","Bankgironummer")};},mounted(){const inputElement=getInputElement(this);logic.ValidationService.addValidatorsToElement(inputElement,{maxLength:{length:9},bankgiro:{}},true);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","40");logic.ValidationService.validateElement(inputElement);}});const _sfc_main$G=vue.defineComponent({name:"FClearingnumberTextField",extends:FTextField,mixins:[TranslationMixin],props:{formatter:{type:Function,required:false,default:logic.parseClearingNumber}},setup(){return{textFieldTableMode:vue.inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.clearingnumber-text-field.label","Clearingnummer")};},mounted(){const inputElement=getInputElement(this);logic.ValidationService.addValidatorsToElement(inputElement,{clearingNumber:{}},true);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","16");logic.ValidationService.validateElement(inputElement);}});function defaultFormatter$1(modelValue){return logic.formatNumber(modelValue,this.decimals);}const _sfc_main$F=vue.defineComponent({name:"FNumericTextField",extends:FTextField,props:{/**
|
|
443
|
+
*/modelValue:{type:String,required:false,default:void 0},maxLength:{type:Number,default:80},extendedValidation:{type:Boolean,default:false}},emits:["blur","change","update","update:modelValue"],data(){return{validityMode:"INITIAL",secondPhone:"",defaultText:this.$t("fkui.phone-text-field.label","Telefonnummer")};},mounted(){this.configureValidators();},methods:{onChange(event){this.$emit("change",event);},onBlur(event){this.$emit("blur",event);},onUpdate(event){this.$emit("update:modelValue",event);this.$emit("update",event);},onValidity({detail}){var _renderSlotText6;this.validityMode=detail.validityMode;const errorMessage=(_renderSlotText6=renderSlotText(this.$slots.default))!==null&&_renderSlotText6!==void 0?_renderSlotText6:this.defaultText;const element=this.$el.querySelector(`#${detail.elementId}`);if(element){dispatchComponentValidityEvent(element,{...detail,errorMessage,focusElementId:detail.elementId});}},onPendingValidity(){this.validityMode="INITIAL";},configureValidators(){const elements=Array.from(this.$el.querySelectorAll("input"));const validatorPhoneConfig={phoneNumber:{}};logic.ValidationService.addValidatorsToElement(elements[0],validatorPhoneConfig,true);if(this.extendedValidation){this.configureExtendedValidation(elements);}},configureExtendedValidation(elements){const validatorPhoneMatchesConfig={required:{enabled:elements[0].hasAttribute("required")},phoneNumber:{},matches:{id:elements[0].id}};logic.ValidationService.addValidatorsToElement(elements[1],validatorPhoneMatchesConfig,true);}}});function _sfc_render$B(_ctx,_cache,$props,$setup,$data,$options){const _component_f_text_field=vue.resolveComponent("f-text-field");return vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(_component_f_text_field,vue.mergeProps({id:_ctx.id,type:"tel",maxlength:_ctx.maxLength},_ctx.$attrs,{"model-value":_ctx.modelValue,onChange:_ctx.onChange,onBlur:_ctx.onBlur,onUpdate:_ctx.onUpdate,onValidity:_ctx.onValidity,onPendingValidity:_ctx.onPendingValidity}),{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.defaultText),1/* TEXT */)])]),_:3/* FORWARDED */},16,["id","maxlength","model-value","onChange","onBlur","onUpdate","onValidity","onPendingValidity"]),_cache[1]||(_cache[1]=vue.createTextVNode()),_ctx.extendedValidation?(vue.openBlock(),vue.createBlock(_component_f_text_field,{key:0,modelValue:_ctx.secondPhone,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>_ctx.secondPhone=$event),type:"tel",maxlength:_ctx.maxLength},{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"extendedLabel",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.phone-text-field.label.repeat","Upprepa telefonnumret")),1/* TEXT */)])]),_:3/* FORWARDED */},8,["modelValue","maxlength"])):vue.createCommentVNode("v-if",true)]);}const FPhoneTextField=/* @__PURE__ */_export_sfc(_sfc_main$L,[["render",_sfc_render$B]]);const _sfc_main$K=vue.defineComponent({name:"FCurrencyTextField",extends:FTextField,mixins:[TranslationMixin],props:{formatter:{type:Function,required:false,default:logic.formatNumber},parser:{type:Function,required:false,default:logic.parseNumber}},setup(){return{textFieldTableMode:vue.inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.currency-text-field.label","Pengar")};},mounted(){const inputElement=getInputElement(this);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","20");logic.ValidationService.addValidatorsToElement(inputElement,{currency:{},integer:{}},true);logic.ValidationService.validateElement(inputElement);}});const _sfc_main$J=vue.defineComponent({name:"FSearchTextField",components:{FTextField,FIcon},props:{id:{type:String,required:false,default:()=>logic.ElementIdService.generateElementId()},modelValue:{type:String,required:false,default:""},clearableScreenReaderText:{type:String,required:false,default:logic.TranslationService.provider.translate("fkui.search-text-field.search-screen-reader","Töm inmatningsfält")},maxLength:{type:Number,default:80}},emits:["blur","change","update","update:modelValue"],data(){return{defaultText:this.$t("fkui.search-text-field.label","Sök")};},computed:{canClear(){return this.modelValue!=="";}},methods:{clear(){logic.alertScreenReader(this.$t("fkui.search-text-field.aria-live.clear","Inmatningsfältet har tömts"),{assertive:true});this.$emit("update:modelValue","");this.$el.querySelector("input").focus();},onInput(event){this.$emit("update:modelValue",event.target.value);},onChange(event){this.$emit("change",event);},onBlur(event){this.$emit("blur",event);},onUpdate(event){this.$emit("update:modelValue",event);}}});const _hoisted_1$x={class:"sr-only"};function _sfc_render$A(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");const _component_f_text_field=vue.resolveComponent("f-text-field");return vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(_component_f_text_field,vue.mergeProps({id:_ctx.id,maxlength:_ctx.maxLength,"model-value":_ctx.modelValue},_ctx.$attrs,{type:"search",class:"text-field--search",onChange:_ctx.onChange,onInput:_ctx.onInput,onBlur:_ctx.onBlur,onUpdate:_ctx.onUpdate}),vue.createSlots({"input-right":vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"input-right")]),"input-left":vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"input-left")]),"error-message":vue.withCtx(({hasError,validationMessage})=>[vue.renderSlot(_ctx.$slots,"error-message",vue.normalizeProps(vue.guardReactiveProps({hasError,validationMessage})))]),description:vue.withCtx(({descriptionClass,discreteDescriptionClass})=>[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.defaultText),1/* TEXT */)]),_cache[2]||(_cache[2]=vue.createTextVNode()),_cache[3]||(_cache[3]=vue.createTextVNode()),_cache[4]||(_cache[4]=vue.createTextVNode()),_cache[5]||(_cache[5]=vue.createTextVNode()),_cache[6]||(_cache[6]=vue.createTextVNode()),_cache[7]||(_cache[7]=vue.createTextVNode())]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0,_ctx.canClear?{name:"append-inner",fn:vue.withCtx(()=>[vue.createElementVNode("button",{class:"text-field__icon clear-button",type:"button",onClick:_cache[0]||(_cache[0]=vue.withModifiers((...args)=>_ctx.clear&&_ctx.clear(...args),["self"]))},[vue.createVNode(_component_f_icon,{name:"cross",class:"clear-button__icon"}),_cache[1]||(_cache[1]=vue.createTextVNode()),vue.createElementVNode("span",_hoisted_1$x,vue.toDisplayString(_ctx.clearableScreenReaderText),1/* TEXT */)])]),key:"1"}:void 0]),1040,["id","maxlength","model-value","onChange","onInput","onBlur","onUpdate"])]);}const FSearchTextField=/* @__PURE__ */_export_sfc(_sfc_main$J,[["render",_sfc_render$A]]);const _sfc_main$I=vue.defineComponent({name:"FBankAccountNumberTextField",extends:FTextField,mixins:[TranslationMixin],props:{parser:{type:Function,required:false,default:logic.parseBankAccountNumber}},setup(){return{textFieldTableMode:vue.inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.bank-account-number-text-field.label","Kontonummer")};},mounted(){const inputElement=getInputElement(this);logic.ValidationService.addValidatorsToElement(inputElement,{bankAccountNumber:{}},true);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","40");logic.ValidationService.validateElement(inputElement);}});const _sfc_main$H=vue.defineComponent({name:"FBankgiroTextField",extends:FTextField,mixins:[TranslationMixin],props:{formatter:{type:Function,required:false,default:logic.parseBankgiro}},setup(){return{textFieldTableMode:vue.inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.bankgiro-text-field.label","Bankgironummer")};},mounted(){const inputElement=getInputElement(this);logic.ValidationService.addValidatorsToElement(inputElement,{maxLength:{length:9},bankgiro:{}},true);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","40");logic.ValidationService.validateElement(inputElement);}});const _sfc_main$G=vue.defineComponent({name:"FClearingnumberTextField",extends:FTextField,mixins:[TranslationMixin],props:{formatter:{type:Function,required:false,default:logic.parseClearingNumber}},setup(){return{textFieldTableMode:vue.inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.clearingnumber-text-field.label","Clearingnummer")};},mounted(){const inputElement=getInputElement(this);logic.ValidationService.addValidatorsToElement(inputElement,{clearingNumber:{}},true);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","16");logic.ValidationService.validateElement(inputElement);}});function defaultFormatter$1(modelValue){return logic.formatNumber(modelValue,this.decimals);}const _sfc_main$F=vue.defineComponent({name:"FNumericTextField",extends:FTextField,props:{/**
|
|
444
444
|
* The number of decimals to format number as.
|
|
445
445
|
* @model
|
|
446
446
|
*/decimals:{type:Number,required:false,default:void 0},formatter:{type:Function,required:false,default:defaultFormatter$1},parser:{type:Function,required:false,default:logic.parseNumber}},setup(){return{textFieldTableMode:vue.inject("textFieldTableMode",false)};},mounted(){const inputElement=getInputElement(this);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","20");logic.ValidationService.addValidatorsToElement(inputElement,{number:{}},true);logic.ValidationService.validateElement(inputElement);}});const _sfc_main$E=vue.defineComponent({name:"FPersonnummerTextField",extends:FTextField,mixins:[TranslationMixin],props:{formatter:{type:Function,required:false,default:logic.formatPersonnummer},parser:{type:Function,required:false,default:logic.parsePersonnummer}},setup(){return{textFieldTableMode:vue.inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.personnummer-text-field.label-10-digits","Personnummer"),discreteDescriptionText:this.$t("fkui.personnummer-text-field.example-10-digits","(ååmmdd-nnnn)"),discreteDescriptionScreenReaderText:this.$t("fkui.personnummer-text-field.format-description-10-digits","Skriv personnumret med 10 siffror,")};},mounted(){const inputElement=getInputElement(this);logic.ValidationService.addValidatorsToElement(inputElement,{maxLength:{length:20},personnummerFormat:{},personnummerLuhn:{}},true);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","23");logic.ValidationService.validateElement(inputElement);}});const _sfc_main$D=vue.defineComponent({name:"FPlusgiroTextField",extends:FTextField,mixins:[TranslationMixin],props:{formatter:{type:Function,required:false,default:logic.parsePlusgiro}},setup(){return{textFieldTableMode:vue.inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.plusgiro-text-field.label","Plusgironummer")};},mounted(){const inputElement=getInputElement(this);logic.ValidationService.addValidatorsToElement(inputElement,{maxLength:{length:11},plusgiro:{}},true);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","16");logic.ValidationService.validateElement(inputElement);}});const _sfc_main$C=vue.defineComponent({name:"FPostalCodeTextField",extends:FTextField,mixins:[TranslationMixin],props:{formatter:{type:Function,required:false,default:logic.formatPostalCode}},setup(){return{textFieldTableMode:vue.inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.postal-code-text-field.label","Postnummer"),discreteDescriptionText:this.$t("fkui.postal-code-text-field.example","(123 45)"),discreteDescriptionScreenReaderText:this.$t("fkui.postal-code-text-field.format-description","Formatbeskrivning")};},mounted(){const inputElement=getInputElement(this);logic.ValidationService.addValidatorsToElement(inputElement,{maxLength:{length:13},postalCode:{}},true);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","15");logic.ValidationService.validateElement(inputElement);}});function defaultFormatter(modelValue){return logic.formatPercent(modelValue,this.decimals);}const _sfc_main$B=vue.defineComponent({name:"FPercentTextField",extends:FTextField,mixins:[TranslationMixin],props:{/**
|
|
@@ -462,7 +462,7 @@ defaultText:"",descriptionText:"",descriptionScreenReaderText:"",discreteDescrip
|
|
|
462
462
|
* Default is textkey "fkui.sort-filter-dataset.placeholder.filter"
|
|
463
463
|
*/placeholderFilter:{type:String,required:false,default:TranslationMixin.methods.$t("fkui.sort-filter-dataset.placeholder.filter","Sök")},/**
|
|
464
464
|
* The order the data will be sorted by if defaultSortAttribute has been set.
|
|
465
|
-
*/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$
|
|
465
|
+
*/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$l={class:"sr-only"};const _hoisted_4$h=["title"];const _hoisted_5$d={class:"sr-only"};const _hoisted_6$9={value:{attribute:"",ascending:false}};const _hoisted_7$9=["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 */}),_cache[9]||(_cache[9]=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"}),_cache[4]||(_cache[4]=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$l,vue.toDisplayString(_ctx.placeholderFilter),1/* TEXT */)]),_:1/* STABLE */},8,["modelValue","placeholder","onInput"]),_cache[5]||(_cache[5]=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"}),_cache[3]||(_cache[3]=vue.createTextVNode()),vue.createElementVNode("span",_hoisted_5$d,vue.toDisplayString(_ctx.$t("fkui.sort-filter-dataset.clear.filter","Rensa sökfält")),1/* TEXT */)],8,_hoisted_4$h)):vue.createCommentVNode("v-if",true)])]),_:1/* STABLE */})):vue.createCommentVNode("v-if",true),_cache[8]||(_cache[8]=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(()=>[_cache[6]||(_cache[6]=vue.createTextVNode()),vue.createElementVNode("option",_hoisted_6$9,vue.toDisplayString(_ctx.$t("fkui.sort-filter-dataset.label.unsorted","Välj")),1/* TEXT */),_cache[7]||(_cache[7]=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$9);}),128/* KEYED_FRAGMENT */))]),_:1/* STABLE */},8,["modelValue","onChange"])]),_:1/* STABLE */})):vue.createCommentVNode("v-if",true)]),_:1/* STABLE */})]),_:1/* STABLE */})]),_:3/* FORWARDED */}),_cache[10]||(_cache[10]=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:{/**
|
|
466
466
|
* The rows to be listed.
|
|
467
467
|
* The rows will be listed in the given array order.
|
|
468
468
|
*/rows:{type:Array,required:true},/**
|
|
@@ -478,7 +478,7 @@ defaultText:"",descriptionText:"",descriptionScreenReaderText:"",discreteDescrip
|
|
|
478
478
|
* - `"vertical"`: Enables vertical scrolling
|
|
479
479
|
* - `"both"`: Enables scrolling in both directions
|
|
480
480
|
* - `"none"`: Disables scrolling (default)
|
|
481
|
-
*/scroll:{type:String,default:TableScroll.NONE,validator
|
|
481
|
+
*/scroll:{type:String,default:TableScroll.NONE,validator(value){const types=Object.values(TableScroll);return types.includes(value);}}},setup(props){vue.provide("renderColumns",vue.computed(()=>props.rows.length>0));return FSortFilterDatasetInjected();},data(){return{columns:[]};},computed:{hasCaption(){return hasSlot(this,"caption",{},{stripClasses:[]});},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);},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$k={class:"table__row"};const _hoisted_4$g=["innerHTML"];const _hoisted_5$c={key:1,class:"table__column__description"};const _hoisted_6$8={key:0};const _hoisted_7$8={key:1};const _hoisted_8$6=["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),_cache[4]||(_cache[4]=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 */))]),_cache[5]||(_cache[5]=vue.createTextVNode()),vue.createElementVNode("thead",null,[vue.createElementVNode("tr",_hoisted_3$k,[(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$g),_cache[0]||(_cache[0]=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),_cache[1]||(_cache[1]=vue.createTextVNode()),column.description?(vue.openBlock(),vue.createElementBlock("span",_hoisted_5$c,vue.toDisplayString(column.description),1/* TEXT */)):vue.createCommentVNode("v-if",true)],16/* FULL_PROPS */);}),128/* KEYED_FRAGMENT */))])]),_cache[6]||(_cache[6]=vue.createTextVNode()),vue.createElementVNode("tbody",null,[_ctx.isEmpty&&_ctx.columns.length===0?(vue.openBlock(),vue.createElementBlock("tr",_hoisted_6$8,[vue.renderSlot(_ctx.$slots,"default",vue.normalizeProps(vue.guardReactiveProps({row:{}})))])):vue.createCommentVNode("v-if",true),_cache[2]||(_cache[2]=vue.createTextVNode()),_ctx.isEmpty?(vue.openBlock(),vue.createElementBlock("tr",_hoisted_7$8,[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$6)])):vue.createCommentVNode("v-if",true),_cache[3]||(_cache[3]=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(datepicker,newValue){const{isDateEnabled,minDate,maxDate}=datepicker;const newCalendarValue=date.FDate.fromIso(newValue);if(!newCalendarValue.isValid()){datepicker.calendarValue=void 0;}else if(isInvalidMonth(newCalendarValue,minDate,maxDate)){datepicker.calendarValue=void 0;}else if(!isDateEnabled(newCalendarValue)){datepicker.calendarValue=void 0;}else if(!datepicker.calendarValue||!datepicker.calendarValue.equals(newCalendarValue)){datepicker.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.
|
|
482
482
|
* @model
|
|
483
483
|
*/modelValue:{type:String,required:false,default:""},/**
|
|
484
484
|
* Initial month. Applies when no day is selected.
|
|
@@ -501,7 +501,7 @@ defaultText:"",descriptionText:"",descriptionScreenReaderText:"",discreteDescrip
|
|
|
501
501
|
* ```
|
|
502
502
|
*/inputWidth:{type:String,required:false,default:"sm-12"},/**
|
|
503
503
|
* Set to `true`, empty string `""` or string `"disabled"` to disable this field.
|
|
504
|
-
*/disabled:{type:Boolean,required:false,default:false}},emits:["change","update:modelValue"],setup(){const defaultMinDate=date.FDate.now().addYears(-10);const defaultMaxDate=date.FDate.now().addYears(10);return{textFieldValue:vue.ref(""),textFieldTouched:vue.ref(false),textFieldValidityRevealed:vue.ref(false),textFieldTableMode:vue.inject("textFieldTableMode",false),componentTouched:vue.ref(false),calendarMonth:vue.shallowRef(getDisplayMonth(defaultMinDate,defaultMaxDate)),calendarValue:vue.shallowRef(void 0),isCalendarOpen:vue.ref(false),validationConfig:vue.ref({}),minDate:vue.shallowRef(defaultMinDate),maxDate:vue.shallowRef(defaultMaxDate),calendarInputs:vue.ref(null)};},computed:{calendarButtonText(){const{calendarValue}=this;if(calendarValue&&calendarValue.isValid()){const prettyDate=calendarValue.toString(date.DateFormat.FULL);const text=this.$t("fkui.datepicker-field.change","Ändra datum");return`${text} ${prettyDate}`;}else{return this.$t("fkui.datepicker-field.choose","Välj datum");}},popupClass(){return this.textFieldTableMode?"datepicker-field__popup datepicker-field__table":"datepicker-field__popup";}},watch:{modelValue:{async handler(value){if(value!==this.textFieldValue){await this.updateTextFieldValue(value);updateCalendarValue(this,value);}},immediate:true}},mounted(){logic.ValidationService.addValidatorsToElement(getInputElement(this),{date:{},dateFormat:{},minDate:{limit:this.minDate.toString()},maxDate:{limit:this.maxDate.toString()}},true);},methods:{dateFormatter:logic.parseDate,async onValidityTextField({detail}){if(this.textFieldValidityRevealed&&detail.validityMode==="INITIAL"){this.textFieldTouched=false;this.componentTouched=false;}if(!this.textFieldTouched&&["blur","change"].includes(detail.nativeEvent)){this.textFieldTouched=true;}if(this.isCalendarOpen){logic.alertScreenReader(detail.validationMessage,{assertive:true});}this.textFieldValidityRevealed=detail.validityMode!=="INITIAL";if(detail.validityMode==="INITIAL"||!this.textFieldTouched||this.componentTouched){return;}const inputElement=getInputElement(this);const pendingValidityEvent=new CustomEvent("pending-validity",{bubbles:false});inputElement.dispatchEvent(pendingValidityEvent);},onChangeTextField(){updateCalendarValue(this,this.textFieldValue);this.$emit("update:modelValue",this.textFieldValue);this.$emit("change",this.textFieldValue);},onClickCalendarButton(){if(!this.isCalendarOpen){this.calendarMonth=getDisplayMonth(this.minDate,this.maxDate,this.calendarValue,this.initialMonth);}this.isCalendarOpen=!this.isCalendarOpen;},onFocusoutTextFieldButton(e){if(this.componentTouched||this.$refs.component===null){return;}const component=getHTMLElementFromVueRef(this.$refs.component);const relatedTarget=e.relatedTarget;if(!component.contains(relatedTarget)){this.componentTouched=true;const inputElement=getInputElement(this);logic.ValidationService.setTouched(inputElement);logic.ValidationService.validateElement(inputElement);}},async onSelectCalendarDay(date2){this.componentTouched=true;this.isCalendarOpen=!this.isDateEnabled(date2);if(!this.isCalendarOpen){getHTMLElementFromVueRef(this.$refs.calendarButton).focus();}this.$emit("update:modelValue",date2.toString());this.$emit("change",date2.toString());await this.updateTextFieldValue(date2.toString());updateCalendarValue(this,date2.toString());},async onKeyupEsc(){this.isCalendarOpen=false;logic.waitForScreenReader(()=>{getHTMLElementFromVueRef(this.$refs.calendarButton).focus();});},async onClickCloseCalendarButton(){this.isCalendarOpen=false;logic.waitForScreenReader(()=>{getHTMLElementFromVueRef(this.$refs.calendarButton).focus();});},onOpenPopup(){if(!this.isCalendarOpen){return;}const popup=getHTMLElementFromVueRef(this.$refs.popup);const navMonth=popup.querySelector(".calendar-navbar__month");if(navMonth){navMonth.focus({preventScroll:true});}},onClosePopup(){this.isCalendarOpen=false;},async onValidationConfigUpdate(event){this.validationConfig=event.detail.config;if(this.validationConfig.minDate){const minDateConfig=this.validationConfig.minDate;if(!minDateConfig.limit){throw new Error("MinDate validator must be set");}this.minDate=date.FDate.fromIso(minDateConfig.limit.toString());}if(this.validationConfig.maxDate){const maxDateConfig=this.validationConfig.maxDate;if(!maxDateConfig.limit){throw new Error("MaxDate validator must be set");}this.maxDate=date.FDate.fromIso(maxDateConfig.limit.toString());}const element=findHTMLElementFromVueRef(this.$refs.calendarInputs);if(element){await this.$nextTick();logic.ValidationService.validateAllElements(element);}},isDateEnabled(day){return isDayEnabled(day,this.validationConfig);},isDaySelected(date2){return this.calendarValue?date2.equals(this.calendarValue):false;},highlightDay(date$1){return this.highlightToday&&date$1.equals(date.FDate.now());},async updateTextFieldValue(newValue){this.textFieldValue=newValue;await this.$nextTick();logic.ValidationService.validateElement(getInputElement(this));}}});const _hoisted_1$u={ref:"component",class:"datepicker-field"};const _hoisted_2$o=["disabled","aria-expanded"];const _hoisted_3$l={class:"sr-only"};const _hoisted_4$g={class:"datepicker-field__close"};function _sfc_render$x(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");const _component_f_text_field=vue.resolveComponent("f-text-field");const _component_f_calendar_day=vue.resolveComponent("f-calendar-day");const _component_f_calendar=vue.resolveComponent("f-calendar");const _component_i_popup=vue.resolveComponent("i-popup");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$u,[vue.createElementVNode("div",{ref:"calendarInputs",onFocusout:_cache[2]||(_cache[2]=(...args)=>_ctx.onFocusoutTextFieldButton&&_ctx.onFocusoutTextFieldButton(...args))},[vue.createVNode(_component_f_text_field,vue.mergeProps(_ctx.$attrs,{modelValue:_ctx.textFieldValue,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>_ctx.textFieldValue=$event),maxlength:"20",disabled:_ctx.disabled,formatter:_ctx.dateFormatter,"label-width":_ctx.labelWidth,"input-width":_ctx.inputWidth,onComponentValidity:_ctx.onValidityTextField,onChange:_ctx.onChangeTextField,onValidationConfigUpdate:_ctx.onValidationConfigUpdate}),vue.createSlots({description:vue.withCtx(({descriptionClass,discreteDescriptionClass})=>[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),"error-message":vue.withCtx(({hasError,validationMessage})=>[vue.renderSlot(_ctx.$slots,"error-message",vue.normalizeProps(vue.guardReactiveProps({hasError,validationMessage})))]),"input-right":vue.withCtx(()=>[vue.createElementVNode("button",{ref:"calendarButton",disabled:_ctx.disabled,class:"datepicker-field__button",type:"button","aria-expanded":_ctx.isCalendarOpen?"true":"false","data-test":"calendar-button",onClick:_cache[0]||(_cache[0]=$event=>_ctx.onClickCalendarButton())},[vue.createVNode(_component_f_icon,{name:"calendar"}),vue.createTextVNode(),vue.createElementVNode("span",_hoisted_3$l,vue.toDisplayString(_ctx.calendarButtonText),1/* TEXT */)],8,_hoisted_2$o)]),default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.datepicker-field.label","Datum")),1/* TEXT */)]),vue.createTextVNode(),vue.createTextVNode(),vue.createTextVNode(),vue.createTextVNode()]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1040,["modelValue","disabled","formatter","label-width","input-width","onComponentValidity","onChange","onValidationConfigUpdate"])],544/* NEED_HYDRATION, NEED_PATCH */),vue.createTextVNode(),vue.createVNode(_component_i_popup,{"is-open":_ctx.isCalendarOpen,anchor:_ctx.calendarInputs,inline:_ctx.alwaysInline?"always":void 0,"set-focus":false,onOpen:_ctx.onOpenPopup,onClose:_ctx.onClosePopup},{default:vue.withCtx(()=>[vue.createElementVNode("div",{ref:"popup",class:vue.normalizeClass(_ctx.popupClass)},[vue.createVNode(_component_f_calendar,{modelValue:_ctx.calendarMonth,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>_ctx.calendarMonth=$event),"tab-date":_ctx.calendarValue,"min-date":_ctx.minDate,"max-date":_ctx.maxDate,onClick:_ctx.onSelectCalendarDay,onKeyup:vue.withKeys(vue.withModifiers(_ctx.onKeyupEsc,["stop"]),["esc","native"])},{default:vue.withCtx(({date:date2,isFocused})=>[vue.createVNode(_component_f_calendar_day,{day:date2,enabled:_ctx.isDateEnabled(date2),focused:isFocused,highlight:_ctx.highlightDay(date2),selected:_ctx.isDaySelected(date2)},null,8,["day","enabled","focused","highlight","selected"])]),_:1/* STABLE */},8,["modelValue","tab-date","min-date","max-date","onClick","onKeyup"]),vue.createTextVNode(),vue.createElementVNode("div",_hoisted_4$g,[vue.createElementVNode("button",{class:"button button--discrete button--discrete--black datepicker-field__close__button",type:"button",onClick:_cache[4]||(_cache[4]=(...args)=>_ctx.onClickCloseCalendarButton&&_ctx.onClickCloseCalendarButton(...args)),onKeyup:_cache[5]||(_cache[5]=vue.withKeys(vue.withModifiers((...args)=>_ctx.onKeyupEsc&&_ctx.onKeyupEsc(...args),["stop"]),["esc"]))},[vue.createElementVNode("span",null,vue.toDisplayString(_ctx.$t("fkui.datepicker-field.close","Stäng")),1/* TEXT */),vue.createTextVNode(),vue.createVNode(_component_f_icon,{"aria-hidden":"true",class:"button__icon",name:"close"})],32/* NEED_HYDRATION */)])],2/* CLASS */)]),_:1/* STABLE */},8,["is-open","anchor","inline","onOpen","onClose"])],512/* NEED_PATCH */);}const FDatepickerField=/* @__PURE__ */_export_sfc(_sfc_main$x,[["render",_sfc_render$x]]);const _sfc_main$w=vue.defineComponent({name:"FExpand",data(){return{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"}};},methods:{enter(element){const htmlElement=getHTMLElementFromVueRef(element);Object.assign(htmlElement.style,this.initialStyle);Object.assign(htmlElement.style,this.hiddenStyle);htmlElement.style.width=getComputedStyle(element).width;const height=getComputedStyle(element).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);});}}});function _sfc_render$w(_ctx,_cache,$props,$setup,$data,$options){return vue.openBlock(),vue.createBlock(vue.Transition,{onEnter:_ctx.enter,onAfterEnter:_ctx.afterEnter,onLeave:_ctx.leave},{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default",{height:_ctx.height})]),_:3/* FORWARDED */},8,["onEnter","onAfterEnter","onLeave"]);}const FExpand=/* @__PURE__ */_export_sfc(_sfc_main$w,[["render",_sfc_render$w]]);const _sfc_main$v=vue.defineComponent({name:"FExpandablePanel",components:{FIcon,FExpand},mixins:[TranslationMixin],inheritAttrs:false,props:{/**
|
|
504
|
+
*/disabled:{type:Boolean,required:false,default:false}},emits:["change","update:modelValue"],setup(){const defaultMinDate=date.FDate.now().addYears(-10);const defaultMaxDate=date.FDate.now().addYears(10);return{textFieldValue:vue.ref(""),textFieldTouched:vue.ref(false),textFieldValidityRevealed:vue.ref(false),textFieldTableMode:vue.inject("textFieldTableMode",false),componentTouched:vue.ref(false),calendarMonth:vue.shallowRef(getDisplayMonth(defaultMinDate,defaultMaxDate)),calendarValue:vue.shallowRef(void 0),isCalendarOpen:vue.ref(false),validationConfig:vue.ref({}),minDate:vue.shallowRef(defaultMinDate),maxDate:vue.shallowRef(defaultMaxDate),calendarInputs:vue.ref(null)};},computed:{calendarButtonText(){const{calendarValue}=this;if(calendarValue&&calendarValue.isValid()){const prettyDate=calendarValue.toString(date.DateFormat.FULL);const text=this.$t("fkui.datepicker-field.change","Ändra datum");return`${text} ${prettyDate}`;}else{return this.$t("fkui.datepicker-field.choose","Välj datum");}},popupClass(){return this.textFieldTableMode?"datepicker-field__popup datepicker-field__table":"datepicker-field__popup";}},watch:{modelValue:{async handler(value){if(value!==this.textFieldValue){await this.updateTextFieldValue(value);updateCalendarValue(this,value);}},immediate:true}},mounted(){logic.ValidationService.addValidatorsToElement(getInputElement(this),{date:{},dateFormat:{},minDate:{limit:this.minDate.toString()},maxDate:{limit:this.maxDate.toString()}},true);},methods:{dateFormatter:logic.parseDate,async onValidityTextField({detail}){if(this.textFieldValidityRevealed&&detail.validityMode==="INITIAL"){this.textFieldTouched=false;this.componentTouched=false;}if(!this.textFieldTouched&&["blur","change"].includes(detail.nativeEvent)){this.textFieldTouched=true;}if(this.isCalendarOpen){logic.alertScreenReader(detail.validationMessage,{assertive:true});}this.textFieldValidityRevealed=detail.validityMode!=="INITIAL";if(detail.validityMode==="INITIAL"||!this.textFieldTouched||this.componentTouched){return;}const inputElement=getInputElement(this);const pendingValidityEvent=new CustomEvent("pending-validity",{bubbles:false});inputElement.dispatchEvent(pendingValidityEvent);},onChangeTextField(){updateCalendarValue(this,this.textFieldValue);this.$emit("update:modelValue",this.textFieldValue);this.$emit("change",this.textFieldValue);},onClickCalendarButton(){if(!this.isCalendarOpen){this.calendarMonth=getDisplayMonth(this.minDate,this.maxDate,this.calendarValue,this.initialMonth);}this.isCalendarOpen=!this.isCalendarOpen;},onFocusoutTextFieldButton(e){if(this.componentTouched||this.$refs.component===null){return;}const component=getHTMLElementFromVueRef(this.$refs.component);const relatedTarget=e.relatedTarget;if(!component.contains(relatedTarget)){this.componentTouched=true;const inputElement=getInputElement(this);logic.ValidationService.setTouched(inputElement);logic.ValidationService.validateElement(inputElement);}},async onSelectCalendarDay(date2){this.componentTouched=true;this.isCalendarOpen=!this.isDateEnabled(date2);if(!this.isCalendarOpen){getHTMLElementFromVueRef(this.$refs.calendarButton).focus();}this.$emit("update:modelValue",date2.toString());this.$emit("change",date2.toString());await this.updateTextFieldValue(date2.toString());updateCalendarValue(this,date2.toString());},async onKeyupEsc(){this.isCalendarOpen=false;logic.waitForScreenReader(()=>{getHTMLElementFromVueRef(this.$refs.calendarButton).focus();});},async onClickCloseCalendarButton(){this.isCalendarOpen=false;logic.waitForScreenReader(()=>{getHTMLElementFromVueRef(this.$refs.calendarButton).focus();});},onOpenPopup(){if(!this.isCalendarOpen){return;}const popup=getHTMLElementFromVueRef(this.$refs.popup);const navMonth=popup.querySelector(".calendar-navbar__month");if(navMonth){navMonth.focus({preventScroll:true});}},onClosePopup(){this.isCalendarOpen=false;},async onValidationConfigUpdate(event){this.validationConfig=event.detail.config;if(this.validationConfig.minDate){const minDateConfig=this.validationConfig.minDate;if(!minDateConfig.limit){throw new Error("MinDate validator must be set");}this.minDate=date.FDate.fromIso(minDateConfig.limit.toString());}if(this.validationConfig.maxDate){const maxDateConfig=this.validationConfig.maxDate;if(!maxDateConfig.limit){throw new Error("MaxDate validator must be set");}this.maxDate=date.FDate.fromIso(maxDateConfig.limit.toString());}const element=findHTMLElementFromVueRef(this.$refs.calendarInputs);if(element){await this.$nextTick();logic.ValidationService.validateAllElements(element);}},isDateEnabled(day){return isDayEnabled(day,this.validationConfig);},isDaySelected(date2){return this.calendarValue?date2.equals(this.calendarValue):false;},highlightDay(date$1){return this.highlightToday&&date$1.equals(date.FDate.now());},async updateTextFieldValue(newValue){this.textFieldValue=newValue;await this.$nextTick();logic.ValidationService.validateElement(getInputElement(this));}}});const _hoisted_1$u={ref:"component",class:"datepicker-field"};const _hoisted_2$o=["disabled","aria-expanded"];const _hoisted_3$j={class:"sr-only"};const _hoisted_4$f={class:"datepicker-field__close"};function _sfc_render$x(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");const _component_f_text_field=vue.resolveComponent("f-text-field");const _component_f_calendar_day=vue.resolveComponent("f-calendar-day");const _component_f_calendar=vue.resolveComponent("f-calendar");const _component_i_popup=vue.resolveComponent("i-popup");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$u,[vue.createElementVNode("div",{ref:"calendarInputs",onFocusout:_cache[2]||(_cache[2]=(...args)=>_ctx.onFocusoutTextFieldButton&&_ctx.onFocusoutTextFieldButton(...args))},[vue.createVNode(_component_f_text_field,vue.mergeProps(_ctx.$attrs,{modelValue:_ctx.textFieldValue,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>_ctx.textFieldValue=$event),maxlength:"20",disabled:_ctx.disabled,formatter:_ctx.dateFormatter,"label-width":_ctx.labelWidth,"input-width":_ctx.inputWidth,onComponentValidity:_ctx.onValidityTextField,onChange:_ctx.onChangeTextField,onValidationConfigUpdate:_ctx.onValidationConfigUpdate}),vue.createSlots({description:vue.withCtx(({descriptionClass,discreteDescriptionClass})=>[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),"error-message":vue.withCtx(({hasError,validationMessage})=>[vue.renderSlot(_ctx.$slots,"error-message",vue.normalizeProps(vue.guardReactiveProps({hasError,validationMessage})))]),"input-right":vue.withCtx(()=>[vue.createElementVNode("button",{ref:"calendarButton",disabled:_ctx.disabled,class:"datepicker-field__button",type:"button","aria-expanded":_ctx.isCalendarOpen?"true":"false","data-test":"calendar-button",onClick:_cache[0]||(_cache[0]=$event=>_ctx.onClickCalendarButton())},[vue.createVNode(_component_f_icon,{name:"calendar"}),_cache[6]||(_cache[6]=vue.createTextVNode()),vue.createElementVNode("span",_hoisted_3$j,vue.toDisplayString(_ctx.calendarButtonText),1/* TEXT */)],8,_hoisted_2$o)]),default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.datepicker-field.label","Datum")),1/* TEXT */)]),_cache[7]||(_cache[7]=vue.createTextVNode()),_cache[8]||(_cache[8]=vue.createTextVNode()),_cache[9]||(_cache[9]=vue.createTextVNode()),_cache[10]||(_cache[10]=vue.createTextVNode())]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1040,["modelValue","disabled","formatter","label-width","input-width","onComponentValidity","onChange","onValidationConfigUpdate"])],544/* NEED_HYDRATION, NEED_PATCH */),_cache[13]||(_cache[13]=vue.createTextVNode()),vue.createVNode(_component_i_popup,{"is-open":_ctx.isCalendarOpen,anchor:_ctx.calendarInputs,inline:_ctx.alwaysInline?"always":void 0,"set-focus":false,onOpen:_ctx.onOpenPopup,onClose:_ctx.onClosePopup},{default:vue.withCtx(()=>[vue.createElementVNode("div",{ref:"popup",class:vue.normalizeClass(_ctx.popupClass)},[vue.createVNode(_component_f_calendar,{modelValue:_ctx.calendarMonth,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>_ctx.calendarMonth=$event),"tab-date":_ctx.calendarValue,"min-date":_ctx.minDate,"max-date":_ctx.maxDate,onClick:_ctx.onSelectCalendarDay,onKeyup:vue.withKeys(vue.withModifiers(_ctx.onKeyupEsc,["stop"]),["esc","native"])},{default:vue.withCtx(({date:date2,isFocused})=>[vue.createVNode(_component_f_calendar_day,{day:date2,enabled:_ctx.isDateEnabled(date2),focused:isFocused,highlight:_ctx.highlightDay(date2),selected:_ctx.isDaySelected(date2)},null,8,["day","enabled","focused","highlight","selected"])]),_:1/* STABLE */},8,["modelValue","tab-date","min-date","max-date","onClick","onKeyup"]),_cache[12]||(_cache[12]=vue.createTextVNode()),vue.createElementVNode("div",_hoisted_4$f,[vue.createElementVNode("button",{class:"button button--discrete button--discrete--black datepicker-field__close__button",type:"button",onClick:_cache[4]||(_cache[4]=(...args)=>_ctx.onClickCloseCalendarButton&&_ctx.onClickCloseCalendarButton(...args)),onKeyup:_cache[5]||(_cache[5]=vue.withKeys(vue.withModifiers((...args)=>_ctx.onKeyupEsc&&_ctx.onKeyupEsc(...args),["stop"]),["esc"]))},[vue.createElementVNode("span",null,vue.toDisplayString(_ctx.$t("fkui.datepicker-field.close","Stäng")),1/* TEXT */),_cache[11]||(_cache[11]=vue.createTextVNode()),vue.createVNode(_component_f_icon,{"aria-hidden":"true",class:"button__icon",name:"close"})],32/* NEED_HYDRATION */)])],2/* CLASS */)]),_:1/* STABLE */},8,["is-open","anchor","inline","onOpen","onClose"])],512/* NEED_PATCH */);}const FDatepickerField=/* @__PURE__ */_export_sfc(_sfc_main$x,[["render",_sfc_render$x]]);const _sfc_main$w=vue.defineComponent({name:"FExpand",data(){return{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"}};},methods:{enter(element){const htmlElement=getHTMLElementFromVueRef(element);Object.assign(htmlElement.style,this.initialStyle);Object.assign(htmlElement.style,this.hiddenStyle);htmlElement.style.width=getComputedStyle(element).width;const height=getComputedStyle(element).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);});}}});function _sfc_render$w(_ctx,_cache,$props,$setup,$data,$options){return vue.openBlock(),vue.createBlock(vue.Transition,{onEnter:_ctx.enter,onAfterEnter:_ctx.afterEnter,onLeave:_ctx.leave},{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default",{height:_ctx.height})]),_:3/* FORWARDED */},8,["onEnter","onAfterEnter","onLeave"]);}const FExpand=/* @__PURE__ */_export_sfc(_sfc_main$w,[["render",_sfc_render$w]]);const _sfc_main$v=vue.defineComponent({name:"FExpandablePanel",components:{FIcon,FExpand},mixins:[TranslationMixin],inheritAttrs:false,props:{/**
|
|
505
505
|
* Toggle expanded/collapsed state
|
|
506
506
|
*/expanded:{type:Boolean,required:false,default:false},/**
|
|
507
507
|
* Element to render for the header element inside the expandable panel.
|
|
@@ -513,7 +513,7 @@ defaultText:"",descriptionText:"",descriptionScreenReaderText:"",discreteDescrip
|
|
|
513
513
|
* Number of notifications present in panel.
|
|
514
514
|
*
|
|
515
515
|
* If set to zero (default) no notification badge will be displayed.
|
|
516
|
-
*/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$
|
|
516
|
+
*/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$i={class:"icon-stack"};const _hoisted_4$e=["title"];const _hoisted_5$b={class:"sr-only"};const _hoisted_6$7=["id"];const _hoisted_7$7={class:"expandable-panel__body"};const _hoisted_8$5={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$i,[vue.createVNode(_component_f_icon,{name:"dash"}),_cache[1]||(_cache[1]=vue.createTextVNode()),vue.createVNode(_component_f_icon,{name:"dash"})])]),_cache[3]||(_cache[3]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"title"),_cache[4]||(_cache[4]=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$b,vue.toDisplayString(_ctx.screenReaderNotificationText),1/* TEXT */),_cache[2]||(_cache[2]=vue.createTextVNode()),vue.createVNode(_component_f_icon,{name:"bell"})],8,_hoisted_4$e)):vue.createCommentVNode("v-if",true)],16,_hoisted_1$t)]),_:3/* FORWARDED */})),_cache[6]||(_cache[6]=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$7,[vue.renderSlot(_ctx.$slots,"default")]),_cache[5]||(_cache[5]=vue.createTextVNode()),_ctx.hasOutsideSlot?(vue.openBlock(),vue.createElementBlock("div",_hoisted_8$5,[vue.renderSlot(_ctx.$slots,"outside")])):vue.createCommentVNode("v-if",true)],8,_hoisted_6$7),[[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:{/**
|
|
517
517
|
* Toggle expanded/collapsed state
|
|
518
518
|
*/expanded:{type:Boolean,required:false,default:false},/**
|
|
519
519
|
* Element to render for the button elmement
|
|
@@ -527,7 +527,7 @@ defaultText:"",descriptionText:"",descriptionScreenReaderText:"",discreteDescrip
|
|
|
527
527
|
*/list:{type:Boolean,default:false,required:false},/**
|
|
528
528
|
* The id for the content id attribute.
|
|
529
529
|
* If the prop is not set the id will be generated.
|
|
530
|
-
*/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$
|
|
530
|
+
*/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$h={class:"icon-stack"};const _hoisted_4$d={key:0,class:"expandable-paragraph__related-information"};const _hoisted_5$a=["id"];const _hoisted_6$6={class:"expandable-paragraph__content"};const _hoisted_7$6={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$h,[vue.createVNode(_component_f_icon,{name:"dash"}),_cache[1]||(_cache[1]=vue.createTextVNode()),vue.createVNode(_component_f_icon,{name:"dash"})])]),_cache[2]||(_cache[2]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"title")],16,_hoisted_1$s)]),_:3/* FORWARDED */},8,["class"])),_cache[3]||(_cache[3]=vue.createTextVNode()),_ctx.hasRelatedSlot?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$d,[vue.renderSlot(_ctx.$slots,"related")])):vue.createCommentVNode("v-if",true)],2/* CLASS */),_cache[5]||(_cache[5]=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$6,[vue.renderSlot(_ctx.$slots,"default")]),_cache[4]||(_cache[4]=vue.createTextVNode()),!_ctx.list?(vue.openBlock(),vue.createElementBlock("div",_hoisted_7$6)):vue.createCommentVNode("v-if",true)],8,_hoisted_5$a),[[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:{/**
|
|
531
531
|
* The id for the input id attribute.
|
|
532
532
|
* The id for the label for attribute.
|
|
533
533
|
* If the prop is not set a random value will be generated.
|
|
@@ -539,11 +539,11 @@ defaultText:"",descriptionText:"",descriptionScreenReaderText:"",discreteDescrip
|
|
|
539
539
|
* The name of the file uploaded
|
|
540
540
|
*/originalMimeType:{type:String,required:false,default:void 0},/**
|
|
541
541
|
* If file name changed, this info will be displayed, placeholder %before% and %after% will be replaced with originalMimeType and mimeType
|
|
542
|
-
*/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$
|
|
542
|
+
*/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$g=["id"];const _hoisted_4$c={class:"icon-stack button__icon icon-stack--new-window"};const _hoisted_5$9={class:"file-item__file-name"};const _hoisted_6$5={class:"sr-only"};const _hoisted_7$5={key:0,class:"file-item__change-info"};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$c,[vue.createVNode(_component_f_icon,{name:"new-window"}),_cache[0]||(_cache[0]=vue.createTextVNode()),vue.createVNode(_component_f_icon,{name:_ctx.iconName},null,8,["name"])]),_cache[1]||(_cache[1]=vue.createTextVNode()),vue.createElementVNode("span",_hoisted_5$9,vue.toDisplayString(_ctx.fileName),1/* TEXT */),_cache[2]||(_cache[2]=vue.createTextVNode()),vue.createElementVNode("span",_hoisted_6$5," "+vue.toDisplayString(_ctx.$t("fkui.file-item.file-open","öppnas i nytt fönster")),1/* TEXT */)],16,_hoisted_3$g),_cache[3]||(_cache[3]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"row")]),_cache[4]||(_cache[4]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"default"),_cache[5]||(_cache[5]=vue.createTextVNode()),_ctx.isMimeTypeChanged?(vue.openBlock(),vue.createElementBlock("div",_hoisted_7$5,vue.toDisplayString(_ctx.mimeTypeChangedText),1/* TEXT */)):vue.createCommentVNode("v-if",true),_cache[6]||(_cache[6]=vue.createTextVNode()),_cache[7]||(_cache[7]=vue.createElementVNode("hr",{class:"file-item__separator"},null,-1/* HOISTED */))]);}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:{/**
|
|
543
543
|
* The id for the input id attribute.
|
|
544
544
|
* The id for the label for attribute.
|
|
545
545
|
* If the prop is not set a random value will be generated.
|
|
546
|
-
*/id:{type:String,required:false,default:()=>logic.ElementIdService.generateElementId()},disabled:{type:Boolean,required:false,default:false}},emits:["change"],computed:{attrs(){return{...this.$attrs,id:this.id,onChange:event=>{if(event.target instanceof HTMLInputElement){this.$emit("change",event.target.files);}}};},labelClass(){return this.disabled?"disabled":"enabled";},labelId(){return`${this.id}_label`;},ariaDisabled(){return this.disabled?"true":void 0;}},methods:{onClick(event){if(this.disabled){event.preventDefault();return;}const input=this.$refs["file-selector"];input.value="";}}});const _hoisted_1$q={class:"file-selector"};const _hoisted_2$k=["id","aria-labelledby","aria-disabled"];const _hoisted_3$
|
|
546
|
+
*/id:{type:String,required:false,default:()=>logic.ElementIdService.generateElementId()},disabled:{type:Boolean,required:false,default:false}},emits:["change"],computed:{attrs(){return{...this.$attrs,id:this.id,onChange:event=>{if(event.target instanceof HTMLInputElement){this.$emit("change",event.target.files);}}};},labelClass(){return this.disabled?"disabled":"enabled";},labelId(){return`${this.id}_label`;},ariaDisabled(){return this.disabled?"true":void 0;}},methods:{onClick(event){if(this.disabled){event.preventDefault();return;}const input=this.$refs["file-selector"];input.value="";}}});const _hoisted_1$q={class:"file-selector"};const _hoisted_2$k=["id","aria-labelledby","aria-disabled"];const _hoisted_3$f=["id","for"];function _sfc_render$s(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$q,[vue.createElementVNode("input",vue.mergeProps({id:_ctx.id,ref:"file-selector",type:"file","aria-labelledby":_ctx.labelId,"aria-disabled":_ctx.ariaDisabled?"true":void 0},_ctx.attrs,{onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.onClick&&_ctx.onClick(...args))}),null,16,_hoisted_2$k),_cache[2]||(_cache[2]=vue.createTextVNode()),vue.createElementVNode("label",{id:_ctx.labelId,role:"button",class:vue.normalizeClass([_ctx.labelClass,"button button--tertiary button--medium"]),for:_ctx.id,"aria-hidden":"true"},[vue.createVNode(_component_f_icon,{class:"button__icon",name:"paper-clip"}),_cache[1]||(_cache[1]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"default")],10,_hoisted_3$f)]);}const FFileSelector=/* @__PURE__ */_export_sfc(_sfc_main$s,[["render",_sfc_render$s]]);const iconClasses={success:{symbol:"circle",sign:"success",screenReaderContextKey:"fkui.message-box.sr-context.success",screenReaderContextDefault:"Meddelande"},warning:{symbol:"circle",sign:"alert",screenReaderContextKey:"fkui.message-box.sr-context.warning",screenReaderContextDefault:"Varningsmeddelande"},error:{symbol:"triangle",sign:"alert",screenReaderContextKey:"fkui.message-box.sr-context.error",screenReaderContextDefault:"Felmeddelande"},info:{symbol:"circle",sign:"i",screenReaderContextKey:"fkui.message-box.sr-context.info",screenReaderContextDefault:"Informationsmeddelande"}};const _sfc_main$r=vue.defineComponent({name:"FMessageBox",components:{FIcon,IFlex,IFlexItem},props:{/**
|
|
547
547
|
* Type of message-box. 'success', 'error', 'warning' and 'info' is valid.
|
|
548
548
|
* */type:{type:String,required:true,validator(value){return["success","warning","error","info"].includes(value);}},/**
|
|
549
549
|
* If message-box should be a banner.
|
|
@@ -558,7 +558,7 @@ defaultText:"",descriptionText:"",descriptionScreenReaderText:"",discreteDescrip
|
|
|
558
558
|
*
|
|
559
559
|
* - 'normal' - Use normal layout when need for heading and/or longer text/multiple sentences
|
|
560
560
|
* - 'short' - Use short layout when only need for shorter text
|
|
561
|
-
*/layout:{type:String,required:false,default:"standard",validator(value){return["standard","short"].includes(value);}}},data(){return{headingClass:["message-box__heading"]};},computed:{messageBoxType(){if(this.layout==="short"){return`message-box--${this.type}-short`;}else{return`message-box--${this.type}`;}},bannerType(){return this.banner?`message-box--banner`:"";},classType(){return`icon__${this.type}`;},classIcon(){return iconClasses[this.type].symbol==="circle"&&iconClasses[this.type].sign==="alert"?`icon__exclamation`:"";},stackTypeClass(){return`icon-stack--${this.type}`;},symbol(){return iconClasses[this.type].symbol;},sign(){return iconClasses[this.type].sign;}},methods:{screenReaderContext(){return logic.TranslationService.provider.translate(iconClasses[this.type].screenReaderContextKey,iconClasses[this.type].screenReaderContextDefault);}}});const _hoisted_1$p={key:0,class:"sr-only"};function _sfc_render$r(_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",{class:vue.normalizeClass(["message-box",[_ctx.messageBoxType,_ctx.bannerType]])},[_ctx.provideScreenReaderContext?(vue.openBlock(),vue.createElementBlock("span",_hoisted_1$p,vue.toDisplayString(_ctx.screenReaderContext()),1/* TEXT */)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createVNode(_component_i_flex,{gap:"2x"},{default:vue.withCtx(()=>[_ctx.layout==="short"?(vue.openBlock(),vue.createBlock(_component_i_flex_item,{key:0,class:"message-box__icon",shrink:"",align:"center"},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(["icon-stack",_ctx.stackTypeClass])},[vue.createVNode(_component_f_icon,{class:vue.normalizeClass(_ctx.classType),name:_ctx.symbol},null,8,["class","name"]),vue.createTextVNode(),vue.createVNode(_component_f_icon,{class:vue.normalizeClass(_ctx.classIcon),name:_ctx.sign},null,8,["class","name"])],2/* CLASS */)]),_:1/* STABLE */})):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createVNode(_component_i_flex_item,{class:"message-box__content",grow:"",align:"center"},{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default",vue.normalizeProps(vue.guardReactiveProps(_ctx.layout==="short"?{}:{headingSlotClass:_ctx.headingClass})))]),_:3/* FORWARDED */})]),_:3/* FORWARDED */})],2/* CLASS */);}const FMessageBox=/* @__PURE__ */_export_sfc(_sfc_main$r,[["render",_sfc_render$r]]);const setRef=Symbol("setRef");const getRef=Symbol("getRef");const setIsOpen=Symbol("setIsOpen");function createFFormProvideOptions(vm){const{components}=vm;return{[setRef](id,data){components[id]=new logic.Reference(data);},[getRef](id){return components[id];},[setIsOpen](id,isOpen){const steps=Object.values(components).filter(isFormStepReference);for(const step2 of steps){step2.ref.isOpen=false;}const step=components[id];if(isFormStepReference(step)){step.ref.isOpen=isOpen;}}};}const _sfc_main$q=vue.defineComponent({name:"FForm",components:{FMessageBox,FErrorList},provide(){return createFFormProvideOptions(this);},inheritAttrs:false,props:{/**
|
|
561
|
+
*/layout:{type:String,required:false,default:"standard",validator(value){return["standard","short"].includes(value);}}},data(){return{headingClass:["message-box__heading"]};},computed:{messageBoxType(){if(this.layout==="short"){return`message-box--${this.type}-short`;}else{return`message-box--${this.type}`;}},bannerType(){return this.banner?`message-box--banner`:"";},classType(){return`icon__${this.type}`;},classIcon(){return iconClasses[this.type].symbol==="circle"&&iconClasses[this.type].sign==="alert"?`icon__exclamation`:"";},stackTypeClass(){return`icon-stack--${this.type}`;},symbol(){return iconClasses[this.type].symbol;},sign(){return iconClasses[this.type].sign;}},methods:{screenReaderContext(){return logic.TranslationService.provider.translate(iconClasses[this.type].screenReaderContextKey,iconClasses[this.type].screenReaderContextDefault);}}});const _hoisted_1$p={key:0,class:"sr-only"};function _sfc_render$r(_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",{class:vue.normalizeClass(["message-box",[_ctx.messageBoxType,_ctx.bannerType]])},[_ctx.provideScreenReaderContext?(vue.openBlock(),vue.createElementBlock("span",_hoisted_1$p,vue.toDisplayString(_ctx.screenReaderContext()),1/* TEXT */)):vue.createCommentVNode("v-if",true),_cache[2]||(_cache[2]=vue.createTextVNode()),vue.createVNode(_component_i_flex,{gap:"2x"},{default:vue.withCtx(()=>[_ctx.layout==="short"?(vue.openBlock(),vue.createBlock(_component_i_flex_item,{key:0,class:"message-box__icon",shrink:"",align:"center"},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(["icon-stack",_ctx.stackTypeClass])},[vue.createVNode(_component_f_icon,{class:vue.normalizeClass(_ctx.classType),name:_ctx.symbol},null,8,["class","name"]),_cache[0]||(_cache[0]=vue.createTextVNode()),vue.createVNode(_component_f_icon,{class:vue.normalizeClass(_ctx.classIcon),name:_ctx.sign},null,8,["class","name"])],2/* CLASS */)]),_:1/* STABLE */})):vue.createCommentVNode("v-if",true),_cache[1]||(_cache[1]=vue.createTextVNode()),vue.createVNode(_component_i_flex_item,{class:"message-box__content",grow:"",align:"center"},{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default",vue.normalizeProps(vue.guardReactiveProps(_ctx.layout==="short"?{}:{headingSlotClass:_ctx.headingClass})))]),_:3/* FORWARDED */})]),_:3/* FORWARDED */})],2/* CLASS */);}const FMessageBox=/* @__PURE__ */_export_sfc(_sfc_main$r,[["render",_sfc_render$r]]);const setRef=Symbol("setRef");const getRef=Symbol("getRef");const setIsOpen=Symbol("setIsOpen");function createFFormProvideOptions(vm){const{components}=vm;return{[setRef](id,data){components[id]=new logic.Reference(data);},[getRef](id){return components[id];},[setIsOpen](id,isOpen){const steps=Object.values(components).filter(isFormStepReference);for(const step2 of steps){step2.ref.isOpen=false;}const step=components[id];if(isFormStepReference(step)){step.ref.isOpen=isOpen;}}};}const _sfc_main$q=vue.defineComponent({name:"FForm",components:{FMessageBox,FErrorList},provide(){return createFFormProvideOptions(this);},inheritAttrs:false,props:{/**
|
|
562
562
|
* The id for the form id attribute.
|
|
563
563
|
* If the prop is not set a random value will be generated.
|
|
564
564
|
*/id:{type:String,required:false,default:()=>logic.ElementIdService.generateElementId()},/**
|
|
@@ -569,7 +569,7 @@ defaultText:"",descriptionText:"",descriptionScreenReaderText:"",discreteDescrip
|
|
|
569
569
|
* field should occur. The default, "center", centres the error information
|
|
570
570
|
* vertically. Allowed value is also "top" which scrolls such that the error
|
|
571
571
|
* informations top is at the top of the viewport.
|
|
572
|
-
*/errorScroll:{type:String,default:"center",validator(value){return["center","top"].includes(value);}}},data(){return{errorMessageSlotClass:["message-box__heading"],components:{}};},computed:{attrs(){let onSubmit;if(this.$attrs.onSubmit){const originalSubmit=this.$attrs.onSubmit;onSubmit=async event=>{const isValid=await this.onSubmit(event);if(isValid){if(Array.isArray(originalSubmit)){originalSubmit.forEach(submitFunction=>submitFunction(event));}else{originalSubmit(event);}}};}else{onSubmit=this.onSubmit;}const attrs={...this.$attrs,id:this.id,onSubmit};return attrs;},numberOfTimesSubmitted(){const components=Object.values(this.components);return Math.max(0,...components.map(it=>it.ref.numberOfTimesSubmitted));},isSubmitted(){return this.numberOfTimesSubmitted>0;},hasError(){if(Object.values(this.components).length===0){return false;}else{const components=Object.values(this.components);return components.some(component=>component.ref.isValid===false);}},componentsWithErrors(){const sortedComponents=sortComponentsWithErrorsOnDOMOrder(this.components);return sortedComponents.map(c=>c.ref);},needsErrorScroll(){return this.errorScroll!=="center";}},methods:{async focusDomElement(){await this.$nextTick();const messageBoxError=this.$el.querySelector(".message-box--error");if(messageBoxError){logic.focus(messageBoxError,{scrollToTop:this.needsErrorScroll});}},async focusFallbackElement(){await this.$nextTick();const element=this.$el.querySelector(".form-step__header");const invalidElement=this.$el.querySelector(":invalid");if(element){logic.focus(element,{scrollToTop:this.needsErrorScroll});}else if(invalidElement){logic.focus(invalidElement,{force:true,scrollToTop:this.needsErrorScroll});}},async onSubmit(event){event.preventDefault();const components=Object.values(this.components);components.forEach(component=>{component.ref.numberOfTimesSubmitted++;if(!isFormStepReference(component)){logic.ValidationService.setTouched(component.ref.id);logic.ValidationService.setSubmitted(component.ref.id);}});await cleanUpElements(this);await logic.ValidationService.validateAllElements(this.id);if(this.displayError){this.focusDomElement();}else{this.focusFallbackElement();}return this.hasError===false;},async onComponentValidity(event){const reference=new logic.Reference({id:event.detail.elementId,focusElementId:event.detail.focusElementId,title:event.detail.errorMessage,isValid:event.detail.isValid,numberOfTimesSubmitted:this.numberOfTimesSubmitted});this.components[event.detail.elementId]=reference;await cleanUpElements(this);}}});const _hoisted_1$o=["id"];function _sfc_render$q(_ctx,_cache,$props,$setup,$data,$options){const _component_f_error_list=vue.resolveComponent("f-error-list");const _component_f_message_box=vue.resolveComponent("f-message-box");return vue.openBlock(),vue.createElementBlock("form",vue.mergeProps({id:_ctx.id,class:"form",novalidate:""},_ctx.attrs,{onComponentValidity:_cache[0]||(_cache[0]=(...args)=>_ctx.onComponentValidity&&_ctx.onComponentValidity(...args))}),[_ctx.displayError&&_ctx.isSubmitted&&_ctx.hasError?(vue.openBlock(),vue.createBlock(_component_f_message_box,{key:0,tabindex:"-1",type:"error"},{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"error-message",vue.normalizeProps(vue.guardReactiveProps({slotClass:_ctx.errorMessageSlotClass}))),vue.createTextVNode(),vue.createElementVNode("nav",null,[vue.createVNode(_component_f_error_list,{items:_ctx.componentsWithErrors},null,8,["items"])])]),_:3/* FORWARDED */})):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"default")],16,_hoisted_1$o);}const FForm=/* @__PURE__ */_export_sfc(_sfc_main$q,[["render",_sfc_render$q]]);const _sfc_main$p=vue.defineComponent({name:"FFormStep",components:{FIcon,FValidationGroup,FErrorList},mixins:[TranslationMixin],inheritAttrs:false,props:{/**
|
|
572
|
+
*/errorScroll:{type:String,default:"center",validator(value){return["center","top"].includes(value);}}},data(){return{errorMessageSlotClass:["message-box__heading"],components:{}};},computed:{attrs(){let onSubmit;if(this.$attrs.onSubmit){const originalSubmit=this.$attrs.onSubmit;onSubmit=async event=>{const isValid=await this.onSubmit(event);if(isValid){if(Array.isArray(originalSubmit)){originalSubmit.forEach(submitFunction=>submitFunction(event));}else{originalSubmit(event);}}};}else{onSubmit=this.onSubmit;}const attrs={...this.$attrs,id:this.id,onSubmit};return attrs;},numberOfTimesSubmitted(){const components=Object.values(this.components);return Math.max(0,...components.map(it=>it.ref.numberOfTimesSubmitted));},isSubmitted(){return this.numberOfTimesSubmitted>0;},hasError(){if(Object.values(this.components).length===0){return false;}else{const components=Object.values(this.components);return components.some(component=>component.ref.isValid===false);}},componentsWithErrors(){const sortedComponents=sortComponentsWithErrorsOnDOMOrder(this.components);return sortedComponents.map(c=>c.ref);},needsErrorScroll(){return this.errorScroll!=="center";}},methods:{async focusDomElement(){await this.$nextTick();const messageBoxError=this.$el.querySelector(".message-box--error");if(messageBoxError){logic.focus(messageBoxError,{scrollToTop:this.needsErrorScroll});}},async focusFallbackElement(){await this.$nextTick();const element=this.$el.querySelector(".form-step__header");const invalidElement=this.$el.querySelector(":invalid");if(element){logic.focus(element,{scrollToTop:this.needsErrorScroll});}else if(invalidElement){logic.focus(invalidElement,{force:true,scrollToTop:this.needsErrorScroll});}},async onSubmit(event){event.preventDefault();const components=Object.values(this.components);components.forEach(component=>{component.ref.numberOfTimesSubmitted++;if(!isFormStepReference(component)){logic.ValidationService.setTouched(component.ref.id);logic.ValidationService.setSubmitted(component.ref.id);}});await cleanUpElements(this);await logic.ValidationService.validateAllElements(this.id);if(this.displayError){this.focusDomElement();}else{this.focusFallbackElement();}return this.hasError===false;},async onComponentValidity(event){const reference=new logic.Reference({id:event.detail.elementId,focusElementId:event.detail.focusElementId,title:event.detail.errorMessage,isValid:event.detail.isValid,numberOfTimesSubmitted:this.numberOfTimesSubmitted});this.components[event.detail.elementId]=reference;await cleanUpElements(this);}}});const _hoisted_1$o=["id"];function _sfc_render$q(_ctx,_cache,$props,$setup,$data,$options){const _component_f_error_list=vue.resolveComponent("f-error-list");const _component_f_message_box=vue.resolveComponent("f-message-box");return vue.openBlock(),vue.createElementBlock("form",vue.mergeProps({id:_ctx.id,class:"form",novalidate:""},_ctx.attrs,{onComponentValidity:_cache[0]||(_cache[0]=(...args)=>_ctx.onComponentValidity&&_ctx.onComponentValidity(...args))}),[_ctx.displayError&&_ctx.isSubmitted&&_ctx.hasError?(vue.openBlock(),vue.createBlock(_component_f_message_box,{key:0,tabindex:"-1",type:"error"},{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"error-message",vue.normalizeProps(vue.guardReactiveProps({slotClass:_ctx.errorMessageSlotClass}))),_cache[1]||(_cache[1]=vue.createTextVNode()),vue.createElementVNode("nav",null,[vue.createVNode(_component_f_error_list,{items:_ctx.componentsWithErrors},null,8,["items"])])]),_:3/* FORWARDED */})):vue.createCommentVNode("v-if",true),_cache[2]||(_cache[2]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"default")],16,_hoisted_1$o);}const FForm=/* @__PURE__ */_export_sfc(_sfc_main$q,[["render",_sfc_render$q]]);const _sfc_main$p=vue.defineComponent({name:"FFormStep",components:{FIcon,FValidationGroup,FErrorList},mixins:[TranslationMixin],inheritAttrs:false,props:{/**
|
|
573
573
|
* The id for the root div id attribute.
|
|
574
574
|
* If the prop is not set a random value will be generated.
|
|
575
575
|
*/id:{type:String,required:true,default:()=>logic.ElementIdService.generateElementId()},/**
|
|
@@ -586,19 +586,19 @@ injected(){return this;},isSubmitted(){return this.self.ref.numberOfTimesSubmitt
|
|
|
586
586
|
* Toggle if open or closed.
|
|
587
587
|
* If another form step is open then it will be closed.
|
|
588
588
|
* @public
|
|
589
|
-
*/toggleIsOpen(){this.injected.setIsOpen(this.id,!this.self.ref.isOpen);if(this.self.ref.isAnyFieldTouched&&this.self.ref.isOpen===false){if(this.isOpenedClosed===false){this.isOpenedClosed=true;}logic.ValidationService.setTouched(this.$el);logic.ValidationService.validateAllElements(this.id);}this.focusDomElement();},onComponentValidity(event){const hasReceivedValidOrErrorEvent=event.detail.validityMode==="VALID"||event.detail.validityMode==="ERROR";if(hasReceivedValidOrErrorEvent&&this.self.ref.isOpen){this.self.ref.isAnyFieldTouched=true;}}}});const _hoisted_1$n={class:"form-step__header",tabindex:"-1",role:"group"};const _hoisted_2$j=["id"];const _hoisted_3$
|
|
589
|
+
*/toggleIsOpen(){this.injected.setIsOpen(this.id,!this.self.ref.isOpen);if(this.self.ref.isAnyFieldTouched&&this.self.ref.isOpen===false){if(this.isOpenedClosed===false){this.isOpenedClosed=true;}logic.ValidationService.setTouched(this.$el);logic.ValidationService.validateAllElements(this.id);}this.focusDomElement();},onComponentValidity(event){const hasReceivedValidOrErrorEvent=event.detail.validityMode==="VALID"||event.detail.validityMode==="ERROR";if(hasReceivedValidOrErrorEvent&&this.self.ref.isOpen){this.self.ref.isAnyFieldTouched=true;}}}});const _hoisted_1$n={class:"form-step__header",tabindex:"-1",role:"group"};const _hoisted_2$j=["id"];const _hoisted_3$e={key:0,class:"form-step__arrow"};function _sfc_render$p(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");const _component_f_error_list=vue.resolveComponent("f-error-list");const _component_f_validation_group=vue.resolveComponent("f-validation-group");return vue.openBlock(),vue.createBlock(_component_f_validation_group,vue.mergeProps({id:_ctx.id},_ctx.attrs,{key:_ctx.validationGroupKey,modelValue:_ctx.groupValidity,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>_ctx.groupValidity=$event),class:"form-step","stop-propagation":true}),{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$n,[vue.renderSlot(_ctx.$slots,"header",vue.normalizeProps(vue.guardReactiveProps({slotClass:_ctx.headerSlotClass,..._ctx.self.ref,toggleIsOpen:_ctx.toggleIsOpen}))),_cache[2]||(_cache[2]=vue.createTextVNode()),_ctx.self.ref.isValid?(vue.openBlock(),vue.createBlock(_component_f_icon,{key:0,class:"form-step__check",name:"success"})):vue.createCommentVNode("v-if",true)]),_cache[4]||(_cache[4]=vue.createTextVNode()),_ctx.displayErrorList?(vue.openBlock(),vue.createElementBlock("div",{key:0,id:_ctx.stepErrorId,class:"form-step__error",tabindex:"-1",role:"group"},[vue.createElementVNode("nav",null,[vue.createVNode(_component_f_error_list,{bullets:true,items:_ctx.componentsWithError,"before-navigate":_ctx.beforeNavigateToError},{title:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"error-message",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.defaultErrorMessage),1/* TEXT */)])]),_:3/* FORWARDED */},8,["items","before-navigate"])])],8,_hoisted_2$j)):vue.createCommentVNode("v-if",true),_cache[5]||(_cache[5]=vue.createTextVNode()),vue.createElementVNode("div",{onComponentValidity:_cache[0]||(_cache[0]=(...args)=>_ctx.onComponentValidity&&_ctx.onComponentValidity(...args))},[vue.renderSlot(_ctx.$slots,"default",vue.normalizeProps(vue.guardReactiveProps({..._ctx.self.ref,isSubmitted:_ctx.isSubmitted,toggleIsOpen:_ctx.toggleIsOpen}))),_cache[3]||(_cache[3]=vue.createTextVNode()),_ctx.hasArrow?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$e)):vue.createCommentVNode("v-if",true)],32/* NEED_HYDRATION */)]),_:3/* FORWARDED */},16,["id","modelValue"]);}const FFormStep=/* @__PURE__ */_export_sfc(_sfc_main$p,[["render",_sfc_render$p]]);const _sfc_main$o=vue.defineComponent({name:"FFormStepButton",components:{FIcon},mixins:[TranslationMixin],inheritAttrs:false,model:{prop:"sr-only"},props:{/**
|
|
590
590
|
* If the id is not set a random value will be generated.
|
|
591
|
-
*/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$
|
|
591
|
+
*/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 */)),_cache[0]||(_cache[0]=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$d={class:"card__content"};const _hoisted_4$b={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),_cache[0]||(_cache[0]=vue.createTextVNode()),vue.createElementVNode("div",_hoisted_3$d,[vue.renderSlot(_ctx.$slots,"default")]),_cache[1]||(_cache[1]=vue.createTextVNode()),_ctx.hasFooterSlot?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$b,[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$c={key:1};const _hoisted_4$a={ref:"primary-content",class:"layout-application-template__main"};const _hoisted_5$8={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),_cache[0]||(_cache[0]=vue.createTextVNode()),_ctx.showTopNavigation?(vue.openBlock(),vue.createElementBlock("nav",_hoisted_3$c,[vue.renderSlot(_ctx.$slots,"top-navigation")])):vue.createCommentVNode("v-if",true)],512/* NEED_PATCH */)):vue.createCommentVNode("v-if",true),_cache[2]||(_cache[2]=vue.createTextVNode()),vue.createElementVNode("main",_hoisted_4$a,[vue.renderSlot(_ctx.$slots,"default"),_cache[1]||(_cache[1]=vue.createTextVNode()),_ctx.showFooter?(vue.openBlock(),vue.createElementBlock("footer",_hoisted_5$8,[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:{/**
|
|
592
592
|
* The default width for the panel in pixels
|
|
593
593
|
*/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
|
|
594
|
-
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$
|
|
594
|
+
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$b={class:"layout-navigation__navigation__inner"};const _hoisted_4$9={key:1,class:"layout-navigation__navigation__inner--minimized"};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$b,[_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"),_cache[5]||(_cache[5]=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))},[_cache[3]||(_cache[3]=vue.createElementVNode("span",{class:"sr-only"},"Stäng navigationspanelen",-1/* HOISTED */)),_cache[4]||(_cache[4]=vue.createTextVNode()),vue.createVNode(_component_f_icon,{class:"button__icon",name:"chevrons-left"})],512/* NEED_PATCH */)],4/* STYLE */),_cache[6]||(_cache[6]=vue.createTextVNode()),_cache[7]||(_cache[7]=vue.createElementVNode("div",null,[vue.createElementVNode("hr")],-1/* HOISTED */)),_cache[8]||(_cache[8]=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),_cache[11]||(_cache[11]=vue.createTextVNode()),!_ctx.isOpen?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$9,[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))},[_cache[9]||(_cache[9]=vue.createElementVNode("span",{class:"sr-only"},"Öppna navigationspanelen",-1/* HOISTED */)),_cache[10]||(_cache[10]=vue.createTextVNode()),vue.createVNode(_component_f_icon,{class:"button__icon",name:"bars"})],512/* NEED_PATCH */)])):vue.createCommentVNode("v-if",true)]),_cache[13]||(_cache[13]=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))},_cache[12]||(_cache[12]=[vue.createElementVNode("div",{class:"layout-navigation__navigation__border__dot"},null,-1/* HOISTED */),vue.createTextVNode(),vue.createElementVNode("div",{class:"layout-navigation__navigation__border__dot"},null,-1/* HOISTED */),vue.createTextVNode(),vue.createElementVNode("div",{class:"layout-navigation__navigation__border__dot"},null,-1/* HOISTED */)]),32/* NEED_HYDRATION */)):vue.createCommentVNode("v-if",true)],12,_hoisted_2$f),_cache[14]||(_cache[14]=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:{/**
|
|
595
595
|
* The default width for the panel in pixels
|
|
596
596
|
*/initialWidth:{type:String,default:"320"},/**
|
|
597
597
|
* The default maximun width for the panel in percentage where 1 is 100% and 0 is 0%
|
|
598
598
|
*/maxWidth:{type:Number,default:0.5,validator(value){return typeof value==="number"&&value>0&&value<=1;}},/**
|
|
599
599
|
* The default minium width for the panel in pixels
|
|
600
600
|
*/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
|
|
601
|
-
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
|
|
601
|
+
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={class:"layout-secondary__secondary__inner"};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 */),_cache[10]||(_cache[10]=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))},_cache[2]||(_cache[2]=[vue.createElementVNode("div",{class:"layout-secondary__secondary__border__dot"},null,-1/* HOISTED */),vue.createTextVNode(),vue.createElementVNode("div",{class:"layout-secondary__secondary__border__dot"},null,-1/* HOISTED */),vue.createTextVNode(),vue.createElementVNode("div",{class:"layout-secondary__secondary__border__dot"},null,-1/* HOISTED */)]),32/* NEED_HYDRATION */),_cache[9]||(_cache[9]=vue.createTextVNode()),vue.createElementVNode("div",_hoisted_2$e,[vue.createElementVNode("div",{ref:"title",class:"layout-secondary__secondary__inner__title",style:vue.normalizeStyle(_ctx.contentStyle)},[vue.renderSlot(_ctx.$slots,"heading")],4/* STYLE */),_cache[6]||(_cache[6]=vue.createTextVNode()),_cache[7]||(_cache[7]=vue.createElementVNode("div",null,[vue.createElementVNode("hr",{"aria-hidden":"true"})],-1/* HOISTED */)),_cache[8]||(_cache[8]=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"),_cache[5]||(_cache[5]=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))},[_cache[3]||(_cache[3]=vue.createElementVNode("span",{class:"sr-only"},"Stäng sekundärpanelen",-1/* HOISTED */)),_cache[4]||(_cache[4]=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:{/**
|
|
602
602
|
* The items to be listed.
|
|
603
603
|
* The items will be listed in the given array order.
|
|
604
604
|
*/items:{type:Array,required:true},/**
|
|
@@ -624,7 +624,7 @@ getItemId(item){return`${this.elementId}_item_${this.itemKey(item)}`;},// Focus
|
|
|
624
624
|
// By setting position to relative the
|
|
625
625
|
// item and box-shadow is drawn with a higher z-index,
|
|
626
626
|
// thus no focus border under other list items.
|
|
627
|
-
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$
|
|
627
|
+
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$a={class:"list__item__itempane"};const _hoisted_4$8=["tabindex"];const _hoisted_5$7=["id","aria-labelledby","tabindex","onKeydown"];const _hoisted_6$4=["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 */)),_cache[2]||(_cache[2]=vue.createTextVNode()),_ctx.isEmpty?(vue.openBlock(),vue.createElementBlock("li",_hoisted_2$d,[vue.createElementVNode("div",_hoisted_3$a,[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$4)):vue.createCommentVNode("v-if",true),_cache[3]||(_cache[3]=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$7);}),128/* KEYED_FRAGMENT */)),_cache[4]||(_cache[4]=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 *//**
|
|
628
628
|
* Determine if the loader is visible or not
|
|
629
629
|
*/show:{type:Boolean,required:true,default:false},/**
|
|
630
630
|
* If loader should be displayed as a fullscreen overlay.
|
|
@@ -633,7 +633,7 @@ onItemFocus(event){if(event&&event.target){event.target.style.position="relative
|
|
|
633
633
|
*/delay:{type:Boolean,required:false,default:false},/**
|
|
634
634
|
* Language used for determining fallback value for the loading text. Useful if loader is displayed before
|
|
635
635
|
* text keys have been downloaded
|
|
636
|
-
*/language:{type:String,required:false,default:"sv"}},data(){return{oldFocus:void 0};},computed:{defaultLoadingText(){return this.language==="en"?"Please wait":"Vänligen vänta";},classes(){return{"loader--overlay":this.overlay,"loader--delay":this.delay};},teleportTarget(){return config.teleportTarget;},teleportDisabled(){return!this.overlay;}},watch:{show(show){if(show){this.openLoader();}else{this.closeLoader();}}},mounted(){if(this.show){this.openLoader();}},methods:{async listener(){await this.$nextTick();focus(this.$refs["loader-text"]);},async openLoader(){if(this.overlay){logic.saveFocus(document);this.listener();logic.addFocusListener(logic.findTabbableElements(document),this.listener);}},closeLoader(){if(this.overlay){logic.removeFocusListener(logic.findTabbableElements(document),this.listener);logic.restoreFocus();}}}});const _hoisted_1$g={class:"loader__backdrop"};const _hoisted_2$c
|
|
636
|
+
*/language:{type:String,required:false,default:"sv"}},data(){return{oldFocus:void 0};},computed:{defaultLoadingText(){return this.language==="en"?"Please wait":"Vänligen vänta";},classes(){return{"loader--overlay":this.overlay,"loader--delay":this.delay};},teleportTarget(){return config.teleportTarget;},teleportDisabled(){return!this.overlay;}},watch:{show(show){if(show){this.openLoader();}else{this.closeLoader();}}},mounted(){if(this.show){this.openLoader();}},methods:{async listener(){await this.$nextTick();focus(this.$refs["loader-text"]);},async openLoader(){if(this.overlay){logic.saveFocus(document);this.listener();logic.addFocusListener(logic.findTabbableElements(document),this.listener);}},closeLoader(){if(this.overlay){logic.removeFocusListener(logic.findTabbableElements(document),this.listener);logic.restoreFocus();}}}});const _hoisted_1$g={class:"loader__backdrop"};const _hoisted_2$c={role:"alert"};function _sfc_render$i(_ctx,_cache,$props,$setup,$data,$options){return vue.openBlock(),vue.createBlock(vue.Teleport,{to:_ctx.teleportTarget,disabled:_ctx.teleportDisabled},[vue.withDirectives(vue.createElementVNode("div",vue.mergeProps(_ctx.$attrs,{class:["loader",_ctx.classes]}),[vue.createElementVNode("div",_hoisted_1$g,[_cache[0]||(_cache[0]=vue.createElementVNode("div",{class:"loader__wrapper"},[vue.createElementVNode("div",{class:"loader__spinner-1 loader__spinner"},[vue.createElementVNode("div",{class:"loader__spinner-1-circle1 loader__circle loader__circle--1"}),vue.createTextVNode(),vue.createElementVNode("div",{class:"loader__spinner-1-circle2 loader__circle loader__circle--2"}),vue.createTextVNode(),vue.createElementVNode("div",{class:"loader__spinner-1-circle3 loader__circle loader__circle--3"}),vue.createTextVNode(),vue.createElementVNode("div",{class:"loader__spinner-1-circle4 loader__circle loader__circle--4"})]),vue.createTextVNode(),vue.createElementVNode("div",{class:"loader__spinner-2 loader__spinner"},[vue.createElementVNode("div",{class:"loader__spinner-2-circle1 loader__circle loader__circle--1"}),vue.createTextVNode(),vue.createElementVNode("div",{class:"loader__spinner-2-circle2 loader__circle loader__circle--2"}),vue.createTextVNode(),vue.createElementVNode("div",{class:"loader__spinner-2-circle3 loader__circle loader__circle--3"}),vue.createTextVNode(),vue.createElementVNode("div",{class:"loader__spinner-2-circle4 loader__circle loader__circle--4"})]),vue.createTextVNode(),vue.createElementVNode("div",{class:"loader__spinner-3 loader__spinner"},[vue.createElementVNode("div",{class:"loader__spinner-3-circle1 loader__circle loader__circle--1"}),vue.createTextVNode(),vue.createElementVNode("div",{class:"loader__spinner-3-circle2 loader__circle loader__circle--2"}),vue.createTextVNode(),vue.createElementVNode("div",{class:"loader__spinner-3-circle3 loader__circle loader__circle--3"}),vue.createTextVNode(),vue.createElementVNode("div",{class:"loader__spinner-3-circle4 loader__circle loader__circle--4"})])],-1/* HOISTED */)),_cache[1]||(_cache[1]=vue.createTextVNode()),vue.createElementVNode("div",{ref:"loader-text",class:vue.normalizeClass(["loader__wait-text",{"loader--delay":_ctx.delay}]),tabindex:"-1"},[vue.createElementVNode("span",_hoisted_2$c,[vue.renderSlot(_ctx.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.loader.wait.text",_ctx.defaultLoadingText)),1/* TEXT */)])])],2/* CLASS */)])],16/* FULL_PROPS */),[[vue.vShow,_ctx.show]])],8,["to","disabled"]);}const FLoader=/* @__PURE__ */_export_sfc(_sfc_main$i,[["render",_sfc_render$i]]);function getNewItemIndexFromMenuAction$2(action,index,n){let newIndex;if(n<=0){return 0;}switch(action){case MenuAction.MOVE_NEXT:newIndex=(index+1)%n;break;case MenuAction.MOVE_PREV:newIndex=(index-1+n)%n;break;case MenuAction.MOVE_FIRST:newIndex=0;break;case MenuAction.MOVE_LAST:newIndex=Math.max(n-1,0);break;default:newIndex=index;}return newIndex;}async function doMenuAction$2(action,target){const itemsLength=target.items.length;const currentIndex=target.currentFocusedItemIndex;const newFocusedItemIndex=getNewItemIndexFromMenuAction$2(action,currentIndex,itemsLength);switch(action){case MenuAction.MOVE_NEXT:case MenuAction.MOVE_PREV:case MenuAction.MOVE_FIRST:case MenuAction.MOVE_LAST:await target.setFocusOnItem(newFocusedItemIndex);break;case MenuAction.ACTIVATE:await target.activateItem(newFocusedItemIndex);break;}}const preventKeys$2=["Tab","Up","Down","ArrowUp","ArrowDown","Home","End"," ","Spacebar","Enter"];const _sfc_main$h=vue.defineComponent({name:"IPopupMenu",components:{FIcon,IPopup},props:{/**
|
|
637
637
|
* Key of the currently selected and highlighted item.
|
|
638
638
|
*
|
|
639
639
|
* @model
|
|
@@ -674,7 +674,7 @@ onItemFocus(event){if(event&&event.target){event.target.style.position="relative
|
|
|
674
674
|
*
|
|
675
675
|
* @event select
|
|
676
676
|
* @type {string} Key of focused item, or empty if no item focused.
|
|
677
|
-
*/"update:focusedItem"],data(){return{currentFocusedItemIndex:0,lastSelectedItem:""};},watch:{isOpen:{immediate:true,async handler(newVal){if(newVal){return;}this.currentFocusedItemIndex=0;this.lastSelectedItem="";this.$emit("update:focusedItem","");}},modelValue:{async handler(newVal){if(this.enableKeyboardNavigation){return;}const index=this.indexOfItemByKey(newVal);if(index>=0){await this.activateItem(index);}else{this.setFocusedItemIndex(0);}}},focusedItem:{async handler(newVal){if(newVal.length===0){return;}const index=this.indexOfItemByKey(newVal);if(index>=0){await this.setFocusOnItem(index);}else{this.setFocusedItemIndex(0);}}}},methods:{isSelected(index){return this.items[index].key===this.modelValue;},focusElement(){return null;},findItemByKey(key){return this.items.find(it=>it.key===key);},indexOfItemByKey(key){const item=this.findItemByKey(key);if(!item){return-1;}return this.items.indexOf(item);},async onClickItem(item,doClick=false){var _a;if(item.key!==this.lastSelectedItem){this.$emit("update:modelValue",item.key);this.$emit("select",item.key);this.lastSelectedItem=item.key;}this.$emit("close");if(item.href&&doClick){const anchors=getSortedHTMLElementsFromVueRef(this.$refs.anchors);(_a=anchors[this.currentFocusedItemIndex])==null?void 0:_a.click();}},itemClasses(item){const highlight=item.key===this.modelValue?["ipopupmenu__list__item--highlight"]:[];return["ipopupmenu__list__item",...highlight];},async setFocusOnItem(index){this.setFocusedItemIndex(index);await this.$nextTick();if(!this.isOpen){return;}const anchors=getSortedHTMLElementsFromVueRef(this.$refs.anchors);if(anchors.length===0){return;}const itemAnchor=anchors[index];logic.focus(itemAnchor,{preventScroll:true});const key=this.items[index].key;this.$emit("update:focusedItem",key);},async activateItem(index){if(index!==this.currentFocusedItemIndex){await this.setFocusOnItem(index);}await this.onClickItem(this.items[index],true);},setFocusedItemIndex(index){this.currentFocusedItemIndex=index;},onKeyUp(event){if(!this.enableKeyboardNavigation){return;}if(preventKeys$2.includes(event.key)){event.preventDefault();}},async onKeyDown(event){if(!this.enableKeyboardNavigation){return;}if(!preventKeys$2.includes(event.key)){return;}const firstItemFocused=this.currentFocusedItemIndex===0;const lastItemFocused=this.currentFocusedItemIndex===this.items.length-1;const tabOutPrev=event.key==="Tab"&&event.shiftKey&&firstItemFocused;const tabOutNext=event.key==="Tab"&&!event.shiftKey&&lastItemFocused;if(tabOutPrev||tabOutNext){if(tabOutPrev){event.preventDefault();}this.$emit("close");return;}const action=actionFromKeyboardEvent(event);if(action===null){return;}event.preventDefault();await doMenuAction$2(action,this);}}});const _hoisted_1$f=["aria-label"];const _hoisted_2$b={role:"menu",class:"ipopupmenu__list"};const _hoisted_3$9=["onClick"];const _hoisted_4$7=["data-ref-index","href","target"];const _hoisted_5$
|
|
677
|
+
*/"update:focusedItem"],data(){return{currentFocusedItemIndex:0,lastSelectedItem:""};},watch:{isOpen:{immediate:true,async handler(newVal){if(newVal){return;}this.currentFocusedItemIndex=0;this.lastSelectedItem="";this.$emit("update:focusedItem","");}},modelValue:{async handler(newVal){if(this.enableKeyboardNavigation){return;}const index=this.indexOfItemByKey(newVal);if(index>=0){await this.activateItem(index);}else{this.setFocusedItemIndex(0);}}},focusedItem:{async handler(newVal){if(newVal.length===0){return;}const index=this.indexOfItemByKey(newVal);if(index>=0){await this.setFocusOnItem(index);}else{this.setFocusedItemIndex(0);}}}},methods:{isSelected(index){return this.items[index].key===this.modelValue;},focusElement(){return null;},findItemByKey(key){return this.items.find(it=>it.key===key);},indexOfItemByKey(key){const item=this.findItemByKey(key);if(!item){return-1;}return this.items.indexOf(item);},async onClickItem(item,doClick=false){var _a;if(item.key!==this.lastSelectedItem){this.$emit("update:modelValue",item.key);this.$emit("select",item.key);this.lastSelectedItem=item.key;}this.$emit("close");if(item.href&&doClick){const anchors=getSortedHTMLElementsFromVueRef(this.$refs.anchors);(_a=anchors[this.currentFocusedItemIndex])==null?void 0:_a.click();}},itemClasses(item){const highlight=item.key===this.modelValue?["ipopupmenu__list__item--highlight"]:[];return["ipopupmenu__list__item",...highlight];},async setFocusOnItem(index){this.setFocusedItemIndex(index);await this.$nextTick();if(!this.isOpen){return;}const anchors=getSortedHTMLElementsFromVueRef(this.$refs.anchors);if(anchors.length===0){return;}const itemAnchor=anchors[index];logic.focus(itemAnchor,{preventScroll:true});const key=this.items[index].key;this.$emit("update:focusedItem",key);},async activateItem(index){if(index!==this.currentFocusedItemIndex){await this.setFocusOnItem(index);}await this.onClickItem(this.items[index],true);},setFocusedItemIndex(index){this.currentFocusedItemIndex=index;},onKeyUp(event){if(!this.enableKeyboardNavigation){return;}if(preventKeys$2.includes(event.key)){event.preventDefault();}},async onKeyDown(event){if(!this.enableKeyboardNavigation){return;}if(!preventKeys$2.includes(event.key)){return;}const firstItemFocused=this.currentFocusedItemIndex===0;const lastItemFocused=this.currentFocusedItemIndex===this.items.length-1;const tabOutPrev=event.key==="Tab"&&event.shiftKey&&firstItemFocused;const tabOutNext=event.key==="Tab"&&!event.shiftKey&&lastItemFocused;if(tabOutPrev||tabOutNext){if(tabOutPrev){event.preventDefault();}this.$emit("close");return;}const action=actionFromKeyboardEvent(event);if(action===null){return;}event.preventDefault();await doMenuAction$2(action,this);}}});const _hoisted_1$f=["aria-label"];const _hoisted_2$b={role:"menu",class:"ipopupmenu__list"};const _hoisted_3$9=["onClick"];const _hoisted_4$7=["data-ref-index","href","target"];const _hoisted_5$6={key:0,class:"sr-only"};function _sfc_render$h(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");const _component_i_popup=vue.resolveComponent("i-popup");return vue.openBlock(),vue.createBlock(_component_i_popup,{class:"ipopupmenu","is-open":_ctx.isOpen,"keyboard-trap":false,anchor:_ctx.anchor,"focus-element":_ctx.focusElement,onClose:_cache[0]||(_cache[0]=$event=>_ctx.$emit("close")),onKeyup:_ctx.onKeyUp,onKeydown:_ctx.onKeyDown},{default:vue.withCtx(()=>[vue.createElementVNode("nav",{class:"ipopupmenu ipopupmenu--vertical","aria-label":_ctx.ariaLabel},[vue.createElementVNode("ul",_hoisted_2$b,[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.items,(item,index)=>{return vue.openBlock(),vue.createElementBlock("li",{ref_for:true,ref:"items",key:item.key,role:"presentation",class:vue.normalizeClass(_ctx.itemClasses(item)),onClick:$event=>_ctx.onClickItem(item)},[vue.createElementVNode("a",{ref_for:true,ref:"anchors","data-ref-index":index,href:item.href,role:"menuitem",target:item.target,tabindex:"0"},[_ctx.isSelected(index)?(vue.openBlock(),vue.createElementBlock("span",_hoisted_5$6,[vue.createElementVNode("span",null,vue.toDisplayString(_ctx.selectedMenuItemScreenReaderText)+" ",1/* TEXT */)])):vue.createCommentVNode("v-if",true),vue.createTextVNode(vue.toDisplayString(item.label)+" ",1/* TEXT */),item.iconRight?(vue.openBlock(),vue.createBlock(_component_f_icon,{key:1,name:item.iconRight},null,8,["name"])):vue.createCommentVNode("v-if",true)],8,_hoisted_4$7)],10,_hoisted_3$9);}),128/* KEYED_FRAGMENT */))])],8,_hoisted_1$f)]),_:1/* STABLE */},8,["is-open","anchor","focus-element","onKeyup","onKeydown"]);}const IPopupMenu=/* @__PURE__ */_export_sfc(_sfc_main$h,[["render",_sfc_render$h]]);const menuMoreKey="MENU_MORE";function findOverflowIndex(totalWidth,elements){let sum=0;return elements.findIndex(element=>{sum+=element.offsetWidth;return sum>totalWidth;});}function getNewItemIndexFromMenuAction$1(action,index,n){let newIndex;if(n<=0){return 0;}switch(action){case MenuAction.MOVE_NEXT:newIndex=(index+1)%n;break;case MenuAction.MOVE_PREV:newIndex=(index-1+n)%n;break;case MenuAction.MOVE_FIRST:newIndex=0;break;case MenuAction.MOVE_LAST:newIndex=Math.max(n-1,0);break;default:newIndex=index;}return newIndex;}async function doMenuAction$1(action,target){const itemsLength=target.items.length;const currentIndex=target.currentFocusedItemIndex;const newFocusedItemIndex=getNewItemIndexFromMenuAction$1(action,currentIndex,itemsLength);switch(action){case MenuAction.MOVE_NEXT:case MenuAction.MOVE_PREV:case MenuAction.MOVE_FIRST:case MenuAction.MOVE_LAST:await target.setFocusOnItem(newFocusedItemIndex);break;case MenuAction.ACTIVATE:await target.activateItem(newFocusedItemIndex);break;}}const preventKeys$1=["Tab","Up","Down","Left","Right","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"," ","Spacebar","Enter"];const _sfc_main$g=vue.defineComponent({name:"IMenu",components:{FIcon},props:{/**
|
|
678
678
|
* The currently highlighted menu item key
|
|
679
679
|
* @model
|
|
680
680
|
*/modelValue:{type:String,required:false,default:""},/**
|
|
@@ -689,7 +689,7 @@ onItemFocus(event){if(event&&event.target){event.target.style.position="relative
|
|
|
689
689
|
* Text for selected item for screen reader
|
|
690
690
|
*/selectedMenuItemScreenReaderText:{type:String,required:false,default:"vald nu"},/**
|
|
691
691
|
* If true, indicates that the menu "Mer/More" has selected items
|
|
692
|
-
*/hasMenuMoreSelectedItems:{type:Boolean,required:false,default:false}},emits:["overflow","select","update:modelValue"],data(){return{resizeObserver:void 0,currentFocusedItemIndex:0,lastSelectedItem:""};},computed:{cssClasses(){return{"imenu--horizontal":!this.vertical,"imenu--vertical":this.vertical};}},watch:{items:{deep:true,async handler(){await this.$nextTick();this.onResize();}},focusedItemKey:{async handler(newVal){if(this.enableKeyboardNavigation){return;}const index=this.indexOfItemByKey(newVal);if(index>=0){await this.setFocusOnItem(index);}else{this.setFocusedItemIndex(0);}}},modelValue:{async handler(newVal){if(this.enableKeyboardNavigation){return;}const index=this.indexOfItemByKey(newVal);if(index>=0){await this.activateItem(index);}else{this.setFocusedItemIndex(0);}}}},mounted(){this.currentFocusedItemIndex=0;if(!this.vertical){this.resizeObserver=new ResizeObserver(logic.debounce(this.onResize,100));this.resizeObserver.observe(this.$el);this.onResize();}},unmounted(){if(this.resizeObserver){this.resizeObserver.disconnect();}},methods:{getAnchor(index){return getSortedHTMLElementsFromVueRef(this.$refs.anchors)[index];},getSelectedMenuItemScreenReaderText(index){const menuMoreItem=this.items[index].key===menuMoreKey?this.items[index]:null;if(menuMoreItem){if(this.hasMenuMoreSelectedItems){return menuMoreItem.srMenuMoreTextSelectedContents;}else{return menuMoreItem.srMenuMoreTextContents;}}return this.selectedMenuItemScreenReaderText;},isSelected(index){return this.items[index].key===this.modelValue;},ariaHasPopup(index){const item=this.items[index];return(item==null?void 0:item.ariaHasPopup)?true:void 0;},findItemByKey(key){return this.items.find(it=>it.key===key);},indexOfItemByKey(key){const item=this.findItemByKey(key);if(!item){return-1;}return this.items.indexOf(item);},async onClickItem(item,doClick=false){var _a;if(item.key===menuMoreKey||item.key!==this.lastSelectedItem){this.$emit("update:modelValue",item.key);this.$emit("select",item.key);this.lastSelectedItem=item.key;}if(item.href&&doClick){(_a=this.getAnchor(this.items.indexOf(item)))==null?void 0:_a.click();}},onResize(){const barElement=this.$el;if(!barElement){return;}const barWidth=barElement.offsetWidth;const itemElements=getSortedHTMLElementsFromVueRef(this.$refs.items);const overflowIndex=findOverflowIndex(barWidth,itemElements);this.$emit("overflow",overflowIndex);},cssClassHighlight(item){return item.key===this.modelValue?"imenu__list__item--highlight":"";},ccsClassHighlightAnchor(item){return item.key===this.modelValue?"imenu__list__anchor--highlight":"";},ccsClassHighlightAnchorContainer(item){return item.key===this.modelValue?"imenu__list__anchor-container--highlight":"";},async setFocusOnItem(index){this.setFocusedItemIndex(index);await this.$nextTick();const itemAnchor=this.getAnchor(index);logic.focus(itemAnchor,{preventScroll:true});},async activateItem(index){await this.onClickItem(this.items[index],true);},setFocusedItemIndex(index){this.currentFocusedItemIndex=index;},onKeyUp(event){if(!this.enableKeyboardNavigation){return;}if(preventKeys$1.includes(event.key)){event.preventDefault();}},async onKeyDown(event){if(!this.enableKeyboardNavigation){return;}const action=actionFromKeyboardEvent(event);if(action!==null){event.preventDefault();await doMenuAction$1(action,this);}}}});const _hoisted_1$e={class:"imenu__list",role:"menubar"};const _hoisted_2$a=["data-ref-index","onClick"];const _hoisted_3$8=["data-ref-index","href","target","aria-haspopup"];const _hoisted_4$6={key:0,class:"sr-only"};const _hoisted_5$
|
|
692
|
+
*/hasMenuMoreSelectedItems:{type:Boolean,required:false,default:false}},emits:["overflow","select","update:modelValue"],data(){return{resizeObserver:void 0,currentFocusedItemIndex:0,lastSelectedItem:""};},computed:{cssClasses(){return{"imenu--horizontal":!this.vertical,"imenu--vertical":this.vertical};}},watch:{items:{deep:true,async handler(){await this.$nextTick();this.onResize();}},focusedItemKey:{async handler(newVal){if(this.enableKeyboardNavigation){return;}const index=this.indexOfItemByKey(newVal);if(index>=0){await this.setFocusOnItem(index);}else{this.setFocusedItemIndex(0);}}},modelValue:{async handler(newVal){if(this.enableKeyboardNavigation){return;}const index=this.indexOfItemByKey(newVal);if(index>=0){await this.activateItem(index);}else{this.setFocusedItemIndex(0);}}}},mounted(){this.currentFocusedItemIndex=0;if(!this.vertical){this.resizeObserver=new ResizeObserver(logic.debounce(this.onResize,100));this.resizeObserver.observe(this.$el);this.onResize();}},unmounted(){if(this.resizeObserver){this.resizeObserver.disconnect();}},methods:{getAnchor(index){return getSortedHTMLElementsFromVueRef(this.$refs.anchors)[index];},getSelectedMenuItemScreenReaderText(index){const menuMoreItem=this.items[index].key===menuMoreKey?this.items[index]:null;if(menuMoreItem){if(this.hasMenuMoreSelectedItems){return menuMoreItem.srMenuMoreTextSelectedContents;}else{return menuMoreItem.srMenuMoreTextContents;}}return this.selectedMenuItemScreenReaderText;},isSelected(index){return this.items[index].key===this.modelValue;},ariaHasPopup(index){const item=this.items[index];return(item==null?void 0:item.ariaHasPopup)?true:void 0;},findItemByKey(key){return this.items.find(it=>it.key===key);},indexOfItemByKey(key){const item=this.findItemByKey(key);if(!item){return-1;}return this.items.indexOf(item);},async onClickItem(item,doClick=false){var _a;if(item.key===menuMoreKey||item.key!==this.lastSelectedItem){this.$emit("update:modelValue",item.key);this.$emit("select",item.key);this.lastSelectedItem=item.key;}if(item.href&&doClick){(_a=this.getAnchor(this.items.indexOf(item)))==null?void 0:_a.click();}},onResize(){const barElement=this.$el;if(!barElement){return;}const barWidth=barElement.offsetWidth;const itemElements=getSortedHTMLElementsFromVueRef(this.$refs.items);const overflowIndex=findOverflowIndex(barWidth,itemElements);this.$emit("overflow",overflowIndex);},cssClassHighlight(item){return item.key===this.modelValue?"imenu__list__item--highlight":"";},ccsClassHighlightAnchor(item){return item.key===this.modelValue?"imenu__list__anchor--highlight":"";},ccsClassHighlightAnchorContainer(item){return item.key===this.modelValue?"imenu__list__anchor-container--highlight":"";},async setFocusOnItem(index){this.setFocusedItemIndex(index);await this.$nextTick();const itemAnchor=this.getAnchor(index);logic.focus(itemAnchor,{preventScroll:true});},async activateItem(index){await this.onClickItem(this.items[index],true);},setFocusedItemIndex(index){this.currentFocusedItemIndex=index;},onKeyUp(event){if(!this.enableKeyboardNavigation){return;}if(preventKeys$1.includes(event.key)){event.preventDefault();}},async onKeyDown(event){if(!this.enableKeyboardNavigation){return;}const action=actionFromKeyboardEvent(event);if(action!==null){event.preventDefault();await doMenuAction$1(action,this);}}}});const _hoisted_1$e={class:"imenu__list",role:"menubar"};const _hoisted_2$a=["data-ref-index","onClick"];const _hoisted_3$8=["data-ref-index","href","target","aria-haspopup"];const _hoisted_4$6={key:0,class:"sr-only"};const _hoisted_5$5={key:1,class:"imenu__list__anchor-span"};function _sfc_render$g(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("nav",{class:vue.normalizeClass(["imenu",_ctx.cssClasses]),"aria-label":"Navigeringsmeny",onKeyup:_cache[0]||(_cache[0]=(...args)=>_ctx.onKeyUp&&_ctx.onKeyUp(...args)),onKeydown:_cache[1]||(_cache[1]=(...args)=>_ctx.onKeyDown&&_ctx.onKeyDown(...args))},[vue.createElementVNode("ul",_hoisted_1$e,[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.items,(item,index)=>{return vue.openBlock(),vue.createElementBlock("li",{ref_for:true,ref:"items",key:item.key,"data-ref-index":index,class:vue.normalizeClass(["imenu__list__item",_ctx.cssClassHighlight(item)]),role:"none",onClick:$event=>_ctx.onClickItem(item)},[vue.createElementVNode("div",{class:vue.normalizeClass([_ctx.ccsClassHighlightAnchorContainer(item),"imenu__list__anchor-container"])},[vue.createElementVNode("a",{ref_for:true,ref:"anchors","data-ref-index":index,tabindex:"0",href:item.href,target:item.target,class:vue.normalizeClass(["imenu__list__anchor",_ctx.ccsClassHighlightAnchor(item)]),role:"menuitem","aria-haspopup":_ctx.ariaHasPopup(index)},[_ctx.isSelected(index)?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$6,[vue.createElementVNode("span",null,vue.toDisplayString(_ctx.getSelectedMenuItemScreenReaderText(index))+" ",1/* TEXT */)])):vue.createCommentVNode("v-if",true),vue.createTextVNode(vue.toDisplayString(item.label),1/* TEXT */),item.iconRight?(vue.openBlock(),vue.createElementBlock("span",_hoisted_5$5)):vue.createCommentVNode("v-if",true),_cache[2]||(_cache[2]=vue.createTextVNode()),item.iconRight?(vue.openBlock(),vue.createBlock(_component_f_icon,{key:2,name:item.iconRight,class:"imenu__list__anchor-icon-right"},null,8,["name"])):vue.createCommentVNode("v-if",true)],10,_hoisted_3$8)],2/* CLASS */)],10,_hoisted_2$a);}),128/* KEYED_FRAGMENT */))])],34/* CLASS, NEED_HYDRATION */);}const IMenu=/* @__PURE__ */_export_sfc(_sfc_main$g,[["render",_sfc_render$g]]);function calcOverflowIndexFromIndex(index){return index===-1?-1:index-1;}function getNewItemIndexFromMenuAction(action,index,minIndex,maxIndex){let newIndex;if(maxIndex<=minIndex){return minIndex;}if(index>=maxIndex){return maxIndex-1;}switch(action){case MenuAction.MOVE_NEXT:newIndex=(index+1)%maxIndex;newIndex=Math.max(newIndex,minIndex);break;case MenuAction.MOVE_PREV:newIndex=index-1;if(newIndex<minIndex){newIndex=maxIndex-1;}break;case MenuAction.MOVE_FIRST:newIndex=minIndex;break;case MenuAction.MOVE_LAST:newIndex=Math.max(maxIndex-1,minIndex);break;default:newIndex=index;}return newIndex;}async function doMenuAction(action,target,minIndex,maxIndex){const currentIndex=target.currentFocusedItemIndex;const newFocusedItemIndex=getNewItemIndexFromMenuAction(action,currentIndex,minIndex,maxIndex);switch(action){case MenuAction.MOVE_NEXT:case MenuAction.MOVE_PREV:case MenuAction.MOVE_FIRST:case MenuAction.MOVE_LAST:await target.setFocusOnItem(newFocusedItemIndex);break;case MenuAction.ACTIVATE:await target.activateItem(newFocusedItemIndex);break;}}const preventKeys=["Tab","Up","Down","Left","Right","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"," ","Spacebar","Enter","Escape"];const keyUp=["ArrowUp","Up"];const keyDown=["ArrowDown","Down"];const arrowKeys=[...keyUp,...keyDown];const _sfc_main$f=vue.defineComponent({name:"FNavigationMenu",components:{IMenu,IPopupMenu},mixins:[TranslationMixin],props:{/** Current route.
|
|
693
693
|
* @model
|
|
694
694
|
*/route:{type:String,required:false,default:""},/**
|
|
695
695
|
* The route items to be diplayed in the menu
|
|
@@ -718,7 +718,7 @@ onItemFocus(event){if(event&&event.target){event.target.style.position="relative
|
|
|
718
718
|
* @event update:route
|
|
719
719
|
* @param route
|
|
720
720
|
* @type {string}
|
|
721
|
-
*/"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),"focused-item":_ctx.focusedPopupMenuItemKey,"onUpdate:focusedItem":_cache[2]||(_cache[2]=$event=>_ctx.focusedPopupMenuItemKey=$event),items:_ctx.popupItems,"is-open":_ctx.popupOpen,anchor:_ctx.popupAnchor,"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","focused-item","items","is-open","anchor","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:{/**
|
|
721
|
+
*/"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"]),_cache[3]||(_cache[3]=vue.createTextVNode()),vue.createVNode(_component_i_popup_menu,{ref:"popupMenu",modelValue:_ctx.selectedPopupItemKey,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>_ctx.selectedPopupItemKey=$event),"focused-item":_ctx.focusedPopupMenuItemKey,"onUpdate:focusedItem":_cache[2]||(_cache[2]=$event=>_ctx.focusedPopupMenuItemKey=$event),items:_ctx.popupItems,"is-open":_ctx.popupOpen,anchor:_ctx.popupAnchor,"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","focused-item","items","is-open","anchor","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$4=["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"}),_cache[0]||(_cache[0]=vue.createTextVNode()),vue.createVNode(_component_f_icon,{name:"alert"})])]),_:1/* STABLE */}),_cache[2]||(_cache[2]=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",{},()=>[_cache[1]||(_cache[1]=vue.createTextVNode(" Det verkar som att du inte har någon internetuppkoppling just nu "))])])]),_:3/* FORWARDED */})]),_:3/* FORWARDED */})])):vue.createCommentVNode("v-if",true),_cache[3]||(_cache[3]=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$4),[[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:{/**
|
|
722
722
|
* Associate the output field with one or more id's of the elements
|
|
723
723
|
* contributing or affecting the result of this field. Multiple id's can
|
|
724
724
|
* be set with a space-separated string or an array of strings.
|
|
@@ -726,7 +726,7 @@ onItemFocus(event){if(event&&event.target){event.target.style.position="relative
|
|
|
726
726
|
* The id for the output id attribute.
|
|
727
727
|
* The id for the label for attribute.
|
|
728
728
|
* If the prop is not set a random value will be generated.
|
|
729
|
-
*/id:{type:String,required:false,default:()=>logic.ElementIdService.generateElementId()}},computed:{htmlFor(){return Array.isArray(this.for)?this.for.join(" "):this.for;}}});const _hoisted_1$c={class:"output-field"};const _hoisted_2$8=["id","for"];function _sfc_render$d(_ctx,_cache,$props,$setup,$data,$options){const _component_f_label=vue.resolveComponent("f-label");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$c,[vue.createVNode(_component_f_label,{for:_ctx.id},vue.createSlots({default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"label")]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1032,["for"]),vue.createTextVNode(),vue.createElementVNode("output",vue.mergeProps({id:_ctx.id,for:_ctx.htmlFor,class:"output-field__output"},_ctx.$attrs),[vue.renderSlot(_ctx.$slots,"default")],16,_hoisted_2$8)]);}const FOutputField=/* @__PURE__ */_export_sfc(_sfc_main$d,[["render",_sfc_render$d]]);const _sfc_main$c=vue.defineComponent({name:"ISkipLink",mixins:[TranslationMixin],props:{/**
|
|
729
|
+
*/id:{type:String,required:false,default:()=>logic.ElementIdService.generateElementId()}},computed:{htmlFor(){return Array.isArray(this.for)?this.for.join(" "):this.for;}}});const _hoisted_1$c={class:"output-field"};const _hoisted_2$8=["id","for"];function _sfc_render$d(_ctx,_cache,$props,$setup,$data,$options){const _component_f_label=vue.resolveComponent("f-label");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$c,[vue.createVNode(_component_f_label,{for:_ctx.id},vue.createSlots({default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"label")]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1032,["for"]),_cache[1]||(_cache[1]=vue.createTextVNode()),vue.createElementVNode("output",vue.mergeProps({id:_ctx.id,for:_ctx.htmlFor,class:"output-field__output"},_ctx.$attrs),[vue.renderSlot(_ctx.$slots,"default")],16,_hoisted_2$8)]);}const FOutputField=/* @__PURE__ */_export_sfc(_sfc_main$d,[["render",_sfc_render$d]]);const _sfc_main$c=vue.defineComponent({name:"ISkipLink",mixins:[TranslationMixin],props:{/**
|
|
730
730
|
* Target for skiplink.
|
|
731
731
|
*/href:{type:String,required:false,default:"main"}}});const _hoisted_1$b=["href"];function _sfc_render$c(_ctx,_cache,$props,$setup,$data,$options){return vue.openBlock(),vue.createElementBlock("a",{class:"iskiplink",href:_ctx.href},[vue.renderSlot(_ctx.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.skip-link.text","Gå direkt till innehåll")),1/* TEXT */)])],8,_hoisted_1$b);}const ISkipLink=/* @__PURE__ */_export_sfc(_sfc_main$c,[["render",_sfc_render$c]]);function getAltLogoText(hasRouterLink,routerLinkLabel,t){const srStdLogoAltText=t("fkui.page-header.logo.alt-text","Försäkringskassan");const srStdRouterLinkLabel=t("fkui.page-header.router.link.label","gå till startsidan");if(hasRouterLink&&routerLinkLabel!==""){return`${srStdLogoAltText} ${routerLinkLabel}`;}else if(hasRouterLink){return`${srStdLogoAltText}, ${srStdRouterLinkLabel}`;}else{return srStdLogoAltText;}}const _sfc_main$b=vue.defineComponent({name:"FPageHeader",components:{ISkipLink},mixins:[TranslationMixin],inheritAttrs:true,props:{/** Setting the logo sizes small, large or responsive. */logoSize:{type:String,default:"responsive",required:false,validator(value){return["small","large","responsive"].includes(value);}},/**
|
|
732
732
|
* Render skiplink.
|
|
@@ -754,7 +754,7 @@ onItemFocus(event){if(event&&event.target){event.target.style.position="relative
|
|
|
754
754
|
* (Behaviour from using both name and path in combination is undefined.)
|
|
755
755
|
*/routerLinkName:{type:String,required:false,default:""},/**
|
|
756
756
|
* Label to override the router-link label when router-link is present.
|
|
757
|
-
*/routerLinkLabel:{type:String,required:false,default:""}},computed:{logoClass(){return`page-header__logo--${this.logoSize}`;},hasRouterLink(){return Boolean(this.routerLinkName||this.routerLinkPath);},routerLinkTo(){const{routerLinkName,routerLinkPath}=this;if(routerLinkName){return{name:routerLinkName};}if(routerLinkPath){return{path:routerLinkPath};}return null;},skipLinkAnchor(){const{skipLink,skipLinkHref}=this;if(skipLink===false||skipLink===""){return null;}else if(skipLink===true){return skipLinkHref;}else{return`#${skipLink}`;}},altLogoText(){return getAltLogoText(this.hasRouterLink,this.routerLinkLabel,this.$t);}}});const _hoisted_1$a={class:"page-header__root"};const _hoisted_2$7={key:0};const _hoisted_3$6={ref:"header",class:"page-header"};const _hoisted_4$4={class:"page-header__logo"};const _hoisted_5$
|
|
757
|
+
*/routerLinkLabel:{type:String,required:false,default:""}},computed:{logoClass(){return`page-header__logo--${this.logoSize}`;},hasRouterLink(){return Boolean(this.routerLinkName||this.routerLinkPath);},routerLinkTo(){const{routerLinkName,routerLinkPath}=this;if(routerLinkName){return{name:routerLinkName};}if(routerLinkPath){return{path:routerLinkPath};}return null;},skipLinkAnchor(){const{skipLink,skipLinkHref}=this;if(skipLink===false||skipLink===""){return null;}else if(skipLink===true){return skipLinkHref;}else{return`#${skipLink}`;}},altLogoText(){return getAltLogoText(this.hasRouterLink,this.routerLinkLabel,this.$t);}}});const _hoisted_1$a={class:"page-header__root"};const _hoisted_2$7={key:0};const _hoisted_3$6={ref:"header",class:"page-header"};const _hoisted_4$4={class:"page-header__logo"};const _hoisted_5$3=["aria-label"];const _hoisted_6$3=["aria-label"];const _hoisted_7$3={class:"page-header__right"};const _hoisted_8$3={class:"page-header__right-slot"};function _sfc_render$b(_ctx,_cache,$props,$setup,$data,$options){const _component_i_skip_link=vue.resolveComponent("i-skip-link");const _component_router_link=vue.resolveComponent("router-link");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$a,[_ctx.skipLinkAnchor?(vue.openBlock(),vue.createElementBlock("nav",_hoisted_2$7,[vue.createVNode(_component_i_skip_link,{href:_ctx.skipLinkAnchor},{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"skip-link-text")]),_:3/* FORWARDED */},8,["href"])])):vue.createCommentVNode("v-if",true),_cache[2]||(_cache[2]=vue.createTextVNode()),vue.createElementVNode("div",_hoisted_3$6,[vue.createElementVNode("div",_hoisted_4$4,[vue.renderSlot(_ctx.$slots,"logo",{},()=>[_ctx.routerLinkTo?(vue.openBlock(),vue.createBlock(_component_router_link,{key:0,to:_ctx.routerLinkTo},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(_ctx.logoClass),"aria-label":_ctx.altLogoText,role:"img"},null,10,_hoisted_5$3)]),_:1/* STABLE */},8,["to"])):(vue.openBlock(),vue.createElementBlock("span",{key:1,class:vue.normalizeClass(_ctx.logoClass),"aria-label":_ctx.altLogoText,role:"img"},null,10,_hoisted_6$3))])]),_cache[0]||(_cache[0]=vue.createTextVNode()),(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_ctx.headerTag),{class:"page-header__app-name"},{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default")]),_:3/* FORWARDED */})),_cache[1]||(_cache[1]=vue.createTextVNode()),vue.createElementVNode("div",_hoisted_7$3,[vue.createElementVNode("div",_hoisted_8$3,[vue.renderSlot(_ctx.$slots,"right")])])],512/* NEED_PATCH */)]);}const FPageHeader=/* @__PURE__ */_export_sfc(_sfc_main$b,[["render",_sfc_render$b]]);const MIN_VALUE=0;const MAX_VALUE=100;function clamp(val){return Math.round(Math.min(Math.max(val||0,MIN_VALUE),MAX_VALUE));}const _sfc_main$a=vue.defineComponent({name:"FProgressbar",props:{/**
|
|
758
758
|
* Sets the progress. Higher value indicates further progress. Value must be in range 0-100.
|
|
759
759
|
*/value:{type:Number,required:true,validator(value){return value>=MIN_VALUE&&value<=MAX_VALUE;}},/**
|
|
760
760
|
* Text that the screenreader will read, the actual value will be replaced with %VALUE% e.g You have uploaded %VALUE% percent
|
|
@@ -772,7 +772,7 @@ onItemFocus(event){if(event&&event.target){event.target.style.position="relative
|
|
|
772
772
|
/* it should contain a default value of undefined and proptype should
|
|
773
773
|
/* include undefined (see comment on line above) */modelValue:{type:anyType,required:false},/**
|
|
774
774
|
* The value for the input.
|
|
775
|
-
*/value:{type:anyType,required:true}},emits:["change","update:modelValue"],setup(){const{sharedName,showDetails,getFieldsetLabelText}=useFieldset();return{sharedName,showDetails,getFieldsetLabelText};},data(){return{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(){var _this$sharedName;return{...this.$attrs,value:this.value,checked:this.value===this.modelValue,name:(_this$sharedName=this.sharedName)!==null&&_this$sharedName!==void 0?_this$sharedName:this.$attrs.name,onChange:event=>{if(event.target instanceof HTMLInputElement){this.$emit("update:modelValue",this.value);this.$emit("change",this.value);}},onInput:event=>{event.target.focus();}};},disabledClass(){return this.disabled?"disabled":"";}},methods:{async onValidity({detail}){if(detail.target!==this.$el.querySelector("input")){return;}await this.$nextTick();let errorMessage="";if(hasSlot(this,"default")){const labelText=this.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$8=["id","disabled"];const _hoisted_2$5=["for"];const _hoisted_3$4={key:0,class:"radio-button__details"};const _hoisted_4$3
|
|
775
|
+
*/value:{type:anyType,required:true}},emits:["change","update:modelValue"],setup(){const{sharedName,showDetails,getFieldsetLabelText}=useFieldset();return{sharedName,showDetails,getFieldsetLabelText};},data(){return{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(){var _this$sharedName;return{...this.$attrs,value:this.value,checked:this.value===this.modelValue,name:(_this$sharedName=this.sharedName)!==null&&_this$sharedName!==void 0?_this$sharedName:this.$attrs.name,onChange:event=>{if(event.target instanceof HTMLInputElement){this.$emit("update:modelValue",this.value);this.$emit("change",this.value);}},onInput:event=>{event.target.focus();}};},disabledClass(){return this.disabled?"disabled":"";}},methods:{async onValidity({detail}){if(detail.target!==this.$el.querySelector("input")){return;}await this.$nextTick();let errorMessage="";if(hasSlot(this,"default")){const labelText=this.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$8=["id","disabled"];const _hoisted_2$5=["for"];const _hoisted_3$4={key:0,class:"radio-button__details"};const _hoisted_4$3={key:0,class:"radio-button__details"};function _sfc_render$9(_ctx,_cache,$props,$setup,$data,$options){return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["radio-button",_ctx.disabledClass]),onValidity:_cache[0]||(_cache[0]=(...args)=>_ctx.onValidity&&_ctx.onValidity(...args))},[vue.createElementVNode("input",vue.mergeProps({id:_ctx.id,type:"radio",class:"radio-button__input",disabled:_ctx.disabled},_ctx.attrs),null,16,_hoisted_1$8),_cache[7]||(_cache[7]=vue.createTextVNode()),vue.createElementVNode("label",{class:vue.normalizeClass(_ctx.$slots.details?"radio-button__label radio-button__width":"radio-button__label"),for:_ctx.id},[vue.renderSlot(_ctx.$slots,"default"),_cache[6]||(_cache[6]=vue.createTextVNode()),_ctx.$slots.details?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[_ctx.showDetails==="always"?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$4,[_cache[1]||(_cache[1]=vue.createElementVNode("br",null,null,-1/* HOISTED */)),_cache[2]||(_cache[2]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"details")])):vue.createCommentVNode("v-if",true),_cache[5]||(_cache[5]=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.value===_ctx.modelValue?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$3,[_cache[3]||(_cache[3]=vue.createElementVNode("br",null,null,-1/* HOISTED */)),_cache[4]||(_cache[4]=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$5)],34/* CLASS, NEED_HYDRATION */);}const FRadioField=/* @__PURE__ */_export_sfc(_sfc_main$9,[["render",_sfc_render$9]]);const _sfc_main$8=vue.defineComponent({name:"FRadioGroup",components:{FFieldset},inheritAttrs:false,props:{/**
|
|
776
776
|
* The id for the fieldset id attribute.
|
|
777
777
|
* If the prop is not set the id will be generated.
|
|
778
778
|
*/id:{type:String,required:false,default:()=>logic.ElementIdService.generateElementId()},/**
|
|
@@ -782,7 +782,7 @@ onItemFocus(event){if(event&&event.target){event.target.style.position="relative
|
|
|
782
782
|
* If radio buttons should be aligned horizontally.
|
|
783
783
|
* If the prop is not set the radio buttons will be aligned vertically.
|
|
784
784
|
* Default: `false`
|
|
785
|
-
*/isHorizontal:{type:Boolean,required:false}}});function _sfc_render$8(_ctx,_cache,$props,$setup,$data,$options){const _component_f_fieldset=vue.resolveComponent("f-fieldset");return vue.openBlock(),vue.createBlock(_component_f_fieldset,vue.mergeProps({id:_ctx.id,name:_ctx.name},_ctx.$attrs,{horizontal:_ctx.isHorizontal}),vue.createSlots({label:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"label")]),description:vue.withCtx(({descriptionClass,discreteDescriptionClass})=>[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),"error-message":vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"error-message")]),default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default",vue.normalizeProps(vue.guardReactiveProps({indentClass:"indent"})))]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1040,["id","name","horizontal"]);}const FRadioGroup=/* @__PURE__ */_export_sfc(_sfc_main$8,[["render",_sfc_render$8]]);const _sfc_main$7=vue.defineComponent({name:"FStaticField",components:{FLabel}});const _hoisted_1$7={class:"output-field"};const _hoisted_2$4={class:"output-field__output"};function _sfc_render$7(_ctx,_cache,$props,$setup,$data,$options){const _component_f_label=vue.resolveComponent("f-label");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$7,[vue.createVNode(_component_f_label,null,vue.createSlots({default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"label")]),description:vue.withCtx(({descriptionClass,discreteDescriptionClass})=>[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1024/* DYNAMIC_SLOTS */),vue.createTextVNode(),vue.createElementVNode("p",_hoisted_2$4,[vue.renderSlot(_ctx.$slots,"default")])]);}const FStaticField=/* @__PURE__ */_export_sfc(_sfc_main$7,[["render",_sfc_render$7]]);const keybindings=Object.fromEntries([["Up",focusTrAbove],["Down",focusTrBelow],["ArrowUp",focusTrAbove],["ArrowDown",focusTrBelow],[" ",activateRow],["Spacebar",activateRow]]);function focusTrAbove(current){if(current>0){this.tr[current-1].focus();}else{this.tr[this.tr.length-1].focus();}}function focusTrBelow(current){if(current<this.tr.length-1){this.tr[current+1].focus();}else{this.tr[0].focus();}}function activateRow(current){const row=this.rows[current];const element=this.tr[current];this.activate(row,element);}function onKeydown(event,current){const fn2=keybindings[event.key];if(fn2){event.preventDefault();fn2.call(this,current);}}function useExpandableTable(expandableAttribute,keyAttribute,describedby,emit,slots){const expandedRows=vue.ref([]);const isExpandableTable=vue.computed(()=>{return expandableAttribute.length>0;});const hasExpandableSlot=vue.computed(()=>{return Boolean(slots["expandable"]);});function toggleExpanded(row){if(isExpanded(row)){expandedRows.value=expandedRows.value.filter(it=>!itemEquals(it,row,keyAttribute));emit("collapse",row);}else{expandedRows.value.push(row);emit("expand",row);}}function isExpanded(row){return includeItem(row,expandedRows.value,keyAttribute);}function rowAriaExpanded(row){if(!isExpandableTable||!row[expandableAttribute]){return void 0;}return isExpanded(row);}function expandableRowClasses(row,index){const rows=expandableRows(row);if(!rows){return[];}const border=index<rows.length-1?["table__row--expanded-border"]:[];const expanded=isExpanded(row)?[]:["table__expandable-row--collapsed"];return["table__expandable-row",...border,...expanded];}function expandableColumnClasses(column,index){const indented=index===0?["table__column--indented"]:[];return["table__column",`table__column--${column.type}`,column.size,...indented];}function getExpandableDescribedby(row){if(!isExpandableTable){return void 0;}if(!describedby||describedby.length<1){return void 0;}if(!hasExpandableContent(row)){return void 0;}return describedby;}function expandableRows(row){const expandableRows2=row[expandableAttribute];if(typeof expandableRows2==="undefined"){return void 0;}if(!Array.isArray(expandableRows2)){throw new Error(`Expandable rows must be a ListArray`);}return expandableRows2;}function hasExpandableContent(row){return Boolean(expandableRows(row));}return{expandedRows,isExpandableTable,hasExpandableSlot,toggleExpanded,isExpanded,rowAriaExpanded,expandableRowClasses,expandableColumnClasses,getExpandableDescribedby,expandableRows,hasExpandableContent};}function forceRepaintIE11(target){if(navigator.userAgent.includes("Trident")){target.style.display="none";target.offsetHeight;target.style.removeProperty("display");}}const _sfc_main$6=vue.defineComponent({name:"FInteractiveTable",components:{FCheckboxField,FIcon},mixins:[TranslationMixin],provide(){return{addColumn:column=>{this.columns=addColumn(this.columns,column);},setVisibilityColumn:(id,visible)=>{setVisibilityColumn(this.columns,id,visible);},textFieldTableMode:true};},inheritAttrs:false,props:{/**
|
|
785
|
+
*/isHorizontal:{type:Boolean,required:false}}});function _sfc_render$8(_ctx,_cache,$props,$setup,$data,$options){const _component_f_fieldset=vue.resolveComponent("f-fieldset");return vue.openBlock(),vue.createBlock(_component_f_fieldset,vue.mergeProps({id:_ctx.id,name:_ctx.name},_ctx.$attrs,{horizontal:_ctx.isHorizontal}),vue.createSlots({label:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"label")]),description:vue.withCtx(({descriptionClass,discreteDescriptionClass})=>[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),"error-message":vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"error-message")]),default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default",vue.normalizeProps(vue.guardReactiveProps({indentClass:"indent"})))]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1040,["id","name","horizontal"]);}const FRadioGroup=/* @__PURE__ */_export_sfc(_sfc_main$8,[["render",_sfc_render$8]]);const _sfc_main$7=vue.defineComponent({name:"FStaticField",components:{FLabel}});const _hoisted_1$7={class:"output-field"};const _hoisted_2$4={class:"output-field__output"};function _sfc_render$7(_ctx,_cache,$props,$setup,$data,$options){const _component_f_label=vue.resolveComponent("f-label");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$7,[vue.createVNode(_component_f_label,null,vue.createSlots({default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"label")]),description:vue.withCtx(({descriptionClass,discreteDescriptionClass})=>[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1024/* DYNAMIC_SLOTS */),_cache[2]||(_cache[2]=vue.createTextVNode()),vue.createElementVNode("p",_hoisted_2$4,[vue.renderSlot(_ctx.$slots,"default")])]);}const FStaticField=/* @__PURE__ */_export_sfc(_sfc_main$7,[["render",_sfc_render$7]]);const keybindings=Object.fromEntries([["Up",focusTrAbove],["Down",focusTrBelow],["ArrowUp",focusTrAbove],["ArrowDown",focusTrBelow],[" ",activateRow],["Spacebar",activateRow]]);function focusTrAbove(current){if(current>0){this.tr[current-1].focus();}else{this.tr[this.tr.length-1].focus();}}function focusTrBelow(current){if(current<this.tr.length-1){this.tr[current+1].focus();}else{this.tr[0].focus();}}function activateRow(current){const row=this.rows[current];const element=this.tr[current];this.activate(row,element);}function onKeydown(event,current){const fn2=keybindings[event.key];if(fn2){event.preventDefault();fn2.call(this,current);}}function useExpandableTable(expandableAttribute,keyAttribute,describedby,emit,slots){const expandedRows=vue.ref([]);const isExpandableTable=vue.computed(()=>{return expandableAttribute.length>0;});const hasExpandableSlot=vue.computed(()=>{return Boolean(slots["expandable"]);});function toggleExpanded(row){if(isExpanded(row)){expandedRows.value=expandedRows.value.filter(it=>!itemEquals(it,row,keyAttribute));emit("collapse",row);}else{expandedRows.value.push(row);emit("expand",row);}}function isExpanded(row){return includeItem(row,expandedRows.value,keyAttribute);}function rowAriaExpanded(row){if(!isExpandableTable||!row[expandableAttribute]){return void 0;}return isExpanded(row);}function expandableRowClasses(row,index){const rows=expandableRows(row);if(!rows){return[];}const border=index<rows.length-1?["table__row--expanded-border"]:[];const expanded=isExpanded(row)?[]:["table__expandable-row--collapsed"];return["table__expandable-row",...border,...expanded];}function expandableColumnClasses(column,index){const indented=index===0?["table__column--indented"]:[];return["table__column",`table__column--${column.type}`,column.size,...indented];}function getExpandableDescribedby(row){if(!isExpandableTable){return void 0;}if(!describedby||describedby.length<1){return void 0;}if(!hasExpandableContent(row)){return void 0;}return describedby;}function expandableRows(row){const expandableRows2=row[expandableAttribute];if(typeof expandableRows2==="undefined"){return void 0;}if(!Array.isArray(expandableRows2)){throw new Error(`Expandable rows must be a ListArray`);}return expandableRows2;}function hasExpandableContent(row){return Boolean(expandableRows(row));}return{expandedRows,isExpandableTable,hasExpandableSlot,toggleExpanded,isExpanded,rowAriaExpanded,expandableRowClasses,expandableColumnClasses,getExpandableDescribedby,expandableRows,hasExpandableContent};}function forceRepaintIE11(target){if(navigator.userAgent.includes("Trident")){target.style.display="none";target.offsetHeight;target.style.removeProperty("display");}}const _sfc_main$6=vue.defineComponent({name:"FInteractiveTable",components:{FCheckboxField,FIcon},mixins:[TranslationMixin],provide(){return{addColumn:column=>{this.columns=addColumn(this.columns,column);},setVisibilityColumn:(id,visible)=>{setVisibilityColumn(this.columns,id,visible);},textFieldTableMode:true};},inheritAttrs:false,props:{/**
|
|
786
786
|
* The rows to be listed.
|
|
787
787
|
* The rows will be listed in the given array order.
|
|
788
788
|
*/rows:{type:Array,required:true},/**
|
|
@@ -822,7 +822,7 @@ onItemFocus(event){if(event&&event.target){event.target.style.position="relative
|
|
|
822
822
|
* @event collapse
|
|
823
823
|
* @param row
|
|
824
824
|
* @type {ListItem}
|
|
825
|
-
*/"collapse"],setup(props,context){const sortFilterDatasetInjected=FSortFilterDatasetInjected();const activateItemInjected=ActivateItemInjected();const expandableTable=useExpandableTable(props.expandableAttribute,props.keyAttribute,props.expandableDescribedby,context.emit,context.slots);return{...sortFilterDatasetInjected,...activateItemInjected,...expandableTable};},data(){return{activeRow:void 0,columns:[],emptyRow:emptyTableRow(),selectedRows:[],tr:[]};},computed:{hasCaption(){return hasSlot(this,"caption",{},{stripClasses:[]});},hasCheckboxDescription(){return hasSlot(this,"checkbox-description",{row:this.emptyRow});},hasInitiateColumns(){return this.columns.length>0;},isEmpty(){return this.rows.length===0;},visibleColumns(){return this.columns.filter(col=>col.visible);},tableClasses(){const classes=[];if(this.selectable){classes.push("table--selectable");}if(this.hover){classes.push("table--hover");}return classes;},tableRole(){return this.isExpandableTable?"treegrid":"grid";},wrapperClasses(){return tableScrollClasses(this.scroll);},nbOfColumns(){let columnCount=this.columns.length;if(this.selectable){columnCount++;}if(this.isExpandableTable){columnCount++;}return columnCount;}},watch:{rows:{immediate:true,deep:true,handler:function(){if(this.modelValue){this.selectedRows=this.modelValue.filter(row=>{return includeItem(row,this.rows,this.keyAttribute);});}}}},updated(){const tbodyElement=this.$refs["tbodyElement"];const trElements=[].slice.call(tbodyElement.children);const trInteractableElements=trElements.filter(tr=>{return tr.tabIndex===0;});this.tr=trInteractableElements;},mounted(){this.registerCallbackOnSort(this.callbackOnSort);this.registerCallbackOnMount(this.callbackSortableColumns);this.registerCallbackAfterItemAdd(this.callbackAfterItemAdd);this.registerCallbackBeforeItemDelete(this.callbackBeforeItemDelete);},methods:{isActive(row){return itemEquals(row,this.activeRow,this.keyAttribute);},isSelected(row){return includeItem(row,this.selectedRows,this.keyAttribute);},onKeydownExpandable(event,index){if(event.key===" "||event.key==="Spacebar"){event.preventDefault();return;}onKeydown.call(this,event,index);},onKeydown(event,index){onKeydown.call(this,event,index);},onClick(event,row){const{target}=event;const isRelevant=["TD","TH"].includes(target.nodeName);if(isRelevant){const parent=target.parentElement;this.activate(row,parent);}},activate(row,tr){this.$emit("click",row);if(this.isExpandableTable&&this.hasExpandableContent(row)){this.toggleExpanded(row);}if(!itemEquals(row,this.activeRow,this.keyAttribute)){this.$emit("change",row);this.activeRow=row;if(tr){tr.focus();const td=tr.children[0];forceRepaintIE11(td);}}},rowDescription(row){const slot=this.$slots["row-description"];return renderSlotText(slot,{row});},onSelect(row){if(includeItem(row,this.selectedRows,this.keyAttribute)){this.selectedRows=this.selectedRows.filter(i=>!itemEquals(i,row,this.keyAttribute));this.$emit("unselect",row);}else{this.selectedRows.push(row);this.$emit("select",row);}this.updateVModelWithSelectedRows();this.$forceUpdate();},updateVModelWithSelectedRows(){if(this.modelValue){this.$emit("update:modelValue",this.selectedRows);this.$emit("update",this.selectedRows);}},rowClasses(row,index){const active=this.isActive(row)?["table__row--active"]:[];const selected=this.isSelected(row)?["table__row--selected"]:[];const isExpandableRow=this.isExpandableTable&&this.hasExpandableContent(row);const expandable=isExpandableRow?["table__row--expandable"]:[];const expanded=this.isExpanded(row)?["table__row--expanded-border"]:[];const striped=this.striped&&index%2!==0?["table__row--striped"]:[];return["table__row",...active,...selected,...striped,...expandable,...expanded];},rowKey(row){const key=row[this.keyAttribute];if(typeof key==="undefined"){throw new Error(`Key attribute [${this.keyAttribute}]' is missing in row`);}return String(key);},columnClasses(column){const sortable=column.sortable?["table__column--sortable"]:[];return["table__column",`table__column--${column.type}`,...sortable,column.size];},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);},callbackAfterItemAdd(item){this.activate(item,null);},callbackBeforeItemDelete(item){if(this.rows.length===0){return;}let targetIndex=this.rows.indexOf(item)-1;if(targetIndex<0&&this.rows.length>1){targetIndex=1;}else if(targetIndex<0){targetIndex=0;}this.activate(this.rows[targetIndex],this.tr[targetIndex]);},escapeNewlines(value){return value.replace(/\n/g,"<br/>");}}});const _hoisted_1$6=["role"];const _hoisted_2$3={key:0};const _hoisted_3$3={key:0,class:"table__column--shrink"};const _hoisted_4$2={key:1,class:"table__column--shrink"};const _hoisted_5$2={class:"table__row"};const _hoisted_6$2={key:0,scope:"col"};const _hoisted_7$2={class:"sr-only"};const _hoisted_8$2={key:1,scope:"col"};const _hoisted_9$2={class:"sr-only"};const _hoisted_10$2=["innerHTML"];const _hoisted_11$1={key:1,class:"table__column__description"};const _hoisted_12$1={ref:"tbodyElement"};const _hoisted_13$1=["aria-label","aria-expanded","aria-level","aria-describedby","onKeydown","onClick"];const _hoisted_14$1={key:0};const _hoisted_15$1={key:0,class:"table__expand-icon"};const _hoisted_16={key:1,class:"table__column--selectable"};const _hoisted_17={class:"table__input"};const _hoisted_18={key:0,class:"sr-only"};const _hoisted_19=/* @__PURE__ */vue.createElementVNode("td",null,null,-1/* HOISTED */);const _hoisted_20={key:0,class:"table__column--selectable"};const _hoisted_21=["colspan"];const _hoisted_22={key:0};const _hoisted_23={hidden:""};const _hoisted_24=["colspan"];function _sfc_render$6(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");const _component_f_checkbox_field=vue.resolveComponent("f-checkbox-field");return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(_ctx.wrapperClasses)},[vue.createElementVNode("table",vue.mergeProps({class:["table",_ctx.tableClasses],role:_ctx.tableRole},_ctx.$attrs),[_ctx.hasCaption?(vue.openBlock(),vue.createElementBlock("caption",_hoisted_2$3,[vue.renderSlot(_ctx.$slots,"caption")])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createElementVNode("colgroup",null,[_ctx.isExpandableTable?(vue.openBlock(),vue.createElementBlock("col",_hoisted_3$3)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.selectable?(vue.openBlock(),vue.createElementBlock("col",_hoisted_4$2)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),(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_5$2,[_ctx.isExpandableTable?(vue.openBlock(),vue.createElementBlock("th",_hoisted_6$2,[vue.createElementVNode("span",_hoisted_7$2,vue.toDisplayString(_ctx.$t("fkui.interactive-table.select","Expandera")),1/* TEXT */)])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.selectable?(vue.openBlock(),vue.createElementBlock("th",_hoisted_8$2,[vue.createElementVNode("span",_hoisted_9$2,vue.toDisplayString(_ctx.$t("fkui.interactive-table.select","Markera")),1/* TEXT */)])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),(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_10$2),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_11$1,vue.toDisplayString(column.description),1/* TEXT */)):vue.createCommentVNode("v-if",true)],16/* FULL_PROPS */);}),128/* KEYED_FRAGMENT */))])]),vue.createTextVNode(),vue.createElementVNode("tbody",_hoisted_12$1,[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.rows,(row,index)=>{return vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:_ctx.rowKey(row)},[vue.createElementVNode("tr",{class:vue.normalizeClass(_ctx.rowClasses(row,index)),"aria-label":_ctx.rowDescription(row),"aria-expanded":_ctx.rowAriaExpanded(row),"aria-level":_ctx.isExpandableTable?1:void 0,"aria-describedby":_ctx.getExpandableDescribedby(row),tabindex:"0",onKeydown:vue.withModifiers($event=>_ctx.onKeydown($event,index),["self"]),onClick:$event=>_ctx.onClick($event,row,index)},[_ctx.isExpandableTable?(vue.openBlock(),vue.createElementBlock("td",_hoisted_14$1,[_ctx.hasExpandableContent(row)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_15$1,[vue.createVNode(_component_f_icon,{name:"arrow-right",rotate:_ctx.isExpanded(row)?"270":"90"},null,8,["rotate"])])):vue.createCommentVNode("v-if",true)])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),_ctx.selectable?(vue.openBlock(),vue.createElementBlock("td",_hoisted_16,[vue.createElementVNode("div",_hoisted_17,[vue.createVNode(_component_f_checkbox_field,{value:true,"model-value":_ctx.isSelected(row),onClick:vue.withModifiers($event=>_ctx.onSelect(row),["self"])},{default:vue.withCtx(()=>[_ctx.hasCheckboxDescription?(vue.openBlock(),vue.createElementBlock("span",_hoisted_18,[vue.renderSlot(_ctx.$slots,"checkbox-description",vue.mergeProps({ref_for:true},{row}))])):vue.createCommentVNode("v-if",true)]),_:2/* DYNAMIC */},1032,["model-value","onClick"])])])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.renderSlot(_ctx.$slots,"default",vue.mergeProps({ref_for:true},{row}))],42,_hoisted_13$1),vue.createTextVNode(),_ctx.isExpandableTable&&_ctx.hasExpandableContent(row)?(vue.openBlock(true),vue.createElementBlock(vue.Fragment,{key:0},vue.renderList(_ctx.expandableRows(row),(expandableRow,expandableIndex)=>{return vue.openBlock(),vue.createElementBlock("tr",{key:_ctx.rowKey(expandableRow),"aria-level":"2",class:vue.normalizeClass(_ctx.expandableRowClasses(row,expandableIndex))},[_hoisted_19,vue.createTextVNode(),_ctx.selectable?(vue.openBlock(),vue.createElementBlock("td",_hoisted_20)):vue.createCommentVNode("v-if",true),vue.createTextVNode(),!_ctx.hasExpandableSlot?(vue.openBlock(true),vue.createElementBlock(vue.Fragment,{key:1},vue.renderList(_ctx.columns,(column,columnIndex)=>{return vue.openBlock(),vue.createElementBlock("td",{key:`${_ctx.rowKey(expandableRow)}${column.name}`,class:vue.normalizeClass(_ctx.expandableColumnClasses(column,columnIndex))},vue.toDisplayString(expandableRow[column.name]),3/* TEXT, CLASS */);}),128/* KEYED_FRAGMENT */)):(vue.openBlock(),vue.createElementBlock("td",{key:2,class:"table__column table__column--indented",colspan:_ctx.columns.length},[vue.renderSlot(_ctx.$slots,"expandable",vue.mergeProps({ref_for:true},{expandableRow,parentRow:row}))],8,_hoisted_21))],2/* CLASS */);}),128/* KEYED_FRAGMENT */)):vue.createCommentVNode("v-if",true)],64/* STABLE_FRAGMENT */);}),128/* KEYED_FRAGMENT */)),vue.createTextVNode(),!_ctx.hasInitiateColumns?(vue.openBlock(),vue.createElementBlock("tr",_hoisted_22,[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(vue.Fragment,{key:1},[vue.withDirectives(vue.createElementVNode("tr",_hoisted_23,[vue.renderSlot(_ctx.$slots,"default",vue.normalizeProps(vue.guardReactiveProps({row:_ctx.emptyRow})))],512/* NEED_PATCH */),[[vue.vShow,false]]),vue.createTextVNode(),vue.createElementVNode("tr",null,[vue.createElementVNode("td",{class:"table__column table__column--action",colspan:_ctx.nbOfColumns},[vue.renderSlot(_ctx.$slots,"empty",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.interactive-table.empty","Tabellen är tom")),1/* TEXT */)])],8,_hoisted_24)])],64/* STABLE_FRAGMENT */)):vue.createCommentVNode("v-if",true)],512/* NEED_PATCH */)],16,_hoisted_1$6)],2/* CLASS */);}const FInteractiveTable=/* @__PURE__ */_export_sfc(_sfc_main$6,[["render",_sfc_render$6]]);const _sfc_main$5=vue.defineComponent({name:"FTextareaField",components:{FLabel},inheritAttrs:false,props:{/**
|
|
825
|
+
*/"collapse"],setup(props,context){vue.provide("renderColumns",vue.computed(()=>props.rows.length>0));const sortFilterDatasetInjected=FSortFilterDatasetInjected();const activateItemInjected=ActivateItemInjected();const expandableTable=useExpandableTable(props.expandableAttribute,props.keyAttribute,props.expandableDescribedby,context.emit,context.slots);return{...sortFilterDatasetInjected,...activateItemInjected,...expandableTable};},data(){return{activeRow:void 0,columns:[],selectedRows:[],tr:[]};},computed:{hasCaption(){return hasSlot(this,"caption",{},{stripClasses:[]});},hasCheckboxDescription(){const firstRow=this.rows[0];return hasSlot(this,"checkbox-description",{row:firstRow});},isEmpty(){return this.rows.length===0;},visibleColumns(){return this.columns.filter(col=>col.visible);},tableClasses(){const classes=[];if(this.selectable){classes.push("table--selectable");}if(this.hover){classes.push("table--hover");}return classes;},tableRole(){return this.isExpandableTable?"treegrid":"grid";},wrapperClasses(){return tableScrollClasses(this.scroll);},nbOfColumns(){let columnCount=this.columns.length;if(this.selectable){columnCount++;}if(this.isExpandableTable){columnCount++;}return columnCount;}},watch:{rows:{immediate:true,deep:true,handler:function(){if(this.modelValue){this.selectedRows=this.modelValue.filter(row=>{return includeItem(row,this.rows,this.keyAttribute);});}}}},updated(){const tbodyElement=this.$refs["tbodyElement"];const trElements=[].slice.call(tbodyElement.children);const trInteractableElements=trElements.filter(tr=>{return tr.tabIndex===0;});this.tr=trInteractableElements;},mounted(){this.registerCallbackOnSort(this.callbackOnSort);this.registerCallbackOnMount(this.callbackSortableColumns);this.registerCallbackAfterItemAdd(this.callbackAfterItemAdd);this.registerCallbackBeforeItemDelete(this.callbackBeforeItemDelete);},methods:{isActive(row){return itemEquals(row,this.activeRow,this.keyAttribute);},isSelected(row){return includeItem(row,this.selectedRows,this.keyAttribute);},onKeydownExpandable(event,index){if(event.key===" "||event.key==="Spacebar"){event.preventDefault();return;}onKeydown.call(this,event,index);},onKeydown(event,index){onKeydown.call(this,event,index);},onClick(event,row){const{target}=event;const isRelevant=["TD","TH"].includes(target.nodeName);if(isRelevant){const parent=target.parentElement;this.activate(row,parent);}},activate(row,tr){this.$emit("click",row);if(this.isExpandableTable&&this.hasExpandableContent(row)){this.toggleExpanded(row);}if(!itemEquals(row,this.activeRow,this.keyAttribute)){this.$emit("change",row);this.activeRow=row;if(tr){tr.focus();const td=tr.children[0];forceRepaintIE11(td);}}},rowDescription(row){const slot=this.$slots["row-description"];return renderSlotText(slot,{row});},onSelect(row){if(includeItem(row,this.selectedRows,this.keyAttribute)){this.selectedRows=this.selectedRows.filter(i=>!itemEquals(i,row,this.keyAttribute));this.$emit("unselect",row);}else{this.selectedRows.push(row);this.$emit("select",row);}this.updateVModelWithSelectedRows();this.$forceUpdate();},updateVModelWithSelectedRows(){if(this.modelValue){this.$emit("update:modelValue",this.selectedRows);this.$emit("update",this.selectedRows);}},rowClasses(row,index){const active=this.isActive(row)?["table__row--active"]:[];const selected=this.isSelected(row)?["table__row--selected"]:[];const isExpandableRow=this.isExpandableTable&&this.hasExpandableContent(row);const expandable=isExpandableRow?["table__row--expandable"]:[];const expanded=this.isExpanded(row)?["table__row--expanded-border"]:[];const striped=this.striped&&index%2!==0?["table__row--striped"]:[];return["table__row",...active,...selected,...striped,...expandable,...expanded];},rowKey(row){const key=row[this.keyAttribute];if(typeof key==="undefined"){throw new Error(`Key attribute [${this.keyAttribute}]' is missing in row`);}return String(key);},columnClasses(column){const sortable=column.sortable?["table__column--sortable"]:[];return["table__column",`table__column--${column.type}`,...sortable,column.size];},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);},callbackAfterItemAdd(item){this.activate(item,null);},callbackBeforeItemDelete(item){if(this.rows.length===0){return;}let targetIndex=this.rows.indexOf(item)-1;if(targetIndex<0&&this.rows.length>1){targetIndex=1;}else if(targetIndex<0){targetIndex=0;}this.activate(this.rows[targetIndex],this.tr[targetIndex]);},escapeNewlines(value){return value.replace(/\n/g,"<br/>");}}});const _hoisted_1$6=["role"];const _hoisted_2$3={key:0};const _hoisted_3$3={key:0,class:"table__column--shrink"};const _hoisted_4$2={key:1,class:"table__column--shrink"};const _hoisted_5$2={class:"table__row"};const _hoisted_6$2={key:0,scope:"col"};const _hoisted_7$2={class:"sr-only"};const _hoisted_8$2={key:1,scope:"col"};const _hoisted_9$2={class:"sr-only"};const _hoisted_10$2=["innerHTML"];const _hoisted_11$1={key:1,class:"table__column__description"};const _hoisted_12$1={ref:"tbodyElement"};const _hoisted_13=["aria-label","aria-expanded","aria-level","aria-describedby","onKeydown","onClick"];const _hoisted_14={key:0};const _hoisted_15={key:0,class:"table__expand-icon"};const _hoisted_16={key:1,class:"table__column--selectable"};const _hoisted_17={class:"table__input"};const _hoisted_18={key:0,class:"sr-only"};const _hoisted_19={key:0,class:"table__column--selectable"};const _hoisted_20=["colspan"];const _hoisted_21={key:0};const _hoisted_22={key:1};const _hoisted_23=["colspan"];function _sfc_render$6(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");const _component_f_checkbox_field=vue.resolveComponent("f-checkbox-field");return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(_ctx.wrapperClasses)},[vue.createElementVNode("table",vue.mergeProps({class:["table",_ctx.tableClasses],role:_ctx.tableRole},_ctx.$attrs),[_ctx.hasCaption?(vue.openBlock(),vue.createElementBlock("caption",_hoisted_2$3,[vue.renderSlot(_ctx.$slots,"caption")])):vue.createCommentVNode("v-if",true),_cache[14]||(_cache[14]=vue.createTextVNode()),vue.createElementVNode("colgroup",null,[_ctx.isExpandableTable?(vue.openBlock(),vue.createElementBlock("col",_hoisted_3$3)):vue.createCommentVNode("v-if",true),_cache[0]||(_cache[0]=vue.createTextVNode()),_ctx.selectable?(vue.openBlock(),vue.createElementBlock("col",_hoisted_4$2)):vue.createCommentVNode("v-if",true),_cache[1]||(_cache[1]=vue.createTextVNode()),(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 */))]),_cache[15]||(_cache[15]=vue.createTextVNode()),vue.createElementVNode("thead",null,[vue.createElementVNode("tr",_hoisted_5$2,[_ctx.isExpandableTable?(vue.openBlock(),vue.createElementBlock("th",_hoisted_6$2,[vue.createElementVNode("span",_hoisted_7$2,vue.toDisplayString(_ctx.$t("fkui.interactive-table.select","Expandera")),1/* TEXT */)])):vue.createCommentVNode("v-if",true),_cache[4]||(_cache[4]=vue.createTextVNode()),_ctx.selectable?(vue.openBlock(),vue.createElementBlock("th",_hoisted_8$2,[vue.createElementVNode("span",_hoisted_9$2,vue.toDisplayString(_ctx.$t("fkui.interactive-table.select","Markera")),1/* TEXT */)])):vue.createCommentVNode("v-if",true),_cache[5]||(_cache[5]=vue.createTextVNode()),(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_10$2),_cache[2]||(_cache[2]=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),_cache[3]||(_cache[3]=vue.createTextVNode()),column.description?(vue.openBlock(),vue.createElementBlock("span",_hoisted_11$1,vue.toDisplayString(column.description),1/* TEXT */)):vue.createCommentVNode("v-if",true)],16/* FULL_PROPS */);}),128/* KEYED_FRAGMENT */))])]),_cache[16]||(_cache[16]=vue.createTextVNode()),vue.createElementVNode("tbody",_hoisted_12$1,[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.rows,(row,index)=>{return vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:_ctx.rowKey(row)},[vue.createElementVNode("tr",{class:vue.normalizeClass(_ctx.rowClasses(row,index)),"aria-label":_ctx.rowDescription(row),"aria-expanded":_ctx.rowAriaExpanded(row),"aria-level":_ctx.isExpandableTable?1:void 0,"aria-describedby":_ctx.getExpandableDescribedby(row),tabindex:"0",onKeydown:vue.withModifiers($event=>_ctx.onKeydown($event,index),["self"]),onClick:$event=>_ctx.onClick($event,row,index)},[_ctx.isExpandableTable?(vue.openBlock(),vue.createElementBlock("td",_hoisted_14,[_ctx.hasExpandableContent(row)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_15,[vue.createVNode(_component_f_icon,{name:"arrow-right",rotate:_ctx.isExpanded(row)?"270":"90"},null,8,["rotate"])])):vue.createCommentVNode("v-if",true)])):vue.createCommentVNode("v-if",true),_cache[6]||(_cache[6]=vue.createTextVNode()),_ctx.selectable?(vue.openBlock(),vue.createElementBlock("td",_hoisted_16,[vue.createElementVNode("div",_hoisted_17,[vue.createVNode(_component_f_checkbox_field,{value:true,"model-value":_ctx.isSelected(row),onClick:vue.withModifiers($event=>_ctx.onSelect(row),["self"])},{default:vue.withCtx(()=>[_ctx.hasCheckboxDescription?(vue.openBlock(),vue.createElementBlock("span",_hoisted_18,[vue.renderSlot(_ctx.$slots,"checkbox-description",vue.mergeProps({ref_for:true},{row}))])):vue.createCommentVNode("v-if",true)]),_:2/* DYNAMIC */},1032,["model-value","onClick"])])])):vue.createCommentVNode("v-if",true),_cache[7]||(_cache[7]=vue.createTextVNode()),vue.renderSlot(_ctx.$slots,"default",vue.mergeProps({ref_for:true},{row}))],42,_hoisted_13),_cache[11]||(_cache[11]=vue.createTextVNode()),_ctx.isExpandableTable&&_ctx.hasExpandableContent(row)?(vue.openBlock(true),vue.createElementBlock(vue.Fragment,{key:0},vue.renderList(_ctx.expandableRows(row),(expandableRow,expandableIndex)=>{return vue.openBlock(),vue.createElementBlock("tr",{key:_ctx.rowKey(expandableRow),"aria-level":"2",class:vue.normalizeClass(_ctx.expandableRowClasses(row,expandableIndex))},[_cache[8]||(_cache[8]=vue.createElementVNode("td",null,null,-1/* HOISTED */)),_cache[9]||(_cache[9]=vue.createTextVNode()),_ctx.selectable?(vue.openBlock(),vue.createElementBlock("td",_hoisted_19)):vue.createCommentVNode("v-if",true),_cache[10]||(_cache[10]=vue.createTextVNode()),!_ctx.hasExpandableSlot?(vue.openBlock(true),vue.createElementBlock(vue.Fragment,{key:1},vue.renderList(_ctx.columns,(column,columnIndex)=>{return vue.openBlock(),vue.createElementBlock("td",{key:`${_ctx.rowKey(expandableRow)}${column.name}`,class:vue.normalizeClass(_ctx.expandableColumnClasses(column,columnIndex))},vue.toDisplayString(expandableRow[column.name]),3/* TEXT, CLASS */);}),128/* KEYED_FRAGMENT */)):(vue.openBlock(),vue.createElementBlock("td",{key:2,class:"table__column table__column--indented",colspan:_ctx.columns.length},[vue.renderSlot(_ctx.$slots,"expandable",vue.mergeProps({ref_for:true},{expandableRow,parentRow:row}))],8,_hoisted_20))],2/* CLASS */);}),128/* KEYED_FRAGMENT */)):vue.createCommentVNode("v-if",true)],64/* STABLE_FRAGMENT */);}),128/* KEYED_FRAGMENT */)),_cache[12]||(_cache[12]=vue.createTextVNode()),_ctx.isEmpty&&_ctx.columns.length===0?(vue.openBlock(),vue.createElementBlock("tr",_hoisted_21,[vue.renderSlot(_ctx.$slots,"default",vue.normalizeProps(vue.guardReactiveProps({row:{}})))])):vue.createCommentVNode("v-if",true),_cache[13]||(_cache[13]=vue.createTextVNode()),_ctx.isEmpty?(vue.openBlock(),vue.createElementBlock("tr",_hoisted_22,[vue.createElementVNode("td",{class:"table__column table__column--action",colspan:_ctx.nbOfColumns},[vue.renderSlot(_ctx.$slots,"empty",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.interactive-table.empty","Tabellen är tom")),1/* TEXT */)])],8,_hoisted_23)])):vue.createCommentVNode("v-if",true)],512/* NEED_PATCH */)],16,_hoisted_1$6)],2/* CLASS */);}const FInteractiveTable=/* @__PURE__ */_export_sfc(_sfc_main$6,[["render",_sfc_render$6]]);const _sfc_main$5=vue.defineComponent({name:"FTextareaField",components:{FLabel},inheritAttrs:false,props:{/**
|
|
826
826
|
* The id for the input id attribute.
|
|
827
827
|
* The id for the label for attribute.
|
|
828
828
|
* If the prop is not set a random value will be generated.
|
|
@@ -847,7 +847,7 @@ onItemFocus(event){if(event&&event.target){event.target.style.position="relative
|
|
|
847
847
|
*/disabled:{type:Boolean,default:false},/**
|
|
848
848
|
* Enabling vertical resizing of the textarea
|
|
849
849
|
*/resizable:{type:Boolean,default:false}},emits:["input","update:modelValue"],data(){return{validityMode:"INITIAL",validationMessage:""};},computed:{attrs(){return{rows:4,...this.$attrs,value:this.modelValue,maxlength:this.maxlength};},isValid(){return this.validityMode==="VALID";},hasError(){return this.validityMode==="ERROR";},validityClass(){return{["textarea-field--error"]:this.hasError};},charactersLeft(){if(this.modelValue){return this.maxlength-this.modelValue.length;}else{return this.maxlength;}},showCharactersLeftWarning(){return logic.isSet(this.softLimit)&&logic.isSet(this.modelValue)&&// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- required when `softLimit`
|
|
850
|
-
this.modelValue.length>=this.maxlength-this.softLimit;},charactersLeftWarningInterpolated(){return`${this.charactersLeftWarning.replace("%charactersLeft%",this.charactersLeft.toString())}`;},textareaClass(){const classes=["textarea-field__textarea"];if(this.resizable){classes.push("textarea-field__resize--vertical");}else{classes.push("textarea-field__resize--none");}return classes;}},mounted(){if(logic.isSet(this.softLimit)&&!logic.isSet(this.maxlength)){throw new Error("You must pass a maxlength");}},methods:{onInput(event){if(event.target instanceof HTMLTextAreaElement){this.$emit("update:modelValue",event.target.value);this.$emit("input",event.target.value);}},onValidity({detail}){var _renderSlotText7;this.validationMessage=detail.validationMessage;this.validityMode=detail.validityMode;const errorMessage=(_renderSlotText7=renderSlotText(this.$slots.default))!==null&&_renderSlotText7!==void 0?_renderSlotText7:"";const element=this.$el.querySelector(`#${detail.elementId}`);if(element){dispatchComponentValidityEvent(element,{...detail,errorMessage,focusElementId:detail.elementId});}},onPendingValidity(){this.validityMode="INITIAL";}}});const _hoisted_1$5=["id","disabled"];function _sfc_render$5(_ctx,_cache,$props,$setup,$data,$options){const _component_f_label=vue.resolveComponent("f-label");return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["textarea-field",_ctx.validityClass])},[vue.createVNode(_component_f_label,{for:_ctx.id},vue.createSlots({default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default")]),description:vue.withCtx(({descriptionClass,discreteDescriptionClass})=>[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),"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"]),vue.createTextVNode(),_ctx.softLimit?(vue.openBlock(),vue.createBlock(_component_f_label,{key:0,for:_ctx.id,"aria-live":"polite"},{description:vue.withCtx(({descriptionClass})=>[_ctx.showCharactersLeftWarning?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(descriptionClass)},vue.toDisplayString(_ctx.charactersLeftWarningInterpolated),3/* TEXT, CLASS */)):vue.createCommentVNode("v-if",true)]),_:1/* STABLE */},8,["for"])):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createElementVNode("textarea",vue.mergeProps({id:_ctx.id,class:_ctx.textareaClass},_ctx.attrs,{disabled:_ctx.disabled,onInput:_cache[0]||(_cache[0]=(...args)=>_ctx.onInput&&_ctx.onInput(...args)),onValidity:_cache[1]||(_cache[1]=(...args)=>_ctx.onValidity&&_ctx.onValidity(...args)),onPendingValidity:_cache[2]||(_cache[2]=(...args)=>_ctx.onPendingValidity&&_ctx.onPendingValidity(...args))}),null,16,_hoisted_1$5)],2/* CLASS */);}const FTextareaField=/* @__PURE__ */_export_sfc(_sfc_main$5,[["render",_sfc_render$5]]);const ANIMATION_DURATION=500;const NO_CSS_CLASSES="";const CLOSED_CSS_CLASS_OPACITY="animate-expand animate-expand--opacity";const CLOSED_CSS_CLASS="animate-expand";const ANIMATION_CSS_CLASSES="animate-expand animate-expand--expanded";const _sfc_main$4=vue.defineComponent({name:"IAnimateExpand",props:{/**
|
|
850
|
+
this.modelValue.length>=this.maxlength-this.softLimit;},charactersLeftWarningInterpolated(){return`${this.charactersLeftWarning.replace("%charactersLeft%",this.charactersLeft.toString())}`;},textareaClass(){const classes=["textarea-field__textarea"];if(this.resizable){classes.push("textarea-field__resize--vertical");}else{classes.push("textarea-field__resize--none");}return classes;}},mounted(){if(logic.isSet(this.softLimit)&&!logic.isSet(this.maxlength)){throw new Error("You must pass a maxlength");}},methods:{onInput(event){if(event.target instanceof HTMLTextAreaElement){this.$emit("update:modelValue",event.target.value);this.$emit("input",event.target.value);}},onValidity({detail}){var _renderSlotText7;this.validationMessage=detail.validationMessage;this.validityMode=detail.validityMode;const errorMessage=(_renderSlotText7=renderSlotText(this.$slots.default))!==null&&_renderSlotText7!==void 0?_renderSlotText7:"";const element=this.$el.querySelector(`#${detail.elementId}`);if(element){dispatchComponentValidityEvent(element,{...detail,errorMessage,focusElementId:detail.elementId});}},onPendingValidity(){this.validityMode="INITIAL";}}});const _hoisted_1$5=["id","disabled"];function _sfc_render$5(_ctx,_cache,$props,$setup,$data,$options){const _component_f_label=vue.resolveComponent("f-label");return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["textarea-field",_ctx.validityClass])},[vue.createVNode(_component_f_label,{for:_ctx.id},vue.createSlots({default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default")]),description:vue.withCtx(({descriptionClass,discreteDescriptionClass})=>[vue.renderSlot(_ctx.$slots,"description",vue.normalizeProps(vue.guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),"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"]),_cache[6]||(_cache[6]=vue.createTextVNode()),_ctx.softLimit?(vue.openBlock(),vue.createBlock(_component_f_label,{key:0,for:_ctx.id,"aria-live":"polite"},{description:vue.withCtx(({descriptionClass})=>[_ctx.showCharactersLeftWarning?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(descriptionClass)},vue.toDisplayString(_ctx.charactersLeftWarningInterpolated),3/* TEXT, CLASS */)):vue.createCommentVNode("v-if",true)]),_:1/* STABLE */},8,["for"])):vue.createCommentVNode("v-if",true),_cache[7]||(_cache[7]=vue.createTextVNode()),vue.createElementVNode("textarea",vue.mergeProps({id:_ctx.id,class:_ctx.textareaClass},_ctx.attrs,{disabled:_ctx.disabled,onInput:_cache[0]||(_cache[0]=(...args)=>_ctx.onInput&&_ctx.onInput(...args)),onValidity:_cache[1]||(_cache[1]=(...args)=>_ctx.onValidity&&_ctx.onValidity(...args)),onPendingValidity:_cache[2]||(_cache[2]=(...args)=>_ctx.onPendingValidity&&_ctx.onPendingValidity(...args))}),null,16,_hoisted_1$5)],2/* CLASS */);}const FTextareaField=/* @__PURE__ */_export_sfc(_sfc_main$5,[["render",_sfc_render$5]]);const ANIMATION_DURATION=500;const NO_CSS_CLASSES="";const CLOSED_CSS_CLASS_OPACITY="animate-expand animate-expand--opacity";const CLOSED_CSS_CLASS="animate-expand";const ANIMATION_CSS_CLASSES="animate-expand animate-expand--expanded";const _sfc_main$4=vue.defineComponent({name:"IAnimateExpand",props:{/**
|
|
851
851
|
* Perform animation or not
|
|
852
852
|
*/animate:{type:Boolean,default:true},/**
|
|
853
853
|
* Use v-show instead of v-if when hiding content.
|
|
@@ -905,7 +905,7 @@ this.modelValue.length>=this.maxlength-this.softLimit;},charactersLeftWarningInt
|
|
|
905
905
|
* Gets called when the user interacts with the toggle button
|
|
906
906
|
*
|
|
907
907
|
* @internal
|
|
908
|
-
*/onClickToggle(){this.isOpen=!this.isOpen;const value=this.isOpen;const event={isOpen:this.isOpen};this.$emit("update:modelValue",value);this.$emit("toggle",event);if(!this.isOpen){const button=this.$el.querySelector(".tooltip__button");logic.focus(button);}this.$nextTick(()=>{this.positionArrow();});},positionArrow(){const button=this.$el.querySelector(".tooltip__button");const arrow=this.$el.querySelector(".tooltip__arrow");const content=this.$el.querySelector(".tooltip__content-wrapper");const borderSize=2;if(button&&arrow&&content){const buttonOffsetLeft=button.offsetLeft-content.offsetLeft;const relativeOffset=buttonOffsetLeft-borderSize+button.getBoundingClientRect().width/2;arrow.style.left=`${relativeOffset}px`;}}}});const _hoisted_1$3={class:"tooltip"};const _hoisted_2$2={class:"tooltip__container"};const _hoisted_3$2=["aria-expanded"];const _hoisted_4$1={class:"icon-stack icon-stack--tooltip"};const _hoisted_5$1={class:"sr-only"};const _hoisted_6$1={key:0};const _hoisted_7$1=["aria-hidden"];const _hoisted_8$1={class:"tooltip__arrow"};const _hoisted_9$1={class:"tooltip__content"};const _hoisted_10$1={class:"tooltip__body"};function _sfc_render$3(_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");const _component_f_expand=vue.resolveComponent("f-expand");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$3,[vue.createElementVNode("div",_hoisted_2$2,[vue.createElementVNode("button",{class:"tooltip__button",type:"button","aria-expanded":_ctx.isOpen?"true":"false",onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.onClickToggle&&_ctx.onClickToggle(...args))},[vue.createElementVNode("span",_hoisted_4$1,[vue.createVNode(_component_f_icon,{name:"circle"}),vue.createTextVNode(),vue.createVNode(_component_f_icon,{name:"i"}),vue.createTextVNode(),vue.createElementVNode("span",_hoisted_5$1,vue.toDisplayString(_ctx.screenReaderText),1/* TEXT */)])],8,_hoisted_3$2),vue.createTextVNode(),vue.createVNode(_component_f_expand,null,{default:vue.withCtx(()=>[_ctx.isOpen?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$1,[vue.createElementVNode("div",{class:"tooltip__content-wrapper",tabindex:"-1","aria-hidden":_ctx.isOpen?void 0:"true"},[vue.withDirectives(vue.createElementVNode("span",_hoisted_8$1,null,512/* NEED_PATCH */),[[vue.vShow,_ctx.isOpen]]),vue.createTextVNode(),vue.createElementVNode("div",_hoisted_9$1,[_ctx.hasHeader?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_ctx.headerTag),{key:0,class:"tooltip__header"},{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"header")]),_:3/* FORWARDED */})):vue.createCommentVNode("v-if",true),vue.createTextVNode(),vue.createElementVNode("div",_hoisted_10$1,[vue.renderSlot(_ctx.$slots,"body")])]),vue.createTextVNode(),vue.createVNode(_component_i_flex,{float:"right"},{default:vue.withCtx(()=>[vue.createVNode(_component_i_flex_item,{shrink:""},{default:vue.withCtx(()=>[vue.createElementVNode("button",{class:"close-button",type:"button",onClick:_cache[1]||(_cache[1]=(...args)=>_ctx.onClickToggle&&_ctx.onClickToggle(...args))},[vue.createElementVNode("span",null,vue.toDisplayString(_ctx.closeButtonText),1/* TEXT */),vue.createTextVNode(),vue.createVNode(_component_f_icon,{class:"button__icon",name:"close"})])]),_:1/* STABLE */})]),_:1/* STABLE */})],8,_hoisted_7$1)])):vue.createCommentVNode("v-if",true)]),_:3/* FORWARDED */})])]);}const FTooltip=/* @__PURE__ */_export_sfc(_sfc_main$3,[["render",_sfc_render$3]]);function FWizardApiInjected(){return{register:vue.inject("register"),unregister:vue.inject("unregister"),getStepCount:vue.inject("getStepCount"),openStep:vue.inject("openStep"),openNext:vue.inject("openNext"),cancel:vue.inject("cancel"),inheritedProps:vue.inject("inheritedProps")};}function reindex(dst){dst.sort((a,b)=>logic.documentOrderComparator(a.element,b.element));for(let i=0;i<dst.length;i++){dst[i].stepNumber=i+1;}}function addStep(dst,key,element){const index=dst.findIndex(it=>it.key===key);if(index>=0){throw new Error(`An FWizardStep with key "${key.toString()}" is already registered, refusing to register multiple steps with same key.`);}const step={key,element,stepNumber:-1,isOpen:false,currentOpen:-1};dst.push(step);reindex(dst);return step;}function removeStep(dst,key){const index=dst.findIndex(it=>it.key===key);if(index>=0){dst.splice(index,1);reindex(dst);}}const _sfc_main$2=vue.defineComponent({name:"FWizard",provide(){const wizard=this;const inheritedProps={get headerTag(){return wizard.headerTag;},get disableInitialFocus(){return wizard.disableInitialFocus;}};return{register:this.register,unregister:this.unregister,getStepCount:this.getStepCount,openStep:this.openStep,openNext:this.openNext,cancel:this.cancel,inheritedProps};},inheritAttrs:true,props:{modelValue:{type:String,default:null},/**
|
|
908
|
+
*/onClickToggle(){this.isOpen=!this.isOpen;const value=this.isOpen;const event={isOpen:this.isOpen};this.$emit("update:modelValue",value);this.$emit("toggle",event);if(!this.isOpen){const button=this.$el.querySelector(".tooltip__button");logic.focus(button);}this.$nextTick(()=>{this.positionArrow();});},positionArrow(){const button=this.$el.querySelector(".tooltip__button");const arrow=this.$el.querySelector(".tooltip__arrow");const content=this.$el.querySelector(".tooltip__content-wrapper");const borderSize=2;if(button&&arrow&&content){const buttonOffsetLeft=button.offsetLeft-content.offsetLeft;const relativeOffset=buttonOffsetLeft-borderSize+button.getBoundingClientRect().width/2;arrow.style.left=`${relativeOffset}px`;}}}});const _hoisted_1$3={class:"tooltip"};const _hoisted_2$2={class:"tooltip__container"};const _hoisted_3$2=["aria-expanded"];const _hoisted_4$1={class:"icon-stack icon-stack--tooltip"};const _hoisted_5$1={class:"sr-only"};const _hoisted_6$1={key:0};const _hoisted_7$1=["aria-hidden"];const _hoisted_8$1={class:"tooltip__arrow"};const _hoisted_9$1={class:"tooltip__content"};const _hoisted_10$1={class:"tooltip__body"};function _sfc_render$3(_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");const _component_f_expand=vue.resolveComponent("f-expand");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$3,[vue.createElementVNode("div",_hoisted_2$2,[vue.createElementVNode("button",{class:"tooltip__button",type:"button","aria-expanded":_ctx.isOpen?"true":"false",onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.onClickToggle&&_ctx.onClickToggle(...args))},[vue.createElementVNode("span",_hoisted_4$1,[vue.createVNode(_component_f_icon,{name:"circle"}),_cache[2]||(_cache[2]=vue.createTextVNode()),vue.createVNode(_component_f_icon,{name:"i"}),_cache[3]||(_cache[3]=vue.createTextVNode()),vue.createElementVNode("span",_hoisted_5$1,vue.toDisplayString(_ctx.screenReaderText),1/* TEXT */)])],8,_hoisted_3$2),_cache[8]||(_cache[8]=vue.createTextVNode()),vue.createVNode(_component_f_expand,null,{default:vue.withCtx(()=>[_ctx.isOpen?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$1,[vue.createElementVNode("div",{class:"tooltip__content-wrapper",tabindex:"-1","aria-hidden":_ctx.isOpen?void 0:"true"},[vue.withDirectives(vue.createElementVNode("span",_hoisted_8$1,null,512/* NEED_PATCH */),[[vue.vShow,_ctx.isOpen]]),_cache[6]||(_cache[6]=vue.createTextVNode()),vue.createElementVNode("div",_hoisted_9$1,[_ctx.hasHeader?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_ctx.headerTag),{key:0,class:"tooltip__header"},{default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"header")]),_:3/* FORWARDED */})):vue.createCommentVNode("v-if",true),_cache[4]||(_cache[4]=vue.createTextVNode()),vue.createElementVNode("div",_hoisted_10$1,[vue.renderSlot(_ctx.$slots,"body")])]),_cache[7]||(_cache[7]=vue.createTextVNode()),vue.createVNode(_component_i_flex,{float:"right"},{default:vue.withCtx(()=>[vue.createVNode(_component_i_flex_item,{shrink:""},{default:vue.withCtx(()=>[vue.createElementVNode("button",{class:"close-button",type:"button",onClick:_cache[1]||(_cache[1]=(...args)=>_ctx.onClickToggle&&_ctx.onClickToggle(...args))},[vue.createElementVNode("span",null,vue.toDisplayString(_ctx.closeButtonText),1/* TEXT */),_cache[5]||(_cache[5]=vue.createTextVNode()),vue.createVNode(_component_f_icon,{class:"button__icon",name:"close"})])]),_:1/* STABLE */})]),_:1/* STABLE */})],8,_hoisted_7$1)])):vue.createCommentVNode("v-if",true)]),_:3/* FORWARDED */})])]);}const FTooltip=/* @__PURE__ */_export_sfc(_sfc_main$3,[["render",_sfc_render$3]]);function FWizardApiInjected(){return{register:vue.inject("register"),unregister:vue.inject("unregister"),getStepCount:vue.inject("getStepCount"),openStep:vue.inject("openStep"),openNext:vue.inject("openNext"),cancel:vue.inject("cancel"),inheritedProps:vue.inject("inheritedProps")};}function reindex(dst){dst.sort((a,b)=>logic.documentOrderComparator(a.element,b.element));for(let i=0;i<dst.length;i++){dst[i].stepNumber=i+1;}}function addStep(dst,key,element){const index=dst.findIndex(it=>it.key===key);if(index>=0){throw new Error(`An FWizardStep with key "${key.toString()}" is already registered, refusing to register multiple steps with same key.`);}const step={key,element,stepNumber:-1,isOpen:false,currentOpen:-1};dst.push(step);reindex(dst);return step;}function removeStep(dst,key){const index=dst.findIndex(it=>it.key===key);if(index>=0){dst.splice(index,1);reindex(dst);}}const _sfc_main$2=vue.defineComponent({name:"FWizard",provide(){const wizard=this;const inheritedProps={get headerTag(){return wizard.headerTag;},get disableInitialFocus(){return wizard.disableInitialFocus;}};return{register:this.register,unregister:this.unregister,getStepCount:this.getStepCount,openStep:this.openStep,openNext:this.openNext,cancel:this.cancel,inheritedProps};},inheritAttrs:true,props:{modelValue:{type:String,default:null},/**
|
|
909
909
|
* Element to render for the header element inside the wizard steps.
|
|
910
910
|
*/headerTag:{type:String,required:true,validator(value){return["h1","h2","h3","h4","h5","h6"].includes(value);}},/**
|
|
911
911
|
* When the first wizard step is registered, it is opened and focused by default.
|
|
@@ -929,9 +929,9 @@ this.modelValue.length>=this.maxlength-this.softLimit;},charactersLeftWarningInt
|
|
|
929
929
|
* Include the error list component.
|
|
930
930
|
*/useErrorList:{type:Boolean,required:false,default:true}},setup(){return FWizardApiInjected();},data(){return{step:{},validity:{isValid:true,componentsWithError:[],componentCount:0},isOpenedFirstTime:true,ignoreClick:false};},computed:{defaultCurrentStepInformation(){return this.$t("fkui.wizard-step.current-step",`Steg {{ stepNumber }} av {{ totalSteps }}`,{stepNumber:this.stepNumber,totalSteps:this.totalSteps});},formId(){return`${String(this.step.key)}-form`;},animationId(){return`${String(this.step.key)}-animation`;},isOpen(){return this.step.isOpen;},isPending(){const{currentOpen,stepNumber}=this.step;return currentOpen>=0&¤tOpen<stepNumber;},isFinalStep(){return this.stepNumber===this.totalSteps;},showLink(){return!this.isOpen&&!this.isPending;},stepNumber(){return this.step.stepNumber;},totalSteps(){return this.getStepCount();},cssClass(){if(this.isOpen){return"wizard-step--open";}if(this.isPending){return"wizard-step--pending";}return"wizard-step--done";}},mounted(){var _a,_b;const key=(_b=(_a=vue.getCurrentInstance())==null?void 0:_a.vnode)==null?void 0:_b.key;if(!key){throw new Error("FWizardStep requires key to be set");}this.step=this.register(key,this.$el);},beforeUnmount(){var _a,_b;const key=(_b=(_a=vue.getCurrentInstance())==null?void 0:_a.vnode)==null?void 0:_b.key;if(key){this.unregister(key);}},methods:{open(){this.openStep(this.step);},async onSubmit(){if(this.ignoreClick){return;}this.openNext(this.step);},onCancel(){this.cancel();},/**
|
|
931
931
|
* Scroll down before animation starts.
|
|
932
|
-
*/async beforeAnimation(open){await this.$nextTick();this.ignoreClick=true;if(!open){const headerElement=getHTMLElementFromVueRef(this.$refs["header"]);if(!logic.DomUtils.isVisibleInViewport(headerElement)){ongoingScrollPromise=logic.DomUtils.scrollTo(headerElement,{duration:SCROLL_DURATION,offset:10});await ongoingScrollPromise;}}else if(ongoingScrollPromise){await ongoingScrollPromise;}},async afterAnimation(open){if(!open){return;}this.ignoreClick=false;if(this.isOpenedFirstTime){this.isOpenedFirstTime=false;if(this.inheritedProps.disableInitialFocus&&this.stepNumber===1){return;}}const headerElement=getHTMLElementFromVueRef(this.$refs["header"]);await this.$nextTick();if(!logic.DomUtils.isVisibleInViewport(headerElement)){await logic.DomUtils.scrollTo(headerElement,{duration:SCROLL_DURATION,offset:10});}logic.DomUtils.focus(headerElement);}}});const _hoisted_1$1=["aria-current"];const _hoisted_2$1={ref:"header",role:"group",class:"wizard-step__header",tabindex:"-1"};const _hoisted_3$1
|
|
932
|
+
*/async beforeAnimation(open){await this.$nextTick();this.ignoreClick=true;if(!open){const headerElement=getHTMLElementFromVueRef(this.$refs["header"]);if(!logic.DomUtils.isVisibleInViewport(headerElement)){ongoingScrollPromise=logic.DomUtils.scrollTo(headerElement,{duration:SCROLL_DURATION,offset:10});await ongoingScrollPromise;}}else if(ongoingScrollPromise){await ongoingScrollPromise;}},async afterAnimation(open){if(!open){return;}this.ignoreClick=false;if(this.isOpenedFirstTime){this.isOpenedFirstTime=false;if(this.inheritedProps.disableInitialFocus&&this.stepNumber===1){return;}}const headerElement=getHTMLElementFromVueRef(this.$refs["header"]);await this.$nextTick();if(!logic.DomUtils.isVisibleInViewport(headerElement)){await logic.DomUtils.scrollTo(headerElement,{duration:SCROLL_DURATION,offset:10});}logic.DomUtils.focus(headerElement);}}});const _hoisted_1$1=["aria-current"];const _hoisted_2$1={ref:"header",role:"group",class:"wizard-step__header",tabindex:"-1"};const _hoisted_3$1={class:"icon-stack"};const _hoisted_4={"data-test":"step-number"};const _hoisted_5={"aria-hidden":"true",class:"wizard-step__header__step-of"};const _hoisted_6={class:"sr-only"};const _hoisted_7={class:"sr-only"};const _hoisted_8={class:"sr-only"};const _hoisted_9={key:0,class:"sr-only"};const _hoisted_10={class:"button-group"};const _hoisted_11=["data-disabled"];const _hoisted_12={class:"sr-only"};function _sfc_render$1(_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");const _component_f_validation_form=vue.resolveComponent("f-validation-form");const _component_i_animate_expand=vue.resolveComponent("i-animate-expand");return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["wizard-step",_ctx.cssClass]),"aria-current":_ctx.isOpen?"step":void 0},[vue.createElementVNode("div",_hoisted_2$1,[vue.createVNode(_component_i_flex,null,{default:vue.withCtx(()=>[vue.createVNode(_component_i_flex_item,{align:"bottom",shrink:"","aria-hidden":"true"},{default:vue.withCtx(()=>[_cache[5]||(_cache[5]=vue.createElementVNode("div",{class:"wizard-step__header__line-up"},null,-1/* HOISTED */)),_cache[6]||(_cache[6]=vue.createTextVNode()),vue.createElementVNode("div",_hoisted_3$1,[vue.createVNode(_component_f_icon,{name:"circle"}),_cache[3]||(_cache[3]=vue.createTextVNode()),vue.createVNode(_component_f_icon,{name:"success"}),_cache[4]||(_cache[4]=vue.createTextVNode()),vue.createElementVNode("div",_hoisted_4,vue.toDisplayString(_ctx.stepNumber),1/* TEXT */)]),_cache[7]||(_cache[7]=vue.createTextVNode()),_cache[8]||(_cache[8]=vue.createElementVNode("div",{class:"wizard-step__header__line-down"},null,-1/* HOISTED */))]),_:1/* STABLE */}),_cache[12]||(_cache[12]=vue.createTextVNode()),vue.createVNode(_component_i_flex_item,{align:"bottom",grow:""},{default:vue.withCtx(()=>[_ctx.isOpen?vue.renderSlot(_ctx.$slots,"step-of",vue.normalizeProps(vue.mergeProps({key:0},{headerClass:"wizard-step__header__step-of",stepNumber:_ctx.stepNumber,totalSteps:_ctx.totalSteps})),()=>[vue.createElementVNode("span",_hoisted_5,vue.toDisplayString(_ctx.defaultCurrentStepInformation),1/* TEXT */)]):vue.createCommentVNode("v-if",true),_cache[9]||(_cache[9]=vue.createTextVNode()),vue.createVNode(_component_i_flex,{class:"wizard-step__header__title-container"},{default:vue.withCtx(()=>[vue.createVNode(_component_i_flex_item,{align:"center"},{default:vue.withCtx(()=>[_ctx.showLink?(vue.openBlock(),vue.createElementBlock("a",{key:0,"aria-expanded":"false",role:"button",href:"#",class:"anchor wizard-step__header__title",onClick:_cache[0]||(_cache[0]=vue.withModifiers((...args)=>_ctx.open&&_ctx.open(...args),["prevent"])),onKeypress:_cache[1]||(_cache[1]=vue.withKeys(vue.withModifiers((...args)=>_ctx.open&&_ctx.open(...args),["prevent"]),["space"]))},[vue.createElementVNode("span",_hoisted_6,vue.toDisplayString(_ctx.defaultCurrentStepInformation)+" ",1/* TEXT */),vue.createTextVNode(" "+vue.toDisplayString(_ctx.title)+" ",1/* TEXT */),vue.createElementVNode("span",_hoisted_7," "+vue.toDisplayString(_ctx.$t("fkui.wizard-step.finished-step","Avklarat steg")),1/* TEXT */)],32/* NEED_HYDRATION */)):(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_ctx.inheritedProps.headerTag),{key:1,class:"wizard-step__header__title"},{default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_8,vue.toDisplayString(_ctx.defaultCurrentStepInformation)+" ",1/* TEXT */),vue.createTextVNode(" "+vue.toDisplayString(_ctx.title)+" ",1/* TEXT */),_ctx.isPending?(vue.openBlock(),vue.createElementBlock("span",_hoisted_9,"\n "+vue.toDisplayString(_ctx.$t("fkui.wizard-step.pending","Inaktivt")),1/* TEXT */)):vue.createCommentVNode("v-if",true)]),_:1/* STABLE */}))]),_:1/* STABLE */})]),_:1/* STABLE */}),_cache[10]||(_cache[10]=vue.createTextVNode()),_cache[11]||(_cache[11]=vue.createElementVNode("div",{class:"wizard-step__header__line-adjustment"},null,-1/* HOISTED */))]),_:3/* FORWARDED */})]),_:3/* FORWARDED */})],512/* NEED_PATCH */),_cache[16]||(_cache[16]=vue.createTextVNode()),(vue.openBlock(),vue.createBlock(_component_i_animate_expand,{key:_ctx.animationId,opacity:false,expanded:_ctx.isOpen,"before-animation":_ctx.beforeAnimation,"after-animation":_ctx.afterAnimation,class:"wizard-step__connector"},{default:vue.withCtx(()=>[vue.createVNode(_component_f_validation_form,{id:_ctx.formId,"before-submit":_ctx.beforeNext,"before-validation":_ctx.beforeValidation,"use-error-list":_ctx.useErrorList,class:"wizard-step-body",onSubmit:_ctx.onSubmit},{"error-message":vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"error-message",{},()=>[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.wizard-step.errorlist.title","Oj, du har glömt att fylla i något. Gå till:")),1/* TEXT */)])]),default:vue.withCtx(()=>[vue.renderSlot(_ctx.$slots,"default"),_cache[14]||(_cache[14]=vue.createTextVNode()),vue.createElementVNode("div",_hoisted_10,[vue.createElementVNode("button",{"data-test":"submit-button","data-disabled":_ctx.ignoreClick?"true":"false",type:"submit",class:"button button--primary button-group__item button--large"},[vue.renderSlot(_ctx.$slots,"next-button-text",{},()=>[_ctx.isFinalStep?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.wizard-step.button.next.text-final","Gå vidare och granska")),1/* TEXT */)],64/* STABLE_FRAGMENT */)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createTextVNode(vue.toDisplayString(_ctx.$t("fkui.wizard-step.button.next.text","Fortsätt"))+" ",1/* TEXT */),vue.createElementVNode("span",_hoisted_12,"\n "+vue.toDisplayString(_ctx.$t("fkui.wizard-step.button.next.sr-text","till nästa steg")),1/* TEXT */)],64/* STABLE_FRAGMENT */))])],8,_hoisted_11),_cache[13]||(_cache[13]=vue.createTextVNode()),vue.createElementVNode("button",{"data-test":"cancel-button",type:"button",class:"button button--secondary button-group__item button--large",onClick:_cache[2]||(_cache[2]=(...args)=>_ctx.onCancel&&_ctx.onCancel(...args))},vue.toDisplayString(_ctx.$t("fkui.wizard-step.button.cancel.text","Avbryt")),1/* TEXT */)])]),_:3/* FORWARDED */},8,["id","before-submit","before-validation","use-error-list","onSubmit"])]),_:3/* FORWARDED */},8,["expanded","before-animation","after-animation"]))],10,_hoisted_1$1);}const FWizardStep=/* @__PURE__ */_export_sfc(_sfc_main$1,[["render",_sfc_render$1]]);function isDialogueTreeEndQuestion(value){return Boolean(value.userData);}const _sfc_main=vue.defineComponent({name:"FDialogueTree",components:{FIcon},props:{/**
|
|
933
933
|
* Current dialogue question
|
|
934
934
|
* @model
|
|
935
935
|
*/modelValue:{type:Object,required:true},/**
|
|
936
936
|
* Dialogue tree
|
|
937
|
-
*/dialogueTree:{type:Object,required:true}},emits:["change","update:modelValue"],data(){return{currentStep:this.dialogueTree,steps:[]};},computed:{userData(){if(isDialogueTreeEndQuestion(this.currentStep)){return this.currentStep.userData;}return void 0;},options(){if(!isDialogueTreeEndQuestion(this.currentStep)){return this.currentStep.options;}return[];}},created(){this.currentStep=this.dialogueTree;if(isDialogueTreeEndQuestion(this.currentStep)){this.emitChange(true);}else{this.emitChange(false);}},methods:{async onClickedOption(option,index){this.steps.push(index);this.currentStep=option.question;if(isDialogueTreeEndQuestion(option.question)){this.emitChange(true);await this.$nextTick();logic.focusFirst(this.$el);}else{this.emitChange(false);await this.$nextTick();const firstElement=getHTMLElementsFromVueRef(this.$refs["dialogueButton-0"])[0];if(firstElement){logic.focus(firstElement);}}},emitChange(lastStep){const emit={label:this.currentStep.label,lastStep,steps:this.steps};this.$emit("update:modelValue",emit);this.$emit("change",emit);}}});const _hoisted_1={class:"dialogue-tree"};const _hoisted_2={key:0,class:"dialogue-tree__list"};const _hoisted_3=["onClick"];function _sfc_render(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1,[_ctx.options.length>0?(vue.openBlock(),vue.createElementBlock("ul",_hoisted_2,[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.options,(option,index)=>{return vue.openBlock(),vue.createElementBlock("li",{key:option.label,class:"dialogue-tree__list-item"},[vue.createElementVNode("button",{ref_for:true,ref:`dialogueButton-${index}`,type:"button",onClick:$event=>_ctx.onClickedOption(option,index)},[vue.createElementVNode("span",null,vue.toDisplayString(option.label),1/* TEXT */),vue.createTextVNode(),vue.createVNode(_component_f_icon,{name:"arrow-right"})],8,_hoisted_3)]);}),128/* KEYED_FRAGMENT */))])):vue.renderSlot(_ctx.$slots,"default",vue.normalizeProps(vue.mergeProps({key:1},{userData:_ctx.userData})))]);}const FDialogueTree=/* @__PURE__ */_export_sfc(_sfc_main,[["render",_sfc_render]]);exports.ActivateItemInjected=ActivateItemInjected;exports.ErrorData=ErrorData;exports.ErrorPlugin=ErrorPlugin;exports.ErrorViewData=ErrorViewData;exports.EventBus=EventBus;exports.FBadge=FBadge;exports.FBankAccountNumberTextField=_sfc_main$I;exports.FBankgiroTextField=_sfc_main$H;exports.FCalendar=FCalendar;exports.FCalendarDay=FCalendarDay;exports.FCard=FCard;exports.FCheckboxField=FCheckboxField;exports.FCheckboxGroup=FCheckboxGroup;exports.FCheckboxGroupField=FCheckboxField;exports.FClearingnumberTextField=_sfc_main$G;exports.FConfirmModal=FConfirmModal;exports.FContextMenu=FContextMenu;exports.FCrudButton=FCrudButton;exports.FCrudDataset=FCrudDataset;exports.FCurrencyTextField=_sfc_main$K;exports.FDataTable=FDataTable;exports.FDatepickerField=FDatepickerField;exports.FDialogueTree=FDialogueTree;exports.FEmailTextField=FEmailTextField;exports.FErrorHandlingApp=FErrorHandlingApp;exports.FErrorList=FErrorList;exports.FExpand=FExpand;exports.FExpandablePanel=FExpandablePanel;exports.FExpandableParagraph=FExpandableParagraph;exports.FFieldset=FFieldset;exports.FFileItem=FFileItem;exports.FFileSelector=FFileSelector;exports.FForm=FForm;exports.FFormModal=FFormModal;exports.FFormModalAction=FValidationFormAction;exports.FFormStep=FFormStep;exports.FFormStepButton=FFormStepButton;exports.FIcon=FIcon;exports.FInteractiveTable=FInteractiveTable;exports.FKUIConfigButtonOrder=FKUIConfigButtonOrder;exports.FLabel=FLabel;exports.FLayoutApplicationTemplate=FLayoutApplicationTemplate;exports.FLayoutLeftPanel=FLayoutLeftPanel;exports.FLayoutRightPanel=FLayoutRightPanel;exports.FLayoutRightPanelService=FLayoutRightPanelService;exports.FList=FList;exports.FLoader=FLoader;exports.FMessageBox=FMessageBox;exports.FModal=FModal;exports.FNavigationMenu=FNavigationMenu;exports.FNumericTextField=_sfc_main$F;exports.FOffline=FOffline;exports.FOrganisationsnummerTextField=_sfc_main$A;exports.FOutputField=FOutputField;exports.FPageHeader=FPageHeader;exports.FPercentTextField=_sfc_main$B;exports.FPersonnummerTextField=_sfc_main$E;exports.FPhoneTextField=FPhoneTextField;exports.FPlusgiroTextField=_sfc_main$D;exports.FPostalCodeTextField=_sfc_main$C;exports.FProgressbar=FProgressbar;exports.FRadioField=FRadioField;exports.FRadioGroup=FRadioGroup;exports.FRadioGroupField=FRadioField;exports.FSearchTextField=FSearchTextField;exports.FSelectField=FSelectField;exports.FSortFilterDataset=FSortFilterDataset;exports.FSortFilterDatasetInjected=FSortFilterDatasetInjected;exports.FStaticField=FStaticField;exports.FTableColumn=FTableColumn;exports.FTableColumnSize=FTableColumnSize;exports.FTableColumnSort=FTableColumnSort;exports.FTableColumnType=FTableColumnType;exports.FTextField=FTextField;exports.FTextareaField=FTextareaField;exports.FTooltip=FTooltip;exports.FValidationForm=FValidationForm;exports.FValidationFormAction=FValidationFormAction;exports.FValidationGroup=FValidationGroup;exports.FWizard=FWizard;exports.FWizardStep=FWizardStep;exports.FWizardStepAction=FValidationFormAction;exports.FormErrorList=FormErrorList;exports.FormStep=FormStep;exports.IAnimateExpand=IAnimateExpand;exports.ICalendarMonth=ICalendarMonth;exports.ICalendarMonthGrid=ICalendarMonthGrid;exports.ICalendarNavbar=ICalendarNavbar;exports.IFlex=IFlex;exports.IFlexItem=IFlexItem;exports.IMenu=IMenu;exports.IPopup=IPopup;exports.IPopupError=IPopupError;exports.IPopupMenu=IPopupMenu;exports.ISkipLink=ISkipLink;exports.IValidationForm=FValidationForm;exports.MenuAction=MenuAction;exports.ModalReason=ModalReason;exports.Operation=Operation;exports.Placement=Placement;exports.TableScroll=TableScroll;exports.TestPlugin=TestPlugin;exports.TranslationMixin=TranslationMixin;exports.TranslationPlugin=TranslationPlugin;exports.UNHANDLED_ERROR_EVENT=UNHANDLED_ERROR_EVENT;exports.ValidationPlugin=ValidationPlugin;exports.actionFromKeyboardEvent=actionFromKeyboardEvent;exports.cleanUpElements=cleanUpElements;exports.config=config;exports.confirmModal=confirmModal;exports.createFFormProvideOptions=createFFormProvideOptions;exports.dispatchComponentUnmountEvent=dispatchComponentUnmountEvent;exports.dispatchComponentValidityEvent=dispatchComponentValidityEvent;exports.
|
|
937
|
+
*/dialogueTree:{type:Object,required:true}},emits:["change","update:modelValue"],data(){return{currentStep:this.dialogueTree,steps:[]};},computed:{userData(){if(isDialogueTreeEndQuestion(this.currentStep)){return this.currentStep.userData;}return void 0;},options(){if(!isDialogueTreeEndQuestion(this.currentStep)){return this.currentStep.options;}return[];}},created(){this.currentStep=this.dialogueTree;if(isDialogueTreeEndQuestion(this.currentStep)){this.emitChange(true);}else{this.emitChange(false);}},methods:{async onClickedOption(option,index){this.steps.push(index);this.currentStep=option.question;if(isDialogueTreeEndQuestion(option.question)){this.emitChange(true);await this.$nextTick();logic.focusFirst(this.$el);}else{this.emitChange(false);await this.$nextTick();const firstElement=getHTMLElementsFromVueRef(this.$refs["dialogueButton-0"])[0];if(firstElement){logic.focus(firstElement);}}},emitChange(lastStep){const emit={label:this.currentStep.label,lastStep,steps:this.steps};this.$emit("update:modelValue",emit);this.$emit("change",emit);}}});const _hoisted_1={class:"dialogue-tree"};const _hoisted_2={key:0,class:"dialogue-tree__list"};const _hoisted_3=["onClick"];function _sfc_render(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=vue.resolveComponent("f-icon");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1,[_ctx.options.length>0?(vue.openBlock(),vue.createElementBlock("ul",_hoisted_2,[(vue.openBlock(true),vue.createElementBlock(vue.Fragment,null,vue.renderList(_ctx.options,(option,index)=>{return vue.openBlock(),vue.createElementBlock("li",{key:option.label,class:"dialogue-tree__list-item"},[vue.createElementVNode("button",{ref_for:true,ref:`dialogueButton-${index}`,type:"button",onClick:$event=>_ctx.onClickedOption(option,index)},[vue.createElementVNode("span",null,vue.toDisplayString(option.label),1/* TEXT */),_cache[0]||(_cache[0]=vue.createTextVNode()),vue.createVNode(_component_f_icon,{name:"arrow-right"})],8,_hoisted_3)]);}),128/* KEYED_FRAGMENT */))])):vue.renderSlot(_ctx.$slots,"default",vue.normalizeProps(vue.mergeProps({key:1},{userData:_ctx.userData})))]);}const FDialogueTree=/* @__PURE__ */_export_sfc(_sfc_main,[["render",_sfc_render]]);exports.ActivateItemInjected=ActivateItemInjected;exports.ErrorData=ErrorData;exports.ErrorPlugin=ErrorPlugin;exports.ErrorViewData=ErrorViewData;exports.EventBus=EventBus;exports.FBadge=FBadge;exports.FBankAccountNumberTextField=_sfc_main$I;exports.FBankgiroTextField=_sfc_main$H;exports.FCalendar=FCalendar;exports.FCalendarDay=FCalendarDay;exports.FCard=FCard;exports.FCheckboxField=FCheckboxField;exports.FCheckboxGroup=FCheckboxGroup;exports.FCheckboxGroupField=FCheckboxField;exports.FClearingnumberTextField=_sfc_main$G;exports.FConfirmModal=FConfirmModal;exports.FContextMenu=FContextMenu;exports.FCrudButton=FCrudButton;exports.FCrudDataset=FCrudDataset;exports.FCurrencyTextField=_sfc_main$K;exports.FDataTable=FDataTable;exports.FDatepickerField=FDatepickerField;exports.FDialogueTree=FDialogueTree;exports.FEmailTextField=FEmailTextField;exports.FErrorHandlingApp=FErrorHandlingApp;exports.FErrorList=FErrorList;exports.FExpand=FExpand;exports.FExpandablePanel=FExpandablePanel;exports.FExpandableParagraph=FExpandableParagraph;exports.FFieldset=FFieldset;exports.FFileItem=FFileItem;exports.FFileSelector=FFileSelector;exports.FForm=FForm;exports.FFormModal=FFormModal;exports.FFormModalAction=FValidationFormAction;exports.FFormStep=FFormStep;exports.FFormStepButton=FFormStepButton;exports.FIcon=FIcon;exports.FInteractiveTable=FInteractiveTable;exports.FKUIConfigButtonOrder=FKUIConfigButtonOrder;exports.FLabel=FLabel;exports.FLayoutApplicationTemplate=FLayoutApplicationTemplate;exports.FLayoutLeftPanel=FLayoutLeftPanel;exports.FLayoutRightPanel=FLayoutRightPanel;exports.FLayoutRightPanelService=FLayoutRightPanelService;exports.FList=FList;exports.FLoader=FLoader;exports.FMessageBox=FMessageBox;exports.FModal=FModal;exports.FNavigationMenu=FNavigationMenu;exports.FNumericTextField=_sfc_main$F;exports.FOffline=FOffline;exports.FOrganisationsnummerTextField=_sfc_main$A;exports.FOutputField=FOutputField;exports.FPageHeader=FPageHeader;exports.FPercentTextField=_sfc_main$B;exports.FPersonnummerTextField=_sfc_main$E;exports.FPhoneTextField=FPhoneTextField;exports.FPlusgiroTextField=_sfc_main$D;exports.FPostalCodeTextField=_sfc_main$C;exports.FProgressbar=FProgressbar;exports.FRadioField=FRadioField;exports.FRadioGroup=FRadioGroup;exports.FRadioGroupField=FRadioField;exports.FSearchTextField=FSearchTextField;exports.FSelectField=FSelectField;exports.FSortFilterDataset=FSortFilterDataset;exports.FSortFilterDatasetInjected=FSortFilterDatasetInjected;exports.FStaticField=FStaticField;exports.FTableColumn=FTableColumn;exports.FTableColumnSize=FTableColumnSize;exports.FTableColumnSort=FTableColumnSort;exports.FTableColumnType=FTableColumnType;exports.FTextField=FTextField;exports.FTextareaField=FTextareaField;exports.FTooltip=FTooltip;exports.FValidationForm=FValidationForm;exports.FValidationFormAction=FValidationFormAction;exports.FValidationGroup=FValidationGroup;exports.FWizard=FWizard;exports.FWizardStep=FWizardStep;exports.FWizardStepAction=FValidationFormAction;exports.FormErrorList=FormErrorList;exports.FormStep=FormStep;exports.IAnimateExpand=IAnimateExpand;exports.ICalendarMonth=ICalendarMonth;exports.ICalendarMonthGrid=ICalendarMonthGrid;exports.ICalendarNavbar=ICalendarNavbar;exports.IFlex=IFlex;exports.IFlexItem=IFlexItem;exports.IMenu=IMenu;exports.IPopup=IPopup;exports.IPopupError=IPopupError;exports.IPopupMenu=IPopupMenu;exports.ISkipLink=ISkipLink;exports.IValidationForm=FValidationForm;exports.MenuAction=MenuAction;exports.ModalReason=ModalReason;exports.Operation=Operation;exports.Placement=Placement;exports.TableScroll=TableScroll;exports.TestPlugin=TestPlugin;exports.TranslationMixin=TranslationMixin;exports.TranslationPlugin=TranslationPlugin;exports.UNHANDLED_ERROR_EVENT=UNHANDLED_ERROR_EVENT;exports.ValidationPlugin=ValidationPlugin;exports.actionFromKeyboardEvent=actionFromKeyboardEvent;exports.cleanUpElements=cleanUpElements;exports.config=config;exports.confirmModal=confirmModal;exports.createFFormProvideOptions=createFFormProvideOptions;exports.dispatchComponentUnmountEvent=dispatchComponentUnmountEvent;exports.dispatchComponentValidityEvent=dispatchComponentValidityEvent;exports.findElementFromVueRef=findElementFromVueRef;exports.findHTMLElementFromVueRef=findHTMLElementFromVueRef;exports.findParentByName=findParentByName;exports.focus=focus;exports.formModal=formModal;exports.getDayEndOffset=getDayEndOffset;exports.getDayStartOffset=getDayStartOffset;exports.getElementFromVueRef=getElementFromVueRef;exports.getElementsFromVueRef=getElementsFromVueRef;exports.getHTMLElementFromVueRef=getHTMLElementFromVueRef;exports.getHTMLElementsFromVueRef=getHTMLElementsFromVueRef;exports.getInputElement=getInputElement;exports.getParentByName=getParentByName;exports.getRef=getRef;exports.getSortedHTMLElementsFromVueRef=getSortedHTMLElementsFromVueRef;exports.getTextFromScopedSlot=getTextFromScopedSlot;exports.handleKeyboardFocusNavigation=handleKeyboardFocusNavigation;exports.hasParentByName=hasParentByName;exports.hasSlot=hasSlot;exports.includeItem=includeItem;exports.isContextMenuSeparatorItem=isContextMenuSeparatorItem;exports.isContextMenuTextItem=isContextMenuTextItem;exports.isDialogueTreeEndQuestion=isDialogueTreeEndQuestion;exports.isFormStepReference=isFormStepReference;exports.itemEquals=itemEquals;exports.mountComponent=mountComponent;exports.openModal=openModal;exports.refIsElement=refIsElement;exports.refIsElementArray=refIsElementArray;exports.refIsHTMLElementArray=refIsHTMLElementArray;exports.refIsVue=refIsVue;exports.refIsVueArray=refIsVueArray;exports.renderSlotText=renderSlotText;exports.setIsOpen=setIsOpen;exports.setRef=setRef;exports.setRunningContext=setRunningContext;exports.sortComponentsWithErrorsOnDOMOrder=sortComponentsWithErrorsOnDOMOrder;exports.tableScrollClasses=tableScrollClasses;exports.useModal=useModal;exports.useTranslate=useTranslate;
|