@utahdts/utah-design-system 0.5.3 → 0.6.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/1-settings/_icons.scss +9 -1
- package/css/4-elements/_elements-index.scss +2 -2
- package/dist/utah-design-system.es.js +2063 -1719
- package/dist/utah-design-system.umd.js +2063 -1722
- package/index.js +42 -36
- package/package.json +14 -9
- package/react/components/navigation/ExternalLink.jsx +24 -0
- package/react/components/navigation/OnThisPageHeadersLevel.jsx +2 -1
- package/react/components/popups/Popup.jsx +1 -1
- package/react/components/table/TableBodyData.jsx +13 -6
- package/react/components/table/TableFilterCustom.jsx +1 -1
- package/react/components/table/TableFilterDate.jsx +1 -1
- package/react/components/table/TableFilterSelect.jsx +16 -3
- package/react/components/table/TableFilterSelectAllOptions.jsx +69 -0
- package/react/components/table/TableFilterTextInput.jsx +1 -1
- package/react/components/table/TableFilters.jsx +1 -1
- package/react/components/table/TableHeadCell.jsx +1 -1
- package/react/components/table/TableSortingRule.jsx +1 -1
- package/react/components/table/TableSortingRules.jsx +1 -1
- package/react/components/table/TableWrapper.jsx +57 -2
- package/react/contexts/UtahHeaderContext.jsx +5 -1
- package/react/enums/popupPlacement.js +22 -0
- package/react/hooks/useComponentGuid.js +15 -0
- package/react/util/chainSorters.js +16 -14
- package/react/util/htmlDecode.js +5 -0
- package/react/util/menuItems/calculateMenuItemsParents.js +2 -2
- package/react/components/table/TableContext.jsx +0 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { setUtahHeaderSettings, getUtahHeaderSettings } from "@utahdts/utah-design-system-header";
|
|
2
|
+
import { baseSettings, childrenMenuTypes, events, renderDOMSingle } from "@utahdts/utah-design-system-header";
|
|
1
3
|
import * as React from "react";
|
|
2
4
|
import React__default, { useState, useEffect, useContext, useCallback, useMemo, useRef, useLayoutEffect } from "react";
|
|
3
|
-
import { popupPlacement, setUtahHeaderSettings, getUtahHeaderSettings } from "@utahdts/utah-design-system-header";
|
|
4
|
-
import { baseSettings, childrenMenuTypes, events, popupPlacement as popupPlacement2, renderDOMSingle } from "@utahdts/utah-design-system-header";
|
|
5
5
|
import { useLocation, NavLink } from "react-router-dom";
|
|
6
6
|
const name = "@utahdts/utah-design-system";
|
|
7
7
|
const description = "Utah Design System React Library";
|
|
8
8
|
const displayName = "Utah Design System React Library";
|
|
9
|
-
const version$1 = "0.
|
|
9
|
+
const version$1 = "0.6.0-beta.0";
|
|
10
10
|
const exports = {
|
|
11
11
|
".": {
|
|
12
12
|
"development-local": "./index.js",
|
|
@@ -64,27 +64,28 @@ const bugs = {
|
|
|
64
64
|
};
|
|
65
65
|
const homepage = "https://github.com/utahdts/utah-design-system";
|
|
66
66
|
const dependencies = {
|
|
67
|
-
"@utahdts/utah-design-system-header": "0.
|
|
67
|
+
"@utahdts/utah-design-system-header": "0.6.0-beta.0",
|
|
68
68
|
lodash: "4.17.21",
|
|
69
69
|
"prop-types": "15.8.1",
|
|
70
70
|
react: "18.x",
|
|
71
71
|
"react-popper": "2.3.0",
|
|
72
72
|
"react-router-dom": "6.x",
|
|
73
|
-
"use-immer": "0.9.0"
|
|
73
|
+
"use-immer": "0.9.0",
|
|
74
|
+
uuid: "9.0.0"
|
|
74
75
|
};
|
|
75
76
|
const devDependencies = {
|
|
76
|
-
"@types/react": "18.0.
|
|
77
|
+
"@types/react": "18.0.37",
|
|
77
78
|
"@types/react-dom": "18.0.11",
|
|
78
79
|
"@vitejs/plugin-react": "3.1.0",
|
|
79
|
-
"@vitest/coverage-istanbul": "0.
|
|
80
|
-
eslint: "8.
|
|
80
|
+
"@vitest/coverage-istanbul": "0.30.1",
|
|
81
|
+
eslint: "8.38.0",
|
|
81
82
|
"eslint-config-airbnb": "19.0.4",
|
|
82
83
|
"eslint-plugin-import": "2.27.5",
|
|
83
84
|
"eslint-plugin-jsx-a11y": "6.7.1",
|
|
84
85
|
"eslint-plugin-react": "7.32.2",
|
|
85
86
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
86
|
-
sass: "1.
|
|
87
|
-
vite: "4.2.
|
|
87
|
+
sass: "1.62.0",
|
|
88
|
+
vite: "4.2.2",
|
|
88
89
|
"vite-plugin-eslint": "1.8.1",
|
|
89
90
|
vitest: "0.30.1"
|
|
90
91
|
};
|
|
@@ -109,20 +110,6 @@ const packageJson = {
|
|
|
109
110
|
devDependencies,
|
|
110
111
|
type
|
|
111
112
|
};
|
|
112
|
-
const BUTTON_APPEARANCE = {
|
|
113
|
-
SOLID: "solid",
|
|
114
|
-
OUTLINED: "outlined"
|
|
115
|
-
};
|
|
116
|
-
const BUTTON_TYPES = {
|
|
117
|
-
BUTTON: "button",
|
|
118
|
-
RESET: "reset",
|
|
119
|
-
SUBMIT: "submit"
|
|
120
|
-
};
|
|
121
|
-
const ICON_BUTTON_APPEARANCE = {
|
|
122
|
-
SOLID: "solid",
|
|
123
|
-
OUTLINED: "outlined",
|
|
124
|
-
BORDERLESS: "borderless"
|
|
125
|
-
};
|
|
126
113
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
127
114
|
var jsxRuntimeExports = {};
|
|
128
115
|
var jsxRuntime = {
|
|
@@ -1064,7 +1051,7 @@ const Fragment = jsxRuntimeExports.Fragment;
|
|
|
1064
1051
|
const jsx = jsxRuntimeExports.jsx;
|
|
1065
1052
|
const jsxs = jsxRuntimeExports.jsxs;
|
|
1066
1053
|
var propTypesExports = {};
|
|
1067
|
-
var propTypes$
|
|
1054
|
+
var propTypes$S = {
|
|
1068
1055
|
get exports() {
|
|
1069
1056
|
return propTypesExports;
|
|
1070
1057
|
},
|
|
@@ -2023,309 +2010,24 @@ function requireFactoryWithThrowingShims() {
|
|
|
2023
2010
|
if (process.env.NODE_ENV !== "production") {
|
|
2024
2011
|
var ReactIs = requireReactIs();
|
|
2025
2012
|
var throwOnDirectAccess = true;
|
|
2026
|
-
propTypes$
|
|
2013
|
+
propTypes$S.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
2027
2014
|
} else {
|
|
2028
|
-
propTypes$
|
|
2029
|
-
}
|
|
2030
|
-
var isArray$5 = Array.isArray;
|
|
2031
|
-
var isArray_1 = isArray$5;
|
|
2032
|
-
var isArray$4 = isArray_1;
|
|
2033
|
-
function castArray() {
|
|
2034
|
-
if (!arguments.length) {
|
|
2035
|
-
return [];
|
|
2036
|
-
}
|
|
2037
|
-
var value = arguments[0];
|
|
2038
|
-
return isArray$4(value) ? value : [value];
|
|
2039
|
-
}
|
|
2040
|
-
var castArray_1 = castArray;
|
|
2041
|
-
function identity(value) {
|
|
2042
|
-
return value;
|
|
2043
|
-
}
|
|
2044
|
-
var identity_1 = identity;
|
|
2045
|
-
var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
2046
|
-
var _freeGlobal = freeGlobal$1;
|
|
2047
|
-
var freeGlobal = _freeGlobal;
|
|
2048
|
-
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
2049
|
-
var root$8 = freeGlobal || freeSelf || Function("return this")();
|
|
2050
|
-
var _root = root$8;
|
|
2051
|
-
var root$7 = _root;
|
|
2052
|
-
var Symbol$5 = root$7.Symbol;
|
|
2053
|
-
var _Symbol = Symbol$5;
|
|
2054
|
-
function arrayMap$1(array, iteratee) {
|
|
2055
|
-
var index = -1, length = array == null ? 0 : array.length, result = Array(length);
|
|
2056
|
-
while (++index < length) {
|
|
2057
|
-
result[index] = iteratee(array[index], index, array);
|
|
2058
|
-
}
|
|
2059
|
-
return result;
|
|
2060
|
-
}
|
|
2061
|
-
var _arrayMap = arrayMap$1;
|
|
2062
|
-
var Symbol$4 = _Symbol;
|
|
2063
|
-
var objectProto$c = Object.prototype;
|
|
2064
|
-
var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
|
|
2065
|
-
var nativeObjectToString$1 = objectProto$c.toString;
|
|
2066
|
-
var symToStringTag$1 = Symbol$4 ? Symbol$4.toStringTag : void 0;
|
|
2067
|
-
function getRawTag$1(value) {
|
|
2068
|
-
var isOwn = hasOwnProperty$9.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
|
2069
|
-
try {
|
|
2070
|
-
value[symToStringTag$1] = void 0;
|
|
2071
|
-
var unmasked = true;
|
|
2072
|
-
} catch (e) {
|
|
2073
|
-
}
|
|
2074
|
-
var result = nativeObjectToString$1.call(value);
|
|
2075
|
-
if (unmasked) {
|
|
2076
|
-
if (isOwn) {
|
|
2077
|
-
value[symToStringTag$1] = tag;
|
|
2078
|
-
} else {
|
|
2079
|
-
delete value[symToStringTag$1];
|
|
2080
|
-
}
|
|
2081
|
-
}
|
|
2082
|
-
return result;
|
|
2083
|
-
}
|
|
2084
|
-
var _getRawTag = getRawTag$1;
|
|
2085
|
-
var objectProto$b = Object.prototype;
|
|
2086
|
-
var nativeObjectToString = objectProto$b.toString;
|
|
2087
|
-
function objectToString$1(value) {
|
|
2088
|
-
return nativeObjectToString.call(value);
|
|
2089
|
-
}
|
|
2090
|
-
var _objectToString = objectToString$1;
|
|
2091
|
-
var Symbol$3 = _Symbol, getRawTag = _getRawTag, objectToString = _objectToString;
|
|
2092
|
-
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
|
|
2093
|
-
var symToStringTag = Symbol$3 ? Symbol$3.toStringTag : void 0;
|
|
2094
|
-
function baseGetTag$6(value) {
|
|
2095
|
-
if (value == null) {
|
|
2096
|
-
return value === void 0 ? undefinedTag : nullTag;
|
|
2097
|
-
}
|
|
2098
|
-
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
2099
|
-
}
|
|
2100
|
-
var _baseGetTag = baseGetTag$6;
|
|
2101
|
-
function isObjectLike$7(value) {
|
|
2102
|
-
return value != null && typeof value == "object";
|
|
2103
|
-
}
|
|
2104
|
-
var isObjectLike_1 = isObjectLike$7;
|
|
2105
|
-
var baseGetTag$5 = _baseGetTag, isObjectLike$6 = isObjectLike_1;
|
|
2106
|
-
var symbolTag$2 = "[object Symbol]";
|
|
2107
|
-
function isSymbol$1(value) {
|
|
2108
|
-
return typeof value == "symbol" || isObjectLike$6(value) && baseGetTag$5(value) == symbolTag$2;
|
|
2109
|
-
}
|
|
2110
|
-
var isSymbol_1 = isSymbol$1;
|
|
2111
|
-
var Symbol$2 = _Symbol, arrayMap = _arrayMap, isArray$3 = isArray_1, isSymbol = isSymbol_1;
|
|
2112
|
-
var INFINITY = 1 / 0;
|
|
2113
|
-
var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolToString = symbolProto$1 ? symbolProto$1.toString : void 0;
|
|
2114
|
-
function baseToString$3(value) {
|
|
2115
|
-
if (typeof value == "string") {
|
|
2116
|
-
return value;
|
|
2117
|
-
}
|
|
2118
|
-
if (isArray$3(value)) {
|
|
2119
|
-
return arrayMap(value, baseToString$3) + "";
|
|
2120
|
-
}
|
|
2121
|
-
if (isSymbol(value)) {
|
|
2122
|
-
return symbolToString ? symbolToString.call(value) : "";
|
|
2123
|
-
}
|
|
2124
|
-
var result = value + "";
|
|
2125
|
-
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
|
|
2126
|
-
}
|
|
2127
|
-
var _baseToString = baseToString$3;
|
|
2128
|
-
var reWhitespace = /\s/;
|
|
2129
|
-
function trimmedEndIndex$1(string) {
|
|
2130
|
-
var index = string.length;
|
|
2131
|
-
while (index-- && reWhitespace.test(string.charAt(index))) {
|
|
2132
|
-
}
|
|
2133
|
-
return index;
|
|
2134
|
-
}
|
|
2135
|
-
var _trimmedEndIndex = trimmedEndIndex$1;
|
|
2136
|
-
var trimmedEndIndex = _trimmedEndIndex;
|
|
2137
|
-
var reTrimStart = /^\s+/;
|
|
2138
|
-
function baseTrim$1(string) {
|
|
2139
|
-
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
|
|
2140
|
-
}
|
|
2141
|
-
var _baseTrim = baseTrim$1;
|
|
2142
|
-
function baseSlice$1(array, start2, end2) {
|
|
2143
|
-
var index = -1, length = array.length;
|
|
2144
|
-
if (start2 < 0) {
|
|
2145
|
-
start2 = -start2 > length ? 0 : length + start2;
|
|
2146
|
-
}
|
|
2147
|
-
end2 = end2 > length ? length : end2;
|
|
2148
|
-
if (end2 < 0) {
|
|
2149
|
-
end2 += length;
|
|
2150
|
-
}
|
|
2151
|
-
length = start2 > end2 ? 0 : end2 - start2 >>> 0;
|
|
2152
|
-
start2 >>>= 0;
|
|
2153
|
-
var result = Array(length);
|
|
2154
|
-
while (++index < length) {
|
|
2155
|
-
result[index] = array[index + start2];
|
|
2156
|
-
}
|
|
2157
|
-
return result;
|
|
2158
|
-
}
|
|
2159
|
-
var _baseSlice = baseSlice$1;
|
|
2160
|
-
var baseSlice = _baseSlice;
|
|
2161
|
-
function castSlice$2(array, start2, end2) {
|
|
2162
|
-
var length = array.length;
|
|
2163
|
-
end2 = end2 === void 0 ? length : end2;
|
|
2164
|
-
return !start2 && end2 >= length ? array : baseSlice(array, start2, end2);
|
|
2165
|
-
}
|
|
2166
|
-
var _castSlice = castSlice$2;
|
|
2167
|
-
function baseFindIndex$1(array, predicate, fromIndex, fromRight) {
|
|
2168
|
-
var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
|
|
2169
|
-
while (fromRight ? index-- : ++index < length) {
|
|
2170
|
-
if (predicate(array[index], index, array)) {
|
|
2171
|
-
return index;
|
|
2172
|
-
}
|
|
2173
|
-
}
|
|
2174
|
-
return -1;
|
|
2175
|
-
}
|
|
2176
|
-
var _baseFindIndex = baseFindIndex$1;
|
|
2177
|
-
function baseIsNaN$1(value) {
|
|
2178
|
-
return value !== value;
|
|
2179
|
-
}
|
|
2180
|
-
var _baseIsNaN = baseIsNaN$1;
|
|
2181
|
-
function strictIndexOf$1(array, value, fromIndex) {
|
|
2182
|
-
var index = fromIndex - 1, length = array.length;
|
|
2183
|
-
while (++index < length) {
|
|
2184
|
-
if (array[index] === value) {
|
|
2185
|
-
return index;
|
|
2186
|
-
}
|
|
2187
|
-
}
|
|
2188
|
-
return -1;
|
|
2189
|
-
}
|
|
2190
|
-
var _strictIndexOf = strictIndexOf$1;
|
|
2191
|
-
var baseFindIndex = _baseFindIndex, baseIsNaN = _baseIsNaN, strictIndexOf = _strictIndexOf;
|
|
2192
|
-
function baseIndexOf$2(array, value, fromIndex) {
|
|
2193
|
-
return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
|
|
2194
|
-
}
|
|
2195
|
-
var _baseIndexOf = baseIndexOf$2;
|
|
2196
|
-
var baseIndexOf$1 = _baseIndexOf;
|
|
2197
|
-
function charsEndIndex$1(strSymbols, chrSymbols) {
|
|
2198
|
-
var index = strSymbols.length;
|
|
2199
|
-
while (index-- && baseIndexOf$1(chrSymbols, strSymbols[index], 0) > -1) {
|
|
2200
|
-
}
|
|
2201
|
-
return index;
|
|
2202
|
-
}
|
|
2203
|
-
var _charsEndIndex = charsEndIndex$1;
|
|
2204
|
-
var baseIndexOf = _baseIndexOf;
|
|
2205
|
-
function charsStartIndex$1(strSymbols, chrSymbols) {
|
|
2206
|
-
var index = -1, length = strSymbols.length;
|
|
2207
|
-
while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
|
|
2208
|
-
}
|
|
2209
|
-
return index;
|
|
2210
|
-
}
|
|
2211
|
-
var _charsStartIndex = charsStartIndex$1;
|
|
2212
|
-
function asciiToArray$1(string) {
|
|
2213
|
-
return string.split("");
|
|
2214
|
-
}
|
|
2215
|
-
var _asciiToArray = asciiToArray$1;
|
|
2216
|
-
var rsAstralRange$1 = "\\ud800-\\udfff", rsComboMarksRange$1 = "\\u0300-\\u036f", reComboHalfMarksRange$1 = "\\ufe20-\\ufe2f", rsComboSymbolsRange$1 = "\\u20d0-\\u20ff", rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1, rsVarRange$1 = "\\ufe0e\\ufe0f";
|
|
2217
|
-
var rsZWJ$1 = "\\u200d";
|
|
2218
|
-
var reHasUnicode = RegExp("[" + rsZWJ$1 + rsAstralRange$1 + rsComboRange$1 + rsVarRange$1 + "]");
|
|
2219
|
-
function hasUnicode$2(string) {
|
|
2220
|
-
return reHasUnicode.test(string);
|
|
2221
|
-
}
|
|
2222
|
-
var _hasUnicode = hasUnicode$2;
|
|
2223
|
-
var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsVarRange = "\\ufe0e\\ufe0f";
|
|
2224
|
-
var rsAstral = "[" + rsAstralRange + "]", rsCombo = "[" + rsComboRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsZWJ = "\\u200d";
|
|
2225
|
-
var reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
|
|
2226
|
-
var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
|
|
2227
|
-
function unicodeToArray$1(string) {
|
|
2228
|
-
return string.match(reUnicode) || [];
|
|
2229
|
-
}
|
|
2230
|
-
var _unicodeToArray = unicodeToArray$1;
|
|
2231
|
-
var asciiToArray = _asciiToArray, hasUnicode$1 = _hasUnicode, unicodeToArray = _unicodeToArray;
|
|
2232
|
-
function stringToArray$2(string) {
|
|
2233
|
-
return hasUnicode$1(string) ? unicodeToArray(string) : asciiToArray(string);
|
|
2234
|
-
}
|
|
2235
|
-
var _stringToArray = stringToArray$2;
|
|
2236
|
-
var baseToString$2 = _baseToString;
|
|
2237
|
-
function toString$2(value) {
|
|
2238
|
-
return value == null ? "" : baseToString$2(value);
|
|
2239
|
-
}
|
|
2240
|
-
var toString_1 = toString$2;
|
|
2241
|
-
var baseToString$1 = _baseToString, baseTrim = _baseTrim, castSlice$1 = _castSlice, charsEndIndex = _charsEndIndex, charsStartIndex = _charsStartIndex, stringToArray$1 = _stringToArray, toString$1 = toString_1;
|
|
2242
|
-
function trim(string, chars, guard) {
|
|
2243
|
-
string = toString$1(string);
|
|
2244
|
-
if (string && (guard || chars === void 0)) {
|
|
2245
|
-
return baseTrim(string);
|
|
2246
|
-
}
|
|
2247
|
-
if (!string || !(chars = baseToString$1(chars))) {
|
|
2248
|
-
return string;
|
|
2249
|
-
}
|
|
2250
|
-
var strSymbols = stringToArray$1(string), chrSymbols = stringToArray$1(chars), start2 = charsStartIndex(strSymbols, chrSymbols), end2 = charsEndIndex(strSymbols, chrSymbols) + 1;
|
|
2251
|
-
return castSlice$1(strSymbols, start2, end2).join("");
|
|
2252
|
-
}
|
|
2253
|
-
var trim_1 = trim;
|
|
2254
|
-
function joinClassNames(...classNames) {
|
|
2255
|
-
return (
|
|
2256
|
-
// convert passed in parameters to an array
|
|
2257
|
-
castArray_1(Array.from(classNames)).flat(Infinity).map((className) => typeof className === "string" ? trim_1(className) : className).filter(identity_1).join(" ")
|
|
2258
|
-
);
|
|
2259
|
-
}
|
|
2260
|
-
function handleEvent(func) {
|
|
2261
|
-
return (e) => {
|
|
2262
|
-
var _a;
|
|
2263
|
-
if (e.preventDefault) {
|
|
2264
|
-
e.preventDefault();
|
|
2265
|
-
}
|
|
2266
|
-
if (e.stopPropagation) {
|
|
2267
|
-
e.stopPropagation();
|
|
2268
|
-
}
|
|
2269
|
-
if ((_a = e == null ? void 0 : e.nativeEvent) == null ? void 0 : _a.stopImmediatePropagation) {
|
|
2270
|
-
e.nativeEvent.stopImmediatePropagation();
|
|
2271
|
-
}
|
|
2272
|
-
func.call(e.target, e);
|
|
2273
|
-
};
|
|
2015
|
+
propTypes$S.exports = requireFactoryWithThrowingShims()();
|
|
2274
2016
|
}
|
|
2275
|
-
const
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
contentClassName: propTypesExports.string,
|
|
2279
|
-
headerClassName: propTypesExports.string,
|
|
2280
|
-
headerContent: propTypesExports.node.isRequired,
|
|
2281
|
-
isOpen: propTypesExports.bool,
|
|
2282
|
-
onToggle: propTypesExports.func
|
|
2017
|
+
const BUTTON_APPEARANCE = {
|
|
2018
|
+
SOLID: "solid",
|
|
2019
|
+
OUTLINED: "outlined"
|
|
2283
2020
|
};
|
|
2284
|
-
const
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2021
|
+
const BUTTON_TYPES = {
|
|
2022
|
+
BUTTON: "button",
|
|
2023
|
+
RESET: "reset",
|
|
2024
|
+
SUBMIT: "submit"
|
|
2025
|
+
};
|
|
2026
|
+
const ICON_BUTTON_APPEARANCE = {
|
|
2027
|
+
SOLID: "solid",
|
|
2028
|
+
OUTLINED: "outlined",
|
|
2029
|
+
BORDERLESS: "borderless"
|
|
2290
2030
|
};
|
|
2291
|
-
function Accordion({
|
|
2292
|
-
children,
|
|
2293
|
-
className,
|
|
2294
|
-
contentClassName,
|
|
2295
|
-
headerClassName,
|
|
2296
|
-
headerContent,
|
|
2297
|
-
isOpen,
|
|
2298
|
-
onToggle
|
|
2299
|
-
}) {
|
|
2300
|
-
const [stateIsOpen, setStateIsOpen] = useState(isOpen || false);
|
|
2301
|
-
useEffect(() => {
|
|
2302
|
-
setStateIsOpen(isOpen);
|
|
2303
|
-
}, [isOpen]);
|
|
2304
|
-
function toggleAccordion() {
|
|
2305
|
-
if (onToggle) {
|
|
2306
|
-
onToggle(stateIsOpen);
|
|
2307
|
-
} else {
|
|
2308
|
-
setStateIsOpen(!stateIsOpen);
|
|
2309
|
-
}
|
|
2310
|
-
}
|
|
2311
|
-
return /* @__PURE__ */ jsxs("div", { className: joinClassNames(["accordion", className]), children: [
|
|
2312
|
-
/* @__PURE__ */ jsxs(
|
|
2313
|
-
"button",
|
|
2314
|
-
{
|
|
2315
|
-
className: joinClassNames(["accordion__header", headerClassName]),
|
|
2316
|
-
type: "button",
|
|
2317
|
-
onClick: handleEvent(toggleAccordion),
|
|
2318
|
-
children: [
|
|
2319
|
-
headerContent,
|
|
2320
|
-
/* @__PURE__ */ jsx("span", { className: `material-symbols-outlined icon-button__icon ${stateIsOpen ? "" : "icon-button__icon--rotate180"}`, children: "expand_circle_down" })
|
|
2321
|
-
]
|
|
2322
|
-
}
|
|
2323
|
-
),
|
|
2324
|
-
/* @__PURE__ */ jsx("div", { className: joinClassNames(["accordion__content", contentClassName, stateIsOpen ? "accordion__content--open" : ""]), children })
|
|
2325
|
-
] });
|
|
2326
|
-
}
|
|
2327
|
-
Accordion.propTypes = propTypes$P;
|
|
2328
|
-
Accordion.defaultProps = defaultProps$P;
|
|
2329
2031
|
const componentColors = {
|
|
2330
2032
|
PRIMARY: "primary",
|
|
2331
2033
|
SECONDARY: "secondary",
|
|
@@ -2347,7 +2049,252 @@ const RefShape = propTypesExports.oneOfType([
|
|
|
2347
2049
|
// Or the instance of a DOM native element (see the note about SSR)
|
|
2348
2050
|
propTypesExports.shape({ current: propTypesExports.instanceOf(Element) })
|
|
2349
2051
|
]);
|
|
2350
|
-
|
|
2052
|
+
function handleEvent(func) {
|
|
2053
|
+
return (e) => {
|
|
2054
|
+
var _a;
|
|
2055
|
+
if (e.preventDefault) {
|
|
2056
|
+
e.preventDefault();
|
|
2057
|
+
}
|
|
2058
|
+
if (e.stopPropagation) {
|
|
2059
|
+
e.stopPropagation();
|
|
2060
|
+
}
|
|
2061
|
+
if ((_a = e == null ? void 0 : e.nativeEvent) == null ? void 0 : _a.stopImmediatePropagation) {
|
|
2062
|
+
e.nativeEvent.stopImmediatePropagation();
|
|
2063
|
+
}
|
|
2064
|
+
func.call(e.target, e);
|
|
2065
|
+
};
|
|
2066
|
+
}
|
|
2067
|
+
var isArray$5 = Array.isArray;
|
|
2068
|
+
var isArray_1 = isArray$5;
|
|
2069
|
+
var isArray$4 = isArray_1;
|
|
2070
|
+
function castArray() {
|
|
2071
|
+
if (!arguments.length) {
|
|
2072
|
+
return [];
|
|
2073
|
+
}
|
|
2074
|
+
var value = arguments[0];
|
|
2075
|
+
return isArray$4(value) ? value : [value];
|
|
2076
|
+
}
|
|
2077
|
+
var castArray_1 = castArray;
|
|
2078
|
+
function identity(value) {
|
|
2079
|
+
return value;
|
|
2080
|
+
}
|
|
2081
|
+
var identity_1 = identity;
|
|
2082
|
+
var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
2083
|
+
var _freeGlobal = freeGlobal$1;
|
|
2084
|
+
var freeGlobal = _freeGlobal;
|
|
2085
|
+
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
2086
|
+
var root$8 = freeGlobal || freeSelf || Function("return this")();
|
|
2087
|
+
var _root = root$8;
|
|
2088
|
+
var root$7 = _root;
|
|
2089
|
+
var Symbol$5 = root$7.Symbol;
|
|
2090
|
+
var _Symbol = Symbol$5;
|
|
2091
|
+
function arrayMap$1(array, iteratee) {
|
|
2092
|
+
var index = -1, length = array == null ? 0 : array.length, result = Array(length);
|
|
2093
|
+
while (++index < length) {
|
|
2094
|
+
result[index] = iteratee(array[index], index, array);
|
|
2095
|
+
}
|
|
2096
|
+
return result;
|
|
2097
|
+
}
|
|
2098
|
+
var _arrayMap = arrayMap$1;
|
|
2099
|
+
var Symbol$4 = _Symbol;
|
|
2100
|
+
var objectProto$c = Object.prototype;
|
|
2101
|
+
var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
|
|
2102
|
+
var nativeObjectToString$1 = objectProto$c.toString;
|
|
2103
|
+
var symToStringTag$1 = Symbol$4 ? Symbol$4.toStringTag : void 0;
|
|
2104
|
+
function getRawTag$1(value) {
|
|
2105
|
+
var isOwn = hasOwnProperty$9.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
|
2106
|
+
try {
|
|
2107
|
+
value[symToStringTag$1] = void 0;
|
|
2108
|
+
var unmasked = true;
|
|
2109
|
+
} catch (e) {
|
|
2110
|
+
}
|
|
2111
|
+
var result = nativeObjectToString$1.call(value);
|
|
2112
|
+
if (unmasked) {
|
|
2113
|
+
if (isOwn) {
|
|
2114
|
+
value[symToStringTag$1] = tag;
|
|
2115
|
+
} else {
|
|
2116
|
+
delete value[symToStringTag$1];
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
return result;
|
|
2120
|
+
}
|
|
2121
|
+
var _getRawTag = getRawTag$1;
|
|
2122
|
+
var objectProto$b = Object.prototype;
|
|
2123
|
+
var nativeObjectToString = objectProto$b.toString;
|
|
2124
|
+
function objectToString$1(value) {
|
|
2125
|
+
return nativeObjectToString.call(value);
|
|
2126
|
+
}
|
|
2127
|
+
var _objectToString = objectToString$1;
|
|
2128
|
+
var Symbol$3 = _Symbol, getRawTag = _getRawTag, objectToString = _objectToString;
|
|
2129
|
+
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
|
|
2130
|
+
var symToStringTag = Symbol$3 ? Symbol$3.toStringTag : void 0;
|
|
2131
|
+
function baseGetTag$6(value) {
|
|
2132
|
+
if (value == null) {
|
|
2133
|
+
return value === void 0 ? undefinedTag : nullTag;
|
|
2134
|
+
}
|
|
2135
|
+
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
2136
|
+
}
|
|
2137
|
+
var _baseGetTag = baseGetTag$6;
|
|
2138
|
+
function isObjectLike$7(value) {
|
|
2139
|
+
return value != null && typeof value == "object";
|
|
2140
|
+
}
|
|
2141
|
+
var isObjectLike_1 = isObjectLike$7;
|
|
2142
|
+
var baseGetTag$5 = _baseGetTag, isObjectLike$6 = isObjectLike_1;
|
|
2143
|
+
var symbolTag$2 = "[object Symbol]";
|
|
2144
|
+
function isSymbol$1(value) {
|
|
2145
|
+
return typeof value == "symbol" || isObjectLike$6(value) && baseGetTag$5(value) == symbolTag$2;
|
|
2146
|
+
}
|
|
2147
|
+
var isSymbol_1 = isSymbol$1;
|
|
2148
|
+
var Symbol$2 = _Symbol, arrayMap = _arrayMap, isArray$3 = isArray_1, isSymbol = isSymbol_1;
|
|
2149
|
+
var INFINITY$1 = 1 / 0;
|
|
2150
|
+
var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolToString = symbolProto$1 ? symbolProto$1.toString : void 0;
|
|
2151
|
+
function baseToString$3(value) {
|
|
2152
|
+
if (typeof value == "string") {
|
|
2153
|
+
return value;
|
|
2154
|
+
}
|
|
2155
|
+
if (isArray$3(value)) {
|
|
2156
|
+
return arrayMap(value, baseToString$3) + "";
|
|
2157
|
+
}
|
|
2158
|
+
if (isSymbol(value)) {
|
|
2159
|
+
return symbolToString ? symbolToString.call(value) : "";
|
|
2160
|
+
}
|
|
2161
|
+
var result = value + "";
|
|
2162
|
+
return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
|
|
2163
|
+
}
|
|
2164
|
+
var _baseToString = baseToString$3;
|
|
2165
|
+
var reWhitespace = /\s/;
|
|
2166
|
+
function trimmedEndIndex$1(string) {
|
|
2167
|
+
var index = string.length;
|
|
2168
|
+
while (index-- && reWhitespace.test(string.charAt(index))) {
|
|
2169
|
+
}
|
|
2170
|
+
return index;
|
|
2171
|
+
}
|
|
2172
|
+
var _trimmedEndIndex = trimmedEndIndex$1;
|
|
2173
|
+
var trimmedEndIndex = _trimmedEndIndex;
|
|
2174
|
+
var reTrimStart = /^\s+/;
|
|
2175
|
+
function baseTrim$1(string) {
|
|
2176
|
+
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
|
|
2177
|
+
}
|
|
2178
|
+
var _baseTrim = baseTrim$1;
|
|
2179
|
+
function baseSlice$1(array, start2, end2) {
|
|
2180
|
+
var index = -1, length = array.length;
|
|
2181
|
+
if (start2 < 0) {
|
|
2182
|
+
start2 = -start2 > length ? 0 : length + start2;
|
|
2183
|
+
}
|
|
2184
|
+
end2 = end2 > length ? length : end2;
|
|
2185
|
+
if (end2 < 0) {
|
|
2186
|
+
end2 += length;
|
|
2187
|
+
}
|
|
2188
|
+
length = start2 > end2 ? 0 : end2 - start2 >>> 0;
|
|
2189
|
+
start2 >>>= 0;
|
|
2190
|
+
var result = Array(length);
|
|
2191
|
+
while (++index < length) {
|
|
2192
|
+
result[index] = array[index + start2];
|
|
2193
|
+
}
|
|
2194
|
+
return result;
|
|
2195
|
+
}
|
|
2196
|
+
var _baseSlice = baseSlice$1;
|
|
2197
|
+
var baseSlice = _baseSlice;
|
|
2198
|
+
function castSlice$2(array, start2, end2) {
|
|
2199
|
+
var length = array.length;
|
|
2200
|
+
end2 = end2 === void 0 ? length : end2;
|
|
2201
|
+
return !start2 && end2 >= length ? array : baseSlice(array, start2, end2);
|
|
2202
|
+
}
|
|
2203
|
+
var _castSlice = castSlice$2;
|
|
2204
|
+
function baseFindIndex$1(array, predicate, fromIndex, fromRight) {
|
|
2205
|
+
var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
|
|
2206
|
+
while (fromRight ? index-- : ++index < length) {
|
|
2207
|
+
if (predicate(array[index], index, array)) {
|
|
2208
|
+
return index;
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
return -1;
|
|
2212
|
+
}
|
|
2213
|
+
var _baseFindIndex = baseFindIndex$1;
|
|
2214
|
+
function baseIsNaN$1(value) {
|
|
2215
|
+
return value !== value;
|
|
2216
|
+
}
|
|
2217
|
+
var _baseIsNaN = baseIsNaN$1;
|
|
2218
|
+
function strictIndexOf$1(array, value, fromIndex) {
|
|
2219
|
+
var index = fromIndex - 1, length = array.length;
|
|
2220
|
+
while (++index < length) {
|
|
2221
|
+
if (array[index] === value) {
|
|
2222
|
+
return index;
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
return -1;
|
|
2226
|
+
}
|
|
2227
|
+
var _strictIndexOf = strictIndexOf$1;
|
|
2228
|
+
var baseFindIndex = _baseFindIndex, baseIsNaN = _baseIsNaN, strictIndexOf = _strictIndexOf;
|
|
2229
|
+
function baseIndexOf$3(array, value, fromIndex) {
|
|
2230
|
+
return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
|
|
2231
|
+
}
|
|
2232
|
+
var _baseIndexOf = baseIndexOf$3;
|
|
2233
|
+
var baseIndexOf$2 = _baseIndexOf;
|
|
2234
|
+
function charsEndIndex$1(strSymbols, chrSymbols) {
|
|
2235
|
+
var index = strSymbols.length;
|
|
2236
|
+
while (index-- && baseIndexOf$2(chrSymbols, strSymbols[index], 0) > -1) {
|
|
2237
|
+
}
|
|
2238
|
+
return index;
|
|
2239
|
+
}
|
|
2240
|
+
var _charsEndIndex = charsEndIndex$1;
|
|
2241
|
+
var baseIndexOf$1 = _baseIndexOf;
|
|
2242
|
+
function charsStartIndex$1(strSymbols, chrSymbols) {
|
|
2243
|
+
var index = -1, length = strSymbols.length;
|
|
2244
|
+
while (++index < length && baseIndexOf$1(chrSymbols, strSymbols[index], 0) > -1) {
|
|
2245
|
+
}
|
|
2246
|
+
return index;
|
|
2247
|
+
}
|
|
2248
|
+
var _charsStartIndex = charsStartIndex$1;
|
|
2249
|
+
function asciiToArray$1(string) {
|
|
2250
|
+
return string.split("");
|
|
2251
|
+
}
|
|
2252
|
+
var _asciiToArray = asciiToArray$1;
|
|
2253
|
+
var rsAstralRange$1 = "\\ud800-\\udfff", rsComboMarksRange$1 = "\\u0300-\\u036f", reComboHalfMarksRange$1 = "\\ufe20-\\ufe2f", rsComboSymbolsRange$1 = "\\u20d0-\\u20ff", rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1, rsVarRange$1 = "\\ufe0e\\ufe0f";
|
|
2254
|
+
var rsZWJ$1 = "\\u200d";
|
|
2255
|
+
var reHasUnicode = RegExp("[" + rsZWJ$1 + rsAstralRange$1 + rsComboRange$1 + rsVarRange$1 + "]");
|
|
2256
|
+
function hasUnicode$2(string) {
|
|
2257
|
+
return reHasUnicode.test(string);
|
|
2258
|
+
}
|
|
2259
|
+
var _hasUnicode = hasUnicode$2;
|
|
2260
|
+
var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsVarRange = "\\ufe0e\\ufe0f";
|
|
2261
|
+
var rsAstral = "[" + rsAstralRange + "]", rsCombo = "[" + rsComboRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsZWJ = "\\u200d";
|
|
2262
|
+
var reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
|
|
2263
|
+
var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
|
|
2264
|
+
function unicodeToArray$1(string) {
|
|
2265
|
+
return string.match(reUnicode) || [];
|
|
2266
|
+
}
|
|
2267
|
+
var _unicodeToArray = unicodeToArray$1;
|
|
2268
|
+
var asciiToArray = _asciiToArray, hasUnicode$1 = _hasUnicode, unicodeToArray = _unicodeToArray;
|
|
2269
|
+
function stringToArray$2(string) {
|
|
2270
|
+
return hasUnicode$1(string) ? unicodeToArray(string) : asciiToArray(string);
|
|
2271
|
+
}
|
|
2272
|
+
var _stringToArray = stringToArray$2;
|
|
2273
|
+
var baseToString$2 = _baseToString;
|
|
2274
|
+
function toString$2(value) {
|
|
2275
|
+
return value == null ? "" : baseToString$2(value);
|
|
2276
|
+
}
|
|
2277
|
+
var toString_1 = toString$2;
|
|
2278
|
+
var baseToString$1 = _baseToString, baseTrim = _baseTrim, castSlice$1 = _castSlice, charsEndIndex = _charsEndIndex, charsStartIndex = _charsStartIndex, stringToArray$1 = _stringToArray, toString$1 = toString_1;
|
|
2279
|
+
function trim(string, chars, guard) {
|
|
2280
|
+
string = toString$1(string);
|
|
2281
|
+
if (string && (guard || chars === void 0)) {
|
|
2282
|
+
return baseTrim(string);
|
|
2283
|
+
}
|
|
2284
|
+
if (!string || !(chars = baseToString$1(chars))) {
|
|
2285
|
+
return string;
|
|
2286
|
+
}
|
|
2287
|
+
var strSymbols = stringToArray$1(string), chrSymbols = stringToArray$1(chars), start2 = charsStartIndex(strSymbols, chrSymbols), end2 = charsEndIndex(strSymbols, chrSymbols) + 1;
|
|
2288
|
+
return castSlice$1(strSymbols, start2, end2).join("");
|
|
2289
|
+
}
|
|
2290
|
+
var trim_1 = trim;
|
|
2291
|
+
function joinClassNames(...classNames) {
|
|
2292
|
+
return (
|
|
2293
|
+
// convert passed in parameters to an array
|
|
2294
|
+
castArray_1(Array.from(classNames)).flat(Infinity).map((className) => typeof className === "string" ? trim_1(className) : className).filter(identity_1).join(" ")
|
|
2295
|
+
);
|
|
2296
|
+
}
|
|
2297
|
+
const propTypes$R = {
|
|
2351
2298
|
children: propTypesExports.node,
|
|
2352
2299
|
className: propTypesExports.string,
|
|
2353
2300
|
id: propTypesExports.string,
|
|
@@ -2365,7 +2312,7 @@ const propTypes$O = {
|
|
|
2365
2312
|
return false;
|
|
2366
2313
|
}
|
|
2367
2314
|
};
|
|
2368
|
-
const defaultProps$
|
|
2315
|
+
const defaultProps$R = {
|
|
2369
2316
|
children: null,
|
|
2370
2317
|
className: null,
|
|
2371
2318
|
id: null,
|
|
@@ -2408,9 +2355,9 @@ function Spinner({
|
|
|
2408
2355
|
}
|
|
2409
2356
|
);
|
|
2410
2357
|
}
|
|
2411
|
-
Spinner.propTypes = propTypes$
|
|
2412
|
-
Spinner.defaultProps = defaultProps$
|
|
2413
|
-
const propTypes$
|
|
2358
|
+
Spinner.propTypes = propTypes$R;
|
|
2359
|
+
Spinner.defaultProps = defaultProps$R;
|
|
2360
|
+
const propTypes$Q = {
|
|
2414
2361
|
// the appearance of the button
|
|
2415
2362
|
appearance: propTypesExports.oneOf([
|
|
2416
2363
|
BUTTON_APPEARANCE.OUTLINED,
|
|
@@ -2454,7 +2401,7 @@ const propTypes$N = {
|
|
|
2454
2401
|
BUTTON_TYPES.SUBMIT
|
|
2455
2402
|
])
|
|
2456
2403
|
};
|
|
2457
|
-
const defaultProps$
|
|
2404
|
+
const defaultProps$Q = {
|
|
2458
2405
|
appearance: BUTTON_APPEARANCE.OUTLINED,
|
|
2459
2406
|
className: null,
|
|
2460
2407
|
color: componentColors.NONE,
|
|
@@ -2511,257 +2458,9 @@ function Button({
|
|
|
2511
2458
|
}
|
|
2512
2459
|
);
|
|
2513
2460
|
}
|
|
2514
|
-
Button.propTypes = propTypes$
|
|
2515
|
-
Button.defaultProps = defaultProps$
|
|
2516
|
-
|
|
2517
|
-
return (menuItems || []).map((menuItem2) => {
|
|
2518
|
-
const menuItemLink = menuItem2.link || `menuHeader::${menuItem2.title}`;
|
|
2519
|
-
return {
|
|
2520
|
-
...menuItem2,
|
|
2521
|
-
link: menuItemLink,
|
|
2522
|
-
parentLinks: [...menuItem2.parentLinks || [], ...parentLinks],
|
|
2523
|
-
children: menuItem2.children && calculateMenuItemsParents({
|
|
2524
|
-
parentLinks: [
|
|
2525
|
-
...menuItem2.parentLinks || [],
|
|
2526
|
-
...parentLinks,
|
|
2527
|
-
menuItemLink
|
|
2528
|
-
].filter(identity_1),
|
|
2529
|
-
menuItems: menuItem2.children
|
|
2530
|
-
})
|
|
2531
|
-
};
|
|
2532
|
-
});
|
|
2533
|
-
}
|
|
2534
|
-
const FormContext = React__default.createContext();
|
|
2535
|
-
function eq$3(value, other) {
|
|
2536
|
-
return value === other || value !== value && other !== other;
|
|
2537
|
-
}
|
|
2538
|
-
var eq_1 = eq$3;
|
|
2539
|
-
function isObject$6(value) {
|
|
2540
|
-
var type2 = typeof value;
|
|
2541
|
-
return value != null && (type2 == "object" || type2 == "function");
|
|
2542
|
-
}
|
|
2543
|
-
var isObject_1 = isObject$6;
|
|
2544
|
-
var baseGetTag$4 = _baseGetTag, isObject$5 = isObject_1;
|
|
2545
|
-
var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
|
|
2546
|
-
function isFunction$2(value) {
|
|
2547
|
-
if (!isObject$5(value)) {
|
|
2548
|
-
return false;
|
|
2549
|
-
}
|
|
2550
|
-
var tag = baseGetTag$4(value);
|
|
2551
|
-
return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
|
|
2552
|
-
}
|
|
2553
|
-
var isFunction_1 = isFunction$2;
|
|
2554
|
-
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
|
2555
|
-
function isLength$2(value) {
|
|
2556
|
-
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
|
|
2557
|
-
}
|
|
2558
|
-
var isLength_1 = isLength$2;
|
|
2559
|
-
var isFunction$1 = isFunction_1, isLength$1 = isLength_1;
|
|
2560
|
-
function isArrayLike$3(value) {
|
|
2561
|
-
return value != null && isLength$1(value.length) && !isFunction$1(value);
|
|
2562
|
-
}
|
|
2563
|
-
var isArrayLike_1 = isArrayLike$3;
|
|
2564
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
2565
|
-
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
2566
|
-
function isIndex$2(value, length) {
|
|
2567
|
-
var type2 = typeof value;
|
|
2568
|
-
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
2569
|
-
return !!length && (type2 == "number" || type2 != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
2570
|
-
}
|
|
2571
|
-
var _isIndex = isIndex$2;
|
|
2572
|
-
var eq$2 = eq_1, isArrayLike$2 = isArrayLike_1, isIndex$1 = _isIndex, isObject$4 = isObject_1;
|
|
2573
|
-
function isIterateeCall$1(value, index, object) {
|
|
2574
|
-
if (!isObject$4(object)) {
|
|
2575
|
-
return false;
|
|
2576
|
-
}
|
|
2577
|
-
var type2 = typeof index;
|
|
2578
|
-
if (type2 == "number" ? isArrayLike$2(object) && isIndex$1(index, object.length) : type2 == "string" && index in object) {
|
|
2579
|
-
return eq$2(object[index], value);
|
|
2580
|
-
}
|
|
2581
|
-
return false;
|
|
2582
|
-
}
|
|
2583
|
-
var _isIterateeCall = isIterateeCall$1;
|
|
2584
|
-
var baseGetTag$3 = _baseGetTag, isObjectLike$5 = isObjectLike_1;
|
|
2585
|
-
var regexpTag$3 = "[object RegExp]";
|
|
2586
|
-
function baseIsRegExp$1(value) {
|
|
2587
|
-
return isObjectLike$5(value) && baseGetTag$3(value) == regexpTag$3;
|
|
2588
|
-
}
|
|
2589
|
-
var _baseIsRegExp = baseIsRegExp$1;
|
|
2590
|
-
function baseUnary$4(func) {
|
|
2591
|
-
return function(value) {
|
|
2592
|
-
return func(value);
|
|
2593
|
-
};
|
|
2594
|
-
}
|
|
2595
|
-
var _baseUnary = baseUnary$4;
|
|
2596
|
-
var _nodeUtilExports = {};
|
|
2597
|
-
var _nodeUtil = {
|
|
2598
|
-
get exports() {
|
|
2599
|
-
return _nodeUtilExports;
|
|
2600
|
-
},
|
|
2601
|
-
set exports(v) {
|
|
2602
|
-
_nodeUtilExports = v;
|
|
2603
|
-
}
|
|
2604
|
-
};
|
|
2605
|
-
(function(module, exports2) {
|
|
2606
|
-
var freeGlobal2 = _freeGlobal;
|
|
2607
|
-
var freeExports = exports2 && !exports2.nodeType && exports2;
|
|
2608
|
-
var freeModule = freeExports && true && module && !module.nodeType && module;
|
|
2609
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2610
|
-
var freeProcess = moduleExports && freeGlobal2.process;
|
|
2611
|
-
var nodeUtil2 = function() {
|
|
2612
|
-
try {
|
|
2613
|
-
var types = freeModule && freeModule.require && freeModule.require("util").types;
|
|
2614
|
-
if (types) {
|
|
2615
|
-
return types;
|
|
2616
|
-
}
|
|
2617
|
-
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
2618
|
-
} catch (e) {
|
|
2619
|
-
}
|
|
2620
|
-
}();
|
|
2621
|
-
module.exports = nodeUtil2;
|
|
2622
|
-
})(_nodeUtil, _nodeUtilExports);
|
|
2623
|
-
var baseIsRegExp = _baseIsRegExp, baseUnary$3 = _baseUnary, nodeUtil$3 = _nodeUtilExports;
|
|
2624
|
-
var nodeIsRegExp = nodeUtil$3 && nodeUtil$3.isRegExp;
|
|
2625
|
-
var isRegExp$1 = nodeIsRegExp ? baseUnary$3(nodeIsRegExp) : baseIsRegExp;
|
|
2626
|
-
var isRegExp_1 = isRegExp$1;
|
|
2627
|
-
var baseToString = _baseToString, castSlice = _castSlice, hasUnicode = _hasUnicode, isIterateeCall = _isIterateeCall, isRegExp = isRegExp_1, stringToArray = _stringToArray, toString = toString_1;
|
|
2628
|
-
var MAX_ARRAY_LENGTH = 4294967295;
|
|
2629
|
-
function split(string, separator, limit) {
|
|
2630
|
-
if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) {
|
|
2631
|
-
separator = limit = void 0;
|
|
2632
|
-
}
|
|
2633
|
-
limit = limit === void 0 ? MAX_ARRAY_LENGTH : limit >>> 0;
|
|
2634
|
-
if (!limit) {
|
|
2635
|
-
return [];
|
|
2636
|
-
}
|
|
2637
|
-
string = toString(string);
|
|
2638
|
-
if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) {
|
|
2639
|
-
separator = baseToString(separator);
|
|
2640
|
-
if (!separator && hasUnicode(string)) {
|
|
2641
|
-
return castSlice(stringToArray(string), 0, limit);
|
|
2642
|
-
}
|
|
2643
|
-
}
|
|
2644
|
-
return string.split(separator, limit);
|
|
2645
|
-
}
|
|
2646
|
-
var split_1 = split;
|
|
2647
|
-
function valueAtPath({ object, path }) {
|
|
2648
|
-
return split_1(path, ".").reduce((obj, field) => field && obj ? obj[field] : obj, object);
|
|
2649
|
-
}
|
|
2650
|
-
function onKeyPress({ targetKey, func }) {
|
|
2651
|
-
return (e) => {
|
|
2652
|
-
if (e.key === targetKey) {
|
|
2653
|
-
func(e);
|
|
2654
|
-
}
|
|
2655
|
-
};
|
|
2656
|
-
}
|
|
2657
|
-
function useCurrentValuesFromForm({
|
|
2658
|
-
errorMessage,
|
|
2659
|
-
id,
|
|
2660
|
-
onChange,
|
|
2661
|
-
onSubmit,
|
|
2662
|
-
value
|
|
2663
|
-
}) {
|
|
2664
|
-
if (!id) {
|
|
2665
|
-
console.error("useCurrentValuesFromForm: `id` is required");
|
|
2666
|
-
}
|
|
2667
|
-
const {
|
|
2668
|
-
onChange: contextOnChange,
|
|
2669
|
-
onSubmit: contextOnSubmit,
|
|
2670
|
-
state,
|
|
2671
|
-
validationErrors
|
|
2672
|
-
} = useContext(FormContext) || {};
|
|
2673
|
-
const currentOnSubmit = onSubmit ?? contextOnSubmit;
|
|
2674
|
-
return {
|
|
2675
|
-
currentErrorMessage: errorMessage ?? (validationErrors && validationErrors[id]),
|
|
2676
|
-
currentOnChange: onChange ?? (contextOnChange && ((e, newValue) => contextOnChange({ e, id, newValue }))),
|
|
2677
|
-
currentOnSubmit,
|
|
2678
|
-
currentValue: (value ?? (state && valueAtPath({ object: state, path: id }))) || "",
|
|
2679
|
-
currentOnFormKeyPress: onKeyPress({ targetKey: "Enter", func: (e) => currentOnSubmit && currentOnSubmit(e) })
|
|
2680
|
-
};
|
|
2681
|
-
}
|
|
2682
|
-
const propTypes$M = {
|
|
2683
|
-
errorMessage: propTypesExports.string,
|
|
2684
|
-
id: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.number]).isRequired
|
|
2685
|
-
};
|
|
2686
|
-
const defaultProps$M = {
|
|
2687
|
-
errorMessage: null
|
|
2688
|
-
};
|
|
2689
|
-
function ErrorMessage({ errorMessage, id }) {
|
|
2690
|
-
return errorMessage ? /* @__PURE__ */ jsx("div", { className: "input-wrapper__error-message", id: `${id}-error`, children: errorMessage }) : null;
|
|
2691
|
-
}
|
|
2692
|
-
ErrorMessage.propTypes = propTypes$M;
|
|
2693
|
-
ErrorMessage.defaultProps = defaultProps$M;
|
|
2694
|
-
const propTypes$L = {
|
|
2695
|
-
className: propTypesExports.string,
|
|
2696
|
-
errorMessage: propTypesExports.string,
|
|
2697
|
-
innerRef: RefShape,
|
|
2698
|
-
// id of the input; when tied to a Form the `id` is also the 'dot' path to the data in the form's state: ie person.contact.address.line1
|
|
2699
|
-
id: propTypesExports.string.isRequired,
|
|
2700
|
-
isDisabled: propTypesExports.bool,
|
|
2701
|
-
label: propTypesExports.string.isRequired,
|
|
2702
|
-
// e => ... do something with e.target.value ...; can be omitted so as to be uncontrolled OR if changes are sent through form's onChange
|
|
2703
|
-
onChange: propTypesExports.func,
|
|
2704
|
-
// when enter key pressed in field, submit the form
|
|
2705
|
-
onSubmit: propTypesExports.func,
|
|
2706
|
-
value: propTypesExports.bool
|
|
2707
|
-
};
|
|
2708
|
-
const defaultProps$L = {
|
|
2709
|
-
className: null,
|
|
2710
|
-
errorMessage: null,
|
|
2711
|
-
innerRef: null,
|
|
2712
|
-
isDisabled: false,
|
|
2713
|
-
onChange: null,
|
|
2714
|
-
onSubmit: null,
|
|
2715
|
-
value: null
|
|
2716
|
-
};
|
|
2717
|
-
function CheckBox({
|
|
2718
|
-
className,
|
|
2719
|
-
errorMessage,
|
|
2720
|
-
innerRef,
|
|
2721
|
-
id,
|
|
2722
|
-
isDisabled,
|
|
2723
|
-
label,
|
|
2724
|
-
onChange,
|
|
2725
|
-
onSubmit,
|
|
2726
|
-
value,
|
|
2727
|
-
...rest
|
|
2728
|
-
}) {
|
|
2729
|
-
const {
|
|
2730
|
-
currentErrorMessage,
|
|
2731
|
-
currentOnChange,
|
|
2732
|
-
currentOnFormKeyPress,
|
|
2733
|
-
currentValue
|
|
2734
|
-
} = useCurrentValuesFromForm({
|
|
2735
|
-
errorMessage,
|
|
2736
|
-
id,
|
|
2737
|
-
onChange,
|
|
2738
|
-
onSubmit,
|
|
2739
|
-
value
|
|
2740
|
-
});
|
|
2741
|
-
return /* @__PURE__ */ jsxs("div", { className: "input-wrapper input-wrapper--checkbox", children: [
|
|
2742
|
-
/* @__PURE__ */ jsx("label", { htmlFor: id, children: label }),
|
|
2743
|
-
/* @__PURE__ */ jsx(
|
|
2744
|
-
"input",
|
|
2745
|
-
{
|
|
2746
|
-
"aria-describedby": currentErrorMessage ? `${id}-error` : null,
|
|
2747
|
-
checked: currentValue,
|
|
2748
|
-
className,
|
|
2749
|
-
disabled: isDisabled,
|
|
2750
|
-
id,
|
|
2751
|
-
name: id,
|
|
2752
|
-
onChange: currentOnChange,
|
|
2753
|
-
onKeyPress: currentOnFormKeyPress,
|
|
2754
|
-
ref: innerRef,
|
|
2755
|
-
type: "checkbox",
|
|
2756
|
-
...rest
|
|
2757
|
-
}
|
|
2758
|
-
),
|
|
2759
|
-
/* @__PURE__ */ jsx(ErrorMessage, { errorMessage: currentErrorMessage, id })
|
|
2760
|
-
] });
|
|
2761
|
-
}
|
|
2762
|
-
CheckBox.propTypes = propTypes$L;
|
|
2763
|
-
CheckBox.defaultProps = defaultProps$L;
|
|
2764
|
-
const propTypes$K = {
|
|
2461
|
+
Button.propTypes = propTypes$Q;
|
|
2462
|
+
Button.defaultProps = defaultProps$Q;
|
|
2463
|
+
const propTypes$P = {
|
|
2765
2464
|
appearance: propTypesExports.oneOf(["solid", "outlined"]),
|
|
2766
2465
|
// most often is the title of the button, but can also contain most anything
|
|
2767
2466
|
children: propTypesExports.node.isRequired,
|
|
@@ -2786,7 +2485,7 @@ const propTypes$K = {
|
|
|
2786
2485
|
// button type
|
|
2787
2486
|
type: propTypesExports.oneOf(["button", "reset", "submit"])
|
|
2788
2487
|
};
|
|
2789
|
-
const defaultProps$
|
|
2488
|
+
const defaultProps$P = {
|
|
2790
2489
|
appearance: "outlined",
|
|
2791
2490
|
className: null,
|
|
2792
2491
|
color: "none",
|
|
@@ -2839,34 +2538,195 @@ function ConfirmationButton({
|
|
|
2839
2538
|
}
|
|
2840
2539
|
);
|
|
2841
2540
|
}
|
|
2842
|
-
ConfirmationButton.propTypes = propTypes$
|
|
2843
|
-
ConfirmationButton.defaultProps = defaultProps$
|
|
2844
|
-
const propTypes$
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2541
|
+
ConfirmationButton.propTypes = propTypes$P;
|
|
2542
|
+
ConfirmationButton.defaultProps = defaultProps$P;
|
|
2543
|
+
const propTypes$O = {
|
|
2544
|
+
// the appearance of the button
|
|
2545
|
+
appearance: propTypesExports.oneOf([
|
|
2546
|
+
ICON_BUTTON_APPEARANCE.OUTLINED,
|
|
2547
|
+
ICON_BUTTON_APPEARANCE.SOLID,
|
|
2548
|
+
ICON_BUTTON_APPEARANCE.BORDERLESS
|
|
2549
|
+
]),
|
|
2550
|
+
// css classes for the button
|
|
2551
|
+
className: propTypesExports.string,
|
|
2552
|
+
// the base color of the button
|
|
2553
|
+
color: propTypesExports.oneOf([
|
|
2554
|
+
componentColors.PRIMARY,
|
|
2555
|
+
componentColors.SECONDARY,
|
|
2556
|
+
componentColors.ACCENT,
|
|
2557
|
+
componentColors.NONE
|
|
2558
|
+
]),
|
|
2559
|
+
// the icon for the button
|
|
2560
|
+
icon: propTypesExports.node.isRequired,
|
|
2561
|
+
// the button id
|
|
2562
|
+
id: propTypesExports.string,
|
|
2563
|
+
// a ref to attach to the actual DOM <button> element
|
|
2564
|
+
innerRef: RefShape,
|
|
2565
|
+
// button isDisabled state
|
|
2566
|
+
isDisabled: propTypesExports.bool,
|
|
2567
|
+
// what to do when the button is clicked
|
|
2568
|
+
onClick: propTypesExports.func.isRequired,
|
|
2569
|
+
size: propTypesExports.oneOf([
|
|
2570
|
+
formElementSizesEnum.SMALL1X,
|
|
2571
|
+
formElementSizesEnum.SMALL,
|
|
2572
|
+
formElementSizesEnum.MEDIUM,
|
|
2573
|
+
formElementSizesEnum.LARGE,
|
|
2574
|
+
formElementSizesEnum.LARGE1X
|
|
2575
|
+
]),
|
|
2576
|
+
// A title is used for accessibility purposes to describe the button for screen readers
|
|
2577
|
+
title: propTypesExports.string.isRequired
|
|
2578
|
+
};
|
|
2579
|
+
const defaultProps$O = {
|
|
2580
|
+
appearance: ICON_BUTTON_APPEARANCE.OUTLINED,
|
|
2581
|
+
className: null,
|
|
2582
|
+
color: componentColors.NONE,
|
|
2583
|
+
id: null,
|
|
2584
|
+
innerRef: null,
|
|
2585
|
+
isDisabled: false,
|
|
2586
|
+
size: formElementSizesEnum.MEDIUM
|
|
2587
|
+
};
|
|
2588
|
+
function IconButton({
|
|
2589
|
+
appearance,
|
|
2590
|
+
className,
|
|
2591
|
+
color,
|
|
2592
|
+
icon,
|
|
2593
|
+
id,
|
|
2594
|
+
innerRef,
|
|
2595
|
+
isDisabled,
|
|
2596
|
+
onClick,
|
|
2597
|
+
size,
|
|
2598
|
+
title,
|
|
2599
|
+
...rest
|
|
2600
|
+
}) {
|
|
2601
|
+
return /* @__PURE__ */ jsxs(
|
|
2602
|
+
"button",
|
|
2603
|
+
{
|
|
2604
|
+
className: joinClassNames(
|
|
2605
|
+
"button icon-button",
|
|
2606
|
+
className,
|
|
2607
|
+
`${appearance === ICON_BUTTON_APPEARANCE.BORDERLESS ? "icon-button--" : "button--"}${appearance}`,
|
|
2608
|
+
// default color is none
|
|
2609
|
+
color && color !== "none" ? `button--${color}-color` : null,
|
|
2610
|
+
// default size is medium
|
|
2611
|
+
size && size !== formElementSizesEnum.MEDIUM ? `icon-button--${size}` : null
|
|
2612
|
+
),
|
|
2613
|
+
disabled: isDisabled,
|
|
2614
|
+
id,
|
|
2615
|
+
onClick: handleEvent(onClick),
|
|
2616
|
+
ref: innerRef,
|
|
2617
|
+
type: "button",
|
|
2618
|
+
...rest,
|
|
2619
|
+
children: [
|
|
2620
|
+
icon,
|
|
2621
|
+
/* @__PURE__ */ jsx("span", { className: "visually-hidden", children: title })
|
|
2622
|
+
]
|
|
2623
|
+
}
|
|
2624
|
+
);
|
|
2625
|
+
}
|
|
2626
|
+
IconButton.propTypes = propTypes$O;
|
|
2627
|
+
IconButton.defaultProps = defaultProps$O;
|
|
2628
|
+
const SegmentedButton = () => null;
|
|
2629
|
+
const propTypes$N = {
|
|
2630
|
+
children: propTypesExports.node.isRequired,
|
|
2631
|
+
className: propTypesExports.string,
|
|
2632
|
+
contentClassName: propTypesExports.string,
|
|
2633
|
+
headerClassName: propTypesExports.string,
|
|
2634
|
+
headerContent: propTypesExports.node.isRequired,
|
|
2635
|
+
isOpen: propTypesExports.bool,
|
|
2636
|
+
onToggle: propTypesExports.func
|
|
2637
|
+
};
|
|
2638
|
+
const defaultProps$N = {
|
|
2639
|
+
className: void 0,
|
|
2640
|
+
contentClassName: void 0,
|
|
2641
|
+
headerClassName: void 0,
|
|
2642
|
+
isOpen: void 0,
|
|
2643
|
+
onToggle: void 0
|
|
2644
|
+
};
|
|
2645
|
+
function Accordion({
|
|
2646
|
+
children,
|
|
2647
|
+
className,
|
|
2648
|
+
contentClassName,
|
|
2649
|
+
headerClassName,
|
|
2650
|
+
headerContent,
|
|
2651
|
+
isOpen,
|
|
2652
|
+
onToggle
|
|
2653
|
+
}) {
|
|
2654
|
+
const [stateIsOpen, setStateIsOpen] = useState(isOpen || false);
|
|
2655
|
+
useEffect(() => {
|
|
2656
|
+
setStateIsOpen(isOpen);
|
|
2657
|
+
}, [isOpen]);
|
|
2658
|
+
function toggleAccordion() {
|
|
2659
|
+
if (onToggle) {
|
|
2660
|
+
onToggle(stateIsOpen);
|
|
2661
|
+
} else {
|
|
2662
|
+
setStateIsOpen(!stateIsOpen);
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2665
|
+
return /* @__PURE__ */ jsxs("div", { className: joinClassNames(["accordion", className]), children: [
|
|
2666
|
+
/* @__PURE__ */ jsxs(
|
|
2667
|
+
"button",
|
|
2668
|
+
{
|
|
2669
|
+
className: joinClassNames(["accordion__header", headerClassName]),
|
|
2670
|
+
type: "button",
|
|
2671
|
+
onClick: handleEvent(toggleAccordion),
|
|
2672
|
+
children: [
|
|
2673
|
+
headerContent,
|
|
2674
|
+
/* @__PURE__ */ jsx("span", { className: `material-symbols-outlined icon-button__icon ${stateIsOpen ? "" : "icon-button__icon--rotate180"}`, children: "expand_circle_down" })
|
|
2675
|
+
]
|
|
2676
|
+
}
|
|
2677
|
+
),
|
|
2678
|
+
/* @__PURE__ */ jsx("div", { className: joinClassNames(["accordion__content", contentClassName, stateIsOpen ? "accordion__content--open" : ""]), children })
|
|
2679
|
+
] });
|
|
2680
|
+
}
|
|
2681
|
+
Accordion.propTypes = propTypes$N;
|
|
2682
|
+
Accordion.defaultProps = defaultProps$N;
|
|
2683
|
+
const TabGroupContext = React__default.createContext();
|
|
2684
|
+
const propTypes$M = {
|
|
2685
|
+
children: propTypesExports.node.isRequired,
|
|
2686
|
+
// a tab id must be provided for accessibility and selecting tab
|
|
2687
|
+
id: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string]).isRequired
|
|
2688
|
+
};
|
|
2689
|
+
const defaultProps$M = {};
|
|
2690
|
+
function Tab({ children, id }) {
|
|
2691
|
+
const {
|
|
2692
|
+
selectedTabId,
|
|
2693
|
+
setSelectedTabId,
|
|
2694
|
+
tabGroupId
|
|
2695
|
+
} = useContext(TabGroupContext);
|
|
2696
|
+
return /* @__PURE__ */ jsx(
|
|
2697
|
+
"div",
|
|
2698
|
+
{
|
|
2699
|
+
className: joinClassNames(
|
|
2700
|
+
selectedTabId === id && "tab-group__tab--selected",
|
|
2701
|
+
"tab-group__tab"
|
|
2702
|
+
),
|
|
2703
|
+
children: /* @__PURE__ */ jsx(
|
|
2704
|
+
"button",
|
|
2705
|
+
{
|
|
2706
|
+
"aria-controls": `tabpanel-${tabGroupId}-${id}`,
|
|
2707
|
+
"aria-selected": selectedTabId === id,
|
|
2708
|
+
className: joinClassNames(
|
|
2709
|
+
selectedTabId === id && "tab-group__tab-button--selected",
|
|
2710
|
+
"tab-group__tab-button"
|
|
2711
|
+
),
|
|
2712
|
+
id: `tab-${tabGroupId}-${id}`,
|
|
2713
|
+
onClick: handleEvent(() => setSelectedTabId(id)),
|
|
2714
|
+
role: "tab",
|
|
2715
|
+
tabIndex: "-1",
|
|
2716
|
+
type: "button",
|
|
2717
|
+
children
|
|
2718
|
+
}
|
|
2719
|
+
)
|
|
2720
|
+
}
|
|
2721
|
+
);
|
|
2722
|
+
}
|
|
2723
|
+
Tab.propTypes = propTypes$M;
|
|
2724
|
+
Tab.defaultProps = defaultProps$M;
|
|
2725
|
+
var NOTHING = Symbol.for("immer-nothing");
|
|
2726
|
+
var DRAFTABLE = Symbol.for("immer-draftable");
|
|
2727
|
+
var DRAFT_STATE = Symbol.for("immer-state");
|
|
2728
|
+
var errors = process.env.NODE_ENV !== "production" ? [
|
|
2729
|
+
// All error codes, starting by 0:
|
|
2870
2730
|
function(plugin) {
|
|
2871
2731
|
return `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \`enable${plugin}()\` when initializing your application.`;
|
|
2872
2732
|
},
|
|
@@ -3536,148 +3396,501 @@ function i(f) {
|
|
|
3536
3396
|
i2("function" == typeof t ? produce(t) : freeze(t));
|
|
3537
3397
|
}, [])];
|
|
3538
3398
|
}
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3399
|
+
const propTypes$L = {
|
|
3400
|
+
children: propTypesExports.node.isRequired,
|
|
3401
|
+
className: propTypesExports.string,
|
|
3402
|
+
defaultValue: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string]),
|
|
3403
|
+
onChange: propTypesExports.func,
|
|
3404
|
+
// value is the currentSelectedTabIndex number
|
|
3405
|
+
value: propTypesExports.number
|
|
3406
|
+
};
|
|
3407
|
+
const defaultProps$L = {
|
|
3408
|
+
className: null,
|
|
3409
|
+
defaultValue: null,
|
|
3410
|
+
onChange: null,
|
|
3411
|
+
value: null
|
|
3412
|
+
};
|
|
3413
|
+
let nextTabGroupId = 0;
|
|
3414
|
+
function TabGroup({
|
|
3415
|
+
children,
|
|
3416
|
+
className,
|
|
3417
|
+
defaultValue,
|
|
3418
|
+
onChange,
|
|
3419
|
+
value
|
|
3420
|
+
}) {
|
|
3421
|
+
const [tabGroupState, setTabGroupState] = i(() => {
|
|
3422
|
+
nextTabGroupId += 1;
|
|
3423
|
+
return {
|
|
3424
|
+
selectedTabId: defaultValue || NaN,
|
|
3425
|
+
tabGroupId: nextTabGroupId
|
|
3426
|
+
};
|
|
3427
|
+
});
|
|
3428
|
+
const contextValue = useMemo(
|
|
3429
|
+
() => ({
|
|
3430
|
+
tabGroupId: tabGroupState.tabGroupId,
|
|
3431
|
+
selectedTabId: value || tabGroupState.selectedTabId,
|
|
3432
|
+
setSelectedTabId: (tabId) => {
|
|
3433
|
+
if (onChange) {
|
|
3434
|
+
onChange(tabId);
|
|
3435
|
+
} else {
|
|
3436
|
+
setTabGroupState((draftState) => {
|
|
3437
|
+
draftState.selectedTabId = tabId;
|
|
3438
|
+
});
|
|
3439
|
+
}
|
|
3440
|
+
}
|
|
3441
|
+
}),
|
|
3442
|
+
[tabGroupState, value]
|
|
3443
|
+
);
|
|
3444
|
+
return /* @__PURE__ */ jsx(TabGroupContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx("div", { className: joinClassNames("tab-group", className), id: `tab-group-${tabGroupState.id}`, children }) });
|
|
3542
3445
|
}
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3446
|
+
TabGroup.propTypes = propTypes$L;
|
|
3447
|
+
TabGroup.defaultProps = defaultProps$L;
|
|
3448
|
+
const propTypes$K = {
|
|
3449
|
+
children: propTypesExports.node.isRequired,
|
|
3450
|
+
className: propTypesExports.string,
|
|
3451
|
+
tagName: propTypesExports.string
|
|
3452
|
+
};
|
|
3453
|
+
const defaultProps$K = {
|
|
3454
|
+
className: null,
|
|
3455
|
+
tagName: "div"
|
|
3456
|
+
};
|
|
3457
|
+
function TabGroupTitle({ children, className, tagName: TagName }) {
|
|
3458
|
+
const { tabGroupId } = useContext(TabGroupContext);
|
|
3459
|
+
return /* @__PURE__ */ jsx(TagName, { id: `tab-group-${tabGroupId}`, className: joinClassNames("tag-group__title", className), children });
|
|
3460
|
+
}
|
|
3461
|
+
TabGroupTitle.propTypes = propTypes$K;
|
|
3462
|
+
TabGroupTitle.defaultProps = defaultProps$K;
|
|
3463
|
+
const propTypes$J = {
|
|
3464
|
+
children: propTypesExports.node.isRequired,
|
|
3465
|
+
className: propTypesExports.string
|
|
3466
|
+
};
|
|
3467
|
+
const defaultProps$J = {
|
|
3468
|
+
className: null
|
|
3469
|
+
};
|
|
3470
|
+
function TabList({ children, className }) {
|
|
3471
|
+
const { tabGroupId } = useContext(TabGroupContext);
|
|
3472
|
+
return /* @__PURE__ */ jsx(
|
|
3473
|
+
"div",
|
|
3474
|
+
{
|
|
3475
|
+
className: joinClassNames(className, "tab-group__list"),
|
|
3476
|
+
role: "tablist",
|
|
3477
|
+
"aria-labelledby": `tab-group-${tabGroupId}`,
|
|
3478
|
+
children
|
|
3550
3479
|
}
|
|
3551
|
-
|
|
3552
|
-
return -1;
|
|
3480
|
+
);
|
|
3553
3481
|
}
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
}
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3482
|
+
TabList.propTypes = propTypes$J;
|
|
3483
|
+
TabList.defaultProps = defaultProps$J;
|
|
3484
|
+
const propTypes$I = {
|
|
3485
|
+
children: propTypesExports.node.isRequired,
|
|
3486
|
+
className: propTypesExports.string,
|
|
3487
|
+
// a tabId id must be provided for accessibility and selecting tabs
|
|
3488
|
+
tabId: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string]).isRequired
|
|
3489
|
+
};
|
|
3490
|
+
const defaultProps$I = {
|
|
3491
|
+
className: null
|
|
3492
|
+
};
|
|
3493
|
+
function TabPanel({ children, className, tabId }) {
|
|
3494
|
+
const { selectedTabId, tabGroupId } = useContext(TabGroupContext);
|
|
3495
|
+
return /* @__PURE__ */ jsx(
|
|
3496
|
+
"div",
|
|
3497
|
+
{
|
|
3498
|
+
"aria-labelledby": `tab-${tabGroupId}-${tabId}`,
|
|
3499
|
+
className: joinClassNames(
|
|
3500
|
+
className,
|
|
3501
|
+
selectedTabId === tabId && "tab-group__panel--selected",
|
|
3502
|
+
"tab-group__panel"
|
|
3503
|
+
),
|
|
3504
|
+
id: `tabpanel-${tabGroupId}-${tabId}`,
|
|
3505
|
+
role: "tabpanel",
|
|
3506
|
+
tabIndex: "0",
|
|
3507
|
+
children
|
|
3508
|
+
}
|
|
3509
|
+
);
|
|
3571
3510
|
}
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3511
|
+
TabPanel.propTypes = propTypes$I;
|
|
3512
|
+
TabPanel.defaultProps = defaultProps$I;
|
|
3513
|
+
const propTypes$H = {
|
|
3514
|
+
children: propTypesExports.node.isRequired
|
|
3515
|
+
};
|
|
3516
|
+
const defaultProps$H = {};
|
|
3517
|
+
function TabPanels({ children }) {
|
|
3518
|
+
return /* @__PURE__ */ jsx("div", { className: "tab-group__panels", children });
|
|
3577
3519
|
}
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3520
|
+
TabPanels.propTypes = propTypes$H;
|
|
3521
|
+
TabPanels.defaultProps = defaultProps$H;
|
|
3522
|
+
const FormContext = React__default.createContext();
|
|
3523
|
+
function eq$3(value, other) {
|
|
3524
|
+
return value === other || value !== value && other !== other;
|
|
3582
3525
|
}
|
|
3583
|
-
var
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
if (index < 0) {
|
|
3588
|
-
++this.size;
|
|
3589
|
-
data.push([key, value]);
|
|
3590
|
-
} else {
|
|
3591
|
-
data[index][1] = value;
|
|
3592
|
-
}
|
|
3593
|
-
return this;
|
|
3526
|
+
var eq_1 = eq$3;
|
|
3527
|
+
function isObject$6(value) {
|
|
3528
|
+
var type2 = typeof value;
|
|
3529
|
+
return value != null && (type2 == "object" || type2 == "function");
|
|
3594
3530
|
}
|
|
3595
|
-
var
|
|
3596
|
-
var
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
var entry = entries[index];
|
|
3602
|
-
this.set(entry[0], entry[1]);
|
|
3531
|
+
var isObject_1 = isObject$6;
|
|
3532
|
+
var baseGetTag$4 = _baseGetTag, isObject$5 = isObject_1;
|
|
3533
|
+
var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
|
|
3534
|
+
function isFunction$2(value) {
|
|
3535
|
+
if (!isObject$5(value)) {
|
|
3536
|
+
return false;
|
|
3603
3537
|
}
|
|
3538
|
+
var tag = baseGetTag$4(value);
|
|
3539
|
+
return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
|
|
3604
3540
|
}
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
ListCache$4.prototype.set = listCacheSet;
|
|
3610
|
-
var _ListCache = ListCache$4;
|
|
3611
|
-
var ListCache$3 = _ListCache;
|
|
3612
|
-
function stackClear$1() {
|
|
3613
|
-
this.__data__ = new ListCache$3();
|
|
3614
|
-
this.size = 0;
|
|
3541
|
+
var isFunction_1 = isFunction$2;
|
|
3542
|
+
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
|
3543
|
+
function isLength$2(value) {
|
|
3544
|
+
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
|
|
3615
3545
|
}
|
|
3616
|
-
var
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
return result;
|
|
3546
|
+
var isLength_1 = isLength$2;
|
|
3547
|
+
var isFunction$1 = isFunction_1, isLength$1 = isLength_1;
|
|
3548
|
+
function isArrayLike$3(value) {
|
|
3549
|
+
return value != null && isLength$1(value.length) && !isFunction$1(value);
|
|
3621
3550
|
}
|
|
3622
|
-
var
|
|
3623
|
-
|
|
3624
|
-
|
|
3551
|
+
var isArrayLike_1 = isArrayLike$3;
|
|
3552
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
3553
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
3554
|
+
function isIndex$2(value, length) {
|
|
3555
|
+
var type2 = typeof value;
|
|
3556
|
+
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
3557
|
+
return !!length && (type2 == "number" || type2 != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
3625
3558
|
}
|
|
3626
|
-
var
|
|
3627
|
-
|
|
3628
|
-
|
|
3559
|
+
var _isIndex = isIndex$2;
|
|
3560
|
+
var eq$2 = eq_1, isArrayLike$2 = isArrayLike_1, isIndex$1 = _isIndex, isObject$4 = isObject_1;
|
|
3561
|
+
function isIterateeCall$1(value, index, object) {
|
|
3562
|
+
if (!isObject$4(object)) {
|
|
3563
|
+
return false;
|
|
3564
|
+
}
|
|
3565
|
+
var type2 = typeof index;
|
|
3566
|
+
if (type2 == "number" ? isArrayLike$2(object) && isIndex$1(index, object.length) : type2 == "string" && index in object) {
|
|
3567
|
+
return eq$2(object[index], value);
|
|
3568
|
+
}
|
|
3569
|
+
return false;
|
|
3629
3570
|
}
|
|
3630
|
-
var
|
|
3631
|
-
var
|
|
3632
|
-
var
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
var maskSrcKey = function() {
|
|
3636
|
-
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
3637
|
-
return uid ? "Symbol(src)_1." + uid : "";
|
|
3638
|
-
}();
|
|
3639
|
-
function isMasked$1(func) {
|
|
3640
|
-
return !!maskSrcKey && maskSrcKey in func;
|
|
3571
|
+
var _isIterateeCall = isIterateeCall$1;
|
|
3572
|
+
var baseGetTag$3 = _baseGetTag, isObjectLike$5 = isObjectLike_1;
|
|
3573
|
+
var regexpTag$3 = "[object RegExp]";
|
|
3574
|
+
function baseIsRegExp$1(value) {
|
|
3575
|
+
return isObjectLike$5(value) && baseGetTag$3(value) == regexpTag$3;
|
|
3641
3576
|
}
|
|
3642
|
-
var
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3577
|
+
var _baseIsRegExp = baseIsRegExp$1;
|
|
3578
|
+
function baseUnary$4(func) {
|
|
3579
|
+
return function(value) {
|
|
3580
|
+
return func(value);
|
|
3581
|
+
};
|
|
3582
|
+
}
|
|
3583
|
+
var _baseUnary = baseUnary$4;
|
|
3584
|
+
var _nodeUtilExports = {};
|
|
3585
|
+
var _nodeUtil = {
|
|
3586
|
+
get exports() {
|
|
3587
|
+
return _nodeUtilExports;
|
|
3588
|
+
},
|
|
3589
|
+
set exports(v) {
|
|
3590
|
+
_nodeUtilExports = v;
|
|
3591
|
+
}
|
|
3592
|
+
};
|
|
3593
|
+
(function(module, exports2) {
|
|
3594
|
+
var freeGlobal2 = _freeGlobal;
|
|
3595
|
+
var freeExports = exports2 && !exports2.nodeType && exports2;
|
|
3596
|
+
var freeModule = freeExports && true && module && !module.nodeType && module;
|
|
3597
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
3598
|
+
var freeProcess = moduleExports && freeGlobal2.process;
|
|
3599
|
+
var nodeUtil2 = function() {
|
|
3647
3600
|
try {
|
|
3648
|
-
|
|
3601
|
+
var types = freeModule && freeModule.require && freeModule.require("util").types;
|
|
3602
|
+
if (types) {
|
|
3603
|
+
return types;
|
|
3604
|
+
}
|
|
3605
|
+
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
3649
3606
|
} catch (e) {
|
|
3650
3607
|
}
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3608
|
+
}();
|
|
3609
|
+
module.exports = nodeUtil2;
|
|
3610
|
+
})(_nodeUtil, _nodeUtilExports);
|
|
3611
|
+
var baseIsRegExp = _baseIsRegExp, baseUnary$3 = _baseUnary, nodeUtil$3 = _nodeUtilExports;
|
|
3612
|
+
var nodeIsRegExp = nodeUtil$3 && nodeUtil$3.isRegExp;
|
|
3613
|
+
var isRegExp$1 = nodeIsRegExp ? baseUnary$3(nodeIsRegExp) : baseIsRegExp;
|
|
3614
|
+
var isRegExp_1 = isRegExp$1;
|
|
3615
|
+
var baseToString = _baseToString, castSlice = _castSlice, hasUnicode = _hasUnicode, isIterateeCall = _isIterateeCall, isRegExp = isRegExp_1, stringToArray = _stringToArray, toString = toString_1;
|
|
3616
|
+
var MAX_ARRAY_LENGTH = 4294967295;
|
|
3617
|
+
function split(string, separator, limit) {
|
|
3618
|
+
if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) {
|
|
3619
|
+
separator = limit = void 0;
|
|
3620
|
+
}
|
|
3621
|
+
limit = limit === void 0 ? MAX_ARRAY_LENGTH : limit >>> 0;
|
|
3622
|
+
if (!limit) {
|
|
3623
|
+
return [];
|
|
3624
|
+
}
|
|
3625
|
+
string = toString(string);
|
|
3626
|
+
if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) {
|
|
3627
|
+
separator = baseToString(separator);
|
|
3628
|
+
if (!separator && hasUnicode(string)) {
|
|
3629
|
+
return castSlice(stringToArray(string), 0, limit);
|
|
3654
3630
|
}
|
|
3655
3631
|
}
|
|
3656
|
-
return
|
|
3632
|
+
return string.split(separator, limit);
|
|
3657
3633
|
}
|
|
3658
|
-
var
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
3662
|
-
var funcProto = Function.prototype, objectProto$a = Object.prototype;
|
|
3663
|
-
var funcToString = funcProto.toString;
|
|
3664
|
-
var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
|
|
3665
|
-
var reIsNative = RegExp(
|
|
3666
|
-
"^" + funcToString.call(hasOwnProperty$8).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
3667
|
-
);
|
|
3668
|
-
function baseIsNative$1(value) {
|
|
3669
|
-
if (!isObject$3(value) || isMasked(value)) {
|
|
3670
|
-
return false;
|
|
3671
|
-
}
|
|
3672
|
-
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
3673
|
-
return pattern.test(toSource$1(value));
|
|
3634
|
+
var split_1 = split;
|
|
3635
|
+
function valueAtPath({ object, path }) {
|
|
3636
|
+
return split_1(path, ".").reduce((obj, field) => field && obj ? obj[field] : obj, object);
|
|
3674
3637
|
}
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3638
|
+
function onKeyPress({ targetKey, func }) {
|
|
3639
|
+
return (e) => {
|
|
3640
|
+
if (e.key === targetKey) {
|
|
3641
|
+
func(e);
|
|
3642
|
+
}
|
|
3643
|
+
};
|
|
3678
3644
|
}
|
|
3679
|
-
|
|
3680
|
-
|
|
3645
|
+
function useCurrentValuesFromForm({
|
|
3646
|
+
errorMessage,
|
|
3647
|
+
id,
|
|
3648
|
+
onChange,
|
|
3649
|
+
onSubmit,
|
|
3650
|
+
value
|
|
3651
|
+
}) {
|
|
3652
|
+
if (!id) {
|
|
3653
|
+
console.error("useCurrentValuesFromForm: `id` is required");
|
|
3654
|
+
}
|
|
3655
|
+
const {
|
|
3656
|
+
onChange: contextOnChange,
|
|
3657
|
+
onSubmit: contextOnSubmit,
|
|
3658
|
+
state,
|
|
3659
|
+
validationErrors
|
|
3660
|
+
} = useContext(FormContext) || {};
|
|
3661
|
+
const currentOnSubmit = onSubmit ?? contextOnSubmit;
|
|
3662
|
+
return {
|
|
3663
|
+
currentErrorMessage: errorMessage ?? (validationErrors && validationErrors[id]),
|
|
3664
|
+
currentOnChange: onChange ?? (contextOnChange && ((e, newValue) => contextOnChange({ e, id, newValue }))),
|
|
3665
|
+
currentOnSubmit,
|
|
3666
|
+
currentValue: (value ?? (state && valueAtPath({ object: state, path: id }))) || "",
|
|
3667
|
+
currentOnFormKeyPress: onKeyPress({ targetKey: "Enter", func: (e) => currentOnSubmit && currentOnSubmit(e) })
|
|
3668
|
+
};
|
|
3669
|
+
}
|
|
3670
|
+
const propTypes$G = {
|
|
3671
|
+
errorMessage: propTypesExports.string,
|
|
3672
|
+
id: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.number]).isRequired
|
|
3673
|
+
};
|
|
3674
|
+
const defaultProps$G = {
|
|
3675
|
+
errorMessage: null
|
|
3676
|
+
};
|
|
3677
|
+
function ErrorMessage({ errorMessage, id }) {
|
|
3678
|
+
return errorMessage ? /* @__PURE__ */ jsx("div", { className: "input-wrapper__error-message", id: `${id}-error`, children: errorMessage }) : null;
|
|
3679
|
+
}
|
|
3680
|
+
ErrorMessage.propTypes = propTypes$G;
|
|
3681
|
+
ErrorMessage.defaultProps = defaultProps$G;
|
|
3682
|
+
const propTypes$F = {
|
|
3683
|
+
className: propTypesExports.string,
|
|
3684
|
+
errorMessage: propTypesExports.string,
|
|
3685
|
+
innerRef: RefShape,
|
|
3686
|
+
// id of the input; when tied to a Form the `id` is also the 'dot' path to the data in the form's state: ie person.contact.address.line1
|
|
3687
|
+
id: propTypesExports.string.isRequired,
|
|
3688
|
+
isDisabled: propTypesExports.bool,
|
|
3689
|
+
label: propTypesExports.string.isRequired,
|
|
3690
|
+
// e => ... do something with e.target.value ...; can be omitted so as to be uncontrolled OR if changes are sent through form's onChange
|
|
3691
|
+
onChange: propTypesExports.func,
|
|
3692
|
+
// when enter key pressed in field, submit the form
|
|
3693
|
+
onSubmit: propTypesExports.func,
|
|
3694
|
+
value: propTypesExports.bool
|
|
3695
|
+
};
|
|
3696
|
+
const defaultProps$F = {
|
|
3697
|
+
className: null,
|
|
3698
|
+
errorMessage: null,
|
|
3699
|
+
innerRef: null,
|
|
3700
|
+
isDisabled: false,
|
|
3701
|
+
onChange: null,
|
|
3702
|
+
onSubmit: null,
|
|
3703
|
+
value: null
|
|
3704
|
+
};
|
|
3705
|
+
function CheckBox({
|
|
3706
|
+
className,
|
|
3707
|
+
errorMessage,
|
|
3708
|
+
innerRef,
|
|
3709
|
+
id,
|
|
3710
|
+
isDisabled,
|
|
3711
|
+
label,
|
|
3712
|
+
onChange,
|
|
3713
|
+
onSubmit,
|
|
3714
|
+
value,
|
|
3715
|
+
...rest
|
|
3716
|
+
}) {
|
|
3717
|
+
const {
|
|
3718
|
+
currentErrorMessage,
|
|
3719
|
+
currentOnChange,
|
|
3720
|
+
currentOnFormKeyPress,
|
|
3721
|
+
currentValue
|
|
3722
|
+
} = useCurrentValuesFromForm({
|
|
3723
|
+
errorMessage,
|
|
3724
|
+
id,
|
|
3725
|
+
onChange,
|
|
3726
|
+
onSubmit,
|
|
3727
|
+
value
|
|
3728
|
+
});
|
|
3729
|
+
return /* @__PURE__ */ jsxs("div", { className: "input-wrapper input-wrapper--checkbox", children: [
|
|
3730
|
+
/* @__PURE__ */ jsx("label", { htmlFor: id, children: label }),
|
|
3731
|
+
/* @__PURE__ */ jsx(
|
|
3732
|
+
"input",
|
|
3733
|
+
{
|
|
3734
|
+
"aria-describedby": currentErrorMessage ? `${id}-error` : null,
|
|
3735
|
+
checked: currentValue,
|
|
3736
|
+
className,
|
|
3737
|
+
disabled: isDisabled,
|
|
3738
|
+
id,
|
|
3739
|
+
name: id,
|
|
3740
|
+
onChange: currentOnChange,
|
|
3741
|
+
onKeyPress: currentOnFormKeyPress,
|
|
3742
|
+
ref: innerRef,
|
|
3743
|
+
type: "checkbox",
|
|
3744
|
+
...rest
|
|
3745
|
+
}
|
|
3746
|
+
),
|
|
3747
|
+
/* @__PURE__ */ jsx(ErrorMessage, { errorMessage: currentErrorMessage, id })
|
|
3748
|
+
] });
|
|
3749
|
+
}
|
|
3750
|
+
CheckBox.propTypes = propTypes$F;
|
|
3751
|
+
CheckBox.defaultProps = defaultProps$F;
|
|
3752
|
+
function listCacheClear$1() {
|
|
3753
|
+
this.__data__ = [];
|
|
3754
|
+
this.size = 0;
|
|
3755
|
+
}
|
|
3756
|
+
var _listCacheClear = listCacheClear$1;
|
|
3757
|
+
var eq$1 = eq_1;
|
|
3758
|
+
function assocIndexOf$4(array, key) {
|
|
3759
|
+
var length = array.length;
|
|
3760
|
+
while (length--) {
|
|
3761
|
+
if (eq$1(array[length][0], key)) {
|
|
3762
|
+
return length;
|
|
3763
|
+
}
|
|
3764
|
+
}
|
|
3765
|
+
return -1;
|
|
3766
|
+
}
|
|
3767
|
+
var _assocIndexOf = assocIndexOf$4;
|
|
3768
|
+
var assocIndexOf$3 = _assocIndexOf;
|
|
3769
|
+
var arrayProto = Array.prototype;
|
|
3770
|
+
var splice = arrayProto.splice;
|
|
3771
|
+
function listCacheDelete$1(key) {
|
|
3772
|
+
var data = this.__data__, index = assocIndexOf$3(data, key);
|
|
3773
|
+
if (index < 0) {
|
|
3774
|
+
return false;
|
|
3775
|
+
}
|
|
3776
|
+
var lastIndex = data.length - 1;
|
|
3777
|
+
if (index == lastIndex) {
|
|
3778
|
+
data.pop();
|
|
3779
|
+
} else {
|
|
3780
|
+
splice.call(data, index, 1);
|
|
3781
|
+
}
|
|
3782
|
+
--this.size;
|
|
3783
|
+
return true;
|
|
3784
|
+
}
|
|
3785
|
+
var _listCacheDelete = listCacheDelete$1;
|
|
3786
|
+
var assocIndexOf$2 = _assocIndexOf;
|
|
3787
|
+
function listCacheGet$1(key) {
|
|
3788
|
+
var data = this.__data__, index = assocIndexOf$2(data, key);
|
|
3789
|
+
return index < 0 ? void 0 : data[index][1];
|
|
3790
|
+
}
|
|
3791
|
+
var _listCacheGet = listCacheGet$1;
|
|
3792
|
+
var assocIndexOf$1 = _assocIndexOf;
|
|
3793
|
+
function listCacheHas$1(key) {
|
|
3794
|
+
return assocIndexOf$1(this.__data__, key) > -1;
|
|
3795
|
+
}
|
|
3796
|
+
var _listCacheHas = listCacheHas$1;
|
|
3797
|
+
var assocIndexOf = _assocIndexOf;
|
|
3798
|
+
function listCacheSet$1(key, value) {
|
|
3799
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
3800
|
+
if (index < 0) {
|
|
3801
|
+
++this.size;
|
|
3802
|
+
data.push([key, value]);
|
|
3803
|
+
} else {
|
|
3804
|
+
data[index][1] = value;
|
|
3805
|
+
}
|
|
3806
|
+
return this;
|
|
3807
|
+
}
|
|
3808
|
+
var _listCacheSet = listCacheSet$1;
|
|
3809
|
+
var listCacheClear = _listCacheClear, listCacheDelete = _listCacheDelete, listCacheGet = _listCacheGet, listCacheHas = _listCacheHas, listCacheSet = _listCacheSet;
|
|
3810
|
+
function ListCache$4(entries) {
|
|
3811
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
3812
|
+
this.clear();
|
|
3813
|
+
while (++index < length) {
|
|
3814
|
+
var entry = entries[index];
|
|
3815
|
+
this.set(entry[0], entry[1]);
|
|
3816
|
+
}
|
|
3817
|
+
}
|
|
3818
|
+
ListCache$4.prototype.clear = listCacheClear;
|
|
3819
|
+
ListCache$4.prototype["delete"] = listCacheDelete;
|
|
3820
|
+
ListCache$4.prototype.get = listCacheGet;
|
|
3821
|
+
ListCache$4.prototype.has = listCacheHas;
|
|
3822
|
+
ListCache$4.prototype.set = listCacheSet;
|
|
3823
|
+
var _ListCache = ListCache$4;
|
|
3824
|
+
var ListCache$3 = _ListCache;
|
|
3825
|
+
function stackClear$1() {
|
|
3826
|
+
this.__data__ = new ListCache$3();
|
|
3827
|
+
this.size = 0;
|
|
3828
|
+
}
|
|
3829
|
+
var _stackClear = stackClear$1;
|
|
3830
|
+
function stackDelete$1(key) {
|
|
3831
|
+
var data = this.__data__, result = data["delete"](key);
|
|
3832
|
+
this.size = data.size;
|
|
3833
|
+
return result;
|
|
3834
|
+
}
|
|
3835
|
+
var _stackDelete = stackDelete$1;
|
|
3836
|
+
function stackGet$1(key) {
|
|
3837
|
+
return this.__data__.get(key);
|
|
3838
|
+
}
|
|
3839
|
+
var _stackGet = stackGet$1;
|
|
3840
|
+
function stackHas$1(key) {
|
|
3841
|
+
return this.__data__.has(key);
|
|
3842
|
+
}
|
|
3843
|
+
var _stackHas = stackHas$1;
|
|
3844
|
+
var root$6 = _root;
|
|
3845
|
+
var coreJsData$1 = root$6["__core-js_shared__"];
|
|
3846
|
+
var _coreJsData = coreJsData$1;
|
|
3847
|
+
var coreJsData = _coreJsData;
|
|
3848
|
+
var maskSrcKey = function() {
|
|
3849
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
3850
|
+
return uid ? "Symbol(src)_1." + uid : "";
|
|
3851
|
+
}();
|
|
3852
|
+
function isMasked$1(func) {
|
|
3853
|
+
return !!maskSrcKey && maskSrcKey in func;
|
|
3854
|
+
}
|
|
3855
|
+
var _isMasked = isMasked$1;
|
|
3856
|
+
var funcProto$1 = Function.prototype;
|
|
3857
|
+
var funcToString$1 = funcProto$1.toString;
|
|
3858
|
+
function toSource$2(func) {
|
|
3859
|
+
if (func != null) {
|
|
3860
|
+
try {
|
|
3861
|
+
return funcToString$1.call(func);
|
|
3862
|
+
} catch (e) {
|
|
3863
|
+
}
|
|
3864
|
+
try {
|
|
3865
|
+
return func + "";
|
|
3866
|
+
} catch (e) {
|
|
3867
|
+
}
|
|
3868
|
+
}
|
|
3869
|
+
return "";
|
|
3870
|
+
}
|
|
3871
|
+
var _toSource = toSource$2;
|
|
3872
|
+
var isFunction = isFunction_1, isMasked = _isMasked, isObject$3 = isObject_1, toSource$1 = _toSource;
|
|
3873
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
3874
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
3875
|
+
var funcProto = Function.prototype, objectProto$a = Object.prototype;
|
|
3876
|
+
var funcToString = funcProto.toString;
|
|
3877
|
+
var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
|
|
3878
|
+
var reIsNative = RegExp(
|
|
3879
|
+
"^" + funcToString.call(hasOwnProperty$8).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
3880
|
+
);
|
|
3881
|
+
function baseIsNative$1(value) {
|
|
3882
|
+
if (!isObject$3(value) || isMasked(value)) {
|
|
3883
|
+
return false;
|
|
3884
|
+
}
|
|
3885
|
+
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
3886
|
+
return pattern.test(toSource$1(value));
|
|
3887
|
+
}
|
|
3888
|
+
var _baseIsNative = baseIsNative$1;
|
|
3889
|
+
function getValue$1(object, key) {
|
|
3890
|
+
return object == null ? void 0 : object[key];
|
|
3891
|
+
}
|
|
3892
|
+
var _getValue = getValue$1;
|
|
3893
|
+
var baseIsNative = _baseIsNative, getValue = _getValue;
|
|
3681
3894
|
function getNative$7(object, key) {
|
|
3682
3895
|
var value = getValue(object, key);
|
|
3683
3896
|
return baseIsNative(value) ? value : void 0;
|
|
@@ -3702,14 +3915,14 @@ function hashDelete$1(key) {
|
|
|
3702
3915
|
}
|
|
3703
3916
|
var _hashDelete = hashDelete$1;
|
|
3704
3917
|
var nativeCreate$2 = _nativeCreate;
|
|
3705
|
-
var HASH_UNDEFINED$
|
|
3918
|
+
var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
|
|
3706
3919
|
var objectProto$9 = Object.prototype;
|
|
3707
3920
|
var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
|
|
3708
3921
|
function hashGet$1(key) {
|
|
3709
3922
|
var data = this.__data__;
|
|
3710
3923
|
if (nativeCreate$2) {
|
|
3711
3924
|
var result = data[key];
|
|
3712
|
-
return result === HASH_UNDEFINED$
|
|
3925
|
+
return result === HASH_UNDEFINED$2 ? void 0 : result;
|
|
3713
3926
|
}
|
|
3714
3927
|
return hasOwnProperty$7.call(data, key) ? data[key] : void 0;
|
|
3715
3928
|
}
|
|
@@ -3723,11 +3936,11 @@ function hashHas$1(key) {
|
|
|
3723
3936
|
}
|
|
3724
3937
|
var _hashHas = hashHas$1;
|
|
3725
3938
|
var nativeCreate = _nativeCreate;
|
|
3726
|
-
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
3939
|
+
var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
|
|
3727
3940
|
function hashSet$1(key, value) {
|
|
3728
3941
|
var data = this.__data__;
|
|
3729
3942
|
this.size += this.has(key) ? 0 : 1;
|
|
3730
|
-
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
|
|
3943
|
+
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED$1 : value;
|
|
3731
3944
|
return this;
|
|
3732
3945
|
}
|
|
3733
3946
|
var _hashSet = hashSet$1;
|
|
@@ -3793,7 +4006,7 @@ function mapCacheSet$1(key, value) {
|
|
|
3793
4006
|
}
|
|
3794
4007
|
var _mapCacheSet = mapCacheSet$1;
|
|
3795
4008
|
var mapCacheClear = _mapCacheClear, mapCacheDelete = _mapCacheDelete, mapCacheGet = _mapCacheGet, mapCacheHas = _mapCacheHas, mapCacheSet = _mapCacheSet;
|
|
3796
|
-
function MapCache$
|
|
4009
|
+
function MapCache$2(entries) {
|
|
3797
4010
|
var index = -1, length = entries == null ? 0 : entries.length;
|
|
3798
4011
|
this.clear();
|
|
3799
4012
|
while (++index < length) {
|
|
@@ -3801,24 +4014,24 @@ function MapCache$1(entries) {
|
|
|
3801
4014
|
this.set(entry[0], entry[1]);
|
|
3802
4015
|
}
|
|
3803
4016
|
}
|
|
3804
|
-
MapCache$
|
|
3805
|
-
MapCache$
|
|
3806
|
-
MapCache$
|
|
3807
|
-
MapCache$
|
|
3808
|
-
MapCache$
|
|
3809
|
-
var _MapCache = MapCache$
|
|
3810
|
-
var ListCache$1 = _ListCache, Map$2 = _Map, MapCache = _MapCache;
|
|
3811
|
-
var LARGE_ARRAY_SIZE = 200;
|
|
4017
|
+
MapCache$2.prototype.clear = mapCacheClear;
|
|
4018
|
+
MapCache$2.prototype["delete"] = mapCacheDelete;
|
|
4019
|
+
MapCache$2.prototype.get = mapCacheGet;
|
|
4020
|
+
MapCache$2.prototype.has = mapCacheHas;
|
|
4021
|
+
MapCache$2.prototype.set = mapCacheSet;
|
|
4022
|
+
var _MapCache = MapCache$2;
|
|
4023
|
+
var ListCache$1 = _ListCache, Map$2 = _Map, MapCache$1 = _MapCache;
|
|
4024
|
+
var LARGE_ARRAY_SIZE$1 = 200;
|
|
3812
4025
|
function stackSet$1(key, value) {
|
|
3813
4026
|
var data = this.__data__;
|
|
3814
4027
|
if (data instanceof ListCache$1) {
|
|
3815
4028
|
var pairs = data.__data__;
|
|
3816
|
-
if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
4029
|
+
if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE$1 - 1) {
|
|
3817
4030
|
pairs.push([key, value]);
|
|
3818
4031
|
this.size = ++data.size;
|
|
3819
4032
|
return this;
|
|
3820
4033
|
}
|
|
3821
|
-
data = this.__data__ = new MapCache(pairs);
|
|
4034
|
+
data = this.__data__ = new MapCache$1(pairs);
|
|
3822
4035
|
}
|
|
3823
4036
|
data.set(key, value);
|
|
3824
4037
|
this.size = data.size;
|
|
@@ -4173,17 +4386,17 @@ var getNative$2 = _getNative, root$3 = _root;
|
|
|
4173
4386
|
var Promise$2 = getNative$2(root$3, "Promise");
|
|
4174
4387
|
var _Promise = Promise$2;
|
|
4175
4388
|
var getNative$1 = _getNative, root$2 = _root;
|
|
4176
|
-
var Set$
|
|
4177
|
-
var _Set = Set$
|
|
4389
|
+
var Set$3 = getNative$1(root$2, "Set");
|
|
4390
|
+
var _Set = Set$3;
|
|
4178
4391
|
var getNative = _getNative, root$1 = _root;
|
|
4179
4392
|
var WeakMap$2 = getNative(root$1, "WeakMap");
|
|
4180
4393
|
var _WeakMap = WeakMap$2;
|
|
4181
|
-
var DataView = _DataView, Map$1 = _Map, Promise$1 = _Promise, Set$
|
|
4394
|
+
var DataView = _DataView, Map$1 = _Map, Promise$1 = _Promise, Set$2 = _Set, WeakMap$1 = _WeakMap, baseGetTag = _baseGetTag, toSource = _toSource;
|
|
4182
4395
|
var mapTag$3 = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag$3 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
|
|
4183
4396
|
var dataViewTag$2 = "[object DataView]";
|
|
4184
|
-
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$
|
|
4397
|
+
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$2), weakMapCtorString = toSource(WeakMap$1);
|
|
4185
4398
|
var getTag$3 = baseGetTag;
|
|
4186
|
-
if (DataView && getTag$3(new DataView(new ArrayBuffer(1))) != dataViewTag$2 || Map$1 && getTag$3(new Map$1()) != mapTag$3 || Promise$1 && getTag$3(Promise$1.resolve()) != promiseTag || Set$
|
|
4399
|
+
if (DataView && getTag$3(new DataView(new ArrayBuffer(1))) != dataViewTag$2 || Map$1 && getTag$3(new Map$1()) != mapTag$3 || Promise$1 && getTag$3(Promise$1.resolve()) != promiseTag || Set$2 && getTag$3(new Set$2()) != setTag$3 || WeakMap$1 && getTag$3(new WeakMap$1()) != weakMapTag$1) {
|
|
4187
4400
|
getTag$3 = function(value) {
|
|
4188
4401
|
var result = baseGetTag(value), Ctor = result == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
|
|
4189
4402
|
if (ctorString) {
|
|
@@ -4216,12 +4429,12 @@ function initCloneArray$1(array) {
|
|
|
4216
4429
|
}
|
|
4217
4430
|
var _initCloneArray = initCloneArray$1;
|
|
4218
4431
|
var root = _root;
|
|
4219
|
-
var Uint8Array$
|
|
4220
|
-
var _Uint8Array = Uint8Array$
|
|
4221
|
-
var Uint8Array = _Uint8Array;
|
|
4432
|
+
var Uint8Array$2 = root.Uint8Array;
|
|
4433
|
+
var _Uint8Array = Uint8Array$2;
|
|
4434
|
+
var Uint8Array$1 = _Uint8Array;
|
|
4222
4435
|
function cloneArrayBuffer$3(arrayBuffer) {
|
|
4223
4436
|
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
4224
|
-
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
|
|
4437
|
+
new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
|
|
4225
4438
|
return result;
|
|
4226
4439
|
}
|
|
4227
4440
|
var _cloneArrayBuffer = cloneArrayBuffer$3;
|
|
@@ -4438,7 +4651,7 @@ function setValueAtPath({ object, path, value }) {
|
|
|
4438
4651
|
}
|
|
4439
4652
|
return result;
|
|
4440
4653
|
}
|
|
4441
|
-
const propTypes$
|
|
4654
|
+
const propTypes$E = {
|
|
4442
4655
|
children: propTypesExports.node.isRequired,
|
|
4443
4656
|
formState: propTypesExports.shape({
|
|
4444
4657
|
formId: propTypesExports.number.isRequired
|
|
@@ -4452,7 +4665,7 @@ const propTypes$I = {
|
|
|
4452
4665
|
setState: propTypesExports.func,
|
|
4453
4666
|
state: propTypesExports.shape({})
|
|
4454
4667
|
};
|
|
4455
|
-
const defaultProps$
|
|
4668
|
+
const defaultProps$E = {
|
|
4456
4669
|
formState: null,
|
|
4457
4670
|
onChange: null,
|
|
4458
4671
|
onSubmit: null,
|
|
@@ -4502,9 +4715,9 @@ function FormContextProvider({
|
|
|
4502
4715
|
);
|
|
4503
4716
|
return /* @__PURE__ */ jsx(FormContext.Provider, { value: contextValue, children });
|
|
4504
4717
|
}
|
|
4505
|
-
FormContextProvider.propTypes = propTypes$
|
|
4506
|
-
FormContextProvider.defaultProps = defaultProps$
|
|
4507
|
-
const propTypes$
|
|
4718
|
+
FormContextProvider.propTypes = propTypes$E;
|
|
4719
|
+
FormContextProvider.defaultProps = defaultProps$E;
|
|
4720
|
+
const propTypes$D = {
|
|
4508
4721
|
children: propTypesExports.node.isRequired,
|
|
4509
4722
|
className: propTypesExports.string,
|
|
4510
4723
|
// respond to field changes for key/value pairs of data, where the key is the `id` of the nested form components/inputs.
|
|
@@ -4516,7 +4729,7 @@ const propTypes$H = {
|
|
|
4516
4729
|
setState: propTypesExports.func,
|
|
4517
4730
|
state: propTypesExports.shape({})
|
|
4518
4731
|
};
|
|
4519
|
-
const defaultProps$
|
|
4732
|
+
const defaultProps$D = {
|
|
4520
4733
|
className: null,
|
|
4521
4734
|
onChange: null,
|
|
4522
4735
|
onSubmit: null,
|
|
@@ -4553,148 +4766,371 @@ function Form({
|
|
|
4553
4766
|
}
|
|
4554
4767
|
);
|
|
4555
4768
|
}
|
|
4556
|
-
Form.propTypes = propTypes$
|
|
4557
|
-
Form.defaultProps = defaultProps$
|
|
4558
|
-
const
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
// the
|
|
4565
|
-
parentLinks: propTypesExports.arrayOf(propTypesExports.string),
|
|
4566
|
-
// the title to show for the menu item
|
|
4567
|
-
title: propTypesExports.string.isRequired
|
|
4568
|
-
};
|
|
4569
|
-
menuItem.children = propTypesExports.arrayOf(propTypesExports.exact(menuItem));
|
|
4570
|
-
const MenuItemShape = propTypesExports.exact(menuItem);
|
|
4571
|
-
const MenuItemsShape = propTypesExports.arrayOf(MenuItemShape);
|
|
4572
|
-
const MenuShape = propTypesExports.exact({
|
|
4573
|
-
header: propTypesExports.string.isRequired,
|
|
4769
|
+
Form.propTypes = propTypes$D;
|
|
4770
|
+
Form.defaultProps = defaultProps$D;
|
|
4771
|
+
const propTypes$C = {
|
|
4772
|
+
// children are the options
|
|
4773
|
+
children: propTypesExports.node,
|
|
4774
|
+
className: propTypesExports.string,
|
|
4775
|
+
errorMessage: propTypesExports.string,
|
|
4776
|
+
innerRef: RefShape,
|
|
4777
|
+
// id of the input; when tied to a Form the `id` is also the 'dot' path to the data in the form's state: ie person.contact.address.line1
|
|
4574
4778
|
id: propTypesExports.string.isRequired,
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
IconChevron: (className) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 10.75 6.834", className: `icon-svg icon-chevron ${className || ""}`, children: /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("path", { d: "M5.375,6.834L0,1.438,1.437,0l3.938,3.938L9.313,0l1.437,1.438L5.375,6.834Z" }) }) }),
|
|
4583
|
-
IconCheck: (className) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 11.334 8.896", className: `icon-svg icon-check ${className || ""}`, children: /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("path", { d: "M3.896,8.896L0,4.979l1.438-1.438,2.458,2.459L9.896,0l1.438,1.458L3.896,8.896Z" }) }) }),
|
|
4584
|
-
IconLightMode: (className) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 18.542 18.542", className: `icon-svg icon-light-mode ${className || ""}`, children: /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("path", { d: "M9.271,11.229c.5413,0,1.003-.191,1.385-.573,.382-.382,.573-.8437,.573-1.385s-.191-1.003-.573-1.385c-.382-.382-.8437-.573-1.385-.573s-1.003,.191-1.385,.573-.573,.8437-.573,1.385,.191,1.003,.573,1.385c.382,.382,.8437,.573,1.385,.573Zm0,2.042c-1.1113,0-2.0557-.389-2.833-1.167-.778-.7773-1.167-1.7217-1.167-2.833s.389-2.0557,1.167-2.833c.7773-.778,1.7217-1.167,2.833-1.167s2.0557,.389,2.833,1.167c.778,.7773,1.167,1.7217,1.167,2.833s-.389,2.0557-1.167,2.833c-.7773,.778-1.7217,1.167-2.833,1.167ZM1.021,10.292c-.278,0-.5177-.0973-.719-.292C.1007,9.806,0,9.563,0,9.271c0-.278,.1007-.5177,.302-.719s.441-.302,.719-.302H3.021c.278,0,.5177,.0973,.719,.292,.2013,.194,.302,.437,.302,.729,0,.278-.1007,.5177-.302,.719-.2013,.2013-.441,.302-.719,.302H1.021Zm14.5,0c-.278,0-.5177-.0973-.719-.292-.2013-.194-.302-.437-.302-.729,0-.278,.1007-.5177,.302-.719,.2013-.2013,.441-.302,.719-.302h2c.278,0,.5177,.0973,.719,.292,.2013,.194,.302,.437,.302,.729,0,.278-.1007,.5177-.302,.719-.2013,.2013-.441,.302-.719,.302h-2Zm-6.25-6.25c-.278,0-.5177-.1007-.719-.302s-.302-.441-.302-.719V1.021c0-.278,.0973-.5177,.292-.719,.194-.2013,.437-.302,.729-.302,.278,0,.5177,.1007,.719,.302,.2013,.2013,.302,.441,.302,.719V3.021c0,.278-.0973,.5177-.292,.719-.194,.2013-.437,.302-.729,.302Zm0,14.5c-.278,0-.5177-.1007-.719-.302-.2013-.2013-.302-.441-.302-.719v-2c0-.278,.0973-.5177,.292-.719,.194-.2013,.437-.302,.729-.302,.278,0,.5177,.1007,.719,.302,.2013,.2013,.302,.441,.302,.719v2c0,.278-.0973,.5177-.292,.719-.194,.2013-.437,.302-.729,.302ZM4.125,5.583l-1.042-1.062c-.208-.1947-.312-.4307-.312-.708,0-.278,.104-.5213,.312-.73,.1947-.208,.431-.312,.709-.312s.514,.104,.708,.312l1.083,1.042c.2087,.1947,.3097,.431,.303,.709-.0073,.2773-.1083,.5203-.303,.729-.194,.208-.4333,.3157-.718,.323-.2847,.0067-.5313-.0943-.74-.303ZM14.042,15.459l-1.083-1.042c-.2087-.1947-.313-.4307-.313-.708,0-.278,.1043-.5213,.313-.73,.194-.208,.4333-.312,.718-.312s.5313,.104,.74,.312l1.042,1.042c.208,.1947,.312,.4307,.312,.708,0,.278-.0973,.5213-.292,.73-.208,.208-.4473,.312-.718,.312-.2713,0-.511-.104-.719-.312Zm-1.063-9.876c-.208-.194-.312-.4333-.312-.718s.104-.5313,.312-.74l1.042-1.042c.208-.208,.4477-.3087,.719-.302,.2707,.0073,.5103,.108,.719,.302,.208,.1947,.312,.4273,.312,.698,0,.2713-.104,.511-.312,.719l-1.042,1.083c-.1947,.2087-.4307,.3097-.708,.303-.278-.0073-.5213-.1083-.73-.303ZM3.083,15.459c-.208-.1947-.312-.431-.312-.709s.104-.514,.312-.708l1.042-1.083c.1947-.1947,.4307-.292,.708-.292,.278,0,.5213,.0973,.73,.292,.208,.208,.3087,.451,.302,.729-.0073,.2773-.108,.5203-.302,.729l-1.042,1.042c-.1947,.208-.4307,.312-.708,.312-.278,0-.5213-.104-.73-.312Z" }) }) })
|
|
4779
|
+
isDisabled: propTypesExports.bool,
|
|
4780
|
+
label: propTypesExports.string.isRequired,
|
|
4781
|
+
// e => ... do something with e.target.value ...; can be omitted so as to be uncontrolled OR if changes are sent through form's onChange
|
|
4782
|
+
onChange: propTypesExports.func,
|
|
4783
|
+
// when enter key pressed in field, submit the form
|
|
4784
|
+
onSubmit: propTypesExports.func,
|
|
4785
|
+
value: propTypesExports.string
|
|
4585
4786
|
};
|
|
4586
|
-
const
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
return [state, setState];
|
|
4787
|
+
const defaultProps$C = {
|
|
4788
|
+
children: null,
|
|
4789
|
+
className: null,
|
|
4790
|
+
errorMessage: null,
|
|
4791
|
+
innerRef: null,
|
|
4792
|
+
isDisabled: false,
|
|
4793
|
+
onChange: null,
|
|
4794
|
+
onSubmit: null,
|
|
4795
|
+
value: null
|
|
4596
4796
|
};
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4797
|
+
function Select({
|
|
4798
|
+
children,
|
|
4799
|
+
className,
|
|
4800
|
+
errorMessage,
|
|
4801
|
+
innerRef,
|
|
4802
|
+
id,
|
|
4803
|
+
isDisabled,
|
|
4804
|
+
label,
|
|
4805
|
+
onChange,
|
|
4806
|
+
onSubmit,
|
|
4807
|
+
value,
|
|
4808
|
+
...rest
|
|
4809
|
+
}) {
|
|
4810
|
+
const {
|
|
4811
|
+
currentErrorMessage,
|
|
4812
|
+
currentOnChange,
|
|
4813
|
+
currentOnFormKeyPress,
|
|
4814
|
+
currentValue
|
|
4815
|
+
} = useCurrentValuesFromForm({
|
|
4816
|
+
errorMessage,
|
|
4817
|
+
id,
|
|
4818
|
+
onChange,
|
|
4819
|
+
onSubmit,
|
|
4820
|
+
value
|
|
4821
|
+
});
|
|
4822
|
+
return /* @__PURE__ */ jsxs("div", { className: "input-wrapper input-wrapper--select", children: [
|
|
4823
|
+
/* @__PURE__ */ jsx("label", { htmlFor: id, children: label }),
|
|
4824
|
+
/* @__PURE__ */ jsx(
|
|
4825
|
+
"select",
|
|
4826
|
+
{
|
|
4827
|
+
"aria-describedby": currentErrorMessage ? `${id}-error` : null,
|
|
4828
|
+
className,
|
|
4829
|
+
disabled: isDisabled,
|
|
4830
|
+
id,
|
|
4831
|
+
name: id,
|
|
4832
|
+
onChange: currentOnChange,
|
|
4833
|
+
onKeyPress: currentOnFormKeyPress,
|
|
4834
|
+
ref: innerRef,
|
|
4835
|
+
value: currentValue,
|
|
4836
|
+
...rest,
|
|
4837
|
+
children
|
|
4838
|
+
}
|
|
4839
|
+
),
|
|
4840
|
+
/* @__PURE__ */ jsx(ErrorMessage, { errorMessage: currentErrorMessage, id })
|
|
4841
|
+
] });
|
|
4842
|
+
}
|
|
4843
|
+
Select.propTypes = propTypes$C;
|
|
4844
|
+
Select.defaultProps = defaultProps$C;
|
|
4845
|
+
const propTypes$B = {
|
|
4605
4846
|
className: propTypesExports.string,
|
|
4606
|
-
// the base color of the button
|
|
4607
|
-
color: propTypesExports.oneOf([
|
|
4608
|
-
componentColors.PRIMARY,
|
|
4609
|
-
componentColors.SECONDARY,
|
|
4610
|
-
componentColors.ACCENT,
|
|
4611
|
-
componentColors.NONE
|
|
4612
|
-
]),
|
|
4613
|
-
// the icon for the button
|
|
4614
|
-
icon: propTypesExports.node.isRequired,
|
|
4615
|
-
// the button id
|
|
4616
|
-
id: propTypesExports.string,
|
|
4617
|
-
// a ref to attach to the actual DOM <button> element
|
|
4618
4847
|
innerRef: RefShape,
|
|
4619
|
-
// button isDisabled state
|
|
4620
4848
|
isDisabled: propTypesExports.bool,
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
formElementSizesEnum.SMALL1X,
|
|
4625
|
-
formElementSizesEnum.SMALL,
|
|
4626
|
-
formElementSizesEnum.MEDIUM,
|
|
4627
|
-
formElementSizesEnum.LARGE,
|
|
4628
|
-
formElementSizesEnum.LARGE1X
|
|
4629
|
-
]),
|
|
4630
|
-
// A title is used for accessibility purposes to describe the button for screen readers
|
|
4631
|
-
title: propTypesExports.string.isRequired
|
|
4849
|
+
label: propTypesExports.string.isRequired,
|
|
4850
|
+
// eslint-disable-next-line react/forbid-prop-types
|
|
4851
|
+
value: propTypesExports.any.isRequired
|
|
4632
4852
|
};
|
|
4633
|
-
const defaultProps$
|
|
4634
|
-
appearance: ICON_BUTTON_APPEARANCE.OUTLINED,
|
|
4853
|
+
const defaultProps$B = {
|
|
4635
4854
|
className: null,
|
|
4636
|
-
color: componentColors.NONE,
|
|
4637
|
-
id: null,
|
|
4638
4855
|
innerRef: null,
|
|
4639
|
-
isDisabled: false
|
|
4640
|
-
size: formElementSizesEnum.MEDIUM
|
|
4856
|
+
isDisabled: false
|
|
4641
4857
|
};
|
|
4642
|
-
function
|
|
4643
|
-
appearance,
|
|
4858
|
+
function SelectOption({
|
|
4644
4859
|
className,
|
|
4645
|
-
color,
|
|
4646
|
-
icon,
|
|
4647
|
-
id,
|
|
4648
4860
|
innerRef,
|
|
4649
4861
|
isDisabled,
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
title,
|
|
4862
|
+
label,
|
|
4863
|
+
value,
|
|
4653
4864
|
...rest
|
|
4654
4865
|
}) {
|
|
4655
|
-
return /* @__PURE__ */
|
|
4656
|
-
"
|
|
4866
|
+
return /* @__PURE__ */ jsx(
|
|
4867
|
+
"option",
|
|
4657
4868
|
{
|
|
4658
|
-
className
|
|
4659
|
-
"button icon-button",
|
|
4660
|
-
className,
|
|
4661
|
-
`${appearance === ICON_BUTTON_APPEARANCE.BORDERLESS ? "icon-button--" : "button--"}${appearance}`,
|
|
4662
|
-
// default color is none
|
|
4663
|
-
color && color !== "none" ? `button--${color}-color` : null,
|
|
4664
|
-
// default size is medium
|
|
4665
|
-
size && size !== formElementSizesEnum.MEDIUM ? `icon-button--${size}` : null
|
|
4666
|
-
),
|
|
4869
|
+
className,
|
|
4667
4870
|
disabled: isDisabled,
|
|
4668
|
-
id,
|
|
4669
|
-
onClick: handleEvent(onClick),
|
|
4670
4871
|
ref: innerRef,
|
|
4671
|
-
|
|
4872
|
+
value,
|
|
4672
4873
|
...rest,
|
|
4673
|
-
children:
|
|
4674
|
-
icon,
|
|
4675
|
-
/* @__PURE__ */ jsx("span", { className: "visually-hidden", children: title })
|
|
4676
|
-
]
|
|
4874
|
+
children: label
|
|
4677
4875
|
}
|
|
4678
4876
|
);
|
|
4679
4877
|
}
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
const propTypes$
|
|
4683
|
-
|
|
4684
|
-
|
|
4878
|
+
SelectOption.propTypes = propTypes$B;
|
|
4879
|
+
SelectOption.defaultProps = defaultProps$B;
|
|
4880
|
+
const propTypes$A = {
|
|
4881
|
+
className: propTypesExports.string,
|
|
4882
|
+
errorMessage: propTypesExports.string,
|
|
4883
|
+
// id of the input; when tied to a Form the `id` is also the 'dot' path to the data in the form's state: ie person.contact.address.line1
|
|
4884
|
+
id: propTypesExports.string.isRequired,
|
|
4885
|
+
innerRef: RefShape,
|
|
4886
|
+
isDisabled: propTypesExports.bool,
|
|
4887
|
+
label: propTypesExports.string.isRequired,
|
|
4888
|
+
labelClassName: propTypesExports.string,
|
|
4889
|
+
labelOff: propTypesExports.node,
|
|
4890
|
+
labelOn: propTypesExports.node,
|
|
4891
|
+
// e => ... do something with e.target.value ...; can be omitted so as to be uncontrolled OR if changes are sent through form's onChange
|
|
4892
|
+
onChange: propTypesExports.func,
|
|
4893
|
+
// when enter key pressed in field, submit the form
|
|
4894
|
+
onSubmit: propTypesExports.func,
|
|
4895
|
+
size: propTypesExports.oneOf([formElementSizesEnum.SMALL, formElementSizesEnum.MEDIUM, formElementSizesEnum.LARGE]),
|
|
4896
|
+
sliderChildren: propTypesExports.node,
|
|
4897
|
+
value: propTypesExports.bool,
|
|
4898
|
+
width: propTypesExports.number
|
|
4685
4899
|
};
|
|
4686
|
-
const defaultProps$
|
|
4687
|
-
|
|
4900
|
+
const defaultProps$A = {
|
|
4901
|
+
className: null,
|
|
4902
|
+
errorMessage: null,
|
|
4903
|
+
innerRef: null,
|
|
4904
|
+
isDisabled: false,
|
|
4905
|
+
labelClassName: "",
|
|
4906
|
+
labelOff: null,
|
|
4907
|
+
labelOn: null,
|
|
4908
|
+
onChange: null,
|
|
4909
|
+
onSubmit: null,
|
|
4910
|
+
size: formElementSizesEnum.MEDIUM,
|
|
4911
|
+
sliderChildren: null,
|
|
4912
|
+
value: null,
|
|
4913
|
+
width: null
|
|
4688
4914
|
};
|
|
4689
|
-
function
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4915
|
+
function Switch({
|
|
4916
|
+
className,
|
|
4917
|
+
errorMessage,
|
|
4918
|
+
id,
|
|
4919
|
+
innerRef,
|
|
4920
|
+
isDisabled,
|
|
4921
|
+
label,
|
|
4922
|
+
labelClassName,
|
|
4923
|
+
labelOn,
|
|
4924
|
+
labelOff,
|
|
4925
|
+
onChange,
|
|
4926
|
+
onSubmit,
|
|
4927
|
+
size,
|
|
4928
|
+
sliderChildren,
|
|
4929
|
+
value,
|
|
4930
|
+
width,
|
|
4931
|
+
...rest
|
|
4932
|
+
}) {
|
|
4933
|
+
const {
|
|
4934
|
+
currentErrorMessage,
|
|
4935
|
+
currentOnChange,
|
|
4936
|
+
currentOnFormKeyPress,
|
|
4937
|
+
currentValue
|
|
4938
|
+
} = useCurrentValuesFromForm({
|
|
4939
|
+
errorMessage,
|
|
4940
|
+
id,
|
|
4941
|
+
onChange,
|
|
4942
|
+
onSubmit,
|
|
4943
|
+
value
|
|
4944
|
+
});
|
|
4945
|
+
return /* @__PURE__ */ jsxs(
|
|
4946
|
+
"div",
|
|
4947
|
+
{
|
|
4948
|
+
className: "input-wrapper input-wrapper--switch",
|
|
4949
|
+
ref: innerRef,
|
|
4950
|
+
children: [
|
|
4951
|
+
/* @__PURE__ */ jsxs(
|
|
4952
|
+
"label",
|
|
4953
|
+
{
|
|
4954
|
+
className: joinClassNames(
|
|
4955
|
+
"switch__wrapper",
|
|
4956
|
+
size === formElementSizesEnum.MEDIUM ? null : `switch--${size}`,
|
|
4957
|
+
isDisabled ? "switch--disabled" : null,
|
|
4958
|
+
currentValue && "switch__wrapper--on"
|
|
4959
|
+
),
|
|
4960
|
+
htmlFor: id,
|
|
4961
|
+
style: width && { width: `${width}px` },
|
|
4962
|
+
children: [
|
|
4963
|
+
/* @__PURE__ */ jsx("span", { className: joinClassNames("switch__label", labelClassName), children: label }),
|
|
4964
|
+
/* @__PURE__ */ jsx(
|
|
4965
|
+
"input",
|
|
4966
|
+
{
|
|
4967
|
+
"aria-describedby": currentErrorMessage ? `${id}-error` : null,
|
|
4968
|
+
checked: currentValue,
|
|
4969
|
+
className: joinClassNames("switch visually-hidden", className),
|
|
4970
|
+
disabled: isDisabled,
|
|
4971
|
+
id,
|
|
4972
|
+
name: id,
|
|
4973
|
+
onChange: currentOnChange,
|
|
4974
|
+
onKeyPress: currentOnFormKeyPress,
|
|
4975
|
+
type: "checkbox",
|
|
4976
|
+
...rest
|
|
4977
|
+
}
|
|
4978
|
+
),
|
|
4979
|
+
/* @__PURE__ */ jsx("span", { className: joinClassNames("switch__slider", currentValue && "switch__slider--on"), children: sliderChildren }),
|
|
4980
|
+
labelOn || labelOff ? /* @__PURE__ */ jsxs("span", { className: "switch__inner-label", children: [
|
|
4981
|
+
/* @__PURE__ */ jsx("span", { className: joinClassNames(currentValue ? "show" : "", "switch__inner-label-on"), children: labelOn }),
|
|
4982
|
+
/* @__PURE__ */ jsx("span", { className: joinClassNames(currentValue ? "" : "show", "switch__inner-label-off"), children: labelOff })
|
|
4983
|
+
] }) : null
|
|
4984
|
+
]
|
|
4985
|
+
}
|
|
4986
|
+
),
|
|
4987
|
+
/* @__PURE__ */ jsx(ErrorMessage, { errorMessage: currentErrorMessage, id })
|
|
4988
|
+
]
|
|
4989
|
+
}
|
|
4990
|
+
);
|
|
4991
|
+
}
|
|
4992
|
+
Switch.propTypes = propTypes$A;
|
|
4993
|
+
Switch.defaultProps = defaultProps$A;
|
|
4994
|
+
const propTypes$z = {
|
|
4995
|
+
className: propTypesExports.string,
|
|
4996
|
+
errorMessage: propTypesExports.string,
|
|
4997
|
+
innerRef: RefShape,
|
|
4998
|
+
// id of the input; when tied to a Form the `id` is also the 'dot' path to the data in the form's state: ie person.contact.address.line1
|
|
4999
|
+
id: propTypesExports.string.isRequired,
|
|
5000
|
+
isDisabled: propTypesExports.bool,
|
|
5001
|
+
label: propTypesExports.string.isRequired,
|
|
5002
|
+
// e => ... do something with e.target.value ...; can be omitted so as to be uncontrolled OR if changes are sent through form's onChange
|
|
5003
|
+
onChange: propTypesExports.func,
|
|
5004
|
+
// when enter key pressed in field, submit the form
|
|
5005
|
+
onSubmit: propTypesExports.func,
|
|
5006
|
+
value: propTypesExports.string
|
|
5007
|
+
};
|
|
5008
|
+
const defaultProps$z = {
|
|
5009
|
+
className: null,
|
|
5010
|
+
errorMessage: null,
|
|
5011
|
+
innerRef: null,
|
|
5012
|
+
isDisabled: false,
|
|
5013
|
+
onChange: null,
|
|
5014
|
+
onSubmit: null,
|
|
5015
|
+
value: null
|
|
5016
|
+
};
|
|
5017
|
+
function TextInput({
|
|
5018
|
+
className,
|
|
5019
|
+
errorMessage,
|
|
5020
|
+
innerRef,
|
|
5021
|
+
id,
|
|
5022
|
+
isDisabled,
|
|
5023
|
+
label,
|
|
5024
|
+
onChange,
|
|
5025
|
+
onSubmit,
|
|
5026
|
+
value,
|
|
5027
|
+
...rest
|
|
5028
|
+
}) {
|
|
5029
|
+
const {
|
|
5030
|
+
currentErrorMessage,
|
|
5031
|
+
currentOnChange,
|
|
5032
|
+
currentOnFormKeyPress,
|
|
5033
|
+
currentValue
|
|
5034
|
+
} = useCurrentValuesFromForm({
|
|
5035
|
+
errorMessage,
|
|
5036
|
+
id,
|
|
5037
|
+
onChange,
|
|
5038
|
+
onSubmit,
|
|
5039
|
+
value
|
|
5040
|
+
});
|
|
5041
|
+
return /* @__PURE__ */ jsxs("div", { className: "input-wrapper input-wrapper--text-input", children: [
|
|
5042
|
+
/* @__PURE__ */ jsx("label", { htmlFor: id, children: label }),
|
|
5043
|
+
/* @__PURE__ */ jsx(
|
|
5044
|
+
"input",
|
|
5045
|
+
{
|
|
5046
|
+
"aria-describedby": currentErrorMessage ? `${id}-error` : null,
|
|
5047
|
+
className,
|
|
5048
|
+
disabled: isDisabled,
|
|
5049
|
+
id,
|
|
5050
|
+
name: id,
|
|
5051
|
+
onChange: currentOnChange,
|
|
5052
|
+
onKeyPress: currentOnFormKeyPress,
|
|
5053
|
+
ref: innerRef,
|
|
5054
|
+
type: "text",
|
|
5055
|
+
value: currentValue,
|
|
5056
|
+
...rest
|
|
5057
|
+
}
|
|
5058
|
+
),
|
|
5059
|
+
/* @__PURE__ */ jsx(ErrorMessage, { errorMessage: currentErrorMessage, id })
|
|
5060
|
+
] });
|
|
5061
|
+
}
|
|
5062
|
+
TextInput.propTypes = propTypes$z;
|
|
5063
|
+
TextInput.defaultProps = defaultProps$z;
|
|
5064
|
+
const Icons = {
|
|
5065
|
+
IconArrowLeft: (className) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 12.334 12.334", className: `icon-svg icon-arrow-left ${className || ""}`, children: /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("path", { d: "M0,6.167L6.167,0l1.458,1.438-3.708,3.708H12.334v2.042H3.917s3.708,3.708,3.708,3.708l-1.458,1.438L0,6.167Z" }) }) }),
|
|
5066
|
+
IconArrowRight: (className) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 12.334 12.334", className: `icon-svg icon-arrow-right ${className || ""}`, children: /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("path", { d: "M6.167,12.334l-1.458-1.438,3.708-3.708H0v-2.042H8.417L4.709,1.438l1.458-1.438,6.167,6.167-6.167,6.167Z" }) }) }),
|
|
5067
|
+
IconChevron: (className) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 10.75 6.834", className: `icon-svg icon-chevron ${className || ""}`, children: /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("path", { d: "M5.375,6.834L0,1.438,1.437,0l3.938,3.938L9.313,0l1.437,1.438L5.375,6.834Z" }) }) }),
|
|
5068
|
+
IconCheck: (className) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 11.334 8.896", className: `icon-svg icon-check ${className || ""}`, children: /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("path", { d: "M3.896,8.896L0,4.979l1.438-1.438,2.458,2.459L9.896,0l1.438,1.458L3.896,8.896Z" }) }) }),
|
|
5069
|
+
IconLightMode: (className) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 18.542 18.542", className: `icon-svg icon-light-mode ${className || ""}`, children: /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("path", { d: "M9.271,11.229c.5413,0,1.003-.191,1.385-.573,.382-.382,.573-.8437,.573-1.385s-.191-1.003-.573-1.385c-.382-.382-.8437-.573-1.385-.573s-1.003,.191-1.385,.573-.573,.8437-.573,1.385,.191,1.003,.573,1.385c.382,.382,.8437,.573,1.385,.573Zm0,2.042c-1.1113,0-2.0557-.389-2.833-1.167-.778-.7773-1.167-1.7217-1.167-2.833s.389-2.0557,1.167-2.833c.7773-.778,1.7217-1.167,2.833-1.167s2.0557,.389,2.833,1.167c.778,.7773,1.167,1.7217,1.167,2.833s-.389,2.0557-1.167,2.833c-.7773,.778-1.7217,1.167-2.833,1.167ZM1.021,10.292c-.278,0-.5177-.0973-.719-.292C.1007,9.806,0,9.563,0,9.271c0-.278,.1007-.5177,.302-.719s.441-.302,.719-.302H3.021c.278,0,.5177,.0973,.719,.292,.2013,.194,.302,.437,.302,.729,0,.278-.1007,.5177-.302,.719-.2013,.2013-.441,.302-.719,.302H1.021Zm14.5,0c-.278,0-.5177-.0973-.719-.292-.2013-.194-.302-.437-.302-.729,0-.278,.1007-.5177,.302-.719,.2013-.2013,.441-.302,.719-.302h2c.278,0,.5177,.0973,.719,.292,.2013,.194,.302,.437,.302,.729,0,.278-.1007,.5177-.302,.719-.2013,.2013-.441,.302-.719,.302h-2Zm-6.25-6.25c-.278,0-.5177-.1007-.719-.302s-.302-.441-.302-.719V1.021c0-.278,.0973-.5177,.292-.719,.194-.2013,.437-.302,.729-.302,.278,0,.5177,.1007,.719,.302,.2013,.2013,.302,.441,.302,.719V3.021c0,.278-.0973,.5177-.292,.719-.194,.2013-.437,.302-.729,.302Zm0,14.5c-.278,0-.5177-.1007-.719-.302-.2013-.2013-.302-.441-.302-.719v-2c0-.278,.0973-.5177,.292-.719,.194-.2013,.437-.302,.729-.302,.278,0,.5177,.1007,.719,.302,.2013,.2013,.302,.441,.302,.719v2c0,.278-.0973,.5177-.292,.719-.194,.2013-.437,.302-.729,.302ZM4.125,5.583l-1.042-1.062c-.208-.1947-.312-.4307-.312-.708,0-.278,.104-.5213,.312-.73,.1947-.208,.431-.312,.709-.312s.514,.104,.708,.312l1.083,1.042c.2087,.1947,.3097,.431,.303,.709-.0073,.2773-.1083,.5203-.303,.729-.194,.208-.4333,.3157-.718,.323-.2847,.0067-.5313-.0943-.74-.303ZM14.042,15.459l-1.083-1.042c-.2087-.1947-.313-.4307-.313-.708,0-.278,.1043-.5213,.313-.73,.194-.208,.4333-.312,.718-.312s.5313,.104,.74,.312l1.042,1.042c.208,.1947,.312,.4307,.312,.708,0,.278-.0973,.5213-.292,.73-.208,.208-.4473,.312-.718,.312-.2713,0-.511-.104-.719-.312Zm-1.063-9.876c-.208-.194-.312-.4333-.312-.718s.104-.5313,.312-.74l1.042-1.042c.208-.208,.4477-.3087,.719-.302,.2707,.0073,.5103,.108,.719,.302,.208,.1947,.312,.4273,.312,.698,0,.2713-.104,.511-.312,.719l-1.042,1.083c-.1947,.2087-.4307,.3097-.708,.303-.278-.0073-.5213-.1083-.73-.303ZM3.083,15.459c-.208-.1947-.312-.431-.312-.709s.104-.514,.312-.708l1.042-1.083c.1947-.1947,.4307-.292,.708-.292,.278,0,.5213,.0973,.73,.292,.208,.208,.3087,.451,.302,.729-.0073,.2773-.108,.5203-.302,.729l-1.042,1.042c-.1947,.208-.4307,.312-.708,.312-.278,0-.5213-.104-.73-.312Z" }) }) })
|
|
5070
|
+
};
|
|
5071
|
+
const propTypes$y = {
|
|
5072
|
+
children: propTypesExports.node.isRequired,
|
|
5073
|
+
href: propTypesExports.string.isRequired
|
|
5074
|
+
};
|
|
5075
|
+
const defaultProps$y = {};
|
|
5076
|
+
function ExternalLink({ children, href, ...rest }) {
|
|
5077
|
+
return /* @__PURE__ */ jsxs("a", { href, target: "_blank", rel: "noreferrer", ...rest, children: [
|
|
5078
|
+
children,
|
|
5079
|
+
/* @__PURE__ */ jsxs("span", { className: "utds-new-tab-link-a11y", children: [
|
|
5080
|
+
/* @__PURE__ */ jsx("span", { className: "visually-hidden", children: "opens in a new tab" }),
|
|
5081
|
+
/* @__PURE__ */ jsx("span", { className: "utds-icon-after-external-link", "aria-hidden": "true" })
|
|
5082
|
+
] })
|
|
5083
|
+
] });
|
|
5084
|
+
}
|
|
5085
|
+
ExternalLink.propTypes = propTypes$y;
|
|
5086
|
+
ExternalLink.defaultProps = defaultProps$y;
|
|
5087
|
+
const menuItem = {
|
|
5088
|
+
// parent menu item must have an id to tie aria attributes together
|
|
5089
|
+
id: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.number]),
|
|
5090
|
+
// if no link, then it is a "menu header" then the link is computed so there will always be a link even if it wasn't initially passed in
|
|
5091
|
+
link: propTypesExports.string,
|
|
5092
|
+
// the parent menu links for this menu as calculated in `calculateMenuItemsParents()`
|
|
5093
|
+
parentLinks: propTypesExports.arrayOf(propTypesExports.string),
|
|
5094
|
+
// the title to show for the menu item
|
|
5095
|
+
title: propTypesExports.string.isRequired
|
|
5096
|
+
};
|
|
5097
|
+
menuItem.children = propTypesExports.arrayOf(propTypesExports.exact(menuItem));
|
|
5098
|
+
const MenuItemShape = propTypesExports.exact(menuItem);
|
|
5099
|
+
const MenuItemsShape = propTypesExports.arrayOf(MenuItemShape);
|
|
5100
|
+
const MenuShape = propTypesExports.exact({
|
|
5101
|
+
header: propTypesExports.string.isRequired,
|
|
5102
|
+
id: propTypesExports.string.isRequired,
|
|
5103
|
+
menuItems: MenuItemsShape.isRequired,
|
|
5104
|
+
titleTagClassName: propTypesExports.string,
|
|
5105
|
+
titleTagName: propTypesExports.string
|
|
5106
|
+
});
|
|
5107
|
+
const useStateEffect = ({ calculateValueFn, onUnmountFn, dependencyList }) => {
|
|
5108
|
+
const [state, setState] = useState(() => calculateValueFn(null));
|
|
5109
|
+
useEffect(
|
|
5110
|
+
() => {
|
|
5111
|
+
setState((previousState) => calculateValueFn(previousState));
|
|
5112
|
+
return onUnmountFn;
|
|
5113
|
+
},
|
|
5114
|
+
dependencyList
|
|
5115
|
+
);
|
|
5116
|
+
return [state, setState];
|
|
5117
|
+
};
|
|
5118
|
+
const propTypes$x = {
|
|
5119
|
+
currentMenuItem: MenuItemShape,
|
|
5120
|
+
menuItem: MenuItemShape.isRequired
|
|
5121
|
+
};
|
|
5122
|
+
const defaultProps$x = {
|
|
5123
|
+
currentMenuItem: null
|
|
5124
|
+
};
|
|
5125
|
+
function MenuItem({ currentMenuItem, menuItem: menuItem2 }) {
|
|
5126
|
+
var _a, _b, _c;
|
|
5127
|
+
const { pathname } = useLocation();
|
|
5128
|
+
const [isChildrenOpen, setIsChildrenOpen] = useStateEffect({
|
|
5129
|
+
calculateValueFn: (isChildrenOpenPreviously) => {
|
|
5130
|
+
var _a2;
|
|
5131
|
+
return isChildrenOpenPreviously || ((_a2 = currentMenuItem == null ? void 0 : currentMenuItem.parentLinks) == null ? void 0 : _a2.includes(menuItem2.link));
|
|
5132
|
+
},
|
|
5133
|
+
dependencyList: [currentMenuItem, menuItem2, pathname]
|
|
4698
5134
|
});
|
|
4699
5135
|
const navLinkRef = useRef(null);
|
|
4700
5136
|
useLayoutEffect(
|
|
@@ -4762,9 +5198,9 @@ function MenuItem({ currentMenuItem, menuItem: menuItem2 }) {
|
|
|
4762
5198
|
)) }) : null
|
|
4763
5199
|
] });
|
|
4764
5200
|
}
|
|
4765
|
-
MenuItem.propTypes = propTypes$
|
|
4766
|
-
MenuItem.defaultProps = defaultProps$
|
|
4767
|
-
const propTypes$
|
|
5201
|
+
MenuItem.propTypes = propTypes$x;
|
|
5202
|
+
MenuItem.defaultProps = defaultProps$x;
|
|
5203
|
+
const propTypes$w = {
|
|
4768
5204
|
className: propTypesExports.string,
|
|
4769
5205
|
currentMenuItem: MenuItemShape,
|
|
4770
5206
|
// used for accessibility labeling
|
|
@@ -4773,7 +5209,7 @@ const propTypes$E = {
|
|
|
4773
5209
|
titleTagClassName: propTypesExports.string,
|
|
4774
5210
|
titleTagName: propTypesExports.string
|
|
4775
5211
|
};
|
|
4776
|
-
const defaultProps$
|
|
5212
|
+
const defaultProps$w = {
|
|
4777
5213
|
className: null,
|
|
4778
5214
|
currentMenuItem: null,
|
|
4779
5215
|
titleTagClassName: "visually-hidden",
|
|
@@ -4793,38 +5229,33 @@ function HorizontalMenu({
|
|
|
4793
5229
|
/* @__PURE__ */ jsx("ul", { children: (_a = menu == null ? void 0 : menu.menuItems) == null ? void 0 : _a.map((menuItem2) => /* @__PURE__ */ jsx(MenuItem, { menuItem: menuItem2, currentMenuItem }, `horizontal-menu__nav-link__${menuItem2.link}-${menuItem2.title}}`)) })
|
|
4794
5230
|
] });
|
|
4795
5231
|
}
|
|
4796
|
-
HorizontalMenu.propTypes = propTypes$
|
|
4797
|
-
HorizontalMenu.defaultProps = defaultProps$
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
const defaultProps$D = {};
|
|
4802
|
-
function LandingTemplate({ content: Content }) {
|
|
4803
|
-
return /* @__PURE__ */ jsx(Content, {});
|
|
5232
|
+
HorizontalMenu.propTypes = propTypes$w;
|
|
5233
|
+
HorizontalMenu.defaultProps = defaultProps$w;
|
|
5234
|
+
function htmlDecode(input) {
|
|
5235
|
+
const doc = new DOMParser().parseFromString(input, "text/html");
|
|
5236
|
+
return doc.documentElement.textContent;
|
|
4804
5237
|
}
|
|
4805
|
-
LandingTemplate.propTypes = propTypes$D;
|
|
4806
|
-
LandingTemplate.defaultProps = defaultProps$D;
|
|
4807
5238
|
const headerShape = propTypesExports.shape({ node: propTypesExports.shape({}), level: propTypesExports.oneOf([2, 3]) });
|
|
4808
5239
|
headerShape.children = propTypesExports.arrayOf(headerShape);
|
|
4809
|
-
const propTypes$
|
|
5240
|
+
const propTypes$v = {
|
|
4810
5241
|
headersLevel: propTypesExports.arrayOf(headerShape).isRequired
|
|
4811
5242
|
};
|
|
4812
|
-
const defaultProps$
|
|
5243
|
+
const defaultProps$v = {};
|
|
4813
5244
|
function OnThisPageHeadersLevel({ headersLevel }) {
|
|
4814
5245
|
return /* @__PURE__ */ jsx("ul", { className: "on-this-page__list", children: headersLevel.map((header) => {
|
|
4815
5246
|
var _a;
|
|
4816
5247
|
let node = null;
|
|
4817
5248
|
if (header.node.id) {
|
|
4818
5249
|
node = /* @__PURE__ */ jsxs("li", { children: [
|
|
4819
|
-
/* @__PURE__ */ jsx("a", { href: `#${header.node.id}`, children: header.node.innerHTML }),
|
|
5250
|
+
/* @__PURE__ */ jsx("a", { href: `#${header.node.id}`, children: htmlDecode(header.node.innerHTML) }),
|
|
4820
5251
|
((_a = header.children) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsx(OnThisPageHeadersLevel, { headersLevel: header.children }) : null
|
|
4821
5252
|
] }, `on-this-page-ul-${header.node.id}`);
|
|
4822
5253
|
}
|
|
4823
5254
|
return node;
|
|
4824
5255
|
}) });
|
|
4825
5256
|
}
|
|
4826
|
-
OnThisPageHeadersLevel.propTypes = propTypes$
|
|
4827
|
-
OnThisPageHeadersLevel.defaultProps = defaultProps$
|
|
5257
|
+
OnThisPageHeadersLevel.propTypes = propTypes$v;
|
|
5258
|
+
OnThisPageHeadersLevel.defaultProps = defaultProps$v;
|
|
4828
5259
|
function findElementsByTagNameMatch(element) {
|
|
4829
5260
|
return [
|
|
4830
5261
|
element && element.tagName.match(/^h[23]$/i) ? element : null,
|
|
@@ -4855,10 +5286,10 @@ function groupElementsByHeaderLevel(headers) {
|
|
|
4855
5286
|
});
|
|
4856
5287
|
return nodesHierarchy;
|
|
4857
5288
|
}
|
|
4858
|
-
const propTypes$
|
|
5289
|
+
const propTypes$u = {
|
|
4859
5290
|
contentRef: RefShape.isRequired
|
|
4860
5291
|
};
|
|
4861
|
-
const defaultProps$
|
|
5292
|
+
const defaultProps$u = {};
|
|
4862
5293
|
function OnThisPage({ contentRef }) {
|
|
4863
5294
|
const headers = findElementsByTagNameMatch(contentRef.current);
|
|
4864
5295
|
const headersTree = groupElementsByHeaderLevel(headers);
|
|
@@ -4867,8 +5298,33 @@ function OnThisPage({ contentRef }) {
|
|
|
4867
5298
|
/* @__PURE__ */ jsx(OnThisPageHeadersLevel, { headersLevel: headersTree })
|
|
4868
5299
|
] }) : null });
|
|
4869
5300
|
}
|
|
4870
|
-
OnThisPage.propTypes = propTypes$
|
|
4871
|
-
OnThisPage.defaultProps = defaultProps$
|
|
5301
|
+
OnThisPage.propTypes = propTypes$u;
|
|
5302
|
+
OnThisPage.defaultProps = defaultProps$u;
|
|
5303
|
+
const propTypes$t = {
|
|
5304
|
+
currentMenuItem: MenuItemShape,
|
|
5305
|
+
menus: propTypesExports.arrayOf(MenuShape).isRequired
|
|
5306
|
+
};
|
|
5307
|
+
const defaultProps$t = {
|
|
5308
|
+
currentMenuItem: null
|
|
5309
|
+
};
|
|
5310
|
+
function SidePanelNavigation({ currentMenuItem, menus }) {
|
|
5311
|
+
return menus.map((menu) => {
|
|
5312
|
+
const TitleTagName = menu.titleTagName || "h2";
|
|
5313
|
+
return /* @__PURE__ */ jsxs("nav", { className: "menu-side-panel", "aria-labelledby": menu.id, children: [
|
|
5314
|
+
/* @__PURE__ */ jsx(
|
|
5315
|
+
TitleTagName,
|
|
5316
|
+
{
|
|
5317
|
+
id: menu.id,
|
|
5318
|
+
className: joinClassNames(menu.titleTagClassName, "menu-side-panel__header"),
|
|
5319
|
+
children: menu.header
|
|
5320
|
+
}
|
|
5321
|
+
),
|
|
5322
|
+
/* @__PURE__ */ jsx("ul", { role: "menu", children: menu.menuItems.map((menuItem2) => /* @__PURE__ */ jsx(MenuItem, { currentMenuItem, menuItem: menuItem2 }, `menu-side-panel__menu-item__${menuItem2.link}-${menuItem2.title}}`)) }, `side-panel-navigation-menu__${menu.id}`)
|
|
5323
|
+
] }, `side-panel-navigation-menu__${menu.id}`);
|
|
5324
|
+
});
|
|
5325
|
+
}
|
|
5326
|
+
SidePanelNavigation.propTypes = propTypes$t;
|
|
5327
|
+
SidePanelNavigation.defaultProps = defaultProps$t;
|
|
4872
5328
|
function useComponentState({ defaultValue, onChange, value }) {
|
|
4873
5329
|
const [currentValue, setCurrentValue] = useState(value === void 0 ? defaultValue : value);
|
|
4874
5330
|
return {
|
|
@@ -4876,7 +5332,7 @@ function useComponentState({ defaultValue, onChange, value }) {
|
|
|
4876
5332
|
value: value === void 0 ? currentValue : value
|
|
4877
5333
|
};
|
|
4878
5334
|
}
|
|
4879
|
-
const propTypes$
|
|
5335
|
+
const propTypes$s = {
|
|
4880
5336
|
className: propTypesExports.string,
|
|
4881
5337
|
// starting page number (for uncontrolled)
|
|
4882
5338
|
defaultValue: propTypesExports.number,
|
|
@@ -4890,7 +5346,7 @@ const propTypes$A = {
|
|
|
4890
5346
|
// controlled component: value is the current page number (0 based-index)
|
|
4891
5347
|
value: propTypesExports.number
|
|
4892
5348
|
};
|
|
4893
|
-
const defaultProps$
|
|
5349
|
+
const defaultProps$s = {
|
|
4894
5350
|
className: null,
|
|
4895
5351
|
defaultValue: 0,
|
|
4896
5352
|
id: null,
|
|
@@ -4961,8 +5417,20 @@ function Pagination({
|
|
|
4961
5417
|
)
|
|
4962
5418
|
] });
|
|
4963
5419
|
}
|
|
4964
|
-
Pagination.propTypes = propTypes$
|
|
4965
|
-
Pagination.defaultProps = defaultProps$
|
|
5420
|
+
Pagination.propTypes = propTypes$s;
|
|
5421
|
+
Pagination.defaultProps = defaultProps$s;
|
|
5422
|
+
function usePaginatedList({ list, pageIndex, itemsPerPage }) {
|
|
5423
|
+
const [paginatedList] = useStateEffect({
|
|
5424
|
+
calculateValueFn: () => {
|
|
5425
|
+
const totalPages = Math.ceil(list.length / itemsPerPage);
|
|
5426
|
+
const startIndex = totalPages ? Math.max(Math.min(totalPages - 1, pageIndex) * itemsPerPage) : 0;
|
|
5427
|
+
const endIndex = startIndex + itemsPerPage;
|
|
5428
|
+
return list.slice(startIndex, endIndex);
|
|
5429
|
+
},
|
|
5430
|
+
dependencyList: [list, pageIndex, itemsPerPage]
|
|
5431
|
+
});
|
|
5432
|
+
return paginatedList;
|
|
5433
|
+
}
|
|
4966
5434
|
var fromEntries = function fromEntries2(entries) {
|
|
4967
5435
|
return entries.reduce(function(acc, _ref) {
|
|
4968
5436
|
var key = _ref[0], value = _ref[1];
|
|
@@ -19637,10 +20105,10 @@ function requireReactDom_development() {
|
|
|
19637
20105
|
function getOwnerDocumentFromRootContainer(rootContainerElement) {
|
|
19638
20106
|
return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
|
|
19639
20107
|
}
|
|
19640
|
-
function
|
|
20108
|
+
function noop2() {
|
|
19641
20109
|
}
|
|
19642
20110
|
function trapClickOnNonInteractiveElement(node) {
|
|
19643
|
-
node.onclick =
|
|
20111
|
+
node.onclick = noop2;
|
|
19644
20112
|
}
|
|
19645
20113
|
function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
|
|
19646
20114
|
for (var propKey in nextProps) {
|
|
@@ -35450,6 +35918,68 @@ var usePopper = function usePopper2(referenceElement, popperElement, options) {
|
|
|
35450
35918
|
forceUpdate: popperInstanceRef.current ? popperInstanceRef.current.forceUpdate : null
|
|
35451
35919
|
};
|
|
35452
35920
|
};
|
|
35921
|
+
const popupPlacement = {
|
|
35922
|
+
AUTO: (
|
|
35923
|
+
/** @type {PopupPlacement} */
|
|
35924
|
+
"auto"
|
|
35925
|
+
),
|
|
35926
|
+
AUTO_START: (
|
|
35927
|
+
/** @type {PopupPlacement} */
|
|
35928
|
+
"auto-start"
|
|
35929
|
+
),
|
|
35930
|
+
AUTO_END: (
|
|
35931
|
+
/** @type {PopupPlacement} */
|
|
35932
|
+
"auto-end"
|
|
35933
|
+
),
|
|
35934
|
+
BOTTOM: (
|
|
35935
|
+
/** @type {PopupPlacement} */
|
|
35936
|
+
"bottom"
|
|
35937
|
+
),
|
|
35938
|
+
BOTTOM_START: (
|
|
35939
|
+
/** @type {PopupPlacement} */
|
|
35940
|
+
"bottom-start"
|
|
35941
|
+
),
|
|
35942
|
+
BOTTOM_END: (
|
|
35943
|
+
/** @type {PopupPlacement} */
|
|
35944
|
+
"bottom-end"
|
|
35945
|
+
),
|
|
35946
|
+
LEFT: (
|
|
35947
|
+
/** @type {PopupPlacement} */
|
|
35948
|
+
"left"
|
|
35949
|
+
),
|
|
35950
|
+
LEFT_START: (
|
|
35951
|
+
/** @type {PopupPlacement} */
|
|
35952
|
+
"left-start"
|
|
35953
|
+
),
|
|
35954
|
+
LEFT_END: (
|
|
35955
|
+
/** @type {PopupPlacement} */
|
|
35956
|
+
"left-end"
|
|
35957
|
+
),
|
|
35958
|
+
RIGHT: (
|
|
35959
|
+
/** @type {PopupPlacement} */
|
|
35960
|
+
"right"
|
|
35961
|
+
),
|
|
35962
|
+
RIGHT_START: (
|
|
35963
|
+
/** @type {PopupPlacement} */
|
|
35964
|
+
"right-start"
|
|
35965
|
+
),
|
|
35966
|
+
RIGHT_END: (
|
|
35967
|
+
/** @type {PopupPlacement} */
|
|
35968
|
+
"right-end"
|
|
35969
|
+
),
|
|
35970
|
+
TOP: (
|
|
35971
|
+
/** @type {PopupPlacement} */
|
|
35972
|
+
"top"
|
|
35973
|
+
),
|
|
35974
|
+
TOP_START: (
|
|
35975
|
+
/** @type {PopupPlacement} */
|
|
35976
|
+
"top-start"
|
|
35977
|
+
),
|
|
35978
|
+
TOP_END: (
|
|
35979
|
+
/** @type {PopupPlacement} */
|
|
35980
|
+
"top-end"
|
|
35981
|
+
)
|
|
35982
|
+
};
|
|
35453
35983
|
function useClickOutside(ref, handler, isDisabled = false) {
|
|
35454
35984
|
useEffect(() => {
|
|
35455
35985
|
let retVal;
|
|
@@ -35509,7 +36039,7 @@ const useGlobalKeyEvent = ({ whichKeyCode, onKeyDown, onKeyUp }) => {
|
|
|
35509
36039
|
}, []);
|
|
35510
36040
|
return keyPressed;
|
|
35511
36041
|
};
|
|
35512
|
-
const propTypes$
|
|
36042
|
+
const propTypes$r = {
|
|
35513
36043
|
// usually the id of the button that controls the popup
|
|
35514
36044
|
ariaLabelledBy: propTypesExports.string.isRequired,
|
|
35515
36045
|
// The content of the popup
|
|
@@ -35535,7 +36065,7 @@ const propTypes$z = {
|
|
|
35535
36065
|
// popup must tell its role for accessibility
|
|
35536
36066
|
role: propTypesExports.oneOf(["dialog", "grid", "listbox", "menu", "tree"]).isRequired
|
|
35537
36067
|
};
|
|
35538
|
-
const defaultProps$
|
|
36068
|
+
const defaultProps$r = {
|
|
35539
36069
|
className: null,
|
|
35540
36070
|
hasCloseButton: false,
|
|
35541
36071
|
innerRef: null,
|
|
@@ -35623,434 +36153,270 @@ function Popup({
|
|
|
35623
36153
|
}
|
|
35624
36154
|
);
|
|
35625
36155
|
}
|
|
35626
|
-
Popup.propTypes = propTypes$
|
|
35627
|
-
Popup.defaultProps = defaultProps$
|
|
35628
|
-
|
|
35629
|
-
|
|
35630
|
-
}
|
|
35631
|
-
const SegmentedButton = () => null;
|
|
35632
|
-
const propTypes$y = {
|
|
35633
|
-
// children are the options
|
|
35634
|
-
children: propTypesExports.node,
|
|
36156
|
+
Popup.propTypes = propTypes$r;
|
|
36157
|
+
Popup.defaultProps = defaultProps$r;
|
|
36158
|
+
const propTypes$q = {
|
|
36159
|
+
children: propTypesExports.node.isRequired,
|
|
35635
36160
|
className: propTypesExports.string,
|
|
35636
|
-
errorMessage: propTypesExports.string,
|
|
35637
36161
|
innerRef: RefShape,
|
|
35638
|
-
|
|
35639
|
-
id: propTypesExports.string.isRequired,
|
|
35640
|
-
isDisabled: propTypesExports.bool,
|
|
35641
|
-
label: propTypesExports.string.isRequired,
|
|
35642
|
-
// e => ... do something with e.target.value ...; can be omitted so as to be uncontrolled OR if changes are sent through form's onChange
|
|
35643
|
-
onChange: propTypesExports.func,
|
|
35644
|
-
// when enter key pressed in field, submit the form
|
|
35645
|
-
onSubmit: propTypesExports.func,
|
|
35646
|
-
value: propTypesExports.string
|
|
36162
|
+
id: propTypesExports.string
|
|
35647
36163
|
};
|
|
35648
|
-
const defaultProps$
|
|
35649
|
-
children: null,
|
|
36164
|
+
const defaultProps$q = {
|
|
35650
36165
|
className: null,
|
|
35651
|
-
errorMessage: null,
|
|
35652
36166
|
innerRef: null,
|
|
35653
|
-
|
|
35654
|
-
onChange: null,
|
|
35655
|
-
onSubmit: null,
|
|
35656
|
-
value: null
|
|
36167
|
+
id: null
|
|
35657
36168
|
};
|
|
35658
|
-
function
|
|
36169
|
+
function Table({
|
|
35659
36170
|
children,
|
|
35660
36171
|
className,
|
|
35661
|
-
errorMessage,
|
|
35662
36172
|
innerRef,
|
|
35663
36173
|
id,
|
|
35664
|
-
isDisabled,
|
|
35665
|
-
label,
|
|
35666
|
-
onChange,
|
|
35667
|
-
onSubmit,
|
|
35668
|
-
value,
|
|
35669
36174
|
...rest
|
|
35670
36175
|
}) {
|
|
35671
|
-
|
|
35672
|
-
currentErrorMessage,
|
|
35673
|
-
currentOnChange,
|
|
35674
|
-
currentOnFormKeyPress,
|
|
35675
|
-
currentValue
|
|
35676
|
-
} = useCurrentValuesFromForm({
|
|
35677
|
-
errorMessage,
|
|
35678
|
-
id,
|
|
35679
|
-
onChange,
|
|
35680
|
-
onSubmit,
|
|
35681
|
-
value
|
|
35682
|
-
});
|
|
35683
|
-
return /* @__PURE__ */ jsxs("div", { className: "input-wrapper input-wrapper--select", children: [
|
|
35684
|
-
/* @__PURE__ */ jsx("label", { htmlFor: id, children: label }),
|
|
35685
|
-
/* @__PURE__ */ jsx(
|
|
35686
|
-
"select",
|
|
35687
|
-
{
|
|
35688
|
-
"aria-describedby": currentErrorMessage ? `${id}-error` : null,
|
|
35689
|
-
className,
|
|
35690
|
-
disabled: isDisabled,
|
|
35691
|
-
id,
|
|
35692
|
-
name: id,
|
|
35693
|
-
onChange: currentOnChange,
|
|
35694
|
-
onKeyPress: currentOnFormKeyPress,
|
|
35695
|
-
ref: innerRef,
|
|
35696
|
-
value: currentValue,
|
|
35697
|
-
...rest,
|
|
35698
|
-
children
|
|
35699
|
-
}
|
|
35700
|
-
),
|
|
35701
|
-
/* @__PURE__ */ jsx(ErrorMessage, { errorMessage: currentErrorMessage, id })
|
|
35702
|
-
] });
|
|
36176
|
+
return /* @__PURE__ */ jsx("table", { className: joinClassNames("some-table-classname", className), id, ref: innerRef, role: "grid", ...rest, children });
|
|
35703
36177
|
}
|
|
35704
|
-
|
|
35705
|
-
|
|
35706
|
-
const propTypes$
|
|
36178
|
+
Table.propTypes = propTypes$q;
|
|
36179
|
+
Table.defaultProps = defaultProps$q;
|
|
36180
|
+
const propTypes$p = {
|
|
36181
|
+
children: propTypesExports.node,
|
|
35707
36182
|
className: propTypesExports.string,
|
|
35708
36183
|
innerRef: RefShape,
|
|
35709
|
-
|
|
35710
|
-
label: propTypesExports.string.isRequired,
|
|
35711
|
-
// eslint-disable-next-line react/forbid-prop-types
|
|
35712
|
-
value: propTypesExports.any.isRequired
|
|
36184
|
+
id: propTypesExports.string
|
|
35713
36185
|
};
|
|
35714
|
-
const defaultProps$
|
|
36186
|
+
const defaultProps$p = {
|
|
36187
|
+
children: null,
|
|
35715
36188
|
className: null,
|
|
35716
36189
|
innerRef: null,
|
|
35717
|
-
|
|
36190
|
+
id: null
|
|
35718
36191
|
};
|
|
35719
|
-
function
|
|
36192
|
+
function TableBody({
|
|
36193
|
+
children,
|
|
35720
36194
|
className,
|
|
35721
36195
|
innerRef,
|
|
35722
|
-
|
|
35723
|
-
label,
|
|
35724
|
-
value,
|
|
36196
|
+
id,
|
|
35725
36197
|
...rest
|
|
35726
36198
|
}) {
|
|
35727
|
-
return /* @__PURE__ */ jsx(
|
|
35728
|
-
|
|
35729
|
-
|
|
35730
|
-
|
|
35731
|
-
|
|
35732
|
-
|
|
35733
|
-
|
|
35734
|
-
|
|
35735
|
-
|
|
36199
|
+
return /* @__PURE__ */ jsx("tbody", { className: joinClassNames("some-TableBody-classname", className), id, ref: innerRef, ...rest, children });
|
|
36200
|
+
}
|
|
36201
|
+
TableBody.propTypes = propTypes$p;
|
|
36202
|
+
TableBody.defaultProps = defaultProps$p;
|
|
36203
|
+
let getRandomValues;
|
|
36204
|
+
const rnds8 = new Uint8Array(16);
|
|
36205
|
+
function rng() {
|
|
36206
|
+
if (!getRandomValues) {
|
|
36207
|
+
getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
36208
|
+
if (!getRandomValues) {
|
|
36209
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
35736
36210
|
}
|
|
35737
|
-
|
|
36211
|
+
}
|
|
36212
|
+
return getRandomValues(rnds8);
|
|
35738
36213
|
}
|
|
35739
|
-
|
|
35740
|
-
|
|
35741
|
-
|
|
35742
|
-
currentMenuItem: MenuItemShape,
|
|
35743
|
-
menus: propTypesExports.arrayOf(MenuShape).isRequired
|
|
35744
|
-
};
|
|
35745
|
-
const defaultProps$w = {
|
|
35746
|
-
currentMenuItem: null
|
|
35747
|
-
};
|
|
35748
|
-
function SidePanelNavigation({ currentMenuItem, menus }) {
|
|
35749
|
-
return menus.map((menu) => {
|
|
35750
|
-
const TitleTagName = menu.titleTagName || "h2";
|
|
35751
|
-
return /* @__PURE__ */ jsxs("nav", { className: "menu-side-panel", "aria-labelledby": menu.id, children: [
|
|
35752
|
-
/* @__PURE__ */ jsx(
|
|
35753
|
-
TitleTagName,
|
|
35754
|
-
{
|
|
35755
|
-
id: menu.id,
|
|
35756
|
-
className: joinClassNames(menu.titleTagClassName, "menu-side-panel__header"),
|
|
35757
|
-
children: menu.header
|
|
35758
|
-
}
|
|
35759
|
-
),
|
|
35760
|
-
/* @__PURE__ */ jsx("ul", { role: "menu", children: menu.menuItems.map((menuItem2) => /* @__PURE__ */ jsx(MenuItem, { currentMenuItem, menuItem: menuItem2 }, `menu-side-panel__menu-item__${menuItem2.link}-${menuItem2.title}}`)) }, `side-panel-navigation-menu__${menu.id}`)
|
|
35761
|
-
] }, `side-panel-navigation-menu__${menu.id}`);
|
|
35762
|
-
});
|
|
36214
|
+
const byteToHex = [];
|
|
36215
|
+
for (let i2 = 0; i2 < 256; ++i2) {
|
|
36216
|
+
byteToHex.push((i2 + 256).toString(16).slice(1));
|
|
35763
36217
|
}
|
|
35764
|
-
|
|
35765
|
-
|
|
35766
|
-
function stringToId(inputString) {
|
|
35767
|
-
let retVal;
|
|
35768
|
-
retVal = inputString == null ? void 0 : inputString.toLowerCase();
|
|
35769
|
-
retVal = retVal == null ? void 0 : retVal.replaceAll(" ", "-");
|
|
35770
|
-
retVal = retVal == null ? void 0 : retVal.replaceAll(/[^a-zA-Z0-9-]+/g, "");
|
|
35771
|
-
return retVal;
|
|
36218
|
+
function unsafeStringify(arr, offset2 = 0) {
|
|
36219
|
+
return (byteToHex[arr[offset2 + 0]] + byteToHex[arr[offset2 + 1]] + byteToHex[arr[offset2 + 2]] + byteToHex[arr[offset2 + 3]] + "-" + byteToHex[arr[offset2 + 4]] + byteToHex[arr[offset2 + 5]] + "-" + byteToHex[arr[offset2 + 6]] + byteToHex[arr[offset2 + 7]] + "-" + byteToHex[arr[offset2 + 8]] + byteToHex[arr[offset2 + 9]] + "-" + byteToHex[arr[offset2 + 10]] + byteToHex[arr[offset2 + 11]] + byteToHex[arr[offset2 + 12]] + byteToHex[arr[offset2 + 13]] + byteToHex[arr[offset2 + 14]] + byteToHex[arr[offset2 + 15]]).toLowerCase();
|
|
35772
36220
|
}
|
|
35773
|
-
const
|
|
35774
|
-
|
|
35775
|
-
|
|
35776
|
-
// id of the input; when tied to a Form the `id` is also the 'dot' path to the data in the form's state: ie person.contact.address.line1
|
|
35777
|
-
id: propTypesExports.string.isRequired,
|
|
35778
|
-
innerRef: RefShape,
|
|
35779
|
-
isDisabled: propTypesExports.bool,
|
|
35780
|
-
label: propTypesExports.string.isRequired,
|
|
35781
|
-
labelClassName: propTypesExports.string,
|
|
35782
|
-
labelOff: propTypesExports.node,
|
|
35783
|
-
labelOn: propTypesExports.node,
|
|
35784
|
-
// e => ... do something with e.target.value ...; can be omitted so as to be uncontrolled OR if changes are sent through form's onChange
|
|
35785
|
-
onChange: propTypesExports.func,
|
|
35786
|
-
// when enter key pressed in field, submit the form
|
|
35787
|
-
onSubmit: propTypesExports.func,
|
|
35788
|
-
size: propTypesExports.oneOf([formElementSizesEnum.SMALL, formElementSizesEnum.MEDIUM, formElementSizesEnum.LARGE]),
|
|
35789
|
-
sliderChildren: propTypesExports.node,
|
|
35790
|
-
value: propTypesExports.bool,
|
|
35791
|
-
width: propTypesExports.number
|
|
36221
|
+
const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
36222
|
+
const native = {
|
|
36223
|
+
randomUUID
|
|
35792
36224
|
};
|
|
35793
|
-
|
|
35794
|
-
|
|
35795
|
-
|
|
35796
|
-
|
|
35797
|
-
|
|
35798
|
-
|
|
35799
|
-
|
|
35800
|
-
|
|
35801
|
-
|
|
35802
|
-
|
|
35803
|
-
|
|
35804
|
-
|
|
35805
|
-
|
|
35806
|
-
|
|
35807
|
-
}
|
|
35808
|
-
|
|
35809
|
-
|
|
35810
|
-
|
|
35811
|
-
|
|
35812
|
-
|
|
35813
|
-
|
|
35814
|
-
label,
|
|
35815
|
-
labelClassName,
|
|
35816
|
-
labelOn,
|
|
35817
|
-
labelOff,
|
|
35818
|
-
onChange,
|
|
35819
|
-
onSubmit,
|
|
35820
|
-
size,
|
|
35821
|
-
sliderChildren,
|
|
35822
|
-
value,
|
|
35823
|
-
width,
|
|
35824
|
-
...rest
|
|
35825
|
-
}) {
|
|
35826
|
-
const {
|
|
35827
|
-
currentErrorMessage,
|
|
35828
|
-
currentOnChange,
|
|
35829
|
-
currentOnFormKeyPress,
|
|
35830
|
-
currentValue
|
|
35831
|
-
} = useCurrentValuesFromForm({
|
|
35832
|
-
errorMessage,
|
|
35833
|
-
id,
|
|
35834
|
-
onChange,
|
|
35835
|
-
onSubmit,
|
|
35836
|
-
value
|
|
36225
|
+
function v4(options, buf, offset2) {
|
|
36226
|
+
if (native.randomUUID && !buf && !options) {
|
|
36227
|
+
return native.randomUUID();
|
|
36228
|
+
}
|
|
36229
|
+
options = options || {};
|
|
36230
|
+
const rnds = options.random || (options.rng || rng)();
|
|
36231
|
+
rnds[6] = rnds[6] & 15 | 64;
|
|
36232
|
+
rnds[8] = rnds[8] & 63 | 128;
|
|
36233
|
+
if (buf) {
|
|
36234
|
+
offset2 = offset2 || 0;
|
|
36235
|
+
for (let i2 = 0; i2 < 16; ++i2) {
|
|
36236
|
+
buf[offset2 + i2] = rnds[i2];
|
|
36237
|
+
}
|
|
36238
|
+
return buf;
|
|
36239
|
+
}
|
|
36240
|
+
return unsafeStringify(rnds);
|
|
36241
|
+
}
|
|
36242
|
+
function useComponentGuid() {
|
|
36243
|
+
const [guid] = useStateEffect({
|
|
36244
|
+
calculateValueFn: () => v4(),
|
|
36245
|
+
dependencyList: []
|
|
35837
36246
|
});
|
|
35838
|
-
return
|
|
35839
|
-
"div",
|
|
35840
|
-
{
|
|
35841
|
-
className: "input-wrapper input-wrapper--switch",
|
|
35842
|
-
ref: innerRef,
|
|
35843
|
-
children: [
|
|
35844
|
-
/* @__PURE__ */ jsxs(
|
|
35845
|
-
"label",
|
|
35846
|
-
{
|
|
35847
|
-
className: joinClassNames(
|
|
35848
|
-
"switch__wrapper",
|
|
35849
|
-
size === formElementSizesEnum.MEDIUM ? null : `switch--${size}`,
|
|
35850
|
-
isDisabled ? "switch--disabled" : null,
|
|
35851
|
-
currentValue && "switch__wrapper--on"
|
|
35852
|
-
),
|
|
35853
|
-
htmlFor: id,
|
|
35854
|
-
style: width && { width: `${width}px` },
|
|
35855
|
-
children: [
|
|
35856
|
-
/* @__PURE__ */ jsx("span", { className: joinClassNames("switch__label", labelClassName), children: label }),
|
|
35857
|
-
/* @__PURE__ */ jsx(
|
|
35858
|
-
"input",
|
|
35859
|
-
{
|
|
35860
|
-
"aria-describedby": currentErrorMessage ? `${id}-error` : null,
|
|
35861
|
-
checked: currentValue,
|
|
35862
|
-
className: joinClassNames("switch visually-hidden", className),
|
|
35863
|
-
disabled: isDisabled,
|
|
35864
|
-
id,
|
|
35865
|
-
name: id,
|
|
35866
|
-
onChange: currentOnChange,
|
|
35867
|
-
onKeyPress: currentOnFormKeyPress,
|
|
35868
|
-
type: "checkbox",
|
|
35869
|
-
...rest
|
|
35870
|
-
}
|
|
35871
|
-
),
|
|
35872
|
-
/* @__PURE__ */ jsx("span", { className: joinClassNames("switch__slider", currentValue && "switch__slider--on"), children: sliderChildren }),
|
|
35873
|
-
labelOn || labelOff ? /* @__PURE__ */ jsxs("span", { className: "switch__inner-label", children: [
|
|
35874
|
-
/* @__PURE__ */ jsx("span", { className: joinClassNames(currentValue ? "show" : "", "switch__inner-label-on"), children: labelOn }),
|
|
35875
|
-
/* @__PURE__ */ jsx("span", { className: joinClassNames(currentValue ? "" : "show", "switch__inner-label-off"), children: labelOff })
|
|
35876
|
-
] }) : null
|
|
35877
|
-
]
|
|
35878
|
-
}
|
|
35879
|
-
),
|
|
35880
|
-
/* @__PURE__ */ jsx(ErrorMessage, { errorMessage: currentErrorMessage, id })
|
|
35881
|
-
]
|
|
35882
|
-
}
|
|
35883
|
-
);
|
|
36247
|
+
return guid;
|
|
35884
36248
|
}
|
|
35885
|
-
|
|
35886
|
-
|
|
35887
|
-
|
|
35888
|
-
|
|
35889
|
-
|
|
35890
|
-
|
|
35891
|
-
|
|
35892
|
-
|
|
35893
|
-
|
|
35894
|
-
|
|
35895
|
-
const {
|
|
35896
|
-
selectedTabId,
|
|
35897
|
-
setSelectedTabId,
|
|
35898
|
-
tabGroupId
|
|
35899
|
-
} = useContext(TabGroupContext);
|
|
35900
|
-
return /* @__PURE__ */ jsx(
|
|
35901
|
-
"div",
|
|
35902
|
-
{
|
|
35903
|
-
className: joinClassNames(
|
|
35904
|
-
selectedTabId === id && "tab-group__tab--selected",
|
|
35905
|
-
"tab-group__tab"
|
|
35906
|
-
),
|
|
35907
|
-
children: /* @__PURE__ */ jsx(
|
|
35908
|
-
"button",
|
|
35909
|
-
{
|
|
35910
|
-
"aria-controls": `tabpanel-${tabGroupId}-${id}`,
|
|
35911
|
-
"aria-selected": selectedTabId === id,
|
|
35912
|
-
className: joinClassNames(
|
|
35913
|
-
selectedTabId === id && "tab-group__tab-button--selected",
|
|
35914
|
-
"tab-group__tab-button"
|
|
35915
|
-
),
|
|
35916
|
-
id: `tab-${tabGroupId}-${id}`,
|
|
35917
|
-
onClick: handleEvent(() => setSelectedTabId(id)),
|
|
35918
|
-
role: "tab",
|
|
35919
|
-
tabIndex: "-1",
|
|
35920
|
-
type: "button",
|
|
35921
|
-
children
|
|
35922
|
-
}
|
|
35923
|
-
)
|
|
35924
|
-
}
|
|
36249
|
+
function chainSorters(sorters, ...sorterParams) {
|
|
36250
|
+
return (
|
|
36251
|
+
// One Sorter to rule them all, One Sorter to find them,
|
|
36252
|
+
// One Sorter to bring them all, and in the darkness bind them,
|
|
36253
|
+
(a, b) => (sorters || []).reduce(
|
|
36254
|
+
// loop through the sorters until a comparison gets a non-zero result
|
|
36255
|
+
(result, sorter) => result === 0 ? sorter(a, b, ...sorterParams) : result,
|
|
36256
|
+
// default to zero/equals result
|
|
36257
|
+
0
|
|
36258
|
+
)
|
|
35925
36259
|
);
|
|
35926
36260
|
}
|
|
35927
|
-
|
|
35928
|
-
|
|
35929
|
-
const propTypes$t = {
|
|
35930
|
-
children: propTypesExports.node.isRequired,
|
|
35931
|
-
className: propTypesExports.string,
|
|
35932
|
-
defaultValue: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string]),
|
|
35933
|
-
onChange: propTypesExports.func,
|
|
35934
|
-
// value is the currentSelectedTabIndex number
|
|
35935
|
-
value: propTypesExports.number
|
|
35936
|
-
};
|
|
35937
|
-
const defaultProps$t = {
|
|
35938
|
-
className: null,
|
|
35939
|
-
defaultValue: null,
|
|
35940
|
-
onChange: null,
|
|
35941
|
-
value: null
|
|
35942
|
-
};
|
|
35943
|
-
let nextTabGroupId = 0;
|
|
35944
|
-
function TabGroup({
|
|
35945
|
-
children,
|
|
35946
|
-
className,
|
|
35947
|
-
defaultValue,
|
|
35948
|
-
onChange,
|
|
35949
|
-
value
|
|
35950
|
-
}) {
|
|
35951
|
-
const [tabGroupState, setTabGroupState] = i(() => {
|
|
35952
|
-
nextTabGroupId += 1;
|
|
35953
|
-
return {
|
|
35954
|
-
selectedTabId: defaultValue || NaN,
|
|
35955
|
-
tabGroupId: nextTabGroupId
|
|
35956
|
-
};
|
|
35957
|
-
});
|
|
35958
|
-
const contextValue = useMemo(
|
|
35959
|
-
() => ({
|
|
35960
|
-
tabGroupId: tabGroupState.tabGroupId,
|
|
35961
|
-
selectedTabId: value || tabGroupState.selectedTabId,
|
|
35962
|
-
setSelectedTabId: (tabId) => {
|
|
35963
|
-
if (onChange) {
|
|
35964
|
-
onChange(tabId);
|
|
35965
|
-
} else {
|
|
35966
|
-
setTabGroupState((draftState) => {
|
|
35967
|
-
draftState.selectedTabId = tabId;
|
|
35968
|
-
});
|
|
35969
|
-
}
|
|
35970
|
-
}
|
|
35971
|
-
}),
|
|
35972
|
-
[tabGroupState, value]
|
|
35973
|
-
);
|
|
35974
|
-
return /* @__PURE__ */ jsx(TabGroupContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx("div", { className: joinClassNames("tab-group", className), id: `tab-group-${tabGroupState.id}`, children }) });
|
|
36261
|
+
function toSafeString(value) {
|
|
36262
|
+
return !value && value !== 0 ? "" : `${value}`;
|
|
35975
36263
|
}
|
|
35976
|
-
|
|
35977
|
-
|
|
35978
|
-
|
|
35979
|
-
|
|
35980
|
-
|
|
35981
|
-
|
|
36264
|
+
const TableBodyDataRowContext = React__default.createContext();
|
|
36265
|
+
const tableSortingRuleFieldType = {
|
|
36266
|
+
// compares dates as Date() objects
|
|
36267
|
+
// dates represented by an ISO string should use the STRING enum value
|
|
36268
|
+
DATE: "date",
|
|
36269
|
+
// compares numbers (does do Number(fieldValue)) conversion so it is safe to pass strings as numbers)
|
|
36270
|
+
NUMBER: "number",
|
|
36271
|
+
// does simple localeCompare() string comparison; is safe for null strings
|
|
36272
|
+
STRING: "string"
|
|
35982
36273
|
};
|
|
35983
|
-
const
|
|
35984
|
-
|
|
35985
|
-
|
|
36274
|
+
const useRefAlways = (value) => {
|
|
36275
|
+
const ref = useRef(value);
|
|
36276
|
+
ref.current = value;
|
|
36277
|
+
return ref;
|
|
35986
36278
|
};
|
|
35987
|
-
|
|
35988
|
-
|
|
35989
|
-
return
|
|
36279
|
+
const TableContext = React__default.createContext();
|
|
36280
|
+
function useTableContext() {
|
|
36281
|
+
return useContext(TableContext);
|
|
35990
36282
|
}
|
|
35991
|
-
|
|
35992
|
-
TabGroupTitle.defaultProps = defaultProps$s;
|
|
35993
|
-
const propTypes$r = {
|
|
36283
|
+
const propTypes$o = {
|
|
35994
36284
|
children: propTypesExports.node.isRequired,
|
|
35995
36285
|
className: propTypesExports.string,
|
|
35996
36286
|
innerRef: RefShape,
|
|
35997
36287
|
id: propTypesExports.string
|
|
35998
36288
|
};
|
|
35999
|
-
const defaultProps$
|
|
36289
|
+
const defaultProps$o = {
|
|
36000
36290
|
className: null,
|
|
36001
36291
|
innerRef: null,
|
|
36002
36292
|
id: null
|
|
36003
36293
|
};
|
|
36004
|
-
function
|
|
36005
|
-
|
|
36006
|
-
|
|
36007
|
-
|
|
36008
|
-
|
|
36009
|
-
|
|
36010
|
-
|
|
36011
|
-
|
|
36294
|
+
function sortByFieldType(sortingRule, fieldValueA, fieldValueB) {
|
|
36295
|
+
let result;
|
|
36296
|
+
switch (sortingRule.fieldType) {
|
|
36297
|
+
case tableSortingRuleFieldType.DATE:
|
|
36298
|
+
result = ((fieldValueA == null ? void 0 : fieldValueA.getTime()) || 0) - ((fieldValueB == null ? void 0 : fieldValueB.getTime()) || 0);
|
|
36299
|
+
break;
|
|
36300
|
+
case tableSortingRuleFieldType.NUMBER:
|
|
36301
|
+
result = Number(fieldValueA || 0) - Number(fieldValueB || 0);
|
|
36302
|
+
break;
|
|
36303
|
+
case tableSortingRuleFieldType.STRING:
|
|
36304
|
+
result = (fieldValueA || "").localeCompare(fieldValueB || "");
|
|
36305
|
+
break;
|
|
36306
|
+
default:
|
|
36307
|
+
throw new Error(`Unknown tableSortingRuleFieldType '${sortingRule.fieldType}'`);
|
|
36308
|
+
}
|
|
36309
|
+
return result;
|
|
36012
36310
|
}
|
|
36013
|
-
|
|
36014
|
-
|
|
36015
|
-
|
|
36016
|
-
|
|
36017
|
-
className: propTypesExports.string,
|
|
36018
|
-
innerRef: RefShape,
|
|
36019
|
-
id: propTypesExports.string
|
|
36020
|
-
};
|
|
36021
|
-
const defaultProps$q = {
|
|
36022
|
-
children: null,
|
|
36023
|
-
className: null,
|
|
36024
|
-
innerRef: null,
|
|
36025
|
-
id: null
|
|
36026
|
-
};
|
|
36027
|
-
function TableBody({
|
|
36311
|
+
function combineData(tableData, whichField) {
|
|
36312
|
+
return Object.values(tableData).map((tableDatum) => tableDatum[whichField]).flat();
|
|
36313
|
+
}
|
|
36314
|
+
function TableWrapper({
|
|
36028
36315
|
children,
|
|
36029
36316
|
className,
|
|
36030
36317
|
innerRef,
|
|
36031
36318
|
id,
|
|
36032
36319
|
...rest
|
|
36033
36320
|
}) {
|
|
36034
|
-
|
|
36035
|
-
|
|
36036
|
-
|
|
36037
|
-
|
|
36038
|
-
|
|
36039
|
-
|
|
36040
|
-
|
|
36041
|
-
|
|
36042
|
-
|
|
36043
|
-
|
|
36044
|
-
|
|
36045
|
-
|
|
36046
|
-
|
|
36047
|
-
|
|
36048
|
-
|
|
36049
|
-
|
|
36050
|
-
|
|
36051
|
-
|
|
36321
|
+
const [state, setState] = i({
|
|
36322
|
+
// when sorting, should the sort order for a rule be the "default"
|
|
36323
|
+
// ie a rule defaults to ascending so when currentSortingOrderIsDefault is true then sort that rule ascending
|
|
36324
|
+
currentSortingOrderIsDefault: true,
|
|
36325
|
+
// [recordFieldPath]: filterValue <== the current filtering values from <TableFilter... /> components
|
|
36326
|
+
filterValues: {
|
|
36327
|
+
// context level values from a <TableFilters /> component (<TableFilter... /> child components would override/chain these values)
|
|
36328
|
+
// defaultValue - object of [recordFieldPath]:value pairs for filtering inputs
|
|
36329
|
+
defaultValue: null,
|
|
36330
|
+
// instead of doing a "contains" match, the match must exactly match
|
|
36331
|
+
isExactMatch: false,
|
|
36332
|
+
// onChange to call for any filter change
|
|
36333
|
+
onChange: null,
|
|
36334
|
+
// value - object of [recordFieldPath]:value pairs for filtering inputs
|
|
36335
|
+
value: {}
|
|
36336
|
+
},
|
|
36337
|
+
// these are the sorting rules to which a <TableHeadCell> connects assumes order is add order
|
|
36338
|
+
sortingRules: {},
|
|
36339
|
+
// data for this table separated out by component GUID
|
|
36340
|
+
//
|
|
36341
|
+
// A table may have multiple dynamic and/or static sections of data yet some things, like
|
|
36342
|
+
// a Table Select Filter that wants to show all the possible values, wants to know what all
|
|
36343
|
+
// the possible data is for the table. Each data section needs to be able to add/remove its
|
|
36344
|
+
// data since the data could morph at each render per component. This `tableData` then holds the data per
|
|
36345
|
+
// component (use useComponentGuid() hook to get a guid) so that the component can add/remove its data
|
|
36346
|
+
// without zapping other components' data but still give a full picture of all the data in the end.
|
|
36347
|
+
// Use the context's exposed `setBodyDataForComponentGuid` to manipulate table data for a component
|
|
36348
|
+
//
|
|
36349
|
+
// { [guid]: {allData, filteredData }} - allData = all the records, filteredData = just the records being shown
|
|
36350
|
+
tableData: {},
|
|
36351
|
+
// (func) when table sorting changes, this callback will be called: from <TableSortingRules>
|
|
36352
|
+
tableSortingOnChange: null,
|
|
36353
|
+
// (string | [string]) the current recordFieldPath name for the current header being sorted
|
|
36354
|
+
// array if <TableHeadCell> specifies sort order; otherwise, sort fields in registration order
|
|
36355
|
+
// set when a TableHeadCell is selected and sets its tableSortingFieldPaths as the tableSortingFieldPath
|
|
36356
|
+
// TableBodyData uses this value to sort its records
|
|
36357
|
+
tableSortingFieldPath: null,
|
|
36358
|
+
// a TableHeadCell can provide tableSortingFieldPaths to customize which sorters to use in which order
|
|
36359
|
+
tableSortingFieldPaths: null
|
|
36360
|
+
});
|
|
36361
|
+
const stateRef = useRefAlways(state);
|
|
36362
|
+
const contextValue = useMemo(
|
|
36363
|
+
() => ({
|
|
36364
|
+
// for analytic usage, rendering is generally done at the component level and not at the context level
|
|
36365
|
+
// because each data section handles it differently. This allData is useful for filtering and other
|
|
36366
|
+
// global table tooling that pokes through the data.
|
|
36367
|
+
allData: combineData(stateRef.current.tableData, "allData"),
|
|
36368
|
+
// ATTOW: filteredData may/may not work with a TableRow and TableFilters?
|
|
36369
|
+
filteredData: combineData(stateRef.current.tableData, "filteredData"),
|
|
36370
|
+
// register a new rule for sorting, generally from a <TableSortingRule>
|
|
36371
|
+
registerSortingRule: (sortingRule) => setState((draftState) => {
|
|
36372
|
+
draftState.sortingRules[sortingRule.recordFieldPath] = {
|
|
36373
|
+
...sortingRule,
|
|
36374
|
+
sorter: (recordA, recordB, records) => {
|
|
36375
|
+
const fieldValueA = valueAtPath({ object: recordA.record, path: sortingRule.recordFieldPath });
|
|
36376
|
+
const fieldValueB = valueAtPath({ object: recordB.record, path: sortingRule.recordFieldPath });
|
|
36377
|
+
let result;
|
|
36378
|
+
if (sortingRule.customSort) {
|
|
36379
|
+
result = sortingRule.customSort({
|
|
36380
|
+
fieldValueA,
|
|
36381
|
+
fieldValueB,
|
|
36382
|
+
recordA: recordA.record,
|
|
36383
|
+
recordAIndex: recordA.recordIndex,
|
|
36384
|
+
recordB: recordB.record,
|
|
36385
|
+
recordBIndex: recordB.recordIndex,
|
|
36386
|
+
records
|
|
36387
|
+
});
|
|
36388
|
+
} else {
|
|
36389
|
+
result = sortByFieldType(sortingRule, fieldValueA, fieldValueB);
|
|
36390
|
+
}
|
|
36391
|
+
return result * (stateRef.current.currentSortingOrderIsDefault ? 1 : -1) * (sortingRule.defaultIsAscending ? 1 : -1);
|
|
36392
|
+
}
|
|
36393
|
+
};
|
|
36394
|
+
}),
|
|
36395
|
+
// unregister a rule for sorting, generally when a <TableSortingRule> unmounts
|
|
36396
|
+
unregisterSortingRule: (recordFieldPath) => setState((draftState) => {
|
|
36397
|
+
delete draftState.sortingRules[recordFieldPath];
|
|
36398
|
+
}),
|
|
36399
|
+
/**
|
|
36400
|
+
* data recording per table body section so as to form a full picture of the currently exposed data
|
|
36401
|
+
* @param {string} guid the guid tied to this specific component instance (use useComponentGuid())
|
|
36402
|
+
* @param {any[] | null} data the data for this component (or null on unmount)
|
|
36403
|
+
* @param {any[] | null} [filteredData] the filtered data for this component (optional, defaults to [])
|
|
36404
|
+
*/
|
|
36405
|
+
setBodyDataForComponentGuid: (guid, allData, filteredData) => {
|
|
36406
|
+
setState((draftState) => {
|
|
36407
|
+
draftState.tableData[guid] = { allData, filteredData: filteredData || [] };
|
|
36408
|
+
});
|
|
36409
|
+
},
|
|
36410
|
+
setState,
|
|
36411
|
+
state
|
|
36412
|
+
}),
|
|
36413
|
+
[state]
|
|
36414
|
+
);
|
|
36415
|
+
return /* @__PURE__ */ jsx(TableContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx("div", { className: joinClassNames("some-table-wrapper-className", className), id, ref: innerRef, ...rest, children }) });
|
|
36052
36416
|
}
|
|
36053
|
-
|
|
36417
|
+
TableWrapper.propTypes = propTypes$o;
|
|
36418
|
+
TableWrapper.defaultProps = defaultProps$o;
|
|
36419
|
+
const propTypes$n = {
|
|
36054
36420
|
// the TableBodyDataRowTemplate and TableBodyDataCellTemplate elements making up the repeatable section
|
|
36055
36421
|
children: propTypesExports.node.isRequired,
|
|
36056
36422
|
// field on the record that provides the unique id of the record; uses pathing ie 'contact.address.zipCode'
|
|
@@ -36058,9 +36424,10 @@ const propTypes$p = {
|
|
|
36058
36424
|
// the data records to repeat in the children templates
|
|
36059
36425
|
records: propTypesExports.arrayOf(propTypesExports.shape({})).isRequired
|
|
36060
36426
|
};
|
|
36061
|
-
const defaultProps$
|
|
36427
|
+
const defaultProps$n = {};
|
|
36062
36428
|
function TableBodyData({ children, recordIdField, records }) {
|
|
36063
36429
|
const [recordsForContexts, setRecordsForContexts] = i(null);
|
|
36430
|
+
const guid = useComponentGuid();
|
|
36064
36431
|
const {
|
|
36065
36432
|
state: {
|
|
36066
36433
|
currentSortingOrderIsDefault,
|
|
@@ -36068,8 +36435,9 @@ function TableBodyData({ children, recordIdField, records }) {
|
|
|
36068
36435
|
sortingRules,
|
|
36069
36436
|
tableSortingFieldPath,
|
|
36070
36437
|
tableSortingFieldPaths
|
|
36071
|
-
}
|
|
36072
|
-
|
|
36438
|
+
},
|
|
36439
|
+
setBodyDataForComponentGuid
|
|
36440
|
+
} = useTableContext();
|
|
36073
36441
|
useEffect(
|
|
36074
36442
|
() => {
|
|
36075
36443
|
let newRecordsForContext = records == null ? void 0 : records.map((record, recordIndex) => ({ record, recordIndex, records }));
|
|
@@ -36089,6 +36457,7 @@ function TableBodyData({ children, recordIdField, records }) {
|
|
|
36089
36457
|
true
|
|
36090
36458
|
));
|
|
36091
36459
|
setRecordsForContexts(newRecordsForContext);
|
|
36460
|
+
setBodyDataForComponentGuid(guid, records, newRecordsForContext);
|
|
36092
36461
|
},
|
|
36093
36462
|
[currentSortingOrderIsDefault, filterValues, records, tableSortingFieldPath, tableSortingFieldPaths]
|
|
36094
36463
|
);
|
|
@@ -36097,9 +36466,9 @@ function TableBodyData({ children, recordIdField, records }) {
|
|
|
36097
36466
|
recordsForContexts == null ? void 0 : recordsForContexts.map((recordForContext) => /* @__PURE__ */ jsx(TableBodyDataRowContext.Provider, { value: recordForContext, children }, `table-body-data-${valueAtPath({ object: recordForContext.record, path: recordIdField })}`))
|
|
36098
36467
|
) : null;
|
|
36099
36468
|
}
|
|
36100
|
-
TableBodyData.propTypes = propTypes$
|
|
36101
|
-
TableBodyData.defaultProps = defaultProps$
|
|
36102
|
-
const propTypes$
|
|
36469
|
+
TableBodyData.propTypes = propTypes$n;
|
|
36470
|
+
TableBodyData.defaultProps = defaultProps$n;
|
|
36471
|
+
const propTypes$m = {
|
|
36103
36472
|
children: propTypesExports.node,
|
|
36104
36473
|
className: propTypesExports.string,
|
|
36105
36474
|
id: propTypesExports.string,
|
|
@@ -36107,7 +36476,7 @@ const propTypes$o = {
|
|
|
36107
36476
|
onClick: propTypesExports.func,
|
|
36108
36477
|
onDoubleClick: propTypesExports.func
|
|
36109
36478
|
};
|
|
36110
|
-
const defaultProps$
|
|
36479
|
+
const defaultProps$m = {
|
|
36111
36480
|
children: null,
|
|
36112
36481
|
className: null,
|
|
36113
36482
|
id: null,
|
|
@@ -36139,9 +36508,9 @@ function TableCell({
|
|
|
36139
36508
|
}
|
|
36140
36509
|
);
|
|
36141
36510
|
}
|
|
36142
|
-
TableCell.propTypes = propTypes$
|
|
36143
|
-
TableCell.defaultProps = defaultProps$
|
|
36144
|
-
const propTypes$
|
|
36511
|
+
TableCell.propTypes = propTypes$m;
|
|
36512
|
+
TableCell.defaultProps = defaultProps$m;
|
|
36513
|
+
const propTypes$l = {
|
|
36145
36514
|
children: propTypesExports.oneOfType([propTypesExports.node, propTypesExports.func]),
|
|
36146
36515
|
className: propTypesExports.string,
|
|
36147
36516
|
id: propTypesExports.string,
|
|
@@ -36153,7 +36522,7 @@ const propTypes$n = {
|
|
|
36153
36522
|
// the field path in the record to the data to render in the <td>; ie 'person.contact.address.city'
|
|
36154
36523
|
recordFieldPath: propTypesExports.string
|
|
36155
36524
|
};
|
|
36156
|
-
const defaultProps$
|
|
36525
|
+
const defaultProps$l = {
|
|
36157
36526
|
children: null,
|
|
36158
36527
|
className: null,
|
|
36159
36528
|
id: null,
|
|
@@ -36197,9 +36566,9 @@ function TableBodyDataCellTemplate({
|
|
|
36197
36566
|
}
|
|
36198
36567
|
);
|
|
36199
36568
|
}
|
|
36200
|
-
TableBodyDataCellTemplate.propTypes = propTypes$
|
|
36201
|
-
TableBodyDataCellTemplate.defaultProps = defaultProps$
|
|
36202
|
-
const propTypes$
|
|
36569
|
+
TableBodyDataCellTemplate.propTypes = propTypes$l;
|
|
36570
|
+
TableBodyDataCellTemplate.defaultProps = defaultProps$l;
|
|
36571
|
+
const propTypes$k = {
|
|
36203
36572
|
// the TableBodyDataCellTemplates for the row
|
|
36204
36573
|
children: propTypesExports.node.isRequired,
|
|
36205
36574
|
// className for the <TableRow>
|
|
@@ -36211,7 +36580,7 @@ const propTypes$m = {
|
|
|
36211
36580
|
// ({ e }) => { ... do something ... }
|
|
36212
36581
|
onDoubleClick: propTypesExports.func
|
|
36213
36582
|
};
|
|
36214
|
-
const defaultProps$
|
|
36583
|
+
const defaultProps$k = {
|
|
36215
36584
|
className: null,
|
|
36216
36585
|
innerRef: null,
|
|
36217
36586
|
onClick: null,
|
|
@@ -36233,118 +36602,48 @@ function TableBodyDataRowTemplate({
|
|
|
36233
36602
|
"some-TableBodyDataRowTemplate-classname",
|
|
36234
36603
|
isFunction_1(className) ? className(rowContextData) : className
|
|
36235
36604
|
),
|
|
36236
|
-
onClick: onClick && ((e) => onClick({ e, ...rowContextData })),
|
|
36237
|
-
onDoubleClick: onDoubleClick && ((e) => onDoubleClick({ e, ...rowContextData })),
|
|
36238
|
-
ref: innerRef,
|
|
36239
|
-
...rest,
|
|
36240
|
-
children
|
|
36241
|
-
}
|
|
36242
|
-
);
|
|
36243
|
-
}
|
|
36244
|
-
TableBodyDataRowTemplate.propTypes = propTypes$
|
|
36245
|
-
TableBodyDataRowTemplate.defaultProps = defaultProps$
|
|
36246
|
-
const propTypes$
|
|
36247
|
-
children: propTypesExports.func.isRequired,
|
|
36248
|
-
className: propTypesExports.string,
|
|
36249
|
-
innerRef: RefShape,
|
|
36250
|
-
id: propTypesExports.string
|
|
36251
|
-
};
|
|
36252
|
-
const defaultProps$
|
|
36253
|
-
className: null,
|
|
36254
|
-
innerRef: null,
|
|
36255
|
-
id: null
|
|
36256
|
-
};
|
|
36257
|
-
function TableFilterCustom({
|
|
36258
|
-
children,
|
|
36259
|
-
className,
|
|
36260
|
-
innerRef,
|
|
36261
|
-
id,
|
|
36262
|
-
...rest
|
|
36263
|
-
}) {
|
|
36264
|
-
const { setState: setStateContext, state: stateContext } = useContext(TableContext);
|
|
36265
|
-
return /* @__PURE__ */ jsx("th", { className: joinClassNames("some-TableFilterCustom-classname", className), id, ref: innerRef, ...rest, children: children({
|
|
36266
|
-
// current filter values (key => value)
|
|
36267
|
-
filterValues: stateContext.filterValues.value,
|
|
36268
|
-
// 'setter' function that will update just the filterValues.value of the table context
|
|
36269
|
-
setFilterValues: (setFilterValuesFunc) => {
|
|
36270
|
-
setStateContext((draftStateContext) => {
|
|
36271
|
-
setFilterValuesFunc(draftStateContext.filterValues.value);
|
|
36272
|
-
});
|
|
36273
|
-
}
|
|
36274
|
-
}) });
|
|
36275
|
-
}
|
|
36276
|
-
TableFilterCustom.propTypes = propTypes$l;
|
|
36277
|
-
TableFilterCustom.defaultProps = defaultProps$l;
|
|
36278
|
-
const propTypes$k = {
|
|
36279
|
-
className: propTypesExports.string,
|
|
36280
|
-
errorMessage: propTypesExports.string,
|
|
36281
|
-
innerRef: RefShape,
|
|
36282
|
-
// id of the input; when tied to a Form the `id` is also the 'dot' path to the data in the form's state: ie person.contact.address.line1
|
|
36283
|
-
id: propTypesExports.string.isRequired,
|
|
36284
|
-
isDisabled: propTypesExports.bool,
|
|
36285
|
-
label: propTypesExports.string.isRequired,
|
|
36286
|
-
// e => ... do something with e.target.value ...; can be omitted so as to be uncontrolled OR if changes are sent through form's onChange
|
|
36287
|
-
onChange: propTypesExports.func,
|
|
36288
|
-
// when enter key pressed in field, submit the form
|
|
36289
|
-
onSubmit: propTypesExports.func,
|
|
36290
|
-
value: propTypesExports.string
|
|
36291
|
-
};
|
|
36292
|
-
const defaultProps$k = {
|
|
36293
|
-
className: null,
|
|
36294
|
-
errorMessage: null,
|
|
36295
|
-
innerRef: null,
|
|
36296
|
-
isDisabled: false,
|
|
36297
|
-
onChange: null,
|
|
36298
|
-
onSubmit: null,
|
|
36299
|
-
value: null
|
|
36300
|
-
};
|
|
36301
|
-
function TextInput({
|
|
36302
|
-
className,
|
|
36303
|
-
errorMessage,
|
|
36304
|
-
innerRef,
|
|
36305
|
-
id,
|
|
36306
|
-
isDisabled,
|
|
36307
|
-
label,
|
|
36308
|
-
onChange,
|
|
36309
|
-
onSubmit,
|
|
36310
|
-
value,
|
|
36311
|
-
...rest
|
|
36312
|
-
}) {
|
|
36313
|
-
const {
|
|
36314
|
-
currentErrorMessage,
|
|
36315
|
-
currentOnChange,
|
|
36316
|
-
currentOnFormKeyPress,
|
|
36317
|
-
currentValue
|
|
36318
|
-
} = useCurrentValuesFromForm({
|
|
36319
|
-
errorMessage,
|
|
36320
|
-
id,
|
|
36321
|
-
onChange,
|
|
36322
|
-
onSubmit,
|
|
36323
|
-
value
|
|
36324
|
-
});
|
|
36325
|
-
return /* @__PURE__ */ jsxs("div", { className: "input-wrapper input-wrapper--text-input", children: [
|
|
36326
|
-
/* @__PURE__ */ jsx("label", { htmlFor: id, children: label }),
|
|
36327
|
-
/* @__PURE__ */ jsx(
|
|
36328
|
-
"input",
|
|
36329
|
-
{
|
|
36330
|
-
"aria-describedby": currentErrorMessage ? `${id}-error` : null,
|
|
36331
|
-
className,
|
|
36332
|
-
disabled: isDisabled,
|
|
36333
|
-
id,
|
|
36334
|
-
name: id,
|
|
36335
|
-
onChange: currentOnChange,
|
|
36336
|
-
onKeyPress: currentOnFormKeyPress,
|
|
36337
|
-
ref: innerRef,
|
|
36338
|
-
type: "text",
|
|
36339
|
-
value: currentValue,
|
|
36340
|
-
...rest
|
|
36341
|
-
}
|
|
36342
|
-
),
|
|
36343
|
-
/* @__PURE__ */ jsx(ErrorMessage, { errorMessage: currentErrorMessage, id })
|
|
36344
|
-
] });
|
|
36605
|
+
onClick: onClick && ((e) => onClick({ e, ...rowContextData })),
|
|
36606
|
+
onDoubleClick: onDoubleClick && ((e) => onDoubleClick({ e, ...rowContextData })),
|
|
36607
|
+
ref: innerRef,
|
|
36608
|
+
...rest,
|
|
36609
|
+
children
|
|
36610
|
+
}
|
|
36611
|
+
);
|
|
36612
|
+
}
|
|
36613
|
+
TableBodyDataRowTemplate.propTypes = propTypes$k;
|
|
36614
|
+
TableBodyDataRowTemplate.defaultProps = defaultProps$k;
|
|
36615
|
+
const propTypes$j = {
|
|
36616
|
+
children: propTypesExports.func.isRequired,
|
|
36617
|
+
className: propTypesExports.string,
|
|
36618
|
+
innerRef: RefShape,
|
|
36619
|
+
id: propTypesExports.string
|
|
36620
|
+
};
|
|
36621
|
+
const defaultProps$j = {
|
|
36622
|
+
className: null,
|
|
36623
|
+
innerRef: null,
|
|
36624
|
+
id: null
|
|
36625
|
+
};
|
|
36626
|
+
function TableFilterCustom({
|
|
36627
|
+
children,
|
|
36628
|
+
className,
|
|
36629
|
+
innerRef,
|
|
36630
|
+
id,
|
|
36631
|
+
...rest
|
|
36632
|
+
}) {
|
|
36633
|
+
const { setState: setStateContext, state: stateContext } = useContext(TableContext);
|
|
36634
|
+
return /* @__PURE__ */ jsx("th", { className: joinClassNames("some-TableFilterCustom-classname", className), id, ref: innerRef, ...rest, children: children({
|
|
36635
|
+
// current filter values (key => value)
|
|
36636
|
+
filterValues: stateContext.filterValues.value,
|
|
36637
|
+
// 'setter' function that will update just the filterValues.value of the table context
|
|
36638
|
+
setFilterValues: (setFilterValuesFunc) => {
|
|
36639
|
+
setStateContext((draftStateContext) => {
|
|
36640
|
+
setFilterValuesFunc(draftStateContext.filterValues.value);
|
|
36641
|
+
});
|
|
36642
|
+
}
|
|
36643
|
+
}) });
|
|
36345
36644
|
}
|
|
36346
|
-
|
|
36347
|
-
|
|
36645
|
+
TableFilterCustom.propTypes = propTypes$j;
|
|
36646
|
+
TableFilterCustom.defaultProps = defaultProps$j;
|
|
36348
36647
|
function useCurrentValuesFromStateContext({
|
|
36349
36648
|
// the React.createContext being questioned
|
|
36350
36649
|
context,
|
|
@@ -36389,7 +36688,7 @@ function useCurrentValuesFromStateContext({
|
|
|
36389
36688
|
)
|
|
36390
36689
|
};
|
|
36391
36690
|
}
|
|
36392
|
-
const propTypes$
|
|
36691
|
+
const propTypes$i = {
|
|
36393
36692
|
className: propTypesExports.string,
|
|
36394
36693
|
defaultValue: propTypesExports.string,
|
|
36395
36694
|
innerRef: RefShape,
|
|
@@ -36398,7 +36697,7 @@ const propTypes$j = {
|
|
|
36398
36697
|
recordFieldPath: propTypesExports.string.isRequired,
|
|
36399
36698
|
value: propTypesExports.string
|
|
36400
36699
|
};
|
|
36401
|
-
const defaultProps$
|
|
36700
|
+
const defaultProps$i = {
|
|
36402
36701
|
className: null,
|
|
36403
36702
|
defaultValue: null,
|
|
36404
36703
|
innerRef: null,
|
|
@@ -36438,15 +36737,15 @@ function TableFilterDate({
|
|
|
36438
36737
|
}
|
|
36439
36738
|
) });
|
|
36440
36739
|
}
|
|
36441
|
-
TableFilterDate.propTypes = propTypes$
|
|
36442
|
-
TableFilterDate.defaultProps = defaultProps$
|
|
36443
|
-
const propTypes$
|
|
36740
|
+
TableFilterDate.propTypes = propTypes$i;
|
|
36741
|
+
TableFilterDate.defaultProps = defaultProps$i;
|
|
36742
|
+
const propTypes$h = {
|
|
36444
36743
|
children: propTypesExports.node,
|
|
36445
36744
|
className: propTypesExports.string,
|
|
36446
36745
|
innerRef: RefShape,
|
|
36447
36746
|
id: propTypesExports.string
|
|
36448
36747
|
};
|
|
36449
|
-
const defaultProps$
|
|
36748
|
+
const defaultProps$h = {
|
|
36450
36749
|
children: null,
|
|
36451
36750
|
className: null,
|
|
36452
36751
|
innerRef: null,
|
|
@@ -36461,72 +36760,166 @@ function TableFilterNone({
|
|
|
36461
36760
|
}) {
|
|
36462
36761
|
return /* @__PURE__ */ jsx("th", { className: joinClassNames("some-TableFilterNone-classname", className), id, ref: innerRef, ...rest, children });
|
|
36463
36762
|
}
|
|
36464
|
-
TableFilterNone.propTypes = propTypes$
|
|
36465
|
-
TableFilterNone.defaultProps = defaultProps$
|
|
36466
|
-
|
|
36467
|
-
|
|
36468
|
-
|
|
36763
|
+
TableFilterNone.propTypes = propTypes$h;
|
|
36764
|
+
TableFilterNone.defaultProps = defaultProps$h;
|
|
36765
|
+
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
36766
|
+
function setCacheAdd$1(value) {
|
|
36767
|
+
this.__data__.set(value, HASH_UNDEFINED);
|
|
36768
|
+
return this;
|
|
36769
|
+
}
|
|
36770
|
+
var _setCacheAdd = setCacheAdd$1;
|
|
36771
|
+
function setCacheHas$1(value) {
|
|
36772
|
+
return this.__data__.has(value);
|
|
36773
|
+
}
|
|
36774
|
+
var _setCacheHas = setCacheHas$1;
|
|
36775
|
+
var MapCache = _MapCache, setCacheAdd = _setCacheAdd, setCacheHas = _setCacheHas;
|
|
36776
|
+
function SetCache$1(values) {
|
|
36777
|
+
var index = -1, length = values == null ? 0 : values.length;
|
|
36778
|
+
this.__data__ = new MapCache();
|
|
36779
|
+
while (++index < length) {
|
|
36780
|
+
this.add(values[index]);
|
|
36781
|
+
}
|
|
36782
|
+
}
|
|
36783
|
+
SetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;
|
|
36784
|
+
SetCache$1.prototype.has = setCacheHas;
|
|
36785
|
+
var _SetCache = SetCache$1;
|
|
36786
|
+
var baseIndexOf = _baseIndexOf;
|
|
36787
|
+
function arrayIncludes$1(array, value) {
|
|
36788
|
+
var length = array == null ? 0 : array.length;
|
|
36789
|
+
return !!length && baseIndexOf(array, value, 0) > -1;
|
|
36790
|
+
}
|
|
36791
|
+
var _arrayIncludes = arrayIncludes$1;
|
|
36792
|
+
function arrayIncludesWith$1(array, value, comparator) {
|
|
36793
|
+
var index = -1, length = array == null ? 0 : array.length;
|
|
36794
|
+
while (++index < length) {
|
|
36795
|
+
if (comparator(value, array[index])) {
|
|
36796
|
+
return true;
|
|
36797
|
+
}
|
|
36798
|
+
}
|
|
36799
|
+
return false;
|
|
36800
|
+
}
|
|
36801
|
+
var _arrayIncludesWith = arrayIncludesWith$1;
|
|
36802
|
+
function cacheHas$1(cache, key) {
|
|
36803
|
+
return cache.has(key);
|
|
36804
|
+
}
|
|
36805
|
+
var _cacheHas = cacheHas$1;
|
|
36806
|
+
function noop$1() {
|
|
36807
|
+
}
|
|
36808
|
+
var noop_1 = noop$1;
|
|
36809
|
+
function setToArray$2(set2) {
|
|
36810
|
+
var index = -1, result = Array(set2.size);
|
|
36811
|
+
set2.forEach(function(value) {
|
|
36812
|
+
result[++index] = value;
|
|
36813
|
+
});
|
|
36814
|
+
return result;
|
|
36815
|
+
}
|
|
36816
|
+
var _setToArray = setToArray$2;
|
|
36817
|
+
var Set$1 = _Set, noop = noop_1, setToArray$1 = _setToArray;
|
|
36818
|
+
var INFINITY = 1 / 0;
|
|
36819
|
+
var createSet$1 = !(Set$1 && 1 / setToArray$1(new Set$1([, -0]))[1] == INFINITY) ? noop : function(values) {
|
|
36820
|
+
return new Set$1(values);
|
|
36821
|
+
};
|
|
36822
|
+
var _createSet = createSet$1;
|
|
36823
|
+
var SetCache = _SetCache, arrayIncludes = _arrayIncludes, arrayIncludesWith = _arrayIncludesWith, cacheHas = _cacheHas, createSet = _createSet, setToArray = _setToArray;
|
|
36824
|
+
var LARGE_ARRAY_SIZE = 200;
|
|
36825
|
+
function baseUniq$1(array, iteratee, comparator) {
|
|
36826
|
+
var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
|
|
36827
|
+
if (comparator) {
|
|
36828
|
+
isCommon = false;
|
|
36829
|
+
includes = arrayIncludesWith;
|
|
36830
|
+
} else if (length >= LARGE_ARRAY_SIZE) {
|
|
36831
|
+
var set2 = iteratee ? null : createSet(array);
|
|
36832
|
+
if (set2) {
|
|
36833
|
+
return setToArray(set2);
|
|
36834
|
+
}
|
|
36835
|
+
isCommon = false;
|
|
36836
|
+
includes = cacheHas;
|
|
36837
|
+
seen = new SetCache();
|
|
36838
|
+
} else {
|
|
36839
|
+
seen = iteratee ? [] : result;
|
|
36840
|
+
}
|
|
36841
|
+
outer:
|
|
36842
|
+
while (++index < length) {
|
|
36843
|
+
var value = array[index], computed = iteratee ? iteratee(value) : value;
|
|
36844
|
+
value = comparator || value !== 0 ? value : 0;
|
|
36845
|
+
if (isCommon && computed === computed) {
|
|
36846
|
+
var seenIndex = seen.length;
|
|
36847
|
+
while (seenIndex--) {
|
|
36848
|
+
if (seen[seenIndex] === computed) {
|
|
36849
|
+
continue outer;
|
|
36850
|
+
}
|
|
36851
|
+
}
|
|
36852
|
+
if (iteratee) {
|
|
36853
|
+
seen.push(computed);
|
|
36854
|
+
}
|
|
36855
|
+
result.push(value);
|
|
36856
|
+
} else if (!includes(seen, computed, comparator)) {
|
|
36857
|
+
if (seen !== result) {
|
|
36858
|
+
seen.push(computed);
|
|
36859
|
+
}
|
|
36860
|
+
result.push(value);
|
|
36861
|
+
}
|
|
36862
|
+
}
|
|
36863
|
+
return result;
|
|
36864
|
+
}
|
|
36865
|
+
var _baseUniq = baseUniq$1;
|
|
36866
|
+
var baseUniq = _baseUniq;
|
|
36867
|
+
function uniq(array) {
|
|
36868
|
+
return array && array.length ? baseUniq(array) : [];
|
|
36869
|
+
}
|
|
36870
|
+
var uniq_1 = uniq;
|
|
36871
|
+
const propTypes$g = {
|
|
36469
36872
|
className: propTypesExports.string,
|
|
36470
|
-
|
|
36471
|
-
|
|
36472
|
-
// fires when any filter changes; ie ({ recordFieldPath, value }) => { ... do something ... }
|
|
36473
|
-
onChange: propTypesExports.func,
|
|
36474
|
-
// make sure to useMemo() before passing value in here
|
|
36475
|
-
value: propTypesExports.shape({})
|
|
36873
|
+
idBase: propTypesExports.string,
|
|
36874
|
+
recordFieldPath: propTypesExports.string.isRequired
|
|
36476
36875
|
};
|
|
36477
|
-
const defaultProps$
|
|
36876
|
+
const defaultProps$g = {
|
|
36478
36877
|
className: null,
|
|
36479
|
-
|
|
36480
|
-
innerRef: null,
|
|
36481
|
-
id: null,
|
|
36482
|
-
onChange: null,
|
|
36483
|
-
value: null
|
|
36878
|
+
idBase: null
|
|
36484
36879
|
};
|
|
36485
|
-
function
|
|
36486
|
-
children,
|
|
36880
|
+
function TableFilterSelectAllOptions({
|
|
36487
36881
|
className,
|
|
36488
|
-
|
|
36489
|
-
|
|
36490
|
-
id,
|
|
36491
|
-
onChange,
|
|
36492
|
-
value,
|
|
36882
|
+
idBase,
|
|
36883
|
+
recordFieldPath,
|
|
36493
36884
|
...rest
|
|
36494
36885
|
}) {
|
|
36495
|
-
const {
|
|
36496
|
-
|
|
36497
|
-
() =>
|
|
36498
|
-
|
|
36499
|
-
|
|
36886
|
+
const { allData } = useTableContext();
|
|
36887
|
+
const dataOptions = uniq_1(
|
|
36888
|
+
allData.map((datum) => datum[recordFieldPath]).filter(identity_1)
|
|
36889
|
+
).sort(chainSorters([
|
|
36890
|
+
(a, b) => a < b ? -1 : 0,
|
|
36891
|
+
(a, b) => a > b ? 1 : 0
|
|
36892
|
+
]));
|
|
36893
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
36894
|
+
/* @__PURE__ */ jsx(
|
|
36895
|
+
SelectOption,
|
|
36896
|
+
{
|
|
36897
|
+
className,
|
|
36898
|
+
id: idBase ? `${idBase}-empty` : null,
|
|
36899
|
+
label: "",
|
|
36900
|
+
value: "",
|
|
36901
|
+
...rest
|
|
36500
36902
|
}
|
|
36501
|
-
|
|
36502
|
-
|
|
36503
|
-
|
|
36504
|
-
|
|
36505
|
-
|
|
36506
|
-
|
|
36507
|
-
|
|
36508
|
-
|
|
36509
|
-
|
|
36510
|
-
|
|
36511
|
-
|
|
36512
|
-
}
|
|
36513
|
-
|
|
36514
|
-
|
|
36515
|
-
);
|
|
36516
|
-
useEffect(
|
|
36517
|
-
() => {
|
|
36518
|
-
setState((draftState) => {
|
|
36519
|
-
draftState.filterValues.value = value || draftState.filterValues.value;
|
|
36520
|
-
});
|
|
36521
|
-
},
|
|
36522
|
-
[value]
|
|
36523
|
-
);
|
|
36524
|
-
return /* @__PURE__ */ jsx("tr", { className: joinClassNames("some-TableFilters-classname", className), id, ref: innerRef, ...rest, children });
|
|
36903
|
+
),
|
|
36904
|
+
// create select options for each possible data value
|
|
36905
|
+
dataOptions.map((dataOption) => /* @__PURE__ */ jsx(
|
|
36906
|
+
SelectOption,
|
|
36907
|
+
{
|
|
36908
|
+
className,
|
|
36909
|
+
id: idBase ? `${idBase}-${dataOption}` : null,
|
|
36910
|
+
label: dataOption,
|
|
36911
|
+
value: dataOption,
|
|
36912
|
+
...rest
|
|
36913
|
+
},
|
|
36914
|
+
`${idBase || "table-filter-select-all-options"}-${dataOption}`
|
|
36915
|
+
))
|
|
36916
|
+
] });
|
|
36525
36917
|
}
|
|
36526
|
-
|
|
36527
|
-
|
|
36528
|
-
const propTypes$
|
|
36529
|
-
children
|
|
36918
|
+
TableFilterSelectAllOptions.propTypes = propTypes$g;
|
|
36919
|
+
TableFilterSelectAllOptions.defaultProps = defaultProps$g;
|
|
36920
|
+
const propTypes$f = {
|
|
36921
|
+
// if no children (TableFilterSelect) are provided then it will automagically use TableFilterSelectAllOptions
|
|
36922
|
+
children: propTypesExports.node,
|
|
36530
36923
|
className: propTypesExports.string,
|
|
36531
36924
|
defaultValue: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.number]),
|
|
36532
36925
|
innerRef: RefShape,
|
|
@@ -36535,7 +36928,8 @@ const propTypes$g = {
|
|
|
36535
36928
|
recordFieldPath: propTypesExports.string.isRequired,
|
|
36536
36929
|
value: propTypesExports.string
|
|
36537
36930
|
};
|
|
36538
|
-
const defaultProps$
|
|
36931
|
+
const defaultProps$f = {
|
|
36932
|
+
children: null,
|
|
36539
36933
|
className: null,
|
|
36540
36934
|
defaultValue: null,
|
|
36541
36935
|
innerRef: null,
|
|
@@ -36573,13 +36967,21 @@ function TableFilterSelect({
|
|
|
36573
36967
|
onChange: currentOnChange,
|
|
36574
36968
|
value: currentValue,
|
|
36575
36969
|
...rest,
|
|
36576
|
-
children
|
|
36970
|
+
children: children || /* @__PURE__ */ jsx(
|
|
36971
|
+
TableFilterSelectAllOptions,
|
|
36972
|
+
{
|
|
36973
|
+
className,
|
|
36974
|
+
idBase: id,
|
|
36975
|
+
recordFieldPath,
|
|
36976
|
+
...rest
|
|
36977
|
+
}
|
|
36978
|
+
)
|
|
36577
36979
|
}
|
|
36578
36980
|
) });
|
|
36579
36981
|
}
|
|
36580
|
-
TableFilterSelect.propTypes = propTypes$
|
|
36581
|
-
TableFilterSelect.defaultProps = defaultProps$
|
|
36582
|
-
const propTypes$
|
|
36982
|
+
TableFilterSelect.propTypes = propTypes$f;
|
|
36983
|
+
TableFilterSelect.defaultProps = defaultProps$f;
|
|
36984
|
+
const propTypes$e = {
|
|
36583
36985
|
className: propTypesExports.string,
|
|
36584
36986
|
innerRef: RefShape,
|
|
36585
36987
|
id: propTypesExports.string,
|
|
@@ -36587,7 +36989,7 @@ const propTypes$f = {
|
|
|
36587
36989
|
// eslint-disable-next-line react/forbid-prop-types
|
|
36588
36990
|
value: propTypesExports.any.isRequired
|
|
36589
36991
|
};
|
|
36590
|
-
const defaultProps$
|
|
36992
|
+
const defaultProps$e = {
|
|
36591
36993
|
className: null,
|
|
36592
36994
|
innerRef: null,
|
|
36593
36995
|
id: null
|
|
@@ -36612,9 +37014,9 @@ function TableFilterSelectOption({
|
|
|
36612
37014
|
}
|
|
36613
37015
|
);
|
|
36614
37016
|
}
|
|
36615
|
-
TableFilterSelectOption.propTypes = propTypes$
|
|
36616
|
-
TableFilterSelectOption.defaultProps = defaultProps$
|
|
36617
|
-
const propTypes$
|
|
37017
|
+
TableFilterSelectOption.propTypes = propTypes$e;
|
|
37018
|
+
TableFilterSelectOption.defaultProps = defaultProps$e;
|
|
37019
|
+
const propTypes$d = {
|
|
36618
37020
|
className: propTypesExports.string,
|
|
36619
37021
|
defaultValue: propTypesExports.string,
|
|
36620
37022
|
innerRef: RefShape,
|
|
@@ -36623,7 +37025,7 @@ const propTypes$e = {
|
|
|
36623
37025
|
recordFieldPath: propTypesExports.string.isRequired,
|
|
36624
37026
|
value: propTypesExports.string
|
|
36625
37027
|
};
|
|
36626
|
-
const defaultProps$
|
|
37028
|
+
const defaultProps$d = {
|
|
36627
37029
|
className: null,
|
|
36628
37030
|
defaultValue: null,
|
|
36629
37031
|
innerRef: null,
|
|
@@ -36663,15 +37065,77 @@ function TableFilterTextInput({
|
|
|
36663
37065
|
}
|
|
36664
37066
|
) });
|
|
36665
37067
|
}
|
|
36666
|
-
TableFilterTextInput.propTypes = propTypes$
|
|
36667
|
-
TableFilterTextInput.defaultProps = defaultProps$
|
|
36668
|
-
const propTypes$
|
|
37068
|
+
TableFilterTextInput.propTypes = propTypes$d;
|
|
37069
|
+
TableFilterTextInput.defaultProps = defaultProps$d;
|
|
37070
|
+
const propTypes$c = {
|
|
37071
|
+
children: propTypesExports.node.isRequired,
|
|
37072
|
+
defaultValue: propTypesExports.shape({}),
|
|
37073
|
+
className: propTypesExports.string,
|
|
37074
|
+
innerRef: RefShape,
|
|
37075
|
+
id: propTypesExports.string,
|
|
37076
|
+
// fires when any filter changes; ie ({ recordFieldPath, value }) => { ... do something ... }
|
|
37077
|
+
onChange: propTypesExports.func,
|
|
37078
|
+
// make sure to useMemo() before passing value in here
|
|
37079
|
+
value: propTypesExports.shape({})
|
|
37080
|
+
};
|
|
37081
|
+
const defaultProps$c = {
|
|
37082
|
+
className: null,
|
|
37083
|
+
defaultValue: null,
|
|
37084
|
+
innerRef: null,
|
|
37085
|
+
id: null,
|
|
37086
|
+
onChange: null,
|
|
37087
|
+
value: null
|
|
37088
|
+
};
|
|
37089
|
+
function TableFilters({
|
|
37090
|
+
children,
|
|
37091
|
+
className,
|
|
37092
|
+
defaultValue,
|
|
37093
|
+
innerRef,
|
|
37094
|
+
id,
|
|
37095
|
+
onChange,
|
|
37096
|
+
value,
|
|
37097
|
+
...rest
|
|
37098
|
+
}) {
|
|
37099
|
+
const { setState, state } = useContext(TableContext);
|
|
37100
|
+
useEffect(
|
|
37101
|
+
() => {
|
|
37102
|
+
if (state.filterValues.defaultValue || state.filterValues.onChange || state.filterValues.value && Object.values(state.filterValues.value).length) {
|
|
37103
|
+
console.warn("defaultValue, onChange, or value were already set for Filters. There should only be one <TableFilters/> section in a table.");
|
|
37104
|
+
}
|
|
37105
|
+
setState((draftState) => {
|
|
37106
|
+
draftState.filterValues.defaultValue = defaultValue;
|
|
37107
|
+
draftState.filterValues.onChange = onChange;
|
|
37108
|
+
draftState.filterValues.value = value || draftState.filterValues.value;
|
|
37109
|
+
});
|
|
37110
|
+
return () => {
|
|
37111
|
+
setState((draftState) => {
|
|
37112
|
+
draftState.filterValues.defaultValue = null;
|
|
37113
|
+
draftState.filterValues.onChange = null;
|
|
37114
|
+
draftState.filterValues.value = {};
|
|
37115
|
+
});
|
|
37116
|
+
};
|
|
37117
|
+
},
|
|
37118
|
+
[]
|
|
37119
|
+
);
|
|
37120
|
+
useEffect(
|
|
37121
|
+
() => {
|
|
37122
|
+
setState((draftState) => {
|
|
37123
|
+
draftState.filterValues.value = value || draftState.filterValues.value;
|
|
37124
|
+
});
|
|
37125
|
+
},
|
|
37126
|
+
[value]
|
|
37127
|
+
);
|
|
37128
|
+
return /* @__PURE__ */ jsx("tr", { className: joinClassNames("some-TableFilters-classname", className), id, ref: innerRef, ...rest, children });
|
|
37129
|
+
}
|
|
37130
|
+
TableFilters.propTypes = propTypes$c;
|
|
37131
|
+
TableFilters.defaultProps = defaultProps$c;
|
|
37132
|
+
const propTypes$b = {
|
|
36669
37133
|
children: propTypesExports.node.isRequired,
|
|
36670
37134
|
className: propTypesExports.string,
|
|
36671
37135
|
innerRef: RefShape,
|
|
36672
37136
|
id: propTypesExports.string
|
|
36673
37137
|
};
|
|
36674
|
-
const defaultProps$
|
|
37138
|
+
const defaultProps$b = {
|
|
36675
37139
|
className: null,
|
|
36676
37140
|
innerRef: null,
|
|
36677
37141
|
id: null
|
|
@@ -36685,15 +37149,15 @@ function TableFoot({
|
|
|
36685
37149
|
}) {
|
|
36686
37150
|
return /* @__PURE__ */ jsx("tfoot", { className: joinClassNames("some-TableFoot-classname", className), id, ref: innerRef, ...rest, children });
|
|
36687
37151
|
}
|
|
36688
|
-
TableFoot.propTypes = propTypes$
|
|
36689
|
-
TableFoot.defaultProps = defaultProps$
|
|
36690
|
-
const propTypes$
|
|
37152
|
+
TableFoot.propTypes = propTypes$b;
|
|
37153
|
+
TableFoot.defaultProps = defaultProps$b;
|
|
37154
|
+
const propTypes$a = {
|
|
36691
37155
|
children: propTypesExports.node,
|
|
36692
37156
|
className: propTypesExports.string,
|
|
36693
37157
|
innerRef: RefShape,
|
|
36694
37158
|
id: propTypesExports.string
|
|
36695
37159
|
};
|
|
36696
|
-
const defaultProps$
|
|
37160
|
+
const defaultProps$a = {
|
|
36697
37161
|
children: null,
|
|
36698
37162
|
className: null,
|
|
36699
37163
|
innerRef: null,
|
|
@@ -36708,15 +37172,15 @@ function TableFootCell({
|
|
|
36708
37172
|
}) {
|
|
36709
37173
|
return /* @__PURE__ */ jsx("td", { className: joinClassNames("some-TableFootCell-classname", className), id, ref: innerRef, ...rest, children });
|
|
36710
37174
|
}
|
|
36711
|
-
TableFootCell.propTypes = propTypes$
|
|
36712
|
-
TableFootCell.defaultProps = defaultProps$
|
|
36713
|
-
const propTypes$
|
|
37175
|
+
TableFootCell.propTypes = propTypes$a;
|
|
37176
|
+
TableFootCell.defaultProps = defaultProps$a;
|
|
37177
|
+
const propTypes$9 = {
|
|
36714
37178
|
children: propTypesExports.node.isRequired,
|
|
36715
37179
|
className: propTypesExports.string,
|
|
36716
37180
|
innerRef: RefShape,
|
|
36717
37181
|
id: propTypesExports.string
|
|
36718
37182
|
};
|
|
36719
|
-
const defaultProps$
|
|
37183
|
+
const defaultProps$9 = {
|
|
36720
37184
|
className: null,
|
|
36721
37185
|
innerRef: null,
|
|
36722
37186
|
id: null
|
|
@@ -36730,15 +37194,15 @@ function TableFootRow({
|
|
|
36730
37194
|
}) {
|
|
36731
37195
|
return /* @__PURE__ */ jsx("tr", { className: joinClassNames("some-TableFootRow-classname", className), id, ref: innerRef, ...rest, children });
|
|
36732
37196
|
}
|
|
36733
|
-
TableFootRow.propTypes = propTypes$
|
|
36734
|
-
TableFootRow.defaultProps = defaultProps$
|
|
36735
|
-
const propTypes$
|
|
37197
|
+
TableFootRow.propTypes = propTypes$9;
|
|
37198
|
+
TableFootRow.defaultProps = defaultProps$9;
|
|
37199
|
+
const propTypes$8 = {
|
|
36736
37200
|
children: propTypesExports.node.isRequired,
|
|
36737
37201
|
className: propTypesExports.string,
|
|
36738
37202
|
innerRef: RefShape,
|
|
36739
37203
|
id: propTypesExports.string
|
|
36740
37204
|
};
|
|
36741
|
-
const defaultProps$
|
|
37205
|
+
const defaultProps$8 = {
|
|
36742
37206
|
className: null,
|
|
36743
37207
|
innerRef: null,
|
|
36744
37208
|
id: null
|
|
@@ -36761,9 +37225,9 @@ function TableHead({
|
|
|
36761
37225
|
}
|
|
36762
37226
|
);
|
|
36763
37227
|
}
|
|
36764
|
-
TableHead.propTypes = propTypes$
|
|
36765
|
-
TableHead.defaultProps = defaultProps$
|
|
36766
|
-
const propTypes$
|
|
37228
|
+
TableHead.propTypes = propTypes$8;
|
|
37229
|
+
TableHead.defaultProps = defaultProps$8;
|
|
37230
|
+
const propTypes$7 = {
|
|
36767
37231
|
children: propTypesExports.node,
|
|
36768
37232
|
className: propTypesExports.string,
|
|
36769
37233
|
// The field related to this column. CellTemplate and RowTemplate can define a field. This field is used for determining sorting and filtering.
|
|
@@ -36773,7 +37237,7 @@ const propTypes$9 = {
|
|
|
36773
37237
|
onClick: propTypesExports.func,
|
|
36774
37238
|
tableSortingFieldPaths: propTypesExports.arrayOf(propTypesExports.string)
|
|
36775
37239
|
};
|
|
36776
|
-
const defaultProps$
|
|
37240
|
+
const defaultProps$7 = {
|
|
36777
37241
|
children: null,
|
|
36778
37242
|
className: null,
|
|
36779
37243
|
recordFieldPath: null,
|
|
@@ -36827,15 +37291,15 @@ function TableHeadCell({
|
|
|
36827
37291
|
}
|
|
36828
37292
|
);
|
|
36829
37293
|
}
|
|
36830
|
-
TableHeadCell.propTypes = propTypes$
|
|
36831
|
-
TableHeadCell.defaultProps = defaultProps$
|
|
36832
|
-
const propTypes$
|
|
37294
|
+
TableHeadCell.propTypes = propTypes$7;
|
|
37295
|
+
TableHeadCell.defaultProps = defaultProps$7;
|
|
37296
|
+
const propTypes$6 = {
|
|
36833
37297
|
children: propTypesExports.node.isRequired,
|
|
36834
37298
|
className: propTypesExports.string,
|
|
36835
37299
|
innerRef: RefShape,
|
|
36836
37300
|
id: propTypesExports.string
|
|
36837
37301
|
};
|
|
36838
|
-
const defaultProps$
|
|
37302
|
+
const defaultProps$6 = {
|
|
36839
37303
|
className: null,
|
|
36840
37304
|
innerRef: null,
|
|
36841
37305
|
id: null
|
|
@@ -36849,9 +37313,9 @@ function TableHeadRow({
|
|
|
36849
37313
|
}) {
|
|
36850
37314
|
return /* @__PURE__ */ jsx("tr", { className: joinClassNames("some-TableHeadRow-classname", className), id, ref: innerRef, ...rest, children });
|
|
36851
37315
|
}
|
|
36852
|
-
TableHeadRow.propTypes = propTypes$
|
|
36853
|
-
TableHeadRow.defaultProps = defaultProps$
|
|
36854
|
-
const propTypes$
|
|
37316
|
+
TableHeadRow.propTypes = propTypes$6;
|
|
37317
|
+
TableHeadRow.defaultProps = defaultProps$6;
|
|
37318
|
+
const propTypes$5 = {
|
|
36855
37319
|
children: propTypesExports.node.isRequired,
|
|
36856
37320
|
className: propTypesExports.string,
|
|
36857
37321
|
innerRef: RefShape,
|
|
@@ -36861,7 +37325,7 @@ const propTypes$7 = {
|
|
|
36861
37325
|
// (e) => { ... do something ... }
|
|
36862
37326
|
onDoubleClick: propTypesExports.func
|
|
36863
37327
|
};
|
|
36864
|
-
const defaultProps$
|
|
37328
|
+
const defaultProps$5 = {
|
|
36865
37329
|
className: null,
|
|
36866
37330
|
innerRef: null,
|
|
36867
37331
|
id: null,
|
|
@@ -36890,18 +37354,9 @@ function TableRow({
|
|
|
36890
37354
|
}
|
|
36891
37355
|
);
|
|
36892
37356
|
}
|
|
36893
|
-
TableRow.propTypes = propTypes$
|
|
36894
|
-
TableRow.defaultProps = defaultProps$
|
|
36895
|
-
const
|
|
36896
|
-
// compares dates as Date() objects
|
|
36897
|
-
// dates represented by an ISO string should use the STRING enum value
|
|
36898
|
-
DATE: "date",
|
|
36899
|
-
// compares numbers (does do Number(fieldValue)) conversion so it is safe to pass strings as numbers)
|
|
36900
|
-
NUMBER: "number",
|
|
36901
|
-
// does simple localeCompare() string comparison; is safe for null strings
|
|
36902
|
-
STRING: "string"
|
|
36903
|
-
};
|
|
36904
|
-
const propTypes$6 = {
|
|
37357
|
+
TableRow.propTypes = propTypes$5;
|
|
37358
|
+
TableRow.defaultProps = defaultProps$5;
|
|
37359
|
+
const propTypes$4 = {
|
|
36905
37360
|
// should be a function that does sorting
|
|
36906
37361
|
// ({ fieldValueA, fieldValueB, recordA, recordB, records }) => (a < b ? -1 : a > b ? 1 : 0)
|
|
36907
37362
|
customSort: propTypesExports.func,
|
|
@@ -36915,7 +37370,7 @@ const propTypes$6 = {
|
|
|
36915
37370
|
// calculated value's path. This way the value does not have to be recalculated on every render.
|
|
36916
37371
|
recordFieldPath: propTypesExports.string.isRequired
|
|
36917
37372
|
};
|
|
36918
|
-
const defaultProps$
|
|
37373
|
+
const defaultProps$4 = {
|
|
36919
37374
|
customSort: null,
|
|
36920
37375
|
defaultIsAscending: true,
|
|
36921
37376
|
fieldType: "string"
|
|
@@ -36943,16 +37398,16 @@ function TableSortingRule({
|
|
|
36943
37398
|
);
|
|
36944
37399
|
return null;
|
|
36945
37400
|
}
|
|
36946
|
-
TableSortingRule.propTypes = propTypes$
|
|
36947
|
-
TableSortingRule.defaultProps = defaultProps$
|
|
36948
|
-
const propTypes$
|
|
37401
|
+
TableSortingRule.propTypes = propTypes$4;
|
|
37402
|
+
TableSortingRule.defaultProps = defaultProps$4;
|
|
37403
|
+
const propTypes$3 = {
|
|
36949
37404
|
children: propTypesExports.node.isRequired,
|
|
36950
37405
|
defaultValue: propTypesExports.string,
|
|
36951
37406
|
// ({ recordFieldPath }) => { ... do something ... }
|
|
36952
37407
|
onChange: propTypesExports.func,
|
|
36953
37408
|
value: propTypesExports.string
|
|
36954
37409
|
};
|
|
36955
|
-
const defaultProps$
|
|
37410
|
+
const defaultProps$3 = {
|
|
36956
37411
|
defaultValue: null,
|
|
36957
37412
|
onChange: null,
|
|
36958
37413
|
value: void 0
|
|
@@ -36999,174 +37454,63 @@ function TableSortingRules({
|
|
|
36999
37454
|
);
|
|
37000
37455
|
return children;
|
|
37001
37456
|
}
|
|
37002
|
-
TableSortingRules.propTypes = propTypes$
|
|
37003
|
-
TableSortingRules.defaultProps = defaultProps$
|
|
37004
|
-
const useRefAlways = (value) => {
|
|
37005
|
-
const ref = useRef(value);
|
|
37006
|
-
ref.current = value;
|
|
37007
|
-
return ref;
|
|
37008
|
-
};
|
|
37009
|
-
const propTypes$4 = {
|
|
37010
|
-
children: propTypesExports.node.isRequired,
|
|
37011
|
-
className: propTypesExports.string,
|
|
37012
|
-
innerRef: RefShape,
|
|
37013
|
-
id: propTypesExports.string
|
|
37014
|
-
};
|
|
37015
|
-
const defaultProps$4 = {
|
|
37016
|
-
className: null,
|
|
37017
|
-
innerRef: null,
|
|
37018
|
-
id: null
|
|
37019
|
-
};
|
|
37020
|
-
function sortByFieldType(sortingRule, fieldValueA, fieldValueB) {
|
|
37021
|
-
let result;
|
|
37022
|
-
switch (sortingRule.fieldType) {
|
|
37023
|
-
case tableSortingRuleFieldType.DATE:
|
|
37024
|
-
result = ((fieldValueA == null ? void 0 : fieldValueA.getTime()) || 0) - ((fieldValueB == null ? void 0 : fieldValueB.getTime()) || 0);
|
|
37025
|
-
break;
|
|
37026
|
-
case tableSortingRuleFieldType.NUMBER:
|
|
37027
|
-
result = Number(fieldValueA || 0) - Number(fieldValueB || 0);
|
|
37028
|
-
break;
|
|
37029
|
-
case tableSortingRuleFieldType.STRING:
|
|
37030
|
-
result = (fieldValueA || "").localeCompare(fieldValueB || "");
|
|
37031
|
-
break;
|
|
37032
|
-
default:
|
|
37033
|
-
throw new Error(`Unknown tableSortingRuleFieldType '${sortingRule.fieldType}'`);
|
|
37034
|
-
}
|
|
37035
|
-
return result;
|
|
37036
|
-
}
|
|
37037
|
-
function TableWrapper({
|
|
37038
|
-
children,
|
|
37039
|
-
className,
|
|
37040
|
-
innerRef,
|
|
37041
|
-
id,
|
|
37042
|
-
...rest
|
|
37043
|
-
}) {
|
|
37044
|
-
const [state, setState] = i({
|
|
37045
|
-
// when sorting, should the sort order for a rule be the "default"
|
|
37046
|
-
// ie a rule defaults to ascending so when currentSortingOrderIsDefault is true then sort that rule ascending
|
|
37047
|
-
currentSortingOrderIsDefault: true,
|
|
37048
|
-
// [recordFieldPath]: filterValue <== the current filtering values from <TableFilter... /> components
|
|
37049
|
-
filterValues: {
|
|
37050
|
-
// context level values from a <TableFilters /> component (<TableFilter... /> child components would override/chain these values)
|
|
37051
|
-
// defaultValue - object of [recordFieldPath]:value pairs for filtering inputs
|
|
37052
|
-
defaultValue: null,
|
|
37053
|
-
// onChange to call for any filter change
|
|
37054
|
-
onChange: null,
|
|
37055
|
-
// value - object of [recordFieldPath]:value pairs for filtering inputs
|
|
37056
|
-
value: {}
|
|
37057
|
-
},
|
|
37058
|
-
// these are the sorting rules to which a <TableHeadCell> connects assumes order is add order
|
|
37059
|
-
sortingRules: {},
|
|
37060
|
-
// (func) when table sorting changes, this callback will be called: from <TableSortingRules>
|
|
37061
|
-
tableSortingOnChange: null,
|
|
37062
|
-
// (string | [string]) the current recordFieldPath name for the current header being sorted
|
|
37063
|
-
// array if <TableHeadCell> specifies sort order; otherwise, sort fields in registration order
|
|
37064
|
-
// set when a TableHeadCell is selected and sets its tableSortingFieldPaths as the tableSortingFieldPath
|
|
37065
|
-
// TableBodyData uses this value to sort its records
|
|
37066
|
-
tableSortingFieldPath: null,
|
|
37067
|
-
// a TableHeadCell can provide tableSortingFieldPaths to customize which sorters to use in which order
|
|
37068
|
-
tableSortingFieldPaths: null
|
|
37069
|
-
});
|
|
37070
|
-
const stateRef = useRefAlways(state);
|
|
37071
|
-
const contextValue = useMemo(
|
|
37072
|
-
() => ({
|
|
37073
|
-
// register a new rule for sorting, generally from a <TableSortingRule>
|
|
37074
|
-
registerSortingRule: (sortingRule) => setState((draftState) => {
|
|
37075
|
-
draftState.sortingRules[sortingRule.recordFieldPath] = {
|
|
37076
|
-
...sortingRule,
|
|
37077
|
-
sorter: (recordA, recordB, records) => {
|
|
37078
|
-
const fieldValueA = valueAtPath({ object: recordA.record, path: sortingRule.recordFieldPath });
|
|
37079
|
-
const fieldValueB = valueAtPath({ object: recordB.record, path: sortingRule.recordFieldPath });
|
|
37080
|
-
let result;
|
|
37081
|
-
if (sortingRule.customSort) {
|
|
37082
|
-
result = sortingRule.customSort({
|
|
37083
|
-
fieldValueA,
|
|
37084
|
-
fieldValueB,
|
|
37085
|
-
recordA: recordA.record,
|
|
37086
|
-
recordAIndex: recordA.recordIndex,
|
|
37087
|
-
recordB: recordB.record,
|
|
37088
|
-
recordBIndex: recordB.recordIndex,
|
|
37089
|
-
records
|
|
37090
|
-
});
|
|
37091
|
-
} else {
|
|
37092
|
-
result = sortByFieldType(sortingRule, fieldValueA, fieldValueB);
|
|
37093
|
-
}
|
|
37094
|
-
return result * (stateRef.current.currentSortingOrderIsDefault ? 1 : -1) * (sortingRule.defaultIsAscending ? 1 : -1);
|
|
37095
|
-
}
|
|
37096
|
-
};
|
|
37097
|
-
}),
|
|
37098
|
-
// unregister a rule for sorting, generally when a <TableSortingRule> unmounts
|
|
37099
|
-
unregisterSortingRule: (recordFieldPath) => setState((draftState) => {
|
|
37100
|
-
delete draftState.sortingRules[recordFieldPath];
|
|
37101
|
-
}),
|
|
37102
|
-
setState,
|
|
37103
|
-
state
|
|
37104
|
-
}),
|
|
37105
|
-
[state]
|
|
37106
|
-
);
|
|
37107
|
-
return /* @__PURE__ */ jsx(TableContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx("div", { className: joinClassNames("some-table-wrapper-className", className), id, ref: innerRef, ...rest, children }) });
|
|
37108
|
-
}
|
|
37109
|
-
TableWrapper.propTypes = propTypes$4;
|
|
37110
|
-
TableWrapper.defaultProps = defaultProps$4;
|
|
37111
|
-
const propTypes$3 = {
|
|
37112
|
-
children: propTypesExports.node.isRequired,
|
|
37113
|
-
className: propTypesExports.string
|
|
37114
|
-
};
|
|
37115
|
-
const defaultProps$3 = {
|
|
37116
|
-
className: null
|
|
37117
|
-
};
|
|
37118
|
-
function TabList({ children, className }) {
|
|
37119
|
-
const { tabGroupId } = useContext(TabGroupContext);
|
|
37120
|
-
return /* @__PURE__ */ jsx(
|
|
37121
|
-
"div",
|
|
37122
|
-
{
|
|
37123
|
-
className: joinClassNames(className, "tab-group__list"),
|
|
37124
|
-
role: "tablist",
|
|
37125
|
-
"aria-labelledby": `tab-group-${tabGroupId}`,
|
|
37126
|
-
children
|
|
37127
|
-
}
|
|
37128
|
-
);
|
|
37129
|
-
}
|
|
37130
|
-
TabList.propTypes = propTypes$3;
|
|
37131
|
-
TabList.defaultProps = defaultProps$3;
|
|
37457
|
+
TableSortingRules.propTypes = propTypes$3;
|
|
37458
|
+
TableSortingRules.defaultProps = defaultProps$3;
|
|
37132
37459
|
const propTypes$2 = {
|
|
37133
|
-
|
|
37134
|
-
|
|
37135
|
-
|
|
37136
|
-
|
|
37137
|
-
};
|
|
37138
|
-
const defaultProps$2 = {
|
|
37139
|
-
className: null
|
|
37460
|
+
content: propTypesExports.func.isRequired,
|
|
37461
|
+
contentRef: RefShape.isRequired,
|
|
37462
|
+
sidePanelRightContent: propTypesExports.element.isRequired,
|
|
37463
|
+
sidePanelLeftContent: propTypesExports.element.isRequired
|
|
37140
37464
|
};
|
|
37141
|
-
|
|
37142
|
-
|
|
37143
|
-
|
|
37144
|
-
|
|
37145
|
-
|
|
37146
|
-
|
|
37147
|
-
|
|
37148
|
-
|
|
37149
|
-
|
|
37150
|
-
|
|
37151
|
-
|
|
37152
|
-
|
|
37153
|
-
role: "tabpanel",
|
|
37154
|
-
tabIndex: "0",
|
|
37155
|
-
children
|
|
37156
|
-
}
|
|
37157
|
-
);
|
|
37465
|
+
const defaultProps$2 = {};
|
|
37466
|
+
function DocumentationTemplate({
|
|
37467
|
+
content: Content,
|
|
37468
|
+
contentRef,
|
|
37469
|
+
sidePanelRightContent,
|
|
37470
|
+
sidePanelLeftContent
|
|
37471
|
+
}) {
|
|
37472
|
+
return /* @__PURE__ */ jsx("div", { className: "documentation-template__wrapper", children: /* @__PURE__ */ jsxs("div", { className: "documentation-template", children: [
|
|
37473
|
+
/* @__PURE__ */ jsx("div", { className: "documentation-template__side-panel-left", children: sidePanelLeftContent }),
|
|
37474
|
+
/* @__PURE__ */ jsx("main", { className: "documentation-template__content", ref: contentRef, children: /* @__PURE__ */ jsx(Content, {}) }),
|
|
37475
|
+
/* @__PURE__ */ jsx("div", { className: "documentation-template__side-panel-right", children: sidePanelRightContent })
|
|
37476
|
+
] }) });
|
|
37158
37477
|
}
|
|
37159
|
-
|
|
37160
|
-
|
|
37478
|
+
DocumentationTemplate.propTypes = propTypes$2;
|
|
37479
|
+
DocumentationTemplate.defaultProps = defaultProps$2;
|
|
37161
37480
|
const propTypes$1 = {
|
|
37162
|
-
|
|
37481
|
+
content: propTypesExports.func.isRequired
|
|
37163
37482
|
};
|
|
37164
37483
|
const defaultProps$1 = {};
|
|
37165
|
-
function
|
|
37166
|
-
return /* @__PURE__ */ jsx(
|
|
37484
|
+
function LandingTemplate({ content: Content }) {
|
|
37485
|
+
return /* @__PURE__ */ jsx(Content, {});
|
|
37486
|
+
}
|
|
37487
|
+
LandingTemplate.propTypes = propTypes$1;
|
|
37488
|
+
LandingTemplate.defaultProps = defaultProps$1;
|
|
37489
|
+
const UtahHeaderContext = React__default.createContext();
|
|
37490
|
+
function useUtahHeaderContext() {
|
|
37491
|
+
return useContext(UtahHeaderContext);
|
|
37492
|
+
}
|
|
37493
|
+
const propTypes = { children: propTypesExports.node.isRequired };
|
|
37494
|
+
const defaultProps = {};
|
|
37495
|
+
function UtahHeaderContextProvider({ children }) {
|
|
37496
|
+
const [settings, setSettings] = i(() => getUtahHeaderSettings());
|
|
37497
|
+
useEffect(
|
|
37498
|
+
() => {
|
|
37499
|
+
setUtahHeaderSettings(settings);
|
|
37500
|
+
},
|
|
37501
|
+
[settings]
|
|
37502
|
+
);
|
|
37503
|
+
const providedSettings = useMemo(() => ({ settings, setSettings }), [settings]);
|
|
37504
|
+
return (
|
|
37505
|
+
// Vite HMR was sometimes getting an "unspreadable" value for this context!
|
|
37506
|
+
// The above useMemo() ALWAYS returns a spreadable object, so it seems it's got to
|
|
37507
|
+
// be HMR's fault it's not always behaving? Why would providedSettings ever not be an object?
|
|
37508
|
+
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
37509
|
+
/* @__PURE__ */ jsx(UtahHeaderContext.Provider, { value: providedSettings || {}, children })
|
|
37510
|
+
);
|
|
37167
37511
|
}
|
|
37168
|
-
|
|
37169
|
-
|
|
37512
|
+
UtahHeaderContextProvider.propTypes = propTypes;
|
|
37513
|
+
UtahHeaderContextProvider.defaultProps = defaultProps;
|
|
37170
37514
|
function useBanner() {
|
|
37171
37515
|
return ({ message }) => {
|
|
37172
37516
|
console.log(message);
|
|
@@ -37207,18 +37551,6 @@ function useMountingTracker(title) {
|
|
|
37207
37551
|
[]
|
|
37208
37552
|
);
|
|
37209
37553
|
}
|
|
37210
|
-
function usePaginatedList({ list, pageIndex, itemsPerPage }) {
|
|
37211
|
-
const [paginatedList] = useStateEffect({
|
|
37212
|
-
calculateValueFn: () => {
|
|
37213
|
-
const totalPages = Math.ceil(list.length / itemsPerPage);
|
|
37214
|
-
const startIndex = totalPages ? Math.max(Math.min(totalPages - 1, pageIndex) * itemsPerPage) : 0;
|
|
37215
|
-
const endIndex = startIndex + itemsPerPage;
|
|
37216
|
-
return list.slice(startIndex, endIndex);
|
|
37217
|
-
},
|
|
37218
|
-
dependencyList: [list, pageIndex, itemsPerPage]
|
|
37219
|
-
});
|
|
37220
|
-
return paginatedList;
|
|
37221
|
-
}
|
|
37222
37554
|
const useRefLazy = (lazyFunc) => {
|
|
37223
37555
|
const ref = useRef(void 0);
|
|
37224
37556
|
if (ref.current === void 0) {
|
|
@@ -37226,25 +37558,35 @@ const useRefLazy = (lazyFunc) => {
|
|
|
37226
37558
|
}
|
|
37227
37559
|
return ref;
|
|
37228
37560
|
};
|
|
37229
|
-
const
|
|
37230
|
-
function
|
|
37231
|
-
return
|
|
37561
|
+
const handleKeyPress = (code, handler) => (e) => e.code === code && handler();
|
|
37562
|
+
function calculateMenuItemsParents({ parentLinks = [], menuItems }) {
|
|
37563
|
+
return (menuItems || []).map((menuItem2) => {
|
|
37564
|
+
const menuItemLink = menuItem2.link || `menuHeader::${menuItem2.title}`;
|
|
37565
|
+
return {
|
|
37566
|
+
...menuItem2,
|
|
37567
|
+
link: menuItemLink,
|
|
37568
|
+
parentLinks: [...menuItem2.parentLinks || [], ...parentLinks],
|
|
37569
|
+
children: menuItem2.children && calculateMenuItemsParents({
|
|
37570
|
+
parentLinks: [
|
|
37571
|
+
...menuItem2.parentLinks || [],
|
|
37572
|
+
...parentLinks,
|
|
37573
|
+
menuItemLink
|
|
37574
|
+
].filter(identity_1),
|
|
37575
|
+
menuItems: menuItem2.children
|
|
37576
|
+
})
|
|
37577
|
+
};
|
|
37578
|
+
});
|
|
37232
37579
|
}
|
|
37233
|
-
|
|
37234
|
-
|
|
37235
|
-
|
|
37236
|
-
|
|
37237
|
-
|
|
37238
|
-
|
|
37239
|
-
|
|
37240
|
-
|
|
37241
|
-
|
|
37242
|
-
);
|
|
37243
|
-
const providedSettings = useMemo(() => ({ settings, setSettings }), [settings]);
|
|
37244
|
-
return /* @__PURE__ */ jsx(UtahHeaderContext.Provider, { value: providedSettings, children });
|
|
37580
|
+
function rectContainsPoint(rect, point) {
|
|
37581
|
+
return rect.left <= point.x && rect.right >= point.x && rect.top <= point.y && rect.bottom >= point.y;
|
|
37582
|
+
}
|
|
37583
|
+
function stringToId(inputString) {
|
|
37584
|
+
let retVal;
|
|
37585
|
+
retVal = inputString == null ? void 0 : inputString.toLowerCase();
|
|
37586
|
+
retVal = retVal == null ? void 0 : retVal.replaceAll(" ", "-");
|
|
37587
|
+
retVal = retVal == null ? void 0 : retVal.replaceAll(/[^a-zA-Z0-9-]+/g, "");
|
|
37588
|
+
return retVal;
|
|
37245
37589
|
}
|
|
37246
|
-
UtahHeaderContextProvider.propTypes = propTypes;
|
|
37247
|
-
UtahHeaderContextProvider.defaultProps = defaultProps;
|
|
37248
37590
|
const { version } = packageJson;
|
|
37249
37591
|
export {
|
|
37250
37592
|
Accordion,
|
|
@@ -37254,6 +37596,7 @@ export {
|
|
|
37254
37596
|
CheckBox,
|
|
37255
37597
|
ConfirmationButton,
|
|
37256
37598
|
DocumentationTemplate,
|
|
37599
|
+
ExternalLink,
|
|
37257
37600
|
Form,
|
|
37258
37601
|
FormContext,
|
|
37259
37602
|
FormContextProvider,
|
|
@@ -37306,6 +37649,7 @@ export {
|
|
|
37306
37649
|
UtahHeaderContextProvider,
|
|
37307
37650
|
baseSettings,
|
|
37308
37651
|
calculateMenuItemsParents,
|
|
37652
|
+
chainSorters,
|
|
37309
37653
|
childrenMenuTypes,
|
|
37310
37654
|
componentColors,
|
|
37311
37655
|
events,
|
|
@@ -37313,7 +37657,7 @@ export {
|
|
|
37313
37657
|
handleEvent,
|
|
37314
37658
|
handleKeyPress,
|
|
37315
37659
|
joinClassNames,
|
|
37316
|
-
|
|
37660
|
+
popupPlacement,
|
|
37317
37661
|
rectContainsPoint,
|
|
37318
37662
|
renderDOMSingle,
|
|
37319
37663
|
setValueAtPath,
|