@stonecrop/atable 0.3.7 → 0.3.8
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/dist/atable.d.ts +213 -213
- package/dist/atable.js +434 -430
- package/dist/atable.js.map +1 -1
- package/dist/atable.umd.cjs +1 -1
- package/dist/atable.umd.cjs.map +1 -1
- package/dist/src/stores/table.d.ts +213 -213
- package/dist/src/stores/table.d.ts.map +1 -1
- package/dist/stores/table.js +3 -3
- package/package.json +3 -3
- package/src/components/ACell.vue +7 -7
- package/src/components/ARow.vue +4 -3
- package/src/stores/table.ts +5 -3
|
@@ -19,92 +19,92 @@ export declare const createTableStore: (initData: {
|
|
|
19
19
|
}) => import("pinia").Store<`table-${string}`, Pick<{
|
|
20
20
|
columns: import("vue").Ref<{
|
|
21
21
|
name: string;
|
|
22
|
-
align?: CanvasTextAlign;
|
|
23
|
-
edit?: boolean;
|
|
24
|
-
label?: string;
|
|
25
|
-
type?: string;
|
|
26
|
-
width?: string;
|
|
27
|
-
pinned?: boolean;
|
|
28
|
-
cellComponent?: string;
|
|
29
|
-
cellComponentProps?: Record<string, any
|
|
30
|
-
modalComponent?: string | ((context: CellContext) => string);
|
|
31
|
-
modalComponentExtraProps?: Record<string, any
|
|
32
|
-
format?: string | ((value: any, context: CellContext) => string);
|
|
33
|
-
mask?: (value: any) => any;
|
|
22
|
+
align?: CanvasTextAlign | undefined;
|
|
23
|
+
edit?: boolean | undefined;
|
|
24
|
+
label?: string | undefined;
|
|
25
|
+
type?: string | undefined;
|
|
26
|
+
width?: string | undefined;
|
|
27
|
+
pinned?: boolean | undefined;
|
|
28
|
+
cellComponent?: string | undefined;
|
|
29
|
+
cellComponentProps?: Record<string, any> | undefined;
|
|
30
|
+
modalComponent?: string | ((context: CellContext) => string) | undefined;
|
|
31
|
+
modalComponentExtraProps?: Record<string, any> | undefined;
|
|
32
|
+
format?: string | ((value: any, context: CellContext) => string) | undefined;
|
|
33
|
+
mask?: ((value: any) => any) | undefined;
|
|
34
34
|
}[], TableColumn[] | {
|
|
35
35
|
name: string;
|
|
36
|
-
align?: CanvasTextAlign;
|
|
37
|
-
edit?: boolean;
|
|
38
|
-
label?: string;
|
|
39
|
-
type?: string;
|
|
40
|
-
width?: string;
|
|
41
|
-
pinned?: boolean;
|
|
42
|
-
cellComponent?: string;
|
|
43
|
-
cellComponentProps?: Record<string, any
|
|
44
|
-
modalComponent?: string | ((context: CellContext) => string);
|
|
45
|
-
modalComponentExtraProps?: Record<string, any
|
|
46
|
-
format?: string | ((value: any, context: CellContext) => string);
|
|
47
|
-
mask?: (value: any) => any;
|
|
36
|
+
align?: CanvasTextAlign | undefined;
|
|
37
|
+
edit?: boolean | undefined;
|
|
38
|
+
label?: string | undefined;
|
|
39
|
+
type?: string | undefined;
|
|
40
|
+
width?: string | undefined;
|
|
41
|
+
pinned?: boolean | undefined;
|
|
42
|
+
cellComponent?: string | undefined;
|
|
43
|
+
cellComponentProps?: Record<string, any> | undefined;
|
|
44
|
+
modalComponent?: string | ((context: CellContext) => string) | undefined;
|
|
45
|
+
modalComponentExtraProps?: Record<string, any> | undefined;
|
|
46
|
+
format?: string | ((value: any, context: CellContext) => string) | undefined;
|
|
47
|
+
mask?: ((value: any) => any) | undefined;
|
|
48
48
|
}[]>;
|
|
49
49
|
config: import("vue").Ref<{
|
|
50
|
-
view?: "uncounted" | "list" | "list-expansion" | "tree";
|
|
51
|
-
fullWidth?: boolean;
|
|
50
|
+
view?: "uncounted" | "list" | "list-expansion" | "tree" | undefined;
|
|
51
|
+
fullWidth?: boolean | undefined;
|
|
52
52
|
}, TableConfig | {
|
|
53
|
-
view?: "uncounted" | "list" | "list-expansion" | "tree";
|
|
54
|
-
fullWidth?: boolean;
|
|
53
|
+
view?: "uncounted" | "list" | "list-expansion" | "tree" | undefined;
|
|
54
|
+
fullWidth?: boolean | undefined;
|
|
55
55
|
}>;
|
|
56
56
|
display: import("vue").Ref<{
|
|
57
|
-
childrenOpen?: boolean;
|
|
58
|
-
expanded?: boolean;
|
|
59
|
-
indent?: number;
|
|
60
|
-
isParent?: boolean;
|
|
61
|
-
isRoot?: boolean;
|
|
62
|
-
open?: boolean;
|
|
63
|
-
parent?: number;
|
|
64
|
-
rowModified?: boolean;
|
|
57
|
+
childrenOpen?: boolean | undefined;
|
|
58
|
+
expanded?: boolean | undefined;
|
|
59
|
+
indent?: number | undefined;
|
|
60
|
+
isParent?: boolean | undefined;
|
|
61
|
+
isRoot?: boolean | undefined;
|
|
62
|
+
open?: boolean | undefined;
|
|
63
|
+
parent?: number | undefined;
|
|
64
|
+
rowModified?: boolean | undefined;
|
|
65
65
|
}[], TableDisplay[] | {
|
|
66
|
-
childrenOpen?: boolean;
|
|
67
|
-
expanded?: boolean;
|
|
68
|
-
indent?: number;
|
|
69
|
-
isParent?: boolean;
|
|
70
|
-
isRoot?: boolean;
|
|
71
|
-
open?: boolean;
|
|
72
|
-
parent?: number;
|
|
73
|
-
rowModified?: boolean;
|
|
66
|
+
childrenOpen?: boolean | undefined;
|
|
67
|
+
expanded?: boolean | undefined;
|
|
68
|
+
indent?: number | undefined;
|
|
69
|
+
isParent?: boolean | undefined;
|
|
70
|
+
isRoot?: boolean | undefined;
|
|
71
|
+
open?: boolean | undefined;
|
|
72
|
+
parent?: number | undefined;
|
|
73
|
+
rowModified?: boolean | undefined;
|
|
74
74
|
}[]>;
|
|
75
75
|
modal: import("vue").Ref<{
|
|
76
|
-
colIndex?: number;
|
|
77
|
-
event?: string;
|
|
78
|
-
height?: number;
|
|
79
|
-
left?: number;
|
|
80
|
-
parent?: HTMLElement;
|
|
81
|
-
rowIndex?: number;
|
|
82
|
-
top?: number;
|
|
83
|
-
visible?: boolean;
|
|
84
|
-
width?: number;
|
|
85
|
-
component?: string;
|
|
86
|
-
componentProps?: Record<string, any
|
|
76
|
+
colIndex?: number | undefined;
|
|
77
|
+
event?: string | undefined;
|
|
78
|
+
height?: number | undefined;
|
|
79
|
+
left?: number | undefined;
|
|
80
|
+
parent?: HTMLElement | undefined;
|
|
81
|
+
rowIndex?: number | undefined;
|
|
82
|
+
top?: number | undefined;
|
|
83
|
+
visible?: boolean | undefined;
|
|
84
|
+
width?: number | undefined;
|
|
85
|
+
component?: string | undefined;
|
|
86
|
+
componentProps?: Record<string, any> | undefined;
|
|
87
87
|
}, TableModal | {
|
|
88
|
-
colIndex?: number;
|
|
89
|
-
event?: string;
|
|
90
|
-
height?: number;
|
|
91
|
-
left?: number;
|
|
92
|
-
parent?: HTMLElement;
|
|
93
|
-
rowIndex?: number;
|
|
94
|
-
top?: number;
|
|
95
|
-
visible?: boolean;
|
|
96
|
-
width?: number;
|
|
97
|
-
component?: string;
|
|
98
|
-
componentProps?: Record<string, any
|
|
88
|
+
colIndex?: number | undefined;
|
|
89
|
+
event?: string | undefined;
|
|
90
|
+
height?: number | undefined;
|
|
91
|
+
left?: number | undefined;
|
|
92
|
+
parent?: HTMLElement | undefined;
|
|
93
|
+
rowIndex?: number | undefined;
|
|
94
|
+
top?: number | undefined;
|
|
95
|
+
visible?: boolean | undefined;
|
|
96
|
+
width?: number | undefined;
|
|
97
|
+
component?: string | undefined;
|
|
98
|
+
componentProps?: Record<string, any> | undefined;
|
|
99
99
|
}>;
|
|
100
100
|
rows: import("vue").Ref<{
|
|
101
101
|
[x: string]: any;
|
|
102
|
-
indent?: number;
|
|
103
|
-
parent?: number;
|
|
102
|
+
indent?: number | undefined;
|
|
103
|
+
parent?: number | undefined;
|
|
104
104
|
}[], TableRow[] | {
|
|
105
105
|
[x: string]: any;
|
|
106
|
-
indent?: number;
|
|
107
|
-
parent?: number;
|
|
106
|
+
indent?: number | undefined;
|
|
107
|
+
parent?: number | undefined;
|
|
108
108
|
}[]>;
|
|
109
109
|
table: import("vue").Ref<{}, {}>;
|
|
110
110
|
updates: import("vue").Ref<Record<string, string>, Record<string, string>>;
|
|
@@ -118,99 +118,99 @@ export declare const createTableStore: (initData: {
|
|
|
118
118
|
getHeaderCellStyle: (column: TableColumn) => CSSProperties;
|
|
119
119
|
getIndent: (colIndex: number, indentLevel?: number) => string;
|
|
120
120
|
getRowExpandSymbol: (rowIndex: number) => "" | "-" | "+";
|
|
121
|
-
isRowVisible: (rowIndex: number) => boolean;
|
|
121
|
+
isRowVisible: (rowIndex: number) => boolean | undefined;
|
|
122
122
|
setCellData: (colIndex: number, rowIndex: number, value: any) => void;
|
|
123
123
|
setCellText: (colIndex: number, rowIndex: number, value: string) => void;
|
|
124
124
|
toggleRowExpand: (rowIndex: number) => void;
|
|
125
125
|
}, "columns" | "config" | "display" | "modal" | "rows" | "table" | "updates">, Pick<{
|
|
126
126
|
columns: import("vue").Ref<{
|
|
127
127
|
name: string;
|
|
128
|
-
align?: CanvasTextAlign;
|
|
129
|
-
edit?: boolean;
|
|
130
|
-
label?: string;
|
|
131
|
-
type?: string;
|
|
132
|
-
width?: string;
|
|
133
|
-
pinned?: boolean;
|
|
134
|
-
cellComponent?: string;
|
|
135
|
-
cellComponentProps?: Record<string, any
|
|
136
|
-
modalComponent?: string | ((context: CellContext) => string);
|
|
137
|
-
modalComponentExtraProps?: Record<string, any
|
|
138
|
-
format?: string | ((value: any, context: CellContext) => string);
|
|
139
|
-
mask?: (value: any) => any;
|
|
128
|
+
align?: CanvasTextAlign | undefined;
|
|
129
|
+
edit?: boolean | undefined;
|
|
130
|
+
label?: string | undefined;
|
|
131
|
+
type?: string | undefined;
|
|
132
|
+
width?: string | undefined;
|
|
133
|
+
pinned?: boolean | undefined;
|
|
134
|
+
cellComponent?: string | undefined;
|
|
135
|
+
cellComponentProps?: Record<string, any> | undefined;
|
|
136
|
+
modalComponent?: string | ((context: CellContext) => string) | undefined;
|
|
137
|
+
modalComponentExtraProps?: Record<string, any> | undefined;
|
|
138
|
+
format?: string | ((value: any, context: CellContext) => string) | undefined;
|
|
139
|
+
mask?: ((value: any) => any) | undefined;
|
|
140
140
|
}[], TableColumn[] | {
|
|
141
141
|
name: string;
|
|
142
|
-
align?: CanvasTextAlign;
|
|
143
|
-
edit?: boolean;
|
|
144
|
-
label?: string;
|
|
145
|
-
type?: string;
|
|
146
|
-
width?: string;
|
|
147
|
-
pinned?: boolean;
|
|
148
|
-
cellComponent?: string;
|
|
149
|
-
cellComponentProps?: Record<string, any
|
|
150
|
-
modalComponent?: string | ((context: CellContext) => string);
|
|
151
|
-
modalComponentExtraProps?: Record<string, any
|
|
152
|
-
format?: string | ((value: any, context: CellContext) => string);
|
|
153
|
-
mask?: (value: any) => any;
|
|
142
|
+
align?: CanvasTextAlign | undefined;
|
|
143
|
+
edit?: boolean | undefined;
|
|
144
|
+
label?: string | undefined;
|
|
145
|
+
type?: string | undefined;
|
|
146
|
+
width?: string | undefined;
|
|
147
|
+
pinned?: boolean | undefined;
|
|
148
|
+
cellComponent?: string | undefined;
|
|
149
|
+
cellComponentProps?: Record<string, any> | undefined;
|
|
150
|
+
modalComponent?: string | ((context: CellContext) => string) | undefined;
|
|
151
|
+
modalComponentExtraProps?: Record<string, any> | undefined;
|
|
152
|
+
format?: string | ((value: any, context: CellContext) => string) | undefined;
|
|
153
|
+
mask?: ((value: any) => any) | undefined;
|
|
154
154
|
}[]>;
|
|
155
155
|
config: import("vue").Ref<{
|
|
156
|
-
view?: "uncounted" | "list" | "list-expansion" | "tree";
|
|
157
|
-
fullWidth?: boolean;
|
|
156
|
+
view?: "uncounted" | "list" | "list-expansion" | "tree" | undefined;
|
|
157
|
+
fullWidth?: boolean | undefined;
|
|
158
158
|
}, TableConfig | {
|
|
159
|
-
view?: "uncounted" | "list" | "list-expansion" | "tree";
|
|
160
|
-
fullWidth?: boolean;
|
|
159
|
+
view?: "uncounted" | "list" | "list-expansion" | "tree" | undefined;
|
|
160
|
+
fullWidth?: boolean | undefined;
|
|
161
161
|
}>;
|
|
162
162
|
display: import("vue").Ref<{
|
|
163
|
-
childrenOpen?: boolean;
|
|
164
|
-
expanded?: boolean;
|
|
165
|
-
indent?: number;
|
|
166
|
-
isParent?: boolean;
|
|
167
|
-
isRoot?: boolean;
|
|
168
|
-
open?: boolean;
|
|
169
|
-
parent?: number;
|
|
170
|
-
rowModified?: boolean;
|
|
163
|
+
childrenOpen?: boolean | undefined;
|
|
164
|
+
expanded?: boolean | undefined;
|
|
165
|
+
indent?: number | undefined;
|
|
166
|
+
isParent?: boolean | undefined;
|
|
167
|
+
isRoot?: boolean | undefined;
|
|
168
|
+
open?: boolean | undefined;
|
|
169
|
+
parent?: number | undefined;
|
|
170
|
+
rowModified?: boolean | undefined;
|
|
171
171
|
}[], TableDisplay[] | {
|
|
172
|
-
childrenOpen?: boolean;
|
|
173
|
-
expanded?: boolean;
|
|
174
|
-
indent?: number;
|
|
175
|
-
isParent?: boolean;
|
|
176
|
-
isRoot?: boolean;
|
|
177
|
-
open?: boolean;
|
|
178
|
-
parent?: number;
|
|
179
|
-
rowModified?: boolean;
|
|
172
|
+
childrenOpen?: boolean | undefined;
|
|
173
|
+
expanded?: boolean | undefined;
|
|
174
|
+
indent?: number | undefined;
|
|
175
|
+
isParent?: boolean | undefined;
|
|
176
|
+
isRoot?: boolean | undefined;
|
|
177
|
+
open?: boolean | undefined;
|
|
178
|
+
parent?: number | undefined;
|
|
179
|
+
rowModified?: boolean | undefined;
|
|
180
180
|
}[]>;
|
|
181
181
|
modal: import("vue").Ref<{
|
|
182
|
-
colIndex?: number;
|
|
183
|
-
event?: string;
|
|
184
|
-
height?: number;
|
|
185
|
-
left?: number;
|
|
186
|
-
parent?: HTMLElement;
|
|
187
|
-
rowIndex?: number;
|
|
188
|
-
top?: number;
|
|
189
|
-
visible?: boolean;
|
|
190
|
-
width?: number;
|
|
191
|
-
component?: string;
|
|
192
|
-
componentProps?: Record<string, any
|
|
182
|
+
colIndex?: number | undefined;
|
|
183
|
+
event?: string | undefined;
|
|
184
|
+
height?: number | undefined;
|
|
185
|
+
left?: number | undefined;
|
|
186
|
+
parent?: HTMLElement | undefined;
|
|
187
|
+
rowIndex?: number | undefined;
|
|
188
|
+
top?: number | undefined;
|
|
189
|
+
visible?: boolean | undefined;
|
|
190
|
+
width?: number | undefined;
|
|
191
|
+
component?: string | undefined;
|
|
192
|
+
componentProps?: Record<string, any> | undefined;
|
|
193
193
|
}, TableModal | {
|
|
194
|
-
colIndex?: number;
|
|
195
|
-
event?: string;
|
|
196
|
-
height?: number;
|
|
197
|
-
left?: number;
|
|
198
|
-
parent?: HTMLElement;
|
|
199
|
-
rowIndex?: number;
|
|
200
|
-
top?: number;
|
|
201
|
-
visible?: boolean;
|
|
202
|
-
width?: number;
|
|
203
|
-
component?: string;
|
|
204
|
-
componentProps?: Record<string, any
|
|
194
|
+
colIndex?: number | undefined;
|
|
195
|
+
event?: string | undefined;
|
|
196
|
+
height?: number | undefined;
|
|
197
|
+
left?: number | undefined;
|
|
198
|
+
parent?: HTMLElement | undefined;
|
|
199
|
+
rowIndex?: number | undefined;
|
|
200
|
+
top?: number | undefined;
|
|
201
|
+
visible?: boolean | undefined;
|
|
202
|
+
width?: number | undefined;
|
|
203
|
+
component?: string | undefined;
|
|
204
|
+
componentProps?: Record<string, any> | undefined;
|
|
205
205
|
}>;
|
|
206
206
|
rows: import("vue").Ref<{
|
|
207
207
|
[x: string]: any;
|
|
208
|
-
indent?: number;
|
|
209
|
-
parent?: number;
|
|
208
|
+
indent?: number | undefined;
|
|
209
|
+
parent?: number | undefined;
|
|
210
210
|
}[], TableRow[] | {
|
|
211
211
|
[x: string]: any;
|
|
212
|
-
indent?: number;
|
|
213
|
-
parent?: number;
|
|
212
|
+
indent?: number | undefined;
|
|
213
|
+
parent?: number | undefined;
|
|
214
214
|
}[]>;
|
|
215
215
|
table: import("vue").Ref<{}, {}>;
|
|
216
216
|
updates: import("vue").Ref<Record<string, string>, Record<string, string>>;
|
|
@@ -224,99 +224,99 @@ export declare const createTableStore: (initData: {
|
|
|
224
224
|
getHeaderCellStyle: (column: TableColumn) => CSSProperties;
|
|
225
225
|
getIndent: (colIndex: number, indentLevel?: number) => string;
|
|
226
226
|
getRowExpandSymbol: (rowIndex: number) => "" | "-" | "+";
|
|
227
|
-
isRowVisible: (rowIndex: number) => boolean;
|
|
227
|
+
isRowVisible: (rowIndex: number) => boolean | undefined;
|
|
228
228
|
setCellData: (colIndex: number, rowIndex: number, value: any) => void;
|
|
229
229
|
setCellText: (colIndex: number, rowIndex: number, value: string) => void;
|
|
230
230
|
toggleRowExpand: (rowIndex: number) => void;
|
|
231
231
|
}, "hasPinnedColumns" | "numberedRowWidth" | "zeroColumn">, Pick<{
|
|
232
232
|
columns: import("vue").Ref<{
|
|
233
233
|
name: string;
|
|
234
|
-
align?: CanvasTextAlign;
|
|
235
|
-
edit?: boolean;
|
|
236
|
-
label?: string;
|
|
237
|
-
type?: string;
|
|
238
|
-
width?: string;
|
|
239
|
-
pinned?: boolean;
|
|
240
|
-
cellComponent?: string;
|
|
241
|
-
cellComponentProps?: Record<string, any
|
|
242
|
-
modalComponent?: string | ((context: CellContext) => string);
|
|
243
|
-
modalComponentExtraProps?: Record<string, any
|
|
244
|
-
format?: string | ((value: any, context: CellContext) => string);
|
|
245
|
-
mask?: (value: any) => any;
|
|
234
|
+
align?: CanvasTextAlign | undefined;
|
|
235
|
+
edit?: boolean | undefined;
|
|
236
|
+
label?: string | undefined;
|
|
237
|
+
type?: string | undefined;
|
|
238
|
+
width?: string | undefined;
|
|
239
|
+
pinned?: boolean | undefined;
|
|
240
|
+
cellComponent?: string | undefined;
|
|
241
|
+
cellComponentProps?: Record<string, any> | undefined;
|
|
242
|
+
modalComponent?: string | ((context: CellContext) => string) | undefined;
|
|
243
|
+
modalComponentExtraProps?: Record<string, any> | undefined;
|
|
244
|
+
format?: string | ((value: any, context: CellContext) => string) | undefined;
|
|
245
|
+
mask?: ((value: any) => any) | undefined;
|
|
246
246
|
}[], TableColumn[] | {
|
|
247
247
|
name: string;
|
|
248
|
-
align?: CanvasTextAlign;
|
|
249
|
-
edit?: boolean;
|
|
250
|
-
label?: string;
|
|
251
|
-
type?: string;
|
|
252
|
-
width?: string;
|
|
253
|
-
pinned?: boolean;
|
|
254
|
-
cellComponent?: string;
|
|
255
|
-
cellComponentProps?: Record<string, any
|
|
256
|
-
modalComponent?: string | ((context: CellContext) => string);
|
|
257
|
-
modalComponentExtraProps?: Record<string, any
|
|
258
|
-
format?: string | ((value: any, context: CellContext) => string);
|
|
259
|
-
mask?: (value: any) => any;
|
|
248
|
+
align?: CanvasTextAlign | undefined;
|
|
249
|
+
edit?: boolean | undefined;
|
|
250
|
+
label?: string | undefined;
|
|
251
|
+
type?: string | undefined;
|
|
252
|
+
width?: string | undefined;
|
|
253
|
+
pinned?: boolean | undefined;
|
|
254
|
+
cellComponent?: string | undefined;
|
|
255
|
+
cellComponentProps?: Record<string, any> | undefined;
|
|
256
|
+
modalComponent?: string | ((context: CellContext) => string) | undefined;
|
|
257
|
+
modalComponentExtraProps?: Record<string, any> | undefined;
|
|
258
|
+
format?: string | ((value: any, context: CellContext) => string) | undefined;
|
|
259
|
+
mask?: ((value: any) => any) | undefined;
|
|
260
260
|
}[]>;
|
|
261
261
|
config: import("vue").Ref<{
|
|
262
|
-
view?: "uncounted" | "list" | "list-expansion" | "tree";
|
|
263
|
-
fullWidth?: boolean;
|
|
262
|
+
view?: "uncounted" | "list" | "list-expansion" | "tree" | undefined;
|
|
263
|
+
fullWidth?: boolean | undefined;
|
|
264
264
|
}, TableConfig | {
|
|
265
|
-
view?: "uncounted" | "list" | "list-expansion" | "tree";
|
|
266
|
-
fullWidth?: boolean;
|
|
265
|
+
view?: "uncounted" | "list" | "list-expansion" | "tree" | undefined;
|
|
266
|
+
fullWidth?: boolean | undefined;
|
|
267
267
|
}>;
|
|
268
268
|
display: import("vue").Ref<{
|
|
269
|
-
childrenOpen?: boolean;
|
|
270
|
-
expanded?: boolean;
|
|
271
|
-
indent?: number;
|
|
272
|
-
isParent?: boolean;
|
|
273
|
-
isRoot?: boolean;
|
|
274
|
-
open?: boolean;
|
|
275
|
-
parent?: number;
|
|
276
|
-
rowModified?: boolean;
|
|
269
|
+
childrenOpen?: boolean | undefined;
|
|
270
|
+
expanded?: boolean | undefined;
|
|
271
|
+
indent?: number | undefined;
|
|
272
|
+
isParent?: boolean | undefined;
|
|
273
|
+
isRoot?: boolean | undefined;
|
|
274
|
+
open?: boolean | undefined;
|
|
275
|
+
parent?: number | undefined;
|
|
276
|
+
rowModified?: boolean | undefined;
|
|
277
277
|
}[], TableDisplay[] | {
|
|
278
|
-
childrenOpen?: boolean;
|
|
279
|
-
expanded?: boolean;
|
|
280
|
-
indent?: number;
|
|
281
|
-
isParent?: boolean;
|
|
282
|
-
isRoot?: boolean;
|
|
283
|
-
open?: boolean;
|
|
284
|
-
parent?: number;
|
|
285
|
-
rowModified?: boolean;
|
|
278
|
+
childrenOpen?: boolean | undefined;
|
|
279
|
+
expanded?: boolean | undefined;
|
|
280
|
+
indent?: number | undefined;
|
|
281
|
+
isParent?: boolean | undefined;
|
|
282
|
+
isRoot?: boolean | undefined;
|
|
283
|
+
open?: boolean | undefined;
|
|
284
|
+
parent?: number | undefined;
|
|
285
|
+
rowModified?: boolean | undefined;
|
|
286
286
|
}[]>;
|
|
287
287
|
modal: import("vue").Ref<{
|
|
288
|
-
colIndex?: number;
|
|
289
|
-
event?: string;
|
|
290
|
-
height?: number;
|
|
291
|
-
left?: number;
|
|
292
|
-
parent?: HTMLElement;
|
|
293
|
-
rowIndex?: number;
|
|
294
|
-
top?: number;
|
|
295
|
-
visible?: boolean;
|
|
296
|
-
width?: number;
|
|
297
|
-
component?: string;
|
|
298
|
-
componentProps?: Record<string, any
|
|
288
|
+
colIndex?: number | undefined;
|
|
289
|
+
event?: string | undefined;
|
|
290
|
+
height?: number | undefined;
|
|
291
|
+
left?: number | undefined;
|
|
292
|
+
parent?: HTMLElement | undefined;
|
|
293
|
+
rowIndex?: number | undefined;
|
|
294
|
+
top?: number | undefined;
|
|
295
|
+
visible?: boolean | undefined;
|
|
296
|
+
width?: number | undefined;
|
|
297
|
+
component?: string | undefined;
|
|
298
|
+
componentProps?: Record<string, any> | undefined;
|
|
299
299
|
}, TableModal | {
|
|
300
|
-
colIndex?: number;
|
|
301
|
-
event?: string;
|
|
302
|
-
height?: number;
|
|
303
|
-
left?: number;
|
|
304
|
-
parent?: HTMLElement;
|
|
305
|
-
rowIndex?: number;
|
|
306
|
-
top?: number;
|
|
307
|
-
visible?: boolean;
|
|
308
|
-
width?: number;
|
|
309
|
-
component?: string;
|
|
310
|
-
componentProps?: Record<string, any
|
|
300
|
+
colIndex?: number | undefined;
|
|
301
|
+
event?: string | undefined;
|
|
302
|
+
height?: number | undefined;
|
|
303
|
+
left?: number | undefined;
|
|
304
|
+
parent?: HTMLElement | undefined;
|
|
305
|
+
rowIndex?: number | undefined;
|
|
306
|
+
top?: number | undefined;
|
|
307
|
+
visible?: boolean | undefined;
|
|
308
|
+
width?: number | undefined;
|
|
309
|
+
component?: string | undefined;
|
|
310
|
+
componentProps?: Record<string, any> | undefined;
|
|
311
311
|
}>;
|
|
312
312
|
rows: import("vue").Ref<{
|
|
313
313
|
[x: string]: any;
|
|
314
|
-
indent?: number;
|
|
315
|
-
parent?: number;
|
|
314
|
+
indent?: number | undefined;
|
|
315
|
+
parent?: number | undefined;
|
|
316
316
|
}[], TableRow[] | {
|
|
317
317
|
[x: string]: any;
|
|
318
|
-
indent?: number;
|
|
319
|
-
parent?: number;
|
|
318
|
+
indent?: number | undefined;
|
|
319
|
+
parent?: number | undefined;
|
|
320
320
|
}[]>;
|
|
321
321
|
table: import("vue").Ref<{}, {}>;
|
|
322
322
|
updates: import("vue").Ref<Record<string, string>, Record<string, string>>;
|
|
@@ -330,7 +330,7 @@ export declare const createTableStore: (initData: {
|
|
|
330
330
|
getHeaderCellStyle: (column: TableColumn) => CSSProperties;
|
|
331
331
|
getIndent: (colIndex: number, indentLevel?: number) => string;
|
|
332
332
|
getRowExpandSymbol: (rowIndex: number) => "" | "-" | "+";
|
|
333
|
-
isRowVisible: (rowIndex: number) => boolean;
|
|
333
|
+
isRowVisible: (rowIndex: number) => boolean | undefined;
|
|
334
334
|
setCellData: (colIndex: number, rowIndex: number, value: any) => void;
|
|
335
335
|
setCellText: (colIndex: number, rowIndex: number, value: string) => void;
|
|
336
336
|
toggleRowExpand: (rowIndex: number) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/stores/table.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,KAAK,CAAA;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEzG;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,aAAc;IAC1C,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,IAAI,EAAE,QAAQ,EAAE,CAAA;IAChB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAA;IAC9B,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB,KAAK,CAAC,EAAE,UAAU,CAAA;CAClB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/stores/table.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,KAAK,CAAA;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEzG;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,aAAc;IAC1C,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,IAAI,EAAE,QAAQ,EAAE,CAAA;IAChB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAA;IAC9B,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB,KAAK,CAAC,EAAE,UAAU,CAAA;CAClB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA+J4B,UAAU;kBAtFhB,CAAC,kBAAkB,MAAM,YAAY,MAAM,KAAG,CAAC;oCA4D7B,MAAM,YAAY,MAAM;kCAK1B,MAAM,YAAY,MAAM,SAAS,GAAG;iCA3CrC,WAAW,KAAG,aAAa;0BA0ElC,MAAM,gBAAgB,MAAM;mCAhEnB,MAAM;6BAJZ,MAAM;4BA3BP,MAAM,YAAY,MAAM,SAAS,GAAG;4BAYpC,MAAM,YAAY,MAAM,SAAS,MAAM;gCA+BnC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0Cd,UAAU;kBAtFhB,CAAC,kBAAkB,MAAM,YAAY,MAAM,KAAG,CAAC;oCA4D7B,MAAM,YAAY,MAAM;kCAK1B,MAAM,YAAY,MAAM,SAAS,GAAG;iCA3CrC,WAAW,KAAG,aAAa;0BA0ElC,MAAM,gBAAgB,MAAM;mCAhEnB,MAAM;6BAJZ,MAAM;4BA3BP,MAAM,YAAY,MAAM,SAAS,GAAG;4BAYpC,MAAM,YAAY,MAAM,SAAS,MAAM;gCA+BnC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0Cd,UAAU;kBAtFhB,CAAC,kBAAkB,MAAM,YAAY,MAAM,KAAG,CAAC;oCA4D7B,MAAM,YAAY,MAAM;kCAK1B,MAAM,YAAY,MAAM,SAAS,GAAG;iCA3CrC,WAAW,KAAG,aAAa;0BA0ElC,MAAM,gBAAgB,MAAM;mCAhEnB,MAAM;6BAJZ,MAAM;4BA3BP,MAAM,YAAY,MAAM,SAAS,GAAG;4BAYpC,MAAM,YAAY,MAAM,SAAS,MAAM;gCA+BnC,MAAM;gNA2F1C,CAAA"}
|
package/dist/stores/table.js
CHANGED
|
@@ -41,7 +41,7 @@ export const createTableStore = (initData) => {
|
|
|
41
41
|
defaultDisplay[rowIndex] = {
|
|
42
42
|
childrenOpen: false,
|
|
43
43
|
expanded: false,
|
|
44
|
-
indent: row.indent ||
|
|
44
|
+
indent: row.indent || 0,
|
|
45
45
|
isParent: parents.has(rowIndex),
|
|
46
46
|
isRoot: row.parent === null || row.parent === undefined,
|
|
47
47
|
rowModified: false,
|
|
@@ -65,7 +65,7 @@ export const createTableStore = (initData) => {
|
|
|
65
65
|
const indent = Math.ceil(rows.value.length / 100 + 1);
|
|
66
66
|
return `${indent}ch`;
|
|
67
67
|
});
|
|
68
|
-
const zeroColumn = computed(() => ['list', 'tree', 'list-expansion'].includes(config.value.view));
|
|
68
|
+
const zeroColumn = computed(() => config.value.view ? ['list', 'tree', 'list-expansion'].includes(config.value.view) : false);
|
|
69
69
|
// actions
|
|
70
70
|
const getCellData = (colIndex, rowIndex) => table.value[`${colIndex}:${rowIndex}`];
|
|
71
71
|
const setCellData = (colIndex, rowIndex, value) => {
|
|
@@ -87,7 +87,7 @@ export const createTableStore = (initData) => {
|
|
|
87
87
|
const getHeaderCellStyle = (column) => ({
|
|
88
88
|
minWidth: column.width || '40ch',
|
|
89
89
|
textAlign: column.align || 'center',
|
|
90
|
-
width: config.value.fullWidth ? 'auto' :
|
|
90
|
+
width: config.value.fullWidth ? 'auto' : undefined,
|
|
91
91
|
});
|
|
92
92
|
const isRowVisible = (rowIndex) => {
|
|
93
93
|
return config.value.view !== 'tree' || display.value[rowIndex].isRoot || display.value[rowIndex].open;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stonecrop/atable",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@vueuse/core": "^12.0.0",
|
|
39
39
|
"pinia": "^2.3.0",
|
|
40
40
|
"vue": "^3.5.11",
|
|
41
|
-
"@stonecrop/
|
|
42
|
-
"@stonecrop/
|
|
41
|
+
"@stonecrop/themes": "0.3.8",
|
|
42
|
+
"@stonecrop/utilities": "0.3.8"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@microsoft/api-documenter": "^7.26.2",
|
package/src/components/ACell.vue
CHANGED
|
@@ -90,9 +90,9 @@ const showModal = () => {
|
|
|
90
90
|
state.modal.visible = true
|
|
91
91
|
state.modal.colIndex = colIndex
|
|
92
92
|
state.modal.rowIndex = rowIndex
|
|
93
|
-
state.modal.parent = cellRef.value
|
|
94
|
-
state.modal.top = cellRef.value
|
|
95
|
-
state.modal.left = cellRef.value
|
|
93
|
+
state.modal.parent = cellRef.value!
|
|
94
|
+
state.modal.top = cellRef.value!.offsetTop + cellRef.value!.offsetHeight
|
|
95
|
+
state.modal.left = cellRef.value!.offsetLeft
|
|
96
96
|
state.modal.width = width.value
|
|
97
97
|
state.modal.height = height.value
|
|
98
98
|
|
|
@@ -146,7 +146,7 @@ if (addNavigation) {
|
|
|
146
146
|
|
|
147
147
|
const onFocus = () => {
|
|
148
148
|
if (cellRef.value) {
|
|
149
|
-
currentData.value = cellRef.value.textContent
|
|
149
|
+
currentData.value = cellRef.value.textContent!
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
|
|
@@ -156,14 +156,14 @@ const updateCellData = (payload: Event) => {
|
|
|
156
156
|
return
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
emit('cellInput', colIndex, rowIndex, target.textContent
|
|
160
|
-
currentData.value = target.textContent
|
|
159
|
+
emit('cellInput', colIndex, rowIndex, target.textContent!, currentData.value)
|
|
160
|
+
currentData.value = target.textContent!
|
|
161
161
|
|
|
162
162
|
// only apply changes if the cell value has changed after being mounted
|
|
163
163
|
if (column.format) {
|
|
164
164
|
cellModified.value = target.textContent !== store.getFormattedValue(colIndex, rowIndex, originalData)
|
|
165
165
|
// TODO: need to setup reverse format function?
|
|
166
|
-
store.setCellText(colIndex, rowIndex, target.textContent)
|
|
166
|
+
store.setCellText(colIndex, rowIndex, target.textContent!)
|
|
167
167
|
} else {
|
|
168
168
|
cellModified.value = target.textContent !== originalData
|
|
169
169
|
store.setCellData(colIndex, rowIndex, target.textContent)
|
package/src/components/ARow.vue
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
<script setup lang="ts">
|
|
28
28
|
import { type KeypressHandlers, useKeyboardNav, defaultKeypressHandlers } from '@stonecrop/utilities'
|
|
29
|
-
import { useTemplateRef } from 'vue'
|
|
29
|
+
import { computed, useTemplateRef } from 'vue'
|
|
30
30
|
|
|
31
31
|
import { createTableStore } from '../stores/table'
|
|
32
32
|
|
|
@@ -43,8 +43,9 @@ const {
|
|
|
43
43
|
}>()
|
|
44
44
|
|
|
45
45
|
const rowRef = useTemplateRef<HTMLTableRowElement>('rowEl')
|
|
46
|
-
|
|
47
|
-
const
|
|
46
|
+
|
|
47
|
+
const isRowVisible = computed(() => store.isRowVisible(rowIndex))
|
|
48
|
+
const rowExpandSymbol = computed(() => store.getRowExpandSymbol(rowIndex))
|
|
48
49
|
|
|
49
50
|
if (addNavigation) {
|
|
50
51
|
let handlers = defaultKeypressHandlers
|