@decisiv/ui-components 2.0.1-alpha.20 → 2.0.1-alpha.201
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/atoms/BaseButton/index.d.ts.map +1 -1
- package/lib/atoms/BaseButton/index.js +1 -1
- package/lib/atoms/BooleanInput/elements.d.ts.map +1 -1
- package/lib/atoms/BooleanInput/elements.js +8 -3
- package/lib/atoms/BooleanInput/index.d.ts.map +1 -1
- package/lib/atoms/BooleanInput/index.js +26 -5
- package/lib/atoms/BooleanInput/index.test.js +17 -6
- package/lib/atoms/BooleanInput/types.d.ts +4 -0
- package/lib/atoms/BooleanInput/types.d.ts.map +1 -1
- package/lib/atoms/BooleanInput/types.js +5 -1
- package/lib/atoms/Calendar/hooks/useCalendar/index.d.ts.map +1 -1
- package/lib/atoms/Calendar/hooks/useCalendar/index.js +2 -1
- package/lib/atoms/Calendar/hooks/useCalendar/index.test.js +5 -6
- package/lib/atoms/Calendar/index.d.ts.map +1 -1
- package/lib/atoms/Calendar/index.js +46 -6
- package/lib/atoms/Calendar/index.test.js +68 -38
- package/lib/atoms/Calendar/types.d.ts +1 -1
- package/lib/atoms/Calendar/types.d.ts.map +1 -1
- package/lib/atoms/Calendar/types.js +5 -1
- package/lib/atoms/InputField/Containers.d.ts +12 -6
- package/lib/atoms/InputField/Containers.d.ts.map +1 -1
- package/lib/atoms/InputField/Containers.js +8 -6
- package/lib/atoms/InputField/HelpMessage.d.ts +1 -1
- package/lib/atoms/InputField/HelpMessage.d.ts.map +1 -1
- package/lib/atoms/InputField/HelpMessage.js +2 -1
- package/lib/atoms/InputField/InputLabel.d.ts +1 -0
- package/lib/atoms/InputField/InputLabel.d.ts.map +1 -1
- package/lib/atoms/InputField/InputLabel.js +2 -1
- package/lib/atoms/InputField/index.d.ts +8 -1
- package/lib/atoms/InputField/index.d.ts.map +1 -1
- package/lib/atoms/InputField/index.js +27 -9
- package/lib/atoms/InputField/index.test.js +91 -0
- package/lib/atoms/InputField/schema.d.ts.map +1 -1
- package/lib/atoms/InputField/schema.js +3 -2
- package/lib/atoms/OptionsList/Category/index.d.ts +4 -0
- package/lib/atoms/OptionsList/Category/index.d.ts.map +1 -0
- package/lib/atoms/OptionsList/{Category.js → Category/index.js} +13 -21
- package/lib/atoms/OptionsList/Category/styles.d.ts +6 -0
- package/lib/atoms/OptionsList/Category/styles.d.ts.map +1 -0
- package/lib/atoms/OptionsList/Category/styles.js +36 -0
- package/lib/atoms/OptionsList/{Option.d.ts → Option/index.d.ts} +2 -2
- package/lib/atoms/OptionsList/Option/index.d.ts.map +1 -0
- package/lib/atoms/OptionsList/Option/index.js +169 -0
- package/lib/atoms/OptionsList/Option/styles.d.ts +17 -0
- package/lib/atoms/OptionsList/Option/styles.d.ts.map +1 -0
- package/lib/atoms/OptionsList/Option/styles.js +83 -0
- package/lib/atoms/OptionsList/index.d.ts.map +1 -1
- package/lib/atoms/OptionsList/index.js +16 -7
- package/lib/atoms/OptionsList/index.test.js +249 -156
- package/lib/atoms/OptionsList/schema.d.ts.map +1 -1
- package/lib/atoms/OptionsList/schema.js +3 -1
- package/lib/atoms/OptionsList/types.d.ts +23 -0
- package/lib/atoms/OptionsList/types.d.ts.map +1 -1
- package/lib/atoms/OptionsList/types.js +5 -1
- package/lib/atoms/RequiredIcon.d.ts +9 -0
- package/lib/atoms/RequiredIcon.d.ts.map +1 -0
- package/lib/atoms/{InputField/RequiredIcon.js → RequiredIcon.js} +7 -3
- package/lib/components/Accordion/types.js +5 -1
- package/lib/components/Accordion/useAccordion/types.js +5 -1
- package/lib/components/Alert/Container.d.ts +201 -0
- package/lib/components/Alert/Container.d.ts.map +1 -0
- package/lib/components/Alert/Container.js +26 -0
- package/lib/components/Alert/StyledButton.d.ts +5 -0
- package/lib/components/Alert/StyledButton.d.ts.map +1 -0
- package/lib/components/Alert/StyledButton.js +23 -0
- package/lib/components/Alert/index.d.ts +27 -0
- package/lib/components/Alert/index.d.ts.map +1 -0
- package/lib/components/Alert/index.js +112 -0
- package/lib/components/Alert/index.test.js +79 -0
- package/lib/components/Alert/intents.d.ts +13 -0
- package/lib/components/Alert/intents.d.ts.map +1 -0
- package/lib/components/Alert/intents.js +72 -0
- package/lib/components/{Tabs/schema.tab.d.ts → Alert/schema.d.ts} +1 -1
- package/lib/components/Alert/schema.d.ts.map +1 -0
- package/lib/components/Alert/schema.js +25 -0
- package/lib/components/Alert/types.d.ts +36 -0
- package/lib/components/Alert/types.d.ts.map +1 -0
- package/lib/components/Alert/types.js +32 -0
- package/lib/components/Avatar/AvatarContainer.d.ts +1 -13
- package/lib/components/Avatar/AvatarContainer.d.ts.map +1 -1
- package/lib/components/Avatar/AvatarContainer.js +12 -13
- package/lib/components/Avatar/AvatarContent.d.ts +2 -2
- package/lib/components/Avatar/AvatarContent.d.ts.map +1 -1
- package/lib/components/Avatar/AvatarContent.js +24 -20
- package/lib/components/Avatar/index.d.ts.map +1 -1
- package/lib/components/Avatar/index.js +39 -5
- package/lib/components/Avatar/index.test.js +4 -0
- package/lib/components/Avatar/schema.d.ts.map +1 -1
- package/lib/components/Avatar/schema.js +3 -1
- package/lib/components/Avatar/types.d.ts +15 -2
- package/lib/components/Avatar/types.d.ts.map +1 -1
- package/lib/components/Avatar/types.js +5 -1
- package/lib/components/Badge/constants.d.ts +2 -0
- package/lib/components/Badge/constants.d.ts.map +1 -0
- package/lib/components/Badge/constants.js +29 -0
- package/lib/components/Badge/index.d.ts.map +1 -1
- package/lib/components/Badge/index.js +3 -70
- package/lib/components/Badge/index.test.js +62 -8
- package/lib/components/Badge/schema.d.ts.map +1 -1
- package/lib/components/Badge/schema.js +2 -1
- package/lib/components/Badge/styles.d.ts +3 -0
- package/lib/components/Badge/styles.d.ts.map +1 -0
- package/lib/components/Badge/styles.js +96 -0
- package/lib/components/Badge/types.d.ts +3 -2
- package/lib/components/Badge/types.d.ts.map +1 -1
- package/lib/components/Badge/types.js +7 -3
- package/lib/components/Breadcrumbs/types.js +5 -1
- package/lib/components/Button/StyledButton.d.ts +3 -6
- package/lib/components/Button/StyledButton.d.ts.map +1 -1
- package/lib/components/Button/StyledButton.js +39 -11
- package/lib/components/Button/index.d.ts.map +1 -1
- package/lib/components/Button/index.js +51 -12
- package/lib/components/Button/index.test.js +43 -8
- package/lib/components/Button/schema.d.ts.map +1 -1
- package/lib/components/Button/schema.js +4 -1
- package/lib/components/Button/types.d.ts +4 -1
- package/lib/components/Button/types.d.ts.map +1 -1
- package/lib/components/Button/types.js +5 -1
- package/lib/components/Checkbox/index.d.ts.map +1 -1
- package/lib/components/Checkbox/index.js +3 -1
- package/lib/components/Checkbox/schema.d.ts.map +1 -1
- package/lib/components/Checkbox/schema.js +2 -0
- package/lib/components/CheckboxGroup/index.d.ts +1 -1
- package/lib/components/Combobox/Target.d.ts.map +1 -1
- package/lib/components/Combobox/Target.js +52 -14
- package/lib/components/Combobox/index.d.ts.map +1 -1
- package/lib/components/Combobox/index.js +217 -85
- package/lib/components/Combobox/index.test.js +370 -147
- package/lib/components/Combobox/schema.d.ts.map +1 -1
- package/lib/components/Combobox/schema.js +10 -2
- package/lib/components/Combobox/types.d.ts +12 -3
- package/lib/components/Combobox/types.d.ts.map +1 -1
- package/lib/components/Combobox/types.js +5 -1
- package/lib/components/Drawer/index.d.ts +22 -0
- package/lib/components/Drawer/index.d.ts.map +1 -0
- package/lib/components/Drawer/index.js +115 -0
- package/lib/components/Drawer/index.test.js +139 -0
- package/lib/components/Drawer/schema.d.ts +3 -0
- package/lib/components/Drawer/schema.d.ts.map +1 -0
- package/lib/components/Drawer/schema.js +32 -0
- package/lib/components/Drawer/styles.d.ts +11 -0
- package/lib/components/Drawer/styles.d.ts.map +1 -0
- package/lib/components/Drawer/styles.js +79 -0
- package/lib/components/DropdownList/index.d.ts +1 -0
- package/lib/components/DropdownList/index.d.ts.map +1 -1
- package/lib/components/DropdownList/index.js +70 -22
- package/lib/components/DropdownList/propTypes.d.ts +4 -0
- package/lib/components/DropdownList/propTypes.d.ts.map +1 -0
- package/lib/components/DropdownList/propTypes.js +42 -0
- package/lib/components/DropdownList/schema.d.ts.map +1 -1
- package/lib/components/DropdownList/schema.js +2 -1
- package/lib/components/DropdownList/types.d.ts +2 -0
- package/lib/components/DropdownList/types.d.ts.map +1 -1
- package/lib/components/Filter/ActionFilter/index.d.ts +5 -0
- package/lib/components/Filter/ActionFilter/index.d.ts.map +1 -0
- package/lib/components/Filter/ActionFilter/index.js +43 -0
- package/lib/components/Filter/IconWrapper/index.d.ts +197 -0
- package/lib/components/Filter/IconWrapper/index.d.ts.map +1 -0
- package/lib/components/Filter/IconWrapper/index.js +35 -0
- package/lib/components/Filter/SimplePrimary/index.d.ts +5 -0
- package/lib/components/Filter/SimplePrimary/index.d.ts.map +1 -0
- package/lib/components/Filter/SimplePrimary/index.js +46 -0
- package/lib/components/Filter/SimplePrimary/index.test.js +34 -0
- package/lib/components/Filter/StyledFilter.d.ts +4 -0
- package/lib/components/Filter/StyledFilter.d.ts.map +1 -0
- package/lib/components/Filter/StyledFilter.js +66 -0
- package/lib/components/Filter/StyledLabel/index.d.ts +8 -0
- package/lib/components/Filter/StyledLabel/index.d.ts.map +1 -0
- package/lib/components/Filter/StyledLabel/index.js +38 -0
- package/lib/components/Filter/index.d.ts +6 -0
- package/lib/components/Filter/index.d.ts.map +1 -0
- package/lib/components/Filter/index.js +107 -0
- package/lib/components/Filter/index.test.js +70 -0
- package/lib/components/Filter/kind.d.ts +7 -0
- package/lib/components/Filter/kind.d.ts.map +1 -0
- package/lib/components/Filter/kind.js +43 -0
- package/lib/components/Filter/schema.d.ts +9 -0
- package/lib/components/Filter/schema.d.ts.map +1 -0
- package/lib/components/Filter/schema.js +37 -0
- package/lib/components/Filter/types.d.ts +31 -0
- package/lib/components/Filter/types.d.ts.map +1 -0
- package/lib/components/Filter/types.js +5 -0
- package/lib/components/JumpTo/JumpToMenu.d.ts +2 -2
- package/lib/components/JumpTo/JumpToMenu.d.ts.map +1 -1
- package/lib/components/JumpTo/JumpToMenu.js +53 -12
- package/lib/components/JumpTo/index.test.js +84 -0
- package/lib/components/JumpTo/schema.d.ts.map +1 -1
- package/lib/components/JumpTo/schema.js +2 -1
- package/lib/components/JumpTo/types.d.ts +1 -0
- package/lib/components/JumpTo/types.d.ts.map +1 -1
- package/lib/components/JumpTo/types.js +5 -1
- package/lib/components/JumpTo/utils.d.ts.map +1 -1
- package/lib/components/JumpTo/utils.js +3 -7
- package/lib/components/LeftNav/Item/ClickArea.js +1 -1
- package/lib/components/LeftNav/Item/ItemWrapper.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/ItemWrapper.js +3 -1
- package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts +7 -0
- package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts.map +1 -0
- package/lib/components/LeftNav/Item/MenuItemWrapper.js +20 -0
- package/lib/components/LeftNav/Item/NavCollapsedXItem/index.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/NavCollapsedXItem/index.js +7 -5
- package/lib/components/LeftNav/Item/NavExpandedItem/index.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/NavExpandedItem/index.js +24 -13
- package/lib/components/LeftNav/Item/types.d.ts +1 -1
- package/lib/components/LeftNav/Item/types.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/types.js +5 -1
- package/lib/components/LeftNav/index.test.js +13 -3
- package/lib/components/LeftNav/schema.d.ts.map +1 -1
- package/lib/components/LeftNav/schema.js +2 -0
- package/lib/components/LeftNav/types.d.ts +1 -0
- package/lib/components/LeftNav/types.d.ts.map +1 -1
- package/lib/components/LeftNav/types.js +5 -1
- package/lib/components/Link/DisabledLink.d.ts +7 -0
- package/lib/components/Link/DisabledLink.d.ts.map +1 -0
- package/lib/components/Link/DisabledLink.js +46 -0
- package/lib/components/Link/Link.d.ts +4 -0
- package/lib/components/Link/Link.d.ts.map +1 -0
- package/lib/components/Link/Link.js +67 -0
- package/lib/components/Link/index.d.ts +4 -23
- package/lib/components/Link/index.d.ts.map +1 -1
- package/lib/components/Link/index.js +20 -158
- package/lib/components/Link/index.test.js +63 -42
- package/lib/components/Link/schema.d.ts.map +1 -1
- package/lib/components/Link/schema.js +2 -1
- package/lib/components/Link/styles.d.ts +20 -0
- package/lib/components/Link/styles.d.ts.map +1 -0
- package/lib/components/Link/styles.js +131 -0
- package/lib/components/Link/types.d.ts +28 -0
- package/lib/components/Link/types.d.ts.map +1 -0
- package/lib/components/Link/types.js +5 -0
- package/lib/components/Loading/Loading.d.ts +12 -0
- package/lib/components/Loading/Loading.d.ts.map +1 -0
- package/lib/components/Loading/Loading.js +70 -0
- package/lib/components/Loading/index.d.ts +4 -0
- package/lib/components/Loading/index.d.ts.map +1 -0
- package/lib/components/Loading/index.js +33 -0
- package/lib/components/Loading/index.test.js +55 -0
- package/lib/components/Loading/schema.d.ts +4 -0
- package/lib/components/Loading/schema.d.ts.map +1 -0
- package/lib/components/Loading/schema.js +31 -0
- package/lib/components/Loading/styles.d.ts +211 -0
- package/lib/components/Loading/styles.d.ts.map +1 -0
- package/lib/components/Loading/styles.js +77 -0
- package/lib/components/Loading/types.d.ts +10 -0
- package/lib/components/Loading/types.d.ts.map +1 -0
- package/lib/components/Loading/types.js +5 -0
- package/lib/components/Menu/types.js +5 -1
- package/lib/components/Modal/Manager.d.ts +6 -0
- package/lib/components/Modal/Manager.d.ts.map +1 -0
- package/lib/components/Modal/Manager.js +53 -0
- package/lib/components/Modal/ResponsiveModalWrapper.d.ts +11 -0
- package/lib/components/Modal/ResponsiveModalWrapper.d.ts.map +1 -0
- package/lib/components/Modal/ResponsiveModalWrapper.js +82 -0
- package/lib/components/Modal/components.d.ts +201 -3
- package/lib/components/Modal/components.d.ts.map +1 -1
- package/lib/components/Modal/components.js +16 -24
- package/lib/components/Modal/index.d.ts +8 -4
- package/lib/components/Modal/index.d.ts.map +1 -1
- package/lib/components/Modal/index.js +56 -95
- package/lib/components/Modal/index.test.js +26 -0
- package/lib/components/Modal/schema.d.ts.map +1 -1
- package/lib/components/Modal/schema.js +2 -1
- package/lib/components/Modal/types.d.ts +2 -1
- package/lib/components/Modal/types.d.ts.map +1 -1
- package/lib/components/Modal/types.js +5 -1
- package/lib/components/Modal/utils.d.ts +1 -1
- package/lib/components/Modal/utils.d.ts.map +1 -1
- package/lib/components/Modal/utils.js +7 -5
- package/lib/components/Notifications/Notification/components.d.ts +3 -3
- package/lib/components/Notifications/Notification/components.d.ts.map +1 -1
- package/lib/components/Notifications/Notification/components.js +12 -6
- package/lib/components/Notifications/Notification/index.d.ts +3 -6
- package/lib/components/Notifications/Notification/index.d.ts.map +1 -1
- package/lib/components/Notifications/Notification/index.js +19 -12
- package/lib/components/Notifications/Notification/index.test.js +38 -19
- package/lib/components/Notifications/NotificationsPanel/index.d.ts +2 -1
- package/lib/components/Notifications/NotificationsPanel/index.d.ts.map +1 -1
- package/lib/components/Notifications/NotificationsPanel/index.js +41 -22
- package/lib/components/Notifications/NotificationsPanel/schema.js +1 -1
- package/lib/components/Notifications/Notifier.test.js +79 -10
- package/lib/components/Notifications/constants.d.ts +2 -0
- package/lib/components/Notifications/constants.d.ts.map +1 -0
- package/lib/components/Notifications/constants.js +16 -0
- package/lib/components/Notifications/schema.d.ts.map +1 -1
- package/lib/components/Notifications/schema.js +2 -1
- package/lib/components/Notifications/useNotifications.d.ts +1 -0
- package/lib/components/Notifications/useNotifications.d.ts.map +1 -1
- package/lib/components/Notifications/useNotifications.test.js +7 -4
- package/lib/components/Pagination/Pagination.d.ts +1 -1
- package/lib/components/Pagination/Pagination.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.js +1 -0
- package/lib/components/Pagination/Pagination.test.js +9 -0
- package/lib/components/Pagination/types.js +5 -1
- package/lib/components/PasswordField/IconWrapper.d.ts +198 -0
- package/lib/components/PasswordField/IconWrapper.d.ts.map +1 -0
- package/lib/components/PasswordField/IconWrapper.js +32 -0
- package/lib/components/PasswordField/Input.d.ts +6 -0
- package/lib/components/PasswordField/Input.d.ts.map +1 -0
- package/lib/components/PasswordField/Input.js +28 -0
- package/lib/components/PasswordField/ShowPasswordButton.d.ts +8 -0
- package/lib/components/PasswordField/ShowPasswordButton.d.ts.map +1 -0
- package/lib/components/PasswordField/ShowPasswordButton.js +48 -0
- package/lib/components/PasswordField/index.d.ts +14 -0
- package/lib/components/PasswordField/index.d.ts.map +1 -0
- package/lib/components/PasswordField/index.js +113 -0
- package/lib/components/PasswordField/index.test.js +217 -0
- package/lib/components/PasswordField/schema.d.ts +3 -0
- package/lib/components/PasswordField/schema.d.ts.map +1 -0
- package/lib/components/PasswordField/schema.js +27 -0
- package/lib/components/Popover/Arrow.d.ts +2 -2
- package/lib/components/Popover/index.d.ts.map +1 -1
- package/lib/components/Popover/index.js +9 -5
- package/lib/components/Popover/schema.d.ts.map +1 -1
- package/lib/components/Popover/schema.js +27 -20
- package/lib/components/Popover/types.d.ts +4 -2
- package/lib/components/Popover/types.d.ts.map +1 -1
- package/lib/components/Popover/utils.d.ts +1 -1
- package/lib/components/SearchInput/index.d.ts +11 -0
- package/lib/components/SearchInput/index.d.ts.map +1 -0
- package/lib/components/SearchInput/index.js +176 -0
- package/lib/components/SearchInput/index.test.js +660 -0
- package/lib/components/SearchInput/schema.d.ts +3 -0
- package/lib/components/SearchInput/schema.d.ts.map +1 -0
- package/lib/components/SearchInput/schema.js +37 -0
- package/lib/components/SearchInput/styles.d.ts +1176 -0
- package/lib/components/SearchInput/styles.d.ts.map +1 -0
- package/lib/components/SearchInput/styles.js +97 -0
- package/lib/components/SearchInput/types.d.ts +38 -0
- package/lib/components/SearchInput/types.d.ts.map +1 -0
- package/lib/components/SearchInput/types.js +5 -0
- package/lib/components/Select/Target.d.ts.map +1 -1
- package/lib/components/Select/Target.js +6 -2
- package/lib/components/Select/index.d.ts.map +1 -1
- package/lib/components/Select/index.js +26 -3
- package/lib/components/Select/index.test.js +106 -23
- package/lib/components/Select/schema.d.ts.map +1 -1
- package/lib/components/Select/schema.js +5 -0
- package/lib/components/Select/types.d.ts +6 -3
- package/lib/components/Select/types.d.ts.map +1 -1
- package/lib/components/Select/types.js +5 -1
- package/lib/components/SelectDate/Target.d.ts.map +1 -1
- package/lib/components/SelectDate/Target.js +6 -2
- package/lib/components/SelectDate/index.d.ts.map +1 -1
- package/lib/components/SelectDate/index.js +32 -3
- package/lib/components/SelectDate/index.test.js +108 -51
- package/lib/components/SelectDate/schema.d.ts.map +1 -1
- package/lib/components/SelectDate/schema.js +3 -0
- package/lib/components/SelectDate/types.d.ts +3 -0
- package/lib/components/SelectDate/types.d.ts.map +1 -1
- package/lib/components/SelectDate/types.js +5 -1
- package/lib/components/SelectDateRange/index.d.ts.map +1 -1
- package/lib/components/SelectDateRange/index.js +31 -2
- package/lib/components/SelectDateRange/index.test.js +115 -58
- package/lib/components/SelectDateRange/schema.d.ts.map +1 -1
- package/lib/components/SelectDateRange/schema.js +3 -0
- package/lib/components/SelectDateRange/types.js +5 -1
- package/lib/components/StepTracker/index.d.ts +11 -0
- package/lib/components/StepTracker/index.d.ts.map +1 -0
- package/lib/components/StepTracker/index.js +56 -0
- package/lib/components/StepTracker/index.test.js +89 -0
- package/lib/components/StepTracker/schema.d.ts +3 -0
- package/lib/components/StepTracker/schema.d.ts.map +1 -0
- package/lib/components/StepTracker/schema.js +19 -0
- package/lib/components/StepTracker/styles.d.ts +605 -0
- package/lib/components/StepTracker/styles.d.ts.map +1 -0
- package/lib/components/StepTracker/styles.js +114 -0
- package/lib/components/Table/Body.d.ts.map +1 -1
- package/lib/components/Table/Body.js +28 -17
- package/lib/components/Table/Container.d.ts.map +1 -1
- package/lib/components/Table/Container.js +6 -1
- package/lib/components/Table/DataRow.d.ts.map +1 -1
- package/lib/components/Table/DataRow.js +26 -18
- package/lib/components/Table/Head.d.ts +1 -1
- package/lib/components/Table/Head.d.ts.map +1 -1
- package/lib/components/Table/Head.js +10 -5
- package/lib/components/Table/HeaderCell/index.d.ts.map +1 -1
- package/lib/components/Table/HeaderCell/index.js +19 -6
- package/lib/components/Table/HeaderCell/types.d.ts +6 -1
- package/lib/components/Table/HeaderCell/types.d.ts.map +1 -1
- package/lib/components/Table/HeaderCell/types.js +5 -1
- package/lib/components/Table/Provider.d.ts +5 -5
- package/lib/components/Table/Provider.d.ts.map +1 -1
- package/lib/components/Table/Provider.js +10 -11
- package/lib/components/Table/index.d.ts.map +1 -1
- package/lib/components/Table/index.js +110 -20
- package/lib/components/Table/index.test.js +80 -33
- package/lib/components/Table/schema.columns.d.ts.map +1 -1
- package/lib/components/Table/schema.columns.js +6 -4
- package/lib/components/Table/schema.d.ts.map +1 -1
- package/lib/components/Table/schema.js +7 -6
- package/lib/components/Table/types.d.ts +19 -4
- package/lib/components/Table/types.d.ts.map +1 -1
- package/lib/components/Table/utils.d.ts +2 -8
- package/lib/components/Table/utils.d.ts.map +1 -1
- package/lib/components/Table/utils.js +21 -20
- package/lib/components/Tabs/Tab/index.d.ts +13 -0
- package/lib/components/Tabs/Tab/index.d.ts.map +1 -0
- package/lib/components/Tabs/Tab/index.js +94 -0
- package/lib/components/Tabs/Tab/schema.d.ts +3 -0
- package/lib/components/Tabs/Tab/schema.d.ts.map +1 -0
- package/lib/components/Tabs/Tab/styles.d.ts +7 -0
- package/lib/components/Tabs/Tab/styles.d.ts.map +1 -0
- package/lib/components/Tabs/Tab/styles.js +37 -0
- package/lib/components/Tabs/context.d.ts +2 -2
- package/lib/components/Tabs/context.d.ts.map +1 -1
- package/lib/components/Tabs/context.js +1 -1
- package/lib/components/Tabs/index.d.ts +17 -6
- package/lib/components/Tabs/index.d.ts.map +1 -1
- package/lib/components/Tabs/index.js +104 -163
- package/lib/components/Tabs/index.test.js +54 -2
- package/lib/components/Tabs/styles.d.ts +4 -0
- package/lib/components/Tabs/styles.d.ts.map +1 -0
- package/lib/components/Tabs/styles.js +35 -0
- package/lib/components/Tag/Action.d.ts +4 -0
- package/lib/components/Tag/Action.d.ts.map +1 -0
- package/lib/components/Tag/Action.js +39 -0
- package/lib/components/Tag/constants.d.ts +2 -2
- package/lib/components/Tag/constants.d.ts.map +1 -1
- package/lib/components/Tag/constants.js +4 -4
- package/lib/components/Tag/index.d.ts +1 -3
- package/lib/components/Tag/index.d.ts.map +1 -1
- package/lib/components/Tag/index.js +40 -97
- package/lib/components/Tag/index.test.js +239 -2
- package/lib/components/Tag/propTypes.d.ts +4 -1
- package/lib/components/Tag/propTypes.d.ts.map +1 -1
- package/lib/components/Tag/propTypes.js +5 -2
- package/lib/components/Tag/schema.d.ts.map +1 -1
- package/lib/components/Tag/schema.js +2 -0
- package/lib/components/Tag/styles.d.ts +13 -0
- package/lib/components/Tag/styles.d.ts.map +1 -0
- package/lib/components/Tag/styles.js +133 -0
- package/lib/components/Tag/types.d.ts +9 -10
- package/lib/components/Tag/types.d.ts.map +1 -1
- package/lib/components/Tag/types.js +5 -1
- package/lib/components/TagInput/index.d.ts +10 -0
- package/lib/components/TagInput/index.d.ts.map +1 -0
- package/lib/components/TagInput/index.js +217 -0
- package/lib/components/TagInput/index.test.js +1001 -0
- package/lib/components/TagInput/schema.d.ts +3 -0
- package/lib/components/TagInput/schema.d.ts.map +1 -0
- package/lib/components/TagInput/schema.js +30 -0
- package/lib/components/TagInput/styles.d.ts +10 -0
- package/lib/components/TagInput/styles.d.ts.map +1 -0
- package/lib/components/TagInput/styles.js +52 -0
- package/lib/components/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.js +1 -1
- package/lib/components/TextArea/index.js +1 -0
- package/lib/components/TextArea/index.test.js +5 -0
- package/lib/components/TextField/Input.js +1 -1
- package/lib/components/TextField/index.test.js +5 -0
- package/lib/components/Toggle/Fieldset.d.ts.map +1 -1
- package/lib/components/Toggle/Fieldset.js +20 -11
- package/lib/components/Toggle/Option.d.ts.map +1 -1
- package/lib/components/Toggle/Option.js +1 -1
- package/lib/components/Toggle/Slider.d.ts +1 -3
- package/lib/components/Toggle/Slider.d.ts.map +1 -1
- package/lib/components/Toggle/Slider.js +29 -24
- package/lib/components/Toggle/index.d.ts.map +1 -1
- package/lib/components/Toggle/index.js +6 -1
- package/lib/components/Toggle/index.test.js +39 -10
- package/lib/components/Toggle/propTypes.js +1 -1
- package/lib/components/Toggle/schema.js +1 -1
- package/lib/components/Toggle/types.d.ts +3 -2
- package/lib/components/Toggle/types.d.ts.map +1 -1
- package/lib/components/Toggle/types.js +5 -1
- package/lib/components/ToggleView/ToggleView.d.ts +5 -0
- package/lib/components/ToggleView/ToggleView.d.ts.map +1 -0
- package/lib/components/ToggleView/ToggleView.js +80 -0
- package/lib/components/ToggleView/index.d.ts +4 -0
- package/lib/components/ToggleView/index.d.ts.map +1 -0
- package/lib/components/ToggleView/index.js +33 -0
- package/lib/components/ToggleView/index.test.js +61 -0
- package/lib/components/ToggleView/schema.d.ts +3 -0
- package/lib/components/ToggleView/schema.d.ts.map +1 -0
- package/lib/components/ToggleView/schema.js +24 -0
- package/lib/components/ToggleView/styles.d.ts +6 -0
- package/lib/components/ToggleView/styles.d.ts.map +1 -0
- package/lib/components/ToggleView/styles.js +23 -0
- package/lib/components/ToggleView/types.d.ts +23 -0
- package/lib/components/ToggleView/types.d.ts.map +1 -0
- package/lib/components/ToggleView/types.js +12 -0
- package/lib/components/Tooltip/index.d.ts.map +1 -1
- package/lib/components/Tooltip/index.js +3 -13
- package/lib/components/Tooltip/schema.d.ts +3 -0
- package/lib/components/Tooltip/schema.d.ts.map +1 -0
- package/lib/components/Tooltip/schema.js +29 -0
- package/lib/components/Typography/withColors.d.ts +1 -1
- package/lib/components/Typography/withColors.d.ts.map +1 -1
- package/lib/components/Typography/withColors.js +1 -1
- package/lib/components/Wizard/index.d.ts +24 -0
- package/lib/components/Wizard/index.d.ts.map +1 -0
- package/lib/components/Wizard/index.js +146 -0
- package/lib/components/Wizard/index.test.js +591 -0
- package/lib/components/Wizard/schema.d.ts +3 -0
- package/lib/components/Wizard/schema.d.ts.map +1 -0
- package/lib/components/Wizard/schema.js +37 -0
- package/lib/components/Wizard/styles.d.ts +990 -0
- package/lib/components/Wizard/styles.d.ts.map +1 -0
- package/lib/components/Wizard/styles.js +79 -0
- package/lib/components/index.d.ts +11 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +182 -1
- package/lib/modifiers/palette.d.ts +36 -0
- package/lib/modifiers/palette.d.ts.map +1 -0
- package/lib/modifiers/palette.js +88 -0
- package/lib/modifiers/spacingSchema.d.ts.map +1 -1
- package/lib/modifiers/spacingSchema.js +29 -16
- package/lib/providers/ConfigProvider/index.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/index.js +5 -1
- package/lib/providers/ConfigProvider/utils/context.d.ts +1 -1
- package/lib/providers/ConfigProvider/utils/context.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/normalizer.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/normalizer.js +1 -1
- package/lib/providers/ConfigProvider/utils/translations.d.ts +40 -0
- package/lib/providers/ConfigProvider/utils/translations.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/translations.js +40 -0
- package/lib/providers/NotificationsProvider/index.d.ts +6 -5
- package/lib/providers/NotificationsProvider/index.d.ts.map +1 -1
- package/lib/providers/NotificationsProvider/index.js +47 -28
- package/lib/providers/NotificationsProvider/types.d.ts +4 -1
- package/lib/providers/NotificationsProvider/types.d.ts.map +1 -1
- package/lib/utils/commonUIColors.d.ts +351 -3
- package/lib/utils/commonUIColors.d.ts.map +1 -1
- package/lib/utils/commonUIColors.js +6 -2
- package/lib/utils/joinClassnames.d.ts +3 -0
- package/lib/utils/joinClassnames.d.ts.map +1 -0
- package/lib/utils/joinClassnames.js +26 -0
- package/lib/utils/useDebounce.d.ts +2 -0
- package/lib/utils/useDebounce.d.ts.map +1 -0
- package/lib/utils/useDebounce.js +37 -0
- package/lib/utils/useFirstMount.d.ts +2 -0
- package/lib/utils/useFirstMount.d.ts.map +1 -0
- package/lib/utils/useFirstMount.js +19 -0
- package/lib/utils/useUpdateEffect.d.ts +4 -0
- package/lib/utils/useUpdateEffect.d.ts.map +1 -0
- package/lib/utils/useUpdateEffect.js +28 -0
- package/package.json +2 -2
- package/CHANGELOG.md +0 -796
- package/lib/atoms/InputField/RequiredIcon.d.ts +0 -4
- package/lib/atoms/InputField/RequiredIcon.d.ts.map +0 -1
- package/lib/atoms/OptionsList/Category.d.ts +0 -4
- package/lib/atoms/OptionsList/Category.d.ts.map +0 -1
- package/lib/atoms/OptionsList/Option.d.ts.map +0 -1
- package/lib/atoms/OptionsList/Option.js +0 -194
- package/lib/components/Tabs/Tab.d.ts +0 -5
- package/lib/components/Tabs/Tab.d.ts.map +0 -1
- package/lib/components/Tabs/Tab.js +0 -109
- package/lib/components/Tabs/schema.tab.d.ts.map +0 -1
- package/lib/components/Tabs/types.d.ts +0 -27
- package/lib/components/Tabs/types.d.ts.map +0 -1
- package/lib/components/Tabs/types.js +0 -1
- package/lib/components/Tag/ActionButton.d.ts +0 -5
- package/lib/components/Tag/ActionButton.d.ts.map +0 -1
- package/lib/components/Tag/ActionButton.js +0 -56
- /package/lib/components/Tabs/{schema.tab.js → Tab/schema.js} +0 -0
|
@@ -63,6 +63,8 @@ var _types = require("./types");
|
|
|
63
63
|
|
|
64
64
|
var _utils = require("./utils");
|
|
65
65
|
|
|
66
|
+
var _Grip = _interopRequireDefault(require("./Grip"));
|
|
67
|
+
|
|
66
68
|
var _useSortableHeaders = require("./hooks/useSortableHeaders");
|
|
67
69
|
|
|
68
70
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
@@ -71,6 +73,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
71
73
|
|
|
72
74
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
73
75
|
|
|
76
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
77
|
+
|
|
78
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
79
|
+
|
|
80
|
+
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
|
81
|
+
|
|
82
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
|
83
|
+
|
|
74
84
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; }
|
|
75
85
|
|
|
76
86
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
@@ -94,9 +104,11 @@ function Table(props) {
|
|
|
94
104
|
defaultSort = props.defaultSort,
|
|
95
105
|
footer = props.footer,
|
|
96
106
|
toolbar = props.toolbar,
|
|
97
|
-
|
|
107
|
+
columnsProp = props.columns,
|
|
98
108
|
onDragEnd = props.onDragEnd,
|
|
99
|
-
|
|
109
|
+
_props$dragVariant = props.dragVariant,
|
|
110
|
+
dragVariant = _props$dragVariant === void 0 ? 'row' : _props$dragVariant,
|
|
111
|
+
rest = _objectWithoutProperties(props, ["data", "defaultSort", "footer", "toolbar", "columns", "onDragEnd", "dragVariant"]);
|
|
100
112
|
|
|
101
113
|
var _useState = (0, _react.useState)({}),
|
|
102
114
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -108,19 +120,61 @@ function Table(props) {
|
|
|
108
120
|
return _objectSpread({}, prevColumnsWidth, _defineProperty({}, name, width));
|
|
109
121
|
});
|
|
110
122
|
}, []);
|
|
123
|
+
var isDnDEnabled = !!onDragEnd;
|
|
124
|
+
|
|
125
|
+
var _useState3 = (0, _react.useState)(false),
|
|
126
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
127
|
+
hasDragHandlers = _useState4[0],
|
|
128
|
+
setHasDragHandlers = _useState4[1];
|
|
129
|
+
|
|
130
|
+
var columns = (0, _react.useMemo)(function () {
|
|
131
|
+
if (isDnDEnabled && !hasDragHandlers) {
|
|
132
|
+
return [{
|
|
133
|
+
name: 'default-drag-handle',
|
|
134
|
+
DataCell: function DataCell(_ref) {
|
|
135
|
+
var DragHandle = _ref.DragHandle;
|
|
136
|
+
|
|
137
|
+
if (dragVariant === 'handle') {
|
|
138
|
+
var defaultHandle = _react.default.cloneElement(DragHandle, {
|
|
139
|
+
'data-drag-handle-context-id': undefined
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
return defaultHandle;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return _react.default.createElement("div", null, _react.default.createElement(_Grip.default, null));
|
|
146
|
+
},
|
|
147
|
+
getHeaderCellAttrs: function getHeaderCellAttrs() {
|
|
148
|
+
return {
|
|
149
|
+
className: 'handle-container'
|
|
150
|
+
};
|
|
151
|
+
},
|
|
152
|
+
getCellAttrs: function getCellAttrs() {
|
|
153
|
+
return {
|
|
154
|
+
className: 'handle-container'
|
|
155
|
+
};
|
|
156
|
+
},
|
|
157
|
+
getCellKey: function getCellKey() {
|
|
158
|
+
return 'default-drag-handle';
|
|
159
|
+
},
|
|
160
|
+
fixed: columnsProp[0].fixed
|
|
161
|
+
}].concat(_toConsumableArray(columnsProp));
|
|
162
|
+
}
|
|
111
163
|
|
|
112
|
-
|
|
164
|
+
return columnsProp;
|
|
165
|
+
}, [isDnDEnabled, hasDragHandlers, columnsProp, dragVariant]);
|
|
166
|
+
var fixedColumns = (0, _react.useMemo)(function () {
|
|
113
167
|
return (0, _utils.calculateOffsets)(columns, columnsWidth);
|
|
114
|
-
}, [columns, columnsWidth])
|
|
115
|
-
leftColumnsOffset = _useMemo.leftColumnsOffset,
|
|
116
|
-
rightColumnsOffset = _useMemo.rightColumnsOffset;
|
|
117
|
-
|
|
168
|
+
}, [columns, columnsWidth]);
|
|
118
169
|
return _react.default.createElement(_Provider.default, {
|
|
119
170
|
defaultSort: defaultSort,
|
|
120
171
|
onColumnResize: onColumnResize,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
172
|
+
columnsWidth: columnsWidth,
|
|
173
|
+
fixedColumns: fixedColumns,
|
|
174
|
+
isDnDEnabled: isDnDEnabled,
|
|
175
|
+
hasDragHandlers: hasDragHandlers,
|
|
176
|
+
setHasDragHandlers: setHasDragHandlers,
|
|
177
|
+
dragVariant: dragVariant
|
|
124
178
|
}, _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_Toolbar.default, {
|
|
125
179
|
kind: rest.kind,
|
|
126
180
|
toolbar: toolbar
|
|
@@ -140,8 +194,8 @@ function Table(props) {
|
|
|
140
194
|
}
|
|
141
195
|
|
|
142
196
|
Table.propTypes = _objectSpread({}, _schema.default.propTypes, {
|
|
143
|
-
GroupHeader: (0, _propTypes.requireIf)(_propTypes2.default.elementType, function (
|
|
144
|
-
var rowDataPath =
|
|
197
|
+
GroupHeader: (0, _propTypes.requireIf)(_propTypes2.default.elementType, function (_ref2) {
|
|
198
|
+
var rowDataPath = _ref2.rowDataPath;
|
|
145
199
|
return !!rowDataPath;
|
|
146
200
|
}),
|
|
147
201
|
// eslint-disable-next-line react/require-default-props
|
|
@@ -155,6 +209,34 @@ Table.propTypes = _objectSpread({}, _schema.default.propTypes, {
|
|
|
155
209
|
return new Error("You have set a column as fixed but the Table doesn't have horizontal scroll, you need to enable it via scroll prop for this feature to work correctly");
|
|
156
210
|
}
|
|
157
211
|
|
|
212
|
+
var previousColumn = null;
|
|
213
|
+
var isleColumnIndex = null;
|
|
214
|
+
|
|
215
|
+
for (var index = 0; index < columns.length; index += 1) {
|
|
216
|
+
var column = columns[index];
|
|
217
|
+
|
|
218
|
+
if (previousColumn && column.fixed && !previousColumn.fixed) {
|
|
219
|
+
isleColumnIndex = index;
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
previousColumn = column;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
previousColumn = null;
|
|
227
|
+
|
|
228
|
+
for (var _index = columns.length - 1; _index >= 0; _index -= 1) {
|
|
229
|
+
var _column = columns[_index];
|
|
230
|
+
|
|
231
|
+
if (previousColumn && _column.fixed && !previousColumn.fixed) {
|
|
232
|
+
if (isleColumnIndex && isleColumnIndex <= _index) {
|
|
233
|
+
return new Error("Column [".concat(_column.name, "] will not be fixed. Fixed columns must be consecutive, grouped at the beginning or at the end of the array."));
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
previousColumn = _column;
|
|
238
|
+
}
|
|
239
|
+
|
|
158
240
|
_propTypes2.default.checkPropTypes({
|
|
159
241
|
columns: _propTypes2.default.arrayOf(_propTypes2.default.shape({
|
|
160
242
|
DataCell: _propTypes2.default.elementType.isRequired,
|
|
@@ -162,7 +244,7 @@ Table.propTypes = _objectSpread({}, _schema.default.propTypes, {
|
|
|
162
244
|
name: _propTypes2.default.string.isRequired,
|
|
163
245
|
sortBy: _propTypes2.default.func,
|
|
164
246
|
title: _propTypes2.default.string,
|
|
165
|
-
fixed: _propTypes2.default.
|
|
247
|
+
fixed: _propTypes2.default.bool
|
|
166
248
|
}))
|
|
167
249
|
}, props, propName, componentName);
|
|
168
250
|
|
|
@@ -170,16 +252,24 @@ Table.propTypes = _objectSpread({}, _schema.default.propTypes, {
|
|
|
170
252
|
},
|
|
171
253
|
toolbar: _propTypes2.default.elementType,
|
|
172
254
|
footer: _propTypes2.default.elementType,
|
|
173
|
-
getRowKey: (0, _propTypes.requireIf)(_propTypes2.default.func, function (
|
|
174
|
-
var data =
|
|
175
|
-
return !((0, _get.default)(data, '0.key') || (0, _get.default)(data, '0.id'));
|
|
255
|
+
getRowKey: (0, _propTypes.requireIf)(_propTypes2.default.func, function (_ref3) {
|
|
256
|
+
var data = _ref3.data;
|
|
257
|
+
return !!data && data.length > 0 && !((0, _get.default)(data, '0.key') || (0, _get.default)(data, '0.id'));
|
|
176
258
|
}),
|
|
177
|
-
height: (0, _propTypes.requireIf)(_propTypes2.default.string, function (
|
|
178
|
-
var scroll =
|
|
179
|
-
size =
|
|
259
|
+
height: (0, _propTypes.requireIf)(_propTypes2.default.string, function (_ref4) {
|
|
260
|
+
var scroll = _ref4.scroll,
|
|
261
|
+
size = _ref4.size;
|
|
180
262
|
return (0, _modifiersPropApplies.default)('y', scroll, size);
|
|
181
263
|
}),
|
|
182
|
-
scroll: _propTypes2.default.oneOfType([_propTypes2.default.oneOf(['x', 'y']), _propTypes2.default.arrayOf(_propTypes2.default.oneOf(['x', 'y'])), _propTypes2.default.objectOf(_propTypes2.default.oneOfType([_propTypes2.default.oneOf(['x', 'y']), _propTypes2.default.arrayOf(_propTypes2.default.oneOf(['x', 'y']))]))])
|
|
264
|
+
scroll: _propTypes2.default.oneOfType([_propTypes2.default.oneOf(['x', 'y']), _propTypes2.default.arrayOf(_propTypes2.default.oneOf(['x', 'y'])), _propTypes2.default.objectOf(_propTypes2.default.oneOfType([_propTypes2.default.oneOf(['x', 'y']), _propTypes2.default.arrayOf(_propTypes2.default.oneOf(['x', 'y']))]))]),
|
|
265
|
+
// eslint-disable-next-line react/require-default-props
|
|
266
|
+
dragVariant: function dragVariant(_ref5) {
|
|
267
|
+
var onDragEnd = _ref5.onDragEnd,
|
|
268
|
+
props = _objectWithoutProperties(_ref5, ["onDragEnd"]);
|
|
269
|
+
|
|
270
|
+
if (!onDragEnd && 'dragVariant' in props) return new Error('You have set dragVariant prop but Drag-and-Drop sorting is not enabled, you can enable it by passing [onDragEnd] callback');
|
|
271
|
+
return null;
|
|
272
|
+
}
|
|
183
273
|
});
|
|
184
274
|
Table.defaultProps = {
|
|
185
275
|
GroupHeader: undefined,
|
|
@@ -10,6 +10,14 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
10
10
|
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
|
|
13
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
14
|
+
|
|
15
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
16
|
+
|
|
17
|
+
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
|
18
|
+
|
|
19
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
|
20
|
+
|
|
13
21
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
14
22
|
|
|
15
23
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -281,29 +289,49 @@ describe('Table', function () {
|
|
|
281
289
|
});
|
|
282
290
|
});
|
|
283
291
|
describe('fixed columns', function () {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
292
|
+
it('renders columns with sticky styles', function () {
|
|
293
|
+
var columnsFixed = [].concat(columns);
|
|
294
|
+
var firstColumn = columnsFixed[0];
|
|
295
|
+
columnsFixed[0] = _objectSpread({}, firstColumn, {
|
|
296
|
+
fixed: true
|
|
297
|
+
});
|
|
298
|
+
var lastIndex = columnsFixed.length - 1;
|
|
299
|
+
var lastColumn = columnsFixed[lastIndex];
|
|
300
|
+
columnsFixed[lastIndex] = _objectSpread({}, lastColumn, {
|
|
301
|
+
fixed: true
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
var _render9 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
305
|
+
columns: columnsFixed,
|
|
306
|
+
data: data
|
|
307
|
+
})),
|
|
308
|
+
getByText = _render9.getByText,
|
|
309
|
+
container = _render9.container;
|
|
310
|
+
|
|
311
|
+
expect(getByText(firstColumn.title).closest('th')).toHaveStyle("\n position: sticky;\n left: 0px;\n ");
|
|
312
|
+
expect(getByText(lastColumn.title).closest('th')).toHaveStyle("\n position: sticky;\n right: 0px;\n ");
|
|
313
|
+
var firstRow = container.querySelector('tbody tr:first-child');
|
|
314
|
+
expect((0, _react2.getByText)(firstRow, data[0][firstColumn.name]).closest('td')).toHaveStyle("\n position: sticky;\n left: 0px;\n ");
|
|
315
|
+
expect((0, _react2.getByText)(firstRow, data[0][lastColumn.name]).closest('td')).toHaveStyle("\n position: sticky;\n right: 0px;\n ");
|
|
293
316
|
});
|
|
317
|
+
it('ignores columns in the middle', function () {
|
|
318
|
+
var columnsFixed = [].concat(columns);
|
|
319
|
+
var middleIndex = Math.trunc(columns.length / 2);
|
|
320
|
+
var middleColumn = columnsFixed[middleIndex];
|
|
321
|
+
columnsFixed[middleIndex] = _objectSpread({}, middleColumn, {
|
|
322
|
+
fixed: true
|
|
323
|
+
});
|
|
294
324
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
expect((0, _react2.getByText)(firstRow, data[0][firstColumn.name]).closest('td')).toHaveStyle("\n position: sticky;\n left: 0px;\n ");
|
|
306
|
-
expect((0, _react2.getByText)(firstRow, data[0][lastColumn.name]).closest('td')).toHaveStyle("\n position: sticky;\n right: 0px;\n ");
|
|
325
|
+
var _render10 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
326
|
+
columns: columnsFixed,
|
|
327
|
+
data: data,
|
|
328
|
+
scroll: "x"
|
|
329
|
+
})),
|
|
330
|
+
container = _render10.container;
|
|
331
|
+
|
|
332
|
+
var firstRow = container.querySelector('tbody tr:first-child');
|
|
333
|
+
expect((0, _react2.getByText)(firstRow, data[0][middleColumn.name]).closest('td')).not.toHaveStyle("\n position: sticky;\n ");
|
|
334
|
+
});
|
|
307
335
|
});
|
|
308
336
|
describe('Drag-and-Drop sorting', function () {
|
|
309
337
|
var dragItem = /*#__PURE__*/function () {
|
|
@@ -377,18 +405,18 @@ describe('Table', function () {
|
|
|
377
405
|
}();
|
|
378
406
|
|
|
379
407
|
it('calls onDragEnd prop when sorting with DnD', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
380
|
-
var onDragEnd,
|
|
408
|
+
var onDragEnd, _render11, getByText;
|
|
381
409
|
|
|
382
410
|
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
383
411
|
while (1) {
|
|
384
412
|
switch (_context2.prev = _context2.next) {
|
|
385
413
|
case 0:
|
|
386
414
|
onDragEnd = jest.fn();
|
|
387
|
-
|
|
415
|
+
_render11 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
388
416
|
columns: columns,
|
|
389
417
|
data: data,
|
|
390
418
|
onDragEnd: onDragEnd
|
|
391
|
-
})), getByText =
|
|
419
|
+
})), getByText = _render11.getByText;
|
|
392
420
|
_context2.next = 4;
|
|
393
421
|
return dragItem(getByText('Avatar'), 2, 'down', getByText);
|
|
394
422
|
|
|
@@ -405,14 +433,14 @@ describe('Table', function () {
|
|
|
405
433
|
describe('grouped data', function () {
|
|
406
434
|
// the beginning of the table is outside any group
|
|
407
435
|
it('does not call onDragEnd prop when moving item to the beginning', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
|
|
408
|
-
var onDragEnd,
|
|
436
|
+
var onDragEnd, _render12, getByText;
|
|
409
437
|
|
|
410
438
|
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
411
439
|
while (1) {
|
|
412
440
|
switch (_context3.prev = _context3.next) {
|
|
413
441
|
case 0:
|
|
414
442
|
onDragEnd = jest.fn();
|
|
415
|
-
|
|
443
|
+
_render12 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
416
444
|
columns: groupColumns,
|
|
417
445
|
data: groupData,
|
|
418
446
|
onDragEnd: onDragEnd,
|
|
@@ -421,7 +449,7 @@ describe('Table', function () {
|
|
|
421
449
|
var name = _ref10.groupData.name;
|
|
422
450
|
return _react.default.createElement("span", null, name);
|
|
423
451
|
}
|
|
424
|
-
})), getByText =
|
|
452
|
+
})), getByText = _render12.getByText;
|
|
425
453
|
_context3.next = 4;
|
|
426
454
|
return dragItem(getByText('garlic'), 2, 'up', getByText);
|
|
427
455
|
|
|
@@ -436,14 +464,14 @@ describe('Table', function () {
|
|
|
436
464
|
}, _callee3);
|
|
437
465
|
})));
|
|
438
466
|
it('calls onDragEnd prop when moving item to a group before', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
|
|
439
|
-
var onDragEnd,
|
|
467
|
+
var onDragEnd, _render13, getByText;
|
|
440
468
|
|
|
441
469
|
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
442
470
|
while (1) {
|
|
443
471
|
switch (_context4.prev = _context4.next) {
|
|
444
472
|
case 0:
|
|
445
473
|
onDragEnd = jest.fn();
|
|
446
|
-
|
|
474
|
+
_render13 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
447
475
|
columns: groupColumns,
|
|
448
476
|
data: groupData,
|
|
449
477
|
onDragEnd: onDragEnd,
|
|
@@ -452,7 +480,7 @@ describe('Table', function () {
|
|
|
452
480
|
var name = _ref12.groupData.name;
|
|
453
481
|
return _react.default.createElement("span", null, name);
|
|
454
482
|
}
|
|
455
|
-
})), getByText =
|
|
483
|
+
})), getByText = _render13.getByText;
|
|
456
484
|
_context4.next = 4;
|
|
457
485
|
return dragItem(getByText('kale'), 2, 'up', getByText);
|
|
458
486
|
|
|
@@ -467,14 +495,14 @@ describe('Table', function () {
|
|
|
467
495
|
}, _callee4);
|
|
468
496
|
})));
|
|
469
497
|
it('calls onDragEnd prop when moving item to a group after', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
470
|
-
var onDragEnd,
|
|
498
|
+
var onDragEnd, _render14, getByText;
|
|
471
499
|
|
|
472
500
|
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
473
501
|
while (1) {
|
|
474
502
|
switch (_context5.prev = _context5.next) {
|
|
475
503
|
case 0:
|
|
476
504
|
onDragEnd = jest.fn();
|
|
477
|
-
|
|
505
|
+
_render14 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
478
506
|
columns: groupColumns,
|
|
479
507
|
data: groupData,
|
|
480
508
|
onDragEnd: onDragEnd,
|
|
@@ -483,7 +511,7 @@ describe('Table', function () {
|
|
|
483
511
|
var name = _ref14.groupData.name;
|
|
484
512
|
return _react.default.createElement("span", null, name);
|
|
485
513
|
}
|
|
486
|
-
})), getByText =
|
|
514
|
+
})), getByText = _render14.getByText;
|
|
487
515
|
_context5.next = 4;
|
|
488
516
|
return dragItem(getByText('onion'), 2, 'down', getByText);
|
|
489
517
|
|
|
@@ -499,4 +527,23 @@ describe('Table', function () {
|
|
|
499
527
|
})));
|
|
500
528
|
});
|
|
501
529
|
});
|
|
530
|
+
describe('rendering custom header', function () {
|
|
531
|
+
it('renders a custom header', function () {
|
|
532
|
+
var firstColumn = columns[0],
|
|
533
|
+
rest = columns.slice(1);
|
|
534
|
+
var headerTitle = 'Custom header';
|
|
535
|
+
|
|
536
|
+
var _render15 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
537
|
+
columns: [_objectSpread({
|
|
538
|
+
HeaderCell: function HeaderCell() {
|
|
539
|
+
return _react.default.createElement("span", null, headerTitle);
|
|
540
|
+
}
|
|
541
|
+
}, firstColumn)].concat(_toConsumableArray(rest)),
|
|
542
|
+
data: data
|
|
543
|
+
})),
|
|
544
|
+
getByText = _render15.getByText;
|
|
545
|
+
|
|
546
|
+
expect(getByText(headerTitle)).toBeTruthy();
|
|
547
|
+
});
|
|
548
|
+
});
|
|
502
549
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.columns.d.ts","sourceRoot":"","sources":["../../../src/components/Table/schema.columns.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.columns.d.ts","sourceRoot":"","sources":["../../../src/components/Table/schema.columns.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAqC,CAAC;AAoClD,eAAe,MAAM,CAAC"}
|
|
@@ -12,13 +12,15 @@ var schema = (0, _reactDesc.describe)({
|
|
|
12
12
|
displayName: 'Table'
|
|
13
13
|
});
|
|
14
14
|
schema.propTypes = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
HeaderCell: _reactDesc.PropTypes.any.description('A React Component used to render a custom column header cell. See below for more details.').format('React Component'),
|
|
16
|
+
DataCell: _reactDesc.PropTypes.any.description("A React Component used to render data inside one of the column's data cells. See below for more details.").format('React Component').isRequired,
|
|
17
|
+
getCellAttrs: _reactDesc.PropTypes.func.description("A function that returns additional attributes for the rendered `<td>`. Receives the row's data and the column's name as arguments. See below for function signature."),
|
|
18
|
+
getHeaderCellAttrs: _reactDesc.PropTypes.func.description('A function that returns additional attributes for the rendered `<th>` within the `<thead>`. Receives the column name as argument. See below for function signature.'),
|
|
19
|
+
getCellKey: _reactDesc.PropTypes.func.description("A function that returns a unique, stable key for each cell based on the row's data and the column's name. Receives the row's data and the column's name as arguments. Defaults to `columnName`. See below for function signature."),
|
|
18
20
|
name: _reactDesc.PropTypes.string.description('The name of this column. Must be unique to the table.').isRequired,
|
|
19
21
|
sortBy: _reactDesc.PropTypes.func.description("If included (with a title), makes a column sortable. Will be called with the new sorting type when a user clicks on the column's header. Should cause the data provided to the table to update based on the new sorting type."),
|
|
20
22
|
title: _reactDesc.PropTypes.string.description("The text displayed in a column's header."),
|
|
21
|
-
fixed: _reactDesc.PropTypes.
|
|
23
|
+
fixed: _reactDesc.PropTypes.bool.description('If true the column will be kept visible when scrolling horizontally, it will stick to the left when the column is at the beginning of the array and to the right when at the end. Fixed columns can be grouped at the beginning or at the end of the array, if set to a column in the middle it will be ignored. Horizontal scroll in table is required.')
|
|
22
24
|
};
|
|
23
25
|
var _default = schema;
|
|
24
26
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Table/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,KAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Table/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,KAAqC,CAAC;AAkElD,eAAe,MAAM,CAAC"}
|
|
@@ -23,7 +23,7 @@ var schema = (0, _reactDesc.describe)({
|
|
|
23
23
|
displayName: 'Table'
|
|
24
24
|
});
|
|
25
25
|
schema.propTypes = {
|
|
26
|
-
GroupHeader: _reactDesc.PropTypes.any.description('A React Component used to render a header within the table for grouped data. Required if `rowDataPath` is provided.').format('React Component'),
|
|
26
|
+
GroupHeader: _reactDesc.PropTypes.any.description('A React Component used to render a header within the table for grouped data. Required if `rowDataPath` is provided. Receives `groupData` as prop.').format('React Component'),
|
|
27
27
|
columns: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.object).description('An array of column configuration objects (described in more detail below). Columns will be displayed in the order of the array.').isRequired,
|
|
28
28
|
data: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.object).description('An array of row data objects. Row data can contain basically anything. Rows will be displayed in the order of the array.').isRequired,
|
|
29
29
|
defaultSort: _reactDesc.PropTypes.shape({
|
|
@@ -31,16 +31,17 @@ schema.propTypes = {
|
|
|
31
31
|
sortingType: _reactDesc.PropTypes.oneOf([_useSortableHeaders.ASCENDING, _useSortableHeaders.DESCENDING, _useSortableHeaders.UNSORTED]).description('The initial sort type.')
|
|
32
32
|
}).description("Indicates that the provided data is initially sorted on the given column, in the specified direction. The column's onSort handler will NOT be called; it is assumed that the data has been sorted prior to the initial render."),
|
|
33
33
|
footer: _reactDesc.PropTypes.any.description("A React Component used to render a footer area beneath the table rows. This component is not included in the 'height' if set.").format('React Component'),
|
|
34
|
-
getGroupHeaderAttrs: _reactDesc.PropTypes.func.description(
|
|
35
|
-
getRowAttrs: _reactDesc.PropTypes.func.description(
|
|
36
|
-
getRowKey: _reactDesc.PropTypes.func.description("A function that returns a unique, stable key for each row based on that row's data. Defaults to `rowData['key']` or `rowData['id']`."),
|
|
34
|
+
getGroupHeaderAttrs: _reactDesc.PropTypes.func.description("A function that returns additional attributes for the `<th>` rendered as a row group header. Receives the row's data as argument. See below for function signature."),
|
|
35
|
+
getRowAttrs: _reactDesc.PropTypes.func.description("A function that returns additional attributes for the rendered `<tr>` within the `<tbody>`. Receives 2 arguments: the row's data and an options object. See below for function signature."),
|
|
36
|
+
getRowKey: _reactDesc.PropTypes.func.description("A function that returns a unique, stable key for each row based on that row's data. Receives 2 arguments: the row's data and an options object. Defaults to `rowData['key']` or `rowData['id']`. See below for function signature."),
|
|
37
37
|
height: _reactDesc.PropTypes.string.description('A pass through CSS value for the height of the table.'),
|
|
38
38
|
kind: _reactDesc.PropTypes.oneOf(['primary', 'secondary']).description('A flag controlling the kind of table displayed.').defaultValue('primary'),
|
|
39
39
|
rowDataPath: _reactDesc.PropTypes.string.description('A valid path to an array of rowData objects within a groupData object. Required if `GroupHeader` is provided.'),
|
|
40
|
-
scroll: _reactDesc.PropTypes.oneOf(['x', 'y']).description('A responsive modifier used to control scrolling on the table.
|
|
40
|
+
scroll: _reactDesc.PropTypes.oneOf(['x', 'y']).description('A responsive modifier used to control scrolling on the table.'),
|
|
41
41
|
size: _reactDesc.PropTypes.oneOf(['_'].concat(_toConsumableArray(Object.keys(_breakpointObserver.sizes)))).description('Defines the breakpoint to use (for use in reactive design).'),
|
|
42
42
|
variant: _reactDesc.PropTypes.oneOf(['comfortable', 'compact']).description('A flag controlling the variant of the table displayed.').defaultValue('comfortable'),
|
|
43
|
-
onDragEnd: _reactDesc.PropTypes.func.description("If present enables Drag-and-Drop sorting. A function called after the order of rows changes when a row is dragged and dropped, it is called with 2 arguments: the index from where it's dragged and the index to where it's dropped, if there are grouped rows each argument is an array where the first element is the group index and the second the row index inside the group")
|
|
43
|
+
onDragEnd: _reactDesc.PropTypes.func.description("If present enables Drag-and-Drop sorting. A function called after the order of rows changes when a row is dragged and dropped, it is called with 2 arguments: the index from where it's dragged and the index to where it's dropped, if there are grouped rows each argument is an array where the first element is the group index and the second the row index inside the group. See below for function signature."),
|
|
44
|
+
dragVariant: _reactDesc.PropTypes.oneOf(['handle', 'row']).description('When Drag-and-Drop sorting is enabled, defines if the rows should be dragged only from the default handle or from anywhere in the row. This flag is ignored when a `DragHandle` node is rendered in a `DataCell`.').defaultValue('row')
|
|
44
45
|
};
|
|
45
46
|
var _default = schema;
|
|
46
47
|
exports.default = _default;
|
|
@@ -5,17 +5,27 @@ import { ModifiersProp } from 'styled-components-modifiers';
|
|
|
5
5
|
import { DroppableProvided, DroppableStateSnapshot, DraggableProvided, DraggableStateSnapshot, DropResult } from 'react-beautiful-dnd';
|
|
6
6
|
import { KindModifiers, ScrollModifiersConfig, VariantModifiers } from './Container';
|
|
7
7
|
import { SortableState, SortingTypes } from './hooks/useSortableHeaders';
|
|
8
|
+
import { CustomHeaderCellProps } from './HeaderCell/types';
|
|
8
9
|
export { KindModifiers, ScrollModifiers, VariantModifiers } from './Container';
|
|
9
10
|
export interface Column<TData> {
|
|
11
|
+
HeaderCell?: (props: CustomHeaderCellProps) => JSX.Element;
|
|
10
12
|
DataCell: (props: DataCellProps<TData>) => JSX.Element;
|
|
11
13
|
getCellAttrs?: (rowData: TData, columnName: string) => object | undefined;
|
|
14
|
+
getHeaderCellAttrs?: (columnName: string) => object | undefined;
|
|
12
15
|
getCellKey?: (rowData: TData, columnName: string) => string;
|
|
13
16
|
name: string;
|
|
14
17
|
sortBy?: (sortingType: SortingTypes) => void;
|
|
15
18
|
title?: string;
|
|
16
|
-
fixed?:
|
|
19
|
+
fixed?: boolean;
|
|
17
20
|
}
|
|
21
|
+
export declare type DragVariant = 'handle' | 'row';
|
|
18
22
|
export declare type Columns<TData> = Column<TData>[];
|
|
23
|
+
export interface FixedColumns {
|
|
24
|
+
[name: string]: {
|
|
25
|
+
offset: number;
|
|
26
|
+
alignment: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
19
29
|
export interface HeadProps<TData> {
|
|
20
30
|
columns: Columns<TData>;
|
|
21
31
|
kind?: KindModifiers;
|
|
@@ -24,7 +34,7 @@ export interface HeadProps<TData> {
|
|
|
24
34
|
export interface DataRowProps<TData> {
|
|
25
35
|
className?: 'group-data-row';
|
|
26
36
|
columns: Columns<TData>;
|
|
27
|
-
getRowAttrs?:
|
|
37
|
+
getRowAttrs?: TableProps<TData>['getRowAttrs'];
|
|
28
38
|
groupData?: TData;
|
|
29
39
|
groupId?: string | undefined;
|
|
30
40
|
kind?: KindModifiers;
|
|
@@ -69,13 +79,18 @@ export interface TableProps<TData extends RowData> extends HeadProps<TData>, Too
|
|
|
69
79
|
data: TData[];
|
|
70
80
|
defaultSort?: SortableState;
|
|
71
81
|
getGroupHeaderAttrs?: (groupData: TData) => object | undefined;
|
|
72
|
-
getRowAttrs?: (rowData: TData,
|
|
73
|
-
|
|
82
|
+
getRowAttrs?: (rowData: TData, options: {
|
|
83
|
+
isGroupHeaderRow?: boolean;
|
|
84
|
+
}) => object | undefined;
|
|
85
|
+
getRowKey?: (rowData: TData, options: {
|
|
86
|
+
isGroupHeaderRow?: boolean;
|
|
87
|
+
}) => string;
|
|
74
88
|
height?: HeightProperty<string>;
|
|
75
89
|
rowDataPath?: string;
|
|
76
90
|
scroll?: ModifiersProp<ScrollModifiersConfig, typeof sizes>;
|
|
77
91
|
size?: keyof typeof sizes;
|
|
78
92
|
onDragEnd?: (from: number | number[], to: number | number[]) => void;
|
|
93
|
+
dragVariant?: DragVariant;
|
|
79
94
|
}
|
|
80
95
|
export interface DroppableWrapperProps {
|
|
81
96
|
children(provided?: DroppableProvided, snapshot?: DroppableStateSnapshot): React.ReactElement<HTMLElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Table/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,EACtB,UAAU,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Table/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import { RowData, TableProps, WrapperProps, Columns } from './types';
|
|
1
|
+
import { RowData, TableProps, WrapperProps, Columns, FixedColumns } from './types';
|
|
2
2
|
export declare function defaultGetRowKey({ key, id }: RowData): string | undefined;
|
|
3
3
|
export declare function isGroupData<TData>(dataObj: TData, { rowDataPath, GroupHeader }: TableProps<TData>): boolean;
|
|
4
4
|
export declare const Wrapper: import("styled-components").StyledComponent<"div", any, WrapperProps, never>;
|
|
5
|
-
export interface ColumnsOffset {
|
|
6
|
-
[name: string]: number;
|
|
7
|
-
}
|
|
8
5
|
export declare function calculateOffsets<T>(columns: Columns<T>, columnsWidth: {
|
|
9
6
|
[name: string]: number;
|
|
10
|
-
}):
|
|
11
|
-
leftColumnsOffset: ColumnsOffset;
|
|
12
|
-
rightColumnsOffset: ColumnsOffset;
|
|
13
|
-
};
|
|
7
|
+
}): FixedColumns;
|
|
14
8
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Table/utils.ts"],"names":[],"mappings":"AAOA,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Table/utils.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,OAAO,EACP,UAAU,EACV,YAAY,EACZ,OAAO,EACP,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAEzE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAC/B,OAAO,EAAE,KAAK,EACd,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,UAAU,CAAC,KAAK,CAAC,GAC9C,OAAO,CAMT;AAaD,eAAO,MAAM,OAAO,8EAQnB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,YAAY,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GACvC,YAAY,CA4Bd"}
|
|
@@ -61,26 +61,27 @@ exports.Wrapper = Wrapper;
|
|
|
61
61
|
function calculateOffsets(columns, columnsWidth) {
|
|
62
62
|
var leftOffset = 0;
|
|
63
63
|
var rightOffset = 0;
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (rightColumn.fixed === 'right') {
|
|
77
|
-
rightOffsets[rightColumn.name] = rightOffset;
|
|
78
|
-
rightOffset += Math.floor(columnsWidth[rightColumn.name] || 0);
|
|
79
|
-
}
|
|
64
|
+
var fixedColumns = {};
|
|
65
|
+
|
|
66
|
+
for (var index = 0; index < columns.length; index += 1) {
|
|
67
|
+
var column = columns[index];
|
|
68
|
+
if (!column.fixed) break;
|
|
69
|
+
fixedColumns[column.name] = {
|
|
70
|
+
alignment: 'left',
|
|
71
|
+
offset: leftOffset
|
|
72
|
+
};
|
|
73
|
+
leftOffset += Math.floor(columnsWidth[column.name] || 0);
|
|
80
74
|
}
|
|
81
75
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
for (var _index = columns.length - 1; _index >= 0; _index -= 1) {
|
|
77
|
+
var _column = columns[_index];
|
|
78
|
+
if (!_column.fixed) break;
|
|
79
|
+
fixedColumns[_column.name] = {
|
|
80
|
+
alignment: 'right',
|
|
81
|
+
offset: rightOffset
|
|
82
|
+
};
|
|
83
|
+
rightOffset += Math.floor(columnsWidth[_column.name] || 0);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return fixedColumns;
|
|
86
87
|
}
|