@davincihealthcare/elty-design-system-vue 1.89.2 → 1.92.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.
@@ -9,12 +9,14 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
9
9
  /** Hide tooltip when tooltip's title changes */
10
10
  hideOnChange?: boolean;
11
11
  hideOnMobile?: boolean;
12
+ allowNewLines?: boolean;
12
13
  }>, {
13
14
  content: undefined;
14
15
  position: string;
15
16
  delayTime: number;
16
17
  hideOnChange: boolean;
17
18
  hideOnMobile: boolean;
19
+ allowNewLines: boolean;
18
20
  }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
19
21
  title: string;
20
22
  content?: string;
@@ -24,18 +26,21 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
24
26
  /** Hide tooltip when tooltip's title changes */
25
27
  hideOnChange?: boolean;
26
28
  hideOnMobile?: boolean;
29
+ allowNewLines?: boolean;
27
30
  }>, {
28
31
  content: undefined;
29
32
  position: string;
30
33
  delayTime: number;
31
34
  hideOnChange: boolean;
32
35
  hideOnMobile: boolean;
36
+ allowNewLines: boolean;
33
37
  }>>>, {
34
38
  position: ElTooltipPosition;
35
39
  content: string;
36
40
  delayTime: string | number;
37
41
  hideOnChange: boolean;
38
42
  hideOnMobile: boolean;
43
+ allowNewLines: boolean;
39
44
  }, {}>, {
40
45
  default?(_: {}): any;
41
46
  }>;
@@ -8,6 +8,11 @@ declare const _default: import('vue').DefineComponent<{
8
8
  type: PropType<ElInputDateType>;
9
9
  default: string;
10
10
  };
11
+ zone: {
12
+ type: StringConstructor;
13
+ default: undefined;
14
+ required: false;
15
+ };
11
16
  modelValue: {
12
17
  type: PropType<NumberValueType>;
13
18
  };
@@ -74,6 +79,11 @@ declare const _default: import('vue').DefineComponent<{
74
79
  type: PropType<ElInputDateType>;
75
80
  default: string;
76
81
  };
82
+ zone: {
83
+ type: StringConstructor;
84
+ default: undefined;
85
+ required: false;
86
+ };
77
87
  modelValue: {
78
88
  type: PropType<NumberValueType>;
79
89
  };
@@ -148,5 +158,6 @@ declare const _default: import('vue').DefineComponent<{
148
158
  min: number;
149
159
  max: number;
150
160
  validation: import('./validation-rules').InputValidation;
161
+ zone: string;
151
162
  }, {}>;
152
163
  export default _default;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("./_CustomTransition.vue.cjs2.js"),s=require("./ElClipToAnchor.vue.cjs2.js"),h=require("./composable/mobileComposable.cjs.js"),_={class:"font-semibold"},v={key:0,class:"mt-1"},y=s.elClipToAnchorPositions,T=e.defineComponent({__name:"ElTooltip",props:{title:{},content:{default:void 0},position:{default:"top"},delayTime:{default:200},hideOnChange:{type:Boolean,default:!1},hideOnMobile:{type:Boolean,default:!1}},setup(r){const o=r,i=e.ref(),n=e.ref(!1);let l;const{isMobile:u}=h.useMobile(),c=e.computed(()=>typeof o.delayTime=="string"&&isNaN(Number(o.delayTime))?200:Number(o.delayTime)),d=()=>{!o.title.length||o.hideOnMobile&&u.value||(l=setTimeout(()=>{l&&clearTimeout(l),n.value=!0},c.value))},p=()=>{n.value=!1,l&&clearTimeout(l)};return e.watch(()=>o.title,t=>{t.length||(n.value=!1)}),e.watch([()=>o.hideOnChange,()=>o.title],t=>{t[0]&&(n.value=!1)}),(t,f)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{ref_key:"anchor",ref:i,onMouseenter:d,onMouseleave:p},[e.renderSlot(t.$slots,"default")],544),e.createVNode(m.default,{name:"slide-y-fade"},{default:e.withCtx(()=>[i.value&&n.value?(e.openBlock(),e.createBlock(s.default,{key:0,anchor:i.value,position:t.position,"distance-from-anchor":14,class:"max-w-96 rounded-2xl bg-neutral-100 p-3 text-xs drop-shadow text-neutral-darker"},{default:e.withCtx(()=>{var a;return[e.createElementVNode("p",_,e.toDisplayString(t.title),1),(a=t.content)!=null&&a.length?(e.openBlock(),e.createElementBlock("p",v,e.toDisplayString(t.content),1)):e.createCommentVNode("",!0)]}),_:1},8,["anchor","position"])):e.createCommentVNode("",!0)]),_:1})]))}});exports.default=T;exports.elTooltipPositions=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("./_CustomTransition.vue.cjs2.js"),s=require("./ElClipToAnchor.vue.cjs2.js"),h=require("./composable/mobileComposable.cjs.js"),v=s.elClipToAnchorPositions,_=e.defineComponent({__name:"ElTooltip",props:{title:{},content:{default:void 0},position:{default:"top"},delayTime:{default:200},hideOnChange:{type:Boolean,default:!1},hideOnMobile:{type:Boolean,default:!1},allowNewLines:{type:Boolean,default:!1}},setup(r){const o=r,a=e.ref(),l=e.ref(!1);let n;const{isMobile:u}=h.useMobile(),c=e.computed(()=>typeof o.delayTime=="string"&&isNaN(Number(o.delayTime))?200:Number(o.delayTime)),d=()=>{!o.title.length||o.hideOnMobile&&u.value||(n=setTimeout(()=>{n&&clearTimeout(n),l.value=!0},c.value))},p=()=>{l.value=!1,n&&clearTimeout(n)};return e.watch(()=>o.title,t=>{t.length||(l.value=!1)}),e.watch([()=>o.hideOnChange,()=>o.title],t=>{t[0]&&(l.value=!1)}),(t,f)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{ref_key:"anchor",ref:a,onMouseenter:d,onMouseleave:p},[e.renderSlot(t.$slots,"default")],544),e.createVNode(m.default,{name:"slide-y-fade"},{default:e.withCtx(()=>[a.value&&l.value?(e.openBlock(),e.createBlock(s.default,{key:0,anchor:a.value,position:t.position,"distance-from-anchor":14,class:"max-w-96 rounded-2xl bg-neutral-100 p-3 text-xs drop-shadow text-neutral-darker"},{default:e.withCtx(()=>{var i;return[e.createElementVNode("p",{class:e.normalizeClass(["font-semibold",{"whitespace-pre-line":t.allowNewLines}])},e.toDisplayString(t.title),3),(i=t.content)!=null&&i.length?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(["mt-1",{"whitespace-pre-line":t.allowNewLines}])},e.toDisplayString(t.content),3)):e.createCommentVNode("",!0)]}),_:1},8,["anchor","position"])):e.createCommentVNode("",!0)]),_:1})]))}});exports.default=_;exports.elTooltipPositions=v;
