@innovaccer/design-system 2.14.1 → 2.15.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/index.css +169 -35
- package/css/dist/index.css.map +1 -1
- package/css/src/components/calendar.css +36 -16
- package/css/src/components/checkbox.css +64 -8
- package/css/src/components/chip.css +8 -3
- package/css/src/components/fileList.css +2 -2
- package/css/src/components/horizontalNav.css +4 -0
- package/css/src/components/switch.css +6 -6
- package/css/src/components/toast.css +49 -0
- package/dist/.lib/tsconfig.type.tsbuildinfo +63 -48
- package/dist/core/components/atoms/checkbox/Checkbox.d.ts +1 -0
- package/dist/core/components/atoms/checkbox/CheckboxIcon.d.ts +5 -0
- package/dist/core/components/atoms/input/Input.d.ts +1 -0
- package/dist/core/components/atoms/popperWrapper/PopperWrapper.d.ts +2 -2
- package/dist/core/components/molecules/inputMask/InputMask.d.ts +1 -0
- package/dist/index.esm.js +425 -202
- package/dist/index.js +417 -194
- 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/dist/index.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* Generated on:
|
|
3
|
+
* Generated on: 1678111228630
|
|
4
4
|
* Package: @innovaccer/design-system
|
|
5
|
-
* Version: v2.
|
|
5
|
+
* Version: v2.15.0
|
|
6
6
|
* License: MIT
|
|
7
7
|
* Docs: https://innovaccer.github.io/design-system
|
|
8
8
|
*/
|
|
@@ -567,86 +567,90 @@ var date$1 = function date(val, format) {
|
|
|
567
567
|
return month <= 12 && date <= monthLength[month - 1];
|
|
568
568
|
};
|
|
569
569
|
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
570
|
+
if (val) {
|
|
571
|
+
switch (format) {
|
|
572
|
+
case 'dd/mm/yyyy':
|
|
573
|
+
{
|
|
574
|
+
var p = val.split('/');
|
|
574
575
|
|
|
575
|
-
|
|
576
|
+
var _date = +p[0] || 1;
|
|
576
577
|
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
578
|
+
var month = +p[1] || 1;
|
|
579
|
+
var year = +p[2] || 1900;
|
|
580
|
+
return validate(_date, month, year);
|
|
581
|
+
}
|
|
581
582
|
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
583
|
+
case 'mm/dd/yyyy':
|
|
584
|
+
{
|
|
585
|
+
var _p = val.split('/');
|
|
585
586
|
|
|
586
|
-
|
|
587
|
+
var _date2 = +_p[1] || 1;
|
|
587
588
|
|
|
588
|
-
|
|
589
|
+
var _month = +_p[0] || 1;
|
|
589
590
|
|
|
590
|
-
|
|
591
|
+
var _year = +_p[2] || 1900;
|
|
591
592
|
|
|
592
|
-
|
|
593
|
-
|
|
593
|
+
return validate(_date2, _month, _year);
|
|
594
|
+
}
|
|
594
595
|
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
596
|
+
case 'yyyy/mm/dd':
|
|
597
|
+
{
|
|
598
|
+
var _p2 = val.split('/');
|
|
598
599
|
|
|
599
|
-
|
|
600
|
+
var _date3 = +_p2[2] || 1;
|
|
600
601
|
|
|
601
|
-
|
|
602
|
+
var _month2 = +_p2[1] || 1;
|
|
602
603
|
|
|
603
|
-
|
|
604
|
+
var _year2 = +_p2[0] || 1900;
|
|
604
605
|
|
|
605
|
-
|
|
606
|
-
|
|
606
|
+
return validate(_date3, _month2, _year2);
|
|
607
|
+
}
|
|
607
608
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
609
|
+
case 'dd-mm-yyyy':
|
|
610
|
+
{
|
|
611
|
+
var _p3 = val.split('-');
|
|
611
612
|
|
|
612
|
-
|
|
613
|
+
var _date4 = +_p3[0] || 1;
|
|
613
614
|
|
|
614
|
-
|
|
615
|
+
var _month3 = +_p3[1] || 1;
|
|
615
616
|
|
|
616
|
-
|
|
617
|
+
var _year3 = +_p3[2] || 1900;
|
|
617
618
|
|
|
618
|
-
|
|
619
|
-
|
|
619
|
+
return validate(_date4, _month3, _year3);
|
|
620
|
+
}
|
|
620
621
|
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
622
|
+
case 'mm-dd-yyyy':
|
|
623
|
+
{
|
|
624
|
+
var _p4 = val.split('-');
|
|
624
625
|
|
|
625
|
-
|
|
626
|
+
var _date5 = +_p4[1] || 1;
|
|
626
627
|
|
|
627
|
-
|
|
628
|
+
var _month4 = +_p4[0] || 1;
|
|
628
629
|
|
|
629
|
-
|
|
630
|
+
var _year4 = +_p4[2] || 1900;
|
|
630
631
|
|
|
631
|
-
|
|
632
|
-
|
|
632
|
+
return validate(_date5, _month4, _year4);
|
|
633
|
+
}
|
|
633
634
|
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
635
|
+
case 'yyyy-mm-dd':
|
|
636
|
+
{
|
|
637
|
+
var _p5 = val.split('-');
|
|
637
638
|
|
|
638
|
-
|
|
639
|
+
var _date6 = +_p5[2] || 1;
|
|
639
640
|
|
|
640
|
-
|
|
641
|
+
var _month5 = +_p5[1] || 1;
|
|
641
642
|
|
|
642
|
-
|
|
643
|
+
var _year5 = +_p5[0] || 1900;
|
|
643
644
|
|
|
644
|
-
|
|
645
|
-
|
|
645
|
+
return validate(_date6, _month5, _year5);
|
|
646
|
+
}
|
|
646
647
|
|
|
647
|
-
|
|
648
|
-
|
|
648
|
+
default:
|
|
649
|
+
return false;
|
|
650
|
+
}
|
|
649
651
|
}
|
|
652
|
+
|
|
653
|
+
return false;
|
|
650
654
|
};
|
|
651
655
|
var time$1 = function time(val, format) {
|
|
652
656
|
var _getTimeObjFromStr = getTimeObjFromStr(format, val),
|
|
@@ -1244,7 +1248,7 @@ var _isEqual = function _isEqual(firstList, secondList) {
|
|
|
1244
1248
|
var firstSortedList = sortList(firstList);
|
|
1245
1249
|
var secondSortedList = sortList(secondList);
|
|
1246
1250
|
return firstSortedList.length === secondSortedList.length && firstSortedList.every(function (option, index) {
|
|
1247
|
-
return option.value === secondSortedList[index].value
|
|
1251
|
+
return option.value === secondSortedList[index].value;
|
|
1248
1252
|
});
|
|
1249
1253
|
};
|
|
1250
1254
|
var _isControlled = function _isControlled(selected) {
|
|
@@ -1399,110 +1403,6 @@ Text.defaultProps = {
|
|
|
1399
1403
|
size: 'regular'
|
|
1400
1404
|
};
|
|
1401
1405
|
|
|
1402
|
-
var isSpaceKey = function isSpaceKey(e) {
|
|
1403
|
-
return e.key === 'Space';
|
|
1404
|
-
};
|
|
1405
|
-
|
|
1406
|
-
var _excluded$x = ["onClick", "onKeyDown", "role"];
|
|
1407
|
-
var allowed = {
|
|
1408
|
-
button: new Set(['Enter', 'Space', 'Spacebar', ' ']),
|
|
1409
|
-
link: new Set(['Enter']),
|
|
1410
|
-
// onChange handles everything, no need for extra keyboard interaction
|
|
1411
|
-
checkbox: new Set([]),
|
|
1412
|
-
radio: new Set([])
|
|
1413
|
-
}; // Refer for keyboard interactions: https://webaim.org/techniques/keyboard/#testing
|
|
1414
|
-
|
|
1415
|
-
var isKeyboardInteractionAllowed = function isKeyboardInteractionAllowed(role, key) {
|
|
1416
|
-
if (!allowed[role]) {
|
|
1417
|
-
return false;
|
|
1418
|
-
}
|
|
1419
|
-
|
|
1420
|
-
var allowedKeys = allowed[role];
|
|
1421
|
-
return allowedKeys.has(key);
|
|
1422
|
-
};
|
|
1423
|
-
|
|
1424
|
-
var useAccessibilityProps = function useAccessibilityProps(_ref) {
|
|
1425
|
-
var onClick = _ref.onClick,
|
|
1426
|
-
_onKeyDown = _ref.onKeyDown,
|
|
1427
|
-
_ref$role = _ref.role,
|
|
1428
|
-
role = _ref$role === void 0 ? 'button' : _ref$role,
|
|
1429
|
-
rest = _objectWithoutProperties(_ref, _excluded$x);
|
|
1430
|
-
|
|
1431
|
-
return _objectSpread2({}, onClick ? {
|
|
1432
|
-
onClick: onClick,
|
|
1433
|
-
role: role,
|
|
1434
|
-
tabIndex: 0,
|
|
1435
|
-
'aria-label': rest['aria-label'],
|
|
1436
|
-
onKeyDown: function onKeyDown(e) {
|
|
1437
|
-
if (_onKeyDown) {
|
|
1438
|
-
_onKeyDown(e);
|
|
1439
|
-
|
|
1440
|
-
return;
|
|
1441
|
-
}
|
|
1442
|
-
|
|
1443
|
-
var key = e.key;
|
|
1444
|
-
|
|
1445
|
-
if (isKeyboardInteractionAllowed(role, key)) {
|
|
1446
|
-
if (onClick) {
|
|
1447
|
-
e.preventDefault();
|
|
1448
|
-
onClick(e);
|
|
1449
|
-
}
|
|
1450
|
-
}
|
|
1451
|
-
}
|
|
1452
|
-
} : {
|
|
1453
|
-
role: role,
|
|
1454
|
-
'aria-label': rest['aria-label']
|
|
1455
|
-
});
|
|
1456
|
-
};
|
|
1457
|
-
|
|
1458
|
-
var Icon = function Icon(props) {
|
|
1459
|
-
var _classNames;
|
|
1460
|
-
|
|
1461
|
-
var appearance = props.appearance,
|
|
1462
|
-
className = props.className,
|
|
1463
|
-
name = props.name,
|
|
1464
|
-
size = props.size,
|
|
1465
|
-
children = props.children;
|
|
1466
|
-
var accessibilityProps = useAccessibilityProps(props);
|
|
1467
|
-
var baseProps = extractBaseProps(props);
|
|
1468
|
-
|
|
1469
|
-
var mapper = function mapper(val) {
|
|
1470
|
-
if (val === 'outline') return 'outlined';
|
|
1471
|
-
if (val === 'rounded') return 'round';
|
|
1472
|
-
return val;
|
|
1473
|
-
};
|
|
1474
|
-
|
|
1475
|
-
var type = mapper(props.type);
|
|
1476
|
-
|
|
1477
|
-
var getIconAppearance = function getIconAppearance(iconColor) {
|
|
1478
|
-
var x = iconColor.indexOf('_');
|
|
1479
|
-
return iconColor.slice(0, x) + iconColor.charAt(x + 1).toUpperCase() + iconColor.slice(x + 2);
|
|
1480
|
-
};
|
|
1481
|
-
|
|
1482
|
-
var color = appearance && appearance.includes('_') ? getIconAppearance(appearance) : appearance;
|
|
1483
|
-
var iconClass = classnames((_classNames = {}, _defineProperty$1(_classNames, 'material-icons', true), _defineProperty$1(_classNames, "material-icons-".concat(mapper(type)), type && type !== 'filled'), _defineProperty$1(_classNames, 'Icon', true), _defineProperty$1(_classNames, "Icon--".concat(color), appearance), _defineProperty$1(_classNames, "".concat(className), className), _classNames));
|
|
1484
|
-
var styles = {
|
|
1485
|
-
fontSize: "".concat(size, "px"),
|
|
1486
|
-
width: "".concat(size, "px")
|
|
1487
|
-
}; // change `children` to {name} after migration
|
|
1488
|
-
|
|
1489
|
-
if (children && /*#__PURE__*/React.isValidElement(children)) {
|
|
1490
|
-
return /*#__PURE__*/React.createElement("span", _extends$2({}, baseProps, {
|
|
1491
|
-
className: className
|
|
1492
|
-
}), children);
|
|
1493
|
-
}
|
|
1494
|
-
|
|
1495
|
-
return /*#__PURE__*/React.createElement("i", _extends$2({}, baseProps, {
|
|
1496
|
-
className: iconClass,
|
|
1497
|
-
style: styles
|
|
1498
|
-
}, accessibilityProps), type ? "".concat(name, "_").concat(type) : name);
|
|
1499
|
-
};
|
|
1500
|
-
Icon.displayName = 'Icon';
|
|
1501
|
-
Icon.defaultProps = {
|
|
1502
|
-
size: 16,
|
|
1503
|
-
type: 'round'
|
|
1504
|
-
};
|
|
1505
|
-
|
|
1506
1406
|
var uidGenerator = function uidGenerator() {
|
|
1507
1407
|
var dt = new Date().getTime();
|
|
1508
1408
|
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
@@ -1514,7 +1414,66 @@ var uidGenerator = function uidGenerator() {
|
|
|
1514
1414
|
return uuid;
|
|
1515
1415
|
};
|
|
1516
1416
|
|
|
1517
|
-
var
|
|
1417
|
+
var CheckboxIcon = function CheckboxIcon(props) {
|
|
1418
|
+
switch (props.name) {
|
|
1419
|
+
case 'checked--regular':
|
|
1420
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
1421
|
+
width: "10",
|
|
1422
|
+
height: "8",
|
|
1423
|
+
viewBox: "0 0 10 8",
|
|
1424
|
+
fill: "none",
|
|
1425
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1426
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
1427
|
+
fillRule: "evenodd",
|
|
1428
|
+
clipRule: "evenodd",
|
|
1429
|
+
d: "M3.66667 5.56L8.72667 0.5L9.66667 1.44667L3.66667 7.44667L0.333333 4.11333L1.27333 3.17333L3.66667 5.56Z",
|
|
1430
|
+
fill: "white"
|
|
1431
|
+
}));
|
|
1432
|
+
|
|
1433
|
+
case 'checked--tiny':
|
|
1434
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
1435
|
+
width: "10",
|
|
1436
|
+
height: "8",
|
|
1437
|
+
viewBox: "0 0 10 8",
|
|
1438
|
+
fill: "none",
|
|
1439
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1440
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
1441
|
+
d: "M0.333344 4L1.27334 3.06L3.66668 5.44667L8.72668 0.386665L9.66668 1.33333L3.66668 7.33333L0.333344 4Z",
|
|
1442
|
+
fill: "white"
|
|
1443
|
+
}));
|
|
1444
|
+
|
|
1445
|
+
case 'indeterminate--regular':
|
|
1446
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
1447
|
+
width: "10",
|
|
1448
|
+
height: "2",
|
|
1449
|
+
viewBox: "0 0 10 2",
|
|
1450
|
+
fill: "none",
|
|
1451
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1452
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
1453
|
+
d: "M0 0H10V2H0V0Z",
|
|
1454
|
+
fill: "white"
|
|
1455
|
+
}));
|
|
1456
|
+
|
|
1457
|
+
case 'indeterminate--tiny':
|
|
1458
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
1459
|
+
width: "8",
|
|
1460
|
+
height: "2",
|
|
1461
|
+
viewBox: "0 0 8 2",
|
|
1462
|
+
fill: "none",
|
|
1463
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1464
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
1465
|
+
fillRule: "evenodd",
|
|
1466
|
+
clipRule: "evenodd",
|
|
1467
|
+
d: "M8 0H0V2H8V0Z",
|
|
1468
|
+
fill: "white"
|
|
1469
|
+
}));
|
|
1470
|
+
|
|
1471
|
+
default:
|
|
1472
|
+
return null;
|
|
1473
|
+
}
|
|
1474
|
+
};
|
|
1475
|
+
|
|
1476
|
+
var _excluded$x = ["size", "tabIndex", "defaultChecked", "indeterminate", "label", "error", "disabled", "onChange", "name", "value", "className", "checked", "helpText", "id"];
|
|
1518
1477
|
|
|
1519
1478
|
/**
|
|
1520
1479
|
* ######Checkbox has two types:
|
|
@@ -1522,7 +1481,7 @@ var _excluded$w = ["size", "tabIndex", "defaultChecked", "indeterminate", "label
|
|
|
1522
1481
|
* - [Uncontrolled Checkbox](https://reactjs.org/docs/uncontrolled-components.html)
|
|
1523
1482
|
*/
|
|
1524
1483
|
var Checkbox = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
|
|
1525
|
-
var _classNames, _classNames2, _classNames3;
|
|
1484
|
+
var _classNames, _classNames2, _classNames3, _classNames4, _classNames6;
|
|
1526
1485
|
|
|
1527
1486
|
var _props$size = props.size,
|
|
1528
1487
|
size = _props$size === void 0 ? 'regular' : _props$size,
|
|
@@ -1531,6 +1490,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
|
|
|
1531
1490
|
defaultChecked = props.defaultChecked,
|
|
1532
1491
|
indeterminate = props.indeterminate,
|
|
1533
1492
|
label = props.label,
|
|
1493
|
+
error = props.error,
|
|
1534
1494
|
disabled = props.disabled,
|
|
1535
1495
|
onChange = props.onChange,
|
|
1536
1496
|
name = props.name,
|
|
@@ -1540,7 +1500,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
|
|
|
1540
1500
|
helpText = props.helpText,
|
|
1541
1501
|
_props$id = props.id,
|
|
1542
1502
|
id = _props$id === void 0 ? "".concat(name, "-").concat(label, "-").concat(uidGenerator()) : _props$id,
|
|
1543
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
1503
|
+
rest = _objectWithoutProperties(props, _excluded$x);
|
|
1544
1504
|
|
|
1545
1505
|
var ref = React.useRef(null);
|
|
1546
1506
|
React.useImperativeHandle(forwardedRef, function () {
|
|
@@ -1563,7 +1523,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
|
|
|
1563
1523
|
var CheckboxClass = classnames((_classNames = {}, _defineProperty$1(_classNames, 'Checkbox', true), _defineProperty$1(_classNames, 'Checkbox--disabled', disabled), _classNames), className);
|
|
1564
1524
|
var CheckboxOuterWrapper = classnames((_classNames2 = {}, _defineProperty$1(_classNames2, 'Checkbox-outerWrapper', true), _defineProperty$1(_classNames2, "Checkbox-outerWrapper--".concat(size), size), _classNames2));
|
|
1565
1525
|
var CheckboxInputWrapper = classnames((_classNames3 = {}, _defineProperty$1(_classNames3, 'Checkbox-input', true), _defineProperty$1(_classNames3, 'Checkbox-input--checked', checked), _defineProperty$1(_classNames3, 'Checkbox-input--indeterminate', props.indeterminate), _classNames3));
|
|
1566
|
-
var CheckboxWrapper = classnames(_defineProperty$1(
|
|
1526
|
+
var CheckboxWrapper = classnames((_classNames4 = {}, _defineProperty$1(_classNames4, 'Checkbox-wrapper', true), _defineProperty$1(_classNames4, 'Checkbox-wrapper--default', !error), _defineProperty$1(_classNames4, 'Checkbox-wrapper--error', error), _classNames4));
|
|
1567
1527
|
var CheckboxLabelClass = classnames(_defineProperty$1({}, 'Checkbox-label', true));
|
|
1568
1528
|
|
|
1569
1529
|
var setIndeterminate = function setIndeterminate(indeterminateValue) {
|
|
@@ -1579,8 +1539,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
|
|
|
1579
1539
|
if (onChange) onChange(e);
|
|
1580
1540
|
};
|
|
1581
1541
|
|
|
1582
|
-
var
|
|
1583
|
-
var IconSize = size === 'tiny' ? 12 : 16;
|
|
1542
|
+
var IconMapper = classnames((_classNames6 = {}, _defineProperty$1(_classNames6, 'checked--regular', checked && size === 'regular'), _defineProperty$1(_classNames6, 'checked--tiny', checked && size === 'tiny'), _defineProperty$1(_classNames6, 'indeterminate--regular', indeterminate && size === 'regular'), _defineProperty$1(_classNames6, 'indeterminate--tiny', indeterminate && size === 'tiny'), _classNames6));
|
|
1584
1543
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
1585
1544
|
"data-test": "DesignSystem-Checkbox",
|
|
1586
1545
|
className: CheckboxClass
|
|
@@ -1603,10 +1562,8 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
|
|
|
1603
1562
|
})), /*#__PURE__*/React.createElement("span", {
|
|
1604
1563
|
className: CheckboxWrapper,
|
|
1605
1564
|
"data-test": "DesignSystem-Checkbox-Icon"
|
|
1606
|
-
},
|
|
1607
|
-
name:
|
|
1608
|
-
size: IconSize,
|
|
1609
|
-
appearance: 'white'
|
|
1565
|
+
}, IconMapper && /*#__PURE__*/React.createElement(CheckboxIcon, {
|
|
1566
|
+
name: IconMapper
|
|
1610
1567
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
1611
1568
|
className: "Checkbox-labelWrapper"
|
|
1612
1569
|
}, label && label.trim() && /*#__PURE__*/React.createElement("label", {
|
|
@@ -2013,12 +1970,15 @@ Placeholder.defaultProps = {
|
|
|
2013
1970
|
};
|
|
2014
1971
|
|
|
2015
1972
|
var Loading = function Loading(props) {
|
|
2016
|
-
var loadingType = props.loadingType
|
|
1973
|
+
var loadingType = props.loadingType,
|
|
1974
|
+
optionIndex = props.optionIndex;
|
|
1975
|
+
var placeholderSizes = ['medium', 'large'];
|
|
1976
|
+
var size = placeholderSizes[(optionIndex + 2) % 2];
|
|
2017
1977
|
|
|
2018
1978
|
switch (loadingType) {
|
|
2019
1979
|
case 'DEFAULT':
|
|
2020
1980
|
return /*#__PURE__*/React.createElement(PlaceholderParagraph, {
|
|
2021
|
-
length:
|
|
1981
|
+
length: size,
|
|
2022
1982
|
"data-test": "DesignSystem-Dropdown--PlaceholderParagraph"
|
|
2023
1983
|
});
|
|
2024
1984
|
|
|
@@ -2360,7 +2320,8 @@ var DropdownList = function DropdownList(props) {
|
|
|
2360
2320
|
className: "Option-loading",
|
|
2361
2321
|
key: "".concat(option, "-").concat(ind)
|
|
2362
2322
|
}, /*#__PURE__*/React.createElement(Loading, {
|
|
2363
|
-
loadingType: type
|
|
2323
|
+
loadingType: type,
|
|
2324
|
+
optionIndex: ind
|
|
2364
2325
|
}));
|
|
2365
2326
|
});
|
|
2366
2327
|
};
|
|
@@ -2591,7 +2552,7 @@ var DropdownList = function DropdownList(props) {
|
|
|
2591
2552
|
|
|
2592
2553
|
DropdownList.displayName = 'DropdownList';
|
|
2593
2554
|
|
|
2594
|
-
var _excluded$
|
|
2555
|
+
var _excluded$w = ["triggerOptions", "selected", "tabIndex"];
|
|
2595
2556
|
var inputRef = /*#__PURE__*/React.createRef();
|
|
2596
2557
|
|
|
2597
2558
|
/**
|
|
@@ -3239,7 +3200,7 @@ var Dropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
3239
3200
|
triggerOptions = _this$props14$trigger === void 0 ? {} : _this$props14$trigger;
|
|
3240
3201
|
_this$props14.selected;
|
|
3241
3202
|
var tabIndex = _this$props14.tabIndex,
|
|
3242
|
-
rest = _objectWithoutProperties(_this$props14, _excluded$
|
|
3203
|
+
rest = _objectWithoutProperties(_this$props14, _excluded$w);
|
|
3243
3204
|
|
|
3244
3205
|
var remainingOptionsLen = searchedOptionsLength - options.length;
|
|
3245
3206
|
var firstEnabledOption = tabIndex ? tabIndex : _isSelectAllPresent(searchTerm, remainingOptionsLen, withSelectAll, withCheckbox) ? 0 : options.findIndex(function (option) {
|
|
@@ -3398,7 +3359,7 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
|
3398
3359
|
})));
|
|
3399
3360
|
};
|
|
3400
3361
|
|
|
3401
|
-
var _excluded$
|
|
3362
|
+
var _excluded$v = ["size", "appearance", "iconAlign", "tabIndex", "largeIcon", "type", "children", "icon", "expanded", "selected", "loading", "disabled", "className", "tooltip"];
|
|
3402
3363
|
var sizeMapping$2 = {
|
|
3403
3364
|
tiny: 12,
|
|
3404
3365
|
regular: 16,
|
|
@@ -3426,7 +3387,7 @@ var ButtonElement = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
3426
3387
|
disabled = props.disabled,
|
|
3427
3388
|
className = props.className;
|
|
3428
3389
|
props.tooltip;
|
|
3429
|
-
var rest = _objectWithoutProperties(props, _excluded$
|
|
3390
|
+
var rest = _objectWithoutProperties(props, _excluded$v);
|
|
3430
3391
|
|
|
3431
3392
|
var buttonClass = classnames((_classNames = {}, _defineProperty$1(_classNames, 'Button', true), _defineProperty$1(_classNames, 'Button--expanded', expanded), _defineProperty$1(_classNames, "Button--".concat(size), size), _defineProperty$1(_classNames, "Button--".concat(size, "Square"), !children), _defineProperty$1(_classNames, "Button--".concat(appearance), appearance), _defineProperty$1(_classNames, 'Button--selected', selected && (appearance === 'basic' || appearance === 'transparent')), _defineProperty$1(_classNames, "Button--iconAlign-".concat(iconAlign), children && iconAlign), _defineProperty$1(_classNames, "".concat(className), className), _classNames));
|
|
3432
3393
|
var iconClass = classnames((_classNames2 = {}, _defineProperty$1(_classNames2, 'Button-icon', true), _defineProperty$1(_classNames2, "Button-icon--".concat(iconAlign), children && iconAlign), _classNames2));
|
|
@@ -4087,6 +4048,13 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
|
|
|
4087
4048
|
'Calendar-value--disabled': disabled,
|
|
4088
4049
|
'Calendar-yearValue': true
|
|
4089
4050
|
}, _defineProperty$1(_classNames2, "Calendar-yearValue--".concat(size), size), _defineProperty$1(_classNames2, 'Calendar-value--currDateMonthYear', isCurrentYear()), _classNames2));
|
|
4051
|
+
var getTextColor = classnames({
|
|
4052
|
+
inverse: !active && !isCurrentYear() && !disabled,
|
|
4053
|
+
white: active,
|
|
4054
|
+
'primary-lighter': isCurrentYear() && disabled,
|
|
4055
|
+
primary: isCurrentYear(),
|
|
4056
|
+
'inverse-lightest': disabled
|
|
4057
|
+
});
|
|
4090
4058
|
return (
|
|
4091
4059
|
/*#__PURE__*/
|
|
4092
4060
|
// TODO(a11y)
|
|
@@ -4099,7 +4067,8 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
|
|
|
4099
4067
|
onMouseOver: _this.yearMouseOverHandler.bind(_assertThisInitialized$1(_this), year, isCurrentYear(), disabled)
|
|
4100
4068
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
4101
4069
|
size: size === 'small' ? 'small' : 'regular',
|
|
4102
|
-
|
|
4070
|
+
color: getTextColor,
|
|
4071
|
+
className: "Calendar-text"
|
|
4103
4072
|
}, year))
|
|
4104
4073
|
);
|
|
4105
4074
|
}));
|
|
@@ -4142,9 +4111,16 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
|
|
|
4142
4111
|
var valueClass = classnames((_classNames3 = {
|
|
4143
4112
|
'Calendar-value': true,
|
|
4144
4113
|
'Calendar-value--active': active,
|
|
4145
|
-
'Calendar-value--
|
|
4114
|
+
'Calendar-value--disabled': disabled,
|
|
4146
4115
|
'Calendar-monthValue': true
|
|
4147
4116
|
}, _defineProperty$1(_classNames3, "Calendar-monthValue--".concat(size), size), _defineProperty$1(_classNames3, 'Calendar-value--currDateMonthYear', isCurrentMonth()), _classNames3));
|
|
4117
|
+
var getTextColor = classnames({
|
|
4118
|
+
inverse: !active && !isCurrentMonth() && !disabled,
|
|
4119
|
+
white: active,
|
|
4120
|
+
'primary-lighter': isCurrentMonth() && disabled,
|
|
4121
|
+
primary: isCurrentMonth(),
|
|
4122
|
+
'inverse-lightest': disabled
|
|
4123
|
+
});
|
|
4148
4124
|
return (
|
|
4149
4125
|
/*#__PURE__*/
|
|
4150
4126
|
//TODO(a11y)
|
|
@@ -4157,7 +4133,8 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
|
|
|
4157
4133
|
onMouseOver: _this.monthMouseOverHandler.bind(_assertThisInitialized$1(_this), month, isCurrentMonth(), disabled)
|
|
4158
4134
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
4159
4135
|
size: size === 'small' ? 'small' : 'regular',
|
|
4160
|
-
|
|
4136
|
+
color: getTextColor,
|
|
4137
|
+
className: "Calendar-text"
|
|
4161
4138
|
}, months[month]))
|
|
4162
4139
|
);
|
|
4163
4140
|
}));
|
|
@@ -4374,6 +4351,7 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
|
|
|
4374
4351
|
});
|
|
4375
4352
|
var valueClass = classnames((_classNames4 = {
|
|
4376
4353
|
'Calendar-value': true,
|
|
4354
|
+
'Calendar-inRangeValue': !isStart && !isEnd,
|
|
4377
4355
|
'Calendar-value--start': isStart && !isEnd,
|
|
4378
4356
|
'Calendar-value--end': isEnd && !isStart,
|
|
4379
4357
|
'Calendar-value--startError': isStart && isRangeError,
|
|
@@ -4382,12 +4360,19 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
|
|
|
4382
4360
|
'Calendar-value--disabled': disabled,
|
|
4383
4361
|
'Calendar-dateValue': true
|
|
4384
4362
|
}, _defineProperty$1(_classNames4, "Calendar-dateValue--".concat(size), size), _defineProperty$1(_classNames4, 'Calendar-value--currDateMonthYear', today()), _classNames4));
|
|
4363
|
+
var getTextColor = classnames({
|
|
4364
|
+
inverse: !active && !today() && !disabled,
|
|
4365
|
+
white: active,
|
|
4366
|
+
'primary-lighter': today() && disabled,
|
|
4367
|
+
primary: today(),
|
|
4368
|
+
'inverse-lightest': disabled
|
|
4369
|
+
});
|
|
4385
4370
|
return /*#__PURE__*/React.createElement("div", {
|
|
4386
4371
|
key: "".concat(row, "-").concat(col),
|
|
4387
4372
|
className: wrapperClass,
|
|
4388
4373
|
"data-test": "designSystem-Calendar-WrapperClass"
|
|
4389
4374
|
}, !dummy && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
|
|
4390
|
-
|
|
4375
|
+
color: getTextColor,
|
|
4391
4376
|
size: size === 'small' ? 'small' : 'regular',
|
|
4392
4377
|
"data-test": "DesignSystem-Calendar--dateValue",
|
|
4393
4378
|
className: valueClass,
|
|
@@ -4414,7 +4399,7 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
|
|
|
4414
4399
|
size = _this$props8.size,
|
|
4415
4400
|
monthsInView = _this$props8.monthsInView;
|
|
4416
4401
|
var view = _this.state.view;
|
|
4417
|
-
var containerClass = classnames((_classNames5 = {}, _defineProperty$1(_classNames5, 'Calendar', true), _defineProperty$1(_classNames5, "Calendar
|
|
4402
|
+
var containerClass = classnames((_classNames5 = {}, _defineProperty$1(_classNames5, 'Calendar', true), _defineProperty$1(_classNames5, "Calendar-".concat(view, "--").concat(size), view), _defineProperty$1(_classNames5, "Calendar--".concat(size), size), _classNames5));
|
|
4418
4403
|
var headerClass = classnames(_defineProperty$1({}, "Calendar-header--".concat(size), size));
|
|
4419
4404
|
var bodyClass = classnames({
|
|
4420
4405
|
'Calendar-body': true
|
|
@@ -4447,7 +4432,7 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
|
|
|
4447
4432
|
_month = _getDateInfo6.month,
|
|
4448
4433
|
_date = _getDateInfo6.date;
|
|
4449
4434
|
|
|
4450
|
-
var todayCompleteDate = getDateInfo(new Date());
|
|
4435
|
+
var todayCompleteDate = getDateInfo(new Date(Date.now()));
|
|
4451
4436
|
_this.state = {
|
|
4452
4437
|
currDate: currDate,
|
|
4453
4438
|
startDate: _startDate,
|
|
@@ -4670,7 +4655,7 @@ _defineProperty$1(Calendar, "defaultProps", {
|
|
|
4670
4655
|
jumpView: true
|
|
4671
4656
|
});
|
|
4672
4657
|
|
|
4673
|
-
var _excluded$
|
|
4658
|
+
var _excluded$u = ["shadow", "children", "className"];
|
|
4674
4659
|
var Card = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
4675
4660
|
var _classNames;
|
|
4676
4661
|
|
|
@@ -4678,7 +4663,7 @@ var Card = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
4678
4663
|
shadow = _props$shadow === void 0 ? 'default' : _props$shadow,
|
|
4679
4664
|
children = props.children,
|
|
4680
4665
|
className = props.className,
|
|
4681
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
4666
|
+
rest = _objectWithoutProperties(props, _excluded$u);
|
|
4682
4667
|
|
|
4683
4668
|
var classes = classnames((_classNames = {
|
|
4684
4669
|
Card: true
|
|
@@ -4691,12 +4676,12 @@ var Card = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
4691
4676
|
});
|
|
4692
4677
|
Card.displayName = 'Card';
|
|
4693
4678
|
|
|
4694
|
-
var _excluded$
|
|
4679
|
+
var _excluded$t = ["border", "children", "className"];
|
|
4695
4680
|
var CardSubdued = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
4696
4681
|
var border = props.border,
|
|
4697
4682
|
children = props.children,
|
|
4698
4683
|
className = props.className,
|
|
4699
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
4684
|
+
rest = _objectWithoutProperties(props, _excluded$t);
|
|
4700
4685
|
|
|
4701
4686
|
var classes = classnames(_defineProperty$1({
|
|
4702
4687
|
CardSubdued: true
|
|
@@ -4759,6 +4744,110 @@ CardFooter.defaultProps = {
|
|
|
4759
4744
|
withSeperator: true
|
|
4760
4745
|
};
|
|
4761
4746
|
|
|
4747
|
+
var isSpaceKey = function isSpaceKey(e) {
|
|
4748
|
+
return e.key === 'Space';
|
|
4749
|
+
};
|
|
4750
|
+
|
|
4751
|
+
var _excluded$s = ["onClick", "onKeyDown", "role"];
|
|
4752
|
+
var allowed = {
|
|
4753
|
+
button: new Set(['Enter', 'Space', 'Spacebar', ' ']),
|
|
4754
|
+
link: new Set(['Enter']),
|
|
4755
|
+
// onChange handles everything, no need for extra keyboard interaction
|
|
4756
|
+
checkbox: new Set([]),
|
|
4757
|
+
radio: new Set([])
|
|
4758
|
+
}; // Refer for keyboard interactions: https://webaim.org/techniques/keyboard/#testing
|
|
4759
|
+
|
|
4760
|
+
var isKeyboardInteractionAllowed = function isKeyboardInteractionAllowed(role, key) {
|
|
4761
|
+
if (!allowed[role]) {
|
|
4762
|
+
return false;
|
|
4763
|
+
}
|
|
4764
|
+
|
|
4765
|
+
var allowedKeys = allowed[role];
|
|
4766
|
+
return allowedKeys.has(key);
|
|
4767
|
+
};
|
|
4768
|
+
|
|
4769
|
+
var useAccessibilityProps = function useAccessibilityProps(_ref) {
|
|
4770
|
+
var onClick = _ref.onClick,
|
|
4771
|
+
_onKeyDown = _ref.onKeyDown,
|
|
4772
|
+
_ref$role = _ref.role,
|
|
4773
|
+
role = _ref$role === void 0 ? 'button' : _ref$role,
|
|
4774
|
+
rest = _objectWithoutProperties(_ref, _excluded$s);
|
|
4775
|
+
|
|
4776
|
+
return _objectSpread2({}, onClick ? {
|
|
4777
|
+
onClick: onClick,
|
|
4778
|
+
role: role,
|
|
4779
|
+
tabIndex: 0,
|
|
4780
|
+
'aria-label': rest['aria-label'],
|
|
4781
|
+
onKeyDown: function onKeyDown(e) {
|
|
4782
|
+
if (_onKeyDown) {
|
|
4783
|
+
_onKeyDown(e);
|
|
4784
|
+
|
|
4785
|
+
return;
|
|
4786
|
+
}
|
|
4787
|
+
|
|
4788
|
+
var key = e.key;
|
|
4789
|
+
|
|
4790
|
+
if (isKeyboardInteractionAllowed(role, key)) {
|
|
4791
|
+
if (onClick) {
|
|
4792
|
+
e.preventDefault();
|
|
4793
|
+
onClick(e);
|
|
4794
|
+
}
|
|
4795
|
+
}
|
|
4796
|
+
}
|
|
4797
|
+
} : {
|
|
4798
|
+
role: role,
|
|
4799
|
+
'aria-label': rest['aria-label']
|
|
4800
|
+
});
|
|
4801
|
+
};
|
|
4802
|
+
|
|
4803
|
+
var Icon = function Icon(props) {
|
|
4804
|
+
var _classNames;
|
|
4805
|
+
|
|
4806
|
+
var appearance = props.appearance,
|
|
4807
|
+
className = props.className,
|
|
4808
|
+
name = props.name,
|
|
4809
|
+
size = props.size,
|
|
4810
|
+
children = props.children;
|
|
4811
|
+
var accessibilityProps = useAccessibilityProps(props);
|
|
4812
|
+
var baseProps = extractBaseProps(props);
|
|
4813
|
+
|
|
4814
|
+
var mapper = function mapper(val) {
|
|
4815
|
+
if (val === 'outline') return 'outlined';
|
|
4816
|
+
if (val === 'rounded') return 'round';
|
|
4817
|
+
return val;
|
|
4818
|
+
};
|
|
4819
|
+
|
|
4820
|
+
var type = mapper(props.type);
|
|
4821
|
+
|
|
4822
|
+
var getIconAppearance = function getIconAppearance(iconColor) {
|
|
4823
|
+
var x = iconColor.indexOf('_');
|
|
4824
|
+
return iconColor.slice(0, x) + iconColor.charAt(x + 1).toUpperCase() + iconColor.slice(x + 2);
|
|
4825
|
+
};
|
|
4826
|
+
|
|
4827
|
+
var color = appearance && appearance.includes('_') ? getIconAppearance(appearance) : appearance;
|
|
4828
|
+
var iconClass = classnames((_classNames = {}, _defineProperty$1(_classNames, 'material-icons', true), _defineProperty$1(_classNames, "material-icons-".concat(mapper(type)), type && type !== 'filled'), _defineProperty$1(_classNames, 'Icon', true), _defineProperty$1(_classNames, "Icon--".concat(color), appearance), _defineProperty$1(_classNames, "".concat(className), className), _classNames));
|
|
4829
|
+
var styles = {
|
|
4830
|
+
fontSize: "".concat(size, "px"),
|
|
4831
|
+
width: "".concat(size, "px")
|
|
4832
|
+
}; // change `children` to {name} after migration
|
|
4833
|
+
|
|
4834
|
+
if (children && /*#__PURE__*/React.isValidElement(children)) {
|
|
4835
|
+
return /*#__PURE__*/React.createElement("span", _extends$2({}, baseProps, {
|
|
4836
|
+
className: className
|
|
4837
|
+
}), children);
|
|
4838
|
+
}
|
|
4839
|
+
|
|
4840
|
+
return /*#__PURE__*/React.createElement("i", _extends$2({}, baseProps, {
|
|
4841
|
+
className: iconClass,
|
|
4842
|
+
style: styles
|
|
4843
|
+
}, accessibilityProps), type ? "".concat(name, "_").concat(type) : name);
|
|
4844
|
+
};
|
|
4845
|
+
Icon.displayName = 'Icon';
|
|
4846
|
+
Icon.defaultProps = {
|
|
4847
|
+
size: 16,
|
|
4848
|
+
type: 'round'
|
|
4849
|
+
};
|
|
4850
|
+
|
|
4762
4851
|
var GenericChip = function GenericChip(props) {
|
|
4763
4852
|
var _classNames3;
|
|
4764
4853
|
|
|
@@ -4969,6 +5058,22 @@ var Trigger$1 = function Trigger(props) {
|
|
|
4969
5058
|
var _inputOptions$placeho = inputOptions.placeholderChar,
|
|
4970
5059
|
placeholderChar = _inputOptions$placeho === void 0 ? '_' : _inputOptions$placeho;
|
|
4971
5060
|
|
|
5061
|
+
var onPasteHandler = function onPasteHandler(_e, val) {
|
|
5062
|
+
var onPaste = inputOptions.onPaste;
|
|
5063
|
+
setState({
|
|
5064
|
+
open: true
|
|
5065
|
+
});
|
|
5066
|
+
|
|
5067
|
+
if (val && !val.includes(placeholderChar)) {
|
|
5068
|
+
var d = translateToDate(inputFormat, val, validators);
|
|
5069
|
+
setState({
|
|
5070
|
+
date: d
|
|
5071
|
+
});
|
|
5072
|
+
}
|
|
5073
|
+
|
|
5074
|
+
if (onPaste) onPaste(_e, val);
|
|
5075
|
+
};
|
|
5076
|
+
|
|
4972
5077
|
var onChangeHandler = function onChangeHandler(_e, val) {
|
|
4973
5078
|
var onChange = inputOptions.onChange;
|
|
4974
5079
|
setState({
|
|
@@ -5030,6 +5135,7 @@ var Trigger$1 = function Trigger(props) {
|
|
|
5030
5135
|
mask: mask,
|
|
5031
5136
|
value: date$1 ? translateToString(inputFormat, date$1) : init ? X.utils.getDefaultValue(mask, placeholderChar) : '',
|
|
5032
5137
|
onChange: onChangeHandler,
|
|
5138
|
+
onPaste: onPasteHandler,
|
|
5033
5139
|
onBlur: onBlurHandler,
|
|
5034
5140
|
onClear: onClearHandler,
|
|
5035
5141
|
caption: showError ? errorMessage : '',
|
|
@@ -6034,7 +6140,7 @@ Heading.defaultProps = {
|
|
|
6034
6140
|
size: 'm'
|
|
6035
6141
|
};
|
|
6036
6142
|
|
|
6037
|
-
var _excluded$o = ["size", "type", "minWidth", "defaultValue", "name", "placeholder", "value", "icon", "inlineLabel", "required", "error", "info", "onChange", "onClick", "onClear", "onBlur", "onFocus", "actionIcon", "className", "autoFocus", "disabled", "readOnly"];
|
|
6143
|
+
var _excluded$o = ["size", "type", "minWidth", "defaultValue", "name", "placeholder", "value", "icon", "inlineLabel", "required", "error", "info", "onChange", "onClick", "onClear", "onBlur", "onFocus", "onPaste", "actionIcon", "className", "autoFocus", "disabled", "readOnly"];
|
|
6038
6144
|
var sizeMapping$1 = {
|
|
6039
6145
|
tiny: 12,
|
|
6040
6146
|
regular: 16,
|
|
@@ -6069,6 +6175,7 @@ var Input = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
|
|
|
6069
6175
|
onClear = props.onClear,
|
|
6070
6176
|
onBlur = props.onBlur,
|
|
6071
6177
|
onFocus = props.onFocus,
|
|
6178
|
+
onPaste = props.onPaste,
|
|
6072
6179
|
actionIcon = props.actionIcon,
|
|
6073
6180
|
className = props.className,
|
|
6074
6181
|
autoFocus = props.autoFocus,
|
|
@@ -6138,7 +6245,8 @@ var Input = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
|
|
|
6138
6245
|
onChange: onChange,
|
|
6139
6246
|
onBlur: onBlur,
|
|
6140
6247
|
onClick: onClick,
|
|
6141
|
-
onFocus: onFocus
|
|
6248
|
+
onFocus: onFocus,
|
|
6249
|
+
onPaste: onPaste
|
|
6142
6250
|
})), disabled ? '' : info ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
6143
6251
|
position: "top",
|
|
6144
6252
|
tooltip: info
|
|
@@ -6368,7 +6476,7 @@ var getDefaultValue = function getDefaultValue(mask, placeholderChar) {
|
|
|
6368
6476
|
return val;
|
|
6369
6477
|
};
|
|
6370
6478
|
|
|
6371
|
-
var _excluded$m = ["mask", "value", "placeholderChar", "validators", "clearOnEmptyBlur", "defaultValue", "mask", "error", "caption", "required", "onChange", "onBlur", "onFocus", "onClear", "className", "id", "helpText"];
|
|
6479
|
+
var _excluded$m = ["mask", "value", "placeholderChar", "validators", "clearOnEmptyBlur", "defaultValue", "mask", "error", "caption", "required", "onChange", "onPaste", "onBlur", "onFocus", "onClear", "className", "id", "helpText"];
|
|
6372
6480
|
|
|
6373
6481
|
/**
|
|
6374
6482
|
* It works as Uncontrolled Input
|
|
@@ -6390,6 +6498,7 @@ var InputMask = /*#__PURE__*/React.forwardRef(function (props, forwardRef) {
|
|
|
6390
6498
|
caption = props.caption,
|
|
6391
6499
|
required = props.required,
|
|
6392
6500
|
onChange = props.onChange,
|
|
6501
|
+
onPaste = props.onPaste,
|
|
6393
6502
|
onBlur = props.onBlur,
|
|
6394
6503
|
onFocus = props.onFocus,
|
|
6395
6504
|
onClear = props.onClear,
|
|
@@ -6521,8 +6630,48 @@ var InputMask = /*#__PURE__*/React.forwardRef(function (props, forwardRef) {
|
|
|
6521
6630
|
selectionPos.current = getCurrSelection();
|
|
6522
6631
|
deferId.current = window.requestAnimationFrame(updateSelection);
|
|
6523
6632
|
}, [selectionPos.current, getCurrSelection]);
|
|
6633
|
+
|
|
6634
|
+
var matchSeparatorValue = function matchSeparatorValue(currValue) {
|
|
6635
|
+
var separator = props.placeholder || 'dd/mm/yyyy';
|
|
6636
|
+
|
|
6637
|
+
if (separator.substring(0, 4) === 'yyyy') {
|
|
6638
|
+
return currValue && currValue[4] === separator[4] && currValue[7] === separator[7];
|
|
6639
|
+
}
|
|
6640
|
+
|
|
6641
|
+
return currValue && currValue[2] === separator[2] && currValue[5] === separator[5];
|
|
6642
|
+
};
|
|
6643
|
+
|
|
6644
|
+
var isSameFormat = function isSameFormat(currValue, inputLength) {
|
|
6645
|
+
var value = currValue.substring(0, inputLength);
|
|
6646
|
+
|
|
6647
|
+
if (inputLength === 23) {
|
|
6648
|
+
var date = value.split(' - ');
|
|
6649
|
+
var startVal = date[0];
|
|
6650
|
+
var endVal = date[1];
|
|
6651
|
+
return matchSeparatorValue(startVal) && matchSeparatorValue(endVal);
|
|
6652
|
+
}
|
|
6653
|
+
|
|
6654
|
+
return matchSeparatorValue(value);
|
|
6655
|
+
};
|
|
6656
|
+
|
|
6657
|
+
var onPasteHandler = function onPasteHandler(e) {
|
|
6658
|
+
var _e$clipboardData;
|
|
6659
|
+
|
|
6660
|
+
e.preventDefault();
|
|
6661
|
+
var pastedValue = (_e$clipboardData = e.clipboardData) === null || _e$clipboardData === void 0 ? void 0 : _e$clipboardData.getData('Text');
|
|
6662
|
+
var sameFormat = isSameFormat(pastedValue, pastedValue.length);
|
|
6663
|
+
var isValidDate = isValid(validators, pastedValue);
|
|
6664
|
+
|
|
6665
|
+
if (sameFormat && onPaste && isValidDate) {
|
|
6666
|
+
onPaste(e, pastedValue);
|
|
6667
|
+
setValue(pastedValue);
|
|
6668
|
+
}
|
|
6669
|
+
};
|
|
6670
|
+
|
|
6524
6671
|
var onChangeHandler = React.useCallback(function (e) {
|
|
6525
|
-
var
|
|
6672
|
+
var _e$currentTarget;
|
|
6673
|
+
|
|
6674
|
+
var inputVal = (_e$currentTarget = e.currentTarget) === null || _e$currentTarget === void 0 ? void 0 : _e$currentTarget.value;
|
|
6526
6675
|
var currSelection = getCurrSelection();
|
|
6527
6676
|
var start = Math.min(selectionPos.current.start, currSelection.start);
|
|
6528
6677
|
var end = currSelection.end;
|
|
@@ -6635,6 +6784,7 @@ var InputMask = /*#__PURE__*/React.forwardRef(function (props, forwardRef) {
|
|
|
6635
6784
|
onChange: onChangeHandler,
|
|
6636
6785
|
onClear: onClearHandler,
|
|
6637
6786
|
onBlur: onBlurHandler,
|
|
6787
|
+
onPaste: onPasteHandler,
|
|
6638
6788
|
autoComplete: 'off',
|
|
6639
6789
|
ref: ref
|
|
6640
6790
|
})), /*#__PURE__*/React.createElement(HelpText, {
|
|
@@ -8341,7 +8491,7 @@ var Toast = function Toast(props) {
|
|
|
8341
8491
|
var iconClass = function iconClass(align) {
|
|
8342
8492
|
var _classNames3;
|
|
8343
8493
|
|
|
8344
|
-
return classnames((_classNames3 = {}, _defineProperty$1(_classNames3, 'Toast-icon', true), _defineProperty$1(_classNames3, "Toast-icon--".concat(align), align), _defineProperty$1(_classNames3, "Toast-icon--".concat(appearance), appearance), _classNames3));
|
|
8494
|
+
return classnames((_classNames3 = {}, _defineProperty$1(_classNames3, 'Toast-icon', true), _defineProperty$1(_classNames3, "Toast-icon--".concat(align), align), _defineProperty$1(_classNames3, "Toast-icon--".concat(appearance), appearance), _defineProperty$1(_classNames3, "Toast-close-icon--".concat(appearance), appearance && align === 'right'), _classNames3));
|
|
8345
8495
|
};
|
|
8346
8496
|
|
|
8347
8497
|
var textClass = classnames((_classNames4 = {}, _defineProperty$1(_classNames4, 'Toast-text', true), _defineProperty$1(_classNames4, "Toast-text--".concat(appearance), appearance), _classNames4));
|
|
@@ -15903,15 +16053,14 @@ var Step = function Step(props) {
|
|
|
15903
16053
|
active = props.active,
|
|
15904
16054
|
completed = props.completed,
|
|
15905
16055
|
onChange = props.onChange;
|
|
15906
|
-
var StepClass = classnames((_classNames = {}, _defineProperty$1(_classNames, 'Step', true), _defineProperty$1(_classNames, 'Step--active', active), _defineProperty$1(_classNames, 'Step--disabled', disabled), _defineProperty$1(_classNames, 'Stepper-animate', true), _classNames));
|
|
16056
|
+
var StepClass = classnames((_classNames = {}, _defineProperty$1(_classNames, 'Step', true), _defineProperty$1(_classNames, 'Step--active', active), _defineProperty$1(_classNames, 'Step--disabled', disabled), _defineProperty$1(_classNames, 'Stepper-animate', true), _defineProperty$1(_classNames, 'color-primary-dark', active || completed), _defineProperty$1(_classNames, 'color-inverse-lightest', disabled), _classNames));
|
|
15907
16057
|
|
|
15908
16058
|
var onClickHandle = function onClickHandle() {
|
|
15909
16059
|
if (disabled) return;
|
|
15910
16060
|
if (onChange) onChange(label, value);
|
|
15911
16061
|
};
|
|
15912
16062
|
|
|
15913
|
-
var
|
|
15914
|
-
var appearance = active ? 'link' : disabled ? 'disabled' : 'default';
|
|
16063
|
+
var textColor = active ? 'primary-dark' : disabled ? 'inverse-lightest' : 'inverse';
|
|
15915
16064
|
return (
|
|
15916
16065
|
/*#__PURE__*/
|
|
15917
16066
|
// TODO(a11y)
|
|
@@ -15923,11 +16072,10 @@ var Step = function Step(props) {
|
|
|
15923
16072
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
15924
16073
|
"data-test": "DesignSystem-Step--Icon",
|
|
15925
16074
|
name: completed ? 'check_circle' : 'radio_button_unchecked',
|
|
15926
|
-
appearance: iconAppearance,
|
|
15927
16075
|
className: "mr-3 my-4 Stepper-animate"
|
|
15928
16076
|
}), label && /*#__PURE__*/React.createElement(Text, {
|
|
15929
16077
|
weight: "medium",
|
|
15930
|
-
|
|
16078
|
+
color: textColor,
|
|
15931
16079
|
className: "Stepper-animate"
|
|
15932
16080
|
}, label))
|
|
15933
16081
|
);
|
|
@@ -16016,7 +16164,7 @@ var Trigger = function Trigger(props) {
|
|
|
16016
16164
|
}
|
|
16017
16165
|
};
|
|
16018
16166
|
|
|
16019
|
-
var
|
|
16167
|
+
var onPasteHandler = function onPasteHandler(_e, val, type) {
|
|
16020
16168
|
setState({
|
|
16021
16169
|
open: true
|
|
16022
16170
|
});
|
|
@@ -16044,6 +16192,8 @@ var Trigger = function Trigger(props) {
|
|
|
16044
16192
|
});
|
|
16045
16193
|
}
|
|
16046
16194
|
}
|
|
16195
|
+
|
|
16196
|
+
if (startInputOptions.onPaste) startInputOptions.onPaste(_e, val);
|
|
16047
16197
|
}
|
|
16048
16198
|
}
|
|
16049
16199
|
}
|
|
@@ -16054,8 +16204,56 @@ var Trigger = function Trigger(props) {
|
|
|
16054
16204
|
if (val && !val.includes(_placeholderChar)) {
|
|
16055
16205
|
var _d = translateToDate(inputFormat, val, validators);
|
|
16056
16206
|
|
|
16057
|
-
if (_d)
|
|
16058
|
-
|
|
16207
|
+
if (_d) {
|
|
16208
|
+
setState({
|
|
16209
|
+
endDate: _d
|
|
16210
|
+
});
|
|
16211
|
+
if (endInputOptions.onPaste) endInputOptions.onPaste(_e, val);
|
|
16212
|
+
}
|
|
16213
|
+
}
|
|
16214
|
+
}
|
|
16215
|
+
};
|
|
16216
|
+
|
|
16217
|
+
var onChangeHandler = function onChangeHandler(_e, val, type) {
|
|
16218
|
+
setState({
|
|
16219
|
+
open: true
|
|
16220
|
+
});
|
|
16221
|
+
|
|
16222
|
+
if (type === 'start') {
|
|
16223
|
+
var placeholderChar = startInputOptions.placeholderChar || '_';
|
|
16224
|
+
|
|
16225
|
+
if (val && !val.includes(placeholderChar)) {
|
|
16226
|
+
var d = translateToDate(inputFormat, val, validators);
|
|
16227
|
+
|
|
16228
|
+
if (d) {
|
|
16229
|
+
setState({
|
|
16230
|
+
startDate: d
|
|
16231
|
+
});
|
|
16232
|
+
|
|
16233
|
+
if (endDate) {
|
|
16234
|
+
var _getDateInfo4 = getDateInfo(endDate),
|
|
16235
|
+
eYear = _getDateInfo4.year,
|
|
16236
|
+
eMonth = _getDateInfo4.month,
|
|
16237
|
+
eDate = _getDateInfo4.date;
|
|
16238
|
+
|
|
16239
|
+
if (compareDate(startDate, 'more', eYear, eMonth, eDate)) {
|
|
16240
|
+
setState({
|
|
16241
|
+
endDate: undefined
|
|
16242
|
+
});
|
|
16243
|
+
}
|
|
16244
|
+
}
|
|
16245
|
+
}
|
|
16246
|
+
}
|
|
16247
|
+
}
|
|
16248
|
+
|
|
16249
|
+
if (type === 'end') {
|
|
16250
|
+
var _placeholderChar2 = endInputOptions.placeholderChar ? endInputOptions.placeholderChar : '_';
|
|
16251
|
+
|
|
16252
|
+
if (val && !val.includes(_placeholderChar2)) {
|
|
16253
|
+
var _d2 = translateToDate(inputFormat, val, validators);
|
|
16254
|
+
|
|
16255
|
+
if (_d2) setState({
|
|
16256
|
+
endDate: _d2
|
|
16059
16257
|
});
|
|
16060
16258
|
}
|
|
16061
16259
|
}
|
|
@@ -16088,9 +16286,9 @@ var Trigger = function Trigger(props) {
|
|
|
16088
16286
|
|
|
16089
16287
|
if (type === 'end') {
|
|
16090
16288
|
var _endInputOptions$plac = endInputOptions.placeholderChar,
|
|
16091
|
-
|
|
16289
|
+
_placeholderChar3 = _endInputOptions$plac === void 0 ? '_' : _endInputOptions$plac;
|
|
16092
16290
|
|
|
16093
|
-
if (val && hasNumber.test(val) && val.includes(
|
|
16291
|
+
if (val && hasNumber.test(val) && val.includes(_placeholderChar3)) {
|
|
16094
16292
|
setState({
|
|
16095
16293
|
endError: true
|
|
16096
16294
|
});
|
|
@@ -16100,7 +16298,7 @@ var Trigger = function Trigger(props) {
|
|
|
16100
16298
|
});
|
|
16101
16299
|
}
|
|
16102
16300
|
|
|
16103
|
-
if (!val || val.includes(
|
|
16301
|
+
if (!val || val.includes(_placeholderChar3)) setState({
|
|
16104
16302
|
endDate: undefined
|
|
16105
16303
|
});
|
|
16106
16304
|
}
|
|
@@ -16166,6 +16364,9 @@ var Trigger = function Trigger(props) {
|
|
|
16166
16364
|
onChange: function onChange(e, val) {
|
|
16167
16365
|
onChangeHandler(e, val || '', 'start');
|
|
16168
16366
|
},
|
|
16367
|
+
onPaste: function onPaste(e, val) {
|
|
16368
|
+
onPasteHandler(e, val || '', 'start');
|
|
16369
|
+
},
|
|
16169
16370
|
onBlur: function onBlur(e, val) {
|
|
16170
16371
|
onBlurHandler(e, val || '', 'start');
|
|
16171
16372
|
},
|
|
@@ -16195,6 +16396,9 @@ var Trigger = function Trigger(props) {
|
|
|
16195
16396
|
onChange: function onChange(e, val) {
|
|
16196
16397
|
onChangeHandler(e, val || '', 'end');
|
|
16197
16398
|
},
|
|
16399
|
+
onPaste: function onPaste(e, val) {
|
|
16400
|
+
onPasteHandler(e, val || '', 'end');
|
|
16401
|
+
},
|
|
16198
16402
|
onBlur: function onBlur(e, val) {
|
|
16199
16403
|
onBlurHandler(e, val || '', 'end');
|
|
16200
16404
|
},
|
|
@@ -16243,6 +16447,22 @@ var SingleInputTrigger = function SingleInputTrigger(props) {
|
|
|
16243
16447
|
return isValid(validators, startVal, inputFormat) && isValid(validators, endVal, inputFormat);
|
|
16244
16448
|
};
|
|
16245
16449
|
|
|
16450
|
+
var onPasteHandler = function onPasteHandler(_e, val) {
|
|
16451
|
+
var onPaste = inputOptions.onPaste;
|
|
16452
|
+
var date = val.split(' - ');
|
|
16453
|
+
var startVal = date[0];
|
|
16454
|
+
var endVal = date[1];
|
|
16455
|
+
var endD = translateToDate(inputFormat, endVal, validators);
|
|
16456
|
+
var startD = translateToDate(inputFormat, startVal, validators);
|
|
16457
|
+
setState({
|
|
16458
|
+
startDate: startD,
|
|
16459
|
+
endDate: endD,
|
|
16460
|
+
startValue: startVal,
|
|
16461
|
+
endValue: endVal
|
|
16462
|
+
});
|
|
16463
|
+
if (onPaste) onPaste(_e, val);
|
|
16464
|
+
};
|
|
16465
|
+
|
|
16246
16466
|
var onChangeHandler = function onChangeHandler(_e, val) {
|
|
16247
16467
|
var date = val.split(' - ');
|
|
16248
16468
|
var startVal = date[0];
|
|
@@ -16357,6 +16577,9 @@ var SingleInputTrigger = function SingleInputTrigger(props) {
|
|
|
16357
16577
|
onBlur: function onBlur(e, val) {
|
|
16358
16578
|
onBlurHandler(e, val || '');
|
|
16359
16579
|
},
|
|
16580
|
+
onPaste: function onPaste(e, val) {
|
|
16581
|
+
onPasteHandler(e, val || '');
|
|
16582
|
+
},
|
|
16360
16583
|
onClear: onClearHandler,
|
|
16361
16584
|
error: showError,
|
|
16362
16585
|
caption: showError ? errorMessage : '',
|
|
@@ -21334,6 +21557,6 @@ var HelpText = function HelpText(props) {
|
|
|
21334
21557
|
};
|
|
21335
21558
|
HelpText.displayName = 'HelpText';
|
|
21336
21559
|
|
|
21337
|
-
var version = "2.
|
|
21560
|
+
var version = "2.15.0";
|
|
21338
21561
|
|
|
21339
21562
|
export { Avatar, AvatarGroup, Backdrop, Badge, Breadcrumbs, Button, Calendar, Caption, Card, CardBody, CardFooter, CardHeader, CardSubdued, ChatMessage, Checkbox, Chip, ChipGroup, ChipInput, ChoiceList, Collapsible, Column, DatePicker, DateRangePicker, Dialog, Divider, Dropdown, Dropzone, EditableChipInput, EditableDropdown, EditableInput, EmptyState, FileList, FileUploader, FileUploaderList, FullscreenModal, Grid, GridCell, Heading, HelpText, HorizontalNav, Icon, InlineMessage, Input, X as InputMask, Label, Legend, Link, List, Message, MetaList, MetricInput, Modal, ModalBody, ModalDescription, ModalFooter, ModalHeader, MultiSlider, Navigation, OutsideClick, PageHeader, Pagination, Paragraph, Pills, Placeholder, PlaceholderImage, PlaceholderParagraph, Popover, ProgressBar, ProgressRing, Radio, RangeSlider, Row, Sidesheet, Slider, Spinner, StatusHint, Stepper, Subheading, Switch, Tab, Table, Tabs, TabsWrapper, Text, Textarea, TimePicker, Toast, Tooltip, index as Utils, VerificationCodeInput, VerticalNav, version };
|