@mackin.com/styleguide 11.0.12 → 11.2.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/index.d.ts +192 -162
- package/index.esm.js +1202 -1068
- package/index.js +1202 -1067
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -1242,6 +1242,128 @@ const styles = {
|
|
|
1242
1242
|
}),
|
|
1243
1243
|
};
|
|
1244
1244
|
|
|
1245
|
+
const defaultMinChars = 3;
|
|
1246
|
+
class AutocompleteController {
|
|
1247
|
+
constructor(getOptions, config) {
|
|
1248
|
+
var _a;
|
|
1249
|
+
this._value = undefined;
|
|
1250
|
+
this._options = [];
|
|
1251
|
+
this._minChars = (_a = config === null || config === void 0 ? void 0 : config.minChars) !== null && _a !== void 0 ? _a : defaultMinChars;
|
|
1252
|
+
if (config === null || config === void 0 ? void 0 : config.debounceMs) {
|
|
1253
|
+
this.getOptions = createDebouncedPromise(getOptions, config === null || config === void 0 ? void 0 : config.debounceMs);
|
|
1254
|
+
}
|
|
1255
|
+
else {
|
|
1256
|
+
this.getOptions = getOptions;
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
get value() {
|
|
1260
|
+
return this._value;
|
|
1261
|
+
}
|
|
1262
|
+
get options() {
|
|
1263
|
+
return this._options;
|
|
1264
|
+
}
|
|
1265
|
+
async onChange(newValue) {
|
|
1266
|
+
// don't make getOptions calls if the value hasn't changed.
|
|
1267
|
+
if (newValue === this.value) {
|
|
1268
|
+
return;
|
|
1269
|
+
}
|
|
1270
|
+
// nullish should not make the getOptions call and instead clear everything.
|
|
1271
|
+
if (!newValue) {
|
|
1272
|
+
this._value = newValue;
|
|
1273
|
+
this._options = [];
|
|
1274
|
+
return;
|
|
1275
|
+
}
|
|
1276
|
+
// sub min chars should clear everything and not attempt the getOptions call.
|
|
1277
|
+
if (newValue.length < this._minChars) {
|
|
1278
|
+
this._value = newValue;
|
|
1279
|
+
this._options = [];
|
|
1280
|
+
return;
|
|
1281
|
+
}
|
|
1282
|
+
try {
|
|
1283
|
+
this._value = newValue;
|
|
1284
|
+
this._options = (await this.getOptions(newValue));
|
|
1285
|
+
}
|
|
1286
|
+
catch (err) {
|
|
1287
|
+
// this method will throw errors on debounce rejections. that is to be expected.
|
|
1288
|
+
// for actual getOptions exceptions, the owner of that function will need to handle errors.
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
onPick(newValue) {
|
|
1292
|
+
this._value = newValue;
|
|
1293
|
+
this._options = [];
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
const createDebouncedPromise = (originalFunction, trailingTimeoutMs) => {
|
|
1297
|
+
let timer;
|
|
1298
|
+
let onCancel;
|
|
1299
|
+
return (value) => {
|
|
1300
|
+
if (timer) {
|
|
1301
|
+
clearTimeout(timer);
|
|
1302
|
+
}
|
|
1303
|
+
if (onCancel) {
|
|
1304
|
+
onCancel('Promise cancelled due to in-progress debounce call.');
|
|
1305
|
+
onCancel = undefined;
|
|
1306
|
+
}
|
|
1307
|
+
return new Promise((res, rej) => {
|
|
1308
|
+
onCancel = rej;
|
|
1309
|
+
timer = setTimeout(() => {
|
|
1310
|
+
originalFunction(value)
|
|
1311
|
+
.then(values => {
|
|
1312
|
+
res(values);
|
|
1313
|
+
})
|
|
1314
|
+
.catch(err => {
|
|
1315
|
+
rej(err);
|
|
1316
|
+
})
|
|
1317
|
+
.finally(() => {
|
|
1318
|
+
clearTimeout(timer);
|
|
1319
|
+
});
|
|
1320
|
+
}, trailingTimeoutMs);
|
|
1321
|
+
});
|
|
1322
|
+
};
|
|
1323
|
+
};
|
|
1324
|
+
|
|
1325
|
+
/** Extracted logic around autocomplete functionality for Autocomplete.tsx that supports Entity (id/name) mapping. */
|
|
1326
|
+
class AutocompleteEntityController {
|
|
1327
|
+
constructor(getOptions, config) {
|
|
1328
|
+
this._options = [];
|
|
1329
|
+
const getStringOptions = async (value) => {
|
|
1330
|
+
this._options = await getOptions(value);
|
|
1331
|
+
return this._options.map(o => o.name);
|
|
1332
|
+
};
|
|
1333
|
+
this._ctrl = new AutocompleteController(getStringOptions, config);
|
|
1334
|
+
}
|
|
1335
|
+
get entity() {
|
|
1336
|
+
return this._pickedEntity;
|
|
1337
|
+
}
|
|
1338
|
+
get entities() {
|
|
1339
|
+
return this._options;
|
|
1340
|
+
}
|
|
1341
|
+
get value() {
|
|
1342
|
+
return this._ctrl.value;
|
|
1343
|
+
}
|
|
1344
|
+
get options() {
|
|
1345
|
+
return this._options.map(o => o.name);
|
|
1346
|
+
}
|
|
1347
|
+
async onChange(newValue) {
|
|
1348
|
+
const clearEntity = newValue !== this._ctrl.value;
|
|
1349
|
+
await this._ctrl.onChange(newValue);
|
|
1350
|
+
if (clearEntity) {
|
|
1351
|
+
this._pickedEntity = undefined;
|
|
1352
|
+
}
|
|
1353
|
+
this.trySyncCtrlOptions();
|
|
1354
|
+
}
|
|
1355
|
+
onPick(newValue) {
|
|
1356
|
+
this._ctrl.onPick(newValue);
|
|
1357
|
+
this._pickedEntity = this._options.find(o => o.name === this._ctrl.value);
|
|
1358
|
+
this.trySyncCtrlOptions();
|
|
1359
|
+
}
|
|
1360
|
+
trySyncCtrlOptions() {
|
|
1361
|
+
if (!this._ctrl.options.length) {
|
|
1362
|
+
this._options = [];
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1245
1367
|
/** Returns a UID. Use this instead of a direct call to a library. */
|
|
1246
1368
|
function createUid() {
|
|
1247
1369
|
return uniqueId();
|
|
@@ -2960,108 +3082,6 @@ const Label = (props) => {
|
|
|
2960
3082
|
return (React.createElement("label", Object.assign({}, labelProps, { htmlFor: htmlFor, className: cx('label', labelStyles, outerClass) }), content));
|
|
2961
3083
|
};
|
|
2962
3084
|
|
|
2963
|
-
const Nav = (props) => {
|
|
2964
|
-
var _a, _b, _c, _d;
|
|
2965
|
-
const nav = React.useRef(null);
|
|
2966
|
-
const theme = useThemeSafely();
|
|
2967
|
-
const navWidth = (_a = props.navWidth) !== null && _a !== void 0 ? _a : theme.layout.navWidth;
|
|
2968
|
-
const totalNavOffset = `calc(${navWidth} + 20px)`;
|
|
2969
|
-
const backdrop = useBackdropContext();
|
|
2970
|
-
const log = useLogger(`Nav ${(_b = props.id) !== null && _b !== void 0 ? _b : '?'}`, (_c = props.__debug) !== null && _c !== void 0 ? _c : false);
|
|
2971
|
-
const slideMs = (_d = props.slideMs) !== null && _d !== void 0 ? _d : theme.timings.nav.slideMs;
|
|
2972
|
-
const slideRight = keyframes `
|
|
2973
|
-
0% {
|
|
2974
|
-
transform: translateX(0);
|
|
2975
|
-
}
|
|
2976
|
-
|
|
2977
|
-
100% {
|
|
2978
|
-
transform: translateX(${totalNavOffset});
|
|
2979
|
-
}
|
|
2980
|
-
`;
|
|
2981
|
-
const slideLeft = keyframes `
|
|
2982
|
-
0% {
|
|
2983
|
-
transform: translateX(${totalNavOffset});
|
|
2984
|
-
}
|
|
2985
|
-
|
|
2986
|
-
100% {
|
|
2987
|
-
transform: translateX(0px);
|
|
2988
|
-
}
|
|
2989
|
-
`;
|
|
2990
|
-
const classNavShowing = css `
|
|
2991
|
-
animation: ${slideRight} ${slideMs}ms cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
|
|
2992
|
-
`;
|
|
2993
|
-
const classNavNotShowing = css `
|
|
2994
|
-
animation: ${slideLeft} ${slideMs}ms cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
|
|
2995
|
-
`;
|
|
2996
|
-
const zIndex = theme.zIndexes.nav;
|
|
2997
|
-
// the padding-top here is to offset the navs' content from the header. the shadow creeps over it.
|
|
2998
|
-
const navStyles = css `
|
|
2999
|
-
label: Nav;
|
|
3000
|
-
position: fixed;
|
|
3001
|
-
top: 0;
|
|
3002
|
-
left: calc(${totalNavOffset} * -1);
|
|
3003
|
-
bottom: 0;
|
|
3004
|
-
background-color: ${theme.colors.nav};
|
|
3005
|
-
color: ${theme.colors.navFont};
|
|
3006
|
-
width: ${navWidth};
|
|
3007
|
-
min-width: ${navWidth};
|
|
3008
|
-
box-shadow: 4px 2px 12px 6px rgba(0, 0, 0, 0.2);
|
|
3009
|
-
z-index: ${zIndex};
|
|
3010
|
-
overflow-y: auto;
|
|
3011
|
-
.omniLink, .omniLink:active, .omniLink:focus, .omniLink:visited {
|
|
3012
|
-
color: ${theme.colors.navFont};
|
|
3013
|
-
}
|
|
3014
|
-
padding-top:0;
|
|
3015
|
-
`;
|
|
3016
|
-
React.useEffect(() => {
|
|
3017
|
-
if (!backdrop.showing) {
|
|
3018
|
-
props.toggle(false);
|
|
3019
|
-
}
|
|
3020
|
-
}, [backdrop.showing]);
|
|
3021
|
-
useBooleanChanged((current, previous) => {
|
|
3022
|
-
var _a;
|
|
3023
|
-
log('show changed', `${previous !== null && previous !== void 0 ? previous : 'undefined'} > ${current}`);
|
|
3024
|
-
backdrop.setShow(current, { key: (_a = props.id) !== null && _a !== void 0 ? _a : 'Nav', zIndex });
|
|
3025
|
-
if (!props.show && props.onCloseFocusId) {
|
|
3026
|
-
const focusId = props.onCloseFocusId;
|
|
3027
|
-
setTimeout(() => {
|
|
3028
|
-
var _a;
|
|
3029
|
-
(_a = document.getElementById(focusId)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
3030
|
-
}, 0);
|
|
3031
|
-
}
|
|
3032
|
-
}, props.show);
|
|
3033
|
-
React.useLayoutEffect(() => {
|
|
3034
|
-
if (nav && nav.current) {
|
|
3035
|
-
if (props.show) {
|
|
3036
|
-
if (!nav.current.classList.contains(classNavShowing)) {
|
|
3037
|
-
nav.current.classList.add(classNavShowing);
|
|
3038
|
-
setTimeout(() => {
|
|
3039
|
-
var _a;
|
|
3040
|
-
(_a = document.getElementById(props.focusContentId)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
3041
|
-
}, slideMs + 1);
|
|
3042
|
-
}
|
|
3043
|
-
}
|
|
3044
|
-
else {
|
|
3045
|
-
if (nav.current.classList.contains(classNavShowing)) {
|
|
3046
|
-
nav.current.classList.remove(classNavShowing);
|
|
3047
|
-
nav.current.classList.add(classNavNotShowing);
|
|
3048
|
-
setTimeout(() => {
|
|
3049
|
-
if (nav && nav.current) {
|
|
3050
|
-
nav.current.classList.remove(classNavNotShowing);
|
|
3051
|
-
}
|
|
3052
|
-
}, slideMs);
|
|
3053
|
-
}
|
|
3054
|
-
}
|
|
3055
|
-
}
|
|
3056
|
-
});
|
|
3057
|
-
return (React.createElement("nav", { role: "dialog", "aria-modal": "true", "aria-label": props.ariaLabel, ref: nav, className: cx('nav', navStyles, props.className), onKeyDown: e => {
|
|
3058
|
-
if (e.code === 'Escape') {
|
|
3059
|
-
props.toggle(false);
|
|
3060
|
-
}
|
|
3061
|
-
} },
|
|
3062
|
-
React.createElement(TabLocker, { className: css({ height: '100%' }) }, props.children)));
|
|
3063
|
-
};
|
|
3064
|
-
|
|
3065
3085
|
const LinkContent = (props) => {
|
|
3066
3086
|
return (React.createElement(React.Fragment, null,
|
|
3067
3087
|
React.createElement("span", null,
|
|
@@ -3319,6 +3339,29 @@ const generateLinkStyles = (props, theme) => {
|
|
|
3319
3339
|
return linkStyles;
|
|
3320
3340
|
};
|
|
3321
3341
|
|
|
3342
|
+
const Link = (props) => {
|
|
3343
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3344
|
+
const { rightIcon, leftIcon, block, iconBlock, variant, round, small, colorOverride, children, disabled, ref, waiting } = props, linkProps = __rest(props, ["rightIcon", "leftIcon", "block", "iconBlock", "variant", "round", "small", "colorOverride", "children", "disabled", "ref", "waiting"]);
|
|
3345
|
+
const theme = useThemeSafely();
|
|
3346
|
+
const linkStyles = generateLinkStyles(props, theme);
|
|
3347
|
+
const mainClassName = cx('link', linkStyles, props.className);
|
|
3348
|
+
if (variant === 'text') {
|
|
3349
|
+
return React.createElement(Text, { className: mainClassName, tag: "div" }, props.children);
|
|
3350
|
+
}
|
|
3351
|
+
const isDisabled = props.disabled || props.waiting;
|
|
3352
|
+
return (React.createElement("a", Object.assign({}, linkProps, { tabIndex: disabled ? -1 : undefined, target: props.target, className: mainClassName, onClick: e => {
|
|
3353
|
+
var _a;
|
|
3354
|
+
if (isDisabled) {
|
|
3355
|
+
e.stopPropagation();
|
|
3356
|
+
e.preventDefault();
|
|
3357
|
+
}
|
|
3358
|
+
else {
|
|
3359
|
+
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
3360
|
+
}
|
|
3361
|
+
} }),
|
|
3362
|
+
React.createElement(LinkContent, Object.assign({}, props))));
|
|
3363
|
+
};
|
|
3364
|
+
|
|
3322
3365
|
const OmniLink = (props) => {
|
|
3323
3366
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3324
3367
|
const { noRouter, rightIcon, leftIcon, block, iconBlock, variant, round, small, colorOverride, children, ref, waiting } = props, linkProps = __rest(props, ["noRouter", "rightIcon", "leftIcon", "block", "iconBlock", "variant", "round", "small", "colorOverride", "children", "ref", "waiting"]);
|
|
@@ -3345,17 +3388,119 @@ const OmniLink = (props) => {
|
|
|
3345
3388
|
} }), content));
|
|
3346
3389
|
};
|
|
3347
3390
|
|
|
3348
|
-
const
|
|
3349
|
-
|
|
3350
|
-
const
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3391
|
+
const Nav = (props) => {
|
|
3392
|
+
var _a, _b, _c, _d;
|
|
3393
|
+
const nav = React.useRef(null);
|
|
3394
|
+
const theme = useThemeSafely();
|
|
3395
|
+
const navWidth = (_a = props.navWidth) !== null && _a !== void 0 ? _a : theme.layout.navWidth;
|
|
3396
|
+
const totalNavOffset = `calc(${navWidth} + 20px)`;
|
|
3397
|
+
const backdrop = useBackdropContext();
|
|
3398
|
+
const log = useLogger(`Nav ${(_b = props.id) !== null && _b !== void 0 ? _b : '?'}`, (_c = props.__debug) !== null && _c !== void 0 ? _c : false);
|
|
3399
|
+
const slideMs = (_d = props.slideMs) !== null && _d !== void 0 ? _d : theme.timings.nav.slideMs;
|
|
3400
|
+
const slideRight = keyframes `
|
|
3401
|
+
0% {
|
|
3402
|
+
transform: translateX(0);
|
|
3403
|
+
}
|
|
3404
|
+
|
|
3405
|
+
100% {
|
|
3406
|
+
transform: translateX(${totalNavOffset});
|
|
3407
|
+
}
|
|
3408
|
+
`;
|
|
3409
|
+
const slideLeft = keyframes `
|
|
3410
|
+
0% {
|
|
3411
|
+
transform: translateX(${totalNavOffset});
|
|
3412
|
+
}
|
|
3413
|
+
|
|
3414
|
+
100% {
|
|
3415
|
+
transform: translateX(0px);
|
|
3416
|
+
}
|
|
3417
|
+
`;
|
|
3418
|
+
const classNavShowing = css `
|
|
3419
|
+
animation: ${slideRight} ${slideMs}ms cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
|
|
3420
|
+
`;
|
|
3421
|
+
const classNavNotShowing = css `
|
|
3422
|
+
animation: ${slideLeft} ${slideMs}ms cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
|
|
3423
|
+
`;
|
|
3424
|
+
const zIndex = theme.zIndexes.nav;
|
|
3425
|
+
// the padding-top here is to offset the navs' content from the header. the shadow creeps over it.
|
|
3426
|
+
const navStyles = css `
|
|
3427
|
+
label: Nav;
|
|
3428
|
+
position: fixed;
|
|
3429
|
+
top: 0;
|
|
3430
|
+
left: calc(${totalNavOffset} * -1);
|
|
3431
|
+
bottom: 0;
|
|
3432
|
+
background-color: ${theme.colors.nav};
|
|
3433
|
+
color: ${theme.colors.navFont};
|
|
3434
|
+
width: ${navWidth};
|
|
3435
|
+
min-width: ${navWidth};
|
|
3436
|
+
box-shadow: 4px 2px 12px 6px rgba(0, 0, 0, 0.2);
|
|
3437
|
+
z-index: ${zIndex};
|
|
3438
|
+
overflow-y: auto;
|
|
3439
|
+
.omniLink, .omniLink:active, .omniLink:focus, .omniLink:visited {
|
|
3440
|
+
color: ${theme.colors.navFont};
|
|
3441
|
+
}
|
|
3442
|
+
padding-top:0;
|
|
3443
|
+
`;
|
|
3444
|
+
React.useEffect(() => {
|
|
3445
|
+
if (!backdrop.showing) {
|
|
3446
|
+
props.toggle(false);
|
|
3447
|
+
}
|
|
3448
|
+
}, [backdrop.showing]);
|
|
3449
|
+
useBooleanChanged((current, previous) => {
|
|
3450
|
+
var _a;
|
|
3451
|
+
log('show changed', `${previous !== null && previous !== void 0 ? previous : 'undefined'} > ${current}`);
|
|
3452
|
+
backdrop.setShow(current, { key: (_a = props.id) !== null && _a !== void 0 ? _a : 'Nav', zIndex });
|
|
3453
|
+
if (!props.show && props.onCloseFocusId) {
|
|
3454
|
+
const focusId = props.onCloseFocusId;
|
|
3455
|
+
setTimeout(() => {
|
|
3456
|
+
var _a;
|
|
3457
|
+
(_a = document.getElementById(focusId)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
3458
|
+
}, 0);
|
|
3459
|
+
}
|
|
3460
|
+
}, props.show);
|
|
3461
|
+
React.useLayoutEffect(() => {
|
|
3462
|
+
if (nav && nav.current) {
|
|
3463
|
+
if (props.show) {
|
|
3464
|
+
if (!nav.current.classList.contains(classNavShowing)) {
|
|
3465
|
+
nav.current.classList.add(classNavShowing);
|
|
3466
|
+
setTimeout(() => {
|
|
3467
|
+
var _a;
|
|
3468
|
+
(_a = document.getElementById(props.focusContentId)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
3469
|
+
}, slideMs + 1);
|
|
3470
|
+
}
|
|
3471
|
+
}
|
|
3472
|
+
else {
|
|
3473
|
+
if (nav.current.classList.contains(classNavShowing)) {
|
|
3474
|
+
nav.current.classList.remove(classNavShowing);
|
|
3475
|
+
nav.current.classList.add(classNavNotShowing);
|
|
3476
|
+
setTimeout(() => {
|
|
3477
|
+
if (nav && nav.current) {
|
|
3478
|
+
nav.current.classList.remove(classNavNotShowing);
|
|
3479
|
+
}
|
|
3480
|
+
}, slideMs);
|
|
3481
|
+
}
|
|
3482
|
+
}
|
|
3483
|
+
}
|
|
3484
|
+
});
|
|
3485
|
+
return (React.createElement("nav", { role: "dialog", "aria-modal": "true", "aria-label": props.ariaLabel, ref: nav, className: cx('nav', navStyles, props.className), onKeyDown: e => {
|
|
3486
|
+
if (e.code === 'Escape') {
|
|
3487
|
+
props.toggle(false);
|
|
3488
|
+
}
|
|
3489
|
+
} },
|
|
3490
|
+
React.createElement(TabLocker, { className: css({ height: '100%' }) }, props.children)));
|
|
3491
|
+
};
|
|
3492
|
+
|
|
3493
|
+
const roundPxPadding = '4px';
|
|
3494
|
+
const Picker = (props) => {
|
|
3495
|
+
const { value, options, onValueChange, readOnly, round, controlAlign, wrapperClassName, iconClassName, error, optionClassName } = props, selectProps = __rest(props
|
|
3496
|
+
// if we put numbers in, we expect them out
|
|
3497
|
+
, ["value", "options", "onValueChange", "readOnly", "round", "controlAlign", "wrapperClassName", "iconClassName", "error", "optionClassName"]);
|
|
3498
|
+
// if we put numbers in, we expect them out
|
|
3499
|
+
let isNumber = false;
|
|
3500
|
+
if (options && options.length) {
|
|
3501
|
+
const testOption = options[0];
|
|
3502
|
+
if (typeof testOption === 'object') {
|
|
3503
|
+
isNumber = typeof testOption.id === 'number';
|
|
3359
3504
|
}
|
|
3360
3505
|
else {
|
|
3361
3506
|
isNumber = typeof testOption === 'number';
|
|
@@ -3363,6 +3508,7 @@ const Picker = (props) => {
|
|
|
3363
3508
|
}
|
|
3364
3509
|
const theme = useThemeSafely();
|
|
3365
3510
|
const selectStyles = css({
|
|
3511
|
+
label: 'Picker',
|
|
3366
3512
|
// fix the arrow so browser all look the same
|
|
3367
3513
|
appearance: 'none',
|
|
3368
3514
|
paddingLeft: theme.controls.padding,
|
|
@@ -3406,8 +3552,7 @@ const Picker = (props) => {
|
|
|
3406
3552
|
const select = (React.createElement("select", Object.assign({}, selectProps, { tabIndex: readOnly ? -1 : selectProps.tabIndex, className: cx('picker', selectStyles, props.className), value: value, onKeyDown: e => {
|
|
3407
3553
|
var _a;
|
|
3408
3554
|
if (readOnly) {
|
|
3409
|
-
if (e.
|
|
3410
|
-
//TAB
|
|
3555
|
+
if (e.code === 'Tab') {
|
|
3411
3556
|
return;
|
|
3412
3557
|
}
|
|
3413
3558
|
e.preventDefault();
|
|
@@ -3448,7 +3593,7 @@ const Picker = (props) => {
|
|
|
3448
3593
|
val = o;
|
|
3449
3594
|
label = o;
|
|
3450
3595
|
}
|
|
3451
|
-
return React.createElement("option", { key: val, value: val }, label);
|
|
3596
|
+
return React.createElement("option", { key: val, value: val, className: optionClassName }, label);
|
|
3452
3597
|
})));
|
|
3453
3598
|
return (React.createElement("span", { className: cx(css({
|
|
3454
3599
|
label: 'PickerWrapper',
|
|
@@ -3924,6 +4069,118 @@ class ItemPager {
|
|
|
3924
4069
|
}
|
|
3925
4070
|
}
|
|
3926
4071
|
|
|
4072
|
+
const MultiPicker = (props) => {
|
|
4073
|
+
const { value: values, options, onValueChange, readOnly, controlAlign, wrapperClassName, error, optionClassName } = props, selectProps = __rest(props
|
|
4074
|
+
// if we put numbers in, we expect them out
|
|
4075
|
+
, ["value", "options", "onValueChange", "readOnly", "controlAlign", "wrapperClassName", "error", "optionClassName"]);
|
|
4076
|
+
// if we put numbers in, we expect them out
|
|
4077
|
+
let isNumber = false;
|
|
4078
|
+
if (options && options.length) {
|
|
4079
|
+
const testOption = options[0];
|
|
4080
|
+
if (typeof testOption === 'object') {
|
|
4081
|
+
isNumber = typeof testOption.id === 'number';
|
|
4082
|
+
}
|
|
4083
|
+
else {
|
|
4084
|
+
isNumber = typeof testOption === 'number';
|
|
4085
|
+
}
|
|
4086
|
+
}
|
|
4087
|
+
const theme = useThemeSafely();
|
|
4088
|
+
const selectStyles = css({
|
|
4089
|
+
label: 'MultiPicker',
|
|
4090
|
+
padding: theme.controls.padding,
|
|
4091
|
+
minHeight: theme.controls.height,
|
|
4092
|
+
backgroundColor: theme.colors.bg,
|
|
4093
|
+
color: theme.colors.font,
|
|
4094
|
+
fontSize: theme.controls.fontSize,
|
|
4095
|
+
width: '100%',
|
|
4096
|
+
border: theme.controls.border,
|
|
4097
|
+
borderRadius: theme.controls.borderRadius || 0, /* safari fix */
|
|
4098
|
+
transition: theme.controls.transition,
|
|
4099
|
+
'&:disabled': {
|
|
4100
|
+
color: theme.colors.font,
|
|
4101
|
+
opacity: 1,
|
|
4102
|
+
backgroundColor: theme.colors.disabled,
|
|
4103
|
+
cursor: 'not-allowed'
|
|
4104
|
+
},
|
|
4105
|
+
'&:focus': {
|
|
4106
|
+
outline: 'none',
|
|
4107
|
+
boxShadow: theme.controls.focusOutlineShadow
|
|
4108
|
+
}
|
|
4109
|
+
}, error && {
|
|
4110
|
+
borderColor: theme.colors.required,
|
|
4111
|
+
':focus': {
|
|
4112
|
+
boxShadow: theme.controls.focusOutlineRequiredShadow
|
|
4113
|
+
}
|
|
4114
|
+
}, readOnly && {
|
|
4115
|
+
backgroundColor: 'transparent !important',
|
|
4116
|
+
backgroundImage: 'unset',
|
|
4117
|
+
border: 'none',
|
|
4118
|
+
'&:focus': {
|
|
4119
|
+
outline: 'none',
|
|
4120
|
+
boxShadow: 'none'
|
|
4121
|
+
}
|
|
4122
|
+
});
|
|
4123
|
+
const select = (React.createElement("select", Object.assign({}, selectProps, { multiple: true, tabIndex: readOnly ? -1 : selectProps.tabIndex, className: cx(selectStyles, props.className), value: values.map(v => v.toString()), onKeyDown: e => {
|
|
4124
|
+
var _a;
|
|
4125
|
+
if (readOnly) {
|
|
4126
|
+
if (e.code === 'Tab') {
|
|
4127
|
+
return;
|
|
4128
|
+
}
|
|
4129
|
+
e.preventDefault();
|
|
4130
|
+
e.stopPropagation();
|
|
4131
|
+
}
|
|
4132
|
+
else {
|
|
4133
|
+
(_a = selectProps.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(selectProps, e);
|
|
4134
|
+
}
|
|
4135
|
+
}, onMouseDown: e => {
|
|
4136
|
+
var _a;
|
|
4137
|
+
if (readOnly) {
|
|
4138
|
+
e.preventDefault();
|
|
4139
|
+
e.stopPropagation();
|
|
4140
|
+
}
|
|
4141
|
+
else {
|
|
4142
|
+
(_a = selectProps.onMouseDown) === null || _a === void 0 ? void 0 : _a.call(selectProps, e);
|
|
4143
|
+
}
|
|
4144
|
+
}, onChange: e => {
|
|
4145
|
+
var _a;
|
|
4146
|
+
const values = Array.from(e.target.selectedOptions).map(o => {
|
|
4147
|
+
let val = o.value;
|
|
4148
|
+
if (isNumber) {
|
|
4149
|
+
val = parseInt(val, 10);
|
|
4150
|
+
if (isNaN(val)) {
|
|
4151
|
+
val = '';
|
|
4152
|
+
}
|
|
4153
|
+
}
|
|
4154
|
+
return val;
|
|
4155
|
+
});
|
|
4156
|
+
onValueChange(values);
|
|
4157
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
4158
|
+
} }), (options || []).map(o => {
|
|
4159
|
+
var _a;
|
|
4160
|
+
let val;
|
|
4161
|
+
let label;
|
|
4162
|
+
if (typeof o === 'object') {
|
|
4163
|
+
val = o.id;
|
|
4164
|
+
label = (_a = o.name) !== null && _a !== void 0 ? _a : o.id;
|
|
4165
|
+
}
|
|
4166
|
+
else {
|
|
4167
|
+
val = o;
|
|
4168
|
+
label = o;
|
|
4169
|
+
}
|
|
4170
|
+
return React.createElement("option", { key: val, value: val, className: optionClassName }, label);
|
|
4171
|
+
})));
|
|
4172
|
+
return (React.createElement("span", { className: cx(css({
|
|
4173
|
+
label: 'MultiPickerWrapper',
|
|
4174
|
+
position: 'relative',
|
|
4175
|
+
display: 'inline-block',
|
|
4176
|
+
width: '100%',
|
|
4177
|
+
}), wrapperClassName) },
|
|
4178
|
+
React.createElement("div", { className: css({
|
|
4179
|
+
position: 'relative'
|
|
4180
|
+
}) }, select),
|
|
4181
|
+
(error || controlAlign) && React.createElement(InputErrorDisplay, { error: error })));
|
|
4182
|
+
};
|
|
4183
|
+
|
|
3927
4184
|
const ProgressBar = (props) => {
|
|
3928
4185
|
var _a;
|
|
3929
4186
|
const bar = React.useRef(null);
|
|
@@ -4002,9 +4259,9 @@ const useWaiting = (func) => {
|
|
|
4002
4259
|
};
|
|
4003
4260
|
|
|
4004
4261
|
const SearchBox = React.forwardRef((props, ref) => {
|
|
4005
|
-
const { wrapperClassName, buttonClassName, inputWrapperClassName, inputClassName, onSubmit, noForm, noSubmitWhenEmpty, onClear } = props, inputProps = __rest(props, ["wrapperClassName", "buttonClassName", "inputWrapperClassName", "inputClassName", "onSubmit", "noForm", "noSubmitWhenEmpty", "onClear"]);
|
|
4262
|
+
const { wrapperClassName, buttonClassName, inputWrapperClassName, inputClassName, onSubmit, noForm, noSubmitWhenEmpty, onClear, searchButtonAriaLabel, clearButtonAriaLabel } = props, inputProps = __rest(props, ["wrapperClassName", "buttonClassName", "inputWrapperClassName", "inputClassName", "onSubmit", "noForm", "noSubmitWhenEmpty", "onClear", "searchButtonAriaLabel", "clearButtonAriaLabel"]);
|
|
4263
|
+
const searchBoxMarkerClass = 'searchBoxInput';
|
|
4006
4264
|
const [waiting, handleSubmit] = useWaiting(async () => {
|
|
4007
|
-
var _a, _b;
|
|
4008
4265
|
if (noForm) {
|
|
4009
4266
|
return;
|
|
4010
4267
|
}
|
|
@@ -4014,12 +4271,17 @@ const SearchBox = React.forwardRef((props, ref) => {
|
|
|
4014
4271
|
if ((noSubmitWhenEmpty !== null && noSubmitWhenEmpty !== void 0 ? noSubmitWhenEmpty : true) && !props.value) {
|
|
4015
4272
|
return;
|
|
4016
4273
|
}
|
|
4017
|
-
// the active element
|
|
4274
|
+
// the active element should be the input. if the submit action changes props.value it will
|
|
4018
4275
|
// be ignored due to Inputs focused handling.
|
|
4019
|
-
|
|
4020
|
-
|
|
4276
|
+
const focusElement = document.activeElement;
|
|
4277
|
+
if (focusElement && focusElement.classList.contains(searchBoxMarkerClass)) {
|
|
4278
|
+
focusElement.blur();
|
|
4021
4279
|
}
|
|
4022
|
-
return onSubmit()
|
|
4280
|
+
return onSubmit().then(() => {
|
|
4281
|
+
if (focusElement) {
|
|
4282
|
+
focusElement.focus();
|
|
4283
|
+
}
|
|
4284
|
+
});
|
|
4023
4285
|
});
|
|
4024
4286
|
const theme = useThemeSafely();
|
|
4025
4287
|
const buttonStyles = cx(css({
|
|
@@ -4028,10 +4290,10 @@ const SearchBox = React.forwardRef((props, ref) => {
|
|
|
4028
4290
|
}), buttonClassName);
|
|
4029
4291
|
let clearButton;
|
|
4030
4292
|
if (onClear && !!props.value) {
|
|
4031
|
-
clearButton = (React.createElement(Button, { onClick: onClear, tabIndex: -1, disabled: waiting, className: buttonStyles, variant: "icon", small: true },
|
|
4293
|
+
clearButton = (React.createElement(Button, { "aria-label": clearButtonAriaLabel, onClick: onClear, tabIndex: -1, disabled: waiting, className: buttonStyles, variant: "icon", small: true },
|
|
4032
4294
|
React.createElement(Icon, { id: "clear" })));
|
|
4033
4295
|
}
|
|
4034
|
-
const saveButton = (React.createElement(Button, { tabIndex: -1, disabled: waiting, readOnly: !props.onSubmit, type: "submit", className: buttonStyles, variant: "icon", small: true },
|
|
4296
|
+
const saveButton = (React.createElement(Button, { "aria-label": searchButtonAriaLabel, tabIndex: -1, disabled: waiting, readOnly: !props.onSubmit, type: "submit", className: buttonStyles, variant: "icon", small: true },
|
|
4035
4297
|
React.createElement(Icon, { id: waiting ? 'waiting' : 'search', spin: waiting })));
|
|
4036
4298
|
const rightControls = clearButton ? React.createElement(React.Fragment, null,
|
|
4037
4299
|
clearButton,
|
|
@@ -4042,16 +4304,56 @@ const SearchBox = React.forwardRef((props, ref) => {
|
|
|
4042
4304
|
paddingRight: `calc(${theme.controls.height} + ${theme.controls.heightSmall})`
|
|
4043
4305
|
});
|
|
4044
4306
|
}
|
|
4045
|
-
const input = (React.createElement(TextInput, Object.assign({}, inputProps, { ref: ref, wrapperClassName: inputWrapperClassName, className: cx(clearButtonInputStyles, inputClassName), rightControl: rightControls })));
|
|
4307
|
+
const input = (React.createElement(TextInput, Object.assign({}, inputProps, { ref: ref, wrapperClassName: inputWrapperClassName, className: cx(searchBoxMarkerClass, clearButtonInputStyles, inputClassName), rightControl: rightControls })));
|
|
4046
4308
|
const searchBoxWrapperStyles = cx(css({
|
|
4047
4309
|
label: 'SearchBox'
|
|
4048
4310
|
}), wrapperClassName);
|
|
4049
4311
|
if (!noForm) {
|
|
4050
|
-
return (React.createElement(Form, { role: "search", className: searchBoxWrapperStyles, onSubmit: handleSubmit
|
|
4312
|
+
return (React.createElement(Form, { role: "search", className: searchBoxWrapperStyles, onSubmit: handleSubmit, onKeyDown: e => {
|
|
4313
|
+
if (e.code === 'Escape' && onClear) {
|
|
4314
|
+
e.stopPropagation();
|
|
4315
|
+
e.preventDefault();
|
|
4316
|
+
// the active element should be the input. if the clear action changes props.value it will
|
|
4317
|
+
// be ignored due to Inputs focused handling.
|
|
4318
|
+
const focusElement = document.activeElement;
|
|
4319
|
+
if (focusElement && focusElement.classList.contains(searchBoxMarkerClass)) {
|
|
4320
|
+
focusElement.blur();
|
|
4321
|
+
}
|
|
4322
|
+
onClear();
|
|
4323
|
+
if (focusElement) {
|
|
4324
|
+
setTimeout(() => {
|
|
4325
|
+
focusElement.focus();
|
|
4326
|
+
}, 0);
|
|
4327
|
+
}
|
|
4328
|
+
}
|
|
4329
|
+
} }, input));
|
|
4051
4330
|
}
|
|
4052
4331
|
return (React.createElement("div", { className: searchBoxWrapperStyles }, input));
|
|
4053
4332
|
});
|
|
4054
4333
|
|
|
4334
|
+
/** Converts an enum to an array of entities with id and name. The enum can be an integer or string enum.*/
|
|
4335
|
+
const enumToEntities = (enumObj) => {
|
|
4336
|
+
const entities = [];
|
|
4337
|
+
for (const key in enumObj) {
|
|
4338
|
+
if (isNaN(parseInt(key, 10))) {
|
|
4339
|
+
entities.push({
|
|
4340
|
+
id: enumObj[key],
|
|
4341
|
+
name: key
|
|
4342
|
+
});
|
|
4343
|
+
}
|
|
4344
|
+
}
|
|
4345
|
+
return entities;
|
|
4346
|
+
};
|
|
4347
|
+
|
|
4348
|
+
/** Displays the value in American dollars. */
|
|
4349
|
+
const getCurrencyDisplay = (value, isCents, denomination = '$') => {
|
|
4350
|
+
let actualValue = value || 0;
|
|
4351
|
+
if (isCents) {
|
|
4352
|
+
actualValue /= 100;
|
|
4353
|
+
}
|
|
4354
|
+
return `${denomination}${actualValue.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
4355
|
+
};
|
|
4356
|
+
|
|
4055
4357
|
const GlobalStyles = () => {
|
|
4056
4358
|
const theme = useThemeSafely();
|
|
4057
4359
|
injectGlobal({
|
|
@@ -4080,699 +4382,37 @@ const GlobalStyles = () => {
|
|
|
4080
4382
|
return null;
|
|
4081
4383
|
};
|
|
4082
4384
|
|
|
4083
|
-
|
|
4084
|
-
From https://fireship.io/snippets/use-media-query-hook/.
|
|
4085
|
-
Tried using https://www.npmjs.com/package/react-media, but it cause Webpack build issues.
|
|
4086
|
-
*/
|
|
4087
|
-
/** React wrapper around window resizing and window.matchMedia.
|
|
4088
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia
|
|
4089
|
-
*/
|
|
4090
|
-
const useMediaQuery = (query) => {
|
|
4091
|
-
const [matches, setMatches] = useState(window.matchMedia(query).matches);
|
|
4092
|
-
useEffect(() => {
|
|
4093
|
-
const media = window.matchMedia(query);
|
|
4094
|
-
if (media.matches !== matches) {
|
|
4095
|
-
setMatches(media.matches);
|
|
4096
|
-
}
|
|
4097
|
-
const listener = () => setMatches(media.matches);
|
|
4098
|
-
window.addEventListener("resize", listener);
|
|
4099
|
-
return () => window.removeEventListener("resize", listener);
|
|
4100
|
-
}, [matches, query]);
|
|
4101
|
-
return matches;
|
|
4102
|
-
};
|
|
4385
|
+
var decimal=["decimal","décimale"];var place=["lugar","lieu"];var places=["lugares","lieux"];var file=["archivo","fichier"];var selected=["seleccionado","choisi"];var Upload=["Subir","Télécharger"];var Clear=["Cerrar","Fermer"];var Showing=["Mostrando","Affichage de"];var of=["de","sur"];var results=["resultados","résultats"];var Page=["Página","Page"];var Limit=["Límite","Limite"];var Sort=["Ordenar","Trier"];var January=["Enero","Janvier"];var February=["Febrero","Février"];var March=["Marzo","Mars"];var April=["Abril","Avril"];var May=["Mayo","Mai"];var June=["Junio","Juin"];var July=["Julio","Juillet"];var August=["Agosto","Août"];var September=["Septiembre","Septembre"];var October=["Octubre","Octobre"];var November=["Noviembre","Novembre"];var December=["Diciembre","Décembre"];var Sun=["Dom","Dim"];var Mon=["Lun","Lun"];var Tue=["Mar","Mar"];var Wed=["Mié","Mer"];var Thu=["Jue","Jeu"];var Fri=["Vie","Ven"];var Sat=["Sáb","Sam"];var OK=["Aceptar","Accepter"];var Cancel=["Cancelar","Annuler"];var strings = {"Required.":["Requerido.","Requis."],"Must be at least":["Debe ser al menos","Doit être au moins"],"characters in length.":["caracteres de longitud.","caractères de longueur."],"Must be an integer.":["Debe ser un número entero.","Doit être un entier."],"Limited to":["Limitado a","Limité à"],decimal:decimal,place:place,places:places,"Must be greater than or equal to":["Debe ser mayor o igual a","Doit être supérieur ou égal à"],"Must be less than or equal to":["Debe ser menor o igual a","Doit être inférieur ou égal à"],"Invalid email.":["Correo electrónico no válido.","Email invalide."],"Invalid URL.":["URL no válida.","URL non valide."],"Click or drag and drop files.":["Haga clic o arrastre y suelte archivos.","Cliquez ou faites glisser et déposez les fichiers."],file:file,selected:selected,"Upload failed.":["Error en la carga.","Le téléchargement a échoué."],Upload:Upload,"Upload successful.":["Carga exitosa","Téléchargement réussi."],"Invalid files":["Archivos no válidos","Fichiers invalides"],"Max file size exceeded":["Se ha excedido el tamaño máximo de archivo","La taille maximale du fichier a été dépassée"],"Error":["Error","Erreur"],Clear:Clear,Showing:Showing,of:of,results:results,"No Results":["No Hay Resultados","Aucun Résultat"],Page:Page,Limit:Limit,Sort:Sort,January:January,February:February,March:March,April:April,May:May,June:June,July:July,August:August,September:September,October:October,November:November,December:December,Sun:Sun,Mon:Mon,Tue:Tue,Wed:Wed,Thu:Thu,Fri:Fri,Sat:Sat,OK:OK,Cancel:Cancel,"Copied!":["¡Copiado!","Copié!"],"Copy to clipboard":["Copiar al portapapeles","Copier dans le presse-papier"]};
|
|
4103
4386
|
|
|
4104
|
-
const
|
|
4387
|
+
const LocalizationProvider = (p) => {
|
|
4105
4388
|
var _a;
|
|
4106
|
-
const
|
|
4107
|
-
const
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
const [, forceUpdate] = useState(Date.now());
|
|
4114
|
-
useEffect(() => {
|
|
4115
|
-
if (p.value !== currentValue.current) {
|
|
4116
|
-
currentValue.current = p.value;
|
|
4117
|
-
forceUpdate(Date.now());
|
|
4118
|
-
}
|
|
4119
|
-
}, [p.value]);
|
|
4120
|
-
return (React__default.createElement("div", { ref: sliderContainer, className: cx(css({
|
|
4121
|
-
label: 'Slider',
|
|
4122
|
-
width: '100%',
|
|
4123
|
-
height,
|
|
4124
|
-
}), p.className) },
|
|
4125
|
-
React__default.createElement(ReactSlider, { ariaLabel: p.ariaLabel, step: p.step, min: p.min, max: p.max, value: p.value, onAfterChange: (value) => {
|
|
4126
|
-
p.onChange(value);
|
|
4127
|
-
}, onChange: p.onUpdate || p.showValue ? (value) => {
|
|
4128
|
-
var _a;
|
|
4129
|
-
currentValue.current = value;
|
|
4130
|
-
(_a = p.onUpdate) === null || _a === void 0 ? void 0 : _a.call(p, value);
|
|
4131
|
-
} : undefined, renderTrack: (props) => {
|
|
4132
|
-
const { className } = props, rest = __rest(props, ["className"]);
|
|
4133
|
-
return (React__default.createElement("div", Object.assign({ className: cx(className, p.trackClassName, css({
|
|
4134
|
-
display: 'flex',
|
|
4135
|
-
alignItems: 'center',
|
|
4136
|
-
height: sliderHandleSize
|
|
4137
|
-
})) }, rest),
|
|
4138
|
-
React__default.createElement("div", { className: css({
|
|
4139
|
-
backgroundColor: theme.colors.secondary,
|
|
4140
|
-
height: `calc(${sliderHandleSize} / 4)`,
|
|
4141
|
-
borderRadius: theme.controls.roundRadius,
|
|
4142
|
-
width: '100%'
|
|
4143
|
-
}, p.innerTrackClassName && rest.key === 'track-1' && Array.isArray(p.value) ? p.innerTrackClassName : undefined) })));
|
|
4144
|
-
}, renderThumb: (props, state) => {
|
|
4145
|
-
var _a;
|
|
4146
|
-
const { className } = props, rest = __rest(props, ["className"]);
|
|
4147
|
-
let specificThumbStyles;
|
|
4148
|
-
if (p.handle1ClassName && props.key === 'thumb-0') {
|
|
4149
|
-
specificThumbStyles = p.handle1ClassName;
|
|
4389
|
+
const log = useLogger('LocalizationProvider', (_a = p.__debug) !== null && _a !== void 0 ? _a : false);
|
|
4390
|
+
const stringsDb = strings;
|
|
4391
|
+
return (React__default.createElement(LocalizationContext.Provider, { value: {
|
|
4392
|
+
language: p.language,
|
|
4393
|
+
getText: (text) => {
|
|
4394
|
+
if (!text) {
|
|
4395
|
+
return '';
|
|
4150
4396
|
}
|
|
4151
|
-
|
|
4152
|
-
|
|
4397
|
+
if (!isNaN(parseInt(text))) {
|
|
4398
|
+
return text;
|
|
4153
4399
|
}
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
},
|
|
4169
|
-
'&:hover': {
|
|
4170
|
-
filter: theme.controls.hoverBrightness
|
|
4171
|
-
}
|
|
4172
|
-
}), specificThumbStyles, p.handleClassName, css({
|
|
4173
|
-
width: sliderHandleSize,
|
|
4174
|
-
height: sliderHandleSize,
|
|
4175
|
-
})) }, rest, { tabIndex: (_a = p.tabIndex) !== null && _a !== void 0 ? _a : 0 }), p.showValue && (React__default.createElement(HandleText, { sliderHandleSize: sliderHandleSize, className: p.sliderTextClassName, index: state.index, parentElement: sliderContainer.current, value: Array.isArray(currentValue.current) ? currentValue.current[state.index] : currentValue.current, renderValue: p.renderValue, renderValueWidth: p.renderValueWidth }))));
|
|
4176
|
-
} })));
|
|
4177
|
-
};
|
|
4178
|
-
const rectsCollideX = (r1, r2) => {
|
|
4179
|
-
if (r1.left >= r2.left && r1.left <= r2.right) {
|
|
4180
|
-
return true;
|
|
4181
|
-
}
|
|
4182
|
-
if (r1.right >= r2.left && r1.right <= r2.right) {
|
|
4183
|
-
return true;
|
|
4184
|
-
}
|
|
4185
|
-
return false;
|
|
4186
|
-
};
|
|
4187
|
-
const HandleText = (p) => {
|
|
4188
|
-
var _a, _b, _c;
|
|
4189
|
-
const displayValue = (_b = (_a = p.renderValue) === null || _a === void 0 ? void 0 : _a.call(p, p.value)) !== null && _b !== void 0 ? _b : p.value;
|
|
4190
|
-
const renderValueWidth = (_c = p.renderValueWidth) !== null && _c !== void 0 ? _c : p.sliderHandleSize;
|
|
4191
|
-
const renderValueLeft = useMemo(() => {
|
|
4192
|
-
return `calc(${renderValueWidth} * 0.5 * -1 + (${p.sliderHandleSize} * 0.5))`;
|
|
4193
|
-
}, [p.renderValueWidth, p.sliderHandleSize]);
|
|
4194
|
-
const [flipText, setFlipText] = useState(false);
|
|
4195
|
-
const offset = '2px';
|
|
4196
|
-
useEffect(() => {
|
|
4197
|
-
// this needs to fire on every render due to the other handle also moving.
|
|
4198
|
-
var _a, _b;
|
|
4199
|
-
if (p.index === 1) {
|
|
4200
|
-
// only do this for the max/right-most handle
|
|
4201
|
-
const [r1, r2] = Array.from((_b = (_a = p.parentElement) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.slider-handle').values()) !== null && _b !== void 0 ? _b : []).map(e => e.getBoundingClientRect());
|
|
4202
|
-
if (r1 && r2) {
|
|
4203
|
-
setFlipText(rectsCollideX(r1, r2));
|
|
4400
|
+
const wordArray = stringsDb[text];
|
|
4401
|
+
if (!wordArray) {
|
|
4402
|
+
log(`No localization data exists for "${text}".`);
|
|
4403
|
+
}
|
|
4404
|
+
if (p.language === StyleGuideLanguage.English) {
|
|
4405
|
+
return text;
|
|
4406
|
+
}
|
|
4407
|
+
const languageIndex = p.language - 1;
|
|
4408
|
+
const translation = wordArray === null || wordArray === void 0 ? void 0 : wordArray[languageIndex];
|
|
4409
|
+
if (translation) {
|
|
4410
|
+
return translation;
|
|
4411
|
+
}
|
|
4412
|
+
log(`No ${StyleGuideLanguage[p.language]} translations exist for "${text}".`);
|
|
4413
|
+
return text;
|
|
4204
4414
|
}
|
|
4205
|
-
}
|
|
4206
|
-
});
|
|
4207
|
-
return (React__default.createElement(Text, { ellipsis: true, className: cx('slider-handle', css({
|
|
4208
|
-
width: renderValueWidth,
|
|
4209
|
-
left: renderValueLeft,
|
|
4210
|
-
top: flipText ? undefined : `calc(${p.sliderHandleSize} + ${offset})`,
|
|
4211
|
-
bottom: flipText ? `calc(${p.sliderHandleSize} + ${offset})` : undefined,
|
|
4212
|
-
position: 'absolute',
|
|
4213
|
-
overflow: 'hidden',
|
|
4214
|
-
}), p.className), tag: "div", align: "center" }, displayValue));
|
|
4215
|
-
};
|
|
4216
|
-
|
|
4217
|
-
const TabHeader = (p) => {
|
|
4218
|
-
var _a, _b;
|
|
4219
|
-
const [tabIndex, setTabIndex] = React.useState((_a = p.startingIndex) !== null && _a !== void 0 ? _a : 0);
|
|
4220
|
-
const [tabsChanging, setTabsChanging] = React.useState(false);
|
|
4221
|
-
const theme = useThemeSafely();
|
|
4222
|
-
const variant = (_b = p.variant) !== null && _b !== void 0 ? _b : 'tab';
|
|
4223
|
-
const menuStyles = css({
|
|
4224
|
-
display: 'flex',
|
|
4225
|
-
gap: theme.controls.gap,
|
|
4226
|
-
listStyleType: 'none',
|
|
4227
|
-
margin: 0,
|
|
4228
|
-
padding: 0,
|
|
4229
|
-
flexWrap: variant === 'button' ? 'wrap' : 'nowrap'
|
|
4230
|
-
}, variant === 'button' && {
|
|
4231
|
-
borderBottom: theme.controls.border,
|
|
4232
|
-
paddingBottom: '1rem'
|
|
4233
|
-
});
|
|
4234
|
-
function onTabSelect(index, tabId, focusAfter) {
|
|
4235
|
-
const onChange = () => {
|
|
4236
|
-
var _a;
|
|
4237
|
-
setTabIndex(index);
|
|
4238
|
-
(_a = p.onTabChanged) === null || _a === void 0 ? void 0 : _a.call(p, index);
|
|
4239
|
-
if (focusAfter) {
|
|
4240
|
-
setTimeout(() => {
|
|
4241
|
-
var _a;
|
|
4242
|
-
(_a = document.getElementById(tabId)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
4243
|
-
}, 0);
|
|
4244
|
-
}
|
|
4245
|
-
};
|
|
4246
|
-
if (p.onBeforeTabChanged) {
|
|
4247
|
-
setTabsChanging(true);
|
|
4248
|
-
p.onBeforeTabChanged(index)
|
|
4249
|
-
.then(() => {
|
|
4250
|
-
onChange();
|
|
4251
|
-
})
|
|
4252
|
-
.catch(() => {
|
|
4253
|
-
/* do nothing */
|
|
4254
|
-
})
|
|
4255
|
-
.finally(() => {
|
|
4256
|
-
setTabsChanging(false);
|
|
4257
|
-
});
|
|
4258
|
-
}
|
|
4259
|
-
else {
|
|
4260
|
-
onChange();
|
|
4261
|
-
}
|
|
4262
|
-
}
|
|
4263
|
-
return (React.createElement("div", { className: "tabHeader" },
|
|
4264
|
-
React.createElement("ul", { role: 'tablist', "aria-label": p.ariaLabel, className: cx(menuStyles, p.containerClassName) }, p.tabs.map((tab, index) => {
|
|
4265
|
-
var _a, _b;
|
|
4266
|
-
const active = index === tabIndex;
|
|
4267
|
-
let tabStyles;
|
|
4268
|
-
let buttonStyles;
|
|
4269
|
-
let buttonVariant;
|
|
4270
|
-
if (variant === 'tab') {
|
|
4271
|
-
tabStyles = css({
|
|
4272
|
-
paddingLeft: '1rem',
|
|
4273
|
-
paddingRight: '1rem',
|
|
4274
|
-
backgroundColor: theme.colors.bg,
|
|
4275
|
-
zIndex: 1,
|
|
4276
|
-
}, active && {
|
|
4277
|
-
border: theme.controls.border,
|
|
4278
|
-
borderRadius: theme.controls.borderRadius,
|
|
4279
|
-
borderBottomLeftRadius: 0,
|
|
4280
|
-
borderBottomRightRadius: 0,
|
|
4281
|
-
borderBottom: 'none',
|
|
4282
|
-
zIndex: 3,
|
|
4283
|
-
});
|
|
4284
|
-
buttonVariant = 'link';
|
|
4285
|
-
buttonStyles = css({
|
|
4286
|
-
maxWidth: (_a = p.maxTabWidth) !== null && _a !== void 0 ? _a : '10rem',
|
|
4287
|
-
overflow: 'hidden'
|
|
4288
|
-
});
|
|
4289
|
-
}
|
|
4290
|
-
else {
|
|
4291
|
-
buttonVariant = active ? 'primary' : undefined;
|
|
4292
|
-
buttonStyles = css({
|
|
4293
|
-
paddingLeft: '1rem',
|
|
4294
|
-
paddingRight: '1rem',
|
|
4295
|
-
maxWidth: (_b = p.maxTabWidth) !== null && _b !== void 0 ? _b : '10rem',
|
|
4296
|
-
overflow: 'hidden',
|
|
4297
|
-
});
|
|
4298
|
-
}
|
|
4299
|
-
let title = tab.title;
|
|
4300
|
-
let buttonContent;
|
|
4301
|
-
if (typeof tab.name === 'string') {
|
|
4302
|
-
title !== null && title !== void 0 ? title : (title = tab.name);
|
|
4303
|
-
buttonContent = React.createElement(Text, { tag: "div", align: "center", ellipsis: true }, tab.name);
|
|
4304
|
-
}
|
|
4305
|
-
else {
|
|
4306
|
-
buttonContent = tab.name;
|
|
4307
|
-
}
|
|
4308
|
-
const tabId = getTabHeaderTabId(p.id, index);
|
|
4309
|
-
return (React.createElement("li", { key: index, className: cx(tabStyles, p.tabClassName) },
|
|
4310
|
-
React.createElement(Button, { id: tabId, tabIndex: active ? 0 : -1, role: "tab", "aria-controls": p.ariaControlsId, "aria-selected": active, disabled: tabsChanging, className: buttonStyles, variant: buttonVariant, title: title, readOnly: active, onClick: () => {
|
|
4311
|
-
onTabSelect(index, tabId, false);
|
|
4312
|
-
}, onKeyDown: e => {
|
|
4313
|
-
e.stopPropagation();
|
|
4314
|
-
let newIndex = index;
|
|
4315
|
-
if (e.code === 'ArrowLeft') {
|
|
4316
|
-
if (index === 0) {
|
|
4317
|
-
newIndex = p.tabs.length - 1;
|
|
4318
|
-
}
|
|
4319
|
-
else {
|
|
4320
|
-
newIndex = index - 1;
|
|
4321
|
-
}
|
|
4322
|
-
}
|
|
4323
|
-
else if (e.code === 'ArrowRight') {
|
|
4324
|
-
if (index === p.tabs.length - 1) {
|
|
4325
|
-
newIndex = 0;
|
|
4326
|
-
}
|
|
4327
|
-
else {
|
|
4328
|
-
newIndex = index + 1;
|
|
4329
|
-
}
|
|
4330
|
-
}
|
|
4331
|
-
if (newIndex !== index) {
|
|
4332
|
-
onTabSelect(newIndex, getTabHeaderTabId(p.id, newIndex), true);
|
|
4333
|
-
}
|
|
4334
|
-
} }, buttonContent)));
|
|
4335
|
-
})),
|
|
4336
|
-
variant === 'tab' && (React.createElement("div", { className: cx(css({
|
|
4337
|
-
label: 'TabHeaderDivider',
|
|
4338
|
-
borderBottom: theme.controls.border,
|
|
4339
|
-
marginTop: `calc(${theme.controls.borderWidth} * -1)`,
|
|
4340
|
-
zIndex: 2,
|
|
4341
|
-
position: 'relative'
|
|
4342
|
-
}), p.tabHeaderDividerClassName) }))));
|
|
4343
|
-
};
|
|
4344
|
-
function getTabHeaderTabId(tabHeaderId, tabIndex) {
|
|
4345
|
-
return `${tabHeaderId}_tab_${tabIndex}`;
|
|
4346
|
-
}
|
|
4347
|
-
|
|
4348
|
-
const Table = (props) => {
|
|
4349
|
-
const theme = useThemeSafely();
|
|
4350
|
-
const tableStyles = css `
|
|
4351
|
-
label: Table;
|
|
4352
|
-
width: 100%;
|
|
4353
|
-
border-collapse: collapse;
|
|
4354
|
-
${props.noCellBorder && `
|
|
4355
|
-
.table__td {
|
|
4356
|
-
border-left: none;
|
|
4357
|
-
border-right: none;
|
|
4358
|
-
}
|
|
4359
|
-
`}
|
|
4360
|
-
${props.altRows && `
|
|
4361
|
-
.table__tr:nth-of-type(even) {
|
|
4362
|
-
background-color: ${theme.colors.lightBg};
|
|
4363
|
-
}
|
|
4364
|
-
`}
|
|
4365
|
-
`;
|
|
4366
|
-
const wrapperStyles = css `
|
|
4367
|
-
label: TableScrollWrapper;
|
|
4368
|
-
width:100%;
|
|
4369
|
-
overflow-y: auto;
|
|
4370
|
-
padding:0 1px; //fixes always showing of the table scroller
|
|
4371
|
-
`;
|
|
4372
|
-
return (React.createElement("div", { className: cx(wrapperStyles, props.wrapperClassName) },
|
|
4373
|
-
React.createElement("table", { className: cx(tableStyles, props.className) },
|
|
4374
|
-
props.caption && React.createElement("caption", { className: css({
|
|
4375
|
-
fontWeight: 'bold',
|
|
4376
|
-
padding: theme.controls.padding
|
|
4377
|
-
}) }, props.caption),
|
|
4378
|
-
props.children)));
|
|
4379
|
-
};
|
|
4380
|
-
const Tr = (props) => {
|
|
4381
|
-
return (React.createElement("tr", { className: cx('table__tr', props.className) }, props.children));
|
|
4382
|
-
};
|
|
4383
|
-
const Th = (props) => {
|
|
4384
|
-
var _a;
|
|
4385
|
-
let style = props.style;
|
|
4386
|
-
if (props.width) {
|
|
4387
|
-
if (style) {
|
|
4388
|
-
style = Object.assign(Object.assign({}, style), { width: props.width, minWidth: props.width });
|
|
4389
|
-
}
|
|
4390
|
-
else {
|
|
4391
|
-
style = { width: props.width, minWidth: props.width };
|
|
4392
|
-
}
|
|
4393
|
-
}
|
|
4394
|
-
const theme = useThemeSafely();
|
|
4395
|
-
const thStyles = css `
|
|
4396
|
-
border-bottom: ${theme.controls.border};
|
|
4397
|
-
padding: ${theme.controls.padding};
|
|
4398
|
-
font-weight: bold;
|
|
4399
|
-
text-align: ${(_a = props.align) !== null && _a !== void 0 ? _a : 'center'};
|
|
4400
|
-
> .button {
|
|
4401
|
-
font-weight: bold;
|
|
4402
|
-
}
|
|
4403
|
-
`;
|
|
4404
|
-
return (React.createElement("th", { className: cx(thStyles, props.className), style: style }, props.children));
|
|
4405
|
-
};
|
|
4406
|
-
const Td = (props) => {
|
|
4407
|
-
var _a;
|
|
4408
|
-
const theme = useThemeSafely();
|
|
4409
|
-
const tdStyles = css `
|
|
4410
|
-
border: ${theme.controls.border};
|
|
4411
|
-
padding: ${theme.controls.padding};
|
|
4412
|
-
vertical-align: middle;
|
|
4413
|
-
text-align: ${(_a = props.align) !== null && _a !== void 0 ? _a : 'center'};
|
|
4414
|
-
`;
|
|
4415
|
-
return (React.createElement("td", { colSpan: props.colSpan, style: props.style, className: cx('table__td', tdStyles, props.className) }, props.children));
|
|
4416
|
-
};
|
|
4417
|
-
|
|
4418
|
-
const TdCurrency = (props) => {
|
|
4419
|
-
let actualValue = props.value || 0;
|
|
4420
|
-
if (props.cents) {
|
|
4421
|
-
actualValue = actualValue / 100;
|
|
4422
|
-
}
|
|
4423
|
-
const displayValue = actualValue.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
4424
|
-
return (React.createElement(Td, { align: "right" },
|
|
4425
|
-
"$",
|
|
4426
|
-
displayValue));
|
|
4427
|
-
};
|
|
4428
|
-
|
|
4429
|
-
const TdNumber = (props) => {
|
|
4430
|
-
return React.createElement(Td, { align: "right" }, props.value || props.value === 0 ? props.value.toLocaleString() : '');
|
|
4431
|
-
};
|
|
4432
|
-
|
|
4433
|
-
const ThSort = (props) => {
|
|
4434
|
-
let iconId = '';
|
|
4435
|
-
if (props.direction) {
|
|
4436
|
-
if (props.direction === 'asc') {
|
|
4437
|
-
iconId = 'sortAsc';
|
|
4438
|
-
}
|
|
4439
|
-
else {
|
|
4440
|
-
iconId = 'sortDesc';
|
|
4441
|
-
}
|
|
4442
|
-
}
|
|
4443
|
-
let rightContentSpecialJustify = 'center';
|
|
4444
|
-
switch (props.align) {
|
|
4445
|
-
case 'left':
|
|
4446
|
-
rightContentSpecialJustify = 'flex-start';
|
|
4447
|
-
break;
|
|
4448
|
-
case 'right':
|
|
4449
|
-
rightContentSpecialJustify = 'flex-end';
|
|
4450
|
-
break;
|
|
4451
|
-
}
|
|
4452
|
-
return (React.createElement(Th, { align: props.align, style: props.style, width: props.width },
|
|
4453
|
-
React.createElement("div", { className: props.rightContent && css({
|
|
4454
|
-
display: 'flex',
|
|
4455
|
-
alignItems: 'center',
|
|
4456
|
-
justifyContent: rightContentSpecialJustify,
|
|
4457
|
-
gap: '0.5rem'
|
|
4458
|
-
}) },
|
|
4459
|
-
React.createElement(Button, { onClick: props.onClick, variant: "link" },
|
|
4460
|
-
props.text,
|
|
4461
|
-
iconId && React.createElement(Icon, { className: css({
|
|
4462
|
-
marginLeft: '0.5rem'
|
|
4463
|
-
}), id: iconId })),
|
|
4464
|
-
props.rightContent)));
|
|
4465
|
-
};
|
|
4466
|
-
|
|
4467
|
-
const defaultMaxLength = 200;
|
|
4468
|
-
const defaultRows = 10;
|
|
4469
|
-
const TextArea = React.forwardRef((props, ref) => {
|
|
4470
|
-
var _a, _b;
|
|
4471
|
-
const [localValue, setLocalValue] = React.useState(props.value);
|
|
4472
|
-
const inputRef = (ref !== null && ref !== void 0 ? ref : React.useRef(null));
|
|
4473
|
-
const [validationError, updateErrorMessage] = useInputValidationMessage(inputRef, props);
|
|
4474
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4475
|
-
const { onValueChange, customError, reportValueOnError, showErrorDisplay, allowUpdateOnFocus } = props, nativeProps = __rest(props, ["onValueChange", "customError", "reportValueOnError", "showErrorDisplay", "allowUpdateOnFocus"]);
|
|
4476
|
-
const theme = useThemeSafely();
|
|
4477
|
-
React.useEffect(() => {
|
|
4478
|
-
updateErrorMessage();
|
|
4479
|
-
}, []);
|
|
4480
|
-
useIgnoreMount(() => {
|
|
4481
|
-
var _a;
|
|
4482
|
-
if ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.checkValidity()) {
|
|
4483
|
-
onValueChange(localValue);
|
|
4484
|
-
}
|
|
4485
|
-
else {
|
|
4486
|
-
if (reportValueOnError) {
|
|
4487
|
-
onValueChange(localValue);
|
|
4488
|
-
}
|
|
4489
|
-
else {
|
|
4490
|
-
onValueChange(undefined);
|
|
4491
|
-
}
|
|
4492
|
-
}
|
|
4493
|
-
updateErrorMessage();
|
|
4494
|
-
}, [localValue]);
|
|
4495
|
-
useIgnoreMount(() => {
|
|
4496
|
-
if (allowUpdateOnFocus || document.activeElement !== inputRef.current) {
|
|
4497
|
-
setLocalValue(props.value);
|
|
4498
|
-
}
|
|
4499
|
-
updateErrorMessage();
|
|
4500
|
-
}, [props.value]);
|
|
4501
|
-
const styles = css({
|
|
4502
|
-
backgroundColor: theme.colors.bg,
|
|
4503
|
-
maxWidth: '100%',
|
|
4504
|
-
minHeight: theme.controls.height,
|
|
4505
|
-
fontFamily: theme.fonts.family,
|
|
4506
|
-
fontSize: theme.fonts.size,
|
|
4507
|
-
width: '100%',
|
|
4508
|
-
border: theme.controls.border,
|
|
4509
|
-
borderRadius: theme.controls.borderRadius,
|
|
4510
|
-
color: theme.colors.font,
|
|
4511
|
-
paddingTop: '0.75rem',
|
|
4512
|
-
paddingLeft: theme.controls.padding,
|
|
4513
|
-
paddingRight: theme.controls.padding,
|
|
4514
|
-
height: 'auto',
|
|
4515
|
-
transition: theme.controls.transition,
|
|
4516
|
-
':focus': {
|
|
4517
|
-
outline: 'none',
|
|
4518
|
-
boxShadow: theme.controls.focusOutlineShadow
|
|
4519
|
-
},
|
|
4520
|
-
':disabled': {
|
|
4521
|
-
backgroundColor: theme.colors.disabled,
|
|
4522
|
-
cursor: 'not-allowed'
|
|
4523
|
-
},
|
|
4524
|
-
':invalid': {
|
|
4525
|
-
borderColor: theme.colors.required,
|
|
4526
|
-
':focus': {
|
|
4527
|
-
boxShadow: theme.controls.focusOutlineRequiredShadow
|
|
4528
|
-
}
|
|
4529
|
-
},
|
|
4530
|
-
}, props.readOnly && {
|
|
4531
|
-
backgroundColor: 'transparent',
|
|
4532
|
-
cursor: 'default',
|
|
4533
|
-
border: 'none',
|
|
4534
|
-
':focus': {
|
|
4535
|
-
outline: 'none',
|
|
4536
|
-
boxShadow: 'none'
|
|
4537
|
-
}
|
|
4538
|
-
});
|
|
4539
|
-
return (React.createElement("span", { className: css({
|
|
4540
|
-
display: 'inline-block',
|
|
4541
|
-
width: '100%'
|
|
4542
|
-
}) },
|
|
4543
|
-
React.createElement("textarea", Object.assign({}, nativeProps, { className: cx(styles, props.className), autoComplete: (_a = props.autoComplete) !== null && _a !== void 0 ? _a : 'off', tabIndex: props.readOnly ? -1 : props.tabIndex, maxLength: props.maxLength || defaultMaxLength, rows: (_b = props.rows) !== null && _b !== void 0 ? _b : defaultRows, ref: inputRef, value: localValue !== null && localValue !== void 0 ? localValue : '', onChange: e => {
|
|
4544
|
-
var _a;
|
|
4545
|
-
setLocalValue(e.target.value || undefined);
|
|
4546
|
-
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
4547
|
-
}, onBlur: e => {
|
|
4548
|
-
var _a;
|
|
4549
|
-
if (!props.noTrim) {
|
|
4550
|
-
setLocalValue(currentValue => {
|
|
4551
|
-
return currentValue === null || currentValue === void 0 ? void 0 : currentValue.trim();
|
|
4552
|
-
});
|
|
4553
|
-
}
|
|
4554
|
-
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
4555
|
-
} })),
|
|
4556
|
-
(showErrorDisplay !== null && showErrorDisplay !== void 0 ? showErrorDisplay : true) && React.createElement(InputErrorDisplay, { error: validationError })));
|
|
4557
|
-
});
|
|
4558
|
-
|
|
4559
|
-
const ToggleButton = React.forwardRef((props, ref) => {
|
|
4560
|
-
const { checked, checkedChildren, uncheckedChildren, checkedVariant, checkedClassName, checkedStyle, checkedIcon, uncheckedIcon } = props, buttonProps = __rest(props, ["checked", "checkedChildren", "uncheckedChildren", "checkedVariant", "checkedClassName", "checkedStyle", "checkedIcon", "uncheckedIcon"]);
|
|
4561
|
-
let children;
|
|
4562
|
-
if (checked) {
|
|
4563
|
-
children = checkedChildren;
|
|
4564
|
-
}
|
|
4565
|
-
else {
|
|
4566
|
-
children = uncheckedChildren;
|
|
4567
|
-
}
|
|
4568
|
-
return (React.createElement(Button, Object.assign({}, buttonProps, { ref: ref, className: cx('toggleButton', checked && 'toggleButton--checked', props.className, checked && checkedClassName), rightIcon: checked ? checkedIcon : uncheckedIcon, variant: checked ? checkedVariant : props.variant, style: checked ? checkedStyle : props.style }), children));
|
|
4569
|
-
});
|
|
4570
|
-
|
|
4571
|
-
const ToggleButtonGroup = (props) => {
|
|
4572
|
-
const theme = useThemeSafely();
|
|
4573
|
-
const groupStyles = css `
|
|
4574
|
-
display: flex;
|
|
4575
|
-
box-shadow: ${theme.controls.buttonBoxShadow};
|
|
4576
|
-
border-radius: ${theme.controls.borderRadius};
|
|
4577
|
-
${props.round && `
|
|
4578
|
-
border-radius: ${theme.controls.roundRadius};
|
|
4579
|
-
`}
|
|
4580
|
-
`;
|
|
4581
|
-
const buttonStyles = css `
|
|
4582
|
-
flex-grow:1;
|
|
4583
|
-
box-shadow: none;
|
|
4584
|
-
&:nth-of-type(1n+2){
|
|
4585
|
-
margin-left: -1px;
|
|
4586
|
-
}
|
|
4587
|
-
border-radius: 0;
|
|
4588
|
-
&:first-of-type{
|
|
4589
|
-
border-top-left-radius: ${theme.controls.borderRadius};
|
|
4590
|
-
border-bottom-left-radius: ${theme.controls.borderRadius};
|
|
4591
|
-
}
|
|
4592
|
-
&:last-child {
|
|
4593
|
-
border-top-right-radius: ${theme.controls.borderRadius};
|
|
4594
|
-
border-bottom-right-radius: ${theme.controls.borderRadius};
|
|
4595
|
-
}
|
|
4596
|
-
${props.round && `
|
|
4597
|
-
&:first-of-type{
|
|
4598
|
-
border-top-left-radius: ${theme.controls.roundRadius};
|
|
4599
|
-
border-bottom-left-radius: ${theme.controls.roundRadius};
|
|
4600
|
-
padding-left: 1rem;
|
|
4601
|
-
}
|
|
4602
|
-
&:last-child {
|
|
4603
|
-
border-top-right-radius: ${theme.controls.roundRadius};
|
|
4604
|
-
border-bottom-right-radius: ${theme.controls.roundRadius};
|
|
4605
|
-
padding-right: 1rem;
|
|
4606
|
-
}
|
|
4607
|
-
`}
|
|
4608
|
-
`;
|
|
4609
|
-
return (React.createElement("div", { className: cx('toggleButtonGroup', groupStyles, props.className) }, props.options.map(o => {
|
|
4610
|
-
const active = o.id === props.value;
|
|
4611
|
-
return React.createElement(Button, { style: props.width ? { width: props.width } : undefined, small: props.small, rightIcon: o.rightIcon, key: o.id, tabIndex: active ? -1 : 0, className: cx(css `
|
|
4612
|
-
${buttonStyles}
|
|
4613
|
-
${active && `
|
|
4614
|
-
background-color: ${theme.colors.font};
|
|
4615
|
-
color: ${theme.colors.bg};
|
|
4616
|
-
cursor: default;
|
|
4617
|
-
&:hover:not(:disabled) {
|
|
4618
|
-
filter: none;
|
|
4619
|
-
}
|
|
4620
|
-
&:focus {
|
|
4621
|
-
outline: none;
|
|
4622
|
-
box-shadow: none;
|
|
4623
|
-
}
|
|
4624
|
-
`}
|
|
4625
|
-
`, active ? o.activeClass : undefined), disabled: props.disabled, enforceMinWidth: props.enforceMinWidth, onClick: () => {
|
|
4626
|
-
if (active) {
|
|
4627
|
-
return;
|
|
4628
|
-
}
|
|
4629
|
-
props.onChange(o.id);
|
|
4630
|
-
} }, o.name);
|
|
4631
|
-
})));
|
|
4632
|
-
};
|
|
4633
|
-
|
|
4634
|
-
const TogglePasswordInput = React.forwardRef((props, ref) => {
|
|
4635
|
-
const { onVisibilityChanged } = props, inputProps = __rest(props, ["onVisibilityChanged"]);
|
|
4636
|
-
const [show, setShow] = React.useState(false);
|
|
4637
|
-
useIgnoreMount(() => {
|
|
4638
|
-
onVisibilityChanged === null || onVisibilityChanged === void 0 ? void 0 : onVisibilityChanged(show);
|
|
4639
|
-
}, [show]);
|
|
4640
|
-
return (React.createElement(TextInput, Object.assign({}, inputProps, { ref: ref, type: show ? 'text' : 'password', rightControl: (React.createElement(Button, { small: true, style: {
|
|
4641
|
-
// small button is required here due to the icon pushing outside the boundries of the
|
|
4642
|
-
// parent textbox. increasing the font size here to fill the small button.
|
|
4643
|
-
fontSize: '1rem'
|
|
4644
|
-
}, variant: "icon", onClick: () => {
|
|
4645
|
-
setShow(previous => !previous);
|
|
4646
|
-
} },
|
|
4647
|
-
React.createElement(Icon, { id: show ? 'show' : 'hide' }))) })));
|
|
4648
|
-
});
|
|
4649
|
-
|
|
4650
|
-
let clearTimerId = undefined;
|
|
4651
|
-
/** Allows for status notificaiton methods for screen readers.
|
|
4652
|
-
* This hook does not have any dependencies, so it can be used in projects that don't important anything else from the style_guide. */
|
|
4653
|
-
function useAriaLiveRegion() {
|
|
4654
|
-
const id = 'MknAriaLiveRegion';
|
|
4655
|
-
if (!document.getElementById(id)) {
|
|
4656
|
-
const div = document.createElement('div');
|
|
4657
|
-
div.id = id;
|
|
4658
|
-
// different sources cannot decide if this is needed.
|
|
4659
|
-
// "Can work for status messages, but aria-live="polite" + text is usually simpler and more reliable for loading."
|
|
4660
|
-
div.role = 'status';
|
|
4661
|
-
div.ariaLive = 'polite';
|
|
4662
|
-
div.ariaAtomic = 'true';
|
|
4663
|
-
div.style.position = 'absolute';
|
|
4664
|
-
div.style.width = '1px';
|
|
4665
|
-
div.style.height = '1px';
|
|
4666
|
-
div.style.padding = '0px';
|
|
4667
|
-
div.style.margin = '-1px';
|
|
4668
|
-
div.style.overflow = 'hidden';
|
|
4669
|
-
div.style.whiteSpace = 'nowrap';
|
|
4670
|
-
document.body.prepend(div);
|
|
4671
|
-
}
|
|
4672
|
-
const clearNotification = () => {
|
|
4673
|
-
if (clearTimerId) {
|
|
4674
|
-
clearTimeout(clearTimerId);
|
|
4675
|
-
}
|
|
4676
|
-
const element = document.getElementById(id);
|
|
4677
|
-
if (!element) {
|
|
4678
|
-
return;
|
|
4679
|
-
}
|
|
4680
|
-
element.textContent = '';
|
|
4681
|
-
};
|
|
4682
|
-
return {
|
|
4683
|
-
/**
|
|
4684
|
-
* @param message - The text to be read by the screen reader.
|
|
4685
|
-
* @param clearTimeoutMs - Milliseconds to wait before the message is cleared. Defaults to `2000`.
|
|
4686
|
-
*/
|
|
4687
|
-
notify: (message, clearTimoutMs) => {
|
|
4688
|
-
if (clearTimerId) {
|
|
4689
|
-
clearTimeout(clearTimerId);
|
|
4690
|
-
}
|
|
4691
|
-
const element = document.getElementById(id);
|
|
4692
|
-
if (!element) {
|
|
4693
|
-
return;
|
|
4694
|
-
}
|
|
4695
|
-
element.textContent = message;
|
|
4696
|
-
clearTimerId = setTimeout(() => {
|
|
4697
|
-
// this is considered a good practice. if you leave text here, some screen readers will read it out randomly as you navigate around the page.
|
|
4698
|
-
clearNotification();
|
|
4699
|
-
}, clearTimoutMs !== null && clearTimoutMs !== void 0 ? clearTimoutMs : 2000);
|
|
4700
|
-
},
|
|
4701
|
-
clearNotification
|
|
4702
|
-
};
|
|
4703
|
-
}
|
|
4704
|
-
|
|
4705
|
-
const WaitingIndicator = (p) => {
|
|
4706
|
-
var _a, _b, _c;
|
|
4707
|
-
const [show, setShow] = useState(p.show);
|
|
4708
|
-
const hideTimer = useRef(0);
|
|
4709
|
-
const lastShowStatus = useRef(false);
|
|
4710
|
-
const log = useLogger(`WaitingIndicator ${(_a = p.id) !== null && _a !== void 0 ? _a : '?'}`, (_b = p.__debug) !== null && _b !== void 0 ? _b : false);
|
|
4711
|
-
const { notify, clearNotification } = useAriaLiveRegion();
|
|
4712
|
-
if (p.__debug) {
|
|
4713
|
-
useEffect(() => {
|
|
4714
|
-
log('mounted');
|
|
4715
|
-
return () => {
|
|
4716
|
-
log('unmounted');
|
|
4717
|
-
};
|
|
4718
|
-
}, []);
|
|
4719
|
-
}
|
|
4720
|
-
useEffect(() => {
|
|
4721
|
-
log('show changed', p.show);
|
|
4722
|
-
// we need to store the 'last props' since props.show will be captured locally and the incorrect
|
|
4723
|
-
// value will display in the timeout below.
|
|
4724
|
-
log('storing lastShowStatus', p.show);
|
|
4725
|
-
lastShowStatus.current = p.show;
|
|
4726
|
-
if (p.show) {
|
|
4727
|
-
log('setShow', true);
|
|
4728
|
-
setShow(true);
|
|
4729
|
-
if (p.minShowTimeMs) {
|
|
4730
|
-
log('staring hideTimer', 'timout in ms:', p.minShowTimeMs);
|
|
4731
|
-
hideTimer.current = window.setTimeout(() => {
|
|
4732
|
-
log('hideTimer complete', 'clearing hideTimer');
|
|
4733
|
-
window.clearTimeout(hideTimer.current);
|
|
4734
|
-
hideTimer.current = 0;
|
|
4735
|
-
// this check is necessary since the show status may have updated again to true.
|
|
4736
|
-
// if so, ignore this timeout since we're already past the min time and we're still
|
|
4737
|
-
// showing the component.
|
|
4738
|
-
if (!lastShowStatus.current) {
|
|
4739
|
-
log('setShow', false);
|
|
4740
|
-
setShow(false);
|
|
4741
|
-
}
|
|
4742
|
-
else {
|
|
4743
|
-
log('ignoring hideTimer handler due to hideTimer ticking');
|
|
4744
|
-
}
|
|
4745
|
-
}, p.minShowTimeMs);
|
|
4746
|
-
}
|
|
4747
|
-
}
|
|
4748
|
-
else {
|
|
4749
|
-
// ignore hiding the component since the min timer is running.
|
|
4750
|
-
if (!hideTimer.current) {
|
|
4751
|
-
log('setShow', false);
|
|
4752
|
-
setShow(false);
|
|
4753
|
-
}
|
|
4754
|
-
else {
|
|
4755
|
-
log('ignoring show change due to hideTimer ticking');
|
|
4756
|
-
}
|
|
4757
|
-
}
|
|
4758
|
-
if (p.show) {
|
|
4759
|
-
// set to a very long time so the hiding of the waiting indicator clears it.
|
|
4760
|
-
notify('Loading content.', 60000);
|
|
4761
|
-
}
|
|
4762
|
-
else {
|
|
4763
|
-
clearNotification();
|
|
4764
|
-
}
|
|
4765
|
-
}, [p.show]);
|
|
4766
|
-
const id = (_c = p.id) !== null && _c !== void 0 ? _c : 'MknWaitingIndicator';
|
|
4767
|
-
return (React__default.createElement(Modal, { id: id, __debug: p.__debug, __asWaitingIndicator: true, heading: '', onClose: () => {
|
|
4768
|
-
/* noop */
|
|
4769
|
-
}, className: "waitingIndicator", show: show },
|
|
4770
|
-
React__default.createElement("div", { className: css({
|
|
4771
|
-
color: 'white',
|
|
4772
|
-
fontSize: '3rem',
|
|
4773
|
-
padding: '0.7rem'
|
|
4774
|
-
}) },
|
|
4775
|
-
React__default.createElement(Icon, { id: "waiting", spin: true }))));
|
|
4415
|
+
} }, p.children));
|
|
4776
4416
|
};
|
|
4777
4417
|
|
|
4778
4418
|
/*
|
|
@@ -5071,284 +4711,778 @@ summary {
|
|
|
5071
4711
|
`;
|
|
5072
4712
|
return null;
|
|
5073
4713
|
};
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
const
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
4714
|
+
|
|
4715
|
+
const Table = (props) => {
|
|
4716
|
+
const theme = useThemeSafely();
|
|
4717
|
+
const tableStyles = css `
|
|
4718
|
+
label: Table;
|
|
4719
|
+
width: 100%;
|
|
4720
|
+
border-collapse: collapse;
|
|
4721
|
+
${props.noCellBorder && `
|
|
4722
|
+
.table__td {
|
|
4723
|
+
border-left: none;
|
|
4724
|
+
border-right: none;
|
|
4725
|
+
}
|
|
4726
|
+
`}
|
|
4727
|
+
${props.altRows && `
|
|
4728
|
+
.table__tr:nth-of-type(even) {
|
|
4729
|
+
background-color: ${theme.colors.lightBg};
|
|
4730
|
+
}
|
|
4731
|
+
`}
|
|
4732
|
+
`;
|
|
4733
|
+
const wrapperStyles = css `
|
|
4734
|
+
label: TableScrollWrapper;
|
|
4735
|
+
width:100%;
|
|
4736
|
+
overflow-y: auto;
|
|
4737
|
+
padding:0 1px; //fixes always showing of the table scroller
|
|
4738
|
+
`;
|
|
4739
|
+
return (React.createElement("div", { className: cx(wrapperStyles, props.wrapperClassName) },
|
|
4740
|
+
React.createElement("table", { className: cx(tableStyles, props.className) },
|
|
4741
|
+
props.caption && React.createElement("caption", { className: css({
|
|
4742
|
+
fontWeight: 'bold',
|
|
4743
|
+
padding: theme.controls.padding
|
|
4744
|
+
}) }, props.caption),
|
|
4745
|
+
props.children)));
|
|
4746
|
+
};
|
|
4747
|
+
const Tr = (props) => {
|
|
4748
|
+
return (React.createElement("tr", { className: cx('table__tr', props.className) }, props.children));
|
|
4749
|
+
};
|
|
4750
|
+
const Th = (props) => {
|
|
4751
|
+
var _a;
|
|
4752
|
+
let style = props.style;
|
|
4753
|
+
if (props.width) {
|
|
4754
|
+
if (style) {
|
|
4755
|
+
style = Object.assign(Object.assign({}, style), { width: props.width, minWidth: props.width });
|
|
4756
|
+
}
|
|
4757
|
+
else {
|
|
4758
|
+
style = { width: props.width, minWidth: props.width };
|
|
4759
|
+
}
|
|
4760
|
+
}
|
|
4761
|
+
const theme = useThemeSafely();
|
|
4762
|
+
const thStyles = css `
|
|
4763
|
+
border-bottom: ${theme.controls.border};
|
|
4764
|
+
padding: ${theme.controls.padding};
|
|
4765
|
+
font-weight: bold;
|
|
4766
|
+
text-align: ${(_a = props.align) !== null && _a !== void 0 ? _a : 'center'};
|
|
4767
|
+
> .button {
|
|
4768
|
+
font-weight: bold;
|
|
4769
|
+
}
|
|
4770
|
+
`;
|
|
4771
|
+
return (React.createElement("th", { className: cx(thStyles, props.className), style: style }, props.children));
|
|
4772
|
+
};
|
|
4773
|
+
const Td = (props) => {
|
|
4774
|
+
var _a;
|
|
4775
|
+
const theme = useThemeSafely();
|
|
4776
|
+
const tdStyles = css `
|
|
4777
|
+
border: ${theme.controls.border};
|
|
4778
|
+
padding: ${theme.controls.padding};
|
|
4779
|
+
vertical-align: middle;
|
|
4780
|
+
text-align: ${(_a = props.align) !== null && _a !== void 0 ? _a : 'center'};
|
|
4781
|
+
`;
|
|
4782
|
+
return (React.createElement("td", { colSpan: props.colSpan, style: props.style, className: cx('table__td', tdStyles, props.className) }, props.children));
|
|
4783
|
+
};
|
|
4784
|
+
|
|
4785
|
+
/* eslint @typescript-eslint/no-explicit-any: 0 */
|
|
4786
|
+
const ThemeRenderer = (p) => {
|
|
4787
|
+
const { backgroundColor, color } = p, theme = __rest(p, ["backgroundColor", "color"]);
|
|
4788
|
+
const flatTheme = flatten(theme);
|
|
4789
|
+
const entries = orderBy(Object.entries(flatTheme), x => x[0]);
|
|
4790
|
+
return (React.createElement(Table, { caption: (React.createElement("div", null,
|
|
4791
|
+
React.createElement(Text, { tag: "h1", align: "center" }, "Theme"),
|
|
4792
|
+
React.createElement(Text, { tag: "p", align: "center", italics: true }, "Background color applied to show colors with alpha ('rgba(X, X, X, 0.X)')"))), className: css({
|
|
4793
|
+
backgroundColor: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : '#eee7ca',
|
|
4794
|
+
color: color !== null && color !== void 0 ? color : 'black'
|
|
4795
|
+
}) },
|
|
4796
|
+
React.createElement("thead", null,
|
|
4797
|
+
React.createElement(Tr, null,
|
|
4798
|
+
React.createElement(Th, { align: "left" }, "Property"),
|
|
4799
|
+
React.createElement(Th, { align: "left" }, "Value"))),
|
|
4800
|
+
React.createElement("tbody", null, entries.map(([key, value]) => {
|
|
4801
|
+
let colorBox;
|
|
4802
|
+
if (/color/i.test(key)) {
|
|
4803
|
+
colorBox = (React.createElement("span", { className: css({
|
|
4804
|
+
display: 'block',
|
|
4805
|
+
border: '1px solid black',
|
|
4806
|
+
width: '100%',
|
|
4807
|
+
height: 24,
|
|
4808
|
+
background: value
|
|
4809
|
+
}) }));
|
|
4810
|
+
}
|
|
4811
|
+
return (React.createElement(Tr, { key: key },
|
|
4812
|
+
React.createElement(Td, { align: "left" }, key),
|
|
4813
|
+
React.createElement(Td, { align: "left" },
|
|
4814
|
+
React.createElement("div", { className: css({
|
|
4815
|
+
display: 'flex',
|
|
4816
|
+
alignItems: 'center',
|
|
4817
|
+
gap: '1rem'
|
|
4818
|
+
}) },
|
|
4819
|
+
React.createElement("span", { className: css({ flexShrink: 1 }) }, value),
|
|
4820
|
+
" ",
|
|
4821
|
+
colorBox))));
|
|
4822
|
+
}))));
|
|
4823
|
+
};
|
|
4824
|
+
const flatten = (obj, parent, path = 'theme') => {
|
|
4825
|
+
const flatObj = parent !== null && parent !== void 0 ? parent : {};
|
|
4826
|
+
for (const prop in obj) {
|
|
4827
|
+
const value = obj[prop];
|
|
4828
|
+
const fullPath = `${path}.${prop}`;
|
|
4829
|
+
if (typeof value !== 'object') {
|
|
4830
|
+
flatObj[fullPath] = value;
|
|
4831
|
+
}
|
|
4832
|
+
else {
|
|
4833
|
+
flatten(value, flatObj, fullPath);
|
|
4834
|
+
}
|
|
4835
|
+
}
|
|
4836
|
+
return flatObj;
|
|
4837
|
+
};
|
|
4838
|
+
|
|
4839
|
+
let clearTimerId = undefined;
|
|
4840
|
+
/** Allows for status notificaiton methods for screen readers.
|
|
4841
|
+
* This hook does not have any dependencies, so it can be used in projects that don't important anything else from the style_guide. */
|
|
4842
|
+
function useAriaLiveRegion() {
|
|
4843
|
+
const id = 'MknAriaLiveRegion';
|
|
4844
|
+
if (!document.getElementById(id)) {
|
|
4845
|
+
const div = document.createElement('div');
|
|
4846
|
+
div.id = id;
|
|
4847
|
+
// different sources cannot decide if this is needed.
|
|
4848
|
+
// "Can work for status messages, but aria-live="polite" + text is usually simpler and more reliable for loading."
|
|
4849
|
+
div.role = 'status';
|
|
4850
|
+
div.ariaLive = 'polite';
|
|
4851
|
+
div.ariaAtomic = 'true';
|
|
4852
|
+
div.style.position = 'absolute';
|
|
4853
|
+
div.style.width = '1px';
|
|
4854
|
+
div.style.height = '1px';
|
|
4855
|
+
div.style.padding = '0px';
|
|
4856
|
+
div.style.margin = '-1px';
|
|
4857
|
+
div.style.overflow = 'hidden';
|
|
4858
|
+
div.style.whiteSpace = 'nowrap';
|
|
4859
|
+
document.body.prepend(div);
|
|
4860
|
+
}
|
|
4861
|
+
const clearNotification = () => {
|
|
4862
|
+
if (clearTimerId) {
|
|
4863
|
+
clearTimeout(clearTimerId);
|
|
4864
|
+
}
|
|
4865
|
+
const element = document.getElementById(id);
|
|
4866
|
+
if (!element) {
|
|
4867
|
+
return;
|
|
4868
|
+
}
|
|
4869
|
+
element.textContent = '';
|
|
4870
|
+
};
|
|
4871
|
+
return {
|
|
4872
|
+
/**
|
|
4873
|
+
* @param message - The text to be read by the screen reader.
|
|
4874
|
+
* @param clearTimeoutMs - Milliseconds to wait before the message is cleared. Defaults to `2000`.
|
|
4875
|
+
*/
|
|
4876
|
+
notify: (message, clearTimoutMs) => {
|
|
4877
|
+
if (clearTimerId) {
|
|
4878
|
+
clearTimeout(clearTimerId);
|
|
4879
|
+
}
|
|
4880
|
+
const element = document.getElementById(id);
|
|
4881
|
+
if (!element) {
|
|
4882
|
+
return;
|
|
4883
|
+
}
|
|
4884
|
+
element.textContent = message;
|
|
4885
|
+
clearTimerId = setTimeout(() => {
|
|
4886
|
+
// this is considered a good practice. if you leave text here, some screen readers will read it out randomly as you navigate around the page.
|
|
4887
|
+
clearNotification();
|
|
4888
|
+
}, clearTimoutMs !== null && clearTimoutMs !== void 0 ? clearTimoutMs : 2000);
|
|
4889
|
+
},
|
|
4890
|
+
clearNotification
|
|
4891
|
+
};
|
|
4892
|
+
}
|
|
4893
|
+
|
|
4894
|
+
/*
|
|
4895
|
+
From https://fireship.io/snippets/use-media-query-hook/.
|
|
4896
|
+
Tried using https://www.npmjs.com/package/react-media, but it cause Webpack build issues.
|
|
4897
|
+
*/
|
|
4898
|
+
/** React wrapper around window resizing and window.matchMedia.
|
|
4899
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia
|
|
4900
|
+
*/
|
|
4901
|
+
const useMediaQuery = (query) => {
|
|
4902
|
+
const [matches, setMatches] = useState(window.matchMedia(query).matches);
|
|
4903
|
+
useEffect(() => {
|
|
4904
|
+
const media = window.matchMedia(query);
|
|
4905
|
+
if (media.matches !== matches) {
|
|
4906
|
+
setMatches(media.matches);
|
|
4907
|
+
}
|
|
4908
|
+
const listener = () => setMatches(media.matches);
|
|
4909
|
+
window.addEventListener("resize", listener);
|
|
4910
|
+
return () => window.removeEventListener("resize", listener);
|
|
4911
|
+
}, [matches, query]);
|
|
4912
|
+
return matches;
|
|
4913
|
+
};
|
|
4914
|
+
|
|
4915
|
+
const Slider = (p) => {
|
|
4916
|
+
var _a;
|
|
4917
|
+
const theme = useThemeSafely();
|
|
4918
|
+
const sliderContainer = useRef(null);
|
|
4919
|
+
const sliderHandleSize = (_a = p.sliderHandleSize) !== null && _a !== void 0 ? _a : theme.controls.height;
|
|
4920
|
+
const height = p.showValue ? `calc(${sliderHandleSize} + 1.5rem)` : sliderHandleSize;
|
|
4921
|
+
// we're keeping this value in a ref vs. state so the constant updates don't cause re-render.
|
|
4922
|
+
// we will have to respond to outside value changes after the fact however...
|
|
4923
|
+
const currentValue = useRef(p.value);
|
|
4924
|
+
const [, forceUpdate] = useState(Date.now());
|
|
4925
|
+
useEffect(() => {
|
|
4926
|
+
if (p.value !== currentValue.current) {
|
|
4927
|
+
currentValue.current = p.value;
|
|
4928
|
+
forceUpdate(Date.now());
|
|
4929
|
+
}
|
|
4930
|
+
}, [p.value]);
|
|
4931
|
+
return (React__default.createElement("div", { ref: sliderContainer, className: cx(css({
|
|
4932
|
+
label: 'Slider',
|
|
4933
|
+
width: '100%',
|
|
4934
|
+
height,
|
|
4935
|
+
}), p.className) },
|
|
4936
|
+
React__default.createElement(ReactSlider, { ariaLabel: p.ariaLabel, step: p.step, min: p.min, max: p.max, value: p.value, onAfterChange: (value) => {
|
|
4937
|
+
p.onChange(value);
|
|
4938
|
+
}, onChange: p.onUpdate || p.showValue ? (value) => {
|
|
4939
|
+
var _a;
|
|
4940
|
+
currentValue.current = value;
|
|
4941
|
+
(_a = p.onUpdate) === null || _a === void 0 ? void 0 : _a.call(p, value);
|
|
4942
|
+
} : undefined, renderTrack: (props) => {
|
|
4943
|
+
const { className } = props, rest = __rest(props, ["className"]);
|
|
4944
|
+
return (React__default.createElement("div", Object.assign({ className: cx(className, p.trackClassName, css({
|
|
4945
|
+
display: 'flex',
|
|
4946
|
+
alignItems: 'center',
|
|
4947
|
+
height: sliderHandleSize
|
|
4948
|
+
})) }, rest),
|
|
4949
|
+
React__default.createElement("div", { className: css({
|
|
4950
|
+
backgroundColor: theme.colors.secondary,
|
|
4951
|
+
height: `calc(${sliderHandleSize} / 4)`,
|
|
4952
|
+
borderRadius: theme.controls.roundRadius,
|
|
4953
|
+
width: '100%'
|
|
4954
|
+
}, p.innerTrackClassName && rest.key === 'track-1' && Array.isArray(p.value) ? p.innerTrackClassName : undefined) })));
|
|
4955
|
+
}, renderThumb: (props, state) => {
|
|
4956
|
+
var _a;
|
|
4957
|
+
const { className } = props, rest = __rest(props, ["className"]);
|
|
4958
|
+
let specificThumbStyles;
|
|
4959
|
+
if (p.handle1ClassName && props.key === 'thumb-0') {
|
|
4960
|
+
specificThumbStyles = p.handle1ClassName;
|
|
4961
|
+
}
|
|
4962
|
+
else if (p.handle2ClassName && props.key === 'thumb-1') {
|
|
4963
|
+
specificThumbStyles = p.handle2ClassName;
|
|
4964
|
+
}
|
|
4965
|
+
return (React__default.createElement("div", Object.assign({ className: cx(className, css({
|
|
4966
|
+
borderRadius: theme.controls.roundRadius,
|
|
4967
|
+
backgroundColor: 'white',
|
|
4968
|
+
border: theme.controls.border,
|
|
4969
|
+
cursor: 'grab',
|
|
4970
|
+
boxShadow: theme.controls.buttonBoxShadow,
|
|
4971
|
+
transition: theme.controls.transition,
|
|
4972
|
+
'&:focus': {
|
|
4973
|
+
outline: 'none',
|
|
4974
|
+
boxShadow: theme.controls.focusOutlineShadow
|
|
4975
|
+
},
|
|
4976
|
+
'&:active': {
|
|
4977
|
+
boxShadow: 'none',
|
|
4978
|
+
cursor: 'grabbing'
|
|
4979
|
+
},
|
|
4980
|
+
'&:hover': {
|
|
4981
|
+
filter: theme.controls.hoverBrightness
|
|
4982
|
+
}
|
|
4983
|
+
}), specificThumbStyles, p.handleClassName, css({
|
|
4984
|
+
width: sliderHandleSize,
|
|
4985
|
+
height: sliderHandleSize,
|
|
4986
|
+
})) }, rest, { tabIndex: (_a = p.tabIndex) !== null && _a !== void 0 ? _a : 0 }), p.showValue && (React__default.createElement(HandleText, { sliderHandleSize: sliderHandleSize, className: p.sliderTextClassName, index: state.index, parentElement: sliderContainer.current, value: Array.isArray(currentValue.current) ? currentValue.current[state.index] : currentValue.current, renderValue: p.renderValue, renderValueWidth: p.renderValueWidth }))));
|
|
4987
|
+
} })));
|
|
4988
|
+
};
|
|
4989
|
+
const rectsCollideX = (r1, r2) => {
|
|
4990
|
+
if (r1.left >= r2.left && r1.left <= r2.right) {
|
|
4991
|
+
return true;
|
|
5080
4992
|
}
|
|
5081
|
-
|
|
4993
|
+
if (r1.right >= r2.left && r1.right <= r2.right) {
|
|
4994
|
+
return true;
|
|
4995
|
+
}
|
|
4996
|
+
return false;
|
|
4997
|
+
};
|
|
4998
|
+
const HandleText = (p) => {
|
|
4999
|
+
var _a, _b, _c;
|
|
5000
|
+
const displayValue = (_b = (_a = p.renderValue) === null || _a === void 0 ? void 0 : _a.call(p, p.value)) !== null && _b !== void 0 ? _b : p.value;
|
|
5001
|
+
const renderValueWidth = (_c = p.renderValueWidth) !== null && _c !== void 0 ? _c : p.sliderHandleSize;
|
|
5002
|
+
const renderValueLeft = useMemo(() => {
|
|
5003
|
+
return `calc(${renderValueWidth} * 0.5 * -1 + (${p.sliderHandleSize} * 0.5))`;
|
|
5004
|
+
}, [p.renderValueWidth, p.sliderHandleSize]);
|
|
5005
|
+
const [flipText, setFlipText] = useState(false);
|
|
5006
|
+
const offset = '2px';
|
|
5007
|
+
useEffect(() => {
|
|
5008
|
+
// this needs to fire on every render due to the other handle also moving.
|
|
5009
|
+
var _a, _b;
|
|
5010
|
+
if (p.index === 1) {
|
|
5011
|
+
// only do this for the max/right-most handle
|
|
5012
|
+
const [r1, r2] = Array.from((_b = (_a = p.parentElement) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.slider-handle').values()) !== null && _b !== void 0 ? _b : []).map(e => e.getBoundingClientRect());
|
|
5013
|
+
if (r1 && r2) {
|
|
5014
|
+
setFlipText(rectsCollideX(r1, r2));
|
|
5015
|
+
}
|
|
5016
|
+
}
|
|
5017
|
+
});
|
|
5018
|
+
return (React__default.createElement(Text, { ellipsis: true, className: cx('slider-handle', css({
|
|
5019
|
+
width: renderValueWidth,
|
|
5020
|
+
left: renderValueLeft,
|
|
5021
|
+
top: flipText ? undefined : `calc(${p.sliderHandleSize} + ${offset})`,
|
|
5022
|
+
bottom: flipText ? `calc(${p.sliderHandleSize} + ${offset})` : undefined,
|
|
5023
|
+
position: 'absolute',
|
|
5024
|
+
overflow: 'hidden',
|
|
5025
|
+
}), p.className), tag: "div", align: "center" }, displayValue));
|
|
5082
5026
|
};
|
|
5083
5027
|
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
const
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5028
|
+
const TabHeader = (p) => {
|
|
5029
|
+
var _a, _b;
|
|
5030
|
+
const [tabIndex, setTabIndex] = React.useState((_a = p.startingIndex) !== null && _a !== void 0 ? _a : 0);
|
|
5031
|
+
const [tabsChanging, setTabsChanging] = React.useState(false);
|
|
5032
|
+
const theme = useThemeSafely();
|
|
5033
|
+
const variant = (_b = p.variant) !== null && _b !== void 0 ? _b : 'tab';
|
|
5034
|
+
const menuStyles = css({
|
|
5035
|
+
display: 'flex',
|
|
5036
|
+
gap: theme.controls.gap,
|
|
5037
|
+
listStyleType: 'none',
|
|
5038
|
+
margin: 0,
|
|
5039
|
+
padding: 0,
|
|
5040
|
+
flexWrap: variant === 'button' ? 'wrap' : 'nowrap'
|
|
5041
|
+
}, variant === 'button' && {
|
|
5042
|
+
borderBottom: theme.controls.border,
|
|
5043
|
+
paddingBottom: '1rem'
|
|
5044
|
+
});
|
|
5045
|
+
function onTabSelect(index, tabId, focusAfter) {
|
|
5046
|
+
const onChange = () => {
|
|
5047
|
+
var _a;
|
|
5048
|
+
setTabIndex(index);
|
|
5049
|
+
(_a = p.onTabChanged) === null || _a === void 0 ? void 0 : _a.call(p, index);
|
|
5050
|
+
if (focusAfter) {
|
|
5051
|
+
setTimeout(() => {
|
|
5052
|
+
var _a;
|
|
5053
|
+
(_a = document.getElementById(tabId)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
5054
|
+
}, 0);
|
|
5055
|
+
}
|
|
5056
|
+
};
|
|
5057
|
+
if (p.onBeforeTabChanged) {
|
|
5058
|
+
setTabsChanging(true);
|
|
5059
|
+
p.onBeforeTabChanged(index)
|
|
5060
|
+
.then(() => {
|
|
5061
|
+
onChange();
|
|
5062
|
+
})
|
|
5063
|
+
.catch(() => {
|
|
5064
|
+
/* do nothing */
|
|
5065
|
+
})
|
|
5066
|
+
.finally(() => {
|
|
5067
|
+
setTabsChanging(false);
|
|
5092
5068
|
});
|
|
5093
5069
|
}
|
|
5070
|
+
else {
|
|
5071
|
+
onChange();
|
|
5072
|
+
}
|
|
5073
|
+
}
|
|
5074
|
+
return (React.createElement("div", { className: "tabHeader" },
|
|
5075
|
+
React.createElement("ul", { role: 'tablist', "aria-label": p.ariaLabel, className: cx(menuStyles, p.containerClassName) }, p.tabs.map((tab, index) => {
|
|
5076
|
+
var _a, _b;
|
|
5077
|
+
const active = index === tabIndex;
|
|
5078
|
+
let tabStyles;
|
|
5079
|
+
let buttonStyles;
|
|
5080
|
+
let buttonVariant;
|
|
5081
|
+
if (variant === 'tab') {
|
|
5082
|
+
tabStyles = css({
|
|
5083
|
+
paddingLeft: '1rem',
|
|
5084
|
+
paddingRight: '1rem',
|
|
5085
|
+
backgroundColor: theme.colors.bg,
|
|
5086
|
+
zIndex: 1,
|
|
5087
|
+
}, active && {
|
|
5088
|
+
border: theme.controls.border,
|
|
5089
|
+
borderRadius: theme.controls.borderRadius,
|
|
5090
|
+
borderBottomLeftRadius: 0,
|
|
5091
|
+
borderBottomRightRadius: 0,
|
|
5092
|
+
borderBottom: 'none',
|
|
5093
|
+
zIndex: 3,
|
|
5094
|
+
});
|
|
5095
|
+
buttonVariant = 'link';
|
|
5096
|
+
buttonStyles = css({
|
|
5097
|
+
maxWidth: (_a = p.maxTabWidth) !== null && _a !== void 0 ? _a : '10rem',
|
|
5098
|
+
overflow: 'hidden'
|
|
5099
|
+
});
|
|
5100
|
+
}
|
|
5101
|
+
else {
|
|
5102
|
+
buttonVariant = active ? 'primary' : undefined;
|
|
5103
|
+
buttonStyles = css({
|
|
5104
|
+
paddingLeft: '1rem',
|
|
5105
|
+
paddingRight: '1rem',
|
|
5106
|
+
maxWidth: (_b = p.maxTabWidth) !== null && _b !== void 0 ? _b : '10rem',
|
|
5107
|
+
overflow: 'hidden',
|
|
5108
|
+
});
|
|
5109
|
+
}
|
|
5110
|
+
let title = tab.title;
|
|
5111
|
+
let buttonContent;
|
|
5112
|
+
if (typeof tab.name === 'string') {
|
|
5113
|
+
title !== null && title !== void 0 ? title : (title = tab.name);
|
|
5114
|
+
buttonContent = React.createElement(Text, { tag: "div", align: "center", ellipsis: true }, tab.name);
|
|
5115
|
+
}
|
|
5116
|
+
else {
|
|
5117
|
+
buttonContent = tab.name;
|
|
5118
|
+
}
|
|
5119
|
+
const tabId = getTabHeaderTabId(p.id, index);
|
|
5120
|
+
return (React.createElement("li", { key: index, className: cx(tabStyles, p.tabClassName) },
|
|
5121
|
+
React.createElement(Button, { id: tabId, tabIndex: active ? 0 : -1, role: "tab", "aria-controls": p.ariaControlsId, "aria-selected": active, disabled: tabsChanging, className: buttonStyles, variant: buttonVariant, title: title, readOnly: active, onClick: () => {
|
|
5122
|
+
onTabSelect(index, tabId, false);
|
|
5123
|
+
}, onKeyDown: e => {
|
|
5124
|
+
e.stopPropagation();
|
|
5125
|
+
let newIndex = index;
|
|
5126
|
+
if (e.code === 'ArrowLeft') {
|
|
5127
|
+
if (index === 0) {
|
|
5128
|
+
newIndex = p.tabs.length - 1;
|
|
5129
|
+
}
|
|
5130
|
+
else {
|
|
5131
|
+
newIndex = index - 1;
|
|
5132
|
+
}
|
|
5133
|
+
}
|
|
5134
|
+
else if (e.code === 'ArrowRight') {
|
|
5135
|
+
if (index === p.tabs.length - 1) {
|
|
5136
|
+
newIndex = 0;
|
|
5137
|
+
}
|
|
5138
|
+
else {
|
|
5139
|
+
newIndex = index + 1;
|
|
5140
|
+
}
|
|
5141
|
+
}
|
|
5142
|
+
if (newIndex !== index) {
|
|
5143
|
+
onTabSelect(newIndex, getTabHeaderTabId(p.id, newIndex), true);
|
|
5144
|
+
}
|
|
5145
|
+
} }, buttonContent)));
|
|
5146
|
+
})),
|
|
5147
|
+
variant === 'tab' && (React.createElement("div", { className: cx(css({
|
|
5148
|
+
label: 'TabHeaderDivider',
|
|
5149
|
+
borderBottom: theme.controls.border,
|
|
5150
|
+
marginTop: `calc(${theme.controls.borderWidth} * -1)`,
|
|
5151
|
+
zIndex: 2,
|
|
5152
|
+
position: 'relative'
|
|
5153
|
+
}), p.tabHeaderDividerClassName) }))));
|
|
5154
|
+
};
|
|
5155
|
+
function getTabHeaderTabId(tabHeaderId, tabIndex) {
|
|
5156
|
+
return `${tabHeaderId}_tab_${tabIndex}`;
|
|
5157
|
+
}
|
|
5158
|
+
|
|
5159
|
+
const TabContainer = (p) => {
|
|
5160
|
+
var _a;
|
|
5161
|
+
const [tabIndex, setTabIndex] = React.useState((_a = p.startingIndex) !== null && _a !== void 0 ? _a : 0);
|
|
5162
|
+
const theme = useThemeSafely();
|
|
5163
|
+
const tabPanelId = `${p.id}_tabpanel`;
|
|
5164
|
+
const tabHeaderId = `${p.id}_TabHeader`;
|
|
5165
|
+
return (React.createElement("div", { className: css({
|
|
5166
|
+
label: 'TabContainer'
|
|
5167
|
+
}) },
|
|
5168
|
+
React.createElement(TabHeader, { id: tabHeaderId, ariaControlsId: tabPanelId, ariaLabel: p.ariaLabel, tabs: p.tabs, maxTabWidth: p.maxTabWidth, variant: p.variant, containerClassName: p.tabHeaderClassName, tabClassName: p.tabClassName, tabHeaderDividerClassName: p.tabHeaderDividerClassName, startingIndex: tabIndex, onBeforeTabChanged: p.onBeforeTabChanged, onTabChanged: (newIndex) => {
|
|
5169
|
+
var _a;
|
|
5170
|
+
setTabIndex(newIndex);
|
|
5171
|
+
(_a = p.onTabChanged) === null || _a === void 0 ? void 0 : _a.call(p, newIndex);
|
|
5172
|
+
} }),
|
|
5173
|
+
React.createElement("div", { role: 'tabpanel', id: tabPanelId, "aria-labelledby": getTabHeaderTabId(tabHeaderId, tabIndex), className: cx(css({
|
|
5174
|
+
label: 'TabContainerContent',
|
|
5175
|
+
padding: '1rem',
|
|
5176
|
+
borderLeft: theme.controls.border,
|
|
5177
|
+
borderRight: theme.controls.border,
|
|
5178
|
+
borderBottom: theme.controls.border,
|
|
5179
|
+
}), p.contentClassName) }, p.tabs[tabIndex].getContent())));
|
|
5180
|
+
};
|
|
5181
|
+
|
|
5182
|
+
const TdCurrency = (props) => {
|
|
5183
|
+
let actualValue = props.value || 0;
|
|
5184
|
+
if (props.cents) {
|
|
5185
|
+
actualValue = actualValue / 100;
|
|
5186
|
+
}
|
|
5187
|
+
const displayValue = actualValue.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
5188
|
+
return (React.createElement(Td, { align: "right" },
|
|
5189
|
+
"$",
|
|
5190
|
+
displayValue));
|
|
5191
|
+
};
|
|
5192
|
+
|
|
5193
|
+
const TdNumber = (props) => {
|
|
5194
|
+
return React.createElement(Td, { align: "right" }, props.value || props.value === 0 ? props.value.toLocaleString() : '');
|
|
5195
|
+
};
|
|
5196
|
+
|
|
5197
|
+
const ThSort = (props) => {
|
|
5198
|
+
let iconId = '';
|
|
5199
|
+
if (props.direction) {
|
|
5200
|
+
if (props.direction === 'asc') {
|
|
5201
|
+
iconId = 'sortAsc';
|
|
5202
|
+
}
|
|
5203
|
+
else {
|
|
5204
|
+
iconId = 'sortDesc';
|
|
5205
|
+
}
|
|
5094
5206
|
}
|
|
5095
|
-
|
|
5207
|
+
let rightContentSpecialJustify = 'center';
|
|
5208
|
+
switch (props.align) {
|
|
5209
|
+
case 'left':
|
|
5210
|
+
rightContentSpecialJustify = 'flex-start';
|
|
5211
|
+
break;
|
|
5212
|
+
case 'right':
|
|
5213
|
+
rightContentSpecialJustify = 'flex-end';
|
|
5214
|
+
break;
|
|
5215
|
+
}
|
|
5216
|
+
return (React.createElement(Th, { align: props.align, style: props.style, width: props.width },
|
|
5217
|
+
React.createElement("div", { className: props.rightContent && css({
|
|
5218
|
+
display: 'flex',
|
|
5219
|
+
alignItems: 'center',
|
|
5220
|
+
justifyContent: rightContentSpecialJustify,
|
|
5221
|
+
gap: '0.5rem'
|
|
5222
|
+
}) },
|
|
5223
|
+
React.createElement(Button, { onClick: props.onClick, variant: "link" },
|
|
5224
|
+
props.text,
|
|
5225
|
+
iconId && React.createElement(Icon, { className: css({
|
|
5226
|
+
marginLeft: '0.5rem'
|
|
5227
|
+
}), id: iconId })),
|
|
5228
|
+
props.rightContent)));
|
|
5096
5229
|
};
|
|
5097
5230
|
|
|
5098
|
-
const
|
|
5231
|
+
const defaultMaxLength = 200;
|
|
5232
|
+
const defaultRows = 10;
|
|
5233
|
+
const TextArea = React.forwardRef((props, ref) => {
|
|
5234
|
+
var _a, _b;
|
|
5235
|
+
const [localValue, setLocalValue] = React.useState(props.value);
|
|
5236
|
+
const inputRef = (ref !== null && ref !== void 0 ? ref : React.useRef(null));
|
|
5237
|
+
const [validationError, updateErrorMessage] = useInputValidationMessage(inputRef, props);
|
|
5099
5238
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5100
|
-
const {
|
|
5239
|
+
const { onValueChange, customError, reportValueOnError, showErrorDisplay, allowUpdateOnFocus } = props, nativeProps = __rest(props, ["onValueChange", "customError", "reportValueOnError", "showErrorDisplay", "allowUpdateOnFocus"]);
|
|
5101
5240
|
const theme = useThemeSafely();
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5241
|
+
React.useEffect(() => {
|
|
5242
|
+
updateErrorMessage();
|
|
5243
|
+
}, []);
|
|
5244
|
+
useIgnoreMount(() => {
|
|
5245
|
+
var _a;
|
|
5246
|
+
if ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.checkValidity()) {
|
|
5247
|
+
onValueChange(localValue);
|
|
5248
|
+
}
|
|
5249
|
+
else {
|
|
5250
|
+
if (reportValueOnError) {
|
|
5251
|
+
onValueChange(localValue);
|
|
5113
5252
|
}
|
|
5114
5253
|
else {
|
|
5115
|
-
(
|
|
5116
|
-
}
|
|
5117
|
-
} }),
|
|
5118
|
-
React.createElement(LinkContent, Object.assign({}, props))));
|
|
5119
|
-
};
|
|
5120
|
-
|
|
5121
|
-
/* eslint @typescript-eslint/no-explicit-any: 0 */
|
|
5122
|
-
const ThemeRenderer = (p) => {
|
|
5123
|
-
const { backgroundColor, color } = p, theme = __rest(p, ["backgroundColor", "color"]);
|
|
5124
|
-
const flatTheme = flatten(theme);
|
|
5125
|
-
const entries = orderBy(Object.entries(flatTheme), x => x[0]);
|
|
5126
|
-
return (React.createElement(Table, { caption: (React.createElement("div", null,
|
|
5127
|
-
React.createElement(Text, { tag: "h1", align: "center" }, "Theme"),
|
|
5128
|
-
React.createElement(Text, { tag: "p", align: "center", italics: true }, "Background color applied to show colors with alpha ('rgba(X, X, X, 0.X)')"))), className: css({
|
|
5129
|
-
backgroundColor: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : '#eee7ca',
|
|
5130
|
-
color: color !== null && color !== void 0 ? color : 'black'
|
|
5131
|
-
}) },
|
|
5132
|
-
React.createElement("thead", null,
|
|
5133
|
-
React.createElement(Tr, null,
|
|
5134
|
-
React.createElement(Th, { align: "left" }, "Property"),
|
|
5135
|
-
React.createElement(Th, { align: "left" }, "Value"))),
|
|
5136
|
-
React.createElement("tbody", null, entries.map(([key, value]) => {
|
|
5137
|
-
let colorBox;
|
|
5138
|
-
if (/color/i.test(key)) {
|
|
5139
|
-
colorBox = (React.createElement("span", { className: css({
|
|
5140
|
-
display: 'block',
|
|
5141
|
-
border: '1px solid black',
|
|
5142
|
-
width: '100%',
|
|
5143
|
-
height: 24,
|
|
5144
|
-
background: value
|
|
5145
|
-
}) }));
|
|
5254
|
+
onValueChange(undefined);
|
|
5146
5255
|
}
|
|
5147
|
-
return (React.createElement(Tr, { key: key },
|
|
5148
|
-
React.createElement(Td, { align: "left" }, key),
|
|
5149
|
-
React.createElement(Td, { align: "left" },
|
|
5150
|
-
React.createElement("div", { className: css({
|
|
5151
|
-
display: 'flex',
|
|
5152
|
-
alignItems: 'center',
|
|
5153
|
-
gap: '1rem'
|
|
5154
|
-
}) },
|
|
5155
|
-
React.createElement("span", { className: css({ flexShrink: 1 }) }, value),
|
|
5156
|
-
" ",
|
|
5157
|
-
colorBox))));
|
|
5158
|
-
}))));
|
|
5159
|
-
};
|
|
5160
|
-
const flatten = (obj, parent, path = 'theme') => {
|
|
5161
|
-
const flatObj = parent !== null && parent !== void 0 ? parent : {};
|
|
5162
|
-
for (const prop in obj) {
|
|
5163
|
-
const value = obj[prop];
|
|
5164
|
-
const fullPath = `${path}.${prop}`;
|
|
5165
|
-
if (typeof value !== 'object') {
|
|
5166
|
-
flatObj[fullPath] = value;
|
|
5167
5256
|
}
|
|
5168
|
-
|
|
5169
|
-
|
|
5257
|
+
updateErrorMessage();
|
|
5258
|
+
}, [localValue]);
|
|
5259
|
+
useIgnoreMount(() => {
|
|
5260
|
+
if (allowUpdateOnFocus || document.activeElement !== inputRef.current) {
|
|
5261
|
+
setLocalValue(props.value);
|
|
5170
5262
|
}
|
|
5263
|
+
updateErrorMessage();
|
|
5264
|
+
}, [props.value]);
|
|
5265
|
+
const styles = css({
|
|
5266
|
+
backgroundColor: theme.colors.bg,
|
|
5267
|
+
maxWidth: '100%',
|
|
5268
|
+
minHeight: theme.controls.height,
|
|
5269
|
+
fontFamily: theme.fonts.family,
|
|
5270
|
+
fontSize: theme.fonts.size,
|
|
5271
|
+
width: '100%',
|
|
5272
|
+
border: theme.controls.border,
|
|
5273
|
+
borderRadius: theme.controls.borderRadius,
|
|
5274
|
+
color: theme.colors.font,
|
|
5275
|
+
paddingTop: '0.75rem',
|
|
5276
|
+
paddingLeft: theme.controls.padding,
|
|
5277
|
+
paddingRight: theme.controls.padding,
|
|
5278
|
+
height: 'auto',
|
|
5279
|
+
transition: theme.controls.transition,
|
|
5280
|
+
':focus': {
|
|
5281
|
+
outline: 'none',
|
|
5282
|
+
boxShadow: theme.controls.focusOutlineShadow
|
|
5283
|
+
},
|
|
5284
|
+
':disabled': {
|
|
5285
|
+
backgroundColor: theme.colors.disabled,
|
|
5286
|
+
cursor: 'not-allowed'
|
|
5287
|
+
},
|
|
5288
|
+
':invalid': {
|
|
5289
|
+
borderColor: theme.colors.required,
|
|
5290
|
+
':focus': {
|
|
5291
|
+
boxShadow: theme.controls.focusOutlineRequiredShadow
|
|
5292
|
+
}
|
|
5293
|
+
},
|
|
5294
|
+
}, props.readOnly && {
|
|
5295
|
+
backgroundColor: 'transparent',
|
|
5296
|
+
cursor: 'default',
|
|
5297
|
+
border: 'none',
|
|
5298
|
+
':focus': {
|
|
5299
|
+
outline: 'none',
|
|
5300
|
+
boxShadow: 'none'
|
|
5301
|
+
}
|
|
5302
|
+
});
|
|
5303
|
+
return (React.createElement("span", { className: css({
|
|
5304
|
+
display: 'inline-block',
|
|
5305
|
+
width: '100%'
|
|
5306
|
+
}) },
|
|
5307
|
+
React.createElement("textarea", Object.assign({}, nativeProps, { className: cx(styles, props.className), autoComplete: (_a = props.autoComplete) !== null && _a !== void 0 ? _a : 'off', tabIndex: props.readOnly ? -1 : props.tabIndex, maxLength: props.maxLength || defaultMaxLength, rows: (_b = props.rows) !== null && _b !== void 0 ? _b : defaultRows, ref: inputRef, value: localValue !== null && localValue !== void 0 ? localValue : '', onChange: e => {
|
|
5308
|
+
var _a;
|
|
5309
|
+
setLocalValue(e.target.value || undefined);
|
|
5310
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
5311
|
+
}, onBlur: e => {
|
|
5312
|
+
var _a;
|
|
5313
|
+
if (!props.noTrim) {
|
|
5314
|
+
setLocalValue(currentValue => {
|
|
5315
|
+
return currentValue === null || currentValue === void 0 ? void 0 : currentValue.trim();
|
|
5316
|
+
});
|
|
5317
|
+
}
|
|
5318
|
+
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
5319
|
+
} })),
|
|
5320
|
+
(showErrorDisplay !== null && showErrorDisplay !== void 0 ? showErrorDisplay : true) && React.createElement(InputErrorDisplay, { error: validationError })));
|
|
5321
|
+
});
|
|
5322
|
+
|
|
5323
|
+
const ToggleButton = React.forwardRef((props, ref) => {
|
|
5324
|
+
const { checked, checkedChildren, uncheckedChildren, checkedVariant, checkedClassName, checkedStyle, checkedIcon, uncheckedIcon } = props, buttonProps = __rest(props, ["checked", "checkedChildren", "uncheckedChildren", "checkedVariant", "checkedClassName", "checkedStyle", "checkedIcon", "uncheckedIcon"]);
|
|
5325
|
+
let children;
|
|
5326
|
+
if (checked) {
|
|
5327
|
+
children = checkedChildren;
|
|
5171
5328
|
}
|
|
5172
|
-
|
|
5329
|
+
else {
|
|
5330
|
+
children = uncheckedChildren;
|
|
5331
|
+
}
|
|
5332
|
+
return (React.createElement(Button, Object.assign({}, buttonProps, { ref: ref, className: cx('toggleButton', checked && 'toggleButton--checked', props.className, checked && checkedClassName), rightIcon: checked ? checkedIcon : uncheckedIcon, variant: checked ? checkedVariant : props.variant, style: checked ? checkedStyle : props.style }), children));
|
|
5333
|
+
});
|
|
5334
|
+
|
|
5335
|
+
const ToggleButtonGroup = (props) => {
|
|
5336
|
+
const theme = useThemeSafely();
|
|
5337
|
+
const groupStyles = css `
|
|
5338
|
+
display: flex;
|
|
5339
|
+
box-shadow: ${theme.controls.buttonBoxShadow};
|
|
5340
|
+
border-radius: ${theme.controls.borderRadius};
|
|
5341
|
+
${props.round && `
|
|
5342
|
+
border-radius: ${theme.controls.roundRadius};
|
|
5343
|
+
`}
|
|
5344
|
+
`;
|
|
5345
|
+
const buttonStyles = css `
|
|
5346
|
+
flex-grow:1;
|
|
5347
|
+
box-shadow: none;
|
|
5348
|
+
&:nth-of-type(1n+2){
|
|
5349
|
+
margin-left: -1px;
|
|
5350
|
+
}
|
|
5351
|
+
border-radius: 0;
|
|
5352
|
+
&:first-of-type{
|
|
5353
|
+
border-top-left-radius: ${theme.controls.borderRadius};
|
|
5354
|
+
border-bottom-left-radius: ${theme.controls.borderRadius};
|
|
5355
|
+
}
|
|
5356
|
+
&:last-child {
|
|
5357
|
+
border-top-right-radius: ${theme.controls.borderRadius};
|
|
5358
|
+
border-bottom-right-radius: ${theme.controls.borderRadius};
|
|
5359
|
+
}
|
|
5360
|
+
${props.round && `
|
|
5361
|
+
&:first-of-type{
|
|
5362
|
+
border-top-left-radius: ${theme.controls.roundRadius};
|
|
5363
|
+
border-bottom-left-radius: ${theme.controls.roundRadius};
|
|
5364
|
+
padding-left: 1rem;
|
|
5365
|
+
}
|
|
5366
|
+
&:last-child {
|
|
5367
|
+
border-top-right-radius: ${theme.controls.roundRadius};
|
|
5368
|
+
border-bottom-right-radius: ${theme.controls.roundRadius};
|
|
5369
|
+
padding-right: 1rem;
|
|
5370
|
+
}
|
|
5371
|
+
`}
|
|
5372
|
+
`;
|
|
5373
|
+
return (React.createElement("div", { className: cx('toggleButtonGroup', groupStyles, props.className) }, props.options.map(o => {
|
|
5374
|
+
const active = o.id === props.value;
|
|
5375
|
+
return React.createElement(Button, { style: props.width ? { width: props.width } : undefined, small: props.small, rightIcon: o.rightIcon, key: o.id, tabIndex: active ? -1 : 0, className: cx(css `
|
|
5376
|
+
${buttonStyles}
|
|
5377
|
+
${active && `
|
|
5378
|
+
background-color: ${theme.colors.font};
|
|
5379
|
+
color: ${theme.colors.bg};
|
|
5380
|
+
cursor: default;
|
|
5381
|
+
&:hover:not(:disabled) {
|
|
5382
|
+
filter: none;
|
|
5383
|
+
}
|
|
5384
|
+
&:focus {
|
|
5385
|
+
outline: none;
|
|
5386
|
+
box-shadow: none;
|
|
5387
|
+
}
|
|
5388
|
+
`}
|
|
5389
|
+
`, active ? o.activeClass : undefined), disabled: props.disabled, enforceMinWidth: props.enforceMinWidth, onClick: () => {
|
|
5390
|
+
if (active) {
|
|
5391
|
+
return;
|
|
5392
|
+
}
|
|
5393
|
+
props.onChange(o.id);
|
|
5394
|
+
} }, o.name);
|
|
5395
|
+
})));
|
|
5173
5396
|
};
|
|
5174
5397
|
|
|
5175
|
-
const
|
|
5176
|
-
|
|
5177
|
-
const [
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
return (React.createElement(
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
} })
|
|
5189
|
-
|
|
5190
|
-
label: 'TabContainerContent',
|
|
5191
|
-
padding: '1rem',
|
|
5192
|
-
borderLeft: theme.controls.border,
|
|
5193
|
-
borderRight: theme.controls.border,
|
|
5194
|
-
borderBottom: theme.controls.border,
|
|
5195
|
-
}), p.contentClassName) }, p.tabs[tabIndex].getContent())));
|
|
5196
|
-
};
|
|
5398
|
+
const TogglePasswordInput = React.forwardRef((props, ref) => {
|
|
5399
|
+
const { onVisibilityChanged } = props, inputProps = __rest(props, ["onVisibilityChanged"]);
|
|
5400
|
+
const [show, setShow] = React.useState(false);
|
|
5401
|
+
useIgnoreMount(() => {
|
|
5402
|
+
onVisibilityChanged === null || onVisibilityChanged === void 0 ? void 0 : onVisibilityChanged(show);
|
|
5403
|
+
}, [show]);
|
|
5404
|
+
return (React.createElement(TextInput, Object.assign({}, inputProps, { ref: ref, type: show ? 'text' : 'password', rightControl: (React.createElement(Button, { small: true, style: {
|
|
5405
|
+
// small button is required here due to the icon pushing outside the boundries of the
|
|
5406
|
+
// parent textbox. increasing the font size here to fill the small button.
|
|
5407
|
+
fontSize: '1rem'
|
|
5408
|
+
}, variant: "icon", onClick: () => {
|
|
5409
|
+
setShow(previous => !previous);
|
|
5410
|
+
} },
|
|
5411
|
+
React.createElement(Icon, { id: show ? 'show' : 'hide' }))) })));
|
|
5412
|
+
});
|
|
5197
5413
|
|
|
5198
|
-
const
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
get value() {
|
|
5213
|
-
return this._value;
|
|
5214
|
-
}
|
|
5215
|
-
get options() {
|
|
5216
|
-
return this._options;
|
|
5217
|
-
}
|
|
5218
|
-
async onChange(newValue) {
|
|
5219
|
-
// don't make getOptions calls if the value hasn't changed.
|
|
5220
|
-
if (newValue === this.value) {
|
|
5221
|
-
return;
|
|
5222
|
-
}
|
|
5223
|
-
// nullish should not make the getOptions call and instead clear everything.
|
|
5224
|
-
if (!newValue) {
|
|
5225
|
-
this._value = newValue;
|
|
5226
|
-
this._options = [];
|
|
5227
|
-
return;
|
|
5228
|
-
}
|
|
5229
|
-
// sub min chars should clear everything and not attempt the getOptions call.
|
|
5230
|
-
if (newValue.length < this._minChars) {
|
|
5231
|
-
this._value = newValue;
|
|
5232
|
-
this._options = [];
|
|
5233
|
-
return;
|
|
5234
|
-
}
|
|
5235
|
-
try {
|
|
5236
|
-
this._value = newValue;
|
|
5237
|
-
this._options = (await this.getOptions(newValue));
|
|
5238
|
-
}
|
|
5239
|
-
catch (err) {
|
|
5240
|
-
// this method will throw errors on debounce rejections. that is to be expected.
|
|
5241
|
-
// for actual getOptions exceptions, the owner of that function will need to handle errors.
|
|
5242
|
-
}
|
|
5243
|
-
}
|
|
5244
|
-
onPick(newValue) {
|
|
5245
|
-
this._value = newValue;
|
|
5246
|
-
this._options = [];
|
|
5414
|
+
const WaitingIndicator = (p) => {
|
|
5415
|
+
var _a, _b, _c;
|
|
5416
|
+
const [show, setShow] = useState(p.show);
|
|
5417
|
+
const hideTimer = useRef(0);
|
|
5418
|
+
const lastShowStatus = useRef(false);
|
|
5419
|
+
const log = useLogger(`WaitingIndicator ${(_a = p.id) !== null && _a !== void 0 ? _a : '?'}`, (_b = p.__debug) !== null && _b !== void 0 ? _b : false);
|
|
5420
|
+
const { notify, clearNotification } = useAriaLiveRegion();
|
|
5421
|
+
if (p.__debug) {
|
|
5422
|
+
useEffect(() => {
|
|
5423
|
+
log('mounted');
|
|
5424
|
+
return () => {
|
|
5425
|
+
log('unmounted');
|
|
5426
|
+
};
|
|
5427
|
+
}, []);
|
|
5247
5428
|
}
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5429
|
+
useEffect(() => {
|
|
5430
|
+
log('show changed', p.show);
|
|
5431
|
+
// we need to store the 'last props' since props.show will be captured locally and the incorrect
|
|
5432
|
+
// value will display in the timeout below.
|
|
5433
|
+
log('storing lastShowStatus', p.show);
|
|
5434
|
+
lastShowStatus.current = p.show;
|
|
5435
|
+
if (p.show) {
|
|
5436
|
+
log('setShow', true);
|
|
5437
|
+
setShow(true);
|
|
5438
|
+
if (p.minShowTimeMs) {
|
|
5439
|
+
log('staring hideTimer', 'timout in ms:', p.minShowTimeMs);
|
|
5440
|
+
hideTimer.current = window.setTimeout(() => {
|
|
5441
|
+
log('hideTimer complete', 'clearing hideTimer');
|
|
5442
|
+
window.clearTimeout(hideTimer.current);
|
|
5443
|
+
hideTimer.current = 0;
|
|
5444
|
+
// this check is necessary since the show status may have updated again to true.
|
|
5445
|
+
// if so, ignore this timeout since we're already past the min time and we're still
|
|
5446
|
+
// showing the component.
|
|
5447
|
+
if (!lastShowStatus.current) {
|
|
5448
|
+
log('setShow', false);
|
|
5449
|
+
setShow(false);
|
|
5450
|
+
}
|
|
5451
|
+
else {
|
|
5452
|
+
log('ignoring hideTimer handler due to hideTimer ticking');
|
|
5453
|
+
}
|
|
5454
|
+
}, p.minShowTimeMs);
|
|
5455
|
+
}
|
|
5255
5456
|
}
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5457
|
+
else {
|
|
5458
|
+
// ignore hiding the component since the min timer is running.
|
|
5459
|
+
if (!hideTimer.current) {
|
|
5460
|
+
log('setShow', false);
|
|
5461
|
+
setShow(false);
|
|
5462
|
+
}
|
|
5463
|
+
else {
|
|
5464
|
+
log('ignoring show change due to hideTimer ticking');
|
|
5465
|
+
}
|
|
5259
5466
|
}
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
originalFunction(value)
|
|
5264
|
-
.then(values => {
|
|
5265
|
-
res(values);
|
|
5266
|
-
})
|
|
5267
|
-
.catch(err => {
|
|
5268
|
-
rej(err);
|
|
5269
|
-
})
|
|
5270
|
-
.finally(() => {
|
|
5271
|
-
clearTimeout(timer);
|
|
5272
|
-
});
|
|
5273
|
-
}, trailingTimeoutMs);
|
|
5274
|
-
});
|
|
5275
|
-
};
|
|
5276
|
-
};
|
|
5277
|
-
|
|
5278
|
-
/** Extracted logic around autocomplete functionality for Autocomplete.tsx that supports Entity (id/name) mapping. */
|
|
5279
|
-
class AutocompleteEntityController {
|
|
5280
|
-
constructor(getOptions, config) {
|
|
5281
|
-
this._options = [];
|
|
5282
|
-
const getStringOptions = async (value) => {
|
|
5283
|
-
this._options = await getOptions(value);
|
|
5284
|
-
return this._options.map(o => o.name);
|
|
5285
|
-
};
|
|
5286
|
-
this._ctrl = new AutocompleteController(getStringOptions, config);
|
|
5287
|
-
}
|
|
5288
|
-
get entity() {
|
|
5289
|
-
return this._pickedEntity;
|
|
5290
|
-
}
|
|
5291
|
-
get entities() {
|
|
5292
|
-
return this._options;
|
|
5293
|
-
}
|
|
5294
|
-
get value() {
|
|
5295
|
-
return this._ctrl.value;
|
|
5296
|
-
}
|
|
5297
|
-
get options() {
|
|
5298
|
-
return this._options.map(o => o.name);
|
|
5299
|
-
}
|
|
5300
|
-
async onChange(newValue) {
|
|
5301
|
-
const clearEntity = newValue !== this._ctrl.value;
|
|
5302
|
-
await this._ctrl.onChange(newValue);
|
|
5303
|
-
if (clearEntity) {
|
|
5304
|
-
this._pickedEntity = undefined;
|
|
5467
|
+
if (p.show) {
|
|
5468
|
+
// set to a very long time so the hiding of the waiting indicator clears it.
|
|
5469
|
+
notify('Loading content.', 60000);
|
|
5305
5470
|
}
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
onPick(newValue) {
|
|
5309
|
-
this._ctrl.onPick(newValue);
|
|
5310
|
-
this._pickedEntity = this._options.find(o => o.name === this._ctrl.value);
|
|
5311
|
-
this.trySyncCtrlOptions();
|
|
5312
|
-
}
|
|
5313
|
-
trySyncCtrlOptions() {
|
|
5314
|
-
if (!this._ctrl.options.length) {
|
|
5315
|
-
this._options = [];
|
|
5471
|
+
else {
|
|
5472
|
+
clearNotification();
|
|
5316
5473
|
}
|
|
5317
|
-
}
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
getText: (text) => {
|
|
5329
|
-
if (!text) {
|
|
5330
|
-
return '';
|
|
5331
|
-
}
|
|
5332
|
-
if (!isNaN(parseInt(text))) {
|
|
5333
|
-
return text;
|
|
5334
|
-
}
|
|
5335
|
-
const wordArray = stringsDb[text];
|
|
5336
|
-
if (!wordArray) {
|
|
5337
|
-
log(`No localization data exists for "${text}".`);
|
|
5338
|
-
}
|
|
5339
|
-
if (p.language === StyleGuideLanguage.English) {
|
|
5340
|
-
return text;
|
|
5341
|
-
}
|
|
5342
|
-
const languageIndex = p.language - 1;
|
|
5343
|
-
const translation = wordArray === null || wordArray === void 0 ? void 0 : wordArray[languageIndex];
|
|
5344
|
-
if (translation) {
|
|
5345
|
-
return translation;
|
|
5346
|
-
}
|
|
5347
|
-
log(`No ${StyleGuideLanguage[p.language]} translations exist for "${text}".`);
|
|
5348
|
-
return text;
|
|
5349
|
-
}
|
|
5350
|
-
} }, p.children));
|
|
5474
|
+
}, [p.show]);
|
|
5475
|
+
const id = (_c = p.id) !== null && _c !== void 0 ? _c : 'MknWaitingIndicator';
|
|
5476
|
+
return (React__default.createElement(Modal, { id: id, __debug: p.__debug, __asWaitingIndicator: true, heading: '', onClose: () => {
|
|
5477
|
+
/* noop */
|
|
5478
|
+
}, className: "waitingIndicator", show: show },
|
|
5479
|
+
React__default.createElement("div", { className: css({
|
|
5480
|
+
color: 'white',
|
|
5481
|
+
fontSize: '3rem',
|
|
5482
|
+
padding: '0.7rem'
|
|
5483
|
+
}) },
|
|
5484
|
+
React__default.createElement(Icon, { id: "waiting", spin: true }))));
|
|
5351
5485
|
};
|
|
5352
5486
|
|
|
5353
|
-
export { Accordion, Autocomplete, AutocompleteController, AutocompleteEntityController, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, Calendar, Checkbox, ConfirmModal, CopyButton, DateInput, DialogPopover, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, GlobalStyles, Header, Highlight, ICONS, Icon, Image, InfoPanel, InfoTip, ItemPager, Label, Link, List, ListItem, LocalizationProvider, Modal, Nav, NormalizeCss, NumberInput, OmniLink, PagedResult, Pager, Picker, ProgressBar, SearchBox, Slider, StyleGuideLanguage, TabContainer, TabHeader, TabLocker, Table, Td, TdCurrency, TdNumber, Text, TextArea, TextInput, Th, ThSort, ThemeProvider, ThemeRenderer, ToggleButton, ToggleButtonGroup, TogglePasswordInput, TooltipPopover, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, enumToEntities, getCurrencyDisplay, getFileSizeDisplay, modalScrollFixClassName, useAccordionState, useAriaLiveRegion, useBooleanChanged, useIgnoreMount, useMediaQuery, useScrollbarSize, useThemeSafely, useWaiting };
|
|
5487
|
+
export { Accordion, Autocomplete, AutocompleteController, AutocompleteEntityController, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, Calendar, Checkbox, ConfirmModal, CopyButton, DateInput, DialogPopover, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, GlobalStyles, Header, Highlight, ICONS, Icon, Image, InfoPanel, InfoTip, ItemPager, Label, Link, List, ListItem, LocalizationProvider, Modal, MultiPicker, Nav, NormalizeCss, NumberInput, OmniLink, PagedResult, Pager, Picker, ProgressBar, SearchBox, Slider, StyleGuideLanguage, TabContainer, TabHeader, TabLocker, Table, Td, TdCurrency, TdNumber, Text, TextArea, TextInput, Th, ThSort, ThemeProvider, ThemeRenderer, ToggleButton, ToggleButtonGroup, TogglePasswordInput, TooltipPopover, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, enumToEntities, getCurrencyDisplay, getFileSizeDisplay, modalScrollFixClassName, useAccordionState, useAriaLiveRegion, useBooleanChanged, useIgnoreMount, useMediaQuery, useScrollbarSize, useThemeSafely, useWaiting };
|
|
5354
5488
|
//# sourceMappingURL=index.esm.js.map
|