@spscommerce/ds-react 6.11.2 → 6.12.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/lib/index.es.js CHANGED
@@ -1776,7 +1776,8 @@ const spsOptionListPassthroughProps = {
1776
1776
  zeroState: "string",
1777
1777
  maxHeightPx: "number",
1778
1778
  maxHeightRem: "number",
1779
- disableOptionsMemoization: "boolean"
1779
+ disableOptionsMemoization: "boolean",
1780
+ onSpecialActionSelect: "() => void"
1780
1781
  },
1781
1782
  propTypes: {
1782
1783
  captionKey: propTypes$1G.exports.string,
@@ -1801,7 +1802,8 @@ const searchableOptionListProps = {
1801
1802
  search: propTypes$1G.exports.string,
1802
1803
  searchDebounce: propTypes$1G.exports.number,
1803
1804
  searchPlaceholder: propTypes$1G.exports.string,
1804
- searchInputRef: ref()
1805
+ searchInputRef: ref(),
1806
+ onSpecialActionSelect: fun()
1805
1807
  };
1806
1808
  const propTypes$1C = __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, spsGlobalPropTypes), spsOptionListPassthroughProps.propTypes), searchableOptionListProps), {
1807
1809
  attachTo: ref().isRequired,
@@ -2117,6 +2119,7 @@ const SpsOptionList = React.forwardRef((props2, ref2) => {
2117
2119
  search,
2118
2120
  searchDebounce,
2119
2121
  searchPlaceholder,
2122
+ onSpecialActionSelect,
2120
2123
  attachTo,
2121
2124
  className,
2122
2125
  conformWidth,
@@ -2155,6 +2158,7 @@ const SpsOptionList = React.forwardRef((props2, ref2) => {
2155
2158
  "search",
2156
2159
  "searchDebounce",
2157
2160
  "searchPlaceholder",
2161
+ "onSpecialActionSelect",
2158
2162
  "attachTo",
2159
2163
  "className",
2160
2164
  "conformWidth",
@@ -2237,6 +2241,9 @@ const SpsOptionList = React.forwardRef((props2, ref2) => {
2237
2241
  if (option && !option.disabled) {
2238
2242
  if (typeof option.value === "function") {
2239
2243
  option.value();
2244
+ if (onSpecialActionSelect) {
2245
+ onSpecialActionSelect();
2246
+ }
2240
2247
  } else if (typeof onOptionSelected === "function") {
2241
2248
  onOptionSelected(option.value);
2242
2249
  }
@@ -29632,6 +29639,12 @@ function SpsMultiSelect(_O) {
29632
29639
  optionIds: new Array(filteredListLength).fill("").map((s, i2) => `${wrapperId}-options-option-${i2}`).join(",")
29633
29640
  });
29634
29641
  }
29642
+ const onSpecialActionSelect = React.useCallback(() => {
29643
+ patchState({
29644
+ searchText: ""
29645
+ });
29646
+ focusTextInput();
29647
+ }, []);
29635
29648
  const classes = clsx(unsafelyReplaceClassName || "sps-multi-select", showPopup && "sps-multi-select--open", showPopup && "z-stratum-dropdown", state.opensUpward && "sps-multi-select--opens-upward", disabled && "sps-form-control--disabled", className);
29636
29649
  const tagIds = new Array(value.length).fill(0).map((_, i2) => `${wrapperId}_tag-${i2}`);
29637
29650
  return /* @__PURE__ */ React.createElement(SpsFormComponentWrapper, {
@@ -29708,7 +29721,8 @@ function SpsMultiSelect(_O) {
29708
29721
  loading,
29709
29722
  maxHeightPx: maxHeightOptionListPx,
29710
29723
  maxHeightRem: maxHeightOptionListRem,
29711
- disableOptionsMemoization
29724
+ disableOptionsMemoization,
29725
+ onSpecialActionSelect
29712
29726
  }));
29713
29727
  }
29714
29728
  Object.assign(SpsMultiSelect, {
@@ -16,6 +16,7 @@ export declare const spsOptionListPassthroughProps: {
16
16
  maxHeightPx: string;
17
17
  maxHeightRem: string;
18
18
  disableOptionsMemoization: string;
19
+ onSpecialActionSelect: string;
19
20
  };
20
21
  propTypes: {
21
22
  captionKey: PropTypes.Requireable<string>;
@@ -37,6 +38,7 @@ export declare const searchableOptionListProps: {
37
38
  searchDebounce: PropTypes.Requireable<number>;
38
39
  searchPlaceholder: PropTypes.Requireable<string>;
39
40
  searchInputRef: PropTypes.Requireable<import("react").MutableRefObject<HTMLInputElement>>;
41
+ onSpecialActionSelect: PropTypes.Requireable<() => void>;
40
42
  };
41
43
  export declare const propTypes: {
42
44
  attachTo: PropTypes.Validator<import("react").MutableRefObject<HTMLElement>>;
@@ -65,6 +67,7 @@ export declare const propTypes: {
65
67
  searchDebounce: PropTypes.Requireable<number>;
66
68
  searchPlaceholder: PropTypes.Requireable<string>;
67
69
  searchInputRef: PropTypes.Requireable<import("react").MutableRefObject<HTMLInputElement>>;
70
+ onSpecialActionSelect: PropTypes.Requireable<() => void>;
68
71
  captionKey: PropTypes.Requireable<string>;
69
72
  comparisonKey: PropTypes.Requireable<string>;
70
73
  disabledOptions: PropTypes.Requireable<any[]>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spscommerce/ds-react",
3
3
  "description": "SPS Design System React components",
4
- "version": "6.11.2",
4
+ "version": "6.12.0",
5
5
  "author": "SPS Commerce",
6
6
  "license": "UNLICENSED",
7
7
  "repository": "https://github.com/spscommerce/design-system/tree/main/packages/@spscommerce/ds-react",
@@ -28,11 +28,11 @@
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@react-stately/collections": "^3.3.3",
31
- "@spscommerce/ds-colors": "6.11.2",
32
- "@spscommerce/ds-illustrations": "6.11.2",
33
- "@spscommerce/ds-shared": "6.11.2",
34
- "@spscommerce/positioning": "6.11.2",
35
- "@spscommerce/utils": "6.11.2",
31
+ "@spscommerce/ds-colors": "6.12.0",
32
+ "@spscommerce/ds-illustrations": "6.12.0",
33
+ "@spscommerce/ds-shared": "6.12.0",
34
+ "@spscommerce/positioning": "6.12.0",
35
+ "@spscommerce/utils": "^6.11.3",
36
36
  "moment": "^2.25.3",
37
37
  "moment-timezone": "^0.5.28",
38
38
  "react": "^16.9.0",
@@ -40,11 +40,11 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@react-stately/collections": "^3.3.3",
43
- "@spscommerce/ds-colors": "6.11.2",
44
- "@spscommerce/ds-illustrations": "6.11.2",
45
- "@spscommerce/ds-shared": "6.11.2",
46
- "@spscommerce/positioning": "6.11.2",
47
- "@spscommerce/utils": "6.11.2",
43
+ "@spscommerce/ds-colors": "6.12.0",
44
+ "@spscommerce/ds-illustrations": "6.12.0",
45
+ "@spscommerce/ds-shared": "6.12.0",
46
+ "@spscommerce/positioning": "6.12.0",
47
+ "@spscommerce/utils": "^6.11.3",
48
48
  "@testing-library/react": "^9.3.2",
49
49
  "@types/prop-types": "^15.7.1",
50
50
  "@types/react": "^16.9.0",