@adapttable/naive-ui 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +14 -0
  2. package/dist/assistant-Cv8df2ti.js +355 -0
  3. package/dist/assistant-Cv8df2ti.js.map +1 -0
  4. package/dist/assistant-D6mc-LJl.cjs +378 -0
  5. package/dist/assistant-D6mc-LJl.cjs.map +1 -0
  6. package/dist/assistant.cjs +5 -354
  7. package/dist/assistant.d.cts.map +1 -1
  8. package/dist/assistant.d.ts.map +1 -1
  9. package/dist/assistant.js +1 -350
  10. package/dist/column-menu-DdWVP1hz.d.cts +23 -0
  11. package/dist/column-menu-DdWVP1hz.d.cts.map +1 -0
  12. package/dist/column-menu-DdWVP1hz.d.ts +23 -0
  13. package/dist/column-menu-DdWVP1hz.d.ts.map +1 -0
  14. package/dist/column-menu.d.cts +2 -23
  15. package/dist/column-menu.d.ts +2 -23
  16. package/dist/command-palette-vIegnqVo.js +112 -0
  17. package/dist/command-palette-vIegnqVo.js.map +1 -0
  18. package/dist/command-palette-ztI3qI2V.cjs +117 -0
  19. package/dist/command-palette-ztI3qI2V.cjs.map +1 -0
  20. package/dist/command-palette.cjs +2 -112
  21. package/dist/command-palette.js +1 -111
  22. package/dist/context-menu-BbhrjTZr.cjs +145 -0
  23. package/dist/context-menu-BbhrjTZr.cjs.map +1 -0
  24. package/dist/context-menu-DjYIQXhY.js +140 -0
  25. package/dist/context-menu-DjYIQXhY.js.map +1 -0
  26. package/dist/context-menu.cjs +2 -140
  27. package/dist/context-menu.js +1 -139
  28. package/dist/features.cjs +217 -0
  29. package/dist/features.d.cts +40 -0
  30. package/dist/features.d.ts +40 -0
  31. package/dist/features.js +36 -0
  32. package/dist/filters-BJ48GzqJ.d.ts +66 -0
  33. package/dist/filters-BJ48GzqJ.d.ts.map +1 -0
  34. package/dist/filters-C6DvAZ_T.d.cts +66 -0
  35. package/dist/filters-C6DvAZ_T.d.cts.map +1 -0
  36. package/dist/filters.d.cts +2 -66
  37. package/dist/filters.d.ts +2 -66
  38. package/dist/grouping-panel-BPaPG49S.cjs +151 -0
  39. package/dist/grouping-panel-BPaPG49S.cjs.map +1 -0
  40. package/dist/grouping-panel-CYUPSa0u.js +146 -0
  41. package/dist/grouping-panel-CYUPSa0u.js.map +1 -0
  42. package/dist/grouping-panel.cjs +3 -146
  43. package/dist/grouping-panel.js +2 -145
  44. package/dist/header-filters-CQg6clum.d.cts +52 -0
  45. package/dist/header-filters-CQg6clum.d.cts.map +1 -0
  46. package/dist/header-filters-CQg6clum.d.ts +52 -0
  47. package/dist/header-filters-CQg6clum.d.ts.map +1 -0
  48. package/dist/header-filters.d.cts +2 -52
  49. package/dist/header-filters.d.ts +2 -52
  50. package/dist/index.cjs +1 -1
  51. package/dist/index.js +1 -1
  52. package/dist/{mobile-Bc3-31-b.cjs → mobile-C2JUs6b_.cjs} +3 -2
  53. package/dist/mobile-C2JUs6b_.cjs.map +1 -0
  54. package/dist/{mobile-Dlwq8dB7.js → mobile-CC3NeIRK.js} +4 -3
  55. package/dist/mobile-CC3NeIRK.js.map +1 -0
  56. package/dist/preset.cjs +5 -5
  57. package/dist/preset.js +5 -5
  58. package/dist/renderers.cjs +1 -1
  59. package/dist/renderers.d.cts.map +1 -1
  60. package/dist/renderers.d.ts.map +1 -1
  61. package/dist/renderers.js +1 -1
  62. package/dist/row-reorder-BNYYEL8w.js +186 -0
  63. package/dist/row-reorder-BNYYEL8w.js.map +1 -0
  64. package/dist/row-reorder-BRySq2FF.cjs +191 -0
  65. package/dist/row-reorder-BRySq2FF.cjs.map +1 -0
  66. package/dist/row-reorder.cjs +2 -185
  67. package/dist/row-reorder.js +1 -185
  68. package/dist/side-panel-Bf4zBlYZ.cjs +64 -0
  69. package/dist/side-panel-Bf4zBlYZ.cjs.map +1 -0
  70. package/dist/side-panel-CLTgXUnb.js +59 -0
  71. package/dist/side-panel-CLTgXUnb.js.map +1 -0
  72. package/dist/side-panel.cjs +2 -59
  73. package/dist/side-panel.js +1 -58
  74. package/dist/styles.css +39 -39
  75. package/package.json +14 -3
  76. package/dist/assistant.cjs.map +0 -1
  77. package/dist/assistant.js.map +0 -1
  78. package/dist/column-menu.d.cts.map +0 -1
  79. package/dist/column-menu.d.ts.map +0 -1
  80. package/dist/command-palette.cjs.map +0 -1
  81. package/dist/command-palette.js.map +0 -1
  82. package/dist/context-menu.cjs.map +0 -1
  83. package/dist/context-menu.js.map +0 -1
  84. package/dist/filters.d.cts.map +0 -1
  85. package/dist/filters.d.ts.map +0 -1
  86. package/dist/grouping-panel.cjs.map +0 -1
  87. package/dist/grouping-panel.js.map +0 -1
  88. package/dist/header-filters.d.cts.map +0 -1
  89. package/dist/header-filters.d.ts.map +0 -1
  90. package/dist/mobile-Bc3-31-b.cjs.map +0 -1
  91. package/dist/mobile-Dlwq8dB7.js.map +0 -1
  92. package/dist/row-reorder.cjs.map +0 -1
  93. package/dist/row-reorder.js.map +0 -1
  94. package/dist/side-panel.cjs.map +0 -1
  95. package/dist/side-panel.js.map +0 -1
