@qwickapps/react-framework 1.3.5 → 1.4.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/README.md +1681 -2
- package/dist/__tests__/schemas/transformers/MockSerializableComponent.d.ts +66 -0
- package/dist/__tests__/schemas/transformers/MockSerializableComponent.d.ts.map +1 -0
- package/dist/components/ErrorBoundary.d.ts +7 -0
- package/dist/components/ErrorBoundary.d.ts.map +1 -1
- package/dist/components/Html.d.ts +28 -18
- package/dist/components/Html.d.ts.map +1 -1
- package/dist/components/Logo.d.ts +12 -35
- package/dist/components/Logo.d.ts.map +1 -1
- package/dist/components/Markdown.d.ts +18 -13
- package/dist/components/Markdown.d.ts.map +1 -1
- package/dist/components/QwickApp.d.ts +16 -3
- package/dist/components/QwickApp.d.ts.map +1 -1
- package/dist/components/QwickIcon.d.ts +23 -0
- package/dist/components/QwickIcon.d.ts.map +1 -0
- package/dist/components/SafeSpan.d.ts +12 -5
- package/dist/components/SafeSpan.d.ts.map +1 -1
- package/dist/components/Scaffold.d.ts.map +1 -1
- package/dist/components/base/ModelView.d.ts +101 -0
- package/dist/components/base/ModelView.d.ts.map +1 -0
- package/dist/components/base/index.d.ts +11 -0
- package/dist/components/base/index.d.ts.map +1 -0
- package/dist/components/blocks/Article.d.ts +12 -2
- package/dist/components/blocks/Article.d.ts.map +1 -1
- package/dist/components/blocks/Code.d.ts +13 -2
- package/dist/components/blocks/Code.d.ts.map +1 -1
- package/dist/components/blocks/CoverImageHeader.d.ts.map +1 -1
- package/dist/components/blocks/FeatureCard.d.ts.map +1 -1
- package/dist/components/blocks/FeatureGrid.d.ts.map +1 -1
- package/dist/components/blocks/Footer.d.ts.map +1 -1
- package/dist/components/blocks/HeroBlock.d.ts +27 -13
- package/dist/components/blocks/HeroBlock.d.ts.map +1 -1
- package/dist/components/blocks/Image.d.ts +41 -0
- package/dist/components/blocks/Image.d.ts.map +1 -0
- package/dist/components/blocks/PageBannerHeader.d.ts.map +1 -1
- package/dist/components/blocks/Section.d.ts +16 -2
- package/dist/components/blocks/Section.d.ts.map +1 -1
- package/dist/components/blocks/Text.d.ts +41 -0
- package/dist/components/blocks/Text.d.ts.map +1 -0
- package/dist/components/blocks/index.d.ts +4 -0
- package/dist/components/blocks/index.d.ts.map +1 -1
- package/dist/components/buttons/Button.d.ts +23 -7
- package/dist/components/buttons/Button.d.ts.map +1 -1
- package/dist/components/forms/FormBlock.d.ts +19 -13
- package/dist/components/forms/FormBlock.d.ts.map +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/input/ChoiceInputField.d.ts +17 -11
- package/dist/components/input/ChoiceInputField.d.ts.map +1 -1
- package/dist/components/input/HtmlInputField.d.ts +17 -11
- package/dist/components/input/HtmlInputField.d.ts.map +1 -1
- package/dist/components/input/SelectInputField.d.ts +16 -10
- package/dist/components/input/SelectInputField.d.ts.map +1 -1
- package/dist/components/input/SwitchInputField.d.ts +16 -10
- package/dist/components/input/SwitchInputField.d.ts.map +1 -1
- package/dist/components/input/TextField.d.ts.map +1 -1
- package/dist/components/input/TextInputField.d.ts +16 -11
- package/dist/components/input/TextInputField.d.ts.map +1 -1
- package/dist/components/layout/GridCell.d.ts +23 -6
- package/dist/components/layout/GridCell.d.ts.map +1 -1
- package/dist/components/layout/GridLayout.d.ts +24 -23
- package/dist/components/layout/GridLayout.d.ts.map +1 -1
- package/dist/components/pages/FormPage.d.ts.map +1 -1
- package/dist/components/pages/Page.d.ts +49 -87
- package/dist/components/pages/Page.d.ts.map +1 -1
- package/dist/components/pages/index.d.ts +2 -2
- package/dist/components/pages/index.d.ts.map +1 -1
- package/dist/config/AppConfig.d.ts +49 -0
- package/dist/config/AppConfig.d.ts.map +1 -0
- package/dist/config/AppConfigBuilder.d.ts +75 -0
- package/dist/config/AppConfigBuilder.d.ts.map +1 -0
- package/dist/config/index.d.ts +13 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/types.d.ts +130 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config.d.ts +15 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.esm.js +451 -0
- package/dist/config.js +455 -0
- package/dist/contexts/PrintModeContext.d.ts +27 -0
- package/dist/contexts/PrintModeContext.d.ts.map +1 -0
- package/dist/contexts/QwickAppContext.d.ts +2 -2
- package/dist/contexts/QwickAppContext.d.ts.map +1 -1
- package/dist/contexts/index.d.ts +2 -0
- package/dist/contexts/index.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/usePrintMode.d.ts +39 -0
- package/dist/hooks/usePrintMode.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +10951 -6238
- package/dist/index.js +11014 -6287
- package/dist/schemas/CodeSchema.d.ts +2 -1
- package/dist/schemas/CodeSchema.d.ts.map +1 -1
- package/dist/schemas/CollapsibleLayoutSchema.d.ts +2 -1
- package/dist/schemas/CollapsibleLayoutSchema.d.ts.map +1 -1
- package/dist/schemas/ContentSchema.d.ts +2 -1
- package/dist/schemas/ContentSchema.d.ts.map +1 -1
- package/dist/schemas/GridCellSchema.d.ts +25 -0
- package/dist/schemas/GridCellSchema.d.ts.map +1 -0
- package/dist/schemas/GridLayoutSchema.d.ts +23 -0
- package/dist/schemas/GridLayoutSchema.d.ts.map +1 -0
- package/dist/schemas/HtmlSchema.d.ts +14 -0
- package/dist/schemas/HtmlSchema.d.ts.map +1 -0
- package/dist/schemas/ImageSchema.d.ts +32 -0
- package/dist/schemas/ImageSchema.d.ts.map +1 -0
- package/dist/schemas/LogoSchema.d.ts +35 -0
- package/dist/schemas/LogoSchema.d.ts.map +1 -0
- package/dist/schemas/MarkdownSchema.d.ts +14 -0
- package/dist/schemas/MarkdownSchema.d.ts.map +1 -0
- package/dist/schemas/PageTemplateSchema.d.ts +31 -0
- package/dist/schemas/PageTemplateSchema.d.ts.map +1 -0
- package/dist/schemas/PrintConfigSchema.d.ts +31 -0
- package/dist/schemas/PrintConfigSchema.d.ts.map +1 -0
- package/dist/schemas/SectionSchema.d.ts +2 -1
- package/dist/schemas/SectionSchema.d.ts.map +1 -1
- package/dist/schemas/TextSchema.d.ts +37 -0
- package/dist/schemas/TextSchema.d.ts.map +1 -0
- package/dist/schemas/ViewModelSchema.d.ts +23 -0
- package/dist/schemas/ViewModelSchema.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +15 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/transformers/ComponentTransformer.d.ts +116 -0
- package/dist/schemas/transformers/ComponentTransformer.d.ts.map +1 -0
- package/dist/schemas/transformers/ReactNodeTransformer.d.ts +53 -0
- package/dist/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -0
- package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts +66 -0
- package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts.map +1 -0
- package/dist/schemas/transformers/registry.d.ts +15 -0
- package/dist/schemas/transformers/registry.d.ts.map +1 -0
- package/dist/schemas/types/Serializable.d.ts +46 -0
- package/dist/schemas/types/Serializable.d.ts.map +1 -0
- package/dist/utils/htmlTransform.d.ts.map +1 -1
- package/dist/utils/reactUtils.d.ts +12 -3
- package/dist/utils/reactUtils.d.ts.map +1 -1
- package/package.json +17 -3
- package/src/{components/__tests__ → __tests__/components}/AccessibilityProvider.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Article.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Breadcrumbs.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Button.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/CardListGrid.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/ChoiceInputField.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Code.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Content.integration.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Content.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/CoverImageHeader.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/ErrorBoundary.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/FeatureCard.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/FeatureGrid.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/FeatureGrid.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/Footer.test.tsx +4 -4
- package/src/{components/__tests__ → __tests__/components}/FormBlock.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/HeroBlock.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/HeroBlock.test.tsx +233 -7
- package/src/{components/__tests__ → __tests__/components}/Html.test.tsx +11 -2
- package/src/{components/__tests__ → __tests__/components}/HtmlInputField.test.tsx +3 -3
- package/src/__tests__/components/Logo.test.js +3 -3
- package/src/{components/__tests__ → __tests__/components}/Markdown.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/PageBannerHeader.test.tsx +3 -3
- package/src/{components/__tests__ → __tests__/components}/PaletteSwitcher.test.tsx +3 -3
- package/src/{components/__tests__ → __tests__/components}/ProductCard.test.tsx +4 -4
- package/src/{components/__tests__ → __tests__/components}/SafeSpan.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/SafeSpan.simple.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/SafeSpan.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Section.integration.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Section.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/SelectInputField.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/TextInputField.test.tsx +3 -3
- package/src/{components/__tests__ → __tests__/components}/ThemeSwitcher.test.tsx +3 -3
- package/src/__tests__/components/base/ModelView.test.tsx +220 -0
- package/src/__tests__/components/blocks/Code.performance.test.tsx +625 -0
- package/src/__tests__/components/blocks/Code.serialization.test.tsx +507 -0
- package/src/__tests__/components/blocks/HeroBlock.serialization.test.tsx +414 -0
- package/src/__tests__/components/blocks/Image.serialization.test.tsx +257 -0
- package/src/__tests__/components/blocks/Section.serialization.test.tsx +553 -0
- package/src/__tests__/components/blocks/Text.performance.test.tsx +442 -0
- package/src/__tests__/components/blocks/Text.serialization.test.tsx +491 -0
- package/src/__tests__/components/buttons/Button.serialization.test.tsx +443 -0
- package/src/__tests__/components/input/FormComponents.serialization.test.tsx +482 -0
- package/src/__tests__/components/input/SelectInputField.serialization.test.tsx +439 -0
- package/src/__tests__/components/input/TextInputField.serialization.test.tsx +359 -0
- package/src/{components/layout/CollapsibleLayout/__tests__ → __tests__/components/layout}/CollapsibleLayout.test.tsx +4 -4
- package/src/__tests__/components/layout/GridCell.serialization.test.tsx +403 -0
- package/src/__tests__/components/layout/GridLayout.serialization.test.tsx +311 -0
- package/src/__tests__/hooks/usePrintMode.test.ts +89 -0
- package/src/__tests__/schemas/PageTemplateSchema.test.ts +161 -0
- package/src/__tests__/schemas/PrintConfigSchema.test.ts +127 -0
- package/src/__tests__/schemas/ViewModelSchema.test.ts +80 -0
- package/src/__tests__/schemas/transformers/ComponentSerializationPatterns.test.tsx +602 -0
- package/src/__tests__/schemas/transformers/ComponentTransformer.htmlPatterns.test.ts +301 -0
- package/src/__tests__/schemas/transformers/ComponentTransformer.test.ts +521 -0
- package/src/__tests__/schemas/transformers/CrossBrowserCompatibility.test.ts +586 -0
- package/src/__tests__/schemas/transformers/MockSerializableComponent.ts +103 -0
- package/src/__tests__/schemas/transformers/RealWorldScenarios.test.tsx +1165 -0
- package/src/__tests__/schemas/transformers/SerializationErrorHandling.test.ts +602 -0
- package/src/__tests__/schemas/transformers/SerializationIntegration.test.tsx +691 -0
- package/src/__tests__/schemas/transformers/SerializationPerformance.test.ts +460 -0
- package/src/__tests__/schemas/transformers/TestAutomation.test.ts +597 -0
- package/src/{utils/__tests__ → __tests__/utils}/nested-dom-fix.test.tsx +1 -1
- package/src/components/ErrorBoundary.tsx +8 -8
- package/src/components/Html.tsx +147 -44
- package/src/components/Logo.tsx +198 -100
- package/src/components/Markdown.tsx +125 -16
- package/src/components/QwickApp.tsx +64 -31
- package/src/components/QwickIcon.tsx +59 -0
- package/src/components/SafeSpan.tsx +65 -10
- package/src/components/Scaffold.tsx +2 -8
- package/src/components/base/ModelView.tsx +199 -0
- package/src/components/base/index.ts +11 -0
- package/src/components/blocks/Article.tsx +57 -18
- package/src/components/blocks/Code.md +529 -0
- package/src/components/blocks/Code.tsx +102 -15
- package/src/components/blocks/CoverImageHeader.tsx +9 -4
- package/src/components/blocks/FeatureCard.tsx +1 -2
- package/src/components/blocks/FeatureGrid.tsx +19 -1
- package/src/components/blocks/Footer.tsx +13 -1
- package/src/components/blocks/HeroBlock.tsx +87 -20
- package/src/components/blocks/Image.tsx +395 -0
- package/src/components/blocks/PageBannerHeader.tsx +14 -12
- package/src/components/blocks/ProductCard.tsx +1 -1
- package/src/components/blocks/Section.tsx +113 -8
- package/src/components/blocks/Text.tsx +285 -0
- package/src/components/blocks/index.ts +4 -0
- package/src/components/buttons/Button.tsx +184 -15
- package/src/components/forms/FormBlock.tsx +70 -17
- package/src/components/index.ts +5 -0
- package/src/components/input/ChoiceInputField.tsx +48 -18
- package/src/components/input/HtmlInputField.tsx +48 -18
- package/src/components/input/SelectInputField.tsx +48 -16
- package/src/components/input/SwitchInputField.tsx +48 -17
- package/src/components/input/TextField.tsx +41 -1
- package/src/components/input/TextInputField.tsx +52 -18
- package/src/components/layout/GridCell.tsx +118 -9
- package/src/components/layout/GridLayout.tsx +125 -24
- package/src/components/pages/FormPage.tsx +0 -1
- package/src/components/pages/Page.css +304 -332
- package/src/components/pages/Page.tsx +307 -255
- package/src/components/pages/index.ts +2 -2
- package/src/config/AppConfig.ts +133 -0
- package/src/config/AppConfigBuilder.ts +421 -0
- package/src/config/__tests__/AppConfig.test.ts +385 -0
- package/src/config/__tests__/AppConfigBuilder.test.ts +432 -0
- package/src/config/index.ts +24 -0
- package/src/config/types.ts +170 -0
- package/src/config.ts +25 -0
- package/src/contexts/PrintModeContext.tsx +332 -0
- package/src/contexts/QwickAppContext.tsx +2 -2
- package/src/contexts/index.ts +2 -0
- package/src/hooks/index.ts +5 -1
- package/src/hooks/usePrintMode.ts +73 -0
- package/src/index.ts +3 -0
- package/src/schemas/CodeSchema.ts +3 -3
- package/src/schemas/CollapsibleLayoutSchema.ts +2 -1
- package/src/schemas/ContentSchema.ts +2 -1
- package/src/schemas/GridCellSchema.ts +164 -0
- package/src/schemas/GridLayoutSchema.ts +133 -0
- package/src/schemas/HtmlSchema.ts +47 -0
- package/src/schemas/ImageSchema.ts +235 -0
- package/src/schemas/LogoSchema.ts +241 -0
- package/src/schemas/MarkdownSchema.ts +47 -0
- package/src/schemas/PageTemplateSchema.ts +186 -0
- package/src/schemas/PrintConfigSchema.ts +207 -0
- package/src/schemas/README.md +661 -0
- package/src/schemas/SectionSchema.ts +2 -1
- package/src/schemas/TextSchema.ts +329 -0
- package/src/schemas/ViewModelSchema.ts +115 -0
- package/src/schemas/index.ts +21 -2
- package/src/schemas/transformers/ComponentTransformer.ts +403 -0
- package/src/schemas/transformers/ReactNodeTransformer.ts +236 -0
- package/src/schemas/transformers/registry.ts +72 -0
- package/src/schemas/types/Serializable.ts +51 -0
- package/src/stories/AccessibilityProvider.stories.tsx +253 -253
- package/src/stories/Article.stories.tsx +433 -433
- package/src/stories/Button.stories.tsx +1 -1
- package/src/stories/CardListGrid.stories.tsx +451 -451
- package/src/stories/ChoiceInputField.stories.tsx +503 -503
- package/src/stories/Code.stories.tsx +1 -1
- package/src/stories/CollapsibleLayout.stories.tsx +1414 -1414
- package/src/stories/Content.stories.tsx +393 -393
- package/src/stories/CoverImageHeader.stories.tsx +701 -701
- package/src/stories/DataBinding.advanced.stories.tsx +432 -432
- package/src/stories/DataProvider.stories.tsx +1192 -1192
- package/src/stories/FeatureCard.stories.tsx +557 -557
- package/src/stories/FeatureGrid.stories.tsx +594 -594
- package/src/stories/Footer.stories.tsx +640 -640
- package/src/stories/FormBlock.stories.tsx +760 -760
- package/src/stories/FormComponents.stories.tsx +349 -541
- package/src/stories/GridCell.stories.tsx +417 -0
- package/src/stories/GridLayout.stories.tsx +353 -0
- package/src/stories/HeroBlock.stories.tsx +862 -373
- package/src/stories/HtmlInputField.stories.tsx +474 -474
- package/src/stories/Image.stories.tsx +819 -0
- package/src/stories/Introduction.stories.tsx +667 -667
- package/src/stories/LayoutBlocks.stories.tsx +324 -324
- package/src/stories/Logo.stories.tsx +165 -6
- package/src/stories/Markdown.stories.tsx +137 -137
- package/src/stories/ModelView.stories.tsx +477 -0
- package/src/stories/Page.stories.tsx +688 -688
- package/src/stories/PageBannerHeader.stories.tsx +864 -864
- package/src/stories/PaletteSwitcher.stories.tsx +119 -119
- package/src/stories/ProductCard.stories.tsx +424 -424
- package/src/stories/QwickApp.stories.tsx +368 -368
- package/src/stories/ResponsiveMenu.stories.tsx +249 -249
- package/src/stories/SafeSpan.stories.tsx +531 -531
- package/src/stories/Section.stories.tsx +90 -2
- package/src/stories/SelectInputField.stories.tsx +524 -524
- package/src/stories/Text.stories.tsx +560 -0
- package/src/stories/TextInputField.stories.tsx +443 -443
- package/src/stories/ThemeSwitcher.stories.tsx +123 -123
- package/src/utils/htmlTransform.tsx +74 -53
- package/src/utils/reactUtils.tsx +57 -6
- package/dist/index.bundled.css +0 -12
- /package/src/{hooks/__tests__ → __tests__/hooks}/useDataBinding.test.tsx.disabled +0 -0
- /package/src/{schemas/__tests__ → __tests__/schemas}/builders.test.ts +0 -0
- /package/src/{utils/__tests__ → __tests__/utils}/createDataDrivenComponent.test.tsx.disabled +0 -0
- /package/src/{utils/__tests__ → __tests__/utils}/htmlTransform.test.tsx +0 -0
- /package/src/{utils/__tests__ → __tests__/utils}/optional-logging.test.ts +0 -0
|
@@ -13,144 +13,144 @@ import QwickApp from '../components/QwickApp';
|
|
|
13
13
|
|
|
14
14
|
// Sample select field data for different use cases
|
|
15
15
|
const sampleCmsData = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
16
|
+
'selectInputFields': {
|
|
17
|
+
'basic-dropdown': {
|
|
18
|
+
label: 'Country',
|
|
19
|
+
placeholder: 'Select your country',
|
|
20
|
+
required: true,
|
|
21
|
+
options: [
|
|
22
|
+
{ label: 'United States', value: 'us' },
|
|
23
|
+
{ label: 'Canada', value: 'ca' },
|
|
24
|
+
{ label: 'United Kingdom', value: 'uk' },
|
|
25
|
+
{ label: 'Germany', value: 'de' },
|
|
26
|
+
{ label: 'France', value: 'fr' },
|
|
27
|
+
{ label: 'Australia', value: 'au' },
|
|
28
|
+
{ label: 'Japan', value: 'jp' }
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
'user-role': {
|
|
32
|
+
label: 'User Role',
|
|
33
|
+
placeholder: 'Choose user role',
|
|
34
|
+
required: true,
|
|
35
|
+
helperText: 'Select the appropriate role for this user',
|
|
36
|
+
options: [
|
|
37
|
+
{ label: 'Administrator', value: 'admin' },
|
|
38
|
+
{ label: 'Editor', value: 'editor' },
|
|
39
|
+
{ label: 'Author', value: 'author' },
|
|
40
|
+
{ label: 'Contributor', value: 'contributor' },
|
|
41
|
+
{ label: 'Subscriber', value: 'subscriber' }
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
'product-category': {
|
|
45
|
+
label: 'Product Category',
|
|
46
|
+
placeholder: 'Select category',
|
|
47
|
+
helperText: 'Choose the most appropriate category',
|
|
48
|
+
options: [
|
|
49
|
+
{ label: 'Electronics', value: 'electronics' },
|
|
50
|
+
{ label: 'Clothing & Fashion', value: 'clothing' },
|
|
51
|
+
{ label: 'Home & Garden', value: 'home-garden' },
|
|
52
|
+
{ label: 'Books & Media', value: 'books-media' },
|
|
53
|
+
{ label: 'Sports & Outdoors', value: 'sports' },
|
|
54
|
+
{ label: 'Health & Beauty', value: 'health-beauty' }
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
'priority-level': {
|
|
58
|
+
label: 'Priority Level',
|
|
59
|
+
placeholder: 'Set priority',
|
|
60
|
+
required: true,
|
|
61
|
+
options: [
|
|
62
|
+
{ label: '🔥 Critical', value: 'critical' },
|
|
63
|
+
{ label: ' High', value: 'high' },
|
|
64
|
+
{ label: '🟡 Medium', value: 'medium' },
|
|
65
|
+
{ label: '🔵 Low', value: 'low' },
|
|
66
|
+
{ label: '⚪ Minimal', value: 'minimal' }
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
'subscription-plan': {
|
|
70
|
+
label: 'Subscription Plan',
|
|
71
|
+
placeholder: 'Choose your plan',
|
|
72
|
+
required: true,
|
|
73
|
+
helperText: 'You can upgrade or downgrade at any time',
|
|
74
|
+
options: [
|
|
75
|
+
{ label: 'Free Plan - $0/month', value: 'free' },
|
|
76
|
+
{ label: 'Starter Plan - $9/month', value: 'starter' },
|
|
77
|
+
{ label: 'Professional Plan - $29/month', value: 'professional' },
|
|
78
|
+
{ label: 'Enterprise Plan - $99/month', value: 'enterprise' }
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
'language-preference': {
|
|
82
|
+
label: 'Language Preference',
|
|
83
|
+
placeholder: 'Select language',
|
|
84
|
+
helperText: 'Choose your preferred interface language',
|
|
85
|
+
options: [
|
|
86
|
+
{ label: '🇺🇸 English', value: 'en' },
|
|
87
|
+
{ label: '🇪🇸 Spanish', value: 'es' },
|
|
88
|
+
{ label: '🇫🇷 French', value: 'fr' },
|
|
89
|
+
{ label: '🇩🇪 German', value: 'de' },
|
|
90
|
+
{ label: '🇮🇹 Italian', value: 'it' },
|
|
91
|
+
{ label: '🇯🇵 Japanese', value: 'ja' },
|
|
92
|
+
{ label: '🇰🇷 Korean', value: 'ko' },
|
|
93
|
+
{ label: '🇨🇳 Chinese (Simplified)', value: 'zh-cn' }
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
'status-select': {
|
|
97
|
+
label: 'Status',
|
|
98
|
+
value: 'active',
|
|
99
|
+
options: [
|
|
100
|
+
{ label: '✅ Active', value: 'active' },
|
|
101
|
+
{ label: '⏸ Pending', value: 'pending' },
|
|
102
|
+
{ label: '❌ Inactive', value: 'inactive' },
|
|
103
|
+
{ label: '🛑 Suspended', value: 'suspended' }
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
'disabled-select': {
|
|
107
|
+
label: 'Read-only Field',
|
|
108
|
+
value: 'locked-value',
|
|
109
|
+
disabled: true,
|
|
110
|
+
helperText: 'This field cannot be modified',
|
|
111
|
+
options: [
|
|
112
|
+
{ label: 'Locked Value', value: 'locked-value' },
|
|
113
|
+
{ label: 'Alternative Option', value: 'alt-option' }
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
'error-select': {
|
|
117
|
+
label: 'Department',
|
|
118
|
+
placeholder: 'Select department',
|
|
119
|
+
error: 'Please select a valid department',
|
|
120
|
+
required: true,
|
|
121
|
+
options: [
|
|
122
|
+
{ label: 'Engineering', value: 'engineering' },
|
|
123
|
+
{ label: 'Design', value: 'design' },
|
|
124
|
+
{ label: 'Marketing', value: 'marketing' },
|
|
125
|
+
{ label: 'Sales', value: 'sales' }
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
'numeric-options': {
|
|
129
|
+
label: 'Team Size',
|
|
130
|
+
placeholder: 'Select team size',
|
|
131
|
+
helperText: 'Approximate number of team members',
|
|
132
|
+
options: [
|
|
133
|
+
{ label: '1-5 people', value: 5 },
|
|
134
|
+
{ label: '6-10 people', value: 10 },
|
|
135
|
+
{ label: '11-25 people', value: 25 },
|
|
136
|
+
{ label: '26-50 people', value: 50 },
|
|
137
|
+
{ label: '51-100 people', value: 100 },
|
|
138
|
+
{ label: '100+ people', value: 999 }
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
142
|
};
|
|
143
143
|
|
|
144
144
|
const dataProvider = new JsonDataProvider({ data: sampleCmsData });
|
|
145
145
|
|
|
146
146
|
const meta = {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
147
|
+
title: 'Forms/SelectInputField',
|
|
148
|
+
component: SelectInputField,
|
|
149
|
+
parameters: {
|
|
150
|
+
layout: 'padded',
|
|
151
|
+
docs: {
|
|
152
|
+
description: {
|
|
153
|
+
component: `SelectInputField is a dropdown select component with comprehensive features and data binding support for form building.
|
|
154
154
|
|
|
155
155
|
**Key Features:**
|
|
156
156
|
- **Flexible Options**: Support for string and numeric values with custom labels
|
|
@@ -169,10 +169,10 @@ const meta = {
|
|
|
169
169
|
- Status and priority selection
|
|
170
170
|
- Language and region selection
|
|
171
171
|
- Any single-choice selection requirement`,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
tags: ['autodocs'],
|
|
176
176
|
} satisfies Meta<typeof SelectInputField>;
|
|
177
177
|
|
|
178
178
|
export default meta;
|
|
@@ -180,426 +180,426 @@ type Story = StoryObj<typeof SelectInputField>;
|
|
|
180
180
|
|
|
181
181
|
// Traditional Usage Examples
|
|
182
182
|
export const BasicDropdown: Story = {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
183
|
+
render: () => (
|
|
184
|
+
<QwickApp appId="select-basic" appName='Basic Select'>
|
|
185
|
+
<SelectInputField
|
|
186
|
+
label="Country"
|
|
187
|
+
placeholder="Select your country"
|
|
188
|
+
options={[
|
|
189
|
+
{ label: 'United States', value: 'us' },
|
|
190
|
+
{ label: 'Canada', value: 'ca' },
|
|
191
|
+
{ label: 'United Kingdom', value: 'uk' },
|
|
192
|
+
{ label: 'Germany', value: 'de' }
|
|
193
|
+
]}
|
|
194
|
+
onChange={(value) => console.log('Country selected:', value)}
|
|
195
|
+
/>
|
|
196
|
+
</QwickApp>
|
|
197
|
+
),
|
|
198
|
+
parameters: {
|
|
199
|
+
docs: {
|
|
200
|
+
description: {
|
|
201
|
+
story: 'Basic select dropdown with country options.',
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
205
|
};
|
|
206
206
|
|
|
207
207
|
export const WithIcons: Story = {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
208
|
+
render: () => (
|
|
209
|
+
<QwickApp appId="select-icons" appName='Select with Icons'>
|
|
210
|
+
<SelectInputField
|
|
211
|
+
label="Priority Level"
|
|
212
|
+
placeholder="Set priority"
|
|
213
|
+
options={[
|
|
214
|
+
{ label: '🔥 Critical', value: 'critical' },
|
|
215
|
+
{ label: ' High', value: 'high' },
|
|
216
|
+
{ label: '🟡 Medium', value: 'medium' },
|
|
217
|
+
{ label: '🔵 Low', value: 'low' },
|
|
218
|
+
{ label: '⚪ Minimal', value: 'minimal' }
|
|
219
|
+
]}
|
|
220
|
+
onChange={(value) => console.log('Priority selected:', value)}
|
|
221
|
+
/>
|
|
222
|
+
</QwickApp>
|
|
223
|
+
),
|
|
224
|
+
parameters: {
|
|
225
|
+
docs: {
|
|
226
|
+
description: {
|
|
227
|
+
story: 'Select dropdown with emoji icons in option labels.',
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
231
|
};
|
|
232
232
|
|
|
233
233
|
export const NumericValues: Story = {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
234
|
+
render: () => (
|
|
235
|
+
<QwickApp appId="select-numeric" appName='Select with Numeric Values'>
|
|
236
|
+
<SelectInputField
|
|
237
|
+
label="Team Size"
|
|
238
|
+
placeholder="Select team size"
|
|
239
|
+
helperText="Approximate number of team members"
|
|
240
|
+
options={[
|
|
241
|
+
{ label: '1-5 people', value: 5 },
|
|
242
|
+
{ label: '6-10 people', value: 10 },
|
|
243
|
+
{ label: '11-25 people', value: 25 },
|
|
244
|
+
{ label: '26-50 people', value: 50 },
|
|
245
|
+
{ label: '100+ people', value: 999 }
|
|
246
|
+
]}
|
|
247
|
+
onChange={(value) => console.log('Team size selected:', value)}
|
|
248
|
+
/>
|
|
249
|
+
</QwickApp>
|
|
250
|
+
),
|
|
251
|
+
parameters: {
|
|
252
|
+
docs: {
|
|
253
|
+
description: {
|
|
254
|
+
story: 'Select dropdown with numeric values and descriptive labels.',
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
258
|
};
|
|
259
259
|
|
|
260
260
|
export const WithHelperText: Story = {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
261
|
+
render: () => (
|
|
262
|
+
<QwickApp appId="select-helper" appName='Select with Helper Text'>
|
|
263
|
+
<SelectInputField
|
|
264
|
+
label="Subscription Plan"
|
|
265
|
+
placeholder="Choose your plan"
|
|
266
|
+
required={true}
|
|
267
|
+
helperText="You can upgrade or downgrade at any time"
|
|
268
|
+
options={[
|
|
269
|
+
{ label: 'Free Plan - $0/month', value: 'free' },
|
|
270
|
+
{ label: 'Starter Plan - $9/month', value: 'starter' },
|
|
271
|
+
{ label: 'Professional Plan - $29/month', value: 'professional' },
|
|
272
|
+
{ label: 'Enterprise Plan - $99/month', value: 'enterprise' }
|
|
273
|
+
]}
|
|
274
|
+
onChange={(value) => console.log('Plan selected:', value)}
|
|
275
|
+
/>
|
|
276
|
+
</QwickApp>
|
|
277
|
+
),
|
|
278
|
+
parameters: {
|
|
279
|
+
docs: {
|
|
280
|
+
description: {
|
|
281
|
+
story: 'Select dropdown with helper text and pricing information.',
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
285
|
};
|
|
286
286
|
|
|
287
287
|
export const States: Story = {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
288
|
+
render: () => (
|
|
289
|
+
<QwickApp appId="select-states" appName='Select Field States'>
|
|
290
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, maxWidth: 500 }}>
|
|
291
|
+
<SelectInputField
|
|
292
|
+
label="Normal State"
|
|
293
|
+
placeholder="Select an option"
|
|
294
|
+
options={[
|
|
295
|
+
{ label: 'Option 1', value: 'option1' },
|
|
296
|
+
{ label: 'Option 2', value: 'option2' },
|
|
297
|
+
{ label: 'Option 3', value: 'option3' }
|
|
298
|
+
]}
|
|
299
|
+
onChange={(value) => console.log('Normal selected:', value)}
|
|
300
|
+
/>
|
|
301
|
+
|
|
302
|
+
<SelectInputField
|
|
303
|
+
label="Required Field"
|
|
304
|
+
placeholder="This field is required"
|
|
305
|
+
required={true}
|
|
306
|
+
options={[
|
|
307
|
+
{ label: 'Option A', value: 'a' },
|
|
308
|
+
{ label: 'Option B', value: 'b' }
|
|
309
|
+
]}
|
|
310
|
+
onChange={(value) => console.log('Required selected:', value)}
|
|
311
|
+
/>
|
|
312
|
+
|
|
313
|
+
<SelectInputField
|
|
314
|
+
label="Pre-selected Value"
|
|
315
|
+
value="active"
|
|
316
|
+
options={[
|
|
317
|
+
{ label: '✅ Active', value: 'active' },
|
|
318
|
+
{ label: '❌ Inactive', value: 'inactive' }
|
|
319
|
+
]}
|
|
320
|
+
onChange={(value) => console.log('Pre-selected changed:', value)}
|
|
321
|
+
/>
|
|
322
|
+
|
|
323
|
+
<SelectInputField
|
|
324
|
+
label="Disabled Field"
|
|
325
|
+
value="locked"
|
|
326
|
+
disabled={true}
|
|
327
|
+
options={[
|
|
328
|
+
{ label: 'Locked Value', value: 'locked' },
|
|
329
|
+
{ label: 'Alternative', value: 'alt' }
|
|
330
|
+
]}
|
|
331
|
+
/>
|
|
332
|
+
|
|
333
|
+
<SelectInputField
|
|
334
|
+
label="Error State"
|
|
335
|
+
placeholder="Select a department"
|
|
336
|
+
error="Please select a valid department"
|
|
337
|
+
options={[
|
|
338
|
+
{ label: 'Engineering', value: 'eng' },
|
|
339
|
+
{ label: 'Design', value: 'design' },
|
|
340
|
+
{ label: 'Marketing', value: 'marketing' }
|
|
341
|
+
]}
|
|
342
|
+
onChange={(value) => console.log('Error field selected:', value)}
|
|
343
|
+
/>
|
|
344
|
+
</Box>
|
|
345
|
+
</QwickApp>
|
|
346
|
+
),
|
|
347
|
+
parameters: {
|
|
348
|
+
docs: {
|
|
349
|
+
description: {
|
|
350
|
+
story: 'Different select field states including normal, required, pre-selected, disabled, and error states.',
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
354
|
};
|
|
355
355
|
|
|
356
356
|
// Data Binding Examples
|
|
357
357
|
export const DataBindingBasic: Story = {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
358
|
+
render: () => (
|
|
359
|
+
<QwickApp appId="select-data-binding" appName='SelectInputField Data Binding' dataSource={{ dataProvider }}>
|
|
360
|
+
<Box>
|
|
361
|
+
|
|
362
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
363
|
+
<Typography variant="h5" gutterBottom> Data-Driven Select</Typography>
|
|
364
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
365
|
+
SelectInputField components can be completely driven by CMS data, loading options and configuration from your data source.
|
|
366
|
+
</Typography>
|
|
367
|
+
|
|
368
|
+
<Code title="Usage" language="tsx">{`<SelectInputField dataSource="selectInputFields.basic-dropdown" />`}</Code>
|
|
369
|
+
|
|
370
|
+
<Code title="Data Structure" language="json">{JSON.stringify(sampleCmsData.selectInputFields['basic-dropdown'], null, 2)}</Code>
|
|
371
|
+
</Box>
|
|
372
372
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
373
|
+
<SelectInputField dataSource="selectInputFields.basic-dropdown" />
|
|
374
|
+
|
|
375
|
+
</Box>
|
|
376
|
+
</QwickApp>
|
|
377
|
+
),
|
|
378
|
+
parameters: {
|
|
379
|
+
docs: {
|
|
380
|
+
description: {
|
|
381
|
+
story: 'SelectInputField with data binding - options and configuration resolved from CMS data through dataSource.',
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
385
|
};
|
|
386
386
|
|
|
387
387
|
export const DataBindingAdvanced: Story = {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
388
|
+
render: () => (
|
|
389
|
+
<QwickApp appId="select-data-advanced" appName='Advanced SelectInputField Data Binding' dataSource={{ dataProvider }}>
|
|
390
|
+
<Box>
|
|
391
|
+
|
|
392
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
393
|
+
<Typography variant="h5" gutterBottom> Multiple Select Types</Typography>
|
|
394
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
395
|
+
Different SelectInputField instances can load different option sets and configurations from separate data sources.
|
|
396
|
+
</Typography>
|
|
397
|
+
</Box>
|
|
398
398
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
399
|
+
{/* User Management */}
|
|
400
|
+
<Box sx={{ mb: 4 }}>
|
|
401
|
+
<Typography variant="h4" gutterBottom>User Management</Typography>
|
|
402
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, maxWidth: 500 }}>
|
|
403
|
+
<SelectInputField dataSource="selectInputFields.user-role" />
|
|
404
|
+
<SelectInputField dataSource="selectInputFields.status-select" />
|
|
405
|
+
<SelectInputField dataSource="selectInputFields.language-preference" />
|
|
406
|
+
</Box>
|
|
407
|
+
</Box>
|
|
408
408
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
409
|
+
{/* Business Settings */}
|
|
410
|
+
<Box sx={{ mb: 4 }}>
|
|
411
|
+
<Typography variant="h4" gutterBottom>Business Configuration</Typography>
|
|
412
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, maxWidth: 500 }}>
|
|
413
|
+
<SelectInputField dataSource="selectInputFields.subscription-plan" />
|
|
414
|
+
<SelectInputField dataSource="selectInputFields.numeric-options" />
|
|
415
|
+
<SelectInputField dataSource="selectInputFields.basic-dropdown" />
|
|
416
|
+
</Box>
|
|
417
|
+
</Box>
|
|
418
418
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
419
|
+
{/* Project Management */}
|
|
420
|
+
<Box sx={{ mb: 4 }}>
|
|
421
|
+
<Typography variant="h4" gutterBottom>Project Settings</Typography>
|
|
422
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, maxWidth: 500 }}>
|
|
423
|
+
<SelectInputField dataSource="selectInputFields.priority-level" />
|
|
424
|
+
<SelectInputField dataSource="selectInputFields.product-category" />
|
|
425
|
+
<SelectInputField dataSource="selectInputFields.error-select" />
|
|
426
|
+
</Box>
|
|
427
|
+
</Box>
|
|
428
|
+
|
|
429
|
+
</Box>
|
|
430
|
+
</QwickApp>
|
|
431
|
+
),
|
|
432
|
+
parameters: {
|
|
433
|
+
docs: {
|
|
434
|
+
description: {
|
|
435
|
+
story: 'Advanced data binding with multiple select types showcasing different option sets and configurations.',
|
|
436
|
+
},
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
439
|
};
|
|
440
440
|
|
|
441
441
|
export const DataBindingWithFallback: Story = {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
442
|
+
render: () => (
|
|
443
|
+
<QwickApp appId="select-fallback" appName='SelectInputField Data Binding with Fallback' dataSource={{ dataProvider }}>
|
|
444
|
+
<Box>
|
|
445
|
+
|
|
446
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
447
|
+
<Typography variant="h5" gutterBottom> Fallback Support</Typography>
|
|
448
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
449
|
+
SelectInputField components gracefully handle missing data sources with fallback options.
|
|
450
|
+
</Typography>
|
|
451
|
+
|
|
452
|
+
<Code title="Fallback Usage" language="tsx">{`<SelectInputField
|
|
453
|
+
dataSource="nonexistent.field"
|
|
454
|
+
label="Fallback Select"
|
|
455
|
+
placeholder="Choose option"
|
|
456
|
+
options={[
|
|
457
|
+
{ label: 'Fallback Option 1', value: 'fb1' },
|
|
458
|
+
{ label: 'Fallback Option 2', value: 'fb2' }
|
|
459
|
+
]}
|
|
460
460
|
/>`}</Code>
|
|
461
|
-
|
|
461
|
+
</Box>
|
|
462
462
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
463
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4 }}>
|
|
464
|
+
<Box>
|
|
465
|
+
<Typography variant="h6" gutterBottom>Missing Data Source (Fallback)</Typography>
|
|
466
|
+
<SelectInputField
|
|
467
|
+
dataSource="nonexistent.field"
|
|
468
|
+
label="Fallback Select"
|
|
469
|
+
placeholder="Choose option"
|
|
470
|
+
options={[
|
|
471
|
+
{ label: 'Fallback Option 1', value: 'fb1' },
|
|
472
|
+
{ label: 'Fallback Option 2', value: 'fb2' }
|
|
473
|
+
]}
|
|
474
|
+
/>
|
|
475
|
+
</Box>
|
|
476
|
+
<Box>
|
|
477
|
+
<Typography variant="h6" gutterBottom>Valid Data Source</Typography>
|
|
478
|
+
<SelectInputField dataSource="selectInputFields.basic-dropdown" />
|
|
479
|
+
</Box>
|
|
480
|
+
</Box>
|
|
481
|
+
|
|
482
|
+
</Box>
|
|
483
|
+
</QwickApp>
|
|
484
|
+
),
|
|
485
|
+
parameters: {
|
|
486
|
+
docs: {
|
|
487
|
+
description: {
|
|
488
|
+
story: 'SelectInputField with fallback options when dataSource is missing or unavailable.',
|
|
489
|
+
},
|
|
490
|
+
},
|
|
491
|
+
},
|
|
492
492
|
};
|
|
493
493
|
|
|
494
494
|
export const RealWorldExample: Story = {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
495
|
+
render: () => (
|
|
496
|
+
<QwickApp appId="select-real-world" appName='Real World SelectInputField Example' dataSource={{ dataProvider }}>
|
|
497
|
+
<Box>
|
|
498
|
+
|
|
499
|
+
{/* User Profile Setup */}
|
|
500
|
+
<Box sx={{ mb: 6, p: 4, backgroundColor: 'background.paper', borderRadius: 2 }}>
|
|
501
|
+
<Typography variant="h3" gutterBottom>User Profile Setup</Typography>
|
|
502
|
+
<Typography variant="body1" sx={{ mb: 4, opacity: 0.8 }}>
|
|
503
|
+
Configure your account settings and preferences
|
|
504
|
+
</Typography>
|
|
505
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: { xs: '1fr', md: '1fr 1fr' }, gap: 3, maxWidth: 800 }}>
|
|
506
|
+
<SelectInputField dataSource="selectInputFields.basic-dropdown" />
|
|
507
|
+
<SelectInputField dataSource="selectInputFields.language-preference" />
|
|
508
|
+
<SelectInputField dataSource="selectInputFields.user-role" />
|
|
509
|
+
<SelectInputField dataSource="selectInputFields.subscription-plan" />
|
|
510
|
+
</Box>
|
|
511
|
+
</Box>
|
|
512
|
+
|
|
513
|
+
{/* Project Management Dashboard */}
|
|
514
|
+
<Box sx={{ mb: 6, p: 4, backgroundColor: 'primary.main', color: 'primary.contrastText', borderRadius: 2 }}>
|
|
515
|
+
<Typography variant="h3" gutterBottom>Project Configuration</Typography>
|
|
516
|
+
<Typography variant="body1" sx={{ mb: 4, opacity: 0.9 }}>
|
|
517
|
+
Set up your project parameters and team settings
|
|
518
|
+
</Typography>
|
|
519
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: { xs: '1fr', md: '1fr 1fr 1fr' }, gap: 3, maxWidth: 1000 }}>
|
|
520
|
+
<SelectInputField dataSource="selectInputFields.priority-level" />
|
|
521
|
+
<SelectInputField dataSource="selectInputFields.product-category" />
|
|
522
|
+
<SelectInputField dataSource="selectInputFields.numeric-options" />
|
|
523
|
+
</Box>
|
|
524
|
+
</Box>
|
|
525
|
+
|
|
526
|
+
{/* System Administration */}
|
|
527
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper', borderRadius: 2 }}>
|
|
528
|
+
<Typography variant="h3" gutterBottom>System Administration</Typography>
|
|
529
|
+
<Typography variant="body1" sx={{ mb: 4, opacity: 0.8 }}>
|
|
530
|
+
Manage system-wide settings and user permissions
|
|
531
|
+
</Typography>
|
|
532
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, maxWidth: 500 }}>
|
|
533
|
+
<SelectInputField dataSource="selectInputFields.status-select" />
|
|
534
|
+
<SelectInputField dataSource="selectInputFields.disabled-select" />
|
|
535
|
+
<SelectInputField dataSource="selectInputFields.error-select" />
|
|
536
|
+
</Box>
|
|
537
|
+
</Box>
|
|
538
|
+
|
|
539
|
+
</Box>
|
|
540
|
+
</QwickApp>
|
|
541
|
+
),
|
|
542
|
+
parameters: {
|
|
543
|
+
docs: {
|
|
544
|
+
description: {
|
|
545
|
+
story: 'Real-world example showing SelectInputField in various contexts: user profiles, project management, and system administration.',
|
|
546
|
+
},
|
|
547
|
+
},
|
|
548
|
+
},
|
|
549
549
|
};
|
|
550
550
|
|
|
551
551
|
export const OptionsShowcase: Story = {
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
552
|
+
render: () => (
|
|
553
|
+
<QwickApp appId="select-showcase" appName='SelectInputField Options Showcase' dataSource={{ dataProvider }}>
|
|
554
|
+
<Box>
|
|
555
|
+
|
|
556
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
557
|
+
<Typography variant="h5" gutterBottom> Options Showcase</Typography>
|
|
558
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
559
|
+
SelectInputField supports various option formats including icons, pricing, status indicators, and numeric values.
|
|
560
|
+
</Typography>
|
|
561
|
+
</Box>
|
|
562
562
|
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
563
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(350px, 1fr))', gap: 4 }}>
|
|
564
|
+
<Box>
|
|
565
|
+
<Typography variant="h6" gutterBottom>Basic Text Options</Typography>
|
|
566
|
+
<SelectInputField dataSource="selectInputFields.basic-dropdown" />
|
|
567
|
+
</Box>
|
|
568
|
+
|
|
569
|
+
<Box>
|
|
570
|
+
<Typography variant="h6" gutterBottom>Icon-Enhanced Options</Typography>
|
|
571
|
+
<SelectInputField dataSource="selectInputFields.priority-level" />
|
|
572
|
+
</Box>
|
|
573
|
+
|
|
574
|
+
<Box>
|
|
575
|
+
<Typography variant="h6" gutterBottom>Pricing Options</Typography>
|
|
576
|
+
<SelectInputField dataSource="selectInputFields.subscription-plan" />
|
|
577
|
+
</Box>
|
|
578
|
+
|
|
579
|
+
<Box>
|
|
580
|
+
<Typography variant="h6" gutterBottom>Status Indicators</Typography>
|
|
581
|
+
<SelectInputField dataSource="selectInputFields.status-select" />
|
|
582
|
+
</Box>
|
|
583
|
+
|
|
584
|
+
<Box>
|
|
585
|
+
<Typography variant="h6" gutterBottom>Numeric Values</Typography>
|
|
586
|
+
<SelectInputField dataSource="selectInputFields.numeric-options" />
|
|
587
|
+
</Box>
|
|
588
|
+
|
|
589
|
+
<Box>
|
|
590
|
+
<Typography variant="h6" gutterBottom>Multi-language Options</Typography>
|
|
591
|
+
<SelectInputField dataSource="selectInputFields.language-preference" />
|
|
592
|
+
</Box>
|
|
593
|
+
</Box>
|
|
594
|
+
|
|
595
|
+
</Box>
|
|
596
|
+
</QwickApp>
|
|
597
|
+
),
|
|
598
|
+
parameters: {
|
|
599
|
+
docs: {
|
|
600
|
+
description: {
|
|
601
|
+
story: 'Comprehensive showcase of different SelectInputField option formats and styles.',
|
|
602
|
+
},
|
|
603
|
+
},
|
|
604
|
+
},
|
|
605
605
|
};
|