@innovaccer/design-system 2.21.0 → 2.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -0
- package/css/dist/MaterialSymbolsRounded.woff2 +0 -0
- package/css/dist/index.css +108 -21
- package/css/dist/index.css.map +1 -1
- package/css/gulpfile.js +1 -1
- package/css/material-design-icons/iconfont/MaterialSymbolsRounded.woff2 +0 -0
- package/css/material-design-icons/iconfont/material-icons.css +9 -15
- package/css/src/components/pageHeader.css +7 -6
- package/css/src/components/selectionCard.css +91 -0
- package/dist/.lib/tsconfig.type.tsbuildinfo +157 -66
- package/dist/core/common.type.d.ts +1 -6
- package/dist/core/components/atoms/_chip/index.d.ts +2 -2
- package/dist/core/components/atoms/button/Button.d.ts +2 -2
- package/dist/core/components/atoms/chip/Chip.d.ts +2 -2
- package/dist/core/components/atoms/dropdown/Dropdown.d.ts +3 -0
- package/dist/core/components/atoms/dropdown/DropdownButton.d.ts +2 -2
- package/dist/core/components/atoms/dropdown/DropdownList.d.ts +8 -0
- package/dist/core/components/atoms/dropdown/ErrorTemplate.d.ts +9 -0
- package/dist/core/components/atoms/dropdown/option/index.d.ts +2 -2
- package/dist/core/components/atoms/icon/Icon.d.ts +0 -8
- package/dist/core/components/atoms/input/Input.d.ts +2 -2
- package/dist/core/components/atoms/input/actionButton/ActionButton.d.ts +2 -2
- package/dist/core/components/atoms/linkButton/LinkButton.d.ts +2 -2
- package/dist/core/components/atoms/metaList/Meta.d.ts +2 -2
- package/dist/core/components/atoms/metricInput/MetricInput.d.ts +2 -2
- package/dist/core/components/atoms/popperWrapper/PopperWrapper.d.ts +15 -15
- package/dist/core/components/atoms/selectionCard/SelectionCard.d.ts +23 -0
- package/dist/core/components/atoms/selectionCard/hooks/index.d.ts +2 -0
- package/dist/core/components/atoms/selectionCard/hooks/useMultiSelect.d.ts +6 -0
- package/dist/core/components/atoms/selectionCard/hooks/useSingleSelect.d.ts +6 -0
- package/dist/core/components/atoms/selectionCard/index.d.ts +2 -0
- package/dist/core/components/molecules/chipInput/ChipInput.d.ts +1 -1
- package/dist/core/components/molecules/tabs/Tabs.d.ts +2 -2
- package/dist/core/components/organisms/pageHeader/PageHeader.d.ts +1 -0
- package/dist/core/components/organisms/pageHeader/utils.d.ts +32 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.type.d.ts +1 -0
- package/dist/core/utils/navigationHelper.d.ts +2 -2
- package/dist/index.esm.js +535 -301
- package/dist/index.js +434 -224
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.br +0 -0
- package/dist/index.umd.js.gz +0 -0
- package/package.json +1 -1
- package/css/dist/MaterialSymbolsOutlined.ttf +0 -0
- package/css/dist/MaterialSymbolsRounded.ttf +0 -0
- package/css/material-design-icons/iconfont/MaterialSymbolsOutlined.ttf +0 -0
- package/css/material-design-icons/iconfont/MaterialSymbolsRounded.ttf +0 -0
- package/dist/core/components/atoms/icon/utils.d.ts +0 -7
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* Generated on:
|
|
3
|
+
* Generated on: 1697533162690
|
|
4
4
|
* Package: @innovaccer/design-system
|
|
5
|
-
* Version: v2.
|
|
5
|
+
* Version: v2.23.0
|
|
6
6
|
* License: MIT
|
|
7
7
|
* Docs: https://innovaccer.github.io/design-system
|
|
8
8
|
*/
|
|
@@ -892,8 +892,8 @@
|
|
|
892
892
|
disabled = props.disabled,
|
|
893
893
|
className = props.className;
|
|
894
894
|
props.tooltip;
|
|
895
|
-
var
|
|
896
|
-
rest = __rest(props, ["size", "appearance", "iconAlign", "tabIndex", "largeIcon", "type", "children", "icon", "expanded", "selected", "loading", "disabled", "className", "tooltip", "
|
|
895
|
+
var iconType = props.iconType,
|
|
896
|
+
rest = __rest(props, ["size", "appearance", "iconAlign", "tabIndex", "largeIcon", "type", "children", "icon", "expanded", "selected", "loading", "disabled", "className", "tooltip", "iconType"]);
|
|
897
897
|
|
|
898
898
|
var buttonClass = classNames__default["default"]((_a = {}, _a['Button'] = true, _a['Button--expanded'] = expanded, _a["Button--" + size] = size, _a["Button--" + size + "Square"] = !children, _a["Button--" + appearance] = appearance, _a['Button--selected'] = selected && (appearance === 'basic' || appearance === 'transparent'), _a["Button--iconAlign-" + iconAlign] = children && iconAlign, _a["" + className] = className, _a));
|
|
899
899
|
var iconClass = classNames__default["default"]((_b = {}, _b['Button-icon'] = true, _b["Button-icon--" + iconAlign] = children && iconAlign, _b));
|
|
@@ -916,7 +916,7 @@
|
|
|
916
916
|
}, /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
917
917
|
"data-test": "DesignSystem-Button--Icon",
|
|
918
918
|
name: icon,
|
|
919
|
-
|
|
919
|
+
type: iconType,
|
|
920
920
|
size: largeIcon && !children ? sizeMapping$3[size] + 4 : sizeMapping$3[size]
|
|
921
921
|
})), children && /*#__PURE__*/React__namespace.createElement("span", {
|
|
922
922
|
className: "Button-text"
|
|
@@ -2341,116 +2341,36 @@
|
|
|
2341
2341
|
});
|
|
2342
2342
|
};
|
|
2343
2343
|
|
|
2344
|
-
var
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
},
|
|
2374
|
-
check_circle_outline: {
|
|
2375
|
-
fill: 0
|
|
2376
|
-
},
|
|
2377
|
-
highlight_of: {
|
|
2378
|
-
fill: 0
|
|
2379
|
-
},
|
|
2380
|
-
credit_card: {
|
|
2381
|
-
fill: 0
|
|
2382
|
-
},
|
|
2383
|
-
delete_outline: {
|
|
2384
|
-
fill: 0
|
|
2385
|
-
},
|
|
2386
|
-
bookmark_border: {
|
|
2387
|
-
fill: 0
|
|
2388
|
-
},
|
|
2389
|
-
work_outline: {
|
|
2390
|
-
fill: 0
|
|
2391
|
-
},
|
|
2392
|
-
alarm: {
|
|
2393
|
-
fill: 0
|
|
2394
|
-
},
|
|
2395
|
-
arrow_circle_up: {
|
|
2396
|
-
fill: 0
|
|
2397
|
-
},
|
|
2398
|
-
copyright: {
|
|
2399
|
-
fill: 0
|
|
2400
|
-
},
|
|
2401
|
-
query_builder: {
|
|
2402
|
-
fill: 0
|
|
2403
|
-
},
|
|
2404
|
-
card_membership: {
|
|
2405
|
-
fill: 0
|
|
2406
|
-
},
|
|
2407
|
-
arrow_circle_down: {
|
|
2408
|
-
fill: 0
|
|
2409
|
-
},
|
|
2410
|
-
change_history: {
|
|
2411
|
-
fill: 0
|
|
2412
|
-
},
|
|
2413
|
-
aspect_ratio: {
|
|
2414
|
-
fill: 0
|
|
2415
|
-
},
|
|
2416
|
-
calendar_view_month: {
|
|
2417
|
-
fill: 0
|
|
2418
|
-
},
|
|
2419
|
-
alarm_on: {
|
|
2420
|
-
fill: 0
|
|
2421
|
-
},
|
|
2422
|
-
thumb_down_off_alt: {
|
|
2423
|
-
fill: 0
|
|
2424
|
-
},
|
|
2425
|
-
important_devices: {
|
|
2426
|
-
fill: 0
|
|
2427
|
-
},
|
|
2428
|
-
turned_in_not: {
|
|
2429
|
-
fill: 0
|
|
2430
|
-
},
|
|
2431
|
-
add_circle_outline: {
|
|
2432
|
-
fill: 0
|
|
2433
|
-
},
|
|
2434
|
-
speed: {
|
|
2435
|
-
fill: 0
|
|
2436
|
-
},
|
|
2437
|
-
content_copy: {
|
|
2438
|
-
fill: 0
|
|
2439
|
-
},
|
|
2440
|
-
timelapse: {
|
|
2441
|
-
fill: 0
|
|
2442
|
-
}
|
|
2344
|
+
var iconTypeMapper = {
|
|
2345
|
+
timelapse: 'outlined',
|
|
2346
|
+
content_copy: 'outlined',
|
|
2347
|
+
speed: 'outlined',
|
|
2348
|
+
add_circle_outline: 'outlined',
|
|
2349
|
+
turned_in_not: 'outlined',
|
|
2350
|
+
important_devices: 'outlined',
|
|
2351
|
+
thumb_down_off_alt: 'outlined',
|
|
2352
|
+
alarm_on: 'outlined',
|
|
2353
|
+
calendar_view_month: 'outlined',
|
|
2354
|
+
aspect_ratio: 'outlined',
|
|
2355
|
+
change_history: 'outlined',
|
|
2356
|
+
arrow_circle_down: 'outlined',
|
|
2357
|
+
card_membership: 'outlined',
|
|
2358
|
+
query_builder: 'outlined',
|
|
2359
|
+
copyright: 'outlined',
|
|
2360
|
+
arrow_circle_up: 'outlined',
|
|
2361
|
+
alarm: 'outlined',
|
|
2362
|
+
work_outline: 'outlined',
|
|
2363
|
+
bookmark_border: 'outlined',
|
|
2364
|
+
delete_outline: 'outlined',
|
|
2365
|
+
credit_card: 'outlined',
|
|
2366
|
+
highlight_of: 'outlined',
|
|
2367
|
+
check_circle_outline: 'outlined',
|
|
2368
|
+
help_outline: 'outlined',
|
|
2369
|
+
schedule: 'outlined',
|
|
2370
|
+
radio_button_unchecked: 'outlined',
|
|
2371
|
+
radio_button_checked: 'outlined',
|
|
2372
|
+
"delete": 'outlined'
|
|
2443
2373
|
};
|
|
2444
|
-
var getFontVariation = function getFontVariation(iconName, variations, type, size) {
|
|
2445
|
-
var defaultVariant = {
|
|
2446
|
-
fill: type === 'outlined' ? 0 : 1,
|
|
2447
|
-
weight: 400,
|
|
2448
|
-
grade: 0,
|
|
2449
|
-
opticalSize: getOpticalSize(size)
|
|
2450
|
-
};
|
|
2451
|
-
return __assign(__assign(__assign({}, defaultVariant), iconVariantMapper[iconName]), variations);
|
|
2452
|
-
};
|
|
2453
|
-
|
|
2454
2374
|
var Icon = function Icon(props) {
|
|
2455
2375
|
var _a;
|
|
2456
2376
|
|
|
@@ -2458,8 +2378,7 @@
|
|
|
2458
2378
|
className = props.className,
|
|
2459
2379
|
name = props.name,
|
|
2460
2380
|
size = props.size,
|
|
2461
|
-
children = props.children
|
|
2462
|
-
variations = props.variations;
|
|
2381
|
+
children = props.children;
|
|
2463
2382
|
var accessibilityProps = useAccessibilityProps(props);
|
|
2464
2383
|
var baseProps = extractBaseProps(props);
|
|
2465
2384
|
var mapper = {
|
|
@@ -2469,7 +2388,7 @@
|
|
|
2469
2388
|
filled: 'rounded',
|
|
2470
2389
|
'two-tone': 'rounded'
|
|
2471
2390
|
};
|
|
2472
|
-
var type = props.type && mapper[props.type] || props.type;
|
|
2391
|
+
var type = props.type && mapper[props.type] || props.type || name && iconTypeMapper[name] || 'rounded';
|
|
2473
2392
|
|
|
2474
2393
|
var getIconAppearance = function getIconAppearance(iconColor) {
|
|
2475
2394
|
var x = iconColor.indexOf('_');
|
|
@@ -2478,17 +2397,9 @@
|
|
|
2478
2397
|
|
|
2479
2398
|
var color = appearance && appearance.includes('_') ? getIconAppearance(appearance) : appearance;
|
|
2480
2399
|
var iconClass = classNames__default["default"]((_a = {}, _a['material-icons'] = true, _a['material-icons-rounded'] = type === 'rounded', _a['material-icons-outlined'] = type === 'outlined', _a['Icon'] = true, _a["Icon--" + color] = appearance, _a["" + className] = className, _a));
|
|
2481
|
-
|
|
2482
|
-
var _b = getFontVariation(name, variations, type, size),
|
|
2483
|
-
fill = _b.fill,
|
|
2484
|
-
grade = _b.grade,
|
|
2485
|
-
opticalSize = _b.opticalSize,
|
|
2486
|
-
weight = _b.weight;
|
|
2487
|
-
|
|
2488
2400
|
var styles = {
|
|
2489
2401
|
fontSize: size + "px",
|
|
2490
|
-
width: size + "px"
|
|
2491
|
-
'font-variation-settings': "\"FILL\" " + fill + ", \"wght\" " + weight + ", \"GRAD\" " + grade + ", \"opsz\" " + opticalSize
|
|
2402
|
+
width: size + "px"
|
|
2492
2403
|
};
|
|
2493
2404
|
|
|
2494
2405
|
if (children && /*#__PURE__*/React__namespace.isValidElement(children)) {
|
|
@@ -2506,8 +2417,7 @@
|
|
|
2506
2417
|
};
|
|
2507
2418
|
Icon.displayName = 'Icon';
|
|
2508
2419
|
Icon.defaultProps = {
|
|
2509
|
-
size: 16
|
|
2510
|
-
type: 'rounded'
|
|
2420
|
+
size: 16
|
|
2511
2421
|
};
|
|
2512
2422
|
|
|
2513
2423
|
var GenericText = function GenericText(_a) {
|
|
@@ -2562,7 +2472,7 @@
|
|
|
2562
2472
|
onClose = props.onClose,
|
|
2563
2473
|
onClick = props.onClick,
|
|
2564
2474
|
labelPrefix = props.labelPrefix,
|
|
2565
|
-
|
|
2475
|
+
iconType = props.iconType;
|
|
2566
2476
|
var baseProps = extractBaseProps(props);
|
|
2567
2477
|
|
|
2568
2478
|
var iconClass = function iconClass(align) {
|
|
@@ -2620,7 +2530,7 @@
|
|
|
2620
2530
|
}), icon && /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
2621
2531
|
"data-test": "DesignSystem-GenericChip--Icon",
|
|
2622
2532
|
name: icon,
|
|
2623
|
-
|
|
2533
|
+
type: iconType,
|
|
2624
2534
|
appearance: iconAppearance('left'),
|
|
2625
2535
|
className: iconClass('left')
|
|
2626
2536
|
}), renderLabel(), clearButton && /*#__PURE__*/React__namespace.createElement("div", {
|
|
@@ -2652,7 +2562,7 @@
|
|
|
2652
2562
|
name = props.name,
|
|
2653
2563
|
className = props.className,
|
|
2654
2564
|
labelPrefix = props.labelPrefix,
|
|
2655
|
-
|
|
2565
|
+
iconType = props.iconType;
|
|
2656
2566
|
var baseProps = extractBaseProps(props);
|
|
2657
2567
|
|
|
2658
2568
|
var onCloseHandler = function onCloseHandler() {
|
|
@@ -2674,7 +2584,7 @@
|
|
|
2674
2584
|
label: label,
|
|
2675
2585
|
selected: select,
|
|
2676
2586
|
icon: icon,
|
|
2677
|
-
|
|
2587
|
+
iconType: iconType,
|
|
2678
2588
|
clearButton: clearbutton,
|
|
2679
2589
|
disabled: disabled,
|
|
2680
2590
|
className: chipClass,
|
|
@@ -2720,7 +2630,7 @@
|
|
|
2720
2630
|
selected = item.selected,
|
|
2721
2631
|
clearButton = item.clearButton,
|
|
2722
2632
|
name = item.name,
|
|
2723
|
-
|
|
2633
|
+
iconType = item.iconType;
|
|
2724
2634
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
2725
2635
|
key: ind,
|
|
2726
2636
|
className: "ChipGroup-item"
|
|
@@ -2732,7 +2642,7 @@
|
|
|
2732
2642
|
icon: icon,
|
|
2733
2643
|
disabled: disabled,
|
|
2734
2644
|
clearButton: clearButton,
|
|
2735
|
-
|
|
2645
|
+
iconType: iconType,
|
|
2736
2646
|
type: type,
|
|
2737
2647
|
onClick: function onClick() {
|
|
2738
2648
|
return onClickHandler(item);
|
|
@@ -4154,8 +4064,8 @@
|
|
|
4154
4064
|
open = props.open,
|
|
4155
4065
|
inlineLabel = props.inlineLabel,
|
|
4156
4066
|
error = props.error,
|
|
4157
|
-
|
|
4158
|
-
rest = __rest(props, ["triggerSize", "placeholder", "menu", "children", "icon", "disabled", "open", "inlineLabel", "error", "
|
|
4067
|
+
iconType = props.iconType,
|
|
4068
|
+
rest = __rest(props, ["triggerSize", "placeholder", "menu", "children", "icon", "disabled", "open", "inlineLabel", "error", "iconType"]);
|
|
4159
4069
|
|
|
4160
4070
|
var buttonDisabled = disabled ? 'disabled' : 'default';
|
|
4161
4071
|
var trimmedPlaceholder = placeholder.trim();
|
|
@@ -4180,13 +4090,13 @@
|
|
|
4180
4090
|
appearance: buttonDisabled,
|
|
4181
4091
|
className: "d-flex align-items-center mr-4",
|
|
4182
4092
|
name: icon,
|
|
4183
|
-
|
|
4093
|
+
type: iconType
|
|
4184
4094
|
}), value && /*#__PURE__*/React__namespace.createElement("span", {
|
|
4185
4095
|
className: textClass
|
|
4186
4096
|
}, value)), /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
4187
4097
|
appearance: buttonDisabled,
|
|
4188
4098
|
name: iconName,
|
|
4189
|
-
|
|
4099
|
+
type: iconType
|
|
4190
4100
|
}));
|
|
4191
4101
|
});
|
|
4192
4102
|
DropdownButton.displayName = 'DropdownButton';
|
|
@@ -4313,7 +4223,7 @@
|
|
|
4313
4223
|
var label = optionData.label,
|
|
4314
4224
|
icon = optionData.icon,
|
|
4315
4225
|
disabled = optionData.disabled,
|
|
4316
|
-
|
|
4226
|
+
iconType = optionData.iconType;
|
|
4317
4227
|
var OptionClass = classNames__default["default"]((_a = {}, _a["" + className] = true, _a['Option--icon'] = icon, _a));
|
|
4318
4228
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
4319
4229
|
className: OptionClass,
|
|
@@ -4325,7 +4235,7 @@
|
|
|
4325
4235
|
className: "Option-icon mr-4",
|
|
4326
4236
|
"data-test": dataTest + "--Icon",
|
|
4327
4237
|
name: icon,
|
|
4328
|
-
|
|
4238
|
+
type: iconType
|
|
4329
4239
|
}), /*#__PURE__*/React__namespace.createElement("div", {
|
|
4330
4240
|
className: 'Option-label'
|
|
4331
4241
|
}, /*#__PURE__*/React__namespace.createElement(Text, {
|
|
@@ -4618,6 +4528,47 @@
|
|
|
4618
4528
|
return null;
|
|
4619
4529
|
};
|
|
4620
4530
|
|
|
4531
|
+
var errorTitle = {
|
|
4532
|
+
FAILED_TO_FETCH: 'Failed to fetch data',
|
|
4533
|
+
NO_RECORDS_FOUND: 'No results found',
|
|
4534
|
+
DEFAULT: 'No record available'
|
|
4535
|
+
};
|
|
4536
|
+
var errorDescription = {
|
|
4537
|
+
FAILED_TO_FETCH: "We couldn't load the data, try reloading.",
|
|
4538
|
+
NO_RECORDS_FOUND: 'Try modifying your search to find what you are looking for.',
|
|
4539
|
+
DEFAULT: 'We have nothing to show you at the moment.'
|
|
4540
|
+
};
|
|
4541
|
+
var ErrorTemplate = function ErrorTemplate(_a) {
|
|
4542
|
+
var dropdownStyle = _a.dropdownStyle,
|
|
4543
|
+
errorType = _a.errorType,
|
|
4544
|
+
updateOptions = _a.updateOptions;
|
|
4545
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
4546
|
+
className: "Dropdown-wrapper px-7 d-flex",
|
|
4547
|
+
style: dropdownStyle,
|
|
4548
|
+
"data-test": "DesignSystem-Dropdown--wrapper"
|
|
4549
|
+
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
4550
|
+
className: "d-flex flex-column justify-content-center align-items-center",
|
|
4551
|
+
"data-test": "DesignSystem-Dropdown--errorWrapper"
|
|
4552
|
+
}, /*#__PURE__*/React__namespace.createElement(Text, {
|
|
4553
|
+
className: "mb-3",
|
|
4554
|
+
weight: "strong"
|
|
4555
|
+
}, errorTitle[errorType]), /*#__PURE__*/React__namespace.createElement(Text, {
|
|
4556
|
+
className: "text-align-center mb-6",
|
|
4557
|
+
weight: "medium",
|
|
4558
|
+
size: "small",
|
|
4559
|
+
appearance: "subtle"
|
|
4560
|
+
}, errorDescription[errorType]), errorType === 'FAILED_TO_FETCH' && /*#__PURE__*/React__namespace.createElement(Button, {
|
|
4561
|
+
size: "tiny",
|
|
4562
|
+
largeIcon: true,
|
|
4563
|
+
"aria-label": "reload",
|
|
4564
|
+
icon: "refresh",
|
|
4565
|
+
iconAlign: "left",
|
|
4566
|
+
onClick: function onClick() {
|
|
4567
|
+
return updateOptions();
|
|
4568
|
+
}
|
|
4569
|
+
}, "Reload")));
|
|
4570
|
+
};
|
|
4571
|
+
|
|
4621
4572
|
var alignmentMapping = {
|
|
4622
4573
|
right: 'bottom-start',
|
|
4623
4574
|
left: 'bottom-end'
|
|
@@ -4664,7 +4615,11 @@
|
|
|
4664
4615
|
className = props.className,
|
|
4665
4616
|
_m = props.searchPlaceholder,
|
|
4666
4617
|
searchPlaceholder = _m === void 0 ? 'Search..' : _m,
|
|
4667
|
-
scrollIndex = props.scrollIndex
|
|
4618
|
+
scrollIndex = props.scrollIndex,
|
|
4619
|
+
updateOptions = props.updateOptions,
|
|
4620
|
+
noResultMessage = props.noResultMessage,
|
|
4621
|
+
errorType = props.errorType,
|
|
4622
|
+
loadingOptions = props.loadingOptions;
|
|
4668
4623
|
var baseProps = extractBaseProps(props);
|
|
4669
4624
|
var dropdownRef = /*#__PURE__*/React__namespace.createRef();
|
|
4670
4625
|
var triggerRef = /*#__PURE__*/React__namespace.createRef();
|
|
@@ -4690,6 +4645,7 @@
|
|
|
4690
4645
|
minHeight && setMinHeight(minHeight);
|
|
4691
4646
|
};
|
|
4692
4647
|
|
|
4648
|
+
var isDropdownListBlank = listOptions.length === 0 && !loadingOptions && selected.length <= 0;
|
|
4693
4649
|
React__namespace.useEffect(function () {
|
|
4694
4650
|
var _a;
|
|
4695
4651
|
|
|
@@ -4732,7 +4688,7 @@
|
|
|
4732
4688
|
disabled = props.disabled,
|
|
4733
4689
|
inlineLabel = props.inlineLabel,
|
|
4734
4690
|
triggerLabel = props.triggerLabel,
|
|
4735
|
-
|
|
4691
|
+
iconType = props.iconType;
|
|
4736
4692
|
var CustomTrigger = customTrigger ? customTrigger(triggerLabel ? triggerLabel : placeholder) : /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null);
|
|
4737
4693
|
var NewCustomTrigger = /*#__PURE__*/React__namespace.cloneElement(CustomTrigger, {
|
|
4738
4694
|
tabIndex: 0,
|
|
@@ -4748,7 +4704,7 @@
|
|
|
4748
4704
|
menu: menu,
|
|
4749
4705
|
error: error,
|
|
4750
4706
|
ref: dropdownTriggerRef,
|
|
4751
|
-
|
|
4707
|
+
iconType: iconType
|
|
4752
4708
|
}, triggerLabel);
|
|
4753
4709
|
var dropdownStyle = {
|
|
4754
4710
|
maxHeight: maxHeight,
|
|
@@ -4763,6 +4719,16 @@
|
|
|
4763
4719
|
minHeight: minHeight
|
|
4764
4720
|
};
|
|
4765
4721
|
|
|
4722
|
+
var defaultErrorTemplate = function defaultErrorTemplate() {
|
|
4723
|
+
return /*#__PURE__*/React__namespace.createElement(ErrorTemplate, {
|
|
4724
|
+
dropdownStyle: __assign(__assign({}, dropdownStyle), {
|
|
4725
|
+
minHeight: maxHeight
|
|
4726
|
+
}),
|
|
4727
|
+
updateOptions: updateOptions,
|
|
4728
|
+
errorType: errorType
|
|
4729
|
+
});
|
|
4730
|
+
};
|
|
4731
|
+
|
|
4766
4732
|
var getDropdownSectionClass = function getDropdownSectionClass(showClearButton) {
|
|
4767
4733
|
var _a;
|
|
4768
4734
|
|
|
@@ -4969,7 +4935,8 @@
|
|
|
4969
4935
|
allItemsSectionLabel = _c === void 0 ? 'All Items' : _c,
|
|
4970
4936
|
_d = props.loadersCount,
|
|
4971
4937
|
loadersCount = _d === void 0 ? 10 : _d,
|
|
4972
|
-
|
|
4938
|
+
_e = props.errorTemplate,
|
|
4939
|
+
errorTemplate = _e === void 0 ? defaultErrorTemplate : _e;
|
|
4973
4940
|
|
|
4974
4941
|
var selectAllPresent = _isSelectAllPresent(searchTerm, remainingOptions, withSelectAll, withCheckbox);
|
|
4975
4942
|
|
|
@@ -4984,18 +4951,22 @@
|
|
|
4984
4951
|
}, renderLoading(loadersCount)));
|
|
4985
4952
|
}
|
|
4986
4953
|
|
|
4987
|
-
if (
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
"
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
}
|
|
4954
|
+
if (isDropdownListBlank) {
|
|
4955
|
+
if (noResultMessage) {
|
|
4956
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
4957
|
+
className: "Dropdown-wrapper",
|
|
4958
|
+
style: dropdownStyle,
|
|
4959
|
+
"data-test": "DesignSystem-Dropdown--errorWrapper"
|
|
4960
|
+
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
4961
|
+
className: 'Option'
|
|
4962
|
+
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
4963
|
+
className: 'Option-subinfo'
|
|
4964
|
+
}, noResultMessage)));
|
|
4965
|
+
} else {
|
|
4966
|
+
return errorTemplate && errorTemplate({
|
|
4967
|
+
errorType: errorType
|
|
4968
|
+
});
|
|
4969
|
+
}
|
|
4999
4970
|
}
|
|
5000
4971
|
|
|
5001
4972
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
@@ -5104,6 +5075,7 @@
|
|
|
5104
5075
|
}
|
|
5105
5076
|
};
|
|
5106
5077
|
|
|
5078
|
+
var enableSearch = (withSearch || props.async) && (!isDropdownListBlank || errorType === 'NO_RECORDS_FOUND');
|
|
5107
5079
|
return /*#__PURE__*/React__namespace.createElement("div", __assign({}, baseProps, {
|
|
5108
5080
|
className: dropdownClass,
|
|
5109
5081
|
ref: triggerRef,
|
|
@@ -5117,7 +5089,7 @@
|
|
|
5117
5089
|
position: alignmentMapping[align]
|
|
5118
5090
|
}, popoverOptions, {
|
|
5119
5091
|
"data-test": "DesignSystem-Dropdown--Popover"
|
|
5120
|
-
}),
|
|
5092
|
+
}), enableSearch && renderSearch(), renderDropdownSection(), showApplyButton && withCheckbox && renderApplyButton()));
|
|
5121
5093
|
};
|
|
5122
5094
|
|
|
5123
5095
|
DropdownList.displayName = 'DropdownList';
|
|
@@ -5195,7 +5167,8 @@
|
|
|
5195
5167
|
searchTerm = _a.searchTerm,
|
|
5196
5168
|
selectAll = _a.selectAll,
|
|
5197
5169
|
tempSelected = _a.tempSelected,
|
|
5198
|
-
previousSelected = _a.previousSelected
|
|
5170
|
+
previousSelected = _a.previousSelected,
|
|
5171
|
+
errorType = _a.errorType;
|
|
5199
5172
|
var updatedAsync = async === undefined ? _this.state.async : async;
|
|
5200
5173
|
var _b = _this.props,
|
|
5201
5174
|
fetchOptions = _b.fetchOptions,
|
|
@@ -5222,7 +5195,18 @@
|
|
|
5222
5195
|
|
|
5223
5196
|
var disabledOptions = _this.getDisabledOptions(unSelectedGroup.slice(0, _this.staticLimit));
|
|
5224
5197
|
|
|
5198
|
+
var errorResult = errorType;
|
|
5199
|
+
|
|
5200
|
+
if (optionsLength === 0 && searchTerm === '') {
|
|
5201
|
+
errorResult = 'DEFAULT';
|
|
5202
|
+
} else if (searchTerm !== '') {
|
|
5203
|
+
errorResult = 'NO_RECORDS_FOUND';
|
|
5204
|
+
} else {
|
|
5205
|
+
errorResult = 'FAILED_TO_FETCH';
|
|
5206
|
+
}
|
|
5207
|
+
|
|
5225
5208
|
_this.setState(__assign(__assign({}, _this.state), {
|
|
5209
|
+
errorType: fetchOptions ? errorResult : errorType,
|
|
5226
5210
|
scrollIndex: res.scrollToIndex || 0,
|
|
5227
5211
|
optionsLength: optionsLength,
|
|
5228
5212
|
loading: false,
|
|
@@ -5238,6 +5222,11 @@
|
|
|
5238
5222
|
|
|
5239
5223
|
if (updatedAsync || withSearch) (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
5240
5224
|
}
|
|
5225
|
+
})["catch"](function () {
|
|
5226
|
+
_this.setState({
|
|
5227
|
+
errorType: fetchOptions ? 'FAILED_TO_FETCH' : errorType,
|
|
5228
|
+
loading: false
|
|
5229
|
+
});
|
|
5241
5230
|
});
|
|
5242
5231
|
};
|
|
5243
5232
|
|
|
@@ -5245,7 +5234,8 @@
|
|
|
5245
5234
|
_this.setState(__assign(__assign({}, _this.state), {
|
|
5246
5235
|
loading: true,
|
|
5247
5236
|
searchInit: true,
|
|
5248
|
-
searchTerm: search
|
|
5237
|
+
searchTerm: search,
|
|
5238
|
+
errorType: 'NO_RECORDS_FOUND'
|
|
5249
5239
|
}));
|
|
5250
5240
|
};
|
|
5251
5241
|
|
|
@@ -5493,6 +5483,15 @@
|
|
|
5493
5483
|
_this.updateOptions(false);
|
|
5494
5484
|
});
|
|
5495
5485
|
});
|
|
5486
|
+
|
|
5487
|
+
_this.reload = function () {
|
|
5488
|
+
_this.setState({
|
|
5489
|
+
loading: true
|
|
5490
|
+
}, function () {
|
|
5491
|
+
_this.updateOptions(false);
|
|
5492
|
+
});
|
|
5493
|
+
};
|
|
5494
|
+
|
|
5496
5495
|
_this.debounceClear = debounce(250, function () {
|
|
5497
5496
|
return _this.updateOptions(false);
|
|
5498
5497
|
});
|
|
@@ -5660,7 +5659,8 @@
|
|
|
5660
5659
|
previousSelected: selectedGroup,
|
|
5661
5660
|
selected: _showSelectedItems(async, '', withCheckbox) ? selected : [],
|
|
5662
5661
|
triggerLabel: _this.updateTriggerLabel(selectedGroup, optionsLength),
|
|
5663
|
-
selectAll: getSelectAll$1(selectedGroup, optionsLength, disabledOptions.length)
|
|
5662
|
+
selectAll: getSelectAll$1(selectedGroup, optionsLength, disabledOptions.length),
|
|
5663
|
+
errorType: 'DEFAULT'
|
|
5664
5664
|
};
|
|
5665
5665
|
return _this;
|
|
5666
5666
|
}
|
|
@@ -5730,7 +5730,8 @@
|
|
|
5730
5730
|
selectAll = _a.selectAll,
|
|
5731
5731
|
triggerLabel = _a.triggerLabel,
|
|
5732
5732
|
previousSelected = _a.previousSelected,
|
|
5733
|
-
scrollIndex = _a.scrollIndex
|
|
5733
|
+
scrollIndex = _a.scrollIndex,
|
|
5734
|
+
errorType = _a.errorType;
|
|
5734
5735
|
var _b = this.props,
|
|
5735
5736
|
_c = _b.withSelectAll,
|
|
5736
5737
|
withSelectAll = _c === void 0 ? true : _c,
|
|
@@ -5771,7 +5772,9 @@
|
|
|
5771
5772
|
onOptionSelect: this.onOptionSelect,
|
|
5772
5773
|
onSelectAll: this.onSelectAll,
|
|
5773
5774
|
customTrigger: triggerOptions.customTrigger,
|
|
5774
|
-
scrollIndex: scrollIndex
|
|
5775
|
+
scrollIndex: scrollIndex,
|
|
5776
|
+
updateOptions: this.reload,
|
|
5777
|
+
errorType: errorType
|
|
5775
5778
|
}, rest));
|
|
5776
5779
|
};
|
|
5777
5780
|
|
|
@@ -5822,13 +5825,13 @@
|
|
|
5822
5825
|
var _a;
|
|
5823
5826
|
|
|
5824
5827
|
var className = props.className,
|
|
5825
|
-
|
|
5826
|
-
rest = __rest(props, ["className", "
|
|
5828
|
+
iconType = props.iconType,
|
|
5829
|
+
rest = __rest(props, ["className", "iconType"]);
|
|
5827
5830
|
|
|
5828
5831
|
var iconClass = classNames__default["default"]((_a = {}, _a['ActionButton'] = true, _a["" + className] = className, _a));
|
|
5829
5832
|
return /*#__PURE__*/React__namespace.createElement(Icon, __assign({
|
|
5830
5833
|
className: iconClass,
|
|
5831
|
-
|
|
5834
|
+
type: iconType,
|
|
5832
5835
|
"data-test": "DesignSystem-Input-ActionButton"
|
|
5833
5836
|
}, rest));
|
|
5834
5837
|
};
|
|
@@ -5872,8 +5875,8 @@
|
|
|
5872
5875
|
autoFocus = props.autoFocus,
|
|
5873
5876
|
disabled = props.disabled,
|
|
5874
5877
|
readOnly = props.readOnly,
|
|
5875
|
-
|
|
5876
|
-
rest = __rest(props, ["size", "type", "minWidth", "defaultValue", "name", "placeholder", "value", "icon", "inlineLabel", "required", "error", "info", "onChange", "onClick", "onClear", "onBlur", "onFocus", "onPaste", "actionIcon", "className", "autoFocus", "disabled", "readOnly", "
|
|
5878
|
+
iconType = props.iconType,
|
|
5879
|
+
rest = __rest(props, ["size", "type", "minWidth", "defaultValue", "name", "placeholder", "value", "icon", "inlineLabel", "required", "error", "info", "onChange", "onClick", "onClear", "onBlur", "onFocus", "onPaste", "actionIcon", "className", "autoFocus", "disabled", "readOnly", "iconType"]);
|
|
5877
5880
|
|
|
5878
5881
|
var ref = React__namespace.useRef(null);
|
|
5879
5882
|
|
|
@@ -5930,7 +5933,7 @@
|
|
|
5930
5933
|
}, /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
5931
5934
|
name: icon,
|
|
5932
5935
|
size: sizeMapping$2[size],
|
|
5933
|
-
|
|
5936
|
+
type: iconType
|
|
5934
5937
|
})), /*#__PURE__*/React__namespace.createElement("input", __assign({
|
|
5935
5938
|
"data-test": "DesignSystem-Input"
|
|
5936
5939
|
}, baseProps, rest, {
|
|
@@ -6022,8 +6025,8 @@
|
|
|
6022
6025
|
_h = props.showActionButton,
|
|
6023
6026
|
showActionButton = _h === void 0 ? true : _h,
|
|
6024
6027
|
onKeyDown = props.onKeyDown,
|
|
6025
|
-
|
|
6026
|
-
rest = __rest(props, ["size", "defaultValue", "name", "placeholder", "icon", "prefix", "suffix", "error", "min", "max", "onChange", "onClick", "onBlur", "onFocus", "className", "autoFocus", "disabled", "readOnly", "value", "showActionButton", "onKeyDown", "
|
|
6028
|
+
iconType = props.iconType,
|
|
6029
|
+
rest = __rest(props, ["size", "defaultValue", "name", "placeholder", "icon", "prefix", "suffix", "error", "min", "max", "onChange", "onClick", "onBlur", "onFocus", "className", "autoFocus", "disabled", "readOnly", "value", "showActionButton", "onKeyDown", "iconType"]);
|
|
6027
6030
|
|
|
6028
6031
|
var ref = React__namespace.useRef(null);
|
|
6029
6032
|
var isUncontrolled = valueProp === undefined;
|
|
@@ -6120,7 +6123,7 @@
|
|
|
6120
6123
|
}, icon && /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
6121
6124
|
"data-test": "DesignSystem-MetricInput--icon",
|
|
6122
6125
|
name: icon,
|
|
6123
|
-
|
|
6126
|
+
type: iconType,
|
|
6124
6127
|
size: sizeMapping$1[size],
|
|
6125
6128
|
appearance: !value ? 'disabled' : 'subtle',
|
|
6126
6129
|
className: iconClass
|
|
@@ -6862,7 +6865,7 @@
|
|
|
6862
6865
|
var label = props.label,
|
|
6863
6866
|
icon = props.icon,
|
|
6864
6867
|
size = props.size,
|
|
6865
|
-
|
|
6868
|
+
iconType = props.iconType;
|
|
6866
6869
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
6867
6870
|
"data-test": "DesignSystem-MetaList--Meta",
|
|
6868
6871
|
className: 'Meta'
|
|
@@ -6871,7 +6874,7 @@
|
|
|
6871
6874
|
name: icon,
|
|
6872
6875
|
appearance: "subtle",
|
|
6873
6876
|
className: 'Meta-icon',
|
|
6874
|
-
|
|
6877
|
+
type: iconType,
|
|
6875
6878
|
size: size === 'regular' ? 16 : 12
|
|
6876
6879
|
}), /*#__PURE__*/React__namespace.createElement(Text, {
|
|
6877
6880
|
size: size,
|
|
@@ -6906,7 +6909,7 @@
|
|
|
6906
6909
|
var _a = item.label,
|
|
6907
6910
|
label = _a === void 0 ? '' : _a,
|
|
6908
6911
|
icon = item.icon,
|
|
6909
|
-
|
|
6912
|
+
iconType = item.iconType;
|
|
6910
6913
|
var rightSeperator = ind !== list.length - 1;
|
|
6911
6914
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
6912
6915
|
key: ind,
|
|
@@ -6915,7 +6918,7 @@
|
|
|
6915
6918
|
size: size,
|
|
6916
6919
|
label: label,
|
|
6917
6920
|
icon: icon,
|
|
6918
|
-
|
|
6921
|
+
iconType: iconType
|
|
6919
6922
|
}), rightSeperator && /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
6920
6923
|
"data-test": "DesignSystem-MetaList--rightSeperator",
|
|
6921
6924
|
name: "fiber_manual_record",
|
|
@@ -8965,7 +8968,7 @@
|
|
|
8965
8968
|
"data-test": "DesignSystem-VerticalNav--Icon",
|
|
8966
8969
|
className: expanded ? 'mr-4' : '',
|
|
8967
8970
|
name: menu.icon,
|
|
8968
|
-
|
|
8971
|
+
type: menu.iconType
|
|
8969
8972
|
}), expanded && /*#__PURE__*/React__namespace.createElement(_MenuLabel, {
|
|
8970
8973
|
label: menu.label,
|
|
8971
8974
|
labelColor: itemColor
|
|
@@ -9163,7 +9166,7 @@
|
|
|
9163
9166
|
return /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
9164
9167
|
className: "mr-3 HorizontalNav-animate",
|
|
9165
9168
|
name: menu.icon,
|
|
9166
|
-
|
|
9169
|
+
type: menu.iconType,
|
|
9167
9170
|
"data-test": "DesignSystem-HorizontalNav--Icon"
|
|
9168
9171
|
});
|
|
9169
9172
|
}
|
|
@@ -10217,7 +10220,7 @@
|
|
|
10217
10220
|
withTrigger: true
|
|
10218
10221
|
};
|
|
10219
10222
|
|
|
10220
|
-
var Status = function Status(props) {
|
|
10223
|
+
var Status$1 = function Status(props) {
|
|
10221
10224
|
var _a, _b;
|
|
10222
10225
|
|
|
10223
10226
|
var type = props.type,
|
|
@@ -10314,7 +10317,7 @@
|
|
|
10314
10317
|
return null;
|
|
10315
10318
|
}
|
|
10316
10319
|
};
|
|
10317
|
-
Status.displayName = 'Status';
|
|
10320
|
+
Status$1.displayName = 'Status';
|
|
10318
10321
|
|
|
10319
10322
|
var Box = function Box(props) {
|
|
10320
10323
|
var _a;
|
|
@@ -10387,7 +10390,7 @@
|
|
|
10387
10390
|
typingText: typingText,
|
|
10388
10391
|
isTyping: isTyping,
|
|
10389
10392
|
statusType: statusType
|
|
10390
|
-
}), !isTyping && statusOptions && /*#__PURE__*/React__namespace.createElement(Status, __assign({}, statusOptions)));
|
|
10393
|
+
}), !isTyping && statusOptions && /*#__PURE__*/React__namespace.createElement(Status$1, __assign({}, statusOptions)));
|
|
10391
10394
|
};
|
|
10392
10395
|
ChatMessage.displayName = 'ChatMessage';
|
|
10393
10396
|
|
|
@@ -12104,7 +12107,7 @@
|
|
|
12104
12107
|
count = _b.count,
|
|
12105
12108
|
icon = _b.icon,
|
|
12106
12109
|
disabled = _b.disabled,
|
|
12107
|
-
|
|
12110
|
+
iconType = _b.iconType;
|
|
12108
12111
|
|
|
12109
12112
|
if (count !== undefined) {
|
|
12110
12113
|
return /*#__PURE__*/React__namespace.createElement(Pills, {
|
|
@@ -12122,7 +12125,7 @@
|
|
|
12122
12125
|
"data-test": "DesignSystem-Tabs--Icon",
|
|
12123
12126
|
className: "mr-4 " + iconClass,
|
|
12124
12127
|
name: icon,
|
|
12125
|
-
|
|
12128
|
+
type: iconType,
|
|
12126
12129
|
appearance: iconAppearance
|
|
12127
12130
|
});
|
|
12128
12131
|
}
|
|
@@ -15657,6 +15660,83 @@
|
|
|
15657
15660
|
rounded: false
|
|
15658
15661
|
};
|
|
15659
15662
|
|
|
15663
|
+
var Status = function Status(props) {
|
|
15664
|
+
var status = props.status,
|
|
15665
|
+
meta = props.meta,
|
|
15666
|
+
navigationPosition = props.navigationPosition,
|
|
15667
|
+
navigation = props.navigation,
|
|
15668
|
+
tabs = props.tabs;
|
|
15669
|
+
var statusClasses = classNames__default["default"]({
|
|
15670
|
+
'PageHeader-statusWrapper': true,
|
|
15671
|
+
'mb-3': navigationPosition === 'bottom' && navigation || tabs
|
|
15672
|
+
});
|
|
15673
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, (status || meta) && /*#__PURE__*/React__namespace.createElement("div", {
|
|
15674
|
+
className: statusClasses,
|
|
15675
|
+
"data-test": "DesignSystem-PageHeader--Status"
|
|
15676
|
+
}, status, meta));
|
|
15677
|
+
};
|
|
15678
|
+
var Action = function Action(props) {
|
|
15679
|
+
var actions = props.actions,
|
|
15680
|
+
navigation = props.navigation,
|
|
15681
|
+
stepper = props.stepper;
|
|
15682
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, actions ? /*#__PURE__*/React__namespace.createElement(Column, {
|
|
15683
|
+
size: "4",
|
|
15684
|
+
sizeXL: "4",
|
|
15685
|
+
sizeM: "4",
|
|
15686
|
+
"data-test": "DesignSystem-PageHeader--Actions"
|
|
15687
|
+
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
15688
|
+
className: "PageHeader-actionsWrapper"
|
|
15689
|
+
}, actions)) : (navigation || stepper) && /*#__PURE__*/React__namespace.createElement(Column, {
|
|
15690
|
+
size: "4",
|
|
15691
|
+
sizeXL: "4",
|
|
15692
|
+
sizeM: "4",
|
|
15693
|
+
"data-test": "DesignSystem-PageHeader--Actions"
|
|
15694
|
+
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
15695
|
+
className: "PageHeader-actionsWrapper"
|
|
15696
|
+
})));
|
|
15697
|
+
};
|
|
15698
|
+
var Nav = function Nav(props) {
|
|
15699
|
+
var navigation = props.navigation,
|
|
15700
|
+
stepper = props.stepper;
|
|
15701
|
+
|
|
15702
|
+
if (!navigation && !stepper) {
|
|
15703
|
+
return null;
|
|
15704
|
+
}
|
|
15705
|
+
|
|
15706
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
15707
|
+
className: "PageHeader-navigationWrapper",
|
|
15708
|
+
"data-test": "DesignSystem-PageHeader--Nav"
|
|
15709
|
+
}, navigation || stepper);
|
|
15710
|
+
};
|
|
15711
|
+
var CenterNav = function CenterNav(props) {
|
|
15712
|
+
var colSize = props.colSize,
|
|
15713
|
+
breadcrumbs = props.breadcrumbs,
|
|
15714
|
+
navigationPosition = props.navigationPosition;
|
|
15715
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, (!breadcrumbs || navigationPosition === 'center') && colSize === '4' && /*#__PURE__*/React__namespace.createElement(Column, {
|
|
15716
|
+
size: "4",
|
|
15717
|
+
sizeXL: "4",
|
|
15718
|
+
sizeM: "4",
|
|
15719
|
+
"data-test": "DesignSystem-PageHeader--CenterNav"
|
|
15720
|
+
}, /*#__PURE__*/React__namespace.createElement(Nav, __assign({}, props))));
|
|
15721
|
+
};
|
|
15722
|
+
var BackButton = function BackButton(props) {
|
|
15723
|
+
var button = props.button;
|
|
15724
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, button && /*#__PURE__*/React__namespace.createElement("div", {
|
|
15725
|
+
className: "mr-5 my-3",
|
|
15726
|
+
"data-test": "DesignSystem-PageHeader--Button"
|
|
15727
|
+
}, button));
|
|
15728
|
+
};
|
|
15729
|
+
var Title = function Title(props) {
|
|
15730
|
+
var badge = props.badge,
|
|
15731
|
+
title = props.title;
|
|
15732
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
15733
|
+
className: "PageHeader-titleWrapper",
|
|
15734
|
+
"data-test": "DesignSystem-PageHeader--Title"
|
|
15735
|
+
}, /*#__PURE__*/React__namespace.createElement(Heading, {
|
|
15736
|
+
className: "PageHeader-title"
|
|
15737
|
+
}, title), badge);
|
|
15738
|
+
};
|
|
15739
|
+
|
|
15660
15740
|
var PageHeader = function PageHeader(props) {
|
|
15661
15741
|
var _a;
|
|
15662
15742
|
|
|
@@ -15671,57 +15751,64 @@
|
|
|
15671
15751
|
status = props.status,
|
|
15672
15752
|
meta = props.meta,
|
|
15673
15753
|
navigationPosition = props.navigationPosition,
|
|
15674
|
-
className = props.className
|
|
15754
|
+
className = props.className,
|
|
15755
|
+
button = props.button;
|
|
15675
15756
|
var baseProps = extractBaseProps(props);
|
|
15676
15757
|
var wrapperClasses = classNames__default["default"]((_a = {
|
|
15677
15758
|
'PageHeader-wrapper': true
|
|
15678
|
-
}, _a['PageHeader-wrapper--
|
|
15759
|
+
}, _a['PageHeader-wrapper--withTabs'] = tabs, _a), className);
|
|
15679
15760
|
var classes = classNames__default["default"]({
|
|
15680
15761
|
PageHeader: true
|
|
15681
15762
|
});
|
|
15682
|
-
|
|
15683
|
-
var renderNav = function renderNav() {
|
|
15684
|
-
if (!navigation && !stepper) {
|
|
15685
|
-
return null;
|
|
15686
|
-
}
|
|
15687
|
-
|
|
15688
|
-
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
15689
|
-
className: "PageHeader-navigationWrapper"
|
|
15690
|
-
}, navigation || stepper);
|
|
15691
|
-
};
|
|
15692
|
-
|
|
15693
15763
|
var colSize = (navigation || stepper) && navigationPosition === 'center' ? '4' : actions ? '8' : '12';
|
|
15694
|
-
|
|
15764
|
+
var centerNavProps = {
|
|
15765
|
+
colSize: colSize,
|
|
15766
|
+
breadcrumbs: breadcrumbs,
|
|
15767
|
+
navigationPosition: navigationPosition,
|
|
15768
|
+
navigation: navigation,
|
|
15769
|
+
stepper: stepper
|
|
15770
|
+
};
|
|
15771
|
+
var statusProps = {
|
|
15772
|
+
status: status,
|
|
15773
|
+
meta: meta,
|
|
15774
|
+
navigationPosition: navigationPosition,
|
|
15775
|
+
navigation: navigation,
|
|
15776
|
+
tabs: tabs
|
|
15777
|
+
};
|
|
15778
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
15779
|
+
"data-test": "DesignSystem-PageHeader"
|
|
15780
|
+
}, /*#__PURE__*/React__namespace.createElement("div", __assign({}, baseProps, {
|
|
15695
15781
|
className: wrapperClasses
|
|
15696
|
-
}), breadcrumbs
|
|
15782
|
+
}), breadcrumbs && /*#__PURE__*/React__namespace.createElement("div", {
|
|
15783
|
+
className: "pl-6",
|
|
15784
|
+
"data-test": "DesignSystem-PageHeader--Breadcrumbs"
|
|
15785
|
+
}, breadcrumbs), /*#__PURE__*/React__namespace.createElement("div", {
|
|
15786
|
+
className: "d-flex pl-6"
|
|
15787
|
+
}, /*#__PURE__*/React__namespace.createElement(BackButton, {
|
|
15788
|
+
button: button
|
|
15789
|
+
}), /*#__PURE__*/React__namespace.createElement("div", {
|
|
15697
15790
|
className: classes
|
|
15698
15791
|
}, /*#__PURE__*/React__namespace.createElement(Row, null, /*#__PURE__*/React__namespace.createElement(Column, {
|
|
15699
15792
|
size: colSize,
|
|
15700
15793
|
sizeXL: colSize,
|
|
15701
15794
|
sizeM: colSize
|
|
15702
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
15703
|
-
|
|
15704
|
-
|
|
15705
|
-
|
|
15706
|
-
|
|
15707
|
-
|
|
15708
|
-
|
|
15709
|
-
|
|
15710
|
-
|
|
15711
|
-
|
|
15712
|
-
|
|
15713
|
-
|
|
15714
|
-
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
15715
|
-
|
|
15716
|
-
},
|
|
15717
|
-
|
|
15718
|
-
|
|
15719
|
-
sizeM: "4"
|
|
15720
|
-
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
15721
|
-
className: "PageHeader-actionsWrapper"
|
|
15722
|
-
})))), (status || meta) && /*#__PURE__*/React__namespace.createElement("div", {
|
|
15723
|
-
className: "PageHeader-statusWrapper"
|
|
15724
|
-
}, status, meta), breadcrumbs && navigationPosition === 'bottom' && renderNav(), tabs && /*#__PURE__*/React__namespace.createElement("div", null, tabs));
|
|
15795
|
+
}, /*#__PURE__*/React__namespace.createElement(Title, {
|
|
15796
|
+
badge: badge,
|
|
15797
|
+
title: title
|
|
15798
|
+
})), /*#__PURE__*/React__namespace.createElement(CenterNav, __assign({}, centerNavProps)), /*#__PURE__*/React__namespace.createElement(Action, {
|
|
15799
|
+
actions: actions,
|
|
15800
|
+
navigation: navigation,
|
|
15801
|
+
stepper: stepper
|
|
15802
|
+
})), /*#__PURE__*/React__namespace.createElement(Status, __assign({}, statusProps)))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
15803
|
+
className: "pl-3"
|
|
15804
|
+
}, navigationPosition === 'bottom' && /*#__PURE__*/React__namespace.createElement(Nav, {
|
|
15805
|
+
navigation: navigation,
|
|
15806
|
+
stepper: stepper
|
|
15807
|
+
}), tabs && /*#__PURE__*/React__namespace.createElement("div", {
|
|
15808
|
+
"data-test": "DesignSystem-PageHeader--Tabs"
|
|
15809
|
+
}, tabs))), separator && /*#__PURE__*/React__namespace.createElement(Divider, {
|
|
15810
|
+
appearance: "header"
|
|
15811
|
+
}));
|
|
15725
15812
|
};
|
|
15726
15813
|
PageHeader.defaultProps = {
|
|
15727
15814
|
navigationPosition: 'center',
|
|
@@ -16306,8 +16393,8 @@
|
|
|
16306
16393
|
subtle = props.subtle,
|
|
16307
16394
|
size = props.size,
|
|
16308
16395
|
iconAlign = props.iconAlign,
|
|
16309
|
-
|
|
16310
|
-
rest = __rest(props, ["children", "type", "className", "disabled", "tabIndex", "icon", "subtle", "size", "iconAlign", "
|
|
16396
|
+
iconType = props.iconType,
|
|
16397
|
+
rest = __rest(props, ["children", "type", "className", "disabled", "tabIndex", "icon", "subtle", "size", "iconAlign", "iconType"]);
|
|
16311
16398
|
|
|
16312
16399
|
var buttonClass = classNames__default["default"]((_a = {}, _a['LinkButton'] = true, _a["LinkButton--" + size] = size, _a['LinkButton--default'] = !subtle, _a['LinkButton--subtle'] = subtle, _a["LinkButton--iconAlign-" + iconAlign] = children && iconAlign, _a["" + className] = className, _a));
|
|
16313
16400
|
var iconClass = classNames__default["default"]((_b = {}, _b['LinkButton-icon'] = true, _b["LinkButton-icon--" + iconAlign] = children && iconAlign, _b));
|
|
@@ -16323,7 +16410,7 @@
|
|
|
16323
16410
|
}, /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
16324
16411
|
"data-test": "DesignSystem-LinkButton--Icon",
|
|
16325
16412
|
name: icon,
|
|
16326
|
-
|
|
16413
|
+
type: iconType,
|
|
16327
16414
|
size: size && sizeMapping[size]
|
|
16328
16415
|
})), children));
|
|
16329
16416
|
});
|
|
@@ -16369,7 +16456,129 @@
|
|
|
16369
16456
|
};
|
|
16370
16457
|
ActionCard.displayName = 'ActionCard';
|
|
16371
16458
|
|
|
16372
|
-
var
|
|
16459
|
+
var selectedCardValues = new Map();
|
|
16460
|
+
function useMultiSelect() {
|
|
16461
|
+
var _a = React__namespace.useState([]),
|
|
16462
|
+
selectedCardIds = _a[0],
|
|
16463
|
+
setSelectedCardIds = _a[1];
|
|
16464
|
+
|
|
16465
|
+
var isCardSelected = function isCardSelected(id) {
|
|
16466
|
+
return selectedCardIds.includes(id);
|
|
16467
|
+
};
|
|
16468
|
+
|
|
16469
|
+
var updateCardSelection = function updateCardSelection(id, value) {
|
|
16470
|
+
var idList = __spreadArrays(selectedCardIds);
|
|
16471
|
+
|
|
16472
|
+
if (isCardSelected(id)) {
|
|
16473
|
+
idList = selectedCardIds.filter(function (cardKey) {
|
|
16474
|
+
return id !== cardKey;
|
|
16475
|
+
});
|
|
16476
|
+
selectedCardValues["delete"](id);
|
|
16477
|
+
} else {
|
|
16478
|
+
idList.push(id);
|
|
16479
|
+
selectedCardValues.set(id, value);
|
|
16480
|
+
}
|
|
16481
|
+
|
|
16482
|
+
setSelectedCardIds(idList);
|
|
16483
|
+
};
|
|
16484
|
+
|
|
16485
|
+
return {
|
|
16486
|
+
selectedCardIds: selectedCardIds,
|
|
16487
|
+
selectedCardValues: selectedCardValues,
|
|
16488
|
+
isCardSelected: isCardSelected,
|
|
16489
|
+
updateCardSelection: updateCardSelection
|
|
16490
|
+
};
|
|
16491
|
+
}
|
|
16492
|
+
|
|
16493
|
+
function useSingleSelect() {
|
|
16494
|
+
var _a = React__namespace.useState([]),
|
|
16495
|
+
selectedCardIds = _a[0],
|
|
16496
|
+
setSelectedCardIds = _a[1];
|
|
16497
|
+
|
|
16498
|
+
var _b = React__namespace.useState([]),
|
|
16499
|
+
selectedCardValues = _b[0],
|
|
16500
|
+
setSelectedCardValues = _b[1];
|
|
16501
|
+
|
|
16502
|
+
var isCardSelected = function isCardSelected(id) {
|
|
16503
|
+
return selectedCardIds.includes(id);
|
|
16504
|
+
};
|
|
16505
|
+
|
|
16506
|
+
var updateCardSelection = function updateCardSelection(id, value) {
|
|
16507
|
+
var idList = __spreadArrays(selectedCardIds);
|
|
16508
|
+
|
|
16509
|
+
var valueList = __spreadArrays(selectedCardValues);
|
|
16510
|
+
|
|
16511
|
+
if (selectedCardIds.includes(id)) {
|
|
16512
|
+
idList = [];
|
|
16513
|
+
valueList = [];
|
|
16514
|
+
} else {
|
|
16515
|
+
idList = [id];
|
|
16516
|
+
valueList = value ? [value] : [];
|
|
16517
|
+
}
|
|
16518
|
+
|
|
16519
|
+
setSelectedCardIds(idList);
|
|
16520
|
+
setSelectedCardValues(valueList);
|
|
16521
|
+
};
|
|
16522
|
+
|
|
16523
|
+
return {
|
|
16524
|
+
selectedCardIds: selectedCardIds,
|
|
16525
|
+
selectedCardValues: selectedCardValues,
|
|
16526
|
+
isCardSelected: isCardSelected,
|
|
16527
|
+
updateCardSelection: updateCardSelection
|
|
16528
|
+
};
|
|
16529
|
+
}
|
|
16530
|
+
|
|
16531
|
+
var SelectionCard = function SelectionCard(props) {
|
|
16532
|
+
var _a;
|
|
16533
|
+
|
|
16534
|
+
var children = props.children,
|
|
16535
|
+
onClick = props.onClick,
|
|
16536
|
+
disabled = props.disabled,
|
|
16537
|
+
id = props.id,
|
|
16538
|
+
cardValue = props.cardValue,
|
|
16539
|
+
overlayZIndex = props.overlayZIndex,
|
|
16540
|
+
selected = props.selected,
|
|
16541
|
+
className = props.className,
|
|
16542
|
+
rest = __rest(props, ["children", "onClick", "disabled", "id", "cardValue", "overlayZIndex", "selected", "className"]);
|
|
16543
|
+
|
|
16544
|
+
var classes = classNames__default["default"]((_a = {}, _a['Selection-card'] = true, _a['Selection-card--selected'] = selected, _a['Selection-card--disabled'] = disabled && !selected, _a['Selection-card--selected-disabled'] = disabled && selected, _a), className);
|
|
16545
|
+
|
|
16546
|
+
var onClickHandler = function onClickHandler(event) {
|
|
16547
|
+
onClick && onClick(event, id, cardValue);
|
|
16548
|
+
};
|
|
16549
|
+
|
|
16550
|
+
var onKeyDownHandler = function onKeyDownHandler(event) {
|
|
16551
|
+
if (event.key === 'Enter') {
|
|
16552
|
+
onClickHandler(event);
|
|
16553
|
+
}
|
|
16554
|
+
};
|
|
16555
|
+
|
|
16556
|
+
return /*#__PURE__*/React__namespace.createElement("div", __assign({
|
|
16557
|
+
role: "checkbox",
|
|
16558
|
+
"aria-checked": selected,
|
|
16559
|
+
tabIndex: 0,
|
|
16560
|
+
onKeyDown: onKeyDownHandler,
|
|
16561
|
+
onClick: function onClick(event) {
|
|
16562
|
+
return onClickHandler(event);
|
|
16563
|
+
},
|
|
16564
|
+
className: classes,
|
|
16565
|
+
"data-test": "DesignSystem-SelectionCard"
|
|
16566
|
+
}, rest), /*#__PURE__*/React__namespace.createElement("div", {
|
|
16567
|
+
className: "Selection-card-overlay",
|
|
16568
|
+
style: {
|
|
16569
|
+
zIndex: overlayZIndex
|
|
16570
|
+
},
|
|
16571
|
+
"data-test": "DesignSystem-SelectionCard-Overlay"
|
|
16572
|
+
}), children);
|
|
16573
|
+
};
|
|
16574
|
+
SelectionCard.defaultProps = {
|
|
16575
|
+
disabled: false,
|
|
16576
|
+
overlayZIndex: 2
|
|
16577
|
+
};
|
|
16578
|
+
SelectionCard.useMultiSelect = useMultiSelect;
|
|
16579
|
+
SelectionCard.useSingleSelect = useSingleSelect;
|
|
16580
|
+
|
|
16581
|
+
var version = "2.23.0";
|
|
16373
16582
|
|
|
16374
16583
|
exports.ActionCard = ActionCard;
|
|
16375
16584
|
exports.Avatar = Avatar;
|
|
@@ -16445,6 +16654,7 @@
|
|
|
16445
16654
|
exports.Radio = Radio;
|
|
16446
16655
|
exports.RangeSlider = RangeSlider;
|
|
16447
16656
|
exports.Row = Row;
|
|
16657
|
+
exports.SelectionCard = SelectionCard;
|
|
16448
16658
|
exports.Sidesheet = Sidesheet;
|
|
16449
16659
|
exports.Slider = Slider;
|
|
16450
16660
|
exports.Spinner = Spinner;
|