@adapttable/element-plus 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +14 -0
  2. package/dist/assistant-BcVKhdKt.cjs +328 -0
  3. package/dist/assistant-BcVKhdKt.cjs.map +1 -0
  4. package/dist/assistant-Dv4a3KEk.js +305 -0
  5. package/dist/assistant-Dv4a3KEk.js.map +1 -0
  6. package/dist/assistant.cjs +5 -308
  7. package/dist/assistant.js +1 -304
  8. package/dist/column-menu-BUiQUex0.d.cts +34 -0
  9. package/dist/column-menu-BUiQUex0.d.cts.map +1 -0
  10. package/dist/column-menu-C0YWdhRz.d.ts +34 -0
  11. package/dist/column-menu-C0YWdhRz.d.ts.map +1 -0
  12. package/dist/column-menu.d.cts +2 -34
  13. package/dist/column-menu.d.ts +2 -34
  14. package/dist/features.cjs +212 -0
  15. package/dist/features.d.cts +35 -0
  16. package/dist/features.d.ts +35 -0
  17. package/dist/features.js +31 -0
  18. package/dist/filters-BJDFrg_k.d.ts +54 -0
  19. package/dist/filters-BJDFrg_k.d.ts.map +1 -0
  20. package/dist/filters-BYHvvws9.d.cts +54 -0
  21. package/dist/filters-BYHvvws9.d.cts.map +1 -0
  22. package/dist/filters.d.cts +2 -54
  23. package/dist/filters.d.ts +2 -54
  24. package/dist/grouping-panel-B8gWD_90.js +146 -0
  25. package/dist/grouping-panel-B8gWD_90.js.map +1 -0
  26. package/dist/grouping-panel-B9AcU8lx.cjs +150 -0
  27. package/dist/grouping-panel-B9AcU8lx.cjs.map +1 -0
  28. package/dist/grouping-panel.cjs +3 -145
  29. package/dist/grouping-panel.js +2 -145
  30. package/dist/header-filters-B2B5RqQS.d.ts +24 -0
  31. package/dist/header-filters-B2B5RqQS.d.ts.map +1 -0
  32. package/dist/header-filters-hGm_7LFO.d.cts +24 -0
  33. package/dist/header-filters-hGm_7LFO.d.cts.map +1 -0
  34. package/dist/header-filters.d.cts +2 -23
  35. package/dist/header-filters.d.ts +2 -23
  36. package/dist/preset.cjs +7 -7
  37. package/dist/preset.js +7 -7
  38. package/dist/row-actions-VRa4T6oF.d.cts +7 -0
  39. package/dist/row-actions-VRa4T6oF.d.cts.map +1 -0
  40. package/dist/row-actions-VRa4T6oF.d.ts +7 -0
  41. package/dist/row-actions-VRa4T6oF.d.ts.map +1 -0
  42. package/dist/row-actions.d.cts +2 -7
  43. package/dist/row-actions.d.ts +2 -7
  44. package/dist/row-pinning-B0WfYDZD.d.ts +8 -0
  45. package/dist/row-pinning-B0WfYDZD.d.ts.map +1 -0
  46. package/dist/row-pinning-LzBZmZcZ.d.cts +8 -0
  47. package/dist/row-pinning-LzBZmZcZ.d.cts.map +1 -0
  48. package/dist/row-pinning.d.cts +2 -8
  49. package/dist/row-pinning.d.ts +2 -8
  50. package/dist/row-reorder-BNscjPNy.cjs +161 -0
  51. package/dist/row-reorder-BNscjPNy.cjs.map +1 -0
  52. package/dist/row-reorder-kuiFvbsM.js +157 -0
  53. package/dist/row-reorder-kuiFvbsM.js.map +1 -0
  54. package/dist/row-reorder.cjs +2 -155
  55. package/dist/row-reorder.js +1 -156
  56. package/dist/rows.d.cts +2 -2
  57. package/dist/rows.d.ts +2 -2
  58. package/dist/styles.css +57 -57
  59. package/package.json +14 -3
  60. package/dist/assistant.cjs.map +0 -1
  61. package/dist/assistant.js.map +0 -1
  62. package/dist/column-menu.d.cts.map +0 -1
  63. package/dist/column-menu.d.ts.map +0 -1
  64. package/dist/filters.d.cts.map +0 -1
  65. package/dist/filters.d.ts.map +0 -1
  66. package/dist/grouping-panel.cjs.map +0 -1
  67. package/dist/grouping-panel.js.map +0 -1
  68. package/dist/header-filters.d.cts.map +0 -1
  69. package/dist/header-filters.d.ts.map +0 -1
  70. package/dist/row-actions.d.cts.map +0 -1
  71. package/dist/row-actions.d.ts.map +0 -1
  72. package/dist/row-pinning.d.cts.map +0 -1
  73. package/dist/row-pinning.d.ts.map +0 -1
  74. package/dist/row-reorder.cjs.map +0 -1
  75. package/dist/row-reorder.js.map +0 -1
@@ -1,157 +1,2 @@
1
- import { n as useClassNames } from "./classNamesContext-18Wbxy4F.js";
2
- import { t as elementButton } from "./button-DwB4UxI2.js";
3
- import { createBlock, defineComponent, h, nextTick, openBlock, shallowRef, useId, watch } from "vue";
4
- import { RowReorderChrome, extendFeature, rowReorderControlKey, slotRender, useScopeActivity } from "@adapttable/vue/adapter";
5
- import { ElDialog, ElOption, ElSelect } from "element-plus";
6
- import { rowReorder as rowReorder$1 } from "@adapttable/vue/features";
7
- import { useRowReorder } from "@adapttable/vue";
8
- //#region src/reorder/ElementRowMoveMenu.ts
9
- /** The shared controller owns target selection and pending confirmation. */
10
- const ElementRowMoveMenu = defineComponent((props) => {
11
- const active = useScopeActivity();
12
- let lifetime = 0;
13
- watch(active, () => lifetime++, { flush: "sync" });
14
- const trigger = shallowRef();
15
- const description = `adapttable-row-move-${useId()}`;
16
- return () => {
17
- const live = active.value;
18
- const ticket = lifetime;
19
- const items = props.items;
20
- const owner = props.confirmation;
21
- const isCurrent = () => live && active.value && ticket === lifetime;
22
- const finish = (kind) => {
23
- if (!isCurrent() || !owner) return;
24
- if (props.confirmation?.onConfirm === owner.onConfirm && props.confirmation.onCancel === owner.onCancel) owner[kind]();
25
- };
26
- return h("span", { "data-adapttable-part": "row-move-menu" }, [h(ElSelect, {
27
- ref: trigger,
28
- modelValue: "",
29
- placeholder: props.label,
30
- "aria-label": props.label,
31
- "data-adapttable-part": "row-move-menu-trigger",
32
- teleported: false,
33
- disabled: props.items.every((item) => item.disabled),
34
- validateEvent: false,
35
- "onUpdate:modelValue": (value) => {
36
- if (!isCurrent()) return;
37
- const item = items.find((item) => item.id === value);
38
- if (item && !item.disabled) item.onSelect();
39
- nextTick(() => {
40
- if (isCurrent()) trigger.value?.$forceUpdate();
41
- });
42
- }
43
- }, { default: () => props.items.map((item) => h(ElOption, {
44
- key: item.id,
45
- value: item.id,
46
- label: item.label,
47
- disabled: item.disabled,
48
- title: item.disabledReason,
49
- "data-adapttable-part": "row-move-menu-item"
50
- })) }), owner ? h(ElDialog, {
51
- modelValue: active.value,
52
- title: owner.title,
53
- showClose: false,
54
- destroyOnClose: true,
55
- "data-adapttable-part": "row-move-confirmation",
56
- "aria-describedby": description,
57
- width: "min(28rem, calc(100vw - 2rem))",
58
- appendToBody: false,
59
- beforeClose: () => finish("onCancel")
60
- }, {
61
- default: () => h("p", { id: description }, owner.description),
62
- footer: () => [elementButton({
63
- type: "button",
64
- "data-adapttable-part": "row-move-cancel",
65
- onClick: () => finish("onCancel")
66
- }, owner.cancelLabel), elementButton({
67
- type: "button",
68
- "data-adapttable-part": "row-move-confirm",
69
- onClick: () => finish("onConfirm")
70
- }, owner.confirmLabel)]
71
- }) : null]);
72
- };
73
- }, {
74
- name: "ElementRowMoveMenu",
75
- props: {
76
- label: { type: String },
77
- items: { type: Array },
78
- confirmation: { type: Object }
79
- }
80
- });
81
- //#endregion
82
- //#region src/reorder/elementReorderControls.ts
83
- const elementReorderControls = {
84
- Handle: ({ label, pressed, dragging, disabled, dragProps, onKeyDown, className }) => elementButton({
85
- type: "button",
86
- "aria-label": label,
87
- "aria-pressed": pressed,
88
- "data-dragging": dragging ? "" : void 0,
89
- "data-adapttable-part": "row-reorder-handle",
90
- "data-adapttable-grip": "",
91
- class: className,
92
- disabled,
93
- draggable: dragProps.draggable,
94
- onDragstart: (event) => {
95
- if (event.dataTransfer) dragProps.onDragStart({
96
- ...event,
97
- dataTransfer: event.dataTransfer,
98
- clientY: event.clientY,
99
- currentTarget: event.currentTarget instanceof HTMLElement ? event.currentTarget : null,
100
- preventDefault: () => event.preventDefault()
101
- });
102
- },
103
- onDragend: dragProps.onDragEnd,
104
- onKeydown: (event) => onKeyDown({
105
- key: event.key,
106
- currentTarget: event.currentTarget instanceof HTMLElement ? event.currentTarget : null,
107
- preventDefault: () => event.preventDefault()
108
- })
109
- }, "↕"),
110
- Button: ({ label, part, disabled, onClick, className }) => elementButton({
111
- type: "button",
112
- "aria-label": label,
113
- "data-adapttable-part": part,
114
- class: className,
115
- disabled,
116
- onClick
117
- }, label),
118
- Menu: (props) => h(ElementRowMoveMenu, props)
119
- };
120
- //#endregion
121
- //#region src/reorder/ElementRowReorder.vue
122
- const _sfc_main = /*@__PURE__*/ defineComponent({
123
- __name: "ElementRowReorder",
124
- props: {
125
- model: {},
126
- labels: {},
127
- mobile: { type: Boolean },
128
- classNames: {},
129
- rowId: {},
130
- localIndex: {},
131
- row: {},
132
- windowStart: {},
133
- rowCount: {}
134
- },
135
- setup(__props) {
136
- const props = __props;
137
- const names = useClassNames();
138
- const Render = () => RowReorderChrome({
139
- ...props,
140
- classNames: { ...names.value },
141
- slots: elementReorderControls
142
- });
143
- Render.props = [];
144
- return (_ctx, _cache) => {
145
- return openBlock(), createBlock(Render);
146
- };
147
- }
148
- });
149
- //#endregion
150
- //#region src/row-reorder.ts
151
- function rowReorder(onRowReorder, options) {
152
- return extendFeature(rowReorder$1(onRowReorder, options), [slotRender(rowReorderControlKey(), (props) => h(_sfc_main, { ...props }))]);
153
- }
154
- //#endregion
1
+ import { n as useRowReorder, t as rowReorder } from "./row-reorder-kuiFvbsM.js";
155
2
  export { rowReorder, useRowReorder };
156
-
157
- //# sourceMappingURL=row-reorder.js.map
package/dist/rows.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { rowActions } from "./row-actions.cjs";
2
- import { rowPinning } from "./row-pinning.cjs";
1
+ import { t as rowActions } from "./row-actions-VRa4T6oF.cjs";
2
+ import { t as rowPinning } from "./row-pinning-LzBZmZcZ.cjs";
3
3
  import { CellSpanAppearance, CellSpanRequest, ConfirmHandler, ConfirmRequest, ExtraRowKind, GetCellSpan, GetCellSpanArgs, PinnedRows, PinnedSummaryEntry, RowAction, RowHeight, RowMutationHandlers, RowPinSide, RowPinState, RowStyle } from "@adapttable/vue";
