@edvisor/product-language 0.10.6 → 0.10.8
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.js +395 -1346
- package/package.json +7 -5
package/index.js
CHANGED
|
@@ -1095,9 +1095,7 @@ $$g({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }
|
|
|
1095
1095
|
* it is for juuuuust in case a third party sends us a null
|
|
1096
1096
|
* or something, and the types are not correct
|
|
1097
1097
|
*/
|
|
1098
|
-
|
|
1099
1098
|
/* eslint-disable no-null/no-null */
|
|
1100
|
-
|
|
1101
1099
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
1102
1100
|
function isNil(value) {
|
|
1103
1101
|
return value === null || value === undefined;
|
|
@@ -1112,7 +1110,6 @@ function isEmpty(obj) {
|
|
|
1112
1110
|
return obj.length < 1;
|
|
1113
1111
|
}
|
|
1114
1112
|
/** used for evaluating tri-state logic (true | false | undefined) */
|
|
1115
|
-
|
|
1116
1113
|
function is(pred) {
|
|
1117
1114
|
return isDefined(pred) && pred;
|
|
1118
1115
|
}
|
|
@@ -2326,16 +2323,16 @@ $$a({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
|
|
|
2326
2323
|
}
|
|
2327
2324
|
});
|
|
2328
2325
|
|
|
2329
|
-
const isReactElementOfType = (
|
|
2330
|
-
|
|
2326
|
+
const isReactElementOfType = (
|
|
2327
|
+
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-explicit-any
|
|
2328
|
+
component) =>
|
|
2329
|
+
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-explicit-any
|
|
2331
2330
|
element => {
|
|
2332
2331
|
var _a, _b;
|
|
2333
2332
|
/**
|
|
2334
2333
|
* I'm going to leave this as a big if/else instead of a compound expression to make
|
|
2335
2334
|
* it clear exactly what we are checking.
|
|
2336
2335
|
*/
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
2336
|
if ((element === null || element === void 0 ? void 0 : element.type) === component) {
|
|
2340
2337
|
// component is a function or a class, and element is an element of that type
|
|
2341
2338
|
return true;
|
|
@@ -2353,12 +2350,12 @@ element => {
|
|
|
2353
2350
|
// but their underlying component type is the same
|
|
2354
2351
|
return true;
|
|
2355
2352
|
}
|
|
2356
|
-
|
|
2357
2353
|
return false;
|
|
2358
2354
|
};
|
|
2359
2355
|
|
|
2360
|
-
|
|
2361
|
-
|
|
2356
|
+
// eslint-disable-next-line no-null/no-null
|
|
2357
|
+
const Nothing = () => null;
|
|
2358
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2362
2359
|
const isNothing = isReactElementOfType(Nothing);
|
|
2363
2360
|
function maybeRender(prop, JSX) {
|
|
2364
2361
|
return isNil(prop) || false === Boolean(prop) || isNothing(prop) ? jsx(Nothing, {}) : JSX;
|
|
@@ -2384,30 +2381,24 @@ const If = props => {
|
|
|
2384
2381
|
* Right? I want this...
|
|
2385
2382
|
* */
|
|
2386
2383
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2387
|
-
|
|
2388
2384
|
function isReactElement(obj) {
|
|
2389
2385
|
// eslint-disable-next-line no-prototype-builtins
|
|
2390
2386
|
return isDefined(obj) && obj.hasOwnProperty('type');
|
|
2391
|
-
}
|
|
2392
|
-
|
|
2393
|
-
|
|
2387
|
+
}
|
|
2388
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2394
2389
|
const isSlotOfType = type => obj => {
|
|
2395
2390
|
return isDefined(obj) && isReactElement(obj) && isDefined(obj.type) && (Object.getPrototypeOf(obj.type) === type || obj.type === type) || isDefined(obj.type) && isDefined(obj.type.target) && (Object.getPrototypeOf(obj.type.target) === type || obj.type.target === type);
|
|
2396
2391
|
};
|
|
2397
|
-
|
|
2398
2392
|
const findSlotByType = (type, children) => {
|
|
2399
2393
|
return Children.toArray(children).find(isSlotOfType(type));
|
|
2400
2394
|
};
|
|
2401
|
-
|
|
2402
2395
|
const filterSlotByType = (type, children) => {
|
|
2403
2396
|
return Children.toArray(children).filter(isSlotOfType(type));
|
|
2404
2397
|
};
|
|
2405
|
-
|
|
2406
2398
|
class Slot extends PureComponent {
|
|
2407
2399
|
render() {
|
|
2408
2400
|
return this.props.children;
|
|
2409
2401
|
}
|
|
2410
|
-
|
|
2411
2402
|
}
|
|
2412
2403
|
class StylableSlot extends Slot {
|
|
2413
2404
|
render() {
|
|
@@ -2415,39 +2406,31 @@ class StylableSlot extends Slot {
|
|
|
2415
2406
|
children: this.props.children
|
|
2416
2407
|
}));
|
|
2417
2408
|
}
|
|
2418
|
-
|
|
2419
2409
|
}
|
|
2420
2410
|
/** gets children that are _not_ slots */
|
|
2421
|
-
|
|
2422
2411
|
function getOtherChildren(children) {
|
|
2423
2412
|
return Children.toArray(children).filter(child => !isSlotOfType(Slot)(child));
|
|
2424
2413
|
}
|
|
2425
2414
|
function getSlots(slot, children) {
|
|
2426
2415
|
const result = filterSlotByType(slot, children);
|
|
2427
|
-
|
|
2428
2416
|
if (isNil(result)) {
|
|
2429
2417
|
return [];
|
|
2430
2418
|
}
|
|
2431
|
-
|
|
2432
2419
|
return result;
|
|
2433
|
-
}
|
|
2434
|
-
|
|
2420
|
+
}
|
|
2421
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2435
2422
|
function hasProps(obj) {
|
|
2436
2423
|
// eslint-disable-next-line no-prototype-builtins
|
|
2437
2424
|
return isDefined(obj) && obj.hasOwnProperty('props');
|
|
2438
2425
|
}
|
|
2439
|
-
|
|
2440
2426
|
function getSlot(slot, children) {
|
|
2441
2427
|
const result = findSlotByType(slot, children);
|
|
2442
|
-
|
|
2443
2428
|
if (isNil(result)) {
|
|
2444
2429
|
return jsx(Nothing, {});
|
|
2445
2430
|
}
|
|
2446
|
-
|
|
2447
2431
|
if (hasProps(result)) {
|
|
2448
2432
|
return result;
|
|
2449
2433
|
}
|
|
2450
|
-
|
|
2451
2434
|
return result;
|
|
2452
2435
|
}
|
|
2453
2436
|
function applyProps(element, props) {
|
|
@@ -2456,13 +2439,11 @@ function applyProps(element, props) {
|
|
|
2456
2439
|
props: props(element.props)
|
|
2457
2440
|
});
|
|
2458
2441
|
}
|
|
2459
|
-
|
|
2460
2442
|
return Object.assign(Object.assign({}, element), {
|
|
2461
2443
|
props: Object.assign(Object.assign({}, element.props), props)
|
|
2462
2444
|
});
|
|
2463
2445
|
}
|
|
2464
2446
|
/** given a ReactElement, like a child, apply the given styles to it, merging with the existing styles */
|
|
2465
|
-
|
|
2466
2447
|
function applyStyle(element, style) {
|
|
2467
2448
|
return Object.assign(Object.assign({}, element), {
|
|
2468
2449
|
props: Object.assign(Object.assign({}, element.props), {
|
|
@@ -2472,7 +2453,7 @@ function applyStyle(element, style) {
|
|
|
2472
2453
|
}
|
|
2473
2454
|
|
|
2474
2455
|
// eslint-disable-next-line no-restricted-syntax
|
|
2475
|
-
|
|
2456
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
2476
2457
|
function forwardRef(render) {
|
|
2477
2458
|
return /*#__PURE__*/React.forwardRef(render);
|
|
2478
2459
|
}
|
|
@@ -2731,7 +2712,6 @@ function concatHex(a, b) {
|
|
|
2731
2712
|
* const levelEnum = toLevel(level)
|
|
2732
2713
|
* ```
|
|
2733
2714
|
*/
|
|
2734
|
-
|
|
2735
2715
|
function bitwiseOr$1(flags) {
|
|
2736
2716
|
return flags.reduce((mask, flag, i) => mask | Number(flag) << i, 0);
|
|
2737
2717
|
}
|
|
@@ -2743,7 +2723,6 @@ function bitwiseOr$1(flags) {
|
|
|
2743
2723
|
* ```
|
|
2744
2724
|
*
|
|
2745
2725
|
* */
|
|
2746
|
-
|
|
2747
2726
|
function getRightmostSetBitNumber(n) {
|
|
2748
2727
|
return n & -n;
|
|
2749
2728
|
}
|
|
@@ -3746,7 +3725,6 @@ const CONTROLLED_TO_UNCONTROLLED = 'Warning: A component is changing a controlle
|
|
|
3746
3725
|
* if you give it value only, you get a warning
|
|
3747
3726
|
* if you give it value and onChange, state management if deferred to the parent (controlled input)
|
|
3748
3727
|
*/
|
|
3749
|
-
|
|
3750
3728
|
function useInputElementState(props) {
|
|
3751
3729
|
const [initialValue] = useState(props.value);
|
|
3752
3730
|
const [state, setState] = useState(props.defaultValue);
|
|
@@ -3761,11 +3739,9 @@ function useInputElementState(props) {
|
|
|
3761
3739
|
console.error(CONTROLLED_TO_UNCONTROLLED);
|
|
3762
3740
|
}
|
|
3763
3741
|
}, [props.value, initialValue]);
|
|
3764
|
-
|
|
3765
3742
|
if (isDefined(props.value) && isNil(props.onChange)) {
|
|
3766
3743
|
console.error(READ_ONLY_WARNING);
|
|
3767
3744
|
}
|
|
3768
|
-
|
|
3769
3745
|
return [value, onChange];
|
|
3770
3746
|
}
|
|
3771
3747
|
|
|
@@ -3835,7 +3811,6 @@ function addOpacity(hex, opacity) {
|
|
|
3835
3811
|
const opacityHex = toHex(clamp(0, Math.floor(0xFF * opacity), 0xFF), 2);
|
|
3836
3812
|
return concatHex(hex, opacityHex);
|
|
3837
3813
|
}
|
|
3838
|
-
|
|
3839
3814
|
const Background = {
|
|
3840
3815
|
Default: GRAY[100],
|
|
3841
3816
|
Overlay: addOpacity(GRAY[800], 0.6)
|
|
@@ -3943,7 +3918,6 @@ const Interactive = {
|
|
|
3943
3918
|
};
|
|
3944
3919
|
/** in order for disabled to appear light gray on any background
|
|
3945
3920
|
* we have to give a darker gray some opacity */
|
|
3946
|
-
|
|
3947
3921
|
const DisabledGray = addOpacity(GRAY[800], 0.06);
|
|
3948
3922
|
const PressedGray = addOpacity(GRAY[800], 0.12);
|
|
3949
3923
|
const Actions = {
|
|
@@ -3977,77 +3951,31 @@ const Actions = {
|
|
|
3977
3951
|
|
|
3978
3952
|
function toTextAspect(n) {
|
|
3979
3953
|
switch (n) {
|
|
3980
|
-
case 2
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
return
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
/* TextAspects.
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
/* TextAspects.
|
|
3992
|
-
;
|
|
3993
|
-
|
|
3994
|
-
case 8
|
|
3995
|
-
/* TextAspects.critical */
|
|
3996
|
-
:
|
|
3997
|
-
return 8
|
|
3998
|
-
/* TextAspects.critical */
|
|
3999
|
-
;
|
|
4000
|
-
|
|
4001
|
-
case 16
|
|
4002
|
-
/* TextAspects.success */
|
|
4003
|
-
:
|
|
4004
|
-
return 16
|
|
4005
|
-
/* TextAspects.success */
|
|
4006
|
-
;
|
|
4007
|
-
|
|
4008
|
-
case 32
|
|
4009
|
-
/* TextAspects.onPrimary */
|
|
4010
|
-
:
|
|
4011
|
-
return 32
|
|
4012
|
-
/* TextAspects.onPrimary */
|
|
4013
|
-
;
|
|
4014
|
-
|
|
4015
|
-
case 64
|
|
4016
|
-
/* TextAspects.onCritical */
|
|
4017
|
-
:
|
|
4018
|
-
return 64
|
|
4019
|
-
/* TextAspects.onCritical */
|
|
4020
|
-
;
|
|
4021
|
-
|
|
3954
|
+
case 2 /* TextAspects.subdued */:
|
|
3955
|
+
return 2 /* TextAspects.subdued */;
|
|
3956
|
+
case 4 /* TextAspects.light */:
|
|
3957
|
+
return 4 /* TextAspects.light */;
|
|
3958
|
+
case 8 /* TextAspects.critical */:
|
|
3959
|
+
return 8 /* TextAspects.critical */;
|
|
3960
|
+
case 16 /* TextAspects.success */:
|
|
3961
|
+
return 16 /* TextAspects.success */;
|
|
3962
|
+
case 32 /* TextAspects.onPrimary */:
|
|
3963
|
+
return 32 /* TextAspects.onPrimary */;
|
|
3964
|
+
case 64 /* TextAspects.onCritical */:
|
|
3965
|
+
return 64 /* TextAspects.onCritical */;
|
|
4022
3966
|
default:
|
|
4023
|
-
return 1
|
|
4024
|
-
/* TextAspects.default */
|
|
4025
|
-
;
|
|
3967
|
+
return 1 /* TextAspects.default */;
|
|
4026
3968
|
}
|
|
4027
3969
|
}
|
|
4028
3970
|
|
|
4029
3971
|
const TextAspectColors = {
|
|
4030
|
-
[1
|
|
4031
|
-
/* TextAspects.
|
|
4032
|
-
]: Text$1.
|
|
4033
|
-
[
|
|
4034
|
-
/* TextAspects.
|
|
4035
|
-
]: Text$1.
|
|
4036
|
-
[
|
|
4037
|
-
/* TextAspects.light */
|
|
4038
|
-
]: Text$1.Light,
|
|
4039
|
-
[32
|
|
4040
|
-
/* TextAspects.onPrimary */
|
|
4041
|
-
]: Text$1.OnPrimary,
|
|
4042
|
-
[64
|
|
4043
|
-
/* TextAspects.onCritical */
|
|
4044
|
-
]: Text$1.OnPrimary,
|
|
4045
|
-
[16
|
|
4046
|
-
/* TextAspects.success */
|
|
4047
|
-
]: Text$1.Success,
|
|
4048
|
-
[8
|
|
4049
|
-
/* TextAspects.critical */
|
|
4050
|
-
]: Text$1.Critical
|
|
3972
|
+
[1 /* TextAspects.default */]: Text$1.Default,
|
|
3973
|
+
[2 /* TextAspects.subdued */]: Text$1.Subdued,
|
|
3974
|
+
[4 /* TextAspects.light */]: Text$1.Light,
|
|
3975
|
+
[32 /* TextAspects.onPrimary */]: Text$1.OnPrimary,
|
|
3976
|
+
[64 /* TextAspects.onCritical */]: Text$1.OnPrimary,
|
|
3977
|
+
[16 /* TextAspects.success */]: Text$1.Success,
|
|
3978
|
+
[8 /* TextAspects.critical */]: Text$1.Critical
|
|
4051
3979
|
};
|
|
4052
3980
|
function getTextAspect(props) {
|
|
4053
3981
|
return TextAspectColors[toTextAspect(bitwiseOr$1([props.default, props.subdued, props.light, props.critical, props.success, isDefined(props.onPrimary) ? props.onPrimary : props.$onPrimary, isDefined(props.onCritical) ? props.onCritical : props.$onCritical]))];
|
|
@@ -4281,39 +4209,21 @@ const LightText = /*#__PURE__*/css([" color:", ";"], getTextAspect({
|
|
|
4281
4209
|
light: true
|
|
4282
4210
|
}));
|
|
4283
4211
|
const Base = /*#__PURE__*/css(["color:", ";", " font-family:'Inter';"], props => getTextAspect(props), InterFontFace);
|
|
4284
|
-
const Display$1 = /*#__PURE__*/css(["", " font-weight:", ";font-size:", ";line-height:", ";"], Base, "400"
|
|
4285
|
-
/* FontWeight.
|
|
4286
|
-
, FontSize.g, LineHeight.f);
|
|
4287
|
-
const Heading1$1 = /*#__PURE__*/css(["", " font-weight:", ";font-size:", ";line-height:", ";"], Base, "600"
|
|
4288
|
-
/* FontWeight.SemiBold */
|
|
4289
|
-
, FontSize.f, LineHeight.e);
|
|
4212
|
+
const Display$1 = /*#__PURE__*/css(["", " font-weight:", ";font-size:", ";line-height:", ";"], Base, "400" /* FontWeight.Regular */, FontSize.g, LineHeight.f);
|
|
4213
|
+
const Heading1$1 = /*#__PURE__*/css(["", " font-weight:", ";font-size:", ";line-height:", ";"], Base, "600" /* FontWeight.SemiBold */, FontSize.f, LineHeight.e);
|
|
4290
4214
|
const Heading2$1 = /*#__PURE__*/css(["", " font-size:", ";line-height:", ";"], Heading1$1, FontSize.e, LineHeight.d);
|
|
4291
4215
|
const Heading3$1 = /*#__PURE__*/css(["", " font-size:", ";line-height:", ";"], Heading1$1, FontSize.c, LineHeight.c);
|
|
4292
4216
|
const Heading4$1 = /*#__PURE__*/css(["", " font-size:", ";line-height:", ";"], Heading1$1, FontSize.b, LineHeight.b);
|
|
4293
4217
|
const Body$1 = /*#__PURE__*/css(["", " font-weight:", ";font-size:", ";line-height:", ";"], Base, ({
|
|
4294
4218
|
strong
|
|
4295
|
-
}) => is(strong) ? "500"
|
|
4296
|
-
/* FontWeight.Medium */
|
|
4297
|
-
: "400"
|
|
4298
|
-
/* FontWeight.Regular */
|
|
4299
|
-
, FontSize.b, LineHeight.b);
|
|
4219
|
+
}) => is(strong) ? "500" /* FontWeight.Medium */ : "400" /* FontWeight.Regular */, FontSize.b, LineHeight.b);
|
|
4300
4220
|
const BodyLarge$1 = /*#__PURE__*/css(["", " font-weight:", ";font-size:", ";line-height:", ";"], Base, ({
|
|
4301
4221
|
strong
|
|
4302
|
-
}) => is(strong) ? "600"
|
|
4303
|
-
/* FontWeight.
|
|
4304
|
-
: "400"
|
|
4305
|
-
/* FontWeight.Regular */
|
|
4306
|
-
, FontSize.d, LineHeight.d);
|
|
4307
|
-
const Caption$1 = /*#__PURE__*/css(["", " font-weight:", ";font-size:", ";line-height:", ";"], Base, "400"
|
|
4308
|
-
/* FontWeight.Regular */
|
|
4309
|
-
, FontSize.a, LineHeight.a);
|
|
4222
|
+
}) => is(strong) ? "600" /* FontWeight.SemiBold */ : "400" /* FontWeight.Regular */, FontSize.d, LineHeight.d);
|
|
4223
|
+
const Caption$1 = /*#__PURE__*/css(["", " font-weight:", ";font-size:", ";line-height:", ";"], Base, "400" /* FontWeight.Regular */, FontSize.a, LineHeight.a);
|
|
4310
4224
|
const Label$2 = /*#__PURE__*/css(["", " font-weight:", ";font-size:", ";line-height:", ";"], Base, ({
|
|
4311
4225
|
strong
|
|
4312
|
-
}) => is(strong) ? "500"
|
|
4313
|
-
/* FontWeight.Medium */
|
|
4314
|
-
: "400"
|
|
4315
|
-
/* FontWeight.Regular */
|
|
4316
|
-
, ({
|
|
4226
|
+
}) => is(strong) ? "500" /* FontWeight.Medium */ : "400" /* FontWeight.Regular */, ({
|
|
4317
4227
|
subtle
|
|
4318
4228
|
}) => is(subtle) ? FontSize.a : FontSize.b, ({
|
|
4319
4229
|
subtle
|
|
@@ -4334,7 +4244,6 @@ const _Typography = {
|
|
|
4334
4244
|
};
|
|
4335
4245
|
|
|
4336
4246
|
var SPACING;
|
|
4337
|
-
|
|
4338
4247
|
(function (SPACING) {
|
|
4339
4248
|
SPACING["Size2"] = "2px";
|
|
4340
4249
|
SPACING["Size4"] = "4px";
|
|
@@ -4396,7 +4305,6 @@ const shadow2Xl = /*#__PURE__*/css(["box-shadow:0px 25px 50px -12px rgba(0,0,0,0
|
|
|
4396
4305
|
const shadowInner = /*#__PURE__*/css(["box-shadow:inset 0px 2px 4px rgba(0,0,0,0.06);border-radius:6px;"]);
|
|
4397
4306
|
|
|
4398
4307
|
/* eslint-disable no-restricted-syntax */
|
|
4399
|
-
|
|
4400
4308
|
const IconListMajor = {
|
|
4401
4309
|
'arrows-up-down-left-right': jsxs(Fragment, {
|
|
4402
4310
|
children: [jsx("g", Object.assign({
|
|
@@ -5224,7 +5132,6 @@ Svg$1.defaultProps = {
|
|
|
5224
5132
|
role: 'icon',
|
|
5225
5133
|
'aria-label': 'icon'
|
|
5226
5134
|
};
|
|
5227
|
-
|
|
5228
5135
|
const ProductLanguageIcon = props => jsx(BoundingBox$1, Object.assign({}, props, {
|
|
5229
5136
|
children: jsx(Svg$1, Object.assign({
|
|
5230
5137
|
props: props
|
|
@@ -5232,7 +5139,6 @@ const ProductLanguageIcon = props => jsx(BoundingBox$1, Object.assign({}, props,
|
|
|
5232
5139
|
children: props.icon
|
|
5233
5140
|
}))
|
|
5234
5141
|
}));
|
|
5235
|
-
|
|
5236
5142
|
const Icon = {
|
|
5237
5143
|
ArrowsUpDownLeftRight: props => jsx(ProductLanguageIcon, Object.assign({}, props, {
|
|
5238
5144
|
icon: IconListMajor['arrows-up-down-left-right']
|
|
@@ -5702,113 +5608,55 @@ const IconMinor = {
|
|
|
5702
5608
|
};
|
|
5703
5609
|
|
|
5704
5610
|
// this file was generated, but it is safe to modify
|
|
5705
|
-
|
|
5706
5611
|
function toAlertLevel(n) {
|
|
5707
5612
|
switch (n) {
|
|
5708
|
-
case 1
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
return
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
/* AlertLevel.
|
|
5717
|
-
|
|
5718
|
-
return 2
|
|
5719
|
-
/* AlertLevel.info */
|
|
5720
|
-
;
|
|
5721
|
-
|
|
5722
|
-
case 4
|
|
5723
|
-
/* AlertLevel.success */
|
|
5724
|
-
:
|
|
5725
|
-
return 4
|
|
5726
|
-
/* AlertLevel.success */
|
|
5727
|
-
;
|
|
5728
|
-
|
|
5729
|
-
case 8
|
|
5730
|
-
/* AlertLevel.warning */
|
|
5731
|
-
:
|
|
5732
|
-
return 8
|
|
5733
|
-
/* AlertLevel.warning */
|
|
5734
|
-
;
|
|
5735
|
-
|
|
5736
|
-
case 16
|
|
5737
|
-
/* AlertLevel.critical */
|
|
5738
|
-
:
|
|
5739
|
-
return 16
|
|
5740
|
-
/* AlertLevel.critical */
|
|
5741
|
-
;
|
|
5742
|
-
|
|
5613
|
+
case 1 /* AlertLevel.neutral */:
|
|
5614
|
+
return 1 /* AlertLevel.neutral */;
|
|
5615
|
+
case 2 /* AlertLevel.info */:
|
|
5616
|
+
return 2 /* AlertLevel.info */;
|
|
5617
|
+
case 4 /* AlertLevel.success */:
|
|
5618
|
+
return 4 /* AlertLevel.success */;
|
|
5619
|
+
case 8 /* AlertLevel.warning */:
|
|
5620
|
+
return 8 /* AlertLevel.warning */;
|
|
5621
|
+
case 16 /* AlertLevel.critical */:
|
|
5622
|
+
return 16 /* AlertLevel.critical */;
|
|
5743
5623
|
default:
|
|
5744
|
-
return 1
|
|
5745
|
-
/* AlertLevel.neutral */
|
|
5746
|
-
;
|
|
5624
|
+
return 1 /* AlertLevel.neutral */;
|
|
5747
5625
|
}
|
|
5748
5626
|
}
|
|
5749
5627
|
|
|
5750
5628
|
const AlertLevelBackgroundColors = {
|
|
5751
|
-
[1
|
|
5752
|
-
/* AlertLevel.
|
|
5753
|
-
]: Surface.
|
|
5754
|
-
[
|
|
5755
|
-
/* AlertLevel.
|
|
5756
|
-
]: Surface.Highlight.Subdued,
|
|
5757
|
-
[4
|
|
5758
|
-
/* AlertLevel.success */
|
|
5759
|
-
]: Surface.Success.Subdued,
|
|
5760
|
-
[8
|
|
5761
|
-
/* AlertLevel.warning */
|
|
5762
|
-
]: Surface.Warning.Subdued,
|
|
5763
|
-
[16
|
|
5764
|
-
/* AlertLevel.critical */
|
|
5765
|
-
]: Surface.Critical.Subdued
|
|
5629
|
+
[1 /* AlertLevel.neutral */]: Surface.Neutral.Subdued,
|
|
5630
|
+
[2 /* AlertLevel.info */]: Surface.Highlight.Subdued,
|
|
5631
|
+
[4 /* AlertLevel.success */]: Surface.Success.Subdued,
|
|
5632
|
+
[8 /* AlertLevel.warning */]: Surface.Warning.Subdued,
|
|
5633
|
+
[16 /* AlertLevel.critical */]: Surface.Critical.Subdued
|
|
5766
5634
|
};
|
|
5767
5635
|
const AlertLevelBorderColors = {
|
|
5768
|
-
[1
|
|
5769
|
-
/* AlertLevel.
|
|
5770
|
-
]: Borders.
|
|
5771
|
-
[
|
|
5772
|
-
/* AlertLevel.
|
|
5773
|
-
]: Borders.Highlight.Subdued,
|
|
5774
|
-
[4
|
|
5775
|
-
/* AlertLevel.success */
|
|
5776
|
-
]: Borders.Success.Subdued,
|
|
5777
|
-
[8
|
|
5778
|
-
/* AlertLevel.warning */
|
|
5779
|
-
]: Borders.Warning.Subdued,
|
|
5780
|
-
[16
|
|
5781
|
-
/* AlertLevel.critical */
|
|
5782
|
-
]: Borders.Critical.Subdued
|
|
5636
|
+
[1 /* AlertLevel.neutral */]: Borders.Default.Default,
|
|
5637
|
+
[2 /* AlertLevel.info */]: Borders.Highlight.Subdued,
|
|
5638
|
+
[4 /* AlertLevel.success */]: Borders.Success.Subdued,
|
|
5639
|
+
[8 /* AlertLevel.warning */]: Borders.Warning.Subdued,
|
|
5640
|
+
[16 /* AlertLevel.critical */]: Borders.Critical.Subdued
|
|
5783
5641
|
};
|
|
5784
5642
|
const AlertLevelIcons = {
|
|
5785
|
-
[1
|
|
5786
|
-
/* AlertLevel.neutral */
|
|
5787
|
-
]: {
|
|
5643
|
+
[1 /* AlertLevel.neutral */]: {
|
|
5788
5644
|
icon: Icon.CircleInfo,
|
|
5789
5645
|
color: Icons.Default
|
|
5790
5646
|
},
|
|
5791
|
-
[2
|
|
5792
|
-
/* AlertLevel.info */
|
|
5793
|
-
]: {
|
|
5647
|
+
[2 /* AlertLevel.info */]: {
|
|
5794
5648
|
icon: Icon.CircleInfo,
|
|
5795
5649
|
color: Icons.Highlight
|
|
5796
5650
|
},
|
|
5797
|
-
[4
|
|
5798
|
-
/* AlertLevel.success */
|
|
5799
|
-
]: {
|
|
5651
|
+
[4 /* AlertLevel.success */]: {
|
|
5800
5652
|
icon: Icon.CircleCheck,
|
|
5801
5653
|
color: Icons.Success
|
|
5802
5654
|
},
|
|
5803
|
-
[8
|
|
5804
|
-
/* AlertLevel.warning */
|
|
5805
|
-
]: {
|
|
5655
|
+
[8 /* AlertLevel.warning */]: {
|
|
5806
5656
|
icon: Icon.TriangleExclamation,
|
|
5807
5657
|
color: Icons.Warning
|
|
5808
5658
|
},
|
|
5809
|
-
[16
|
|
5810
|
-
/* AlertLevel.critical */
|
|
5811
|
-
]: {
|
|
5659
|
+
[16 /* AlertLevel.critical */]: {
|
|
5812
5660
|
icon: Icon.DiamondExclamation,
|
|
5813
5661
|
color: Icons.Critical
|
|
5814
5662
|
}
|
|
@@ -5829,7 +5677,6 @@ function getIcon(props) {
|
|
|
5829
5677
|
*
|
|
5830
5678
|
* We might use it to implement the AlertBanner, or put a table in it.
|
|
5831
5679
|
*/
|
|
5832
|
-
|
|
5833
5680
|
const CardFrame$1 = /*#__PURE__*/styled.section.withConfig({
|
|
5834
5681
|
displayName: "card-frame__CardFrame",
|
|
5835
5682
|
componentId: "l58n4z-0"
|
|
@@ -5863,483 +5710,194 @@ function __rest(s, e) {
|
|
|
5863
5710
|
}
|
|
5864
5711
|
|
|
5865
5712
|
// this file was generated, but it is safe to modify
|
|
5866
|
-
|
|
5867
5713
|
function toButtonSize(n) {
|
|
5868
5714
|
switch (n) {
|
|
5869
|
-
case 1
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
return
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
case 2
|
|
5877
|
-
/* ButtonSize.small */
|
|
5878
|
-
:
|
|
5879
|
-
return 2
|
|
5880
|
-
/* ButtonSize.small */
|
|
5881
|
-
;
|
|
5882
|
-
|
|
5883
|
-
case 4
|
|
5884
|
-
/* ButtonSize.large */
|
|
5885
|
-
:
|
|
5886
|
-
return 4
|
|
5887
|
-
/* ButtonSize.large */
|
|
5888
|
-
;
|
|
5889
|
-
|
|
5715
|
+
case 1 /* ButtonSize.default */:
|
|
5716
|
+
return 1 /* ButtonSize.default */;
|
|
5717
|
+
case 2 /* ButtonSize.small */:
|
|
5718
|
+
return 2 /* ButtonSize.small */;
|
|
5719
|
+
case 4 /* ButtonSize.large */:
|
|
5720
|
+
return 4 /* ButtonSize.large */;
|
|
5890
5721
|
default:
|
|
5891
|
-
return 1
|
|
5892
|
-
/* ButtonSize.default */
|
|
5893
|
-
;
|
|
5722
|
+
return 1 /* ButtonSize.default */;
|
|
5894
5723
|
}
|
|
5895
5724
|
}
|
|
5896
5725
|
|
|
5897
5726
|
function toButtonDisabledType(n) {
|
|
5898
5727
|
switch (n) {
|
|
5899
|
-
case 1
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
return
|
|
5903
|
-
/* ButtonDisabledType.enabled */
|
|
5904
|
-
;
|
|
5905
|
-
|
|
5906
|
-
case 2
|
|
5907
|
-
/* ButtonDisabledType.disabled */
|
|
5908
|
-
:
|
|
5909
|
-
return 2
|
|
5910
|
-
/* ButtonDisabledType.disabled */
|
|
5911
|
-
;
|
|
5912
|
-
|
|
5728
|
+
case 1 /* ButtonDisabledType.enabled */:
|
|
5729
|
+
return 1 /* ButtonDisabledType.enabled */;
|
|
5730
|
+
case 2 /* ButtonDisabledType.disabled */:
|
|
5731
|
+
return 2 /* ButtonDisabledType.disabled */;
|
|
5913
5732
|
default:
|
|
5914
|
-
return 1
|
|
5915
|
-
/* ButtonDisabledType.enabled */
|
|
5916
|
-
;
|
|
5733
|
+
return 1 /* ButtonDisabledType.enabled */;
|
|
5917
5734
|
}
|
|
5918
5735
|
}
|
|
5919
5736
|
|
|
5920
5737
|
function toButtonTypes(n) {
|
|
5921
5738
|
const defaultType = 0;
|
|
5922
|
-
|
|
5923
5739
|
switch (n) {
|
|
5924
5740
|
case defaultType:
|
|
5925
|
-
case 1
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
return
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
/* ButtonType.
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
/* ButtonType.
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
case 6
|
|
5940
|
-
/* ButtonType.destructivePrimary */
|
|
5941
|
-
:
|
|
5942
|
-
return 6
|
|
5943
|
-
/* ButtonType.destructivePrimary */
|
|
5944
|
-
;
|
|
5945
|
-
|
|
5946
|
-
case 4
|
|
5947
|
-
/* ButtonType.destructive */
|
|
5948
|
-
:
|
|
5949
|
-
return 4
|
|
5950
|
-
/* ButtonType.destructive */
|
|
5951
|
-
;
|
|
5952
|
-
|
|
5953
|
-
case 8
|
|
5954
|
-
/* ButtonType.outline */
|
|
5955
|
-
:
|
|
5956
|
-
return 8
|
|
5957
|
-
/* ButtonType.outline */
|
|
5958
|
-
;
|
|
5959
|
-
|
|
5960
|
-
case 16
|
|
5961
|
-
/* ButtonType.plain */
|
|
5962
|
-
:
|
|
5963
|
-
return 16
|
|
5964
|
-
/* ButtonType.plain */
|
|
5965
|
-
;
|
|
5966
|
-
|
|
5967
|
-
case 48
|
|
5968
|
-
/* ButtonType.plainSubtle */
|
|
5969
|
-
:
|
|
5970
|
-
return 48
|
|
5971
|
-
/* ButtonType.plainSubtle */
|
|
5972
|
-
;
|
|
5973
|
-
|
|
5741
|
+
case 1 /* ButtonType.basic */:
|
|
5742
|
+
return 1 /* ButtonType.basic */;
|
|
5743
|
+
case 2 /* ButtonType.primary */:
|
|
5744
|
+
return 2 /* ButtonType.primary */;
|
|
5745
|
+
case 6 /* ButtonType.destructivePrimary */:
|
|
5746
|
+
return 6 /* ButtonType.destructivePrimary */;
|
|
5747
|
+
case 4 /* ButtonType.destructive */:
|
|
5748
|
+
return 4 /* ButtonType.destructive */;
|
|
5749
|
+
case 8 /* ButtonType.outline */:
|
|
5750
|
+
return 8 /* ButtonType.outline */;
|
|
5751
|
+
case 16 /* ButtonType.plain */:
|
|
5752
|
+
return 16 /* ButtonType.plain */;
|
|
5753
|
+
case 48 /* ButtonType.plainSubtle */:
|
|
5754
|
+
return 48 /* ButtonType.plainSubtle */;
|
|
5974
5755
|
default:
|
|
5975
5756
|
return getRightmostSetBitNumber(n);
|
|
5976
5757
|
}
|
|
5977
5758
|
}
|
|
5978
|
-
|
|
5979
5759
|
const ButtonBackgroundColorValues = {
|
|
5980
|
-
[1
|
|
5981
|
-
/* ButtonType.
|
|
5982
|
-
]: Actions.
|
|
5983
|
-
[
|
|
5984
|
-
/* ButtonType.
|
|
5985
|
-
]:
|
|
5986
|
-
[
|
|
5987
|
-
/* ButtonType.
|
|
5988
|
-
]: Actions.Critical.Default,
|
|
5989
|
-
[4
|
|
5990
|
-
/* ButtonType.destructive */
|
|
5991
|
-
]: 'none',
|
|
5992
|
-
[8
|
|
5993
|
-
/* ButtonType.outline */
|
|
5994
|
-
]: 'none',
|
|
5995
|
-
[16
|
|
5996
|
-
/* ButtonType.plain */
|
|
5997
|
-
]: 'none',
|
|
5998
|
-
[32
|
|
5999
|
-
/* ButtonType.subtle */
|
|
6000
|
-
]: 'none',
|
|
6001
|
-
[48
|
|
6002
|
-
/* ButtonType.plainSubtle */
|
|
6003
|
-
]: 'none'
|
|
5760
|
+
[1 /* ButtonType.basic */]: Actions.Secondary.Default,
|
|
5761
|
+
[2 /* ButtonType.primary */]: Actions.Primary.Default,
|
|
5762
|
+
[6 /* ButtonType.destructivePrimary */]: Actions.Critical.Default,
|
|
5763
|
+
[4 /* ButtonType.destructive */]: 'none',
|
|
5764
|
+
[8 /* ButtonType.outline */]: 'none',
|
|
5765
|
+
[16 /* ButtonType.plain */]: 'none',
|
|
5766
|
+
[32 /* ButtonType.subtle */]: 'none',
|
|
5767
|
+
[48 /* ButtonType.plainSubtle */]: 'none'
|
|
6004
5768
|
};
|
|
6005
5769
|
const ButtonBackgroundColorDisabledValues = {
|
|
6006
|
-
[1
|
|
6007
|
-
/* ButtonType.
|
|
6008
|
-
]: Actions.
|
|
6009
|
-
[
|
|
6010
|
-
/* ButtonType.
|
|
6011
|
-
]:
|
|
6012
|
-
[
|
|
6013
|
-
/* ButtonType.
|
|
6014
|
-
]: Actions.Critical.Disabled,
|
|
6015
|
-
[4
|
|
6016
|
-
/* ButtonType.destructive */
|
|
6017
|
-
]: Actions.Secondary.Disabled,
|
|
6018
|
-
[8
|
|
6019
|
-
/* ButtonType.outline */
|
|
6020
|
-
]: 'none',
|
|
6021
|
-
[16
|
|
6022
|
-
/* ButtonType.plain */
|
|
6023
|
-
]: 'none',
|
|
6024
|
-
[32
|
|
6025
|
-
/* ButtonType.subtle */
|
|
6026
|
-
]: Actions.Secondary.Disabled,
|
|
6027
|
-
[48
|
|
6028
|
-
/* ButtonType.plainSubtle */
|
|
6029
|
-
]: 'none'
|
|
5770
|
+
[1 /* ButtonType.basic */]: Actions.Secondary.Disabled,
|
|
5771
|
+
[2 /* ButtonType.primary */]: Actions.Primary.Disabled,
|
|
5772
|
+
[6 /* ButtonType.destructivePrimary */]: Actions.Critical.Disabled,
|
|
5773
|
+
[4 /* ButtonType.destructive */]: Actions.Secondary.Disabled,
|
|
5774
|
+
[8 /* ButtonType.outline */]: 'none',
|
|
5775
|
+
[16 /* ButtonType.plain */]: 'none',
|
|
5776
|
+
[32 /* ButtonType.subtle */]: Actions.Secondary.Disabled,
|
|
5777
|
+
[48 /* ButtonType.plainSubtle */]: 'none'
|
|
6030
5778
|
};
|
|
6031
5779
|
const ButtonBackgroundColorHoverValues = {
|
|
6032
|
-
[1
|
|
6033
|
-
/* ButtonType.
|
|
6034
|
-
]: Actions.
|
|
6035
|
-
[
|
|
6036
|
-
/* ButtonType.
|
|
6037
|
-
]:
|
|
6038
|
-
[
|
|
6039
|
-
/* ButtonType.
|
|
6040
|
-
]: Actions.Critical.Hover,
|
|
6041
|
-
[4
|
|
6042
|
-
/* ButtonType.destructive */
|
|
6043
|
-
]: Actions.Critical.Hover,
|
|
6044
|
-
[8
|
|
6045
|
-
/* ButtonType.outline */
|
|
6046
|
-
]: Actions.Secondary.Hover,
|
|
6047
|
-
[16
|
|
6048
|
-
/* ButtonType.plain */
|
|
6049
|
-
]: '',
|
|
6050
|
-
[32
|
|
6051
|
-
/* ButtonType.subtle */
|
|
6052
|
-
]: Actions.Secondary.Hover,
|
|
6053
|
-
[48
|
|
6054
|
-
/* ButtonType.plainSubtle */
|
|
6055
|
-
]: ''
|
|
5780
|
+
[1 /* ButtonType.basic */]: Actions.Secondary.Hover,
|
|
5781
|
+
[2 /* ButtonType.primary */]: Actions.Primary.Hover,
|
|
5782
|
+
[6 /* ButtonType.destructivePrimary */]: Actions.Critical.Hover,
|
|
5783
|
+
[4 /* ButtonType.destructive */]: Actions.Critical.Hover,
|
|
5784
|
+
[8 /* ButtonType.outline */]: Actions.Secondary.Hover,
|
|
5785
|
+
[16 /* ButtonType.plain */]: '',
|
|
5786
|
+
[32 /* ButtonType.subtle */]: Actions.Secondary.Hover,
|
|
5787
|
+
[48 /* ButtonType.plainSubtle */]: ''
|
|
6056
5788
|
};
|
|
6057
5789
|
const ButtonTextDecorationHoverValues = {
|
|
6058
|
-
[1
|
|
6059
|
-
/* ButtonType.
|
|
6060
|
-
]: '',
|
|
6061
|
-
[
|
|
6062
|
-
/* ButtonType.
|
|
6063
|
-
]: '',
|
|
6064
|
-
[
|
|
6065
|
-
/* ButtonType.
|
|
6066
|
-
]: '',
|
|
6067
|
-
[4
|
|
6068
|
-
/* ButtonType.destructive */
|
|
6069
|
-
]: '',
|
|
6070
|
-
[8
|
|
6071
|
-
/* ButtonType.outline */
|
|
6072
|
-
]: '',
|
|
6073
|
-
[16
|
|
6074
|
-
/* ButtonType.plain */
|
|
6075
|
-
]: 'underline',
|
|
6076
|
-
[32
|
|
6077
|
-
/* ButtonType.subtle */
|
|
6078
|
-
]: '',
|
|
6079
|
-
[48
|
|
6080
|
-
/* ButtonType.plainSubtle */
|
|
6081
|
-
]: 'underline'
|
|
5790
|
+
[1 /* ButtonType.basic */]: '',
|
|
5791
|
+
[2 /* ButtonType.primary */]: '',
|
|
5792
|
+
[6 /* ButtonType.destructivePrimary */]: '',
|
|
5793
|
+
[4 /* ButtonType.destructive */]: '',
|
|
5794
|
+
[8 /* ButtonType.outline */]: '',
|
|
5795
|
+
[16 /* ButtonType.plain */]: 'underline',
|
|
5796
|
+
[32 /* ButtonType.subtle */]: '',
|
|
5797
|
+
[48 /* ButtonType.plainSubtle */]: 'underline'
|
|
6082
5798
|
};
|
|
6083
5799
|
const ButtonBackgroundColorPressedValues = {
|
|
6084
|
-
[1
|
|
6085
|
-
/* ButtonType.
|
|
6086
|
-
]: Actions.
|
|
6087
|
-
[
|
|
6088
|
-
/* ButtonType.
|
|
6089
|
-
]: Actions.
|
|
6090
|
-
[
|
|
6091
|
-
/* ButtonType.
|
|
6092
|
-
]: Actions.Critical.Pressed,
|
|
6093
|
-
[4
|
|
6094
|
-
/* ButtonType.destructive */
|
|
6095
|
-
]: Actions.Critical.Pressed,
|
|
6096
|
-
[8
|
|
6097
|
-
/* ButtonType.outline */
|
|
6098
|
-
]: Actions.Secondary.Pressed,
|
|
6099
|
-
[16
|
|
6100
|
-
/* ButtonType.plain */
|
|
6101
|
-
]: Actions.Secondary.Hover,
|
|
6102
|
-
[32
|
|
6103
|
-
/* ButtonType.subtle */
|
|
6104
|
-
]: Actions.Secondary.Pressed,
|
|
6105
|
-
[48
|
|
6106
|
-
/* ButtonType.plainSubtle */
|
|
6107
|
-
]: Actions.Secondary.Hover
|
|
5800
|
+
[1 /* ButtonType.basic */]: Actions.Secondary.Pressed,
|
|
5801
|
+
[2 /* ButtonType.primary */]: Actions.Primary.Pressed,
|
|
5802
|
+
[6 /* ButtonType.destructivePrimary */]: Actions.Critical.Pressed,
|
|
5803
|
+
[4 /* ButtonType.destructive */]: Actions.Critical.Pressed,
|
|
5804
|
+
[8 /* ButtonType.outline */]: Actions.Secondary.Pressed,
|
|
5805
|
+
[16 /* ButtonType.plain */]: Actions.Secondary.Hover,
|
|
5806
|
+
[32 /* ButtonType.subtle */]: Actions.Secondary.Pressed,
|
|
5807
|
+
[48 /* ButtonType.plainSubtle */]: Actions.Secondary.Hover
|
|
6108
5808
|
};
|
|
6109
5809
|
const ButtonTextColorValues = {
|
|
6110
|
-
[1
|
|
6111
|
-
/* ButtonType.
|
|
6112
|
-
]: Text$1.
|
|
6113
|
-
[
|
|
6114
|
-
/* ButtonType.
|
|
6115
|
-
]:
|
|
6116
|
-
[
|
|
6117
|
-
/* ButtonType.
|
|
6118
|
-
]: Text$1.OnCritical,
|
|
6119
|
-
[4
|
|
6120
|
-
/* ButtonType.destructive */
|
|
6121
|
-
]: Text$1.Default,
|
|
6122
|
-
[8
|
|
6123
|
-
/* ButtonType.outline */
|
|
6124
|
-
]: Text$1.Default,
|
|
6125
|
-
[16
|
|
6126
|
-
/* ButtonType.plain */
|
|
6127
|
-
]: Interactive.Default.Default,
|
|
6128
|
-
[32
|
|
6129
|
-
/* ButtonType.subtle */
|
|
6130
|
-
]: Text$1.Default,
|
|
6131
|
-
[48
|
|
6132
|
-
/* ButtonType.plainSubtle */
|
|
6133
|
-
]: Interactive.Subtle.Default
|
|
5810
|
+
[1 /* ButtonType.basic */]: Text$1.Default,
|
|
5811
|
+
[2 /* ButtonType.primary */]: Text$1.OnPrimary,
|
|
5812
|
+
[6 /* ButtonType.destructivePrimary */]: Text$1.OnCritical,
|
|
5813
|
+
[4 /* ButtonType.destructive */]: Text$1.Default,
|
|
5814
|
+
[8 /* ButtonType.outline */]: Text$1.Default,
|
|
5815
|
+
[16 /* ButtonType.plain */]: Interactive.Default.Default,
|
|
5816
|
+
[32 /* ButtonType.subtle */]: Text$1.Default,
|
|
5817
|
+
[48 /* ButtonType.plainSubtle */]: Interactive.Subtle.Default
|
|
6134
5818
|
};
|
|
6135
5819
|
const IconTextColorValues = {
|
|
6136
|
-
[1
|
|
6137
|
-
/* ButtonType.
|
|
6138
|
-
]: Icons.
|
|
6139
|
-
[
|
|
6140
|
-
/* ButtonType.
|
|
6141
|
-
]:
|
|
6142
|
-
[
|
|
6143
|
-
/* ButtonType.
|
|
6144
|
-
]: Icons.OnCritical,
|
|
6145
|
-
[4
|
|
6146
|
-
/* ButtonType.destructive */
|
|
6147
|
-
]: Icons.Default,
|
|
6148
|
-
[8
|
|
6149
|
-
/* ButtonType.outline */
|
|
6150
|
-
]: Icons.Default,
|
|
6151
|
-
[16
|
|
6152
|
-
/* ButtonType.plain */
|
|
6153
|
-
]: Interactive.Default.Default,
|
|
6154
|
-
[32
|
|
6155
|
-
/* ButtonType.subtle */
|
|
6156
|
-
]: Icons.Default,
|
|
6157
|
-
[48
|
|
6158
|
-
/* ButtonType.plainSubtle */
|
|
6159
|
-
]: Icons.Default
|
|
5820
|
+
[1 /* ButtonType.basic */]: Icons.Default,
|
|
5821
|
+
[2 /* ButtonType.primary */]: Icons.OnPrimary,
|
|
5822
|
+
[6 /* ButtonType.destructivePrimary */]: Icons.OnCritical,
|
|
5823
|
+
[4 /* ButtonType.destructive */]: Icons.Default,
|
|
5824
|
+
[8 /* ButtonType.outline */]: Icons.Default,
|
|
5825
|
+
[16 /* ButtonType.plain */]: Interactive.Default.Default,
|
|
5826
|
+
[32 /* ButtonType.subtle */]: Icons.Default,
|
|
5827
|
+
[48 /* ButtonType.plainSubtle */]: Icons.Default
|
|
6160
5828
|
};
|
|
6161
5829
|
const ButtonTextColorHoverValues = {
|
|
6162
|
-
[1
|
|
6163
|
-
/* ButtonType.
|
|
6164
|
-
]: Text$1.
|
|
6165
|
-
[
|
|
6166
|
-
/* ButtonType.
|
|
6167
|
-
]:
|
|
6168
|
-
[
|
|
6169
|
-
/* ButtonType.
|
|
6170
|
-
]: Text$1.OnCritical,
|
|
6171
|
-
[4
|
|
6172
|
-
/* ButtonType.destructive */
|
|
6173
|
-
]: Text$1.OnCritical,
|
|
6174
|
-
[8
|
|
6175
|
-
/* ButtonType.outline */
|
|
6176
|
-
]: Text$1.Default,
|
|
6177
|
-
[16
|
|
6178
|
-
/* ButtonType.plain */
|
|
6179
|
-
]: Interactive.Default.Hover,
|
|
6180
|
-
[32
|
|
6181
|
-
/* ButtonType.subtle */
|
|
6182
|
-
]: Text$1.Default,
|
|
6183
|
-
[48
|
|
6184
|
-
/* ButtonType.plainSubtle */
|
|
6185
|
-
]: Interactive.Subtle.Hover
|
|
5830
|
+
[1 /* ButtonType.basic */]: Text$1.Default,
|
|
5831
|
+
[2 /* ButtonType.primary */]: Text$1.OnPrimary,
|
|
5832
|
+
[6 /* ButtonType.destructivePrimary */]: Text$1.OnCritical,
|
|
5833
|
+
[4 /* ButtonType.destructive */]: Text$1.OnCritical,
|
|
5834
|
+
[8 /* ButtonType.outline */]: Text$1.Default,
|
|
5835
|
+
[16 /* ButtonType.plain */]: Interactive.Default.Hover,
|
|
5836
|
+
[32 /* ButtonType.subtle */]: Text$1.Default,
|
|
5837
|
+
[48 /* ButtonType.plainSubtle */]: Interactive.Subtle.Hover
|
|
6186
5838
|
};
|
|
6187
5839
|
const IconColorHoverValues = {
|
|
6188
|
-
[1
|
|
6189
|
-
/* ButtonType.
|
|
6190
|
-
]: Icons.
|
|
6191
|
-
[
|
|
6192
|
-
/* ButtonType.
|
|
6193
|
-
]:
|
|
6194
|
-
[
|
|
6195
|
-
/* ButtonType.
|
|
6196
|
-
]: Icons.OnCritical,
|
|
6197
|
-
[4
|
|
6198
|
-
/* ButtonType.destructive */
|
|
6199
|
-
]: Icons.OnCritical,
|
|
6200
|
-
[8
|
|
6201
|
-
/* ButtonType.outline */
|
|
6202
|
-
]: Icons.Default,
|
|
6203
|
-
[16
|
|
6204
|
-
/* ButtonType.plain */
|
|
6205
|
-
]: Interactive.Default.Hover,
|
|
6206
|
-
[32
|
|
6207
|
-
/* ButtonType.subtle */
|
|
6208
|
-
]: Icons.Default,
|
|
6209
|
-
[48
|
|
6210
|
-
/* ButtonType.plainSubtle */
|
|
6211
|
-
]: Interactive.Subtle.Hover
|
|
5840
|
+
[1 /* ButtonType.basic */]: Icons.Default,
|
|
5841
|
+
[2 /* ButtonType.primary */]: Icons.OnPrimary,
|
|
5842
|
+
[6 /* ButtonType.destructivePrimary */]: Icons.OnCritical,
|
|
5843
|
+
[4 /* ButtonType.destructive */]: Icons.OnCritical,
|
|
5844
|
+
[8 /* ButtonType.outline */]: Icons.Default,
|
|
5845
|
+
[16 /* ButtonType.plain */]: Interactive.Default.Hover,
|
|
5846
|
+
[32 /* ButtonType.subtle */]: Icons.Default,
|
|
5847
|
+
[48 /* ButtonType.plainSubtle */]: Interactive.Subtle.Hover
|
|
6212
5848
|
};
|
|
6213
5849
|
const ButtonBorderValues = {
|
|
6214
|
-
[1
|
|
6215
|
-
/* ButtonType.
|
|
6216
|
-
]:
|
|
6217
|
-
[
|
|
6218
|
-
/* ButtonType.
|
|
6219
|
-
]: 'none',
|
|
6220
|
-
[
|
|
6221
|
-
/* ButtonType.
|
|
6222
|
-
]: 'none',
|
|
6223
|
-
[4
|
|
6224
|
-
/* ButtonType.destructive */
|
|
6225
|
-
]: `1px solid ${Borders.Default.Default}`,
|
|
6226
|
-
[8
|
|
6227
|
-
/* ButtonType.outline */
|
|
6228
|
-
]: `1px solid ${Borders.Default.Default}`,
|
|
6229
|
-
[16
|
|
6230
|
-
/* ButtonType.plain */
|
|
6231
|
-
]: 'none',
|
|
6232
|
-
[32
|
|
6233
|
-
/* ButtonType.subtle */
|
|
6234
|
-
]: `1px solid ${Borders.Default.Default}`,
|
|
6235
|
-
[48
|
|
6236
|
-
/* ButtonType.plainSubtle */
|
|
6237
|
-
]: 'none'
|
|
5850
|
+
[1 /* ButtonType.basic */]: `1px solid ${Borders.Default.Default}`,
|
|
5851
|
+
[2 /* ButtonType.primary */]: 'none',
|
|
5852
|
+
[6 /* ButtonType.destructivePrimary */]: 'none',
|
|
5853
|
+
[4 /* ButtonType.destructive */]: `1px solid ${Borders.Default.Default}`,
|
|
5854
|
+
[8 /* ButtonType.outline */]: `1px solid ${Borders.Default.Default}`,
|
|
5855
|
+
[16 /* ButtonType.plain */]: 'none',
|
|
5856
|
+
[32 /* ButtonType.subtle */]: `1px solid ${Borders.Default.Default}`,
|
|
5857
|
+
[48 /* ButtonType.plainSubtle */]: 'none'
|
|
6238
5858
|
};
|
|
6239
5859
|
const ButtonBorderDisabledValues = {
|
|
6240
|
-
[1
|
|
6241
|
-
/* ButtonType.
|
|
6242
|
-
]:
|
|
6243
|
-
[
|
|
6244
|
-
/* ButtonType.
|
|
6245
|
-
]: 'none',
|
|
6246
|
-
[
|
|
6247
|
-
/* ButtonType.
|
|
6248
|
-
]: 'none',
|
|
6249
|
-
[4
|
|
6250
|
-
/* ButtonType.destructive */
|
|
6251
|
-
]: `1px solid ${Borders.Default.Subdued}`,
|
|
6252
|
-
[8
|
|
6253
|
-
/* ButtonType.outline */
|
|
6254
|
-
]: `1px solid ${Borders.Default.Default}`,
|
|
6255
|
-
[16
|
|
6256
|
-
/* ButtonType.plain */
|
|
6257
|
-
]: 'none',
|
|
6258
|
-
[32
|
|
6259
|
-
/* ButtonType.subtle */
|
|
6260
|
-
]: `1px solid ${Borders.Default.Subdued}`,
|
|
6261
|
-
[48
|
|
6262
|
-
/* ButtonType.plainSubtle */
|
|
6263
|
-
]: 'none'
|
|
5860
|
+
[1 /* ButtonType.basic */]: `1px solid ${Borders.Default.Subdued}`,
|
|
5861
|
+
[2 /* ButtonType.primary */]: 'none',
|
|
5862
|
+
[6 /* ButtonType.destructivePrimary */]: 'none',
|
|
5863
|
+
[4 /* ButtonType.destructive */]: `1px solid ${Borders.Default.Subdued}`,
|
|
5864
|
+
[8 /* ButtonType.outline */]: `1px solid ${Borders.Default.Default}`,
|
|
5865
|
+
[16 /* ButtonType.plain */]: 'none',
|
|
5866
|
+
[32 /* ButtonType.subtle */]: `1px solid ${Borders.Default.Subdued}`,
|
|
5867
|
+
[48 /* ButtonType.plainSubtle */]: 'none'
|
|
6264
5868
|
};
|
|
6265
5869
|
const ButtonTextColorDisabled = {
|
|
6266
|
-
[1
|
|
6267
|
-
/* ButtonDisabledType.
|
|
6268
|
-
]: '',
|
|
6269
|
-
[2
|
|
6270
|
-
/* ButtonDisabledType.disabled */
|
|
6271
|
-
]: Text$1.Light
|
|
5870
|
+
[1 /* ButtonDisabledType.enabled */]: '',
|
|
5871
|
+
[2 /* ButtonDisabledType.disabled */]: Text$1.Light
|
|
6272
5872
|
};
|
|
6273
5873
|
const ButtonCursor = {
|
|
6274
|
-
[1
|
|
6275
|
-
/* ButtonDisabledType.
|
|
6276
|
-
]: 'pointer',
|
|
6277
|
-
[2
|
|
6278
|
-
/* ButtonDisabledType.disabled */
|
|
6279
|
-
]: 'not-allowed'
|
|
5874
|
+
[1 /* ButtonDisabledType.enabled */]: 'pointer',
|
|
5875
|
+
[2 /* ButtonDisabledType.disabled */]: 'not-allowed'
|
|
6280
5876
|
};
|
|
6281
5877
|
const ButtonSizeValues = {
|
|
6282
|
-
[2
|
|
6283
|
-
/* ButtonSize.
|
|
6284
|
-
]: `${Padding.
|
|
6285
|
-
[1
|
|
6286
|
-
/* ButtonSize.default */
|
|
6287
|
-
]: `${Padding.xs} ${Padding.m}`,
|
|
6288
|
-
[4
|
|
6289
|
-
/* ButtonSize.large */
|
|
6290
|
-
]: `${Padding.s} ${Padding.l}`
|
|
5878
|
+
[2 /* ButtonSize.small */]: `${Padding.xxs} ${Padding.s}`,
|
|
5879
|
+
[1 /* ButtonSize.default */]: `${Padding.xs} ${Padding.m}`,
|
|
5880
|
+
[4 /* ButtonSize.large */]: `${Padding.s} ${Padding.l}`
|
|
6291
5881
|
};
|
|
6292
5882
|
const ButtonSizeValuesByType = {
|
|
6293
|
-
[1
|
|
6294
|
-
/* ButtonType.
|
|
6295
|
-
]: '',
|
|
6296
|
-
[
|
|
6297
|
-
/* ButtonType.
|
|
6298
|
-
]:
|
|
6299
|
-
[
|
|
6300
|
-
/* ButtonType.
|
|
6301
|
-
]: '',
|
|
6302
|
-
[4
|
|
6303
|
-
/* ButtonType.destructive */
|
|
6304
|
-
]: '',
|
|
6305
|
-
[8
|
|
6306
|
-
/* ButtonType.outline */
|
|
6307
|
-
]: '',
|
|
6308
|
-
[16
|
|
6309
|
-
/* ButtonType.plain */
|
|
6310
|
-
]: `${Padding.xxxs} ${Padding.xxs}`,
|
|
6311
|
-
[32
|
|
6312
|
-
/* ButtonType.subtle */
|
|
6313
|
-
]: '',
|
|
6314
|
-
[48
|
|
6315
|
-
/* ButtonType.plainSubtle */
|
|
6316
|
-
]: `${Padding.xxxs} ${Padding.xxs}`
|
|
5883
|
+
[1 /* ButtonType.basic */]: '',
|
|
5884
|
+
[2 /* ButtonType.primary */]: '',
|
|
5885
|
+
[6 /* ButtonType.destructivePrimary */]: '',
|
|
5886
|
+
[4 /* ButtonType.destructive */]: '',
|
|
5887
|
+
[8 /* ButtonType.outline */]: '',
|
|
5888
|
+
[16 /* ButtonType.plain */]: `${Padding.xxxs} ${Padding.xxs}`,
|
|
5889
|
+
[32 /* ButtonType.subtle */]: '',
|
|
5890
|
+
[48 /* ButtonType.plainSubtle */]: `${Padding.xxxs} ${Padding.xxs}`
|
|
6317
5891
|
};
|
|
6318
5892
|
const ButtonTypeValues = {
|
|
6319
|
-
[1
|
|
6320
|
-
/* ButtonType.
|
|
6321
|
-
]:
|
|
6322
|
-
[
|
|
6323
|
-
/* ButtonType.
|
|
6324
|
-
]:
|
|
6325
|
-
[
|
|
6326
|
-
/* ButtonType.
|
|
6327
|
-
]: 4,
|
|
6328
|
-
[6
|
|
6329
|
-
/* ButtonType.destructivePrimary */
|
|
6330
|
-
]: 6,
|
|
6331
|
-
[8
|
|
6332
|
-
/* ButtonType.outline */
|
|
6333
|
-
]: 8,
|
|
6334
|
-
[16
|
|
6335
|
-
/* ButtonType.plain */
|
|
6336
|
-
]: 16,
|
|
6337
|
-
[32
|
|
6338
|
-
/* ButtonType.subtle */
|
|
6339
|
-
]: 32,
|
|
6340
|
-
[48
|
|
6341
|
-
/* ButtonType.plainSubtle */
|
|
6342
|
-
]: 48
|
|
5893
|
+
[1 /* ButtonType.basic */]: 1,
|
|
5894
|
+
[2 /* ButtonType.primary */]: 2,
|
|
5895
|
+
[4 /* ButtonType.destructive */]: 4,
|
|
5896
|
+
[6 /* ButtonType.destructivePrimary */]: 6,
|
|
5897
|
+
[8 /* ButtonType.outline */]: 8,
|
|
5898
|
+
[16 /* ButtonType.plain */]: 16,
|
|
5899
|
+
[32 /* ButtonType.subtle */]: 32,
|
|
5900
|
+
[48 /* ButtonType.plainSubtle */]: 48
|
|
6343
5901
|
};
|
|
6344
5902
|
function getBackgroundColorByType(type) {
|
|
6345
5903
|
return ButtonBackgroundColorValues[type];
|
|
@@ -6387,30 +5945,27 @@ function getCursor(props) {
|
|
|
6387
5945
|
return ButtonCursor[toButtonDisabledType(bitwiseOr$1([props.enabled, props.disabled]))];
|
|
6388
5946
|
}
|
|
6389
5947
|
function getIsDisabled(props) {
|
|
6390
|
-
return toButtonDisabledType(bitwiseOr$1([props.enabled, props.disabled])) === 2
|
|
6391
|
-
/* ButtonDisabledType.disabled */
|
|
6392
|
-
;
|
|
5948
|
+
return toButtonDisabledType(bitwiseOr$1([props.enabled, props.disabled])) === 2 /* ButtonDisabledType.disabled */;
|
|
6393
5949
|
}
|
|
5950
|
+
|
|
6394
5951
|
function getButtonType(props) {
|
|
6395
5952
|
return ButtonTypeValues[toButtonTypes(bitwiseOr$1([props.basic, props.primary, props.destructive, props.outline, props.plain, props.subtle]))];
|
|
6396
5953
|
}
|
|
6397
5954
|
|
|
6398
5955
|
function toTransientProps(props) {
|
|
6399
5956
|
const {
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
5957
|
+
onCritical,
|
|
5958
|
+
onPrimary,
|
|
5959
|
+
emphasis,
|
|
5960
|
+
children
|
|
5961
|
+
} = props,
|
|
5962
|
+
rest = __rest(props, ["onCritical", "onPrimary", "emphasis", "children"]);
|
|
6407
5963
|
return Object.assign(Object.assign({}, rest), {
|
|
6408
5964
|
$onCritical: onCritical,
|
|
6409
5965
|
$onPrimary: onPrimary,
|
|
6410
5966
|
$emphasis: emphasis
|
|
6411
5967
|
});
|
|
6412
5968
|
}
|
|
6413
|
-
|
|
6414
5969
|
const DISPLAY = /*#__PURE__*/styled.div.withConfig({
|
|
6415
5970
|
displayName: "typography__DISPLAY",
|
|
6416
5971
|
componentId: "sc-5x0jko-0"
|
|
@@ -6495,44 +6050,21 @@ const Label$1 = props => {
|
|
|
6495
6050
|
|
|
6496
6051
|
function toSpinner(n) {
|
|
6497
6052
|
switch (n) {
|
|
6498
|
-
case 1
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
return
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
case 2
|
|
6506
|
-
/* SpinnerSize.medium */
|
|
6507
|
-
:
|
|
6508
|
-
return 2
|
|
6509
|
-
/* SpinnerSize.medium */
|
|
6510
|
-
;
|
|
6511
|
-
|
|
6512
|
-
case 4
|
|
6513
|
-
/* SpinnerSize.large */
|
|
6514
|
-
:
|
|
6515
|
-
return 4
|
|
6516
|
-
/* SpinnerSize.large */
|
|
6517
|
-
;
|
|
6518
|
-
|
|
6053
|
+
case 1 /* SpinnerSize.small */:
|
|
6054
|
+
return 1 /* SpinnerSize.small */;
|
|
6055
|
+
case 2 /* SpinnerSize.medium */:
|
|
6056
|
+
return 2 /* SpinnerSize.medium */;
|
|
6057
|
+
case 4 /* SpinnerSize.large */:
|
|
6058
|
+
return 4 /* SpinnerSize.large */;
|
|
6519
6059
|
default:
|
|
6520
|
-
return 2
|
|
6521
|
-
/* SpinnerSize.medium */
|
|
6522
|
-
;
|
|
6060
|
+
return 2 /* SpinnerSize.medium */;
|
|
6523
6061
|
}
|
|
6524
6062
|
}
|
|
6525
6063
|
|
|
6526
6064
|
const SpinnerValues = {
|
|
6527
|
-
[1
|
|
6528
|
-
/* SpinnerSize.
|
|
6529
|
-
]: '
|
|
6530
|
-
[2
|
|
6531
|
-
/* SpinnerSize.medium */
|
|
6532
|
-
]: '40px',
|
|
6533
|
-
[4
|
|
6534
|
-
/* SpinnerSize.large */
|
|
6535
|
-
]: '60px'
|
|
6065
|
+
[1 /* SpinnerSize.small */]: '18px',
|
|
6066
|
+
[2 /* SpinnerSize.medium */]: '40px',
|
|
6067
|
+
[4 /* SpinnerSize.large */]: '60px'
|
|
6536
6068
|
};
|
|
6537
6069
|
function getValuesBySize$3(props) {
|
|
6538
6070
|
return SpinnerValues[toSpinner(bitwiseOr$1([props.small, props.medium, props.large]))];
|
|
@@ -6580,7 +6112,6 @@ const Loading = /*#__PURE__*/styled(Spinner).withConfig({
|
|
|
6580
6112
|
displayName: "button__Loading",
|
|
6581
6113
|
componentId: "v4884z-3"
|
|
6582
6114
|
})(["position:absolute;"]);
|
|
6583
|
-
|
|
6584
6115
|
function makeButtonConfig(props) {
|
|
6585
6116
|
const buttonType = getButtonType(props);
|
|
6586
6117
|
const isDisabled = getIsDisabled(props);
|
|
@@ -6615,25 +6146,22 @@ function makeButtonConfig(props) {
|
|
|
6615
6146
|
buttonType
|
|
6616
6147
|
};
|
|
6617
6148
|
}
|
|
6618
|
-
|
|
6619
6149
|
const Button = props => {
|
|
6620
6150
|
const {
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6151
|
+
children,
|
|
6152
|
+
loading,
|
|
6153
|
+
IconPrefix,
|
|
6154
|
+
IconSuffix,
|
|
6155
|
+
type = 'button'
|
|
6156
|
+
} = props,
|
|
6157
|
+
htmlProps = __rest(props, ["children", "loading", "IconPrefix", "IconSuffix", "type"]);
|
|
6629
6158
|
const _a = makeButtonConfig(props),
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6159
|
+
{
|
|
6160
|
+
textColor,
|
|
6161
|
+
textColorDisabled,
|
|
6162
|
+
buttonType
|
|
6163
|
+
} = _a,
|
|
6164
|
+
buttonConfig = __rest(_a, ["textColor", "textColorDisabled", "buttonType"]);
|
|
6637
6165
|
return jsxs(ButtonFrame, Object.assign({}, htmlProps, {
|
|
6638
6166
|
type: type
|
|
6639
6167
|
}, buttonConfig, {
|
|
@@ -6653,11 +6181,7 @@ const Button = props => {
|
|
|
6653
6181
|
children: children
|
|
6654
6182
|
})), is(loading) ? jsx(Loading, {
|
|
6655
6183
|
small: true,
|
|
6656
|
-
onPrimary: buttonType === 2
|
|
6657
|
-
/* ButtonType.primary */
|
|
6658
|
-
|| buttonType === 6
|
|
6659
|
-
/* ButtonType.destructivePrimary */
|
|
6660
|
-
|
|
6184
|
+
onPrimary: buttonType === 2 /* ButtonType.primary */ || buttonType === 6 /* ButtonType.destructivePrimary */
|
|
6661
6185
|
}) : '', isDefined(IconSuffix) ? jsx(IconContainer$1, Object.assign({
|
|
6662
6186
|
isLoading: is(loading)
|
|
6663
6187
|
}, {
|
|
@@ -6708,15 +6232,12 @@ const AlertBanner = props => {
|
|
|
6708
6232
|
icon: LevelIcon,
|
|
6709
6233
|
color: iconColor
|
|
6710
6234
|
} = getIcon(props);
|
|
6711
|
-
|
|
6712
6235
|
const handleClose = () => {
|
|
6713
6236
|
safeCallback(onClose);
|
|
6714
6237
|
};
|
|
6715
|
-
|
|
6716
6238
|
if (!is(open)) {
|
|
6717
6239
|
return jsx(Nothing, {});
|
|
6718
6240
|
}
|
|
6719
|
-
|
|
6720
6241
|
return jsxs(InCardFrame, Object.assign({
|
|
6721
6242
|
role: "alert",
|
|
6722
6243
|
background: background,
|
|
@@ -6753,70 +6274,31 @@ const AlertBanner = props => {
|
|
|
6753
6274
|
|
|
6754
6275
|
function toBadgeType(n) {
|
|
6755
6276
|
switch (n) {
|
|
6756
|
-
case 1
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
return
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
/* BadgeType.
|
|
6765
|
-
|
|
6766
|
-
return 2
|
|
6767
|
-
/* BadgeType.info */
|
|
6768
|
-
;
|
|
6769
|
-
|
|
6770
|
-
case 4
|
|
6771
|
-
/* BadgeType.success */
|
|
6772
|
-
:
|
|
6773
|
-
return 4
|
|
6774
|
-
/* BadgeType.success */
|
|
6775
|
-
;
|
|
6776
|
-
|
|
6777
|
-
case 8
|
|
6778
|
-
/* BadgeType.warning */
|
|
6779
|
-
:
|
|
6780
|
-
return 8
|
|
6781
|
-
/* BadgeType.warning */
|
|
6782
|
-
;
|
|
6783
|
-
|
|
6784
|
-
case 16
|
|
6785
|
-
/* BadgeType.critical */
|
|
6786
|
-
:
|
|
6787
|
-
return 16
|
|
6788
|
-
/* BadgeType.critical */
|
|
6789
|
-
;
|
|
6790
|
-
|
|
6277
|
+
case 1 /* BadgeType.neutral */:
|
|
6278
|
+
return 1 /* BadgeType.neutral */;
|
|
6279
|
+
case 2 /* BadgeType.info */:
|
|
6280
|
+
return 2 /* BadgeType.info */;
|
|
6281
|
+
case 4 /* BadgeType.success */:
|
|
6282
|
+
return 4 /* BadgeType.success */;
|
|
6283
|
+
case 8 /* BadgeType.warning */:
|
|
6284
|
+
return 8 /* BadgeType.warning */;
|
|
6285
|
+
case 16 /* BadgeType.critical */:
|
|
6286
|
+
return 16 /* BadgeType.critical */;
|
|
6791
6287
|
default:
|
|
6792
|
-
return 1
|
|
6793
|
-
/* BadgeType.neutral */
|
|
6794
|
-
;
|
|
6288
|
+
return 1 /* BadgeType.neutral */;
|
|
6795
6289
|
}
|
|
6796
6290
|
}
|
|
6797
6291
|
|
|
6798
6292
|
const BadgeTypeColors = {
|
|
6799
|
-
[1
|
|
6800
|
-
/* BadgeType.
|
|
6801
|
-
]: Surface.
|
|
6802
|
-
[
|
|
6803
|
-
/* BadgeType.
|
|
6804
|
-
]: Surface.Highlight.Default,
|
|
6805
|
-
[4
|
|
6806
|
-
/* BadgeType.success */
|
|
6807
|
-
]: Surface.Success.Default,
|
|
6808
|
-
[8
|
|
6809
|
-
/* BadgeType.warning */
|
|
6810
|
-
]: Surface.Warning.Default,
|
|
6811
|
-
[16
|
|
6812
|
-
/* BadgeType.critical */
|
|
6813
|
-
]: Surface.Critical.Default
|
|
6293
|
+
[1 /* BadgeType.neutral */]: Surface.Neutral.Default,
|
|
6294
|
+
[2 /* BadgeType.info */]: Surface.Highlight.Default,
|
|
6295
|
+
[4 /* BadgeType.success */]: Surface.Success.Default,
|
|
6296
|
+
[8 /* BadgeType.warning */]: Surface.Warning.Default,
|
|
6297
|
+
[16 /* BadgeType.critical */]: Surface.Critical.Default
|
|
6814
6298
|
};
|
|
6815
|
-
|
|
6816
6299
|
function bitwiseOr(flags) {
|
|
6817
6300
|
return flags.reduce((mask, flag, i) => mask | Number(flag) << i, 0);
|
|
6818
6301
|
}
|
|
6819
|
-
|
|
6820
6302
|
function getColor$1(props) {
|
|
6821
6303
|
return BadgeTypeColors[toBadgeType(bitwiseOr([props.neutral, props.info, props.success, props.warning, props.critical]))];
|
|
6822
6304
|
}
|
|
@@ -6868,13 +6350,11 @@ function leftRightLayoutGenerator(layoutProps = {}) {
|
|
|
6868
6350
|
})([""]),
|
|
6869
6351
|
BodyText: Body
|
|
6870
6352
|
};
|
|
6871
|
-
|
|
6872
6353
|
const Layout = props => {
|
|
6873
6354
|
return jsx(LayoutFrame, {
|
|
6874
6355
|
children: props.children
|
|
6875
6356
|
});
|
|
6876
6357
|
};
|
|
6877
|
-
|
|
6878
6358
|
Layout.Left = Left;
|
|
6879
6359
|
Layout.Right = Right;
|
|
6880
6360
|
Layout.HeadingText = Slots.HeadingText;
|
|
@@ -6940,7 +6420,6 @@ class CardAlertBannerSlot extends Slot {
|
|
|
6940
6420
|
children: this.props.children
|
|
6941
6421
|
}));
|
|
6942
6422
|
}
|
|
6943
|
-
|
|
6944
6423
|
}
|
|
6945
6424
|
|
|
6946
6425
|
const ControlsFrame$1 = /*#__PURE__*/styled(Flex).withConfig({
|
|
@@ -6953,7 +6432,6 @@ class CardControlsSlot extends Slot {
|
|
|
6953
6432
|
children: this.props.children
|
|
6954
6433
|
});
|
|
6955
6434
|
}
|
|
6956
|
-
|
|
6957
6435
|
}
|
|
6958
6436
|
|
|
6959
6437
|
class CardHeadingActionSlot extends Slot {}
|
|
@@ -6994,7 +6472,6 @@ class CardSectionSlot extends Slot {
|
|
|
6994
6472
|
})), children]
|
|
6995
6473
|
}));
|
|
6996
6474
|
}
|
|
6997
|
-
|
|
6998
6475
|
}
|
|
6999
6476
|
|
|
7000
6477
|
const CardHeading = /*#__PURE__*/styled(SpaceBetween).withConfig({
|
|
@@ -7002,7 +6479,6 @@ const CardHeading = /*#__PURE__*/styled(SpaceBetween).withConfig({
|
|
|
7002
6479
|
componentId: "sc-14canq2-0"
|
|
7003
6480
|
})(["margin:", " ", " ", " ", ";padding-top:", ";"], Margin.none, Margin.l, Margin.none, Margin.l, Padding.l);
|
|
7004
6481
|
/** remove the margin bottom here since the frame handles it */
|
|
7005
|
-
|
|
7006
6482
|
const CardHeadingText = /*#__PURE__*/styled(Heading3).withConfig({
|
|
7007
6483
|
displayName: "card__CardHeadingText",
|
|
7008
6484
|
componentId: "sc-14canq2-1"
|
|
@@ -7013,11 +6489,10 @@ const CardFrame = /*#__PURE__*/styled(CardFrame$1).withConfig({
|
|
|
7013
6489
|
})(["", ";> section:nth-of-type(1){border:none;}"], shadow);
|
|
7014
6490
|
const Card = props => {
|
|
7015
6491
|
const {
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
6492
|
+
children,
|
|
6493
|
+
heading
|
|
6494
|
+
} = props,
|
|
6495
|
+
htmlProps = __rest(props, ["children", "heading"]);
|
|
7021
6496
|
const sections = getSlots(CardSectionSlot, children);
|
|
7022
6497
|
const controls = getSlot(CardControlsSlot, children);
|
|
7023
6498
|
const headingAction = getSlot(CardHeadingActionSlot, children);
|
|
@@ -7055,7 +6530,6 @@ const Card = props => {
|
|
|
7055
6530
|
}));
|
|
7056
6531
|
};
|
|
7057
6532
|
/** export the slots and some sub-components */
|
|
7058
|
-
|
|
7059
6533
|
Card.Section = CardSectionSlot;
|
|
7060
6534
|
Card.Controls = CardControlsSlot;
|
|
7061
6535
|
Card.HeadingAction = CardHeadingActionSlot;
|
|
@@ -7064,11 +6538,8 @@ Card.AlertBanner = CardAlertBannerSlot;
|
|
|
7064
6538
|
const {
|
|
7065
6539
|
Layout
|
|
7066
6540
|
} = leftRightLayoutGenerator();
|
|
7067
|
-
|
|
7068
6541
|
class Right extends Slot {}
|
|
7069
|
-
|
|
7070
6542
|
class Controls$1 extends Slot {}
|
|
7071
|
-
|
|
7072
6543
|
const LeftRightCard = props => {
|
|
7073
6544
|
const right = getSlot(Right, props.children);
|
|
7074
6545
|
const controls = getSlot(Controls$1, props.children);
|
|
@@ -7124,7 +6595,6 @@ const checkSvg = `
|
|
|
7124
6595
|
<svg xmlns='http://www.w3.org/2000/svg' width='10' height='12' viewBox='0 0 10 8'>
|
|
7125
6596
|
<path d='M4.50846 7.37941C4.0689 7.81898 3.35108 7.81898 2.91151 7.37941L0.330581 4.79848C-0.110194 4.35892 -0.110194 3.64109 0.330581 3.20153C0.770146 2.76196 1.48797 2.76196 1.92753 3.20153L3.70999 4.98399L8.07338 0.620598C8.51294 0.181033 9.23076 0.181033 9.67033 0.620598C10.1099 1.06016 10.1099 1.77798 9.67033 2.21755L4.50846 7.37941Z' fill='white'/>
|
|
7126
6597
|
</svg>`;
|
|
7127
|
-
|
|
7128
6598
|
function getCheckMark(indeterminate) {
|
|
7129
6599
|
return css(["::before{position:absolute;content:url(\"data:image/svg+xml,", "\");left:", "px;top:", "px;}"], indeterminate ? indeterminateSvg : checkSvg, indeterminate ? 3 : 4, indeterminate ? 6 : 3);
|
|
7130
6600
|
}
|
|
@@ -7139,14 +6609,11 @@ function getCheckMark(indeterminate) {
|
|
|
7139
6609
|
* the styles to depend on the browser's
|
|
7140
6610
|
* idea of the state of the button.
|
|
7141
6611
|
*/
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
6612
|
function getCheckedStyles(indeterminate, color) {
|
|
7145
6613
|
return css(["", ""], ({
|
|
7146
6614
|
checked
|
|
7147
6615
|
}) => isNil(checked) ? css([":checked{background:", ";border:2px solid ", ";", "}"], color, color, getCheckMark(indeterminate)) : is(checked) || is(indeterminate) ? css(["background:", ";border:2px solid ", ";", ""], color, color, getCheckMark(indeterminate)) : '');
|
|
7148
6616
|
}
|
|
7149
|
-
|
|
7150
6617
|
const getHoverStyles = indeterminate => css(["background:", ";", ""], Surface.Default.Hover, getCheckedStyles(indeterminate, Interactive.Default.Hover));
|
|
7151
6618
|
const getDisabledStyles = indeterminate => css(["pointer-events:none;background:", ";border:2px solid ", ";", ""], props => is(props.checked) || is(indeterminate) ? `${Borders.Default.Default}` : `${Surface.Default.Subdued}`, Borders.Default.Default, getCheckedStyles(indeterminate, Icons.Disabled));
|
|
7152
6619
|
const getDefaultStyles = indeterminate => css(["background:", ";border:2px solid ", ";", ":hover{", "}"], Surface.Default.Default, Interactive.Default.Disabled, getCheckedStyles(indeterminate, Interactive.Default.Default), getHoverStyles(indeterminate));
|
|
@@ -7170,11 +6637,10 @@ const CustomizedCheckbox = /*#__PURE__*/styled.input.withConfig({
|
|
|
7170
6637
|
}, Focused.Default);
|
|
7171
6638
|
const Checkbox = props => {
|
|
7172
6639
|
const {
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
6640
|
+
error,
|
|
6641
|
+
indeterminate
|
|
6642
|
+
} = props,
|
|
6643
|
+
htmlProps = __rest(props, ["error", "indeterminate"]);
|
|
7178
6644
|
return jsx(CustomizedCheckbox, Object.assign({}, htmlProps, {
|
|
7179
6645
|
type: 'checkbox',
|
|
7180
6646
|
error: error,
|
|
@@ -7201,12 +6667,11 @@ const LabelText$2 = /*#__PURE__*/styled.span.withConfig({
|
|
|
7201
6667
|
})(["margin-left:", ";"], Margin.xs);
|
|
7202
6668
|
const RadioButton$1 = props => {
|
|
7203
6669
|
const {
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
6670
|
+
className,
|
|
6671
|
+
label,
|
|
6672
|
+
disabled
|
|
6673
|
+
} = props,
|
|
6674
|
+
htmlProps = __rest(props, ["className", "label", "disabled"]);
|
|
7210
6675
|
return jsxs(Label, Object.assign({
|
|
7211
6676
|
disabled: is(disabled),
|
|
7212
6677
|
className: className
|
|
@@ -7221,37 +6686,20 @@ const RadioButton$1 = props => {
|
|
|
7221
6686
|
};
|
|
7222
6687
|
|
|
7223
6688
|
// this file was generated, but it is safe to modify
|
|
7224
|
-
|
|
7225
6689
|
function toDividerType(n) {
|
|
7226
6690
|
switch (n) {
|
|
7227
|
-
case 1
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
return
|
|
7231
|
-
/* DividerType.default */
|
|
7232
|
-
;
|
|
7233
|
-
|
|
7234
|
-
case 2
|
|
7235
|
-
/* DividerType.subdued */
|
|
7236
|
-
:
|
|
7237
|
-
return 2
|
|
7238
|
-
/* DividerType.subdued */
|
|
7239
|
-
;
|
|
7240
|
-
|
|
6691
|
+
case 1 /* DividerType.default */:
|
|
6692
|
+
return 1 /* DividerType.default */;
|
|
6693
|
+
case 2 /* DividerType.subdued */:
|
|
6694
|
+
return 2 /* DividerType.subdued */;
|
|
7241
6695
|
default:
|
|
7242
|
-
return 1
|
|
7243
|
-
/* DividerType.default */
|
|
7244
|
-
;
|
|
6696
|
+
return 1 /* DividerType.default */;
|
|
7245
6697
|
}
|
|
7246
6698
|
}
|
|
7247
6699
|
|
|
7248
6700
|
const DividerTypeColor = {
|
|
7249
|
-
[1
|
|
7250
|
-
/* DividerType.
|
|
7251
|
-
]: Borders.Default.Default,
|
|
7252
|
-
[2
|
|
7253
|
-
/* DividerType.subdued */
|
|
7254
|
-
]: Borders.Default.Subdued
|
|
6701
|
+
[1 /* DividerType.default */]: Borders.Default.Default,
|
|
6702
|
+
[2 /* DividerType.subdued */]: Borders.Default.Subdued
|
|
7255
6703
|
};
|
|
7256
6704
|
function getColor(props) {
|
|
7257
6705
|
return DividerTypeColor[toDividerType(bitwiseOr$1([props.default, props.subdued]))];
|
|
@@ -7266,7 +6714,6 @@ function getColor(props) {
|
|
|
7266
6714
|
* this comment and feel like experimenting, go crazy. Check out the
|
|
7267
6715
|
* card stories for an example of the divider (it's way at the bottom)
|
|
7268
6716
|
*/
|
|
7269
|
-
|
|
7270
6717
|
const DividerWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
7271
6718
|
displayName: "divider__DividerWrapper",
|
|
7272
6719
|
componentId: "hcchmo-0"
|
|
@@ -7385,25 +6832,18 @@ const SuffixFrame = /*#__PURE__*/styled(Label$1).withConfig({
|
|
|
7385
6832
|
displayName: "input-field__SuffixFrame",
|
|
7386
6833
|
componentId: "sc-1yq0rb7-4"
|
|
7387
6834
|
})(["margin-right:", ";"], Margin.xs);
|
|
7388
|
-
|
|
7389
6835
|
class IconSlot extends Slot {}
|
|
7390
|
-
|
|
7391
6836
|
class ControlsSlot$1 extends Slot {}
|
|
7392
|
-
|
|
7393
6837
|
const InputFrame = /*#__PURE__*/styled.label.withConfig({
|
|
7394
6838
|
displayName: "input-field__InputFrame",
|
|
7395
6839
|
componentId: "sc-1yq0rb7-5"
|
|
7396
6840
|
})(["width:100%;padding:", " ", " ", " ", ";display:flex;flex-direction:", ";", ""], Padding.xs, Padding.none, Padding.none, Padding.none, ({
|
|
7397
6841
|
label,
|
|
7398
6842
|
labelPosition
|
|
7399
|
-
}) => isDefined(label) && !isEmpty(label) && labelPosition === "side"
|
|
7400
|
-
/* labelPositionType.SIDE */
|
|
7401
|
-
? 'row' : 'column', ({
|
|
6843
|
+
}) => isDefined(label) && !isEmpty(label) && labelPosition === "side" /* labelPositionType.SIDE */ ? 'row' : 'column', ({
|
|
7402
6844
|
label,
|
|
7403
6845
|
labelPosition
|
|
7404
|
-
}) => isDefined(label) && !isEmpty(label) && labelPosition === "side"
|
|
7405
|
-
/* labelPositionType.SIDE */
|
|
7406
|
-
&& css(["width:fit-content;white-space:pre;"]));
|
|
6846
|
+
}) => isDefined(label) && !isEmpty(label) && labelPosition === "side" /* labelPositionType.SIDE */ && css(["width:fit-content;white-space:pre;"]));
|
|
7407
6847
|
const ControlsFrame = /*#__PURE__*/styled(Flex).withConfig({
|
|
7408
6848
|
displayName: "input-field__ControlsFrame",
|
|
7409
6849
|
componentId: "sc-1yq0rb7-6"
|
|
@@ -7413,23 +6853,18 @@ const InputLabel = /*#__PURE__*/styled(Label$1).withConfig({
|
|
|
7413
6853
|
componentId: "sc-1yq0rb7-7"
|
|
7414
6854
|
})(["margin-bottom:", ";", ""], Margin.xxs, ({
|
|
7415
6855
|
labelPosition
|
|
7416
|
-
}) => labelPosition === "side"
|
|
7417
|
-
/* labelPositionType.SIDE */
|
|
7418
|
-
&& css(["padding-right:", ";"], Padding.xs));
|
|
6856
|
+
}) => labelPosition === "side" /* labelPositionType.SIDE */ && css(["padding-right:", ";"], Padding.xs));
|
|
7419
6857
|
const InputField$1 = forwardRef((props, ref) => {
|
|
7420
6858
|
const {
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
} = props,
|
|
7431
|
-
inputProps = __rest(props, ["children", "prefix", "suffix", "label", "className", "style", "labelPosition"]);
|
|
7432
|
-
|
|
6859
|
+
children,
|
|
6860
|
+
prefix,
|
|
6861
|
+
suffix,
|
|
6862
|
+
label,
|
|
6863
|
+
className,
|
|
6864
|
+
style,
|
|
6865
|
+
labelPosition = "top" /* labelPositionType.TOP */
|
|
6866
|
+
} = props,
|
|
6867
|
+
inputProps = __rest(props, ["children", "prefix", "suffix", "label", "className", "style", "labelPosition"]);
|
|
7433
6868
|
const icon = getSlot(IconSlot, children);
|
|
7434
6869
|
const controls = getSlot(ControlsSlot$1, children);
|
|
7435
6870
|
const required = is(props.required) ? '*' : '';
|
|
@@ -7568,11 +7003,10 @@ $$5({ global: true, forced: parseFloat != $parseFloat }, {
|
|
|
7568
7003
|
|
|
7569
7004
|
const InputNumber = props => {
|
|
7570
7005
|
const {
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7006
|
+
onChange,
|
|
7007
|
+
value
|
|
7008
|
+
} = props,
|
|
7009
|
+
inputFieldProps = __rest(props, ["onChange", "value"]);
|
|
7576
7010
|
return jsx(InputField$1, Object.assign({
|
|
7577
7011
|
type: 'number',
|
|
7578
7012
|
value: isNil(value) || isNaN(value) ? '' : value,
|
|
@@ -7589,10 +7023,9 @@ InputNumber.Stepper = Stepper;
|
|
|
7589
7023
|
|
|
7590
7024
|
const InputText = props => {
|
|
7591
7025
|
const {
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7026
|
+
onChange
|
|
7027
|
+
} = props,
|
|
7028
|
+
inputFieldProps = __rest(props, ["onChange"]);
|
|
7596
7029
|
return jsx(InputField$1, Object.assign({
|
|
7597
7030
|
type: 'text',
|
|
7598
7031
|
onChange: e => onChange(e.target.value)
|
|
@@ -7614,12 +7047,11 @@ const HTMLAnchor = /*#__PURE__*/styled.a.withConfig({
|
|
|
7614
7047
|
}) => interactionColor);
|
|
7615
7048
|
const Link = props => {
|
|
7616
7049
|
const {
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
|
|
7050
|
+
label,
|
|
7051
|
+
disabled = false,
|
|
7052
|
+
subtle
|
|
7053
|
+
} = props,
|
|
7054
|
+
rest = __rest(props, ["label", "disabled", "subtle"]);
|
|
7623
7055
|
const initialColor = getInitialColor(props);
|
|
7624
7056
|
const interactionColor = getInteractionColor(props);
|
|
7625
7057
|
return jsx(HTMLAnchor, Object.assign({}, rest, {
|
|
@@ -7630,7 +7062,6 @@ const Link = props => {
|
|
|
7630
7062
|
children: label
|
|
7631
7063
|
}));
|
|
7632
7064
|
};
|
|
7633
|
-
|
|
7634
7065
|
function getInitialColor({
|
|
7635
7066
|
subtle,
|
|
7636
7067
|
disabled
|
|
@@ -7638,10 +7069,8 @@ function getInitialColor({
|
|
|
7638
7069
|
if (is(disabled)) {
|
|
7639
7070
|
return Interactive.Default.Disabled;
|
|
7640
7071
|
}
|
|
7641
|
-
|
|
7642
7072
|
return is(subtle) ? Interactive.Subtle.Default : Interactive.Default.Default;
|
|
7643
7073
|
}
|
|
7644
|
-
|
|
7645
7074
|
function getInteractionColor({
|
|
7646
7075
|
subtle
|
|
7647
7076
|
}) {
|
|
@@ -7684,13 +7113,11 @@ const ClosableIcon = /*#__PURE__*/styled.svg.withConfig({
|
|
|
7684
7113
|
})(["path{fill:", ";}"], Icons.Default);
|
|
7685
7114
|
const CloseButton$1 = props => {
|
|
7686
7115
|
const disabled = is(props.disabled);
|
|
7687
|
-
|
|
7688
7116
|
const onClickHandler = () => {
|
|
7689
7117
|
if (!disabled && isDefined(props.onClick)) {
|
|
7690
7118
|
props.onClick();
|
|
7691
7119
|
}
|
|
7692
7120
|
};
|
|
7693
|
-
|
|
7694
7121
|
return jsx(ClosableWrapper, Object.assign({
|
|
7695
7122
|
disabled: disabled,
|
|
7696
7123
|
onClick: onClickHandler,
|
|
@@ -7738,12 +7165,11 @@ const TagFrame = /*#__PURE__*/styled(Flex).withConfig({
|
|
|
7738
7165
|
})(["flex-direction:row;align-items:stretch;padding:", ";width:fit-content;"], Padding.none);
|
|
7739
7166
|
const Tag = props => {
|
|
7740
7167
|
const {
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7168
|
+
disabled,
|
|
7169
|
+
closable,
|
|
7170
|
+
onClick
|
|
7171
|
+
} = props,
|
|
7172
|
+
domProps = __rest(props, ["disabled", "closable", "onClick"]);
|
|
7747
7173
|
return jsxs(TagFrame, Object.assign({}, domProps, {
|
|
7748
7174
|
className: props.className
|
|
7749
7175
|
}, {
|
|
@@ -7757,47 +7183,23 @@ const Tag = props => {
|
|
|
7757
7183
|
};
|
|
7758
7184
|
|
|
7759
7185
|
// this file was generated, but it is safe to modify
|
|
7760
|
-
|
|
7761
7186
|
function toThumbnailSize(n) {
|
|
7762
7187
|
switch (n) {
|
|
7763
|
-
case 1
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
return
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
case 2
|
|
7771
|
-
/* ThumbnailSize.medium */
|
|
7772
|
-
:
|
|
7773
|
-
return 2
|
|
7774
|
-
/* ThumbnailSize.medium */
|
|
7775
|
-
;
|
|
7776
|
-
|
|
7777
|
-
case 4
|
|
7778
|
-
/* ThumbnailSize.large */
|
|
7779
|
-
:
|
|
7780
|
-
return 4
|
|
7781
|
-
/* ThumbnailSize.large */
|
|
7782
|
-
;
|
|
7783
|
-
|
|
7188
|
+
case 1 /* ThumbnailSize.small */:
|
|
7189
|
+
return 1 /* ThumbnailSize.small */;
|
|
7190
|
+
case 2 /* ThumbnailSize.medium */:
|
|
7191
|
+
return 2 /* ThumbnailSize.medium */;
|
|
7192
|
+
case 4 /* ThumbnailSize.large */:
|
|
7193
|
+
return 4 /* ThumbnailSize.large */;
|
|
7784
7194
|
default:
|
|
7785
|
-
return 2
|
|
7786
|
-
/* ThumbnailSize.medium */
|
|
7787
|
-
;
|
|
7195
|
+
return 2 /* ThumbnailSize.medium */;
|
|
7788
7196
|
}
|
|
7789
7197
|
}
|
|
7790
7198
|
|
|
7791
7199
|
const ThumbnailSizeValues = {
|
|
7792
|
-
[1
|
|
7793
|
-
/* ThumbnailSize.
|
|
7794
|
-
]: '
|
|
7795
|
-
[2
|
|
7796
|
-
/* ThumbnailSize.medium */
|
|
7797
|
-
]: '60px',
|
|
7798
|
-
[4
|
|
7799
|
-
/* ThumbnailSize.large */
|
|
7800
|
-
]: '80px'
|
|
7200
|
+
[1 /* ThumbnailSize.small */]: '40px',
|
|
7201
|
+
[2 /* ThumbnailSize.medium */]: '60px',
|
|
7202
|
+
[4 /* ThumbnailSize.large */]: '80px'
|
|
7801
7203
|
};
|
|
7802
7204
|
function getValuesBySize$2(props) {
|
|
7803
7205
|
return ThumbnailSizeValues[toThumbnailSize(bitwiseOr$1([props.small, props.medium, props.large]))];
|
|
@@ -7822,11 +7224,9 @@ const Thumbnail = props => {
|
|
|
7822
7224
|
className = ''
|
|
7823
7225
|
} = props;
|
|
7824
7226
|
const size = getValuesBySize$2(props);
|
|
7825
|
-
|
|
7826
7227
|
if (isNil(imageUrl)) {
|
|
7827
7228
|
return jsx(Nothing, {});
|
|
7828
7229
|
}
|
|
7829
|
-
|
|
7830
7230
|
return jsx(Box, Object.assign({
|
|
7831
7231
|
size: size,
|
|
7832
7232
|
"data-testid": "thumbnail-test",
|
|
@@ -7855,7 +7255,6 @@ const getStylesToTypePrimary = ({
|
|
|
7855
7255
|
borderBottom: `3px solid ${Borders.Highlight.Default}`
|
|
7856
7256
|
}
|
|
7857
7257
|
});
|
|
7858
|
-
|
|
7859
7258
|
const getStylesToTypeSecondary = ({
|
|
7860
7259
|
selected
|
|
7861
7260
|
}) => ({
|
|
@@ -7869,33 +7268,29 @@ const getStylesToTypeSecondary = ({
|
|
|
7869
7268
|
borderRadius: '18px',
|
|
7870
7269
|
alignItems: 'center'
|
|
7871
7270
|
});
|
|
7872
|
-
|
|
7873
7271
|
const getStylesByType = (secondary, selected) => {
|
|
7874
7272
|
if (secondary) {
|
|
7875
7273
|
return getStylesToTypeSecondary({
|
|
7876
7274
|
selected
|
|
7877
7275
|
});
|
|
7878
7276
|
}
|
|
7879
|
-
|
|
7880
7277
|
return getStylesToTypePrimary({
|
|
7881
7278
|
selected
|
|
7882
7279
|
});
|
|
7883
7280
|
};
|
|
7884
|
-
|
|
7885
7281
|
const Tab$1 = props => {
|
|
7886
7282
|
const {
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7283
|
+
Prefix,
|
|
7284
|
+
selected = false,
|
|
7285
|
+
secondary = false
|
|
7286
|
+
} = props,
|
|
7287
|
+
rest = __rest(props
|
|
7288
|
+
// eslint-disable-next-line no-null/no-null
|
|
7289
|
+
, ["Prefix", "selected", "secondary"]);
|
|
7290
|
+
// eslint-disable-next-line no-null/no-null
|
|
7895
7291
|
const ref = useRef(null);
|
|
7896
7292
|
useEffect(() => {
|
|
7897
7293
|
var _a, _b;
|
|
7898
|
-
|
|
7899
7294
|
selected ? (_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus() : (_b = ref.current) === null || _b === void 0 ? void 0 : _b.blur();
|
|
7900
7295
|
}, [selected]);
|
|
7901
7296
|
/**
|
|
@@ -7906,12 +7301,10 @@ const Tab$1 = props => {
|
|
|
7906
7301
|
* we will have to use a div and style it the old fashioned way until
|
|
7907
7302
|
* we upgrade rwc's styled-components or drop rwc
|
|
7908
7303
|
*/
|
|
7909
|
-
|
|
7910
7304
|
return jsxs("div", Object.assign({}, rest, {
|
|
7911
7305
|
tabIndex: 0,
|
|
7912
7306
|
onClick: () => {
|
|
7913
7307
|
var _a;
|
|
7914
|
-
|
|
7915
7308
|
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
7916
7309
|
},
|
|
7917
7310
|
role: 'tab',
|
|
@@ -7948,11 +7341,8 @@ const TabListPrimary = /*#__PURE__*/styled(TabList).withConfig({
|
|
|
7948
7341
|
displayName: "tabs__TabListPrimary",
|
|
7949
7342
|
componentId: "kpjo9y-3"
|
|
7950
7343
|
})(["border-bottom:1px solid ", ";"], Borders.Default.Subdued);
|
|
7951
|
-
|
|
7952
7344
|
class Content extends StylableSlot {}
|
|
7953
|
-
|
|
7954
7345
|
class Navigation extends Slot {}
|
|
7955
|
-
|
|
7956
7346
|
const isTab = isReactElementOfType(Tab);
|
|
7957
7347
|
const isTabList = isReactElementOfType(Navigation);
|
|
7958
7348
|
const isContent = isReactElementOfType(Content);
|
|
@@ -7964,18 +7354,15 @@ const Tabs = props => {
|
|
|
7964
7354
|
if (isContent(child)) {
|
|
7965
7355
|
return decorateContent(child, props, contentCount++);
|
|
7966
7356
|
}
|
|
7967
|
-
|
|
7968
7357
|
if (isTabList(child)) {
|
|
7969
7358
|
const tabs = Children.map(child.props.children, tab => {
|
|
7970
7359
|
return isTab(tab) ? decorateTab(tab, props, tabCount++) : tab;
|
|
7971
7360
|
});
|
|
7972
|
-
|
|
7973
7361
|
if (is(props.secondary) && props.secondary === true) {
|
|
7974
7362
|
return jsx(TabListSecondary, {
|
|
7975
7363
|
children: tabs
|
|
7976
7364
|
});
|
|
7977
7365
|
}
|
|
7978
|
-
|
|
7979
7366
|
return jsx(TabListPrimary, {
|
|
7980
7367
|
children: tabs
|
|
7981
7368
|
});
|
|
@@ -7987,7 +7374,6 @@ const Tabs = props => {
|
|
|
7987
7374
|
children: children
|
|
7988
7375
|
});
|
|
7989
7376
|
};
|
|
7990
|
-
|
|
7991
7377
|
function decorateTab(tab, {
|
|
7992
7378
|
selected,
|
|
7993
7379
|
secondary,
|
|
@@ -7998,7 +7384,6 @@ function decorateTab(tab, {
|
|
|
7998
7384
|
selected: is(tab.props.selected) ? tab.props.selected : index === selected,
|
|
7999
7385
|
onFocus: e => {
|
|
8000
7386
|
safeCallback(tab.props.onFocus, e);
|
|
8001
|
-
|
|
8002
7387
|
if (index !== selected) {
|
|
8003
7388
|
onChange(index);
|
|
8004
7389
|
}
|
|
@@ -8008,8 +7393,6 @@ function decorateTab(tab, {
|
|
|
8008
7393
|
}));
|
|
8009
7394
|
}
|
|
8010
7395
|
/** content could be anything, but it needs to at least show and hide appropriately */
|
|
8011
|
-
|
|
8012
|
-
|
|
8013
7396
|
function decorateContent(child, props, index) {
|
|
8014
7397
|
return applyProps(applyStyle(child, {
|
|
8015
7398
|
display: index === props.selected ? 'inherit' : 'none'
|
|
@@ -8018,61 +7401,31 @@ function decorateContent(child, props, index) {
|
|
|
8018
7401
|
'aria-hidden': !(index === props.selected)
|
|
8019
7402
|
});
|
|
8020
7403
|
}
|
|
8021
|
-
|
|
8022
7404
|
Tabs.Content = Content;
|
|
8023
7405
|
Tabs.TabList = Navigation;
|
|
8024
7406
|
|
|
8025
7407
|
function toFlag(n) {
|
|
8026
7408
|
switch (n) {
|
|
8027
|
-
case 1
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
return
|
|
8031
|
-
|
|
8032
|
-
|
|
8033
|
-
|
|
8034
|
-
case 2
|
|
8035
|
-
/* FlagSize.medium */
|
|
8036
|
-
:
|
|
8037
|
-
return 2
|
|
8038
|
-
/* FlagSize.medium */
|
|
8039
|
-
;
|
|
8040
|
-
|
|
8041
|
-
case 4
|
|
8042
|
-
/* FlagSize.large */
|
|
8043
|
-
:
|
|
8044
|
-
return 4
|
|
8045
|
-
/* FlagSize.large */
|
|
8046
|
-
;
|
|
8047
|
-
|
|
7409
|
+
case 1 /* FlagSize.small */:
|
|
7410
|
+
return 1 /* FlagSize.small */;
|
|
7411
|
+
case 2 /* FlagSize.medium */:
|
|
7412
|
+
return 2 /* FlagSize.medium */;
|
|
7413
|
+
case 4 /* FlagSize.large */:
|
|
7414
|
+
return 4 /* FlagSize.large */;
|
|
8048
7415
|
default:
|
|
8049
|
-
return 2
|
|
8050
|
-
/* FlagSize.medium */
|
|
8051
|
-
;
|
|
7416
|
+
return 2 /* FlagSize.medium */;
|
|
8052
7417
|
}
|
|
8053
7418
|
}
|
|
8054
7419
|
|
|
8055
7420
|
const FlagWidthValues = {
|
|
8056
|
-
[1
|
|
8057
|
-
/* FlagSize.
|
|
8058
|
-
]: '
|
|
8059
|
-
[2
|
|
8060
|
-
/* FlagSize.medium */
|
|
8061
|
-
]: '20',
|
|
8062
|
-
[4
|
|
8063
|
-
/* FlagSize.large */
|
|
8064
|
-
]: '32'
|
|
7421
|
+
[1 /* FlagSize.small */]: '20',
|
|
7422
|
+
[2 /* FlagSize.medium */]: '20',
|
|
7423
|
+
[4 /* FlagSize.large */]: '32'
|
|
8065
7424
|
};
|
|
8066
7425
|
const FlagHeightValues = {
|
|
8067
|
-
[1
|
|
8068
|
-
/* FlagSize.
|
|
8069
|
-
]: '
|
|
8070
|
-
[2
|
|
8071
|
-
/* FlagSize.medium */
|
|
8072
|
-
]: '20',
|
|
8073
|
-
[4
|
|
8074
|
-
/* FlagSize.large */
|
|
8075
|
-
]: '24'
|
|
7426
|
+
[1 /* FlagSize.small */]: '20',
|
|
7427
|
+
[2 /* FlagSize.medium */]: '20',
|
|
7428
|
+
[4 /* FlagSize.large */]: '24'
|
|
8076
7429
|
};
|
|
8077
7430
|
function getHeigthBySize(props) {
|
|
8078
7431
|
return FlagHeightValues[getFlagSize(props)];
|
|
@@ -8088,23 +7441,14 @@ const SmallFlags={'AD':jsxs(React.Fragment,{children:[jsxs("g",Object.assign({cl
|
|
|
8088
7441
|
|
|
8089
7442
|
const getCoordsStyles = props => {
|
|
8090
7443
|
switch (getFlagSize(props)) {
|
|
8091
|
-
case 4
|
|
8092
|
-
/* FlagSize.large */
|
|
8093
|
-
:
|
|
7444
|
+
case 4 /* FlagSize.large */:
|
|
8094
7445
|
return css(["& .coords{width:32px;height:24px;x:0;y:0;}"]);
|
|
8095
|
-
|
|
8096
|
-
case 2
|
|
8097
|
-
/* FlagSize.medium */
|
|
8098
|
-
:
|
|
7446
|
+
case 2 /* FlagSize.medium */:
|
|
8099
7447
|
return css(["& .coords{width:20px;height:16px;x:0;y:2;}"]);
|
|
8100
|
-
|
|
8101
|
-
case 1
|
|
8102
|
-
/* FlagSize.small */
|
|
8103
|
-
:
|
|
7448
|
+
case 1 /* FlagSize.small */:
|
|
8104
7449
|
return css(["& .coords{width:16px;height:12px;x:2;y:4;}"]);
|
|
8105
7450
|
}
|
|
8106
7451
|
};
|
|
8107
|
-
|
|
8108
7452
|
const BoundingBox = /*#__PURE__*/styled.i.withConfig({
|
|
8109
7453
|
displayName: "flag__BoundingBox",
|
|
8110
7454
|
componentId: "sc-1qckhuo-0"
|
|
@@ -8131,29 +7475,18 @@ const Svg = /*#__PURE__*/styled.svg.attrs(({
|
|
|
8131
7475
|
}) => getWidthBySize(props), ({
|
|
8132
7476
|
props
|
|
8133
7477
|
}) => getCoordsStyles(props));
|
|
8134
|
-
|
|
8135
7478
|
const getFlagPathByCode = props => {
|
|
8136
7479
|
switch (getFlagSize(props)) {
|
|
8137
|
-
case 1
|
|
8138
|
-
/* FlagSize.small */
|
|
8139
|
-
:
|
|
7480
|
+
case 1 /* FlagSize.small */:
|
|
8140
7481
|
return SmallFlags[props.code];
|
|
8141
|
-
|
|
8142
|
-
case 2
|
|
8143
|
-
/* FlagSize.medium */
|
|
8144
|
-
:
|
|
7482
|
+
case 2 /* FlagSize.medium */:
|
|
8145
7483
|
return MediumFlags[props.code];
|
|
8146
|
-
|
|
8147
|
-
case 4
|
|
8148
|
-
/* FlagSize.large */
|
|
8149
|
-
:
|
|
7484
|
+
case 4 /* FlagSize.large */:
|
|
8150
7485
|
return LargeFlags[props.code];
|
|
8151
|
-
|
|
8152
7486
|
default:
|
|
8153
7487
|
return SmallFlags[props.code];
|
|
8154
7488
|
}
|
|
8155
7489
|
};
|
|
8156
|
-
|
|
8157
7490
|
const Flag = props => {
|
|
8158
7491
|
return jsx(BoundingBox, Object.assign({
|
|
8159
7492
|
className: props.className,
|
|
@@ -8476,26 +7809,21 @@ function getDocument() {
|
|
|
8476
7809
|
if (typeof document !== 'undefined') {
|
|
8477
7810
|
return document;
|
|
8478
7811
|
}
|
|
8479
|
-
|
|
8480
7812
|
return undefined;
|
|
8481
7813
|
}
|
|
8482
7814
|
function equal(valueA, valueB) {
|
|
8483
7815
|
if (valueA === valueB) {
|
|
8484
7816
|
return true;
|
|
8485
7817
|
}
|
|
8486
|
-
|
|
8487
7818
|
if (isNil(valueA) || isNil(valueB)) {
|
|
8488
7819
|
return false;
|
|
8489
7820
|
}
|
|
8490
|
-
|
|
8491
7821
|
if (typeof valueA === 'object' && typeof valueB === 'object') {
|
|
8492
7822
|
if (isDefined(valueA.toJSON) && isDefined(valueB.toJSON)) {
|
|
8493
7823
|
return JSON.stringify(valueA.toJSON()) === JSON.stringify(valueB.toJSON());
|
|
8494
7824
|
}
|
|
8495
|
-
|
|
8496
7825
|
return JSON.stringify(valueA) === JSON.stringify(valueB);
|
|
8497
7826
|
}
|
|
8498
|
-
|
|
8499
7827
|
return false;
|
|
8500
7828
|
}
|
|
8501
7829
|
function getValueOptions(options, value, multi) {
|
|
@@ -8528,32 +7856,23 @@ function toKey(value) {
|
|
|
8528
7856
|
if (typeof value === 'string') {
|
|
8529
7857
|
return value;
|
|
8530
7858
|
}
|
|
8531
|
-
|
|
8532
7859
|
if (isDefined(value) && typeof value === 'object') {
|
|
8533
7860
|
const jsonObject = isDefined(value.toJSON) ? value.toJSON() : value;
|
|
8534
7861
|
return JSON.stringify(jsonObject);
|
|
8535
7862
|
}
|
|
8536
|
-
|
|
8537
7863
|
return JSON.stringify(value);
|
|
8538
7864
|
}
|
|
8539
7865
|
const topPosition = props => {
|
|
8540
|
-
if (props.menuPosition === "top"
|
|
8541
|
-
|
|
8542
|
-
&& isDefined(props.menuHeight) && typeof props.menuHeight === 'number') {
|
|
8543
|
-
return `${-(props.menuHeight + (isDefined(props.label) && !isEmpty(props.label) && props.labelPosition === "top"
|
|
8544
|
-
/* labelPositionType.TOP */
|
|
8545
|
-
? 64 : 44))}px`;
|
|
7866
|
+
if (props.menuPosition === "top" /* menuPositionType.TOP */ && isDefined(props.menuHeight) && typeof props.menuHeight === 'number') {
|
|
7867
|
+
return `${-(props.menuHeight + (isDefined(props.label) && !isEmpty(props.label) && props.labelPosition === "top" /* labelPositionType.TOP */ ? 64 : 44))}px`;
|
|
8546
7868
|
}
|
|
8547
|
-
|
|
8548
7869
|
return '4px';
|
|
8549
7870
|
};
|
|
8550
7871
|
|
|
8551
7872
|
const MenuWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
8552
7873
|
displayName: "menu-container__MenuWrapper",
|
|
8553
7874
|
componentId: "dadn7s-0"
|
|
8554
|
-
})(["z-index:1;position:relative;background:", ";top:", ";box-sizing:border-box;.menu-list{box-sizing:border-box;box-shadow:", ";border:1px solid ", ";background-color:", ";border-radius:6px;opacity:0;transition:opacity 0.1s ease;padding:", ";&:focus{outline:none;}::-webkit-scrollbar{width:10px;height:0;}::-webkit-scrollbar-thumb{min-height:50px;border:2px solid rgba(0,0,0,0);background-clip:padding-box;border-radius:1em;background-color:", ";}::-webkit-scrollbar-corner{background-color:transparent;}}"], Surface.Default.Default, props => topPosition(props), props => props.menuPosition === "bottom"
|
|
8555
|
-
/* menuPositionType.BOTTOM */
|
|
8556
|
-
? '0px 2px 10px 0px rgba(0, 0, 0, 0.10)' : '0px -2px 10px 0px rgba(0, 0, 0, 0.10)', Borders.Default.Subdued, Surface.Default.Default, Padding.xxs, Surface.Neutral.Default);
|
|
7875
|
+
})(["z-index:1;position:relative;background:", ";top:", ";box-sizing:border-box;.menu-list{box-sizing:border-box;box-shadow:", ";border:1px solid ", ";background-color:", ";border-radius:6px;opacity:0;transition:opacity 0.1s ease;padding:", ";&:focus{outline:none;}::-webkit-scrollbar{width:10px;height:0;}::-webkit-scrollbar-thumb{min-height:50px;border:2px solid rgba(0,0,0,0);background-clip:padding-box;border-radius:1em;background-color:", ";}::-webkit-scrollbar-corner{background-color:transparent;}}"], Surface.Default.Default, props => topPosition(props), props => props.menuPosition === "bottom" /* menuPositionType.BOTTOM */ ? '0px 2px 10px 0px rgba(0, 0, 0, 0.10)' : '0px -2px 10px 0px rgba(0, 0, 0, 0.10)', Borders.Default.Subdued, Surface.Default.Default, Padding.xxs, Surface.Neutral.Default);
|
|
8557
7876
|
const MenuContainer = props => {
|
|
8558
7877
|
const {
|
|
8559
7878
|
onClick,
|
|
@@ -8624,9 +7943,7 @@ const EmptyOptionItem = /*#__PURE__*/styled(OptionItem).withConfig({
|
|
|
8624
7943
|
componentId: "sc-15t2iwx-1"
|
|
8625
7944
|
})(["border:1px solid ", ";background-color:", ";position:absolute;margin:", ";width:100%;height:54px;box-shadow:", ";&:hover{background-color:", ";}"], Borders.Default.Subdued, Surface.Default.Default, Margin.none, ({
|
|
8626
7945
|
props
|
|
8627
|
-
}) => props.menuPosition === "bottom"
|
|
8628
|
-
/* menuPositionType.BOTTOM */
|
|
8629
|
-
? '0px 2px 10px 0px rgba(0, 0, 0, 0.10)' : '0px -2px 10px 0px rgba(0, 0, 0, 0.10)', Surface.Default.Default);
|
|
7946
|
+
}) => props.menuPosition === "bottom" /* menuPositionType.BOTTOM */ ? '0px 2px 10px 0px rgba(0, 0, 0, 0.10)' : '0px -2px 10px 0px rgba(0, 0, 0, 0.10)', Surface.Default.Default);
|
|
8630
7947
|
|
|
8631
7948
|
const CheckedIcon$1 = /*#__PURE__*/styled(IconMinor.Check).withConfig({
|
|
8632
7949
|
displayName: "option__CheckedIcon",
|
|
@@ -8636,7 +7953,6 @@ const OptionComponent = /*#__PURE__*/memo(props => {
|
|
|
8636
7953
|
const onClick = () => {
|
|
8637
7954
|
props.onSelect(props.option.value, props.option);
|
|
8638
7955
|
};
|
|
8639
|
-
|
|
8640
7956
|
const {
|
|
8641
7957
|
active,
|
|
8642
7958
|
selected,
|
|
@@ -8707,18 +8023,14 @@ const Menu = props => {
|
|
|
8707
8023
|
open,
|
|
8708
8024
|
invalid,
|
|
8709
8025
|
menuHeight = DEFAULT_MENU_HEIGHT,
|
|
8710
|
-
menuPosition = "bottom"
|
|
8711
|
-
/*
|
|
8712
|
-
,
|
|
8713
|
-
labelPosition = "top"
|
|
8714
|
-
/* labelPositionType.TOP */
|
|
8715
|
-
,
|
|
8026
|
+
menuPosition = "bottom" /* menuPositionType.BOTTOM */,
|
|
8027
|
+
labelPosition = "top" /* labelPositionType.TOP */,
|
|
8716
8028
|
label
|
|
8717
8029
|
} = props;
|
|
8718
|
-
const options = safeArray(props.options);
|
|
8719
|
-
|
|
8720
|
-
const list = useRef(null);
|
|
8721
|
-
|
|
8030
|
+
const options = safeArray(props.options);
|
|
8031
|
+
// eslint-disable-next-line no-null/no-null
|
|
8032
|
+
const list = useRef(null);
|
|
8033
|
+
// eslint-disable-next-line no-null/no-null
|
|
8722
8034
|
const outerRef = useRef(null);
|
|
8723
8035
|
const height = Math.min(Math.max(options.length * rowHeight, rowHeight) + 10, menuHeight);
|
|
8724
8036
|
useEffect(() => {
|
|
@@ -8745,15 +8057,12 @@ const Menu = props => {
|
|
|
8745
8057
|
}
|
|
8746
8058
|
});
|
|
8747
8059
|
}, [props, options]);
|
|
8748
|
-
|
|
8749
8060
|
const renderList = () => {
|
|
8750
8061
|
const MenuComponent = props.menuComponent;
|
|
8751
8062
|
const itemCount = options.length;
|
|
8752
|
-
|
|
8753
8063
|
if (isDefined(MenuComponent)) {
|
|
8754
8064
|
return jsx(MenuComponent, Object.assign({}, props));
|
|
8755
8065
|
}
|
|
8756
|
-
|
|
8757
8066
|
if (itemCount === 0) {
|
|
8758
8067
|
const {
|
|
8759
8068
|
emptyText
|
|
@@ -8768,7 +8077,6 @@ const Menu = props => {
|
|
|
8768
8077
|
})
|
|
8769
8078
|
}));
|
|
8770
8079
|
}
|
|
8771
|
-
|
|
8772
8080
|
return jsx(FixedSizeList, Object.assign({
|
|
8773
8081
|
className: "menu-list",
|
|
8774
8082
|
style: {
|
|
@@ -8785,7 +8093,6 @@ const Menu = props => {
|
|
|
8785
8093
|
children: MenuRow$1
|
|
8786
8094
|
}));
|
|
8787
8095
|
};
|
|
8788
|
-
|
|
8789
8096
|
return maybeRender(open, jsx(MenuContainer, Object.assign({
|
|
8790
8097
|
invalid: invalid,
|
|
8791
8098
|
label: label,
|
|
@@ -8829,7 +8136,6 @@ const TagContainer = /*#__PURE__*/styled(Tag).withConfig({
|
|
|
8829
8136
|
displayName: "value-component-multi__TagContainer",
|
|
8830
8137
|
componentId: "sc-1fc9cnm-0"
|
|
8831
8138
|
})(["div:first-child{min-height:auto;padding:", " ", " ", " ", ";}div:last-child{padding:", ";}"], Padding.none, Padding.none, Padding.none, Padding.xxs, Padding.none);
|
|
8832
|
-
|
|
8833
8139
|
const ValueComponentMulti = props => {
|
|
8834
8140
|
const {
|
|
8835
8141
|
option,
|
|
@@ -8850,7 +8156,6 @@ const ValueComponentMulti = props => {
|
|
|
8850
8156
|
}))
|
|
8851
8157
|
}));
|
|
8852
8158
|
};
|
|
8853
|
-
|
|
8854
8159
|
var ValueComponentMulti$1 = /*#__PURE__*/memo(ValueComponentMulti);
|
|
8855
8160
|
|
|
8856
8161
|
const ValueComponentSingle = props => {
|
|
@@ -8869,7 +8174,6 @@ const ValueComponentSingle = props => {
|
|
|
8869
8174
|
children: props.option.label
|
|
8870
8175
|
}));
|
|
8871
8176
|
};
|
|
8872
|
-
|
|
8873
8177
|
var ValueComponentSingle$1 = /*#__PURE__*/memo(ValueComponentSingle);
|
|
8874
8178
|
|
|
8875
8179
|
const valueStyles = ({
|
|
@@ -8888,7 +8192,6 @@ const valueStyles = ({
|
|
|
8888
8192
|
lineHeight: '20px',
|
|
8889
8193
|
color: `${Text$1.Default}`
|
|
8890
8194
|
});
|
|
8891
|
-
|
|
8892
8195
|
const ValueContainer = /*#__PURE__*/styled(SpaceBetween).withConfig({
|
|
8893
8196
|
displayName: "value__ValueContainer",
|
|
8894
8197
|
componentId: "sc-1aps7dx-0"
|
|
@@ -8908,25 +8211,17 @@ const ValueWrapper$1 = /*#__PURE__*/styled(Flex).withConfig({
|
|
|
8908
8211
|
})(["width:100%;display:", ";"], ({
|
|
8909
8212
|
label,
|
|
8910
8213
|
labelPosition
|
|
8911
|
-
}) => isDefined(label) && !isEmpty(label) && labelPosition === "top"
|
|
8912
|
-
/* labelPositionType.TOP */
|
|
8913
|
-
? 'block' : 'flex');
|
|
8214
|
+
}) => isDefined(label) && !isEmpty(label) && labelPosition === "top" /* labelPositionType.TOP */ ? 'block' : 'flex');
|
|
8914
8215
|
const ValueLabel = /*#__PURE__*/styled(Label$1).withConfig({
|
|
8915
8216
|
displayName: "value__ValueLabel",
|
|
8916
8217
|
componentId: "sc-1aps7dx-2"
|
|
8917
8218
|
})(["padding-left:", ";margin-bottom:", ";display:flex;align-self:", ";width:fit-content;white-space:pre;", ""], Padding.s, ({
|
|
8918
8219
|
labelPosition
|
|
8919
|
-
}) => labelPosition === "top"
|
|
8920
|
-
/* labelPositionType.TOP */
|
|
8921
|
-
? Margin.xxs : Margin.none, ({
|
|
8220
|
+
}) => labelPosition === "top" /* labelPositionType.TOP */ ? Margin.xxs : Margin.none, ({
|
|
8922
8221
|
labelPosition
|
|
8923
|
-
}) => labelPosition === "top"
|
|
8924
|
-
/* labelPositionType.TOP */
|
|
8925
|
-
? 'flex-start' : 'center', ({
|
|
8222
|
+
}) => labelPosition === "top" /* labelPositionType.TOP */ ? 'flex-start' : 'center', ({
|
|
8926
8223
|
labelPosition
|
|
8927
|
-
}) => labelPosition === "top"
|
|
8928
|
-
/* labelPositionType.TOP */
|
|
8929
|
-
&& css(["flex-basis:100%;"]));
|
|
8224
|
+
}) => labelPosition === "top" /* labelPositionType.TOP */ && css(["flex-basis:100%;"]));
|
|
8930
8225
|
const ValueLeft = /*#__PURE__*/styled(Flex).withConfig({
|
|
8931
8226
|
displayName: "value__ValueLeft",
|
|
8932
8227
|
componentId: "sc-1aps7dx-3"
|
|
@@ -8950,7 +8245,6 @@ const ErrorMessage = /*#__PURE__*/styled.div.withConfig({
|
|
|
8950
8245
|
displayName: "value__ErrorMessage",
|
|
8951
8246
|
componentId: "sc-1aps7dx-7"
|
|
8952
8247
|
})(["display:", ";flex-direction:'row';width:100%;padding:", " ", ";& path{fill:", ";}div{color:", ";margin:", " ", "}"], props => is(props.visible) ? 'flex' : 'none', Padding.xxs, Padding.none, Icons.Critical, Text$1.Critical, Margin.none, Margin.xxs);
|
|
8953
|
-
|
|
8954
8248
|
const Value = props => {
|
|
8955
8249
|
const search = /*#__PURE__*/createRef();
|
|
8956
8250
|
useEffect(() => {
|
|
@@ -8970,25 +8264,20 @@ const Value = props => {
|
|
|
8970
8264
|
errors,
|
|
8971
8265
|
label,
|
|
8972
8266
|
searchable,
|
|
8973
|
-
labelPosition = "top"
|
|
8974
|
-
/* labelPositionType.TOP */
|
|
8975
|
-
|
|
8267
|
+
labelPosition = "top" /* labelPositionType.TOP */
|
|
8976
8268
|
} = props;
|
|
8977
8269
|
const valueOptions = getValueOptions(options, value, multi);
|
|
8978
8270
|
const showClearer = is(clearable) && valueOptions.length > 0;
|
|
8979
8271
|
const searchAtStart = !is(multi) || valueOptions.length === 0;
|
|
8980
8272
|
const searchAtEnd = is(multi) && valueOptions.length > 0;
|
|
8981
|
-
|
|
8982
8273
|
const renderSearch = () => {
|
|
8983
8274
|
const {
|
|
8984
8275
|
onSearchFocus,
|
|
8985
8276
|
onSearchBlur
|
|
8986
8277
|
} = props;
|
|
8987
|
-
|
|
8988
8278
|
if (is(disabled) || !is(searchable)) {
|
|
8989
8279
|
return jsx(Nothing, {});
|
|
8990
8280
|
}
|
|
8991
|
-
|
|
8992
8281
|
const canSearch = open && is(searchable) || !isDefined(value) && is(searchable) || isDefined(search.current);
|
|
8993
8282
|
/**
|
|
8994
8283
|
* @TODO this is a hack to be able to use the ref in react-web-client
|
|
@@ -8998,7 +8287,6 @@ const Value = props => {
|
|
|
8998
8287
|
* we will have to use a div and style it the old fashioned way until
|
|
8999
8288
|
* we upgrade rwc's styled-components or drop rwc
|
|
9000
8289
|
*/
|
|
9001
|
-
|
|
9002
8290
|
return jsx("span", {
|
|
9003
8291
|
className: "search",
|
|
9004
8292
|
contentEditable: true,
|
|
@@ -9012,7 +8300,6 @@ const Value = props => {
|
|
|
9012
8300
|
ref: search
|
|
9013
8301
|
});
|
|
9014
8302
|
};
|
|
9015
|
-
|
|
9016
8303
|
const renderLabel = () => {
|
|
9017
8304
|
return maybeRender(label, jsx(ValueLabel, Object.assign({
|
|
9018
8305
|
labelPosition: labelPosition,
|
|
@@ -9022,23 +8309,19 @@ const Value = props => {
|
|
|
9022
8309
|
children: label
|
|
9023
8310
|
})));
|
|
9024
8311
|
};
|
|
9025
|
-
|
|
9026
8312
|
const renderValues = () => {
|
|
9027
8313
|
const {
|
|
9028
8314
|
placeholder,
|
|
9029
8315
|
labelComponent
|
|
9030
8316
|
} = props;
|
|
9031
|
-
|
|
9032
8317
|
if (isDefined(search) && is(searchable) && open && !is(multi)) {
|
|
9033
8318
|
return jsx(Nothing, {});
|
|
9034
8319
|
}
|
|
9035
|
-
|
|
9036
8320
|
if (valueOptions.length === 0 && isNil(search === null || search === void 0 ? void 0 : search.current)) {
|
|
9037
8321
|
return jsx(Placeholder, {
|
|
9038
8322
|
children: defaultTo(placeholder, DEFAULT_PLACEHOLDER)
|
|
9039
8323
|
});
|
|
9040
8324
|
}
|
|
9041
|
-
|
|
9042
8325
|
return valueOptions.map(option => is(multi) ? jsx(ValueComponentMulti$1, {
|
|
9043
8326
|
option: option,
|
|
9044
8327
|
labelComponent: labelComponent,
|
|
@@ -9049,27 +8332,22 @@ const Value = props => {
|
|
|
9049
8332
|
labelComponent: labelComponent
|
|
9050
8333
|
}, toKey(option.value)));
|
|
9051
8334
|
};
|
|
9052
|
-
|
|
9053
8335
|
const focus = () => {
|
|
9054
8336
|
const el = search.current;
|
|
9055
|
-
|
|
9056
8337
|
if (isDefined(el)) {
|
|
9057
8338
|
el.focus();
|
|
9058
8339
|
}
|
|
9059
8340
|
};
|
|
9060
|
-
|
|
9061
8341
|
const onClick = () => {
|
|
9062
8342
|
if (!is(props.disabled)) {
|
|
9063
8343
|
focus();
|
|
9064
8344
|
props.onClick();
|
|
9065
8345
|
}
|
|
9066
8346
|
};
|
|
9067
|
-
|
|
9068
8347
|
const onClear = event => {
|
|
9069
8348
|
event.stopPropagation();
|
|
9070
8349
|
props.onClear();
|
|
9071
8350
|
};
|
|
9072
|
-
|
|
9073
8351
|
const onSearch = event => {
|
|
9074
8352
|
if (is(props.searchable)) {
|
|
9075
8353
|
props.onSearch(event.currentTarget.innerText.trim());
|
|
@@ -9077,13 +8355,11 @@ const Value = props => {
|
|
|
9077
8355
|
event.preventDefault();
|
|
9078
8356
|
}
|
|
9079
8357
|
};
|
|
9080
|
-
|
|
9081
8358
|
const onKeyDown = event => {
|
|
9082
8359
|
if (!is(searchable) && event.key !== keys.TAB || event.key === keys.ENTER || event.key === keys.ARROW_UP || event.key === keys.ARROW_DOWN) {
|
|
9083
8360
|
event.preventDefault();
|
|
9084
8361
|
}
|
|
9085
8362
|
};
|
|
9086
|
-
|
|
9087
8363
|
return jsxs(React.Fragment, {
|
|
9088
8364
|
children: [jsxs(ValueContainer, Object.assign({
|
|
9089
8365
|
"data-role": "value",
|
|
@@ -9130,14 +8406,12 @@ const Value = props => {
|
|
|
9130
8406
|
}), e.message))]
|
|
9131
8407
|
});
|
|
9132
8408
|
};
|
|
9133
|
-
|
|
9134
8409
|
var Value$1 = /*#__PURE__*/memo(Value);
|
|
9135
8410
|
|
|
9136
8411
|
/**
|
|
9137
8412
|
* @TODO Use this container and remove the ContainerStyles
|
|
9138
8413
|
* when we have a solution for RWC styled components, or move away from it.
|
|
9139
8414
|
*/
|
|
9140
|
-
|
|
9141
8415
|
/*const Container = styled.div`
|
|
9142
8416
|
position: relative;
|
|
9143
8417
|
cursor: default;
|
|
@@ -9148,7 +8422,6 @@ var Value$1 = /*#__PURE__*/memo(Value);
|
|
|
9148
8422
|
opacity: ${(props: { disabled?: boolean }) => (is(props.disabled) ? 0.75 : 1)};
|
|
9149
8423
|
user-select: none;
|
|
9150
8424
|
`*/
|
|
9151
|
-
|
|
9152
8425
|
const ContainerStyles = ({
|
|
9153
8426
|
disabled
|
|
9154
8427
|
}) => ({
|
|
@@ -9160,13 +8433,11 @@ const ContainerStyles = ({
|
|
|
9160
8433
|
opacity: is(disabled) ? 0.75 : 1,
|
|
9161
8434
|
userSelect: 'none'
|
|
9162
8435
|
});
|
|
9163
|
-
|
|
9164
8436
|
const SelectImpl = (props, selectRef) => {
|
|
9165
8437
|
if (isNil(selectRef)) {
|
|
9166
8438
|
// eslint-disable-next-line no-null/no-null, react-hooks/rules-of-hooks
|
|
9167
8439
|
selectRef = useRef(null);
|
|
9168
8440
|
}
|
|
9169
|
-
|
|
9170
8441
|
const [open, setOpen] = useState(false);
|
|
9171
8442
|
const [selectedIndex, setSelectedIndex] = useState(undefined);
|
|
9172
8443
|
const [search, setSearch] = useState(undefined);
|
|
@@ -9196,76 +8467,61 @@ const SelectImpl = (props, selectRef) => {
|
|
|
9196
8467
|
const options = getOptions();
|
|
9197
8468
|
const onDocumentClick = useCallback(e => {
|
|
9198
8469
|
const target = e.target;
|
|
9199
|
-
|
|
9200
8470
|
if (isDefined(target) && isDefined(target.closest('.select-menu'))) {
|
|
9201
8471
|
return;
|
|
9202
8472
|
}
|
|
9203
|
-
|
|
9204
8473
|
if (isDefined(selectRef) && typeof selectRef === 'object') {
|
|
9205
8474
|
const {
|
|
9206
8475
|
current
|
|
9207
8476
|
} = selectRef;
|
|
9208
|
-
|
|
9209
8477
|
if (isDefined(current) && !current.contains(target)) {
|
|
9210
8478
|
closeMenu(props.value);
|
|
9211
8479
|
}
|
|
9212
8480
|
}
|
|
9213
8481
|
}, [props.value]);
|
|
9214
|
-
|
|
9215
8482
|
function getOptions() {
|
|
9216
8483
|
if (isDefined(search)) {
|
|
9217
8484
|
return safeArray(props.options).filter(option => option.label.toLowerCase().includes(search.toLowerCase()));
|
|
9218
8485
|
}
|
|
9219
|
-
|
|
9220
8486
|
return defaultTo(props.options, []);
|
|
9221
8487
|
}
|
|
9222
|
-
|
|
9223
8488
|
function openMenu() {
|
|
9224
8489
|
var _a;
|
|
9225
|
-
|
|
9226
8490
|
setOpen(true);
|
|
9227
8491
|
setSearch(isNil(props.value) ? search : undefined);
|
|
9228
8492
|
setSelectedIndex(options.findIndex(option => equal(option.value, props.value)));
|
|
9229
8493
|
(_a = props.onOpen) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
9230
8494
|
addDocumentListener();
|
|
9231
8495
|
}
|
|
9232
|
-
|
|
9233
8496
|
function closeMenu(val, callback) {
|
|
9234
8497
|
var _a;
|
|
9235
|
-
|
|
9236
8498
|
removeDocumentListener();
|
|
9237
8499
|
setOpen(false);
|
|
9238
8500
|
setSearch(isNil(val) ? search : undefined);
|
|
9239
8501
|
setSelectedIndex(undefined);
|
|
9240
8502
|
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
9241
|
-
|
|
9242
8503
|
if (typeof callback === 'function') {
|
|
9243
8504
|
callback();
|
|
9244
8505
|
}
|
|
9245
8506
|
}
|
|
9246
|
-
|
|
9247
8507
|
function addDocumentListener() {
|
|
9248
8508
|
removeDocumentListener();
|
|
9249
8509
|
document === null || document === void 0 ? void 0 : document.addEventListener('click', onDocumentClick, {
|
|
9250
8510
|
capture: true
|
|
9251
8511
|
});
|
|
9252
8512
|
}
|
|
9253
|
-
|
|
9254
8513
|
function onOptionSelect(selectValue, option) {
|
|
9255
8514
|
setFocused(true);
|
|
9256
8515
|
closeMenu(selectValue, () => {
|
|
9257
8516
|
var _a;
|
|
9258
|
-
|
|
9259
8517
|
return (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, selectValue, option);
|
|
9260
8518
|
});
|
|
9261
8519
|
}
|
|
9262
|
-
|
|
9263
8520
|
function removeDocumentListener() {
|
|
9264
8521
|
document === null || document === void 0 ? void 0 : document.removeEventListener('click', onDocumentClick, {
|
|
9265
8522
|
capture: true
|
|
9266
8523
|
});
|
|
9267
8524
|
}
|
|
9268
|
-
|
|
9269
8525
|
function onKeyDown({
|
|
9270
8526
|
key
|
|
9271
8527
|
}) {
|
|
@@ -9274,29 +8530,23 @@ const SelectImpl = (props, selectRef) => {
|
|
|
9274
8530
|
if (open) {
|
|
9275
8531
|
closeMenu(props.value);
|
|
9276
8532
|
}
|
|
9277
|
-
|
|
9278
8533
|
break;
|
|
9279
|
-
|
|
9280
8534
|
case keys.ARROW_UP:
|
|
9281
8535
|
if (open) {
|
|
9282
8536
|
setSelectedIndex(getNewSelectedIndex(key));
|
|
9283
8537
|
} else {
|
|
9284
8538
|
openMenu();
|
|
9285
8539
|
}
|
|
9286
|
-
|
|
9287
8540
|
break;
|
|
9288
|
-
|
|
9289
8541
|
case keys.ARROW_DOWN:
|
|
9290
8542
|
if (open) {
|
|
9291
8543
|
setSelectedIndex(getNewSelectedIndex(key));
|
|
9292
8544
|
} else {
|
|
9293
8545
|
openMenu();
|
|
9294
8546
|
}
|
|
9295
|
-
|
|
9296
8547
|
break;
|
|
9297
8548
|
}
|
|
9298
8549
|
}
|
|
9299
|
-
|
|
9300
8550
|
function onKeyUp({
|
|
9301
8551
|
key
|
|
9302
8552
|
}) {
|
|
@@ -9307,33 +8557,25 @@ const SelectImpl = (props, selectRef) => {
|
|
|
9307
8557
|
const newValue = option.value;
|
|
9308
8558
|
onOptionSelect(Array.isArray(value) && is(multi) ? [...value, newValue] : newValue, option);
|
|
9309
8559
|
}
|
|
9310
|
-
|
|
9311
8560
|
break;
|
|
9312
|
-
|
|
9313
8561
|
case keys.ESC:
|
|
9314
8562
|
if (open) {
|
|
9315
8563
|
closeMenu(value);
|
|
9316
8564
|
}
|
|
9317
|
-
|
|
9318
8565
|
break;
|
|
9319
8566
|
}
|
|
9320
8567
|
}
|
|
9321
|
-
|
|
9322
8568
|
const getNewSelectedIndex = key => {
|
|
9323
8569
|
if (isNil(selectedIndex)) {
|
|
9324
8570
|
return 0;
|
|
9325
8571
|
}
|
|
9326
|
-
|
|
9327
8572
|
let newSelectedIndex = selectedIndex;
|
|
9328
|
-
|
|
9329
8573
|
if (key === keys.ARROW_UP) {
|
|
9330
8574
|
newSelectedIndex = newSelectedIndex - 1;
|
|
9331
|
-
|
|
9332
8575
|
if (newSelectedIndex < 0) {
|
|
9333
8576
|
newSelectedIndex = options.length - 1;
|
|
9334
8577
|
}
|
|
9335
8578
|
}
|
|
9336
|
-
|
|
9337
8579
|
if (key === keys.ARROW_DOWN) {
|
|
9338
8580
|
if (newSelectedIndex === options.length - 1) {
|
|
9339
8581
|
newSelectedIndex = 0;
|
|
@@ -9341,14 +8583,11 @@ const SelectImpl = (props, selectRef) => {
|
|
|
9341
8583
|
newSelectedIndex = newSelectedIndex + 1;
|
|
9342
8584
|
}
|
|
9343
8585
|
}
|
|
9344
|
-
|
|
9345
8586
|
return newSelectedIndex;
|
|
9346
8587
|
};
|
|
9347
|
-
|
|
9348
8588
|
function onClear() {
|
|
9349
8589
|
onOptionSelect(is(props.multi) ? [] : undefined);
|
|
9350
8590
|
}
|
|
9351
|
-
|
|
9352
8591
|
function toggleMenu() {
|
|
9353
8592
|
if (!open) {
|
|
9354
8593
|
openMenu();
|
|
@@ -9356,41 +8595,32 @@ const SelectImpl = (props, selectRef) => {
|
|
|
9356
8595
|
closeMenu(props.value);
|
|
9357
8596
|
}
|
|
9358
8597
|
}
|
|
9359
|
-
|
|
9360
8598
|
function onSearch(searchValue) {
|
|
9361
8599
|
var _a;
|
|
9362
|
-
|
|
9363
8600
|
setSearch(searchValue);
|
|
9364
8601
|
setOpen(true);
|
|
9365
|
-
|
|
9366
8602
|
if (options.length === 1 || isDefined(searchValue)) {
|
|
9367
8603
|
setSelectedIndex(0);
|
|
9368
8604
|
} else {
|
|
9369
8605
|
setSelectedIndex(undefined);
|
|
9370
8606
|
}
|
|
9371
|
-
|
|
9372
8607
|
(_a = props.onSearch) === null || _a === void 0 ? void 0 : _a.call(props, searchValue);
|
|
9373
8608
|
}
|
|
9374
|
-
|
|
9375
8609
|
function onSearchFocus() {
|
|
9376
8610
|
if (!open && !focused) {
|
|
9377
8611
|
openMenu();
|
|
9378
8612
|
}
|
|
9379
|
-
|
|
9380
8613
|
setFocused(true);
|
|
9381
8614
|
}
|
|
9382
|
-
|
|
9383
8615
|
function onSearchBlur() {
|
|
9384
8616
|
setFocused(false);
|
|
9385
8617
|
}
|
|
9386
|
-
|
|
9387
8618
|
function onOptionRemove(removedValue) {
|
|
9388
8619
|
if (Array.isArray(props.value) && is(props.multi)) {
|
|
9389
8620
|
const values = props.value.filter(val => !equal(val, removedValue));
|
|
9390
8621
|
onOptionSelect(values);
|
|
9391
8622
|
}
|
|
9392
8623
|
}
|
|
9393
|
-
|
|
9394
8624
|
const classNames = ['select', className, open && 'open', is(invalid) && 'has-error'].filter(c => Boolean(c));
|
|
9395
8625
|
/**
|
|
9396
8626
|
* @TODO this is a hack to be able to use the ref in react-web-client
|
|
@@ -9400,7 +8630,6 @@ const SelectImpl = (props, selectRef) => {
|
|
|
9400
8630
|
* we will have to use a div and style it the old fashioned way until
|
|
9401
8631
|
* we upgrade rwc's styled-components or drop rwc
|
|
9402
8632
|
*/
|
|
9403
|
-
|
|
9404
8633
|
return jsxs("div", Object.assign({
|
|
9405
8634
|
style: Object.assign(Object.assign({}, style), ContainerStyles({
|
|
9406
8635
|
disabled
|
|
@@ -9453,7 +8682,6 @@ const SelectImpl = (props, selectRef) => {
|
|
|
9453
8682
|
})]
|
|
9454
8683
|
}));
|
|
9455
8684
|
};
|
|
9456
|
-
|
|
9457
8685
|
const Select = forwardRef(SelectImpl);
|
|
9458
8686
|
|
|
9459
8687
|
const MenuListFrame = /*#__PURE__*/styled.div.withConfig({
|
|
@@ -9480,7 +8708,6 @@ const TitleRow = /*#__PURE__*/styled(Heading4).withConfig({
|
|
|
9480
8708
|
displayName: "menu-list__TitleRow",
|
|
9481
8709
|
componentId: "sxh4rn-5"
|
|
9482
8710
|
})(["height:44px;margin:", " ", ";border-bottom:1px solid ", ";display:flex;align-items:center;padding-left:", ";"], Margin.none, Margin.xxs, Borders.Default.Subdued, Padding.s);
|
|
9483
|
-
|
|
9484
8711
|
const Row = props => {
|
|
9485
8712
|
const {
|
|
9486
8713
|
index,
|
|
@@ -9510,7 +8737,6 @@ const Row = props => {
|
|
|
9510
8737
|
}), maybeRender(currentValue.some(val => equal(val, option.value)), jsx(CheckedIcon, {}))]
|
|
9511
8738
|
}));
|
|
9512
8739
|
};
|
|
9513
|
-
|
|
9514
8740
|
const MenuList = props => {
|
|
9515
8741
|
const {
|
|
9516
8742
|
menuHeight = 184
|
|
@@ -9519,10 +8745,10 @@ const MenuList = props => {
|
|
|
9519
8745
|
const optionsHeight = options.reduce(function (acc, obj) {
|
|
9520
8746
|
return acc + (isDefined(obj['helperText']) ? 72 : 52);
|
|
9521
8747
|
}, 0);
|
|
9522
|
-
const height = Math.min(Math.max(optionsHeight, 40), menuHeight);
|
|
9523
|
-
|
|
9524
|
-
const list = useRef(null);
|
|
9525
|
-
|
|
8748
|
+
const height = Math.min(Math.max(optionsHeight, 40), menuHeight);
|
|
8749
|
+
// eslint-disable-next-line no-null/no-null
|
|
8750
|
+
const list = useRef(null);
|
|
8751
|
+
// const { open, selectedIndex, rowHeight } = props
|
|
9526
8752
|
const handleClick = option => {
|
|
9527
8753
|
const newValue = Array.isArray(props.value) && is(props.multi) ? [...props.value, option.value] : option.value;
|
|
9528
8754
|
props.onSelect(newValue);
|
|
@@ -9536,8 +8762,6 @@ const MenuList = props => {
|
|
|
9536
8762
|
* }
|
|
9537
8763
|
*}, [open, list, selectedIndex, rowHeight])
|
|
9538
8764
|
*/
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
8765
|
if (options.length === 0) {
|
|
9542
8766
|
const {
|
|
9543
8767
|
emptyText
|
|
@@ -9552,7 +8776,6 @@ const MenuList = props => {
|
|
|
9552
8776
|
})
|
|
9553
8777
|
}));
|
|
9554
8778
|
}
|
|
9555
|
-
|
|
9556
8779
|
return jsxs(MenuListFrame, Object.assign({
|
|
9557
8780
|
height: height,
|
|
9558
8781
|
ref: list
|
|
@@ -9567,7 +8790,6 @@ const MenuList = props => {
|
|
|
9567
8790
|
};
|
|
9568
8791
|
|
|
9569
8792
|
var CheckboxState;
|
|
9570
|
-
|
|
9571
8793
|
(function (CheckboxState) {
|
|
9572
8794
|
CheckboxState[CheckboxState["UNCHECKED"] = 0] = "UNCHECKED";
|
|
9573
8795
|
CheckboxState[CheckboxState["CHECKED"] = 1] = "CHECKED";
|
|
@@ -9608,7 +8830,6 @@ const TreeNode = props => {
|
|
|
9608
8830
|
label,
|
|
9609
8831
|
expanded
|
|
9610
8832
|
} = props;
|
|
9611
|
-
|
|
9612
8833
|
const handleCheck = () => {
|
|
9613
8834
|
const {
|
|
9614
8835
|
onCheck
|
|
@@ -9621,18 +8842,15 @@ const TreeNode = props => {
|
|
|
9621
8842
|
})
|
|
9622
8843
|
});
|
|
9623
8844
|
};
|
|
9624
|
-
|
|
9625
8845
|
const handleClick = () => {
|
|
9626
8846
|
const {
|
|
9627
8847
|
onClick,
|
|
9628
8848
|
isParent,
|
|
9629
8849
|
expandDisabled
|
|
9630
8850
|
} = props;
|
|
9631
|
-
|
|
9632
8851
|
if (isParent && !expandDisabled) {
|
|
9633
8852
|
handleOnExpand();
|
|
9634
8853
|
}
|
|
9635
|
-
|
|
9636
8854
|
onClick({
|
|
9637
8855
|
label,
|
|
9638
8856
|
value,
|
|
@@ -9641,7 +8859,6 @@ const TreeNode = props => {
|
|
|
9641
8859
|
})
|
|
9642
8860
|
});
|
|
9643
8861
|
};
|
|
9644
|
-
|
|
9645
8862
|
const handleOnExpand = () => {
|
|
9646
8863
|
const {
|
|
9647
8864
|
onExpand
|
|
@@ -9652,29 +8869,23 @@ const TreeNode = props => {
|
|
|
9652
8869
|
expanded: !is(expanded)
|
|
9653
8870
|
});
|
|
9654
8871
|
};
|
|
9655
|
-
|
|
9656
8872
|
const getCheckState = ({
|
|
9657
8873
|
toggle
|
|
9658
8874
|
}) => {
|
|
9659
8875
|
const {
|
|
9660
8876
|
checkState
|
|
9661
8877
|
} = props;
|
|
9662
|
-
|
|
9663
8878
|
if (checkState === CheckboxState.UNCHECKED && toggle) {
|
|
9664
8879
|
return true;
|
|
9665
8880
|
}
|
|
9666
|
-
|
|
9667
8881
|
if (checkState === CheckboxState.CHECKED && !toggle) {
|
|
9668
8882
|
return true;
|
|
9669
8883
|
}
|
|
9670
|
-
|
|
9671
8884
|
if (checkState === CheckboxState.INDETERMINATE) {
|
|
9672
8885
|
return true;
|
|
9673
8886
|
}
|
|
9674
|
-
|
|
9675
8887
|
return false;
|
|
9676
8888
|
};
|
|
9677
|
-
|
|
9678
8889
|
const renderCollapseButton = () => {
|
|
9679
8890
|
const {
|
|
9680
8891
|
expandDisabled,
|
|
@@ -9687,7 +8898,6 @@ const TreeNode = props => {
|
|
|
9687
8898
|
IconSuffix: expanded ? IconMinor.ChevronUpSolid : IconMinor.ChevronDownSolid
|
|
9688
8899
|
}));
|
|
9689
8900
|
};
|
|
9690
|
-
|
|
9691
8901
|
const renderCheckboxLabel = () => {
|
|
9692
8902
|
const {
|
|
9693
8903
|
checkState,
|
|
@@ -9731,7 +8941,6 @@ const TreeNode = props => {
|
|
|
9731
8941
|
}), renderCollapseButton()]
|
|
9732
8942
|
});
|
|
9733
8943
|
};
|
|
9734
|
-
|
|
9735
8944
|
const {
|
|
9736
8945
|
disabled
|
|
9737
8946
|
} = props;
|
|
@@ -9771,45 +8980,36 @@ const flattenNodes = (flattenList, nodes, parent, depth = 0) => {
|
|
|
9771
8980
|
const getNode = (nodes, value) => {
|
|
9772
8981
|
return nodes.find(node => node.value === value);
|
|
9773
8982
|
};
|
|
9774
|
-
|
|
9775
8983
|
const nodeHasChildren = node => {
|
|
9776
8984
|
return isDefined(node.children) && Array.isArray(node.children) && !isEmpty(node.children);
|
|
9777
8985
|
};
|
|
9778
|
-
|
|
9779
8986
|
const getDisabledState = (node, parent) => {
|
|
9780
8987
|
if (isDefined(parent) && is(parent.disabled)) {
|
|
9781
8988
|
return true;
|
|
9782
8989
|
}
|
|
9783
|
-
|
|
9784
8990
|
return is(node.disabled);
|
|
9785
8991
|
};
|
|
9786
|
-
|
|
9787
8992
|
const deserializeList = (flatNodes, lists) => {
|
|
9788
8993
|
flatNodes.forEach(flatNode => {
|
|
9789
8994
|
if (lists.checked.includes(flatNode.value)) {
|
|
9790
8995
|
flatNode.checked = true;
|
|
9791
|
-
|
|
9792
8996
|
if (flatNode.isParent) {
|
|
9793
8997
|
checkAllChildren(flatNodes, flatNode);
|
|
9794
8998
|
}
|
|
9795
8999
|
}
|
|
9796
|
-
|
|
9797
9000
|
if (lists.expanded.includes(flatNode.value)) {
|
|
9798
9001
|
flatNode.expanded = true;
|
|
9799
9002
|
}
|
|
9800
9003
|
});
|
|
9801
9004
|
};
|
|
9802
|
-
|
|
9803
9005
|
const checkAllChildren = (flatNodes, flatNode) => {
|
|
9804
9006
|
defaultTo(flatNode.children, []).forEach(node => {
|
|
9805
9007
|
const _flatoNode = getNode(flatNodes, node.value);
|
|
9806
|
-
|
|
9807
9008
|
if (isDefined(_flatoNode)) {
|
|
9808
9009
|
_flatoNode.checked = true;
|
|
9809
9010
|
}
|
|
9810
9011
|
});
|
|
9811
9012
|
};
|
|
9812
|
-
|
|
9813
9013
|
const serializeList = (flatNodes, key) => {
|
|
9814
9014
|
const list = [];
|
|
9815
9015
|
flatNodes.forEach(node => {
|
|
@@ -9818,7 +9018,6 @@ const serializeList = (flatNodes, key) => {
|
|
|
9818
9018
|
list.push(node.value);
|
|
9819
9019
|
}
|
|
9820
9020
|
}
|
|
9821
|
-
|
|
9822
9021
|
if (key === 'checked') {
|
|
9823
9022
|
if (node.checked) {
|
|
9824
9023
|
list.push(node.value);
|
|
@@ -9829,22 +9028,18 @@ const serializeList = (flatNodes, key) => {
|
|
|
9829
9028
|
};
|
|
9830
9029
|
const toggleChecked = (flatNodes, node, isChecked) => {
|
|
9831
9030
|
const flatNode = getNode(flatNodes, node.value);
|
|
9832
|
-
|
|
9833
9031
|
if (isNil(flatNode)) {
|
|
9834
9032
|
return;
|
|
9835
9033
|
}
|
|
9836
|
-
|
|
9837
9034
|
if (flatNode.isLeaf) {
|
|
9838
9035
|
if (is(node.disabled)) {
|
|
9839
9036
|
return;
|
|
9840
9037
|
}
|
|
9841
|
-
|
|
9842
9038
|
toggleNode(flatNodes, node.value, 'checked', isChecked);
|
|
9843
9039
|
} else {
|
|
9844
9040
|
if (isDefined(flatNode.children) && flatNode.children.length === 0) {
|
|
9845
9041
|
toggleNode(flatNodes, node.value, 'checked', isChecked);
|
|
9846
9042
|
}
|
|
9847
|
-
|
|
9848
9043
|
safeArray(flatNode.children).forEach(child => {
|
|
9849
9044
|
toggleChecked(flatNodes, child, isChecked);
|
|
9850
9045
|
});
|
|
@@ -9852,41 +9047,32 @@ const toggleChecked = (flatNodes, node, isChecked) => {
|
|
|
9852
9047
|
};
|
|
9853
9048
|
const toggleNode = (flatNodes, nodeValue, key, toggleValue) => {
|
|
9854
9049
|
const node = flatNodes.find(_node => _node.value === nodeValue);
|
|
9855
|
-
|
|
9856
9050
|
if (isDefined(node)) {
|
|
9857
9051
|
key === 'checked' ? node.checked = toggleValue : node.expanded = toggleValue;
|
|
9858
9052
|
}
|
|
9859
9053
|
};
|
|
9860
9054
|
const getNodeCheckState = (flattenNodeList, node) => {
|
|
9861
9055
|
const flatNode = getNode(flattenNodeList, node.value);
|
|
9862
|
-
|
|
9863
9056
|
if (is(flatNode === null || flatNode === void 0 ? void 0 : flatNode.isLeaf) || isDefined(node.children) && node.children.length === 0) {
|
|
9864
9057
|
return is(flatNode === null || flatNode === void 0 ? void 0 : flatNode.checked) ? CheckboxState.CHECKED : CheckboxState.UNCHECKED;
|
|
9865
9058
|
}
|
|
9866
|
-
|
|
9867
9059
|
if (is(isEveryChildChecked(flattenNodeList, node))) {
|
|
9868
9060
|
return CheckboxState.CHECKED;
|
|
9869
9061
|
}
|
|
9870
|
-
|
|
9871
9062
|
if (is(isSomeChildChecked(flattenNodeList, node))) {
|
|
9872
9063
|
return CheckboxState.INDETERMINATE;
|
|
9873
9064
|
}
|
|
9874
|
-
|
|
9875
9065
|
return CheckboxState.UNCHECKED;
|
|
9876
9066
|
};
|
|
9877
|
-
|
|
9878
9067
|
const isEveryChildChecked = (flattenNodeList, node) => {
|
|
9879
9068
|
return safeArray(node.children).every(child => {
|
|
9880
9069
|
const _node = getNode(flattenNodeList, child.value);
|
|
9881
|
-
|
|
9882
9070
|
return isDefined(_node) && _node.checkState === 1;
|
|
9883
9071
|
});
|
|
9884
9072
|
};
|
|
9885
|
-
|
|
9886
9073
|
const isSomeChildChecked = (flattenNodeList, node) => {
|
|
9887
9074
|
return safeArray(node.children).some(child => {
|
|
9888
9075
|
const _node = getNode(flattenNodeList, child.value);
|
|
9889
|
-
|
|
9890
9076
|
return isDefined(_node) && _node.checkState > 0;
|
|
9891
9077
|
});
|
|
9892
9078
|
};
|
|
@@ -9922,62 +9108,49 @@ const TreeView = props => {
|
|
|
9922
9108
|
});
|
|
9923
9109
|
return _nodeList;
|
|
9924
9110
|
}, [nodes, checkedList]);
|
|
9925
|
-
|
|
9926
9111
|
const handleOnCheck = nodeInfo => {
|
|
9927
9112
|
const {
|
|
9928
9113
|
onCheck
|
|
9929
9114
|
} = props;
|
|
9930
9115
|
toggleChecked(flattenNodeList, nodeInfo, nodeInfo.checked);
|
|
9931
|
-
|
|
9932
9116
|
if (isDefined(onCheck)) {
|
|
9933
9117
|
onCheck(serializeList(flattenNodeList, 'checked'), Object.assign({}, nodeInfo));
|
|
9934
9118
|
}
|
|
9935
9119
|
};
|
|
9936
|
-
|
|
9937
9120
|
const handleOnExpand = nodeInfo => {
|
|
9938
9121
|
const {
|
|
9939
9122
|
onExpand
|
|
9940
9123
|
} = props;
|
|
9941
9124
|
toggleNode(flattenNodeList, nodeInfo.value, 'expanded', nodeInfo.expanded);
|
|
9942
|
-
|
|
9943
9125
|
if (isDefined(onExpand)) {
|
|
9944
9126
|
onExpand(serializeList(flattenNodeList, 'expanded'), Object.assign({}, nodeInfo));
|
|
9945
9127
|
}
|
|
9946
|
-
|
|
9947
9128
|
setExpandedList(serializeList(flattenNodeList, 'expanded'));
|
|
9948
9129
|
};
|
|
9949
|
-
|
|
9950
9130
|
const onNodeClick = nodeInfo => {
|
|
9951
9131
|
const {
|
|
9952
9132
|
onClick
|
|
9953
9133
|
} = props;
|
|
9954
9134
|
const node = getNode(flattenNodeList, nodeInfo.value);
|
|
9955
|
-
|
|
9956
9135
|
if (isDefined(onClick)) {
|
|
9957
9136
|
onClick(Object.assign(Object.assign({}, node), nodeInfo));
|
|
9958
9137
|
}
|
|
9959
9138
|
};
|
|
9960
|
-
|
|
9961
9139
|
const renderTreeNodes = (nodeList, parent) => {
|
|
9962
9140
|
const {
|
|
9963
9141
|
expandDisabled = false
|
|
9964
9142
|
} = props;
|
|
9965
9143
|
const treeNodes = nodeList.map(node => {
|
|
9966
9144
|
var _a, _b;
|
|
9967
|
-
|
|
9968
9145
|
const flatNode = getNode(flattenNodeList, node.value);
|
|
9969
9146
|
const children = is(flatNode === null || flatNode === void 0 ? void 0 : flatNode.isParent) ? renderTreeNodes(defaultTo(node.children, []), node) : jsx(Nothing, {}, node.value);
|
|
9970
|
-
|
|
9971
9147
|
if (isDefined(flatNode)) {
|
|
9972
9148
|
flatNode.checkState = getNodeCheckState(flattenNodeList, node);
|
|
9973
9149
|
}
|
|
9974
|
-
|
|
9975
9150
|
const parentExpanded = isDefined(parent) && isDefined(parent.value) ? (_a = getNode(flattenNodeList, parent.value)) === null || _a === void 0 ? void 0 : _a.expanded : true;
|
|
9976
|
-
|
|
9977
9151
|
if (!is(parentExpanded)) {
|
|
9978
9152
|
return jsx(Nothing, {}, node.value);
|
|
9979
9153
|
}
|
|
9980
|
-
|
|
9981
9154
|
return jsx(TreeNode, Object.assign({
|
|
9982
9155
|
checkState: defaultTo(flatNode === null || flatNode === void 0 ? void 0 : flatNode.checkState, 0),
|
|
9983
9156
|
disabled: is(flatNode === null || flatNode === void 0 ? void 0 : flatNode.disabled),
|
|
@@ -10006,7 +9179,6 @@ const TreeView = props => {
|
|
|
10006
9179
|
children: treeNodes
|
|
10007
9180
|
}));
|
|
10008
9181
|
};
|
|
10009
|
-
|
|
10010
9182
|
const renderTree = () => {
|
|
10011
9183
|
return useCardContainer ? jsx(Card, Object.assign({
|
|
10012
9184
|
heading: title
|
|
@@ -10028,24 +9200,20 @@ const TreeView = props => {
|
|
|
10028
9200
|
children: renderTreeNodes(nodes)
|
|
10029
9201
|
}));
|
|
10030
9202
|
};
|
|
10031
|
-
|
|
10032
9203
|
return maybeRender(!isEmpty(nodes), renderTree());
|
|
10033
9204
|
};
|
|
10034
9205
|
|
|
10035
9206
|
var TooltipPosition;
|
|
10036
|
-
|
|
10037
9207
|
(function (TooltipPosition) {
|
|
10038
9208
|
TooltipPosition[TooltipPosition["TOP"] = 0] = "TOP";
|
|
10039
9209
|
TooltipPosition[TooltipPosition["BOTTOM"] = 1] = "BOTTOM";
|
|
10040
9210
|
TooltipPosition[TooltipPosition["LEFT"] = 2] = "LEFT";
|
|
10041
9211
|
TooltipPosition[TooltipPosition["RIGHT"] = 3] = "RIGHT";
|
|
10042
9212
|
})(TooltipPosition || (TooltipPosition = {}));
|
|
10043
|
-
|
|
10044
9213
|
const TooltipWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
10045
9214
|
displayName: "tooltip__TooltipWrapper",
|
|
10046
9215
|
componentId: "sc-1rhmjz7-0"
|
|
10047
9216
|
})(["position:relative;display:inline-flex;"]);
|
|
10048
|
-
|
|
10049
9217
|
const getContainerPosition = tooltipPosition => {
|
|
10050
9218
|
const position = {
|
|
10051
9219
|
TOP: css([""]),
|
|
@@ -10056,7 +9224,6 @@ const getContainerPosition = tooltipPosition => {
|
|
|
10056
9224
|
const key = TooltipPosition[tooltipPosition];
|
|
10057
9225
|
return position[key];
|
|
10058
9226
|
};
|
|
10059
|
-
|
|
10060
9227
|
const getTooltipBoxPosition = tooltipPosition => {
|
|
10061
9228
|
const position = {
|
|
10062
9229
|
TOP: css([""]),
|
|
@@ -10067,7 +9234,6 @@ const getTooltipBoxPosition = tooltipPosition => {
|
|
|
10067
9234
|
const key = TooltipPosition[tooltipPosition];
|
|
10068
9235
|
return position[key];
|
|
10069
9236
|
};
|
|
10070
|
-
|
|
10071
9237
|
const CenterContainer = /*#__PURE__*/styled.div.withConfig({
|
|
10072
9238
|
displayName: "tooltip__CenterContainer",
|
|
10073
9239
|
componentId: "sc-1rhmjz7-1"
|
|
@@ -10126,7 +9292,6 @@ const Tooltip = props => {
|
|
|
10126
9292
|
* For a reasonable description of the class names etc,
|
|
10127
9293
|
* @see https://shahabyazdi.github.io/react-multi-date-picker/classes-&-styles/
|
|
10128
9294
|
*/
|
|
10129
|
-
|
|
10130
9295
|
const CustomCalendar = /*#__PURE__*/styled(Calendar$1).withConfig({
|
|
10131
9296
|
displayName: "custom-calendar__CustomCalendar",
|
|
10132
9297
|
componentId: "luqga3-0"
|
|
@@ -10145,9 +9310,7 @@ const InputField = /*#__PURE__*/styled(InputField$1).withConfig({
|
|
|
10145
9310
|
componentId: "sc-1pii8by-2"
|
|
10146
9311
|
})(["margin-bottom:", ";"], Margin.xxs);
|
|
10147
9312
|
const DEFAULT_DATE_FORMAT = 'YYYY-MM-DD';
|
|
10148
|
-
|
|
10149
9313
|
class ControlsSlot extends Slot {}
|
|
10150
|
-
|
|
10151
9314
|
function datePickerFactory({
|
|
10152
9315
|
fromDate,
|
|
10153
9316
|
toDate,
|
|
@@ -10155,21 +9318,20 @@ function datePickerFactory({
|
|
|
10155
9318
|
}) {
|
|
10156
9319
|
const ConcreteDatePicker = props => {
|
|
10157
9320
|
const {
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
10165
|
-
|
|
10166
|
-
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
|
|
10172
|
-
|
|
9321
|
+
value: valueProp,
|
|
9322
|
+
defaultValue,
|
|
9323
|
+
onChange: onChangeProp,
|
|
9324
|
+
onClick,
|
|
9325
|
+
isAvailable = () => true,
|
|
9326
|
+
isOpen,
|
|
9327
|
+
defaultOpen,
|
|
9328
|
+
label,
|
|
9329
|
+
format,
|
|
9330
|
+
children,
|
|
9331
|
+
min,
|
|
9332
|
+
max
|
|
9333
|
+
} = props,
|
|
9334
|
+
HTMLInputProps = __rest(props, ["value", "defaultValue", "onChange", "onClick", "isAvailable", "isOpen", "defaultOpen", "label", "format", "children", "min", "max"]);
|
|
10173
9335
|
const [value, onChange] = useInputElementState({
|
|
10174
9336
|
value: valueProp,
|
|
10175
9337
|
defaultValue,
|
|
@@ -10181,19 +9343,17 @@ function datePickerFactory({
|
|
|
10181
9343
|
onChange: onClick
|
|
10182
9344
|
});
|
|
10183
9345
|
const controls = getSlot(ControlsSlot, children);
|
|
10184
|
-
const calendarChildren = getOtherChildren(children);
|
|
10185
|
-
|
|
9346
|
+
const calendarChildren = getOtherChildren(children);
|
|
9347
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
10186
9348
|
const handleChange = selectedDates => {
|
|
10187
9349
|
const date = first(toArray(selectedDates));
|
|
10188
9350
|
const change = fromDate(date === null || date === void 0 ? void 0 : date.toDate());
|
|
10189
9351
|
onChange(change);
|
|
10190
|
-
|
|
10191
9352
|
if (isNil(props.isOpen)) {
|
|
10192
9353
|
// we don't want to override the user's custom open/close behaviour
|
|
10193
9354
|
setOpen(false);
|
|
10194
9355
|
}
|
|
10195
9356
|
};
|
|
10196
|
-
|
|
10197
9357
|
return jsxs(InputDatePicker, {
|
|
10198
9358
|
children: [!isNothing(controls) ? applyProps(controls.props.children, childProps => Object.assign(Object.assign({}, childProps), {
|
|
10199
9359
|
onClick: isDefined(childProps.onClick) ? childProps.onClick : () => setOpen(!is(open)),
|
|
@@ -10211,9 +9371,7 @@ function datePickerFactory({
|
|
|
10211
9371
|
children: jsx(InputField.Icon, {
|
|
10212
9372
|
children: jsx(IconMinor.Calendar, {})
|
|
10213
9373
|
})
|
|
10214
|
-
})), is(open) ?
|
|
10215
|
-
/** temporary fix while we wait for https://github.com/shahabyazdi/react-multi-date-picker/pull/153 */
|
|
10216
|
-
jsx("div", Object.assign({
|
|
9374
|
+
})), is(open) ? /** temporary fix while we wait for https://github.com/shahabyazdi/react-multi-date-picker/pull/153 */jsx("div", Object.assign({
|
|
10217
9375
|
role: 'dialog'
|
|
10218
9376
|
}, {
|
|
10219
9377
|
children: jsx(Calendar, {
|
|
@@ -10240,23 +9398,18 @@ function datePickerFactory({
|
|
|
10240
9398
|
})) : jsx(Nothing, {})]
|
|
10241
9399
|
});
|
|
10242
9400
|
};
|
|
10243
|
-
|
|
10244
9401
|
ConcreteDatePicker.Controls = ControlsSlot;
|
|
10245
9402
|
ConcreteDatePicker.displayName = 'DatePicker';
|
|
10246
9403
|
return ConcreteDatePicker;
|
|
10247
|
-
|
|
10248
9404
|
function toDateObject(date) {
|
|
10249
9405
|
return new DateObject(toDate(date));
|
|
10250
9406
|
}
|
|
10251
|
-
|
|
10252
9407
|
function defaultFormatter(date, format) {
|
|
10253
9408
|
if (isNil(date)) {
|
|
10254
9409
|
return '';
|
|
10255
9410
|
}
|
|
10256
|
-
|
|
10257
9411
|
return toDateObject(date).format(defaultTo(format, DEFAULT_DATE_FORMAT));
|
|
10258
9412
|
}
|
|
10259
|
-
|
|
10260
9413
|
function formatDate(date, format) {
|
|
10261
9414
|
if (isFunction(format)) {
|
|
10262
9415
|
return format({
|
|
@@ -10264,17 +9417,14 @@ function datePickerFactory({
|
|
|
10264
9417
|
defaultFormatter
|
|
10265
9418
|
});
|
|
10266
9419
|
}
|
|
10267
|
-
|
|
10268
9420
|
if (isNil(date) || empty(date)) {
|
|
10269
9421
|
// same behavior as html input type='date', it shows the format
|
|
10270
9422
|
// even though if you open the picker it goes to TODAY
|
|
10271
9423
|
return isString(format) ? format : DEFAULT_DATE_FORMAT;
|
|
10272
9424
|
}
|
|
10273
|
-
|
|
10274
9425
|
return toDateObject(date).format(defaultTo(format, DEFAULT_DATE_FORMAT));
|
|
10275
9426
|
}
|
|
10276
9427
|
}
|
|
10277
|
-
|
|
10278
9428
|
function renderArrows(direction, handleClick) {
|
|
10279
9429
|
return jsx("button", Object.assign({
|
|
10280
9430
|
type: 'button',
|
|
@@ -10291,19 +9441,15 @@ const DatePicker = datePickerFactory({
|
|
|
10291
9441
|
});
|
|
10292
9442
|
|
|
10293
9443
|
var SliderType;
|
|
10294
|
-
|
|
10295
9444
|
(function (SliderType) {
|
|
10296
9445
|
SliderType[SliderType["SLIDER"] = 0] = "SLIDER";
|
|
10297
9446
|
SliderType[SliderType["RANGE_SLIDER"] = 1] = "RANGE_SLIDER";
|
|
10298
9447
|
})(SliderType || (SliderType = {}));
|
|
10299
|
-
|
|
10300
9448
|
var ValueType;
|
|
10301
|
-
|
|
10302
9449
|
(function (ValueType) {
|
|
10303
9450
|
ValueType[ValueType["MIN"] = 0] = "MIN";
|
|
10304
9451
|
ValueType[ValueType["MAX"] = 1] = "MAX";
|
|
10305
9452
|
})(ValueType || (ValueType = {}));
|
|
10306
|
-
|
|
10307
9453
|
const FieldContainer = /*#__PURE__*/styled.div.withConfig({
|
|
10308
9454
|
displayName: "types__FieldContainer",
|
|
10309
9455
|
componentId: "xsdaaw-0"
|
|
@@ -10338,7 +9484,6 @@ const HandleComponent = /*#__PURE__*/memo(props => {
|
|
|
10338
9484
|
"aria-valuenow": handle.value
|
|
10339
9485
|
}, getHandleProps(handle.id)));
|
|
10340
9486
|
}, arePropsEqual$1);
|
|
10341
|
-
|
|
10342
9487
|
function arePropsEqual$1(oldProps, newProps) {
|
|
10343
9488
|
return oldProps.handle.value === newProps.handle.value && oldProps.handle.percent === newProps.handle.percent;
|
|
10344
9489
|
}
|
|
@@ -10416,7 +9561,6 @@ const TrackComponent = /*#__PURE__*/memo(props => {
|
|
|
10416
9561
|
}, getTrackProps()))]
|
|
10417
9562
|
});
|
|
10418
9563
|
}, arePropsEqual);
|
|
10419
|
-
|
|
10420
9564
|
function arePropsEqual(oldProps, newProps) {
|
|
10421
9565
|
return oldProps.source.value === newProps.source.value && oldProps.target.percent === newProps.target.percent;
|
|
10422
9566
|
}
|
|
@@ -10437,13 +9581,11 @@ const SliderComponent = props => {
|
|
|
10437
9581
|
onChange,
|
|
10438
9582
|
onUpdate
|
|
10439
9583
|
} = props;
|
|
10440
|
-
|
|
10441
9584
|
const handleOnChange = newValues => {
|
|
10442
9585
|
if (values.some((val, index) => val !== newValues[index])) {
|
|
10443
9586
|
onChange(newValues);
|
|
10444
9587
|
}
|
|
10445
9588
|
};
|
|
10446
|
-
|
|
10447
9589
|
return jsxs(Slider$1, Object.assign({
|
|
10448
9590
|
mode: mode,
|
|
10449
9591
|
step: 1,
|
|
@@ -10507,7 +9649,6 @@ const Input = /*#__PURE__*/styled(InputField$1).withConfig({
|
|
|
10507
9649
|
displayName: "slider-inputs__Input",
|
|
10508
9650
|
componentId: "mcw7y8-0"
|
|
10509
9651
|
})(["width:52px;padding:", " ", ";text-align:center;"], Padding.none, Padding.xs);
|
|
10510
|
-
|
|
10511
9652
|
const getNewValue = (intValue, valueType, props) => {
|
|
10512
9653
|
const {
|
|
10513
9654
|
type,
|
|
@@ -10515,15 +9656,12 @@ const getNewValue = (intValue, valueType, props) => {
|
|
|
10515
9656
|
minValue,
|
|
10516
9657
|
maxValue
|
|
10517
9658
|
} = props;
|
|
10518
|
-
|
|
10519
9659
|
if (valueType === ValueType.MIN) {
|
|
10520
9660
|
return Math.min(intValue < range[0] ? range[0] : intValue, maxValue - 1);
|
|
10521
9661
|
}
|
|
10522
|
-
|
|
10523
9662
|
const actualMin = type === SliderType.SLIDER ? range[0] : minValue;
|
|
10524
9663
|
return Math.max(intValue > range[1] ? range[1] : intValue, actualMin + 1);
|
|
10525
9664
|
};
|
|
10526
|
-
|
|
10527
9665
|
const SliderInputs = props => {
|
|
10528
9666
|
const {
|
|
10529
9667
|
type,
|
|
@@ -10540,47 +9678,37 @@ const SliderInputs = props => {
|
|
|
10540
9678
|
setMinValue(minValue);
|
|
10541
9679
|
setMaxValue(maxValue);
|
|
10542
9680
|
}, [minValue, maxValue]);
|
|
10543
|
-
|
|
10544
9681
|
const handleOnBlur = (e, valueType) => {
|
|
10545
9682
|
const intValue = +e.target.value;
|
|
10546
9683
|
const newValue = getNewValue(intValue, valueType, props);
|
|
10547
9684
|
mayCallOnChange(newValue, valueType);
|
|
10548
|
-
|
|
10549
9685
|
if (type === SliderType.SLIDER) {
|
|
10550
9686
|
setMaxValue(newValue);
|
|
10551
9687
|
return;
|
|
10552
9688
|
}
|
|
10553
|
-
|
|
10554
9689
|
if (valueType === ValueType.MIN) {
|
|
10555
9690
|
setMinValue(newValue);
|
|
10556
9691
|
return;
|
|
10557
9692
|
}
|
|
10558
|
-
|
|
10559
9693
|
setMaxValue(newValue);
|
|
10560
9694
|
};
|
|
10561
|
-
|
|
10562
9695
|
const mayCallOnChange = (newValue, valueType) => {
|
|
10563
9696
|
if (type === SliderType.SLIDER) {
|
|
10564
9697
|
if (newValue !== maxValue) {
|
|
10565
9698
|
onChange([newValue]);
|
|
10566
9699
|
}
|
|
10567
|
-
|
|
10568
9700
|
return;
|
|
10569
9701
|
}
|
|
10570
|
-
|
|
10571
9702
|
if (valueType === ValueType.MIN) {
|
|
10572
9703
|
if (newValue !== minValue) {
|
|
10573
9704
|
onChange([newValue, stateMaxValue]);
|
|
10574
9705
|
}
|
|
10575
|
-
|
|
10576
9706
|
return;
|
|
10577
9707
|
}
|
|
10578
|
-
|
|
10579
9708
|
if (newValue !== maxValue) {
|
|
10580
9709
|
onChange([stateMinValue, newValue]);
|
|
10581
9710
|
}
|
|
10582
9711
|
};
|
|
10583
|
-
|
|
10584
9712
|
return type === SliderType.RANGE_SLIDER ? jsxs(Fragment$1, {
|
|
10585
9713
|
children: [jsx(FieldContainer, Object.assign({
|
|
10586
9714
|
margin: 'right'
|
|
@@ -10634,7 +9762,6 @@ const getChartData = (data, highlight) => {
|
|
|
10634
9762
|
};
|
|
10635
9763
|
}).sort((valueA, valueB) => valueA.value - valueB.value);
|
|
10636
9764
|
};
|
|
10637
|
-
|
|
10638
9765
|
const BarChartComponent = props => {
|
|
10639
9766
|
const {
|
|
10640
9767
|
data,
|
|
@@ -10694,18 +9821,14 @@ const RangeSlider = props => {
|
|
|
10694
9821
|
onChange
|
|
10695
9822
|
} = props;
|
|
10696
9823
|
const [update, setUpdate] = useState(values);
|
|
10697
|
-
|
|
10698
9824
|
if (isNil(max) && (isNil(data) || isEmpty(data))) {
|
|
10699
9825
|
return jsx(Nothing, {});
|
|
10700
9826
|
}
|
|
10701
|
-
|
|
10702
9827
|
const range = isDefined(data) ? [Math.min(...data), Math.max(...data)] : [min, max];
|
|
10703
|
-
|
|
10704
9828
|
const handleChange = newValues => {
|
|
10705
9829
|
setUpdate(newValues);
|
|
10706
9830
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValues);
|
|
10707
9831
|
};
|
|
10708
|
-
|
|
10709
9832
|
return jsxs(ComponentWrapper$1, {
|
|
10710
9833
|
children: [isDefined(data) && jsx(ChartContainer, Object.assign({
|
|
10711
9834
|
height: graphHeight,
|
|
@@ -10776,11 +9899,9 @@ const Slider = props => {
|
|
|
10776
9899
|
editable = false
|
|
10777
9900
|
} = props;
|
|
10778
9901
|
const domain = [min, max];
|
|
10779
|
-
|
|
10780
9902
|
const handleChange = newValues => {
|
|
10781
9903
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValues[0]);
|
|
10782
9904
|
};
|
|
10783
|
-
|
|
10784
9905
|
return jsxs(ComponentWrapper, {
|
|
10785
9906
|
children: [isDefined(prefix) && jsx(Label$1, {
|
|
10786
9907
|
children: prefix
|
|
@@ -10812,7 +9933,6 @@ function useKeyDown(targetKey, handler) {
|
|
|
10812
9933
|
handler();
|
|
10813
9934
|
}
|
|
10814
9935
|
}
|
|
10815
|
-
|
|
10816
9936
|
useEffect(() => {
|
|
10817
9937
|
window.addEventListener('keydown', downHandler);
|
|
10818
9938
|
return () => {
|
|
@@ -10848,13 +9968,11 @@ const MODAL_SIZE_TEXT = {
|
|
|
10848
9968
|
LARGE: 'large',
|
|
10849
9969
|
XLARGE: 'xLarge'
|
|
10850
9970
|
};
|
|
10851
|
-
|
|
10852
9971
|
function getModalSize(size) {
|
|
10853
9972
|
const isValidKey = Object.keys(MODAL_SIZE).includes(size);
|
|
10854
9973
|
const validSize = isValidKey ? size : MODAL_SIZE_TEXT.DEFAULT;
|
|
10855
9974
|
return MODAL_SIZE[validSize];
|
|
10856
9975
|
}
|
|
10857
|
-
|
|
10858
9976
|
const ModalBase = props => {
|
|
10859
9977
|
const {
|
|
10860
9978
|
open,
|
|
@@ -10863,33 +9981,27 @@ const ModalBase = props => {
|
|
|
10863
9981
|
modalSize = MODAL_SIZE_TEXT.DEFAULT,
|
|
10864
9982
|
onOverlayClick,
|
|
10865
9983
|
onClose
|
|
10866
|
-
} = props;
|
|
10867
|
-
|
|
9984
|
+
} = props;
|
|
9985
|
+
// eslint-disable-next-line no-null/no-null
|
|
10868
9986
|
const modalRef = useRef(null);
|
|
10869
|
-
|
|
10870
9987
|
const handleEscPress = () => {
|
|
10871
9988
|
if (is(closeOnEsc)) {
|
|
10872
9989
|
onClose();
|
|
10873
9990
|
}
|
|
10874
9991
|
};
|
|
10875
|
-
|
|
10876
9992
|
useKeyDown('Escape', handleEscPress);
|
|
10877
|
-
|
|
10878
9993
|
if (!is(open)) {
|
|
10879
9994
|
document.body.style.overflow = 'unset';
|
|
10880
9995
|
return jsx(Nothing, {});
|
|
10881
9996
|
} else {
|
|
10882
9997
|
document.body.style.overflow = 'hidden';
|
|
10883
9998
|
}
|
|
10884
|
-
|
|
10885
9999
|
const handleOverlayClick = event => {
|
|
10886
10000
|
if (isNil(modalRef.current) || modalRef.current.contains(event.target)) {
|
|
10887
10001
|
return;
|
|
10888
10002
|
}
|
|
10889
|
-
|
|
10890
10003
|
safeCallback(onOverlayClick);
|
|
10891
10004
|
};
|
|
10892
|
-
|
|
10893
10005
|
return jsx(OverlayFrame, Object.assign({
|
|
10894
10006
|
center: true,
|
|
10895
10007
|
onClick: handleOverlayClick,
|
|
@@ -11037,40 +10149,20 @@ const ModalDestructive = props => {
|
|
|
11037
10149
|
|
|
11038
10150
|
function toProgressBarSize(n) {
|
|
11039
10151
|
switch (n) {
|
|
11040
|
-
case 2
|
|
11041
|
-
|
|
11042
|
-
|
|
11043
|
-
return
|
|
11044
|
-
|
|
11045
|
-
;
|
|
11046
|
-
|
|
11047
|
-
case 4
|
|
11048
|
-
/* ProgressBarSize.large */
|
|
11049
|
-
:
|
|
11050
|
-
return 4
|
|
11051
|
-
/* ProgressBarSize.large */
|
|
11052
|
-
;
|
|
11053
|
-
|
|
11054
|
-
case 1
|
|
11055
|
-
/* ProgressBarSize.small */
|
|
11056
|
-
:
|
|
10152
|
+
case 2 /* ProgressBarSize.medium */:
|
|
10153
|
+
return 2 /* ProgressBarSize.medium */;
|
|
10154
|
+
case 4 /* ProgressBarSize.large */:
|
|
10155
|
+
return 4 /* ProgressBarSize.large */;
|
|
10156
|
+
case 1 /* ProgressBarSize.small */:
|
|
11057
10157
|
default:
|
|
11058
|
-
return 1
|
|
11059
|
-
/* ProgressBarSize.small */
|
|
11060
|
-
;
|
|
10158
|
+
return 1 /* ProgressBarSize.small */;
|
|
11061
10159
|
}
|
|
11062
10160
|
}
|
|
11063
10161
|
|
|
11064
10162
|
const ProgressBarValues = {
|
|
11065
|
-
[1
|
|
11066
|
-
/* ProgressBarSize.
|
|
11067
|
-
]: '
|
|
11068
|
-
[2
|
|
11069
|
-
/* ProgressBarSize.medium */
|
|
11070
|
-
]: '16px',
|
|
11071
|
-
[4
|
|
11072
|
-
/* ProgressBarSize.large */
|
|
11073
|
-
]: '32px'
|
|
10163
|
+
[1 /* ProgressBarSize.small */]: '8px',
|
|
10164
|
+
[2 /* ProgressBarSize.medium */]: '16px',
|
|
10165
|
+
[4 /* ProgressBarSize.large */]: '32px'
|
|
11074
10166
|
};
|
|
11075
10167
|
function getValuesBySize$1(props) {
|
|
11076
10168
|
return ProgressBarValues[toProgressBarSize(bitwiseOr$1([props.small, props.medium, props.large]))];
|
|
@@ -11104,58 +10196,28 @@ const ProgressBar = props => {
|
|
|
11104
10196
|
};
|
|
11105
10197
|
|
|
11106
10198
|
// this file was generated, but it is safe to modify
|
|
11107
|
-
|
|
11108
10199
|
function toAvatarSize(n) {
|
|
11109
10200
|
switch (n) {
|
|
11110
|
-
case 1
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
return
|
|
11114
|
-
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
case 2
|
|
11118
|
-
/* AvatarSize.medium */
|
|
11119
|
-
:
|
|
11120
|
-
return 2
|
|
11121
|
-
/* AvatarSize.medium */
|
|
11122
|
-
;
|
|
11123
|
-
|
|
11124
|
-
case 4
|
|
11125
|
-
/* AvatarSize.large */
|
|
11126
|
-
:
|
|
11127
|
-
return 4
|
|
11128
|
-
/* AvatarSize.large */
|
|
11129
|
-
;
|
|
11130
|
-
|
|
10201
|
+
case 1 /* AvatarSize.small */:
|
|
10202
|
+
return 1 /* AvatarSize.small */;
|
|
10203
|
+
case 2 /* AvatarSize.medium */:
|
|
10204
|
+
return 2 /* AvatarSize.medium */;
|
|
10205
|
+
case 4 /* AvatarSize.large */:
|
|
10206
|
+
return 4 /* AvatarSize.large */;
|
|
11131
10207
|
default:
|
|
11132
|
-
return 2
|
|
11133
|
-
/* AvatarSize.medium */
|
|
11134
|
-
;
|
|
10208
|
+
return 2 /* AvatarSize.medium */;
|
|
11135
10209
|
}
|
|
11136
10210
|
}
|
|
11137
10211
|
|
|
11138
10212
|
const AvatarSizeValues = {
|
|
11139
|
-
[1
|
|
11140
|
-
/* AvatarSize.
|
|
11141
|
-
]: '
|
|
11142
|
-
[2
|
|
11143
|
-
/* AvatarSize.medium */
|
|
11144
|
-
]: '40px',
|
|
11145
|
-
[4
|
|
11146
|
-
/* AvatarSize.large */
|
|
11147
|
-
]: '60px'
|
|
10213
|
+
[1 /* AvatarSize.small */]: '32px',
|
|
10214
|
+
[2 /* AvatarSize.medium */]: '40px',
|
|
10215
|
+
[4 /* AvatarSize.large */]: '60px'
|
|
11148
10216
|
};
|
|
11149
10217
|
const AvatarSizeNodes = {
|
|
11150
|
-
[1
|
|
11151
|
-
/* AvatarSize.
|
|
11152
|
-
]:
|
|
11153
|
-
[2
|
|
11154
|
-
/* AvatarSize.medium */
|
|
11155
|
-
]: Body,
|
|
11156
|
-
[4
|
|
11157
|
-
/* AvatarSize.large */
|
|
11158
|
-
]: Display
|
|
10218
|
+
[1 /* AvatarSize.small */]: Label$1,
|
|
10219
|
+
[2 /* AvatarSize.medium */]: Body,
|
|
10220
|
+
[4 /* AvatarSize.large */]: Display
|
|
11159
10221
|
};
|
|
11160
10222
|
function getValuesBySize(props) {
|
|
11161
10223
|
return AvatarSizeValues[toAvatarSize(bitwiseOr$1([props.small, props.medium, props.large]))];
|
|
@@ -11184,17 +10246,13 @@ const FullName = /*#__PURE__*/styled(Label$1).withConfig({
|
|
|
11184
10246
|
displayName: "avatar__FullName",
|
|
11185
10247
|
componentId: "sc-3qe63w-3"
|
|
11186
10248
|
})(["margin-left:", ";"], Margin.xs);
|
|
11187
|
-
|
|
11188
10249
|
const isFirstOrLast = (el, index, items) => isDefined(el) && index === 0 || index === items.length - 1;
|
|
11189
|
-
|
|
11190
10250
|
const getInitial = text => isNil(text) ? '' : text.charAt(0);
|
|
11191
|
-
|
|
11192
10251
|
const getInitialsFromName = name => {
|
|
11193
10252
|
const allNames = name.trim().split(' ');
|
|
11194
10253
|
const initials = allNames.filter(isFirstOrLast).map(getInitial).join('');
|
|
11195
10254
|
return initials;
|
|
11196
10255
|
};
|
|
11197
|
-
|
|
11198
10256
|
const Avatar = props => {
|
|
11199
10257
|
const {
|
|
11200
10258
|
name,
|
|
@@ -11204,11 +10262,9 @@ const Avatar = props => {
|
|
|
11204
10262
|
} = props;
|
|
11205
10263
|
const size = getValuesBySize(props);
|
|
11206
10264
|
const Text = getNodeToRenderText(props);
|
|
11207
|
-
|
|
11208
10265
|
if (!isDefined(name)) {
|
|
11209
10266
|
return jsx(Nothing, {});
|
|
11210
10267
|
}
|
|
11211
|
-
|
|
11212
10268
|
return jsxs(Container$1, Object.assign({
|
|
11213
10269
|
className: props.className
|
|
11214
10270
|
}, {
|
|
@@ -11240,11 +10296,9 @@ const InputCheckbox = props => {
|
|
|
11240
10296
|
label = '',
|
|
11241
10297
|
onChange
|
|
11242
10298
|
} = props;
|
|
11243
|
-
|
|
11244
10299
|
if (isEmpty(label)) {
|
|
11245
10300
|
return jsx(Nothing, {});
|
|
11246
10301
|
}
|
|
11247
|
-
|
|
11248
10302
|
return jsxs(Wrapper, {
|
|
11249
10303
|
children: [jsx(Checkbox, Object.assign({}, props, {
|
|
11250
10304
|
name: isDefined(props.name) ? props.name : label,
|
|
@@ -11272,11 +10326,9 @@ const MultiChoiceList = props => {
|
|
|
11272
10326
|
options,
|
|
11273
10327
|
className = ''
|
|
11274
10328
|
} = props;
|
|
11275
|
-
|
|
11276
10329
|
if (isEmpty(options)) {
|
|
11277
10330
|
return jsx(Nothing, {});
|
|
11278
10331
|
}
|
|
11279
|
-
|
|
11280
10332
|
return jsx(Group, Object.assign({
|
|
11281
10333
|
role: "group",
|
|
11282
10334
|
className: className
|
|
@@ -11302,7 +10354,6 @@ const RadioButton = /*#__PURE__*/styled(RadioButton$1).withConfig({
|
|
|
11302
10354
|
displayName: "choice-list__RadioButton",
|
|
11303
10355
|
componentId: "sc-1jen314-1"
|
|
11304
10356
|
})(["margin-bottom:", ";"], Margin.xxs);
|
|
11305
|
-
|
|
11306
10357
|
const RadioGroup = props => {
|
|
11307
10358
|
return jsx(Fragment, {
|
|
11308
10359
|
children: props.options.map((option, index) => {
|
|
@@ -11320,12 +10371,10 @@ const RadioGroup = props => {
|
|
|
11320
10371
|
})
|
|
11321
10372
|
});
|
|
11322
10373
|
};
|
|
11323
|
-
|
|
11324
10374
|
const ChoiceList = props => {
|
|
11325
10375
|
const handleChange = event => {
|
|
11326
10376
|
props.onChange(event.target.value);
|
|
11327
10377
|
};
|
|
11328
|
-
|
|
11329
10378
|
return jsx(Container, {
|
|
11330
10379
|
children: jsx(RadioGroup, {
|
|
11331
10380
|
options: props.options,
|