@idea-fragments/react-components-zendesk 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alert.js +2701 -3288
- package/dist/alert.js.map +1 -1
- package/dist/index.js +1002 -0
- package/dist/index.js.map +1 -0
- package/dist/types/components/forms/selectors/Dropdown/Item.d.ts +1 -1
- package/dist/types/components/tags/Chip.d.ts +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +14 -3
- package/.node-version +0 -1
- package/.storybook/ThemeProvider.tsx +0 -15
- package/.storybook/main.js +0 -13
- package/.storybook/preview.js +0 -20
- package/dist/forms.js +0 -101816
- package/dist/forms.js.map +0 -1
- package/entries/alert.ts +0 -1
- package/entries/forms.ts +0 -46
- package/entries/hooks.ts +0 -3
- package/entries/icon.ts +0 -1
- package/entries/layouts.ts +0 -15
- package/entries/loaders.ts +0 -3
- package/entries/mobx.ts +0 -6
- package/entries/modal.ts +0 -1
- package/entries/navigation.ts +0 -3
- package/entries/notifications.ts +0 -2
- package/entries/styles.ts +0 -16
- package/entries/tables.ts +0 -4
- package/entries/tags.ts +0 -2
- package/entries/text.ts +0 -7
- package/entries/tooltips.ts +0 -2
- package/entries/types.ts +0 -3
- package/entries/utils.ts +0 -4
- package/react_components_zendesk.iml +0 -9
- package/rollup.config.js +0 -40
- package/src/GlobalStyle.js +0 -43
- package/src/calendarCss.js +0 -2
- package/src/components/Alert.tsx +0 -175
- package/src/components/Drawer.tsx +0 -244
- package/src/components/Icon.tsx +0 -43
- package/src/components/Modal.tsx +0 -206
- package/src/components/StyledComponentProps.type.ts +0 -3
- package/src/components/StyledProps.type.ts +0 -4
- package/src/components/calendars/Legendable.type.tsx +0 -4
- package/src/components/calendars/TinyCalendar.tsx +0 -185
- package/src/components/calendars/TinyMonthYearCalendar.tsx +0 -57
- package/src/components/calendars/blocks/Legend.tsx +0 -44
- package/src/components/calendars/blocks/MonthPicker.tsx +0 -54
- package/src/components/calendars/blocks/MonthYearPicker.tsx +0 -101
- package/src/components/calendars/blocks/YearPicker.tsx +0 -44
- package/src/components/forms/Button.tsx +0 -214
- package/src/components/forms/Checkbox.tsx +0 -99
- package/src/components/forms/CycleButton.stories.tsx +0 -23
- package/src/components/forms/CycleButton.tsx +0 -52
- package/src/components/forms/Form.tsx +0 -43
- package/src/components/forms/Hint.tsx +0 -12
- package/src/components/forms/IconButton.tsx +0 -29
- package/src/components/forms/Label.tsx +0 -9
- package/src/components/forms/TaggedToggle.stories.tsx +0 -18
- package/src/components/forms/TaggedToggle.tsx +0 -19
- package/src/components/forms/Toggle.stories.tsx +0 -30
- package/src/components/forms/Toggle.tsx +0 -62
- package/src/components/forms/ValidatedFormProps.type.ts +0 -3
- package/src/components/forms/Validation.type.ts +0 -10
- package/src/components/forms/buttonMixins.ts +0 -74
- package/src/components/forms/formField.types.ts +0 -26
- package/src/components/forms/selectors/BooleanSelector.tsx +0 -71
- package/src/components/forms/selectors/DatePickerSelector.tsx +0 -88
- package/src/components/forms/selectors/Dropdown/Item.tsx +0 -34
- package/src/components/forms/selectors/Dropdown.tsx +0 -410
- package/src/components/forms/selectors/MonthYearSelector.tsx +0 -54
- package/src/components/forms/selectors/MultiSelector.tsx +0 -58
- package/src/components/forms/selectors/SearchableSelector.tsx +0 -120
- package/src/components/forms/selectors/Selector.tsx +0 -55
- package/src/components/forms/selectors/SelectorEmptyState.tsx +0 -5
- package/src/components/forms/selectors/types.ts +0 -43
- package/src/components/forms/textfields/EmailTextField.tsx +0 -7
- package/src/components/forms/textfields/NumberTextField.tsx +0 -17
- package/src/components/forms/textfields/PasswordTextField.tsx +0 -12
- package/src/components/forms/textfields/TextArea.tsx +0 -25
- package/src/components/forms/textfields/TextField.tsx +0 -45
- package/src/components/forms/textfields/TextFieldWrapper.tsx +0 -120
- package/src/components/forms/validationStates.ts +0 -6
- package/src/components/layout/AppBar.tsx +0 -137
- package/src/components/layout/AppBarLayout.tsx +0 -55
- package/src/components/layout/Carousel.tsx +0 -44
- package/src/components/layout/Container.tsx +0 -43
- package/src/components/layout/FlexBlock.tsx +0 -122
- package/src/components/layout/FlexBox.tsx +0 -69
- package/src/components/layout/Grid.tsx +0 -23
- package/src/components/layout/Line.tsx +0 -13
- package/src/components/layout/OpacityTransition.tsx +0 -6
- package/src/components/layout/OverflowMenu.tsx +0 -45
- package/src/components/layout/Section.tsx +0 -41
- package/src/components/layout/Sidebar.tsx +0 -107
- package/src/components/layout/SidebarLayout.tsx +0 -32
- package/src/components/layout/Tabs.tsx +0 -39
- package/src/components/loaders/AsyncLoadable.tsx +0 -57
- package/src/components/loaders/Dots.tsx +0 -16
- package/src/components/loaders/Loadable.tsx +0 -99
- package/src/components/loaders/Loader.tsx +0 -52
- package/src/components/loaders/TranslucentLoader.tsx +0 -49
- package/src/components/mobx/Alert.tsx +0 -33
- package/src/components/mobx/Drawer.tsx +0 -13
- package/src/components/mobx/ErrorBoundary.tsx +0 -56
- package/src/components/mobx/Modal.tsx +0 -44
- package/src/components/navigation/Breadcrumbs.tsx +0 -49
- package/src/components/navigation/ButtonLink.tsx +0 -55
- package/src/components/navigation/InlineButtonLink.tsx +0 -9
- package/src/components/notification/InfoPanel.tsx +0 -70
- package/src/components/notification/Notification.tsx +0 -51
- package/src/components/tables/MobileTable/Row.tsx +0 -147
- package/src/components/tables/MobileTable.tsx +0 -67
- package/src/components/tables/NiceTable.tsx +0 -81
- package/src/components/tables/Row.tsx +0 -84
- package/src/components/tables/SimpleTable.tsx +0 -99
- package/src/components/tables/Table.tsx +0 -153
- package/src/components/tables/blocks/Header.tsx +0 -119
- package/src/components/tables/blocks/HelpText.tsx +0 -9
- package/src/components/tables/blocks/Pagination.tsx +0 -85
- package/src/components/tables/blocks/TableFilter.tsx +0 -56
- package/src/components/tables/blocks/Title.tsx +0 -6
- package/src/components/tables/index.tsx +0 -106
- package/src/components/tables/utils.ts +0 -1
- package/src/components/tags/Chip.tsx +0 -44
- package/src/components/tags/Tag.tsx +0 -23
- package/src/components/text/Header.js +0 -55
- package/src/components/text/Hint.js +0 -25
- package/src/components/text/Label.js +0 -18
- package/src/components/text/Paragraph.js +0 -35
- package/src/components/text/Text.tsx +0 -33
- package/src/components/tooltips/IconTooltip.stories.tsx +0 -20
- package/src/components/tooltips/IconTooltip.tsx +0 -25
- package/src/components/tooltips/Tooltip.tsx +0 -30
- package/src/global.d.ts +0 -29
- package/src/hooks/useIsMounted.ts +0 -11
- package/src/hooks/useLoader.tsx +0 -73
- package/src/hooks/useLoaderV2.tsx +0 -51
- package/src/index.css +0 -34
- package/src/index.js +0 -4
- package/src/stores/useStores.tsx +0 -11
- package/src/stories/Introduction.stories.mdx +0 -211
- package/src/stories/assets/code-brackets.svg +0 -1
- package/src/stories/assets/colors.svg +0 -1
- package/src/stories/assets/comments.svg +0 -1
- package/src/stories/assets/direction.svg +0 -1
- package/src/stories/assets/flow.svg +0 -1
- package/src/stories/assets/plugin.svg +0 -1
- package/src/stories/assets/repo.svg +0 -1
- package/src/stories/assets/stackalt.svg +0 -1
- package/src/styles/DeviceSizeWatcher.ts +0 -113
- package/src/styles/alignments.ts +0 -9
- package/src/styles/colors.ts +0 -51
- package/src/styles/deviceSizes.ts +0 -28
- package/src/styles/mediaQueries.ts +0 -83
- package/src/styles/mixins.ts +0 -23
- package/src/styles/spacings.ts +0 -16
- package/src/styles/theme/Theme.type.ts +0 -76
- package/src/styles/theme/base.ts +0 -47
- package/src/styles/theme/dark.ts +0 -36
- package/src/styles/theme/light.ts +0 -44
- package/src/styles/theme/light2.ts +0 -22
- package/src/styles/theme/useTheme.ts +0 -5
- package/src/styles/types.ts +0 -18
- package/src/styles/typography.ts +0 -67
- package/src/utils/NavBarScrollWatcher.ts +0 -59
- package/src/utils/arrayHelpers.ts +0 -56
- package/src/utils/dateTime/DateRange.type.ts +0 -6
- package/src/utils/dateTime/calendar.ts +0 -23
- package/src/utils/dateTimeHelpers.ts +0 -105
- package/src/utils/function.types.ts +0 -1
- package/src/utils/functionHelpers.ts +0 -23
- package/src/utils/idGenerator.ts +0 -8
- package/src/utils/logging/Logger.ts +0 -34
- package/src/utils/logging/Logger.type.ts +0 -7
- package/src/utils/logging/loggable.tsx +0 -17
- package/src/utils/logging/with_module_logging.ts +0 -8
- package/src/utils/numberHelpers.ts +0 -4
- package/src/utils/typeCheckers.ts +0 -6
- package/src/utils/types.d.ts +0 -1
- package/src/utils/validateFields.ts +0 -14
- package/src/zendeskGardenCss.js +0 -15
- package/tsconfig.json +0 -30
- package/type_defs/GlobalStyle.d.ts +0 -2
- package/type_defs/GlobalStyle.d.ts.map +0 -1
- package/type_defs/calendarCss.d.ts +0 -2
- package/type_defs/calendarCss.d.ts.map +0 -1
- package/type_defs/components/Alert.d.ts +0 -24
- package/type_defs/components/Alert.d.ts.map +0 -1
- package/type_defs/components/Drawer.d.ts +0 -18
- package/type_defs/components/Drawer.d.ts.map +0 -1
- package/type_defs/components/Icon.d.ts +0 -15
- package/type_defs/components/Icon.d.ts.map +0 -1
- package/type_defs/components/Modal.d.ts +0 -31
- package/type_defs/components/Modal.d.ts.map +0 -1
- package/type_defs/components/StyledComponentProps.type.d.ts +0 -4
- package/type_defs/components/StyledComponentProps.type.d.ts.map +0 -1
- package/type_defs/components/StyledProps.type.d.ts +0 -4
- package/type_defs/components/StyledProps.type.d.ts.map +0 -1
- package/type_defs/components/calendars/Legendable.type.d.ts +0 -5
- package/type_defs/components/calendars/Legendable.type.d.ts.map +0 -1
- package/type_defs/components/calendars/TinyCalendar.d.ts +0 -25
- package/type_defs/components/calendars/TinyCalendar.d.ts.map +0 -1
- package/type_defs/components/calendars/TinyMonthYearCalendar.d.ts +0 -11
- package/type_defs/components/calendars/TinyMonthYearCalendar.d.ts.map +0 -1
- package/type_defs/components/calendars/blocks/Legend.d.ts +0 -12
- package/type_defs/components/calendars/blocks/Legend.d.ts.map +0 -1
- package/type_defs/components/calendars/blocks/MonthPicker.d.ts +0 -8
- package/type_defs/components/calendars/blocks/MonthPicker.d.ts.map +0 -1
- package/type_defs/components/calendars/blocks/MonthYearPicker.d.ts +0 -16
- package/type_defs/components/calendars/blocks/MonthYearPicker.d.ts.map +0 -1
- package/type_defs/components/calendars/blocks/YearPicker.d.ts +0 -10
- package/type_defs/components/calendars/blocks/YearPicker.d.ts.map +0 -1
- package/type_defs/components/forms/Button.d.ts +0 -41
- package/type_defs/components/forms/Button.d.ts.map +0 -1
- package/type_defs/components/forms/Checkbox.d.ts +0 -10
- package/type_defs/components/forms/Checkbox.d.ts.map +0 -1
- package/type_defs/components/forms/CycleButton.d.ts +0 -14
- package/type_defs/components/forms/CycleButton.d.ts.map +0 -1
- package/type_defs/components/forms/CycleButton.stories.d.ts +0 -16
- package/type_defs/components/forms/CycleButton.stories.d.ts.map +0 -1
- package/type_defs/components/forms/Form.d.ts +0 -9
- package/type_defs/components/forms/Form.d.ts.map +0 -1
- package/type_defs/components/forms/Hint.d.ts +0 -2
- package/type_defs/components/forms/Hint.d.ts.map +0 -1
- package/type_defs/components/forms/IconButton.d.ts +0 -6
- package/type_defs/components/forms/IconButton.d.ts.map +0 -1
- package/type_defs/components/forms/Label.d.ts +0 -2
- package/type_defs/components/forms/Label.d.ts.map +0 -1
- package/type_defs/components/forms/TaggedToggle.d.ts +0 -8
- package/type_defs/components/forms/TaggedToggle.d.ts.map +0 -1
- package/type_defs/components/forms/TaggedToggle.stories.d.ts +0 -12
- package/type_defs/components/forms/TaggedToggle.stories.d.ts.map +0 -1
- package/type_defs/components/forms/Toggle.d.ts +0 -12
- package/type_defs/components/forms/Toggle.d.ts.map +0 -1
- package/type_defs/components/forms/Toggle.stories.d.ts +0 -18
- package/type_defs/components/forms/Toggle.stories.d.ts.map +0 -1
- package/type_defs/components/forms/ValidatedFormProps.type.d.ts +0 -6
- package/type_defs/components/forms/ValidatedFormProps.type.d.ts.map +0 -1
- package/type_defs/components/forms/Validation.type.d.ts +0 -9
- package/type_defs/components/forms/Validation.type.d.ts.map +0 -1
- package/type_defs/components/forms/buttonMixins.d.ts +0 -23
- package/type_defs/components/forms/buttonMixins.d.ts.map +0 -1
- package/type_defs/components/forms/formField.types.d.ts +0 -23
- package/type_defs/components/forms/formField.types.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/BooleanSelector.d.ts +0 -11
- package/type_defs/components/forms/selectors/BooleanSelector.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/DatePickerSelector.d.ts +0 -19
- package/type_defs/components/forms/selectors/DatePickerSelector.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/Dropdown/Item.d.ts +0 -19
- package/type_defs/components/forms/selectors/Dropdown/Item.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/Dropdown.d.ts +0 -28
- package/type_defs/components/forms/selectors/Dropdown.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/MonthYearSelector.d.ts +0 -9
- package/type_defs/components/forms/selectors/MonthYearSelector.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/MultiSelector.d.ts +0 -9
- package/type_defs/components/forms/selectors/MultiSelector.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/SearchableSelector.d.ts +0 -8
- package/type_defs/components/forms/selectors/SearchableSelector.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/Selector.d.ts +0 -4
- package/type_defs/components/forms/selectors/Selector.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/SelectorEmptyState.d.ts +0 -2
- package/type_defs/components/forms/selectors/SelectorEmptyState.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/types.d.ts +0 -41
- package/type_defs/components/forms/selectors/types.d.ts.map +0 -1
- package/type_defs/components/forms/textfields/EmailTextField.d.ts +0 -4
- package/type_defs/components/forms/textfields/EmailTextField.d.ts.map +0 -1
- package/type_defs/components/forms/textfields/NumberTextField.d.ts +0 -4
- package/type_defs/components/forms/textfields/NumberTextField.d.ts.map +0 -1
- package/type_defs/components/forms/textfields/PasswordTextField.d.ts +0 -8
- package/type_defs/components/forms/textfields/PasswordTextField.d.ts.map +0 -1
- package/type_defs/components/forms/textfields/TextArea.d.ts +0 -9
- package/type_defs/components/forms/textfields/TextArea.d.ts.map +0 -1
- package/type_defs/components/forms/textfields/TextField.d.ts +0 -14
- package/type_defs/components/forms/textfields/TextField.d.ts.map +0 -1
- package/type_defs/components/forms/textfields/TextFieldWrapper.d.ts +0 -13
- package/type_defs/components/forms/textfields/TextFieldWrapper.d.ts.map +0 -1
- package/type_defs/components/forms/validationStates.d.ts +0 -7
- package/type_defs/components/forms/validationStates.d.ts.map +0 -1
- package/type_defs/components/layout/AppBar.d.ts +0 -14
- package/type_defs/components/layout/AppBar.d.ts.map +0 -1
- package/type_defs/components/layout/AppBarLayout.d.ts +0 -15
- package/type_defs/components/layout/AppBarLayout.d.ts.map +0 -1
- package/type_defs/components/layout/Carousel.d.ts +0 -13
- package/type_defs/components/layout/Carousel.d.ts.map +0 -1
- package/type_defs/components/layout/Container.d.ts +0 -4
- package/type_defs/components/layout/Container.d.ts.map +0 -1
- package/type_defs/components/layout/FlexBlock.d.ts +0 -19
- package/type_defs/components/layout/FlexBlock.d.ts.map +0 -1
- package/type_defs/components/layout/FlexBox.d.ts +0 -18
- package/type_defs/components/layout/FlexBox.d.ts.map +0 -1
- package/type_defs/components/layout/Grid.d.ts +0 -4
- package/type_defs/components/layout/Grid.d.ts.map +0 -1
- package/type_defs/components/layout/Line.d.ts +0 -6
- package/type_defs/components/layout/Line.d.ts.map +0 -1
- package/type_defs/components/layout/OpacityTransition.d.ts +0 -4
- package/type_defs/components/layout/OpacityTransition.d.ts.map +0 -1
- package/type_defs/components/layout/OverflowMenu.d.ts +0 -13
- package/type_defs/components/layout/OverflowMenu.d.ts.map +0 -1
- package/type_defs/components/layout/Section.d.ts +0 -6
- package/type_defs/components/layout/Section.d.ts.map +0 -1
- package/type_defs/components/layout/Sidebar.d.ts +0 -12
- package/type_defs/components/layout/Sidebar.d.ts.map +0 -1
- package/type_defs/components/layout/SidebarLayout.d.ts +0 -5
- package/type_defs/components/layout/SidebarLayout.d.ts.map +0 -1
- package/type_defs/components/layout/Tabs.d.ts +0 -3
- package/type_defs/components/layout/Tabs.d.ts.map +0 -1
- package/type_defs/components/loaders/AsyncLoadable.d.ts +0 -13
- package/type_defs/components/loaders/AsyncLoadable.d.ts.map +0 -1
- package/type_defs/components/loaders/Dots.d.ts +0 -9
- package/type_defs/components/loaders/Dots.d.ts.map +0 -1
- package/type_defs/components/loaders/Loadable.d.ts +0 -10
- package/type_defs/components/loaders/Loadable.d.ts.map +0 -1
- package/type_defs/components/loaders/Loader.d.ts +0 -15
- package/type_defs/components/loaders/Loader.d.ts.map +0 -1
- package/type_defs/components/loaders/TranslucentLoader.d.ts +0 -9
- package/type_defs/components/loaders/TranslucentLoader.d.ts.map +0 -1
- package/type_defs/components/mobx/Alert.d.ts +0 -4
- package/type_defs/components/mobx/Alert.d.ts.map +0 -1
- package/type_defs/components/mobx/Drawer.d.ts +0 -5
- package/type_defs/components/mobx/Drawer.d.ts.map +0 -1
- package/type_defs/components/mobx/ErrorBoundary.d.ts +0 -24
- package/type_defs/components/mobx/ErrorBoundary.d.ts.map +0 -1
- package/type_defs/components/mobx/Modal.d.ts +0 -4
- package/type_defs/components/mobx/Modal.d.ts.map +0 -1
- package/type_defs/components/navigation/Breadcrumbs.d.ts +0 -3
- package/type_defs/components/navigation/Breadcrumbs.d.ts.map +0 -1
- package/type_defs/components/navigation/ButtonLink.d.ts +0 -25
- package/type_defs/components/navigation/ButtonLink.d.ts.map +0 -1
- package/type_defs/components/navigation/InlineButtonLink.d.ts +0 -3
- package/type_defs/components/navigation/InlineButtonLink.d.ts.map +0 -1
- package/type_defs/components/notification/InfoPanel.d.ts +0 -18
- package/type_defs/components/notification/InfoPanel.d.ts.map +0 -1
- package/type_defs/components/notification/Notification.d.ts +0 -14
- package/type_defs/components/notification/Notification.d.ts.map +0 -1
- package/type_defs/components/tables/MobileTable/Row.d.ts +0 -14
- package/type_defs/components/tables/MobileTable/Row.d.ts.map +0 -1
- package/type_defs/components/tables/MobileTable.d.ts +0 -9
- package/type_defs/components/tables/MobileTable.d.ts.map +0 -1
- package/type_defs/components/tables/NiceTable.d.ts +0 -12
- package/type_defs/components/tables/NiceTable.d.ts.map +0 -1
- package/type_defs/components/tables/Row.d.ts +0 -19
- package/type_defs/components/tables/Row.d.ts.map +0 -1
- package/type_defs/components/tables/SimpleTable.d.ts +0 -9
- package/type_defs/components/tables/SimpleTable.d.ts.map +0 -1
- package/type_defs/components/tables/Table.d.ts +0 -73
- package/type_defs/components/tables/Table.d.ts.map +0 -1
- package/type_defs/components/tables/blocks/Header.d.ts +0 -17
- package/type_defs/components/tables/blocks/Header.d.ts.map +0 -1
- package/type_defs/components/tables/blocks/HelpText.d.ts +0 -5
- package/type_defs/components/tables/blocks/HelpText.d.ts.map +0 -1
- package/type_defs/components/tables/blocks/Pagination.d.ts +0 -8
- package/type_defs/components/tables/blocks/Pagination.d.ts.map +0 -1
- package/type_defs/components/tables/blocks/TableFilter.d.ts +0 -9
- package/type_defs/components/tables/blocks/TableFilter.d.ts.map +0 -1
- package/type_defs/components/tables/blocks/Title.d.ts +0 -7
- package/type_defs/components/tables/blocks/Title.d.ts.map +0 -1
- package/type_defs/components/tables/index.d.ts +0 -9
- package/type_defs/components/tables/index.d.ts.map +0 -1
- package/type_defs/components/tables/utils.d.ts +0 -2
- package/type_defs/components/tables/utils.d.ts.map +0 -1
- package/type_defs/components/tags/Chip.d.ts +0 -18
- package/type_defs/components/tags/Chip.d.ts.map +0 -1
- package/type_defs/components/tags/Tag.d.ts +0 -8
- package/type_defs/components/tags/Tag.d.ts.map +0 -1
- package/type_defs/components/text/Header.d.ts +0 -31
- package/type_defs/components/text/Header.d.ts.map +0 -1
- package/type_defs/components/text/Hint.d.ts +0 -10
- package/type_defs/components/text/Hint.d.ts.map +0 -1
- package/type_defs/components/text/Label.d.ts +0 -7
- package/type_defs/components/text/Label.d.ts.map +0 -1
- package/type_defs/components/text/Paragraph.d.ts +0 -37
- package/type_defs/components/text/Paragraph.d.ts.map +0 -1
- package/type_defs/components/text/Text.d.ts +0 -7
- package/type_defs/components/text/Text.d.ts.map +0 -1
- package/type_defs/components/tooltips/IconTooltip.d.ts +0 -10
- package/type_defs/components/tooltips/IconTooltip.d.ts.map +0 -1
- package/type_defs/components/tooltips/IconTooltip.stories.d.ts +0 -18
- package/type_defs/components/tooltips/IconTooltip.stories.d.ts.map +0 -1
- package/type_defs/components/tooltips/Tooltip.d.ts +0 -14
- package/type_defs/components/tooltips/Tooltip.d.ts.map +0 -1
- package/type_defs/hooks/useIsMounted.d.ts +0 -2
- package/type_defs/hooks/useIsMounted.d.ts.map +0 -1
- package/type_defs/hooks/useLoader.d.ts +0 -10
- package/type_defs/hooks/useLoader.d.ts.map +0 -1
- package/type_defs/hooks/useLoaderV2.d.ts +0 -15
- package/type_defs/hooks/useLoaderV2.d.ts.map +0 -1
- package/type_defs/index.d.ts +0 -2
- package/type_defs/index.d.ts.map +0 -1
- package/type_defs/stores/useStores.d.ts +0 -5
- package/type_defs/stores/useStores.d.ts.map +0 -1
- package/type_defs/styles/DeviceSizeWatcher.d.ts +0 -21
- package/type_defs/styles/DeviceSizeWatcher.d.ts.map +0 -1
- package/type_defs/styles/alignments.d.ts +0 -8
- package/type_defs/styles/alignments.d.ts.map +0 -1
- package/type_defs/styles/colors.d.ts +0 -35
- package/type_defs/styles/colors.d.ts.map +0 -1
- package/type_defs/styles/deviceSizes.d.ts +0 -9
- package/type_defs/styles/deviceSizes.d.ts.map +0 -1
- package/type_defs/styles/mediaQueries.d.ts +0 -21
- package/type_defs/styles/mediaQueries.d.ts.map +0 -1
- package/type_defs/styles/mixins.d.ts +0 -8
- package/type_defs/styles/mixins.d.ts.map +0 -1
- package/type_defs/styles/spacings.d.ts +0 -15
- package/type_defs/styles/spacings.d.ts.map +0 -1
- package/type_defs/styles/theme/Theme.type.d.ts +0 -79
- package/type_defs/styles/theme/Theme.type.d.ts.map +0 -1
- package/type_defs/styles/theme/base.d.ts +0 -3
- package/type_defs/styles/theme/base.d.ts.map +0 -1
- package/type_defs/styles/theme/dark.d.ts +0 -3
- package/type_defs/styles/theme/dark.d.ts.map +0 -1
- package/type_defs/styles/theme/light.d.ts +0 -3
- package/type_defs/styles/theme/light.d.ts.map +0 -1
- package/type_defs/styles/theme/light2.d.ts +0 -3
- package/type_defs/styles/theme/light2.d.ts.map +0 -1
- package/type_defs/styles/theme/useTheme.d.ts +0 -3
- package/type_defs/styles/theme/useTheme.d.ts.map +0 -1
- package/type_defs/styles/types.d.ts +0 -17
- package/type_defs/styles/types.d.ts.map +0 -1
- package/type_defs/styles/typography.d.ts +0 -56
- package/type_defs/styles/typography.d.ts.map +0 -1
- package/type_defs/utils/NavBarScrollWatcher.d.ts +0 -7
- package/type_defs/utils/NavBarScrollWatcher.d.ts.map +0 -1
- package/type_defs/utils/arrayHelpers.d.ts +0 -23
- package/type_defs/utils/arrayHelpers.d.ts.map +0 -1
- package/type_defs/utils/dateTime/DateRange.type.d.ts +0 -6
- package/type_defs/utils/dateTime/DateRange.type.d.ts.map +0 -1
- package/type_defs/utils/dateTime/calendar.d.ts +0 -18
- package/type_defs/utils/dateTime/calendar.d.ts.map +0 -1
- package/type_defs/utils/dateTimeHelpers.d.ts +0 -23
- package/type_defs/utils/dateTimeHelpers.d.ts.map +0 -1
- package/type_defs/utils/function.types.d.ts +0 -2
- package/type_defs/utils/function.types.d.ts.map +0 -1
- package/type_defs/utils/functionHelpers.d.ts +0 -7
- package/type_defs/utils/functionHelpers.d.ts.map +0 -1
- package/type_defs/utils/idGenerator.d.ts +0 -3
- package/type_defs/utils/idGenerator.d.ts.map +0 -1
- package/type_defs/utils/logging/Logger.d.ts +0 -10
- package/type_defs/utils/logging/Logger.d.ts.map +0 -1
- package/type_defs/utils/logging/Logger.type.d.ts +0 -7
- package/type_defs/utils/logging/Logger.type.d.ts.map +0 -1
- package/type_defs/utils/logging/loggable.d.ts +0 -7
- package/type_defs/utils/logging/loggable.d.ts.map +0 -1
- package/type_defs/utils/logging/with_module_logging.d.ts +0 -3
- package/type_defs/utils/logging/with_module_logging.d.ts.map +0 -1
- package/type_defs/utils/numberHelpers.d.ts +0 -3
- package/type_defs/utils/numberHelpers.d.ts.map +0 -1
- package/type_defs/utils/typeCheckers.d.ts +0 -5
- package/type_defs/utils/typeCheckers.d.ts.map +0 -1
- package/type_defs/utils/validateFields.d.ts +0 -13
- package/type_defs/utils/validateFields.d.ts.map +0 -1
- package/type_defs/zendeskGardenCss.d.ts +0 -2
- package/type_defs/zendeskGardenCss.d.ts.map +0 -1
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { Checkbox } from "components/forms/Checkbox"
|
|
2
|
-
import { OverflowMenu } from "components/layout/OverflowMenu"
|
|
3
|
-
import { Cell, Row as MyRow } from "components/tables/index"
|
|
4
|
-
import { ColumnConfig, Item, ItemKey, } from "components/tables/Table"
|
|
5
|
-
import { columnWidth } from "components/tables/utils"
|
|
6
|
-
import { Text } from "components/text/Text"
|
|
7
|
-
import React from "react"
|
|
8
|
-
import styled from "styled-components"
|
|
9
|
-
import { FONT_WEIGHTS } from "styles/typography"
|
|
10
|
-
|
|
11
|
-
type Props = {
|
|
12
|
-
checkable?: boolean,
|
|
13
|
-
checkDisabled?: boolean,
|
|
14
|
-
checked?: boolean,
|
|
15
|
-
columnConfigs: Array<ColumnConfig>,
|
|
16
|
-
item: Item,
|
|
17
|
-
onCheck?: (row: ItemKey, isChecked: boolean) => void,
|
|
18
|
-
onClick?: (row: ItemKey) => void,
|
|
19
|
-
onHoverEnd?: (row: ItemKey) => void,
|
|
20
|
-
onHoverStart?: (row: ItemKey) => void,
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const Row = ({
|
|
24
|
-
checkable = false,
|
|
25
|
-
checkDisabled = false,
|
|
26
|
-
checked = false,
|
|
27
|
-
columnConfigs,
|
|
28
|
-
item,
|
|
29
|
-
onCheck,
|
|
30
|
-
onClick,
|
|
31
|
-
onHoverEnd,
|
|
32
|
-
onHoverStart,
|
|
33
|
-
}: Props) => {
|
|
34
|
-
const colWidth = columnWidth(columnConfigs.length)
|
|
35
|
-
const handleCheckChange = (checked: boolean) => {
|
|
36
|
-
onCheck?.(item.key, checked)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const { key, containerStyles, actions }: Item = item
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<MyRow css={containerStyles || {}}
|
|
43
|
-
onClick={() => onClick?.(key)}
|
|
44
|
-
onMouseEnter={() => onHoverStart?.(key)}
|
|
45
|
-
onMouseLeave={() => onHoverEnd?.(key)}
|
|
46
|
-
>
|
|
47
|
-
{checkable ? (
|
|
48
|
-
<Cell minimum>
|
|
49
|
-
<Checkbox checked={!checkDisabled && checked}
|
|
50
|
-
disabled={checkDisabled}
|
|
51
|
-
onChange={handleCheckChange} />
|
|
52
|
-
</Cell>
|
|
53
|
-
) : null}
|
|
54
|
-
{columnConfigs.map((c: ColumnConfig) => {
|
|
55
|
-
const { css, name, important, width, } = c
|
|
56
|
-
|
|
57
|
-
const weight = important
|
|
58
|
-
? FONT_WEIGHTS.MEDIUM
|
|
59
|
-
: FONT_WEIGHTS.REGULAR
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<Cell key={`${key}-${name}`}
|
|
63
|
-
css={css}
|
|
64
|
-
width={css ? null : width || colWidth}>
|
|
65
|
-
<Text css={`font-weight: ${weight}; width: 100%;`}>
|
|
66
|
-
{item[name]}
|
|
67
|
-
</Text>
|
|
68
|
-
</Cell>
|
|
69
|
-
)
|
|
70
|
-
})}
|
|
71
|
-
{actions ? <OverflowMenuCell menu>
|
|
72
|
-
<OverflowMenu actions={actions} placement={"bottom-end"} />
|
|
73
|
-
</OverflowMenuCell> : null}
|
|
74
|
-
</MyRow>
|
|
75
|
-
)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const OverflowMenuCell = styled(Cell)`
|
|
79
|
-
&& {
|
|
80
|
-
padding: 1rem 0;
|
|
81
|
-
}
|
|
82
|
-
`
|
|
83
|
-
|
|
84
|
-
Row.COMPONENT_NAME = "Row"
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
import { Checkbox, Label } from "@zendeskgarden/react-forms"
|
|
3
|
-
import {
|
|
4
|
-
Body,
|
|
5
|
-
Head,
|
|
6
|
-
HeaderCell,
|
|
7
|
-
HeaderRow,
|
|
8
|
-
Table as ZTable,
|
|
9
|
-
/*@ts-ignore*/
|
|
10
|
-
} from "@zendeskgarden/react-tables"
|
|
11
|
-
import { FlexBlock } from "components/layout/FlexBlock"
|
|
12
|
-
import { FlexBox } from "components/layout/FlexBox"
|
|
13
|
-
import { HelpText } from "components/tables/blocks/HelpText"
|
|
14
|
-
import { Title } from "components/tables/blocks/Title"
|
|
15
|
-
import { Row } from "components/tables/Row"
|
|
16
|
-
import {
|
|
17
|
-
ColumnConfig,
|
|
18
|
-
Item
|
|
19
|
-
} from "components/tables/Table"
|
|
20
|
-
import { TableProps } from "components/tables/Table"
|
|
21
|
-
import { columnWidth } from "components/tables/utils"
|
|
22
|
-
import { Text } from "components/text/Text"
|
|
23
|
-
import * as React from "react"
|
|
24
|
-
import { FONT_WEIGHTS } from "styles/typography"
|
|
25
|
-
|
|
26
|
-
type Props = TableProps & {
|
|
27
|
-
hasRowActions: boolean,
|
|
28
|
-
onSelectAllToggle?: (b: boolean) => void,
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export const SimpleTable = ({
|
|
32
|
-
title,
|
|
33
|
-
actions,
|
|
34
|
-
columnConfigs,
|
|
35
|
-
helpText,
|
|
36
|
-
items,
|
|
37
|
-
onItemClick,
|
|
38
|
-
checkable,
|
|
39
|
-
checkedItems,
|
|
40
|
-
onItemChecked,
|
|
41
|
-
onSelectAllToggle,
|
|
42
|
-
}: Props) => {
|
|
43
|
-
|
|
44
|
-
const colWidth = columnWidth(columnConfigs.length)
|
|
45
|
-
|
|
46
|
-
const allSelected = checkedItems?.size === items.length
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<FlexBlock>
|
|
50
|
-
<ZTable>
|
|
51
|
-
<FlexBox css={`margin-bottom: 1rem`}
|
|
52
|
-
justifyContent={"space-between"} withRows>
|
|
53
|
-
{title ? <Title>{title}</Title> : null}
|
|
54
|
-
{helpText ? <HelpText>{helpText}</HelpText> : null}
|
|
55
|
-
<FlexBox css={`flex: 1`} justifyContent={"flex-end"}>
|
|
56
|
-
{/*@ts-ignore*/}
|
|
57
|
-
{actions?.({ checkedItems })?.map((a) => a)}
|
|
58
|
-
</FlexBox>
|
|
59
|
-
</FlexBox>
|
|
60
|
-
|
|
61
|
-
<Head>
|
|
62
|
-
<HeaderRow>
|
|
63
|
-
{checkable ? (
|
|
64
|
-
<HeaderCell minimum>
|
|
65
|
-
<Checkbox checked={allSelected}
|
|
66
|
-
onChange={onSelectAllToggle}>
|
|
67
|
-
<Label hidden
|
|
68
|
-
indeterminate={checkedItems!.size > 0 && !allSelected}>
|
|
69
|
-
Select all Jobs
|
|
70
|
-
</Label>
|
|
71
|
-
</Checkbox>
|
|
72
|
-
</HeaderCell>
|
|
73
|
-
) : null}
|
|
74
|
-
|
|
75
|
-
{columnConfigs.map(({ name }: ColumnConfig) => (
|
|
76
|
-
<HeaderCell key={name} width={colWidth}>
|
|
77
|
-
<Text weight={FONT_WEIGHTS.BOLD}>
|
|
78
|
-
{name}
|
|
79
|
-
</Text>
|
|
80
|
-
</HeaderCell>
|
|
81
|
-
))}
|
|
82
|
-
</HeaderRow>
|
|
83
|
-
</Head>
|
|
84
|
-
|
|
85
|
-
<Body>
|
|
86
|
-
{items.map((item: Item) => (
|
|
87
|
-
<Row item={item}
|
|
88
|
-
key={item.key}
|
|
89
|
-
columnConfigs={columnConfigs}
|
|
90
|
-
onClick={onItemClick}
|
|
91
|
-
checkable={checkable}
|
|
92
|
-
checked={checkedItems?.has(item.key)}
|
|
93
|
-
onCheck={onItemChecked} />
|
|
94
|
-
))}
|
|
95
|
-
</Body>
|
|
96
|
-
</ZTable>
|
|
97
|
-
</FlexBlock>
|
|
98
|
-
)
|
|
99
|
-
}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { FlexBox } from "components/layout/FlexBox"
|
|
2
|
-
import { Pagination } from "components/tables/blocks/Pagination"
|
|
3
|
-
import { MobileTable } from "components/tables/MobileTable"
|
|
4
|
-
import { NiceTable } from "components/tables/NiceTable"
|
|
5
|
-
import { SimpleTable } from "components/tables/SimpleTable"
|
|
6
|
-
import React, { ReactNode, useCallback, useEffect, useState } from "react"
|
|
7
|
-
import styled, { CSSProp } from "styled-components"
|
|
8
|
-
import {
|
|
9
|
-
DeviceSize,
|
|
10
|
-
DeviceSizeChangeListener,
|
|
11
|
-
} from "styles/DeviceSizeWatcher"
|
|
12
|
-
import { deviceSizeWatcher } from "styles/DeviceSizeWatcher"
|
|
13
|
-
import { isNotEmpty } from "utils/arrayHelpers"
|
|
14
|
-
|
|
15
|
-
export type ItemKey = number | string
|
|
16
|
-
export type ItemContainerStyles = string
|
|
17
|
-
export type ItemAction = {
|
|
18
|
-
action: () => void,
|
|
19
|
-
label: string,
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export type ItemFilterOptions = { name: string } &
|
|
23
|
-
({
|
|
24
|
-
options: { label: string, value: string }[],
|
|
25
|
-
type: "select",
|
|
26
|
-
} | { options: undefined, type: "text" })
|
|
27
|
-
|
|
28
|
-
export type Item = { [key: string]: ReactNode } & {
|
|
29
|
-
actions?: Array<ItemAction>,
|
|
30
|
-
checkDisabled?: boolean,
|
|
31
|
-
clickDisabled?: boolean,
|
|
32
|
-
containerStyles?: ItemContainerStyles,
|
|
33
|
-
key: ItemKey,
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export type ColumnConfig = {
|
|
37
|
-
collapsible: boolean,
|
|
38
|
-
css?: CSSProp,
|
|
39
|
-
filter?: ItemFilterOptions,
|
|
40
|
-
important: boolean,
|
|
41
|
-
name: string,
|
|
42
|
-
width?: string,
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export type PaginationData = {
|
|
46
|
-
page: number,
|
|
47
|
-
pageSize: number,
|
|
48
|
-
totalCount: number,
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
type ActionsCreatorParams = {
|
|
52
|
-
checkedItems: Set<ItemKey>
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export type TableProps = {
|
|
56
|
-
actions?: (p: ActionsCreatorParams) => ReactNode[],
|
|
57
|
-
checkable?: boolean,
|
|
58
|
-
checkedItems?: Set<ItemKey>,
|
|
59
|
-
columnConfigs: Array<ColumnConfig>,
|
|
60
|
-
emptyState?: ReactNode,
|
|
61
|
-
helpText?: ReactNode,
|
|
62
|
-
initialFilterValues?: { [key: string]: string },
|
|
63
|
-
items: Array<Item>,
|
|
64
|
-
title?: string,
|
|
65
|
-
onFilterChange?: (name: string, value: any) => void,
|
|
66
|
-
onItemChecked?: (key: ItemKey, isChecked: boolean) => void,
|
|
67
|
-
onItemsChecked?: (rows: Set<ItemKey>) => void,
|
|
68
|
-
onItemClick?: (key: ItemKey) => void,
|
|
69
|
-
onItemHoverEnd?: (key: ItemKey) => void,
|
|
70
|
-
onItemHoverStart?: (key: ItemKey) => void,
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
type Props = TableProps & {
|
|
74
|
-
className?: string,
|
|
75
|
-
nice?: boolean,
|
|
76
|
-
pagination?: PaginationData,
|
|
77
|
-
onPageChange?: (p: number) => void,
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const {
|
|
81
|
-
getSize,
|
|
82
|
-
isLargeComputer,
|
|
83
|
-
isSmallComputer,
|
|
84
|
-
subscribe,
|
|
85
|
-
unsubscribe,
|
|
86
|
-
} = deviceSizeWatcher
|
|
87
|
-
|
|
88
|
-
export let Table = ({
|
|
89
|
-
// @ts-ignore
|
|
90
|
-
action,
|
|
91
|
-
actions,
|
|
92
|
-
className,
|
|
93
|
-
nice = true,
|
|
94
|
-
pagination,
|
|
95
|
-
onItemsChecked,
|
|
96
|
-
onPageChange,
|
|
97
|
-
...props
|
|
98
|
-
}: Props) => {
|
|
99
|
-
|
|
100
|
-
const [, setDeviseSize] = useState<DeviceSize>(getSize())
|
|
101
|
-
|
|
102
|
-
const handleDeviseSizeChange = useCallback<DeviceSizeChangeListener>(
|
|
103
|
-
(s: DeviceSize) => { setDeviseSize(s) },
|
|
104
|
-
[],
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
const setAllRowsSelectedTo = (isChecked: boolean) => {
|
|
108
|
-
const rows = isChecked ? props.items.map((i) => i.key) : []
|
|
109
|
-
onItemsChecked?.(new Set([...rows]))
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
useEffect(() => {
|
|
113
|
-
const subId = subscribe(handleDeviseSizeChange)
|
|
114
|
-
return () => { unsubscribe(subId) }
|
|
115
|
-
}, [handleDeviseSizeChange])
|
|
116
|
-
|
|
117
|
-
const hasRowActions = props.items.some(
|
|
118
|
-
(i: Item) => i.actions && isNotEmpty(i.actions),
|
|
119
|
-
)
|
|
120
|
-
|
|
121
|
-
if (action && !actions) { actions = () => [action] }
|
|
122
|
-
|
|
123
|
-
const largeTable = () => nice
|
|
124
|
-
? <NiceTable actions={actions}
|
|
125
|
-
hasRowActions={hasRowActions}
|
|
126
|
-
onSelectAllToggle={setAllRowsSelectedTo}
|
|
127
|
-
{...props}
|
|
128
|
-
/>
|
|
129
|
-
: <SimpleTable actions={actions}
|
|
130
|
-
hasRowActions={hasRowActions}
|
|
131
|
-
onSelectAllToggle={setAllRowsSelectedTo}
|
|
132
|
-
{...props}
|
|
133
|
-
/>
|
|
134
|
-
return (
|
|
135
|
-
<FlexBox withRows className={className}>
|
|
136
|
-
{
|
|
137
|
-
isSmallComputer() || isLargeComputer()
|
|
138
|
-
? largeTable()
|
|
139
|
-
: <MobileTable actions={actions}
|
|
140
|
-
hasRowActions={hasRowActions}
|
|
141
|
-
onSelectAllToggle={setAllRowsSelectedTo}
|
|
142
|
-
{...props} />
|
|
143
|
-
}
|
|
144
|
-
{
|
|
145
|
-
pagination
|
|
146
|
-
? <Pagination {...pagination} onPageChange={onPageChange!!} />
|
|
147
|
-
: null
|
|
148
|
-
}
|
|
149
|
-
</FlexBox>
|
|
150
|
-
)
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
Table = styled(Table)``
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { mdiFilterVariant } from "@mdi/js"
|
|
2
|
-
import { Checkbox } from "components/forms/Checkbox"
|
|
3
|
-
import { IconButton } from "components/forms/IconButton"
|
|
4
|
-
import { FlexBlock } from "components/layout/FlexBlock"
|
|
5
|
-
import { StyledProps } from "components/StyledProps.type"
|
|
6
|
-
import { TableFilter } from "components/tables/blocks/TableFilter"
|
|
7
|
-
import {
|
|
8
|
-
Head as TableHead,
|
|
9
|
-
HeaderCell,
|
|
10
|
-
HeaderRow,
|
|
11
|
-
} from "components/tables/index"
|
|
12
|
-
import {
|
|
13
|
-
ColumnConfig,
|
|
14
|
-
Item,
|
|
15
|
-
ItemKey
|
|
16
|
-
} from "components/tables/Table"
|
|
17
|
-
import { columnWidth } from "components/tables/utils"
|
|
18
|
-
import { Text } from "components/text/Text"
|
|
19
|
-
import React, { useState } from "react"
|
|
20
|
-
import { SPACINGS } from "styles/spacings"
|
|
21
|
-
import { FONT_WEIGHTS } from "styles/typography"
|
|
22
|
-
import { DO_NOTHING } from "utils/functionHelpers"
|
|
23
|
-
|
|
24
|
-
type Props = {
|
|
25
|
-
checkable?: boolean,
|
|
26
|
-
checkedItems?: Set<ItemKey>,
|
|
27
|
-
columnConfigs: Array<ColumnConfig>,
|
|
28
|
-
hasRowActions?: boolean,
|
|
29
|
-
initialFilterValues?: { [key: string]: string },
|
|
30
|
-
items: Array<Item>,
|
|
31
|
-
onFilterChange?: (name: string, value: any) => void,
|
|
32
|
-
onSelectAllToggle?: (selected: boolean) => void,
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export const Header = ({
|
|
36
|
-
checkable,
|
|
37
|
-
checkedItems,
|
|
38
|
-
columnConfigs,
|
|
39
|
-
hasRowActions,
|
|
40
|
-
initialFilterValues = {},
|
|
41
|
-
items,
|
|
42
|
-
onFilterChange,
|
|
43
|
-
onSelectAllToggle,
|
|
44
|
-
}: Props) => {
|
|
45
|
-
const [enabledFilters, setVisibleFiltersTo] = useState(
|
|
46
|
-
Object.keys(initialFilterValues),
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
const colWidth = columnWidth(columnConfigs.length)
|
|
50
|
-
const allSelected = checkedItems?.size === items.length
|
|
51
|
-
const someSelected = !!checkedItems?.size && !allSelected
|
|
52
|
-
|
|
53
|
-
const handleSelectAll = (checked: boolean) => {
|
|
54
|
-
if (!!onSelectAllToggle) onSelectAllToggle(checked)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const toggleFilter = (name: string) => () => {
|
|
58
|
-
setVisibleFiltersTo((state: string[]) => {
|
|
59
|
-
return state.includes(name)
|
|
60
|
-
? state.filter((s: string) => s !== name)
|
|
61
|
-
: [...state, name]
|
|
62
|
-
})
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return <TableHead>
|
|
66
|
-
<HeaderRow>
|
|
67
|
-
{checkable ? (
|
|
68
|
-
<HeaderCell minimum>
|
|
69
|
-
<Checkbox checked={allSelected}
|
|
70
|
-
indeterminate={someSelected}
|
|
71
|
-
onChange={handleSelectAll} />
|
|
72
|
-
</HeaderCell>
|
|
73
|
-
) : null}
|
|
74
|
-
|
|
75
|
-
{columnConfigs.map(
|
|
76
|
-
({ css, important, name, width, filter }: ColumnConfig) => {
|
|
77
|
-
const color = (p: StyledProps) => important
|
|
78
|
-
? p.theme.styles.colorPrimary
|
|
79
|
-
: "unset"
|
|
80
|
-
const weight = important ? FONT_WEIGHTS.BOLD : FONT_WEIGHTS.BOLD
|
|
81
|
-
const textNode = (
|
|
82
|
-
<Text css={`color: ${color}; font-weight: ${weight};`}>{name}</Text>
|
|
83
|
-
)
|
|
84
|
-
return (
|
|
85
|
-
<HeaderCell key={name}
|
|
86
|
-
css={css}
|
|
87
|
-
width={css ? null : width || colWidth}>
|
|
88
|
-
{
|
|
89
|
-
filter
|
|
90
|
-
? <FlexBlock css={`flex: 1;`}
|
|
91
|
-
spacing={SPACINGS.XS}
|
|
92
|
-
withRows>
|
|
93
|
-
<FlexBlock spacing={SPACINGS.XS}>
|
|
94
|
-
{textNode}
|
|
95
|
-
<IconButton
|
|
96
|
-
icon={mdiFilterVariant}
|
|
97
|
-
iconSize={"1.2rem"}
|
|
98
|
-
inline
|
|
99
|
-
onClick={toggleFilter(filter.name)} />
|
|
100
|
-
</FlexBlock>
|
|
101
|
-
{
|
|
102
|
-
enabledFilters.includes(filter.name)
|
|
103
|
-
? <TableFilter {...filter}
|
|
104
|
-
initialValue={initialFilterValues[filter.name]}
|
|
105
|
-
onChange={onFilterChange ?? DO_NOTHING} />
|
|
106
|
-
: null
|
|
107
|
-
}
|
|
108
|
-
</FlexBlock>
|
|
109
|
-
: textNode
|
|
110
|
-
}
|
|
111
|
-
</HeaderCell>
|
|
112
|
-
)
|
|
113
|
-
},
|
|
114
|
-
)}
|
|
115
|
-
|
|
116
|
-
{hasRowActions ? <HeaderCell menu /> : null}
|
|
117
|
-
</HeaderRow>
|
|
118
|
-
</TableHead>
|
|
119
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { Button, BUTTON_SIZES } from "components/forms/Button"
|
|
2
|
-
import { Carousel } from "components/layout/Carousel"
|
|
3
|
-
import { FlexBox } from "components/layout/FlexBox"
|
|
4
|
-
import { PaginationData } from "components/tables/Table"
|
|
5
|
-
import React from "react"
|
|
6
|
-
import { arrayOfSizeN } from "utils/arrayHelpers"
|
|
7
|
-
import { DO_NOTHING } from "utils/functionHelpers"
|
|
8
|
-
|
|
9
|
-
type Props = PaginationData & {
|
|
10
|
-
onPageChange: (n: number) => void
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const Pagination = ({
|
|
14
|
-
page,
|
|
15
|
-
pageSize,
|
|
16
|
-
totalCount,
|
|
17
|
-
onPageChange,
|
|
18
|
-
}: Props) => {
|
|
19
|
-
if (!totalCount || !pageSize || totalCount <= pageSize) return null
|
|
20
|
-
|
|
21
|
-
const numberPages = Math.ceil(totalCount / pageSize)
|
|
22
|
-
|
|
23
|
-
const getItems = () => {
|
|
24
|
-
const maxNumberCarouselItems = 7
|
|
25
|
-
|
|
26
|
-
if (numberPages <= maxNumberCarouselItems) {
|
|
27
|
-
return arrayOfSizeN(numberPages).map((_, i) => i + 1)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const equilibriumNumberOfPads = Math.floor(maxNumberCarouselItems / 2)
|
|
31
|
-
|
|
32
|
-
const leftPadding = Math.min(
|
|
33
|
-
page - 1,
|
|
34
|
-
equilibriumNumberOfPads,
|
|
35
|
-
)
|
|
36
|
-
const rightPadding = Math.min(
|
|
37
|
-
numberPages - page,
|
|
38
|
-
equilibriumNumberOfPads,
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
const missingFromRight = equilibriumNumberOfPads - rightPadding
|
|
42
|
-
const missingFromLeft = equilibriumNumberOfPads - leftPadding
|
|
43
|
-
|
|
44
|
-
return [
|
|
45
|
-
...arrayOfSizeN(leftPadding + missingFromRight)
|
|
46
|
-
.map((_, i) => page - (i + 1)),
|
|
47
|
-
page,
|
|
48
|
-
...arrayOfSizeN(rightPadding + missingFromLeft)
|
|
49
|
-
.map((_, i) => page + (i + 1)),
|
|
50
|
-
].sort((a, b) => a - b)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const movePage = (direction: number) => () => {
|
|
54
|
-
const newPage = page + direction
|
|
55
|
-
if (1 > newPage || newPage > numberPages) return
|
|
56
|
-
|
|
57
|
-
return onPageChange(newPage)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return <Carousel css={`align-self: center;`}
|
|
61
|
-
disableNextButton={page === numberPages}
|
|
62
|
-
disablePreviousButton={page === 1}
|
|
63
|
-
inline
|
|
64
|
-
onNextClick={movePage(+1)}
|
|
65
|
-
onPreviousClick={movePage(-1)}>
|
|
66
|
-
<FlexBox gap={"unset"}>
|
|
67
|
-
{
|
|
68
|
-
getItems().map((num: number) => (
|
|
69
|
-
<Button
|
|
70
|
-
compact
|
|
71
|
-
flat={num !== page}
|
|
72
|
-
key={num}
|
|
73
|
-
pill
|
|
74
|
-
size={BUTTON_SIZES.SMALL}
|
|
75
|
-
onClick={num === page
|
|
76
|
-
? DO_NOTHING
|
|
77
|
-
: movePage(num - page)}
|
|
78
|
-
>
|
|
79
|
-
{num}
|
|
80
|
-
</Button>
|
|
81
|
-
))
|
|
82
|
-
}
|
|
83
|
-
</FlexBox>
|
|
84
|
-
</Carousel>
|
|
85
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { mdiCheck } from "@mdi/js"
|
|
2
|
-
import { Button, BUTTON_SIZES } from "components/forms/Button"
|
|
3
|
-
import { Selector } from "components/forms/selectors/Selector"
|
|
4
|
-
import { TextField } from "components/forms/textfields/TextField"
|
|
5
|
-
import { FlexBox } from "components/layout/FlexBox"
|
|
6
|
-
import { ItemFilterOptions } from "components/tables/Table"
|
|
7
|
-
import React, { ChangeEvent, useState } from "react"
|
|
8
|
-
import { FONT_WEIGHTS } from "styles/typography"
|
|
9
|
-
import { Logger } from "utils/logging/Logger"
|
|
10
|
-
|
|
11
|
-
const logger = new Logger("TableFilter")
|
|
12
|
-
|
|
13
|
-
type Props = ItemFilterOptions & {
|
|
14
|
-
initialValue?: string,
|
|
15
|
-
onChange: (name: string, value: any) => void,
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const TableFilter = ({
|
|
19
|
-
initialValue,
|
|
20
|
-
name,
|
|
21
|
-
options,
|
|
22
|
-
type,
|
|
23
|
-
onChange,
|
|
24
|
-
}: Props) => {
|
|
25
|
-
const [value, setValue] = useState<string>(initialValue ?? "")
|
|
26
|
-
|
|
27
|
-
const onTextChange = (e: ChangeEvent<HTMLInputElement>) => {
|
|
28
|
-
setValue(e.target.value)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
logger.writeInfo("render", name, value)
|
|
32
|
-
|
|
33
|
-
const filter = type === "select"
|
|
34
|
-
? <Selector clearable
|
|
35
|
-
css={`font-weight: ${FONT_WEIGHTS.REGULAR};`}
|
|
36
|
-
keyField={"value"}
|
|
37
|
-
options={options!!}
|
|
38
|
-
selectedKey={value}
|
|
39
|
-
small
|
|
40
|
-
valueField={"label"}
|
|
41
|
-
// @ts-ignore
|
|
42
|
-
onChange={setValue} />
|
|
43
|
-
: <TextField small
|
|
44
|
-
value={value}
|
|
45
|
-
onChange={onTextChange} />
|
|
46
|
-
|
|
47
|
-
return <FlexBox withRows>
|
|
48
|
-
{filter}
|
|
49
|
-
<Button compact
|
|
50
|
-
css={`align-self: flex-end;`}
|
|
51
|
-
icon={mdiCheck}
|
|
52
|
-
iconSize={"1rem"}
|
|
53
|
-
size={BUTTON_SIZES.SMALL}
|
|
54
|
-
onClick={() => onChange(name, value)} />
|
|
55
|
-
</FlexBox>
|
|
56
|
-
}
|