@adapttable/element-plus 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +535 -2
- package/dist/ElementCard-BRZekaHr.cjs +41 -0
- package/dist/ElementCard-BRZekaHr.cjs.map +1 -0
- package/dist/ElementCard-DZdAU6x8.js +36 -0
- package/dist/ElementCard-DZdAU6x8.js.map +1 -0
- package/dist/ElementCheckbox-BQN4_eas.js +99 -0
- package/dist/ElementCheckbox-BQN4_eas.js.map +1 -0
- package/dist/ElementCheckbox-BewKx6sv.cjs +104 -0
- package/dist/ElementCheckbox-BewKx6sv.cjs.map +1 -0
- package/dist/ElementColumnMenuPanel-D7SdfclW.js +126 -0
- package/dist/ElementColumnMenuPanel-D7SdfclW.js.map +1 -0
- package/dist/ElementColumnMenuPanel-DRQbZVow.cjs +137 -0
- package/dist/ElementColumnMenuPanel-DRQbZVow.cjs.map +1 -0
- package/dist/ElementFilterHeaderRow-CR1aax4I.cjs +202 -0
- package/dist/ElementFilterHeaderRow-CR1aax4I.cjs.map +1 -0
- package/dist/ElementFilterHeaderRow-CjduRYN5.js +191 -0
- package/dist/ElementFilterHeaderRow-CjduRYN5.js.map +1 -0
- package/dist/ElementFilterHeaderRow.vue-aMWpPgI9.d.cts +33 -0
- package/dist/ElementFilterHeaderRow.vue-aMWpPgI9.d.cts.map +1 -0
- package/dist/ElementFilterHeaderRow.vue-aMWpPgI9.d.ts +33 -0
- package/dist/ElementFilterHeaderRow.vue-aMWpPgI9.d.ts.map +1 -0
- package/dist/ElementFilterSurface-DcPyYCK-.cjs +302 -0
- package/dist/ElementFilterSurface-DcPyYCK-.cjs.map +1 -0
- package/dist/ElementFilterSurface-DdvPfm1N.js +285 -0
- package/dist/ElementFilterSurface-DdvPfm1N.js.map +1 -0
- package/dist/ElementInput-BsoAvPfO.js +55 -0
- package/dist/ElementInput-BsoAvPfO.js.map +1 -0
- package/dist/ElementInput-vBVDBaLp.cjs +60 -0
- package/dist/ElementInput-vBVDBaLp.cjs.map +1 -0
- package/dist/ElementRowActions-BKfX2XRn.js +59 -0
- package/dist/ElementRowActions-BKfX2XRn.js.map +1 -0
- package/dist/ElementRowActions-B_rR7qSj.cjs +64 -0
- package/dist/ElementRowActions-B_rR7qSj.cjs.map +1 -0
- package/dist/ElementSelect-Cl5ZjuQM.js +65 -0
- package/dist/ElementSelect-Cl5ZjuQM.js.map +1 -0
- package/dist/ElementSelect-K1rRvu5q.cjs +70 -0
- package/dist/ElementSelect-K1rRvu5q.cjs.map +1 -0
- package/dist/assistant.cjs +301 -0
- package/dist/assistant.cjs.map +1 -0
- package/dist/assistant.d.cts +10 -0
- package/dist/assistant.d.cts.map +1 -0
- package/dist/assistant.d.ts +10 -0
- package/dist/assistant.d.ts.map +1 -0
- package/dist/assistant.js +297 -0
- package/dist/assistant.js.map +1 -0
- package/dist/batch-editing.cjs +4 -0
- package/dist/batch-editing.d.cts +2 -0
- package/dist/batch-editing.d.ts +2 -0
- package/dist/batch-editing.js +2 -0
- package/dist/bulk-actions.cjs +15 -0
- package/dist/bulk-actions.cjs.map +1 -0
- package/dist/bulk-actions.d.cts +6 -0
- package/dist/bulk-actions.d.cts.map +1 -0
- package/dist/bulk-actions.d.ts +6 -0
- package/dist/bulk-actions.d.ts.map +1 -0
- package/dist/bulk-actions.js +14 -0
- package/dist/bulk-actions.js.map +1 -0
- package/dist/button-BFjBL9m3.cjs +77 -0
- package/dist/button-BFjBL9m3.cjs.map +1 -0
- package/dist/button-DwB4UxI2.js +66 -0
- package/dist/button-DwB4UxI2.js.map +1 -0
- package/dist/cell-navigation-BXE28fwQ.cjs +85 -0
- package/dist/cell-navigation-BXE28fwQ.cjs.map +1 -0
- package/dist/cell-navigation-THnr6YdK.js +74 -0
- package/dist/cell-navigation-THnr6YdK.js.map +1 -0
- package/dist/cell-navigation.cjs +4 -0
- package/dist/cell-navigation.d.cts +9 -0
- package/dist/cell-navigation.d.cts.map +1 -0
- package/dist/cell-navigation.d.ts +9 -0
- package/dist/cell-navigation.d.ts.map +1 -0
- package/dist/cell-navigation.js +2 -0
- package/dist/cell-span.cjs +8 -0
- package/dist/cell-span.d.cts +2 -0
- package/dist/cell-span.d.ts +2 -0
- package/dist/cell-span.js +2 -0
- package/dist/checkbox-DhUYYwWe.cjs +26 -0
- package/dist/checkbox-DhUYYwWe.cjs.map +1 -0
- package/dist/classNamesContext-18Wbxy4F.js +2 -0
- package/dist/column-groups.cjs +8 -0
- package/dist/column-groups.d.cts +2 -0
- package/dist/column-groups.d.ts +2 -0
- package/dist/column-groups.js +2 -0
- package/dist/column-menu-CfqfyZzs.js +115 -0
- package/dist/column-menu-CfqfyZzs.js.map +1 -0
- package/dist/column-menu-DfTLlqC-.cjs +126 -0
- package/dist/column-menu-DfTLlqC-.cjs.map +1 -0
- package/dist/column-menu.cjs +4 -0
- package/dist/column-menu.d.cts +34 -0
- package/dist/column-menu.d.cts.map +1 -0
- package/dist/column-menu.d.ts +34 -0
- package/dist/column-menu.d.ts.map +1 -0
- package/dist/column-menu.js +2 -0
- package/dist/column-selection.cjs +3 -0
- package/dist/column-selection.d.cts +2 -0
- package/dist/column-selection.d.ts +2 -0
- package/dist/column-selection.js +2 -0
- package/dist/columns.cjs +26 -0
- package/dist/columns.d.cts +3 -0
- package/dist/columns.d.ts +3 -0
- package/dist/columns.js +2 -0
- package/dist/command-palette.cjs +43 -0
- package/dist/command-palette.cjs.map +1 -0
- package/dist/command-palette.d.cts +7 -0
- package/dist/command-palette.d.cts.map +1 -0
- package/dist/command-palette.d.ts +7 -0
- package/dist/command-palette.d.ts.map +1 -0
- package/dist/command-palette.js +42 -0
- package/dist/command-palette.js.map +1 -0
- package/dist/context-menu.cjs +34 -0
- package/dist/context-menu.cjs.map +1 -0
- package/dist/context-menu.d.cts +7 -0
- package/dist/context-menu.d.cts.map +1 -0
- package/dist/context-menu.d.ts +7 -0
- package/dist/context-menu.d.ts.map +1 -0
- package/dist/context-menu.js +33 -0
- package/dist/context-menu.js.map +1 -0
- package/dist/density-Bj1pck4x.cjs +82 -0
- package/dist/density-Bj1pck4x.cjs.map +1 -0
- package/dist/density-ChRp0NG3.js +77 -0
- package/dist/density-ChRp0NG3.js.map +1 -0
- package/dist/density.cjs +3 -0
- package/dist/density.d.cts +7 -0
- package/dist/density.d.cts.map +1 -0
- package/dist/density.d.ts +7 -0
- package/dist/density.d.ts.map +1 -0
- package/dist/density.js +2 -0
- package/dist/editing-BX-jUtdO.cjs +423 -0
- package/dist/editing-BX-jUtdO.cjs.map +1 -0
- package/dist/editing-BnLdNDlo.d.ts +60 -0
- package/dist/editing-BnLdNDlo.d.ts.map +1 -0
- package/dist/editing-C1Hy-MCQ.js +383 -0
- package/dist/editing-C1Hy-MCQ.js.map +1 -0
- package/dist/editing-Cg6ZNvSa.d.cts +60 -0
- package/dist/editing-Cg6ZNvSa.d.cts.map +1 -0
- package/dist/editing.cjs +22 -0
- package/dist/editing.d.cts +2 -0
- package/dist/editing.d.ts +2 -0
- package/dist/editing.js +2 -0
- package/dist/elementActionSlots-CbKE3WnM.js +8 -0
- package/dist/elementActionSlots-CbKE3WnM.js.map +1 -0
- package/dist/elementActionSlots-DlhU82H7.cjs +13 -0
- package/dist/elementActionSlots-DlhU82H7.cjs.map +1 -0
- package/dist/elementHierarchyControlSlots-Ctcmq3T2.js +21 -0
- package/dist/elementHierarchyControlSlots-Ctcmq3T2.js.map +1 -0
- package/dist/elementRemainingControls-BPGBbbUF.js +243 -0
- package/dist/elementRemainingControls-BPGBbbUF.js.map +1 -0
- package/dist/elementRemainingControls-CtY2jZWN.cjs +266 -0
- package/dist/elementRemainingControls-CtY2jZWN.cjs.map +1 -0
- package/dist/export-CL36qPVY.cjs +79 -0
- package/dist/export-CL36qPVY.cjs.map +1 -0
- package/dist/export-DR1t4N5Q.js +74 -0
- package/dist/export-DR1t4N5Q.js.map +1 -0
- package/dist/export.cjs +3 -0
- package/dist/export.d.cts +8 -0
- package/dist/export.d.cts.map +1 -0
- package/dist/export.d.ts +8 -0
- package/dist/export.d.ts.map +1 -0
- package/dist/export.js +2 -0
- package/dist/extra-rows.cjs +8 -0
- package/dist/extra-rows.d.cts +2 -0
- package/dist/extra-rows.d.ts +2 -0
- package/dist/extra-rows.js +2 -0
- package/dist/filters-BA8vjGzr.cjs +201 -0
- package/dist/filters-BA8vjGzr.cjs.map +1 -0
- package/dist/filters-Dg22pfUy.js +191 -0
- package/dist/filters-Dg22pfUy.js.map +1 -0
- package/dist/filters.cjs +14 -0
- package/dist/filters.d.cts +54 -0
- package/dist/filters.d.cts.map +1 -0
- package/dist/filters.d.ts +54 -0
- package/dist/filters.d.ts.map +1 -0
- package/dist/filters.js +3 -0
- package/dist/find-in-table--8ZBYijC.js +57 -0
- package/dist/find-in-table--8ZBYijC.js.map +1 -0
- package/dist/find-in-table-DOn2Hua1.cjs +61 -0
- package/dist/find-in-table-DOn2Hua1.cjs.map +1 -0
- package/dist/find-in-table.cjs +3 -0
- package/dist/find-in-table.d.cts +9 -0
- package/dist/find-in-table.d.cts.map +1 -0
- package/dist/find-in-table.d.ts +9 -0
- package/dist/find-in-table.d.ts.map +1 -0
- package/dist/find-in-table.js +2 -0
- package/dist/fit-columns.cjs +8 -0
- package/dist/fit-columns.d.cts +2 -0
- package/dist/fit-columns.d.ts +2 -0
- package/dist/fit-columns.js +2 -0
- package/dist/fullscreen.cjs +15 -0
- package/dist/fullscreen.cjs.map +1 -0
- package/dist/fullscreen.d.cts +6 -0
- package/dist/fullscreen.d.cts.map +1 -0
- package/dist/fullscreen.d.ts +6 -0
- package/dist/fullscreen.d.ts.map +1 -0
- package/dist/fullscreen.js +14 -0
- package/dist/fullscreen.js.map +1 -0
- package/dist/grouping-panel.cjs +144 -0
- package/dist/grouping-panel.cjs.map +1 -0
- package/dist/grouping-panel.d.cts +8 -0
- package/dist/grouping-panel.d.cts.map +1 -0
- package/dist/grouping-panel.d.ts +8 -0
- package/dist/grouping-panel.d.ts.map +1 -0
- package/dist/grouping-panel.js +144 -0
- package/dist/grouping-panel.js.map +1 -0
- package/dist/grouping.cjs +41 -0
- package/dist/grouping.cjs.map +1 -0
- package/dist/grouping.d.cts +10 -0
- package/dist/grouping.d.cts.map +1 -0
- package/dist/grouping.d.ts +10 -0
- package/dist/grouping.d.ts.map +1 -0
- package/dist/grouping.js +22 -0
- package/dist/grouping.js.map +1 -0
- package/dist/header-filters-B_WFdnIO.js +67 -0
- package/dist/header-filters-B_WFdnIO.js.map +1 -0
- package/dist/header-filters-DnlmROS8.cjs +77 -0
- package/dist/header-filters-DnlmROS8.cjs.map +1 -0
- package/dist/header-filters.cjs +7 -0
- package/dist/header-filters.d.cts +24 -0
- package/dist/header-filters.d.cts.map +1 -0
- package/dist/header-filters.d.ts +24 -0
- package/dist/header-filters.d.ts.map +1 -0
- package/dist/header-filters.js +3 -0
- package/dist/index.cjs +485 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +25 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +483 -0
- package/dist/index.js.map +1 -0
- package/dist/multi-sort.cjs +8 -0
- package/dist/multi-sort.d.cts +2 -0
- package/dist/multi-sort.d.ts +2 -0
- package/dist/multi-sort.js +2 -0
- package/dist/nested-table.cjs +8 -0
- package/dist/nested-table.d.cts +2 -0
- package/dist/nested-table.d.ts +2 -0
- package/dist/nested-table.js +2 -0
- package/dist/pinned-summary-rows.cjs +8 -0
- package/dist/pinned-summary-rows.d.cts +2 -0
- package/dist/pinned-summary-rows.d.ts +2 -0
- package/dist/pinned-summary-rows.js +2 -0
- package/dist/pivot.cjs +82 -0
- package/dist/pivot.cjs.map +1 -0
- package/dist/pivot.d.cts +11 -0
- package/dist/pivot.d.cts.map +1 -0
- package/dist/pivot.d.ts +11 -0
- package/dist/pivot.d.ts.map +1 -0
- package/dist/pivot.js +81 -0
- package/dist/pivot.js.map +1 -0
- package/dist/preset.cjs +40 -0
- package/dist/preset.cjs.map +1 -0
- package/dist/preset.d.cts +21 -0
- package/dist/preset.d.cts.map +1 -0
- package/dist/preset.d.ts +21 -0
- package/dist/preset.d.ts.map +1 -0
- package/dist/preset.js +38 -0
- package/dist/preset.js.map +1 -0
- package/dist/print.cjs +15 -0
- package/dist/print.cjs.map +1 -0
- package/dist/print.d.cts +6 -0
- package/dist/print.d.cts.map +1 -0
- package/dist/print.d.ts +6 -0
- package/dist/print.d.ts.map +1 -0
- package/dist/print.js +14 -0
- package/dist/print.js.map +1 -0
- package/dist/resizable-columns.cjs +8 -0
- package/dist/resizable-columns.d.cts +2 -0
- package/dist/resizable-columns.d.ts +2 -0
- package/dist/resizable-columns.js +2 -0
- package/dist/row-actions.cjs +15 -0
- package/dist/row-actions.cjs.map +1 -0
- package/dist/row-actions.d.cts +7 -0
- package/dist/row-actions.d.cts.map +1 -0
- package/dist/row-actions.d.ts +7 -0
- package/dist/row-actions.d.ts.map +1 -0
- package/dist/row-actions.js +14 -0
- package/dist/row-actions.js.map +1 -0
- package/dist/row-appearance.cjs +8 -0
- package/dist/row-appearance.d.cts +2 -0
- package/dist/row-appearance.d.ts +2 -0
- package/dist/row-appearance.js +2 -0
- package/dist/row-detail.cjs +28 -0
- package/dist/row-detail.d.cts +4 -0
- package/dist/row-detail.d.ts +4 -0
- package/dist/row-detail.js +4 -0
- package/dist/row-pinning.cjs +15 -0
- package/dist/row-pinning.cjs.map +1 -0
- package/dist/row-pinning.d.cts +8 -0
- package/dist/row-pinning.d.cts.map +1 -0
- package/dist/row-pinning.d.ts +8 -0
- package/dist/row-pinning.d.ts.map +1 -0
- package/dist/row-pinning.js +14 -0
- package/dist/row-pinning.js.map +1 -0
- package/dist/row-reorder.cjs +163 -0
- package/dist/row-reorder.cjs.map +1 -0
- package/dist/row-reorder.d.cts +6 -0
- package/dist/row-reorder.d.cts.map +1 -0
- package/dist/row-reorder.d.ts +6 -0
- package/dist/row-reorder.d.ts.map +1 -0
- package/dist/row-reorder.js +157 -0
- package/dist/row-reorder.js.map +1 -0
- package/dist/rowActionsSlot-CdnzwBmt.js +11 -0
- package/dist/rowActionsSlot-CdnzwBmt.js.map +1 -0
- package/dist/rowActionsSlot-Ps5hHI6n.cjs +21 -0
- package/dist/rowActionsSlot-Ps5hHI6n.cjs.map +1 -0
- package/dist/rows.cjs +30 -0
- package/dist/rows.d.cts +6 -0
- package/dist/rows.d.ts +6 -0
- package/dist/rows.js +4 -0
- package/dist/saved-views-BtC15-kG.js +135 -0
- package/dist/saved-views-BtC15-kG.js.map +1 -0
- package/dist/saved-views-DLiRBZ13.cjs +146 -0
- package/dist/saved-views-DLiRBZ13.cjs.map +1 -0
- package/dist/saved-views.cjs +4 -0
- package/dist/saved-views.d.cts +15 -0
- package/dist/saved-views.d.cts.map +1 -0
- package/dist/saved-views.d.ts +15 -0
- package/dist/saved-views.d.ts.map +1 -0
- package/dist/saved-views.js +2 -0
- package/dist/scrollbarGutter-B-QczwA9.cjs +21 -0
- package/dist/scrollbarGutter-B-QczwA9.cjs.map +1 -0
- package/dist/scrollbarGutter-BNp0-4l1.js +16 -0
- package/dist/scrollbarGutter-BNp0-4l1.js.map +1 -0
- package/dist/selection-stats.cjs +3 -0
- package/dist/selection-stats.d.cts +2 -0
- package/dist/selection-stats.d.ts +2 -0
- package/dist/selection-stats.js +2 -0
- package/dist/side-panel.cjs +29 -0
- package/dist/side-panel.cjs.map +1 -0
- package/dist/side-panel.d.cts +7 -0
- package/dist/side-panel.d.cts.map +1 -0
- package/dist/side-panel.d.ts +7 -0
- package/dist/side-panel.d.ts.map +1 -0
- package/dist/side-panel.js +28 -0
- package/dist/side-panel.js.map +1 -0
- package/dist/status-bar-C-XuZg77.cjs +78 -0
- package/dist/status-bar-C-XuZg77.cjs.map +1 -0
- package/dist/status-bar-DaWh0Agh.js +68 -0
- package/dist/status-bar-DaWh0Agh.js.map +1 -0
- package/dist/status-bar.cjs +4 -0
- package/dist/status-bar.d.cts +7 -0
- package/dist/status-bar.d.cts.map +1 -0
- package/dist/status-bar.d.ts +7 -0
- package/dist/status-bar.d.ts.map +1 -0
- package/dist/status-bar.js +2 -0
- package/dist/styles.css +434 -0
- package/dist/tree.cjs +21 -0
- package/dist/tree.d.cts +3 -0
- package/dist/tree.d.ts +3 -0
- package/dist/tree.js +3 -0
- package/dist/types-CLQKtnFl.d.cts +2 -0
- package/dist/types-CLQKtnFl.d.ts +2 -0
- package/dist/virtualize.cjs +8 -0
- package/dist/virtualize.d.cts +2 -0
- package/dist/virtualize.d.ts +2 -0
- package/dist/virtualize.js +2 -0
- package/package.json +473 -3
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
const require_button = require("./button-BFjBL9m3.cjs");
|
|
2
|
+
const require_ElementCheckbox = require("./ElementCheckbox-BewKx6sv.cjs");
|
|
3
|
+
const require_ElementInput = require("./ElementInput-vBVDBaLp.cjs");
|
|
4
|
+
const require_ElementSelect = require("./ElementSelect-K1rRvu5q.cjs");
|
|
5
|
+
const require_scrollbarGutter = require("./scrollbarGutter-B-QczwA9.cjs");
|
|
6
|
+
let vue = require("vue");
|
|
7
|
+
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
8
|
+
let element_plus = require("element-plus");
|
|
9
|
+
//#region src/filters/fieldControls.ts
|
|
10
|
+
function elementFilterControls(names) {
|
|
11
|
+
return {
|
|
12
|
+
Input: (control) => (0, vue.h)(require_ElementInput._sfc_main, {
|
|
13
|
+
...control.attrs,
|
|
14
|
+
value: control.value,
|
|
15
|
+
type: control.type,
|
|
16
|
+
class: names().filterInput,
|
|
17
|
+
onChange: control.onChange
|
|
18
|
+
}),
|
|
19
|
+
Select: (control) => (0, vue.h)(require_ElementSelect._sfc_main, {
|
|
20
|
+
...control.attrs,
|
|
21
|
+
value: control.value,
|
|
22
|
+
options: control.options,
|
|
23
|
+
class: control.attrs["data-adapttable-part"] === "filter-operator" ? names().filterOperator : names().filterSelect,
|
|
24
|
+
onChange: control.onChange
|
|
25
|
+
}),
|
|
26
|
+
Checkbox: (control) => (0, vue.h)(require_ElementCheckbox._sfc_main, {
|
|
27
|
+
...control.attrs,
|
|
28
|
+
checked: control.checked,
|
|
29
|
+
label: control.label,
|
|
30
|
+
labelVisible: true,
|
|
31
|
+
class: names().filterCheckbox,
|
|
32
|
+
onChange: control.onChange
|
|
33
|
+
})
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/filters/ElementBasicFilterField.vue
|
|
38
|
+
const _sfc_main$1 = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
39
|
+
name: "ElementBasicFilterField",
|
|
40
|
+
__name: "ElementBasicFilterField",
|
|
41
|
+
props: {
|
|
42
|
+
id: {},
|
|
43
|
+
def: {},
|
|
44
|
+
source: {},
|
|
45
|
+
labels: {},
|
|
46
|
+
registry: {},
|
|
47
|
+
classNames: {}
|
|
48
|
+
},
|
|
49
|
+
setup(__props) {
|
|
50
|
+
const props = __props;
|
|
51
|
+
const model = (0, _adapttable_vue_adapter.useFilterField)(() => props);
|
|
52
|
+
const controls = elementFilterControls(() => props.classNames ?? {});
|
|
53
|
+
const Render = () => (0, _adapttable_vue_adapter.FilterFieldChrome)({
|
|
54
|
+
model: model.value,
|
|
55
|
+
controls,
|
|
56
|
+
classNames: props.classNames
|
|
57
|
+
});
|
|
58
|
+
Render.props = [];
|
|
59
|
+
return (_ctx, _cache) => {
|
|
60
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)(Render);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/filters/ElementChecklistFilter.ts
|
|
66
|
+
const controls = {
|
|
67
|
+
Search: (control) => (0, vue.h)(require_ElementInput._sfc_main, {
|
|
68
|
+
type: "search",
|
|
69
|
+
value: control.value,
|
|
70
|
+
"aria-label": control.label,
|
|
71
|
+
"data-adapttable-part": "filter-checklist-search",
|
|
72
|
+
class: control.className,
|
|
73
|
+
onChange: control.onChange
|
|
74
|
+
}),
|
|
75
|
+
Button: (control) => require_button.elementButton({ onClick: control.onClick }, control.label),
|
|
76
|
+
Checkbox: (control) => (0, vue.h)("div", { class: "adapttable-element-plus-checklist-option" }, [(0, vue.h)(require_ElementCheckbox._sfc_main, {
|
|
77
|
+
"data-adapttable-part": "filter-checkbox",
|
|
78
|
+
class: control.className,
|
|
79
|
+
label: control.label,
|
|
80
|
+
labelVisible: true,
|
|
81
|
+
checked: control.checked,
|
|
82
|
+
onChange: control.onChange
|
|
83
|
+
}), (0, vue.h)(element_plus.ElText, {
|
|
84
|
+
class: control.countClassName,
|
|
85
|
+
"data-adapttable-part": "filter-checklist-count",
|
|
86
|
+
type: "info",
|
|
87
|
+
size: "small"
|
|
88
|
+
}, { default: () => control.count })])
|
|
89
|
+
};
|
|
90
|
+
const checklistRuntimeProps = {
|
|
91
|
+
def: { type: Object },
|
|
92
|
+
source: { type: Object },
|
|
93
|
+
labels: { type: Object },
|
|
94
|
+
classNames: { type: Object }
|
|
95
|
+
};
|
|
96
|
+
const ElementChecklistFilterPresentation = (0, vue.defineComponent)((props) => {
|
|
97
|
+
const model = (0, _adapttable_vue_adapter.useChecklistModel)(() => props);
|
|
98
|
+
return () => (0, _adapttable_vue_adapter.ChecklistChrome)({
|
|
99
|
+
model: model.value,
|
|
100
|
+
controls
|
|
101
|
+
});
|
|
102
|
+
}, {
|
|
103
|
+
name: "ElementChecklistFilterPresentation",
|
|
104
|
+
props: checklistRuntimeProps
|
|
105
|
+
});
|
|
106
|
+
/** Preserve the canonical row contract without exposing versioned instance helpers. */
|
|
107
|
+
function ElementChecklistFilter(props, context) {
|
|
108
|
+
return (0, vue.createVNode)(ElementChecklistFilterPresentation, {
|
|
109
|
+
...context.attrs,
|
|
110
|
+
...props
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
ElementChecklistFilter.props = Object.keys(checklistRuntimeProps);
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/filters/ElementFilterField.vue
|
|
116
|
+
const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
117
|
+
name: "ElementFilterField",
|
|
118
|
+
__name: "ElementFilterField",
|
|
119
|
+
props: {
|
|
120
|
+
id: {},
|
|
121
|
+
def: {},
|
|
122
|
+
source: {},
|
|
123
|
+
labels: {},
|
|
124
|
+
registry: {},
|
|
125
|
+
classNames: {}
|
|
126
|
+
},
|
|
127
|
+
setup(__props) {
|
|
128
|
+
const props = __props;
|
|
129
|
+
return (_ctx, _cache) => {
|
|
130
|
+
return (0, vue.unref)(_adapttable_vue_adapter.filterWidgetKind)(props.def, props.registry ?? (0, vue.unref)(_adapttable_vue_adapter.defaultFilterRegistry)) === "checklist" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(element_plus.ElFormItem), {
|
|
131
|
+
key: 0,
|
|
132
|
+
label: (0, vue.unref)(_adapttable_vue_adapter.filterLabel)(props.def),
|
|
133
|
+
class: (0, vue.normalizeClass)(props.classNames?.filterField),
|
|
134
|
+
"data-adapttable-part": "filter-field"
|
|
135
|
+
}, {
|
|
136
|
+
default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(ElementChecklistFilter), {
|
|
137
|
+
def: props.def,
|
|
138
|
+
source: props.source,
|
|
139
|
+
labels: props.labels,
|
|
140
|
+
"class-names": props.classNames
|
|
141
|
+
}, null, 8, [
|
|
142
|
+
"def",
|
|
143
|
+
"source",
|
|
144
|
+
"labels",
|
|
145
|
+
"class-names"
|
|
146
|
+
])]),
|
|
147
|
+
_: 1
|
|
148
|
+
}, 8, ["label", "class"])) : ((0, vue.openBlock)(), (0, vue.createBlock)(_sfc_main$1, (0, vue.normalizeProps)((0, vue.mergeProps)({ key: 1 }, props)), null, 16));
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/filters/ElementFilterSurface.ts
|
|
154
|
+
/** Kit overlays retain their own positioning, focus trap and modal backdrop. */
|
|
155
|
+
const ElementFilterSurface = (0, vue.defineComponent)((props) => {
|
|
156
|
+
const mounted = (0, vue.shallowRef)(false);
|
|
157
|
+
const active = (0, _adapttable_vue_adapter.useScopeActivity)();
|
|
158
|
+
const fullscreen = (0, _adapttable_vue_adapter.useFeatureState)(_adapttable_vue_adapter.FULLSCREEN_MODEL);
|
|
159
|
+
const panel = (0, vue.shallowRef)();
|
|
160
|
+
(0, vue.onMounted)(() => {
|
|
161
|
+
mounted.value = true;
|
|
162
|
+
});
|
|
163
|
+
const close = (reason) => {
|
|
164
|
+
if (!active.value || !props.open) return;
|
|
165
|
+
props.onClose(reason);
|
|
166
|
+
if (reason === "escape") {
|
|
167
|
+
const anchor = props.anchor;
|
|
168
|
+
(0, vue.nextTick)(() => {
|
|
169
|
+
if (active.value && !props.open && props.anchor === anchor && anchor?.isConnected) anchor.focus();
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
const outside = (event) => {
|
|
174
|
+
const target = event.target;
|
|
175
|
+
if (target instanceof Node && props.anchor?.contains(target)) return;
|
|
176
|
+
close("outside");
|
|
177
|
+
};
|
|
178
|
+
const keydown = (event) => {
|
|
179
|
+
if (event.key !== "Escape") return;
|
|
180
|
+
if (event.defaultPrevented || event.isComposing) {
|
|
181
|
+
event.stopPropagation();
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
event.preventDefault();
|
|
185
|
+
event.stopPropagation();
|
|
186
|
+
close("escape");
|
|
187
|
+
};
|
|
188
|
+
const captureKeydown = (event) => {
|
|
189
|
+
const target = event.target;
|
|
190
|
+
if (target instanceof Element && target.getAttribute("role") === "combobox" && target.getAttribute("aria-expanded") === "false") keydown(event);
|
|
191
|
+
};
|
|
192
|
+
const focusPanel = () => {
|
|
193
|
+
const element = panel.value?.$el;
|
|
194
|
+
if (!active.value || !props.open || !(element instanceof HTMLElement)) return;
|
|
195
|
+
const focused = element.ownerDocument.activeElement;
|
|
196
|
+
if (focused === props.anchor || focused === element.ownerDocument.body) element.focus();
|
|
197
|
+
};
|
|
198
|
+
return () => {
|
|
199
|
+
if (!mounted.value || !active.value) return null;
|
|
200
|
+
if (props.modal) return (0, vue.h)(element_plus.ElDrawer, {
|
|
201
|
+
modelValue: props.open,
|
|
202
|
+
title: props.label,
|
|
203
|
+
direction: props.dir === "rtl" ? "ltr" : "rtl",
|
|
204
|
+
appendTo: props.container ?? fullscreen.value?.container ?? "body",
|
|
205
|
+
appendToBody: true,
|
|
206
|
+
modal: true,
|
|
207
|
+
modalClass: props.backdropClassName,
|
|
208
|
+
withHeader: false,
|
|
209
|
+
showClose: false,
|
|
210
|
+
destroyOnClose: true,
|
|
211
|
+
size: "min(30rem, 100%)",
|
|
212
|
+
dir: props.dir,
|
|
213
|
+
class: props.className,
|
|
214
|
+
"data-adapttable-part": "filters-panel",
|
|
215
|
+
beforeClose: () => close("outside"),
|
|
216
|
+
onKeydown: keydown,
|
|
217
|
+
onKeydownCapture: captureKeydown
|
|
218
|
+
}, { default: () => props.children });
|
|
219
|
+
if (!props.anchor) return null;
|
|
220
|
+
return (0, vue.h)(element_plus.ElPopover, {
|
|
221
|
+
visible: props.open,
|
|
222
|
+
virtualTriggering: true,
|
|
223
|
+
virtualRef: props.anchor,
|
|
224
|
+
trigger: "click",
|
|
225
|
+
role: "dialog",
|
|
226
|
+
"aria-label": props.label,
|
|
227
|
+
placement: props.dir === "rtl" ? "bottom-end" : "bottom-start",
|
|
228
|
+
appendTo: props.container ?? fullscreen.value?.container ?? "body",
|
|
229
|
+
teleported: true,
|
|
230
|
+
persistent: false,
|
|
231
|
+
showArrow: false,
|
|
232
|
+
width: "min(28rem, calc(100vw - 1rem))",
|
|
233
|
+
popperClass: "adapttable-element-plus-filter-popover",
|
|
234
|
+
popperStyle: {
|
|
235
|
+
padding: 0,
|
|
236
|
+
translate: `${require_scrollbarGutter.rtlScrollbarGutter(props.dir, props.anchor?.ownerDocument.defaultView)} 0`
|
|
237
|
+
},
|
|
238
|
+
onAfterEnter: focusPanel
|
|
239
|
+
}, { default: () => (0, vue.withDirectives)((0, vue.h)(element_plus.ElCard, {
|
|
240
|
+
ref: panel,
|
|
241
|
+
shadow: "never",
|
|
242
|
+
dir: props.dir,
|
|
243
|
+
tabindex: -1,
|
|
244
|
+
"aria-label": props.label,
|
|
245
|
+
"data-adapttable-part": props.part ?? "filters-popover",
|
|
246
|
+
class: props.className,
|
|
247
|
+
onKeydown: keydown,
|
|
248
|
+
onKeydownCapture: captureKeydown
|
|
249
|
+
}, { default: () => props.children }), [[element_plus.ClickOutside, outside]]) });
|
|
250
|
+
};
|
|
251
|
+
}, {
|
|
252
|
+
name: "ElementFilterSurface",
|
|
253
|
+
props: {
|
|
254
|
+
className: { type: String },
|
|
255
|
+
open: {
|
|
256
|
+
type: Boolean,
|
|
257
|
+
default: void 0
|
|
258
|
+
},
|
|
259
|
+
label: { type: String },
|
|
260
|
+
dir: { type: String },
|
|
261
|
+
anchor: { type: Object },
|
|
262
|
+
container: { type: Object },
|
|
263
|
+
children: {
|
|
264
|
+
type: [
|
|
265
|
+
String,
|
|
266
|
+
Number,
|
|
267
|
+
Boolean,
|
|
268
|
+
Array,
|
|
269
|
+
Object
|
|
270
|
+
],
|
|
271
|
+
default: void 0
|
|
272
|
+
},
|
|
273
|
+
onClose: { type: Function },
|
|
274
|
+
modal: {
|
|
275
|
+
type: Boolean,
|
|
276
|
+
default: void 0
|
|
277
|
+
},
|
|
278
|
+
part: { type: String },
|
|
279
|
+
backdropClassName: { type: String }
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
//#endregion
|
|
283
|
+
Object.defineProperty(exports, "ElementChecklistFilter", {
|
|
284
|
+
enumerable: true,
|
|
285
|
+
get: function() {
|
|
286
|
+
return ElementChecklistFilter;
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
Object.defineProperty(exports, "ElementFilterSurface", {
|
|
290
|
+
enumerable: true,
|
|
291
|
+
get: function() {
|
|
292
|
+
return ElementFilterSurface;
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
Object.defineProperty(exports, "_sfc_main", {
|
|
296
|
+
enumerable: true,
|
|
297
|
+
get: function() {
|
|
298
|
+
return _sfc_main;
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
//# sourceMappingURL=ElementFilterSurface-DcPyYCK-.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElementFilterSurface-DcPyYCK-.cjs","names":["h","ElementInput","ElementSelect","ElementCheckbox","h","ElementInput","elementButton","ElementCheckbox","ElText","defineComponent","useChecklistModel","ChecklistChrome","createVNode","defineComponent","shallowRef","useScopeActivity","useFeatureState","FULLSCREEN_MODEL","nextTick","h","ElDrawer","ElPopover","rtlScrollbarGutter","withDirectives","ElCard","ClickOutside"],"sources":["../src/filters/fieldControls.ts","../src/filters/ElementBasicFilterField.vue","../src/filters/ElementChecklistFilter.ts","../src/filters/ElementFilterField.vue","../src/filters/ElementFilterSurface.ts"],"sourcesContent":["import type {\n DataTableClassNames,\n FilterFieldSlots,\n} from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\n\nexport function elementFilterControls(\n names: () => DataTableClassNames\n): FilterFieldSlots {\n return {\n Input: (control) =>\n h(ElementInput, {\n ...control.attrs,\n value: control.value,\n type: control.type,\n class: names().filterInput,\n onChange: control.onChange,\n }),\n Select: (control) =>\n h(ElementSelect, {\n ...control.attrs,\n value: control.value,\n options: control.options,\n class:\n control.attrs[\"data-adapttable-part\"] === \"filter-operator\"\n ? names().filterOperator\n : names().filterSelect,\n onChange: control.onChange,\n }),\n Checkbox: (control) =>\n h(ElementCheckbox, {\n ...control.attrs,\n checked: control.checked,\n label: control.label,\n labelVisible: true,\n class: names().filterCheckbox,\n onChange: control.onChange,\n }),\n };\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n type DataTableClassNames,\n FilterFieldChrome,\n type FilterFieldOptions,\n useFilterField,\n} from \"@adapttable/vue/adapter\";\n\nimport { elementFilterControls } from \"./fieldControls\";\n\ndefineOptions({ name: \"ElementBasicFilterField\" });\nconst props = defineProps<\n FilterFieldOptions<TRow> & { classNames?: DataTableClassNames }\n>();\nconst model = useFilterField(() => props);\nconst controls = elementFilterControls(() => props.classNames ?? {});\nconst Render = () =>\n FilterFieldChrome({\n model: model.value,\n controls,\n classNames: props.classNames,\n });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template><Render /></template>\n","import {\n ChecklistChrome,\n type ChecklistFilterProps,\n type ChecklistSlots,\n useChecklistModel,\n} from \"@adapttable/vue/adapter\";\nimport { ElText } from \"element-plus\";\nimport {\n createVNode,\n defineComponent,\n h,\n type PropType,\n type SetupContext,\n type VNodeChild,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\n\nconst controls: ChecklistSlots<VNodeChild> = {\n Search: (control) =>\n h(ElementInput, {\n type: \"search\",\n value: control.value,\n \"aria-label\": control.label,\n \"data-adapttable-part\": \"filter-checklist-search\",\n class: control.className,\n onChange: control.onChange,\n }),\n Button: (control) =>\n elementButton({ onClick: control.onClick }, control.label),\n Checkbox: (control) =>\n h(\"div\", { class: \"adapttable-element-plus-checklist-option\" }, [\n h(ElementCheckbox, {\n \"data-adapttable-part\": \"filter-checkbox\",\n class: control.className,\n label: control.label,\n labelVisible: true,\n checked: control.checked,\n onChange: control.onChange,\n }),\n h(\n ElText,\n {\n class: control.countClassName,\n \"data-adapttable-part\": \"filter-checklist-count\",\n type: \"info\",\n size: \"small\",\n },\n { default: () => control.count }\n ),\n ]),\n};\n\n// The presentation validates values; its key list preserves generic public\n// components and Vue fallthrough attribute inference.\nconst checklistRuntimeProps = {\n def: { type: Object as PropType<ChecklistFilterProps<unknown>[\"def\"]> },\n source: { type: Object as PropType<ChecklistFilterProps<unknown>[\"source\"]> },\n labels: { type: Object as PropType<ChecklistFilterProps<unknown>[\"labels\"]> },\n classNames: {\n type: Object as PropType<ChecklistFilterProps<unknown>[\"classNames\"]>,\n },\n};\n\nconst ElementChecklistFilterPresentation = defineComponent(\n (props: ChecklistFilterProps<unknown>) => {\n const model = useChecklistModel(() => props);\n return () => ChecklistChrome({ model: model.value, controls });\n },\n {\n name: \"ElementChecklistFilterPresentation\",\n props: checklistRuntimeProps,\n }\n);\n\n/** Preserve the canonical row contract without exposing versioned instance helpers. */\nexport function ElementChecklistFilter<TRow>(\n props: ChecklistFilterProps<TRow>,\n context: Pick<SetupContext, \"attrs\">\n) {\n return createVNode(ElementChecklistFilterPresentation, {\n ...context.attrs,\n ...props,\n });\n}\nElementChecklistFilter.props = Object.keys(checklistRuntimeProps);\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n type DataTableClassNames,\n defaultFilterRegistry,\n type FilterFieldOptions,\n filterLabel,\n filterWidgetKind,\n} from \"@adapttable/vue/adapter\";\nimport { ElFormItem } from \"element-plus\";\n\nimport ElementBasicFilterField from \"./ElementBasicFilterField.vue\";\nimport { ElementChecklistFilter } from \"./ElementChecklistFilter\";\n\ndefineOptions({ name: \"ElementFilterField\" });\nconst props = defineProps<\n FilterFieldOptions<TRow> & { classNames?: DataTableClassNames }\n>();\n</script>\n\n<template>\n <ElFormItem\n v-if=\"\n filterWidgetKind(props.def, props.registry ?? defaultFilterRegistry) ===\n 'checklist'\n \"\n :label=\"filterLabel(props.def)\"\n :class=\"props.classNames?.filterField\"\n data-adapttable-part=\"filter-field\"\n >\n <ElementChecklistFilter\n :def=\"props.def\"\n :source=\"props.source\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n />\n </ElFormItem>\n <ElementBasicFilterField v-else v-bind=\"props\" />\n</template>\n","import {\n type FilterPanelSurfaceProps,\n FULLSCREEN_MODEL,\n useFeatureState,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type CardInstance,\n ClickOutside,\n ElCard,\n ElDrawer,\n ElPopover,\n} from \"element-plus\";\nimport {\n defineComponent,\n h,\n nextTick,\n onMounted,\n type PropType,\n shallowRef,\n withDirectives,\n} from \"vue\";\n\nimport { rtlScrollbarGutter } from \"../scrollbarGutter\";\n\n/** Kit overlays retain their own positioning, focus trap and modal backdrop. */\nexport const ElementFilterSurface = defineComponent(\n (\n props: FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n }\n ) => {\n const mounted = shallowRef(false);\n const active = useScopeActivity();\n const fullscreen = useFeatureState(FULLSCREEN_MODEL);\n const panel = shallowRef<CardInstance>();\n onMounted(() => {\n mounted.value = true;\n });\n const close: FilterPanelSurfaceProps[\"onClose\"] = (reason) => {\n if (!active.value || !props.open) return;\n props.onClose(reason);\n if (reason === \"escape\") {\n const anchor = props.anchor;\n void nextTick(() => {\n if (\n active.value &&\n !props.open &&\n props.anchor === anchor &&\n anchor?.isConnected\n )\n anchor.focus();\n });\n }\n };\n const outside = (event: MouseEvent) => {\n const target = event.target;\n if (target instanceof Node && props.anchor?.contains(target)) return;\n close(\"outside\");\n };\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return;\n // Element's focus trap releases on any Escape that reaches the document,\n // including one an inner control handled or an IME composition owns, so\n // the panel keeps those Escapes inside itself.\n if (event.defaultPrevented || event.isComposing) {\n event.stopPropagation();\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n close(\"escape\");\n };\n // A closed native combobox must not swallow the containing overlay's Escape.\n // Open comboboxes keep the event so their own menu closes first.\n const captureKeydown = (event: KeyboardEvent) => {\n const target = event.target;\n if (\n target instanceof Element &&\n target.getAttribute(\"role\") === \"combobox\" &&\n target.getAttribute(\"aria-expanded\") === \"false\"\n )\n keydown(event);\n };\n const focusPanel = () => {\n const element: unknown = panel.value?.$el;\n if (!active.value || !props.open || !(element instanceof HTMLElement))\n return;\n const focused = element.ownerDocument.activeElement;\n if (focused === props.anchor || focused === element.ownerDocument.body)\n element.focus();\n };\n return () => {\n if (!mounted.value || !active.value) return null;\n if (props.modal)\n return h(\n ElDrawer,\n {\n modelValue: props.open,\n title: props.label,\n direction: props.dir === \"rtl\" ? \"ltr\" : \"rtl\",\n appendTo: props.container ?? fullscreen.value?.container ?? \"body\",\n appendToBody: true,\n modal: true,\n modalClass: props.backdropClassName,\n withHeader: false,\n showClose: false,\n destroyOnClose: true,\n // Relative to the drawer's overlay, which excludes a classic\n // scrollbar or a reserved gutter; 100vw does not.\n size: \"min(30rem, 100%)\",\n dir: props.dir,\n class: props.className,\n \"data-adapttable-part\": \"filters-panel\",\n beforeClose: () => close(\"outside\"),\n onKeydown: keydown,\n onKeydownCapture: captureKeydown,\n },\n { default: () => props.children }\n );\n if (!props.anchor) return null;\n return h(\n ElPopover,\n {\n visible: props.open,\n virtualTriggering: true,\n virtualRef: props.anchor,\n trigger: \"click\",\n role: \"dialog\",\n \"aria-label\": props.label,\n placement: props.dir === \"rtl\" ? \"bottom-end\" : \"bottom-start\",\n appendTo: props.container ?? fullscreen.value?.container ?? \"body\",\n teleported: true,\n persistent: false,\n showArrow: false,\n width: \"min(28rem, calc(100vw - 1rem))\",\n popperClass: \"adapttable-element-plus-filter-popover\",\n popperStyle: {\n padding: 0,\n translate: `${rtlScrollbarGutter(props.dir, props.anchor?.ownerDocument.defaultView)} 0`,\n },\n onAfterEnter: focusPanel,\n },\n {\n default: () =>\n withDirectives(\n h(\n ElCard,\n {\n ref: panel,\n shadow: \"never\",\n dir: props.dir,\n tabindex: -1,\n \"aria-label\": props.label,\n \"data-adapttable-part\": props.part ?? \"filters-popover\",\n class: props.className,\n onKeydown: keydown,\n onKeydownCapture: captureKeydown,\n },\n { default: () => props.children }\n ),\n [[ClickOutside, outside]]\n ),\n }\n );\n };\n },\n {\n name: \"ElementFilterSurface\",\n props: {\n className: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"className\"]\n >,\n },\n open: {\n type: Boolean as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"open\"]\n >,\n default: undefined,\n },\n label: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"label\"]\n >,\n },\n dir: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"dir\"]\n >,\n },\n anchor: {\n type: Object as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"anchor\"]\n >,\n },\n container: {\n type: Object as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"container\"]\n >,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"children\"]\n >,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"onClose\"]\n >,\n },\n modal: {\n type: Boolean as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"modal\"]\n >,\n default: undefined,\n },\n part: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"part\"]\n >,\n },\n backdropClassName: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"backdropClassName\"]\n >,\n },\n },\n }\n);\n"],"mappings":";;;;;;;;;AAUA,SAAgB,sBACd,OACkB;CAClB,OAAO;EACL,QAAQ,aAAA,GACNA,IAAAA,EAAAA,CAAEC,qBAAAA,WAAc;GACd,GAAG,QAAQ;GACX,OAAO,QAAQ;GACf,MAAM,QAAQ;GACd,OAAO,MAAM,CAAC,CAAC;GACf,UAAU,QAAQ;EACpB,CAAC;EACH,SAAS,aAAA,GACPD,IAAAA,EAAAA,CAAEE,sBAAAA,WAAe;GACf,GAAG,QAAQ;GACX,OAAO,QAAQ;GACf,SAAS,QAAQ;GACjB,OACE,QAAQ,MAAM,4BAA4B,oBACtC,MAAM,CAAC,CAAC,iBACR,MAAM,CAAC,CAAC;GACd,UAAU,QAAQ;EACpB,CAAC;EACH,WAAW,aAAA,GACTF,IAAAA,EAAAA,CAAEG,wBAAAA,WAAiB;GACjB,GAAG,QAAQ;GACX,SAAS,QAAQ;GACjB,OAAO,QAAQ;GACf,cAAc;GACd,OAAO,MAAM,CAAC,CAAC;GACf,UAAU,QAAQ;EACpB,CAAC;CACL;AACF;;;;;;;;;;;;;;;EChCA,MAAM,QAAQ;EAGd,MAAM,SAAA,GAAQ,wBAAA,eAAA,OAAqB,KAAK;EACxC,MAAM,WAAW,4BAA4B,MAAM,cAAc,CA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,SAAS,KAAA;EACX;EACA,OAAO,EACL,MAAM,OAQR;EACA,KAAK,EACH,MAAM,OAQR;EACA,QAAQ,EACN,MAAM,OAQR;EACA,WAAW,EACT,MAAM,OAQR;EACA,UAAU;GACR,MAAM;IAAC;IAAQ;IAAQ;IAAS;IAAO;GAAM;GAQ7C,SAAS,KAAA;EACX;EACA,SAAS,EACP,MAAM,SAQR;EACA,OAAO;GACL,MAAM;GAQN,SAAS,KAAA;EACX;EACA,MAAM,EACJ,MAAM,OAQR;EACA,mBAAmB,EACjB,MAAM,OAQR;CACF;AACF,CACF"}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { t as elementButton } from "./button-DwB4UxI2.js";
|
|
2
|
+
import { t as _sfc_main$2 } from "./ElementCheckbox-BQN4_eas.js";
|
|
3
|
+
import { t as _sfc_main$3 } from "./ElementInput-BsoAvPfO.js";
|
|
4
|
+
import { t as _sfc_main$4 } from "./ElementSelect-Cl5ZjuQM.js";
|
|
5
|
+
import { t as rtlScrollbarGutter } from "./scrollbarGutter-BNp0-4l1.js";
|
|
6
|
+
import { createBlock, createVNode, defineComponent, h, mergeProps, nextTick, normalizeClass, normalizeProps, onMounted, openBlock, shallowRef, unref, withCtx, withDirectives } from "vue";
|
|
7
|
+
import { ChecklistChrome, FULLSCREEN_MODEL, FilterFieldChrome, defaultFilterRegistry, filterLabel, filterWidgetKind, useChecklistModel, useFeatureState, useFilterField, useScopeActivity } from "@adapttable/vue/adapter";
|
|
8
|
+
import { ClickOutside, ElCard, ElDrawer, ElFormItem, ElPopover, ElText } from "element-plus";
|
|
9
|
+
//#region src/filters/fieldControls.ts
|
|
10
|
+
function elementFilterControls(names) {
|
|
11
|
+
return {
|
|
12
|
+
Input: (control) => h(_sfc_main$3, {
|
|
13
|
+
...control.attrs,
|
|
14
|
+
value: control.value,
|
|
15
|
+
type: control.type,
|
|
16
|
+
class: names().filterInput,
|
|
17
|
+
onChange: control.onChange
|
|
18
|
+
}),
|
|
19
|
+
Select: (control) => h(_sfc_main$4, {
|
|
20
|
+
...control.attrs,
|
|
21
|
+
value: control.value,
|
|
22
|
+
options: control.options,
|
|
23
|
+
class: control.attrs["data-adapttable-part"] === "filter-operator" ? names().filterOperator : names().filterSelect,
|
|
24
|
+
onChange: control.onChange
|
|
25
|
+
}),
|
|
26
|
+
Checkbox: (control) => h(_sfc_main$2, {
|
|
27
|
+
...control.attrs,
|
|
28
|
+
checked: control.checked,
|
|
29
|
+
label: control.label,
|
|
30
|
+
labelVisible: true,
|
|
31
|
+
class: names().filterCheckbox,
|
|
32
|
+
onChange: control.onChange
|
|
33
|
+
})
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/filters/ElementBasicFilterField.vue
|
|
38
|
+
const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
39
|
+
name: "ElementBasicFilterField",
|
|
40
|
+
__name: "ElementBasicFilterField",
|
|
41
|
+
props: {
|
|
42
|
+
id: {},
|
|
43
|
+
def: {},
|
|
44
|
+
source: {},
|
|
45
|
+
labels: {},
|
|
46
|
+
registry: {},
|
|
47
|
+
classNames: {}
|
|
48
|
+
},
|
|
49
|
+
setup(__props) {
|
|
50
|
+
const props = __props;
|
|
51
|
+
const model = useFilterField(() => props);
|
|
52
|
+
const controls = elementFilterControls(() => props.classNames ?? {});
|
|
53
|
+
const Render = () => FilterFieldChrome({
|
|
54
|
+
model: model.value,
|
|
55
|
+
controls,
|
|
56
|
+
classNames: props.classNames
|
|
57
|
+
});
|
|
58
|
+
Render.props = [];
|
|
59
|
+
return (_ctx, _cache) => {
|
|
60
|
+
return openBlock(), createBlock(Render);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/filters/ElementChecklistFilter.ts
|
|
66
|
+
const controls = {
|
|
67
|
+
Search: (control) => h(_sfc_main$3, {
|
|
68
|
+
type: "search",
|
|
69
|
+
value: control.value,
|
|
70
|
+
"aria-label": control.label,
|
|
71
|
+
"data-adapttable-part": "filter-checklist-search",
|
|
72
|
+
class: control.className,
|
|
73
|
+
onChange: control.onChange
|
|
74
|
+
}),
|
|
75
|
+
Button: (control) => elementButton({ onClick: control.onClick }, control.label),
|
|
76
|
+
Checkbox: (control) => h("div", { class: "adapttable-element-plus-checklist-option" }, [h(_sfc_main$2, {
|
|
77
|
+
"data-adapttable-part": "filter-checkbox",
|
|
78
|
+
class: control.className,
|
|
79
|
+
label: control.label,
|
|
80
|
+
labelVisible: true,
|
|
81
|
+
checked: control.checked,
|
|
82
|
+
onChange: control.onChange
|
|
83
|
+
}), h(ElText, {
|
|
84
|
+
class: control.countClassName,
|
|
85
|
+
"data-adapttable-part": "filter-checklist-count",
|
|
86
|
+
type: "info",
|
|
87
|
+
size: "small"
|
|
88
|
+
}, { default: () => control.count })])
|
|
89
|
+
};
|
|
90
|
+
const checklistRuntimeProps = {
|
|
91
|
+
def: { type: Object },
|
|
92
|
+
source: { type: Object },
|
|
93
|
+
labels: { type: Object },
|
|
94
|
+
classNames: { type: Object }
|
|
95
|
+
};
|
|
96
|
+
const ElementChecklistFilterPresentation = defineComponent((props) => {
|
|
97
|
+
const model = useChecklistModel(() => props);
|
|
98
|
+
return () => ChecklistChrome({
|
|
99
|
+
model: model.value,
|
|
100
|
+
controls
|
|
101
|
+
});
|
|
102
|
+
}, {
|
|
103
|
+
name: "ElementChecklistFilterPresentation",
|
|
104
|
+
props: checklistRuntimeProps
|
|
105
|
+
});
|
|
106
|
+
/** Preserve the canonical row contract without exposing versioned instance helpers. */
|
|
107
|
+
function ElementChecklistFilter(props, context) {
|
|
108
|
+
return createVNode(ElementChecklistFilterPresentation, {
|
|
109
|
+
...context.attrs,
|
|
110
|
+
...props
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
ElementChecklistFilter.props = Object.keys(checklistRuntimeProps);
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/filters/ElementFilterField.vue
|
|
116
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
117
|
+
name: "ElementFilterField",
|
|
118
|
+
__name: "ElementFilterField",
|
|
119
|
+
props: {
|
|
120
|
+
id: {},
|
|
121
|
+
def: {},
|
|
122
|
+
source: {},
|
|
123
|
+
labels: {},
|
|
124
|
+
registry: {},
|
|
125
|
+
classNames: {}
|
|
126
|
+
},
|
|
127
|
+
setup(__props) {
|
|
128
|
+
const props = __props;
|
|
129
|
+
return (_ctx, _cache) => {
|
|
130
|
+
return unref(filterWidgetKind)(props.def, props.registry ?? unref(defaultFilterRegistry)) === "checklist" ? (openBlock(), createBlock(unref(ElFormItem), {
|
|
131
|
+
key: 0,
|
|
132
|
+
label: unref(filterLabel)(props.def),
|
|
133
|
+
class: normalizeClass(props.classNames?.filterField),
|
|
134
|
+
"data-adapttable-part": "filter-field"
|
|
135
|
+
}, {
|
|
136
|
+
default: withCtx(() => [createVNode(unref(ElementChecklistFilter), {
|
|
137
|
+
def: props.def,
|
|
138
|
+
source: props.source,
|
|
139
|
+
labels: props.labels,
|
|
140
|
+
"class-names": props.classNames
|
|
141
|
+
}, null, 8, [
|
|
142
|
+
"def",
|
|
143
|
+
"source",
|
|
144
|
+
"labels",
|
|
145
|
+
"class-names"
|
|
146
|
+
])]),
|
|
147
|
+
_: 1
|
|
148
|
+
}, 8, ["label", "class"])) : (openBlock(), createBlock(_sfc_main$1, normalizeProps(mergeProps({ key: 1 }, props)), null, 16));
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/filters/ElementFilterSurface.ts
|
|
154
|
+
/** Kit overlays retain their own positioning, focus trap and modal backdrop. */
|
|
155
|
+
const ElementFilterSurface = defineComponent((props) => {
|
|
156
|
+
const mounted = shallowRef(false);
|
|
157
|
+
const active = useScopeActivity();
|
|
158
|
+
const fullscreen = useFeatureState(FULLSCREEN_MODEL);
|
|
159
|
+
const panel = shallowRef();
|
|
160
|
+
onMounted(() => {
|
|
161
|
+
mounted.value = true;
|
|
162
|
+
});
|
|
163
|
+
const close = (reason) => {
|
|
164
|
+
if (!active.value || !props.open) return;
|
|
165
|
+
props.onClose(reason);
|
|
166
|
+
if (reason === "escape") {
|
|
167
|
+
const anchor = props.anchor;
|
|
168
|
+
nextTick(() => {
|
|
169
|
+
if (active.value && !props.open && props.anchor === anchor && anchor?.isConnected) anchor.focus();
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
const outside = (event) => {
|
|
174
|
+
const target = event.target;
|
|
175
|
+
if (target instanceof Node && props.anchor?.contains(target)) return;
|
|
176
|
+
close("outside");
|
|
177
|
+
};
|
|
178
|
+
const keydown = (event) => {
|
|
179
|
+
if (event.key !== "Escape") return;
|
|
180
|
+
if (event.defaultPrevented || event.isComposing) {
|
|
181
|
+
event.stopPropagation();
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
event.preventDefault();
|
|
185
|
+
event.stopPropagation();
|
|
186
|
+
close("escape");
|
|
187
|
+
};
|
|
188
|
+
const captureKeydown = (event) => {
|
|
189
|
+
const target = event.target;
|
|
190
|
+
if (target instanceof Element && target.getAttribute("role") === "combobox" && target.getAttribute("aria-expanded") === "false") keydown(event);
|
|
191
|
+
};
|
|
192
|
+
const focusPanel = () => {
|
|
193
|
+
const element = panel.value?.$el;
|
|
194
|
+
if (!active.value || !props.open || !(element instanceof HTMLElement)) return;
|
|
195
|
+
const focused = element.ownerDocument.activeElement;
|
|
196
|
+
if (focused === props.anchor || focused === element.ownerDocument.body) element.focus();
|
|
197
|
+
};
|
|
198
|
+
return () => {
|
|
199
|
+
if (!mounted.value || !active.value) return null;
|
|
200
|
+
if (props.modal) return h(ElDrawer, {
|
|
201
|
+
modelValue: props.open,
|
|
202
|
+
title: props.label,
|
|
203
|
+
direction: props.dir === "rtl" ? "ltr" : "rtl",
|
|
204
|
+
appendTo: props.container ?? fullscreen.value?.container ?? "body",
|
|
205
|
+
appendToBody: true,
|
|
206
|
+
modal: true,
|
|
207
|
+
modalClass: props.backdropClassName,
|
|
208
|
+
withHeader: false,
|
|
209
|
+
showClose: false,
|
|
210
|
+
destroyOnClose: true,
|
|
211
|
+
size: "min(30rem, 100%)",
|
|
212
|
+
dir: props.dir,
|
|
213
|
+
class: props.className,
|
|
214
|
+
"data-adapttable-part": "filters-panel",
|
|
215
|
+
beforeClose: () => close("outside"),
|
|
216
|
+
onKeydown: keydown,
|
|
217
|
+
onKeydownCapture: captureKeydown
|
|
218
|
+
}, { default: () => props.children });
|
|
219
|
+
if (!props.anchor) return null;
|
|
220
|
+
return h(ElPopover, {
|
|
221
|
+
visible: props.open,
|
|
222
|
+
virtualTriggering: true,
|
|
223
|
+
virtualRef: props.anchor,
|
|
224
|
+
trigger: "click",
|
|
225
|
+
role: "dialog",
|
|
226
|
+
"aria-label": props.label,
|
|
227
|
+
placement: props.dir === "rtl" ? "bottom-end" : "bottom-start",
|
|
228
|
+
appendTo: props.container ?? fullscreen.value?.container ?? "body",
|
|
229
|
+
teleported: true,
|
|
230
|
+
persistent: false,
|
|
231
|
+
showArrow: false,
|
|
232
|
+
width: "min(28rem, calc(100vw - 1rem))",
|
|
233
|
+
popperClass: "adapttable-element-plus-filter-popover",
|
|
234
|
+
popperStyle: {
|
|
235
|
+
padding: 0,
|
|
236
|
+
translate: `${rtlScrollbarGutter(props.dir, props.anchor?.ownerDocument.defaultView)} 0`
|
|
237
|
+
},
|
|
238
|
+
onAfterEnter: focusPanel
|
|
239
|
+
}, { default: () => withDirectives(h(ElCard, {
|
|
240
|
+
ref: panel,
|
|
241
|
+
shadow: "never",
|
|
242
|
+
dir: props.dir,
|
|
243
|
+
tabindex: -1,
|
|
244
|
+
"aria-label": props.label,
|
|
245
|
+
"data-adapttable-part": props.part ?? "filters-popover",
|
|
246
|
+
class: props.className,
|
|
247
|
+
onKeydown: keydown,
|
|
248
|
+
onKeydownCapture: captureKeydown
|
|
249
|
+
}, { default: () => props.children }), [[ClickOutside, outside]]) });
|
|
250
|
+
};
|
|
251
|
+
}, {
|
|
252
|
+
name: "ElementFilterSurface",
|
|
253
|
+
props: {
|
|
254
|
+
className: { type: String },
|
|
255
|
+
open: {
|
|
256
|
+
type: Boolean,
|
|
257
|
+
default: void 0
|
|
258
|
+
},
|
|
259
|
+
label: { type: String },
|
|
260
|
+
dir: { type: String },
|
|
261
|
+
anchor: { type: Object },
|
|
262
|
+
container: { type: Object },
|
|
263
|
+
children: {
|
|
264
|
+
type: [
|
|
265
|
+
String,
|
|
266
|
+
Number,
|
|
267
|
+
Boolean,
|
|
268
|
+
Array,
|
|
269
|
+
Object
|
|
270
|
+
],
|
|
271
|
+
default: void 0
|
|
272
|
+
},
|
|
273
|
+
onClose: { type: Function },
|
|
274
|
+
modal: {
|
|
275
|
+
type: Boolean,
|
|
276
|
+
default: void 0
|
|
277
|
+
},
|
|
278
|
+
part: { type: String },
|
|
279
|
+
backdropClassName: { type: String }
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
//#endregion
|
|
283
|
+
export { _sfc_main as n, ElementChecklistFilter as r, ElementFilterSurface as t };
|
|
284
|
+
|
|
285
|
+
//# sourceMappingURL=ElementFilterSurface-DdvPfm1N.js.map
|