2
2
  //# sourceMappingURL=ElTooltip.vue.cjs2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ElTooltip.vue.cjs2.js","sources":["../../src/ElTooltip.vue"],"sourcesContent":["<script lang=\"ts\">\nimport ElClipToAnchor, { elClipToAnchorPositions } from '@/ElClipToAnchor.vue';\nimport { useMobile } from '@/composable/mobileComposable';\nexport const elTooltipPositions = elClipToAnchorPositions;\nexport type ElTooltipPosition = (typeof elTooltipPositions)[number];\n</script>\n<script lang=\"ts\" setup>\nimport { computed, ref, watch } from 'vue';\nimport CustomTransition from '@/_CustomTransition.vue';\n\nconst props = withDefaults(\n defineProps<{\n title: string;\n content?: string;\n position?: ElTooltipPosition;\n /** Time in ms before the tooltip appears */\n delayTime?: string | number;\n /** Hide tooltip when tooltip's title changes */\n hideOnChange?: boolean;\n hideOnMobile?: boolean;\n }>(),\n {\n content: undefined,\n position: 'top',\n delayTime: 200,\n hideOnChange: false,\n hideOnMobile: false,\n },\n);\n\nconst anchor = ref<HTMLElement>();\nconst show = ref(false);\nlet showDebounceTimeout: ReturnType<typeof setTimeout> | undefined;\n\nconst { isMobile } = useMobile();\n\nconst sanitizedDelayTime = computed(() =>\n typeof props.delayTime === 'string' && isNaN(Number(props.delayTime)) ? 200 : Number(props.delayTime),\n);\n\nconst onMouseEnter = () => {\n if (!props.title.length || (props.hideOnMobile && isMobile.value)) return;\n\n showDebounceTimeout = setTimeout(() => {\n if (showDebounceTimeout) clearTimeout(showDebounceTimeout);\n show.value = true;\n }, sanitizedDelayTime.value);\n};\n\nconst onMouseLeave = () => {\n show.value = false;\n if (showDebounceTimeout) clearTimeout(showDebounceTimeout);\n};\n\nwatch(\n () => props.title,\n v => {\n if (!v.length) show.value = false;\n },\n);\nwatch([() => props.hideOnChange, () => props.title], v => {\n const hideOnChange = v[0];\n if (hideOnChange) {\n show.value = false;\n }\n});\n</script>\n\n<template>\n <div>\n <div ref=\"anchor\" @mouseenter=\"onMouseEnter\" @mouseleave=\"onMouseLeave\">\n <slot></slot>\n </div>\n <CustomTransition name=\"slide-y-fade\">\n <ElClipToAnchor\n v-if=\"anchor && show\"\n :anchor=\"anchor\"\n :position=\"position\"\n :distance-from-anchor=\"14\"\n class=\"max-w-96 rounded-2xl bg-neutral-100 p-3 text-xs drop-shadow text-neutral-darker\"\n >\n <p class=\"font-semibold\">\n {{ title }}\n </p>\n <p v-if=\"content?.length\" class=\"mt-1\">{{ content }}</p>\n </ElClipToAnchor>\n </CustomTransition>\n </div>\n</template>\n"],"names":["elTooltipPositions","elClipToAnchorPositions","props","__props","anchor","ref","show","showDebounceTimeout","isMobile","useMobile","sanitizedDelayTime","computed","onMouseEnter","onMouseLeave","watch","v"],"mappings":"6TAGaA,EAAqBC,EAAA,kPAOlC,MAAMC,EAAQC,EAoBRC,EAASC,EAAAA,MACTC,EAAOD,MAAI,EAAK,EAClB,IAAAE,EAEE,KAAA,CAAE,SAAAC,GAAaC,EAAAA,YAEfC,EAAqBC,EAAA,SAAS,IAClC,OAAOT,EAAM,WAAc,UAAY,MAAM,OAAOA,EAAM,SAAS,CAAC,EAAI,IAAM,OAAOA,EAAM,SAAS,CAAA,EAGhGU,EAAe,IAAM,CACrB,CAACV,EAAM,MAAM,QAAWA,EAAM,cAAgBM,EAAS,QAE3DD,EAAsB,WAAW,IAAM,CACjCA,GAAqB,aAAaA,CAAmB,EACzDD,EAAK,MAAQ,EAAA,EACZI,EAAmB,KAAK,EAAA,EAGvBG,EAAe,IAAM,CACzBP,EAAK,MAAQ,GACTC,GAAqB,aAAaA,CAAmB,CAAA,EAG3DO,OAAAA,EAAA,MACE,IAAMZ,EAAM,MACPa,GAAA,CACEA,EAAE,SAAQT,EAAK,MAAQ,GAC9B,CAAA,EAEIQ,QAAA,CAAC,IAAMZ,EAAM,aAAc,IAAMA,EAAM,KAAK,EAAQa,GAAA,CACnCA,EAAE,CAAC,IAEtBT,EAAK,MAAQ,GACf,CACD"}
