@pixelated-tech/components 3.1.4
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 +231 -0
- package/dist/components/buzzwordbingo/buzzwordbingo.css +42 -0
- package/dist/components/buzzwordbingo/buzzwordbingo.js +35 -0
- package/dist/components/callout/callout.js +95 -0
- package/dist/components/callout/callout.scss +331 -0
- package/dist/components/carousel/carousel.css +178 -0
- package/dist/components/carousel/carousel.drag.js +203 -0
- package/dist/components/carousel/carousel.js +124 -0
- package/dist/components/cms/calendly.js +20 -0
- package/dist/components/cms/cloudinary.image.js +132 -0
- package/dist/components/cms/cloudinary.js +106 -0
- package/dist/components/cms/contentful.delivery.js +247 -0
- package/dist/components/cms/contentful.items.components.js +243 -0
- package/dist/components/cms/contentful.items.css +131 -0
- package/dist/components/cms/contentful.management.js +254 -0
- package/dist/components/cms/flickr.js +160 -0
- package/dist/components/cms/google.reviews.components.js +36 -0
- package/dist/components/cms/google.reviews.functions.js +26 -0
- package/dist/components/cms/gravatar.components.js +41 -0
- package/dist/components/cms/gravatar.functions.js +52 -0
- package/dist/components/cms/hubspot.components.js +45 -0
- package/dist/components/cms/hubspot.js +34 -0
- package/dist/components/cms/instagram.components.js +40 -0
- package/dist/components/cms/instagram.functions.js +67 -0
- package/dist/components/cms/wordpress.components.js +47 -0
- package/dist/components/cms/wordpress.css +55 -0
- package/dist/components/cms/wordpress.functions.js +49 -0
- package/dist/components/config/config.client.js +22 -0
- package/dist/components/config/config.example.js +70 -0
- package/dist/components/config/config.js +53 -0
- package/dist/components/config/config.server.js +11 -0
- package/dist/components/config/config.types.js +2 -0
- package/dist/components/general/css.js +60 -0
- package/dist/components/general/headers.css +16 -0
- package/dist/components/general/headers.js +27 -0
- package/dist/components/general/image.js +81 -0
- package/dist/components/general/layout.js +147 -0
- package/dist/components/general/layout.scss +47 -0
- package/dist/components/general/loading.js +36 -0
- package/dist/components/general/loading.scss +80 -0
- package/dist/components/general/microinteractions.css +229 -0
- package/dist/components/general/microinteractions.js +87 -0
- package/dist/components/general/modal.css +65 -0
- package/dist/components/general/modal.js +52 -0
- package/dist/components/general/table.css +73 -0
- package/dist/components/general/table.js +108 -0
- package/dist/components/linkedin/pixelated.linkedin.js +180 -0
- package/dist/components/linkedin/pixelated.linkedin1.js +102 -0
- package/dist/components/linkedin/pixelated.linkedin2.js +92 -0
- package/dist/components/markdown/markdown.css +12 -0
- package/dist/components/markdown/markdown.js +39 -0
- package/dist/components/menu/menu-accordion.css +198 -0
- package/dist/components/menu/menu-accordion.js +183 -0
- package/dist/components/menu/menu-expando.css +127 -0
- package/dist/components/menu/menu-expando.js +48 -0
- package/dist/components/menu/menu-simple.css +76 -0
- package/dist/components/menu/menu-simple.js +56 -0
- package/dist/components/nerdjoke/nerdjoke.css +69 -0
- package/dist/components/nerdjoke/nerdjoke.js +95 -0
- package/dist/components/pagebuilder/components/ComponentPropertiesForm.js +15 -0
- package/dist/components/pagebuilder/components/ComponentSelector.js +67 -0
- package/dist/components/pagebuilder/components/ComponentTree.js +95 -0
- package/dist/components/pagebuilder/components/PageBuilderUI.js +48 -0
- package/dist/components/pagebuilder/components/PageEngine.js +97 -0
- package/dist/components/pagebuilder/components/SaveLoadSection.js +168 -0
- package/dist/components/pagebuilder/components/pagebuilder.scss +123 -0
- package/dist/components/pagebuilder/form/form.css +101 -0
- package/dist/components/pagebuilder/form/form.js +455 -0
- package/dist/components/pagebuilder/form/form.submit.js +65 -0
- package/dist/components/pagebuilder/form/formcomponents.js +359 -0
- package/dist/components/pagebuilder/form/formvalidations.js +80 -0
- package/dist/components/pagebuilder/lib/componentGeneration.js +105 -0
- package/dist/components/pagebuilder/lib/componentMap.js +32 -0
- package/dist/components/pagebuilder/lib/componentMetadata.js +146 -0
- package/dist/components/pagebuilder/lib/pageStorageContentful.js +142 -0
- package/dist/components/pagebuilder/lib/pageStorageLocal.js +143 -0
- package/dist/components/pagebuilder/lib/pageStorageTypes.js +1 -0
- package/dist/components/pagebuilder/lib/propTypeIntrospection.js +177 -0
- package/dist/components/pagebuilder/lib/types.js +4 -0
- package/dist/components/pagebuilder/lib/usePageBuilder.js +234 -0
- package/dist/components/recipe/recipe.css +107 -0
- package/dist/components/recipe/recipe.js +161 -0
- package/dist/components/resume/resume.css +162 -0
- package/dist/components/resume/resume.js +195 -0
- package/dist/components/seo/404.css +25 -0
- package/dist/components/seo/404.js +32 -0
- package/dist/components/seo/googleanalytics.js +70 -0
- package/dist/components/seo/googlemap.js +15 -0
- package/dist/components/seo/googlesearch.css +30 -0
- package/dist/components/seo/googlesearch.js +37 -0
- package/dist/components/seo/metadata.js +156 -0
- package/dist/components/seo/sitemap.js +171 -0
- package/dist/components/shoppingcart/ebay.components.js +203 -0
- package/dist/components/shoppingcart/ebay.css +131 -0
- package/dist/components/shoppingcart/ebay.functions.js +240 -0
- package/dist/components/shoppingcart/paypal.js +169 -0
- package/dist/components/shoppingcart/shoppingcart.components.js +257 -0
- package/dist/components/shoppingcart/shoppingcart.css +122 -0
- package/dist/components/shoppingcart/shoppingcart.functions.js +324 -0
- package/dist/components/sidepanel/sidepanel.css +129 -0
- package/dist/components/sidepanel/sidepanel.js +54 -0
- package/dist/components/socialcard/socialcard.css +118 -0
- package/dist/components/socialcard/socialcard.js +317 -0
- package/dist/components/tiles/tiles.css +77 -0
- package/dist/components/tiles/tiles.js +38 -0
- package/dist/components/timeline/timeline.css +139 -0
- package/dist/components/timeline/timeline.js +28 -0
- package/dist/components/utilities/api.js +36 -0
- package/dist/components/utilities/functions.js +98 -0
- package/dist/components/yelp/yelp.js +50 -0
- package/dist/css/pixelated.font.scss +68 -0
- package/dist/css/pixelated.global.css +548 -0
- package/dist/css/pixelated.grid.scss +82 -0
- package/dist/data/404-data.json +104 -0
- package/dist/data/buzzwords.js +28 -0
- package/dist/data/form.json +370 -0
- package/dist/data/recipes.json +1917 -0
- package/dist/data/references.json +139 -0
- package/dist/data/requests.json +137 -0
- package/dist/data/resume.json +2577 -0
- package/dist/data/routes.json +184 -0
- package/dist/data/routes2.json +117 -0
- package/dist/data/shipping.to.json +422 -0
- package/dist/index.js +78 -0
- package/dist/index.server.js +35 -0
- package/dist/types/components/buzzwordbingo/buzzwordbingo.d.ts +26 -0
- package/dist/types/components/buzzwordbingo/buzzwordbingo.d.ts.map +1 -0
- package/dist/types/components/callout/callout.d.ts +53 -0
- package/dist/types/components/callout/callout.d.ts.map +1 -0
- package/dist/types/components/carousel/carousel.d.ts +28 -0
- package/dist/types/components/carousel/carousel.d.ts.map +1 -0
- package/dist/types/components/carousel/carousel.drag.d.ts +12 -0
- package/dist/types/components/carousel/carousel.drag.d.ts.map +1 -0
- package/dist/types/components/cms/calendly.d.ts +11 -0
- package/dist/types/components/cms/calendly.d.ts.map +1 -0
- package/dist/types/components/cms/cloudinary.d.ts +27 -0
- package/dist/types/components/cms/cloudinary.d.ts.map +1 -0
- package/dist/types/components/cms/cloudinary.image.d.ts +56 -0
- package/dist/types/components/cms/cloudinary.image.d.ts.map +1 -0
- package/dist/types/components/cms/contentful.delivery.d.ts +149 -0
- package/dist/types/components/cms/contentful.delivery.d.ts.map +1 -0
- package/dist/types/components/cms/contentful.items.components.d.ts +38 -0
- package/dist/types/components/cms/contentful.items.components.d.ts.map +1 -0
- package/dist/types/components/cms/contentful.management.d.ts +71 -0
- package/dist/types/components/cms/contentful.management.d.ts.map +1 -0
- package/dist/types/components/cms/flickr.d.ts +39 -0
- package/dist/types/components/cms/flickr.d.ts.map +1 -0
- package/dist/types/components/cms/google.reviews.components.d.ts +7 -0
- package/dist/types/components/cms/google.reviews.components.d.ts.map +1 -0
- package/dist/types/components/cms/google.reviews.functions.d.ts +25 -0
- package/dist/types/components/cms/google.reviews.functions.d.ts.map +1 -0
- package/dist/types/components/cms/gravatar.components.d.ts +26 -0
- package/dist/types/components/cms/gravatar.components.d.ts.map +1 -0
- package/dist/types/components/cms/gravatar.functions.d.ts +53 -0
- package/dist/types/components/cms/gravatar.functions.d.ts.map +1 -0
- package/dist/types/components/cms/hubspot.components.d.ts +15 -0
- package/dist/types/components/cms/hubspot.components.d.ts.map +1 -0
- package/dist/types/components/cms/hubspot.d.ts +18 -0
- package/dist/types/components/cms/hubspot.d.ts.map +1 -0
- package/dist/types/components/cms/instagram.components.d.ts +10 -0
- package/dist/types/components/cms/instagram.components.d.ts.map +1 -0
- package/dist/types/components/cms/instagram.functions.d.ts +63 -0
- package/dist/types/components/cms/instagram.functions.d.ts.map +1 -0
- package/dist/types/components/cms/wordpress.components.d.ts +11 -0
- package/dist/types/components/cms/wordpress.components.d.ts.map +1 -0
- package/dist/types/components/cms/wordpress.functions.d.ts +28 -0
- package/dist/types/components/cms/wordpress.functions.d.ts.map +1 -0
- package/dist/types/components/config/config.client.d.ts +13 -0
- package/dist/types/components/config/config.client.d.ts.map +1 -0
- package/dist/types/components/config/config.d.ts +12 -0
- package/dist/types/components/config/config.d.ts.map +1 -0
- package/dist/types/components/config/config.example.d.ts +4 -0
- package/dist/types/components/config/config.example.d.ts.map +1 -0
- package/dist/types/components/config/config.server.d.ts +7 -0
- package/dist/types/components/config/config.server.d.ts.map +1 -0
- package/dist/types/components/config/config.types.d.ts +84 -0
- package/dist/types/components/config/config.types.d.ts.map +1 -0
- package/dist/types/components/general/css.d.ts +3 -0
- package/dist/types/components/general/css.d.ts.map +1 -0
- package/dist/types/components/general/headers.d.ts +19 -0
- package/dist/types/components/general/headers.d.ts.map +1 -0
- package/dist/types/components/general/image.d.ts +3 -0
- package/dist/types/components/general/image.d.ts.map +1 -0
- package/dist/types/components/general/layout.d.ts +73 -0
- package/dist/types/components/general/layout.d.ts.map +1 -0
- package/dist/types/components/general/loading.d.ts +11 -0
- package/dist/types/components/general/loading.d.ts.map +1 -0
- package/dist/types/components/general/microinteractions.d.ts +20 -0
- package/dist/types/components/general/microinteractions.d.ts.map +1 -0
- package/dist/types/components/general/modal.d.ts +8 -0
- package/dist/types/components/general/modal.d.ts.map +1 -0
- package/dist/types/components/general/table.d.ts +12 -0
- package/dist/types/components/general/table.d.ts.map +1 -0
- package/dist/types/components/linkedin/pixelated.linkedin.d.ts +2 -0
- package/dist/types/components/linkedin/pixelated.linkedin.d.ts.map +1 -0
- package/dist/types/components/linkedin/pixelated.linkedin1.d.ts +2 -0
- package/dist/types/components/linkedin/pixelated.linkedin1.d.ts.map +1 -0
- package/dist/types/components/linkedin/pixelated.linkedin2.d.ts +2 -0
- package/dist/types/components/linkedin/pixelated.linkedin2.d.ts.map +1 -0
- package/dist/types/components/markdown/markdown.d.ts +12 -0
- package/dist/types/components/markdown/markdown.d.ts.map +1 -0
- package/dist/types/components/menu/menu-accordion.d.ts +44 -0
- package/dist/types/components/menu/menu-accordion.d.ts.map +1 -0
- package/dist/types/components/menu/menu-expando.d.ts +20 -0
- package/dist/types/components/menu/menu-expando.d.ts.map +1 -0
- package/dist/types/components/menu/menu-simple.d.ts +28 -0
- package/dist/types/components/menu/menu-simple.d.ts.map +1 -0
- package/dist/types/components/nerdjoke/nerdjoke.d.ts +23 -0
- package/dist/types/components/nerdjoke/nerdjoke.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/components/ComponentPropertiesForm.d.ts +11 -0
- package/dist/types/components/pagebuilder/components/ComponentPropertiesForm.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/components/ComponentSelector.d.ts +15 -0
- package/dist/types/components/pagebuilder/components/ComponentSelector.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/components/ComponentTree.d.ts +17 -0
- package/dist/types/components/pagebuilder/components/ComponentTree.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/components/PageBuilderUI.d.ts +10 -0
- package/dist/types/components/pagebuilder/components/PageBuilderUI.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/components/PageEngine.d.ts +23 -0
- package/dist/types/components/pagebuilder/components/PageEngine.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/components/SaveLoadSection.d.ts +12 -0
- package/dist/types/components/pagebuilder/components/SaveLoadSection.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/form/form.d.ts +46 -0
- package/dist/types/components/pagebuilder/form/form.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/form/form.submit.d.ts +3 -0
- package/dist/types/components/pagebuilder/form/form.submit.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/form/formcomponents.d.ts +205 -0
- package/dist/types/components/pagebuilder/form/formcomponents.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/form/formvalidations.d.ts +29 -0
- package/dist/types/components/pagebuilder/form/formvalidations.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/lib/componentGeneration.d.ts +17 -0
- package/dist/types/components/pagebuilder/lib/componentGeneration.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/lib/componentMap.d.ts +25 -0
- package/dist/types/components/pagebuilder/lib/componentMap.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/lib/componentMetadata.d.ts +22 -0
- package/dist/types/components/pagebuilder/lib/componentMetadata.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/lib/pageStorageContentful.d.ts +25 -0
- package/dist/types/components/pagebuilder/lib/pageStorageContentful.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/lib/pageStorageLocal.d.ts +23 -0
- package/dist/types/components/pagebuilder/lib/pageStorageLocal.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/lib/pageStorageTypes.d.ts +25 -0
- package/dist/types/components/pagebuilder/lib/pageStorageTypes.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/lib/propTypeIntrospection.d.ts +24 -0
- package/dist/types/components/pagebuilder/lib/propTypeIntrospection.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/lib/types.d.ts +34 -0
- package/dist/types/components/pagebuilder/lib/types.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/lib/usePageBuilder.d.ts +24 -0
- package/dist/types/components/pagebuilder/lib/usePageBuilder.d.ts.map +1 -0
- package/dist/types/components/recipe/recipe.d.ts +66 -0
- package/dist/types/components/recipe/recipe.d.ts.map +1 -0
- package/dist/types/components/resume/resume.d.ts +85 -0
- package/dist/types/components/resume/resume.d.ts.map +1 -0
- package/dist/types/components/seo/404.d.ts +10 -0
- package/dist/types/components/seo/404.d.ts.map +1 -0
- package/dist/types/components/seo/googleanalytics.d.ts +23 -0
- package/dist/types/components/seo/googleanalytics.d.ts.map +1 -0
- package/dist/types/components/seo/googlemap.d.ts +15 -0
- package/dist/types/components/seo/googlemap.d.ts.map +1 -0
- package/dist/types/components/seo/googlesearch.d.ts +10 -0
- package/dist/types/components/seo/googlesearch.d.ts.map +1 -0
- package/dist/types/components/seo/metadata.d.ts +35 -0
- package/dist/types/components/seo/metadata.d.ts.map +1 -0
- package/dist/types/components/seo/sitemap.d.ts +47 -0
- package/dist/types/components/seo/sitemap.d.ts.map +1 -0
- package/dist/types/components/shoppingcart/ebay.components.d.ts +46 -0
- package/dist/types/components/shoppingcart/ebay.components.d.ts.map +1 -0
- package/dist/types/components/shoppingcart/ebay.functions.d.ts +76 -0
- package/dist/types/components/shoppingcart/ebay.functions.d.ts.map +1 -0
- package/dist/types/components/shoppingcart/paypal.d.ts +16 -0
- package/dist/types/components/shoppingcart/paypal.d.ts.map +1 -0
- package/dist/types/components/shoppingcart/shoppingcart.components.d.ts +35 -0
- package/dist/types/components/shoppingcart/shoppingcart.components.d.ts.map +1 -0
- package/dist/types/components/shoppingcart/shoppingcart.functions.d.ts +89 -0
- package/dist/types/components/shoppingcart/shoppingcart.functions.d.ts.map +1 -0
- package/dist/types/components/sidepanel/sidepanel.d.ts +18 -0
- package/dist/types/components/sidepanel/sidepanel.d.ts.map +1 -0
- package/dist/types/components/socialcard/socialcard.d.ts +20 -0
- package/dist/types/components/socialcard/socialcard.d.ts.map +1 -0
- package/dist/types/components/tiles/tiles.d.ts +28 -0
- package/dist/types/components/tiles/tiles.d.ts.map +1 -0
- package/dist/types/components/timeline/timeline.d.ts +31 -0
- package/dist/types/components/timeline/timeline.d.ts.map +1 -0
- package/dist/types/components/utilities/api.d.ts +16 -0
- package/dist/types/components/utilities/api.d.ts.map +1 -0
- package/dist/types/components/utilities/functions.d.ts +11 -0
- package/dist/types/components/utilities/functions.d.ts.map +1 -0
- package/dist/types/components/yelp/yelp.d.ts +5 -0
- package/dist/types/components/yelp/yelp.d.ts.map +1 -0
- package/dist/types/data/buzzwords.d.ts +2 -0
- package/dist/types/data/buzzwords.d.ts.map +1 -0
- package/dist/types/index.d.ts +76 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.server.d.ts +30 -0
- package/dist/types/index.server.d.ts.map +1 -0
- package/dist/types/stories/buzzword-bingo.stories.d.ts +13 -0
- package/dist/types/stories/buzzword-bingo.stories.d.ts.map +1 -0
- package/dist/types/stories/callout.many.stories.d.ts +8 -0
- package/dist/types/stories/callout.many.stories.d.ts.map +1 -0
- package/dist/types/stories/callout.stories.d.ts +69 -0
- package/dist/types/stories/callout.stories.d.ts.map +1 -0
- package/dist/types/stories/carousel-hero.stories.d.ts +22 -0
- package/dist/types/stories/carousel-hero.stories.d.ts.map +1 -0
- package/dist/types/stories/carousel-reviews.stories.d.ts +38 -0
- package/dist/types/stories/carousel-reviews.stories.d.ts.map +1 -0
- package/dist/types/stories/carousel-workportfolio.stories.d.ts +22 -0
- package/dist/types/stories/carousel-workportfolio.stories.d.ts.map +1 -0
- package/dist/types/stories/carousel.stories.d.ts +41 -0
- package/dist/types/stories/carousel.stories.d.ts.map +1 -0
- package/dist/types/stories/cms.contentful.item.stories.d.ts +21 -0
- package/dist/types/stories/cms.contentful.item.stories.d.ts.map +1 -0
- package/dist/types/stories/cms.contentful.items.stories.d.ts +20 -0
- package/dist/types/stories/cms.contentful.items.stories.d.ts.map +1 -0
- package/dist/types/stories/cms.contentful.stories.d.ts +9 -0
- package/dist/types/stories/cms.contentful.stories.d.ts.map +1 -0
- package/dist/types/stories/cms.google.reviews.stories.d.ts +11 -0
- package/dist/types/stories/cms.google.reviews.stories.d.ts.map +1 -0
- package/dist/types/stories/cms.gravatar.stories.d.ts +88 -0
- package/dist/types/stories/cms.gravatar.stories.d.ts.map +1 -0
- package/dist/types/stories/cms.instagram.stories.d.ts +16 -0
- package/dist/types/stories/cms.instagram.stories.d.ts.map +1 -0
- package/dist/types/stories/cms.wordpress.stories.d.ts +26 -0
- package/dist/types/stories/cms.wordpress.stories.d.ts.map +1 -0
- package/dist/types/stories/general.headers.stories.d.ts +27 -0
- package/dist/types/stories/general.headers.stories.d.ts.map +1 -0
- package/dist/types/stories/general.loading.stories.d.ts +11 -0
- package/dist/types/stories/general.loading.stories.d.ts.map +1 -0
- package/dist/types/stories/general.microinteractions.stories.d.ts +9 -0
- package/dist/types/stories/general.microinteractions.stories.d.ts.map +1 -0
- package/dist/types/stories/general.modal.stories.d.ts +9 -0
- package/dist/types/stories/general.modal.stories.d.ts.map +1 -0
- package/dist/types/stories/general.table.stories.d.ts +15 -0
- package/dist/types/stories/general.table.stories.d.ts.map +1 -0
- package/dist/types/stories/layout.stories.d.ts +299 -0
- package/dist/types/stories/layout.stories.d.ts.map +1 -0
- package/dist/types/stories/markdown.stories.d.ts +13 -0
- package/dist/types/stories/markdown.stories.d.ts.map +1 -0
- package/dist/types/stories/menu-accordion.stories.d.ts +34 -0
- package/dist/types/stories/menu-accordion.stories.d.ts.map +1 -0
- package/dist/types/stories/menu-simple.stories.d.ts +43 -0
- package/dist/types/stories/menu-simple.stories.d.ts.map +1 -0
- package/dist/types/stories/nerdjoke.stories.d.ts +10 -0
- package/dist/types/stories/nerdjoke.stories.d.ts.map +1 -0
- package/dist/types/stories/pagebuilder.form-builder.stories.d.ts +10 -0
- package/dist/types/stories/pagebuilder.form-builder.stories.d.ts.map +1 -0
- package/dist/types/stories/pagebuilder.form-engine.stories.d.ts +16 -0
- package/dist/types/stories/pagebuilder.form-engine.stories.d.ts.map +1 -0
- package/dist/types/stories/pagebuilder.form-extractor.stories.d.ts +10 -0
- package/dist/types/stories/pagebuilder.form-extractor.stories.d.ts.map +1 -0
- package/dist/types/stories/pagebuilder.stories.d.ts +29 -0
- package/dist/types/stories/pagebuilder.stories.d.ts.map +1 -0
- package/dist/types/stories/pagebuilder.usageguide.stories.d.ts +29 -0
- package/dist/types/stories/pagebuilder.usageguide.stories.d.ts.map +1 -0
- package/dist/types/stories/pageengine.stories.d.ts +32 -0
- package/dist/types/stories/pageengine.stories.d.ts.map +1 -0
- package/dist/types/stories/recipe.stories.d.ts +16 -0
- package/dist/types/stories/recipe.stories.d.ts.map +1 -0
- package/dist/types/stories/resume.stories.d.ts +283 -0
- package/dist/types/stories/resume.stories.d.ts.map +1 -0
- package/dist/types/stories/seo.404.stories.d.ts +18 -0
- package/dist/types/stories/seo.404.stories.d.ts.map +1 -0
- package/dist/types/stories/seo.googleanalytics.stories.d.ts +12 -0
- package/dist/types/stories/seo.googleanalytics.stories.d.ts.map +1 -0
- package/dist/types/stories/seo.googlesearch.stories.d.ts +12 -0
- package/dist/types/stories/seo.googlesearch.stories.d.ts.map +1 -0
- package/dist/types/stories/seo.metadata.stories.d.ts +25 -0
- package/dist/types/stories/seo.metadata.stories.d.ts.map +1 -0
- package/dist/types/stories/seo.sitemap.stories.d.ts +8 -0
- package/dist/types/stories/seo.sitemap.stories.d.ts.map +1 -0
- package/dist/types/stories/shoppingcart.ebay.item.stories.d.ts +21 -0
- package/dist/types/stories/shoppingcart.ebay.item.stories.d.ts.map +1 -0
- package/dist/types/stories/shoppingcart.ebay.items.stories.d.ts +21 -0
- package/dist/types/stories/shoppingcart.ebay.items.stories.d.ts.map +1 -0
- package/dist/types/stories/shoppingcart.stories.d.ts +9 -0
- package/dist/types/stories/shoppingcart.stories.d.ts.map +1 -0
- package/dist/types/stories/sidepanel.stories.d.ts +85 -0
- package/dist/types/stories/sidepanel.stories.d.ts.map +1 -0
- package/dist/types/stories/socialcard.stories.d.ts +81 -0
- package/dist/types/stories/socialcard.stories.d.ts.map +1 -0
- package/dist/types/stories/tiles.stories.d.ts +9 -0
- package/dist/types/stories/tiles.stories.d.ts.map +1 -0
- package/dist/types/stories/timeline.stories.d.ts +19 -0
- package/dist/types/stories/timeline.stories.d.ts.map +1 -0
- package/dist/types/tests/pixelated.api.test.d.ts +2 -0
- package/dist/types/tests/pixelated.api.test.d.ts.map +1 -0
- package/dist/types/tests/pixelated.callout.test.d.ts +2 -0
- package/dist/types/tests/pixelated.callout.test.d.ts.map +1 -0
- package/dist/types/tests/pixelated.carousel.test.d.ts +2 -0
- package/dist/types/tests/pixelated.carousel.test.d.ts.map +1 -0
- package/dist/types/tests/pixelated.menu-accordion.test.d.ts +2 -0
- package/dist/types/tests/pixelated.menu-accordion.test.d.ts.map +1 -0
- package/dist/types/tests/pixelated.menu-simple.test.d.ts +2 -0
- package/dist/types/tests/pixelated.menu-simple.test.d.ts.map +1 -0
- package/dist/types/tests/pixelated.nerdjoke.test.d.ts +2 -0
- package/dist/types/tests/pixelated.nerdjoke.test.d.ts.map +1 -0
- package/dist/types/tests/pixelated.recipe.test.d.ts +2 -0
- package/dist/types/tests/pixelated.recipe.test.d.ts.map +1 -0
- package/dist/types/tests/pixelated.resume.test.d.ts +2 -0
- package/dist/types/tests/pixelated.resume.test.d.ts.map +1 -0
- package/dist/types/tests/pixelated.socialcard.test.d.ts +2 -0
- package/dist/types/tests/pixelated.socialcard.test.d.ts.map +1 -0
- package/package.json +136 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { SmartImage } from "../../cms/cloudinary.image";
|
|
5
|
+
import { usePixelatedConfig } from "../../config/config.client";
|
|
6
|
+
import * as FV from "./formvalidations";
|
|
7
|
+
import "./form.css";
|
|
8
|
+
/*
|
|
9
|
+
InferProps to generate Types
|
|
10
|
+
https://amanhimself.dev/blog/prop-types-in-react-and-typescript/#inferring-proptypes-in-typescript
|
|
11
|
+
*/
|
|
12
|
+
const onChange = (me, event) => {
|
|
13
|
+
// TEST VALUES
|
|
14
|
+
let myValidate = (typeof me.props.validate === "string" && me.props.validate in FV)
|
|
15
|
+
? FV[me.props.validate](event.target)
|
|
16
|
+
: true;
|
|
17
|
+
let myParentValidate = me.props.parent && me.props.parent.validate
|
|
18
|
+
? FV[me.props.parent.validate](event.target)
|
|
19
|
+
: true;
|
|
20
|
+
let myRequired = me.props.required ? event.target.checkValidity() : true;
|
|
21
|
+
let myRequiredNotEmpty = (me.props.required && (!event.target.value)) ? false : true;
|
|
22
|
+
// RETURN VALUES
|
|
23
|
+
Promise.all([myValidate, myParentValidate, myRequired, myRequiredNotEmpty])
|
|
24
|
+
.then((result) => {
|
|
25
|
+
let myValid = (result[0] && result[1] && result[2] && result[3]) ? true : false;
|
|
26
|
+
if (me.props.setIsValid)
|
|
27
|
+
me.props.setIsValid(myValid);
|
|
28
|
+
if (me.props.parent && me.props.parent.setIsValid)
|
|
29
|
+
me.props.parent.setIsValid(myValid);
|
|
30
|
+
return true;
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
FormLabel.propTypes = {
|
|
34
|
+
id: PropTypes.string.isRequired,
|
|
35
|
+
label: PropTypes.string,
|
|
36
|
+
tooltip: PropTypes.string,
|
|
37
|
+
className: PropTypes.string,
|
|
38
|
+
};
|
|
39
|
+
FormLabel.defaultProps = {
|
|
40
|
+
id: "",
|
|
41
|
+
label: "",
|
|
42
|
+
tooltip: "",
|
|
43
|
+
};
|
|
44
|
+
function FormLabel(props) {
|
|
45
|
+
return (_jsxs(_Fragment, { children: [props.label && props.id
|
|
46
|
+
? _jsx("label", { className: props.className || '', id: `lbl-${props.id}`, htmlFor: props.id, children: props.label })
|
|
47
|
+
: "", props.tooltip
|
|
48
|
+
? _jsx(FormTooltip, { id: props.id, text: props.tooltip })
|
|
49
|
+
: ""] }));
|
|
50
|
+
}
|
|
51
|
+
FormTooltip.propTypes = {
|
|
52
|
+
id: PropTypes.string,
|
|
53
|
+
text: PropTypes.string,
|
|
54
|
+
className: PropTypes.string,
|
|
55
|
+
};
|
|
56
|
+
FormTooltip.defaultProps = {
|
|
57
|
+
id: "",
|
|
58
|
+
text: "",
|
|
59
|
+
};
|
|
60
|
+
function FormTooltip(props) {
|
|
61
|
+
function toggleTooltip(e) {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
const target = e.currentTarget;
|
|
64
|
+
const nextSibling = target.nextSibling;
|
|
65
|
+
if (nextSibling) {
|
|
66
|
+
if (nextSibling.style.display === "block") {
|
|
67
|
+
nextSibling.style.display = "none";
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
nextSibling.style.display = "block";
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
// ℹ 8505 2139 INFORMATION SOURCE
|
|
76
|
+
// ⚠ 9888 26A0 WARNING SIGN
|
|
77
|
+
// 24BE I IN CIRCLE
|
|
78
|
+
// {'\u2139'}
|
|
79
|
+
let thisID = "tooltip-" + props.id;
|
|
80
|
+
const config = usePixelatedConfig();
|
|
81
|
+
let tooltipImg = _jsx(SmartImage, { src: "/images/icons/tooltip-icon-2.png", title: props.id + " - " + props.text, alt: props.id + " - " + props.text, cloudinaryEnv: config?.cloudinary?.product_env ?? undefined, cloudinaryDomain: config?.cloudinary?.baseUrl ?? undefined, cloudinaryTransforms: config?.cloudinary?.transforms ?? undefined });
|
|
82
|
+
/* <img title={props.id + " - " + props.text}
|
|
83
|
+
alt={props.id + " - " + props.text}
|
|
84
|
+
src="/images/icons/tooltip-icon-2.png" /> */
|
|
85
|
+
return (_jsx(_Fragment, { children: props.text && props.id
|
|
86
|
+
? _jsx(_Fragment, { children: _jsxs("div", { id: thisID, className: `tooltip ${props.className || ''}`, children: [_jsx("a", { href: "#", className: "tooltipIcon", onClick: toggleTooltip, children: tooltipImg }), _jsx("div", { className: "tooltipText", children: props.text })] }) })
|
|
87
|
+
: "" }));
|
|
88
|
+
}
|
|
89
|
+
FormValidate.propTypes = {
|
|
90
|
+
id: PropTypes.string.isRequired,
|
|
91
|
+
valid: PropTypes.bool,
|
|
92
|
+
};
|
|
93
|
+
function FormValidate(props) {
|
|
94
|
+
return (_jsx(_Fragment, { children: !props.valid ?
|
|
95
|
+
_jsx("span", { id: props.id, children: props.valid ? "\u2705" : "\u274C" }) : "" }));
|
|
96
|
+
}
|
|
97
|
+
FormInput.propTypes = {
|
|
98
|
+
type: PropTypes.string,
|
|
99
|
+
id: PropTypes.string.isRequired,
|
|
100
|
+
name: PropTypes.string,
|
|
101
|
+
defaultValue: PropTypes.string,
|
|
102
|
+
value: PropTypes.string,
|
|
103
|
+
list: PropTypes.string,
|
|
104
|
+
listItems: PropTypes.string, /* this one is mine */
|
|
105
|
+
size: PropTypes.string,
|
|
106
|
+
maxLength: PropTypes.string,
|
|
107
|
+
placeholder: PropTypes.string,
|
|
108
|
+
autoComplete: PropTypes.string,
|
|
109
|
+
"aria-label": PropTypes.string,
|
|
110
|
+
min: PropTypes.string,
|
|
111
|
+
max: PropTypes.string,
|
|
112
|
+
step: PropTypes.string,
|
|
113
|
+
// flag attributes
|
|
114
|
+
autoFocus: PropTypes.string,
|
|
115
|
+
disabled: PropTypes.string,
|
|
116
|
+
readOnly: PropTypes.string,
|
|
117
|
+
required: PropTypes.string,
|
|
118
|
+
// className,
|
|
119
|
+
// data-mapping, data-component-endpoint, data-testid
|
|
120
|
+
// aria-invalid, aria-describedby,
|
|
121
|
+
// ----- for calculations
|
|
122
|
+
display: PropTypes.string,
|
|
123
|
+
label: PropTypes.string,
|
|
124
|
+
tooltip: PropTypes.string,
|
|
125
|
+
className: PropTypes.string,
|
|
126
|
+
validate: PropTypes.string,
|
|
127
|
+
};
|
|
128
|
+
export function FormInput(props) {
|
|
129
|
+
const [isValid, setIsValid] = useState(true);
|
|
130
|
+
let formValidate = _jsx(FormValidate, { id: `${props.id}-validate`, valid: isValid });
|
|
131
|
+
// ----- Input Props
|
|
132
|
+
let inputProps = JSON.parse(JSON.stringify(props));
|
|
133
|
+
["display", "label", "listItems", "validate"].forEach(e => delete inputProps[e]);
|
|
134
|
+
inputProps["onChange"] = (e) => onChange({ props: { ...props, isValid: isValid, setIsValid: setIsValid } }, e);
|
|
135
|
+
inputProps["className"] = (props.display == "vertical") ? "displayVertical" : "";
|
|
136
|
+
if (["submit", "button"].indexOf(props.type ?? "") > -1) {
|
|
137
|
+
inputProps["value"] = props.value;
|
|
138
|
+
}
|
|
139
|
+
;
|
|
140
|
+
let formDataList = props.list && props.list in FV
|
|
141
|
+
? FV[props.list]
|
|
142
|
+
: props.list && props.listItems
|
|
143
|
+
? props.listItems.split(',')
|
|
144
|
+
: undefined;
|
|
145
|
+
return (_jsxs("div", { children: [props.type == "checkbox" ? _jsx("input", { ...inputProps }) : "", _jsx(FormLabel, { id: props.id, label: props.label }, "label-" + props.id), props.tooltip ? _jsx(FormTooltip, { id: props.id, text: props.tooltip }) : "", props.display == "vertical" ? formValidate : "", props.type != "checkbox" ? _jsx("input", { ...inputProps }) : "", formDataList && Array.isArray(formDataList) ? _jsx(FormDataList, { id: props.list ?? '', items: formDataList }) : "", props.display != "vertical" ? formValidate : ""] }));
|
|
146
|
+
}
|
|
147
|
+
FormSelect.propTypes = {
|
|
148
|
+
id: PropTypes.string.isRequired,
|
|
149
|
+
name: PropTypes.string,
|
|
150
|
+
size: PropTypes.string,
|
|
151
|
+
autoComplete: PropTypes.string,
|
|
152
|
+
defaultValue: PropTypes.oneOfType([
|
|
153
|
+
PropTypes.string,
|
|
154
|
+
PropTypes.array
|
|
155
|
+
]),
|
|
156
|
+
// flag attributes
|
|
157
|
+
autoFocus: PropTypes.string,
|
|
158
|
+
disabled: PropTypes.string,
|
|
159
|
+
multiple: PropTypes.string,
|
|
160
|
+
readOnly: PropTypes.string,
|
|
161
|
+
required: PropTypes.string,
|
|
162
|
+
// selected: PropTypes.string, // not used
|
|
163
|
+
// ----- for calculations
|
|
164
|
+
options: PropTypes.array,
|
|
165
|
+
display: PropTypes.string,
|
|
166
|
+
label: PropTypes.string,
|
|
167
|
+
tooltip: PropTypes.string,
|
|
168
|
+
className: PropTypes.string,
|
|
169
|
+
validate: PropTypes.string,
|
|
170
|
+
};
|
|
171
|
+
export function FormSelect(props) {
|
|
172
|
+
const [isValid, setIsValid] = useState(true);
|
|
173
|
+
function generateOptions() {
|
|
174
|
+
let options = [];
|
|
175
|
+
for (let option in props.options) {
|
|
176
|
+
let key = option;
|
|
177
|
+
let thisOption = props.options[key];
|
|
178
|
+
let thisKey = "select-" + props.id + "-" + thisOption.value;
|
|
179
|
+
let newOption = _jsx(FormSelectOption, { ...thisOption, parent: { isValid: isValid, setisValid: setIsValid } }, thisKey);
|
|
180
|
+
options.push(newOption);
|
|
181
|
+
}
|
|
182
|
+
return options;
|
|
183
|
+
}
|
|
184
|
+
let formValidate = _jsx(FormValidate, { id: `${props.id}-validate`, valid: isValid });
|
|
185
|
+
// ----- Input Props
|
|
186
|
+
let inputProps = JSON.parse(JSON.stringify(props));
|
|
187
|
+
["options", "display", "label", "validate"].forEach(e => delete inputProps[e]);
|
|
188
|
+
inputProps["onChange"] = (e) => onChange({ props: { ...props, isValid: isValid, setIsValid: setIsValid } }, e);
|
|
189
|
+
inputProps["className"] = (props.display == "vertical") ? "displayVertical" : "";
|
|
190
|
+
return (_jsxs("div", { children: [_jsx(FormLabel, { id: props.id, label: props.label }, "label-" + props.id), props.tooltip ? _jsx(FormTooltip, { id: props.id, text: props.tooltip }) : "", props.display == "vertical" ? formValidate : "", _jsx("select", { ...inputProps, suppressHydrationWarning: true, children: generateOptions() }), props.display != "vertical" ? formValidate : ""] }));
|
|
191
|
+
}
|
|
192
|
+
FormSelectOption.propTypes = {
|
|
193
|
+
text: PropTypes.string,
|
|
194
|
+
value: PropTypes.string,
|
|
195
|
+
// flag attributes
|
|
196
|
+
disabled: PropTypes.string,
|
|
197
|
+
// selected : PropTypes.string
|
|
198
|
+
};
|
|
199
|
+
function FormSelectOption(props) {
|
|
200
|
+
let inputProps = JSON.parse(JSON.stringify(props));
|
|
201
|
+
["selected"].forEach(e => delete inputProps[e]);
|
|
202
|
+
return (_jsx("option", { ...inputProps, children: props.text }));
|
|
203
|
+
}
|
|
204
|
+
FormTextarea.propTypes = {
|
|
205
|
+
id: PropTypes.string.isRequired,
|
|
206
|
+
name: PropTypes.string,
|
|
207
|
+
rows: PropTypes.string,
|
|
208
|
+
cols: PropTypes.string,
|
|
209
|
+
defaultValue: PropTypes.string,
|
|
210
|
+
maxLength: PropTypes.number,
|
|
211
|
+
placeholder: PropTypes.string,
|
|
212
|
+
autoComplete: PropTypes.string,
|
|
213
|
+
// flag attributes
|
|
214
|
+
autoFocus: PropTypes.string,
|
|
215
|
+
disabled: PropTypes.string,
|
|
216
|
+
readOnly: PropTypes.string,
|
|
217
|
+
required: PropTypes.string,
|
|
218
|
+
// ----- for calculations
|
|
219
|
+
display: PropTypes.string,
|
|
220
|
+
label: PropTypes.string,
|
|
221
|
+
tooltip: PropTypes.string,
|
|
222
|
+
className: PropTypes.string,
|
|
223
|
+
validate: PropTypes.string,
|
|
224
|
+
};
|
|
225
|
+
export function FormTextarea(props) {
|
|
226
|
+
const [isValid, setIsValid] = useState(true);
|
|
227
|
+
let formValidate = _jsx(FormValidate, { id: `${props.id}-validate`, valid: isValid });
|
|
228
|
+
// ----- Input Props
|
|
229
|
+
let inputProps = JSON.parse(JSON.stringify(props));
|
|
230
|
+
["display", "label", "validate"].forEach(e => delete inputProps[e]);
|
|
231
|
+
inputProps["onChange"] = (e) => onChange({ props: { ...props, isValid: isValid, setIsValid: setIsValid } }, e);
|
|
232
|
+
inputProps["className"] = (props.display == "vertical") ? "displayVertical" : "";
|
|
233
|
+
return (_jsxs("div", { children: [_jsx(FormLabel, { id: props.id, label: props.label }, "label-" + props.id), props.tooltip ? _jsx(FormTooltip, { id: props.id, text: props.tooltip }) : "", props.display == "vertical" ? formValidate : "", _jsx("textarea", { ...inputProps }), props.display != "vertical" ? formValidate : ""] }));
|
|
234
|
+
}
|
|
235
|
+
FormRadio.propTypes = {
|
|
236
|
+
id: PropTypes.string.isRequired, // not using?
|
|
237
|
+
name: PropTypes.string.isRequired,
|
|
238
|
+
options: PropTypes.array,
|
|
239
|
+
// flag attributes
|
|
240
|
+
autoFocus: PropTypes.string,
|
|
241
|
+
disabled: PropTypes.string,
|
|
242
|
+
readOnly: PropTypes.string,
|
|
243
|
+
required: PropTypes.string,
|
|
244
|
+
// ? selected: PropTypes.string,
|
|
245
|
+
// ----- for calculations
|
|
246
|
+
display: PropTypes.string,
|
|
247
|
+
label: PropTypes.string,
|
|
248
|
+
tooltip: PropTypes.string,
|
|
249
|
+
validate: PropTypes.string,
|
|
250
|
+
};
|
|
251
|
+
export function FormRadio(props) {
|
|
252
|
+
const [isValid, setIsValid] = useState(true);
|
|
253
|
+
function generateOptions() {
|
|
254
|
+
let options = [];
|
|
255
|
+
for (var option in props.options) {
|
|
256
|
+
let key = option;
|
|
257
|
+
let thisOption = props.options[key];
|
|
258
|
+
thisOption.setIsValid = setIsValid;
|
|
259
|
+
thisOption.parent = { ...props };
|
|
260
|
+
thisOption.parent.isValid = isValid;
|
|
261
|
+
thisOption.parent.setIsValid = setIsValid;
|
|
262
|
+
let thisKey = "radio-" + props.id + "-" + thisOption.value;
|
|
263
|
+
let newOption = _jsx(FormRadioOption, { ...thisOption }, thisKey);
|
|
264
|
+
options.push(newOption);
|
|
265
|
+
}
|
|
266
|
+
return options;
|
|
267
|
+
}
|
|
268
|
+
let formValidate = _jsx(FormValidate, { id: `${props.id}-validate`, valid: isValid });
|
|
269
|
+
return (_jsxs("div", { children: [_jsx(FormLabel, { id: props.name, label: props.label }, "label-" + props.id), props.tooltip ? _jsx(FormTooltip, { id: props.id, text: props.tooltip }) : "", props.display == "vertical" ? formValidate : "", generateOptions(), props.display != "vertical" ? formValidate : ""] }));
|
|
270
|
+
}
|
|
271
|
+
FormRadioOption.propTypes = {
|
|
272
|
+
name: PropTypes.string,
|
|
273
|
+
text: PropTypes.string,
|
|
274
|
+
value: PropTypes.string.isRequired,
|
|
275
|
+
// flag attributes
|
|
276
|
+
checked: PropTypes.string,
|
|
277
|
+
// ----- for calculations
|
|
278
|
+
parent: FormRadio,
|
|
279
|
+
setIsValid: PropTypes.func,
|
|
280
|
+
};
|
|
281
|
+
function FormRadioOption(props) {
|
|
282
|
+
return (_jsxs("span", { className: props.parent.display == "vertical" ? "displayVertical" : "", children: [_jsx("input", { type: "radio", id: `${props.parent.name}-${props.value}`, name: props.parent.name, value: props.value, defaultChecked: !!props.checked, required: !!props.parent.required, onChange: (e) => onChange({ props }, e) }), _jsx("label", { htmlFor: `${props.parent.name}-${props.value}`, children: props.text })] }));
|
|
283
|
+
}
|
|
284
|
+
FormCheckbox.propTypes = {
|
|
285
|
+
id: PropTypes.string.isRequired,
|
|
286
|
+
name: PropTypes.string.isRequired,
|
|
287
|
+
options: PropTypes.array,
|
|
288
|
+
// flag attributes
|
|
289
|
+
autoFocus: PropTypes.string,
|
|
290
|
+
disabled: PropTypes.string,
|
|
291
|
+
readOnly: PropTypes.string,
|
|
292
|
+
// ----- for calculations
|
|
293
|
+
display: PropTypes.string,
|
|
294
|
+
label: PropTypes.string,
|
|
295
|
+
tooltip: PropTypes.string,
|
|
296
|
+
className: PropTypes.string,
|
|
297
|
+
validate: PropTypes.string,
|
|
298
|
+
};
|
|
299
|
+
export function FormCheckbox(props) {
|
|
300
|
+
const [isValid, setIsValid] = useState(true);
|
|
301
|
+
function generateOptions() {
|
|
302
|
+
let options = [];
|
|
303
|
+
for (var option in props.options) {
|
|
304
|
+
let key = option;
|
|
305
|
+
let thisOption = props.options[key];
|
|
306
|
+
thisOption.setIsValid = setIsValid;
|
|
307
|
+
thisOption.parent = { ...props };
|
|
308
|
+
thisOption.parent.isValid = isValid;
|
|
309
|
+
thisOption.parent.setIsValid = setIsValid;
|
|
310
|
+
let thisKey = "checkbox-" + props.name + "-" + thisOption.value;
|
|
311
|
+
let newOption = _jsx(FormCheckboxOption, { ...thisOption }, thisKey);
|
|
312
|
+
options.push(newOption);
|
|
313
|
+
}
|
|
314
|
+
return options;
|
|
315
|
+
}
|
|
316
|
+
let formValidate = _jsx(FormValidate, { id: `${props.id}-validate`, valid: isValid });
|
|
317
|
+
return (_jsxs("div", { children: [_jsx(FormLabel, { id: props.name, label: props.label }, "label-" + props.id), props.tooltip ? _jsx(FormTooltip, { id: props.id, text: props.tooltip }) : "", props.display == "vertical" ? formValidate : "", generateOptions(), props.display != "vertical" ? formValidate : ""] }));
|
|
318
|
+
}
|
|
319
|
+
FormCheckboxOption.propTypes = {
|
|
320
|
+
text: PropTypes.string.isRequired,
|
|
321
|
+
value: PropTypes.string.isRequired,
|
|
322
|
+
// flag attributes
|
|
323
|
+
selected: PropTypes.string,
|
|
324
|
+
// ----- for calculations
|
|
325
|
+
parent: FormCheckbox,
|
|
326
|
+
setIsValid: PropTypes.func,
|
|
327
|
+
};
|
|
328
|
+
function FormCheckboxOption(props) {
|
|
329
|
+
return (_jsxs("span", { className: props.parent.display == "vertical" ? "displayVertical" : "", children: [_jsx("input", { type: "checkbox", id: props.parent.name + "_" + props.text, name: props.text, value: props.value, onChange: (e) => onChange({ props }, e) }), _jsx("label", { htmlFor: props.text, children: props.text })] }));
|
|
330
|
+
}
|
|
331
|
+
FormButton.propTypes = {
|
|
332
|
+
type: PropTypes.string,
|
|
333
|
+
id: PropTypes.string.isRequired,
|
|
334
|
+
text: PropTypes.string,
|
|
335
|
+
// ----- for calculations
|
|
336
|
+
className: PropTypes.string,
|
|
337
|
+
onClick: PropTypes.func.isRequired
|
|
338
|
+
};
|
|
339
|
+
export function FormButton(props) {
|
|
340
|
+
return (_jsx("div", { children: _jsx("button", { type: props.type, id: props.id, className: props.className || "", onClick: props.onClick, children: props.text }) }));
|
|
341
|
+
}
|
|
342
|
+
FormDataList.propTypes = {
|
|
343
|
+
id: PropTypes.string.isRequired,
|
|
344
|
+
items: PropTypes.array,
|
|
345
|
+
};
|
|
346
|
+
export function FormDataList(props) {
|
|
347
|
+
const options = [];
|
|
348
|
+
for (const item in props.items) {
|
|
349
|
+
let key = item;
|
|
350
|
+
const thisItem = props.items[key];
|
|
351
|
+
const newOption = _jsx("option", { value: thisItem }, props.id + '-' + thisItem);
|
|
352
|
+
options.push(newOption);
|
|
353
|
+
}
|
|
354
|
+
return (_jsx("datalist", { id: props.id, children: options }));
|
|
355
|
+
}
|
|
356
|
+
FormFieldset.propTypes = {};
|
|
357
|
+
export function FormFieldset() {
|
|
358
|
+
return (_jsx(_Fragment, {}));
|
|
359
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { validateDiscountCode } from '../../shoppingcart/shoppingcart.functions';
|
|
2
|
+
export const inputTypes = [
|
|
3
|
+
'button', 'checkbox', 'color', 'date', 'datetime-local', 'email',
|
|
4
|
+
'file', 'hidden', 'image', 'month', 'number', 'password', 'radio',
|
|
5
|
+
'range', 'reset', 'search', 'submit', 'tel', 'text', 'time', 'url', 'week'
|
|
6
|
+
];
|
|
7
|
+
export const booleans = ['true', 'false'];
|
|
8
|
+
export const formURLs = [
|
|
9
|
+
'https://www.marriott.com/loyalty/createAccount/createAccountPage1.mi',
|
|
10
|
+
'https://stackoverflow.com/users/signup',
|
|
11
|
+
'https://www.google.com',
|
|
12
|
+
'https://www.hilton.com/en/hilton-honors/join/',
|
|
13
|
+
'https://www.oakleyforum.com/register/?accountType=1',
|
|
14
|
+
'https://www.microfocus.com/selfreg/jsp/createAccount.jsp',
|
|
15
|
+
'https://www.michaels.com/on/demandware.store/Sites-MichaelsUS-Site/default/Account-NewRegistration',
|
|
16
|
+
'https://reg.usps.com/register'
|
|
17
|
+
];
|
|
18
|
+
export function getAllInvalidFields() {
|
|
19
|
+
const invalids = [];
|
|
20
|
+
for (const field of document.querySelectorAll('[required]')) {
|
|
21
|
+
const inputField = field;
|
|
22
|
+
if (typeof inputField.reportValidity === 'function' && !inputField.reportValidity()) {
|
|
23
|
+
invalids.push(inputField.id);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return invalids;
|
|
27
|
+
}
|
|
28
|
+
export function isOneChecked(field) {
|
|
29
|
+
const name = field.id.substring(0, field.id.indexOf('_') + 1);
|
|
30
|
+
const boxes = document.querySelectorAll("[id^='" + name + "']");
|
|
31
|
+
for (const box of Array.from(boxes)) {
|
|
32
|
+
const thisBox = box;
|
|
33
|
+
if (thisBox.checked)
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
export function isOneRadioSelected(field) {
|
|
39
|
+
const radios = document.getElementsByName(field.name);
|
|
40
|
+
let isValid = false;
|
|
41
|
+
for (let i = 0; i < radios.length; i++) {
|
|
42
|
+
const radioElem = radios[i];
|
|
43
|
+
if (radioElem.checked)
|
|
44
|
+
isValid = true;
|
|
45
|
+
}
|
|
46
|
+
return isValid;
|
|
47
|
+
}
|
|
48
|
+
export function isValidUSZipCode(field) {
|
|
49
|
+
const regexStr = /^\d{5}(-\d{4})?$/;
|
|
50
|
+
const regex = new RegExp(regexStr);
|
|
51
|
+
return regex.test(field.value); // was match
|
|
52
|
+
}
|
|
53
|
+
export function isValidUSPhoneNumber(field) {
|
|
54
|
+
const regexStr = /^[(]{0,1}[0-9]{3}[)]{0,1}[-\s.]{0,1}[0-9]{3}[-\s.]{0,1}[0-9]{4}$/;
|
|
55
|
+
const regex = new RegExp(regexStr);
|
|
56
|
+
return regex.test(field.value); // was match
|
|
57
|
+
}
|
|
58
|
+
export function isValidEmailAddress(field) {
|
|
59
|
+
// let regex1 = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ ;
|
|
60
|
+
const regexStr = /^\S+@\S+\.\S+$/;
|
|
61
|
+
const regex = new RegExp(regexStr);
|
|
62
|
+
const str = String(field.value).toLowerCase();
|
|
63
|
+
return regex.test(str); // was match
|
|
64
|
+
}
|
|
65
|
+
export function isValidDate(field) {
|
|
66
|
+
const date = new Date(field.value);
|
|
67
|
+
return date instanceof Date && !isNaN(date.valueOf());
|
|
68
|
+
}
|
|
69
|
+
export function isValidUrl(field) {
|
|
70
|
+
try {
|
|
71
|
+
return Boolean(new URL(field.value));
|
|
72
|
+
}
|
|
73
|
+
catch (e) {
|
|
74
|
+
console.log(e);
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export function isValidDiscountCode(field) {
|
|
79
|
+
return validateDiscountCode(field);
|
|
80
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { componentMap } from './componentMap';
|
|
2
|
+
import { generateFormFieldFromPropType } from './propTypeIntrospection';
|
|
3
|
+
/**
|
|
4
|
+
* Component Generation Logic
|
|
5
|
+
* Handles form data extraction and component object creation
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Extracts component data from form submission event
|
|
9
|
+
*/
|
|
10
|
+
export function generateComponentObject(event) {
|
|
11
|
+
const props = {};
|
|
12
|
+
const target = event.target;
|
|
13
|
+
for (const prop in target) {
|
|
14
|
+
const thisProp = target[prop];
|
|
15
|
+
if (thisProp && thisProp.value && (thisProp.value !== Object(thisProp.value))) {
|
|
16
|
+
let value = thisProp.value;
|
|
17
|
+
// Try to parse JSON objects
|
|
18
|
+
if (thisProp.name !== 'type' && value.startsWith('{')) {
|
|
19
|
+
try {
|
|
20
|
+
value = JSON.parse(value);
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
console.log('Invalid JSON for prop:', err, thisProp.name, value);
|
|
24
|
+
// Keep as string if not valid JSON
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// Convert number strings to numbers
|
|
28
|
+
if (thisProp.type === 'number') {
|
|
29
|
+
value = parseFloat(value) || value;
|
|
30
|
+
}
|
|
31
|
+
// Convert checkbox values to boolean
|
|
32
|
+
if (thisProp.type === 'checkbox') {
|
|
33
|
+
value = thisProp.checked;
|
|
34
|
+
}
|
|
35
|
+
props[thisProp.name] = value;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const parentPath = props.__parentPath;
|
|
39
|
+
delete props.__parentPath;
|
|
40
|
+
const newComponent = {
|
|
41
|
+
component: props.type,
|
|
42
|
+
props: props,
|
|
43
|
+
children: [] // Initialize children array for layout components
|
|
44
|
+
};
|
|
45
|
+
// Add path for tracking nested structure
|
|
46
|
+
newComponent.path = parentPath
|
|
47
|
+
? `${parentPath}.children[${Date.now()}]`
|
|
48
|
+
: `root[${Date.now()}]`;
|
|
49
|
+
return { component: newComponent, parentPath };
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Generates form field configuration for a component
|
|
53
|
+
*/
|
|
54
|
+
export function generateFieldJSON(component, existingProps, parentPath) {
|
|
55
|
+
const form = { fields: [] };
|
|
56
|
+
// ADD COMPONENT TYPE FIELD (disabled in phase 2)
|
|
57
|
+
form.fields.push({
|
|
58
|
+
component: 'FormInput',
|
|
59
|
+
props: {
|
|
60
|
+
label: 'Type:',
|
|
61
|
+
name: 'type',
|
|
62
|
+
id: 'type',
|
|
63
|
+
type: 'text',
|
|
64
|
+
disabled: true,
|
|
65
|
+
value: component
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
// ADD PARENT PATH (hidden field for nested components)
|
|
69
|
+
if (parentPath) {
|
|
70
|
+
form.fields.push({
|
|
71
|
+
component: 'FormInput',
|
|
72
|
+
props: {
|
|
73
|
+
name: '__parentPath',
|
|
74
|
+
id: '__parentPath',
|
|
75
|
+
type: 'hidden',
|
|
76
|
+
value: parentPath
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
// INTROSPECT PROPTYPES TO GENERATE APPROPRIATE FIELDS
|
|
81
|
+
const componentPropTypes = componentMap[component].propTypes;
|
|
82
|
+
if (componentPropTypes) {
|
|
83
|
+
for (const prop in componentPropTypes) {
|
|
84
|
+
// Skip children as we'll handle that separately for layout components
|
|
85
|
+
if (prop === 'children')
|
|
86
|
+
continue;
|
|
87
|
+
const propType = componentPropTypes[prop];
|
|
88
|
+
const existingValue = existingProps ? existingProps[prop] : undefined;
|
|
89
|
+
const field = generateFormFieldFromPropType(prop, propType, existingValue, component);
|
|
90
|
+
form.fields.push(field);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
// ADD SUBMIT BUTTON
|
|
94
|
+
const buttonText = existingProps ? 'Update ' + component : 'Add ' + component;
|
|
95
|
+
form.fields.push({
|
|
96
|
+
component: 'FormButton',
|
|
97
|
+
props: {
|
|
98
|
+
label: buttonText,
|
|
99
|
+
type: 'submit',
|
|
100
|
+
id: buttonText,
|
|
101
|
+
text: buttonText
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
return form;
|
|
105
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { PageHeader, PageSectionHeader } from "../../general/headers";
|
|
2
|
+
import { Callout } from "../../callout/callout";
|
|
3
|
+
import { PageSection, GridItem, FlexItem } from "../../general/layout";
|
|
4
|
+
/**
|
|
5
|
+
* Component registry and constants
|
|
6
|
+
*/
|
|
7
|
+
export const componentMap = {
|
|
8
|
+
"Page Header": PageHeader,
|
|
9
|
+
"Page Section Header": PageSectionHeader,
|
|
10
|
+
"Callout": Callout,
|
|
11
|
+
"Page Section": PageSection,
|
|
12
|
+
"Grid Item": GridItem,
|
|
13
|
+
"Flex Item": FlexItem,
|
|
14
|
+
};
|
|
15
|
+
export const layoutComponents = [
|
|
16
|
+
'Page Section',
|
|
17
|
+
'Grid Item',
|
|
18
|
+
'Flex Item'
|
|
19
|
+
];
|
|
20
|
+
export const componentTypes = Object.keys(componentMap).toString();
|
|
21
|
+
/**
|
|
22
|
+
* Check if a component is a layout component (can have children)
|
|
23
|
+
*/
|
|
24
|
+
export function isLayoutComponent(componentName) {
|
|
25
|
+
return layoutComponents.includes(componentName);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get component type from the registry
|
|
29
|
+
*/
|
|
30
|
+
export function getComponentType(componentName) {
|
|
31
|
+
return componentMap[componentName];
|
|
32
|
+
}
|