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.
Files changed (154) hide show
  1. package/components/EzBaseComponent.ts +648 -0
  2. package/components/EzComponent.ts +89 -0
  3. package/components/EzInput.module.scss +183 -0
  4. package/components/EzInput.ts +104 -0
  5. package/components/EzLabel.ts +22 -0
  6. package/components/EzOutlet.ts +181 -0
  7. package/components/HtmlWrapper.ts +305 -0
  8. package/components/avatar/EzAvatar.module.scss +200 -0
  9. package/components/avatar/EzAvatar.ts +130 -0
  10. package/components/badge/EzBadge.module.scss +202 -0
  11. package/components/badge/EzBadge.ts +77 -0
  12. package/components/button/EzButton.module.scss +402 -0
  13. package/components/button/EzButton.ts +175 -0
  14. package/components/button/EzButtonGroup.ts +48 -0
  15. package/components/card/EzCard.module.scss +71 -0
  16. package/components/card/EzCard.ts +120 -0
  17. package/components/chart/EzBarChart.ts +47 -0
  18. package/components/chart/EzChart.module.scss +14 -0
  19. package/components/chart/EzChart.ts +279 -0
  20. package/components/chart/EzDoughnutChart.ts +47 -0
  21. package/components/chart/EzLineChart.ts +53 -0
  22. package/components/checkbox/EzCheckbox.module.scss +145 -0
  23. package/components/checkbox/EzCheckbox.ts +115 -0
  24. package/components/dataview/EzDataView.module.scss +115 -0
  25. package/components/dataview/EzDataView.ts +355 -0
  26. package/components/dataview/modes/EzDataViewCards.ts +322 -0
  27. package/components/dataview/modes/EzDataViewGrid.ts +76 -0
  28. package/components/datepicker/EzDatePicker.module.scss +348 -0
  29. package/components/datepicker/EzDatePicker.ts +519 -0
  30. package/components/dialog/EzDialog.module.scss +180 -0
  31. package/components/dropdown/EzDropdown.module.scss +107 -0
  32. package/components/dropdown/EzDropdown.ts +235 -0
  33. package/components/feed/EzActivityFeed.module.scss +90 -0
  34. package/components/feed/EzActivityFeed.ts +78 -0
  35. package/components/form/EzForm.ts +364 -0
  36. package/components/form/EzValidators.test.js +421 -0
  37. package/components/form/EzValidators.ts +202 -0
  38. package/components/grid/EzGrid.scss +88 -0
  39. package/components/grid/EzGrid.ts +1085 -0
  40. package/components/grid/EzGridContainer.ts +104 -0
  41. package/components/grid/body/EzGridBody.scss +283 -0
  42. package/components/grid/body/EzGridBody.ts +549 -0
  43. package/components/grid/body/EzGridCell.ts +211 -0
  44. package/components/grid/body/EzGridRow.ts +196 -0
  45. package/components/grid/filter/EzGridFilters.scss +78 -0
  46. package/components/grid/filter/EzGridFilters.ts +285 -0
  47. package/components/grid/footer/EzGridFooter.scss +136 -0
  48. package/components/grid/footer/EzGridFooter.ts +448 -0
  49. package/components/grid/header/EzGridHeader.scss +199 -0
  50. package/components/grid/header/EzGridHeader.ts +430 -0
  51. package/components/grid/query/EzGridQuery.ts +81 -0
  52. package/components/grid/state/EzGridColumns.ts +155 -0
  53. package/components/grid/state/EzGridController.ts +470 -0
  54. package/components/grid/state/EzGridLifecycle.ts +136 -0
  55. package/components/grid/state/EzGridNormalizers.test.js +273 -0
  56. package/components/grid/state/EzGridNormalizers.ts +162 -0
  57. package/components/grid/state/EzGridParts.ts +233 -0
  58. package/components/grid/state/EzGridPersistence.ts +140 -0
  59. package/components/grid/state/EzGridRemote.test.js +573 -0
  60. package/components/grid/state/EzGridRemote.ts +335 -0
  61. package/components/grid/state/EzGridSelection.ts +231 -0
  62. package/components/grid/state/EzGridSort.ts +286 -0
  63. package/components/grid/title/EzGridActionBar.ts +98 -0
  64. package/components/grid/title/EzGridTitle.ts +114 -0
  65. package/components/grid/title/EzGridTitleBar.scss +65 -0
  66. package/components/grid/title/EzGridTitleBar.ts +87 -0
  67. package/components/grid/types.ts +607 -0
  68. package/components/panel/EzPanel.module.scss +133 -0
  69. package/components/panel/EzPanel.ts +147 -0
  70. package/components/radio/EzRadio.module.scss +190 -0
  71. package/components/radio/EzRadio.ts +149 -0
  72. package/components/select/EzSelect.module.scss +153 -0
  73. package/components/select/EzSelect.ts +238 -0
  74. package/components/skeleton/EzSkeleton.module.scss +95 -0
  75. package/components/skeleton/EzSkeleton.ts +70 -0
  76. package/components/store/EzStore.ts +344 -0
  77. package/components/switch/EzSwitch.module.scss +164 -0
  78. package/components/switch/EzSwitch.ts +117 -0
  79. package/components/tabs/EzTabPanel.module.scss +181 -0
  80. package/components/tabs/EzTabPanel.ts +402 -0
  81. package/components/textarea/EzTextarea.module.scss +131 -0
  82. package/components/textarea/EzTextarea.ts +161 -0
  83. package/components/timepicker/EzTimePicker.module.scss +282 -0
  84. package/components/timepicker/EzTimePicker.ts +540 -0
  85. package/components/toast/EzToast.module.scss +291 -0
  86. package/components/tooltip/EzTooltip.module.scss +124 -0
  87. package/components/tooltip/EzTooltip.ts +153 -0
  88. package/core/EzComponentTypes.ts +693 -0
  89. package/core/EzError.ts +63 -0
  90. package/core/EzModel.ts +268 -0
  91. package/core/EzTypes.ts +328 -0
  92. package/core/eventBus.ts +284 -0
  93. package/core/ez.ts +617 -0
  94. package/core/loader.ts +725 -0
  95. package/core/renderer.ts +1010 -0
  96. package/core/router.ts +490 -0
  97. package/core/services.ts +124 -0
  98. package/core/state.ts +142 -0
  99. package/core/utils.ts +81 -0
  100. package/package.json +51 -0
  101. package/services/RouteUI.js +17 -0
  102. package/services/crypto.js +64 -0
  103. package/services/dialog.js +222 -0
  104. package/services/fetchApi.js +63 -0
  105. package/services/firebase.js +30 -0
  106. package/services/toast.js +214 -0
  107. package/template/doc/EzDocs.js +15 -0
  108. package/template/doc/EzDocs.module.scss +627 -0
  109. package/template/doc/EzDocsController.js +164 -0
  110. package/template/doc/data/activityfeed/EzActivityFeedDoc.js +42 -0
  111. package/template/doc/data/avatar/EzAvatarDoc.js +71 -0
  112. package/template/doc/data/badge/EzBadgeDoc.js +92 -0
  113. package/template/doc/data/button/EzButtonDoc.js +77 -0
  114. package/template/doc/data/buttongroup/EzButtonGroupDoc.js +102 -0
  115. package/template/doc/data/card/EzCardDoc.js +39 -0
  116. package/template/doc/data/chart/EzChartDoc.js +60 -0
  117. package/template/doc/data/checkbox/EzCheckboxDoc.js +67 -0
  118. package/template/doc/data/component/EzComponentDoc.js +34 -0
  119. package/template/doc/data/cssmodules/CSSModulesDoc.js +70 -0
  120. package/template/doc/data/datepicker/EzDatePickerDoc.js +126 -0
  121. package/template/doc/data/dialog/EzDialogDoc.js +217 -0
  122. package/template/doc/data/dropdown/EzDropdownDoc.js +178 -0
  123. package/template/doc/data/form/EzFormDoc.js +90 -0
  124. package/template/doc/data/grid/EzGridDoc.js +99 -0
  125. package/template/doc/data/input/EzInputDoc.js +92 -0
  126. package/template/doc/data/label/EzLabelDoc.js +40 -0
  127. package/template/doc/data/model/EzModelDoc.js +53 -0
  128. package/template/doc/data/outlet/EzOutletDoc.js +63 -0
  129. package/template/doc/data/panel/EzPanelDoc.js +214 -0
  130. package/template/doc/data/radio/EzRadioDoc.js +174 -0
  131. package/template/doc/data/router/EzRouterDoc.js +75 -0
  132. package/template/doc/data/select/EzSelectDoc.js +37 -0
  133. package/template/doc/data/skeleton/EzSkeletonDoc.js +149 -0
  134. package/template/doc/data/switch/EzSwitchDoc.js +82 -0
  135. package/template/doc/data/tabpanel/EzTabPanelDoc.js +44 -0
  136. package/template/doc/data/textarea/EzTextareaDoc.js +131 -0
  137. package/template/doc/data/timepicker/EzTimePickerDoc.js +107 -0
  138. package/template/doc/data/tooltip/EzTooltipDoc.js +193 -0
  139. package/template/doc/data/validators/EzValidatorsDoc.js +37 -0
  140. package/template/doc/sidebar/EzDocsSidebar.js +32 -0
  141. package/template/doc/sidebar/category/EzDocsCategory.js +33 -0
  142. package/template/doc/sidebar/item/EzDocsComponentItem.js +24 -0
  143. package/template/doc/viewer/EzDocsViewer.js +18 -0
  144. package/template/doc/viewer/codepanel/EzDocsCodePanel.js +51 -0
  145. package/template/doc/viewer/content/EzDocsContent.js +315 -0
  146. package/template/doc/viewer/header/EzDocsViewerHeader.js +46 -0
  147. package/template/doc/viewer/showcase/EzDocsShowcase.js +59 -0
  148. package/template/doc/viewer/showcase/EzDocsShowcaseSection.js +25 -0
  149. package/template/doc/viewer/showcase/EzDocsVariantItem.js +29 -0
  150. package/template/doc/welcome/EzDocsWelcome.js +48 -0
  151. package/themes/ez-theme.scss +179 -0
  152. package/themes/nature-fresh.scss +169 -0
  153. package/types/global.d.ts +21 -0
  154. package/utils/cssModules.js +81 -0