1
+ {"version":3,"file":"ElTooltip.vue.cjs2.js","sources":["../../src/ElTooltip.vue"],"sourcesContent":["<script lang=\"ts\">\nimport ElClipToAnchor, { elClipToAnchorPositions } from '@/ElClipToAnchor.vue';\nimport { useMobile } from '@/composable/mobileComposable';\nexport const elTooltipPositions = elClipToAnchorPositions;\nexport type ElTooltipPosition = (typeof elTooltipPositions)[number];\n</script>\n<script lang=\"ts\" setup>\nimport { computed, ref, watch } from 'vue';\nimport CustomTransition from '@/_CustomTransition.vue';\n\nconst props = withDefaults(\n defineProps<{\n title: string;\n content?: string;\n position?: ElTooltipPosition;\n /** Time in ms before the tooltip appears */\n delayTime?: string | number;\n /** Hide tooltip when tooltip's title changes */\n hideOnChange?: boolean;\n hideOnMobile?: boolean;\n allowNewLines?: boolean;\n }>(),\n {\n content: undefined,\n position: 'top',\n delayTime: 200,\n hideOnChange: false,\n hideOnMobile: false,\n allowNewLines: false,\n },\n);\n\nconst anchor = ref<HTMLElement>();\nconst show = ref(false);\nlet showDebounceTimeout: ReturnType<typeof setTimeout> | undefined;\n\nconst { isMobile } = useMobile();\n\nconst sanitizedDelayTime = computed(() =>\n typeof props.delayTime === 'string' && isNaN(Number(props.delayTime)) ? 200 : Number(props.delayTime),\n);\n\nconst onMouseEnter = () => {\n if (!props.title.length || (props.hideOnMobile && isMobile.value)) return;\n\n showDebounceTimeout = setTimeout(() => {\n if (showDebounceTimeout) clearTimeout(showDebounceTimeout);\n show.value = true;\n }, sanitizedDelayTime.value);\n};\n\nconst onMouseLeave = () => {\n show.value = false;\n if (showDebounceTimeout) clearTimeout(showDebounceTimeout);\n};\n\nwatch(\n () => props.title,\n v => {\n if (!v.length) show.value = false;\n },\n);\nwatch([() => props.hideOnChange, () => props.title], v => {\n const hideOnChange = v[0];\n if (hideOnChange) {\n show.value = false;\n }\n});\n</script>\n\n<template>\n <div>\n <div ref=\"anchor\" @mouseenter=\"onMouseEnter\" @mouseleave=\"onMouseLeave\">\n <slot></slot>\n </div>\n <CustomTransition name=\"slide-y-fade\">\n <ElClipToAnchor\n v-if=\"anchor && show\"\n :anchor=\"anchor\"\n :position=\"position\"\n :distance-from-anchor=\"14\"\n class=\"max-w-96 rounded-2xl bg-neutral-100 p-3 text-xs drop-shadow text-neutral-darker\"\n >\n <p class=\"font-semibold\" :class=\"{ 'whitespace-pre-line': allowNewLines }\">\n {{ title }}\n </p>\n <p v-if=\"content?.length\" class=\"mt-1\" :class=\"{ 'whitespace-pre-line': allowNewLines }\">{{ content }}</p>\n </ElClipToAnchor>\n </CustomTransition>\n </div>\n</template>\n"],"names":["elTooltipPositions","elClipToAnchorPositions","props","__props","anchor","ref","show","showDebounceTimeout","isMobile","useMobile","sanitizedDelayTime","computed","onMouseEnter","onMouseLeave","watch","v"],"mappings":"4QAGaA,EAAqBC,EAAA,0RAOlC,MAAMC,EAAQC,EAsBRC,EAASC,EAAAA,MACTC,EAAOD,MAAI,EAAK,EAClB,IAAAE,EAEE,KAAA,CAAE,SAAAC,GAAaC,EAAAA,YAEfC,EAAqBC,EAAA,SAAS,IAClC,OAAOT,EAAM,WAAc,UAAY,MAAM,OAAOA,EAAM,SAAS,CAAC,EAAI,IAAM,OAAOA,EAAM,SAAS,CAAA,EAGhGU,EAAe,IAAM,CACrB,CAACV,EAAM,MAAM,QAAWA,EAAM,cAAgBM,EAAS,QAE3DD,EAAsB,WAAW,IAAM,CACjCA,GAAqB,aAAaA,CAAmB,EACzDD,EAAK,MAAQ,EAAA,EACZI,EAAmB,KAAK,EAAA,EAGvBG,EAAe,IAAM,CACzBP,EAAK,MAAQ,GACTC,GAAqB,aAAaA,CAAmB,CAAA,EAG3DO,OAAAA,EAAA,MACE,IAAMZ,EAAM,MACPa,GAAA,CACEA,EAAE,SAAQT,EAAK,MAAQ,GAC9B,CAAA,EAEIQ,QAAA,CAAC,IAAMZ,EAAM,aAAc,IAAMA,EAAM,KAAK,EAAQa,GAAA,CACnCA,EAAE,CAAC,IAEtBT,EAAK,MAAQ,GACf,CACD"}
@@ -1,2 +1,2 @@
1
- import{defineComponent as g,ref as s,computed as b,watch as r,openBlock as a,createElementBlock as u,createElementVNode as d,renderSlot as C,createVNode as M,withCtx as c,createBlock as k,toDisplayString as f,createCommentVNode as m}from"vue";import N from"./_CustomTransition.vue.esm2.js";import w,{elClipToAnchorPositions as O}from"./ElClipToAnchor.vue.esm2.js";import{useMobile as B}from"./composable/mobileComposable.esm.js";const E={class:"font-semibold"},x={key:0,class:"mt-1"},S=O,z=g({__name:"ElTooltip",props:{title:{},content:{default:void 0},position:{default:"top"},delayTime:{default:200},hideOnChange:{type:Boolean,default:!1},hideOnMobile:{type:Boolean,default:!1}},setup(p){const t=p,l=s(),o=s(!1);let n;const{isMobile:h}=B(),v=b(()=>typeof t.delayTime=="string"&&isNaN(Number(t.delayTime))?200:Number(t.delayTime)),y=()=>{!t.title.length||t.hideOnMobile&&h.value||(n=setTimeout(()=>{n&&clearTimeout(n),o.value=!0},v.value))},T=()=>{o.value=!1,n&&clearTimeout(n)};return r(()=>t.title,e=>{e.length||(o.value=!1)}),r([()=>t.hideOnChange,()=>t.title],e=>{e[0]&&(o.value=!1)}),(e,_)=>(a(),u("div",null,[d("div",{ref_key:"anchor",ref:l,onMouseenter:y,onMouseleave:T},[C(e.$slots,"default")],544),M(N,{name:"slide-y-fade"},{default:c(()=>[l.value&&o.value?(a(),k(w,{key:0,anchor:l.value,position:e.position,"distance-from-anchor":14,class:"max-w-96 rounded-2xl bg-neutral-100 p-3 text-xs drop-shadow text-neutral-darker"},{default:c(()=>{var i;return[d("p",E,f(e.title),1),(i=e.content)!=null&&i.length?(a(),u("p",x,f(e.content),1)):m("",!0)]}),_:1},8,["anchor","position"])):m("",!0)]),_:1})]))}});export{z as default,S as elTooltipPositions};
1
+ import{defineComponent as N,ref as s,computed as b,watch as r,openBlock as a,createElementBlock as u,createElementVNode as d,renderSlot as C,createVNode as M,withCtx as c,createBlock as k,normalizeClass as f,toDisplayString as m,createCommentVNode as p}from"vue";import B from"./_CustomTransition.vue.esm2.js";import O,{elClipToAnchorPositions as _}from"./ElClipToAnchor.vue.esm2.js";import{useMobile as E}from"./composable/mobileComposable.esm.js";const z=_,P=N({__name:"ElTooltip",props:{title:{},content:{default:void 0},position:{default:"top"},delayTime:{default:200},hideOnChange:{type:Boolean,default:!1},hideOnMobile:{type:Boolean,default:!1},allowNewLines:{type:Boolean,default:!1}},setup(h){const o=h,n=s(),t=s(!1);let l;const{isMobile:v}=E(),w=b(()=>typeof o.delayTime=="string"&&isNaN(Number(o.delayTime))?200:Number(o.delayTime)),y=()=>{!o.title.length||o.hideOnMobile&&v.value||(l=setTimeout(()=>{l&&clearTimeout(l),t.value=!0},w.value))},T=()=>{t.value=!1,l&&clearTimeout(l)};return r(()=>o.title,e=>{e.length||(t.value=!1)}),r([()=>o.hideOnChange,()=>o.title],e=>{e[0]&&(t.value=!1)}),(e,g)=>(a(),u("div",null,[d("div",{ref_key:"anchor",ref:n,onMouseenter:y,onMouseleave:T},[C(e.$slots,"default")],544),M(B,{name:"slide-y-fade"},{default:c(()=>[n.value&&t.value?(a(),k(O,{key:0,anchor:n.value,position:e.position,"distance-from-anchor":14,class:"max-w-96 rounded-2xl bg-neutral-100 p-3 text-xs drop-shadow text-neutral-darker"},{default:c(()=>{var i;return[d("p",{class:f(["font-semibold",{"whitespace-pre-line":e.allowNewLines}])},m(e.title),3),(i=e.content)!=null&&i.length?(a(),u("p",{key:0,class:f(["mt-1",{"whitespace-pre-line":e.allowNewLines}])},m(e.content),3)):p("",!0)]}),_:1},8,["anchor","position"])):p("",!0)]),_:1})]))}});export{P as default,z as elTooltipPositions};
2
2
  //# sourceMappingURL=ElTooltip.vue.esm2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ElTooltip.vue.esm2.js","sources":["../../src/ElTooltip.vue"],"sourcesContent":["<script lang=\"ts\">\nimport ElClipToAnchor, { elClipToAnchorPositions } from '@/ElClipToAnchor.vue';\nimport { useMobile } from '@/composable/mobileComposable';\nexport const elTooltipPositions = elClipToAnchorPositions;\nexport type ElTooltipPosition = (typeof elTooltipPositions)[number];\n</script>\n<script lang=\"ts\" setup>\nimport { computed, ref, watch } from 'vue';\nimport CustomTransition from '@/_CustomTransition.vue';\n\nconst props = withDefaults(\n defineProps<{\n title: string;\n content?: string;\n position?: ElTooltipPosition;\n /** Time in ms before the tooltip appears */\n delayTime?: string | number;\n /** Hide tooltip when tooltip's title changes */\n hideOnChange?: boolean;\n hideOnMobile?: boolean;\n }>(),\n {\n content: undefined,\n position: 'top',\n delayTime: 200,\n hideOnChange: false,\n hideOnMobile: false,\n },\n);\n\nconst anchor = ref<HTMLElement>();\nconst show = ref(false);\nlet showDebounceTimeout: ReturnType<typeof setTimeout> | undefined;\n\nconst { isMobile } = useMobile();\n\nconst sanitizedDelayTime = computed(() =>\n typeof props.delayTime === 'string' && isNaN(Number(props.delayTime)) ? 200 : Number(props.delayTime),\n);\n\nconst onMouseEnter = () => {\n if (!props.title.length || (props.hideOnMobile && isMobile.value)) return;\n\n showDebounceTimeout = setTimeout(() => {\n if (showDebounceTimeout) clearTimeout(showDebounceTimeout);\n show.value = true;\n }, sanitizedDelayTime.value);\n};\n\nconst onMouseLeave = () => {\n show.value = false;\n if (showDebounceTimeout) clearTimeout(showDebounceTimeout);\n};\n\nwatch(\n () => props.title,\n v => {\n if (!v.length) show.value = false;\n },\n);\nwatch([() => props.hideOnChange, () => props.title], v => {\n const hideOnChange = v[0];\n if (hideOnChange) {\n show.value = false;\n }\n});\n</script>\n\n<template>\n <div>\n <div ref=\"anchor\" @mouseenter=\"onMouseEnter\" @mouseleave=\"onMouseLeave\">\n <slot></slot>\n </div>\n <CustomTransition name=\"slide-y-fade\">\n <ElClipToAnchor\n v-if=\"anchor && show\"\n :anchor=\"anchor\"\n :position=\"position\"\n :distance-from-anchor=\"14\"\n class=\"max-w-96 rounded-2xl bg-neutral-100 p-3 text-xs drop-shadow text-neutral-darker\"\n >\n <p class=\"font-semibold\">\n {{ title }}\n </p>\n <p v-if=\"content?.length\" class=\"mt-1\">{{ content }}</p>\n </ElClipToAnchor>\n </CustomTransition>\n </div>\n</template>\n"],"names":["elTooltipPositions","elClipToAnchorPositions","props","__props","anchor","ref","show","showDebounceTimeout","isMobile","useMobile","sanitizedDelayTime","computed","onMouseEnter","onMouseLeave","watch","v"],"mappings":"oeAGaA,EAAqBC,4MAOlC,MAAMC,EAAQC,EAoBRC,EAASC,IACTC,EAAOD,EAAI,EAAK,EAClB,IAAAE,EAEE,KAAA,CAAE,SAAAC,GAAaC,IAEfC,EAAqBC,EAAS,IAClC,OAAOT,EAAM,WAAc,UAAY,MAAM,OAAOA,EAAM,SAAS,CAAC,EAAI,IAAM,OAAOA,EAAM,SAAS,CAAA,EAGhGU,EAAe,IAAM,CACrB,CAACV,EAAM,MAAM,QAAWA,EAAM,cAAgBM,EAAS,QAE3DD,EAAsB,WAAW,IAAM,CACjCA,GAAqB,aAAaA,CAAmB,EACzDD,EAAK,MAAQ,EAAA,EACZI,EAAmB,KAAK,EAAA,EAGvBG,EAAe,IAAM,CACzBP,EAAK,MAAQ,GACTC,GAAqB,aAAaA,CAAmB,CAAA,EAG3D,OAAAO,EACE,IAAMZ,EAAM,MACPa,GAAA,CACEA,EAAE,SAAQT,EAAK,MAAQ,GAC9B,CAAA,EAEIQ,EAAA,CAAC,IAAMZ,EAAM,aAAc,IAAMA,EAAM,KAAK,EAAQa,GAAA,CACnCA,EAAE,CAAC,IAEtBT,EAAK,MAAQ,GACf,CACD"}
