@adapttable/naive-ui 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 (128) hide show
  1. package/dist/{NaiveFilterSurface-DFoXPlGU.cjs → NaiveFilterSurface-BMG3PDjK.cjs} +4 -4
  2. package/dist/{NaiveFilterSurface-DFoXPlGU.cjs.map → NaiveFilterSurface-BMG3PDjK.cjs.map} +1 -1
  3. package/dist/{NaiveFilterSurface-DZKgJ6G_.js → NaiveFilterSurface-BnlW8DFz.js} +4 -4
  4. package/dist/{NaiveFilterSurface-DZKgJ6G_.js.map → NaiveFilterSurface-BnlW8DFz.js.map} +1 -1
  5. package/dist/{NaiveManagedPopover-BScsoUHh.cjs → NaiveManagedPopover-DhLEXdew.cjs} +2 -2
  6. package/dist/{NaiveManagedPopover-BScsoUHh.cjs.map → NaiveManagedPopover-DhLEXdew.cjs.map} +1 -1
  7. package/dist/{NaiveManagedPopover-DqSDYnef.js → NaiveManagedPopover-XhOSQEWC.js} +2 -2
  8. package/dist/{NaiveManagedPopover-DqSDYnef.js.map → NaiveManagedPopover-XhOSQEWC.js.map} +1 -1
  9. package/dist/{NaiveRowActions-BhgFAnM3.cjs → NaiveRowActions-D3J6uPSu.cjs} +2 -2
  10. package/dist/{NaiveRowActions-BhgFAnM3.cjs.map → NaiveRowActions-D3J6uPSu.cjs.map} +1 -1
  11. package/dist/{NaiveRowActions-BxDGoOKe.js → NaiveRowActions-DlDrl3Ed.js} +2 -2
  12. package/dist/{NaiveRowActions-BxDGoOKe.js.map → NaiveRowActions-DlDrl3Ed.js.map} +1 -1
  13. package/dist/assistant.cjs +13 -9
  14. package/dist/assistant.cjs.map +1 -1
  15. package/dist/assistant.d.cts.map +1 -1
  16. package/dist/assistant.d.ts.map +1 -1
  17. package/dist/assistant.js +14 -10
  18. package/dist/assistant.js.map +1 -1
  19. package/dist/batch-editing.cjs +1 -1
  20. package/dist/batch-editing.js +1 -1
  21. package/dist/bulk-actions.cjs +1 -1
  22. package/dist/bulk-actions.js +1 -1
  23. package/dist/{button-Cf1lslmX.js → button-BxXdDW7A.js} +2 -1
  24. package/dist/{button-Cf1lslmX.js.map → button-BxXdDW7A.js.map} +1 -1
  25. package/dist/{button-CVOchGam.cjs → button-CaakTzYM.cjs} +2 -1
  26. package/dist/{button-CVOchGam.cjs.map → button-CaakTzYM.cjs.map} +1 -1
  27. package/dist/cell-navigation.cjs +1 -1
  28. package/dist/cell-navigation.js +1 -1
  29. package/dist/{checkbox-Bu4Tl5TQ.cjs → checkbox-DcANe2ru.cjs} +2 -2
  30. package/dist/{checkbox-Bu4Tl5TQ.cjs.map → checkbox-DcANe2ru.cjs.map} +1 -1
  31. package/dist/{checkbox-CcYT0Q-6.js → checkbox-GQ0BLv13.js} +2 -2
  32. package/dist/{checkbox-CcYT0Q-6.js.map → checkbox-GQ0BLv13.js.map} +1 -1
  33. package/dist/{column-menu-Cd8Fm695.cjs → column-menu-Dh3hU7Vp.cjs} +5 -5
  34. package/dist/{column-menu-Cd8Fm695.cjs.map → column-menu-Dh3hU7Vp.cjs.map} +1 -1
  35. package/dist/{column-menu-B5xm8hhB.js → column-menu-kVdaXqiU.js} +5 -5
  36. package/dist/{column-menu-B5xm8hhB.js.map → column-menu-kVdaXqiU.js.map} +1 -1
  37. package/dist/column-menu.cjs +1 -1
  38. package/dist/column-menu.js +1 -1
  39. package/dist/command-palette.cjs +2 -2
  40. package/dist/command-palette.js +2 -2
  41. package/dist/context-menu.cjs +1 -1
  42. package/dist/context-menu.js +1 -1
  43. package/dist/{controls-ZeT4wgJ-.js → controls-BbSp1__U.js} +4 -4
  44. package/dist/{controls-ZeT4wgJ-.js.map → controls-BbSp1__U.js.map} +1 -1
  45. package/dist/{controls-D193740P.cjs → controls-BqcNuqAb.cjs} +2 -2
  46. package/dist/{controls-D193740P.cjs.map → controls-BqcNuqAb.cjs.map} +1 -1
  47. package/dist/{controls-Dp-hPfD4.js → controls-CheF2D5J.js} +2 -2
  48. package/dist/{controls-Dp-hPfD4.js.map → controls-CheF2D5J.js.map} +1 -1
  49. package/dist/{controls-Dj3k83WJ.cjs → controls-CovJN7Di.cjs} +4 -4
  50. package/dist/{controls-Dj3k83WJ.cjs.map → controls-CovJN7Di.cjs.map} +1 -1
  51. package/dist/{editing-BsaH2gDF.js → editing-BZFBs7GP.js} +5 -5
  52. package/dist/editing-BZFBs7GP.js.map +1 -0
  53. package/dist/{editing-BKNxRBEo.cjs → editing-CbNASsOY.cjs} +5 -5
  54. package/dist/editing-CbNASsOY.cjs.map +1 -0
  55. package/dist/editing.cjs +1 -1
  56. package/dist/editing.js +1 -1
  57. package/dist/export.cjs +1 -1
  58. package/dist/export.js +1 -1
  59. package/dist/{filters-BqymR1RY.cjs → filters-CCiha_tj.cjs} +5 -5
  60. package/dist/{filters-BqymR1RY.cjs.map → filters-CCiha_tj.cjs.map} +1 -1
  61. package/dist/{filters-i_dmiQO_.js → filters-CV7NPw4D.js} +5 -5
  62. package/dist/{filters-i_dmiQO_.js.map → filters-CV7NPw4D.js.map} +1 -1
  63. package/dist/filters.cjs +2 -2
  64. package/dist/filters.js +2 -2
  65. package/dist/find-in-table.cjs +2 -2
  66. package/dist/find-in-table.js +2 -2
  67. package/dist/fullscreen.cjs +1 -1
  68. package/dist/fullscreen.js +1 -1
  69. package/dist/grouping-panel.cjs +10 -7
  70. package/dist/grouping-panel.cjs.map +1 -1
  71. package/dist/grouping-panel.js +10 -7
  72. package/dist/grouping-panel.js.map +1 -1
  73. package/dist/grouping.cjs +3 -3
  74. package/dist/grouping.cjs.map +1 -1
  75. package/dist/grouping.js +3 -3
  76. package/dist/grouping.js.map +1 -1
  77. package/dist/{header-filters-WYusPMig.cjs → header-filters-Dc94qhxq.cjs} +5 -5
  78. package/dist/{header-filters-WYusPMig.cjs.map → header-filters-Dc94qhxq.cjs.map} +1 -1
  79. package/dist/{header-filters-C6K_Y6Sa.js → header-filters-vT9O5T_C.js} +5 -5
  80. package/dist/{header-filters-C6K_Y6Sa.js.map → header-filters-vT9O5T_C.js.map} +1 -1
  81. package/dist/header-filters.cjs +1 -1
  82. package/dist/header-filters.js +1 -1
  83. package/dist/index.cjs +6 -4
  84. package/dist/index.cjs.map +1 -1
  85. package/dist/index.js +6 -4
  86. package/dist/index.js.map +1 -1
  87. package/dist/{input-Cgm2r2YC.cjs → input-DPQy4L2b.cjs} +2 -2
  88. package/dist/{input-Cgm2r2YC.cjs.map → input-DPQy4L2b.cjs.map} +1 -1
  89. package/dist/{input-l5DTkb1E.js → input-DZI_oY9v.js} +2 -2
  90. package/dist/{input-l5DTkb1E.js.map → input-DZI_oY9v.js.map} +1 -1
  91. package/dist/{mobile-52C0B3aN.cjs → mobile-Bc3-31-b.cjs} +4 -4
  92. package/dist/mobile-Bc3-31-b.cjs.map +1 -0
  93. package/dist/{mobile-298ixM-b.js → mobile-Dlwq8dB7.js} +4 -4
  94. package/dist/mobile-Dlwq8dB7.js.map +1 -0
  95. package/dist/pivot.cjs +2 -2
  96. package/dist/pivot.js +2 -2
  97. package/dist/preset.cjs +4 -4
  98. package/dist/preset.js +4 -4
  99. package/dist/print.cjs +1 -1
  100. package/dist/print.js +1 -1
  101. package/dist/renderers.cjs +1 -1
  102. package/dist/renderers.js +1 -1
  103. package/dist/row-actions.cjs +1 -1
  104. package/dist/row-actions.js +1 -1
  105. package/dist/row-pinning.cjs +1 -1
  106. package/dist/row-pinning.js +1 -1
  107. package/dist/row-reorder.cjs +2 -2
  108. package/dist/row-reorder.js +2 -2
  109. package/dist/{saved-views-CRyxrATI.cjs → saved-views-BSZ9y-_E.cjs} +4 -4
  110. package/dist/{saved-views-CRyxrATI.cjs.map → saved-views-BSZ9y-_E.cjs.map} +1 -1
  111. package/dist/{saved-views-BO5_w40C.js → saved-views-CdJjkWzt.js} +4 -4
  112. package/dist/{saved-views-BO5_w40C.js.map → saved-views-CdJjkWzt.js.map} +1 -1
  113. package/dist/saved-views.cjs +1 -1
  114. package/dist/saved-views.js +1 -1
  115. package/dist/{select-BSo8XTMg.js → select-Bgc5ttop.js} +2 -2
  116. package/dist/{select-BSo8XTMg.js.map → select-Bgc5ttop.js.map} +1 -1
  117. package/dist/{select-ChoLy-Ja.cjs → select-C8UKnsWO.cjs} +2 -2
  118. package/dist/{select-ChoLy-Ja.cjs.map → select-C8UKnsWO.cjs.map} +1 -1
  119. package/dist/side-panel.cjs +1 -1
  120. package/dist/side-panel.js +1 -1
  121. package/dist/status-bar.cjs +1 -1
  122. package/dist/status-bar.js +1 -1
  123. package/dist/styles.css +261 -0
  124. package/package.json +3 -3
  125. package/dist/editing-BKNxRBEo.cjs.map +0 -1
  126. package/dist/editing-BsaH2gDF.js.map +0 -1
  127. package/dist/mobile-298ixM-b.js.map +0 -1
  128. package/dist/mobile-52C0B3aN.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"assistant.cjs","names":["naiveButton","h","NCard","defineComponent","useScopeActivity","shallowRef","createMenuNavigation","nextTick","htmlRoot","NPopover","defineComponent","useScopeActivity","h","NDrawer","NDrawerContent","h","NCard","naiveButton","naiveInput","NTag","naiveSelect","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 createMenuNavigation,\n type TableAssistantMenuProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { NCard, NPopover } from \"naive-ui\";\nimport {\n type ComponentPublicInstance,\n defineComponent,\n h,\n nextTick,\n type PropType,\n type ShallowRef,\n shallowRef,\n watch,\n} from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { htmlRoot } from \"../controls/elementTarget\";\n\n/** One shortcut as a menu item: its icon, title and optional description. */\nfunction shortcut(\n item: TableAssistantMenuProps[\"items\"][number],\n choose: (id: string) => void\n) {\n return naiveButton(\n {\n key: item.id,\n role: \"menuitem\",\n tabindex: -1,\n \"data-adapttable-part\": item.part,\n class: \"adapttable-naive-assistant-shortcut\",\n onClick: () => choose(item.id),\n },\n [\n item.icon,\n h(\"span\", [\n h(\"strong\", item.title),\n item.description ? h(\"small\", item.description) : null,\n ]),\n ],\n { text: true }\n );\n}\n\n/** The open menu: a Naive UI card holding one menu item per shortcut. */\nfunction menuCard(\n props: TableAssistantMenuProps,\n card: ShallowRef<ComponentPublicInstance | null>,\n keydown: (event: KeyboardEvent) => void,\n choose: (id: string) => void\n) {\n const items = props.items.map((item) => shortcut(item, choose));\n return h(\n NCard,\n {\n ref: card,\n size: \"small\",\n role: \"menu\",\n \"aria-label\": props.label,\n class: \"adapttable-naive-assistant-menu\",\n contentStyle: { display: \"flex\", flexDirection: \"column\", gap: \"4px\" },\n style: { maxHeight: props.maxHeight, overflowY: \"auto\" },\n onKeydown: keydown,\n },\n { default: () => items }\n );\n}\n\n/**\n * The assistant's shortcuts in a Naive UI popover menu under its trigger.\n * The shared menu navigation moves focus; Escape and Tab close the menu and\n * Escape returns focus to the trigger.\n */\nexport const NaiveExamplesMenu = defineComponent(\n (props: TableAssistantMenuProps) => {\n const active = useScopeActivity();\n const open = shallowRef(false);\n const trigger = shallowRef<HTMLElement | null>(null);\n const card = shallowRef<ComponentPublicInstance | null>(null);\n const navigation = createMenuNavigation();\n let generation = 0;\n watch(\n [active, () => props.disabled, () => props.items, () => props.onSelect],\n () => {\n generation++;\n open.value = false;\n },\n { flush: \"sync\" }\n );\n watch(open, (expanded) => {\n navigation.reset();\n if (!expanded) return;\n void nextTick(() => {\n const panel = card.value ? htmlRoot(card.value) : null;\n panel\n ?.querySelector<HTMLElement>('[role=\"menuitem\"]')\n ?.focus({ preventScroll: true });\n });\n });\n const close = (restore: boolean) => {\n open.value = false;\n if (restore) trigger.value?.focus({ preventScroll: true });\n };\n const keydown = (event: KeyboardEvent) => {\n const panel = event.currentTarget;\n if (!(panel instanceof HTMLElement)) return;\n const items = [\n ...panel.querySelectorAll<HTMLButtonElement>('[role=\"menuitem\"]'),\n ];\n const focusTargets: readonly (EventTarget | null | undefined)[] = items;\n const action = navigation.key(\n event,\n items.map((item) => ({\n label: item.textContent ?? \"\",\n disabled: item.disabled,\n })),\n focusTargets.indexOf(panel.ownerDocument.activeElement)\n );\n if (!action) return;\n if (action.kind !== \"close\" || action.key !== \"Tab\")\n event.preventDefault();\n event.stopPropagation();\n if (action.kind === \"close\") close(action.key === \"Escape\");\n else items[action.index]?.focus({ preventScroll: true });\n };\n return () => {\n if (!active.value) return null;\n const ticket = generation;\n const choose = (id: string) => {\n if (\n !active.value ||\n props.disabled ||\n ticket !== generation ||\n !props.items.some((item) => item.id === id)\n )\n return;\n close(false);\n props.onSelect(id);\n };\n return h(\n NPopover,\n {\n trigger: \"manual\",\n show: open.value,\n placement: \"bottom-start\",\n showArrow: false,\n raw: true,\n onClickoutside: (event: MouseEvent) => {\n if (\n event.target instanceof Node &&\n trigger.value?.contains(event.target)\n )\n return;\n close(false);\n },\n },\n {\n trigger: () =>\n naiveButton(\n {\n ref: (element: HTMLElement | null) => {\n trigger.value = element;\n },\n disabled: props.disabled,\n \"aria-label\": props.label,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": open.value,\n title: props.label,\n class: props.className,\n \"data-adapttable-part\": props.part,\n onClick: () => {\n if (active.value && !props.disabled) open.value = !open.value;\n },\n },\n [props.icon, props.label]\n ),\n default: () => menuCard(props, card, keydown, choose),\n }\n );\n };\n },\n {\n name: \"NaiveExamplesMenu\",\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 { NDrawer, NDrawerContent } from \"naive-ui\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\n/**\n * Chrome chooses initial and return focus; NDrawer contains focus and owns\n * the portal. Escape and mask dismissal become one close request to the\n * host, and the drawer stays open until the host closes it.\n */\nexport const NaiveAssistantSheet = defineComponent(\n (props: TableAssistantSheetProps) => {\n const active = useScopeActivity();\n const requestClose = () => {\n if (active.value && props.open) props.onClose();\n };\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 NDrawer,\n {\n show: props.open,\n placement: props.dir === \"rtl\" ? \"left\" : \"right\",\n width: \"min(28rem, 100vw)\",\n autoFocus: false,\n closeOnEsc: false,\n maskClosable: false,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n \"aria-label\": props.label,\n dir: props.dir,\n class: [\"adapttable-naive-assistant-sheet\", props.className],\n \"data-adapttable-part\": props.part,\n onKeydown: keydown,\n onMaskClick: requestClose,\n },\n {\n default: () =>\n h(NDrawerContent, {}, { default: () => props.children }),\n }\n );\n };\n },\n {\n name: \"NaiveAssistantSheet\",\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 { NCard, NTag } from \"naive-ui\";\nimport { h, type StyleValue, type VNodeChild } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { naiveInput } from \"../controls/input\";\nimport { naiveSelect } from \"../controls/select\";\nimport { NaiveExamplesMenu } from \"./ExamplesMenu\";\nimport { NaiveAssistantSheet } from \"./Sheet\";\n\n/** Naive UI tag types for the assistant's status tones. */\nconst TAG_TYPE = {\n neutral: \"default\",\n busy: \"info\",\n warning: \"warning\",\n danger: \"error\",\n} as const;\n\nconst surface = (\n props: {\n readonly part: string;\n readonly label: string;\n readonly children: VNodeChild;\n readonly style?: StyleValue;\n },\n classes: readonly (string | undefined)[]\n) =>\n h(\n NCard,\n {\n size: \"small\",\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: classes,\n style: props.style,\n contentStyle: { display: \"flex\", flexDirection: \"column\", minHeight: 0 },\n },\n { default: () => props.children }\n );\n\nexport const naiveAssistantControls: TableAssistantSlots = {\n Button: (props) =>\n naiveButton(\n {\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 { size: props.part === \"assistant-launcher\" ? \"medium\" : \"small\" }\n ),\n Composer: (props) =>\n naiveInput({\n type: \"textarea\",\n value: props.value,\n attrs: {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n placeholder: props.placeholder,\n class: props.className,\n disabled: props.disabled,\n rows: 2,\n onKeydown: props.onKeyDown,\n },\n onChange: props.onChange,\n }),\n Badge: (props) =>\n h(\n NTag,\n {\n \"data-adapttable-part\": props.part,\n \"data-tone\": props.tone,\n type: TAG_TYPE[props.tone],\n size: \"small\",\n bordered: false,\n class: props.className,\n },\n { default: () => props.label }\n ),\n Panel: (props) =>\n surface(props, [\"adapttable-naive-assistant-panel\", props.className]),\n Window: (props) =>\n surface(props, [\"adapttable-naive-assistant-window\", props.className]),\n Sheet: (props) => h(NaiveAssistantSheet, { ...props, key: props.part }),\n Menu: (props) => h(NaiveExamplesMenu, props),\n LanguageChip: (props) =>\n naiveSelect({\n attrs: {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: props.className,\n disabled: props.disabled,\n },\n value: props.value,\n options: props.options,\n onChange: props.onChange,\n }),\n};\n\nexport const naiveApprovalControls: ApprovalReviewSlots = {\n Approve: naiveAssistantControls.Button,\n Reject: naiveAssistantControls.Button,\n Action: naiveAssistantControls.Button,\n List: (props) =>\n h(\n \"ul\",\n {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-naive-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 naiveApprovalControls,\n naiveAssistantControls,\n} from \"./assistant/controls\";\n\nexport const TableAssistant = defineComponent(\n (props: TableAssistantProps) => () =>\n h(TableAssistantChrome, { ...props, slots: naiveAssistantControls }),\n {\n name: \"NaiveTableAssistant\",\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: naiveApprovalControls }),\n {\n name: \"NaiveAgentApproval\",\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":";;;;;;;;;AAqBA,SAAS,SACP,MACA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wBAAAA,mCAAAA,EAAoC,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
+ {"version":3,"file":"assistant.cjs","names":["naiveButton","h","NCard","defineComponent","useScopeActivity","shallowRef","createMenuNavigation","nextTick","htmlRoot","NPopover","defineComponent","useScopeActivity","h","NDrawer","NDrawerContent","h","NCard","naiveButton","naiveInput","NTag","naiveSelect","defineComponent","useThemeVars","h","TableAssistantChrome","AgentApprovalChrome","createAdapterTableAssistantFeature","createAdapterAgentApprovalFeature"],"sources":["../src/assistant/ExamplesMenu.ts","../src/assistant/Sheet.ts","../src/assistant/controls.ts","../src/assistant.ts"],"sourcesContent":["import {\n createMenuNavigation,\n type TableAssistantMenuProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { NCard, NPopover } from \"naive-ui\";\nimport {\n type ComponentPublicInstance,\n defineComponent,\n h,\n nextTick,\n type PropType,\n type ShallowRef,\n shallowRef,\n watch,\n} from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { htmlRoot } from \"../controls/elementTarget\";\n\n/** One shortcut as a menu item: its icon, title and optional description. */\nfunction shortcut(\n item: TableAssistantMenuProps[\"items\"][number],\n choose: (id: string) => void\n) {\n return naiveButton(\n {\n key: item.id,\n role: \"menuitem\",\n tabindex: -1,\n \"data-adapttable-part\": item.part,\n class: \"adapttable-naive-assistant-shortcut\",\n onClick: () => choose(item.id),\n },\n [\n item.icon,\n h(\"span\", [\n h(\"strong\", item.title),\n item.description ? h(\"small\", item.description) : null,\n ]),\n ],\n { text: true }\n );\n}\n\n/** The open menu: a Naive UI card holding one menu item per shortcut. */\nfunction menuCard(\n props: TableAssistantMenuProps,\n card: ShallowRef<ComponentPublicInstance | null>,\n keydown: (event: KeyboardEvent) => void,\n choose: (id: string) => void\n) {\n const items = props.items.map((item) => shortcut(item, choose));\n return h(\n NCard,\n {\n ref: card,\n size: \"small\",\n role: \"menu\",\n \"aria-label\": props.label,\n class: \"adapttable-naive-assistant-menu\",\n contentStyle: { display: \"flex\", flexDirection: \"column\", gap: \"4px\" },\n style: { maxHeight: props.maxHeight, overflowY: \"auto\" },\n onKeydown: keydown,\n },\n { default: () => items }\n );\n}\n\n/**\n * The assistant's shortcuts in a Naive UI popover menu under its trigger.\n * The shared menu navigation moves focus; Escape and Tab close the menu and\n * Escape returns focus to the trigger.\n */\nexport const NaiveExamplesMenu = defineComponent(\n (props: TableAssistantMenuProps) => {\n const active = useScopeActivity();\n const open = shallowRef(false);\n const trigger = shallowRef<HTMLElement | null>(null);\n const card = shallowRef<ComponentPublicInstance | null>(null);\n const navigation = createMenuNavigation();\n let generation = 0;\n watch(\n [active, () => props.disabled, () => props.items, () => props.onSelect],\n () => {\n generation++;\n open.value = false;\n },\n { flush: \"sync\" }\n );\n watch(open, (expanded) => {\n navigation.reset();\n if (!expanded) return;\n void nextTick(() => {\n const panel = card.value ? htmlRoot(card.value) : null;\n panel\n ?.querySelector<HTMLElement>('[role=\"menuitem\"]')\n ?.focus({ preventScroll: true });\n });\n });\n const close = (restore: boolean) => {\n open.value = false;\n if (restore) trigger.value?.focus({ preventScroll: true });\n };\n const keydown = (event: KeyboardEvent) => {\n const panel = event.currentTarget;\n if (!(panel instanceof HTMLElement)) return;\n const items = [\n ...panel.querySelectorAll<HTMLButtonElement>('[role=\"menuitem\"]'),\n ];\n const focusTargets: readonly (EventTarget | null | undefined)[] = items;\n const action = navigation.key(\n event,\n items.map((item) => ({\n label: item.textContent ?? \"\",\n disabled: item.disabled,\n })),\n focusTargets.indexOf(panel.ownerDocument.activeElement)\n );\n if (!action) return;\n if (action.kind !== \"close\" || action.key !== \"Tab\")\n event.preventDefault();\n event.stopPropagation();\n if (action.kind === \"close\") close(action.key === \"Escape\");\n else items[action.index]?.focus({ preventScroll: true });\n };\n return () => {\n if (!active.value) return null;\n const ticket = generation;\n const choose = (id: string) => {\n if (\n !active.value ||\n props.disabled ||\n ticket !== generation ||\n !props.items.some((item) => item.id === id)\n )\n return;\n close(false);\n props.onSelect(id);\n };\n return h(\n NPopover,\n {\n trigger: \"manual\",\n show: open.value,\n placement: \"bottom-start\",\n showArrow: false,\n raw: true,\n onClickoutside: (event: MouseEvent) => {\n if (\n event.target instanceof Node &&\n trigger.value?.contains(event.target)\n )\n return;\n close(false);\n },\n },\n {\n trigger: () =>\n naiveButton(\n {\n ref: (element: HTMLElement | null) => {\n trigger.value = element;\n },\n disabled: props.disabled,\n \"aria-label\": props.label,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": open.value,\n title: props.label,\n class: props.className,\n \"data-adapttable-part\": props.part,\n onClick: () => {\n if (active.value && !props.disabled) open.value = !open.value;\n },\n },\n [props.icon ?? props.label]\n ),\n default: () => menuCard(props, card, keydown, choose),\n }\n );\n };\n },\n {\n name: \"NaiveExamplesMenu\",\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 { NDrawer, NDrawerContent } from \"naive-ui\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\n/**\n * Chrome chooses initial and return focus; NDrawer contains focus and owns\n * the portal. Escape and mask dismissal become one close request to the\n * host, and the drawer stays open until the host closes it.\n */\nexport const NaiveAssistantSheet = defineComponent(\n (props: TableAssistantSheetProps) => {\n const active = useScopeActivity();\n const requestClose = () => {\n if (active.value && props.open) props.onClose();\n };\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 NDrawer,\n {\n show: props.open,\n placement: props.dir === \"rtl\" ? \"left\" : \"right\",\n width: \"min(28rem, 100vw)\",\n autoFocus: false,\n closeOnEsc: false,\n maskClosable: false,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n \"aria-label\": props.label,\n dir: props.dir,\n class: [\"adapttable-naive-assistant-sheet\", props.className],\n \"data-adapttable-part\": props.part,\n onKeydown: keydown,\n onMaskClick: requestClose,\n },\n {\n default: () =>\n h(NDrawerContent, {}, { default: () => props.children }),\n }\n );\n };\n },\n {\n name: \"NaiveAssistantSheet\",\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 { NCard, NTag } from \"naive-ui\";\nimport { h, type StyleValue, type VNodeChild } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { naiveInput } from \"../controls/input\";\nimport { naiveSelect } from \"../controls/select\";\nimport { NaiveExamplesMenu } from \"./ExamplesMenu\";\nimport { NaiveAssistantSheet } from \"./Sheet\";\n\n/** Naive UI tag types for the assistant's status tones. */\nconst TAG_TYPE = {\n neutral: \"default\",\n busy: \"info\",\n warning: \"warning\",\n danger: \"error\",\n} as const;\n\nconst surface = (\n props: {\n readonly part: string;\n readonly label: string;\n readonly children: VNodeChild;\n readonly style?: StyleValue;\n },\n classes: readonly (string | undefined)[]\n) =>\n h(\n NCard,\n {\n size: \"small\",\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: classes,\n style: props.style,\n contentStyle: { display: \"flex\", flexDirection: \"column\", minHeight: 0 },\n },\n { default: () => props.children }\n );\n\nexport const naiveAssistantControls: TableAssistantSlots = {\n Button: (props) =>\n naiveButton(\n {\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 { size: props.part === \"assistant-launcher\" ? \"medium\" : \"small\" }\n ),\n Composer: (props) =>\n naiveInput({\n type: \"textarea\",\n value: props.value,\n attrs: {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n placeholder: props.placeholder,\n class: props.className,\n disabled: props.disabled,\n rows: 1,\n onKeydown: props.onKeyDown,\n },\n onChange: props.onChange,\n }),\n Badge: (props) =>\n h(\n NTag,\n {\n \"data-adapttable-part\": props.part,\n \"data-tone\": props.tone,\n type: TAG_TYPE[props.tone],\n size: \"small\",\n bordered: false,\n class: props.className,\n },\n { default: () => props.label }\n ),\n Panel: (props) =>\n surface(props, [\"adapttable-naive-assistant-panel\", props.className]),\n Window: (props) =>\n surface(props, [\"adapttable-naive-assistant-window\", props.className]),\n Sheet: (props) => h(NaiveAssistantSheet, { ...props, key: props.part }),\n Menu: (props) => h(NaiveExamplesMenu, props),\n LanguageChip: (props) =>\n naiveSelect({\n attrs: {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: props.className,\n disabled: props.disabled,\n },\n value: props.value,\n options: props.options,\n onChange: props.onChange,\n }),\n};\n\nexport const naiveApprovalControls: ApprovalReviewSlots = {\n Approve: naiveAssistantControls.Button,\n Reject: naiveAssistantControls.Button,\n Action: naiveAssistantControls.Button,\n List: (props) =>\n h(\n \"ul\",\n {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-naive-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 { useThemeVars } from \"naive-ui\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport {\n naiveApprovalControls,\n naiveAssistantControls,\n} from \"./assistant/controls\";\n\nexport const TableAssistant = defineComponent(\n (props: TableAssistantProps) => {\n const theme = useThemeVars();\n return () =>\n h(TableAssistantChrome, {\n ...props,\n accent: props.accent ?? theme.value.primaryColor,\n slots: naiveAssistantControls,\n });\n },\n {\n name: \"NaiveTableAssistant\",\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: naiveApprovalControls }),\n {\n name: \"NaiveAgentApproval\",\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":";;;;;;;;;AAqBA,SAAS,SACP,MACA,QACA;CACA,OAAOA,eAAAA,YACL;EACE,KAAK,KAAK;EACV,MAAM;EACN,UAAU;EACV,wBAAwB,KAAK;EAC7B,OAAO;EACP,eAAe,OAAO,KAAK,EAAE;CAC/B,GACA,CACE,KAAK,OAAA,GACLC,IAAAA,EAAAA,CAAE,QAAQ,EAAA,GACRA,IAAAA,E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,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":";;;cAoBa,8BAAc,uBAAA,+BAAA,0CAAA;cAqDd,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":";;;cAoBa,8BAAc,uBAAA,+BAAA,0CAAA;cAqDd,6BAAa,uBAAA,8BAAA,yCAAA;iBAeV,kBAAkB;iBAKlB,iBAAiB"}
package/dist/assistant.js CHANGED
@@ -1,9 +1,9 @@
1
- import { r as htmlRoot, t as naiveButton } from "./button-Cf1lslmX.js";
2
- import { t as naiveInput } from "./input-l5DTkb1E.js";
3
- import { t as naiveSelect } from "./select-BSo8XTMg.js";
1
+ import { r as htmlRoot, t as naiveButton } from "./button-BxXdDW7A.js";
2
+ import { t as naiveInput } from "./input-DZI_oY9v.js";
3
+ import { t as naiveSelect } from "./select-Bgc5ttop.js";
4
4
  import { AgentApprovalChrome, TableAssistantChrome, createAdapterAgentApprovalFeature, createAdapterTableAssistantFeature, createMenuNavigation, useScopeActivity } from "@adapttable/vue/adapter";
5
5
  import { defineComponent, h, nextTick, shallowRef, watch } from "vue";
6
- import { NCard, NDrawer, NDrawerContent, NPopover, NTag } from "naive-ui";
6
+ import { NCard, NDrawer, NDrawerContent, NPopover, NTag, useThemeVars } from "naive-ui";
7
7
  //#region src/assistant/ExamplesMenu.ts
8
8
  /** One shortcut as a menu item: its icon, title and optional description. */
9
9
  function shortcut(item, choose) {
@@ -117,7 +117,7 @@ const NaiveExamplesMenu = defineComponent((props) => {
117
117
  onClick: () => {
118
118
  if (active.value && !props.disabled) open.value = !open.value;
119
119
  }
120
- }, [props.icon, props.label]),
120
+ }, [props.icon ?? props.label]),
121
121
  default: () => menuCard(props, card, keydown, choose)
122
122
  });
