ezfw-core 1.0.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/components/EzBaseComponent.ts +648 -0
- package/components/EzComponent.ts +89 -0
- package/components/EzInput.module.scss +183 -0
- package/components/EzInput.ts +104 -0
- package/components/EzLabel.ts +22 -0
- package/components/EzOutlet.ts +181 -0
- package/components/HtmlWrapper.ts +305 -0
- package/components/avatar/EzAvatar.module.scss +200 -0
- package/components/avatar/EzAvatar.ts +130 -0
- package/components/badge/EzBadge.module.scss +202 -0
- package/components/badge/EzBadge.ts +77 -0
- package/components/button/EzButton.module.scss +402 -0
- package/components/button/EzButton.ts +175 -0
- package/components/button/EzButtonGroup.ts +48 -0
- package/components/card/EzCard.module.scss +71 -0
- package/components/card/EzCard.ts +120 -0
- package/components/chart/EzBarChart.ts +47 -0
- package/components/chart/EzChart.module.scss +14 -0
- package/components/chart/EzChart.ts +279 -0
- package/components/chart/EzDoughnutChart.ts +47 -0
- package/components/chart/EzLineChart.ts +53 -0
- package/components/checkbox/EzCheckbox.module.scss +145 -0
- package/components/checkbox/EzCheckbox.ts +115 -0
- package/components/dataview/EzDataView.module.scss +115 -0
- package/components/dataview/EzDataView.ts +355 -0
- package/components/dataview/modes/EzDataViewCards.ts +322 -0
- package/components/dataview/modes/EzDataViewGrid.ts +76 -0
- package/components/datepicker/EzDatePicker.module.scss +348 -0
- package/components/datepicker/EzDatePicker.ts +519 -0
- package/components/dialog/EzDialog.module.scss +180 -0
- package/components/dropdown/EzDropdown.module.scss +107 -0
- package/components/dropdown/EzDropdown.ts +235 -0
- package/components/feed/EzActivityFeed.module.scss +90 -0
- package/components/feed/EzActivityFeed.ts +78 -0
- package/components/form/EzForm.ts +364 -0
- package/components/form/EzValidators.test.js +421 -0
- package/components/form/EzValidators.ts +202 -0
- package/components/grid/EzGrid.scss +88 -0
- package/components/grid/EzGrid.ts +1085 -0
- package/components/grid/EzGridContainer.ts +104 -0
- package/components/grid/body/EzGridBody.scss +283 -0
- package/components/grid/body/EzGridBody.ts +549 -0
- package/components/grid/body/EzGridCell.ts +211 -0
- package/components/grid/body/EzGridRow.ts +196 -0
- package/components/grid/filter/EzGridFilters.scss +78 -0
- package/components/grid/filter/EzGridFilters.ts +285 -0
- package/components/grid/footer/EzGridFooter.scss +136 -0
- package/components/grid/footer/EzGridFooter.ts +448 -0
- package/components/grid/header/EzGridHeader.scss +199 -0
- package/components/grid/header/EzGridHeader.ts +430 -0
- package/components/grid/query/EzGridQuery.ts +81 -0
- package/components/grid/state/EzGridColumns.ts +155 -0
- package/components/grid/state/EzGridController.ts +470 -0
- package/components/grid/state/EzGridLifecycle.ts +136 -0
- package/components/grid/state/EzGridNormalizers.test.js +273 -0
- package/components/grid/state/EzGridNormalizers.ts +162 -0
- package/components/grid/state/EzGridParts.ts +233 -0
- package/components/grid/state/EzGridPersistence.ts +140 -0
- package/components/grid/state/EzGridRemote.test.js +573 -0
- package/components/grid/state/EzGridRemote.ts +335 -0
- package/components/grid/state/EzGridSelection.ts +231 -0
- package/components/grid/state/EzGridSort.ts +286 -0
- package/components/grid/title/EzGridActionBar.ts +98 -0
- package/components/grid/title/EzGridTitle.ts +114 -0
- package/components/grid/title/EzGridTitleBar.scss +65 -0
- package/components/grid/title/EzGridTitleBar.ts +87 -0
- package/components/grid/types.ts +607 -0
- package/components/panel/EzPanel.module.scss +133 -0
- package/components/panel/EzPanel.ts +147 -0
- package/components/radio/EzRadio.module.scss +190 -0
- package/components/radio/EzRadio.ts +149 -0
- package/components/select/EzSelect.module.scss +153 -0
- package/components/select/EzSelect.ts +238 -0
- package/components/skeleton/EzSkeleton.module.scss +95 -0
- package/components/skeleton/EzSkeleton.ts +70 -0
- package/components/store/EzStore.ts +344 -0
- package/components/switch/EzSwitch.module.scss +164 -0
- package/components/switch/EzSwitch.ts +117 -0
- package/components/tabs/EzTabPanel.module.scss +181 -0
- package/components/tabs/EzTabPanel.ts +402 -0
- package/components/textarea/EzTextarea.module.scss +131 -0
- package/components/textarea/EzTextarea.ts +161 -0
- package/components/timepicker/EzTimePicker.module.scss +282 -0
- package/components/timepicker/EzTimePicker.ts +540 -0
- package/components/toast/EzToast.module.scss +291 -0
- package/components/tooltip/EzTooltip.module.scss +124 -0
- package/components/tooltip/EzTooltip.ts +153 -0
- package/core/EzComponentTypes.ts +693 -0
- package/core/EzError.ts +63 -0
- package/core/EzModel.ts +268 -0
- package/core/EzTypes.ts +328 -0
- package/core/eventBus.ts +284 -0
- package/core/ez.ts +617 -0
- package/core/loader.ts +725 -0
- package/core/renderer.ts +1010 -0
- package/core/router.ts +490 -0
- package/core/services.ts +124 -0
- package/core/state.ts +142 -0
- package/core/utils.ts +81 -0
- package/package.json +51 -0
- package/services/RouteUI.js +17 -0
- package/services/crypto.js +64 -0
- package/services/dialog.js +222 -0
- package/services/fetchApi.js +63 -0
- package/services/firebase.js +30 -0
- package/services/toast.js +214 -0
- package/template/doc/EzDocs.js +15 -0
- package/template/doc/EzDocs.module.scss +627 -0
- package/template/doc/EzDocsController.js +164 -0
- package/template/doc/data/activityfeed/EzActivityFeedDoc.js +42 -0
- package/template/doc/data/avatar/EzAvatarDoc.js +71 -0
- package/template/doc/data/badge/EzBadgeDoc.js +92 -0
- package/template/doc/data/button/EzButtonDoc.js +77 -0
- package/template/doc/data/buttongroup/EzButtonGroupDoc.js +102 -0
- package/template/doc/data/card/EzCardDoc.js +39 -0
- package/template/doc/data/chart/EzChartDoc.js +60 -0
- package/template/doc/data/checkbox/EzCheckboxDoc.js +67 -0
- package/template/doc/data/component/EzComponentDoc.js +34 -0
- package/template/doc/data/cssmodules/CSSModulesDoc.js +70 -0
- package/template/doc/data/datepicker/EzDatePickerDoc.js +126 -0
- package/template/doc/data/dialog/EzDialogDoc.js +217 -0
- package/template/doc/data/dropdown/EzDropdownDoc.js +178 -0
- package/template/doc/data/form/EzFormDoc.js +90 -0
- package/template/doc/data/grid/EzGridDoc.js +99 -0
- package/template/doc/data/input/EzInputDoc.js +92 -0
- package/template/doc/data/label/EzLabelDoc.js +40 -0
- package/template/doc/data/model/EzModelDoc.js +53 -0
- package/template/doc/data/outlet/EzOutletDoc.js +63 -0
- package/template/doc/data/panel/EzPanelDoc.js +214 -0
- package/template/doc/data/radio/EzRadioDoc.js +174 -0
- package/template/doc/data/router/EzRouterDoc.js +75 -0
- package/template/doc/data/select/EzSelectDoc.js +37 -0
- package/template/doc/data/skeleton/EzSkeletonDoc.js +149 -0
- package/template/doc/data/switch/EzSwitchDoc.js +82 -0
- package/template/doc/data/tabpanel/EzTabPanelDoc.js +44 -0
- package/template/doc/data/textarea/EzTextareaDoc.js +131 -0
- package/template/doc/data/timepicker/EzTimePickerDoc.js +107 -0
- package/template/doc/data/tooltip/EzTooltipDoc.js +193 -0
- package/template/doc/data/validators/EzValidatorsDoc.js +37 -0
- package/template/doc/sidebar/EzDocsSidebar.js +32 -0
- package/template/doc/sidebar/category/EzDocsCategory.js +33 -0
- package/template/doc/sidebar/item/EzDocsComponentItem.js +24 -0
- package/template/doc/viewer/EzDocsViewer.js +18 -0
- package/template/doc/viewer/codepanel/EzDocsCodePanel.js +51 -0
- package/template/doc/viewer/content/EzDocsContent.js +315 -0
- package/template/doc/viewer/header/EzDocsViewerHeader.js +46 -0
- package/template/doc/viewer/showcase/EzDocsShowcase.js +59 -0
- package/template/doc/viewer/showcase/EzDocsShowcaseSection.js +25 -0
- package/template/doc/viewer/showcase/EzDocsVariantItem.js +29 -0
- package/template/doc/welcome/EzDocsWelcome.js +48 -0
- package/themes/ez-theme.scss +179 -0
- package/themes/nature-fresh.scss +169 -0
- package/types/global.d.ts +21 -0
- package/utils/cssModules.js +81 -0
|
@@ -0,0 +1,693 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component-specific type definitions for IDE autocomplete
|
|
3
|
+
* These interfaces enable discriminated unions for eztype-specific props
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { ItemConfig, BindConfig } from './EzTypes.js';
|
|
7
|
+
|
|
8
|
+
// =============================================================================
|
|
9
|
+
// Base Config (shared by all components)
|
|
10
|
+
// =============================================================================
|
|
11
|
+
|
|
12
|
+
interface BaseComponentConfig {
|
|
13
|
+
/** CSS class(es) */
|
|
14
|
+
cls?: string | string[];
|
|
15
|
+
/** Inline styles */
|
|
16
|
+
style?: Record<string, string | number>;
|
|
17
|
+
/** Flex grow value */
|
|
18
|
+
flex?: number;
|
|
19
|
+
/** Reference name for ez._refs */
|
|
20
|
+
ref?: string;
|
|
21
|
+
/** Data bindings */
|
|
22
|
+
bind?: BindConfig;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// EzButton
|
|
27
|
+
// =============================================================================
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Button component with variants, sizes, and loading state
|
|
31
|
+
* @example
|
|
32
|
+
* { eztype: 'EzButton', text: 'Submit', variant: 'primary', onClick: 'handleSubmit' }
|
|
33
|
+
*/
|
|
34
|
+
export interface EzButtonItemConfig extends BaseComponentConfig {
|
|
35
|
+
eztype: 'EzButton';
|
|
36
|
+
/** Button text */
|
|
37
|
+
text?: string;
|
|
38
|
+
/** Icon class (FontAwesome) - e.g., 'download', 'fa-solid fa-check' */
|
|
39
|
+
icon?: string;
|
|
40
|
+
/** Icon position relative to text */
|
|
41
|
+
iconPosition?: 'left' | 'right';
|
|
42
|
+
/** Button style variant */
|
|
43
|
+
variant?: 'primary' | 'danger' | 'success' | 'warning' | 'ghost' | 'text' | 'outline' | 'outline-primary' | 'outline-danger' | 'outline-success' | 'outline-warning';
|
|
44
|
+
/** Button size */
|
|
45
|
+
size?: 'sm' | 'lg';
|
|
46
|
+
/** Full width button */
|
|
47
|
+
block?: boolean;
|
|
48
|
+
/** Show loading spinner */
|
|
49
|
+
loading?: boolean;
|
|
50
|
+
/** Disable button */
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
/** HTML button type */
|
|
53
|
+
htmlType?: 'button' | 'submit' | 'reset';
|
|
54
|
+
/** Tooltip text */
|
|
55
|
+
tooltip?: string;
|
|
56
|
+
/** Click handler - method name or function */
|
|
57
|
+
onClick?: string | ((e: MouseEvent) => void);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// =============================================================================
|
|
61
|
+
// EzInput
|
|
62
|
+
// =============================================================================
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Text input with icons and variants
|
|
66
|
+
* @example
|
|
67
|
+
* { eztype: 'EzInput', name: 'email', placeholder: 'Enter email', formData: 'form' }
|
|
68
|
+
*/
|
|
69
|
+
export interface EzInputItemConfig extends BaseComponentConfig {
|
|
70
|
+
eztype: 'EzInput';
|
|
71
|
+
/** Field name for form binding */
|
|
72
|
+
name?: string;
|
|
73
|
+
/** Form data path in controller state */
|
|
74
|
+
formData?: string;
|
|
75
|
+
/** Placeholder text */
|
|
76
|
+
placeholder?: string;
|
|
77
|
+
/** Initial value */
|
|
78
|
+
value?: string | number;
|
|
79
|
+
/** Input type */
|
|
80
|
+
inputType?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url';
|
|
81
|
+
/** Input size */
|
|
82
|
+
size?: 'sm' | 'lg';
|
|
83
|
+
/** Input variant */
|
|
84
|
+
variant?: 'filled' | 'underline';
|
|
85
|
+
/** Icon class (left side) */
|
|
86
|
+
icon?: string;
|
|
87
|
+
/** Full width */
|
|
88
|
+
block?: boolean;
|
|
89
|
+
/** Disable input */
|
|
90
|
+
disabled?: boolean;
|
|
91
|
+
/** Read-only input */
|
|
92
|
+
readonly?: boolean;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// =============================================================================
|
|
96
|
+
// EzTextarea
|
|
97
|
+
// =============================================================================
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Multi-line text input with auto-resize
|
|
101
|
+
* @example
|
|
102
|
+
* { eztype: 'EzTextarea', name: 'description', rows: 4, formData: 'form' }
|
|
103
|
+
*/
|
|
104
|
+
export interface EzTextareaItemConfig extends BaseComponentConfig {
|
|
105
|
+
eztype: 'EzTextarea';
|
|
106
|
+
/** Field name for form binding */
|
|
107
|
+
name?: string;
|
|
108
|
+
/** Form data path in controller state */
|
|
109
|
+
formData?: string;
|
|
110
|
+
/** Placeholder text */
|
|
111
|
+
placeholder?: string;
|
|
112
|
+
/** Initial value */
|
|
113
|
+
value?: string;
|
|
114
|
+
/** Number of visible rows */
|
|
115
|
+
rows?: number;
|
|
116
|
+
/** Minimum rows for auto-resize */
|
|
117
|
+
minRows?: number;
|
|
118
|
+
/** Maximum rows for auto-resize */
|
|
119
|
+
maxRows?: number;
|
|
120
|
+
/** Disable textarea */
|
|
121
|
+
disabled?: boolean;
|
|
122
|
+
/** Read-only textarea */
|
|
123
|
+
readonly?: boolean;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// =============================================================================
|
|
127
|
+
// EzSelect
|
|
128
|
+
// =============================================================================
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Dropdown select component
|
|
132
|
+
* @example
|
|
133
|
+
* { eztype: 'EzSelect', options: [{value: 1, label: 'One'}], placeholder: 'Select...' }
|
|
134
|
+
*/
|
|
135
|
+
export interface EzSelectItemConfig extends BaseComponentConfig {
|
|
136
|
+
eztype: 'EzSelect';
|
|
137
|
+
/** Select options - array of {value, label} or primitives */
|
|
138
|
+
options?: ({ value: string | number; label: string } | string | number)[];
|
|
139
|
+
/** Selected value */
|
|
140
|
+
value?: string | number | null;
|
|
141
|
+
/** Placeholder when no selection */
|
|
142
|
+
placeholder?: string;
|
|
143
|
+
/** Selection change handler */
|
|
144
|
+
onSelect?: string | ((value: string | number) => void);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// =============================================================================
|
|
148
|
+
// EzCheckbox
|
|
149
|
+
// =============================================================================
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Checkbox input with label
|
|
153
|
+
* @example
|
|
154
|
+
* { eztype: 'EzCheckbox', name: 'agree', label: 'I agree', formData: 'form' }
|
|
155
|
+
*/
|
|
156
|
+
export interface EzCheckboxItemConfig extends BaseComponentConfig {
|
|
157
|
+
eztype: 'EzCheckbox';
|
|
158
|
+
/** Field name for form binding */
|
|
159
|
+
name?: string;
|
|
160
|
+
/** Form data path */
|
|
161
|
+
formData?: string;
|
|
162
|
+
/** Checkbox label text */
|
|
163
|
+
label?: string;
|
|
164
|
+
/** Checked state */
|
|
165
|
+
value?: boolean;
|
|
166
|
+
/** Checkbox size */
|
|
167
|
+
size?: 'sm' | 'lg';
|
|
168
|
+
/** Disable checkbox */
|
|
169
|
+
disabled?: boolean;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// =============================================================================
|
|
173
|
+
// EzSwitch
|
|
174
|
+
// =============================================================================
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Toggle switch component
|
|
178
|
+
* @example
|
|
179
|
+
* { eztype: 'EzSwitch', name: 'enabled', label: 'Enable feature', formData: 'settings' }
|
|
180
|
+
*/
|
|
181
|
+
export interface EzSwitchItemConfig extends BaseComponentConfig {
|
|
182
|
+
eztype: 'EzSwitch';
|
|
183
|
+
/** Field name for form binding */
|
|
184
|
+
name?: string;
|
|
185
|
+
/** Form data path */
|
|
186
|
+
formData?: string;
|
|
187
|
+
/** Switch label */
|
|
188
|
+
label?: string;
|
|
189
|
+
/** On/off state */
|
|
190
|
+
value?: boolean;
|
|
191
|
+
/** Switch size */
|
|
192
|
+
size?: 'sm' | 'lg';
|
|
193
|
+
/** Disable switch */
|
|
194
|
+
disabled?: boolean;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// =============================================================================
|
|
198
|
+
// EzRadio
|
|
199
|
+
// =============================================================================
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Radio button group
|
|
203
|
+
* @example
|
|
204
|
+
* { eztype: 'EzRadio', name: 'size', options: ['S', 'M', 'L'], formData: 'form' }
|
|
205
|
+
*/
|
|
206
|
+
export interface EzRadioItemConfig extends BaseComponentConfig {
|
|
207
|
+
eztype: 'EzRadio';
|
|
208
|
+
/** Field name for form binding */
|
|
209
|
+
name?: string;
|
|
210
|
+
/** Form data path */
|
|
211
|
+
formData?: string;
|
|
212
|
+
/** Radio options */
|
|
213
|
+
options?: ({ value: string | number; label: string } | string | number)[];
|
|
214
|
+
/** Selected value */
|
|
215
|
+
value?: string | number;
|
|
216
|
+
/** Radio size */
|
|
217
|
+
size?: 'sm' | 'lg';
|
|
218
|
+
/** Disable all options */
|
|
219
|
+
disabled?: boolean;
|
|
220
|
+
/** Layout direction */
|
|
221
|
+
direction?: 'horizontal' | 'vertical';
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// =============================================================================
|
|
225
|
+
// EzCard
|
|
226
|
+
// =============================================================================
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Card container with header and actions
|
|
230
|
+
* @example
|
|
231
|
+
* { eztype: 'EzCard', title: 'My Card', items: [...] }
|
|
232
|
+
*/
|
|
233
|
+
export interface EzCardItemConfig extends BaseComponentConfig {
|
|
234
|
+
eztype: 'EzCard';
|
|
235
|
+
/** Card title */
|
|
236
|
+
title?: string;
|
|
237
|
+
/** Card subtitle */
|
|
238
|
+
subtitle?: string;
|
|
239
|
+
/** Action buttons in header */
|
|
240
|
+
headerActions?: ItemConfig[];
|
|
241
|
+
/** Card variant */
|
|
242
|
+
variant?: 'default' | 'bordered' | 'elevated';
|
|
243
|
+
/** Remove body padding */
|
|
244
|
+
noPadding?: boolean;
|
|
245
|
+
/** Card content */
|
|
246
|
+
items?: ItemConfig[];
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// =============================================================================
|
|
250
|
+
// EzBadge
|
|
251
|
+
// =============================================================================
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Badge for status, labels, and notifications
|
|
255
|
+
* @example
|
|
256
|
+
* { eztype: 'EzBadge', text: 'New', variant: 'success', pill: true }
|
|
257
|
+
*/
|
|
258
|
+
export interface EzBadgeItemConfig extends BaseComponentConfig {
|
|
259
|
+
eztype: 'EzBadge';
|
|
260
|
+
/** Badge text */
|
|
261
|
+
text?: string | number;
|
|
262
|
+
/** Badge variant */
|
|
263
|
+
variant?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
|
264
|
+
/** Badge size */
|
|
265
|
+
size?: 'sm' | 'lg';
|
|
266
|
+
/** Pill shape (rounded) */
|
|
267
|
+
pill?: boolean;
|
|
268
|
+
/** Outline style */
|
|
269
|
+
outline?: boolean;
|
|
270
|
+
/** Dot indicator (no text) */
|
|
271
|
+
dot?: boolean;
|
|
272
|
+
/** Icon class */
|
|
273
|
+
icon?: string;
|
|
274
|
+
/** Show close button */
|
|
275
|
+
closable?: boolean;
|
|
276
|
+
/** Close button handler */
|
|
277
|
+
onClose?: (e: MouseEvent) => void;
|
|
278
|
+
/** Click handler */
|
|
279
|
+
onClick?: (e: MouseEvent) => void;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// =============================================================================
|
|
283
|
+
// EzLabel
|
|
284
|
+
// =============================================================================
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Text label with binding support
|
|
288
|
+
* @example
|
|
289
|
+
* { eztype: 'EzLabel', text: 'Hello', bind: { text: 'userName' } }
|
|
290
|
+
*/
|
|
291
|
+
export interface EzLabelItemConfig extends BaseComponentConfig {
|
|
292
|
+
eztype: 'EzLabel';
|
|
293
|
+
/** Label text */
|
|
294
|
+
text?: string;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// =============================================================================
|
|
298
|
+
// EzForm
|
|
299
|
+
// =============================================================================
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Form container with validation
|
|
303
|
+
* @example
|
|
304
|
+
* { eztype: 'EzForm', formData: 'userData', onSubmit: 'handleSubmit', items: [...] }
|
|
305
|
+
*/
|
|
306
|
+
export interface EzFormItemConfig extends BaseComponentConfig {
|
|
307
|
+
eztype: 'EzForm';
|
|
308
|
+
/** State path for form data */
|
|
309
|
+
formData?: string;
|
|
310
|
+
/** Gap between form items */
|
|
311
|
+
gap?: string;
|
|
312
|
+
/** Row layout - items per row e.g., [2, 3] */
|
|
313
|
+
layout?: number[];
|
|
314
|
+
/** Default props for form items */
|
|
315
|
+
defaults?: { eztype?: string; [key: string]: unknown };
|
|
316
|
+
/** Submit handler - method name or function */
|
|
317
|
+
onSubmit?: string | ((dirtyData: object, formData: object, form: unknown) => void);
|
|
318
|
+
/** Form items */
|
|
319
|
+
items?: ItemConfig[];
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// =============================================================================
|
|
323
|
+
// EzGrid
|
|
324
|
+
// =============================================================================
|
|
325
|
+
|
|
326
|
+
interface GridColumnConfig {
|
|
327
|
+
/** Field index in row data */
|
|
328
|
+
index?: string;
|
|
329
|
+
/** Column type */
|
|
330
|
+
type?: 'selection' | 'actions' | string;
|
|
331
|
+
/** Column header text */
|
|
332
|
+
text?: string;
|
|
333
|
+
/** Flex grow */
|
|
334
|
+
flex?: number;
|
|
335
|
+
/** Fixed width in pixels */
|
|
336
|
+
width?: number;
|
|
337
|
+
/** Custom cell render function */
|
|
338
|
+
render?: (value: unknown, row: Record<string, unknown>, cell: HTMLElement) => unknown;
|
|
339
|
+
/** Enable sorting */
|
|
340
|
+
sort?: boolean;
|
|
341
|
+
/** Enable filtering */
|
|
342
|
+
filter?: boolean | string | object;
|
|
343
|
+
/** Action buttons for actions column */
|
|
344
|
+
actions?: { icon?: string; tooltip?: string; danger?: boolean; onClick?: (row: Record<string, unknown>) => void }[];
|
|
345
|
+
/** Text wrapping */
|
|
346
|
+
wrap?: boolean | number;
|
|
347
|
+
/** Enable column resize */
|
|
348
|
+
resizable?: boolean;
|
|
349
|
+
/** Enable column reorder */
|
|
350
|
+
reorderable?: boolean;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Data grid with sorting, filtering, and pagination
|
|
355
|
+
* @example
|
|
356
|
+
* { eztype: 'EzGrid', columns: [...], data: users, rowKey: 'id' }
|
|
357
|
+
*/
|
|
358
|
+
export interface EzGridItemConfig extends BaseComponentConfig {
|
|
359
|
+
eztype: 'EzGrid';
|
|
360
|
+
/** Grid columns configuration */
|
|
361
|
+
columns?: GridColumnConfig[];
|
|
362
|
+
/** Local data array */
|
|
363
|
+
data?: Record<string, unknown>[];
|
|
364
|
+
/** Row identifier field */
|
|
365
|
+
rowKey?: string | ((row: Record<string, unknown>) => string | number);
|
|
366
|
+
/** Data model name */
|
|
367
|
+
model?: string;
|
|
368
|
+
/** Grid controller name */
|
|
369
|
+
gridController?: string;
|
|
370
|
+
/** Selection mode */
|
|
371
|
+
selectionMode?: 'single' | 'multi';
|
|
372
|
+
/** Data mode */
|
|
373
|
+
dataMode?: 'local' | 'remote';
|
|
374
|
+
/** Remote data configuration */
|
|
375
|
+
remote?: {
|
|
376
|
+
api?: string;
|
|
377
|
+
source?: { dataPath?: string; countPath?: string };
|
|
378
|
+
autoLoad?: boolean;
|
|
379
|
+
};
|
|
380
|
+
/** Page size */
|
|
381
|
+
pageSize?: number;
|
|
382
|
+
/** Show pagination */
|
|
383
|
+
showPagination?: boolean;
|
|
384
|
+
/** Show title bar */
|
|
385
|
+
showTitle?: boolean;
|
|
386
|
+
/** Show filters */
|
|
387
|
+
showFilters?: boolean;
|
|
388
|
+
/** Persist state to localStorage */
|
|
389
|
+
stateful?: boolean;
|
|
390
|
+
statefulPersist?: boolean;
|
|
391
|
+
/** Row click handler */
|
|
392
|
+
onRowClick?: string | ((row: Record<string, unknown>, ctx: object) => void);
|
|
393
|
+
/** Selection change handler */
|
|
394
|
+
onSelectionChange?: string | ((rows: Record<string, unknown>[]) => void);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// =============================================================================
|
|
398
|
+
// EzTabPanel
|
|
399
|
+
// =============================================================================
|
|
400
|
+
|
|
401
|
+
interface TabConfig {
|
|
402
|
+
/** Tab identifier */
|
|
403
|
+
id?: string | number;
|
|
404
|
+
/** Tab title */
|
|
405
|
+
title?: string;
|
|
406
|
+
/** Tab icon */
|
|
407
|
+
icon?: string;
|
|
408
|
+
/** Allow closing tab */
|
|
409
|
+
closable?: boolean;
|
|
410
|
+
/** Tab content */
|
|
411
|
+
items?: ItemConfig[];
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* Tabbed content panel with variants
|
|
416
|
+
* @example
|
|
417
|
+
* { eztype: 'EzTabPanel', tabs: [{ id: 'tab1', title: 'Tab 1', items: [...] }] }
|
|
418
|
+
*/
|
|
419
|
+
export interface EzTabPanelItemConfig extends BaseComponentConfig {
|
|
420
|
+
eztype: 'EzTabPanel';
|
|
421
|
+
/** Tab panel id for state persistence */
|
|
422
|
+
id?: string;
|
|
423
|
+
/** Tab configurations */
|
|
424
|
+
tabs?: TabConfig[];
|
|
425
|
+
/** Initially active tab */
|
|
426
|
+
activeTab?: string | number;
|
|
427
|
+
/** Tab style variant */
|
|
428
|
+
variant?: string;
|
|
429
|
+
/** Persist state */
|
|
430
|
+
stateful?: boolean;
|
|
431
|
+
statefulPersist?: boolean;
|
|
432
|
+
/** Tab change handler */
|
|
433
|
+
onTabChange?: (tabId: string | number) => void;
|
|
434
|
+
/** Tab add handler */
|
|
435
|
+
onTabAdd?: (tabId: string | number, config: TabConfig) => void;
|
|
436
|
+
/** Tab close handler */
|
|
437
|
+
onTabClose?: (tabId: string | number) => void;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// =============================================================================
|
|
441
|
+
// EzDialog
|
|
442
|
+
// =============================================================================
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Modal dialog with sizes and async loading
|
|
446
|
+
* @example
|
|
447
|
+
* ez.dialog.show({ title: 'Confirm', message: 'Are you sure?' })
|
|
448
|
+
*/
|
|
449
|
+
export interface EzDialogItemConfig extends BaseComponentConfig {
|
|
450
|
+
eztype: 'EzDialog';
|
|
451
|
+
/** Dialog title */
|
|
452
|
+
title?: string;
|
|
453
|
+
/** Dialog size */
|
|
454
|
+
size?: 'sm' | 'md' | 'lg' | 'xl' | 'fullscreen';
|
|
455
|
+
/** Show close button */
|
|
456
|
+
closable?: boolean;
|
|
457
|
+
/** Dialog content */
|
|
458
|
+
items?: ItemConfig[];
|
|
459
|
+
/** Footer buttons */
|
|
460
|
+
buttons?: ItemConfig[];
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
// =============================================================================
|
|
464
|
+
// EzDropdown
|
|
465
|
+
// =============================================================================
|
|
466
|
+
|
|
467
|
+
interface DropdownItem {
|
|
468
|
+
/** Item text */
|
|
469
|
+
text?: string;
|
|
470
|
+
/** Item icon */
|
|
471
|
+
icon?: string;
|
|
472
|
+
/** Keyboard shortcut display */
|
|
473
|
+
shortcut?: string;
|
|
474
|
+
/** Divider line */
|
|
475
|
+
divider?: boolean;
|
|
476
|
+
/** Disable item */
|
|
477
|
+
disabled?: boolean;
|
|
478
|
+
/** Danger style */
|
|
479
|
+
danger?: boolean;
|
|
480
|
+
/** Click handler */
|
|
481
|
+
onClick?: () => void;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Dropdown menu with icons and shortcuts
|
|
486
|
+
* @example
|
|
487
|
+
* { eztype: 'EzDropdown', trigger: { eztype: 'EzButton', text: 'Menu' }, items: [...] }
|
|
488
|
+
*/
|
|
489
|
+
export interface EzDropdownItemConfig extends BaseComponentConfig {
|
|
490
|
+
eztype: 'EzDropdown';
|
|
491
|
+
/** Trigger element */
|
|
492
|
+
trigger?: ItemConfig;
|
|
493
|
+
/** Dropdown items */
|
|
494
|
+
items?: DropdownItem[];
|
|
495
|
+
/** Dropdown position */
|
|
496
|
+
position?: 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end';
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
// =============================================================================
|
|
500
|
+
// EzComponent
|
|
501
|
+
// =============================================================================
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Base layout component with flex support
|
|
505
|
+
* @example
|
|
506
|
+
* { eztype: 'EzComponent', layout: 'hbox', items: [...] }
|
|
507
|
+
*/
|
|
508
|
+
export interface EzComponentItemConfig extends BaseComponentConfig {
|
|
509
|
+
eztype: 'EzComponent';
|
|
510
|
+
/** Layout direction */
|
|
511
|
+
layout?: 'hbox' | 'vbox';
|
|
512
|
+
/** Child items */
|
|
513
|
+
items?: ItemConfig[];
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// =============================================================================
|
|
517
|
+
// EzPanel
|
|
518
|
+
// =============================================================================
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Panel with header, title, tools and content
|
|
522
|
+
* @example
|
|
523
|
+
* { eztype: 'EzPanel', title: 'Settings', collapsible: true, items: [...] }
|
|
524
|
+
*/
|
|
525
|
+
export interface EzPanelItemConfig extends BaseComponentConfig {
|
|
526
|
+
eztype: 'EzPanel';
|
|
527
|
+
/** Panel title */
|
|
528
|
+
title?: string;
|
|
529
|
+
/** Title icon */
|
|
530
|
+
icon?: string;
|
|
531
|
+
/** Header tool buttons */
|
|
532
|
+
tools?: ItemConfig[];
|
|
533
|
+
/** Allow collapsing */
|
|
534
|
+
collapsible?: boolean;
|
|
535
|
+
/** Initial collapsed state */
|
|
536
|
+
collapsed?: boolean;
|
|
537
|
+
/** Panel content */
|
|
538
|
+
items?: ItemConfig[];
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// =============================================================================
|
|
542
|
+
// EzSkeleton
|
|
543
|
+
// =============================================================================
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Loading placeholder for content
|
|
547
|
+
* @example
|
|
548
|
+
* { eztype: 'EzSkeleton', variant: 'card', count: 3 }
|
|
549
|
+
*/
|
|
550
|
+
export interface EzSkeletonItemConfig extends BaseComponentConfig {
|
|
551
|
+
eztype: 'EzSkeleton';
|
|
552
|
+
/** Skeleton variant */
|
|
553
|
+
variant?: 'text' | 'circle' | 'rect' | 'card';
|
|
554
|
+
/** Width */
|
|
555
|
+
width?: string | number;
|
|
556
|
+
/** Height */
|
|
557
|
+
height?: string | number;
|
|
558
|
+
/** Number of skeleton items */
|
|
559
|
+
count?: number;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
// =============================================================================
|
|
563
|
+
// EzAvatar
|
|
564
|
+
// =============================================================================
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* User avatar component
|
|
568
|
+
* @example
|
|
569
|
+
* { eztype: 'EzAvatar', name: 'John Doe', src: '/avatar.jpg', size: 'lg' }
|
|
570
|
+
*/
|
|
571
|
+
export interface EzAvatarItemConfig extends BaseComponentConfig {
|
|
572
|
+
eztype: 'EzAvatar';
|
|
573
|
+
/** User name (for initials fallback) */
|
|
574
|
+
name?: string;
|
|
575
|
+
/** Image source URL */
|
|
576
|
+
src?: string;
|
|
577
|
+
/** Avatar size */
|
|
578
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
579
|
+
/** Shape */
|
|
580
|
+
shape?: 'circle' | 'square';
|
|
581
|
+
/** Status indicator */
|
|
582
|
+
status?: 'online' | 'offline' | 'busy' | 'away';
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
// =============================================================================
|
|
586
|
+
// Chart Components
|
|
587
|
+
// =============================================================================
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Line chart with simplified API
|
|
591
|
+
* @example
|
|
592
|
+
* { eztype: 'EzLineChart', labels: ['Mon','Tue'], datasets: [{data: [1,2]}] }
|
|
593
|
+
*/
|
|
594
|
+
export interface EzLineChartItemConfig extends BaseComponentConfig {
|
|
595
|
+
eztype: 'EzLineChart';
|
|
596
|
+
/** Chart height */
|
|
597
|
+
height?: number;
|
|
598
|
+
/** X-axis labels */
|
|
599
|
+
labels?: string[];
|
|
600
|
+
/** Chart datasets */
|
|
601
|
+
datasets?: { label?: string; data: number[]; borderColor?: string; backgroundColor?: string }[];
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* Bar chart with simplified API
|
|
606
|
+
* @example
|
|
607
|
+
* { eztype: 'EzBarChart', labels: ['A','B'], datasets: [{data: [10,20]}] }
|
|
608
|
+
*/
|
|
609
|
+
export interface EzBarChartItemConfig extends BaseComponentConfig {
|
|
610
|
+
eztype: 'EzBarChart';
|
|
611
|
+
/** Chart height */
|
|
612
|
+
height?: number;
|
|
613
|
+
/** X-axis labels */
|
|
614
|
+
labels?: string[];
|
|
615
|
+
/** Chart datasets */
|
|
616
|
+
datasets?: { label?: string; data: number[]; backgroundColor?: string }[];
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Doughnut chart with simplified API
|
|
621
|
+
* @example
|
|
622
|
+
* { eztype: 'EzDoughnutChart', labels: ['A','B'], values: [30, 70] }
|
|
623
|
+
*/
|
|
624
|
+
export interface EzDoughnutChartItemConfig extends BaseComponentConfig {
|
|
625
|
+
eztype: 'EzDoughnutChart';
|
|
626
|
+
/** Chart height */
|
|
627
|
+
height?: number;
|
|
628
|
+
/** Segment labels */
|
|
629
|
+
labels?: string[];
|
|
630
|
+
/** Segment values */
|
|
631
|
+
values?: number[];
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
// =============================================================================
|
|
635
|
+
// EzActivityFeed
|
|
636
|
+
// =============================================================================
|
|
637
|
+
|
|
638
|
+
interface ActivityItem {
|
|
639
|
+
/** Icon class */
|
|
640
|
+
icon?: string;
|
|
641
|
+
/** Icon variant */
|
|
642
|
+
variant?: 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
|
643
|
+
/** Activity description */
|
|
644
|
+
description?: string;
|
|
645
|
+
/** Timestamp display */
|
|
646
|
+
timestamp?: string;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Activity feed with icons and timestamps
|
|
651
|
+
* @example
|
|
652
|
+
* { eztype: 'EzActivityFeed', items: [{ icon: 'fa-user', description: 'User joined' }] }
|
|
653
|
+
*/
|
|
654
|
+
export interface EzActivityFeedItemConfig extends BaseComponentConfig {
|
|
655
|
+
eztype: 'EzActivityFeed';
|
|
656
|
+
/** Maximum height with scroll */
|
|
657
|
+
maxHeight?: number | string;
|
|
658
|
+
/** Activity items */
|
|
659
|
+
items?: ActivityItem[];
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
// =============================================================================
|
|
663
|
+
// Union Type for All Components
|
|
664
|
+
// =============================================================================
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* Union of all Ez component configurations
|
|
668
|
+
* Provides autocomplete for component-specific props based on eztype
|
|
669
|
+
*/
|
|
670
|
+
export type EzItemConfig =
|
|
671
|
+
| EzButtonItemConfig
|
|
672
|
+
| EzInputItemConfig
|
|
673
|
+
| EzTextareaItemConfig
|
|
674
|
+
| EzSelectItemConfig
|
|
675
|
+
| EzCheckboxItemConfig
|
|
676
|
+
| EzSwitchItemConfig
|
|
677
|
+
| EzRadioItemConfig
|
|
678
|
+
| EzCardItemConfig
|
|
679
|
+
| EzBadgeItemConfig
|
|
680
|
+
| EzLabelItemConfig
|
|
681
|
+
| EzFormItemConfig
|
|
682
|
+
| EzGridItemConfig
|
|
683
|
+
| EzTabPanelItemConfig
|
|
684
|
+
| EzDialogItemConfig
|
|
685
|
+
| EzDropdownItemConfig
|
|
686
|
+
| EzComponentItemConfig
|
|
687
|
+
| EzPanelItemConfig
|
|
688
|
+
| EzSkeletonItemConfig
|
|
689
|
+
| EzAvatarItemConfig
|
|
690
|
+
| EzLineChartItemConfig
|
|
691
|
+
| EzBarChartItemConfig
|
|
692
|
+
| EzDoughnutChartItemConfig
|
|
693
|
+
| EzActivityFeedItemConfig;
|