carbon-react 118.0.0 → 118.1.1

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.
Files changed (169) hide show
  1. package/esm/__internal__/filter-object-properties/filter-object-properties.d.ts +1 -1
  2. package/esm/components/button-minor/button-minor.style.js +8 -0
  3. package/esm/components/pager/pager.component.js +5 -5
  4. package/esm/components/pill/pill.component.d.ts +3 -1
  5. package/esm/components/pill/pill.component.js +1 -0
  6. package/esm/components/select/__internal__/select-list-context.d.ts +7 -0
  7. package/esm/components/select/__internal__/select-text/index.d.ts +2 -0
  8. package/esm/components/select/__internal__/select-text/index.js +1 -0
  9. package/esm/components/select/__internal__/select-text/select-text.component.d.ts +33 -0
  10. package/esm/components/select/__internal__/select-text/select-text.component.js +16 -36
  11. package/esm/components/select/__internal__/select-text/select-text.style.d.ts +6 -1
  12. package/esm/components/select/filterable-select/filterable-select.component.d.ts +65 -0
  13. package/esm/components/select/filterable-select/filterable-select.component.js +568 -102
  14. package/esm/components/select/filterable-select/index.d.ts +2 -1
  15. package/esm/components/select/filterable-select/index.js +1 -0
  16. package/esm/components/select/index.d.ts +6 -0
  17. package/esm/components/select/index.js +6 -6
  18. package/esm/components/select/list-action-button/index.d.ts +2 -0
  19. package/esm/components/select/list-action-button/index.js +1 -0
  20. package/esm/components/select/list-action-button/list-action-button.component.d.ts +7 -0
  21. package/esm/components/select/list-action-button/list-action-button.component.js +9 -6
  22. package/esm/components/select/list-action-button/list-action-button.style.d.ts +2 -0
  23. package/esm/components/select/multi-select/index.d.ts +2 -1
  24. package/esm/components/select/multi-select/index.js +1 -0
  25. package/esm/components/select/multi-select/multi-select.component.d.ts +62 -0
  26. package/esm/components/select/multi-select/multi-select.component.js +575 -104
  27. package/esm/components/select/multi-select/multi-select.style.d.ts +4 -0
  28. package/esm/components/select/multi-select/multi-select.style.js +1 -0
  29. package/esm/components/select/option/index.d.ts +2 -25
  30. package/esm/components/select/option/index.js +1 -0
  31. package/esm/components/select/option/option.component.d.ts +34 -0
  32. package/esm/components/select/option/option.component.js +399 -62
  33. package/esm/components/select/option/option.style.d.ts +6 -0
  34. package/esm/components/select/option/option.style.js +0 -5
  35. package/esm/components/select/option-group-header/index.d.ts +2 -10
  36. package/esm/components/select/option-group-header/index.js +1 -0
  37. package/esm/components/select/option-group-header/option-group-header.component.d.ts +16 -0
  38. package/esm/components/select/option-group-header/option-group-header.component.js +4 -15
  39. package/esm/components/select/option-group-header/option-group-header.style.d.ts +2 -0
  40. package/esm/components/select/option-row/index.d.ts +2 -16
  41. package/esm/components/select/option-row/index.js +1 -0
  42. package/esm/components/select/option-row/option-row.component.d.ts +42 -0
  43. package/esm/components/select/option-row/option-row.component.js +10 -40
  44. package/esm/components/select/option-row/option-row.style.d.ts +6 -0
  45. package/esm/components/select/select-list/index.d.ts +2 -0
  46. package/esm/components/select/select-list/index.js +1 -0
  47. package/esm/components/select/select-list/select-list-container.style.d.ts +6 -0
  48. package/esm/components/select/select-list/select-list.component.d.ts +64 -0
  49. package/esm/components/select/select-list/select-list.component.js +69 -100
  50. package/esm/components/select/select-list/select-list.style.d.ts +12 -0
  51. package/esm/components/select/select-list/select-list.style.js +2 -2
  52. package/esm/components/select/select-textbox/index.d.ts +2 -1
  53. package/esm/components/select/select-textbox/index.js +1 -0
  54. package/esm/components/select/select-textbox/select-textbox.component.d.ts +81 -0
  55. package/esm/components/select/select-textbox/select-textbox.component.js +567 -142
  56. package/esm/components/select/select.style.d.ts +8 -0
  57. package/esm/components/select/simple-select/index.d.ts +2 -1
  58. package/esm/components/select/simple-select/index.js +1 -0
  59. package/esm/components/select/simple-select/simple-select.component.d.ts +58 -0
  60. package/esm/components/select/simple-select/simple-select.component.js +578 -111
  61. package/esm/components/select/utils/get-next-child-by-text.d.ts +5 -0
  62. package/esm/components/select/utils/get-next-child-by-text.js +20 -17
  63. package/esm/components/select/utils/get-next-index-by-key.d.ts +2 -0
  64. package/esm/components/select/utils/highlight-part-of-text.d.ts +2 -0
  65. package/esm/components/select/utils/highlight-part-of-text.js +10 -3
  66. package/esm/components/select/utils/is-expected-option.d.ts +2 -0
  67. package/esm/components/select/utils/is-expected-option.js +1 -1
  68. package/esm/components/select/utils/is-expected-value.d.ts +1 -0
  69. package/esm/components/select/utils/is-expected-value.js +1 -1
  70. package/esm/components/select/utils/is-navigation-key.d.ts +1 -0
  71. package/esm/components/select/utils/matching-text.style.d.ts +2 -0
  72. package/esm/components/select/utils/with-filter.hoc.d.ts +14 -0
  73. package/esm/components/select/utils/with-filter.hoc.js +59 -41
  74. package/esm/components/tabs/__internal__/tab-title/tab-title.component.js +1 -0
  75. package/lib/__internal__/filter-object-properties/filter-object-properties.d.ts +1 -1
  76. package/lib/components/button-minor/button-minor.style.js +8 -0
  77. package/lib/components/pager/pager.component.js +5 -5
  78. package/lib/components/pill/pill.component.d.ts +3 -1
  79. package/lib/components/pill/pill.component.js +1 -0
  80. package/lib/components/select/__internal__/select-list-context.d.ts +7 -0
  81. package/lib/components/select/__internal__/select-text/index.d.ts +2 -0
  82. package/lib/components/select/__internal__/select-text/index.js +15 -0
  83. package/lib/components/select/__internal__/select-text/package.json +6 -0
  84. package/lib/components/select/__internal__/select-text/select-text.component.d.ts +33 -0
  85. package/lib/components/select/__internal__/select-text/select-text.component.js +16 -36
  86. package/lib/components/select/__internal__/select-text/select-text.style.d.ts +6 -1
  87. package/lib/components/select/filterable-select/filterable-select.component.d.ts +65 -0
  88. package/lib/components/select/filterable-select/filterable-select.component.js +569 -103
  89. package/lib/components/select/filterable-select/index.d.ts +2 -1
  90. package/lib/components/select/filterable-select/index.js +15 -0
  91. package/lib/components/select/filterable-select/package.json +6 -0
  92. package/lib/components/select/index.d.ts +6 -0
  93. package/lib/components/select/index.js +6 -6
  94. package/lib/components/select/list-action-button/index.d.ts +2 -0
  95. package/lib/components/select/list-action-button/index.js +15 -0
  96. package/lib/components/select/list-action-button/list-action-button.component.d.ts +7 -0
  97. package/lib/components/select/list-action-button/list-action-button.component.js +9 -6
  98. package/lib/components/select/list-action-button/list-action-button.style.d.ts +2 -0
  99. package/lib/components/select/list-action-button/package.json +6 -0
  100. package/lib/components/select/multi-select/index.d.ts +2 -1
  101. package/lib/components/select/multi-select/index.js +15 -0
  102. package/lib/components/select/multi-select/multi-select.component.d.ts +62 -0
  103. package/lib/components/select/multi-select/multi-select.component.js +576 -105
  104. package/lib/components/select/multi-select/multi-select.style.d.ts +4 -0
  105. package/lib/components/select/multi-select/multi-select.style.js +1 -0
  106. package/lib/components/select/multi-select/package.json +6 -0
  107. package/lib/components/select/option/index.d.ts +2 -25
  108. package/lib/components/select/option/index.js +15 -0
  109. package/lib/components/select/option/option.component.d.ts +34 -0
  110. package/lib/components/select/option/option.component.js +399 -62
  111. package/lib/components/select/option/option.style.d.ts +6 -0
  112. package/lib/components/select/option/option.style.js +0 -8
  113. package/lib/components/select/option/package.json +6 -0
  114. package/lib/components/select/option-group-header/index.d.ts +2 -10
  115. package/lib/components/select/option-group-header/index.js +15 -0
  116. package/lib/components/select/option-group-header/option-group-header.component.d.ts +16 -0
  117. package/lib/components/select/option-group-header/option-group-header.component.js +4 -15
  118. package/lib/components/select/option-group-header/option-group-header.style.d.ts +2 -0
  119. package/lib/components/select/option-group-header/package.json +6 -0
  120. package/lib/components/select/option-row/index.d.ts +2 -16
  121. package/lib/components/select/option-row/index.js +15 -0
  122. package/lib/components/select/option-row/option-row.component.d.ts +42 -0
  123. package/lib/components/select/option-row/option-row.component.js +10 -40
  124. package/lib/components/select/option-row/option-row.style.d.ts +6 -0
  125. package/lib/components/select/option-row/package.json +6 -0
  126. package/lib/components/select/select-list/index.d.ts +2 -0
  127. package/lib/components/select/select-list/index.js +15 -0
  128. package/lib/components/select/select-list/package.json +6 -0
  129. package/lib/components/select/select-list/select-list-container.style.d.ts +6 -0
  130. package/lib/components/select/select-list/select-list.component.d.ts +64 -0
  131. package/lib/components/select/select-list/select-list.component.js +69 -100
  132. package/lib/components/select/select-list/select-list.style.d.ts +12 -0
  133. package/lib/components/select/select-list/select-list.style.js +2 -2
  134. package/lib/components/select/select-textbox/index.d.ts +2 -1
  135. package/lib/components/select/select-textbox/index.js +15 -0
  136. package/lib/components/select/select-textbox/package.json +6 -0
  137. package/lib/components/select/select-textbox/select-textbox.component.d.ts +81 -0
  138. package/lib/components/select/select-textbox/select-textbox.component.js +567 -142
  139. package/lib/components/select/select.style.d.ts +8 -0
  140. package/lib/components/select/simple-select/index.d.ts +2 -1
  141. package/lib/components/select/simple-select/index.js +15 -0
  142. package/lib/components/select/simple-select/package.json +6 -0
  143. package/lib/components/select/simple-select/simple-select.component.d.ts +58 -0
  144. package/lib/components/select/simple-select/simple-select.component.js +579 -113
  145. package/lib/components/select/utils/get-next-child-by-text.d.ts +5 -0
  146. package/lib/components/select/utils/get-next-child-by-text.js +20 -17
  147. package/lib/components/select/utils/get-next-index-by-key.d.ts +2 -0
  148. package/lib/components/select/utils/highlight-part-of-text.d.ts +2 -0
  149. package/lib/components/select/utils/highlight-part-of-text.js +10 -3
  150. package/lib/components/select/utils/is-expected-option.d.ts +2 -0
  151. package/lib/components/select/utils/is-expected-option.js +1 -1
  152. package/lib/components/select/utils/is-expected-value.d.ts +1 -0
  153. package/lib/components/select/utils/is-expected-value.js +1 -1
  154. package/lib/components/select/utils/is-navigation-key.d.ts +1 -0
  155. package/lib/components/select/utils/matching-text.style.d.ts +2 -0
  156. package/lib/components/select/utils/with-filter.hoc.d.ts +14 -0
  157. package/lib/components/select/utils/with-filter.hoc.js +59 -42
  158. package/lib/components/tabs/__internal__/tab-title/tab-title.component.js +1 -0
  159. package/package.json +1 -1
  160. package/esm/components/select/__internal__/select-text/select-text.d.ts +0 -36
  161. package/esm/components/select/filterable-select/filterable-select.d.ts +0 -71
  162. package/esm/components/select/multi-select/multi-select.d.ts +0 -68
  163. package/esm/components/select/select-textbox/select-textbox.d.ts +0 -72
  164. package/esm/components/select/simple-select/simple-select.d.ts +0 -64
  165. package/lib/components/select/__internal__/select-text/select-text.d.ts +0 -36
  166. package/lib/components/select/filterable-select/filterable-select.d.ts +0 -71
  167. package/lib/components/select/multi-select/multi-select.d.ts +0 -68
  168. package/lib/components/select/select-textbox/select-textbox.d.ts +0 -72
  169. package/lib/components/select/simple-select/simple-select.d.ts +0 -64