@@ -0,0 +1,104 @@
1
+ // EzGrid/EzGridContainer.ts
2
+
3
+ import { EzBaseComponent, EzComponentConfig } from '../EzBaseComponent.js';
4
+
5
+ declare const ez: {
6
+ _createChildElements(
7
+ items: EzComponentConfig[],
8
+ controller: string | null,
9
+ state: unknown,
10
+ css: string | null
11
+ ): Promise<Node[]>;
12
+ };
13
+
14
+ type LayoutType = 'hbox' | 'vbox';
15
+
16
+ export interface EzGridContainerConfig extends Omit<EzComponentConfig, 'controller'> {
17
+ layout?: LayoutType;
18
+ flex?: string | number;
19
+ items?: any[];
20
+ attrs?: Record<string, string | number | boolean | null | undefined>;
21
+ onClick?: (e: MouseEvent, component: EzGridContainer) => void;
22
+ onDblClick?: (e: MouseEvent, component: EzGridContainer) => void;
23
+ onContextMenu?: (e: MouseEvent, component: EzGridContainer) => void;
24
+ controller?: string | null;
25
+ css?: string | null;
26
+ }
27
+
28
+ export class EzGridContainer extends EzBaseComponent {
29
+ declare config: any; // EzGridContainerConfig - relaxed for subclass compatibility
30
+
31
+ constructor(config: EzGridContainerConfig = {}) {
32
+ super(config as any);
33
+ this.config = config;
34
+ }
35
+
36
+ async render(): Promise<HTMLDivElement> {
37
+ const el = document.createElement('div');
38
+
39
+ const { layout, style = {} } = this.config;
40
+
41
+ if (layout === 'hbox') {
42
+ el.style.display = 'flex';
43
+ el.style.flexDirection = 'row';
44
+ }
45
+
46
+ if (layout === 'vbox') {
47
+ el.style.display = 'flex';
48
+ el.style.flexDirection = 'column';
49
+ }
50
+
51
+ const attrs = this.config.attrs;
52
+ if (attrs && typeof attrs === 'object') {
53
+ Object.entries(attrs).forEach(([k, v]) => {
54
+ if (v != null) el.setAttribute(k, String(v));
55
+ });
56
+ }
57
+
58
+ Object.assign(el.style, style);
59
+
60
+ if (this.config.flex) {
61
+ el.style.flex = String(this.config.flex);
62
+ }
63
+
64
+ this.applyCls(el);
65
+
66
+ if (this.config.onClick) {
67
+ el.addEventListener('click', (e: MouseEvent) => {
68
+ this.config.onClick!(e, this);
69
+ });
70
+ }
71
+
72
+ if (this.config.onDblClick) {
73
+ el.addEventListener('dblclick', (e: MouseEvent) => {
74
+ this.config.onDblClick!(e, this);
75
+ });
76
+ }
77
+
78
+ if (typeof this.config.onContextMenu === 'function') {
79
+ el.addEventListener('contextmenu', (e: MouseEvent) => {
80
+ e.preventDefault();
81
+ e.stopPropagation();
82
+
83
+ this.config.onContextMenu!(e, this);
84
+ });
85
+ }
86
+
87
+ if (this.config.items) {
88
+ const children = await ez._createChildElements(
89
+ this.config.items,
90
+ this.config.controller || null,
91
+ null,
92
+ this.config.css || null
93
+ );
94
+
95
+ for (const child of children) {
96
+ if (child instanceof Node) {
97
+ el.appendChild(child);
98
+ }
99
+ }
100
+ }
101
+
102
+ return el;
103
+ }
104
+ }
@@ -0,0 +1,283 @@
1
+ // ==========================================================
2
+ // EzGridBody
3
+ // ==========================================================
4
+
5
+ .ez-grid {
6
+ .ez-grid-body {
7
+ flex: 1;
8
+ overflow-y: auto;
9
+ min-height: 0;
10
+ }
11
+
12
+ // ----------------------------------------------------------
13
+ // Rows
14
+ // ----------------------------------------------------------
15
+ .ez-grid-row {
16
+ display: flex;
17
+ flex-direction: row;
18
+ align-items: stretch;
19
+ border-bottom: 1px solid var(--ez-grid-border-light);
20
+ cursor: pointer;
21
+
22
+ background-color: var(--ez-grid-bg);
23
+
24
+ transition: background-color 0.1s ease;
25
+
26
+ &:last-child {
27
+ border-bottom: none;
28
+ }
29
+
30
+ // Zebra striping - alternating row colors
31
+ &:nth-child(even) {
32
+ background-color: var(--ez-grid-surface);
33
+ }
34
+
35
+ &:hover {
36
+ background-color: var(--ez-grid-surface-hover);
37
+ }
38
+
39
+ // Selected state - uses theme primary color
40
+ &.is-selected {
41
+ background-color: var(--ez-grid-row-selected);
42
+ border-left: 3px solid var(--ez-grid-primary);
43
+
44
+ .ez-grid-cell:first-child {
45
+ padding-left: 9px; // compensate for border
46
+ }
47
+
48
+ &:nth-child(even) {
49
+ background-color: var(--ez-grid-row-selected);
50
+ }
51
+
52
+ &:hover {
53
+ background-color: var(--ez-grid-primary-light);
54
+ }
55
+ }
56
+
57
+ // Keyboard focus state - subtle indicator for keyboard navigation only
58
+ &.is-focused {
59
+ background-color: var(--ez-grid-surface-hover);
60
+ box-shadow: inset 3px 0 0 var(--ez-grid-primary);
61
+ }
62
+
63
+ // Combined focused + selected
64
+ &.is-focused.is-selected {
65
+ background-color: var(--ez-grid-primary-light);
66
+ box-shadow: inset 3px 0 0 var(--ez-grid-primary);
67
+ }
68
+ }
69
+
70
+ // Focus styling for grid body - remove default outline
71
+ .ez-grid-body:focus,
72
+ .ez-grid-body:focus-visible {
73
+ outline: none;
74
+ }
75
+
76
+ // ----------------------------------------------------------
77
+ // Virtual scrolling
78
+ // ----------------------------------------------------------
79
+ .ez-grid-body--virtual {
80
+ position: relative;
81
+
82
+ .ez-grid-virtual-container {
83
+ position: relative;
84
+ }
85
+
86
+ .ez-grid-row {
87
+ position: absolute;
88
+ left: 0;
89
+ right: 0;
90
+ }
91
+ }
92
+
93
+ // ----------------------------------------------------------
94
+ // Cells
95
+ // ----------------------------------------------------------
96
+ .ez-grid-cell {
97
+ display: flex;
98
+ align-items: center;
99
+ align-self: stretch;
100
+
101
+ padding: 8px 12px;
102
+ min-height: 40px;
103
+ box-sizing: border-box;
104
+
105
+ font-size: var(--ez-grid-font-size);
106
+ color: var(--ez-grid-text);
107
+
108
+ // CRITICAL: Allow flex item to shrink below content size
109
+ min-width: 0;
110
+ overflow: hidden;
111
+
112
+ // Text overflow only applies to text content, not components
113
+ .ez-grid-cell-inner {
114
+ flex: 1;
115
+ min-width: 0;
116
+ white-space: nowrap;
117
+ overflow: hidden;
118
+ text-overflow: ellipsis;
119
+ }
120
+
121
+ // Wrap mode: multi-line text (line count set via inline style)
122
+ &.ez-grid-cell-wrap {
123
+ align-items: flex-start;
124
+
125
+ .ez-grid-cell-inner {
126
+ white-space: normal;
127
+ word-break: break-word;
128
+
129
+ // Line clamp with ellipsis (-webkit-line-clamp set via inline style)
130
+ display: -webkit-box;
131
+ -webkit-box-orient: vertical;
132
+ overflow: hidden;
133
+ text-overflow: ellipsis;
134
+ }
135
+ }
136
+ }
137
+
138
+ // ----------------------------------------------------------
139
+ // Empty state
140
+ // ----------------------------------------------------------
141
+ .ez-grid-empty {
142
+ display: flex;
143
+ flex-direction: column;
144
+ align-items: center;
145
+ justify-content: center;
146
+ flex: 1;
147
+ padding: 48px 24px;
148
+ color: var(--ez-grid-text-muted);
149
+ font-size: var(--ez-grid-font-size);
150
+ text-align: center;
151
+ min-height: 120px;
152
+ }
153
+
154
+ // ----------------------------------------------------------
155
+ // Loading state
156
+ // ----------------------------------------------------------
157
+ .ez-grid-loading {
158
+ display: flex;
159
+ flex-direction: column;
160
+ align-items: center;
161
+ justify-content: center;
162
+ flex: 1;
163
+ padding: 48px 24px;
164
+ min-height: 120px;
165
+ gap: 12px;
166
+ }
167
+
168
+ .ez-grid-loading-spinner {
169
+ width: 32px;
170
+ height: 32px;
171
+ border: 3px solid var(--ez-grid-border-light);
172
+ border-top-color: var(--ez-grid-primary);
173
+ border-radius: 50%;
174
+ animation: ez-grid-spin 0.8s linear infinite;
175
+ }
176
+
177
+ .ez-grid-loading-text {
178
+ color: var(--ez-grid-text-muted);
179
+ font-size: var(--ez-grid-font-size);
180
+ }
181
+
182
+ @keyframes ez-grid-spin {
183
+ to {
184
+ transform: rotate(360deg);
185
+ }
186
+ }
187
+
188
+ // ----------------------------------------------------------
189
+ // Error state
190
+ // ----------------------------------------------------------
191
+ .ez-grid-error {
192
+ display: flex;
193
+ flex-direction: column;
194
+ align-items: center;
195
+ justify-content: center;
196
+ flex: 1;
197
+ padding: 48px 24px;
198
+ min-height: 120px;
199
+ gap: 12px;
200
+ text-align: center;
201
+ }
202
+
203
+ .ez-grid-error-icon {
204
+ font-size: 32px;
205
+ color: var(--ez-grid-danger);
206
+ }
207
+
208
+ .ez-grid-error-message {
209
+ color: var(--ez-grid-text);
210
+ font-size: var(--ez-grid-font-size);
211
+ max-width: 400px;
212
+ }
213
+
214
+ .ez-grid-error-retry {
215
+ margin-top: 8px;
216
+ padding: 8px 16px;
217
+ background-color: var(--ez-grid-primary);
218
+ color: white;
219
+ border: none;
220
+ border-radius: var(--ez-grid-radius-sm);
221
+ font-size: var(--ez-grid-font-size);
222
+ cursor: pointer;
223
+ transition: background-color 0.15s ease, filter 0.15s ease;
224
+
225
+ &:hover {
226
+ filter: brightness(0.9);
227
+ }
228
+ }
229
+
230
+ // ----------------------------------------------------------
231
+ // Action cells
232
+ // ----------------------------------------------------------
233
+ .ez-grid-cell-actions {
234
+ display: flex;
235
+ justify-content: center;
236
+ gap: 4px;
237
+ }
238
+
239
+ .ez-grid-action {
240
+ display: inline-flex;
241
+ align-items: center;
242
+ justify-content: center;
243
+
244
+ width: 28px;
245
+ height: 28px;
246
+ padding: 0;
247
+
248
+ cursor: pointer;
249
+ border-radius: var(--ez-grid-radius-sm);
250
+ border: none;
251
+ background: transparent;
252
+
253
+ color: var(--ez-grid-text-secondary);
254
+
255
+ transition: all 0.15s ease;
256
+
257
+ &:hover {
258
+ background-color: var(--ez-grid-surface-hover);
259
+ color: var(--ez-grid-text);
260
+ }
261
+
262
+ &.is-danger:hover {
263
+ background-color: var(--ez-grid-danger-light);
264
+ color: var(--ez-grid-danger);
265
+ }
266
+ }
267
+
268
+ // ----------------------------------------------------------
269
+ // Selection checkbox
270
+ // ----------------------------------------------------------
271
+ .ez-grid-cell-select {
272
+ display: flex;
273
+ justify-content: center;
274
+ padding: 0;
275
+
276
+ input[type='checkbox'] {
277
+ width: 16px;
278
+ height: 16px;
279
+ cursor: pointer;
280
+ accent-color: var(--ez-grid-primary);
281
+ }
282
+ }
283
+ }