@@ -0,0 +1,66 @@
1
+ import { FilterDef, FilterDef as FilterDef$1, FilterOption, FilterTypeSpec, TableFeature } from "@adapttable/vue";
2
+ import { ChecklistFilterProps, ChecklistFilterProps as ChecklistFilterProps$1, FilterFieldOptions, FilterTreeBuilderProps, FilterTreeBuilderProps as FilterTreeBuilderProps$1 } from "@adapttable/vue/adapter";
3
+ import { FiltersOptions, FiltersOptions as FiltersOptions$1, filterTypes } from "@adapttable/vue/features";
4
+ //#region src/filters/NaiveChecklistFilter.vue.d.ts
5
+ declare const __VLS_export$2: <TRow>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$2<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6
+ props: import("vue").PublicProps & __VLS_PrettifyLocal$2<{
7
+ readonly def: ChecklistFilterProps<TRow>["def"];
8
+ readonly source: ChecklistFilterProps<TRow>["source"];
9
+ readonly labels?: NonNullable<ChecklistFilterProps<TRow>["labels"]>;
10
+ readonly classNames?: NonNullable<ChecklistFilterProps<TRow>["classNames"]>;
11
+ }> & (typeof globalThis extends {
12
+ __VLS_PROPS_FALLBACK: infer P;
13
+ } ? P : {});
14
+ expose: (exposed: {}) => void;
15
+ attrs: any;
16
+ slots: {};
17
+ emit: {};
18
+ }>) => import("vue").VNode & {
19
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
20
+ };
21
+ declare const _default$2: typeof __VLS_export$2;
22
+ type __VLS_PrettifyLocal$2<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
23
+ //#endregion
24
+ //#region src/filters/NaiveFilterField.vue.d.ts
25
+ declare const __VLS_export$1: <TRow>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$1<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
26
+ props: import("vue").PublicProps & __VLS_PrettifyLocal$1<FilterFieldOptions<TRow>> & (typeof globalThis extends {
27
+ __VLS_PROPS_FALLBACK: infer P;
28
+ } ? P : {});
29
+ expose: (exposed: {}) => void;
30
+ attrs: any;
31
+ slots: {};
32
+ emit: {};
33
+ }>) => import("vue").VNode & {
34
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
35
+ };
36
+ declare const _default$1: typeof __VLS_export$1;
37
+ type __VLS_PrettifyLocal$1<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
38
+ //#endregion
39
+ //#region src/filters/NaiveFilterTree.vue.d.ts
40
+ declare const __VLS_export: <TRow>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
41
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<{
42
+ readonly defs: FilterTreeBuilderProps<TRow>["defs"];
43
+ readonly source: FilterTreeBuilderProps<TRow>["source"];
44
+ readonly labels?: NonNullable<FilterTreeBuilderProps<TRow>["labels"]>;
45
+ readonly classNames?: NonNullable<FilterTreeBuilderProps<TRow>["classNames"]>;
46
+ readonly registry?: NonNullable<FilterTreeBuilderProps<TRow>["registry"]>;
47
+ readonly defaultExpanded?: boolean;
48
+ }> & (typeof globalThis extends {
49
+ __VLS_PROPS_FALLBACK: infer P;
50
+ } ? P : {});
51
+ expose: (exposed: {}) => void;
52
+ attrs: any;
53
+ slots: {};
54
+ emit: {};
55
+ }>) => import("vue").VNode & {
56
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
57
+ };
58
+ declare const _default: typeof __VLS_export;
59
+ type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
60
+ //#endregion
61
+ //#region src/filters.d.ts
62
+ /** Naive fields and vendor overlays over the binding's filter state. */
63
+ declare function filters$1<TRow>(defs?: readonly FilterDef<TRow>[], options?: FiltersOptions): TableFeature<TRow>;
64
+ //#endregion
65
+ export { FilterTypeSpec as a, filters$1 as c, _default$2 as d, FilterTreeBuilderProps$1 as i, _default as l, FilterDef$1 as n, FiltersOptions$1 as o, FilterOption as r, filterTypes as s, ChecklistFilterProps$1 as t, _default$1 as u };
66
+ //# sourceMappingURL=filters-BJ48GzqJ.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters-BJ48GzqJ.d.ts","names":[],"sources":["../src/filters/NaiveChecklistFilter.vue","../src/filters/NaiveFilterField.vue","../src/filters/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W,WAAW,KAAK,IAAI,EAAE;;;;iBCpOpF,UAAQ,MACtB,gBAAe,UAAU,SACzB,UAAS,iBACR,aAAa"}
@@ -0,0 +1,66 @@
1
+ import { FilterDef, FilterDef as FilterDef$1, FilterOption, FilterTypeSpec, TableFeature } from "@adapttable/vue";
2
+ import { ChecklistFilterProps, ChecklistFilterProps as ChecklistFilterProps$1, FilterFieldOptions, FilterTreeBuilderProps, FilterTreeBuilderProps as FilterTreeBuilderProps$1 } from "@adapttable/vue/adapter";
3
+ import { FiltersOptions, FiltersOptions as FiltersOptions$1, filterTypes } from "@adapttable/vue/features";
4
+ //#region src/filters/NaiveChecklistFilter.vue.d.ts
5
+ declare const __VLS_export$2: <TRow>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$2<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6
+ props: import("vue").PublicProps & __VLS_PrettifyLocal$2<{
7
+ readonly def: ChecklistFilterProps<TRow>["def"];
8
+ readonly source: ChecklistFilterProps<TRow>["source"];
9
+ readonly labels?: NonNullable<ChecklistFilterProps<TRow>["labels"]>;
10
+ readonly classNames?: NonNullable<ChecklistFilterProps<TRow>["classNames"]>;
11
+ }> & (typeof globalThis extends {
12
+ __VLS_PROPS_FALLBACK: infer P;
13
+ } ? P : {});
14
+ expose: (exposed: {}) => void;
15
+ attrs: any;
16
+ slots: {};
17
+ emit: {};
18
+ }>) => import("vue").VNode & {
19
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
20
+ };
21
+ declare const _default$2: typeof __VLS_export$2;
22
+ type __VLS_PrettifyLocal$2<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
23
+ //#endregion
24
+ //#region src/filters/NaiveFilterField.vue.d.ts
25
+ declare const __VLS_export$1: <TRow>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$1<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
26
+ props: import("vue").PublicProps & __VLS_PrettifyLocal$1<FilterFieldOptions<TRow>> & (typeof globalThis extends {
27
+ __VLS_PROPS_FALLBACK: infer P;
28
+ } ? P : {});
29
+ expose: (exposed: {}) => void;
30
+ attrs: any;
31
+ slots: {};
32
+ emit: {};
33
+ }>) => import("vue").VNode & {
34
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
35
+ };
36
+ declare const _default$1: typeof __VLS_export$1;
37
+ type __VLS_PrettifyLocal$1<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
38
+ //#endregion
39
+ //#region src/filters/NaiveFilterTree.vue.d.ts
40
+ declare const __VLS_export: <TRow>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
41
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<{
42
+ readonly defs: FilterTreeBuilderProps<TRow>["defs"];
43
+ readonly source: FilterTreeBuilderProps<TRow>["source"];
44
+ readonly labels?: NonNullable<FilterTreeBuilderProps<TRow>["labels"]>;
45
+ readonly classNames?: NonNullable<FilterTreeBuilderProps<TRow>["classNames"]>;
46
+ readonly registry?: NonNullable<FilterTreeBuilderProps<TRow>["registry"]>;
47
+ readonly defaultExpanded?: boolean;
48
+ }> & (typeof globalThis extends {
49
+ __VLS_PROPS_FALLBACK: infer P;
50
+ } ? P : {});
51
+ expose: (exposed: {}) => void;
52
+ attrs: any;
53
+ slots: {};
54
+ emit: {};
55
+ }>) => import("vue").VNode & {
56
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
57
+ };
58
+ declare const _default: typeof __VLS_export;
59
+ type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
60
+ //#endregion
61
+ //#region src/filters.d.ts
62
+ /** Naive fields and vendor overlays over the binding's filter state. */
63
+ declare function filters<TRow>(defs?: readonly FilterDef<TRow>[], options?: FiltersOptions): TableFeature<TRow>;
64
+ //#endregion
65
+ export { FilterTypeSpec as a, filters as c, _default$2 as d, FilterTreeBuilderProps$1 as i, _default as l, FilterDef$1 as n, FiltersOptions$1 as o, FilterOption as r, filterTypes as s, ChecklistFilterProps$1 as t, _default$1 as u };
66
+ //# sourceMappingURL=filters-C6DvAZ_T.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters-C6DvAZ_T.d.cts","names":[],"sources":["../src/filters/NaiveChecklistFilter.vue","../src/filters/NaiveFilterField.vue","../src/filters/NaiveFilterTree.vue","../src/filters.ts"],"mappings":";;;;cA2EM,iBAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,sBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAwEO,qBAAc,cAAc;aArEpB,KAAA,qBAAqB;aAClB,QAAA,qBAAqB;aACpB,SAAA,YAAY,qBAAqB;aAC7B,aAAA,YAAY,qBAAqB;eAkE4B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,mBAAO;KACvB,sBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;cC/F9F,iBAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,sBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EA8DO,qBAAc,cAAc,sBAAmB,mBAAA,iBAA8B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,mBAAO;KACvB,sBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;cCxB9F,eAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,oBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAoHO,qBAAc,cAAc;aAjHjB,MAAA,uBAAuB;aACrB,QAAA,uBAAuB;aACtB,SAAA,YAAY,uBAAuB;aAC/B,aAAA,YACpB,uBAAuB;aAEL,WAAA,YAAY,uBAAuB;aAC5B;eA0GsD;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,iBAAO;KACvB,oBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;;iBCpOpF,QAAQ,MACtB,gBAAe,UAAU,SACzB,UAAS,iBACR,aAAa"}
@@ -1,66 +1,2 @@
1
- import { FilterDef, FilterDef as FilterDef$1, FilterOption, FilterTypeSpec, TableFeature } from "@adapttable/vue";
2
- import { ChecklistFilterProps, ChecklistFilterProps as ChecklistFilterProps$1, FilterFieldOptions, FilterTreeBuilderProps, FilterTreeBuilderProps as FilterTreeBuilderProps$1 } from "@adapttable/vue/adapter";
3
- import { FiltersOptions, FiltersOptions as FiltersOptions$1, filterTypes } from "@adapttable/vue/features";
4
- //#region src/filters/NaiveChecklistFilter.vue.d.ts
5
- declare const __VLS_export$2: <TRow>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$2<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6
- props: import("vue").PublicProps & __VLS_PrettifyLocal$2<{
7
- readonly def: ChecklistFilterProps$1<TRow>["def"];
8
- readonly source: ChecklistFilterProps$1<TRow>["source"];
9
- readonly labels?: NonNullable<ChecklistFilterProps$1<TRow>["labels"]>;
10
- readonly classNames?: NonNullable<ChecklistFilterProps$1<TRow>["classNames"]>;
11
- }> & (typeof globalThis extends {
12
- __VLS_PROPS_FALLBACK: infer P;
13
- } ? P : {});
14
- expose: (exposed: {}) => void;
15
- attrs: any;
16
- slots: {};
17
- emit: {};
18
- }>) => import("vue").VNode & {
19
- __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
20
- };
21
- declare const _default: typeof __VLS_export$2;
22
- type __VLS_PrettifyLocal$2<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
23
- //#endregion
24
- //#region src/filters/NaiveFilterField.vue.d.ts
25
- declare const __VLS_export$1: <TRow>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$1<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
26
- props: import("vue").PublicProps & __VLS_PrettifyLocal$1<FilterFieldOptions<TRow>> & (typeof globalThis extends {
27
- __VLS_PROPS_FALLBACK: infer P;
28
- } ? P : {});
29
- expose: (exposed: {}) => void;
30
- attrs: any;
31
- slots: {};
32
- emit: {};
33
- }>) => import("vue").VNode & {
34
- __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
35
- };
36
- declare const _default$2: typeof __VLS_export$1;
37
- type __VLS_PrettifyLocal$1<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
38
- //#endregion
39
- //#region src/filters/NaiveFilterTree.vue.d.ts
40
- declare const __VLS_export: <TRow>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
41
- props: import("vue").PublicProps & __VLS_PrettifyLocal<{
42
- readonly defs: FilterTreeBuilderProps$1<TRow>["defs"];
43
- readonly source: FilterTreeBuilderProps$1<TRow>["source"];
44
- readonly labels?: NonNullable<FilterTreeBuilderProps$1<TRow>["labels"]>;
45
- readonly classNames?: NonNullable<FilterTreeBuilderProps$1<TRow>["classNames"]>;
46
- readonly registry?: NonNullable<FilterTreeBuilderProps$1<TRow>["registry"]>;
47
- readonly defaultExpanded?: boolean;
48
- }> & (typeof globalThis extends {
49
- __VLS_PROPS_FALLBACK: infer P;
50
- } ? P : {});
51
- expose: (exposed: {}) => void;
52
- attrs: any;
53
- slots: {};
54
- emit: {};
55
- }>) => import("vue").VNode & {
56
- __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
57
- };
58
- declare const _default$1: typeof __VLS_export;
59
- type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
60
- //#endregion
61
- //#region src/filters.d.ts
62
- /** Naive fields and vendor overlays over the binding's filter state. */
63
- declare function filters<TRow>(defs?: readonly FilterDef$1<TRow>[], options?: FiltersOptions$1): TableFeature<TRow>;
64
- //#endregion
65
- export { _default as ChecklistFilter, type ChecklistFilterProps, type FilterDef, type FilterOption, _default$1 as FilterTreeBuilder, type FilterTreeBuilderProps, type FilterTypeSpec, type FiltersOptions, _default$2 as NaiveFilterField, filterTypes, filters };
66
- //# sourceMappingURL=filters.d.cts.map
1
+ import { a as FilterTypeSpec, c as filters, d as _default, i as FilterTreeBuilderProps, l as _default$1, n as FilterDef, o as FiltersOptions, r as FilterOption, s as filterTypes, t as ChecklistFilterProps, u as _default$2 } from "./filters-C6DvAZ_T.cjs";
2
+ export { _default as ChecklistFilter, type ChecklistFilterProps, type FilterDef, type FilterOption, _default$1 as FilterTreeBuilder, type FilterTreeBuilderProps, type FilterTypeSpec, type FiltersOptions, _default$2 as NaiveFilterField, filterTypes, filters };
package/dist/filters.d.ts CHANGED
@@ -1,66 +1,2 @@
1
- import { FilterDef, FilterDef as FilterDef$1, FilterOption, FilterTypeSpec, TableFeature } from "@adapttable/vue";
2
- import { ChecklistFilterProps, ChecklistFilterProps as ChecklistFilterProps$1, FilterFieldOptions, FilterTreeBuilderProps, FilterTreeBuilderProps as FilterTreeBuilderProps$1 } from "@adapttable/vue/adapter";
3
- import { FiltersOptions, FiltersOptions as FiltersOptions$1, filterTypes } from "@adapttable/vue/features";
4
- //#region src/filters/NaiveChecklistFilter.vue.d.ts
5
- declare const __VLS_export$2: <TRow>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$2<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6
- props: import("vue").PublicProps & __VLS_PrettifyLocal$2<{
7
- readonly def: ChecklistFilterProps$1<TRow>["def"];
8
- readonly source: ChecklistFilterProps$1<TRow>["source"];
9
- readonly labels?: NonNullable<ChecklistFilterProps$1<TRow>["labels"]>;
10
- readonly classNames?: NonNullable<ChecklistFilterProps$1<TRow>["classNames"]>;
11
- }> & (typeof globalThis extends {
12
- __VLS_PROPS_FALLBACK: infer P;
13
- } ? P : {});
14
- expose: (exposed: {}) => void;
15
- attrs: any;
16
- slots: {};
17
- emit: {};
18
- }>) => import("vue").VNode & {
19
- __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
20
- };
21
- declare const _default: typeof __VLS_export$2;
22
- type __VLS_PrettifyLocal$2<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
23
- //#endregion
24
- //#region src/filters/NaiveFilterField.vue.d.ts
25
- declare const __VLS_export$1: <TRow>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$1<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
26
- props: import("vue").PublicProps & __VLS_PrettifyLocal$1<FilterFieldOptions<TRow>> & (typeof globalThis extends {
27
- __VLS_PROPS_FALLBACK: infer P;
28
- } ? P : {});
29
- expose: (exposed: {}) => void;
30
- attrs: any;
31
- slots: {};
32
- emit: {};
33
- }>) => import("vue").VNode & {
34
- __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
35
- };
36
- declare const _default$2: typeof __VLS_export$1;
37
- type __VLS_PrettifyLocal$1<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
38
- //#endregion
39
- //#region src/filters/NaiveFilterTree.vue.d.ts
40
- declare const __VLS_export: <TRow>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
41
- props: import("vue").PublicProps & __VLS_PrettifyLocal<{
42
- readonly defs: FilterTreeBuilderProps$1<TRow>["defs"];
43
- readonly source: FilterTreeBuilderProps$1<TRow>["source"];
44
- readonly labels?: NonNullable<FilterTreeBuilderProps$1<TRow>["labels"]>;
45
- readonly classNames?: NonNullable<FilterTreeBuilderProps$1<TRow>["classNames"]>;
46
- readonly registry?: NonNullable<FilterTreeBuilderProps$1<TRow>["registry"]>;
47
- readonly defaultExpanded?: boolean;
48
- }> & (typeof globalThis extends {
49
- __VLS_PROPS_FALLBACK: infer P;
50
- } ? P : {});
51
- expose: (exposed: {}) => void;
52
- attrs: any;
53
- slots: {};
54
- emit: {};
55
- }>) => import("vue").VNode & {
56
- __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
57
- };
58
- declare const _default$1: typeof __VLS_export;
59
- type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
60
- //#endregion
61
- //#region src/filters.d.ts
62
- /** Naive fields and vendor overlays over the binding's filter state. */
63
- declare function filters<TRow>(defs?: readonly FilterDef$1<TRow>[], options?: FiltersOptions$1): TableFeature<TRow>;
64
- //#endregion
65
- export { _default as ChecklistFilter, type ChecklistFilterProps, type FilterDef, type FilterOption, _default$1 as FilterTreeBuilder, type FilterTreeBuilderProps, type FilterTypeSpec, type FiltersOptions, _default$2 as NaiveFilterField, filterTypes, filters };
66
- //# sourceMappingURL=filters.d.ts.map
1
+ import { a as FilterTypeSpec, c as filters, d as _default, i as FilterTreeBuilderProps, l as _default$1, n as FilterDef, o as FiltersOptions, r as FilterOption, s as filterTypes, t as ChecklistFilterProps, u as _default$2 } from "./filters-BJ48GzqJ.js";
2
+ export { _default as ChecklistFilter, type ChecklistFilterProps, type FilterDef, type FilterOption, _default$1 as FilterTreeBuilder, type FilterTreeBuilderProps, type FilterTypeSpec, type FiltersOptions, _default$2 as NaiveFilterField, filterTypes, filters };
@@ -0,0 +1,151 @@
1
+ const require_button = require("./button-CaakTzYM.cjs");
2
+ const require_select = require("./select-C8UKnsWO.cjs");
3
+ const require_grouping = require("./grouping.cjs");
4
+ require("@adapttable/vue");
5
+ let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
6
+ let _adapttable_vue_features = require("@adapttable/vue/features");
7
+ let vue = require("vue");
8
+ let naive_ui = require("naive-ui");
9
+ //#region src/grouping/naiveGroupingControls.ts
10
+ function aggregationOption(option, disabled, onToggle) {
11
+ return (0, vue.h)(naive_ui.NCheckbox, {
12
+ key: option.value,
13
+ checked: option.checked,
14
+ disabled,
15
+ "data-adapttable-part": "grouping-aggregation-option",
16
+ "onUpdate:checked": (checked) => onToggle(option.value, checked)
17
+ }, { default: () => option.label });
18
+ }
19
+ function naiveGroupingControls(names) {
20
+ return {
21
+ Surface: ({ children, label, mobile, ...attrs }) => (0, vue.h)(naive_ui.NCard, {
22
+ ...(0, _adapttable_vue_adapter.toVueAttrs)(attrs),
23
+ size: "small",
24
+ class: ["adapttable-naive-ui-grouping-layout", names.value.groupingPanel],
25
+ role: "group",
26
+ "aria-label": label,
27
+ "data-mobile": mobile ? "" : void 0
28
+ }, { default: () => [(0, vue.h)("span", { class: "adapttable-naive-ui-grouping-layout-label" }, label), children] }),
29
+ DropZone: ({ label, empty, active, dragging, dropProps, ...attrs }) => (0, vue.h)(naive_ui.NTag, {
30
+ ...attrs,
31
+ ...(0, _adapttable_vue_adapter.toVueAttrs)({ ...dropProps }),
32
+ class: names.value.groupingDropZone,
33
+ "aria-label": label,
34
+ "data-empty": empty ? "" : void 0,
35
+ "data-active": active ? "" : void 0,
36
+ "data-dragging": dragging ? "" : void 0
37
+ }, { default: () => empty ? label : "" }),
38
+ Chip: ({ label, level, dragProps, keyboardProps, onRemove, removeLabel, ...attrs }) => (0, vue.h)(naive_ui.NFlex, {
39
+ ...attrs,
40
+ inline: true,
41
+ align: "center",
42
+ size: 4,
43
+ class: names.value.groupingChip,
44
+ "data-level": level
45
+ }, { default: () => [require_button.naiveButton({
46
+ ...(0, _adapttable_vue_adapter.toVueAttrs)({ ...dragProps }),
47
+ ...(0, _adapttable_vue_adapter.toVueAttrs)({ ...keyboardProps }),
48
+ class: names.value.groupingChipHandle,
49
+ "data-adapttable-part": "grouping-chip-handle"
50
+ }, `${level}. ${label}`), require_button.naiveButton({
51
+ class: names.value.groupingChipRemove,
52
+ "aria-label": removeLabel,
53
+ "data-adapttable-part": "grouping-chip-remove",
54
+ onClick: onRemove
55
+ }, "×")] }),
56
+ Select: ({ label, value, options, onChange, disabled, ...attrs }) => require_select.naiveSelect({
57
+ value,
58
+ options: value === "" ? [{
59
+ value: "",
60
+ label,
61
+ disabled: true
62
+ }, ...options] : options,
63
+ onChange,
64
+ attrs: {
65
+ ...attrs,
66
+ class: attrs["data-adapttable-part"] === "grouping-add" ? names.value.groupingAdd : names.value.groupingAggregationOperation,
67
+ disabled,
68
+ "aria-label": label,
69
+ placeholder: label
70
+ }
71
+ }),
72
+ RemoveZone: ({ label, active, dropProps, ...attrs }) => (0, vue.h)(naive_ui.NTag, {
73
+ ...attrs,
74
+ ...(0, _adapttable_vue_adapter.toVueAttrs)({ ...dropProps }),
75
+ class: names.value.groupingRemoveZone,
76
+ "aria-label": label,
77
+ "data-active": active ? "" : void 0
78
+ }, { default: () => label }),
79
+ AggregationItem: ({ label, readOnly, readOnlyLabel, children, ...attrs }) => (0, vue.h)(naive_ui.NFlex, {
80
+ ...attrs,
81
+ inline: true,
82
+ align: "center",
83
+ class: names.value.groupingAggregationItem,
84
+ "data-read-only": readOnly ? "" : void 0
85
+ }, { default: () => [
86
+ (0, vue.h)(naive_ui.NText, null, { default: () => label }),
87
+ readOnly ? (0, vue.h)(naive_ui.NTag, null, { default: () => readOnlyLabel }) : null,
88
+ children
89
+ ] }),
90
+ AggregationRemove: ({ label, onRemove, ...attrs }) => require_button.naiveButton({
91
+ ...attrs,
92
+ class: names.value.groupingAggregationRemove,
93
+ "aria-label": label,
94
+ onClick: onRemove
95
+ }, "×"),
96
+ AggregationPicker: ({ label, options, onToggle, disabled, ...attrs }) => (0, vue.h)(naive_ui.NFlex, {
97
+ ...attrs,
98
+ role: "group",
99
+ "aria-label": label,
100
+ class: names.value.groupingAggregationAdd
101
+ }, { default: () => options.map((option) => aggregationOption(option, disabled, onToggle)) }),
102
+ AggregationRestore: ({ label, disabled, onRestore, ...attrs }) => require_button.naiveButton({
103
+ ...attrs,
104
+ class: names.value.groupingAggregationsRestore,
105
+ disabled,
106
+ onClick: onRestore
107
+ }, label)
108
+ };
109
+ }
110
+ //#endregion
111
+ //#region src/grouping/NaiveGroupingPanel.vue
112
+ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
113
+ name: "NaiveGroupingPanel",
114
+ __name: "NaiveGroupingPanel",
115
+ props: {
116
+ state: {},
117
+ columns: {},
118
+ labels: {},
119
+ mobile: { type: Boolean },
120
+ dir: {}
121
+ },
122
+ setup(__props) {
123
+ const props = __props;
124
+ const names = (0, _adapttable_vue_adapter.useDataTableClassNames)();
125
+ const controls = naiveGroupingControls(names);
126
+ const Render = () => (0, _adapttable_vue_adapter.GroupingPanelChrome)({
127
+ ...props,
128
+ classNames: names.value,
129
+ slots: controls
130
+ });
131
+ Render.props = [];
132
+ return (_ctx, _cache) => {
133
+ return (0, vue.openBlock)(), (0, vue.createBlock)(Render);
134
+ };
135
+ }
136
+ });
137
+ //#endregion
138
+ //#region src/grouping-panel.ts
139
+ function groupingPanel(initialGroupBy, extras = {}) {
140
+ const ordinary = require_grouping.grouping([], extras);
141
+ return (0, _adapttable_vue_adapter.extendFeature)((0, _adapttable_vue_features.groupingPanel)(initialGroupBy, extras), [...ordinary.renders ?? [], (0, _adapttable_vue_adapter.slotRender)((0, _adapttable_vue_adapter.groupingPanelControlKey)(), (props) => (0, vue.h)(_sfc_main, { ...props }))]);
142
+ }
143
+ //#endregion
144
+ Object.defineProperty(exports, "groupingPanel", {
145
+ enumerable: true,
146
+ get: function() {
147
+ return groupingPanel;
148
+ }
149
+ });
150
+
151
+ //# sourceMappingURL=grouping-panel-BPaPG49S.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grouping-panel-BPaPG49S.cjs","names":["h","NCheckbox","NCard","toVueAttrs","NTag","NFlex","naiveButton","naiveSelect","NText","grouping","extendFeature","bindingGroupingPanel","slotRender","groupingPanelControlKey","h","NaiveGroupingPanel"],"sources":["../src/grouping/naiveGroupingControls.ts","../src/grouping/NaiveGroupingPanel.vue","../src/grouping-panel.ts"],"sourcesContent":["import {\n type DataTableClassNames,\n type GroupingPanelSlots,\n toVueAttrs,\n} from \"@adapttable/vue/adapter\";\nimport { NCard, NCheckbox, NFlex, NTag, NText } from \"naive-ui\";\nimport { type ComputedRef, h } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { naiveSelect } from \"../controls/select\";\nfunction aggregationOption(\n option: { value: string; label: string; checked: boolean },\n disabled: boolean | undefined,\n onToggle: (value: string, checked: boolean) => void\n) {\n return h(\n NCheckbox,\n {\n key: option.value,\n checked: option.checked,\n disabled,\n \"data-adapttable-part\": \"grouping-aggregation-option\",\n \"onUpdate:checked\": (checked: boolean) => onToggle(option.value, checked),\n },\n { default: () => option.label }\n );\n}\nexport function naiveGroupingControls(\n names: ComputedRef<DataTableClassNames>\n): GroupingPanelSlots {\n return {\n Surface: ({ children, label, mobile, ...attrs }) =>\n h(\n NCard,\n {\n ...toVueAttrs(attrs),\n size: \"small\",\n class: [\n \"adapttable-naive-ui-grouping-layout\",\n names.value.groupingPanel,\n ],\n role: \"group\",\n \"aria-label\": label,\n \"data-mobile\": mobile ? \"\" : undefined,\n },\n {\n default: () => [\n h(\n \"span\",\n { class: \"adapttable-naive-ui-grouping-layout-label\" },\n label\n ),\n children,\n ],\n }\n ),\n DropZone: ({ label, empty, active, dragging, dropProps, ...attrs }) =>\n h(\n NTag,\n {\n ...attrs,\n ...toVueAttrs({ ...dropProps }),\n class: names.value.groupingDropZone,\n \"aria-label\": label,\n \"data-empty\": empty ? \"\" : undefined,\n \"data-active\": active ? \"\" : undefined,\n \"data-dragging\": dragging ? \"\" : undefined,\n },\n { default: () => (empty ? label : \"\") }\n ),\n Chip: ({\n label,\n level,\n dragProps,\n keyboardProps,\n onRemove,\n removeLabel,\n ...attrs\n }) =>\n h(\n NFlex,\n {\n ...attrs,\n inline: true,\n align: \"center\",\n size: 4,\n class: names.value.groupingChip,\n \"data-level\": level,\n },\n {\n default: () => [\n naiveButton(\n {\n ...toVueAttrs({ ...dragProps }),\n ...toVueAttrs({ ...keyboardProps }),\n class: names.value.groupingChipHandle,\n \"data-adapttable-part\": \"grouping-chip-handle\",\n },\n `${level}. ${label}`\n ),\n naiveButton(\n {\n class: names.value.groupingChipRemove,\n \"aria-label\": removeLabel,\n \"data-adapttable-part\": \"grouping-chip-remove\",\n onClick: onRemove,\n },\n \"×\"\n ),\n ],\n }\n ),\n Select: ({ label, value, options, onChange, disabled, ...attrs }) =>\n naiveSelect({\n value,\n options:\n value === \"\"\n ? [{ value: \"\", label, disabled: true }, ...options]\n : options,\n onChange,\n attrs: {\n ...attrs,\n class:\n attrs[\"data-adapttable-part\"] === \"grouping-add\"\n ? names.value.groupingAdd\n : names.value.groupingAggregationOperation,\n disabled,\n \"aria-label\": label,\n placeholder: label,\n },\n }),\n RemoveZone: ({ label, active, dropProps, ...attrs }) =>\n h(\n NTag,\n {\n ...attrs,\n ...toVueAttrs({ ...dropProps }),\n class: names.value.groupingRemoveZone,\n \"aria-label\": label,\n \"data-active\": active ? \"\" : undefined,\n },\n { default: () => label }\n ),\n AggregationItem: ({ label, readOnly, readOnlyLabel, children, ...attrs }) =>\n h(\n NFlex,\n {\n ...attrs,\n inline: true,\n align: \"center\",\n class: names.value.groupingAggregationItem,\n \"data-read-only\": readOnly ? \"\" : undefined,\n },\n {\n default: () => [\n h(NText, null, { default: () => label }),\n readOnly ? h(NTag, null, { default: () => readOnlyLabel }) : null,\n children,\n ],\n }\n ),\n AggregationRemove: ({ label, onRemove, ...attrs }) =>\n naiveButton(\n {\n ...attrs,\n class: names.value.groupingAggregationRemove,\n \"aria-label\": label,\n onClick: onRemove,\n },\n \"×\"\n ),\n AggregationPicker: ({ label, options, onToggle, disabled, ...attrs }) =>\n h(\n NFlex,\n {\n ...attrs,\n role: \"group\",\n \"aria-label\": label,\n class: names.value.groupingAggregationAdd,\n },\n {\n default: () =>\n options.map((option) =>\n aggregationOption(option, disabled, onToggle)\n ),\n }\n ),\n AggregationRestore: ({ label, disabled, onRestore, ...attrs }) =>\n naiveButton(\n {\n ...attrs,\n class: names.value.groupingAggregationsRestore,\n disabled,\n onClick: onRestore,\n },\n label\n ),\n };\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport { type GroupingPanelProps } from \"@adapttable/vue\";\nimport {\n GroupingPanelChrome,\n useDataTableClassNames,\n} from \"@adapttable/vue/adapter\";\n\nimport { naiveGroupingControls } from \"./naiveGroupingControls\";\n\ndefineOptions({ name: \"NaiveGroupingPanel\" });\nconst props = defineProps<GroupingPanelProps<TRow>>();\nconst names = useDataTableClassNames();\nconst controls = naiveGroupingControls(names);\nconst Render = () =>\n GroupingPanelChrome({\n ...props,\n classNames: names.value,\n slots: controls,\n });\n\n// Declare no props so Vue forwards all root attributes, including id and data-*.\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n\n<style>\n.adapttable-naive-ui-grouping-layout > .n-card-content {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem;\n padding: 0.75rem 1rem;\n min-inline-size: 0;\n}\n.adapttable-naive-ui-grouping-layout-label,\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-aggregations\"]::before {\n font-size: 0.8125rem;\n font-weight: 600;\n color: var(--n-text-color);\n margin-inline-end: 0.5rem;\n}\n.adapttable-naive-ui-grouping-layout [data-adapttable-part=\"grouping-add\"] {\n flex: 0 1 15rem;\n inline-size: 15rem;\n min-inline-size: 0;\n max-inline-size: 100%;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-aggregations\"] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.75rem;\n flex-basis: 100%;\n min-inline-size: 0;\n margin: 0.25rem 0 0;\n padding: 0.75rem 0 0;\n border: 0;\n border-block-start: 1px solid var(--n-border-color);\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-aggregations\"]::before {\n content: attr(aria-label);\n}\n.adapttable-naive-ui-grouping-layout [data-adapttable-aggregation],\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-aggregation-item\"] {\n display: inline-flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem;\n min-inline-size: 0;\n max-inline-size: 100%;\n margin: 0;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-aggregation-operation\"] {\n flex: 0 1 8rem;\n inline-size: 8rem;\n min-inline-size: 0;\n max-inline-size: 100%;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-aggregation-add\"] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem 0.75rem;\n min-inline-size: 0;\n max-inline-size: 100%;\n margin: 0;\n padding: 0;\n border: 0;\n box-shadow: none;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-aggregation-add\"]\n legend {\n float: inline-start;\n padding: 0;\n font-size: 0.8125rem;\n color: var(--n-text-color);\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-aggregation-add\"]\n label {\n display: inline-flex;\n align-items: center;\n gap: 0.375rem;\n margin: 0;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-chip-remove\"],\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-aggregation-remove\"] {\n min-inline-size: 2rem;\n min-block-size: 2rem;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-drop-zone\"]:not([data-empty]):not(\n [data-dragging]\n ):not([data-active]) {\n opacity: 0;\n}\n\n/* Keep insertion boundaries stable so the target never moves under the pointer. */\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-drop-zone\"] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n flex: 0 0 auto;\n min-inline-size: 10px;\n min-block-size: 32px;\n block-size: auto;\n transition:\n border-color 120ms ease,\n background-color 120ms ease;\n margin-inline: 2px;\n padding: 0;\n border: 1px dashed color-mix(in srgb, currentColor 30%, transparent);\n border-radius: 4px;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-drop-zone\"][data-empty] {\n min-inline-size: 9rem;\n min-block-size: 44px;\n padding: 0.5rem;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-drop-zone\"][data-dragging] {\n opacity: 1;\n border-color: var(--adapttable-naive-primary, #18a058);\n background: color-mix(\n in srgb,\n var(--adapttable-naive-primary, #18a058) 8%,\n transparent\n );\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-drop-zone\"][data-active] {\n border-style: solid;\n border-color: var(--adapttable-naive-primary, #18a058);\n background: color-mix(\n in srgb,\n var(--adapttable-naive-primary, #18a058) 22%,\n transparent\n );\n outline: 2px solid var(--adapttable-naive-primary, #18a058);\n outline-offset: 1px;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-chip-handle\"] {\n cursor: grab;\n}\n.adapttable-naive-ui-grouping-layout [data-grouping-dragging] {\n opacity: 0.5;\n cursor: grabbing;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-remove-zone\"] {\n display: flex;\n flex: 1 1 100%;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n min-block-size: 44px;\n padding: 0.5rem 0.75rem;\n border: 1px dashed var(--adapttable-naive-error, #d03050);\n border-radius: 6px;\n color: var(--adapttable-naive-error, #d03050);\n font-size: 0.8125rem;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-remove-zone\"][data-active] {\n background: color-mix(\n in srgb,\n var(--adapttable-naive-error, #d03050) 12%,\n transparent\n );\n border-style: solid;\n outline: 2px solid var(--adapttable-naive-error, #d03050);\n}\n</style>\n","import { type StaticTableFeature, type TableFeature } from \"@adapttable/vue\";\nimport {\n extendFeature,\n groupingPanelControlKey,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport {\n type GroupingExtras,\n groupingPanel as bindingGroupingPanel,\n type StaticGroupingExtras,\n} from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport { grouping } from \"./grouping\";\nimport NaiveGroupingPanel from \"./grouping/NaiveGroupingPanel.vue\";\nexport type { GroupingPanelProps } from \"@adapttable/vue\";\nexport type { GroupingExtras } from \"@adapttable/vue/features\";\nexport function groupingPanel(\n initialGroupBy?: string | readonly string[],\n extras?: StaticGroupingExtras\n): StaticTableFeature;\nexport function groupingPanel<TRow>(\n initialGroupBy?: string | readonly string[],\n extras?: GroupingExtras<TRow>\n): TableFeature<TRow>;\nexport function groupingPanel<TRow>(\n initialGroupBy?: string | readonly string[],\n extras: GroupingExtras<TRow> = {}\n): TableFeature<TRow> {\n const ordinary = grouping<TRow>([], extras);\n return extendFeature(bindingGroupingPanel<TRow>(initialGroupBy, extras), [\n ...(ordinary.renders ?? []),\n slotRender(groupingPanelControlKey<TRow>(), (props) =>\n h(NaiveGroupingPanel<TRow>, { ...props })\n ),\n ]);\n}\n"],"mappings":";;;;;;;;;AAUA,SAAS,kBACP,QACA,UACA,UACA;CACA,QAAA,GAAOA,IAAAA,EAAAA,CACLC,SAAAA,WACA;EACE,KAAK,OAAO;EACZ,SAAS,OAAO;EAChB;EACA,wBAAwB;EACxB,qBAAqB,YAAqB,SAAS,OAAO,OAAO,OAAO;CAC1E,GACA,EAAE,eAAe,OAAO,MAAM,CAChC;AACF;AACA,SAAgB,sBACd,OACoB;CACpB,OAAO;EACL,UAAU,EAAE,UAAU,OAAO,QAAQ,GAAG,aAAA,GACtCD,IAAAA,EAAAA,CACEE,SAAAA,OACA;GACE,IAAA,GAAGC,wBAAAA,WAAAA,CAAW,KAAK;GACnB,MAAM;GACN,OAAO,CACL,uCACA,MAAM,MAAM,aACd;GACA,MAAM;GACN,cAAc;GACd,eAAe,SAAS,KAAK,KAAA;EAC/B,GACA,EACE,eAAe,EAAA,GACbH,IAAAA,EAAAA,CACE,QACA,EAAE,OAAO,4CAA4C,GACrD,KACF,GACA,QACF,EACF,CACF;EACF,WAAW,EAAE,OAAO,OAAO,QAAQ,UAAU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AoB;GAClB,GAAG;GACH,YAAY,MAAM;GAClB,OAAO;EACT,CAAC;EAIH,OAAO,QAAQ,CAAA;;GAIb,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,CAAU,MAAA;;;;;;ACDZ,SAAgB,cACd,gBACA,SAA+B,CAAC,GACZ;CACpB,MAAM,WAAWG,iBAAAA,SAAe,CAAC,GAAG,MAAM;CAC1C,QAAA,GAAOC,wBAAAA,cAAAA,EAAAA,GAAcC,yBAAAA,cAAAA,CAA2B,gBAAgB,MAAM,GAAG,CACvE,GAAI,SAAS,WAAW,CAAC,IAAA,GACzBC,wBAAAA,WAAAA,EAAAA,GAAWC,wBAAAA,wBAAAA,CAA8B,IAAI,WAAA,GAC3CC,IAAAA,EAAAA,CAAEC,WAA0B,EAAE,GAAG,MAAM,CAAC,CAC1C,CACF,CAAC;AACH"}
@@ -0,0 +1,146 @@
1
+ import { t as naiveButton } from "./button-BxXdDW7A.js";
2
+ import { t as naiveSelect } from "./select-Bgc5ttop.js";
3
+ import { grouping as grouping$1 } from "./grouping.js";
4
+ import "@adapttable/vue";
5
+ import { GroupingPanelChrome, extendFeature, groupingPanelControlKey, slotRender, toVueAttrs, useDataTableClassNames } from "@adapttable/vue/adapter";
6
+ import { groupingPanel } from "@adapttable/vue/features";
7
+ import { createBlock, defineComponent, h, openBlock } from "vue";
8
+ import { NCard, NCheckbox, NFlex, NTag, NText } from "naive-ui";
9
+ //#region src/grouping/naiveGroupingControls.ts
10
+ function aggregationOption(option, disabled, onToggle) {
11
+ return h(NCheckbox, {
12
+ key: option.value,
13
+ checked: option.checked,
14
+ disabled,
15
+ "data-adapttable-part": "grouping-aggregation-option",
16
+ "onUpdate:checked": (checked) => onToggle(option.value, checked)
17
+ }, { default: () => option.label });
18
+ }
19
+ function naiveGroupingControls(names) {
20
+ return {
21
+ Surface: ({ children, label, mobile, ...attrs }) => h(NCard, {
22
+ ...toVueAttrs(attrs),
23
+ size: "small",
24
+ class: ["adapttable-naive-ui-grouping-layout", names.value.groupingPanel],
25
+ role: "group",
26
+ "aria-label": label,
27
+ "data-mobile": mobile ? "" : void 0
28
+ }, { default: () => [h("span", { class: "adapttable-naive-ui-grouping-layout-label" }, label), children] }),
29
+ DropZone: ({ label, empty, active, dragging, dropProps, ...attrs }) => h(NTag, {
30
+ ...attrs,
31
+ ...toVueAttrs({ ...dropProps }),
32
+ class: names.value.groupingDropZone,
33
+ "aria-label": label,
34
+ "data-empty": empty ? "" : void 0,
35
+ "data-active": active ? "" : void 0,
36
+ "data-dragging": dragging ? "" : void 0
37
+ }, { default: () => empty ? label : "" }),
38
+ Chip: ({ label, level, dragProps, keyboardProps, onRemove, removeLabel, ...attrs }) => h(NFlex, {
39
+ ...attrs,
40
+ inline: true,
41
+ align: "center",
42
+ size: 4,
43
+ class: names.value.groupingChip,
44
+ "data-level": level
45
+ }, { default: () => [naiveButton({
46
+ ...toVueAttrs({ ...dragProps }),
47
+ ...toVueAttrs({ ...keyboardProps }),
48
+ class: names.value.groupingChipHandle,
49
+ "data-adapttable-part": "grouping-chip-handle"
50
+ }, `${level}. ${label}`), naiveButton({
51
+ class: names.value.groupingChipRemove,
52
+ "aria-label": removeLabel,
53
+ "data-adapttable-part": "grouping-chip-remove",
54
+ onClick: onRemove
55
+ }, "×")] }),
56
+ Select: ({ label, value, options, onChange, disabled, ...attrs }) => naiveSelect({
57
+ value,
58
+ options: value === "" ? [{
59
+ value: "",
60
+ label,
61
+ disabled: true
62
+ }, ...options] : options,
63
+ onChange,
64
+ attrs: {
65
+ ...attrs,
66
+ class: attrs["data-adapttable-part"] === "grouping-add" ? names.value.groupingAdd : names.value.groupingAggregationOperation,
67
+ disabled,
68
+ "aria-label": label,
69
+ placeholder: label
70
+ }
71
+ }),
72
+ RemoveZone: ({ label, active, dropProps, ...attrs }) => h(NTag, {
73
+ ...attrs,
74
+ ...toVueAttrs({ ...dropProps }),
75
+ class: names.value.groupingRemoveZone,
76
+ "aria-label": label,
77
+ "data-active": active ? "" : void 0
78
+ }, { default: () => label }),
79
+ AggregationItem: ({ label, readOnly, readOnlyLabel, children, ...attrs }) => h(NFlex, {
80
+ ...attrs,
81
+ inline: true,
82
+ align: "center",
83
+ class: names.value.groupingAggregationItem,
84
+ "data-read-only": readOnly ? "" : void 0
85
+ }, { default: () => [
86
+ h(NText, null, { default: () => label }),
87
+ readOnly ? h(NTag, null, { default: () => readOnlyLabel }) : null,
88
+ children
89
+ ] }),
90
+ AggregationRemove: ({ label, onRemove, ...attrs }) => naiveButton({
91
+ ...attrs,
92
+ class: names.value.groupingAggregationRemove,
93
+ "aria-label": label,
94
+ onClick: onRemove
95
+ }, "×"),
96
+ AggregationPicker: ({ label, options, onToggle, disabled, ...attrs }) => h(NFlex, {
97
+ ...attrs,
98
+ role: "group",
99
+ "aria-label": label,
100
+ class: names.value.groupingAggregationAdd
101
+ }, { default: () => options.map((option) => aggregationOption(option, disabled, onToggle)) }),
102
+ AggregationRestore: ({ label, disabled, onRestore, ...attrs }) => naiveButton({
103
+ ...attrs,
104
+ class: names.value.groupingAggregationsRestore,
105
+ disabled,
106
+ onClick: onRestore
107
+ }, label)
108
+ };
109
+ }
110
+ //#endregion
111
+ //#region src/grouping/NaiveGroupingPanel.vue
112
+ const _sfc_main = /*@__PURE__*/ defineComponent({
113
+ name: "NaiveGroupingPanel",
114
+ __name: "NaiveGroupingPanel",
115
+ props: {
116
+ state: {},
117
+ columns: {},
118
+ labels: {},
119
+ mobile: { type: Boolean },
120
+ dir: {}
121
+ },
122
+ setup(__props) {
123
+ const props = __props;
124
+ const names = useDataTableClassNames();
125
+ const controls = naiveGroupingControls(names);
126
+ const Render = () => GroupingPanelChrome({
127
+ ...props,
128
+ classNames: names.value,
129
+ slots: controls
130
+ });
131
+ Render.props = [];
132
+ return (_ctx, _cache) => {
133
+ return openBlock(), createBlock(Render);
134
+ };
135
+ }
136
+ });
137
+ //#endregion
138
+ //#region src/grouping-panel.ts
139
+ function groupingPanel$1(initialGroupBy, extras = {}) {
140
+ const ordinary = grouping$1([], extras);
141
+ return extendFeature(groupingPanel(initialGroupBy, extras), [...ordinary.renders ?? [], slotRender(groupingPanelControlKey(), (props) => h(_sfc_main, { ...props }))]);
142
+ }
143
+ //#endregion
144
+ export { groupingPanel$1 as t };
145
+
146
+ //# sourceMappingURL=grouping-panel-CYUPSa0u.js.map