@featherk/ui 0.18.0 → 0.18.1
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/README.md +1 -1
- package/dist/chunks/picker.css +1 -1
- package/dist/docs-manifest.mjs +7 -7
- package/dist/picker.cjs +1 -1
- package/dist/picker.cjs.map +1 -1
- package/dist/picker.mjs +146 -164
- package/dist/picker.mjs.map +1 -1
- package/docs/picker/DateRangeField.md +3 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -115,7 +115,7 @@ npm run build
|
|
|
115
115
|
- `package.json` lists only CSS in `sideEffects`, so a root import tree-shakes to the same code and styles as the subpath. Keep other modules free of import-time side effects, or add them to `sideEffects`.
|
|
116
116
|
- Keep shared state out of module scope: no module-level refs, Maps or `provide`/`inject` keys. An app can load both the ES and CommonJS builds, and the two copies don't share state. Create state in the component or composable and pass the instance, as `useActionCellMenu` does.
|
|
117
117
|
- The repo's `scripts/check-entries.mjs` runs at the end of the build. It fails if an export target is missing, an entry imports an undeclared peer, any entry imports an optional peer (npm doesn't install those), or a stylesheet is not imported.
|
|
118
|
-
- The repo's `scripts/check-peers.mjs` runs after it. It fails unless each `@featherk/*` peer range is `>=x.y.z` with a minimum of at least that sibling's current version, so npm never pairs this release with an older sibling that lacks what it imports. Packages release in lockstep, so
|
|
118
|
+
- The repo's `scripts/check-peers.mjs` runs after it. It fails unless each `@featherk/*` peer range is `>=x.y.z` with a minimum of at least that sibling's current version, so npm never pairs this release with an older sibling that lacks what it imports. Packages release in lockstep, so the root `version:patch|minor|major` scripts run `scripts/sync-peers.mjs`, which raises these minimums to the new version in `package.json` and `package-lock.json`.
|
|
119
119
|
- For new component documentation, follow the docs authoring template in `docs/README.md`.
|
|
120
120
|
|
|
121
121
|
## Changelog
|
package/dist/chunks/picker.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.fkui-picker[data-v-9598aad4],.fkui-picker[data-v-
|
|
1
|
+
.fkui-picker[data-v-9598aad4],.fkui-picker[data-v-8b45610e]{display:inline-flex;flex-direction:column;align-items:flex-start}.fkui-range-calendar[data-v-8b45610e]{overscroll-behavior:contain}.fkui-picker[data-v-33cb65f4]{display:inline-flex;flex-direction:column;align-items:flex-start}
|
package/dist/docs-manifest.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Generated by scripts/generate-docs-manifest.mjs. Do not edit.
|
|
2
2
|
export const packageName = "@featherk/ui";
|
|
3
3
|
|
|
4
|
-
export const version = "0.18.
|
|
4
|
+
export const version = "0.18.1";
|
|
5
5
|
|
|
6
6
|
export const paths = {
|
|
7
7
|
ActionCell: "table/ActionCell.md",
|
|
@@ -13,12 +13,12 @@ export const paths = {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export const docs = {
|
|
16
|
-
ActionCell: "https://cdn.jsdelivr.net/npm/@featherk/ui@0.18.
|
|
17
|
-
DateField: "https://cdn.jsdelivr.net/npm/@featherk/ui@0.18.
|
|
18
|
-
DateRangeField: "https://cdn.jsdelivr.net/npm/@featherk/ui@0.18.
|
|
19
|
-
TimeField: "https://cdn.jsdelivr.net/npm/@featherk/ui@0.18.
|
|
20
|
-
USAddress: "https://cdn.jsdelivr.net/npm/@featherk/ui@0.18.
|
|
21
|
-
useActionCellMenu: "https://cdn.jsdelivr.net/npm/@featherk/ui@0.18.
|
|
16
|
+
ActionCell: "https://cdn.jsdelivr.net/npm/@featherk/ui@0.18.1/docs/table/ActionCell.md",
|
|
17
|
+
DateField: "https://cdn.jsdelivr.net/npm/@featherk/ui@0.18.1/docs/picker/DateField.md",
|
|
18
|
+
DateRangeField: "https://cdn.jsdelivr.net/npm/@featherk/ui@0.18.1/docs/picker/DateRangeField.md",
|
|
19
|
+
TimeField: "https://cdn.jsdelivr.net/npm/@featherk/ui@0.18.1/docs/picker/TimeField.md",
|
|
20
|
+
USAddress: "https://cdn.jsdelivr.net/npm/@featherk/ui@0.18.1/docs/address/USAddress.md",
|
|
21
|
+
useActionCellMenu: "https://cdn.jsdelivr.net/npm/@featherk/ui@0.18.1/docs/table/useActionCellMenu.md",
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export const docUrl = (name, host = "https://cdn.jsdelivr.net/npm") =>
|
package/dist/picker.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p=require("@progress/kendo-vue-dateinputs"),g=require("@progress/kendo-vue-inputs"),r=require("@progress/kendo-vue-labels"),b=require("@featherk/composables/trap"),C=require("./chunks/shared-BHFhmbuH.cjs"),V=require("@progress/kendo-vue-common"),M=require("@progress/kendo-vue-popup"),D=require("@progress/kendo-vue-tooltip"),N=require("@featherk/icons"),w=a=>a==="incomplete"?"required":a,T=e.defineComponent({inheritAttrs:!1,__name:"DateField",props:e.mergeModels({input:{},label:{},min:{},max:{},messages:{},disabled:{type:Boolean},readonly:{type:Boolean}},{modelValue:{},modelModifiers:{},show:{type:Boolean,default:!1},showModifiers:{}}),emits:["update:modelValue","update:show"],setup(a){const t=a,u=e.useModel(a,"modelValue"),l=e.useModel(a,"show"),m=e.ref(null),v=e.computed(()=>l.value&&!t.disabled&&!t.readonly),s=e.computed(()=>`${t.input.id}-error`),f=e.computed(()=>`${t.input.id}-hint`),d=e.computed(()=>{const c=t.input.validationMessage.value;if(!c)return"";const n=w(t.input.reason.value);return n&&t.messages?.error?.[n]||c}),k=e.computed(()=>d.value?s.value:t.messages?.hint?f.value:void 0);return b.usePopupTrap({isOpen:v,onRequestClose:()=>l.value=!1,triggerEl:m}),(c,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:m,class:"fk-datepicker fkui-picker"},[a.label?(e.openBlock(),e.createBlock(e.unref(r.Label),{key:0,"editor-id":a.input.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.label),1)]),_:1},8,["editor-id"])):e.createCommentVNode("",!0),e.createVNode(e.unref(p.DatePicker),e.mergeProps({"fill-mode":"outline",rounded:"medium",size:"medium"},c.$attrs,{"model-value":u.value instanceof Date?u.value:void 0,"date-input":"masked",min:a.min??a.input.min??void 0,max:a.max??a.input.max??void 0,valid:a.input.isValid.value,"validation-message":d.value,disabled:a.disabled,show:v.value,"onUpdate:modelValue":n[0]||(n[0]=i=>u.value=i),onOpen:n[1]||(n[1]=i=>l.value=!a.readonly),onClose:n[2]||(n[2]=i=>l.value=!1)}),{masked:e.withCtx(()=>[e.createVNode(e.unref(g.MaskedTextBox),{id:a.input.id,mask:"00/00/0000",value:a.input.raw.value,placeholder:a.messages?.placeholder??a.input.placeholder.value,"show-clear-button":!1,disabled:a.disabled,readonly:a.readonly,"aria-described-by":k.value,"input-attributes":{"aria-invalid":!a.input.isValid.value},onChange:a.input.handleChange,onKeydown:a.input.handleKeyDown,onKeyup:a.input.handleKeyUp,onClick:a.input.handleClick,onWheel:a.input.handleWheel,onBlur:a.input.handleBlur},null,8,["id","value","placeholder","disabled","readonly","aria-described-by","input-attributes","onChange","onKeydown","onKeyup","onClick","onWheel","onBlur"])]),_:1},16,["model-value","min","max","valid","validation-message","disabled","show"]),d.value?(e.openBlock(),e.createBlock(e.unref(r.Error),{key:1,id:s.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:1},8,["id"])):a.messages?.hint?(e.openBlock(),e.createBlock(e.unref(r.Hint),{key:2,id:f.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.messages.hint),1)]),_:1},8,["id"])):e.createCommentVNode("",!0)],512))}}),K=C._export_sfc(T,[["__scopeId","data-v-9598aad4"]]),$={class:"fk-daterangepicker fkui-picker"},S={class:"fkui-picker-row"},R=e.defineComponent({inheritAttrs:!1,__name:"DateRangeField",props:e.mergeModels({input:{},label:{},min:{},max:{},messages:{},disabled:{type:Boolean},readonly:{type:Boolean},showClearButton:{type:Boolean,default:!0},views:{}},{modelValue:{},modelModifiers:{},show:{type:Boolean,default:!1},showModifiers:{}}),emits:["update:modelValue","update:show"],setup(a){const t=a,u=e.useModel(a,"modelValue"),l=e.useModel(a,"show"),m=o=>u.value=o,v=e.ref(null),s=e.computed(()=>l.value&&!t.disabled&&!t.readonly),f=()=>{!t.disabled&&!t.readonly&&(l.value=!l.value)},d=e.computed(()=>{const o=Math.trunc(t.views??4);return Number.isFinite(o)?Math.min(Math.max(o,1),4):4}),k=e.computed(()=>`${t.input.id}-calendar`),c=e.computed(()=>`${t.input.id}-error`),n=e.computed(()=>`${t.input.id}-hint`),i=e.computed(()=>`${t.input.id}-span`),h=e.computed(()=>{if(t.input.validComputed.value!==!1)return"";const o=w(t.input.reason.value);return o&&t.messages?.error?.[o]||t.input.validationMessage.value}),x=e.computed(()=>{if(h.value)return c.value;const o=[t.input.validComputed.value&&t.input.spanDays.value?i.value:"",t.messages?.hint?n.value:""].filter(Boolean);return o.length?o.join(" "):void 0});return b.usePopupTrap({isOpen:s,onRequestClose:()=>l.value=!1,triggerEl:e.computed(()=>v.value?.$el??null),popupSelector:[".k-calendar",".k-popup"]}),(o,y)=>(e.openBlock(),e.createElementBlock("div",$,[a.label?(e.openBlock(),e.createBlock(e.unref(r.Label),{key:0,"editor-id":a.input.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.label),1)]),_:1},8,["editor-id"])):e.createCommentVNode("",!0),e.createElementVNode("div",S,[e.createVNode(e.unref(g.MaskedTextBox),e.mergeProps({ref_key:"maskedTextBoxRef",ref:v,"fill-mode":"outline",rounded:"medium",size:"medium"},o.$attrs,{id:a.input.id,disabled:a.disabled,readonly:a.readonly,"show-clear-button":a.showClearButton&&!a.disabled&&!a.readonly,placeholder:a.messages?.placeholder??"Start Date - End Date",mask:"00/00/0000 - 00/00/0000",value:a.input.raw.value,valid:a.input.validComputed.value,"aria-described-by":x.value,"input-attributes":{"aria-invalid":a.input.validComputed.value===!1,"aria-haspopup":"grid","aria-expanded":s.value,"aria-controls":k.value},"input-suffix":"calendar-suffix",onChange:a.input.handleChange,onKeydown:a.input.handleKeyDown,onKeyup:a.input.handleKeyUp,onWheel:a.input.handleWheel,onClick:a.input.handleClick,onBlur:a.input.handleBlur,onFocus:y[0]||(y[0]=B=>l.value=!1)}),{"calendar-suffix":e.withCtx(()=>[e.createVNode(e.unref(V.SvgIcon),{icon:e.unref(N.dateRangeIcon),class:"fkui-calendar-toggle",onMousedown:e.withModifiers(f,["prevent","stop"])},null,8,["icon"])]),_:1},16,["id","disabled","readonly","show-clear-button","placeholder","value","valid","aria-described-by","input-attributes","onChange","onKeydown","onKeyup","onWheel","onClick","onBlur"]),a.input.validComputed.value&&a.input.spanDays.value?(e.openBlock(),e.createBlock(e.unref(r.Hint),{key:0,id:i.value},{default:e.withCtx(()=>[e.createTextVNode(" ("+e.toDisplayString(a.input.spanDays.value)+" day"+e.toDisplayString(a.input.spanDays.value===1?"":"s")+") ",1)]),_:1},8,["id"])):e.createCommentVNode("",!0)]),h.value?(e.openBlock(),e.createBlock(e.unref(r.Error),{key:1,id:c.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.value),1)]),_:1},8,["id"])):a.messages?.hint?(e.openBlock(),e.createBlock(e.unref(r.Hint),{key:2,id:n.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.messages.hint),1)]),_:1},8,["id"])):e.createCommentVNode("",!0),e.createVNode(e.unref(M.Popup),{anchor:"maskedTextBoxRef",show:s.value,animate:!1,class:"fkui-range-popup"},{default:e.withCtx(()=>[e.createVNode(e.unref(D.Tooltip),{"anchor-element":"pointer",position:"top","open-delay":280,"parent-title":!0},{default:e.withCtx(()=>[e.createVNode(e.unref(p.Calendar),{id:k.value,"model-value":u.value??void 0,class:"fkui-range-calendar",mode:"range","allow-reverse":!1,views:d.value,min:a.min??a.input.min,max:a.max??a.input.max,"onUpdate:modelValue":m,onChange:a.input.onCalendarChange,onKeydown:y[1]||(y[1]=e.withKeys(B=>l.value=!1,["escape"]))},null,8,["id","model-value","views","min","max","onChange"])]),_:1})]),_:1},8,["show"])]))}}),q=C._export_sfc(R,[["__scopeId","data-v-43893bc7"]]),I=e.defineComponent({inheritAttrs:!1,__name:"TimeField",props:e.mergeModels({input:{},label:{},min:{},max:{},messages:{},disabled:{type:Boolean},readonly:{type:Boolean}},{modelValue:{},modelModifiers:{},show:{type:Boolean,default:!1},showModifiers:{}}),emits:["update:modelValue","update:show"],setup(a){const t=a,u=e.useModel(a,"modelValue"),l=e.useModel(a,"show"),m=e.ref(null),v=e.computed(()=>l.value&&!t.disabled&&!t.readonly),s=e.computed(()=>`${t.input.id}-error`),f=e.computed(()=>`${t.input.id}-hint`),d=e.computed(()=>{const n=t.input.validationMessage.value;if(!n)return"";const i=w(t.input.reason.value);return i&&t.messages?.error?.[i]||n}),k=e.computed(()=>d.value?s.value:t.messages?.hint?f.value:void 0),c=b.usePopupTrap({isOpen:v,onRequestClose:()=>l.value=!1,triggerEl:m,popupSelector:[".k-timeselector",".k-popup"],focusTrapOptions:{setReturnFocus:()=>c.lastCloseReason.value==="outside"?!1:m.value?.querySelector("input")??!1}});return(n,i)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:m,class:"fk-timepicker fkui-picker"},[a.label?(e.openBlock(),e.createBlock(e.unref(r.Label),{key:0,"editor-id":a.input.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.label),1)]),_:1},8,["editor-id"])):e.createCommentVNode("",!0),e.createVNode(e.unref(p.TimePicker),e.mergeProps({"fill-mode":"outline",rounded:"medium",size:"medium",format:"hh:mm a"},n.$attrs,{"model-value":u.value instanceof Date?u.value:void 0,"date-input":"masked",min:a.min??a.input.min??void 0,max:a.max??a.input.max??void 0,valid:a.input.isValid.value,"validation-message":d.value,disabled:a.disabled,show:v.value,onChange:a.input.handleChange,"onUpdate:modelValue":i[0]||(i[0]=h=>u.value=h),onOpen:i[1]||(i[1]=h=>l.value=!a.readonly),onClose:i[2]||(i[2]=h=>l.value=!1)}),{masked:e.withCtx(()=>[e.createVNode(e.unref(g.MaskedTextBox),{id:a.input.id,mask:"Hh:Mm Aa",rules:a.input.rules,value:a.input.raw.value,placeholder:a.messages?.placeholder??a.input.placeholder.value,"show-clear-button":!1,disabled:a.disabled,readonly:a.readonly,"aria-described-by":k.value,"input-attributes":{"aria-invalid":!a.input.isValid.value},onChange:a.input.handleChange,onKeydown:a.input.handleKeyDown,onKeyup:a.input.handleKeyUp,onClick:a.input.handleClick,onWheel:a.input.handleWheel,onBlur:a.input.handleBlur},null,8,["id","rules","value","placeholder","disabled","readonly","aria-described-by","input-attributes","onChange","onKeydown","onKeyup","onClick","onWheel","onBlur"])]),_:1},16,["model-value","min","max","valid","validation-message","disabled","show","onChange"]),d.value?(e.openBlock(),e.createBlock(e.unref(r.Error),{key:1,id:s.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:1},8,["id"])):a.messages?.hint?(e.openBlock(),e.createBlock(e.unref(r.Hint),{key:2,id:f.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.messages.hint),1)]),_:1},8,["id"])):e.createCommentVNode("",!0)],512))}}),E=C._export_sfc(I,[["__scopeId","data-v-33cb65f4"]]);exports.DateField=K;exports.DateRangeField=q;exports.TimeField=E;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),g=require("@progress/kendo-vue-dateinputs"),p=require("@progress/kendo-vue-inputs"),c=require("@progress/kendo-vue-labels"),b=require("@featherk/composables/trap"),w=require("./chunks/shared-BHFhmbuH.cjs"),B=require("@progress/kendo-vue-common"),V=require("@progress/kendo-vue-popup"),M=require("@progress/kendo-vue-tooltip"),T=require("@featherk/icons"),C=a=>a==="incomplete"?"required":a,N=e.defineComponent({inheritAttrs:!1,__name:"DateField",props:e.mergeModels({input:{},label:{},min:{},max:{},messages:{},disabled:{type:Boolean},readonly:{type:Boolean}},{modelValue:{},modelModifiers:{},show:{type:Boolean,default:!1},showModifiers:{}}),emits:["update:modelValue","update:show"],setup(a){const t=a,d=e.useModel(a,"modelValue"),i=e.useModel(a,"show"),m=e.ref(null),v=e.computed(()=>i.value&&!t.disabled&&!t.readonly),u=e.computed(()=>`${t.input.id}-error`),f=e.computed(()=>`${t.input.id}-hint`),o=e.computed(()=>{const r=t.input.validationMessage.value;if(!r)return"";const n=C(t.input.reason.value);return n&&t.messages?.error?.[n]||r}),h=e.computed(()=>o.value?u.value:t.messages?.hint?f.value:void 0);return b.usePopupTrap({isOpen:v,onRequestClose:()=>i.value=!1,triggerEl:m}),(r,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:m,class:"fk-datepicker fkui-picker"},[a.label?(e.openBlock(),e.createBlock(e.unref(c.Label),{key:0,"editor-id":a.input.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.label),1)]),_:1},8,["editor-id"])):e.createCommentVNode("",!0),e.createVNode(e.unref(g.DatePicker),e.mergeProps({"fill-mode":"outline",rounded:"medium",size:"medium"},r.$attrs,{"model-value":d.value instanceof Date?d.value:void 0,"date-input":"masked",min:a.min??a.input.min??void 0,max:a.max??a.input.max??void 0,valid:a.input.isValid.value,"validation-message":o.value,disabled:a.disabled,show:v.value,"onUpdate:modelValue":n[0]||(n[0]=l=>d.value=l),onOpen:n[1]||(n[1]=l=>i.value=!a.readonly),onClose:n[2]||(n[2]=l=>i.value=!1)}),{masked:e.withCtx(()=>[e.createVNode(e.unref(p.MaskedTextBox),{id:a.input.id,mask:"00/00/0000",value:a.input.raw.value,placeholder:a.messages?.placeholder??a.input.placeholder.value,"show-clear-button":!1,disabled:a.disabled,readonly:a.readonly,"aria-described-by":h.value,"input-attributes":{"aria-invalid":!a.input.isValid.value},onChange:a.input.handleChange,onKeydown:a.input.handleKeyDown,onKeyup:a.input.handleKeyUp,onClick:a.input.handleClick,onWheel:a.input.handleWheel,onBlur:a.input.handleBlur},null,8,["id","value","placeholder","disabled","readonly","aria-described-by","input-attributes","onChange","onKeydown","onKeyup","onClick","onWheel","onBlur"])]),_:1},16,["model-value","min","max","valid","validation-message","disabled","show"]),o.value?(e.openBlock(),e.createBlock(e.unref(c.Error),{key:1,id:u.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.value),1)]),_:1},8,["id"])):a.messages?.hint?(e.openBlock(),e.createBlock(e.unref(c.Hint),{key:2,id:f.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.messages.hint),1)]),_:1},8,["id"])):e.createCommentVNode("",!0)],512))}}),D=w._export_sfc(N,[["__scopeId","data-v-9598aad4"]]),K={class:"fk-daterangepicker fkui-picker"},$=e.defineComponent({inheritAttrs:!1,__name:"DateRangeField",props:e.mergeModels({input:{},label:{},min:{},max:{},messages:{},disabled:{type:Boolean},readonly:{type:Boolean},showClearButton:{type:Boolean,default:!0},views:{}},{modelValue:{},modelModifiers:{},show:{type:Boolean,default:!1},showModifiers:{}}),emits:["update:modelValue","update:show"],setup(a){const t=a,d=e.useModel(a,"modelValue"),i=e.useModel(a,"show"),m=s=>d.value=s,v=e.ref(null),u=e.computed(()=>i.value&&!t.disabled&&!t.readonly),f=()=>{!t.disabled&&!t.readonly&&(i.value=!i.value)},o=e.computed(()=>{const s=Math.trunc(t.views??4);return Number.isFinite(s)?Math.min(Math.max(s,1),4):4}),h=e.computed(()=>`${t.input.id}-calendar`),r=e.computed(()=>`${t.input.id}-error`),n=e.computed(()=>`${t.input.id}-hint`),l=e.computed(()=>{if(t.input.validComputed.value!==!1)return"";const s=C(t.input.reason.value);return s&&t.messages?.error?.[s]||t.input.validationMessage.value}),k=e.computed(()=>l.value?r.value:t.messages?.hint?n.value:void 0);return b.usePopupTrap({isOpen:u,onRequestClose:()=>i.value=!1,triggerEl:e.computed(()=>v.value?.$el??null),popupSelector:[".k-calendar",".k-popup"]}),(s,y)=>(e.openBlock(),e.createElementBlock("div",K,[a.label?(e.openBlock(),e.createBlock(e.unref(c.Label),{key:0,"editor-id":a.input.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.label),1)]),_:1},8,["editor-id"])):e.createCommentVNode("",!0),e.createVNode(e.unref(p.MaskedTextBox),e.mergeProps({ref_key:"maskedTextBoxRef",ref:v,"fill-mode":"outline",rounded:"medium",size:"medium"},s.$attrs,{id:a.input.id,disabled:a.disabled,readonly:a.readonly,"show-clear-button":a.showClearButton&&!a.disabled&&!a.readonly,placeholder:a.messages?.placeholder??"Start Date - End Date",mask:"00/00/0000 - 00/00/0000",value:a.input.raw.value,valid:a.input.validComputed.value,"aria-described-by":k.value,"input-attributes":{"aria-invalid":a.input.validComputed.value===!1,"aria-haspopup":"grid","aria-expanded":u.value,"aria-controls":h.value},"input-suffix":"calendar-suffix",onChange:a.input.handleChange,onKeydown:a.input.handleKeyDown,onKeyup:a.input.handleKeyUp,onWheel:a.input.handleWheel,onClick:a.input.handleClick,onBlur:a.input.handleBlur,onFocus:y[0]||(y[0]=x=>i.value=!1)}),{"calendar-suffix":e.withCtx(()=>[e.createVNode(e.unref(B.SvgIcon),{icon:e.unref(T.dateRangeIcon),class:"fkui-calendar-toggle",onMousedown:e.withModifiers(f,["prevent","stop"])},null,8,["icon"])]),_:1},16,["id","disabled","readonly","show-clear-button","placeholder","value","valid","aria-described-by","input-attributes","onChange","onKeydown","onKeyup","onWheel","onClick","onBlur"]),l.value?(e.openBlock(),e.createBlock(e.unref(c.Error),{key:1,id:r.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1},8,["id"])):a.messages?.hint?(e.openBlock(),e.createBlock(e.unref(c.Hint),{key:2,id:n.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.messages.hint),1)]),_:1},8,["id"])):e.createCommentVNode("",!0),e.createVNode(e.unref(V.Popup),{anchor:"maskedTextBoxRef",show:u.value,animate:!1,class:"fkui-range-popup"},{default:e.withCtx(()=>[e.createVNode(e.unref(M.Tooltip),{"anchor-element":"pointer",position:"top","open-delay":280,"parent-title":!0},{default:e.withCtx(()=>[e.createVNode(e.unref(g.Calendar),{id:h.value,"model-value":d.value??void 0,class:"fkui-range-calendar",mode:"range","allow-reverse":!1,views:o.value,min:a.min??a.input.min,max:a.max??a.input.max,"onUpdate:modelValue":m,onChange:a.input.onCalendarChange,onKeydown:y[1]||(y[1]=e.withKeys(x=>i.value=!1,["escape"]))},null,8,["id","model-value","views","min","max","onChange"])]),_:1})]),_:1},8,["show"])]))}}),R=w._export_sfc($,[["__scopeId","data-v-8b45610e"]]),S=e.defineComponent({inheritAttrs:!1,__name:"TimeField",props:e.mergeModels({input:{},label:{},min:{},max:{},messages:{},disabled:{type:Boolean},readonly:{type:Boolean}},{modelValue:{},modelModifiers:{},show:{type:Boolean,default:!1},showModifiers:{}}),emits:["update:modelValue","update:show"],setup(a){const t=a,d=e.useModel(a,"modelValue"),i=e.useModel(a,"show"),m=e.ref(null),v=e.computed(()=>i.value&&!t.disabled&&!t.readonly),u=e.computed(()=>`${t.input.id}-error`),f=e.computed(()=>`${t.input.id}-hint`),o=e.computed(()=>{const n=t.input.validationMessage.value;if(!n)return"";const l=C(t.input.reason.value);return l&&t.messages?.error?.[l]||n}),h=e.computed(()=>o.value?u.value:t.messages?.hint?f.value:void 0),r=b.usePopupTrap({isOpen:v,onRequestClose:()=>i.value=!1,triggerEl:m,popupSelector:[".k-timeselector",".k-popup"],focusTrapOptions:{setReturnFocus:()=>r.lastCloseReason.value==="outside"?!1:m.value?.querySelector("input")??!1}});return(n,l)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:m,class:"fk-timepicker fkui-picker"},[a.label?(e.openBlock(),e.createBlock(e.unref(c.Label),{key:0,"editor-id":a.input.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.label),1)]),_:1},8,["editor-id"])):e.createCommentVNode("",!0),e.createVNode(e.unref(g.TimePicker),e.mergeProps({"fill-mode":"outline",rounded:"medium",size:"medium",format:"hh:mm a"},n.$attrs,{"model-value":d.value instanceof Date?d.value:void 0,"date-input":"masked",min:a.min??a.input.min??void 0,max:a.max??a.input.max??void 0,valid:a.input.isValid.value,"validation-message":o.value,disabled:a.disabled,show:v.value,onChange:a.input.handleChange,"onUpdate:modelValue":l[0]||(l[0]=k=>d.value=k),onOpen:l[1]||(l[1]=k=>i.value=!a.readonly),onClose:l[2]||(l[2]=k=>i.value=!1)}),{masked:e.withCtx(()=>[e.createVNode(e.unref(p.MaskedTextBox),{id:a.input.id,mask:"Hh:Mm Aa",rules:a.input.rules,value:a.input.raw.value,placeholder:a.messages?.placeholder??a.input.placeholder.value,"show-clear-button":!1,disabled:a.disabled,readonly:a.readonly,"aria-described-by":h.value,"input-attributes":{"aria-invalid":!a.input.isValid.value},onChange:a.input.handleChange,onKeydown:a.input.handleKeyDown,onKeyup:a.input.handleKeyUp,onClick:a.input.handleClick,onWheel:a.input.handleWheel,onBlur:a.input.handleBlur},null,8,["id","rules","value","placeholder","disabled","readonly","aria-described-by","input-attributes","onChange","onKeydown","onKeyup","onClick","onWheel","onBlur"])]),_:1},16,["model-value","min","max","valid","validation-message","disabled","show","onChange"]),o.value?(e.openBlock(),e.createBlock(e.unref(c.Error),{key:1,id:u.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.value),1)]),_:1},8,["id"])):a.messages?.hint?(e.openBlock(),e.createBlock(e.unref(c.Hint),{key:2,id:f.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.messages.hint),1)]),_:1},8,["id"])):e.createCommentVNode("",!0)],512))}}),q=w._export_sfc(S,[["__scopeId","data-v-33cb65f4"]]);exports.DateField=D;exports.DateRangeField=R;exports.TimeField=q;
|
|
2
2
|
//# sourceMappingURL=picker.cjs.map
|
package/dist/picker.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picker.cjs","sources":["../src/picker/errorKey.ts","../src/picker/DateField.vue","../src/picker/DateRangeField.vue","../src/picker/TimeField.vue"],"sourcesContent":["// The composables report a missing value as \"incomplete\"; messages call it\n// \"required\" to match USAddressMessages.\nexport const toErrorKey = <TKey extends string>(reason: string | undefined) =>\n (reason === \"incomplete\" ? \"required\" : reason) as TKey | undefined;\n","<template>\n <div ref=\"rootRef\" class=\"fk-datepicker fkui-picker\">\n <Label v-if=\"label\" :editor-id=\"input.id\">{{ label }}</Label>\n <DatePicker\n fill-mode=\"outline\"\n rounded=\"medium\"\n size=\"medium\"\n v-bind=\"$attrs\"\n :model-value=\"model instanceof Date ? model : undefined\"\n date-input=\"masked\"\n :min=\"min ?? input.min ?? undefined\"\n :max=\"max ?? input.max ?? undefined\"\n :valid=\"input.isValid.value\"\n :validation-message=\"errorMessage\"\n :disabled=\"disabled\"\n :show=\"isOpen\"\n @update:model-value=\"model = $event\"\n @open=\"show = !readonly\"\n @close=\"show = false\"\n >\n <template #masked>\n <MaskedTextBox\n :id=\"input.id\"\n mask=\"00/00/0000\"\n :value=\"input.raw.value\"\n :placeholder=\"messages?.placeholder ?? input.placeholder.value\"\n :show-clear-button=\"false\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :aria-described-by=\"describedBy\"\n :input-attributes=\"{ 'aria-invalid': !input.isValid.value }\"\n @change=\"input.handleChange\"\n @keydown=\"input.handleKeyDown\"\n @keyup=\"input.handleKeyUp\"\n @click=\"input.handleClick\"\n @wheel=\"input.handleWheel\"\n @blur=\"input.handleBlur\"\n />\n </template>\n </DatePicker>\n <Error v-if=\"errorMessage\" :id=\"errorId\">{{ errorMessage }}</Error>\n <Hint v-else-if=\"messages?.hint\" :id=\"hintId\">{{ messages.hint }}</Hint>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\nimport { DatePicker } from \"@progress/kendo-vue-dateinputs\";\nimport { MaskedTextBox } from \"@progress/kendo-vue-inputs\";\nimport { Error, Hint, Label } from \"@progress/kendo-vue-labels\";\nimport { usePopupTrap } from \"@featherk/composables/trap\";\nimport type { UseMaskedDateInputReturn } from \"@featherk/composables/date\";\nimport type { DateFieldMessages, DateFieldErrorKey } from \"./types\";\nimport { toErrorKey } from \"./errorKey\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = defineProps<{\n /** Return value of `useMaskedDateInput`. */\n input: UseMaskedDateInputReturn;\n label?: string;\n /** Calendar bounds; default to the composable's `min`/`max`. */\n min?: Date;\n max?: Date;\n messages?: DateFieldMessages;\n /** Also applied to the masked input, which Kendo's picker does not reach. */\n disabled?: boolean;\n readonly?: boolean;\n}>();\n\n/** Must be the same ref passed to `useMaskedDateInput` as `externalValue`. */\nconst model = defineModel<Date | string | null | undefined>();\n/** Must be the same ref the composable's `onShowCalendar` opens. */\nconst show = defineModel<boolean>(\"show\", { default: false });\n\nconst rootRef = ref<HTMLElement | null>(null);\n// A locked field never shows its popup, even if the parent sets `show`, so its selection can't write the model.\nconst isOpen = computed(() => show.value && !props.disabled && !props.readonly);\nconst errorId = computed(() => `${props.input.id}-error`);\nconst hintId = computed(() => `${props.input.id}-hint`);\n\n// The composable decides when an error shows; messages only replace its text.\nconst errorMessage = computed(() => {\n const fallback = props.input.validationMessage.value;\n if (!fallback) return \"\";\n const key = toErrorKey<DateFieldErrorKey>(props.input.reason.value);\n return (key && props.messages?.error?.[key]) || fallback;\n});\n\nconst describedBy = computed(() => {\n if (errorMessage.value) return errorId.value;\n return props.messages?.hint ? hintId.value : undefined;\n});\n\nusePopupTrap({\n isOpen,\n onRequestClose: () => (show.value = false),\n triggerEl: rootRef,\n});\n</script>\n\n<style scoped>\n.fkui-picker {\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n}\n</style>\n","<template>\n <div class=\"fk-daterangepicker fkui-picker\">\n <Label v-if=\"label\" :editor-id=\"input.id\">{{ label }}</Label>\n <div class=\"fkui-picker-row\">\n <MaskedTextBox\n ref=\"maskedTextBoxRef\"\n fill-mode=\"outline\"\n rounded=\"medium\"\n size=\"medium\"\n v-bind=\"$attrs\"\n :id=\"input.id\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :show-clear-button=\"showClearButton && !disabled && !readonly\"\n :placeholder=\"messages?.placeholder ?? 'Start Date - End Date'\"\n mask=\"00/00/0000 - 00/00/0000\"\n :value=\"input.raw.value\"\n :valid=\"input.validComputed.value\"\n :aria-described-by=\"describedBy\"\n :input-attributes=\"{\n 'aria-invalid': input.validComputed.value === false,\n 'aria-haspopup': 'grid',\n 'aria-expanded': isOpen,\n 'aria-controls': calendarId,\n }\"\n input-suffix=\"calendar-suffix\"\n @change=\"input.handleChange\"\n @keydown=\"input.handleKeyDown\"\n @keyup=\"input.handleKeyUp\"\n @wheel=\"input.handleWheel\"\n @click=\"input.handleClick\"\n @blur=\"input.handleBlur\"\n @focus=\"show = false\"\n >\n <template #calendar-suffix>\n <!-- mousedown.prevent keeps focus in the input; keyboard users open the calendar from the input. -->\n <SvgIcon\n :icon=\"dateRangeIcon\"\n class=\"fkui-calendar-toggle\"\n @mousedown.prevent.stop=\"toggleCalendar\"\n />\n </template>\n </MaskedTextBox>\n <Hint\n v-if=\"input.validComputed.value && input.spanDays.value\"\n :id=\"spanId\"\n >\n ({{ input.spanDays.value }} day{{\n input.spanDays.value === 1 ? \"\" : \"s\"\n }})\n </Hint>\n </div>\n <Error v-if=\"errorMessage\" :id=\"errorId\">{{ errorMessage }}</Error>\n <Hint v-else-if=\"messages?.hint\" :id=\"hintId\">{{ messages.hint }}</Hint>\n\n <Popup\n anchor=\"maskedTextBoxRef\"\n :show=\"isOpen\"\n :animate=\"false\"\n class=\"fkui-range-popup\"\n >\n <Tooltip\n anchor-element=\"pointer\"\n position=\"top\"\n :open-delay=\"280\"\n :parent-title=\"true\"\n >\n <Calendar\n :id=\"calendarId\"\n :model-value=\"model ?? undefined\"\n class=\"fkui-range-calendar\"\n mode=\"range\"\n :allow-reverse=\"false\"\n :views=\"calendarViews\"\n :min=\"min ?? input.min\"\n :max=\"max ?? input.max\"\n @update:model-value=\"onCalendarValue\"\n @change=\"input.onCalendarChange\"\n @keydown.escape=\"show = false\"\n />\n </Tooltip>\n </Popup>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\nimport { Calendar, type SelectionRange } from \"@progress/kendo-vue-dateinputs\";\nimport { MaskedTextBox } from \"@progress/kendo-vue-inputs\";\nimport { Error, Hint, Label } from \"@progress/kendo-vue-labels\";\nimport { SvgIcon } from \"@progress/kendo-vue-common\";\nimport { Popup } from \"@progress/kendo-vue-popup\";\nimport { Tooltip } from \"@progress/kendo-vue-tooltip\";\nimport { dateRangeIcon } from \"@featherk/icons\";\nimport { usePopupTrap } from \"@featherk/composables/trap\";\nimport type { UseMaskedDateRangeInputReturn } from \"@featherk/composables/range\";\nimport type { DateRangeFieldErrorKey, DateRangeFieldMessages } from \"./types\";\nimport { toErrorKey } from \"./errorKey\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = withDefaults(\n defineProps<{\n /** Return value of `useMaskedDateRangeInput`. */\n input: UseMaskedDateRangeInputReturn;\n label?: string;\n /** Calendar bounds; default to the composable's `min`/`max`. */\n min?: Date;\n max?: Date;\n messages?: DateRangeFieldMessages;\n disabled?: boolean;\n readonly?: boolean;\n /** Hidden while disabled or readonly, since Kendo's clear button ignores both. */\n showClearButton?: boolean;\n /** Months shown in the calendar, 1 to 4 (default 4). */\n views?: 1 | 2 | 3 | 4;\n }>(),\n { showClearButton: true },\n);\n\n/** Must be the same ref passed to `useMaskedDateRangeInput` as `externalValue`. */\nconst model = defineModel<SelectionRange | null | undefined>();\n/** Must be the same ref passed to the composable as `isOpen`. */\nconst show = defineModel<boolean>(\"show\", { default: false });\n\n// Kendo Calendar's model type has no null, and in range mode it always emits a SelectionRange.\nconst onCalendarValue = (value: unknown) =>\n (model.value = value as SelectionRange);\n\nconst maskedTextBoxRef = ref<InstanceType<typeof MaskedTextBox> | null>(null);\n\n// A locked field never shows its popup, even if the parent sets `show`, so its selection can't write the model.\nconst isOpen = computed(() => show.value && !props.disabled && !props.readonly);\n\nconst toggleCalendar = () => {\n if (!props.disabled && !props.readonly) show.value = !show.value;\n};\n\n// Clamped for untyped callers; the external styles are laid out for at most four months.\nconst calendarViews = computed(() => {\n const views = Math.trunc(props.views ?? 4);\n return Number.isFinite(views) ? Math.min(Math.max(views, 1), 4) : 4;\n});\n\nconst calendarId = computed(() => `${props.input.id}-calendar`);\nconst errorId = computed(() => `${props.input.id}-error`);\nconst hintId = computed(() => `${props.input.id}-hint`);\nconst spanId = computed(() => `${props.input.id}-span`);\n\n// The composable decides when an error shows; messages only replace its text.\nconst errorMessage = computed(() => {\n if (props.input.validComputed.value !== false) return \"\";\n const key = toErrorKey<DateRangeFieldErrorKey>(props.input.reason.value);\n return (\n (key && props.messages?.error?.[key]) || props.input.validationMessage.value\n );\n});\n\nconst describedBy = computed(() => {\n if (errorMessage.value) return errorId.value;\n const ids = [\n props.input.validComputed.value && props.input.spanDays.value\n ? spanId.value\n : \"\",\n props.messages?.hint ? hintId.value : \"\",\n ].filter(Boolean);\n return ids.length ? ids.join(\" \") : undefined;\n});\n\nusePopupTrap({\n isOpen,\n onRequestClose: () => (show.value = false),\n triggerEl: computed(\n () => (maskedTextBoxRef.value?.$el as HTMLElement | undefined) ?? null,\n ),\n popupSelector: [\".k-calendar\", \".k-popup\"],\n});\n</script>\n\n<style scoped>\n.fkui-picker {\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n}\n.fkui-picker-row {\n display: inline-flex;\n align-items: center;\n gap: 1em;\n}\n.fkui-range-calendar {\n overscroll-behavior: contain;\n}\n</style>\n","<template>\n <div ref=\"rootRef\" class=\"fk-timepicker fkui-picker\">\n <Label v-if=\"label\" :editor-id=\"input.id\">{{ label }}</Label>\n <TimePicker\n fill-mode=\"outline\"\n rounded=\"medium\"\n size=\"medium\"\n format=\"hh:mm a\"\n v-bind=\"$attrs\"\n :model-value=\"model instanceof Date ? model : undefined\"\n date-input=\"masked\"\n :min=\"min ?? input.min ?? undefined\"\n :max=\"max ?? input.max ?? undefined\"\n :valid=\"input.isValid.value\"\n :validation-message=\"errorMessage\"\n :disabled=\"disabled\"\n :show=\"isOpen\"\n @change=\"input.handleChange\"\n @update:model-value=\"model = $event\"\n @open=\"show = !readonly\"\n @close=\"show = false\"\n >\n <template #masked>\n <MaskedTextBox\n :id=\"input.id\"\n mask=\"Hh:Mm Aa\"\n :rules=\"input.rules\"\n :value=\"input.raw.value\"\n :placeholder=\"messages?.placeholder ?? input.placeholder.value\"\n :show-clear-button=\"false\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :aria-described-by=\"describedBy\"\n :input-attributes=\"{ 'aria-invalid': !input.isValid.value }\"\n @change=\"input.handleChange\"\n @keydown=\"input.handleKeyDown\"\n @keyup=\"input.handleKeyUp\"\n @click=\"input.handleClick\"\n @wheel=\"input.handleWheel\"\n @blur=\"input.handleBlur\"\n />\n </template>\n </TimePicker>\n <Error v-if=\"errorMessage\" :id=\"errorId\">{{ errorMessage }}</Error>\n <Hint v-else-if=\"messages?.hint\" :id=\"hintId\">{{ messages.hint }}</Hint>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\nimport { TimePicker } from \"@progress/kendo-vue-dateinputs\";\nimport { MaskedTextBox } from \"@progress/kendo-vue-inputs\";\nimport { Error, Hint, Label } from \"@progress/kendo-vue-labels\";\nimport { usePopupTrap } from \"@featherk/composables/trap\";\nimport type { UseMaskedTimeInputReturn } from \"@featherk/composables/time\";\nimport type { TimeFieldMessages, TimeFieldErrorKey } from \"./types\";\nimport { toErrorKey } from \"./errorKey\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = defineProps<{\n /** Return value of `useMaskedTimeInput`. */\n input: UseMaskedTimeInputReturn;\n label?: string;\n /** Time list bounds; default to the composable's `min`/`max`. */\n min?: Date;\n max?: Date;\n messages?: TimeFieldMessages;\n /** Also applied to the masked input, which Kendo's picker does not reach. */\n disabled?: boolean;\n readonly?: boolean;\n}>();\n\n/** Must be the same ref passed to `useMaskedTimeInput` as `externalValue`. */\nconst model = defineModel<Date | string | null | undefined>();\n/** Must be the same ref the composable's `onShowPicker` opens. */\nconst show = defineModel<boolean>(\"show\", { default: false });\n\nconst rootRef = ref<HTMLElement | null>(null);\n// A locked field never shows its popup, even if the parent sets `show`, so its selection can't write the model.\nconst isOpen = computed(() => show.value && !props.disabled && !props.readonly);\nconst errorId = computed(() => `${props.input.id}-error`);\nconst hintId = computed(() => `${props.input.id}-hint`);\n\n// The composable decides when an error shows; messages only replace its text.\nconst errorMessage = computed(() => {\n const fallback = props.input.validationMessage.value;\n if (!fallback) return \"\";\n const key = toErrorKey<TimeFieldErrorKey>(props.input.reason.value);\n return (key && props.messages?.error?.[key]) || fallback;\n});\n\nconst describedBy = computed(() => {\n if (errorMessage.value) return errorId.value;\n return props.messages?.hint ? hintId.value : undefined;\n});\n\nconst trap = usePopupTrap({\n isOpen,\n onRequestClose: () => (show.value = false),\n triggerEl: rootRef,\n popupSelector: [\".k-timeselector\", \".k-popup\"],\n focusTrapOptions: {\n // TimePicker focuses its time list before the trap activates, so the\n // trap's default return target is removed with the popup (Set, Now, Cancel).\n setReturnFocus: () =>\n trap.lastCloseReason.value === \"outside\"\n ? false\n : (rootRef.value?.querySelector(\"input\") ?? false),\n },\n});\n</script>\n\n<style scoped>\n.fkui-picker {\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n}\n</style>\n"],"names":["toErrorKey","reason","props","__props","model","_useModel","show","rootRef","ref","isOpen","computed","errorId","hintId","errorMessage","fallback","key","describedBy","usePopupTrap","_createElementBlock","_createBlock","_unref","Label","_createVNode","_mergeProps","$attrs","_cache","$event","MaskedTextBox","Error","Hint","_createTextVNode","_toDisplayString","onCalendarValue","value","maskedTextBoxRef","toggleCalendar","calendarViews","views","calendarId","spanId","ids","_openBlock","_hoisted_1","_createElementVNode","_hoisted_2","SvgIcon","dateRangeIcon","Popup","Tooltip","Calendar","trap"],"mappings":"0cAEaA,EAAmCC,GAC7CA,IAAW,aAAe,WAAaA,kTCsD1C,MAAMC,EAAQC,EAcRC,EAAQC,EAAAA,S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gBAAA5B,EAAA,SAAS,IAAI,EAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"picker.cjs","sources":["../src/picker/errorKey.ts","../src/picker/DateField.vue","../src/picker/DateRangeField.vue","../src/picker/TimeField.vue"],"sourcesContent":["// The composables report a missing value as \"incomplete\"; messages call it\n// \"required\" to match USAddressMessages.\nexport const toErrorKey = <TKey extends string>(reason: string | undefined) =>\n (reason === \"incomplete\" ? \"required\" : reason) as TKey | undefined;\n","<template>\n <div ref=\"rootRef\" class=\"fk-datepicker fkui-picker\">\n <Label v-if=\"label\" :editor-id=\"input.id\">{{ label }}</Label>\n <DatePicker\n fill-mode=\"outline\"\n rounded=\"medium\"\n size=\"medium\"\n v-bind=\"$attrs\"\n :model-value=\"model instanceof Date ? model : undefined\"\n date-input=\"masked\"\n :min=\"min ?? input.min ?? undefined\"\n :max=\"max ?? input.max ?? undefined\"\n :valid=\"input.isValid.value\"\n :validation-message=\"errorMessage\"\n :disabled=\"disabled\"\n :show=\"isOpen\"\n @update:model-value=\"model = $event\"\n @open=\"show = !readonly\"\n @close=\"show = false\"\n >\n <template #masked>\n <MaskedTextBox\n :id=\"input.id\"\n mask=\"00/00/0000\"\n :value=\"input.raw.value\"\n :placeholder=\"messages?.placeholder ?? input.placeholder.value\"\n :show-clear-button=\"false\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :aria-described-by=\"describedBy\"\n :input-attributes=\"{ 'aria-invalid': !input.isValid.value }\"\n @change=\"input.handleChange\"\n @keydown=\"input.handleKeyDown\"\n @keyup=\"input.handleKeyUp\"\n @click=\"input.handleClick\"\n @wheel=\"input.handleWheel\"\n @blur=\"input.handleBlur\"\n />\n </template>\n </DatePicker>\n <Error v-if=\"errorMessage\" :id=\"errorId\">{{ errorMessage }}</Error>\n <Hint v-else-if=\"messages?.hint\" :id=\"hintId\">{{ messages.hint }}</Hint>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\nimport { DatePicker } from \"@progress/kendo-vue-dateinputs\";\nimport { MaskedTextBox } from \"@progress/kendo-vue-inputs\";\nimport { Error, Hint, Label } from \"@progress/kendo-vue-labels\";\nimport { usePopupTrap } from \"@featherk/composables/trap\";\nimport type { UseMaskedDateInputReturn } from \"@featherk/composables/date\";\nimport type { DateFieldMessages, DateFieldErrorKey } from \"./types\";\nimport { toErrorKey } from \"./errorKey\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = defineProps<{\n /** Return value of `useMaskedDateInput`. */\n input: UseMaskedDateInputReturn;\n label?: string;\n /** Calendar bounds; default to the composable's `min`/`max`. */\n min?: Date;\n max?: Date;\n messages?: DateFieldMessages;\n /** Also applied to the masked input, which Kendo's picker does not reach. */\n disabled?: boolean;\n readonly?: boolean;\n}>();\n\n/** Must be the same ref passed to `useMaskedDateInput` as `externalValue`. */\nconst model = defineModel<Date | string | null | undefined>();\n/** Must be the same ref the composable's `onShowCalendar` opens. */\nconst show = defineModel<boolean>(\"show\", { default: false });\n\nconst rootRef = ref<HTMLElement | null>(null);\n// A locked field never shows its popup, even if the parent sets `show`, so its selection can't write the model.\nconst isOpen = computed(() => show.value && !props.disabled && !props.readonly);\nconst errorId = computed(() => `${props.input.id}-error`);\nconst hintId = computed(() => `${props.input.id}-hint`);\n\n// The composable decides when an error shows; messages only replace its text.\nconst errorMessage = computed(() => {\n const fallback = props.input.validationMessage.value;\n if (!fallback) return \"\";\n const key = toErrorKey<DateFieldErrorKey>(props.input.reason.value);\n return (key && props.messages?.error?.[key]) || fallback;\n});\n\nconst describedBy = computed(() => {\n if (errorMessage.value) return errorId.value;\n return props.messages?.hint ? hintId.value : undefined;\n});\n\nusePopupTrap({\n isOpen,\n onRequestClose: () => (show.value = false),\n triggerEl: rootRef,\n});\n</script>\n\n<style scoped>\n.fkui-picker {\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n}\n</style>\n","<template>\n <div class=\"fk-daterangepicker fkui-picker\">\n <Label v-if=\"label\" :editor-id=\"input.id\">{{ label }}</Label>\n <MaskedTextBox\n ref=\"maskedTextBoxRef\"\n fill-mode=\"outline\"\n rounded=\"medium\"\n size=\"medium\"\n v-bind=\"$attrs\"\n :id=\"input.id\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :show-clear-button=\"showClearButton && !disabled && !readonly\"\n :placeholder=\"messages?.placeholder ?? 'Start Date - End Date'\"\n mask=\"00/00/0000 - 00/00/0000\"\n :value=\"input.raw.value\"\n :valid=\"input.validComputed.value\"\n :aria-described-by=\"describedBy\"\n :input-attributes=\"{\n 'aria-invalid': input.validComputed.value === false,\n 'aria-haspopup': 'grid',\n 'aria-expanded': isOpen,\n 'aria-controls': calendarId,\n }\"\n input-suffix=\"calendar-suffix\"\n @change=\"input.handleChange\"\n @keydown=\"input.handleKeyDown\"\n @keyup=\"input.handleKeyUp\"\n @wheel=\"input.handleWheel\"\n @click=\"input.handleClick\"\n @blur=\"input.handleBlur\"\n @focus=\"show = false\"\n >\n <template #calendar-suffix>\n <!-- mousedown.prevent keeps focus in the input; keyboard users open the calendar from the input. -->\n <SvgIcon\n :icon=\"dateRangeIcon\"\n class=\"fkui-calendar-toggle\"\n @mousedown.prevent.stop=\"toggleCalendar\"\n />\n </template>\n </MaskedTextBox>\n <Error v-if=\"errorMessage\" :id=\"errorId\">{{ errorMessage }}</Error>\n <Hint v-else-if=\"messages?.hint\" :id=\"hintId\">{{ messages.hint }}</Hint>\n\n <Popup\n anchor=\"maskedTextBoxRef\"\n :show=\"isOpen\"\n :animate=\"false\"\n class=\"fkui-range-popup\"\n >\n <Tooltip\n anchor-element=\"pointer\"\n position=\"top\"\n :open-delay=\"280\"\n :parent-title=\"true\"\n >\n <Calendar\n :id=\"calendarId\"\n :model-value=\"model ?? undefined\"\n class=\"fkui-range-calendar\"\n mode=\"range\"\n :allow-reverse=\"false\"\n :views=\"calendarViews\"\n :min=\"min ?? input.min\"\n :max=\"max ?? input.max\"\n @update:model-value=\"onCalendarValue\"\n @change=\"input.onCalendarChange\"\n @keydown.escape=\"show = false\"\n />\n </Tooltip>\n </Popup>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\nimport { Calendar, type SelectionRange } from \"@progress/kendo-vue-dateinputs\";\nimport { MaskedTextBox } from \"@progress/kendo-vue-inputs\";\nimport { Error, Hint, Label } from \"@progress/kendo-vue-labels\";\nimport { SvgIcon } from \"@progress/kendo-vue-common\";\nimport { Popup } from \"@progress/kendo-vue-popup\";\nimport { Tooltip } from \"@progress/kendo-vue-tooltip\";\nimport { dateRangeIcon } from \"@featherk/icons\";\nimport { usePopupTrap } from \"@featherk/composables/trap\";\nimport type { UseMaskedDateRangeInputReturn } from \"@featherk/composables/range\";\nimport type { DateRangeFieldErrorKey, DateRangeFieldMessages } from \"./types\";\nimport { toErrorKey } from \"./errorKey\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = withDefaults(\n defineProps<{\n /** Return value of `useMaskedDateRangeInput`. */\n input: UseMaskedDateRangeInputReturn;\n label?: string;\n /** Calendar bounds; default to the composable's `min`/`max`. */\n min?: Date;\n max?: Date;\n messages?: DateRangeFieldMessages;\n disabled?: boolean;\n readonly?: boolean;\n /** Hidden while disabled or readonly, since Kendo's clear button ignores both. */\n showClearButton?: boolean;\n /** Months shown in the calendar, 1 to 4 (default 4). */\n views?: 1 | 2 | 3 | 4;\n }>(),\n { showClearButton: true },\n);\n\n/** Must be the same ref passed to `useMaskedDateRangeInput` as `externalValue`. */\nconst model = defineModel<SelectionRange | null | undefined>();\n/** Must be the same ref passed to the composable as `isOpen`. */\nconst show = defineModel<boolean>(\"show\", { default: false });\n\n// Kendo Calendar's model type has no null, and in range mode it always emits a SelectionRange.\nconst onCalendarValue = (value: unknown) =>\n (model.value = value as SelectionRange);\n\nconst maskedTextBoxRef = ref<InstanceType<typeof MaskedTextBox> | null>(null);\n\n// A locked field never shows its popup, even if the parent sets `show`, so its selection can't write the model.\nconst isOpen = computed(() => show.value && !props.disabled && !props.readonly);\n\nconst toggleCalendar = () => {\n if (!props.disabled && !props.readonly) show.value = !show.value;\n};\n\n// Clamped for untyped callers; the external styles are laid out for at most four months.\nconst calendarViews = computed(() => {\n const views = Math.trunc(props.views ?? 4);\n return Number.isFinite(views) ? Math.min(Math.max(views, 1), 4) : 4;\n});\n\nconst calendarId = computed(() => `${props.input.id}-calendar`);\nconst errorId = computed(() => `${props.input.id}-error`);\nconst hintId = computed(() => `${props.input.id}-hint`);\n\n// The composable decides when an error shows; messages only replace its text.\nconst errorMessage = computed(() => {\n if (props.input.validComputed.value !== false) return \"\";\n const key = toErrorKey<DateRangeFieldErrorKey>(props.input.reason.value);\n return (\n (key && props.messages?.error?.[key]) || props.input.validationMessage.value\n );\n});\n\nconst describedBy = computed(() => {\n if (errorMessage.value) return errorId.value;\n return props.messages?.hint ? hintId.value : undefined;\n});\n\nusePopupTrap({\n isOpen,\n onRequestClose: () => (show.value = false),\n triggerEl: computed(\n () => (maskedTextBoxRef.value?.$el as HTMLElement | undefined) ?? null,\n ),\n popupSelector: [\".k-calendar\", \".k-popup\"],\n});\n</script>\n\n<style scoped>\n.fkui-picker {\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n}\n.fkui-range-calendar {\n overscroll-behavior: contain;\n}\n</style>\n","<template>\n <div ref=\"rootRef\" class=\"fk-timepicker fkui-picker\">\n <Label v-if=\"label\" :editor-id=\"input.id\">{{ label }}</Label>\n <TimePicker\n fill-mode=\"outline\"\n rounded=\"medium\"\n size=\"medium\"\n format=\"hh:mm a\"\n v-bind=\"$attrs\"\n :model-value=\"model instanceof Date ? model : undefined\"\n date-input=\"masked\"\n :min=\"min ?? input.min ?? undefined\"\n :max=\"max ?? input.max ?? undefined\"\n :valid=\"input.isValid.value\"\n :validation-message=\"errorMessage\"\n :disabled=\"disabled\"\n :show=\"isOpen\"\n @change=\"input.handleChange\"\n @update:model-value=\"model = $event\"\n @open=\"show = !readonly\"\n @close=\"show = false\"\n >\n <template #masked>\n <MaskedTextBox\n :id=\"input.id\"\n mask=\"Hh:Mm Aa\"\n :rules=\"input.rules\"\n :value=\"input.raw.value\"\n :placeholder=\"messages?.placeholder ?? input.placeholder.value\"\n :show-clear-button=\"false\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :aria-described-by=\"describedBy\"\n :input-attributes=\"{ 'aria-invalid': !input.isValid.value }\"\n @change=\"input.handleChange\"\n @keydown=\"input.handleKeyDown\"\n @keyup=\"input.handleKeyUp\"\n @click=\"input.handleClick\"\n @wheel=\"input.handleWheel\"\n @blur=\"input.handleBlur\"\n />\n </template>\n </TimePicker>\n <Error v-if=\"errorMessage\" :id=\"errorId\">{{ errorMessage }}</Error>\n <Hint v-else-if=\"messages?.hint\" :id=\"hintId\">{{ messages.hint }}</Hint>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\nimport { TimePicker } from \"@progress/kendo-vue-dateinputs\";\nimport { MaskedTextBox } from \"@progress/kendo-vue-inputs\";\nimport { Error, Hint, Label } from \"@progress/kendo-vue-labels\";\nimport { usePopupTrap } from \"@featherk/composables/trap\";\nimport type { UseMaskedTimeInputReturn } from \"@featherk/composables/time\";\nimport type { TimeFieldMessages, TimeFieldErrorKey } from \"./types\";\nimport { toErrorKey } from \"./errorKey\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = defineProps<{\n /** Return value of `useMaskedTimeInput`. */\n input: UseMaskedTimeInputReturn;\n label?: string;\n /** Time list bounds; default to the composable's `min`/`max`. */\n min?: Date;\n max?: Date;\n messages?: TimeFieldMessages;\n /** Also applied to the masked input, which Kendo's picker does not reach. */\n disabled?: boolean;\n readonly?: boolean;\n}>();\n\n/** Must be the same ref passed to `useMaskedTimeInput` as `externalValue`. */\nconst model = defineModel<Date | string | null | undefined>();\n/** Must be the same ref the composable's `onShowPicker` opens. */\nconst show = defineModel<boolean>(\"show\", { default: false });\n\nconst rootRef = ref<HTMLElement | null>(null);\n// A locked field never shows its popup, even if the parent sets `show`, so its selection can't write the model.\nconst isOpen = computed(() => show.value && !props.disabled && !props.readonly);\nconst errorId = computed(() => `${props.input.id}-error`);\nconst hintId = computed(() => `${props.input.id}-hint`);\n\n// The composable decides when an error shows; messages only replace its text.\nconst errorMessage = computed(() => {\n const fallback = props.input.validationMessage.value;\n if (!fallback) return \"\";\n const key = toErrorKey<TimeFieldErrorKey>(props.input.reason.value);\n return (key && props.messages?.error?.[key]) || fallback;\n});\n\nconst describedBy = computed(() => {\n if (errorMessage.value) return errorId.value;\n return props.messages?.hint ? hintId.value : undefined;\n});\n\nconst trap = usePopupTrap({\n isOpen,\n onRequestClose: () => (show.value = false),\n triggerEl: rootRef,\n popupSelector: [\".k-timeselector\", \".k-popup\"],\n focusTrapOptions: {\n // TimePicker focuses its time list before the trap activates, so the\n // trap's default return target is removed with the popup (Set, Now, Cancel).\n setReturnFocus: () =>\n trap.lastCloseReason.value === \"outside\"\n ? false\n : (rootRef.value?.querySelector(\"input\") ?? false),\n },\n});\n</script>\n\n<style scoped>\n.fkui-picker {\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n}\n</style>\n"],"names":["toErrorKey","reason","props","__props","model","_useModel","show","rootRef","ref","isOpen","computed","errorId","hintId","errorMessage","fallback","key","describedBy","usePopupTrap","_createElementBlock","_createBlock","_unref","Label","_createVNode","_mergeProps","$attrs","_cache","$event","MaskedTextBox","Error","Hint","_createTextVNode","_toDisplayString","onCalendarValue","value","maskedTextBoxRef","toggleCalendar","calendarViews","views","calendarId","_openBlock","_hoisted_1","SvgIcon","dateRangeIcon","Popup","Tooltip","Calendar","trap"],"mappings":"0cAEaA,EAAmCC,GAC7CA,IAAW,aAAe,WAAaA,kTCsD1C,MAAMC,EAAQC,EAcRC,EAAQC,EAAAA,SAA6CF,EAAA,YAAC,EAEtDG,EAAOD,EAAAA,SAAoBF,EAAC,MAA0B,EAEtDI,EAAUC,EAAAA,IAAwB,IAAI,EAEtCC,EAASC,WAAS,IAAMJ,EAAK,OAAS,CAACJ,EAAM,U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AA,eAAA,CAAqBb,EAAA,MAAM,QAAQ,KAAA,EACnD,SAAQA,EAAA,MAAM,aACd,UAASA,EAAA,MAAM,cACf,QAAOA,EAAA,MAAM,YACb,QAAOA,EAAA,MAAM,YACb,QAAOA,EAAA,MAAM,YACb,OAAMA,EAAA,MAAM,UAAA,2QAINU,EAAA,qBAAbM,EAAAA,YAAmEC,EAAAA,MAAAQ,EAAAA,KAAA,EAAA,OAAvC,GAAIjB,EAAA,KAAA,qBAAS,IAAkB,qCAAfE,EAAA,KAAY,EAAA,CAAA,CAAA,mBACvCV,EAAA,UAAU,oBAA3BgB,EAAAA,YAAwEC,EAAAA,MAAAS,EAAAA,IAAA,EAAA,OAAtC,GAAIjB,EAAA,KAAA,qBAAQ,IAAmB,CAAhBkB,EAAAA,gBAAAC,EAAAA,gBAAA5B,EAAA,SAAS,IAAI,EAAA,CAAA,CAAA"}
|
package/dist/picker.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import "./chunks/picker.css";import { defineComponent as M, useModel as
|
|
2
|
-
import { DatePicker as
|
|
3
|
-
import { MaskedTextBox as
|
|
4
|
-
import { Label as
|
|
1
|
+
import "./chunks/picker.css";import { defineComponent as M, useModel as x, ref as V, computed as n, openBlock as o, createElementBlock as $, createBlock as h, unref as l, withCtx as u, createTextVNode as y, toDisplayString as g, createCommentVNode as B, createVNode as f, mergeProps as R, mergeModels as D, withModifiers as q, withKeys as P } from "vue";
|
|
2
|
+
import { DatePicker as A, Calendar as N, TimePicker as z } from "@progress/kendo-vue-dateinputs";
|
|
3
|
+
import { MaskedTextBox as I } from "@progress/kendo-vue-inputs";
|
|
4
|
+
import { Label as T, Error as F, Hint as W } from "@progress/kendo-vue-labels";
|
|
5
5
|
import { usePopupTrap as E } from "@featherk/composables/trap";
|
|
6
6
|
import { _ as O } from "./chunks/shared-CHgC5LLL.mjs";
|
|
7
|
-
import { SvgIcon as
|
|
8
|
-
import { Popup as
|
|
9
|
-
import { Tooltip as
|
|
10
|
-
import { dateRangeIcon as
|
|
11
|
-
const S = (e) => e === "incomplete" ? "required" : e,
|
|
7
|
+
import { SvgIcon as H } from "@progress/kendo-vue-common";
|
|
8
|
+
import { Popup as L } from "@progress/kendo-vue-popup";
|
|
9
|
+
import { Tooltip as j } from "@progress/kendo-vue-tooltip";
|
|
10
|
+
import { dateRangeIcon as G } from "@featherk/icons";
|
|
11
|
+
const S = (e) => e === "incomplete" ? "required" : e, J = /* @__PURE__ */ M({
|
|
12
12
|
inheritAttrs: !1,
|
|
13
13
|
__name: "DateField",
|
|
14
|
-
props: /* @__PURE__ */
|
|
14
|
+
props: /* @__PURE__ */ D({
|
|
15
15
|
input: {},
|
|
16
16
|
label: {},
|
|
17
17
|
min: {},
|
|
@@ -27,49 +27,49 @@ const S = (e) => e === "incomplete" ? "required" : e, X = /* @__PURE__ */ M({
|
|
|
27
27
|
}),
|
|
28
28
|
emits: ["update:modelValue", "update:show"],
|
|
29
29
|
setup(e) {
|
|
30
|
-
const a = e,
|
|
31
|
-
const
|
|
32
|
-
if (!
|
|
30
|
+
const a = e, r = x(e, "modelValue"), d = x(e, "show"), b = V(null), k = n(() => d.value && !a.disabled && !a.readonly), m = n(() => `${a.input.id}-error`), w = n(() => `${a.input.id}-hint`), s = n(() => {
|
|
31
|
+
const v = a.input.validationMessage.value;
|
|
32
|
+
if (!v) return "";
|
|
33
33
|
const i = S(a.input.reason.value);
|
|
34
|
-
return i && a.messages?.error?.[i] ||
|
|
35
|
-
}),
|
|
34
|
+
return i && a.messages?.error?.[i] || v;
|
|
35
|
+
}), C = n(() => s.value ? m.value : a.messages?.hint ? w.value : void 0);
|
|
36
36
|
return E({
|
|
37
|
-
isOpen:
|
|
38
|
-
onRequestClose: () =>
|
|
39
|
-
triggerEl:
|
|
40
|
-
}), (
|
|
37
|
+
isOpen: k,
|
|
38
|
+
onRequestClose: () => d.value = !1,
|
|
39
|
+
triggerEl: b
|
|
40
|
+
}), (v, i) => (o(), $("div", {
|
|
41
41
|
ref_key: "rootRef",
|
|
42
|
-
ref:
|
|
42
|
+
ref: b,
|
|
43
43
|
class: "fk-datepicker fkui-picker"
|
|
44
44
|
}, [
|
|
45
|
-
e.label ? (o(),
|
|
45
|
+
e.label ? (o(), h(l(T), {
|
|
46
46
|
key: 0,
|
|
47
47
|
"editor-id": e.input.id
|
|
48
48
|
}, {
|
|
49
49
|
default: u(() => [
|
|
50
|
-
|
|
50
|
+
y(g(e.label), 1)
|
|
51
51
|
]),
|
|
52
52
|
_: 1
|
|
53
|
-
}, 8, ["editor-id"])) :
|
|
54
|
-
|
|
53
|
+
}, 8, ["editor-id"])) : B("", !0),
|
|
54
|
+
f(l(A), R({
|
|
55
55
|
"fill-mode": "outline",
|
|
56
56
|
rounded: "medium",
|
|
57
57
|
size: "medium"
|
|
58
|
-
},
|
|
59
|
-
"model-value":
|
|
58
|
+
}, v.$attrs, {
|
|
59
|
+
"model-value": r.value instanceof Date ? r.value : void 0,
|
|
60
60
|
"date-input": "masked",
|
|
61
61
|
min: e.min ?? e.input.min ?? void 0,
|
|
62
62
|
max: e.max ?? e.input.max ?? void 0,
|
|
63
63
|
valid: e.input.isValid.value,
|
|
64
|
-
"validation-message":
|
|
64
|
+
"validation-message": s.value,
|
|
65
65
|
disabled: e.disabled,
|
|
66
|
-
show:
|
|
67
|
-
"onUpdate:modelValue": i[0] || (i[0] = (
|
|
68
|
-
onOpen: i[1] || (i[1] = (
|
|
69
|
-
onClose: i[2] || (i[2] = (
|
|
66
|
+
show: k.value,
|
|
67
|
+
"onUpdate:modelValue": i[0] || (i[0] = (t) => r.value = t),
|
|
68
|
+
onOpen: i[1] || (i[1] = (t) => d.value = !e.readonly),
|
|
69
|
+
onClose: i[2] || (i[2] = (t) => d.value = !1)
|
|
70
70
|
}), {
|
|
71
71
|
masked: u(() => [
|
|
72
|
-
|
|
72
|
+
f(l(I), {
|
|
73
73
|
id: e.input.id,
|
|
74
74
|
mask: "00/00/0000",
|
|
75
75
|
value: e.input.raw.value,
|
|
@@ -77,7 +77,7 @@ const S = (e) => e === "incomplete" ? "required" : e, X = /* @__PURE__ */ M({
|
|
|
77
77
|
"show-clear-button": !1,
|
|
78
78
|
disabled: e.disabled,
|
|
79
79
|
readonly: e.readonly,
|
|
80
|
-
"aria-described-by":
|
|
80
|
+
"aria-described-by": C.value,
|
|
81
81
|
"input-attributes": { "aria-invalid": !e.input.isValid.value },
|
|
82
82
|
onChange: e.input.handleChange,
|
|
83
83
|
onKeydown: e.input.handleKeyDown,
|
|
@@ -89,29 +89,29 @@ const S = (e) => e === "incomplete" ? "required" : e, X = /* @__PURE__ */ M({
|
|
|
89
89
|
]),
|
|
90
90
|
_: 1
|
|
91
91
|
}, 16, ["model-value", "min", "max", "valid", "validation-message", "disabled", "show"]),
|
|
92
|
-
|
|
92
|
+
s.value ? (o(), h(l(F), {
|
|
93
93
|
key: 1,
|
|
94
|
-
id:
|
|
94
|
+
id: m.value
|
|
95
95
|
}, {
|
|
96
96
|
default: u(() => [
|
|
97
|
-
|
|
97
|
+
y(g(s.value), 1)
|
|
98
98
|
]),
|
|
99
99
|
_: 1
|
|
100
|
-
}, 8, ["id"])) : e.messages?.hint ? (o(),
|
|
100
|
+
}, 8, ["id"])) : e.messages?.hint ? (o(), h(l(W), {
|
|
101
101
|
key: 2,
|
|
102
102
|
id: w.value
|
|
103
103
|
}, {
|
|
104
104
|
default: u(() => [
|
|
105
|
-
|
|
105
|
+
y(g(e.messages.hint), 1)
|
|
106
106
|
]),
|
|
107
107
|
_: 1
|
|
108
|
-
}, 8, ["id"])) :
|
|
108
|
+
}, 8, ["id"])) : B("", !0)
|
|
109
109
|
], 512));
|
|
110
110
|
}
|
|
111
|
-
}),
|
|
111
|
+
}), oe = /* @__PURE__ */ O(J, [["__scopeId", "data-v-9598aad4"]]), Q = { class: "fk-daterangepicker fkui-picker" }, X = /* @__PURE__ */ M({
|
|
112
112
|
inheritAttrs: !1,
|
|
113
113
|
__name: "DateRangeField",
|
|
114
|
-
props: /* @__PURE__ */
|
|
114
|
+
props: /* @__PURE__ */ D({
|
|
115
115
|
input: {},
|
|
116
116
|
label: {},
|
|
117
117
|
min: {},
|
|
@@ -129,134 +129,116 @@ const S = (e) => e === "incomplete" ? "required" : e, X = /* @__PURE__ */ M({
|
|
|
129
129
|
}),
|
|
130
130
|
emits: ["update:modelValue", "update:show"],
|
|
131
131
|
setup(e) {
|
|
132
|
-
const a = e,
|
|
133
|
-
!a.disabled && !a.readonly && (
|
|
134
|
-
},
|
|
135
|
-
const
|
|
136
|
-
return Number.isFinite(
|
|
137
|
-
}),
|
|
132
|
+
const a = e, r = x(e, "modelValue"), d = x(e, "show"), b = (c) => r.value = c, k = V(null), m = n(() => d.value && !a.disabled && !a.readonly), w = () => {
|
|
133
|
+
!a.disabled && !a.readonly && (d.value = !d.value);
|
|
134
|
+
}, s = n(() => {
|
|
135
|
+
const c = Math.trunc(a.views ?? 4);
|
|
136
|
+
return Number.isFinite(c) ? Math.min(Math.max(c, 1), 4) : 4;
|
|
137
|
+
}), C = n(() => `${a.input.id}-calendar`), v = n(() => `${a.input.id}-error`), i = n(() => `${a.input.id}-hint`), t = n(() => {
|
|
138
138
|
if (a.input.validComputed.value !== !1) return "";
|
|
139
|
-
const
|
|
140
|
-
return
|
|
141
|
-
}),
|
|
142
|
-
if (C.value) return y.value;
|
|
143
|
-
const s = [
|
|
144
|
-
a.input.validComputed.value && a.input.spanDays.value ? d.value : "",
|
|
145
|
-
a.messages?.hint ? i.value : ""
|
|
146
|
-
].filter(Boolean);
|
|
147
|
-
return s.length ? s.join(" ") : void 0;
|
|
148
|
-
});
|
|
139
|
+
const c = S(a.input.reason.value);
|
|
140
|
+
return c && a.messages?.error?.[c] || a.input.validationMessage.value;
|
|
141
|
+
}), p = n(() => t.value ? v.value : a.messages?.hint ? i.value : void 0);
|
|
149
142
|
return E({
|
|
150
|
-
isOpen:
|
|
151
|
-
onRequestClose: () =>
|
|
143
|
+
isOpen: m,
|
|
144
|
+
onRequestClose: () => d.value = !1,
|
|
152
145
|
triggerEl: n(
|
|
153
|
-
() =>
|
|
146
|
+
() => k.value?.$el ?? null
|
|
154
147
|
),
|
|
155
148
|
popupSelector: [".k-calendar", ".k-popup"]
|
|
156
|
-
}), (
|
|
157
|
-
e.label ? (o(),
|
|
149
|
+
}), (c, K) => (o(), $("div", Q, [
|
|
150
|
+
e.label ? (o(), h(l(T), {
|
|
158
151
|
key: 0,
|
|
159
152
|
"editor-id": e.input.id
|
|
160
153
|
}, {
|
|
161
154
|
default: u(() => [
|
|
162
|
-
|
|
155
|
+
y(g(e.label), 1)
|
|
156
|
+
]),
|
|
157
|
+
_: 1
|
|
158
|
+
}, 8, ["editor-id"])) : B("", !0),
|
|
159
|
+
f(l(I), R({
|
|
160
|
+
ref_key: "maskedTextBoxRef",
|
|
161
|
+
ref: k,
|
|
162
|
+
"fill-mode": "outline",
|
|
163
|
+
rounded: "medium",
|
|
164
|
+
size: "medium"
|
|
165
|
+
}, c.$attrs, {
|
|
166
|
+
id: e.input.id,
|
|
167
|
+
disabled: e.disabled,
|
|
168
|
+
readonly: e.readonly,
|
|
169
|
+
"show-clear-button": e.showClearButton && !e.disabled && !e.readonly,
|
|
170
|
+
placeholder: e.messages?.placeholder ?? "Start Date - End Date",
|
|
171
|
+
mask: "00/00/0000 - 00/00/0000",
|
|
172
|
+
value: e.input.raw.value,
|
|
173
|
+
valid: e.input.validComputed.value,
|
|
174
|
+
"aria-described-by": p.value,
|
|
175
|
+
"input-attributes": {
|
|
176
|
+
"aria-invalid": e.input.validComputed.value === !1,
|
|
177
|
+
"aria-haspopup": "grid",
|
|
178
|
+
"aria-expanded": m.value,
|
|
179
|
+
"aria-controls": C.value
|
|
180
|
+
},
|
|
181
|
+
"input-suffix": "calendar-suffix",
|
|
182
|
+
onChange: e.input.handleChange,
|
|
183
|
+
onKeydown: e.input.handleKeyDown,
|
|
184
|
+
onKeyup: e.input.handleKeyUp,
|
|
185
|
+
onWheel: e.input.handleWheel,
|
|
186
|
+
onClick: e.input.handleClick,
|
|
187
|
+
onBlur: e.input.handleBlur,
|
|
188
|
+
onFocus: K[0] || (K[0] = (U) => d.value = !1)
|
|
189
|
+
}), {
|
|
190
|
+
"calendar-suffix": u(() => [
|
|
191
|
+
f(l(H), {
|
|
192
|
+
icon: l(G),
|
|
193
|
+
class: "fkui-calendar-toggle",
|
|
194
|
+
onMousedown: q(w, ["prevent", "stop"])
|
|
195
|
+
}, null, 8, ["icon"])
|
|
163
196
|
]),
|
|
164
197
|
_: 1
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
g(l(T), R({
|
|
168
|
-
ref_key: "maskedTextBoxRef",
|
|
169
|
-
ref: b,
|
|
170
|
-
"fill-mode": "outline",
|
|
171
|
-
rounded: "medium",
|
|
172
|
-
size: "medium"
|
|
173
|
-
}, s.$attrs, {
|
|
174
|
-
id: e.input.id,
|
|
175
|
-
disabled: e.disabled,
|
|
176
|
-
readonly: e.readonly,
|
|
177
|
-
"show-clear-button": e.showClearButton && !e.disabled && !e.readonly,
|
|
178
|
-
placeholder: e.messages?.placeholder ?? "Start Date - End Date",
|
|
179
|
-
mask: "00/00/0000 - 00/00/0000",
|
|
180
|
-
value: e.input.raw.value,
|
|
181
|
-
valid: e.input.validComputed.value,
|
|
182
|
-
"aria-described-by": U.value,
|
|
183
|
-
"input-attributes": {
|
|
184
|
-
"aria-invalid": e.input.validComputed.value === !1,
|
|
185
|
-
"aria-haspopup": "grid",
|
|
186
|
-
"aria-expanded": h.value,
|
|
187
|
-
"aria-controls": x.value
|
|
188
|
-
},
|
|
189
|
-
"input-suffix": "calendar-suffix",
|
|
190
|
-
onChange: e.input.handleChange,
|
|
191
|
-
onKeydown: e.input.handleKeyDown,
|
|
192
|
-
onKeyup: e.input.handleKeyUp,
|
|
193
|
-
onWheel: e.input.handleWheel,
|
|
194
|
-
onClick: e.input.handleClick,
|
|
195
|
-
onBlur: e.input.handleBlur,
|
|
196
|
-
onFocus: V[0] || (V[0] = (q) => t.value = !1)
|
|
197
|
-
}), {
|
|
198
|
-
"calendar-suffix": u(() => [
|
|
199
|
-
g(l(L), {
|
|
200
|
-
icon: l(Q),
|
|
201
|
-
class: "fkui-calendar-toggle",
|
|
202
|
-
onMousedown: P(w, ["prevent", "stop"])
|
|
203
|
-
}, null, 8, ["icon"])
|
|
204
|
-
]),
|
|
205
|
-
_: 1
|
|
206
|
-
}, 16, ["id", "disabled", "readonly", "show-clear-button", "placeholder", "value", "valid", "aria-described-by", "input-attributes", "onChange", "onKeydown", "onKeyup", "onWheel", "onClick", "onBlur"]),
|
|
207
|
-
e.input.validComputed.value && e.input.spanDays.value ? (o(), c(l(K), {
|
|
208
|
-
key: 0,
|
|
209
|
-
id: d.value
|
|
210
|
-
}, {
|
|
211
|
-
default: u(() => [
|
|
212
|
-
f(" (" + m(e.input.spanDays.value) + " day" + m(e.input.spanDays.value === 1 ? "" : "s") + ") ", 1)
|
|
213
|
-
]),
|
|
214
|
-
_: 1
|
|
215
|
-
}, 8, ["id"])) : p("", !0)
|
|
216
|
-
]),
|
|
217
|
-
C.value ? (o(), c(l(W), {
|
|
198
|
+
}, 16, ["id", "disabled", "readonly", "show-clear-button", "placeholder", "value", "valid", "aria-described-by", "input-attributes", "onChange", "onKeydown", "onKeyup", "onWheel", "onClick", "onBlur"]),
|
|
199
|
+
t.value ? (o(), h(l(F), {
|
|
218
200
|
key: 1,
|
|
219
|
-
id:
|
|
201
|
+
id: v.value
|
|
220
202
|
}, {
|
|
221
203
|
default: u(() => [
|
|
222
|
-
|
|
204
|
+
y(g(t.value), 1)
|
|
223
205
|
]),
|
|
224
206
|
_: 1
|
|
225
|
-
}, 8, ["id"])) : e.messages?.hint ? (o(),
|
|
207
|
+
}, 8, ["id"])) : e.messages?.hint ? (o(), h(l(W), {
|
|
226
208
|
key: 2,
|
|
227
209
|
id: i.value
|
|
228
210
|
}, {
|
|
229
211
|
default: u(() => [
|
|
230
|
-
|
|
212
|
+
y(g(e.messages.hint), 1)
|
|
231
213
|
]),
|
|
232
214
|
_: 1
|
|
233
|
-
}, 8, ["id"])) :
|
|
234
|
-
|
|
215
|
+
}, 8, ["id"])) : B("", !0),
|
|
216
|
+
f(l(L), {
|
|
235
217
|
anchor: "maskedTextBoxRef",
|
|
236
|
-
show:
|
|
218
|
+
show: m.value,
|
|
237
219
|
animate: !1,
|
|
238
220
|
class: "fkui-range-popup"
|
|
239
221
|
}, {
|
|
240
222
|
default: u(() => [
|
|
241
|
-
|
|
223
|
+
f(l(j), {
|
|
242
224
|
"anchor-element": "pointer",
|
|
243
225
|
position: "top",
|
|
244
226
|
"open-delay": 280,
|
|
245
227
|
"parent-title": !0
|
|
246
228
|
}, {
|
|
247
229
|
default: u(() => [
|
|
248
|
-
|
|
249
|
-
id:
|
|
250
|
-
"model-value":
|
|
230
|
+
f(l(N), {
|
|
231
|
+
id: C.value,
|
|
232
|
+
"model-value": r.value ?? void 0,
|
|
251
233
|
class: "fkui-range-calendar",
|
|
252
234
|
mode: "range",
|
|
253
235
|
"allow-reverse": !1,
|
|
254
|
-
views:
|
|
236
|
+
views: s.value,
|
|
255
237
|
min: e.min ?? e.input.min,
|
|
256
238
|
max: e.max ?? e.input.max,
|
|
257
|
-
"onUpdate:modelValue":
|
|
239
|
+
"onUpdate:modelValue": b,
|
|
258
240
|
onChange: e.input.onCalendarChange,
|
|
259
|
-
onKeydown:
|
|
241
|
+
onKeydown: K[1] || (K[1] = P((U) => d.value = !1, ["escape"]))
|
|
260
242
|
}, null, 8, ["id", "model-value", "views", "min", "max", "onChange"])
|
|
261
243
|
]),
|
|
262
244
|
_: 1
|
|
@@ -266,10 +248,10 @@ const S = (e) => e === "incomplete" ? "required" : e, X = /* @__PURE__ */ M({
|
|
|
266
248
|
}, 8, ["show"])
|
|
267
249
|
]));
|
|
268
250
|
}
|
|
269
|
-
}),
|
|
251
|
+
}), se = /* @__PURE__ */ O(X, [["__scopeId", "data-v-8b45610e"]]), Y = /* @__PURE__ */ M({
|
|
270
252
|
inheritAttrs: !1,
|
|
271
253
|
__name: "TimeField",
|
|
272
|
-
props: /* @__PURE__ */
|
|
254
|
+
props: /* @__PURE__ */ D({
|
|
273
255
|
input: {},
|
|
274
256
|
label: {},
|
|
275
257
|
min: {},
|
|
@@ -285,57 +267,57 @@ const S = (e) => e === "incomplete" ? "required" : e, X = /* @__PURE__ */ M({
|
|
|
285
267
|
}),
|
|
286
268
|
emits: ["update:modelValue", "update:show"],
|
|
287
269
|
setup(e) {
|
|
288
|
-
const a = e,
|
|
270
|
+
const a = e, r = x(e, "modelValue"), d = x(e, "show"), b = V(null), k = n(() => d.value && !a.disabled && !a.readonly), m = n(() => `${a.input.id}-error`), w = n(() => `${a.input.id}-hint`), s = n(() => {
|
|
289
271
|
const i = a.input.validationMessage.value;
|
|
290
272
|
if (!i) return "";
|
|
291
|
-
const
|
|
292
|
-
return
|
|
293
|
-
}),
|
|
294
|
-
isOpen:
|
|
295
|
-
onRequestClose: () =>
|
|
296
|
-
triggerEl:
|
|
273
|
+
const t = S(a.input.reason.value);
|
|
274
|
+
return t && a.messages?.error?.[t] || i;
|
|
275
|
+
}), C = n(() => s.value ? m.value : a.messages?.hint ? w.value : void 0), v = E({
|
|
276
|
+
isOpen: k,
|
|
277
|
+
onRequestClose: () => d.value = !1,
|
|
278
|
+
triggerEl: b,
|
|
297
279
|
popupSelector: [".k-timeselector", ".k-popup"],
|
|
298
280
|
focusTrapOptions: {
|
|
299
281
|
// TimePicker focuses its time list before the trap activates, so the
|
|
300
282
|
// trap's default return target is removed with the popup (Set, Now, Cancel).
|
|
301
|
-
setReturnFocus: () =>
|
|
283
|
+
setReturnFocus: () => v.lastCloseReason.value === "outside" ? !1 : b.value?.querySelector("input") ?? !1
|
|
302
284
|
}
|
|
303
285
|
});
|
|
304
|
-
return (i,
|
|
286
|
+
return (i, t) => (o(), $("div", {
|
|
305
287
|
ref_key: "rootRef",
|
|
306
|
-
ref:
|
|
288
|
+
ref: b,
|
|
307
289
|
class: "fk-timepicker fkui-picker"
|
|
308
290
|
}, [
|
|
309
|
-
e.label ? (o(),
|
|
291
|
+
e.label ? (o(), h(l(T), {
|
|
310
292
|
key: 0,
|
|
311
293
|
"editor-id": e.input.id
|
|
312
294
|
}, {
|
|
313
295
|
default: u(() => [
|
|
314
|
-
|
|
296
|
+
y(g(e.label), 1)
|
|
315
297
|
]),
|
|
316
298
|
_: 1
|
|
317
|
-
}, 8, ["editor-id"])) :
|
|
318
|
-
|
|
299
|
+
}, 8, ["editor-id"])) : B("", !0),
|
|
300
|
+
f(l(z), R({
|
|
319
301
|
"fill-mode": "outline",
|
|
320
302
|
rounded: "medium",
|
|
321
303
|
size: "medium",
|
|
322
304
|
format: "hh:mm a"
|
|
323
305
|
}, i.$attrs, {
|
|
324
|
-
"model-value":
|
|
306
|
+
"model-value": r.value instanceof Date ? r.value : void 0,
|
|
325
307
|
"date-input": "masked",
|
|
326
308
|
min: e.min ?? e.input.min ?? void 0,
|
|
327
309
|
max: e.max ?? e.input.max ?? void 0,
|
|
328
310
|
valid: e.input.isValid.value,
|
|
329
|
-
"validation-message":
|
|
311
|
+
"validation-message": s.value,
|
|
330
312
|
disabled: e.disabled,
|
|
331
|
-
show:
|
|
313
|
+
show: k.value,
|
|
332
314
|
onChange: e.input.handleChange,
|
|
333
|
-
"onUpdate:modelValue":
|
|
334
|
-
onOpen:
|
|
335
|
-
onClose:
|
|
315
|
+
"onUpdate:modelValue": t[0] || (t[0] = (p) => r.value = p),
|
|
316
|
+
onOpen: t[1] || (t[1] = (p) => d.value = !e.readonly),
|
|
317
|
+
onClose: t[2] || (t[2] = (p) => d.value = !1)
|
|
336
318
|
}), {
|
|
337
319
|
masked: u(() => [
|
|
338
|
-
|
|
320
|
+
f(l(I), {
|
|
339
321
|
id: e.input.id,
|
|
340
322
|
mask: "Hh:Mm Aa",
|
|
341
323
|
rules: e.input.rules,
|
|
@@ -344,7 +326,7 @@ const S = (e) => e === "incomplete" ? "required" : e, X = /* @__PURE__ */ M({
|
|
|
344
326
|
"show-clear-button": !1,
|
|
345
327
|
disabled: e.disabled,
|
|
346
328
|
readonly: e.readonly,
|
|
347
|
-
"aria-described-by":
|
|
329
|
+
"aria-described-by": C.value,
|
|
348
330
|
"input-attributes": { "aria-invalid": !e.input.isValid.value },
|
|
349
331
|
onChange: e.input.handleChange,
|
|
350
332
|
onKeydown: e.input.handleKeyDown,
|
|
@@ -356,29 +338,29 @@ const S = (e) => e === "incomplete" ? "required" : e, X = /* @__PURE__ */ M({
|
|
|
356
338
|
]),
|
|
357
339
|
_: 1
|
|
358
340
|
}, 16, ["model-value", "min", "max", "valid", "validation-message", "disabled", "show", "onChange"]),
|
|
359
|
-
|
|
341
|
+
s.value ? (o(), h(l(F), {
|
|
360
342
|
key: 1,
|
|
361
|
-
id:
|
|
343
|
+
id: m.value
|
|
362
344
|
}, {
|
|
363
345
|
default: u(() => [
|
|
364
|
-
|
|
346
|
+
y(g(s.value), 1)
|
|
365
347
|
]),
|
|
366
348
|
_: 1
|
|
367
|
-
}, 8, ["id"])) : e.messages?.hint ? (o(),
|
|
349
|
+
}, 8, ["id"])) : e.messages?.hint ? (o(), h(l(W), {
|
|
368
350
|
key: 2,
|
|
369
351
|
id: w.value
|
|
370
352
|
}, {
|
|
371
353
|
default: u(() => [
|
|
372
|
-
|
|
354
|
+
y(g(e.messages.hint), 1)
|
|
373
355
|
]),
|
|
374
356
|
_: 1
|
|
375
|
-
}, 8, ["id"])) :
|
|
357
|
+
}, 8, ["id"])) : B("", !0)
|
|
376
358
|
], 512));
|
|
377
359
|
}
|
|
378
|
-
}),
|
|
360
|
+
}), re = /* @__PURE__ */ O(Y, [["__scopeId", "data-v-33cb65f4"]]);
|
|
379
361
|
export {
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
362
|
+
oe as DateField,
|
|
363
|
+
se as DateRangeField,
|
|
364
|
+
re as TimeField
|
|
383
365
|
};
|
|
384
366
|
//# sourceMappingURL=picker.mjs.map
|
package/dist/picker.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picker.mjs","sources":["../src/picker/errorKey.ts","../src/picker/DateField.vue","../src/picker/DateRangeField.vue","../src/picker/TimeField.vue"],"sourcesContent":["// The composables report a missing value as \"incomplete\"; messages call it\n// \"required\" to match USAddressMessages.\nexport const toErrorKey = <TKey extends string>(reason: string | undefined) =>\n (reason === \"incomplete\" ? \"required\" : reason) as TKey | undefined;\n","<template>\n <div ref=\"rootRef\" class=\"fk-datepicker fkui-picker\">\n <Label v-if=\"label\" :editor-id=\"input.id\">{{ label }}</Label>\n <DatePicker\n fill-mode=\"outline\"\n rounded=\"medium\"\n size=\"medium\"\n v-bind=\"$attrs\"\n :model-value=\"model instanceof Date ? model : undefined\"\n date-input=\"masked\"\n :min=\"min ?? input.min ?? undefined\"\n :max=\"max ?? input.max ?? undefined\"\n :valid=\"input.isValid.value\"\n :validation-message=\"errorMessage\"\n :disabled=\"disabled\"\n :show=\"isOpen\"\n @update:model-value=\"model = $event\"\n @open=\"show = !readonly\"\n @close=\"show = false\"\n >\n <template #masked>\n <MaskedTextBox\n :id=\"input.id\"\n mask=\"00/00/0000\"\n :value=\"input.raw.value\"\n :placeholder=\"messages?.placeholder ?? input.placeholder.value\"\n :show-clear-button=\"false\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :aria-described-by=\"describedBy\"\n :input-attributes=\"{ 'aria-invalid': !input.isValid.value }\"\n @change=\"input.handleChange\"\n @keydown=\"input.handleKeyDown\"\n @keyup=\"input.handleKeyUp\"\n @click=\"input.handleClick\"\n @wheel=\"input.handleWheel\"\n @blur=\"input.handleBlur\"\n />\n </template>\n </DatePicker>\n <Error v-if=\"errorMessage\" :id=\"errorId\">{{ errorMessage }}</Error>\n <Hint v-else-if=\"messages?.hint\" :id=\"hintId\">{{ messages.hint }}</Hint>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\nimport { DatePicker } from \"@progress/kendo-vue-dateinputs\";\nimport { MaskedTextBox } from \"@progress/kendo-vue-inputs\";\nimport { Error, Hint, Label } from \"@progress/kendo-vue-labels\";\nimport { usePopupTrap } from \"@featherk/composables/trap\";\nimport type { UseMaskedDateInputReturn } from \"@featherk/composables/date\";\nimport type { DateFieldMessages, DateFieldErrorKey } from \"./types\";\nimport { toErrorKey } from \"./errorKey\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = defineProps<{\n /** Return value of `useMaskedDateInput`. */\n input: UseMaskedDateInputReturn;\n label?: string;\n /** Calendar bounds; default to the composable's `min`/`max`. */\n min?: Date;\n max?: Date;\n messages?: DateFieldMessages;\n /** Also applied to the masked input, which Kendo's picker does not reach. */\n disabled?: boolean;\n readonly?: boolean;\n}>();\n\n/** Must be the same ref passed to `useMaskedDateInput` as `externalValue`. */\nconst model = defineModel<Date | string | null | undefined>();\n/** Must be the same ref the composable's `onShowCalendar` opens. */\nconst show = defineModel<boolean>(\"show\", { default: false });\n\nconst rootRef = ref<HTMLElement | null>(null);\n// A locked field never shows its popup, even if the parent sets `show`, so its selection can't write the model.\nconst isOpen = computed(() => show.value && !props.disabled && !props.readonly);\nconst errorId = computed(() => `${props.input.id}-error`);\nconst hintId = computed(() => `${props.input.id}-hint`);\n\n// The composable decides when an error shows; messages only replace its text.\nconst errorMessage = computed(() => {\n const fallback = props.input.validationMessage.value;\n if (!fallback) return \"\";\n const key = toErrorKey<DateFieldErrorKey>(props.input.reason.value);\n return (key && props.messages?.error?.[key]) || fallback;\n});\n\nconst describedBy = computed(() => {\n if (errorMessage.value) return errorId.value;\n return props.messages?.hint ? hintId.value : undefined;\n});\n\nusePopupTrap({\n isOpen,\n onRequestClose: () => (show.value = false),\n triggerEl: rootRef,\n});\n</script>\n\n<style scoped>\n.fkui-picker {\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n}\n</style>\n","<template>\n <div class=\"fk-daterangepicker fkui-picker\">\n <Label v-if=\"label\" :editor-id=\"input.id\">{{ label }}</Label>\n <div class=\"fkui-picker-row\">\n <MaskedTextBox\n ref=\"maskedTextBoxRef\"\n fill-mode=\"outline\"\n rounded=\"medium\"\n size=\"medium\"\n v-bind=\"$attrs\"\n :id=\"input.id\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :show-clear-button=\"showClearButton && !disabled && !readonly\"\n :placeholder=\"messages?.placeholder ?? 'Start Date - End Date'\"\n mask=\"00/00/0000 - 00/00/0000\"\n :value=\"input.raw.value\"\n :valid=\"input.validComputed.value\"\n :aria-described-by=\"describedBy\"\n :input-attributes=\"{\n 'aria-invalid': input.validComputed.value === false,\n 'aria-haspopup': 'grid',\n 'aria-expanded': isOpen,\n 'aria-controls': calendarId,\n }\"\n input-suffix=\"calendar-suffix\"\n @change=\"input.handleChange\"\n @keydown=\"input.handleKeyDown\"\n @keyup=\"input.handleKeyUp\"\n @wheel=\"input.handleWheel\"\n @click=\"input.handleClick\"\n @blur=\"input.handleBlur\"\n @focus=\"show = false\"\n >\n <template #calendar-suffix>\n <!-- mousedown.prevent keeps focus in the input; keyboard users open the calendar from the input. -->\n <SvgIcon\n :icon=\"dateRangeIcon\"\n class=\"fkui-calendar-toggle\"\n @mousedown.prevent.stop=\"toggleCalendar\"\n />\n </template>\n </MaskedTextBox>\n <Hint\n v-if=\"input.validComputed.value && input.spanDays.value\"\n :id=\"spanId\"\n >\n ({{ input.spanDays.value }} day{{\n input.spanDays.value === 1 ? \"\" : \"s\"\n }})\n </Hint>\n </div>\n <Error v-if=\"errorMessage\" :id=\"errorId\">{{ errorMessage }}</Error>\n <Hint v-else-if=\"messages?.hint\" :id=\"hintId\">{{ messages.hint }}</Hint>\n\n <Popup\n anchor=\"maskedTextBoxRef\"\n :show=\"isOpen\"\n :animate=\"false\"\n class=\"fkui-range-popup\"\n >\n <Tooltip\n anchor-element=\"pointer\"\n position=\"top\"\n :open-delay=\"280\"\n :parent-title=\"true\"\n >\n <Calendar\n :id=\"calendarId\"\n :model-value=\"model ?? undefined\"\n class=\"fkui-range-calendar\"\n mode=\"range\"\n :allow-reverse=\"false\"\n :views=\"calendarViews\"\n :min=\"min ?? input.min\"\n :max=\"max ?? input.max\"\n @update:model-value=\"onCalendarValue\"\n @change=\"input.onCalendarChange\"\n @keydown.escape=\"show = false\"\n />\n </Tooltip>\n </Popup>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\nimport { Calendar, type SelectionRange } from \"@progress/kendo-vue-dateinputs\";\nimport { MaskedTextBox } from \"@progress/kendo-vue-inputs\";\nimport { Error, Hint, Label } from \"@progress/kendo-vue-labels\";\nimport { SvgIcon } from \"@progress/kendo-vue-common\";\nimport { Popup } from \"@progress/kendo-vue-popup\";\nimport { Tooltip } from \"@progress/kendo-vue-tooltip\";\nimport { dateRangeIcon } from \"@featherk/icons\";\nimport { usePopupTrap } from \"@featherk/composables/trap\";\nimport type { UseMaskedDateRangeInputReturn } from \"@featherk/composables/range\";\nimport type { DateRangeFieldErrorKey, DateRangeFieldMessages } from \"./types\";\nimport { toErrorKey } from \"./errorKey\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = withDefaults(\n defineProps<{\n /** Return value of `useMaskedDateRangeInput`. */\n input: UseMaskedDateRangeInputReturn;\n label?: string;\n /** Calendar bounds; default to the composable's `min`/`max`. */\n min?: Date;\n max?: Date;\n messages?: DateRangeFieldMessages;\n disabled?: boolean;\n readonly?: boolean;\n /** Hidden while disabled or readonly, since Kendo's clear button ignores both. */\n showClearButton?: boolean;\n /** Months shown in the calendar, 1 to 4 (default 4). */\n views?: 1 | 2 | 3 | 4;\n }>(),\n { showClearButton: true },\n);\n\n/** Must be the same ref passed to `useMaskedDateRangeInput` as `externalValue`. */\nconst model = defineModel<SelectionRange | null | undefined>();\n/** Must be the same ref passed to the composable as `isOpen`. */\nconst show = defineModel<boolean>(\"show\", { default: false });\n\n// Kendo Calendar's model type has no null, and in range mode it always emits a SelectionRange.\nconst onCalendarValue = (value: unknown) =>\n (model.value = value as SelectionRange);\n\nconst maskedTextBoxRef = ref<InstanceType<typeof MaskedTextBox> | null>(null);\n\n// A locked field never shows its popup, even if the parent sets `show`, so its selection can't write the model.\nconst isOpen = computed(() => show.value && !props.disabled && !props.readonly);\n\nconst toggleCalendar = () => {\n if (!props.disabled && !props.readonly) show.value = !show.value;\n};\n\n// Clamped for untyped callers; the external styles are laid out for at most four months.\nconst calendarViews = computed(() => {\n const views = Math.trunc(props.views ?? 4);\n return Number.isFinite(views) ? Math.min(Math.max(views, 1), 4) : 4;\n});\n\nconst calendarId = computed(() => `${props.input.id}-calendar`);\nconst errorId = computed(() => `${props.input.id}-error`);\nconst hintId = computed(() => `${props.input.id}-hint`);\nconst spanId = computed(() => `${props.input.id}-span`);\n\n// The composable decides when an error shows; messages only replace its text.\nconst errorMessage = computed(() => {\n if (props.input.validComputed.value !== false) return \"\";\n const key = toErrorKey<DateRangeFieldErrorKey>(props.input.reason.value);\n return (\n (key && props.messages?.error?.[key]) || props.input.validationMessage.value\n );\n});\n\nconst describedBy = computed(() => {\n if (errorMessage.value) return errorId.value;\n const ids = [\n props.input.validComputed.value && props.input.spanDays.value\n ? spanId.value\n : \"\",\n props.messages?.hint ? hintId.value : \"\",\n ].filter(Boolean);\n return ids.length ? ids.join(\" \") : undefined;\n});\n\nusePopupTrap({\n isOpen,\n onRequestClose: () => (show.value = false),\n triggerEl: computed(\n () => (maskedTextBoxRef.value?.$el as HTMLElement | undefined) ?? null,\n ),\n popupSelector: [\".k-calendar\", \".k-popup\"],\n});\n</script>\n\n<style scoped>\n.fkui-picker {\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n}\n.fkui-picker-row {\n display: inline-flex;\n align-items: center;\n gap: 1em;\n}\n.fkui-range-calendar {\n overscroll-behavior: contain;\n}\n</style>\n","<template>\n <div ref=\"rootRef\" class=\"fk-timepicker fkui-picker\">\n <Label v-if=\"label\" :editor-id=\"input.id\">{{ label }}</Label>\n <TimePicker\n fill-mode=\"outline\"\n rounded=\"medium\"\n size=\"medium\"\n format=\"hh:mm a\"\n v-bind=\"$attrs\"\n :model-value=\"model instanceof Date ? model : undefined\"\n date-input=\"masked\"\n :min=\"min ?? input.min ?? undefined\"\n :max=\"max ?? input.max ?? undefined\"\n :valid=\"input.isValid.value\"\n :validation-message=\"errorMessage\"\n :disabled=\"disabled\"\n :show=\"isOpen\"\n @change=\"input.handleChange\"\n @update:model-value=\"model = $event\"\n @open=\"show = !readonly\"\n @close=\"show = false\"\n >\n <template #masked>\n <MaskedTextBox\n :id=\"input.id\"\n mask=\"Hh:Mm Aa\"\n :rules=\"input.rules\"\n :value=\"input.raw.value\"\n :placeholder=\"messages?.placeholder ?? input.placeholder.value\"\n :show-clear-button=\"false\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :aria-described-by=\"describedBy\"\n :input-attributes=\"{ 'aria-invalid': !input.isValid.value }\"\n @change=\"input.handleChange\"\n @keydown=\"input.handleKeyDown\"\n @keyup=\"input.handleKeyUp\"\n @click=\"input.handleClick\"\n @wheel=\"input.handleWheel\"\n @blur=\"input.handleBlur\"\n />\n </template>\n </TimePicker>\n <Error v-if=\"errorMessage\" :id=\"errorId\">{{ errorMessage }}</Error>\n <Hint v-else-if=\"messages?.hint\" :id=\"hintId\">{{ messages.hint }}</Hint>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\nimport { TimePicker } from \"@progress/kendo-vue-dateinputs\";\nimport { MaskedTextBox } from \"@progress/kendo-vue-inputs\";\nimport { Error, Hint, Label } from \"@progress/kendo-vue-labels\";\nimport { usePopupTrap } from \"@featherk/composables/trap\";\nimport type { UseMaskedTimeInputReturn } from \"@featherk/composables/time\";\nimport type { TimeFieldMessages, TimeFieldErrorKey } from \"./types\";\nimport { toErrorKey } from \"./errorKey\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = defineProps<{\n /** Return value of `useMaskedTimeInput`. */\n input: UseMaskedTimeInputReturn;\n label?: string;\n /** Time list bounds; default to the composable's `min`/`max`. */\n min?: Date;\n max?: Date;\n messages?: TimeFieldMessages;\n /** Also applied to the masked input, which Kendo's picker does not reach. */\n disabled?: boolean;\n readonly?: boolean;\n}>();\n\n/** Must be the same ref passed to `useMaskedTimeInput` as `externalValue`. */\nconst model = defineModel<Date | string | null | undefined>();\n/** Must be the same ref the composable's `onShowPicker` opens. */\nconst show = defineModel<boolean>(\"show\", { default: false });\n\nconst rootRef = ref<HTMLElement | null>(null);\n// A locked field never shows its popup, even if the parent sets `show`, so its selection can't write the model.\nconst isOpen = computed(() => show.value && !props.disabled && !props.readonly);\nconst errorId = computed(() => `${props.input.id}-error`);\nconst hintId = computed(() => `${props.input.id}-hint`);\n\n// The composable decides when an error shows; messages only replace its text.\nconst errorMessage = computed(() => {\n const fallback = props.input.validationMessage.value;\n if (!fallback) return \"\";\n const key = toErrorKey<TimeFieldErrorKey>(props.input.reason.value);\n return (key && props.messages?.error?.[key]) || fallback;\n});\n\nconst describedBy = computed(() => {\n if (errorMessage.value) return errorId.value;\n return props.messages?.hint ? hintId.value : undefined;\n});\n\nconst trap = usePopupTrap({\n isOpen,\n onRequestClose: () => (show.value = false),\n triggerEl: rootRef,\n popupSelector: [\".k-timeselector\", \".k-popup\"],\n focusTrapOptions: {\n // TimePicker focuses its time list before the trap activates, so the\n // trap's default return target is removed with the popup (Set, Now, Cancel).\n setReturnFocus: () =>\n trap.lastCloseReason.value === \"outside\"\n ? false\n : (rootRef.value?.querySelector(\"input\") ?? false),\n },\n});\n</script>\n\n<style scoped>\n.fkui-picker {\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n}\n</style>\n"],"names":["toErrorKey","reason","props","__props","model","_useModel","show","rootRef","ref","isOpen","computed","errorId","hintId","errorMessage","fallback","key","describedBy","usePopupTrap","_createElementBlock","_createBlock","_unref","Label","_createVNode","_mergeProps","$attrs","_cache","$event","MaskedTextBox","Error","Hint","_createTextVNode","_toDisplayString","onCalendarValue","value","maskedTextBoxRef","toggleCalendar","calendarViews","views","calendarId","spanId","ids","_openBlock","_hoisted_1","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AA,QAAI;AAAA,MAAA;QAED,UACT,MAiBE;AAAA,UAjBFgB,EAiBEF,EAAAO,CAAA,GAAA;AAAA,YAhBC,IAAIxB,EAAA,MAAM;AAAA,YACX,MAAK;AAAA,YACJ,OAAOA,EAAA,MAAM;AAAA,YACb,OAAOA,EAAA,MAAM,IAAI;AAAA,YACjB,aAAaA,YAAU,eAAeA,EAAA,MAAM,YAAY;AAAA,YACxD,qBAAmB;AAAA,YACnB,UAAUA,EAAA;AAAA,YACV,UAAUA,EAAA;AAAA,YACV,qBAAmBa,EAAA;AAAA,YACnB,oBAAgB,EAAA,gBAAA,CAAqBb,EAAA,MAAM,QAAQ,MAAA;AAAA,YACnD,UAAQA,EAAA,MAAM;AAAA,YACd,WAASA,EAAA,MAAM;AAAA,YACf,SAAOA,EAAA,MAAM;AAAA,YACb,SAAOA,EAAA,MAAM;AAAA,YACb,SAAOA,EAAA,MAAM;AAAA,YACb,QAAMA,EAAA,MAAM;AAAA,UAAA;;;;MAINU,EAAA,cAAbM,EAAmEC,EAAAQ,CAAA,GAAA;AAAA;QAAvC,IAAIjB,EAAA;AAAA,MAAA;mBAAS,MAAkB;AAAA,cAAfE,EAAA,KAAY,GAAA,CAAA;AAAA,QAAA;;uBACvCV,EAAA,UAAU,aAA3BgB,EAAwEC,EAAAS,CAAA,GAAA;AAAA;QAAtC,IAAIjB,EAAA;AAAA,MAAA;mBAAQ,MAAmB;AAAA,UAAhBkB,EAAAC,EAAA5B,EAAA,SAAS,IAAI,GAAA,CAAA;AAAA,QAAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"picker.mjs","sources":["../src/picker/errorKey.ts","../src/picker/DateField.vue","../src/picker/DateRangeField.vue","../src/picker/TimeField.vue"],"sourcesContent":["// The composables report a missing value as \"incomplete\"; messages call it\n// \"required\" to match USAddressMessages.\nexport const toErrorKey = <TKey extends string>(reason: string | undefined) =>\n (reason === \"incomplete\" ? \"required\" : reason) as TKey | undefined;\n","<template>\n <div ref=\"rootRef\" class=\"fk-datepicker fkui-picker\">\n <Label v-if=\"label\" :editor-id=\"input.id\">{{ label }}</Label>\n <DatePicker\n fill-mode=\"outline\"\n rounded=\"medium\"\n size=\"medium\"\n v-bind=\"$attrs\"\n :model-value=\"model instanceof Date ? model : undefined\"\n date-input=\"masked\"\n :min=\"min ?? input.min ?? undefined\"\n :max=\"max ?? input.max ?? undefined\"\n :valid=\"input.isValid.value\"\n :validation-message=\"errorMessage\"\n :disabled=\"disabled\"\n :show=\"isOpen\"\n @update:model-value=\"model = $event\"\n @open=\"show = !readonly\"\n @close=\"show = false\"\n >\n <template #masked>\n <MaskedTextBox\n :id=\"input.id\"\n mask=\"00/00/0000\"\n :value=\"input.raw.value\"\n :placeholder=\"messages?.placeholder ?? input.placeholder.value\"\n :show-clear-button=\"false\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :aria-described-by=\"describedBy\"\n :input-attributes=\"{ 'aria-invalid': !input.isValid.value }\"\n @change=\"input.handleChange\"\n @keydown=\"input.handleKeyDown\"\n @keyup=\"input.handleKeyUp\"\n @click=\"input.handleClick\"\n @wheel=\"input.handleWheel\"\n @blur=\"input.handleBlur\"\n />\n </template>\n </DatePicker>\n <Error v-if=\"errorMessage\" :id=\"errorId\">{{ errorMessage }}</Error>\n <Hint v-else-if=\"messages?.hint\" :id=\"hintId\">{{ messages.hint }}</Hint>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\nimport { DatePicker } from \"@progress/kendo-vue-dateinputs\";\nimport { MaskedTextBox } from \"@progress/kendo-vue-inputs\";\nimport { Error, Hint, Label } from \"@progress/kendo-vue-labels\";\nimport { usePopupTrap } from \"@featherk/composables/trap\";\nimport type { UseMaskedDateInputReturn } from \"@featherk/composables/date\";\nimport type { DateFieldMessages, DateFieldErrorKey } from \"./types\";\nimport { toErrorKey } from \"./errorKey\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = defineProps<{\n /** Return value of `useMaskedDateInput`. */\n input: UseMaskedDateInputReturn;\n label?: string;\n /** Calendar bounds; default to the composable's `min`/`max`. */\n min?: Date;\n max?: Date;\n messages?: DateFieldMessages;\n /** Also applied to the masked input, which Kendo's picker does not reach. */\n disabled?: boolean;\n readonly?: boolean;\n}>();\n\n/** Must be the same ref passed to `useMaskedDateInput` as `externalValue`. */\nconst model = defineModel<Date | string | null | undefined>();\n/** Must be the same ref the composable's `onShowCalendar` opens. */\nconst show = defineModel<boolean>(\"show\", { default: false });\n\nconst rootRef = ref<HTMLElement | null>(null);\n// A locked field never shows its popup, even if the parent sets `show`, so its selection can't write the model.\nconst isOpen = computed(() => show.value && !props.disabled && !props.readonly);\nconst errorId = computed(() => `${props.input.id}-error`);\nconst hintId = computed(() => `${props.input.id}-hint`);\n\n// The composable decides when an error shows; messages only replace its text.\nconst errorMessage = computed(() => {\n const fallback = props.input.validationMessage.value;\n if (!fallback) return \"\";\n const key = toErrorKey<DateFieldErrorKey>(props.input.reason.value);\n return (key && props.messages?.error?.[key]) || fallback;\n});\n\nconst describedBy = computed(() => {\n if (errorMessage.value) return errorId.value;\n return props.messages?.hint ? hintId.value : undefined;\n});\n\nusePopupTrap({\n isOpen,\n onRequestClose: () => (show.value = false),\n triggerEl: rootRef,\n});\n</script>\n\n<style scoped>\n.fkui-picker {\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n}\n</style>\n","<template>\n <div class=\"fk-daterangepicker fkui-picker\">\n <Label v-if=\"label\" :editor-id=\"input.id\">{{ label }}</Label>\n <MaskedTextBox\n ref=\"maskedTextBoxRef\"\n fill-mode=\"outline\"\n rounded=\"medium\"\n size=\"medium\"\n v-bind=\"$attrs\"\n :id=\"input.id\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :show-clear-button=\"showClearButton && !disabled && !readonly\"\n :placeholder=\"messages?.placeholder ?? 'Start Date - End Date'\"\n mask=\"00/00/0000 - 00/00/0000\"\n :value=\"input.raw.value\"\n :valid=\"input.validComputed.value\"\n :aria-described-by=\"describedBy\"\n :input-attributes=\"{\n 'aria-invalid': input.validComputed.value === false,\n 'aria-haspopup': 'grid',\n 'aria-expanded': isOpen,\n 'aria-controls': calendarId,\n }\"\n input-suffix=\"calendar-suffix\"\n @change=\"input.handleChange\"\n @keydown=\"input.handleKeyDown\"\n @keyup=\"input.handleKeyUp\"\n @wheel=\"input.handleWheel\"\n @click=\"input.handleClick\"\n @blur=\"input.handleBlur\"\n @focus=\"show = false\"\n >\n <template #calendar-suffix>\n <!-- mousedown.prevent keeps focus in the input; keyboard users open the calendar from the input. -->\n <SvgIcon\n :icon=\"dateRangeIcon\"\n class=\"fkui-calendar-toggle\"\n @mousedown.prevent.stop=\"toggleCalendar\"\n />\n </template>\n </MaskedTextBox>\n <Error v-if=\"errorMessage\" :id=\"errorId\">{{ errorMessage }}</Error>\n <Hint v-else-if=\"messages?.hint\" :id=\"hintId\">{{ messages.hint }}</Hint>\n\n <Popup\n anchor=\"maskedTextBoxRef\"\n :show=\"isOpen\"\n :animate=\"false\"\n class=\"fkui-range-popup\"\n >\n <Tooltip\n anchor-element=\"pointer\"\n position=\"top\"\n :open-delay=\"280\"\n :parent-title=\"true\"\n >\n <Calendar\n :id=\"calendarId\"\n :model-value=\"model ?? undefined\"\n class=\"fkui-range-calendar\"\n mode=\"range\"\n :allow-reverse=\"false\"\n :views=\"calendarViews\"\n :min=\"min ?? input.min\"\n :max=\"max ?? input.max\"\n @update:model-value=\"onCalendarValue\"\n @change=\"input.onCalendarChange\"\n @keydown.escape=\"show = false\"\n />\n </Tooltip>\n </Popup>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\nimport { Calendar, type SelectionRange } from \"@progress/kendo-vue-dateinputs\";\nimport { MaskedTextBox } from \"@progress/kendo-vue-inputs\";\nimport { Error, Hint, Label } from \"@progress/kendo-vue-labels\";\nimport { SvgIcon } from \"@progress/kendo-vue-common\";\nimport { Popup } from \"@progress/kendo-vue-popup\";\nimport { Tooltip } from \"@progress/kendo-vue-tooltip\";\nimport { dateRangeIcon } from \"@featherk/icons\";\nimport { usePopupTrap } from \"@featherk/composables/trap\";\nimport type { UseMaskedDateRangeInputReturn } from \"@featherk/composables/range\";\nimport type { DateRangeFieldErrorKey, DateRangeFieldMessages } from \"./types\";\nimport { toErrorKey } from \"./errorKey\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = withDefaults(\n defineProps<{\n /** Return value of `useMaskedDateRangeInput`. */\n input: UseMaskedDateRangeInputReturn;\n label?: string;\n /** Calendar bounds; default to the composable's `min`/`max`. */\n min?: Date;\n max?: Date;\n messages?: DateRangeFieldMessages;\n disabled?: boolean;\n readonly?: boolean;\n /** Hidden while disabled or readonly, since Kendo's clear button ignores both. */\n showClearButton?: boolean;\n /** Months shown in the calendar, 1 to 4 (default 4). */\n views?: 1 | 2 | 3 | 4;\n }>(),\n { showClearButton: true },\n);\n\n/** Must be the same ref passed to `useMaskedDateRangeInput` as `externalValue`. */\nconst model = defineModel<SelectionRange | null | undefined>();\n/** Must be the same ref passed to the composable as `isOpen`. */\nconst show = defineModel<boolean>(\"show\", { default: false });\n\n// Kendo Calendar's model type has no null, and in range mode it always emits a SelectionRange.\nconst onCalendarValue = (value: unknown) =>\n (model.value = value as SelectionRange);\n\nconst maskedTextBoxRef = ref<InstanceType<typeof MaskedTextBox> | null>(null);\n\n// A locked field never shows its popup, even if the parent sets `show`, so its selection can't write the model.\nconst isOpen = computed(() => show.value && !props.disabled && !props.readonly);\n\nconst toggleCalendar = () => {\n if (!props.disabled && !props.readonly) show.value = !show.value;\n};\n\n// Clamped for untyped callers; the external styles are laid out for at most four months.\nconst calendarViews = computed(() => {\n const views = Math.trunc(props.views ?? 4);\n return Number.isFinite(views) ? Math.min(Math.max(views, 1), 4) : 4;\n});\n\nconst calendarId = computed(() => `${props.input.id}-calendar`);\nconst errorId = computed(() => `${props.input.id}-error`);\nconst hintId = computed(() => `${props.input.id}-hint`);\n\n// The composable decides when an error shows; messages only replace its text.\nconst errorMessage = computed(() => {\n if (props.input.validComputed.value !== false) return \"\";\n const key = toErrorKey<DateRangeFieldErrorKey>(props.input.reason.value);\n return (\n (key && props.messages?.error?.[key]) || props.input.validationMessage.value\n );\n});\n\nconst describedBy = computed(() => {\n if (errorMessage.value) return errorId.value;\n return props.messages?.hint ? hintId.value : undefined;\n});\n\nusePopupTrap({\n isOpen,\n onRequestClose: () => (show.value = false),\n triggerEl: computed(\n () => (maskedTextBoxRef.value?.$el as HTMLElement | undefined) ?? null,\n ),\n popupSelector: [\".k-calendar\", \".k-popup\"],\n});\n</script>\n\n<style scoped>\n.fkui-picker {\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n}\n.fkui-range-calendar {\n overscroll-behavior: contain;\n}\n</style>\n","<template>\n <div ref=\"rootRef\" class=\"fk-timepicker fkui-picker\">\n <Label v-if=\"label\" :editor-id=\"input.id\">{{ label }}</Label>\n <TimePicker\n fill-mode=\"outline\"\n rounded=\"medium\"\n size=\"medium\"\n format=\"hh:mm a\"\n v-bind=\"$attrs\"\n :model-value=\"model instanceof Date ? model : undefined\"\n date-input=\"masked\"\n :min=\"min ?? input.min ?? undefined\"\n :max=\"max ?? input.max ?? undefined\"\n :valid=\"input.isValid.value\"\n :validation-message=\"errorMessage\"\n :disabled=\"disabled\"\n :show=\"isOpen\"\n @change=\"input.handleChange\"\n @update:model-value=\"model = $event\"\n @open=\"show = !readonly\"\n @close=\"show = false\"\n >\n <template #masked>\n <MaskedTextBox\n :id=\"input.id\"\n mask=\"Hh:Mm Aa\"\n :rules=\"input.rules\"\n :value=\"input.raw.value\"\n :placeholder=\"messages?.placeholder ?? input.placeholder.value\"\n :show-clear-button=\"false\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :aria-described-by=\"describedBy\"\n :input-attributes=\"{ 'aria-invalid': !input.isValid.value }\"\n @change=\"input.handleChange\"\n @keydown=\"input.handleKeyDown\"\n @keyup=\"input.handleKeyUp\"\n @click=\"input.handleClick\"\n @wheel=\"input.handleWheel\"\n @blur=\"input.handleBlur\"\n />\n </template>\n </TimePicker>\n <Error v-if=\"errorMessage\" :id=\"errorId\">{{ errorMessage }}</Error>\n <Hint v-else-if=\"messages?.hint\" :id=\"hintId\">{{ messages.hint }}</Hint>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\nimport { TimePicker } from \"@progress/kendo-vue-dateinputs\";\nimport { MaskedTextBox } from \"@progress/kendo-vue-inputs\";\nimport { Error, Hint, Label } from \"@progress/kendo-vue-labels\";\nimport { usePopupTrap } from \"@featherk/composables/trap\";\nimport type { UseMaskedTimeInputReturn } from \"@featherk/composables/time\";\nimport type { TimeFieldMessages, TimeFieldErrorKey } from \"./types\";\nimport { toErrorKey } from \"./errorKey\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = defineProps<{\n /** Return value of `useMaskedTimeInput`. */\n input: UseMaskedTimeInputReturn;\n label?: string;\n /** Time list bounds; default to the composable's `min`/`max`. */\n min?: Date;\n max?: Date;\n messages?: TimeFieldMessages;\n /** Also applied to the masked input, which Kendo's picker does not reach. */\n disabled?: boolean;\n readonly?: boolean;\n}>();\n\n/** Must be the same ref passed to `useMaskedTimeInput` as `externalValue`. */\nconst model = defineModel<Date | string | null | undefined>();\n/** Must be the same ref the composable's `onShowPicker` opens. */\nconst show = defineModel<boolean>(\"show\", { default: false });\n\nconst rootRef = ref<HTMLElement | null>(null);\n// A locked field never shows its popup, even if the parent sets `show`, so its selection can't write the model.\nconst isOpen = computed(() => show.value && !props.disabled && !props.readonly);\nconst errorId = computed(() => `${props.input.id}-error`);\nconst hintId = computed(() => `${props.input.id}-hint`);\n\n// The composable decides when an error shows; messages only replace its text.\nconst errorMessage = computed(() => {\n const fallback = props.input.validationMessage.value;\n if (!fallback) return \"\";\n const key = toErrorKey<TimeFieldErrorKey>(props.input.reason.value);\n return (key && props.messages?.error?.[key]) || fallback;\n});\n\nconst describedBy = computed(() => {\n if (errorMessage.value) return errorId.value;\n return props.messages?.hint ? hintId.value : undefined;\n});\n\nconst trap = usePopupTrap({\n isOpen,\n onRequestClose: () => (show.value = false),\n triggerEl: rootRef,\n popupSelector: [\".k-timeselector\", \".k-popup\"],\n focusTrapOptions: {\n // TimePicker focuses its time list before the trap activates, so the\n // trap's default return target is removed with the popup (Set, Now, Cancel).\n setReturnFocus: () =>\n trap.lastCloseReason.value === \"outside\"\n ? false\n : (rootRef.value?.querySelector(\"input\") ?? false),\n },\n});\n</script>\n\n<style scoped>\n.fkui-picker {\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n}\n</style>\n"],"names":["toErrorKey","reason","props","__props","model","_useModel","show","rootRef","ref","isOpen","computed","errorId","hintId","errorMessage","fallback","key","describedBy","usePopupTrap","_createElementBlock","_createBlock","_unref","Label","_createVNode","_mergeProps","$attrs","_cache","$event","MaskedTextBox","Error","Hint","_createTextVNode","_toDisplayString","onCalendarValue","value","maskedTextBoxRef","toggleCalendar","calendarViews","views","calendarId","_openBlock","_hoisted_1","SvgIcon","dateRangeIcon","Popup","Tooltip","Calendar","trap"],"mappings":";;;;;;;;;;AAEO,MAAMA,IAAa,CAAsBC,MAC7CA,MAAW,eAAe,aAAaA;;;;;;;;;;;;;;;;;;;ACsD1C,UAAMC,IAAQC,GAcRC,IAAQC,EAA6CF,GAAA,YAAC,GAEtDG,IAAOD,EAAoBF,GAAC,MAA0B,GAEtDI,IAAUC,EAAwB,IAAI,GAEtCC,IAASC,EAAS,MAAMJ,EAAK,SAAS,CAACJ,EAAM,YAAY,CAACA,EAAM,QAAQ,GACxES,IAAUD,EAAS,MAAM,GAAGR,EAAM,MAAM,EAAE,QAAQ,GAClDU,IAASF,EAAS,MAAM,GAAGR,EAAM,MAAM,EAAE,OAAO,GAGhDW,IAAeH,EAAS,MAAM;AAClC,YAAMI,IAAWZ,EAAM,MAAM,kBAAkB;AAC/C,UAAI,CAACY,EAAU,QAAO;AACtB,YAAMC,IAAMf,EAA8BE,EAAM,MAAM,OAAO,KAAK;AAClE,aA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;AAAA,QACd,gCAAOG,EAAA,QAAI;AAAA,MAAA;QAED,UACT,MAiBE;AAAA,UAjBFgB,EAiBEF,EAAAO,CAAA,GAAA;AAAA,YAhBC,IAAIxB,EAAA,MAAM;AAAA,YACX,MAAK;AAAA,YACJ,OAAOA,EAAA,MAAM;AAAA,YACb,OAAOA,EAAA,MAAM,IAAI;AAAA,YACjB,aAAaA,YAAU,eAAeA,EAAA,MAAM,YAAY;AAAA,YACxD,qBAAmB;AAAA,YACnB,UAAUA,EAAA;AAAA,YACV,UAAUA,EAAA;AAAA,YACV,qBAAmBa,EAAA;AAAA,YACnB,oBAAgB,EAAA,gBAAA,CAAqBb,EAAA,MAAM,QAAQ,MAAA;AAAA,YACnD,UAAQA,EAAA,MAAM;AAAA,YACd,WAASA,EAAA,MAAM;AAAA,YACf,SAAOA,EAAA,MAAM;AAAA,YACb,SAAOA,EAAA,MAAM;AAAA,YACb,SAAOA,EAAA,MAAM;AAAA,YACb,QAAMA,EAAA,MAAM;AAAA,UAAA;;;;MAINU,EAAA,cAAbM,EAAmEC,EAAAQ,CAAA,GAAA;AAAA;QAAvC,IAAIjB,EAAA;AAAA,MAAA;mBAAS,MAAkB;AAAA,cAAfE,EAAA,KAAY,GAAA,CAAA;AAAA,QAAA;;uBACvCV,EAAA,UAAU,aAA3BgB,EAAwEC,EAAAS,CAAA,GAAA;AAAA;QAAtC,IAAIjB,EAAA;AAAA,MAAA;mBAAQ,MAAmB;AAAA,UAAhBkB,EAAAC,EAAA5B,EAAA,SAAS,IAAI,GAAA,CAAA;AAAA,QAAA;;;;;;"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
`DateRangeField` renders a masked date range input with a range-mode calendar popup, driven by a parent-owned `useMaskedDateRangeInput`.
|
|
4
4
|
|
|
5
|
-
It wires the `MaskedTextBox` and its handlers, the calendar icon toggle, the anchored `Popup`, a `Tooltip` around a range-mode `Calendar`,
|
|
5
|
+
It wires the `MaskedTextBox` and its handlers, the calendar icon toggle, the anchored `Popup`, a `Tooltip` around a range-mode `Calendar`, `Hint`, `Label`, `Error` and the popup focus trap.
|
|
6
6
|
|
|
7
7
|
## Import
|
|
8
8
|
|
|
@@ -91,9 +91,9 @@ Typed input is reported through the composable's `onChange`.
|
|
|
91
91
|
|
|
92
92
|
## Notes
|
|
93
93
|
|
|
94
|
-
- The input `id` comes from the composable's `id` option. Use a unique id per instance. The
|
|
94
|
+
- The input `id` comes from the composable's `id` option. Use a unique id per instance. The calendar, error and hint get `<id>-calendar`, `<id>-error` and `<id>-hint`.
|
|
95
95
|
- Keyboard: Space or Alt+ArrowDown opens the calendar, ArrowUp/ArrowDown step the date part under the caret, Escape closes the calendar. Focus is trapped in the calendar while it is open.
|
|
96
|
-
- The input has `aria-haspopup="grid"`, `aria-expanded` and `aria-controls` for the calendar. `aria-describedby` points to the error while invalid, otherwise to the
|
|
96
|
+
- The input has `aria-haspopup="grid"`, `aria-expanded` and `aria-controls` for the calendar. `aria-describedby` points to the error while invalid, otherwise to the hint. `aria-invalid` and the invalid styling follow the composable's `validComputed`: nothing is flagged before the first blur, and afterwards they update as the user types, together with the error text.
|
|
97
97
|
- The calendar icon is mouse-only (`mousedown.prevent` keeps focus in the input). Keyboard users open the calendar from the input.
|
|
98
98
|
- With the FeatherK external styles, four months show as a 2×2 grid and two as one row.
|
|
99
99
|
- Styling comes from `@featherk/styles`: the component root has the `fk-daterangepicker` class used by its external styles.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@featherk/ui",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"main": "dist/index.cjs",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"vue": "^3.5.0",
|
|
54
|
-
"@featherk/composables": ">=0.18.
|
|
55
|
-
"@featherk/icons": ">=0.18.
|
|
54
|
+
"@featherk/composables": ">=0.18.1",
|
|
55
|
+
"@featherk/icons": ">=0.18.1",
|
|
56
56
|
"@progress/kendo-svg-icons": "^4.5.0",
|
|
57
57
|
"@progress/kendo-vue-buttons": "^6.4.1",
|
|
58
58
|
"@progress/kendo-vue-common": "^6.4.1",
|