@addev-be/ui 0.19.2 → 0.19.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/icons/arrow-down-1-9.svg +1 -1
- package/assets/icons/arrow-down-a-z.svg +1 -1
- package/assets/icons/arrow-up-z-a.svg +1 -1
- package/assets/icons/bars.svg +1 -0
- package/assets/icons/check.svg +1 -1
- package/assets/icons/circle-check.svg +1 -1
- package/assets/icons/down.svg +1 -1
- package/assets/icons/filter-full.svg +1 -1
- package/assets/icons/filter.svg +1 -1
- package/assets/icons/hashtag.svg +1 -1
- package/assets/icons/image-slash.svg +1 -1
- package/assets/icons/left.svg +1 -1
- package/assets/icons/magnifier.svg +1 -1
- package/assets/icons/phone.svg +1 -1
- package/assets/icons/right.svg +1 -1
- package/assets/icons/sort-calendar-ascending.svg +5 -5
- package/assets/icons/spinner-third.svg +1 -1
- package/assets/icons/table-columns.svg +1 -1
- package/assets/icons/table-footer-slash.svg +4 -4
- package/assets/icons/table-footer.svg +3 -3
- package/assets/icons/up.svg +1 -1
- package/assets/icons/user-tie.svg +1 -1
- package/assets/icons/x-bar.svg +3 -3
- package/dist/Icons.d.ts +9 -1
- package/dist/Icons.js +17 -1
- package/dist/components/auth/LoginForm.js +1 -1
- package/dist/components/auth/PasswordRecoveryForm.js +1 -1
- package/dist/components/auth/PasswordResetForm.js +1 -1
- package/dist/components/data/AdvancedRequestDataGrid/helpers/advancedRequests.js +9 -8
- package/dist/components/data/AdvancedRequestDataGrid/helpers/columns.js +21 -72
- package/dist/components/data/AdvancedRequestDataGrid/index.js +2 -2
- package/dist/components/data/AdvancedRequestDataGrid/types.d.ts +1 -1
- package/dist/components/data/DataGrid/AdvancedRequestDataGrid.d.ts +10 -0
- package/dist/components/data/DataGrid/AdvancedRequestDataGrid.js +173 -0
- package/dist/components/data/DataGrid/DataGridCell.js +5 -5
- package/dist/components/data/DataGrid/DataGridColumnsModal/helpers.d.ts +2 -2
- package/dist/components/data/DataGrid/DataGridColumnsModal/helpers.js +1 -7
- package/dist/components/data/DataGrid/DataGridColumnsModal/hooks.js +3 -3
- package/dist/components/data/DataGrid/DataGridColumnsModal/index.js +16 -21
- package/dist/components/data/DataGrid/DataGridEditableCell/CheckboxEditableCell.d.ts +2 -0
- package/dist/components/data/DataGrid/DataGridEditableCell/CheckboxEditableCell.js +23 -0
- package/dist/components/data/DataGrid/DataGridEditableCell/DateEditableCell.d.ts +2 -0
- package/dist/components/data/DataGrid/DataGridEditableCell/DateEditableCell.js +27 -0
- package/dist/components/data/DataGrid/DataGridEditableCell/NumberEditableCell.d.ts +5 -0
- package/dist/components/data/DataGrid/DataGridEditableCell/NumberEditableCell.js +32 -0
- package/dist/components/data/DataGrid/DataGridEditableCell/TextEditableCell.d.ts +2 -0
- package/dist/components/data/DataGrid/DataGridEditableCell/TextEditableCell.js +23 -0
- package/dist/components/data/DataGrid/DataGridEditableCell/index.d.ts +2 -0
- package/dist/components/data/DataGrid/DataGridEditableCell/index.js +91 -0
- package/dist/components/data/DataGrid/DataGridEditableCell/styles.d.ts +3 -0
- package/dist/components/data/DataGrid/DataGridEditableCell/styles.js +17 -0
- package/dist/components/data/DataGrid/DataGridEditableCell/types.d.ts +11 -0
- package/dist/components/data/DataGrid/DataGridEditableCell/types.js +3 -0
- package/dist/components/data/DataGrid/DataGridFilterMenu/FilterValuesScroller.js +17 -1
- package/dist/components/data/DataGrid/DataGridFilterMenu/hooks.d.ts +4 -3
- package/dist/components/data/DataGrid/DataGridFilterMenu/hooks.js +11 -12
- package/dist/components/data/DataGrid/DataGridFilterMenu/index.d.ts +5 -4
- package/dist/components/data/DataGrid/DataGridFilterMenu/index.js +44 -40
- package/dist/components/data/DataGrid/DataGridFilterMenu/styles.js +1 -1
- package/dist/components/data/DataGrid/DataGridFooter.js +5 -5
- package/dist/components/data/DataGrid/DataGridHeader.js +40 -6
- package/dist/components/data/DataGrid/DataGridHeaderCell.d.ts +1 -1
- package/dist/components/data/DataGrid/DataGridHeaderCell.js +11 -23
- package/dist/components/data/DataGrid/DataGridRowTemplate.d.ts +1 -1
- package/dist/components/data/DataGrid/DataGridRowTemplate.js +8 -9
- package/dist/components/data/DataGrid/FilterModalContent/index.js +1 -1
- package/dist/components/data/DataGrid/FilterValuesScroller.d.ts +13 -0
- package/dist/components/data/DataGrid/FilterValuesScroller.js +73 -0
- package/dist/components/data/DataGrid/VirtualScroller.d.ts +11 -0
- package/dist/components/data/DataGrid/VirtualScroller.js +41 -0
- package/dist/components/data/DataGrid/constants.d.ts +6 -0
- package/dist/components/data/DataGrid/constants.js +9 -0
- package/dist/components/data/DataGrid/helpers/advancedRequests.d.ts +12 -0
- package/dist/components/data/DataGrid/helpers/advancedRequests.js +53 -0
- package/dist/components/data/DataGrid/helpers/columns.d.ts +13 -12
- package/dist/components/data/DataGrid/helpers/columns.js +100 -130
- package/dist/components/data/DataGrid/helpers.d.ts +28 -0
- package/dist/components/data/DataGrid/helpers.js +436 -0
- package/dist/components/data/DataGrid/hooks/index.d.ts +3 -3
- package/dist/components/data/DataGrid/hooks/index.js +8 -12
- package/dist/components/data/DataGrid/hooks/useDataGrid.js +71 -23
- package/dist/components/data/DataGrid/hooks/useDataGridChangedRows.d.ts +9 -0
- package/dist/components/data/DataGrid/hooks/useDataGridChangedRows.js +71 -0
- package/dist/components/data/DataGrid/hooks/useDataGridCopy.js +25 -30
- package/dist/components/data/DataGrid/index.js +16 -3
- package/dist/components/data/DataGrid/styles.d.ts +13 -8
- package/dist/components/data/DataGrid/styles.js +58 -30
- package/dist/components/data/DataGrid/types.d.ts +81 -15
- package/dist/components/data/SmartQueryDataGrid/helpers/columns.d.ts +20 -0
- package/dist/components/data/SmartQueryDataGrid/helpers/columns.js +160 -0
- package/dist/components/data/SmartQueryDataGrid/helpers/hooks.d.ts +5 -0
- package/dist/components/data/SmartQueryDataGrid/helpers/hooks.js +41 -0
- package/dist/components/data/SmartQueryDataGrid/helpers/index.d.ts +2 -0
- package/dist/components/data/SmartQueryDataGrid/helpers/index.js +18 -0
- package/dist/components/data/SmartQueryDataGrid/helpers/smartQueries.d.ts +3 -0
- package/dist/components/data/SmartQueryDataGrid/helpers/smartQueries.js +15 -0
- package/dist/components/data/SmartQueryDataGrid/hooks.d.ts +9 -0
- package/dist/components/data/SmartQueryDataGrid/hooks.js +63 -0
- package/dist/components/data/SmartQueryDataGrid/index.d.ts +12 -0
- package/dist/components/data/SmartQueryDataGrid/index.js +242 -0
- package/dist/components/data/SmartQueryDataGrid/types.d.ts +22 -0
- package/dist/components/data/SmartQueryDataGrid/types.js +2 -0
- package/dist/components/data/SqlRequestDataGrid/SqlRequestForeignListEditableCell.d.ts +2 -0
- package/dist/components/data/SqlRequestDataGrid/SqlRequestForeignListEditableCell.js +19 -0
- package/dist/components/data/SqlRequestDataGrid/helpers/columns.d.ts +16 -17
- package/dist/components/data/SqlRequestDataGrid/helpers/columns.js +236 -84
- package/dist/components/data/SqlRequestDataGrid/index.js +77 -63
- package/dist/components/data/SqlRequestDataGrid/styles.d.ts +2 -0
- package/dist/components/data/SqlRequestDataGrid/styles.js +14 -0
- package/dist/components/data/SqlRequestDataGrid/types.d.ts +13 -3
- package/dist/components/data/SqlRequestDataGrid/types.js +1 -0
- package/dist/components/data/SqlRequestForeignList/index.d.ts +4 -0
- package/dist/components/data/SqlRequestForeignList/index.js +131 -0
- package/dist/components/data/SqlRequestForeignList/styles.d.ts +9 -0
- package/dist/components/data/SqlRequestForeignList/styles.js +22 -0
- package/dist/components/data/SqlRequestForeignList/types.d.ts +22 -0
- package/dist/components/data/SqlRequestForeignList/types.js +3 -0
- package/dist/components/data/SqlRequestGrid/filters/FiltersSidebar.d.ts +10 -0
- package/dist/components/data/SqlRequestGrid/filters/FiltersSidebar.js +51 -0
- package/dist/components/data/SqlRequestGrid/filters/styles.d.ts +4 -0
- package/dist/components/data/SqlRequestGrid/filters/styles.js +17 -0
- package/dist/components/data/SqlRequestGrid/index.d.ts +1 -1
- package/dist/components/data/SqlRequestGrid/index.js +139 -49
- package/dist/components/data/SqlRequestGrid/styles.d.ts +0 -12
- package/dist/components/data/SqlRequestGrid/styles.js +4 -20
- package/dist/components/data/SqlRequestGrid/types.d.ts +14 -4
- package/dist/components/data/VirtualScroller/index.d.ts +4 -3
- package/dist/components/data/VirtualScroller/index.js +15 -5
- package/dist/components/data/VirtualScroller/styles.d.ts +4 -2
- package/dist/components/data/VirtualScroller/styles.js +9 -6
- package/dist/components/data/index.d.ts +1 -2
- package/dist/components/data/index.js +1 -2
- package/dist/components/forms/AutoTextArea.d.ts +10 -0
- package/dist/components/forms/AutoTextArea.js +40 -0
- package/dist/components/forms/Button.d.ts +9 -2
- package/dist/components/forms/Button.js +13 -7
- package/dist/components/forms/Form/Checkbox.d.ts +3 -0
- package/dist/components/forms/Form/Checkbox.js +33 -0
- package/dist/components/forms/Form/FormGroup.d.ts +9 -0
- package/dist/components/forms/Form/FormGroup.js +10 -0
- package/dist/components/forms/Form/Input.d.ts +3 -0
- package/dist/components/forms/Form/Input.js +32 -0
- package/dist/components/forms/Form/InputWithLabel.d.ts +2 -0
- package/dist/components/forms/Form/InputWithLabel.js +10 -0
- package/dist/components/forms/Form/Select.d.ts +17 -0
- package/dist/components/forms/Form/Select.js +46 -0
- package/dist/components/forms/Form/TextArea.d.ts +4 -0
- package/dist/components/forms/Form/TextArea.js +33 -0
- package/dist/components/forms/Form/index.d.ts +66 -0
- package/dist/components/forms/Form/index.js +24 -0
- package/dist/components/forms/Form/styles.d.ts +14 -0
- package/dist/components/forms/Form/styles.js +47 -0
- package/dist/components/forms/Form/types.d.ts +7 -0
- package/dist/components/forms/Form/types.js +2 -0
- package/dist/components/forms/IconButton.d.ts +2 -1
- package/dist/components/forms/IconButton.js +12 -12
- package/dist/components/forms/Select.d.ts +5 -6
- package/dist/components/forms/Select.js +2 -5
- package/dist/components/forms/index.d.ts +3 -0
- package/dist/components/forms/index.js +3 -0
- package/dist/components/layout/Columns.d.ts +5 -0
- package/dist/components/layout/Columns.js +19 -0
- package/dist/components/layout/Dropdown/index.d.ts +1 -0
- package/dist/components/layout/Dropdown/index.js +24 -3
- package/dist/components/layout/Grid/index.d.ts +6 -0
- package/dist/components/layout/Grid/index.js +6 -0
- package/dist/components/layout/Grid/styles.d.ts +14 -0
- package/dist/components/layout/Grid/styles.js +29 -0
- package/dist/components/layout/Masonry/index.d.ts +3 -0
- package/dist/components/layout/Masonry/index.js +20 -0
- package/dist/components/layout/Masonry/styles.d.ts +5 -0
- package/dist/components/layout/Masonry/styles.js +17 -0
- package/dist/components/layout/index.d.ts +4 -1
- package/dist/components/layout/index.js +4 -1
- package/dist/components/search/QuickSearchBar.js +6 -0
- package/dist/components/ui/Avatar/index.d.ts +10 -0
- package/dist/components/ui/Avatar/index.js +52 -0
- package/dist/components/ui/Avatar/styles.d.ts +4 -0
- package/dist/components/ui/Avatar/styles.js +43 -0
- package/dist/components/ui/Card/styles.js +1 -1
- package/dist/components/ui/Ellipsis.d.ts +13 -0
- package/dist/components/ui/Ellipsis.js +28 -0
- package/dist/components/ui/Label.d.ts +9 -0
- package/dist/components/ui/Label.js +74 -0
- package/dist/components/ui/index.d.ts +3 -0
- package/dist/components/ui/index.js +3 -0
- package/dist/config/types.d.ts +11 -0
- package/dist/config/types.js +2 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.js +1 -0
- package/dist/helpers/numbers.d.ts +3 -0
- package/dist/helpers/numbers.js +33 -1
- package/dist/helpers/responsive.d.ts +37 -0
- package/dist/helpers/responsive.js +57 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/useContainerMediaQuery.d.ts +17 -0
- package/dist/hooks/useContainerMediaQuery.js +10 -0
- package/dist/hooks/useMediaQuery.d.ts +17 -0
- package/dist/hooks/useMediaQuery.js +11 -0
- package/dist/hooks/useMediaQueryForWidth.d.ts +17 -0
- package/dist/hooks/useMediaQueryForWidth.js +26 -0
- package/dist/hooks/useShowArchived.d.ts +6 -0
- package/dist/hooks/useShowArchived.js +21 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/providers/AuthenticationProvider/index.js +4 -3
- package/dist/providers/PortalsProvider/styles.js +1 -1
- package/dist/providers/ThemeProvider/defaultTheme.js +13 -0
- package/dist/providers/ThemeProvider/helpers.d.ts +3 -0
- package/dist/providers/ThemeProvider/helpers.js +13 -0
- package/dist/providers/ThemeProvider/types.d.ts +2 -1
- package/dist/providers/TrackingProvider/hooks.d.ts +1 -0
- package/dist/providers/TrackingProvider/hooks.js +15 -0
- package/dist/providers/TrackingProvider/index.d.ts +8 -0
- package/dist/providers/TrackingProvider/index.js +41 -0
- package/dist/providers/UiProviders/index.js +2 -1
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.js +2 -0
- package/dist/services/globalSearch.d.ts +2 -1
- package/dist/services/index.d.ts +7 -0
- package/dist/services/index.js +20 -0
- package/dist/services/requests/generic.d.ts +29 -0
- package/dist/services/requests/generic.js +29 -0
- package/dist/services/requests/tracking.d.ts +18 -0
- package/dist/services/requests/tracking.js +8 -0
- package/dist/services/requests/userPermissions.d.ts +4 -0
- package/dist/services/requests/userPermissions.js +20 -0
- package/dist/services/smartQueries.d.ts +51 -0
- package/dist/services/smartQueries.js +10 -0
- package/dist/services/smartRequests.d.ts +0 -0
- package/dist/services/smartRequests.js +1 -0
- package/dist/services/types/generic.d.ts +44 -0
- package/dist/services/types/generic.js +79 -0
- package/dist/services/types/tracking.d.ts +24 -0
- package/dist/services/types/tracking.js +47 -0
- package/dist/services/updateSqlRequests.d.ts +24 -0
- package/dist/services/updateSqlRequests.js +7 -0
- package/package.json +2 -2
- package/src/Icons.tsx +138 -136
- package/src/components/auth/LoginForm.tsx +84 -84
- package/src/components/auth/LoginPage.tsx +32 -32
- package/src/components/auth/PasswordRecoveryForm.tsx +52 -52
- package/src/components/auth/PasswordResetForm.tsx +112 -112
- package/src/components/auth/index.ts +4 -4
- package/src/components/auth/styles.ts +14 -14
- package/src/components/data/DataGrid/DataGridCell.tsx +77 -77
- package/src/components/data/DataGrid/DataGridColumnsModal/helpers.ts +9 -9
- package/src/components/data/DataGrid/DataGridColumnsModal/hooks.tsx +59 -59
- package/src/components/data/DataGrid/DataGridColumnsModal/index.tsx +182 -182
- package/src/components/data/DataGrid/DataGridColumnsModal/styles.ts +104 -104
- package/src/components/data/DataGrid/DataGridEditableCell/CheckboxEditableCell.tsx +38 -38
- package/src/components/data/DataGrid/DataGridEditableCell/DateEditableCell.tsx +39 -39
- package/src/components/data/DataGrid/DataGridEditableCell/NumberEditableCell.tsx +68 -68
- package/src/components/data/DataGrid/DataGridEditableCell/TextEditableCell.tsx +38 -38
- package/src/components/data/DataGrid/DataGridEditableCell/index.tsx +106 -106
- package/src/components/data/DataGrid/DataGridEditableCell/styles.ts +35 -35
- package/src/components/data/DataGrid/DataGridEditableCell/types.ts +19 -19
- package/src/components/data/DataGrid/DataGridFilterMenu/FilterValuesScroller.tsx +131 -131
- package/src/components/data/DataGrid/DataGridFilterMenu/hooks.tsx +81 -81
- package/src/components/data/DataGrid/DataGridFilterMenu/index.tsx +376 -376
- package/src/components/data/DataGrid/DataGridFilterMenu/styles.ts +97 -97
- package/src/components/data/DataGrid/DataGridFooter.tsx +45 -45
- package/src/components/data/DataGrid/DataGridHeader.tsx +185 -185
- package/src/components/data/DataGrid/DataGridHeaderCell.tsx +111 -111
- package/src/components/data/DataGrid/DataGridRowTemplate.tsx +82 -82
- package/src/components/data/DataGrid/FilterModalContent/index.tsx +136 -136
- package/src/components/data/DataGrid/FilterModalContent/styles.ts +22 -22
- package/src/components/data/DataGrid/constants.ts +6 -6
- package/src/components/data/DataGrid/helpers/columns.tsx +386 -386
- package/src/components/data/DataGrid/helpers/filters.ts +287 -287
- package/src/components/data/DataGrid/helpers/index.ts +2 -2
- package/src/components/data/DataGrid/hooks/index.ts +29 -29
- package/src/components/data/DataGrid/hooks/useDataGrid.tsx +381 -381
- package/src/components/data/DataGrid/hooks/useDataGridChangedRows.ts +97 -97
- package/src/components/data/DataGrid/hooks/useDataGridCopy.ts +174 -174
- package/src/components/data/DataGrid/hooks/useDataGridSettings.ts +48 -48
- package/src/components/data/DataGrid/hooks/useRefreshModal.tsx +48 -48
- package/src/components/data/DataGrid/index.tsx +112 -112
- package/src/components/data/DataGrid/styles.ts +380 -380
- package/src/components/data/DataGrid/types.ts +369 -369
- package/src/components/data/SqlRequestDataGrid/SqlRequestForeignListEditableCell.tsx +16 -16
- package/src/components/data/SqlRequestDataGrid/helpers/columns.tsx +481 -481
- package/src/components/data/SqlRequestDataGrid/helpers/index.ts +2 -2
- package/src/components/data/SqlRequestDataGrid/helpers/sqlRequests.ts +16 -16
- package/src/components/data/SqlRequestDataGrid/index.tsx +414 -414
- package/src/components/data/SqlRequestDataGrid/styles.ts +15 -15
- package/src/components/data/SqlRequestDataGrid/types.ts +74 -74
- package/src/components/data/SqlRequestForeignList/index.tsx +259 -259
- package/src/components/data/SqlRequestForeignList/styles.ts +43 -43
- package/src/components/data/SqlRequestForeignList/types.ts +34 -34
- package/src/components/data/SqlRequestGrid/filters/FiltersSidebar.tsx +110 -110
- package/src/components/data/SqlRequestGrid/filters/styles.ts +88 -88
- package/src/components/data/SqlRequestGrid/helpers/index.ts +1 -1
- package/src/components/data/SqlRequestGrid/helpers/sqlRequests.ts +16 -16
- package/src/components/data/SqlRequestGrid/index.tsx +316 -316
- package/src/components/data/SqlRequestGrid/styles.ts +20 -20
- package/src/components/data/SqlRequestGrid/types.ts +75 -75
- package/src/components/data/VirtualScroller/hooks.ts +71 -71
- package/src/components/data/VirtualScroller/index.tsx +91 -91
- package/src/components/data/VirtualScroller/styles.ts +58 -58
- package/src/components/data/VirtualScroller/types.ts +12 -12
- package/src/components/data/index.ts +16 -16
- package/src/components/forms/AutoTextArea.tsx +48 -41
- package/src/components/forms/Button.tsx +132 -133
- package/src/components/forms/Form/Checkbox.tsx +12 -12
- package/src/components/forms/Form/FormGroup.tsx +31 -31
- package/src/components/forms/Form/Input.tsx +16 -16
- package/src/components/forms/Form/Row.tsx +32 -32
- package/src/components/forms/Form/Select.tsx +87 -87
- package/src/components/forms/Form/TextArea.tsx +17 -17
- package/src/components/forms/Form/index.tsx +45 -45
- package/src/components/forms/Form/styles.ts +184 -184
- package/src/components/forms/IconButton.tsx +57 -57
- package/src/components/forms/IndeterminateCheckbox.tsx +46 -46
- package/src/components/forms/NumberInput.tsx +4 -4
- package/src/components/forms/Select.tsx +35 -35
- package/src/components/forms/VerticalLabel.tsx +20 -20
- package/src/components/forms/index.ts +9 -9
- package/src/components/forms/styles.ts +41 -29
- package/src/components/index.ts +6 -6
- package/src/components/layout/Columns.ts +28 -28
- package/src/components/layout/Dropdown/index.tsx +113 -113
- package/src/components/layout/Dropdown/styles.ts +45 -45
- package/src/components/layout/Flexbox.ts +21 -0
- package/src/components/layout/Grid/index.tsx +8 -8
- package/src/components/layout/Grid/styles.ts +34 -34
- package/src/components/layout/Loading/index.tsx +29 -29
- package/src/components/layout/Loading/styles.ts +29 -29
- package/src/components/layout/Masonry/index.tsx +29 -29
- package/src/components/layout/Masonry/styles.ts +20 -20
- package/src/components/layout/Modal/index.tsx +51 -51
- package/src/components/layout/Modal/styles.ts +125 -125
- package/src/components/layout/index.ts +7 -6
- package/src/components/search/HighlightedText.tsx +41 -41
- package/src/components/search/QuickSearchBar.tsx +100 -100
- package/src/components/search/QuickSearchResults.tsx +86 -86
- package/src/components/search/index.ts +9 -9
- package/src/components/search/styles.ts +96 -96
- package/src/components/search/types.ts +29 -29
- package/src/components/ui/Avatar/index.tsx +54 -54
- package/src/components/ui/Card/index.tsx +14 -14
- package/src/components/ui/Card/styles.ts +37 -37
- package/src/components/ui/ContextMenu/index.tsx +79 -79
- package/src/components/ui/ContextMenu/styles.ts +119 -119
- package/src/components/ui/Ellipsis.tsx +34 -34
- package/src/components/ui/Label.tsx +90 -90
- package/src/components/ui/Message/index.tsx +57 -57
- package/src/components/ui/Message/styles.ts +40 -40
- package/src/components/ui/index.ts +6 -6
- package/src/config/index.ts +14 -14
- package/src/helpers/dates.ts +17 -17
- package/src/helpers/getScrollbarSize.ts +14 -14
- package/src/helpers/index.ts +5 -5
- package/src/helpers/numbers.ts +63 -63
- package/src/helpers/responsive.ts +83 -83
- package/src/helpers/text.ts +13 -13
- package/src/hooks/index.ts +7 -7
- package/src/hooks/useContainerMediaQuery.ts +7 -7
- package/src/hooks/useElementSize.ts +24 -24
- package/src/hooks/useMediaQuery.ts +9 -9
- package/src/hooks/useMediaQueryForWidth.ts +35 -35
- package/src/hooks/useMutableState.ts +19 -19
- package/src/hooks/useShowArchived.ts +28 -28
- package/src/hooks/useWindowSize.ts +20 -20
- package/src/index.ts +9 -9
- package/src/providers/AuthenticationProvider/helpers.ts +3 -3
- package/src/providers/AuthenticationProvider/index.tsx +303 -303
- package/src/providers/LoadingProvider/index.tsx +47 -47
- package/src/providers/PortalsProvider/index.tsx +54 -54
- package/src/providers/PortalsProvider/styles.ts +31 -31
- package/src/providers/SettingsProvider/index.tsx +70 -70
- package/src/providers/ThemeProvider/ThemeProvider.ts +63 -63
- package/src/providers/ThemeProvider/defaultTheme.ts +457 -457
- package/src/providers/ThemeProvider/helpers.ts +69 -11
- package/src/providers/ThemeProvider/index.ts +4 -4
- package/src/providers/ThemeProvider/types.ts +131 -131
- package/src/providers/TrackingProvider/index.tsx +71 -71
- package/src/providers/UiProviders/index.tsx +68 -68
- package/src/providers/UiProviders/styles.ts +10 -10
- package/src/providers/hooks.ts +12 -12
- package/src/providers/index.ts +8 -8
- package/src/services/HttpService.ts +92 -92
- package/src/services/WebSocketService.ts +155 -155
- package/src/services/advancedRequests.ts +102 -102
- package/src/services/base.ts +23 -23
- package/src/services/globalSearch.ts +32 -32
- package/src/services/hooks.ts +92 -92
- package/src/services/index.ts +21 -21
- package/src/services/requests/auth.ts +44 -44
- package/src/services/requests/generic.ts +62 -62
- package/src/services/requests/tracking.ts +12 -12
- package/src/services/requests/userProfiles.ts +35 -35
- package/src/services/requests/users.ts +28 -28
- package/src/services/smartQueries.ts +122 -122
- package/src/services/sqlRequests.ts +111 -111
- package/src/services/types/auth.ts +131 -131
- package/src/services/types/base.ts +10 -10
- package/src/services/types/generic.ts +96 -96
- package/src/services/types/tracking.ts +39 -39
- package/src/services/types/userProfiles.ts +107 -107
- package/src/services/types/users.ts +106 -106
- package/src/services/updateSqlRequests.ts +34 -34
- package/src/styles/animations.scss +30 -30
- package/src/styles/index.scss +42 -42
- package/src/typings.d.ts +19 -19
- package/tsconfig.json +18 -18
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.convertSmartFiltersToConditions = void 0;
|
|
5
|
+
var lodash_1 = require("lodash");
|
|
6
|
+
var convertSmartFiltersToConditions = function (filters) {
|
|
7
|
+
return (0, lodash_1.mapValues)(filters, function (filter, columnKey) { return ({
|
|
8
|
+
field: { fieldName: columnKey },
|
|
9
|
+
operator: filter.operator,
|
|
10
|
+
value: ['inArray', 'inRange'].includes(filter.operator)
|
|
11
|
+
? filter.values
|
|
12
|
+
: (0, lodash_1.castArray)(filter.values)[0],
|
|
13
|
+
}); });
|
|
14
|
+
};
|
|
15
|
+
exports.convertSmartFiltersToConditions = convertSmartFiltersToConditions;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ColumnDTO } from '../../../services/smartQueries';
|
|
2
|
+
import { SmartQueries } from '../../../services';
|
|
3
|
+
export declare const useSmartQuery: (type: string, columns: ColumnDTO[]) => {
|
|
4
|
+
query: SmartQueries.QueryDTO;
|
|
5
|
+
havings: SmartQueries.HavingDTO[];
|
|
6
|
+
setHaving: (columnId: string, having: SmartQueries.HavingDTO) => void;
|
|
7
|
+
footers: ("max" | "min" | "sum" | "avg" | "count")[];
|
|
8
|
+
setFooter: (columnId: string, footer: SmartQueries.FooterFunction) => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.useSmartQuery = void 0;
|
|
15
|
+
var react_1 = require("react");
|
|
16
|
+
var useSmartQuery = function (type, columns) {
|
|
17
|
+
var _a = (0, react_1.useState)({
|
|
18
|
+
type: type,
|
|
19
|
+
columns: columns,
|
|
20
|
+
}), query = _a[0], setQuery = _a[1];
|
|
21
|
+
var havings = (0, react_1.useMemo)(function () {
|
|
22
|
+
var _a;
|
|
23
|
+
return ((_a = query.columns) !== null && _a !== void 0 ? _a : [])
|
|
24
|
+
.filter(function (column) {
|
|
25
|
+
return !!column.having;
|
|
26
|
+
})
|
|
27
|
+
.map(function (col) { return col.having; });
|
|
28
|
+
}, [query.columns]);
|
|
29
|
+
var setHaving = (0, react_1.useCallback)(function (columnId, having) {
|
|
30
|
+
setQuery(function (currentQuery) {
|
|
31
|
+
var _a;
|
|
32
|
+
return (__assign(__assign({}, currentQuery), { columns: (_a = currentQuery.columns) === null || _a === void 0 ? void 0 : _a.map(function (column) {
|
|
33
|
+
return column.key === columnId
|
|
34
|
+
? __assign(__assign({}, column), { having: having }) : column;
|
|
35
|
+
}) }));
|
|
36
|
+
});
|
|
37
|
+
}, []);
|
|
38
|
+
var footers = (0, react_1.useMemo)(function () {
|
|
39
|
+
var _a;
|
|
40
|
+
return ((_a = query.columns) !== null && _a !== void 0 ? _a : [])
|
|
41
|
+
.filter(function (column) {
|
|
42
|
+
return !!column.footer;
|
|
43
|
+
})
|
|
44
|
+
.map(function (col) { return col.footer; });
|
|
45
|
+
}, [query.columns]);
|
|
46
|
+
var setFooter = (0, react_1.useCallback)(function (columnId, footer) {
|
|
47
|
+
setQuery(function (currentQuery) {
|
|
48
|
+
var _a;
|
|
49
|
+
return (__assign(__assign({}, currentQuery), { columns: (_a = currentQuery.columns) === null || _a === void 0 ? void 0 : _a.map(function (column) {
|
|
50
|
+
return column.key === columnId
|
|
51
|
+
? __assign(__assign({}, column), { footer: footer }) : column;
|
|
52
|
+
}) }));
|
|
53
|
+
});
|
|
54
|
+
}, []);
|
|
55
|
+
return {
|
|
56
|
+
query: query,
|
|
57
|
+
havings: havings,
|
|
58
|
+
setHaving: setHaving,
|
|
59
|
+
footers: footers,
|
|
60
|
+
setFooter: setFooter,
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
exports.useSmartQuery = useSmartQuery;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ConditionDTO, FooterFunction, RequestRow } from '../../../services/smartQueries';
|
|
2
|
+
import { DataGridRefProps } from '../DataGrid/types';
|
|
3
|
+
import { ForwardedRef } from 'react';
|
|
4
|
+
import { SmartQueryDataGridProps } from './types';
|
|
5
|
+
export declare const SmartQueryDataGridInner: <R>({ onSelectionChange: onSelectionChangeFromProps, ...props }: SmartQueryDataGridProps<R>, ref: ForwardedRef<DataGridRefProps>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const SmartQueryDataGrid: <R>(props: Omit<import("../DataGrid/types").DataGridProps<R>, "rows" | "columns"> & {
|
|
7
|
+
columns: import("./types").SmartQueryDataGridColumns<R>;
|
|
8
|
+
type: string;
|
|
9
|
+
conditions?: ConditionDTO[];
|
|
10
|
+
initialFooters?: Record<string, FooterFunction>;
|
|
11
|
+
parser?: ((row: RequestRow<R>) => R) | undefined;
|
|
12
|
+
} & import("react").RefAttributes<DataGridRefProps>) => import("react").JSX.Element | null;
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
25
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
26
|
+
if (ar || !(i in from)) {
|
|
27
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
28
|
+
ar[i] = from[i];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
32
|
+
};
|
|
33
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
+
exports.SmartQueryDataGrid = exports.SmartQueryDataGridInner = void 0;
|
|
35
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
36
|
+
var smartQueries_1 = require("../../../services/smartQueries");
|
|
37
|
+
var react_1 = require("react");
|
|
38
|
+
var helpers_1 = require("./helpers");
|
|
39
|
+
var lodash_1 = require("lodash");
|
|
40
|
+
var hooks_1 = require("./helpers/hooks");
|
|
41
|
+
var DataGrid_1 = require("../DataGrid");
|
|
42
|
+
var SmartQueryDataGridInner = function (_a, ref) {
|
|
43
|
+
var _b;
|
|
44
|
+
var onSelectionChangeFromProps = _a.onSelectionChange, props = __rest(_a, ["onSelectionChange"]);
|
|
45
|
+
var currentRows = (0, react_1.useRef)([]);
|
|
46
|
+
var _c = (0, react_1.useState)([]), rows = _c[0], setRows = _c[1];
|
|
47
|
+
var _d = (0, react_1.useState)(0), start = _d[0], setStart = _d[1];
|
|
48
|
+
var _e = (0, react_1.useState)(-1), length = _e[0], setLength = _e[1];
|
|
49
|
+
var _f = (0, react_1.useState)(-1), count = _f[0], setCount = _f[1];
|
|
50
|
+
var _g = (0, smartQueries_1.useSmartQueryHandler)('SmartQuery'), smartQuery = _g[0], smartIdRequest = _g[1];
|
|
51
|
+
var gridRef = (0, react_1.useRef)(null);
|
|
52
|
+
var _h = (0, react_1.useState)({}), sorts = _h[0], setSorts = _h[1];
|
|
53
|
+
var _j = (0, react_1.useState)((_b = props.initialFooters) !== null && _b !== void 0 ? _b : {}), footers = _j[0], setFooters = _j[1];
|
|
54
|
+
var _k = (0, react_1.useState)({}), conditions = _k[0], setConditions = _k[1];
|
|
55
|
+
var smartColumns = (0, hooks_1.useSmartColumnDTOs)(props.columns, conditions, footers, sorts);
|
|
56
|
+
var smartIdColumn = (0, hooks_1.useIdSmartColumnDTO)(smartColumns);
|
|
57
|
+
var refresh = (0, react_1.useCallback)(function () {
|
|
58
|
+
setRows([]);
|
|
59
|
+
setStart(0);
|
|
60
|
+
setCount(-1);
|
|
61
|
+
}, []);
|
|
62
|
+
var onFiltersChanged = (0, react_1.useCallback)(function (filters) {
|
|
63
|
+
var newConditions = (0, helpers_1.convertSmartFiltersToConditions)(filters);
|
|
64
|
+
console.log('newConditions', newConditions);
|
|
65
|
+
setConditions(newConditions);
|
|
66
|
+
refresh();
|
|
67
|
+
}, [refresh]);
|
|
68
|
+
var onSortsChanged = (0, react_1.useCallback)(function (sorts) {
|
|
69
|
+
setSorts((0, lodash_1.mapValues)(sorts, function (sort) {
|
|
70
|
+
return sort === 'asc' ? 'ascending' : 'descending';
|
|
71
|
+
}));
|
|
72
|
+
refresh();
|
|
73
|
+
}, [refresh]);
|
|
74
|
+
var loadRows = (0, react_1.useRef)((0, lodash_1.debounce)(function (type, columns, where, offset, limit, getCount) {
|
|
75
|
+
if (where === void 0) { where = []; }
|
|
76
|
+
if (offset === void 0) { offset = 0; }
|
|
77
|
+
if (limit === void 0) { limit = 0; }
|
|
78
|
+
if (getCount === void 0) { getCount = false; }
|
|
79
|
+
if (limit > 0) {
|
|
80
|
+
smartQuery({
|
|
81
|
+
type: type,
|
|
82
|
+
columns: columns,
|
|
83
|
+
where: where,
|
|
84
|
+
offset: offset,
|
|
85
|
+
limit: limit,
|
|
86
|
+
getCount: getCount,
|
|
87
|
+
}).then(function (response) {
|
|
88
|
+
var _a;
|
|
89
|
+
var _b, _c;
|
|
90
|
+
if (getCount) {
|
|
91
|
+
currentRows.current = Array(response.count).fill(null);
|
|
92
|
+
if (getCount)
|
|
93
|
+
setCount((_b = response.count) !== null && _b !== void 0 ? _b : 0);
|
|
94
|
+
}
|
|
95
|
+
var data = (_c = response.data) !== null && _c !== void 0 ? _c : [];
|
|
96
|
+
var parsedRows = props.parser
|
|
97
|
+
? data.map(props.parser)
|
|
98
|
+
: data;
|
|
99
|
+
(_a = currentRows.current).splice.apply(_a, __spreadArray([offset, limit], parsedRows, false));
|
|
100
|
+
setRows(__spreadArray([], currentRows.current, true));
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}, 100, {
|
|
104
|
+
leading: true,
|
|
105
|
+
trailing: true,
|
|
106
|
+
}));
|
|
107
|
+
var loadFilterValues = (0, react_1.useCallback)(function (columnKey) {
|
|
108
|
+
var _a;
|
|
109
|
+
var smartColumn = smartColumns.find(function (col) { return col.key === columnKey; });
|
|
110
|
+
if (!smartColumn) {
|
|
111
|
+
return Promise.resolve([]);
|
|
112
|
+
}
|
|
113
|
+
var otherSmartColumns = smartColumns.filter(function (col) { return col.key !== columnKey; });
|
|
114
|
+
return smartQuery({
|
|
115
|
+
type: props.type,
|
|
116
|
+
columns: __spreadArray([
|
|
117
|
+
__assign(__assign({}, smartColumn), { having: undefined })
|
|
118
|
+
], otherSmartColumns, true),
|
|
119
|
+
filterColumn: smartColumn,
|
|
120
|
+
where: (_a = props.conditions) !== null && _a !== void 0 ? _a : [],
|
|
121
|
+
getCount: false,
|
|
122
|
+
}).then(function (response) {
|
|
123
|
+
return response.data.map(function (row) { var _a, _b, _c; return (_c = (_b = (_a = props.columns[columnKey].filter) === null || _a === void 0 ? void 0 : _a.getter) === null || _b === void 0 ? void 0 : _b.call(_a, row)) !== null && _c !== void 0 ? _c : null; });
|
|
124
|
+
});
|
|
125
|
+
}, [props.columns, props.conditions, props.type, smartColumns, smartQuery]);
|
|
126
|
+
(0, react_1.useEffect)(function () {
|
|
127
|
+
var _a;
|
|
128
|
+
if ((!rows.length && count < 0) ||
|
|
129
|
+
rows.slice(start, start + length).some(function (row) { return row === null; })) {
|
|
130
|
+
loadRows.current(props.type, smartColumns, (_a = props.conditions) !== null && _a !== void 0 ? _a : [], start, length, count < 0);
|
|
131
|
+
}
|
|
132
|
+
}, [
|
|
133
|
+
conditions,
|
|
134
|
+
count,
|
|
135
|
+
length,
|
|
136
|
+
props.conditions,
|
|
137
|
+
props.type,
|
|
138
|
+
rows,
|
|
139
|
+
smartColumns,
|
|
140
|
+
start,
|
|
141
|
+
]);
|
|
142
|
+
var loadCopyRows = (0, react_1.useCallback)(function () {
|
|
143
|
+
var _a;
|
|
144
|
+
return smartQuery({
|
|
145
|
+
type: props.type,
|
|
146
|
+
columns: smartColumns,
|
|
147
|
+
where: (_a = props.conditions) !== null && _a !== void 0 ? _a : [],
|
|
148
|
+
}).then(function (response) {
|
|
149
|
+
return props.parser ? response.data.map(props.parser) : response.data;
|
|
150
|
+
});
|
|
151
|
+
}, [smartQuery, props.type, props.conditions, props.parser, smartColumns]);
|
|
152
|
+
var loadAllIds = (0, react_1.useCallback)(function () {
|
|
153
|
+
var _a, _b;
|
|
154
|
+
return smartIdRequest({
|
|
155
|
+
type: props.type,
|
|
156
|
+
columns: [smartIdColumn],
|
|
157
|
+
where: __spreadArray(__spreadArray([], ((_a = props.conditions) !== null && _a !== void 0 ? _a : []), true), ((_b = Object.values(conditions)) !== null && _b !== void 0 ? _b : []), true),
|
|
158
|
+
// orderBy,
|
|
159
|
+
offset: 0,
|
|
160
|
+
limit: count,
|
|
161
|
+
}).then(function (response) { return response.data.map(function (row) { return row['id']; }); });
|
|
162
|
+
}, [
|
|
163
|
+
conditions,
|
|
164
|
+
count,
|
|
165
|
+
props.conditions,
|
|
166
|
+
props.type,
|
|
167
|
+
smartIdColumn,
|
|
168
|
+
smartIdRequest,
|
|
169
|
+
]);
|
|
170
|
+
var onVisibleRowsChanged = (0, react_1.useCallback)(function (newStart, newLength) {
|
|
171
|
+
if (newStart !== start || newLength !== length) {
|
|
172
|
+
setStart(newStart);
|
|
173
|
+
setLength(newLength);
|
|
174
|
+
}
|
|
175
|
+
}, [length, start]);
|
|
176
|
+
var onSelectionChange = (0, react_1.useCallback)(function (selectedKeys) {
|
|
177
|
+
onSelectionChangeFromProps === null || onSelectionChangeFromProps === void 0 ? void 0 : onSelectionChangeFromProps(selectedKeys);
|
|
178
|
+
}, [onSelectionChangeFromProps]);
|
|
179
|
+
/** FOOTERS */
|
|
180
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
181
|
+
var _l = (0, react_1.useState)({}), footerData = _l[0], setFooterData = _l[1];
|
|
182
|
+
var loadFooters = (0, react_1.useCallback)(function () {
|
|
183
|
+
var columnsWithFooter = smartColumns
|
|
184
|
+
.filter(function (column) { return !!column.footer; })
|
|
185
|
+
.map(helpers_1.getFooterColumn);
|
|
186
|
+
var otherSmartColumns = smartColumns.filter(function (column) { return !column.footer; });
|
|
187
|
+
if (columnsWithFooter.length === 0) {
|
|
188
|
+
setFooterData({});
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
columnsWithFooter.map(function (column) {
|
|
192
|
+
var _a;
|
|
193
|
+
return smartQuery({
|
|
194
|
+
type: props.type,
|
|
195
|
+
columns: [column],
|
|
196
|
+
where: __spreadArray(__spreadArray([], ((_a = props.conditions) !== null && _a !== void 0 ? _a : []), true), (0, helpers_1.getColumnsConditions)(otherSmartColumns), true),
|
|
197
|
+
}).then(function (response) {
|
|
198
|
+
return setFooterData(function (previousData) { return (__assign(__assign({}, previousData), response.data[0])); });
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}, [props.conditions, props.type, smartColumns, smartQuery]);
|
|
203
|
+
(0, react_1.useEffect)(function () {
|
|
204
|
+
loadFooters();
|
|
205
|
+
}, [loadFooters]);
|
|
206
|
+
var footerFunctions = (0, react_1.useMemo)(function () {
|
|
207
|
+
return !footerData
|
|
208
|
+
? {}
|
|
209
|
+
: Object.entries(footers).reduce(function (acc, _a) {
|
|
210
|
+
var _b, _c;
|
|
211
|
+
var columnKey = _a[0], footerKey = _a[1];
|
|
212
|
+
var column = props.columns[columnKey];
|
|
213
|
+
var footerFunc = typeof (column === null || column === void 0 ? void 0 : column.footer) === 'function'
|
|
214
|
+
? column.footer
|
|
215
|
+
: (_b = column === null || column === void 0 ? void 0 : column.footer) === null || _b === void 0 ? void 0 : _b[footerKey];
|
|
216
|
+
var render = footerFunc
|
|
217
|
+
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
218
|
+
function (data) { return footerFunc([data], [], []); }
|
|
219
|
+
: (_c = column === null || column === void 0 ? void 0 : column.render) !== null && _c !== void 0 ? _c : lodash_1.identity;
|
|
220
|
+
if (!column) {
|
|
221
|
+
return acc;
|
|
222
|
+
}
|
|
223
|
+
acc[columnKey] = function () { return render(footerData, column); };
|
|
224
|
+
return acc;
|
|
225
|
+
}, {});
|
|
226
|
+
}, [footerData, footers, props.columns]);
|
|
227
|
+
var contextOverride = (0, react_1.useMemo)(function () { return ({
|
|
228
|
+
footers: footers,
|
|
229
|
+
setFooters: setFooters,
|
|
230
|
+
footerFunctions: footerFunctions,
|
|
231
|
+
}); }, [footers, setFooters, footerFunctions]);
|
|
232
|
+
(0, react_1.useImperativeHandle)(ref, function () {
|
|
233
|
+
var _a, _b;
|
|
234
|
+
return ({
|
|
235
|
+
refresh: refresh,
|
|
236
|
+
setSelectedKeys: (_b = (_a = gridRef.current) === null || _a === void 0 ? void 0 : _a.setSelectedKeys) !== null && _b !== void 0 ? _b : (function () { }),
|
|
237
|
+
});
|
|
238
|
+
}, [refresh]);
|
|
239
|
+
return ((0, jsx_runtime_1.jsx)(DataGrid_1.DataGrid, __assign({ ref: gridRef, onVisibleRowsChange: onVisibleRowsChanged, filter: false, sort: false, onFiltersChanged: onFiltersChanged, onSortsChanged: onSortsChanged, filterValuesLoader: loadFilterValues, rows: rows, loadCopyRows: loadCopyRows, refresh: refresh, onSelectionChange: onSelectionChange, getAllIds: loadAllIds, contextOverride: contextOverride }, props)));
|
|
240
|
+
};
|
|
241
|
+
exports.SmartQueryDataGridInner = SmartQueryDataGridInner;
|
|
242
|
+
exports.SmartQueryDataGrid = (0, react_1.forwardRef)(exports.SmartQueryDataGridInner);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ConditionDTO, FieldDTO } from '../../../services/smartQueries';
|
|
2
|
+
import { DataGridColumn, DataGridFilter, DataGridFilterType, DataGridProps } from '../DataGrid/types';
|
|
3
|
+
import { SmartQueries } from '../../../services';
|
|
4
|
+
export type SmartQueryDataGridFilter<T extends DataGridFilterType = DataGridFilterType> = DataGridFilter<T> & {
|
|
5
|
+
field?: FieldDTO;
|
|
6
|
+
};
|
|
7
|
+
export type SmartQueryDataGridFilters = Record<string, SmartQueryDataGridFilter>;
|
|
8
|
+
export type SmartQueryDataGridColumn<R> = DataGridColumn<R> & {
|
|
9
|
+
filter?: SmartQueryDataGridFilter;
|
|
10
|
+
field?: FieldDTO;
|
|
11
|
+
filterField?: string;
|
|
12
|
+
sortField?: string;
|
|
13
|
+
ignore?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type SmartQueryDataGridColumns<R> = Record<string, SmartQueryDataGridColumn<R>>;
|
|
16
|
+
export type SmartQueryDataGridProps<R> = Omit<DataGridProps<R>, 'rows' | 'columns'> & {
|
|
17
|
+
columns: SmartQueryDataGridColumns<R>;
|
|
18
|
+
type: string;
|
|
19
|
+
conditions?: ConditionDTO[];
|
|
20
|
+
initialFooters?: Record<string, SmartQueries.FooterFunction>;
|
|
21
|
+
parser?: (row: SmartQueries.RequestRow<R>) => R;
|
|
22
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { SqlRequestForeignListProps } from '../SqlRequestForeignList/types';
|
|
2
|
+
export declare const SqlRequestForeignListEditableCell: <R extends Record<string, any>>(props: SqlRequestForeignListProps<R> & import("react").RefAttributes<HTMLDivElement>) => import("react").JSX.Element | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.SqlRequestForeignListEditableCell = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
var react_1 = require("react");
|
|
17
|
+
var SqlRequestForeignList_1 = require("../SqlRequestForeignList");
|
|
18
|
+
var SqlRequestForeignListEditableCellInner = function (props, ref) { return (0, jsx_runtime_1.jsx)(SqlRequestForeignList_1.SqlRequestForeignList, __assign({}, props, { ref: ref })); };
|
|
19
|
+
exports.SqlRequestForeignListEditableCell = (0, react_1.forwardRef)(SqlRequestForeignListEditableCellInner);
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const sqlColorColumn: <R extends Record<string, any>>(key: string, title: string, options?: Partial<SqlRequestDataGridColumn<R>>) => SqlRequestDataGridColumns<R>;
|
|
1
|
+
import { SqlRequestDataGridCheckboxColumn, SqlRequestDataGridDateColumn, SqlRequestDataGridForeignListColumn, SqlRequestDataGridNumberColumn, SqlRequestDataGridTextColumn } from '../types';
|
|
2
|
+
import { DeepPartial } from '../../../../typings';
|
|
3
|
+
import { SqlRequestForeignListItemFC } from '../../SqlRequestForeignList/types';
|
|
4
|
+
export declare const sqlTextColumn: <R extends Record<string, any>>(key: string, title: React.ReactNode, options?: DeepPartial<SqlRequestDataGridTextColumn<R>>) => SqlRequestDataGridTextColumn<R>;
|
|
5
|
+
export declare const sqlMailColumn: <R extends Record<string, any>>(key: string, title: string, options?: DeepPartial<SqlRequestDataGridTextColumn<R>>) => SqlRequestDataGridTextColumn<R>;
|
|
6
|
+
export declare const sqlPhoneColumn: <R extends Record<string, any>>(key: string, title: string, options?: DeepPartial<SqlRequestDataGridTextColumn<R>>) => SqlRequestDataGridTextColumn<R>;
|
|
7
|
+
export declare const sqlDateColumn: <R extends Record<string, any>>(key: string, title: string, options?: DeepPartial<SqlRequestDataGridDateColumn<R>>) => SqlRequestDataGridDateColumn<R>;
|
|
8
|
+
export declare const sqlDateTimeColumn: <R extends Record<string, any>>(key: string, title: string, options?: DeepPartial<SqlRequestDataGridDateColumn<R>>) => SqlRequestDataGridDateColumn<R>;
|
|
9
|
+
export declare const sqlMonthColumn: <R extends Record<string, any>>(key: string, title: string, options?: DeepPartial<SqlRequestDataGridTextColumn<R>>) => SqlRequestDataGridTextColumn<R>;
|
|
10
|
+
export declare const sqlNumberColumn: <R extends Record<string, any>>(key: string, title: string, decimals?: number, options?: DeepPartial<SqlRequestDataGridNumberColumn<R>>) => SqlRequestDataGridNumberColumn<R>;
|
|
11
|
+
export declare const sqlMoneyColumn: <R extends Record<string, any>>(key: string, title: string, decimals?: number, currency?: string | ((row: R) => string), options?: DeepPartial<SqlRequestDataGridNumberColumn<R>>) => SqlRequestDataGridNumberColumn<R>;
|
|
12
|
+
export declare const sqlPercentageColumn: <R extends Record<string, any>>(key: string, title: string, decimals?: number, options?: DeepPartial<SqlRequestDataGridNumberColumn<R>>) => SqlRequestDataGridNumberColumn<R>;
|
|
13
|
+
export declare const sqlCheckboxColumn: <R extends Record<string, any>>(key: string, title: string, options?: DeepPartial<SqlRequestDataGridCheckboxColumn<R>>) => SqlRequestDataGridCheckboxColumn<R>;
|
|
14
|
+
export declare const sqlImageColumn: <R extends Record<string, any>>(key: string, title: string, urlPrefix: string, options?: DeepPartial<SqlRequestDataGridTextColumn<R>>) => SqlRequestDataGridTextColumn<R>;
|
|
15
|
+
export declare const sqlColorColumn: <R extends Record<string, any>>(key: string, title: string, options?: DeepPartial<SqlRequestDataGridTextColumn<R>>) => SqlRequestDataGridTextColumn<R>;
|
|
16
|
+
export declare const sqlForeignListColumn: <R extends Record<string, any>, T extends Record<string, any>, C extends string>(key: string, columnMapping: Record<keyof R, C>, title: string, requestName: string, ItemTemplate: SqlRequestForeignListItemFC<T>, options?: DeepPartial<SqlRequestDataGridForeignListColumn<R, T | null>>) => SqlRequestDataGridForeignListColumn<R, T | null>;
|