@spscommerce/ds-react 5.11.1 → 5.12.3
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/autocomplete/SpsAutocomplete.d.ts +3 -1
- package/lib/dropdown/SpsDropdown.d.ts +2 -0
- package/lib/form/hooks/useSpsForm.d.ts +1 -1
- package/lib/index.cjs.js +341 -341
- package/lib/index.es.js +90 -25
- package/lib/multi-select/SpsMultiSelect.d.ts +3 -1
- package/lib/option-list/SpsOptionListProps.d.ts +6 -0
- package/lib/select/SpsSelect.d.ts +3 -1
- package/package.json +9 -9
package/lib/index.es.js
CHANGED
|
@@ -902,8 +902,7 @@ class SpsFormMetaBase {
|
|
|
902
902
|
this.preventativeErrors = [];
|
|
903
903
|
}
|
|
904
904
|
setValidators(newValidators) {
|
|
905
|
-
this.
|
|
906
|
-
this.update(null);
|
|
905
|
+
this.update(this.path, null, null, newValidators);
|
|
907
906
|
return this;
|
|
908
907
|
}
|
|
909
908
|
validate(newValue) {
|
|
@@ -1148,6 +1147,7 @@ function useSpsForm(value, validatorMap) {
|
|
|
1148
1147
|
return controlSet;
|
|
1149
1148
|
}, []);
|
|
1150
1149
|
const scheduledDispatch = useRef();
|
|
1150
|
+
let currentValidatorMap = validatorMap;
|
|
1151
1151
|
const reducer2 = useCallback$1((currentState, action) => {
|
|
1152
1152
|
let newValue;
|
|
1153
1153
|
scheduledDispatch.current = null;
|
|
@@ -1159,6 +1159,14 @@ function useSpsForm(value, validatorMap) {
|
|
|
1159
1159
|
control.focused = false;
|
|
1160
1160
|
control.revealAllErrors = true;
|
|
1161
1161
|
}
|
|
1162
|
+
} else if (action.newValidators) {
|
|
1163
|
+
if (currentValidatorMap) {
|
|
1164
|
+
const controlPath = action.path.join(".");
|
|
1165
|
+
const newValidatorMap = __spreadValues({}, currentValidatorMap);
|
|
1166
|
+
newValidatorMap[controlPath] = action.newValidators;
|
|
1167
|
+
currentValidatorMap = newValidatorMap;
|
|
1168
|
+
updateValidators(currentState.formValue, currentState.formMeta, currentValidatorMap, true);
|
|
1169
|
+
}
|
|
1162
1170
|
} else {
|
|
1163
1171
|
newValue = cloneFormValue(currentState.formValue, action.path);
|
|
1164
1172
|
setPath(newValue, action.path, action.value);
|
|
@@ -1203,8 +1211,8 @@ function useSpsForm(value, validatorMap) {
|
|
|
1203
1211
|
}
|
|
1204
1212
|
}
|
|
1205
1213
|
}
|
|
1206
|
-
if (
|
|
1207
|
-
updateValidators(newValue, currentState.formMeta,
|
|
1214
|
+
if (currentValidatorMap) {
|
|
1215
|
+
updateValidators(newValue, currentState.formMeta, currentValidatorMap);
|
|
1208
1216
|
const alreadyValidated = new Set();
|
|
1209
1217
|
validatorMapForEach(currentState.formMeta, validatorMap, (control, validators) => {
|
|
1210
1218
|
if (typeof validators === "function") {
|
|
@@ -1247,9 +1255,14 @@ function useSpsForm(value, validatorMap) {
|
|
|
1247
1255
|
};
|
|
1248
1256
|
}, []);
|
|
1249
1257
|
const [state, dispatch] = useReducer(reducer2, { formValue: value, formMeta, updateForm });
|
|
1250
|
-
function update2(path, newValue, markAsBlurred = false) {
|
|
1258
|
+
function update2(path, newValue, markAsBlurred = false, newValidators) {
|
|
1251
1259
|
if (path) {
|
|
1252
|
-
dispatch({
|
|
1260
|
+
dispatch({
|
|
1261
|
+
path,
|
|
1262
|
+
value: newValue,
|
|
1263
|
+
markAsBlurred,
|
|
1264
|
+
newValidators
|
|
1265
|
+
});
|
|
1253
1266
|
} else {
|
|
1254
1267
|
updateForm();
|
|
1255
1268
|
}
|
|
@@ -1671,7 +1684,9 @@ const spsOptionListPassthroughProps = {
|
|
|
1671
1684
|
tall: "boolean",
|
|
1672
1685
|
textKey: "string",
|
|
1673
1686
|
valueKey: "string",
|
|
1674
|
-
zeroState: "string"
|
|
1687
|
+
zeroState: "string",
|
|
1688
|
+
maxHeightPx: "number",
|
|
1689
|
+
maxHeightRem: "number"
|
|
1675
1690
|
},
|
|
1676
1691
|
propTypes: {
|
|
1677
1692
|
captionKey: propTypes$1N.exports.string,
|
|
@@ -1685,7 +1700,9 @@ const spsOptionListPassthroughProps = {
|
|
|
1685
1700
|
tall: propTypes$1N.exports.bool,
|
|
1686
1701
|
textKey: propTypes$1N.exports.string,
|
|
1687
1702
|
valueKey: propTypes$1N.exports.string,
|
|
1688
|
-
zeroState: propTypes$1N.exports.string
|
|
1703
|
+
zeroState: propTypes$1N.exports.string,
|
|
1704
|
+
maxHeightPx: propTypes$1N.exports.number,
|
|
1705
|
+
maxHeightRem: propTypes$1N.exports.number
|
|
1689
1706
|
}
|
|
1690
1707
|
};
|
|
1691
1708
|
const searchableOptionListProps = {
|
|
@@ -2023,6 +2040,8 @@ const SpsOptionList = React.forwardRef((props2, ref2) => {
|
|
|
2023
2040
|
unsafelyReplaceClassName,
|
|
2024
2041
|
loading,
|
|
2025
2042
|
filterByTextAndCaptionKey,
|
|
2043
|
+
maxHeightPx,
|
|
2044
|
+
maxHeightRem,
|
|
2026
2045
|
"data-testid": testId
|
|
2027
2046
|
} = _a, rest = __objRest(_a, [
|
|
2028
2047
|
"captionKey",
|
|
@@ -2058,6 +2077,8 @@ const SpsOptionList = React.forwardRef((props2, ref2) => {
|
|
|
2058
2077
|
"unsafelyReplaceClassName",
|
|
2059
2078
|
"loading",
|
|
2060
2079
|
"filterByTextAndCaptionKey",
|
|
2080
|
+
"maxHeightPx",
|
|
2081
|
+
"maxHeightRem",
|
|
2061
2082
|
"data-testid"
|
|
2062
2083
|
]);
|
|
2063
2084
|
const specialActionOption = React.useMemo(() => specialAction ? new SpsOptionListOption(specialAction, {
|
|
@@ -2279,6 +2300,8 @@ const SpsOptionList = React.forwardRef((props2, ref2) => {
|
|
|
2279
2300
|
onPositionFlip(openingUpward);
|
|
2280
2301
|
}
|
|
2281
2302
|
}, [isOpen]);
|
|
2303
|
+
const maxHeight = maxHeightPx ? maxHeightPx / 16 : maxHeightRem;
|
|
2304
|
+
const optionsInlineStyles = maxHeight ? { maxHeight: `${maxHeight}rem` } : {};
|
|
2282
2305
|
return portal(/* @__PURE__ */ React.createElement("div", __spreadValues({
|
|
2283
2306
|
className: classes,
|
|
2284
2307
|
id: id2,
|
|
@@ -2291,7 +2314,8 @@ const SpsOptionList = React.forwardRef((props2, ref2) => {
|
|
|
2291
2314
|
}, rest), searchElement, /* @__PURE__ */ React.createElement("div", {
|
|
2292
2315
|
className: optionsClasses,
|
|
2293
2316
|
ref: optionsRef,
|
|
2294
|
-
"data-testid": `${testId}-options
|
|
2317
|
+
"data-testid": `${testId}-options`,
|
|
2318
|
+
style: optionsInlineStyles
|
|
2295
2319
|
}, !loading && !searchState.pending && zeroState && (searchState.value || !searchState.isAsync) && optionList.length === 0 && /* @__PURE__ */ React.createElement("div", {
|
|
2296
2320
|
className: "sps-option-list__zero-state"
|
|
2297
2321
|
}, zeroState), (loading || searchState.pending) && /* @__PURE__ */ React.createElement("div", {
|
|
@@ -2445,7 +2469,9 @@ const propsDoc$1F = {
|
|
|
2445
2469
|
tallOptionList: "boolean",
|
|
2446
2470
|
value: "string",
|
|
2447
2471
|
zeroState: "string",
|
|
2448
|
-
loading: "boolean"
|
|
2472
|
+
loading: "boolean",
|
|
2473
|
+
maxHeightOptionListPx: "number",
|
|
2474
|
+
maxHeightOptionListRem: "number"
|
|
2449
2475
|
};
|
|
2450
2476
|
const propTypes$1I = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
|
|
2451
2477
|
debounce: propTypes$1N.exports.number,
|
|
@@ -2463,7 +2489,9 @@ const propTypes$1I = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
|
|
|
2463
2489
|
tallOptionList: propTypes$1N.exports.bool,
|
|
2464
2490
|
value: propTypes$1N.exports.string,
|
|
2465
2491
|
zeroState: propTypes$1N.exports.string,
|
|
2466
|
-
loading: propTypes$1N.exports.bool
|
|
2492
|
+
loading: propTypes$1N.exports.bool,
|
|
2493
|
+
maxHeightOptionListPx: propTypes$1N.exports.number,
|
|
2494
|
+
maxHeightOptionListRem: propTypes$1N.exports.number
|
|
2467
2495
|
});
|
|
2468
2496
|
function SpsAutocomplete(_a) {
|
|
2469
2497
|
var _b = _a, {
|
|
@@ -2481,7 +2509,9 @@ function SpsAutocomplete(_a) {
|
|
|
2481
2509
|
tallOptionList,
|
|
2482
2510
|
value = "",
|
|
2483
2511
|
zeroState,
|
|
2484
|
-
loading
|
|
2512
|
+
loading,
|
|
2513
|
+
maxHeightOptionListPx,
|
|
2514
|
+
maxHeightOptionListRem
|
|
2485
2515
|
} = _b, rest = __objRest(_b, [
|
|
2486
2516
|
"className",
|
|
2487
2517
|
"debounce",
|
|
@@ -2497,7 +2527,9 @@ function SpsAutocomplete(_a) {
|
|
|
2497
2527
|
"tallOptionList",
|
|
2498
2528
|
"value",
|
|
2499
2529
|
"zeroState",
|
|
2500
|
-
"loading"
|
|
2530
|
+
"loading",
|
|
2531
|
+
"maxHeightOptionListPx",
|
|
2532
|
+
"maxHeightOptionListRem"
|
|
2501
2533
|
]);
|
|
2502
2534
|
const meta = formMeta || formControl2;
|
|
2503
2535
|
const { wrapperId, controlId } = useFormControlId(id2, meta);
|
|
@@ -2606,7 +2638,9 @@ function SpsAutocomplete(_a) {
|
|
|
2606
2638
|
searchDebounce: debounce2,
|
|
2607
2639
|
tall: tallOptionList,
|
|
2608
2640
|
zeroState,
|
|
2609
|
-
loading
|
|
2641
|
+
loading,
|
|
2642
|
+
maxHeightPx: maxHeightOptionListPx,
|
|
2643
|
+
maxHeightRem: maxHeightOptionListRem
|
|
2610
2644
|
}));
|
|
2611
2645
|
}
|
|
2612
2646
|
Object.assign(SpsAutocomplete, {
|
|
@@ -2746,7 +2780,9 @@ const propsDoc$1E = {
|
|
|
2746
2780
|
tallOptionList: "boolean",
|
|
2747
2781
|
onOpen: "() => void",
|
|
2748
2782
|
onClose: "() => void",
|
|
2749
|
-
loading: "boolean"
|
|
2783
|
+
loading: "boolean",
|
|
2784
|
+
maxHeightOptionListPx: "number",
|
|
2785
|
+
maxHeightOptionListRem: "number"
|
|
2750
2786
|
};
|
|
2751
2787
|
const propTypes$1H = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
|
|
2752
2788
|
alignLeft: propTypes$1N.exports.bool,
|
|
@@ -2760,7 +2796,9 @@ const propTypes$1H = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
|
|
|
2760
2796
|
tallOptionList: propTypes$1N.exports.bool,
|
|
2761
2797
|
onOpen: fun(),
|
|
2762
2798
|
onClose: fun(),
|
|
2763
|
-
loading: propTypes$1N.exports.bool
|
|
2799
|
+
loading: propTypes$1N.exports.bool,
|
|
2800
|
+
maxHeightOptionListPx: propTypes$1N.exports.number,
|
|
2801
|
+
maxHeightOptionListRem: propTypes$1N.exports.number
|
|
2764
2802
|
});
|
|
2765
2803
|
function SpsDropdown(props2) {
|
|
2766
2804
|
const _a = props2, {
|
|
@@ -2779,7 +2817,9 @@ function SpsDropdown(props2) {
|
|
|
2779
2817
|
unsafelyReplaceClassName,
|
|
2780
2818
|
onOpen,
|
|
2781
2819
|
onClose,
|
|
2782
|
-
loading
|
|
2820
|
+
loading,
|
|
2821
|
+
maxHeightOptionListPx,
|
|
2822
|
+
maxHeightOptionListRem
|
|
2783
2823
|
} = _a, rest = __objRest(_a, [
|
|
2784
2824
|
"alignLeft",
|
|
2785
2825
|
"className",
|
|
@@ -2796,7 +2836,9 @@ function SpsDropdown(props2) {
|
|
|
2796
2836
|
"unsafelyReplaceClassName",
|
|
2797
2837
|
"onOpen",
|
|
2798
2838
|
"onClose",
|
|
2799
|
-
"loading"
|
|
2839
|
+
"loading",
|
|
2840
|
+
"maxHeightOptionListPx",
|
|
2841
|
+
"maxHeightOptionListRem"
|
|
2800
2842
|
]);
|
|
2801
2843
|
const { t: t2 } = React.useContext(I18nContext);
|
|
2802
2844
|
const id2 = useElementId(idProp);
|
|
@@ -2895,7 +2937,9 @@ function SpsDropdown(props2) {
|
|
|
2895
2937
|
offsets: [0, 0],
|
|
2896
2938
|
tall: tallOptionList,
|
|
2897
2939
|
optionRole: "option",
|
|
2898
|
-
loading
|
|
2940
|
+
loading,
|
|
2941
|
+
maxHeightPx: maxHeightOptionListPx,
|
|
2942
|
+
maxHeightRem: maxHeightOptionListRem
|
|
2899
2943
|
}), /* @__PURE__ */ React.createElement("div", {
|
|
2900
2944
|
onClick: handleButtonClick,
|
|
2901
2945
|
className: buttonClasses,
|
|
@@ -26302,7 +26346,8 @@ function SpsTable(props2) {
|
|
|
26302
26346
|
const updateSortingDisplay = (newSort) => {
|
|
26303
26347
|
const sortedColumn = newSort && newSort[0];
|
|
26304
26348
|
React.Children.map(children, (child) => React.Children.map(child.props.children, (c2) => React.Children.map(c2.props.children, (c22) => {
|
|
26305
|
-
|
|
26349
|
+
var _a2, _b;
|
|
26350
|
+
if (sortedColumn && (((_a2 = c22 == null ? void 0 : c22.props) == null ? void 0 : _a2.sortKey) && ((_b = c22 == null ? void 0 : c22.props) == null ? void 0 : _b.sortKey) === sortedColumn.key)) {
|
|
26306
26351
|
setSort([sortedColumn]);
|
|
26307
26352
|
}
|
|
26308
26353
|
})));
|
|
@@ -29651,7 +29696,9 @@ const propsDoc$P = {
|
|
|
29651
29696
|
textKey: "string",
|
|
29652
29697
|
value: "any",
|
|
29653
29698
|
zeroState: "string",
|
|
29654
|
-
loading: "boolean"
|
|
29699
|
+
loading: "boolean",
|
|
29700
|
+
maxHeightOptionListPx: "number",
|
|
29701
|
+
maxHeightOptionListRem: "number"
|
|
29655
29702
|
};
|
|
29656
29703
|
const propTypes$R = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
|
|
29657
29704
|
action: fun(),
|
|
@@ -29675,7 +29722,9 @@ const propTypes$R = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
|
|
|
29675
29722
|
textKey: propTypes$1N.exports.string,
|
|
29676
29723
|
value: propTypes$1N.exports.any,
|
|
29677
29724
|
zeroState: propTypes$1N.exports.string,
|
|
29678
|
-
loading: propTypes$1N.exports.bool
|
|
29725
|
+
loading: propTypes$1N.exports.bool,
|
|
29726
|
+
maxHeightOptionListPx: propTypes$1N.exports.number,
|
|
29727
|
+
maxHeightOptionListRem: propTypes$1N.exports.number
|
|
29679
29728
|
});
|
|
29680
29729
|
function SpsMultiSelect(_w) {
|
|
29681
29730
|
var _x = _w, {
|
|
@@ -29700,6 +29749,8 @@ function SpsMultiSelect(_w) {
|
|
|
29700
29749
|
zeroState = "There are no matching options.",
|
|
29701
29750
|
loading,
|
|
29702
29751
|
icon,
|
|
29752
|
+
maxHeightOptionListPx,
|
|
29753
|
+
maxHeightOptionListRem,
|
|
29703
29754
|
"data-testid": testId
|
|
29704
29755
|
} = _x, rest = __objRest(_x, [
|
|
29705
29756
|
"action",
|
|
@@ -29723,6 +29774,8 @@ function SpsMultiSelect(_w) {
|
|
|
29723
29774
|
"zeroState",
|
|
29724
29775
|
"loading",
|
|
29725
29776
|
"icon",
|
|
29777
|
+
"maxHeightOptionListPx",
|
|
29778
|
+
"maxHeightOptionListRem",
|
|
29726
29779
|
"data-testid"
|
|
29727
29780
|
]);
|
|
29728
29781
|
const meta = formMeta || formControl2;
|
|
@@ -29921,7 +29974,9 @@ function SpsMultiSelect(_w) {
|
|
|
29921
29974
|
tall: tallOptionList,
|
|
29922
29975
|
textKey,
|
|
29923
29976
|
zeroState,
|
|
29924
|
-
loading
|
|
29977
|
+
loading,
|
|
29978
|
+
maxHeightPx: maxHeightOptionListPx,
|
|
29979
|
+
maxHeightRem: maxHeightOptionListRem
|
|
29925
29980
|
}));
|
|
29926
29981
|
}
|
|
29927
29982
|
Object.assign(SpsMultiSelect, {
|
|
@@ -30231,7 +30286,9 @@ const propsDoc$M = {
|
|
|
30231
30286
|
zeroState: "string",
|
|
30232
30287
|
autoFixWidth: "boolean",
|
|
30233
30288
|
loading: "boolean",
|
|
30234
|
-
filterByTextAndCaptionKey: "boolean"
|
|
30289
|
+
filterByTextAndCaptionKey: "boolean",
|
|
30290
|
+
maxHeightOptionListPx: "number",
|
|
30291
|
+
maxHeightOptionListRem: "number"
|
|
30235
30292
|
};
|
|
30236
30293
|
const propTypes$O = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
|
|
30237
30294
|
action: fun(),
|
|
@@ -30257,7 +30314,9 @@ const propTypes$O = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
|
|
|
30257
30314
|
zeroState: propTypes$1N.exports.string,
|
|
30258
30315
|
autoFixWidth: propTypes$1N.exports.bool,
|
|
30259
30316
|
loading: propTypes$1N.exports.bool,
|
|
30260
|
-
filterByTextAndCaptionKey: propTypes$1N.exports.bool
|
|
30317
|
+
filterByTextAndCaptionKey: propTypes$1N.exports.bool,
|
|
30318
|
+
maxHeightOptionListPx: propTypes$1N.exports.number,
|
|
30319
|
+
maxHeightOptionListRem: propTypes$1N.exports.number
|
|
30261
30320
|
});
|
|
30262
30321
|
const SpsSelect = React.forwardRef((props2, ref2) => {
|
|
30263
30322
|
const _a = props2, {
|
|
@@ -30285,6 +30344,8 @@ const SpsSelect = React.forwardRef((props2, ref2) => {
|
|
|
30285
30344
|
zeroState,
|
|
30286
30345
|
loading,
|
|
30287
30346
|
filterByTextAndCaptionKey,
|
|
30347
|
+
maxHeightOptionListPx,
|
|
30348
|
+
maxHeightOptionListRem,
|
|
30288
30349
|
"data-testid": testId
|
|
30289
30350
|
} = _a, rest = __objRest(_a, [
|
|
30290
30351
|
"action",
|
|
@@ -30311,6 +30372,8 @@ const SpsSelect = React.forwardRef((props2, ref2) => {
|
|
|
30311
30372
|
"zeroState",
|
|
30312
30373
|
"loading",
|
|
30313
30374
|
"filterByTextAndCaptionKey",
|
|
30375
|
+
"maxHeightOptionListPx",
|
|
30376
|
+
"maxHeightOptionListRem",
|
|
30314
30377
|
"data-testid"
|
|
30315
30378
|
]);
|
|
30316
30379
|
const meta = formMeta || formControl2;
|
|
@@ -30481,6 +30544,8 @@ const SpsSelect = React.forwardRef((props2, ref2) => {
|
|
|
30481
30544
|
zeroState,
|
|
30482
30545
|
ignoreWidthStyles: autoFixWidth,
|
|
30483
30546
|
loading,
|
|
30547
|
+
maxHeightPx: maxHeightOptionListPx,
|
|
30548
|
+
maxHeightRem: maxHeightOptionListRem,
|
|
30484
30549
|
"data-testid": `${testId}-option-list`
|
|
30485
30550
|
}));
|
|
30486
30551
|
});
|
|
@@ -24,11 +24,13 @@ declare const propTypes: {
|
|
|
24
24
|
value: PropTypes.Requireable<any>;
|
|
25
25
|
zeroState: PropTypes.Requireable<string>;
|
|
26
26
|
loading: PropTypes.Requireable<boolean>;
|
|
27
|
+
maxHeightOptionListPx: PropTypes.Requireable<number>;
|
|
28
|
+
maxHeightOptionListRem: PropTypes.Requireable<number>;
|
|
27
29
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
28
30
|
className: PropTypes.Requireable<string>;
|
|
29
31
|
"data-testid": PropTypes.Requireable<string>;
|
|
30
32
|
unsafelyReplaceClassName: PropTypes.Requireable<string>;
|
|
31
33
|
};
|
|
32
34
|
export declare type SpsMultiSelectProps = PropTypes.InferTS<typeof propTypes, HTMLInputElement>;
|
|
33
|
-
export declare function SpsMultiSelect({ action, captionKey, className, debounce, disabled, disableSelected, comparisonKey, formControl, formMeta, hideSelected, id, onChange, options, placeholder, tallOptionList, textKey, unsafelyReplaceClassName, value, zeroState, loading, icon, "data-testid": testId, ...rest }: SpsMultiSelectProps): JSX.Element;
|
|
35
|
+
export declare function SpsMultiSelect({ action, captionKey, className, debounce, disabled, disableSelected, comparisonKey, formControl, formMeta, hideSelected, id, onChange, options, placeholder, tallOptionList, textKey, unsafelyReplaceClassName, value, zeroState, loading, icon, maxHeightOptionListPx, maxHeightOptionListRem, "data-testid": testId, ...rest }: SpsMultiSelectProps): JSX.Element;
|
|
34
36
|
export {};
|
|
@@ -13,6 +13,8 @@ export declare const spsOptionListPassthroughProps: {
|
|
|
13
13
|
textKey: string;
|
|
14
14
|
valueKey: string;
|
|
15
15
|
zeroState: string;
|
|
16
|
+
maxHeightPx: string;
|
|
17
|
+
maxHeightRem: string;
|
|
16
18
|
};
|
|
17
19
|
propTypes: {
|
|
18
20
|
captionKey: PropTypes.Requireable<string>;
|
|
@@ -23,6 +25,8 @@ export declare const spsOptionListPassthroughProps: {
|
|
|
23
25
|
textKey: PropTypes.Requireable<string>;
|
|
24
26
|
valueKey: PropTypes.Requireable<string>;
|
|
25
27
|
zeroState: PropTypes.Requireable<string>;
|
|
28
|
+
maxHeightPx: PropTypes.Requireable<number>;
|
|
29
|
+
maxHeightRem: PropTypes.Requireable<number>;
|
|
26
30
|
};
|
|
27
31
|
};
|
|
28
32
|
export declare const searchableOptionListProps: {
|
|
@@ -67,6 +71,8 @@ export declare const propTypes: {
|
|
|
67
71
|
textKey: PropTypes.Requireable<string>;
|
|
68
72
|
valueKey: PropTypes.Requireable<string>;
|
|
69
73
|
zeroState: PropTypes.Requireable<string>;
|
|
74
|
+
maxHeightPx: PropTypes.Requireable<number>;
|
|
75
|
+
maxHeightRem: PropTypes.Requireable<number>;
|
|
70
76
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
71
77
|
className: PropTypes.Requireable<string>;
|
|
72
78
|
"data-testid": PropTypes.Requireable<string>;
|
|
@@ -25,13 +25,15 @@ declare const propTypes: {
|
|
|
25
25
|
autoFixWidth: PropTypes.Requireable<boolean>;
|
|
26
26
|
loading: PropTypes.Requireable<boolean>;
|
|
27
27
|
filterByTextAndCaptionKey: PropTypes.Requireable<boolean>;
|
|
28
|
+
maxHeightOptionListPx: PropTypes.Requireable<number>;
|
|
29
|
+
maxHeightOptionListRem: PropTypes.Requireable<number>;
|
|
28
30
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
29
31
|
className: PropTypes.Requireable<string>;
|
|
30
32
|
"data-testid": PropTypes.Requireable<string>;
|
|
31
33
|
unsafelyReplaceClassName: PropTypes.Requireable<string>;
|
|
32
34
|
};
|
|
33
35
|
export declare type SpsSelectProps = PropTypes.InferTS<typeof propTypes, HTMLDivElement>;
|
|
34
|
-
export declare const SpsSelect: React.ForwardRefExoticComponent<Pick<SpsSelectProps, "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "label" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "data-testid" | "unsafelyReplaceClassName" | "formMeta" | "formControl" | "loading" | "filterByTextAndCaptionKey" | "searchDebounce" | "searchPlaceholder" | "captionKey" | "comparisonKey" | "options" | "textKey" | "valueKey" | "zeroState" | "tallOptionList" | "notClearable" | "autoFixWidth"> & React.RefAttributes<{
|
|
36
|
+
export declare const SpsSelect: React.ForwardRefExoticComponent<Pick<SpsSelectProps, "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "label" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "data-testid" | "unsafelyReplaceClassName" | "formMeta" | "formControl" | "loading" | "filterByTextAndCaptionKey" | "searchDebounce" | "searchPlaceholder" | "captionKey" | "comparisonKey" | "options" | "textKey" | "valueKey" | "zeroState" | "tallOptionList" | "maxHeightOptionListPx" | "maxHeightOptionListRem" | "notClearable" | "autoFixWidth"> & React.RefAttributes<{
|
|
35
37
|
focus: () => void;
|
|
36
38
|
}>>;
|
|
37
39
|
export {};
|
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": "5.
|
|
4
|
+
"version": "5.12.3",
|
|
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,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@react-stately/collections": "^3.3.3",
|
|
31
|
-
"@spscommerce/ds-colors": "5.
|
|
32
|
-
"@spscommerce/ds-shared": "5.
|
|
33
|
-
"@spscommerce/positioning": "5.
|
|
34
|
-
"@spscommerce/utils": "5.
|
|
31
|
+
"@spscommerce/ds-colors": "5.12.3",
|
|
32
|
+
"@spscommerce/ds-shared": "5.12.3",
|
|
33
|
+
"@spscommerce/positioning": "5.12.3",
|
|
34
|
+
"@spscommerce/utils": "5.12.3",
|
|
35
35
|
"moment": "^2.25.3",
|
|
36
36
|
"moment-timezone": "^0.5.28",
|
|
37
37
|
"react": "^16.9.0",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@react-stately/collections": "^3.3.3",
|
|
42
|
-
"@spscommerce/ds-colors": "5.
|
|
43
|
-
"@spscommerce/ds-shared": "5.
|
|
44
|
-
"@spscommerce/positioning": "5.
|
|
45
|
-
"@spscommerce/utils": "5.
|
|
42
|
+
"@spscommerce/ds-colors": "5.12.3",
|
|
43
|
+
"@spscommerce/ds-shared": "5.12.3",
|
|
44
|
+
"@spscommerce/positioning": "5.12.3",
|
|
45
|
+
"@spscommerce/utils": "5.12.3",
|
|
46
46
|
"@testing-library/react": "^9.3.2",
|
|
47
47
|
"@types/prop-types": "^15.7.1",
|
|
48
48
|
"@types/react": "^16.9.0",
|