@tsed/react-formio 2.3.2 → 3.0.0-alpha.1
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/chunks/index.js +45 -0
- package/dist/chunks/index.js.map +1 -0
- package/dist/components/actions-table/actionsTable.component.d.ts +10 -11
- package/dist/components/actions-table/actionsTable.component.js +53 -0
- package/dist/components/actions-table/actionsTable.component.js.map +1 -0
- package/dist/components/alert/alert.component.d.ts +5 -6
- package/dist/components/alert/alert.component.js +24 -0
- package/dist/components/alert/alert.component.js.map +1 -0
- package/dist/components/card/card.component.d.ts +6 -7
- package/dist/components/card/card.component.js +12 -0
- package/dist/components/card/card.component.js.map +1 -0
- package/dist/components/form/form.component.d.ts +62 -63
- package/dist/components/form/form.component.js +64 -0
- package/dist/components/form/form.component.js.map +1 -0
- package/dist/components/form/useForm.hook.d.ts +59 -60
- package/dist/components/form/useForm.hook.js +64 -0
- package/dist/components/form/useForm.hook.js.map +1 -0
- package/dist/components/form-access/formAccess.component.d.ts +9 -9
- package/dist/components/form-access/formAccess.component.js +95 -0
- package/dist/components/form-access/formAccess.component.js.map +1 -0
- package/dist/components/form-access/formAccess.schema.d.ts +5 -5
- package/dist/components/form-access/formAccess.schema.js +164 -0
- package/dist/components/form-access/formAccess.schema.js.map +1 -0
- package/dist/components/form-access/formAccess.utils.d.ts +24 -24
- package/dist/components/form-access/formAccess.utils.js +68 -0
- package/dist/components/form-access/formAccess.utils.js.map +1 -0
- package/dist/components/form-action/formAction.component.d.ts +9 -9
- package/dist/components/form-action/formAction.component.js +32 -0
- package/dist/components/form-action/formAction.component.js.map +1 -0
- package/dist/components/form-builder/formBuilder.component.d.ts +53 -53
- package/dist/components/form-builder/formBuilder.component.js +142 -0
- package/dist/components/form-builder/formBuilder.component.js.map +1 -0
- package/dist/components/form-control/formControl.component.d.ts +14 -14
- package/dist/components/form-control/formControl.component.js +26 -0
- package/dist/components/form-control/formControl.component.js.map +1 -0
- package/dist/components/form-edit/formCtas.component.d.ts +28 -28
- package/dist/components/form-edit/formCtas.component.js +70 -0
- package/dist/components/form-edit/formCtas.component.js.map +1 -0
- package/dist/components/form-edit/formEdit.component.d.ts +18 -19
- package/dist/components/form-edit/formEdit.component.js +57 -0
- package/dist/components/form-edit/formEdit.component.js.map +1 -0
- package/dist/components/form-edit/formEdit.reducer.d.ts +10 -10
- package/dist/components/form-edit/formEdit.reducer.js +65 -0
- package/dist/components/form-edit/formEdit.reducer.js.map +1 -0
- package/dist/components/form-edit/formParameters.component.d.ts +34 -34
- package/dist/components/form-edit/formParameters.component.js +92 -0
- package/dist/components/form-edit/formParameters.component.js.map +1 -0
- package/dist/components/form-edit/useFormEdit.hook.d.ts +29 -29
- package/dist/components/form-edit/useFormEdit.hook.js +36 -0
- package/dist/components/form-edit/useFormEdit.hook.js.map +1 -0
- package/dist/components/form-settings/formSettings.component.d.ts +7 -8
- package/dist/components/form-settings/formSettings.component.js +38 -0
- package/dist/components/form-settings/formSettings.component.js.map +1 -0
- package/dist/components/form-settings/formSettings.schema.d.ts +2 -2
- package/dist/components/form-settings/formSettings.schema.js +60 -0
- package/dist/components/form-settings/formSettings.schema.js.map +1 -0
- package/dist/components/form-settings/formSettings.utils.d.ts +8 -8
- package/dist/components/form-settings/formSettings.utils.js +23 -0
- package/dist/components/form-settings/formSettings.utils.js.map +1 -0
- package/dist/components/forms-table/components/formCell.component.d.ts +6 -7
- package/dist/components/forms-table/components/formCell.component.js +50 -0
- package/dist/components/forms-table/components/formCell.component.js.map +1 -0
- package/dist/components/forms-table/formsTable.component.d.ts +10 -11
- package/dist/components/forms-table/formsTable.component.js +29 -0
- package/dist/components/forms-table/formsTable.component.js.map +1 -0
- package/dist/components/index.d.ts +25 -26
- package/dist/components/index.js +86 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/input-tags/inputTags.component.d.ts +18 -19
- package/dist/components/input-tags/inputTags.component.js +37 -0
- package/dist/components/input-tags/inputTags.component.js.map +1 -0
- package/dist/components/input-text/inputText.component.d.ts +27 -28
- package/dist/components/input-text/inputText.component.js +70 -0
- package/dist/components/input-text/inputText.component.js.map +1 -0
- package/dist/components/loader/loader.component.d.ts +17 -17
- package/dist/components/loader/loader.component.js +26 -0
- package/dist/components/loader/loader.component.js.map +1 -0
- package/dist/components/modal/modal.component.d.ts +15 -15
- package/dist/components/modal/modal.component.js +62 -0
- package/dist/components/modal/modal.component.js.map +1 -0
- package/dist/components/modal/removeModal.component.d.ts +9 -9
- package/dist/components/modal/removeModal.component.js +71 -0
- package/dist/components/modal/removeModal.component.js.map +1 -0
- package/dist/components/pagination/pagination.component.d.ts +17 -18
- package/dist/components/pagination/pagination.component.js +87 -0
- package/dist/components/pagination/pagination.component.js.map +1 -0
- package/dist/components/select/select.component.d.ts +14 -14
- package/dist/components/select/select.component.js +60 -0
- package/dist/components/select/select.component.js.map +1 -0
- package/dist/components/submissions-table/submissionsTable.component.d.ts +6 -7
- package/dist/components/submissions-table/submissionsTable.component.js +11 -0
- package/dist/components/submissions-table/submissionsTable.component.js.map +1 -0
- package/dist/components/table/components/defaultArrowSort.component.d.ts +1 -2
- package/dist/components/table/components/defaultArrowSort.component.js +10 -0
- package/dist/components/table/components/defaultArrowSort.component.js.map +1 -0
- package/dist/components/table/components/defaultCell.component.d.ts +1 -2
- package/dist/components/table/components/defaultCell.component.js +11 -0
- package/dist/components/table/components/defaultCell.component.js.map +1 -0
- package/dist/components/table/components/defaultCellHeader.component.d.ts +5 -6
- package/dist/components/table/components/defaultCellHeader.component.js +14 -0
- package/dist/components/table/components/defaultCellHeader.component.js.map +1 -0
- package/dist/components/table/components/defaultCellOperations.component.d.ts +12 -13
- package/dist/components/table/components/defaultCellOperations.component.js +21 -0
- package/dist/components/table/components/defaultCellOperations.component.js.map +1 -0
- package/dist/components/table/components/defaultCells.component.d.ts +4 -5
- package/dist/components/table/components/defaultCells.component.js +23 -0
- package/dist/components/table/components/defaultCells.component.js.map +1 -0
- package/dist/components/table/components/defaultOperationButton.component.d.ts +15 -14
- package/dist/components/table/components/defaultOperationButton.component.js +45 -0
- package/dist/components/table/components/defaultOperationButton.component.js.map +1 -0
- package/dist/components/table/components/defaultRow.component.d.ts +12 -12
- package/dist/components/table/components/defaultRow.component.js +25 -0
- package/dist/components/table/components/defaultRow.component.js.map +1 -0
- package/dist/components/table/components/dragNDropContainer.d.ts +4 -4
- package/dist/components/table/components/dragNDropContainer.js +10 -0
- package/dist/components/table/components/dragNDropContainer.js.map +1 -0
- package/dist/components/table/filters/defaultColumnFilter.component.d.ts +5 -6
- package/dist/components/table/filters/defaultColumnFilter.component.js +32 -0
- package/dist/components/table/filters/defaultColumnFilter.component.js.map +1 -0
- package/dist/components/table/filters/selectColumnFilter.component.d.ts +10 -11
- package/dist/components/table/filters/selectColumnFilter.component.js +34 -0
- package/dist/components/table/filters/selectColumnFilter.component.js.map +1 -0
- package/dist/components/table/filters/sliderColumnFilter.component.d.ts +2 -3
- package/dist/components/table/filters/sliderColumnFilter.component.js +27 -0
- package/dist/components/table/filters/sliderColumnFilter.component.js.map +1 -0
- package/dist/components/table/hooks/useCustomTable.hook.d.ts +128 -128
- package/dist/components/table/hooks/useCustomTable.hook.js +130 -0
- package/dist/components/table/hooks/useCustomTable.hook.js.map +1 -0
- package/dist/components/table/hooks/useDragnDropRow.hook.d.ts +272 -274
- package/dist/components/table/hooks/useDragnDropRow.hook.js +40 -0
- package/dist/components/table/hooks/useDragnDropRow.hook.js.map +1 -0
- package/dist/components/table/hooks/useOperations.hook.d.ts +11 -11
- package/dist/components/table/hooks/useOperations.hook.js +25 -0
- package/dist/components/table/hooks/useOperations.hook.js.map +1 -0
- package/dist/components/table/index.d.ts +15 -15
- package/dist/components/table/index.js +35 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/table/table.component.d.ts +3 -3
- package/dist/components/table/table.component.js +81 -0
- package/dist/components/table/table.component.js.map +1 -0
- package/dist/components/table/utils/getPageNumbers.d.ts +3 -3
- package/dist/components/table/utils/getPageNumbers.js +25 -0
- package/dist/components/table/utils/getPageNumbers.js.map +1 -0
- package/dist/components/table/utils/mapFormToColumns.d.ts +3 -3
- package/dist/components/table/utils/mapFormToColumns.js +23 -0
- package/dist/components/table/utils/mapFormToColumns.js.map +1 -0
- package/dist/components/table/utils/swapElements.d.ts +1 -1
- package/dist/components/table/utils/swapElements.js +5 -0
- package/dist/components/table/utils/swapElements.js.map +1 -0
- package/dist/components/tabs/tabs.component.d.ts +19 -19
- package/dist/components/tabs/tabs.component.js +72 -0
- package/dist/components/tabs/tabs.component.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 +13 -13
- package/dist/index.js +107 -7651
- package/dist/index.js.map +1 -1
- package/dist/interfaces/ActionSchema.d.ts +23 -23
- package/dist/interfaces/ActionSchema.js +2 -0
- package/dist/interfaces/ActionSchema.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/FormOptions.d.ts +10 -10
- package/dist/interfaces/FormOptions.js +2 -0
- package/dist/interfaces/FormOptions.js.map +1 -0
- package/dist/interfaces/FormSchema.d.ts +12 -12
- package/dist/interfaces/FormSchema.js +2 -0
- package/dist/interfaces/FormSchema.js.map +1 -0
- package/dist/interfaces/Operation.d.ts +29 -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 +6 -6
- package/dist/interfaces/RoleSchema.js +2 -0
- package/dist/interfaces/RoleSchema.js.map +1 -0
- package/dist/interfaces/Submission.d.ts +5 -5
- package/dist/interfaces/Submission.js +2 -0
- package/dist/interfaces/Submission.js.map +1 -0
- package/dist/interfaces/index.d.ts +8 -8
- package/dist/interfaces/index.js +2 -0
- package/dist/interfaces/index.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/typings.d.js +2 -0
- package/dist/typings.d.js.map +1 -0
- package/dist/utils/callLast.d.ts +1 -1
- package/dist/utils/callLast.js +10 -0
- package/dist/utils/callLast.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 +23 -13
- package/src/components/actions-table/actionsTable.component.spec.tsx +5 -6
- package/src/components/actions-table/actionsTable.component.tsx +1 -1
- package/src/components/alert/alert.component.spec.tsx +0 -1
- package/src/components/alert/alert.component.tsx +0 -2
- package/src/components/alert/alert.stories.tsx +0 -2
- package/src/components/card/card.component.spec.tsx +0 -1
- package/src/components/card/card.component.tsx +1 -2
- package/src/components/card/card.stories.tsx +0 -2
- package/src/components/form/form.component.spec.tsx +1 -1
- package/src/components/form/form.component.tsx +0 -1
- package/src/components/form/form.stories.tsx +2 -3
- package/src/components/form-access/formAccess.component.tsx +1 -2
- package/src/components/form-action/formAction.component.tsx +2 -1
- package/src/components/form-action/formAction.stories.tsx +0 -2
- package/src/components/form-builder/formBuilder.component.tsx +4 -4
- package/src/components/form-builder/formBuilder.stories.tsx +0 -2
- package/src/components/form-control/formControl.component.spec.tsx +0 -1
- package/src/components/form-control/formControl.component.tsx +5 -5
- package/src/components/form-control/formControl.stories.tsx +0 -2
- package/src/components/form-edit/formCtas.component.tsx +1 -1
- package/src/components/form-edit/formEdit.component.tsx +0 -1
- package/src/components/form-edit/formEdit.reducer.ts +0 -1
- package/src/components/form-edit/formEdit.stories.tsx +0 -2
- package/src/components/form-edit/formParameters.component.tsx +1 -1
- package/src/components/form-settings/formSettings.component.spec.tsx +5 -6
- package/src/components/form-settings/formSettings.component.tsx +1 -1
- package/src/components/form-settings/formSettings.stories.tsx +0 -2
- package/src/components/forms-table/components/formCell.component.tsx +0 -1
- package/src/components/forms-table/formsTable.component.tsx +0 -2
- package/src/components/forms-table/formsTable.stories.tsx +0 -1
- package/src/components/index.ts +0 -1
- package/src/components/input-tags/inputTags.component.tsx +1 -1
- package/src/components/input-tags/inputTags.stories.tsx +1 -1
- package/src/components/input-text/inputText.component.spec.tsx +0 -1
- package/src/components/input-text/inputText.component.tsx +1 -1
- package/src/components/input-text/inputText.stories.tsx +1 -1
- package/src/components/loader/loader.component.spec.tsx +1 -1
- package/src/components/loader/loader.component.tsx +1 -1
- package/src/components/loader/loader.stories.tsx +0 -2
- package/src/components/modal/modal.component.spec.tsx +2 -5
- package/src/components/modal/modal.component.tsx +1 -1
- package/src/components/modal/modal.stories.tsx +0 -2
- package/src/components/modal/removeModal.component.tsx +1 -1
- package/src/components/pagination/pagination.component.spec.tsx +7 -10
- package/src/components/pagination/pagination.component.tsx +1 -1
- package/src/components/pagination/pagination.stories.tsx +1 -1
- package/src/components/select/select.component.spec.tsx +1 -2
- package/src/components/select/select.component.tsx +2 -2
- package/src/components/select/select.stories.tsx +1 -1
- package/src/components/submissions-table/submissionsTable.component.tsx +0 -2
- package/src/components/submissions-table/submissionsTable.stories.tsx +4 -4
- package/src/components/table/components/defaultArrowSort.component.tsx +0 -2
- package/src/components/table/components/defaultCell.component.tsx +0 -2
- package/src/components/table/components/defaultCellHeader.component.tsx +0 -1
- package/src/components/table/components/defaultCellOperations.component.tsx +0 -2
- package/src/components/table/components/defaultCells.component.tsx +0 -1
- package/src/components/table/components/defaultOperationButton.component.tsx +5 -0
- package/src/components/table/components/defaultRow.component.tsx +2 -1
- package/src/components/table/components/dragNDropContainer.tsx +1 -1
- package/src/components/table/filters/defaultColumnFilter.component.spec.tsx +2 -5
- package/src/components/table/filters/defaultColumnFilter.component.tsx +2 -1
- package/src/components/table/filters/selectColumnFilter.component.spec.tsx +3 -6
- package/src/components/table/filters/selectColumnFilter.component.tsx +0 -1
- package/src/components/table/filters/sliderColumnFilter.component.tsx +7 -10
- package/src/components/table/hooks/useCustomTable.hook.tsx +16 -20
- package/src/components/table/hooks/useOperations.hook.tsx +1 -1
- package/src/components/table/table.component.tsx +1 -1
- package/src/components/table/table.stories.tsx +8 -8
- package/src/components/table/utils/mapFormToColumns.tsx +0 -1
- package/src/components/tabs/tabs.component.spec.tsx +2 -2
- package/src/components/tabs/tabs.component.stories.tsx +1 -1
- package/src/components/tabs/tabs.component.tsx +1 -1
- package/src/react-table.d.ts +2 -0
- package/src/utils/iconClass.ts +3 -1
- package/tsconfig.app.json +11 -0
- package/tsconfig.json +8 -6
- 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.spec.d.ts +0 -1
- package/dist/components/actions-table/actionsTable.stories.d.ts +0 -40
- 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.spec.d.ts +0 -1
- package/dist/components/form/form.stories.d.ts +0 -6445
- package/dist/components/form-access/formAccess.stories.d.ts +0 -21
- package/dist/components/form-access/formAccess.utils.spec.d.ts +0 -1
- package/dist/components/form-action/formAction.stories.d.ts +0 -409
- package/dist/components/form-builder/formBuilder.stories.d.ts +0 -5989
- 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/formEdit.stories.d.ts +0 -396
- package/dist/components/form-settings/formSettings.component.spec.d.ts +0 -1
- package/dist/components/form-settings/formSettings.stories.d.ts +0 -58
- package/dist/components/form-settings/formSettings.utils.spec.d.ts +0 -1
- package/dist/components/forms-table/formsTable.stories.d.ts +0 -117
- package/dist/components/input-tags/inputTags.stories.d.ts +0 -76
- 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.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.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.spec.d.ts +0 -1
- package/dist/components/select/select.stories.d.ts +0 -164
- package/dist/components/submissions-table/submissionsTable.stories.d.ts +0 -649
- package/dist/components/table/filters/defaultColumnFilter.component.spec.d.ts +0 -1
- package/dist/components/table/filters/selectColumnFilter.component.spec.d.ts +0 -1
- package/dist/components/table/table.stories.d.ts +0 -71
- 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 -7435
- package/dist/index.modern.js.map +0 -1
- package/dist/setupTests.d.ts +0 -1
- package/jest.config.js +0 -6
- package/src/components/react-component/reactComponent.component.tsx +0 -197
- package/src/setupTests.tsx +0 -5
- package/tsconfig.node.json +0 -8
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsxs as n, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { c as t } from "../../chunks/index.js";
|
|
3
|
+
import { Select as I } from "../select/select.component.js";
|
|
4
|
+
import { getPageNumbers as k, LEFT_PAGE as S, RIGHT_PAGE as z } from "../table/utils/getPageNumbers.js";
|
|
5
|
+
function m(s) {
|
|
6
|
+
const { component: d = "button", children: g, disabled: l, active: r, ...p } = s;
|
|
7
|
+
return /* @__PURE__ */ a(
|
|
8
|
+
d,
|
|
9
|
+
{
|
|
10
|
+
...p,
|
|
11
|
+
"data-testid": "pagination-button",
|
|
12
|
+
disabled: l,
|
|
13
|
+
className: t("page-link", l ? "disabled" : "", "", s.className),
|
|
14
|
+
children: g
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
function A(s) {
|
|
19
|
+
const {
|
|
20
|
+
className: d,
|
|
21
|
+
pageSizes: g = [10, 25, 50, 100],
|
|
22
|
+
gotoPage: l,
|
|
23
|
+
canPreviousPage: r,
|
|
24
|
+
previousPage: p,
|
|
25
|
+
nextPage: P,
|
|
26
|
+
canNextPage: h,
|
|
27
|
+
pageCount: x,
|
|
28
|
+
pageIndex: c = 1,
|
|
29
|
+
pageOptions: b,
|
|
30
|
+
pageSize: f,
|
|
31
|
+
setPageSize: v,
|
|
32
|
+
totalLength: u,
|
|
33
|
+
i18n: i = (e) => e
|
|
34
|
+
} = s, N = k({
|
|
35
|
+
currentPage: c,
|
|
36
|
+
// pageNeighbours,
|
|
37
|
+
totalPages: x
|
|
38
|
+
}), C = g.map((e) => ({ value: e, label: e }));
|
|
39
|
+
return /* @__PURE__ */ n("nav", { "aria-label": "Page navigation", className: t("pagination-group -mb-3", d), children: [
|
|
40
|
+
/* @__PURE__ */ n("ul", { className: "pagination mb-3 mr-3", children: [
|
|
41
|
+
/* @__PURE__ */ a("li", { className: t("page-item", !r && "disabled"), children: /* @__PURE__ */ a(m, { tabIndex: -1, disabled: !r, onClick: () => p(), children: i("Previous") }) }),
|
|
42
|
+
N.map((e) => {
|
|
43
|
+
if ([S, z].includes(e))
|
|
44
|
+
return /* @__PURE__ */ a("li", { className: "page-item", children: /* @__PURE__ */ a(m, { "aria-hidden": "true", children: "..." }) }, e);
|
|
45
|
+
const o = e - 1 === c;
|
|
46
|
+
return /* @__PURE__ */ a("li", { className: t("page-item", o && "active"), children: /* @__PURE__ */ a(m, { tabIndex: c, active: o, onClick: () => l(e - 1), children: e }) }, e);
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ a("li", { className: t("page-item", !h && "disabled"), children: /* @__PURE__ */ a(m, { tabIndex: N.length, disabled: !h, onClick: () => P(), children: i("Next") }) })
|
|
49
|
+
] }),
|
|
50
|
+
/* @__PURE__ */ n("li", { className: "mb-3 mr-3 flex items-center", children: [
|
|
51
|
+
/* @__PURE__ */ a(
|
|
52
|
+
I,
|
|
53
|
+
{
|
|
54
|
+
name: "page",
|
|
55
|
+
value: f,
|
|
56
|
+
choices: C,
|
|
57
|
+
onChange: (e, o) => {
|
|
58
|
+
v(+o);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ a("span", { className: "ml-3", children: i("items per page") })
|
|
63
|
+
] }),
|
|
64
|
+
b && /* @__PURE__ */ n("li", { className: "mb-3 mr-3 flex items-center", children: [
|
|
65
|
+
/* @__PURE__ */ n("span", { children: [
|
|
66
|
+
i("Page"),
|
|
67
|
+
" "
|
|
68
|
+
] }),
|
|
69
|
+
/* @__PURE__ */ n("strong", { children: [
|
|
70
|
+
c + 1,
|
|
71
|
+
" of ",
|
|
72
|
+
b.length
|
|
73
|
+
] })
|
|
74
|
+
] }),
|
|
75
|
+
u !== void 0 && /* @__PURE__ */ n("li", { className: "mb-3 flex items-center", "data-testid": "pagination-total-items", children: [
|
|
76
|
+
i("Total"),
|
|
77
|
+
": ",
|
|
78
|
+
/* @__PURE__ */ a("strong", { className: "mx-1", children: new Intl.NumberFormat(void 0).format(u) }),
|
|
79
|
+
" ",
|
|
80
|
+
i("items")
|
|
81
|
+
] })
|
|
82
|
+
] });
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
A as Pagination
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=pagination.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.component.js","sources":["../../../src/components/pagination/pagination.component.tsx"],"sourcesContent":["import classnames from \"classnames\";\nimport { PropsWithChildren } from \"react\";\n\nimport { Select } from \"../select/select.component\";\nimport { getPageNumbers, LEFT_PAGE, RIGHT_PAGE } from \"../table/utils/getPageNumbers\";\n\nfunction PaginationButton(\n props: PropsWithChildren<\n {\n component?: any;\n disabled?: boolean;\n className?: string;\n active?: boolean;\n } & Record<string, any>\n >\n) {\n const { component: Component = \"button\", children, disabled, active, ...otherProps } = props;\n\n return (\n <Component\n {...otherProps}\n data-testid='pagination-button'\n disabled={disabled}\n className={classnames(\"page-link\", disabled ? \"disabled\" : \"\", active ? \"\" : \"\", props.className)}\n >\n {children}\n </Component>\n );\n}\n\nexport interface PaginationProps {\n className?: string;\n pageSizes?: number[];\n gotoPage: any;\n canPreviousPage: boolean;\n previousPage: any;\n nextPage: any;\n canNextPage: boolean;\n pageCount: number;\n pageIndex: number;\n pageOptions?: number[];\n pageSize: number;\n setPageSize: any;\n totalLength?: number;\n i18n?: (f: string) => string;\n}\n\nexport function Pagination(props: PaginationProps) {\n const {\n className,\n pageSizes = [10, 25, 50, 100],\n gotoPage,\n canPreviousPage,\n previousPage,\n nextPage,\n canNextPage,\n pageCount,\n pageIndex = 1,\n pageOptions,\n pageSize,\n setPageSize,\n totalLength,\n i18n = (f: string) => f\n } = props;\n\n const pageNumbers = getPageNumbers({\n currentPage: pageIndex,\n // pageNeighbours,\n totalPages: pageCount\n });\n const choices: any[] = pageSizes.map((value) => ({ value, label: value }));\n\n return (\n <nav aria-label='Page navigation' className={classnames(\"pagination-group -mb-3\", className)}>\n <ul className='pagination mb-3 mr-3'>\n <li className={classnames(\"page-item\", !canPreviousPage && \"disabled\")}>\n <PaginationButton tabIndex={-1} disabled={!canPreviousPage} onClick={() => previousPage()}>\n {i18n(\"Previous\")}\n </PaginationButton>\n </li>\n\n {pageNumbers.map((page) => {\n if ([LEFT_PAGE, RIGHT_PAGE].includes(page)) {\n return (\n <li className='page-item' key={page}>\n <PaginationButton aria-hidden='true'>...</PaginationButton>\n </li>\n );\n }\n\n const active = page - 1 === pageIndex;\n return (\n <li className={classnames(\"page-item\", active && \"active\")} key={page}>\n <PaginationButton tabIndex={pageIndex} active={active} onClick={() => gotoPage(page - 1)}>\n {page}\n </PaginationButton>\n </li>\n );\n })}\n\n <li className={classnames(\"page-item\", !canNextPage && \"disabled\")}>\n <PaginationButton tabIndex={pageNumbers.length} disabled={!canNextPage} onClick={() => nextPage()}>\n {i18n(\"Next\")}\n </PaginationButton>\n </li>\n </ul>\n\n <li className='mb-3 mr-3 flex items-center'>\n <Select\n name={\"page\"}\n value={pageSize}\n choices={choices}\n onChange={(name: string, value: number) => {\n setPageSize(+value);\n }}\n />\n <span className={\"ml-3\"}>{i18n(\"items per page\")}</span>\n </li>\n {pageOptions && (\n <li className={\"mb-3 mr-3 flex items-center\"}>\n <span>{i18n(\"Page\")} </span>\n <strong>\n {pageIndex + 1} of {pageOptions.length}\n </strong>\n </li>\n )}\n {totalLength !== undefined && (\n <li className={\"mb-3 flex items-center\"} data-testid='pagination-total-items'>\n {i18n(\"Total\")}: <strong className='mx-1'>{new Intl.NumberFormat(undefined).format(totalLength)}</strong> {i18n(\"items\")}\n </li>\n )}\n </nav>\n );\n}\n"],"names":["PaginationButton","props","Component","children","disabled","active","otherProps","jsx","classnames","Pagination","className","pageSizes","gotoPage","canPreviousPage","previousPage","nextPage","canNextPage","pageCount","pageIndex","pageOptions","pageSize","setPageSize","totalLength","i18n","f","pageNumbers","getPageNumbers","choices","value","jsxs","page","LEFT_PAGE","RIGHT_PAGE","Select","name"],"mappings":";;;;AAMA,SAASA,EACPC,GAQA;AACM,QAAA,EAAE,WAAWC,IAAY,UAAU,UAAAC,GAAU,UAAAC,GAAU,QAAAC,GAAQ,GAAGC,EAAA,IAAeL;AAGrF,SAAA,gBAAAM;AAAA,IAACL;AAAA,IAAA;AAAA,MACE,GAAGI;AAAA,MACJ,eAAY;AAAA,MACZ,UAAAF;AAAA,MACA,WAAWI,EAAW,aAAaJ,IAAW,aAAa,IAAa,IAASH,EAAM,SAAS;AAAA,MAE/F,UAAAE;AAAA,IAAA;AAAA,EACH;AAEJ;AAmBO,SAASM,EAAWR,GAAwB;AAC3C,QAAA;AAAA,IACJ,WAAAS;AAAA,IACA,WAAAC,IAAY,CAAC,IAAI,IAAI,IAAI,GAAG;AAAA,IAC5B,UAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,MAAAC,IAAO,CAACC,MAAcA;AAAA,EAAA,IACpBvB,GAEEwB,IAAcC,EAAe;AAAA,IACjC,aAAaR;AAAA;AAAA,IAEb,YAAYD;AAAA,EAAA,CACb,GACKU,IAAiBhB,EAAU,IAAI,CAACiB,OAAW,EAAE,OAAAA,GAAO,OAAOA,EAAA,EAAQ;AAGvE,SAAA,gBAAAC,EAAC,SAAI,cAAW,mBAAkB,WAAWrB,EAAW,0BAA0BE,CAAS,GACzF,UAAA;AAAA,IAAC,gBAAAmB,EAAA,MAAA,EAAG,WAAU,wBACZ,UAAA;AAAA,MAAC,gBAAAtB,EAAA,MAAA,EAAG,WAAWC,EAAW,aAAa,CAACK,KAAmB,UAAU,GACnE,UAAA,gBAAAN,EAACP,GAAiB,EAAA,UAAU,IAAI,UAAU,CAACa,GAAiB,SAAS,MAAMC,EACxE,GAAA,UAAAS,EAAK,UAAU,EAAA,CAClB,EACF,CAAA;AAAA,MAECE,EAAY,IAAI,CAACK,MAAS;AACzB,YAAI,CAACC,GAAWC,CAAU,EAAE,SAASF,CAAI;AAErC,iBAAA,gBAAAvB,EAAC,MAAG,EAAA,WAAU,aACZ,UAAA,gBAAAA,EAACP,KAAiB,eAAY,QAAO,UAAG,MAAA,CAAA,EAAA,GADX8B,CAE/B;AAIE,cAAAzB,IAASyB,IAAO,MAAMZ;AAE1B,eAAA,gBAAAX,EAAC,QAAG,WAAWC,EAAW,aAAaH,KAAU,QAAQ,GACvD,UAAC,gBAAAE,EAAAP,GAAA,EAAiB,UAAUkB,GAAW,QAAAb,GAAgB,SAAS,MAAMO,EAASkB,IAAO,CAAC,GACpF,UACHA,GAAA,EAAA,GAH+DA,CAIjE;AAAA,MAAA,CAEH;AAAA,MAED,gBAAAvB,EAAC,MAAG,EAAA,WAAWC,EAAW,aAAa,CAACQ,KAAe,UAAU,GAC/D,UAAA,gBAAAT,EAACP,GAAiB,EAAA,UAAUyB,EAAY,QAAQ,UAAU,CAACT,GAAa,SAAS,MAAMD,KACpF,UAAAQ,EAAK,MAAM,EACd,CAAA,EACF,CAAA;AAAA,IAAA,GACF;AAAA,IAEA,gBAAAM,EAAC,MAAG,EAAA,WAAU,+BACZ,UAAA;AAAA,MAAA,gBAAAtB;AAAA,QAAC0B;AAAA,QAAA;AAAA,UACC,MAAM;AAAA,UACN,OAAOb;AAAA,UACP,SAAAO;AAAA,UACA,UAAU,CAACO,GAAcN,MAAkB;AACzC,YAAAP,EAAY,CAACO,CAAK;AAAA,UAAA;AAAA,QACpB;AAAA,MACF;AAAA,wBACC,QAAK,EAAA,WAAW,QAAS,UAAAL,EAAK,gBAAgB,EAAE,CAAA;AAAA,IAAA,GACnD;AAAA,IACCJ,KACC,gBAAAU,EAAC,MAAG,EAAA,WAAW,+BACb,UAAA;AAAA,MAAA,gBAAAA,EAAC,QAAM,EAAA,UAAA;AAAA,QAAAN,EAAK,MAAM;AAAA,QAAE;AAAA,MAAA,GAAM;AAAA,wBACzB,UACE,EAAA,UAAA;AAAA,QAAYL,IAAA;AAAA,QAAE;AAAA,QAAKC,EAAY;AAAA,MAAA,EAClC,CAAA;AAAA,IAAA,GACF;AAAA,IAEDG,MAAgB,UACf,gBAAAO,EAAC,QAAG,WAAW,0BAA0B,eAAY,0BAClD,UAAA;AAAA,MAAAN,EAAK,OAAO;AAAA,MAAE;AAAA,MAAE,gBAAAhB,EAAC,UAAO,EAAA,WAAU,QAAQ,UAAA,IAAI,KAAK,aAAa,MAAS,EAAE,OAAOe,CAAW,EAAE,CAAA;AAAA,MAAS;AAAA,MAAEC,EAAK,OAAO;AAAA,IAAA,EACzH,CAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { HTMLAttributes, ReactElement } from
|
|
2
|
-
import { FormControlProps } from
|
|
3
|
-
export interface SelectProps<Data = any> extends FormControlProps, Omit<HTMLAttributes<HTMLSelectElement>, "onChange" | "prefix"> {
|
|
4
|
-
size?: string;
|
|
5
|
-
placeholder?: string;
|
|
6
|
-
choices: {
|
|
7
|
-
label: string;
|
|
8
|
-
value: Data;
|
|
9
|
-
}[];
|
|
10
|
-
layout?: "html5" | "choicesjs";
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
multiple?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare function Select<Data = any>({ name, label, size, onChange, required, value, choices, description, placeholder, prefix, suffix, multiple, layout, ...props }: SelectProps<Data>): ReactElement;
|
|
1
|
+
import { HTMLAttributes, ReactElement } from 'react';
|
|
2
|
+
import { FormControlProps } from '../form-control/formControl.component';
|
|
3
|
+
export interface SelectProps<Data = any> extends FormControlProps, Omit<HTMLAttributes<HTMLSelectElement>, "onChange" | "prefix"> {
|
|
4
|
+
size?: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
choices: {
|
|
7
|
+
label: string;
|
|
8
|
+
value: Data;
|
|
9
|
+
}[];
|
|
10
|
+
layout?: "html5" | "choicesjs";
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
multiple?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function Select<Data = any>({ name, label, size, onChange, required, value, choices, description, placeholder, prefix, suffix, multiple, layout, ...props }: SelectProps<Data>): ReactElement;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import g from "@formio/choices.js";
|
|
3
|
+
import { c as h } from "../../chunks/index.js";
|
|
4
|
+
import { useRef as w, useEffect as x } from "react";
|
|
5
|
+
import { getEventValue as C } from "../../utils/getEventValue.js";
|
|
6
|
+
import { FormControl as E } from "../form-control/formControl.component.js";
|
|
7
|
+
function N({
|
|
8
|
+
name: t,
|
|
9
|
+
label: u,
|
|
10
|
+
size: s,
|
|
11
|
+
onChange: l,
|
|
12
|
+
required: a,
|
|
13
|
+
value: d,
|
|
14
|
+
choices: e,
|
|
15
|
+
description: p,
|
|
16
|
+
placeholder: o,
|
|
17
|
+
prefix: v,
|
|
18
|
+
suffix: j,
|
|
19
|
+
multiple: f,
|
|
20
|
+
layout: m,
|
|
21
|
+
...b
|
|
22
|
+
}) {
|
|
23
|
+
const i = w(null);
|
|
24
|
+
return x(() => {
|
|
25
|
+
let r;
|
|
26
|
+
return m === "choicesjs" && (r = new g(i.current, {
|
|
27
|
+
removeItemButton: !0,
|
|
28
|
+
placeholderValue: o
|
|
29
|
+
})), () => {
|
|
30
|
+
r && r.destroy();
|
|
31
|
+
};
|
|
32
|
+
}, []), e = m === "choicesjs" || f || !o ? e : [
|
|
33
|
+
{
|
|
34
|
+
label: o,
|
|
35
|
+
value: ""
|
|
36
|
+
},
|
|
37
|
+
...e
|
|
38
|
+
], /* @__PURE__ */ n(E, { name: t, label: u, required: a, description: p, prefix: v, suffix: j, shadow: !1, children: /* @__PURE__ */ n(
|
|
39
|
+
"select",
|
|
40
|
+
{
|
|
41
|
+
ref: i,
|
|
42
|
+
"data-testid": `select_${t}`,
|
|
43
|
+
...b,
|
|
44
|
+
className: h("form-control", s && `form-control-${s}`),
|
|
45
|
+
name: t,
|
|
46
|
+
id: t,
|
|
47
|
+
multiple: f,
|
|
48
|
+
value: d || "",
|
|
49
|
+
placeholder: o,
|
|
50
|
+
onChange: (r) => {
|
|
51
|
+
l && l(t, C(r));
|
|
52
|
+
},
|
|
53
|
+
children: e.map(({ label: r, value: c }) => /* @__PURE__ */ n("option", { label: r, value: c, children: r }, String(c)))
|
|
54
|
+
}
|
|
55
|
+
) });
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
N as Select
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=select.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.component.js","sources":["../../../src/components/select/select.component.tsx"],"sourcesContent":["import Choices from \"@formio/choices.js\";\nimport classnames from \"classnames\";\nimport { HTMLAttributes, ReactElement, useEffect, useRef } from \"react\";\n\nimport { getEventValue } from \"../../utils/getEventValue\";\nimport { FormControl, FormControlProps } from \"../form-control/formControl.component\";\n\nexport interface SelectProps<Data = any> extends FormControlProps, Omit<HTMLAttributes<HTMLSelectElement>, \"onChange\" | \"prefix\"> {\n size?: string;\n placeholder?: string;\n choices: { label: string; value: Data }[];\n layout?: \"html5\" | \"choicesjs\";\n disabled?: boolean;\n multiple?: boolean;\n}\n\nexport function Select<Data = any>({\n name,\n label,\n size,\n onChange,\n required,\n value,\n choices,\n description,\n placeholder,\n prefix,\n suffix,\n multiple,\n layout,\n ...props\n}: SelectProps<Data>): ReactElement {\n const ref = useRef<HTMLSelectElement>(null);\n\n useEffect(() => {\n let instance: any;\n\n if (layout === \"choicesjs\") {\n instance = new Choices(ref.current as unknown as HTMLInputElement, {\n removeItemButton: true,\n placeholderValue: placeholder\n });\n }\n\n return () => {\n instance && instance.destroy();\n };\n }, []);\n\n choices =\n layout === \"choicesjs\" || multiple || !placeholder\n ? choices\n : ([\n {\n label: placeholder,\n value: \"\"\n },\n ...choices\n ] as any[]);\n\n return (\n <FormControl name={name} label={label} required={required} description={description} prefix={prefix} suffix={suffix} shadow={false}>\n {}\n <select\n ref={ref}\n data-testid={`select_${name}`}\n {...props}\n className={classnames(\"form-control\", size && `form-control-${size}`)}\n name={name}\n id={name}\n multiple={multiple}\n value={value || (\"\" as any)}\n placeholder={placeholder}\n onChange={(event) => {\n onChange && onChange(name, getEventValue(event));\n }}\n >\n {choices.map(({ label, value }) => {\n return (\n <option key={String(value)} label={label} value={value as any}>\n {label}\n </option>\n );\n })}\n </select>\n </FormControl>\n );\n}\n"],"names":["Select","name","label","size","onChange","required","value","choices","description","placeholder","prefix","suffix","multiple","layout","props","ref","useRef","useEffect","instance","Choices","jsx","FormControl","classnames","event","getEventValue"],"mappings":";;;;;;AAgBO,SAASA,EAAmB;AAAA,EACjC,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,GAAGC;AACL,GAAoC;AAC5B,QAAAC,IAAMC,EAA0B,IAAI;AAE1C,SAAAC,EAAU,MAAM;AACV,QAAAC;AAEJ,WAAIL,MAAW,gBACFK,IAAA,IAAIC,EAAQJ,EAAI,SAAwC;AAAA,MACjE,kBAAkB;AAAA,MAClB,kBAAkBN;AAAA,IAAA,CACnB,IAGI,MAAM;AACX,MAAAS,KAAYA,EAAS,QAAQ;AAAA,IAC/B;AAAA,EACF,GAAG,EAAE,GAELX,IACEM,MAAW,eAAeD,KAAY,CAACH,IACnCF,IACC;AAAA,IACC;AAAA,MACE,OAAOE;AAAA,MACP,OAAO;AAAA,IACT;AAAA,IACA,GAAGF;AAAA,EACL,GAGJ,gBAAAa,EAACC,KAAY,MAAApB,GAAY,OAAAC,GAAc,UAAAG,GAAoB,aAAAG,GAA0B,QAAAE,GAAgB,QAAAC,GAAgB,QAAQ,IAE3H,UAAA,gBAAAS;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAL;AAAA,MACA,eAAa,UAAUd,CAAI;AAAA,MAC1B,GAAGa;AAAA,MACJ,WAAWQ,EAAW,gBAAgBnB,KAAQ,gBAAgBA,CAAI,EAAE;AAAA,MACpE,MAAAF;AAAA,MACA,IAAIA;AAAA,MACJ,UAAAW;AAAA,MACA,OAAON,KAAU;AAAA,MACjB,aAAAG;AAAA,MACA,UAAU,CAACc,MAAU;AACnB,QAAAnB,KAAYA,EAASH,GAAMuB,EAAcD,CAAK,CAAC;AAAA,MACjD;AAAA,MAEC,UAAAhB,EAAQ,IAAI,CAAC,EAAE,OAAAL,GAAO,OAAAI,QAEnB,gBAAAc,EAAC,UAA2B,EAAA,OAAOlB,GAAO,OAAOI,GAC9C,UAAAJ,EAAAA,GADU,OAAOI,CAAK,CAEzB,CAEH;AAAA,IAAA;AAAA,EAAA,GAEL;AAEJ;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
export declare function SubmissionsTable({ form, ...props }: SubmissionsTableProps): React.JSX.Element;
|
|
1
|
+
import { FormSchema, Submission } from '../../interfaces';
|
|
2
|
+
import { TableProps } from '../table/hooks/useCustomTable.hook';
|
|
3
|
+
export type SubmissionsTableProps = Omit<TableProps<Submission>, "columns"> & {
|
|
4
|
+
form?: FormSchema;
|
|
5
|
+
};
|
|
6
|
+
export declare function SubmissionsTable({ form, ...props }: SubmissionsTableProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Table as s } from "../table/table.component.js";
|
|
3
|
+
import { mapFormToColumns as t } from "../table/utils/mapFormToColumns.js";
|
|
4
|
+
function e({ form: o, ...m }) {
|
|
5
|
+
const r = o && t(o);
|
|
6
|
+
return /* @__PURE__ */ n(s, { ...m, columns: r });
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
e as SubmissionsTable
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=submissionsTable.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submissionsTable.component.js","sources":["../../../src/components/submissions-table/submissionsTable.component.tsx"],"sourcesContent":["import { FormSchema, Submission } from \"../../interfaces\";\nimport { TableProps } from \"../table/hooks/useCustomTable.hook\";\nimport { Table } from \"../table/table.component\";\nimport { mapFormToColumns } from \"../table/utils/mapFormToColumns\";\n\nexport type SubmissionsTableProps = Omit<TableProps<Submission>, \"columns\"> & {\n form?: FormSchema;\n};\n\nexport function SubmissionsTable({ form, ...props }: SubmissionsTableProps) {\n const columns: any[] | undefined = form && mapFormToColumns(form);\n\n return <Table {...props} columns={columns!} />;\n}\n"],"names":["SubmissionsTable","form","props","columns","mapFormToColumns","jsx","Table"],"mappings":";;;AASO,SAASA,EAAiB,EAAE,MAAAC,GAAM,GAAGC,KAAgC;AACpE,QAAAC,IAA6BF,KAAQG,EAAiBH,CAAI;AAEhE,SAAQ,gBAAAI,EAAAC,GAAA,EAAO,GAAGJ,GAAO,SAAAC,EAAmB,CAAA;AAC9C;"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function DefaultArrowSort({ column }: any): React.JSX.Element;
|
|
1
|
+
export declare function DefaultArrowSort({ column }: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { iconClass as e } from "../../../utils/iconClass.js";
|
|
3
|
+
function n({ column: r }) {
|
|
4
|
+
const { isSorted: s, isSortedDesc: t } = r;
|
|
5
|
+
return /* @__PURE__ */ o("span", { className: "table-arrow-sort", children: s ? /* @__PURE__ */ o("i", { className: e(void 0, t ? "sort-up" : "sort-down") }) : "" });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
n as DefaultArrowSort
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=defaultArrowSort.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultArrowSort.component.js","sources":["../../../../src/components/table/components/defaultArrowSort.component.tsx"],"sourcesContent":["import { iconClass } from \"../../../utils/iconClass\";\n\nexport function DefaultArrowSort({ column }: any) {\n const { isSorted, isSortedDesc } = column;\n return (\n <span className={\"table-arrow-sort\"}>\n {isSorted ? <i className={iconClass(undefined, isSortedDesc ? \"sort-up\" : \"sort-down\")} /> : \"\"}\n </span>\n );\n}\n"],"names":["DefaultArrowSort","column","isSorted","isSortedDesc","jsx","iconClass"],"mappings":";;AAEgB,SAAAA,EAAiB,EAAE,QAAAC,KAAe;AAC1C,QAAA,EAAE,UAAAC,GAAU,cAAAC,EAAA,IAAiBF;AACnC,SACG,gBAAAG,EAAA,QAAA,EAAK,WAAW,oBACd,cAAY,gBAAAA,EAAA,KAAA,EAAE,WAAWC,EAAU,QAAWF,IAAe,YAAY,WAAW,EAAA,CAAG,IAAK,IAC/F;AAEJ;"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function DefaultCell({ value, render }: any): JSX.Element;
|
|
1
|
+
export declare function DefaultCell({ value, render }: any): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
function o({ value: r, render: e = (n) => n }) {
|
|
3
|
+
if (r === void 0)
|
|
4
|
+
return /* @__PURE__ */ t("span", {});
|
|
5
|
+
const n = e(r);
|
|
6
|
+
return r !== n ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: n } }) : /* @__PURE__ */ t("span", { children: String(r) });
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
o as DefaultCell
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=defaultCell.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultCell.component.js","sources":["../../../../src/components/table/components/defaultCell.component.tsx"],"sourcesContent":["export function DefaultCell({ value, render = (f: any) => f }: any): JSX.Element {\n if (value === undefined) {\n return <span></span>;\n }\n\n const rendered = render(value);\n\n if (value !== rendered) {\n return <div dangerouslySetInnerHTML={{ __html: rendered }} />;\n }\n\n return <span>{String(value)}</span>;\n}\n"],"names":["DefaultCell","value","render","f","rendered","jsx"],"mappings":";AAAO,SAASA,EAAY,EAAE,OAAAC,GAAO,QAAAC,IAAS,CAACC,MAAWA,KAAuB;AAC/E,MAAIF,MAAU;AACZ,6BAAQ,QAAK,EAAA;AAGT,QAAAG,IAAWF,EAAOD,CAAK;AAE7B,SAAIA,MAAUG,sBACJ,OAAI,EAAA,yBAAyB,EAAE,QAAQA,KAAY,IAGrD,gBAAAC,EAAA,QAAA,EAAM,UAAO,OAAAJ,CAAK,GAAE;AAC9B;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
export declare function DefaultCellHeader<Data extends Record<string, unknown> = {}>({ column }: DefaultCellHeaderProps<Data>): React.JSX.Element;
|
|
1
|
+
import { HeaderGroup } from 'react-table';
|
|
2
|
+
export interface DefaultCellHeaderProps<Data extends object = any> extends Record<string, unknown> {
|
|
3
|
+
column: HeaderGroup<Data>;
|
|
4
|
+
}
|
|
5
|
+
export declare function DefaultCellHeader<Data extends Record<string, unknown> = {}>({ column }: DefaultCellHeaderProps<Data>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsxs as r, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
function d({ column: e }) {
|
|
3
|
+
return /* @__PURE__ */ r("div", { className: "table-cell-header", children: [
|
|
4
|
+
/* @__PURE__ */ r("div", { className: "table-cell-header__label", ...e.getSortByToggleProps(), children: [
|
|
5
|
+
/* @__PURE__ */ l("span", { children: e.render("Header") }),
|
|
6
|
+
e.render("ArrowSort")
|
|
7
|
+
] }),
|
|
8
|
+
e.canFilter ? /* @__PURE__ */ l("div", { className: "table-cell-header__filter", children: e.render("Filter") }) : null
|
|
9
|
+
] });
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
d as DefaultCellHeader
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=defaultCellHeader.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultCellHeader.component.js","sources":["../../../../src/components/table/components/defaultCellHeader.component.tsx"],"sourcesContent":["import { HeaderGroup } from \"react-table\";\n\nexport interface DefaultCellHeaderProps<Data extends object = any> extends Record<string, unknown> {\n column: HeaderGroup<Data>;\n}\n\nexport function DefaultCellHeader<Data extends Record<string, unknown> = {}>({ column }: DefaultCellHeaderProps<Data>) {\n return (\n <div className={\"table-cell-header\"}>\n <div className='table-cell-header__label' {...column.getSortByToggleProps()}>\n <span>{column.render(\"Header\") as any}</span>\n\n {column.render(\"ArrowSort\") as any}\n </div>\n {column.canFilter ? <div className='table-cell-header__filter'>{column.render(\"Filter\") as any}</div> : null}\n </div>\n );\n}\n"],"names":["DefaultCellHeader","column","jsxs","jsx"],"mappings":";AAMgB,SAAAA,EAA6D,EAAE,QAAAC,KAAwC;AAEnH,SAAA,gBAAAC,EAAC,OAAI,EAAA,WAAW,qBACd,UAAA;AAAA,IAAA,gBAAAA,EAAC,SAAI,WAAU,4BAA4B,GAAGD,EAAO,qBACnD,GAAA,UAAA;AAAA,MAAA,gBAAAE,EAAC,QAAM,EAAA,UAAAF,EAAO,OAAO,QAAQ,GAAS;AAAA,MAErCA,EAAO,OAAO,WAAW;AAAA,IAAA,GAC5B;AAAA,IACCA,EAAO,YAAY,gBAAAE,EAAC,OAAI,EAAA,WAAU,6BAA6B,UAAOF,EAAA,OAAO,QAAQ,EAAS,CAAA,IAAS;AAAA,EAAA,GAC1G;AAEJ;"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
export declare function DefaultCellOperations({ operations, row, onClick, ctx, i18n }: DefaultCellOperationsProps): React.JSX.Element;
|
|
1
|
+
import { DefaultOperationButton, OperationButtonProps } from './defaultOperationButton.component';
|
|
2
|
+
export interface DefaultCellOperationsProps {
|
|
3
|
+
operations: (OperationButtonProps & {
|
|
4
|
+
OperationButton: typeof DefaultOperationButton;
|
|
5
|
+
permissionsResolver?(data: unknown, ctx: any): boolean;
|
|
6
|
+
})[];
|
|
7
|
+
row: any;
|
|
8
|
+
onClick: (data: any, action: string) => void;
|
|
9
|
+
ctx: any;
|
|
10
|
+
i18n: (i18n: string) => string;
|
|
11
|
+
}
|
|
12
|
+
export declare function DefaultCellOperations({ operations, row, onClick, ctx, i18n }: DefaultCellOperationsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { DefaultOperationButton as d } from "./defaultOperationButton.component.js";
|
|
3
|
+
function g({ operations: o, row: e, onClick: l, ctx: r, i18n: u }) {
|
|
4
|
+
const a = e.original;
|
|
5
|
+
return /* @__PURE__ */ i("div", { className: "btn-group", children: o.filter(({ permissionsResolver: t }) => !t || t(a, r)).map(({ OperationButton: t = d, ...n }, c) => /* @__PURE__ */ i(
|
|
6
|
+
t,
|
|
7
|
+
{
|
|
8
|
+
...n,
|
|
9
|
+
"data-testid": `operation-${c}-${n.action}`,
|
|
10
|
+
onClick: (f) => l(a, f),
|
|
11
|
+
data: a,
|
|
12
|
+
i18n: u,
|
|
13
|
+
ctx: r
|
|
14
|
+
},
|
|
15
|
+
n.action
|
|
16
|
+
)) });
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
g as DefaultCellOperations
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=defaultCellOperations.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultCellOperations.component.js","sources":["../../../../src/components/table/components/defaultCellOperations.component.tsx"],"sourcesContent":["import { DefaultOperationButton, OperationButtonProps } from \"./defaultOperationButton.component\";\n\nexport interface DefaultCellOperationsProps {\n operations: (OperationButtonProps & {\n OperationButton: typeof DefaultOperationButton;\n permissionsResolver?(data: unknown, ctx: any): boolean;\n })[];\n row: any;\n\n onClick: (data: any, action: string) => void;\n ctx: any;\n i18n: (i18n: string) => string;\n}\n\nexport function DefaultCellOperations({ operations, row, onClick, ctx, i18n }: DefaultCellOperationsProps) {\n const data = row.original;\n\n return (\n <div className='btn-group'>\n {operations\n .filter(({ permissionsResolver }) => !permissionsResolver || permissionsResolver(data, ctx))\n .map(({ OperationButton = DefaultOperationButton, ...operation }, index: number) => {\n return (\n <OperationButton\n key={operation.action}\n {...operation}\n data-testid={`operation-${index}-${operation.action}`}\n onClick={(action: string) => onClick(data, action)}\n data={data}\n i18n={i18n}\n ctx={ctx}\n />\n );\n })}\n </div>\n );\n}\n"],"names":["DefaultCellOperations","operations","row","onClick","ctx","i18n","data","jsx","permissionsResolver","OperationButton","DefaultOperationButton","operation","index","action"],"mappings":";;AAcO,SAASA,EAAsB,EAAE,YAAAC,GAAY,KAAAC,GAAK,SAAAC,GAAS,KAAAC,GAAK,MAAAC,KAAoC;AACzG,QAAMC,IAAOJ,EAAI;AAGf,SAAA,gBAAAK,EAAC,OAAI,EAAA,WAAU,aACZ,UAAAN,EACE,OAAO,CAAC,EAAE,qBAAAO,QAA0B,CAACA,KAAuBA,EAAoBF,GAAMF,CAAG,CAAC,EAC1F,IAAI,CAAC,EAAE,iBAAAK,IAAkBC,GAAwB,GAAGC,EAAU,GAAGC,MAE9D,gBAAAL;AAAA,IAACE;AAAA,IAAA;AAAA,MAEE,GAAGE;AAAA,MACJ,eAAa,aAAaC,CAAK,IAAID,EAAU,MAAM;AAAA,MACnD,SAAS,CAACE,MAAmBV,EAAQG,GAAMO,CAAM;AAAA,MACjD,MAAAP;AAAA,MACA,MAAAD;AAAA,MACA,KAAAD;AAAA,IAAA;AAAA,IANKO,EAAU;AAAA,EAOjB,CAEH,GACL;AAEJ;"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}): React.JSX.Element;
|
|
1
|
+
import { Row } from 'react-table';
|
|
2
|
+
export declare function DefaultCells<Data extends object = {}>({ row }: {
|
|
3
|
+
row: Row<Data>;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as a, Fragment as s } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as o } from "react";
|
|
3
|
+
function c({ row: n }) {
|
|
4
|
+
return /* @__PURE__ */ a(s, { children: n.cells.map((e, t) => {
|
|
5
|
+
const { hidden: l, colspan: r } = e.column;
|
|
6
|
+
return l ? null : /* @__PURE__ */ o(
|
|
7
|
+
"td",
|
|
8
|
+
{
|
|
9
|
+
colSpan: r,
|
|
10
|
+
...e.getCellProps({
|
|
11
|
+
className: e.column.className,
|
|
12
|
+
style: e.column.style
|
|
13
|
+
}),
|
|
14
|
+
key: `tableInstance.page.cells.${e.value || "value"}.${t}`
|
|
15
|
+
},
|
|
16
|
+
e.render("Cell")
|
|
17
|
+
);
|
|
18
|
+
}) });
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
c as DefaultCells
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=defaultCells.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultCells.component.js","sources":["../../../../src/components/table/components/defaultCells.component.tsx"],"sourcesContent":["import { Row } from \"react-table\";\n\nimport type { ExtendedCell } from \"../hooks/useCustomTable.hook\";\n\nexport function DefaultCells<Data extends object = {}>({ row }: { row: Row<Data> }) {\n return (\n <>\n {row.cells.map((cell: ExtendedCell<Data>, i) => {\n const { hidden, colspan } = cell.column;\n\n if (hidden) {\n return null;\n }\n\n return (\n <td\n colSpan={colspan}\n {...cell.getCellProps({\n className: cell.column.className,\n style: cell.column.style\n })}\n key={`tableInstance.page.cells.${cell.value || \"value\"}.${i}`}\n >\n {cell.render(\"Cell\") as any}\n </td>\n );\n })}\n </>\n );\n}\n"],"names":["DefaultCells","row","cell","i","hidden","colspan","createElement"],"mappings":";;AAIgB,SAAAA,EAAuC,EAAE,KAAAC,KAA2B;AAClF,gCAEK,UAAIA,EAAA,MAAM,IAAI,CAACC,GAA0BC,MAAM;AAC9C,UAAM,EAAE,QAAAC,GAAQ,SAAAC,EAAQ,IAAIH,EAAK;AAEjC,WAAIE,IACK,OAIP,gBAAAE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAASD;AAAA,QACR,GAAGH,EAAK,aAAa;AAAA,UACpB,WAAWA,EAAK,OAAO;AAAA,UACvB,OAAOA,EAAK,OAAO;AAAA,QAAA,CACpB;AAAA,QACD,KAAK,4BAA4BA,EAAK,SAAS,OAAO,IAAIC,CAAC;AAAA,MAAA;AAAA,MAE1DD,EAAK,OAAO,MAAM;AAAA,IACrB;AAAA,EAEH,CAAA,GACH;AAEJ;"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { HTMLAttributes } from
|
|
2
|
-
export interface OperationButtonProps extends Omit<HTMLAttributes<HTMLButtonElement>, "onClick"> {
|
|
3
|
-
buttonType?: string;
|
|
4
|
-
buttonSize?: string;
|
|
5
|
-
buttonOutline?: boolean;
|
|
6
|
-
data: any[];
|
|
7
|
-
onClick: (action: string) => void;
|
|
8
|
-
action: string;
|
|
9
|
-
icon?: string;
|
|
10
|
-
title?: string;
|
|
11
|
-
i18n?: (i18n: string) => string;
|
|
12
|
-
ctx?: any;
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface OperationButtonProps extends Omit<HTMLAttributes<HTMLButtonElement>, "onClick"> {
|
|
3
|
+
buttonType?: string;
|
|
4
|
+
buttonSize?: string;
|
|
5
|
+
buttonOutline?: boolean;
|
|
6
|
+
data: any[];
|
|
7
|
+
onClick: (action: string) => void;
|
|
8
|
+
action: string;
|
|
9
|
+
icon?: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
i18n?: (i18n: string) => string;
|
|
12
|
+
ctx?: any;
|
|
13
|
+
permissionsResolver?: (ctx: any) => boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function DefaultOperationButton(props: OperationButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsxs as i, Fragment as f, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { c as d } from "../../../chunks/index.js";
|
|
3
|
+
import { iconClass as x } from "../../../utils/iconClass.js";
|
|
4
|
+
import { stopPropagationWrapper as h } from "../../../utils/stopPropagationWrapper.js";
|
|
5
|
+
function y(r) {
|
|
6
|
+
const {
|
|
7
|
+
className: e = "btn",
|
|
8
|
+
buttonSize: s = "xs",
|
|
9
|
+
buttonType: l = "primary",
|
|
10
|
+
buttonOutline: c,
|
|
11
|
+
onClick: m,
|
|
12
|
+
action: n,
|
|
13
|
+
icon: o = "",
|
|
14
|
+
title: t = "",
|
|
15
|
+
i18n: p = (b) => b,
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
17
|
+
data: N,
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
19
|
+
ctx: j,
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
21
|
+
permissionsResolver: C,
|
|
22
|
+
...u
|
|
23
|
+
} = r;
|
|
24
|
+
return /* @__PURE__ */ i(
|
|
25
|
+
"button",
|
|
26
|
+
{
|
|
27
|
+
...u,
|
|
28
|
+
"aria-label": "Operation button: " + (t || n),
|
|
29
|
+
className: d(e, ["btn", c && "outline", l].filter(Boolean).join("-"), `btn-${s}`),
|
|
30
|
+
onClick: h(() => m(n)),
|
|
31
|
+
children: [
|
|
32
|
+
o ? /* @__PURE__ */ i(f, { children: [
|
|
33
|
+
/* @__PURE__ */ a("i", { className: x(void 0, o) }),
|
|
34
|
+
" ",
|
|
35
|
+
t && " "
|
|
36
|
+
] }) : null,
|
|
37
|
+
t && /* @__PURE__ */ a("span", { className: o && t ? "ml-1" : "", children: p(t) })
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
y as DefaultOperationButton
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=defaultOperationButton.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultOperationButton.component.js","sources":["../../../../src/components/table/components/defaultOperationButton.component.tsx"],"sourcesContent":["import classnames from \"classnames\";\nimport { HTMLAttributes } from \"react\";\n\nimport { iconClass } from \"../../../utils/iconClass\";\nimport { stopPropagationWrapper } from \"../../../utils/stopPropagationWrapper\";\n\nexport interface OperationButtonProps extends Omit<HTMLAttributes<HTMLButtonElement>, \"onClick\"> {\n buttonType?: string;\n buttonSize?: string;\n buttonOutline?: boolean;\n data: any[];\n onClick: (action: string) => void;\n action: string;\n icon?: string;\n title?: string;\n i18n?: (i18n: string) => string;\n ctx?: any;\n permissionsResolver?: (ctx: any) => boolean;\n}\n\nexport function DefaultOperationButton(props: OperationButtonProps) {\n const {\n className = \"btn\",\n buttonSize = \"xs\",\n buttonType = \"primary\",\n buttonOutline,\n onClick,\n action,\n icon = \"\",\n title = \"\",\n i18n = (f: string) => f,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n data,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ctx,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n permissionsResolver,\n ...otherProps\n } = props;\n\n return (\n <button\n {...otherProps}\n aria-label={\"Operation button: \" + (title || action)}\n className={classnames(className, [\"btn\", buttonOutline && \"outline\", buttonType].filter(Boolean).join(\"-\"), `btn-${buttonSize}`)}\n onClick={stopPropagationWrapper(() => onClick(action))}\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"],"names":["DefaultOperationButton","props","className","buttonSize","buttonType","buttonOutline","onClick","action","icon","title","i18n","f","data","ctx","permissionsResolver","otherProps","jsxs","classnames","stopPropagationWrapper","Fragment","jsx","iconClass"],"mappings":";;;;AAoBO,SAASA,EAAuBC,GAA6B;AAC5D,QAAA;AAAA,IACJ,WAAAC,IAAY;AAAA,IACZ,YAAAC,IAAa;AAAA,IACb,YAAAC,IAAa;AAAA,IACb,eAAAC;AAAA,IACA,SAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,OAAAC,IAAQ;AAAA,IACR,MAAAC,IAAO,CAACC,MAAcA;AAAA;AAAA,IAEtB,MAAAC;AAAA;AAAA,IAEA,KAAAC;AAAA;AAAA,IAEA,qBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDd;AAGF,SAAA,gBAAAe;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGD;AAAA,MACJ,cAAY,wBAAwBN,KAASF;AAAA,MAC7C,WAAWU,EAAWf,GAAW,CAAC,OAAOG,KAAiB,WAAWD,CAAU,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,GAAG,OAAOD,CAAU,EAAE;AAAA,MAC/H,SAASe,EAAuB,MAAMZ,EAAQC,CAAM,CAAC;AAAA,MAEpD,UAAA;AAAA,QAAAC,IAEG,gBAAAQ,EAAAG,GAAA,EAAA,UAAA;AAAA,UAAA,gBAAAC,EAAC,KAAE,EAAA,WAAWC,EAAU,QAAWb,CAAI,GAAG;AAAA,UAAE;AAAA,UAAEC,KAAS;AAAA,QAAA,EAAA,CACzD,IACE;AAAA,QACHA,KAAU,gBAAAW,EAAA,QAAA,EAAK,WAAWZ,KAAQC,IAAQ,SAAS,IAAK,UAAKC,EAAAD,CAAK,EAAE,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACvE;AAEJ;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Row } from
|
|
3
|
-
export interface DefaultRowProps<Data extends object = {}> extends Omit<DetailedHTMLProps<HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, "onClick" | "onDrag" | "onDrop"> {
|
|
4
|
-
onClick: (data: any, action: string) => void;
|
|
5
|
-
row: Row<Data>;
|
|
6
|
-
index: number;
|
|
7
|
-
onDrop: (item: Data) => void;
|
|
8
|
-
onDrag: (index: number, hoverIndex: number) => void;
|
|
9
|
-
enableDragNDrop?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare function DefaultDndRow<Data extends object = {}>(props: DefaultRowProps<Data>):
|
|
12
|
-
export declare function DefaultRow<Data extends object = {}>({ onClick, row, enableDragNDrop, onDrop, onDrag, ...props }: DefaultRowProps<Data>):
|
|
1
|
+
import { DetailedHTMLProps, HTMLAttributes } from 'react';
|
|
2
|
+
import { Row } from 'react-table';
|
|
3
|
+
export interface DefaultRowProps<Data extends object = {}> extends Omit<DetailedHTMLProps<HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, "onClick" | "onDrag" | "onDrop"> {
|
|
4
|
+
onClick: (data: any, action: string) => void;
|
|
5
|
+
row: Row<Data>;
|
|
6
|
+
index: number;
|
|
7
|
+
onDrop: (item: Data) => void;
|
|
8
|
+
onDrag: (index: number, hoverIndex: number) => void;
|
|
9
|
+
enableDragNDrop?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function DefaultDndRow<Data extends object = {}>(props: DefaultRowProps<Data>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function DefaultRow<Data extends object = {}>({ onClick, row, enableDragNDrop, onDrop, onDrag, ...props }: DefaultRowProps<Data>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as f } from "../../../chunks/index.js";
|
|
3
|
+
import { iconClass as d } from "../../../utils/iconClass.js";
|
|
4
|
+
import { useDndRow as m } from "../hooks/useDragnDropRow.hook.js";
|
|
5
|
+
import { DefaultCells as n } from "./defaultCells.component.js";
|
|
6
|
+
function u(t) {
|
|
7
|
+
const { isDragging: e, dragRef: i, dropRef: o, opacity: s } = m(t);
|
|
8
|
+
return /* @__PURE__ */ c("tr", { ref: o, style: { opacity: s }, children: [
|
|
9
|
+
/* @__PURE__ */ r("td", { ref: i, role: "cell", style: { cursor: e ? "grabbing" : "grab" }, className: "align-middle", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ r("i", { className: f(d(void 0, "dots-vertical-rounded")) }) }) }),
|
|
10
|
+
/* @__PURE__ */ r(n, { ...t })
|
|
11
|
+
] });
|
|
12
|
+
}
|
|
13
|
+
function x({ onClick: t, row: e, enableDragNDrop: i, onDrop: o, onDrag: s, ...a }) {
|
|
14
|
+
const l = {
|
|
15
|
+
...a,
|
|
16
|
+
onClick: () => t(e.original, "row"),
|
|
17
|
+
...e.getRowProps()
|
|
18
|
+
};
|
|
19
|
+
return i ? /* @__PURE__ */ r(u, { ...l, row: e, onDrag: s, onDrop: o }) : /* @__PURE__ */ r("tr", { ...l, children: /* @__PURE__ */ r(n, { row: e }) });
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
u as DefaultDndRow,
|
|
23
|
+
x as DefaultRow
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=defaultRow.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultRow.component.js","sources":["../../../../src/components/table/components/defaultRow.component.tsx"],"sourcesContent":["import classnames from \"classnames\";\nimport { DetailedHTMLProps, HTMLAttributes } from \"react\";\nimport { Row } from \"react-table\";\n\nimport { iconClass } from \"../../../utils/iconClass\";\nimport { useDndRow } from \"../hooks/useDragnDropRow.hook\";\nimport { DefaultCells } from \"./defaultCells.component\";\n\nexport interface DefaultRowProps<Data extends object = {}>\n extends Omit<DetailedHTMLProps<HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, \"onClick\" | \"onDrag\" | \"onDrop\"> {\n onClick: (data: any, action: string) => void;\n row: Row<Data>;\n index: number;\n onDrop: (item: Data) => void;\n onDrag: (index: number, hoverIndex: number) => void;\n enableDragNDrop?: boolean;\n}\n\nexport function DefaultDndRow<Data extends object = {}>(props: DefaultRowProps<Data>) {\n const { isDragging, dragRef, dropRef, opacity } = useDndRow(props);\n\n return (\n <tr ref={dropRef} style={{ opacity }}>\n {/* eslint-disable-next-line jsx-a11y/no-interactive-element-to-noninteractive-role */}\n <td ref={dragRef} role='cell' style={{ cursor: isDragging ? \"grabbing\" : \"grab\" }} className='align-middle'>\n <div className='flex items-center justify-center'>\n <i className={classnames(iconClass(undefined, \"dots-vertical-rounded\"))} />\n </div>\n </td>\n <DefaultCells<Data> {...props} />\n </tr>\n );\n}\n\nexport function DefaultRow<Data extends object = {}>({ onClick, row, enableDragNDrop, onDrop, onDrag, ...props }: DefaultRowProps<Data>) {\n const opts = {\n ...props,\n onClick: () => onClick(row.original, \"row\"),\n ...row.getRowProps()\n };\n\n if (enableDragNDrop) {\n return <DefaultDndRow<Data> {...opts} row={row} onDrag={onDrag} onDrop={onDrop} />;\n }\n\n return (\n <tr {...opts}>\n <DefaultCells<Data> row={row} />\n </tr>\n );\n}\n"],"names":["DefaultDndRow","props","isDragging","dragRef","dropRef","opacity","useDndRow","jsx","classnames","iconClass","DefaultCells","DefaultRow","onClick","row","enableDragNDrop","onDrop","onDrag","opts"],"mappings":";;;;;AAkBO,SAASA,EAAwCC,GAA8B;AACpF,QAAM,EAAE,YAAAC,GAAY,SAAAC,GAAS,SAAAC,GAAS,SAAAC,EAAQ,IAAIC,EAAUL,CAAK;AAEjE,2BACG,MAAG,EAAA,KAAKG,GAAS,OAAO,EAAE,SAAAC,EAEzB,GAAA,UAAA;AAAA,IAAA,gBAAAE,EAAC,MAAG,EAAA,KAAKJ,GAAS,MAAK,QAAO,OAAO,EAAE,QAAQD,IAAa,aAAa,OAAO,GAAG,WAAU,gBAC3F,UAAC,gBAAAK,EAAA,OAAA,EAAI,WAAU,oCACb,UAAC,gBAAAA,EAAA,KAAA,EAAE,WAAWC,EAAWC,EAAU,QAAW,uBAAuB,CAAC,EAAG,CAAA,EAC3E,CAAA,GACF;AAAA,IACA,gBAAAF,EAACG,GAAoB,EAAA,GAAGT,EAAO,CAAA;AAAA,EAAA,GACjC;AAEJ;AAEgB,SAAAU,EAAqC,EAAE,SAAAC,GAAS,KAAAC,GAAK,iBAAAC,GAAiB,QAAAC,GAAQ,QAAAC,GAAQ,GAAGf,KAAgC;AACvI,QAAMgB,IAAO;AAAA,IACX,GAAGhB;AAAA,IACH,SAAS,MAAMW,EAAQC,EAAI,UAAU,KAAK;AAAA,IAC1C,GAAGA,EAAI,YAAY;AAAA,EACrB;AAEA,SAAIC,sBACMd,GAAqB,EAAA,GAAGiB,GAAM,KAAAJ,GAAU,QAAAG,GAAgB,QAAAD,GAAgB,sBAI/E,MAAI,EAAA,GAAGE,GACN,UAAC,gBAAAV,EAAAG,GAAA,EAAmB,KAAAG,EAAU,CAAA,GAChC;AAEJ;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare function DrapNDropContainer({ enableDragNDrop, children }: PropsWithChildren<{
|
|
3
|
-
enableDragNDrop?: boolean;
|
|
4
|
-
}>):
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
export declare function DrapNDropContainer({ enableDragNDrop, children }: PropsWithChildren<{
|
|
3
|
+
enableDragNDrop?: boolean;
|
|
4
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as o, Fragment as t } from "react/jsx-runtime";
|
|
2
|
+
import { DndProvider as m } from "react-dnd";
|
|
3
|
+
import { HTML5Backend as e } from "react-dnd-html5-backend";
|
|
4
|
+
function f({ enableDragNDrop: n, children: r }) {
|
|
5
|
+
return n ? /* @__PURE__ */ o(m, { backend: e, children: r }) : /* @__PURE__ */ o(t, { children: r });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
f as DrapNDropContainer
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=dragNDropContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dragNDropContainer.js","sources":["../../../../src/components/table/components/dragNDropContainer.tsx"],"sourcesContent":["import { PropsWithChildren } from \"react\";\nimport { DndProvider } from \"react-dnd\";\nimport { HTML5Backend } from \"react-dnd-html5-backend\";\n\nexport function DrapNDropContainer({ enableDragNDrop, children }: PropsWithChildren<{ enableDragNDrop?: boolean }>) {\n return enableDragNDrop ? <DndProvider backend={HTML5Backend}>{children}</DndProvider> : <>{children}</>;\n}\n"],"names":["DrapNDropContainer","enableDragNDrop","children","DndProvider","HTML5Backend"],"mappings":";;;AAIO,SAASA,EAAmB,EAAE,iBAAAC,GAAiB,UAAAC,KAA8D;AAC3G,SAAAD,sBAAmBE,GAAY,EAAA,SAASC,GAAe,UAAAF,EAAS,CAAA,2BAAoB,UAAAA,EAAS,CAAA;AACtG;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}): React.JSX.Element;
|
|
1
|
+
import { FilterProps } from 'react-table';
|
|
2
|
+
export declare function DefaultColumnFilter<D extends Record<string, unknown> = {}>(props: FilterProps<D> & {
|
|
3
|
+
filterId: string;
|
|
4
|
+
setFilterId: any;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|