@0djek/sveltix 0.0.6
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/README.md +103 -0
- package/dist/button/Button.svelte +24 -0
- package/dist/button/Button.svelte.d.ts +4 -0
- package/dist/button/ButtonComponent.svelte.d.ts +15 -0
- package/dist/button/ButtonComponent.svelte.js +26 -0
- package/dist/button/ButtonStyles.d.ts +11 -0
- package/dist/button/ButtonStyles.js +2 -0
- package/dist/button/__tests__/builders/ButtonBuilder.d.ts +23 -0
- package/dist/button/__tests__/builders/ButtonBuilder.js +61 -0
- package/dist/button/__tests__/builders/ButtonStory.svelte +27 -0
- package/dist/button/__tests__/builders/ButtonStory.svelte.d.ts +14 -0
- package/dist/button/__tests__/pom/ButtonPom.d.ts +6 -0
- package/dist/button/__tests__/pom/ButtonPom.js +14 -0
- package/dist/button/buttonDefaults.d.ts +9 -0
- package/dist/button/buttonDefaults.js +9 -0
- package/dist/button/index.d.ts +5 -0
- package/dist/button/index.js +9 -0
- package/dist/button/internal/DefaultButtonStyles.d.ts +15 -0
- package/dist/button/internal/DefaultButtonStyles.js +64 -0
- package/dist/button/models/ButtonProps.d.ts +45 -0
- package/dist/button/models/ButtonProps.js +1 -0
- package/dist/button/models/ButtonSize.d.ts +6 -0
- package/dist/button/models/ButtonSize.js +7 -0
- package/dist/button/models/ButtonVariant.d.ts +5 -0
- package/dist/button/models/ButtonVariant.js +6 -0
- package/dist/button/models/index.d.ts +3 -0
- package/dist/button/models/index.js +3 -0
- package/dist/cache/Cache.d.ts +18 -0
- package/dist/cache/Cache.js +20 -0
- package/dist/cache/MappedCache.d.ts +7 -0
- package/dist/cache/MappedCache.js +35 -0
- package/dist/cache/__tests__/builders/CacheBuilder.d.ts +7 -0
- package/dist/cache/__tests__/builders/CacheBuilder.js +18 -0
- package/dist/cache/__tests__/builders/MappedCacheBuilder.d.ts +7 -0
- package/dist/cache/__tests__/builders/MappedCacheBuilder.js +18 -0
- package/dist/cache/index.d.ts +2 -0
- package/dist/cache/index.js +2 -0
- package/dist/datagrid/SveltixGrid.svelte.d.ts +35 -0
- package/dist/datagrid/SveltixGrid.svelte.js +90 -0
- package/dist/datagrid/SveltixGridGlobal.d.ts +9 -0
- package/dist/datagrid/SveltixGridGlobal.js +12 -0
- package/dist/datagrid/components/Datagrid.svelte +114 -0
- package/dist/datagrid/components/Datagrid.svelte.d.ts +39 -0
- package/dist/datagrid/core-modules/columns/Column.svelte.d.ts +79 -0
- package/dist/datagrid/core-modules/columns/Column.svelte.js +322 -0
- package/dist/datagrid/core-modules/columns/ColumnsModule.svelte.d.ts +26 -0
- package/dist/datagrid/core-modules/columns/ColumnsModule.svelte.js +77 -0
- package/dist/datagrid/core-modules/columns/components/CalculateCellWidth.svelte +18 -0
- package/dist/datagrid/core-modules/columns/components/CalculateCellWidth.svelte.d.ts +25 -0
- package/dist/datagrid/core-modules/columns/index.d.ts +5 -0
- package/dist/datagrid/core-modules/columns/index.js +11 -0
- package/dist/datagrid/core-modules/columns/models/ColumnOptions.d.ts +2 -0
- package/dist/datagrid/core-modules/columns/models/ColumnOptions.js +1 -0
- package/dist/datagrid/core-modules/custom/CustomComponentsModule.svelte.d.ts +27 -0
- package/dist/datagrid/core-modules/custom/CustomComponentsModule.svelte.js +58 -0
- package/dist/datagrid/core-modules/custom/components/CustomComponents.svelte +36 -0
- package/dist/datagrid/core-modules/custom/components/CustomComponents.svelte.d.ts +30 -0
- package/dist/datagrid/core-modules/custom/index.d.ts +3 -0
- package/dist/datagrid/core-modules/custom/index.js +10 -0
- package/dist/datagrid/core-modules/custom/models/CustomComponentPosition.d.ts +21 -0
- package/dist/datagrid/core-modules/custom/models/CustomComponentPosition.js +22 -0
- package/dist/datagrid/core-modules/index.d.ts +4 -0
- package/dist/datagrid/core-modules/index.js +4 -0
- package/dist/datagrid/core-modules/pipelines/PipelinesModule.svelte.d.ts +12 -0
- package/dist/datagrid/core-modules/pipelines/PipelinesModule.svelte.js +58 -0
- package/dist/datagrid/core-modules/pipelines/index.d.ts +4 -0
- package/dist/datagrid/core-modules/pipelines/index.js +11 -0
- package/dist/datagrid/core-modules/pipelines/models/CallbackSignature.d.ts +9 -0
- package/dist/datagrid/core-modules/pipelines/models/CallbackSignature.js +1 -0
- package/dist/datagrid/core-modules/rows/Cell.svelte.d.ts +27 -0
- package/dist/datagrid/core-modules/rows/Cell.svelte.js +103 -0
- package/dist/datagrid/core-modules/rows/Row.svelte.d.ts +24 -0
- package/dist/datagrid/core-modules/rows/Row.svelte.js +117 -0
- package/dist/datagrid/core-modules/rows/RowsModule.svelte.d.ts +33 -0
- package/dist/datagrid/core-modules/rows/RowsModule.svelte.js +115 -0
- package/dist/datagrid/core-modules/rows/components/body/BodyCell.svelte +31 -0
- package/dist/datagrid/core-modules/rows/components/body/BodyCell.svelte.d.ts +30 -0
- package/dist/datagrid/core-modules/rows/components/body/GroupCell.svelte +26 -0
- package/dist/datagrid/core-modules/rows/components/body/GroupCell.svelte.d.ts +25 -0
- package/dist/datagrid/core-modules/rows/index.d.ts +8 -0
- package/dist/datagrid/core-modules/rows/index.js +13 -0
- package/dist/datagrid/core-modules/rows/internal/CreateRowOptions.d.ts +15 -0
- package/dist/datagrid/core-modules/rows/internal/CreateRowOptions.js +1 -0
- package/dist/datagrid/core-modules/rows/models/RowsOptions.d.ts +3 -0
- package/dist/datagrid/core-modules/rows/models/RowsOptions.js +1 -0
- package/dist/datagrid/core-modules/rows/models/index.d.ts +1 -0
- package/dist/datagrid/core-modules/rows/models/index.js +1 -0
- package/dist/datagrid/events/generateEvents.d.ts +2 -0
- package/dist/datagrid/events/generateEvents.js +16 -0
- package/dist/datagrid/events/index.d.ts +2 -0
- package/dist/datagrid/events/index.js +2 -0
- package/dist/datagrid/events/models/RowUpdatedArgs.d.ts +5 -0
- package/dist/datagrid/events/models/RowUpdatedArgs.js +1 -0
- package/dist/datagrid/events/models/SveltixEvents.d.ts +20 -0
- package/dist/datagrid/events/models/SveltixEvents.js +1 -0
- package/dist/datagrid/events/models/index.d.ts +2 -0
- package/dist/datagrid/events/models/index.js +2 -0
- package/dist/datagrid/index.d.ts +5 -0
- package/dist/datagrid/index.js +5 -0
- package/dist/datagrid/interfaces/ISveltixGrid.d.ts +22 -0
- package/dist/datagrid/interfaces/ISveltixGrid.js +1 -0
- package/dist/datagrid/interfaces/Module.d.ts +11 -0
- package/dist/datagrid/interfaces/Module.js +13 -0
- package/dist/datagrid/interfaces/index.d.ts +2 -0
- package/dist/datagrid/interfaces/index.js +2 -0
- package/dist/datagrid/models/BaseColumn.d.ts +23 -0
- package/dist/datagrid/models/BaseColumn.js +1 -0
- package/dist/datagrid/models/Formatter.d.ts +32 -0
- package/dist/datagrid/models/Formatter.js +7 -0
- package/dist/datagrid/models/SveltixGridOptions.d.ts +12 -0
- package/dist/datagrid/models/SveltixGridOptions.js +1 -0
- package/dist/datagrid/models/Value.d.ts +21 -0
- package/dist/datagrid/models/Value.js +6 -0
- package/dist/datagrid/models/index.d.ts +4 -0
- package/dist/datagrid/models/index.js +4 -0
- package/dist/datagrid/models/module/ModuleConstructor.d.ts +5 -0
- package/dist/datagrid/models/module/ModuleConstructor.js +1 -0
- package/dist/datagrid/models/module/ModuleRegistrationEntry.d.ts +6 -0
- package/dist/datagrid/models/module/ModuleRegistrationEntry.js +1 -0
- package/dist/datagrid/models/module/index.d.ts +2 -0
- package/dist/datagrid/models/module/index.js +2 -0
- package/dist/datagrid/modules/flash/FlashModule.svelte.d.ts +9 -0
- package/dist/datagrid/modules/flash/FlashModule.svelte.js +33 -0
- package/dist/datagrid/modules/flash/index.d.ts +5 -0
- package/dist/datagrid/modules/flash/index.js +10 -0
- package/dist/datagrid/modules/flash/models/FlashModuleOptions.d.ts +4 -0
- package/dist/datagrid/modules/flash/models/FlashModuleOptions.js +1 -0
- package/dist/datagrid/modules/flash/models/index.d.ts +1 -0
- package/dist/datagrid/modules/flash/models/index.js +1 -0
- package/dist/datagrid/modules/resize/ResizeModule.svelte.d.ts +14 -0
- package/dist/datagrid/modules/resize/ResizeModule.svelte.js +68 -0
- package/dist/datagrid/modules/resize/components/ResizeCustomComponent.svelte +15 -0
- package/dist/datagrid/modules/resize/components/ResizeCustomComponent.svelte.d.ts +25 -0
- package/dist/datagrid/modules/resize/components/ResizeHandle.svelte +29 -0
- package/dist/datagrid/modules/resize/components/ResizeHandle.svelte.d.ts +28 -0
- package/dist/datagrid/modules/resize/index.d.ts +5 -0
- package/dist/datagrid/modules/resize/index.js +12 -0
- package/dist/datagrid/modules/resize/models/ResizeModuleOptions.d.ts +15 -0
- package/dist/datagrid/modules/resize/models/ResizeModuleOptions.js +1 -0
- package/dist/datagrid/modules/resize/models/index.d.ts +1 -0
- package/dist/datagrid/modules/resize/models/index.js +1 -0
- package/dist/deep-equal/deepEqual.d.ts +7 -0
- package/dist/deep-equal/deepEqual.js +79 -0
- package/dist/deep-equal/index.d.ts +1 -0
- package/dist/deep-equal/index.js +1 -0
- package/dist/di/DiContainer.d.ts +20 -0
- package/dist/di/DiContainer.js +42 -0
- package/dist/event-bus/EventBus.d.ts +9 -0
- package/dist/event-bus/EventBus.js +38 -0
- package/dist/event-bus/createEventDefinition.d.ts +1 -0
- package/dist/event-bus/createEventDefinition.js +5 -0
- package/dist/event-bus/index.d.ts +3 -0
- package/dist/event-bus/index.js +3 -0
- package/dist/event-bus/models/Event.d.ts +6 -0
- package/dist/event-bus/models/Event.js +1 -0
- package/dist/event-bus/models/SubscriberEntry.d.ts +5 -0
- package/dist/event-bus/models/SubscriberEntry.js +1 -0
- package/dist/event-bus/models/SubscriberSignature.d.ts +3 -0
- package/dist/event-bus/models/SubscriberSignature.js +1 -0
- package/dist/event-bus/models/UnsubscribeSignature.d.ts +3 -0
- package/dist/event-bus/models/UnsubscribeSignature.js +1 -0
- package/dist/event-bus/models/index.d.ts +4 -0
- package/dist/event-bus/models/index.js +4 -0
- package/dist/groupBy/groupBy.d.ts +2 -0
- package/dist/groupBy/groupBy.js +22 -0
- package/dist/groupBy/index.d.ts +2 -0
- package/dist/groupBy/index.js +2 -0
- package/dist/groupBy/models/Grouping.d.ts +4 -0
- package/dist/groupBy/models/Grouping.js +1 -0
- package/dist/groupBy/models/index.d.ts +1 -0
- package/dist/groupBy/models/index.js +1 -0
- package/dist/heading/Heading.svelte +28 -0
- package/dist/heading/Heading.svelte.d.ts +4 -0
- package/dist/heading/HeadingComponent.svelte.d.ts +13 -0
- package/dist/heading/HeadingComponent.svelte.js +20 -0
- package/dist/heading/HeadingStyles.d.ts +11 -0
- package/dist/heading/HeadingStyles.js +1 -0
- package/dist/heading/__tests__/HeadingBuilder.d.ts +12 -0
- package/dist/heading/__tests__/HeadingBuilder.js +34 -0
- package/dist/heading/__tests__/HeadingStory.svelte +16 -0
- package/dist/heading/__tests__/HeadingStory.svelte.d.ts +10 -0
- package/dist/heading/headingClasses.d.ts +8 -0
- package/dist/heading/headingClasses.js +8 -0
- package/dist/heading/index.d.ts +5 -0
- package/dist/heading/index.js +8 -0
- package/dist/heading/internal/DefaultHeadingStyles.d.ts +15 -0
- package/dist/heading/internal/DefaultHeadingStyles.js +75 -0
- package/dist/heading/models/Align.d.ts +8 -0
- package/dist/heading/models/Align.js +9 -0
- package/dist/heading/models/HeadingProps.d.ts +25 -0
- package/dist/heading/models/HeadingProps.js +1 -0
- package/dist/heading/models/HeadingTag.d.ts +1 -0
- package/dist/heading/models/HeadingTag.js +1 -0
- package/dist/heading/models/index.d.ts +3 -0
- package/dist/heading/models/index.js +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/ordered-map/OrderedMap.svelte.d.ts +27 -0
- package/dist/ordered-map/OrderedMap.svelte.js +138 -0
- package/dist/ordered-map/__tests__/builders/OrderedMapBuilder.d.ts +9 -0
- package/dist/ordered-map/__tests__/builders/OrderedMapBuilder.js +26 -0
- package/dist/ordered-map/index.d.ts +1 -0
- package/dist/ordered-map/index.js +1 -0
- package/dist/paragraph/P.svelte +21 -0
- package/dist/paragraph/P.svelte.d.ts +4 -0
- package/dist/paragraph/PComponents.svelte.d.ts +13 -0
- package/dist/paragraph/PComponents.svelte.js +20 -0
- package/dist/paragraph/ParagraphStyles.d.ts +11 -0
- package/dist/paragraph/ParagraphStyles.js +1 -0
- package/dist/paragraph/__tests__/PStory.svelte +15 -0
- package/dist/paragraph/__tests__/PStory.svelte.d.ts +10 -0
- package/dist/paragraph/__tests__/ParagraphBuilder.d.ts +10 -0
- package/dist/paragraph/__tests__/ParagraphBuilder.js +28 -0
- package/dist/paragraph/index.d.ts +5 -0
- package/dist/paragraph/index.js +8 -0
- package/dist/paragraph/internal/DefaultParagraphStyles.d.ts +15 -0
- package/dist/paragraph/internal/DefaultParagraphStyles.js +61 -0
- package/dist/paragraph/internal/classes.d.ts +6 -0
- package/dist/paragraph/internal/classes.js +7 -0
- package/dist/paragraph/models/PFont.d.ts +4 -0
- package/dist/paragraph/models/PFont.js +5 -0
- package/dist/paragraph/models/PProps.d.ts +12 -0
- package/dist/paragraph/models/PProps.js +1 -0
- package/dist/paragraph/models/PSize.d.ts +6 -0
- package/dist/paragraph/models/PSize.js +7 -0
- package/dist/paragraph/models/index.d.ts +3 -0
- package/dist/paragraph/models/index.js +3 -0
- package/dist/theme/Component.svelte.d.ts +13 -0
- package/dist/theme/Component.svelte.js +20 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.js +2 -0
- package/dist/theme/models/ThemableComponent.d.ts +6 -0
- package/dist/theme/models/ThemableComponent.js +1 -0
- package/dist/theme/models/Theme.d.ts +9 -0
- package/dist/theme/models/Theme.js +10 -0
- package/dist/theme/models/index.d.ts +2 -0
- package/dist/theme/models/index.js +2 -0
- package/dist/theme/themeDefaults.d.ts +2 -0
- package/dist/theme/themeDefaults.js +2 -0
- package/dist/types/KeysOfType.d.ts +3 -0
- package/dist/types/KeysOfType.js +1 -0
- package/dist/types/SurfaceContainerStyles.d.ts +4 -0
- package/dist/types/SurfaceContainerStyles.js +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where to place custom component.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum CustomComponentPosition {
|
|
5
|
+
/**
|
|
6
|
+
* Place it above the table itself.
|
|
7
|
+
*/
|
|
8
|
+
Action = "Action",
|
|
9
|
+
/**
|
|
10
|
+
* Place it to the left of the table.
|
|
11
|
+
*/
|
|
12
|
+
Left = "Left",
|
|
13
|
+
/**
|
|
14
|
+
* Place it at the footer of the table.
|
|
15
|
+
*/
|
|
16
|
+
Footer = "Footer",
|
|
17
|
+
/**
|
|
18
|
+
* Place it to the rigt of the table
|
|
19
|
+
*/
|
|
20
|
+
Right = "Right"
|
|
21
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where to place custom component.
|
|
3
|
+
*/
|
|
4
|
+
export var CustomComponentPosition;
|
|
5
|
+
(function (CustomComponentPosition) {
|
|
6
|
+
/**
|
|
7
|
+
* Place it above the table itself.
|
|
8
|
+
*/
|
|
9
|
+
CustomComponentPosition["Action"] = "Action";
|
|
10
|
+
/**
|
|
11
|
+
* Place it to the left of the table.
|
|
12
|
+
*/
|
|
13
|
+
CustomComponentPosition["Left"] = "Left";
|
|
14
|
+
/**
|
|
15
|
+
* Place it at the footer of the table.
|
|
16
|
+
*/
|
|
17
|
+
CustomComponentPosition["Footer"] = "Footer";
|
|
18
|
+
/**
|
|
19
|
+
* Place it to the rigt of the table
|
|
20
|
+
*/
|
|
21
|
+
CustomComponentPosition["Right"] = "Right";
|
|
22
|
+
})(CustomComponentPosition || (CustomComponentPosition = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Module, type ISveltixGrid } from '../../interfaces';
|
|
2
|
+
import type { CallbackSignature } from './models/CallbackSignature';
|
|
3
|
+
export declare class PipelinesModule<T> extends Module<T> {
|
|
4
|
+
private _entries;
|
|
5
|
+
constructor(api: ISveltixGrid<T>);
|
|
6
|
+
addCallback(callback: CallbackSignature<T>, id: string, order?: number): void;
|
|
7
|
+
execute(from?: string): void;
|
|
8
|
+
private getIndex;
|
|
9
|
+
private getData;
|
|
10
|
+
init(): void;
|
|
11
|
+
uninit(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Module } from '../../interfaces';
|
|
2
|
+
export class PipelinesModule extends Module {
|
|
3
|
+
_entries = [];
|
|
4
|
+
constructor(api) {
|
|
5
|
+
super(api);
|
|
6
|
+
}
|
|
7
|
+
addCallback(callback, id, order) {
|
|
8
|
+
order ??= 100;
|
|
9
|
+
this._entries.push({
|
|
10
|
+
id,
|
|
11
|
+
order,
|
|
12
|
+
callback,
|
|
13
|
+
previousRunResponse: {
|
|
14
|
+
columns: [],
|
|
15
|
+
rows: [],
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
this._entries.sort((first, second) => first.order - second.order);
|
|
19
|
+
}
|
|
20
|
+
execute(from) {
|
|
21
|
+
const indexToStartFrom = this.getIndex(from);
|
|
22
|
+
for (let index = indexToStartFrom; index < this._entries.length; index++) {
|
|
23
|
+
const entry = this._entries[index];
|
|
24
|
+
const dataToUse = this.getData(index);
|
|
25
|
+
const response = entry.callback(dataToUse.rows, dataToUse.columns);
|
|
26
|
+
this._entries[index].previousRunResponse = response;
|
|
27
|
+
}
|
|
28
|
+
const lastEntry = this._entries[this._entries.length - 1];
|
|
29
|
+
this._api.emit(this._api.events.pipeline.executed, {
|
|
30
|
+
rows: lastEntry.previousRunResponse.rows,
|
|
31
|
+
columns: lastEntry.previousRunResponse.columns,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
getIndex(from) {
|
|
35
|
+
if (from == null) {
|
|
36
|
+
return 0;
|
|
37
|
+
}
|
|
38
|
+
const foundIndex = this._entries.findIndex((entry) => entry.id === from);
|
|
39
|
+
if (foundIndex === -1) {
|
|
40
|
+
return 0;
|
|
41
|
+
}
|
|
42
|
+
return foundIndex;
|
|
43
|
+
}
|
|
44
|
+
getData(index) {
|
|
45
|
+
if (index === 0) {
|
|
46
|
+
return {
|
|
47
|
+
rows: [],
|
|
48
|
+
columns: [],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
rows: this._entries[index - 1].previousRunResponse.rows,
|
|
53
|
+
columns: this._entries[index - 1].previousRunResponse.columns,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
init() { }
|
|
57
|
+
uninit() { }
|
|
58
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PipelinesModule } from './PipelinesModule.svelte';
|
|
2
|
+
export * from './PipelinesModule.svelte';
|
|
3
|
+
export const PIPELINES_MODULE = Symbol.for('PIPELINES_MODULE');
|
|
4
|
+
export function pipelinesModule() {
|
|
5
|
+
return {
|
|
6
|
+
key: PIPELINES_MODULE,
|
|
7
|
+
module: (PipelinesModule),
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
+
options: undefined,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Column } from '../../columns/Column.svelte';
|
|
2
|
+
import type { Row } from '../../rows';
|
|
3
|
+
export interface PipelineResponse<T> {
|
|
4
|
+
rows: Row<T>[];
|
|
5
|
+
columns: Column<T>[];
|
|
6
|
+
}
|
|
7
|
+
export interface CallbackSignature<T> {
|
|
8
|
+
(rows: Row<T>[], columns: Column<T>[]): PipelineResponse<T>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ISveltixGrid } from '../..';
|
|
2
|
+
import { type Column, type Formatted } from '../columns/Column.svelte';
|
|
3
|
+
import type { Row } from './Row.svelte';
|
|
4
|
+
export declare class Cell<T> {
|
|
5
|
+
get id(): string;
|
|
6
|
+
get value(): unknown;
|
|
7
|
+
get format(): Formatted<T>;
|
|
8
|
+
get column(): Column<T>;
|
|
9
|
+
get row(): Row<T>;
|
|
10
|
+
get class(): string;
|
|
11
|
+
private _api;
|
|
12
|
+
private _row;
|
|
13
|
+
private _column;
|
|
14
|
+
private _id;
|
|
15
|
+
private _value;
|
|
16
|
+
private _classes;
|
|
17
|
+
private _format;
|
|
18
|
+
constructor(api: ISveltixGrid<T>, row: Row<T>, column: Column<T>);
|
|
19
|
+
getDom(): HTMLDivElement | undefined;
|
|
20
|
+
getWidth(): number | undefined;
|
|
21
|
+
setClasses(classes: string[]): void;
|
|
22
|
+
removeClasses(classes: string[]): void;
|
|
23
|
+
updated(row: Row<T>): boolean;
|
|
24
|
+
setValue(value: unknown): void;
|
|
25
|
+
setFormat(format: Formatted<T>): void;
|
|
26
|
+
private formatChanged;
|
|
27
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { FormatterValue } from '../columns/Column.svelte';
|
|
2
|
+
export class Cell {
|
|
3
|
+
get id() {
|
|
4
|
+
return this._id;
|
|
5
|
+
}
|
|
6
|
+
get value() {
|
|
7
|
+
return this._value;
|
|
8
|
+
}
|
|
9
|
+
get format() {
|
|
10
|
+
return this._format;
|
|
11
|
+
}
|
|
12
|
+
get column() {
|
|
13
|
+
return this._column;
|
|
14
|
+
}
|
|
15
|
+
get row() {
|
|
16
|
+
return this._row;
|
|
17
|
+
}
|
|
18
|
+
get class() {
|
|
19
|
+
return this._classes.join(' ');
|
|
20
|
+
}
|
|
21
|
+
_api;
|
|
22
|
+
_row = undefined;
|
|
23
|
+
_column;
|
|
24
|
+
_id;
|
|
25
|
+
_value = $state();
|
|
26
|
+
_classes = $state([]);
|
|
27
|
+
_format = $state();
|
|
28
|
+
constructor(api, row, column) {
|
|
29
|
+
this._api = api;
|
|
30
|
+
this._column = column;
|
|
31
|
+
this._id = `${row.id}x${this._column.id}`;
|
|
32
|
+
this.updated(row);
|
|
33
|
+
}
|
|
34
|
+
getDom() {
|
|
35
|
+
const selector = `[data-bodycellid="${this._id}"]`;
|
|
36
|
+
const dom = this._api.dom.querySelector(selector);
|
|
37
|
+
if (dom == null) {
|
|
38
|
+
// console.log(`Couldn't find DOM for '${selector}'`);
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
return dom;
|
|
42
|
+
}
|
|
43
|
+
getWidth() {
|
|
44
|
+
const dom = this.getDom();
|
|
45
|
+
if (dom == null) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
const rect = dom.getBoundingClientRect();
|
|
49
|
+
return rect.width;
|
|
50
|
+
}
|
|
51
|
+
setClasses(classes) {
|
|
52
|
+
const allClasses = new Set(...this._classes, ...classes);
|
|
53
|
+
this._classes = Array.from(allClasses);
|
|
54
|
+
}
|
|
55
|
+
removeClasses(classes) {
|
|
56
|
+
const allClasses = new Set(...this._classes);
|
|
57
|
+
for (const cssClass of classes) {
|
|
58
|
+
allClasses.delete(cssClass);
|
|
59
|
+
}
|
|
60
|
+
this._classes = Array.from(allClasses);
|
|
61
|
+
}
|
|
62
|
+
updated(row) {
|
|
63
|
+
this._row = row;
|
|
64
|
+
const value = this._column.getValue(this._row);
|
|
65
|
+
if (value !== this._value) {
|
|
66
|
+
this._value = value;
|
|
67
|
+
}
|
|
68
|
+
const oldFormatter = this._format;
|
|
69
|
+
this._format = this._column.format(this._value, this._row);
|
|
70
|
+
this._row.setCell(this._column.id, this);
|
|
71
|
+
const formatChanged = this.formatChanged(oldFormatter, this._format);
|
|
72
|
+
return formatChanged;
|
|
73
|
+
}
|
|
74
|
+
setValue(value) {
|
|
75
|
+
this._value = value;
|
|
76
|
+
this._column.clearCache(this._row);
|
|
77
|
+
this._format = this._column.format(this._value, this._row);
|
|
78
|
+
}
|
|
79
|
+
setFormat(format) {
|
|
80
|
+
this._format = format;
|
|
81
|
+
this._column.clearCache(this._row);
|
|
82
|
+
}
|
|
83
|
+
formatChanged(oldFormat, newFormat) {
|
|
84
|
+
if (oldFormat == null && newFormat == null) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
if (oldFormat == null && newFormat != null) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
if (oldFormat != null && newFormat == null) {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
const oldF = oldFormat;
|
|
94
|
+
const newF = newFormat;
|
|
95
|
+
if (oldF.mode !== newF.mode) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
if (oldF.mode === FormatterValue.Static && newF.mode === FormatterValue.Static) {
|
|
99
|
+
return oldF.format !== newF.format;
|
|
100
|
+
}
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Cell } from './Cell.svelte';
|
|
2
|
+
import type { CreateRowOptions } from './internal/CreateRowOptions';
|
|
3
|
+
export declare class Row<T> {
|
|
4
|
+
get data(): T | undefined;
|
|
5
|
+
get id(): string;
|
|
6
|
+
get index(): number;
|
|
7
|
+
get cells(): Cell<T>[];
|
|
8
|
+
get removed(): boolean;
|
|
9
|
+
private _data;
|
|
10
|
+
private _id;
|
|
11
|
+
private _index;
|
|
12
|
+
private _cells;
|
|
13
|
+
private _api;
|
|
14
|
+
private _updateData;
|
|
15
|
+
private _removed;
|
|
16
|
+
constructor(options: CreateRowOptions<T>);
|
|
17
|
+
update(data: T | undefined): void;
|
|
18
|
+
private generateCells;
|
|
19
|
+
getCell(columnId: string): Cell<T> | undefined;
|
|
20
|
+
setCell(columnId: string, cell: Cell<T>): void;
|
|
21
|
+
setValue(columnId: string, value: never): void;
|
|
22
|
+
private updateCells;
|
|
23
|
+
remove(): Row<T> | undefined;
|
|
24
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { ValueMode } from '../..';
|
|
2
|
+
import { deepEqual } from '../../../deep-equal';
|
|
3
|
+
import { OrderedMap } from '../../../ordered-map';
|
|
4
|
+
import { Cell } from './Cell.svelte';
|
|
5
|
+
export class Row {
|
|
6
|
+
get data() {
|
|
7
|
+
return this._data;
|
|
8
|
+
}
|
|
9
|
+
get id() {
|
|
10
|
+
return this._id;
|
|
11
|
+
}
|
|
12
|
+
get index() {
|
|
13
|
+
return this._index;
|
|
14
|
+
}
|
|
15
|
+
get cells() {
|
|
16
|
+
return this._cells.entries;
|
|
17
|
+
}
|
|
18
|
+
get removed() {
|
|
19
|
+
return this._removed;
|
|
20
|
+
}
|
|
21
|
+
_data = $state();
|
|
22
|
+
_id = $state('');
|
|
23
|
+
_index = $state(0);
|
|
24
|
+
_cells = $state(OrderedMap.create());
|
|
25
|
+
_api;
|
|
26
|
+
_updateData = false;
|
|
27
|
+
_removed = $state(false);
|
|
28
|
+
constructor(options) {
|
|
29
|
+
this._data = options.data;
|
|
30
|
+
this._id = options.id;
|
|
31
|
+
this._api = options.api;
|
|
32
|
+
this.generateCells(options.cells ?? []);
|
|
33
|
+
this.updateCells(options.cells ?? []);
|
|
34
|
+
}
|
|
35
|
+
update(data) {
|
|
36
|
+
this._updateData = true;
|
|
37
|
+
this._data = data;
|
|
38
|
+
this.updateCells([]);
|
|
39
|
+
}
|
|
40
|
+
generateCells(cells) {
|
|
41
|
+
for (const column of this._api.core.columns.columns) {
|
|
42
|
+
const cellCustom = cells.find((cell) => cell.columnId === column.id);
|
|
43
|
+
const cell = new Cell(this._api, this, column);
|
|
44
|
+
if (cellCustom?.value !== null) {
|
|
45
|
+
cell.setValue(cellCustom?.value);
|
|
46
|
+
}
|
|
47
|
+
if (cellCustom?.format != null) {
|
|
48
|
+
cell.setFormat(cellCustom.format);
|
|
49
|
+
}
|
|
50
|
+
this._cells.addBatched(cell.column.id, cell);
|
|
51
|
+
}
|
|
52
|
+
this._cells.batchedFinish();
|
|
53
|
+
}
|
|
54
|
+
getCell(columnId) {
|
|
55
|
+
return this._cells.getByKey(columnId);
|
|
56
|
+
}
|
|
57
|
+
setCell(columnId, cell) {
|
|
58
|
+
this._cells.setByKey(columnId, cell);
|
|
59
|
+
}
|
|
60
|
+
setValue(columnId, value) {
|
|
61
|
+
const column = this._api.core.columns.get(columnId);
|
|
62
|
+
if (column == null) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
let rowData = this._data;
|
|
66
|
+
if (rowData == null) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
switch (column.valueGetter?.mode) {
|
|
70
|
+
case ValueMode.Key: {
|
|
71
|
+
const canAssign = typeof rowData[column.valueGetter.key] === typeof value;
|
|
72
|
+
if (!canAssign) {
|
|
73
|
+
throw new Error("Given value must be the same as column's value");
|
|
74
|
+
}
|
|
75
|
+
rowData[column.valueGetter.key] = value;
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
case ValueMode.Callback:
|
|
79
|
+
if (column.valueGetter.set == null) {
|
|
80
|
+
throw new Error('Value setter must be set');
|
|
81
|
+
}
|
|
82
|
+
rowData = column.valueGetter.set(value, rowData);
|
|
83
|
+
break;
|
|
84
|
+
case ValueMode.Static:
|
|
85
|
+
throw new Error("Can't modify static data");
|
|
86
|
+
}
|
|
87
|
+
this.update(rowData);
|
|
88
|
+
}
|
|
89
|
+
updateCells(cells) {
|
|
90
|
+
const updateEntries = [];
|
|
91
|
+
for (const cell of this.cells) {
|
|
92
|
+
const cellCreate = cells.find((cellCreate) => cellCreate.columnId === cell.column.id);
|
|
93
|
+
const value = cellCreate?.value ?? cell.column.getValue(this, undefined, true);
|
|
94
|
+
const valuesEqual = deepEqual(value, cell.value);
|
|
95
|
+
if (valuesEqual) {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
cell.column.clearCache(this);
|
|
99
|
+
const cellFormatUpdated = cell.updated(this);
|
|
100
|
+
if (this._updateData && cellFormatUpdated) {
|
|
101
|
+
updateEntries.push({
|
|
102
|
+
row: this,
|
|
103
|
+
cell: cell,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (this._updateData && updateEntries.length > 0) {
|
|
108
|
+
this._api.emit(this._api.events.row.updated, updateEntries);
|
|
109
|
+
}
|
|
110
|
+
this._updateData = false;
|
|
111
|
+
}
|
|
112
|
+
remove() {
|
|
113
|
+
this._removed = true;
|
|
114
|
+
console.log('set removed to true');
|
|
115
|
+
return this._api.core.rows.remove(this._id);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Module, type ISveltixGrid } from '../../interfaces';
|
|
2
|
+
import type { RowsOptions } from './models/RowsOptions';
|
|
3
|
+
import { Row } from './Row.svelte';
|
|
4
|
+
export declare class RowsModule<T> extends Module<T> {
|
|
5
|
+
get visible(): Row<T>[];
|
|
6
|
+
get body(): Row<T>[];
|
|
7
|
+
private _options?;
|
|
8
|
+
private _id;
|
|
9
|
+
private _visible;
|
|
10
|
+
private _body;
|
|
11
|
+
constructor(api: ISveltixGrid<T>, options: RowsOptions<T> | undefined);
|
|
12
|
+
private onPipelinesExecuted;
|
|
13
|
+
add(row: T, rerun?: boolean): void;
|
|
14
|
+
/**
|
|
15
|
+
* Create new rows in the datagrid.
|
|
16
|
+
* @param rows Rows to create.
|
|
17
|
+
*/
|
|
18
|
+
create(rows: T[], rerun?: boolean): void;
|
|
19
|
+
private rowsCreate;
|
|
20
|
+
private generateRow;
|
|
21
|
+
getId(row: T): string;
|
|
22
|
+
/**
|
|
23
|
+
* Moves row from one one place to another.
|
|
24
|
+
* @param from ID of the row to move.
|
|
25
|
+
* @param to ID of the row to move to.
|
|
26
|
+
*/
|
|
27
|
+
move(from: string, to: string, after?: boolean): void;
|
|
28
|
+
get(key: string): Row<T> | undefined;
|
|
29
|
+
getByIndex(index: number): Row<T> | undefined;
|
|
30
|
+
remove(id: string): Row<T> | undefined;
|
|
31
|
+
init(): void;
|
|
32
|
+
uninit(): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { Module } from '../../interfaces';
|
|
2
|
+
import { OrderedMap } from '../../../ordered-map';
|
|
3
|
+
import { Row } from './Row.svelte';
|
|
4
|
+
export class RowsModule extends Module {
|
|
5
|
+
get visible() {
|
|
6
|
+
return this._visible.entries;
|
|
7
|
+
}
|
|
8
|
+
get body() {
|
|
9
|
+
return this._body.entries;
|
|
10
|
+
}
|
|
11
|
+
_options;
|
|
12
|
+
_id = 0;
|
|
13
|
+
_visible = $state(OrderedMap.create());
|
|
14
|
+
_body = $state(OrderedMap.create());
|
|
15
|
+
constructor(api, options) {
|
|
16
|
+
super(api);
|
|
17
|
+
this._options = options;
|
|
18
|
+
}
|
|
19
|
+
onPipelinesExecuted(rows) {
|
|
20
|
+
this._visible.clear();
|
|
21
|
+
rows.forEach((row) => this._visible.add(row.id, row));
|
|
22
|
+
}
|
|
23
|
+
add(row, rerun) {
|
|
24
|
+
rerun ??= false;
|
|
25
|
+
const rowObject = this.generateRow(row);
|
|
26
|
+
if (!rerun) {
|
|
27
|
+
this._visible.add(rowObject.id, rowObject);
|
|
28
|
+
}
|
|
29
|
+
this._body.add(rowObject.id, rowObject);
|
|
30
|
+
if (rerun) {
|
|
31
|
+
this._api.core.pipelines.execute();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Create new rows in the datagrid.
|
|
36
|
+
* @param rows Rows to create.
|
|
37
|
+
*/
|
|
38
|
+
create(rows, rerun) {
|
|
39
|
+
this._visible.clear();
|
|
40
|
+
this._body.clear();
|
|
41
|
+
rerun ??= false;
|
|
42
|
+
console.time('Create rows');
|
|
43
|
+
this.rowsCreate(rows, rerun);
|
|
44
|
+
this._body.batchedFinish();
|
|
45
|
+
console.timeEnd('Create rows');
|
|
46
|
+
if (rerun) {
|
|
47
|
+
this._api.core.pipelines.execute();
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
this._visible.batchedFinish();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
rowsCreate(rows, rerun) {
|
|
54
|
+
for (const row of rows) {
|
|
55
|
+
const rowObject = this.generateRow(row);
|
|
56
|
+
this._body.addBatched(rowObject.id, rowObject);
|
|
57
|
+
if (!rerun) {
|
|
58
|
+
this._visible.addBatched(rowObject.id, rowObject);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
generateRow(row) {
|
|
63
|
+
const id = this.getId(row);
|
|
64
|
+
const rowObject = new Row({
|
|
65
|
+
id: id,
|
|
66
|
+
data: row,
|
|
67
|
+
api: this._api,
|
|
68
|
+
isGroup: true,
|
|
69
|
+
});
|
|
70
|
+
return rowObject;
|
|
71
|
+
}
|
|
72
|
+
getId(row) {
|
|
73
|
+
if (this._options?.getRowId == null) {
|
|
74
|
+
const id = this._id;
|
|
75
|
+
this._id += 1;
|
|
76
|
+
return id.toString();
|
|
77
|
+
}
|
|
78
|
+
return this._options.getRowId(row);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Moves row from one one place to another.
|
|
82
|
+
* @param from ID of the row to move.
|
|
83
|
+
* @param to ID of the row to move to.
|
|
84
|
+
*/
|
|
85
|
+
move(from, to, after) {
|
|
86
|
+
if (after == null) {
|
|
87
|
+
after = true;
|
|
88
|
+
}
|
|
89
|
+
this._visible.move(from, to, after);
|
|
90
|
+
}
|
|
91
|
+
get(key) {
|
|
92
|
+
return this._body.getByKey(key);
|
|
93
|
+
}
|
|
94
|
+
getByIndex(index) {
|
|
95
|
+
return this._body.getByIndex(index);
|
|
96
|
+
}
|
|
97
|
+
remove(id) {
|
|
98
|
+
const removedRow = this._body.remove(id);
|
|
99
|
+
if (removedRow == null) {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
this._visible.remove(id);
|
|
103
|
+
this._api.emit(this._api.events.row.removed, removedRow);
|
|
104
|
+
return removedRow;
|
|
105
|
+
}
|
|
106
|
+
init() {
|
|
107
|
+
this._api.core.pipelines.addCallback((_rows, columns) => ({
|
|
108
|
+
columns: columns,
|
|
109
|
+
rows: this._body.entries,
|
|
110
|
+
}), 'rows', 0);
|
|
111
|
+
const onExecutedSub = this._api.on(this._api.events.pipeline.executed, (data) => this.onPipelinesExecuted(data.rows));
|
|
112
|
+
this.addUnsub(onExecutedSub);
|
|
113
|
+
}
|
|
114
|
+
uninit() { }
|
|
115
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script
|
|
2
|
+
lang="ts"
|
|
3
|
+
generics="T">
|
|
4
|
+
import type { ISveltixGrid } from '../../../..';
|
|
5
|
+
import { FormatterValue } from '../../../columns/Column.svelte';
|
|
6
|
+
import type { Cell } from '../../Cell.svelte';
|
|
7
|
+
|
|
8
|
+
interface BodyCellProps<T> {
|
|
9
|
+
cell: Cell<T>;
|
|
10
|
+
api: ISveltixGrid<T>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const { api, cell }: BodyCellProps<T> = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<div
|
|
17
|
+
data-bodycellid={cell.id}
|
|
18
|
+
class="px-4 h-12 flex items-center border-b group-last:border-b-0 whitespace-nowrap overflow-hidden {cell.class}"
|
|
19
|
+
style="max-width: {cell.column.width}px; min-width: {cell.column.width}px">
|
|
20
|
+
{#if cell.format.mode === FormatterValue.Static}
|
|
21
|
+
<span class="text-nowrap overflow-hidden text-ellipsis">
|
|
22
|
+
{cell.format.format}
|
|
23
|
+
</span>
|
|
24
|
+
{:else if cell.format.mode === FormatterValue.Snippet}
|
|
25
|
+
{@render cell.format.snippet(cell.value)}
|
|
26
|
+
{:else if cell.format.mode === FormatterValue.Component}
|
|
27
|
+
<cell.format.component
|
|
28
|
+
{api}
|
|
29
|
+
{cell} />
|
|
30
|
+
{/if}
|
|
31
|
+
</div>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ISveltixGrid } from '../../../..';
|
|
2
|
+
import type { Cell } from '../../Cell.svelte';
|
|
3
|
+
interface BodyCellProps<T> {
|
|
4
|
+
cell: Cell<T>;
|
|
5
|
+
api: ISveltixGrid<T>;
|
|
6
|
+
}
|
|
7
|
+
declare function $$render<T>(): {
|
|
8
|
+
props: BodyCellProps<T>;
|
|
9
|
+
exports: {};
|
|
10
|
+
bindings: "";
|
|
11
|
+
slots: {};
|
|
12
|
+
events: {};
|
|
13
|
+
};
|
|
14
|
+
declare class __sveltets_Render<T> {
|
|
15
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
16
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
17
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
18
|
+
bindings(): "";
|
|
19
|
+
exports(): {};
|
|
20
|
+
}
|
|
21
|
+
interface $$IsomorphicComponent {
|
|
22
|
+
new <T>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
23
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
24
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
25
|
+
<T>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
26
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
27
|
+
}
|
|
28
|
+
declare const BodyCell: $$IsomorphicComponent;
|
|
29
|
+
type BodyCell<T> = InstanceType<typeof BodyCell<T>>;
|
|
30
|
+
export default BodyCell;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script
|
|
2
|
+
lang="ts"
|
|
3
|
+
generics="T">
|
|
4
|
+
import type { FormatterComponentProps } from '../../../../models';
|
|
5
|
+
|
|
6
|
+
const { cell }: FormatterComponentProps<T> = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
{#if cell.row.children.length > 0 && cell.column.id === 'group'}
|
|
10
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
11
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
12
|
+
<span
|
|
13
|
+
class="flex gap-2 w-full h-full items-center line-clamp-1"
|
|
14
|
+
style="padding-left: {cell.row.childLevel * 4}px;"
|
|
15
|
+
onclick={() => cell.row.toggleGroupOpen()}>
|
|
16
|
+
<span class="w-2">
|
|
17
|
+
{#if !cell.row.groupOpen}
|
|
18
|
+
/\
|
|
19
|
+
{:else}
|
|
20
|
+
>
|
|
21
|
+
{/if}
|
|
22
|
+
</span>
|
|
23
|
+
{cell.value}
|
|
24
|
+
({cell.row.children.length})
|
|
25
|
+
</span>
|
|
26
|
+
{/if}
|