@purpurds/quantity-selector 5.30.1 → 5.32.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/.rush/temp/operation/ci_build/all.log +4 -4
- package/.rush/temp/operation/ci_build/state.json +1 -1
- package/.rush/temp/operation/test_unit/all.log +4 -4
- package/.rush/temp/operation/test_unit/state.json +1 -1
- package/.rush/temp/shrinkwrap-deps.json +272 -327
- package/dist/LICENSE.txt +4 -4
- package/dist/quantity-selector.cjs.js +15 -15
- package/dist/quantity-selector.cjs.js.map +1 -1
- package/dist/quantity-selector.es.js +31 -31
- package/dist/quantity-selector.es.js.map +1 -1
- package/package.json +5 -5
|
@@ -244,7 +244,7 @@ const lt = /* @__PURE__ */ ot(st), ct = {
|
|
|
244
244
|
loading: e = !1,
|
|
245
245
|
negative: u = !1,
|
|
246
246
|
onClick: d,
|
|
247
|
-
size:
|
|
247
|
+
size: x = "md",
|
|
248
248
|
variant: f,
|
|
249
249
|
type: O = "button",
|
|
250
250
|
...w
|
|
@@ -255,7 +255,7 @@ const lt = /* @__PURE__ */ ot(st), ct = {
|
|
|
255
255
|
[
|
|
256
256
|
A,
|
|
257
257
|
`${A}--${u ? `${f}-negative` : f}`,
|
|
258
|
-
`${A}--${
|
|
258
|
+
`${A}--${x}`
|
|
259
259
|
],
|
|
260
260
|
{
|
|
261
261
|
[`${A}--icon-only`]: r,
|
|
@@ -264,8 +264,8 @@ const lt = /* @__PURE__ */ ot(st), ct = {
|
|
|
264
264
|
[`${A}--disabled`]: a || e
|
|
265
265
|
},
|
|
266
266
|
i
|
|
267
|
-
), $ = (
|
|
268
|
-
a || e ?
|
|
267
|
+
), $ = (v) => {
|
|
268
|
+
a || e ? v.preventDefault() : d && d(v);
|
|
269
269
|
}, m = !!w["aria-disabled"] || a || e;
|
|
270
270
|
return /* @__PURE__ */ N(
|
|
271
271
|
"button",
|
|
@@ -278,7 +278,7 @@ const lt = /* @__PURE__ */ ot(st), ct = {
|
|
|
278
278
|
onClick: $,
|
|
279
279
|
...w,
|
|
280
280
|
children: [
|
|
281
|
-
e && /* @__PURE__ */ o(pt, { size:
|
|
281
|
+
e && /* @__PURE__ */ o(pt, { size: x === tt.LG ? "xs" : "xxs", negative: u, disabled: m }),
|
|
282
282
|
" ",
|
|
283
283
|
t
|
|
284
284
|
]
|
|
@@ -326,7 +326,7 @@ var jr = { exports: {} };
|
|
|
326
326
|
})();
|
|
327
327
|
})(jr);
|
|
328
328
|
var gt = jr.exports;
|
|
329
|
-
const
|
|
329
|
+
const xt = /* @__PURE__ */ ft(gt), vt = {
|
|
330
330
|
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
331
331
|
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
332
332
|
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
|
@@ -339,7 +339,7 @@ const vt = /* @__PURE__ */ ft(gt), xt = {
|
|
|
339
339
|
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 24" fill="currentColor"><path fill-rule="evenodd" d="M14.268 3.5c-.77-1.333-2.694-1.333-3.464 0l-8.66 15c-.77 1.333.192 3 1.732 3h17.32c1.54 0 2.502-1.667 1.733-3l-8.66-15Zm-.694 5.067-.247 6.876h-1.566l-.247-6.876a1.03 1.03 0 1 1 2.06 0Zm.212 8.917c0 .649-.585 1.234-1.25 1.234-.648 0-1.25-.585-1.25-1.234 0-.633.602-1.234 1.25-1.234.665 0 1.25.601 1.25 1.234Z" clip-rule="evenodd"/></svg>',
|
|
340
340
|
keywords: ["error-filled"],
|
|
341
341
|
category: "status"
|
|
342
|
-
}, bt =
|
|
342
|
+
}, bt = xt.bind(vt), sr = "purpur-icon", yt = "md", ht = (t) => t.filter((i) => Object.keys(i).length >= 1).map((i) => `${i.name}="${i.value}"`).join(" "), wt = ({ content: t = "", title: i } = {}) => {
|
|
343
343
|
const n = [
|
|
344
344
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
345
345
|
{ name: "fill", value: "currentColor" },
|
|
@@ -914,20 +914,20 @@ const le = /* @__PURE__ */ oe(se), ce = {
|
|
|
914
914
|
errorText: e,
|
|
915
915
|
helperText: u,
|
|
916
916
|
label: d,
|
|
917
|
-
loading:
|
|
917
|
+
loading: x = !1,
|
|
918
918
|
onClear: f,
|
|
919
919
|
startAdornment: O,
|
|
920
920
|
valid: w = !1,
|
|
921
921
|
...s
|
|
922
922
|
}, y) => {
|
|
923
923
|
var $;
|
|
924
|
-
const m = Rr(),
|
|
924
|
+
const m = Rr(), v = s.id ?? m, l = (_) => t ? `${t}-${_}` : void 0, S = w && !e, C = u ? `${v}-helper-text` : void 0, b = [O].filter((_) => !!_), B = (typeof s.value == "number" ? s.value !== void 0 : ($ = s.value) == null ? void 0 : $.length) && !s.disabled && !s.readOnly && !x && f && n, D = _e(null), q = (_) => {
|
|
925
925
|
D.current = _, typeof y == "function" ? y(_) : y && (y.current = _);
|
|
926
926
|
}, M = () => {
|
|
927
927
|
var _;
|
|
928
928
|
f == null || f(), (_ = D.current) == null || _.focus();
|
|
929
929
|
}, I = [
|
|
930
|
-
|
|
930
|
+
x && /* @__PURE__ */ o(
|
|
931
931
|
pe,
|
|
932
932
|
{
|
|
933
933
|
disabled: s.disabled,
|
|
@@ -971,7 +971,7 @@ const le = /* @__PURE__ */ oe(se), ce = {
|
|
|
971
971
|
d && /* @__PURE__ */ o(
|
|
972
972
|
te,
|
|
973
973
|
{
|
|
974
|
-
htmlFor:
|
|
974
|
+
htmlFor: v,
|
|
975
975
|
className: j(`${c}__label`),
|
|
976
976
|
"data-testid": l("label"),
|
|
977
977
|
disabled: s.disabled,
|
|
@@ -993,7 +993,7 @@ const le = /* @__PURE__ */ oe(se), ce = {
|
|
|
993
993
|
"input",
|
|
994
994
|
{
|
|
995
995
|
...s,
|
|
996
|
-
id:
|
|
996
|
+
id: v,
|
|
997
997
|
ref: q,
|
|
998
998
|
"data-testid": l("input"),
|
|
999
999
|
"aria-describedby": s["aria-describedby"] || C,
|
|
@@ -1067,7 +1067,7 @@ var Lr = { exports: {} };
|
|
|
1067
1067
|
})();
|
|
1068
1068
|
})(Lr);
|
|
1069
1069
|
var ge = Lr.exports;
|
|
1070
|
-
const kr = /* @__PURE__ */ fe(ge),
|
|
1070
|
+
const kr = /* @__PURE__ */ fe(ge), xe = {
|
|
1071
1071
|
"purpur-quantity-selector": "_purpur-quantity-selector_lzxe3_1",
|
|
1072
1072
|
"purpur-quantity-selector--full-width": "_purpur-quantity-selector--full-width_lzxe3_21",
|
|
1073
1073
|
"purpur-quantity-selector--loading": "_purpur-quantity-selector--loading_lzxe3_27",
|
|
@@ -1078,7 +1078,7 @@ const kr = /* @__PURE__ */ fe(ge), ve = {
|
|
|
1078
1078
|
"purpur-quantity-selector__spinner": "_purpur-quantity-selector__spinner_lzxe3_46",
|
|
1079
1079
|
"purpur-quantity-selector__spinner--full-width": "_purpur-quantity-selector__spinner--full-width_lzxe3_53",
|
|
1080
1080
|
"purpur-quantity-selector__spinner--separated": "_purpur-quantity-selector__spinner--separated_lzxe3_57"
|
|
1081
|
-
},
|
|
1081
|
+
}, ve = {
|
|
1082
1082
|
SM: "sm",
|
|
1083
1083
|
MD: "md",
|
|
1084
1084
|
LG: "lg"
|
|
@@ -1123,7 +1123,7 @@ var Ir = { exports: {} };
|
|
|
1123
1123
|
})();
|
|
1124
1124
|
})(Ir);
|
|
1125
1125
|
var be = Ir.exports;
|
|
1126
|
-
const
|
|
1126
|
+
const xr = /* @__PURE__ */ me(be), ye = "_rotate_1xozj_1", he = "_dash_1xozj_1", H = {
|
|
1127
1127
|
"purpur-spinner": "_purpur-spinner_1xozj_1",
|
|
1128
1128
|
rotate: ye,
|
|
1129
1129
|
"purpur-spinner--xxs": "_purpur-spinner--xxs_1xozj_4",
|
|
@@ -1150,13 +1150,13 @@ const vr = /* @__PURE__ */ me(be), ye = "_rotate_1xozj_1", he = "_dash_1xozj_1",
|
|
|
1150
1150
|
}) => /* @__PURE__ */ o(
|
|
1151
1151
|
"div",
|
|
1152
1152
|
{
|
|
1153
|
-
className:
|
|
1153
|
+
className: xr([H[R], H[`${R}--${a}`]]),
|
|
1154
1154
|
"data-testid": t,
|
|
1155
1155
|
...p,
|
|
1156
1156
|
children: /* @__PURE__ */ o("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ o(
|
|
1157
1157
|
"circle",
|
|
1158
1158
|
{
|
|
1159
|
-
className:
|
|
1159
|
+
className: xr(H[`${R}__circle`], {
|
|
1160
1160
|
[H[`${R}__circle--disabled`]]: i,
|
|
1161
1161
|
[H[`${R}__circle--negative`]]: n
|
|
1162
1162
|
}),
|
|
@@ -1238,7 +1238,7 @@ const Ne = /* @__PURE__ */ je(Se), ze = {
|
|
|
1238
1238
|
loading: e = !1,
|
|
1239
1239
|
negative: u = !1,
|
|
1240
1240
|
onClick: d,
|
|
1241
|
-
size:
|
|
1241
|
+
size: x = "md",
|
|
1242
1242
|
variant: f,
|
|
1243
1243
|
type: O = "button",
|
|
1244
1244
|
...w
|
|
@@ -1249,7 +1249,7 @@ const Ne = /* @__PURE__ */ je(Se), ze = {
|
|
|
1249
1249
|
[
|
|
1250
1250
|
P,
|
|
1251
1251
|
`${P}--${u ? `${f}-negative` : f}`,
|
|
1252
|
-
`${P}--${
|
|
1252
|
+
`${P}--${x}`
|
|
1253
1253
|
],
|
|
1254
1254
|
{
|
|
1255
1255
|
[`${P}--icon-only`]: r,
|
|
@@ -1258,8 +1258,8 @@ const Ne = /* @__PURE__ */ je(Se), ze = {
|
|
|
1258
1258
|
[`${P}--disabled`]: a || e
|
|
1259
1259
|
},
|
|
1260
1260
|
i
|
|
1261
|
-
), $ = (
|
|
1262
|
-
a || e ?
|
|
1261
|
+
), $ = (v) => {
|
|
1262
|
+
a || e ? v.preventDefault() : d && d(v);
|
|
1263
1263
|
}, m = !!w["aria-disabled"] || a || e;
|
|
1264
1264
|
return /* @__PURE__ */ N(
|
|
1265
1265
|
"button",
|
|
@@ -1272,7 +1272,7 @@ const Ne = /* @__PURE__ */ je(Se), ze = {
|
|
|
1272
1272
|
onClick: $,
|
|
1273
1273
|
...w,
|
|
1274
1274
|
children: [
|
|
1275
|
-
e && /* @__PURE__ */ o($e, { size:
|
|
1275
|
+
e && /* @__PURE__ */ o($e, { size: x === ve.LG ? "xs" : "xxs", negative: u, disabled: m }),
|
|
1276
1276
|
" ",
|
|
1277
1277
|
t
|
|
1278
1278
|
]
|
|
@@ -1354,7 +1354,7 @@ const Vr = (t) => /* @__PURE__ */ o(
|
|
|
1354
1354
|
}
|
|
1355
1355
|
);
|
|
1356
1356
|
Vr.displayName = "IconPlus";
|
|
1357
|
-
const Le = Pe.bind(Ce),
|
|
1357
|
+
const Le = Pe.bind(Ce), vr = "purpur-icon", ke = "md", Ie = (t) => t.filter((i) => Object.keys(i).length >= 1).map((i) => `${i.name}="${i.value}"`).join(" "), Xe = ({ content: t = "", title: i } = {}) => {
|
|
1358
1358
|
const n = [
|
|
1359
1359
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
1360
1360
|
{ name: "fill", value: "currentColor" },
|
|
@@ -1373,7 +1373,7 @@ const Le = Pe.bind(Ce), xr = "purpur-icon", ke = "md", Ie = (t) => t.filter((i)
|
|
|
1373
1373
|
const e = Xe({
|
|
1374
1374
|
content: Fe(i.svg),
|
|
1375
1375
|
title: n
|
|
1376
|
-
}), u = Le(a,
|
|
1376
|
+
}), u = Le(a, vr, `${vr}--${p}`);
|
|
1377
1377
|
return /* @__PURE__ */ o(
|
|
1378
1378
|
"span",
|
|
1379
1379
|
{
|
|
@@ -1424,7 +1424,7 @@ const Ee = {
|
|
|
1424
1424
|
children: p === "increment" ? /* @__PURE__ */ o(Vr, { size: "xs" }) : /* @__PURE__ */ o(Zr, { size: "xs" })
|
|
1425
1425
|
}
|
|
1426
1426
|
);
|
|
1427
|
-
}, mr = kr.bind(
|
|
1427
|
+
}, mr = kr.bind(xe), Qe = ["attached", "separated"], Ue = ["primary", "secondary"], h = "purpur-quantity-selector", Ge = z(
|
|
1428
1428
|
({
|
|
1429
1429
|
["data-testid"]: t,
|
|
1430
1430
|
className: i,
|
|
@@ -1435,12 +1435,12 @@ const Ee = {
|
|
|
1435
1435
|
defaultValue: e,
|
|
1436
1436
|
fullWidth: u,
|
|
1437
1437
|
disabled: d,
|
|
1438
|
-
loading:
|
|
1438
|
+
loading: x,
|
|
1439
1439
|
minValue: f,
|
|
1440
1440
|
maxValue: O,
|
|
1441
1441
|
...w
|
|
1442
1442
|
}, s) => {
|
|
1443
|
-
const [y, $] = ar(e ?? 0), [m,
|
|
1443
|
+
const [y, $] = ar(e ?? 0), [m, v] = ar(y), l = r !== void 0, S = l ? r : m, C = (g) => t ? `${t}-${g}` : void 0, b = d || x, B = Math.max(f ?? 0, 0), D = O ?? Number.MAX_SAFE_INTEGER, q = S === D, M = S === B;
|
|
1444
1444
|
tr(() => {
|
|
1445
1445
|
l && $(r);
|
|
1446
1446
|
}, [r, l]), tr(() => {
|
|
@@ -1460,16 +1460,16 @@ const Ee = {
|
|
|
1460
1460
|
[`${h}--no-gap-disabled-right`]: n === "attached" && !b && !M && q,
|
|
1461
1461
|
[`${h}--no-gap-disabled`]: n === "attached" && (b || q && M),
|
|
1462
1462
|
[`${h}--full-width`]: u,
|
|
1463
|
-
[`${h}--loading`]:
|
|
1463
|
+
[`${h}--loading`]: x
|
|
1464
1464
|
}
|
|
1465
1465
|
]), W = (g) => {
|
|
1466
1466
|
if (!/^[0-9]*$/.test(g.target.value))
|
|
1467
1467
|
return;
|
|
1468
1468
|
const J = +g.target.value;
|
|
1469
|
-
J < B || J > D || (l ||
|
|
1469
|
+
J < B || J > D || (l || v(J), p(J));
|
|
1470
1470
|
}, _ = (g) => {
|
|
1471
1471
|
const L = g === "increment" ? S + 1 : S - 1;
|
|
1472
|
-
L < 0 || (l ||
|
|
1472
|
+
L < 0 || (l || v(L), p(L));
|
|
1473
1473
|
}, ir = (g) => {
|
|
1474
1474
|
const L = g === "increment" && q || g === "decrement" && M;
|
|
1475
1475
|
return /* @__PURE__ */ o(
|
|
@@ -1484,7 +1484,7 @@ const Ee = {
|
|
|
1484
1484
|
}
|
|
1485
1485
|
);
|
|
1486
1486
|
}, Gr = /* @__PURE__ */ N(Hr, { children: [
|
|
1487
|
-
|
|
1487
|
+
x && /* @__PURE__ */ o(
|
|
1488
1488
|
"div",
|
|
1489
1489
|
{
|
|
1490
1490
|
className: mr([
|