@spscommerce/ds-react 5.6.0 → 5.7.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.cjs.js +59 -59
- package/lib/index.es.js +18 -5
- package/package.json +9 -9
package/lib/index.es.js
CHANGED
|
@@ -610,29 +610,39 @@ const SpsFormComponentWrapper = React.forwardRef((props2, ref2) => {
|
|
|
610
610
|
focusInputOnClick,
|
|
611
611
|
formControl: formControl2,
|
|
612
612
|
formMeta,
|
|
613
|
-
inputRef: inputRefProp
|
|
613
|
+
inputRef: inputRefProp,
|
|
614
|
+
onClick
|
|
614
615
|
} = _a, rest = __objRest(_a, [
|
|
615
616
|
"className",
|
|
616
617
|
"children",
|
|
617
618
|
"focusInputOnClick",
|
|
618
619
|
"formControl",
|
|
619
620
|
"formMeta",
|
|
620
|
-
"inputRef"
|
|
621
|
+
"inputRef",
|
|
622
|
+
"onClick"
|
|
621
623
|
]);
|
|
622
624
|
const fallbackRef = React.useRef();
|
|
623
625
|
const rootRef = ref2 || fallbackRef;
|
|
624
626
|
const inputRef = inputRefProp || rootRef;
|
|
625
|
-
function
|
|
627
|
+
function doFocusInputOnClick() {
|
|
626
628
|
if (inputRef && inputRef !== ref2 && inputRef.current) {
|
|
627
629
|
inputRef.current.focus();
|
|
628
630
|
}
|
|
629
631
|
}
|
|
630
632
|
const classes = clsx("sps-form-group", (formControl2 && formControl2.isRequired() || formMeta && formMeta.isRequired()) && "sps-form-group--required", (formControl2 && !formControl2.isValid() || formMeta && formMeta.isVisibilyInvalid()) && "sps-form-group--error", className);
|
|
633
|
+
function handleOnClick(event) {
|
|
634
|
+
if (focusInputOnClick) {
|
|
635
|
+
doFocusInputOnClick();
|
|
636
|
+
}
|
|
637
|
+
if (onClick) {
|
|
638
|
+
onClick(event);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
631
641
|
return /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
|
632
642
|
className: classes,
|
|
633
643
|
ref: ref2,
|
|
634
644
|
tabIndex: -1,
|
|
635
|
-
onClick:
|
|
645
|
+
onClick: handleOnClick
|
|
636
646
|
}), children);
|
|
637
647
|
});
|
|
638
648
|
Object.assign(SpsFormComponentWrapper, {
|
|
@@ -29527,6 +29537,7 @@ const SpsSelect = React.forwardRef((props2, ref2) => {
|
|
|
29527
29537
|
notClearable,
|
|
29528
29538
|
options,
|
|
29529
29539
|
onChange,
|
|
29540
|
+
onClick,
|
|
29530
29541
|
placeholder,
|
|
29531
29542
|
searchDebounce,
|
|
29532
29543
|
searchPlaceholder = "Search\u2026",
|
|
@@ -29552,6 +29563,7 @@ const SpsSelect = React.forwardRef((props2, ref2) => {
|
|
|
29552
29563
|
"notClearable",
|
|
29553
29564
|
"options",
|
|
29554
29565
|
"onChange",
|
|
29566
|
+
"onClick",
|
|
29555
29567
|
"placeholder",
|
|
29556
29568
|
"searchDebounce",
|
|
29557
29569
|
"searchPlaceholder",
|
|
@@ -29686,7 +29698,8 @@ const SpsSelect = React.forwardRef((props2, ref2) => {
|
|
|
29686
29698
|
ref: rootElement,
|
|
29687
29699
|
role: "listbox",
|
|
29688
29700
|
"aria-owns": state.optionIds,
|
|
29689
|
-
"data-testid": testId
|
|
29701
|
+
"data-testid": testId,
|
|
29702
|
+
onClick
|
|
29690
29703
|
}, rest), /* @__PURE__ */ React.createElement("div", {
|
|
29691
29704
|
className: clsx("sps-select__dropctrl", disabled && "disabled"),
|
|
29692
29705
|
id: controlId,
|
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.7.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,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.7.0",
|
|
32
|
+
"@spscommerce/ds-shared": "5.7.0",
|
|
33
|
+
"@spscommerce/positioning": "5.7.0",
|
|
34
|
+
"@spscommerce/utils": "5.7.0",
|
|
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.7.0",
|
|
43
|
+
"@spscommerce/ds-shared": "5.7.0",
|
|
44
|
+
"@spscommerce/positioning": "5.7.0",
|
|
45
|
+
"@spscommerce/utils": "5.7.0",
|
|
46
46
|
"@testing-library/react": "^9.3.2",
|
|
47
47
|
"@types/prop-types": "^15.7.1",
|
|
48
48
|
"@types/react": "^16.9.0",
|