@rastr/vue 0.0.0-stage → 0.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +209 -2
- package/dist/RsGrid-CuQ785Nt.d.cts +298 -0
- package/dist/RsGrid-CuQ785Nt.d.ts +298 -0
- package/dist/index.cjs +973 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +222 -0
- package/dist/index.d.ts +222 -0
- package/dist/index.js +926 -0
- package/dist/index.js.map +1 -0
- package/dist/pdf-designer.cjs +119 -0
- package/dist/pdf-designer.cjs.map +1 -0
- package/dist/pdf-designer.d.cts +68 -0
- package/dist/pdf-designer.d.ts +68 -0
- package/dist/pdf-designer.js +82 -0
- package/dist/pdf-designer.js.map +1 -0
- package/dist/tree-list.cjs +133 -0
- package/dist/tree-list.cjs.map +1 -0
- package/dist/tree-list.d.cts +91 -0
- package/dist/tree-list.d.ts +91 -0
- package/dist/tree-list.js +106 -0
- package/dist/tree-list.js.map +1 -0
- package/package.json +96 -3
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/tree-list/index.ts
|
|
21
|
+
var tree_list_exports = {};
|
|
22
|
+
__export(tree_list_exports, {
|
|
23
|
+
RsTreeList: () => RsTreeList
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(tree_list_exports);
|
|
26
|
+
|
|
27
|
+
// src/tree-list/RsTreeList.ts
|
|
28
|
+
var import_tree_list = require("@rastr/tree-list");
|
|
29
|
+
var import_vue = require("vue");
|
|
30
|
+
var sameKeys = (a, b) => a.length === b.length && a.every((key, i) => String(key) === String(b[i]));
|
|
31
|
+
var RsTreeList = (0, import_vue.defineComponent)({
|
|
32
|
+
name: "RsTreeList",
|
|
33
|
+
props: {
|
|
34
|
+
/** The rows; a new array (reference) refreshes the tree. */
|
|
35
|
+
rows: { type: [Array, Function], required: true },
|
|
36
|
+
keyField: { type: String, required: true },
|
|
37
|
+
parentField: String,
|
|
38
|
+
childrenField: String,
|
|
39
|
+
treeField: String,
|
|
40
|
+
columns: { type: Array, required: true },
|
|
41
|
+
expandedKeys: { type: Array, default: () => [] },
|
|
42
|
+
height: String,
|
|
43
|
+
selectionMode: String,
|
|
44
|
+
locale: String,
|
|
45
|
+
messages: Object,
|
|
46
|
+
theme: String,
|
|
47
|
+
density: String
|
|
48
|
+
},
|
|
49
|
+
emits: {
|
|
50
|
+
"update:expandedKeys": (keys) => Array.isArray(keys),
|
|
51
|
+
rowClick: (payload) => payload !== void 0,
|
|
52
|
+
rowDblClick: (payload) => payload !== void 0,
|
|
53
|
+
focusedRowChange: (payload) => payload !== void 0,
|
|
54
|
+
selectionChange: (selection) => selection !== void 0
|
|
55
|
+
},
|
|
56
|
+
setup(props, { emit, expose }) {
|
|
57
|
+
const host = (0, import_vue.ref)(null);
|
|
58
|
+
let tree = null;
|
|
59
|
+
let unsubscribe = null;
|
|
60
|
+
const create = () => {
|
|
61
|
+
if (!host.value) return;
|
|
62
|
+
const expanded = tree ? tree.getExpandedKeys() : (0, import_vue.toRaw)(props.expandedKeys);
|
|
63
|
+
destroy();
|
|
64
|
+
tree = (0, import_tree_list.createTreeList)(host.value, {
|
|
65
|
+
// Read on every load, so a refresh sees the latest rows prop.
|
|
66
|
+
rows: () => {
|
|
67
|
+
const rows = (0, import_vue.toRaw)(props.rows);
|
|
68
|
+
return typeof rows === "function" ? rows() : rows;
|
|
69
|
+
},
|
|
70
|
+
keyField: props.keyField,
|
|
71
|
+
columns: (0, import_vue.toRaw)(props.columns),
|
|
72
|
+
expandedKeys: expanded,
|
|
73
|
+
onExpandedChange: (keys) => emit("update:expandedKeys", keys),
|
|
74
|
+
...props.parentField ? { parentField: props.parentField } : {},
|
|
75
|
+
...props.childrenField ? { childrenField: props.childrenField } : {},
|
|
76
|
+
...props.treeField ? { treeField: props.treeField } : {},
|
|
77
|
+
...props.height ? { height: props.height } : {},
|
|
78
|
+
...props.selectionMode ? { selectionMode: props.selectionMode } : {},
|
|
79
|
+
...props.locale ? { locale: props.locale } : {},
|
|
80
|
+
...props.messages ? { messages: props.messages } : {},
|
|
81
|
+
...props.theme ? { theme: props.theme } : {},
|
|
82
|
+
...props.density ? { density: props.density } : {}
|
|
83
|
+
});
|
|
84
|
+
tree.grid.on("rowClick", (payload) => emit("rowClick", payload));
|
|
85
|
+
tree.grid.on("rowDblClick", (payload) => emit("rowDblClick", payload));
|
|
86
|
+
tree.grid.on("focusedRowChange", (payload) => emit("focusedRowChange", payload));
|
|
87
|
+
let selection = tree.store.getSnapshot().state.selection;
|
|
88
|
+
unsubscribe = tree.store.subscribe((snapshot) => {
|
|
89
|
+
if (snapshot.state.selection === selection) return;
|
|
90
|
+
selection = snapshot.state.selection;
|
|
91
|
+
emit("selectionChange", selection);
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
const destroy = () => {
|
|
95
|
+
unsubscribe?.();
|
|
96
|
+
unsubscribe = null;
|
|
97
|
+
tree?.destroy();
|
|
98
|
+
tree = null;
|
|
99
|
+
};
|
|
100
|
+
expose({
|
|
101
|
+
expand: (key) => tree?.expand(key),
|
|
102
|
+
collapse: (key) => tree?.collapse(key),
|
|
103
|
+
expandAll: () => tree?.expandAll(),
|
|
104
|
+
collapseAll: () => tree?.collapseAll(),
|
|
105
|
+
refresh: () => tree?.refresh(),
|
|
106
|
+
get store() {
|
|
107
|
+
return tree?.store ?? null;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
(0, import_vue.onMounted)(create);
|
|
111
|
+
(0, import_vue.onBeforeUnmount)(destroy);
|
|
112
|
+
(0, import_vue.watch)(
|
|
113
|
+
() => props.rows,
|
|
114
|
+
() => void tree?.refresh()
|
|
115
|
+
);
|
|
116
|
+
(0, import_vue.watch)(
|
|
117
|
+
() => props.expandedKeys,
|
|
118
|
+
(keys) => {
|
|
119
|
+
if (!tree || sameKeys((0, import_vue.toRaw)(keys), tree.getExpandedKeys())) return;
|
|
120
|
+
tree.source.collapseAll();
|
|
121
|
+
(0, import_vue.toRaw)(keys).forEach((key) => tree.source.setExpanded(key, true));
|
|
122
|
+
void tree.store.reload();
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
(0, import_vue.watch)(() => [props.columns, props.keyField, props.parentField, props.childrenField, props.treeField, props.height, props.selectionMode, props.locale, props.messages, props.theme, props.density], create);
|
|
126
|
+
return () => (0, import_vue.h)("div", { ref: host, class: "rs-vue-tree-list" });
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
130
|
+
0 && (module.exports = {
|
|
131
|
+
RsTreeList
|
|
132
|
+
});
|
|
133
|
+
//# sourceMappingURL=tree-list.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tree-list/index.ts","../src/tree-list/RsTreeList.ts"],"sourcesContent":["export { RsTreeList } from './RsTreeList';\n","import type { GridStore, Key, SelectionState } from '@rastr/core';\nimport type { GridColumn, GridEvents, Messages } from '@rastr/grid';\nimport { createTreeList } from '@rastr/tree-list';\nimport type { TreeList } from '@rastr/tree-list';\nimport { defineComponent, h, onBeforeUnmount, onMounted, ref, toRaw, watch } from 'vue';\nimport type { PropType, Ref } from 'vue';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyRow = any;\n\nconst sameKeys = (a: readonly Key[], b: readonly Key[]): boolean => a.length === b.length && a.every((key, i) => String(key) === String(b[i]));\n\n/** Tree list: hierarchical rows (parentField or childrenField) with v-model:expandedKeys. */\nexport const RsTreeList = defineComponent({\n name: 'RsTreeList',\n props: {\n /** The rows; a new array (reference) refreshes the tree. */\n rows: { type: [Array, Function] as PropType<readonly AnyRow[] | (() => readonly AnyRow[] | Promise<readonly AnyRow[]>)>, required: true },\n keyField: { type: String, required: true },\n parentField: String,\n childrenField: String,\n treeField: String,\n columns: { type: Array as PropType<readonly GridColumn<AnyRow>[]>, required: true },\n expandedKeys: { type: Array as PropType<readonly Key[]>, default: () => [] },\n height: String,\n selectionMode: String as PropType<'none' | 'single' | 'multiple'>,\n locale: String,\n messages: Object as PropType<Partial<Messages>>,\n theme: String as PropType<'light' | 'dark'>,\n density: String as PropType<'compact' | 'normal' | 'comfortable'>,\n },\n emits: {\n 'update:expandedKeys': (keys: readonly Key[]) => Array.isArray(keys),\n rowClick: (payload: GridEvents<AnyRow>['rowClick']) => payload !== undefined,\n rowDblClick: (payload: GridEvents<AnyRow>['rowDblClick']) => payload !== undefined,\n focusedRowChange: (payload: GridEvents<AnyRow>['focusedRowChange']) => payload !== undefined,\n selectionChange: (selection: SelectionState) => selection !== undefined,\n },\n setup(props, { emit, expose }) {\n const host: Ref<HTMLElement | null> = ref(null);\n let tree: TreeList<AnyRow> | null = null;\n let unsubscribe: (() => void) | null = null;\n\n const create = (): void => {\n if (!host.value) return;\n const expanded: readonly Key[] = tree ? tree.getExpandedKeys() : toRaw(props.expandedKeys);\n destroy();\n tree = createTreeList<AnyRow>(host.value, {\n // Read on every load, so a refresh sees the latest rows prop.\n rows: () => {\n const rows = toRaw(props.rows);\n return typeof rows === 'function' ? rows() : rows;\n },\n keyField: props.keyField,\n columns: toRaw(props.columns),\n expandedKeys: expanded,\n onExpandedChange: keys => emit('update:expandedKeys', keys),\n ...(props.parentField ? { parentField: props.parentField } : {}),\n ...(props.childrenField ? { childrenField: props.childrenField } : {}),\n ...(props.treeField ? { treeField: props.treeField } : {}),\n ...(props.height ? { height: props.height } : {}),\n ...(props.selectionMode ? { selectionMode: props.selectionMode } : {}),\n ...(props.locale ? { locale: props.locale } : {}),\n ...(props.messages ? { messages: props.messages } : {}),\n ...(props.theme ? { theme: props.theme } : {}),\n ...(props.density ? { density: props.density } : {}),\n });\n tree.grid.on('rowClick', payload => emit('rowClick', payload));\n tree.grid.on('rowDblClick', payload => emit('rowDblClick', payload));\n tree.grid.on('focusedRowChange', payload => emit('focusedRowChange', payload));\n let selection: SelectionState = tree.store.getSnapshot().state.selection;\n unsubscribe = tree.store.subscribe(snapshot => {\n if (snapshot.state.selection === selection) return;\n selection = snapshot.state.selection;\n emit('selectionChange', selection);\n });\n };\n\n const destroy = (): void => {\n unsubscribe?.();\n unsubscribe = null;\n tree?.destroy();\n tree = null;\n };\n\n expose({\n expand: (key: Key) => tree?.expand(key),\n collapse: (key: Key) => tree?.collapse(key),\n expandAll: () => tree?.expandAll(),\n collapseAll: () => tree?.collapseAll(),\n refresh: () => tree?.refresh(),\n get store(): GridStore<AnyRow> | null {\n return tree?.store ?? null;\n },\n });\n\n onMounted(create);\n onBeforeUnmount(destroy);\n watch(\n () => props.rows,\n () => void tree?.refresh(),\n );\n // v-model: its own keys coming back change nothing; other keys replace the expansion.\n watch(\n () => props.expandedKeys,\n keys => {\n if (!tree || sameKeys(toRaw(keys), tree.getExpandedKeys())) return;\n tree.source.collapseAll();\n toRaw(keys).forEach(key => tree!.source.setExpanded(key, true));\n void tree.store.reload();\n },\n );\n watch(() => [props.columns, props.keyField, props.parentField, props.childrenField, props.treeField, props.height, props.selectionMode, props.locale, props.messages, props.theme, props.density], create);\n\n return () => h('div', { ref: host, class: 'rs-vue-tree-list' });\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,uBAA+B;AAE/B,iBAAkF;AAMlF,IAAM,WAAW,CAAC,GAAmB,MAA+B,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,CAAC,KAAK,MAAM,OAAO,GAAG,MAAM,OAAO,EAAE,CAAC,CAAC,CAAC;AAGtI,IAAM,iBAAa,4BAAgB;AAAA,EACxC,MAAM;AAAA,EACN,OAAO;AAAA;AAAA,IAEL,MAAM,EAAE,MAAM,CAAC,OAAO,QAAQ,GAA2F,UAAU,KAAK;AAAA,IACxI,UAAU,EAAE,MAAM,QAAQ,UAAU,KAAK;AAAA,IACzC,aAAa;AAAA,IACb,eAAe;AAAA,IACf,WAAW;AAAA,IACX,SAAS,EAAE,MAAM,OAAkD,UAAU,KAAK;AAAA,IAClF,cAAc,EAAE,MAAM,OAAmC,SAAS,MAAM,CAAC,EAAE;AAAA,IAC3E,QAAQ;AAAA,IACR,eAAe;AAAA,IACf,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,OAAO;AAAA,IACP,SAAS;AAAA,EACX;AAAA,EACA,OAAO;AAAA,IACL,uBAAuB,CAAC,SAAyB,MAAM,QAAQ,IAAI;AAAA,IACnE,UAAU,CAAC,YAA4C,YAAY;AAAA,IACnE,aAAa,CAAC,YAA+C,YAAY;AAAA,IACzE,kBAAkB,CAAC,YAAoD,YAAY;AAAA,IACnF,iBAAiB,CAAC,cAA8B,cAAc;AAAA,EAChE;AAAA,EACA,MAAM,OAAO,EAAE,MAAM,OAAO,GAAG;AAC7B,UAAM,WAAgC,gBAAI,IAAI;AAC9C,QAAI,OAAgC;AACpC,QAAI,cAAmC;AAEvC,UAAM,SAAS,MAAY;AACzB,UAAI,CAAC,KAAK,MAA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 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
import { Key, SelectionState } from '@rastr/core';
|
|
4
|
+
import { GridColumn, Messages, GridEvents } from '@rastr/grid';
|
|
5
|
+
|
|
6
|
+
type AnyRow = any;
|
|
7
|
+
/** Tree list: hierarchical rows (parentField or childrenField) with v-model:expandedKeys. */
|
|
8
|
+
declare const RsTreeList: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
9
|
+
/** The rows; a new array (reference) refreshes the tree. */
|
|
10
|
+
rows: {
|
|
11
|
+
type: PropType<readonly AnyRow[] | (() => readonly AnyRow[] | Promise<readonly AnyRow[]>)>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
keyField: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
parentField: StringConstructor;
|
|
19
|
+
childrenField: StringConstructor;
|
|
20
|
+
treeField: StringConstructor;
|
|
21
|
+
columns: {
|
|
22
|
+
type: PropType<readonly GridColumn<AnyRow>[]>;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
expandedKeys: {
|
|
26
|
+
type: PropType<readonly Key[]>;
|
|
27
|
+
default: () => never[];
|
|
28
|
+
};
|
|
29
|
+
height: StringConstructor;
|
|
30
|
+
selectionMode: PropType<"none" | "single" | "multiple">;
|
|
31
|
+
locale: StringConstructor;
|
|
32
|
+
messages: PropType<Partial<Messages>>;
|
|
33
|
+
theme: PropType<"light" | "dark">;
|
|
34
|
+
density: PropType<"compact" | "normal" | "comfortable">;
|
|
35
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
38
|
+
'update:expandedKeys': (keys: readonly Key[]) => keys is any[];
|
|
39
|
+
rowClick: (payload: GridEvents<AnyRow>["rowClick"]) => boolean;
|
|
40
|
+
rowDblClick: (payload: GridEvents<AnyRow>["rowDblClick"]) => boolean;
|
|
41
|
+
focusedRowChange: (payload: GridEvents<AnyRow>["focusedRowChange"]) => boolean;
|
|
42
|
+
selectionChange: (selection: SelectionState) => boolean;
|
|
43
|
+
}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
44
|
+
/** The rows; a new array (reference) refreshes the tree. */
|
|
45
|
+
rows: {
|
|
46
|
+
type: PropType<readonly AnyRow[] | (() => readonly AnyRow[] | Promise<readonly AnyRow[]>)>;
|
|
47
|
+
required: true;
|
|
48
|
+
};
|
|
49
|
+
keyField: {
|
|
50
|
+
type: StringConstructor;
|
|
51
|
+
required: true;
|
|
52
|
+
};
|
|
53
|
+
parentField: StringConstructor;
|
|
54
|
+
childrenField: StringConstructor;
|
|
55
|
+
treeField: StringConstructor;
|
|
56
|
+
columns: {
|
|
57
|
+
type: PropType<readonly GridColumn<AnyRow>[]>;
|
|
58
|
+
required: true;
|
|
59
|
+
};
|
|
60
|
+
expandedKeys: {
|
|
61
|
+
type: PropType<readonly Key[]>;
|
|
62
|
+
default: () => never[];
|
|
63
|
+
};
|
|
64
|
+
height: StringConstructor;
|
|
65
|
+
selectionMode: PropType<"none" | "single" | "multiple">;
|
|
66
|
+
locale: StringConstructor;
|
|
67
|
+
messages: PropType<Partial<Messages>>;
|
|
68
|
+
theme: PropType<"light" | "dark">;
|
|
69
|
+
density: PropType<"compact" | "normal" | "comfortable">;
|
|
70
|
+
}>> & Readonly<{
|
|
71
|
+
onRowClick?: (payload: {
|
|
72
|
+
readonly row: any;
|
|
73
|
+
readonly key: Key;
|
|
74
|
+
readonly event: MouseEvent;
|
|
75
|
+
}) => any;
|
|
76
|
+
onRowDblClick?: (payload: {
|
|
77
|
+
readonly row: any;
|
|
78
|
+
readonly key: Key;
|
|
79
|
+
readonly event: MouseEvent;
|
|
80
|
+
}) => any;
|
|
81
|
+
onFocusedRowChange?: (payload: {
|
|
82
|
+
readonly row: any;
|
|
83
|
+
readonly key: Key | null;
|
|
84
|
+
}) => any;
|
|
85
|
+
"onUpdate:expandedKeys"?: (keys: readonly Key[]) => any;
|
|
86
|
+
onSelectionChange?: (selection: SelectionState) => any;
|
|
87
|
+
}>, {
|
|
88
|
+
expandedKeys: readonly Key[];
|
|
89
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
90
|
+
|
|
91
|
+
export { RsTreeList };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
import { Key, SelectionState } from '@rastr/core';
|
|
4
|
+
import { GridColumn, Messages, GridEvents } from '@rastr/grid';
|
|
5
|
+
|
|
6
|
+
type AnyRow = any;
|
|
7
|
+
/** Tree list: hierarchical rows (parentField or childrenField) with v-model:expandedKeys. */
|
|
8
|
+
declare const RsTreeList: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
9
|
+
/** The rows; a new array (reference) refreshes the tree. */
|
|
10
|
+
rows: {
|
|
11
|
+
type: PropType<readonly AnyRow[] | (() => readonly AnyRow[] | Promise<readonly AnyRow[]>)>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
keyField: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
parentField: StringConstructor;
|
|
19
|
+
childrenField: StringConstructor;
|
|
20
|
+
treeField: StringConstructor;
|
|
21
|
+
columns: {
|
|
22
|
+
type: PropType<readonly GridColumn<AnyRow>[]>;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
expandedKeys: {
|
|
26
|
+
type: PropType<readonly Key[]>;
|
|
27
|
+
default: () => never[];
|
|
28
|
+
};
|
|
29
|
+
height: StringConstructor;
|
|
30
|
+
selectionMode: PropType<"none" | "single" | "multiple">;
|
|
31
|
+
locale: StringConstructor;
|
|
32
|
+
messages: PropType<Partial<Messages>>;
|
|
33
|
+
theme: PropType<"light" | "dark">;
|
|
34
|
+
density: PropType<"compact" | "normal" | "comfortable">;
|
|
35
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
38
|
+
'update:expandedKeys': (keys: readonly Key[]) => keys is any[];
|
|
39
|
+
rowClick: (payload: GridEvents<AnyRow>["rowClick"]) => boolean;
|
|
40
|
+
rowDblClick: (payload: GridEvents<AnyRow>["rowDblClick"]) => boolean;
|
|
41
|
+
focusedRowChange: (payload: GridEvents<AnyRow>["focusedRowChange"]) => boolean;
|
|
42
|
+
selectionChange: (selection: SelectionState) => boolean;
|
|
43
|
+
}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
44
|
+
/** The rows; a new array (reference) refreshes the tree. */
|
|
45
|
+
rows: {
|
|
46
|
+
type: PropType<readonly AnyRow[] | (() => readonly AnyRow[] | Promise<readonly AnyRow[]>)>;
|
|
47
|
+
required: true;
|
|
48
|
+
};
|
|
49
|
+
keyField: {
|
|
50
|
+
type: StringConstructor;
|
|
51
|
+
required: true;
|
|
52
|
+
};
|
|
53
|
+
parentField: StringConstructor;
|
|
54
|
+
childrenField: StringConstructor;
|
|
55
|
+
treeField: StringConstructor;
|
|
56
|
+
columns: {
|
|
57
|
+
type: PropType<readonly GridColumn<AnyRow>[]>;
|
|
58
|
+
required: true;
|
|
59
|
+
};
|
|
60
|
+
expandedKeys: {
|
|
61
|
+
type: PropType<readonly Key[]>;
|
|
62
|
+
default: () => never[];
|
|
63
|
+
};
|
|
64
|
+
height: StringConstructor;
|
|
65
|
+
selectionMode: PropType<"none" | "single" | "multiple">;
|
|
66
|
+
locale: StringConstructor;
|
|
67
|
+
messages: PropType<Partial<Messages>>;
|
|
68
|
+
theme: PropType<"light" | "dark">;
|
|
69
|
+
density: PropType<"compact" | "normal" | "comfortable">;
|
|
70
|
+
}>> & Readonly<{
|
|
71
|
+
onRowClick?: (payload: {
|
|
72
|
+
readonly row: any;
|
|
73
|
+
readonly key: Key;
|
|
74
|
+
readonly event: MouseEvent;
|
|
75
|
+
}) => any;
|
|
76
|
+
onRowDblClick?: (payload: {
|
|
77
|
+
readonly row: any;
|
|
78
|
+
readonly key: Key;
|
|
79
|
+
readonly event: MouseEvent;
|
|
80
|
+
}) => any;
|
|
81
|
+
onFocusedRowChange?: (payload: {
|
|
82
|
+
readonly row: any;
|
|
83
|
+
readonly key: Key | null;
|
|
84
|
+
}) => any;
|
|
85
|
+
"onUpdate:expandedKeys"?: (keys: readonly Key[]) => any;
|
|
86
|
+
onSelectionChange?: (selection: SelectionState) => any;
|
|
87
|
+
}>, {
|
|
88
|
+
expandedKeys: readonly Key[];
|
|
89
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
90
|
+
|
|
91
|
+
export { RsTreeList };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// src/tree-list/RsTreeList.ts
|
|
2
|
+
import { createTreeList } from "@rastr/tree-list";
|
|
3
|
+
import { defineComponent, h, onBeforeUnmount, onMounted, ref, toRaw, watch } from "vue";
|
|
4
|
+
var sameKeys = (a, b) => a.length === b.length && a.every((key, i) => String(key) === String(b[i]));
|
|
5
|
+
var RsTreeList = defineComponent({
|
|
6
|
+
name: "RsTreeList",
|
|
7
|
+
props: {
|
|
8
|
+
/** The rows; a new array (reference) refreshes the tree. */
|
|
9
|
+
rows: { type: [Array, Function], required: true },
|
|
10
|
+
keyField: { type: String, required: true },
|
|
11
|
+
parentField: String,
|
|
12
|
+
childrenField: String,
|
|
13
|
+
treeField: String,
|
|
14
|
+
columns: { type: Array, required: true },
|
|
15
|
+
expandedKeys: { type: Array, default: () => [] },
|
|
16
|
+
height: String,
|
|
17
|
+
selectionMode: String,
|
|
18
|
+
locale: String,
|
|
19
|
+
messages: Object,
|
|
20
|
+
theme: String,
|
|
21
|
+
density: String
|
|
22
|
+
},
|
|
23
|
+
emits: {
|
|
24
|
+
"update:expandedKeys": (keys) => Array.isArray(keys),
|
|
25
|
+
rowClick: (payload) => payload !== void 0,
|
|
26
|
+
rowDblClick: (payload) => payload !== void 0,
|
|
27
|
+
focusedRowChange: (payload) => payload !== void 0,
|
|
28
|
+
selectionChange: (selection) => selection !== void 0
|
|
29
|
+
},
|
|
30
|
+
setup(props, { emit, expose }) {
|
|
31
|
+
const host = ref(null);
|
|
32
|
+
let tree = null;
|
|
33
|
+
let unsubscribe = null;
|
|
34
|
+
const create = () => {
|
|
35
|
+
if (!host.value) return;
|
|
36
|
+
const expanded = tree ? tree.getExpandedKeys() : toRaw(props.expandedKeys);
|
|
37
|
+
destroy();
|
|
38
|
+
tree = createTreeList(host.value, {
|
|
39
|
+
// Read on every load, so a refresh sees the latest rows prop.
|
|
40
|
+
rows: () => {
|
|
41
|
+
const rows = toRaw(props.rows);
|
|
42
|
+
return typeof rows === "function" ? rows() : rows;
|
|
43
|
+
},
|
|
44
|
+
keyField: props.keyField,
|
|
45
|
+
columns: toRaw(props.columns),
|
|
46
|
+
expandedKeys: expanded,
|
|
47
|
+
onExpandedChange: (keys) => emit("update:expandedKeys", keys),
|
|
48
|
+
...props.parentField ? { parentField: props.parentField } : {},
|
|
49
|
+
...props.childrenField ? { childrenField: props.childrenField } : {},
|
|
50
|
+
...props.treeField ? { treeField: props.treeField } : {},
|
|
51
|
+
...props.height ? { height: props.height } : {},
|
|
52
|
+
...props.selectionMode ? { selectionMode: props.selectionMode } : {},
|
|
53
|
+
...props.locale ? { locale: props.locale } : {},
|
|
54
|
+
...props.messages ? { messages: props.messages } : {},
|
|
55
|
+
...props.theme ? { theme: props.theme } : {},
|
|
56
|
+
...props.density ? { density: props.density } : {}
|
|
57
|
+
});
|
|
58
|
+
tree.grid.on("rowClick", (payload) => emit("rowClick", payload));
|
|
59
|
+
tree.grid.on("rowDblClick", (payload) => emit("rowDblClick", payload));
|
|
60
|
+
tree.grid.on("focusedRowChange", (payload) => emit("focusedRowChange", payload));
|
|
61
|
+
let selection = tree.store.getSnapshot().state.selection;
|
|
62
|
+
unsubscribe = tree.store.subscribe((snapshot) => {
|
|
63
|
+
if (snapshot.state.selection === selection) return;
|
|
64
|
+
selection = snapshot.state.selection;
|
|
65
|
+
emit("selectionChange", selection);
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
const destroy = () => {
|
|
69
|
+
unsubscribe?.();
|
|
70
|
+
unsubscribe = null;
|
|
71
|
+
tree?.destroy();
|
|
72
|
+
tree = null;
|
|
73
|
+
};
|
|
74
|
+
expose({
|
|
75
|
+
expand: (key) => tree?.expand(key),
|
|
76
|
+
collapse: (key) => tree?.collapse(key),
|
|
77
|
+
expandAll: () => tree?.expandAll(),
|
|
78
|
+
collapseAll: () => tree?.collapseAll(),
|
|
79
|
+
refresh: () => tree?.refresh(),
|
|
80
|
+
get store() {
|
|
81
|
+
return tree?.store ?? null;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
onMounted(create);
|
|
85
|
+
onBeforeUnmount(destroy);
|
|
86
|
+
watch(
|
|
87
|
+
() => props.rows,
|
|
88
|
+
() => void tree?.refresh()
|
|
89
|
+
);
|
|
90
|
+
watch(
|
|
91
|
+
() => props.expandedKeys,
|
|
92
|
+
(keys) => {
|
|
93
|
+
if (!tree || sameKeys(toRaw(keys), tree.getExpandedKeys())) return;
|
|
94
|
+
tree.source.collapseAll();
|
|
95
|
+
toRaw(keys).forEach((key) => tree.source.setExpanded(key, true));
|
|
96
|
+
void tree.store.reload();
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
watch(() => [props.columns, props.keyField, props.parentField, props.childrenField, props.treeField, props.height, props.selectionMode, props.locale, props.messages, props.theme, props.density], create);
|
|
100
|
+
return () => h("div", { ref: host, class: "rs-vue-tree-list" });
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
export {
|
|
104
|
+
RsTreeList
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=tree-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tree-list/RsTreeList.ts"],"sourcesContent":["import type { GridStore, Key, SelectionState } from '@rastr/core';\nimport type { GridColumn, GridEvents, Messages } from '@rastr/grid';\nimport { createTreeList } from '@rastr/tree-list';\nimport type { TreeList } from '@rastr/tree-list';\nimport { defineComponent, h, onBeforeUnmount, onMounted, ref, toRaw, watch } from 'vue';\nimport type { PropType, Ref } from 'vue';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyRow = any;\n\nconst sameKeys = (a: readonly Key[], b: readonly Key[]): boolean => a.length === b.length && a.every((key, i) => String(key) === String(b[i]));\n\n/** Tree list: hierarchical rows (parentField or childrenField) with v-model:expandedKeys. */\nexport const RsTreeList = defineComponent({\n name: 'RsTreeList',\n props: {\n /** The rows; a new array (reference) refreshes the tree. */\n rows: { type: [Array, Function] as PropType<readonly AnyRow[] | (() => readonly AnyRow[] | Promise<readonly AnyRow[]>)>, required: true },\n keyField: { type: String, required: true },\n parentField: String,\n childrenField: String,\n treeField: String,\n columns: { type: Array as PropType<readonly GridColumn<AnyRow>[]>, required: true },\n expandedKeys: { type: Array as PropType<readonly Key[]>, default: () => [] },\n height: String,\n selectionMode: String as PropType<'none' | 'single' | 'multiple'>,\n locale: String,\n messages: Object as PropType<Partial<Messages>>,\n theme: String as PropType<'light' | 'dark'>,\n density: String as PropType<'compact' | 'normal' | 'comfortable'>,\n },\n emits: {\n 'update:expandedKeys': (keys: readonly Key[]) => Array.isArray(keys),\n rowClick: (payload: GridEvents<AnyRow>['rowClick']) => payload !== undefined,\n rowDblClick: (payload: GridEvents<AnyRow>['rowDblClick']) => payload !== undefined,\n focusedRowChange: (payload: GridEvents<AnyRow>['focusedRowChange']) => payload !== undefined,\n selectionChange: (selection: SelectionState) => selection !== undefined,\n },\n setup(props, { emit, expose }) {\n const host: Ref<HTMLElement | null> = ref(null);\n let tree: TreeList<AnyRow> | null = null;\n let unsubscribe: (() => void) | null = null;\n\n const create = (): void => {\n if (!host.value) return;\n const expanded: readonly Key[] = tree ? tree.getExpandedKeys() : toRaw(props.expandedKeys);\n destroy();\n tree = createTreeList<AnyRow>(host.value, {\n // Read on every load, so a refresh sees the latest rows prop.\n rows: () => {\n const rows = toRaw(props.rows);\n return typeof rows === 'function' ? rows() : rows;\n },\n keyField: props.keyField,\n columns: toRaw(props.columns),\n expandedKeys: expanded,\n onExpandedChange: keys => emit('update:expandedKeys', keys),\n ...(props.parentField ? { parentField: props.parentField } : {}),\n ...(props.childrenField ? { childrenField: props.childrenField } : {}),\n ...(props.treeField ? { treeField: props.treeField } : {}),\n ...(props.height ? { height: props.height } : {}),\n ...(props.selectionMode ? { selectionMode: props.selectionMode } : {}),\n ...(props.locale ? { locale: props.locale } : {}),\n ...(props.messages ? { messages: props.messages } : {}),\n ...(props.theme ? { theme: props.theme } : {}),\n ...(props.density ? { density: props.density } : {}),\n });\n tree.grid.on('rowClick', payload => emit('rowClick', payload));\n tree.grid.on('rowDblClick', payload => emit('rowDblClick', payload));\n tree.grid.on('focusedRowChange', payload => emit('focusedRowChange', payload));\n let selection: SelectionState = tree.store.getSnapshot().state.selection;\n unsubscribe = tree.store.subscribe(snapshot => {\n if (snapshot.state.selection === selection) return;\n selection = snapshot.state.selection;\n emit('selectionChange', selection);\n });\n };\n\n const destroy = (): void => {\n unsubscribe?.();\n unsubscribe = null;\n tree?.destroy();\n tree = null;\n };\n\n expose({\n expand: (key: Key) => tree?.expand(key),\n collapse: (key: Key) => tree?.collapse(key),\n expandAll: () => tree?.expandAll(),\n collapseAll: () => tree?.collapseAll(),\n refresh: () => tree?.refresh(),\n get store(): GridStore<AnyRow> | null {\n return tree?.store ?? null;\n },\n });\n\n onMounted(create);\n onBeforeUnmount(destroy);\n watch(\n () => props.rows,\n () => void tree?.refresh(),\n );\n // v-model: its own keys coming back change nothing; other keys replace the expansion.\n watch(\n () => props.expandedKeys,\n keys => {\n if (!tree || sameKeys(toRaw(keys), tree.getExpandedKeys())) return;\n tree.source.collapseAll();\n toRaw(keys).forEach(key => tree!.source.setExpanded(key, true));\n void tree.store.reload();\n },\n );\n watch(() => [props.columns, props.keyField, props.parentField, props.childrenField, props.treeField, props.height, props.selectionMode, props.locale, props.messages, props.theme, props.density], create);\n\n return () => h('div', { ref: host, class: 'rs-vue-tree-list' });\n },\n});\n"],"mappings":";AAEA,SAAS,sBAAsB;AAE/B,SAAS,iBAAiB,GAAG,iBAAiB,WAAW,KAAK,OAAO,aAAa;AAMlF,IAAM,WAAW,CAAC,GAAmB,MAA+B,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,CAAC,KAAK,MAAM,OAAO,GAAG,MAAM,OAAO,EAAE,CAAC,CAAC,CAAC;AAGtI,IAAM,aAAa,gBAAgB;AAAA,EACxC,MAAM;AAAA,EACN,OAAO;AAAA;AAAA,IAEL,MAAM,EAAE,MAAM,CAAC,OAAO,QAAQ,GAA2F,UAAU,KAAK;AAAA,IACxI,UAAU,EAAE,MAAM,QAAQ,UAAU,KAAK;AAAA,IACzC,aAAa;AAAA,IACb,eAAe;AAAA,IACf,WAAW;AAAA,IACX,SAAS,EAAE,MAAM,OAAkD,UAAU,KAAK;AAAA,IAClF,cAAc,EAAE,MAAM,OAAmC,SAAS,MAAM,CAAC,EAAE;AAAA,IAC3E,QAAQ;AAAA,IACR,eAAe;AAAA,IACf,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,OAAO;AAAA,IACP,SAAS;AAAA,EACX;AAAA,EACA,OAAO;AAAA,IACL,uBAAuB,CAAC,SAAyB,MAAM,QAAQ,IAAI;AAAA,IACnE,UAAU,CAAC,YAA4C,YAAY;AAAA,IACnE,aAAa,CAAC,YAA+C,YAAY;AAAA,IACzE,kBAAkB,CAAC,YAAoD,YAAY;AAAA,IACnF,iBAAiB,CAAC,cAA8B,cAAc;AAAA,EAChE;AAAA,EACA,MAAM,OAAO,EAAE,MAAM,OAAO,GAAG;AAC7B,UAAM,OAAgC,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AAO,EAAE,KAAK,MAAM,OAAO,mBAAmB,CAAC;AAAA,EAChE;AACF,CAAC;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,99 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rastr/vue",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
|
+
"description": "Vue 3 components for the Rastr data grid.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"main": "./dist/index.cjs",
|
|
9
|
+
"module": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"default": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"require": {
|
|
18
|
+
"types": "./dist/index.d.cts",
|
|
19
|
+
"default": "./dist/index.cjs"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"./pdf-designer": {
|
|
23
|
+
"import": {
|
|
24
|
+
"types": "./dist/pdf-designer.d.ts",
|
|
25
|
+
"default": "./dist/pdf-designer.js"
|
|
26
|
+
},
|
|
27
|
+
"require": {
|
|
28
|
+
"types": "./dist/pdf-designer.d.cts",
|
|
29
|
+
"default": "./dist/pdf-designer.cjs"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"./tree-list": {
|
|
33
|
+
"import": {
|
|
34
|
+
"types": "./dist/tree-list.d.ts",
|
|
35
|
+
"default": "./dist/tree-list.js"
|
|
36
|
+
},
|
|
37
|
+
"require": {
|
|
38
|
+
"types": "./dist/tree-list.d.cts",
|
|
39
|
+
"default": "./dist/tree-list.cjs"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist"
|
|
45
|
+
],
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"vue": "^3.3.0",
|
|
48
|
+
"@rastr/pdf-designer": "0.1.0-beta.1",
|
|
49
|
+
"@rastr/export-pdf": "0.1.0-beta.1",
|
|
50
|
+
"@rastr/pdf-template": "0.1.0-beta.1",
|
|
51
|
+
"@rastr/tree-list": "0.1.0-beta.1"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@rastr/core": "0.1.0-beta.1",
|
|
55
|
+
"@rastr/grid": "0.1.0-beta.1",
|
|
56
|
+
"@rastr/filter-builder": "0.1.0-beta.1",
|
|
57
|
+
"@rastr/controls": "0.1.0-beta.1"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@playwright/test": "1.48.2",
|
|
61
|
+
"@types/node": "^22",
|
|
62
|
+
"@vitejs/plugin-vue": "^5",
|
|
63
|
+
"@vue/test-utils": "^2.4",
|
|
64
|
+
"jsdom": "^25",
|
|
65
|
+
"tsup": "^8",
|
|
66
|
+
"vite": "^5",
|
|
67
|
+
"vitest": "^2",
|
|
68
|
+
"vue": "^3.5",
|
|
69
|
+
"@rastr/export-pdf": "0.1.0-beta.1",
|
|
70
|
+
"@rastr/pdf-template": "0.1.0-beta.1",
|
|
71
|
+
"@rastr/pdf-designer": "0.1.0-beta.1",
|
|
72
|
+
"@rastr/tree-list": "0.1.0-beta.1"
|
|
73
|
+
},
|
|
74
|
+
"peerDependenciesMeta": {
|
|
75
|
+
"@rastr/pdf-designer": {
|
|
76
|
+
"optional": true
|
|
77
|
+
},
|
|
78
|
+
"@rastr/export-pdf": {
|
|
79
|
+
"optional": true
|
|
80
|
+
},
|
|
81
|
+
"@rastr/pdf-template": {
|
|
82
|
+
"optional": true
|
|
83
|
+
},
|
|
84
|
+
"@rastr/tree-list": {
|
|
85
|
+
"optional": true
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"publishConfig": {
|
|
89
|
+
"access": "public"
|
|
90
|
+
},
|
|
91
|
+
"scripts": {
|
|
92
|
+
"build": "tsup",
|
|
93
|
+
"test": "vitest run",
|
|
94
|
+
"lint": "eslint src test e2e",
|
|
95
|
+
"typecheck": "tsc --noEmit",
|
|
96
|
+
"dev": "vite --config vite.config.ts",
|
|
97
|
+
"e2e": "playwright test --workers=1"
|
|
98
|
+
}
|
|
6
99
|
}
|