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,178 @@
1
+ ez.define('EzDropdownDoc', {
2
+ controller: 'EzDocs',
3
+ template() {
4
+ const sections = [
5
+ {
6
+ title: 'Basic Menu',
7
+ variants: [
8
+ {
9
+ label: 'Simple Dropdown',
10
+ config: {
11
+ eztype: 'EzDropdown',
12
+ trigger: { eztype: 'EzButton', text: 'Actions', icon: 'fa-solid fa-chevron-down', iconPosition: 'right' },
13
+ items: [
14
+ { text: 'Edit', onClick: () => ez.toast.info('Edit clicked') },
15
+ { text: 'Duplicate', onClick: () => ez.toast.info('Duplicate clicked') },
16
+ { text: 'Delete', onClick: () => ez.toast.info('Delete clicked') }
17
+ ]
18
+ }
19
+ }
20
+ ]
21
+ },
22
+ {
23
+ title: 'With Icons & Shortcuts',
24
+ variants: [
25
+ {
26
+ label: 'Full Featured',
27
+ config: {
28
+ eztype: 'EzDropdown',
29
+ trigger: { eztype: 'EzButton', text: 'File', variant: 'primary' },
30
+ items: [
31
+ { text: 'New', icon: 'fa-solid fa-plus', shortcut: 'Ctrl+N' },
32
+ { text: 'Open', icon: 'fa-solid fa-folder-open', shortcut: 'Ctrl+O' },
33
+ { text: 'Save', icon: 'fa-solid fa-save', shortcut: 'Ctrl+S' },
34
+ { text: 'Save As', icon: 'fa-solid fa-save', shortcut: 'Ctrl+Shift+S' }
35
+ ]
36
+ }
37
+ }
38
+ ]
39
+ },
40
+ {
41
+ title: 'With Headers & Dividers',
42
+ variants: [
43
+ {
44
+ label: 'Grouped Items',
45
+ config: {
46
+ eztype: 'EzDropdown',
47
+ trigger: { eztype: 'EzButton', text: 'Options', icon: 'fa-solid fa-ellipsis-v' },
48
+ items: [
49
+ { header: 'Actions' },
50
+ { text: 'Edit', icon: 'fa-solid fa-edit' },
51
+ { text: 'Copy', icon: 'fa-solid fa-copy' },
52
+ { divider: true },
53
+ { header: 'More' },
54
+ { text: 'Share', icon: 'fa-solid fa-share' },
55
+ { text: 'Export', icon: 'fa-solid fa-download' }
56
+ ]
57
+ }
58
+ }
59
+ ]
60
+ },
61
+ {
62
+ title: 'Position Variants',
63
+ variants: [
64
+ {
65
+ label: 'Bottom Start',
66
+ config: {
67
+ eztype: 'EzDropdown',
68
+ position: 'bottom-start',
69
+ trigger: { eztype: 'EzButton', text: 'Bottom Start' },
70
+ items: [
71
+ { text: 'Option 1' },
72
+ { text: 'Option 2' },
73
+ { text: 'Option 3' }
74
+ ]
75
+ }
76
+ },
77
+ {
78
+ label: 'Bottom End',
79
+ config: {
80
+ eztype: 'EzDropdown',
81
+ position: 'bottom-end',
82
+ trigger: { eztype: 'EzButton', text: 'Bottom End' },
83
+ items: [
84
+ { text: 'Option 1' },
85
+ { text: 'Option 2' },
86
+ { text: 'Option 3' }
87
+ ]
88
+ }
89
+ },
90
+ {
91
+ label: 'Top Start',
92
+ config: {
93
+ eztype: 'EzDropdown',
94
+ position: 'top-start',
95
+ trigger: { eztype: 'EzButton', text: 'Top Start' },
96
+ items: [
97
+ { text: 'Option 1' },
98
+ { text: 'Option 2' },
99
+ { text: 'Option 3' }
100
+ ]
101
+ }
102
+ }
103
+ ]
104
+ },
105
+ {
106
+ title: 'Danger Items',
107
+ variants: [
108
+ {
109
+ label: 'With Danger',
110
+ config: {
111
+ eztype: 'EzDropdown',
112
+ trigger: { eztype: 'EzButton', text: 'Manage', icon: 'fa-solid fa-cog' },
113
+ items: [
114
+ { text: 'Settings', icon: 'fa-solid fa-cog' },
115
+ { text: 'Permissions', icon: 'fa-solid fa-shield' },
116
+ { divider: true },
117
+ { text: 'Delete', icon: 'fa-solid fa-trash', danger: true }
118
+ ]
119
+ }
120
+ }
121
+ ]
122
+ },
123
+ {
124
+ title: 'Disabled Items',
125
+ variants: [
126
+ {
127
+ label: 'Some Disabled',
128
+ config: {
129
+ eztype: 'EzDropdown',
130
+ trigger: { eztype: 'EzButton', text: 'Actions' },
131
+ items: [
132
+ { text: 'Available Action' },
133
+ { text: 'Disabled Action', disabled: true },
134
+ { text: 'Another Available' },
135
+ { text: 'Also Disabled', disabled: true }
136
+ ]
137
+ }
138
+ }
139
+ ]
140
+ },
141
+ {
142
+ title: 'Icon Only Trigger',
143
+ variants: [
144
+ {
145
+ label: 'Icon Button',
146
+ config: {
147
+ eztype: 'EzDropdown',
148
+ trigger: { eztype: 'EzButton', icon: 'fa-solid fa-ellipsis-v', variant: 'ghost' },
149
+ items: [
150
+ { text: 'View', icon: 'fa-solid fa-eye' },
151
+ { text: 'Edit', icon: 'fa-solid fa-edit' },
152
+ { text: 'Delete', icon: 'fa-solid fa-trash', danger: true }
153
+ ]
154
+ }
155
+ }
156
+ ]
157
+ }
158
+ ];
159
+
160
+ return {
161
+ eztype: 'EzComponent',
162
+ cls: 'ez-docs-showcase-container',
163
+ layout: 'hbox',
164
+ items: [
165
+ {
166
+ eztype: 'EzComponent',
167
+ cls: 'ez-docs-showcase-panel',
168
+ flex: 1,
169
+ items: sections.map(section => ({
170
+ eztype: 'EzDocsShowcaseSection',
171
+ props: { section }
172
+ }))
173
+ },
174
+ { eztype: 'EzDocsCodePanel' }
175
+ ]
176
+ };
177
+ }
178
+ });
@@ -0,0 +1,90 @@
1
+ ez.define('EzFormDoc', {
2
+ template() {
3
+ return {
4
+ eztype: 'EzDocsContent',
5
+ props: {
6
+ componentName: 'EzForm',
7
+ docs: {
8
+ features: [
9
+ 'Automatic data binding via formData property',
10
+ 'Built-in validation with EzValidators',
11
+ 'Dirty tracking (isDirty, getDirtyData)',
12
+ 'Form reset to initial values',
13
+ 'Real-time validation after first submit',
14
+ 'Auto-layout with layout: [1, 2, 1] array syntax'
15
+ ],
16
+ usage: {
17
+ config: {
18
+ eztype: 'EzForm',
19
+ style: { maxWidth: '400px' },
20
+ items: [
21
+ { eztype: 'EzInput', placeholder: 'Email', icon: 'envelope', validate: { required: true, email: true } },
22
+ { eztype: 'EzInput', placeholder: 'Password', icon: 'lock', inputType: 'password', validate: { required: true, minLength: 8 } },
23
+ {
24
+ eztype: 'EzComponent',
25
+ layout: 'hbox',
26
+ style: { gap: '12px', marginTop: '8px' },
27
+ items: [
28
+ { eztype: 'EzButton', text: 'Cancel', variant: 'ghost', flex: 1 },
29
+ { eztype: 'EzButton', text: 'Submit', variant: 'primary', htmlType: 'submit', flex: 1 }
30
+ ]
31
+ }
32
+ ]
33
+ },
34
+ code: `{
35
+ eztype: 'EzForm',
36
+ controller: 'MyController',
37
+ formData: 'form',
38
+ onSubmit: 'handleSubmit',
39
+ items: [
40
+ { eztype: 'EzInput', name: 'email', placeholder: 'Email', validate: { required: true, email: true } },
41
+ { eztype: 'EzInput', name: 'password', inputType: 'password', validate: { required: true, minLength: 8 } },
42
+ { eztype: 'EzButton', text: 'Submit', variant: 'primary', htmlType: 'submit' }
43
+ ]
44
+ }`
45
+ },
46
+ api: [
47
+ { method: 'formData', description: 'Path to form data in controller state' },
48
+ { method: 'onSubmit', description: 'Submit handler function or method name' },
49
+ { method: 'layout', description: 'Array of numbers defining items per row, e.g. [1, 2, 1]' },
50
+ { method: 'validate()', description: 'Validate all fields, returns true if valid' },
51
+ { method: 'getFormData()', description: 'Get current form data object' },
52
+ { method: 'resetFormData()', description: 'Reset form to initial values' },
53
+ { method: 'isDirty()', description: 'Check if form has unsaved changes' },
54
+ { method: 'getDirtyData()', description: 'Get only the changed fields' }
55
+ ],
56
+ sections: [
57
+ {
58
+ title: 'Auto Layout',
59
+ content: {
60
+ eztype: 'EzForm',
61
+ style: { maxWidth: '500px' },
62
+ layout: [1, 2, 2, 1],
63
+ items: [
64
+ { eztype: 'EzInput', placeholder: 'Full Name', icon: 'user' },
65
+ { eztype: 'EzInput', placeholder: 'First Name' },
66
+ { eztype: 'EzInput', placeholder: 'Last Name' },
67
+ { eztype: 'EzInput', placeholder: 'Email', icon: 'envelope' },
68
+ { eztype: 'EzInput', placeholder: 'Phone', icon: 'phone' },
69
+ { eztype: 'EzButton', text: 'Submit', variant: 'primary', block: true }
70
+ ]
71
+ },
72
+ code: `{
73
+ eztype: 'EzForm',
74
+ layout: [1, 2, 2, 1], // 1 + 2 + 2 + 1 = 6 items
75
+ items: [
76
+ { eztype: 'EzInput', placeholder: 'Full Name' }, // Row 1: 1 item
77
+ { eztype: 'EzInput', placeholder: 'First Name' }, // Row 2: 2 items
78
+ { eztype: 'EzInput', placeholder: 'Last Name' },
79
+ { eztype: 'EzInput', placeholder: 'Email' }, // Row 3: 2 items
80
+ { eztype: 'EzInput', placeholder: 'Phone' },
81
+ { eztype: 'EzButton', text: 'Submit', block: true } // Row 4: 1 item
82
+ ]
83
+ }`
84
+ }
85
+ ]
86
+ }
87
+ }
88
+ };
89
+ }
90
+ });
@@ -0,0 +1,99 @@
1
+ ez.define('EzGridDoc', {
2
+ controller: 'EzDocs',
3
+ template() {
4
+ const ctrl = ez.getControllerSync('EzDocs');
5
+ const sections = [
6
+ {
7
+ title: 'Basic Grid',
8
+ variants: [
9
+ { label: 'Simple', config: {
10
+ eztype: 'EzGrid',
11
+ height: 250,
12
+ columns: [
13
+ { index: 'id', text: 'ID', width: 60 },
14
+ { index: 'name', text: 'Name', flex: 1 },
15
+ { index: 'email', text: 'Email', flex: 1 },
16
+ { index: 'status', text: 'Status', width: 100 }
17
+ ],
18
+ data: [
19
+ { id: 1, name: 'John Doe', email: 'john@example.com', status: 'Active' },
20
+ { id: 2, name: 'Jane Smith', email: 'jane@example.com', status: 'Pending' },
21
+ { id: 3, name: 'Bob Wilson', email: 'bob@example.com', status: 'Active' }
22
+ ]
23
+ }}
24
+ ]
25
+ },
26
+ {
27
+ title: 'With Selection',
28
+ variants: [
29
+ { label: 'Multiple', config: {
30
+ eztype: 'EzGrid',
31
+ height: 250,
32
+ selection: { mode: 'multi' },
33
+ columns: [
34
+ { index: 'id', text: 'ID', width: 60 },
35
+ { index: 'name', text: 'Name', flex: 1 },
36
+ { index: 'email', text: 'Email', flex: 1 }
37
+ ],
38
+ data: [
39
+ { id: 1, name: 'John Doe', email: 'john@example.com' },
40
+ { id: 2, name: 'Jane Smith', email: 'jane@example.com' },
41
+ { id: 3, name: 'Bob Wilson', email: 'bob@example.com' }
42
+ ]
43
+ }}
44
+ ]
45
+ },
46
+ {
47
+ title: 'Sortable Columns',
48
+ variants: [
49
+ { label: 'Sortable', config: {
50
+ eztype: 'EzGrid',
51
+ height: 250,
52
+ columns: [
53
+ { index: 'id', text: 'ID', width: 60, sortable: true },
54
+ { index: 'name', text: 'Name', flex: 1, sortable: true },
55
+ { index: 'age', text: 'Age', width: 80, sortable: true },
56
+ { index: 'city', text: 'City', flex: 1, sortable: true }
57
+ ],
58
+ data: [
59
+ { id: 1, name: 'Alice', age: 28, city: 'New York' },
60
+ { id: 2, name: 'Bob', age: 35, city: 'Los Angeles' },
61
+ { id: 3, name: 'Charlie', age: 22, city: 'Chicago' },
62
+ { id: 4, name: 'Diana', age: 31, city: 'Houston' }
63
+ ]
64
+ }}
65
+ ]
66
+ },
67
+ {
68
+ title: 'Grid Variants',
69
+ variants: [
70
+ { label: 'Bordered', config: {
71
+ eztype: 'EzGrid',
72
+ height: 200,
73
+ variant: 'bordered',
74
+ columns: [
75
+ { index: 'id', text: 'ID', width: 60 },
76
+ { index: 'product', text: 'Product', flex: 1 },
77
+ { index: 'price', text: 'Price', width: 100 }
78
+ ],
79
+ data: [
80
+ { id: 1, product: 'Laptop', price: '$999' },
81
+ { id: 2, product: 'Mouse', price: '$29' },
82
+ { id: 3, product: 'Keyboard', price: '$79' }
83
+ ]
84
+ }}
85
+ ]
86
+ }
87
+ ];
88
+
89
+ return {
90
+ eztype: 'EzComponent',
91
+ cls: 'ez-docs-showcase-container',
92
+ layout: 'hbox',
93
+ items: [
94
+ { eztype: 'EzComponent', cls: 'ez-docs-showcase-panel', flex: 1, items: sections.map(section => ({ eztype: 'EzDocsShowcaseSection', props: { section } })) },
95
+ { eztype: 'EzDocsCodePanel' }
96
+ ]
97
+ };
98
+ }
99
+ });
@@ -0,0 +1,92 @@
1
+ ez.define('EzInputDoc', {
2
+ controller: 'EzDocs',
3
+ template() {
4
+ const sections = [
5
+ {
6
+ title: 'Basic Input',
7
+ variants: [
8
+ { label: 'Default', config: { eztype: 'EzInput', placeholder: 'Enter text...' } },
9
+ { label: 'With Value', config: { eztype: 'EzInput', placeholder: 'Name', value: 'John Doe' } }
10
+ ]
11
+ },
12
+ {
13
+ title: 'Input Types',
14
+ variants: [
15
+ { label: 'Text', config: { eztype: 'EzInput', inputType: 'text', placeholder: 'Text input' } },
16
+ { label: 'Password', config: { eztype: 'EzInput', inputType: 'password', placeholder: 'Password' } },
17
+ { label: 'Email', config: { eztype: 'EzInput', inputType: 'email', placeholder: 'email@example.com' } },
18
+ { label: 'Number', config: { eztype: 'EzInput', inputType: 'number', placeholder: '0' } }
19
+ ]
20
+ },
21
+ {
22
+ title: 'Sizes',
23
+ variants: [
24
+ { label: 'Small', config: { eztype: 'EzInput', size: 'sm', placeholder: 'Small input...' } },
25
+ { label: 'Default', config: { eztype: 'EzInput', placeholder: 'Default input...' } },
26
+ { label: 'Large', config: { eztype: 'EzInput', size: 'lg', placeholder: 'Large input...' } }
27
+ ]
28
+ },
29
+ {
30
+ title: 'Variants',
31
+ variants: [
32
+ { label: 'Default', config: { eztype: 'EzInput', placeholder: 'Default style...' } },
33
+ { label: 'Filled', config: { eztype: 'EzInput', variant: 'filled', placeholder: 'Filled style...' } },
34
+ { label: 'Underline', config: { eztype: 'EzInput', variant: 'underline', placeholder: 'Underline style...' } }
35
+ ]
36
+ },
37
+ {
38
+ title: 'With Icons',
39
+ variants: [
40
+ { label: 'User Icon', config: { eztype: 'EzInput', icon: 'user', placeholder: 'Username' } },
41
+ { label: 'Search Icon', config: { eztype: 'EzInput', icon: 'search', placeholder: 'Search...' } },
42
+ { label: 'Lock Icon', config: { eztype: 'EzInput', icon: 'lock', inputType: 'password', placeholder: 'Password' } },
43
+ { label: 'Email Icon', config: { eztype: 'EzInput', icon: 'envelope', placeholder: 'Email' } }
44
+ ]
45
+ },
46
+ {
47
+ title: 'Block Mode',
48
+ variants: [
49
+ { label: 'Block Input', config: { eztype: 'EzInput', block: true, placeholder: 'Full width input...' } }
50
+ ]
51
+ },
52
+ {
53
+ title: 'States',
54
+ variants: [
55
+ { label: 'Disabled', config: { eztype: 'EzInput', placeholder: 'Disabled', disabled: true } },
56
+ { label: 'Readonly', config: { eztype: 'EzInput', value: 'Read only value', readonly: true } }
57
+ ]
58
+ },
59
+ {
60
+ title: 'With onChange',
61
+ variants: [
62
+ {
63
+ label: 'Interactive',
64
+ config: {
65
+ eztype: 'EzInput',
66
+ placeholder: 'Type and see toast...',
67
+ onChange: (value) => {ez.toast.info(`Value: ${value}`)}
68
+ }
69
+ }
70
+ ]
71
+ }
72
+ ];
73
+
74
+ return {
75
+ eztype: 'EzComponent',
76
+ cls: 'ez-docs-showcase-container',
77
+ layout: 'hbox',
78
+ items: [
79
+ {
80
+ eztype: 'EzComponent',
81
+ cls: 'ez-docs-showcase-panel',
82
+ flex: 1,
83
+ items: sections.map(section => ({
84
+ eztype: 'EzDocsShowcaseSection',
85
+ props: { section }
86
+ }))
87
+ },
88
+ { eztype: 'EzDocsCodePanel' }
89
+ ]
90
+ };
91
+ }
92
+ });
@@ -0,0 +1,40 @@
1
+ ez.define('EzLabelDoc', {
2
+ controller: 'EzDocs',
3
+ template() {
4
+ const ctrl = ez.getControllerSync('EzDocs');
5
+ const sections = [
6
+ {
7
+ title: 'Basic Labels',
8
+ variants: [
9
+ { label: 'Simple Text', config: { eztype: 'EzLabel', text: 'Hello World' } },
10
+ { label: 'With Class', config: { eztype: 'EzLabel', text: 'Styled Label', cls: 'ez-docs-section-title' } }
11
+ ]
12
+ },
13
+ {
14
+ title: 'HTML Content',
15
+ variants: [
16
+ { label: 'Bold Text', config: { eztype: 'EzLabel', html: '<strong>Bold</strong> text' } },
17
+ { label: 'With Link', config: { eztype: 'EzLabel', html: 'Visit <a href="#">our site</a>' } }
18
+ ]
19
+ }
20
+ ];
21
+
22
+ return {
23
+ eztype: 'EzComponent',
24
+ cls: 'ez-docs-showcase-container',
25
+ layout: 'hbox',
26
+ items: [
27
+ {
28
+ eztype: 'EzComponent',
29
+ cls: 'ez-docs-showcase-panel',
30
+ flex: 1,
31
+ items: sections.map(section => ({
32
+ eztype: 'EzDocsShowcaseSection',
33
+ props: { section }
34
+ }))
35
+ },
36
+ { eztype: 'EzDocsCodePanel' }
37
+ ]
38
+ };
39
+ }
40
+ });
@@ -0,0 +1,53 @@
1
+ ez.define('EzModelDoc', {
2
+ template() {
3
+ return {
4
+ eztype: 'EzDocsContent',
5
+ props: {
6
+ componentName: 'EzModel',
7
+ docs: {
8
+ features: [
9
+ 'Type coercion (int, float, string, bool, date, array, object, any)',
10
+ 'Default values (static or function)',
11
+ 'Computed fields',
12
+ 'Primary key definition',
13
+ 'Validation with nullable constraints'
14
+ ],
15
+ usage: `ez.defineModel('UserModel', {
16
+ fields: [
17
+ { name: 'id', type: 'int', primaryKey: true },
18
+ { name: 'name', type: 'string' },
19
+ { name: 'age', type: 'int', default: 0 },
20
+ { name: 'email', type: 'string' },
21
+ { name: 'created_at', type: 'date' },
22
+ {
23
+ name: 'displayName',
24
+ type: 'string',
25
+ compute: (record) => \`\${record.name} (\${record.age})\`
26
+ }
27
+ ]
28
+ });
29
+
30
+ // Use in EzGrid
31
+ {
32
+ eztype: 'EzGrid',
33
+ model: 'UserModel',
34
+ columns: [...],
35
+ data: [
36
+ { id: '1', name: 'John', age: '25' }
37
+ // Automatically processed to:
38
+ // { id: 1, name: 'John', age: 25, displayName: 'John (25)' }
39
+ ]
40
+ }`,
41
+ api: [
42
+ { method: 'ez.defineModel(name, definition)', description: 'Define a new model' },
43
+ { method: 'ez.getModel(name)', description: 'Get model by name (returns null if not found)' },
44
+ { method: 'ez.getModelSync(name)', description: 'Get model synchronously (throws if not found)' },
45
+ { method: 'model.process(record)', description: 'Process a single record through the model' },
46
+ { method: 'model.processAll(records)', description: 'Process an array of records' },
47
+ { method: 'model.validate(record)', description: 'Validate a record against the schema' }
48
+ ]
49
+ }
50
+ }
51
+ };
52
+ }
53
+ });
@@ -0,0 +1,63 @@
1
+ ez.define('EzOutletDoc', {
2
+ template() {
3
+ return {
4
+ eztype: 'EzDocsContent',
5
+ props: {
6
+ componentName: 'EzOutlet',
7
+ docs: {
8
+ features: [
9
+ 'Dynamic view loading and unloading',
10
+ 'Route parameter passing to views',
11
+ 'Smart view reuse (avoids unnecessary re-renders)',
12
+ 'Route chain propagation for nested outlets',
13
+ 'View lifecycle management (create/destroy)',
14
+ 'Template and controller-based view support',
15
+ 'Stretch mode for full height layouts'
16
+ ],
17
+ usage: `// Basic outlet
18
+ {
19
+ eztype: 'EzOutlet',
20
+ name: 'main'
21
+ }
22
+
23
+ // Stretched outlet (fills available space)
24
+ {
25
+ eztype: 'EzOutlet',
26
+ name: 'content',
27
+ stretch: true
28
+ }
29
+
30
+ // Register outlet as ref for programmatic access
31
+ {
32
+ eztype: 'EzOutlet',
33
+ name: 'detail',
34
+ ref: 'detailOutlet'
35
+ }
36
+
37
+ // Open view programmatically
38
+ const outlet = ez._refs.detailOutlet;
39
+ await outlet.open('UserDetail', { userId: 123 });
40
+
41
+ // Close current view
42
+ outlet.close();
43
+
44
+ // Check current state
45
+ outlet.getCurrentView(); // 'UserDetail'
46
+ outlet.getCurrentParams(); // { userId: 123 }
47
+ outlet.isOpen(); // true`,
48
+ api: [
49
+ { method: 'name', description: 'Outlet identifier (for debugging)' },
50
+ { method: 'stretch', description: 'Fill available vertical space (flex: 1)' },
51
+ { method: 'ref', description: 'Register as ez._refs[name] for access' },
52
+ { method: 'open(view, params, chain)', description: 'Open a view with parameters' },
53
+ { method: 'close()', description: 'Close current view' },
54
+ { method: 'getCurrentView()', description: 'Get name of current view' },
55
+ { method: 'getCurrentParams()', description: 'Get current route parameters' },
56
+ { method: 'isOpen()', description: 'Check if a view is open' },
57
+ { method: 'getInstance()', description: 'Get current view component instance' }
58
+ ]
59
+ }
60
+ }
61
+ };
62
+ }
63
+ });