123
123
  };
@@ -248,7 +248,7 @@ const naiveAssistantControls = {
248
248
  placeholder: props.placeholder,
249
249
  class: props.className,
250
250
  disabled: props.disabled,
251
- rows: 2,
251
+ rows: 1,
252
252
  onKeydown: props.onKeyDown
253
253
  },
254
254
  onChange: props.onChange
@@ -292,10 +292,14 @@ const naiveApprovalControls = {
292
292
  };
293
293
  //#endregion
294
294
  //#region src/assistant.ts
295
- const TableAssistant = defineComponent((props) => () => h(TableAssistantChrome, {
296
- ...props,
297
- slots: naiveAssistantControls
298
- }), {
295
+ const TableAssistant = defineComponent((props) => {
296
+ const theme = useThemeVars();
297
+ return () => h(TableAssistantChrome, {
298
+ ...props,
299
+ accent: props.accent ?? theme.value.primaryColor,
300
+ slots: naiveAssistantControls
301
+ });
302
+ }, {
299
303
  name: "NaiveTableAssistant",
300
304
  props: {
301
305
  assistant: { type: Object },
@@ -1 +1 @@
1
- {"version":3,"file":"assistant.js","names":[],"sources":["../src/assistant/ExamplesMenu.ts","../src/assistant/Sheet.ts","../src/assistant/controls.ts","../src/assistant.ts"],"sourcesContent":["import {\n createMenuNavigation,\n type TableAssistantMenuProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { NCard, NPopover } from \"naive-ui\";\nimport {\n type ComponentPublicInstance,\n defineComponent,\n h,\n nextTick,\n type PropType,\n type ShallowRef,\n shallowRef,\n watch,\n} from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { htmlRoot } from \"../controls/elementTarget\";\n\n/** One shortcut as a menu item: its icon, title and optional description. */\nfunction shortcut(\n item: TableAssistantMenuProps[\"items\"][number],\n choose: (id: string) => void\n) {\n return naiveButton(\n {\n key: item.id,\n role: \"menuitem\",\n tabindex: -1,\n \"data-adapttable-part\": item.part,\n class: \"adapttable-naive-assistant-shortcut\",\n onClick: () => choose(item.id),\n },\n [\n item.icon,\n h(\"span\", [\n h(\"strong\", item.title),\n item.description ? h(\"small\", item.description) : null,\n ]),\n ],\n { text: true }\n );\n}\n\n/** The open menu: a Naive UI card holding one menu item per shortcut. */\nfunction menuCard(\n props: TableAssistantMenuProps,\n card: ShallowRef<ComponentPublicInstance | null>,\n keydown: (event: KeyboardEvent) => void,\n choose: (id: string) => void\n) {\n const items = props.items.map((item) => shortcut(item, choose));\n return h(\n NCard,\n {\n ref: card,\n size: \"small\",\n role: \"menu\",\n \"aria-label\": props.label,\n class: \"adapttable-naive-assistant-menu\",\n contentStyle: { display: \"flex\", flexDirection: \"column\", gap: \"4px\" },\n style: { maxHeight: props.maxHeight, overflowY: \"auto\" },\n onKeydown: keydown,\n },\n { default: () => items }\n );\n}\n\n/**\n * The assistant's shortcuts in a Naive UI popover menu under its trigger.\n * The shared menu navigation moves focus; Escape and Tab close the menu and\n * Escape returns focus to the trigger.\n */\nexport const NaiveExamplesMenu = defineComponent(\n (props: TableAssistantMenuProps) => {\n const active = useScopeActivity();\n const open = shallowRef(false);\n const trigger = shallowRef<HTMLElement | null>(null);\n const card = shallowRef<ComponentPublicInstance | null>(null);\n const navigation = createMenuNavigation();\n let generation = 0;\n watch(\n [active, () => props.disabled, () => props.items, () => props.onSelect],\n () => {\n generation++;\n open.value = false;\n },\n { flush: \"sync\" }\n );\n watch(open, (expanded) => {\n navigation.reset();\n if (!expanded) return;\n void nextTick(() => {\n const panel = card.value ? htmlRoot(card.value) : null;\n panel\n ?.querySelector<HTMLElement>('[role=\"menuitem\"]')\n ?.focus({ preventScroll: true });\n });\n });\n const close = (restore: boolean) => {\n open.value = false;\n if (restore) trigger.value?.focus({ preventScroll: true });\n };\n const keydown = (event: KeyboardEvent) => {\n const panel = event.currentTarget;\n if (!(panel instanceof HTMLElement)) return;\n const items = [\n ...panel.querySelectorAll<HTMLButtonElement>('[role=\"menuitem\"]'),\n ];\n const focusTargets: readonly (EventTarget | null | undefined)[] = items;\n const action = navigation.key(\n event,\n items.map((item) => ({\n label: item.textContent ?? \"\",\n disabled: item.disabled,\n })),\n focusTargets.indexOf(panel.ownerDocument.activeElement)\n );\n if (!action) return;\n if (action.kind !== \"close\" || action.key !== \"Tab\")\n event.preventDefault();\n event.stopPropagation();\n if (action.kind === \"close\") close(action.key === \"Escape\");\n else items[action.index]?.focus({ preventScroll: true });\n };\n return () => {\n if (!active.value) return null;\n const ticket = generation;\n const choose = (id: string) => {\n if (\n !active.value ||\n props.disabled ||\n ticket !== generation ||\n !props.items.some((item) => item.id === id)\n )\n return;\n close(false);\n props.onSelect(id);\n };\n return h(\n NPopover,\n {\n trigger: \"manual\",\n show: open.value,\n placement: \"bottom-start\",\n showArrow: false,\n raw: true,\n onClickoutside: (event: MouseEvent) => {\n if (\n event.target instanceof Node &&\n trigger.value?.contains(event.target)\n )\n return;\n close(false);\n },\n },\n {\n trigger: () =>\n naiveButton(\n {\n ref: (element: HTMLElement | null) => {\n trigger.value = element;\n },\n disabled: props.disabled,\n \"aria-label\": props.label,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": open.value,\n title: props.label,\n class: props.className,\n \"data-adapttable-part\": props.part,\n onClick: () => {\n if (active.value && !props.disabled) open.value = !open.value;\n },\n },\n [props.icon, props.label]\n ),\n default: () => menuCard(props, card, keydown, choose),\n }\n );\n };\n },\n {\n name: \"NaiveExamplesMenu\",\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 { NDrawer, NDrawerContent } from \"naive-ui\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\n/**\n * Chrome chooses initial and return focus; NDrawer contains focus and owns\n * the portal. Escape and mask dismissal become one close request to the\n * host, and the drawer stays open until the host closes it.\n */\nexport const NaiveAssistantSheet = defineComponent(\n (props: TableAssistantSheetProps) => {\n const active = useScopeActivity();\n const requestClose = () => {\n if (active.value && props.open) props.onClose();\n };\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 NDrawer,\n {\n show: props.open,\n placement: props.dir === \"rtl\" ? \"left\" : \"right\",\n width: \"min(28rem, 100vw)\",\n autoFocus: false,\n closeOnEsc: false,\n maskClosable: false,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n \"aria-label\": props.label,\n dir: props.dir,\n class: [\"adapttable-naive-assistant-sheet\", props.className],\n \"data-adapttable-part\": props.part,\n onKeydown: keydown,\n onMaskClick: requestClose,\n },\n {\n default: () =>\n h(NDrawerContent, {}, { default: () => props.children }),\n }\n );\n };\n },\n {\n name: \"NaiveAssistantSheet\",\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 { NCard, NTag } from \"naive-ui\";\nimport { h, type StyleValue, type VNodeChild } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { naiveInput } from \"../controls/input\";\nimport { naiveSelect } from \"../controls/select\";\nimport { NaiveExamplesMenu } from \"./ExamplesMenu\";\nimport { NaiveAssistantSheet } from \"./Sheet\";\n\n/** Naive UI tag types for the assistant's status tones. */\nconst TAG_TYPE = {\n neutral: \"default\",\n busy: \"info\",\n warning: \"warning\",\n danger: \"error\",\n} as const;\n\nconst surface = (\n props: {\n readonly part: string;\n readonly label: string;\n readonly children: VNodeChild;\n readonly style?: StyleValue;\n },\n classes: readonly (string | undefined)[]\n) =>\n h(\n NCard,\n {\n size: \"small\",\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: classes,\n style: props.style,\n contentStyle: { display: \"flex\", flexDirection: \"column\", minHeight: 0 },\n },\n { default: () => props.children }\n );\n\nexport const naiveAssistantControls: TableAssistantSlots = {\n Button: (props) =>\n naiveButton(\n {\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 { size: props.part === \"assistant-launcher\" ? \"medium\" : \"small\" }\n ),\n Composer: (props) =>\n naiveInput({\n type: \"textarea\",\n value: props.value,\n attrs: {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n placeholder: props.placeholder,\n class: props.className,\n disabled: props.disabled,\n rows: 2,\n onKeydown: props.onKeyDown,\n },\n onChange: props.onChange,\n }),\n Badge: (props) =>\n h(\n NTag,\n {\n \"data-adapttable-part\": props.part,\n \"data-tone\": props.tone,\n type: TAG_TYPE[props.tone],\n size: \"small\",\n bordered: false,\n class: props.className,\n },\n { default: () => props.label }\n ),\n Panel: (props) =>\n surface(props, [\"adapttable-naive-assistant-panel\", props.className]),\n Window: (props) =>\n surface(props, [\"adapttable-naive-assistant-window\", props.className]),\n Sheet: (props) => h(NaiveAssistantSheet, { ...props, key: props.part }),\n Menu: (props) => h(NaiveExamplesMenu, props),\n LanguageChip: (props) =>\n naiveSelect({\n attrs: {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: props.className,\n disabled: props.disabled,\n },\n value: props.value,\n options: props.options,\n onChange: props.onChange,\n }),\n};\n\nexport const naiveApprovalControls: ApprovalReviewSlots = {\n Approve: naiveAssistantControls.Button,\n Reject: naiveAssistantControls.Button,\n Action: naiveAssistantControls.Button,\n List: (props) =>\n h(\n \"ul\",\n {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-naive-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 naiveApprovalControls,\n naiveAssistantControls,\n} from \"./assistant/controls\";\n\nexport const TableAssistant = defineComponent(\n (props: TableAssistantProps) => () =>\n h(TableAssistantChrome, { ...props, slots: naiveAssistantControls }),\n {\n name: \"NaiveTableAssistant\",\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: naiveApprovalControls }),\n {\n name: \"NaiveAgentApproval\",\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":";;;;;;;;AAqBA,SAAS,SACP,MACA,QACA;CACA,OAAO,YACL;EACE,KAAK,KAAK;EACV,MAAM;EACN,UAAU;EACV,wBAAwB,KAAK;EAC7B,OAAO;EACP,eAAe,OAAO,KAAK,EAAE;CAC/B,GACA,CACE,KAAK,MACL,EAAE,QAAQ,CACR,EAAE,UAAU,KAAK,KAAK,GACtB,KAAK,cAAc,EAAE,SAAS,KAAK,WAAW,IAAI,IACpD,CAAC,CACH,GACA,EAAE,MAAM,KAAK,CACf;AACF;;AAGA,SAAS,SACP,OACA,MACA,SACA,QACA;CACA,MAAM,QAAQ,MAAM,MAAM,KAAK,SAAS,SAAS,MAAM,MAAM,CAAC;CAC9D,OAAO,EACL,OACA;EACE,KAAK;EACL,MAAM;EACN,MAAM;EACN,cAAc,MAAM;EACpB,OAAO;EACP,cAAc;GAAE,SAAS;GAAQ,eAAe;GAAU,KAAK;EAAM;EACrE,OAAO;GAAE,WAAW,MAAM;GAAW,WAAW;EAAO;EACvD,WAAW;CACb,GACA,EAAE,eAAe,MAAM,CACzB;AACF;;;;;;AAOA,MAAa,oBAAoB,iBAC9B,UAAmC;CAClC,MAAM,SAAS,iBAAiB;CAChC,MAAM,OAAO,WAAW,KAAK;CAC7B,MAAM,UAAU,WAA+B,IAAI;CACnD,MAAM,OAAO,WAA2C,IAAI;CAC5D,MAAM,aAAa,qBAAqB;CACxC,IAAI,aAAa;CACjB,MACE;EAAC;QAAc,MAAM;QAAgB,MAAM;QAAa,MAAM;CAAQ,SAChE;EACJ;EACA,KAAK,QAAQ;CACf,GACA,EAAE,OAAO,OAAO,CAClB;CACA,MAAM,OAAO,aAAa;EACxB,WAAW,MAAM;EACjB,IAAI,CAAC,UAAU;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AkD;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;AAAsB,CAAC,GACnE;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":[],"sources":["../src/assistant/ExamplesMenu.ts","../src/assistant/Sheet.ts","../src/assistant/controls.ts","../src/assistant.ts"],"sourcesContent":["import {\n createMenuNavigation,\n type TableAssistantMenuProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { NCard, NPopover } from \"naive-ui\";\nimport {\n type ComponentPublicInstance,\n defineComponent,\n h,\n nextTick,\n type PropType,\n type ShallowRef,\n shallowRef,\n watch,\n} from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { htmlRoot } from \"../controls/elementTarget\";\n\n/** One shortcut as a menu item: its icon, title and optional description. */\nfunction shortcut(\n item: TableAssistantMenuProps[\"items\"][number],\n choose: (id: string) => void\n) {\n return naiveButton(\n {\n key: item.id,\n role: \"menuitem\",\n tabindex: -1,\n \"data-adapttable-part\": item.part,\n class: \"adapttable-naive-assistant-shortcut\",\n onClick: () => choose(item.id),\n },\n [\n item.icon,\n h(\"span\", [\n h(\"strong\", item.title),\n item.description ? h(\"small\", item.description) : null,\n ]),\n ],\n { text: true }\n );\n}\n\n/** The open menu: a Naive UI card holding one menu item per shortcut. */\nfunction menuCard(\n props: TableAssistantMenuProps,\n card: ShallowRef<ComponentPublicInstance | null>,\n keydown: (event: KeyboardEvent) => void,\n choose: (id: string) => void\n) {\n const items = props.items.map((item) => shortcut(item, choose));\n return h(\n NCard,\n {\n ref: card,\n size: \"small\",\n role: \"menu\",\n \"aria-label\": props.label,\n class: \"adapttable-naive-assistant-menu\",\n contentStyle: { display: \"flex\", flexDirection: \"column\", gap: \"4px\" },\n style: { maxHeight: props.maxHeight, overflowY: \"auto\" },\n onKeydown: keydown,\n },\n { default: () => items }\n );\n}\n\n/**\n * The assistant's shortcuts in a Naive UI popover menu under its trigger.\n * The shared menu navigation moves focus; Escape and Tab close the menu and\n * Escape returns focus to the trigger.\n */\nexport const NaiveExamplesMenu = defineComponent(\n (props: TableAssistantMenuProps) => {\n const active = useScopeActivity();\n const open = shallowRef(false);\n const trigger = shallowRef<HTMLElement | null>(null);\n const card = shallowRef<ComponentPublicInstance | null>(null);\n const navigation = createMenuNavigation();\n let generation = 0;\n watch(\n [active, () => props.disabled, () => props.items, () => props.onSelect],\n () => {\n generation++;\n open.value = false;\n },\n { flush: \"sync\" }\n );\n watch(open, (expanded) => {\n navigation.reset();\n if (!expanded) return;\n void nextTick(() => {\n const panel = card.value ? htmlRoot(card.value) : null;\n panel\n ?.querySelector<HTMLElement>('[role=\"menuitem\"]')\n ?.focus({ preventScroll: true });\n });\n });\n const close = (restore: boolean) => {\n open.value = false;\n if (restore) trigger.value?.focus({ preventScroll: true });\n };\n const keydown = (event: KeyboardEvent) => {\n const panel = event.currentTarget;\n if (!(panel instanceof HTMLElement)) return;\n const items = [\n ...panel.querySelectorAll<HTMLButtonElement>('[role=\"menuitem\"]'),\n ];\n const focusTargets: readonly (EventTarget | null | undefined)[] = items;\n const action = navigation.key(\n event,\n items.map((item) => ({\n label: item.textContent ?? \"\",\n disabled: item.disabled,\n })),\n focusTargets.indexOf(panel.ownerDocument.activeElement)\n );\n if (!action) return;\n if (action.kind !== \"close\" || action.key !== \"Tab\")\n event.preventDefault();\n event.stopPropagation();\n if (action.kind === \"close\") close(action.key === \"Escape\");\n else items[action.index]?.focus({ preventScroll: true });\n };\n return () => {\n if (!active.value) return null;\n const ticket = generation;\n const choose = (id: string) => {\n if (\n !active.value ||\n props.disabled ||\n ticket !== generation ||\n !props.items.some((item) => item.id === id)\n )\n return;\n close(false);\n props.onSelect(id);\n };\n return h(\n NPopover,\n {\n trigger: \"manual\",\n show: open.value,\n placement: \"bottom-start\",\n showArrow: false,\n raw: true,\n onClickoutside: (event: MouseEvent) => {\n if (\n event.target instanceof Node &&\n trigger.value?.contains(event.target)\n )\n return;\n close(false);\n },\n },\n {\n trigger: () =>\n naiveButton(\n {\n ref: (element: HTMLElement | null) => {\n trigger.value = element;\n },\n disabled: props.disabled,\n \"aria-label\": props.label,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": open.value,\n title: props.label,\n class: props.className,\n \"data-adapttable-part\": props.part,\n onClick: () => {\n if (active.value && !props.disabled) open.value = !open.value;\n },\n },\n [props.icon ?? props.label]\n ),\n default: () => menuCard(props, card, keydown, choose),\n }\n );\n };\n },\n {\n name: \"NaiveExamplesMenu\",\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 { NDrawer, NDrawerContent } from \"naive-ui\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\n/**\n * Chrome chooses initial and return focus; NDrawer contains focus and owns\n * the portal. Escape and mask dismissal become one close request to the\n * host, and the drawer stays open until the host closes it.\n */\nexport const NaiveAssistantSheet = defineComponent(\n (props: TableAssistantSheetProps) => {\n const active = useScopeActivity();\n const requestClose = () => {\n if (active.value && props.open) props.onClose();\n };\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 NDrawer,\n {\n show: props.open,\n placement: props.dir === \"rtl\" ? \"left\" : \"right\",\n width: \"min(28rem, 100vw)\",\n autoFocus: false,\n closeOnEsc: false,\n maskClosable: false,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n \"aria-label\": props.label,\n dir: props.dir,\n class: [\"adapttable-naive-assistant-sheet\", props.className],\n \"data-adapttable-part\": props.part,\n onKeydown: keydown,\n onMaskClick: requestClose,\n },\n {\n default: () =>\n h(NDrawerContent, {}, { default: () => props.children }),\n }\n );\n };\n },\n {\n name: \"NaiveAssistantSheet\",\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 { NCard, NTag } from \"naive-ui\";\nimport { h, type StyleValue, type VNodeChild } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { naiveInput } from \"../controls/input\";\nimport { naiveSelect } from \"../controls/select\";\nimport { NaiveExamplesMenu } from \"./ExamplesMenu\";\nimport { NaiveAssistantSheet } from \"./Sheet\";\n\n/** Naive UI tag types for the assistant's status tones. */\nconst TAG_TYPE = {\n neutral: \"default\",\n busy: \"info\",\n warning: \"warning\",\n danger: \"error\",\n} as const;\n\nconst surface = (\n props: {\n readonly part: string;\n readonly label: string;\n readonly children: VNodeChild;\n readonly style?: StyleValue;\n },\n classes: readonly (string | undefined)[]\n) =>\n h(\n NCard,\n {\n size: \"small\",\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: classes,\n style: props.style,\n contentStyle: { display: \"flex\", flexDirection: \"column\", minHeight: 0 },\n },\n { default: () => props.children }\n );\n\nexport const naiveAssistantControls: TableAssistantSlots = {\n Button: (props) =>\n naiveButton(\n {\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 { size: props.part === \"assistant-launcher\" ? \"medium\" : \"small\" }\n ),\n Composer: (props) =>\n naiveInput({\n type: \"textarea\",\n value: props.value,\n attrs: {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n placeholder: props.placeholder,\n class: props.className,\n disabled: props.disabled,\n rows: 1,\n onKeydown: props.onKeyDown,\n },\n onChange: props.onChange,\n }),\n Badge: (props) =>\n h(\n NTag,\n {\n \"data-adapttable-part\": props.part,\n \"data-tone\": props.tone,\n type: TAG_TYPE[props.tone],\n size: \"small\",\n bordered: false,\n class: props.className,\n },\n { default: () => props.label }\n ),\n Panel: (props) =>\n surface(props, [\"adapttable-naive-assistant-panel\", props.className]),\n Window: (props) =>\n surface(props, [\"adapttable-naive-assistant-window\", props.className]),\n Sheet: (props) => h(NaiveAssistantSheet, { ...props, key: props.part }),\n Menu: (props) => h(NaiveExamplesMenu, props),\n LanguageChip: (props) =>\n naiveSelect({\n attrs: {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: props.className,\n disabled: props.disabled,\n },\n value: props.value,\n options: props.options,\n onChange: props.onChange,\n }),\n};\n\nexport const naiveApprovalControls: ApprovalReviewSlots = {\n Approve: naiveAssistantControls.Button,\n Reject: naiveAssistantControls.Button,\n Action: naiveAssistantControls.Button,\n List: (props) =>\n h(\n \"ul\",\n {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-naive-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 { useThemeVars } from \"naive-ui\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport {\n naiveApprovalControls,\n naiveAssistantControls,\n} from \"./assistant/controls\";\n\nexport const TableAssistant = defineComponent(\n (props: TableAssistantProps) => {\n const theme = useThemeVars();\n return () =>\n h(TableAssistantChrome, {\n ...props,\n accent: props.accent ?? theme.value.primaryColor,\n slots: naiveAssistantControls,\n });\n },\n {\n name: \"NaiveTableAssistant\",\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: naiveApprovalControls }),\n {\n name: \"NaiveAgentApproval\",\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":";;;;;;;;AAqBA,SAAS,SACP,MACA,QACA;CACA,OAAO,YACL;EACE,KAAK,KAAK;EACV,MAAM;EACN,UAAU;EACV,wBAAwB,KAAK;EAC7B,OAAO;EACP,eAAe,OAAO,KAAK,EAAE;CAC/B,GACA,CACE,KAAK,MACL,EAAE,QAAQ,CACR,EAAE,UAAU,KAAK,KAAK,GACtB,KAAK,cAAc,EAAE,SAAS,KAAK,WAAW,IAAI,IACpD,CAAC,CACH,GACA,EAAE,MAAM,KAAK,CACf;AACF;;AAGA,SAAS,SACP,OACA,MACA,SACA,QACA;CACA,MAAM,QAAQ,MAAM,MAAM,KAAK,SAAS,SAAS,MAAM,MAAM,CAAC;CAC9D,OAAO,EACL,OACA;EACE,KAAK;EACL,MAAM;EACN,MAAM;EACN,cAAc,MAAM;EACpB,OAAO;EACP,cAAc;GAAE,SAAS;GAAQ,eAAe;GAAU,KAAK;EAAM;EACrE,OAAO;GAAE,WAAW,MAAM;GAAW,WAAW;EAAO;EACvD,WAAW;CACb,GACA,EAAE,eAAe,MAAM,CACzB;AACF;;;;;;AAOA,MAAa,oBAAoB,iBAC9B,UAAmC;CAClC,MAAM,SAAS,iBAAiB;CAChC,MAAM,OAAO,WAAW,KAAK;CAC7B,MAAM,UAAU,WAA+B,IAAI;CACnD,MAAM,OAAO,WAA2C,IAAI;CAC5D,MAAM,aAAa,qBAAqB;CACxC,IAAI,aAAa;CACjB,MACE;EAAC;QAAc,MAAM;QAAgB,MAAM;QAAa,MAAM;CAAQ,SAChE;EACJ;EACA,KAAK,QAAQ;CACf,GACA,EAAE,OAAO,OAAO,CAClB;CACA,MAAM,OAAO,aAAa;EACxB,WAAW,MAAM;EACjB,IAAI,CAAC,UAAU;EACf,eAAoB;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,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;AAAsB,CAAC,GACnE;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,4 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_editing = require("./editing-BKNxRBEo.cjs");
2
+ const require_editing = require("./editing-CbNASsOY.cjs");
3
3
  exports.NaiveBatchEditBar = require_editing._sfc_main$2;
4
4
  exports.batchEditing = require_editing.batchEditing;
@@ -1,2 +1,2 @@
1
- import { l as _sfc_main, t as batchEditing } from "./editing-BsaH2gDF.js";
1
+ import { l as _sfc_main, t as batchEditing } from "./editing-BZFBs7GP.js";
2
2
  export { _sfc_main as NaiveBatchEditBar, batchEditing };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_controls = require("./controls-D193740P.cjs");
2
+ const require_controls = require("./controls-BqcNuqAb.cjs");
3
3
  require("@adapttable/vue");
4
4
  let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
5
5
  let _adapttable_vue_features = require("@adapttable/vue/features");
@@ -1,4 +1,4 @@
1
- import { t as naiveActionButton } from "./controls-Dp-hPfD4.js";
1
+ import { t as naiveActionButton } from "./controls-CheF2D5J.js";
2
2
  import "@adapttable/vue";
3
3
  import { BULK_ACTIONS_CONTROL, BulkActionsChrome, extendFeature, slotRender } from "@adapttable/vue/adapter";
4
4
  import { bulkActions as bulkActions$1 } from "@adapttable/vue/features";
@@ -58,6 +58,7 @@ function naiveButton(attrs, content, appearance = {}) {
58
58
  const { type, ...nativeAttrs } = attrs;
59
59
  return naiveElement(NButton, {
60
60
  ...appearance,
61
+ nativeFocusBehavior: true,
61
62
  ...nativeAttrs,
62
63
  attrType: type === "submit" || type === "reset" ? type : "button",
63
64
  size: appearance.size ?? "small"
@@ -66,4 +67,4 @@ function naiveButton(attrs, content, appearance = {}) {
66
67
  //#endregion
67
68
  export { withoutAttributes as a, eventHandler as i, naiveElement as n, htmlRoot as r, naiveButton as t };
68
69
 
69
- //# sourceMappingURL=button-Cf1lslmX.js.map
70
+ //# sourceMappingURL=button-BxXdDW7A.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-Cf1lslmX.js","names":[],"sources":["../src/controls/attributes.ts","../src/controls/elementTarget.ts","../src/renderers/nativeElement.ts","../src/controls/button.ts"],"sourcesContent":["import type { Attrs } from \"@adapttable/vue\";\n\n/** Remove only attributes consumed by a component's controlled-value API. */\nexport function withoutAttributes(\n attrs: Attrs,\n names: readonly string[]\n): Attrs {\n return Object.fromEntries(\n Object.entries(attrs).filter(([name]) => !names.includes(name))\n );\n}\n\n/** Vue may merge DOM listeners into arrays; preserve their order and event identity. */\nexport function eventHandler<TEvent extends Event>(\n value: unknown\n): ((event: TEvent) => void) | undefined {\n if (typeof value === \"function\") return value as (event: TEvent) => void;\n if (!Array.isArray(value)) return undefined;\n const listeners = value.map((entry: unknown) => eventHandler<TEvent>(entry));\n return (event) => {\n for (const listener of listeners) listener?.(event);\n };\n}\n","import type { ComponentPublicInstance } from \"vue\";\n\n/** Public Vue host access for Naive primitives with a single HTML root. */\nexport function htmlRoot(\n instance: ComponentPublicInstance\n): HTMLElement | null {\n const value: unknown = instance.$el;\n return typeof HTMLElement !== \"undefined\" && value instanceof HTMLElement\n ? value\n : null;\n}\n","import type { Attrs, ElementRef } from \"@adapttable/vue\";\nimport { useElementRef } from \"@adapttable/vue/adapter\";\nimport {\n type Component,\n type ComponentPublicInstance,\n defineComponent,\n h,\n type PropType,\n shallowRef,\n type VNodeChild,\n} from \"vue\";\n\nimport { withoutAttributes } from \"../controls/attributes\";\nimport { htmlRoot } from \"../controls/elementTarget\";\n\nconst NativeElement = defineComponent(\n (props: {\n readonly component: Component;\n readonly attrs: Attrs;\n readonly content: () => VNodeChild;\n }) => {\n const instance = shallowRef<ComponentPublicInstance | null>(null);\n useElementRef(\n () => (instance.value ? htmlRoot(instance.value) : null),\n () =>\n typeof props.attrs.ref === \"function\"\n ? (props.attrs.ref as ElementRef)\n : undefined\n );\n return () => {\n const attrs = withoutAttributes(props.attrs, [\"ref\"]);\n return h(\n props.component,\n { ...attrs, ref: instance },\n { default: props.content }\n );\n };\n },\n {\n name: \"NaiveSemanticElement\",\n props: {\n component: { type: [Object, Function] as PropType<Component> },\n attrs: { type: Object as PropType<Attrs> },\n content: { type: Function as PropType<() => VNodeChild> },\n },\n }\n);\n\n/** Naive primitives have one semantic root; refs resolve through public $el. */\nexport function naiveElement(\n component: Component,\n attrs: Attrs,\n content: () => VNodeChild = () => null\n) {\n return h(NativeElement, {\n key: attrs.key as string | number | symbol | undefined,\n component,\n attrs,\n content,\n });\n}\n","import type { Attrs } from \"@adapttable/vue\";\nimport { type ButtonProps, NButton } from \"naive-ui\";\nimport { type VNode, type VNodeChild } from \"vue\";\n\nimport { naiveElement } from \"../renderers/nativeElement\";\n\n/** NButton's public attrType forwards the native type to its button. */\nexport function naiveButton(\n attrs: Attrs,\n content: VNodeChild,\n appearance: Pick<ButtonProps, \"tag\" | \"text\" | \"size\"> = {}\n): VNode {\n const { type, ...nativeAttrs } = attrs;\n return naiveElement(\n NButton,\n {\n ...appearance,\n ...nativeAttrs,\n attrType: type === \"submit\" || type === \"reset\" ? type : \"button\",\n size: appearance.size ?? \"small\",\n },\n () => content\n );\n}\n"],"mappings":";;;;;AAGA,SAAgB,kBACd,OACA,OACO;CACP,OAAO,OAAO,YACZ,OAAO,QAAQ,KAAK,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,SAAS,IAAI,CAAC,CAChE;AACF;;AAGA,SAAgB,aACd,OACuC;CACvC,IAAI,OAAO,UAAU,YAAY,OAAO;CACxC,IAAI,CAAC,MAAM,QAAQ,KAAK,GAAG,OAAO,KAAA;CAClC,MAAM,YAAY,MAAM,KAAK,UAAmB,aAAqB,KAAK,CAAC;CAC3E,QAAQ,UAAU;EAChB,KAAK,MAAM,YAAY,WAAW,WAAW,KAAK;CACpD;AACF;;;;ACnBA,SAAgB,SACd,UACoB;CACpB,MAAM,QAAiB,SAAS;CAChC,OAAO,OAAO,gBAAgB,eAAe,iBAAiB,cAC1D,QACA;AACN;;;ACKA,MAAM,gBAAgB,iBACnB,UAIK;CACJ,MAAM,WAAW,WAA2C,IAAI;CAChE,oBACS,SAAS,QAAQ,SAAS,SAAS,KAAK,IAAI,YAEjD,OAAO,MAAM,MAAM,QAAQ,aACtB,MAAM,MAAM,MACb,KAAA,CACR;CACA,aAAa;EACX,MAAM,QAAQ,kBAAkB,MAAM,OAAO,CAAC,KAAK,CAAC;EACpD,OAAO,EACL,MAAM,WACN;GAAE,GAAG;GAAO,KAAK;EAAS,GAC1B,EAAE,SAAS,MAAM,QAAQ,CAC3B;CACF;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,WAAW,EAAE,MAAM,CAAC,QAAQ,QAAQ,EAAyB;EAC7D,OAAO,EAAE,MAAM,OAA0B;EACzC,SAAS,EAAE,MAAM,SAAuC;CAC1D;AACF,CACF;;AAGA,SAAgB,aACd,WACA,OACA,gBAAkC,MAClC;CACA,OAAO,EAAE,eAAe;EACtB,KAAK,MAAM;EACX;EACA;EACA;CACF,CAAC;AACH;;;;ACrDA,SAAgB,YACd,OACA,SACA,aAAyD,CAAC,GACnD;CACP,MAAM,EAAE,MAAM,GAAG,gBAAgB;CACjC,OAAO,aACL,SACA;EACE,GAAG;EACH,GAAG;EACH,UAAU,SAAS,YAAY,SAAS,UAAU,OAAO;EACzD,MAAM,WAAW,QAAQ;CAC3B,SACM,OACR;AACF"}
1
+ {"version":3,"file":"button-BxXdDW7A.js","names":[],"sources":["../src/controls/attributes.ts","../src/controls/elementTarget.ts","../src/renderers/nativeElement.ts","../src/controls/button.ts"],"sourcesContent":["import type { Attrs } from \"@adapttable/vue\";\n\n/** Remove only attributes consumed by a component's controlled-value API. */\nexport function withoutAttributes(\n attrs: Attrs,\n names: readonly string[]\n): Attrs {\n return Object.fromEntries(\n Object.entries(attrs).filter(([name]) => !names.includes(name))\n );\n}\n\n/** Vue may merge DOM listeners into arrays; preserve their order and event identity. */\nexport function eventHandler<TEvent extends Event>(\n value: unknown\n): ((event: TEvent) => void) | undefined {\n if (typeof value === \"function\") return value as (event: TEvent) => void;\n if (!Array.isArray(value)) return undefined;\n const listeners = value.map((entry: unknown) => eventHandler<TEvent>(entry));\n return (event) => {\n for (const listener of listeners) listener?.(event);\n };\n}\n","import type { ComponentPublicInstance } from \"vue\";\n\n/** Public Vue host access for Naive primitives with a single HTML root. */\nexport function htmlRoot(\n instance: ComponentPublicInstance\n): HTMLElement | null {\n const value: unknown = instance.$el;\n return typeof HTMLElement !== \"undefined\" && value instanceof HTMLElement\n ? value\n : null;\n}\n","import type { Attrs, ElementRef } from \"@adapttable/vue\";\nimport { useElementRef } from \"@adapttable/vue/adapter\";\nimport {\n type Component,\n type ComponentPublicInstance,\n defineComponent,\n h,\n type PropType,\n shallowRef,\n type VNodeChild,\n} from \"vue\";\n\nimport { withoutAttributes } from \"../controls/attributes\";\nimport { htmlRoot } from \"../controls/elementTarget\";\n\nconst NativeElement = defineComponent(\n (props: {\n readonly component: Component;\n readonly attrs: Attrs;\n readonly content: () => VNodeChild;\n }) => {\n const instance = shallowRef<ComponentPublicInstance | null>(null);\n useElementRef(\n () => (instance.value ? htmlRoot(instance.value) : null),\n () =>\n typeof props.attrs.ref === \"function\"\n ? (props.attrs.ref as ElementRef)\n : undefined\n );\n return () => {\n const attrs = withoutAttributes(props.attrs, [\"ref\"]);\n return h(\n props.component,\n { ...attrs, ref: instance },\n { default: props.content }\n );\n };\n },\n {\n name: \"NaiveSemanticElement\",\n props: {\n component: { type: [Object, Function] as PropType<Component> },\n attrs: { type: Object as PropType<Attrs> },\n content: { type: Function as PropType<() => VNodeChild> },\n },\n }\n);\n\n/** Naive primitives have one semantic root; refs resolve through public $el. */\nexport function naiveElement(\n component: Component,\n attrs: Attrs,\n content: () => VNodeChild = () => null\n) {\n return h(NativeElement, {\n key: attrs.key as string | number | symbol | undefined,\n component,\n attrs,\n content,\n });\n}\n","import type { Attrs } from \"@adapttable/vue\";\nimport { type ButtonProps, NButton } from \"naive-ui\";\nimport { type VNode, type VNodeChild } from \"vue\";\n\nimport { naiveElement } from \"../renderers/nativeElement\";\n\n/** NButton's public attrType forwards the native type to its button. */\nexport function naiveButton(\n attrs: Attrs,\n content: VNodeChild,\n appearance: Pick<ButtonProps, \"tag\" | \"text\" | \"size\"> = {}\n): VNode {\n const { type, ...nativeAttrs } = attrs;\n return naiveElement(\n NButton,\n {\n ...appearance,\n // Naive's synthetic focus cancels mousedown, preventing native drags\n // from both a handle and a sortable button inside a draggable header.\n nativeFocusBehavior: true,\n ...nativeAttrs,\n attrType: type === \"submit\" || type === \"reset\" ? type : \"button\",\n size: appearance.size ?? \"small\",\n },\n () => content\n );\n}\n"],"mappings":";;;;;AAGA,SAAgB,kBACd,OACA,OACO;CACP,OAAO,OAAO,YACZ,OAAO,QAAQ,KAAK,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,SAAS,IAAI,CAAC,CAChE;AACF;;AAGA,SAAgB,aACd,OACuC;CACvC,IAAI,OAAO,UAAU,YAAY,OAAO;CACxC,IAAI,CAAC,MAAM,QAAQ,KAAK,GAAG,OAAO,KAAA;CAClC,MAAM,YAAY,MAAM,KAAK,UAAmB,aAAqB,KAAK,CAAC;CAC3E,QAAQ,UAAU;EAChB,KAAK,MAAM,YAAY,WAAW,WAAW,KAAK;CACpD;AACF;;;;ACnBA,SAAgB,SACd,UACoB;CACpB,MAAM,QAAiB,SAAS;CAChC,OAAO,OAAO,gBAAgB,eAAe,iBAAiB,cAC1D,QACA;AACN;;;ACKA,MAAM,gBAAgB,iBACnB,UAIK;CACJ,MAAM,WAAW,WAA2C,IAAI;CAChE,oBACS,SAAS,QAAQ,SAAS,SAAS,KAAK,IAAI,YAEjD,OAAO,MAAM,MAAM,QAAQ,aACtB,MAAM,MAAM,MACb,KAAA,CACR;CACA,aAAa;EACX,MAAM,QAAQ,kBAAkB,MAAM,OAAO,CAAC,KAAK,CAAC;EACpD,OAAO,EACL,MAAM,WACN;GAAE,GAAG;GAAO,KAAK;EAAS,GAC1B,EAAE,SAAS,MAAM,QAAQ,CAC3B;CACF;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,WAAW,EAAE,MAAM,CAAC,QAAQ,QAAQ,EAAyB;EAC7D,OAAO,EAAE,MAAM,OAA0B;EACzC,SAAS,EAAE,MAAM,SAAuC;CAC1D;AACF,CACF;;AAGA,SAAgB,aACd,WACA,OACA,gBAAkC,MAClC;CACA,OAAO,EAAE,eAAe;EACtB,KAAK,MAAM;EACX;EACA;EACA;CACF,CAAC;AACH;;;;ACrDA,SAAgB,YACd,OACA,SACA,aAAyD,CAAC,GACnD;CACP,MAAM,EAAE,MAAM,GAAG,gBAAgB;CACjC,OAAO,aACL,SACA;EACE,GAAG;EAGH,qBAAqB;EACrB,GAAG;EACH,UAAU,SAAS,YAAY,SAAS,UAAU,OAAO;EACzD,MAAM,WAAW,QAAQ;CAC3B,SACM,OACR;AACF"}
@@ -58,6 +58,7 @@ function naiveButton(attrs, content, appearance = {}) {
58
58
  const { type, ...nativeAttrs } = attrs;
59
59
  return naiveElement(naive_ui.NButton, {
60
60
  ...appearance,
61
+ nativeFocusBehavior: true,
61
62
  ...nativeAttrs,
62
63
  attrType: type === "submit" || type === "reset" ? type : "button",
63
64
  size: appearance.size ?? "small"
@@ -95,4 +96,4 @@ Object.defineProperty(exports, "withoutAttributes", {
95
96
  }
96
97
  });
97
98
 
98
- //# sourceMappingURL=button-CVOchGam.cjs.map
99
+ //# sourceMappingURL=button-CaakTzYM.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-CVOchGam.cjs","names":["defineComponent","shallowRef","h","NButton"],"sources":["../src/controls/attributes.ts","../src/controls/elementTarget.ts","../src/renderers/nativeElement.ts","../src/controls/button.ts"],"sourcesContent":["import type { Attrs } from \"@adapttable/vue\";\n\n/** Remove only attributes consumed by a component's controlled-value API. */\nexport function withoutAttributes(\n attrs: Attrs,\n names: readonly string[]\n): Attrs {\n return Object.fromEntries(\n Object.entries(attrs).filter(([name]) => !names.includes(name))\n );\n}\n\n/** Vue may merge DOM listeners into arrays; preserve their order and event identity. */\nexport function eventHandler<TEvent extends Event>(\n value: unknown\n): ((event: TEvent) => void) | undefined {\n if (typeof value === \"function\") return value as (event: TEvent) => void;\n if (!Array.isArray(value)) return undefined;\n const listeners = value.map((entry: unknown) => eventHandler<TEvent>(entry));\n return (event) => {\n for (const listener of listeners) listener?.(event);\n };\n}\n","import type { ComponentPublicInstance } from \"vue\";\n\n/** Public Vue host access for Naive primitives with a single HTML root. */\nexport function htmlRoot(\n instance: ComponentPublicInstance\n): HTMLElement | null {\n const value: unknown = instance.$el;\n return typeof HTMLElement !== \"undefined\" && value instanceof HTMLElement\n ? value\n : null;\n}\n","import type { Attrs, ElementRef } from \"@adapttable/vue\";\nimport { useElementRef } from \"@adapttable/vue/adapter\";\nimport {\n type Component,\n type ComponentPublicInstance,\n defineComponent,\n h,\n type PropType,\n shallowRef,\n type VNodeChild,\n} from \"vue\";\n\nimport { withoutAttributes } from \"../controls/attributes\";\nimport { htmlRoot } from \"../controls/elementTarget\";\n\nconst NativeElement = defineComponent(\n (props: {\n readonly component: Component;\n readonly attrs: Attrs;\n readonly content: () => VNodeChild;\n }) => {\n const instance = shallowRef<ComponentPublicInstance | null>(null);\n useElementRef(\n () => (instance.value ? htmlRoot(instance.value) : null),\n () =>\n typeof props.attrs.ref === \"function\"\n ? (props.attrs.ref as ElementRef)\n : undefined\n );\n return () => {\n const attrs = withoutAttributes(props.attrs, [\"ref\"]);\n return h(\n props.component,\n { ...attrs, ref: instance },\n { default: props.content }\n );\n };\n },\n {\n name: \"NaiveSemanticElement\",\n props: {\n component: { type: [Object, Function] as PropType<Component> },\n attrs: { type: Object as PropType<Attrs> },\n content: { type: Function as PropType<() => VNodeChild> },\n },\n }\n);\n\n/** Naive primitives have one semantic root; refs resolve through public $el. */\nexport function naiveElement(\n component: Component,\n attrs: Attrs,\n content: () => VNodeChild = () => null\n) {\n return h(NativeElement, {\n key: attrs.key as string | number | symbol | undefined,\n component,\n attrs,\n content,\n });\n}\n","import type { Attrs } from \"@adapttable/vue\";\nimport { type ButtonProps, NButton } from \"naive-ui\";\nimport { type VNode, type VNodeChild } from \"vue\";\n\nimport { naiveElement } from \"../renderers/nativeElement\";\n\n/** NButton's public attrType forwards the native type to its button. */\nexport function naiveButton(\n attrs: Attrs,\n content: VNodeChild,\n appearance: Pick<ButtonProps, \"tag\" | \"text\" | \"size\"> = {}\n): VNode {\n const { type, ...nativeAttrs } = attrs;\n return naiveElement(\n NButton,\n {\n ...appearance,\n ...nativeAttrs,\n attrType: type === \"submit\" || type === \"reset\" ? type : \"button\",\n size: appearance.size ?? \"small\",\n },\n () => content\n );\n}\n"],"mappings":";;;;;AAGA,SAAgB,kBACd,OACA,OACO;CACP,OAAO,OAAO,YACZ,OAAO,QAAQ,KAAK,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,SAAS,IAAI,CAAC,CAChE;AACF;;AAGA,SAAgB,aACd,OACuC;CACvC,IAAI,OAAO,UAAU,YAAY,OAAO;CACxC,IAAI,CAAC,MAAM,QAAQ,KAAK,GAAG,OAAO,KAAA;CAClC,MAAM,YAAY,MAAM,KAAK,UAAmB,aAAqB,KAAK,CAAC;CAC3E,QAAQ,UAAU;EAChB,KAAK,MAAM,YAAY,WAAW,WAAW,KAAK;CACpD;AACF;;;;ACnBA,SAAgB,SACd,UACoB;CACpB,MAAM,QAAiB,SAAS;CAChC,OAAO,OAAO,gBAAgB,eAAe,iBAAiB,cAC1D,QACA;AACN;;;ACKA,MAAM,iBAAA,GAAgBA,IAAAA,gBAAAA,EACnB,UAIK;CACJ,MAAM,YAAA,GAAWC,IAAAA,WAAAA,CAA2C,IAAI;CAChE,CAAA,GAAA,wBAAA,cAAA,OACS,SAAS,QAAQ,SAAS,SAAS,KAAK,IAAI,YAEjD,OAAO,MAAM,MAAM,QAAQ,aACtB,MAAM,MAAM,MACb,KAAA,CACR;CACA,aAAa;EACX,MAAM,QAAQ,kBAAkB,MAAM,OAAO,CAAC,KAAK,CAAC;EACpD,QAAA,GAAOC,IAAAA,EAAAA,CACL,MAAM,WACN;GAAE,GAAG;GAAO,KAAK;EAAS,GAC1B,EAAE,SAAS,MAAM,QAAQ,CAC3B;CACF;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,WAAW,EAAE,MAAM,CAAC,QAAQ,QAAQ,EAAyB;EAC7D,OAAO,EAAE,MAAM,OAA0B;EACzC,SAAS,EAAE,MAAM,SAAuC;CAC1D;AACF,CACF;;AAGA,SAAgB,aACd,WACA,OACA,gBAAkC,MAClC;CACA,QAAA,GAAOA,IAAAA,EAAAA,CAAE,eAAe;EACtB,KAAK,MAAM;EACX;EACA;EACA;CACF,CAAC;AACH;;;;ACrDA,SAAgB,YACd,OACA,SACA,aAAyD,CAAC,GACnD;CACP,MAAM,EAAE,MAAM,GAAG,gBAAgB;CACjC,OAAO,aACLC,SAAAA,SACA;EACE,GAAG;EACH,GAAG;EACH,UAAU,SAAS,YAAY,SAAS,UAAU,OAAO;EACzD,MAAM,WAAW,QAAQ;CAC3B,SACM,OACR;AACF"}
1
+ {"version":3,"file":"button-CaakTzYM.cjs","names":["defineComponent","shallowRef","h","NButton"],"sources":["../src/controls/attributes.ts","../src/controls/elementTarget.ts","../src/renderers/nativeElement.ts","../src/controls/button.ts"],"sourcesContent":["import type { Attrs } from \"@adapttable/vue\";\n\n/** Remove only attributes consumed by a component's controlled-value API. */\nexport function withoutAttributes(\n attrs: Attrs,\n names: readonly string[]\n): Attrs {\n return Object.fromEntries(\n Object.entries(attrs).filter(([name]) => !names.includes(name))\n );\n}\n\n/** Vue may merge DOM listeners into arrays; preserve their order and event identity. */\nexport function eventHandler<TEvent extends Event>(\n value: unknown\n): ((event: TEvent) => void) | undefined {\n if (typeof value === \"function\") return value as (event: TEvent) => void;\n if (!Array.isArray(value)) return undefined;\n const listeners = value.map((entry: unknown) => eventHandler<TEvent>(entry));\n return (event) => {\n for (const listener of listeners) listener?.(event);\n };\n}\n","import type { ComponentPublicInstance } from \"vue\";\n\n/** Public Vue host access for Naive primitives with a single HTML root. */\nexport function htmlRoot(\n instance: ComponentPublicInstance\n): HTMLElement | null {\n const value: unknown = instance.$el;\n return typeof HTMLElement !== \"undefined\" && value instanceof HTMLElement\n ? value\n : null;\n}\n","import type { Attrs, ElementRef } from \"@adapttable/vue\";\nimport { useElementRef } from \"@adapttable/vue/adapter\";\nimport {\n type Component,\n type ComponentPublicInstance,\n defineComponent,\n h,\n type PropType,\n shallowRef,\n type VNodeChild,\n} from \"vue\";\n\nimport { withoutAttributes } from \"../controls/attributes\";\nimport { htmlRoot } from \"../controls/elementTarget\";\n\nconst NativeElement = defineComponent(\n (props: {\n readonly component: Component;\n readonly attrs: Attrs;\n readonly content: () => VNodeChild;\n }) => {\n const instance = shallowRef<ComponentPublicInstance | null>(null);\n useElementRef(\n () => (instance.value ? htmlRoot(instance.value) : null),\n () =>\n typeof props.attrs.ref === \"function\"\n ? (props.attrs.ref as ElementRef)\n : undefined\n );\n return () => {\n const attrs = withoutAttributes(props.attrs, [\"ref\"]);\n return h(\n props.component,\n { ...attrs, ref: instance },\n { default: props.content }\n );\n };\n },\n {\n name: \"NaiveSemanticElement\",\n props: {\n component: { type: [Object, Function] as PropType<Component> },\n attrs: { type: Object as PropType<Attrs> },\n content: { type: Function as PropType<() => VNodeChild> },\n },\n }\n);\n\n/** Naive primitives have one semantic root; refs resolve through public $el. */\nexport function naiveElement(\n component: Component,\n attrs: Attrs,\n content: () => VNodeChild = () => null\n) {\n return h(NativeElement, {\n key: attrs.key as string | number | symbol | undefined,\n component,\n attrs,\n content,\n });\n}\n","import type { Attrs } from \"@adapttable/vue\";\nimport { type ButtonProps, NButton } from \"naive-ui\";\nimport { type VNode, type VNodeChild } from \"vue\";\n\nimport { naiveElement } from \"../renderers/nativeElement\";\n\n/** NButton's public attrType forwards the native type to its button. */\nexport function naiveButton(\n attrs: Attrs,\n content: VNodeChild,\n appearance: Pick<ButtonProps, \"tag\" | \"text\" | \"size\"> = {}\n): VNode {\n const { type, ...nativeAttrs } = attrs;\n return naiveElement(\n NButton,\n {\n ...appearance,\n // Naive's synthetic focus cancels mousedown, preventing native drags\n // from both a handle and a sortable button inside a draggable header.\n nativeFocusBehavior: true,\n ...nativeAttrs,\n attrType: type === \"submit\" || type === \"reset\" ? type : \"button\",\n size: appearance.size ?? \"small\",\n },\n () => content\n );\n}\n"],"mappings":";;;;;AAGA,SAAgB,kBACd,OACA,OACO;CACP,OAAO,OAAO,YACZ,OAAO,QAAQ,KAAK,CAA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AE,MAAM,GAAG,gBAAgB;CACjC,OAAO,aACLC,SAAAA,SACA;EACE,GAAG;EAGH,qBAAqB;EACrB,GAAG;EACH,UAAU,SAAS,YAAY,SAAS,UAAU,OAAO;EACzD,MAAM,WAAW,QAAQ;CAC3B,SACM,OACR;AACF"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_controls = require("./controls-Dj3k83WJ.cjs");
2
+ const require_controls = require("./controls-CovJN7Di.cjs");
3
3
  require("@adapttable/vue");
4
4
  let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
5
5
  let _adapttable_vue_features = require("@adapttable/vue/features");
@@ -1,4 +1,4 @@
1
- import { n as NaiveFillHandle, t as NaiveColumnSelect } from "./controls-ZeT4wgJ-.js";
1
+ import { n as NaiveFillHandle, t as NaiveColumnSelect } from "./controls-BbSp1__U.js";
2
2
  import "@adapttable/vue";
3
3
  import { COLUMN_SELECT, FILL_HANDLE_CONTROL, extendFeature, slotRender } from "@adapttable/vue/adapter";
4
4
  import { cellNavigation as cellNavigation$1, columnSelectionCheckbox as columnSelectionCheckbox$1 } from "@adapttable/vue/features";
@@ -1,4 +1,4 @@
1
- const require_button = require("./button-CVOchGam.cjs");
1
+ const require_button = require("./button-CaakTzYM.cjs");
2
2
  let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
3
3
  require("vue");
4
4
  let naive_ui = require("naive-ui");
@@ -23,4 +23,4 @@ Object.defineProperty(exports, "naiveCheckbox", {
23
23
  }
24
24
  });
25
25
 
26
- //# sourceMappingURL=checkbox-Bu4Tl5TQ.cjs.map
26
+ //# sourceMappingURL=checkbox-DcANe2ru.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-Bu4Tl5TQ.cjs","names":["withoutAttributes","selectionCheckboxInputAttrs","naiveElement","NCheckbox"],"sources":["../src/controls/checkbox.ts"],"sourcesContent":["import {\n type SelectionCheckboxControl,\n selectionCheckboxInputAttrs,\n} from \"@adapttable/vue/adapter\";\nimport { NCheckbox } from \"naive-ui\";\nimport { type VNode } from \"vue\";\n\nimport { naiveElement } from \"../renderers/nativeElement\";\nimport { withoutAttributes } from \"./attributes\";\n\n/** NCheckbox's focusable root is its ARIA checkbox, not a native input. */\nexport function naiveCheckbox(control: SelectionCheckboxControl): VNode {\n const attrs = withoutAttributes(selectionCheckboxInputAttrs(control.attrs), [\n \"type\",\n ]);\n return naiveElement(NCheckbox, {\n ...attrs,\n checked: control.checked,\n indeterminate: control.indeterminate,\n \"aria-labelledby\": attrs[\"aria-labelledby\"] ?? undefined,\n \"aria-disabled\": attrs.disabled ? true : undefined,\n \"onUpdate:checked\": () => control.onToggle(),\n });\n}\n"],"mappings":";;;;;;AAWA,SAAgB,cAAc,SAA0C;CACtE,MAAM,QAAQA,eAAAA,mBAAAA,GAAkBC,wBAAAA,4BAAAA,CAA4B,QAAQ,KAAK,GAAG,CAC1E,MACF,CAAC;CACD,OAAOC,eAAAA,aAAaC,SAAAA,WAAW;EAC7B,GAAG;EACH,SAAS,QAAQ;EACjB,eAAe,QAAQ;EACvB,mBAAmB,MAAM,sBAAsB,KAAA;EAC/C,iBAAiB,MAAM,WAAW,OAAO,KAAA;EACzC,0BAA0B,QAAQ,SAAS;CAC7C,CAAC;AACH"}
1
+ {"version":3,"file":"checkbox-DcANe2ru.cjs","names":["withoutAttributes","selectionCheckboxInputAttrs","naiveElement","NCheckbox"],"sources":["../src/controls/checkbox.ts"],"sourcesContent":["import {\n type SelectionCheckboxControl,\n selectionCheckboxInputAttrs,\n} from \"@adapttable/vue/adapter\";\nimport { NCheckbox } from \"naive-ui\";\nimport { type VNode } from \"vue\";\n\nimport { naiveElement } from \"../renderers/nativeElement\";\nimport { withoutAttributes } from \"./attributes\";\n\n/** NCheckbox's focusable root is its ARIA checkbox, not a native input. */\nexport function naiveCheckbox(control: SelectionCheckboxControl): VNode {\n const attrs = withoutAttributes(selectionCheckboxInputAttrs(control.attrs), [\n \"type\",\n ]);\n return naiveElement(NCheckbox, {\n ...attrs,\n checked: control.checked,\n indeterminate: control.indeterminate,\n \"aria-labelledby\": attrs[\"aria-labelledby\"] ?? undefined,\n \"aria-disabled\": attrs.disabled ? true : undefined,\n \"onUpdate:checked\": () => control.onToggle(),\n });\n}\n"],"mappings":";;;;;;AAWA,SAAgB,cAAc,SAA0C;CACtE,MAAM,QAAQA,eAAAA,mBAAAA,GAAkBC,wBAAAA,4BAAAA,CAA4B,QAAQ,KAAK,GAAG,CAC1E,MACF,CAAC;CACD,OAAOC,eAAAA,aAAaC,SAAAA,WAAW;EAC7B,GAAG;EACH,SAAS,QAAQ;EACjB,eAAe,QAAQ;EACvB,mBAAmB,MAAM,sBAAsB,KAAA;EAC/C,iBAAiB,MAAM,WAAW,OAAO,KAAA;EACzC,0BAA0B,QAAQ,SAAS;CAC7C,CAAC;AACH"}
@@ -1,4 +1,4 @@
1
- import { a as withoutAttributes, n as naiveElement } from "./button-Cf1lslmX.js";
1
+ import { a as withoutAttributes, n as naiveElement } from "./button-BxXdDW7A.js";
2
2
  import { selectionCheckboxInputAttrs } from "@adapttable/vue/adapter";
3
3
  import "vue";
4
4
  import { NCheckbox } from "naive-ui";
@@ -18,4 +18,4 @@ function naiveCheckbox(control) {
18
18
  //#endregion
19
19
  export { naiveCheckbox as t };
20
20
 
21
- //# sourceMappingURL=checkbox-CcYT0Q-6.js.map
21
+ //# sourceMappingURL=checkbox-GQ0BLv13.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-CcYT0Q-6.js","names":[],"sources":["../src/controls/checkbox.ts"],"sourcesContent":["import {\n type SelectionCheckboxControl,\n selectionCheckboxInputAttrs,\n} from \"@adapttable/vue/adapter\";\nimport { NCheckbox } from \"naive-ui\";\nimport { type VNode } from \"vue\";\n\nimport { naiveElement } from \"../renderers/nativeElement\";\nimport { withoutAttributes } from \"./attributes\";\n\n/** NCheckbox's focusable root is its ARIA checkbox, not a native input. */\nexport function naiveCheckbox(control: SelectionCheckboxControl): VNode {\n const attrs = withoutAttributes(selectionCheckboxInputAttrs(control.attrs), [\n \"type\",\n ]);\n return naiveElement(NCheckbox, {\n ...attrs,\n checked: control.checked,\n indeterminate: control.indeterminate,\n \"aria-labelledby\": attrs[\"aria-labelledby\"] ?? undefined,\n \"aria-disabled\": attrs.disabled ? true : undefined,\n \"onUpdate:checked\": () => control.onToggle(),\n });\n}\n"],"mappings":";;;;;;AAWA,SAAgB,cAAc,SAA0C;CACtE,MAAM,QAAQ,kBAAkB,4BAA4B,QAAQ,KAAK,GAAG,CAC1E,MACF,CAAC;CACD,OAAO,aAAa,WAAW;EAC7B,GAAG;EACH,SAAS,QAAQ;EACjB,eAAe,QAAQ;EACvB,mBAAmB,MAAM,sBAAsB,KAAA;EAC/C,iBAAiB,MAAM,WAAW,OAAO,KAAA;EACzC,0BAA0B,QAAQ,SAAS;CAC7C,CAAC;AACH"}
1
+ {"version":3,"file":"checkbox-GQ0BLv13.js","names":[],"sources":["../src/controls/checkbox.ts"],"sourcesContent":["import {\n type SelectionCheckboxControl,\n selectionCheckboxInputAttrs,\n} from \"@adapttable/vue/adapter\";\nimport { NCheckbox } from \"naive-ui\";\nimport { type VNode } from \"vue\";\n\nimport { naiveElement } from \"../renderers/nativeElement\";\nimport { withoutAttributes } from \"./attributes\";\n\n/** NCheckbox's focusable root is its ARIA checkbox, not a native input. */\nexport function naiveCheckbox(control: SelectionCheckboxControl): VNode {\n const attrs = withoutAttributes(selectionCheckboxInputAttrs(control.attrs), [\n \"type\",\n ]);\n return naiveElement(NCheckbox, {\n ...attrs,\n checked: control.checked,\n indeterminate: control.indeterminate,\n \"aria-labelledby\": attrs[\"aria-labelledby\"] ?? undefined,\n \"aria-disabled\": attrs.disabled ? true : undefined,\n \"onUpdate:checked\": () => control.onToggle(),\n });\n}\n"],"mappings":";;;;;;AAWA,SAAgB,cAAc,SAA0C;CACtE,MAAM,QAAQ,kBAAkB,4BAA4B,QAAQ,KAAK,GAAG,CAC1E,MACF,CAAC;CACD,OAAO,aAAa,WAAW;EAC7B,GAAG;EACH,SAAS,QAAQ;EACjB,eAAe,QAAQ;EACvB,mBAAmB,MAAM,sBAAsB,KAAA;EAC/C,iBAAiB,MAAM,WAAW,OAAO,KAAA;EACzC,0BAA0B,QAAQ,SAAS;CAC7C,CAAC;AACH"}
@@ -1,7 +1,7 @@
1
- const require_button = require("./button-CVOchGam.cjs");
2
- const require_input = require("./input-Cgm2r2YC.cjs");
3
- const require_select = require("./select-ChoLy-Ja.cjs");
4
- const require_NaiveManagedPopover = require("./NaiveManagedPopover-BScsoUHh.cjs");
1
+ const require_button = require("./button-CaakTzYM.cjs");
2
+ const require_input = require("./input-DPQy4L2b.cjs");
3
+ const require_select = require("./select-C8UKnsWO.cjs");
4
+ const require_NaiveManagedPopover = require("./NaiveManagedPopover-DhLEXdew.cjs");
5
5
  let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
6
6
  let _adapttable_vue_features = require("@adapttable/vue/features");
7
7
  let vue = require("vue");
@@ -82,4 +82,4 @@ Object.defineProperty(exports, "columnMenu", {
82
82
  }
83
83
  });
84
84
 
85
- //# sourceMappingURL=column-menu-Cd8Fm695.cjs.map
85
+ //# sourceMappingURL=column-menu-Dh3hU7Vp.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"column-menu-Cd8Fm695.cjs","names":["naiveButton","h","NIcon","naiveInput","naiveSelect","managedOverlayPanel","NaiveManagedPopover","extendFeature","bindingColumnMenu","slotRender","COLUMN_MENU","h","ColumnMenu","COLUMN_HEADER_RENAME","ColumnHeaderRenameChrome"],"sources":["../src/columns/controls.ts","../src/columns/ColumnMenu.vue","../src/column-menu.ts"],"sourcesContent":["import {\n type ColumnMenuButtonProps,\n type ColumnMenuSlots,\n managedOverlayPanel,\n} from \"@adapttable/vue/adapter\";\nimport { NIcon } from \"naive-ui\";\nimport { h } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { naiveInput } from \"../controls/input\";\nimport { naiveSelect } from \"../controls/select\";\nimport { NaiveManagedPopover } from \"./NaiveManagedPopover\";\n\nconst icons = {\n grip: \"⠿\",\n visible: \"◉\",\n hidden: \"○\",\n pin: \"⌖\",\n more: \"⋯\",\n rename: \"✎\",\n};\nfunction button({ attrs, label, icon }: ColumnMenuButtonProps) {\n return naiveButton(\n attrs,\n icon\n ? h(NIcon, { \"aria-hidden\": true }, { default: () => icons[icon] })\n : label\n );\n}\n\nexport const naiveColumnMenuSlots: ColumnMenuSlots = {\n Trigger: button,\n Button: button,\n Input: naiveInput,\n Choice: naiveSelect,\n Panel: managedOverlayPanel((control) => h(NaiveManagedPopover, { control })),\n};\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n ColumnMenuChrome,\n type ColumnMenuSlotProps,\n useColumnMenu,\n} from \"@adapttable/vue/adapter\";\n\nimport { naiveColumnMenuSlots } from \"./controls\";\n\nconst props = defineProps<ColumnMenuSlotProps<TRow>>();\nconst model = useColumnMenu(() => props);\n</script>\n\n<template>\n <ColumnMenuChrome :model=\"model\" :slots=\"naiveColumnMenuSlots\" />\n</template>\n","import type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n COLUMN_HEADER_RENAME,\n COLUMN_MENU,\n ColumnHeaderRenameChrome,\n extendFeature,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { columnMenu as bindingColumnMenu } from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport ColumnMenu from \"./columns/ColumnMenu.vue\";\nimport { naiveColumnMenuSlots } from \"./columns/controls\";\n\n/** Shared column state and rename editors with genuine Naive UI controls. */\nexport function columnMenu(): StaticTableFeature {\n return extendFeature(bindingColumnMenu(), [\n slotRender(COLUMN_MENU, (props) => h(ColumnMenu<never>, { ...props })),\n slotRender(COLUMN_HEADER_RENAME, (props) =>\n h(ColumnHeaderRenameChrome, { ...props, slots: naiveColumnMenuSlots })\n ),\n ]);\n}\nexport { default as ColumnMenu } from \"./columns/ColumnMenu.vue\";\nexport type { ColumnMenuSlotProps } from \"@adapttable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"version":3,"file":"column-menu-Dh3hU7Vp.cjs","names":["naiveButton","h","NIcon","naiveInput","naiveSelect","managedOverlayPanel","NaiveManagedPopover","extendFeature","bindingColumnMenu","slotRender","COLUMN_MENU","h","ColumnMenu","COLUMN_HEADER_RENAME","ColumnHeaderRenameChrome"],"sources":["../src/columns/controls.ts","../src/columns/ColumnMenu.vue","../src/column-menu.ts"],"sourcesContent":["import {\n type ColumnMenuButtonProps,\n type ColumnMenuSlots,\n managedOverlayPanel,\n} from \"@adapttable/vue/adapter\";\nimport { NIcon } from \"naive-ui\";\nimport { h } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { naiveInput } from \"../controls/input\";\nimport { naiveSelect } from \"../controls/select\";\nimport { NaiveManagedPopover } from \"./NaiveManagedPopover\";\n\nconst icons = {\n grip: \"⠿\",\n visible: \"◉\",\n hidden: \"○\",\n pin: \"⌖\",\n more: \"⋯\",\n rename: \"✎\",\n};\nfunction button({ attrs, label, icon }: ColumnMenuButtonProps) {\n return naiveButton(\n attrs,\n icon\n ? h(NIcon, { \"aria-hidden\": true }, { default: () => icons[icon] })\n : label\n );\n}\n\nexport const naiveColumnMenuSlots: ColumnMenuSlots = {\n Trigger: button,\n Button: button,\n Input: naiveInput,\n Choice: naiveSelect,\n Panel: managedOverlayPanel((control) => h(NaiveManagedPopover, { control })),\n};\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n ColumnMenuChrome,\n type ColumnMenuSlotProps,\n useColumnMenu,\n} from \"@adapttable/vue/adapter\";\n\nimport { naiveColumnMenuSlots } from \"./controls\";\n\nconst props = defineProps<ColumnMenuSlotProps<TRow>>();\nconst model = useColumnMenu(() => props);\n</script>\n\n<template>\n <ColumnMenuChrome :model=\"model\" :slots=\"naiveColumnMenuSlots\" />\n</template>\n","import type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n COLUMN_HEADER_RENAME,\n COLUMN_MENU,\n ColumnHeaderRenameChrome,\n extendFeature,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { columnMenu as bindingColumnMenu } from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport ColumnMenu from \"./columns/ColumnMenu.vue\";\nimport { naiveColumnMenuSlots } from \"./columns/controls\";\n\n/** Shared column state and rename editors with genuine Naive UI controls. */\nexport function columnMenu(): StaticTableFeature {\n return extendFeature(bindingColumnMenu(), [\n slotRender(COLUMN_MENU, (props) => h(ColumnMenu<never>, { ...props })),\n slotRender(COLUMN_HEADER_RENAME, (props) =>\n h(ColumnHeaderRenameChrome, { ...props, slots: naiveColumnMenuSlots })\n ),\n ]);\n}\nexport { default as ColumnMenu } from \"./columns/ColumnMenu.vue\";\nexport type { ColumnMenuSlotProps } from \"@adapttable/vue/adapter\";\n"],"mappings":";;;;;;;;;AAaA,MAAM,QAAQ;CACZ,MAAM;CACN,SAAS;CACT,QAAQ;CACR,KAAK;CACL,MAAM;CACN,QAAQ;AACV;AACA,SAAS,OAAO,EAAE,OAAO,OAAO,QAA+B;CAC7D,OAAOA,eAAAA,YACL,OACA,QAAA,GACIC,IAAAA,EAAAA,CAAEC,SAAAA,OAAO,EAAE,eAAe,KAAK,GAAG,EAAE,eAAe,MAAM,MAAM,CAAC,IAChE,KACN;AACF;AAEA,MAAa,uBAAwC;CACnD,SAAS;CACT,QAAQ;CACR,OAAOC,cAAAA;CACP,QAAQC,eAAAA;CACR,QAAA,GAAOC,wBAAAA,oBAAAA,EAAqB,aAAA,GAAYJ,IAAAA,EAAAA,CAAEK,4BAAAA,qBAAqB,EAAE,QAAQ,CAAC,CAAC;AAC7E;;;;;;;;;;;;;;;;;;;;;;;;;EC3BA,MAAM,QAAQ;EACd,MAAM,SAAA,GAAQ,wBAAA,cAAA,OAAoB,KAAK;;GAIrC,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,EAAA,GAAiE,IAAA,MAAA,CAAA,wBAAA,gBAAA,GAAA;IAA9C,QAAA,GAAO,IAAA,MAAA,CAAA,KAAA;IAAQ,QAAA,GAAO,IAAA,MAAA,CAAA,oBAAA;;;;;;;;ACC3C,SAAgB,aAAiC;CAC/C,QAAA,GAAOC,wBAAAA,cAAAA,EAAAA,GAAcC,yBAAAA,WAAAA,CAAkB,GAAG,EAAA,GACxCC,wBAAAA,WAAAA,CAAWC,wBAAAA,cAAc,WAAA,GAAUC,IAAAA,EAAAA,CAAEC,WAAmB,EAAE,GAAG,MAAM,CAAC,CAAC,IAAA,GACrEH,wBAAAA,WAAAA,CAAWI,wBAAAA,uBAAuB,WAAA,GAChCF,IAAAA,EAAAA,CAAEG,wBAAAA,0BAA0B;EAAE,GAAG;EAAO,OAAO;CAAqB,CAAC,CACvE,CACF,CAAC;AACH"}
@@ -1,7 +1,7 @@
1
- import { t as naiveButton } from "./button-Cf1lslmX.js";
2
- import { t as naiveInput } from "./input-l5DTkb1E.js";
3
- import { t as naiveSelect } from "./select-BSo8XTMg.js";
4
- import { t as NaiveManagedPopover } from "./NaiveManagedPopover-DqSDYnef.js";
1
+ import { t as naiveButton } from "./button-BxXdDW7A.js";
2
+ import { t as naiveInput } from "./input-DZI_oY9v.js";
3
+ import { t as naiveSelect } from "./select-Bgc5ttop.js";
4
+ import { t as NaiveManagedPopover } from "./NaiveManagedPopover-XhOSQEWC.js";
5
5
  import { COLUMN_HEADER_RENAME, COLUMN_MENU, ColumnHeaderRenameChrome, ColumnMenuChrome, extendFeature, managedOverlayPanel, slotRender, useColumnMenu } from "@adapttable/vue/adapter";
6
6
  import { columnMenu } from "@adapttable/vue/features";
7
7
  import { createBlock, defineComponent, h, openBlock, unref } from "vue";
@@ -71,4 +71,4 @@ function columnMenu$1() {
71
71
  //#endregion
72
72
  export { _sfc_main as n, columnMenu$1 as t };
73
73
 
74
- //# sourceMappingURL=column-menu-B5xm8hhB.js.map
74
+ //# sourceMappingURL=column-menu-kVdaXqiU.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"column-menu-B5xm8hhB.js","names":["columnMenu","bindingColumnMenu","ColumnMenu"],"sources":["../src/columns/controls.ts","../src/columns/ColumnMenu.vue","../src/column-menu.ts"],"sourcesContent":["import {\n type ColumnMenuButtonProps,\n type ColumnMenuSlots,\n managedOverlayPanel,\n} from \"@adapttable/vue/adapter\";\nimport { NIcon } from \"naive-ui\";\nimport { h } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { naiveInput } from \"../controls/input\";\nimport { naiveSelect } from \"../controls/select\";\nimport { NaiveManagedPopover } from \"./NaiveManagedPopover\";\n\nconst icons = {\n grip: \"⠿\",\n visible: \"◉\",\n hidden: \"○\",\n pin: \"⌖\",\n more: \"⋯\",\n rename: \"✎\",\n};\nfunction button({ attrs, label, icon }: ColumnMenuButtonProps) {\n return naiveButton(\n attrs,\n icon\n ? h(NIcon, { \"aria-hidden\": true }, { default: () => icons[icon] })\n : label\n );\n}\n\nexport const naiveColumnMenuSlots: ColumnMenuSlots = {\n Trigger: button,\n Button: button,\n Input: naiveInput,\n Choice: naiveSelect,\n Panel: managedOverlayPanel((control) => h(NaiveManagedPopover, { control })),\n};\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n ColumnMenuChrome,\n type ColumnMenuSlotProps,\n useColumnMenu,\n} from \"@adapttable/vue/adapter\";\n\nimport { naiveColumnMenuSlots } from \"./controls\";\n\nconst props = defineProps<ColumnMenuSlotProps<TRow>>();\nconst model = useColumnMenu(() => props);\n</script>\n\n<template>\n <ColumnMenuChrome :model=\"model\" :slots=\"naiveColumnMenuSlots\" />\n</template>\n","import type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n COLUMN_HEADER_RENAME,\n COLUMN_MENU,\n ColumnHeaderRenameChrome,\n extendFeature,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { columnMenu as bindingColumnMenu } from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport ColumnMenu from \"./columns/ColumnMenu.vue\";\nimport { naiveColumnMenuSlots } from \"./columns/controls\";\n\n/** Shared column state and rename editors with genuine Naive UI controls. */\nexport function columnMenu(): StaticTableFeature {\n return extendFeature(bindingColumnMenu(), [\n slotRender(COLUMN_MENU, (props) => h(ColumnMenu<never>, { ...props })),\n slotRender(COLUMN_HEADER_RENAME, (props) =>\n h(ColumnHeaderRenameChrome, { ...props, slots: naiveColumnMenuSlots })\n ),\n ]);\n}\nexport { default as ColumnMenu } from \"./columns/ColumnMenu.vue\";\nexport type { ColumnMenuSlotProps } from \"@adapttable/vue/adapter\";\n"],"mappings":";;;;;;;;;AAaA,MAAM,QAAQ;CACZ,MAAM;CACN,SAAS;CACT,QAAQ;CACR,KAAK;CACL,MAAM;CACN,QAAQ;AACV;AACA,SAAS,OAAO,EAAE,OAAO,OAAO,QAA+B;CAC7D,OAAO,YACL,OACA,OACI,EAAE,OAAO,EAAE,eAAe,KAAK,GAAG,EAAE,eAAe,MAAM,MAAM,CAAC,IAChE,KACN;AACF;AAEA,MAAa,uBAAwC;CACnD,SAAS;CACT,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,OAAO,qBAAqB,YAAY,EAAE,qBAAqB,EAAE,QAAQ,CAAC,CAAC;AAC7E;;;;;;;;;;;;;;;;;;;;;;;;;EC3BA,MAAM,QAAQ;EACd,MAAM,QAAQ,oBAAoB,KAAK;;GAIrC,OAAA,UAAA,GAAA,YAAiE,MAAA,gBAAA,GAAA;IAA9C,OAAO,MAAA,KAAA;IAAQ,OAAO,MAAA,oBAAA;;;;;;;;ACC3C,SAAgBA,eAAiC;CAC/C,OAAO,cAAcC,WAAkB,GAAG,CACxC,WAAW,cAAc,UAAU,EAAEC,WAAmB,EAAE,GAAG,MAAM,CAAC,CAAC,GACrE,WAAW,uBAAuB,UAChC,EAAE,0BAA0B;EAAE,GAAG;EAAO,OAAO;CAAqB,CAAC,CACvE,CACF,CAAC;AACH"}
1
+ {"version":3,"file":"column-menu-kVdaXqiU.js","names":["columnMenu","bindingColumnMenu","ColumnMenu"],"sources":["../src/columns/controls.ts","../src/columns/ColumnMenu.vue","../src/column-menu.ts"],"sourcesContent":["import {\n type ColumnMenuButtonProps,\n type ColumnMenuSlots,\n managedOverlayPanel,\n} from \"@adapttable/vue/adapter\";\nimport { NIcon } from \"naive-ui\";\nimport { h } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { naiveInput } from \"../controls/input\";\nimport { naiveSelect } from \"../controls/select\";\nimport { NaiveManagedPopover } from \"./NaiveManagedPopover\";\n\nconst icons = {\n grip: \"⠿\",\n visible: \"◉\",\n hidden: \"○\",\n pin: \"⌖\",\n more: \"⋯\",\n rename: \"✎\",\n};\nfunction button({ attrs, label, icon }: ColumnMenuButtonProps) {\n return naiveButton(\n attrs,\n icon\n ? h(NIcon, { \"aria-hidden\": true }, { default: () => icons[icon] })\n : label\n );\n}\n\nexport const naiveColumnMenuSlots: ColumnMenuSlots = {\n Trigger: button,\n Button: button,\n Input: naiveInput,\n Choice: naiveSelect,\n Panel: managedOverlayPanel((control) => h(NaiveManagedPopover, { control })),\n};\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n ColumnMenuChrome,\n type ColumnMenuSlotProps,\n useColumnMenu,\n} from \"@adapttable/vue/adapter\";\n\nimport { naiveColumnMenuSlots } from \"./controls\";\n\nconst props = defineProps<ColumnMenuSlotProps<TRow>>();\nconst model = useColumnMenu(() => props);\n</script>\n\n<template>\n <ColumnMenuChrome :model=\"model\" :slots=\"naiveColumnMenuSlots\" />\n</template>\n","import type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n COLUMN_HEADER_RENAME,\n COLUMN_MENU,\n ColumnHeaderRenameChrome,\n extendFeature,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { columnMenu as bindingColumnMenu } from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport ColumnMenu from \"./columns/ColumnMenu.vue\";\nimport { naiveColumnMenuSlots } from \"./columns/controls\";\n\n/** Shared column state and rename editors with genuine Naive UI controls. */\nexport function columnMenu(): StaticTableFeature {\n return extendFeature(bindingColumnMenu(), [\n slotRender(COLUMN_MENU, (props) => h(ColumnMenu<never>, { ...props })),\n slotRender(COLUMN_HEADER_RENAME, (props) =>\n h(ColumnHeaderRenameChrome, { ...props, slots: naiveColumnMenuSlots })\n ),\n ]);\n}\nexport { default as ColumnMenu } from \"./columns/ColumnMenu.vue\";\nexport type { ColumnMenuSlotProps } from \"@adapttable/vue/adapter\";\n"],"mappings":";;;;;;;;;AAaA,MAAM,QAAQ;CACZ,MAAM;CACN,SAAS;CACT,QAAQ;CACR,KAAK;CACL,MAAM;CACN,QAAQ;AACV;AACA,SAAS,OAAO,EAAE,OAAO,OAAO,QAA+B;CAC7D,OAAO,YACL,OACA,OACI,EAAE,OAAO,EAAE,eAAe,KAAK,GAAG,EAAE,eAAe,MAAM,MAAM,CAAC,IAChE,KACN;AACF;AAEA,MAAa,uBAAwC;CACnD,SAAS;CACT,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,OAAO,qBAAqB,YAAY,EAAE,qBAAqB,EAAE,QAAQ,CAAC,CAAC;AAC7E;;;;;;;;;;;;;;;;;;;;;;;;;EC3BA,MAAM,QAAQ;EACd,MAAM,QAAQ,oBAAoB,KAAK;;GAIrC,OAAA,UAAA,GAAA,YAAiE,MAAA,gBAAA,GAAA;IAA9C,OAAO,MAAA,KAAA;IAAQ,OAAO,MAAA,oBAAA;;;;;;;;ACC3C,SAAgBA,eAAiC;CAC/C,OAAO,cAAcC,WAAkB,GAAG,CACxC,WAAW,cAAc,UAAU,EAAEC,WAAmB,EAAE,GAAG,MAAM,CAAC,CAAC,GACrE,WAAW,uBAAuB,UAChC,EAAE,0BAA0B;EAAE,GAAG;EAAO,OAAO;CAAqB,CAAC,CACvE,CACF,CAAC;AACH"}
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_column_menu = require("./column-menu-Cd8Fm695.cjs");
2
+ const require_column_menu = require("./column-menu-Dh3hU7Vp.cjs");
3
3
  exports.ColumnMenu = require_column_menu._sfc_main;
4
4
  exports.columnMenu = require_column_menu.columnMenu;
@@ -1,2 +1,2 @@
1
- import { n as _sfc_main, t as columnMenu } from "./column-menu-B5xm8hhB.js";
1
+ import { n as _sfc_main, t as columnMenu } from "./column-menu-kVdaXqiU.js";
2
2
  export { _sfc_main as ColumnMenu, columnMenu };
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_button = require("./button-CVOchGam.cjs");
3
- const require_input = require("./input-Cgm2r2YC.cjs");
2
+ const require_button = require("./button-CaakTzYM.cjs");
3
+ const require_input = require("./input-DPQy4L2b.cjs");
4
4
  const require_modalEscape = require("./modalEscape-aYoIK8OW.cjs");
5
5
  let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
6
6
  let _adapttable_vue_features = require("@adapttable/vue/features");