4
4
  import { ExtraEntry, ExtraRow } from "@adapttable/vue/adapter";
5
5
  import { RowAppearanceOptions, RowPinningFeatureOptions, cellSpan, extraRows, pinnedSummaryRows, rowAppearance } from "@adapttable/vue/features";
package/dist/rows.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { rowActions } from "./row-actions.js";
2
- import { rowPinning } from "./row-pinning.js";
1
+ import { t as rowActions } from "./row-actions-VRa4T6oF.js";
2
+ import { t as rowPinning } from "./row-pinning-B0WfYDZD.js";
3
3
  import { ExtraEntry, ExtraRow } from "@adapttable/vue/adapter";
4
4
  import { RowAppearanceOptions, RowPinningFeatureOptions, cellSpan, extraRows, pinnedSummaryRows, rowAppearance } from "@adapttable/vue/features";
5
5
  import { CellSpanAppearance, CellSpanRequest, ConfirmHandler, ConfirmRequest, ExtraRowKind, GetCellSpan, GetCellSpanArgs, PinnedRows, PinnedSummaryEntry, RowAction, RowHeight, RowMutationHandlers, RowPinSide, RowPinState, RowStyle } from "@adapttable/vue";
package/dist/styles.css CHANGED
@@ -479,6 +479,63 @@
479
479
  min-block-size: 44px;
480
480
  }
481
481
  }
482
+ .adapttable-element-plus-pivot {
483
+ flex-wrap: wrap;
484
+ gap: .75rem;
485
+ display: flex;
486
+ }
487
+
488
+ .adapttable-element-plus-pivot fieldset {
489
+ border: 1px solid var(--el-border-color);
490
+ border-radius: var(--el-border-radius-base);
491
+ gap: .5rem;
492
+ min-inline-size: 0;
493
+ margin: 0;
494
+ padding: .5rem .75rem .75rem;
495
+ display: grid;
496
+ }
497
+
498
+ .adapttable-element-plus-pivot [data-adapttable-part="pivot-field"] {
499
+ flex-wrap: wrap;
500
+ align-items: center;
501
+ gap: .375rem;
502
+ display: flex;
503
+ }
504
+ .adapttable-element-plus-assistant-panel, .adapttable-element-plus-assistant-window {
505
+ flex-direction: column;
506
+ min-inline-size: 18rem;
507
+ display: flex;
508
+ }
509
+
510
+ .adapttable-element-plus-assistant-input {
511
+ inline-size: 100%;
512
+ }
513
+
514
+ .adapttable-element-plus-approval-list {
515
+ gap: .5rem;
516
+ margin: 0;
517
+ padding: 0;
518
+ list-style: none;
519
+ display: grid;
520
+ }
521
+
522
+ .el-button.adapttable-element-edit-value {
523
+ justify-content: start;
524
+ inline-size: 100%;
525
+ min-inline-size: 0;
526
+ block-size: auto;
527
+ padding: 0;
528
+ border: 0;
529
+ color: inherit;
530
+ font: inherit;
531
+ text-align: inherit;
532
+ white-space: normal;
533
+ overflow-wrap: anywhere;
534
+ cursor: text;
535
+ }
536
+ .el-button.adapttable-element-edit-value > span {
537
+ min-inline-size: 0;
538
+ }
482
539
 
483
540
  .adapttable-element-grouping > .el-card__body {
484
541
  display: flex;
@@ -632,60 +689,3 @@
632
689
  border-style: solid;
633
690
  outline: 2px solid var(--el-color-danger);
634
691
  }
635
- .adapttable-element-plus-pivot {
636
- flex-wrap: wrap;
637
- gap: .75rem;
638
- display: flex;
639
- }
640
-
641
- .adapttable-element-plus-pivot fieldset {
642
- border: 1px solid var(--el-border-color);
643
- border-radius: var(--el-border-radius-base);
644
- gap: .5rem;
645
- min-inline-size: 12rem;
646
- margin: 0;
647
- padding: .5rem .75rem .75rem;
648
- display: grid;
649
- }
650
-
651
- .adapttable-element-plus-pivot [data-adapttable-part="pivot-field"] {
652
- flex-wrap: wrap;
653
- align-items: center;
654
- gap: .375rem;
655
- display: flex;
656
- }
657
- .adapttable-element-plus-assistant-panel, .adapttable-element-plus-assistant-window {
658
- flex-direction: column;
659
- min-inline-size: 18rem;
660
- display: flex;
661
- }
662
-
663
- .adapttable-element-plus-assistant-input {
664
- inline-size: 100%;
665
- }
666
-
667
- .adapttable-element-plus-approval-list {
668
- gap: .5rem;
669
- margin: 0;
670
- padding: 0;
671
- list-style: none;
672
- display: grid;
673
- }
674
-
675
- .el-button.adapttable-element-edit-value {
676
- justify-content: start;
677
- inline-size: 100%;
678
- min-inline-size: 0;
679
- block-size: auto;
680
- padding: 0;
681
- border: 0;
682
- color: inherit;
683
- font: inherit;
684
- text-align: inherit;
685
- white-space: normal;
686
- overflow-wrap: anywhere;
687
- cursor: text;
688
- }
689
- .el-button.adapttable-element-edit-value > span {
690
- min-inline-size: 0;
691
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adapttable/element-plus",
3
- "version": "0.1.3",
3
+ "version": "0.2.0",
4
4
  "description": "Element Plus data table controls for the AdaptTable Vue binding.",
5
5
  "license": "MIT",
6
6
  "author": "Orwa Mahmoud",
@@ -17,7 +17,7 @@
17
17
  "module": "./dist/index.js",
18
18
  "types": "./dist/index.d.ts",
19
19
  "dependencies": {
20
- "@adapttable/vue": "0.1.3"
20
+ "@adapttable/vue": "0.1.4"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "element-plus": "^2.14.7",
@@ -26,7 +26,8 @@
26
26
  "devDependencies": {
27
27
  "element-plus": "2.14.7",
28
28
  "vue": "^3.5.43",
29
- "@adapttable/i18n": "3.3.3"
29
+ "@adapttable/core": "3.10.0",
30
+ "@adapttable/i18n": "3.3.4"
30
31
  },
31
32
  "engines": {
32
33
  "node": ">=22.12.0"
@@ -453,6 +454,16 @@
453
454
  "types": "./dist/assistant.d.cts",
454
455
  "default": "./dist/assistant.cjs"
455
456
  }
457
+ },
458
+ "./features": {
459
+ "import": {
460
+ "types": "./dist/features.d.ts",
461
+ "default": "./dist/features.js"
462
+ },
463
+ "require": {
464
+ "types": "./dist/features.d.cts",
465
+ "default": "./dist/features.cjs"
466
+ }
456
467
  }
457
468
  },