1
+ {"version":3,"file":"ElTooltip.vue.esm2.js","sources":["../../src/ElTooltip.vue"],"sourcesContent":["<script lang=\"ts\">\nimport ElClipToAnchor, { elClipToAnchorPositions } from '@/ElClipToAnchor.vue';\nimport { useMobile } from '@/composable/mobileComposable';\nexport const elTooltipPositions = elClipToAnchorPositions;\nexport type ElTooltipPosition = (typeof elTooltipPositions)[number];\n</script>\n<script lang=\"ts\" setup>\nimport { computed, ref, watch } from 'vue';\nimport CustomTransition from '@/_CustomTransition.vue';\n\nconst props = withDefaults(\n defineProps<{\n title: string;\n content?: string;\n position?: ElTooltipPosition;\n /** Time in ms before the tooltip appears */\n delayTime?: string | number;\n /** Hide tooltip when tooltip's title changes */\n hideOnChange?: boolean;\n hideOnMobile?: boolean;\n allowNewLines?: boolean;\n }>(),\n {\n content: undefined,\n position: 'top',\n delayTime: 200,\n hideOnChange: false,\n hideOnMobile: false,\n allowNewLines: false,\n },\n);\n\nconst anchor = ref<HTMLElement>();\nconst show = ref(false);\nlet showDebounceTimeout: ReturnType<typeof setTimeout> | undefined;\n\nconst { isMobile } = useMobile();\n\nconst sanitizedDelayTime = computed(() =>\n typeof props.delayTime === 'string' && isNaN(Number(props.delayTime)) ? 200 : Number(props.delayTime),\n);\n\nconst onMouseEnter = () => {\n if (!props.title.length || (props.hideOnMobile && isMobile.value)) return;\n\n showDebounceTimeout = setTimeout(() => {\n if (showDebounceTimeout) clearTimeout(showDebounceTimeout);\n show.value = true;\n }, sanitizedDelayTime.value);\n};\n\nconst onMouseLeave = () => {\n show.value = false;\n if (showDebounceTimeout) clearTimeout(showDebounceTimeout);\n};\n\nwatch(\n () => props.title,\n v => {\n if (!v.length) show.value = false;\n },\n);\nwatch([() => props.hideOnChange, () => props.title], v => {\n const hideOnChange = v[0];\n if (hideOnChange) {\n show.value = false;\n }\n});\n</script>\n\n<template>\n <div>\n <div ref=\"anchor\" @mouseenter=\"onMouseEnter\" @mouseleave=\"onMouseLeave\">\n <slot></slot>\n </div>\n <CustomTransition name=\"slide-y-fade\">\n <ElClipToAnchor\n v-if=\"anchor && show\"\n :anchor=\"anchor\"\n :position=\"position\"\n :distance-from-anchor=\"14\"\n class=\"max-w-96 rounded-2xl bg-neutral-100 p-3 text-xs drop-shadow text-neutral-darker\"\n >\n <p class=\"font-semibold\" :class=\"{ 'whitespace-pre-line': allowNewLines }\">\n {{ title }}\n </p>\n <p v-if=\"content?.length\" class=\"mt-1\" :class=\"{ 'whitespace-pre-line': allowNewLines }\">{{ content }}</p>\n </ElClipToAnchor>\n </CustomTransition>\n </div>\n</template>\n"],"names":["elTooltipPositions","elClipToAnchorPositions","props","__props","anchor","ref","show","showDebounceTimeout","isMobile","useMobile","sanitizedDelayTime","computed","onMouseEnter","onMouseLeave","watch","v"],"mappings":"icAGO,MAAMA,EAAqBC,oPAOlC,MAAMC,EAAQC,EAsBRC,EAASC,IACTC,EAAOD,EAAI,EAAK,EAClB,IAAAE,EAEE,KAAA,CAAE,SAAAC,GAAaC,IAEfC,EAAqBC,EAAS,IAClC,OAAOT,EAAM,WAAc,UAAY,MAAM,OAAOA,EAAM,SAAS,CAAC,EAAI,IAAM,OAAOA,EAAM,SAAS,CAAA,EAGhGU,EAAe,IAAM,CACrB,CAACV,EAAM,MAAM,QAAWA,EAAM,cAAgBM,EAAS,QAE3DD,EAAsB,WAAW,IAAM,CACjCA,GAAqB,aAAaA,CAAmB,EACzDD,EAAK,MAAQ,EAAA,EACZI,EAAmB,KAAK,EAAA,EAGvBG,EAAe,IAAM,CACzBP,EAAK,MAAQ,GACTC,GAAqB,aAAaA,CAAmB,CAAA,EAG3D,OAAAO,EACE,IAAMZ,EAAM,MACPa,GAAA,CACEA,EAAE,SAAQT,EAAK,MAAQ,GAC9B,CAAA,EAEIQ,EAAA,CAAC,IAAMZ,EAAM,aAAc,IAAMA,EAAM,KAAK,EAAQa,GAAA,CACnCA,EAAE,CAAC,IAEtBT,EAAK,MAAQ,GACf,CACD"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("./ElInputContainer.vue.cjs2.js"),d=require("./input.cjs.js"),n=require("../../node_modules/luxon/src/datetime.cjs.js");require("../../node_modules/luxon/src/duration.cjs.js");const V=["id","name","type","placeholder","disabled","data-cy"],q=["date","datetime-local","time","month"],D=e.defineComponent({__name:"ElInputDate",props:{...d.withNumberElInputProps(),type:{type:String,default:"date"}},emits:["update:modelValue","update:readableString"],setup(s,{emit:y}){const t=s,i=y,l=t.modelValue?n.default.fromSeconds(t.modelValue):void 0,m=e.computed(()=>{switch(t.type){case"date":return"yyyy-MM-dd";case"time":return"HH:mm";case"datetime-local":return"yyyy-MM-dd'T'HH:mm";default:return""}}),f=e.computed(()=>t.modelValue),v=e.computed(()=>[t.validation]),{value:u,errorMessage:g,uuid:p,fieldContext:b}=d.useInput(f,v,t.name,a=>{i("update:modelValue",a),i("update:readableString",o.value)}),o=e.computed({get:()=>u.value?n.default.fromSeconds(u.value).toFormat(m.value):"",set:a=>{if(a){let r=n.default.fromFormat(a,m.value);t.type==="time"&&l&&(r=r.set({day:l.day,month:l.month,year:l.year})),u.value=Math.round(r.toSeconds())}else u.value=void 0}});return(a,r)=>(e.openBlock(),e.createBlock(h.default,e.mergeProps(a.$attrs,{name:e.unref(p),label:a.label,"error-message":t.errorMessage===!1?!1:t.errorMessage||e.unref(g),"hidden-error-message":a.hiddenErrorMessage,"set-required-mark":e.unref(d.showRequiredMark)([a.validation])}),{default:e.withCtx(({error:M})=>[e.withDirectives(e.createElementVNode("input",{id:e.unref(p),"onUpdate:modelValue":r[0]||(r[0]=c=>o.value=c),name:t.name,type:s.type,class:e.normalizeClass(["el-input",{error:M,"text-neutral-darker border-primary":o.value!==""}]),placeholder:a.placeholder,disabled:t.disabled,"data-cy":`${a.label.trim().replaceAll(" ","")}-input`,max:"9999-12-31",onBlur:r[1]||(r[1]=c=>e.unref(b).validate())},null,42,V),[[e.vModelDynamic,o.value]])]),_:1},16,["name","label","error-message","hidden-error-message","set-required-mark"]))}});exports.default=D;exports.elInputDateTypes=q;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("./ElInputContainer.vue.cjs2.js"),n=require("./input.cjs.js"),d=require("../../node_modules/luxon/src/datetime.cjs.js");require("../../node_modules/luxon/src/duration.cjs.js");const q=["id","name","type","placeholder","disabled","data-cy"],V=["date","datetime-local","time","month"],z=e.defineComponent({__name:"ElInputDate",props:{...n.withNumberElInputProps(),type:{type:String,default:"date"},zone:{type:String,default:void 0,required:!1}},emits:["update:modelValue","update:readableString"],setup(s,{emit:y}){const t=s,i=y,l=t.modelValue?d.default.fromSeconds(t.modelValue,{zone:t.zone}):void 0,m=e.computed(()=>{switch(t.type){case"date":return"yyyy-MM-dd";case"time":return"HH:mm";case"datetime-local":return"yyyy-MM-dd'T'HH:mm";default:return""}}),f=e.computed(()=>t.modelValue),v=e.computed(()=>[t.validation]),{value:o,errorMessage:g,uuid:p,fieldContext:b}=n.useInput(f,v,t.name,a=>{i("update:modelValue",a),i("update:readableString",u.value)}),u=e.computed({get:()=>o.value?d.default.fromSeconds(o.value,{zone:t.zone}).toFormat(m.value):"",set:a=>{if(a){let r=d.default.fromFormat(a,m.value,{zone:t.zone});t.type==="time"&&l&&(r=r.set({day:l.day,month:l.month,year:l.year})),o.value=Math.round(r.toSeconds())}else o.value=void 0}});return(a,r)=>(e.openBlock(),e.createBlock(h.default,e.mergeProps(a.$attrs,{name:e.unref(p),label:a.label,"error-message":t.errorMessage===!1?!1:t.errorMessage||e.unref(g),"hidden-error-message":a.hiddenErrorMessage,"set-required-mark":e.unref(n.showRequiredMark)([a.validation])}),{default:e.withCtx(({error:M})=>[e.withDirectives(e.createElementVNode("input",{id:e.unref(p),"onUpdate:modelValue":r[0]||(r[0]=c=>u.value=c),name:t.name,type:s.type,class:e.normalizeClass(["el-input",{error:M,"text-neutral-darker border-primary":u.value!==""}]),placeholder:a.placeholder,disabled:t.disabled,"data-cy":`${a.label.trim().replaceAll(" ","")}-input`,max:"9999-12-31",onBlur:r[1]||(r[1]=c=>e.unref(b).validate())},null,42,q),[[e.vModelDynamic,u.value]])]),_:1},16,["name","label","error-message","hidden-error-message","set-required-mark"]))}});exports.default=z;exports.elInputDateTypes=V;
2
2
  //# sourceMappingURL=ElInputDate.vue.cjs2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ElInputDate.vue.cjs2.js","sources":["../../../src/forms/ElInputDate.vue"],"sourcesContent":["<script lang=\"ts\">\nexport const elInputDateTypes = ['date', 'datetime-local', 'time', 'month'] as const;\nexport type ElInputDateType = (typeof elInputDateTypes)[number];\n</script>\n\n<script lang=\"ts\" setup>\nimport { computed, PropType } from 'vue';\nimport ElInputContainer from '@/forms/ElInputContainer.vue';\nimport { useInput, NumberValueType, showRequiredMark, withNumberElInputProps } from '@/forms/input';\nimport { DateTime } from 'luxon';\n\nconst props = defineProps({\n ...withNumberElInputProps(),\n type: {\n type: String as PropType<ElInputDateType>,\n default: 'date',\n },\n});\n\nconst emit = defineEmits<{\n (event: 'update:modelValue', value: NumberValueType): void;\n (event: 'update:readableString', value: string): void;\n}>();\n\nconst initialDate = props.modelValue ? DateTime.fromSeconds(props.modelValue) : undefined;\n\nconst dateFormat = computed(() => {\n switch (props.type) {\n case 'date':\n return 'yyyy-MM-dd';\n case 'time':\n return 'HH:mm';\n case 'datetime-local':\n // eslint-disable-next-line quotes\n return `yyyy-MM-dd'T'HH:mm`;\n default:\n return '';\n }\n});\n\nconst computedModelValue = computed(() => props.modelValue);\nconst computedValidation = computed(() => [props.validation]);\n\nconst { value, errorMessage, uuid, fieldContext } = useInput(computedModelValue, computedValidation, props.name, newValue => {\n emit('update:modelValue', newValue);\n emit('update:readableString', valueToNumber.value);\n});\n\n// this is needed to have vee-validate only work on number values, this way we don't have to deal with date format, but only timestamps\nconst valueToNumber = computed<string>({\n get: () => {\n if (!value.value) return '';\n return DateTime.fromSeconds(value.value).toFormat(dateFormat.value);\n },\n set: (valueAsString: string) => {\n if (valueAsString) {\n let newDate = DateTime.fromFormat(valueAsString, dateFormat.value);\n if (props.type === 'time' && initialDate) {\n // when parsing from time, it loses reference of the actual date. Set it manually\n newDate = newDate.set({ day: initialDate.day, month: initialDate.month, year: initialDate.year });\n }\n value.value = Math.round(newDate.toSeconds());\n } else {\n value.value = undefined;\n }\n },\n});\n</script>\n\n<template>\n <ElInputContainer\n v-bind=\"$attrs\"\n :name=\"uuid\"\n :label=\"label\"\n :error-message=\"props.errorMessage === false ? false : props.errorMessage || errorMessage\"\n :hidden-error-message=\"hiddenErrorMessage\"\n :set-required-mark=\"showRequiredMark([validation])\"\n >\n <template #default=\"{ error }\">\n <input\n :id=\"uuid\"\n v-model=\"valueToNumber\"\n :name=\"props.name\"\n :type=\"type\"\n class=\"el-input\"\n :class=\"{\n error: error,\n 'text-neutral-darker border-primary': valueToNumber !== '',\n }\"\n :placeholder=\"placeholder\"\n :disabled=\"props.disabled\"\n :data-cy=\"`${label.trim().replaceAll(' ', '')}-input`\"\n max=\"9999-12-31\"\n @blur=\"fieldContext.validate()\"\n />\n </template>\n </ElInputContainer>\n</template>\n"],"names":["elInputDateTypes","props","__props","emit","__emit","initialDate","DateTime","dateFormat","computed","computedModelValue","computedValidation","value","errorMessage","uuid","fieldContext","useInput","newValue","valueToNumber","valueAsString","newDate"],"mappings":"6XACaA,EAAmB,CAAC,OAAQ,iBAAkB,OAAQ,OAAO,0LAU1E,MAAMC,EAAQC,EAQRC,EAAOC,EAKPC,EAAcJ,EAAM,WAAaK,UAAS,YAAYL,EAAM,UAAU,EAAI,OAE1EM,EAAaC,EAAAA,SAAS,IAAM,CAChC,OAAQP,EAAM,KAAM,CAClB,IAAK,OACI,MAAA,aACT,IAAK,OACI,MAAA,QACT,IAAK,iBAEI,MAAA,qBACT,QACS,MAAA,EACX,CAAA,CACD,EAEKQ,EAAqBD,EAAA,SAAS,IAAMP,EAAM,UAAU,EACpDS,EAAqBF,EAAAA,SAAS,IAAM,CAACP,EAAM,UAAU,CAAC,EAEtD,CAAE,MAAAU,EAAO,aAAAC,EAAc,KAAAC,EAAM,aAAAC,CAAiB,EAAAC,WAASN,EAAoBC,EAAoBT,EAAM,KAAkBe,GAAA,CAC3Hb,EAAK,oBAAqBa,CAAQ,EAC7Bb,EAAA,wBAAyBc,EAAc,KAAK,CAAA,CAClD,EAGKA,EAAgBT,EAAAA,SAAiB,CACrC,IAAK,IACEG,EAAM,MACJL,UAAS,YAAYK,EAAM,KAAK,EAAE,SAASJ,EAAW,KAAK,EADzC,GAG3B,IAAMW,GAA0B,CAC9B,GAAIA,EAAe,CACjB,IAAIC,EAAUb,EAAAA,QAAS,WAAWY,EAAeX,EAAW,KAAK,EAC7DN,EAAM,OAAS,QAAUI,IAE3Bc,EAAUA,EAAQ,IAAI,CAAE,IAAKd,EAAY,IAAK,MAAOA,EAAY,MAAO,KAAMA,EAAY,IAAM,CAAA,GAElGM,EAAM,MAAQ,KAAK,MAAMQ,EAAQ,WAAW,CAAA,MAE5CR,EAAM,MAAQ,MAElB,CAAA,CACD"}
1
+ {"version":3,"file":"ElInputDate.vue.cjs2.js","sources":["../../../src/forms/ElInputDate.vue"],"sourcesContent":["<script lang=\"ts\">\nexport const elInputDateTypes = ['date', 'datetime-local', 'time', 'month'] as const;\nexport type ElInputDateType = (typeof elInputDateTypes)[number];\n</script>\n\n<script lang=\"ts\" setup>\nimport { computed, PropType } from 'vue';\nimport ElInputContainer from '@/forms/ElInputContainer.vue';\nimport { useInput, NumberValueType, showRequiredMark, withNumberElInputProps } from '@/forms/input';\nimport { DateTime } from 'luxon';\n\nconst props = defineProps({\n ...withNumberElInputProps(),\n type: {\n type: String as PropType<ElInputDateType>,\n default: 'date',\n },\n zone: {\n type: String,\n default: undefined,\n required: false,\n },\n});\n\nconst emit = defineEmits<{\n (event: 'update:modelValue', value: NumberValueType): void;\n (event: 'update:readableString', value: string): void;\n}>();\n\nconst initialDate = props.modelValue ? DateTime.fromSeconds(props.modelValue, { zone: props.zone }) : undefined;\n\nconst dateFormat = computed(() => {\n switch (props.type) {\n case 'date':\n return 'yyyy-MM-dd';\n case 'time':\n return 'HH:mm';\n case 'datetime-local':\n // eslint-disable-next-line quotes\n return `yyyy-MM-dd'T'HH:mm`;\n default:\n return '';\n }\n});\n\nconst computedModelValue = computed(() => props.modelValue);\nconst computedValidation = computed(() => [props.validation]);\n\nconst { value, errorMessage, uuid, fieldContext } = useInput(computedModelValue, computedValidation, props.name, newValue => {\n emit('update:modelValue', newValue);\n emit('update:readableString', valueToNumber.value);\n});\n\n// this is needed to have vee-validate only work on number values, this way we don't have to deal with date format, but only timestamps\nconst valueToNumber = computed<string>({\n get: () => {\n if (!value.value) return '';\n return DateTime.fromSeconds(value.value, { zone: props.zone }).toFormat(dateFormat.value);\n },\n set: (valueAsString: string) => {\n if (valueAsString) {\n let newDate = DateTime.fromFormat(valueAsString, dateFormat.value, { zone: props.zone });\n if (props.type === 'time' && initialDate) {\n // when parsing from time, it loses reference of the actual date. Set it manually\n newDate = newDate.set({ day: initialDate.day, month: initialDate.month, year: initialDate.year });\n }\n value.value = Math.round(newDate.toSeconds());\n } else {\n value.value = undefined;\n }\n },\n});\n</script>\n\n<template>\n <ElInputContainer\n v-bind=\"$attrs\"\n :name=\"uuid\"\n :label=\"label\"\n :error-message=\"props.errorMessage === false ? false : props.errorMessage || errorMessage\"\n :hidden-error-message=\"hiddenErrorMessage\"\n :set-required-mark=\"showRequiredMark([validation])\"\n >\n <template #default=\"{ error }\">\n <input\n :id=\"uuid\"\n v-model=\"valueToNumber\"\n :name=\"props.name\"\n :type=\"type\"\n class=\"el-input\"\n :class=\"{\n error: error,\n 'text-neutral-darker border-primary': valueToNumber !== '',\n }\"\n :placeholder=\"placeholder\"\n :disabled=\"props.disabled\"\n :data-cy=\"`${label.trim().replaceAll(' ', '')}-input`\"\n max=\"9999-12-31\"\n @blur=\"fieldContext.validate()\"\n />\n </template>\n </ElInputContainer>\n</template>\n"],"names":["elInputDateTypes","props","__props","emit","__emit","initialDate","DateTime","dateFormat","computed","computedModelValue","computedValidation","value","errorMessage","uuid","fieldContext","useInput","newValue","valueToNumber","valueAsString","newDate"],"mappings":"6XACaA,EAAmB,CAAC,OAAQ,iBAAkB,OAAQ,OAAO,wOAU1E,MAAMC,EAAQC,EAaRC,EAAOC,EAKPC,EAAcJ,EAAM,WAAaK,EAAA,QAAS,YAAYL,EAAM,WAAY,CAAE,KAAMA,EAAM,IAAK,CAAC,EAAI,OAEhGM,EAAaC,EAAAA,SAAS,IAAM,CAChC,OAAQP,EAAM,KAAM,CAClB,IAAK,OACI,MAAA,aACT,IAAK,OACI,MAAA,QACT,IAAK,iBAEI,MAAA,qBACT,QACS,MAAA,EACX,CAAA,CACD,EAEKQ,EAAqBD,EAAA,SAAS,IAAMP,EAAM,UAAU,EACpDS,EAAqBF,EAAAA,SAAS,IAAM,CAACP,EAAM,UAAU,CAAC,EAEtD,CAAE,MAAAU,EAAO,aAAAC,EAAc,KAAAC,EAAM,aAAAC,CAAiB,EAAAC,WAASN,EAAoBC,EAAoBT,EAAM,KAAkBe,GAAA,CAC3Hb,EAAK,oBAAqBa,CAAQ,EAC7Bb,EAAA,wBAAyBc,EAAc,KAAK,CAAA,CAClD,EAGKA,EAAgBT,EAAAA,SAAiB,CACrC,IAAK,IACEG,EAAM,MACJL,EAAS,QAAA,YAAYK,EAAM,MAAO,CAAE,KAAMV,EAAM,IAAM,CAAA,EAAE,SAASM,EAAW,KAAK,EAD/D,GAG3B,IAAMW,GAA0B,CAC9B,GAAIA,EAAe,CACb,IAAAC,EAAUb,EAAAA,QAAS,WAAWY,EAAeX,EAAW,MAAO,CAAE,KAAMN,EAAM,IAAM,CAAA,EACnFA,EAAM,OAAS,QAAUI,IAE3Bc,EAAUA,EAAQ,IAAI,CAAE,IAAKd,EAAY,IAAK,MAAOA,EAAY,MAAO,KAAMA,EAAY,IAAM,CAAA,GAElGM,EAAM,MAAQ,KAAK,MAAMQ,EAAQ,WAAW,CAAA,MAE5CR,EAAM,MAAQ,MAElB,CAAA,CACD"}
@@ -1,2 +1,2 @@
1
- import{defineComponent as M,computed as n,openBlock as V,createBlock as D,mergeProps as k,unref as r,withCtx as w,withDirectives as S,createElementVNode as C,normalizeClass as E,vModelDynamic as H}from"vue";import I from"./ElInputContainer.vue.esm2.js";import{withNumberElInputProps as T,useInput as $,showRequiredMark as q}from"./input.esm.js";import m from"../../node_modules/luxon/src/datetime.esm.js";import"../../node_modules/luxon/src/duration.esm.js";const B=["id","name","type","placeholder","disabled","data-cy"],U=["date","datetime-local","time","month"],j=M({__name:"ElInputDate",props:{...T(),type:{type:String,default:"date"}},emits:["update:modelValue","update:readableString"],setup(i,{emit:y}){const e=i,s=y,o=e.modelValue?m.fromSeconds(e.modelValue):void 0,u=n(()=>{switch(e.type){case"date":return"yyyy-MM-dd";case"time":return"HH:mm";case"datetime-local":return"yyyy-MM-dd'T'HH:mm";default:return""}}),f=n(()=>e.modelValue),v=n(()=>[e.validation]),{value:l,errorMessage:h,uuid:p,fieldContext:b}=$(f,v,e.name,a=>{s("update:modelValue",a),s("update:readableString",d.value)}),d=n({get:()=>l.value?m.fromSeconds(l.value).toFormat(u.value):"",set:a=>{if(a){let t=m.fromFormat(a,u.value);e.type==="time"&&o&&(t=t.set({day:o.day,month:o.month,year:o.year})),l.value=Math.round(t.toSeconds())}else l.value=void 0}});return(a,t)=>(V(),D(I,k(a.$attrs,{name:r(p),label:a.label,"error-message":e.errorMessage===!1?!1:e.errorMessage||r(h),"hidden-error-message":a.hiddenErrorMessage,"set-required-mark":r(q)([a.validation])}),{default:w(({error:g})=>[S(C("input",{id:r(p),"onUpdate:modelValue":t[0]||(t[0]=c=>d.value=c),name:e.name,type:i.type,class:E(["el-input",{error:g,"text-neutral-darker border-primary":d.value!==""}]),placeholder:a.placeholder,disabled:e.disabled,"data-cy":`${a.label.trim().replaceAll(" ","")}-input`,max:"9999-12-31",onBlur:t[1]||(t[1]=c=>r(b).validate())},null,42,B),[[H,d.value]])]),_:1},16,["name","label","error-message","hidden-error-message","set-required-mark"]))}});export{j as default,U as elInputDateTypes};
1
+ import{defineComponent as M,computed as n,openBlock as V,createBlock as z,mergeProps as D,unref as r,withCtx as k,withDirectives as w,createElementVNode as S,normalizeClass as q,vModelDynamic as C}from"vue";import E from"./ElInputContainer.vue.esm2.js";import{withNumberElInputProps as H,useInput as I,showRequiredMark as T}from"./input.esm.js";import m from"../../node_modules/luxon/src/datetime.esm.js";import"../../node_modules/luxon/src/duration.esm.js";const $=["id","name","type","placeholder","disabled","data-cy"],U=["date","datetime-local","time","month"],j=M({__name:"ElInputDate",props:{...H(),type:{type:String,default:"date"},zone:{type:String,default:void 0,required:!1}},emits:["update:modelValue","update:readableString"],setup(i,{emit:y}){const e=i,s=y,o=e.modelValue?m.fromSeconds(e.modelValue,{zone:e.zone}):void 0,u=n(()=>{switch(e.type){case"date":return"yyyy-MM-dd";case"time":return"HH:mm";case"datetime-local":return"yyyy-MM-dd'T'HH:mm";default:return""}}),f=n(()=>e.modelValue),v=n(()=>[e.validation]),{value:l,errorMessage:g,uuid:p,fieldContext:h}=I(f,v,e.name,t=>{s("update:modelValue",t),s("update:readableString",d.value)}),d=n({get:()=>l.value?m.fromSeconds(l.value,{zone:e.zone}).toFormat(u.value):"",set:t=>{if(t){let a=m.fromFormat(t,u.value,{zone:e.zone});e.type==="time"&&o&&(a=a.set({day:o.day,month:o.month,year:o.year})),l.value=Math.round(a.toSeconds())}else l.value=void 0}});return(t,a)=>(V(),z(E,D(t.$attrs,{name:r(p),label:t.label,"error-message":e.errorMessage===!1?!1:e.errorMessage||r(g),"hidden-error-message":t.hiddenErrorMessage,"set-required-mark":r(T)([t.validation])}),{default:k(({error:b})=>[w(S("input",{id:r(p),"onUpdate:modelValue":a[0]||(a[0]=c=>d.value=c),name:e.name,type:i.type,class:q(["el-input",{error:b,"text-neutral-darker border-primary":d.value!==""}]),placeholder:t.placeholder,disabled:e.disabled,"data-cy":`${t.label.trim().replaceAll(" ","")}-input`,max:"9999-12-31",onBlur:a[1]||(a[1]=c=>r(h).validate())},null,42,$),[[C,d.value]])]),_:1},16,["name","label","error-message","hidden-error-message","set-required-mark"]))}});export{j as default,U as elInputDateTypes};
2
2
  //# sourceMappingURL=ElInputDate.vue.esm2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ElInputDate.vue.esm2.js","sources":["../../../src/forms/ElInputDate.vue"],"sourcesContent":["<script lang=\"ts\">\nexport const elInputDateTypes = ['date', 'datetime-local', 'time', 'month'] as const;\nexport type ElInputDateType = (typeof elInputDateTypes)[number];\n</script>\n\n<script lang=\"ts\" setup>\nimport { computed, PropType } from 'vue';\nimport ElInputContainer from '@/forms/ElInputContainer.vue';\nimport { useInput, NumberValueType, showRequiredMark, withNumberElInputProps } from '@/forms/input';\nimport { DateTime } from 'luxon';\n\nconst props = defineProps({\n ...withNumberElInputProps(),\n type: {\n type: String as PropType<ElInputDateType>,\n default: 'date',\n },\n});\n\nconst emit = defineEmits<{\n (event: 'update:modelValue', value: NumberValueType): void;\n (event: 'update:readableString', value: string): void;\n}>();\n\nconst initialDate = props.modelValue ? DateTime.fromSeconds(props.modelValue) : undefined;\n\nconst dateFormat = computed(() => {\n switch (props.type) {\n case 'date':\n return 'yyyy-MM-dd';\n case 'time':\n return 'HH:mm';\n case 'datetime-local':\n // eslint-disable-next-line quotes\n return `yyyy-MM-dd'T'HH:mm`;\n default:\n return '';\n }\n});\n\nconst computedModelValue = computed(() => props.modelValue);\nconst computedValidation = computed(() => [props.validation]);\n\nconst { value, errorMessage, uuid, fieldContext } = useInput(computedModelValue, computedValidation, props.name, newValue => {\n emit('update:modelValue', newValue);\n emit('update:readableString', valueToNumber.value);\n});\n\n// this is needed to have vee-validate only work on number values, this way we don't have to deal with date format, but only timestamps\nconst valueToNumber = computed<string>({\n get: () => {\n if (!value.value) return '';\n return DateTime.fromSeconds(value.value).toFormat(dateFormat.value);\n },\n set: (valueAsString: string) => {\n if (valueAsString) {\n let newDate = DateTime.fromFormat(valueAsString, dateFormat.value);\n if (props.type === 'time' && initialDate) {\n // when parsing from time, it loses reference of the actual date. Set it manually\n newDate = newDate.set({ day: initialDate.day, month: initialDate.month, year: initialDate.year });\n }\n value.value = Math.round(newDate.toSeconds());\n } else {\n value.value = undefined;\n }\n },\n});\n</script>\n\n<template>\n <ElInputContainer\n v-bind=\"$attrs\"\n :name=\"uuid\"\n :label=\"label\"\n :error-message=\"props.errorMessage === false ? false : props.errorMessage || errorMessage\"\n :hidden-error-message=\"hiddenErrorMessage\"\n :set-required-mark=\"showRequiredMark([validation])\"\n >\n <template #default=\"{ error }\">\n <input\n :id=\"uuid\"\n v-model=\"valueToNumber\"\n :name=\"props.name\"\n :type=\"type\"\n class=\"el-input\"\n :class=\"{\n error: error,\n 'text-neutral-darker border-primary': valueToNumber !== '',\n }\"\n :placeholder=\"placeholder\"\n :disabled=\"props.disabled\"\n :data-cy=\"`${label.trim().replaceAll(' ', '')}-input`\"\n max=\"9999-12-31\"\n @blur=\"fieldContext.validate()\"\n />\n </template>\n </ElInputContainer>\n</template>\n"],"names":["elInputDateTypes","props","__props","emit","__emit","initialDate","DateTime","dateFormat","computed","computedModelValue","computedValidation","value","errorMessage","uuid","fieldContext","useInput","newValue","valueToNumber","valueAsString","newDate"],"mappings":"0gBACaA,EAAmB,CAAC,OAAQ,iBAAkB,OAAQ,OAAO,mJAU1E,MAAMC,EAAQC,EAQRC,EAAOC,EAKPC,EAAcJ,EAAM,WAAaK,EAAS,YAAYL,EAAM,UAAU,EAAI,OAE1EM,EAAaC,EAAS,IAAM,CAChC,OAAQP,EAAM,KAAM,CAClB,IAAK,OACI,MAAA,aACT,IAAK,OACI,MAAA,QACT,IAAK,iBAEI,MAAA,qBACT,QACS,MAAA,EACX,CAAA,CACD,EAEKQ,EAAqBD,EAAS,IAAMP,EAAM,UAAU,EACpDS,EAAqBF,EAAS,IAAM,CAACP,EAAM,UAAU,CAAC,EAEtD,CAAE,MAAAU,EAAO,aAAAC,EAAc,KAAAC,EAAM,aAAAC,CAAiB,EAAAC,EAASN,EAAoBC,EAAoBT,EAAM,KAAkBe,GAAA,CAC3Hb,EAAK,oBAAqBa,CAAQ,EAC7Bb,EAAA,wBAAyBc,EAAc,KAAK,CAAA,CAClD,EAGKA,EAAgBT,EAAiB,CACrC,IAAK,IACEG,EAAM,MACJL,EAAS,YAAYK,EAAM,KAAK,EAAE,SAASJ,EAAW,KAAK,EADzC,GAG3B,IAAMW,GAA0B,CAC9B,GAAIA,EAAe,CACjB,IAAIC,EAAUb,EAAS,WAAWY,EAAeX,EAAW,KAAK,EAC7DN,EAAM,OAAS,QAAUI,IAE3Bc,EAAUA,EAAQ,IAAI,CAAE,IAAKd,EAAY,IAAK,MAAOA,EAAY,MAAO,KAAMA,EAAY,IAAM,CAAA,GAElGM,EAAM,MAAQ,KAAK,MAAMQ,EAAQ,WAAW,CAAA,MAE5CR,EAAM,MAAQ,MAElB,CAAA,CACD"}
1
+ {"version":3,"file":"ElInputDate.vue.esm2.js","sources":["../../../src/forms/ElInputDate.vue"],"sourcesContent":["<script lang=\"ts\">\nexport const elInputDateTypes = ['date', 'datetime-local', 'time', 'month'] as const;\nexport type ElInputDateType = (typeof elInputDateTypes)[number];\n</script>\n\n<script lang=\"ts\" setup>\nimport { computed, PropType } from 'vue';\nimport ElInputContainer from '@/forms/ElInputContainer.vue';\nimport { useInput, NumberValueType, showRequiredMark, withNumberElInputProps } from '@/forms/input';\nimport { DateTime } from 'luxon';\n\nconst props = defineProps({\n ...withNumberElInputProps(),\n type: {\n type: String as PropType<ElInputDateType>,\n default: 'date',\n },\n zone: {\n type: String,\n default: undefined,\n required: false,\n },\n});\n\nconst emit = defineEmits<{\n (event: 'update:modelValue', value: NumberValueType): void;\n (event: 'update:readableString', value: string): void;\n}>();\n\nconst initialDate = props.modelValue ? DateTime.fromSeconds(props.modelValue, { zone: props.zone }) : undefined;\n\nconst dateFormat = computed(() => {\n switch (props.type) {\n case 'date':\n return 'yyyy-MM-dd';\n case 'time':\n return 'HH:mm';\n case 'datetime-local':\n // eslint-disable-next-line quotes\n return `yyyy-MM-dd'T'HH:mm`;\n default:\n return '';\n }\n});\n\nconst computedModelValue = computed(() => props.modelValue);\nconst computedValidation = computed(() => [props.validation]);\n\nconst { value, errorMessage, uuid, fieldContext } = useInput(computedModelValue, computedValidation, props.name, newValue => {\n emit('update:modelValue', newValue);\n emit('update:readableString', valueToNumber.value);\n});\n\n// this is needed to have vee-validate only work on number values, this way we don't have to deal with date format, but only timestamps\nconst valueToNumber = computed<string>({\n get: () => {\n if (!value.value) return '';\n return DateTime.fromSeconds(value.value, { zone: props.zone }).toFormat(dateFormat.value);\n },\n set: (valueAsString: string) => {\n if (valueAsString) {\n let newDate = DateTime.fromFormat(valueAsString, dateFormat.value, { zone: props.zone });\n if (props.type === 'time' && initialDate) {\n // when parsing from time, it loses reference of the actual date. Set it manually\n newDate = newDate.set({ day: initialDate.day, month: initialDate.month, year: initialDate.year });\n }\n value.value = Math.round(newDate.toSeconds());\n } else {\n value.value = undefined;\n }\n },\n});\n</script>\n\n<template>\n <ElInputContainer\n v-bind=\"$attrs\"\n :name=\"uuid\"\n :label=\"label\"\n :error-message=\"props.errorMessage === false ? false : props.errorMessage || errorMessage\"\n :hidden-error-message=\"hiddenErrorMessage\"\n :set-required-mark=\"showRequiredMark([validation])\"\n >\n <template #default=\"{ error }\">\n <input\n :id=\"uuid\"\n v-model=\"valueToNumber\"\n :name=\"props.name\"\n :type=\"type\"\n class=\"el-input\"\n :class=\"{\n error: error,\n 'text-neutral-darker border-primary': valueToNumber !== '',\n }\"\n :placeholder=\"placeholder\"\n :disabled=\"props.disabled\"\n :data-cy=\"`${label.trim().replaceAll(' ', '')}-input`\"\n max=\"9999-12-31\"\n @blur=\"fieldContext.validate()\"\n />\n </template>\n </ElInputContainer>\n</template>\n"],"names":["elInputDateTypes","props","__props","emit","__emit","initialDate","DateTime","dateFormat","computed","computedModelValue","computedValidation","value","errorMessage","uuid","fieldContext","useInput","newValue","valueToNumber","valueAsString","newDate"],"mappings":"0gBACaA,EAAmB,CAAC,OAAQ,iBAAkB,OAAQ,OAAO,iMAU1E,MAAMC,EAAQC,EAaRC,EAAOC,EAKPC,EAAcJ,EAAM,WAAaK,EAAS,YAAYL,EAAM,WAAY,CAAE,KAAMA,EAAM,IAAK,CAAC,EAAI,OAEhGM,EAAaC,EAAS,IAAM,CAChC,OAAQP,EAAM,KAAM,CAClB,IAAK,OACI,MAAA,aACT,IAAK,OACI,MAAA,QACT,IAAK,iBAEI,MAAA,qBACT,QACS,MAAA,EACX,CAAA,CACD,EAEKQ,EAAqBD,EAAS,IAAMP,EAAM,UAAU,EACpDS,EAAqBF,EAAS,IAAM,CAACP,EAAM,UAAU,CAAC,EAEtD,CAAE,MAAAU,EAAO,aAAAC,EAAc,KAAAC,EAAM,aAAAC,CAAiB,EAAAC,EAASN,EAAoBC,EAAoBT,EAAM,KAAkBe,GAAA,CAC3Hb,EAAK,oBAAqBa,CAAQ,EAC7Bb,EAAA,wBAAyBc,EAAc,KAAK,CAAA,CAClD,EAGKA,EAAgBT,EAAiB,CACrC,IAAK,IACEG,EAAM,MACJL,EAAS,YAAYK,EAAM,MAAO,CAAE,KAAMV,EAAM,IAAM,CAAA,EAAE,SAASM,EAAW,KAAK,EAD/D,GAG3B,IAAMW,GAA0B,CAC9B,GAAIA,EAAe,CACb,IAAAC,EAAUb,EAAS,WAAWY,EAAeX,EAAW,MAAO,CAAE,KAAMN,EAAM,IAAM,CAAA,EACnFA,EAAM,OAAS,QAAUI,IAE3Bc,EAAUA,EAAQ,IAAI,CAAE,IAAKd,EAAY,IAAK,MAAOA,EAAY,MAAO,KAAMA,EAAY,IAAM,CAAA,GAElGM,EAAM,MAAQ,KAAK,MAAMQ,EAAQ,WAAW,CAAA,MAE5CR,EAAM,MAAQ,MAElB,CAAA,CACD"}