@toolbox-web/grid-vue 0.7.0 → 0.8.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/chunks/use-grid-B59B6XdD.js +22 -0
- package/chunks/use-grid-B59B6XdD.js.map +1 -0
- package/features/clipboard.d.ts +0 -19
- package/features/clipboard.d.ts.map +1 -1
- package/features/clipboard.js +1 -3
- package/features/clipboard.js.map +1 -1
- package/features/column-virtualization.d.ts +0 -19
- package/features/column-virtualization.d.ts.map +1 -1
- package/features/column-virtualization.js +1 -3
- package/features/column-virtualization.js.map +1 -1
- package/features/context-menu.d.ts +0 -19
- package/features/context-menu.d.ts.map +1 -1
- package/features/context-menu.js +1 -3
- package/features/context-menu.js.map +1 -1
- package/features/editing.d.ts +0 -19
- package/features/editing.d.ts.map +1 -1
- package/features/editing.js +1 -3
- package/features/editing.js.map +1 -1
- package/features/export.d.ts.map +1 -1
- package/features/export.js +18 -20
- package/features/export.js.map +1 -1
- package/features/filtering.js +33 -33
- package/features/filtering.js.map +1 -1
- package/features/grouping-columns.d.ts +0 -23
- package/features/grouping-columns.d.ts.map +1 -1
- package/features/grouping-columns.js +1 -3
- package/features/grouping-columns.js.map +1 -1
- package/features/grouping-rows.d.ts +0 -22
- package/features/grouping-rows.d.ts.map +1 -1
- package/features/grouping-rows.js +1 -3
- package/features/grouping-rows.js.map +1 -1
- package/features/index.js +20 -21
- package/features/index.js.map +1 -1
- package/features/master-detail.d.ts +0 -22
- package/features/master-detail.d.ts.map +1 -1
- package/features/master-detail.js +1 -3
- package/features/master-detail.js.map +1 -1
- package/features/multi-sort.d.ts +0 -19
- package/features/multi-sort.d.ts.map +1 -1
- package/features/multi-sort.js +1 -4
- package/features/multi-sort.js.map +1 -1
- package/features/pinned-columns.d.ts +0 -22
- package/features/pinned-columns.d.ts.map +1 -1
- package/features/pinned-columns.js +1 -3
- package/features/pinned-columns.js.map +1 -1
- package/features/pinned-rows.d.ts +0 -21
- package/features/pinned-rows.d.ts.map +1 -1
- package/features/pinned-rows.js +1 -3
- package/features/pinned-rows.js.map +1 -1
- package/features/pivot.d.ts +0 -23
- package/features/pivot.d.ts.map +1 -1
- package/features/pivot.js +1 -3
- package/features/pivot.js.map +1 -1
- package/features/print.d.ts.map +1 -1
- package/features/print.js +11 -13
- package/features/print.js.map +1 -1
- package/features/reorder-columns.d.ts +1 -0
- package/features/reorder-columns.d.ts.map +1 -0
- package/features/reorder-columns.js +2 -0
- package/features/reorder-columns.js.map +1 -0
- package/features/reorder-rows.d.ts +1 -0
- package/features/reorder-rows.d.ts.map +1 -0
- package/features/reorder-rows.js +2 -0
- package/features/reorder-rows.js.map +1 -0
- package/features/reorder.d.ts +3 -17
- package/features/reorder.d.ts.map +1 -1
- package/features/reorder.js +1 -3
- package/features/reorder.js.map +1 -1
- package/features/responsive.d.ts +0 -23
- package/features/responsive.d.ts.map +1 -1
- package/features/responsive.js +1 -3
- package/features/responsive.js.map +1 -1
- package/features/row-reorder.d.ts +3 -17
- package/features/row-reorder.d.ts.map +1 -1
- package/features/row-reorder.js +1 -3
- package/features/row-reorder.js.map +1 -1
- package/features/selection.d.ts.map +1 -1
- package/features/selection.js +20 -22
- package/features/selection.js.map +1 -1
- package/features/server-side.d.ts +0 -21
- package/features/server-side.d.ts.map +1 -1
- package/features/server-side.js +1 -3
- package/features/server-side.js.map +1 -1
- package/features/tree.d.ts +0 -22
- package/features/tree.d.ts.map +1 -1
- package/features/tree.js +1 -3
- package/features/tree.js.map +1 -1
- package/features/undo-redo.d.ts.map +1 -1
- package/features/undo-redo.js +10 -12
- package/features/undo-redo.js.map +1 -1
- package/features/visibility.d.ts +0 -19
- package/features/visibility.d.ts.map +1 -1
- package/features/visibility.js +1 -3
- package/features/visibility.js.map +1 -1
- package/index.js +87 -73
- package/index.js.map +1 -1
- package/lib/TbwGrid.vue.d.ts +5 -1
- package/lib/TbwGrid.vue.d.ts.map +1 -1
- package/lib/feature-props.d.ts +12 -4
- package/lib/feature-props.d.ts.map +1 -1
- package/lib/feature-registry.d.ts +6 -51
- package/lib/feature-registry.d.ts.map +1 -1
- package/lib/use-grid.d.ts +5 -0
- package/lib/use-grid.d.ts.map +1 -1
- package/package.json +1 -1
- package/chunks/feature-registry-BgEOysSJ.js +0 -38
- package/chunks/feature-registry-BgEOysSJ.js.map +0 -1
- package/chunks/use-grid-DwjXrO19.js +0 -21
- package/chunks/use-grid-DwjXrO19.js.map +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { inject as a, ref as n } from "vue";
|
|
2
|
+
const r = /* @__PURE__ */ Symbol("tbw-grid");
|
|
3
|
+
function g() {
|
|
4
|
+
const e = a(r, n(null));
|
|
5
|
+
return {
|
|
6
|
+
gridElement: e,
|
|
7
|
+
forceLayout: async () => {
|
|
8
|
+
await e.value?.forceLayout();
|
|
9
|
+
},
|
|
10
|
+
getConfig: () => e.value?.getConfig(),
|
|
11
|
+
ready: async () => {
|
|
12
|
+
await e.value?.ready();
|
|
13
|
+
},
|
|
14
|
+
getPlugin: (t) => e.value?.getPlugin(t),
|
|
15
|
+
getPluginByName: ((t) => e.value?.getPluginByName(t))
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
r as G,
|
|
20
|
+
g as u
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=use-grid-B59B6XdD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-grid-B59B6XdD.js","sources":["../../../../libs/grid-vue/src/lib/use-grid.ts"],"sourcesContent":["import type { DataGridElement } from '@toolbox-web/grid';\nimport { inject, ref, type InjectionKey, type Ref } from 'vue';\n\n/**\n * Injection key for the grid element.\n */\nexport const GRID_ELEMENT_KEY: InjectionKey<Ref<DataGridElement | null>> = Symbol('tbw-grid');\n\n/**\n * Return type for useGrid composable.\n */\nexport interface UseGridReturn {\n /** The grid element reference */\n gridElement: Ref<DataGridElement | null>;\n /** Force a layout recalculation */\n forceLayout: () => Promise<void>;\n /** Get current grid configuration */\n getConfig: () => ReturnType<DataGridElement['getConfig']> | undefined;\n /** Wait for grid to be ready */\n ready: () => Promise<void>;\n /** Get a plugin by its class */\n getPlugin: <T>(pluginClass: new (...args: unknown[]) => T) => T | undefined;\n /**\n * Get a plugin by its registered name (preferred).\n * Uses the type-safe PluginNameMap for auto-completion and return type narrowing.\n */\n getPluginByName: DataGridElement['getPluginByName'];\n}\n\n/**\n * Composable for programmatic access to the grid.\n *\n * @example\n * ```vue\n * <script setup>\n * import { useGrid } from '@toolbox-web/grid-vue';\n *\n * const { forceLayout, getConfig } = useGrid();\n *\n * async function handleResize() {\n * await forceLayout();\n * }\n * </script>\n * ```\n */\nexport function useGrid(): UseGridReturn {\n const gridElement = inject(GRID_ELEMENT_KEY, ref(null));\n\n return {\n gridElement,\n forceLayout: async () => {\n await gridElement.value?.forceLayout();\n },\n getConfig: () => {\n return gridElement.value?.getConfig();\n },\n ready: async () => {\n await gridElement.value?.ready();\n },\n getPlugin: <T>(pluginClass: new (...args: unknown[]) => T) => {\n return gridElement.value?.getPlugin(pluginClass);\n },\n getPluginByName: ((name: string) => {\n return gridElement.value?.getPluginByName(name);\n }) as DataGridElement['getPluginByName'],\n };\n}\n"],"names":["GRID_ELEMENT_KEY","useGrid","gridElement","inject","ref","pluginClass","name"],"mappings":";AAMO,MAAMA,2BAAqE,UAAU;AAuCrF,SAASC,IAAyB;AACvC,QAAMC,IAAcC,EAAOH,GAAkBI,EAAI,IAAI,CAAC;AAEtD,SAAO;AAAA,IACL,aAAAF;AAAA,IACA,aAAa,YAAY;AACvB,YAAMA,EAAY,OAAO,YAAA;AAAA,IAC3B;AAAA,IACA,WAAW,MACFA,EAAY,OAAO,UAAA;AAAA,IAE5B,OAAO,YAAY;AACjB,YAAMA,EAAY,OAAO,MAAA;AAAA,IAC3B;AAAA,IACA,WAAW,CAAIG,MACNH,EAAY,OAAO,UAAUG,CAAW;AAAA,IAEjD,kBAAkB,CAACC,MACVJ,EAAY,OAAO,gBAAgBI,CAAI;AAAA,EAChD;AAEJ;"}
|
package/features/clipboard.d.ts
CHANGED
|
@@ -1,20 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Clipboard feature for @toolbox-web/grid-vue
|
|
3
|
-
*
|
|
4
|
-
* Import this module to enable the `clipboard` prop on TbwGrid.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```vue
|
|
8
|
-
* <script setup>
|
|
9
|
-
* import '@toolbox-web/grid-vue/features/clipboard';
|
|
10
|
-
* </script>
|
|
11
|
-
*
|
|
12
|
-
* <template>
|
|
13
|
-
* <TbwGrid selection="range" clipboard />
|
|
14
|
-
* </template>
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @packageDocumentation
|
|
18
|
-
*/
|
|
19
|
-
export {};
|
|
20
1
|
//# sourceMappingURL=clipboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/clipboard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG"}
|
|
1
|
+
{"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/clipboard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,sCAAsC,CAAC"}
|
package/features/clipboard.js
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { r as i } from "../chunks/feature-registry-BgEOysSJ.js";
|
|
3
|
-
i("clipboard", (r) => r === !0 ? new e() : new e(r ?? void 0));
|
|
1
|
+
import "@toolbox-web/grid/features/clipboard";
|
|
4
2
|
//# sourceMappingURL=clipboard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clipboard.js","sources":[
|
|
1
|
+
{"version":3,"file":"clipboard.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,20 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Column virtualization feature for @toolbox-web/grid-vue
|
|
3
|
-
*
|
|
4
|
-
* Import this module to enable the `columnVirtualization` prop on TbwGrid.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```vue
|
|
8
|
-
* <script setup>
|
|
9
|
-
* import '@toolbox-web/grid-vue/features/column-virtualization';
|
|
10
|
-
* </script>
|
|
11
|
-
*
|
|
12
|
-
* <template>
|
|
13
|
-
* <TbwGrid columnVirtualization />
|
|
14
|
-
* </template>
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @packageDocumentation
|
|
18
|
-
*/
|
|
19
|
-
export {};
|
|
20
1
|
//# sourceMappingURL=column-virtualization.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-virtualization.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/column-virtualization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG"}
|
|
1
|
+
{"version":3,"file":"column-virtualization.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/column-virtualization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,kDAAkD,CAAC"}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { r as t } from "../chunks/feature-registry-BgEOysSJ.js";
|
|
3
|
-
t("columnVirtualization", (r) => r === !0 ? new i() : new i(r ?? void 0));
|
|
1
|
+
import "@toolbox-web/grid/features/column-virtualization";
|
|
4
2
|
//# sourceMappingURL=column-virtualization.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-virtualization.js","sources":[
|
|
1
|
+
{"version":3,"file":"column-virtualization.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,20 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Context menu feature for @toolbox-web/grid-vue
|
|
3
|
-
*
|
|
4
|
-
* Import this module to enable the `contextMenu` prop on TbwGrid.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```vue
|
|
8
|
-
* <script setup>
|
|
9
|
-
* import '@toolbox-web/grid-vue/features/context-menu';
|
|
10
|
-
* </script>
|
|
11
|
-
*
|
|
12
|
-
* <template>
|
|
13
|
-
* <TbwGrid contextMenu />
|
|
14
|
-
* </template>
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @packageDocumentation
|
|
18
|
-
*/
|
|
19
|
-
export {};
|
|
20
1
|
//# sourceMappingURL=context-menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/context-menu.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG"}
|
|
1
|
+
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/context-menu.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,yCAAyC,CAAC"}
|
package/features/context-menu.js
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { r as t } from "../chunks/feature-registry-BgEOysSJ.js";
|
|
3
|
-
t("contextMenu", (e) => e === !0 ? new r() : new r(e ?? void 0));
|
|
1
|
+
import "@toolbox-web/grid/features/context-menu";
|
|
4
2
|
//# sourceMappingURL=context-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.js","sources":[
|
|
1
|
+
{"version":3,"file":"context-menu.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/features/editing.d.ts
CHANGED
|
@@ -1,20 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Editing feature for @toolbox-web/grid-vue
|
|
3
|
-
*
|
|
4
|
-
* Import this module to enable the `editing` prop on TbwGrid.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```vue
|
|
8
|
-
* <script setup>
|
|
9
|
-
* import '@toolbox-web/grid-vue/features/editing';
|
|
10
|
-
* </script>
|
|
11
|
-
*
|
|
12
|
-
* <template>
|
|
13
|
-
* <TbwGrid editing="dblclick" />
|
|
14
|
-
* </template>
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @packageDocumentation
|
|
18
|
-
*/
|
|
19
|
-
export {};
|
|
20
1
|
//# sourceMappingURL=editing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editing.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/editing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG"}
|
|
1
|
+
{"version":3,"file":"editing.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/editing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,oCAAoC,CAAC"}
|
package/features/editing.js
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { r as t } from "../chunks/feature-registry-BgEOysSJ.js";
|
|
3
|
-
t("editing", (r) => r === !0 ? new e() : r === "click" || r === "dblclick" || r === "manual" ? new e({ editOn: r }) : new e(r ?? void 0));
|
|
1
|
+
import "@toolbox-web/grid/features/editing";
|
|
4
2
|
//# sourceMappingURL=editing.js.map
|
package/features/editing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editing.js","sources":[
|
|
1
|
+
{"version":3,"file":"editing.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/features/export.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/export.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/export.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAAqB,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAK3G,OAAO,mCAAmC,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,WAAW,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IAEzE;;;;OAIG;IACH,aAAa,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IAE3E;;;;OAIG;IACH,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IAE1E;;OAEG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC;IAE3B;;OAEG;IACH,aAAa,EAAE,MAAM;QAAE,MAAM,EAAE,YAAY,CAAC;QAAC,SAAS,EAAE,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;CACvE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,aAAa,IAAI,aAAa,CAwD7C"}
|
package/features/export.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function d() {
|
|
7
|
-
const n = p(u, x(null)), o = () => n.value?.getPlugin(i);
|
|
1
|
+
import { inject as i, ref as x } from "vue";
|
|
2
|
+
import { G as p } from "../chunks/use-grid-B59B6XdD.js";
|
|
3
|
+
import "@toolbox-web/grid/features/export";
|
|
4
|
+
function s() {
|
|
5
|
+
const n = i(p, x(null)), o = () => n.value?.getPluginByName("export");
|
|
8
6
|
return {
|
|
9
|
-
exportToCsv: (
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
7
|
+
exportToCsv: (r, e) => {
|
|
8
|
+
const t = o();
|
|
9
|
+
if (!t) {
|
|
12
10
|
console.warn(
|
|
13
11
|
`[tbw-grid:export] ExportPlugin not found.
|
|
14
12
|
|
|
@@ -17,11 +15,11 @@ function d() {
|
|
|
17
15
|
);
|
|
18
16
|
return;
|
|
19
17
|
}
|
|
20
|
-
|
|
18
|
+
t.exportCsv({ ...e, fileName: r ?? e?.fileName ?? "export.csv" });
|
|
21
19
|
},
|
|
22
|
-
exportToExcel: (
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
20
|
+
exportToExcel: (r, e) => {
|
|
21
|
+
const t = o();
|
|
22
|
+
if (!t) {
|
|
25
23
|
console.warn(
|
|
26
24
|
`[tbw-grid:export] ExportPlugin not found.
|
|
27
25
|
|
|
@@ -30,11 +28,11 @@ function d() {
|
|
|
30
28
|
);
|
|
31
29
|
return;
|
|
32
30
|
}
|
|
33
|
-
|
|
31
|
+
t.exportExcel({ ...e, fileName: r ?? e?.fileName ?? "export.xlsx" });
|
|
34
32
|
},
|
|
35
|
-
exportToJson: (
|
|
36
|
-
const
|
|
37
|
-
if (!
|
|
33
|
+
exportToJson: (r, e) => {
|
|
34
|
+
const t = o();
|
|
35
|
+
if (!t) {
|
|
38
36
|
console.warn(
|
|
39
37
|
`[tbw-grid:export] ExportPlugin not found.
|
|
40
38
|
|
|
@@ -43,13 +41,13 @@ function d() {
|
|
|
43
41
|
);
|
|
44
42
|
return;
|
|
45
43
|
}
|
|
46
|
-
|
|
44
|
+
t.exportJson({ ...e, fileName: r ?? e?.fileName ?? "export.json" });
|
|
47
45
|
},
|
|
48
46
|
isExporting: () => o()?.isExporting() ?? !1,
|
|
49
47
|
getLastExport: () => o()?.getLastExport() ?? null
|
|
50
48
|
};
|
|
51
49
|
}
|
|
52
50
|
export {
|
|
53
|
-
|
|
51
|
+
s as useGridExport
|
|
54
52
|
};
|
|
55
53
|
//# sourceMappingURL=export.js.map
|
package/features/export.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export.js","sources":["../../../../libs/grid-vue/src/features/export.ts"],"sourcesContent":["/**\n * Export feature for @toolbox-web/grid-vue\n *\n * Import this module to enable the `export` prop on TbwGrid.\n * Also exports `useGridExport()` composable for programmatic export control.\n *\n * @example\n * ```vue\n * <script setup>\n * import '@toolbox-web/grid-vue/features/export';\n * </script>\n *\n * <template>\n * <TbwGrid export />\n * </template>\n * ```\n *\n * @example Using the composable\n * ```vue\n * <script setup>\n * import { useGridExport } from '@toolbox-web/grid-vue/features/export';\n *\n * const { exportToCsv, exportToExcel, exportToJson } = useGridExport();\n *\n * function handleExport() {\n * exportToCsv('employees.csv');\n * }\n * </script>\n * ```\n *\n * @packageDocumentation\n */\n\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { ExportPlugin, type ExportFormat, type ExportParams } from '@toolbox-web/grid/plugins/export';\nimport { inject, ref } from 'vue';\nimport {
|
|
1
|
+
{"version":3,"file":"export.js","sources":["../../../../libs/grid-vue/src/features/export.ts"],"sourcesContent":["/**\n * Export feature for @toolbox-web/grid-vue\n *\n * Import this module to enable the `export` prop on TbwGrid.\n * Also exports `useGridExport()` composable for programmatic export control.\n *\n * @example\n * ```vue\n * <script setup>\n * import '@toolbox-web/grid-vue/features/export';\n * </script>\n *\n * <template>\n * <TbwGrid export />\n * </template>\n * ```\n *\n * @example Using the composable\n * ```vue\n * <script setup>\n * import { useGridExport } from '@toolbox-web/grid-vue/features/export';\n *\n * const { exportToCsv, exportToExcel, exportToJson } = useGridExport();\n *\n * function handleExport() {\n * exportToCsv('employees.csv');\n * }\n * </script>\n * ```\n *\n * @packageDocumentation\n */\n\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport { type ExportPlugin, type ExportFormat, type ExportParams } from '@toolbox-web/grid/plugins/export';\nimport { inject, ref } from 'vue';\nimport { GRID_ELEMENT_KEY } from '../lib/use-grid';\n\n// Delegate to core feature registration\nimport '@toolbox-web/grid/features/export';\n\n/**\n * Export methods returned from useGridExport.\n */\nexport interface ExportMethods {\n /**\n * Export grid data to CSV file.\n * @param filename - Optional filename (defaults to 'export.csv')\n * @param params - Optional export parameters\n */\n exportToCsv: (filename?: string, params?: Partial<ExportParams>) => void;\n\n /**\n * Export grid data to Excel file (XML Spreadsheet format).\n * @param filename - Optional filename (defaults to 'export.xlsx')\n * @param params - Optional export parameters\n */\n exportToExcel: (filename?: string, params?: Partial<ExportParams>) => void;\n\n /**\n * Export grid data to JSON file.\n * @param filename - Optional filename (defaults to 'export.json')\n * @param params - Optional export parameters\n */\n exportToJson: (filename?: string, params?: Partial<ExportParams>) => void;\n\n /**\n * Check if an export is currently in progress.\n */\n isExporting: () => boolean;\n\n /**\n * Get information about the last export.\n */\n getLastExport: () => { format: ExportFormat; timestamp: Date } | null;\n}\n\n/**\n * Composable for programmatic export control.\n *\n * Must be used within a component that contains a TbwGrid with the export feature enabled.\n *\n * @example\n * ```vue\n * <script setup>\n * import { useGridExport } from '@toolbox-web/grid-vue/features/export';\n *\n * const { exportToCsv, exportToExcel, isExporting } = useGridExport();\n *\n * async function handleExport(format: 'csv' | 'excel' | 'json') {\n * if (isExporting()) return; // Prevent concurrent exports\n *\n * switch (format) {\n * case 'csv': exportToCsv('data.csv'); break;\n * case 'excel': exportToExcel('data.xlsx'); break;\n * case 'json': exportToJson('data.json'); break;\n * }\n * }\n * </script>\n * ```\n */\nexport function useGridExport(): ExportMethods {\n const gridElement = inject(GRID_ELEMENT_KEY, ref(null));\n\n const getPlugin = (): ExportPlugin | undefined => {\n const grid = gridElement.value as DataGridElement | null;\n return grid?.getPluginByName('export');\n };\n\n return {\n exportToCsv: (filename?: string, params?: Partial<ExportParams>) => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:export] ExportPlugin not found.\\n\\n` +\n ` → Enable export on the grid:\\n` +\n ` <TbwGrid :export=\"true\" />`,\n );\n return;\n }\n plugin.exportCsv({ ...params, fileName: filename ?? params?.fileName ?? 'export.csv' });\n },\n\n exportToExcel: (filename?: string, params?: Partial<ExportParams>) => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:export] ExportPlugin not found.\\n\\n` +\n ` → Enable export on the grid:\\n` +\n ` <TbwGrid :export=\"true\" />`,\n );\n return;\n }\n plugin.exportExcel({ ...params, fileName: filename ?? params?.fileName ?? 'export.xlsx' });\n },\n\n exportToJson: (filename?: string, params?: Partial<ExportParams>) => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:export] ExportPlugin not found.\\n\\n` +\n ` → Enable export on the grid:\\n` +\n ` <TbwGrid :export=\"true\" />`,\n );\n return;\n }\n plugin.exportJson({ ...params, fileName: filename ?? params?.fileName ?? 'export.json' });\n },\n\n isExporting: () => {\n return getPlugin()?.isExporting() ?? false;\n },\n\n getLastExport: () => {\n return getPlugin()?.getLastExport() ?? null;\n },\n };\n}\n"],"names":["useGridExport","gridElement","inject","GRID_ELEMENT_KEY","ref","getPlugin","filename","params","plugin"],"mappings":";;;AAqGO,SAASA,IAA+B;AAC7C,QAAMC,IAAcC,EAAOC,GAAkBC,EAAI,IAAI,CAAC,GAEhDC,IAAY,MACHJ,EAAY,OACZ,gBAAgB,QAAQ;AAGvC,SAAO;AAAA,IACL,aAAa,CAACK,GAAmBC,MAAmC;AAClE,YAAMC,IAASH,EAAA;AACf,UAAI,CAACG,GAAQ;AACX,gBAAQ;AAAA,UACN;AAAA;AAAA;AAAA;AAAA,QAAA;AAIF;AAAA,MACF;AACA,MAAAA,EAAO,UAAU,EAAE,GAAGD,GAAQ,UAAUD,KAAYC,GAAQ,YAAY,cAAc;AAAA,IACxF;AAAA,IAEA,eAAe,CAACD,GAAmBC,MAAmC;AACpE,YAAMC,IAASH,EAAA;AACf,UAAI,CAACG,GAAQ;AACX,gBAAQ;AAAA,UACN;AAAA;AAAA;AAAA;AAAA,QAAA;AAIF;AAAA,MACF;AACA,MAAAA,EAAO,YAAY,EAAE,GAAGD,GAAQ,UAAUD,KAAYC,GAAQ,YAAY,eAAe;AAAA,IAC3F;AAAA,IAEA,cAAc,CAACD,GAAmBC,MAAmC;AACnE,YAAMC,IAASH,EAAA;AACf,UAAI,CAACG,GAAQ;AACX,gBAAQ;AAAA,UACN;AAAA;AAAA;AAAA;AAAA,QAAA;AAIF;AAAA,MACF;AACA,MAAAA,EAAO,WAAW,EAAE,GAAGD,GAAQ,UAAUD,KAAYC,GAAQ,YAAY,eAAe;AAAA,IAC1F;AAAA,IAEA,aAAa,MACJF,EAAA,GAAa,YAAA,KAAiB;AAAA,IAGvC,eAAe,MACNA,EAAA,GAAa,cAAA,KAAmB;AAAA,EACzC;AAEJ;"}
|
package/features/filtering.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { FilteringPlugin as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { G as a } from "../chunks/use-grid-
|
|
5
|
-
|
|
1
|
+
import { FilteringPlugin as o } from "@toolbox-web/grid/plugins/filtering";
|
|
2
|
+
import { inject as u, ref as d, createApp as f } from "vue";
|
|
3
|
+
import { registerFeature as s } from "@toolbox-web/grid/features/registry";
|
|
4
|
+
import { G as a } from "../chunks/use-grid-B59B6XdD.js";
|
|
5
|
+
s("filtering", (r) => {
|
|
6
6
|
if (r === !0)
|
|
7
|
-
return new
|
|
7
|
+
return new o();
|
|
8
8
|
if (!r)
|
|
9
|
-
return new
|
|
10
|
-
const
|
|
11
|
-
if (typeof
|
|
12
|
-
const
|
|
9
|
+
return new o();
|
|
10
|
+
const i = r, e = { ...i };
|
|
11
|
+
if (typeof i.filterPanelRenderer == "function" && i.filterPanelRenderer.length <= 1) {
|
|
12
|
+
const t = i.filterPanelRenderer;
|
|
13
13
|
e.filterPanelRenderer = (n, g) => {
|
|
14
|
-
const
|
|
15
|
-
|
|
14
|
+
const l = document.createElement("div");
|
|
15
|
+
l.style.display = "contents", f({
|
|
16
16
|
render() {
|
|
17
|
-
return
|
|
17
|
+
return t(g);
|
|
18
18
|
}
|
|
19
|
-
}).mount(
|
|
19
|
+
}).mount(l), n.appendChild(l);
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
return new
|
|
22
|
+
return new o(e);
|
|
23
23
|
});
|
|
24
|
-
function
|
|
25
|
-
const r =
|
|
24
|
+
function b() {
|
|
25
|
+
const r = u(a, d(null)), i = () => r.value?.getPluginByName("filtering");
|
|
26
26
|
return {
|
|
27
|
-
setFilter: (e,
|
|
28
|
-
const n =
|
|
27
|
+
setFilter: (e, t) => {
|
|
28
|
+
const n = i();
|
|
29
29
|
if (!n) {
|
|
30
30
|
console.warn(
|
|
31
31
|
`[tbw-grid:filtering] FilteringPlugin not found.
|
|
@@ -35,13 +35,13 @@ function m() {
|
|
|
35
35
|
);
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
|
-
n.setFilter(e,
|
|
38
|
+
n.setFilter(e, t);
|
|
39
39
|
},
|
|
40
|
-
getFilter: (e) =>
|
|
41
|
-
getFilters: () =>
|
|
40
|
+
getFilter: (e) => i()?.getFilter(e),
|
|
41
|
+
getFilters: () => i()?.getFilters() ?? [],
|
|
42
42
|
setFilterModel: (e) => {
|
|
43
|
-
const
|
|
44
|
-
if (!
|
|
43
|
+
const t = i();
|
|
44
|
+
if (!t) {
|
|
45
45
|
console.warn(
|
|
46
46
|
`[tbw-grid:filtering] FilteringPlugin not found.
|
|
47
47
|
|
|
@@ -50,10 +50,10 @@ function m() {
|
|
|
50
50
|
);
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
t.setFilterModel(e);
|
|
54
54
|
},
|
|
55
55
|
clearAllFilters: () => {
|
|
56
|
-
const e =
|
|
56
|
+
const e = i();
|
|
57
57
|
if (!e) {
|
|
58
58
|
console.warn(
|
|
59
59
|
`[tbw-grid:filtering] FilteringPlugin not found.
|
|
@@ -66,8 +66,8 @@ function m() {
|
|
|
66
66
|
e.clearAllFilters();
|
|
67
67
|
},
|
|
68
68
|
clearFieldFilter: (e) => {
|
|
69
|
-
const
|
|
70
|
-
if (!
|
|
69
|
+
const t = i();
|
|
70
|
+
if (!t) {
|
|
71
71
|
console.warn(
|
|
72
72
|
`[tbw-grid:filtering] FilteringPlugin not found.
|
|
73
73
|
|
|
@@ -76,14 +76,14 @@ function m() {
|
|
|
76
76
|
);
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
t.clearFieldFilter(e);
|
|
80
80
|
},
|
|
81
|
-
isFieldFiltered: (e) =>
|
|
82
|
-
getFilteredRowCount: () =>
|
|
83
|
-
getUniqueValues: (e) =>
|
|
81
|
+
isFieldFiltered: (e) => i()?.isFieldFiltered(e) ?? !1,
|
|
82
|
+
getFilteredRowCount: () => i()?.getFilteredRowCount() ?? 0,
|
|
83
|
+
getUniqueValues: (e) => i()?.getUniqueValues(e) ?? []
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
export {
|
|
87
|
-
|
|
87
|
+
b as useGridFiltering
|
|
88
88
|
};
|
|
89
89
|
//# sourceMappingURL=filtering.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filtering.js","sources":["../../../../libs/grid-vue/src/features/filtering.ts"],"sourcesContent":["/**\n * Filtering feature for @toolbox-web/grid-vue\n *\n * Import this module to enable the `filtering` prop on TbwGrid.\n * Also exports `useGridFiltering()` composable for programmatic filter control.\n *\n * @example\n * ```vue\n * <script setup>\n * import '@toolbox-web/grid-vue/features/filtering';\n * </script>\n *\n * <template>\n * <TbwGrid filtering />\n * </template>\n * ```\n *\n * @example Using the composable\n * ```vue\n * <script setup>\n * import { useGridFiltering } from '@toolbox-web/grid-vue/features/filtering';\n *\n * const { setFilter, clearAllFilters, getFilteredRowCount } = useGridFiltering();\n *\n * function filterByStatus(status: string) {\n * setFilter('status', { operator: 'equals', value: status });\n * }\n * </script>\n * ```\n *\n * @packageDocumentation\n */\n\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport {\n FilteringPlugin,\n type FilterConfig,\n type FilterModel,\n type FilterPanelParams,\n} from '@toolbox-web/grid/plugins/filtering';\nimport { createApp, inject, ref, type VNode } from 'vue';\nimport { registerFeature } from '../lib/feature-registry';\nimport { GRID_ELEMENT_KEY } from '../lib/use-grid';\n\nregisterFeature('filtering', (rawConfig) => {\n if (rawConfig === true) {\n return new FilteringPlugin();\n }\n if (!rawConfig) {\n return new FilteringPlugin();\n }\n\n const config = rawConfig as FilterConfig & { filterPanelRenderer?: unknown };\n const options = { ...config } as FilterConfig;\n\n // Bridge Vue filterPanelRenderer (1 arg: params → VNode) to vanilla (2 args: container, params)\n if (typeof config.filterPanelRenderer === 'function' && config.filterPanelRenderer.length <= 1) {\n const vueFn = config.filterPanelRenderer as unknown as (params: FilterPanelParams) => VNode;\n options.filterPanelRenderer = (container: HTMLElement, params: FilterPanelParams) => {\n const wrapper = document.createElement('div');\n wrapper.style.display = 'contents';\n\n const app = createApp({\n render() {\n return vueFn(params);\n },\n });\n\n app.mount(wrapper);\n container.appendChild(wrapper);\n };\n }\n\n return new FilteringPlugin(options);\n});\n\n/**\n * Filtering methods returned from useGridFiltering.\n */\nexport interface FilteringMethods {\n /**\n * Set a filter on a specific field.\n * @param field - The field name to filter\n * @param filter - Filter configuration, or null to remove\n */\n setFilter: (field: string, filter: Omit<FilterModel, 'field'> | null) => void;\n\n /**\n * Get the current filter for a field.\n */\n getFilter: (field: string) => FilterModel | undefined;\n\n /**\n * Get all active filters.\n */\n getFilters: () => FilterModel[];\n\n /**\n * Set all filters at once (replaces existing).\n */\n setFilterModel: (filters: FilterModel[]) => void;\n\n /**\n * Clear all active filters.\n */\n clearAllFilters: () => void;\n\n /**\n * Clear filter for a specific field.\n */\n clearFieldFilter: (field: string) => void;\n\n /**\n * Check if a field has an active filter.\n */\n isFieldFiltered: (field: string) => boolean;\n\n /**\n * Get the count of rows after filtering.\n */\n getFilteredRowCount: () => number;\n\n /**\n * Get unique values for a field (for building filter dropdowns).\n */\n getUniqueValues: (field: string) => unknown[];\n}\n\n/**\n * Composable for programmatic filter control.\n *\n * Must be used within a component that contains a TbwGrid with filtering enabled.\n *\n * @example\n * ```vue\n * <script setup>\n * import { useGridFiltering } from '@toolbox-web/grid-vue/features/filtering';\n *\n * const { setFilter, clearAllFilters, getFilteredRowCount, isFieldFiltered } = useGridFiltering();\n *\n * function applyQuickFilter(field: string, value: string) {\n * setFilter(field, { operator: 'contains', value });\n * }\n * </script>\n *\n * <template>\n * <input @input=\"applyQuickFilter('name', $event.target.value)\" placeholder=\"Filter by name...\" />\n * <span>{{ getFilteredRowCount() }} results</span>\n * <button @click=\"clearAllFilters\">Clear Filters</button>\n * </template>\n * ```\n */\nexport function useGridFiltering(): FilteringMethods {\n const gridElement = inject(GRID_ELEMENT_KEY, ref(null));\n\n const getPlugin = (): FilteringPlugin | undefined => {\n const grid = gridElement.value as DataGridElement | null;\n return grid?.
|
|
1
|
+
{"version":3,"file":"filtering.js","sources":["../../../../libs/grid-vue/src/features/filtering.ts"],"sourcesContent":["/**\n * Filtering feature for @toolbox-web/grid-vue\n *\n * Import this module to enable the `filtering` prop on TbwGrid.\n * Also exports `useGridFiltering()` composable for programmatic filter control.\n *\n * @example\n * ```vue\n * <script setup>\n * import '@toolbox-web/grid-vue/features/filtering';\n * </script>\n *\n * <template>\n * <TbwGrid filtering />\n * </template>\n * ```\n *\n * @example Using the composable\n * ```vue\n * <script setup>\n * import { useGridFiltering } from '@toolbox-web/grid-vue/features/filtering';\n *\n * const { setFilter, clearAllFilters, getFilteredRowCount } = useGridFiltering();\n *\n * function filterByStatus(status: string) {\n * setFilter('status', { operator: 'equals', value: status });\n * }\n * </script>\n * ```\n *\n * @packageDocumentation\n */\n\nimport type { DataGridElement } from '@toolbox-web/grid';\nimport {\n FilteringPlugin,\n type FilterConfig,\n type FilterModel,\n type FilterPanelParams,\n} from '@toolbox-web/grid/plugins/filtering';\nimport { createApp, inject, ref, type VNode } from 'vue';\nimport { registerFeature } from '../lib/feature-registry';\nimport { GRID_ELEMENT_KEY } from '../lib/use-grid';\n\nregisterFeature('filtering', (rawConfig) => {\n if (rawConfig === true) {\n return new FilteringPlugin();\n }\n if (!rawConfig) {\n return new FilteringPlugin();\n }\n\n const config = rawConfig as FilterConfig & { filterPanelRenderer?: unknown };\n const options = { ...config } as FilterConfig;\n\n // Bridge Vue filterPanelRenderer (1 arg: params → VNode) to vanilla (2 args: container, params)\n if (typeof config.filterPanelRenderer === 'function' && config.filterPanelRenderer.length <= 1) {\n const vueFn = config.filterPanelRenderer as unknown as (params: FilterPanelParams) => VNode;\n options.filterPanelRenderer = (container: HTMLElement, params: FilterPanelParams) => {\n const wrapper = document.createElement('div');\n wrapper.style.display = 'contents';\n\n const app = createApp({\n render() {\n return vueFn(params);\n },\n });\n\n app.mount(wrapper);\n container.appendChild(wrapper);\n };\n }\n\n return new FilteringPlugin(options);\n});\n\n/**\n * Filtering methods returned from useGridFiltering.\n */\nexport interface FilteringMethods {\n /**\n * Set a filter on a specific field.\n * @param field - The field name to filter\n * @param filter - Filter configuration, or null to remove\n */\n setFilter: (field: string, filter: Omit<FilterModel, 'field'> | null) => void;\n\n /**\n * Get the current filter for a field.\n */\n getFilter: (field: string) => FilterModel | undefined;\n\n /**\n * Get all active filters.\n */\n getFilters: () => FilterModel[];\n\n /**\n * Set all filters at once (replaces existing).\n */\n setFilterModel: (filters: FilterModel[]) => void;\n\n /**\n * Clear all active filters.\n */\n clearAllFilters: () => void;\n\n /**\n * Clear filter for a specific field.\n */\n clearFieldFilter: (field: string) => void;\n\n /**\n * Check if a field has an active filter.\n */\n isFieldFiltered: (field: string) => boolean;\n\n /**\n * Get the count of rows after filtering.\n */\n getFilteredRowCount: () => number;\n\n /**\n * Get unique values for a field (for building filter dropdowns).\n */\n getUniqueValues: (field: string) => unknown[];\n}\n\n/**\n * Composable for programmatic filter control.\n *\n * Must be used within a component that contains a TbwGrid with filtering enabled.\n *\n * @example\n * ```vue\n * <script setup>\n * import { useGridFiltering } from '@toolbox-web/grid-vue/features/filtering';\n *\n * const { setFilter, clearAllFilters, getFilteredRowCount, isFieldFiltered } = useGridFiltering();\n *\n * function applyQuickFilter(field: string, value: string) {\n * setFilter(field, { operator: 'contains', value });\n * }\n * </script>\n *\n * <template>\n * <input @input=\"applyQuickFilter('name', $event.target.value)\" placeholder=\"Filter by name...\" />\n * <span>{{ getFilteredRowCount() }} results</span>\n * <button @click=\"clearAllFilters\">Clear Filters</button>\n * </template>\n * ```\n */\nexport function useGridFiltering(): FilteringMethods {\n const gridElement = inject(GRID_ELEMENT_KEY, ref(null));\n\n const getPlugin = (): FilteringPlugin | undefined => {\n const grid = gridElement.value as DataGridElement | null;\n return grid?.getPluginByName('filtering');\n };\n\n return {\n setFilter: (field: string, filter: Omit<FilterModel, 'field'> | null) => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:filtering] FilteringPlugin not found.\\n\\n` +\n ` → Enable filtering on the grid:\\n` +\n ` <TbwGrid filtering />`,\n );\n return;\n }\n plugin.setFilter(field, filter);\n },\n\n getFilter: (field: string) => getPlugin()?.getFilter(field),\n\n getFilters: () => getPlugin()?.getFilters() ?? [],\n\n setFilterModel: (filters: FilterModel[]) => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:filtering] FilteringPlugin not found.\\n\\n` +\n ` → Enable filtering on the grid:\\n` +\n ` <TbwGrid filtering />`,\n );\n return;\n }\n plugin.setFilterModel(filters);\n },\n\n clearAllFilters: () => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:filtering] FilteringPlugin not found.\\n\\n` +\n ` → Enable filtering on the grid:\\n` +\n ` <TbwGrid filtering />`,\n );\n return;\n }\n plugin.clearAllFilters();\n },\n\n clearFieldFilter: (field: string) => {\n const plugin = getPlugin();\n if (!plugin) {\n console.warn(\n `[tbw-grid:filtering] FilteringPlugin not found.\\n\\n` +\n ` → Enable filtering on the grid:\\n` +\n ` <TbwGrid filtering />`,\n );\n return;\n }\n plugin.clearFieldFilter(field);\n },\n\n isFieldFiltered: (field: string) => getPlugin()?.isFieldFiltered(field) ?? false,\n\n getFilteredRowCount: () => getPlugin()?.getFilteredRowCount() ?? 0,\n\n getUniqueValues: (field: string) => getPlugin()?.getUniqueValues(field) ?? [],\n };\n}\n"],"names":["registerFeature","rawConfig","FilteringPlugin","config","options","vueFn","container","params","wrapper","createApp","useGridFiltering","gridElement","inject","GRID_ELEMENT_KEY","ref","getPlugin","field","filter","plugin","filters"],"mappings":";;;;AA4CAA,EAAgB,aAAa,CAACC,MAAc;AAC1C,MAAIA,MAAc;AAChB,WAAO,IAAIC,EAAA;AAEb,MAAI,CAACD;AACH,WAAO,IAAIC,EAAA;AAGb,QAAMC,IAASF,GACTG,IAAU,EAAE,GAAGD,EAAA;AAGrB,MAAI,OAAOA,EAAO,uBAAwB,cAAcA,EAAO,oBAAoB,UAAU,GAAG;AAC9F,UAAME,IAAQF,EAAO;AACrB,IAAAC,EAAQ,sBAAsB,CAACE,GAAwBC,MAA8B;AACnF,YAAMC,IAAU,SAAS,cAAc,KAAK;AAC5C,MAAAA,EAAQ,MAAM,UAAU,YAEZC,EAAU;AAAA,QACpB,SAAS;AACP,iBAAOJ,EAAME,CAAM;AAAA,QACrB;AAAA,MAAA,CACD,EAEG,MAAMC,CAAO,GACjBF,EAAU,YAAYE,CAAO;AAAA,IAC/B;AAAA,EACF;AAEA,SAAO,IAAIN,EAAgBE,CAAO;AACpC,CAAC;AA8EM,SAASM,IAAqC;AACnD,QAAMC,IAAcC,EAAOC,GAAkBC,EAAI,IAAI,CAAC,GAEhDC,IAAY,MACHJ,EAAY,OACZ,gBAAgB,WAAW;AAG1C,SAAO;AAAA,IACL,WAAW,CAACK,GAAeC,MAA8C;AACvE,YAAMC,IAASH,EAAA;AACf,UAAI,CAACG,GAAQ;AACX,gBAAQ;AAAA,UACN;AAAA;AAAA;AAAA;AAAA,QAAA;AAIF;AAAA,MACF;AACA,MAAAA,EAAO,UAAUF,GAAOC,CAAM;AAAA,IAChC;AAAA,IAEA,WAAW,CAACD,MAAkBD,EAAA,GAAa,UAAUC,CAAK;AAAA,IAE1D,YAAY,MAAMD,KAAa,WAAA,KAAgB,CAAA;AAAA,IAE/C,gBAAgB,CAACI,MAA2B;AAC1C,YAAMD,IAASH,EAAA;AACf,UAAI,CAACG,GAAQ;AACX,gBAAQ;AAAA,UACN;AAAA;AAAA;AAAA;AAAA,QAAA;AAIF;AAAA,MACF;AACA,MAAAA,EAAO,eAAeC,CAAO;AAAA,IAC/B;AAAA,IAEA,iBAAiB,MAAM;AACrB,YAAMD,IAASH,EAAA;AACf,UAAI,CAACG,GAAQ;AACX,gBAAQ;AAAA,UACN;AAAA;AAAA;AAAA;AAAA,QAAA;AAIF;AAAA,MACF;AACA,MAAAA,EAAO,gBAAA;AAAA,IACT;AAAA,IAEA,kBAAkB,CAACF,MAAkB;AACnC,YAAME,IAASH,EAAA;AACf,UAAI,CAACG,GAAQ;AACX,gBAAQ;AAAA,UACN;AAAA;AAAA;AAAA;AAAA,QAAA;AAIF;AAAA,MACF;AACA,MAAAA,EAAO,iBAAiBF,CAAK;AAAA,IAC/B;AAAA,IAEA,iBAAiB,CAACA,MAAkBD,KAAa,gBAAgBC,CAAK,KAAK;AAAA,IAE3E,qBAAqB,MAAMD,KAAa,yBAAyB;AAAA,IAEjE,iBAAiB,CAACC,MAAkBD,EAAA,GAAa,gBAAgBC,CAAK,KAAK,CAAA;AAAA,EAAC;AAEhF;"}
|
|
@@ -1,24 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Column grouping feature for @toolbox-web/grid-vue
|
|
3
|
-
*
|
|
4
|
-
* Import this module to enable the `groupingColumns` prop on TbwGrid.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```vue
|
|
8
|
-
* <script setup>
|
|
9
|
-
* import '@toolbox-web/grid-vue/features/grouping-columns';
|
|
10
|
-
* </script>
|
|
11
|
-
*
|
|
12
|
-
* <template>
|
|
13
|
-
* <TbwGrid :groupingColumns="{
|
|
14
|
-
* columnGroups: [
|
|
15
|
-
* { header: 'Personal Info', children: ['firstName', 'lastName'] },
|
|
16
|
-
* ],
|
|
17
|
-
* }" />
|
|
18
|
-
* </template>
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* @packageDocumentation
|
|
22
|
-
*/
|
|
23
|
-
export {};
|
|
24
1
|
//# sourceMappingURL=grouping-columns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grouping-columns.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/grouping-columns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG"}
|
|
1
|
+
{"version":3,"file":"grouping-columns.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/grouping-columns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,6CAA6C,CAAC"}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { r as u } from "../chunks/feature-registry-BgEOysSJ.js";
|
|
3
|
-
u("groupingColumns", (r) => r === !0 ? new e() : new e(r ?? void 0));
|
|
1
|
+
import "@toolbox-web/grid/features/grouping-columns";
|
|
4
2
|
//# sourceMappingURL=grouping-columns.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grouping-columns.js","sources":[
|
|
1
|
+
{"version":3,"file":"grouping-columns.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Row grouping feature for @toolbox-web/grid-vue
|
|
3
|
-
*
|
|
4
|
-
* Import this module to enable the `groupingRows` prop on TbwGrid.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```vue
|
|
8
|
-
* <script setup>
|
|
9
|
-
* import '@toolbox-web/grid-vue/features/grouping-rows';
|
|
10
|
-
* </script>
|
|
11
|
-
*
|
|
12
|
-
* <template>
|
|
13
|
-
* <TbwGrid :groupingRows="{
|
|
14
|
-
* groupBy: ['department', 'team'],
|
|
15
|
-
* defaultExpanded: true,
|
|
16
|
-
* }" />
|
|
17
|
-
* </template>
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @packageDocumentation
|
|
21
|
-
*/
|
|
22
|
-
export {};
|
|
23
1
|
//# sourceMappingURL=grouping-rows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grouping-rows.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/grouping-rows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG"}
|
|
1
|
+
{"version":3,"file":"grouping-rows.d.ts","sourceRoot":"","sources":["../../../../libs/grid-vue/src/features/grouping-rows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,0CAA0C,CAAC"}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { r as i } from "../chunks/feature-registry-BgEOysSJ.js";
|
|
3
|
-
i("groupingRows", (r) => new o(r ?? void 0));
|
|
1
|
+
import "@toolbox-web/grid/features/grouping-rows";
|
|
4
2
|
//# sourceMappingURL=grouping-rows.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grouping-rows.js","sources":[
|
|
1
|
+
{"version":3,"file":"grouping-rows.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/features/index.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
1
|
+
import "@toolbox-web/grid/features/clipboard";
|
|
2
|
+
import "@toolbox-web/grid/features/column-virtualization";
|
|
3
|
+
import "@toolbox-web/grid/features/context-menu";
|
|
4
|
+
import "@toolbox-web/grid/features/editing";
|
|
5
|
+
import "vue";
|
|
6
|
+
import "@toolbox-web/grid/features/export";
|
|
6
7
|
import "./filtering.js";
|
|
7
|
-
import "
|
|
8
|
-
import "
|
|
9
|
-
import "
|
|
10
|
-
import "
|
|
11
|
-
import "
|
|
12
|
-
import "
|
|
13
|
-
import "
|
|
14
|
-
import "
|
|
15
|
-
import "
|
|
16
|
-
import "
|
|
17
|
-
import "
|
|
18
|
-
import "
|
|
19
|
-
import "
|
|
20
|
-
import "
|
|
21
|
-
import "./undo-redo.js";
|
|
22
|
-
import "./visibility.js";
|
|
8
|
+
import "@toolbox-web/grid/features/grouping-columns";
|
|
9
|
+
import "@toolbox-web/grid/features/grouping-rows";
|
|
10
|
+
import "@toolbox-web/grid/features/master-detail";
|
|
11
|
+
import "@toolbox-web/grid/features/multi-sort";
|
|
12
|
+
import "@toolbox-web/grid/features/pinned-columns";
|
|
13
|
+
import "@toolbox-web/grid/features/pinned-rows";
|
|
14
|
+
import "@toolbox-web/grid/features/pivot";
|
|
15
|
+
import "@toolbox-web/grid/features/print";
|
|
16
|
+
import "@toolbox-web/grid/features/responsive";
|
|
17
|
+
import "@toolbox-web/grid/features/selection";
|
|
18
|
+
import "@toolbox-web/grid/features/server-side";
|
|
19
|
+
import "@toolbox-web/grid/features/tree";
|
|
20
|
+
import "@toolbox-web/grid/features/undo-redo";
|
|
21
|
+
import "@toolbox-web/grid/features/visibility";
|
|
23
22
|
//# sourceMappingURL=index.js.map
|
package/features/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|