@procore/core-react 12.27.0 → 12.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/AnchorNavigation/AnchorNavigation.styles.js +3 -3
- package/dist/Avatar/Avatar.styles.js +5 -5
- package/dist/AvatarStack/AvatarStack.styles.js +7 -7
- package/dist/Badge/Badge.styles.js +2 -2
- package/dist/BadgePill/BadgePill.styles.js +4 -4
- package/dist/Banner/Banner.styles.js +10 -10
- package/dist/Box/Box.styles.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
- package/dist/Button/Button.styles.js +5 -5
- package/dist/Calendar/Calendar.styles.js +8 -8
- package/dist/Card/Card.styles.js +1 -1
- package/dist/Checkbox/Checkbox.styles.js +6 -6
- package/dist/Checkbox/CheckboxTooltip.js +1 -1
- package/dist/ContactItem/ContactItem.styles.js +5 -5
- package/dist/Content/Content.styles.js +2 -2
- package/dist/DateInput/DateInput.styles.js +6 -6
- package/dist/DetailPage/DetailPage.styles.js +7 -7
- package/dist/Dropdown/Dropdown.styles.js +3 -3
- package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
- package/dist/Dropzone/Dropzone.js +1 -1
- package/dist/Dropzone/Dropzone.styles.js +9 -9
- package/dist/EmptyState/EmptyState.styles.js +6 -6
- package/dist/Field/Field.styles.js +3 -3
- package/dist/FileList/FileList.styles.js +4 -4
- package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
- package/dist/FileSelect/FileSelect.styles.js +2 -2
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
- package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
- package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
- package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
- package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
- package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
- package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
- package/dist/FileToken/FileToken.styles.js +4 -4
- package/dist/FilterToken/FilterToken.styles.js +5 -5
- package/dist/FlexList/FlexList.styles.js +1 -1
- package/dist/Form/Form.styles.js +14 -14
- package/dist/Form/StyledFormikForm.styles.js +2 -2
- package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
- package/dist/Grid/Grid.styles.js +2 -2
- package/dist/GroupSelect/GroupSelect.styles.js +1 -1
- package/dist/Input/Input.styles.js +1 -1
- package/dist/Link/Link.styles.js +1 -1
- package/dist/ListPage/ListPage.styles.js +8 -8
- package/dist/Loader/Loader.styles.js +2 -2
- package/dist/MenuImperative/MenuImperative.styles.js +10 -10
- package/dist/Modal/Modal.styles.js +13 -13
- package/dist/MultiSelect/MultiSelect.styles.js +6 -6
- package/dist/NextMenu/NextMenu.styles.js +3 -3
- package/dist/Notation/Notation.js +1 -1
- package/dist/NumberInput/NumberInput.styles.js +7 -7
- package/dist/Overlay/OverlayArrow.styles.js +1 -1
- package/dist/PageLayout/PageLayout.styles.js +16 -16
- package/dist/PageTemplate/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
- package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
- package/dist/PageTemplate/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
- package/dist/PageTemplate/PageTemplate/PageTemplate.styles.js +3 -3
- package/dist/Pagination/Pagination.styles.js +5 -5
- package/dist/Panel/Panel.styles.js +11 -11
- package/dist/Pill/Pill.styles.js +3 -3
- package/dist/PillSelect/PillSelect.styles.js +4 -4
- package/dist/Popover/Popover.styles.js +2 -2
- package/dist/Portal/Portal.styles.js +1 -1
- package/dist/ProgressBar/ProgressBar.styles.js +2 -2
- package/dist/RadioButton/RadioButton.styles.js +3 -3
- package/dist/Required/Required.styles.js +3 -3
- package/dist/Search/Search.styles.js +5 -5
- package/dist/Section/Section.styles.js +7 -7
- package/dist/SegmentedController/SegmentedController.styles.js +4 -4
- package/dist/Select/Select.styles.js +7 -7
- package/dist/Semantic/Semantic.styles.js +9 -9
- package/dist/Slider/Slider.styles.js +5 -5
- package/dist/Spinner/Spinner.styles.js +7 -7
- package/dist/SplitViewCard/SplitViewCard.styles.js +8 -8
- package/dist/SuperSelect/SuperSelect.components.d.ts +1 -0
- package/dist/SuperSelect/SuperSelect.components.js +106 -15
- package/dist/SuperSelect/SuperSelect.components.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.constants.d.ts +1 -0
- package/dist/SuperSelect/SuperSelect.constants.js +1 -0
- package/dist/SuperSelect/SuperSelect.constants.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.js +5 -1
- package/dist/SuperSelect/SuperSelect.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
- package/dist/SuperSelect/SuperSelect.styles.d.ts +3 -0
- package/dist/SuperSelect/SuperSelect.styles.js +41 -37
- package/dist/SuperSelect/SuperSelect.styles.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.types.d.ts +35 -1
- package/dist/SuperSelect/SuperSelect.types.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.utils.d.ts +1 -0
- package/dist/SuperSelect/SuperSelect.utils.js +4 -1
- package/dist/SuperSelect/SuperSelect.utils.js.map +1 -1
- package/dist/SuperSelect/useSuperSelect.d.ts +1 -1
- package/dist/SuperSelect/useSuperSelect.js +111 -24
- package/dist/SuperSelect/useSuperSelect.js.map +1 -1
- package/dist/Switch/Switch.styles.js +4 -4
- package/dist/Table/Table.styles.js +28 -28
- package/dist/TableShelf/TableShelf.styles.js +5 -5
- package/dist/Tabs/Tabs.styles.js +15 -15
- package/dist/Tearsheet/Tearsheet.styles.js +5 -5
- package/dist/TextArea/TextArea.styles.js +1 -1
- package/dist/TextEditor/TextEditor.d.ts +1 -1
- package/dist/TextEditor/TextEditor.js +8 -1
- package/dist/TextEditor/TextEditor.js.map +1 -1
- package/dist/TextEditor/TextEditor.styles.js +1 -1
- package/dist/TextEditor/TextEditor.types.d.ts +43 -0
- package/dist/TextEditor/TextEditor.types.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
- package/dist/Thumbnail/Thumbnail.styles.js +17 -17
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
- package/dist/TieredSelect/TieredSelect.js +1 -1
- package/dist/TieredSelect/TieredSelect.js.map +1 -1
- package/dist/TieredSelect/TieredSelect.styles.js +9 -9
- package/dist/Tile/Tile.styles.js +8 -8
- package/dist/Title/Title.styles.js +7 -7
- package/dist/Toast/Toast.styles.js +3 -3
- package/dist/ToggleButton/ToggleButton.styles.js +1 -1
- package/dist/Token/Token.styles.js +3 -3
- package/dist/ToolHeader/ToolHeader.styles.js +6 -6
- package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
- package/dist/Tooltip/Tooltip.styles.js +2 -2
- package/dist/Tree/Tree.styles.js +9 -9
- package/dist/Typeahead/Typeahead.styles.js +3 -3
- package/dist/Typography/Typography.styles.js +1 -1
- package/dist/Typography/Typography.table.story.js +2 -2
- package/dist/_hooks/I18n.d.ts +2 -0
- package/dist/_locales/en.json +2 -1
- package/dist/_locales/pseudo.json +2 -1
- package/dist/_storyHelpers_/components/Deprecation.styles.js +1 -1
- package/dist/_storyHelpers_/components/StoryGrid.js +3 -3
- package/dist/_typedoc/AnchorNavigation/AnchorNavigation.types.json +3 -3
- package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
- package/dist/_typedoc/AvatarStack/AvatarStack.types.json +24 -24
- package/dist/_typedoc/Badge/Badge.types.json +6 -6
- package/dist/_typedoc/Banner/Banner.types.json +13 -13
- package/dist/_typedoc/Box/Box.types.json +68 -68
- package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
- package/dist/_typedoc/Button/Button.types.json +13 -13
- package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
- package/dist/_typedoc/Card/Card.types.json +6 -6
- package/dist/_typedoc/Checkbox/Checkbox.types.json +8 -8
- package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
- package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
- package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
- package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
- package/dist/_typedoc/Dropdown/Dropdown.types.json +37 -37
- package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +30 -30
- package/dist/_typedoc/Dropzone/Dropzone.types.json +44 -44
- package/dist/_typedoc/EmptyState/EmptyState.types.json +16 -16
- package/dist/_typedoc/FileList/FileList.types.json +9 -9
- package/dist/_typedoc/FileSelect/FileSelect.types.json +27 -27
- package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
- package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
- package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
- package/dist/_typedoc/Flex/Flex.types.json +27 -27
- package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
- package/dist/_typedoc/Form/Form.types.json +901 -757
- package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
- package/dist/_typedoc/Grid/Grid.types.json +8 -8
- package/dist/_typedoc/GroupSelect/GroupSelect.types.json +52 -52
- package/dist/_typedoc/Input/Input.types.json +2 -2
- package/dist/_typedoc/Link/Link.types.json +1 -1
- package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
- package/dist/_typedoc/Menu/Menu.types.json +62 -62
- package/dist/_typedoc/MenuImperative/MenuImperative.types.json +74 -74
- package/dist/_typedoc/Modal/Modal.types.json +46 -46
- package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
- package/dist/_typedoc/NextTile/NextTile.types.json +32 -32
- package/dist/_typedoc/Notation/Notation.types.json +4 -4
- package/dist/_typedoc/NumberInput/NumberInput.types.json +48 -48
- package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +32 -32
- package/dist/_typedoc/PageLayout/PageLayout.types.json +26 -26
- package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
- package/dist/_typedoc/Panel/Panel.types.json +30 -30
- package/dist/_typedoc/Pill/Pill.types.json +2 -2
- package/dist/_typedoc/PillSelect/PillSelect.types.json +49 -49
- package/dist/_typedoc/Popover/Popover.types.json +15 -15
- package/dist/_typedoc/ProgressBar/ProgressBar.types.json +7 -7
- package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
- package/dist/_typedoc/Required/Required.types.json +5 -5
- package/dist/_typedoc/Search/Search.types.json +18 -18
- package/dist/_typedoc/Section/Section.types.json +15 -15
- package/dist/_typedoc/SegmentedController/SegmentedController.types.json +21 -21
- package/dist/_typedoc/Select/Select.types.json +60 -60
- package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
- package/dist/_typedoc/Slider/Slider.types.json +6 -6
- package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
- package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +14 -14
- package/dist/_typedoc/Table/Table.types.json +101 -101
- package/dist/_typedoc/Tabs/Tabs.types.json +20 -20
- package/dist/_typedoc/Tearsheet/Tearsheet.types.json +17 -17
- package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
- package/dist/_typedoc/TextEditor/TextEditor.types.json +86 -14
- package/dist/_typedoc/TextEditor/TextEditorProvider.types.json +2 -2
- package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +3 -3
- package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
- package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +42 -42
- package/dist/_typedoc/TieredSelect/TieredSelect.types.json +28 -28
- package/dist/_typedoc/Tile/Tile.types.json +8 -8
- package/dist/_typedoc/Title/Title.types.json +1 -1
- package/dist/_typedoc/Toast/Toast.types.json +4 -4
- package/dist/_typedoc/ToggleButton/ToggleButton.types.json +4 -4
- package/dist/_typedoc/Token/Token.types.json +7 -7
- package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
- package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +7 -7
- package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
- package/dist/_typedoc/Tree/Tree.types.json +86 -86
- package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
- package/dist/_typedoc/Typography/Typography.types.json +9 -9
- package/dist/_typedoc/_utils/types.json +3 -3
- package/dist/_typedoc/deprecations.json +1 -1
- package/package.json +1 -1
|
@@ -22,40 +22,40 @@ var styledSelectButtonDefaultWidth = 248;
|
|
|
22
22
|
export var extendedSelectMenuWidth = 360;
|
|
23
23
|
export var PillSelectOptionWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
24
24
|
displayName: "PillSelectOptionWrapper",
|
|
25
|
-
componentId: "core-
|
|
25
|
+
componentId: "core-12_28_0__sc-1uf5708-0"
|
|
26
26
|
})(["display:flex;align-items:center;justify-content:space-between;padding:", "px ", "px;"], spacing.xs, spacing.lg);
|
|
27
27
|
export var PillSelectLabel = /*#__PURE__*/styled(Pill).withConfig({
|
|
28
28
|
displayName: "PillSelectLabel",
|
|
29
|
-
componentId: "core-
|
|
29
|
+
componentId: "core-12_28_0__sc-1uf5708-1"
|
|
30
30
|
})(["", ""], getEllipsis);
|
|
31
31
|
export var PillSelectLabelWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
32
32
|
displayName: "PillSelectLabelWrapper",
|
|
33
|
-
componentId: "core-
|
|
33
|
+
componentId: "core-12_28_0__sc-1uf5708-2"
|
|
34
34
|
})(["display:flex;max-width:100%;pointer-events:auto;", ""], function (_ref) {
|
|
35
35
|
var disabled = _ref.disabled;
|
|
36
36
|
return disabled && css(["pointer-events:none;"]);
|
|
37
37
|
});
|
|
38
38
|
export var StyledCheckboxContainer = /*#__PURE__*/styled.div.withConfig({
|
|
39
39
|
displayName: "StyledCheckboxContainer",
|
|
40
|
-
componentId: "core-
|
|
40
|
+
componentId: "core-12_28_0__sc-1uf5708-3"
|
|
41
41
|
})(["padding-left:", "px;"], spacing.lg);
|
|
42
42
|
export var StyledCheckmarkContainer = /*#__PURE__*/styled.div.withConfig({
|
|
43
43
|
displayName: "StyledCheckmarkContainer",
|
|
44
|
-
componentId: "core-
|
|
44
|
+
componentId: "core-12_28_0__sc-1uf5708-4"
|
|
45
45
|
})(["align-items:center;color:", ";display:inline-flex;flex-shrink:0;padding:0 ", "px 0 ", "px;"], colors.blue50, spacing.lg, spacing.sm);
|
|
46
46
|
|
|
47
47
|
// Do not merge with StyledMenu, needed for max-height working in IE
|
|
48
48
|
export var StyledWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
49
49
|
displayName: "StyledWrapper",
|
|
50
|
-
componentId: "core-
|
|
50
|
+
componentId: "core-12_28_0__sc-1uf5708-5"
|
|
51
51
|
})(["display:flex;max-height:inherit;min-width:inherit;outline:none;width:inherit;"]);
|
|
52
52
|
export var StyledMenu = /*#__PURE__*/styled.div.withConfig({
|
|
53
53
|
displayName: "StyledMenu",
|
|
54
|
-
componentId: "core-
|
|
54
|
+
componentId: "core-12_28_0__sc-1uf5708-6"
|
|
55
55
|
})(["display:flex;flex-direction:column;outline:0;width:100%;"]);
|
|
56
56
|
export var StyledOptions = /*#__PURE__*/styled.div.withConfig({
|
|
57
57
|
displayName: "StyledOptions",
|
|
58
|
-
componentId: "core-
|
|
58
|
+
componentId: "core-12_28_0__sc-1uf5708-7"
|
|
59
59
|
})(["flex-basis:auto;flex-grow:1;flex-shrink:1;min-height:", "px;", ";padding:", "px 0;position:relative;overflow:hidden;&:focus{", " margin:-1px;}"], optionMinHeight, function (_ref2) {
|
|
60
60
|
var _ref2$$scrollable = _ref2.$scrollable,
|
|
61
61
|
$scrollable = _ref2$$scrollable === void 0 ? true : _ref2$$scrollable;
|
|
@@ -63,53 +63,53 @@ export var StyledOptions = /*#__PURE__*/styled.div.withConfig({
|
|
|
63
63
|
}, spacing.sm, getFocus());
|
|
64
64
|
export var StyledItemContent = /*#__PURE__*/styled.div.withConfig({
|
|
65
65
|
displayName: "StyledItemContent",
|
|
66
|
-
componentId: "core-
|
|
66
|
+
componentId: "core-12_28_0__sc-1uf5708-8"
|
|
67
67
|
})(["display:flex;flex-direction:row;align-items:center;"]);
|
|
68
68
|
export var StyledOptionGroupLabel = /*#__PURE__*/styled.div.withConfig({
|
|
69
69
|
displayName: "StyledOptionGroupLabel",
|
|
70
|
-
componentId: "core-
|
|
70
|
+
componentId: "core-12_28_0__sc-1uf5708-9"
|
|
71
71
|
})(["padding:", "px 0 ", "px ", "px;"], spacing.md, spacing.xs, spacing.lg);
|
|
72
72
|
export var StyledItemLabel = /*#__PURE__*/styled.div.withConfig({
|
|
73
73
|
displayName: "StyledItemLabel",
|
|
74
|
-
componentId: "core-
|
|
74
|
+
componentId: "core-12_28_0__sc-1uf5708-10"
|
|
75
75
|
})(["", ""], function (_ref3) {
|
|
76
76
|
var $draggable = _ref3.$draggable;
|
|
77
77
|
return css(["padding:", "px ", "px;overflow-wrap:anywhere;"], spacing.xs, $draggable ? 0 : spacing.lg);
|
|
78
78
|
});
|
|
79
79
|
export var StyledDraggableWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
80
80
|
displayName: "StyledDraggableWrapper",
|
|
81
|
-
componentId: "core-
|
|
81
|
+
componentId: "core-12_28_0__sc-1uf5708-11"
|
|
82
82
|
})(["display:flex;width:100%;align-items:center;"]);
|
|
83
83
|
export var StyledGrip = /*#__PURE__*/styled.div.withConfig({
|
|
84
84
|
displayName: "StyledGrip",
|
|
85
|
-
componentId: "core-
|
|
85
|
+
componentId: "core-12_28_0__sc-1uf5708-12"
|
|
86
86
|
})(["padding:0 2px;height:24px;visibility:hidden;"]);
|
|
87
87
|
export var StyledFooter = /*#__PURE__*/styled(Box).withConfig({
|
|
88
88
|
displayName: "StyledFooter",
|
|
89
|
-
componentId: "core-
|
|
89
|
+
componentId: "core-12_28_0__sc-1uf5708-13"
|
|
90
90
|
})(["border-top:1px solid ", ";"], colors.gray85);
|
|
91
91
|
export var StyledHeader = /*#__PURE__*/styled.div.withConfig({
|
|
92
92
|
displayName: "StyledHeader",
|
|
93
|
-
componentId: "core-
|
|
93
|
+
componentId: "core-12_28_0__sc-1uf5708-14"
|
|
94
94
|
})([""]);
|
|
95
95
|
export var StyledEmptyMessage = /*#__PURE__*/styled.div.withConfig({
|
|
96
96
|
displayName: "StyledEmptyMessage",
|
|
97
|
-
componentId: "core-
|
|
97
|
+
componentId: "core-12_28_0__sc-1uf5708-15"
|
|
98
98
|
})(["", ";padding:", "px ", "px;color:", ";"], getTypographyIntent('body'), spacing.md, spacing.lg, colors.gray45);
|
|
99
99
|
export var StyledSearchContainer = /*#__PURE__*/styled.div.withConfig({
|
|
100
100
|
displayName: "StyledSearchContainer",
|
|
101
|
-
componentId: "core-
|
|
101
|
+
componentId: "core-12_28_0__sc-1uf5708-16"
|
|
102
102
|
})(["padding:", "px ", "px ", "px;", " > *{pointer-events:none;}"], spacing.lg, spacing.lg, spacing.sm, StyledButton);
|
|
103
103
|
export var StyledGroup = /*#__PURE__*/styled.div.withConfig({
|
|
104
104
|
displayName: "StyledGroup",
|
|
105
|
-
componentId: "core-
|
|
105
|
+
componentId: "core-12_28_0__sc-1uf5708-17"
|
|
106
106
|
})(["", " color:", ";cursor:", ";font-weight:", ";padding:", "px ", "px;&:not(:first-child){padding-top:", "px;}&&{padding:0;}", "{padding:", "px ", " px;}&:not(:first-child){", "{padding-top:", " px;}}"], getTypographyIntent('body'), colors.gray15, function (_ref4) {
|
|
107
107
|
var $clickable = _ref4.$clickable;
|
|
108
108
|
return $clickable ? 'pointer' : 'default';
|
|
109
109
|
}, typographyWeights.semibold, spacing.xs, spacing.lg, spacing.md + spacing.xs, StyledOptionGroupLabel, spacing.xs, spacing.lg, StyledOptionGroupLabel, spacing.md + spacing.xs);
|
|
110
110
|
export var StyledItem = /*#__PURE__*/styled.div.withConfig({
|
|
111
111
|
displayName: "StyledItem",
|
|
112
|
-
componentId: "core-
|
|
112
|
+
componentId: "core-12_28_0__sc-1uf5708-18"
|
|
113
113
|
})(["", ";align-items:center;cursor:pointer;list-style-type:none;display:flex;padding:0;", " ", " ", " a{color:", ";display:block;margin:-", "px -", "px;padding:", "px ", "px;text-decoration:none;&:hover{color:", ";text-decoration:none;}}&[data-highlighted='true']{background-color:", ";}", " &:hover,&:active{", "{visibility:visible;}}", "{color:inherit;cursor:pointer;}", " ", " ", ""], getTypographyIntent('body'), function (_ref5) {
|
|
114
114
|
var $emptyMinHeight = _ref5.$emptyMinHeight;
|
|
115
115
|
return css(["&:empty{min-height:", "px;}"], $emptyMinHeight);
|
|
@@ -145,52 +145,56 @@ export var StyledItem = /*#__PURE__*/styled.div.withConfig({
|
|
|
145
145
|
return css(["background-color:", ";", "{visibility:visible;}"], colors.gray96, StyledGrip);
|
|
146
146
|
}
|
|
147
147
|
});
|
|
148
|
+
export var StyledSelectAll = /*#__PURE__*/styled(Box).withConfig({
|
|
149
|
+
displayName: "StyledSelectAll",
|
|
150
|
+
componentId: "core-12_28_0__sc-1uf5708-19"
|
|
151
|
+
})(["padding-top:", "px;padding-bottom:", "px;border-bottom:1px solid ", ";"], spacing.md, spacing.md, colors.gray85);
|
|
148
152
|
export var StyledDroppable = /*#__PURE__*/styled.div.withConfig({
|
|
149
153
|
displayName: "StyledDroppable",
|
|
150
|
-
componentId: "core-
|
|
154
|
+
componentId: "core-12_28_0__sc-1uf5708-20"
|
|
151
155
|
})(["", ",", "{padding-left:28px;}"], StyledGroup, StyledItem);
|
|
152
156
|
export var StyledSelectMenu = /*#__PURE__*/styled(Card).withConfig({
|
|
153
157
|
displayName: "StyledSelectMenu",
|
|
154
|
-
componentId: "core-
|
|
158
|
+
componentId: "core-12_28_0__sc-1uf5708-21"
|
|
155
159
|
})(["display:flex;max-height:40vh;max-width:", "px;min-width:inherit;"], styledSelectButtonDefaultWidth);
|
|
156
160
|
export var StyledLabel = /*#__PURE__*/styled.div.withConfig({
|
|
157
161
|
displayName: "StyledLabel",
|
|
158
|
-
componentId: "core-
|
|
162
|
+
componentId: "core-12_28_0__sc-1uf5708-22"
|
|
159
163
|
})(["", " flex-grow:1;margin-right:", "px;outline:none;pointer-events:", ";user-select:none;"], getEllipsis(), spacing.sm, function (_ref10) {
|
|
160
164
|
var $hoverable = _ref10.$hoverable;
|
|
161
165
|
return $hoverable ? 'initial' : 'none';
|
|
162
166
|
});
|
|
163
167
|
export var StyledIndicators = /*#__PURE__*/styled.div.withConfig({
|
|
164
168
|
displayName: "StyledIndicators",
|
|
165
|
-
componentId: "core-
|
|
169
|
+
componentId: "core-12_28_0__sc-1uf5708-23"
|
|
166
170
|
})(["align-items:center;align-self:flex-start;display:flex;height:34px;justify-content:flex-end;margin-left:", "px;min-width:40px;width:40px;"], spacing.xs);
|
|
167
171
|
export var StyledClearIcon = /*#__PURE__*/styled(Button).withConfig({
|
|
168
172
|
displayName: "StyledClearIcon",
|
|
169
|
-
componentId: "core-
|
|
173
|
+
componentId: "core-12_28_0__sc-1uf5708-24"
|
|
170
174
|
})([""]);
|
|
171
175
|
export var StyledSpinner = /*#__PURE__*/styled.div.withConfig({
|
|
172
176
|
displayName: "StyledSpinner",
|
|
173
|
-
componentId: "core-
|
|
177
|
+
componentId: "core-12_28_0__sc-1uf5708-25"
|
|
174
178
|
})(["align-items:center;display:flex;flex:0 0 auto;justify-content:center;line-height:0;"]);
|
|
175
179
|
export var StyledArrowContainer = /*#__PURE__*/styled.div.withConfig({
|
|
176
180
|
displayName: "StyledArrowContainer",
|
|
177
|
-
componentId: "core-
|
|
181
|
+
componentId: "core-12_28_0__sc-1uf5708-26"
|
|
178
182
|
})(["align-items:center;display:inline-flex;height:16px;justify-content:flex-end;margin-left:", "px;width:8px;"], spacing.sm);
|
|
179
183
|
export var StyledArrow = /*#__PURE__*/styled.span.withConfig({
|
|
180
184
|
displayName: "StyledArrow",
|
|
181
|
-
componentId: "core-
|
|
185
|
+
componentId: "core-12_28_0__sc-1uf5708-27"
|
|
182
186
|
})(["display:inline-flex;svg{fill:", ";}"], colors.gray45);
|
|
183
187
|
export var StyledArrowOutline = /*#__PURE__*/styled.polygon.withConfig({
|
|
184
188
|
displayName: "StyledArrowOutline",
|
|
185
|
-
componentId: "core-
|
|
189
|
+
componentId: "core-12_28_0__sc-1uf5708-28"
|
|
186
190
|
})([""]);
|
|
187
191
|
export var StyledArrowFill = /*#__PURE__*/styled.polygon.withConfig({
|
|
188
192
|
displayName: "StyledArrowFill",
|
|
189
|
-
componentId: "core-
|
|
193
|
+
componentId: "core-12_28_0__sc-1uf5708-29"
|
|
190
194
|
})([""]);
|
|
191
195
|
export var StyledTrigger = /*#__PURE__*/styled.div.withConfig({
|
|
192
196
|
displayName: "StyledTrigger",
|
|
193
|
-
componentId: "core-
|
|
197
|
+
componentId: "core-12_28_0__sc-1uf5708-30"
|
|
194
198
|
})(["", " align-items:center;background-color:", ";border-color:", ";border-radius:", "px;border-style:solid;border-width:1px;color:", ";cursor:pointer;display:inline-flex;height:36px;min-height:36px;outline:none;padding:0 ", "px;position:relative;white-space:nowrap;width:", ";&::placeholder{border-color:", ";}&:hover,&:active,&[data-qa=", "]{background-color:", ";border-color:", ";color:", ";}&:focus,&[data-qa=", "]{", " ", "{stroke:", ";}}", " ", " ", " ", " ", " ", " ", "}"], getTypographyIntent('body'), colors.white, colors.gray70, borderRadius.md, colors.gray15, spacing.md, function (_ref11) {
|
|
195
199
|
var $block = _ref11.$block;
|
|
196
200
|
return $block ? '100%' : "".concat(styledSelectButtonDefaultWidth, "px");
|
|
@@ -225,31 +229,31 @@ export var StyledTrigger = /*#__PURE__*/styled.div.withConfig({
|
|
|
225
229
|
});
|
|
226
230
|
export var StyledOverlay = /*#__PURE__*/styled(Card).withConfig({
|
|
227
231
|
displayName: "StyledOverlay",
|
|
228
|
-
componentId: "core-
|
|
232
|
+
componentId: "core-12_28_0__sc-1uf5708-31"
|
|
229
233
|
})(["display:flex;flex-direction:column;"]);
|
|
230
234
|
export var StyledVirtuoso = /*#__PURE__*/styled(Virtuoso).withConfig({
|
|
231
235
|
displayName: "StyledVirtuoso",
|
|
232
|
-
componentId: "core-
|
|
236
|
+
componentId: "core-12_28_0__sc-1uf5708-32"
|
|
233
237
|
})(["flex:1 1 auto;"]);
|
|
234
238
|
export var StyledEllipses = /*#__PURE__*/styled.div.withConfig({
|
|
235
239
|
displayName: "StyledEllipses",
|
|
236
|
-
componentId: "core-
|
|
240
|
+
componentId: "core-12_28_0__sc-1uf5708-33"
|
|
237
241
|
})(["", " display:inline-flex;> div{display:inline-flex;width:100%;}"], getEllipsis());
|
|
238
242
|
export var StyledMultiValueContainer = /*#__PURE__*/styled.div.withConfig({
|
|
239
243
|
displayName: "StyledMultiValueContainer",
|
|
240
|
-
componentId: "core-
|
|
244
|
+
componentId: "core-12_28_0__sc-1uf5708-34"
|
|
241
245
|
})(["display:flex;flex-wrap:wrap;margin-bottom:2px;margin-right:", "px;margin-top:2px;min-width:0;width:100%;"], spacing.xs);
|
|
242
246
|
export var StyledMultiValue = /*#__PURE__*/styled.div.withConfig({
|
|
243
247
|
displayName: "StyledMultiValue",
|
|
244
|
-
componentId: "core-
|
|
248
|
+
componentId: "core-12_28_0__sc-1uf5708-35"
|
|
245
249
|
})(["margin-bottom:2px;margin-right:", "px;margin-top:2px;flex:0 1 auto;> div{max-width:178px;width:100%;}"], spacing.xs);
|
|
246
250
|
export var StyledMultiInputContainer = /*#__PURE__*/styled.div.withConfig({
|
|
247
251
|
displayName: "StyledMultiInputContainer",
|
|
248
|
-
componentId: "core-
|
|
252
|
+
componentId: "core-12_28_0__sc-1uf5708-36"
|
|
249
253
|
})(["margin-bottom:2px;margin-right:", "px;margin-top:2px;flex:1;max-width:100%;min-width:24px;"], spacing.xs);
|
|
250
254
|
export var StyledMultiInput = /*#__PURE__*/styled.input.withConfig({
|
|
251
255
|
displayName: "StyledMultiInput",
|
|
252
|
-
componentId: "core-
|
|
256
|
+
componentId: "core-12_28_0__sc-1uf5708-37"
|
|
253
257
|
})(["background-color:transparent;border-width:0;font-family:inherit;padding:0;height:24px;width:100%;", " ", " &::-ms-clear{display:none;}&:focus{box-shadow:none;outline:none;}&::placeholder{color:", ";}"], getTypographyIntent('body'), function (_ref19) {
|
|
254
258
|
var $isNavigatingTokens = _ref19.$isNavigatingTokens;
|
|
255
259
|
return $isNavigatingTokens && css(["color:transparent;"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuperSelect.styles.js","names":["Virtuoso","styled","css","Box","Button","StyledButton","Card","StyledCheckboxLabel","Pill","StyledCircle","getTypographyIntent","typographyWeights","borderRadius","colors","getEllipsis","getFocus","spacing","dataQa","focused","hovered","optionMinHeight","checkedIconPlaceholderWidth","styledSelectButtonDefaultWidth","extendedSelectMenuWidth","PillSelectOptionWrapper","div","withConfig","displayName","componentId","xs","lg","PillSelectLabel","PillSelectLabelWrapper","_ref","disabled","StyledCheckboxContainer","StyledCheckmarkContainer","blue50","sm","StyledWrapper","StyledMenu","StyledOptions","_ref2","_ref2$$scrollable","$scrollable","StyledItemContent","StyledOptionGroupLabel","md","StyledItemLabel","_ref3","$draggable","StyledDraggableWrapper","StyledGrip","StyledFooter","gray85","StyledHeader","StyledEmptyMessage","gray45","StyledSearchContainer","StyledGroup","gray15","_ref4","$clickable","semibold","StyledItem","_ref5","$emptyMinHeight","_ref6","$isDraggingOver","$highlighted","_ref7","$disabled","$isDraggingDisabled","gray96","_ref8","concat","_ref9","$selected","_ref0","$isDraggable","_ref1","$isDragging","StyledDroppable","StyledSelectMenu","StyledLabel","_ref10","$hoverable","StyledIndicators","StyledClearIcon","StyledSpinner","StyledArrowContainer","StyledArrow","span","StyledArrowOutline","polygon","StyledArrowFill","StyledTrigger","white","gray70","_ref11","$block","_ref12","_ref12$$placeholder","$placeholder","_ref13","gray94","_ref14","$error","red50","_ref15","$hasClearIcon","_ref16","$multiple","_ref17","$open","_ref18","_ref18$$placeholder","StyledOverlay","StyledVirtuoso","StyledEllipses","StyledMultiValueContainer","StyledMultiValue","StyledMultiInputContainer","StyledMultiInput","input","_ref19","$isNavigatingTokens"],"sources":["../../src/SuperSelect/SuperSelect.styles.ts"],"sourcesContent":["import { Virtuoso } from 'react-virtuoso'\nimport styled, { css } from 'styled-components'\nimport { Box } from '../Box/Box'\nimport { Button } from '../Button'\nimport { StyledButton } from '../Button/Button.styles'\nimport { Card } from '../Card/Card'\nimport { StyledCheckboxLabel } from '../Checkbox/Checkbox.styles'\nimport { Pill } from '../Pill/Pill'\nimport { StyledCircle } from '../Spinner/Spinner.styles'\nimport {\n getTypographyIntent,\n typographyWeights,\n} from '../Typography/Typography.styles'\nimport { borderRadius } from '../_styles/borderRadius'\nimport { colors } from '../_styles/colors'\nimport { getEllipsis, getFocus } from '../_styles/mixins'\nimport { spacing } from '../_styles/spacing'\n\nexport type SuperSelectStyledTriggerProps = {\n $block?: boolean\n $disabled?: boolean\n $error?: boolean\n $hasClearIcon?: boolean\n $loading?: boolean\n $multiple?: boolean\n $open?: boolean\n $placeholder?: boolean\n}\n\nexport const dataQa = {\n focused: 'core-select-focused',\n hovered: 'core-select-hovered',\n}\n\nconst optionMinHeight = 32\n\nconst checkedIconPlaceholderWidth = 32\n\nconst styledSelectButtonDefaultWidth = 248\n\nexport const extendedSelectMenuWidth = 360\n\nexport const PillSelectOptionWrapper = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ${spacing.xs}px ${spacing.lg}px;\n`\n\nexport const PillSelectLabel = styled(Pill)`\n ${getEllipsis}\n`\n\nexport const PillSelectLabelWrapper = styled.div<{ disabled?: boolean }>`\n display: flex;\n max-width: 100%;\n pointer-events: auto;\n\n ${({ disabled }) =>\n disabled &&\n css`\n pointer-events: none;\n `}\n`\n\nexport const StyledCheckboxContainer = styled.div`\n padding-left: ${spacing.lg}px;\n`\n\nexport const StyledCheckmarkContainer = styled.div`\n align-items: center;\n color: ${colors.blue50};\n display: inline-flex;\n flex-shrink: 0;\n padding: 0 ${spacing.lg}px 0 ${spacing.sm}px;\n`\n\n// Do not merge with StyledMenu, needed for max-height working in IE\nexport const StyledWrapper = styled.div`\n display: flex;\n max-height: inherit;\n min-width: inherit;\n outline: none;\n width: inherit;\n`\n\nexport const StyledMenu = styled.div`\n display: flex;\n flex-direction: column;\n outline: 0;\n width: 100%;\n`\n\nexport const StyledOptions = styled.div<{ $scrollable?: boolean }>`\n flex-basis: auto;\n flex-grow: 1;\n flex-shrink: 1;\n min-height: ${optionMinHeight}px;\n ${({ $scrollable = true }) => $scrollable && `overflow-y: auto`};\n padding: ${spacing.sm}px 0;\n position: relative;\n overflow: hidden;\n\n &:focus {\n ${getFocus()}\n margin: -1px;\n }\n`\n\nexport const StyledItemContent = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n`\n\nexport const StyledOptionGroupLabel = styled.div`\n padding: ${spacing.md}px 0 ${spacing.xs}px ${spacing.lg}px;\n`\n\nexport const StyledItemLabel = styled.div<{\n $draggable?: boolean\n $selectionStyle?: 'highlight' | 'checkbox' | 'checkmark'\n}>`\n ${({ $draggable }) => {\n return css`\n padding: ${spacing.xs}px ${$draggable ? 0 : spacing.lg}px;\n overflow-wrap: anywhere;\n `\n }}\n`\n\nexport const StyledDraggableWrapper = styled.div`\n display: flex;\n width: 100%;\n align-items: center;\n`\n\nexport const StyledGrip = styled.div`\n padding: 0 2px;\n height: 24px;\n visibility: hidden;\n`\n\nexport const StyledFooter = styled(Box)`\n border-top: 1px solid ${colors.gray85};\n`\n\nexport const StyledHeader = styled.div``\n\nexport const StyledEmptyMessage = styled.div`\n ${getTypographyIntent('body')};\n\n padding: ${spacing.md}px ${spacing.lg}px;\n color: ${colors.gray45};\n`\n\nexport const StyledSearchContainer = styled.div`\n padding: ${spacing.lg}px ${spacing.lg}px ${spacing.sm}px;\n\n ${StyledButton} > * {\n pointer-events: none;\n }\n`\n\nexport const StyledGroup = styled.div<{ $clickable?: boolean }>`\n ${getTypographyIntent('body')}\n\n color: ${colors.gray15};\n cursor: ${({ $clickable }) => ($clickable ? 'pointer' : 'default')};\n font-weight: ${typographyWeights.semibold};\n padding: ${spacing.xs}px ${spacing.lg}px;\n\n &:not(:first-child) {\n padding-top: ${spacing.md + spacing.xs}px;\n }\n\n && {\n padding: 0;\n }\n\n ${StyledOptionGroupLabel} {\n padding: ${spacing.xs}px ${spacing.lg} px;\n }\n\n &:not(:first-child) {\n ${StyledOptionGroupLabel} {\n padding-top: ${spacing.md + spacing.xs} px;\n }\n }\n`\n\nexport const StyledItem = styled.div<{\n $disabled?: boolean\n $selected?: boolean\n $highlighted?: boolean\n $isDraggable?: boolean\n $isDragging?: boolean\n $emptyMinHeight?: number\n $isDraggingOver?: boolean\n $isDraggingDisabled?: boolean\n}>`\n ${getTypographyIntent('body')};\n\n align-items: center;\n cursor: pointer;\n list-style-type: none;\n display: flex;\n padding: 0;\n\n ${({ $emptyMinHeight }) => {\n return css`\n &:empty {\n min-height: ${$emptyMinHeight}px;\n }\n `\n }}\n\n ${({ $isDraggingOver, $highlighted }) => {\n return (\n $isDraggingOver &&\n $highlighted &&\n css`\n background-color: initial;\n `\n )\n }}\n\n ${({ $isDraggingOver, $disabled, $isDraggingDisabled }) => {\n return (\n ($isDraggingOver || $disabled || $isDraggingDisabled) &&\n css`\n &:hover {\n ${StyledGrip} {\n visibility: hidden;\n }\n }\n `\n )\n }}\n\n a {\n // We decided to use a negative margin trick here to allow us to continue\n // to use listNavigation without having to rewrite a bunch of code in js\n color: ${colors.gray15};\n display: block;\n margin: -${spacing.xs}px -${spacing.lg}px;\n padding: ${spacing.xs}px ${spacing.lg}px;\n text-decoration: none;\n\n &:hover {\n color: ${colors.gray15};\n text-decoration: none;\n }\n }\n\n &[data-highlighted='true'] {\n background-color: ${colors.gray96};\n }\n\n ${({ $highlighted }) => $highlighted && `background-color: ${colors.gray96};`}\n\n &:hover,\n &:active {\n ${StyledGrip} {\n visibility: visible;\n }\n }\n\n ${StyledCheckboxLabel} {\n color: inherit;\n cursor: pointer;\n }\n\n ${({ $disabled, $selected }) => {\n if ($disabled) {\n return css`\n &,\n ${StyledCheckboxLabel} {\n color: ${colors.gray85};\n cursor: default;\n }\n `\n } else if ($selected) {\n return css`\n color: ${colors.blue50};\n font-weight: 700;\n\n a,\n a:hover {\n color: ${colors.blue50};\n text-decoration: none;\n }\n\n &[data-highlighted='true'] {\n background-color: ${colors.gray96};\n }\n `\n }\n\n return css`\n color: ${colors.gray15};\n\n &[data-highlighted='true'] {\n background-color: ${colors.gray96};\n }\n `\n }}\n\n ${({ $isDraggable }) => {\n if ($isDraggable) {\n return css`\n ${StyledCheckboxLabel} {\n cursor: grab;\n\n // The unchecked and checked icons\n &:before,\n &:after {\n cursor: pointer;\n }\n }\n\n &&& {\n padding-left: 0;\n }\n `\n }\n }}\n\n ${({ $isDragging }) => {\n if ($isDragging) {\n return css`\n background-color: ${colors.gray96};\n\n ${StyledGrip} {\n visibility: visible;\n }\n `\n }\n }}\n`\n\nexport const StyledDroppable = styled.div`\n ${StyledGroup}, ${StyledItem} {\n padding-left: 28px;\n }\n`\n\nexport const StyledSelectMenu = styled(Card)`\n display: flex;\n max-height: 40vh;\n max-width: ${styledSelectButtonDefaultWidth}px;\n min-width: inherit;\n`\n\nexport const StyledLabel = styled.div<{ $hoverable: boolean }>`\n ${getEllipsis()}\n flex-grow: 1;\n margin-right: ${spacing.sm}px;\n outline: none;\n pointer-events: ${({ $hoverable }) => ($hoverable ? 'initial' : 'none')};\n user-select: none;\n`\n\nexport const StyledIndicators = styled.div`\n align-items: center;\n align-self: flex-start;\n display: flex;\n height: 34px;\n justify-content: flex-end;\n margin-left: ${spacing.xs}px;\n min-width: 40px;\n width: 40px;\n`\n\nexport const StyledClearIcon = styled(Button)``\n\nexport const StyledSpinner = styled.div`\n align-items: center;\n display: flex;\n flex: 0 0 auto;\n justify-content: center;\n line-height: 0;\n`\n\nexport const StyledArrowContainer = styled.div`\n align-items: center;\n display: inline-flex;\n height: 16px;\n justify-content: flex-end;\n margin-left: ${spacing.sm}px;\n width: 8px;\n`\n\nexport const StyledArrow = styled.span`\n display: inline-flex;\n\n svg {\n fill: ${colors.gray45};\n }\n`\n\nexport const StyledArrowOutline = styled.polygon``\n\nexport const StyledArrowFill = styled.polygon``\n\nexport const StyledTrigger = styled.div<SuperSelectStyledTriggerProps>`\n ${getTypographyIntent('body')}\n\n align-items: center;\n background-color: ${colors.white};\n border-color: ${colors.gray70};\n border-radius: ${borderRadius.md}px;\n border-style: solid;\n border-width: 1px;\n color: ${colors.gray15};\n cursor: pointer;\n display: inline-flex;\n height: 36px;\n min-height: 36px;\n outline: none;\n padding: 0 ${spacing.md}px;\n position: relative;\n white-space: nowrap;\n width: ${({ $block }) =>\n $block ? '100%' : `${styledSelectButtonDefaultWidth}px`};\n\n &::placeholder {\n border-color: ${colors.gray45};\n }\n\n &:hover,\n &:active,\n &[data-qa=${dataQa.hovered}] {\n background-color: ${colors.white};\n border-color: ${colors.gray45};\n color: ${colors.gray15};\n }\n\n &:focus,\n &[data-qa=${dataQa.focused}] {\n ${getFocus()}\n\n ${StyledCircle} {\n stroke: ${colors.blue50};\n }\n }\n\n ${({ $placeholder = false }) =>\n $placeholder &&\n css`\n ${StyledLabel} {\n color: ${colors.gray45};\n }\n `}\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n background-color: ${colors.gray94};\n border-color: ${colors.gray70};\n color: ${colors.gray45};\n cursor: default;\n pointer-events: none;\n\n ${StyledLabel} {\n color: ${colors.gray70};\n }\n\n ${StyledArrow} {\n svg {\n fill: ${colors.gray70};\n }\n }\n `}\n\n ${({ $error, $disabled }) => {\n if ($error && !$disabled) {\n return css`\n &,\n &:hover {\n border-color: ${colors.red50};\n border-color: var(--core-input-error-border-color, ${colors.red50});\n }\n &:hover:focus {\n ${getFocus()}\n }\n `\n }\n }}\n\n ${({ $hasClearIcon }) => css`\n ${StyledClearIcon} {\n opacity: ${$hasClearIcon ? 1 : 0};\n }\n `}\n\n ${({ $multiple }) =>\n $multiple &&\n css`\n height: auto;\n\n &:focus-within {\n ${getFocus()}\n }\n `}\n\n ${({ $open, $hasClearIcon }) =>\n $open &&\n $hasClearIcon &&\n css`\n ${StyledClearIcon} {\n opacity: 1;\n pointer-events: all;\n }\n `}\n\n ${({ $open, $placeholder = false }) =>\n $open &&\n $placeholder &&\n css`\n ${StyledLabel} {\n opacity: 1;\n pointer-events: all;\n }\n `}\n }\n`\n\nexport const StyledOverlay = styled(Card)`\n display: flex;\n flex-direction: column;\n`\n\nexport const StyledVirtuoso = styled(Virtuoso)`\n flex: 1 1 auto;\n`\n\nexport const StyledEllipses = styled.div`\n ${getEllipsis()}\n display: inline-flex;\n\n > div {\n display: inline-flex;\n width: 100%;\n }\n`\n\nexport const StyledMultiValueContainer = styled.div`\n display: flex;\n flex-wrap: wrap;\n margin-bottom: 2px;\n margin-right: ${spacing.xs}px;\n margin-top: 2px;\n min-width: 0;\n width: 100%;\n`\n\nexport const StyledMultiValue = styled.div`\n margin-bottom: 2px;\n margin-right: ${spacing.xs}px;\n margin-top: 2px;\n flex: 0 1 auto;\n\n > div {\n max-width: 178px;\n width: 100%;\n }\n`\n\nexport const StyledMultiInputContainer = styled.div`\n margin-bottom: 2px;\n margin-right: ${spacing.xs}px;\n margin-top: 2px;\n flex: 1;\n max-width: 100%;\n min-width: 24px;\n`\n\nexport const StyledMultiInput = styled.input<{\n $isNavigatingTokens?: boolean\n}>`\n background-color: transparent;\n border-width: 0;\n font-family: inherit;\n padding: 0;\n height: 24px;\n width: 100%;\n\n ${getTypographyIntent('body')}\n\n ${({ $isNavigatingTokens }) =>\n $isNavigatingTokens &&\n css`\n color: transparent;\n `}\n\n &::-ms-clear {\n display: none;\n }\n\n &:focus {\n box-shadow: none;\n outline: none;\n }\n\n &::placeholder {\n color: ${colors.gray45};\n }\n`\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,GAAG,QAAQ,YAAY;AAChC,SAASC,MAAM,QAAQ,WAA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,WAAA;EAAAC,WAAA;AAAA,iHAIjCZ,OAAO,CAACa,EAAE,CAI3B;AAED,OAAO,IAAM4F,gBAAgB,gBAAGxH,MAAM,CAACwB,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,8GAExBZ,OAAO,CAACa,EAAE,CAQ3B;AAED,OAAO,IAAM6F,yBAAyB,gBAAGzH,MAAM,CAACwB,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,mGAEjCZ,OAAO,CAACa,EAAE,CAK3B;AAED,OAAO,IAAM8F,gBAAgB,gBAAG1H,MAAM,CAAC2H,KAAK,CAAAlG,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gNAUxClB,mBAAmB,CAAC,MAAM,CAAC,EAE3B,UAAAmH,MAAA;EAAA,IAAGC,mBAAmB,GAAAD,MAAA,CAAnBC,mBAAmB;EAAA,OACtBA,mBAAmB,IACnB5H,GAAG,wBAEF;AAAA,GAYQW,MAAM,CAAC4C,MAAM,CAEzB"}
|
|
1
|
+
{"version":3,"file":"SuperSelect.styles.js","names":["Virtuoso","styled","css","Box","Button","StyledButton","Card","StyledCheckboxLabel","Pill","StyledCircle","getTypographyIntent","typographyWeights","borderRadius","colors","getEllipsis","getFocus","spacing","dataQa","focused","hovered","optionMinHeight","checkedIconPlaceholderWidth","styledSelectButtonDefaultWidth","extendedSelectMenuWidth","PillSelectOptionWrapper","div","withConfig","displayName","componentId","xs","lg","PillSelectLabel","PillSelectLabelWrapper","_ref","disabled","StyledCheckboxContainer","StyledCheckmarkContainer","blue50","sm","StyledWrapper","StyledMenu","StyledOptions","_ref2","_ref2$$scrollable","$scrollable","StyledItemContent","StyledOptionGroupLabel","md","StyledItemLabel","_ref3","$draggable","StyledDraggableWrapper","StyledGrip","StyledFooter","gray85","StyledHeader","StyledEmptyMessage","gray45","StyledSearchContainer","StyledGroup","gray15","_ref4","$clickable","semibold","StyledItem","_ref5","$emptyMinHeight","_ref6","$isDraggingOver","$highlighted","_ref7","$disabled","$isDraggingDisabled","gray96","_ref8","concat","_ref9","$selected","_ref0","$isDraggable","_ref1","$isDragging","StyledSelectAll","StyledDroppable","StyledSelectMenu","StyledLabel","_ref10","$hoverable","StyledIndicators","StyledClearIcon","StyledSpinner","StyledArrowContainer","StyledArrow","span","StyledArrowOutline","polygon","StyledArrowFill","StyledTrigger","white","gray70","_ref11","$block","_ref12","_ref12$$placeholder","$placeholder","_ref13","gray94","_ref14","$error","red50","_ref15","$hasClearIcon","_ref16","$multiple","_ref17","$open","_ref18","_ref18$$placeholder","StyledOverlay","StyledVirtuoso","StyledEllipses","StyledMultiValueContainer","StyledMultiValue","StyledMultiInputContainer","StyledMultiInput","input","_ref19","$isNavigatingTokens"],"sources":["../../src/SuperSelect/SuperSelect.styles.ts"],"sourcesContent":["import { Virtuoso } from 'react-virtuoso'\nimport styled, { css } from 'styled-components'\nimport { Box } from '../Box/Box'\nimport { Button } from '../Button'\nimport { StyledButton } from '../Button/Button.styles'\nimport { Card } from '../Card/Card'\nimport { StyledCheckboxLabel } from '../Checkbox/Checkbox.styles'\nimport { Pill } from '../Pill/Pill'\nimport { StyledCircle } from '../Spinner/Spinner.styles'\nimport {\n getTypographyIntent,\n typographyWeights,\n} from '../Typography/Typography.styles'\nimport { borderRadius } from '../_styles/borderRadius'\nimport { colors } from '../_styles/colors'\nimport { getEllipsis, getFocus } from '../_styles/mixins'\nimport { spacing } from '../_styles/spacing'\n\nexport type SuperSelectStyledTriggerProps = {\n $block?: boolean\n $disabled?: boolean\n $error?: boolean\n $hasClearIcon?: boolean\n $loading?: boolean\n $multiple?: boolean\n $open?: boolean\n $placeholder?: boolean\n}\n\nexport const dataQa = {\n focused: 'core-select-focused',\n hovered: 'core-select-hovered',\n}\n\nconst optionMinHeight = 32\n\nconst checkedIconPlaceholderWidth = 32\n\nconst styledSelectButtonDefaultWidth = 248\n\nexport const extendedSelectMenuWidth = 360\n\nexport const PillSelectOptionWrapper = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ${spacing.xs}px ${spacing.lg}px;\n`\n\nexport const PillSelectLabel = styled(Pill)`\n ${getEllipsis}\n`\n\nexport const PillSelectLabelWrapper = styled.div<{ disabled?: boolean }>`\n display: flex;\n max-width: 100%;\n pointer-events: auto;\n\n ${({ disabled }) =>\n disabled &&\n css`\n pointer-events: none;\n `}\n`\n\nexport const StyledCheckboxContainer = styled.div`\n padding-left: ${spacing.lg}px;\n`\n\nexport const StyledCheckmarkContainer = styled.div`\n align-items: center;\n color: ${colors.blue50};\n display: inline-flex;\n flex-shrink: 0;\n padding: 0 ${spacing.lg}px 0 ${spacing.sm}px;\n`\n\n// Do not merge with StyledMenu, needed for max-height working in IE\nexport const StyledWrapper = styled.div`\n display: flex;\n max-height: inherit;\n min-width: inherit;\n outline: none;\n width: inherit;\n`\n\nexport const StyledMenu = styled.div`\n display: flex;\n flex-direction: column;\n outline: 0;\n width: 100%;\n`\n\nexport const StyledOptions = styled.div<{ $scrollable?: boolean }>`\n flex-basis: auto;\n flex-grow: 1;\n flex-shrink: 1;\n min-height: ${optionMinHeight}px;\n ${({ $scrollable = true }) => $scrollable && `overflow-y: auto`};\n padding: ${spacing.sm}px 0;\n position: relative;\n overflow: hidden;\n\n &:focus {\n ${getFocus()}\n margin: -1px;\n }\n`\n\nexport const StyledItemContent = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n`\n\nexport const StyledOptionGroupLabel = styled.div`\n padding: ${spacing.md}px 0 ${spacing.xs}px ${spacing.lg}px;\n`\n\nexport const StyledItemLabel = styled.div<{\n $draggable?: boolean\n $selectionStyle?: 'highlight' | 'checkbox' | 'checkmark'\n}>`\n ${({ $draggable }) => {\n return css`\n padding: ${spacing.xs}px ${$draggable ? 0 : spacing.lg}px;\n overflow-wrap: anywhere;\n `\n }}\n`\n\nexport const StyledDraggableWrapper = styled.div`\n display: flex;\n width: 100%;\n align-items: center;\n`\n\nexport const StyledGrip = styled.div`\n padding: 0 2px;\n height: 24px;\n visibility: hidden;\n`\n\nexport const StyledFooter = styled(Box)`\n border-top: 1px solid ${colors.gray85};\n`\n\nexport const StyledHeader = styled.div``\n\nexport const StyledEmptyMessage = styled.div`\n ${getTypographyIntent('body')};\n\n padding: ${spacing.md}px ${spacing.lg}px;\n color: ${colors.gray45};\n`\n\nexport const StyledSearchContainer = styled.div`\n padding: ${spacing.lg}px ${spacing.lg}px ${spacing.sm}px;\n\n ${StyledButton} > * {\n pointer-events: none;\n }\n`\n\nexport const StyledGroup = styled.div<{ $clickable?: boolean }>`\n ${getTypographyIntent('body')}\n\n color: ${colors.gray15};\n cursor: ${({ $clickable }) => ($clickable ? 'pointer' : 'default')};\n font-weight: ${typographyWeights.semibold};\n padding: ${spacing.xs}px ${spacing.lg}px;\n\n &:not(:first-child) {\n padding-top: ${spacing.md + spacing.xs}px;\n }\n\n && {\n padding: 0;\n }\n\n ${StyledOptionGroupLabel} {\n padding: ${spacing.xs}px ${spacing.lg} px;\n }\n\n &:not(:first-child) {\n ${StyledOptionGroupLabel} {\n padding-top: ${spacing.md + spacing.xs} px;\n }\n }\n`\n\nexport const StyledItem = styled.div<{\n $disabled?: boolean\n $selected?: boolean\n $highlighted?: boolean\n $isDraggable?: boolean\n $isDragging?: boolean\n $emptyMinHeight?: number\n $isDraggingOver?: boolean\n $isDraggingDisabled?: boolean\n}>`\n ${getTypographyIntent('body')};\n\n align-items: center;\n cursor: pointer;\n list-style-type: none;\n display: flex;\n padding: 0;\n\n ${({ $emptyMinHeight }) => {\n return css`\n &:empty {\n min-height: ${$emptyMinHeight}px;\n }\n `\n }}\n\n ${({ $isDraggingOver, $highlighted }) => {\n return (\n $isDraggingOver &&\n $highlighted &&\n css`\n background-color: initial;\n `\n )\n }}\n\n ${({ $isDraggingOver, $disabled, $isDraggingDisabled }) => {\n return (\n ($isDraggingOver || $disabled || $isDraggingDisabled) &&\n css`\n &:hover {\n ${StyledGrip} {\n visibility: hidden;\n }\n }\n `\n )\n }}\n\n a {\n // We decided to use a negative margin trick here to allow us to continue\n // to use listNavigation without having to rewrite a bunch of code in js\n color: ${colors.gray15};\n display: block;\n margin: -${spacing.xs}px -${spacing.lg}px;\n padding: ${spacing.xs}px ${spacing.lg}px;\n text-decoration: none;\n\n &:hover {\n color: ${colors.gray15};\n text-decoration: none;\n }\n }\n\n &[data-highlighted='true'] {\n background-color: ${colors.gray96};\n }\n\n ${({ $highlighted }) => $highlighted && `background-color: ${colors.gray96};`}\n\n &:hover,\n &:active {\n ${StyledGrip} {\n visibility: visible;\n }\n }\n\n ${StyledCheckboxLabel} {\n color: inherit;\n cursor: pointer;\n }\n\n ${({ $disabled, $selected }) => {\n if ($disabled) {\n return css`\n &,\n ${StyledCheckboxLabel} {\n color: ${colors.gray85};\n cursor: default;\n }\n `\n } else if ($selected) {\n return css`\n color: ${colors.blue50};\n font-weight: 700;\n\n a,\n a:hover {\n color: ${colors.blue50};\n text-decoration: none;\n }\n\n &[data-highlighted='true'] {\n background-color: ${colors.gray96};\n }\n `\n }\n\n return css`\n color: ${colors.gray15};\n\n &[data-highlighted='true'] {\n background-color: ${colors.gray96};\n }\n `\n }}\n\n ${({ $isDraggable }) => {\n if ($isDraggable) {\n return css`\n ${StyledCheckboxLabel} {\n cursor: grab;\n\n // The unchecked and checked icons\n &:before,\n &:after {\n cursor: pointer;\n }\n }\n\n &&& {\n padding-left: 0;\n }\n `\n }\n }}\n\n ${({ $isDragging }) => {\n if ($isDragging) {\n return css`\n background-color: ${colors.gray96};\n\n ${StyledGrip} {\n visibility: visible;\n }\n `\n }\n }}\n`\n\nexport const StyledSelectAll = styled(Box)`\n padding-top: ${spacing.md}px;\n padding-bottom: ${spacing.md}px;\n border-bottom: 1px solid ${colors.gray85};\n`\n\nexport const StyledDroppable = styled.div`\n ${StyledGroup}, ${StyledItem} {\n padding-left: 28px;\n }\n`\n\nexport const StyledSelectMenu = styled(Card)`\n display: flex;\n max-height: 40vh;\n max-width: ${styledSelectButtonDefaultWidth}px;\n min-width: inherit;\n`\n\nexport const StyledLabel = styled.div<{ $hoverable: boolean }>`\n ${getEllipsis()}\n flex-grow: 1;\n margin-right: ${spacing.sm}px;\n outline: none;\n pointer-events: ${({ $hoverable }) => ($hoverable ? 'initial' : 'none')};\n user-select: none;\n`\n\nexport const StyledIndicators = styled.div`\n align-items: center;\n align-self: flex-start;\n display: flex;\n height: 34px;\n justify-content: flex-end;\n margin-left: ${spacing.xs}px;\n min-width: 40px;\n width: 40px;\n`\n\nexport const StyledClearIcon = styled(Button)``\n\nexport const StyledSpinner = styled.div`\n align-items: center;\n display: flex;\n flex: 0 0 auto;\n justify-content: center;\n line-height: 0;\n`\n\nexport const StyledArrowContainer = styled.div`\n align-items: center;\n display: inline-flex;\n height: 16px;\n justify-content: flex-end;\n margin-left: ${spacing.sm}px;\n width: 8px;\n`\n\nexport const StyledArrow = styled.span`\n display: inline-flex;\n\n svg {\n fill: ${colors.gray45};\n }\n`\n\nexport const StyledArrowOutline = styled.polygon``\n\nexport const StyledArrowFill = styled.polygon``\n\nexport const StyledTrigger = styled.div<SuperSelectStyledTriggerProps>`\n ${getTypographyIntent('body')}\n\n align-items: center;\n background-color: ${colors.white};\n border-color: ${colors.gray70};\n border-radius: ${borderRadius.md}px;\n border-style: solid;\n border-width: 1px;\n color: ${colors.gray15};\n cursor: pointer;\n display: inline-flex;\n height: 36px;\n min-height: 36px;\n outline: none;\n padding: 0 ${spacing.md}px;\n position: relative;\n white-space: nowrap;\n width: ${({ $block }) =>\n $block ? '100%' : `${styledSelectButtonDefaultWidth}px`};\n\n &::placeholder {\n border-color: ${colors.gray45};\n }\n\n &:hover,\n &:active,\n &[data-qa=${dataQa.hovered}] {\n background-color: ${colors.white};\n border-color: ${colors.gray45};\n color: ${colors.gray15};\n }\n\n &:focus,\n &[data-qa=${dataQa.focused}] {\n ${getFocus()}\n\n ${StyledCircle} {\n stroke: ${colors.blue50};\n }\n }\n\n ${({ $placeholder = false }) =>\n $placeholder &&\n css`\n ${StyledLabel} {\n color: ${colors.gray45};\n }\n `}\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n background-color: ${colors.gray94};\n border-color: ${colors.gray70};\n color: ${colors.gray45};\n cursor: default;\n pointer-events: none;\n\n ${StyledLabel} {\n color: ${colors.gray70};\n }\n\n ${StyledArrow} {\n svg {\n fill: ${colors.gray70};\n }\n }\n `}\n\n ${({ $error, $disabled }) => {\n if ($error && !$disabled) {\n return css`\n &,\n &:hover {\n border-color: ${colors.red50};\n border-color: var(--core-input-error-border-color, ${colors.red50});\n }\n &:hover:focus {\n ${getFocus()}\n }\n `\n }\n }}\n\n ${({ $hasClearIcon }) => css`\n ${StyledClearIcon} {\n opacity: ${$hasClearIcon ? 1 : 0};\n }\n `}\n\n ${({ $multiple }) =>\n $multiple &&\n css`\n height: auto;\n\n &:focus-within {\n ${getFocus()}\n }\n `}\n\n ${({ $open, $hasClearIcon }) =>\n $open &&\n $hasClearIcon &&\n css`\n ${StyledClearIcon} {\n opacity: 1;\n pointer-events: all;\n }\n `}\n\n ${({ $open, $placeholder = false }) =>\n $open &&\n $placeholder &&\n css`\n ${StyledLabel} {\n opacity: 1;\n pointer-events: all;\n }\n `}\n }\n`\n\nexport const StyledOverlay = styled(Card)`\n display: flex;\n flex-direction: column;\n`\n\nexport const StyledVirtuoso = styled(Virtuoso)`\n flex: 1 1 auto;\n`\n\nexport const StyledEllipses = styled.div`\n ${getEllipsis()}\n display: inline-flex;\n\n > div {\n display: inline-flex;\n width: 100%;\n }\n`\n\nexport const StyledMultiValueContainer = styled.div`\n display: flex;\n flex-wrap: wrap;\n margin-bottom: 2px;\n margin-right: ${spacing.xs}px;\n margin-top: 2px;\n min-width: 0;\n width: 100%;\n`\n\nexport const StyledMultiValue = styled.div`\n margin-bottom: 2px;\n margin-right: ${spacing.xs}px;\n margin-top: 2px;\n flex: 0 1 auto;\n\n > div {\n max-width: 178px;\n width: 100%;\n }\n`\n\nexport const StyledMultiInputContainer = styled.div`\n margin-bottom: 2px;\n margin-right: ${spacing.xs}px;\n margin-top: 2px;\n flex: 1;\n max-width: 100%;\n min-width: 24px;\n`\n\nexport const StyledMultiInput = styled.input<{\n $isNavigatingTokens?: boolean\n}>`\n background-color: transparent;\n border-width: 0;\n font-family: inherit;\n padding: 0;\n height: 24px;\n width: 100%;\n\n ${getTypographyIntent('body')}\n\n ${({ $isNavigatingTokens }) =>\n $isNavigatingTokens &&\n css`\n color: transparent;\n `}\n\n &::-ms-clear {\n display: none;\n }\n\n &:focus {\n box-shadow: none;\n outline: none;\n }\n\n &::placeholder {\n color: ${colors.gray45};\n }\n`\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,GAAG,QAAQ,YAAY;AAChC,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,mBAAmB,QAAQ,6BAA6B;AACjE,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SACEC,mBAAmB,EACnBC,iBAAiB,QACZ,iCAAiC;AACxC,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,WAAW,EAAEC,QAAQ,QAAQ,mBAAmB;AACzD,SAASC,OAAO,QAAQ,oBAAoB;AAa5C,OAAO,IAAMC,MAAM,GAAG;EACpBC,OAAO,EAAE,qBAAqB;EAC9BC,OAAO,EAAE;AACX,CAAC;AAED,IAAMC,eAAe,GAAG,EAAE;AAE1B,IAAMC,2BAA2B,GAAG,EAAE;AAEtC,IAAMC,8BAA8B,GAAG,GAAG;AAE1C,OAAO,IAAMC,uBAAuB,GAAG,GAAG;AAE1C,OAAO,IAAMC,uBAAuB,gBAAGvB,MAAM,CAACwB,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,6FAIpCZ,OA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AAD,MAAA,CAAnBC,mBAAmB;EAAA,OACtBA,mBAAmB,IACnB7H,GAAG,wBAEF;AAAA,GAYQW,MAAM,CAAC4C,MAAM,CAEzB"}
|
|
@@ -40,19 +40,43 @@ export interface SuperSelectConfig {
|
|
|
40
40
|
disabled?: boolean;
|
|
41
41
|
draggable?: boolean;
|
|
42
42
|
emptyMessage?: string;
|
|
43
|
+
selectAllEnabled?: boolean;
|
|
43
44
|
error?: boolean;
|
|
44
45
|
footer?: React.ReactElement;
|
|
45
46
|
getOptionGroup?: (option: SuperSelectOption) => string;
|
|
46
47
|
getOptionIsBatch?: (option: SuperSelectOption) => boolean;
|
|
47
48
|
getOptionIsDisabled?: (option: SuperSelectOption) => boolean;
|
|
49
|
+
getOptionIsPartiallySelected?: (option: SuperSelectOption) => boolean;
|
|
50
|
+
getOptionIsSelected?: (option: SuperSelectOption) => boolean;
|
|
48
51
|
getOptionLabel?: (option: SuperSelectOption) => string;
|
|
49
|
-
getOptionPartiallySelected?: (option: SuperSelectOption) => boolean;
|
|
50
52
|
getOptionValue?: (option: SuperSelectOption) => SuperSelectValuePrimitive;
|
|
51
53
|
header?: React.ReactElement;
|
|
52
54
|
loading?: boolean;
|
|
53
55
|
multiple?: boolean;
|
|
54
56
|
onChange?: (value: SuperSelectValue) => void;
|
|
55
57
|
onManualSort?: (options: SuperSelectOption[]) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Callback function triggered when the "Select All" functionality is used in a multi-select SuperSelect.
|
|
60
|
+
*
|
|
61
|
+
* This prop is only relevant when `multiple={true}` and `selectAllEnabled={true}`. The callback is invoked
|
|
62
|
+
* when users interact with a select all option in the select list that allows them to
|
|
63
|
+
* select or deselect all available options at once.
|
|
64
|
+
*
|
|
65
|
+
* @param selectedOptions - An array of all options that would be selected when "Select All" is triggered.
|
|
66
|
+
* This includes all selectable options (excluding disabled options) that are
|
|
67
|
+
* currently visible and available for selection.
|
|
68
|
+
*
|
|
69
|
+
* @remarks
|
|
70
|
+
* - Only called when the component is in multi-select mode (`multiple={true}`)
|
|
71
|
+
* - Requires `selectAllEnabled={true}` to show the select-all UI
|
|
72
|
+
* - Disabled options are automatically excluded from the selectedOptions array
|
|
73
|
+
* - Allows additional customization of select-all behavior if needed by implementing custom logic within the callback
|
|
74
|
+
*
|
|
75
|
+
* @see {@link selectAllEnabled} - Enable the select-all functionality
|
|
76
|
+
* @see {@link multiple} - Enable multi-select mode
|
|
77
|
+
* @see {@link getOptionIsDisabled} - Function to determine if options are disabled
|
|
78
|
+
*/
|
|
79
|
+
onSelectAll?: (selectedOptions: SuperSelectOption[]) => void;
|
|
56
80
|
onScrollBottom?: () => void;
|
|
57
81
|
onOpenChange?: (open: boolean) => void;
|
|
58
82
|
options?: SuperSelectOption[];
|
|
@@ -85,6 +109,7 @@ export interface SuperSelectApi {
|
|
|
85
109
|
tabIndex: number;
|
|
86
110
|
loading: boolean;
|
|
87
111
|
multiple: boolean;
|
|
112
|
+
selectAllEnabled: boolean;
|
|
88
113
|
};
|
|
89
114
|
components: typeof defaultComponents;
|
|
90
115
|
state: {
|
|
@@ -96,15 +121,19 @@ export interface SuperSelectApi {
|
|
|
96
121
|
maxHeight: number;
|
|
97
122
|
onDragEnd: (result: SuperSelectResult) => void;
|
|
98
123
|
onSelect: (option: SuperSelectOption) => void;
|
|
124
|
+
onSelectAll?: (selectedOptions: SuperSelectOption[]) => void;
|
|
99
125
|
open: boolean;
|
|
100
126
|
options: SuperSelectOption[];
|
|
101
127
|
overlayId: string;
|
|
102
128
|
searchValue: string;
|
|
129
|
+
selectAllOption: SuperSelectOption;
|
|
103
130
|
selectedIndex: number | null;
|
|
104
131
|
selectedLabel: string;
|
|
105
132
|
selectedOption: SuperSelectOption | null;
|
|
106
133
|
setOpen: (open: boolean) => void;
|
|
107
134
|
setPointer: any;
|
|
135
|
+
setValue: (value: SuperSelectValue) => void;
|
|
136
|
+
setActiveMenuIndex: (index: number | null) => void;
|
|
108
137
|
setSearchValue: ((value: string) => void) & {
|
|
109
138
|
cancel: () => void;
|
|
110
139
|
};
|
|
@@ -135,7 +164,12 @@ export interface SuperSelectApi {
|
|
|
135
164
|
isSelected: (option: SuperSelectOption) => boolean;
|
|
136
165
|
isDisabled: (option: SuperSelectOption) => boolean;
|
|
137
166
|
isOptgroup: (option: SuperSelectOption) => boolean;
|
|
167
|
+
isOptSelectAll: (option: SuperSelectOption) => boolean;
|
|
138
168
|
label: (option: SuperSelectOption) => string;
|
|
169
|
+
selectAll: {
|
|
170
|
+
isSelectAllPartiallySelected: (options: SuperSelectOption[]) => boolean;
|
|
171
|
+
isSelectAllSelected: (options: SuperSelectOption[]) => boolean;
|
|
172
|
+
};
|
|
139
173
|
value: (option: SuperSelectOption) => SuperSelectValuePrimitive;
|
|
140
174
|
};
|
|
141
175
|
refs: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuperSelect.types.js","names":[],"sources":["../../src/SuperSelect/SuperSelect.types.ts"],"sourcesContent":["import type React from 'react'\nimport type { VirtuosoHandle } from 'react-virtuoso'\nimport type * as defaultComponents from './SuperSelect.components'\nimport type { isOptgroupSymbol } from './SuperSelect.constants'\n\nexport interface TokenNavigationProps {\n activeIndex?: number | null\n enabled?: boolean\n onChange?: (value: SuperSelectValue) => void\n onNavigate?: (index: number | null) => void\n value?: SuperSelectValue\n}\n\nexport interface KeyboardSelectionProps {\n enabled?: boolean\n onSelect?: () => void\n}\n\nexport type SuperSelectValuePrimitive = boolean | string | number\n\nexport type SuperSelectValue =\n | SuperSelectValuePrimitive\n | Array<SuperSelectValuePrimitive>\n | null\n\nexport type SuperSelectOption = any\n\nexport type SuperSelectPreset = '' | 'pill' | 'filter' | 'contacts'\n\nexport type SuperSelectResult = {\n destination?: { index: number } | null\n source: { index: number }\n}\n\nexport interface SuperSelectPresetProps {\n filter?: {\n filterName?: string\n }\n pill?: {}\n contacts?: {}\n ''?: {}\n}\n\nexport interface SuperSelectConfig {\n block?: boolean\n components?: Partial<typeof defaultComponents>\n defaultValue?: SuperSelectValue\n disabled?: boolean\n draggable?: boolean\n emptyMessage?: string\n error?: boolean\n footer?: React.ReactElement\n getOptionGroup?: (option: SuperSelectOption) => string\n getOptionIsBatch?: (option: SuperSelectOption) => boolean\n getOptionIsDisabled?: (option: SuperSelectOption) => boolean\n
|
|
1
|
+
{"version":3,"file":"SuperSelect.types.js","names":[],"sources":["../../src/SuperSelect/SuperSelect.types.ts"],"sourcesContent":["import type React from 'react'\nimport type { VirtuosoHandle } from 'react-virtuoso'\nimport type * as defaultComponents from './SuperSelect.components'\nimport type { isOptgroupSymbol } from './SuperSelect.constants'\n\nexport interface TokenNavigationProps {\n activeIndex?: number | null\n enabled?: boolean\n onChange?: (value: SuperSelectValue) => void\n onNavigate?: (index: number | null) => void\n value?: SuperSelectValue\n}\n\nexport interface KeyboardSelectionProps {\n enabled?: boolean\n onSelect?: () => void\n}\n\nexport type SuperSelectValuePrimitive = boolean | string | number\n\nexport type SuperSelectValue =\n | SuperSelectValuePrimitive\n | Array<SuperSelectValuePrimitive>\n | null\n\nexport type SuperSelectOption = any\n\nexport type SuperSelectPreset = '' | 'pill' | 'filter' | 'contacts'\n\nexport type SuperSelectResult = {\n destination?: { index: number } | null\n source: { index: number }\n}\n\nexport interface SuperSelectPresetProps {\n filter?: {\n filterName?: string\n }\n pill?: {}\n contacts?: {}\n ''?: {}\n}\n\nexport interface SuperSelectConfig {\n block?: boolean\n components?: Partial<typeof defaultComponents>\n defaultValue?: SuperSelectValue\n disabled?: boolean\n draggable?: boolean\n emptyMessage?: string\n selectAllEnabled?: boolean\n error?: boolean\n footer?: React.ReactElement\n getOptionGroup?: (option: SuperSelectOption) => string\n getOptionIsBatch?: (option: SuperSelectOption) => boolean\n getOptionIsDisabled?: (option: SuperSelectOption) => boolean\n getOptionIsPartiallySelected?: (option: SuperSelectOption) => boolean\n getOptionIsSelected?: (option: SuperSelectOption) => boolean\n getOptionLabel?: (option: SuperSelectOption) => string\n getOptionValue?: (option: SuperSelectOption) => SuperSelectValuePrimitive\n header?: React.ReactElement\n loading?: boolean\n multiple?: boolean\n onChange?: (value: SuperSelectValue) => void\n onManualSort?: (options: SuperSelectOption[]) => void\n /**\n * Callback function triggered when the \"Select All\" functionality is used in a multi-select SuperSelect.\n *\n * This prop is only relevant when `multiple={true}` and `selectAllEnabled={true}`. The callback is invoked\n * when users interact with a select all option in the select list that allows them to\n * select or deselect all available options at once.\n *\n * @param selectedOptions - An array of all options that would be selected when \"Select All\" is triggered.\n * This includes all selectable options (excluding disabled options) that are\n * currently visible and available for selection.\n *\n * @remarks\n * - Only called when the component is in multi-select mode (`multiple={true}`)\n * - Requires `selectAllEnabled={true}` to show the select-all UI\n * - Disabled options are automatically excluded from the selectedOptions array\n * - Allows additional customization of select-all behavior if needed by implementing custom logic within the callback\n *\n * @see {@link selectAllEnabled} - Enable the select-all functionality\n * @see {@link multiple} - Enable multi-select mode\n * @see {@link getOptionIsDisabled} - Function to determine if options are disabled\n */\n onSelectAll?: (selectedOptions: SuperSelectOption[]) => void\n onScrollBottom?: () => void\n onOpenChange?: (open: boolean) => void\n options?: SuperSelectOption[]\n placeholder?: string\n preset?: SuperSelectPreset\n presetProps?: SuperSelectPresetProps\n search?: boolean\n selectionStyle?: 'highlight' | 'checkbox' | 'checkmark'\n setOptionGroup?: (\n option: SuperSelectOption,\n group: string\n ) => SuperSelectOption\n sort?: boolean\n tabIndex?: number\n value?: SuperSelectValue\n overlayMatchesTriggerWidth?: boolean\n 'aria-label'?: string\n}\n\nexport type SuperSelectProps = SuperSelectConfig\n\nexport interface SuperSelectApi {\n config: {\n block: boolean\n disabled: boolean\n draggable: boolean\n emptyMessage: string\n error?: boolean\n footer?: React.ReactElement\n header?: React.ReactElement\n placeholder?: string\n preset: SuperSelectPreset\n presetProps?: any\n selectionStyle: 'highlight' | 'token' | 'checkbox' | 'checkmark'\n tabIndex: number\n loading: boolean\n multiple: boolean\n selectAllEnabled: boolean\n }\n components: typeof defaultComponents\n state: {\n activeMenuIndex: number | null\n activeTokenIndex: number | null\n isEmpty: () => boolean\n listContainerHeight: number\n listId: string\n maxHeight: number\n onDragEnd: (result: SuperSelectResult) => void\n onSelect: (option: SuperSelectOption) => void\n onSelectAll?: (selectedOptions: SuperSelectOption[]) => void\n open: boolean\n options: SuperSelectOption[]\n overlayId: string\n searchValue: string\n selectAllOption: SuperSelectOption\n selectedIndex: number | null\n selectedLabel: string\n selectedOption: SuperSelectOption | null\n setOpen: (open: boolean) => void\n setPointer: any\n setValue: (value: SuperSelectValue) => void\n setActiveMenuIndex: (index: number | null) => void\n setSearchValue: ((value: string) => void) & { cancel: () => void }\n sourceOptions: SuperSelectOption[]\n value: SuperSelectValue\n width: number\n }\n props: {\n clear: () => Record<string, any>\n emptyMessage: () => Record<string, any>\n footer: () => Record<string, any>\n header: () => Record<string, any>\n item: (...args: any[]) => Record<string, any>\n label: () => Record<string, any>\n menu: () => Record<string, any>\n multiInput: () => Record<string, any>\n overlay: () => Record<string, any>\n search: () => Record<string, any>\n searchContainer: () => Record<string, any>\n tokenClear: (index: number) => Record<string, any>\n trigger: () => Record<string, any>\n virtuoso: () => Record<string, any>\n }\n option: {\n group: (option: SuperSelectOption) => string\n isBatch: (option: SuperSelectOption) => boolean\n isPartiallySelected: (option: SuperSelectOption) => boolean\n isSelected: (option: SuperSelectOption) => boolean\n isDisabled: (option: SuperSelectOption) => boolean\n isOptgroup: (option: SuperSelectOption) => boolean\n isOptSelectAll: (option: SuperSelectOption) => boolean\n label: (option: SuperSelectOption) => string\n selectAll: {\n isSelectAllPartiallySelected: (options: SuperSelectOption[]) => boolean\n isSelectAllSelected: (options: SuperSelectOption[]) => boolean\n }\n value: (option: SuperSelectOption) => SuperSelectValuePrimitive\n }\n refs: {\n floating: any\n navigationList: any\n virtuoso: React.RefObject<VirtuosoHandle>\n }\n}\n\nexport interface SuperSelectTriggerProps {\n block?: boolean\n disabled?: boolean\n error?: boolean\n loading?: boolean\n placeholder?: string\n search?: boolean\n tabIndex?: number\n}\n\nexport interface SuperSelectOptgroup {\n label: string\n id: string\n [isOptgroupSymbol]: true\n}\n\nexport interface SuperSelectMenuItemProps\n extends React.HTMLAttributes<HTMLDivElement> {\n isDragging?: boolean\n // data attributes are passed by Virtuoso\n 'data-known-size'?: number\n 'data-index': number\n}\n"],"mappings":""}
|
|
@@ -22,6 +22,7 @@ export declare function reorder(options: SuperSelectOption[], startIndex: number
|
|
|
22
22
|
};
|
|
23
23
|
export declare function isMultiple<T>(multiple: boolean, value: T | T[]): value is T[];
|
|
24
24
|
export declare const getOptionIsOptgroup: (item: SuperSelectOption) => item is SuperSelectOptgroup;
|
|
25
|
+
export declare const getOptionIsOptSelectAll: (item: SuperSelectOption) => item is SuperSelectOptgroup;
|
|
25
26
|
export declare const sortOptgroups: (groupA: string, groupB: string) => number;
|
|
26
27
|
export declare function getIsAllOptionsUngrouped(groups: string[]): boolean;
|
|
27
28
|
export declare function createOptgroup(groupName: string, groupOptions: SuperSelectOption[]): any[];
|
|
@@ -14,7 +14,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
14
14
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
15
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
16
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
|
-
import { isOptgroupSymbol } from './SuperSelect.constants';
|
|
17
|
+
import { isOptgroupSymbol, isOptSelectAllSymbol } from './SuperSelect.constants';
|
|
18
18
|
export var getGroupNameIsValid = function getGroupNameIsValid(groupName) {
|
|
19
19
|
var isGroupDefined = ![undefined, null, ''].includes(groupName);
|
|
20
20
|
return isGroupDefined && typeof groupName === 'string' && groupName.length > 0;
|
|
@@ -128,6 +128,9 @@ export function isMultiple(multiple, value) {
|
|
|
128
128
|
export var getOptionIsOptgroup = function getOptionIsOptgroup(item) {
|
|
129
129
|
return Boolean(item[isOptgroupSymbol]);
|
|
130
130
|
};
|
|
131
|
+
export var getOptionIsOptSelectAll = function getOptionIsOptSelectAll(item) {
|
|
132
|
+
return Boolean(item[isOptSelectAllSymbol]);
|
|
133
|
+
};
|
|
131
134
|
export var sortOptgroups = function sortOptgroups(groupA, groupB) {
|
|
132
135
|
// always put ungrouped options on top
|
|
133
136
|
if (groupA === RESERVED_UNGROUPED_OPTGROUP_NAME) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuperSelect.utils.js","names":["isOptgroupSymbol","getGroupNameIsValid","groupName","isGroupDefined","undefined","includes","length","getOptionsSortingAlgorithm","_ref","getOptionIsBatch","getOptionLabel","a","b","isOptionBatch1","isOptionBatch2","compareStrings","getBatchOptionFormatter","_ref2","value","multiple","getOptionValue","option","isMultiple","val","disabled","Array","isArray","every","v","_objectSpread","RESERVED_UNGROUPED_OPTGROUP_NAME","collectGroupsInOrderOfOccurrence","opts","getOptionGroup","output","reduce","_ref3","_groupedOptions$adjus","groups","groupedOptions","isGroupNameValid","adjustedGroupName","groupOptions","push","concat","_toConsumableArray","filter","group","findParentOptgroup","list","index","i","isOptgroup","getOptionIsOptgroup","id","reorder","options","startIndex","endIndex","nextOptions","_nextOptions$splice","splice","_nextOptions$splice2","_slicedToArray","removed","prevGroup","nextGroup","localeCompare","numeric","sensitivity","item","Boolean","sortOptgroups","groupA","groupB","getIsAllOptionsUngrouped","createOptgroup","optgroupHeader","_defineProperty","removeEmptyOptGroups","opt","arr","currentElementIsLast","currentElementIsOptgroup","nextElementIsOptgroup"],"sources":["../../src/SuperSelect/SuperSelect.utils.ts"],"sourcesContent":["import { isOptgroupSymbol } from './SuperSelect.constants'\nimport type {\n SuperSelectConfig,\n SuperSelectOptgroup,\n SuperSelectOption,\n} from './SuperSelect.types'\n\nexport const getGroupNameIsValid = (groupName: unknown) => {\n const isGroupDefined = ![undefined, null, ''].includes(groupName as string)\n\n return isGroupDefined && typeof groupName === 'string' && groupName.length > 0\n}\n\nexport const getOptionsSortingAlgorithm =\n ({\n getOptionIsBatch,\n getOptionLabel,\n }: {\n getOptionIsBatch: NonNullable<SuperSelectConfig['getOptionIsBatch']>\n getOptionLabel: NonNullable<SuperSelectConfig['getOptionLabel']>\n }) =>\n (a: SuperSelectOption, b: SuperSelectOption) => {\n const isOptionBatch1 = getOptionIsBatch(a)\n const isOptionBatch2 = getOptionIsBatch(b)\n\n // move batched options up\n if (isOptionBatch1 && isOptionBatch2) {\n return compareStrings(getOptionLabel(a), getOptionLabel(b))\n } else if (isOptionBatch1) {\n return -1\n } else if (isOptionBatch2) {\n return 1\n }\n\n return compareStrings(getOptionLabel(a), getOptionLabel(b))\n }\n\nexport const getBatchOptionFormatter =\n ({\n value,\n multiple,\n getOptionIsBatch,\n getOptionValue,\n }: {\n value: SuperSelectConfig['value']\n multiple: NonNullable<SuperSelectConfig['multiple']>\n getOptionIsBatch: NonNullable<SuperSelectConfig['getOptionIsBatch']>\n getOptionValue: NonNullable<SuperSelectConfig['getOptionValue']>\n }) =>\n (option: SuperSelectOption) => {\n if (isMultiple(multiple, value) && getOptionIsBatch(option)) {\n const val = getOptionValue(option)\n\n const disabled = Array.isArray(val) && val.every((v) => value.includes(v))\n\n return {\n ...option,\n disabled,\n }\n }\n return option\n }\n\nexport const RESERVED_UNGROUPED_OPTGROUP_NAME =\n 'RESERVED_UNGROUPED_OPTGROUP_NAME'\n\nexport const collectGroupsInOrderOfOccurrence = (\n opts: SuperSelectOption[],\n getOptionGroup: NonNullable<SuperSelectConfig['getOptionGroup']>\n): {\n groups: string[]\n groupedOptions: Record<string, SuperSelectOption[]>\n} => {\n const output: {\n groups: string[]\n groupedOptions: Record<string, SuperSelectOption[]>\n } = opts.reduce(\n ({ groups, groupedOptions }, option) => {\n const groupName = getOptionGroup(option)\n\n // if group name is invalid, consider the option ungrouped\n const isGroupNameValid = getGroupNameIsValid(groupName)\n const adjustedGroupName = isGroupNameValid\n ? groupName\n : RESERVED_UNGROUPED_OPTGROUP_NAME\n\n const groupOptions = groupedOptions[adjustedGroupName] ?? []\n\n // push/assign for performance considerations\n groupOptions.push(option)\n groupedOptions[adjustedGroupName] = groupOptions\n\n return {\n groups: groups.includes(adjustedGroupName)\n ? groups\n : [...groups, adjustedGroupName],\n groupedOptions,\n }\n },\n {\n groups: [],\n groupedOptions: {},\n }\n )\n\n // if ungrouped options were found, lift them to the top\n if (output.groups.includes(RESERVED_UNGROUPED_OPTGROUP_NAME)) {\n return {\n groupedOptions: output.groupedOptions,\n groups: [\n RESERVED_UNGROUPED_OPTGROUP_NAME,\n ...output.groups.filter(\n (group) => group !== RESERVED_UNGROUPED_OPTGROUP_NAME\n ),\n ],\n }\n }\n\n return output\n}\n\nfunction findParentOptgroup(list: SuperSelectOption[], index: number) {\n for (let i = index; i >= 0; i--) {\n const option = list[i]\n const isOptgroup = getOptionIsOptgroup(option)\n\n if (isOptgroup) {\n return option.id\n }\n }\n // no parent optgroup was found, so the option is considered ungrouped\n return RESERVED_UNGROUPED_OPTGROUP_NAME\n}\n\nexport function reorder(\n options: SuperSelectOption[],\n startIndex: number,\n endIndex: number\n) {\n const nextOptions = [...options]\n const [removed] = nextOptions.splice(startIndex, 1)\n nextOptions.splice(endIndex, 0, removed)\n\n const prevGroup = findParentOptgroup(options, startIndex)\n const nextGroup = findParentOptgroup(nextOptions, endIndex)\n\n return { nextOptions, prevGroup, nextGroup }\n}\n\nfunction compareStrings(a: string, b: string) {\n return a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' })\n}\n\nexport function isMultiple<T>(multiple: boolean, value: T | T[]): value is T[] {\n return multiple && Array.isArray(value)\n}\n\nexport const getOptionIsOptgroup = (\n item: SuperSelectOption\n): item is SuperSelectOptgroup => {\n return Boolean(item[isOptgroupSymbol])\n}\n\nexport const sortOptgroups = (groupA: string, groupB: string) => {\n // always put ungrouped options on top\n if (groupA === RESERVED_UNGROUPED_OPTGROUP_NAME) {\n return -1\n }\n if (groupB === RESERVED_UNGROUPED_OPTGROUP_NAME) {\n return 1\n }\n return compareStrings(groupA, groupB)\n}\n\nexport function getIsAllOptionsUngrouped(groups: string[]) {\n return groups.length === 1 && groups[0] === RESERVED_UNGROUPED_OPTGROUP_NAME\n}\n\nexport function createOptgroup(\n groupName: string,\n groupOptions: SuperSelectOption[]\n) {\n // ungrouped options should not have a group header\n if (groupName === RESERVED_UNGROUPED_OPTGROUP_NAME) {\n return groupOptions\n }\n\n const optgroupHeader: SuperSelectOptgroup = {\n [isOptgroupSymbol]: true,\n id: groupName,\n label: groupName,\n }\n\n return [optgroupHeader, ...groupOptions]\n}\n\nexport function removeEmptyOptGroups(options: SuperSelectOption[]) {\n return options.filter((opt, index, arr) => {\n const currentElementIsLast = index === arr.length - 1\n const currentElementIsOptgroup = getOptionIsOptgroup(opt)\n const nextElementIsOptgroup =\n !currentElementIsLast && getOptionIsOptgroup(arr[index + 1])\n\n return !(\n currentElementIsOptgroup &&\n (nextElementIsOptgroup || currentElementIsLast)\n )\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,gBAAgB,QAAQ,yBAAyB;AAO1D,OAAO,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIC,SAAkB,EAAK;EACzD,IAAMC,cAAc,GAAG,CAAC,CAACC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAACC,QAAQ,CAACH,SAAmB,CAAC;EAE3E,OAAOC,cAAc,IAAI,OAAOD,SAAS,KAAK,QAAQ,IAAIA,SAAS,CAACI,MAAM,GAAG,CAAC;AAChF,CAAC;AAED,OAAO,IAAMC,0BAA0B,GACrC,SADWA,0BAA0BA,CAAAC,IAAA;EAAA,IAEnCC,gBAAgB,GAAAD,IAAA,CAA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B,GAAG,CAAC3E,MAAM,GAAG,CAAC;IACrD,IAAM6E,wBAAwB,GAAG9B,mBAAmB,CAAC2B,GAAG,CAAC;IACzD,IAAMI,qBAAqB,GACzB,CAACF,oBAAoB,IAAI7B,mBAAmB,CAAC4B,GAAG,CAAC/B,KAAK,GAAG,CAAC,CAAC,CAAC;IAE9D,OAAO,EACLiC,wBAAwB,KACvBC,qBAAqB,IAAIF,oBAAoB,CAAC,CAChD;EACH,CAAC,CAAC;AACJ"}
|
|
1
|
+
{"version":3,"file":"SuperSelect.utils.js","names":["isOptgroupSymbol","isOptSelectAllSymbol","getGroupNameIsValid","groupName","isGroupDefined","undefined","includes","length","getOptionsSortingAlgorithm","_ref","getOptionIsBatch","getOptionLabel","a","b","isOptionBatch1","isOptionBatch2","compareStrings","getBatchOptionFormatter","_ref2","value","multiple","getOptionValue","option","isMultiple","val","disabled","Array","isArray","every","v","_objectSpread","RESERVED_UNGROUPED_OPTGROUP_NAME","collectGroupsInOrderOfOccurrence","opts","getOptionGroup","output","reduce","_ref3","_groupedOptions$adjus","groups","groupedOptions","isGroupNameValid","adjustedGroupName","groupOptions","push","concat","_toConsumableArray","filter","group","findParentOptgroup","list","index","i","isOptgroup","getOptionIsOptgroup","id","reorder","options","startIndex","endIndex","nextOptions","_nextOptions$splice","splice","_nextOptions$splice2","_slicedToArray","removed","prevGroup","nextGroup","localeCompare","numeric","sensitivity","item","Boolean","getOptionIsOptSelectAll","sortOptgroups","groupA","groupB","getIsAllOptionsUngrouped","createOptgroup","optgroupHeader","_defineProperty","removeEmptyOptGroups","opt","arr","currentElementIsLast","currentElementIsOptgroup","nextElementIsOptgroup"],"sources":["../../src/SuperSelect/SuperSelect.utils.ts"],"sourcesContent":["import { isOptgroupSymbol, isOptSelectAllSymbol } from './SuperSelect.constants'\nimport type {\n SuperSelectConfig,\n SuperSelectOptgroup,\n SuperSelectOption,\n} from './SuperSelect.types'\n\nexport const getGroupNameIsValid = (groupName: unknown) => {\n const isGroupDefined = ![undefined, null, ''].includes(groupName as string)\n\n return isGroupDefined && typeof groupName === 'string' && groupName.length > 0\n}\n\nexport const getOptionsSortingAlgorithm =\n ({\n getOptionIsBatch,\n getOptionLabel,\n }: {\n getOptionIsBatch: NonNullable<SuperSelectConfig['getOptionIsBatch']>\n getOptionLabel: NonNullable<SuperSelectConfig['getOptionLabel']>\n }) =>\n (a: SuperSelectOption, b: SuperSelectOption) => {\n const isOptionBatch1 = getOptionIsBatch(a)\n const isOptionBatch2 = getOptionIsBatch(b)\n\n // move batched options up\n if (isOptionBatch1 && isOptionBatch2) {\n return compareStrings(getOptionLabel(a), getOptionLabel(b))\n } else if (isOptionBatch1) {\n return -1\n } else if (isOptionBatch2) {\n return 1\n }\n\n return compareStrings(getOptionLabel(a), getOptionLabel(b))\n }\n\nexport const getBatchOptionFormatter =\n ({\n value,\n multiple,\n getOptionIsBatch,\n getOptionValue,\n }: {\n value: SuperSelectConfig['value']\n multiple: NonNullable<SuperSelectConfig['multiple']>\n getOptionIsBatch: NonNullable<SuperSelectConfig['getOptionIsBatch']>\n getOptionValue: NonNullable<SuperSelectConfig['getOptionValue']>\n }) =>\n (option: SuperSelectOption) => {\n if (isMultiple(multiple, value) && getOptionIsBatch(option)) {\n const val = getOptionValue(option)\n\n const disabled = Array.isArray(val) && val.every((v) => value.includes(v))\n\n return {\n ...option,\n disabled,\n }\n }\n return option\n }\n\nexport const RESERVED_UNGROUPED_OPTGROUP_NAME =\n 'RESERVED_UNGROUPED_OPTGROUP_NAME'\n\nexport const collectGroupsInOrderOfOccurrence = (\n opts: SuperSelectOption[],\n getOptionGroup: NonNullable<SuperSelectConfig['getOptionGroup']>\n): {\n groups: string[]\n groupedOptions: Record<string, SuperSelectOption[]>\n} => {\n const output: {\n groups: string[]\n groupedOptions: Record<string, SuperSelectOption[]>\n } = opts.reduce(\n ({ groups, groupedOptions }, option) => {\n const groupName = getOptionGroup(option)\n\n // if group name is invalid, consider the option ungrouped\n const isGroupNameValid = getGroupNameIsValid(groupName)\n const adjustedGroupName = isGroupNameValid\n ? groupName\n : RESERVED_UNGROUPED_OPTGROUP_NAME\n\n const groupOptions = groupedOptions[adjustedGroupName] ?? []\n\n // push/assign for performance considerations\n groupOptions.push(option)\n groupedOptions[adjustedGroupName] = groupOptions\n\n return {\n groups: groups.includes(adjustedGroupName)\n ? groups\n : [...groups, adjustedGroupName],\n groupedOptions,\n }\n },\n {\n groups: [],\n groupedOptions: {},\n }\n )\n\n // if ungrouped options were found, lift them to the top\n if (output.groups.includes(RESERVED_UNGROUPED_OPTGROUP_NAME)) {\n return {\n groupedOptions: output.groupedOptions,\n groups: [\n RESERVED_UNGROUPED_OPTGROUP_NAME,\n ...output.groups.filter(\n (group) => group !== RESERVED_UNGROUPED_OPTGROUP_NAME\n ),\n ],\n }\n }\n\n return output\n}\n\nfunction findParentOptgroup(list: SuperSelectOption[], index: number) {\n for (let i = index; i >= 0; i--) {\n const option = list[i]\n const isOptgroup = getOptionIsOptgroup(option)\n\n if (isOptgroup) {\n return option.id\n }\n }\n // no parent optgroup was found, so the option is considered ungrouped\n return RESERVED_UNGROUPED_OPTGROUP_NAME\n}\n\nexport function reorder(\n options: SuperSelectOption[],\n startIndex: number,\n endIndex: number\n) {\n const nextOptions = [...options]\n const [removed] = nextOptions.splice(startIndex, 1)\n nextOptions.splice(endIndex, 0, removed)\n\n const prevGroup = findParentOptgroup(options, startIndex)\n const nextGroup = findParentOptgroup(nextOptions, endIndex)\n\n return { nextOptions, prevGroup, nextGroup }\n}\n\nfunction compareStrings(a: string, b: string) {\n return a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' })\n}\n\nexport function isMultiple<T>(multiple: boolean, value: T | T[]): value is T[] {\n return multiple && Array.isArray(value)\n}\n\nexport const getOptionIsOptgroup = (\n item: SuperSelectOption\n): item is SuperSelectOptgroup => {\n return Boolean(item[isOptgroupSymbol])\n}\n\nexport const getOptionIsOptSelectAll = (\n item: SuperSelectOption\n): item is SuperSelectOptgroup => {\n return Boolean(item[isOptSelectAllSymbol])\n}\n\nexport const sortOptgroups = (groupA: string, groupB: string) => {\n // always put ungrouped options on top\n if (groupA === RESERVED_UNGROUPED_OPTGROUP_NAME) {\n return -1\n }\n if (groupB === RESERVED_UNGROUPED_OPTGROUP_NAME) {\n return 1\n }\n return compareStrings(groupA, groupB)\n}\n\nexport function getIsAllOptionsUngrouped(groups: string[]) {\n return groups.length === 1 && groups[0] === RESERVED_UNGROUPED_OPTGROUP_NAME\n}\n\nexport function createOptgroup(\n groupName: string,\n groupOptions: SuperSelectOption[]\n) {\n // ungrouped options should not have a group header\n if (groupName === RESERVED_UNGROUPED_OPTGROUP_NAME) {\n return groupOptions\n }\n\n const optgroupHeader: SuperSelectOptgroup = {\n [isOptgroupSymbol]: true,\n id: groupName,\n label: groupName,\n }\n\n return [optgroupHeader, ...groupOptions]\n}\n\nexport function removeEmptyOptGroups(options: SuperSelectOption[]) {\n return options.filter((opt, index, arr) => {\n const currentElementIsLast = index === arr.length - 1\n const currentElementIsOptgroup = getOptionIsOptgroup(opt)\n const nextElementIsOptgroup =\n !currentElementIsLast && getOptionIsOptgroup(arr[index + 1])\n\n return !(\n currentElementIsOptgroup &&\n (nextElementIsOptgroup || currentElementIsLast)\n )\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,gBAAgB,EAAEC,oBAAoB,QAAQ,yBAAyB;AAOhF,OAAO,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIC,SAAkB,EAAK;EACzD,IAAMC,cAAc,GAAG,CAAC,CAACC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAACC,QAAQ,CAACH,SAAmB,CAAC;EAE3E,OAAOC,cAAc,IAAI,OAAOD,SAAS,KAAK,QAAQ,IAAIA,SAAS,CAACI,MAAM,GAAG,CAAC;AAChF,CAAC;AAED,OAAO,IAAMC,0BAA0B,GACrC,SADWA,0BAA0BA,CAAAC,IAAA;EAAA,IAEnCC,gBAAgB,GAAAD,IAAA,C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xB,OAA4B,EAAE;EACjE,OAAOA,OAAO,CAACV,MAAM,CAAC,UAACmC,GAAG,EAAE/B,KAAK,EAAEgC,GAAG,EAAK;IACzC,IAAMC,oBAAoB,GAAGjC,KAAK,KAAKgC,GAAG,CAAC5E,MAAM,GAAG,CAAC;IACrD,IAAM8E,wBAAwB,GAAG/B,mBAAmB,CAAC4B,GAAG,CAAC;IACzD,IAAMI,qBAAqB,GACzB,CAACF,oBAAoB,IAAI9B,mBAAmB,CAAC6B,GAAG,CAAChC,KAAK,GAAG,CAAC,CAAC,CAAC;IAE9D,OAAO,EACLkC,wBAAwB,KACvBC,qBAAqB,IAAIF,oBAAoB,CAAC,CAChD;EACH,CAAC,CAAC;AACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SuperSelectApi, SuperSelectConfig } from './SuperSelect.types';
|
|
3
|
-
export declare function useSuperSelect({ block, components: customComponents, defaultValue, disabled, draggable, emptyMessage, error, footer, getOptionGroup, getOptionIsBatch, getOptionIsDisabled, getOptionLabel,
|
|
3
|
+
export declare function useSuperSelect({ block, components: customComponents, defaultValue, disabled, draggable, emptyMessage, selectAllEnabled, error, footer, getOptionGroup, getOptionIsBatch, getOptionIsDisabled, getOptionLabel, getOptionIsPartiallySelected, getOptionIsSelected, getOptionValue, onScrollBottom, onOpenChange, header, loading, multiple, onChange, onManualSort, onSelectAll, options: sourceOptions, placeholder, preset, presetProps, search, selectionStyle, setOptionGroup, sort, tabIndex, value: value_, overlayMatchesTriggerWidth, 'aria-label': ariaLabel, }: SuperSelectConfig): SuperSelectApi;
|
|
4
4
|
export declare const SuperSelectContext: React.Context<SuperSelectApi | null>;
|
|
5
5
|
export declare function useSuperSelectContext(): SuperSelectApi;
|