@adapttable/element-plus 0.6.1 → 0.6.2

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.
Files changed (127) hide show
  1. package/dist/{ElementCard-BRZekaHr.cjs → ElementCard-DQpWVv24.cjs} +2 -2
  2. package/dist/{ElementCard-BRZekaHr.cjs.map → ElementCard-DQpWVv24.cjs.map} +1 -1
  3. package/dist/{ElementCard-DZdAU6x8.js → ElementCard-czqeWAnk.js} +2 -2
  4. package/dist/{ElementCard-DZdAU6x8.js.map → ElementCard-czqeWAnk.js.map} +1 -1
  5. package/dist/{ElementColumnMenuPanel-Ddh01A17.cjs → ElementColumnMenuPanel-BfFgrSEJ.cjs} +3 -3
  6. package/dist/{ElementColumnMenuPanel-Ddh01A17.cjs.map → ElementColumnMenuPanel-BfFgrSEJ.cjs.map} +1 -1
  7. package/dist/{ElementColumnMenuPanel-CPW4wU3M.js → ElementColumnMenuPanel-Nkilw7G4.js} +3 -3
  8. package/dist/{ElementColumnMenuPanel-CPW4wU3M.js.map → ElementColumnMenuPanel-Nkilw7G4.js.map} +1 -1
  9. package/dist/{ElementFilterField-Dfzy-Yk4.cjs → ElementFilterField-BbwJTXvK.cjs} +2 -2
  10. package/dist/{ElementFilterField-Dfzy-Yk4.cjs.map → ElementFilterField-BbwJTXvK.cjs.map} +1 -1
  11. package/dist/{ElementFilterField-C8EJjVB_.js → ElementFilterField-N8tiYPGN.js} +2 -2
  12. package/dist/{ElementFilterField-C8EJjVB_.js.map → ElementFilterField-N8tiYPGN.js.map} +1 -1
  13. package/dist/{ElementFilterHeaderRow-DGp4Wrts.js → ElementFilterHeaderRow-BVo9WSuR.js} +2 -2
  14. package/dist/{ElementFilterHeaderRow-DGp4Wrts.js.map → ElementFilterHeaderRow-BVo9WSuR.js.map} +1 -1
  15. package/dist/{ElementFilterHeaderRow-D8ZZ3BOH.cjs → ElementFilterHeaderRow-D22VL0F8.cjs} +2 -2
  16. package/dist/{ElementFilterHeaderRow-D8ZZ3BOH.cjs.map → ElementFilterHeaderRow-D22VL0F8.cjs.map} +1 -1
  17. package/dist/{ElementRowActions-CUdXemC-.js → ElementRowActions-Djhrf9rm.js} +2 -2
  18. package/dist/{ElementRowActions-CUdXemC-.js.map → ElementRowActions-Djhrf9rm.js.map} +1 -1
  19. package/dist/{ElementRowActions-XyX2PAWL.cjs → ElementRowActions-DzAA3wSa.cjs} +2 -2
  20. package/dist/{ElementRowActions-XyX2PAWL.cjs.map → ElementRowActions-DzAA3wSa.cjs.map} +1 -1
  21. package/dist/assistant.cjs +2 -2
  22. package/dist/assistant.js +2 -2
  23. package/dist/batch-editing.cjs +1 -1
  24. package/dist/batch-editing.js +1 -1
  25. package/dist/bulk-actions.cjs +1 -1
  26. package/dist/bulk-actions.js +1 -1
  27. package/dist/{button-BFjBL9m3.cjs → button-BuXbfKKx.cjs} +3 -2
  28. package/dist/button-BuXbfKKx.cjs.map +1 -0
  29. package/dist/{button-DwB4UxI2.js → button-DUddRulx.js} +3 -2
  30. package/dist/button-DUddRulx.js.map +1 -0
  31. package/dist/{checkbox-BF19iMgI.cjs → checkbox-DRhRrexK.cjs} +2 -2
  32. package/dist/{checkbox-BF19iMgI.cjs.map → checkbox-DRhRrexK.cjs.map} +1 -1
  33. package/dist/column-layout.cjs +1 -1
  34. package/dist/column-layout.js +1 -1
  35. package/dist/{column-menu-CwTWnahc.js → column-menu-DaOcmA45.js} +33 -13
  36. package/dist/column-menu-DaOcmA45.js.map +1 -0
  37. package/dist/{column-menu-CqyYtohz.cjs → column-menu-eS7ylKfB.cjs} +33 -13
  38. package/dist/column-menu-eS7ylKfB.cjs.map +1 -0
  39. package/dist/column-menu.cjs +1 -1
  40. package/dist/column-menu.js +1 -1
  41. package/dist/command-palette.cjs +1 -1
  42. package/dist/command-palette.js +1 -1
  43. package/dist/context-menu.cjs +1 -1
  44. package/dist/context-menu.js +1 -1
  45. package/dist/{editing-CSqZENeW.cjs → editing-Bal8jOJT.cjs} +2 -2
  46. package/dist/{editing-CSqZENeW.cjs.map → editing-Bal8jOJT.cjs.map} +1 -1
  47. package/dist/{editing-BlpYR839.js → editing-BgWyfVFS.js} +2 -2
  48. package/dist/{editing-BlpYR839.js.map → editing-BgWyfVFS.js.map} +1 -1
  49. package/dist/editing.cjs +1 -1
  50. package/dist/editing.js +1 -1
  51. package/dist/{elementActionSlots-CbKE3WnM.js → elementActionSlots-BOdXhb05.js} +2 -2
  52. package/dist/{elementActionSlots-CbKE3WnM.js.map → elementActionSlots-BOdXhb05.js.map} +1 -1
  53. package/dist/{elementActionSlots-DlhU82H7.cjs → elementActionSlots-WeXIVVnx.cjs} +2 -2
  54. package/dist/{elementActionSlots-DlhU82H7.cjs.map → elementActionSlots-WeXIVVnx.cjs.map} +1 -1
  55. package/dist/{elementHierarchyControlSlots-21LL1wEw.js → elementHierarchyControlSlots-CBz7cgOw.js} +2 -2
  56. package/dist/{elementHierarchyControlSlots-21LL1wEw.js.map → elementHierarchyControlSlots-CBz7cgOw.js.map} +1 -1
  57. package/dist/{elementRemainingControls-DvVVLXE0.cjs → elementRemainingControls-CvGiKtfz.cjs} +3 -3
  58. package/dist/{elementRemainingControls-DvVVLXE0.cjs.map → elementRemainingControls-CvGiKtfz.cjs.map} +1 -1
  59. package/dist/{elementRemainingControls-6tN9tgWx.js → elementRemainingControls-J7eDWROX.js} +3 -3
  60. package/dist/{elementRemainingControls-6tN9tgWx.js.map → elementRemainingControls-J7eDWROX.js.map} +1 -1
  61. package/dist/{export-x-Ow8SY5.cjs → export-Cln4twUm.cjs} +2 -2
  62. package/dist/{export-x-Ow8SY5.cjs.map → export-Cln4twUm.cjs.map} +1 -1
  63. package/dist/{export-kuOvIoQg.js → export-DMEVONO6.js} +2 -2
  64. package/dist/{export-kuOvIoQg.js.map → export-DMEVONO6.js.map} +1 -1
  65. package/dist/export-pdf.cjs +1 -1
  66. package/dist/export-pdf.js +1 -1
  67. package/dist/export-xlsx.cjs +1 -1
  68. package/dist/export-xlsx.js +1 -1
  69. package/dist/export.cjs +1 -1
  70. package/dist/export.js +1 -1
  71. package/dist/filtering.cjs +2 -2
  72. package/dist/filtering.js +2 -2
  73. package/dist/{filters-CYQFsZ_f.cjs → filters-B3GI0d_7.cjs} +3 -3
  74. package/dist/{filters-CYQFsZ_f.cjs.map → filters-B3GI0d_7.cjs.map} +1 -1
  75. package/dist/{filters-CIQ1uMZw.js → filters-C5j2hjd3.js} +3 -3
  76. package/dist/{filters-CIQ1uMZw.js.map → filters-C5j2hjd3.js.map} +1 -1
  77. package/dist/filters.cjs +2 -2
  78. package/dist/filters.js +2 -2
  79. package/dist/{find-in-table-WtXzIkkg.cjs → find-in-table-Bn5eTjXM.cjs} +2 -2
  80. package/dist/{find-in-table-WtXzIkkg.cjs.map → find-in-table-Bn5eTjXM.cjs.map} +1 -1
  81. package/dist/{find-in-table-B9ySCCJh.js → find-in-table-oPAJgCGy.js} +2 -2
  82. package/dist/{find-in-table-B9ySCCJh.js.map → find-in-table-oPAJgCGy.js.map} +1 -1
  83. package/dist/find-in-table.cjs +1 -1
  84. package/dist/find-in-table.js +1 -1
  85. package/dist/fullscreen.cjs +1 -1
  86. package/dist/fullscreen.js +1 -1
  87. package/dist/grouping-panel.cjs +2 -2
  88. package/dist/grouping-panel.js +2 -2
  89. package/dist/grouping.cjs +2 -2
  90. package/dist/grouping.js +2 -2
  91. package/dist/{header-filters-COkO6tD4.cjs → header-filters-D7475LRH.cjs} +3 -3
  92. package/dist/{header-filters-COkO6tD4.cjs.map → header-filters-D7475LRH.cjs.map} +1 -1
  93. package/dist/{header-filters-B2veND8x.js → header-filters-s7nFkTHe.js} +3 -3
  94. package/dist/{header-filters-B2veND8x.js.map → header-filters-s7nFkTHe.js.map} +1 -1
  95. package/dist/header-filters.cjs +2 -2
  96. package/dist/header-filters.js +2 -2
  97. package/dist/index.cjs +4 -4
  98. package/dist/index.js +4 -4
  99. package/dist/pivot.cjs +1 -1
  100. package/dist/pivot.js +1 -1
  101. package/dist/preset.cjs +6 -6
  102. package/dist/preset.js +6 -6
  103. package/dist/print.cjs +1 -1
  104. package/dist/print.js +1 -1
  105. package/dist/row-actions.cjs +1 -1
  106. package/dist/row-actions.js +1 -1
  107. package/dist/row-pinning.cjs +1 -1
  108. package/dist/row-pinning.js +1 -1
  109. package/dist/row-reorder.cjs +1 -1
  110. package/dist/row-reorder.js +1 -1
  111. package/dist/{saved-views-luZVHu3w.cjs → saved-views-BdoXhuyE.cjs} +4 -4
  112. package/dist/{saved-views-luZVHu3w.cjs.map → saved-views-BdoXhuyE.cjs.map} +1 -1
  113. package/dist/{saved-views-DDo4Bl-f.js → saved-views-DAkqlIlo.js} +4 -4
  114. package/dist/{saved-views-DDo4Bl-f.js.map → saved-views-DAkqlIlo.js.map} +1 -1
  115. package/dist/saved-views.cjs +1 -1
  116. package/dist/saved-views.js +1 -1
  117. package/dist/side-panel.cjs +1 -1
  118. package/dist/side-panel.js +1 -1
  119. package/dist/{withElementExport-B97s6RIr.js → withElementExport-CX-S76EV.js} +3 -3
  120. package/dist/{withElementExport-B97s6RIr.js.map → withElementExport-CX-S76EV.js.map} +1 -1
  121. package/dist/{withElementExport-J-6vXfL9.cjs → withElementExport-CmkGvvZT.cjs} +3 -3
  122. package/dist/{withElementExport-J-6vXfL9.cjs.map → withElementExport-CmkGvvZT.cjs.map} +1 -1
  123. package/package.json +2 -2
  124. package/dist/button-BFjBL9m3.cjs.map +0 -1
  125. package/dist/button-DwB4UxI2.js.map +0 -1
  126. package/dist/column-menu-CqyYtohz.cjs.map +0 -1
  127. package/dist/column-menu-CwTWnahc.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"editing-CSqZENeW.cjs","names":["$attrs","defineComponent","useScopeActivity","shallowRef","computed","h","ElementCheckbox","ElementMultiSelect","readMultiDraft","formatMultiDraft","ElementSelect","ElementInput","editorInputType","createVNode","elementButton","mergeProps","defineComponent","useClassNames","HistoryButtonsChrome","elementButton","slotRender","editableCellSlotKey","h","ElementEditableCell","extendFeature","bindingEditing","bindingRowEditing","rowEditActionsSlotKey","ElementRowEditActions","bindingBatchEditing","batchEditBarSlotKey","ElementBatchEditBar","bindingUndoRedoButtons","UNDO_REDO_CONTROL","editingFamilyList","editHistory"],"sources":["../src/controls/ElementMultiSelect.vue","../src/controls/focusRef.ts","../src/editing/ElementCellEditor.ts","../src/editing/ElementEditableCell.vue","../src/editing/elementEditingButton.ts","../src/editing/ElementBatchEditBar.vue","../src/editing/ElementRowEditActions.vue","../src/editing/ElementHistoryButtons.ts","../src/editing.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { scheduleTick } from \"@adapttable/vue/adapter\";\nimport { ElOption, ElSelect, type SelectInstance } from \"element-plus\";\nimport { shallowRef } from \"vue\";\n\ndefineOptions({ inheritAttrs: false });\nconst props = defineProps<{\n value: readonly string[];\n options: readonly { value: string; label: string }[];\n}>();\nconst emit = defineEmits<{ change: [value: string[]] }>();\nconst control = shallowRef<SelectInstance>();\nfunction change(value: unknown): void {\n if (\n Array.isArray(value) &&\n value.every((item): item is string => typeof item === \"string\")\n )\n emit(\"change\", value);\n scheduleTick(() => control.value?.$forceUpdate());\n}\n// A parent ref resolves before this template ref does, so a focus requested\n// while the select mounts waits a tick for it.\nfunction focus(): void {\n if (control.value) control.value.focus();\n else scheduleTick(() => control.value?.focus());\n}\ndefineExpose({\n focus,\n blur: () => control.value?.blur(),\n});\n</script>\n\n<template>\n <ElSelect\n ref=\"control\"\n v-bind=\"$attrs\"\n :model-value=\"[...props.value]\"\n multiple\n :teleported=\"false\"\n :validate-event=\"false\"\n @update:model-value=\"change\"\n >\n <ElOption\n v-for=\"option in props.options\"\n :key=\"option.value\"\n :value=\"option.value\"\n :label=\"option.label\"\n />\n </ElSelect>\n</template>\n","import type { VNodeProps } from \"vue\";\n\ninterface FocusTarget {\n focus(): void;\n}\nfunction isFocusTarget(value: unknown): value is FocusTarget {\n return (\n value !== null &&\n typeof value === \"object\" &&\n \"focus\" in value &&\n typeof value.focus === \"function\"\n );\n}\n/** Keep the supported exposed focus handle, including its stable identity. */\nexport function focusControlRef(\n set: (target: FocusTarget | null) => void\n): VNodeProps[\"ref\"] {\n return (value) => {\n if (value === null) {\n set(null);\n return;\n }\n if (!isFocusTarget(value))\n throw new Error(\n \"AdaptTable: Element Plus control must expose its supported focus method.\"\n );\n set(value);\n };\n}\n","import {\n type EditableCellEditorProps,\n editorInputType,\n formatMultiDraft,\n readMultiDraft,\n scheduleTick,\n useScopeActivity,\n withProps,\n} from \"@adapttable/vue/adapter\";\nimport {\n computed,\n createVNode,\n defineComponent,\n h,\n onMounted,\n type PropType,\n shallowRef,\n watch,\n} from \"vue\";\n\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementMultiSelect from \"../controls/ElementMultiSelect.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\nimport { focusControlRef } from \"../controls/focusRef\";\n\n/** The kit owns its nested popup; draft and commit transitions stay in Chrome. */\nconst editorRuntimeProps = {\n controller: {\n type: Object as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"controller\"]\n >,\n },\n label: {\n type: String as PropType<\n (EditableCellEditorProps<unknown> & { className?: string })[\"label\"]\n >,\n },\n attrs: {\n type: Object as PropType<\n (EditableCellEditorProps<unknown> & { className?: string })[\"attrs\"]\n >,\n },\n editorRef: {\n type: Function as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"editorRef\"]\n >,\n },\n onChange: {\n type: Function as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"onChange\"]\n >,\n },\n onBlur: {\n type: Function as PropType<\n (EditableCellEditorProps<unknown> & { className?: string })[\"onBlur\"]\n >,\n },\n onKeyDown: {\n type: Function as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"onKeyDown\"]\n >,\n },\n className: {\n type: String as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"className\"]\n >,\n },\n};\n\nconst ElementCellEditorPresentation = defineComponent(\n (props: EditableCellEditorProps<unknown> & { className?: string }) => {\n const active = useScopeActivity();\n const mounted = shallowRef(false);\n const host = shallowRef<HTMLElement | null>(null);\n const field = shallowRef<HTMLInputElement | HTMLTextAreaElement | null>(\n null\n );\n const popup = shallowRef(false);\n onMounted(() => {\n mounted.value = true;\n });\n const present = computed(() => !mounted.value || active.value);\n watch(\n active,\n (live) => {\n if (!live) popup.value = false;\n },\n { flush: \"sync\" }\n );\n function validation(): void {\n const target = field.value;\n if (!target || !active.value || !target.isConnected) return;\n for (const name of [\"aria-invalid\", \"aria-describedby\"] as const) {\n const value = props.attrs[name];\n if (typeof value === \"string\" || typeof value === \"boolean\")\n target.setAttribute(name, String(value));\n else target.removeAttribute(name);\n }\n }\n watch([field, active, () => props.attrs], validation, { flush: \"post\" });\n function focusin(event: FocusEvent): void {\n const target = event.target;\n if (\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement\n ) {\n // The native focus event identifies Select's field without private refs.\n field.value = target;\n validation();\n }\n }\n function keydown(event: KeyboardEvent): void {\n if (\n active.value &&\n !popup.value &&\n !event.defaultPrevented &&\n !event.isComposing\n )\n props.onKeyDown(event);\n }\n function focusout(event: FocusEvent): void {\n if (\n event.relatedTarget instanceof Node &&\n host.value?.contains(event.relatedTarget)\n )\n return;\n const commit = props.onBlur;\n scheduleTick(() => {\n if (\n active.value &&\n !popup.value &&\n host.value &&\n !host.value.contains(document.activeElement)\n )\n commit();\n });\n }\n function control() {\n const editor = props.controller.editor;\n const owner = props.editorRef;\n const inputRef = (\n target: HTMLInputElement | HTMLTextAreaElement | null\n ): void => {\n field.value = target;\n owner(target);\n };\n const attrs = {\n ...props.attrs,\n class: props.className,\n \"aria-label\": props.label,\n };\n if (editor === \"boolean\")\n return h(ElementCheckbox, {\n ...attrs,\n label: props.label,\n checked: props.controller.draft === \"true\",\n inputRef,\n onChange: (checked) => props.onChange(String(checked)),\n });\n if (editor && typeof editor === \"object\") {\n const select = {\n ...attrs,\n ref: focusControlRef(props.editorRef),\n options: props.controller.selectOptions,\n onVisibleChange: (open: boolean) => {\n popup.value = open;\n },\n };\n if (editor.type === \"multi-select\")\n return h(ElementMultiSelect, {\n ...select,\n value: readMultiDraft(props.controller.draft),\n onChange: (values) => props.onChange(formatMultiDraft(values)),\n });\n return h(ElementSelect, {\n ...select,\n value: props.controller.draft,\n onChange: props.onChange,\n });\n }\n return h(ElementInput, {\n ...attrs,\n type: editorInputType(editor),\n value: props.controller.draft,\n inputRef,\n onChange: props.onChange,\n });\n }\n return () =>\n h(\n \"div\",\n {\n ref: host,\n class: \"adapttable-element-plus-editor-host\",\n onKeydownCapture: keydown,\n onFocusinCapture: focusin,\n onFocusout: focusout,\n },\n present.value ? [control()] : []\n );\n },\n {\n name: \"ElementCellEditor\",\n inheritAttrs: false,\n props: editorRuntimeProps,\n }\n);\n\n// Keep the row type at the functional boundary; the presentation validates\n// values and owns the editor's reactive lifecycle.\nconst ElementCellEditor = /* @__PURE__ */ withProps(\n function ElementCellEditor<TRow>(\n props: EditableCellEditorProps<TRow> & { className?: string }\n ) {\n return createVNode(ElementCellEditorPresentation, { ...props });\n },\n Object.keys(editorRuntimeProps) as (keyof typeof editorRuntimeProps)[],\n { inheritAttrs: false }\n);\nexport default ElementCellEditor;\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n EditableCellChrome,\n type EditableCellChromeSlots,\n editableCustomControl,\n useEditableCellModel,\n type VueEditableCellProps,\n} from \"@adapttable/vue/adapter\";\nimport { Fragment, h, type VNodeChild } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\nimport ElementCellEditor from \"./ElementCellEditor\";\n\ndefineOptions({ name: \"ElementEditableCell\" });\nconst props = defineProps<VueEditableCellProps<TRow>>();\nconst names = useClassNames();\nconst model = useEditableCellModel(() => props);\nconst controls: EditableCellChromeSlots<TRow> = {\n Activate: (control) =>\n elementButton(\n {\n title: control.title,\n text: true,\n \"aria-description\": control.title,\n class: [\n \"adapttable-element-edit-value\",\n control.className,\n names.value.editCellActivate,\n ],\n ref: control.activateRef,\n \"data-adapttable-part\": \"edit-cell-activate\",\n \"data-save-status\": control.saveStatus,\n \"data-dirty\": control.dirty ? \"\" : undefined,\n onClick: control.onClick,\n onDblclick: control.onDoubleClick,\n onKeydown: control.onKeyDown,\n },\n control.display\n ),\n Editor: (control) => {\n const editor = control.controller.editor;\n if (editor && typeof editor === \"object\" && editor.type === \"custom\")\n return h(Fragment, [\n editor.render(editableCustomControl(model.value)) as VNodeChild,\n ]);\n return h(ElementCellEditor<TRow>, {\n ...control,\n className: names.value.editCellEditor,\n });\n },\n Button: (control) =>\n elementButton(\n {\n class: [\n control.className,\n control.part === \"edit-cell-rollback\"\n ? names.value.editCellRollback\n : names.value.editCellConflictButton,\n ],\n \"data-adapttable-part\": control.part,\n onMousedown: control.onMouseDown,\n onClick: control.onClick,\n },\n control.label\n ),\n};\nconst Render = () =>\n EditableCellChrome({ model: model.value, classNames: names.value, controls });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template><Render /></template>\n\n<style>\n.el-button.adapttable-element-edit-value {\n justify-content: start;\n inline-size: 100%;\n min-inline-size: 0;\n block-size: auto;\n padding: 0;\n border: 0;\n color: inherit;\n font: inherit;\n text-align: inherit;\n white-space: normal;\n overflow-wrap: anywhere;\n cursor: text;\n}\n.el-button.adapttable-element-edit-value > span {\n min-inline-size: 0;\n}\n</style>\n","import type { EditingActionButtonProps } from \"@adapttable/vue/adapter\";\nimport { mergeProps, type VNodeChild } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n\nexport function elementEditingButton(\n control: EditingActionButtonProps,\n className?: string\n) {\n return elementButton(\n mergeProps(control.attrs, { class: className, onClick: control.onClick }),\n [\n control.icon === false ? null : (control.icon as VNodeChild),\n control.label,\n ]\n );\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n BatchEditBarChrome,\n type BatchEditBarProps,\n} from \"@adapttable/vue/adapter\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementEditingButton } from \"./elementEditingButton\";\ndefineOptions({ name: \"ElementBatchEditBar\" });\nconst { contested = undefined, ...props } =\n defineProps<BatchEditBarProps<TRow>>();\nconst names = useClassNames();\nconst Render = () =>\n BatchEditBarChrome({\n ...props,\n contested,\n className: [props.className, names.value.batchEditBar]\n .filter(Boolean)\n .join(\" \"),\n controls: {\n Button: (control) =>\n elementEditingButton(control, names.value.batchEditButton),\n },\n });\n\n// Declare no props so Vue forwards all root attributes, including id and data-*.\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n RowEditActionsChrome,\n type RowEditActionsProps,\n} from \"@adapttable/vue/adapter\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementEditingButton } from \"./elementEditingButton\";\ndefineOptions({ name: \"ElementRowEditActions\" });\nconst { showBegin = undefined, ...props } =\n defineProps<RowEditActionsProps<TRow>>();\nconst names = useClassNames();\nconst Render = () =>\n RowEditActionsChrome({\n ...props,\n showBegin,\n className: [props.className, names.value.rowEditActions]\n .filter(Boolean)\n .join(\" \"),\n controls: {\n Button: (control) =>\n elementEditingButton(control, names.value.rowEditButton),\n },\n });\n\n// Declare no props so Vue forwards all root attributes, including id and data-*.\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n","import {\n HistoryButtonsChrome,\n type UndoRedoControlProps,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, type PropType } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\n\nexport const ElementHistoryButtons = defineComponent(\n (props: UndoRedoControlProps) => {\n const names = useClassNames();\n return () =>\n HistoryButtonsChrome({\n ...props,\n classNames: { ...names.value },\n slots: { Button: ({ label, attrs }) => elementButton(attrs, label) },\n });\n },\n {\n name: \"ElementHistoryButtons\",\n props: {\n onUndo: { type: Function as PropType<UndoRedoControlProps[\"onUndo\"]> },\n onRedo: { type: Function as PropType<UndoRedoControlProps[\"onRedo\"]> },\n canUndo: {\n type: Boolean as PropType<UndoRedoControlProps[\"canUndo\"]>,\n default: undefined,\n },\n canRedo: {\n type: Boolean as PropType<UndoRedoControlProps[\"canRedo\"]>,\n default: undefined,\n },\n undoLabel: {\n type: String as PropType<UndoRedoControlProps[\"undoLabel\"]>,\n },\n redoLabel: {\n type: String as PropType<UndoRedoControlProps[\"redoLabel\"]>,\n },\n labels: { type: Object as PropType<UndoRedoControlProps[\"labels\"]> },\n classNames: {\n type: Object as PropType<UndoRedoControlProps[\"classNames\"]>,\n },\n },\n }\n);\n","import {\n type CellEditHandler,\n type StaticTableFeature,\n type TableEditingOptions,\n type TableFeature,\n} from \"@adapttable/vue\";\nimport {\n batchEditBarSlotKey,\n editableCellSlotKey,\n editingFamilyList,\n extendFeature,\n rowEditActionsSlotKey,\n slotRender,\n UNDO_REDO_CONTROL,\n} from \"@adapttable/vue/adapter\";\nimport {\n batchEditing as bindingBatchEditing,\n dirtyIndicators,\n editHistory,\n editing as bindingEditing,\n type EditingLifecycleExtras,\n rowEditing as bindingRowEditing,\n undoRedoButtons as bindingUndoRedoButtons,\n} from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport { ElementEditableCell } from \"./editing/ElementEditableCell\";\nimport {\n ElementBatchEditBar,\n ElementRowEditActions,\n} from \"./editing/ElementEditingActions\";\nimport { ElementHistoryButtons } from \"./editing/ElementHistoryButtons\";\n\nfunction cellSlot<TRow>() {\n return slotRender(editableCellSlotKey<TRow>(), (props) =>\n h(ElementEditableCell<TRow>, { ...props })\n );\n}\n\n/** Element controls keep all validation, save and host-write transitions in the binding. */\nexport function editing<TRow>(\n onCellEdit: CellEditHandler<TRow>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingEditing(onCellEdit, extras), [cellSlot<TRow>()]);\n}\n\n/** Edit a row as one gesture with explicit Element Plus Save and Cancel controls. */\nexport function rowEditing<TRow>(\n onRowEdit: NonNullable<TableEditingOptions<TRow>[\"onRowEdit\"]>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingRowEditing(onRowEdit, extras), [\n cellSlot<TRow>(),\n slotRender(rowEditActionsSlotKey<TRow>(), (props) =>\n h(ElementRowEditActions<TRow>, { ...props })\n ),\n ]);\n}\n\n/** Stage edits across rows; host writes happen only on the batch Save action. */\nexport function batchEditing<TRow>(\n onBatchEdit: NonNullable<TableEditingOptions<TRow>[\"onBatchEdit\"]>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingBatchEditing(onBatchEdit, extras), [\n cellSlot<TRow>(),\n slotRender(batchEditBarSlotKey<TRow>(), (props) =>\n h(ElementBatchEditBar<TRow>, { ...props })\n ),\n ]);\n}\n\nexport { ElementEditableCell } from \"./editing/ElementEditableCell\";\nexport {\n ElementBatchEditBar,\n ElementRowEditActions,\n} from \"./editing/ElementEditingActions\";\nexport type {\n BatchEditingState,\n BatchRowEdit,\n CellEditHandler,\n RowEditingState,\n TableEditingOptions,\n} from \"@adapttable/vue\";\nexport type { RowEditIcons } from \"@adapttable/vue/adapter\";\nexport type { EditingLifecycleExtras } from \"@adapttable/vue/features\";\nexport { dirtyIndicators, editHistory };\n\n/** Opt-in Element Plus Undo and Redo buttons use the shell's history projection. */\nexport function undoRedoButtons(): StaticTableFeature {\n return extendFeature(bindingUndoRedoButtons(), [\n slotRender(UNDO_REDO_CONTROL, (props) =>\n h(ElementHistoryButtons, { ...props })\n ),\n ]);\n}\n\n/**\n * All of editing — cell editing, dirty marks, edit history and undo\n * controls — with this kit's controls, passed to `features` as one entry.\n * Row and batch editing join beside it.\n *\n * @public\n */\nexport function editingFamily<TRow>(\n onCellEdit: CellEditHandler<TRow>,\n extras?: EditingLifecycleExtras<TRow>\n): readonly TableFeature<TRow>[] {\n return editingFamilyList<\n TableFeature<TRow>,\n CellEditHandler<TRow>,\n EditingLifecycleExtras<TRow> | undefined\n >(\n {\n editing: (save, more) => editing(save, more),\n dirtyIndicators,\n editHistory: () => editHistory(),\n undoRedoButtons,\n },\n onCellEdit,\n extras\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAMA,MAAM,QAAQ;EAId,MAAM,OAAO;EACb,MAAM,WAAA,GAAU,IAAA,WAAA,CAA2B;EAC3C,SAAS,OAAO,OAAsB;GACpC,IACE,MAAM,QAAQ,KAAK,KACnB,MAAM,OAAO,SAAyB,OAAO,SAAS,QAAQ,GAE9D,KAAK,UAAU,KAAK;GACtB,CAAA,GAAA,wBAAA,aAAA,OAAmB,QAAQ,OAAO,aAAa,CAAC;EAClD;EAGA,SAAS,QAAc;GACrB,IAAI,QAAQ,OAAO,QAAQ,MAAM,MAAM;QAClC,CAAA,GAAA,wBAAA,aAAA,OAAmB,QAAQ,OAAO,MAAM,CAAC;EAChD;EACA,SAAa;GACX;GACA,YAAY,QAAQ,OAAO,KAAK;EAClC,CAAC;;GAIC,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,EAAA,GAeW,IAAA,MAAA,CAAA,aAAA,QAAA,IAAA,GAfX,IAAA,WAAA,CAeW;IAdL,SAAA;IAAJ,KAAI;GACIA,GAAAA,KAAAA,QAAM;IACb,eAAW,CAAA,GAAM,MAAM,KAAK;IAC7B,UAAA;IACC,YAAY;IACZ,kBAAgB;IAChB,uBAAoB;;IAGnB,UAAA,GAAA,IAAA,QAAA,OAA+B,GAAA,GADjC,IAAA,UAAA,CAAA,IAAA,IAAA,GAAA,IAAA,mBAAA,CAKE,IAAA,UAAA,OAAA,GAAA,IAAA,WAAA,CAJiB,MAAM,UAAhB,WAAM;KADf,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,EAAA,GAKE,IAAA,MAAA,CAAA,aAAA,QAA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aAAAA,CAAoB,aAAa,MAAM,GAAG,CAC7D,SAAe,IAAA,GACfT,wBAAAA,WAAAA,EAAAA,GAAWU,wBAAAA,oBAAAA,CAA0B,IAAI,WAAA,GACvCR,IAAAA,EAAAA,CAAES,aAA2B,EAAE,GAAG,MAAM,CAAC,CAC3C,CACF,CAAC;AACH;;AAmBA,SAAgB,kBAAsC;CACpD,QAAA,GAAOP,wBAAAA,cAAAA,EAAAA,GAAcQ,yBAAAA,gBAAAA,CAAuB,GAAG,EAAA,GAC7CZ,wBAAAA,WAAAA,CAAWa,wBAAAA,oBAAoB,WAAA,GAC7BX,IAAAA,EAAAA,CAAE,uBAAuB,EAAE,GAAG,MAAM,CAAC,CACvC,CACF,CAAC;AACH;;;;;;;;AASA,SAAgB,cACd,YACA,QAC+B;CAC/B,QAAA,GAAOY,wBAAAA,kBAAAA,CAKL;EACE,UAAU,MAAM,SAAS,QAAQ,MAAM,IAAI;EAC3C,iBAAA,yBAAA;EACA,oBAAA,GAAmBC,yBAAAA,YAAAA,CAAY;EAC/B;CACF,GACA,YACA,MACF;AACF"}
