@adapttable/element-plus 0.1.1 → 0.1.3

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 (38) hide show
  1. package/dist/assistant.cjs +11 -3
  2. package/dist/assistant.cjs.map +1 -1
  3. package/dist/assistant.d.cts.map +1 -1
  4. package/dist/assistant.d.ts.map +1 -1
  5. package/dist/assistant.js +11 -3
  6. package/dist/assistant.js.map +1 -1
  7. package/dist/batch-editing.cjs +1 -1
  8. package/dist/batch-editing.js +1 -1
  9. package/dist/{editing-BX-jUtdO.cjs → editing-BMtWRqqJ.cjs} +8 -3
  10. package/dist/editing-BMtWRqqJ.cjs.map +1 -0
  11. package/dist/editing-BnLdNDlo.d.ts.map +1 -1
  12. package/dist/editing-Cg6ZNvSa.d.cts.map +1 -1
  13. package/dist/{editing-C1Hy-MCQ.js → editing-CohAxA65.js} +8 -3
  14. package/dist/editing-CohAxA65.js.map +1 -0
  15. package/dist/editing.cjs +1 -1
  16. package/dist/editing.js +1 -1
  17. package/dist/{filters-DOlxNQqE.cjs → filters-2G3MfNF7.cjs} +11 -3
  18. package/dist/filters-2G3MfNF7.cjs.map +1 -0
  19. package/dist/{filters-C9_trRXw.js → filters-DD-qeRIb.js} +11 -3
  20. package/dist/filters-DD-qeRIb.js.map +1 -0
  21. package/dist/filters.cjs +1 -1
  22. package/dist/filters.js +1 -1
  23. package/dist/grouping-panel.cjs +9 -7
  24. package/dist/grouping-panel.cjs.map +1 -1
  25. package/dist/grouping-panel.js +9 -7
  26. package/dist/grouping-panel.js.map +1 -1
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts.map +1 -1
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/preset.cjs +1 -1
  32. package/dist/preset.js +1 -1
  33. package/dist/styles.css +258 -1
  34. package/package.json +3 -3
  35. package/dist/editing-BX-jUtdO.cjs.map +0 -1
  36. package/dist/editing-C1Hy-MCQ.js.map +0 -1
  37. package/dist/filters-C9_trRXw.js.map +0 -1
  38. package/dist/filters-DOlxNQqE.cjs.map +0 -1