458
469
  "repository": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"assistant.cjs","names":["h","ElDropdownItem","defineComponent","useScopeActivity","shallowRef","ElDropdown","elementButton","ElDropdownMenu","defineComponent","useScopeActivity","h","ElDrawer","elementButton","h","ElementInput","ElTag","ElementCard","ElementSelect","defineComponent","h","TableAssistantChrome","AgentApprovalChrome","createAdapterTableAssistantFeature","createAdapterAgentApprovalFeature"],"sources":["../src/assistant/ExamplesMenu.ts","../src/assistant/Sheet.ts","../src/assistant/controls.ts","../src/assistant.ts"],"sourcesContent":["import {\n type TableAssistantMenuProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type DropdownInstance,\n ElDropdown,\n ElDropdownItem,\n ElDropdownMenu,\n} from \"element-plus\";\nimport { defineComponent, h, type PropType, shallowRef, watch } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n\n/** One shortcut: its icon, title and optional description. */\nfunction menuItem(item: TableAssistantMenuProps[\"items\"][number]) {\n return h(\n ElDropdownItem,\n { key: item.id, command: item.id, \"data-adapttable-part\": item.part },\n {\n default: () => [\n item.icon,\n h(\"span\", [\n h(\"strong\", item.title),\n item.description ? h(\"small\", item.description) : null,\n ]),\n ],\n }\n );\n}\n\n/** The assistant's shortcuts in an Element Plus dropdown under its trigger. */\nexport const ElementExamplesMenu = defineComponent(\n (props: TableAssistantMenuProps) => {\n const active = useScopeActivity();\n const dropdown = shallowRef<DropdownInstance>();\n const trigger = shallowRef<HTMLElement | null>(null);\n const open = shallowRef(false);\n let generation = 0;\n watch(\n [active, () => props.disabled, () => props.items, () => props.onSelect],\n () => {\n generation++;\n dropdown.value?.handleClose();\n },\n { flush: \"sync\" }\n );\n // The menu closes itself on Escape and hands focus back to its trigger,\n // so an Escape inside it never reaches the surface around the trigger.\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.isComposing) return;\n event.preventDefault();\n event.stopPropagation();\n dropdown.value?.handleClose();\n trigger.value?.focus({ preventScroll: true });\n };\n return () => {\n if (!active.value) return null;\n const ticket = generation;\n const current = () =>\n active.value && !props.disabled && ticket === generation;\n return h(\n ElDropdown,\n {\n ref: dropdown,\n trigger: \"click\",\n persistent: false,\n hideTimeout: 0,\n disabled: props.disabled,\n maxHeight: props.maxHeight,\n onVisibleChange: (value: boolean) => {\n open.value = value;\n },\n onCommand: (id: unknown) => {\n if (\n current() &&\n typeof id === \"string\" &&\n props.items.some((item) => item.id === id)\n )\n props.onSelect(id);\n },\n },\n {\n default: () =>\n elementButton(\n {\n ref: (element: HTMLElement | null) => {\n trigger.value = element;\n },\n type: \"button\",\n disabled: props.disabled,\n \"aria-label\": props.label,\n title: props.label,\n class: props.className,\n \"data-adapttable-part\": props.part,\n onKeydown: (event: KeyboardEvent) => {\n if (open.value) keydown(event);\n },\n },\n [props.icon ?? props.label]\n ),\n dropdown: () =>\n h(\n ElDropdownMenu,\n // Captured on the list so an Escape from any item reaches it\n // before Element's own handling moves focus into the list.\n { \"aria-label\": props.label, onKeydownCapture: keydown },\n { default: () => props.items.map(menuItem) }\n ),\n }\n );\n };\n },\n {\n name: \"ElementExamplesMenu\",\n props: {\n label: { type: String as PropType<TableAssistantMenuProps[\"label\"]> },\n part: { type: String as PropType<TableAssistantMenuProps[\"part\"]> },\n className: {\n type: String as PropType<TableAssistantMenuProps[\"className\"]>,\n },\n icon: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n TableAssistantMenuProps[\"icon\"]\n >,\n default: undefined,\n },\n disabled: {\n type: Boolean as PropType<TableAssistantMenuProps[\"disabled\"]>,\n default: undefined,\n },\n items: { type: Array as PropType<TableAssistantMenuProps[\"items\"]> },\n onSelect: {\n type: Function as PropType<TableAssistantMenuProps[\"onSelect\"]>,\n },\n maxHeight: {\n type: String as PropType<TableAssistantMenuProps[\"maxHeight\"]>,\n },\n },\n }\n);\n","import {\n type TableAssistantSheetProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { ElDrawer } from \"element-plus\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\n/**\n * Chrome chooses initial and return focus; ElDrawer contains focus and owns\n * the portal. Escape and backdrop dismissal become one close request to the\n * host, and the drawer stays open until the host closes it.\n */\nexport const ElementAssistantSheet = defineComponent(\n (props: TableAssistantSheetProps) => {\n const active = useScopeActivity();\n const requestClose = () => {\n if (active.value && props.open) props.onClose();\n };\n const preventDefault = (event: Event) => event.preventDefault();\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.defaultPrevented || event.isComposing)\n return;\n event.preventDefault();\n event.stopPropagation();\n requestClose();\n };\n return () => {\n if (!active.value) return null;\n return h(\n ElDrawer,\n {\n modelValue: props.open,\n direction: props.dir === \"rtl\" ? \"ltr\" : \"rtl\",\n size: \"min(28rem, 100vw)\",\n withHeader: false,\n showClose: false,\n appendToBody: true,\n destroyOnClose: true,\n closeOnPressEscape: false,\n title: props.label,\n \"aria-label\": props.label,\n dir: props.dir,\n class: [\"adapttable-element-plus-assistant-sheet\", props.className],\n \"data-adapttable-part\": props.part,\n beforeClose: requestClose,\n onKeydown: keydown,\n // Chrome places the initial focus and returns it to the launcher;\n // the drawer's trap only keeps focus inside while open.\n \"on:focus-trap.focus-after-trapped\": preventDefault,\n \"on:focus-trap.focus-after-released\": preventDefault,\n },\n { default: () => props.children }\n );\n };\n },\n {\n name: \"ElementAssistantSheet\",\n props: {\n label: { type: String as PropType<TableAssistantSheetProps[\"label\"]> },\n part: { type: String as PropType<TableAssistantSheetProps[\"part\"]> },\n className: {\n type: String as PropType<TableAssistantSheetProps[\"className\"]>,\n },\n dir: { type: String as PropType<TableAssistantSheetProps[\"dir\"]> },\n open: {\n type: Boolean as PropType<TableAssistantSheetProps[\"open\"]>,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<TableAssistantSheetProps[\"onClose\"]>,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n TableAssistantSheetProps[\"children\"]\n >,\n default: undefined,\n },\n },\n }\n);\n","import type {\n ApprovalReviewSlots,\n TableAssistantSlots,\n} from \"@adapttable/vue/adapter\";\nimport { ElTag } from \"element-plus\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport { ElementExamplesMenu } from \"./ExamplesMenu\";\nimport { ElementAssistantSheet } from \"./Sheet\";\n\n/** Element Plus tag types for the assistant's status tones. */\nconst TAG_TYPE = {\n neutral: \"info\",\n busy: \"primary\",\n warning: \"warning\",\n danger: \"danger\",\n} as const;\n\nexport const elementAssistantControls: TableAssistantSlots = {\n Button: (props) =>\n elementButton(\n {\n type: \"button\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n \"aria-expanded\": props.expanded,\n title: props.tooltip,\n class: props.className,\n disabled: props.disabled,\n onClick: props.onClick,\n },\n [\n props.icon,\n props.iconOnly && props.icon ? null : (props.children ?? props.label),\n ]\n ),\n Composer: (props) =>\n h(ElementInput, {\n type: \"textarea\",\n rows: 1,\n value: props.value,\n disabled: props.disabled,\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n placeholder: props.placeholder,\n class: [\"adapttable-element-plus-assistant-input\", props.className],\n onChange: props.onChange,\n onKeydown: props.onKeyDown,\n }),\n Badge: (props) =>\n h(\n ElTag,\n {\n \"data-adapttable-part\": props.part,\n \"data-tone\": props.tone,\n type: TAG_TYPE[props.tone],\n size: \"small\",\n effect: \"light\",\n class: props.className,\n },\n { default: () => props.label }\n ),\n Panel: (props) =>\n h(\n ElementCard,\n {\n attrs: {\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-assistant-panel\", props.className],\n },\n },\n { default: () => props.children }\n ),\n Window: (props) =>\n h(\n ElementCard,\n {\n attrs: {\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-assistant-window\", props.className],\n style: props.style,\n },\n },\n { default: () => props.children }\n ),\n Sheet: (props) => h(ElementAssistantSheet, { ...props, key: props.part }),\n Menu: (props) => h(ElementExamplesMenu, props),\n LanguageChip: (props) =>\n h(ElementSelect, {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: props.className,\n disabled: props.disabled,\n value: props.value,\n options: props.options,\n onChange: props.onChange,\n }),\n};\n\nexport const elementApprovalControls: ApprovalReviewSlots = {\n Approve: elementAssistantControls.Button,\n Reject: elementAssistantControls.Button,\n Action: elementAssistantControls.Button,\n List: (props) =>\n h(\n \"ul\",\n {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-approval-list\", props.className],\n },\n [props.children]\n ),\n};\n","/** Optional assistant presentation; all conversation and approval state stays in the binding. */\nimport \"./assistant/assistant.css\";\n\nimport type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n AgentApprovalChrome,\n type AgentApprovalProps,\n createAdapterAgentApprovalFeature,\n createAdapterTableAssistantFeature,\n TableAssistantChrome,\n type TableAssistantProps,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport {\n elementApprovalControls,\n elementAssistantControls,\n} from \"./assistant/controls\";\n\nexport const TableAssistant = defineComponent(\n (props: TableAssistantProps) => () =>\n h(TableAssistantChrome, {\n ...props,\n accent: props.accent ?? \"var(--el-color-primary)\",\n slots: elementAssistantControls,\n }),\n {\n name: \"ElementTableAssistant\",\n props: {\n assistant: { type: Object as PropType<TableAssistantProps[\"assistant\"]> },\n speech: { type: Object as PropType<TableAssistantProps[\"speech\"]> },\n open: {\n type: Boolean as PropType<TableAssistantProps[\"open\"]>,\n default: undefined,\n },\n onOpenChange: {\n type: Function as PropType<TableAssistantProps[\"onOpenChange\"]>,\n },\n presentation: {\n type: String as PropType<TableAssistantProps[\"presentation\"]>,\n },\n labels: { type: Object as PropType<TableAssistantProps[\"labels\"]> },\n accent: { type: String as PropType<TableAssistantProps[\"accent\"]> },\n receipts: {\n type: Boolean as PropType<TableAssistantProps[\"receipts\"]>,\n default: undefined,\n },\n className: { type: String as PropType<TableAssistantProps[\"className\"]> },\n launcher: {\n type: Boolean as PropType<TableAssistantProps[\"launcher\"]>,\n default: undefined,\n },\n onSettings: {\n type: Function as PropType<TableAssistantProps[\"onSettings\"]>,\n },\n boundary: {\n type: [String, Object] as PropType<TableAssistantProps[\"boundary\"]>,\n },\n note: { type: String as PropType<TableAssistantProps[\"note\"]> },\n greeting: { type: String as PropType<TableAssistantProps[\"greeting\"]> },\n avatars: { type: Object as PropType<TableAssistantProps[\"avatars\"]> },\n messageAction: {\n type: Function as PropType<TableAssistantProps[\"messageAction\"]>,\n },\n approval: { type: Object as PropType<TableAssistantProps[\"approval\"]> },\n dir: { type: String as PropType<TableAssistantProps[\"dir\"]> },\n },\n }\n);\nexport const AgentApproval = defineComponent(\n (props: AgentApprovalProps) => () =>\n h(AgentApprovalChrome, { ...props, slots: elementApprovalControls }),\n {\n name: \"ElementAgentApproval\",\n props: {\n pending: { type: Object as PropType<AgentApprovalProps[\"pending\"]> },\n labels: { type: Object as PropType<AgentApprovalProps[\"labels\"]> },\n className: { type: String as PropType<AgentApprovalProps[\"className\"]> },\n buttonClassName: {\n type: String as PropType<AgentApprovalProps[\"buttonClassName\"]>,\n },\n },\n }\n);\nexport function tableAssistant(): StaticTableFeature {\n return createAdapterTableAssistantFeature((props) =>\n h(TableAssistant, props)\n );\n}\nexport function agentApproval(): StaticTableFeature {\n return createAdapterAgentApprovalFeature((props) => h(AgentApproval, props));\n}\nexport type {\n AgentApprovalProps,\n TableAssistantProps,\n} from \"@adapttable/vue/adapter\";\n"],"mappings":";;;;;;;;;;AAeA,SAAS,SAAS,MAAgD;CAChE,QAAA,GAAOA,IAAAA,EAAAA,CACLC,aAAAA,gBACA;EAAE,KAAK,KAAK;EAAI,SAAS,KAAK;EAAI,wBAAwB,KAAK;CAAK,GACpE,EACE,eAAe,CACb,KAAK,OAAA,GACLD,IAAAA,EAAAA,CAAE,QAAQ,EAAA,GACRA,IAAAA,EAAAA,CAAE,UAAU,KAAK,KAAK,GACtB,KAAK,eAAA,GAAcA,IAAAA,EAAAA,CAAE,SAAS,KAAK,WAAW,IAAI,IACpD,CAAC,CACH,EACF,CACF;AACF;;AAGA,MAAa,uBAAA,GAAsBE,IAAAA,gBAAAA,EAChC,UAAmC;CAClC,MAAM,UAAA,GAASC,wBAAAA,iBAAAA,CAAiB;CAChC,MAAM,YAAA,GAAWC,IAAAA,WAAAA,CAA6B;CAC9C,MAAM,WAAA,GAAUA,IAAAA,WA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EACX;EACA,cAAc,EACZ,MAAM,SACR;EACA,cAAc,EACZ,MAAM,OACR;EACA,QAAQ,EAAE,MAAM,OAAkD;EAClE,QAAQ,EAAE,MAAM,OAAkD;EAClE,UAAU;GACR,MAAM;GACN,SAAS,KAAA;EACX;EACA,WAAW,EAAE,MAAM,OAAqD;EACxE,UAAU;GACR,MAAM;GACN,SAAS,KAAA;EACX;EACA,YAAY,EACV,MAAM,SACR;EACA,UAAU,EACR,MAAM,CAAC,QAAQ,MAAM,EACvB;EACA,MAAM,EAAE,MAAM,OAAgD;EAC9D,UAAU,EAAE,MAAM,OAAoD;EACtE,SAAS,EAAE,MAAM,OAAmD;EACpE,eAAe,EACb,MAAM,SACR;EACA,UAAU,EAAE,MAAM,OAAoD;EACtE,KAAK,EAAE,MAAM,OAA+C;CAC9D;AACF,CACF;AACA,MAAa,iBAAA,GAAgBF,IAAAA,gBAAAA,EAC1B,iBAAA,GACCC,IAAAA,EAAAA,CAAEE,wBAAAA,qBAAqB;CAAE,GAAG;CAAO,OAAO;AAAwB,CAAC,GACrE;CACE,MAAM;CACN,OAAO;EACL,SAAS,EAAE,MAAM,OAAkD;EACnE,QAAQ,EAAE,MAAM,OAAiD;EACjE,WAAW,EAAE,MAAM,OAAoD;EACvE,iBAAiB,EACf,MAAM,OACR;CACF;AACF,CACF;AACA,SAAgB,iBAAqC;CACnD,QAAA,GAAOC,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 +0,0 @@
