@deviceinsight/ng-ui-components 6.18.0 → 6.19.0
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/lib/cjs/__mocks__/i18n.d.ts +12 -4
- package/lib/cjs/__mocks__/i18n.d.ts.map +1 -1
- package/lib/cjs/__mocks__/i18n.js +20 -7
- package/lib/cjs/components/chart/Chart.d.ts +1 -1
- package/lib/cjs/components/colorpicker/ColorPickerPopper.d.ts +1 -1
- package/lib/cjs/components/colorpicker/GradientColorPicker.d.ts +2 -2
- package/lib/cjs/components/colorpicker/GridColorPicker.d.ts +2 -2
- package/lib/cjs/components/contentHeader/ContentHeader.d.ts +1 -1
- package/lib/cjs/components/contentHeader/ContentHeader.d.ts.map +1 -1
- package/lib/cjs/components/infobox/InfoBox.d.ts +1 -1
- package/lib/cjs/components/infobox/InfoBox.d.ts.map +1 -1
- package/lib/cjs/components/input/DateInput.d.ts +2 -2
- package/lib/cjs/components/input/DateInput.d.ts.map +1 -1
- package/lib/cjs/components/input/DateTimeInput.d.ts +2 -2
- package/lib/cjs/components/input/DateTimeInput.d.ts.map +1 -1
- package/lib/cjs/components/input/SelectWithSearch.d.ts +4 -1
- package/lib/cjs/components/input/SelectWithSearch.d.ts.map +1 -1
- package/lib/cjs/components/input/SelectWithSearch.js +25 -4
- package/lib/cjs/components/input/SelectWithSearchAsync.d.ts +1 -1
- package/lib/cjs/components/input/UrnInput.d.ts +1 -1
- package/lib/cjs/components/input/ValidatedTextInput.d.ts +1 -1
- package/lib/cjs/components/input/__tests__/DateInput.spec.js +24 -24
- package/lib/cjs/components/input/__tests__/DateTimeInput.spec.js +5 -4
- package/lib/cjs/components/input/__tests__/SelectWithSearchAsync.spec.js +12 -11
- package/lib/cjs/components/link/RouteLink.d.ts +2 -2
- package/lib/cjs/components/link/RouteLink.d.ts.map +1 -1
- package/lib/cjs/components/multiMenu/MultiMenu.d.ts +1 -1
- package/lib/cjs/components/multiMenu/components/MultiMenuItem.d.ts +1 -1
- package/lib/cjs/components/pagination/Pagination.d.ts +1 -1
- package/lib/cjs/components/pagination/__tests__/Pagination.spec.js +70 -70
- package/lib/cjs/components/periodpicker/PeriodPicker.d.ts +2 -2
- package/lib/cjs/components/periodpicker/PeriodPicker.d.ts.map +1 -1
- package/lib/cjs/components/periodpicker/components/Inputs.d.ts +2 -2
- package/lib/cjs/components/periodpicker/components/Inputs.d.ts.map +1 -1
- package/lib/cjs/components/periodpicker/components/Menu.d.ts +2 -2
- package/lib/cjs/components/periodpicker/components/Menu.d.ts.map +1 -1
- package/lib/cjs/components/periodpicker/components/MonthPicker.d.ts +2 -2
- package/lib/cjs/components/periodpicker/components/MonthPicker.d.ts.map +1 -1
- package/lib/cjs/components/periodpicker/usePeriodName.d.ts +1 -1
- package/lib/cjs/components/periodpicker/usePeriodName.d.ts.map +1 -1
- package/lib/cjs/components/periodpicker/usePeriodName.js +2 -2
- package/lib/cjs/components/prompt/Prompt.d.ts +2 -2
- package/lib/cjs/components/prompt/Prompt.d.ts.map +1 -1
- package/lib/cjs/components/reactable/Reactable.d.ts +1 -1
- package/lib/cjs/components/reactable/helpers/ReactableTable.d.ts +1 -1
- package/lib/cjs/components/reactable/helpers/ReactableTableHeader.d.ts +2 -2
- package/lib/cjs/components/reactable/helpers/ReactableTableHeader.d.ts.map +1 -1
- package/lib/cjs/components/reactable/helpers/ReactableTableRow.d.ts +1 -1
- package/lib/cjs/components/reactableWithClientSidePagination/ReactableWithClientSidePagination.d.ts +1 -1
- package/lib/cjs/components/reactableWithClientSidePagination/__tests__/ReactableWithClientSidePagination.spec.js +64 -72
- package/lib/cjs/components/slider/Slider.d.ts +2 -2
- package/lib/cjs/components/slider/Slider.d.ts.map +1 -1
- package/lib/cjs/components/svg/SvgImage.d.ts +2 -2
- package/lib/cjs/components/svg/SvgImage.d.ts.map +1 -1
- package/lib/cjs/components/svg/utils/__tests__/getMutableNodeList.spec.js +11 -10
- package/lib/cjs/components/tabs/RouteTabs.d.ts +1 -1
- package/lib/cjs/components/tabs/RouteTabs.d.ts.map +1 -1
- package/lib/cjs/components/tabs/RouteTabs.js +2 -2
- package/lib/cjs/components/treeview/TreeView.d.ts +1 -1
- package/lib/cjs/components/treeview/components/Node.d.ts +1 -1
- package/lib/cjs/components/treeview/components/NodeInfo.d.ts +1 -1
- package/lib/cjs/components/upload/FileUpload.d.ts +1 -1
- package/lib/cjs/components/upload/ImageUpload.d.ts +1 -1
- package/lib/cjs/modules/messageBox/messageBox.d.ts +2 -2
- package/lib/cjs/modules/messageBox/messageBox.d.ts.map +1 -1
- package/lib/esm/__mocks__/i18n.d.ts +12 -4
- package/lib/esm/__mocks__/i18n.d.ts.map +1 -1
- package/lib/esm/__mocks__/i18n.js +20 -5
- package/lib/esm/components/chart/Chart.d.ts +1 -1
- package/lib/esm/components/colorpicker/ColorPickerPopper.d.ts +1 -1
- package/lib/esm/components/colorpicker/GradientColorPicker.d.ts +2 -2
- package/lib/esm/components/colorpicker/GridColorPicker.d.ts +2 -2
- package/lib/esm/components/contentHeader/ContentHeader.d.ts +1 -1
- package/lib/esm/components/contentHeader/ContentHeader.d.ts.map +1 -1
- package/lib/esm/components/infobox/InfoBox.d.ts +1 -1
- package/lib/esm/components/infobox/InfoBox.d.ts.map +1 -1
- package/lib/esm/components/input/DateInput.d.ts +2 -2
- package/lib/esm/components/input/DateInput.d.ts.map +1 -1
- package/lib/esm/components/input/DateTimeInput.d.ts +2 -2
- package/lib/esm/components/input/DateTimeInput.d.ts.map +1 -1
- package/lib/esm/components/input/SelectWithSearch.d.ts +4 -1
- package/lib/esm/components/input/SelectWithSearch.d.ts.map +1 -1
- package/lib/esm/components/input/SelectWithSearch.js +25 -4
- package/lib/esm/components/input/SelectWithSearchAsync.d.ts +1 -1
- package/lib/esm/components/input/UrnInput.d.ts +1 -1
- package/lib/esm/components/input/ValidatedTextInput.d.ts +1 -1
- package/lib/esm/components/input/__tests__/DateInput.spec.js +4 -4
- package/lib/esm/components/input/__tests__/DateTimeInput.spec.js +1 -0
- package/lib/esm/components/input/__tests__/SelectWithSearchAsync.spec.js +3 -2
- package/lib/esm/components/link/RouteLink.d.ts +2 -2
- package/lib/esm/components/link/RouteLink.d.ts.map +1 -1
- package/lib/esm/components/multiMenu/MultiMenu.d.ts +1 -1
- package/lib/esm/components/multiMenu/components/MultiMenuItem.d.ts +1 -1
- package/lib/esm/components/pagination/Pagination.d.ts +1 -1
- package/lib/esm/components/pagination/__tests__/Pagination.spec.js +53 -53
- package/lib/esm/components/periodpicker/PeriodPicker.d.ts +2 -2
- package/lib/esm/components/periodpicker/PeriodPicker.d.ts.map +1 -1
- package/lib/esm/components/periodpicker/components/Inputs.d.ts +2 -2
- package/lib/esm/components/periodpicker/components/Inputs.d.ts.map +1 -1
- package/lib/esm/components/periodpicker/components/Menu.d.ts +2 -2
- package/lib/esm/components/periodpicker/components/Menu.d.ts.map +1 -1
- package/lib/esm/components/periodpicker/components/MonthPicker.d.ts +2 -2
- package/lib/esm/components/periodpicker/components/MonthPicker.d.ts.map +1 -1
- package/lib/esm/components/periodpicker/usePeriodName.d.ts +1 -1
- package/lib/esm/components/periodpicker/usePeriodName.d.ts.map +1 -1
- package/lib/esm/components/periodpicker/usePeriodName.js +1 -1
- package/lib/esm/components/prompt/Prompt.d.ts +2 -2
- package/lib/esm/components/prompt/Prompt.d.ts.map +1 -1
- package/lib/esm/components/reactable/Reactable.d.ts +1 -1
- package/lib/esm/components/reactable/helpers/ReactableTable.d.ts +1 -1
- package/lib/esm/components/reactable/helpers/ReactableTableHeader.d.ts +2 -2
- package/lib/esm/components/reactable/helpers/ReactableTableHeader.d.ts.map +1 -1
- package/lib/esm/components/reactable/helpers/ReactableTableRow.d.ts +1 -1
- package/lib/esm/components/reactableWithClientSidePagination/ReactableWithClientSidePagination.d.ts +1 -1
- package/lib/esm/components/reactableWithClientSidePagination/__tests__/ReactableWithClientSidePagination.spec.js +55 -63
- package/lib/esm/components/slider/Slider.d.ts +2 -2
- package/lib/esm/components/slider/Slider.d.ts.map +1 -1
- package/lib/esm/components/svg/SvgImage.d.ts +2 -2
- package/lib/esm/components/svg/SvgImage.d.ts.map +1 -1
- package/lib/esm/components/svg/utils/__tests__/getMutableNodeList.spec.js +1 -0
- package/lib/esm/components/tabs/RouteTabs.d.ts +1 -1
- package/lib/esm/components/tabs/RouteTabs.d.ts.map +1 -1
- package/lib/esm/components/tabs/RouteTabs.js +2 -2
- package/lib/esm/components/treeview/TreeView.d.ts +1 -1
- package/lib/esm/components/treeview/components/Node.d.ts +1 -1
- package/lib/esm/components/treeview/components/NodeInfo.d.ts +1 -1
- package/lib/esm/components/upload/FileUpload.d.ts +1 -1
- package/lib/esm/components/upload/ImageUpload.d.ts +1 -1
- package/lib/esm/modules/messageBox/messageBox.d.ts +2 -2
- package/lib/esm/modules/messageBox/messageBox.d.ts.map +1 -1
- package/lib/esm/src/__mocks__/i18n.d.ts +13 -0
- package/lib/esm/src/__mocks__/i18n.d.ts.map +1 -0
- package/lib/esm/src/__mocks__/i18n.js +20 -0
- package/lib/esm/src/components/chart/Chart.d.ts +38 -0
- package/lib/esm/src/components/chart/Chart.d.ts.map +1 -0
- package/lib/esm/src/components/chart/Chart.js +202 -0
- package/lib/esm/src/components/colorpicker/ColorPickerPopper.d.ts +24 -0
- package/lib/esm/src/components/colorpicker/ColorPickerPopper.d.ts.map +1 -0
- package/lib/esm/src/components/colorpicker/ColorPickerPopper.js +46 -0
- package/lib/esm/src/components/colorpicker/GradientColorPicker.d.ts +63 -0
- package/lib/esm/src/components/colorpicker/GradientColorPicker.d.ts.map +1 -0
- package/lib/esm/src/components/colorpicker/GradientColorPicker.js +125 -0
- package/lib/esm/src/components/colorpicker/GridColorPicker.d.ts +41 -0
- package/lib/esm/src/components/colorpicker/GridColorPicker.d.ts.map +1 -0
- package/lib/esm/src/components/colorpicker/GridColorPicker.js +30 -0
- package/lib/esm/src/components/contentHeader/ContentHeader.d.ts +25 -0
- package/lib/esm/src/components/contentHeader/ContentHeader.d.ts.map +1 -0
- package/lib/esm/src/components/contentHeader/ContentHeader.js +53 -0
- package/lib/esm/src/components/infobox/InfoBox.d.ts +22 -0
- package/lib/esm/src/components/infobox/InfoBox.d.ts.map +1 -0
- package/lib/esm/src/components/infobox/InfoBox.js +36 -0
- package/lib/esm/src/components/input/DateInput.d.ts +28 -0
- package/lib/esm/src/components/input/DateInput.d.ts.map +1 -0
- package/lib/esm/src/components/input/DateInput.js +157 -0
- package/lib/esm/src/components/input/DateTimeInput.d.ts +27 -0
- package/lib/esm/src/components/input/DateTimeInput.d.ts.map +1 -0
- package/lib/esm/src/components/input/DateTimeInput.js +50 -0
- package/lib/esm/src/components/input/SelectWithSearch.d.ts +65 -0
- package/lib/esm/src/components/input/SelectWithSearch.d.ts.map +1 -0
- package/lib/esm/src/components/input/SelectWithSearch.js +111 -0
- package/lib/esm/src/components/input/SelectWithSearchAsync.d.ts +58 -0
- package/lib/esm/src/components/input/SelectWithSearchAsync.d.ts.map +1 -0
- package/lib/esm/src/components/input/SelectWithSearchAsync.js +100 -0
- package/lib/esm/src/components/input/UrnInput.d.ts +22 -0
- package/lib/esm/src/components/input/UrnInput.d.ts.map +1 -0
- package/lib/esm/src/components/input/UrnInput.js +33 -0
- package/lib/esm/src/components/input/ValidatedTextInput.d.ts +35 -0
- package/lib/esm/src/components/input/ValidatedTextInput.d.ts.map +1 -0
- package/lib/esm/src/components/input/ValidatedTextInput.js +30 -0
- package/lib/esm/src/components/input/__tests__/DateInput.spec.d.ts +2 -0
- package/lib/esm/src/components/input/__tests__/DateInput.spec.d.ts.map +1 -0
- package/lib/esm/src/components/input/__tests__/DateInput.spec.js +85 -0
- package/lib/esm/src/components/input/__tests__/DateTimeInput.spec.d.ts +2 -0
- package/lib/esm/src/components/input/__tests__/DateTimeInput.spec.d.ts.map +1 -0
- package/lib/esm/src/components/input/__tests__/DateTimeInput.spec.js +13 -0
- package/lib/esm/src/components/input/__tests__/SelectWithSearchAsync.spec.d.ts +2 -0
- package/lib/esm/src/components/input/__tests__/SelectWithSearchAsync.spec.d.ts.map +1 -0
- package/lib/esm/src/components/input/__tests__/SelectWithSearchAsync.spec.js +44 -0
- package/lib/esm/src/components/link/RouteLink.d.ts +31 -0
- package/lib/esm/src/components/link/RouteLink.d.ts.map +1 -0
- package/lib/esm/src/components/link/RouteLink.js +55 -0
- package/lib/esm/src/components/multiMenu/MultiMenu.d.ts +27 -0
- package/lib/esm/src/components/multiMenu/MultiMenu.d.ts.map +1 -0
- package/lib/esm/src/components/multiMenu/MultiMenu.js +30 -0
- package/lib/esm/src/components/multiMenu/components/MultiMenuContext.d.ts +7 -0
- package/lib/esm/src/components/multiMenu/components/MultiMenuContext.d.ts.map +1 -0
- package/lib/esm/src/components/multiMenu/components/MultiMenuContext.js +5 -0
- package/lib/esm/src/components/multiMenu/components/MultiMenuItem.d.ts +14 -0
- package/lib/esm/src/components/multiMenu/components/MultiMenuItem.d.ts.map +1 -0
- package/lib/esm/src/components/multiMenu/components/MultiMenuItem.js +24 -0
- package/lib/esm/src/components/pagination/Pagination.d.ts +37 -0
- package/lib/esm/src/components/pagination/Pagination.d.ts.map +1 -0
- package/lib/esm/src/components/pagination/Pagination.js +114 -0
- package/lib/esm/src/components/pagination/__tests__/Pagination.spec.d.ts +2 -0
- package/lib/esm/src/components/pagination/__tests__/Pagination.spec.d.ts.map +1 -0
- package/lib/esm/src/components/pagination/__tests__/Pagination.spec.js +87 -0
- package/lib/esm/src/components/periodpicker/PeriodPicker.d.ts +23 -0
- package/lib/esm/src/components/periodpicker/PeriodPicker.d.ts.map +1 -0
- package/lib/esm/src/components/periodpicker/PeriodPicker.js +11 -0
- package/lib/esm/src/components/periodpicker/components/Inputs.d.ts +12 -0
- package/lib/esm/src/components/periodpicker/components/Inputs.d.ts.map +1 -0
- package/lib/esm/src/components/periodpicker/components/Inputs.js +59 -0
- package/lib/esm/src/components/periodpicker/components/Menu.d.ts +11 -0
- package/lib/esm/src/components/periodpicker/components/Menu.d.ts.map +1 -0
- package/lib/esm/src/components/periodpicker/components/Menu.js +96 -0
- package/lib/esm/src/components/periodpicker/components/MonthPicker.d.ts +19 -0
- package/lib/esm/src/components/periodpicker/components/MonthPicker.d.ts.map +1 -0
- package/lib/esm/src/components/periodpicker/components/MonthPicker.js +62 -0
- package/lib/esm/src/components/periodpicker/periods.d.ts +33 -0
- package/lib/esm/src/components/periodpicker/periods.d.ts.map +1 -0
- package/lib/esm/src/components/periodpicker/periods.js +56 -0
- package/lib/esm/src/components/periodpicker/types.d.ts +5 -0
- package/lib/esm/src/components/periodpicker/types.d.ts.map +1 -0
- package/lib/esm/src/components/periodpicker/types.js +1 -0
- package/lib/esm/src/components/periodpicker/usePeriodName.d.ts +7 -0
- package/lib/esm/src/components/periodpicker/usePeriodName.d.ts.map +1 -0
- package/lib/esm/src/components/periodpicker/usePeriodName.js +38 -0
- package/lib/esm/src/components/prompt/Prompt.d.ts +23 -0
- package/lib/esm/src/components/prompt/Prompt.d.ts.map +1 -0
- package/lib/esm/src/components/prompt/Prompt.js +31 -0
- package/lib/esm/src/components/prompt/withPrompt.d.ts +7 -0
- package/lib/esm/src/components/prompt/withPrompt.d.ts.map +1 -0
- package/lib/esm/src/components/prompt/withPrompt.js +33 -0
- package/lib/esm/src/components/reactable/Reactable.d.ts +38 -0
- package/lib/esm/src/components/reactable/Reactable.d.ts.map +1 -0
- package/lib/esm/src/components/reactable/Reactable.js +18 -0
- package/lib/esm/src/components/reactable/helpers/ReactableTable.d.ts +21 -0
- package/lib/esm/src/components/reactable/helpers/ReactableTable.d.ts.map +1 -0
- package/lib/esm/src/components/reactable/helpers/ReactableTable.js +33 -0
- package/lib/esm/src/components/reactable/helpers/ReactableTableFilterRow.d.ts +9 -0
- package/lib/esm/src/components/reactable/helpers/ReactableTableFilterRow.d.ts.map +1 -0
- package/lib/esm/src/components/reactable/helpers/ReactableTableFilterRow.js +57 -0
- package/lib/esm/src/components/reactable/helpers/ReactableTableHeader.d.ts +16 -0
- package/lib/esm/src/components/reactable/helpers/ReactableTableHeader.d.ts.map +1 -0
- package/lib/esm/src/components/reactable/helpers/ReactableTableHeader.js +52 -0
- package/lib/esm/src/components/reactable/helpers/ReactableTableRow.d.ts +16 -0
- package/lib/esm/src/components/reactable/helpers/ReactableTableRow.d.ts.map +1 -0
- package/lib/esm/src/components/reactable/helpers/ReactableTableRow.js +56 -0
- package/lib/esm/src/components/reactable/helpers/ReactableTextFilter.d.ts +9 -0
- package/lib/esm/src/components/reactable/helpers/ReactableTextFilter.d.ts.map +1 -0
- package/lib/esm/src/components/reactable/helpers/ReactableTextFilter.js +18 -0
- package/lib/esm/src/components/reactable/helpers/helper.d.ts +7 -0
- package/lib/esm/src/components/reactable/helpers/helper.d.ts.map +1 -0
- package/lib/esm/src/components/reactable/helpers/helper.js +90 -0
- package/lib/esm/src/components/reactable/types.d.ts +38 -0
- package/lib/esm/src/components/reactable/types.d.ts.map +1 -0
- package/lib/esm/src/components/reactable/types.js +1 -0
- package/lib/esm/src/components/reactableWithClientSidePagination/ReactableWithClientSidePagination.d.ts +69 -0
- package/lib/esm/src/components/reactableWithClientSidePagination/ReactableWithClientSidePagination.d.ts.map +1 -0
- package/lib/esm/src/components/reactableWithClientSidePagination/ReactableWithClientSidePagination.js +155 -0
- package/lib/esm/src/components/reactableWithClientSidePagination/__tests__/ReactableWithClientSidePagination.spec.d.ts +2 -0
- package/lib/esm/src/components/reactableWithClientSidePagination/__tests__/ReactableWithClientSidePagination.spec.d.ts.map +1 -0
- package/lib/esm/src/components/reactableWithClientSidePagination/__tests__/ReactableWithClientSidePagination.spec.js +130 -0
- package/lib/esm/src/components/slider/Slider.d.ts +30 -0
- package/lib/esm/src/components/slider/Slider.d.ts.map +1 -0
- package/lib/esm/src/components/slider/Slider.js +35 -0
- package/lib/esm/src/components/slider/useLimitStyling.d.ts +3 -0
- package/lib/esm/src/components/slider/useLimitStyling.d.ts.map +1 -0
- package/lib/esm/src/components/slider/useLimitStyling.js +49 -0
- package/lib/esm/src/components/svg/SvgImage.d.ts +12 -0
- package/lib/esm/src/components/svg/SvgImage.d.ts.map +1 -0
- package/lib/esm/src/components/svg/SvgImage.js +37 -0
- package/lib/esm/src/components/svg/storybookHelper.d.ts +7 -0
- package/lib/esm/src/components/svg/storybookHelper.d.ts.map +1 -0
- package/lib/esm/src/components/svg/storybookHelper.js +53 -0
- package/lib/esm/src/components/svg/types.d.ts +58 -0
- package/lib/esm/src/components/svg/types.d.ts.map +1 -0
- package/lib/esm/src/components/svg/types.js +1 -0
- package/lib/esm/src/components/svg/utils/__tests__/getMutableNodeList.spec.d.ts +2 -0
- package/lib/esm/src/components/svg/utils/__tests__/getMutableNodeList.spec.d.ts.map +1 -0
- package/lib/esm/src/components/svg/utils/__tests__/getMutableNodeList.spec.js +24 -0
- package/lib/esm/src/components/svg/utils/createHyperlinkModification.d.ts +4 -0
- package/lib/esm/src/components/svg/utils/createHyperlinkModification.d.ts.map +1 -0
- package/lib/esm/src/components/svg/utils/createHyperlinkModification.js +35 -0
- package/lib/esm/src/components/svg/utils/createPositionModification.d.ts +3 -0
- package/lib/esm/src/components/svg/utils/createPositionModification.d.ts.map +1 -0
- package/lib/esm/src/components/svg/utils/createPositionModification.js +19 -0
- package/lib/esm/src/components/svg/utils/findConflicts.d.ts +2 -0
- package/lib/esm/src/components/svg/utils/findConflicts.d.ts.map +1 -0
- package/lib/esm/src/components/svg/utils/findConflicts.js +23 -0
- package/lib/esm/src/components/svg/utils/getMutableNodeList.d.ts +3 -0
- package/lib/esm/src/components/svg/utils/getMutableNodeList.d.ts.map +1 -0
- package/lib/esm/src/components/svg/utils/getMutableNodeList.js +12 -0
- package/lib/esm/src/components/svg/utils/getSvgElement.d.ts +3 -0
- package/lib/esm/src/components/svg/utils/getSvgElement.d.ts.map +1 -0
- package/lib/esm/src/components/svg/utils/getSvgElement.js +10 -0
- package/lib/esm/src/components/svg/utils/renderSvg.d.ts +3 -0
- package/lib/esm/src/components/svg/utils/renderSvg.d.ts.map +1 -0
- package/lib/esm/src/components/svg/utils/renderSvg.js +88 -0
- package/lib/esm/src/components/svg/utils/transformPositionModifications.d.ts +4 -0
- package/lib/esm/src/components/svg/utils/transformPositionModifications.d.ts.map +1 -0
- package/lib/esm/src/components/svg/utils/transformPositionModifications.js +42 -0
- package/lib/esm/src/components/svg/utils/validateSvg.d.ts +3 -0
- package/lib/esm/src/components/svg/utils/validateSvg.d.ts.map +1 -0
- package/lib/esm/src/components/svg/utils/validateSvg.js +5 -0
- package/lib/esm/src/components/tabs/RouteTabs.d.ts +24 -0
- package/lib/esm/src/components/tabs/RouteTabs.d.ts.map +1 -0
- package/lib/esm/src/components/tabs/RouteTabs.js +67 -0
- package/lib/esm/src/components/treeview/TreeView.d.ts +50 -0
- package/lib/esm/src/components/treeview/TreeView.d.ts.map +1 -0
- package/lib/esm/src/components/treeview/TreeView.js +104 -0
- package/lib/esm/src/components/treeview/components/Node.d.ts +37 -0
- package/lib/esm/src/components/treeview/components/Node.d.ts.map +1 -0
- package/lib/esm/src/components/treeview/components/Node.js +111 -0
- package/lib/esm/src/components/treeview/components/NodeInfo.d.ts +25 -0
- package/lib/esm/src/components/treeview/components/NodeInfo.d.ts.map +1 -0
- package/lib/esm/src/components/treeview/components/NodeInfo.js +64 -0
- package/lib/esm/src/components/treeview/constants.d.ts +6 -0
- package/lib/esm/src/components/treeview/constants.d.ts.map +1 -0
- package/lib/esm/src/components/treeview/constants.js +6 -0
- package/lib/esm/src/components/treeview/treeutils.d.ts +59 -0
- package/lib/esm/src/components/treeview/treeutils.d.ts.map +1 -0
- package/lib/esm/src/components/treeview/treeutils.js +158 -0
- package/lib/esm/src/components/treeview/types.d.ts +37 -0
- package/lib/esm/src/components/treeview/types.d.ts.map +1 -0
- package/lib/esm/src/components/treeview/types.js +1 -0
- package/lib/esm/src/components/upload/FileUpload.d.ts +67 -0
- package/lib/esm/src/components/upload/FileUpload.d.ts.map +1 -0
- package/lib/esm/src/components/upload/FileUpload.js +95 -0
- package/lib/esm/src/components/upload/ImageUpload.d.ts +21 -0
- package/lib/esm/src/components/upload/ImageUpload.d.ts.map +1 -0
- package/lib/esm/src/components/upload/ImageUpload.js +45 -0
- package/lib/esm/src/hoc/outsideClick.d.ts +4 -0
- package/lib/esm/src/hoc/outsideClick.d.ts.map +1 -0
- package/lib/esm/src/hoc/outsideClick.js +73 -0
- package/lib/esm/src/i18n/index.d.ts +16 -0
- package/lib/esm/src/i18n/index.d.ts.map +1 -0
- package/lib/esm/src/i18n/index.js +6 -0
- package/lib/esm/src/index.d.ts +52 -0
- package/lib/esm/src/index.d.ts.map +1 -0
- package/lib/esm/src/index.js +39 -0
- package/lib/esm/src/modules/messageBox/messageBox.d.ts +14 -0
- package/lib/esm/src/modules/messageBox/messageBox.d.ts.map +1 -0
- package/lib/esm/src/modules/messageBox/messageBox.js +56 -0
- package/lib/esm/src/modules/utils/nanoidGen.d.ts +2 -0
- package/lib/esm/src/modules/utils/nanoidGen.d.ts.map +1 -0
- package/lib/esm/src/modules/utils/nanoidGen.js +3 -0
- package/lib/esm/src/modules/utils/uuidGen.d.ts +2 -0
- package/lib/esm/src/modules/utils/uuidGen.d.ts.map +1 -0
- package/lib/esm/src/modules/utils/uuidGen.js +13 -0
- package/lib/esm/src/types/i18n.d.ts +5 -0
- package/lib/esm/src/types/i18n.d.ts.map +1 -0
- package/lib/esm/src/types/i18n.js +1 -0
- package/lib/esm/src/types/pagination.d.ts +19 -0
- package/lib/esm/src/types/pagination.d.ts.map +1 -0
- package/lib/esm/src/types/pagination.js +1 -0
- package/lib/esm/src/utils/dayjsLocales.d.ts +10 -0
- package/lib/esm/src/utils/dayjsLocales.d.ts.map +1 -0
- package/lib/esm/src/utils/dayjsLocales.js +12 -0
- package/lib/esm/src/utils/resolvePath.d.ts +2 -0
- package/lib/esm/src/utils/resolvePath.d.ts.map +1 -0
- package/lib/esm/src/utils/resolvePath.js +4 -0
- package/lib/esm/vite.config.d.mts +3 -0
- package/lib/esm/vite.config.d.mts.map +1 -0
- package/lib/esm/vite.config.mjs +9 -0
- package/lib/esm/vitest.setup.d.ts +3 -0
- package/lib/esm/vitest.setup.d.ts.map +1 -0
- package/lib/esm/vitest.setup.js +10 -0
- package/package.json +24 -54
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import { Period } from './types';
|
|
3
|
+
export declare function dayjsTz(timezone: string | undefined, ts?: number | null | undefined): dayjs.Dayjs;
|
|
4
|
+
export declare function createToday(timezone: string | undefined): {
|
|
5
|
+
tsStart: number;
|
|
6
|
+
tsEnd: number;
|
|
7
|
+
};
|
|
8
|
+
export declare function createYesterday(timezone: string | undefined): {
|
|
9
|
+
tsStart: number;
|
|
10
|
+
tsEnd: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function createCurrentWeek(timezone: string | undefined): {
|
|
13
|
+
tsStart: number;
|
|
14
|
+
tsEnd: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function createCurrentMonth(timezone: string | undefined): {
|
|
17
|
+
tsStart: number;
|
|
18
|
+
tsEnd: number;
|
|
19
|
+
};
|
|
20
|
+
export declare function createWholeDay(tsMiddle: number, timezone: string | undefined): {
|
|
21
|
+
tsStart: number;
|
|
22
|
+
tsEnd: number;
|
|
23
|
+
};
|
|
24
|
+
export declare function createWholeMonth(tsMiddle: number, timezone: string | undefined): {
|
|
25
|
+
tsStart: number;
|
|
26
|
+
tsEnd: number;
|
|
27
|
+
};
|
|
28
|
+
export declare function createLastXDays(days: number, timezone: string | undefined): {
|
|
29
|
+
tsStart: number;
|
|
30
|
+
tsEnd: number;
|
|
31
|
+
};
|
|
32
|
+
export declare function periodToDays({ tsStart, tsEnd }: Period): number;
|
|
33
|
+
//# sourceMappingURL=periods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"periods.d.ts","sourceRoot":"","sources":["../../../../../src/components/periodpicker/periods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,MAAM,EAAC,MAAM,SAAS,CAAC;AAK/B,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,eAEnF;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS;;;EAKvD;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS;;;EAK3D;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS;;;EAK7D;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS;;;EAK9D;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS;;;EAK5E;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS;;;EAK9E;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS;;;EAQzE;AAID,wBAAgB,YAAY,CAAC,EAAC,OAAO,EAAE,KAAK,EAAC,EAAE,MAAM,GAAG,MAAM,CAE7D"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import timezone from 'dayjs/plugin/timezone';
|
|
3
|
+
import utc from 'dayjs/plugin/utc';
|
|
4
|
+
dayjs.extend(timezone);
|
|
5
|
+
dayjs.extend(utc);
|
|
6
|
+
export function dayjsTz(timezone, ts) {
|
|
7
|
+
return timezone ? dayjs.tz(ts, timezone) : dayjs(ts);
|
|
8
|
+
}
|
|
9
|
+
export function createToday(timezone) {
|
|
10
|
+
return {
|
|
11
|
+
tsStart: dayjsTz(timezone).startOf('day').valueOf(),
|
|
12
|
+
tsEnd: dayjsTz(timezone).endOf('day').valueOf()
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function createYesterday(timezone) {
|
|
16
|
+
return {
|
|
17
|
+
tsStart: dayjsTz(timezone).subtract(1, 'day').startOf('day').valueOf(),
|
|
18
|
+
tsEnd: dayjsTz(timezone).subtract(1, 'day').endOf('day').valueOf()
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function createCurrentWeek(timezone) {
|
|
22
|
+
return {
|
|
23
|
+
tsStart: dayjsTz(timezone).startOf('week').valueOf(),
|
|
24
|
+
tsEnd: dayjsTz(timezone).endOf('week').valueOf()
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export function createCurrentMonth(timezone) {
|
|
28
|
+
return {
|
|
29
|
+
tsStart: dayjsTz(timezone).startOf('month').valueOf(),
|
|
30
|
+
tsEnd: dayjsTz(timezone).endOf('month').valueOf()
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export function createWholeDay(tsMiddle, timezone) {
|
|
34
|
+
return {
|
|
35
|
+
tsStart: dayjsTz(timezone, tsMiddle).startOf('day').valueOf(),
|
|
36
|
+
tsEnd: dayjsTz(timezone, tsMiddle).endOf('day').valueOf()
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export function createWholeMonth(tsMiddle, timezone) {
|
|
40
|
+
return {
|
|
41
|
+
tsStart: dayjsTz(timezone, tsMiddle).startOf('month').valueOf(),
|
|
42
|
+
tsEnd: dayjsTz(timezone, tsMiddle).endOf('month').valueOf()
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export function createLastXDays(days, timezone) {
|
|
46
|
+
const tsStart = dayjsTz(timezone)
|
|
47
|
+
.subtract(days - 1, 'days')
|
|
48
|
+
.startOf('day')
|
|
49
|
+
.valueOf();
|
|
50
|
+
const tsEnd = dayjs().endOf('day').valueOf();
|
|
51
|
+
return { tsStart, tsEnd };
|
|
52
|
+
}
|
|
53
|
+
const DAY_TO_MILLIS = 1000 * 60 * 60 * 24;
|
|
54
|
+
export function periodToDays({ tsStart, tsEnd }) {
|
|
55
|
+
return Math.round((tsEnd - tsStart + 1) / DAY_TO_MILLIS);
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/periodpicker/types.ts"],"names":[],"mappings":"AAAA,oBAAY,MAAM,GAAG;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Period } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* This hook takes a period and tries to find its translation.
|
|
4
|
+
* @param period
|
|
5
|
+
*/
|
|
6
|
+
export default function usePeriodName(period: Period, timezone: string | undefined): string | undefined;
|
|
7
|
+
//# sourceMappingURL=usePeriodName.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePeriodName.d.ts","sourceRoot":"","sources":["../../../../../src/components/periodpicker/usePeriodName.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,MAAM,EAAC,MAAM,SAAS,CAAC;AAgB/B;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,sBAoCjF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useTranslation } from '../../i18n';
|
|
2
|
+
import { createCurrentMonth, createCurrentWeek, createLastXDays, createToday, createWholeDay, createWholeMonth, createYesterday, periodToDays } from './periods';
|
|
3
|
+
function compare(period1, period2) {
|
|
4
|
+
return period1.tsStart === period2.tsStart && period1.tsEnd === period2.tsEnd;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* This hook takes a period and tries to find its translation.
|
|
8
|
+
* @param period
|
|
9
|
+
*/
|
|
10
|
+
export default function usePeriodName(period, timezone) {
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
if (compare(period, createToday(timezone))) {
|
|
13
|
+
return t('trend.calendarMenu.timePeriod.today', { defaultValue: 'Today' });
|
|
14
|
+
}
|
|
15
|
+
if (compare(period, createYesterday(timezone))) {
|
|
16
|
+
return t('trend.calendarMenu.timePeriod.yesterday', { defaultValue: 'Yesterday' });
|
|
17
|
+
}
|
|
18
|
+
if (compare(period, createCurrentWeek(timezone))) {
|
|
19
|
+
return t('trend.calendarMenu.timePeriod.currentWeek', { defaultValue: 'Curr. Week' });
|
|
20
|
+
}
|
|
21
|
+
if (compare(period, createCurrentMonth(timezone))) {
|
|
22
|
+
return t('trend.calendarMenu.timePeriod.currentMonth', { defaultValue: 'Curr. Month' });
|
|
23
|
+
}
|
|
24
|
+
if (compare(period, createWholeDay((period.tsStart + period.tsEnd) / 2, timezone))) {
|
|
25
|
+
return t('trend.calendarMenu.timePeriod.day', { defaultValue: 'Day' });
|
|
26
|
+
}
|
|
27
|
+
if (compare(period, createWholeMonth((period.tsStart + period.tsEnd) / 2, timezone))) {
|
|
28
|
+
return t('trend.calendarMenu.timePeriod.month', { defaultValue: 'Month' });
|
|
29
|
+
}
|
|
30
|
+
const days = periodToDays(period);
|
|
31
|
+
if (compare(period, createLastXDays(days, timezone))) {
|
|
32
|
+
return t('trend.calendarMenu.timePeriod.lastDays', {
|
|
33
|
+
defaultValue: `Last ${days} days`,
|
|
34
|
+
days: days
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TranslationDescriptor } from '../../types/i18n';
|
|
3
|
+
export declare type Props = {
|
|
4
|
+
/** Title of the Prompt's content */
|
|
5
|
+
title: TranslationDescriptor;
|
|
6
|
+
/** Label of the Prompt's input field */
|
|
7
|
+
message: TranslationDescriptor;
|
|
8
|
+
/** @ignore */
|
|
9
|
+
onAccept: (arg0: string) => void;
|
|
10
|
+
/** @ignore */
|
|
11
|
+
onCancel: (...args: Array<any>) => any;
|
|
12
|
+
/** (Optional) if sets, returns custom label for the accept button */
|
|
13
|
+
acceptButtonLabel?: TranslationDescriptor;
|
|
14
|
+
/** (Optional) if sets, returns custom label for the cancel button */
|
|
15
|
+
cancelButtonLabel?: TranslationDescriptor;
|
|
16
|
+
/** (Optional) if sets, returns custom placeholder for the input field */
|
|
17
|
+
inputPlaceholder?: TranslationDescriptor;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* This component should not be used directly, instead use `@withPrompt` to inject a promise-based prompt method
|
|
21
|
+
*/
|
|
22
|
+
export default function Prompt({ title, message, onAccept, onCancel, inputPlaceholder, cancelButtonLabel, acceptButtonLabel }: Props): React.JSX.Element;
|
|
23
|
+
//# sourceMappingURL=Prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Prompt.d.ts","sourceRoot":"","sources":["../../../../../src/components/prompt/Prompt.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAKzD,OAAO,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAEvD,oBAAY,KAAK,GAAG;IACnB,oCAAoC;IACpC,KAAK,EAAE,qBAAqB,CAAC;IAE7B,wCAAwC;IACxC,OAAO,EAAE,qBAAqB,CAAC;IAE/B,cAAc;IACd,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAEjC,cAAc;IACd,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC;IAEvC,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;IAE1C,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;IAE1C,yEAAyE;IACzE,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC9B,KAAK,EACL,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,EAAE,KAAK,qBAiEP"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { Trans, useTranslation } from '../../i18n';
|
|
3
|
+
import { Button, Modal } from '@deviceinsight/ng-ui-basic-components';
|
|
4
|
+
/**
|
|
5
|
+
* This component should not be used directly, instead use `@withPrompt` to inject a promise-based prompt method
|
|
6
|
+
*/
|
|
7
|
+
export default function Prompt({ title, message, onAccept, onCancel, inputPlaceholder, cancelButtonLabel, acceptButtonLabel }) {
|
|
8
|
+
const { t } = useTranslation();
|
|
9
|
+
const inputRef = useRef(null);
|
|
10
|
+
const [value, setValue] = useState('');
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
inputRef.current?.focus();
|
|
13
|
+
});
|
|
14
|
+
return (React.createElement(Modal, { header: t(title.id, {
|
|
15
|
+
defaultValue: title.defaultValue
|
|
16
|
+
}), content: React.createElement("div", { className: "di form" },
|
|
17
|
+
React.createElement("div", { className: "field" },
|
|
18
|
+
React.createElement("label", null,
|
|
19
|
+
React.createElement(Trans, { i18nKey: message.id }, message.defaultValue)),
|
|
20
|
+
React.createElement("input", { type: "text", style: {
|
|
21
|
+
width: 250
|
|
22
|
+
}, ref: inputRef, placeholder: inputPlaceholder
|
|
23
|
+
? t(inputPlaceholder.id, {
|
|
24
|
+
defaultValue: inputPlaceholder.defaultValue
|
|
25
|
+
})
|
|
26
|
+
: undefined, onChange: (event) => setValue(event.target.value) }))), footer: React.createElement("div", null,
|
|
27
|
+
React.createElement(Button, { primary: true, onClick: () => {
|
|
28
|
+
onAccept(value);
|
|
29
|
+
}, disabled: !value.length }, acceptButtonLabel ? (React.createElement(Trans, { i18nKey: acceptButtonLabel.id }, acceptButtonLabel.defaultValue)) : (React.createElement(Trans, { i18nKey: "form.accept" }, "Accept"))),
|
|
30
|
+
React.createElement(Button, { onClick: onCancel }, cancelButtonLabel ? (React.createElement(Trans, { i18nKey: cancelButtonLabel.id }, cancelButtonLabel.defaultValue)) : (React.createElement(Trans, { i18nKey: "form.cancel" }, "Cancel")))), width: 600 }));
|
|
31
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TranslationDescriptor } from '../../types/i18n';
|
|
3
|
+
export declare type PromptProps = {
|
|
4
|
+
prompt: (title: TranslationDescriptor, message: TranslationDescriptor, inputPlaceholder?: TranslationDescriptor, acceptButtonLabel?: TranslationDescriptor, cancelButtonLabel?: TranslationDescriptor) => Promise<string>;
|
|
5
|
+
};
|
|
6
|
+
export default function withPrompt<P>(WrappedComponent: React.ComponentType<P & PromptProps>): React.ComponentType<P>;
|
|
7
|
+
//# sourceMappingURL=withPrompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withPrompt.d.ts","sourceRoot":"","sources":["../../../../../src/components/prompt/withPrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAGvD,oBAAY,WAAW,GAAG;IACzB,MAAM,EAAE,CACP,KAAK,EAAE,qBAAqB,EAC5B,OAAO,EAAE,qBAAqB,EAC9B,gBAAgB,CAAC,EAAE,qBAAqB,EACxC,iBAAiB,CAAC,EAAE,qBAAqB,EACzC,iBAAiB,CAAC,EAAE,qBAAqB,KACrC,OAAO,CAAC,MAAM,CAAC,CAAC;CACrB,CAAC;AAOF,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,EAAE,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,WAAW,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CA8CpH"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Prompt from './Prompt';
|
|
3
|
+
export default function withPrompt(WrappedComponent) {
|
|
4
|
+
return class WithPromptWrapper extends React.Component {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.state = {
|
|
8
|
+
show: false
|
|
9
|
+
};
|
|
10
|
+
this.prompt = (title, message, inputPlaceholder, acceptButtonLabel, cancelButtonLabel) => new Promise((resolve) => {
|
|
11
|
+
this.setState({
|
|
12
|
+
show: true,
|
|
13
|
+
promptElement: (React.createElement(Prompt, { title: title, message: message, onAccept: (value) => {
|
|
14
|
+
this.setState({
|
|
15
|
+
show: false
|
|
16
|
+
});
|
|
17
|
+
resolve(value);
|
|
18
|
+
}, onCancel: () => {
|
|
19
|
+
this.setState({
|
|
20
|
+
show: false
|
|
21
|
+
});
|
|
22
|
+
}, inputPlaceholder: inputPlaceholder, acceptButtonLabel: acceptButtonLabel, cancelButtonLabel: cancelButtonLabel, key: "1" }))
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
return [
|
|
28
|
+
React.createElement(WrappedComponent, { ...this.props, prompt: this.prompt, key: "0" }),
|
|
29
|
+
this.state.show ? this.state.promptElement : null
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactableColumnDef, ReactableRowDef, ReactableFilterSettings } from './types';
|
|
3
|
+
import { Pageable, PaginationSettings, SortDirection } from '../../types/pagination';
|
|
4
|
+
export declare type Props<T, ID extends string | number | undefined | null = any> = {
|
|
5
|
+
/** Array of column definitions, each column can be configured independently */
|
|
6
|
+
columnDefs: Array<ReactableColumnDef<T>>;
|
|
7
|
+
/** Function, sets identifier for each element in Reactable */
|
|
8
|
+
uniqueItemKey: (item: T) => ID;
|
|
9
|
+
/** Settings for paginated content */
|
|
10
|
+
paginationSettings: PaginationSettings;
|
|
11
|
+
/** Function, executed if the current page changes */
|
|
12
|
+
onChangePage: (page: number) => void;
|
|
13
|
+
/** Function, executed if sorting changes */
|
|
14
|
+
onSort: (property: string, direction: SortDirection) => void;
|
|
15
|
+
/** (Optional) function, executed if the page size changes */
|
|
16
|
+
onChangeSize?: (size: number) => void;
|
|
17
|
+
/** (Optional) function, executed if the Reactable gets filtered */
|
|
18
|
+
onFilter?: (filterSettings: ReactableFilterSettings) => void;
|
|
19
|
+
/** Content, totalElements, totalPages, number, size, sort */
|
|
20
|
+
pageable: Pageable<T> | null | undefined;
|
|
21
|
+
/** (Optional) can set custom event handler and/or functions in general */
|
|
22
|
+
rowDef?: ReactableRowDef<T>;
|
|
23
|
+
/** It true, shows loading indicator */
|
|
24
|
+
isLoading: boolean;
|
|
25
|
+
/** (Optional) if true, makes rows clickable */
|
|
26
|
+
clickable?: boolean;
|
|
27
|
+
/** (Optional) shown message when the table is empty */
|
|
28
|
+
messageWhenEmpty?: string;
|
|
29
|
+
'data-testid'?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Reactable displays paginated results nicely, while adding the possibility to add further functionality to each row.
|
|
33
|
+
* Each column can also be extended to be sortable and/or filterable
|
|
34
|
+
*/
|
|
35
|
+
export default class Reactable<T = any, ID extends string | number | undefined | null = any> extends React.Component<Props<T, ID>> {
|
|
36
|
+
render(): React.JSX.Element;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=Reactable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Reactable.d.ts","sourceRoot":"","sources":["../../../../../src/components/reactable/Reactable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAC,kBAAkB,EAAE,eAAe,EAAE,uBAAuB,EAAC,MAAM,SAAS,CAAC;AACrF,OAAO,EAAC,QAAQ,EAAE,kBAAkB,EAAE,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAEnF,oBAAY,KAAK,CAAC,CAAC,EAAE,EAAE,SAAS,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,GAAG,IAAI;IAC3E,+EAA+E;IAC/E,UAAU,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzC,8DAA8D;IAC9D,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC;IAE/B,qCAAqC;IACrC,kBAAkB,EAAE,kBAAkB,CAAC;IAEvC,qDAAqD;IACrD,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAErC,4CAA4C;IAC5C,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,KAAK,IAAI,CAAC;IAE7D,6DAA6D;IAC7D,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAEtC,mEAAmE;IACnE,QAAQ,CAAC,EAAE,CAAC,cAAc,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAE7D,6DAA6D;IAC7D,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IAEzC,0EAA0E;IAC1E,MAAM,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAE5B,uCAAuC;IACvC,SAAS,EAAE,OAAO,CAAC;IAEnB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,wDAAwD;IACxD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS,CAAC,CAAC,GAAG,GAAG,EAAE,EAAE,SAAS,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,GAAG,CAAE,SAAQ,KAAK,CAAC,SAAS,CACnH,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CACZ;IACA,MAAM;CAoBN"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Pagination from '../pagination/Pagination';
|
|
3
|
+
import ReactableTable from './helpers/ReactableTable';
|
|
4
|
+
/**
|
|
5
|
+
* Reactable displays paginated results nicely, while adding the possibility to add further functionality to each row.
|
|
6
|
+
* Each column can also be extended to be sortable and/or filterable
|
|
7
|
+
*/
|
|
8
|
+
export default class Reactable extends React.Component {
|
|
9
|
+
render() {
|
|
10
|
+
const { paginationSettings, pageable, onChangePage, onChangeSize } = this.props;
|
|
11
|
+
const showPagination = onChangeSize
|
|
12
|
+
? pageable && pageable.totalElements > 0
|
|
13
|
+
: pageable && pageable.totalPages > 1;
|
|
14
|
+
return (React.createElement("div", null,
|
|
15
|
+
React.createElement(ReactableTable, { ...this.props }),
|
|
16
|
+
pageable && showPagination && (React.createElement(Pagination, { page: paginationSettings.page, totalPages: pageable.totalPages, onChangePage: onChangePage, onChangeSize: onChangeSize, size: paginationSettings.size }))));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactableColumnDef, ReactableRowDef, ReactableFilterSettings } from '../types';
|
|
3
|
+
import { Pageable, PaginationSettings, SortDirection } from '../../../types/pagination';
|
|
4
|
+
declare type Props<T, ID extends string | number | undefined | null> = {
|
|
5
|
+
columnDefs: Array<ReactableColumnDef<T>>;
|
|
6
|
+
uniqueItemKey: (arg0: T) => ID;
|
|
7
|
+
paginationSettings: PaginationSettings;
|
|
8
|
+
onSort: (property: string, direction: SortDirection) => void;
|
|
9
|
+
onFilter?: (filterSettings: ReactableFilterSettings) => void;
|
|
10
|
+
pageable: Pageable<T> | null | undefined;
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
rowDef?: ReactableRowDef<T>;
|
|
13
|
+
clickable?: boolean;
|
|
14
|
+
messageWhenEmpty?: string;
|
|
15
|
+
'data-testid'?: string;
|
|
16
|
+
};
|
|
17
|
+
export default class ReactableTable<T = any, ID extends string | number | undefined | null = any> extends React.Component<Props<T, ID>> {
|
|
18
|
+
render(): React.JSX.Element;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=ReactableTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactableTable.d.ts","sourceRoot":"","sources":["../../../../../../src/components/reactable/helpers/ReactableTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,EAAC,kBAAkB,EAAE,eAAe,EAAE,uBAAuB,EAAC,MAAM,UAAU,CAAC;AACtF,OAAO,EAAC,QAAQ,EAAE,kBAAkB,EAAE,aAAa,EAAC,MAAM,2BAA2B,CAAC;AAEtF,aAAK,KAAK,CAAC,CAAC,EAAE,EAAE,SAAS,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,IAAI;IAC9D,UAAU,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC;IAC/B,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7D,QAAQ,CAAC,EAAE,CAAC,cAAc,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAC7D,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,cAAc,CAClC,CAAC,GAAG,GAAG,EACP,EAAE,SAAS,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,GAAG,CAClD,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACtC,MAAM;CA+DN"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Trans } from '../../../i18n';
|
|
3
|
+
import cx from 'classnames';
|
|
4
|
+
import { SpinnerContainer } from '@deviceinsight/ng-ui-basic-components';
|
|
5
|
+
import ReactableTableRow from './ReactableTableRow';
|
|
6
|
+
import ReactableTableHeader from './ReactableTableHeader';
|
|
7
|
+
import ReactableTableFilterRow from './ReactableTableFilterRow';
|
|
8
|
+
export default class ReactableTable extends React.Component {
|
|
9
|
+
render() {
|
|
10
|
+
const { columnDefs, rowDef, uniqueItemKey, paginationSettings, pageable, onSort, onFilter, isLoading, clickable, messageWhenEmpty } = this.props;
|
|
11
|
+
const showFilterRow = columnDefs.some((columnDef) => !!columnDef.filterable);
|
|
12
|
+
return (React.createElement(SpinnerContainer, { show: isLoading },
|
|
13
|
+
React.createElement("div", { className: "di reactable scroll-x" },
|
|
14
|
+
React.createElement("table", { className: cx('di reactable sortable hoverable', { selectable: clickable }), "data-testid": this.props['data-testid'] },
|
|
15
|
+
React.createElement("thead", null,
|
|
16
|
+
React.createElement(ReactableTableHeader, { columnDefs: columnDefs, paginationSettings: paginationSettings, onSort: onSort })),
|
|
17
|
+
React.createElement("tbody", null,
|
|
18
|
+
onFilter && showFilterRow && (React.createElement(ReactableTableFilterRow, { columnDefs: columnDefs, onFilter: onFilter })),
|
|
19
|
+
pageable &&
|
|
20
|
+
pageable.content.length > 0 &&
|
|
21
|
+
pageable.content.map((item, index) => {
|
|
22
|
+
if (paginationSettings.size > index) {
|
|
23
|
+
return (React.createElement(ReactableTableRow, { key: uniqueItemKey(item), columnDefs: columnDefs, item: item, rowDef: rowDef }));
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}),
|
|
29
|
+
(!pageable || !pageable.content.length) && !isLoading && (React.createElement("tr", null,
|
|
30
|
+
React.createElement("td", { colSpan: columnDefs.length },
|
|
31
|
+
React.createElement(Trans, { i18nKey: messageWhenEmpty ?? 'reactable.noEntriesFound' }, "No entries found")))))))));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ReactableColumnDef, ReactableFilterSettings } from '../types';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
columnDefs: Array<ReactableColumnDef<any>>;
|
|
5
|
+
onFilter: (filterColumns: ReactableFilterSettings) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const ReactableTableFilterRow: React.FC<Props>;
|
|
8
|
+
export default ReactableTableFilterRow;
|
|
9
|
+
//# sourceMappingURL=ReactableTableFilterRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactableTableFilterRow.d.ts","sourceRoot":"","sources":["../../../../../../src/components/reactable/helpers/ReactableTableFilterRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAC,kBAAkB,EAAE,uBAAuB,EAAC,MAAM,UAAU,CAAC;AAGrE,aAAK,KAAK,GAAG;IACZ,UAAU,EAAE,KAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3C,QAAQ,EAAE,CAAC,aAAa,EAAE,uBAAuB,KAAK,IAAI,CAAC;CAC3D,CAAC;AAEF,QAAA,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAuF5C,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { useTranslation } from '../../../i18n';
|
|
3
|
+
import ReactableTextFilter from './ReactableTextFilter';
|
|
4
|
+
const ReactableTableFilterRow = ({ columnDefs, onFilter }) => {
|
|
5
|
+
const { t } = useTranslation();
|
|
6
|
+
const [state, setState] = useState({});
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
const initialFilters = columnDefs.reduce((acc, columnDef) => ({
|
|
9
|
+
...acc,
|
|
10
|
+
[columnDef.name]: columnDef.filterable?.initialValue ?? ''
|
|
11
|
+
}), {});
|
|
12
|
+
setState(initialFilters);
|
|
13
|
+
if (Object.values(initialFilters).some((value) => value)) {
|
|
14
|
+
onFilter(initialFilters);
|
|
15
|
+
}
|
|
16
|
+
}, [columnDefs, onFilter]);
|
|
17
|
+
const changeFilter = (columnName, value) => {
|
|
18
|
+
const newState = { ...state, [columnName]: value };
|
|
19
|
+
setState(newState);
|
|
20
|
+
onFilter(newState);
|
|
21
|
+
};
|
|
22
|
+
const getFilterByColumnDef = (columnDef) => {
|
|
23
|
+
if (columnDef.filterable) {
|
|
24
|
+
switch (columnDef.filterable.filterType) {
|
|
25
|
+
case 'text':
|
|
26
|
+
return textFilter(columnDef);
|
|
27
|
+
case 'options':
|
|
28
|
+
return optionsFilter(columnDef);
|
|
29
|
+
default:
|
|
30
|
+
throw new Error(`Filter type ${columnDef.filterable.filterType} not supported`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
};
|
|
35
|
+
const textFilter = (columnDef) => {
|
|
36
|
+
return React.createElement(ReactableTextFilter, { columnDef: columnDef, changeFilter: changeFilter });
|
|
37
|
+
};
|
|
38
|
+
const optionsFilter = (columnDef) => {
|
|
39
|
+
if (!columnDef.filterable?.filterOptions) {
|
|
40
|
+
throw new Error(`No filterOptions found for column type: options on columnDef: ${columnDef.name}`);
|
|
41
|
+
}
|
|
42
|
+
const filterOptions = columnDef.filterable.filterOptions;
|
|
43
|
+
return (React.createElement("select", { onChange: (event) => {
|
|
44
|
+
changeFilter(columnDef.name, event.target.value);
|
|
45
|
+
}, value: state[columnDef.name] },
|
|
46
|
+
React.createElement("option", { key: "", value: "" }, t('reactable.filter.all', {
|
|
47
|
+
defaultValue: '- All -'
|
|
48
|
+
})),
|
|
49
|
+
filterOptions.map((option) => (React.createElement("option", { key: option.value, value: option.value }, typeof option.label === 'string'
|
|
50
|
+
? option.label
|
|
51
|
+
: t(option.label.id, {
|
|
52
|
+
defaultValue: option.label.defaultValue
|
|
53
|
+
}))))));
|
|
54
|
+
};
|
|
55
|
+
return (React.createElement("tr", { className: "di filterrow form" }, columnDefs.map((columnDef) => (React.createElement("td", { key: columnDef.name, style: { textAlign: columnDef.align || 'left' } }, getFilterByColumnDef(columnDef))))));
|
|
56
|
+
};
|
|
57
|
+
export default ReactableTableFilterRow;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactableColumnDef, ReactableColumnLabel } from '../types';
|
|
3
|
+
import { PaginationSettings, SortDirection } from '../../../types/pagination';
|
|
4
|
+
declare type Props = {
|
|
5
|
+
columnDefs: Array<ReactableColumnDef<any>>;
|
|
6
|
+
paginationSettings: PaginationSettings;
|
|
7
|
+
onSort: (property: string, direction: SortDirection) => void;
|
|
8
|
+
};
|
|
9
|
+
export default class ReactableTableHeader extends React.Component<Props> {
|
|
10
|
+
handleSort: (columnDef: ReactableColumnDef<unknown>) => void;
|
|
11
|
+
getClassName: (columnDef: ReactableColumnDef<any>) => "" | "sortable sortAsc" | "sortable sortDes" | "sortable";
|
|
12
|
+
printLabel: (label: ReactableColumnLabel) => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | import("../../../types/i18n").TranslationDescriptor | null | undefined;
|
|
13
|
+
render(): React.JSX.Element;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=ReactableTableHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactableTableHeader.d.ts","sourceRoot":"","sources":["../../../../../../src/components/reactable/helpers/ReactableTableHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,kBAAkB,EAAE,oBAAoB,EAAC,MAAM,UAAU,CAAC;AAClE,OAAO,EAAC,kBAAkB,EAAE,aAAa,EAAC,MAAM,2BAA2B,CAAC;AAI5E,aAAK,KAAK,GAAG;IACZ,UAAU,EAAE,KAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3C,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,KAAK,IAAI,CAAC;CAC7D,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC;IACvE,UAAU,EAAE,CAAC,SAAS,EAAE,kBAAkB,CAAC,OAAO,CAAC,KAAK,IAAI,CAO1D;IAEF,YAAY,cAAe,mBAAmB,GAAG,CAAC,+DAgBhD;IAEF,UAAU,UAAW,oBAAoB,wJAQvC;IAEF,MAAM;CAuBN"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Trans } from '../../../i18n';
|
|
3
|
+
const toggleSortDirection = (direction) => (direction === 'ASC' ? 'DESC' : 'ASC');
|
|
4
|
+
export default class ReactableTableHeader extends React.Component {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.handleSort = (columnDef) => {
|
|
8
|
+
const { paginationSettings, onSort } = this.props;
|
|
9
|
+
const direction = columnDef.name === paginationSettings.sort.property
|
|
10
|
+
? toggleSortDirection(paginationSettings.sort.direction)
|
|
11
|
+
: columnDef.defaultSortDirection || 'ASC';
|
|
12
|
+
onSort(columnDef.name, direction);
|
|
13
|
+
};
|
|
14
|
+
this.getClassName = (columnDef) => {
|
|
15
|
+
const { paginationSettings } = this.props;
|
|
16
|
+
if (columnDef.sortable) {
|
|
17
|
+
if (columnDef.name === paginationSettings.sort.property) {
|
|
18
|
+
if (paginationSettings.sort.direction === 'ASC') {
|
|
19
|
+
return 'sortable sortAsc';
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return 'sortable sortDes';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
return 'sortable';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return '';
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
this.printLabel = (label) => {
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
if (typeof label === 'object' && label.id && typeof label.id === 'string') {
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
return React.createElement(Trans, { i18nKey: label.id }, label.defaultValue);
|
|
38
|
+
}
|
|
39
|
+
return label;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
render() {
|
|
43
|
+
return (React.createElement("tr", null, this.props.columnDefs.map((columnDef) => (React.createElement("th", { key: columnDef.name, style: {
|
|
44
|
+
width: columnDef.width || 'auto',
|
|
45
|
+
textAlign: columnDef.align || 'left'
|
|
46
|
+
}, className: this.getClassName(columnDef), onClick: () => {
|
|
47
|
+
if (columnDef.sortable) {
|
|
48
|
+
this.handleSort(columnDef);
|
|
49
|
+
}
|
|
50
|
+
} }, this.printLabel(columnDef.label))))));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactableColumnDef, ReactableRowDef } from '../types';
|
|
3
|
+
declare type Props<T> = {
|
|
4
|
+
columnDefs: Array<ReactableColumnDef<T>>;
|
|
5
|
+
item: T;
|
|
6
|
+
rowDef: ReactableRowDef<T> | null | undefined;
|
|
7
|
+
};
|
|
8
|
+
export default class ReactableTableRow extends React.Component<Props<any>> {
|
|
9
|
+
getRowClass: () => string;
|
|
10
|
+
handleClick: () => void;
|
|
11
|
+
getTooltip: () => string;
|
|
12
|
+
getRowStyle: () => React.CSSProperties | undefined;
|
|
13
|
+
render(): React.JSX.Element;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=ReactableTableRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactableTableRow.d.ts","sourceRoot":"","sources":["../../../../../../src/components/reactable/helpers/ReactableTableRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,kBAAkB,EAAE,eAAe,EAAC,MAAM,UAAU,CAAC;AAE7D,aAAK,KAAK,CAAC,CAAC,IAAI;IACf,UAAU,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC;IACR,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;CAC9C,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzE,WAAW,eAQT;IAEF,WAAW,aAMT;IAEF,UAAU,eAQR;IAEF,WAAW,wCAQT;IAEF,MAAM;CAkCN"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export default class ReactableTableRow extends React.Component {
|
|
3
|
+
constructor() {
|
|
4
|
+
super(...arguments);
|
|
5
|
+
this.getRowClass = () => {
|
|
6
|
+
const { rowDef, item } = this.props;
|
|
7
|
+
if (rowDef && typeof rowDef.getRowClass === 'function') {
|
|
8
|
+
return rowDef.getRowClass(item);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
return '';
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
this.handleClick = () => {
|
|
15
|
+
const { rowDef, item } = this.props;
|
|
16
|
+
if (rowDef && typeof rowDef.onClick === 'function') {
|
|
17
|
+
rowDef.onClick(item);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
this.getTooltip = () => {
|
|
21
|
+
const { rowDef, item } = this.props;
|
|
22
|
+
if (rowDef && typeof rowDef.getTooltip === 'function') {
|
|
23
|
+
return rowDef.getTooltip(item);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
return '';
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
this.getRowStyle = () => {
|
|
30
|
+
const { rowDef, item } = this.props;
|
|
31
|
+
if (rowDef && rowDef.getRowStyle) {
|
|
32
|
+
return rowDef.getRowStyle(item);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
40
|
+
const { columnDefs, item } = this.props;
|
|
41
|
+
return (React.createElement("tr", { className: this.getRowClass(), onClick: this.handleClick, title: this.getTooltip(), style: this.getRowStyle() }, columnDefs.map((columnDef) => {
|
|
42
|
+
const textAlign = columnDef.align || 'left';
|
|
43
|
+
const cursor = columnDef.onClick ? 'pointer' : 'inherit';
|
|
44
|
+
const whiteSpace = columnDef.whiteSpace || undefined;
|
|
45
|
+
const onClick = columnDef.onClick
|
|
46
|
+
? () => (columnDef.onClick ? columnDef.onClick(item) : undefined)
|
|
47
|
+
: undefined;
|
|
48
|
+
return (React.createElement("td", { key: `${item.id}_${columnDef.name}`, style: {
|
|
49
|
+
textAlign,
|
|
50
|
+
cursor,
|
|
51
|
+
// @ts-ignore
|
|
52
|
+
whiteSpace
|
|
53
|
+
}, onClick: onClick }, columnDef.render(item)));
|
|
54
|
+
})));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ReactableColumnDef } from '../types';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
columnDef: ReactableColumnDef<any>;
|
|
5
|
+
changeFilter: (columnName: string, value: any) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const ReactableTextFilter: React.FC<Props>;
|
|
8
|
+
export default ReactableTextFilter;
|
|
9
|
+
//# sourceMappingURL=ReactableTextFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactableTextFilter.d.ts","sourceRoot":"","sources":["../../../../../../src/components/reactable/helpers/ReactableTextFilter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAC,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAE5C,aAAK,KAAK,GAAG;IACZ,SAAS,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACnC,YAAY,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CACvD,CAAC;AAMF,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAqBxC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|