domma-js 0.56.0 → 0.57.0
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/assets/types/generated/public/assets/flags/africa.d.ts +6 -0
- package/assets/types/generated/public/assets/flags/americas.d.ts +6 -0
- package/assets/types/generated/public/assets/flags/asia.d.ts +6 -0
- package/assets/types/generated/public/assets/flags/europe.d.ts +9 -0
- package/assets/types/generated/public/assets/flags/index.d.ts +11 -0
- package/assets/types/generated/public/assets/flags/oceania.d.ts +2 -0
- package/assets/types/generated/public/assets/icons/buildings.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/code.d.ts +2 -0
- package/assets/types/generated/public/assets/icons/commerce.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/communication.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/devices.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/emojis.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/files.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/finance.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/forms.d.ts +5 -0
- package/assets/types/generated/public/assets/icons/health.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/index.d.ts +24 -0
- package/assets/types/generated/public/assets/icons/media.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/navigation.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/seasonal.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/social.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/sport.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/status.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/transport.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/ui.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/weather.d.ts +6 -0
- package/assets/types/generated/src/auth.d.ts +424 -0
- package/assets/types/generated/src/avatar.d.ts +270 -0
- package/assets/types/generated/src/binding-source.d.ts +58 -0
- package/assets/types/generated/src/butterfly-drawing.d.ts +2 -0
- package/assets/types/generated/src/component-factory.d.ts +150 -0
- package/assets/types/generated/src/component.d.ts +162 -0
- package/assets/types/generated/src/components/back-to-top.d.ts +150 -0
- package/assets/types/generated/src/components/badge.d.ts +208 -0
- package/assets/types/generated/src/components/card.d.ts +189 -0
- package/assets/types/generated/src/components/command-palette.d.ts +352 -0
- package/assets/types/generated/src/components/dropzone.d.ts +342 -0
- package/assets/types/generated/src/components/focus-trap.d.ts +238 -0
- package/assets/types/generated/src/components/loader.d.ts +133 -0
- package/assets/types/generated/src/components/modal.d.ts +341 -0
- package/assets/types/generated/src/components/range-slider.d.ts +267 -0
- package/assets/types/generated/src/components/shared.d.ts +91 -0
- package/assets/types/generated/src/components/split-pane.d.ts +239 -0
- package/assets/types/generated/src/components/toast.d.ts +284 -0
- package/assets/types/generated/src/components/tooltip.d.ts +200 -0
- package/assets/types/generated/src/components/virtual-list.d.ts +340 -0
- package/assets/types/generated/src/config.d.ts +193 -0
- package/assets/types/generated/src/context-cursor.d.ts +69 -0
- package/assets/types/generated/src/context-menu.d.ts +596 -0
- package/assets/types/generated/src/dates.d.ts +367 -0
- package/assets/types/generated/src/dom.d.ts +1221 -0
- package/assets/types/generated/src/effects.d.ts +1281 -0
- package/assets/types/generated/src/elements.d.ts +4996 -0
- package/assets/types/generated/src/escape.d.ts +5 -0
- package/assets/types/generated/src/flags-bundle.d.ts +4 -0
- package/assets/types/generated/src/flags.d.ts +338 -0
- package/assets/types/generated/src/forms.d.ts +1060 -0
- package/assets/types/generated/src/globals.d.ts +45 -0
- package/assets/types/generated/src/http.d.ts +131 -0
- package/assets/types/generated/src/i18n.d.ts +261 -0
- package/assets/types/generated/src/icons.d.ts +213 -0
- package/assets/types/generated/src/index.d.ts +249 -0
- package/assets/types/generated/src/input-group.d.ts +135 -0
- package/assets/types/generated/src/models.d.ts +968 -0
- package/assets/types/generated/src/popover.d.ts +412 -0
- package/assets/types/generated/src/router.d.ts +344 -0
- package/assets/types/generated/src/safe-url.d.ts +10 -0
- package/assets/types/generated/src/sanitize.d.ts +97 -0
- package/assets/types/generated/src/schema-builder.d.ts +420 -0
- package/assets/types/generated/src/skeleton.d.ts +135 -0
- package/assets/types/generated/src/smooth-caret.d.ts +61 -0
- package/assets/types/generated/src/sortable.d.ts +369 -0
- package/assets/types/generated/src/storage.d.ts +93 -0
- package/assets/types/generated/src/tables.d.ts +901 -0
- package/assets/types/generated/src/theme.d.ts +277 -0
- package/assets/types/generated/src/ticker-tape-drawing.d.ts +2 -0
- package/assets/types/generated/src/treeview.d.ts +504 -0
- package/assets/types/generated/src/utils.d.ts +1667 -0
- package/assets/types/generated/src/web-components/base/domma-element.d.ts +134 -0
- package/assets/types/generated/src/web-components/index.d.ts +14 -0
- package/assets/types/generated/vendor/domma-reactive.d.ts +587 -0
- package/assets/types/index.d.ts +104 -226
- package/package.json +5 -2
- package/public/dist/bundles/domma-complete.css +20 -14
- package/public/dist/bundles/domma-data-focused.css +20 -14
- package/public/dist/bundles/domma-essentials.css +20 -14
- package/public/dist/bundles/domma-full.css +20 -14
- package/public/dist/bundles/domma-minimal.css +8 -8
- package/public/dist/domma-flags.esm.js +3 -3
- package/public/dist/domma-flags.esm.js.map +1 -1
- package/public/dist/domma-flags.min.js +3 -3
- package/public/dist/domma-flags.min.js.map +1 -1
- package/public/dist/domma-syntax.min.js +3 -3
- package/public/dist/domma.css +3 -3
- package/public/dist/domma.esm.js +5 -5
- package/public/dist/domma.esm.js.map +1 -1
- package/public/dist/domma.min.js +5 -5
- package/public/dist/domma.min.js.map +1 -1
- package/public/dist/elements.css +9 -3
- package/public/dist/grid.css +3 -3
- package/public/dist/syntax.css +3 -3
- package/public/dist/themes/domma-themes.css +3 -3
- package/templates/kickstart/frontend/types/domma.d.ts +2 -1
- package/assets/types/config.d.ts +0 -136
- package/assets/types/dates.d.ts +0 -209
- package/assets/types/dom.d.ts +0 -448
- package/assets/types/elements.d.ts +0 -1168
- package/assets/types/flags.d.ts +0 -130
- package/assets/types/http.d.ts +0 -97
- package/assets/types/i18n.d.ts +0 -99
- package/assets/types/icons.d.ts +0 -147
- package/assets/types/models.d.ts +0 -260
- package/assets/types/smooth-caret.d.ts +0 -12
- package/assets/types/storage.d.ts +0 -93
- package/assets/types/tables.d.ts +0 -327
- package/assets/types/theme.d.ts +0 -137
- package/assets/types/utils.d.ts +0 -675
package/assets/types/models.d.ts
DELETED
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Domma Models Module - TypeScript Declarations
|
|
3
|
-
* Pub/Sub events and reactive data binding
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export type TypeValidator = (value: any) => boolean;
|
|
7
|
-
|
|
8
|
-
export interface FieldDefinition {
|
|
9
|
-
type?: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'date' | 'any';
|
|
10
|
-
default?: any;
|
|
11
|
-
required?: boolean;
|
|
12
|
-
min?: number;
|
|
13
|
-
max?: number;
|
|
14
|
-
minLength?: number;
|
|
15
|
-
maxLength?: number;
|
|
16
|
-
pattern?: RegExp;
|
|
17
|
-
validate?: (value: any) => boolean | string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface Schema {
|
|
21
|
-
[field: string]: FieldDefinition;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface ValidationResult {
|
|
25
|
-
valid: boolean;
|
|
26
|
-
errors: Array<{ field: string; error: string }>;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface ModelOptions {
|
|
30
|
-
persist?: string;
|
|
31
|
-
autoSave?: boolean;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface ChangeEvent {
|
|
35
|
-
field: string;
|
|
36
|
-
newValue: any;
|
|
37
|
-
oldValue: any;
|
|
38
|
-
model: Model;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export type ChangeCallback = (event: ChangeEvent) => void;
|
|
42
|
-
export type FieldChangeCallback = (newValue: any, oldValue: any, model: Model) => void;
|
|
43
|
-
export type UnsubscribeFn = () => void;
|
|
44
|
-
|
|
45
|
-
export interface BindingOptions {
|
|
46
|
-
format?: (value: any) => any;
|
|
47
|
-
parse?: (value: any) => any;
|
|
48
|
-
twoWay?: boolean;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* A lazily-evaluated, dependency-tracked derived value.
|
|
53
|
-
*/
|
|
54
|
-
export interface ComputedRef<T = any> {
|
|
55
|
-
/** Current value, recomputing only if a dependency changed. */
|
|
56
|
-
get(): T;
|
|
57
|
-
|
|
58
|
-
/** Current value without registering a dependency on the caller. */
|
|
59
|
-
peek(): T;
|
|
60
|
-
|
|
61
|
-
/** Unlink from the dependency graph. */
|
|
62
|
-
dispose(): void;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface ComputedOptions<T = any> {
|
|
66
|
-
/** Debug label used in console warnings. */
|
|
67
|
-
label?: string;
|
|
68
|
-
|
|
69
|
-
/** Called with the new value whenever it changes. */
|
|
70
|
-
onChange?: (value: T) => void;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export interface EffectOptions {
|
|
74
|
-
/** Debug label used in console warnings. */
|
|
75
|
-
label?: string;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Reactive Model class
|
|
80
|
-
*/
|
|
81
|
-
export declare class Model {
|
|
82
|
-
constructor(schema: Schema, data?: Record<string, any>, options?: ModelOptions);
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Get field value or all data.
|
|
86
|
-
* Reads inside a computed or effect are tracked as dependencies.
|
|
87
|
-
*/
|
|
88
|
-
get(): Record<string, any>;
|
|
89
|
-
get(field: string): any;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Read-tracked, write-through view of the model's data.
|
|
93
|
-
* Property reads register a dependency; writes route through set(),
|
|
94
|
-
* preserving validation, change notification and persistence.
|
|
95
|
-
*/
|
|
96
|
-
tracked(): Record<string, any>;
|
|
97
|
-
|
|
98
|
-
/** Set field value(s) */
|
|
99
|
-
set(field: string, value: any): Model;
|
|
100
|
-
set(data: Record<string, any>): Model;
|
|
101
|
-
|
|
102
|
-
/** Validate all fields */
|
|
103
|
-
validate(): ValidationResult;
|
|
104
|
-
|
|
105
|
-
/** Get model data as JSON */
|
|
106
|
-
toJSON(): Record<string, any>;
|
|
107
|
-
|
|
108
|
-
/** Subscribe to any change; callback receives {field, newValue, oldValue, model} */
|
|
109
|
-
onChange(callback: ChangeCallback): UnsubscribeFn;
|
|
110
|
-
|
|
111
|
-
/** Subscribe to changes on a single field; callback receives the same change object */
|
|
112
|
-
onChange(field: string, callback: ChangeCallback): UnsubscribeFn;
|
|
113
|
-
|
|
114
|
-
/** Subscribe to specific field change */
|
|
115
|
-
onFieldChange(field: string, callback: FieldChangeCallback): UnsubscribeFn;
|
|
116
|
-
|
|
117
|
-
/** Reset model to initial data */
|
|
118
|
-
reset(clearStorage?: boolean): Model;
|
|
119
|
-
|
|
120
|
-
/** Destroy model and cleanup */
|
|
121
|
-
destroy(clearStorage?: boolean): void;
|
|
122
|
-
|
|
123
|
-
// Persistence Methods
|
|
124
|
-
|
|
125
|
-
/** Manually save model to localStorage */
|
|
126
|
-
save(): boolean;
|
|
127
|
-
|
|
128
|
-
/** Manually load model from localStorage */
|
|
129
|
-
load(): boolean;
|
|
130
|
-
|
|
131
|
-
/** Clear persisted data from localStorage */
|
|
132
|
-
clearStorage(): boolean;
|
|
133
|
-
|
|
134
|
-
/** Get the persistence key */
|
|
135
|
-
getPersistKey(): string | null;
|
|
136
|
-
|
|
137
|
-
/** Check if model is persisted */
|
|
138
|
-
isPersisted(): boolean;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export interface Store {
|
|
142
|
-
/** Get current state */
|
|
143
|
-
getState(): Record<string, any>;
|
|
144
|
-
|
|
145
|
-
/** Update state with partial updates */
|
|
146
|
-
setState(updates: Record<string, any>): void;
|
|
147
|
-
|
|
148
|
-
/** Subscribe to state changes */
|
|
149
|
-
subscribe(listener: (state: Record<string, any>, oldState: Record<string, any>) => void): UnsubscribeFn;
|
|
150
|
-
|
|
151
|
-
/** Reset state to initial or new state */
|
|
152
|
-
reset(newState?: Record<string, any>): void;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export interface TypeValidators {
|
|
156
|
-
string: TypeValidator;
|
|
157
|
-
number: TypeValidator;
|
|
158
|
-
boolean: TypeValidator;
|
|
159
|
-
array: TypeValidator;
|
|
160
|
-
object: TypeValidator;
|
|
161
|
-
date: TypeValidator;
|
|
162
|
-
any: TypeValidator;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export interface Models {
|
|
166
|
-
// ============================================
|
|
167
|
-
// Pub/Sub Event System
|
|
168
|
-
// ============================================
|
|
169
|
-
|
|
170
|
-
/** Subscribe to an event */
|
|
171
|
-
subscribe(event: string, callback: (data: any) => void): UnsubscribeFn;
|
|
172
|
-
|
|
173
|
-
/** Alias for subscribe */
|
|
174
|
-
on(event: string, callback: (data: any) => void): UnsubscribeFn;
|
|
175
|
-
|
|
176
|
-
/** Unsubscribe from an event */
|
|
177
|
-
unsubscribe(event: string, callback: (data: any) => void): void;
|
|
178
|
-
|
|
179
|
-
/** Alias for unsubscribe */
|
|
180
|
-
off(event: string, callback: (data: any) => void): void;
|
|
181
|
-
|
|
182
|
-
/** Publish an event */
|
|
183
|
-
publish(event: string, data?: any): void;
|
|
184
|
-
|
|
185
|
-
/** Alias for publish */
|
|
186
|
-
emit(event: string, data?: any): void;
|
|
187
|
-
|
|
188
|
-
/** Subscribe to an event once */
|
|
189
|
-
once(event: string, callback: (data: any) => void): UnsubscribeFn;
|
|
190
|
-
|
|
191
|
-
/** Clear event listeners */
|
|
192
|
-
clear(event?: string): void;
|
|
193
|
-
|
|
194
|
-
// ============================================
|
|
195
|
-
// Model Creation
|
|
196
|
-
// ============================================
|
|
197
|
-
|
|
198
|
-
/** Create a new reactive model */
|
|
199
|
-
create(schema: Schema, initialData?: Record<string, any>, options?: ModelOptions): Model;
|
|
200
|
-
|
|
201
|
-
/** Extend a blueprint with additional fields */
|
|
202
|
-
extend(...blueprints: Schema[]): Schema;
|
|
203
|
-
|
|
204
|
-
/** Pick specific fields from a blueprint */
|
|
205
|
-
pick(blueprint: Schema, fields: string[]): Schema;
|
|
206
|
-
|
|
207
|
-
/** Omit specific fields from a blueprint */
|
|
208
|
-
omit(blueprint: Schema, fields: string[]): Schema;
|
|
209
|
-
|
|
210
|
-
// ============================================
|
|
211
|
-
// Dependency-Tracked Reactivity
|
|
212
|
-
// ============================================
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Create a lazily-evaluated derived value that tracks whatever it reads.
|
|
216
|
-
* The body must be synchronous - tracking stops at the first `await`.
|
|
217
|
-
*/
|
|
218
|
-
computed<T = any>(fn: () => T, options?: ComputedOptions<T>): ComputedRef<T>;
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Run a function now, and again whenever any field it read changes.
|
|
222
|
-
* Re-runs are batched into a single microtask flush.
|
|
223
|
-
* Returns a function that stops the effect.
|
|
224
|
-
*/
|
|
225
|
-
effect(fn: () => void, options?: EffectOptions): UnsubscribeFn;
|
|
226
|
-
|
|
227
|
-
/** Read values without registering them as dependencies. */
|
|
228
|
-
untracked<T = any>(fn: () => T): T;
|
|
229
|
-
|
|
230
|
-
/** Settle pending reactive work immediately instead of on the microtask. */
|
|
231
|
-
flush(): void;
|
|
232
|
-
|
|
233
|
-
// ============================================
|
|
234
|
-
// Type Validators
|
|
235
|
-
// ============================================
|
|
236
|
-
|
|
237
|
-
types: TypeValidators;
|
|
238
|
-
|
|
239
|
-
// ============================================
|
|
240
|
-
// DOM Binding
|
|
241
|
-
// ============================================
|
|
242
|
-
|
|
243
|
-
/** Bind a model field to DOM element(s) */
|
|
244
|
-
bind(model: Model, field: string, selector: string | HTMLElement, options?: BindingOptions): UnsubscribeFn;
|
|
245
|
-
|
|
246
|
-
// ============================================
|
|
247
|
-
// Store (Simple State Management)
|
|
248
|
-
// ============================================
|
|
249
|
-
|
|
250
|
-
/** Get or create a named store */
|
|
251
|
-
store(name: string, initialState?: Record<string, any>): Store;
|
|
252
|
-
|
|
253
|
-
/** Get an existing store */
|
|
254
|
-
getStore(name: string): Store | undefined;
|
|
255
|
-
|
|
256
|
-
/** Remove a store */
|
|
257
|
-
removeStore(name: string): void;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
export declare const models: Models;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export type CaretPreference = 'auto' | 'smooth' | 'native';
|
|
2
|
-
export interface SmoothCaretHandle {
|
|
3
|
-
refresh(): void;
|
|
4
|
-
destroy(): void;
|
|
5
|
-
}
|
|
6
|
-
export interface SmoothCaret {
|
|
7
|
-
attach(element: HTMLInputElement | HTMLTextAreaElement | HTMLElement): SmoothCaretHandle;
|
|
8
|
-
install(root?: Document | HTMLElement | ShadowRoot): {destroy(): void};
|
|
9
|
-
getPreference(): CaretPreference;
|
|
10
|
-
setPreference(value: CaretPreference): void;
|
|
11
|
-
}
|
|
12
|
-
export declare const smoothCaret: SmoothCaret;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Domma Storage Module - TypeScript Declarations
|
|
3
|
-
* localStorage wrapper with auto-serialisation and key prefixing
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export interface Storage {
|
|
7
|
-
/**
|
|
8
|
-
* Get a value from storage
|
|
9
|
-
* @param key - The storage key
|
|
10
|
-
* @param defaultValue - Default value if key doesn't exist
|
|
11
|
-
* @returns The stored value or default
|
|
12
|
-
*/
|
|
13
|
-
get<T = any>(key: string, defaultValue?: T): T;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Set a value in storage
|
|
17
|
-
* @param key - The storage key
|
|
18
|
-
* @param value - The value to store (auto-serialised)
|
|
19
|
-
* @returns true if successful
|
|
20
|
-
*/
|
|
21
|
-
set(key: string, value: any): boolean;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Remove a key from storage
|
|
25
|
-
* @param key - The storage key
|
|
26
|
-
* @returns true if successful
|
|
27
|
-
*/
|
|
28
|
-
remove(key: string): boolean;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Check if a key exists in storage
|
|
32
|
-
* @param key - The storage key
|
|
33
|
-
* @returns true if key exists
|
|
34
|
-
*/
|
|
35
|
-
has(key: string): boolean;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Clear all storage (within prefix)
|
|
39
|
-
* @returns true if successful
|
|
40
|
-
*/
|
|
41
|
-
clear(): boolean;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Get all storage keys (within prefix)
|
|
45
|
-
* @returns Array of keys
|
|
46
|
-
*/
|
|
47
|
-
keys(): string[];
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Get the number of stored items (within prefix)
|
|
51
|
-
* @returns Number of items
|
|
52
|
-
*/
|
|
53
|
-
size(): number;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Get total storage size in bytes
|
|
57
|
-
* @returns Size in bytes
|
|
58
|
-
*/
|
|
59
|
-
totalSize(): number;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Get all stored data as an object
|
|
63
|
-
* @returns Object with all key-value pairs
|
|
64
|
-
*/
|
|
65
|
-
getAll(): Record<string, any>;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Set multiple values at once
|
|
69
|
-
* @param data - Object with key-value pairs
|
|
70
|
-
* @returns true if all successful
|
|
71
|
-
*/
|
|
72
|
-
setAll(data: Record<string, any>): boolean;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Check if localStorage is available
|
|
76
|
-
* @returns true if available
|
|
77
|
-
*/
|
|
78
|
-
isAvailable(): boolean;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Set the key prefix
|
|
82
|
-
* @param prefix - Prefix string for all keys
|
|
83
|
-
*/
|
|
84
|
-
setPrefix(prefix: string): void;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Get the current key prefix
|
|
88
|
-
* @returns Current prefix
|
|
89
|
-
*/
|
|
90
|
-
getPrefix(): string;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export declare const storage: Storage;
|
package/assets/types/tables.d.ts
DELETED
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Domma Tables Module - TypeScript Declarations
|
|
3
|
-
* DataTable-like functionality with sorting, filtering, pagination, and export
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// ============================================
|
|
7
|
-
// Types
|
|
8
|
-
// ============================================
|
|
9
|
-
|
|
10
|
-
export type SortDirection = 'asc' | 'desc' | null;
|
|
11
|
-
export type SelectionMode = 'single' | 'multiple';
|
|
12
|
-
export type ExportFormat = 'csv' | 'json' | 'excel';
|
|
13
|
-
export type TableEventType = 'sort' | 'filter' | 'page' | 'select' | 'edit' | 'render';
|
|
14
|
-
|
|
15
|
-
export interface ColumnDefinition {
|
|
16
|
-
/** Column key in data object */
|
|
17
|
-
key: string;
|
|
18
|
-
/** Display header text */
|
|
19
|
-
title?: string;
|
|
20
|
-
/** Enable sorting for this column */
|
|
21
|
-
sortable?: boolean;
|
|
22
|
-
/** Enable filtering for this column */
|
|
23
|
-
filterable?: boolean;
|
|
24
|
-
/** Column width */
|
|
25
|
-
width?: string | number;
|
|
26
|
-
/** Text alignment */
|
|
27
|
-
align?: 'left' | 'center' | 'right';
|
|
28
|
-
/** Custom render function */
|
|
29
|
-
render?: (value: any, row: Record<string, any>, index: number) => string;
|
|
30
|
-
/** Custom sort comparator */
|
|
31
|
-
comparator?: (a: any, b: any) => number;
|
|
32
|
-
/** Make column editable */
|
|
33
|
-
editable?: boolean;
|
|
34
|
-
/** Input type for editable cells */
|
|
35
|
-
editType?: 'text' | 'number' | 'select' | 'checkbox';
|
|
36
|
-
/** Options for select edit type */
|
|
37
|
-
editOptions?: string[] | { value: any; label: string }[];
|
|
38
|
-
/** Column visibility */
|
|
39
|
-
visible?: boolean;
|
|
40
|
-
/** CSS class for column */
|
|
41
|
-
className?: string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface SortState {
|
|
45
|
-
column: string;
|
|
46
|
-
direction: SortDirection;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface FilterState {
|
|
50
|
-
column: string;
|
|
51
|
-
value: any;
|
|
52
|
-
operator?: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'startsWith' | 'endsWith';
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface PageInfo {
|
|
56
|
-
currentPage: number;
|
|
57
|
-
pageSize: number;
|
|
58
|
-
totalPages: number;
|
|
59
|
-
totalRows: number;
|
|
60
|
-
startRow: number;
|
|
61
|
-
endRow: number;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface TableEventData {
|
|
65
|
-
type: TableEventType;
|
|
66
|
-
data?: any;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export type TableEventCallback = (event: TableEventData) => void;
|
|
70
|
-
|
|
71
|
-
// ============================================
|
|
72
|
-
// Table Options
|
|
73
|
-
// ============================================
|
|
74
|
-
|
|
75
|
-
export interface TableOptions {
|
|
76
|
-
/** Initial data array */
|
|
77
|
-
data?: Record<string, any>[];
|
|
78
|
-
/** Column definitions */
|
|
79
|
-
columns?: ColumnDefinition[];
|
|
80
|
-
/** Enable sorting */
|
|
81
|
-
sortable?: boolean;
|
|
82
|
-
/** Enable filtering */
|
|
83
|
-
filterable?: boolean;
|
|
84
|
-
/** Enable global search */
|
|
85
|
-
searchable?: boolean;
|
|
86
|
-
/** Enable pagination */
|
|
87
|
-
pagination?: boolean;
|
|
88
|
-
/** Rows per page */
|
|
89
|
-
pageSize?: number;
|
|
90
|
-
/** Page size options */
|
|
91
|
-
pageSizeOptions?: number[];
|
|
92
|
-
/** Enable row selection */
|
|
93
|
-
selectable?: boolean;
|
|
94
|
-
/** Selection mode: 'single' or 'multiple' */
|
|
95
|
-
selectionMode?: SelectionMode;
|
|
96
|
-
/** Enable cell editing */
|
|
97
|
-
editable?: boolean;
|
|
98
|
-
/** Enable column resizing */
|
|
99
|
-
resizable?: boolean;
|
|
100
|
-
/** Show export panel */
|
|
101
|
-
exportPanel?: boolean;
|
|
102
|
-
/** Show row numbers */
|
|
103
|
-
showRowNumbers?: boolean;
|
|
104
|
-
/** Empty state message */
|
|
105
|
-
emptyMessage?: string;
|
|
106
|
-
/** Loading state message */
|
|
107
|
-
loadingMessage?: string;
|
|
108
|
-
/** CSS class for table */
|
|
109
|
-
className?: string;
|
|
110
|
-
/** Striped rows */
|
|
111
|
-
striped?: boolean;
|
|
112
|
-
/** Hoverable rows */
|
|
113
|
-
hover?: boolean;
|
|
114
|
-
/** Bordered table */
|
|
115
|
-
bordered?: boolean;
|
|
116
|
-
/** Compact/dense layout */
|
|
117
|
-
compact?: boolean;
|
|
118
|
-
/** Responsive wrapper */
|
|
119
|
-
responsive?: boolean;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// ============================================
|
|
123
|
-
// Table Instance
|
|
124
|
-
// ============================================
|
|
125
|
-
|
|
126
|
-
export interface TableInstance {
|
|
127
|
-
/** The table element */
|
|
128
|
-
element: HTMLElement;
|
|
129
|
-
/** Current options */
|
|
130
|
-
options: TableOptions;
|
|
131
|
-
|
|
132
|
-
// Data Methods
|
|
133
|
-
/** Set table data */
|
|
134
|
-
setData(data: Record<string, any>[]): this;
|
|
135
|
-
|
|
136
|
-
/** Get current data (filtered and sorted) */
|
|
137
|
-
getData(): Record<string, any>[];
|
|
138
|
-
|
|
139
|
-
/** Get original unfiltered data */
|
|
140
|
-
getOriginalData(): Record<string, any>[];
|
|
141
|
-
|
|
142
|
-
/** Add a single row */
|
|
143
|
-
addRow(row: Record<string, any>): this;
|
|
144
|
-
|
|
145
|
-
/** Add multiple rows */
|
|
146
|
-
addRows(rows: Record<string, any>[]): this;
|
|
147
|
-
|
|
148
|
-
/** Update a row by index */
|
|
149
|
-
updateRow(index: number, data: Partial<Record<string, any>>): this;
|
|
150
|
-
|
|
151
|
-
/** Remove a row by index */
|
|
152
|
-
removeRow(index: number): this;
|
|
153
|
-
|
|
154
|
-
/** Remove multiple rows by indices */
|
|
155
|
-
removeRows(indices: number[]): this;
|
|
156
|
-
|
|
157
|
-
/** Clear all data */
|
|
158
|
-
clear(): this;
|
|
159
|
-
|
|
160
|
-
/** Refresh the table display */
|
|
161
|
-
refresh(): this;
|
|
162
|
-
|
|
163
|
-
// Sort Methods
|
|
164
|
-
/** Sort by column */
|
|
165
|
-
sort(column: string, direction?: SortDirection): this;
|
|
166
|
-
|
|
167
|
-
/** Sort by multiple columns */
|
|
168
|
-
sortMultiple(sorts: SortState[]): this;
|
|
169
|
-
|
|
170
|
-
/** Clear all sorting */
|
|
171
|
-
clearSort(): this;
|
|
172
|
-
|
|
173
|
-
/** Get current sort state */
|
|
174
|
-
getSortState(): SortState[];
|
|
175
|
-
|
|
176
|
-
// Filter Methods
|
|
177
|
-
/** Global search across all columns */
|
|
178
|
-
search(query: string): this;
|
|
179
|
-
|
|
180
|
-
/** Filter with a custom function */
|
|
181
|
-
filter(fn: (row: Record<string, any>, index: number) => boolean): this;
|
|
182
|
-
|
|
183
|
-
/** Filter by column value */
|
|
184
|
-
filterBy(column: string, value: any, operator?: FilterState['operator']): this;
|
|
185
|
-
|
|
186
|
-
/** Clear all filters */
|
|
187
|
-
clearFilters(): this;
|
|
188
|
-
|
|
189
|
-
/** Get current filter state */
|
|
190
|
-
getFilters(): FilterState[];
|
|
191
|
-
|
|
192
|
-
// Pagination Methods
|
|
193
|
-
/** Go to a specific page (1-indexed) */
|
|
194
|
-
page(pageNumber: number): this;
|
|
195
|
-
|
|
196
|
-
/** Set page size */
|
|
197
|
-
pageSize(size: number): this;
|
|
198
|
-
|
|
199
|
-
/** Go to next page */
|
|
200
|
-
nextPage(): this;
|
|
201
|
-
|
|
202
|
-
/** Go to previous page */
|
|
203
|
-
prevPage(): this;
|
|
204
|
-
|
|
205
|
-
/** Go to first page */
|
|
206
|
-
firstPage(): this;
|
|
207
|
-
|
|
208
|
-
/** Go to last page */
|
|
209
|
-
lastPage(): this;
|
|
210
|
-
|
|
211
|
-
/** Get pagination info */
|
|
212
|
-
pageInfo(): PageInfo;
|
|
213
|
-
|
|
214
|
-
// Selection Methods
|
|
215
|
-
/** Select row(s) by index */
|
|
216
|
-
select(index: number | number[]): this;
|
|
217
|
-
|
|
218
|
-
/** Deselect row(s) by index */
|
|
219
|
-
deselect(index: number | number[]): this;
|
|
220
|
-
|
|
221
|
-
/** Select all rows */
|
|
222
|
-
selectAll(): this;
|
|
223
|
-
|
|
224
|
-
/** Deselect all rows */
|
|
225
|
-
deselectAll(): this;
|
|
226
|
-
|
|
227
|
-
/** Toggle row selection */
|
|
228
|
-
toggleSelect(index: number): this;
|
|
229
|
-
|
|
230
|
-
/** Get selected row data */
|
|
231
|
-
getSelected(): Record<string, any>[];
|
|
232
|
-
|
|
233
|
-
/** Get selected row indices */
|
|
234
|
-
getSelectedIndices(): number[];
|
|
235
|
-
|
|
236
|
-
// Column Methods
|
|
237
|
-
/** Show a column */
|
|
238
|
-
showColumn(key: string): this;
|
|
239
|
-
|
|
240
|
-
/** Hide a column */
|
|
241
|
-
hideColumn(key: string): this;
|
|
242
|
-
|
|
243
|
-
/** Toggle column visibility */
|
|
244
|
-
toggleColumn(key: string): this;
|
|
245
|
-
|
|
246
|
-
/** Get column visibility state */
|
|
247
|
-
getColumnVisibility(): Record<string, boolean>;
|
|
248
|
-
|
|
249
|
-
/** Reorder columns */
|
|
250
|
-
reorderColumns(keys: string[]): this;
|
|
251
|
-
|
|
252
|
-
// Editing Methods
|
|
253
|
-
/** Edit a cell value */
|
|
254
|
-
editCell(rowIndex: number, column: string, value: any): this;
|
|
255
|
-
|
|
256
|
-
/** Get edited cells */
|
|
257
|
-
getEditedCells(): Array<{ row: number; column: string; value: any; originalValue: any }>;
|
|
258
|
-
|
|
259
|
-
/** Clear edit history */
|
|
260
|
-
clearEdits(): this;
|
|
261
|
-
|
|
262
|
-
// Export Methods
|
|
263
|
-
/** Export to CSV string */
|
|
264
|
-
toCSV(options?: { delimiter?: string; includeHeaders?: boolean }): string;
|
|
265
|
-
|
|
266
|
-
/** Export to JSON string */
|
|
267
|
-
toJSON(options?: { pretty?: boolean }): string;
|
|
268
|
-
|
|
269
|
-
/** Export to Excel-compatible format */
|
|
270
|
-
toExcel(): Blob;
|
|
271
|
-
|
|
272
|
-
/** Download export file */
|
|
273
|
-
download(format: ExportFormat, filename?: string): this;
|
|
274
|
-
|
|
275
|
-
/** Copy to clipboard */
|
|
276
|
-
copyToClipboard(format?: 'csv' | 'json'): Promise<boolean>;
|
|
277
|
-
|
|
278
|
-
// Event Methods
|
|
279
|
-
/** Subscribe to table events */
|
|
280
|
-
on(event: TableEventType, callback: TableEventCallback): this;
|
|
281
|
-
|
|
282
|
-
/** Unsubscribe from table events */
|
|
283
|
-
off(event: TableEventType, callback?: TableEventCallback): this;
|
|
284
|
-
|
|
285
|
-
/** Subscribe to event once */
|
|
286
|
-
once(event: TableEventType, callback: TableEventCallback): this;
|
|
287
|
-
|
|
288
|
-
// Rendering Methods
|
|
289
|
-
/** Force re-render */
|
|
290
|
-
render(): this;
|
|
291
|
-
|
|
292
|
-
/** Destroy the table instance */
|
|
293
|
-
destroy(): void;
|
|
294
|
-
|
|
295
|
-
// State Methods
|
|
296
|
-
/** Get current table state */
|
|
297
|
-
getState(): {
|
|
298
|
-
data: Record<string, any>[];
|
|
299
|
-
sort: SortState[];
|
|
300
|
-
filters: FilterState[];
|
|
301
|
-
page: PageInfo;
|
|
302
|
-
selected: number[];
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
/** Restore table state */
|
|
306
|
-
setState(state: Partial<ReturnType<TableInstance['getState']>>): this;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
// ============================================
|
|
310
|
-
// Tables Module
|
|
311
|
-
// ============================================
|
|
312
|
-
|
|
313
|
-
export interface Tables {
|
|
314
|
-
/** Create a new table instance */
|
|
315
|
-
create(selector: string | HTMLElement, options?: TableOptions): TableInstance;
|
|
316
|
-
|
|
317
|
-
/** Get an existing table instance */
|
|
318
|
-
get(selector: string | HTMLElement): TableInstance | undefined;
|
|
319
|
-
|
|
320
|
-
/** Destroy a table instance */
|
|
321
|
-
destroy(selector: string | HTMLElement): void;
|
|
322
|
-
|
|
323
|
-
/** Destroy all table instances */
|
|
324
|
-
destroyAll(): void;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
export declare const tables: Tables;
|