@sectile/vue 0.18.3 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +127 -14
- package/dist/accordion.js +1 -1
- package/dist/accordion.js.map +1 -1
- package/dist/carousel.d.ts +20 -0
- package/dist/carousel.js +1 -1
- package/dist/carousel.js.map +1 -1
- package/dist/cascade-list.js +1 -1
- package/dist/cascade-list.js.map +1 -1
- package/dist/cascade-select.js +1 -1
- package/dist/cascade-select.js.map +1 -1
- package/dist/chart.js +1 -1
- package/dist/chart.js.map +1 -1
- package/dist/checkbox-group.js +1 -1
- package/dist/checkbox-group.js.map +1 -1
- package/dist/checkbox-tree.d.ts +102 -0
- package/dist/checkbox-tree.js +2 -0
- package/dist/checkbox-tree.js.map +1 -0
- package/dist/checkbox.js +1 -1
- package/dist/checkbox.js.map +1 -1
- package/dist/color-picker.d.ts +24 -0
- package/dist/color-picker.js +1 -1
- package/dist/color-picker.js.map +1 -1
- package/dist/combobox.d.ts +47 -1
- package/dist/combobox.js +1 -1
- package/dist/combobox.js.map +1 -1
- package/dist/component-handle.d.ts +8 -0
- package/dist/component-handle.js +2 -0
- package/dist/component-handle.js.map +1 -0
- package/dist/context-menu.d.ts +1 -0
- package/dist/context-menu.js +2 -0
- package/dist/context-menu.js.map +1 -0
- package/dist/drag-drop.d.ts +23 -0
- package/dist/drag-drop.js +2 -0
- package/dist/drag-drop.js.map +1 -0
- package/dist/editable.d.ts +3 -0
- package/dist/editable.js +1 -1
- package/dist/editable.js.map +1 -1
- package/dist/form/context.d.ts +3 -0
- package/dist/form/context.js +1 -1
- package/dist/form/context.js.map +1 -1
- package/dist/form/contracts.d.ts +1 -0
- package/dist/form/control-inventory.d.ts +20 -0
- package/dist/form/control-inventory.js +1 -1
- package/dist/form/control-inventory.js.map +1 -1
- package/dist/form/control.d.ts +44 -1
- package/dist/form/control.js +1 -1
- package/dist/form/control.js.map +1 -1
- package/dist/form/field.d.ts +10 -0
- package/dist/form/field.js +1 -1
- package/dist/form/field.js.map +1 -1
- package/dist/form/file-input.d.ts +229 -0
- package/dist/form/file-input.js +2 -0
- package/dist/form/file-input.js.map +1 -0
- package/dist/form/file-upload/group.d.ts +28 -0
- package/dist/form/file-upload/group.js +2 -0
- package/dist/form/file-upload/group.js.map +1 -0
- package/dist/form/file-upload.d.ts +26 -0
- package/dist/form/file-upload.js +2 -0
- package/dist/form/file-upload.js.map +1 -0
- package/dist/form/root.js +1 -1
- package/dist/form/root.js.map +1 -1
- package/dist/form-boundary.d.ts +2 -0
- package/dist/form-boundary.js +2 -0
- package/dist/form-boundary.js.map +1 -0
- package/dist/fullscreen.d.ts +16 -0
- package/dist/fullscreen.js +2 -0
- package/dist/fullscreen.js.map +1 -0
- package/dist/host-provider.d.ts +99 -1
- package/dist/host-provider.js +1 -1
- package/dist/host-provider.js.map +1 -1
- package/dist/image.d.ts +24 -0
- package/dist/image.js +2 -0
- package/dist/image.js.map +1 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/input/native-field.d.ts +33 -6
- package/dist/input/native-field.js +1 -1
- package/dist/input/native-field.js.map +1 -1
- package/dist/input/native-range-field.d.ts +16 -7
- package/dist/input/native-range-field.js +1 -1
- package/dist/input/native-range-field.js.map +1 -1
- package/dist/internal/cascade-choice.js +1 -1
- package/dist/internal/cascade-choice.js.map +1 -1
- package/dist/internal/connection-lifetime.d.ts +10 -0
- package/dist/internal/connection-lifetime.js +2 -0
- package/dist/internal/connection-lifetime.js.map +1 -0
- package/dist/internal/popup-presentation.d.ts +32 -0
- package/dist/internal/popup-presentation.js +2 -0
- package/dist/internal/popup-presentation.js.map +1 -0
- package/dist/internal/portal-move.d.ts +11 -0
- package/dist/internal/portal-move.js +2 -0
- package/dist/internal/portal-move.js.map +1 -0
- package/dist/internal/scheduled-task.js +1 -1
- package/dist/internal/scheduled-task.js.map +1 -1
- package/dist/internal/tabs-context.d.ts +11 -0
- package/dist/internal/tabs-context.js +1 -1
- package/dist/internal/tabs-context.js.map +1 -1
- package/dist/internal/tree-parts.d.ts +142 -0
- package/dist/internal/tree-parts.js +2 -0
- package/dist/internal/tree-parts.js.map +1 -0
- package/dist/listbox.d.ts +11 -0
- package/dist/listbox.js +1 -1
- package/dist/listbox.js.map +1 -1
- package/dist/media-gesture.d.ts +20 -0
- package/dist/media-gesture.js +2 -0
- package/dist/media-gesture.js.map +1 -0
- package/dist/menu.d.ts +239 -0
- package/dist/menu.js +1 -1
- package/dist/menu.js.map +1 -1
- package/dist/meter-group.js +1 -1
- package/dist/meter-group.js.map +1 -1
- package/dist/multi-thumb-slider.js +1 -1
- package/dist/multi-thumb-slider.js.map +1 -1
- package/dist/number-field.d.ts +18 -1
- package/dist/number-field.js +1 -1
- package/dist/number-field.js.map +1 -1
- package/dist/overlay/dialog.d.ts +1 -0
- package/dist/overlay/dialog.js.map +1 -1
- package/dist/overlay/drawer.d.ts +33 -4
- package/dist/overlay/drawer.js +1 -1
- package/dist/overlay/drawer.js.map +1 -1
- package/dist/overlay/popover.d.ts +2 -1
- package/dist/overlay/popover.js.map +1 -1
- package/dist/overlay/popup.d.ts +50 -2
- package/dist/overlay/popup.js +1 -1
- package/dist/overlay/popup.js.map +1 -1
- package/dist/overlay/tooltip.d.ts +38 -3
- package/dist/overlay/tooltip.js +1 -1
- package/dist/overlay/tooltip.js.map +1 -1
- package/dist/pagination.js +1 -1
- package/dist/pagination.js.map +1 -1
- package/dist/pin-input.js +1 -1
- package/dist/pin-input.js.map +1 -1
- package/dist/presence/presence.d.ts +1 -1
- package/dist/presence/presence.js +1 -1
- package/dist/presence/presence.js.map +1 -1
- package/dist/primitive.d.ts +37 -3
- package/dist/primitive.js +1 -1
- package/dist/primitive.js.map +1 -1
- package/dist/quantity-field.js +1 -1
- package/dist/quantity-field.js.map +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/radio-group.js.map +1 -1
- package/dist/rating.js +1 -1
- package/dist/rating.js.map +1 -1
- package/dist/reorder.d.ts +169 -77
- package/dist/reorder.js +1 -1
- package/dist/reorder.js.map +1 -1
- package/dist/select.d.ts +21 -0
- package/dist/select.js +1 -1
- package/dist/select.js.map +1 -1
- package/dist/slider.js +1 -1
- package/dist/slider.js.map +1 -1
- package/dist/spin-button.d.ts +19 -0
- package/dist/spin-button.js +1 -1
- package/dist/spin-button.js.map +1 -1
- package/dist/stepper.js +1 -1
- package/dist/stepper.js.map +1 -1
- package/dist/switch.js +1 -1
- package/dist/switch.js.map +1 -1
- package/dist/tabs.d.ts +2 -0
- package/dist/tabs.js +1 -1
- package/dist/tabs.js.map +1 -1
- package/dist/tabular/components.d.ts +5 -0
- package/dist/tabular/components.js.map +1 -1
- package/dist/tabular/controller.d.ts +1 -0
- package/dist/tabular/controller.js +1 -1
- package/dist/tabular/controller.js.map +1 -1
- package/dist/tabular/data-grid.d.ts +4 -4
- package/dist/tabular/data-grid.js +1 -1
- package/dist/tabular/data-grid.js.map +1 -1
- package/dist/tabular/data-table.d.ts +4 -4
- package/dist/tabular/data-table.js +1 -1
- package/dist/tabular/data-table.js.map +1 -1
- package/dist/tabular/data-tree-grid.d.ts +4 -4
- package/dist/tabular/data-tree-grid.js +1 -1
- package/dist/tabular/data-tree-grid.js.map +1 -1
- package/dist/tabular/parts.d.ts +11 -1
- package/dist/tabular/parts.js +1 -1
- package/dist/tabular/parts.js.map +1 -1
- package/dist/tags-input.d.ts +12 -1
- package/dist/tags-input.js +1 -1
- package/dist/tags-input.js.map +1 -1
- package/dist/temporal/calendar.d.ts +15 -111
- package/dist/temporal/calendar.js +1 -1
- package/dist/temporal/calendar.js.map +1 -1
- package/dist/temporal/capabilities/date-picker.js +1 -1
- package/dist/temporal/capabilities/date-picker.js.map +1 -1
- package/dist/temporal/capabilities/date-time-picker.js +1 -1
- package/dist/temporal/capabilities/date-time-picker.js.map +1 -1
- package/dist/temporal/capabilities/date-time-range-picker.js +1 -1
- package/dist/temporal/capabilities/date-time-range-picker.js.map +1 -1
- package/dist/temporal/capability.d.ts +13 -1
- package/dist/temporal/capability.js.map +1 -1
- package/dist/temporal/date-field.d.ts +1 -1
- package/dist/temporal/date-field.js +1 -1
- package/dist/temporal/date-field.js.map +1 -1
- package/dist/temporal/date-picker.d.ts +3 -1
- package/dist/temporal/date-picker.js.map +1 -1
- package/dist/temporal/date-range-field.d.ts +20 -0
- package/dist/temporal/date-range-field.js +1 -1
- package/dist/temporal/date-range-field.js.map +1 -1
- package/dist/temporal/date-range-picker.d.ts +3 -1
- package/dist/temporal/date-range-picker.js.map +1 -1
- package/dist/temporal/date-time-field.d.ts +4 -1
- package/dist/temporal/date-time-field.js +1 -1
- package/dist/temporal/date-time-field.js.map +1 -1
- package/dist/temporal/date-time-picker.d.ts +3 -1
- package/dist/temporal/date-time-picker.js +1 -1
- package/dist/temporal/date-time-picker.js.map +1 -1
- package/dist/temporal/date-time-range-field.d.ts +158 -0
- package/dist/temporal/date-time-range-field.js +2 -0
- package/dist/temporal/date-time-range-field.js.map +1 -0
- package/dist/temporal/date-time-range-picker.d.ts +3 -1
- package/dist/temporal/date-time-range-picker.js +1 -1
- package/dist/temporal/date-time-range-picker.js.map +1 -1
- package/dist/temporal/internal/time-presentation.d.ts +15 -0
- package/dist/temporal/internal/time-presentation.js +2 -0
- package/dist/temporal/internal/time-presentation.js.map +1 -0
- package/dist/temporal/month-picker.d.ts +3 -1
- package/dist/temporal/month-picker.js.map +1 -1
- package/dist/temporal/month-range-picker.d.ts +3 -1
- package/dist/temporal/month-range-picker.js.map +1 -1
- package/dist/temporal/picker.d.ts +23 -1
- package/dist/temporal/picker.js +1 -1
- package/dist/temporal/picker.js.map +1 -1
- package/dist/temporal/range-calendar.d.ts +119 -2
- package/dist/temporal/range-calendar.js +1 -1
- package/dist/temporal/range-calendar.js.map +1 -1
- package/dist/temporal/temporal-provider.d.ts +23 -0
- package/dist/temporal/temporal-provider.js +1 -1
- package/dist/temporal/temporal-provider.js.map +1 -1
- package/dist/temporal/time-field.d.ts +4 -1
- package/dist/temporal/time-field.js +1 -1
- package/dist/temporal/time-field.js.map +1 -1
- package/dist/temporal/time-picker.d.ts +112 -0
- package/dist/temporal/time-picker.js +2 -0
- package/dist/temporal/time-picker.js.map +1 -0
- package/dist/temporal/time-range-field.d.ts +32 -1
- package/dist/temporal/time-range-field.js +1 -1
- package/dist/temporal/time-range-field.js.map +1 -1
- package/dist/temporal/year-picker.d.ts +3 -1
- package/dist/temporal/year-picker.js.map +1 -1
- package/dist/temporal/year-range-picker.d.ts +3 -1
- package/dist/temporal/year-range-picker.js.map +1 -1
- package/dist/text.d.ts +43 -1
- package/dist/text.js +1 -1
- package/dist/text.js.map +1 -1
- package/dist/timer.d.ts +16 -5
- package/dist/timer.js +1 -1
- package/dist/timer.js.map +1 -1
- package/dist/toast.js +1 -1
- package/dist/toast.js.map +1 -1
- package/dist/toggle-group.js +1 -1
- package/dist/toggle-group.js.map +1 -1
- package/dist/toolbar.js +1 -1
- package/dist/toolbar.js.map +1 -1
- package/dist/transfer.d.ts +191 -0
- package/dist/transfer.js +2 -0
- package/dist/transfer.js.map +1 -0
- package/dist/tree-grid.d.ts +122 -0
- package/dist/tree-grid.js +1 -1
- package/dist/tree-grid.js.map +1 -1
- package/dist/tree-select.d.ts +186 -0
- package/dist/tree-select.js +2 -0
- package/dist/tree-select.js.map +1 -0
- package/dist/tree-view.js +1 -1
- package/dist/tree-view.js.map +1 -1
- package/dist/virtual/virtual-collection.d.ts +2 -0
- package/dist/virtual/virtual-collection.js.map +1 -1
- package/dist/virtual/virtual-grid.d.ts +12 -2
- package/dist/virtual/virtual-grid.js +1 -1
- package/dist/virtual/virtual-grid.js.map +1 -1
- package/dist/virtual/virtual-list.d.ts +12 -3
- package/dist/virtual/virtual-list.js +1 -1
- package/dist/virtual/virtual-list.js.map +1 -1
- package/dist/virtual/virtual-masonry.d.ts +12 -2
- package/dist/virtual/virtual-masonry.js +1 -1
- package/dist/virtual/virtual-masonry.js.map +1 -1
- package/dist/virtual/virtual-spatial.d.ts +12 -2
- package/dist/virtual/virtual-spatial.js +1 -1
- package/dist/virtual/virtual-spatial.js.map +1 -1
- package/dist/window-splitter.js +1 -1
- package/dist/window-splitter.js.map +1 -1
- package/package.json +88 -17
package/dist/editable.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{computed,defineComponent,h,inject,mergeProps,onBeforeUnmount,onMounted,provide,
|
|
1
|
+
import{computed,defineComponent,h,inject,mergeProps,onBeforeUnmount,onMounted,provide,shallowRef,watch}from"vue";import{createEditable}from"@sectile/dom/editable";import{Primitive}from"./primitive.js";import{useFormControlFlags,useNativeInputFormControl}from"./form/control.js";import{useControlledStateInvariant}from"./internal/controlled-state.js";import{useNextTickTask}from"./internal/scheduled-task.js";const editableContextKey=Symbol("SectileEditable");const partProps={as:{type:[String,Object,Function],default:"div"},asChild:{type:Boolean,default:false}};const EditableRoot=defineComponent({name:"SectileEditableRoot",inheritAttrs:false,props:{modelValue:{type:String,default:void 0},defaultValue:{type:String,default:""},disabled:{type:Boolean,default:false},readonly:{type:Boolean,default:false},submitOnBlur:{type:Boolean,default:false},policies:{type:Object,default:void 0},name:{type:String,default:void 0},label:{type:String,default:void 0},...partProps},emits:{"update:modelValue":_value=>true,"update:editing":_editing=>true},slots:Object,setup(props,{attrs,emit,slots}){const flags=useFormControlFlags(props);const controlled=useControlledStateInvariant("EditableRoot","modelValue",()=>props.modelValue);const initial=controlled?props.modelValue:props.defaultValue;const snapshot=shallowRef({value:initial,draft:initial,editing:false});const root=shallowRef(null);const preview=shallowRef(null);const input=shallowRef(null);const editTrigger=shallowRef(null);const submitTrigger=shallowRef(null);const cancelTrigger=shallowRef(null);const multiline=shallowRef(false);let connection=null;let mounted=false;let restoreInputFocus=false;const refresh=()=>{if(connection!==null)snapshot.value=connection.getSnapshot().state};const mount=()=>{if(!mounted||root.value===null||preview.value===null||input.value===null)return;const binding={root:root.value,preview:preview.value,input:input.value,...editTrigger.value===null?{}:{editTrigger:editTrigger.value},...submitTrigger.value===null?{}:{submitTrigger:submitTrigger.value},...cancelTrigger.value===null?{}:{cancelTrigger:cancelTrigger.value},disabled:flags.value.disabled,readOnly:flags.value.readonly,submitOnBlur:props.submitOnBlur,...props.policies===void 0?{}:{policies:props.policies},...props.name===void 0?{}:{name:props.name},...props.label===void 0?{}:{label:props.label}};if(connection!==null){const result=connection.syncOptions(binding);if(!result.ok)throw new TypeError(result.error.message)}else connection=createEditable({...binding,...controlled?{value:props.modelValue}:{defaultValue:snapshot.value.value},onValueChange:value=>emit("update:modelValue",value),onEditingChange:editing=>emit("update:editing",editing),onUpdate:refresh});refresh();if(restoreInputFocus&&snapshot.value.editing)input.value.focus();restoreInputFocus=false};const reset=()=>{queueMicrotask(()=>{if(!mounted)return;mountTask.cancel();connection?.disconnect();connection=null;const value=controlled?props.modelValue:initial;snapshot.value={value,draft:value,editing:false};mount()})};const mountTask=useNextTickTask(mount);let inputComposing=false;let reconnectPending=false;let reconnectTimer=null;let pendingMultiline;const requestMount=()=>{if(inputComposing||reconnectTimer!==null){reconnectPending=true;return}mountTask.schedule()};const setMultiline=value=>{if(inputComposing||reconnectTimer!==null){pendingMultiline=value;reconnectPending=true}else multiline.value=value};const setInputComposing=composing=>{inputComposing=composing;if(composing||!reconnectPending||reconnectTimer!==null)return;reconnectTimer=setTimeout(()=>{reconnectTimer=null;if(!mounted||inputComposing)return;reconnectPending=false;if(pendingMultiline!==void 0){multiline.value=pendingMultiline;pendingMultiline=void 0}mountTask.schedule()},0)};onMounted(()=>{mounted=true;mount()});onBeforeUnmount(()=>{mounted=false;if(reconnectTimer!==null)clearTimeout(reconnectTimer);reconnectTimer=null;reconnectPending=false;pendingMultiline=void 0;restoreInputFocus=false;mountTask.cancel();connection?.disconnect();connection=null});watch(()=>props.modelValue,value=>{if(!controlled||value===void 0||connection===null)return;const result=connection.syncControlledValue(value);if(!result.ok)throw new TypeError(result.error.message);snapshot.value=result.value.state});watch([()=>flags.value.disabled,()=>flags.value.readonly,()=>props.submitOnBlur,()=>props.policies,()=>props.label,()=>props.name],requestMount);watch(input,(_next,previous)=>{if(previous!==null&&previous.ownerDocument.activeElement===previous)restoreInputFocus=true},{flush:"sync"});watch([root,preview,input,editTrigger,submitTrigger,cancelTrigger],requestMount,{flush:"post"});const slotProps=computed(()=>Object.freeze({...snapshot.value,disabled:flags.value.disabled,readonly:flags.value.readonly}));provide(editableContextKey,{slotProps,root,preview,input,editTrigger,submitTrigger,cancelTrigger,multiline,setInputComposing,setMultiline,reset});return()=>h(Primitive,mergeProps(attrs,{as:props.as,asChild:props.asChild,elementRef:element=>{root.value=element},"data-scope":"editable","data-part":"root","data-state":slotProps.value.editing?"editing":"idle","data-disabled":flags.value.disabled?"":void 0,"data-readonly":flags.value.readonly?"":void 0}),{default:()=>slots["default"]?.(slotProps.value)})}});const EditableArea=defineComponent({name:"SectileEditableArea",inheritAttrs:false,props:partProps,slots:Object,setup(props,{attrs,slots}){const context=useEditableContext("EditableArea");return()=>renderPart(props,attrs,slots,context,"area")}});const EditablePreview=defineComponent({name:"SectileEditablePreview",inheritAttrs:false,props:{...partProps,as:{...partProps.as,default:"span"}},slots:Object,setup(props,{attrs,slots}){const context=useEditableContext("EditablePreview");return()=>h(Primitive,mergeProps(attrs,{as:props.as,asChild:props.asChild,elementRef:element=>{context.preview.value=element},hidden:context.slotProps.value.editing,tabindex:context.slotProps.value.disabled?-1:0,"data-scope":"editable","data-part":"preview"}),{default:()=>slots["default"]?.(context.slotProps.value)})}});const EditableInput=defineComponent({name:"SectileEditableInput",inheritAttrs:false,props:{multiline:{type:Boolean,default:false},type:{type:String,default:"text"},name:{type:String,default:void 0},form:{type:String,default:void 0},required:{type:Boolean,default:false}},setup(props,{attrs,expose}){const context=useEditableContext("EditableInput");expose({get element(){return context.input.value}});const participation=useNativeInputFormControl(context.input,{reset:context.reset});const renderServerValue=typeof window==="undefined";watch(()=>props.multiline,context.setMultiline,{immediate:true});return()=>h(context.multiline.value?"textarea":"input",mergeProps(attrs,{ref:element=>{context.input.value=element},...!context.multiline.value?{type:props.type}:{},name:props.name,form:props.form,required:props.required,...renderServerValue?{value:context.slotProps.value.draft}:{},hidden:!context.slotProps.value.editing,disabled:context.slotProps.value.disabled,readonly:context.slotProps.value.readonly,onCompositionstart:()=>context.setInputComposing(true),onCompositionend:()=>context.setInputComposing(false),"data-scope":"editable","data-part":"input","data-multiline":context.multiline.value?"true":void 0},participation.controlProps.value))}});const EditableEditTrigger=createTrigger("Edit","editTrigger","edit-trigger",false);const EditableSubmitTrigger=createTrigger("Submit","submitTrigger","submit-trigger",true);const EditableCancelTrigger=createTrigger("Cancel","cancelTrigger","cancel-trigger",true);function createTrigger(label,key,part,editing){return defineComponent({name:`SectileEditable${label}Trigger`,inheritAttrs:false,props:{...partProps,as:{...partProps.as,default:"button"}},slots:Object,setup(props,{attrs,slots}){const context=useEditableContext(`Editable${label}Trigger`);return()=>h(Primitive,mergeProps(attrs,{as:props.as,asChild:props.asChild,elementRef:element=>{context[key].value=element},...props.as==="button"&&!props.asChild?{type:"button"}:{},hidden:context.slotProps.value.editing!==editing,disabled:context.slotProps.value.disabled,"data-scope":"editable","data-part":part}),{default:()=>slots["default"]?.(context.slotProps.value)})}})}function renderPart(props,attrs,slots,context,part){return h(Primitive,mergeProps(attrs,{as:props.as,asChild:props.asChild,"data-scope":"editable","data-part":part,"data-state":context.slotProps.value.editing?"editing":"idle"}),{default:()=>slots.default?.(context.slotProps.value)})}function useEditableContext(part){const context=inject(editableContextKey);if(context===void 0)throw new TypeError(`${part} must be used inside EditableRoot.`);return context}export{EditableArea,EditableCancelTrigger,EditableEditTrigger,EditableInput,EditablePreview,EditableRoot,EditableSubmitTrigger};
|
|
2
2
|
//# sourceMappingURL=editable.js.map
|
package/dist/editable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/editable.ts"],"mappings":"AAAA,OACE,SACA,gBACA,EACA,OACA,WACA,gBACA,UACA,QACA,
|
|
1
|
+
{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MAAQ,OAA+B,EACxF,GAAI,MAAM,KAAO,UAAY,CAAC,MAAM,QAAU,CAAE,KAAM,QAAQ,EAAK,CAAA,EACnE,OAAQ,QAAQ,UAAU,MAAM,UAAY,QAC5C,SAAU,QAAQ,UAAU,MAAM,SAClC,aAAc,WAAY,YAAa,KACxC,EAAG,CAAE,QAAS,IAAM,MAAM,SAAS,IAAI,QAAQ,UAAU,KAAK,CAAC,CAAE,CACpE,EACD,CACH,CAEA,SAAS,WACP,MACA,MACA,MACA,QACA,KAAY,CAEZ,OAAO,EAAE,UAAW,WAAW,MAAO,CACpC,GAAI,MAAM,GAAI,QAAS,MAAM,QAC7B,aAAc,WAAY,YAAa,KACvC,aAAc,QAAQ,UAAU,MAAM,QAAU,UAAY,OAC7D,EAAG,CAAE,QAAS,IAAM,MAAM,UAAU,QAAQ,UAAU,KAAK,CAAC,CAAE,CACjE,CAEA,SAAS,mBAAmB,KAAY,CACtC,MAAM,QAAU,OAAwB,kBAAkB,EAC1D,GAAI,UAAY,OAAW,MAAM,IAAI,UAAU,GAAG,IAAI,oCAAoC,EAC1F,OAAO,OACT","names":[],"file":"editable.js"}
|
package/dist/form/context.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { FormConnection, FormParticipant } from '@sectile/dom/form';
|
|
|
3
3
|
import type { FormFieldSelectorFunction, FormFieldSlotProps, FormIssue, FormSelectorFunction, FormSubscribeOptions } from './contracts.js';
|
|
4
4
|
import type { FormControlRegistration, FormLabelMode } from './control.js';
|
|
5
5
|
export interface FormContext {
|
|
6
|
+
readonly active: Readonly<ShallowRef<boolean>>;
|
|
6
7
|
readonly summary: ShallowRef<HTMLElement | null>;
|
|
7
8
|
readonly summaryId: string;
|
|
8
9
|
readonly register: (participant: FormParticipant<string>) => () => void;
|
|
@@ -17,6 +18,8 @@ export interface FormFieldContext {
|
|
|
17
18
|
}
|
|
18
19
|
export declare const formContextKey: unique symbol;
|
|
19
20
|
export declare const formFieldContextKey: unique symbol;
|
|
21
|
+
/** Independent popup content keeps its Form root and permits new explicit field owners. */
|
|
22
|
+
export declare function provideFormBoundary(): void;
|
|
20
23
|
export declare function useFormContext(part: string): FormContext;
|
|
21
24
|
export declare function useFormFieldContext(part: string): FormFieldContext;
|
|
22
25
|
export declare function useFormSelectorFromContext<Selected>(context: FormContext, selectorSource: () => FormSelectorFunction<Selected>, equalsSource?: () => NonNullable<FormSubscribeOptions<Selected>['equals']>): Readonly<ShallowRef<Selected>>;
|
package/dist/form/context.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{inject,onScopeDispose,shallowRef,watch}from"vue";const formContextKey=Symbol("SectileForm");const formFieldContextKey=Symbol("SectileFormField");const emptyState=Object.freeze({validation:Object.freeze({generation:0,status:"idle",trigger:null,intent:null}),submission:Object.freeze({generation:0,status:"idle",count:0,failure:null}),touched:false,dirty:false,valid:true,fields:Object.freeze([]),issues:Object.freeze([]),allIssues:Object.freeze([])});function useFormContext(part){const context=inject(formContextKey,null);if(context===null)throw new TypeError(`${part} must be rendered inside FormRoot.`);return context}function useFormFieldContext(part){const context=inject(formFieldContextKey,null);if(context===null)throw new TypeError(`${part} must be rendered inside FormField.`);return context}function useFormSelectorFromContext(context,selectorSource,equalsSource=()=>Object.is){const initialSelector=selectorSource();const selected=shallowRef(initialSelector(context.connection.value?.state??emptyState));let unsubscribe;const stop=watch([context.connection,selectorSource,equalsSource],([target,selector,equals])=>{unsubscribe?.();unsubscribe=void 0;const next=selector(target?.state??emptyState);if(!equals(selected.value,next))selected.value=next;if(target!==null){unsubscribe=target.subscribeForm(selector,value=>{selected.value=value},{equals})}},{immediate:true,flush:"sync"});onScopeDispose(()=>{unsubscribe?.();stop()});return selected}function useFormFieldSelectorFromContext(context,idSource,selectorSource,equalsSource=()=>Object.is){const initialSelector=selectorSource();const selected=shallowRef(initialSelector(context.connection.value?.getField(idSource())??null));let unsubscribe;const stop=watch([context.connection,idSource,selectorSource,equalsSource],([target,id,selector,equals])=>{unsubscribe?.();unsubscribe=void 0;const next=selector(target?.getField(id)??null);if(!equals(selected.value,next))selected.value=next;if(target!==null){unsubscribe=target.subscribeField(id,selector,value=>{selected.value=value},{equals})}},{immediate:true,flush:"sync"});onScopeDispose(()=>{unsubscribe?.();stop()});return selected}export{formContextKey,formFieldContextKey,useFormContext,useFormFieldContext,useFormFieldSelectorFromContext,useFormSelectorFromContext};
|
|
1
|
+
import{inject,provide,onScopeDispose,shallowRef,watch}from"vue";import{provideFormControlBoundary}from"./control.js";import{useHostActive}from"../host-provider.js";const formContextKey=Symbol("SectileForm");const formFieldContextKey=Symbol("SectileFormField");function provideFormBoundary(){provide(formFieldContextKey,null);provideFormControlBoundary()}const emptyState=Object.freeze({validation:Object.freeze({generation:0,status:"idle",trigger:null,intent:null}),submission:Object.freeze({generation:0,status:"idle",count:0,failure:null}),touched:false,dirty:false,valid:true,fields:Object.freeze([]),issues:Object.freeze([]),allIssues:Object.freeze([])});function useFormContext(part){const context=inject(formContextKey,null);if(context===null)throw new TypeError(`${part} must be rendered inside FormRoot.`);return context}function useFormFieldContext(part){const context=inject(formFieldContextKey,null);if(context===null)throw new TypeError(`${part} must be rendered inside FormField.`);return context}function useFormSelectorFromContext(context,selectorSource,equalsSource=()=>Object.is){const active=useHostActive();const initialSelector=selectorSource();const selected=shallowRef(initialSelector(context.connection.value?.state??emptyState));let unsubscribe;const stop=watch([context.connection,selectorSource,equalsSource,active,()=>context.active.value],([target,selector,equals])=>{unsubscribe?.();unsubscribe=void 0;const next=selector(target?.state??emptyState);if(!equals(selected.value,next))selected.value=next;if(target!==null&&active.value&&context.active.value){unsubscribe=target.subscribeForm(selector,value=>{selected.value=value},{equals})}},{immediate:true,flush:"sync"});onScopeDispose(()=>{unsubscribe?.();stop()});return selected}function useFormFieldSelectorFromContext(context,idSource,selectorSource,equalsSource=()=>Object.is){const active=useHostActive();const initialSelector=selectorSource();const selected=shallowRef(initialSelector(context.connection.value?.getField(idSource())??null));let unsubscribe;const stop=watch([context.connection,idSource,selectorSource,equalsSource,active,()=>context.active.value],([target,id,selector,equals])=>{unsubscribe?.();unsubscribe=void 0;const next=selector(target?.getField(id)??null);if(!equals(selected.value,next))selected.value=next;if(target!==null&&active.value&&context.active.value){unsubscribe=target.subscribeField(id,selector,value=>{selected.value=value},{equals})}},{immediate:true,flush:"sync"});onScopeDispose(()=>{unsubscribe?.();stop()});return selected}export{formContextKey,formFieldContextKey,provideFormBoundary,useFormContext,useFormFieldContext,useFormFieldSelectorFromContext,useFormSelectorFromContext};
|
|
2
2
|
//# sourceMappingURL=context.js.map
|
package/dist/form/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/form/context.ts"],"mappings":"AAAA,OACE,OACA,eACA,WACA,UAGK,
|
|
1
|
+
{"version":3,"sources":["../../src/form/context.ts"],"mappings":"AAAA,OACE,OACA,QACA,eACA,WACA,UAGK,MAcP,OAAS,+BAAkC,eAC3C,OAAS,kBAAqB,sBAoBvB,MAAM,eAAiB,OAAO,aAAa,EAC3C,MAAM,oBAAsB,OAAO,kBAAkB,EAGtD,SAAU,qBAAmB,CACjC,QAAQ,oBAAqB,IAAI,EACjC,2BAA0B,CAC5B,CAEA,MAAM,WAAwB,OAAO,OAAO,CAC1C,WAAY,OAAO,OAAO,CAAE,WAAY,EAAG,OAAQ,OAAQ,QAAS,KAAM,OAAQ,IAAI,CAAE,EACxF,WAAY,OAAO,OAAO,CAAE,WAAY,EAAG,OAAQ,OAAQ,MAAO,EAAG,QAAS,IAAI,CAAE,EACpF,QAAS,MACT,MAAO,MACP,MAAO,KACP,OAAQ,OAAO,OAAO,CAAA,CAAE,EACxB,OAAQ,OAAO,OAAO,CAAA,CAAE,EACxB,UAAW,OAAO,OAAO,CAAA,CAAE,EAC5B,EAEK,SAAU,eAAe,KAAY,CACzC,MAAM,QAAU,OAA2B,eAAgB,IAAI,EAC/D,GAAI,UAAY,KAAM,MAAM,IAAI,UAAU,GAAG,IAAI,oCAAoC,EACrF,OAAO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,YAAc,OACd,MAAM,KAAO,SAAS,QAAQ,SAAS,EAAE,GAAK,IAAI,EAClD,GAAI,CAAC,OAAO,SAAS,MAAO,IAAI,EAAG,SAAS,MAAQ,KACpD,GAAI,SAAW,MAAQ,OAAO,OAAS,QAAQ,OAAO,MAAO,CAC3D,YAAc,OAAO,eAAe,GAAI,SAAW,OAAS,CAC1D,SAAS,MAAQ,KACnB,EAAG,CAAE,MAAM,CAAE,CACf,CACF,EACA,CAAE,UAAW,KAAM,MAAO,MAAM,CAAE,EAEpC,eAAe,IAAK,CAClB,cAAa,EACb,KAAI,CACN,CAAC,EACD,OAAO,QACT","names":[],"file":"context.js"}
|
package/dist/form/contracts.d.ts
CHANGED
|
@@ -46,6 +46,14 @@ export declare const formValueControlInventory: Readonly<{
|
|
|
46
46
|
family: "selection";
|
|
47
47
|
phase: "simple";
|
|
48
48
|
};
|
|
49
|
+
TreeSelectRoot: {
|
|
50
|
+
family: "selection";
|
|
51
|
+
phase: "simple";
|
|
52
|
+
};
|
|
53
|
+
TransferRoot: {
|
|
54
|
+
family: "selection";
|
|
55
|
+
phase: "simple";
|
|
56
|
+
};
|
|
49
57
|
CascadeListRoot: {
|
|
50
58
|
family: "selection";
|
|
51
59
|
phase: "simple";
|
|
@@ -82,6 +90,10 @@ export declare const formValueControlInventory: Readonly<{
|
|
|
82
90
|
family: "numeric";
|
|
83
91
|
phase: "simple";
|
|
84
92
|
};
|
|
93
|
+
FileInputRoot: {
|
|
94
|
+
family: "compound";
|
|
95
|
+
phase: "compound";
|
|
96
|
+
};
|
|
85
97
|
DateField: {
|
|
86
98
|
family: "compound";
|
|
87
99
|
phase: "compound";
|
|
@@ -94,6 +106,10 @@ export declare const formValueControlInventory: Readonly<{
|
|
|
94
106
|
family: "compound";
|
|
95
107
|
phase: "compound";
|
|
96
108
|
};
|
|
109
|
+
TimePickerRoot: {
|
|
110
|
+
family: "compound";
|
|
111
|
+
phase: "compound";
|
|
112
|
+
};
|
|
97
113
|
DateRangeFieldRoot: {
|
|
98
114
|
family: "compound";
|
|
99
115
|
phase: "compound";
|
|
@@ -102,6 +118,10 @@ export declare const formValueControlInventory: Readonly<{
|
|
|
102
118
|
family: "compound";
|
|
103
119
|
phase: "compound";
|
|
104
120
|
};
|
|
121
|
+
DateTimeRangeFieldRoot: {
|
|
122
|
+
family: "compound";
|
|
123
|
+
phase: "compound";
|
|
124
|
+
};
|
|
105
125
|
SliderRoot: {
|
|
106
126
|
family: "compound";
|
|
107
127
|
phase: "compound";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const formValueControlInventory=Object.freeze({TextField:{family:"scalar",phase:"simple"},NumberField:{family:"numeric",phase:"simple"},CheckboxRoot:{family:"boolean",phase:"simple"},SwitchRoot:{family:"boolean",phase:"simple"},CheckboxGroupRoot:{family:"group",phase:"simple"},RadioGroupRoot:{family:"group",phase:"simple"},ListboxRoot:{family:"selection",phase:"simple"},SelectRoot:{family:"selection",phase:"simple"},ComboboxRoot:{family:"selection",phase:"simple"},CascadeListRoot:{family:"selection",phase:"simple"},CascadeSelectRoot:{family:"selection",phase:"simple"},RatingRoot:{family:"selection",phase:"simple"},ToggleGroupRoot:{family:"selection",phase:"simple"},EditableRoot:{family:"editable",phase:"simple"},TagsInputRoot:{family:"token",phase:"simple"},PinInputRoot:{family:"token",phase:"simple"},SpinButtonRoot:{family:"numeric",phase:"simple"},QuantityFieldRoot:{family:"numeric",phase:"simple"},DateField:{family:"compound",phase:"compound"},DateTimeField:{family:"compound",phase:"compound"},TimeField:{family:"compound",phase:"compound"},DateRangeFieldRoot:{family:"compound",phase:"compound"},TimeRangeFieldRoot:{family:"compound",phase:"compound"},SliderRoot:{family:"compound",phase:"compound"},MultiThumbSliderRoot:{family:"compound",phase:"compound"},ColorPickerRoot:{family:"compound",phase:"compound"},CalendarRoot:{family:"compound",phase:"compound"},RangeCalendarRoot:{family:"compound",phase:"compound"},DatePickerRoot:{family:"compound",phase:"compound"},DateRangePickerRoot:{family:"compound",phase:"compound"},DateTimePickerRoot:{family:"compound",phase:"compound"},DateTimeRangePickerRoot:{family:"compound",phase:"compound"},MonthPickerRoot:{family:"compound",phase:"compound"},MonthRangePickerRoot:{family:"compound",phase:"compound"},YearPickerRoot:{family:"compound",phase:"compound"},YearRangePickerRoot:{family:"compound",phase:"compound"}});export{formValueControlInventory};
|
|
1
|
+
const formValueControlInventory=Object.freeze({TextField:{family:"scalar",phase:"simple"},NumberField:{family:"numeric",phase:"simple"},CheckboxRoot:{family:"boolean",phase:"simple"},SwitchRoot:{family:"boolean",phase:"simple"},CheckboxGroupRoot:{family:"group",phase:"simple"},RadioGroupRoot:{family:"group",phase:"simple"},ListboxRoot:{family:"selection",phase:"simple"},SelectRoot:{family:"selection",phase:"simple"},ComboboxRoot:{family:"selection",phase:"simple"},TreeSelectRoot:{family:"selection",phase:"simple"},TransferRoot:{family:"selection",phase:"simple"},CascadeListRoot:{family:"selection",phase:"simple"},CascadeSelectRoot:{family:"selection",phase:"simple"},RatingRoot:{family:"selection",phase:"simple"},ToggleGroupRoot:{family:"selection",phase:"simple"},EditableRoot:{family:"editable",phase:"simple"},TagsInputRoot:{family:"token",phase:"simple"},PinInputRoot:{family:"token",phase:"simple"},SpinButtonRoot:{family:"numeric",phase:"simple"},QuantityFieldRoot:{family:"numeric",phase:"simple"},FileInputRoot:{family:"compound",phase:"compound"},DateField:{family:"compound",phase:"compound"},DateTimeField:{family:"compound",phase:"compound"},TimeField:{family:"compound",phase:"compound"},TimePickerRoot:{family:"compound",phase:"compound"},DateRangeFieldRoot:{family:"compound",phase:"compound"},TimeRangeFieldRoot:{family:"compound",phase:"compound"},DateTimeRangeFieldRoot:{family:"compound",phase:"compound"},SliderRoot:{family:"compound",phase:"compound"},MultiThumbSliderRoot:{family:"compound",phase:"compound"},ColorPickerRoot:{family:"compound",phase:"compound"},CalendarRoot:{family:"compound",phase:"compound"},RangeCalendarRoot:{family:"compound",phase:"compound"},DatePickerRoot:{family:"compound",phase:"compound"},DateRangePickerRoot:{family:"compound",phase:"compound"},DateTimePickerRoot:{family:"compound",phase:"compound"},DateTimeRangePickerRoot:{family:"compound",phase:"compound"},MonthPickerRoot:{family:"compound",phase:"compound"},MonthRangePickerRoot:{family:"compound",phase:"compound"},YearPickerRoot:{family:"compound",phase:"compound"},YearRangePickerRoot:{family:"compound",phase:"compound"}});export{formValueControlInventory};
|
|
2
2
|
//# sourceMappingURL=control-inventory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/form/control-inventory.ts"],"mappings":"AAsBO,MAAM,0BAA4B,OAAO,OAAO,CACrD,UAAW,CAAE,OAAQ,SAAU,MAAO,QAAQ,EAC9C,YAAa,CAAE,OAAQ,UAAW,MAAO,QAAQ,EACjD,aAAc,CAAE,OAAQ,UAAW,MAAO,QAAQ,EAClD,WAAY,CAAE,OAAQ,UAAW,MAAO,QAAQ,EAChD,kBAAmB,CAAE,OAAQ,QAAS,MAAO,QAAQ,EACrD,eAAgB,CAAE,OAAQ,QAAS,MAAO,QAAQ,EAClD,YAAa,CAAE,OAAQ,YAAa,MAAO,QAAQ,EACnD,WAAY,CAAE,OAAQ,YAAa,MAAO,QAAQ,EAClD,aAAc,CAAE,OAAQ,YAAa,MAAO,QAAQ,EACpD,gBAAiB,CAAE,OAAQ,YAAa,MAAO,QAAQ,EACvD,kBAAmB,CAAE,OAAQ,YAAa,MAAO,QAAQ,EACzD,WAAY,CAAE,OAAQ,YAAa,MAAO,QAAQ,EAClD,gBAAiB,CAAE,OAAQ,YAAa,MAAO,QAAQ,EACvD,aAAc,CAAE,OAAQ,WAAY,MAAO,QAAQ,EACnD,cAAe,CAAE,OAAQ,QAAS,MAAO,QAAQ,EACjD,aAAc,CAAE,OAAQ,QAAS,MAAO,QAAQ,EAChD,eAAgB,CAAE,OAAQ,UAAW,MAAO,QAAQ,EACpD,kBAAmB,CAAE,OAAQ,UAAW,MAAO,QAAQ,EACvD,UAAW,CAAE,OAAQ,WAAY,MAAO,UAAU,EAClD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AC5D,mBAAoB,CAAE,OAAQ,WAAY,MAAO,UAAU,EAC3D,wBAAyB,CAAE,OAAQ,WAAY,MAAO,UAAU,EAChE,gBAAiB,CAAE,OAAQ,WAAY,MAAO,UAAU,EACxD,qBAAsB,CAAE,OAAQ,WAAY,MAAO,UAAU,EAC7D,eAAgB,CAAE,OAAQ,WAAY,MAAO,UAAU,EACvD,oBAAqB,CAAE,OAAQ,WAAY,MAAO,UAAU,EACT","names":[],"file":"control-inventory.js"}
|
package/dist/form/control.d.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { type ComputedRef, type ShallowRef } from 'vue';
|
|
1
|
+
import { type ComputedRef, type ShallowRef, type VNodeChild } from 'vue';
|
|
2
2
|
export type FormControlPathSegment = string | number;
|
|
3
3
|
export type FormControlRelativePath = FormControlPathSegment | readonly FormControlPathSegment[];
|
|
4
4
|
export type FormControlSubmissionElement = HTMLButtonElement | HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
|
|
5
5
|
export type FormLabelMode = 'for' | 'labelledby' | 'legend';
|
|
6
|
+
/** Components use this literal option key so unused initializers remain tree-shakable. */
|
|
7
|
+
export declare const formLabelModeKey = "__sectileFormLabelMode";
|
|
8
|
+
/** Inspect materialized native/Fragment children without evaluating component slots. */
|
|
9
|
+
export declare function visitFormComponents(children: VNodeChild, visit: (component: Readonly<Record<string, unknown>>) => boolean | void): void;
|
|
6
10
|
export type FormMetadataAttribute = 'id' | 'name' | 'form' | 'required' | 'disabled' | 'readonly' | 'aria-describedby' | 'aria-errormessage' | 'aria-invalid' | 'aria-labelledby' | 'aria-disabled' | 'aria-required' | 'aria-readonly';
|
|
7
11
|
export interface FormControlCapabilities {
|
|
8
12
|
readonly id?: boolean;
|
|
13
|
+
readonly name?: boolean;
|
|
14
|
+
readonly form?: boolean;
|
|
9
15
|
readonly describedBy?: boolean;
|
|
10
16
|
readonly invalid?: boolean;
|
|
11
17
|
readonly labelledBy?: boolean;
|
|
@@ -38,21 +44,54 @@ export interface FormControlRegistration {
|
|
|
38
44
|
readonly capabilities?: FormControlCapabilities;
|
|
39
45
|
readonly explicit?: readonly FormMetadataAttribute[];
|
|
40
46
|
readonly reset?: () => void;
|
|
47
|
+
readonly prepareSubmission?: (() => void) | undefined;
|
|
41
48
|
readonly getValue?: (() => unknown) | undefined;
|
|
42
49
|
readonly isValueEqual?: ((current: unknown, baseline: unknown) => boolean) | undefined;
|
|
43
50
|
}
|
|
44
51
|
export interface FormControlParticipation {
|
|
45
52
|
readonly participating: boolean;
|
|
46
53
|
readonly controlProps: ComputedRef<Readonly<Record<string, unknown>>>;
|
|
54
|
+
/** Publish accepted asynchronous control values, or their explicit reset baseline. */
|
|
55
|
+
readonly refreshValue?: (mode?: 'value' | 'baseline') => void;
|
|
56
|
+
}
|
|
57
|
+
export interface FormFieldDefaults {
|
|
58
|
+
readonly disabled: boolean;
|
|
59
|
+
readonly readonly: boolean;
|
|
60
|
+
readonly required: boolean;
|
|
47
61
|
}
|
|
48
62
|
export interface FormControlFieldContext {
|
|
49
63
|
readonly registerControl: (registration: FormControlRegistration) => () => void;
|
|
50
64
|
readonly attributesFor: (registration: FormControlRegistration) => Readonly<Record<string, unknown>>;
|
|
65
|
+
readonly submissionAttributesFor: (submission: FormSubmissionRegistration) => Readonly<Record<string, unknown>>;
|
|
66
|
+
readonly defaults?: Readonly<ShallowRef<FormFieldDefaults>>;
|
|
67
|
+
readonly refreshControl?: (registration: FormControlRegistration, mode?: 'value' | 'baseline') => void;
|
|
51
68
|
}
|
|
69
|
+
export declare function formControlMetadata(registration: FormControlRegistration): Readonly<Record<string, unknown>> | undefined;
|
|
70
|
+
/** A native part owns metadata that cannot be inferred from absent DOM attributes. */
|
|
71
|
+
export declare function useFormSubmissionMetadata(owned?: readonly FormMetadataAttribute[]): (element: FormControlSubmissionElement | null) => void;
|
|
72
|
+
export declare function formSubmissionMetadata(element: HTMLElement): readonly FormMetadataAttribute[] | undefined;
|
|
73
|
+
/** Read inherited control defaults without registering another semantic control. */
|
|
74
|
+
export declare function useFormFieldDefaults(): ComputedRef<FormFieldDefaults> | undefined;
|
|
75
|
+
/** Match inherited native metadata with the controller's interaction policies. */
|
|
76
|
+
export declare function useFormControlFlags(props: Readonly<{
|
|
77
|
+
[Key in keyof FormFieldDefaults]?: boolean | undefined;
|
|
78
|
+
}>): ComputedRef<FormFieldDefaults>;
|
|
79
|
+
/** A derived control decorates its inner owner's registration, not a second control. */
|
|
80
|
+
export declare function provideFormControlReset(reset: () => void): void;
|
|
52
81
|
export declare function provideFormControlFieldContext(context: FormControlFieldContext): void;
|
|
82
|
+
/** Project an existing composite owner's native submission; never register another control. */
|
|
83
|
+
export declare function useFormSubmissionProps(submission: FormSubmissionRegistration, props?: Readonly<Partial<Record<'name' | 'form' | 'required' | 'disabled' | 'readonly', unknown>>>): ComputedRef<Readonly<Record<string, unknown>>>;
|
|
84
|
+
/** Project indexed submissions at render time without adding a Form dependency to controls. */
|
|
85
|
+
export declare function useFormSubmissionProjection(props?: Readonly<Partial<Record<'name' | 'form' | 'required' | 'disabled' | 'readonly', unknown>>>): (submission: FormSubmissionRegistration) => Readonly<Record<string, unknown>>;
|
|
86
|
+
/** Field-only projection for composite parts that own their interaction policies. */
|
|
87
|
+
export declare function useFormSubmissionDefaults(submission: FormSubmissionRegistration): ComputedRef<Readonly<Record<string, unknown>>>;
|
|
88
|
+
/** Preserve authored undefined separately from an absent native metadata attribute. */
|
|
89
|
+
export declare function useFormMetadataPresence(fixedExplicit?: readonly FormMetadataAttribute[]): Readonly<ShallowRef<readonly FormMetadataAttribute[]>>;
|
|
53
90
|
export declare function useFormControl(registration: FormControlRegistration): FormControlParticipation;
|
|
54
91
|
export declare const nativeInputControlCapabilities: Readonly<{
|
|
55
92
|
id: true;
|
|
93
|
+
name: true;
|
|
94
|
+
form: true;
|
|
56
95
|
describedBy: true;
|
|
57
96
|
invalid: true;
|
|
58
97
|
required: true;
|
|
@@ -84,6 +123,7 @@ export declare const hiddenValueSubmissionCapabilities: Readonly<{
|
|
|
84
123
|
}>;
|
|
85
124
|
export declare function useNativeInputFormControl(element: Readonly<ShallowRef<HTMLInputElement | HTMLTextAreaElement | null | undefined>>, options?: {
|
|
86
125
|
readonly reset?: () => void;
|
|
126
|
+
readonly prepareSubmission?: () => void;
|
|
87
127
|
readonly getValue?: () => unknown;
|
|
88
128
|
readonly isValueEqual?: (current: unknown, baseline: unknown) => boolean;
|
|
89
129
|
}): FormControlParticipation;
|
|
@@ -94,7 +134,10 @@ export declare function useCompositeFormControl(options: {
|
|
|
94
134
|
readonly submissions?: FormSubmissionSource;
|
|
95
135
|
readonly labelMode?: FormLabelMode;
|
|
96
136
|
readonly reset?: () => void;
|
|
137
|
+
readonly prepareSubmission?: () => void;
|
|
97
138
|
readonly getValue?: () => unknown;
|
|
98
139
|
readonly isValueEqual?: (current: unknown, baseline: unknown) => boolean;
|
|
99
140
|
}): FormControlParticipation;
|
|
100
141
|
export declare function provideFormControlOwner(): void;
|
|
142
|
+
/** An independent surface retains its Form root, while explicit fields establish fresh participation. */
|
|
143
|
+
export declare function provideFormControlBoundary(): void;
|
package/dist/form/control.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{computed,getCurrentInstance,inject,onBeforeUnmount,onMounted,provide}from
|
|
1
|
+
import{computed,getCurrentInstance,inject,onBeforeUpdate,onBeforeUnmount,onMounted,provide,shallowRef,Fragment,isVNode}from'vue';export const formLabelModeKey='__sectileFormLabelMode';export function visitFormComponents(children,visit){const pending=[children];while(pending.length>0){const child=pending.pop();if(Array.isArray(child)){for(let index=child.length-1;index>=0;index--)pending.push(child[index])}else if(isVNode(child)){const type=child.type;if(typeof type==='string'||type===Fragment)pending.push(child.children);else if((typeof type==='object'||typeof type==='function')&&visit(type)===false)return}}}class FormControlValueRefresh{#field;#registration;constructor(field,registration){this.#field=field;this.#registration=registration}refresh=(mode='value')=>{if(this.#registration)this.#field?.refreshControl?.(this.#registration,mode)};release(){this.#field=undefined;this.#registration=undefined}}const inactiveRefresh=()=>{};const formControlFieldContextKey=Symbol('SectileFormControlField');const formControlOwnerKey=Symbol('SectileFormControlOwner');const formControlResetKey=Symbol('SectileFormControlReset');const formControlFlagsKey=Symbol('SectileFormControlFlags');const controlMetadataKey=/* @__PURE__ */Symbol('SectileControlMetadata');export function formControlMetadata(registration){return registration[controlMetadataKey]}const formFlagKeys=['disabled','readonly','required'];const submissionMetadataKey=/* @__PURE__ */Symbol('SectileSubmissionMetadata');export function useFormSubmissionMetadata(owned=[]){const explicit=useFormMetadataPresence(owned);let current=null;const release=()=>{if(current?.[submissionMetadataKey]===explicit)delete current[submissionMetadataKey];current=null};onBeforeUnmount(release);return element=>{if(element===current)return;release();current=element;if(current!==null)current[submissionMetadataKey]=explicit}}export function formSubmissionMetadata(element){return element[submissionMetadataKey]?.value}function useParticipatingField(){return inject(formControlOwnerKey,false)?null:inject(formControlFieldContextKey,null)}function fieldDefaultsView(source){return computed(()=>source.value)}export function useFormFieldDefaults(){const source=useParticipatingField()?.defaults;return source===undefined?undefined:fieldDefaultsView(source)}export function useFormControlFlags(props){const defaults=useParticipatingField()?.defaults;const explicit=useFormMetadataPresence();const flags=computed(previous=>{const next={};for(const key of formFlagKeys)next[key]=explicit.value.includes(key)?props[key]===true:defaults?.value[key]??props[key]===true;return previous!==undefined&&formFlagKeys.every(key=>previous[key]===next[key])?previous:Object.freeze(next)});provide(formControlFlagsKey,{defaults:flags,explicit:computed(()=>formFlagKeys.filter(key=>explicit.value.includes(key)))});return flags}export function provideFormControlReset(reset){const field=inject(formControlFieldContextKey,null);if(field!==null)provide(formControlResetKey,{field,reset})}export function provideFormControlFieldContext(context){provide(formControlFieldContextKey,context);provide(formControlOwnerKey,false);provide(formControlFlagsKey,null)}export function useFormSubmissionProps(submission,props){const project=useFormSubmissionProjection(props);return computed(()=>project(submission))}export function useFormSubmissionProjection(props){const project=useSubmissionDefaultsProjection();const explicit=props===undefined?undefined:useFormMetadataPresence();return submission=>{const attributes=project(submission);if(props!==undefined)for(const key of['name','form','required','disabled','readonly']){if(submission.capabilities?.[key]===true&&(explicit.value.includes(key)||attributes[key]===undefined))attributes[key]=props[key]}return attributes}}export function useFormSubmissionDefaults(submission){const field=useParticipatingField();return computed(()=>field?.submissionAttributesFor(submission)??{})}function useSubmissionDefaultsProjection(){const field=useParticipatingField();const scoped=inject(formControlFlagsKey,null);return submission=>{const inherited={...field?.submissionAttributesFor(submission)};if(field!==null&&scoped!==null)for(const key of formFlagKeys){if(submission.capabilities?.[key]===true&&scoped.explicit.value.includes(key))inherited[key]=scoped.defaults.value[key]}return inherited}}export function useFormMetadataPresence(fixedExplicit=[]){const instance=getCurrentInstance();const fixed=[...fixedExplicit];const authored=metadataAttributes.map(attribute=>hasMetadataAttribute(instance?.vnode.props??null,attribute));const collectExplicit=()=>Object.freeze([...new Set([...fixed,...metadataAttributes.filter((_attribute,index)=>authored[index])])]);const explicit=shallowRef(collectExplicit());onBeforeUpdate(()=>{let changed=false;for(let index=0;index<metadataAttributes.length;index++){const next=hasMetadataAttribute(instance?.vnode.props??null,metadataAttributes[index]);if(next!==authored[index]){authored[index]=next;changed=true}}if(changed)explicit.value=collectExplicit()});return explicit}export function useFormControl(registration){const field=useParticipatingField();const resetOwner=inject(formControlResetKey,null);if(field===null)return Object.freeze({participating:false,controlProps:computed(()=>Object.freeze({}))});const explicit=useFormMetadataPresence(registration.explicit);const scoped=registration[formControlFlagsKey];const combinedExplicit=scoped===undefined?explicit:computed(()=>[...new Set([...scoped.value,...explicit.value])]);const normalized={...registration,[controlMetadataKey]:getCurrentInstance()?.props,get explicit(){return combinedExplicit.value}};if(resetOwner?.field===field){const reset=normalized.reset;normalized.reset=()=>{resetOwner.reset();reset?.()}}Object.freeze(normalized);const controlProps=computed(()=>field.attributesFor(normalized));let unregister;let refresher,disposed=false;onMounted(()=>{unregister=field.registerControl(normalized)});onBeforeUnmount(()=>{disposed=true;try{unregister?.()}finally{unregister=undefined;refresher?.release()}});return Object.freeze({participating:true,controlProps,get refreshValue(){if(disposed)return inactiveRefresh;refresher??=new FormControlValueRefresh(field,normalized);return refresher.refresh}})}export const nativeInputControlCapabilities=Object.freeze({id:true,name:true,form:true,describedBy:true,invalid:true,required:true,disabled:true,readonly:true});export const compositeControlCapabilities=Object.freeze({id:true,describedBy:true,invalid:true,labelledBy:true});export const hiddenInputSubmissionCapabilities=Object.freeze({name:true,form:true,required:true,disabled:true});export const hiddenSelectSubmissionCapabilities=hiddenInputSubmissionCapabilities;export const hiddenValueSubmissionCapabilities=Object.freeze({name:true,form:true,disabled:true});export function useNativeInputFormControl(element,options={}){const registration={[formControlFlagsKey]:inject(formControlFlagsKey,null)?.explicit,element,semanticControl:element,focusTarget:element,validationTarget:element,labelMode:'for',capabilities:nativeInputControlCapabilities};return useFormControl(withFormCallbacks(registration,options))}export function useCompositeFormControl(options){return useFormControl(withFormCallbacks({element:options.root,semanticControl:options.root,focusTarget:options.focusTarget??options.root,validationTarget:options.validationTarget??options.root,labelMode:options.labelMode??'labelledby',capabilities:compositeControlCapabilities,...options.submissions===undefined?{}:{submissions:options.submissions}},options))}const formCallbackKeys=['reset','prepareSubmission','getValue','isValueEqual'];function withFormCallbacks(registration,options){const target=registration;for(const key of formCallbackKeys){const callback=options[key];if(callback!==undefined)target[key]=callback}return registration}export function provideFormControlOwner(){provide(formControlOwnerKey,true)}export function provideFormControlBoundary(){provide(formControlFieldContextKey,null);provide(formControlOwnerKey,false);provide(formControlFlagsKey,null)}const metadataAliases={id:'id',name:'name',form:'form',required:'required',disabled:'disabled',readonly:'readOnly','aria-describedby':'ariaDescribedby','aria-errormessage':'ariaErrormessage','aria-invalid':'ariaInvalid','aria-labelledby':'ariaLabelledby','aria-disabled':'ariaDisabled','aria-required':'ariaRequired','aria-readonly':'ariaReadonly'};const metadataAttributes=Object.keys(metadataAliases);function hasMetadataAttribute(vnodeProps,attribute){return vnodeProps!==null&&(Object.hasOwn(vnodeProps,attribute)||Object.hasOwn(vnodeProps,metadataAliases[attribute]))}
|
|
2
2
|
//# sourceMappingURL=control.js.map
|
package/dist/form/control.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/form/control.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"control.js","names":["computed","getCurrentInstance","inject","onBeforeUpdate","onBeforeUnmount","onMounted","provide","shallowRef","Fragment","isVNode","formLabelModeKey","visitFormComponents","children","visit","pending","length","child","pop","Array","isArray","index","push","type","FormControlValueRefresh","field","registration","constructor","this","refresh","mode","refreshControl","release","undefined","inactiveRefresh","formControlFieldContextKey","Symbol","formControlOwnerKey","formControlResetKey","formControlFlagsKey","controlMetadataKey","formControlMetadata","formFlagKeys","submissionMetadataKey","useFormSubmissionMetadata","owned","explicit","useFormMetadataPresence","current","element","formSubmissionMetadata","value","useParticipatingField","fieldDefaultsView","source","useFormFieldDefaults","defaults","useFormControlFlags","props","flags","previous","next","key","includes","every","Object","freeze","filter","provideFormControlReset","reset","provideFormControlFieldContext","context","useFormSubmissionProps","submission","project","useFormSubmissionProjection","useSubmissionDefaultsProjection","attributes","capabilities","useFormSubmissionDefaults","submissionAttributesFor","scoped","inherited","fixedExplicit","instance","fixed","authored","metadataAttributes","map","attribute","hasMetadataAttribute","vnode","collectExplicit","Set","_attribute","changed","useFormControl","resetOwner","participating","controlProps","combinedExplicit","normalized","attributesFor","unregister","refresher","disposed","registerControl","refreshValue","nativeInputControlCapabilities","id","name","form","describedBy","invalid","required","disabled","readonly","compositeControlCapabilities","labelledBy","hiddenInputSubmissionCapabilities","hiddenSelectSubmissionCapabilities","hiddenValueSubmissionCapabilities","useNativeInputFormControl","options","semanticControl","focusTarget","validationTarget","labelMode","withFormCallbacks","useCompositeFormControl","root","submissions","formCallbackKeys","target","callback","provideFormControlOwner","provideFormControlBoundary","metadataAliases","keys","vnodeProps","hasOwn"],"sources":["../../src/form/control.ts"],"mappings":"OACEA,SACAC,mBACAC,OACAC,eACAC,gBACAC,UACAC,QACAC,WACAC,SACAC,YAIK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5C,CACA,OAAO5G,YACT,QAEM,SAAU6G,0BACdhI,QAAQ8B,oBAAqB,KAC/B,QAGM,SAAUmG,6BACdjI,QAAQ4B,2BAA4B,MACpC5B,QAAQ8B,oBAAqB,OAC7B9B,QAAQgC,oBAAqB,KAC/B,CAEA,MAAMkG,gBAAmE,CACvE5B,GAAI,KAAMC,KAAM,OAAQC,KAAM,OAAQG,SAAU,WAAYC,SAAU,WACtEC,SAAU,WACV,mBAAoB,kBACpB,oBAAqB,mBACrB,eAAgB,cAChB,kBAAmB,iBACnB,gBAAiB,eACjB,gBAAiB,eACjB,gBAAiB,gBAEnB,MAAM7B,mBAAqBtB,OAAOyE,KAAKD,iBAEvC,SAAS/C,qBACPiD,WACAlD,WAEA,OAAOkD,aAAe,OAAS1E,OAAO2E,OAAOD,WAAYlD,YAAcxB,OAAO2E,OAAOD,WAAYF,gBAAgBhD,YACnH","ignoreList":[]}
|
package/dist/form/field.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type PropType, type SlotsType, type VNodeChild } from 'vue';
|
|
2
2
|
import type { FormFieldPath } from '@sectile/form/path';
|
|
3
3
|
import type { FormFieldSlotProps } from './contracts.js';
|
|
4
|
+
import { type FormLabelMode } from './control.js';
|
|
4
5
|
export declare const FormField: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
6
|
as: {
|
|
6
7
|
type: PropType<import("../primitive.js").PrimitiveAs>;
|
|
@@ -34,6 +35,10 @@ export declare const FormField: import("vue").DefineComponent<import("vue").Extr
|
|
|
34
35
|
type: BooleanConstructor;
|
|
35
36
|
default: undefined;
|
|
36
37
|
};
|
|
38
|
+
labelMode: {
|
|
39
|
+
type: PropType<FormLabelMode>;
|
|
40
|
+
default: undefined;
|
|
41
|
+
};
|
|
37
42
|
}>, () => VNodeChild, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
38
43
|
as: {
|
|
39
44
|
type: PropType<import("../primitive.js").PrimitiveAs>;
|
|
@@ -67,6 +72,10 @@ export declare const FormField: import("vue").DefineComponent<import("vue").Extr
|
|
|
67
72
|
type: BooleanConstructor;
|
|
68
73
|
default: undefined;
|
|
69
74
|
};
|
|
75
|
+
labelMode: {
|
|
76
|
+
type: PropType<FormLabelMode>;
|
|
77
|
+
default: undefined;
|
|
78
|
+
};
|
|
70
79
|
}>> & Readonly<{}>, {
|
|
71
80
|
as: import("../primitive.js").PrimitiveAs;
|
|
72
81
|
asChild: boolean;
|
|
@@ -76,6 +85,7 @@ export declare const FormField: import("vue").DefineComponent<import("vue").Extr
|
|
|
76
85
|
required: boolean;
|
|
77
86
|
disabled: boolean;
|
|
78
87
|
readonly: boolean;
|
|
88
|
+
labelMode: FormLabelMode;
|
|
79
89
|
}, SlotsType<{
|
|
80
90
|
default: (props: FormFieldSlotProps) => VNodeChild;
|
|
81
91
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
package/dist/form/field.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defineComponent,computed,shallowRef,nextTick,onMounted,onBeforeUnmount,watch,provide,h,mergeProps}from"vue";import{partProps}from"./part.js";import{useFormContext,useFormFieldSelectorFromContext,formFieldContextKey}from"./context.js";import{useHostId}from"../host-provider.js";import{safeEncodeFormFieldPath,resolveElement,applyMetadata,resolveSubmissionRegistrations,nativeSubmissionCapabilities,safeEncodeSubmissionName,nativeCandidates,createNativeFallbackRegistration,sameSubmissionElements}from"./native.js";import{provideFormControlFieldContext}from"./control.js";import{useNextTickTask}from"../internal/scheduled-task.js";import{Primitive}from"../primitive.js";const FormField=defineComponent({name:"SectileFormField",inheritAttrs:false,props:{id:{type:String,default:void 0},name:{type:[String,Array],default:void 0},form:{type:String,default:void 0},required:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},readonly:{type:Boolean,default:void 0},...partProps},slots:Object,setup(props,{attrs,slots}){const formContext=useFormContext("FormField");const generatedId=useHostId();const id=computed(()=>props.id??`form-field-${generatedId}`);const nameKey=computed(()=>props.name===void 0?void 0:safeEncodeFormFieldPath(props.name)??void 0);const root=shallowRef(null);const controls=shallowRef([]);const fallback=shallowRef(null);const nativeFallbackProblem=shallowRef(null);const appliedAttributes=new Map;let observer;let unregister;let diagnosticId;let observedTargets=[];let warnedMultipleControls=false;const activeRegistrations=computed(()=>controls.value.filter(registration=>resolveElement(registration.element)!==null));const activeControl=computed(()=>activeRegistrations.value.length===1?activeRegistrations.value[0]:controls.value.length===0?fallback.value:null);const labelMode=computed(()=>activeControl.value?.labelMode??"for");const semanticControl=()=>{const registration=activeControl.value;if(registration===void 0||registration===null)return null;return resolveElement(registration.semanticControl??registration.element)};const effectiveControlId=computed(()=>semanticControl()?.getAttribute("id")?.trim()||`${id.value}-control`);const fieldState=useFormFieldSelectorFromContext(formContext,()=>id.value,()=>field=>field);const fieldActions=Object.freeze({setMeta:meta=>formContext.connection.value?.setFieldMeta(id.value,meta)??false,replaceIssues:(source,issues)=>formContext.connection.value?.replaceFieldIssues(id.value,source,issues)??false,upsertIssue:issue=>formContext.connection.value?.upsertFieldIssue(id.value,issue)??false,removeIssue:issueId=>formContext.connection.value?.removeFieldIssue(id.value,issueId)??false,clearIssues:source=>formContext.connection.value?.clearFieldIssues(id.value,source)??false});const slotProps=computed(()=>{const current=fieldState.value;const descriptionId=`${id.value}-description`;const messageId=`${id.value}-message`;const relatedIssues=current?.relatedIssues??[];const describedBy=`${descriptionId} ${messageId}${relatedIssues.length===0?"":` ${formContext.summaryId}`}`;const valid=current?.valid??true;return Object.freeze({id:id.value,controlId:effectiveControlId.value,labelId:`${id.value}-label`,descriptionId,messageId,describedBy,valid,touched:current?.touched??false,dirty:current?.dirty??false,issues:current?.issues??[],relatedIssues,...fieldActions})});const attributesFor=registration=>{const explicit=new Set(registration.explicit??[]);const capabilities=registration.capabilities??{};const attributes={};const assign=(attribute,value)=>{if(!explicit.has(attribute)&&value!==void 0)attributes[attribute]=value};if(capabilities.id===true)assign("id",slotProps.value.controlId);if(capabilities.describedBy===true){assign("aria-describedby",slotProps.value.describedBy);assign("aria-errormessage",slotProps.value.issues.length>0?slotProps.value.messageId:slotProps.value.relatedIssues.length>0?formContext.summaryId:slotProps.value.messageId)}if(capabilities.invalid===true&&!slotProps.value.valid)assign("aria-invalid","true");if(capabilities.labelledBy===true&&labelMode.value==="labelledby"){assign("aria-labelledby",slotProps.value.labelId)}if(capabilities.required===true&&props.required===true)assign("required",true);else if(labelMode.value!=="for"&&props.required===true)assign("aria-required","true");if(capabilities.disabled===true&&props.disabled===true)assign("disabled",true);else if(labelMode.value!=="for"&&props.disabled===true)assign("aria-disabled","true");if(capabilities.readonly===true&&props.readonly===true)assign("readonly",true);else if(labelMode.value!=="for"&&props.readonly===true)assign("aria-readonly","true");if(labelMode.value!=="for"){const refreshValue=()=>{queueMicrotask(()=>formContext.connection.value?.refreshParticipant(id.value))};attributes["onClick"]=refreshValue;attributes["onKeydown"]=refreshValue}return Object.freeze(attributes)};const restoreControlAttributes=()=>{for(const[element,attributes]of appliedAttributes){for(const[name,previous]of attributes){if(previous===null)element.removeAttribute(name);else element.setAttribute(name,previous)}}appliedAttributes.clear()};const applyControlAttributes=()=>{restoreControlAttributes();const registration=activeControl.value;if(registration===void 0||registration===null)return;const semantic=resolveElement(registration.semanticControl??registration.element);if(semantic!==null){applyMetadata(semantic,attributesFor(registration),registration.explicit,appliedAttributes)}for(const submission of resolveSubmissionRegistrations(registration)){const element=resolveElement(submission.element);if(element===null)continue;const capabilities=submission.capabilities??nativeSubmissionCapabilities(element);const explicit=submission.explicit??registration.explicit;const attributes={};if(capabilities.name===true&&nameKey.value!==void 0){const submissionName=safeEncodeSubmissionName(nameKey.value,submission.relativeName);if(submissionName!==null)attributes["name"]=submissionName}if(capabilities.form===true&&props.form!==void 0)attributes["form"]=props.form;if(capabilities.required===true&&props.required===true)attributes["required"]=true;if(capabilities.disabled===true&&props.disabled===true)attributes["disabled"]=true;if(capabilities.readonly===true&&props.readonly===true)attributes["readonly"]=true;applyMetadata(element,attributes,explicit,appliedAttributes)}};const discoverNativeFallback=()=>{if(controls.value.length>0||root.value===null){fallback.value=null;nativeFallbackProblem.value=null;return}const candidates=nativeCandidates(root.value);const discovered=createNativeFallbackRegistration(root.value,candidates);nativeFallbackProblem.value=discovered.problem;if(discovered.registration===null){fallback.value=null;return}const next=discovered.registration;const current=fallback.value;if(current!==null&&resolveElement(current.semanticControl??current.element)===resolveElement(next.semanticControl??next.element)&&sameSubmissionElements(resolveSubmissionRegistrations(current),resolveSubmissionRegistrations(next)))return;fallback.value=next};const syncDiagnostic=()=>{const currentId=id.value;if(diagnosticId!==void 0&&diagnosticId!==currentId){formContext.setFieldDiagnostic(diagnosticId,null)}diagnosticId=currentId;let message=null;if(props.name!==void 0&&nameKey.value===void 0){message="FormField received an invalid field path."}else if(activeRegistrations.value.length>1){message="FormField received multiple active controls. Register one composite control with explicit targets."}else if(controls.value.length>0&&activeRegistrations.value.length===0){message="FormField has no mounted control target."}else if(nativeFallbackProblem.value!==null){message=nativeFallbackProblem.value}else{const registration=activeControl.value;if(registration!==null&®istration!==void 0){const invalidRelativeName=resolveSubmissionRegistrations(registration).some(submission=>submission.relativeName!==void 0&&nameKey.value!==void 0&&safeEncodeSubmissionName(nameKey.value,submission.relativeName)===null);if(invalidRelativeName)message="FormField received an invalid relative submission path."}}formContext.setFieldDiagnostic(currentId,message===null?null:Object.freeze({id:`${currentId}:composition`,fieldId:currentId,message,source:"field"}))};const refreshParticipantTargets=()=>{const registration=activeControl.value;const next=registration===null||registration===void 0?root.value===null?[]:[root.value]:[root.value,resolveElement(registration.semanticControl??registration.element),resolveElement(registration.focusTarget??registration.element),resolveElement(registration.validationTarget??registration.element),...resolveSubmissionRegistrations(registration).map(submission=>resolveElement(submission.element))].filter(element=>element!==null);if(next.length===observedTargets.length&&next.every((element,index)=>element===observedTargets[index]))return;observedTargets=Object.freeze([...next]);formContext.connection.value?.refreshParticipant(id.value)};const registerControl=registration=>{controls.value=[...controls.value,registration];fallback.value=null;void nextTick(()=>{if(!warnedMultipleControls&&activeRegistrations.value.length>1){warnedMultipleControls=true;console.warn("[Sectile] FormField received multiple active control registrations. Register one composite control with explicit semantic, focus, and submission targets.")}applyControlAttributes();syncDiagnostic();refreshParticipantTargets()});return()=>{controls.value=controls.value.filter(candidate=>candidate!==registration);discoverNativeFallback();void nextTick(()=>{applyControlAttributes();syncDiagnostic();refreshParticipantTargets()})}};const mount=()=>{unregister?.();unregister=void 0;if(root.value===null)return;discoverNativeFallback();observer?.disconnect();observer=new MutationObserver(()=>{discoverNativeFallback();applyControlAttributes();syncDiagnostic();refreshParticipantTargets()});observer.observe(root.value,{childList:true,subtree:true});applyControlAttributes();const participant={id:id.value,get element(){return root.value},get semanticControl(){return semanticControl()??root.value},get focusTarget(){const registration=activeControl.value;return registration===void 0||registration===null?root.value:resolveElement(registration.focusTarget??registration.semanticControl??registration.element)??root.value},get validationTarget(){const registration=activeControl.value;return registration===void 0||registration===null?root.value:resolveElement(registration.validationTarget??registration.semanticControl??registration.element)??root.value},get submissionElements(){const registration=activeControl.value;if(registration===void 0||registration===null)return[];return resolveSubmissionRegistrations(registration).map(submission=>resolveElement(submission.element)).filter(element=>element!==null)},focus:()=>{const registration=activeControl.value;const control=registration===void 0||registration===null?null:resolveElement(registration.focusTarget??registration.semanticControl??registration.element);control?.focus();return control!==null&&document.activeElement===control},reset:()=>activeControl.value?.reset?.(),get getValue(){return activeControl.value?.getValue},get isValueEqual(){return activeControl.value?.isValueEqual},...nameKey.value===void 0?{}:{name:nameKey.value}};unregister=formContext.register(participant);observedTargets=Object.freeze([participant.element,participant.semanticControl??participant.element,participant.focusTarget??participant.element,participant.validationTarget??participant.element,...participant.submissionElements??[]]);syncDiagnostic()};const mountTask=useNextTickTask(mount);onMounted(mountTask.schedule);onBeforeUnmount(()=>{mountTask.cancel();observer?.disconnect();observer=void 0;restoreControlAttributes();if(diagnosticId!==void 0)formContext.setFieldDiagnostic(diagnosticId,null);unregister?.();unregister=void 0});watch([id,nameKey],mountTask.schedule);watch([activeControl,effectiveControlId,labelMode,nameKey,()=>props.form,()=>props.required,()=>props.disabled,()=>props.readonly,()=>slotProps.value.valid],()=>{applyControlAttributes();syncDiagnostic()},{flush:"post"});provide(formFieldContextKey,{slotProps,labelMode,registerControl,attributesFor});provideFormControlFieldContext({registerControl,attributesFor});return()=>h(Primitive,mergeProps(attrs,{as:props.as,asChild:props.asChild,elementRef:element=>{root.value=element},"data-scope":"form","data-part":"field","data-valid":slotProps.value.valid?"":void 0,"data-invalid":slotProps.value.valid?void 0:"","data-touched":slotProps.value.touched?"":void 0,"data-dirty":slotProps.value.dirty?"":void 0}),{default:()=>slots["default"]?.(slotProps.value)})}});export{FormField};
|
|
1
|
+
import{defineComponent,computed,shallowRef,nextTick,onMounted,onBeforeUnmount,watch,provide,h,mergeProps}from"vue";import{partProps}from"./part.js";import{useFormContext,useFormFieldSelectorFromContext,formFieldContextKey}from"./context.js";import{provideHostActive,useHostActive,useHostId}from"../host-provider.js";import{safeEncodeFormFieldPath,resolveElement,applyMetadata,resolveSubmissionRegistrations,nativeSubmissionCapabilities,safeEncodeSubmissionName,nativeCandidates,createNativeFallbackRegistration,sameSubmissionElements}from"./native.js";import{provideFormControlFieldContext,formLabelModeKey,formSubmissionMetadata,visitFormComponents,formControlMetadata}from"./control.js";import{useNextTickTask}from"../internal/scheduled-task.js";import{Primitive}from"../primitive.js";const FormField=defineComponent({name:"SectileFormField",inheritAttrs:false,props:{id:{type:String,default:void 0},name:{type:[String,Array],default:void 0},form:{type:String,default:void 0},required:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},readonly:{type:Boolean,default:void 0},labelMode:{type:String,default:void 0},...partProps},slots:Object,setup(props,{attrs,slots}){const formContext=useFormContext("FormField");const hostAvailability=useHostActive();const availability=computed(()=>hostAvailability.value&&formContext.active.value);const observing=shallowRef(true);const active=computed(()=>availability.value&&observing.value);provideHostActive(active);const generatedId=useHostId();const id=computed(()=>props.id??`form-field-${generatedId}`);const nameKey=computed(()=>props.name===void 0?void 0:safeEncodeFormFieldPath(props.name)??void 0);const root=shallowRef(null);const controlDefaults=shallowRef(Object.freeze({disabled:props.disabled===true,readonly:props.readonly===true,required:props.required===true}));const controls=shallowRef([]);const declaredLabelMode=shallowRef();const fallback=shallowRef(null);const nativeFallbackProblem=shallowRef(null);const appliedAttributes=new Map;let observer;let unregister;let registeredId;let remountPending=false;let disposed=false;let activityGeneration=0;let diagnosticId;let observedTargets=[];let warnedMultipleControls=false;const activeRegistrations=computed(()=>controls.value.filter(registration=>resolveElement(registration.element)!==null));const activeControl=computed(()=>activeRegistrations.value.length===1?activeRegistrations.value[0]:controls.value.length===0?fallback.value:null);const labelMode=computed(()=>props.labelMode??activeControl.value?.labelMode??declaredLabelMode.value??"for");const semanticControl=()=>{const registration=activeControl.value;if(registration===void 0||registration===null)return null;return resolveElement(registration.semanticControl??registration.element)};const effectiveControlId=computed(()=>semanticControl()?.getAttribute("id")?.trim()||`${id.value}-control`);const fieldState=useFormFieldSelectorFromContext(formContext,()=>id.value,()=>field=>field);const fieldActions=Object.freeze({setMeta:meta=>formContext.connection.value?.setFieldMeta(id.value,meta)??false,replaceIssues:(source,issues)=>formContext.connection.value?.replaceFieldIssues(id.value,source,issues)??false,upsertIssue:issue=>formContext.connection.value?.upsertFieldIssue(id.value,issue)??false,removeIssue:issueId=>formContext.connection.value?.removeFieldIssue(id.value,issueId)??false,clearIssues:source=>formContext.connection.value?.clearFieldIssues(id.value,source)??false});const slotProps=computed(()=>{const current=fieldState.value;const descriptionId=`${id.value}-description`;const messageId=`${id.value}-message`;const relatedIssues=current?.relatedIssues??[];const describedBy=`${descriptionId} ${messageId}${relatedIssues.length===0?"":` ${formContext.summaryId}`}`;const valid=current?.valid??true;return Object.freeze({id:id.value,controlId:effectiveControlId.value,labelId:`${id.value}-label`,descriptionId,messageId,describedBy,valid,touched:current?.touched??false,dirty:current?.dirty??false,issues:current?.issues??[],relatedIssues,...fieldActions})});const attributesFor=registration=>{const explicit=new Set(registration.explicit??[]);const capabilities=registration.capabilities??{};const authored=formControlMetadata(registration);const required=explicit.has("required")?authored?.["required"]===true:props.required===true;const disabled=explicit.has("disabled")?authored?.["disabled"]===true:props.disabled===true;const readonly=explicit.has("readonly")?authored?.["readonly"]===true:props.readonly===true;const attributes={};const assign=(attribute,value)=>{if(!explicit.has(attribute)&&value!==void 0)attributes[attribute]=value};if(capabilities.id===true)assign("id",slotProps.value.controlId);if(capabilities.name===true)assign("name",nameKey.value);if(capabilities.form===true)assign("form",props.form);if(capabilities.describedBy===true){assign("aria-describedby",slotProps.value.describedBy);assign("aria-errormessage",slotProps.value.issues.length>0?slotProps.value.messageId:slotProps.value.relatedIssues.length>0?formContext.summaryId:slotProps.value.messageId)}if(capabilities.invalid===true&&!slotProps.value.valid)assign("aria-invalid","true");if(capabilities.labelledBy===true&&labelMode.value==="labelledby"){assign("aria-labelledby",slotProps.value.labelId)}if(capabilities.required===true&&required)assign("required",true);else if(labelMode.value!=="for"&&required)assign("aria-required","true");if(capabilities.disabled===true&&disabled)assign("disabled",true);else if(labelMode.value!=="for"&&disabled)assign("aria-disabled","true");if(capabilities.readonly===true&&readonly)assign("readonly",true);else if(labelMode.value!=="for"&&readonly)assign("aria-readonly","true");if(labelMode.value!=="for"){const refreshValue=()=>{const generation=activityGeneration;queueMicrotask(()=>{if(!disposed&&active.value&&generation===activityGeneration)formContext.connection.value?.refreshParticipant(id.value)})};attributes["onClick"]=refreshValue;attributes["onKeydown"]=refreshValue}return Object.freeze(attributes)};const submissionAttributesFor=(submission,resolved)=>{const element=submission.capabilities===void 0?resolved??resolveElement(submission.element):null;const capabilities=submission.capabilities??(element===null?{}:nativeSubmissionCapabilities(element));const attributes={};if(capabilities.name===true&&nameKey.value!==void 0){const submissionName=safeEncodeSubmissionName(nameKey.value,submission.relativeName);if(submissionName!==null)attributes["name"]=submissionName}if(capabilities.form===true&&props.form!==void 0)attributes["form"]=props.form;if(capabilities.required===true&&props.required===true)attributes["required"]=true;if(capabilities.disabled===true&&props.disabled===true)attributes["disabled"]=true;if(capabilities.readonly===true&&props.readonly===true)attributes["readonly"]=true;return Object.freeze(attributes)};const restoreControlAttributes=()=>{for(const[element,attributes]of appliedAttributes){for(const[name,previous]of attributes){if(previous===null)element.removeAttribute(name);else element.setAttribute(name,previous)}}appliedAttributes.clear()};const applyControlAttributes=()=>{if(!active.value||disposed)return;restoreControlAttributes();const registration=activeControl.value;if(registration===void 0||registration===null)return;const semantic=resolveElement(registration.semanticControl??registration.element);if(semantic!==null){applyMetadata(semantic,attributesFor(registration),registration.explicit,appliedAttributes)}for(const submission of resolveSubmissionRegistrations(registration)){const element=resolveElement(submission.element);if(element===null)continue;const explicit=formSubmissionMetadata(element)??submission.explicit??registration.explicit;applyMetadata(element,submissionAttributesFor(submission,element),explicit,appliedAttributes)}};const discoverNativeFallback=()=>{if(!active.value||disposed)return;if(controls.value.length>0||root.value===null){fallback.value=null;nativeFallbackProblem.value=null;return}const candidates=nativeCandidates(root.value);const discovered=createNativeFallbackRegistration(root.value,candidates);nativeFallbackProblem.value=discovered.problem;if(discovered.registration===null){fallback.value=null;return}const next=discovered.registration;const current=fallback.value;if(current!==null&&resolveElement(current.semanticControl??current.element)===resolveElement(next.semanticControl??next.element)&&sameSubmissionElements(resolveSubmissionRegistrations(current),resolveSubmissionRegistrations(next)))return;fallback.value=next};const syncDiagnostic=()=>{if(!active.value||disposed)return;const currentId=id.value;if(diagnosticId!==void 0&&diagnosticId!==currentId){formContext.setFieldDiagnostic(diagnosticId,null)}diagnosticId=currentId;let message=null;if(props.name!==void 0&&nameKey.value===void 0){message="FormField received an invalid field path."}else if(activeRegistrations.value.length>1){message="FormField received multiple active controls. Register one composite control with explicit targets."}else if(controls.value.length>0&&activeRegistrations.value.length===0){message="FormField has no mounted control target."}else if(nativeFallbackProblem.value!==null){message=nativeFallbackProblem.value}else{const registration=activeControl.value;if(registration!==null&®istration!==void 0){const invalidRelativeName=resolveSubmissionRegistrations(registration).some(submission=>submission.relativeName!==void 0&&nameKey.value!==void 0&&safeEncodeSubmissionName(nameKey.value,submission.relativeName)===null);if(invalidRelativeName)message="FormField received an invalid relative submission path."}}formContext.setFieldDiagnostic(currentId,message===null?null:Object.freeze({id:`${currentId}:composition`,fieldId:currentId,message,source:"field"}))};const refreshParticipantTargets=()=>{if(!active.value||disposed)return;const registration=activeControl.value;const next=registration===null||registration===void 0?root.value===null?[]:[root.value]:[root.value,resolveElement(registration.semanticControl??registration.element),resolveElement(registration.focusTarget??registration.element),resolveElement(registration.validationTarget??registration.element),...resolveSubmissionRegistrations(registration).map(submission=>resolveElement(submission.element))].filter(element=>element!==null);if(next.length===observedTargets.length&&next.every((element,index)=>element===observedTargets[index]))return;observedTargets=Object.freeze([...next]);formContext.connection.value?.refreshParticipant(id.value)};const registerControl=registration=>{controls.value=[...controls.value,registration];fallback.value=null;void nextTick(()=>{if(!warnedMultipleControls&&activeRegistrations.value.length>1){warnedMultipleControls=true;console.warn("[Sectile] FormField received multiple active control registrations. Register one composite control with explicit semantic, focus, and submission targets.")}applyControlAttributes();syncDiagnostic();refreshParticipantTargets()});return()=>{controls.value=controls.value.filter(candidate=>candidate!==registration);discoverNativeFallback();void nextTick(()=>{applyControlAttributes();syncDiagnostic();refreshParticipantTargets()})}};const observe=()=>{if(root.value===null||!active.value||disposed)return;observer??=new MutationObserver(()=>{if(!active.value||disposed)return;discoverNativeFallback();applyControlAttributes();syncDiagnostic();refreshParticipantTargets()});observer.observe(root.value,{childList:true,subtree:true})};const mount=()=>{if(root.value===null||!active.value||disposed)return;if(registeredId!==id.value){unregister?.();unregister=void 0;registeredId=void 0}discoverNativeFallback();observe();applyControlAttributes();const participant={id:id.value,get active(){return active.value},get element(){return root.value},get semanticControl(){return semanticControl()??root.value},get focusTarget(){const registration=activeControl.value;return registration===void 0||registration===null?root.value:resolveElement(registration.focusTarget??registration.semanticControl??registration.element)??root.value},get validationTarget(){const registration=activeControl.value;return registration===void 0||registration===null?root.value:resolveElement(registration.validationTarget??registration.semanticControl??registration.element)??root.value},get submissionElements(){const registration=activeControl.value;if(registration===void 0||registration===null)return[];return resolveSubmissionRegistrations(registration).map(submission=>resolveElement(submission.element)).filter(element=>element!==null)},focus:()=>{if(!active.value||disposed)return false;const registration=activeControl.value;const control=registration===void 0||registration===null?null:resolveElement(registration.focusTarget??registration.semanticControl??registration.element);control?.focus();return control!==null&&document.activeElement===control},reset:()=>activeControl.value?.reset?.(),get prepareSubmission(){return activeControl.value?.prepareSubmission},get getValue(){return activeControl.value?.getValue},get isValueEqual(){return activeControl.value?.isValueEqual},...nameKey.value===void 0?{}:{name:nameKey.value}};unregister=formContext.register(participant);registeredId=id.value;remountPending=false;observedTargets=Object.freeze([participant.element,participant.semanticControl??participant.element,participant.focusTarget??participant.element,participant.validationTarget??participant.element,...participant.submissionElements??[]]);syncDiagnostic()};const mountTask=useNextTickTask(mount);onMounted(mountTask.schedule);onBeforeUnmount(()=>{disposed=true;observing.value=false;activityGeneration+=1;mountTask.cancel();observer?.disconnect();observer=void 0;restoreControlAttributes();if(diagnosticId!==void 0)formContext.setFieldDiagnostic(diagnosticId,null);unregister?.();unregister=void 0;registeredId=void 0});watch(availability,next=>{if(next||disposed)return;observing.value=false;activityGeneration+=1;mountTask.cancel();observer?.disconnect();if(registeredId!==void 0)formContext.connection.value?.refreshParticipantActivity(registeredId)},{flush:"sync"});watch(availability,next=>{if(!next||disposed)return;observing.value=true;try{if(unregister===void 0||remountPending)mount();else{discoverNativeFallback();observe();applyControlAttributes();syncDiagnostic();refreshParticipantTargets()}if(registeredId!==void 0)formContext.connection.value?.refreshParticipantActivity(registeredId)}catch(error){observing.value=false;activityGeneration+=1;observer?.disconnect();try{if(registeredId!==void 0)formContext.connection.value?.refreshParticipantActivity(registeredId)}catch{}throw error}},{flush:"post"});watch(()=>activeControl.value?.explicit,restoreControlAttributes,{flush:"sync"});watch([id,nameKey],()=>{remountPending=true;if(active.value)mountTask.schedule()});watch([activeControl,()=>activeControl.value?.explicit,effectiveControlId,labelMode,nameKey,()=>props.form,()=>props.required,()=>props.disabled,()=>props.readonly,()=>slotProps.value.valid],()=>{const previous=controlDefaults.value;const disabled=props.disabled===true,readonly=props.readonly===true,required=props.required===true;if(previous.disabled!==disabled||previous.readonly!==readonly||previous.required!==required)controlDefaults.value=Object.freeze({disabled,readonly,required});applyControlAttributes();syncDiagnostic()},{flush:"post"});provide(formFieldContextKey,{slotProps,labelMode,registerControl,attributesFor});provideFormControlFieldContext({registerControl,attributesFor,submissionAttributesFor,defaults:controlDefaults,refreshControl(registration,mode="value"){if(active.value&&!disposed&®isteredId!==void 0&&activeControl.value===registration)formContext.connection.value?.refreshParticipant(registeredId,mode)}});return()=>h(Primitive,mergeProps(attrs,{as:props.as,asChild:props.asChild,elementRef:element=>{root.value=element},"data-scope":"form","data-part":"field",...!active.value?{inert:true,"aria-hidden":"true"}:{},"data-valid":slotProps.value.valid?"":void 0,"data-invalid":slotProps.value.valid?void 0:"","data-touched":slotProps.value.touched?"":void 0,"data-dirty":slotProps.value.dirty?"":void 0}),{default:()=>{const children=slots["default"]?.(slotProps.value);declaredLabelMode.value=findDeclaredLabelMode(children);return children}})}});function findDeclaredLabelMode(children){let result;visitFormComponents(children,type=>{const mode=type[formLabelModeKey];if(mode==="for"||mode==="labelledby"||mode==="legend"){if(result!==void 0){result=void 0;return false}result=mode}return true});return result}export{FormField};
|
|
2
2
|
//# sourceMappingURL=field.js.map
|
package/dist/form/field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/form/field.ts"],"mappings":"AAAA,OACE,gBAIA,SACA,WACA,SACA,UACA,gBACA,MACA,QACA,EACA,eACK,MAEP,OAAS,cAAiB,YAE1B,OACE,eACA,gCACA,wBAEK,eACP,OAAS,cAAiB,sBAC1B,OACE,wBACA,eACA,cACA,+BACA,6BACA,yBACA,iBACA,iCACA,2BACK,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