1
- {"version":3,"file":"assistant.js","names":["ElementInput","ElementSelect"],"sources":["../src/assistant/ExamplesMenu.ts","../src/assistant/Sheet.ts","../src/assistant/controls.ts","../src/assistant.ts"],"sourcesContent":["import {\n type TableAssistantMenuProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type DropdownInstance,\n ElDropdown,\n ElDropdownItem,\n ElDropdownMenu,\n} from \"element-plus\";\nimport { defineComponent, h, type PropType, shallowRef, watch } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n\n/** One shortcut: its icon, title and optional description. */\nfunction menuItem(item: TableAssistantMenuProps[\"items\"][number]) {\n return h(\n ElDropdownItem,\n { key: item.id, command: item.id, \"data-adapttable-part\": item.part },\n {\n default: () => [\n item.icon,\n h(\"span\", [\n h(\"strong\", item.title),\n item.description ? h(\"small\", item.description) : null,\n ]),\n ],\n }\n );\n}\n\n/** The assistant's shortcuts in an Element Plus dropdown under its trigger. */\nexport const ElementExamplesMenu = defineComponent(\n (props: TableAssistantMenuProps) => {\n const active = useScopeActivity();\n const dropdown = shallowRef<DropdownInstance>();\n const trigger = shallowRef<HTMLElement | null>(null);\n const open = shallowRef(false);\n let generation = 0;\n watch(\n [active, () => props.disabled, () => props.items, () => props.onSelect],\n () => {\n generation++;\n dropdown.value?.handleClose();\n },\n { flush: \"sync\" }\n );\n // The menu closes itself on Escape and hands focus back to its trigger,\n // so an Escape inside it never reaches the surface around the trigger.\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.isComposing) return;\n event.preventDefault();\n event.stopPropagation();\n dropdown.value?.handleClose();\n trigger.value?.focus({ preventScroll: true });\n };\n return () => {\n if (!active.value) return null;\n const ticket = generation;\n const current = () =>\n active.value && !props.disabled && ticket === generation;\n return h(\n ElDropdown,\n {\n ref: dropdown,\n trigger: \"click\",\n persistent: false,\n hideTimeout: 0,\n disabled: props.disabled,\n maxHeight: props.maxHeight,\n onVisibleChange: (value: boolean) => {\n open.value = value;\n },\n onCommand: (id: unknown) => {\n if (\n current() &&\n typeof id === \"string\" &&\n props.items.some((item) => item.id === id)\n )\n props.onSelect(id);\n },\n },\n {\n default: () =>\n elementButton(\n {\n ref: (element: HTMLElement | null) => {\n trigger.value = element;\n },\n type: \"button\",\n disabled: props.disabled,\n \"aria-label\": props.label,\n title: props.label,\n class: props.className,\n \"data-adapttable-part\": props.part,\n onKeydown: (event: KeyboardEvent) => {\n if (open.value) keydown(event);\n },\n },\n [props.icon ?? props.label]\n ),\n dropdown: () =>\n h(\n ElDropdownMenu,\n // Captured on the list so an Escape from any item reaches it\n // before Element's own handling moves focus into the list.\n { \"aria-label\": props.label, onKeydownCapture: keydown },\n { default: () => props.items.map(menuItem) }\n ),\n }\n );\n };\n },\n {\n name: \"ElementExamplesMenu\",\n props: {\n label: { type: String as PropType<TableAssistantMenuProps[\"label\"]> },\n part: { type: String as PropType<TableAssistantMenuProps[\"part\"]> },\n className: {\n type: String as PropType<TableAssistantMenuProps[\"className\"]>,\n },\n icon: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n TableAssistantMenuProps[\"icon\"]\n >,\n default: undefined,\n },\n disabled: {\n type: Boolean as PropType<TableAssistantMenuProps[\"disabled\"]>,\n default: undefined,\n },\n items: { type: Array as PropType<TableAssistantMenuProps[\"items\"]> },\n onSelect: {\n type: Function as PropType<TableAssistantMenuProps[\"onSelect\"]>,\n },\n maxHeight: {\n type: String as PropType<TableAssistantMenuProps[\"maxHeight\"]>,\n },\n },\n }\n);\n","import {\n type TableAssistantSheetProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { ElDrawer } from \"element-plus\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\n/**\n * Chrome chooses initial and return focus; ElDrawer contains focus and owns\n * the portal. Escape and backdrop dismissal become one close request to the\n * host, and the drawer stays open until the host closes it.\n */\nexport const ElementAssistantSheet = defineComponent(\n (props: TableAssistantSheetProps) => {\n const active = useScopeActivity();\n const requestClose = () => {\n if (active.value && props.open) props.onClose();\n };\n const preventDefault = (event: Event) => event.preventDefault();\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.defaultPrevented || event.isComposing)\n return;\n event.preventDefault();\n event.stopPropagation();\n requestClose();\n };\n return () => {\n if (!active.value) return null;\n return h(\n ElDrawer,\n {\n modelValue: props.open,\n direction: props.dir === \"rtl\" ? \"ltr\" : \"rtl\",\n size: \"min(28rem, 100vw)\",\n withHeader: false,\n showClose: false,\n appendToBody: true,\n destroyOnClose: true,\n closeOnPressEscape: false,\n title: props.label,\n \"aria-label\": props.label,\n dir: props.dir,\n class: [\"adapttable-element-plus-assistant-sheet\", props.className],\n \"data-adapttable-part\": props.part,\n beforeClose: requestClose,\n onKeydown: keydown,\n // Chrome places the initial focus and returns it to the launcher;\n // the drawer's trap only keeps focus inside while open.\n \"on:focus-trap.focus-after-trapped\": preventDefault,\n \"on:focus-trap.focus-after-released\": preventDefault,\n },\n { default: () => props.children }\n );\n };\n },\n {\n name: \"ElementAssistantSheet\",\n props: {\n label: { type: String as PropType<TableAssistantSheetProps[\"label\"]> },\n part: { type: String as PropType<TableAssistantSheetProps[\"part\"]> },\n className: {\n type: String as PropType<TableAssistantSheetProps[\"className\"]>,\n },\n dir: { type: String as PropType<TableAssistantSheetProps[\"dir\"]> },\n open: {\n type: Boolean as PropType<TableAssistantSheetProps[\"open\"]>,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<TableAssistantSheetProps[\"onClose\"]>,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n TableAssistantSheetProps[\"children\"]\n >,\n default: undefined,\n },\n },\n }\n);\n","import type {\n ApprovalReviewSlots,\n TableAssistantSlots,\n} from \"@adapttable/vue/adapter\";\nimport { ElTag } from \"element-plus\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport { ElementExamplesMenu } from \"./ExamplesMenu\";\nimport { ElementAssistantSheet } from \"./Sheet\";\n\n/** Element Plus tag types for the assistant's status tones. */\nconst TAG_TYPE = {\n neutral: \"info\",\n busy: \"primary\",\n warning: \"warning\",\n danger: \"danger\",\n} as const;\n\nexport const elementAssistantControls: TableAssistantSlots = {\n Button: (props) =>\n elementButton(\n {\n type: \"button\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n \"aria-expanded\": props.expanded,\n title: props.tooltip,\n class: props.className,\n disabled: props.disabled,\n onClick: props.onClick,\n },\n [\n props.icon,\n props.iconOnly && props.icon ? null : (props.children ?? props.label),\n ]\n ),\n Composer: (props) =>\n h(ElementInput, {\n type: \"textarea\",\n rows: 1,\n value: props.value,\n disabled: props.disabled,\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n placeholder: props.placeholder,\n class: [\"adapttable-element-plus-assistant-input\", props.className],\n onChange: props.onChange,\n onKeydown: props.onKeyDown,\n }),\n Badge: (props) =>\n h(\n ElTag,\n {\n \"data-adapttable-part\": props.part,\n \"data-tone\": props.tone,\n type: TAG_TYPE[props.tone],\n size: \"small\",\n effect: \"light\",\n class: props.className,\n },\n { default: () => props.label }\n ),\n Panel: (props) =>\n h(\n ElementCard,\n {\n attrs: {\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-assistant-panel\", props.className],\n },\n },\n { default: () => props.children }\n ),\n Window: (props) =>\n h(\n ElementCard,\n {\n attrs: {\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-assistant-window\", props.className],\n style: props.style,\n },\n },\n { default: () => props.children }\n ),\n Sheet: (props) => h(ElementAssistantSheet, { ...props, key: props.part }),\n Menu: (props) => h(ElementExamplesMenu, props),\n LanguageChip: (props) =>\n h(ElementSelect, {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: props.className,\n disabled: props.disabled,\n value: props.value,\n options: props.options,\n onChange: props.onChange,\n }),\n};\n\nexport const elementApprovalControls: ApprovalReviewSlots = {\n Approve: elementAssistantControls.Button,\n Reject: elementAssistantControls.Button,\n Action: elementAssistantControls.Button,\n List: (props) =>\n h(\n \"ul\",\n {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-approval-list\", props.className],\n },\n [props.children]\n ),\n};\n","/** Optional assistant presentation; all conversation and approval state stays in the binding. */\nimport \"./assistant/assistant.css\";\n\nimport type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n AgentApprovalChrome,\n type AgentApprovalProps,\n createAdapterAgentApprovalFeature,\n createAdapterTableAssistantFeature,\n TableAssistantChrome,\n type TableAssistantProps,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport {\n elementApprovalControls,\n elementAssistantControls,\n} from \"./assistant/controls\";\n\nexport const TableAssistant = defineComponent(\n (props: TableAssistantProps) => () =>\n h(TableAssistantChrome, {\n ...props,\n accent: props.accent ?? \"var(--el-color-primary)\",\n slots: elementAssistantControls,\n }),\n {\n name: \"ElementTableAssistant\",\n props: {\n assistant: { type: Object as PropType<TableAssistantProps[\"assistant\"]> },\n speech: { type: Object as PropType<TableAssistantProps[\"speech\"]> },\n open: {\n type: Boolean as PropType<TableAssistantProps[\"open\"]>,\n default: undefined,\n },\n onOpenChange: {\n type: Function as PropType<TableAssistantProps[\"onOpenChange\"]>,\n },\n presentation: {\n type: String as PropType<TableAssistantProps[\"presentation\"]>,\n },\n labels: { type: Object as PropType<TableAssistantProps[\"labels\"]> },\n accent: { type: String as PropType<TableAssistantProps[\"accent\"]> },\n receipts: {\n type: Boolean as PropType<TableAssistantProps[\"receipts\"]>,\n default: undefined,\n },\n className: { type: String as PropType<TableAssistantProps[\"className\"]> },\n launcher: {\n type: Boolean as PropType<TableAssistantProps[\"launcher\"]>,\n default: undefined,\n },\n onSettings: {\n type: Function as PropType<TableAssistantProps[\"onSettings\"]>,\n },\n boundary: {\n type: [String, Object] as PropType<TableAssistantProps[\"boundary\"]>,\n },\n note: { type: String as PropType<TableAssistantProps[\"note\"]> },\n greeting: { type: String as PropType<TableAssistantProps[\"greeting\"]> },\n avatars: { type: Object as PropType<TableAssistantProps[\"avatars\"]> },\n messageAction: {\n type: Function as PropType<TableAssistantProps[\"messageAction\"]>,\n },\n approval: { type: Object as PropType<TableAssistantProps[\"approval\"]> },\n dir: { type: String as PropType<TableAssistantProps[\"dir\"]> },\n },\n }\n);\nexport const AgentApproval = defineComponent(\n (props: AgentApprovalProps) => () =>\n h(AgentApprovalChrome, { ...props, slots: elementApprovalControls }),\n {\n name: \"ElementAgentApproval\",\n props: {\n pending: { type: Object as PropType<AgentApprovalProps[\"pending\"]> },\n labels: { type: Object as PropType<AgentApprovalProps[\"labels\"]> },\n className: { type: String as PropType<AgentApprovalProps[\"className\"]> },\n buttonClassName: {\n type: String as PropType<AgentApprovalProps[\"buttonClassName\"]>,\n },\n },\n }\n);\nexport function tableAssistant(): StaticTableFeature {\n return createAdapterTableAssistantFeature((props) =>\n h(TableAssistant, props)\n );\n}\nexport function agentApproval(): StaticTableFeature {\n return createAdapterAgentApprovalFeature((props) => h(AgentApproval, props));\n}\nexport type {\n AgentApprovalProps,\n TableAssistantProps,\n} from \"@adapttable/vue/adapter\";\n"],"mappings":";;;;;;;;;AAeA,SAAS,SAAS,MAAgD;CAChE,OAAO,EACL,gBACA;EAAE,KAAK,KAAK;EAAI,SAAS,KAAK;EAAI,wBAAwB,KAAK;CAAK,GACpE,EACE,eAAe,CACb,KAAK,MACL,EAAE,QAAQ,CACR,EAAE,UAAU,KAAK,KAAK,GACtB,KAAK,cAAc,EAAE,SAAS,KAAK,WAAW,IAAI,IACpD,CAAC,CACH,EACF,CACF;AACF;;AAGA,MAAa,sBAAsB,iBAChC,UAAmC;CAClC,MAAM,SAAS,iBAAiB;CAChC,MAAM,WAAW,WAA6B;CAC9C,MAAM,UAAU,WAA+B,IAAI;CACnD,MAAM,OAAO,WAAW,KAAK;CAC7B,IAAI,aAAa;CACjB,MACE;EAAC;QAAc,MAAM;QAAgB,MAAM;QAAa,MAAM;CAAQ,SAChE;EACJ;EACA,SAAS,OAAO,Y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O;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 +0,0 @@
1
- {"version":3,"file":"column-menu.d.cts","names":[],"sources":["../src/columns/ColumnMenu.ts","../src/column-menu.ts"],"mappings":";;;;iBAmCgB,WAAW,MACzB,OAAO,sBAAoB,OAC3B,SAAS,KAAK,uCAAsB,oBAAA,4BAAA;;;kBAFtB;;;;;mBAAA;mBAAA;;;;;;;;;;;;;;;;;iBCrBA,cAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"column-menu.d.ts","names":[],"sources":["../src/columns/ColumnMenu.ts","../src/column-menu.ts"],"mappings":";;;;iBAmCgB,WAAW,MACzB,OAAO,sBAAoB,OAC3B,SAAS,KAAK,uCAAsB,oBAAA,4BAAA;;;kBAFtB;;;;;mBAAA;mBAAA;;;;;;;;;;;;;;;;;iBCrBA,cAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"filters.d.cts","names":[],"sources":["../src/filters/ElementChecklistFilter.ts","../src/filters/ElementFilterField.vue","../src/filters/ElementFilterTree.ts","../src/filters.ts"],"mappings":";;;;;;iBA8EgB,uBAAuB,MACrC,OAAO,uBAAqB,OAC5B,SAAS,KAAK,uCAAsB,oBAAA,4BAAA;;;kBAFtB;MAAA;;;;cC1BV,eAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,oBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAuEO,qBAAc,cAAc,oBAAmB,qBAAA;IArEM,aAAA;eAqEwB;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,iBAAO;KACvB,oBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;;iBCIpF,kBAAkB,MAChC,OAAO,yBAAuB,OAC9B,SAAS,KAAK,uCAAsB,oBAAA,4BAAA;;;kBAFtB;;;;;;;;YAAA;;;;;;;iBC5HA,QAAQ,MACtB,gBAAe,YAAU,SACzB,UAAS,mBACR,aAAa"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"filters.d.ts","names":[],"sources":["../src/filters/ElementChecklistFilter.ts","../src/filters/ElementFilterField.vue","../src/filters/ElementFilterTree.ts","../src/filters.ts"],"mappings":";;;;;;iBA8EgB,uBAAuB,MACrC,OAAO,uBAAqB,OAC5B,SAAS,KAAK,uCAAsB,oBAAA,4BAAA;;;kBAFtB;MAAA;;;;cC1BV,eAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,oBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAuEO,qBAAc,cAAc,oBAAmB,qBAAA;IArEM,aAAA;eAqEwB;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,iBAAO;KACvB,oBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;;iBCIpF,kBAAkB,MAChC,OAAO,yBAAuB,OAC9B,SAAS,KAAK,uCAAsB,oBAAA,4BAAA;;;kBAFtB;;;;;;;;YAAA;;;;;;;iBC5HA,QAAQ,MACtB,gBAAe,YAAU,SACzB,UAAS,mBACR,aAAa"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"grouping-panel.cjs","names":["h","ElementCard","toVueAttrs","ElTag","elementButton","ElementSelect","ElementCheckbox","grouping","extendFeature","bindingGroupingPanel","slotRender","groupingPanelControlKey","h","ElementGroupingPanel"],"sources":["../src/grouping/elementGroupingControls.ts","../src/grouping/ElementGroupingPanel.vue","../src/grouping-panel.ts"],"sourcesContent":["import { type GroupingPanelSlots, toVueAttrs } from \"@adapttable/vue/adapter\";\nimport { ElTag } from \"element-plus\";\nimport { type ComputedRef, h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport type { DataTableClassNames } from \"../types\";\n\nexport function elementGroupingControls(\n names: ComputedRef<DataTableClassNames>\n): GroupingPanelSlots {\n return {\n Surface: ({ children, label, mobile, ...attrs }) =>\n h(\n ElementCard,\n {\n attrs: {\n ...toVueAttrs(attrs),\n class: [\"adapttable-element-grouping\", names.value.groupingPanel],\n role: \"group\",\n \"aria-label\": label,\n \"data-mobile\": mobile ? \"\" : undefined,\n },\n },\n {\n default: () => [\n h(\"span\", { class: \"adapttable-element-grouping-label\" }, label),\n children,\n ],\n }\n ),\n DropZone: ({ label, empty, active, dragging, dropProps, ...attrs }) =>\n h(\n \"span\",\n {\n ...attrs,\n ...toVueAttrs({ ...dropProps }),\n class: names.value.groupingDropZone,\n \"aria-label\": label,\n \"data-empty\": empty ? \"\" : undefined,\n \"data-active\": active ? \"\" : undefined,\n \"data-dragging\": dragging ? \"\" : undefined,\n },\n empty ? label : \"\"\n ),\n Chip: ({\n label,\n level,\n dragProps,\n keyboardProps,\n onRemove,\n removeLabel,\n ...attrs\n }) =>\n h(\n ElTag,\n {\n ...attrs,\n class: names.value.groupingChip,\n \"data-level\": level,\n size: \"large\",\n },\n {\n default: () => [\n elementButton(\n {\n ...toVueAttrs({ ...dragProps }),\n ...toVueAttrs({ ...keyboardProps }),\n type: \"button\",\n text: true,\n size: \"small\",\n class: names.value.groupingChipHandle,\n \"data-adapttable-part\": \"grouping-chip-handle\",\n },\n `${level}. ${label}`\n ),\n elementButton(\n {\n type: \"button\",\n text: true,\n size: \"small\",\n class: names.value.groupingChipRemove,\n \"aria-label\": removeLabel,\n \"data-adapttable-part\": \"grouping-chip-remove\",\n onClick: onRemove,\n },\n \"×\"\n ),\n ],\n }\n ),\n Select: ({ label, value, options, onChange, disabled, ...attrs }) =>\n h(ElementSelect, {\n ...attrs,\n value,\n options,\n disabled,\n placeholder: label,\n \"aria-label\": label,\n class:\n attrs[\"data-adapttable-part\"] === \"grouping-add\"\n ? names.value.groupingAdd\n : names.value.groupingAggregationOperation,\n onChange,\n }),\n RemoveZone: ({ label, active, dropProps, ...attrs }) =>\n h(\n \"span\",\n {\n ...attrs,\n ...toVueAttrs({ ...dropProps }),\n class: names.value.groupingRemoveZone,\n \"aria-label\": label,\n \"data-active\": active ? \"\" : undefined,\n },\n label\n ),\n AggregationItem: ({ label, readOnly, readOnlyLabel, children, ...attrs }) =>\n h(\n \"span\",\n {\n ...attrs,\n class: names.value.groupingAggregationItem,\n \"data-read-only\": readOnly ? \"\" : undefined,\n },\n [h(\"span\", label), readOnly ? h(\"span\", readOnlyLabel) : null, children]\n ),\n AggregationRemove: ({ label, onRemove, ...attrs }) =>\n elementButton(\n {\n ...attrs,\n type: \"button\",\n text: true,\n size: \"small\",\n class: names.value.groupingAggregationRemove,\n \"aria-label\": label,\n onClick: onRemove,\n },\n \"×\"\n ),\n AggregationPicker: ({ label, options, onToggle, disabled, ...attrs }) =>\n h(\n \"fieldset\",\n { ...attrs, class: names.value.groupingAggregationAdd, disabled },\n [\n h(\"legend\", label),\n ...options.map((option) =>\n h(ElementCheckbox, {\n key: option.value,\n checked: option.checked,\n label: option.label,\n labelVisible: true,\n disabled,\n \"data-adapttable-part\": \"grouping-aggregation-option\",\n onChange: (checked: boolean) => onToggle(option.value, checked),\n })\n ),\n ]\n ),\n AggregationRestore: ({ label, disabled, onRestore, ...attrs }) =>\n elementButton(\n {\n ...attrs,\n type: \"button\",\n class: names.value.groupingAggregationsRestore,\n disabled,\n onClick: onRestore,\n },\n label\n ),\n };\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport { type GroupingPanelProps } from \"@adapttable/vue\";\nimport { GroupingPanelChrome } from \"@adapttable/vue/adapter\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementGroupingControls } from \"./elementGroupingControls\";\n\ndefineOptions({ name: \"ElementGroupingPanel\" });\nconst props = defineProps<GroupingPanelProps<TRow>>();\nconst names = useClassNames();\nconst controls = elementGroupingControls(names);\nconst Render = () =>\n GroupingPanelChrome({\n ...props,\n classNames: names.value,\n slots: controls,\n });\n\n// Declare no props so Vue forwards all root attributes, including id and data-*.\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n\n<style>\n.adapttable-element-grouping > .el-card__body {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem;\n padding: 0.75rem 1rem;\n}\n.adapttable-element-grouping-label,\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-aggregations\"]::before {\n font-size: 0.8125rem;\n font-weight: 600;\n color: var(--el-text-color-secondary);\n margin-inline-end: 0.5rem;\n}\n.adapttable-element-grouping [data-adapttable-part=\"grouping-add\"] {\n inline-size: 15rem;\n max-inline-size: 100%;\n}\n.adapttable-element-grouping [data-adapttable-part=\"grouping-chip\"] {\n block-size: auto;\n padding: 0.125rem 0.25rem;\n}\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-chip\"]\n .el-tag__content {\n display: inline-flex;\n align-items: center;\n}\n.adapttable-element-grouping [data-adapttable-part=\"grouping-aggregations\"] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.75rem;\n flex-basis: 100%;\n min-inline-size: 0;\n margin: 0.25rem 0 0;\n padding: 0.75rem 0 0;\n border: 0;\n border-block-start: 1px solid var(--el-border-color-lighter);\n}\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-aggregations\"]::before {\n content: attr(aria-label);\n}\n.adapttable-element-grouping [data-adapttable-aggregation],\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-aggregation-item\"] {\n display: inline-flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem;\n min-inline-size: 0;\n max-inline-size: 100%;\n}\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-aggregation-operation\"] {\n inline-size: 8rem;\n max-inline-size: 100%;\n}\n.adapttable-element-grouping [data-adapttable-part=\"grouping-aggregation-add\"] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem 0.75rem;\n min-inline-size: 0;\n margin: 0;\n padding: 0;\n border: 0;\n}\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-aggregation-add\"]\n legend {\n float: inline-start;\n padding: 0;\n font-size: 0.8125rem;\n color: var(--el-text-color-secondary);\n}\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-aggregation-add\"]\n .el-checkbox {\n margin: 0;\n}\n.adapttable-element-grouping [data-adapttable-part=\"grouping-chip-remove\"],\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-aggregation-remove\"] {\n margin: 0;\n min-inline-size: 1.75rem;\n padding-inline: 0.375rem;\n}\n\n/* Keep insertion boundaries stable so the target never moves under the pointer. */\n.adapttable-element-grouping [data-adapttable-part=\"grouping-drop-zone\"] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n flex: 0 0 auto;\n min-inline-size: 10px;\n min-block-size: 32px;\n block-size: auto;\n margin-inline: 2px;\n padding: 0;\n border: 1px dashed color-mix(in srgb, currentColor 30%, transparent);\n border-radius: 4px;\n}\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-drop-zone\"][data-empty] {\n min-inline-size: 9rem;\n min-block-size: 44px;\n padding: 0.5rem;\n}\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-drop-zone\"][data-dragging] {\n opacity: 1;\n border-color: var(--el-color-primary);\n background: color-mix(in srgb, var(--el-color-primary) 8%, transparent);\n}\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-drop-zone\"][data-active] {\n border-style: solid;\n border-color: var(--el-color-primary);\n background: color-mix(in srgb, var(--el-color-primary) 22%, transparent);\n outline: 2px solid var(--el-color-primary);\n outline-offset: 1px;\n}\n.adapttable-element-grouping [data-adapttable-part=\"grouping-chip-handle\"] {\n cursor: grab;\n}\n.adapttable-element-grouping [data-grouping-dragging] {\n opacity: 0.5;\n cursor: grabbing;\n}\n.adapttable-element-grouping [data-adapttable-part=\"grouping-remove-zone\"] {\n display: flex;\n flex: 1 1 100%;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n min-block-size: 44px;\n padding: 0.5rem 0.75rem;\n border: 1px dashed var(--el-color-danger);\n border-radius: 6px;\n color: var(--el-color-danger);\n font-size: 0.8125rem;\n}\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-remove-zone\"][data-active] {\n background: color-mix(in srgb, var(--el-color-danger) 12%, transparent);\n border-style: solid;\n outline: 2px solid var(--el-color-danger);\n}\n</style>\n","import { type StaticTableFeature, type TableFeature } from \"@adapttable/vue\";\nimport {\n extendFeature,\n groupingPanelControlKey,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport {\n type GroupingExtras,\n groupingPanel as bindingGroupingPanel,\n type StaticGroupingExtras,\n} from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport { grouping } from \"./grouping\";\nimport ElementGroupingPanel from \"./grouping/ElementGroupingPanel.vue\";\nexport type { GroupingPanelProps } from \"@adapttable/vue\";\nexport type { GroupingExtras } from \"@adapttable/vue/features\";\nexport function groupingPanel(\n initialGroupBy?: string | readonly string[],\n extras?: StaticGroupingExtras\n): StaticTableFeature;\nexport function groupingPanel<TRow>(\n initialGroupBy?: string | readonly string[],\n extras?: GroupingExtras<TRow>\n): TableFeature<TRow>;\nexport function groupingPanel<TRow>(\n initialGroupBy?: string | readonly string[],\n extras: GroupingExtras<TRow> = {}\n): TableFeature<TRow> {\n const ordinary = grouping<TRow>([], extras);\n return extendFeature(bindingGroupingPanel<TRow>(initialGroupBy, extras), [\n ...(ordinary.renders ?? []),\n slotRender(groupingPanelControlKey<TRow>(), (props) =>\n h(ElementGroupingPanel<TRow>, { ...props })\n ),\n ]);\n}\n"],"mappings":";;;;;;;;;;;;AAUA,SAAgB,wBACd,OACoB;CACpB,OAAO;EACL,UAAU,EAAE,UAAU,OAAO,QAAQ,GAAG,aAAA,GACtCA,IAAAA,EAAAA,CACEC,oBAAAA,aACA,EACE,OAAO;GACL,IAAA,GAAGC,wBAAAA,WAAAA,CAAW,KAAK;GACnB,OAAO,CAAC,+BAA+B,MAAM,MAAM,aAAa;GAChE,MAAM;GACN,cAAc;GACd,eAAe,SAAS,KAAK,KAAA;EAC/B,EACF,GACA,EACE,eAAe,EAAA,GACbF,IAAAA,EAAAA,CAAE,QAAQ,EAAE,OAAO,oCAAoC,GAAG,KAAK,GAC/D,QACF,EACF,CACF;EACF,WAAW,EAAE,OAAO,OAAO,QAAQ,UAAU,WAAW,GAAG,aAAA,GACzDA,IAAAA,EAAAA,CACE,QACA;GACE,GAAG;GACH,IAAA,GAAGE,wBAAAA,WAAAA,CAAW,EAAE,GAAG,UAAU,CAAC;GAC9B,OAAO,MAAM,MAAM;GACnB,cAAc;GACd,cAAc,QAAQ,KAAK,KAAA;GAC3B,eAAe,SAAS,KAAK,KAAA;GAC7B,iBAAiB,WAAW,KAAK,KAAA;EACnC,GACA,QAAQ,QAAQ,EAClB;EACF,OAAO,EACL,OACA,OACA,WACA,eACA,UACA,aACA,GAAG,aAAA,GAEHF,IAAAA,EAAAA,CACEG,aAAAA,OACA;GACE,GAAG;GACH,OAAO,MAAM,MAAM;GACnB,cAAc;GACd,MAAM;EACR,GACA,EACE,eAAe,CACbC,eAAAA,cACE;GACE,IAAA,GAAGF,wBAAAA,WAAAA,CAAW,EAAE,GAAG,UAAU,CAAC;GAC9B,IAAA,GAAGA,wBAAAA,WAAAA,CAAW,EAAE,GAAG,cAAc,CAAC;GAClC,MAAM;GACN,MAAM;GAC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ElementCheckbox","grouping","bindingGroupingPanel","ElementGroupingPanel"],"sources":["../src/grouping/elementGroupingControls.ts","../src/grouping/ElementGroupingPanel.vue","../src/grouping-panel.ts"],"sourcesContent":["import { type GroupingPanelSlots, toVueAttrs } from \"@adapttable/vue/adapter\";\nimport { ElTag } from \"element-plus\";\nimport { type ComputedRef, h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport type { DataTableClassNames } from \"../types\";\n\nexport function elementGroupingControls(\n names: ComputedRef<DataTableClassNames>\n): GroupingPanelSlots {\n return {\n Surface: ({ children, label, mobile, ...attrs }) =>\n h(\n ElementCard,\n {\n attrs: {\n ...toVueAttrs(attrs),\n class: [\"adapttable-element-grouping\", names.value.groupingPanel],\n role: \"group\",\n \"aria-label\": label,\n \"data-mobile\": mobile ? \"\" : undefined,\n },\n },\n {\n default: () => [\n h(\"span\", { class: \"adapttable-element-grouping-label\" }, label),\n children,\n ],\n }\n ),\n DropZone: ({ label, empty, active, dragging, dropProps, ...attrs }) =>\n h(\n \"span\",\n {\n ...attrs,\n ...toVueAttrs({ ...dropProps }),\n class: names.value.groupingDropZone,\n \"aria-label\": label,\n \"data-empty\": empty ? \"\" : undefined,\n \"data-active\": active ? \"\" : undefined,\n \"data-dragging\": dragging ? \"\" : undefined,\n },\n empty ? label : \"\"\n ),\n Chip: ({\n label,\n level,\n dragProps,\n keyboardProps,\n onRemove,\n removeLabel,\n ...attrs\n }) =>\n h(\n ElTag,\n {\n ...attrs,\n class: names.value.groupingChip,\n \"data-level\": level,\n size: \"large\",\n },\n {\n default: () => [\n elementButton(\n {\n ...toVueAttrs({ ...dragProps }),\n ...toVueAttrs({ ...keyboardProps }),\n type: \"button\",\n text: true,\n size: \"small\",\n class: names.value.groupingChipHandle,\n \"data-adapttable-part\": \"grouping-chip-handle\",\n },\n `${level}. ${label}`\n ),\n elementButton(\n {\n type: \"button\",\n text: true,\n size: \"small\",\n class: names.value.groupingChipRemove,\n \"aria-label\": removeLabel,\n \"data-adapttable-part\": \"grouping-chip-remove\",\n onClick: onRemove,\n },\n \"×\"\n ),\n ],\n }\n ),\n Select: ({ label, value, options, onChange, disabled, ...attrs }) =>\n h(ElementSelect, {\n ...attrs,\n value,\n options,\n disabled,\n placeholder: label,\n \"aria-label\": label,\n class:\n attrs[\"data-adapttable-part\"] === \"grouping-add\"\n ? names.value.groupingAdd\n : names.value.groupingAggregationOperation,\n onChange,\n }),\n RemoveZone: ({ label, active, dropProps, ...attrs }) =>\n h(\n \"span\",\n {\n ...attrs,\n ...toVueAttrs({ ...dropProps }),\n class: names.value.groupingRemoveZone,\n \"aria-label\": label,\n \"data-active\": active ? \"\" : undefined,\n },\n label\n ),\n AggregationItem: ({ label, readOnly, readOnlyLabel, children, ...attrs }) =>\n h(\n \"span\",\n {\n ...attrs,\n class: names.value.groupingAggregationItem,\n \"data-read-only\": readOnly ? \"\" : undefined,\n },\n [h(\"span\", label), readOnly ? h(\"span\", readOnlyLabel) : null, children]\n ),\n AggregationRemove: ({ label, onRemove, ...attrs }) =>\n elementButton(\n {\n ...attrs,\n type: \"button\",\n text: true,\n size: \"small\",\n class: names.value.groupingAggregationRemove,\n \"aria-label\": label,\n onClick: onRemove,\n },\n \"×\"\n ),\n AggregationPicker: ({ label, options, onToggle, disabled, ...attrs }) =>\n h(\n \"fieldset\",\n { ...attrs, class: names.value.groupingAggregationAdd, disabled },\n [\n h(\"legend\", label),\n ...options.map((option) =>\n h(ElementCheckbox, {\n key: option.value,\n checked: option.checked,\n label: option.label,\n labelVisible: true,\n disabled,\n \"data-adapttable-part\": \"grouping-aggregation-option\",\n onChange: (checked: boolean) => onToggle(option.value, checked),\n })\n ),\n ]\n ),\n AggregationRestore: ({ label, disabled, onRestore, ...attrs }) =>\n elementButton(\n {\n ...attrs,\n type: \"button\",\n class: names.value.groupingAggregationsRestore,\n disabled,\n onClick: onRestore,\n },\n label\n ),\n };\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport { type GroupingPanelProps } from \"@adapttable/vue\";\nimport { GroupingPanelChrome } from \"@adapttable/vue/adapter\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementGroupingControls } from \"./elementGroupingControls\";\n\ndefineOptions({ name: \"ElementGroupingPanel\" });\nconst props = defineProps<GroupingPanelProps<TRow>>();\nconst names = useClassNames();\nconst controls = elementGroupingControls(names);\nconst Render = () =>\n GroupingPanelChrome({\n ...props,\n classNames: names.value,\n slots: controls,\n });\n\n// Declare no props so Vue forwards all root attributes, including id and data-*.\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n\n<style>\n.adapttable-element-grouping > .el-card__body {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem;\n padding: 0.75rem 1rem;\n}\n.adapttable-element-grouping-label,\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-aggregations\"]::before {\n font-size: 0.8125rem;\n font-weight: 600;\n color: var(--el-text-color-secondary);\n margin-inline-end: 0.5rem;\n}\n.adapttable-element-grouping [data-adapttable-part=\"grouping-add\"] {\n inline-size: 15rem;\n max-inline-size: 100%;\n}\n.adapttable-element-grouping [data-adapttable-part=\"grouping-chip\"] {\n block-size: auto;\n padding: 0.125rem 0.25rem;\n}\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-chip\"]\n .el-tag__content {\n display: inline-flex;\n align-items: center;\n}\n.adapttable-element-grouping [data-adapttable-part=\"grouping-aggregations\"] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.75rem;\n flex-basis: 100%;\n min-inline-size: 0;\n margin: 0.25rem 0 0;\n padding: 0.75rem 0 0;\n border: 0;\n border-block-start: 1px solid var(--el-border-color-lighter);\n}\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-aggregations\"]::before {\n content: attr(aria-label);\n}\n.adapttable-element-grouping [data-adapttable-aggregation],\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-aggregation-item\"] {\n display: inline-flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem;\n min-inline-size: 0;\n max-inline-size: 100%;\n}\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-aggregation-operation\"] {\n inline-size: 8rem;\n max-inline-size: 100%;\n}\n.adapttable-element-grouping [data-adapttable-part=\"grouping-aggregation-add\"] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem 0.75rem;\n min-inline-size: 0;\n margin: 0;\n padding: 0;\n border: 0;\n}\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-aggregation-add\"]\n legend {\n float: inline-start;\n padding: 0;\n font-size: 0.8125rem;\n color: var(--el-text-color-secondary);\n}\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-aggregation-add\"]\n .el-checkbox {\n margin: 0;\n}\n.adapttable-element-grouping [data-adapttable-part=\"grouping-chip-remove\"],\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-aggregation-remove\"] {\n margin: 0;\n min-inline-size: 1.75rem;\n padding-inline: 0.375rem;\n}\n\n/* Keep insertion boundaries stable so the target never moves under the pointer. */\n.adapttable-element-grouping [data-adapttable-part=\"grouping-drop-zone\"] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n flex: 0 0 auto;\n min-inline-size: 10px;\n min-block-size: 32px;\n block-size: auto;\n margin-inline: 2px;\n padding: 0;\n border: 1px dashed color-mix(in srgb, currentColor 30%, transparent);\n border-radius: 4px;\n}\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-drop-zone\"][data-empty] {\n min-inline-size: 9rem;\n min-block-size: 44px;\n padding: 0.5rem;\n}\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-drop-zone\"][data-dragging] {\n opacity: 1;\n border-color: var(--el-color-primary);\n background: color-mix(in srgb, var(--el-color-primary) 8%, transparent);\n}\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-drop-zone\"][data-active] {\n border-style: solid;\n border-color: var(--el-color-primary);\n background: color-mix(in srgb, var(--el-color-primary) 22%, transparent);\n outline: 2px solid var(--el-color-primary);\n outline-offset: 1px;\n}\n.adapttable-element-grouping [data-adapttable-part=\"grouping-chip-handle\"] {\n cursor: grab;\n}\n.adapttable-element-grouping [data-grouping-dragging] {\n opacity: 0.5;\n cursor: grabbing;\n}\n.adapttable-element-grouping [data-adapttable-part=\"grouping-remove-zone\"] {\n display: flex;\n flex: 1 1 100%;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n min-block-size: 44px;\n padding: 0.5rem 0.75rem;\n border: 1px dashed var(--el-color-danger);\n border-radius: 6px;\n color: var(--el-color-danger);\n font-size: 0.8125rem;\n}\n.adapttable-element-grouping\n [data-adapttable-part=\"grouping-remove-zone\"][data-active] {\n background: color-mix(in srgb, var(--el-color-danger) 12%, transparent);\n border-style: solid;\n outline: 2px solid var(--el-color-danger);\n}\n</style>\n","import { type StaticTableFeature, type TableFeature } from \"@adapttable/vue\";\nimport {\n extendFeature,\n groupingPanelControlKey,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport {\n type GroupingExtras,\n groupingPanel as bindingGroupingPanel,\n type StaticGroupingExtras,\n} from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport { grouping } from \"./grouping\";\nimport ElementGroupingPanel from \"./grouping/ElementGroupingPanel.vue\";\nexport type { GroupingPanelProps } from \"@adapttable/vue\";\nexport type { GroupingExtras } from \"@adapttable/vue/features\";\nexport function groupingPanel(\n initialGroupBy?: string | readonly string[],\n extras?: StaticGroupingExtras\n): StaticTableFeature;\nexport function groupingPanel<TRow>(\n initialGroupBy?: string | readonly string[],\n extras?: GroupingExtras<TRow>\n): TableFeature<TRow>;\nexport function groupingPanel<TRow>(\n initialGroupBy?: string | readonly string[],\n extras: GroupingExtras<TRow> = {}\n): TableFeature<TRow> {\n const ordinary = grouping<TRow>([], extras);\n return extendFeature(bindingGroupingPanel<TRow>(initialGroupBy, extras), [\n ...(ordinary.renders ?? []),\n slotRender(groupingPanelControlKey<TRow>(), (props) =>\n h(ElementGroupingPanel<TRow>, { ...props })\n ),\n ]);\n}\n"],"mappings":";;;;;;;;;;;;AAUA,SAAgB,wBACd,OACoB;CACpB,OAAO;EACL,UAAU,EAAE,UAAU,OAAO,QAAQ,GAAG,YACtC,EACE,aACA,EACE,OAAO;GACL,GAAG,WAAW,KAAK;GACnB,OAAO,CAAC,+BAA+B,MAAM,MAAM,aAAa;GAChE,MAAM;GACN,cAAc;GACd,eAAe,SAAS,KAAK,KAAA;EAC/B,EACF,GACA,EACE,eAAe,CACb,EAAE,QAAQ,EAAE,OAAO,oCAAoC,GAAG,KAAK,GAC/D,QACF,EACF,CACF;EACF,WAAW,EAAE,OAAO,OAAO,QAAQ,UAAU,WAAW,GAAG,YACzD,EACE,QACA;GACE,GAAG;GACH,GAAG,WAAW,EAAE,GAAG,UAAU,CAAC;GAC9B,OAAO,MAAM,MAAM;GACnB,cAAc;GACd,cAAc,QAAQ,KAAK,KAAA;GAC3B,eAAe,SAAS,KAAK,KAAA;GAC7B,iBAAiB,WAAW,KAAK,KAAA;EACnC,GACA,QAAQ,QAAQ,EAClB;EACF,OAAO,EACL,OACA,OACA,WACA,eACA,UACA,aACA,GAAG,YAEH,EACE,OACA;GACE,GAAG;GACH,OAAO,MAAM,MAAM;GACnB,cAAc;GACd,MAAM;EACR,GACA,EACE,eAAe,CACb,cACE;GACE,GAAG,WAAW,EAAE,GAAG,UAAU,CAAC;GAC9B,GAAG,WAAW,EAAE,GAAG,cAAc,CAAC;GAClC,MAAM;GACN,MAAM;GACN,MAAM;GACN,OAAO,MAAM,MAAM;GACnB,wBAAwB;EAC1B,GACA,GAAG,MAAM,IAAI,OACf,GACA,cACE;GACE,MAAM;GACN,MAAM;GACN,MAAM;GACN,OAAO,MAAM,MAAM;GACnB,cAAc;GACd,wBAAwB;GACxB,SAAS;EACX,GACA,G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;GACA,SAAS;EACX,GACA,KACF;CACJ;AACF;;;;;;;;;;;;;;ECrKA,MAAM,QAAQ;EACd,MAAM,QAAQ,cAAc;EAC5B,MAAM,WAAW,wBAAwB,KAAK;EAC9C,MAAM,eACJ,oBAAoB;GAClB,GAAG;GACH,YAAY,MAAM;GAClB,OAAO;EACT,CAAC;EAIH,OAAO,QAAQ,CAAA;;GAIb,OAAA,UAAA,GAAA,YAAU,MAAA;;;;;;ACCZ,SAAgB,cACd,gBACA,SAA+B,CAAC,GACZ;CACpB,MAAM,WAAWC,WAAe,CAAC,GAAG,MAAM;CAC1C,OAAO,cAAcC,gBAA2B,gBAAgB,MAAM,GAAG,CACvE,GAAI,SAAS,WAAW,CAAC,GACzB,WAAW,wBAA8B,IAAI,UAC3C,EAAEC,WAA4B,EAAE,GAAG,MAAM,CAAC,CAC5C,CACF,CAAC;AACH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"header-filters.d.cts","names":[],"sources":["../src/filters/ElementHeaderFilter.vue","../src/header-filters.ts"],"mappings":";;;;cAoEM,eAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,oBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAiEO,qBAAc,cAAc,oBAAmB,oBAAA,iBAA8B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,iBAAO;KACvB,oBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;;iBCtIpF,iBAAiB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"header-filters.d.ts","names":[],"sources":["../src/filters/ElementHeaderFilter.vue","../src/header-filters.ts"],"mappings":";;;;cAoEM,eAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,oBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAiEO,qBAAc,cAAc,oBAAmB,oBAAA,iBAA8B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,iBAAO;KACvB,oBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;;iBCtIpF,iBAAiB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"row-actions.d.cts","names":[],"sources":["../src/row-actions.ts"],"mappings":";;;iBAagB,WAAW,MACzB,mBAAmB,UAAU,SAC7B,WAAW,oBAAoB,QAC9B,aAAa"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"row-actions.d.ts","names":[],"sources":["../src/row-actions.ts"],"mappings":";;;iBAagB,WAAW,MACzB,mBAAmB,UAAU,SAC7B,WAAW,oBAAoB,QAC9B,aAAa"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"row-pinning.d.cts","names":[],"sources":["../src/row-pinning.ts"],"mappings":";;;;iBAYgB,WACd,UAAS,2BACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"row-pinning.d.ts","names":[],"sources":["../src/row-pinning.ts"],"mappings":";;;;iBAYgB,WACd,UAAS,2BACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"row-reorder.cjs","names":["defineComponent","useScopeActivity","shallowRef","useId","h","ElSelect","nextTick","ElOption","ElDialog","elementButton","elementButton","h","extendFeature","bindingRowReorder","slotRender","rowReorderControlKey","h","ElementRowReorder"],"sources":["../src/reorder/ElementRowMoveMenu.ts","../src/reorder/elementReorderControls.ts","../src/reorder/ElementRowReorder.vue","../src/row-reorder.ts"],"sourcesContent":["import {\n type RowMoveMenuSlotProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n ElDialog,\n ElOption,\n ElSelect,\n type SelectInstance,\n} from \"element-plus\";\nimport {\n defineComponent,\n h,\n nextTick,\n type PropType,\n shallowRef,\n useId,\n watch,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n/** The shared controller owns target selection and pending confirmation. */\nexport const ElementRowMoveMenu = defineComponent(\n (props: RowMoveMenuSlotProps) => {\n const active = useScopeActivity();\n let lifetime = 0;\n watch(active, () => lifetime++, { flush: \"sync\" });\n const trigger = shallowRef<SelectInstance>();\n const description = `adapttable-row-move-${useId()}`;\n return () => {\n const live = active.value;\n const ticket = lifetime;\n const items = props.items;\n const owner = props.confirmation;\n const isCurrent = () => live && active.value && ticket === lifetime;\n const finish = (kind: \"onConfirm\" | \"onCancel\") => {\n if (!isCurrent() || !owner) return;\n if (\n props.confirmation?.onConfirm === owner.onConfirm &&\n props.confirmation.onCancel === owner.onCancel\n )\n owner[kind]();\n };\n return h(\"span\", { \"data-adapttable-part\": \"row-move-menu\" }, [\n h(\n ElSelect,\n {\n ref: trigger,\n modelValue: \"\",\n placeholder: props.label,\n \"aria-label\": props.label,\n \"data-adapttable-part\": \"row-move-menu-trigger\",\n teleported: false,\n disabled: props.items.every((item) => item.disabled),\n validateEvent: false,\n \"onUpdate:modelValue\": (value: unknown) => {\n if (!isCurrent()) return;\n const item = items.find((item) => item.id === value);\n if (item && !item.disabled) item.onSelect();\n void nextTick(() => {\n if (isCurrent()) trigger.value?.$forceUpdate();\n });\n },\n },\n {\n default: () =>\n props.items.map((item) =>\n h(ElOption, {\n key: item.id,\n value: item.id,\n label: item.label,\n disabled: item.disabled,\n title: item.disabledReason,\n \"data-adapttable-part\": \"row-move-menu-item\",\n })\n ),\n }\n ),\n owner\n ? h(\n ElDialog,\n {\n modelValue: active.value,\n title: owner.title,\n showClose: false,\n destroyOnClose: true,\n \"data-adapttable-part\": \"row-move-confirmation\",\n \"aria-describedby\": description,\n width: \"min(28rem, calc(100vw - 2rem))\",\n appendToBody: false,\n beforeClose: () => finish(\"onCancel\"),\n },\n {\n default: () => h(\"p\", { id: description }, owner.description),\n footer: () => [\n elementButton(\n {\n type: \"button\",\n \"data-adapttable-part\": \"row-move-cancel\",\n onClick: () => finish(\"onCancel\"),\n },\n owner.cancelLabel\n ),\n elementButton(\n {\n type: \"button\",\n \"data-adapttable-part\": \"row-move-confirm\",\n onClick: () => finish(\"onConfirm\"),\n },\n owner.confirmLabel\n ),\n ],\n }\n )\n : null,\n ]);\n };\n },\n {\n name: \"ElementRowMoveMenu\",\n props: {\n label: { type: String as PropType<RowMoveMenuSlotProps[\"label\"]> },\n items: { type: Array as PropType<RowMoveMenuSlotProps[\"items\"]> },\n confirmation: {\n type: Object as PropType<RowMoveMenuSlotProps[\"confirmation\"]>,\n },\n },\n }\n);\n","import type { RowReorderControlSlots } from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport { ElementRowMoveMenu } from \"./ElementRowMoveMenu\";\n\nexport const elementReorderControls: RowReorderControlSlots = {\n Handle: ({\n label,\n pressed,\n dragging,\n disabled,\n dragProps,\n onKeyDown,\n className,\n }) =>\n elementButton(\n {\n type: \"button\",\n \"aria-label\": label,\n \"aria-pressed\": pressed,\n \"data-dragging\": dragging ? \"\" : undefined,\n \"data-adapttable-part\": \"row-reorder-handle\",\n \"data-adapttable-grip\": \"\",\n class: className,\n disabled,\n draggable: dragProps.draggable,\n onDragstart: (event: DragEvent) => {\n if (event.dataTransfer)\n dragProps.onDragStart({\n ...event,\n dataTransfer: event.dataTransfer,\n clientY: event.clientY,\n currentTarget:\n event.currentTarget instanceof HTMLElement\n ? event.currentTarget\n : null,\n preventDefault: () => event.preventDefault(),\n });\n },\n onDragend: dragProps.onDragEnd,\n onKeydown: (event: KeyboardEvent) =>\n onKeyDown({\n key: event.key,\n currentTarget:\n event.currentTarget instanceof HTMLElement\n ? event.currentTarget\n : null,\n preventDefault: () => event.preventDefault(),\n }),\n },\n \"↕\"\n ),\n Button: ({ label, part, disabled, onClick, className }) =>\n elementButton(\n {\n type: \"button\",\n \"aria-label\": label,\n \"data-adapttable-part\": part,\n class: className,\n disabled,\n onClick,\n },\n label\n ),\n Menu: (props) => h(ElementRowMoveMenu, props),\n};\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n RowReorderChrome,\n type RowReorderControlProps,\n} from \"@adapttable/vue/adapter\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementReorderControls } from \"./elementReorderControls\";\n\nconst props = defineProps<RowReorderControlProps<TRow>>();\nconst names = useClassNames();\nconst Render = () =>\n RowReorderChrome({\n ...props,\n classNames: { ...names.value },\n slots: elementReorderControls,\n });\n\n// Declare no props so Vue forwards all root attributes, including id and data-*.\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n","import type {\n RowReorderHandler,\n RowReorderOptions,\n TableFeature,\n} from \"@adapttable/vue\";\nimport {\n extendFeature,\n rowReorderControlKey,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { rowReorder as bindingRowReorder } from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport ElementRowReorder from \"./reorder/ElementRowReorder.vue\";\nexport {\n type RowReorderHandler,\n type RowReorderOptions,\n useRowReorder,\n} from \"@adapttable/vue\";\nexport function rowReorder<TRow>(\n onRowReorder: RowReorderHandler<TRow>,\n options?: RowReorderOptions<TRow>\n): TableFeature<TRow> {\n return extendFeature(bindingRowReorder(onRowReorder, options), [\n slotRender(rowReorderControlKey<TRow>(), (props) =>\n h(ElementRowReorder<TRow>, { ...props })\n ),\n ]);\n}\n"],"mappings":";;;;;;;;;AAsBA,MAAa,sBAAA,GAAqBA,IAAAA,gBAAAA,EAC/B,UAAgC;CAC/B,MAAM,UAAA,GAASC,wBAAAA,iBAAAA,CAAiB;CAChC,IAAI,WAAW;CACf,CAAA,GAAA,IAAA,MAAA,CAAM,cAAc,YAAY,EAAE,OAAO,OAAO,CAAC;CACjD,MAAM,WAAA,GAAUC,IAAAA,WAAAA,CAA2B;CAC3C,MAAM,cAAc,wBAAA,GAAuBC,IAAAA,MAAAA,CAAM;CACjD,aAAa;EACX,MAAM,OAAO,OAAO;EACp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AAA,GAAQ,wBAAA,uBAAA,CAAc;EAC5B,MAAM,gBAAA,GACJ,wBAAA,iBAAA,CAAiB;GACf,GAAG;GACH,YAAY,EAAE,GAAG,MAAM,MAAM;GAC7B,OAAO;EACT,CAAC;EAIH,OAAO,QAAQ,CAAA;;GAIb,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,CAAU,MAAA;;;;;;ACLZ,SAAgB,WACd,cACA,SACoB;CACpB,QAAA,GAAOC,wBAAAA,cAAAA,EAAAA,GAAcC,yBAAAA,WAAAA,CAAkB,cAAc,OAAO,GAAG,EAAA,GAC7DC,wBAAAA,WAAAA,EAAAA,GAAWC,wBAAAA,qBAAAA,CAA2B,IAAI,WAAA,GACxCC,IAAAA,EAAAA,CAAEC,WAAyB,EAAE,GAAG,MAAM,CAAC,CACzC,CACF,CAAC;AACH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"row-reorder.js","names":["bindingRowReorder","ElementRowReorder"],"sources":["../src/reorder/ElementRowMoveMenu.ts","../src/reorder/elementReorderControls.ts","../src/reorder/ElementRowReorder.vue","../src/row-reorder.ts"],"sourcesContent":["import {\n type RowMoveMenuSlotProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n ElDialog,\n ElOption,\n ElSelect,\n type SelectInstance,\n} from \"element-plus\";\nimport {\n defineComponent,\n h,\n nextTick,\n type PropType,\n shallowRef,\n useId,\n watch,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n/** The shared controller owns target selection and pending confirmation. */\nexport const ElementRowMoveMenu = defineComponent(\n (props: RowMoveMenuSlotProps) => {\n const active = useScopeActivity();\n let lifetime = 0;\n watch(active, () => lifetime++, { flush: \"sync\" });\n const trigger = shallowRef<SelectInstance>();\n const description = `adapttable-row-move-${useId()}`;\n return () => {\n const live = active.value;\n const ticket = lifetime;\n const items = props.items;\n const owner = props.confirmation;\n const isCurrent = () => live && active.value && ticket === lifetime;\n const finish = (kind: \"onConfirm\" | \"onCancel\") => {\n if (!isCurrent() || !owner) return;\n if (\n props.confirmation?.onConfirm === owner.onConfirm &&\n props.confirmation.onCancel === owner.onCancel\n )\n owner[kind]();\n };\n return h(\"span\", { \"data-adapttable-part\": \"row-move-menu\" }, [\n h(\n ElSelect,\n {\n ref: trigger,\n modelValue: \"\",\n placeholder: props.label,\n \"aria-label\": props.label,\n \"data-adapttable-part\": \"row-move-menu-trigger\",\n teleported: false,\n disabled: props.items.every((item) => item.disabled),\n validateEvent: false,\n \"onUpdate:modelValue\": (value: unknown) => {\n if (!isCurrent()) return;\n const item = items.find((item) => item.id === value);\n if (item && !item.disabled) item.onSelect();\n void nextTick(() => {\n if (isCurrent()) trigger.value?.$forceUpdate();\n });\n },\n },\n {\n default: () =>\n props.items.map((item) =>\n h(ElOption, {\n key: item.id,\n value: item.id,\n label: item.label,\n disabled: item.disabled,\n title: item.disabledReason,\n \"data-adapttable-part\": \"row-move-menu-item\",\n })\n ),\n }\n ),\n owner\n ? h(\n ElDialog,\n {\n modelValue: active.value,\n title: owner.title,\n showClose: false,\n destroyOnClose: true,\n \"data-adapttable-part\": \"row-move-confirmation\",\n \"aria-describedby\": description,\n width: \"min(28rem, calc(100vw - 2rem))\",\n appendToBody: false,\n beforeClose: () => finish(\"onCancel\"),\n },\n {\n default: () => h(\"p\", { id: description }, owner.description),\n footer: () => [\n elementButton(\n {\n type: \"button\",\n \"data-adapttable-part\": \"row-move-cancel\",\n onClick: () => finish(\"onCancel\"),\n },\n owner.cancelLabel\n ),\n elementButton(\n {\n type: \"button\",\n \"data-adapttable-part\": \"row-move-confirm\",\n onClick: () => finish(\"onConfirm\"),\n },\n owner.confirmLabel\n ),\n ],\n }\n )\n : null,\n ]);\n };\n },\n {\n name: \"ElementRowMoveMenu\",\n props: {\n label: { type: String as PropType<RowMoveMenuSlotProps[\"label\"]> },\n items: { type: Array as PropType<RowMoveMenuSlotProps[\"items\"]> },\n confirmation: {\n type: Object as PropType<RowMoveMenuSlotProps[\"confirmation\"]>,\n },\n },\n }\n);\n","import type { RowReorderControlSlots } from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport { ElementRowMoveMenu } from \"./ElementRowMoveMenu\";\n\nexport const elementReorderControls: RowReorderControlSlots = {\n Handle: ({\n label,\n pressed,\n dragging,\n disabled,\n dragProps,\n onKeyDown,\n className,\n }) =>\n elementButton(\n {\n type: \"button\",\n \"aria-label\": label,\n \"aria-pressed\": pressed,\n \"data-dragging\": dragging ? \"\" : undefined,\n \"data-adapttable-part\": \"row-reorder-handle\",\n \"data-adapttable-grip\": \"\",\n class: className,\n disabled,\n draggable: dragProps.draggable,\n onDragstart: (event: DragEvent) => {\n if (event.dataTransfer)\n dragProps.onDragStart({\n ...event,\n dataTransfer: event.dataTransfer,\n clientY: event.clientY,\n currentTarget:\n event.currentTarget instanceof HTMLElement\n ? event.currentTarget\n : null,\n preventDefault: () => event.preventDefault(),\n });\n },\n onDragend: dragProps.onDragEnd,\n onKeydown: (event: KeyboardEvent) =>\n onKeyDown({\n key: event.key,\n currentTarget:\n event.currentTarget instanceof HTMLElement\n ? event.currentTarget\n : null,\n preventDefault: () => event.preventDefault(),\n }),\n },\n \"↕\"\n ),\n Button: ({ label, part, disabled, onClick, className }) =>\n elementButton(\n {\n type: \"button\",\n \"aria-label\": label,\n \"data-adapttable-part\": part,\n class: className,\n disabled,\n onClick,\n },\n label\n ),\n Menu: (props) => h(ElementRowMoveMenu, props),\n};\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n RowReorderChrome,\n type RowReorderControlProps,\n} from \"@adapttable/vue/adapter\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementReorderControls } from \"./elementReorderControls\";\n\nconst props = defineProps<RowReorderControlProps<TRow>>();\nconst names = useClassNames();\nconst Render = () =>\n RowReorderChrome({\n ...props,\n classNames: { ...names.value },\n slots: elementReorderControls,\n });\n\n// Declare no props so Vue forwards all root attributes, including id and data-*.\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n","import type {\n RowReorderHandler,\n RowReorderOptions,\n TableFeature,\n} from \"@adapttable/vue\";\nimport {\n extendFeature,\n rowReorderControlKey,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { rowReorder as bindingRowReorder } from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport ElementRowReorder from \"./reorder/ElementRowReorder.vue\";\nexport {\n type RowReorderHandler,\n type RowReorderOptions,\n useRowReorder,\n} from \"@adapttable/vue\";\nexport function rowReorder<TRow>(\n onRowReorder: RowReorderHandler<TRow>,\n options?: RowReorderOptions<TRow>\n): TableFeature<TRow> {\n return extendFeature(bindingRowReorder(onRowReorder, options), [\n slotRender(rowReorderControlKey<TRow>(), (props) =>\n h(ElementRowReorder<TRow>, { ...props })\n ),\n ]);\n}\n"],"mappings":";;;;;;;;;AAsBA,MAAa,qBAAqB,iBAC/B,UAAgC;CAC/B,MAAM,SAAS,iBAAiB;CAChC,IAAI,WAAW;CACf,MAAM,cAAc,YAAY,EAAE,OAAO,OAAO,CAAC;CACjD,MAAM,UAAU,WAA2B;CAC3C,MAAM,cAAc,uBAAuB,MAAM;CACjD,aAAa;EACX,MAAM,OAAO,OAAO;EACpB,MAAM,SAAS;EACf,MAAM,QAAQ,MAAM;EACpB,MAAM,QAAQ,MAAM;EACpB,MAAM,kBAAkB,QAAQ,OAAO,SAAS,WAAW;EAC3D,MAAM,UAAU,SAAmC;GACjD,IAAI,CAAC,UAAU,KAAK,CAAC,OAAO;GAC5B,IACE,MAAM,cAAc,cAAc,MAAM,aACxC,MAAM,aAAa,aAAa,MAAM,UAEtC,MAAM,KAAK,CAAC;EAChB;EACA,OAAO,EAAE,QAAQ,EAAE,wBAAwB,gBAAgB,GAAG,CAC5D,EACE,UACA;GACE,KAAK;GACL,YAAY;GACZ,aAAa,MAAM;GACnB,cAAc,MAAM;GACpB,wBAAwB;GACxB,YAAY;GACZ,UAA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