@adapttable/vue-headless-ui 0.0.0-stage → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +197 -2
- package/dist/FilterField-BRcf96Xt.js +173 -0
- package/dist/FilterField-BRcf96Xt.js.map +1 -0
- package/dist/FilterField-DEyQh8de.cjs +195 -0
- package/dist/FilterField-DEyQh8de.cjs.map +1 -0
- package/dist/HeadlessRowActions--xEzkpxa.js +44 -0
- package/dist/HeadlessRowActions--xEzkpxa.js.map +1 -0
- package/dist/HeadlessRowActions-CL8yo3k-.cjs +49 -0
- package/dist/HeadlessRowActions-CL8yo3k-.cjs.map +1 -0
- package/dist/HeadlessSurface-CrOMvxVj.cjs +149 -0
- package/dist/HeadlessSurface-CrOMvxVj.cjs.map +1 -0
- package/dist/HeadlessSurface-gPmhSxmK.js +144 -0
- package/dist/HeadlessSurface-gPmhSxmK.js.map +1 -0
- package/dist/assistant.cjs +268 -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 +264 -0
- package/dist/assistant.js.map +1 -0
- package/dist/basic-BUT5yxns.cjs +42 -0
- package/dist/basic-BUT5yxns.cjs.map +1 -0
- package/dist/basic-DX6Oejyw.js +31 -0
- package/dist/basic-DX6Oejyw.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 +16 -0
- package/dist/bulk-actions.cjs.map +1 -0
- package/dist/bulk-actions.d.cts +7 -0
- package/dist/bulk-actions.d.cts.map +1 -0
- package/dist/bulk-actions.d.ts +7 -0
- package/dist/bulk-actions.d.ts.map +1 -0
- package/dist/bulk-actions.js +15 -0
- package/dist/bulk-actions.js.map +1 -0
- package/dist/cell-navigation.cjs +31 -0
- package/dist/cell-navigation.cjs.map +1 -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 +29 -0
- package/dist/cell-navigation.js.map +1 -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-Bjsm3kP_.js +49 -0
- package/dist/checkbox-Bjsm3kP_.js.map +1 -0
- package/dist/checkbox-cy6E_PMS.cjs +60 -0
- package/dist/checkbox-cy6E_PMS.cjs.map +1 -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-layout.cjs +24 -0
- package/dist/column-layout.cjs.map +1 -0
- package/dist/column-layout.d.cts +12 -0
- package/dist/column-layout.d.cts.map +1 -0
- package/dist/column-layout.d.ts +12 -0
- package/dist/column-layout.d.ts.map +1 -0
- package/dist/column-layout.js +22 -0
- package/dist/column-layout.js.map +1 -0
- package/dist/column-menu-Dkdnp8Wk.js +89 -0
- package/dist/column-menu-Dkdnp8Wk.js.map +1 -0
- package/dist/column-menu-_nvHPN8r.cjs +100 -0
- package/dist/column-menu-_nvHPN8r.cjs.map +1 -0
- package/dist/column-menu.cjs +4 -0
- package/dist/column-menu.d.cts +23 -0
- package/dist/column-menu.d.cts.map +1 -0
- package/dist/column-menu.d.ts +23 -0
- package/dist/column-menu.d.ts.map +1 -0
- package/dist/column-menu.js +2 -0
- package/dist/column-selection.cjs +19 -0
- package/dist/column-selection.cjs.map +1 -0
- package/dist/column-selection.d.cts +7 -0
- package/dist/column-selection.d.cts.map +1 -0
- package/dist/column-selection.d.ts +7 -0
- package/dist/column-selection.d.ts.map +1 -0
- package/dist/column-selection.js +18 -0
- package/dist/column-selection.js.map +1 -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 +117 -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 +116 -0
- package/dist/command-palette.js.map +1 -0
- package/dist/context-B4_4jyr7.js +2 -0
- package/dist/context-menu.cjs +118 -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 +117 -0
- package/dist/context-menu.js.map +1 -0
- package/dist/density.cjs +57 -0
- package/dist/density.cjs.map +1 -0
- package/dist/density.d.cts +6 -0
- package/dist/density.d.cts.map +1 -0
- package/dist/density.d.ts +6 -0
- package/dist/density.d.ts.map +1 -0
- package/dist/density.js +56 -0
- package/dist/density.js.map +1 -0
- package/dist/dialog-BFiJHEU0.js +61 -0
- package/dist/dialog-BFiJHEU0.js.map +1 -0
- package/dist/dialog-kLRPt0eo.cjs +66 -0
- package/dist/dialog-kLRPt0eo.cjs.map +1 -0
- package/dist/direction-BddXmM5u.js +14 -0
- package/dist/direction-BddXmM5u.js.map +1 -0
- package/dist/direction-BoccEkT5.cjs +25 -0
- package/dist/direction-BoccEkT5.cjs.map +1 -0
- package/dist/editing-BDFeEaa7.cjs +320 -0
- package/dist/editing-BDFeEaa7.cjs.map +1 -0
- package/dist/editing-DmrzTZmJ.js +274 -0
- package/dist/editing-DmrzTZmJ.js.map +1 -0
- package/dist/editing-Zuj4SiEJ.d.cts +64 -0
- package/dist/editing-Zuj4SiEJ.d.cts.map +1 -0
- package/dist/editing-jRKWRTeo.d.ts +64 -0
- package/dist/editing-jRKWRTeo.d.ts.map +1 -0
- package/dist/editing.cjs +13 -0
- package/dist/editing.d.cts +2 -0
- package/dist/editing.d.ts +2 -0
- package/dist/editing.js +2 -0
- package/dist/export-csv-B7LpklZy.js +10 -0
- package/dist/export-csv-B7LpklZy.js.map +1 -0
- package/dist/export-csv-IWCNspOS.cjs +15 -0
- package/dist/export-csv-IWCNspOS.cjs.map +1 -0
- package/dist/export-pdf.cjs +53 -0
- package/dist/export-pdf.cjs.map +1 -0
- package/dist/export-pdf.d.cts +8 -0
- package/dist/export-pdf.d.cts.map +1 -0
- package/dist/export-pdf.d.ts +8 -0
- package/dist/export-pdf.d.ts.map +1 -0
- package/dist/export-pdf.js +10 -0
- package/dist/export-pdf.js.map +1 -0
- package/dist/export-xlsx.cjs +23 -0
- package/dist/export-xlsx.cjs.map +1 -0
- package/dist/export-xlsx.d.cts +8 -0
- package/dist/export-xlsx.d.cts.map +1 -0
- package/dist/export-xlsx.d.ts +8 -0
- package/dist/export-xlsx.d.ts.map +1 -0
- package/dist/export-xlsx.js +10 -0
- package/dist/export-xlsx.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/filtering.cjs +22 -0
- package/dist/filtering.cjs.map +1 -0
- package/dist/filtering.d.cts +13 -0
- package/dist/filtering.d.cts.map +1 -0
- package/dist/filtering.d.ts +13 -0
- package/dist/filtering.d.ts.map +1 -0
- package/dist/filtering.js +21 -0
- package/dist/filtering.js.map +1 -0
- package/dist/filters-0eDneZJ3.cjs +342 -0
- package/dist/filters-0eDneZJ3.cjs.map +1 -0
- package/dist/filters-BGdDaMAO.d.ts +90 -0
- package/dist/filters-BGdDaMAO.d.ts.map +1 -0
- package/dist/filters-MgBA-9UX.d.cts +90 -0
- package/dist/filters-MgBA-9UX.d.cts.map +1 -0
- package/dist/filters-PK2rSgg_.js +290 -0
- package/dist/filters-PK2rSgg_.js.map +1 -0
- package/dist/filters.cjs +21 -0
- package/dist/filters.d.cts +2 -0
- package/dist/filters.d.ts +2 -0
- package/dist/filters.js +3 -0
- package/dist/find-in-table-CdSzaSEf.cjs +60 -0
- package/dist/find-in-table-CdSzaSEf.cjs.map +1 -0
- package/dist/find-in-table-DLueFbHI.js +56 -0
- package/dist/find-in-table-DLueFbHI.js.map +1 -0
- package/dist/find-in-table.cjs +3 -0
- package/dist/find-in-table.d.cts +8 -0
- package/dist/find-in-table.d.cts.map +1 -0
- package/dist/find-in-table.d.ts +8 -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/formula.cjs +9 -0
- package/dist/formula.d.cts +1 -0
- package/dist/formula.d.ts +1 -0
- package/dist/formula.js +1 -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 +134 -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 +134 -0
- package/dist/grouping-panel.js.map +1 -0
- package/dist/grouping.cjs +43 -0
- package/dist/grouping.cjs.map +1 -0
- package/dist/grouping.d.cts +9 -0
- package/dist/grouping.d.cts.map +1 -0
- package/dist/grouping.d.ts +9 -0
- package/dist/grouping.d.ts.map +1 -0
- package/dist/grouping.js +24 -0
- package/dist/grouping.js.map +1 -0
- package/dist/header-filters-BjP_iXlH.js +217 -0
- package/dist/header-filters-BjP_iXlH.js.map +1 -0
- package/dist/header-filters-q7r79WaS.cjs +239 -0
- package/dist/header-filters-q7r79WaS.cjs.map +1 -0
- package/dist/header-filters.cjs +6 -0
- package/dist/header-filters.d.cts +52 -0
- package/dist/header-filters.d.cts.map +1 -0
- package/dist/header-filters.d.ts +52 -0
- package/dist/header-filters.d.ts.map +1 -0
- package/dist/header-filters.js +2 -0
- package/dist/index.cjs +336 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +22 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +336 -0
- package/dist/index.js.map +1 -0
- package/dist/managedPanel-Bb8ep_cT.js +27 -0
- package/dist/managedPanel-Bb8ep_cT.js.map +1 -0
- package/dist/managedPanel-BwjP8QJ9.cjs +31 -0
- package/dist/managedPanel-BwjP8QJ9.cjs.map +1 -0
- package/dist/menu-Cg-P5uJv.js +66 -0
- package/dist/menu-Cg-P5uJv.js.map +1 -0
- package/dist/menu-RAcylhSS.cjs +77 -0
- package/dist/menu-RAcylhSS.cjs.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/overlay-BELaYa9y.cjs +140 -0
- package/dist/overlay-BELaYa9y.cjs.map +1 -0
- package/dist/overlay-CGNQ_Qbl.js +111 -0
- package/dist/overlay-CGNQ_Qbl.js.map +1 -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 +79 -0
- package/dist/pivot.cjs.map +1 -0
- package/dist/pivot.d.cts +9 -0
- package/dist/pivot.d.cts.map +1 -0
- package/dist/pivot.d.ts +9 -0
- package/dist/pivot.d.ts.map +1 -0
- package/dist/pivot.js +78 -0
- package/dist/pivot.js.map +1 -0
- package/dist/portal-BeSwili6.cjs +81 -0
- package/dist/portal-BeSwili6.cjs.map +1 -0
- package/dist/portal-CdNXlwQR.js +58 -0
- package/dist/portal-CdNXlwQR.js.map +1 -0
- package/dist/preset.cjs +40 -0
- package/dist/preset.cjs.map +1 -0
- package/dist/preset.d.cts +16 -0
- package/dist/preset.d.cts.map +1 -0
- package/dist/preset.d.ts +16 -0
- package/dist/preset.d.ts.map +1 -0
- package/dist/preset.js +38 -0
- package/dist/preset.js.map +1 -0
- package/dist/primitive-BOve5bNE.cjs +42 -0
- package/dist/primitive-BOve5bNE.cjs.map +1 -0
- package/dist/primitive-DzjBBhOj.js +31 -0
- package/dist/primitive-DzjBBhOj.js.map +1 -0
- package/dist/print.cjs +16 -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 +15 -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 +161 -0
- package/dist/row-reorder.cjs.map +1 -0
- package/dist/row-reorder.d.cts +7 -0
- package/dist/row-reorder.d.cts.map +1 -0
- package/dist/row-reorder.d.ts +7 -0
- package/dist/row-reorder.d.ts.map +1 -0
- package/dist/row-reorder.js +155 -0
- package/dist/row-reorder.js.map +1 -0
- package/dist/rowActionsSlot-Dpy_3Wey.js +11 -0
- package/dist/rowActionsSlot-Dpy_3Wey.js.map +1 -0
- package/dist/rowActionsSlot-LFWTvwEJ.cjs +21 -0
- package/dist/rowActionsSlot-LFWTvwEJ.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-CE7IEzY3.d.ts +12 -0
- package/dist/saved-views-CE7IEzY3.d.ts.map +1 -0
- package/dist/saved-views-CNXfj7FZ.d.cts +12 -0
- package/dist/saved-views-CNXfj7FZ.d.cts.map +1 -0
- package/dist/saved-views-CNZTPbnn.js +117 -0
- package/dist/saved-views-CNZTPbnn.js.map +1 -0
- package/dist/saved-views-DhUO_HoG.cjs +128 -0
- package/dist/saved-views-DhUO_HoG.cjs.map +1 -0
- package/dist/saved-views.cjs +4 -0
- package/dist/saved-views.d.cts +2 -0
- package/dist/saved-views.d.ts +2 -0
- package/dist/saved-views.js +2 -0
- package/dist/select-DchWHRTE.cjs +150 -0
- package/dist/select-DchWHRTE.cjs.map +1 -0
- package/dist/select-ofDZbnd6.js +139 -0
- package/dist/select-ofDZbnd6.js.map +1 -0
- package/dist/selection-stats-B8YUI68M.cjs +82 -0
- package/dist/selection-stats-B8YUI68M.cjs.map +1 -0
- package/dist/selection-stats-CAv_JysE.js +72 -0
- package/dist/selection-stats-CAv_JysE.js.map +1 -0
- package/dist/selection-stats.cjs +3 -0
- package/dist/selection-stats.d.cts +6 -0
- package/dist/selection-stats.d.cts.map +1 -0
- package/dist/selection-stats.d.ts +6 -0
- package/dist/selection-stats.d.ts.map +1 -0
- package/dist/selection-stats.js +2 -0
- package/dist/selection.cjs +8 -0
- package/dist/selection.d.cts +2 -0
- package/dist/selection.d.ts +2 -0
- package/dist/selection.js +2 -0
- package/dist/side-panel.cjs +71 -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 +70 -0
- package/dist/side-panel.js.map +1 -0
- package/dist/signal-CJNKPFud.cjs +23 -0
- package/dist/signal-CJNKPFud.cjs.map +1 -0
- package/dist/signal-G-6BhqAT.js +18 -0
- package/dist/signal-G-6BhqAT.js.map +1 -0
- package/dist/sparkline.cjs +9 -0
- package/dist/sparkline.d.cts +1 -0
- package/dist/sparkline.d.ts +1 -0
- package/dist/sparkline.js +1 -0
- package/dist/status-bar.cjs +14 -0
- package/dist/status-bar.cjs.map +1 -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 +12 -0
- package/dist/status-bar.js.map +1 -0
- package/dist/stream.cjs +9 -0
- package/dist/stream.d.cts +1 -0
- package/dist/stream.d.ts +1 -0
- package/dist/stream.js +1 -0
- package/dist/styles.css +1152 -0
- package/dist/target-B-JQVtw9.js +73 -0
- package/dist/target-B-JQVtw9.js.map +1 -0
- package/dist/target-CZ60Sqrg.cjs +90 -0
- package/dist/target-CZ60Sqrg.cjs.map +1 -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/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/dist/withHeadlessExport-BWtz333c.cjs +76 -0
- package/dist/withHeadlessExport-BWtz333c.cjs.map +1 -0
- package/dist/withHeadlessExport-BccRGCD8.js +71 -0
- package/dist/withHeadlessExport-BccRGCD8.js.map +1 -0
- package/package.json +565 -3
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ColumnSelectCheckboxProps } from "@adapttable/vue/adapter";
|
|
2
|
+
import { StaticTableFeature } from "@adapttable/vue";
|
|
3
|
+
//#region src/column-selection.d.ts
|
|
4
|
+
declare function columnSelectionCheckbox(): StaticTableFeature;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { type ColumnSelectCheckboxProps, columnSelectionCheckbox };
|
|
7
|
+
//# sourceMappingURL=column-selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column-selection.d.ts","names":[],"sources":["../src/column-selection.ts"],"mappings":";;;iBAWgB,2BAA2B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { t as headlessCheckbox } from "./checkbox-Bjsm3kP_.js";
|
|
2
|
+
import { COLUMN_SELECT, ColumnSelectCheckboxChrome, extendFeature, slotRender } from "@adapttable/vue/adapter";
|
|
3
|
+
import { columnSelectionCheckbox as columnSelectionCheckbox$1 } from "@adapttable/vue/features";
|
|
4
|
+
//#region src/column-selection.ts
|
|
5
|
+
function columnSelectionCheckbox() {
|
|
6
|
+
return extendFeature(columnSelectionCheckbox$1(), [slotRender(COLUMN_SELECT, (props) => ColumnSelectCheckboxChrome({
|
|
7
|
+
...props,
|
|
8
|
+
slots: { Checkbox: (control) => headlessCheckbox({
|
|
9
|
+
attrs: { "aria-label": control.label },
|
|
10
|
+
checked: control.checked,
|
|
11
|
+
onChange: control.onToggle
|
|
12
|
+
}) }
|
|
13
|
+
}))]);
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { columnSelectionCheckbox };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=column-selection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column-selection.js","names":["bindingColumnSelection"],"sources":["../src/column-selection.ts"],"sourcesContent":["import type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n COLUMN_SELECT,\n ColumnSelectCheckboxChrome,\n extendFeature,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { columnSelectionCheckbox as bindingColumnSelection } from \"@adapttable/vue/features\";\n\nimport { headlessCheckbox } from \"./controls/checkbox\";\n\nexport function columnSelectionCheckbox(): StaticTableFeature {\n return extendFeature(bindingColumnSelection(), [\n slotRender(COLUMN_SELECT, (props) =>\n ColumnSelectCheckboxChrome({\n ...props,\n slots: {\n Checkbox: (control) =>\n headlessCheckbox({\n attrs: { \"aria-label\": control.label },\n checked: control.checked,\n onChange: control.onToggle,\n }),\n },\n })\n ),\n ]);\n}\nexport type { ColumnSelectCheckboxProps } from \"@adapttable/vue/adapter\";\n"],"mappings":";;;;AAWA,SAAgB,0BAA8C;CAC5D,OAAO,cAAcA,0BAAuB,GAAG,CAC7C,WAAW,gBAAgB,UACzB,2BAA2B;EACzB,GAAG;EACH,OAAO,EACL,WAAW,YACT,iBAAiB;GACf,OAAO,EAAE,cAAc,QAAQ,MAAM;GACrC,SAAS,QAAQ;GACjB,UAAU,QAAQ;EACpB,CAAC,EACL;CACF,CAAC,CACH,CACF,CAAC;AACH"}
|
package/dist/columns.cjs
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
3
|
+
Object.defineProperty(exports, "collapsibleColumnGroups", {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
get: function() {
|
|
6
|
+
return _adapttable_vue_features.collapsibleColumnGroups;
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
Object.defineProperty(exports, "fitColumns", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return _adapttable_vue_features.fitColumns;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "multiSort", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function() {
|
|
18
|
+
return _adapttable_vue_features.multiSort;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports, "resizableColumns", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return _adapttable_vue_features.resizableColumns;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ColumnResizeHandleOptions, ColumnResizeHandleProps } from "@adapttable/vue/adapter";
|
|
2
|
+
import { collapsibleColumnGroups, fitColumns, multiSort, resizableColumns } from "@adapttable/vue/features";
|
|
3
|
+
export { type ColumnResizeHandleOptions, type ColumnResizeHandleProps, collapsibleColumnGroups, fitColumns, multiSort, resizableColumns };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ColumnResizeHandleOptions, ColumnResizeHandleProps } from "@adapttable/vue/adapter";
|
|
2
|
+
import { collapsibleColumnGroups, fitColumns, multiSort, resizableColumns } from "@adapttable/vue/features";
|
|
3
|
+
export { type ColumnResizeHandleOptions, type ColumnResizeHandleProps, collapsibleColumnGroups, fitColumns, multiSort, resizableColumns };
|
package/dist/columns.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_primitive = require("./primitive-BOve5bNE.cjs");
|
|
3
|
+
const require_basic = require("./basic-BUT5yxns.cjs");
|
|
4
|
+
const require_dialog = require("./dialog-kLRPt0eo.cjs");
|
|
5
|
+
let vue = require("vue");
|
|
6
|
+
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
7
|
+
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
8
|
+
//#region src/actions/CommandDialog.ts
|
|
9
|
+
/** Dialog owns dismissal and focus; Chrome supplies the original opener and lifetime. */
|
|
10
|
+
const HeadlessCommandDialog = (0, vue.defineComponent)((props) => {
|
|
11
|
+
let opener = null;
|
|
12
|
+
return () => {
|
|
13
|
+
if (props.open && !opener) {
|
|
14
|
+
const current = document.activeElement;
|
|
15
|
+
opener = props.getOpener() ?? (current instanceof HTMLElement ? current : null);
|
|
16
|
+
}
|
|
17
|
+
return (0, vue.h)(require_dialog.HeadlessDialog, {
|
|
18
|
+
open: props.open,
|
|
19
|
+
label: props.label,
|
|
20
|
+
dir: props.dir,
|
|
21
|
+
part: "command-palette",
|
|
22
|
+
className: ["at-headless-command-dialog", props.className].filter(Boolean).join(" "),
|
|
23
|
+
container: props.container,
|
|
24
|
+
onClose: () => {
|
|
25
|
+
if (props.isCurrent()) props.onClose();
|
|
26
|
+
},
|
|
27
|
+
onClosed: () => {
|
|
28
|
+
const target = opener;
|
|
29
|
+
opener = null;
|
|
30
|
+
if (props.isCurrent() && target?.isConnected) target.focus();
|
|
31
|
+
}
|
|
32
|
+
}, { default: () => props.children });
|
|
33
|
+
};
|
|
34
|
+
}, {
|
|
35
|
+
name: "HeadlessCommandDialog",
|
|
36
|
+
props: {
|
|
37
|
+
open: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: void 0
|
|
40
|
+
},
|
|
41
|
+
isCurrent: { type: Function },
|
|
42
|
+
getOpener: { type: Function },
|
|
43
|
+
onClose: { type: Function },
|
|
44
|
+
label: { type: String },
|
|
45
|
+
children: {
|
|
46
|
+
type: [
|
|
47
|
+
String,
|
|
48
|
+
Number,
|
|
49
|
+
Boolean,
|
|
50
|
+
Array,
|
|
51
|
+
Object
|
|
52
|
+
],
|
|
53
|
+
default: void 0
|
|
54
|
+
},
|
|
55
|
+
className: { type: String },
|
|
56
|
+
dir: { type: String },
|
|
57
|
+
container: { type: Object }
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/command-palette.ts
|
|
62
|
+
const CommandPaletteControl = (0, vue.defineComponent)((props) => {
|
|
63
|
+
const slots = {
|
|
64
|
+
Surface: (0, _adapttable_vue_adapter.managedCommandPaletteSurface)((control) => (0, vue.h)(HeadlessCommandDialog, {
|
|
65
|
+
...control,
|
|
66
|
+
dir: props.dir,
|
|
67
|
+
container: props.container
|
|
68
|
+
})),
|
|
69
|
+
Input: ({ inputProps: { value, onChange, ...attrs } }) => require_basic.headlessInput({
|
|
70
|
+
value,
|
|
71
|
+
onChange,
|
|
72
|
+
attrs: {
|
|
73
|
+
...(0, _adapttable_vue_adapter.toVueAttrs)(attrs),
|
|
74
|
+
class: props.classNames?.commandInput
|
|
75
|
+
}
|
|
76
|
+
}),
|
|
77
|
+
Item: ({ command, itemProps }) => (0, vue.h)(require_primitive.HeadlessPrimitive, {
|
|
78
|
+
as: "div",
|
|
79
|
+
...(0, _adapttable_vue_adapter.toVueAttrs)(itemProps),
|
|
80
|
+
class: ["at-headless-command-item", props.classNames?.commandItem]
|
|
81
|
+
}, { default: () => command.label }),
|
|
82
|
+
Empty: ({ message }) => (0, vue.h)("p", {
|
|
83
|
+
"data-adapttable-part": "command-empty",
|
|
84
|
+
class: ["at-headless-command-empty", props.classNames?.commandEmpty]
|
|
85
|
+
}, message)
|
|
86
|
+
};
|
|
87
|
+
return () => [props.model.button ? require_basic.headlessButton({
|
|
88
|
+
"data-adapttable-part": "command-palette-button",
|
|
89
|
+
"aria-haspopup": "dialog",
|
|
90
|
+
"aria-expanded": props.model.open,
|
|
91
|
+
class: props.classNames?.commandPaletteButton,
|
|
92
|
+
onClick: props.model.show
|
|
93
|
+
}, props.labels.commandPalette) : null, (0, vue.h)(_adapttable_vue_adapter.CommandPaletteChrome, {
|
|
94
|
+
commands: props.model.commands,
|
|
95
|
+
open: props.model.open,
|
|
96
|
+
onClose: props.model.close,
|
|
97
|
+
labels: props.labels,
|
|
98
|
+
className: props.classNames?.commandPalette,
|
|
99
|
+
slots
|
|
100
|
+
})];
|
|
101
|
+
}, {
|
|
102
|
+
name: "HeadlessCommandPaletteControl",
|
|
103
|
+
props: {
|
|
104
|
+
model: { type: Object },
|
|
105
|
+
labels: { type: Object },
|
|
106
|
+
dir: { type: String },
|
|
107
|
+
classNames: { type: Object },
|
|
108
|
+
container: { type: Object }
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
function commandPalette(options = true) {
|
|
112
|
+
return (0, _adapttable_vue_adapter.extendFeature)((0, _adapttable_vue_features.commandPalette)(options), [(0, _adapttable_vue_adapter.slotRender)(_adapttable_vue_adapter.COMMAND_PALETTE_CONTROL, (props) => (0, vue.h)(CommandPaletteControl, props))]);
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
exports.commandPalette = commandPalette;
|
|
116
|
+
|
|
117
|
+
//# sourceMappingURL=command-palette.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-palette.cjs","names":["defineComponent","h","HeadlessDialog","defineComponent","managedCommandPaletteSurface","h","headlessInput","toVueAttrs","HeadlessPrimitive","headlessButton","CommandPaletteChrome","extendFeature","bindingCommandPalette","slotRender","COMMAND_PALETTE_CONTROL"],"sources":["../src/actions/CommandDialog.ts","../src/command-palette.ts"],"sourcesContent":["import type { ManagedCommandPaletteSurfaceProps } from \"@adapttable/vue/adapter\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport { HeadlessDialog } from \"../controls/dialog\";\n\ntype Props = ManagedCommandPaletteSurfaceProps & {\n readonly dir: \"ltr\" | \"rtl\";\n readonly container?: HTMLElement;\n};\n\n/** Dialog owns dismissal and focus; Chrome supplies the original opener and lifetime. */\nexport const HeadlessCommandDialog = defineComponent(\n (props: Props) => {\n let opener: HTMLElement | null = null;\n return () => {\n if (props.open && !opener) {\n const current = document.activeElement;\n opener =\n props.getOpener() ??\n (current instanceof HTMLElement ? current : null);\n }\n return h(\n HeadlessDialog,\n {\n open: props.open,\n label: props.label,\n dir: props.dir,\n part: \"command-palette\",\n className: [\"at-headless-command-dialog\", props.className]\n .filter(Boolean)\n .join(\" \"),\n container: props.container,\n onClose: () => {\n if (props.isCurrent()) props.onClose();\n },\n onClosed: () => {\n const target = opener;\n opener = null;\n if (props.isCurrent() && target?.isConnected) target.focus();\n },\n },\n { default: () => props.children }\n );\n };\n },\n {\n name: \"HeadlessCommandDialog\",\n props: {\n open: { type: Boolean as PropType<Props[\"open\"]>, default: undefined },\n isCurrent: { type: Function as PropType<Props[\"isCurrent\"]> },\n getOpener: { type: Function as PropType<Props[\"getOpener\"]> },\n onClose: { type: Function as PropType<Props[\"onClose\"]> },\n label: { type: String as PropType<Props[\"label\"]> },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n Props[\"children\"]\n >,\n default: undefined,\n },\n className: { type: String as PropType<Props[\"className\"]> },\n dir: { type: String as PropType<Props[\"dir\"]> },\n container: { type: Object as PropType<Props[\"container\"]> },\n },\n }\n);\n","import type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n type ActionPresentation,\n COMMAND_PALETTE_CONTROL,\n CommandPaletteChrome,\n type CommandPaletteModel,\n type CommandPaletteSlots,\n extendFeature,\n managedCommandPaletteSurface,\n slotRender,\n toVueAttrs,\n} from \"@adapttable/vue/adapter\";\nimport { commandPalette as bindingCommandPalette } from \"@adapttable/vue/features\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport { HeadlessCommandDialog } from \"./actions/CommandDialog\";\nimport { headlessButton, headlessInput } from \"./controls/basic\";\nimport { HeadlessPrimitive } from \"./controls/primitive\";\n\nconst CommandPaletteControl = defineComponent(\n (props: ActionPresentation & { readonly model: CommandPaletteModel }) => {\n const slots: CommandPaletteSlots = {\n Surface: managedCommandPaletteSurface((control) =>\n h(HeadlessCommandDialog, {\n ...control,\n dir: props.dir,\n container: props.container,\n })\n ),\n Input: ({ inputProps: { value, onChange, ...attrs } }) =>\n headlessInput({\n value,\n onChange,\n attrs: {\n ...toVueAttrs(attrs),\n class: props.classNames?.commandInput,\n },\n }),\n Item: ({ command, itemProps }) =>\n h(\n HeadlessPrimitive,\n {\n as: \"div\",\n ...toVueAttrs(itemProps),\n class: [\"at-headless-command-item\", props.classNames?.commandItem],\n },\n { default: () => command.label }\n ),\n Empty: ({ message }) =>\n h(\n \"p\",\n {\n \"data-adapttable-part\": \"command-empty\",\n class: [\n \"at-headless-command-empty\",\n props.classNames?.commandEmpty,\n ],\n },\n message\n ),\n };\n return () => [\n props.model.button\n ? headlessButton(\n {\n \"data-adapttable-part\": \"command-palette-button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": props.model.open,\n class: props.classNames?.commandPaletteButton,\n onClick: props.model.show,\n },\n props.labels.commandPalette\n )\n : null,\n h(CommandPaletteChrome, {\n commands: props.model.commands,\n open: props.model.open,\n onClose: props.model.close,\n labels: props.labels,\n className: props.classNames?.commandPalette,\n slots,\n }),\n ];\n },\n {\n name: \"HeadlessCommandPaletteControl\",\n props: {\n model: {\n type: Object as PropType<\n (ActionPresentation & {\n readonly model: CommandPaletteModel;\n })[\"model\"]\n >,\n },\n labels: {\n type: Object as PropType<\n (ActionPresentation & {\n readonly model: CommandPaletteModel;\n })[\"labels\"]\n >,\n },\n dir: {\n type: String as PropType<\n (ActionPresentation & { readonly model: CommandPaletteModel })[\"dir\"]\n >,\n },\n classNames: {\n type: Object as PropType<\n (ActionPresentation & {\n readonly model: CommandPaletteModel;\n })[\"classNames\"]\n >,\n },\n container: {\n type: Object as PropType<\n (ActionPresentation & {\n readonly model: CommandPaletteModel;\n })[\"container\"]\n >,\n },\n },\n }\n);\n\nexport function commandPalette(\n options: Parameters<typeof bindingCommandPalette>[0] = true\n): StaticTableFeature {\n return extendFeature(bindingCommandPalette(options), [\n slotRender(COMMAND_PALETTE_CONTROL, (props) =>\n h(CommandPaletteControl, props)\n ),\n ]);\n}\nexport type { CommandPaletteOptions } from \"@adapttable/vue/features\";\n"],"mappings":"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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StaticTableFeature } from "@adapttable/vue";
|
|
2
|
+
import { CommandPaletteOptions, commandPalette as commandPalette$1 } from "@adapttable/vue/features";
|
|
3
|
+
//#region src/command-palette.d.ts
|
|
4
|
+
declare function commandPalette(options?: Parameters<typeof commandPalette$1>[0]): StaticTableFeature;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { type CommandPaletteOptions, commandPalette };
|
|
7
|
+
//# sourceMappingURL=command-palette.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-palette.d.cts","names":[],"sources":["../src/command-palette.ts"],"mappings":";;;iBA4HgB,eACd,UAAS,kBAAkB,uBAC1B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CommandPaletteOptions, commandPalette as commandPalette$1 } from "@adapttable/vue/features";
|
|
2
|
+
import { StaticTableFeature } from "@adapttable/vue";
|
|
3
|
+
//#region src/command-palette.d.ts
|
|
4
|
+
declare function commandPalette(options?: Parameters<typeof commandPalette$1>[0]): StaticTableFeature;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { type CommandPaletteOptions, commandPalette };
|
|
7
|
+
//# sourceMappingURL=command-palette.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-palette.d.ts","names":[],"sources":["../src/command-palette.ts"],"mappings":";;;iBA4HgB,eACd,UAAS,kBAAkB,uBAC1B"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { n as HeadlessPrimitive } from "./primitive-DzjBBhOj.js";
|
|
2
|
+
import { n as headlessInput, t as headlessButton } from "./basic-DX6Oejyw.js";
|
|
3
|
+
import { t as HeadlessDialog } from "./dialog-BFiJHEU0.js";
|
|
4
|
+
import { defineComponent, h } from "vue";
|
|
5
|
+
import { COMMAND_PALETTE_CONTROL, CommandPaletteChrome, extendFeature, managedCommandPaletteSurface, slotRender, toVueAttrs } from "@adapttable/vue/adapter";
|
|
6
|
+
import { commandPalette as commandPalette$1 } from "@adapttable/vue/features";
|
|
7
|
+
//#region src/actions/CommandDialog.ts
|
|
8
|
+
/** Dialog owns dismissal and focus; Chrome supplies the original opener and lifetime. */
|
|
9
|
+
const HeadlessCommandDialog = defineComponent((props) => {
|
|
10
|
+
let opener = null;
|
|
11
|
+
return () => {
|
|
12
|
+
if (props.open && !opener) {
|
|
13
|
+
const current = document.activeElement;
|
|
14
|
+
opener = props.getOpener() ?? (current instanceof HTMLElement ? current : null);
|
|
15
|
+
}
|
|
16
|
+
return h(HeadlessDialog, {
|
|
17
|
+
open: props.open,
|
|
18
|
+
label: props.label,
|
|
19
|
+
dir: props.dir,
|
|
20
|
+
part: "command-palette",
|
|
21
|
+
className: ["at-headless-command-dialog", props.className].filter(Boolean).join(" "),
|
|
22
|
+
container: props.container,
|
|
23
|
+
onClose: () => {
|
|
24
|
+
if (props.isCurrent()) props.onClose();
|
|
25
|
+
},
|
|
26
|
+
onClosed: () => {
|
|
27
|
+
const target = opener;
|
|
28
|
+
opener = null;
|
|
29
|
+
if (props.isCurrent() && target?.isConnected) target.focus();
|
|
30
|
+
}
|
|
31
|
+
}, { default: () => props.children });
|
|
32
|
+
};
|
|
33
|
+
}, {
|
|
34
|
+
name: "HeadlessCommandDialog",
|
|
35
|
+
props: {
|
|
36
|
+
open: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: void 0
|
|
39
|
+
},
|
|
40
|
+
isCurrent: { type: Function },
|
|
41
|
+
getOpener: { type: Function },
|
|
42
|
+
onClose: { type: Function },
|
|
43
|
+
label: { type: String },
|
|
44
|
+
children: {
|
|
45
|
+
type: [
|
|
46
|
+
String,
|
|
47
|
+
Number,
|
|
48
|
+
Boolean,
|
|
49
|
+
Array,
|
|
50
|
+
Object
|
|
51
|
+
],
|
|
52
|
+
default: void 0
|
|
53
|
+
},
|
|
54
|
+
className: { type: String },
|
|
55
|
+
dir: { type: String },
|
|
56
|
+
container: { type: Object }
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/command-palette.ts
|
|
61
|
+
const CommandPaletteControl = defineComponent((props) => {
|
|
62
|
+
const slots = {
|
|
63
|
+
Surface: managedCommandPaletteSurface((control) => h(HeadlessCommandDialog, {
|
|
64
|
+
...control,
|
|
65
|
+
dir: props.dir,
|
|
66
|
+
container: props.container
|
|
67
|
+
})),
|
|
68
|
+
Input: ({ inputProps: { value, onChange, ...attrs } }) => headlessInput({
|
|
69
|
+
value,
|
|
70
|
+
onChange,
|
|
71
|
+
attrs: {
|
|
72
|
+
...toVueAttrs(attrs),
|
|
73
|
+
class: props.classNames?.commandInput
|
|
74
|
+
}
|
|
75
|
+
}),
|
|
76
|
+
Item: ({ command, itemProps }) => h(HeadlessPrimitive, {
|
|
77
|
+
as: "div",
|
|
78
|
+
...toVueAttrs(itemProps),
|
|
79
|
+
class: ["at-headless-command-item", props.classNames?.commandItem]
|
|
80
|
+
}, { default: () => command.label }),
|
|
81
|
+
Empty: ({ message }) => h("p", {
|
|
82
|
+
"data-adapttable-part": "command-empty",
|
|
83
|
+
class: ["at-headless-command-empty", props.classNames?.commandEmpty]
|
|
84
|
+
}, message)
|
|
85
|
+
};
|
|
86
|
+
return () => [props.model.button ? headlessButton({
|
|
87
|
+
"data-adapttable-part": "command-palette-button",
|
|
88
|
+
"aria-haspopup": "dialog",
|
|
89
|
+
"aria-expanded": props.model.open,
|
|
90
|
+
class: props.classNames?.commandPaletteButton,
|
|
91
|
+
onClick: props.model.show
|
|
92
|
+
}, props.labels.commandPalette) : null, h(CommandPaletteChrome, {
|
|
93
|
+
commands: props.model.commands,
|
|
94
|
+
open: props.model.open,
|
|
95
|
+
onClose: props.model.close,
|
|
96
|
+
labels: props.labels,
|
|
97
|
+
className: props.classNames?.commandPalette,
|
|
98
|
+
slots
|
|
99
|
+
})];
|
|
100
|
+
}, {
|
|
101
|
+
name: "HeadlessCommandPaletteControl",
|
|
102
|
+
props: {
|
|
103
|
+
model: { type: Object },
|
|
104
|
+
labels: { type: Object },
|
|
105
|
+
dir: { type: String },
|
|
106
|
+
classNames: { type: Object },
|
|
107
|
+
container: { type: Object }
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
function commandPalette(options = true) {
|
|
111
|
+
return extendFeature(commandPalette$1(options), [slotRender(COMMAND_PALETTE_CONTROL, (props) => h(CommandPaletteControl, props))]);
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
export { commandPalette };
|
|
115
|
+
|
|
116
|
+
//# sourceMappingURL=command-palette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-palette.js","names":["bindingCommandPalette"],"sources":["../src/actions/CommandDialog.ts","../src/command-palette.ts"],"sourcesContent":["import type { ManagedCommandPaletteSurfaceProps } from \"@adapttable/vue/adapter\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport { HeadlessDialog } from \"../controls/dialog\";\n\ntype Props = ManagedCommandPaletteSurfaceProps & {\n readonly dir: \"ltr\" | \"rtl\";\n readonly container?: HTMLElement;\n};\n\n/** Dialog owns dismissal and focus; Chrome supplies the original opener and lifetime. */\nexport const HeadlessCommandDialog = defineComponent(\n (props: Props) => {\n let opener: HTMLElement | null = null;\n return () => {\n if (props.open && !opener) {\n const current = document.activeElement;\n opener =\n props.getOpener() ??\n (current instanceof HTMLElement ? current : null);\n }\n return h(\n HeadlessDialog,\n {\n open: props.open,\n label: props.label,\n dir: props.dir,\n part: \"command-palette\",\n className: [\"at-headless-command-dialog\", props.className]\n .filter(Boolean)\n .join(\" \"),\n container: props.container,\n onClose: () => {\n if (props.isCurrent()) props.onClose();\n },\n onClosed: () => {\n const target = opener;\n opener = null;\n if (props.isCurrent() && target?.isConnected) target.focus();\n },\n },\n { default: () => props.children }\n );\n };\n },\n {\n name: \"HeadlessCommandDialog\",\n props: {\n open: { type: Boolean as PropType<Props[\"open\"]>, default: undefined },\n isCurrent: { type: Function as PropType<Props[\"isCurrent\"]> },\n getOpener: { type: Function as PropType<Props[\"getOpener\"]> },\n onClose: { type: Function as PropType<Props[\"onClose\"]> },\n label: { type: String as PropType<Props[\"label\"]> },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n Props[\"children\"]\n >,\n default: undefined,\n },\n className: { type: String as PropType<Props[\"className\"]> },\n dir: { type: String as PropType<Props[\"dir\"]> },\n container: { type: Object as PropType<Props[\"container\"]> },\n },\n }\n);\n","import type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n type ActionPresentation,\n COMMAND_PALETTE_CONTROL,\n CommandPaletteChrome,\n type CommandPaletteModel,\n type CommandPaletteSlots,\n extendFeature,\n managedCommandPaletteSurface,\n slotRender,\n toVueAttrs,\n} from \"@adapttable/vue/adapter\";\nimport { commandPalette as bindingCommandPalette } from \"@adapttable/vue/features\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport { HeadlessCommandDialog } from \"./actions/CommandDialog\";\nimport { headlessButton, headlessInput } from \"./controls/basic\";\nimport { HeadlessPrimitive } from \"./controls/primitive\";\n\nconst CommandPaletteControl = defineComponent(\n (props: ActionPresentation & { readonly model: CommandPaletteModel }) => {\n const slots: CommandPaletteSlots = {\n Surface: managedCommandPaletteSurface((control) =>\n h(HeadlessCommandDialog, {\n ...control,\n dir: props.dir,\n container: props.container,\n })\n ),\n Input: ({ inputProps: { value, onChange, ...attrs } }) =>\n headlessInput({\n value,\n onChange,\n attrs: {\n ...toVueAttrs(attrs),\n class: props.classNames?.commandInput,\n },\n }),\n Item: ({ command, itemProps }) =>\n h(\n HeadlessPrimitive,\n {\n as: \"div\",\n ...toVueAttrs(itemProps),\n class: [\"at-headless-command-item\", props.classNames?.commandItem],\n },\n { default: () => command.label }\n ),\n Empty: ({ message }) =>\n h(\n \"p\",\n {\n \"data-adapttable-part\": \"command-empty\",\n class: [\n \"at-headless-command-empty\",\n props.classNames?.commandEmpty,\n ],\n },\n message\n ),\n };\n return () => [\n props.model.button\n ? headlessButton(\n {\n \"data-adapttable-part\": \"command-palette-button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": props.model.open,\n class: props.classNames?.commandPaletteButton,\n onClick: props.model.show,\n },\n props.labels.commandPalette\n )\n : null,\n h(CommandPaletteChrome, {\n commands: props.model.commands,\n open: props.model.open,\n onClose: props.model.close,\n labels: props.labels,\n className: props.classNames?.commandPalette,\n slots,\n }),\n ];\n },\n {\n name: \"HeadlessCommandPaletteControl\",\n props: {\n model: {\n type: Object as PropType<\n (ActionPresentation & {\n readonly model: CommandPaletteModel;\n })[\"model\"]\n >,\n },\n labels: {\n type: Object as PropType<\n (ActionPresentation & {\n readonly model: CommandPaletteModel;\n })[\"labels\"]\n >,\n },\n dir: {\n type: String as PropType<\n (ActionPresentation & { readonly model: CommandPaletteModel })[\"dir\"]\n >,\n },\n classNames: {\n type: Object as PropType<\n (ActionPresentation & {\n readonly model: CommandPaletteModel;\n })[\"classNames\"]\n >,\n },\n container: {\n type: Object as PropType<\n (ActionPresentation & {\n readonly model: CommandPaletteModel;\n })[\"container\"]\n >,\n },\n },\n }\n);\n\nexport function commandPalette(\n options: Parameters<typeof bindingCommandPalette>[0] = true\n): StaticTableFeature {\n return extendFeature(bindingCommandPalette(options), [\n slotRender(COMMAND_PALETTE_CONTROL, (props) =>\n h(CommandPaletteControl, props)\n ),\n ]);\n}\nexport type { CommandPaletteOptions } from \"@adapttable/vue/features\";\n"],"mappings":";;;;;;;;AAWA,MAAa,wBAAwB,iBAClC,UAAiB;CAChB,IAAI,SAA6B;CACjC,aAAa;EACX,IAAI,MAAM,QAAQ,CAAC,QAAQ;GACzB,MAAM,UAAU,SAAS;GACzB,SACE,MAAM,UAAU,MACf,mBAAmB,cAAc,UAAU;EAChD;EACA,OAAO,EACL,gBACA;GACE,MAAM,MAAM;GACZ,OAAO,MAAM;GACb,KAAK,MAAM;GACX,MAAM;GACN,WAAW,CAAC,8BAA8B,MAAM,SAAS,CAAC,CACvD,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;GACX,WAAW,MAAM;GACjB,eAAe;IACb,IAAI,MAAM,UAAU,GAAG,MAAM,QAAQ;GACvC;GACA,gBAAgB;IACd,MAAM,SAAS;IACf,SAAS;IACT,IAAI,MAAM,UAAU,KAAK,QAAQ,aAAa,OAAO,MAAM;GAC7D;EACF,GACA,EAAE,eAAe,MAAM,SAAS,CAClC;CACF;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,MAAM;GAAE,MAAM;GAAoC,SAAS,KAAA;EAAU;EACrE,WAAW,EAAE,MAAM,SAAyC;EAC5D,WAAW,EAAE,MAAM,SAAyC;EAC5D,SAAS,EAAE,MAAM,SAAuC;EACxD,OAAO,EAAE,MAAM,OAAmC;EAClD,UAAU;GACR,MAAM;IAAC;IAAQ;IAAQ;IAAS;IAAO;GAAM;GAG7C,SAAS,KAAA;EACX;EACA,WAAW,EAAE,MAAM,OAAuC;EAC1D,KAAK,EAAE,MAAM,OAAiC;EAC9C,WAAW,EAAE,MAAM,OAAuC;CAC5D;AACF,CACF;;;AC7CA,MAAM,wBAAwB,iBAC3B,UAAwE;CACvE,MAAM,QAA6B;EACjC,SAAS,8BAA8B,YACrC,EAAE,uBAAuB;GACvB,GAAG;GACH,KAAK,MAAM;GACX,WAAW,MAAM;EACnB,CAAC,CACH;EACA,QAAQ,EAAE,YAAY,EAAE,OAAO,UAAU,GAAG,cAC1C,cAAc;GACZ;GACA;GACA,OAAO;IACL,GAAG,WAAW,KAAK;IACnB,OAAO,MAAM,YAAY;GAC3B;EACF,CAAC;EACH,OAAO,EAAE,SAAS,gBAChB,EACE,mBACA;GACE,IAAI;GACJ,GAAG,WAAW,SAAS;GACvB,OAAO,CAAC,4BAA4B,MAAM,YAAY,WAAW;EACnE,GACA,EAAE,eAAe,QAAQ,MAAM,CACjC;EACF,QAAQ,EAAE,cACR,EACE,KACA;GACE,wBAAwB;GACxB,OAAO,CACL,6BACA,MAAM,YAAY,YACpB;EACF,GACA,OACF;CACJ;CACA,aAAa,CACX,MAAM,MAAM,SACR,eACE;EACE,wBAAwB;EACxB,iBAAiB;EACjB,iBAAiB,MAAM,MAAM;EAC7B,OAAO,MAAM,YAAY;EACzB,SAAS,MAAM,MAAM;CACvB,GACA,MAAM,OAAO,cACf,IACA,MACJ,EAAE,sBAAsB;EACtB,UAAU,MAAM,MAAM;EACtB,MAAM,MAAM,MAAM;EAClB,SAAS,MAAM,MAAM;EACrB,QAAQ,MAAM;EACd,WAAW,MAAM,YAAY;EAC7B;CACF,CAAC,CACH;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,OAAO,EACL,MAAM,OAKR;EACA,QAAQ,EACN,MAAM,OAKR;EACA,KAAK,EACH,MAAM,OAGR;EACA,YAAY,EACV,MAAM,OAKR;EACA,WAAW,EACT,MAAM,OAKR;CACF;AACF,CACF;AAEA,SAAgB,eACd,UAAuD,MACnC;CACpB,OAAO,cAAcA,iBAAsB,OAAO,GAAG,CACnD,WAAW,0BAA0B,UACnC,EAAE,uBAAuB,KAAK,CAChC,CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_primitive = require("./primitive-BOve5bNE.cjs");
|
|
3
|
+
const require_portal = require("./portal-BeSwili6.cjs");
|
|
4
|
+
const require_overlay = require("./overlay-BELaYa9y.cjs");
|
|
5
|
+
const require_menu = require("./menu-RAcylhSS.cjs");
|
|
6
|
+
let vue = require("vue");
|
|
7
|
+
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
8
|
+
let _headlessui_vue = require("@headlessui/vue");
|
|
9
|
+
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
10
|
+
//#region src/actions/ContextSurface.ts
|
|
11
|
+
/**
|
|
12
|
+
* The binding supplies the point as an anchor host. The items are a Headless
|
|
13
|
+
* UI Menu list; the binding owns whether it is open, so the list is shown
|
|
14
|
+
* statically and dismissed by the layer.
|
|
15
|
+
*/
|
|
16
|
+
const HeadlessContextSurface = (0, vue.defineComponent)((props) => {
|
|
17
|
+
const active = (0, _adapttable_vue_adapter.useScopeActivity)();
|
|
18
|
+
const items = (0, vue.shallowRef)(null);
|
|
19
|
+
require_overlay.usePlacement(() => items.value, () => props.anchorRef.current, () => props.dir, "start");
|
|
20
|
+
require_overlay.useDismissLayer({
|
|
21
|
+
open: () => active.value && props.anchorRef.current !== null,
|
|
22
|
+
panel: () => items.value,
|
|
23
|
+
anchor: () => null,
|
|
24
|
+
onDismiss: () => props.onClose()
|
|
25
|
+
});
|
|
26
|
+
const onKeydown = (event) => {
|
|
27
|
+
if (event.key === "Escape") props.onClose();
|
|
28
|
+
};
|
|
29
|
+
const capture = (component) => {
|
|
30
|
+
const element = require_overlay.elementOf(component);
|
|
31
|
+
if (element && element !== items.value) (0, vue.nextTick)(() => element.focus({ preventScroll: true }));
|
|
32
|
+
items.value = element;
|
|
33
|
+
};
|
|
34
|
+
const children = () => props.children;
|
|
35
|
+
return () => {
|
|
36
|
+
if (!active.value || !props.anchorRef.current) return null;
|
|
37
|
+
return require_portal.headlessPortal(() => (0, vue.h)(_headlessui_vue.Menu, { as: "template" }, { default: () => (0, vue.h)(_headlessui_vue.MenuItems, {
|
|
38
|
+
static: true,
|
|
39
|
+
class: ["at-headless-menu", props.className],
|
|
40
|
+
dir: props.dir,
|
|
41
|
+
"data-adapttable-part": "context-menu",
|
|
42
|
+
"aria-label": props.label,
|
|
43
|
+
onKeydown,
|
|
44
|
+
ref: capture
|
|
45
|
+
}, { default: children }) }), props.container ?? void 0);
|
|
46
|
+
};
|
|
47
|
+
}, {
|
|
48
|
+
name: "HeadlessContextSurface",
|
|
49
|
+
props: {
|
|
50
|
+
at: { type: Object },
|
|
51
|
+
anchorRef: { type: Object },
|
|
52
|
+
label: { type: String },
|
|
53
|
+
onClose: { type: Function },
|
|
54
|
+
container: { type: Object },
|
|
55
|
+
children: {
|
|
56
|
+
type: [
|
|
57
|
+
String,
|
|
58
|
+
Number,
|
|
59
|
+
Boolean,
|
|
60
|
+
Array,
|
|
61
|
+
Object
|
|
62
|
+
],
|
|
63
|
+
default: void 0
|
|
64
|
+
},
|
|
65
|
+
className: { type: String },
|
|
66
|
+
dir: { type: String }
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/context-menu.ts
|
|
71
|
+
function controls(dir, names) {
|
|
72
|
+
return {
|
|
73
|
+
Surface: (props) => (0, vue.h)(HeadlessContextSurface, {
|
|
74
|
+
...props,
|
|
75
|
+
dir: dir()
|
|
76
|
+
}),
|
|
77
|
+
Item: ({ item, onSelect }) => require_menu.headlessMenuItem({
|
|
78
|
+
class: names().contextMenuItem,
|
|
79
|
+
"data-adapttable-part": "context-menu-item",
|
|
80
|
+
"data-danger": item.danger ? "" : void 0,
|
|
81
|
+
onClick: () => onSelect()
|
|
82
|
+
}, () => item.label, item.disabled),
|
|
83
|
+
Separator: () => (0, vue.h)(require_primitive.HeadlessPrimitive, {
|
|
84
|
+
as: "div",
|
|
85
|
+
role: "separator",
|
|
86
|
+
"data-adapttable-part": "context-menu-separator",
|
|
87
|
+
class: "at-headless-menu-separator"
|
|
88
|
+
})
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
const HeadlessContextMenuControl = /*#__PURE__*/ (0, vue.defineComponent)((props) => {
|
|
92
|
+
const slots = controls(() => props.dir, () => props.classNames ?? {});
|
|
93
|
+
return () => (0, vue.h)(_adapttable_vue_adapter.ContextMenuChrome, {
|
|
94
|
+
items: props.model.items,
|
|
95
|
+
at: props.model.at,
|
|
96
|
+
onClose: props.model.close,
|
|
97
|
+
labels: props.labels,
|
|
98
|
+
className: props.classNames?.contextMenu,
|
|
99
|
+
container: props.container,
|
|
100
|
+
slots
|
|
101
|
+
});
|
|
102
|
+
}, {
|
|
103
|
+
name: "HeadlessContextMenuControl",
|
|
104
|
+
props: {
|
|
105
|
+
model: { type: Object },
|
|
106
|
+
labels: { type: Object },
|
|
107
|
+
dir: { type: String },
|
|
108
|
+
container: { type: Object },
|
|
109
|
+
classNames: { type: Object }
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
function contextMenu(options = true) {
|
|
113
|
+
return (0, _adapttable_vue_adapter.extendFeature)((0, _adapttable_vue_features.contextMenu)(options), [(0, _adapttable_vue_adapter.slotRender)(_adapttable_vue_adapter.CONTEXT_MENU_CONTROL, (props) => (0, vue.h)(HeadlessContextMenuControl, props))]);
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
exports.contextMenu = contextMenu;
|
|
117
|
+
|
|
118
|
+
//# sourceMappingURL=context-menu.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-menu.cjs","names":["defineComponent","useScopeActivity","shallowRef","elementOf","nextTick","headlessPortal","h","Menu","MenuItems","h","headlessMenuItem","HeadlessPrimitive","ContextMenuChrome","extendFeature","bindingContextMenu","slotRender","CONTEXT_MENU_CONTROL"],"sources":["../src/actions/ContextSurface.ts","../src/context-menu.ts"],"sourcesContent":["import {\n type ContextMenuSlots,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { Menu, MenuItems } from \"@headlessui/vue\";\nimport { defineComponent, h, nextTick, type PropType, shallowRef } from \"vue\";\n\nimport { elementOf, useDismissLayer, usePlacement } from \"../controls/overlay\";\nimport { headlessPortal } from \"../controls/portal\";\n\ntype Props = Parameters<ContextMenuSlots[\"Surface\"]>[0] & {\n readonly dir: \"ltr\" | \"rtl\";\n};\n\n/**\n * The binding supplies the point as an anchor host. The items are a Headless\n * UI Menu list; the binding owns whether it is open, so the list is shown\n * statically and dismissed by the layer.\n */\nexport const HeadlessContextSurface = defineComponent(\n (props: Props) => {\n const active = useScopeActivity();\n const items = shallowRef<HTMLElement | null>(null);\n usePlacement(\n () => items.value,\n () => props.anchorRef.current,\n () => props.dir,\n \"start\"\n );\n useDismissLayer({\n open: () => active.value && props.anchorRef.current !== null,\n panel: () => items.value,\n anchor: () => null,\n onDismiss: () => props.onClose(),\n });\n // Headless UI stops Escape at the list, so the layer never sees it; the\n // binding owns closing.\n const onKeydown = (event: KeyboardEvent): void => {\n if (event.key === \"Escape\") props.onClose();\n };\n const capture = (component: unknown): void => {\n const element = elementOf(component);\n if (element && element !== items.value)\n void nextTick(() => element.focus({ preventScroll: true }));\n items.value = element;\n };\n const children = () => props.children;\n return () => {\n if (!active.value || !props.anchorRef.current) return null;\n return headlessPortal(\n () =>\n h(\n Menu,\n { as: \"template\" },\n {\n default: () =>\n h(\n MenuItems,\n {\n static: true,\n class: [\"at-headless-menu\", props.className],\n dir: props.dir,\n \"data-adapttable-part\": \"context-menu\",\n \"aria-label\": props.label,\n onKeydown,\n ref: capture,\n },\n { default: children }\n ),\n }\n ),\n props.container ?? undefined\n );\n };\n },\n {\n name: \"HeadlessContextSurface\",\n props: {\n at: { type: Object as PropType<Props[\"at\"]> },\n anchorRef: { type: Object as PropType<Props[\"anchorRef\"]> },\n label: { type: String as PropType<Props[\"label\"]> },\n onClose: { type: Function as PropType<Props[\"onClose\"]> },\n container: { type: Object as PropType<Props[\"container\"]> },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n Props[\"children\"]\n >,\n default: undefined,\n },\n className: { type: String as PropType<Props[\"className\"]> },\n dir: { type: String as PropType<Props[\"dir\"]> },\n },\n }\n);\n","import type { TableFeature } from \"@adapttable/vue\";\nimport {\n type ActionPresentation,\n CONTEXT_MENU_CONTROL,\n ContextMenuChrome,\n type ContextMenuModel,\n type ContextMenuSlots,\n extendFeature,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport {\n contextMenu as bindingContextMenu,\n type ContextMenuOptions,\n} from \"@adapttable/vue/features\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport { HeadlessContextSurface } from \"./actions/ContextSurface\";\nimport { headlessMenuItem } from \"./controls/menu\";\nimport { HeadlessPrimitive } from \"./controls/primitive\";\n\nfunction controls(\n dir: () => \"ltr\" | \"rtl\",\n names: () => Readonly<Record<string, string | undefined>>\n): ContextMenuSlots {\n return {\n Surface: (props) => h(HeadlessContextSurface, { ...props, dir: dir() }),\n Item: ({ item, onSelect }) =>\n headlessMenuItem(\n {\n class: names().contextMenuItem,\n \"data-adapttable-part\": \"context-menu-item\",\n \"data-danger\": item.danger ? \"\" : undefined,\n onClick: () => onSelect(),\n },\n () => item.label,\n item.disabled\n ),\n Separator: () =>\n h(HeadlessPrimitive, {\n as: \"div\",\n role: \"separator\",\n \"data-adapttable-part\": \"context-menu-separator\",\n class: \"at-headless-menu-separator\",\n }),\n };\n}\nconst HeadlessContextMenuControl = /*#__PURE__*/ defineComponent(\n (props: ActionPresentation & { readonly model: ContextMenuModel }) => {\n const slots = controls(\n () => props.dir,\n () => props.classNames ?? {}\n );\n return () =>\n h(ContextMenuChrome, {\n items: props.model.items,\n at: props.model.at,\n onClose: props.model.close,\n labels: props.labels,\n className: props.classNames?.contextMenu,\n container: props.container,\n slots,\n });\n },\n {\n name: \"HeadlessContextMenuControl\",\n props: {\n model: {\n type: Object as PropType<\n (ActionPresentation & { readonly model: ContextMenuModel })[\"model\"]\n >,\n },\n labels: {\n type: Object as PropType<\n (ActionPresentation & { readonly model: ContextMenuModel })[\"labels\"]\n >,\n },\n dir: {\n type: String as PropType<\n (ActionPresentation & { readonly model: ContextMenuModel })[\"dir\"]\n >,\n },\n container: {\n type: Object as PropType<\n (ActionPresentation & {\n readonly model: ContextMenuModel;\n })[\"container\"]\n >,\n },\n classNames: {\n type: Object as PropType<\n (ActionPresentation & {\n readonly model: ContextMenuModel;\n })[\"classNames\"]\n >,\n },\n },\n }\n);\nexport function contextMenu<TRow>(\n options: boolean | ContextMenuOptions<TRow> = true\n): TableFeature<TRow> {\n return extendFeature(bindingContextMenu<TRow>(options), [\n slotRender(CONTEXT_MENU_CONTROL, (props) =>\n h(HeadlessContextMenuControl, props)\n ),\n ]);\n}\nexport type { ContextMenuItem, ContextMenuTarget } from \"@adapttable/vue\";\nexport type { ContextMenuOptions } from \"@adapttable/vue/features\";\n"],"mappings":"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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ContextMenuItem, ContextMenuTarget, TableFeature } from "@adapttable/vue";
|
|
2
|
+
import { ContextMenuOptions, ContextMenuOptions as ContextMenuOptions$1 } from "@adapttable/vue/features";
|
|
3
|
+
//#region src/context-menu.d.ts
|
|
4
|
+
declare function contextMenu<TRow>(options?: boolean | ContextMenuOptions$1<TRow>): TableFeature<TRow>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { type ContextMenuItem, type ContextMenuOptions, type ContextMenuTarget, contextMenu };
|
|
7
|
+
//# sourceMappingURL=context-menu.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-menu.d.cts","names":[],"sources":["../src/context-menu.ts"],"mappings":";;;iBAkGgB,YAAY,MAC1B,oBAAmB,qBAAmB,QACrC,aAAa"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ContextMenuOptions, ContextMenuOptions as ContextMenuOptions$1 } from "@adapttable/vue/features";
|
|
2
|
+
import { ContextMenuItem, ContextMenuTarget, TableFeature } from "@adapttable/vue";
|
|
3
|
+
//#region src/context-menu.d.ts
|
|
4
|
+
declare function contextMenu<TRow>(options?: boolean | ContextMenuOptions$1<TRow>): TableFeature<TRow>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { type ContextMenuItem, type ContextMenuOptions, type ContextMenuTarget, contextMenu };
|
|
7
|
+
//# sourceMappingURL=context-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-menu.d.ts","names":[],"sources":["../src/context-menu.ts"],"mappings":";;;iBAkGgB,YAAY,MAC1B,oBAAmB,qBAAmB,QACrC,aAAa"}
|