@@ -20,6 +20,7 @@ const ElementExamplesMenu = (0, vue.defineComponent)((props) => {
20
20
  const active = (0, _adapttable_vue_adapter.useScopeActivity)();
21
21
  const dropdown = (0, vue.shallowRef)();
22
22
  const trigger = (0, vue.shallowRef)(null);
23
+ const open = (0, vue.shallowRef)(false);
23
24
  let generation = 0;
24
25
  (0, vue.watch)([
25
26
  active,
@@ -48,6 +49,9 @@ const ElementExamplesMenu = (0, vue.defineComponent)((props) => {
48
49
  hideTimeout: 0,
49
50
  disabled: props.disabled,
50
51
  maxHeight: props.maxHeight,
52
+ onVisibleChange: (value) => {
53
+ open.value = value;
54
+ },
51
55
  onCommand: (id) => {
52
56
  if (current() && typeof id === "string" && props.items.some((item) => item.id === id)) props.onSelect(id);
53
57
  }
@@ -61,8 +65,11 @@ const ElementExamplesMenu = (0, vue.defineComponent)((props) => {
61
65
  "aria-label": props.label,
62
66
  title: props.label,
63
67
  class: props.className,
64
- "data-adapttable-part": props.part
65
- }, [props.icon, props.label]),
68
+ "data-adapttable-part": props.part,
69
+ onKeydown: (event) => {
70
+ if (open.value) keydown(event);
71
+ }
72
+ }, [props.icon ?? props.label]),
66
73
  dropdown: () => (0, vue.h)(element_plus.ElDropdownMenu, {
67
74
  "aria-label": props.label,
68
75
  onKeydownCapture: keydown
@@ -181,7 +188,7 @@ const elementAssistantControls = {
181
188
  }, [props.icon, props.iconOnly && props.icon ? null : props.children ?? props.label]),
182
189
  Composer: (props) => (0, vue.h)(require_ElementInput._sfc_main, {
183
190
  type: "textarea",
184
- rows: 2,
191
+ rows: 1,
185
192
  value: props.value,
186
193
  disabled: props.disabled,
187
194
  "data-adapttable-part": props.part,
@@ -241,6 +248,7 @@ const elementApprovalControls = {
241
248
  //#region src/assistant.ts
242
249
  const TableAssistant = (0, vue.defineComponent)((props) => () => (0, vue.h)(_adapttable_vue_adapter.TableAssistantChrome, {
243
250
  ...props,
251
+ accent: props.accent ?? "var(--el-color-primary)",
244
252
  slots: elementAssistantControls
245
253
  }), {
246
254
  name: "ElementTableAssistant",
@@ -1 +1 @@
1
- {"version":3,"file":"assistant.cjs","names":["h","ElDropdownItem","defineComponent","useScopeActivity","shallowRef","ElDropdown","elementButton","ElDropdownMenu","defineComponent","useScopeActivity","h","ElDrawer","elementButton","h","ElementInput","ElTag","ElementCard","ElementSelect","defineComponent","h","TableAssistantChrome","AgentApprovalChrome","createAdapterTableAssistantFeature","createAdapterAgentApprovalFeature"],"sources":["../src/assistant/ExamplesMenu.ts","../src/assistant/Sheet.ts","../src/assistant/controls.ts","../src/assistant.ts"],"sourcesContent":["import {\n type TableAssistantMenuProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type DropdownInstance,\n ElDropdown,\n ElDropdownItem,\n ElDropdownMenu,\n} from \"element-plus\";\nimport { defineComponent, h, type PropType, shallowRef, watch } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n\n/** One shortcut: its icon, title and optional description. */\nfunction menuItem(item: TableAssistantMenuProps[\"items\"][number]) {\n return h(\n ElDropdownItem,\n { key: item.id, command: item.id, \"data-adapttable-part\": item.part },\n {\n default: () => [\n item.icon,\n h(\"span\", [\n h(\"strong\", item.title),\n item.description ? h(\"small\", item.description) : null,\n ]),\n ],\n }\n );\n}\n\n/** The assistant's shortcuts in an Element Plus dropdown under its trigger. */\nexport const ElementExamplesMenu = defineComponent(\n (props: TableAssistantMenuProps) => {\n const active = useScopeActivity();\n const dropdown = shallowRef<DropdownInstance>();\n const trigger = shallowRef<HTMLElement | null>(null);\n let generation = 0;\n watch(\n [active, () => props.disabled, () => props.items, () => props.onSelect],\n () => {\n generation++;\n dropdown.value?.handleClose();\n },\n { flush: \"sync\" }\n );\n // The menu closes itself on Escape and hands focus back to its trigger,\n // so an Escape inside it never reaches the surface around the trigger.\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.isComposing) return;\n event.preventDefault();\n event.stopPropagation();\n dropdown.value?.handleClose();\n trigger.value?.focus({ preventScroll: true });\n };\n return () => {\n if (!active.value) return null;\n const ticket = generation;\n const current = () =>\n active.value && !props.disabled && ticket === generation;\n return h(\n ElDropdown,\n {\n ref: dropdown,\n trigger: \"click\",\n persistent: false,\n hideTimeout: 0,\n disabled: props.disabled,\n maxHeight: props.maxHeight,\n onCommand: (id: unknown) => {\n if (\n current() &&\n typeof id === \"string\" &&\n props.items.some((item) => item.id === id)\n )\n props.onSelect(id);\n },\n },\n {\n default: () =>\n elementButton(\n {\n ref: (element: HTMLElement | null) => {\n trigger.value = element;\n },\n type: \"button\",\n disabled: props.disabled,\n \"aria-label\": props.label,\n title: props.label,\n class: props.className,\n \"data-adapttable-part\": props.part,\n },\n [props.icon, props.label]\n ),\n dropdown: () =>\n h(\n ElDropdownMenu,\n // Captured on the list so an Escape from any item reaches it\n // before Element's own handling moves focus into the list.\n { \"aria-label\": props.label, onKeydownCapture: keydown },\n { default: () => props.items.map(menuItem) }\n ),\n }\n );\n };\n },\n {\n name: \"ElementExamplesMenu\",\n props: {\n label: { type: String as PropType<TableAssistantMenuProps[\"label\"]> },\n part: { type: String as PropType<TableAssistantMenuProps[\"part\"]> },\n className: {\n type: String as PropType<TableAssistantMenuProps[\"className\"]>,\n },\n icon: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n TableAssistantMenuProps[\"icon\"]\n >,\n default: undefined,\n },\n disabled: {\n type: Boolean as PropType<TableAssistantMenuProps[\"disabled\"]>,\n default: undefined,\n },\n items: { type: Array as PropType<TableAssistantMenuProps[\"items\"]> },\n onSelect: {\n type: Function as PropType<TableAssistantMenuProps[\"onSelect\"]>,\n },\n maxHeight: {\n type: String as PropType<TableAssistantMenuProps[\"maxHeight\"]>,\n },\n },\n }\n);\n","import {\n type TableAssistantSheetProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { ElDrawer } from \"element-plus\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\n/**\n * Chrome chooses initial and return focus; ElDrawer contains focus and owns\n * the portal. Escape and backdrop dismissal become one close request to the\n * host, and the drawer stays open until the host closes it.\n */\nexport const ElementAssistantSheet = defineComponent(\n (props: TableAssistantSheetProps) => {\n const active = useScopeActivity();\n const requestClose = () => {\n if (active.value && props.open) props.onClose();\n };\n const preventDefault = (event: Event) => event.preventDefault();\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.defaultPrevented || event.isComposing)\n return;\n event.preventDefault();\n event.stopPropagation();\n requestClose();\n };\n return () => {\n if (!active.value) return null;\n return h(\n ElDrawer,\n {\n modelValue: props.open,\n direction: props.dir === \"rtl\" ? \"ltr\" : \"rtl\",\n size: \"min(28rem, 100vw)\",\n withHeader: false,\n showClose: false,\n appendToBody: true,\n destroyOnClose: true,\n closeOnPressEscape: false,\n title: props.label,\n \"aria-label\": props.label,\n dir: props.dir,\n class: [\"adapttable-element-plus-assistant-sheet\", props.className],\n \"data-adapttable-part\": props.part,\n beforeClose: requestClose,\n onKeydown: keydown,\n // Chrome places the initial focus and returns it to the launcher;\n // the drawer's trap only keeps focus inside while open.\n \"on:focus-trap.focus-after-trapped\": preventDefault,\n \"on:focus-trap.focus-after-released\": preventDefault,\n },\n { default: () => props.children }\n );\n };\n },\n {\n name: \"ElementAssistantSheet\",\n props: {\n label: { type: String as PropType<TableAssistantSheetProps[\"label\"]> },\n part: { type: String as PropType<TableAssistantSheetProps[\"part\"]> },\n className: {\n type: String as PropType<TableAssistantSheetProps[\"className\"]>,\n },\n dir: { type: String as PropType<TableAssistantSheetProps[\"dir\"]> },\n open: {\n type: Boolean as PropType<TableAssistantSheetProps[\"open\"]>,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<TableAssistantSheetProps[\"onClose\"]>,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n TableAssistantSheetProps[\"children\"]\n >,\n default: undefined,\n },\n },\n }\n);\n","import type {\n ApprovalReviewSlots,\n TableAssistantSlots,\n} from \"@adapttable/vue/adapter\";\nimport { ElTag } from \"element-plus\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport { ElementExamplesMenu } from \"./ExamplesMenu\";\nimport { ElementAssistantSheet } from \"./Sheet\";\n\n/** Element Plus tag types for the assistant's status tones. */\nconst TAG_TYPE = {\n neutral: \"info\",\n busy: \"primary\",\n warning: \"warning\",\n danger: \"danger\",\n} as const;\n\nexport const elementAssistantControls: TableAssistantSlots = {\n Button: (props) =>\n elementButton(\n {\n type: \"button\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n \"aria-expanded\": props.expanded,\n title: props.tooltip,\n class: props.className,\n disabled: props.disabled,\n onClick: props.onClick,\n },\n [\n props.icon,\n props.iconOnly && props.icon ? null : (props.children ?? props.label),\n ]\n ),\n Composer: (props) =>\n h(ElementInput, {\n type: \"textarea\",\n rows: 2,\n value: props.value,\n disabled: props.disabled,\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n placeholder: props.placeholder,\n class: [\"adapttable-element-plus-assistant-input\", props.className],\n onChange: props.onChange,\n onKeydown: props.onKeyDown,\n }),\n Badge: (props) =>\n h(\n ElTag,\n {\n \"data-adapttable-part\": props.part,\n \"data-tone\": props.tone,\n type: TAG_TYPE[props.tone],\n size: \"small\",\n effect: \"light\",\n class: props.className,\n },\n { default: () => props.label }\n ),\n Panel: (props) =>\n h(\n ElementCard,\n {\n attrs: {\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-assistant-panel\", props.className],\n },\n },\n { default: () => props.children }\n ),\n Window: (props) =>\n h(\n ElementCard,\n {\n attrs: {\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-assistant-window\", props.className],\n style: props.style,\n },\n },\n { default: () => props.children }\n ),\n Sheet: (props) => h(ElementAssistantSheet, { ...props, key: props.part }),\n Menu: (props) => h(ElementExamplesMenu, props),\n LanguageChip: (props) =>\n h(ElementSelect, {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: props.className,\n disabled: props.disabled,\n value: props.value,\n options: props.options,\n onChange: props.onChange,\n }),\n};\n\nexport const elementApprovalControls: ApprovalReviewSlots = {\n Approve: elementAssistantControls.Button,\n Reject: elementAssistantControls.Button,\n Action: elementAssistantControls.Button,\n List: (props) =>\n h(\n \"ul\",\n {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-approval-list\", props.className],\n },\n [props.children]\n ),\n};\n","/** Optional assistant presentation; all conversation and approval state stays in the binding. */\nimport \"./assistant/assistant.css\";\n\nimport type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n AgentApprovalChrome,\n type AgentApprovalProps,\n createAdapterAgentApprovalFeature,\n createAdapterTableAssistantFeature,\n TableAssistantChrome,\n type TableAssistantProps,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport {\n elementApprovalControls,\n elementAssistantControls,\n} from \"./assistant/controls\";\n\nexport const TableAssistant = defineComponent(\n (props: TableAssistantProps) => () =>\n h(TableAssistantChrome, { ...props, slots: elementAssistantControls }),\n {\n name: \"ElementTableAssistant\",\n props: {\n assistant: { type: Object as PropType<TableAssistantProps[\"assistant\"]> },\n speech: { type: Object as PropType<TableAssistantProps[\"speech\"]> },\n open: {\n type: Boolean as PropType<TableAssistantProps[\"open\"]>,\n default: undefined,\n },\n onOpenChange: {\n type: Function as PropType<TableAssistantProps[\"onOpenChange\"]>,\n },\n presentation: {\n type: String as PropType<TableAssistantProps[\"presentation\"]>,\n },\n labels: { type: Object as PropType<TableAssistantProps[\"labels\"]> },\n accent: { type: String as PropType<TableAssistantProps[\"accent\"]> },\n receipts: {\n type: Boolean as PropType<TableAssistantProps[\"receipts\"]>,\n default: undefined,\n },\n className: { type: String as PropType<TableAssistantProps[\"className\"]> },\n launcher: {\n type: Boolean as PropType<TableAssistantProps[\"launcher\"]>,\n default: undefined,\n },\n onSettings: {\n type: Function as PropType<TableAssistantProps[\"onSettings\"]>,\n },\n boundary: {\n type: [String, Object] as PropType<TableAssistantProps[\"boundary\"]>,\n },\n note: { type: String as PropType<TableAssistantProps[\"note\"]> },\n greeting: { type: String as PropType<TableAssistantProps[\"greeting\"]> },\n avatars: { type: Object as PropType<TableAssistantProps[\"avatars\"]> },\n messageAction: {\n type: Function as PropType<TableAssistantProps[\"messageAction\"]>,\n },\n approval: { type: Object as PropType<TableAssistantProps[\"approval\"]> },\n dir: { type: String as PropType<TableAssistantProps[\"dir\"]> },\n },\n }\n);\nexport const AgentApproval = defineComponent(\n (props: AgentApprovalProps) => () =>\n h(AgentApprovalChrome, { ...props, slots: elementApprovalControls }),\n {\n name: \"ElementAgentApproval\",\n props: {\n pending: { type: Object as PropType<AgentApprovalProps[\"pending\"]> },\n labels: { type: Object as PropType<AgentApprovalProps[\"labels\"]> },\n className: { type: String as PropType<AgentApprovalProps[\"className\"]> },\n buttonClassName: {\n type: String as PropType<AgentApprovalProps[\"buttonClassName\"]>,\n },\n },\n }\n);\nexport function tableAssistant(): StaticTableFeature {\n return createAdapterTableAssistantFeature((props) =>\n h(TableAssistant, props)\n );\n}\nexport function agentApproval(): StaticTableFeature {\n return createAdapterAgentApprovalFeature((props) => h(AgentApproval, props));\n}\nexport type {\n AgentApprovalProps,\n TableAssistantProps,\n} from \"@adapttable/vue/adapter\";\n"],"mappings":";;;;;;;;;;AAeA,SAAS,SAAS,MAAgD;CAChE,QAAA,GAAOA,IAAAA,EAAAA,CACLC,aAAAA,gBACA;EAAE,KAAK,KAAK;EAAI,SAAS,KAAK;EAAI,wBAAwB,KAAK;CAAK,GACpE,EACE,eAAe,CACb,KAAK,OAAA,GACLD,IAAAA,EAAAA,CAAE,QAAQ,EAA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version":3,"file":"assistant.cjs","names":["h","ElDropdownItem","defineComponent","useScopeActivity","shallowRef","ElDropdown","elementButton","ElDropdownMenu","defineComponent","useScopeActivity","h","ElDrawer","elementButton","h","ElementInput","ElTag","ElementCard","ElementSelect","defineComponent","h","TableAssistantChrome","AgentApprovalChrome","createAdapterTableAssistantFeature","createAdapterAgentApprovalFeature"],"sources":["../src/assistant/ExamplesMenu.ts","../src/assistant/Sheet.ts","../src/assistant/controls.ts","../src/assistant.ts"],"sourcesContent":["import {\n type TableAssistantMenuProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type DropdownInstance,\n ElDropdown,\n ElDropdownItem,\n ElDropdownMenu,\n} from \"element-plus\";\nimport { defineComponent, h, type PropType, shallowRef, watch } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n\n/** One shortcut: its icon, title and optional description. */\nfunction menuItem(item: TableAssistantMenuProps[\"items\"][number]) {\n return h(\n ElDropdownItem,\n { key: item.id, command: item.id, \"data-adapttable-part\": item.part },\n {\n default: () => [\n item.icon,\n h(\"span\", [\n h(\"strong\", item.title),\n item.description ? h(\"small\", item.description) : null,\n ]),\n ],\n }\n );\n}\n\n/** The assistant's shortcuts in an Element Plus dropdown under its trigger. */\nexport const ElementExamplesMenu = defineComponent(\n (props: TableAssistantMenuProps) => {\n const active = useScopeActivity();\n const dropdown = shallowRef<DropdownInstance>();\n const trigger = shallowRef<HTMLElement | null>(null);\n const open = shallowRef(false);\n let generation = 0;\n watch(\n [active, () => props.disabled, () => props.items, () => props.onSelect],\n () => {\n generation++;\n dropdown.value?.handleClose();\n },\n { flush: \"sync\" }\n );\n // The menu closes itself on Escape and hands focus back to its trigger,\n // so an Escape inside it never reaches the surface around the trigger.\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.isComposing) return;\n event.preventDefault();\n event.stopPropagation();\n dropdown.value?.handleClose();\n trigger.value?.focus({ preventScroll: true });\n };\n return () => {\n if (!active.value) return null;\n const ticket = generation;\n const current = () =>\n active.value && !props.disabled && ticket === generation;\n return h(\n ElDropdown,\n {\n ref: dropdown,\n trigger: \"click\",\n persistent: false,\n hideTimeout: 0,\n disabled: props.disabled,\n maxHeight: props.maxHeight,\n onVisibleChange: (value: boolean) => {\n open.value = value;\n },\n onCommand: (id: unknown) => {\n if (\n current() &&\n typeof id === \"string\" &&\n props.items.some((item) => item.id === id)\n )\n props.onSelect(id);\n },\n },\n {\n default: () =>\n elementButton(\n {\n ref: (element: HTMLElement | null) => {\n trigger.value = element;\n },\n type: \"button\",\n disabled: props.disabled,\n \"aria-label\": props.label,\n title: props.label,\n class: props.className,\n \"data-adapttable-part\": props.part,\n onKeydown: (event: KeyboardEvent) => {\n if (open.value) keydown(event);\n },\n },\n [props.icon ?? props.label]\n ),\n dropdown: () =>\n h(\n ElDropdownMenu,\n // Captured on the list so an Escape from any item reaches it\n // before Element's own handling moves focus into the list.\n { \"aria-label\": props.label, onKeydownCapture: keydown },\n { default: () => props.items.map(menuItem) }\n ),\n }\n );\n };\n },\n {\n name: \"ElementExamplesMenu\",\n props: {\n label: { type: String as PropType<TableAssistantMenuProps[\"label\"]> },\n part: { type: String as PropType<TableAssistantMenuProps[\"part\"]> },\n className: {\n type: String as PropType<TableAssistantMenuProps[\"className\"]>,\n },\n icon: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n TableAssistantMenuProps[\"icon\"]\n >,\n default: undefined,\n },\n disabled: {\n type: Boolean as PropType<TableAssistantMenuProps[\"disabled\"]>,\n default: undefined,\n },\n items: { type: Array as PropType<TableAssistantMenuProps[\"items\"]> },\n onSelect: {\n type: Function as PropType<TableAssistantMenuProps[\"onSelect\"]>,\n },\n maxHeight: {\n type: String as PropType<TableAssistantMenuProps[\"maxHeight\"]>,\n },\n },\n }\n);\n","import {\n type TableAssistantSheetProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { ElDrawer } from \"element-plus\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\n/**\n * Chrome chooses initial and return focus; ElDrawer contains focus and owns\n * the portal. Escape and backdrop dismissal become one close request to the\n * host, and the drawer stays open until the host closes it.\n */\nexport const ElementAssistantSheet = defineComponent(\n (props: TableAssistantSheetProps) => {\n const active = useScopeActivity();\n const requestClose = () => {\n if (active.value && props.open) props.onClose();\n };\n const preventDefault = (event: Event) => event.preventDefault();\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.defaultPrevented || event.isComposing)\n return;\n event.preventDefault();\n event.stopPropagation();\n requestClose();\n };\n return () => {\n if (!active.value) return null;\n return h(\n ElDrawer,\n {\n modelValue: props.open,\n direction: props.dir === \"rtl\" ? \"ltr\" : \"rtl\",\n size: \"min(28rem, 100vw)\",\n withHeader: false,\n showClose: false,\n appendToBody: true,\n destroyOnClose: true,\n closeOnPressEscape: false,\n title: props.label,\n \"aria-label\": props.label,\n dir: props.dir,\n class: [\"adapttable-element-plus-assistant-sheet\", props.className],\n \"data-adapttable-part\": props.part,\n beforeClose: requestClose,\n onKeydown: keydown,\n // Chrome places the initial focus and returns it to the launcher;\n // the drawer's trap only keeps focus inside while open.\n \"on:focus-trap.focus-after-trapped\": preventDefault,\n \"on:focus-trap.focus-after-released\": preventDefault,\n },\n { default: () => props.children }\n );\n };\n },\n {\n name: \"ElementAssistantSheet\",\n props: {\n label: { type: String as PropType<TableAssistantSheetProps[\"label\"]> },\n part: { type: String as PropType<TableAssistantSheetProps[\"part\"]> },\n className: {\n type: String as PropType<TableAssistantSheetProps[\"className\"]>,\n },\n dir: { type: String as PropType<TableAssistantSheetProps[\"dir\"]> },\n open: {\n type: Boolean as PropType<TableAssistantSheetProps[\"open\"]>,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<TableAssistantSheetProps[\"onClose\"]>,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n TableAssistantSheetProps[\"children\"]\n >,\n default: undefined,\n },\n },\n }\n);\n","import type {\n ApprovalReviewSlots,\n TableAssistantSlots,\n} from \"@adapttable/vue/adapter\";\nimport { ElTag } from \"element-plus\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport { ElementExamplesMenu } from \"./ExamplesMenu\";\nimport { ElementAssistantSheet } from \"./Sheet\";\n\n/** Element Plus tag types for the assistant's status tones. */\nconst TAG_TYPE = {\n neutral: \"info\",\n busy: \"primary\",\n warning: \"warning\",\n danger: \"danger\",\n} as const;\n\nexport const elementAssistantControls: TableAssistantSlots = {\n Button: (props) =>\n elementButton(\n {\n type: \"button\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n \"aria-expanded\": props.expanded,\n title: props.tooltip,\n class: props.className,\n disabled: props.disabled,\n onClick: props.onClick,\n },\n [\n props.icon,\n props.iconOnly && props.icon ? null : (props.children ?? props.label),\n ]\n ),\n Composer: (props) =>\n h(ElementInput, {\n type: \"textarea\",\n rows: 1,\n value: props.value,\n disabled: props.disabled,\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n placeholder: props.placeholder,\n class: [\"adapttable-element-plus-assistant-input\", props.className],\n onChange: props.onChange,\n onKeydown: props.onKeyDown,\n }),\n Badge: (props) =>\n h(\n ElTag,\n {\n \"data-adapttable-part\": props.part,\n \"data-tone\": props.tone,\n type: TAG_TYPE[props.tone],\n size: \"small\",\n effect: \"light\",\n class: props.className,\n },\n { default: () => props.label }\n ),\n Panel: (props) =>\n h(\n ElementCard,\n {\n attrs: {\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-assistant-panel\", props.className],\n },\n },\n { default: () => props.children }\n ),\n Window: (props) =>\n h(\n ElementCard,\n {\n attrs: {\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-assistant-window\", props.className],\n style: props.style,\n },\n },\n { default: () => props.children }\n ),\n Sheet: (props) => h(ElementAssistantSheet, { ...props, key: props.part }),\n Menu: (props) => h(ElementExamplesMenu, props),\n LanguageChip: (props) =>\n h(ElementSelect, {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: props.className,\n disabled: props.disabled,\n value: props.value,\n options: props.options,\n onChange: props.onChange,\n }),\n};\n\nexport const elementApprovalControls: ApprovalReviewSlots = {\n Approve: elementAssistantControls.Button,\n Reject: elementAssistantControls.Button,\n Action: elementAssistantControls.Button,\n List: (props) =>\n h(\n \"ul\",\n {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-approval-list\", props.className],\n },\n [props.children]\n ),\n};\n","/** Optional assistant presentation; all conversation and approval state stays in the binding. */\nimport \"./assistant/assistant.css\";\n\nimport type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n AgentApprovalChrome,\n type AgentApprovalProps,\n createAdapterAgentApprovalFeature,\n createAdapterTableAssistantFeature,\n TableAssistantChrome,\n type TableAssistantProps,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport {\n elementApprovalControls,\n elementAssistantControls,\n} from \"./assistant/controls\";\n\nexport const TableAssistant = defineComponent(\n (props: TableAssistantProps) => () =>\n h(TableAssistantChrome, {\n ...props,\n accent: props.accent ?? \"var(--el-color-primary)\",\n slots: elementAssistantControls,\n }),\n {\n name: \"ElementTableAssistant\",\n props: {\n assistant: { type: Object as PropType<TableAssistantProps[\"assistant\"]> },\n speech: { type: Object as PropType<TableAssistantProps[\"speech\"]> },\n open: {\n type: Boolean as PropType<TableAssistantProps[\"open\"]>,\n default: undefined,\n },\n onOpenChange: {\n type: Function as PropType<TableAssistantProps[\"onOpenChange\"]>,\n },\n presentation: {\n type: String as PropType<TableAssistantProps[\"presentation\"]>,\n },\n labels: { type: Object as PropType<TableAssistantProps[\"labels\"]> },\n accent: { type: String as PropType<TableAssistantProps[\"accent\"]> },\n receipts: {\n type: Boolean as PropType<TableAssistantProps[\"receipts\"]>,\n default: undefined,\n },\n className: { type: String as PropType<TableAssistantProps[\"className\"]> },\n launcher: {\n type: Boolean as PropType<TableAssistantProps[\"launcher\"]>,\n default: undefined,\n },\n onSettings: {\n type: Function as PropType<TableAssistantProps[\"onSettings\"]>,\n },\n boundary: {\n type: [String, Object] as PropType<TableAssistantProps[\"boundary\"]>,\n },\n note: { type: String as PropType<TableAssistantProps[\"note\"]> },\n greeting: { type: String as PropType<TableAssistantProps[\"greeting\"]> },\n avatars: { type: Object as PropType<TableAssistantProps[\"avatars\"]> },\n messageAction: {\n type: Function as PropType<TableAssistantProps[\"messageAction\"]>,\n },\n approval: { type: Object as PropType<TableAssistantProps[\"approval\"]> },\n dir: { type: String as PropType<TableAssistantProps[\"dir\"]> },\n },\n }\n);\nexport const AgentApproval = defineComponent(\n (props: AgentApprovalProps) => () =>\n h(AgentApprovalChrome, { ...props, slots: elementApprovalControls }),\n {\n name: \"ElementAgentApproval\",\n props: {\n pending: { type: Object as PropType<AgentApprovalProps[\"pending\"]> },\n labels: { type: Object as PropType<AgentApprovalProps[\"labels\"]> },\n className: { type: String as PropType<AgentApprovalProps[\"className\"]> },\n buttonClassName: {\n type: String as PropType<AgentApprovalProps[\"buttonClassName\"]>,\n },\n },\n }\n);\nexport function tableAssistant(): StaticTableFeature {\n return createAdapterTableAssistantFeature((props) =>\n h(TableAssistant, props)\n );\n}\nexport function agentApproval(): StaticTableFeature {\n return createAdapterAgentApprovalFeature((props) => h(AgentApproval, props));\n}\nexport type {\n AgentApprovalProps,\n TableAssistantProps,\n} from \"@adapttable/vue/adapter\";\n"],"mappings":";;;;;;;;;;AAeA,SAAS,SAAS,MAAgD;CAChE,QAAA,GAAOA,IAAAA,EAAAA,CACLC,aAAAA,gBACA;EAAE,KAAK,KAAK;EAAI,SAAS,KAAK;EAAI,wBAAwB,KAAK;CAAK,GACpE,EACE,eAAe,CACb,KAAK,OAAA,GACLD,IAAAA,EAAAA,CA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oC,WAAA,GACzCH,IAAAA,EAAAA,CAAE,gBAAgB,KAAK,CACzB;AACF;AACA,SAAgB,gBAAoC;CAClD,QAAA,GAAOI,wBAAAA,kCAAAA,EAAmC,WAAA,GAAUJ,IAAAA,EAAAA,CAAE,eAAe,KAAK,CAAC;AAC7E"}
@@ -1 +1 @@
1
- {"version":3,"file":"assistant.d.cts","names":[],"sources":["../src/assistant.ts"],"mappings":";;;cAmBa,8BAAc,uBAAA,+BAAA,0CAAA;cA8Cd,6BAAa,uBAAA,8BAAA,yCAAA;iBAeV,kBAAkB;iBAKlB,iBAAiB"}
1
+ {"version":3,"file":"assistant.d.cts","names":[],"sources":["../src/assistant.ts"],"mappings":";;;cAmBa,8BAAc,uBAAA,+BAAA,0CAAA;cAkDd,6BAAa,uBAAA,8BAAA,yCAAA;iBAeV,kBAAkB;iBAKlB,iBAAiB"}
@@ -1 +1 @@
1
- {"version":3,"file":"assistant.d.ts","names":[],"sources":["../src/assistant.ts"],"mappings":";;;cAmBa,8BAAc,uBAAA,+BAAA,0CAAA;cA8Cd,6BAAa,uBAAA,8BAAA,yCAAA;iBAeV,kBAAkB;iBAKlB,iBAAiB"}
1
+ {"version":3,"file":"assistant.d.ts","names":[],"sources":["../src/assistant.ts"],"mappings":";;;cAmBa,8BAAc,uBAAA,+BAAA,0CAAA;cAkDd,6BAAa,uBAAA,8BAAA,yCAAA;iBAeV,kBAAkB;iBAKlB,iBAAiB"}
package/dist/assistant.js CHANGED
@@ -19,6 +19,7 @@ const ElementExamplesMenu = defineComponent((props) => {
19
19
  const active = useScopeActivity();
20
20
  const dropdown = shallowRef();
21
21
  const trigger = shallowRef(null);
22
+ const open = shallowRef(false);
22
23
  let generation = 0;
23
24
  watch([
24
25
  active,
@@ -47,6 +48,9 @@ const ElementExamplesMenu = defineComponent((props) => {
47
48
  hideTimeout: 0,
48
49
  disabled: props.disabled,
49
50
  maxHeight: props.maxHeight,
51
+ onVisibleChange: (value) => {
52
+ open.value = value;
53
+ },
50
54
  onCommand: (id) => {
51
55
  if (current() && typeof id === "string" && props.items.some((item) => item.id === id)) props.onSelect(id);
52
56
  }
@@ -60,8 +64,11 @@ const ElementExamplesMenu = defineComponent((props) => {
60
64
  "aria-label": props.label,
61
65
  title: props.label,
62
66
  class: props.className,
63
- "data-adapttable-part": props.part
64
- }, [props.icon, props.label]),
67
+ "data-adapttable-part": props.part,
68
+ onKeydown: (event) => {
69
+ if (open.value) keydown(event);
70
+ }
71
+ }, [props.icon ?? props.label]),
65
72
  dropdown: () => h(ElDropdownMenu, {
66
73
  "aria-label": props.label,
67
74
  onKeydownCapture: keydown
@@ -180,7 +187,7 @@ const elementAssistantControls = {
180
187
  }, [props.icon, props.iconOnly && props.icon ? null : props.children ?? props.label]),
181
188
  Composer: (props) => h(_sfc_main, {
182
189
  type: "textarea",
183
- rows: 2,
190
+ rows: 1,
184
191
  value: props.value,
185
192
  disabled: props.disabled,
186
193
  "data-adapttable-part": props.part,
@@ -240,6 +247,7 @@ const elementApprovalControls = {
240
247
  //#region src/assistant.ts
241
248
  const TableAssistant = defineComponent((props) => () => h(TableAssistantChrome, {
242
249
  ...props,
250
+ accent: props.accent ?? "var(--el-color-primary)",
243
251
  slots: elementAssistantControls
244
252
  }), {
245
253
  name: "ElementTableAssistant",
@@ -1 +1 @@
1
- {"version":3,"file":"assistant.js","names":["ElementInput","ElementSelect"],"sources":["../src/assistant/ExamplesMenu.ts","../src/assistant/Sheet.ts","../src/assistant/controls.ts","../src/assistant.ts"],"sourcesContent":["import {\n type TableAssistantMenuProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type DropdownInstance,\n ElDropdown,\n ElDropdownItem,\n ElDropdownMenu,\n} from \"element-plus\";\nimport { defineComponent, h, type PropType, shallowRef, watch } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n\n/** One shortcut: its icon, title and optional description. */\nfunction menuItem(item: TableAssistantMenuProps[\"items\"][number]) {\n return h(\n ElDropdownItem,\n { key: item.id, command: item.id, \"data-adapttable-part\": item.part },\n {\n default: () => [\n item.icon,\n h(\"span\", [\n h(\"strong\", item.title),\n item.description ? h(\"small\", item.description) : null,\n ]),\n ],\n }\n );\n}\n\n/** The assistant's shortcuts in an Element Plus dropdown under its trigger. */\nexport const ElementExamplesMenu = defineComponent(\n (props: TableAssistantMenuProps) => {\n const active = useScopeActivity();\n const dropdown = shallowRef<DropdownInstance>();\n const trigger = shallowRef<HTMLElement | null>(null);\n let generation = 0;\n watch(\n [active, () => props.disabled, () => props.items, () => props.onSelect],\n () => {\n generation++;\n dropdown.value?.handleClose();\n },\n { flush: \"sync\" }\n );\n // The menu closes itself on Escape and hands focus back to its trigger,\n // so an Escape inside it never reaches the surface around the trigger.\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.isComposing) return;\n event.preventDefault();\n event.stopPropagation();\n dropdown.value?.handleClose();\n trigger.value?.focus({ preventScroll: true });\n };\n return () => {\n if (!active.value) return null;\n const ticket = generation;\n const current = () =>\n active.value && !props.disabled && ticket === generation;\n return h(\n ElDropdown,\n {\n ref: dropdown,\n trigger: \"click\",\n persistent: false,\n hideTimeout: 0,\n disabled: props.disabled,\n maxHeight: props.maxHeight,\n onCommand: (id: unknown) => {\n if (\n current() &&\n typeof id === \"string\" &&\n props.items.some((item) => item.id === id)\n )\n props.onSelect(id);\n },\n },\n {\n default: () =>\n elementButton(\n {\n ref: (element: HTMLElement | null) => {\n trigger.value = element;\n },\n type: \"button\",\n disabled: props.disabled,\n \"aria-label\": props.label,\n title: props.label,\n class: props.className,\n \"data-adapttable-part\": props.part,\n },\n [props.icon, props.label]\n ),\n dropdown: () =>\n h(\n ElDropdownMenu,\n // Captured on the list so an Escape from any item reaches it\n // before Element's own handling moves focus into the list.\n { \"aria-label\": props.label, onKeydownCapture: keydown },\n { default: () => props.items.map(menuItem) }\n ),\n }\n );\n };\n },\n {\n name: \"ElementExamplesMenu\",\n props: {\n label: { type: String as PropType<TableAssistantMenuProps[\"label\"]> },\n part: { type: String as PropType<TableAssistantMenuProps[\"part\"]> },\n className: {\n type: String as PropType<TableAssistantMenuProps[\"className\"]>,\n },\n icon: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n TableAssistantMenuProps[\"icon\"]\n >,\n default: undefined,\n },\n disabled: {\n type: Boolean as PropType<TableAssistantMenuProps[\"disabled\"]>,\n default: undefined,\n },\n items: { type: Array as PropType<TableAssistantMenuProps[\"items\"]> },\n onSelect: {\n type: Function as PropType<TableAssistantMenuProps[\"onSelect\"]>,\n },\n maxHeight: {\n type: String as PropType<TableAssistantMenuProps[\"maxHeight\"]>,\n },\n },\n }\n);\n","import {\n type TableAssistantSheetProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { ElDrawer } from \"element-plus\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\n/**\n * Chrome chooses initial and return focus; ElDrawer contains focus and owns\n * the portal. Escape and backdrop dismissal become one close request to the\n * host, and the drawer stays open until the host closes it.\n */\nexport const ElementAssistantSheet = defineComponent(\n (props: TableAssistantSheetProps) => {\n const active = useScopeActivity();\n const requestClose = () => {\n if (active.value && props.open) props.onClose();\n };\n const preventDefault = (event: Event) => event.preventDefault();\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.defaultPrevented || event.isComposing)\n return;\n event.preventDefault();\n event.stopPropagation();\n requestClose();\n };\n return () => {\n if (!active.value) return null;\n return h(\n ElDrawer,\n {\n modelValue: props.open,\n direction: props.dir === \"rtl\" ? \"ltr\" : \"rtl\",\n size: \"min(28rem, 100vw)\",\n withHeader: false,\n showClose: false,\n appendToBody: true,\n destroyOnClose: true,\n closeOnPressEscape: false,\n title: props.label,\n \"aria-label\": props.label,\n dir: props.dir,\n class: [\"adapttable-element-plus-assistant-sheet\", props.className],\n \"data-adapttable-part\": props.part,\n beforeClose: requestClose,\n onKeydown: keydown,\n // Chrome places the initial focus and returns it to the launcher;\n // the drawer's trap only keeps focus inside while open.\n \"on:focus-trap.focus-after-trapped\": preventDefault,\n \"on:focus-trap.focus-after-released\": preventDefault,\n },\n { default: () => props.children }\n );\n };\n },\n {\n name: \"ElementAssistantSheet\",\n props: {\n label: { type: String as PropType<TableAssistantSheetProps[\"label\"]> },\n part: { type: String as PropType<TableAssistantSheetProps[\"part\"]> },\n className: {\n type: String as PropType<TableAssistantSheetProps[\"className\"]>,\n },\n dir: { type: String as PropType<TableAssistantSheetProps[\"dir\"]> },\n open: {\n type: Boolean as PropType<TableAssistantSheetProps[\"open\"]>,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<TableAssistantSheetProps[\"onClose\"]>,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n TableAssistantSheetProps[\"children\"]\n >,\n default: undefined,\n },\n },\n }\n);\n","import type {\n ApprovalReviewSlots,\n TableAssistantSlots,\n} from \"@adapttable/vue/adapter\";\nimport { ElTag } from \"element-plus\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport { ElementExamplesMenu } from \"./ExamplesMenu\";\nimport { ElementAssistantSheet } from \"./Sheet\";\n\n/** Element Plus tag types for the assistant's status tones. */\nconst TAG_TYPE = {\n neutral: \"info\",\n busy: \"primary\",\n warning: \"warning\",\n danger: \"danger\",\n} as const;\n\nexport const elementAssistantControls: TableAssistantSlots = {\n Button: (props) =>\n elementButton(\n {\n type: \"button\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n \"aria-expanded\": props.expanded,\n title: props.tooltip,\n class: props.className,\n disabled: props.disabled,\n onClick: props.onClick,\n },\n [\n props.icon,\n props.iconOnly && props.icon ? null : (props.children ?? props.label),\n ]\n ),\n Composer: (props) =>\n h(ElementInput, {\n type: \"textarea\",\n rows: 2,\n value: props.value,\n disabled: props.disabled,\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n placeholder: props.placeholder,\n class: [\"adapttable-element-plus-assistant-input\", props.className],\n onChange: props.onChange,\n onKeydown: props.onKeyDown,\n }),\n Badge: (props) =>\n h(\n ElTag,\n {\n \"data-adapttable-part\": props.part,\n \"data-tone\": props.tone,\n type: TAG_TYPE[props.tone],\n size: \"small\",\n effect: \"light\",\n class: props.className,\n },\n { default: () => props.label }\n ),\n Panel: (props) =>\n h(\n ElementCard,\n {\n attrs: {\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-assistant-panel\", props.className],\n },\n },\n { default: () => props.children }\n ),\n Window: (props) =>\n h(\n ElementCard,\n {\n attrs: {\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-assistant-window\", props.className],\n style: props.style,\n },\n },\n { default: () => props.children }\n ),\n Sheet: (props) => h(ElementAssistantSheet, { ...props, key: props.part }),\n Menu: (props) => h(ElementExamplesMenu, props),\n LanguageChip: (props) =>\n h(ElementSelect, {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: props.className,\n disabled: props.disabled,\n value: props.value,\n options: props.options,\n onChange: props.onChange,\n }),\n};\n\nexport const elementApprovalControls: ApprovalReviewSlots = {\n Approve: elementAssistantControls.Button,\n Reject: elementAssistantControls.Button,\n Action: elementAssistantControls.Button,\n List: (props) =>\n h(\n \"ul\",\n {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-approval-list\", props.className],\n },\n [props.children]\n ),\n};\n","/** Optional assistant presentation; all conversation and approval state stays in the binding. */\nimport \"./assistant/assistant.css\";\n\nimport type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n AgentApprovalChrome,\n type AgentApprovalProps,\n createAdapterAgentApprovalFeature,\n createAdapterTableAssistantFeature,\n TableAssistantChrome,\n type TableAssistantProps,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport {\n elementApprovalControls,\n elementAssistantControls,\n} from \"./assistant/controls\";\n\nexport const TableAssistant = defineComponent(\n (props: TableAssistantProps) => () =>\n h(TableAssistantChrome, { ...props, slots: elementAssistantControls }),\n {\n name: \"ElementTableAssistant\",\n props: {\n assistant: { type: Object as PropType<TableAssistantProps[\"assistant\"]> },\n speech: { type: Object as PropType<TableAssistantProps[\"speech\"]> },\n open: {\n type: Boolean as PropType<TableAssistantProps[\"open\"]>,\n default: undefined,\n },\n onOpenChange: {\n type: Function as PropType<TableAssistantProps[\"onOpenChange\"]>,\n },\n presentation: {\n type: String as PropType<TableAssistantProps[\"presentation\"]>,\n },\n labels: { type: Object as PropType<TableAssistantProps[\"labels\"]> },\n accent: { type: String as PropType<TableAssistantProps[\"accent\"]> },\n receipts: {\n type: Boolean as PropType<TableAssistantProps[\"receipts\"]>,\n default: undefined,\n },\n className: { type: String as PropType<TableAssistantProps[\"className\"]> },\n launcher: {\n type: Boolean as PropType<TableAssistantProps[\"launcher\"]>,\n default: undefined,\n },\n onSettings: {\n type: Function as PropType<TableAssistantProps[\"onSettings\"]>,\n },\n boundary: {\n type: [String, Object] as PropType<TableAssistantProps[\"boundary\"]>,\n },\n note: { type: String as PropType<TableAssistantProps[\"note\"]> },\n greeting: { type: String as PropType<TableAssistantProps[\"greeting\"]> },\n avatars: { type: Object as PropType<TableAssistantProps[\"avatars\"]> },\n messageAction: {\n type: Function as PropType<TableAssistantProps[\"messageAction\"]>,\n },\n approval: { type: Object as PropType<TableAssistantProps[\"approval\"]> },\n dir: { type: String as PropType<TableAssistantProps[\"dir\"]> },\n },\n }\n);\nexport const AgentApproval = defineComponent(\n (props: AgentApprovalProps) => () =>\n h(AgentApprovalChrome, { ...props, slots: elementApprovalControls }),\n {\n name: \"ElementAgentApproval\",\n props: {\n pending: { type: Object as PropType<AgentApprovalProps[\"pending\"]> },\n labels: { type: Object as PropType<AgentApprovalProps[\"labels\"]> },\n className: { type: String as PropType<AgentApprovalProps[\"className\"]> },\n buttonClassName: {\n type: String as PropType<AgentApprovalProps[\"buttonClassName\"]>,\n },\n },\n }\n);\nexport function tableAssistant(): StaticTableFeature {\n return createAdapterTableAssistantFeature((props) =>\n h(TableAssistant, props)\n );\n}\nexport function agentApproval(): StaticTableFeature {\n return createAdapterAgentApprovalFeature((props) => h(AgentApproval, props));\n}\nexport type {\n AgentApprovalProps,\n TableAssistantProps,\n} from \"@adapttable/vue/adapter\";\n"],"mappings":";;;;;;;;;AAeA,SAAS,SAAS,MAAgD;CAChE,OAAO,EACL,gBACA;EAAE,KAAK,KAAK;EAAI,SAAS,KAAK;EAAI,wBAAwB,KAAK;CAAK,GACpE,EACE,eAAe,CACb,KAAK,MACL,EAAE,QAAQ,CACR,EAAE,UAAU,KAAK,KAAK,GACtB,KAAK,cAAc,EAAE,SAAS,KAAK,WAAW,IAAI,IACpD,CAAC,CACH,EACF,CACF;AACF;;AAGA,MAAa,sBAAsB,iBAChC,UAAmC;CAClC,MAAM,SAAS,iBAAiB;CAChC,MAAM,WAAW,WAA6B;CAC9C,MAAM,UAAU,WAA+B,IAAI;CACnD,IAAI,aAAa;CACjB,MACE;EAAC;QAAc,MAAM;QAAgB,MAAM;QAAa,MAAM;CAAQ,SAChE;EACJ;EACA,SAAS,OAAO,YAAY;CAC9B,GACA,EAAE,OAAO,OAAO,CAClB;CAGA,MAAM,WAAW,UAAyB;EACxC,IAAI,MAAM,QAAQ,YAAY,MAAM,aAAa;EACjD,MAAM,eAAe;EACrB,MAAM,gBAAgB;EACtB,SAAS,OAAO,YAAY;EAC5B,QAAQ,OAAO,MAAM,EAAE,eAAe,KAAK,CAAC;CAC9C;CACA,aAAa;EACX,IAAI,CAAC,OAAO,OAAO,OAAO;EAC1B,MAAM,SAAS;EACf,MAAM,gBACJ,OAAO,SAAS,CAAC,MAAM,YAAY,WAAW;EAChD,OAAO,EACL,YACA;GACE,KAAK;GACL,SAAS;GACT,YAAY;GACZ,aAAa;GACb,UAAU,MAAM;GAChB,WAAW,MAAM;GACj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MAAM;GACN,SAAS,KAAA;EACX;EACA,cAAc,EACZ,MAAM,SACR;EACA,cAAc,EACZ,MAAM,OACR;EACA,QAAQ,EAAE,MAAM,OAAkD;EAClE,QAAQ,EAAE,MAAM,OAAkD;EAClE,UAAU;GACR,MAAM;GACN,SAAS,KAAA;EACX;EACA,WAAW,EAAE,MAAM,OAAqD;EACxE,UAAU;GACR,MAAM;GACN,SAAS,KAAA;EACX;EACA,YAAY,EACV,MAAM,SACR;EACA,UAAU,EACR,MAAM,CAAC,QAAQ,MAAM,EACvB;EACA,MAAM,EAAE,MAAM,OAAgD;EAC9D,UAAU,EAAE,MAAM,OAAoD;EACtE,SAAS,EAAE,MAAM,OAAmD;EACpE,eAAe,EACb,MAAM,SACR;EACA,UAAU,EAAE,MAAM,OAAoD;EACtE,KAAK,EAAE,MAAM,OAA+C;CAC9D;AACF,CACF;AACA,MAAa,gBAAgB,iBAC1B,gBACC,EAAE,qBAAqB;CAAE,GAAG;CAAO,OAAO;AAAwB,CAAC,GACrE;CACE,MAAM;CACN,OAAO;EACL,SAAS,EAAE,MAAM,OAAkD;EACnE,QAAQ,EAAE,MAAM,OAAiD;EACjE,WAAW,EAAE,MAAM,OAAoD;EACvE,iBAAiB,EACf,MAAM,OACR;CACF;AACF,CACF;AACA,SAAgB,iBAAqC;CACnD,OAAO,oCAAoC,UACzC,EAAE,gBAAgB,KAAK,CACzB;AACF;AACA,SAAgB,gBAAoC;CAClD,OAAO,mCAAmC,UAAU,EAAE,eAAe,KAAK,CAAC;AAC7E"}
1
+ {"version":3,"file":"assistant.js","names":["ElementInput","ElementSelect"],"sources":["../src/assistant/ExamplesMenu.ts","../src/assistant/Sheet.ts","../src/assistant/controls.ts","../src/assistant.ts"],"sourcesContent":["import {\n type TableAssistantMenuProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type DropdownInstance,\n ElDropdown,\n ElDropdownItem,\n ElDropdownMenu,\n} from \"element-plus\";\nimport { defineComponent, h, type PropType, shallowRef, watch } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n\n/** One shortcut: its icon, title and optional description. */\nfunction menuItem(item: TableAssistantMenuProps[\"items\"][number]) {\n return h(\n ElDropdownItem,\n { key: item.id, command: item.id, \"data-adapttable-part\": item.part },\n {\n default: () => [\n item.icon,\n h(\"span\", [\n h(\"strong\", item.title),\n item.description ? h(\"small\", item.description) : null,\n ]),\n ],\n }\n );\n}\n\n/** The assistant's shortcuts in an Element Plus dropdown under its trigger. */\nexport const ElementExamplesMenu = defineComponent(\n (props: TableAssistantMenuProps) => {\n const active = useScopeActivity();\n const dropdown = shallowRef<DropdownInstance>();\n const trigger = shallowRef<HTMLElement | null>(null);\n const open = shallowRef(false);\n let generation = 0;\n watch(\n [active, () => props.disabled, () => props.items, () => props.onSelect],\n () => {\n generation++;\n dropdown.value?.handleClose();\n },\n { flush: \"sync\" }\n );\n // The menu closes itself on Escape and hands focus back to its trigger,\n // so an Escape inside it never reaches the surface around the trigger.\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.isComposing) return;\n event.preventDefault();\n event.stopPropagation();\n dropdown.value?.handleClose();\n trigger.value?.focus({ preventScroll: true });\n };\n return () => {\n if (!active.value) return null;\n const ticket = generation;\n const current = () =>\n active.value && !props.disabled && ticket === generation;\n return h(\n ElDropdown,\n {\n ref: dropdown,\n trigger: \"click\",\n persistent: false,\n hideTimeout: 0,\n disabled: props.disabled,\n maxHeight: props.maxHeight,\n onVisibleChange: (value: boolean) => {\n open.value = value;\n },\n onCommand: (id: unknown) => {\n if (\n current() &&\n typeof id === \"string\" &&\n props.items.some((item) => item.id === id)\n )\n props.onSelect(id);\n },\n },\n {\n default: () =>\n elementButton(\n {\n ref: (element: HTMLElement | null) => {\n trigger.value = element;\n },\n type: \"button\",\n disabled: props.disabled,\n \"aria-label\": props.label,\n title: props.label,\n class: props.className,\n \"data-adapttable-part\": props.part,\n onKeydown: (event: KeyboardEvent) => {\n if (open.value) keydown(event);\n },\n },\n [props.icon ?? props.label]\n ),\n dropdown: () =>\n h(\n ElDropdownMenu,\n // Captured on the list so an Escape from any item reaches it\n // before Element's own handling moves focus into the list.\n { \"aria-label\": props.label, onKeydownCapture: keydown },\n { default: () => props.items.map(menuItem) }\n ),\n }\n );\n };\n },\n {\n name: \"ElementExamplesMenu\",\n props: {\n label: { type: String as PropType<TableAssistantMenuProps[\"label\"]> },\n part: { type: String as PropType<TableAssistantMenuProps[\"part\"]> },\n className: {\n type: String as PropType<TableAssistantMenuProps[\"className\"]>,\n },\n icon: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n TableAssistantMenuProps[\"icon\"]\n >,\n default: undefined,\n },\n disabled: {\n type: Boolean as PropType<TableAssistantMenuProps[\"disabled\"]>,\n default: undefined,\n },\n items: { type: Array as PropType<TableAssistantMenuProps[\"items\"]> },\n onSelect: {\n type: Function as PropType<TableAssistantMenuProps[\"onSelect\"]>,\n },\n maxHeight: {\n type: String as PropType<TableAssistantMenuProps[\"maxHeight\"]>,\n },\n },\n }\n);\n","import {\n type TableAssistantSheetProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { ElDrawer } from \"element-plus\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\n/**\n * Chrome chooses initial and return focus; ElDrawer contains focus and owns\n * the portal. Escape and backdrop dismissal become one close request to the\n * host, and the drawer stays open until the host closes it.\n */\nexport const ElementAssistantSheet = defineComponent(\n (props: TableAssistantSheetProps) => {\n const active = useScopeActivity();\n const requestClose = () => {\n if (active.value && props.open) props.onClose();\n };\n const preventDefault = (event: Event) => event.preventDefault();\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.defaultPrevented || event.isComposing)\n return;\n event.preventDefault();\n event.stopPropagation();\n requestClose();\n };\n return () => {\n if (!active.value) return null;\n return h(\n ElDrawer,\n {\n modelValue: props.open,\n direction: props.dir === \"rtl\" ? \"ltr\" : \"rtl\",\n size: \"min(28rem, 100vw)\",\n withHeader: false,\n showClose: false,\n appendToBody: true,\n destroyOnClose: true,\n closeOnPressEscape: false,\n title: props.label,\n \"aria-label\": props.label,\n dir: props.dir,\n class: [\"adapttable-element-plus-assistant-sheet\", props.className],\n \"data-adapttable-part\": props.part,\n beforeClose: requestClose,\n onKeydown: keydown,\n // Chrome places the initial focus and returns it to the launcher;\n // the drawer's trap only keeps focus inside while open.\n \"on:focus-trap.focus-after-trapped\": preventDefault,\n \"on:focus-trap.focus-after-released\": preventDefault,\n },\n { default: () => props.children }\n );\n };\n },\n {\n name: \"ElementAssistantSheet\",\n props: {\n label: { type: String as PropType<TableAssistantSheetProps[\"label\"]> },\n part: { type: String as PropType<TableAssistantSheetProps[\"part\"]> },\n className: {\n type: String as PropType<TableAssistantSheetProps[\"className\"]>,\n },\n dir: { type: String as PropType<TableAssistantSheetProps[\"dir\"]> },\n open: {\n type: Boolean as PropType<TableAssistantSheetProps[\"open\"]>,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<TableAssistantSheetProps[\"onClose\"]>,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n TableAssistantSheetProps[\"children\"]\n >,\n default: undefined,\n },\n },\n }\n);\n","import type {\n ApprovalReviewSlots,\n TableAssistantSlots,\n} from \"@adapttable/vue/adapter\";\nimport { ElTag } from \"element-plus\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport { ElementExamplesMenu } from \"./ExamplesMenu\";\nimport { ElementAssistantSheet } from \"./Sheet\";\n\n/** Element Plus tag types for the assistant's status tones. */\nconst TAG_TYPE = {\n neutral: \"info\",\n busy: \"primary\",\n warning: \"warning\",\n danger: \"danger\",\n} as const;\n\nexport const elementAssistantControls: TableAssistantSlots = {\n Button: (props) =>\n elementButton(\n {\n type: \"button\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n \"aria-expanded\": props.expanded,\n title: props.tooltip,\n class: props.className,\n disabled: props.disabled,\n onClick: props.onClick,\n },\n [\n props.icon,\n props.iconOnly && props.icon ? null : (props.children ?? props.label),\n ]\n ),\n Composer: (props) =>\n h(ElementInput, {\n type: \"textarea\",\n rows: 1,\n value: props.value,\n disabled: props.disabled,\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n placeholder: props.placeholder,\n class: [\"adapttable-element-plus-assistant-input\", props.className],\n onChange: props.onChange,\n onKeydown: props.onKeyDown,\n }),\n Badge: (props) =>\n h(\n ElTag,\n {\n \"data-adapttable-part\": props.part,\n \"data-tone\": props.tone,\n type: TAG_TYPE[props.tone],\n size: \"small\",\n effect: \"light\",\n class: props.className,\n },\n { default: () => props.label }\n ),\n Panel: (props) =>\n h(\n ElementCard,\n {\n attrs: {\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-assistant-panel\", props.className],\n },\n },\n { default: () => props.children }\n ),\n Window: (props) =>\n h(\n ElementCard,\n {\n attrs: {\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-assistant-window\", props.className],\n style: props.style,\n },\n },\n { default: () => props.children }\n ),\n Sheet: (props) => h(ElementAssistantSheet, { ...props, key: props.part }),\n Menu: (props) => h(ElementExamplesMenu, props),\n LanguageChip: (props) =>\n h(ElementSelect, {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: props.className,\n disabled: props.disabled,\n value: props.value,\n options: props.options,\n onChange: props.onChange,\n }),\n};\n\nexport const elementApprovalControls: ApprovalReviewSlots = {\n Approve: elementAssistantControls.Button,\n Reject: elementAssistantControls.Button,\n Action: elementAssistantControls.Button,\n List: (props) =>\n h(\n \"ul\",\n {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-approval-list\", props.className],\n },\n [props.children]\n ),\n};\n","/** Optional assistant presentation; all conversation and approval state stays in the binding. */\nimport \"./assistant/assistant.css\";\n\nimport type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n AgentApprovalChrome,\n type AgentApprovalProps,\n createAdapterAgentApprovalFeature,\n createAdapterTableAssistantFeature,\n TableAssistantChrome,\n type TableAssistantProps,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport {\n elementApprovalControls,\n elementAssistantControls,\n} from \"./assistant/controls\";\n\nexport const TableAssistant = defineComponent(\n (props: TableAssistantProps) => () =>\n h(TableAssistantChrome, {\n ...props,\n accent: props.accent ?? \"var(--el-color-primary)\",\n slots: elementAssistantControls,\n }),\n {\n name: \"ElementTableAssistant\",\n props: {\n assistant: { type: Object as PropType<TableAssistantProps[\"assistant\"]> },\n speech: { type: Object as PropType<TableAssistantProps[\"speech\"]> },\n open: {\n type: Boolean as PropType<TableAssistantProps[\"open\"]>,\n default: undefined,\n },\n onOpenChange: {\n type: Function as PropType<TableAssistantProps[\"onOpenChange\"]>,\n },\n presentation: {\n type: String as PropType<TableAssistantProps[\"presentation\"]>,\n },\n labels: { type: Object as PropType<TableAssistantProps[\"labels\"]> },\n accent: { type: String as PropType<TableAssistantProps[\"accent\"]> },\n receipts: {\n type: Boolean as PropType<TableAssistantProps[\"receipts\"]>,\n default: undefined,\n },\n className: { type: String as PropType<TableAssistantProps[\"className\"]> },\n launcher: {\n type: Boolean as PropType<TableAssistantProps[\"launcher\"]>,\n default: undefined,\n },\n onSettings: {\n type: Function as PropType<TableAssistantProps[\"onSettings\"]>,\n },\n boundary: {\n type: [String, Object] as PropType<TableAssistantProps[\"boundary\"]>,\n },\n note: { type: String as PropType<TableAssistantProps[\"note\"]> },\n greeting: { type: String as PropType<TableAssistantProps[\"greeting\"]> },\n avatars: { type: Object as PropType<TableAssistantProps[\"avatars\"]> },\n messageAction: {\n type: Function as PropType<TableAssistantProps[\"messageAction\"]>,\n },\n approval: { type: Object as PropType<TableAssistantProps[\"approval\"]> },\n dir: { type: String as PropType<TableAssistantProps[\"dir\"]> },\n },\n }\n);\nexport const AgentApproval = defineComponent(\n (props: AgentApprovalProps) => () =>\n h(AgentApprovalChrome, { ...props, slots: elementApprovalControls }),\n {\n name: \"ElementAgentApproval\",\n props: {\n pending: { type: Object as PropType<AgentApprovalProps[\"pending\"]> },\n labels: { type: Object as PropType<AgentApprovalProps[\"labels\"]> },\n className: { type: String as PropType<AgentApprovalProps[\"className\"]> },\n buttonClassName: {\n type: String as PropType<AgentApprovalProps[\"buttonClassName\"]>,\n },\n },\n }\n);\nexport function tableAssistant(): StaticTableFeature {\n return createAdapterTableAssistantFeature((props) =>\n h(TableAssistant, props)\n );\n}\nexport function agentApproval(): StaticTableFeature {\n return createAdapterAgentApprovalFeature((props) => h(AgentApproval, props));\n}\nexport type {\n AgentApprovalProps,\n TableAssistantProps,\n} from \"@adapttable/vue/adapter\";\n"],"mappings":";;;;;;;;;AAeA,SAAS,SAAS,MAAgD;CAChE,OAAO,EACL,gBACA;EAAE,KAAK,KAAK;EAAI,SAAS,KAAK;EAAI,wBAAwB,KAAK;CAAK,GACpE,EACE,eAAe,CACb,KAAK,MACL,EAAE,QAAQ,CACR,EAAE,UAAU,KAAK,KAAK,GACtB,KAAK,cAAc,EAAE,SAAS,KAAK,WAAW,IAAI,IACpD,CAAC,CACH,EACF,CACF;AACF;;AAGA,MAAa,sBAAsB,iBAChC,UAAmC;CAClC,MAAM,SAAS,iBAAiB;CAChC,MAAM,WAAW,WAA6B;CAC9C,MAAM,UAAU,WAA+B,IAAI;CACnD,MAAM,OAAO,WAAW,KAAK;CAC7B,IAAI,aAAa;CACjB,MACE;EAAC;QAAc,MAAM;QAAgB,MAAM;QAAa,MAAM;CAAQ,SAChE;EACJ;EACA,SAAS,OAAO,YAAY;CAC9B,GACA,EAAE,OAAO,OAAO,CAClB;CAGA,MAAM,WAAW,UAAyB;EACxC,IAAI,MAAM,QAAQ,YAAY,MAAM,aAAa;EACjD,MAAM,eAAe;EACrB,MA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CACF;AACA,SAAgB,iBAAqC;CACnD,OAAO,oCAAoC,UACzC,EAAE,gBAAgB,KAAK,CACzB;AACF;AACA,SAAgB,gBAAoC;CAClD,OAAO,mCAAmC,UAAU,EAAE,eAAe,KAAK,CAAC;AAC7E"}
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_editing = require("./editing-BX-jUtdO.cjs");
2
+ const require_editing = require("./editing-BMtWRqqJ.cjs");
3
3
  exports.ElementBatchEditBar = require_editing._sfc_main$1;
4
4
  exports.batchEditing = require_editing.batchEditing;
@@ -1,2 +1,2 @@
1
- import { c as _sfc_main, t as batchEditing } from "./editing-C1Hy-MCQ.js";
1
+ import { c as _sfc_main, t as batchEditing } from "./editing-CohAxA65.js";
2
2
  export { _sfc_main as ElementBatchEditBar, batchEditing };
@@ -219,8 +219,13 @@ const _sfc_main$2 = /*@__PURE__*/ (0, vue.defineComponent)({
219
219
  const controls = {
220
220
  Activate: (control) => require_button.elementButton({
221
221
  title: control.title,
222
- "aria-label": control.title,
223
- class: [control.className, names.value.editCellActivate],
222
+ text: true,
223
+ "aria-description": control.title,
224
+ class: [
225
+ "adapttable-element-edit-value",
226
+ control.className,
227
+ names.value.editCellActivate
228
+ ],
224
229
  ref: control.activateRef,
225
230
  "data-adapttable-part": "edit-cell-activate",
226
231
  "data-save-status": control.saveStatus,
@@ -420,4 +425,4 @@ Object.defineProperty(exports, "undoRedoButtons", {
420
425
  }
421
426
  });
422
427
 
423
- //# sourceMappingURL=editing-BX-jUtdO.cjs.map
428
+ //# sourceMappingURL=editing-BMtWRqqJ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editing-BMtWRqqJ.cjs","names":["$attrs","defineComponent","useScopeActivity","shallowRef","computed","nextTick","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"],"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 { ElOption, ElSelect, type SelectInstance } from \"element-plus\";\nimport { nextTick, 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 void nextTick(() => control.value?.$forceUpdate());\n}\ndefineExpose({\n focus: () => control.value?.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 useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n computed,\n createVNode,\n defineComponent,\n h,\n nextTick,\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 void nextTick(() => {\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.\nfunction ElementCellEditor<TRow>(\n props: EditableCellEditorProps<TRow> & { className?: string }\n) {\n return createVNode(ElementCellEditorPresentation, { ...props });\n}\nElementCellEditor.props = Object.keys(\n editorRuntimeProps\n) as (keyof typeof editorRuntimeProps)[];\nElementCellEditor.inheritAttrs = false;\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 props = withDefaults(defineProps<BatchEditBarProps<TRow>>(), {\n contested: undefined,\n});\nconst names = useClassNames();\nconst Render = () =>\n BatchEditBarChrome({\n ...props,\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 props = withDefaults(defineProps<RowEditActionsProps<TRow>>(), {\n showBegin: undefined,\n});\nconst names = useClassNames();\nconst Render = () =>\n RowEditActionsChrome({\n ...props,\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 ToolbarExtrasSlotProps,\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: ToolbarExtrasSlotProps) => {\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<ToolbarExtrasSlotProps[\"onUndo\"]> },\n onRedo: { type: Function as PropType<ToolbarExtrasSlotProps[\"onRedo\"]> },\n canUndo: {\n type: Boolean as PropType<ToolbarExtrasSlotProps[\"canUndo\"]>,\n default: undefined,\n },\n canRedo: {\n type: Boolean as PropType<ToolbarExtrasSlotProps[\"canRedo\"]>,\n default: undefined,\n },\n undoLabel: {\n type: String as PropType<ToolbarExtrasSlotProps[\"undoLabel\"]>,\n },\n redoLabel: {\n type: String as PropType<ToolbarExtrasSlotProps[\"redoLabel\"]>,\n },\n density: { type: String as PropType<ToolbarExtrasSlotProps[\"density\"]> },\n onDensityChange: {\n type: Function as PropType<ToolbarExtrasSlotProps[\"onDensityChange\"]>,\n },\n labels: { type: Object as PropType<ToolbarExtrasSlotProps[\"labels\"]> },\n classNames: {\n type: Object as PropType<ToolbarExtrasSlotProps[\"classNames\"]>,\n },\n },\n }\n);\n","import type {\n CellEditHandler,\n StaticTableFeature,\n TableEditingOptions,\n TableFeature,\n} from \"@adapttable/vue\";\nimport {\n batchEditBarSlotKey,\n editableCellSlotKey,\n extendFeature,\n rowEditActionsSlotKey,\n slotRender,\n UNDO_REDO_CONTROL,\n} from \"@adapttable/vue/adapter\";\nimport {\n batchEditing as bindingBatchEditing,\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 } from \"@adapttable/vue/features\";\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"],"mappings":";;;;;;;;;;;;;;;;;;EAKA,MAAM,QAAQ;EAId,MAAM,OAAO;EACb,MAAM,WAAA,GAAU,IAAA,WAAA,CAA2B;EAC3C,SAAS,OAAO,OAAsB;GACpC,IACE,MAAM,QAAQ,KAAK,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A,GAC9CC,IAAAA,EAAAA,CAAEC,aAA2B,EAAE,GAAG,MAAM,CAAC,CAC3C;AACF;;AAGA,SAAgB,QACd,YACA,SAAuC,CAAC,GACpB;CACpB,QAAA,GAAOC,wBAAAA,cAAAA,EAAAA,GAAcC,yBAAAA,QAAAA,CAAe,YAAY,MAAM,GAAG,CAAC,SAAe,CAAC,CAAC;AAC7E;;AAGA,SAAgB,WACd,WACA,SAAuC,CAAC,GACpB;CACpB,QAAA,GAAOD,wBAAAA,cAAAA,EAAAA,GAAcE,yBAAAA,WAAAA,CAAkB,WAAW,MAAM,GAAG,CACzD,SAAe,IAAA,GACfN,wBAAAA,WAAAA,EAAAA,GAAWO,wBAAAA,sBAAAA,CAA4B,IAAI,WAAA,GACzCL,IAAAA,EAAAA,CAAEM,WAA6B,EAAE,GAAG,MAAM,CAAC,CAC7C,CACF,CAAC;AACH;;AAGA,SAAgB,aACd,aACA,SAAuC,CAAC,GACpB;CACpB,QAAA,GAAOJ,wBAAAA,cAAAA,EAAAA,GAAcK,yBAAAA,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"editing-BnLdNDlo.d.ts","names":[],"sources":["../src/editing/ElementEditableCell.vue","../src/editing/ElementBatchEditBar.vue","../src/editing/ElementRowEditActions.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YAAY,oBAAoB,uBAC7C,SAAQ,uBAAuB,QAC9B,aAAa;;iBA0BA,qBAAmB"}
1
+ {"version":3,"file":"editing-BnLdNDlo.d.ts","names":[],"sources":["../src/editing/ElementEditableCell.vue","../src/editing/ElementBatchEditBar.vue","../src/editing/ElementRowEditActions.vue","../src/editing.ts"],"mappings":";;;;cA6GM,iBAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,sBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAoFO,qBAAc,cAAc,sBAAmB,qBAAA,iBAA8B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,mBAAO;KACvB,sBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;cCpK9F,iBAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,sBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAmDO,qBAAc,cAAc,sBAAmB,kBAAA,iBAA8B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,mBAAO;KACvB,sBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;cChE9F,eAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,oBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAmDO,qBAAc,cAAc,oBAAmB,oBAAA,iBAA8B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,iBAAO;KACvB,oBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;;iBCrEpF,UAAQ,MACtB,YAAY,gBAAgB,OAC5B,SAAQ,uBAAuB,QAC9B,aAAa;;iBAKA,aAAW,MACzB,WAAW,YAAY,oBAAoB,qBAC3C,SAAQ,uBAAuB,QAC9B,aAAa;;iBAUA,eAAa,MAC3B,aAAa,YAAY,oBAAoB,uBAC7C,SAAQ,uBAAuB,QAC9B,aAAa;;iBA0BA,qBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"editing-Cg6ZNvSa.d.cts","names":[],"sources":["../src/editing/ElementEditableCell.vue","../src/editing/ElementBatchEditBar.vue","../src/editing/ElementRowEditActions.vue","../src/editing.ts"],"mappings":";;;;cAoFM,iBAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,sBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EA+EO,qBAAc,cAAc,sBAAmB,qBAAA,iBAA8B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,mBAAO;KACvB,sBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;cCtI9F,iBAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,sBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAmDO,qBAAc,cAAc,sBAAmB,kBAAA,iBAA8B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,mBAAO;KACvB,sBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;cChE9F,eAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,oBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAmDO,qBAAc,cAAc,oBAAmB,oBAAA,iBAA8B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,iBAAO;KACvB,oBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;;iBCrEpF,QAAQ,MACtB,YAAY,gBAAgB,OAC5B,SAAQ,uBAAuB,QAC9B,aAAa;;iBAKA,WAAW,MACzB,WAAW,YAAY,oBAAoB,qBAC3C,SAAQ,uBAAuB,QAC9B,aAAa;;iBAUA,aAAa,MAC3B,aAAa,YAAY,oBAAoB,uBAC7C,SAAQ,uBAAuB,QAC9B,aAAa;;iBA0BA,mBAAmB"}
1
+ {"version":3,"file":"editing-Cg6ZNvSa.d.cts","names":[],"sources":["../src/editing/ElementEditableCell.vue","../src/editing/ElementBatchEditBar.vue","../src/editing/ElementRowEditActions.vue","../src/editing.ts"],"mappings":";;;;cA6GM,iBAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,sBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAoFO,qBAAc,cAAc,sBAAmB,qBAAA,iBAA8B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,mBAAO;KACvB,sBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;cCpK9F,iBAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,sBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAmDO,qBAAc,cAAc,sBAAmB,kBAAA,iBAA8B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,mBAAO;KACvB,sBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;cChE9F,eAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,oBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAmDO,qBAAc,cAAc,oBAAmB,oBAAA,iBAA8B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,iBAAO;KACvB,oBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;;iBCrEpF,QAAQ,MACtB,YAAY,gBAAgB,OAC5B,SAAQ,uBAAuB,QAC9B,aAAa;;iBAKA,WAAW,MACzB,WAAW,YAAY,oBAAoB,qBAC3C,SAAQ,uBAAuB,QAC9B,aAAa;;iBAUA,aAAa,MAC3B,aAAa,YAAY,oBAAoB,uBAC7C,SAAQ,uBAAuB,QAC9B,aAAa;;iBA0BA,mBAAmB"}
@@ -220,8 +220,13 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
220
220
  const controls = {
221
221
  Activate: (control) => elementButton({
222
222
  title: control.title,
223
- "aria-label": control.title,
224
- class: [control.className, names.value.editCellActivate],
223
+ text: true,
224
+ "aria-description": control.title,
225
+ class: [
226
+ "adapttable-element-edit-value",
227
+ control.className,
228
+ names.value.editCellActivate
229
+ ],
225
230
  ref: control.activateRef,
226
231
  "data-adapttable-part": "edit-cell-activate",
227
232
  "data-save-status": control.saveStatus,
@@ -380,4 +385,4 @@ function undoRedoButtons$1() {
380
385
  //#endregion
381
386
  export { rowEditing$1 as a, _sfc_main$1 as c, editing$1 as i, _sfc_main$2 as l, dirtyIndicators as n, undoRedoButtons$1 as o, editHistory as r, _sfc_main as s, batchEditing$1 as t };
382
387
 
383
- //# sourceMappingURL=editing-C1Hy-MCQ.js.map
388
+ //# sourceMappingURL=editing-CohAxA65.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editing-CohAxA65.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 { ElOption, ElSelect, type SelectInstance } from \"element-plus\";\nimport { nextTick, 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 void nextTick(() => control.value?.$forceUpdate());\n}\ndefineExpose({\n focus: () => control.value?.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 useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n computed,\n createVNode,\n defineComponent,\n h,\n nextTick,\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 void nextTick(() => {\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.\nfunction ElementCellEditor<TRow>(\n props: EditableCellEditorProps<TRow> & { className?: string }\n) {\n return createVNode(ElementCellEditorPresentation, { ...props });\n}\nElementCellEditor.props = Object.keys(\n editorRuntimeProps\n) as (keyof typeof editorRuntimeProps)[];\nElementCellEditor.inheritAttrs = false;\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 props = withDefaults(defineProps<BatchEditBarProps<TRow>>(), {\n contested: undefined,\n});\nconst names = useClassNames();\nconst Render = () =>\n BatchEditBarChrome({\n ...props,\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 props = withDefaults(defineProps<RowEditActionsProps<TRow>>(), {\n showBegin: undefined,\n});\nconst names = useClassNames();\nconst Render = () =>\n RowEditActionsChrome({\n ...props,\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 ToolbarExtrasSlotProps,\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: ToolbarExtrasSlotProps) => {\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<ToolbarExtrasSlotProps[\"onUndo\"]> },\n onRedo: { type: Function as PropType<ToolbarExtrasSlotProps[\"onRedo\"]> },\n canUndo: {\n type: Boolean as PropType<ToolbarExtrasSlotProps[\"canUndo\"]>,\n default: undefined,\n },\n canRedo: {\n type: Boolean as PropType<ToolbarExtrasSlotProps[\"canRedo\"]>,\n default: undefined,\n },\n undoLabel: {\n type: String as PropType<ToolbarExtrasSlotProps[\"undoLabel\"]>,\n },\n redoLabel: {\n type: String as PropType<ToolbarExtrasSlotProps[\"redoLabel\"]>,\n },\n density: { type: String as PropType<ToolbarExtrasSlotProps[\"density\"]> },\n onDensityChange: {\n type: Function as PropType<ToolbarExtrasSlotProps[\"onDensityChange\"]>,\n },\n labels: { type: Object as PropType<ToolbarExtrasSlotProps[\"labels\"]> },\n classNames: {\n type: Object as PropType<ToolbarExtrasSlotProps[\"classNames\"]>,\n },\n },\n }\n);\n","import type {\n CellEditHandler,\n StaticTableFeature,\n TableEditingOptions,\n TableFeature,\n} from \"@adapttable/vue\";\nimport {\n batchEditBarSlotKey,\n editableCellSlotKey,\n extendFeature,\n rowEditActionsSlotKey,\n slotRender,\n UNDO_REDO_CONTROL,\n} from \"@adapttable/vue/adapter\";\nimport {\n batchEditing as bindingBatchEditing,\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 } from \"@adapttable/vue/features\";\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"],"mappings":";;;;;;;;;;;;;;;;;;;EAKA,MAAM,QAAQ;EAId,MAAM,OAAO;EACb,MAAM,UAAU,WAA2B;EAC3C,SAAS,OAAO,OAAsB;GACpC,IAC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F,CACF;;;AClBA,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"}
package/dist/editing.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_editing = require("./editing-BX-jUtdO.cjs");
2
+ const require_editing = require("./editing-BMtWRqqJ.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 rowEditing, c as _sfc_main, i as editing, l as _sfc_main$1, n as dirtyIndicators, o as undoRedoButtons, r as editHistory, s as _sfc_main$2, t as batchEditing } from "./editing-C1Hy-MCQ.js";
1
+ import { a as rowEditing, c as _sfc_main, i as editing, l as _sfc_main$1, n as dirtyIndicators, o as undoRedoButtons, r as editHistory, s as _sfc_main$2, t as batchEditing } from "./editing-CohAxA65.js";
2
2
  export { _sfc_main as ElementBatchEditBar, _sfc_main$1 as ElementEditableCell, _sfc_main$2 as ElementRowEditActions, batchEditing, dirtyIndicators, editHistory, editing, rowEditing, undoRedoButtons };
@@ -13,8 +13,16 @@ const ElementFilterChips = (0, vue.defineComponent)((props) => {
13
13
  ...props,
14
14
  classNames: names.value,
15
15
  slots: {
16
- Remove: ({ attrs }) => require_button.elementButton(attrs, "×"),
17
- Clear: ({ attrs, label }) => require_button.elementButton(attrs, label)
16
+ Remove: ({ attrs }) => require_button.elementButton({
17
+ ...attrs,
18
+ text: true,
19
+ size: "small"
20
+ }, "×"),
21
+ Clear: ({ attrs, label }) => require_button.elementButton({
22
+ ...attrs,
23
+ text: true,
24
+ size: "small"
25
+ }, label)
18
26
  }
19
27
  });
20
28
  }, {
@@ -198,4 +206,4 @@ Object.defineProperty(exports, "filters", {
198
206
  }
199
207
  });
200
208
 
201
- //# sourceMappingURL=filters-DOlxNQqE.cjs.map
209
+ //# sourceMappingURL=filters-2G3MfNF7.cjs.map