@qwickapps/react-framework 1.4.0 → 1.4.2
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/QUICK_START_GUIDE.md +82 -0
- package/README.md +231 -21
- package/dist/components/Html.d.ts.map +1 -1
- package/dist/components/Markdown.d.ts +1 -2
- package/dist/components/Markdown.d.ts.map +1 -1
- package/dist/components/SafeSpan.d.ts +1 -2
- package/dist/components/SafeSpan.d.ts.map +1 -1
- package/dist/components/base/Container.d.ts +32 -0
- package/dist/components/base/Container.d.ts.map +1 -0
- package/dist/components/base/ContainerView.d.ts +65 -0
- package/dist/components/base/ContainerView.d.ts.map +1 -0
- package/dist/components/base/ModelView.d.ts +37 -46
- package/dist/components/base/ModelView.d.ts.map +1 -1
- package/dist/components/base/index.d.ts +3 -2
- package/dist/components/base/index.d.ts.map +1 -1
- package/dist/components/blocks/Article.d.ts +1 -2
- package/dist/components/blocks/Article.d.ts.map +1 -1
- package/dist/components/blocks/Code-factory.d.ts +22 -0
- package/dist/components/blocks/Code-factory.d.ts.map +1 -0
- package/dist/components/blocks/Code-old.d.ts +31 -0
- package/dist/components/blocks/Code-old.d.ts.map +1 -0
- package/dist/components/blocks/Code.d.ts +30 -18
- package/dist/components/blocks/Code.d.ts.map +1 -1
- package/dist/components/blocks/HeroBlock.d.ts +1 -2
- package/dist/components/blocks/HeroBlock.d.ts.map +1 -1
- package/dist/components/blocks/Image.d.ts +1 -2
- package/dist/components/blocks/Image.d.ts.map +1 -1
- package/dist/components/blocks/Section.d.ts +1 -2
- package/dist/components/blocks/Section.d.ts.map +1 -1
- package/dist/components/blocks/Text.d.ts +35 -27
- package/dist/components/blocks/Text.d.ts.map +1 -1
- package/dist/components/buttons/Button.d.ts +1 -2
- package/dist/components/buttons/Button.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/input/ChoiceInputField.d.ts +1 -2
- package/dist/components/input/ChoiceInputField.d.ts.map +1 -1
- package/dist/components/input/HtmlInputField.d.ts +1 -2
- package/dist/components/input/HtmlInputField.d.ts.map +1 -1
- package/dist/components/input/SelectInputField.d.ts +1 -2
- package/dist/components/input/SelectInputField.d.ts.map +1 -1
- package/dist/components/pages/Page.d.ts +29 -47
- package/dist/components/pages/Page.d.ts.map +1 -1
- package/dist/components/pages/index.d.ts +2 -3
- package/dist/components/pages/index.d.ts.map +1 -1
- package/dist/components/shared/createSerializableView.d.ts +68 -0
- package/dist/components/shared/createSerializableView.d.ts.map +1 -0
- package/dist/components/shared/viewProps.d.ts +37 -0
- package/dist/components/shared/viewProps.d.ts.map +1 -0
- package/dist/index.esm.js +21782 -22580
- package/dist/index.js +21782 -22579
- package/dist/qa/ConsoleWarningTest.d.ts +5 -0
- package/dist/qa/ConsoleWarningTest.d.ts.map +1 -0
- package/dist/qa/StorageKeyTest.d.ts +6 -0
- package/dist/qa/StorageKeyTest.d.ts.map +1 -0
- package/dist/qa/ThemeStorageKeyTest.d.ts +6 -0
- package/dist/qa/ThemeStorageKeyTest.d.ts.map +1 -0
- package/dist/schemas/CodeSchema.d.ts +2 -2
- package/dist/schemas/CodeSchema.d.ts.map +1 -1
- package/dist/schemas/ContainerSchema.d.ts +12 -0
- package/dist/schemas/ContainerSchema.d.ts.map +1 -0
- package/dist/schemas/PageTemplateSchema.d.ts +3 -3
- package/dist/schemas/PageTemplateSchema.d.ts.map +1 -1
- package/dist/schemas/ViewModelSchema.d.ts +46 -6
- package/dist/schemas/ViewModelSchema.d.ts.map +1 -1
- package/dist/schemas/ViewSchema.d.ts +65 -0
- package/dist/schemas/ViewSchema.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/transformers/ComponentTransformer.d.ts +27 -15
- package/dist/schemas/transformers/ComponentTransformer.d.ts.map +1 -1
- package/dist/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -1
- package/dist/schemas/transformers/registry.d.ts +3 -0
- package/dist/schemas/transformers/registry.d.ts.map +1 -1
- package/dist/src/__tests__/schemas/transformers/MockSerializableComponent.d.ts +66 -0
- package/dist/src/__tests__/schemas/transformers/MockSerializableComponent.d.ts.map +1 -0
- package/dist/src/components/AccessibilityChecker.d.ts +12 -0
- package/dist/src/components/AccessibilityChecker.d.ts.map +1 -0
- package/dist/src/components/AccessibilityProvider.d.ts +64 -0
- package/dist/src/components/AccessibilityProvider.d.ts.map +1 -0
- package/dist/src/components/Breadcrumbs.d.ts +39 -0
- package/dist/src/components/Breadcrumbs.d.ts.map +1 -0
- package/dist/src/components/ErrorBoundary.d.ts +46 -0
- package/dist/src/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/src/components/Html.d.ts +58 -0
- package/dist/src/components/Html.d.ts.map +1 -0
- package/dist/src/components/Logo.d.ts +56 -0
- package/dist/src/components/Logo.d.ts.map +1 -0
- package/dist/src/components/Markdown.d.ts +51 -0
- package/dist/src/components/Markdown.d.ts.map +1 -0
- package/dist/src/components/QwickApp.d.ts +69 -0
- package/dist/src/components/QwickApp.d.ts.map +1 -0
- package/dist/src/components/QwickAppsLogo.d.ts +25 -0
- package/dist/src/components/QwickAppsLogo.d.ts.map +1 -0
- package/dist/src/components/QwickIcon.d.ts +23 -0
- package/dist/src/components/QwickIcon.d.ts.map +1 -0
- package/dist/src/components/ResponsiveMenu.d.ts +38 -0
- package/dist/src/components/ResponsiveMenu.d.ts.map +1 -0
- package/dist/src/components/SafeSpan.d.ts +29 -0
- package/dist/src/components/SafeSpan.d.ts.map +1 -0
- package/dist/src/components/Scaffold.d.ts +57 -0
- package/dist/src/components/Scaffold.d.ts.map +1 -0
- package/dist/src/components/base/Container.d.ts +33 -0
- package/dist/src/components/base/Container.d.ts.map +1 -0
- package/dist/src/components/base/ModelView.d.ts +92 -0
- package/dist/src/components/base/ModelView.d.ts.map +1 -0
- package/dist/src/components/base/index.d.ts +12 -0
- package/dist/src/components/base/index.d.ts.map +1 -0
- package/dist/src/components/blocks/Article.d.ts +32 -0
- package/dist/src/components/blocks/Article.d.ts.map +1 -0
- package/dist/src/components/blocks/CardListGrid.d.ts +23 -0
- package/dist/src/components/blocks/CardListGrid.d.ts.map +1 -0
- package/dist/src/components/blocks/Code.d.ts +37 -0
- package/dist/src/components/blocks/Code.d.ts.map +1 -0
- package/dist/src/components/blocks/Content.d.ts +24 -0
- package/dist/src/components/blocks/Content.d.ts.map +1 -0
- package/dist/src/components/blocks/CoverImageHeader.d.ts +44 -0
- package/dist/src/components/blocks/CoverImageHeader.d.ts.map +1 -0
- package/dist/src/components/blocks/FeatureCard.d.ts +66 -0
- package/dist/src/components/blocks/FeatureCard.d.ts.map +1 -0
- package/dist/src/components/blocks/FeatureGrid.d.ts +48 -0
- package/dist/src/components/blocks/FeatureGrid.d.ts.map +1 -0
- package/dist/src/components/blocks/Footer.d.ts +56 -0
- package/dist/src/components/blocks/Footer.d.ts.map +1 -0
- package/dist/src/components/blocks/HeroBlock.d.ts +55 -0
- package/dist/src/components/blocks/HeroBlock.d.ts.map +1 -0
- package/dist/src/components/blocks/Image.d.ts +40 -0
- package/dist/src/components/blocks/Image.d.ts.map +1 -0
- package/dist/src/components/blocks/PageBannerHeader.d.ts +30 -0
- package/dist/src/components/blocks/PageBannerHeader.d.ts.map +1 -0
- package/dist/src/components/blocks/ProductCard.d.ts +57 -0
- package/dist/src/components/blocks/ProductCard.d.ts.map +1 -0
- package/dist/src/components/blocks/Section.d.ts +45 -0
- package/dist/src/components/blocks/Section.d.ts.map +1 -0
- package/dist/src/components/blocks/Text.d.ts +34 -0
- package/dist/src/components/blocks/Text.d.ts.map +1 -0
- package/dist/src/components/blocks/index.d.ts +41 -0
- package/dist/src/components/blocks/index.d.ts.map +1 -0
- package/dist/src/components/buttons/Button.d.ts +41 -0
- package/dist/src/components/buttons/Button.d.ts.map +1 -0
- package/dist/src/components/buttons/PaletteSwitcher.d.ts +24 -0
- package/dist/src/components/buttons/PaletteSwitcher.d.ts.map +1 -0
- package/dist/src/components/buttons/ThemeSwitcher.d.ts +24 -0
- package/dist/src/components/buttons/ThemeSwitcher.d.ts.map +1 -0
- package/dist/src/components/buttons/index.d.ts +11 -0
- package/dist/src/components/buttons/index.d.ts.map +1 -0
- package/dist/src/components/forms/FormBlock.d.ts +51 -0
- package/dist/src/components/forms/FormBlock.d.ts.map +1 -0
- package/dist/src/components/forms/index.d.ts +8 -0
- package/dist/src/components/forms/index.d.ts.map +1 -0
- package/dist/src/components/index.d.ts +41 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/components/input/ChoiceInputField.d.ts +29 -0
- package/dist/src/components/input/ChoiceInputField.d.ts.map +1 -0
- package/dist/src/components/input/HtmlInputField.d.ts +33 -0
- package/dist/src/components/input/HtmlInputField.d.ts.map +1 -0
- package/dist/src/components/input/SelectInputField.d.ts +31 -0
- package/dist/src/components/input/SelectInputField.d.ts.map +1 -0
- package/dist/src/components/input/SwitchInputField.d.ts +27 -0
- package/dist/src/components/input/SwitchInputField.d.ts.map +1 -0
- package/dist/src/components/input/TextField.d.ts +18 -0
- package/dist/src/components/input/TextField.d.ts.map +1 -0
- package/dist/src/components/input/TextInputField.d.ts +34 -0
- package/dist/src/components/input/TextInputField.d.ts.map +1 -0
- package/dist/src/components/input/index.d.ts +19 -0
- package/dist/src/components/input/index.d.ts.map +1 -0
- package/dist/src/components/layout/CollapsibleLayout/CollapsibleLayout.d.ts +34 -0
- package/dist/src/components/layout/CollapsibleLayout/CollapsibleLayout.d.ts.map +1 -0
- package/dist/src/components/layout/CollapsibleLayout/index.d.ts +9 -0
- package/dist/src/components/layout/CollapsibleLayout/index.d.ts.map +1 -0
- package/dist/src/components/layout/GridCell.d.ts +32 -0
- package/dist/src/components/layout/GridCell.d.ts.map +1 -0
- package/dist/src/components/layout/GridCellWrapper.d.ts +46 -0
- package/dist/src/components/layout/GridCellWrapper.d.ts.map +1 -0
- package/dist/src/components/layout/GridLayout.d.ts +50 -0
- package/dist/src/components/layout/GridLayout.d.ts.map +1 -0
- package/dist/src/components/layout/index.d.ts +14 -0
- package/dist/src/components/layout/index.d.ts.map +1 -0
- package/dist/src/components/menu/Menu.d.ts +1 -0
- package/dist/src/components/menu/Menu.d.ts.map +1 -0
- package/dist/src/components/menu/MenuItem.d.ts +31 -0
- package/dist/src/components/menu/MenuItem.d.ts.map +1 -0
- package/dist/src/components/menu/index.d.ts +7 -0
- package/dist/src/components/menu/index.d.ts.map +1 -0
- package/dist/src/components/pages/FormPage.d.ts +66 -0
- package/dist/src/components/pages/FormPage.d.ts.map +1 -0
- package/dist/src/components/pages/Page.d.ts +68 -0
- package/dist/src/components/pages/Page.d.ts.map +1 -0
- package/dist/src/components/pages/index.d.ts +10 -0
- package/dist/src/components/pages/index.d.ts.map +1 -0
- package/dist/src/components/shared/createSerializableView.d.ts +81 -0
- package/dist/src/components/shared/createSerializableView.d.ts.map +1 -0
- package/dist/src/components/shared/viewProps.d.ts +37 -0
- package/dist/src/components/shared/viewProps.d.ts.map +1 -0
- package/dist/src/config/AppConfig.d.ts +49 -0
- package/dist/src/config/AppConfig.d.ts.map +1 -0
- package/dist/src/config/AppConfigBuilder.d.ts +75 -0
- package/dist/src/config/AppConfigBuilder.d.ts.map +1 -0
- package/dist/src/config/index.d.ts +13 -0
- package/dist/src/config/index.d.ts.map +1 -0
- package/dist/src/config/types.d.ts +130 -0
- package/dist/src/config/types.d.ts.map +1 -0
- package/dist/src/config.d.ts +15 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/contexts/DataContext.d.ts +139 -0
- package/dist/src/contexts/DataContext.d.ts.map +1 -0
- package/dist/src/contexts/DimensionsContext.d.ts +42 -0
- package/dist/src/contexts/DimensionsContext.d.ts.map +1 -0
- package/dist/src/contexts/PaletteContext.d.ts +53 -0
- package/dist/src/contexts/PaletteContext.d.ts.map +1 -0
- package/dist/src/contexts/PrintModeContext.d.ts +27 -0
- package/dist/src/contexts/PrintModeContext.d.ts.map +1 -0
- package/dist/src/contexts/QwickAppContext.d.ts +71 -0
- package/dist/src/contexts/QwickAppContext.d.ts.map +1 -0
- package/dist/src/contexts/ThemeContext.d.ts +65 -0
- package/dist/src/contexts/ThemeContext.d.ts.map +1 -0
- package/dist/src/contexts/index.d.ts +11 -0
- package/dist/src/contexts/index.d.ts.map +1 -0
- package/dist/src/hooks/index.d.ts +12 -0
- package/dist/src/hooks/index.d.ts.map +1 -0
- package/dist/src/hooks/useBaseProps.d.ts +101 -0
- package/dist/src/hooks/useBaseProps.d.ts.map +1 -0
- package/dist/src/hooks/useDataBinding.d.ts +22 -0
- package/dist/src/hooks/useDataBinding.d.ts.map +1 -0
- package/dist/src/hooks/usePrintMode.d.ts +39 -0
- package/dist/src/hooks/usePrintMode.d.ts.map +1 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/palettes/PaletteAutumn.d.ts +10 -0
- package/dist/src/palettes/PaletteAutumn.d.ts.map +1 -0
- package/dist/src/palettes/PaletteCosmic.d.ts +10 -0
- package/dist/src/palettes/PaletteCosmic.d.ts.map +1 -0
- package/dist/src/palettes/PaletteDefault.d.ts +10 -0
- package/dist/src/palettes/PaletteDefault.d.ts.map +1 -0
- package/dist/src/palettes/PaletteOcean.d.ts +10 -0
- package/dist/src/palettes/PaletteOcean.d.ts.map +1 -0
- package/dist/src/palettes/PaletteSpring.d.ts +10 -0
- package/dist/src/palettes/PaletteSpring.d.ts.map +1 -0
- package/dist/src/palettes/PaletteWinter.d.ts +10 -0
- package/dist/src/palettes/PaletteWinter.d.ts.map +1 -0
- package/dist/src/palettes/index.d.ts +13 -0
- package/dist/src/palettes/index.d.ts.map +1 -0
- package/dist/src/schemas/ActionSchema.d.ts +21 -0
- package/dist/src/schemas/ActionSchema.d.ts.map +1 -0
- package/dist/src/schemas/ArticleSchema.d.ts +13 -0
- package/dist/src/schemas/ArticleSchema.d.ts.map +1 -0
- package/dist/src/schemas/ButtonSchema.d.ts +19 -0
- package/dist/src/schemas/ButtonSchema.d.ts.map +1 -0
- package/dist/src/schemas/CardListGridSchema.d.ts +17 -0
- package/dist/src/schemas/CardListGridSchema.d.ts.map +1 -0
- package/dist/src/schemas/ChoiceInputFieldSchema.d.ts +18 -0
- package/dist/src/schemas/ChoiceInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/CodeSchema.d.ts +18 -0
- package/dist/src/schemas/CodeSchema.d.ts.map +1 -0
- package/dist/src/schemas/CollapsibleLayoutSchema.d.ts +32 -0
- package/dist/src/schemas/CollapsibleLayoutSchema.d.ts.map +1 -0
- package/dist/src/schemas/ContainerSchema.d.ts +12 -0
- package/dist/src/schemas/ContainerSchema.d.ts.map +1 -0
- package/dist/src/schemas/ContentSchema.d.ts +21 -0
- package/dist/src/schemas/ContentSchema.d.ts.map +1 -0
- package/dist/src/schemas/CoverImageHeaderSchema.d.ts +28 -0
- package/dist/src/schemas/CoverImageHeaderSchema.d.ts.map +1 -0
- package/dist/src/schemas/FeatureCardSchema.d.ts +28 -0
- package/dist/src/schemas/FeatureCardSchema.d.ts.map +1 -0
- package/dist/src/schemas/FeatureGridSchema.d.ts +17 -0
- package/dist/src/schemas/FeatureGridSchema.d.ts.map +1 -0
- package/dist/src/schemas/FeatureItemSchema.d.ts +16 -0
- package/dist/src/schemas/FeatureItemSchema.d.ts.map +1 -0
- package/dist/src/schemas/FooterItemSchema.d.ts +15 -0
- package/dist/src/schemas/FooterItemSchema.d.ts.map +1 -0
- package/dist/src/schemas/FooterSchema.d.ts +20 -0
- package/dist/src/schemas/FooterSchema.d.ts.map +1 -0
- package/dist/src/schemas/FooterSectionSchema.d.ts +15 -0
- package/dist/src/schemas/FooterSectionSchema.d.ts.map +1 -0
- package/dist/src/schemas/FormBlockSchema.d.ts +19 -0
- package/dist/src/schemas/FormBlockSchema.d.ts.map +1 -0
- package/dist/src/schemas/GridCellSchema.d.ts +23 -0
- package/dist/src/schemas/GridCellSchema.d.ts.map +1 -0
- package/dist/src/schemas/GridLayoutSchema.d.ts +21 -0
- package/dist/src/schemas/GridLayoutSchema.d.ts.map +1 -0
- package/dist/src/schemas/HeaderActionSchema.d.ts +17 -0
- package/dist/src/schemas/HeaderActionSchema.d.ts.map +1 -0
- package/dist/src/schemas/HeroBlockSchema.d.ts +22 -0
- package/dist/src/schemas/HeroBlockSchema.d.ts.map +1 -0
- package/dist/src/schemas/HtmlInputFieldSchema.d.ts +18 -0
- package/dist/src/schemas/HtmlInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/HtmlSchema.d.ts +14 -0
- package/dist/src/schemas/HtmlSchema.d.ts.map +1 -0
- package/dist/src/schemas/ImageSchema.d.ts +32 -0
- package/dist/src/schemas/ImageSchema.d.ts.map +1 -0
- package/dist/src/schemas/LogoSchema.d.ts +35 -0
- package/dist/src/schemas/LogoSchema.d.ts.map +1 -0
- package/dist/src/schemas/MarkdownSchema.d.ts +14 -0
- package/dist/src/schemas/MarkdownSchema.d.ts.map +1 -0
- package/dist/src/schemas/MetadataItemSchema.d.ts +13 -0
- package/dist/src/schemas/MetadataItemSchema.d.ts.map +1 -0
- package/dist/src/schemas/PageBannerHeaderSchema.d.ts +28 -0
- package/dist/src/schemas/PageBannerHeaderSchema.d.ts.map +1 -0
- package/dist/src/schemas/PageTemplateSchema.d.ts +31 -0
- package/dist/src/schemas/PageTemplateSchema.d.ts.map +1 -0
- package/dist/src/schemas/PaletteSwitcherSchema.d.ts +16 -0
- package/dist/src/schemas/PaletteSwitcherSchema.d.ts.map +1 -0
- package/dist/src/schemas/PrintConfigSchema.d.ts +31 -0
- package/dist/src/schemas/PrintConfigSchema.d.ts.map +1 -0
- package/dist/src/schemas/ProductCardSchema.d.ts +39 -0
- package/dist/src/schemas/ProductCardSchema.d.ts.map +1 -0
- package/dist/src/schemas/SafeSpanSchema.d.ts +13 -0
- package/dist/src/schemas/SafeSpanSchema.d.ts.map +1 -0
- package/dist/src/schemas/SectionSchema.d.ts +16 -0
- package/dist/src/schemas/SectionSchema.d.ts.map +1 -0
- package/dist/src/schemas/SelectInputFieldSchema.d.ts +27 -0
- package/dist/src/schemas/SelectInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/SwitchInputFieldSchema.d.ts +18 -0
- package/dist/src/schemas/SwitchInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/TextInputFieldSchema.d.ts +22 -0
- package/dist/src/schemas/TextInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/TextSchema.d.ts +37 -0
- package/dist/src/schemas/TextSchema.d.ts.map +1 -0
- package/dist/src/schemas/ThemeSwitcherSchema.d.ts +19 -0
- package/dist/src/schemas/ThemeSwitcherSchema.d.ts.map +1 -0
- package/dist/src/schemas/ViewSchema.d.ts +66 -0
- package/dist/src/schemas/ViewSchema.d.ts.map +1 -0
- package/dist/src/schemas/index.d.ts +47 -0
- package/dist/src/schemas/index.d.ts.map +1 -0
- package/dist/src/schemas/transformers/ComponentTransformer.d.ts +128 -0
- package/dist/src/schemas/transformers/ComponentTransformer.d.ts.map +1 -0
- package/dist/src/schemas/transformers/ReactNodeTransformer.d.ts +53 -0
- package/dist/src/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -0
- package/dist/src/schemas/transformers/registry.d.ts +18 -0
- package/dist/src/schemas/transformers/registry.d.ts.map +1 -0
- package/dist/src/schemas/types/Serializable.d.ts +46 -0
- package/dist/src/schemas/types/Serializable.d.ts.map +1 -0
- package/dist/src/stories/_templates/SerializationTemplate.d.ts +44 -0
- package/dist/src/stories/_templates/SerializationTemplate.d.ts.map +1 -0
- package/dist/src/templates/TemplateResolver.d.ts +52 -0
- package/dist/src/templates/TemplateResolver.d.ts.map +1 -0
- package/dist/src/templates/index.d.ts +7 -0
- package/dist/src/templates/index.d.ts.map +1 -0
- package/dist/src/types/CacheProvider.d.ts +18 -0
- package/dist/src/types/CacheProvider.d.ts.map +1 -0
- package/dist/src/types/CollapsibleLayout.d.ts +142 -0
- package/dist/src/types/CollapsibleLayout.d.ts.map +1 -0
- package/dist/src/types/ContentProxy.d.ts +47 -0
- package/dist/src/types/ContentProxy.d.ts.map +1 -0
- package/dist/src/types/DataTypes.d.ts +185 -0
- package/dist/src/types/DataTypes.d.ts.map +1 -0
- package/dist/src/types/TemplateProvider.d.ts +10 -0
- package/dist/src/types/TemplateProvider.d.ts.map +1 -0
- package/dist/src/types/TemplateResolver.d.ts +23 -0
- package/dist/src/types/TemplateResolver.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +82 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/utils/breakpoints.d.ts +35 -0
- package/dist/src/utils/breakpoints.d.ts.map +1 -0
- package/dist/src/utils/cssUtils.d.ts +17 -0
- package/dist/src/utils/cssUtils.d.ts.map +1 -0
- package/dist/src/utils/customPaletteManager.d.ts +8 -0
- package/dist/src/utils/customPaletteManager.d.ts.map +1 -0
- package/dist/src/utils/dimensions.d.ts +34 -0
- package/dist/src/utils/dimensions.d.ts.map +1 -0
- package/dist/src/utils/htmlTransform.d.ts +44 -0
- package/dist/src/utils/htmlTransform.d.ts.map +1 -0
- package/dist/src/utils/index.d.ts +16 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/logger.d.ts +26 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/src/utils/paletteUtils.d.ts +38 -0
- package/dist/src/utils/paletteUtils.d.ts.map +1 -0
- package/dist/src/utils/persistenceUtils.d.ts +31 -0
- package/dist/src/utils/persistenceUtils.d.ts.map +1 -0
- package/dist/src/utils/reactUtils.d.ts +33 -0
- package/dist/src/utils/reactUtils.d.ts.map +1 -0
- package/dist/src/utils/spacing.d.ts +34 -0
- package/dist/src/utils/spacing.d.ts.map +1 -0
- package/dist/src/utils/themePerformanceMonitor.d.ts +32 -0
- package/dist/src/utils/themePerformanceMonitor.d.ts.map +1 -0
- package/dist/src/utils/themeUtils.d.ts +27 -0
- package/dist/src/utils/themeUtils.d.ts.map +1 -0
- package/dist/utils/cssUtils.d.ts +17 -0
- package/dist/utils/cssUtils.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +5 -2
- package/scripts/bundle-css.cjs +27 -0
- package/scripts/create-project.sh +28 -0
- package/scripts/create-qwickapps-project.js +284 -0
- package/src/__tests__/components/base/Container.test.tsx +966 -0
- package/src/__tests__/schemas/PageTemplateSchema.test.ts +1 -1
- package/src/__tests__/schemas/ViewSchema.test.ts +805 -0
- package/src/__tests__/schemas/builders.test.ts +2 -2
- package/src/__tests__/schemas/transformers/ComponentTransformer.test.ts +19 -19
- package/src/__tests__/schemas/transformers/CrossBrowserCompatibility.test.ts +13 -13
- package/src/__tests__/schemas/transformers/SerializationErrorHandling.test.ts +39 -39
- package/src/__tests__/schemas/transformers/SerializationPerformance.test.ts +14 -14
- package/src/__tests__/schemas/transformers/TestAutomation.test.ts +8 -8
- package/src/__tests__/schemas/transformers/nested-serialization.test.tsx +181 -0
- package/src/__tests__/schemas/transformers/round-trip-component-serialization.test.tsx +458 -0
- package/src/__tests__/test_image_accessibility.test.tsx +226 -0
- package/src/__tests__/utils/optional-logging.test.ts +3 -3
- package/src/components/Html.tsx +24 -15
- package/src/components/Logo.tsx +2 -2
- package/src/components/Markdown.tsx +2 -7
- package/src/components/SafeSpan.tsx +2 -7
- package/src/components/base/Container.tsx +61 -0
- package/src/components/base/ModelView.tsx +225 -91
- package/src/components/base/index.ts +3 -2
- package/src/components/blocks/Article.tsx +2 -7
- package/src/components/blocks/CardListGrid.tsx +2 -2
- package/src/components/blocks/Code.tsx +91 -179
- package/src/components/blocks/Content.tsx +2 -2
- package/src/components/blocks/CoverImageHeader.tsx +2 -2
- package/src/components/blocks/HeroBlock.tsx +54 -146
- package/src/components/blocks/Image.tsx +82 -196
- package/src/components/blocks/PageBannerHeader.tsx +2 -2
- package/src/components/blocks/Section.tsx +79 -181
- package/src/components/blocks/Text.tsx +100 -198
- package/src/components/buttons/Button.tsx +85 -183
- package/src/components/buttons/PaletteSwitcher.tsx +2 -2
- package/src/components/buttons/ThemeSwitcher.tsx +2 -2
- package/src/components/forms/FormBlock.tsx +2 -2
- package/src/components/index.ts +5 -0
- package/src/components/input/ChoiceInputField.tsx +76 -160
- package/src/components/input/HtmlInputField.tsx +141 -264
- package/src/components/input/SelectInputField.tsx +48 -153
- package/src/components/input/SwitchInputField.tsx +41 -139
- package/src/components/input/TextInputField.tsx +39 -116
- package/src/components/layout/GridCell.tsx +36 -122
- package/src/components/layout/GridLayout.tsx +55 -127
- package/src/components/pages/Page.tsx +268 -276
- package/src/components/pages/index.ts +2 -3
- package/src/components/shared/createSerializableView.tsx +280 -0
- package/src/components/shared/viewProps.ts +207 -0
- package/src/config/__tests__/AppConfigBuilder.test.ts +2 -2
- package/src/contexts/DataContext.tsx +1 -1
- package/src/schemas/ButtonSchema.ts +3 -2
- package/src/schemas/CardListGridSchema.ts +3 -2
- package/src/schemas/ChoiceInputFieldSchema.ts +3 -2
- package/src/schemas/CodeSchema.ts +8 -6
- package/src/schemas/ContainerSchema.ts +25 -0
- package/src/schemas/FeatureCardSchema.ts +1 -1
- package/src/schemas/FormBlockSchema.ts +3 -2
- package/src/schemas/GridCellSchema.ts +4 -10
- package/src/schemas/GridLayoutSchema.ts +8 -14
- package/src/schemas/HeroBlockSchema.ts +3 -2
- package/src/schemas/HtmlInputFieldSchema.ts +3 -2
- package/src/schemas/ImageSchema.ts +3 -2
- package/src/schemas/PageTemplateSchema.ts +5 -5
- package/src/schemas/SectionSchema.ts +4 -12
- package/src/schemas/SelectInputFieldSchema.ts +3 -2
- package/src/schemas/SwitchInputFieldSchema.ts +2 -2
- package/src/schemas/TextInputFieldSchema.ts +3 -2
- package/src/schemas/ViewSchema.ts +570 -0
- package/src/schemas/index.ts +1 -1
- package/src/schemas/transformers/ComponentTransformer.ts +185 -163
- package/src/schemas/transformers/ReactNodeTransformer.ts +31 -28
- package/src/schemas/transformers/registry.ts +17 -10
- package/src/stories/Button.stories.tsx +24 -0
- package/src/stories/ChoiceInputField.stories.tsx +28 -1
- package/src/stories/Code.stories.tsx +61 -1
- package/src/stories/Container.stories.tsx +954 -0
- package/src/stories/FormBlock.stories.tsx +54 -0
- package/src/stories/FormComponents.stories.tsx +8 -13
- package/src/stories/GridCell.stories.tsx +23 -64
- package/src/stories/GridLayout.stories.tsx +22 -47
- package/src/stories/HeroBlock.stories.tsx +28 -0
- package/src/stories/HtmlInputField.stories.tsx +23 -1
- package/src/stories/Image.stories.tsx +45 -233
- package/src/stories/Markdown.stories.tsx +1 -1
- package/src/stories/Section.stories.tsx +38 -4
- package/src/stories/SelectInputField.stories.tsx +26 -1
- package/src/stories/Text.stories.tsx +22 -54
- package/src/stories/TextInputField.stories.tsx +24 -1
- package/src/stories/_templates/SerializationTemplate.tsx +165 -0
- package/src/templates/TemplateResolver.ts +2 -2
- package/src/types/CollapsibleLayout.ts +2 -2
- package/src/utils/cssUtils.ts +49 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/logger.ts +13 -13
- package/src/__tests__/components/base/ModelView.test.tsx +0 -220
- package/src/__tests__/schemas/ViewModelSchema.test.ts +0 -80
- package/src/components/blocks/Code.md +0 -529
- package/src/schemas/README.md +0 -661
- package/src/schemas/ViewModelSchema.ts +0 -115
- package/src/tests/ConsoleWarningTest.tsx +0 -30
- package/src/tests/StorageKeyTest.tsx +0 -110
- package/src/tests/ThemeStorageKeyTest.tsx +0 -114
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* GridCell -
|
|
2
|
+
* GridCell - Factory-based implementation using createSerializableView
|
|
3
|
+
*
|
|
4
|
+
* Migrated from class-based ModelView to factory pattern for better
|
|
5
|
+
* schema-driven architecture while preserving all functionality.
|
|
3
6
|
*
|
|
4
7
|
* A lightweight wrapper that applies grid props to any content
|
|
5
8
|
* Uses the base props pattern for consistency
|
|
6
|
-
* Full serialization support
|
|
9
|
+
* Full serialization support
|
|
7
10
|
*
|
|
8
11
|
* Usage:
|
|
9
12
|
* - Traditional: <GridCell span={6} background="primary">...</GridCell>
|
|
10
13
|
* - Data-driven: <GridCell dataSource="layout.cell" />
|
|
11
|
-
* - Serializable: ComponentTransformer.serialize(<GridCell ... />)
|
|
12
14
|
*
|
|
13
15
|
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
14
16
|
*/
|
|
15
17
|
|
|
16
|
-
import React
|
|
18
|
+
import React from 'react';
|
|
17
19
|
import { Box } from '@mui/material';
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
import { useDataBinding } from '../../hooks';
|
|
21
|
-
import GridCellModel from '../../schemas/GridCellSchema';
|
|
22
|
-
import { ModelView } from '../base/ModelView';
|
|
23
|
-
import { ComponentTransformer } from '../../schemas/transformers/ComponentTransformer';
|
|
24
|
-
|
|
25
|
-
type GridCellViewProps = ModelProps<GridCellModel>;
|
|
20
|
+
import { createSerializableView, SerializableComponent } from '../shared/createSerializableView';
|
|
21
|
+
import { ViewProps } from '../shared/viewProps';
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
(GridCellView as any)[QWICKAPP_COMPONENT] = true;
|
|
23
|
+
/**
|
|
24
|
+
* Props interface for GridCell component - extends ViewProps
|
|
25
|
+
*/
|
|
26
|
+
export interface GridCellProps extends ViewProps {
|
|
27
|
+
// Note: Grid responsive properties (span, xs, sm, md, lg, xl) are inherited from ViewProps
|
|
28
|
+
// Additional styling properties that might not be in ViewProps
|
|
29
|
+
}
|
|
35
30
|
|
|
31
|
+
/**
|
|
32
|
+
* GridCellView - Pure view component that renders the actual grid cell
|
|
33
|
+
*
|
|
34
|
+
* This component receives fully processed props from createSerializableView
|
|
35
|
+
* and renders the grid cell using Material-UI Box with all styling applied.
|
|
36
|
+
*/
|
|
37
|
+
function GridCellView({ children, gridProps, ...props }: GridCellProps & { gridProps?: any }) {
|
|
36
38
|
return (
|
|
37
39
|
<Box
|
|
38
|
-
{...
|
|
39
|
-
{...styleProps}
|
|
40
|
-
{...restProps}
|
|
40
|
+
{...props}
|
|
41
41
|
// Store grid props as data attributes for GridLayout to pick up
|
|
42
42
|
{...(gridProps && {
|
|
43
43
|
'data-grid-span': gridProps.span,
|
|
@@ -48,108 +48,22 @@ function GridCellView(props: GridCellViewProps) {
|
|
|
48
48
|
'data-grid-xl': gridProps.xl,
|
|
49
49
|
})}
|
|
50
50
|
>
|
|
51
|
-
{
|
|
51
|
+
{children}
|
|
52
52
|
</Box>
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Component-specific serialization properties
|
|
68
|
-
protected getComponentSpecificProps(): any {
|
|
69
|
-
return {
|
|
70
|
-
// Grid responsive properties
|
|
71
|
-
span: this.props.span,
|
|
72
|
-
xs: this.props.xs,
|
|
73
|
-
sm: this.props.sm,
|
|
74
|
-
md: this.props.md,
|
|
75
|
-
lg: this.props.lg,
|
|
76
|
-
xl: this.props.xl,
|
|
77
|
-
// Styling properties
|
|
78
|
-
background: this.props.background,
|
|
79
|
-
padding: this.props.padding,
|
|
80
|
-
margin: this.props.margin,
|
|
81
|
-
height: this.props.height,
|
|
82
|
-
width: this.props.width,
|
|
83
|
-
className: this.props.className
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// GridCell supports nested components
|
|
88
|
-
protected hasNestedComponents(children: ReactNode): boolean {
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Override serializeChildren to handle nested components properly
|
|
93
|
-
protected serializeChildren(children: ReactNode): any {
|
|
94
|
-
if (typeof children === 'string') {
|
|
95
|
-
return children;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (children !== undefined) {
|
|
99
|
-
return ComponentTransformer.serialize(children);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return undefined;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// GridCell component renders traditional props view
|
|
106
|
-
protected renderView(): React.ReactElement {
|
|
107
|
-
const { dataSource, bindingOptions, ...restProps } = this.props;
|
|
108
|
-
return <GridCellView {...restProps} />;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// GridCell component renders data-bound view
|
|
112
|
-
protected renderWithDataBinding(): React.ReactElement {
|
|
113
|
-
return <GridCellWithDataBinding {...this.props} />;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// Helper component to handle data binding with hooks (since we can't use hooks in class components)
|
|
118
|
-
function GridCellWithDataBinding(props: GridCellProps) {
|
|
119
|
-
const { dataSource, bindingOptions, ...restProps } = props;
|
|
120
|
-
|
|
121
|
-
// Use data binding
|
|
122
|
-
const { dataSource: _source, loading, error, cached, ...cellProps } = useDataBinding<GridCellModel>(
|
|
123
|
-
dataSource!,
|
|
124
|
-
restProps as Partial<GridCellModel>,
|
|
125
|
-
GridCellModel.getSchema(),
|
|
126
|
-
{ cache: true, cacheTTL: 300000, strict: false, ...bindingOptions }
|
|
127
|
-
);
|
|
128
|
-
|
|
129
|
-
// Show loading state
|
|
130
|
-
if (loading) {
|
|
131
|
-
return (
|
|
132
|
-
<Box sx={{ p: 2, textAlign: 'center', opacity: 0.6 }}>
|
|
133
|
-
Loading Cell...
|
|
134
|
-
</Box>
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
if (error) {
|
|
139
|
-
console.error('Error loading grid cell:', error);
|
|
140
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
141
|
-
return (
|
|
142
|
-
<Box sx={{ p: 2, textAlign: 'center', borderColor: 'error.main', border: 1 }}>
|
|
143
|
-
Error Loading Cell: {error.message}
|
|
144
|
-
</Box>
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
return null;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
console.log('Resolved props for GridCell:', cellProps);
|
|
151
|
-
return <GridCellView {...cellProps} />;
|
|
152
|
-
}
|
|
153
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Create GridCell component using the factory pattern
|
|
58
|
+
*/
|
|
59
|
+
export const GridCell: SerializableComponent<GridCellProps> = createSerializableView<GridCellProps>({
|
|
60
|
+
tagName: 'GridCell',
|
|
61
|
+
version: '1.0.0',
|
|
62
|
+
role: 'container',
|
|
63
|
+
View: GridCellView
|
|
64
|
+
});
|
|
154
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Export the component as default
|
|
68
|
+
*/
|
|
155
69
|
export default GridCell;
|
|
@@ -1,39 +1,58 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* GridLayout -
|
|
2
|
+
* GridLayout - Factory-based implementation using createSerializableView
|
|
3
|
+
*
|
|
4
|
+
* Migrated from class-based ModelView to factory pattern for better
|
|
5
|
+
* schema-driven architecture while preserving all functionality.
|
|
3
6
|
*
|
|
4
7
|
* Works with any component that has grid props (span, xs, sm, md, lg, xl)
|
|
5
8
|
* Automatically wraps components in Grid when grid props are detected
|
|
6
|
-
* Full serialization support
|
|
9
|
+
* Full serialization support
|
|
7
10
|
*
|
|
8
11
|
* Usage:
|
|
9
12
|
* - Traditional: <GridLayout columns={3} spacing="medium">...</GridLayout>
|
|
10
13
|
* - Data-driven: <GridLayout dataSource="layouts.main" />
|
|
11
|
-
* - Serializable: ComponentTransformer.serialize(<GridLayout ... />)
|
|
12
14
|
*
|
|
13
15
|
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
14
16
|
*/
|
|
15
17
|
|
|
16
|
-
import React
|
|
18
|
+
import React from 'react';
|
|
17
19
|
import { Grid, SxProps, Theme } from '@mui/material';
|
|
18
|
-
import type { WithDataBinding, ModelProps } from '@qwickapps/schema';
|
|
19
20
|
import { SpacingValue, resolveSpacing } from '../../utils/spacing';
|
|
20
21
|
import { DimensionValue, resolveDimension } from '../../utils/dimensions';
|
|
21
22
|
import { QWICKAPP_COMPONENT } from '../../hooks/useBaseProps';
|
|
22
|
-
import {
|
|
23
|
-
import
|
|
24
|
-
import { ModelView } from '../base/ModelView';
|
|
25
|
-
import { ComponentTransformer } from '../../schemas/transformers/ComponentTransformer';
|
|
26
|
-
|
|
27
|
-
type GridLayoutViewProps = ModelProps<GridLayoutModel> & {
|
|
28
|
-
/** Custom styles */
|
|
29
|
-
sx?: SxProps<Theme>;
|
|
30
|
-
/** Inline styles */
|
|
31
|
-
style?: React.CSSProperties;
|
|
32
|
-
};
|
|
23
|
+
import { createSerializableView, SerializableComponent } from '../shared/createSerializableView';
|
|
24
|
+
import { ViewProps } from '../shared/viewProps';
|
|
33
25
|
|
|
34
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Props interface for GridLayout component - extends ViewProps
|
|
28
|
+
*/
|
|
29
|
+
export interface GridLayoutProps extends ViewProps {
|
|
30
|
+
/** Number of equal-width columns for auto-distribution */
|
|
31
|
+
columns?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
32
|
+
/** Spacing between grid items */
|
|
33
|
+
spacing?: string;
|
|
34
|
+
/** Make all grid items the same height */
|
|
35
|
+
equalHeight?: boolean;
|
|
36
|
+
/** Grid container height */
|
|
37
|
+
height?: string;
|
|
38
|
+
/** Grid container width */
|
|
39
|
+
width?: string;
|
|
40
|
+
/** Minimum grid container height */
|
|
41
|
+
minHeight?: string;
|
|
42
|
+
/** Minimum grid container width */
|
|
43
|
+
minWidth?: string;
|
|
44
|
+
/** Maximum grid container height */
|
|
45
|
+
maxHeight?: string;
|
|
46
|
+
/** Maximum grid container width */
|
|
47
|
+
maxWidth?: string;
|
|
48
|
+
}
|
|
35
49
|
|
|
36
|
-
|
|
50
|
+
/**
|
|
51
|
+
* GridLayoutView - Pure view component that renders the actual grid layout
|
|
52
|
+
*
|
|
53
|
+
* This component receives fully processed props from createSerializableView
|
|
54
|
+
* and renders the grid layout using Material-UI Grid with all styling applied.
|
|
55
|
+
*/
|
|
37
56
|
function GridLayoutView({
|
|
38
57
|
children,
|
|
39
58
|
columns,
|
|
@@ -45,13 +64,9 @@ function GridLayoutView({
|
|
|
45
64
|
minWidth,
|
|
46
65
|
maxHeight,
|
|
47
66
|
maxWidth,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
...restProps
|
|
52
|
-
}: GridLayoutViewProps) {
|
|
53
|
-
// Mark as QwickApp component
|
|
54
|
-
(GridLayoutView as any)[QWICKAPP_COMPONENT] = true;
|
|
67
|
+
gridProps,
|
|
68
|
+
...props
|
|
69
|
+
}: GridLayoutProps & { gridProps?: any }) {
|
|
55
70
|
|
|
56
71
|
const resolvedSpacing = resolveSpacing(spacing, 'gap');
|
|
57
72
|
|
|
@@ -139,7 +154,8 @@ function GridLayoutView({
|
|
|
139
154
|
<Grid
|
|
140
155
|
container
|
|
141
156
|
spacing={resolvedSpacing}
|
|
142
|
-
|
|
157
|
+
{...props}
|
|
158
|
+
{...(gridProps && { 'data-grid': JSON.stringify(gridProps) })}
|
|
143
159
|
sx={{
|
|
144
160
|
width: '100%', // Ensure full width by default in MUI v6
|
|
145
161
|
height: resolveDimension(height, 'height'),
|
|
@@ -158,113 +174,25 @@ function GridLayoutView({
|
|
|
158
174
|
},
|
|
159
175
|
},
|
|
160
176
|
}),
|
|
161
|
-
...sx,
|
|
177
|
+
...props.sx,
|
|
162
178
|
}}
|
|
163
|
-
style={style}
|
|
164
179
|
>
|
|
165
180
|
{processChildren()}
|
|
166
181
|
</Grid>
|
|
167
182
|
);
|
|
168
183
|
}
|
|
169
184
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
// Component-specific serialization properties
|
|
182
|
-
protected getComponentSpecificProps(): any {
|
|
183
|
-
return {
|
|
184
|
-
columns: this.props.columns,
|
|
185
|
-
spacing: this.props.spacing,
|
|
186
|
-
equalHeight: this.props.equalHeight,
|
|
187
|
-
height: this.props.height,
|
|
188
|
-
width: this.props.width,
|
|
189
|
-
minHeight: this.props.minHeight,
|
|
190
|
-
minWidth: this.props.minWidth,
|
|
191
|
-
maxHeight: this.props.maxHeight,
|
|
192
|
-
maxWidth: this.props.maxWidth,
|
|
193
|
-
className: this.props.className,
|
|
194
|
-
style: this.props.style,
|
|
195
|
-
sx: this.props.sx
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// GridLayout supports nested components
|
|
200
|
-
protected hasNestedComponents(children: ReactNode): boolean {
|
|
201
|
-
return true;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// Override serializeChildren to handle nested components properly
|
|
205
|
-
protected serializeChildren(children: ReactNode): any {
|
|
206
|
-
if (typeof children === 'string') {
|
|
207
|
-
return children;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
if (children !== undefined) {
|
|
211
|
-
return ComponentTransformer.serialize(children);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
return undefined;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// GridLayout component renders traditional props view
|
|
218
|
-
protected renderView(): React.ReactElement {
|
|
219
|
-
const { dataSource, bindingOptions, ...restProps } = this.props;
|
|
220
|
-
return <GridLayoutView {...restProps} />;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// GridLayout component renders data-bound view
|
|
224
|
-
protected renderWithDataBinding(): React.ReactElement {
|
|
225
|
-
return <GridLayoutWithDataBinding {...this.props} />;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
// Helper component to handle data binding with hooks (since we can't use hooks in class components)
|
|
230
|
-
function GridLayoutWithDataBinding(props: GridLayoutProps) {
|
|
231
|
-
const { dataSource, bindingOptions, ...restProps } = props;
|
|
232
|
-
|
|
233
|
-
// Use data binding
|
|
234
|
-
const { dataSource: _source, loading, error, cached, ...gridProps } = useDataBinding<GridLayoutModel>(
|
|
235
|
-
dataSource!,
|
|
236
|
-
restProps as Partial<GridLayoutModel>,
|
|
237
|
-
GridLayoutModel.getSchema(),
|
|
238
|
-
{ cache: true, cacheTTL: 300000, strict: false, ...bindingOptions }
|
|
239
|
-
);
|
|
240
|
-
|
|
241
|
-
// Show loading state
|
|
242
|
-
if (loading) {
|
|
243
|
-
return (
|
|
244
|
-
<Grid container sx={{ p: 3, textAlign: 'center' }}>
|
|
245
|
-
<Grid size={12}>
|
|
246
|
-
Loading Grid Layout...
|
|
247
|
-
</Grid>
|
|
248
|
-
</Grid>
|
|
249
|
-
);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
if (error) {
|
|
253
|
-
console.error('Error loading grid layout:', error);
|
|
254
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
255
|
-
return (
|
|
256
|
-
<Grid container sx={{ p: 3, textAlign: 'center', borderColor: 'error.main', border: 1 }}>
|
|
257
|
-
<Grid size={12}>
|
|
258
|
-
Error Loading Grid Layout: {error.message}
|
|
259
|
-
</Grid>
|
|
260
|
-
</Grid>
|
|
261
|
-
);
|
|
262
|
-
}
|
|
263
|
-
return null;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
console.log('Resolved props for GridLayout:', gridProps);
|
|
267
|
-
return <GridLayoutView {...gridProps} />;
|
|
268
|
-
}
|
|
185
|
+
/**
|
|
186
|
+
* Create GridLayout component using the factory pattern
|
|
187
|
+
*/
|
|
188
|
+
export const GridLayout: SerializableComponent<GridLayoutProps> = createSerializableView<GridLayoutProps>({
|
|
189
|
+
tagName: 'GridLayout',
|
|
190
|
+
version: '1.0.0',
|
|
191
|
+
role: 'container',
|
|
192
|
+
View: GridLayoutView
|
|
193
|
+
});
|
|
269
194
|
|
|
195
|
+
/**
|
|
196
|
+
* Export the component as default
|
|
197
|
+
*/
|
|
270
198
|
export default GridLayout;
|