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,67 @@
|
|
|
1
|
+
ez.define('EzCheckboxDoc', {
|
|
2
|
+
controller: 'EzDocs',
|
|
3
|
+
template() {
|
|
4
|
+
const sections = [
|
|
5
|
+
{
|
|
6
|
+
title: 'Basic',
|
|
7
|
+
variants: [
|
|
8
|
+
{ label: 'Unchecked', config: { eztype: 'EzCheckbox' } },
|
|
9
|
+
{ label: 'Checked', config: { eztype: 'EzCheckbox', value: true } }
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
title: 'With Label',
|
|
14
|
+
variants: [
|
|
15
|
+
{ label: 'Label Right', config: { eztype: 'EzCheckbox', label: 'Accept terms and conditions' } },
|
|
16
|
+
{ label: 'Checked with Label', config: { eztype: 'EzCheckbox', label: 'Remember me', value: true } }
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
title: 'Sizes',
|
|
21
|
+
variants: [
|
|
22
|
+
{ label: 'Small', config: { eztype: 'EzCheckbox', label: 'Small checkbox', size: 'sm' } },
|
|
23
|
+
{ label: 'Default', config: { eztype: 'EzCheckbox', label: 'Default checkbox' } },
|
|
24
|
+
{ label: 'Large', config: { eztype: 'EzCheckbox', label: 'Large checkbox', size: 'lg' } }
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
title: 'States',
|
|
29
|
+
variants: [
|
|
30
|
+
{ label: 'Disabled Unchecked', config: { eztype: 'EzCheckbox', label: 'Disabled', disabled: true } },
|
|
31
|
+
{ label: 'Disabled Checked', config: { eztype: 'EzCheckbox', label: 'Disabled checked', value: true, disabled: true } }
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: 'With onChange',
|
|
36
|
+
variants: [
|
|
37
|
+
{
|
|
38
|
+
label: 'Interactive',
|
|
39
|
+
config: {
|
|
40
|
+
eztype: 'EzCheckbox',
|
|
41
|
+
label: 'Toggle me',
|
|
42
|
+
onChange: (checked) => ez.toast.info(`Checkbox is now ${checked ? 'checked' : 'unchecked'}`)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
eztype: 'EzComponent',
|
|
51
|
+
cls: 'ez-docs-showcase-container',
|
|
52
|
+
layout: 'hbox',
|
|
53
|
+
items: [
|
|
54
|
+
{
|
|
55
|
+
eztype: 'EzComponent',
|
|
56
|
+
cls: 'ez-docs-showcase-panel',
|
|
57
|
+
flex: 1,
|
|
58
|
+
items: sections.map(section => ({
|
|
59
|
+
eztype: 'EzDocsShowcaseSection',
|
|
60
|
+
props: { section }
|
|
61
|
+
}))
|
|
62
|
+
},
|
|
63
|
+
{ eztype: 'EzDocsCodePanel' }
|
|
64
|
+
]
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
ez.define('EzComponentDoc', {
|
|
2
|
+
controller: 'EzDocs',
|
|
3
|
+
template() {
|
|
4
|
+
const ctrl = ez.getControllerSync('EzDocs');
|
|
5
|
+
const sections = [
|
|
6
|
+
{
|
|
7
|
+
title: 'Layouts',
|
|
8
|
+
variants: [
|
|
9
|
+
{ label: 'Horizontal (hbox)', config: { eztype: 'EzComponent', layout: 'hbox', style: { gap: '8px', padding: '8px', background: '#f1f5f9', borderRadius: '4px' }, items: [{ eztype: 'EzButton', text: 'Left' }, { eztype: 'EzButton', text: 'Center' }, { eztype: 'EzButton', text: 'Right' }] } },
|
|
10
|
+
{ label: 'Vertical (vbox)', config: { eztype: 'EzComponent', layout: 'vbox', style: { gap: '8px', padding: '8px', background: '#f1f5f9', borderRadius: '4px' }, items: [{ eztype: 'EzButton', text: 'Top' }, { eztype: 'EzButton', text: 'Bottom' }] } }
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
title: 'With Flex',
|
|
15
|
+
variants: [
|
|
16
|
+
{ label: 'Flex Items', config: { eztype: 'EzComponent', layout: 'hbox', style: { gap: '8px', padding: '8px', background: '#f1f5f9', borderRadius: '4px' }, items: [
|
|
17
|
+
{ eztype: 'EzComponent', flex: 1, style: { background: '#dbeafe', padding: '12px', borderRadius: '4px' }, items: [{ eztype: 'EzLabel', text: 'flex: 1' }] },
|
|
18
|
+
{ eztype: 'EzComponent', flex: 2, style: { background: '#bfdbfe', padding: '12px', borderRadius: '4px' }, items: [{ eztype: 'EzLabel', text: 'flex: 2' }] }
|
|
19
|
+
]}}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
eztype: 'EzComponent',
|
|
26
|
+
cls: 'ez-docs-showcase-container',
|
|
27
|
+
layout: 'hbox',
|
|
28
|
+
items: [
|
|
29
|
+
{ eztype: 'EzComponent', cls: 'ez-docs-showcase-panel', flex: 1, items: sections.map(section => ({ eztype: 'EzDocsShowcaseSection', props: { section } })) },
|
|
30
|
+
{ eztype: 'EzDocsCodePanel' }
|
|
31
|
+
]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
ez.define('CSSModulesDoc', {
|
|
2
|
+
template() {
|
|
3
|
+
return {
|
|
4
|
+
eztype: 'EzDocsContent',
|
|
5
|
+
props: {
|
|
6
|
+
componentName: 'CSSModules',
|
|
7
|
+
docs: {
|
|
8
|
+
features: [
|
|
9
|
+
'Automatic class name scoping with unique hashes',
|
|
10
|
+
'No global namespace pollution',
|
|
11
|
+
'Vite native support (.module.scss files)',
|
|
12
|
+
'cx() utility for class name resolution',
|
|
13
|
+
'Support for conditional and multiple classes',
|
|
14
|
+
'Seamless integration with global classes (FontAwesome, theme variables)'
|
|
15
|
+
],
|
|
16
|
+
usage: `// 1. Create a CSS Module file
|
|
17
|
+
// EzComponent.module.scss
|
|
18
|
+
.root {
|
|
19
|
+
background: var(--ez-surface-primary);
|
|
20
|
+
padding: 16px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.title {
|
|
24
|
+
font-size: 18px;
|
|
25
|
+
font-weight: 600;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.active {
|
|
29
|
+
border-color: var(--ez-primary);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// 2. Import and use in component
|
|
33
|
+
import styles from './EzComponent.module.scss';
|
|
34
|
+
import { cx } from '../../utils/cssModules.js';
|
|
35
|
+
|
|
36
|
+
const cls = cx(styles);
|
|
37
|
+
|
|
38
|
+
export class EzComponent extends EzBaseComponent {
|
|
39
|
+
render() {
|
|
40
|
+
const el = document.createElement('div');
|
|
41
|
+
|
|
42
|
+
// Single class
|
|
43
|
+
el.classList.add(cls('root'));
|
|
44
|
+
|
|
45
|
+
// Multiple classes
|
|
46
|
+
el.className = cls('root', 'title');
|
|
47
|
+
|
|
48
|
+
// Conditional class
|
|
49
|
+
if (this.config.active) {
|
|
50
|
+
el.classList.add(cls('active'));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Mix with global classes (FontAwesome)
|
|
54
|
+
icon.className = cls('iconWrapper', 'fa-solid fa-check');
|
|
55
|
+
|
|
56
|
+
return el;
|
|
57
|
+
}
|
|
58
|
+
}`,
|
|
59
|
+
api: [
|
|
60
|
+
{ method: 'cx(styles)', description: 'Create a class resolver bound to a CSS Module styles object' },
|
|
61
|
+
{ method: 'cls(name)', description: 'Resolve a single class name from the module' },
|
|
62
|
+
{ method: 'cls(name1, name2, ...)', description: 'Resolve multiple class names, returns space-separated string' },
|
|
63
|
+
{ method: 'cls(name, condition && other)', description: 'Conditional classes - falsy values are ignored' },
|
|
64
|
+
{ method: 'cls(scoped, "global-class")', description: 'Mix scoped and global classes - unmatched names pass through' }
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
});
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
ez.define('EzDatePickerDoc', {
|
|
2
|
+
controller: 'EzDocs',
|
|
3
|
+
template() {
|
|
4
|
+
const sections = [
|
|
5
|
+
{
|
|
6
|
+
title: 'Basic',
|
|
7
|
+
variants: [
|
|
8
|
+
{ label: 'Default', config: { eztype: 'EzDatePicker', placeholder: 'Select date...' } },
|
|
9
|
+
{ label: 'With Value', config: { eztype: 'EzDatePicker', value: '2025-01-15' } }
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
title: 'Date Range',
|
|
14
|
+
variants: [
|
|
15
|
+
{ label: 'Range Picker', config: { eztype: 'EzDatePicker', range: true, placeholder: 'Select date range...' } },
|
|
16
|
+
{
|
|
17
|
+
label: 'With Range Value',
|
|
18
|
+
config: {
|
|
19
|
+
eztype: 'EzDatePicker',
|
|
20
|
+
range: true,
|
|
21
|
+
startDate: '2025-01-01',
|
|
22
|
+
endDate: '2025-01-31'
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
title: 'With Constraints',
|
|
29
|
+
variants: [
|
|
30
|
+
{
|
|
31
|
+
label: 'Min Date',
|
|
32
|
+
config: {
|
|
33
|
+
eztype: 'EzDatePicker',
|
|
34
|
+
min: '2025-01-01',
|
|
35
|
+
placeholder: 'Only 2025 onwards...'
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: 'Max Date',
|
|
40
|
+
config: {
|
|
41
|
+
eztype: 'EzDatePicker',
|
|
42
|
+
max: '2025-12-31',
|
|
43
|
+
placeholder: 'Only until end of 2025...'
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: 'Min & Max',
|
|
48
|
+
config: {
|
|
49
|
+
eztype: 'EzDatePicker',
|
|
50
|
+
min: '2025-01-01',
|
|
51
|
+
max: '2025-03-31',
|
|
52
|
+
placeholder: 'Q1 2025 only...'
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
title: 'Custom Format',
|
|
59
|
+
variants: [
|
|
60
|
+
{
|
|
61
|
+
label: 'DD/MM/YYYY Display',
|
|
62
|
+
config: {
|
|
63
|
+
eztype: 'EzDatePicker',
|
|
64
|
+
displayFormat: 'DD/MM/YYYY',
|
|
65
|
+
value: '2025-12-25'
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: 'Long Format',
|
|
70
|
+
config: {
|
|
71
|
+
eztype: 'EzDatePicker',
|
|
72
|
+
displayFormat: 'dddd, MMMM D, YYYY',
|
|
73
|
+
value: '2025-12-25'
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
title: 'Sizes',
|
|
80
|
+
variants: [
|
|
81
|
+
{ label: 'Small', config: { eztype: 'EzDatePicker', size: 'sm', placeholder: 'Small...' } },
|
|
82
|
+
{ label: 'Default', config: { eztype: 'EzDatePicker', placeholder: 'Default...' } },
|
|
83
|
+
{ label: 'Large', config: { eztype: 'EzDatePicker', size: 'lg', placeholder: 'Large...' } }
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
title: 'States',
|
|
88
|
+
variants: [
|
|
89
|
+
{ label: 'Disabled', config: { eztype: 'EzDatePicker', disabled: true, placeholder: 'Disabled...' } },
|
|
90
|
+
{ label: 'Disabled with Value', config: { eztype: 'EzDatePicker', disabled: true, value: '2025-06-15' } }
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
title: 'With onChange',
|
|
95
|
+
variants: [
|
|
96
|
+
{
|
|
97
|
+
label: 'Interactive',
|
|
98
|
+
config: {
|
|
99
|
+
eztype: 'EzDatePicker',
|
|
100
|
+
placeholder: 'Select and see toast...',
|
|
101
|
+
onChange: (value) => ez.toast.info(`Selected: ${value}`)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
];
|
|
107
|
+
|
|
108
|
+
return {
|
|
109
|
+
eztype: 'EzComponent',
|
|
110
|
+
cls: 'ez-docs-showcase-container',
|
|
111
|
+
layout: 'hbox',
|
|
112
|
+
items: [
|
|
113
|
+
{
|
|
114
|
+
eztype: 'EzComponent',
|
|
115
|
+
cls: 'ez-docs-showcase-panel',
|
|
116
|
+
flex: 1,
|
|
117
|
+
items: sections.map(section => ({
|
|
118
|
+
eztype: 'EzDocsShowcaseSection',
|
|
119
|
+
props: { section }
|
|
120
|
+
}))
|
|
121
|
+
},
|
|
122
|
+
{ eztype: 'EzDocsCodePanel' }
|
|
123
|
+
]
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
});
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
ez.define('EzDialogDoc', {
|
|
2
|
+
controller: 'EzDocs',
|
|
3
|
+
template() {
|
|
4
|
+
const sections = [
|
|
5
|
+
{
|
|
6
|
+
title: 'Sizes',
|
|
7
|
+
variants: [
|
|
8
|
+
{
|
|
9
|
+
label: 'Small',
|
|
10
|
+
config: {
|
|
11
|
+
eztype: 'EzButton',
|
|
12
|
+
text: 'Open Small Dialog',
|
|
13
|
+
onClick: () => ez.dialog.open({
|
|
14
|
+
title: 'Small Dialog',
|
|
15
|
+
size: 'sm',
|
|
16
|
+
message: 'This is a small dialog for simple confirmations.',
|
|
17
|
+
buttons: [{ text: 'OK', variant: 'primary' }]
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: 'Medium',
|
|
23
|
+
config: {
|
|
24
|
+
eztype: 'EzButton',
|
|
25
|
+
text: 'Open Medium Dialog',
|
|
26
|
+
onClick: () => ez.dialog.open({
|
|
27
|
+
title: 'Medium Dialog',
|
|
28
|
+
size: 'md',
|
|
29
|
+
message: 'This is a medium-sized dialog, the default size.',
|
|
30
|
+
buttons: [{ text: 'Cancel' }, { text: 'OK', variant: 'primary' }]
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: 'Large',
|
|
36
|
+
config: {
|
|
37
|
+
eztype: 'EzButton',
|
|
38
|
+
text: 'Open Large Dialog',
|
|
39
|
+
onClick: () => ez.dialog.open({
|
|
40
|
+
title: 'Large Dialog',
|
|
41
|
+
size: 'lg',
|
|
42
|
+
message: 'This is a large dialog for complex content.',
|
|
43
|
+
buttons: [{ text: 'Close' }]
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
title: 'With Icons',
|
|
51
|
+
variants: [
|
|
52
|
+
{
|
|
53
|
+
label: 'Success Icon',
|
|
54
|
+
config: {
|
|
55
|
+
eztype: 'EzButton',
|
|
56
|
+
text: 'Success Dialog',
|
|
57
|
+
variant: 'success',
|
|
58
|
+
onClick: () => ez.dialog.open({
|
|
59
|
+
title: 'Success!',
|
|
60
|
+
icon: 'fa-solid fa-check-circle',
|
|
61
|
+
iconVariant: 'success',
|
|
62
|
+
message: 'Operation completed successfully.',
|
|
63
|
+
buttons: [{ text: 'OK', variant: 'success' }]
|
|
64
|
+
})
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
label: 'Warning Icon',
|
|
69
|
+
config: {
|
|
70
|
+
eztype: 'EzButton',
|
|
71
|
+
text: 'Warning Dialog',
|
|
72
|
+
variant: 'warning',
|
|
73
|
+
onClick: () => ez.dialog.open({
|
|
74
|
+
title: 'Warning',
|
|
75
|
+
icon: 'fa-solid fa-exclamation-triangle',
|
|
76
|
+
iconVariant: 'warning',
|
|
77
|
+
message: 'Are you sure you want to proceed?',
|
|
78
|
+
buttons: [{ text: 'Cancel' }, { text: 'Proceed', variant: 'warning' }]
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: 'Danger Icon',
|
|
84
|
+
config: {
|
|
85
|
+
eztype: 'EzButton',
|
|
86
|
+
text: 'Danger Dialog',
|
|
87
|
+
variant: 'danger',
|
|
88
|
+
onClick: () => ez.dialog.open({
|
|
89
|
+
title: 'Delete Item',
|
|
90
|
+
icon: 'fa-solid fa-trash',
|
|
91
|
+
iconVariant: 'danger',
|
|
92
|
+
message: 'This action cannot be undone. Are you sure?',
|
|
93
|
+
buttons: [{ text: 'Cancel' }, { text: 'Delete', variant: 'danger' }]
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
label: 'Info Icon',
|
|
99
|
+
config: {
|
|
100
|
+
eztype: 'EzButton',
|
|
101
|
+
text: 'Info Dialog',
|
|
102
|
+
variant: 'primary',
|
|
103
|
+
onClick: () => ez.dialog.open({
|
|
104
|
+
title: 'Information',
|
|
105
|
+
icon: 'fa-solid fa-info-circle',
|
|
106
|
+
iconVariant: 'primary',
|
|
107
|
+
message: 'Here is some important information for you.',
|
|
108
|
+
buttons: [{ text: 'Got it', variant: 'primary' }]
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
title: 'With Form Content',
|
|
116
|
+
variants: [
|
|
117
|
+
{
|
|
118
|
+
label: 'Form Dialog',
|
|
119
|
+
config: {
|
|
120
|
+
eztype: 'EzButton',
|
|
121
|
+
text: 'Open Form Dialog',
|
|
122
|
+
variant: 'primary',
|
|
123
|
+
onClick: () => ez.dialog.open({
|
|
124
|
+
title: 'Create New User',
|
|
125
|
+
size: 'md',
|
|
126
|
+
items: [
|
|
127
|
+
{ eztype: 'EzInput', placeholder: 'First Name', icon: 'user' },
|
|
128
|
+
{ eztype: 'EzInput', placeholder: 'Last Name', icon: 'user' },
|
|
129
|
+
{ eztype: 'EzInput', placeholder: 'Email', icon: 'envelope', inputType: 'email' }
|
|
130
|
+
],
|
|
131
|
+
buttons: [{ text: 'Cancel' }, { text: 'Create', variant: 'primary' }]
|
|
132
|
+
})
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
title: 'Maximizable',
|
|
139
|
+
variants: [
|
|
140
|
+
{
|
|
141
|
+
label: 'Maximizable Dialog',
|
|
142
|
+
config: {
|
|
143
|
+
eztype: 'EzButton',
|
|
144
|
+
text: 'Open Maximizable',
|
|
145
|
+
onClick: () => ez.dialog.open({
|
|
146
|
+
title: 'Maximizable Dialog',
|
|
147
|
+
maximizable: true,
|
|
148
|
+
message: 'Click the expand button in the header to maximize this dialog.',
|
|
149
|
+
buttons: [{ text: 'Close' }]
|
|
150
|
+
})
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
title: 'Non-closable',
|
|
157
|
+
variants: [
|
|
158
|
+
{
|
|
159
|
+
label: 'No X Button',
|
|
160
|
+
config: {
|
|
161
|
+
eztype: 'EzButton',
|
|
162
|
+
text: 'Open Non-closable',
|
|
163
|
+
onClick: () => ez.dialog.open({
|
|
164
|
+
title: 'Confirmation Required',
|
|
165
|
+
closable: false,
|
|
166
|
+
message: 'You must choose an option to continue.',
|
|
167
|
+
buttons: [{ text: 'Decline', variant: 'danger' }, { text: 'Accept', variant: 'primary' }]
|
|
168
|
+
})
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
title: 'Async Loading',
|
|
175
|
+
variants: [
|
|
176
|
+
{
|
|
177
|
+
label: 'With onLoad',
|
|
178
|
+
config: {
|
|
179
|
+
eztype: 'EzButton',
|
|
180
|
+
text: 'Open Async Dialog',
|
|
181
|
+
variant: 'primary',
|
|
182
|
+
onClick: () => ez.dialog.open({
|
|
183
|
+
title: 'Loading Data...',
|
|
184
|
+
onLoad: async () => {
|
|
185
|
+
await new Promise(resolve => setTimeout(resolve, 1500));
|
|
186
|
+
},
|
|
187
|
+
items: [
|
|
188
|
+
{ eztype: 'p', text: 'Data loaded successfully!' },
|
|
189
|
+
{ eztype: 'EzInput', placeholder: 'Loaded field', value: 'Pre-filled value' }
|
|
190
|
+
],
|
|
191
|
+
buttons: [{ text: 'Close' }]
|
|
192
|
+
})
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
];
|
|
198
|
+
|
|
199
|
+
return {
|
|
200
|
+
eztype: 'EzComponent',
|
|
201
|
+
cls: 'ez-docs-showcase-container',
|
|
202
|
+
layout: 'hbox',
|
|
203
|
+
items: [
|
|
204
|
+
{
|
|
205
|
+
eztype: 'EzComponent',
|
|
206
|
+
cls: 'ez-docs-showcase-panel',
|
|
207
|
+
flex: 1,
|
|
208
|
+
items: sections.map(section => ({
|
|
209
|
+
eztype: 'EzDocsShowcaseSection',
|
|
210
|
+
props: { section }
|
|
211
|
+
}))
|
|
212
|
+
},
|
|
213
|
+
{ eztype: 'EzDocsCodePanel' }
|
|
214
|
+
]
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
});
|