@tsed/tailwind-formio 2.3.6 → 3.0.0-alpha.10
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/build/config.1e3fca3e.json +1 -0
- package/build/css/app.a4ea028b.css +3 -0
- package/build/js/app.5db1c92a.js +2 -0
- package/build/js/app.5db1c92a.js.map +1 -0
- package/build/js/chunk-vendors.6cab5322.js +8 -0
- package/build/js/chunk-vendors.6cab5322.js.map +1 -0
- package/build/tailwind.html +3 -0
- package/dist/ejs.d.js +2 -0
- package/dist/ejs.d.js.map +1 -0
- package/dist/index.d.ts +222 -222
- package/dist/index.js +6 -2017
- package/dist/index.js.map +1 -1
- package/dist/tailwind/colors.d.ts +328 -0
- package/dist/tailwind/colors.js +15 -0
- package/dist/tailwind/colors.js.map +1 -0
- package/dist/tailwind/preset.d.ts +158 -0
- package/dist/tailwind/preset.js +173 -0
- package/dist/tailwind/preset.js.map +1 -0
- package/dist/templates/index.d.ts +219 -219
- package/dist/templates/index.js +8 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/tailwind/address/index.d.ts +4 -5
- package/dist/templates/tailwind/address/index.js +55 -0
- package/dist/templates/tailwind/address/index.js.map +1 -0
- package/dist/templates/tailwind/alert/index.d.ts +4 -5
- package/dist/templates/tailwind/alert/index.js +22 -0
- package/dist/templates/tailwind/alert/index.js.map +1 -0
- package/dist/templates/tailwind/builder/index.d.ts +4 -5
- package/dist/templates/tailwind/builder/index.js +17 -0
- package/dist/templates/tailwind/builder/index.js.map +1 -0
- package/dist/templates/tailwind/builderComponent/index.d.ts +4 -5
- package/dist/templates/tailwind/builderComponent/index.js +70 -0
- package/dist/templates/tailwind/builderComponent/index.js.map +1 -0
- package/dist/templates/tailwind/builderComponents/index.d.ts +4 -5
- package/dist/templates/tailwind/builderComponents/index.js +12 -0
- package/dist/templates/tailwind/builderComponents/index.js.map +1 -0
- package/dist/templates/tailwind/builderEditForm/index.d.ts +4 -5
- package/dist/templates/tailwind/builderEditForm/index.js +73 -0
- package/dist/templates/tailwind/builderEditForm/index.js.map +1 -0
- package/dist/templates/tailwind/builderPlaceholder/index.d.ts +4 -5
- package/dist/templates/tailwind/builderPlaceholder/index.js +18 -0
- package/dist/templates/tailwind/builderPlaceholder/index.js.map +1 -0
- package/dist/templates/tailwind/builderSidebar/index.d.ts +4 -5
- package/dist/templates/tailwind/builderSidebar/index.js +19 -0
- package/dist/templates/tailwind/builderSidebar/index.js.map +1 -0
- package/dist/templates/tailwind/builderSidebarGroup/index.d.ts +4 -5
- package/dist/templates/tailwind/builderSidebarGroup/index.js +58 -0
- package/dist/templates/tailwind/builderSidebarGroup/index.js.map +1 -0
- package/dist/templates/tailwind/builderWizard/index.d.ts +4 -5
- package/dist/templates/tailwind/builderWizard/index.js +33 -0
- package/dist/templates/tailwind/builderWizard/index.js.map +1 -0
- package/dist/templates/tailwind/button/index.d.ts +5 -7
- package/dist/templates/tailwind/button/index.js +36 -0
- package/dist/templates/tailwind/button/index.js.map +1 -0
- package/dist/templates/tailwind/checkbox/index.d.ts +5 -7
- package/dist/templates/tailwind/checkbox/index.js +42 -0
- package/dist/templates/tailwind/checkbox/index.js.map +1 -0
- package/dist/templates/tailwind/columns/index.d.ts +4 -5
- package/dist/templates/tailwind/columns/index.js +21 -0
- package/dist/templates/tailwind/columns/index.js.map +1 -0
- package/dist/templates/tailwind/component/index.d.ts +4 -5
- package/dist/templates/tailwind/component/index.js +15 -0
- package/dist/templates/tailwind/component/index.js.map +1 -0
- package/dist/templates/tailwind/componentModal/index.d.ts +4 -5
- package/dist/templates/tailwind/componentModal/index.js +35 -0
- package/dist/templates/tailwind/componentModal/index.js.map +1 -0
- package/dist/templates/tailwind/components/index.d.ts +4 -5
- package/dist/templates/tailwind/components/index.js +10 -0
- package/dist/templates/tailwind/components/index.js.map +1 -0
- package/dist/templates/tailwind/container/index.d.ts +4 -5
- package/dist/templates/tailwind/container/index.js +12 -0
- package/dist/templates/tailwind/container/index.js.map +1 -0
- package/dist/templates/tailwind/cssClasses.d.ts +7 -7
- package/dist/templates/tailwind/cssClasses.js +10 -0
- package/dist/templates/tailwind/cssClasses.js.map +1 -0
- package/dist/templates/tailwind/datagrid/index.d.ts +5 -7
- package/dist/templates/tailwind/datagrid/index.js +132 -0
- package/dist/templates/tailwind/datagrid/index.js.map +1 -0
- package/dist/templates/tailwind/day/index.d.ts +4 -5
- package/dist/templates/tailwind/day/index.js +53 -0
- package/dist/templates/tailwind/day/index.js.map +1 -0
- package/dist/templates/tailwind/dialog/index.d.ts +4 -5
- package/dist/templates/tailwind/dialog/index.js +16 -0
- package/dist/templates/tailwind/dialog/index.js.map +1 -0
- package/dist/templates/tailwind/editgrid/index.d.ts +5 -7
- package/dist/templates/tailwind/editgrid/index.js +92 -0
- package/dist/templates/tailwind/editgrid/index.js.map +1 -0
- package/dist/templates/tailwind/editgridTable/index.d.ts +5 -7
- package/dist/templates/tailwind/editgridTable/index.js +121 -0
- package/dist/templates/tailwind/editgridTable/index.js.map +1 -0
- package/dist/templates/tailwind/errorsList/index.d.ts +4 -5
- package/dist/templates/tailwind/errorsList/index.js +30 -0
- package/dist/templates/tailwind/errorsList/index.js.map +1 -0
- package/dist/templates/tailwind/field/index.d.ts +5 -7
- package/dist/templates/tailwind/field/index.js +55 -0
- package/dist/templates/tailwind/field/index.js.map +1 -0
- package/dist/templates/tailwind/fieldset/index.d.ts +4 -5
- package/dist/templates/tailwind/fieldset/index.js +25 -0
- package/dist/templates/tailwind/fieldset/index.js.map +1 -0
- package/dist/templates/tailwind/file/index.d.ts +4 -5
- package/dist/templates/tailwind/file/index.js +158 -0
- package/dist/templates/tailwind/file/index.js.map +1 -0
- package/dist/templates/tailwind/html/index.d.ts +4 -5
- package/dist/templates/tailwind/html/index.js +16 -0
- package/dist/templates/tailwind/html/index.js.map +1 -0
- package/dist/templates/tailwind/icon/index.d.ts +4 -5
- package/dist/templates/tailwind/icon/index.js +10 -0
- package/dist/templates/tailwind/icon/index.js.map +1 -0
- package/dist/templates/tailwind/iconClass.d.ts +3 -3
- package/dist/templates/tailwind/iconClass.js +57 -0
- package/dist/templates/tailwind/iconClass.js.map +1 -0
- package/dist/templates/tailwind/index.d.ts +217 -217
- package/dist/templates/tailwind/index.js +145 -0
- package/dist/templates/tailwind/index.js.map +1 -0
- package/dist/templates/tailwind/input/index.d.ts +5 -7
- package/dist/templates/tailwind/input/index.js +78 -0
- package/dist/templates/tailwind/input/index.js.map +1 -0
- package/dist/templates/tailwind/label/index.d.ts +4 -5
- package/dist/templates/tailwind/label/index.js +23 -0
- package/dist/templates/tailwind/label/index.js.map +1 -0
- package/dist/templates/tailwind/loader/index.d.ts +4 -5
- package/dist/templates/tailwind/loader/index.js +14 -0
- package/dist/templates/tailwind/loader/index.js.map +1 -0
- package/dist/templates/tailwind/loading/index.d.ts +4 -5
- package/dist/templates/tailwind/loading/index.js +10 -0
- package/dist/templates/tailwind/loading/index.js.map +1 -0
- package/dist/templates/tailwind/map/index.d.ts +4 -5
- package/dist/templates/tailwind/map/index.js +10 -0
- package/dist/templates/tailwind/map/index.js.map +1 -0
- package/dist/templates/tailwind/message/index.d.ts +4 -5
- package/dist/templates/tailwind/message/index.js +10 -0
- package/dist/templates/tailwind/message/index.js.map +1 -0
- package/dist/templates/tailwind/modalPreview/index.d.ts +4 -5
- package/dist/templates/tailwind/modalPreview/index.js +24 -0
- package/dist/templates/tailwind/modalPreview/index.js.map +1 -0
- package/dist/templates/tailwind/modaldialog/index.d.ts +4 -5
- package/dist/templates/tailwind/modaldialog/index.js +22 -0
- package/dist/templates/tailwind/modaldialog/index.js.map +1 -0
- package/dist/templates/tailwind/modaledit/index.d.ts +4 -5
- package/dist/templates/tailwind/modaledit/index.js +19 -0
- package/dist/templates/tailwind/modaledit/index.js.map +1 -0
- package/dist/templates/tailwind/multiValueRow/index.d.ts +4 -5
- package/dist/templates/tailwind/multiValueRow/index.js +21 -0
- package/dist/templates/tailwind/multiValueRow/index.js.map +1 -0
- package/dist/templates/tailwind/multiValueTable/index.d.ts +4 -5
- package/dist/templates/tailwind/multiValueTable/index.js +21 -0
- package/dist/templates/tailwind/multiValueTable/index.js.map +1 -0
- package/dist/templates/tailwind/multipleMasksInput/index.d.ts +4 -5
- package/dist/templates/tailwind/multipleMasksInput/index.js +34 -0
- package/dist/templates/tailwind/multipleMasksInput/index.js.map +1 -0
- package/dist/templates/tailwind/panel/index.d.ts +4 -5
- package/dist/templates/tailwind/panel/index.js +39 -0
- package/dist/templates/tailwind/panel/index.js.map +1 -0
- package/dist/templates/tailwind/pdf/index.d.ts +4 -5
- package/dist/templates/tailwind/pdf/index.js +19 -0
- package/dist/templates/tailwind/pdf/index.js.map +1 -0
- package/dist/templates/tailwind/pdfBuilder/index.d.ts +4 -5
- package/dist/templates/tailwind/pdfBuilder/index.js +18 -0
- package/dist/templates/tailwind/pdfBuilder/index.js.map +1 -0
- package/dist/templates/tailwind/pdfBuilderUpload/index.d.ts +4 -5
- package/dist/templates/tailwind/pdfBuilderUpload/index.js +25 -0
- package/dist/templates/tailwind/pdfBuilderUpload/index.js.map +1 -0
- package/dist/templates/tailwind/radio/index.d.ts +5 -7
- package/dist/templates/tailwind/radio/index.js +66 -0
- package/dist/templates/tailwind/radio/index.js.map +1 -0
- package/dist/templates/tailwind/resourceAdd/index.d.ts +4 -5
- package/dist/templates/tailwind/resourceAdd/index.js +26 -0
- package/dist/templates/tailwind/resourceAdd/index.js.map +1 -0
- package/dist/templates/tailwind/select/index.d.ts +5 -7
- package/dist/templates/tailwind/select/index.js +40 -0
- package/dist/templates/tailwind/select/index.js.map +1 -0
- package/dist/templates/tailwind/selectOption/index.d.ts +5 -7
- package/dist/templates/tailwind/selectOption/index.js +25 -0
- package/dist/templates/tailwind/selectOption/index.js.map +1 -0
- package/dist/templates/tailwind/signature/index.d.ts +5 -7
- package/dist/templates/tailwind/signature/index.js +37 -0
- package/dist/templates/tailwind/signature/index.js.map +1 -0
- package/dist/templates/tailwind/survey/index.d.ts +5 -7
- package/dist/templates/tailwind/survey/index.js +71 -0
- package/dist/templates/tailwind/survey/index.js.map +1 -0
- package/dist/templates/tailwind/tab/index.d.ts +5 -7
- package/dist/templates/tailwind/tab/index.js +60 -0
- package/dist/templates/tailwind/tab/index.js.map +1 -0
- package/dist/templates/tailwind/table/index.d.ts +4 -5
- package/dist/templates/tailwind/table/index.js +41 -0
- package/dist/templates/tailwind/table/index.js.map +1 -0
- package/dist/templates/tailwind/tableComponents/index.d.ts +4 -5
- package/dist/templates/tailwind/tableComponents/index.js +16 -0
- package/dist/templates/tailwind/tableComponents/index.js.map +1 -0
- package/dist/templates/tailwind/tree/index.d.ts +4 -5
- package/dist/templates/tailwind/tree/index.js +29 -0
- package/dist/templates/tailwind/tree/index.js.map +1 -0
- package/dist/templates/tailwind/tree/partials/index.d.ts +9 -11
- package/dist/templates/tailwind/tree/partials/index.js +53 -0
- package/dist/templates/tailwind/tree/partials/index.js.map +1 -0
- package/dist/templates/tailwind/webform/index.d.ts +5 -7
- package/dist/templates/tailwind/webform/index.js +15 -0
- package/dist/templates/tailwind/webform/index.js.map +1 -0
- package/dist/templates/tailwind/well/index.d.ts +4 -5
- package/dist/templates/tailwind/well/index.js +14 -0
- package/dist/templates/tailwind/well/index.js.map +1 -0
- package/dist/templates/tailwind/wizard/index.d.ts +5 -7
- package/dist/templates/tailwind/wizard/index.js +44 -0
- package/dist/templates/tailwind/wizard/index.js.map +1 -0
- package/dist/templates/tailwind/wizardHeader/index.d.ts +4 -5
- package/dist/templates/tailwind/wizardHeader/index.js +25 -0
- package/dist/templates/tailwind/wizardHeader/index.js.map +1 -0
- package/dist/templates/tailwind/wizardHeaderClassic/index.d.ts +4 -5
- package/dist/templates/tailwind/wizardHeaderClassic/index.js +27 -0
- package/dist/templates/tailwind/wizardHeaderClassic/index.js.map +1 -0
- package/dist/templates/tailwind/wizardHeaderVertical/index.d.ts +4 -5
- package/dist/templates/tailwind/wizardHeaderVertical/index.js +25 -0
- package/dist/templates/tailwind/wizardHeaderVertical/index.js.map +1 -0
- package/dist/templates/tailwind/wizardNav/index.d.ts +4 -5
- package/dist/templates/tailwind/wizardNav/index.js +39 -0
- package/dist/templates/tailwind/wizardNav/index.js.map +1 -0
- package/package.json +32 -22
- package/readme.md +13 -129
- package/src/tailwind/colors.ts +20 -0
- package/src/tailwind/preset.ts +163 -0
- package/src/templates/stories/__fixtures__/WrapperForm.jsx +103 -0
- package/src/templates/stories/__fixtures__/form-firstname.fixture.json +256 -0
- package/src/templates/stories/__fixtures__/form.fixtures.js +1840 -0
- package/src/templates/stories/__fixtures__/useEditForm.jsx +82 -0
- package/src/templates/stories/breadcrumbs.stories.jsx +2 -1
- package/src/templates/tailwind/address/index.ts +1 -1
- package/src/templates/tailwind/alert/index.ts +3 -0
- package/src/templates/tailwind/builder/index.ts +1 -1
- package/src/templates/tailwind/builderComponent/index.ts +1 -1
- package/src/templates/tailwind/builderComponents/index.ts +1 -1
- package/src/templates/tailwind/builderEditForm/form.ejs +4 -2
- package/src/templates/tailwind/builderEditForm/index.ts +1 -1
- package/src/templates/tailwind/builderPlaceholder/index.ts +1 -1
- package/src/templates/tailwind/builderSidebar/index.ts +1 -1
- package/src/templates/tailwind/builderSidebarGroup/form.ejs +1 -1
- package/src/templates/tailwind/builderSidebarGroup/index.ts +1 -1
- package/src/templates/tailwind/builderWizard/index.ts +1 -1
- package/src/templates/tailwind/button/index.ts +2 -2
- package/src/templates/tailwind/checkbox/index.ts +2 -2
- package/src/templates/tailwind/columns/index.ts +1 -1
- package/src/templates/tailwind/component/index.ts +1 -1
- package/src/templates/tailwind/componentModal/index.ts +1 -1
- package/src/templates/tailwind/components/index.ts +1 -1
- package/src/templates/tailwind/container/index.ts +1 -1
- package/src/templates/tailwind/datagrid/index.ts +2 -2
- package/src/templates/tailwind/day/index.ts +1 -1
- package/src/templates/tailwind/dialog/index.ts +1 -1
- package/src/templates/tailwind/editgrid/index.ts +2 -2
- package/src/templates/tailwind/editgridTable/index.ts +2 -2
- package/src/templates/tailwind/errorsList/index.ts +1 -1
- package/src/templates/tailwind/field/index.ts +2 -2
- package/src/templates/tailwind/fieldset/index.ts +1 -1
- package/src/templates/tailwind/file/index.ts +1 -1
- package/src/templates/tailwind/html/index.ts +1 -1
- package/src/templates/tailwind/icon/index.ts +1 -1
- package/src/templates/tailwind/input/index.ts +2 -2
- package/src/templates/tailwind/label/index.ts +1 -1
- package/src/templates/tailwind/loader/index.ts +1 -1
- package/src/templates/tailwind/loading/index.ts +1 -1
- package/src/templates/tailwind/map/index.ts +1 -1
- package/src/templates/tailwind/message/index.ts +1 -1
- package/src/templates/tailwind/modalPreview/index.ts +1 -1
- package/src/templates/tailwind/modaldialog/index.ts +1 -1
- package/src/templates/tailwind/modaledit/index.ts +1 -1
- package/src/templates/tailwind/multiValueRow/index.ts +1 -1
- package/src/templates/tailwind/multiValueTable/index.ts +1 -1
- package/src/templates/tailwind/multipleMasksInput/index.ts +1 -1
- package/src/templates/tailwind/panel/index.ts +1 -1
- package/src/templates/tailwind/pdf/index.ts +1 -1
- package/src/templates/tailwind/pdfBuilder/index.ts +1 -1
- package/src/templates/tailwind/pdfBuilderUpload/index.ts +1 -1
- package/src/templates/tailwind/radio/index.ts +2 -2
- package/src/templates/tailwind/resourceAdd/index.ts +1 -1
- package/src/templates/tailwind/select/index.ts +2 -2
- package/src/templates/tailwind/selectOption/index.ts +2 -2
- package/src/templates/tailwind/signature/index.ts +2 -2
- package/src/templates/tailwind/survey/index.ts +2 -2
- package/src/templates/tailwind/tab/index.ts +2 -2
- package/src/templates/tailwind/table/index.ts +1 -1
- package/src/templates/tailwind/tableComponents/index.ts +1 -1
- package/src/templates/tailwind/tree/index.ts +1 -1
- package/src/templates/tailwind/tree/partials/index.ts +2 -2
- package/src/templates/tailwind/webform/index.ts +2 -2
- package/src/templates/tailwind/well/index.ts +1 -1
- package/src/templates/tailwind/wizard/index.ts +2 -2
- package/src/templates/tailwind/wizardHeader/index.ts +1 -1
- package/src/templates/tailwind/wizardHeaderClassic/index.ts +1 -1
- package/src/templates/tailwind/wizardHeaderVertical/index.ts +1 -1
- package/src/templates/tailwind/wizardNav/index.ts +1 -1
- package/styles/badge.css +4 -4
- package/styles/choices.css +45 -10
- package/styles/form-edit.css +13 -21
- package/styles/form.css +7 -2
- package/styles/index.css +1 -0
- package/styles/modal.css +1 -0
- package/styles/react-select.css +105 -0
- package/styles/tables.css +20 -57
- package/tsconfig.app.json +11 -0
- package/tsconfig.json +7 -5
- package/tsconfig.node.json +9 -4
- package/vite.config.mts +86 -0
- package/.eslintignore +0 -14
- package/.eslintrc.js +0 -7
- package/dist/index.modern.js +0 -2020
- package/dist/index.modern.js.map +0 -1
- package/dist/templates/stories/alert.stories.d.ts +0 -17
- package/dist/templates/stories/badge.stories.d.ts +0 -17
- package/dist/templates/stories/breadcrumbs.stories.d.ts +0 -37
- package/dist/templates/stories/builder.stories.d.ts +0 -3057
- package/dist/templates/stories/pagination.stories.d.ts +0 -17
- package/dist/templates/stories/progress.stories.d.ts +0 -22
- package/dist/templates/stories/wizard.stories.d.ts +0 -3057
- package/dist/templates/tailwind/address/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/address/html.ejs.d.ts +0 -1
- package/dist/templates/tailwind/alert/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/builder/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/builderComponent/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/builderComponents/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/builderEditForm/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/builderPlaceholder/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/builderSidebar/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/builderSidebarGroup/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/builderWizard/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/button/button.stories.d.ts +0 -22
- package/dist/templates/tailwind/button/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/button/html.ejs.d.ts +0 -1
- package/dist/templates/tailwind/checkbox/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/checkbox/html.ejs.d.ts +0 -1
- package/dist/templates/tailwind/columns/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/component/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/componentModal/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/components/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/container/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/datagrid/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/datagrid/html.ejs.d.ts +0 -1
- package/dist/templates/tailwind/day/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/dialog/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/editgrid/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/editgrid/html.ejs.d.ts +0 -1
- package/dist/templates/tailwind/editgridTable/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/editgridTable/html.ejs.d.ts +0 -1
- package/dist/templates/tailwind/errorsList/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/field/align.ejs.d.ts +0 -1
- package/dist/templates/tailwind/field/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/fieldset/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/file/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/html/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/icon/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/input/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/input/html.ejs.d.ts +0 -1
- package/dist/templates/tailwind/label/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/loader/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/loading/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/map/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/message/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/modalPreview/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/modaldialog/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/modaledit/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/multiValueRow/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/multiValueTable/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/multipleMasksInput/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/panel/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/pdf/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/pdfBuilder/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/pdfBuilderUpload/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/radio/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/radio/html.ejs.d.ts +0 -1
- package/dist/templates/tailwind/resourceAdd/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/select/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/select/html.ejs.d.ts +0 -1
- package/dist/templates/tailwind/selectOption/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/selectOption/html.ejs.d.ts +0 -1
- package/dist/templates/tailwind/signature/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/signature/html.ejs.d.ts +0 -1
- package/dist/templates/tailwind/survey/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/survey/html.ejs.d.ts +0 -1
- package/dist/templates/tailwind/tab/flat.ejs.d.ts +0 -1
- package/dist/templates/tailwind/tab/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/table/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/tableComponents/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/tree/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/tree/partials/edit.ejs.d.ts +0 -1
- package/dist/templates/tailwind/tree/partials/view.ejs.d.ts +0 -1
- package/dist/templates/tailwind/webform/builder.ejs.d.ts +0 -1
- package/dist/templates/tailwind/webform/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/well/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/wizard/builder.ejs.d.ts +0 -1
- package/dist/templates/tailwind/wizard/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/wizardHeader/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/wizardHeaderClassic/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/wizardHeaderVertical/form.ejs.d.ts +0 -1
- package/dist/templates/tailwind/wizardNav/form.ejs.d.ts +0 -1
- package/gulpfile.js +0 -25
- package/src/templates/stories/builder.stories.jsx +0 -1917
- package/src/templates/stories/wizard.stories.jsx +0 -1917
- package/src/templates/tailwind/address/form.ejs.js +0 -58
- package/src/templates/tailwind/address/html.ejs.js +0 -13
- package/src/templates/tailwind/alert/form.ejs.js +0 -24
- package/src/templates/tailwind/alert/index.js +0 -3
- package/src/templates/tailwind/builder/form.ejs.js +0 -9
- package/src/templates/tailwind/builderComponent/form.ejs.js +0 -24
- package/src/templates/tailwind/builderComponents/form.ejs.js +0 -11
- package/src/templates/tailwind/builderEditForm/form.ejs.js +0 -50
- package/src/templates/tailwind/builderPlaceholder/form.ejs.js +0 -9
- package/src/templates/tailwind/builderSidebar/form.ejs.js +0 -16
- package/src/templates/tailwind/builderSidebarGroup/form.ejs.js +0 -60
- package/src/templates/tailwind/builderWizard/form.ejs.js +0 -30
- package/src/templates/tailwind/button/form.ejs.js +0 -52
- package/src/templates/tailwind/button/html.ejs.js +0 -5
- package/src/templates/tailwind/checkbox/form.ejs.js +0 -50
- package/src/templates/tailwind/checkbox/html.ejs.js +0 -22
- package/src/templates/tailwind/columns/form.ejs.js +0 -30
- package/src/templates/tailwind/component/form.ejs.js +0 -22
- package/src/templates/tailwind/componentModal/form.ejs.js +0 -44
- package/src/templates/tailwind/components/form.ejs.js +0 -7
- package/src/templates/tailwind/container/form.ejs.js +0 -9
- package/src/templates/tailwind/datagrid/form.ejs.js +0 -144
- package/src/templates/tailwind/datagrid/html.ejs.js +0 -46
- package/src/templates/tailwind/day/form.ejs.js +0 -98
- package/src/templates/tailwind/dialog/form.ejs.js +0 -5
- package/src/templates/tailwind/editgrid/form.ejs.js +0 -62
- package/src/templates/tailwind/editgrid/html.ejs.js +0 -52
- package/src/templates/tailwind/editgridTable/form.ejs.js +0 -66
- package/src/templates/tailwind/editgridTable/html.ejs.js +0 -56
- package/src/templates/tailwind/errorsList/form.ejs.js +0 -22
- package/src/templates/tailwind/field/align.ejs.js +0 -38
- package/src/templates/tailwind/field/form.ejs.js +0 -36
- package/src/templates/tailwind/fieldset/form.ejs.js +0 -30
- package/src/templates/tailwind/file/form.ejs.js +0 -224
- package/src/templates/tailwind/html/form.ejs.js +0 -25
- package/src/templates/tailwind/icon/form.ejs.js +0 -13
- package/src/templates/tailwind/input/form.ejs.js +0 -108
- package/src/templates/tailwind/input/html.ejs.js +0 -13
- package/src/templates/tailwind/label/form.ejs.js +0 -32
- package/src/templates/tailwind/loader/form.ejs.js +0 -5
- package/src/templates/tailwind/loading/form.ejs.js +0 -7
- package/src/templates/tailwind/map/form.ejs.js +0 -7
- package/src/templates/tailwind/message/form.ejs.js +0 -13
- package/src/templates/tailwind/modalPreview/form.ejs.js +0 -21
- package/src/templates/tailwind/modaldialog/form.ejs.js +0 -7
- package/src/templates/tailwind/modaledit/form.ejs.js +0 -9
- package/src/templates/tailwind/multiValueRow/form.ejs.js +0 -14
- package/src/templates/tailwind/multiValueTable/form.ejs.js +0 -16
- package/src/templates/tailwind/multipleMasksInput/form.ejs.js +0 -30
- package/src/templates/tailwind/panel/form.ejs.js +0 -58
- package/src/templates/tailwind/pdf/form.ejs.js +0 -13
- package/src/templates/tailwind/pdfBuilder/form.ejs.js +0 -9
- package/src/templates/tailwind/pdfBuilderUpload/form.ejs.js +0 -13
- package/src/templates/tailwind/radio/form.ejs.js +0 -84
- package/src/templates/tailwind/radio/html.ejs.js +0 -10
- package/src/templates/tailwind/resourceAdd/form.ejs.js +0 -11
- package/src/templates/tailwind/select/form.ejs.js +0 -46
- package/src/templates/tailwind/select/html.ejs.js +0 -13
- package/src/templates/tailwind/selectOption/form.ejs.js +0 -20
- package/src/templates/tailwind/selectOption/html.ejs.js +0 -11
- package/src/templates/tailwind/signature/form.ejs.js +0 -30
- package/src/templates/tailwind/signature/html.ejs.js +0 -5
- package/src/templates/tailwind/survey/form.ejs.js +0 -52
- package/src/templates/tailwind/survey/html.ejs.js +0 -22
- package/src/templates/tailwind/tab/flat.ejs.js +0 -16
- package/src/templates/tailwind/tab/form.ejs.js +0 -38
- package/src/templates/tailwind/table/form.ejs.js +0 -48
- package/src/templates/tailwind/tableComponents/form.ejs.js +0 -12
- package/src/templates/tailwind/tree/form.ejs.js +0 -32
- package/src/templates/tailwind/tree/partials/edit.ejs.js +0 -16
- package/src/templates/tailwind/tree/partials/view.ejs.js +0 -34
- package/src/templates/tailwind/webform/builder.ejs.js +0 -7
- package/src/templates/tailwind/webform/form.ejs.js +0 -9
- package/src/templates/tailwind/well/form.ejs.js +0 -9
- package/src/templates/tailwind/wizard/builder.ejs.js +0 -7
- package/src/templates/tailwind/wizard/form.ejs.js +0 -42
- package/src/templates/tailwind/wizardHeader/form.ejs.js +0 -32
- package/src/templates/tailwind/wizardHeaderClassic/form.ejs.js +0 -26
- package/src/templates/tailwind/wizardHeaderVertical/form.ejs.js +0 -28
- package/src/templates/tailwind/wizardNav/form.ejs.js +0 -64
package/readme.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p style="text-align: center" align="center">
|
|
2
|
-
<a href="https://tsed.
|
|
2
|
+
<a href="https://tsed.io" target="_blank"><img src="https://tsed.io/tsed-og.png" width="200" alt="Ts.ED logo"/></a>
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<div align="center">
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
</div>
|
|
15
15
|
|
|
16
16
|
<div align="center">
|
|
17
|
-
<a href="https://tsed.
|
|
17
|
+
<a href="https://tsed.io/">Website</a>
|
|
18
18
|
<span> • </span>
|
|
19
|
-
<a href="https://tsed.
|
|
19
|
+
<a href="https://tsed.io/tutorials/prisma.html">Tutorial</a>
|
|
20
20
|
<span> • </span>
|
|
21
|
-
<a href="https://
|
|
21
|
+
<a href="https://api.tsed.io/rest/slack/tsedio/tsed">Slack</a>
|
|
22
22
|
<span> • </span>
|
|
23
23
|
<a href="https://twitter.com/TsED_io">Twitter</a>
|
|
24
24
|
</div>
|
|
@@ -79,12 +79,18 @@ npx tailwindcss-cli@latest init
|
|
|
79
79
|
Edit the `tailwind.config.js` and copy the following content:
|
|
80
80
|
|
|
81
81
|
```js
|
|
82
|
+
import { tailwindPreset } from "@tsed/tailwind-formio/tailwind.preset";
|
|
83
|
+
|
|
82
84
|
const primary = "hsla(208, 100%, 43%, 1)";
|
|
83
85
|
const secondary = "hsla(190, 81%, 42%, 1)";
|
|
84
86
|
|
|
85
87
|
module.exports = {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
content: [
|
|
89
|
+
"./node_modules/**/*.{js,jsx,ts,tsx,ejs}"
|
|
90
|
+
// add your paths
|
|
91
|
+
],
|
|
92
|
+
presets: [],
|
|
93
|
+
darkMode: "class",
|
|
88
94
|
theme: {
|
|
89
95
|
extend: {
|
|
90
96
|
colors: {
|
|
@@ -115,131 +121,9 @@ module.exports = {
|
|
|
115
121
|
900: "hsla(190, 81%, 20%, 1)"
|
|
116
122
|
},
|
|
117
123
|
"gray-darker": "#504747"
|
|
118
|
-
},
|
|
119
|
-
spacing: {
|
|
120
|
-
7.5: "1.875rem", // 30px
|
|
121
|
-
15: "3.75rem", // 60px
|
|
122
|
-
22: "5.5rem", // 88px
|
|
123
|
-
25: "6.25rem", // 100px
|
|
124
|
-
26: "6.5rem", // 104px
|
|
125
|
-
30: "8.5rem", // 136px
|
|
126
|
-
32: "9rem", // 144px
|
|
127
|
-
68: "17rem" // 272px
|
|
128
|
-
},
|
|
129
|
-
padding: {
|
|
130
|
-
px: "1px"
|
|
131
|
-
},
|
|
132
|
-
margin: {
|
|
133
|
-
px: "1px",
|
|
134
|
-
"-px": "-1px",
|
|
135
|
-
"-2px": "-2px",
|
|
136
|
-
auto: "auto"
|
|
137
|
-
},
|
|
138
|
-
fontSize: {
|
|
139
|
-
micro: ".5rem", // 8px
|
|
140
|
-
xxs: ".625rem", // 10px
|
|
141
|
-
md: "1.125rem" // 18px
|
|
142
|
-
},
|
|
143
|
-
fontWeight: {
|
|
144
|
-
hairline: 100
|
|
145
|
-
},
|
|
146
|
-
fontFamily: {
|
|
147
|
-
brand: ["Source Sans Pro", "sans-serif"],
|
|
148
|
-
sans: ["Source Sans Pro", "sans-serif"],
|
|
149
|
-
serif: ["Source Sans Pro", "sans-serif"],
|
|
150
|
-
inconsolata: ["Inconsolata"],
|
|
151
|
-
source: ["source-code-pro", "Menlo", "Monaco", "Consolas", "Courier New", "monospace"]
|
|
152
|
-
},
|
|
153
|
-
minWidth: {
|
|
154
|
-
site: "18.75rem",
|
|
155
|
-
"input-mini": "17.5rem",
|
|
156
|
-
"input-small": "31.25rem",
|
|
157
|
-
"input-medium": "36.3125rem",
|
|
158
|
-
"input-large": "61.45rem",
|
|
159
|
-
"button-mini": "5.5rem",
|
|
160
|
-
"button-small": "7rem",
|
|
161
|
-
"button-medium": "9.875rem",
|
|
162
|
-
"button-large": "10rem"
|
|
163
|
-
},
|
|
164
|
-
width: {
|
|
165
|
-
arrow: ".8rem",
|
|
166
|
-
"3/10": "30%",
|
|
167
|
-
"7/10": "70%",
|
|
168
|
-
"9/10": "90%",
|
|
169
|
-
"12/25": "48%"
|
|
170
|
-
},
|
|
171
|
-
maxWidth: {
|
|
172
|
-
sm: "30rem",
|
|
173
|
-
md: "40rem",
|
|
174
|
-
lg: "50rem",
|
|
175
|
-
xl: "60rem",
|
|
176
|
-
"2xl": "70rem",
|
|
177
|
-
"3xl": "80rem",
|
|
178
|
-
"4xl": "90rem",
|
|
179
|
-
"5xl": "100rem",
|
|
180
|
-
"1/4": "25%",
|
|
181
|
-
"1/2": "50%",
|
|
182
|
-
"3/5": "60%",
|
|
183
|
-
"4/5": "80%",
|
|
184
|
-
"9/10": "90%",
|
|
185
|
-
"site-mini": "17.5rem",
|
|
186
|
-
"site-small": "31.25rem",
|
|
187
|
-
"site-medium": "43.75rem",
|
|
188
|
-
"site-large": "56.25rem",
|
|
189
|
-
site: "73.75rem",
|
|
190
|
-
screen: "100vw"
|
|
191
|
-
},
|
|
192
|
-
height: {
|
|
193
|
-
arrow: ".4rem",
|
|
194
|
-
px: "1px",
|
|
195
|
-
4: "1rem",
|
|
196
|
-
5: "1.25rem",
|
|
197
|
-
8: "1.8rem",
|
|
198
|
-
9: "2.25rem",
|
|
199
|
-
10: "2.5rem",
|
|
200
|
-
11: "2.75rem",
|
|
201
|
-
12: "3rem",
|
|
202
|
-
16: "4rem",
|
|
203
|
-
24: "6rem",
|
|
204
|
-
32: "8rem"
|
|
205
|
-
},
|
|
206
|
-
borderWidth: {
|
|
207
|
-
1: "1px",
|
|
208
|
-
5: "5px"
|
|
209
|
-
},
|
|
210
|
-
borderRadius: {
|
|
211
|
-
half: "50%",
|
|
212
|
-
full: "100%"
|
|
213
|
-
},
|
|
214
|
-
zIndex: {
|
|
215
|
-
1: 1,
|
|
216
|
-
2: 2,
|
|
217
|
-
3: 3,
|
|
218
|
-
4: 4,
|
|
219
|
-
5: 5,
|
|
220
|
-
6: 6
|
|
221
|
-
},
|
|
222
|
-
fill: {
|
|
223
|
-
transparent: "transparent"
|
|
224
|
-
},
|
|
225
|
-
flex: {
|
|
226
|
-
2: "2 2 0%",
|
|
227
|
-
3: "3 3 0%"
|
|
228
124
|
}
|
|
229
|
-
},
|
|
230
|
-
outline: {
|
|
231
|
-
none: ["2px solid transparent", "2px"],
|
|
232
|
-
white: ["2px dotted white", "2px"],
|
|
233
|
-
black: ["2px dotted black", "2px"]
|
|
234
125
|
}
|
|
235
|
-
}
|
|
236
|
-
variants: {
|
|
237
|
-
extend: {}
|
|
238
|
-
},
|
|
239
|
-
corePlugins: {
|
|
240
|
-
borderCollapse: true
|
|
241
|
-
},
|
|
242
|
-
plugins: []
|
|
126
|
+
}
|
|
243
127
|
};
|
|
244
128
|
```
|
|
245
129
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import colors from "tailwindcss/colors.js";
|
|
2
|
+
|
|
3
|
+
import { tailwindPreset } from "./preset.js";
|
|
4
|
+
|
|
5
|
+
const mergedColors = {
|
|
6
|
+
...colors,
|
|
7
|
+
...tailwindPreset.theme.extend.colors
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { mergedColors as colors };
|
|
11
|
+
export const COLORS = Object.keys(mergedColors).reduce((obj, key) => {
|
|
12
|
+
return {
|
|
13
|
+
...obj,
|
|
14
|
+
[key]: key
|
|
15
|
+
};
|
|
16
|
+
}, {});
|
|
17
|
+
|
|
18
|
+
export const COLORS_LIST = Object.keys(COLORS)
|
|
19
|
+
.filter((key) => !["current"].includes(key) && !key.match("-active"))
|
|
20
|
+
.sort((a, b) => (a < b ? -1 : 1));
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import type { Config } from "tailwindcss";
|
|
2
|
+
|
|
3
|
+
const primary = "hsla(208, 100%, 43%, 1)";
|
|
4
|
+
const secondary = "hsla(190, 81%, 42%, 1)";
|
|
5
|
+
|
|
6
|
+
export const tailwindPreset = {
|
|
7
|
+
content: [],
|
|
8
|
+
theme: {
|
|
9
|
+
extend: {
|
|
10
|
+
colors: {
|
|
11
|
+
primary: {
|
|
12
|
+
DEFAULT: primary,
|
|
13
|
+
50: "hsla(208, 100%, 91%, 1)",
|
|
14
|
+
100: "hsla(208, 100%, 83%, 1)",
|
|
15
|
+
200: "hsla(208, 100%, 75%, 1)",
|
|
16
|
+
300: "hsla(208, 100%, 67%, 1)",
|
|
17
|
+
400: "hsla(208, 100%, 59%, 1)",
|
|
18
|
+
500: "hsla(208, 100%, 51%, 1)",
|
|
19
|
+
600: primary,
|
|
20
|
+
700: "hsla(208, 100%, 35%, 1)",
|
|
21
|
+
800: "hsla(208, 100%, 27%, 1)",
|
|
22
|
+
900: "hsla(208, 100%, 19%, 1)"
|
|
23
|
+
},
|
|
24
|
+
secondary: {
|
|
25
|
+
DEFAULT: secondary,
|
|
26
|
+
50: "hsla(190, 81%, 90%, 1)",
|
|
27
|
+
100: "hsla(190, 81%, 82%, 1)",
|
|
28
|
+
200: "hsla(190, 81%, 74%, 1)",
|
|
29
|
+
300: "hsla(190, 81%, 66%, 1)",
|
|
30
|
+
400: "hsla(190, 81%, 58%, 1)",
|
|
31
|
+
500: "hsla(190, 81%, 50%, 1)",
|
|
32
|
+
600: secondary,
|
|
33
|
+
700: "hsla(190, 81%, 34%, 1)",
|
|
34
|
+
800: "hsla(190, 81%, 28%, 1)",
|
|
35
|
+
900: "hsla(190, 81%, 20%, 1)"
|
|
36
|
+
},
|
|
37
|
+
"gray-darker": "#504747"
|
|
38
|
+
},
|
|
39
|
+
spacing: {
|
|
40
|
+
7.5: "1.875rem", // 30px
|
|
41
|
+
15: "3.75rem", // 60px
|
|
42
|
+
22: "5.5rem", // 88px
|
|
43
|
+
25: "6.25rem", // 100px
|
|
44
|
+
26: "6.5rem", // 104px
|
|
45
|
+
30: "8.5rem", // 136px
|
|
46
|
+
32: "9rem", // 144px
|
|
47
|
+
68: "17rem" // 272px
|
|
48
|
+
},
|
|
49
|
+
padding: {
|
|
50
|
+
px: "1px"
|
|
51
|
+
},
|
|
52
|
+
margin: {
|
|
53
|
+
px: "1px",
|
|
54
|
+
"-px": "-1px",
|
|
55
|
+
"-2px": "-2px",
|
|
56
|
+
auto: "auto"
|
|
57
|
+
},
|
|
58
|
+
fontSize: {
|
|
59
|
+
micro: ".5rem", // 8px
|
|
60
|
+
xxs: ".625rem", // 10px
|
|
61
|
+
md: "1.125rem" // 18px
|
|
62
|
+
},
|
|
63
|
+
fontWeight: {
|
|
64
|
+
hairline: "100"
|
|
65
|
+
},
|
|
66
|
+
fontFamily: {
|
|
67
|
+
brand: ["Source Sans Pro", "sans-serif"],
|
|
68
|
+
sans: ["Source Sans Pro", "sans-serif"],
|
|
69
|
+
serif: ["Source Sans Pro", "sans-serif"],
|
|
70
|
+
inconsolata: ["Inconsolata"],
|
|
71
|
+
source: ["source-code-pro", "Menlo", "Monaco", "Consolas", "Courier New", "monospace"]
|
|
72
|
+
},
|
|
73
|
+
minWidth: {
|
|
74
|
+
site: "18.75rem",
|
|
75
|
+
"input-mini": "17.5rem",
|
|
76
|
+
"input-small": "31.25rem",
|
|
77
|
+
"input-medium": "36.3125rem",
|
|
78
|
+
"input-large": "61.45rem",
|
|
79
|
+
"button-mini": "5.5rem",
|
|
80
|
+
"button-small": "7rem",
|
|
81
|
+
"button-medium": "9.875rem",
|
|
82
|
+
"button-large": "10rem"
|
|
83
|
+
},
|
|
84
|
+
width: {
|
|
85
|
+
arrow: ".8rem",
|
|
86
|
+
"3/10": "30%",
|
|
87
|
+
"7/10": "70%",
|
|
88
|
+
"9/10": "90%",
|
|
89
|
+
"12/25": "48%"
|
|
90
|
+
},
|
|
91
|
+
maxWidth: {
|
|
92
|
+
sm: "30rem",
|
|
93
|
+
md: "40rem",
|
|
94
|
+
lg: "50rem",
|
|
95
|
+
xl: "60rem",
|
|
96
|
+
"2xl": "70rem",
|
|
97
|
+
"3xl": "80rem",
|
|
98
|
+
"4xl": "90rem",
|
|
99
|
+
"5xl": "100rem",
|
|
100
|
+
"1/4": "25%",
|
|
101
|
+
"1/2": "50%",
|
|
102
|
+
"3/5": "60%",
|
|
103
|
+
"4/5": "80%",
|
|
104
|
+
"9/10": "90%",
|
|
105
|
+
"site-mini": "17.5rem",
|
|
106
|
+
"site-small": "31.25rem",
|
|
107
|
+
"site-medium": "43.75rem",
|
|
108
|
+
"site-large": "56.25rem",
|
|
109
|
+
site: "73.75rem",
|
|
110
|
+
screen: "100vw"
|
|
111
|
+
},
|
|
112
|
+
height: {
|
|
113
|
+
arrow: ".4rem",
|
|
114
|
+
px: "1px",
|
|
115
|
+
4: "1rem",
|
|
116
|
+
5: "1.25rem",
|
|
117
|
+
8: "1.8rem",
|
|
118
|
+
9: "2.25rem",
|
|
119
|
+
10: "2.5rem",
|
|
120
|
+
11: "2.75rem",
|
|
121
|
+
12: "3rem",
|
|
122
|
+
16: "4rem",
|
|
123
|
+
24: "6rem",
|
|
124
|
+
32: "8rem"
|
|
125
|
+
},
|
|
126
|
+
borderWidth: {
|
|
127
|
+
1: "1px",
|
|
128
|
+
5: "5px"
|
|
129
|
+
},
|
|
130
|
+
borderRadius: {
|
|
131
|
+
half: "50%",
|
|
132
|
+
full: "100%"
|
|
133
|
+
},
|
|
134
|
+
zIndex: {
|
|
135
|
+
1: "1",
|
|
136
|
+
2: "2",
|
|
137
|
+
3: "3",
|
|
138
|
+
4: "4",
|
|
139
|
+
5: "5",
|
|
140
|
+
6: "6"
|
|
141
|
+
},
|
|
142
|
+
fill: {
|
|
143
|
+
transparent: "transparent"
|
|
144
|
+
},
|
|
145
|
+
flex: {
|
|
146
|
+
2: "2 2 0%",
|
|
147
|
+
3: "3 3 0%"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
outline: {
|
|
151
|
+
none: ["2px solid transparent", "2px"],
|
|
152
|
+
white: ["2px dotted white", "2px"],
|
|
153
|
+
black: ["2px dotted black", "2px"]
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
variants: {
|
|
157
|
+
extend: {}
|
|
158
|
+
},
|
|
159
|
+
corePlugins: {
|
|
160
|
+
borderCollapse: true
|
|
161
|
+
},
|
|
162
|
+
plugins: []
|
|
163
|
+
} satisfies Config;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Form } from "formiojs";
|
|
2
|
+
import cloneDeep from "lodash/cloneDeep";
|
|
3
|
+
import React, { useEffect, useRef } from "react";
|
|
4
|
+
|
|
5
|
+
function createCustomValidation(customAction, ref) {
|
|
6
|
+
return async (submission, next) => {
|
|
7
|
+
try {
|
|
8
|
+
const updatedSubmission = await customAction(submission);
|
|
9
|
+
|
|
10
|
+
next(null);
|
|
11
|
+
|
|
12
|
+
ref.current.onSubmit(updatedSubmission, true);
|
|
13
|
+
} catch (er) {
|
|
14
|
+
next(er.errors || er);
|
|
15
|
+
} finally {
|
|
16
|
+
ref.current.submissionInProcess = false;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function listenEvents(props, webform) {
|
|
22
|
+
Object.keys(props).forEach((key) => {
|
|
23
|
+
if (key.startsWith("on") && key !== "onAsyncSubmit") {
|
|
24
|
+
// remove first 2 characters and lowercase the first letter
|
|
25
|
+
const eventName = key.charAt(2).toLowerCase() + key.slice(3);
|
|
26
|
+
|
|
27
|
+
webform.on(eventName, props[key]);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function useForm({ options, form, src, FormClass = Form, submission, ...props }) {
|
|
33
|
+
const renderElement = useRef();
|
|
34
|
+
const instanceRef = useRef();
|
|
35
|
+
const webFormRef = useRef();
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (renderElement.current === null) {
|
|
39
|
+
console.warn("Form element not found");
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (!form && !src) {
|
|
44
|
+
console.warn("Form source not found");
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let opts = options || {};
|
|
49
|
+
|
|
50
|
+
if (props.onAsyncSubmit) {
|
|
51
|
+
opts.hooks = opts.hooks || {};
|
|
52
|
+
opts.hooks.customValidation = createCustomValidation(props.onAsyncSubmit, webFormRef);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const formio = new FormClass(renderElement.current, form ? cloneDeep(form) : src, opts);
|
|
56
|
+
formio.toJSON = () => ({ __FORM__: true });
|
|
57
|
+
|
|
58
|
+
formio.ready.then((webform) => {
|
|
59
|
+
webFormRef.current = webform;
|
|
60
|
+
// FIX to avoid JSON.stringify circular reference
|
|
61
|
+
webform.toJSON = () => ({ __WEBFORM__: true });
|
|
62
|
+
|
|
63
|
+
console.log("Created form");
|
|
64
|
+
|
|
65
|
+
if (submission) {
|
|
66
|
+
webform.setSubmission(submission);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
listenEvents(props, webform);
|
|
70
|
+
|
|
71
|
+
renderElement.current.className = "formio-form-ready";
|
|
72
|
+
instanceRef.current = webform;
|
|
73
|
+
|
|
74
|
+
if (props.onFormReady) {
|
|
75
|
+
// FIX for unit test when onFormReady is a stub
|
|
76
|
+
props.onFormReady(webform);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
return () => {
|
|
81
|
+
return formio.destroy(true);
|
|
82
|
+
};
|
|
83
|
+
}, [form, src]);
|
|
84
|
+
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (submission && instanceRef.current) {
|
|
87
|
+
console.log("Setting submission", submission);
|
|
88
|
+
webFormRef.current.setSubmission(submission);
|
|
89
|
+
}
|
|
90
|
+
}, [submission]);
|
|
91
|
+
|
|
92
|
+
return { element: renderElement };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function WrapperForm({ className, style, ...props }) {
|
|
96
|
+
const { element } = useForm(props);
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<div className={className} style={style}>
|
|
100
|
+
<div data-testid='formio-container' ref={element} />
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
}
|