@tsed/react-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/dist/atoms/icon/Icon.d.ts +6 -0
- package/dist/atoms/icon/Icon.js +12 -0
- package/dist/atoms/icon/Icon.js.map +1 -0
- package/dist/chunks/_commonjsHelpers.js +7 -0
- package/dist/chunks/_commonjsHelpers.js.map +1 -0
- package/dist/chunks/index.js +43 -0
- package/dist/chunks/index.js.map +1 -0
- package/dist/chunks/index.module.js +56 -0
- package/dist/chunks/index.module.js.map +1 -0
- package/dist/chunks/react-select-animated.esm.js +3513 -0
- package/dist/chunks/react-select-animated.esm.js.map +1 -0
- package/dist/hooks/useTooltip.d.ts +2 -3
- package/dist/hooks/useTooltip.js +12 -0
- package/dist/hooks/useTooltip.js.map +1 -0
- package/dist/index.d.ts +7 -13
- package/dist/index.js +14 -7653
- package/dist/index.js.map +1 -1
- package/dist/interfaces/ActionType.d.ts +23 -0
- package/dist/interfaces/ActionType.js +2 -0
- package/dist/interfaces/ActionType.js.map +1 -0
- package/dist/interfaces/ColumnIdentifier.d.ts +14 -14
- package/dist/interfaces/ColumnIdentifier.js +2 -0
- package/dist/interfaces/ColumnIdentifier.js.map +1 -0
- package/dist/interfaces/ComponentType.d.ts +2 -0
- package/dist/interfaces/ComponentType.js +2 -0
- package/dist/interfaces/ComponentType.js.map +1 -0
- package/dist/interfaces/FormOptions.d.ts +13 -10
- package/dist/interfaces/FormOptions.js +2 -0
- package/dist/interfaces/FormOptions.js.map +1 -0
- package/dist/interfaces/{FormSchema.d.ts → FormType.d.ts} +12 -12
- package/dist/interfaces/FormType.js +2 -0
- package/dist/interfaces/FormType.js.map +1 -0
- package/dist/interfaces/Operation.d.ts +28 -29
- package/dist/interfaces/Operation.js +2 -0
- package/dist/interfaces/Operation.js.map +1 -0
- package/dist/interfaces/QueryOptions.d.ts +23 -23
- package/dist/interfaces/QueryOptions.js +2 -0
- package/dist/interfaces/QueryOptions.js.map +1 -0
- package/dist/interfaces/{RoleSchema.d.ts → RoleType.d.ts} +6 -6
- package/dist/interfaces/RoleType.js +2 -0
- package/dist/interfaces/RoleType.js.map +1 -0
- package/dist/interfaces/SubmissionType.d.ts +29 -0
- package/dist/interfaces/SubmissionType.js +2 -0
- package/dist/interfaces/SubmissionType.js.map +1 -0
- package/dist/interfaces/index.d.ts +9 -8
- package/dist/interfaces/index.js +2 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/molecules/alert/Alert.d.ts +6 -0
- package/dist/molecules/alert/Alert.js +27 -0
- package/dist/molecules/alert/Alert.js.map +1 -0
- package/dist/molecules/button/Button.d.ts +8 -0
- package/dist/molecules/button/Button.js +52 -0
- package/dist/molecules/button/Button.js.map +1 -0
- package/dist/{components/card/card.component.d.ts → molecules/card/Card.d.ts} +6 -7
- package/dist/molecules/card/Card.js +12 -0
- package/dist/molecules/card/Card.js.map +1 -0
- package/dist/molecules/forms/form-control/FormControl.d.ts +17 -0
- package/dist/molecules/forms/form-control/FormControl.js +51 -0
- package/dist/molecules/forms/form-control/FormControl.js.map +1 -0
- package/dist/molecules/forms/input-tags/InputTags.d.ts +2 -0
- package/dist/molecules/forms/input-tags/InputTags.interface.d.ts +7 -0
- package/dist/molecules/forms/input-tags/InputTags.interface.js +2 -0
- package/dist/molecules/forms/input-tags/InputTags.interface.js.map +1 -0
- package/dist/molecules/forms/input-tags/InputTags.js +25 -0
- package/dist/molecules/forms/input-tags/InputTags.js.map +1 -0
- package/dist/molecules/forms/input-tags/all.d.ts +2 -0
- package/dist/molecules/forms/input-tags/all.js +9 -0
- package/dist/molecules/forms/input-tags/all.js.map +1 -0
- package/dist/molecules/forms/input-tags/components/ChoicesTags.d.ts +307 -0
- package/dist/molecules/forms/input-tags/components/ChoicesTags.js +51 -0
- package/dist/molecules/forms/input-tags/components/ChoicesTags.js.map +1 -0
- package/dist/molecules/forms/input-tags/components/ReactTags.d.ts +2 -0
- package/dist/molecules/forms/input-tags/components/ReactTags.js +1937 -0
- package/dist/molecules/forms/input-tags/components/ReactTags.js.map +1 -0
- package/dist/molecules/forms/input-text/InputText.d.ts +2 -0
- package/dist/molecules/forms/input-text/InputText.interface.d.ts +4 -0
- package/dist/molecules/forms/input-text/InputText.interface.js +2 -0
- package/dist/molecules/forms/input-text/InputText.interface.js.map +1 -0
- package/dist/molecules/forms/input-text/InputText.js +54 -0
- package/dist/molecules/forms/input-text/InputText.js.map +1 -0
- package/dist/molecules/forms/select/Select.d.ts +2 -0
- package/dist/molecules/forms/select/Select.interface.d.ts +38 -0
- package/dist/molecules/forms/select/Select.interface.js +2 -0
- package/dist/molecules/forms/select/Select.interface.js.map +1 -0
- package/dist/molecules/forms/select/Select.js +16 -0
- package/dist/molecules/forms/select/Select.js.map +1 -0
- package/dist/molecules/forms/select/all.d.ts +2 -0
- package/dist/molecules/forms/select/all.js +9 -0
- package/dist/molecules/forms/select/all.js.map +1 -0
- package/dist/molecules/forms/select/components/ChoicesSelect.d.ts +7 -0
- package/dist/molecules/forms/select/components/ChoicesSelect.js +115 -0
- package/dist/molecules/forms/select/components/ChoicesSelect.js.map +1 -0
- package/dist/molecules/forms/select/components/HtmlSelect.d.ts +2 -0
- package/dist/molecules/forms/select/components/HtmlSelect.js +35 -0
- package/dist/molecules/forms/select/components/HtmlSelect.js.map +1 -0
- package/dist/molecules/forms/select/components/ReactSelect.d.ts +2 -0
- package/dist/molecules/forms/select/components/ReactSelect.js +46 -0
- package/dist/molecules/forms/select/components/ReactSelect.js.map +1 -0
- package/dist/molecules/forms/select/components/choices.template.d.ts +7 -0
- package/dist/molecules/forms/select/components/choices.template.js +9654 -0
- package/dist/molecules/forms/select/components/choices.template.js.map +1 -0
- package/dist/molecules/forms/select/hooks/useOptions.d.ts +9 -0
- package/dist/molecules/forms/select/hooks/useOptions.js +35 -0
- package/dist/molecules/forms/select/hooks/useOptions.js.map +1 -0
- package/dist/molecules/loader/Loader.d.ts +8 -0
- package/dist/molecules/loader/Loader.js +19 -0
- package/dist/molecules/loader/Loader.js.map +1 -0
- package/dist/{components/modal/modal.component.d.ts → molecules/modal/Modal.d.ts} +15 -15
- package/dist/molecules/modal/Modal.js +62 -0
- package/dist/molecules/modal/Modal.js.map +1 -0
- package/dist/molecules/pagination/Pagination.d.ts +18 -0
- package/dist/molecules/pagination/Pagination.js +77 -0
- package/dist/molecules/pagination/Pagination.js.map +1 -0
- package/dist/molecules/pagination/PaginationButton.d.ts +7 -0
- package/dist/molecules/pagination/PaginationButton.js +21 -0
- package/dist/molecules/pagination/PaginationButton.js.map +1 -0
- package/dist/molecules/pagination/all.d.ts +2 -0
- package/dist/molecules/pagination/all.js +12 -0
- package/dist/molecules/pagination/all.js.map +1 -0
- package/dist/{components/table → molecules/pagination}/utils/getPageNumbers.d.ts +3 -3
- package/dist/molecules/pagination/utils/getPageNumbers.js +25 -0
- package/dist/molecules/pagination/utils/getPageNumbers.js.map +1 -0
- package/dist/molecules/table/Table.d.ts +9 -0
- package/dist/molecules/table/Table.js +58 -0
- package/dist/molecules/table/Table.js.map +1 -0
- package/dist/molecules/table/all.d.ts +0 -0
- package/dist/molecules/table/all.js +19 -0
- package/dist/molecules/table/all.js.map +1 -0
- package/dist/molecules/table/components/DefaultArrowSort.d.ts +5 -0
- package/dist/molecules/table/components/DefaultArrowSort.js +22 -0
- package/dist/molecules/table/components/DefaultArrowSort.js.map +1 -0
- package/dist/molecules/table/components/DefaultCell.d.ts +5 -0
- package/dist/molecules/table/components/DefaultCell.js +13 -0
- package/dist/molecules/table/components/DefaultCell.js.map +1 -0
- package/dist/molecules/table/components/DefaultCellFooter.d.ts +6 -0
- package/dist/molecules/table/components/DefaultCellFooter.js +12 -0
- package/dist/molecules/table/components/DefaultCellFooter.js.map +1 -0
- package/dist/molecules/table/components/DefaultCellHeader.d.ts +6 -0
- package/dist/molecules/table/components/DefaultCellHeader.js +30 -0
- package/dist/molecules/table/components/DefaultCellHeader.js.map +1 -0
- package/dist/molecules/table/components/DefaultCellOperations.d.ts +10 -0
- package/dist/molecules/table/components/DefaultCellOperations.js +24 -0
- package/dist/molecules/table/components/DefaultCellOperations.js.map +1 -0
- package/dist/molecules/table/components/DefaultFilter.d.ts +11 -0
- package/dist/molecules/table/components/DefaultFilter.js +15 -0
- package/dist/molecules/table/components/DefaultFilter.js.map +1 -0
- package/dist/molecules/table/components/DefaultOperationButton.d.ts +11 -0
- package/dist/molecules/table/components/DefaultOperationButton.js +30 -0
- package/dist/molecules/table/components/DefaultOperationButton.js.map +1 -0
- package/dist/molecules/table/filters/Filters.d.js +2 -0
- package/dist/molecules/table/filters/Filters.d.js.map +1 -0
- package/dist/molecules/table/filters/RangeFilter.d.ts +3 -0
- package/dist/molecules/table/filters/RangeFilter.js +42 -0
- package/dist/molecules/table/filters/RangeFilter.js.map +1 -0
- package/dist/molecules/table/filters/SelectFilter.d.ts +3 -0
- package/dist/molecules/table/filters/SelectFilter.js +35 -0
- package/dist/molecules/table/filters/SelectFilter.js.map +1 -0
- package/dist/molecules/table/filters/TextFieldFilter.d.ts +3 -0
- package/dist/molecules/table/filters/TextFieldFilter.js +27 -0
- package/dist/molecules/table/filters/TextFieldFilter.js.map +1 -0
- package/dist/molecules/table/hooks/useTable.d.ts +15 -0
- package/dist/molecules/table/hooks/useTable.js +34 -0
- package/dist/molecules/table/hooks/useTable.js.map +1 -0
- package/dist/molecules/table/hooks/useUniqValues.d.ts +5 -0
- package/dist/molecules/table/hooks/useUniqValues.js +11 -0
- package/dist/molecules/table/hooks/useUniqValues.js.map +1 -0
- package/dist/molecules/table/interfaces/extends.d.ts +14 -0
- package/dist/molecules/table/interfaces/extends.js +2 -0
- package/dist/molecules/table/interfaces/extends.js.map +1 -0
- package/dist/molecules/table/utils/mapFormToColumns.d.ts +3 -0
- package/dist/molecules/table/utils/mapFormToColumns.js +39 -0
- package/dist/molecules/table/utils/mapFormToColumns.js.map +1 -0
- package/dist/{components/tabs/tabs.component.d.ts → molecules/tabs/Tabs.d.ts} +19 -19
- package/dist/molecules/tabs/Tabs.js +72 -0
- package/dist/molecules/tabs/Tabs.js.map +1 -0
- package/dist/organisms/form/Form.d.ts +22 -0
- package/dist/organisms/form/Form.js +15 -0
- package/dist/organisms/form/Form.js.map +1 -0
- package/dist/organisms/form/access/FormAccess.d.ts +9 -0
- package/dist/organisms/form/access/FormAccess.js +94 -0
- package/dist/organisms/form/access/FormAccess.js.map +1 -0
- package/dist/organisms/form/access/FormAccess.schema.d.ts +4 -0
- package/dist/organisms/form/access/FormAccess.schema.js +164 -0
- package/dist/organisms/form/access/FormAccess.schema.js.map +1 -0
- package/dist/organisms/form/access/FormAccess.utils.d.ts +23 -0
- package/dist/organisms/form/access/FormAccess.utils.js +68 -0
- package/dist/organisms/form/access/FormAccess.utils.js.map +1 -0
- package/dist/organisms/form/action/FormAction.d.ts +9 -0
- package/dist/organisms/form/action/FormAction.js +32 -0
- package/dist/organisms/form/action/FormAction.js.map +1 -0
- package/dist/organisms/form/builder/FormBuilder.d.ts +7 -0
- package/dist/organisms/form/builder/FormBuilder.js +17 -0
- package/dist/organisms/form/builder/FormBuilder.js.map +1 -0
- package/dist/organisms/form/builder/FormEdit.d.ts +8 -0
- package/dist/organisms/form/builder/FormEdit.js +70 -0
- package/dist/organisms/form/builder/FormEdit.js.map +1 -0
- package/dist/organisms/form/builder/FormEdit.reducer.d.ts +10 -0
- package/dist/organisms/form/builder/FormEdit.reducer.js +65 -0
- package/dist/organisms/form/builder/FormEdit.reducer.js.map +1 -0
- package/dist/organisms/form/builder/FormEditCtas.d.ts +15 -0
- package/dist/organisms/form/builder/FormEditCtas.js +52 -0
- package/dist/organisms/form/builder/FormEditCtas.js.map +1 -0
- package/dist/organisms/form/builder/FormParameters.d.ts +24 -0
- package/dist/organisms/form/builder/FormParameters.js +84 -0
- package/dist/organisms/form/builder/FormParameters.js.map +1 -0
- package/dist/organisms/form/builder/all.d.ts +6 -0
- package/dist/organisms/form/builder/all.js +26 -0
- package/dist/organisms/form/builder/all.js.map +1 -0
- package/dist/organisms/form/builder/useFormBuilder.d.ts +28 -0
- package/dist/organisms/form/builder/useFormBuilder.js +71 -0
- package/dist/organisms/form/builder/useFormBuilder.js.map +1 -0
- package/dist/{components/form-edit/useFormEdit.hook.d.ts → organisms/form/builder/useFormEdit.d.ts} +29 -29
- package/dist/organisms/form/builder/useFormEdit.js +36 -0
- package/dist/organisms/form/builder/useFormEdit.js.map +1 -0
- package/dist/{components/form-settings/formSettings.component.d.ts → organisms/form/settings/FormSettings.d.ts} +7 -8
- package/dist/organisms/form/settings/FormSettings.js +38 -0
- package/dist/organisms/form/settings/FormSettings.js.map +1 -0
- package/dist/organisms/form/settings/FormSettings.schema.d.ts +2 -0
- package/dist/organisms/form/settings/FormSettings.schema.js +60 -0
- package/dist/organisms/form/settings/FormSettings.schema.js.map +1 -0
- package/dist/organisms/form/settings/FormSettings.utils.d.ts +8 -0
- package/dist/organisms/form/settings/FormSettings.utils.js +23 -0
- package/dist/organisms/form/settings/FormSettings.utils.js.map +1 -0
- package/dist/organisms/form/types.d.ts +15 -0
- package/dist/organisms/form/types.js +2 -0
- package/dist/organisms/form/types.js.map +1 -0
- package/dist/organisms/form/useForm.d.ts +65 -0
- package/dist/organisms/form/useForm.js +776 -0
- package/dist/organisms/form/useForm.js.map +1 -0
- package/dist/{components/modal/removeModal.component.d.ts → organisms/modal/RemoveModal.d.ts} +9 -9
- package/dist/organisms/modal/RemoveModal.js +71 -0
- package/dist/organisms/modal/RemoveModal.js.map +1 -0
- package/dist/organisms/table/actions/ActionsTable.d.ts +10 -0
- package/dist/organisms/table/actions/ActionsTable.js +46 -0
- package/dist/organisms/table/actions/ActionsTable.js.map +1 -0
- package/dist/organisms/table/forms/FormsTable.d.ts +9 -0
- package/dist/organisms/table/forms/FormsTable.js +57 -0
- package/dist/organisms/table/forms/FormsTable.js.map +1 -0
- package/dist/organisms/table/forms/components/FormsCell.d.ts +5 -0
- package/dist/organisms/table/forms/components/FormsCell.js +50 -0
- package/dist/organisms/table/forms/components/FormsCell.js.map +1 -0
- package/dist/organisms/table/submissions/SubmissionsTable.d.ts +6 -0
- package/dist/organisms/table/submissions/SubmissionsTable.js +11 -0
- package/dist/organisms/table/submissions/SubmissionsTable.js.map +1 -0
- package/dist/react-app-env.d.js +2 -0
- package/dist/react-app-env.d.js.map +1 -0
- package/dist/react-table.d.js +2 -0
- package/dist/react-table.d.js.map +1 -0
- package/dist/registries/components.d.ts +3 -0
- package/dist/registries/components.js +19 -0
- package/dist/registries/components.js.map +1 -0
- package/dist/typings.d.js +2 -0
- package/dist/typings.d.js.map +1 -0
- package/dist/utils/getEventValue.d.ts +1 -1
- package/dist/utils/getEventValue.js +8 -0
- package/dist/utils/getEventValue.js.map +1 -0
- package/dist/utils/iconClass.d.ts +1 -1
- package/dist/utils/iconClass.js +9 -0
- package/dist/utils/iconClass.js.map +1 -0
- package/dist/utils/mapPagination.d.ts +1 -1
- package/dist/utils/mapPagination.js +11 -0
- package/dist/utils/mapPagination.js.map +1 -0
- package/dist/utils/stopPropagationWrapper.d.ts +1 -1
- package/dist/utils/stopPropagationWrapper.js +7 -0
- package/dist/utils/stopPropagationWrapper.js.map +1 -0
- package/package.json +29 -18
- package/readme.md +33 -20
- package/src/atoms/icon/Icon.stories.tsx +124 -0
- package/src/atoms/icon/Icon.tsx +16 -0
- package/src/index.ts +1 -6
- package/src/interfaces/ActionType.ts +26 -0
- package/src/interfaces/ComponentType.ts +3 -0
- package/src/interfaces/FormOptions.ts +4 -1
- package/src/interfaces/{FormSchema.ts → FormType.ts} +3 -3
- package/src/interfaces/Operation.ts +2 -2
- package/src/interfaces/{RoleSchema.ts → RoleType.ts} +1 -1
- package/src/interfaces/SubmissionType.ts +20 -0
- package/src/interfaces/index.ts +5 -4
- package/src/molecules/__fixtures__/build.js +28 -0
- package/src/molecules/__fixtures__/form-firstname.fixture.json +256 -0
- package/src/molecules/__fixtures__/form-schema.json +350 -0
- package/src/molecules/__fixtures__/form-submissions.json +11942 -0
- package/src/molecules/__fixtures__/form-wizard.fixture.json +2042 -0
- package/src/molecules/__fixtures__/products.json +81539 -0
- package/src/molecules/__fixtures__/useValue.hook.ts +14 -0
- package/src/{components/alert/alert.component.spec.tsx → molecules/alert/Alert.spec.tsx} +12 -15
- package/src/molecules/alert/Alert.stories.tsx +39 -0
- package/src/{components/alert/alert.component.tsx → molecules/alert/Alert.tsx} +9 -8
- package/src/molecules/button/Button.stories.tsx +106 -0
- package/src/molecules/button/Button.tsx +54 -0
- package/src/{components/card/card.component.spec.tsx → molecules/card/Card.spec.tsx} +3 -3
- package/src/{components/card/card.stories.tsx → molecules/card/Card.stories.tsx} +9 -4
- package/src/{components/card/card.component.tsx → molecules/card/Card.tsx} +1 -2
- package/src/{components/form-control/formControl.component.spec.tsx → molecules/forms/form-control/FormControl.spec.tsx} +9 -9
- package/src/molecules/forms/form-control/FormControl.stories.tsx +58 -0
- package/src/molecules/forms/form-control/FormControl.tsx +86 -0
- package/src/molecules/forms/input-tags/InputTags.interface.ts +9 -0
- package/src/molecules/forms/input-tags/InputTags.tsx +30 -0
- package/src/molecules/forms/input-tags/all.ts +6 -0
- package/src/molecules/forms/input-tags/components/ChoicesTags.stories.tsx +110 -0
- package/src/molecules/forms/input-tags/components/ChoicesTags.tsx +72 -0
- package/src/molecules/forms/input-tags/components/ReactTags.stories.tsx +140 -0
- package/src/molecules/forms/input-tags/components/ReactTags.tsx +38 -0
- package/src/molecules/forms/input-text/InputText.interface.ts +5 -0
- package/src/{components/input-text/inputText.component.spec.tsx → molecules/forms/input-text/InputText.spec.tsx} +8 -8
- package/src/molecules/forms/input-text/InputText.stories.tsx +179 -0
- package/src/molecules/forms/input-text/InputText.tsx +63 -0
- package/src/molecules/forms/select/Select.interface.ts +45 -0
- package/src/molecules/forms/select/Select.tsx +28 -0
- package/src/molecules/forms/select/all.ts +7 -0
- package/src/molecules/forms/select/components/ChoicesSelect.stories.tsx +332 -0
- package/src/molecules/forms/select/components/ChoicesSelect.tsx +159 -0
- package/src/molecules/forms/select/components/HtmlSelect.stories.tsx +305 -0
- package/src/molecules/forms/select/components/HtmlSelect.tsx +54 -0
- package/src/molecules/forms/select/components/ReactSelect.stories.tsx +287 -0
- package/src/molecules/forms/select/components/ReactSelect.tsx +60 -0
- package/src/molecules/forms/select/components/choices.template.tsx +38 -0
- package/src/molecules/forms/select/hooks/useOptions.spec.ts +154 -0
- package/src/molecules/forms/select/hooks/useOptions.ts +53 -0
- package/src/{components/loader/loader.component.spec.tsx → molecules/loader/Loader.spec.tsx} +4 -4
- package/src/molecules/loader/Loader.stories.tsx +43 -0
- package/src/{components/loader/loader.component.tsx → molecules/loader/Loader.tsx} +3 -11
- package/src/molecules/modal/Modal.spec.tsx +203 -0
- package/src/molecules/modal/Modal.stories.tsx +178 -0
- package/src/{components/modal/modal.component.tsx → molecules/modal/Modal.tsx} +1 -1
- package/src/{components/pagination/pagination.component.spec.tsx → molecules/pagination/Pagination.spec.tsx} +27 -22
- package/src/molecules/pagination/Pagination.stories.tsx +99 -0
- package/src/{components/pagination/pagination.component.tsx → molecules/pagination/Pagination.tsx} +34 -47
- package/src/molecules/pagination/PaginationButton.tsx +30 -0
- package/src/molecules/pagination/all.ts +3 -0
- package/src/molecules/table/Table.stories.tsx +272 -0
- package/src/molecules/table/Table.tsx +100 -0
- package/src/molecules/table/all.ts +16 -0
- package/src/molecules/table/components/DefaultArrowSort.tsx +26 -0
- package/src/molecules/table/components/DefaultCell.tsx +22 -0
- package/src/molecules/table/components/DefaultCellFooter.tsx +16 -0
- package/src/molecules/table/components/DefaultCellHeader.tsx +42 -0
- package/src/molecules/table/components/DefaultCellOperations.tsx +42 -0
- package/src/molecules/table/components/DefaultFilter.tsx +42 -0
- package/src/molecules/table/components/DefaultOperationButton.tsx +40 -0
- package/src/molecules/table/filters/Filters.d.ts +31 -0
- package/src/molecules/table/filters/RangeFilter.tsx +43 -0
- package/src/molecules/table/filters/SelectFilter.tsx +47 -0
- package/src/molecules/table/filters/TextFieldFilter.tsx +36 -0
- package/src/molecules/table/hooks/useTable.tsx +75 -0
- package/src/molecules/table/hooks/useUniqValues.tsx +10 -0
- package/src/molecules/table/interfaces/extends.ts +18 -0
- package/src/molecules/table/utils/mapFormToColumns.tsx +74 -0
- package/src/{components/tabs/tabs.component.spec.tsx → molecules/tabs/Tabs.spec.tsx} +6 -6
- package/src/molecules/tabs/Tabs.stories.tsx +141 -0
- package/src/{components/tabs/tabs.component.tsx → molecules/tabs/Tabs.tsx} +1 -1
- package/src/organisms/__fixtures__/WrapComponent.tsx +11 -0
- package/src/organisms/__fixtures__/form-actions.json +240 -0
- package/src/organisms/__fixtures__/form-firstname.fixture.json +256 -0
- package/src/organisms/__fixtures__/form-wizard.fixture.json +2042 -0
- package/src/organisms/__fixtures__/form.fixture.json +2067 -0
- package/src/organisms/__fixtures__/useEditForm.tsx +84 -0
- package/src/organisms/__fixtures__/utils.ts +74 -0
- package/src/{components/form/form.component.spec.tsx → organisms/form/Form.spec.tsx} +6 -7
- package/src/organisms/form/Form.stories.tsx +698 -0
- package/src/organisms/form/Form.tsx +29 -0
- package/src/{components/form-access/formAccess.schema.ts → organisms/form/access/FormAccess.schema.ts} +4 -6
- package/src/{components/form-access/formAccess.stories.tsx → organisms/form/access/FormAccess.stories.tsx} +8 -2
- package/src/{components/form-access/formAccess.component.tsx → organisms/form/access/FormAccess.tsx} +16 -18
- package/src/{components/form-access/formAccess.utils.spec.ts → organisms/form/access/FormAccess.utils.spec.ts} +13 -7
- package/src/{components/form-access/formAccess.utils.ts → organisms/form/access/FormAccess.utils.ts} +23 -20
- package/src/{components/form-action/formAction.stories.tsx → organisms/form/action/FormAction.stories.tsx} +11 -13
- package/src/{components/form-action/formAction.component.tsx → organisms/form/action/FormAction.tsx} +8 -8
- package/src/organisms/form/builder/FormBuilder.stories.tsx +97 -0
- package/src/organisms/form/builder/FormBuilder.tsx +28 -0
- package/src/{components/form-edit/formEdit.reducer.ts → organisms/form/builder/FormEdit.reducer.ts} +6 -6
- package/src/{components/form-edit/formEdit.stories.tsx → organisms/form/builder/FormEdit.stories.tsx} +88 -44
- package/src/organisms/form/builder/FormEdit.tsx +75 -0
- package/src/organisms/form/builder/FormEditCtas.tsx +97 -0
- package/src/{components/form-edit/formParameters.component.tsx → organisms/form/builder/FormParameters.tsx} +29 -29
- package/src/organisms/form/builder/all.ts +17 -0
- package/src/organisms/form/builder/useFormBuilder.ts +143 -0
- package/src/{components/form-edit/useFormEdit.hook.ts → organisms/form/builder/useFormEdit.ts} +8 -8
- package/src/{components/form-settings/formSettings.component.spec.tsx → organisms/form/settings/FormSettings.component.spec.tsx} +3 -4
- package/src/{components/form-settings/formSettings.schema.ts → organisms/form/settings/FormSettings.schema.ts} +2 -2
- package/src/{components/form-settings/formSettings.stories.tsx → organisms/form/settings/FormSettings.stories.tsx} +10 -10
- package/src/{components/form-settings/formSettings.component.tsx → organisms/form/settings/FormSettings.tsx} +8 -9
- package/src/{components/form-settings/formSettings.utils.spec.ts → organisms/form/settings/FormSettings.utils.spec.ts} +1 -1
- package/src/{components/form-settings/formSettings.utils.ts → organisms/form/settings/FormSettings.utils.ts} +4 -4
- package/src/organisms/form/types.ts +8 -0
- package/src/organisms/form/useForm.ts +223 -0
- package/src/organisms/modal/RemoveModal.stories.tsx +59 -0
- package/src/{components/modal/removeModal.component.tsx → organisms/modal/RemoveModal.tsx} +3 -3
- package/src/{components/actions-table/actionsTable.component.spec.tsx → organisms/table/actions/ActionsTable.spec.tsx} +14 -11
- package/src/{components/actions-table/actionsTable.stories.tsx → organisms/table/actions/ActionsTable.stories.tsx} +22 -24
- package/src/{components/actions-table/actionsTable.component.tsx → organisms/table/actions/ActionsTable.tsx} +14 -21
- package/src/{components/forms-table/formsTable.stories.tsx → organisms/table/forms/FormsTable.stories.tsx} +24 -28
- package/src/organisms/table/forms/FormsTable.tsx +66 -0
- package/src/organisms/table/forms/components/FormsCell.tsx +53 -0
- package/src/{components/submissions-table/submissionsTable.stories.tsx → organisms/table/submissions/SubmissionsTable.stories.tsx} +28 -31
- package/src/organisms/table/submissions/SubmissionsTable.tsx +13 -0
- package/src/registries/components.ts +23 -0
- package/src/utils/iconClass.ts +3 -1
- package/tsconfig.app.json +11 -0
- package/tsconfig.json +10 -5
- package/tsconfig.node.json +9 -4
- package/tsconfig.spec.json +14 -0
- package/vite.config.mts +69 -0
- package/vitest.config.mts +21 -0
- package/.eslintignore +0 -13
- package/.eslintrc.js +0 -7
- package/coverage.json +0 -6
- package/dist/components/actions-table/actionsTable.component.d.ts +0 -11
- package/dist/components/actions-table/actionsTable.component.spec.d.ts +0 -1
- package/dist/components/actions-table/actionsTable.stories.d.ts +0 -40
- package/dist/components/alert/alert.component.d.ts +0 -6
- package/dist/components/alert/alert.component.spec.d.ts +0 -1
- package/dist/components/alert/alert.stories.d.ts +0 -15
- package/dist/components/card/card.component.spec.d.ts +0 -1
- package/dist/components/card/card.stories.d.ts +0 -16
- package/dist/components/form/form.component.d.ts +0 -63
- package/dist/components/form/form.component.spec.d.ts +0 -1
- package/dist/components/form/form.stories.d.ts +0 -6445
- package/dist/components/form/useForm.hook.d.ts +0 -60
- package/dist/components/form-access/formAccess.component.d.ts +0 -9
- package/dist/components/form-access/formAccess.schema.d.ts +0 -5
- package/dist/components/form-access/formAccess.stories.d.ts +0 -21
- package/dist/components/form-access/formAccess.utils.d.ts +0 -24
- package/dist/components/form-access/formAccess.utils.spec.d.ts +0 -1
- package/dist/components/form-action/formAction.component.d.ts +0 -9
- package/dist/components/form-action/formAction.stories.d.ts +0 -409
- package/dist/components/form-builder/formBuilder.component.d.ts +0 -53
- package/dist/components/form-builder/formBuilder.stories.d.ts +0 -5989
- package/dist/components/form-control/formControl.component.d.ts +0 -14
- package/dist/components/form-control/formControl.component.spec.d.ts +0 -1
- package/dist/components/form-control/formControl.stories.d.ts +0 -58
- package/dist/components/form-edit/formCtas.component.d.ts +0 -28
- package/dist/components/form-edit/formEdit.component.d.ts +0 -19
- package/dist/components/form-edit/formEdit.reducer.d.ts +0 -10
- package/dist/components/form-edit/formEdit.stories.d.ts +0 -396
- package/dist/components/form-edit/formParameters.component.d.ts +0 -34
- package/dist/components/form-settings/formSettings.component.spec.d.ts +0 -1
- package/dist/components/form-settings/formSettings.schema.d.ts +0 -2
- package/dist/components/form-settings/formSettings.stories.d.ts +0 -58
- package/dist/components/form-settings/formSettings.utils.d.ts +0 -8
- package/dist/components/form-settings/formSettings.utils.spec.d.ts +0 -1
- package/dist/components/forms-table/components/formCell.component.d.ts +0 -7
- package/dist/components/forms-table/formsTable.component.d.ts +0 -11
- package/dist/components/forms-table/formsTable.stories.d.ts +0 -117
- package/dist/components/index.d.ts +0 -26
- package/dist/components/input-tags/inputTags.component.d.ts +0 -19
- package/dist/components/input-tags/inputTags.stories.d.ts +0 -76
- package/dist/components/input-text/inputText.component.d.ts +0 -28
- package/dist/components/input-text/inputText.component.spec.d.ts +0 -1
- package/dist/components/input-text/inputText.stories.d.ts +0 -101
- package/dist/components/loader/loader.component.d.ts +0 -17
- package/dist/components/loader/loader.component.spec.d.ts +0 -1
- package/dist/components/loader/loader.stories.d.ts +0 -15
- package/dist/components/modal/modal.component.spec.d.ts +0 -1
- package/dist/components/modal/modal.stories.d.ts +0 -44
- package/dist/components/pagination/pagination.component.d.ts +0 -18
- package/dist/components/pagination/pagination.component.spec.d.ts +0 -1
- package/dist/components/pagination/pagination.stories.d.ts +0 -16
- package/dist/components/react-component/reactComponent.component.d.ts +0 -90
- package/dist/components/select/select.component.d.ts +0 -14
- package/dist/components/select/select.component.spec.d.ts +0 -1
- package/dist/components/select/select.stories.d.ts +0 -164
- package/dist/components/submissions-table/submissionsTable.component.d.ts +0 -7
- package/dist/components/submissions-table/submissionsTable.stories.d.ts +0 -649
- package/dist/components/table/components/defaultArrowSort.component.d.ts +0 -2
- package/dist/components/table/components/defaultCell.component.d.ts +0 -2
- package/dist/components/table/components/defaultCellHeader.component.d.ts +0 -6
- package/dist/components/table/components/defaultCellOperations.component.d.ts +0 -13
- package/dist/components/table/components/defaultCells.component.d.ts +0 -5
- package/dist/components/table/components/defaultOperationButton.component.d.ts +0 -14
- package/dist/components/table/components/defaultRow.component.d.ts +0 -12
- package/dist/components/table/components/dragNDropContainer.d.ts +0 -4
- package/dist/components/table/filters/defaultColumnFilter.component.d.ts +0 -6
- package/dist/components/table/filters/defaultColumnFilter.component.spec.d.ts +0 -1
- package/dist/components/table/filters/selectColumnFilter.component.d.ts +0 -11
- package/dist/components/table/filters/selectColumnFilter.component.spec.d.ts +0 -1
- package/dist/components/table/filters/sliderColumnFilter.component.d.ts +0 -3
- package/dist/components/table/hooks/useCustomTable.hook.d.ts +0 -128
- package/dist/components/table/hooks/useDragnDropRow.hook.d.ts +0 -274
- package/dist/components/table/hooks/useOperations.hook.d.ts +0 -11
- package/dist/components/table/index.d.ts +0 -15
- package/dist/components/table/table.component.d.ts +0 -3
- package/dist/components/table/table.stories.d.ts +0 -71
- package/dist/components/table/utils/mapFormToColumns.d.ts +0 -3
- package/dist/components/table/utils/swapElements.d.ts +0 -1
- package/dist/components/table/utils/swapElements.spec.d.ts +0 -1
- package/dist/components/tabs/tabs.component.spec.d.ts +0 -1
- package/dist/components/tabs/tabs.component.stories.d.ts +0 -47
- package/dist/index.modern.js +0 -7437
- package/dist/index.modern.js.map +0 -1
- package/dist/interfaces/ActionSchema.d.ts +0 -23
- package/dist/interfaces/Submission.d.ts +0 -5
- package/dist/setupTests.d.ts +0 -1
- package/dist/utils/callLast.d.ts +0 -1
- package/jest.config.js +0 -6
- package/src/components/alert/alert.stories.tsx +0 -18
- package/src/components/form/form.component.tsx +0 -73
- package/src/components/form/form.stories.tsx +0 -253
- package/src/components/form/useForm.hook.ts +0 -216
- package/src/components/form-builder/formBuilder.component.tsx +0 -195
- package/src/components/form-builder/formBuilder.stories.tsx +0 -3667
- package/src/components/form-control/formControl.component.tsx +0 -58
- package/src/components/form-control/formControl.stories.tsx +0 -65
- package/src/components/form-edit/formCtas.component.tsx +0 -106
- package/src/components/form-edit/formEdit.component.tsx +0 -60
- package/src/components/forms-table/components/formCell.component.tsx +0 -48
- package/src/components/forms-table/formsTable.component.tsx +0 -42
- package/src/components/index.ts +0 -26
- package/src/components/input-tags/inputTags.component.tsx +0 -58
- package/src/components/input-tags/inputTags.stories.tsx +0 -97
- package/src/components/input-text/inputText.component.tsx +0 -85
- package/src/components/input-text/inputText.stories.tsx +0 -126
- package/src/components/loader/loader.stories.tsx +0 -18
- package/src/components/modal/modal.component.spec.tsx +0 -79
- package/src/components/modal/modal.stories.tsx +0 -192
- package/src/components/pagination/pagination.stories.tsx +0 -40
- package/src/components/react-component/reactComponent.component.tsx +0 -197
- package/src/components/select/select.component.spec.tsx +0 -85
- package/src/components/select/select.component.tsx +0 -88
- package/src/components/select/select.stories.tsx +0 -173
- package/src/components/submissions-table/submissionsTable.component.tsx +0 -16
- package/src/components/table/components/defaultArrowSort.component.tsx +0 -12
- package/src/components/table/components/defaultCell.component.tsx +0 -15
- package/src/components/table/components/defaultCellHeader.component.tsx +0 -19
- package/src/components/table/components/defaultCellOperations.component.tsx +0 -39
- package/src/components/table/components/defaultCells.component.tsx +0 -31
- package/src/components/table/components/defaultOperationButton.component.tsx +0 -53
- package/src/components/table/components/defaultRow.component.tsx +0 -51
- package/src/components/table/components/dragNDropContainer.tsx +0 -7
- package/src/components/table/filters/defaultColumnFilter.component.spec.tsx +0 -34
- package/src/components/table/filters/defaultColumnFilter.component.tsx +0 -39
- package/src/components/table/filters/selectColumnFilter.component.spec.tsx +0 -69
- package/src/components/table/filters/selectColumnFilter.component.tsx +0 -52
- package/src/components/table/filters/sliderColumnFilter.component.tsx +0 -31
- package/src/components/table/hooks/useCustomTable.hook.tsx +0 -272
- package/src/components/table/hooks/useDragnDropRow.hook.ts +0 -80
- package/src/components/table/hooks/useOperations.hook.tsx +0 -39
- package/src/components/table/index.ts +0 -15
- package/src/components/table/table.component.tsx +0 -100
- package/src/components/table/table.stories.tsx +0 -120
- package/src/components/table/utils/mapFormToColumns.tsx +0 -34
- package/src/components/table/utils/swapElements.spec.ts +0 -7
- package/src/components/table/utils/swapElements.ts +0 -7
- package/src/components/tabs/tabs.component.stories.tsx +0 -127
- package/src/interfaces/ActionSchema.ts +0 -26
- package/src/interfaces/Submission.ts +0 -5
- package/src/setupTests.tsx +0 -5
- package/src/utils/callLast.ts +0 -12
- /package/src/{components → molecules}/__fixtures__/form-actions.json +0 -0
- /package/src/{components → molecules}/__fixtures__/form.fixture.json +0 -0
- /package/src/{components/table → molecules/pagination}/utils/getPageNumbers.ts +0 -0
- /package/src/{components → organisms}/__fixtures__/form-schema.json +0 -0
- /package/src/{components → organisms}/__fixtures__/form-submissions.json +0 -0
- /package/src/{components/actions-table → organisms/table/actions}/__fixtures__/data.json +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Header } from '@tanstack/react-table';
|
|
2
|
+
export interface DefaultCellHeaderProps<Data = any> {
|
|
3
|
+
header: Header<Data, unknown>;
|
|
4
|
+
i18n?: (f: string) => string;
|
|
5
|
+
}
|
|
6
|
+
export declare function DefaultCellHeader<Data = any>(props: DefaultCellHeaderProps<Data>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { flexRender as d } from "@tanstack/react-table";
|
|
3
|
+
import { c as t } from "../../../chunks/index.js";
|
|
4
|
+
import { registerComponent as g, getComponent as n } from "../../../registries/components.js";
|
|
5
|
+
function u(l) {
|
|
6
|
+
const { header: e, i18n: c } = l, a = n("ArrowSort"), i = n("Filter"), m = e.column.getCanSort(), s = e.column.getCanFilter();
|
|
7
|
+
return /* @__PURE__ */ o("div", { className: t("table-cell-header", {}), children: [
|
|
8
|
+
/* @__PURE__ */ o(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
className: t("table-cell-header__label", {
|
|
12
|
+
"cursor-pointer select-none": e.column.getCanSort()
|
|
13
|
+
}),
|
|
14
|
+
...m ? {
|
|
15
|
+
onClick: e.column.getToggleSortingHandler()
|
|
16
|
+
} : {},
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ r("span", { children: d(e.column.columnDef.header, e.getContext()) }),
|
|
19
|
+
/* @__PURE__ */ r(a, { header: e })
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
s && /* @__PURE__ */ r(i, { header: e, i18n: c })
|
|
24
|
+
] });
|
|
25
|
+
}
|
|
26
|
+
g("CellHeader", u);
|
|
27
|
+
export {
|
|
28
|
+
u as DefaultCellHeader
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=DefaultCellHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultCellHeader.js","sources":["../../../../src/molecules/table/components/DefaultCellHeader.tsx"],"sourcesContent":["import { flexRender, type Header } from \"@tanstack/react-table\";\nimport cx from \"classnames\";\n\nimport { getComponent, registerComponent } from \"../../../registries/components\";\nimport type { DefaultArrowSort } from \"./DefaultArrowSort\";\nimport type { DefaultFilter } from \"./DefaultFilter\";\n\nexport interface DefaultCellHeaderProps<Data = any> {\n header: Header<Data, unknown>;\n i18n?: (f: string) => string;\n}\n\nexport function DefaultCellHeader<Data = any>(props: DefaultCellHeaderProps<Data>) {\n const { header, i18n } = props;\n\n const ArrowSort = getComponent<typeof DefaultArrowSort>(\"ArrowSort\");\n const Filter = getComponent<typeof DefaultFilter>(\"Filter\");\n const canSort = header.column.getCanSort();\n const canFilter = header.column.getCanFilter();\n\n return (\n <div className={cx(\"table-cell-header\", {})}>\n <div\n className={cx(\"table-cell-header__label\", {\n \"cursor-pointer select-none\": header.column.getCanSort()\n })}\n {...(canSort\n ? {\n onClick: header.column.getToggleSortingHandler()\n }\n : {})}\n >\n <span>{flexRender(header.column.columnDef.header, header.getContext())}</span>\n\n <ArrowSort header={header} />\n </div>\n {canFilter && <Filter header={header} i18n={i18n} />}\n </div>\n );\n}\n\nregisterComponent(\"CellHeader\", DefaultCellHeader);\n"],"names":["DefaultCellHeader","props","header","i18n","ArrowSort","getComponent","Filter","canSort","canFilter","cx","jsxs","jsx","registerComponent"],"mappings":";;;;AAYO,SAASA,EAA8BC,GAAqC;AAC3E,QAAA,EAAE,QAAAC,GAAQ,MAAAC,EAAA,IAASF,GAEnBG,IAAYC,EAAsC,WAAW,GAC7DC,IAASD,EAAmC,QAAQ,GACpDE,IAAUL,EAAO,OAAO,WAAW,GACnCM,IAAYN,EAAO,OAAO,aAAa;AAE7C,2BACG,OAAI,EAAA,WAAWO,EAAG,qBAAqB,CAAA,CAAE,GACxC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWD,EAAG,4BAA4B;AAAA,UACxC,8BAA8BP,EAAO,OAAO,WAAW;AAAA,QAAA,CACxD;AAAA,QACA,GAAIK,IACD;AAAA,UACE,SAASL,EAAO,OAAO,wBAAwB;AAAA,QAAA,IAEjD,CAAC;AAAA,QAEL,UAAA;AAAA,UAAC,gBAAAS,EAAA,QAAA,EAAM,YAAWT,EAAO,OAAO,UAAU,QAAQA,EAAO,WAAW,CAAC,EAAE,CAAA;AAAA,UAEvE,gBAAAS,EAACP,KAAU,QAAAF,EAAgB,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC7B;AAAA,IACCM,KAAa,gBAAAG,EAACL,GAAO,EAAA,QAAAJ,GAAgB,MAAAC,EAAY,CAAA;AAAA,EAAA,GACpD;AAEJ;AAEAS,EAAkB,cAAcZ,CAAiB;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CellContext } from '@tanstack/react-table';
|
|
2
|
+
import { Operation } from '../../../interfaces';
|
|
3
|
+
export interface DefaultCellOperationsProps<Data = any> {
|
|
4
|
+
info: CellContext<Data, unknown>;
|
|
5
|
+
operations: Operation<Data>[];
|
|
6
|
+
metadata?: Record<string, unknown>;
|
|
7
|
+
i18n: (i18n: string) => string;
|
|
8
|
+
onClick?: (data: any, operation: Operation<Data>) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function DefaultCellOperations({ info, metadata, operations, i18n, onClick }: DefaultCellOperationsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { registerComponent as p, getComponent as l } from "../../../registries/components.js";
|
|
3
|
+
function m({ info: r, metadata: n, operations: a, i18n: i, onClick: e }) {
|
|
4
|
+
const u = l("OperationButton");
|
|
5
|
+
return /* @__PURE__ */ o("div", { className: "btn-group", children: a.filter(({ permissionsResolver: t }) => !t || t(r.row.original, n)).map((t) => /* @__PURE__ */ o(
|
|
6
|
+
u,
|
|
7
|
+
{
|
|
8
|
+
"data-testid": `operation-${r.row.id}-${t.action}`,
|
|
9
|
+
operation: t,
|
|
10
|
+
metadata: n,
|
|
11
|
+
info: r,
|
|
12
|
+
i18n: i,
|
|
13
|
+
onClick: () => {
|
|
14
|
+
e == null || e(r.row.original, t);
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
t.action
|
|
18
|
+
)) });
|
|
19
|
+
}
|
|
20
|
+
p("CellOperations", m);
|
|
21
|
+
export {
|
|
22
|
+
m as DefaultCellOperations
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=DefaultCellOperations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultCellOperations.js","sources":["../../../../src/molecules/table/components/DefaultCellOperations.tsx"],"sourcesContent":["import type { CellContext } from \"@tanstack/react-table\";\n\nimport type { Operation } from \"../../../interfaces\";\nimport { getComponent, registerComponent } from \"../../../registries/components\";\nimport type { DefaultOperationButton } from \"./DefaultOperationButton\";\n\nexport interface DefaultCellOperationsProps<Data = any> {\n info: CellContext<Data, unknown>;\n operations: Operation<Data>[];\n metadata?: Record<string, unknown>;\n i18n: (i18n: string) => string;\n onClick?: (data: any, operation: Operation<Data>) => void;\n}\n\nexport function DefaultCellOperations({ info, metadata, operations, i18n, onClick }: DefaultCellOperationsProps) {\n const Button = getComponent<typeof DefaultOperationButton>(\"OperationButton\");\n return (\n <div className='btn-group'>\n {operations\n .filter(({ permissionsResolver }) => {\n return !permissionsResolver || permissionsResolver(info.row.original, metadata);\n })\n .map((operation) => {\n return (\n <Button\n data-testid={`operation-${info.row.id}-${operation.action}`}\n key={operation.action}\n operation={operation}\n metadata={metadata}\n info={info}\n i18n={i18n}\n onClick={() => {\n onClick?.(info.row.original, operation);\n }}\n />\n );\n })}\n </div>\n );\n}\n\nregisterComponent(\"CellOperations\", DefaultCellOperations);\n"],"names":["DefaultCellOperations","info","metadata","operations","i18n","onClick","Button","getComponent","jsx","permissionsResolver","operation","registerComponent"],"mappings":";;AAcO,SAASA,EAAsB,EAAE,MAAAC,GAAM,UAAAC,GAAU,YAAAC,GAAY,MAAAC,GAAM,SAAAC,KAAuC;AACzG,QAAAC,IAASC,EAA4C,iBAAiB;AAE1E,SAAA,gBAAAC,EAAC,SAAI,WAAU,aACZ,YACE,OAAO,CAAC,EAAE,qBAAAC,QACF,CAACA,KAAuBA,EAAoBR,EAAK,IAAI,UAAUC,CAAQ,CAC/E,EACA,IAAI,CAACQ,MAEF,gBAAAF;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,eAAa,aAAaL,EAAK,IAAI,EAAE,IAAIS,EAAU,MAAM;AAAA,MAEzD,WAAAA;AAAA,MACA,UAAAR;AAAA,MACA,MAAAD;AAAA,MACA,MAAAG;AAAA,MACA,SAAS,MAAM;AACH,QAAAC,KAAA,QAAAA,EAAAJ,EAAK,IAAI,UAAUS;AAAA,MAAS;AAAA,IACxC;AAAA,IAPKA,EAAU;AAAA,EAQjB,CAEH,GACL;AAEJ;AAEAC,EAAkB,kBAAkBX,CAAqB;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Header } from '@tanstack/react-table';
|
|
2
|
+
export interface DefaultFilterProps<Data = any> {
|
|
3
|
+
header: Header<Data, unknown>;
|
|
4
|
+
i18n?: (f: string) => string;
|
|
5
|
+
}
|
|
6
|
+
export interface FilterProps<Data = any, Opts = Record<string, unknown>> {
|
|
7
|
+
header: Header<Data, unknown>;
|
|
8
|
+
options: Opts;
|
|
9
|
+
i18n?: (f: string) => string;
|
|
10
|
+
}
|
|
11
|
+
export declare function DefaultFilter<Data = any>({ header, i18n }: DefaultFilterProps<Data>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { registerComponent as o, getComponent as c } from "../../../registries/components.js";
|
|
3
|
+
function m({ header: t, i18n: n }) {
|
|
4
|
+
const {
|
|
5
|
+
filter: r = {
|
|
6
|
+
variant: "text"
|
|
7
|
+
}
|
|
8
|
+
} = t.column.columnDef.meta || {}, { variant: i } = r, e = c([`Filter.${t.column.id}`, `Filter.${i}`, "Filter.text"]);
|
|
9
|
+
return e ? /* @__PURE__ */ l("div", { className: "table-cell-header__filter", children: /* @__PURE__ */ l(e, { header: t, options: r, i18n: n }) }) : (console.warn("Missing filter for `Filter." + t.column.id + "` or `Filter." + i + "`"), null);
|
|
10
|
+
}
|
|
11
|
+
o("Filter", m);
|
|
12
|
+
export {
|
|
13
|
+
m as DefaultFilter
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=DefaultFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultFilter.js","sources":["../../../../src/molecules/table/components/DefaultFilter.tsx"],"sourcesContent":["import \"../interfaces/extends\";\n\nimport { Header } from \"@tanstack/react-table\";\nimport type { ComponentType } from \"react\";\n\nimport { getComponent, registerComponent } from \"../../../registries/components\";\n\nexport interface DefaultFilterProps<Data = any> {\n header: Header<Data, unknown>;\n i18n?: (f: string) => string;\n}\n\nexport interface FilterProps<Data = any, Opts = Record<string, unknown>> {\n header: Header<Data, unknown>;\n options: Opts;\n i18n?: (f: string) => string;\n}\n\nexport function DefaultFilter<Data = any>({ header, i18n }: DefaultFilterProps<Data>) {\n const {\n filter = {\n variant: \"text\"\n }\n } = header.column.columnDef.meta || {};\n\n const { variant: filterVariant } = filter;\n const Filter = getComponent<ComponentType<FilterProps>>([`Filter.${header.column.id}`, `Filter.${filterVariant}`, \"Filter.text\"]);\n\n if (!Filter) {\n console.warn(\"Missing filter for `Filter.\" + header.column.id + \"` or `Filter.\" + filterVariant + \"`\");\n\n return null;\n }\n\n return (\n <div className='table-cell-header__filter'>\n <Filter header={header} options={filter} i18n={i18n} />\n </div>\n );\n}\n\nregisterComponent(\"Filter\", DefaultFilter);\n"],"names":["DefaultFilter","header","i18n","filter","filterVariant","Filter","getComponent","jsx","registerComponent"],"mappings":";;AAkBO,SAASA,EAA0B,EAAE,QAAAC,GAAQ,MAAAC,KAAkC;AAC9E,QAAA;AAAA,IACJ,QAAAC,IAAS;AAAA,MACP,SAAS;AAAA,IAAA;AAAA,EAET,IAAAF,EAAO,OAAO,UAAU,QAAQ,CAAC,GAE/B,EAAE,SAASG,EAAA,IAAkBD,GAC7BE,IAASC,EAAyC,CAAC,UAAUL,EAAO,OAAO,EAAE,IAAI,UAAUG,CAAa,IAAI,aAAa,CAAC;AAEhI,SAAKC,IAOH,gBAAAE,EAAC,OAAI,EAAA,WAAU,6BACb,UAAA,gBAAAA,EAACF,KAAO,QAAAJ,GAAgB,SAASE,GAAQ,MAAAD,EAAA,CAAY,EACvD,CAAA,KARA,QAAQ,KAAK,gCAAgCD,EAAO,OAAO,KAAK,kBAAkBG,IAAgB,GAAG,GAE9F;AAQX;AAEAI,EAAkB,UAAUR,CAAa;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CellContext } from '@tanstack/react-table';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
import { Operation } from '../../../interfaces';
|
|
4
|
+
export interface OperationButtonProps<Data = any> extends Omit<HTMLAttributes<HTMLButtonElement>, "onClick"> {
|
|
5
|
+
operation: Operation<Data>;
|
|
6
|
+
info: CellContext<Data, unknown>;
|
|
7
|
+
metadata?: Record<string, unknown>;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
i18n?: (i18n: string) => string;
|
|
10
|
+
}
|
|
11
|
+
export declare function DefaultOperationButton(props: OperationButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsxs as n, Fragment as x, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { c as d } from "../../../chunks/index.js";
|
|
3
|
+
import { registerComponent as C } from "../../../registries/components.js";
|
|
4
|
+
import { iconClass as N } from "../../../utils/iconClass.js";
|
|
5
|
+
import { stopPropagationWrapper as O } from "../../../utils/stopPropagationWrapper.js";
|
|
6
|
+
function g(r) {
|
|
7
|
+
const { i18n: e = (f) => f, onClick: a, operation: l, info: h, ...s } = r, { className: p = "btn", buttonSize: m = "xs", buttonType: c = "primary", buttonOutline: u, action: b, title: t = "", icon: o = "" } = l;
|
|
8
|
+
return /* @__PURE__ */ n(
|
|
9
|
+
"button",
|
|
10
|
+
{
|
|
11
|
+
...s,
|
|
12
|
+
"aria-label": "Operation button: " + (t || b),
|
|
13
|
+
className: d(p, ["btn", u && "outline", c].filter(Boolean).join("-"), `btn-${m}`),
|
|
14
|
+
onClick: O(() => a()),
|
|
15
|
+
children: [
|
|
16
|
+
o ? /* @__PURE__ */ n(x, { children: [
|
|
17
|
+
/* @__PURE__ */ i("i", { className: N(void 0, o) }),
|
|
18
|
+
" ",
|
|
19
|
+
t && " "
|
|
20
|
+
] }) : null,
|
|
21
|
+
t && /* @__PURE__ */ i("span", { className: o && t ? "ml-1" : "", children: e(t) })
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
C("OperationButton", g);
|
|
27
|
+
export {
|
|
28
|
+
g as DefaultOperationButton
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=DefaultOperationButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultOperationButton.js","sources":["../../../../src/molecules/table/components/DefaultOperationButton.tsx"],"sourcesContent":["import { CellContext } from \"@tanstack/react-table\";\nimport cx from \"classnames\";\nimport { HTMLAttributes } from \"react\";\n\nimport { Operation } from \"../../../interfaces\";\nimport { registerComponent } from \"../../../registries/components\";\nimport { iconClass } from \"../../../utils/iconClass\";\nimport { stopPropagationWrapper } from \"../../../utils/stopPropagationWrapper\";\n\nexport interface OperationButtonProps<Data = any> extends Omit<HTMLAttributes<HTMLButtonElement>, \"onClick\"> {\n operation: Operation<Data>;\n info: CellContext<Data, unknown>;\n metadata?: Record<string, unknown>;\n onClick: () => void;\n i18n?: (i18n: string) => string;\n}\n\nexport function DefaultOperationButton(props: OperationButtonProps) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { i18n = (f: string) => f, onClick, operation, info, ...extraProps } = props;\n const { className = \"btn\", buttonSize = \"xs\", buttonType = \"primary\", buttonOutline, action, title = \"\", icon = \"\" } = operation;\n\n return (\n <button\n {...extraProps}\n aria-label={\"Operation button: \" + (title || action)}\n className={cx(className, [\"btn\", buttonOutline && \"outline\", buttonType].filter(Boolean).join(\"-\"), `btn-${buttonSize}`)}\n onClick={stopPropagationWrapper(() => onClick())}\n >\n {icon ? (\n <>\n <i className={iconClass(undefined, icon)} /> {title && \" \"}\n </>\n ) : null}\n {title && <span className={icon && title ? \"ml-1\" : \"\"}>{i18n(title)}</span>}\n </button>\n );\n}\n\nregisterComponent(\"OperationButton\", DefaultOperationButton);\n"],"names":["DefaultOperationButton","props","i18n","onClick","operation","info","extraProps","className","buttonSize","buttonType","buttonOutline","action","title","icon","jsxs","cx","stopPropagationWrapper","Fragment","jsx","iconClass","registerComponent"],"mappings":";;;;;AAiBO,SAASA,EAAuBC,GAA6B;AAE5D,QAAA,EAAE,MAAAC,IAAO,CAAC,MAAc,GAAG,SAAAC,GAAS,WAAAC,GAAW,MAAAC,GAAM,GAAGC,EAAA,IAAeL,GACvE,EAAE,WAAAM,IAAY,OAAO,YAAAC,IAAa,MAAM,YAAAC,IAAa,WAAW,eAAAC,GAAe,QAAAC,GAAQ,OAAAC,IAAQ,IAAI,MAAAC,IAAO,GAAO,IAAAT;AAGrH,SAAA,gBAAAU;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGR;AAAA,MACJ,cAAY,wBAAwBM,KAASD;AAAA,MAC7C,WAAWI,EAAGR,GAAW,CAAC,OAAOG,KAAiB,WAAWD,CAAU,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,GAAG,OAAOD,CAAU,EAAE;AAAA,MACvH,SAASQ,EAAuB,MAAMb,GAAS;AAAA,MAE9C,UAAA;AAAA,QAAAU,IAEG,gBAAAC,EAAAG,GAAA,EAAA,UAAA;AAAA,UAAA,gBAAAC,EAAC,KAAE,EAAA,WAAWC,EAAU,QAAWN,CAAI,GAAG;AAAA,UAAE;AAAA,UAAED,KAAS;AAAA,QAAA,EAAA,CACzD,IACE;AAAA,QACHA,KAAU,gBAAAM,EAAA,QAAA,EAAK,WAAWL,KAAQD,IAAQ,SAAS,IAAK,UAAKV,EAAAU,CAAK,EAAE,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACvE;AAEJ;AAEAQ,EAAkB,mBAAmBpB,CAAsB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filters.d.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsxs as u, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { registerComponent as o, getComponent as v } from "../../../registries/components.js";
|
|
3
|
+
function M({ header: m, options: c }) {
|
|
4
|
+
var x, g;
|
|
5
|
+
const { column: a } = m, l = v("InputText"), t = m.column.getFilterValue(), s = c.min ?? ((x = a.getFacetedMinMaxValues()) == null ? void 0 : x[0]), i = c.max ?? ((g = a.getFacetedMinMaxValues()) == null ? void 0 : g[1]), p = c.step ?? 1;
|
|
6
|
+
return /* @__PURE__ */ u("div", { children: [
|
|
7
|
+
/* @__PURE__ */ u("div", { className: "flex space-x-2", children: [
|
|
8
|
+
/* @__PURE__ */ n("div", { className: "w-1/2", children: /* @__PURE__ */ n(
|
|
9
|
+
l,
|
|
10
|
+
{
|
|
11
|
+
type: "number",
|
|
12
|
+
size: "small",
|
|
13
|
+
min: s,
|
|
14
|
+
max: i,
|
|
15
|
+
step: p,
|
|
16
|
+
value: (t == null ? void 0 : t[0]) ?? "",
|
|
17
|
+
onChange: (h, r) => a.setFilterValue((e) => [r, e == null ? void 0 : e[1]]),
|
|
18
|
+
placeholder: `Min ${s !== void 0 ? `(${s})` : ""}`
|
|
19
|
+
}
|
|
20
|
+
) }),
|
|
21
|
+
/* @__PURE__ */ n("div", { className: "w-1/2", children: /* @__PURE__ */ n(
|
|
22
|
+
l,
|
|
23
|
+
{
|
|
24
|
+
type: "number",
|
|
25
|
+
size: "small",
|
|
26
|
+
min: s,
|
|
27
|
+
max: i,
|
|
28
|
+
step: p,
|
|
29
|
+
value: (t == null ? void 0 : t[1]) ?? "",
|
|
30
|
+
onChange: (h, r) => a.setFilterValue((e) => [e == null ? void 0 : e[0], r]),
|
|
31
|
+
placeholder: `Max ${i ? `(${i})` : ""}`
|
|
32
|
+
}
|
|
33
|
+
) })
|
|
34
|
+
] }),
|
|
35
|
+
/* @__PURE__ */ n("div", { className: "h-1" })
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
o("Filter.range", M);
|
|
39
|
+
export {
|
|
40
|
+
M as RangeFilter
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=RangeFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RangeFilter.js","sources":["../../../../src/molecules/table/filters/RangeFilter.tsx"],"sourcesContent":["import { getComponent, registerComponent } from \"../../../registries/components\";\nimport { type InputText as DefaultInputText } from \"../../forms/input-text/InputText\";\nimport type { FilterProps } from \"../components/DefaultFilter\";\nimport { FilterRangeOptions } from \"./Filters\";\n\nexport function RangeFilter<Data = any>({ header, options }: FilterProps<Data, FilterRangeOptions>) {\n const { column } = header;\n const InputText = getComponent<typeof DefaultInputText>(\"InputText\");\n const columnFilterValue = header.column.getFilterValue();\n const min = options.min ?? column.getFacetedMinMaxValues()?.[0];\n const max = options.max ?? column.getFacetedMinMaxValues()?.[1];\n const step = options.step ?? 1;\n\n return (\n <div>\n <div className='flex space-x-2'>\n <div className='w-1/2'>\n <InputText\n type='number'\n size='small'\n {...{ min, max, step }}\n value={(columnFilterValue as [number, number])?.[0] ?? \"\"}\n onChange={(_, value) => column.setFilterValue((old: [number, number]) => [value, old?.[1]])}\n placeholder={`Min ${min !== undefined ? `(${min})` : \"\"}`}\n />\n </div>\n <div className='w-1/2'>\n <InputText\n type='number'\n size='small'\n {...{ min, max, step }}\n value={(columnFilterValue as [number, number])?.[1] ?? \"\"}\n onChange={(_, value) => column.setFilterValue((old: [number, number]) => [old?.[0], value])}\n placeholder={`Max ${max ? `(${max})` : \"\"}`}\n />\n </div>\n </div>\n <div className='h-1' />\n </div>\n );\n}\n\nregisterComponent(\"Filter.range\", RangeFilter);\n"],"names":["RangeFilter","header","options","column","InputText","getComponent","columnFilterValue","min","_a","max","_b","step","jsxs","jsx","_","value","old","registerComponent"],"mappings":";;AAKO,SAASA,EAAwB,EAAE,QAAAC,GAAQ,SAAAC,KAAkD;;AAC5F,QAAA,EAAE,QAAAC,MAAWF,GACbG,IAAYC,EAAsC,WAAW,GAC7DC,IAAoBL,EAAO,OAAO,eAAe,GACjDM,IAAML,EAAQ,SAAOM,IAAAL,EAAO,6BAAP,gBAAAK,EAAkC,KACvDC,IAAMP,EAAQ,SAAOQ,IAAAP,EAAO,6BAAP,gBAAAO,EAAkC,KACvDC,IAAOT,EAAQ,QAAQ;AAE7B,2BACG,OACC,EAAA,UAAA;AAAA,IAAC,gBAAAU,EAAA,OAAA,EAAI,WAAU,kBACb,UAAA;AAAA,MAAC,gBAAAC,EAAA,OAAA,EAAI,WAAU,SACb,UAAA,gBAAAA;AAAA,QAACT;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,MAAK;AAAA,UACC,KAAAG;AAAA,UAAK,KAAAE;AAAA,UAAK,MAAAE;AAAA,UAChB,QAAQL,KAAA,gBAAAA,EAAyC,OAAM;AAAA,UACvD,UAAU,CAACQ,GAAGC,MAAUZ,EAAO,eAAe,CAACa,MAA0B,CAACD,GAAOC,KAAA,gBAAAA,EAAM,EAAE,CAAC;AAAA,UAC1F,aAAa,OAAOT,MAAQ,SAAY,IAAIA,CAAG,MAAM,EAAE;AAAA,QAAA;AAAA,MAAA,GAE3D;AAAA,MACA,gBAAAM,EAAC,OAAI,EAAA,WAAU,SACb,UAAA,gBAAAA;AAAA,QAACT;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,MAAK;AAAA,UACC,KAAAG;AAAA,UAAK,KAAAE;AAAA,UAAK,MAAAE;AAAA,UAChB,QAAQL,KAAA,gBAAAA,EAAyC,OAAM;AAAA,UACvD,UAAU,CAACQ,GAAGC,MAAUZ,EAAO,eAAe,CAACa,MAA0B,CAACA,KAAA,gBAAAA,EAAM,IAAID,CAAK,CAAC;AAAA,UAC1F,aAAa,OAAON,IAAM,IAAIA,CAAG,MAAM,EAAE;AAAA,QAAA;AAAA,MAAA,EAE7C,CAAA;AAAA,IAAA,GACF;AAAA,IACA,gBAAAI,EAAC,OAAI,EAAA,WAAU,MAAM,CAAA;AAAA,EAAA,GACvB;AAEJ;AAEAI,EAAkB,gBAAgBjB,CAAW;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as n, Fragment as u } from "react/jsx-runtime";
|
|
2
|
+
import { registerComponent as a, getComponent as p } from "../../../registries/components.js";
|
|
3
|
+
import { useUniqValues as f } from "../hooks/useUniqValues.js";
|
|
4
|
+
function F({ header: l, options: e }) {
|
|
5
|
+
const c = p("Select"), i = l.column.getFilterValue(), o = f({ header: l, filterVariant: "text" });
|
|
6
|
+
console.log(o);
|
|
7
|
+
const r = e.layout === "choicesjs" ? {
|
|
8
|
+
placeholder: void 0
|
|
9
|
+
} : {
|
|
10
|
+
placeholder: `Filter by ${l.column.columnDef.header}`
|
|
11
|
+
}, m = [
|
|
12
|
+
{
|
|
13
|
+
label: `Filter by ${l.column.columnDef.header}`,
|
|
14
|
+
value: ""
|
|
15
|
+
}
|
|
16
|
+
].concat(e.options || o.map((t) => ({ label: t, value: t })));
|
|
17
|
+
return /* @__PURE__ */ n(u, { children: /* @__PURE__ */ n(
|
|
18
|
+
c,
|
|
19
|
+
{
|
|
20
|
+
size: "small",
|
|
21
|
+
...e,
|
|
22
|
+
...r,
|
|
23
|
+
options: m,
|
|
24
|
+
name: `filter_${l.column.id}`,
|
|
25
|
+
"data-testid": `filter_${l.column.id}`,
|
|
26
|
+
value: i,
|
|
27
|
+
onChange: (t, s) => l.column.setFilterValue(s)
|
|
28
|
+
}
|
|
29
|
+
) });
|
|
30
|
+
}
|
|
31
|
+
a("Filter.select", F);
|
|
32
|
+
export {
|
|
33
|
+
F as SelectFilter
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=SelectFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectFilter.js","sources":["../../../../src/molecules/table/filters/SelectFilter.tsx"],"sourcesContent":["import { getComponent, registerComponent } from \"../../../registries/components\";\nimport type { Select as DefaultSelect } from \"../../forms/select/Select\";\nimport { SelectOptionProps } from \"../../forms/select/Select.interface\";\nimport type { FilterProps } from \"../components/DefaultFilter\";\nimport { useUniqValues } from \"../hooks/useUniqValues\";\nimport { FilterSelectOptions } from \"./Filters\";\n\nexport function SelectFilter<Data = any>({ header, options }: FilterProps<Data, FilterSelectOptions>) {\n const Select = getComponent<typeof DefaultSelect>(\"Select\");\n const columnFilterValue = header.column.getFilterValue();\n const uniqValues = useUniqValues<Data>({ header, filterVariant: \"text\" });\n console.log(uniqValues);\n const opts =\n options.layout === \"choicesjs\"\n ? {\n placeholder: undefined\n }\n : {\n placeholder: `Filter by ${header.column.columnDef.header}`\n };\n\n const listOptions = (\n [\n {\n label: `Filter by ${header.column.columnDef.header}`,\n value: \"\"\n }\n ] as SelectOptionProps[]\n ).concat(options.options || uniqValues.map((value: any) => ({ label: value, value })));\n\n return (\n <>\n <Select<string>\n size='small'\n {...(options as any)}\n {...opts}\n options={listOptions}\n name={`filter_${header.column.id}`}\n data-testid={`filter_${header.column.id}`}\n value={columnFilterValue as string}\n onChange={(_, value) => header.column.setFilterValue(value)}\n />\n </>\n );\n}\n\nregisterComponent(\"Filter.select\", SelectFilter);\n"],"names":["SelectFilter","header","options","Select","getComponent","columnFilterValue","uniqValues","useUniqValues","opts","listOptions","value","jsx","Fragment","_","registerComponent"],"mappings":";;;AAOO,SAASA,EAAyB,EAAE,QAAAC,GAAQ,SAAAC,KAAmD;AAC9F,QAAAC,IAASC,EAAmC,QAAQ,GACpDC,IAAoBJ,EAAO,OAAO,eAAe,GACjDK,IAAaC,EAAoB,EAAE,QAAAN,GAAQ,eAAe,QAAQ;AACxE,UAAQ,IAAIK,CAAU;AAChB,QAAAE,IACJN,EAAQ,WAAW,cACf;AAAA,IACE,aAAa;AAAA,EAAA,IAEf;AAAA,IACE,aAAa,aAAaD,EAAO,OAAO,UAAU,MAAM;AAAA,EAC1D,GAEAQ,IACJ;AAAA,IACE;AAAA,MACE,OAAO,aAAaR,EAAO,OAAO,UAAU,MAAM;AAAA,MAClD,OAAO;AAAA,IAAA;AAAA,EAGX,EAAA,OAAOC,EAAQ,WAAWI,EAAW,IAAI,CAACI,OAAgB,EAAE,OAAOA,GAAO,OAAAA,EAAA,EAAQ,CAAC;AAErF,SAEI,gBAAAC,EAAAC,GAAA,EAAA,UAAA,gBAAAD;AAAA,IAACR;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACJ,GAAID;AAAA,MACJ,GAAGM;AAAA,MACJ,SAASC;AAAA,MACT,MAAM,UAAUR,EAAO,OAAO,EAAE;AAAA,MAChC,eAAa,UAAUA,EAAO,OAAO,EAAE;AAAA,MACvC,OAAOI;AAAA,MACP,UAAU,CAACQ,GAAGH,MAAUT,EAAO,OAAO,eAAeS,CAAK;AAAA,IAAA;AAAA,EAAA,GAE9D;AAEJ;AAEAI,EAAkB,iBAAiBd,CAAY;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsxs as a, Fragment as u, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { registerComponent as c, getComponent as d } from "../../../registries/components.js";
|
|
3
|
+
import { useUniqValues as p } from "../hooks/useUniqValues.js";
|
|
4
|
+
function f({ header: t, options: e }) {
|
|
5
|
+
const o = d("InputText"), m = t.column.getFilterValue(), r = p({ header: t, filterVariant: "text" }), n = `data_list_${t.column.id}`;
|
|
6
|
+
return /* @__PURE__ */ a(u, { children: [
|
|
7
|
+
!e.disableDatalist && /* @__PURE__ */ i("datalist", { id: n, children: r.map((l) => /* @__PURE__ */ i("option", { value: l }, l)) }),
|
|
8
|
+
/* @__PURE__ */ i(
|
|
9
|
+
o,
|
|
10
|
+
{
|
|
11
|
+
size: "small",
|
|
12
|
+
placeholder: `Filter by ${t.column.columnDef.header}`,
|
|
13
|
+
...e,
|
|
14
|
+
name: `filter_${t.column.id}`,
|
|
15
|
+
"data-testid": `filter_${t.column.id}`,
|
|
16
|
+
value: m ?? "",
|
|
17
|
+
list: n,
|
|
18
|
+
onChange: (l, s) => t.column.setFilterValue(s)
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
] });
|
|
22
|
+
}
|
|
23
|
+
c("Filter.text", f);
|
|
24
|
+
export {
|
|
25
|
+
f as TextFieldFilter
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=TextFieldFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextFieldFilter.js","sources":["../../../../src/molecules/table/filters/TextFieldFilter.tsx"],"sourcesContent":["import { getComponent, registerComponent } from \"../../../registries/components\";\nimport type { InputText as DefaultInputText } from \"../../forms/input-text/InputText\";\nimport type { FilterProps } from \"../components/DefaultFilter\";\nimport { useUniqValues } from \"../hooks/useUniqValues\";\nimport { FilterTextOptions } from \"./Filters\";\n\nexport function TextFieldFilter<Data = any>({ header, options }: FilterProps<Data, FilterTextOptions>) {\n const InputText = getComponent<typeof DefaultInputText>(\"InputText\");\n const columnFilterValue = header.column.getFilterValue();\n const uniqValues = useUniqValues<Data>({ header, filterVariant: \"text\" });\n const datalistId = `data_list_${header.column.id}`;\n\n return (\n <>\n {!options.disableDatalist && (\n <datalist id={datalistId}>\n {uniqValues.map((value: any) => (\n <option value={value} key={value} />\n ))}\n </datalist>\n )}\n <InputText<string>\n size='small'\n placeholder={`Filter by ${header.column.columnDef.header}`}\n {...options}\n name={`filter_${header.column.id}`}\n data-testid={`filter_${header.column.id}`}\n value={(columnFilterValue ?? \"\") as string}\n list={datalistId}\n onChange={(_, value) => header.column.setFilterValue(value)}\n />\n </>\n );\n}\n\nregisterComponent(\"Filter.text\", TextFieldFilter);\n"],"names":["TextFieldFilter","header","options","InputText","getComponent","columnFilterValue","uniqValues","useUniqValues","datalistId","jsxs","Fragment","jsx","value","_","registerComponent"],"mappings":";;;AAMO,SAASA,EAA4B,EAAE,QAAAC,GAAQ,SAAAC,KAAiD;AAC/F,QAAAC,IAAYC,EAAsC,WAAW,GAC7DC,IAAoBJ,EAAO,OAAO,eAAe,GACjDK,IAAaC,EAAoB,EAAE,QAAAN,GAAQ,eAAe,QAAQ,GAClEO,IAAa,aAAaP,EAAO,OAAO,EAAE;AAEhD,SAEK,gBAAAQ,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,CAACR,EAAQ,mBACP,gBAAAS,EAAA,YAAA,EAAS,IAAIH,GACX,UAAAF,EAAW,IAAI,CAACM,MACd,gBAAAD,EAAA,UAAA,EAAO,OAAAC,KAAmBA,CAAO,CACnC,GACH;AAAA,IAEF,gBAAAD;AAAA,MAACR;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,aAAa,aAAaF,EAAO,OAAO,UAAU,MAAM;AAAA,QACvD,GAAGC;AAAA,QACJ,MAAM,UAAUD,EAAO,OAAO,EAAE;AAAA,QAChC,eAAa,UAAUA,EAAO,OAAO,EAAE;AAAA,QACvC,OAAQI,KAAqB;AAAA,QAC7B,MAAMG;AAAA,QACN,UAAU,CAACK,GAAGD,MAAUX,EAAO,OAAO,eAAeW,CAAK;AAAA,MAAA;AAAA,IAAA;AAAA,EAC5D,GACF;AAEJ;AAEAE,EAAkB,eAAed,CAAe;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RowData, TableOptions, TableState } from '@tanstack/react-table';
|
|
2
|
+
import { Operation } from '../../../interfaces';
|
|
3
|
+
export interface UseTableProps<Data extends RowData> extends TableOptions<Data> {
|
|
4
|
+
operations: Operation<Data>[];
|
|
5
|
+
metadata?: Record<string, unknown>;
|
|
6
|
+
i18n?: (i18n: string) => string;
|
|
7
|
+
onClick?: (data: any, operation: Operation<Data>) => void;
|
|
8
|
+
manualFaceted?: boolean;
|
|
9
|
+
onChange?: (query: TableState) => void;
|
|
10
|
+
pageSizes?: number[];
|
|
11
|
+
}
|
|
12
|
+
export declare function useTable<Data extends RowData>(props: UseTableProps<Data>): {
|
|
13
|
+
i18n: (i18n: string) => string;
|
|
14
|
+
tableInstance: import('@tanstack/table-core').Table<Data>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as R } from "react/jsx-runtime";
|
|
2
|
+
import { useReactTable as w, getCoreRowModel as M, getPaginationRowModel as f, getFilteredRowModel as C, getSortedRowModel as S, getFacetedRowModel as b, getFacetedUniqueValues as h } from "@tanstack/react-table";
|
|
3
|
+
import { useEffect as v } from "react";
|
|
4
|
+
import { getComponent as O } from "../../../registries/components.js";
|
|
5
|
+
function x(e) {
|
|
6
|
+
const i = O("CellOperations"), t = e.i18n || ((n) => n), a = e.operations.length ? [
|
|
7
|
+
{
|
|
8
|
+
id: "operations",
|
|
9
|
+
header: t("Operations"),
|
|
10
|
+
cell: (n) => /* @__PURE__ */ R(i, { info: n, operations: e.operations, metadata: e.metadata, onClick: e.onClick, i18n: t })
|
|
11
|
+
}
|
|
12
|
+
] : [], o = w({
|
|
13
|
+
...e,
|
|
14
|
+
columns: [...e.columns, ...a],
|
|
15
|
+
getCoreRowModel: M(),
|
|
16
|
+
getPaginationRowModel: f(),
|
|
17
|
+
getFilteredRowModel: e.manualFiltering ? void 0 : C(),
|
|
18
|
+
getSortedRowModel: e.manualSorting ? void 0 : S(),
|
|
19
|
+
getFacetedRowModel: e.manualFaceted ? void 0 : b(),
|
|
20
|
+
// client-side faceting
|
|
21
|
+
getFacetedUniqueValues: e.manualFaceted ? void 0 : h()
|
|
22
|
+
// generate unique values for select filter/autocomplete
|
|
23
|
+
}), { columnFilters: l, sorting: d, pagination: g, columnOrder: c, columnPinning: m, columnSizing: r, columnSizingInfo: u, columnVisibility: s, globalFilter: F } = o.getState();
|
|
24
|
+
return v(() => {
|
|
25
|
+
e.onChange && e.onChange(o.getState());
|
|
26
|
+
}, [l, d, g, c, m, r, u, s, F]), {
|
|
27
|
+
i18n: t,
|
|
28
|
+
tableInstance: o
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
x as useTable
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=useTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTable.js","sources":["../../../../src/molecules/table/hooks/useTable.tsx"],"sourcesContent":["import {\n type ColumnDef,\n getCoreRowModel,\n getFacetedRowModel,\n getFacetedUniqueValues,\n getFilteredRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n type RowData,\n type TableOptions,\n type TableState,\n useReactTable\n} from \"@tanstack/react-table\";\nimport { useEffect } from \"react\";\n\nimport { Operation } from \"../../../interfaces\";\nimport { getComponent } from \"../../../registries/components\";\nimport type { DefaultCellOperations } from \"../components/DefaultCellOperations\";\n\nexport interface UseTableProps<Data extends RowData> extends TableOptions<Data> {\n operations: Operation<Data>[];\n metadata?: Record<string, unknown>;\n i18n?: (i18n: string) => string;\n onClick?: (data: any, operation: Operation<Data>) => void;\n manualFaceted?: boolean;\n onChange?: (query: TableState) => void;\n pageSizes?: number[];\n}\n\nexport function useTable<Data extends RowData>(props: UseTableProps<Data>) {\n const Operations = getComponent<typeof DefaultCellOperations>(\"CellOperations\");\n const i18n = props.i18n || ((f: string) => f);\n\n // const [pagination, setPagination] = useState({\n // pageIndex: 0, //initial page index\n // pageSize: 10 //default page size\n // });\n\n const operations = props.operations.length\n ? ([\n {\n id: \"operations\",\n header: i18n(\"Operations\"),\n cell: (info) => (\n <Operations info={info} operations={props.operations} metadata={props.metadata} onClick={props.onClick} i18n={i18n} />\n )\n }\n ] satisfies ColumnDef<Data>[])\n : [];\n\n const tableInstance = useReactTable({\n ...props,\n columns: [...props.columns, ...operations],\n getCoreRowModel: getCoreRowModel(),\n getPaginationRowModel: getPaginationRowModel(),\n getFilteredRowModel: !props.manualFiltering ? getFilteredRowModel() : undefined,\n getSortedRowModel: !props.manualSorting ? getSortedRowModel() : undefined,\n getFacetedRowModel: !props.manualFaceted ? getFacetedRowModel() : undefined, // client-side faceting\n getFacetedUniqueValues: !props.manualFaceted ? getFacetedUniqueValues() : undefined // generate unique values for select filter/autocomplete\n });\n\n const { columnFilters, sorting, pagination, columnOrder, columnPinning, columnSizing, columnSizingInfo, columnVisibility, globalFilter } =\n tableInstance.getState();\n\n useEffect(() => {\n if (props.onChange) {\n props.onChange(tableInstance.getState());\n }\n }, [columnFilters, sorting, pagination, columnOrder, columnPinning, columnSizing, columnSizingInfo, columnVisibility, globalFilter]);\n\n return {\n i18n,\n tableInstance\n };\n}\n"],"names":["useTable","props","Operations","getComponent","i18n","f","operations","info","jsx","tableInstance","useReactTable","getCoreRowModel","getPaginationRowModel","getFilteredRowModel","getSortedRowModel","getFacetedRowModel","getFacetedUniqueValues","columnFilters","sorting","pagination","columnOrder","columnPinning","columnSizing","columnSizingInfo","columnVisibility","globalFilter","useEffect"],"mappings":";;;;AA6BO,SAASA,EAA+BC,GAA4B;AACnE,QAAAC,IAAaC,EAA2C,gBAAgB,GACxEC,IAAOH,EAAM,SAAS,CAACI,MAAcA,IAOrCC,IAAaL,EAAM,WAAW,SAC/B;AAAA,IACC;AAAA,MACE,IAAI;AAAA,MACJ,QAAQG,EAAK,YAAY;AAAA,MACzB,MAAM,CAACG,MACL,gBAAAC,EAACN,KAAW,MAAAK,GAAY,YAAYN,EAAM,YAAY,UAAUA,EAAM,UAAU,SAASA,EAAM,SAAS,MAAAG,EAAY,CAAA;AAAA,IAAA;AAAA,EAExH,IAEF,CAAC,GAECK,IAAgBC,EAAc;AAAA,IAClC,GAAGT;AAAA,IACH,SAAS,CAAC,GAAGA,EAAM,SAAS,GAAGK,CAAU;AAAA,IACzC,iBAAiBK,EAAgB;AAAA,IACjC,uBAAuBC,EAAsB;AAAA,IAC7C,qBAAsBX,EAAM,kBAA0C,SAAxBY;IAC9C,mBAAoBZ,EAAM,gBAAsC,SAAtBa;IAC1C,oBAAqBb,EAAM,gBAAuC,SAAvBc;;IAC3C,wBAAyBd,EAAM,gBAA2C,SAA3Be,EAA2B;AAAA;AAAA,EAAA,CAC3E,GAEK,EAAE,eAAAC,GAAe,SAAAC,GAAS,YAAAC,GAAY,aAAAC,GAAa,eAAAC,GAAe,cAAAC,GAAc,kBAAAC,GAAkB,kBAAAC,GAAkB,cAAAC,MACxHhB,EAAc,SAAS;AAEzB,SAAAiB,EAAU,MAAM;AACd,IAAIzB,EAAM,YACFA,EAAA,SAASQ,EAAc,UAAU;AAAA,EAE3C,GAAG,CAACQ,GAAeC,GAASC,GAAYC,GAAaC,GAAeC,GAAcC,GAAkBC,GAAkBC,CAAY,CAAC,GAE5H;AAAA,IACL,MAAArB;AAAA,IACA,eAAAK;AAAA,EACF;AACF;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useMemo as u } from "react";
|
|
2
|
+
function r({ header: e, filterVariant: o }) {
|
|
3
|
+
return u(
|
|
4
|
+
() => o === "range" ? [] : Array.from(e.column.getFacetedUniqueValues().keys()).flat().sort().slice(0, 5e3),
|
|
5
|
+
[e.column, o]
|
|
6
|
+
);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
r as useUniqValues
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=useUniqValues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUniqValues.js","sources":["../../../../src/molecules/table/hooks/useUniqValues.tsx"],"sourcesContent":["import type { Header } from \"@tanstack/react-table\";\nimport { useMemo } from \"react\";\n\nexport function useUniqValues<Data = any>({ header, filterVariant }: { header: Header<Data, unknown>; filterVariant: string }) {\n return useMemo(\n () => (filterVariant === \"range\" ? [] : Array.from(header.column.getFacetedUniqueValues().keys()).flat().sort().slice(0, 5000)),\n\n [header.column, filterVariant]\n );\n}\n"],"names":["useUniqValues","header","filterVariant","useMemo"],"mappings":";AAGO,SAASA,EAA0B,EAAE,QAAAC,GAAQ,eAAAC,KAA2E;AACtH,SAAAC;AAAA,IACL,MAAOD,MAAkB,UAAU,KAAK,MAAM,KAAKD,EAAO,OAAO,yBAAyB,KAAK,CAAC,EAAE,KAAK,EAAE,OAAO,MAAM,GAAG,GAAI;AAAA,IAE7H,CAACA,EAAO,QAAQC,CAAa;AAAA,EAC/B;AACF;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
|
+
import { TdHTMLAttributes } from 'react';
|
|
3
|
+
import { FilterOptions } from '../filters/Filters';
|
|
4
|
+
declare module "@tanstack/react-table" {
|
|
5
|
+
interface ColumnMeta<TData extends RowData, TValue> {
|
|
6
|
+
filter?: FilterOptions;
|
|
7
|
+
sort?: string;
|
|
8
|
+
cellProps?: TdHTMLAttributes<HTMLTableCellElement>;
|
|
9
|
+
/**
|
|
10
|
+
* Hide the cell
|
|
11
|
+
*/
|
|
12
|
+
hidden?: boolean;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extends.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { createColumnHelper as d } from "@tanstack/react-table";
|
|
3
|
+
import { Components as f } from "formiojs";
|
|
4
|
+
import C from "lodash/cloneDeep";
|
|
5
|
+
import g from "lodash/get";
|
|
6
|
+
import { getComponent as b } from "../../../registries/components.js";
|
|
7
|
+
const x = {
|
|
8
|
+
number: "range",
|
|
9
|
+
currency: "range",
|
|
10
|
+
checkbox: "boolean"
|
|
11
|
+
};
|
|
12
|
+
function H(c, u = []) {
|
|
13
|
+
const p = d(), o = C(u), n = b("Cell");
|
|
14
|
+
return c.components.flatMap((e) => e.type === "tabs" ? e.components.flatMap((r) => r.components) : [e]).filter((e) => e.tableView).map((e) => {
|
|
15
|
+
var m;
|
|
16
|
+
const r = f.create(e, {}, null, !0), a = o.findIndex(({ accessorKey: l }) => l === `data.${e.key}`);
|
|
17
|
+
let t = o[a];
|
|
18
|
+
return t && o.splice(a, 1), p.accessor(`data.${e.key}`, {
|
|
19
|
+
header: (m = e.label || e.title || e.key) == null ? void 0 : m.replace(/:/, ""),
|
|
20
|
+
cell: (l) => /* @__PURE__ */ s(n, { value: l.getValue(), render: (i) => r.asString(i) }),
|
|
21
|
+
meta: {
|
|
22
|
+
filter: { variant: x[e.type] || "text" },
|
|
23
|
+
...(t == null ? void 0 : t.meta) || {}
|
|
24
|
+
},
|
|
25
|
+
...t || {}
|
|
26
|
+
});
|
|
27
|
+
}).concat(o).map((e, r) => ({
|
|
28
|
+
...e,
|
|
29
|
+
meta: {
|
|
30
|
+
...e.meta || {},
|
|
31
|
+
order: g(e, "meta.order", r * 10)
|
|
32
|
+
},
|
|
33
|
+
cell: e.cell || ((a) => /* @__PURE__ */ s(n, { value: a.getValue(), render: (t) => t }))
|
|
34
|
+
})).sort((e, r) => e.meta.order > r.meta.order ? 1 : -1);
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
H as mapFormToColumns
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=mapFormToColumns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapFormToColumns.js","sources":["../../../../src/molecules/table/utils/mapFormToColumns.tsx"],"sourcesContent":["import \"../interfaces/extends\";\n\nimport { ColumnDef, ColumnDefResolved, createColumnHelper } from \"@tanstack/react-table\";\nimport { Components } from \"formiojs\";\nimport cloneDeep from \"lodash/cloneDeep\";\nimport get from \"lodash/get\";\n\nimport type { ComponentType, FormType } from \"../../../interfaces\";\nimport { getComponent } from \"../../../registries/components\";\nimport type { DefaultCell } from \"../components/DefaultCell\";\nimport type { FilterVariants } from \"../filters/Filters.js\";\n\nconst MAP_TYPES: Record<string, FilterVariants> = {\n number: \"range\",\n currency: \"range\",\n checkbox: \"boolean\"\n};\n\nexport function mapFormToColumns<Data = any>(form: FormType, columns: ColumnDefResolved<Data, any>[] = []): ColumnDef<Data, any>[] {\n const columnHelper = createColumnHelper<Data>();\n const columnsToKeep = cloneDeep(columns);\n\n const Cell = getComponent<typeof DefaultCell>(\"Cell\");\n\n const columnsFromComponents = form.components\n .flatMap((component) => {\n if (component.type === \"tabs\") {\n return component.components.flatMap((subComponent: ComponentType) => subComponent.components);\n }\n\n return [component];\n })\n .filter((component) => component.tableView)\n .map((component: ComponentType) => {\n const cmp: any = Components.create(component, {}, null, true);\n\n const columnIndex = columnsToKeep.findIndex(({ accessorKey }) => {\n return accessorKey === `data.${component.key}`;\n });\n\n let column = columnsToKeep[columnIndex];\n\n if (column) {\n columnsToKeep.splice(columnIndex, 1);\n }\n\n return columnHelper.accessor(`data.${component.key}` as any, {\n header: (component.label || component.title || component.key)?.replace(/:/, \"\"),\n cell: (info) => {\n return <Cell value={info.getValue() as Data} render={(value: Data) => cmp.asString(value)} />;\n },\n meta: {\n filter: { variant: MAP_TYPES[component.type!] || \"text\" },\n ...(column?.meta || {})\n },\n ...(column || {})\n });\n });\n\n const mergedColumns = columnsFromComponents.concat(columnsToKeep as any[]).map((column, index) => ({\n ...column,\n meta: {\n ...(column.meta || {}),\n order: get(column, \"meta.order\", index * 10)\n },\n cell:\n column.cell ||\n ((info) => {\n return <Cell value={info.getValue() as Data} render={(value: Data) => value} />;\n })\n }));\n\n return mergedColumns.sort((a, b) => (a.meta.order > b.meta.order ? 1 : -1)) as ColumnDef<Data, any>[];\n}\n"],"names":["MAP_TYPES","mapFormToColumns","form","columns","columnHelper","createColumnHelper","columnsToKeep","cloneDeep","Cell","getComponent","component","subComponent","cmp","Components","columnIndex","accessorKey","column","_a","info","jsx","value","index","get","a","b"],"mappings":";;;;;;AAYA,MAAMA,IAA4C;AAAA,EAChD,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,UAAU;AACZ;AAEO,SAASC,EAA6BC,GAAgBC,IAA0C,IAA4B;AACjI,QAAMC,IAAeC,EAAyB,GACxCC,IAAgBC,EAAUJ,CAAO,GAEjCK,IAAOC,EAAiC,MAAM;AAkDpD,SAhD8BP,EAAK,WAChC,QAAQ,CAACQ,MACJA,EAAU,SAAS,SACdA,EAAU,WAAW,QAAQ,CAACC,MAAgCA,EAAa,UAAU,IAGvF,CAACD,CAAS,CAClB,EACA,OAAO,CAACA,MAAcA,EAAU,SAAS,EACzC,IAAI,CAACA,MAA6B;;AACjC,UAAME,IAAWC,EAAW,OAAOH,GAAW,CAAC,GAAG,MAAM,EAAI,GAEtDI,IAAcR,EAAc,UAAU,CAAC,EAAE,aAAAS,QACtCA,MAAgB,QAAQL,EAAU,GAAG,EAC7C;AAEG,QAAAM,IAASV,EAAcQ,CAAW;AAEtC,WAAIE,KACYV,EAAA,OAAOQ,GAAa,CAAC,GAG9BV,EAAa,SAAS,QAAQM,EAAU,GAAG,IAAW;AAAA,MAC3D,SAASO,IAAAP,EAAU,SAASA,EAAU,SAASA,EAAU,QAAhD,gBAAAO,EAAsD,QAAQ,KAAK;AAAA,MAC5E,MAAM,CAACC,MACG,gBAAAC,EAAAX,GAAA,EAAK,OAAOU,EAAK,SAAS,GAAW,QAAQ,CAACE,MAAgBR,EAAI,SAASQ,CAAK,EAAG,CAAA;AAAA,MAE7F,MAAM;AAAA,QACJ,QAAQ,EAAE,SAASpB,EAAUU,EAAU,IAAK,KAAK,OAAO;AAAA,QACxD,IAAIM,KAAA,gBAAAA,EAAQ,SAAQ,CAAA;AAAA,MACtB;AAAA,MACA,GAAIA,KAAU,CAAA;AAAA,IAAC,CAChB;AAAA,EAAA,CACF,EAEyC,OAAOV,CAAsB,EAAE,IAAI,CAACU,GAAQK,OAAW;AAAA,IACjG,GAAGL;AAAA,IACH,MAAM;AAAA,MACJ,GAAIA,EAAO,QAAQ,CAAC;AAAA,MACpB,OAAOM,EAAIN,GAAQ,cAAcK,IAAQ,EAAE;AAAA,IAC7C;AAAA,IACA,MACEL,EAAO,SACN,CAACE,MACO,gBAAAC,EAACX,KAAK,OAAOU,EAAK,SAAoB,GAAA,QAAQ,CAACE,MAAgBA,GAAO;AAAA,EAC/E,EACF,EAEmB,KAAK,CAACG,GAAGC,MAAOD,EAAE,KAAK,QAAQC,EAAE,KAAK,QAAQ,IAAI,EAAG;AAC5E;"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare function ButtonTab({ icon, back, onClick, isActive, reverse, children, className, after }: PropsWithChildren<any>):
|
|
3
|
-
export interface TabsItemProps extends Record<string, any> {
|
|
4
|
-
label?: string;
|
|
5
|
-
icon?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface TabsProps extends Record<string, any> {
|
|
8
|
-
headerChildren?: any;
|
|
9
|
-
AddButton?: any;
|
|
10
|
-
current?: TabsItemProps;
|
|
11
|
-
items?: TabsItemProps[];
|
|
12
|
-
style?: any;
|
|
13
|
-
className?: string;
|
|
14
|
-
reverse?: boolean;
|
|
15
|
-
Button?: any;
|
|
16
|
-
onClick?: (item: TabsItemProps) => void;
|
|
17
|
-
i18n?: (f: string) => string;
|
|
18
|
-
}
|
|
19
|
-
export declare function Tabs({ style, current, items, children, HeaderChildren, AddButton, Button, className, onClick, i18n, ...additionalProps }: PropsWithChildren<TabsProps>):
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
export declare function ButtonTab({ icon, back, onClick, isActive, reverse, children, className, after }: PropsWithChildren<any>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export interface TabsItemProps extends Record<string, any> {
|
|
4
|
+
label?: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TabsProps extends Record<string, any> {
|
|
8
|
+
headerChildren?: any;
|
|
9
|
+
AddButton?: any;
|
|
10
|
+
current?: TabsItemProps;
|
|
11
|
+
items?: TabsItemProps[];
|
|
12
|
+
style?: any;
|
|
13
|
+
className?: string;
|
|
14
|
+
reverse?: boolean;
|
|
15
|
+
Button?: any;
|
|
16
|
+
onClick?: (item: TabsItemProps) => void;
|
|
17
|
+
i18n?: (f: string) => string;
|
|
18
|
+
}
|
|
19
|
+
export declare function Tabs({ style, current, items, children, HeaderChildren, AddButton, Button, className, onClick, i18n, ...additionalProps }: PropsWithChildren<TabsProps>): import("react/jsx-runtime").JSX.Element;
|