@spscommerce/ds-react 8.56.5 → 8.56.7
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.js +64 -21
- package/lib/index.umd.cjs +38 -2
- package/package.json +12 -12
package/lib/index.js
CHANGED
|
@@ -1034,34 +1034,37 @@ function an(e, t = []) {
|
|
|
1034
1034
|
var on = /* @__PURE__ */ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890".split("");
|
|
1035
1035
|
//#endregion
|
|
1036
1036
|
//#region src/option-list/useOptionListOptions.ts
|
|
1037
|
-
async function sn(e, t, n, r, i, a) {
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1037
|
+
async function sn(e, t, n, r, i, a, o) {
|
|
1038
|
+
if (!o()) return;
|
|
1039
|
+
let s = typeof e.options == "function" ? e.options(t.value) : e.options || [], c = s instanceof Promise, l = (e) => e.replace(/([.?*+^$[\]\\(){}|-])/g, "");
|
|
1040
|
+
n({ pending: c }), a.current = c ? s : null;
|
|
1041
|
+
let u = c ? await s || [] : s || [];
|
|
1042
|
+
if (!o() || c && a.current !== s) return;
|
|
1043
|
+
let d = Array.from(u).filter(Boolean).map((t) => new ae(t, typeof t == "function" ? {
|
|
1043
1044
|
textKey: "label",
|
|
1044
1045
|
captionKey: "caption"
|
|
1045
1046
|
} : {
|
|
1046
1047
|
textKey: e.textKey,
|
|
1047
1048
|
captionKey: e.captionKey
|
|
1048
1049
|
}));
|
|
1049
|
-
if (e.nullOption &&
|
|
1050
|
-
let r =
|
|
1051
|
-
n({ replacementPattern: RegExp(`(${r})`, "ig") }),
|
|
1052
|
-
let n = new RegExp(r, "i"), i =
|
|
1053
|
-
return e.filterByTextAndCaptionKey ? n.test(i) || n.test(
|
|
1050
|
+
if (e.nullOption && d.unshift(new ae(null, { text: e.nullOption })), t.value && !e.disableDefaultOptionsFiltering) {
|
|
1051
|
+
let r = l(t.value);
|
|
1052
|
+
n({ replacementPattern: RegExp(`(${r})`, "ig") }), d = d.filter((t) => {
|
|
1053
|
+
let n = new RegExp(r, "i"), i = l(t.text);
|
|
1054
|
+
return e.filterByTextAndCaptionKey ? n.test(i) || n.test(l(t.caption)) : n.test(i);
|
|
1054
1055
|
});
|
|
1055
1056
|
} else n({ replacementPattern: null });
|
|
1056
|
-
if (e.disabledOptions) for (let t of
|
|
1057
|
-
r(Object.freeze(
|
|
1057
|
+
if (e.disabledOptions) for (let t of d) e.disabledOptions.includes(t.value) && (t.disabled = !0);
|
|
1058
|
+
r(Object.freeze(d)), e.onOptionListChanged && e.onOptionListChanged(d.length), i(d.some((e) => e.value && !!e.value.icon)), n({ pending: !1 });
|
|
1058
1059
|
}
|
|
1059
1060
|
function cn(t, n, r) {
|
|
1060
1061
|
let [i, a] = e.useState(Object.freeze([])), [o, s] = e.useState(!1), c = e.useRef(null), l = e.useRef(t.options);
|
|
1061
1062
|
(typeof t.options != "function" || t.disableOptionsMemoization) && (l.current = t.options);
|
|
1062
|
-
let u = e.useMemo(() => typeof l.current == "function" ? h(sn, t.searchDebounce === void 0 ? 500 : t.searchDebounce) : sn, [l.current, t.disabledOptions]);
|
|
1063
|
-
return e.useEffect(() => {
|
|
1064
|
-
|
|
1063
|
+
let u = e.useMemo(() => typeof l.current == "function" ? h(sn, t.searchDebounce === void 0 ? 500 : t.searchDebounce) : sn, [l.current, t.disabledOptions]), d = e.useRef(!0);
|
|
1064
|
+
return e.useEffect(() => (d.current = !0, () => {
|
|
1065
|
+
d.current = !1, "reset" in u && u.reset?.();
|
|
1066
|
+
}), [u]), e.useEffect(() => {
|
|
1067
|
+
u(t, n, r, a, s, c, () => d.current);
|
|
1065
1068
|
}, [
|
|
1066
1069
|
l.current,
|
|
1067
1070
|
n.value,
|
|
@@ -12084,6 +12087,46 @@ var jm = {
|
|
|
12084
12087
|
</div>
|
|
12085
12088
|
)
|
|
12086
12089
|
}
|
|
12090
|
+
`
|
|
12091
|
+
},
|
|
12092
|
+
pendingSearch: {
|
|
12093
|
+
description: () => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("h4", null, "Pending Searches Stop When the Select Is Removed"), /* @__PURE__ */ t.createElement("p", null, "If the select is removed while a debounced search is still waiting, for example because it sits in a modal or tab that closes, that search never runs, so no late request is made for a select that is gone. Multi Selects and Autocompletes work the same way."), /* @__PURE__ */ t.createElement("p", null, "To see it here, open the select, type a few letters, then choose Hide Select within 2 seconds. The number of searches run does not change.")),
|
|
12094
|
+
react: f`
|
|
12095
|
+
import { SpsButton, SpsLabel, SpsSelect, useSpsForm } from "@spscommerce/ds-react";
|
|
12096
|
+
function DemoComponent() {
|
|
12097
|
+
const [showSelect, setShowSelect] = React.useState(true);
|
|
12098
|
+
const [searchCount, setSearchCount] = React.useState(0);
|
|
12099
|
+
|
|
12100
|
+
function colorSearch(search) {
|
|
12101
|
+
setSearchCount((count) => count + 1);
|
|
12102
|
+
return ["red", "orange", "yellow", "green", "blue", "indigo", "violet"].filter(s => new RegExp(search, "i").test(s));
|
|
12103
|
+
}
|
|
12104
|
+
|
|
12105
|
+
const { formMeta } = useSpsForm({
|
|
12106
|
+
color: ""
|
|
12107
|
+
});
|
|
12108
|
+
|
|
12109
|
+
return (
|
|
12110
|
+
<div className="sfg-row">
|
|
12111
|
+
<div className="sfg-col-4">
|
|
12112
|
+
<SpsButton onClick={() => setShowSelect(!showSelect)}>
|
|
12113
|
+
{showSelect ? "Hide Select" : "Show Select"}
|
|
12114
|
+
</SpsButton>
|
|
12115
|
+
<p className="mt-2">Searches run: {searchCount}</p>
|
|
12116
|
+
{showSelect && (
|
|
12117
|
+
<>
|
|
12118
|
+
<SpsLabel for={formMeta.fields.color}>Color</SpsLabel>
|
|
12119
|
+
<SpsSelect
|
|
12120
|
+
options={colorSearch}
|
|
12121
|
+
searchDebounce={2000}
|
|
12122
|
+
formMeta={formMeta.fields.color}
|
|
12123
|
+
/>
|
|
12124
|
+
</>
|
|
12125
|
+
)}
|
|
12126
|
+
</div>
|
|
12127
|
+
</div>
|
|
12128
|
+
)
|
|
12129
|
+
}
|
|
12087
12130
|
`
|
|
12088
12131
|
}
|
|
12089
12132
|
}
|
|
@@ -13234,8 +13277,8 @@ function sh(t) {
|
|
|
13234
13277
|
p.current && (p.current.removeEventListener("focus", e), p.current.removeEventListener("blur", t));
|
|
13235
13278
|
};
|
|
13236
13279
|
}), s && (s.onFocus = () => y(Z.VISIBLE), s.onBlur = () => y(Z.HIDDEN));
|
|
13237
|
-
let b = G(u || "sps-description-list__term", (c || s && s.isRequired()) && "sps-description-list__term--required", (i || h()) && "sps-description-list__term--error", r);
|
|
13238
|
-
function
|
|
13280
|
+
let b = G(u || "sps-description-list__term", (c || s && s.isRequired()) && "sps-description-list__term--required", (i || h()) && "sps-description-list__term--error", r), x = bn(g === pe.ERROR ? a : o), S = x != null && x !== !1 && x !== "";
|
|
13281
|
+
function C() {
|
|
13239
13282
|
y(v === Z.VISIBLE ? Z.HIDDEN : Z.VISIBLE);
|
|
13240
13283
|
}
|
|
13241
13284
|
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("dt", {
|
|
@@ -13244,14 +13287,14 @@ function sh(t) {
|
|
|
13244
13287
|
ref: f,
|
|
13245
13288
|
onMouseEnter: () => y(Z.VISIBLE),
|
|
13246
13289
|
onMouseLeave: () => y(Z.DELAYED_HIDDEN),
|
|
13247
|
-
onClick:
|
|
13290
|
+
onClick: C,
|
|
13248
13291
|
...d
|
|
13249
13292
|
}, n), /* @__PURE__ */ e.createElement(ah, {
|
|
13250
13293
|
kind: g,
|
|
13251
13294
|
for: f,
|
|
13252
13295
|
showOn: me.MANUAL,
|
|
13253
|
-
isShown: v
|
|
13254
|
-
},
|
|
13296
|
+
isShown: S ? v : Z.HIDDEN
|
|
13297
|
+
}, x));
|
|
13255
13298
|
}
|
|
13256
13299
|
Object.assign(sh, {
|
|
13257
13300
|
props: oh,
|
package/lib/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("react"),require("@spscommerce/utils"),require("moment-timezone"),require("@spscommerce/ds-shared"),require("@spscommerce/i18n"),require("react-dom"),require("@spscommerce/ds-colors"),require("@sps-woodland/illustrations")):typeof define==`function`&&define.amd?define([`exports`,`react`,`@spscommerce/utils`,`moment-timezone`,`@spscommerce/ds-shared`,`@spscommerce/i18n`,`react-dom`,`@spscommerce/ds-colors`,`@sps-woodland/illustrations`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.DSReact={},e.react,e.spscommerceUtils,e.momentTimezone,e.spscommerceDsShared,e.spscommerceI18n,e.reactDom,e.spscommerceDsColors,e.spsWoodlandIllustrations))})(this,function(e,t,n,r,i,a,o,s,c){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var l=Object.create,u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,p=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty,h=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),g=(e,t)=>{let n={};for(var r in e)u(n,r,{get:e[r],enumerable:!0});return t||u(n,Symbol.toStringTag,{value:`Module`}),n},_=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=f(t),a=0,o=i.length,s;a<o;a++)s=i[a],!m.call(e,s)&&s!==n&&u(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=d(t,s))||r.enumerable});return e},v=(e,t,n)=>(n=e==null?{}:l(p(e)),_(t||!e||!e.__esModule||!m.call(e,`default`)?u(n,`default`,{value:e,enumerable:!0}):n,e));let y=v(t,1);t=v(t),r=v(r,1),o=v(o);function b(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=b(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function x(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=b(e))&&(r&&(r+=` `),r+=t);return r}var S=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,C=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=S[n[e]&63];return t};function w(e){return(0,y.useRef)(e||C())}function T(e,t){let n=w(e),r=(0,y.useRef)(`${n.current}_ctrl`);return(0,y.useEffect)(()=>{t&&(t.id=r.current,t.update())},[t]),{wrapperId:n.current||void 0,controlId:r.current}}var E=v(h(((e,t)=>{function n(e){var t=!1;if(e!=null&&typeof e.toString!=`function`)try{t=!!(e+``)}catch{}return t}function r(e,t){return function(n){return e(t(n))}}var i=Function.prototype,a=Object.prototype,o=i.toString,s=a.hasOwnProperty,c=o.call(Object),l=a.toString,u=r(Object.getPrototypeOf,Object);function d(e){return!!e&&typeof e==`object`}function f(e){if(!d(e)||l.call(e)!=`[object Object]`||n(e))return!1;var t=u(e);if(t===null)return!0;var r=s.call(t,`constructor`)&&t.constructor;return typeof r==`function`&&r instanceof r&&o.call(r)==c}t.exports=f}))(),1),D=new Set,O=new Set,k=new Set,A=new Set;function j(e){D.has(e)||k.has(e)||A.has(e)||O.add(e)}function M(e){D.has(e)||k.has(e)||O.has(e)||A.add(e)}var N=r.default||r,P=`MM/DD/YYYY`,F=`MM/DD/YYYY hh:mm A`,I=`MM/DD/YYYY HH:mm`,L=`hh:mm A`,R=`HH:mm`,ee=/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/,z=Symbol(`Date Parse Error`);function B(e){return N.isMoment(e)?e.year()*1e4+(e.month()+1)*100+e.date():e.year*1e4+e.month*100+e.date}var V=Object.freeze({createFrom(e,t){if(!e)return null;if(typeof e==`string`){if(t){let n=N(e,t,!0);if(n.isValid())return Object.freeze({year:n.year(),month:n.month()+1,date:n.date()})}else{let t=ee.exec(e);if(t){let[,e,n,r]=t;return Object.freeze({year:Number(r),month:Number(e),date:Number(n)})}}return Object.freeze({[z]:!0,year:void 0,month:void 0,date:void 0})}return Object.freeze({year:e.year(),month:e.month()+1,date:e.date()})},createMomentFrom(e,t){if(!e)return null;let n=null;return n=typeof e==`string`?t?N(e,t,!0):N(e):N.isMoment(e)?e:V.toMoment(e),n!==null&&N.isMoment(n)&&n.isValid()?n:Object.freeze({[z]:!0,year:void 0,month:void 0,date:void 0})},getRangeSeparator(e){return e?.includes(`-`)?`/`:`-`},createRangeFrom(e,t){if(!e)return null;if(t){let n=V.getRangeSeparator(t),r=RegExp(`[^\\d]*${n}[^\\d]*`);return e.split(r).slice(0,2).map(e=>V.createFrom(e,t))}return e.split(/[^\d]*-[^\d]*/).slice(0,2).map(e=>V.createFrom(e))},isValid(e){return e?N.isMoment(e)?e.isValid():typeof e==`object`&&typeof e.year==`number`&&typeof e.month==`number`&&typeof e.date==`number`&&V.toMoment(e)?.isValid():!1},nullifyInvalidDate(e){return V.isValid(e)?e:null},toMoment(e){return e?N.isMoment(e)?e:N({...e,month:e.month-1}):null},toString(e,t){let n=V.toMoment(e);return n&&n.isValid()?n.format(t||`MM/DD/YYYY`):``},toStringRange(e,t){if(!e)return``;let n=V.getRangeSeparator(t);return e.slice(0,2).map(e=>V.toString(e,t)).join(n)},toDateTimeString(e,t=!1,n){return e&&N.isMoment(e)&&e.isValid()?n?t?e.format(`${n} ${R}`):e.format(`${n} ${L}`):t?e.format(I):e.format(F):``},toDateTimeStringRange(e,t=!1,n){if(!e)return``;let r=V.getRangeSeparator(n);return e.map(e=>V.toDateTimeString(e,t,n)).join(r)},create(){let e=new Date;return Object.freeze({year:e.getFullYear(),month:e.getMonth()+1,date:e.getDate()})},isSameDate(e,t){return e&&t&&e.year===t.year&&e.month===t.month&&e.date===t.date},isSameMonth(e,t){return e&&t&&e.year===t.year&&e.month===t.month},isAfter(e,t){return!e||!t?null:B(e)>B(t)},isBefore(e,t){return!e||!t?null:B(e)<B(t)},isInRange(e,t,n=!0){if(!e||!t||!t[0]||!t[1])return null;let r=B(e),[i,a]=t.map(B);return i&&a&&(n&&r>=i&&r<=a||!n&&r>i&&r<a)},prevMonth(e){return Object.freeze({year:e.month===1?e.year-1:e.year,month:e.month-1||12,date:e.date})},nextMonth(e){return Object.freeze({year:e.month===12?e.year+1:e.year,month:e.month+1>12?1:e.month+1,date:e.date})},createRangeFromPreset(e,t){if(typeof e.definition==`function`)return e.definition();let n=N(),r=n.clone().subtract(N.duration(e.definition));return[V.createFrom(r,t),V.createFrom(n,t)]},createDateTimeRangeFromPreset(e){return typeof e.definition==`function`?e.definition():[N().subtract(N.duration(e.definition)).startOf(`day`),N().endOf(`day`)]},splitMomentInDateTimeParts(e,t=!1,n,r=!1){let i=``;i=t?r?`23:59`:`00:00`:r?`11:59`:`12:00`;let a=r?`PM`:`AM`;return e&&N.isMoment(e)&&e.isValid()?V.toDateTimeString(e,t,n).split(` `):[``,i,t?void 0:a]},getCurrentMoment(){return N()},validateTimeString(e,t=!1){if(!e)return!0;let n=e.split(`:`),r=n[0]||`0`,i=n[1]||`0`,a=Number.isNaN(Number(r))?NaN:parseInt(r,10),o=Number.isNaN(Number(i))?NaN:parseInt(i,10),s=n.length<=2&&r.length<=2&&i.length<=2;return t?s&&a>=0&&a<=23&&o>=0&&o<=59:s&&(!Number.isNaN(a)&&r.length===1||a>=1)&&a<=12&&o>=0&&o<=59},padIncompleteTimeString(e,t=!1){if(!e)return``;let n=e.split(`:`),r=parseInt(n[0]||`0`,10),i=parseInt(n[1]||`0`,10);return t?`${r<10?`0${r}`:`${r}`}:${i<10?`0${i}`:`${i}`}`:`${r===0?`12`:r<10?`0${r}`:`${r}`}:${i<10?`0${i}`:`${i}`}`}}),te=[`01:00`,`02:00`,`03:00`,`04:00`,`05:00`,`06:00`,`07:00`,`08:00`,`09:00`,`10:00`,`11:00`,`12:00`],ne=[`00:00`,`01:00`,`02:00`,`03:00`,`04:00`,`05:00`,`06:00`,`07:00`,`08:00`,`09:00`,`10:00`,`11:00`,`12:00`,`13:00`,`14:00`,`15:00`,`16:00`,`17:00`,`18:00`,`19:00`,`20:00`,`21:00`,`22:00`,`23:00`],re=g({date:()=>W,dateConstraint:()=>K,dateRange:()=>G,setDateFormat:()=>U}),H=P;function U(e){H=e}var W=function(e){if(Array.isArray(e)){let t=W(e[0]),n=W(e[1]);return t||n}if(e&&e.hasOwnProperty(`year`)){if(e[z])return{dateFormat:H};if(!V.isValid(e))return{dateValidity:!0}}return null};D.add(`dateFormat`),D.add(`dateValidity`);var G=function(e){if(Array.isArray(e)){let t=W(e);if(t)return t;if(e&&V.isBefore(e[1],e[0]))return{dateRangeOrder:!0}}return null};D.add(`dateRangeOrder`);var K=function({minDate:e,maxDate:t}){function n(n){let r=V.isBefore(n,e),i=V.isAfter(n,t),a={minExceeded:r?V.toString(e,H):null,maxExceeded:i?V.toString(t,H):null};return r||i?{dateConstraint:a}:null}return function(e){if(!e)return null;if(Array.isArray(e)){let t=n(e[0]),r=n(e[1]);return t||r}return e.hasOwnProperty(`year`)?n(e):null}};D.add(`dateConstraint`);function ie(e,t){for(let n of[].concat(e)){let e=t(n);if(e)return e}return null}var ae=function(e){function t(t){return Number(t)>=e?null:{min:e}}return e=>ie(e,t)};D.add(`min`);var oe=function(e){function t(t){return Number(t)<=e?null:{max:e}}return e=>ie(e,t)};O.add(`max`);var se=function(e){return e==null||e===``||Number.isNaN(e)||e?.length===0?{required:!0}:null};O.add(`required`);var ce=function(e){function t(t){return t===void 0||t.toString().length<e?{minLength:e}:null}return e=>ie(e,t)};D.add(`minLength`);var le=function(e){function t(t){return t==null||Array.isArray(t)&&t.length<e?{minLengthArray:e}:null}return e=>t(e)};D.add(`minLengthArray`);var ue=function(e){function t(t){return t===void 0||t.toString().length<=e?null:{maxLength:e}}return e=>ie(e,t)};k.add(`maxLength`);var de=function(e){function t(t){return t==null||Array.isArray(t)&&t.length<=e?null:{maxLengthArray:e}}return e=>t(e)};D.add(`maxLengthArray`);var fe=function(e){let t=e instanceof RegExp?e:new RegExp(e);function n(n){return t.test(n)?null:{pattern:e}}return e=>ie(e,n)};D.add(`pattern`);var pe=function(e){function t(e){return/^\p{L}*$/u.test(e)?null:{alpha:!0}}return ie(e,t)};k.add(`alpha`);var me=function(e){function t(e){return/^[0-9,. ]*$/.test(e)?null:{numeric:!0}}return ie(e,t)};k.add(`numeric`);var he=function(e){function t(e){return/^-?[0-9,. ]*$/.test(e)?null:{positiveOrNegativeNumber:!0}}return ie(e,t)};k.add(`positiveOrNegativeNumber`);var ge=function(e){function t(e){return/^[^0-9]*$/.test(e)?null:{nonNumeric:!0}}return ie(e,t)};k.add(`nonNumeric`);var _e=Object.freeze({...re,min:ae,max:oe,required:se,minLength:ce,minLengthArray:le,maxLength:ue,maxLengthArray:de,pattern:fe,alpha:pe,numeric:me,nonNumeric:ge,positiveOrNegativeNumber:he,OnBlurErrorKeys:D});function ve(e,t=[]){let n=t.reduce((t,n)=>Object.assign(t,n(e)||{}),{});return Object.keys(n).length?n:null}var ye=function(e){return e[e.ON_CHANGE=0]=`ON_CHANGE`,e[e.ON_BLUR=1]=`ON_BLUR`,e[e.ON_SUBMIT=2]=`ON_SUBMIT`,e}({});function be(e,t={},n=[]){for(let[e,n]of Object.entries(t))n===0?j(e):n===2&&M(e);return y.useCallback(e,n)}var xe=class{#e;#t;#n;constructor(e,t){this.path=e,this.update=t,this.validators=[],this.#e=null,this.#t=null,this.#n=null,this.preventativeErrors=[],this.submitted=!1}get errors(){return this.#e===null&&this.#t===null&&this.#n===null?null:{...this.#e??{},...this.#t??{},...this.#n??{}}}setValidators(e){return this.update(this.path,null,void 0,e),this}validate(e,t,n=!1){if(this.validators&&this.validators.length>0){let r=ve(e,this.validators),i={onSubmit:{},onChange:{},onBlur:{}};r&&(i=Object.keys(r).reduce((e,t)=>(A.has(t)?e.onSubmit[t]=r[t]:O.has(t)?e.onChange[t]=r[t]:e.onBlur[t]=r[t],e),i)),(t===void 0||t===ye.ON_CHANGE)&&(this.#t=Object.keys(i.onChange).length===0?null:i.onChange),(t===void 0||t===ye.ON_BLUR)&&(this.#n=Object.keys(i.onBlur).length===0?null:i.onBlur),(t===void 0||t===ye.ON_SUBMIT)&&(this.#e=Object.keys(i.onSubmit).length===0?null:i.onSubmit,this.#t=Object.keys(i.onChange).length===0?null:i.onChange,this.#n=Object.keys(i.onBlur).length===0?null:i.onBlur),n||this.update(),this.isFocused()&&this.onFocus&&this.onFocus()}else this.errors&&(this.#e=null,this.#n=null,this.#t=null,n||this.update());return this}isValid(){return!this.errors||this.isPristine()}hasErrors(){return!!this.errors}isVisibilyInvalid(){return!this.isValid()}hasError(e){return this.errors&&Object.prototype.hasOwnProperty.call(this.errors,e)}hasPreventativeError(e){return this.preventativeErrors.includes(e)}hasPreventativeErrors(){return this.preventativeErrors.length>0}isRequired(){return this.validators&&this.validators.includes(_e.required)}isSubmitted(){return this.submitted}onFocus(){}onBlur(){}},Se=class extends xe{constructor(...e){super(...e),this.id=C(),this.focused=!1,this.pristine=!0}setValue(e){if(this.preventativeErrors=[],this.validators&&this.validators.length>0){let t=ve(e,this.validators);if(t&&Object.keys(t).filter(e=>k.has(e)).length>0){this.preventativeErrors=Object.keys(t);return}}this.update(this.path,e)}isPristine(){return this.pristine}markAsPristine(){return this.pristine=!0,this.update(),this}markAsDirty(){return this.pristine=!1,this.update(),this}isFocused(){return this.focused}markAsFocused(){return this.focused=!0,this.update(),this.onFocus&&this.onFocus(),this}markAsBlurred(){return this.update(this.path,null,!0),this.onBlur&&this.onBlur(),this.preventativeErrors=[],this}markAsSubmitted(){return this.submitted=!0,this.update(this.path,null,!1,void 0,!0),this}},Ce=class extends Se{constructor(e,t,n){super(n?t:e,n||t),n&&this.inferMembers(e)}isFocused(){return super.isFocused()||this.rollup(`isFocused`)}isValid(){return super.isValid()&&this.rollup(`isValid`)}hasErrors(){return super.hasErrors()||Object.keys(this.fields).some(e=>this.fields[e].hasErrors())}contentsAreValid(){return this.rollup(`isValid`)&&this.rollup(`contentsAreValid`)}isPristine(){return super.isPristine()&&this.rollup(`isPristine`)}markAsPristine(){super.markAsPristine();for(let e of Object.keys(this.fields))this.fields[e].markAsPristine();return this}markAsDirty(){super.markAsDirty();for(let e of Object.keys(this.fields))this.fields[e].markAsDirty();return this}markAsBlurred(){super.markAsBlurred();for(let e of Object.keys(this.fields))this.fields[e].markAsBlurred();return this}markAsSubmitted(){super.markAsSubmitted();for(let e of Object.keys(this.fields))this.fields[e].markAsSubmitted();return this}inferSpsControl(e,t){return Ee(e,[...this.path,t],this.update)}rollup(e){return Object.keys(this.fields).reduce((t,n)=>t&&(!this.fields[n][e]||this.fields[n][e]()),!0)}},we=class extends Ce{inferMembers(e){this.fields={};for(let t of Object.keys(e))this.fields[t]=this.inferSpsControl(e[t],t)}},Te=class extends Ce{inferMembers(e){this.fields=e.map((e,t)=>this.inferSpsControl(e,String(t)))}};function Ee(e,t,n){return e instanceof xe?(e.path=t,e.update=n,e):Array.isArray(e)?new Te(e,t,n):(0,E.default)(e)?new we(e,t,n):new Se(t,n)}function De(e,t){return t.length===0||!e?e:De(e.fields[t[0]],t.slice(1,t.length))}function Oe(e,t){if(t.length===0||!e)return[e];let n=t[0];if(t=t.slice(1,t.length),n===`*`){let n=Array.isArray(e.fields)?e.fields:Object.keys(e.fields).map(t=>e.fields[t]);return t.length===0?n:n.reduce((e,n)=>[...e,...Oe(n,t)],[])}return Oe(e.fields[n],t)}function ke(e,t,n){for(let r of Object.keys(t)){let i=t[r];for(let t of Oe(e,r.split(`.`)))t&&i&&n(t,i)}}function Ae(e,t,r,i=!1,a=!1){ke(t,r,(t,r)=>{t.validators=typeof r==`function`?r(e):r,i&&t.validate((0,n.getPath)(e,t.path),void 0,a)})}function je(e,t){let n=t[0];return t=t.slice(1),Array.isArray(e)?e.map((e,r)=>r===Number(n)?je(e,t):e):(0,E.default)(e)?Object.keys(e).reduce((r,i)=>Object.assign(r,{[i]:i===n?je(e[i],t):e[i]}),{}):e}function Me(e){if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`The initial value of useSpsForm() hook must be an object.`)}function Ne(e,t={}){Me(e);let[,r]=(0,y.useState)({}),i=(0,y.useRef)(!1);i.current=!1;let a=(0,y.useRef)(t),o=(0,y.useCallback)(e=>{let o=f.current,s;if(e){if(e.path){if(e.markAsBlurred){let t=De(o.formMeta,e.path);if(t){t.focused=!1;let r=(0,n.getPath)(o.formValue,e.path);t.validate(r,ye.ON_BLUR)}}else if(e.newValidators){if(a.current){let t=e.path.join(`.`);a.current={...a.current,[t]:e.newValidators},Ae(o.formValue,o.formMeta,a.current,!0)}}else if(e.markAsSubmitted){let t=De(o.formMeta,e.path);if(t){t.submitted=!0;let r=(0,n.getPath)(o.formValue,e.path);t.validate(r,ye.ON_SUBMIT)}}else s=je(o.formValue,e.path),(0,n.setPath)(s,e.path,e.value)}else s=e.value}if(e?.updateFormOptions?.validators&&(a.current={...a.current,...e.updateFormOptions.validators},Ae(o.formValue,o.formMeta,a.current,e.updateFormOptions?.runValidators??!0)),s){o.formMeta.submitted=!1,(0,n.deepFreeze)(s);let e=(0,n.diff)(o.formValue,s);for(let{type:t,key:r,parentPath:i,objects:[,a]}of e){let e=De(o.formMeta,i);if(typeof r!=`symbol`&&e){let o;switch(t){case n.DiffChange.ADDITION:e.fields[r]=Ee(a[r],[...i,r],c);break;case n.DiffChange.DELETION:Array.isArray(e.fields)?e.fields[r]=void 0:delete e.fields[r];break;case n.DiffChange.ALTERATION:o=Ee(a[r],[...i,r],c),(o instanceof Ce&&!(e.fields[r]instanceof Ce)||!(o instanceof Ce)&&e.fields[r]instanceof Ce)&&(o.pristine=!1,e.fields[r]=o)}}}let r=new Set;if(e.filter(e=>e.type===n.DiffChange.DELETION).reduce((e,t)=>(e.has(t.parentPath)||e.add(t.parentPath),e),r),Array.from(r).forEach(e=>{let t=De(o.formMeta,e);Array.isArray(t.fields)&&(t.fields=t.fields.filter(e=>e!==void 0))}),a.current){Ae(s,o.formMeta,a.current);let r=new Set;t&&ke(o.formMeta,t,(e,t)=>{typeof t==`function`&&(e.validate((0,n.getPath)(s,e.path)),r.add(e))});for(let{type:t,key:i,parentPath:a,objects:[,c]}of e)if(typeof i!=`symbol`){let e=o.formMeta,l=s;if(e){for(let t of a)e=e.fields[t],l=l[t],r.has(e)||e.validate(l,ye.ON_CHANGE);if(t===n.DiffChange.ADDITION||t===n.DiffChange.ALTERATION){let a=e.fields[i];if(!r.has(a)&&(e.fields[i].validate(c[i],ye.ON_CHANGE),t===n.DiffChange.ADDITION&&a.fields))for(let[e,t]of Object.entries(a.fields))t.validate(c[i][e],ye.ON_CHANGE)}}}}}f.current={...o,formValue:s||o.formValue},i.current||r({})},[]),s=(0,y.useCallback)((e,t)=>{e||t?o({value:e,updateFormOptions:t}):o()},[o]),c=(0,y.useCallback)((e,t,n=!1,r,i=!1)=>{e?o({path:e,value:t,markAsBlurred:n,newValidators:r,markAsSubmitted:i}):s()},[o,s]),l=(0,y.useMemo)(()=>{(0,n.deepFreeze)(e);let r=Ee(e,[],c);return t&&Ae(e,r,t,!1,!0),r},[]),u=(0,y.useCallback)(()=>(f.current.formMeta.markAsDirty(),a.current&&ke(f.current.formMeta,a.current,(e,t)=>{(typeof t==`function`||Array.isArray(t))&&e.validate((0,n.getPath)(f.current.formValue,e.path))}),f.current.formMeta.isValid()),[]),d=(0,y.useCallback)(()=>f.current.formValue,[]),f=(0,y.useRef)({formValue:e,formMeta:l,updateForm:s,validateForm:u,getCurrentFormValue:d});return f.current}var Pe=y.forwardRef((e,t)=>{let{className:n,children:r,focusInputOnClick:i,formControl:a,formMeta:o,inputRef:s,onClick:c,...l}=e,u=y.useRef(),d=s||t||u;function f(){d&&d!==t&&d.current&&d.current.focus()}function p(){d&&d!==t&&d.current&&o&&o instanceof Se&&o.markAsFocused()}function m(){d&&d!==t&&d.current&&o&&o instanceof Se&&o.markAsBlurred()}let h=x(`sps-form-group`,(a&&a.isRequired()||o&&o.isRequired())&&`sps-form-group--required`,(a&&!a.isValid()||o&&o.isVisibilyInvalid())&&`sps-form-group--error`,o&&o.hasPreventativeErrors()&&`sps-form-group--preventative-error`,n);function g(e){i&&f(),c&&c(e)}return y.useEffect(()=>{function e(e){e.target.classList.contains(`sps-form-control__clear-btn`)&&e.preventDefault()}return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),y.createElement(`div`,{...l,className:h,ref:t,tabIndex:-1,onClick:g,onFocus:p,onBlur:m},r)});Object.assign(Pe,{displayName:`SpsFormComponentWrapper`});var Fe=e=>typeof e==`object`&&!!e&&e.nodeType===1,Ie=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,Le=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return Ie(n.overflowY,t)||Ie(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},Re=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,ze=e=>e.parentElement??(e.getRootNode().host||null),Be=(e,t)=>{if(typeof document>`u`)return[];let{scrollMode:n,block:r,inline:i,boundary:a,skipOverflowHiddenElements:o}=t,s=typeof a==`function`?a:e=>e!==a;if(!Fe(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;Fe(u)&&s(u);){if(u=ze(u),u===c){l.push(u);break}u!=null&&u===document.body&&Le(u)&&!Le(document.documentElement)||u!=null&&Le(u,o)&&l.push(u)}let d=window.visualViewport?.width??innerWidth,f=window.visualViewport?.height??innerHeight,{scrollX:p,scrollY:m}=window,{height:h,width:g,top:_,right:v,bottom:y,left:b}=e.getBoundingClientRect(),{top:x,right:S,bottom:C,left:w}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),T=r===`start`||r===`nearest`?_-x:r===`end`?y+C:_+h/2-x+C,E=i===`center`?b+g/2-w+S:i===`end`?v+S:b-w,D=[];for(let e=0;e<l.length;e++){let t=l[e],{height:a,width:o,top:s,right:u,bottom:x,left:S}=t.getBoundingClientRect();if(n===`if-needed`&&_>=0&&b>=0&&y<=f&&v<=d&&(t===c&&!Le(t)||_>=s&&y<=x&&b>=S&&v<=u))return D;let C=getComputedStyle(t),w=parseInt(C.borderLeftWidth,10),O=parseInt(C.borderTopWidth,10),k=parseInt(C.borderRightWidth,10),A=parseInt(C.borderBottomWidth,10),j=0,M=0,N=`offsetWidth`in t?t.offsetWidth-t.clientWidth-w-k:0,P=`offsetHeight`in t?t.offsetHeight-t.clientHeight-O-A:0,F=`offsetWidth`in t?t.offsetWidth===0?0:o/t.offsetWidth:0,I=`offsetHeight`in t?t.offsetHeight===0?0:a/t.offsetHeight:0;if(c===t)j=r===`start`?T:r===`end`?T-f:r===`nearest`?Re(m,m+f,f,O,A,m+T,m+T+h,h):T-f/2,M=i===`start`?E:i===`center`?E-d/2:i===`end`?E-d:Re(p,p+d,d,w,k,p+E,p+E+g,g),j=Math.max(0,j+m),M=Math.max(0,M+p);else{j=r===`start`?T-s-O:r===`end`?T-x+A+P:r===`nearest`?Re(s,x,a,O,A+P,T,T+h,h):T-(s+a/2)+P/2,M=i===`start`?E-S-w:i===`center`?E-(S+o/2)+N/2:i===`end`?E-u+k+N:Re(S,u,o,w,k+N,E,E+g,g);let{scrollLeft:e,scrollTop:n}=t;j=I===0?0:Math.max(0,Math.min(n+j/I,t.scrollHeight-a/I+P)),M=F===0?0:Math.max(0,Math.min(e+M/F,t.scrollWidth-o/F+N)),T+=n-j,E+=e-M}D.push({el:t,top:j,left:M})}return D},Ve=g({default:()=>Ue}),He=e=>!1===e?{block:`end`,inline:`nearest`}:(e=>e===Object(e)&&Object.keys(e).length!==0)(e)?e:{block:`start`,inline:`nearest`};function Ue(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;let n=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>typeof e==`object`&&typeof e.behavior==`function`)(t))return t.behavior(Be(e,t));let r=typeof t==`boolean`||t==null?void 0:t.behavior;for(let{el:i,top:a,left:o}of Be(e,He(t))){let e=a-n.top+n.bottom,t=o-n.left+n.right;i.scroll({top:e,left:t,behavior:r})}}var We={alt:`string`,size:`SpinnerSize`,title:`string`};function Ge(e){let{alt:t,className:n,size:r=i.SpinnerSize.MEDIUM,"data-testid":o,title:s,unsafelyReplaceClassName:c,...l}=e,{t:u}=(0,a.useWoodlandLanguage)(),d=t||s||u(`spinner.defaultAltText`,{defaultValue:`Loading...`}),f=x(c||`sps-spinner`,`sps-spinner--${r}`,n);return y.createElement(`i`,{className:f,"data-testid":o,title:d,...l})}Object.assign(Ge,{props:We,displayName:`SpsSpinner`});var Ke=60;function qe(e){return e===void 0?`inherit`:`${e}px`}function Je(e){switch(e){case i.Position.TOP_LEFT:return i.Position.BOTTOM_LEFT;case i.Position.TOP_MIDDLE:return i.Position.BOTTOM_MIDDLE;case i.Position.TOP_RIGHT:return i.Position.BOTTOM_RIGHT;case i.Position.RIGHT_TOP:return i.Position.LEFT_TOP;case i.Position.RIGHT_MIDDLE:return i.Position.LEFT_MIDDLE;case i.Position.RIGHT_BOTTOM:return i.Position.LEFT_BOTTOM;case i.Position.BOTTOM_RIGHT:return i.Position.TOP_RIGHT;case i.Position.BOTTOM_MIDDLE:return i.Position.TOP_MIDDLE;case i.Position.BOTTOM_LEFT:return i.Position.TOP_LEFT;case i.Position.LEFT_BOTTOM:return i.Position.RIGHT_BOTTOM;case i.Position.LEFT_MIDDLE:return i.Position.RIGHT_MIDDLE;case i.Position.LEFT_TOP:return i.Position.RIGHT_TOP}}function Ye(e,t,n,r,i,a,o,s){let c=o&&o.current,l=c?c.scrollTop:window.pageYOffset,u=s?0:l,d=c?c.scrollLeft:window.pageXOffset,f=s?0:d,[p,m]=e.split(` `),h,g,_,v;switch(p){case`top`:_=t.height-n.top-u-a[0];break;case`left`:g=t.width-n.left-f-a[0];break;case`right`:v=n.right+f-a[0];break;case`bottom`:h=n.bottom+u-a[0];break;default:throw Error(`Invalid position ${e}`)}switch(m){case`left`:v=n.left+f+a[1];break;case`top`:h=n.top+u+a[1];break;case`middle`:p===`top`||p===`bottom`?v=n.left+f+n.width/2-i/2+a[1]:(p===`left`||p===`right`)&&(h=n.top+u+n.height/2-r.height/2+a[1]);break;case`bottom`:_=t.height-n.bottom-u+a[1];break;case`right`:g=t.width-n.right-f+a[1];break;default:throw Error(`Invalid position ${e}`)}return[h,g,_,v]}function Xe(e,t,n,{altPosition:r,setMinWidth:a=!1,setWidth:o=!1,parentElementRef:s,fixed:c=!1,offsets:l=[0,0],altOffsets:u=l}){if(e.current&&t.current){let d=e.current.getBoundingClientRect(),f=t.current.getBoundingClientRect(),p=Math.max(document.documentElement.clientHeight,window.innerHeight||0),m=document.documentElement.getBoundingClientRect().width,h=(s?.current??document.documentElement).getBoundingClientRect();c&&(h={x:0,y:0,width:m,height:p,top:0,left:0,bottom:p,right:m,toJSON(){return{width:m,height:p,top:0,left:0,bottom:p,right:m}}});let[g,_]=n.split(` `),v=n;if(r&&(g===`top`&&f.top-d.height<Ke||g===`right`&&f.right+d.width>m||g===`bottom`&&f.bottom+d.height>p||g===`left`&&f.left-d.width<0)&&(v=r),_===`left`&&f.left+d.width+(l?.[1]??0)>document.documentElement.getBoundingClientRect().right)switch(g){case`bottom`:v=i.Position.BOTTOM_RIGHT;break;case`top`:v=i.Position.TOP_RIGHT}let y=a?Math.max(f.width,d.width):d.width,b=o?f.width:y,[x,S,C,w]=Ye(v,h,f,d,b,v===r?u:l,s,c),T={top:qe(x),right:qe(S),bottom:qe(C),left:qe(w)};return c&&(T.position=`fixed`,T.zIndex=i.ZStratum.BAR),a&&(T.minWidth=`${f.width}px`),o&&(T.width=`${f.width}px`),[T,v===r]}return[{},!1]}var Ze=(0,y.createContext)(null);function Qe(e,t=[]){let n=(0,y.useContext)(Ze);return(0,y.useMemo)(()=>r=>{let i=n&&n.parentElementRef&&n.parentElementRef.current||document.body,a=null,s=i.lastElementChild;for(;s&&s!==i.firstElementChild;){if(s.hasAttribute(`data-portalid`)&&s.getAttribute(`data-portalid`)===e){a=s;break}s=s.previousElementSibling}if(a)i.contains(a)||i.appendChild(a);else{a=document.createElement(`div`),a.setAttribute(`data-portalid`,e),a.setAttribute(`data-react-aria-top-layer`,`true`);for(let e of t)a.classList.add(e);i.appendChild(a)}return(0,o.createPortal)(r,a)},[n])}var $e=`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890`.split(``);async function et(e,t,n,r,a,o){let s=typeof e.options==`function`?e.options(t.value):e.options||[],c=s instanceof Promise,l=e=>e.replace(/([.?*+^$[\]\\(){}|-])/g,``);n({pending:c}),o.current=c?s:null;let u=c?await s||[]:s||[];if(c&&o.current!==s)return;let d=Array.from(u).filter(Boolean).map(t=>new i.SpsOptionListOption(t,typeof t==`function`?{textKey:`label`,captionKey:`caption`}:{textKey:e.textKey,captionKey:e.captionKey}));if(e.nullOption&&d.unshift(new i.SpsOptionListOption(null,{text:e.nullOption})),t.value&&!e.disableDefaultOptionsFiltering){let r=l(t.value);n({replacementPattern:RegExp(`(${r})`,`ig`)}),d=d.filter(t=>{let n=new RegExp(r,`i`),i=l(t.text);return e.filterByTextAndCaptionKey?n.test(i)||n.test(l(t.caption)):n.test(i)})}else n({replacementPattern:null});if(e.disabledOptions)for(let t of d)e.disabledOptions.includes(t.value)&&(t.disabled=!0);r(Object.freeze(d)),e.onOptionListChanged&&e.onOptionListChanged(d.length),a(d.some(e=>e.value&&!!e.value.icon)),n({pending:!1})}function tt(e,t,r){let[i,a]=y.useState(Object.freeze([])),[o,s]=y.useState(!1),c=y.useRef(null),l=y.useRef(e.options);(typeof e.options!=`function`||e.disableOptionsMemoization)&&(l.current=e.options);let u=y.useMemo(()=>typeof l.current==`function`?(0,n.debounce)(et,e.searchDebounce===void 0?500:e.searchDebounce):et,[l.current,e.disabledOptions]);return y.useEffect(()=>{u(e,t,r,a,s,c)},[l.current,t.value,e.disabledOptions]),[i,o]}var nt=class{constructor(e,t){this.target=e,this.isPgStoppedInternal=!1,this.currentTarget=e,this.nativeEvent=new CustomEvent(`change`,t),Object.defineProperty(this.nativeEvent,"target",{value:e,writable:!1,configurable:!1,enumerable:!0})}get bubbles(){return this.nativeEvent.bubbles}get cancelable(){return this.nativeEvent.cancelable}get defaultPrevented(){return this.nativeEvent.defaultPrevented}get eventPhase(){return this.nativeEvent.eventPhase}get isTrusted(){return this.nativeEvent.isTrusted}get timeStamp(){return this.nativeEvent.timeStamp}get type(){return this.nativeEvent.type}preventDefault(){this.nativeEvent.preventDefault()}isDefaultPrevented(){return this.defaultPrevented}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPgStoppedInternal=!0}isPropagationStopped(){return this.isPgStoppedInternal}persist(){throw Error(`This is not a real React ChangeEvent. React does not permit the creation of SyntheticEvents in userland.`)}};function rt(e,t){return{...e,...t}}function it(e){return(0,y.useReducer)(rt,e)}function at({hideInlineSearch:e,showInlineSearch:t,options:n,onSearchChange:r,search:i=``,searchPlaceholder:o,searchInputRef:s}){let{t:c}=(0,a.useWoodlandLanguage)(),l=o??c(`select.searchPlaceholder`,{defaultValue:`Search…`}),[u,d]=it({isAsync:typeof n==`function`,pending:!1,value:i,replacementPattern:null}),f=y.useCallback(e=>{d({value:e.target.value}),r&&r(e)},[r]),p=y.useCallback(e=>{e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},[]),m=y.useCallback(e=>{e.nativeEvent.stopImmediatePropagation(),d({value:``}),r&&r(new nt({value:``})),s?.current&&s.current.focus()},[r,s]);return y.useEffect(()=>{d({value:i})},[i]),[(u.isAsync||t)&&!e?y.createElement(`div`,{className:`sps-option-list__search sps-form-group sps-text-input`},y.createElement(`div`,{className:`sps-form-control`},!u.value&&y.createElement(`i`,{className:`sps-icon sps-icon-filter sps-text-input__icon`}),y.createElement(`input`,{type:`text`,className:`sps-text-input__input`,placeholder:l,ref:s,value:u.value,onChange:f,onClick:p,onKeyDown:e=>{e&&([`Tab`,`Escape`,`Enter`,`Up`,`ArrowUp`,`Down`,`ArrowDown`].includes(e.key)||e.stopPropagation())}}),u.value&&y.createElement(`i`,{className:`sps-icon sps-icon-x-circle sps-form-control__clear-btn`,onClick:m}))):y.createElement(y.Fragment,null),u,d]}var ot=Ue||Ve,st=[`Tab`,`Escape`,`Enter`,`Up`,`ArrowUp`,`Down`,`ArrowDown`];function ct(e,t,n){return n?(e&&e[n])===(t&&t[n]):e===t}function lt(e,t,n){return typeof n.value==`function`&&n.disabled?!0:t?!!e?.find(e=>e[t]&&e[t]===n?.value?.[t]):!1}var ut=y.forwardRef((e,t)=>{let{captionKey:n,comparisonKey:r,disabledOptions:a,options:o,tall:s,textKey:c,valueKey:l,zeroState:u,hideInlineSearch:d,showInlineSearch:f,onSearchChange:p,search:m,searchDebounce:h,searchPlaceholder:g,onSpecialActionSelect:_,attachTo:v,className:b,conformWidth:S,id:C,ignoreWidthStyles:w,isOpen:T,keepOpen:E,keyDown:D,nullOption:O,onOptionListChanged:k,onOptionSelected:A,onPositionFlip:j,onSelfToggle:M,optionRole:N,positionOverride:P,selectedOption:F,specialAction:I,unsafelyReplaceClassName:L,loading:R,filterByTextAndCaptionKey:ee,maxHeightPx:z,maxHeightRem:B,disableOptionsMemoization:V,disableDefaultOptionsFiltering:te,"data-testid":ne,typeaheadEvent:re,...H}=e,U=y.useMemo(()=>I?new i.SpsOptionListOption(I,{textKey:`label`,captionKey:`caption`}):null,[I]),[W,G]=y.useState(-1),[K,ie]=y.useState(T),ae=t||y.useRef(null),oe=y.useRef(null),se=y.useRef(null),ce=Qe(`sps-option-list-portal`),le=y.useContext(Ze),[ue,de]=P||[i.Position.BOTTOM_LEFT,i.Position.TOP_LEFT],[[fe,pe],me]=y.useState([{},!1]),he=y.useRef(null),[ge,_e,ve]=at({...e,searchInputRef:he}),[ye,be]=tt(e,_e,ve);y.useEffect(()=>{re&&Ae(re)},[re]),y.useEffect(()=>{me(K?Xe(ae,v,ue,{altPosition:de,setMinWidth:!w,setWidth:!w&&S,...le}):[{},!1])},[K,ue,de,ye]),y.useEffect(()=>{let e;return K&&(e=()=>{K&&me(Xe(ae,v,ue,{altPosition:de,setMinWidth:!w,setWidth:!w&&S,...le}))},document.addEventListener(`scroll`,e)),()=>{e&&document.removeEventListener(`scroll`,e)}},[K]),y.useEffect(()=>{G(-1)},[_e]);let xe=x(L||`sps-option-list`,`z-stratum-dropdown`,K&&`sps-option-list--open`,_e.isAsync&&`sps-option-list--searchable`,pe&&`sps-option-list--opens-upward`,I&&I.label&&`sps-option-list--has-special-action`,b),Se=x(L||`sps-option-list__options`,s&&`sps-option-list__options--tall`),Ce=y.useCallback(()=>{K||(ie(!0),he.current&&he.current.focus(),G(-1),M&&M(!0))},[K,M]),we=y.useCallback(()=>{K&&(ie(!1),G(-1),M&&M(!1))},[K,M]),Te=y.useCallback((e,t)=>{t||e&&!e.disabled&&(typeof e.value==`function`?(e.value(),_&&_()):typeof A==`function`&&A(e.value),E||we())},[A,we]),Ee=y.useCallback((e,t,n)=>{e.stopPropagation(),Te(t,n)},[Te]),De=y.useRef(a||[]);De.current=a||[];let Oe=y.useCallback(e=>{switch(e.key){case`Tab`:case`Escape`:we();break;case`Enter`:if(W>-1){let t=ye[W]||U;e.preventDefault();let n=!!t&<(De.current,r||``,t);!n&&t&&typeof A==`function`&&typeof t.value==`function`?t.value():t&&Te(t,n)}break;case`Up`:case`ArrowUp`:{let t=W;pe?W<=-1?t=ye.length-1:W===0?I&&(t=ye.length):W<ye.length&&(t=W-1):W>-1&&(t=W-1),t!==W&&(e.preventDefault(),G(t));break}case`Down`:case`ArrowDown`:{Ce();let t=W;pe?W!==-1&&(t=W>=ye.length?0:W===ye.length-1?-1:W+1):W<ye.length-1+Number(!!I)&&(t=W+1),t!==W&&(e.preventDefault(),G(t));break}default:Ce()}},[we,Ce,W,Te,A,pe,ye]),ke=y.useCallback(e=>{Ce();let t=ye.findIndex(t=>{if(t.textKey){let n=t.textKey;return t.value[n].toLowerCase().charAt([0])===e.key.toLocaleLowerCase()}return t.value.toString().toLowerCase().charAt([0])===e.key.toLocaleLowerCase()});t>-1&&G(t)},[ye]),Ae=y.useCallback(e=>{e&&(st.includes(e.key)?Oe(e):$e.includes(e.key)&&!d&&ke(e))},[we,Ce,W,Te,A,pe,ye]);y.useEffect(()=>{if(le!==null&&document.getElementsByClassName(`sps-modal__body`).length>0){let e=()=>{M&&M(!1)},t=document.getElementsByClassName(`sps-modal__body`)[0];return t.addEventListener(`scroll`,e),()=>{t.removeEventListener(`scroll`,e)}}},[]),y.useEffect(()=>{K&&se.current&&ot(se.current,{scrollMode:`if-needed`,block:`nearest`,inline:`nearest`})},[W,K]),y.useEffect(()=>{ie(T),T?he.current&&he.current.focus():G(-1)},[T]),y.useEffect(()=>{D&&Ae(D)},[D]),y.useEffect(()=>{!K&&oe.current&&(p&&_e.value&&p(new nt({value:``})),ve({value:``}),oe.current.scrollTop=0),K&&j&&j(pe)},[K]);let je=z?z/16:B,Me=je?{maxHeight:`${je}rem`}:{};function Ne(e,t){return t?y.createElement(y.Fragment,null,e.split(t).map((e,n)=>t.test(e)?y.createElement(`u`,{key:n},e):y.createElement(y.Fragment,{key:n},e))):y.createElement(y.Fragment,null,e)}return ce(y.createElement(`div`,{className:xe,id:C,"aria-activedescendant":W>-1?`${C}-option-${W}`:``,tabIndex:-1,ref:ae,style:fe,onMouseLeave:()=>G(-1),"data-testid":ne,...H},ge,y.createElement(`div`,{className:Se,ref:oe,"data-testid":`${ne}-options`,style:Me},!R&&!_e.pending&&u&&ye.length===0&&y.createElement(`div`,{className:`sps-option-list__zero-state`},u),(R||_e.pending)&&y.createElement(`div`,{className:`sps-option-list__loading`},y.createElement(Ge,null)),!R&&!_e.pending&&ye.map((e,t)=>{let n=`${C}-option-${t}`,i=ct(e.value,F,r),a=lt(De.current,r||``,e);return y.createElement(`a`,{key:n,id:n,role:N,"aria-selected":i,href:e.href,className:x(`sps-option-list__option`,e.caption&&`sps-option-list__option--has-caption`,e.disabled&&`sps-option-list__option--disabled`,e.bold&&`sps-option-list__option--bold`,(i||a)&&`sps-option-list__option--selected`,W===t&&`sps-option-list__option--highlighted`),onClick:t=>Ee(t,e,a),onMouseOver:()=>G(t),tabIndex:-1,ref:W===t?se:null,"data-testid":`${ne}-option-${t}`},e.value&&e.value.icon&&y.createElement(`i`,{className:x(`sps-icon`,`sps-option-list__option-icon`,`sps-icon-${String(e.value.icon)}`)}),(!e.value||!e.value.icon&&be)&&y.createElement(`span`,{className:`sps-option-list__option-icon-spacer`}),y.createElement(`span`,null,Ne(e.text,_e.replacementPattern)),e.caption&&y.createElement(`div`,{className:`sps-option-list__option-caption`},y.createElement(`span`,null,Ne(e.caption,_e.replacementPattern))))})),U&&I?.label&&y.createElement(`a`,{className:x(`sps-option-list__option`,`sps-option-list__special-action`,W===ye.length&&`sps-option-list__option--highlighted`,I.disabled&&`sps-option-list__special-action--disabled`),href:U.href,target:U.href&&I.newTab?`_blank`:`_self`,onClick:e=>Ee(e,U),onMouseOver:()=>G(ye.length),"data-testid":`${ne}-special-action`},I.icon&&y.createElement(`i`,{className:x(`sps-icon`,`sps-option-list__option-icon`,`sps-icon-${String(I.icon)}`)}),!I.icon&&be&&y.createElement(`span`,{className:`sps-option-list__option-icon-spacer`}),y.createElement(`span`,null,I.label))))});Object.assign(ut,{displayName:`SpsOptionList`});function dt(e){return{key:e.key,preventDefault:()=>{}}}function ft(e,t,n=[]){return y.useMemo(()=>{function n(n){return y.createElement(e,{...n,...t},n.children)}return n},n)}function pt(e){return typeof e==`function`?e():e}var mt=function({children:e,elements:t}){if(t.length===0)return y.createElement(y.Fragment,null,e);let[n,r]=Array.isArray(t[0])?t[0]:[t[0]];return y.createElement(n,r??{},y.createElement(mt,{elements:t.slice(1)},e))},ht=function({children:e,providers:t=[],...n}){return y.createElement(`div`,n,y.createElement(mt,{elements:t},e))},gt=function({children:e,className:t,...n}){return y.createElement(ht,{className:`sps-app ${t}`,...n},e)};function _t(e,t){let{type:n,props:r={},custom:i}=t;return i?i(e.type):e.type===n&&Object.keys(r).every(t=>r[t]===e.props[t])}function vt(e=[],t=[]){let r=Array.isArray(e)?(0,n.flatten)(e):[e],i=t.map(e=>Array.isArray(e)?e:[e]),a=Array(i.length+1).fill(null).map(()=>[]);for(let e of r){let t=!1;for(let n=0;n<i.length;n+=1)for(let r of i[n])if(_t(e,r)){t=!0,a[n].push(e);break}t||a[a.length-1].push(e)}return a}function yt(e,t,n){let r=Object.entries(t).filter(([,e])=>typeof e!=`string`&&e.deprecated).map(([e])=>e),i=r.map(e=>n[e]);y.useEffect(()=>{i.find(e=>e!==void 0)&&console.warn(`The following prop(s) of ${e} are deprecated: ${r.join(`, `)}`)},i)}function bt(e,t){let n=(0,y.useRef)(!1);(0,y.useEffect)(()=>()=>{n.current=!1},[]),(0,y.useEffect)(()=>{if(n.current)return e();n.current=!0},t)}function xt(e,t,n){let r=y.useRef(t(...n));y.useEffect(()=>(document.addEventListener(e,r.current,{capture:!0}),()=>document.removeEventListener(e,r.current)),[]),y.useEffect(()=>{document.removeEventListener(e,r.current),r.current=t(...n),document.addEventListener(e,r.current,{capture:!0})},n)}function St(e,t,n){return function(r){!e.current?.contains(r.target)&&!t.current?.contains(r.target)&&n()}}function Ct(e,t,n){let r=y.useRef(!1),[i,a]=y.useState(!1),o=y.useCallback(()=>{r.current?r.current=!1:a(!0)},[]),s=y.useCallback((e=!1)=>{a(!1),r.current=e,n&&n()},[]);return xt(`mousedown`,St,[e,t,s]),xt(`pointerdown`,St,[e,t,s]),{showPopup:i,doShowPopup:o,doHidePopup:s}}var wt=e=>{let t=/(auto|scroll)/,n=(e,t)=>e.parentNode===null?t:n(e.parentNode,t.concat([e])),r=(e,t)=>getComputedStyle(e,null).getPropertyValue(t),i=e=>r(e,`overflow`)+r(e,`overflow-y`),a=e=>t.test(i(e));return(e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return;let t=n(e.parentNode,[]);for(let e=0;e<t.length;e+=1)if(a(t[e]))return t[e];return null})(e)},Tt=0,Et=null,Dt=null;function Ot({isOpen:e,rootRef:t}){y.useLayoutEffect(()=>{let n=!1;if(e&&t.current&&(n=!0,Tt+=1,Tt===1)){let e=wt(t.current)||document.body;Et=e;let n=e===document.body?window.innerWidth-document.documentElement.clientWidth:e.offsetWidth-e.clientWidth;e.style.overflow=`hidden`;let r=window.getComputedStyle(e).paddingRight;if(e.style.paddingRight=r&&r!==`0px`?`calc(${r} + ${n}px)`:`${n}px`,e===document.body){let e=document.getElementsByClassName(`sps-navbar-container`).item(0);if(e&&window.getComputedStyle(e).position===`fixed`){let t=window.getComputedStyle(e).paddingRight;e.style.paddingRight=t&&t!==`0px`?`calc(${t} + ${n}px)`:`${n}px`,Dt=e}else if(e=document.getElementsByTagName(`nav`).item(0)?.parentElement??null,e&&window.getComputedStyle(e).position===`fixed`){let t=window.getComputedStyle(e).paddingRight;e.style.paddingRight=t&&t!==`0px`?`calc(${t} + ${n}px)`:`${n}px`,Dt=e}}}return()=>{n&&(--Tt,Tt===0&&Et&&(Et.style.overflow=``,Et.style.paddingRight=``,Dt&&=(Dt.style.paddingRight=``,null),Et=null))}},[e])}var kt={debounce:`number`,disabled:`boolean`,conformWidth:`boolean`,formMeta:`SpsFormFieldMeta<string>`,icon:`SpsIcon`,onChange:`React.ChangeEventHandler`,onSelectionChange:`(newValue: string) => void`,placeholder:`string`,suggestions:{type:`
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("react"),require("@spscommerce/utils"),require("moment-timezone"),require("@spscommerce/ds-shared"),require("@spscommerce/i18n"),require("react-dom"),require("@spscommerce/ds-colors"),require("@sps-woodland/illustrations")):typeof define==`function`&&define.amd?define([`exports`,`react`,`@spscommerce/utils`,`moment-timezone`,`@spscommerce/ds-shared`,`@spscommerce/i18n`,`react-dom`,`@spscommerce/ds-colors`,`@sps-woodland/illustrations`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.DSReact={},e.react,e.spscommerceUtils,e.momentTimezone,e.spscommerceDsShared,e.spscommerceI18n,e.reactDom,e.spscommerceDsColors,e.spsWoodlandIllustrations))})(this,function(e,t,n,r,i,a,o,s,c){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var l=Object.create,u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,p=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty,h=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),g=(e,t)=>{let n={};for(var r in e)u(n,r,{get:e[r],enumerable:!0});return t||u(n,Symbol.toStringTag,{value:`Module`}),n},_=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=f(t),a=0,o=i.length,s;a<o;a++)s=i[a],!m.call(e,s)&&s!==n&&u(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=d(t,s))||r.enumerable});return e},v=(e,t,n)=>(n=e==null?{}:l(p(e)),_(t||!e||!e.__esModule||!m.call(e,`default`)?u(n,`default`,{value:e,enumerable:!0}):n,e));let y=v(t,1);t=v(t),r=v(r,1),o=v(o);function b(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=b(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function x(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=b(e))&&(r&&(r+=` `),r+=t);return r}var S=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,C=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=S[n[e]&63];return t};function w(e){return(0,y.useRef)(e||C())}function T(e,t){let n=w(e),r=(0,y.useRef)(`${n.current}_ctrl`);return(0,y.useEffect)(()=>{t&&(t.id=r.current,t.update())},[t]),{wrapperId:n.current||void 0,controlId:r.current}}var E=v(h(((e,t)=>{function n(e){var t=!1;if(e!=null&&typeof e.toString!=`function`)try{t=!!(e+``)}catch{}return t}function r(e,t){return function(n){return e(t(n))}}var i=Function.prototype,a=Object.prototype,o=i.toString,s=a.hasOwnProperty,c=o.call(Object),l=a.toString,u=r(Object.getPrototypeOf,Object);function d(e){return!!e&&typeof e==`object`}function f(e){if(!d(e)||l.call(e)!=`[object Object]`||n(e))return!1;var t=u(e);if(t===null)return!0;var r=s.call(t,`constructor`)&&t.constructor;return typeof r==`function`&&r instanceof r&&o.call(r)==c}t.exports=f}))(),1),D=new Set,O=new Set,k=new Set,A=new Set;function j(e){D.has(e)||k.has(e)||A.has(e)||O.add(e)}function M(e){D.has(e)||k.has(e)||O.has(e)||A.add(e)}var N=r.default||r,P=`MM/DD/YYYY`,F=`MM/DD/YYYY hh:mm A`,I=`MM/DD/YYYY HH:mm`,L=`hh:mm A`,R=`HH:mm`,ee=/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/,z=Symbol(`Date Parse Error`);function B(e){return N.isMoment(e)?e.year()*1e4+(e.month()+1)*100+e.date():e.year*1e4+e.month*100+e.date}var V=Object.freeze({createFrom(e,t){if(!e)return null;if(typeof e==`string`){if(t){let n=N(e,t,!0);if(n.isValid())return Object.freeze({year:n.year(),month:n.month()+1,date:n.date()})}else{let t=ee.exec(e);if(t){let[,e,n,r]=t;return Object.freeze({year:Number(r),month:Number(e),date:Number(n)})}}return Object.freeze({[z]:!0,year:void 0,month:void 0,date:void 0})}return Object.freeze({year:e.year(),month:e.month()+1,date:e.date()})},createMomentFrom(e,t){if(!e)return null;let n=null;return n=typeof e==`string`?t?N(e,t,!0):N(e):N.isMoment(e)?e:V.toMoment(e),n!==null&&N.isMoment(n)&&n.isValid()?n:Object.freeze({[z]:!0,year:void 0,month:void 0,date:void 0})},getRangeSeparator(e){return e?.includes(`-`)?`/`:`-`},createRangeFrom(e,t){if(!e)return null;if(t){let n=V.getRangeSeparator(t),r=RegExp(`[^\\d]*${n}[^\\d]*`);return e.split(r).slice(0,2).map(e=>V.createFrom(e,t))}return e.split(/[^\d]*-[^\d]*/).slice(0,2).map(e=>V.createFrom(e))},isValid(e){return e?N.isMoment(e)?e.isValid():typeof e==`object`&&typeof e.year==`number`&&typeof e.month==`number`&&typeof e.date==`number`&&V.toMoment(e)?.isValid():!1},nullifyInvalidDate(e){return V.isValid(e)?e:null},toMoment(e){return e?N.isMoment(e)?e:N({...e,month:e.month-1}):null},toString(e,t){let n=V.toMoment(e);return n&&n.isValid()?n.format(t||`MM/DD/YYYY`):``},toStringRange(e,t){if(!e)return``;let n=V.getRangeSeparator(t);return e.slice(0,2).map(e=>V.toString(e,t)).join(n)},toDateTimeString(e,t=!1,n){return e&&N.isMoment(e)&&e.isValid()?n?t?e.format(`${n} ${R}`):e.format(`${n} ${L}`):t?e.format(I):e.format(F):``},toDateTimeStringRange(e,t=!1,n){if(!e)return``;let r=V.getRangeSeparator(n);return e.map(e=>V.toDateTimeString(e,t,n)).join(r)},create(){let e=new Date;return Object.freeze({year:e.getFullYear(),month:e.getMonth()+1,date:e.getDate()})},isSameDate(e,t){return e&&t&&e.year===t.year&&e.month===t.month&&e.date===t.date},isSameMonth(e,t){return e&&t&&e.year===t.year&&e.month===t.month},isAfter(e,t){return!e||!t?null:B(e)>B(t)},isBefore(e,t){return!e||!t?null:B(e)<B(t)},isInRange(e,t,n=!0){if(!e||!t||!t[0]||!t[1])return null;let r=B(e),[i,a]=t.map(B);return i&&a&&(n&&r>=i&&r<=a||!n&&r>i&&r<a)},prevMonth(e){return Object.freeze({year:e.month===1?e.year-1:e.year,month:e.month-1||12,date:e.date})},nextMonth(e){return Object.freeze({year:e.month===12?e.year+1:e.year,month:e.month+1>12?1:e.month+1,date:e.date})},createRangeFromPreset(e,t){if(typeof e.definition==`function`)return e.definition();let n=N(),r=n.clone().subtract(N.duration(e.definition));return[V.createFrom(r,t),V.createFrom(n,t)]},createDateTimeRangeFromPreset(e){return typeof e.definition==`function`?e.definition():[N().subtract(N.duration(e.definition)).startOf(`day`),N().endOf(`day`)]},splitMomentInDateTimeParts(e,t=!1,n,r=!1){let i=``;i=t?r?`23:59`:`00:00`:r?`11:59`:`12:00`;let a=r?`PM`:`AM`;return e&&N.isMoment(e)&&e.isValid()?V.toDateTimeString(e,t,n).split(` `):[``,i,t?void 0:a]},getCurrentMoment(){return N()},validateTimeString(e,t=!1){if(!e)return!0;let n=e.split(`:`),r=n[0]||`0`,i=n[1]||`0`,a=Number.isNaN(Number(r))?NaN:parseInt(r,10),o=Number.isNaN(Number(i))?NaN:parseInt(i,10),s=n.length<=2&&r.length<=2&&i.length<=2;return t?s&&a>=0&&a<=23&&o>=0&&o<=59:s&&(!Number.isNaN(a)&&r.length===1||a>=1)&&a<=12&&o>=0&&o<=59},padIncompleteTimeString(e,t=!1){if(!e)return``;let n=e.split(`:`),r=parseInt(n[0]||`0`,10),i=parseInt(n[1]||`0`,10);return t?`${r<10?`0${r}`:`${r}`}:${i<10?`0${i}`:`${i}`}`:`${r===0?`12`:r<10?`0${r}`:`${r}`}:${i<10?`0${i}`:`${i}`}`}}),te=[`01:00`,`02:00`,`03:00`,`04:00`,`05:00`,`06:00`,`07:00`,`08:00`,`09:00`,`10:00`,`11:00`,`12:00`],ne=[`00:00`,`01:00`,`02:00`,`03:00`,`04:00`,`05:00`,`06:00`,`07:00`,`08:00`,`09:00`,`10:00`,`11:00`,`12:00`,`13:00`,`14:00`,`15:00`,`16:00`,`17:00`,`18:00`,`19:00`,`20:00`,`21:00`,`22:00`,`23:00`],re=g({date:()=>W,dateConstraint:()=>K,dateRange:()=>G,setDateFormat:()=>U}),H=P;function U(e){H=e}var W=function(e){if(Array.isArray(e)){let t=W(e[0]),n=W(e[1]);return t||n}if(e&&e.hasOwnProperty(`year`)){if(e[z])return{dateFormat:H};if(!V.isValid(e))return{dateValidity:!0}}return null};D.add(`dateFormat`),D.add(`dateValidity`);var G=function(e){if(Array.isArray(e)){let t=W(e);if(t)return t;if(e&&V.isBefore(e[1],e[0]))return{dateRangeOrder:!0}}return null};D.add(`dateRangeOrder`);var K=function({minDate:e,maxDate:t}){function n(n){let r=V.isBefore(n,e),i=V.isAfter(n,t),a={minExceeded:r?V.toString(e,H):null,maxExceeded:i?V.toString(t,H):null};return r||i?{dateConstraint:a}:null}return function(e){if(!e)return null;if(Array.isArray(e)){let t=n(e[0]),r=n(e[1]);return t||r}return e.hasOwnProperty(`year`)?n(e):null}};D.add(`dateConstraint`);function ie(e,t){for(let n of[].concat(e)){let e=t(n);if(e)return e}return null}var ae=function(e){function t(t){return Number(t)>=e?null:{min:e}}return e=>ie(e,t)};D.add(`min`);var oe=function(e){function t(t){return Number(t)<=e?null:{max:e}}return e=>ie(e,t)};O.add(`max`);var se=function(e){return e==null||e===``||Number.isNaN(e)||e?.length===0?{required:!0}:null};O.add(`required`);var ce=function(e){function t(t){return t===void 0||t.toString().length<e?{minLength:e}:null}return e=>ie(e,t)};D.add(`minLength`);var le=function(e){function t(t){return t==null||Array.isArray(t)&&t.length<e?{minLengthArray:e}:null}return e=>t(e)};D.add(`minLengthArray`);var ue=function(e){function t(t){return t===void 0||t.toString().length<=e?null:{maxLength:e}}return e=>ie(e,t)};k.add(`maxLength`);var de=function(e){function t(t){return t==null||Array.isArray(t)&&t.length<=e?null:{maxLengthArray:e}}return e=>t(e)};D.add(`maxLengthArray`);var fe=function(e){let t=e instanceof RegExp?e:new RegExp(e);function n(n){return t.test(n)?null:{pattern:e}}return e=>ie(e,n)};D.add(`pattern`);var pe=function(e){function t(e){return/^\p{L}*$/u.test(e)?null:{alpha:!0}}return ie(e,t)};k.add(`alpha`);var me=function(e){function t(e){return/^[0-9,. ]*$/.test(e)?null:{numeric:!0}}return ie(e,t)};k.add(`numeric`);var he=function(e){function t(e){return/^-?[0-9,. ]*$/.test(e)?null:{positiveOrNegativeNumber:!0}}return ie(e,t)};k.add(`positiveOrNegativeNumber`);var ge=function(e){function t(e){return/^[^0-9]*$/.test(e)?null:{nonNumeric:!0}}return ie(e,t)};k.add(`nonNumeric`);var _e=Object.freeze({...re,min:ae,max:oe,required:se,minLength:ce,minLengthArray:le,maxLength:ue,maxLengthArray:de,pattern:fe,alpha:pe,numeric:me,nonNumeric:ge,positiveOrNegativeNumber:he,OnBlurErrorKeys:D});function ve(e,t=[]){let n=t.reduce((t,n)=>Object.assign(t,n(e)||{}),{});return Object.keys(n).length?n:null}var ye=function(e){return e[e.ON_CHANGE=0]=`ON_CHANGE`,e[e.ON_BLUR=1]=`ON_BLUR`,e[e.ON_SUBMIT=2]=`ON_SUBMIT`,e}({});function be(e,t={},n=[]){for(let[e,n]of Object.entries(t))n===0?j(e):n===2&&M(e);return y.useCallback(e,n)}var xe=class{#e;#t;#n;constructor(e,t){this.path=e,this.update=t,this.validators=[],this.#e=null,this.#t=null,this.#n=null,this.preventativeErrors=[],this.submitted=!1}get errors(){return this.#e===null&&this.#t===null&&this.#n===null?null:{...this.#e??{},...this.#t??{},...this.#n??{}}}setValidators(e){return this.update(this.path,null,void 0,e),this}validate(e,t,n=!1){if(this.validators&&this.validators.length>0){let r=ve(e,this.validators),i={onSubmit:{},onChange:{},onBlur:{}};r&&(i=Object.keys(r).reduce((e,t)=>(A.has(t)?e.onSubmit[t]=r[t]:O.has(t)?e.onChange[t]=r[t]:e.onBlur[t]=r[t],e),i)),(t===void 0||t===ye.ON_CHANGE)&&(this.#t=Object.keys(i.onChange).length===0?null:i.onChange),(t===void 0||t===ye.ON_BLUR)&&(this.#n=Object.keys(i.onBlur).length===0?null:i.onBlur),(t===void 0||t===ye.ON_SUBMIT)&&(this.#e=Object.keys(i.onSubmit).length===0?null:i.onSubmit,this.#t=Object.keys(i.onChange).length===0?null:i.onChange,this.#n=Object.keys(i.onBlur).length===0?null:i.onBlur),n||this.update(),this.isFocused()&&this.onFocus&&this.onFocus()}else this.errors&&(this.#e=null,this.#n=null,this.#t=null,n||this.update());return this}isValid(){return!this.errors||this.isPristine()}hasErrors(){return!!this.errors}isVisibilyInvalid(){return!this.isValid()}hasError(e){return this.errors&&Object.prototype.hasOwnProperty.call(this.errors,e)}hasPreventativeError(e){return this.preventativeErrors.includes(e)}hasPreventativeErrors(){return this.preventativeErrors.length>0}isRequired(){return this.validators&&this.validators.includes(_e.required)}isSubmitted(){return this.submitted}onFocus(){}onBlur(){}},Se=class extends xe{constructor(...e){super(...e),this.id=C(),this.focused=!1,this.pristine=!0}setValue(e){if(this.preventativeErrors=[],this.validators&&this.validators.length>0){let t=ve(e,this.validators);if(t&&Object.keys(t).filter(e=>k.has(e)).length>0){this.preventativeErrors=Object.keys(t);return}}this.update(this.path,e)}isPristine(){return this.pristine}markAsPristine(){return this.pristine=!0,this.update(),this}markAsDirty(){return this.pristine=!1,this.update(),this}isFocused(){return this.focused}markAsFocused(){return this.focused=!0,this.update(),this.onFocus&&this.onFocus(),this}markAsBlurred(){return this.update(this.path,null,!0),this.onBlur&&this.onBlur(),this.preventativeErrors=[],this}markAsSubmitted(){return this.submitted=!0,this.update(this.path,null,!1,void 0,!0),this}},Ce=class extends Se{constructor(e,t,n){super(n?t:e,n||t),n&&this.inferMembers(e)}isFocused(){return super.isFocused()||this.rollup(`isFocused`)}isValid(){return super.isValid()&&this.rollup(`isValid`)}hasErrors(){return super.hasErrors()||Object.keys(this.fields).some(e=>this.fields[e].hasErrors())}contentsAreValid(){return this.rollup(`isValid`)&&this.rollup(`contentsAreValid`)}isPristine(){return super.isPristine()&&this.rollup(`isPristine`)}markAsPristine(){super.markAsPristine();for(let e of Object.keys(this.fields))this.fields[e].markAsPristine();return this}markAsDirty(){super.markAsDirty();for(let e of Object.keys(this.fields))this.fields[e].markAsDirty();return this}markAsBlurred(){super.markAsBlurred();for(let e of Object.keys(this.fields))this.fields[e].markAsBlurred();return this}markAsSubmitted(){super.markAsSubmitted();for(let e of Object.keys(this.fields))this.fields[e].markAsSubmitted();return this}inferSpsControl(e,t){return Ee(e,[...this.path,t],this.update)}rollup(e){return Object.keys(this.fields).reduce((t,n)=>t&&(!this.fields[n][e]||this.fields[n][e]()),!0)}},we=class extends Ce{inferMembers(e){this.fields={};for(let t of Object.keys(e))this.fields[t]=this.inferSpsControl(e[t],t)}},Te=class extends Ce{inferMembers(e){this.fields=e.map((e,t)=>this.inferSpsControl(e,String(t)))}};function Ee(e,t,n){return e instanceof xe?(e.path=t,e.update=n,e):Array.isArray(e)?new Te(e,t,n):(0,E.default)(e)?new we(e,t,n):new Se(t,n)}function De(e,t){return t.length===0||!e?e:De(e.fields[t[0]],t.slice(1,t.length))}function Oe(e,t){if(t.length===0||!e)return[e];let n=t[0];if(t=t.slice(1,t.length),n===`*`){let n=Array.isArray(e.fields)?e.fields:Object.keys(e.fields).map(t=>e.fields[t]);return t.length===0?n:n.reduce((e,n)=>[...e,...Oe(n,t)],[])}return Oe(e.fields[n],t)}function ke(e,t,n){for(let r of Object.keys(t)){let i=t[r];for(let t of Oe(e,r.split(`.`)))t&&i&&n(t,i)}}function Ae(e,t,r,i=!1,a=!1){ke(t,r,(t,r)=>{t.validators=typeof r==`function`?r(e):r,i&&t.validate((0,n.getPath)(e,t.path),void 0,a)})}function je(e,t){let n=t[0];return t=t.slice(1),Array.isArray(e)?e.map((e,r)=>r===Number(n)?je(e,t):e):(0,E.default)(e)?Object.keys(e).reduce((r,i)=>Object.assign(r,{[i]:i===n?je(e[i],t):e[i]}),{}):e}function Me(e){if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`The initial value of useSpsForm() hook must be an object.`)}function Ne(e,t={}){Me(e);let[,r]=(0,y.useState)({}),i=(0,y.useRef)(!1);i.current=!1;let a=(0,y.useRef)(t),o=(0,y.useCallback)(e=>{let o=f.current,s;if(e){if(e.path){if(e.markAsBlurred){let t=De(o.formMeta,e.path);if(t){t.focused=!1;let r=(0,n.getPath)(o.formValue,e.path);t.validate(r,ye.ON_BLUR)}}else if(e.newValidators){if(a.current){let t=e.path.join(`.`);a.current={...a.current,[t]:e.newValidators},Ae(o.formValue,o.formMeta,a.current,!0)}}else if(e.markAsSubmitted){let t=De(o.formMeta,e.path);if(t){t.submitted=!0;let r=(0,n.getPath)(o.formValue,e.path);t.validate(r,ye.ON_SUBMIT)}}else s=je(o.formValue,e.path),(0,n.setPath)(s,e.path,e.value)}else s=e.value}if(e?.updateFormOptions?.validators&&(a.current={...a.current,...e.updateFormOptions.validators},Ae(o.formValue,o.formMeta,a.current,e.updateFormOptions?.runValidators??!0)),s){o.formMeta.submitted=!1,(0,n.deepFreeze)(s);let e=(0,n.diff)(o.formValue,s);for(let{type:t,key:r,parentPath:i,objects:[,a]}of e){let e=De(o.formMeta,i);if(typeof r!=`symbol`&&e){let o;switch(t){case n.DiffChange.ADDITION:e.fields[r]=Ee(a[r],[...i,r],c);break;case n.DiffChange.DELETION:Array.isArray(e.fields)?e.fields[r]=void 0:delete e.fields[r];break;case n.DiffChange.ALTERATION:o=Ee(a[r],[...i,r],c),(o instanceof Ce&&!(e.fields[r]instanceof Ce)||!(o instanceof Ce)&&e.fields[r]instanceof Ce)&&(o.pristine=!1,e.fields[r]=o)}}}let r=new Set;if(e.filter(e=>e.type===n.DiffChange.DELETION).reduce((e,t)=>(e.has(t.parentPath)||e.add(t.parentPath),e),r),Array.from(r).forEach(e=>{let t=De(o.formMeta,e);Array.isArray(t.fields)&&(t.fields=t.fields.filter(e=>e!==void 0))}),a.current){Ae(s,o.formMeta,a.current);let r=new Set;t&&ke(o.formMeta,t,(e,t)=>{typeof t==`function`&&(e.validate((0,n.getPath)(s,e.path)),r.add(e))});for(let{type:t,key:i,parentPath:a,objects:[,c]}of e)if(typeof i!=`symbol`){let e=o.formMeta,l=s;if(e){for(let t of a)e=e.fields[t],l=l[t],r.has(e)||e.validate(l,ye.ON_CHANGE);if(t===n.DiffChange.ADDITION||t===n.DiffChange.ALTERATION){let a=e.fields[i];if(!r.has(a)&&(e.fields[i].validate(c[i],ye.ON_CHANGE),t===n.DiffChange.ADDITION&&a.fields))for(let[e,t]of Object.entries(a.fields))t.validate(c[i][e],ye.ON_CHANGE)}}}}}f.current={...o,formValue:s||o.formValue},i.current||r({})},[]),s=(0,y.useCallback)((e,t)=>{e||t?o({value:e,updateFormOptions:t}):o()},[o]),c=(0,y.useCallback)((e,t,n=!1,r,i=!1)=>{e?o({path:e,value:t,markAsBlurred:n,newValidators:r,markAsSubmitted:i}):s()},[o,s]),l=(0,y.useMemo)(()=>{(0,n.deepFreeze)(e);let r=Ee(e,[],c);return t&&Ae(e,r,t,!1,!0),r},[]),u=(0,y.useCallback)(()=>(f.current.formMeta.markAsDirty(),a.current&&ke(f.current.formMeta,a.current,(e,t)=>{(typeof t==`function`||Array.isArray(t))&&e.validate((0,n.getPath)(f.current.formValue,e.path))}),f.current.formMeta.isValid()),[]),d=(0,y.useCallback)(()=>f.current.formValue,[]),f=(0,y.useRef)({formValue:e,formMeta:l,updateForm:s,validateForm:u,getCurrentFormValue:d});return f.current}var Pe=y.forwardRef((e,t)=>{let{className:n,children:r,focusInputOnClick:i,formControl:a,formMeta:o,inputRef:s,onClick:c,...l}=e,u=y.useRef(),d=s||t||u;function f(){d&&d!==t&&d.current&&d.current.focus()}function p(){d&&d!==t&&d.current&&o&&o instanceof Se&&o.markAsFocused()}function m(){d&&d!==t&&d.current&&o&&o instanceof Se&&o.markAsBlurred()}let h=x(`sps-form-group`,(a&&a.isRequired()||o&&o.isRequired())&&`sps-form-group--required`,(a&&!a.isValid()||o&&o.isVisibilyInvalid())&&`sps-form-group--error`,o&&o.hasPreventativeErrors()&&`sps-form-group--preventative-error`,n);function g(e){i&&f(),c&&c(e)}return y.useEffect(()=>{function e(e){e.target.classList.contains(`sps-form-control__clear-btn`)&&e.preventDefault()}return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),y.createElement(`div`,{...l,className:h,ref:t,tabIndex:-1,onClick:g,onFocus:p,onBlur:m},r)});Object.assign(Pe,{displayName:`SpsFormComponentWrapper`});var Fe=e=>typeof e==`object`&&!!e&&e.nodeType===1,Ie=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,Le=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return Ie(n.overflowY,t)||Ie(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},Re=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,ze=e=>e.parentElement??(e.getRootNode().host||null),Be=(e,t)=>{if(typeof document>`u`)return[];let{scrollMode:n,block:r,inline:i,boundary:a,skipOverflowHiddenElements:o}=t,s=typeof a==`function`?a:e=>e!==a;if(!Fe(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;Fe(u)&&s(u);){if(u=ze(u),u===c){l.push(u);break}u!=null&&u===document.body&&Le(u)&&!Le(document.documentElement)||u!=null&&Le(u,o)&&l.push(u)}let d=window.visualViewport?.width??innerWidth,f=window.visualViewport?.height??innerHeight,{scrollX:p,scrollY:m}=window,{height:h,width:g,top:_,right:v,bottom:y,left:b}=e.getBoundingClientRect(),{top:x,right:S,bottom:C,left:w}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),T=r===`start`||r===`nearest`?_-x:r===`end`?y+C:_+h/2-x+C,E=i===`center`?b+g/2-w+S:i===`end`?v+S:b-w,D=[];for(let e=0;e<l.length;e++){let t=l[e],{height:a,width:o,top:s,right:u,bottom:x,left:S}=t.getBoundingClientRect();if(n===`if-needed`&&_>=0&&b>=0&&y<=f&&v<=d&&(t===c&&!Le(t)||_>=s&&y<=x&&b>=S&&v<=u))return D;let C=getComputedStyle(t),w=parseInt(C.borderLeftWidth,10),O=parseInt(C.borderTopWidth,10),k=parseInt(C.borderRightWidth,10),A=parseInt(C.borderBottomWidth,10),j=0,M=0,N=`offsetWidth`in t?t.offsetWidth-t.clientWidth-w-k:0,P=`offsetHeight`in t?t.offsetHeight-t.clientHeight-O-A:0,F=`offsetWidth`in t?t.offsetWidth===0?0:o/t.offsetWidth:0,I=`offsetHeight`in t?t.offsetHeight===0?0:a/t.offsetHeight:0;if(c===t)j=r===`start`?T:r===`end`?T-f:r===`nearest`?Re(m,m+f,f,O,A,m+T,m+T+h,h):T-f/2,M=i===`start`?E:i===`center`?E-d/2:i===`end`?E-d:Re(p,p+d,d,w,k,p+E,p+E+g,g),j=Math.max(0,j+m),M=Math.max(0,M+p);else{j=r===`start`?T-s-O:r===`end`?T-x+A+P:r===`nearest`?Re(s,x,a,O,A+P,T,T+h,h):T-(s+a/2)+P/2,M=i===`start`?E-S-w:i===`center`?E-(S+o/2)+N/2:i===`end`?E-u+k+N:Re(S,u,o,w,k+N,E,E+g,g);let{scrollLeft:e,scrollTop:n}=t;j=I===0?0:Math.max(0,Math.min(n+j/I,t.scrollHeight-a/I+P)),M=F===0?0:Math.max(0,Math.min(e+M/F,t.scrollWidth-o/F+N)),T+=n-j,E+=e-M}D.push({el:t,top:j,left:M})}return D},Ve=g({default:()=>Ue}),He=e=>!1===e?{block:`end`,inline:`nearest`}:(e=>e===Object(e)&&Object.keys(e).length!==0)(e)?e:{block:`start`,inline:`nearest`};function Ue(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;let n=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>typeof e==`object`&&typeof e.behavior==`function`)(t))return t.behavior(Be(e,t));let r=typeof t==`boolean`||t==null?void 0:t.behavior;for(let{el:i,top:a,left:o}of Be(e,He(t))){let e=a-n.top+n.bottom,t=o-n.left+n.right;i.scroll({top:e,left:t,behavior:r})}}var We={alt:`string`,size:`SpinnerSize`,title:`string`};function Ge(e){let{alt:t,className:n,size:r=i.SpinnerSize.MEDIUM,"data-testid":o,title:s,unsafelyReplaceClassName:c,...l}=e,{t:u}=(0,a.useWoodlandLanguage)(),d=t||s||u(`spinner.defaultAltText`,{defaultValue:`Loading...`}),f=x(c||`sps-spinner`,`sps-spinner--${r}`,n);return y.createElement(`i`,{className:f,"data-testid":o,title:d,...l})}Object.assign(Ge,{props:We,displayName:`SpsSpinner`});var Ke=60;function qe(e){return e===void 0?`inherit`:`${e}px`}function Je(e){switch(e){case i.Position.TOP_LEFT:return i.Position.BOTTOM_LEFT;case i.Position.TOP_MIDDLE:return i.Position.BOTTOM_MIDDLE;case i.Position.TOP_RIGHT:return i.Position.BOTTOM_RIGHT;case i.Position.RIGHT_TOP:return i.Position.LEFT_TOP;case i.Position.RIGHT_MIDDLE:return i.Position.LEFT_MIDDLE;case i.Position.RIGHT_BOTTOM:return i.Position.LEFT_BOTTOM;case i.Position.BOTTOM_RIGHT:return i.Position.TOP_RIGHT;case i.Position.BOTTOM_MIDDLE:return i.Position.TOP_MIDDLE;case i.Position.BOTTOM_LEFT:return i.Position.TOP_LEFT;case i.Position.LEFT_BOTTOM:return i.Position.RIGHT_BOTTOM;case i.Position.LEFT_MIDDLE:return i.Position.RIGHT_MIDDLE;case i.Position.LEFT_TOP:return i.Position.RIGHT_TOP}}function Ye(e,t,n,r,i,a,o,s){let c=o&&o.current,l=c?c.scrollTop:window.pageYOffset,u=s?0:l,d=c?c.scrollLeft:window.pageXOffset,f=s?0:d,[p,m]=e.split(` `),h,g,_,v;switch(p){case`top`:_=t.height-n.top-u-a[0];break;case`left`:g=t.width-n.left-f-a[0];break;case`right`:v=n.right+f-a[0];break;case`bottom`:h=n.bottom+u-a[0];break;default:throw Error(`Invalid position ${e}`)}switch(m){case`left`:v=n.left+f+a[1];break;case`top`:h=n.top+u+a[1];break;case`middle`:p===`top`||p===`bottom`?v=n.left+f+n.width/2-i/2+a[1]:(p===`left`||p===`right`)&&(h=n.top+u+n.height/2-r.height/2+a[1]);break;case`bottom`:_=t.height-n.bottom-u+a[1];break;case`right`:g=t.width-n.right-f+a[1];break;default:throw Error(`Invalid position ${e}`)}return[h,g,_,v]}function Xe(e,t,n,{altPosition:r,setMinWidth:a=!1,setWidth:o=!1,parentElementRef:s,fixed:c=!1,offsets:l=[0,0],altOffsets:u=l}){if(e.current&&t.current){let d=e.current.getBoundingClientRect(),f=t.current.getBoundingClientRect(),p=Math.max(document.documentElement.clientHeight,window.innerHeight||0),m=document.documentElement.getBoundingClientRect().width,h=(s?.current??document.documentElement).getBoundingClientRect();c&&(h={x:0,y:0,width:m,height:p,top:0,left:0,bottom:p,right:m,toJSON(){return{width:m,height:p,top:0,left:0,bottom:p,right:m}}});let[g,_]=n.split(` `),v=n;if(r&&(g===`top`&&f.top-d.height<Ke||g===`right`&&f.right+d.width>m||g===`bottom`&&f.bottom+d.height>p||g===`left`&&f.left-d.width<0)&&(v=r),_===`left`&&f.left+d.width+(l?.[1]??0)>document.documentElement.getBoundingClientRect().right)switch(g){case`bottom`:v=i.Position.BOTTOM_RIGHT;break;case`top`:v=i.Position.TOP_RIGHT}let y=a?Math.max(f.width,d.width):d.width,b=o?f.width:y,[x,S,C,w]=Ye(v,h,f,d,b,v===r?u:l,s,c),T={top:qe(x),right:qe(S),bottom:qe(C),left:qe(w)};return c&&(T.position=`fixed`,T.zIndex=i.ZStratum.BAR),a&&(T.minWidth=`${f.width}px`),o&&(T.width=`${f.width}px`),[T,v===r]}return[{},!1]}var Ze=(0,y.createContext)(null);function Qe(e,t=[]){let n=(0,y.useContext)(Ze);return(0,y.useMemo)(()=>r=>{let i=n&&n.parentElementRef&&n.parentElementRef.current||document.body,a=null,s=i.lastElementChild;for(;s&&s!==i.firstElementChild;){if(s.hasAttribute(`data-portalid`)&&s.getAttribute(`data-portalid`)===e){a=s;break}s=s.previousElementSibling}if(a)i.contains(a)||i.appendChild(a);else{a=document.createElement(`div`),a.setAttribute(`data-portalid`,e),a.setAttribute(`data-react-aria-top-layer`,`true`);for(let e of t)a.classList.add(e);i.appendChild(a)}return(0,o.createPortal)(r,a)},[n])}var $e=`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890`.split(``);async function et(e,t,n,r,a,o,s){if(!s())return;let c=typeof e.options==`function`?e.options(t.value):e.options||[],l=c instanceof Promise,u=e=>e.replace(/([.?*+^$[\]\\(){}|-])/g,``);n({pending:l}),o.current=l?c:null;let d=l?await c||[]:c||[];if(!s()||l&&o.current!==c)return;let f=Array.from(d).filter(Boolean).map(t=>new i.SpsOptionListOption(t,typeof t==`function`?{textKey:`label`,captionKey:`caption`}:{textKey:e.textKey,captionKey:e.captionKey}));if(e.nullOption&&f.unshift(new i.SpsOptionListOption(null,{text:e.nullOption})),t.value&&!e.disableDefaultOptionsFiltering){let r=u(t.value);n({replacementPattern:RegExp(`(${r})`,`ig`)}),f=f.filter(t=>{let n=new RegExp(r,`i`),i=u(t.text);return e.filterByTextAndCaptionKey?n.test(i)||n.test(u(t.caption)):n.test(i)})}else n({replacementPattern:null});if(e.disabledOptions)for(let t of f)e.disabledOptions.includes(t.value)&&(t.disabled=!0);r(Object.freeze(f)),e.onOptionListChanged&&e.onOptionListChanged(f.length),a(f.some(e=>e.value&&!!e.value.icon)),n({pending:!1})}function tt(e,t,r){let[i,a]=y.useState(Object.freeze([])),[o,s]=y.useState(!1),c=y.useRef(null),l=y.useRef(e.options);(typeof e.options!=`function`||e.disableOptionsMemoization)&&(l.current=e.options);let u=y.useMemo(()=>typeof l.current==`function`?(0,n.debounce)(et,e.searchDebounce===void 0?500:e.searchDebounce):et,[l.current,e.disabledOptions]),d=y.useRef(!0);return y.useEffect(()=>(d.current=!0,()=>{d.current=!1,`reset`in u&&u.reset?.()}),[u]),y.useEffect(()=>{u(e,t,r,a,s,c,()=>d.current)},[l.current,t.value,e.disabledOptions]),[i,o]}var nt=class{constructor(e,t){this.target=e,this.isPgStoppedInternal=!1,this.currentTarget=e,this.nativeEvent=new CustomEvent(`change`,t),Object.defineProperty(this.nativeEvent,"target",{value:e,writable:!1,configurable:!1,enumerable:!0})}get bubbles(){return this.nativeEvent.bubbles}get cancelable(){return this.nativeEvent.cancelable}get defaultPrevented(){return this.nativeEvent.defaultPrevented}get eventPhase(){return this.nativeEvent.eventPhase}get isTrusted(){return this.nativeEvent.isTrusted}get timeStamp(){return this.nativeEvent.timeStamp}get type(){return this.nativeEvent.type}preventDefault(){this.nativeEvent.preventDefault()}isDefaultPrevented(){return this.defaultPrevented}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPgStoppedInternal=!0}isPropagationStopped(){return this.isPgStoppedInternal}persist(){throw Error(`This is not a real React ChangeEvent. React does not permit the creation of SyntheticEvents in userland.`)}};function rt(e,t){return{...e,...t}}function it(e){return(0,y.useReducer)(rt,e)}function at({hideInlineSearch:e,showInlineSearch:t,options:n,onSearchChange:r,search:i=``,searchPlaceholder:o,searchInputRef:s}){let{t:c}=(0,a.useWoodlandLanguage)(),l=o??c(`select.searchPlaceholder`,{defaultValue:`Search…`}),[u,d]=it({isAsync:typeof n==`function`,pending:!1,value:i,replacementPattern:null}),f=y.useCallback(e=>{d({value:e.target.value}),r&&r(e)},[r]),p=y.useCallback(e=>{e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},[]),m=y.useCallback(e=>{e.nativeEvent.stopImmediatePropagation(),d({value:``}),r&&r(new nt({value:``})),s?.current&&s.current.focus()},[r,s]);return y.useEffect(()=>{d({value:i})},[i]),[(u.isAsync||t)&&!e?y.createElement(`div`,{className:`sps-option-list__search sps-form-group sps-text-input`},y.createElement(`div`,{className:`sps-form-control`},!u.value&&y.createElement(`i`,{className:`sps-icon sps-icon-filter sps-text-input__icon`}),y.createElement(`input`,{type:`text`,className:`sps-text-input__input`,placeholder:l,ref:s,value:u.value,onChange:f,onClick:p,onKeyDown:e=>{e&&([`Tab`,`Escape`,`Enter`,`Up`,`ArrowUp`,`Down`,`ArrowDown`].includes(e.key)||e.stopPropagation())}}),u.value&&y.createElement(`i`,{className:`sps-icon sps-icon-x-circle sps-form-control__clear-btn`,onClick:m}))):y.createElement(y.Fragment,null),u,d]}var ot=Ue||Ve,st=[`Tab`,`Escape`,`Enter`,`Up`,`ArrowUp`,`Down`,`ArrowDown`];function ct(e,t,n){return n?(e&&e[n])===(t&&t[n]):e===t}function lt(e,t,n){return typeof n.value==`function`&&n.disabled?!0:t?!!e?.find(e=>e[t]&&e[t]===n?.value?.[t]):!1}var ut=y.forwardRef((e,t)=>{let{captionKey:n,comparisonKey:r,disabledOptions:a,options:o,tall:s,textKey:c,valueKey:l,zeroState:u,hideInlineSearch:d,showInlineSearch:f,onSearchChange:p,search:m,searchDebounce:h,searchPlaceholder:g,onSpecialActionSelect:_,attachTo:v,className:b,conformWidth:S,id:C,ignoreWidthStyles:w,isOpen:T,keepOpen:E,keyDown:D,nullOption:O,onOptionListChanged:k,onOptionSelected:A,onPositionFlip:j,onSelfToggle:M,optionRole:N,positionOverride:P,selectedOption:F,specialAction:I,unsafelyReplaceClassName:L,loading:R,filterByTextAndCaptionKey:ee,maxHeightPx:z,maxHeightRem:B,disableOptionsMemoization:V,disableDefaultOptionsFiltering:te,"data-testid":ne,typeaheadEvent:re,...H}=e,U=y.useMemo(()=>I?new i.SpsOptionListOption(I,{textKey:`label`,captionKey:`caption`}):null,[I]),[W,G]=y.useState(-1),[K,ie]=y.useState(T),ae=t||y.useRef(null),oe=y.useRef(null),se=y.useRef(null),ce=Qe(`sps-option-list-portal`),le=y.useContext(Ze),[ue,de]=P||[i.Position.BOTTOM_LEFT,i.Position.TOP_LEFT],[[fe,pe],me]=y.useState([{},!1]),he=y.useRef(null),[ge,_e,ve]=at({...e,searchInputRef:he}),[ye,be]=tt(e,_e,ve);y.useEffect(()=>{re&&Ae(re)},[re]),y.useEffect(()=>{me(K?Xe(ae,v,ue,{altPosition:de,setMinWidth:!w,setWidth:!w&&S,...le}):[{},!1])},[K,ue,de,ye]),y.useEffect(()=>{let e;return K&&(e=()=>{K&&me(Xe(ae,v,ue,{altPosition:de,setMinWidth:!w,setWidth:!w&&S,...le}))},document.addEventListener(`scroll`,e)),()=>{e&&document.removeEventListener(`scroll`,e)}},[K]),y.useEffect(()=>{G(-1)},[_e]);let xe=x(L||`sps-option-list`,`z-stratum-dropdown`,K&&`sps-option-list--open`,_e.isAsync&&`sps-option-list--searchable`,pe&&`sps-option-list--opens-upward`,I&&I.label&&`sps-option-list--has-special-action`,b),Se=x(L||`sps-option-list__options`,s&&`sps-option-list__options--tall`),Ce=y.useCallback(()=>{K||(ie(!0),he.current&&he.current.focus(),G(-1),M&&M(!0))},[K,M]),we=y.useCallback(()=>{K&&(ie(!1),G(-1),M&&M(!1))},[K,M]),Te=y.useCallback((e,t)=>{t||e&&!e.disabled&&(typeof e.value==`function`?(e.value(),_&&_()):typeof A==`function`&&A(e.value),E||we())},[A,we]),Ee=y.useCallback((e,t,n)=>{e.stopPropagation(),Te(t,n)},[Te]),De=y.useRef(a||[]);De.current=a||[];let Oe=y.useCallback(e=>{switch(e.key){case`Tab`:case`Escape`:we();break;case`Enter`:if(W>-1){let t=ye[W]||U;e.preventDefault();let n=!!t&<(De.current,r||``,t);!n&&t&&typeof A==`function`&&typeof t.value==`function`?t.value():t&&Te(t,n)}break;case`Up`:case`ArrowUp`:{let t=W;pe?W<=-1?t=ye.length-1:W===0?I&&(t=ye.length):W<ye.length&&(t=W-1):W>-1&&(t=W-1),t!==W&&(e.preventDefault(),G(t));break}case`Down`:case`ArrowDown`:{Ce();let t=W;pe?W!==-1&&(t=W>=ye.length?0:W===ye.length-1?-1:W+1):W<ye.length-1+Number(!!I)&&(t=W+1),t!==W&&(e.preventDefault(),G(t));break}default:Ce()}},[we,Ce,W,Te,A,pe,ye]),ke=y.useCallback(e=>{Ce();let t=ye.findIndex(t=>{if(t.textKey){let n=t.textKey;return t.value[n].toLowerCase().charAt([0])===e.key.toLocaleLowerCase()}return t.value.toString().toLowerCase().charAt([0])===e.key.toLocaleLowerCase()});t>-1&&G(t)},[ye]),Ae=y.useCallback(e=>{e&&(st.includes(e.key)?Oe(e):$e.includes(e.key)&&!d&&ke(e))},[we,Ce,W,Te,A,pe,ye]);y.useEffect(()=>{if(le!==null&&document.getElementsByClassName(`sps-modal__body`).length>0){let e=()=>{M&&M(!1)},t=document.getElementsByClassName(`sps-modal__body`)[0];return t.addEventListener(`scroll`,e),()=>{t.removeEventListener(`scroll`,e)}}},[]),y.useEffect(()=>{K&&se.current&&ot(se.current,{scrollMode:`if-needed`,block:`nearest`,inline:`nearest`})},[W,K]),y.useEffect(()=>{ie(T),T?he.current&&he.current.focus():G(-1)},[T]),y.useEffect(()=>{D&&Ae(D)},[D]),y.useEffect(()=>{!K&&oe.current&&(p&&_e.value&&p(new nt({value:``})),ve({value:``}),oe.current.scrollTop=0),K&&j&&j(pe)},[K]);let je=z?z/16:B,Me=je?{maxHeight:`${je}rem`}:{};function Ne(e,t){return t?y.createElement(y.Fragment,null,e.split(t).map((e,n)=>t.test(e)?y.createElement(`u`,{key:n},e):y.createElement(y.Fragment,{key:n},e))):y.createElement(y.Fragment,null,e)}return ce(y.createElement(`div`,{className:xe,id:C,"aria-activedescendant":W>-1?`${C}-option-${W}`:``,tabIndex:-1,ref:ae,style:fe,onMouseLeave:()=>G(-1),"data-testid":ne,...H},ge,y.createElement(`div`,{className:Se,ref:oe,"data-testid":`${ne}-options`,style:Me},!R&&!_e.pending&&u&&ye.length===0&&y.createElement(`div`,{className:`sps-option-list__zero-state`},u),(R||_e.pending)&&y.createElement(`div`,{className:`sps-option-list__loading`},y.createElement(Ge,null)),!R&&!_e.pending&&ye.map((e,t)=>{let n=`${C}-option-${t}`,i=ct(e.value,F,r),a=lt(De.current,r||``,e);return y.createElement(`a`,{key:n,id:n,role:N,"aria-selected":i,href:e.href,className:x(`sps-option-list__option`,e.caption&&`sps-option-list__option--has-caption`,e.disabled&&`sps-option-list__option--disabled`,e.bold&&`sps-option-list__option--bold`,(i||a)&&`sps-option-list__option--selected`,W===t&&`sps-option-list__option--highlighted`),onClick:t=>Ee(t,e,a),onMouseOver:()=>G(t),tabIndex:-1,ref:W===t?se:null,"data-testid":`${ne}-option-${t}`},e.value&&e.value.icon&&y.createElement(`i`,{className:x(`sps-icon`,`sps-option-list__option-icon`,`sps-icon-${String(e.value.icon)}`)}),(!e.value||!e.value.icon&&be)&&y.createElement(`span`,{className:`sps-option-list__option-icon-spacer`}),y.createElement(`span`,null,Ne(e.text,_e.replacementPattern)),e.caption&&y.createElement(`div`,{className:`sps-option-list__option-caption`},y.createElement(`span`,null,Ne(e.caption,_e.replacementPattern))))})),U&&I?.label&&y.createElement(`a`,{className:x(`sps-option-list__option`,`sps-option-list__special-action`,W===ye.length&&`sps-option-list__option--highlighted`,I.disabled&&`sps-option-list__special-action--disabled`),href:U.href,target:U.href&&I.newTab?`_blank`:`_self`,onClick:e=>Ee(e,U),onMouseOver:()=>G(ye.length),"data-testid":`${ne}-special-action`},I.icon&&y.createElement(`i`,{className:x(`sps-icon`,`sps-option-list__option-icon`,`sps-icon-${String(I.icon)}`)}),!I.icon&&be&&y.createElement(`span`,{className:`sps-option-list__option-icon-spacer`}),y.createElement(`span`,null,I.label))))});Object.assign(ut,{displayName:`SpsOptionList`});function dt(e){return{key:e.key,preventDefault:()=>{}}}function ft(e,t,n=[]){return y.useMemo(()=>{function n(n){return y.createElement(e,{...n,...t},n.children)}return n},n)}function pt(e){return typeof e==`function`?e():e}var mt=function({children:e,elements:t}){if(t.length===0)return y.createElement(y.Fragment,null,e);let[n,r]=Array.isArray(t[0])?t[0]:[t[0]];return y.createElement(n,r??{},y.createElement(mt,{elements:t.slice(1)},e))},ht=function({children:e,providers:t=[],...n}){return y.createElement(`div`,n,y.createElement(mt,{elements:t},e))},gt=function({children:e,className:t,...n}){return y.createElement(ht,{className:`sps-app ${t}`,...n},e)};function _t(e,t){let{type:n,props:r={},custom:i}=t;return i?i(e.type):e.type===n&&Object.keys(r).every(t=>r[t]===e.props[t])}function vt(e=[],t=[]){let r=Array.isArray(e)?(0,n.flatten)(e):[e],i=t.map(e=>Array.isArray(e)?e:[e]),a=Array(i.length+1).fill(null).map(()=>[]);for(let e of r){let t=!1;for(let n=0;n<i.length;n+=1)for(let r of i[n])if(_t(e,r)){t=!0,a[n].push(e);break}t||a[a.length-1].push(e)}return a}function yt(e,t,n){let r=Object.entries(t).filter(([,e])=>typeof e!=`string`&&e.deprecated).map(([e])=>e),i=r.map(e=>n[e]);y.useEffect(()=>{i.find(e=>e!==void 0)&&console.warn(`The following prop(s) of ${e} are deprecated: ${r.join(`, `)}`)},i)}function bt(e,t){let n=(0,y.useRef)(!1);(0,y.useEffect)(()=>()=>{n.current=!1},[]),(0,y.useEffect)(()=>{if(n.current)return e();n.current=!0},t)}function xt(e,t,n){let r=y.useRef(t(...n));y.useEffect(()=>(document.addEventListener(e,r.current,{capture:!0}),()=>document.removeEventListener(e,r.current)),[]),y.useEffect(()=>{document.removeEventListener(e,r.current),r.current=t(...n),document.addEventListener(e,r.current,{capture:!0})},n)}function St(e,t,n){return function(r){!e.current?.contains(r.target)&&!t.current?.contains(r.target)&&n()}}function Ct(e,t,n){let r=y.useRef(!1),[i,a]=y.useState(!1),o=y.useCallback(()=>{r.current?r.current=!1:a(!0)},[]),s=y.useCallback((e=!1)=>{a(!1),r.current=e,n&&n()},[]);return xt(`mousedown`,St,[e,t,s]),xt(`pointerdown`,St,[e,t,s]),{showPopup:i,doShowPopup:o,doHidePopup:s}}var wt=e=>{let t=/(auto|scroll)/,n=(e,t)=>e.parentNode===null?t:n(e.parentNode,t.concat([e])),r=(e,t)=>getComputedStyle(e,null).getPropertyValue(t),i=e=>r(e,`overflow`)+r(e,`overflow-y`),a=e=>t.test(i(e));return(e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return;let t=n(e.parentNode,[]);for(let e=0;e<t.length;e+=1)if(a(t[e]))return t[e];return null})(e)},Tt=0,Et=null,Dt=null;function Ot({isOpen:e,rootRef:t}){y.useLayoutEffect(()=>{let n=!1;if(e&&t.current&&(n=!0,Tt+=1,Tt===1)){let e=wt(t.current)||document.body;Et=e;let n=e===document.body?window.innerWidth-document.documentElement.clientWidth:e.offsetWidth-e.clientWidth;e.style.overflow=`hidden`;let r=window.getComputedStyle(e).paddingRight;if(e.style.paddingRight=r&&r!==`0px`?`calc(${r} + ${n}px)`:`${n}px`,e===document.body){let e=document.getElementsByClassName(`sps-navbar-container`).item(0);if(e&&window.getComputedStyle(e).position===`fixed`){let t=window.getComputedStyle(e).paddingRight;e.style.paddingRight=t&&t!==`0px`?`calc(${t} + ${n}px)`:`${n}px`,Dt=e}else if(e=document.getElementsByTagName(`nav`).item(0)?.parentElement??null,e&&window.getComputedStyle(e).position===`fixed`){let t=window.getComputedStyle(e).paddingRight;e.style.paddingRight=t&&t!==`0px`?`calc(${t} + ${n}px)`:`${n}px`,Dt=e}}}return()=>{n&&(--Tt,Tt===0&&Et&&(Et.style.overflow=``,Et.style.paddingRight=``,Dt&&=(Dt.style.paddingRight=``,null),Et=null))}},[e])}var kt={debounce:`number`,disabled:`boolean`,conformWidth:`boolean`,formMeta:`SpsFormFieldMeta<string>`,icon:`SpsIcon`,onChange:`React.ChangeEventHandler`,onSelectionChange:`(newValue: string) => void`,placeholder:`string`,suggestions:{type:`
|
|
2
2
|
Eventually<Iterable<string>>
|
|
3
3
|
| ((filter?: string) => Eventually<Iterable<string>>)
|
|
4
4
|
`,required:!0},textKey:`string`,captionKey:`string`,tallOptionList:`boolean`,value:`string`,zeroState:`string`,loading:`boolean`,maxHeightOptionListPx:`number`,maxHeightOptionListRem:`number`,disableOptionsMemoization:`boolean`,inputNotClearable:`boolean`,autoFocusOnSelection:`boolean`};function At({className:e,debounce:t=0,disabled:n,conformWidth:r,formControl:i,formMeta:a,onChange:o,onSelectionChange:s,icon:c,id:l,placeholder:u=``,suggestions:d,unsafelyReplaceClassName:f,textKey:p,captionKey:m,tallOptionList:h,value:g=``,zeroState:_,loading:v,maxHeightOptionListPx:b,maxHeightOptionListRem:S,disableOptionsMemoization:C,inputNotClearable:w,autoFocusOnSelection:E,"data-testid":D,...O}){let k=a||i,{wrapperId:A,controlId:j}=T(l,k),[M,N]=it({keyDown:null,opensUpward:!1}),P=y.useRef(null),F=y.useRef(null),I=y.useRef(null),{showPopup:L,doShowPopup:R,doHidePopup:ee}=Ct(P,I);function z(e,t,n=!1){k&&(k.setValue(e),k.markAsDirty()),s&&n?s(e):o&&o(t||new nt({value:e}))}function B(e){F.current&&(F.current.value=``,z(``)),e.stopPropagation()}function V(e){z(e.target.value,e)}function te(e){n||([`Up`,`ArrowUp`,`Down`,`ArrowDown`,`Enter`].includes(e.key)&&e.preventDefault(),e.stopPropagation(),N({keyDown:dt(e)})),e.key===`Tab`&&ee()}function ne(e){e?R():ee()}function re(e){N({opensUpward:e})}let H=x(f||`sps-autocomplete`,L&&`sps-autocomplete--open`,L&&`z-stratum-dropdown`,M.opensUpward&&`sps-autocomplete--opens-upward`,n&&`sps-form-control--disabled`,e);return y.useEffect(()=>{let e;return L&&(e=()=>{ee()},window.addEventListener(`resize`,e)),()=>{e&&window.removeEventListener(`resize`,e)}},[L]),Ot({isOpen:L,rootRef:P}),y.createElement(Pe,{id:A,className:H,formControl:i,formMeta:a,inputRef:F,ref:P,focusInputOnClick:!0,onClick:e=>e.nativeEvent.stopImmediatePropagation(),"data-testid":`${D}`},y.createElement(`div`,{className:`sps-text-input`},y.createElement(`div`,{className:`sps-form-control`},c&&y.createElement(`i`,{className:x(`sps-text-input__icon`,`sps-icon`,`sps-icon-${c}`)}),y.createElement(`input`,{type:`text`,ref:F,value:g,className:`sps-text-input__input`,placeholder:u,onFocus:R,onClick:R,onChange:V,onKeyDown:te,disabled:n,id:j,"data-testid":`${D}__input`,...O}),g&&!n&&!w&&y.createElement(`i`,{"aria-label":`clear`,className:`sps-icon sps-icon-x-circle sps-form-control__clear-btn`,onClick:e=>B(e)}))),y.createElement(ut,{id:`${A}_options`,ref:I,attachTo:P,isOpen:L,options:d,hideInlineSearch:!0,keyDown:M.keyDown,onOptionSelected:e=>{z(p&&typeof e==`object`&&e?e[p]??``:e,void 0,!0),E&&F.current?.focus()},onPositionFlip:re,onSelfToggle:ne,offsets:[1,0],search:g,searchDebounce:t,textKey:p,captionKey:m,tall:h,zeroState:_,loading:v,maxHeightPx:b,maxHeightRem:S,disableOptionsMemoization:C,conformWidth:r}))}Object.assign(At,{props:kt,displayName:`SpsAutocomplete`});var jt={basic:{label:`Basic`,examples:{basic:{react:n.code`
|
|
@@ -1820,6 +1820,42 @@ Valid keys: `+JSON.stringify(Object.keys(e),null,` `));var p=f(l,d,o,s,c+`.`+d,
|
|
|
1820
1820
|
</div>
|
|
1821
1821
|
)
|
|
1822
1822
|
}
|
|
1823
|
+
`},pendingSearch:{description:()=>y.default.createElement(y.default.Fragment,null,y.default.createElement(`h4`,null,`Pending Searches Stop When the Select Is Removed`),y.default.createElement(`p`,null,`If the select is removed while a debounced search is still waiting, for example because it sits in a modal or tab that closes, that search never runs, so no late request is made for a select that is gone. Multi Selects and Autocompletes work the same way.`),y.default.createElement(`p`,null,`To see it here, open the select, type a few letters, then choose Hide Select within 2 seconds. The number of searches run does not change.`)),react:n.code`
|
|
1824
|
+
import { SpsButton, SpsLabel, SpsSelect, useSpsForm } from "@spscommerce/ds-react";
|
|
1825
|
+
function DemoComponent() {
|
|
1826
|
+
const [showSelect, setShowSelect] = React.useState(true);
|
|
1827
|
+
const [searchCount, setSearchCount] = React.useState(0);
|
|
1828
|
+
|
|
1829
|
+
function colorSearch(search) {
|
|
1830
|
+
setSearchCount((count) => count + 1);
|
|
1831
|
+
return ["red", "orange", "yellow", "green", "blue", "indigo", "violet"].filter(s => new RegExp(search, "i").test(s));
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
const { formMeta } = useSpsForm({
|
|
1835
|
+
color: ""
|
|
1836
|
+
});
|
|
1837
|
+
|
|
1838
|
+
return (
|
|
1839
|
+
<div className="sfg-row">
|
|
1840
|
+
<div className="sfg-col-4">
|
|
1841
|
+
<SpsButton onClick={() => setShowSelect(!showSelect)}>
|
|
1842
|
+
{showSelect ? "Hide Select" : "Show Select"}
|
|
1843
|
+
</SpsButton>
|
|
1844
|
+
<p className="mt-2">Searches run: {searchCount}</p>
|
|
1845
|
+
{showSelect && (
|
|
1846
|
+
<>
|
|
1847
|
+
<SpsLabel for={formMeta.fields.color}>Color</SpsLabel>
|
|
1848
|
+
<SpsSelect
|
|
1849
|
+
options={colorSearch}
|
|
1850
|
+
searchDebounce={2000}
|
|
1851
|
+
formMeta={formMeta.fields.color}
|
|
1852
|
+
/>
|
|
1853
|
+
</>
|
|
1854
|
+
)}
|
|
1855
|
+
</div>
|
|
1856
|
+
</div>
|
|
1857
|
+
)
|
|
1858
|
+
}
|
|
1823
1859
|
`}}},objectOptions:{label:`Object Options`,description:()=>y.default.createElement(`p`,null,`The values in the select menu can be modified to provide more detail to the user or the system, when necessary.`),examples:{basic:{react:n.code`
|
|
1824
1860
|
import { SpsLabel, SpsSelect, useSpsForm } from "@spscommerce/ds-react";
|
|
1825
1861
|
function DemoComponent() {
|
|
@@ -2232,7 +2268,7 @@ Valid keys: `+JSON.stringify(Object.keys(e),null,` `));var p=f(l,d,o,s,c+`.`+d,
|
|
|
2232
2268
|
import { SpsDateTime } from "@spscommerce/ds-react";
|
|
2233
2269
|
`,jsx:n.code`
|
|
2234
2270
|
<SpsDateTime>2018-09-11T16:32:52.822000Z</SpsDateTime>
|
|
2235
|
-
`}}}},Vp={compact:`boolean`,wideTerms:`boolean`,widerTerms:`boolean`};function Hp(e){let{children:t,className:n,compact:r=!1,"data-testid":i,unsafelyReplaceClassName:a,wideTerms:o=!1,widerTerms:s=!1,...c}=e,l=y.Children.map(t,(e,t)=>{if(e.type.toString()!==y.Fragment.toString()){let n=parseInt(`${t/2}`,10)+1;return y.cloneElement(e,{style:{...e.props.style,msGridRow:n}})}let n=e.props.children;return y.Children.map(n,e=>y.cloneElement(e,{style:{...e.props.style,msGridRow:t+1}}))}),u=x(a||`sps-description-list`,r&&`sps-description-list--compact`,o&&`sps-description-list--wide-terms`,s&&`sps-description-list--wider-terms`,n);return y.createElement(`dl`,{className:u,"data-testid":`${i}`,...c},l)}Object.assign(Hp,{props:Vp,displayName:`SpsDescriptionList / SpsDl`});function Up(e){return y.createElement(Hp,e)}Object.assign(Up,{props:Vp,displayName:`SpsDescriptionList / SpsDl`});var Wp={};function Gp(e){let{children:t,className:n,"data-testid":r,unsafelyReplaceClassName:i,...a}=e,o=x(i||`sps-description-list__definition`,n);return y.createElement(`dd`,{className:o,"data-testid":`${r}`,...a},t)}Object.assign(Gp,{props:Wp,displayName:`SpsDescriptionListDefinition / SpsDd`});function Kp(e){return y.createElement(Gp,e)}Object.assign(Kp,{props:Wp,displayName:`SpsDescriptionListDefinition / SpsDd`});var Z=function(e){return e.VISIBLE=`visible`,e.DEFER_VISIBLE=`defer_visible`,e.HIDDEN=`hidden`,e.DELAYED_HIDDEN=`delayed_hidden`,e}({});function qp(e){return e===`visible`?`hidden`:`visible`}var Jp=13,Yp=20,Xp=10,Zp=new Map,Qp={for:{type:`React.MutableRefObject<any> | string`,required:!0},hideDelay:`number`,isShown:`TooltipVisibility`,kind:`TooltipKind`,offsets:`[number, number]`,altOffsets:`[number, number]`,onDeferred:`() => void`,position:`Position`,altPosition:`Position`,showOn:`TooltipShowTrigger`,title:`string | ReactNode`};function $p({children:e,className:t,for:n,"data-testid":r,hideDelay:a=i.TOOLTIP_HIDE_DELAY_MS_DEFAULT,isShown:o,kind:s=i.TooltipKind.DEFAULT,offsets:c=[0,0],altOffsets:l,onDeferred:u,position:d=i.Position.TOP_MIDDLE,altPosition:f=Je(d),showOn:p=i.TooltipShowTrigger.MOUSEOVER,style:m,title:h,unsafelyReplaceClassName:g}){let _=y.useRef({instanceKey:Symbol(`ds-react:tooltip:instance-key`),prevIsShown:o,hideTimer:null}),[v,b]=y.useState(!1),S=y.useRef(null),C=typeof n==`string`?y.useRef(document.getElementById(n)):n,w=y.useCallback(()=>{_.current.hideTimer&&(clearTimeout(_.current.hideTimer),_.current.hideTimer=null)},[]),T=y.useCallback(()=>{w(),b(!1)},[]),E=y.useCallback((e=!1)=>{if(e===!0&&Zp.size>0)return u&&u(),!1;if(S.current?.textContent===``)return console.warn(`SpsTooltip is empty; aborting show`),!1;w();for(let e of Zp.values())e();return b(!0),!0},[]),D=y.useCallback(e=>{e&&e.stopPropagation(),b(e=>e?(T(),!1):E())},[]),O=y.useCallback(e=>{S.current&&!S.current.contains(e.target)&&T()},[]),k=y.useCallback(()=>{w(),_.current.hideTimer=setTimeout(T,a)},[]),A=y.useCallback(e=>{let[t,n]=e.split(` `);if(n===`middle`)return 0;let r=C?.current?.getBoundingClientRect();if(!r)return 0;let i=Xp*Math.sqrt(2),a=Yp-(i-Xp)/2+i/2;return[`top`,`bottom`].includes(t)?!r.width||r.width>50?0:r.width/2-a:[`left`,`right`].includes(t)?!r.height||r.height>50?0:r.height/2-a:0},[]);y.useEffect(()=>{if(typeof n==`string`&&(C.current=document.getElementById(n)),v?Zp.set(_.current.instanceKey,T):Zp.has(_.current.instanceKey)&&Zp.delete(_.current.instanceKey),p===i.TooltipShowTrigger.MANUAL){if(o!==_.current.prevIsShown)switch(o){case`visible`:E();break;case`defer_visible`:E(!0);break;case`hidden`:T();break;case`delayed_hidden`:k()}_.current.prevIsShown=o}},[v,o]),y.useEffect(()=>{if(C.current)switch(p){case i.TooltipShowTrigger.MOUSEOVER:C.current.addEventListener(`mouseenter`,E),C.current.addEventListener(`mouseleave`,k);break;case i.TooltipShowTrigger.CLICK:C.current.addEventListener(`click`,D),document.addEventListener(`click`,O);break;case i.TooltipShowTrigger.MANUAL:}},[C]),y.useEffect(()=>{S.current?.textContent===``&&v&&(_.current.hideTimer&&(clearTimeout(_.current.hideTimer),_.current.hideTimer=null),b(!1))},[e,v]),y.useEffect(()=>()=>{w(),Zp.has(_.current.instanceKey)&&Zp.delete(_.current.instanceKey),C.current&&(C.current.removeEventListener(`mouseenter`,E),C.current.removeEventListener(`mouseleave`,k),C.current.removeEventListener(`click`,D),document.removeEventListener(`click`,O))},[]);let j=Qe(`sps-tooltip-portal`),M=y.useContext(Ze),[[N,P],F]=y.useState([{},!1]),I=()=>{let e=[c[0]-Jp,c[1]+A(d)],t=f?[(l?.[0]??c[0])-Jp,(l?.[1]??c[1])+A(f)]:e;return Xe(S,C,d,{altPosition:f,setMinWidth:!1,offsets:e,altOffsets:t,...M})},L=y.useRef(I);L.current=I,y.useEffect(()=>{F(v?L.current():[{},!1])},[v,d,f,c[0],c[1],l?.[0],l?.[1],M?.fixed,M?.parentElementRef,e]),y.useEffect(()=>{if(!v)return;let e=()=>{F(L.current())};return document.addEventListener(`scroll`,e),()=>{document.removeEventListener(`scroll`,e)}},[v]);let R=x(g||`sps-tooltip`,`z-stratum-tip`,`sps-tooltip--${s}`,`sps-tooltip--pos-${(P?f:d).replace(` `,`-`)}`,v&&`sps-tooltip--shown`,t);return j(y.createElement(`div`,{role:`tooltip`,className:R,"data-testid":r,ref:S,style:{...m,...N},onMouseEnter:p===i.TooltipShowTrigger.MOUSEOVER?w:void 0,onMouseLeave:p===i.TooltipShowTrigger.MOUSEOVER?k:void 0},h&&(typeof h==`string`?y.createElement(`span`,{className:`sps-tooltip__title d-block`},h):h),y.createElement(`span`,{className:`sps-tooltip__body d-block`},e),y.createElement(`span`,{className:`sps-tooltip__caret`})))}Object.assign($p,{props:Qp,displayName:`SpsTooltip`});var em={error:`boolean`,errors:`ReactNodeOrRenderFn`,help:`ReactNodeOrRenderFn`,labelFor:`SpsFormFieldMeta<any>`,required:`boolean`};function tm(e){let{children:t,className:n,error:r,errors:a,help:o,labelFor:s,required:c,"data-testid":l,unsafelyReplaceClassName:u,...d}=e,f=y.useRef(null),p=y.useRef();function m(){return p?.current&&p.current.parentElement?.classList.contains(`sps-form-group--error`)}function h(){return s&&!s.isPristine()&&!s.isValid()}let[g,_]=y.useState(),[v,b]=y.useState(Z.HIDDEN);y.useEffect(()=>{_(h()||m()?i.TooltipKind.ERROR:i.TooltipKind.HELP)}),y.useEffect(()=>{p.current=f?.current?.getElementsByClassName(`sps-form-group__label`)[0];let e=()=>b(Z.VISIBLE),t=()=>b(Z.HIDDEN);return p.current&&(p.current.addEventListener(`focus`,e),p.current.addEventListener(`blur`,t)),()=>{p.current&&(p.current.removeEventListener(`focus`,e),p.current.removeEventListener(`blur`,t))}}),s&&(s.onFocus=()=>b(Z.VISIBLE),s.onBlur=()=>b(Z.HIDDEN));let S=x(u||`sps-description-list__term`,(c||s&&s.isRequired())&&`sps-description-list__term--required`,(r||h())&&`sps-description-list__term--error`,n)
|
|
2271
|
+
`}}}},Vp={compact:`boolean`,wideTerms:`boolean`,widerTerms:`boolean`};function Hp(e){let{children:t,className:n,compact:r=!1,"data-testid":i,unsafelyReplaceClassName:a,wideTerms:o=!1,widerTerms:s=!1,...c}=e,l=y.Children.map(t,(e,t)=>{if(e.type.toString()!==y.Fragment.toString()){let n=parseInt(`${t/2}`,10)+1;return y.cloneElement(e,{style:{...e.props.style,msGridRow:n}})}let n=e.props.children;return y.Children.map(n,e=>y.cloneElement(e,{style:{...e.props.style,msGridRow:t+1}}))}),u=x(a||`sps-description-list`,r&&`sps-description-list--compact`,o&&`sps-description-list--wide-terms`,s&&`sps-description-list--wider-terms`,n);return y.createElement(`dl`,{className:u,"data-testid":`${i}`,...c},l)}Object.assign(Hp,{props:Vp,displayName:`SpsDescriptionList / SpsDl`});function Up(e){return y.createElement(Hp,e)}Object.assign(Up,{props:Vp,displayName:`SpsDescriptionList / SpsDl`});var Wp={};function Gp(e){let{children:t,className:n,"data-testid":r,unsafelyReplaceClassName:i,...a}=e,o=x(i||`sps-description-list__definition`,n);return y.createElement(`dd`,{className:o,"data-testid":`${r}`,...a},t)}Object.assign(Gp,{props:Wp,displayName:`SpsDescriptionListDefinition / SpsDd`});function Kp(e){return y.createElement(Gp,e)}Object.assign(Kp,{props:Wp,displayName:`SpsDescriptionListDefinition / SpsDd`});var Z=function(e){return e.VISIBLE=`visible`,e.DEFER_VISIBLE=`defer_visible`,e.HIDDEN=`hidden`,e.DELAYED_HIDDEN=`delayed_hidden`,e}({});function qp(e){return e===`visible`?`hidden`:`visible`}var Jp=13,Yp=20,Xp=10,Zp=new Map,Qp={for:{type:`React.MutableRefObject<any> | string`,required:!0},hideDelay:`number`,isShown:`TooltipVisibility`,kind:`TooltipKind`,offsets:`[number, number]`,altOffsets:`[number, number]`,onDeferred:`() => void`,position:`Position`,altPosition:`Position`,showOn:`TooltipShowTrigger`,title:`string | ReactNode`};function $p({children:e,className:t,for:n,"data-testid":r,hideDelay:a=i.TOOLTIP_HIDE_DELAY_MS_DEFAULT,isShown:o,kind:s=i.TooltipKind.DEFAULT,offsets:c=[0,0],altOffsets:l,onDeferred:u,position:d=i.Position.TOP_MIDDLE,altPosition:f=Je(d),showOn:p=i.TooltipShowTrigger.MOUSEOVER,style:m,title:h,unsafelyReplaceClassName:g}){let _=y.useRef({instanceKey:Symbol(`ds-react:tooltip:instance-key`),prevIsShown:o,hideTimer:null}),[v,b]=y.useState(!1),S=y.useRef(null),C=typeof n==`string`?y.useRef(document.getElementById(n)):n,w=y.useCallback(()=>{_.current.hideTimer&&(clearTimeout(_.current.hideTimer),_.current.hideTimer=null)},[]),T=y.useCallback(()=>{w(),b(!1)},[]),E=y.useCallback((e=!1)=>{if(e===!0&&Zp.size>0)return u&&u(),!1;if(S.current?.textContent===``)return console.warn(`SpsTooltip is empty; aborting show`),!1;w();for(let e of Zp.values())e();return b(!0),!0},[]),D=y.useCallback(e=>{e&&e.stopPropagation(),b(e=>e?(T(),!1):E())},[]),O=y.useCallback(e=>{S.current&&!S.current.contains(e.target)&&T()},[]),k=y.useCallback(()=>{w(),_.current.hideTimer=setTimeout(T,a)},[]),A=y.useCallback(e=>{let[t,n]=e.split(` `);if(n===`middle`)return 0;let r=C?.current?.getBoundingClientRect();if(!r)return 0;let i=Xp*Math.sqrt(2),a=Yp-(i-Xp)/2+i/2;return[`top`,`bottom`].includes(t)?!r.width||r.width>50?0:r.width/2-a:[`left`,`right`].includes(t)?!r.height||r.height>50?0:r.height/2-a:0},[]);y.useEffect(()=>{if(typeof n==`string`&&(C.current=document.getElementById(n)),v?Zp.set(_.current.instanceKey,T):Zp.has(_.current.instanceKey)&&Zp.delete(_.current.instanceKey),p===i.TooltipShowTrigger.MANUAL){if(o!==_.current.prevIsShown)switch(o){case`visible`:E();break;case`defer_visible`:E(!0);break;case`hidden`:T();break;case`delayed_hidden`:k()}_.current.prevIsShown=o}},[v,o]),y.useEffect(()=>{if(C.current)switch(p){case i.TooltipShowTrigger.MOUSEOVER:C.current.addEventListener(`mouseenter`,E),C.current.addEventListener(`mouseleave`,k);break;case i.TooltipShowTrigger.CLICK:C.current.addEventListener(`click`,D),document.addEventListener(`click`,O);break;case i.TooltipShowTrigger.MANUAL:}},[C]),y.useEffect(()=>{S.current?.textContent===``&&v&&(_.current.hideTimer&&(clearTimeout(_.current.hideTimer),_.current.hideTimer=null),b(!1))},[e,v]),y.useEffect(()=>()=>{w(),Zp.has(_.current.instanceKey)&&Zp.delete(_.current.instanceKey),C.current&&(C.current.removeEventListener(`mouseenter`,E),C.current.removeEventListener(`mouseleave`,k),C.current.removeEventListener(`click`,D),document.removeEventListener(`click`,O))},[]);let j=Qe(`sps-tooltip-portal`),M=y.useContext(Ze),[[N,P],F]=y.useState([{},!1]),I=()=>{let e=[c[0]-Jp,c[1]+A(d)],t=f?[(l?.[0]??c[0])-Jp,(l?.[1]??c[1])+A(f)]:e;return Xe(S,C,d,{altPosition:f,setMinWidth:!1,offsets:e,altOffsets:t,...M})},L=y.useRef(I);L.current=I,y.useEffect(()=>{F(v?L.current():[{},!1])},[v,d,f,c[0],c[1],l?.[0],l?.[1],M?.fixed,M?.parentElementRef,e]),y.useEffect(()=>{if(!v)return;let e=()=>{F(L.current())};return document.addEventListener(`scroll`,e),()=>{document.removeEventListener(`scroll`,e)}},[v]);let R=x(g||`sps-tooltip`,`z-stratum-tip`,`sps-tooltip--${s}`,`sps-tooltip--pos-${(P?f:d).replace(` `,`-`)}`,v&&`sps-tooltip--shown`,t);return j(y.createElement(`div`,{role:`tooltip`,className:R,"data-testid":r,ref:S,style:{...m,...N},onMouseEnter:p===i.TooltipShowTrigger.MOUSEOVER?w:void 0,onMouseLeave:p===i.TooltipShowTrigger.MOUSEOVER?k:void 0},h&&(typeof h==`string`?y.createElement(`span`,{className:`sps-tooltip__title d-block`},h):h),y.createElement(`span`,{className:`sps-tooltip__body d-block`},e),y.createElement(`span`,{className:`sps-tooltip__caret`})))}Object.assign($p,{props:Qp,displayName:`SpsTooltip`});var em={error:`boolean`,errors:`ReactNodeOrRenderFn`,help:`ReactNodeOrRenderFn`,labelFor:`SpsFormFieldMeta<any>`,required:`boolean`};function tm(e){let{children:t,className:n,error:r,errors:a,help:o,labelFor:s,required:c,"data-testid":l,unsafelyReplaceClassName:u,...d}=e,f=y.useRef(null),p=y.useRef();function m(){return p?.current&&p.current.parentElement?.classList.contains(`sps-form-group--error`)}function h(){return s&&!s.isPristine()&&!s.isValid()}let[g,_]=y.useState(),[v,b]=y.useState(Z.HIDDEN);y.useEffect(()=>{_(h()||m()?i.TooltipKind.ERROR:i.TooltipKind.HELP)}),y.useEffect(()=>{p.current=f?.current?.getElementsByClassName(`sps-form-group__label`)[0];let e=()=>b(Z.VISIBLE),t=()=>b(Z.HIDDEN);return p.current&&(p.current.addEventListener(`focus`,e),p.current.addEventListener(`blur`,t)),()=>{p.current&&(p.current.removeEventListener(`focus`,e),p.current.removeEventListener(`blur`,t))}}),s&&(s.onFocus=()=>b(Z.VISIBLE),s.onBlur=()=>b(Z.HIDDEN));let S=x(u||`sps-description-list__term`,(c||s&&s.isRequired())&&`sps-description-list__term--required`,(r||h())&&`sps-description-list__term--error`,n),C=pt(g===i.TooltipKind.ERROR?a:o),w=C!=null&&C!==!1&&C!==``;function T(){b(v===Z.VISIBLE?Z.HIDDEN:Z.VISIBLE)}return y.createElement(y.Fragment,null,y.createElement(`dt`,{className:S,"data-testid":`${l}`,ref:f,onMouseEnter:()=>b(Z.VISIBLE),onMouseLeave:()=>b(Z.DELAYED_HIDDEN),onClick:T,...d},t),y.createElement($p,{kind:g,for:f,showOn:i.TooltipShowTrigger.MANUAL,isShown:w?v:Z.HIDDEN},C))}Object.assign(tm,{props:em,displayName:`SpsDescriptionListTerm / SpsDt`});function nm(e){return y.createElement(tm,e)}Object.assign(nm,{props:em,displayName:`SpsDescriptionListTerm / SpsDt`});var rm={general:{label:`General Usage`,description:()=>y.default.createElement(y.default.Fragment,null,y.default.createElement(`p`,null,`Description Lists should be used to group a series of related terms (and their accompanying descriptions) together in a tabular-like format.`),y.default.createElement(`p`,null,`Note: Description Lists are not the required pattern for listing terms and descriptions, but should be used when it benefits the legibility of the content over other typographic formats such as unordered lists or tables.`),y.default.createElement(`h5`,null,`Use a Description List`),y.default.createElement(`ul`,null,y.default.createElement(`li`,{className:`mb-2`},`To display two or more terms that have accompanying descriptions or values.`)),y.default.createElement(`h5`,null,`Do Not Use a Description List`),y.default.createElement(`ul`,null,y.default.createElement(`li`,{className:`mb-2`},`To display a single term`),y.default.createElement(`li`,{className:`mb-2`},`If the listed terms do not have descriptions`)))},basic:{label:`Basic Description Lists`,description:()=>y.default.createElement(`p`,null,`Description Lists are available in two sizes. Additionally, the left column can be set to one of three different width options to best accomodate the content in each specific use case.`),examples:{oneToThree:{description:()=>y.default.createElement(`h5`,null,`1-to-3`),react:n.code`
|
|
2236
2272
|
import { SpsDl, SpsDt, SpsDd } from "@spscommerce/ds-react";
|
|
2237
2273
|
function DemoComponent() {
|
|
2238
2274
|
return (
|
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": "8.56.
|
|
4
|
+
"version": "8.56.7",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/spscommerce/woodland/tree/main/packages/@spscommerce/ds-react",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"moment-timezone": "^0.6.0",
|
|
47
47
|
"react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
48
48
|
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
49
|
-
"@sps-woodland/illustrations": "8.56.
|
|
50
|
-
"@spscommerce/ds-colors": "8.56.
|
|
51
|
-
"@spscommerce/ds-shared": "8.56.
|
|
52
|
-
"@spscommerce/i18n": "8.56.
|
|
53
|
-
"@spscommerce/positioning": "8.56.
|
|
49
|
+
"@sps-woodland/illustrations": "8.56.7",
|
|
50
|
+
"@spscommerce/ds-colors": "8.56.7",
|
|
51
|
+
"@spscommerce/ds-shared": "8.56.7",
|
|
52
|
+
"@spscommerce/i18n": "8.56.7",
|
|
53
|
+
"@spscommerce/positioning": "8.56.7"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@react-stately/collections": "3.13.1",
|
|
@@ -70,12 +70,12 @@
|
|
|
70
70
|
"raf-stub": "3.0.0",
|
|
71
71
|
"react": "16.14.0",
|
|
72
72
|
"react-dom": "16.14.0",
|
|
73
|
-
"@sps-woodland/illustrations": "8.56.
|
|
74
|
-
"@spscommerce/ds-colors": "8.56.
|
|
75
|
-
"@spscommerce/ds-shared": "8.56.
|
|
76
|
-
"@spscommerce/i18n": "8.56.
|
|
77
|
-
"@spscommerce/positioning": "8.56.
|
|
78
|
-
"test": "8.56.
|
|
73
|
+
"@sps-woodland/illustrations": "8.56.7",
|
|
74
|
+
"@spscommerce/ds-colors": "8.56.7",
|
|
75
|
+
"@spscommerce/ds-shared": "8.56.7",
|
|
76
|
+
"@spscommerce/i18n": "8.56.7",
|
|
77
|
+
"@spscommerce/positioning": "8.56.7",
|
|
78
|
+
"test": "8.56.7"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"build": "pnpm run build:js && pnpm run build:types",
|