@@ -1 +1,2 @@
1
- export { default } from "./filterable-select";
1
+ export { default } from "./filterable-select.component";
2
+ export type { FilterableSelectProps } from "./filterable-select.component";
@@ -0,0 +1 @@
1
+ export { default } from "./filterable-select.component";
@@ -1,6 +1,12 @@
1
1
  export { default as Option } from "./option";
2
+ export type { OptionProps } from "./option";
2
3
  export { default as OptionRow } from "./option-row";
4
+ export type { OptionRowProps } from "./option-row";
3
5
  export { default as OptionGroupHeader } from "./option-group-header";
6
+ export type { OptionGroupHeaderProps } from "./option-group-header";
4
7
  export { default as Select } from "./simple-select";
8
+ export type { SimpleSelectProps } from "./simple-select";
5
9
  export { default as FilterableSelect } from "./filterable-select";
10
+ export type { FilterableSelectProps } from "./filterable-select";
6
11
  export { default as MultiSelect } from "./multi-select";
12
+ export type { MultiSelectProps } from "./multi-select";
@@ -1,6 +1,6 @@
1
- export { default as Option } from "./option/option.component";
2
- export { default as OptionRow } from "./option-row/option-row.component";
3
- export { default as OptionGroupHeader } from "./option-group-header/option-group-header.component";
4
- export { default as Select } from "./simple-select/simple-select.component";
5
- export { default as FilterableSelect } from "./filterable-select/filterable-select.component";
6
- export { default as MultiSelect } from "./multi-select/multi-select.component";
1
+ export { default as Option } from "./option";
2
+ export { default as OptionRow } from "./option-row";
3
+ export { default as OptionGroupHeader } from "./option-group-header";
4
+ export { default as Select } from "./simple-select";
5
+ export { default as FilterableSelect } from "./filterable-select";
6
+ export { default as MultiSelect } from "./multi-select";
@@ -0,0 +1,2 @@
1
+ export { default } from "./list-action-button.component";
2
+ export type { ListActionButtonProps } from "./list-action-button.component";
@@ -0,0 +1 @@
1
+ export { default } from "./list-action-button.component";
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ export interface ListActionButtonProps {
3
+ listActionButton?: boolean | React.ReactNode;
4
+ onListAction?: (ev: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;
5
+ }
6
+ declare const ListActionButton: React.ForwardRefExoticComponent<ListActionButtonProps & React.RefAttributes<HTMLButtonElement>>;
7
+ export default ListActionButton;
@@ -12,11 +12,16 @@ const ListActionButton = /*#__PURE__*/React.forwardRef(({
12
12
  function renderListActionButton() {
13
13
  if (!listActionButton || listActionButton === true) {
14
14
  return /*#__PURE__*/React.createElement(Button, {
15
- forwardRef: ref,
15
+ ref: ref,
16
16
  onClick: onListAction,
17
17
  iconType: "add",
18
18
  iconPosition: "after"
19
19
  }, l.select.actionButtonText());
20
+ } // istanbul ignore if
21
+
22
+
23
+ if (! /*#__PURE__*/React.isValidElement(listActionButton)) {
24
+ return listActionButton;
20
25
  }
21
26
 
22
27
  return /*#__PURE__*/React.cloneElement(listActionButton, {
@@ -28,10 +33,8 @@ const ListActionButton = /*#__PURE__*/React.forwardRef(({
28
33
  return /*#__PURE__*/React.createElement(StyledListActionButtonWrapper, null, renderListActionButton());
29
34
  });
30
35
  ListActionButton.propTypes = {
31
- /** True for default text button or a Button Component to be rendered */
32
- listActionButton: PropTypes.oneOfType([PropTypes.bool, PropTypes.element]),
33
-
34
- /** A callback for when the Action Button is triggered */
35
- onListAction: PropTypes.func.isRequired
36
+ "listActionButton": PropTypes.node,
37
+ "onListAction": PropTypes.func
36
38
  };
39
+ ListActionButton.displayName = "ListActionButton";
37
40
  export default ListActionButton;
@@ -0,0 +1,2 @@
1
+ declare const StyledListActionButtonWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export default StyledListActionButtonWrapper;
@@ -1 +1,2 @@
1
- export { default } from "./multi-select";
1
+ export { default } from "./multi-select.component";
2
+ export type { MultiSelectProps } from "./multi-select.component";
@@ -0,0 +1 @@
1
+ export { default } from "./multi-select.component";
@@ -0,0 +1,62 @@
1
+ import React from "react";
2
+ import { Side } from "@floating-ui/dom";
3
+ import { FormInputPropTypes } from "../select-textbox";
4
+ export interface MultiSelectProps extends Omit<FormInputPropTypes, "defaultValue" | "value"> {
5
+ /** Prop to specify the aria-label attribute of the component input */
6
+ "aria-label"?: string;
7
+ /** Prop to specify the aria-labeledby property of the component input */
8
+ "aria-labelledby"?: string;
9
+ /** Identifier used for testing purposes, applied to the root element of the component. */
10
+ "data-component"?: string;
11
+ /** Identifier used for testing purposes, applied to the root element of the component. */
12
+ "data-element"?: string;
13
+ /** Identifier used for testing purposes, applied to the root element of the component. */
14
+ "data-role"?: string;
15
+ /** Size of an input */
16
+ size?: "small" | "medium" | "large";
17
+ /** Child components (such as Option or OptionRow) for the SelectList */
18
+ children: React.ReactNode;
19
+ /** The default selected value(s), when the component is operating in uncontrolled mode */
20
+ defaultValue?: string[] | Record<string, unknown>[];
21
+ /** Boolean to toggle where SelectList is rendered in relation to the Select Input */
22
+ disablePortal?: boolean;
23
+ /** If true the loader animation is displayed in the option list */
24
+ isLoading?: boolean;
25
+ /** When true component will work in multi column mode.
26
+ * Children should consist of OptionRow components in this mode
27
+ */
28
+ multiColumn?: boolean;
29
+ /** A custom message to be displayed when any option does not match the filter text */
30
+ noResultsMessage?: string;
31
+ /** A custom callback for when the input text changes */
32
+ onFilterChange?: (filterText: string) => void;
33
+ /** A custom callback for when the dropdown menu opens */
34
+ onOpen?: () => void;
35
+ /** If true the Component opens on focus */
36
+ openOnFocus?: boolean;
37
+ /** SelectList table header, should consist of multiple th elements.
38
+ * Works only in multiColumn mode
39
+ */
40
+ tableHeader?: React.ReactNode;
41
+ /** The selected value(s), when the component is operating in controlled mode */
42
+ value?: string[] | Record<string, unknown>[];
43
+ /** Overrides the default tooltip position */
44
+ tooltipPosition?: "top" | "bottom" | "left" | "right";
45
+ /** Maximum list height - defaults to 180 */
46
+ listMaxHeight?: number;
47
+ /** Placement of the select list in relation to the input element */
48
+ listPlacement?: Side;
49
+ /** Use the opposite list placement if the set placement does not fit */
50
+ flipEnabled?: boolean;
51
+ /** Wraps the pill text when it would overflow the input width */
52
+ wrapPillText?: boolean;
53
+ /** Set this prop to enable a virtualised list of options. If it is not used then all options will be in the
54
+ * DOM at all times, which may cause performance problems on very large lists */
55
+ enableVirtualScroll?: boolean;
56
+ /** The number of options to render into the DOM at once, either side of the currently-visible ones.
57
+ * Higher values make for smoother scrolling but may impact performance.
58
+ * Only used if the `enableVirtualScroll` prop is set. */
59
+ virtualScrollOverscan?: number;
60
+ }
61
+ export declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps & React.RefAttributes<unknown>>;
62
+ export default MultiSelect;