@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,25 @@
|
|
|
1
|
+
import type { FormatterComponentProps } from '../../../../models';
|
|
2
|
+
declare function $$render<T>(): {
|
|
3
|
+
props: FormatterComponentProps<T>;
|
|
4
|
+
exports: {};
|
|
5
|
+
bindings: "";
|
|
6
|
+
slots: {};
|
|
7
|
+
events: {};
|
|
8
|
+
};
|
|
9
|
+
declare class __sveltets_Render<T> {
|
|
10
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
11
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
12
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
13
|
+
bindings(): "";
|
|
14
|
+
exports(): {};
|
|
15
|
+
}
|
|
16
|
+
interface $$IsomorphicComponent {
|
|
17
|
+
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']>> & {
|
|
18
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
19
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
20
|
+
<T>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
21
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
22
|
+
}
|
|
23
|
+
declare const GroupCell: $$IsomorphicComponent;
|
|
24
|
+
type GroupCell<T> = InstanceType<typeof GroupCell<T>>;
|
|
25
|
+
export default GroupCell;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ModuleRegistrationEntry } from '../../models';
|
|
2
|
+
import type { RowsOptions } from './models/RowsOptions';
|
|
3
|
+
export * from './RowsModule.svelte';
|
|
4
|
+
export declare const ROWS_MODULE: unique symbol;
|
|
5
|
+
export declare function rowsModule<T>(options?: RowsOptions<T>): ModuleRegistrationEntry<T, RowsOptions<T> | undefined>;
|
|
6
|
+
export * from './Row.svelte';
|
|
7
|
+
export * from './Cell.svelte';
|
|
8
|
+
export * from './models';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RowsModule } from './RowsModule.svelte';
|
|
2
|
+
export * from './RowsModule.svelte';
|
|
3
|
+
export const ROWS_MODULE = Symbol.for('ROWS_MODULE');
|
|
4
|
+
export function rowsModule(options) {
|
|
5
|
+
return {
|
|
6
|
+
key: ROWS_MODULE,
|
|
7
|
+
module: (RowsModule),
|
|
8
|
+
options: options,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export * from './Row.svelte';
|
|
12
|
+
export * from './Cell.svelte';
|
|
13
|
+
export * from './models';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ISveltixGrid, Row } from '../../..';
|
|
2
|
+
import type { Formatted } from '../../columns/Column.svelte';
|
|
3
|
+
export interface RowCreateCell<T> {
|
|
4
|
+
value?: unknown;
|
|
5
|
+
format?: Formatted<T>;
|
|
6
|
+
columnId: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CreateRowOptions<T> {
|
|
9
|
+
data: T;
|
|
10
|
+
id: string;
|
|
11
|
+
api: ISveltixGrid<T>;
|
|
12
|
+
parent?: Row<T>;
|
|
13
|
+
isGroup?: boolean;
|
|
14
|
+
cells?: RowCreateCell<T>[];
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RowsOptions';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RowsOptions';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createEventDefinition } from '../../event-bus';
|
|
2
|
+
export function generateEvent() {
|
|
3
|
+
return {
|
|
4
|
+
row: {
|
|
5
|
+
created: createEventDefinition('row/created'),
|
|
6
|
+
updated: createEventDefinition('row/updated'),
|
|
7
|
+
removed: createEventDefinition('row/removed'),
|
|
8
|
+
},
|
|
9
|
+
column: {
|
|
10
|
+
created: createEventDefinition('column/created'),
|
|
11
|
+
},
|
|
12
|
+
pipeline: {
|
|
13
|
+
executed: createEventDefinition('pipeline/executed'),
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Row } from '../../core-modules';
|
|
2
|
+
import type { Column } from '../../core-modules/columns/Column.svelte';
|
|
3
|
+
import type { Event } from '../../../event-bus';
|
|
4
|
+
import type { RowUpdatedArgs } from './RowUpdatedArgs';
|
|
5
|
+
export interface SveltixEvents<T> {
|
|
6
|
+
row: {
|
|
7
|
+
created: Event<Row<T>[]>;
|
|
8
|
+
updated: Event<RowUpdatedArgs<T>[]>;
|
|
9
|
+
removed: Event<Row<T>>;
|
|
10
|
+
};
|
|
11
|
+
column: {
|
|
12
|
+
created: Event<Column<T>[]>;
|
|
13
|
+
};
|
|
14
|
+
pipeline: {
|
|
15
|
+
executed: Event<{
|
|
16
|
+
rows: Row<T>[];
|
|
17
|
+
columns: Column<T>[];
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SubscriberSignature, UnsubscribeSignature, Event } from '../../event-bus';
|
|
2
|
+
import type { SveltixEvents } from '../events';
|
|
3
|
+
import type { ModuleRegistrationEntry } from '../models';
|
|
4
|
+
import type { CoreModules } from '../SveltixGrid.svelte';
|
|
5
|
+
export interface ISveltixGrid<T> {
|
|
6
|
+
get dom(): HTMLDivElement;
|
|
7
|
+
get core(): CoreModules<T>;
|
|
8
|
+
get events(): SveltixEvents<T>;
|
|
9
|
+
on<TEvent>(event: Event<TEvent>, callback: SubscriberSignature<TEvent>): UnsubscribeSignature;
|
|
10
|
+
emit<TEvent>(event: Event<TEvent>, data: TEvent): void;
|
|
11
|
+
/**
|
|
12
|
+
* Registers wanted module.
|
|
13
|
+
* @param entry Module's registration entry.
|
|
14
|
+
*/
|
|
15
|
+
addModule<TOption>(entry: ModuleRegistrationEntry<T, TOption>): void;
|
|
16
|
+
/**
|
|
17
|
+
* Retrieve registered module.
|
|
18
|
+
* @param id Identifaction for the module.
|
|
19
|
+
*/
|
|
20
|
+
getModule<TModule>(id: symbol): TModule;
|
|
21
|
+
destroy(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { UnsubscribeSignature } from '../../event-bus';
|
|
2
|
+
import type { ISveltixGrid } from '.';
|
|
3
|
+
export declare abstract class Module<T> {
|
|
4
|
+
private _unsubs;
|
|
5
|
+
protected _api: ISveltixGrid<T>;
|
|
6
|
+
constructor(api: ISveltixGrid<T>);
|
|
7
|
+
abstract init(): void;
|
|
8
|
+
abstract uninit(): void;
|
|
9
|
+
protected addUnsub(unsub: UnsubscribeSignature): void;
|
|
10
|
+
unsubscribe(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Formatter } from './Formatter';
|
|
2
|
+
import type { Value } from './Value';
|
|
3
|
+
/**
|
|
4
|
+
* Represents single column.
|
|
5
|
+
*/
|
|
6
|
+
export interface BaseColumn<T> {
|
|
7
|
+
/**
|
|
8
|
+
* Column's title.
|
|
9
|
+
*/
|
|
10
|
+
header: string;
|
|
11
|
+
/**
|
|
12
|
+
* A way to retrieve a value for the column.
|
|
13
|
+
*/
|
|
14
|
+
value: Value<T>;
|
|
15
|
+
/**
|
|
16
|
+
* Optional way for custom formatting. If not defined, value will be displayed as-is.
|
|
17
|
+
*/
|
|
18
|
+
format?: Formatter<T>;
|
|
19
|
+
/**
|
|
20
|
+
* ID to differentiate columns (if needed)
|
|
21
|
+
*/
|
|
22
|
+
id?: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Component, Snippet } from 'svelte';
|
|
2
|
+
import type { Cell, Row } from '../core-modules';
|
|
3
|
+
import type { ISveltixGrid } from '../interfaces';
|
|
4
|
+
export declare enum FormatterMode {
|
|
5
|
+
Callback = "Callback",
|
|
6
|
+
Static = "Static",
|
|
7
|
+
Snippet = "Snippet",
|
|
8
|
+
Component = "Component"
|
|
9
|
+
}
|
|
10
|
+
interface FormatterBase<T extends FormatterMode> {
|
|
11
|
+
mode: T;
|
|
12
|
+
}
|
|
13
|
+
interface FormatterCallback<T> extends FormatterBase<FormatterMode.Callback> {
|
|
14
|
+
format: (value: unknown, row: Row<T>) => string;
|
|
15
|
+
}
|
|
16
|
+
interface FormatterStatic extends FormatterBase<FormatterMode.Static> {
|
|
17
|
+
format: {
|
|
18
|
+
[key: string]: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
interface FormatterSnippet extends FormatterBase<FormatterMode.Snippet> {
|
|
22
|
+
snippet: Snippet<[value: any]>;
|
|
23
|
+
}
|
|
24
|
+
export interface FormatterComponentProps<T> {
|
|
25
|
+
api: ISveltixGrid<T>;
|
|
26
|
+
cell: Cell<T>;
|
|
27
|
+
}
|
|
28
|
+
interface FormatterComponent<T> extends FormatterBase<FormatterMode.Component> {
|
|
29
|
+
component: Component<FormatterComponentProps<T>>;
|
|
30
|
+
}
|
|
31
|
+
export type Formatter<T> = FormatterCallback<T> | FormatterStatic | FormatterSnippet | FormatterComponent<T>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RowsOptions } from '../core-modules/rows/models/RowsOptions';
|
|
2
|
+
import type { ModuleRegistrationEntry } from './module';
|
|
3
|
+
export interface SveltixGridOptions<T> {
|
|
4
|
+
/**
|
|
5
|
+
* Options for the rows' module.
|
|
6
|
+
*/
|
|
7
|
+
rows?: RowsOptions<T>;
|
|
8
|
+
/**
|
|
9
|
+
* Modules to register.
|
|
10
|
+
*/
|
|
11
|
+
modules?: ModuleRegistrationEntry<T, any>[];
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Row } from '../core-modules';
|
|
2
|
+
export declare enum ValueMode {
|
|
3
|
+
Key = "Key",
|
|
4
|
+
Callback = "Callback",
|
|
5
|
+
Static = "Static"
|
|
6
|
+
}
|
|
7
|
+
interface ValueBase<T extends ValueMode> {
|
|
8
|
+
mode: T;
|
|
9
|
+
}
|
|
10
|
+
interface ValueKey<T> extends ValueBase<ValueMode.Key> {
|
|
11
|
+
key: keyof T;
|
|
12
|
+
}
|
|
13
|
+
interface ValueCallback<T> extends ValueBase<ValueMode.Callback> {
|
|
14
|
+
get: (row: Row<T>) => unknown;
|
|
15
|
+
set?: (value: any, row: T) => T;
|
|
16
|
+
}
|
|
17
|
+
interface ValueStatic extends ValueBase<ValueMode.Static> {
|
|
18
|
+
values: unknown[];
|
|
19
|
+
}
|
|
20
|
+
export type Value<T> = ValueKey<T> | ValueCallback<T> | ValueStatic;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Module, type ISveltixGrid } from '../../interfaces';
|
|
2
|
+
import type { FlashModuleOptions } from './models';
|
|
3
|
+
export declare class FlashModule<T> extends Module<T> {
|
|
4
|
+
private _idsEnabled;
|
|
5
|
+
private _options?;
|
|
6
|
+
constructor(api: ISveltixGrid<T>, options?: FlashModuleOptions);
|
|
7
|
+
init(): void;
|
|
8
|
+
uninit(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Module } from '../../interfaces';
|
|
2
|
+
export class FlashModule extends Module {
|
|
3
|
+
_idsEnabled = [];
|
|
4
|
+
_options;
|
|
5
|
+
constructor(api, options) {
|
|
6
|
+
super(api);
|
|
7
|
+
this._options = options;
|
|
8
|
+
}
|
|
9
|
+
init() {
|
|
10
|
+
const columnsCreated = this._api.on(this._api.events.column.created, (columns) => {
|
|
11
|
+
for (const column of columns) {
|
|
12
|
+
let isEnabled = true;
|
|
13
|
+
if (this._options?.idsEnable != null && !this._options.idsEnable.includes(column.id)) {
|
|
14
|
+
isEnabled = false;
|
|
15
|
+
}
|
|
16
|
+
if (this._options?.idsDisable != null && this._options.idsDisable.includes(column.id)) {
|
|
17
|
+
isEnabled = false;
|
|
18
|
+
}
|
|
19
|
+
if (isEnabled) {
|
|
20
|
+
this._idsEnabled.push(column.id);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const rowUpdated = this._api.on(this._api.events.row.updated, (entries) => {
|
|
25
|
+
for (const entry of entries) {
|
|
26
|
+
console.log(`Updated ${entry.row.id} row and ${entry.cell.column.id} cell`);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
this.addUnsub(columnsCreated);
|
|
30
|
+
this.addUnsub(rowUpdated);
|
|
31
|
+
}
|
|
32
|
+
uninit() { }
|
|
33
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ModuleRegistrationEntry } from '../..';
|
|
2
|
+
import type { FlashModuleOptions } from './models';
|
|
3
|
+
export * from './models';
|
|
4
|
+
export declare const FLASH_MODULE: unique symbol;
|
|
5
|
+
export declare function flashModule<T>(options?: FlashModuleOptions): ModuleRegistrationEntry<T, FlashModuleOptions | undefined>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FlashModule } from './FlashModule.svelte';
|
|
2
|
+
export * from './models';
|
|
3
|
+
export const FLASH_MODULE = Symbol.for('FLASH_MODULE');
|
|
4
|
+
export function flashModule(options) {
|
|
5
|
+
return {
|
|
6
|
+
key: FLASH_MODULE,
|
|
7
|
+
module: (FlashModule),
|
|
8
|
+
options: options,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FlashModuleOptions';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FlashModuleOptions';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ISveltixGrid } from '../../interfaces';
|
|
2
|
+
import { Module } from '../../interfaces/Module';
|
|
3
|
+
import type { ResizeModuleOptions } from './models';
|
|
4
|
+
export declare class ResizeModule<T> extends Module<T> {
|
|
5
|
+
private _options?;
|
|
6
|
+
private readonly _helperId;
|
|
7
|
+
private _movingColumnId;
|
|
8
|
+
constructor(api: ISveltixGrid<T>, options?: ResizeModuleOptions);
|
|
9
|
+
mouseDown(columnId: string): void;
|
|
10
|
+
mouseMove(e: MouseEvent): void;
|
|
11
|
+
mouseUp(): void;
|
|
12
|
+
init(): void;
|
|
13
|
+
uninit(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { HelperPosition } from '../../core-modules/columns/Column.svelte';
|
|
2
|
+
import { CustomComponentPosition } from '../../core-modules/custom/models/CustomComponentPosition';
|
|
3
|
+
import { Module } from '../../interfaces/Module';
|
|
4
|
+
import ResizeCustomComponent from './components/ResizeCustomComponent.svelte';
|
|
5
|
+
import ResizeHandle from './components/ResizeHandle.svelte';
|
|
6
|
+
export class ResizeModule extends Module {
|
|
7
|
+
_options;
|
|
8
|
+
_helperId = 'resizer';
|
|
9
|
+
_movingColumnId = undefined;
|
|
10
|
+
constructor(api, options) {
|
|
11
|
+
super(api);
|
|
12
|
+
this._options = options;
|
|
13
|
+
}
|
|
14
|
+
mouseDown(columnId) {
|
|
15
|
+
const column = this._api.core.columns.get(columnId);
|
|
16
|
+
if (column == null) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
this._movingColumnId = columnId;
|
|
20
|
+
}
|
|
21
|
+
mouseMove(e) {
|
|
22
|
+
if (this._movingColumnId == null) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const column = this._api.core.columns.get(this._movingColumnId);
|
|
26
|
+
if (column == null) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const dom = column.getDom();
|
|
30
|
+
if (dom == null) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const rect = dom.getBoundingClientRect();
|
|
34
|
+
const difference = e.clientX - rect.left;
|
|
35
|
+
if (difference <= column.minimumWidth) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const newWidth = column.width + e.movementX;
|
|
39
|
+
column.setWidth(newWidth);
|
|
40
|
+
}
|
|
41
|
+
mouseUp() {
|
|
42
|
+
this._movingColumnId = undefined;
|
|
43
|
+
}
|
|
44
|
+
init() {
|
|
45
|
+
const unsub = this._api.on(this._api.events.column.created, (columns) => {
|
|
46
|
+
for (const column of columns) {
|
|
47
|
+
let isEnabled = true;
|
|
48
|
+
if (this._options?.idsEnable != null && !this._options.idsEnable.includes(column.id)) {
|
|
49
|
+
isEnabled = false;
|
|
50
|
+
}
|
|
51
|
+
if (this._options?.idsDisable != null && this._options.idsDisable.includes(column.id)) {
|
|
52
|
+
isEnabled = false;
|
|
53
|
+
}
|
|
54
|
+
column.addHelper(this._helperId, ResizeHandle, HelperPosition.After, {
|
|
55
|
+
enabled: isEnabled,
|
|
56
|
+
module: this,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
this.addUnsub(unsub);
|
|
61
|
+
this._api.core.custom.add({
|
|
62
|
+
id: 'resize',
|
|
63
|
+
component: ResizeCustomComponent,
|
|
64
|
+
options: undefined,
|
|
65
|
+
}, CustomComponentPosition.Action);
|
|
66
|
+
}
|
|
67
|
+
uninit() { }
|
|
68
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script
|
|
2
|
+
lang="ts"
|
|
3
|
+
generics="T">
|
|
4
|
+
import type { CustomComponentEntryProps } from '../../../core-modules/custom/CustomComponentsModule.svelte';
|
|
5
|
+
import { RESIZE_MODULE } from '..';
|
|
6
|
+
import { ResizeModule } from '../ResizeModule.svelte';
|
|
7
|
+
|
|
8
|
+
const { api }: CustomComponentEntryProps<T, void> = $props();
|
|
9
|
+
|
|
10
|
+
const module = api.getModule<ResizeModule<T>>(RESIZE_MODULE);
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<svelte:document
|
|
14
|
+
onmousemove={(e) => module.mouseMove(e)}
|
|
15
|
+
onmouseup={(e) => module.mouseUp()} />
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CustomComponentEntryProps } from '../../../core-modules/custom/CustomComponentsModule.svelte';
|
|
2
|
+
declare function $$render<T>(): {
|
|
3
|
+
props: CustomComponentEntryProps<T, void>;
|
|
4
|
+
exports: {};
|
|
5
|
+
bindings: "";
|
|
6
|
+
slots: {};
|
|
7
|
+
events: {};
|
|
8
|
+
};
|
|
9
|
+
declare class __sveltets_Render<T> {
|
|
10
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
11
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
12
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
13
|
+
bindings(): "";
|
|
14
|
+
exports(): {};
|
|
15
|
+
}
|
|
16
|
+
interface $$IsomorphicComponent {
|
|
17
|
+
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']>> & {
|
|
18
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
19
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
20
|
+
<T>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
21
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
22
|
+
}
|
|
23
|
+
declare const ResizeCustomComponent: $$IsomorphicComponent;
|
|
24
|
+
type ResizeCustomComponent<T> = InstanceType<typeof ResizeCustomComponent<T>>;
|
|
25
|
+
export default ResizeCustomComponent;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script
|
|
2
|
+
lang="ts"
|
|
3
|
+
module>
|
|
4
|
+
export interface ResizeColumnOption {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
}
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<script
|
|
10
|
+
lang="ts"
|
|
11
|
+
generics="T">
|
|
12
|
+
import type { HelperComponentProps } from '../../../core-modules/columns/Column.svelte';
|
|
13
|
+
import { RESIZE_MODULE } from '..';
|
|
14
|
+
import { ResizeModule } from '../ResizeModule.svelte';
|
|
15
|
+
|
|
16
|
+
const { api, column, options }: HelperComponentProps<T, ResizeColumnOption> = $props();
|
|
17
|
+
|
|
18
|
+
const module = api.getModule<ResizeModule<T>>(RESIZE_MODULE);
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
{#if options.enabled}
|
|
22
|
+
<button
|
|
23
|
+
ondblclick={() => column.calculateWidth()}
|
|
24
|
+
onmousedown={(e) => module.mouseDown(column.id)}
|
|
25
|
+
aria-label="Resize column"
|
|
26
|
+
aria-labelledby={column.id}
|
|
27
|
+
class="bg-neutral-200 hover:cursor-col-resize z-30 hover:bg-indigo-300 transition-colors w-1 h-1/2 rounded-full absolute right-0 top-1/4">
|
|
28
|
+
</button>
|
|
29
|
+
{/if}
|