1
+ {"version":3,"file":"editing-Bal8jOJT.cjs","names":["$attrs","defineComponent","useScopeActivity","shallowRef","computed","h","ElementCheckbox","ElementMultiSelect","readMultiDraft","formatMultiDraft","ElementSelect","ElementInput","editorInputType","createVNode","elementButton","mergeProps","defineComponent","useClassNames","HistoryButtonsChrome","elementButton","slotRender","editableCellSlotKey","h","ElementEditableCell","extendFeature","bindingEditing","bindingRowEditing","rowEditActionsSlotKey","ElementRowEditActions","bindingBatchEditing","batchEditBarSlotKey","ElementBatchEditBar","bindingUndoRedoButtons","UNDO_REDO_CONTROL","editingFamilyList","editHistory"],"sources":["../src/controls/ElementMultiSelect.vue","../src/controls/focusRef.ts","../src/editing/ElementCellEditor.ts","../src/editing/ElementEditableCell.vue","../src/editing/elementEditingButton.ts","../src/editing/ElementBatchEditBar.vue","../src/editing/ElementRowEditActions.vue","../src/editing/ElementHistoryButtons.ts","../src/editing.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { scheduleTick } from \"@adapttable/vue/adapter\";\nimport { ElOption, ElSelect, type SelectInstance } from \"element-plus\";\nimport { shallowRef } from \"vue\";\n\ndefineOptions({ inheritAttrs: false });\nconst props = defineProps<{\n value: readonly string[];\n options: readonly { value: string; label: string }[];\n}>();\nconst emit = defineEmits<{ change: [value: string[]] }>();\nconst control = shallowRef<SelectInstance>();\nfunction change(value: unknown): void {\n if (\n Array.isArray(value) &&\n value.every((item): item is string => typeof item === \"string\")\n )\n emit(\"change\", value);\n scheduleTick(() => control.value?.$forceUpdate());\n}\n// A parent ref resolves before this template ref does, so a focus requested\n// while the select mounts waits a tick for it.\nfunction focus(): void {\n if (control.value) control.value.focus();\n else scheduleTick(() => control.value?.focus());\n}\ndefineExpose({\n focus,\n blur: () => control.value?.blur(),\n});\n</script>\n\n<template>\n <ElSelect\n ref=\"control\"\n v-bind=\"$attrs\"\n :model-value=\"[...props.value]\"\n multiple\n :teleported=\"false\"\n :validate-event=\"false\"\n @update:model-value=\"change\"\n >\n <ElOption\n v-for=\"option in props.options\"\n :key=\"option.value\"\n :value=\"option.value\"\n :label=\"option.label\"\n />\n </ElSelect>\n</template>\n","import type { VNodeProps } from \"vue\";\n\ninterface FocusTarget {\n focus(): void;\n}\nfunction isFocusTarget(value: unknown): value is FocusTarget {\n return (\n value !== null &&\n typeof value === \"object\" &&\n \"focus\" in value &&\n typeof value.focus === \"function\"\n );\n}\n/** Keep the supported exposed focus handle, including its stable identity. */\nexport function focusControlRef(\n set: (target: FocusTarget | null) => void\n): VNodeProps[\"ref\"] {\n return (value) => {\n if (value === null) {\n set(null);\n return;\n }\n if (!isFocusTarget(value))\n throw new Error(\n \"AdaptTable: Element Plus control must expose its supported focus method.\"\n );\n set(value);\n };\n}\n","import {\n type EditableCellEditorProps,\n editorInputType,\n formatMultiDraft,\n readMultiDraft,\n scheduleTick,\n useScopeActivity,\n withProps,\n} from \"@adapttable/vue/adapter\";\nimport {\n computed,\n createVNode,\n defineComponent,\n h,\n onMounted,\n type PropType,\n shallowRef,\n watch,\n} from \"vue\";\n\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementMultiSelect from \"../controls/ElementMultiSelect.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\nimport { focusControlRef } from \"../controls/focusRef\";\n\n/** The kit owns its nested popup; draft and commit transitions stay in Chrome. */\nconst editorRuntimeProps = {\n controller: {\n type: Object as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"controller\"]\n >,\n },\n label: {\n type: String as PropType<\n (EditableCellEditorProps<unknown> & { className?: string })[\"label\"]\n >,\n },\n attrs: {\n type: Object as PropType<\n (EditableCellEditorProps<unknown> & { className?: string })[\"attrs\"]\n >,\n },\n editorRef: {\n type: Function as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"editorRef\"]\n >,\n },\n onChange: {\n type: Function as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"onChange\"]\n >,\n },\n onBlur: {\n type: Function as PropType<\n (EditableCellEditorProps<unknown> & { className?: string })[\"onBlur\"]\n >,\n },\n onKeyDown: {\n type: Function as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"onKeyDown\"]\n >,\n },\n className: {\n type: String as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"className\"]\n >,\n },\n};\n\nconst ElementCellEditorPresentation = defineComponent(\n (props: EditableCellEditorProps<unknown> & { className?: string }) => {\n const active = useScopeActivity();\n const mounted = shallowRef(false);\n const host = shallowRef<HTMLElement | null>(null);\n const field = shallowRef<HTMLInputElement | HTMLTextAreaElement | null>(\n null\n );\n const popup = shallowRef(false);\n onMounted(() => {\n mounted.value = true;\n });\n const present = computed(() => !mounted.value || active.value);\n watch(\n active,\n (live) => {\n if (!live) popup.value = false;\n },\n { flush: \"sync\" }\n );\n function validation(): void {\n const target = field.value;\n if (!target || !active.value || !target.isConnected) return;\n for (const name of [\"aria-invalid\", \"aria-describedby\"] as const) {\n const value = props.attrs[name];\n if (typeof value === \"string\" || typeof value === \"boolean\")\n target.setAttribute(name, String(value));\n else target.removeAttribute(name);\n }\n }\n watch([field, active, () => props.attrs], validation, { flush: \"post\" });\n function focusin(event: FocusEvent): void {\n const target = event.target;\n if (\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement\n ) {\n // The native focus event identifies Select's field without private refs.\n field.value = target;\n validation();\n }\n }\n function keydown(event: KeyboardEvent): void {\n if (\n active.value &&\n !popup.value &&\n !event.defaultPrevented &&\n !event.isComposing\n )\n props.onKeyDown(event);\n }\n function focusout(event: FocusEvent): void {\n if (\n event.relatedTarget instanceof Node &&\n host.value?.contains(event.relatedTarget)\n )\n return;\n const commit = props.onBlur;\n scheduleTick(() => {\n if (\n active.value &&\n !popup.value &&\n host.value &&\n !host.value.contains(document.activeElement)\n )\n commit();\n });\n }\n function control() {\n const editor = props.controller.editor;\n const owner = props.editorRef;\n const inputRef = (\n target: HTMLInputElement | HTMLTextAreaElement | null\n ): void => {\n field.value = target;\n owner(target);\n };\n const attrs = {\n ...props.attrs,\n class: props.className,\n \"aria-label\": props.label,\n };\n if (editor === \"boolean\")\n return h(ElementCheckbox, {\n ...attrs,\n label: props.label,\n checked: props.controller.draft === \"true\",\n inputRef,\n onChange: (checked) => props.onChange(String(checked)),\n });\n if (editor && typeof editor === \"object\") {\n const select = {\n ...attrs,\n ref: focusControlRef(props.editorRef),\n options: props.controller.selectOptions,\n onVisibleChange: (open: boolean) => {\n popup.value = open;\n },\n };\n if (editor.type === \"multi-select\")\n return h(ElementMultiSelect, {\n ...select,\n value: readMultiDraft(props.controller.draft),\n onChange: (values) => props.onChange(formatMultiDraft(values)),\n });\n return h(ElementSelect, {\n ...select,\n value: props.controller.draft,\n onChange: props.onChange,\n });\n }\n return h(ElementInput, {\n ...attrs,\n type: editorInputType(editor),\n value: props.controller.draft,\n inputRef,\n onChange: props.onChange,\n });\n }\n return () =>\n h(\n \"div\",\n {\n ref: host,\n class: \"adapttable-element-plus-editor-host\",\n onKeydownCapture: keydown,\n onFocusinCapture: focusin,\n onFocusout: focusout,\n },\n present.value ? [control()] : []\n );\n },\n {\n name: \"ElementCellEditor\",\n inheritAttrs: false,\n props: editorRuntimeProps,\n }\n);\n\n// Keep the row type at the functional boundary; the presentation validates\n// values and owns the editor's reactive lifecycle.\nconst ElementCellEditor = /* @__PURE__ */ withProps(\n function ElementCellEditor<TRow>(\n props: EditableCellEditorProps<TRow> & { className?: string }\n ) {\n return createVNode(ElementCellEditorPresentation, { ...props });\n },\n Object.keys(editorRuntimeProps) as (keyof typeof editorRuntimeProps)[],\n { inheritAttrs: false }\n);\nexport default ElementCellEditor;\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n EditableCellChrome,\n type EditableCellChromeSlots,\n editableCustomControl,\n useEditableCellModel,\n type VueEditableCellProps,\n} from \"@adapttable/vue/adapter\";\nimport { Fragment, h, type VNodeChild } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\nimport ElementCellEditor from \"./ElementCellEditor\";\n\ndefineOptions({ name: \"ElementEditableCell\" });\nconst props = defineProps<VueEditableCellProps<TRow>>();\nconst names = useClassNames();\nconst model = useEditableCellModel(() => props);\nconst controls: EditableCellChromeSlots<TRow> = {\n Activate: (control) =>\n elementButton(\n {\n title: control.title,\n text: true,\n \"aria-description\": control.title,\n class: [\n \"adapttable-element-edit-value\",\n control.className,\n names.value.editCellActivate,\n ],\n ref: control.activateRef,\n \"data-adapttable-part\": \"edit-cell-activate\",\n \"data-save-status\": control.saveStatus,\n \"data-dirty\": control.dirty ? \"\" : undefined,\n onClick: control.onClick,\n onDblclick: control.onDoubleClick,\n onKeydown: control.onKeyDown,\n },\n control.display\n ),\n Editor: (control) => {\n const editor = control.controller.editor;\n if (editor && typeof editor === \"object\" && editor.type === \"custom\")\n return h(Fragment, [\n editor.render(editableCustomControl(model.value)) as VNodeChild,\n ]);\n return h(ElementCellEditor<TRow>, {\n ...control,\n className: names.value.editCellEditor,\n });\n },\n Button: (control) =>\n elementButton(\n {\n class: [\n control.className,\n control.part === \"edit-cell-rollback\"\n ? names.value.editCellRollback\n : names.value.editCellConflictButton,\n ],\n \"data-adapttable-part\": control.part,\n onMousedown: control.onMouseDown,\n onClick: control.onClick,\n },\n control.label\n ),\n};\nconst Render = () =>\n EditableCellChrome({ model: model.value, classNames: names.value, controls });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template><Render /></template>\n\n<style>\n.el-button.adapttable-element-edit-value {\n justify-content: start;\n inline-size: 100%;\n min-inline-size: 0;\n block-size: auto;\n padding: 0;\n border: 0;\n color: inherit;\n font: inherit;\n text-align: inherit;\n white-space: normal;\n overflow-wrap: anywhere;\n cursor: text;\n}\n.el-button.adapttable-element-edit-value > span {\n min-inline-size: 0;\n}\n</style>\n","import type { EditingActionButtonProps } from \"@adapttable/vue/adapter\";\nimport { mergeProps, type VNodeChild } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n\nexport function elementEditingButton(\n control: EditingActionButtonProps,\n className?: string\n) {\n return elementButton(\n mergeProps(control.attrs, { class: className, onClick: control.onClick }),\n [\n control.icon === false ? null : (control.icon as VNodeChild),\n control.label,\n ]\n );\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n BatchEditBarChrome,\n type BatchEditBarProps,\n} from \"@adapttable/vue/adapter\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementEditingButton } from \"./elementEditingButton\";\ndefineOptions({ name: \"ElementBatchEditBar\" });\nconst { contested = undefined, ...props } =\n defineProps<BatchEditBarProps<TRow>>();\nconst names = useClassNames();\nconst Render = () =>\n BatchEditBarChrome({\n ...props,\n contested,\n className: [props.className, names.value.batchEditBar]\n .filter(Boolean)\n .join(\" \"),\n controls: {\n Button: (control) =>\n elementEditingButton(control, names.value.batchEditButton),\n },\n });\n\n// Declare no props so Vue forwards all root attributes, including id and data-*.\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n RowEditActionsChrome,\n type RowEditActionsProps,\n} from \"@adapttable/vue/adapter\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementEditingButton } from \"./elementEditingButton\";\ndefineOptions({ name: \"ElementRowEditActions\" });\nconst { showBegin = undefined, ...props } =\n defineProps<RowEditActionsProps<TRow>>();\nconst names = useClassNames();\nconst Render = () =>\n RowEditActionsChrome({\n ...props,\n showBegin,\n className: [props.className, names.value.rowEditActions]\n .filter(Boolean)\n .join(\" \"),\n controls: {\n Button: (control) =>\n elementEditingButton(control, names.value.rowEditButton),\n },\n });\n\n// Declare no props so Vue forwards all root attributes, including id and data-*.\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n","import {\n HistoryButtonsChrome,\n type UndoRedoControlProps,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, type PropType } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\n\nexport const ElementHistoryButtons = defineComponent(\n (props: UndoRedoControlProps) => {\n const names = useClassNames();\n return () =>\n HistoryButtonsChrome({\n ...props,\n classNames: { ...names.value },\n slots: { Button: ({ label, attrs }) => elementButton(attrs, label) },\n });\n },\n {\n name: \"ElementHistoryButtons\",\n props: {\n onUndo: { type: Function as PropType<UndoRedoControlProps[\"onUndo\"]> },\n onRedo: { type: Function as PropType<UndoRedoControlProps[\"onRedo\"]> },\n canUndo: {\n type: Boolean as PropType<UndoRedoControlProps[\"canUndo\"]>,\n default: undefined,\n },\n canRedo: {\n type: Boolean as PropType<UndoRedoControlProps[\"canRedo\"]>,\n default: undefined,\n },\n undoLabel: {\n type: String as PropType<UndoRedoControlProps[\"undoLabel\"]>,\n },\n redoLabel: {\n type: String as PropType<UndoRedoControlProps[\"redoLabel\"]>,\n },\n labels: { type: Object as PropType<UndoRedoControlProps[\"labels\"]> },\n classNames: {\n type: Object as PropType<UndoRedoControlProps[\"classNames\"]>,\n },\n },\n }\n);\n","import {\n type CellEditHandler,\n type StaticTableFeature,\n type TableEditingOptions,\n type TableFeature,\n} from \"@adapttable/vue\";\nimport {\n batchEditBarSlotKey,\n editableCellSlotKey,\n editingFamilyList,\n extendFeature,\n rowEditActionsSlotKey,\n slotRender,\n UNDO_REDO_CONTROL,\n} from \"@adapttable/vue/adapter\";\nimport {\n batchEditing as bindingBatchEditing,\n dirtyIndicators,\n editHistory,\n editing as bindingEditing,\n type EditingLifecycleExtras,\n rowEditing as bindingRowEditing,\n undoRedoButtons as bindingUndoRedoButtons,\n} from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport { ElementEditableCell } from \"./editing/ElementEditableCell\";\nimport {\n ElementBatchEditBar,\n ElementRowEditActions,\n} from \"./editing/ElementEditingActions\";\nimport { ElementHistoryButtons } from \"./editing/ElementHistoryButtons\";\n\nfunction cellSlot<TRow>() {\n return slotRender(editableCellSlotKey<TRow>(), (props) =>\n h(ElementEditableCell<TRow>, { ...props })\n );\n}\n\n/** Element controls keep all validation, save and host-write transitions in the binding. */\nexport function editing<TRow>(\n onCellEdit: CellEditHandler<TRow>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingEditing(onCellEdit, extras), [cellSlot<TRow>()]);\n}\n\n/** Edit a row as one gesture with explicit Element Plus Save and Cancel controls. */\nexport function rowEditing<TRow>(\n onRowEdit: NonNullable<TableEditingOptions<TRow>[\"onRowEdit\"]>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingRowEditing(onRowEdit, extras), [\n cellSlot<TRow>(),\n slotRender(rowEditActionsSlotKey<TRow>(), (props) =>\n h(ElementRowEditActions<TRow>, { ...props })\n ),\n ]);\n}\n\n/** Stage edits across rows; host writes happen only on the batch Save action. */\nexport function batchEditing<TRow>(\n onBatchEdit: NonNullable<TableEditingOptions<TRow>[\"onBatchEdit\"]>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingBatchEditing(onBatchEdit, extras), [\n cellSlot<TRow>(),\n slotRender(batchEditBarSlotKey<TRow>(), (props) =>\n h(ElementBatchEditBar<TRow>, { ...props })\n ),\n ]);\n}\n\nexport { ElementEditableCell } from \"./editing/ElementEditableCell\";\nexport {\n ElementBatchEditBar,\n ElementRowEditActions,\n} from \"./editing/ElementEditingActions\";\nexport type {\n BatchEditingState,\n BatchRowEdit,\n CellEditHandler,\n RowEditingState,\n TableEditingOptions,\n} from \"@adapttable/vue\";\nexport type { RowEditIcons } from \"@adapttable/vue/adapter\";\nexport type { EditingLifecycleExtras } from \"@adapttable/vue/features\";\nexport { dirtyIndicators, editHistory };\n\n/** Opt-in Element Plus Undo and Redo buttons use the shell's history projection. */\nexport function undoRedoButtons(): StaticTableFeature {\n return extendFeature(bindingUndoRedoButtons(), [\n slotRender(UNDO_REDO_CONTROL, (props) =>\n h(ElementHistoryButtons, { ...props })\n ),\n ]);\n}\n\n/**\n * All of editing — cell editing, dirty marks, edit history and undo\n * controls — with this kit's controls, passed to `features` as one entry.\n * Row and batch editing join beside it.\n *\n * @public\n */\nexport function editingFamily<TRow>(\n onCellEdit: CellEditHandler<TRow>,\n extras?: EditingLifecycleExtras<TRow>\n): readonly TableFeature<TRow>[] {\n return editingFamilyList<\n TableFeature<TRow>,\n CellEditHandler<TRow>,\n EditingLifecycleExtras<TRow> | undefined\n >(\n {\n editing: (save, more) => editing(save, more),\n dirtyIndicators,\n editHistory: () => editHistory(),\n undoRedoButtons,\n },\n onCellEdit,\n extras\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAMA,MAAM,QAAQ;EAId,MAAM,OAAO;EACb,MAAM,WAAA,GAAU,IAAA,WAAA,CAA2B;EAC3C,SAAS,OAAO,OAA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BAAAA,WAAAA,CAAWa,wBAAAA,oBAAoB,WAAA,GAC7BX,IAAAA,EAAAA,CAAE,uBAAuB,EAAE,GAAG,MAAM,CAAC,CACvC,CACF,CAAC;AACH;;;;;;;;AASA,SAAgB,cACd,YACA,QAC+B;CAC/B,QAAA,GAAOY,wBAAAA,kBAAAA,CAKL;EACE,UAAU,MAAM,SAAS,QAAQ,MAAM,IAAI;EAC3C,iBAAA,yBAAA;EACA,oBAAA,GAAmBC,yBAAAA,YAAAA,CAAY;EAC/B;CACF,GACA,YACA,MACF;AACF"}
@@ -1,5 +1,5 @@
1
1
  import { n as useClassNames } from "./classNamesContext-18Wbxy4F.js";
2
- import { t as elementButton } from "./button-DwB4UxI2.js";
2
+ import { t as elementButton } from "./button-DUddRulx.js";
3
3
  import { t as _sfc_main$4 } from "./ElementCheckbox-DobrxadY.js";
4
4
  import { t as _sfc_main$5 } from "./ElementInput-Cn9hpa9j.js";
5
5
  import { t as _sfc_main$6 } from "./ElementSelect-BxFmnPpv.js";
@@ -403,4 +403,4 @@ function editingFamily(onCellEdit, extras) {
403
403
  //#endregion
404
404
  export { editingFamily as a, _sfc_main as c, editing$1 as i, _sfc_main$1 as l, dirtyIndicators as n, rowEditing$1 as o, editHistory as r, undoRedoButtons$1 as s, batchEditing$1 as t, _sfc_main$2 as u };
405
405
 
406
- //# sourceMappingURL=editing-BlpYR839.js.map
406
+ //# sourceMappingURL=editing-BgWyfVFS.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editing-BlpYR839.js","names":["$attrs","ElementCheckbox","ElementMultiSelect","ElementSelect","ElementInput","ElementEditableCell","editing","bindingEditing","rowEditing","bindingRowEditing","ElementRowEditActions","batchEditing","bindingBatchEditing","ElementBatchEditBar","undoRedoButtons","bindingUndoRedoButtons"],"sources":["../src/controls/ElementMultiSelect.vue","../src/controls/focusRef.ts","../src/editing/ElementCellEditor.ts","../src/editing/ElementEditableCell.vue","../src/editing/elementEditingButton.ts","../src/editing/ElementBatchEditBar.vue","../src/editing/ElementRowEditActions.vue","../src/editing/ElementHistoryButtons.ts","../src/editing.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { scheduleTick } from \"@adapttable/vue/adapter\";\nimport { ElOption, ElSelect, type SelectInstance } from \"element-plus\";\nimport { shallowRef } from \"vue\";\n\ndefineOptions({ inheritAttrs: false });\nconst props = defineProps<{\n value: readonly string[];\n options: readonly { value: string; label: string }[];\n}>();\nconst emit = defineEmits<{ change: [value: string[]] }>();\nconst control = shallowRef<SelectInstance>();\nfunction change(value: unknown): void {\n if (\n Array.isArray(value) &&\n value.every((item): item is string => typeof item === \"string\")\n )\n emit(\"change\", value);\n scheduleTick(() => control.value?.$forceUpdate());\n}\n// A parent ref resolves before this template ref does, so a focus requested\n// while the select mounts waits a tick for it.\nfunction focus(): void {\n if (control.value) control.value.focus();\n else scheduleTick(() => control.value?.focus());\n}\ndefineExpose({\n focus,\n blur: () => control.value?.blur(),\n});\n</script>\n\n<template>\n <ElSelect\n ref=\"control\"\n v-bind=\"$attrs\"\n :model-value=\"[...props.value]\"\n multiple\n :teleported=\"false\"\n :validate-event=\"false\"\n @update:model-value=\"change\"\n >\n <ElOption\n v-for=\"option in props.options\"\n :key=\"option.value\"\n :value=\"option.value\"\n :label=\"option.label\"\n />\n </ElSelect>\n</template>\n","import type { VNodeProps } from \"vue\";\n\ninterface FocusTarget {\n focus(): void;\n}\nfunction isFocusTarget(value: unknown): value is FocusTarget {\n return (\n value !== null &&\n typeof value === \"object\" &&\n \"focus\" in value &&\n typeof value.focus === \"function\"\n );\n}\n/** Keep the supported exposed focus handle, including its stable identity. */\nexport function focusControlRef(\n set: (target: FocusTarget | null) => void\n): VNodeProps[\"ref\"] {\n return (value) => {\n if (value === null) {\n set(null);\n return;\n }\n if (!isFocusTarget(value))\n throw new Error(\n \"AdaptTable: Element Plus control must expose its supported focus method.\"\n );\n set(value);\n };\n}\n","import {\n type EditableCellEditorProps,\n editorInputType,\n formatMultiDraft,\n readMultiDraft,\n scheduleTick,\n useScopeActivity,\n withProps,\n} from \"@adapttable/vue/adapter\";\nimport {\n computed,\n createVNode,\n defineComponent,\n h,\n onMounted,\n type PropType,\n shallowRef,\n watch,\n} from \"vue\";\n\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementMultiSelect from \"../controls/ElementMultiSelect.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\nimport { focusControlRef } from \"../controls/focusRef\";\n\n/** The kit owns its nested popup; draft and commit transitions stay in Chrome. */\nconst editorRuntimeProps = {\n controller: {\n type: Object as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"controller\"]\n >,\n },\n label: {\n type: String as PropType<\n (EditableCellEditorProps<unknown> & { className?: string })[\"label\"]\n >,\n },\n attrs: {\n type: Object as PropType<\n (EditableCellEditorProps<unknown> & { className?: string })[\"attrs\"]\n >,\n },\n editorRef: {\n type: Function as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"editorRef\"]\n >,\n },\n onChange: {\n type: Function as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"onChange\"]\n >,\n },\n onBlur: {\n type: Function as PropType<\n (EditableCellEditorProps<unknown> & { className?: string })[\"onBlur\"]\n >,\n },\n onKeyDown: {\n type: Function as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"onKeyDown\"]\n >,\n },\n className: {\n type: String as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"className\"]\n >,\n },\n};\n\nconst ElementCellEditorPresentation = defineComponent(\n (props: EditableCellEditorProps<unknown> & { className?: string }) => {\n const active = useScopeActivity();\n const mounted = shallowRef(false);\n const host = shallowRef<HTMLElement | null>(null);\n const field = shallowRef<HTMLInputElement | HTMLTextAreaElement | null>(\n null\n );\n const popup = shallowRef(false);\n onMounted(() => {\n mounted.value = true;\n });\n const present = computed(() => !mounted.value || active.value);\n watch(\n active,\n (live) => {\n if (!live) popup.value = false;\n },\n { flush: \"sync\" }\n );\n function validation(): void {\n const target = field.value;\n if (!target || !active.value || !target.isConnected) return;\n for (const name of [\"aria-invalid\", \"aria-describedby\"] as const) {\n const value = props.attrs[name];\n if (typeof value === \"string\" || typeof value === \"boolean\")\n target.setAttribute(name, String(value));\n else target.removeAttribute(name);\n }\n }\n watch([field, active, () => props.attrs], validation, { flush: \"post\" });\n function focusin(event: FocusEvent): void {\n const target = event.target;\n if (\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement\n ) {\n // The native focus event identifies Select's field without private refs.\n field.value = target;\n validation();\n }\n }\n function keydown(event: KeyboardEvent): void {\n if (\n active.value &&\n !popup.value &&\n !event.defaultPrevented &&\n !event.isComposing\n )\n props.onKeyDown(event);\n }\n function focusout(event: FocusEvent): void {\n if (\n event.relatedTarget instanceof Node &&\n host.value?.contains(event.relatedTarget)\n )\n return;\n const commit = props.onBlur;\n scheduleTick(() => {\n if (\n active.value &&\n !popup.value &&\n host.value &&\n !host.value.contains(document.activeElement)\n )\n commit();\n });\n }\n function control() {\n const editor = props.controller.editor;\n const owner = props.editorRef;\n const inputRef = (\n target: HTMLInputElement | HTMLTextAreaElement | null\n ): void => {\n field.value = target;\n owner(target);\n };\n const attrs = {\n ...props.attrs,\n class: props.className,\n \"aria-label\": props.label,\n };\n if (editor === \"boolean\")\n return h(ElementCheckbox, {\n ...attrs,\n label: props.label,\n checked: props.controller.draft === \"true\",\n inputRef,\n onChange: (checked) => props.onChange(String(checked)),\n });\n if (editor && typeof editor === \"object\") {\n const select = {\n ...attrs,\n ref: focusControlRef(props.editorRef),\n options: props.controller.selectOptions,\n onVisibleChange: (open: boolean) => {\n popup.value = open;\n },\n };\n if (editor.type === \"multi-select\")\n return h(ElementMultiSelect, {\n ...select,\n value: readMultiDraft(props.controller.draft),\n onChange: (values) => props.onChange(formatMultiDraft(values)),\n });\n return h(ElementSelect, {\n ...select,\n value: props.controller.draft,\n onChange: props.onChange,\n });\n }\n return h(ElementInput, {\n ...attrs,\n type: editorInputType(editor),\n value: props.controller.draft,\n inputRef,\n onChange: props.onChange,\n });\n }\n return () =>\n h(\n \"div\",\n {\n ref: host,\n class: \"adapttable-element-plus-editor-host\",\n onKeydownCapture: keydown,\n onFocusinCapture: focusin,\n onFocusout: focusout,\n },\n present.value ? [control()] : []\n );\n },\n {\n name: \"ElementCellEditor\",\n inheritAttrs: false,\n props: editorRuntimeProps,\n }\n);\n\n// Keep the row type at the functional boundary; the presentation validates\n// values and owns the editor's reactive lifecycle.\nconst ElementCellEditor = /* @__PURE__ */ withProps(\n function ElementCellEditor<TRow>(\n props: EditableCellEditorProps<TRow> & { className?: string }\n ) {\n return createVNode(ElementCellEditorPresentation, { ...props });\n },\n Object.keys(editorRuntimeProps) as (keyof typeof editorRuntimeProps)[],\n { inheritAttrs: false }\n);\nexport default ElementCellEditor;\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n EditableCellChrome,\n type EditableCellChromeSlots,\n editableCustomControl,\n useEditableCellModel,\n type VueEditableCellProps,\n} from \"@adapttable/vue/adapter\";\nimport { Fragment, h, type VNodeChild } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\nimport ElementCellEditor from \"./ElementCellEditor\";\n\ndefineOptions({ name: \"ElementEditableCell\" });\nconst props = defineProps<VueEditableCellProps<TRow>>();\nconst names = useClassNames();\nconst model = useEditableCellModel(() => props);\nconst controls: EditableCellChromeSlots<TRow> = {\n Activate: (control) =>\n elementButton(\n {\n title: control.title,\n text: true,\n \"aria-description\": control.title,\n class: [\n \"adapttable-element-edit-value\",\n control.className,\n names.value.editCellActivate,\n ],\n ref: control.activateRef,\n \"data-adapttable-part\": \"edit-cell-activate\",\n \"data-save-status\": control.saveStatus,\n \"data-dirty\": control.dirty ? \"\" : undefined,\n onClick: control.onClick,\n onDblclick: control.onDoubleClick,\n onKeydown: control.onKeyDown,\n },\n control.display\n ),\n Editor: (control) => {\n const editor = control.controller.editor;\n if (editor && typeof editor === \"object\" && editor.type === \"custom\")\n return h(Fragment, [\n editor.render(editableCustomControl(model.value)) as VNodeChild,\n ]);\n return h(ElementCellEditor<TRow>, {\n ...control,\n className: names.value.editCellEditor,\n });\n },\n Button: (control) =>\n elementButton(\n {\n class: [\n control.className,\n control.part === \"edit-cell-rollback\"\n ? names.value.editCellRollback\n : names.value.editCellConflictButton,\n ],\n \"data-adapttable-part\": control.part,\n onMousedown: control.onMouseDown,\n onClick: control.onClick,\n },\n control.label\n ),\n};\nconst Render = () =>\n EditableCellChrome({ model: model.value, classNames: names.value, controls });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template><Render /></template>\n\n<style>\n.el-button.adapttable-element-edit-value {\n justify-content: start;\n inline-size: 100%;\n min-inline-size: 0;\n block-size: auto;\n padding: 0;\n border: 0;\n color: inherit;\n font: inherit;\n text-align: inherit;\n white-space: normal;\n overflow-wrap: anywhere;\n cursor: text;\n}\n.el-button.adapttable-element-edit-value > span {\n min-inline-size: 0;\n}\n</style>\n","import type { EditingActionButtonProps } from \"@adapttable/vue/adapter\";\nimport { mergeProps, type VNodeChild } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n\nexport function elementEditingButton(\n control: EditingActionButtonProps,\n className?: string\n) {\n return elementButton(\n mergeProps(control.attrs, { class: className, onClick: control.onClick }),\n [\n control.icon === false ? null : (control.icon as VNodeChild),\n control.label,\n ]\n );\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n BatchEditBarChrome,\n type BatchEditBarProps,\n} from \"@adapttable/vue/adapter\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementEditingButton } from \"./elementEditingButton\";\ndefineOptions({ name: \"ElementBatchEditBar\" });\nconst { contested = undefined, ...props } =\n defineProps<BatchEditBarProps<TRow>>();\nconst names = useClassNames();\nconst Render = () =>\n BatchEditBarChrome({\n ...props,\n contested,\n className: [props.className, names.value.batchEditBar]\n .filter(Boolean)\n .join(\" \"),\n controls: {\n Button: (control) =>\n elementEditingButton(control, names.value.batchEditButton),\n },\n });\n\n// Declare no props so Vue forwards all root attributes, including id and data-*.\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n RowEditActionsChrome,\n type RowEditActionsProps,\n} from \"@adapttable/vue/adapter\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementEditingButton } from \"./elementEditingButton\";\ndefineOptions({ name: \"ElementRowEditActions\" });\nconst { showBegin = undefined, ...props } =\n defineProps<RowEditActionsProps<TRow>>();\nconst names = useClassNames();\nconst Render = () =>\n RowEditActionsChrome({\n ...props,\n showBegin,\n className: [props.className, names.value.rowEditActions]\n .filter(Boolean)\n .join(\" \"),\n controls: {\n Button: (control) =>\n elementEditingButton(control, names.value.rowEditButton),\n },\n });\n\n// Declare no props so Vue forwards all root attributes, including id and data-*.\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n","import {\n HistoryButtonsChrome,\n type UndoRedoControlProps,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, type PropType } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\n\nexport const ElementHistoryButtons = defineComponent(\n (props: UndoRedoControlProps) => {\n const names = useClassNames();\n return () =>\n HistoryButtonsChrome({\n ...props,\n classNames: { ...names.value },\n slots: { Button: ({ label, attrs }) => elementButton(attrs, label) },\n });\n },\n {\n name: \"ElementHistoryButtons\",\n props: {\n onUndo: { type: Function as PropType<UndoRedoControlProps[\"onUndo\"]> },\n onRedo: { type: Function as PropType<UndoRedoControlProps[\"onRedo\"]> },\n canUndo: {\n type: Boolean as PropType<UndoRedoControlProps[\"canUndo\"]>,\n default: undefined,\n },\n canRedo: {\n type: Boolean as PropType<UndoRedoControlProps[\"canRedo\"]>,\n default: undefined,\n },\n undoLabel: {\n type: String as PropType<UndoRedoControlProps[\"undoLabel\"]>,\n },\n redoLabel: {\n type: String as PropType<UndoRedoControlProps[\"redoLabel\"]>,\n },\n labels: { type: Object as PropType<UndoRedoControlProps[\"labels\"]> },\n classNames: {\n type: Object as PropType<UndoRedoControlProps[\"classNames\"]>,\n },\n },\n }\n);\n","import {\n type CellEditHandler,\n type StaticTableFeature,\n type TableEditingOptions,\n type TableFeature,\n} from \"@adapttable/vue\";\nimport {\n batchEditBarSlotKey,\n editableCellSlotKey,\n editingFamilyList,\n extendFeature,\n rowEditActionsSlotKey,\n slotRender,\n UNDO_REDO_CONTROL,\n} from \"@adapttable/vue/adapter\";\nimport {\n batchEditing as bindingBatchEditing,\n dirtyIndicators,\n editHistory,\n editing as bindingEditing,\n type EditingLifecycleExtras,\n rowEditing as bindingRowEditing,\n undoRedoButtons as bindingUndoRedoButtons,\n} from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport { ElementEditableCell } from \"./editing/ElementEditableCell\";\nimport {\n ElementBatchEditBar,\n ElementRowEditActions,\n} from \"./editing/ElementEditingActions\";\nimport { ElementHistoryButtons } from \"./editing/ElementHistoryButtons\";\n\nfunction cellSlot<TRow>() {\n return slotRender(editableCellSlotKey<TRow>(), (props) =>\n h(ElementEditableCell<TRow>, { ...props })\n );\n}\n\n/** Element controls keep all validation, save and host-write transitions in the binding. */\nexport function editing<TRow>(\n onCellEdit: CellEditHandler<TRow>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingEditing(onCellEdit, extras), [cellSlot<TRow>()]);\n}\n\n/** Edit a row as one gesture with explicit Element Plus Save and Cancel controls. */\nexport function rowEditing<TRow>(\n onRowEdit: NonNullable<TableEditingOptions<TRow>[\"onRowEdit\"]>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingRowEditing(onRowEdit, extras), [\n cellSlot<TRow>(),\n slotRender(rowEditActionsSlotKey<TRow>(), (props) =>\n h(ElementRowEditActions<TRow>, { ...props })\n ),\n ]);\n}\n\n/** Stage edits across rows; host writes happen only on the batch Save action. */\nexport function batchEditing<TRow>(\n onBatchEdit: NonNullable<TableEditingOptions<TRow>[\"onBatchEdit\"]>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingBatchEditing(onBatchEdit, extras), [\n cellSlot<TRow>(),\n slotRender(batchEditBarSlotKey<TRow>(), (props) =>\n h(ElementBatchEditBar<TRow>, { ...props })\n ),\n ]);\n}\n\nexport { ElementEditableCell } from \"./editing/ElementEditableCell\";\nexport {\n ElementBatchEditBar,\n ElementRowEditActions,\n} from \"./editing/ElementEditingActions\";\nexport type {\n BatchEditingState,\n BatchRowEdit,\n CellEditHandler,\n RowEditingState,\n TableEditingOptions,\n} from \"@adapttable/vue\";\nexport type { RowEditIcons } from \"@adapttable/vue/adapter\";\nexport type { EditingLifecycleExtras } from \"@adapttable/vue/features\";\nexport { dirtyIndicators, editHistory };\n\n/** Opt-in Element Plus Undo and Redo buttons use the shell's history projection. */\nexport function undoRedoButtons(): StaticTableFeature {\n return extendFeature(bindingUndoRedoButtons(), [\n slotRender(UNDO_REDO_CONTROL, (props) =>\n h(ElementHistoryButtons, { ...props })\n ),\n ]);\n}\n\n/**\n * All of editing — cell editing, dirty marks, edit history and undo\n * controls — with this kit's controls, passed to `features` as one entry.\n * Row and batch editing join beside it.\n *\n * @public\n */\nexport function editingFamily<TRow>(\n onCellEdit: CellEditHandler<TRow>,\n extras?: EditingLifecycleExtras<TRow>\n): readonly TableFeature<TRow>[] {\n return editingFamilyList<\n TableFeature<TRow>,\n CellEditHandler<TRow>,\n EditingLifecycleExtras<TRow> | undefined\n >(\n {\n editing: (save, more) => editing(save, more),\n dirtyIndicators,\n editHistory: () => editHistory(),\n undoRedoButtons,\n },\n onCellEdit,\n extras\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAMA,MAAM,QAAQ;EAId,MAAM,OAAO;EACb,MAAM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AM;GACN,SAAS,KAAA;EACX;EACA,SAAS;GACP,MAAM;GACN,SAAS,KAAA;EACX;EACA,WAAW,EACT,MAAM,OACR;EACA,WAAW,EACT,MAAM,OACR;EACA,QAAQ,EAAE,MAAM,OAAmD;EACnE,YAAY,EACV,MAAM,OACR;CACF;AACF,CACF;;;ACXA,SAAS,WAAiB;CACxB,OAAO,WAAW,oBAA0B,IAAI,UAC9C,EAAEC,aAA2B,EAAE,GAAG,MAAM,CAAC,CAC3C;AACF;;AAGA,SAAgBC,UACd,YACA,SAAuC,CAAC,GACpB;CACpB,OAAO,cAAcC,QAAe,YAAY,MAAM,GAAG,CAAC,SAAe,CAAC,CAAC;AAC7E;;AAGA,SAAgBC,aACd,WACA,SAAuC,CAAC,GACpB;CACpB,OAAO,cAAcC,WAAkB,WAAW,MAAM,GAAG,CACzD,SAAe,GACf,WAAW,sBAA4B,IAAI,UACzC,EAAEC,WAA6B,EAAE,GAAG,MAAM,CAAC,CAC7C,CACF,CAAC;AACH;;AAGA,SAAgBC,eACd,aACA,SAAuC,CAAC,GACpB;CACpB,OAAO,cAAcC,aAAoB,aAAa,MAAM,GAAG,CAC7D,SAAe,GACf,WAAW,oBAA0B,IAAI,UACvC,EAAEC,aAA2B,EAAE,GAAG,MAAM,CAAC,CAC3C,CACF,CAAC;AACH;;AAmBA,SAAgBC,oBAAsC;CACpD,OAAO,cAAcC,gBAAuB,GAAG,CAC7C,WAAW,oBAAoB,UAC7B,EAAE,uBAAuB,EAAE,GAAG,MAAM,CAAC,CACvC,CACF,CAAC;AACH;;;;;;;;AASA,SAAgB,cACd,YACA,QAC+B;CAC/B,OAAO,kBAKL;EACE,UAAU,MAAM,SAAST,UAAQ,MAAM,IAAI;EAC3C;EACA,mBAAmB,YAAY;EAC/B,iBAAA;CACF,GACA,YACA,MACF;AACF"}
1
+ {"version":3,"file":"editing-BgWyfVFS.js","names":["$attrs","ElementCheckbox","ElementMultiSelect","ElementSelect","ElementInput","ElementEditableCell","editing","bindingEditing","rowEditing","bindingRowEditing","ElementRowEditActions","batchEditing","bindingBatchEditing","ElementBatchEditBar","undoRedoButtons","bindingUndoRedoButtons"],"sources":["../src/controls/ElementMultiSelect.vue","../src/controls/focusRef.ts","../src/editing/ElementCellEditor.ts","../src/editing/ElementEditableCell.vue","../src/editing/elementEditingButton.ts","../src/editing/ElementBatchEditBar.vue","../src/editing/ElementRowEditActions.vue","../src/editing/ElementHistoryButtons.ts","../src/editing.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { scheduleTick } from \"@adapttable/vue/adapter\";\nimport { ElOption, ElSelect, type SelectInstance } from \"element-plus\";\nimport { shallowRef } from \"vue\";\n\ndefineOptions({ inheritAttrs: false });\nconst props = defineProps<{\n value: readonly string[];\n options: readonly { value: string; label: string }[];\n}>();\nconst emit = defineEmits<{ change: [value: string[]] }>();\nconst control = shallowRef<SelectInstance>();\nfunction change(value: unknown): void {\n if (\n Array.isArray(value) &&\n value.every((item): item is string => typeof item === \"string\")\n )\n emit(\"change\", value);\n scheduleTick(() => control.value?.$forceUpdate());\n}\n// A parent ref resolves before this template ref does, so a focus requested\n// while the select mounts waits a tick for it.\nfunction focus(): void {\n if (control.value) control.value.focus();\n else scheduleTick(() => control.value?.focus());\n}\ndefineExpose({\n focus,\n blur: () => control.value?.blur(),\n});\n</script>\n\n<template>\n <ElSelect\n ref=\"control\"\n v-bind=\"$attrs\"\n :model-value=\"[...props.value]\"\n multiple\n :teleported=\"false\"\n :validate-event=\"false\"\n @update:model-value=\"change\"\n >\n <ElOption\n v-for=\"option in props.options\"\n :key=\"option.value\"\n :value=\"option.value\"\n :label=\"option.label\"\n />\n </ElSelect>\n</template>\n","import type { VNodeProps } from \"vue\";\n\ninterface FocusTarget {\n focus(): void;\n}\nfunction isFocusTarget(value: unknown): value is FocusTarget {\n return (\n value !== null &&\n typeof value === \"object\" &&\n \"focus\" in value &&\n typeof value.focus === \"function\"\n );\n}\n/** Keep the supported exposed focus handle, including its stable identity. */\nexport function focusControlRef(\n set: (target: FocusTarget | null) => void\n): VNodeProps[\"ref\"] {\n return (value) => {\n if (value === null) {\n set(null);\n return;\n }\n if (!isFocusTarget(value))\n throw new Error(\n \"AdaptTable: Element Plus control must expose its supported focus method.\"\n );\n set(value);\n };\n}\n","import {\n type EditableCellEditorProps,\n editorInputType,\n formatMultiDraft,\n readMultiDraft,\n scheduleTick,\n useScopeActivity,\n withProps,\n} from \"@adapttable/vue/adapter\";\nimport {\n computed,\n createVNode,\n defineComponent,\n h,\n onMounted,\n type PropType,\n shallowRef,\n watch,\n} from \"vue\";\n\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementMultiSelect from \"../controls/ElementMultiSelect.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\nimport { focusControlRef } from \"../controls/focusRef\";\n\n/** The kit owns its nested popup; draft and commit transitions stay in Chrome. */\nconst editorRuntimeProps = {\n controller: {\n type: Object as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"controller\"]\n >,\n },\n label: {\n type: String as PropType<\n (EditableCellEditorProps<unknown> & { className?: string })[\"label\"]\n >,\n },\n attrs: {\n type: Object as PropType<\n (EditableCellEditorProps<unknown> & { className?: string })[\"attrs\"]\n >,\n },\n editorRef: {\n type: Function as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"editorRef\"]\n >,\n },\n onChange: {\n type: Function as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"onChange\"]\n >,\n },\n onBlur: {\n type: Function as PropType<\n (EditableCellEditorProps<unknown> & { className?: string })[\"onBlur\"]\n >,\n },\n onKeyDown: {\n type: Function as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"onKeyDown\"]\n >,\n },\n className: {\n type: String as PropType<\n (EditableCellEditorProps<unknown> & {\n className?: string;\n })[\"className\"]\n >,\n },\n};\n\nconst ElementCellEditorPresentation = defineComponent(\n (props: EditableCellEditorProps<unknown> & { className?: string }) => {\n const active = useScopeActivity();\n const mounted = shallowRef(false);\n const host = shallowRef<HTMLElement | null>(null);\n const field = shallowRef<HTMLInputElement | HTMLTextAreaElement | null>(\n null\n );\n const popup = shallowRef(false);\n onMounted(() => {\n mounted.value = true;\n });\n const present = computed(() => !mounted.value || active.value);\n watch(\n active,\n (live) => {\n if (!live) popup.value = false;\n },\n { flush: \"sync\" }\n );\n function validation(): void {\n const target = field.value;\n if (!target || !active.value || !target.isConnected) return;\n for (const name of [\"aria-invalid\", \"aria-describedby\"] as const) {\n const value = props.attrs[name];\n if (typeof value === \"string\" || typeof value === \"boolean\")\n target.setAttribute(name, String(value));\n else target.removeAttribute(name);\n }\n }\n watch([field, active, () => props.attrs], validation, { flush: \"post\" });\n function focusin(event: FocusEvent): void {\n const target = event.target;\n if (\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement\n ) {\n // The native focus event identifies Select's field without private refs.\n field.value = target;\n validation();\n }\n }\n function keydown(event: KeyboardEvent): void {\n if (\n active.value &&\n !popup.value &&\n !event.defaultPrevented &&\n !event.isComposing\n )\n props.onKeyDown(event);\n }\n function focusout(event: FocusEvent): void {\n if (\n event.relatedTarget instanceof Node &&\n host.value?.contains(event.relatedTarget)\n )\n return;\n const commit = props.onBlur;\n scheduleTick(() => {\n if (\n active.value &&\n !popup.value &&\n host.value &&\n !host.value.contains(document.activeElement)\n )\n commit();\n });\n }\n function control() {\n const editor = props.controller.editor;\n const owner = props.editorRef;\n const inputRef = (\n target: HTMLInputElement | HTMLTextAreaElement | null\n ): void => {\n field.value = target;\n owner(target);\n };\n const attrs = {\n ...props.attrs,\n class: props.className,\n \"aria-label\": props.label,\n };\n if (editor === \"boolean\")\n return h(ElementCheckbox, {\n ...attrs,\n label: props.label,\n checked: props.controller.draft === \"true\",\n inputRef,\n onChange: (checked) => props.onChange(String(checked)),\n });\n if (editor && typeof editor === \"object\") {\n const select = {\n ...attrs,\n ref: focusControlRef(props.editorRef),\n options: props.controller.selectOptions,\n onVisibleChange: (open: boolean) => {\n popup.value = open;\n },\n };\n if (editor.type === \"multi-select\")\n return h(ElementMultiSelect, {\n ...select,\n value: readMultiDraft(props.controller.draft),\n onChange: (values) => props.onChange(formatMultiDraft(values)),\n });\n return h(ElementSelect, {\n ...select,\n value: props.controller.draft,\n onChange: props.onChange,\n });\n }\n return h(ElementInput, {\n ...attrs,\n type: editorInputType(editor),\n value: props.controller.draft,\n inputRef,\n onChange: props.onChange,\n });\n }\n return () =>\n h(\n \"div\",\n {\n ref: host,\n class: \"adapttable-element-plus-editor-host\",\n onKeydownCapture: keydown,\n onFocusinCapture: focusin,\n onFocusout: focusout,\n },\n present.value ? [control()] : []\n );\n },\n {\n name: \"ElementCellEditor\",\n inheritAttrs: false,\n props: editorRuntimeProps,\n }\n);\n\n// Keep the row type at the functional boundary; the presentation validates\n// values and owns the editor's reactive lifecycle.\nconst ElementCellEditor = /* @__PURE__ */ withProps(\n function ElementCellEditor<TRow>(\n props: EditableCellEditorProps<TRow> & { className?: string }\n ) {\n return createVNode(ElementCellEditorPresentation, { ...props });\n },\n Object.keys(editorRuntimeProps) as (keyof typeof editorRuntimeProps)[],\n { inheritAttrs: false }\n);\nexport default ElementCellEditor;\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n EditableCellChrome,\n type EditableCellChromeSlots,\n editableCustomControl,\n useEditableCellModel,\n type VueEditableCellProps,\n} from \"@adapttable/vue/adapter\";\nimport { Fragment, h, type VNodeChild } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\nimport ElementCellEditor from \"./ElementCellEditor\";\n\ndefineOptions({ name: \"ElementEditableCell\" });\nconst props = defineProps<VueEditableCellProps<TRow>>();\nconst names = useClassNames();\nconst model = useEditableCellModel(() => props);\nconst controls: EditableCellChromeSlots<TRow> = {\n Activate: (control) =>\n elementButton(\n {\n title: control.title,\n text: true,\n \"aria-description\": control.title,\n class: [\n \"adapttable-element-edit-value\",\n control.className,\n names.value.editCellActivate,\n ],\n ref: control.activateRef,\n \"data-adapttable-part\": \"edit-cell-activate\",\n \"data-save-status\": control.saveStatus,\n \"data-dirty\": control.dirty ? \"\" : undefined,\n onClick: control.onClick,\n onDblclick: control.onDoubleClick,\n onKeydown: control.onKeyDown,\n },\n control.display\n ),\n Editor: (control) => {\n const editor = control.controller.editor;\n if (editor && typeof editor === \"object\" && editor.type === \"custom\")\n return h(Fragment, [\n editor.render(editableCustomControl(model.value)) as VNodeChild,\n ]);\n return h(ElementCellEditor<TRow>, {\n ...control,\n className: names.value.editCellEditor,\n });\n },\n Button: (control) =>\n elementButton(\n {\n class: [\n control.className,\n control.part === \"edit-cell-rollback\"\n ? names.value.editCellRollback\n : names.value.editCellConflictButton,\n ],\n \"data-adapttable-part\": control.part,\n onMousedown: control.onMouseDown,\n onClick: control.onClick,\n },\n control.label\n ),\n};\nconst Render = () =>\n EditableCellChrome({ model: model.value, classNames: names.value, controls });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template><Render /></template>\n\n<style>\n.el-button.adapttable-element-edit-value {\n justify-content: start;\n inline-size: 100%;\n min-inline-size: 0;\n block-size: auto;\n padding: 0;\n border: 0;\n color: inherit;\n font: inherit;\n text-align: inherit;\n white-space: normal;\n overflow-wrap: anywhere;\n cursor: text;\n}\n.el-button.adapttable-element-edit-value > span {\n min-inline-size: 0;\n}\n</style>\n","import type { EditingActionButtonProps } from \"@adapttable/vue/adapter\";\nimport { mergeProps, type VNodeChild } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n\nexport function elementEditingButton(\n control: EditingActionButtonProps,\n className?: string\n) {\n return elementButton(\n mergeProps(control.attrs, { class: className, onClick: control.onClick }),\n [\n control.icon === false ? null : (control.icon as VNodeChild),\n control.label,\n ]\n );\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n BatchEditBarChrome,\n type BatchEditBarProps,\n} from \"@adapttable/vue/adapter\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementEditingButton } from \"./elementEditingButton\";\ndefineOptions({ name: \"ElementBatchEditBar\" });\nconst { contested = undefined, ...props } =\n defineProps<BatchEditBarProps<TRow>>();\nconst names = useClassNames();\nconst Render = () =>\n BatchEditBarChrome({\n ...props,\n contested,\n className: [props.className, names.value.batchEditBar]\n .filter(Boolean)\n .join(\" \"),\n controls: {\n Button: (control) =>\n elementEditingButton(control, names.value.batchEditButton),\n },\n });\n\n// Declare no props so Vue forwards all root attributes, including id and data-*.\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n RowEditActionsChrome,\n type RowEditActionsProps,\n} from \"@adapttable/vue/adapter\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementEditingButton } from \"./elementEditingButton\";\ndefineOptions({ name: \"ElementRowEditActions\" });\nconst { showBegin = undefined, ...props } =\n defineProps<RowEditActionsProps<TRow>>();\nconst names = useClassNames();\nconst Render = () =>\n RowEditActionsChrome({\n ...props,\n showBegin,\n className: [props.className, names.value.rowEditActions]\n .filter(Boolean)\n .join(\" \"),\n controls: {\n Button: (control) =>\n elementEditingButton(control, names.value.rowEditButton),\n },\n });\n\n// Declare no props so Vue forwards all root attributes, including id and data-*.\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n","import {\n HistoryButtonsChrome,\n type UndoRedoControlProps,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, type PropType } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\n\nexport const ElementHistoryButtons = defineComponent(\n (props: UndoRedoControlProps) => {\n const names = useClassNames();\n return () =>\n HistoryButtonsChrome({\n ...props,\n classNames: { ...names.value },\n slots: { Button: ({ label, attrs }) => elementButton(attrs, label) },\n });\n },\n {\n name: \"ElementHistoryButtons\",\n props: {\n onUndo: { type: Function as PropType<UndoRedoControlProps[\"onUndo\"]> },\n onRedo: { type: Function as PropType<UndoRedoControlProps[\"onRedo\"]> },\n canUndo: {\n type: Boolean as PropType<UndoRedoControlProps[\"canUndo\"]>,\n default: undefined,\n },\n canRedo: {\n type: Boolean as PropType<UndoRedoControlProps[\"canRedo\"]>,\n default: undefined,\n },\n undoLabel: {\n type: String as PropType<UndoRedoControlProps[\"undoLabel\"]>,\n },\n redoLabel: {\n type: String as PropType<UndoRedoControlProps[\"redoLabel\"]>,\n },\n labels: { type: Object as PropType<UndoRedoControlProps[\"labels\"]> },\n classNames: {\n type: Object as PropType<UndoRedoControlProps[\"classNames\"]>,\n },\n },\n }\n);\n","import {\n type CellEditHandler,\n type StaticTableFeature,\n type TableEditingOptions,\n type TableFeature,\n} from \"@adapttable/vue\";\nimport {\n batchEditBarSlotKey,\n editableCellSlotKey,\n editingFamilyList,\n extendFeature,\n rowEditActionsSlotKey,\n slotRender,\n UNDO_REDO_CONTROL,\n} from \"@adapttable/vue/adapter\";\nimport {\n batchEditing as bindingBatchEditing,\n dirtyIndicators,\n editHistory,\n editing as bindingEditing,\n type EditingLifecycleExtras,\n rowEditing as bindingRowEditing,\n undoRedoButtons as bindingUndoRedoButtons,\n} from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport { ElementEditableCell } from \"./editing/ElementEditableCell\";\nimport {\n ElementBatchEditBar,\n ElementRowEditActions,\n} from \"./editing/ElementEditingActions\";\nimport { ElementHistoryButtons } from \"./editing/ElementHistoryButtons\";\n\nfunction cellSlot<TRow>() {\n return slotRender(editableCellSlotKey<TRow>(), (props) =>\n h(ElementEditableCell<TRow>, { ...props })\n );\n}\n\n/** Element controls keep all validation, save and host-write transitions in the binding. */\nexport function editing<TRow>(\n onCellEdit: CellEditHandler<TRow>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingEditing(onCellEdit, extras), [cellSlot<TRow>()]);\n}\n\n/** Edit a row as one gesture with explicit Element Plus Save and Cancel controls. */\nexport function rowEditing<TRow>(\n onRowEdit: NonNullable<TableEditingOptions<TRow>[\"onRowEdit\"]>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingRowEditing(onRowEdit, extras), [\n cellSlot<TRow>(),\n slotRender(rowEditActionsSlotKey<TRow>(), (props) =>\n h(ElementRowEditActions<TRow>, { ...props })\n ),\n ]);\n}\n\n/** Stage edits across rows; host writes happen only on the batch Save action. */\nexport function batchEditing<TRow>(\n onBatchEdit: NonNullable<TableEditingOptions<TRow>[\"onBatchEdit\"]>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingBatchEditing(onBatchEdit, extras), [\n cellSlot<TRow>(),\n slotRender(batchEditBarSlotKey<TRow>(), (props) =>\n h(ElementBatchEditBar<TRow>, { ...props })\n ),\n ]);\n}\n\nexport { ElementEditableCell } from \"./editing/ElementEditableCell\";\nexport {\n ElementBatchEditBar,\n ElementRowEditActions,\n} from \"./editing/ElementEditingActions\";\nexport type {\n BatchEditingState,\n BatchRowEdit,\n CellEditHandler,\n RowEditingState,\n TableEditingOptions,\n} from \"@adapttable/vue\";\nexport type { RowEditIcons } from \"@adapttable/vue/adapter\";\nexport type { EditingLifecycleExtras } from \"@adapttable/vue/features\";\nexport { dirtyIndicators, editHistory };\n\n/** Opt-in Element Plus Undo and Redo buttons use the shell's history projection. */\nexport function undoRedoButtons(): StaticTableFeature {\n return extendFeature(bindingUndoRedoButtons(), [\n slotRender(UNDO_REDO_CONTROL, (props) =>\n h(ElementHistoryButtons, { ...props })\n ),\n ]);\n}\n\n/**\n * All of editing — cell editing, dirty marks, edit history and undo\n * controls — with this kit's controls, passed to `features` as one entry.\n * Row and batch editing join beside it.\n *\n * @public\n */\nexport function editingFamily<TRow>(\n onCellEdit: CellEditHandler<TRow>,\n extras?: EditingLifecycleExtras<TRow>\n): readonly TableFeature<TRow>[] {\n return editingFamilyList<\n TableFeature<TRow>,\n CellEditHandler<TRow>,\n EditingLifecycleExtras<TRow> | undefined\n >(\n {\n editing: (save, more) => editing(save, more),\n dirtyIndicators,\n editHistory: () => editHistory(),\n undoRedoButtons,\n },\n onCellEdit,\n extras\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAMA,MAAM,QAAQ;EAId,MAAM,OAAO;EACb,MAAM,UAAU,WAA2B;EAC3C,SAAS,OAAO,OAAsB;GACpC,IACE,MAAM,QAAQ,KAAK,KACnB,MAAM,OAAO,SAAyB,OAAO,SAAS,QAAQ,GAE9D,KAAK,UAAU,KAAK;GACtB,mBAAmB,QAAQ,OAAO,aAAa,CAAC;EAClD;EAGA,SAAS,QAAc;GACrB,IAAI,QAAQ,OAAO,QAAQ,MAAM,MAAM;QAClC,mBAAmB,QAAQ,OAAO,MAAM,CAAC;EAChD;EACA,SAAa;GACX;GACA,YAAY,QAAQ,OAAO,KAAK;EAClC,CAAC;;GAIC,OAAA,UAAA,GAAA,YAeW,MAAA,QAAA,GAfX,WAeW;IAdL,SAAA;IAAJ,KAAI;GACIA,GAAAA,KAAAA,QAAM;IACb,eAAW,CAAA,GAAM,MAAM,KAAK;IAC7B,UAAA;IACC,YAAY;IACZ,kBAAgB;IAChB,uBAAoB;;IAGnB,SAAA,cAA+B,EADjC,UAAA,IAAA,GAAA,mBAKE,UAAA,MAAA,WAJiB,MAAM,UAAhB,WAAM;KADf,OAAA,UAAA,GAAA,YAKE,MAAA,QAAA,GAAA;MAHC,KAAK,OAAO;MACZ,OAAO,OAAO;MACd,OAAO,OAAO;;;;;;;;;;ACzCrB,SAAS,cAAc,OAAsC;CAC3D,OACE,UAAU,QACV,OAAO,UAAU,YACjB,WAAW,SACX,OAAO,MAAM,UAAU;AAE3B;;AAEA,SAAgB,gBACd,KACmB;CACnB,QAAQ,UAAU;EAChB,IAAI,UAAU,MAAM;GAClB,IAAI,IAAI;GACR;EACF;EACA,IAAI,CAAC,cAAc,KAAK,GACtB,MAAM,IAAI,MACR,0EACF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AAO,kBAKL;EACE,UAAU,MAAM,SAAST,UAAQ,MAAM,IAAI;EAC3C;EACA,mBAAmB,YAAY;EAC/B,iBAAA;CACF,GACA,YACA,MACF;AACF"}
package/dist/editing.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_editing = require("./editing-CSqZENeW.cjs");
2
+ const require_editing = require("./editing-Bal8jOJT.cjs");
3
3
  let _adapttable_vue_features = require("@adapttable/vue/features");
4
4
  exports.ElementBatchEditBar = require_editing._sfc_main$1;
5
5
  exports.ElementEditableCell = require_editing._sfc_main$2;
package/dist/editing.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as editingFamily, c as _sfc_main$2, i as editing, l as _sfc_main, n as dirtyIndicators, o as rowEditing, r as editHistory, s as undoRedoButtons, t as batchEditing, u as _sfc_main$1 } from "./editing-BlpYR839.js";
1
+ import { a as editingFamily, c as _sfc_main$2, i as editing, l as _sfc_main, n as dirtyIndicators, o as rowEditing, r as editHistory, s as undoRedoButtons, t as batchEditing, u as _sfc_main$1 } from "./editing-BgWyfVFS.js";
2
2
  export { _sfc_main as ElementBatchEditBar, _sfc_main$1 as ElementEditableCell, _sfc_main$2 as ElementRowEditActions, batchEditing, dirtyIndicators, editHistory, editing, editingFamily, rowEditing, undoRedoButtons };
@@ -1,8 +1,8 @@
1
- import { t as elementButton } from "./button-DwB4UxI2.js";
1
+ import { t as elementButton } from "./button-DUddRulx.js";
2
2
  import { h } from "vue";
3
3
  //#region src/actions/elementActionSlots.ts
4
4
  const elementActionSlots = { Button: ({ attrs, icon, label }) => elementButton(attrs, [icon == null || icon === false ? null : h("span", { "aria-hidden": "true" }, icon), label]) };
5
5
  //#endregion
6
6
  export { elementActionSlots as t };
7
7
 
8
- //# sourceMappingURL=elementActionSlots-CbKE3WnM.js.map
8
+ //# sourceMappingURL=elementActionSlots-BOdXhb05.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"elementActionSlots-CbKE3WnM.js","names":[],"sources":["../src/actions/elementActionSlots.ts"],"sourcesContent":["import type { ActionButtonSlots } from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n\nexport const elementActionSlots: ActionButtonSlots = {\n Button: ({ attrs, icon, label }) =>\n elementButton(attrs, [\n icon == null || icon === false\n ? null\n : h(\"span\", { \"aria-hidden\": \"true\" }, icon),\n label,\n ]),\n};\n"],"mappings":";;;AAKA,MAAa,qBAAwC,EACnD,SAAS,EAAE,OAAO,MAAM,YACtB,cAAc,OAAO,CACnB,QAAQ,QAAQ,SAAS,QACrB,OACA,EAAE,QAAQ,EAAE,eAAe,OAAO,GAAG,IAAI,GAC7C,KACF,CAAC,EACL"}
1
+ {"version":3,"file":"elementActionSlots-BOdXhb05.js","names":[],"sources":["../src/actions/elementActionSlots.ts"],"sourcesContent":["import type { ActionButtonSlots } from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n\nexport const elementActionSlots: ActionButtonSlots = {\n Button: ({ attrs, icon, label }) =>\n elementButton(attrs, [\n icon == null || icon === false\n ? null\n : h(\"span\", { \"aria-hidden\": \"true\" }, icon),\n label,\n ]),\n};\n"],"mappings":";;;AAKA,MAAa,qBAAwC,EACnD,SAAS,EAAE,OAAO,MAAM,YACtB,cAAc,OAAO,CACnB,QAAQ,QAAQ,SAAS,QACrB,OACA,EAAE,QAAQ,EAAE,eAAe,OAAO,GAAG,IAAI,GAC7C,KACF,CAAC,EACL"}
@@ -1,4 +1,4 @@
1
- const require_button = require("./button-BFjBL9m3.cjs");
1
+ const require_button = require("./button-BuXbfKKx.cjs");
2
2
  let vue = require("vue");
3
3
  //#region src/actions/elementActionSlots.ts
4
4
  const elementActionSlots = { Button: ({ attrs, icon, label }) => require_button.elementButton(attrs, [icon == null || icon === false ? null : (0, vue.h)("span", { "aria-hidden": "true" }, icon), label]) };
@@ -10,4 +10,4 @@ Object.defineProperty(exports, "elementActionSlots", {
10
10
  }
11
11
  });
12
12
 
13
- //# sourceMappingURL=elementActionSlots-DlhU82H7.cjs.map
13
+ //# sourceMappingURL=elementActionSlots-WeXIVVnx.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"elementActionSlots-DlhU82H7.cjs","names":["elementButton","h"],"sources":["../src/actions/elementActionSlots.ts"],"sourcesContent":["import type { ActionButtonSlots } from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n\nexport const elementActionSlots: ActionButtonSlots = {\n Button: ({ attrs, icon, label }) =>\n elementButton(attrs, [\n icon == null || icon === false\n ? null\n : h(\"span\", { \"aria-hidden\": \"true\" }, icon),\n label,\n ]),\n};\n"],"mappings":";;;AAKA,MAAa,qBAAwC,EACnD,SAAS,EAAE,OAAO,MAAM,YACtBA,eAAAA,cAAc,OAAO,CACnB,QAAQ,QAAQ,SAAS,QACrB,QAAA,GACAC,IAAAA,EAAAA,CAAE,QAAQ,EAAE,eAAe,OAAO,GAAG,IAAI,GAC7C,KACF,CAAC,EACL"}
1
+ {"version":3,"file":"elementActionSlots-WeXIVVnx.cjs","names":["elementButton","h"],"sources":["../src/actions/elementActionSlots.ts"],"sourcesContent":["import type { ActionButtonSlots } from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n\nexport const elementActionSlots: ActionButtonSlots = {\n Button: ({ attrs, icon, label }) =>\n elementButton(attrs, [\n icon == null || icon === false\n ? null\n : h(\"span\", { \"aria-hidden\": \"true\" }, icon),\n label,\n ]),\n};\n"],"mappings":";;;AAKA,MAAa,qBAAwC,EACnD,SAAS,EAAE,OAAO,MAAM,YACtBA,eAAAA,cAAc,OAAO,CACnB,QAAQ,QAAQ,SAAS,QACrB,QAAA,GACAC,IAAAA,EAAAA,CAAE,QAAQ,EAAE,eAAe,OAAO,GAAG,IAAI,GAC7C,KACF,CAAC,EACL"}
@@ -1,4 +1,4 @@
1
- import { n as isElementRef } from "./button-DwB4UxI2.js";
1
+ import { n as isElementRef } from "./button-DUddRulx.js";
2
2
  import { t as _sfc_main } from "./ElementCheckbox-DobrxadY.js";
3
3
  import { h } from "vue";
4
4
  import { GROUP_ROW as ELEMENT_GROUP_ROW, selectionCheckboxInputAttrs } from "@adapttable/vue/adapter";
@@ -18,4 +18,4 @@ function elementSelectionCheckbox(control) {
18
18
  //#endregion
19
19
  export { elementSelectionCheckbox as n, ELEMENT_GROUP_ROW as t };
20
20
 
21
- //# sourceMappingURL=elementHierarchyControlSlots-21LL1wEw.js.map
21
+ //# sourceMappingURL=elementHierarchyControlSlots-CBz7cgOw.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"elementHierarchyControlSlots-21LL1wEw.js","names":["ElementCheckbox"],"sources":["../src/controls/checkbox.ts"],"sourcesContent":["import {\n type SelectionCheckboxControl,\n selectionCheckboxInputAttrs,\n} from \"@adapttable/vue/adapter\";\nimport { h, type VNode } from \"vue\";\n\nimport ElementCheckbox from \"./ElementCheckbox.vue\";\nimport { isElementRef } from \"./ref\";\n\n/** Parts/classes belong to ElCheckbox's label host; focus belongs to its input. */\nexport function elementSelectionCheckbox(\n control: SelectionCheckboxControl\n): VNode {\n const {\n ref,\n \"aria-label\": label,\n ...attrs\n } = selectionCheckboxInputAttrs(control.attrs);\n return h(ElementCheckbox, {\n ...attrs,\n label: typeof label === \"string\" ? label : \"\",\n checked: control.checked,\n indeterminate: control.indeterminate,\n inputRef: isElementRef(ref) ? ref : undefined,\n onChange: control.onToggle,\n });\n}\n"],"mappings":";;;;;;AAUA,SAAgB,yBACd,SACO;CACP,MAAM,EACJ,KACA,cAAc,OACd,GAAG,UACD,4BAA4B,QAAQ,KAAK;CAC7C,OAAO,EAAEA,WAAiB;EACxB,GAAG;EACH,OAAO,OAAO,UAAU,WAAW,QAAQ;EAC3C,SAAS,QAAQ;EACjB,eAAe,QAAQ;EACvB,UAAU,aAAa,GAAG,IAAI,MAAM,KAAA;EACpC,UAAU,QAAQ;CACpB,CAAC;AACH"}
1
+ {"version":3,"file":"elementHierarchyControlSlots-CBz7cgOw.js","names":["ElementCheckbox"],"sources":["../src/controls/checkbox.ts"],"sourcesContent":["import {\n type SelectionCheckboxControl,\n selectionCheckboxInputAttrs,\n} from \"@adapttable/vue/adapter\";\nimport { h, type VNode } from \"vue\";\n\nimport ElementCheckbox from \"./ElementCheckbox.vue\";\nimport { isElementRef } from \"./ref\";\n\n/** Parts/classes belong to ElCheckbox's label host; focus belongs to its input. */\nexport function elementSelectionCheckbox(\n control: SelectionCheckboxControl\n): VNode {\n const {\n ref,\n \"aria-label\": label,\n ...attrs\n } = selectionCheckboxInputAttrs(control.attrs);\n return h(ElementCheckbox, {\n ...attrs,\n label: typeof label === \"string\" ? label : \"\",\n checked: control.checked,\n indeterminate: control.indeterminate,\n inputRef: isElementRef(ref) ? ref : undefined,\n onChange: control.onToggle,\n });\n}\n"],"mappings":";;;;;;AAUA,SAAgB,yBACd,SACO;CACP,MAAM,EACJ,KACA,cAAc,OACd,GAAG,UACD,4BAA4B,QAAQ,KAAK;CAC7C,OAAO,EAAEA,WAAiB;EACxB,GAAG;EACH,OAAO,OAAO,UAAU,WAAW,QAAQ;EAC3C,SAAS,QAAQ;EACjB,eAAe,QAAQ;EACvB,UAAU,aAAa,GAAG,IAAI,MAAM,KAAA;EACpC,UAAU,QAAQ;CACpB,CAAC;AACH"}
@@ -1,6 +1,6 @@
1
- const require_button = require("./button-BFjBL9m3.cjs");
1
+ const require_button = require("./button-BuXbfKKx.cjs");
2
2
  const require_ElementInput = require("./ElementInput-BF97xXSC.cjs");
3
- const require_ElementCard = require("./ElementCard-BRZekaHr.cjs");
3
+ const require_ElementCard = require("./ElementCard-DQpWVv24.cjs");
4
4
  let vue = require("vue");
5
5
  let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
6
6
  let element_plus = require("element-plus");
@@ -263,4 +263,4 @@ Object.defineProperty(exports, "elementSidePanelSlots", {
263
263
  }
264
264
  });
265
265
 
266
- //# sourceMappingURL=elementRemainingControls-DvVVLXE0.cjs.map
266
+ //# sourceMappingURL=elementRemainingControls-CvGiKtfz.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"elementRemainingControls-DvVVLXE0.cjs","names":["defineComponent","useScopeActivity","shallowRef","h","ElDialog","defineComponent","useScopeActivity","shallowRef","h","ElDropdown","ElDropdownMenu","elementButton","managedCommandPaletteSurface","h","ElementInput","toVueAttrs","ElDropdownItem","ElDivider","ElementCard"],"sources":["../src/actions/ElementCommandSurface.ts","../src/actions/ElementContextSurface.ts","../src/actions/elementRemainingControls.ts"],"sourcesContent":["import {\n type ManagedCommandPaletteSurfaceProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { ElDialog } from \"element-plus\";\nimport { defineComponent, h, type PropType, shallowRef } from \"vue\";\n/** ElDialog owns focus trapping, Escape and outside dismissal. */\nexport const ElementCommandSurface = defineComponent(\n (props: {\n readonly control: ManagedCommandPaletteSurfaceProps;\n readonly container?: HTMLElement;\n readonly dir?: \"ltr\" | \"rtl\";\n }) => {\n const active = useScopeActivity();\n const body = shallowRef<HTMLElement | null>(null);\n return () => {\n const owner = props.control;\n return h(\n ElDialog,\n {\n modelValue: active.value && owner.open && owner.isCurrent(),\n title: owner.label,\n class: owner.className,\n dir: props.dir,\n appendTo: props.container ?? \"body\",\n appendToBody: true,\n width: \"min(32rem, calc(100vw - 2rem))\",\n destroyOnClose: true,\n showClose: false,\n closeOnClickModal: true,\n closeOnPressEscape: true,\n beforeClose: () => {\n if (active.value && owner.isCurrent()) owner.onClose();\n },\n },\n {\n default: () =>\n h(\"div\", { ref: body, \"data-adapttable-part\": \"command-palette\" }, [\n owner.children,\n ]),\n }\n );\n };\n },\n {\n name: \"ElementCommandSurface\",\n props: {\n control: { type: Object as PropType<ManagedCommandPaletteSurfaceProps> },\n container: { type: Object as PropType<HTMLElement | undefined> },\n dir: { type: String as PropType<(\"ltr\" | \"rtl\") | undefined> },\n },\n }\n);\n","import {\n type ContextMenuSurfaceProps,\n scheduleTick,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type DropdownInstance,\n ElDropdown,\n ElDropdownMenu,\n} from \"element-plus\";\nimport {\n defineComponent,\n h,\n onScopeDispose,\n type PropType,\n shallowRef,\n type VNodeChild,\n watch,\n} from \"vue\";\n\n/** The public dropdown API synchronizes the primitive with the binding's open session. */\nexport const ElementContextSurface = defineComponent(\n (\n props: ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n }\n ) => {\n const active = useScopeActivity();\n const control = shallowRef<DropdownInstance>();\n let live = true;\n let generation = 0;\n onScopeDispose(() => {\n live = false;\n generation++;\n });\n const virtualAnchor = {\n getBoundingClientRect: () => new DOMRect(props.at.x, props.at.y, 0, 0),\n get contextElement() {\n return props.anchorRef.current ?? undefined;\n },\n };\n watch(\n [active, () => props.at],\n () => {\n generation++;\n },\n { flush: \"sync\", immediate: true }\n );\n watch(\n [active, control, () => props.at],\n () => {\n const ticket = generation;\n scheduleTick(() => {\n if (live && active.value && ticket === generation)\n control.value?.handleOpen();\n else if (!active.value) control.value?.handleClose();\n });\n },\n { flush: \"post\", immediate: true }\n );\n return () => {\n if (!active.value) return null;\n const at = props.at;\n const ticket = generation;\n const onClose = props.onClose;\n const isCurrent = () =>\n live &&\n active.value &&\n ticket === generation &&\n props.at === at &&\n props.onClose === onClose;\n return h(\n ElDropdown,\n {\n ref: control,\n virtualTriggering: true,\n virtualRef: virtualAnchor,\n trigger: \"contextmenu\",\n role: \"menu\",\n showTimeout: 0,\n hideTimeout: 0,\n hideOnClick: false,\n placement: \"bottom-start\",\n appendTo: props.container ?? \"body\",\n teleported: true,\n persistent: false,\n showArrow: false,\n maxHeight: \"min(70vh, 32rem)\",\n popperStyle: { maxWidth: \"calc(100vw - 1rem)\" },\n onVisibleChange: (visible: boolean) => {\n if (visible || !isCurrent()) return;\n onClose();\n // A rejected controlled close keeps the same native session open.\n scheduleTick(() => {\n if (isCurrent()) control.value?.handleOpen();\n });\n },\n },\n {\n dropdown: () =>\n h(\n ElDropdownMenu,\n {\n \"aria-label\": props.label,\n class: props.className,\n dir: props.dir,\n \"data-adapttable-part\": \"context-menu\",\n onKeydown: (event: KeyboardEvent) => {\n if (\n !isCurrent() ||\n event.key !== \"Escape\" ||\n event.defaultPrevented ||\n event.isComposing ||\n !(event.target instanceof Element) ||\n event.target.closest('[role=\"menu\"]') !==\n event.currentTarget\n )\n return;\n event.preventDefault();\n event.stopPropagation();\n control.value?.handleClose();\n },\n onFocus: (event: FocusEvent) => {\n if (\n !isCurrent() ||\n event.target !== event.currentTarget ||\n !(event.currentTarget instanceof HTMLElement)\n )\n return;\n event.currentTarget\n .querySelector<HTMLElement>(\n '[role=\"menuitem\"]:not([aria-disabled=\"true\"])'\n )\n ?.focus();\n },\n },\n { default: () => props.children }\n ),\n }\n );\n };\n },\n {\n name: \"ElementContextSurface\",\n props: {\n at: {\n type: Object as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"at\"]\n >,\n },\n anchorRef: {\n type: Object as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"anchorRef\"]\n >,\n },\n label: {\n type: String as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"label\"]\n >,\n },\n onClose: {\n type: Function as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"onClose\"]\n >,\n },\n container: {\n type: Object as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"container\"]\n >,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"children\"]\n >,\n default: undefined,\n },\n className: {\n type: String as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"className\"]\n >,\n },\n dir: {\n type: String as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"dir\"]\n >,\n },\n },\n }\n);\n","import {\n type ActionButton,\n type CommandPaletteSlots,\n type ContextMenuSlots,\n managedCommandPaletteSurface,\n type SidePanelSlots,\n toVueAttrs,\n} from \"@adapttable/vue/adapter\";\nimport { ElDivider, ElDropdownItem } from \"element-plus\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport { ElementCommandSurface } from \"./ElementCommandSurface\";\nimport { ElementContextSurface } from \"./ElementContextSurface\";\nexport const elementActionButton = ({ attrs, label, icon }: ActionButton) =>\n elementButton(attrs, [icon, label]);\nexport const elementPaletteSlots = (\n names: () => Readonly<Record<string, string | undefined>> = () => ({}),\n container: () => HTMLElement | undefined = () => undefined,\n dir: () => \"ltr\" | \"rtl\" | undefined = () => undefined\n): CommandPaletteSlots => ({\n Surface: managedCommandPaletteSurface((control) =>\n h(ElementCommandSurface, { control, container: container(), dir: dir() })\n ),\n Input: ({ inputProps }) => {\n const { onChange, ref, value, ...attrs } = inputProps;\n return h(ElementInput, {\n ...toVueAttrs(attrs),\n value,\n inputRef: (element) => {\n if (element instanceof HTMLInputElement || element === null)\n ref(element);\n },\n class: names().commandInput,\n onChange,\n });\n },\n Item: ({ command, itemProps }) =>\n elementButton(\n {\n ...toVueAttrs(itemProps),\n class: names().commandItem,\n type: \"button\",\n tabindex: -1,\n disabled: command.disabled,\n },\n command.label\n ),\n Empty: ({ message }) =>\n h(\n \"p\",\n { \"data-adapttable-part\": \"command-empty\", class: names().commandEmpty },\n message\n ),\n});\nexport const elementContextMenuSlots = (\n names: () => Readonly<Record<string, string | undefined>> = () => ({}),\n dir: () => \"ltr\" | \"rtl\" | undefined = () => undefined\n): ContextMenuSlots => ({\n Surface: (props) => h(ElementContextSurface, { ...props, dir: dir() }),\n Item: ({ item, onSelect }) =>\n h(\n ElDropdownItem,\n {\n disabled: item.disabled,\n textValue: item.label,\n \"aria-disabled\": item.disabled,\n \"data-danger\": item.danger ? \"\" : undefined,\n \"data-adapttable-part\": \"context-menu-item\",\n class: names().contextMenuItem,\n onClick: onSelect,\n },\n { default: () => item.label }\n ),\n Separator: () =>\n h(ElDivider, {\n role: \"separator\",\n \"data-adapttable-part\": \"context-menu-separator\",\n class: names().contextMenuSeparator,\n }),\n});\nexport const elementSidePanelSlots = (\n names: () => Readonly<Record<string, string | undefined>> = () => ({})\n): SidePanelSlots => {\n let closeChoice: (() => void) | undefined;\n return {\n Frame: (props) => {\n const close = closeChoice;\n return h(\n ElementCard,\n {\n attrs: {\n \"data-adapttable-part\": \"side-panel\",\n class: props.className,\n \"data-side\": props.side,\n style: { minWidth: \"min(18rem,100%)\", maxWidth: \"100%\" },\n onKeydownCapture: (event: KeyboardEvent) => {\n const target = event.target;\n // ElSelect stops Escape even while closed; forward that case to the\n // binding's current close callback before the native event is consumed.\n if (\n event.key === \"Escape\" &&\n !event.defaultPrevented &&\n !event.isComposing &&\n target instanceof Element &&\n target.getAttribute(\"role\") === \"combobox\" &&\n target.getAttribute(\"aria-expanded\") === \"false\" &&\n !target.closest('[role=\"dialog\"],[role=\"menu\"]')\n ) {\n event.preventDefault();\n event.stopPropagation();\n close?.();\n }\n },\n },\n },\n { default: () => props.children }\n );\n },\n Tab: (props) =>\n elementButton(\n { ...toVueAttrs(props.buttonProps), class: names().sidePanelTab },\n props.panel.label\n ),\n Close: (props) => {\n closeChoice = props.onClose;\n return elementButton(\n {\n type: \"button\",\n \"aria-label\": props.label,\n \"data-adapttable-part\": \"side-panel-close\",\n class: names().sidePanelClose,\n onClick: props.onClose,\n },\n props.label\n );\n },\n };\n};\n"],"mappings":";;;;;;;;AAOA,MAAa,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AAM,eACP,kBAAkB,WAClB,OAAO,aAAa,MAAM,MAAM,cAChC,OAAO,aAAa,eAAe,MAAM,WACzC,CAAC,OAAO,QAAQ,mCAA+B,GAC/C;MACA,MAAM,eAAe;MACrB,MAAM,gBAAgB;MACtB,QAAQ;KACV;IACF;GACF,EACF,GACA,EAAE,eAAe,MAAM,SAAS,CAClC;EACF;EACA,MAAM,UACJP,eAAAA,cACE;GAAE,IAAA,GAAGI,wBAAAA,WAAAA,CAAW,MAAM,WAAW;GAAG,OAAO,MAAM,CAAC,CAAC;EAAa,GAChE,MAAM,MAAM,KACd;EACF,QAAQ,UAAU;GAChB,cAAc,MAAM;GACpB,OAAOJ,eAAAA,cACL;IACE,MAAM;IACN,cAAc,MAAM;IACpB,wBAAwB;IACxB,OAAO,MAAM,CAAC,CAAC;IACf,SAAS,MAAM;GACjB,GACA,MAAM,KACR;EACF;CACF;AACF"}
1
+ {"version":3,"file":"elementRemainingControls-CvGiKtfz.cjs","names":["defineComponent","useScopeActivity","shallowRef","h","ElDialog","defineComponent","useScopeActivity","shallowRef","h","ElDropdown","ElDropdownMenu","elementButton","managedCommandPaletteSurface","h","ElementInput","toVueAttrs","ElDropdownItem","ElDivider","ElementCard"],"sources":["../src/actions/ElementCommandSurface.ts","../src/actions/ElementContextSurface.ts","../src/actions/elementRemainingControls.ts"],"sourcesContent":["import {\n type ManagedCommandPaletteSurfaceProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { ElDialog } from \"element-plus\";\nimport { defineComponent, h, type PropType, shallowRef } from \"vue\";\n/** ElDialog owns focus trapping, Escape and outside dismissal. */\nexport const ElementCommandSurface = defineComponent(\n (props: {\n readonly control: ManagedCommandPaletteSurfaceProps;\n readonly container?: HTMLElement;\n readonly dir?: \"ltr\" | \"rtl\";\n }) => {\n const active = useScopeActivity();\n const body = shallowRef<HTMLElement | null>(null);\n return () => {\n const owner = props.control;\n return h(\n ElDialog,\n {\n modelValue: active.value && owner.open && owner.isCurrent(),\n title: owner.label,\n class: owner.className,\n dir: props.dir,\n appendTo: props.container ?? \"body\",\n appendToBody: true,\n width: \"min(32rem, calc(100vw - 2rem))\",\n destroyOnClose: true,\n showClose: false,\n closeOnClickModal: true,\n closeOnPressEscape: true,\n beforeClose: () => {\n if (active.value && owner.isCurrent()) owner.onClose();\n },\n },\n {\n default: () =>\n h(\"div\", { ref: body, \"data-adapttable-part\": \"command-palette\" }, [\n owner.children,\n ]),\n }\n );\n };\n },\n {\n name: \"ElementCommandSurface\",\n props: {\n control: { type: Object as PropType<ManagedCommandPaletteSurfaceProps> },\n container: { type: Object as PropType<HTMLElement | undefined> },\n dir: { type: String as PropType<(\"ltr\" | \"rtl\") | undefined> },\n },\n }\n);\n","import {\n type ContextMenuSurfaceProps,\n scheduleTick,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type DropdownInstance,\n ElDropdown,\n ElDropdownMenu,\n} from \"element-plus\";\nimport {\n defineComponent,\n h,\n onScopeDispose,\n type PropType,\n shallowRef,\n type VNodeChild,\n watch,\n} from \"vue\";\n\n/** The public dropdown API synchronizes the primitive with the binding's open session. */\nexport const ElementContextSurface = defineComponent(\n (\n props: ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n }\n ) => {\n const active = useScopeActivity();\n const control = shallowRef<DropdownInstance>();\n let live = true;\n let generation = 0;\n onScopeDispose(() => {\n live = false;\n generation++;\n });\n const virtualAnchor = {\n getBoundingClientRect: () => new DOMRect(props.at.x, props.at.y, 0, 0),\n get contextElement() {\n return props.anchorRef.current ?? undefined;\n },\n };\n watch(\n [active, () => props.at],\n () => {\n generation++;\n },\n { flush: \"sync\", immediate: true }\n );\n watch(\n [active, control, () => props.at],\n () => {\n const ticket = generation;\n scheduleTick(() => {\n if (live && active.value && ticket === generation)\n control.value?.handleOpen();\n else if (!active.value) control.value?.handleClose();\n });\n },\n { flush: \"post\", immediate: true }\n );\n return () => {\n if (!active.value) return null;\n const at = props.at;\n const ticket = generation;\n const onClose = props.onClose;\n const isCurrent = () =>\n live &&\n active.value &&\n ticket === generation &&\n props.at === at &&\n props.onClose === onClose;\n return h(\n ElDropdown,\n {\n ref: control,\n virtualTriggering: true,\n virtualRef: virtualAnchor,\n trigger: \"contextmenu\",\n role: \"menu\",\n showTimeout: 0,\n hideTimeout: 0,\n hideOnClick: false,\n placement: \"bottom-start\",\n appendTo: props.container ?? \"body\",\n teleported: true,\n persistent: false,\n showArrow: false,\n maxHeight: \"min(70vh, 32rem)\",\n popperStyle: { maxWidth: \"calc(100vw - 1rem)\" },\n onVisibleChange: (visible: boolean) => {\n if (visible || !isCurrent()) return;\n onClose();\n // A rejected controlled close keeps the same native session open.\n scheduleTick(() => {\n if (isCurrent()) control.value?.handleOpen();\n });\n },\n },\n {\n dropdown: () =>\n h(\n ElDropdownMenu,\n {\n \"aria-label\": props.label,\n class: props.className,\n dir: props.dir,\n \"data-adapttable-part\": \"context-menu\",\n onKeydown: (event: KeyboardEvent) => {\n if (\n !isCurrent() ||\n event.key !== \"Escape\" ||\n event.defaultPrevented ||\n event.isComposing ||\n !(event.target instanceof Element) ||\n event.target.closest('[role=\"menu\"]') !==\n event.currentTarget\n )\n return;\n event.preventDefault();\n event.stopPropagation();\n control.value?.handleClose();\n },\n onFocus: (event: FocusEvent) => {\n if (\n !isCurrent() ||\n event.target !== event.currentTarget ||\n !(event.currentTarget instanceof HTMLElement)\n )\n return;\n event.currentTarget\n .querySelector<HTMLElement>(\n '[role=\"menuitem\"]:not([aria-disabled=\"true\"])'\n )\n ?.focus();\n },\n },\n { default: () => props.children }\n ),\n }\n );\n };\n },\n {\n name: \"ElementContextSurface\",\n props: {\n at: {\n type: Object as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"at\"]\n >,\n },\n anchorRef: {\n type: Object as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"anchorRef\"]\n >,\n },\n label: {\n type: String as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"label\"]\n >,\n },\n onClose: {\n type: Function as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"onClose\"]\n >,\n },\n container: {\n type: Object as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"container\"]\n >,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"children\"]\n >,\n default: undefined,\n },\n className: {\n type: String as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"className\"]\n >,\n },\n dir: {\n type: String as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"dir\"]\n >,\n },\n },\n }\n);\n","import {\n type ActionButton,\n type CommandPaletteSlots,\n type ContextMenuSlots,\n managedCommandPaletteSurface,\n type SidePanelSlots,\n toVueAttrs,\n} from \"@adapttable/vue/adapter\";\nimport { ElDivider, ElDropdownItem } from \"element-plus\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport { ElementCommandSurface } from \"./ElementCommandSurface\";\nimport { ElementContextSurface } from \"./ElementContextSurface\";\nexport const elementActionButton = ({ attrs, label, icon }: ActionButton) =>\n elementButton(attrs, [icon, label]);\nexport const elementPaletteSlots = (\n names: () => Readonly<Record<string, string | undefined>> = () => ({}),\n container: () => HTMLElement | undefined = () => undefined,\n dir: () => \"ltr\" | \"rtl\" | undefined = () => undefined\n): CommandPaletteSlots => ({\n Surface: managedCommandPaletteSurface((control) =>\n h(ElementCommandSurface, { control, container: container(), dir: dir() })\n ),\n Input: ({ inputProps }) => {\n const { onChange, ref, value, ...attrs } = inputProps;\n return h(ElementInput, {\n ...toVueAttrs(attrs),\n value,\n inputRef: (element) => {\n if (element instanceof HTMLInputElement || element === null)\n ref(element);\n },\n class: names().commandInput,\n onChange,\n });\n },\n Item: ({ command, itemProps }) =>\n elementButton(\n {\n ...toVueAttrs(itemProps),\n class: names().commandItem,\n type: \"button\",\n tabindex: -1,\n disabled: command.disabled,\n },\n command.label\n ),\n Empty: ({ message }) =>\n h(\n \"p\",\n { \"data-adapttable-part\": \"command-empty\", class: names().commandEmpty },\n message\n ),\n});\nexport const elementContextMenuSlots = (\n names: () => Readonly<Record<string, string | undefined>> = () => ({}),\n dir: () => \"ltr\" | \"rtl\" | undefined = () => undefined\n): ContextMenuSlots => ({\n Surface: (props) => h(ElementContextSurface, { ...props, dir: dir() }),\n Item: ({ item, onSelect }) =>\n h(\n ElDropdownItem,\n {\n disabled: item.disabled,\n textValue: item.label,\n \"aria-disabled\": item.disabled,\n \"data-danger\": item.danger ? \"\" : undefined,\n \"data-adapttable-part\": \"context-menu-item\",\n class: names().contextMenuItem,\n onClick: onSelect,\n },\n { default: () => item.label }\n ),\n Separator: () =>\n h(ElDivider, {\n role: \"separator\",\n \"data-adapttable-part\": \"context-menu-separator\",\n class: names().contextMenuSeparator,\n }),\n});\nexport const elementSidePanelSlots = (\n names: () => Readonly<Record<string, string | undefined>> = () => ({})\n): SidePanelSlots => {\n let closeChoice: (() => void) | undefined;\n return {\n Frame: (props) => {\n const close = closeChoice;\n return h(\n ElementCard,\n {\n attrs: {\n \"data-adapttable-part\": \"side-panel\",\n class: props.className,\n \"data-side\": props.side,\n style: { minWidth: \"min(18rem,100%)\", maxWidth: \"100%\" },\n onKeydownCapture: (event: KeyboardEvent) => {\n const target = event.target;\n // ElSelect stops Escape even while closed; forward that case to the\n // binding's current close callback before the native event is consumed.\n if (\n event.key === \"Escape\" &&\n !event.defaultPrevented &&\n !event.isComposing &&\n target instanceof Element &&\n target.getAttribute(\"role\") === \"combobox\" &&\n target.getAttribute(\"aria-expanded\") === \"false\" &&\n !target.closest('[role=\"dialog\"],[role=\"menu\"]')\n ) {\n event.preventDefault();\n event.stopPropagation();\n close?.();\n }\n },\n },\n },\n { default: () => props.children }\n );\n },\n Tab: (props) =>\n elementButton(\n { ...toVueAttrs(props.buttonProps), class: names().sidePanelTab },\n props.panel.label\n ),\n Close: (props) => {\n closeChoice = props.onClose;\n return elementButton(\n {\n type: \"button\",\n \"aria-label\": props.label,\n \"data-adapttable-part\": \"side-panel-close\",\n class: names().sidePanelClose,\n onClick: props.onClose,\n },\n props.label\n );\n },\n };\n};\n"],"mappings":";;;;;;;;AAOA,MAAa,yBAAA,GAAwBA,IAAAA,gBAAAA,EAClC,UAIK;CACJ,MAAM,UAAA,GAASC,wBAAAA,iBAAAA,CAAiB;CAChC,MAAM,QAAA,GAAOC,IAAAA,WAAAA,CAA+B,IAAI;CAChD,aAAa;EACX,MAAM,QAAQ,MAAM;EACpB,QAAA,GAAOC,IAAAA,EAAAA,CACLC,aAAAA,UACA;GACE,YAAY,OAAO,SAAS,MAAM,QAAQ,MAAM,UAAU;GAC1D,OAAO,MAAM;GACb,OAAO,MAAM;GACb,KAAK,MAAM;GACX,UAAU,MAAM,aAAa;GAC7B,cAAc;GACd,OAAO;GACP,gBAAgB;GAChB,WAAW;GACX,mBAAmB;GACnB,oBAAoB;GACpB,mBAAmB;IACjB,IAAI,OAAO,SAAS,MAAM,UAAU,GAAG,MAAM,QAAQ;GACvD;EACF,GACA,EACE,gBAAA,GACED,IAAAA,EAAAA,CAAE,OAAO;GAAE,KAAK;GAAM,wBAAwB;EAAkB,GAAG,CACjE,MAAM,QACR,CAAC,EACL,CACF;CACF;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,SAAS,EAAE,MAAM,OAAsD;EACvE,WAAW,EAAE,MAAM,OAA4C;EAC/D,KAAK,EAAE,MAAM,OAAgD;CAC/D;AACF,CAC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EAAAA,CAAEI,aAAAA,WAAW;EACX,MAAM;EACN,wBAAwB;EACxB,OAAO,MAAM,CAAC,CAAC;CACjB,CAAC;AACL;AACA,MAAa,yBACX,eAAmE,CAAC,OACjD;CACnB,IAAI;CACJ,OAAO;EACL,QAAQ,UAAU;GAChB,MAAM,QAAQ;GACd,QAAA,GAAOJ,IAAAA,EAAAA,CACLK,oBAAAA,aACA,EACE,OAAO;IACL,wBAAwB;IACxB,OAAO,MAAM;IACb,aAAa,MAAM;IACnB,OAAO;KAAE,UAAU;KAAmB,UAAU;IAAO;IACvD,mBAAmB,UAAyB;KAC1C,MAAM,SAAS,MAAM;KAGrB,IACE,MAAM,QAAQ,YACd,CAAC,MAAM,oBACP,CAAC,MAAM,eACP,kBAAkB,WAClB,OAAO,aAAa,MAAM,MAAM,cAChC,OAAO,aAAa,eAAe,MAAM,WACzC,CAAC,OAAO,QAAQ,mCAA+B,GAC/C;MACA,MAAM,eAAe;MACrB,MAAM,gBAAgB;MACtB,QAAQ;KACV;IACF;GACF,EACF,GACA,EAAE,eAAe,MAAM,SAAS,CAClC;EACF;EACA,MAAM,UACJP,eAAAA,cACE;GAAE,IAAA,GAAGI,wBAAAA,WAAAA,CAAW,MAAM,WAAW;GAAG,OAAO,MAAM,CAAC,CAAC;EAAa,GAChE,MAAM,MAAM,KACd;EACF,QAAQ,UAAU;GAChB,cAAc,MAAM;GACpB,OAAOJ,eAAAA,cACL;IACE,MAAM;IACN,cAAc,MAAM;IACpB,wBAAwB;IACxB,OAAO,MAAM,CAAC,CAAC;IACf,SAAS,MAAM;GACjB,GACA,MAAM,KACR;EACF;CACF;AACF"}
@@ -1,6 +1,6 @@
1
- import { t as elementButton } from "./button-DwB4UxI2.js";
1
+ import { t as elementButton } from "./button-DUddRulx.js";
2
2
  import { t as _sfc_main } from "./ElementInput-Cn9hpa9j.js";
3
- import { t as ElementCard } from "./ElementCard-DZdAU6x8.js";
3
+ import { t as ElementCard } from "./ElementCard-czqeWAnk.js";
4
4
  import { defineComponent, h, onScopeDispose, shallowRef, watch } from "vue";
5
5
  import { managedCommandPaletteSurface, scheduleTick, toVueAttrs, useScopeActivity } from "@adapttable/vue/adapter";
6
6
  import { ElDialog, ElDivider, ElDropdown, ElDropdownItem, ElDropdownMenu } from "element-plus";
@@ -240,4 +240,4 @@ const elementSidePanelSlots = (names = () => ({})) => {
240
240
  //#endregion
241
241
  export { elementSidePanelSlots as i, elementContextMenuSlots as n, elementPaletteSlots as r, elementActionButton as t };
242
242
 
243
- //# sourceMappingURL=elementRemainingControls-6tN9tgWx.js.map
243
+ //# sourceMappingURL=elementRemainingControls-J7eDWROX.js.map