@stonecrop/atable 0.6.0 → 0.6.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/dist/assets/index.css +1 -1
- package/dist/atable.d.ts +153 -3
- package/dist/atable.js +1367 -1138
- package/dist/atable.js.map +1 -1
- package/dist/atable.umd.cjs +2 -2
- package/dist/atable.umd.cjs.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/stores/table.d.ts +125 -3
- package/dist/src/stores/table.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +26 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/stores/table.js +166 -0
- package/package.json +3 -3
- package/src/components/ATable.vue +10 -6
- package/src/components/ATableColumnFilter.vue +212 -0
- package/src/components/ATableHeader.vue +36 -1
- package/src/index.ts +1 -0
- package/src/stores/table.ts +199 -0
- package/src/types/index.ts +31 -0
package/dist/src/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import ATableLoading from './components/ATableLoading.vue';
|
|
|
9
9
|
import ATableLoadingBar from './components/ATableLoadingBar.vue';
|
|
10
10
|
import ATableModal from './components/ATableModal.vue';
|
|
11
11
|
export { createTableStore } from './stores/table';
|
|
12
|
+
export type { FilterState, FilterStateRecord } from './stores/table';
|
|
12
13
|
export type * from './types';
|
|
13
14
|
/**
|
|
14
15
|
* Install all ATable components
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,OAAO,KAAK,MAAM,wBAAwB,CAAA;AAC1C,OAAO,aAAa,MAAM,gCAAgC,CAAA;AAC1D,OAAO,UAAU,MAAM,6BAA6B,CAAA;AACpD,OAAO,IAAI,MAAM,uBAAuB,CAAA;AACxC,OAAO,MAAM,MAAM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a,EACb,gBAAgB,EAChB,WAAW,EACX,OAAO,GACP,CAAA"}
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { type CSSProperties } from 'vue';
|
|
2
2
|
import type { CellContext, ConnectionHandle, ConnectionPath, GanttBarInfo, GanttDragEvent, TableColumn, TableConfig, TableDisplay, TableModal, TableRow } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the state of a single filter
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface FilterState {
|
|
8
|
+
/** The main filter value */
|
|
9
|
+
value: any;
|
|
10
|
+
/** Start value for date range filters */
|
|
11
|
+
startValue?: any;
|
|
12
|
+
/** End value for date range filters */
|
|
13
|
+
endValue?: any;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Record mapping column indices to their filter states
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
export type FilterStateRecord = Record<number, FilterState>;
|
|
3
20
|
/**
|
|
4
21
|
* Create a table store
|
|
5
22
|
* @param initData - Initial data for the table store
|
|
@@ -22,6 +39,11 @@ export declare const createTableStore: (initData: {
|
|
|
22
39
|
width?: string | undefined;
|
|
23
40
|
pinned?: boolean | undefined;
|
|
24
41
|
resizable?: boolean | undefined;
|
|
42
|
+
sortable?: boolean | undefined;
|
|
43
|
+
filterable?: boolean | undefined;
|
|
44
|
+
filterType?: "text" | "select" | "number" | "date" | "dateRange" | "checkbox" | "component" | undefined;
|
|
45
|
+
filterOptions?: any[] | undefined;
|
|
46
|
+
filterComponent?: string | undefined;
|
|
25
47
|
cellComponent?: string | undefined;
|
|
26
48
|
cellComponentProps?: Record<string, any> | undefined;
|
|
27
49
|
modalComponent?: string | ((context: CellContext) => string) | undefined;
|
|
@@ -41,6 +63,11 @@ export declare const createTableStore: (initData: {
|
|
|
41
63
|
width?: string | undefined;
|
|
42
64
|
pinned?: boolean | undefined;
|
|
43
65
|
resizable?: boolean | undefined;
|
|
66
|
+
sortable?: boolean | undefined;
|
|
67
|
+
filterable?: boolean | undefined;
|
|
68
|
+
filterType?: "text" | "select" | "number" | "date" | "dateRange" | "checkbox" | "component" | undefined;
|
|
69
|
+
filterOptions?: any[] | undefined;
|
|
70
|
+
filterComponent?: string | undefined;
|
|
44
71
|
cellComponent?: string | undefined;
|
|
45
72
|
cellComponentProps?: Record<string, any> | undefined;
|
|
46
73
|
modalComponent?: string | ((context: CellContext) => string) | undefined;
|
|
@@ -140,6 +167,7 @@ export declare const createTableStore: (initData: {
|
|
|
140
167
|
label?: string | undefined;
|
|
141
168
|
}[]>;
|
|
142
169
|
display: import("vue").WritableComputedRef<TableDisplay[], TableDisplay[]>;
|
|
170
|
+
filterState: import("vue").Ref<FilterStateRecord, FilterStateRecord>;
|
|
143
171
|
ganttBars: import("vue").Ref<{
|
|
144
172
|
id: string;
|
|
145
173
|
rowIndex: number;
|
|
@@ -211,14 +239,36 @@ export declare const createTableStore: (initData: {
|
|
|
211
239
|
colspan?: number | undefined;
|
|
212
240
|
} | undefined;
|
|
213
241
|
}[]>;
|
|
242
|
+
sortState: import("vue").Ref<{
|
|
243
|
+
column: number | null;
|
|
244
|
+
direction: "asc" | "desc" | null;
|
|
245
|
+
}, {
|
|
246
|
+
column: number | null;
|
|
247
|
+
direction: "asc" | "desc" | null;
|
|
248
|
+
} | {
|
|
249
|
+
column: number | null;
|
|
250
|
+
direction: "asc" | "desc" | null;
|
|
251
|
+
}>;
|
|
214
252
|
table: import("vue").ComputedRef<{}>;
|
|
215
253
|
updates: import("vue").Ref<Record<string, string>, Record<string, string>>;
|
|
254
|
+
filteredRows: import("vue").ComputedRef<{
|
|
255
|
+
originalIndex: number;
|
|
256
|
+
indent?: number | undefined;
|
|
257
|
+
parent?: number | undefined;
|
|
258
|
+
gantt?: {
|
|
259
|
+
color?: string | undefined;
|
|
260
|
+
startIndex?: number | undefined;
|
|
261
|
+
endIndex?: number | undefined;
|
|
262
|
+
colspan?: number | undefined;
|
|
263
|
+
} | undefined;
|
|
264
|
+
}[]>;
|
|
216
265
|
hasPinnedColumns: import("vue").ComputedRef<boolean>;
|
|
217
266
|
isGanttView: import("vue").ComputedRef<boolean>;
|
|
218
267
|
isTreeView: import("vue").ComputedRef<boolean>;
|
|
219
268
|
isDependencyGraphEnabled: import("vue").ComputedRef<boolean>;
|
|
220
269
|
numberedRowWidth: import("vue").ComputedRef<string>;
|
|
221
270
|
zeroColumn: import("vue").ComputedRef<boolean>;
|
|
271
|
+
clearFilter: (colIndex: number) => void;
|
|
222
272
|
closeModal: (event: MouseEvent) => void;
|
|
223
273
|
createConnection: (fromHandleId: string, toHandleId: string, options?: {
|
|
224
274
|
style?: ConnectionPath["style"];
|
|
@@ -266,12 +316,14 @@ export declare const createTableStore: (initData: {
|
|
|
266
316
|
resizeColumn: (colIndex: number, newWidth: number) => void;
|
|
267
317
|
setCellData: (colIndex: number, rowIndex: number, value: any) => void;
|
|
268
318
|
setCellText: (colIndex: number, rowIndex: number, value: string) => void;
|
|
319
|
+
setFilter: (colIndex: number, filter: FilterState) => void;
|
|
320
|
+
sortByColumn: (colIndex: number) => void;
|
|
269
321
|
toggleRowExpand: (rowIndex: number) => void;
|
|
270
322
|
unregisterConnectionHandle: (handleId: string) => void;
|
|
271
323
|
unregisterGanttBar: (barId: string) => void;
|
|
272
324
|
updateGanttBar: (event: GanttDragEvent) => void;
|
|
273
325
|
updateRows: (newRows: TableRow[]) => void;
|
|
274
|
-
}, "columns" | "config" | "connectionHandles" | "connectionPaths" | "ganttBars" | "modal" | "rows" | "updates">, Pick<{
|
|
326
|
+
}, "columns" | "config" | "connectionHandles" | "connectionPaths" | "filterState" | "ganttBars" | "modal" | "rows" | "sortState" | "updates">, Pick<{
|
|
275
327
|
columns: import("vue").Ref<{
|
|
276
328
|
name: string;
|
|
277
329
|
align?: CanvasTextAlign | undefined;
|
|
@@ -281,6 +333,11 @@ export declare const createTableStore: (initData: {
|
|
|
281
333
|
width?: string | undefined;
|
|
282
334
|
pinned?: boolean | undefined;
|
|
283
335
|
resizable?: boolean | undefined;
|
|
336
|
+
sortable?: boolean | undefined;
|
|
337
|
+
filterable?: boolean | undefined;
|
|
338
|
+
filterType?: "text" | "select" | "number" | "date" | "dateRange" | "checkbox" | "component" | undefined;
|
|
339
|
+
filterOptions?: any[] | undefined;
|
|
340
|
+
filterComponent?: string | undefined;
|
|
284
341
|
cellComponent?: string | undefined;
|
|
285
342
|
cellComponentProps?: Record<string, any> | undefined;
|
|
286
343
|
modalComponent?: string | ((context: CellContext) => string) | undefined;
|
|
@@ -300,6 +357,11 @@ export declare const createTableStore: (initData: {
|
|
|
300
357
|
width?: string | undefined;
|
|
301
358
|
pinned?: boolean | undefined;
|
|
302
359
|
resizable?: boolean | undefined;
|
|
360
|
+
sortable?: boolean | undefined;
|
|
361
|
+
filterable?: boolean | undefined;
|
|
362
|
+
filterType?: "text" | "select" | "number" | "date" | "dateRange" | "checkbox" | "component" | undefined;
|
|
363
|
+
filterOptions?: any[] | undefined;
|
|
364
|
+
filterComponent?: string | undefined;
|
|
303
365
|
cellComponent?: string | undefined;
|
|
304
366
|
cellComponentProps?: Record<string, any> | undefined;
|
|
305
367
|
modalComponent?: string | ((context: CellContext) => string) | undefined;
|
|
@@ -399,6 +461,7 @@ export declare const createTableStore: (initData: {
|
|
|
399
461
|
label?: string | undefined;
|
|
400
462
|
}[]>;
|
|
401
463
|
display: import("vue").WritableComputedRef<TableDisplay[], TableDisplay[]>;
|
|
464
|
+
filterState: import("vue").Ref<FilterStateRecord, FilterStateRecord>;
|
|
402
465
|
ganttBars: import("vue").Ref<{
|
|
403
466
|
id: string;
|
|
404
467
|
rowIndex: number;
|
|
@@ -470,14 +533,36 @@ export declare const createTableStore: (initData: {
|
|
|
470
533
|
colspan?: number | undefined;
|
|
471
534
|
} | undefined;
|
|
472
535
|
}[]>;
|
|
536
|
+
sortState: import("vue").Ref<{
|
|
537
|
+
column: number | null;
|
|
538
|
+
direction: "asc" | "desc" | null;
|
|
539
|
+
}, {
|
|
540
|
+
column: number | null;
|
|
541
|
+
direction: "asc" | "desc" | null;
|
|
542
|
+
} | {
|
|
543
|
+
column: number | null;
|
|
544
|
+
direction: "asc" | "desc" | null;
|
|
545
|
+
}>;
|
|
473
546
|
table: import("vue").ComputedRef<{}>;
|
|
474
547
|
updates: import("vue").Ref<Record<string, string>, Record<string, string>>;
|
|
548
|
+
filteredRows: import("vue").ComputedRef<{
|
|
549
|
+
originalIndex: number;
|
|
550
|
+
indent?: number | undefined;
|
|
551
|
+
parent?: number | undefined;
|
|
552
|
+
gantt?: {
|
|
553
|
+
color?: string | undefined;
|
|
554
|
+
startIndex?: number | undefined;
|
|
555
|
+
endIndex?: number | undefined;
|
|
556
|
+
colspan?: number | undefined;
|
|
557
|
+
} | undefined;
|
|
558
|
+
}[]>;
|
|
475
559
|
hasPinnedColumns: import("vue").ComputedRef<boolean>;
|
|
476
560
|
isGanttView: import("vue").ComputedRef<boolean>;
|
|
477
561
|
isTreeView: import("vue").ComputedRef<boolean>;
|
|
478
562
|
isDependencyGraphEnabled: import("vue").ComputedRef<boolean>;
|
|
479
563
|
numberedRowWidth: import("vue").ComputedRef<string>;
|
|
480
564
|
zeroColumn: import("vue").ComputedRef<boolean>;
|
|
565
|
+
clearFilter: (colIndex: number) => void;
|
|
481
566
|
closeModal: (event: MouseEvent) => void;
|
|
482
567
|
createConnection: (fromHandleId: string, toHandleId: string, options?: {
|
|
483
568
|
style?: ConnectionPath["style"];
|
|
@@ -525,12 +610,14 @@ export declare const createTableStore: (initData: {
|
|
|
525
610
|
resizeColumn: (colIndex: number, newWidth: number) => void;
|
|
526
611
|
setCellData: (colIndex: number, rowIndex: number, value: any) => void;
|
|
527
612
|
setCellText: (colIndex: number, rowIndex: number, value: string) => void;
|
|
613
|
+
setFilter: (colIndex: number, filter: FilterState) => void;
|
|
614
|
+
sortByColumn: (colIndex: number) => void;
|
|
528
615
|
toggleRowExpand: (rowIndex: number) => void;
|
|
529
616
|
unregisterConnectionHandle: (handleId: string) => void;
|
|
530
617
|
unregisterGanttBar: (barId: string) => void;
|
|
531
618
|
updateGanttBar: (event: GanttDragEvent) => void;
|
|
532
619
|
updateRows: (newRows: TableRow[]) => void;
|
|
533
|
-
}, "display" | "table" | "hasPinnedColumns" | "isGanttView" | "isTreeView" | "isDependencyGraphEnabled" | "numberedRowWidth" | "zeroColumn">, Pick<{
|
|
620
|
+
}, "display" | "table" | "filteredRows" | "hasPinnedColumns" | "isGanttView" | "isTreeView" | "isDependencyGraphEnabled" | "numberedRowWidth" | "zeroColumn">, Pick<{
|
|
534
621
|
columns: import("vue").Ref<{
|
|
535
622
|
name: string;
|
|
536
623
|
align?: CanvasTextAlign | undefined;
|
|
@@ -540,6 +627,11 @@ export declare const createTableStore: (initData: {
|
|
|
540
627
|
width?: string | undefined;
|
|
541
628
|
pinned?: boolean | undefined;
|
|
542
629
|
resizable?: boolean | undefined;
|
|
630
|
+
sortable?: boolean | undefined;
|
|
631
|
+
filterable?: boolean | undefined;
|
|
632
|
+
filterType?: "text" | "select" | "number" | "date" | "dateRange" | "checkbox" | "component" | undefined;
|
|
633
|
+
filterOptions?: any[] | undefined;
|
|
634
|
+
filterComponent?: string | undefined;
|
|
543
635
|
cellComponent?: string | undefined;
|
|
544
636
|
cellComponentProps?: Record<string, any> | undefined;
|
|
545
637
|
modalComponent?: string | ((context: CellContext) => string) | undefined;
|
|
@@ -559,6 +651,11 @@ export declare const createTableStore: (initData: {
|
|
|
559
651
|
width?: string | undefined;
|
|
560
652
|
pinned?: boolean | undefined;
|
|
561
653
|
resizable?: boolean | undefined;
|
|
654
|
+
sortable?: boolean | undefined;
|
|
655
|
+
filterable?: boolean | undefined;
|
|
656
|
+
filterType?: "text" | "select" | "number" | "date" | "dateRange" | "checkbox" | "component" | undefined;
|
|
657
|
+
filterOptions?: any[] | undefined;
|
|
658
|
+
filterComponent?: string | undefined;
|
|
562
659
|
cellComponent?: string | undefined;
|
|
563
660
|
cellComponentProps?: Record<string, any> | undefined;
|
|
564
661
|
modalComponent?: string | ((context: CellContext) => string) | undefined;
|
|
@@ -658,6 +755,7 @@ export declare const createTableStore: (initData: {
|
|
|
658
755
|
label?: string | undefined;
|
|
659
756
|
}[]>;
|
|
660
757
|
display: import("vue").WritableComputedRef<TableDisplay[], TableDisplay[]>;
|
|
758
|
+
filterState: import("vue").Ref<FilterStateRecord, FilterStateRecord>;
|
|
661
759
|
ganttBars: import("vue").Ref<{
|
|
662
760
|
id: string;
|
|
663
761
|
rowIndex: number;
|
|
@@ -729,14 +827,36 @@ export declare const createTableStore: (initData: {
|
|
|
729
827
|
colspan?: number | undefined;
|
|
730
828
|
} | undefined;
|
|
731
829
|
}[]>;
|
|
830
|
+
sortState: import("vue").Ref<{
|
|
831
|
+
column: number | null;
|
|
832
|
+
direction: "asc" | "desc" | null;
|
|
833
|
+
}, {
|
|
834
|
+
column: number | null;
|
|
835
|
+
direction: "asc" | "desc" | null;
|
|
836
|
+
} | {
|
|
837
|
+
column: number | null;
|
|
838
|
+
direction: "asc" | "desc" | null;
|
|
839
|
+
}>;
|
|
732
840
|
table: import("vue").ComputedRef<{}>;
|
|
733
841
|
updates: import("vue").Ref<Record<string, string>, Record<string, string>>;
|
|
842
|
+
filteredRows: import("vue").ComputedRef<{
|
|
843
|
+
originalIndex: number;
|
|
844
|
+
indent?: number | undefined;
|
|
845
|
+
parent?: number | undefined;
|
|
846
|
+
gantt?: {
|
|
847
|
+
color?: string | undefined;
|
|
848
|
+
startIndex?: number | undefined;
|
|
849
|
+
endIndex?: number | undefined;
|
|
850
|
+
colspan?: number | undefined;
|
|
851
|
+
} | undefined;
|
|
852
|
+
}[]>;
|
|
734
853
|
hasPinnedColumns: import("vue").ComputedRef<boolean>;
|
|
735
854
|
isGanttView: import("vue").ComputedRef<boolean>;
|
|
736
855
|
isTreeView: import("vue").ComputedRef<boolean>;
|
|
737
856
|
isDependencyGraphEnabled: import("vue").ComputedRef<boolean>;
|
|
738
857
|
numberedRowWidth: import("vue").ComputedRef<string>;
|
|
739
858
|
zeroColumn: import("vue").ComputedRef<boolean>;
|
|
859
|
+
clearFilter: (colIndex: number) => void;
|
|
740
860
|
closeModal: (event: MouseEvent) => void;
|
|
741
861
|
createConnection: (fromHandleId: string, toHandleId: string, options?: {
|
|
742
862
|
style?: ConnectionPath["style"];
|
|
@@ -784,10 +904,12 @@ export declare const createTableStore: (initData: {
|
|
|
784
904
|
resizeColumn: (colIndex: number, newWidth: number) => void;
|
|
785
905
|
setCellData: (colIndex: number, rowIndex: number, value: any) => void;
|
|
786
906
|
setCellText: (colIndex: number, rowIndex: number, value: string) => void;
|
|
907
|
+
setFilter: (colIndex: number, filter: FilterState) => void;
|
|
908
|
+
sortByColumn: (colIndex: number) => void;
|
|
787
909
|
toggleRowExpand: (rowIndex: number) => void;
|
|
788
910
|
unregisterConnectionHandle: (handleId: string) => void;
|
|
789
911
|
unregisterGanttBar: (barId: string) => void;
|
|
790
912
|
updateGanttBar: (event: GanttDragEvent) => void;
|
|
791
913
|
updateRows: (newRows: TableRow[]) => void;
|
|
792
|
-
}, "closeModal" | "createConnection" | "deleteConnection" | "getCellData" | "getCellDisplayValue" | "getConnectionsForBar" | "getFormattedValue" | "getHandlesForBar" | "getHeaderCellStyle" | "getIndent" | "getRowExpandSymbol" | "isRowGantt" | "isRowVisible" | "registerConnectionHandle" | "registerGanttBar" | "resizeColumn" | "setCellData" | "setCellText" | "toggleRowExpand" | "unregisterConnectionHandle" | "unregisterGanttBar" | "updateGanttBar" | "updateRows">>;
|
|
914
|
+
}, "clearFilter" | "closeModal" | "createConnection" | "deleteConnection" | "getCellData" | "getCellDisplayValue" | "getConnectionsForBar" | "getFormattedValue" | "getHandlesForBar" | "getHeaderCellStyle" | "getIndent" | "getRowExpandSymbol" | "isRowGantt" | "isRowVisible" | "registerConnectionHandle" | "registerGanttBar" | "resizeColumn" | "setCellData" | "setCellText" | "setFilter" | "sortByColumn" | "toggleRowExpand" | "unregisterConnectionHandle" | "unregisterGanttBar" | "updateGanttBar" | "updateRows">>;
|
|
793
915
|
//# sourceMappingURL=table.d.ts.map
|
|
@@ -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,EACX,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,cAAc,EACd,WAAW,EACX,WAAW,EACX,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,MAAM,UAAU,CAAA;AAGjB;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,UAAU;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,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,EACX,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,cAAc,EACd,WAAW,EACX,WAAW,EACX,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,MAAM,UAAU,CAAA;AAGjB;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC3B,4BAA4B;IAC5B,KAAK,EAAE,GAAG,CAAA;IACV,yCAAyC;IACzC,UAAU,CAAC,EAAE,GAAG,CAAA;IAChB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,GAAG,CAAA;CACd;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,UAAU;IAC1C,OAAO,EAAE,WAAW,EA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AAc;0BAxJhB,QAAQ,EAAE;igBA0axC,CAAA"}
|
|
@@ -62,6 +62,32 @@ export interface TableColumn {
|
|
|
62
62
|
* @defaultValue false
|
|
63
63
|
*/
|
|
64
64
|
resizable?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Control whether the column should be sortable.
|
|
67
|
+
*
|
|
68
|
+
* @defaultValue true
|
|
69
|
+
*/
|
|
70
|
+
sortable?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Control whether the column should be filterable and define filter configuration.
|
|
73
|
+
*
|
|
74
|
+
* @defaultValue true
|
|
75
|
+
*/
|
|
76
|
+
filterable?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* The type of filter for the column.
|
|
79
|
+
*
|
|
80
|
+
* @defaultValue 'text'
|
|
81
|
+
*/
|
|
82
|
+
filterType?: 'text' | 'select' | 'number' | 'date' | 'dateRange' | 'checkbox' | 'component';
|
|
83
|
+
/**
|
|
84
|
+
* Options for select-type filters.
|
|
85
|
+
*/
|
|
86
|
+
filterOptions?: any[];
|
|
87
|
+
/**
|
|
88
|
+
* Custom component for filtering.
|
|
89
|
+
*/
|
|
90
|
+
filterComponent?: string;
|
|
65
91
|
/**
|
|
66
92
|
* The component to use to render the cell for the column. If not provided, the table will
|
|
67
93
|
* render the default `<td>` element.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAElD;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,eAAe,CAAA;IAEvB;;;;OAIG;IAC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AM,GAAG,OAAO,CAAA;KACtB,CAAA;IAED;;OAEG;IACH,EAAE,EAAE;QACH,KAAK,EAAE,MAAM,CAAA;QACb,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;KACtB,CAAA;IAED;;OAEG;IACH,KAAK,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,KAAK,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;IAED;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAA;IACzB,UAAU,EAAE,cAAc,CAAA;CAC1B,CAAA"}
|
package/dist/stores/table.js
CHANGED
|
@@ -145,6 +145,11 @@ export const createTableStore = (initData) => {
|
|
|
145
145
|
const ganttBars = ref([]);
|
|
146
146
|
const connectionHandles = ref([]);
|
|
147
147
|
const connectionPaths = ref([]);
|
|
148
|
+
const sortState = ref({
|
|
149
|
+
column: null,
|
|
150
|
+
direction: null,
|
|
151
|
+
});
|
|
152
|
+
const filterState = ref({});
|
|
148
153
|
// getters
|
|
149
154
|
const hasPinnedColumns = computed(() => columns.value.some(col => col.pinned));
|
|
150
155
|
const isGanttView = computed(() => config.value.view === 'gantt' || config.value.view === 'tree-gantt');
|
|
@@ -160,6 +165,55 @@ export const createTableStore = (initData) => {
|
|
|
160
165
|
return `${indent}ch`;
|
|
161
166
|
});
|
|
162
167
|
const zeroColumn = computed(() => config.value.view ? ['list', 'tree', 'tree-gantt', 'list-expansion'].includes(config.value.view) : false);
|
|
168
|
+
const filteredRows = computed(() => {
|
|
169
|
+
let filtered = rows.value.map((row, originalIndex) => ({
|
|
170
|
+
...row,
|
|
171
|
+
originalIndex,
|
|
172
|
+
}));
|
|
173
|
+
// Apply filters
|
|
174
|
+
Object.entries(filterState.value).forEach(([colIndexStr, filter]) => {
|
|
175
|
+
const colIndex = parseInt(colIndexStr);
|
|
176
|
+
const column = columns.value[colIndex];
|
|
177
|
+
if (!column)
|
|
178
|
+
return;
|
|
179
|
+
// Skip if filter has no value (except for dateRange and checkbox which can have different value structures)
|
|
180
|
+
const hasFilterValue = filter.value ||
|
|
181
|
+
filter.startValue ||
|
|
182
|
+
filter.endValue ||
|
|
183
|
+
(column.filterType === 'checkbox' && filter.value !== undefined);
|
|
184
|
+
if (!hasFilterValue)
|
|
185
|
+
return;
|
|
186
|
+
filtered = filtered.filter(row => {
|
|
187
|
+
const cellValue = row[column.name];
|
|
188
|
+
return applyFilter(cellValue, filter, column);
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
// Apply sorting if active
|
|
192
|
+
if (sortState.value.column !== null && sortState.value.direction) {
|
|
193
|
+
const column = columns.value[sortState.value.column];
|
|
194
|
+
const direction = sortState.value.direction;
|
|
195
|
+
filtered.sort((a, b) => {
|
|
196
|
+
let aVal = a[column.name];
|
|
197
|
+
let bVal = b[column.name];
|
|
198
|
+
if (aVal === null || aVal === undefined)
|
|
199
|
+
aVal = '';
|
|
200
|
+
if (bVal === null || bVal === undefined)
|
|
201
|
+
bVal = '';
|
|
202
|
+
const aNum = Number(aVal);
|
|
203
|
+
const bNum = Number(bVal);
|
|
204
|
+
const isNumeric = !isNaN(aNum) && !isNaN(bNum) && aVal !== '' && bVal !== '';
|
|
205
|
+
if (isNumeric) {
|
|
206
|
+
return direction === 'asc' ? aNum - bNum : bNum - aNum;
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
const aStr = String(aVal).toLowerCase();
|
|
210
|
+
const bStr = String(bVal).toLowerCase();
|
|
211
|
+
return direction === 'asc' ? aStr.localeCompare(bStr) : bStr.localeCompare(aStr);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
return filtered;
|
|
216
|
+
});
|
|
163
217
|
// actions
|
|
164
218
|
const getCellData = (colIndex, rowIndex) => table.value[`${colIndex}:${rowIndex}`];
|
|
165
219
|
const setCellData = (colIndex, rowIndex, value) => {
|
|
@@ -402,6 +456,112 @@ export const createTableStore = (initData) => {
|
|
|
402
456
|
const getHandlesForBar = (barId) => {
|
|
403
457
|
return connectionHandles.value.filter(handle => handle.barId === barId);
|
|
404
458
|
};
|
|
459
|
+
const sortByColumn = (colIndex) => {
|
|
460
|
+
const column = columns.value[colIndex];
|
|
461
|
+
if (column.sortable === false)
|
|
462
|
+
return;
|
|
463
|
+
let newDirection;
|
|
464
|
+
if (sortState.value.column === colIndex) {
|
|
465
|
+
if (sortState.value.direction === 'asc') {
|
|
466
|
+
newDirection = 'desc';
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
newDirection = 'asc';
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
else {
|
|
473
|
+
newDirection = 'asc';
|
|
474
|
+
}
|
|
475
|
+
sortState.value.column = colIndex;
|
|
476
|
+
sortState.value.direction = newDirection;
|
|
477
|
+
// Note: The actual sorting is now handled in the filteredRows computed property
|
|
478
|
+
// This ensures that sorting works on filtered data without modifying the original rows
|
|
479
|
+
};
|
|
480
|
+
const applyFilter = (cellValue, filter, column) => {
|
|
481
|
+
const filterType = column.filterType || 'text';
|
|
482
|
+
const value = filter.value;
|
|
483
|
+
if (!value && filterType !== 'dateRange' && filterType !== 'checkbox')
|
|
484
|
+
return true;
|
|
485
|
+
switch (filterType) {
|
|
486
|
+
case 'text': {
|
|
487
|
+
// Handle objects with nested properties
|
|
488
|
+
let searchableText = '';
|
|
489
|
+
if (typeof cellValue === 'object' && cellValue !== null) {
|
|
490
|
+
// If it's an object, search in all string values
|
|
491
|
+
searchableText = Object.values(cellValue).join(' ');
|
|
492
|
+
}
|
|
493
|
+
else {
|
|
494
|
+
searchableText = String(cellValue || '');
|
|
495
|
+
}
|
|
496
|
+
return searchableText.toLowerCase().includes(String(value).toLowerCase());
|
|
497
|
+
}
|
|
498
|
+
case 'number': {
|
|
499
|
+
const numValue = Number(cellValue);
|
|
500
|
+
const filterNum = Number(value);
|
|
501
|
+
return !isNaN(numValue) && !isNaN(filterNum) && numValue === filterNum;
|
|
502
|
+
}
|
|
503
|
+
case 'select':
|
|
504
|
+
return cellValue === value;
|
|
505
|
+
case 'checkbox':
|
|
506
|
+
// For checkbox filter, if checked (true), show only truthy values
|
|
507
|
+
// If unchecked (false/undefined), show all values
|
|
508
|
+
if (value === true) {
|
|
509
|
+
return !!cellValue;
|
|
510
|
+
}
|
|
511
|
+
return true;
|
|
512
|
+
case 'date': {
|
|
513
|
+
// Handle both timestamp numbers and date strings
|
|
514
|
+
let cellDate;
|
|
515
|
+
if (typeof cellValue === 'number') {
|
|
516
|
+
// Apply the same year transformation as in the format function
|
|
517
|
+
const originalDate = new Date(cellValue);
|
|
518
|
+
const currentYear = new Date().getFullYear();
|
|
519
|
+
cellDate = new Date(currentYear, originalDate.getMonth(), originalDate.getDate());
|
|
520
|
+
}
|
|
521
|
+
else {
|
|
522
|
+
cellDate = new Date(String(cellValue));
|
|
523
|
+
}
|
|
524
|
+
const filterDate = new Date(String(value));
|
|
525
|
+
return cellDate.toDateString() === filterDate.toDateString();
|
|
526
|
+
}
|
|
527
|
+
case 'dateRange': {
|
|
528
|
+
const startValue = filter.startValue;
|
|
529
|
+
const endValue = filter.endValue;
|
|
530
|
+
if (!startValue && !endValue)
|
|
531
|
+
return true;
|
|
532
|
+
// Handle both timestamp numbers and date strings
|
|
533
|
+
let cellDateRange;
|
|
534
|
+
if (typeof cellValue === 'number') {
|
|
535
|
+
// Apply the same year transformation as in the format function
|
|
536
|
+
const originalDate = new Date(cellValue);
|
|
537
|
+
const currentYear = new Date().getFullYear();
|
|
538
|
+
cellDateRange = new Date(currentYear, originalDate.getMonth(), originalDate.getDate());
|
|
539
|
+
}
|
|
540
|
+
else {
|
|
541
|
+
cellDateRange = new Date(String(cellValue));
|
|
542
|
+
}
|
|
543
|
+
if (startValue && cellDateRange < new Date(String(startValue)))
|
|
544
|
+
return false;
|
|
545
|
+
if (endValue && cellDateRange > new Date(String(endValue)))
|
|
546
|
+
return false;
|
|
547
|
+
return true;
|
|
548
|
+
}
|
|
549
|
+
default:
|
|
550
|
+
return true;
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
const setFilter = (colIndex, filter) => {
|
|
554
|
+
if (!filter.value && !filter.startValue && !filter.endValue) {
|
|
555
|
+
// Remove filter if empty
|
|
556
|
+
delete filterState.value[colIndex];
|
|
557
|
+
}
|
|
558
|
+
else {
|
|
559
|
+
filterState.value[colIndex] = filter;
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
const clearFilter = (colIndex) => {
|
|
563
|
+
delete filterState.value[colIndex];
|
|
564
|
+
};
|
|
405
565
|
return {
|
|
406
566
|
// state
|
|
407
567
|
columns,
|
|
@@ -409,12 +569,15 @@ export const createTableStore = (initData) => {
|
|
|
409
569
|
connectionHandles,
|
|
410
570
|
connectionPaths,
|
|
411
571
|
display,
|
|
572
|
+
filterState,
|
|
412
573
|
ganttBars,
|
|
413
574
|
modal,
|
|
414
575
|
rows,
|
|
576
|
+
sortState,
|
|
415
577
|
table,
|
|
416
578
|
updates,
|
|
417
579
|
// getters
|
|
580
|
+
filteredRows,
|
|
418
581
|
hasPinnedColumns,
|
|
419
582
|
isGanttView,
|
|
420
583
|
isTreeView,
|
|
@@ -422,6 +585,7 @@ export const createTableStore = (initData) => {
|
|
|
422
585
|
numberedRowWidth,
|
|
423
586
|
zeroColumn,
|
|
424
587
|
// actions
|
|
588
|
+
clearFilter,
|
|
425
589
|
closeModal,
|
|
426
590
|
createConnection,
|
|
427
591
|
deleteConnection,
|
|
@@ -440,6 +604,8 @@ export const createTableStore = (initData) => {
|
|
|
440
604
|
resizeColumn,
|
|
441
605
|
setCellData,
|
|
442
606
|
setCellText,
|
|
607
|
+
setFilter,
|
|
608
|
+
sortByColumn,
|
|
443
609
|
toggleRowExpand,
|
|
444
610
|
unregisterConnectionHandle,
|
|
445
611
|
unregisterGanttBar,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stonecrop/atable",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"@vueuse/core": "^14.0.0",
|
|
43
43
|
"pinia": "^3.0.3",
|
|
44
44
|
"vue": "^3.5.22",
|
|
45
|
-
"@stonecrop/
|
|
46
|
-
"@stonecrop/
|
|
45
|
+
"@stonecrop/themes": "0.6.1",
|
|
46
|
+
"@stonecrop/utilities": "0.6.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@eslint/js": "^9.38.0",
|
|
@@ -11,10 +11,14 @@
|
|
|
11
11
|
<slot name="header" :data="store">
|
|
12
12
|
<ATableHeader :columns="store.columns" :store="store" />
|
|
13
13
|
</slot>
|
|
14
|
-
|
|
15
14
|
<tbody>
|
|
16
15
|
<slot name="body" :data="store">
|
|
17
|
-
<ARow
|
|
16
|
+
<ARow
|
|
17
|
+
v-for="(row, filteredIndex) in store.filteredRows"
|
|
18
|
+
:key="`${row.originalIndex}-${filteredIndex}`"
|
|
19
|
+
:row="row"
|
|
20
|
+
:rowIndex="row.originalIndex"
|
|
21
|
+
:store="store">
|
|
18
22
|
<template v-for="(column, colIndex) in getProcessedColumnsForRow(row)" :key="column.name">
|
|
19
23
|
<component
|
|
20
24
|
:is="column.ganttComponent || 'AGanttCell'"
|
|
@@ -26,8 +30,8 @@
|
|
|
26
30
|
:end="row.gantt?.endIndex"
|
|
27
31
|
:colspan="column.colspan"
|
|
28
32
|
:pinned="column.pinned"
|
|
29
|
-
:
|
|
30
|
-
:
|
|
33
|
+
:rowIndex="row.originalIndex"
|
|
34
|
+
:colIndex="column.originalIndex ?? colIndex"
|
|
31
35
|
:style="{
|
|
32
36
|
textAlign: column?.align || 'center',
|
|
33
37
|
minWidth: column?.width || '40ch',
|
|
@@ -39,8 +43,8 @@
|
|
|
39
43
|
v-else
|
|
40
44
|
:store="store"
|
|
41
45
|
:pinned="column.pinned"
|
|
42
|
-
:
|
|
43
|
-
:
|
|
46
|
+
:rowIndex="row.originalIndex"
|
|
47
|
+
:colIndex="colIndex"
|
|
44
48
|
:style="{
|
|
45
49
|
textAlign: column?.align || 'center',
|
|
46
50
|
width: store.config.fullWidth ? 'auto' : null,
|