@7shifts/sous-chef 3.10.3 → 3.11.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/dist/empty_states/EmptyStateContainer/EmptyStateContainerCTA/EmptyStateContainerCTA.d.ts +2 -1
- package/dist/forms/TimeField/TimeField.d.ts +7 -1
- package/dist/forms/TimeField/TimeFieldDropdown/TimeFieldDropdown.d.ts +12 -0
- package/dist/forms/TimeField/TimeFieldDropdown/index.d.ts +1 -0
- package/dist/forms/TimeField/TimeFieldDropdownTrigger/TimeFieldDropdownTrigger.d.ts +9 -0
- package/dist/forms/TimeField/TimeFieldDropdownTrigger/index.d.ts +1 -0
- package/dist/forms/TimeField/TimeFieldInput/TimeFieldInput.d.ts +7 -0
- package/dist/forms/TimeField/TimeFieldInput/index.d.ts +1 -0
- package/dist/forms/TimeField/domain.d.ts +1 -0
- package/dist/forms/hooks/useRangeFieldControllers.d.ts +7 -8
- package/dist/index.css +223 -207
- package/dist/index.js +1442 -1163
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1442 -1163
- package/dist/index.modern.js.map +1 -1
- package/dist/lists/DataTableRow/DataTableRow.d.ts +1 -1
- package/dist/overlay/Dropdown/Dropdown.d.ts +5 -3
- package/dist/overlay/Dropdown/DropdownContext.d.ts +1 -1
- package/dist/overlay/DropdownList/DropdownList.d.ts +1 -0
- package/dist/overlay/DropdownList/domain.d.ts +1 -0
- package/dist/overlay/DropdownPane/DropdownPane.d.ts +1 -0
- package/dist/overlay/Modal/ModalContext.d.ts +7 -0
- package/dist/overlay/Modal/ModalHeader/ModalHeader.d.ts +1 -1
- package/dist/overlay/hooks/useListKeyboardNavigation/useListKeyboardNavigation.d.ts +1 -0
- package/dist/utils/date.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -10,13 +10,13 @@ import dateFnsFormat from 'date-fns/format';
|
|
|
10
10
|
import dateFnsParse from 'date-fns/parse';
|
|
11
11
|
import startOfDay from 'date-fns/startOfDay';
|
|
12
12
|
import { debounce } from 'lodash-es';
|
|
13
|
+
import parseTime from 'time-autocomplete/src/core/AMPMParser';
|
|
13
14
|
import Select, { components } from 'react-select';
|
|
14
15
|
import { Link as Link$1 } from 'react-router-dom';
|
|
15
16
|
import AsyncSelect from 'react-select/async';
|
|
16
17
|
import DayPickerInput from 'react-day-picker/DayPickerInput';
|
|
17
18
|
import { isDate, startOfDay as startOfDay$1 } from 'date-fns';
|
|
18
19
|
import eachDayOfInterval from 'date-fns/eachDayOfInterval';
|
|
19
|
-
import parseTime from 'time-autocomplete/src/core/AMPMParser';
|
|
20
20
|
|
|
21
21
|
function _extends() {
|
|
22
22
|
_extends = Object.assign || function (target) {
|
|
@@ -4442,6 +4442,7 @@ var PaneOverlay = function PaneOverlay(_ref) {
|
|
|
4442
4442
|
var _classNames;
|
|
4443
4443
|
|
|
4444
4444
|
var width = _ref.width,
|
|
4445
|
+
maxHeight = _ref.maxHeight,
|
|
4445
4446
|
alignment = _ref.alignment,
|
|
4446
4447
|
onMouseEnter = _ref.onMouseEnter,
|
|
4447
4448
|
onMouseLeave = _ref.onMouseLeave,
|
|
@@ -4462,7 +4463,7 @@ var PaneOverlay = function PaneOverlay(_ref) {
|
|
|
4462
4463
|
}, []);
|
|
4463
4464
|
useOnClickOutside([paneRef, triggerRef], clickOutsideCallback);
|
|
4464
4465
|
useLayoutEffect(function () {
|
|
4465
|
-
if (!(triggerRef !== null && triggerRef !== void 0 && triggerRef.current) || !(paneRef !== null && paneRef !== void 0 && paneRef.current)) {
|
|
4466
|
+
if (!triggerRef || !('current' in triggerRef) || !(triggerRef !== null && triggerRef !== void 0 && triggerRef.current) || !(paneRef !== null && paneRef !== void 0 && paneRef.current)) {
|
|
4466
4467
|
return;
|
|
4467
4468
|
}
|
|
4468
4469
|
|
|
@@ -4473,10 +4474,13 @@ var PaneOverlay = function PaneOverlay(_ref) {
|
|
|
4473
4474
|
}, [triggerRef]);
|
|
4474
4475
|
var handleEscapeKey = useCallback(onToggleDropdown, []);
|
|
4475
4476
|
useKeyPress(['Escape'], handleEscapeKey);
|
|
4477
|
+
var overflow = maxHeight ? 'scroll' : undefined;
|
|
4476
4478
|
return React__default.createElement("div", {
|
|
4477
4479
|
className: classnames(styles$b['dropdown-pane'], (_classNames = {}, _classNames[styles$b['dropdown-pane--with-padding']] = true, _classNames)),
|
|
4478
4480
|
style: _extends({}, position, {
|
|
4479
|
-
width: width
|
|
4481
|
+
width: width,
|
|
4482
|
+
maxHeight: maxHeight,
|
|
4483
|
+
overflow: overflow
|
|
4480
4484
|
}),
|
|
4481
4485
|
ref: paneRef,
|
|
4482
4486
|
onMouseEnter: onMouseEnter,
|
|
@@ -4512,1151 +4516,1369 @@ var DROPDOWN_TRIGGER = {
|
|
|
4512
4516
|
CLICK: 'click'
|
|
4513
4517
|
};
|
|
4514
4518
|
|
|
4515
|
-
var
|
|
4516
|
-
var trigger = _ref.trigger,
|
|
4517
|
-
_ref$triggersOn = _ref.triggersOn,
|
|
4518
|
-
triggersOn = _ref$triggersOn === void 0 ? DROPDOWN_TRIGGER.CLICK : _ref$triggersOn,
|
|
4519
|
-
_ref$alignment = _ref.alignment,
|
|
4520
|
-
alignment = _ref$alignment === void 0 ? DROPDOWN_ALIGNEMNT.RIGHT : _ref$alignment,
|
|
4521
|
-
width = _ref.width,
|
|
4522
|
-
testId = _ref.testId,
|
|
4523
|
-
children = _ref.children;
|
|
4524
|
-
|
|
4525
|
-
var _useState = useState(false),
|
|
4526
|
-
isOpen = _useState[0],
|
|
4527
|
-
setIsOpen = _useState[1];
|
|
4528
|
-
|
|
4529
|
-
var triggerRef = useRef(null);
|
|
4530
|
-
var paneRef = useRef(null);
|
|
4531
|
-
var isFocusingOverlay = useRef(false);
|
|
4532
|
-
|
|
4533
|
-
var handleToggleDropdown = function handleToggleDropdown() {
|
|
4534
|
-
return setIsOpen(!isOpen);
|
|
4535
|
-
};
|
|
4536
|
-
|
|
4537
|
-
var handleMouseClick = function handleMouseClick(e) {
|
|
4538
|
-
handleToggleDropdown();
|
|
4539
|
-
e.stopPropagation();
|
|
4540
|
-
|
|
4541
|
-
if ('onClick' in trigger.props) {
|
|
4542
|
-
trigger.props.onClick(e);
|
|
4543
|
-
}
|
|
4544
|
-
};
|
|
4519
|
+
var styles$d = {"overlay":"_2puqJ","overlay--after-open":"_1167h","overlay--before-close":"_t_t7L","content":"_wQQ_2","content--after-open":"_3jwux","content--before-close":"_2c2QP"};
|
|
4545
4520
|
|
|
4546
|
-
|
|
4547
|
-
if (triggersOn !== 'hover') {
|
|
4548
|
-
return;
|
|
4549
|
-
}
|
|
4521
|
+
var styles$e = {"header":"_36nxW","header__close-button":"_2zYre","sub-header":"_2XwRD"};
|
|
4550
4522
|
|
|
4551
|
-
|
|
4523
|
+
var ModalHeader = function ModalHeader(_ref) {
|
|
4524
|
+
var header = _ref.header,
|
|
4525
|
+
subHeader = _ref.subHeader,
|
|
4526
|
+
onClose = _ref.onClose,
|
|
4527
|
+
loading = _ref.loading;
|
|
4552
4528
|
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4529
|
+
if (!header && !subHeader) {
|
|
4530
|
+
return onClose ? React__default.createElement("div", {
|
|
4531
|
+
className: styles$e['header__close-button']
|
|
4532
|
+
}, React__default.createElement(Button$1, {
|
|
4533
|
+
theme: "link-icon",
|
|
4534
|
+
onClick: onClose,
|
|
4535
|
+
disabled: loading
|
|
4536
|
+
}, React__default.createElement(IconTimes, null))) : null;
|
|
4537
|
+
}
|
|
4557
4538
|
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4539
|
+
return React__default.createElement(Stack, {
|
|
4540
|
+
space: 12,
|
|
4541
|
+
marginBottom: 24
|
|
4542
|
+
}, React__default.createElement(Inline, {
|
|
4543
|
+
flex: [1],
|
|
4544
|
+
alignItems: "center"
|
|
4545
|
+
}, React__default.createElement("span", {
|
|
4546
|
+
className: styles$e['header']
|
|
4547
|
+
}, header), onClose && React__default.createElement(Button$1, {
|
|
4548
|
+
theme: "link-icon",
|
|
4549
|
+
onClick: onClose,
|
|
4550
|
+
disabled: loading
|
|
4551
|
+
}, React__default.createElement(IconTimes, null))), subHeader && React__default.createElement("div", {
|
|
4552
|
+
className: styles$e['sub-header']
|
|
4553
|
+
}, subHeader));
|
|
4554
|
+
};
|
|
4562
4555
|
|
|
4563
|
-
|
|
4556
|
+
var ModalContext = createContext({
|
|
4557
|
+
isModalMounted: false
|
|
4558
|
+
});
|
|
4559
|
+
var useModalContext = function useModalContext() {
|
|
4560
|
+
var context = useContext(ModalContext);
|
|
4561
|
+
return context || {};
|
|
4562
|
+
};
|
|
4564
4563
|
|
|
4565
|
-
|
|
4566
|
-
|
|
4564
|
+
var Modal = function Modal(_ref) {
|
|
4565
|
+
var children = _ref.children,
|
|
4566
|
+
header = _ref.header,
|
|
4567
|
+
subHeader = _ref.subHeader,
|
|
4568
|
+
onClose = _ref.onClose,
|
|
4569
|
+
loading = _ref.loading,
|
|
4570
|
+
_ref$zIndex = _ref.zIndex,
|
|
4571
|
+
zIndex = _ref$zIndex === void 0 ? Z_INDEX_LAYERS.MODAL : _ref$zIndex,
|
|
4572
|
+
rootElementId = _ref.rootElementId,
|
|
4573
|
+
_ref$width = _ref.width,
|
|
4574
|
+
width = _ref$width === void 0 ? 500 : _ref$width,
|
|
4575
|
+
height = _ref.height,
|
|
4576
|
+
maxWidth = _ref.maxWidth,
|
|
4577
|
+
_ref$shouldReturnFocu = _ref.shouldReturnFocusAfterClose,
|
|
4578
|
+
shouldReturnFocusAfterClose = _ref$shouldReturnFocu === void 0 ? true : _ref$shouldReturnFocu,
|
|
4579
|
+
testId = _ref.testId;
|
|
4580
|
+
var style = {
|
|
4581
|
+
content: {
|
|
4582
|
+
width: width,
|
|
4583
|
+
height: height,
|
|
4584
|
+
maxWidth: maxWidth
|
|
4585
|
+
},
|
|
4586
|
+
overlay: {
|
|
4587
|
+
zIndex: zIndex
|
|
4567
4588
|
}
|
|
4568
4589
|
};
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4590
|
+
return React__default.createElement(ReactModal, {
|
|
4591
|
+
isOpen: true,
|
|
4592
|
+
testId: testId,
|
|
4593
|
+
shouldCloseOnEsc: true,
|
|
4594
|
+
shouldCloseOnOverlayClick: false,
|
|
4595
|
+
shouldReturnFocusAfterClose: shouldReturnFocusAfterClose,
|
|
4596
|
+
onRequestClose: onClose && !loading ? onClose : undefined,
|
|
4597
|
+
style: style,
|
|
4598
|
+
closeTimeoutMS: 200,
|
|
4599
|
+
contentLabel: "Modal",
|
|
4600
|
+
appElement: rootElementId && document.getElementById(rootElementId) || undefined,
|
|
4601
|
+
overlayClassName: {
|
|
4602
|
+
base: styles$d['overlay'],
|
|
4603
|
+
afterOpen: styles$d['overlay--after-open'],
|
|
4604
|
+
beforeClose: styles$d['overlay--before-close']
|
|
4605
|
+
},
|
|
4606
|
+
className: {
|
|
4607
|
+
base: styles$d['content'],
|
|
4608
|
+
afterOpen: styles$d['content--after-open'],
|
|
4609
|
+
beforeClose: styles$d['content--before-close']
|
|
4573
4610
|
}
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
}
|
|
4611
|
+
}, React__default.createElement(ModalHeader, {
|
|
4612
|
+
header: header,
|
|
4613
|
+
subHeader: subHeader,
|
|
4614
|
+
onClose: onClose,
|
|
4615
|
+
loading: loading
|
|
4616
|
+
}), React__default.createElement(ModalContext.Provider, {
|
|
4617
|
+
value: {
|
|
4618
|
+
isModalMounted: true
|
|
4583
4619
|
}
|
|
4584
|
-
};
|
|
4620
|
+
}, children));
|
|
4621
|
+
};
|
|
4585
4622
|
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4623
|
+
Modal.setAppElement = function (rootElement) {
|
|
4624
|
+
ReactModal.setAppElement(rootElement);
|
|
4625
|
+
};
|
|
4589
4626
|
|
|
4590
|
-
|
|
4591
|
-
|
|
4627
|
+
var THRESHOLD = 20;
|
|
4628
|
+
var useScrollShadow = function useScrollShadow() {
|
|
4629
|
+
var ref = useRef(null);
|
|
4592
4630
|
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
};
|
|
4631
|
+
var _useState = useState(false),
|
|
4632
|
+
showScrollShadow = _useState[0],
|
|
4633
|
+
setShowScrollShadow = _useState[1];
|
|
4597
4634
|
|
|
4598
|
-
|
|
4599
|
-
if (!
|
|
4635
|
+
useEffect(function () {
|
|
4636
|
+
if (!ref.current) {
|
|
4600
4637
|
return;
|
|
4601
4638
|
}
|
|
4602
4639
|
|
|
4603
|
-
var
|
|
4640
|
+
var modalBody = ref.current;
|
|
4604
4641
|
|
|
4605
|
-
if (
|
|
4606
|
-
|
|
4607
|
-
return focusableElements[0].focus();
|
|
4608
|
-
}, 0);
|
|
4609
|
-
} else if (!isFocusingOverlay.current) {
|
|
4610
|
-
setIsOpen(false);
|
|
4642
|
+
if (modalBody.offsetHeight > THRESHOLD) {
|
|
4643
|
+
setShowScrollShadow(true);
|
|
4611
4644
|
}
|
|
4645
|
+
}, []);
|
|
4646
|
+
return {
|
|
4647
|
+
ref: ref,
|
|
4648
|
+
showScrollShadow: showScrollShadow
|
|
4612
4649
|
};
|
|
4613
|
-
|
|
4614
|
-
var triggerProps = {
|
|
4615
|
-
onClick: handleMouseClick,
|
|
4616
|
-
onMouseEnter: handleMouseEnter,
|
|
4617
|
-
onMouseLeave: handleMouseLeave,
|
|
4618
|
-
onBlur: handleOnBlur,
|
|
4619
|
-
onFocus: handleFocus,
|
|
4620
|
-
ref: triggerRef
|
|
4621
|
-
};
|
|
4622
|
-
return React__default.createElement(DropdownContext.Provider, {
|
|
4623
|
-
value: {
|
|
4624
|
-
isOpen: isOpen,
|
|
4625
|
-
onToggleDropdown: handleToggleDropdown,
|
|
4626
|
-
triggerRef: triggerRef,
|
|
4627
|
-
paneRef: paneRef
|
|
4628
|
-
}
|
|
4629
|
-
}, trigger.type === Button$1 ? React__default.cloneElement(trigger, _extends({}, trigger.props, triggerProps)) : React__default.createElement("button", Object.assign({}, triggerProps, {
|
|
4630
|
-
className: styles$c['dropdown__trigger'],
|
|
4631
|
-
onFocus: handleFocus
|
|
4632
|
-
}), trigger), React__default.createElement(DropdownPane, {
|
|
4633
|
-
width: width,
|
|
4634
|
-
onMouseEnter: handlePaneMouseEnter,
|
|
4635
|
-
onMouseLeave: handlePaneMouseLeave,
|
|
4636
|
-
alignment: alignment,
|
|
4637
|
-
testId: testId
|
|
4638
|
-
}, children));
|
|
4639
4650
|
};
|
|
4640
4651
|
|
|
4641
|
-
var styles$
|
|
4642
|
-
|
|
4643
|
-
var findNextActiveIndex = function findNextActiveIndex(items, startAt) {
|
|
4644
|
-
var startIndex = 0;
|
|
4652
|
+
var styles$f = {"modal-body":"_2J-ku","modal-body--with-scroll-shadow":"_2ErCP"};
|
|
4645
4653
|
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
}
|
|
4654
|
+
var ModalBody = function ModalBody(_ref) {
|
|
4655
|
+
var _classNames;
|
|
4649
4656
|
|
|
4650
|
-
var
|
|
4651
|
-
|
|
4652
|
-
});
|
|
4657
|
+
var children = _ref.children,
|
|
4658
|
+
testId = _ref.testId;
|
|
4653
4659
|
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
return false;
|
|
4658
|
-
}
|
|
4660
|
+
var _useScrollShadow = useScrollShadow(),
|
|
4661
|
+
ref = _useScrollShadow.ref,
|
|
4662
|
+
showScrollShadow = _useScrollShadow.showScrollShadow;
|
|
4659
4663
|
|
|
4660
|
-
|
|
4661
|
-
})
|
|
4664
|
+
return React__default.createElement("div", {
|
|
4665
|
+
className: classnames(styles$f['modal-body'], (_classNames = {}, _classNames[styles$f['modal-body--with-scroll-shadow']] = showScrollShadow, _classNames)),
|
|
4666
|
+
ref: ref,
|
|
4667
|
+
"data-testid": testId
|
|
4668
|
+
}, children);
|
|
4669
|
+
};
|
|
4662
4670
|
|
|
4663
|
-
|
|
4664
|
-
}
|
|
4671
|
+
var styles$g = {"modal-footer":"_LKOr5","tertiary-container":"_Qktd-"};
|
|
4665
4672
|
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
return nextEnabledIndex >= 0 ? nextEnabledIndex : null;
|
|
4670
|
-
};
|
|
4671
|
-
var findPreviousEnabledIndex = function findPreviousEnabledIndex(items, startAt) {
|
|
4672
|
-
for (var i = startAt - 1; i >= 0; i--) {
|
|
4673
|
-
if (!items[i].disabled) {
|
|
4674
|
-
return i;
|
|
4675
|
-
}
|
|
4673
|
+
var updateButtonProps = function updateButtonProps(button, newProps) {
|
|
4674
|
+
if (!button) {
|
|
4675
|
+
return null;
|
|
4676
4676
|
}
|
|
4677
4677
|
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
return _i;
|
|
4681
|
-
}
|
|
4678
|
+
if (button.type !== Button$1) {
|
|
4679
|
+
return button;
|
|
4682
4680
|
}
|
|
4683
4681
|
|
|
4684
|
-
return
|
|
4682
|
+
return React__default.cloneElement(button, _extends({}, newProps));
|
|
4685
4683
|
};
|
|
4686
4684
|
|
|
4687
|
-
var
|
|
4688
|
-
var
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
var focusOnNextItem = function focusOnNextItem() {
|
|
4693
|
-
setFocusedItem(findNextActiveIndex(listItems, focusedItem));
|
|
4694
|
-
};
|
|
4685
|
+
var ModalFooter = function ModalFooter(_ref) {
|
|
4686
|
+
var children = _ref.children,
|
|
4687
|
+
actions = _ref.actions,
|
|
4688
|
+
testId = _ref.testId;
|
|
4695
4689
|
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
};
|
|
4690
|
+
if (actions) {
|
|
4691
|
+
var _actions$primary, _actions$secondary, _actions$tertiary, _classnames;
|
|
4699
4692
|
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
}
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4693
|
+
var primaryButton = updateButtonProps(actions.primary, {
|
|
4694
|
+
theme: (actions === null || actions === void 0 ? void 0 : (_actions$primary = actions.primary) === null || _actions$primary === void 0 ? void 0 : _actions$primary.props.theme) || 'primary',
|
|
4695
|
+
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
4696
|
+
});
|
|
4697
|
+
var secondaryButton = updateButtonProps(actions.secondary, {
|
|
4698
|
+
theme: (actions === null || actions === void 0 ? void 0 : (_actions$secondary = actions.secondary) === null || _actions$secondary === void 0 ? void 0 : _actions$secondary.props.theme) || 'default',
|
|
4699
|
+
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
4700
|
+
});
|
|
4701
|
+
var tertiaryButton = updateButtonProps(actions.tertiary, {
|
|
4702
|
+
theme: (actions === null || actions === void 0 ? void 0 : (_actions$tertiary = actions.tertiary) === null || _actions$tertiary === void 0 ? void 0 : _actions$tertiary.props.theme) || 'link-primary',
|
|
4703
|
+
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
4704
|
+
});
|
|
4705
|
+
return React__default.createElement(FooterContainer, {
|
|
4706
|
+
testId: testId
|
|
4707
|
+
}, React__default.createElement(Inline, {
|
|
4708
|
+
justifyContent: "space-between"
|
|
4709
|
+
}, React__default.createElement("div", {
|
|
4710
|
+
className: classnames((_classnames = {}, _classnames[styles$g['tertiary-container']] = tertiaryButton && tertiaryButton.props.theme.startsWith('link'), _classnames))
|
|
4711
|
+
}, tertiaryButton || React__default.createElement("div", null)), React__default.createElement(Inline, {
|
|
4712
|
+
space: 12
|
|
4713
|
+
}, secondaryButton, primaryButton)));
|
|
4714
|
+
}
|
|
4707
4715
|
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
focusOnNextItem();
|
|
4711
|
-
}
|
|
4716
|
+
return React__default.createElement(FooterContainer, null, children);
|
|
4717
|
+
};
|
|
4712
4718
|
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4719
|
+
var FooterContainer = function FooterContainer(_ref2) {
|
|
4720
|
+
var children = _ref2.children,
|
|
4721
|
+
testId = _ref2.testId;
|
|
4722
|
+
var childrenItens = React__default.Children.toArray(children);
|
|
4723
|
+
var hasCustomAlignment = childrenItens.length === 1 && childrenItens[0].type === Inline;
|
|
4724
|
+
return React__default.createElement("div", {
|
|
4725
|
+
className: styles$g['modal-footer'],
|
|
4726
|
+
"data-testid": testId
|
|
4727
|
+
}, React__default.createElement(Inline, {
|
|
4728
|
+
justifyContent: "end",
|
|
4729
|
+
space: 12,
|
|
4730
|
+
flex: hasCustomAlignment ? [1] : undefined
|
|
4731
|
+
}, children));
|
|
4732
|
+
};
|
|
4716
4733
|
|
|
4717
|
-
|
|
4718
|
-
var _actions$onPressEnter;
|
|
4734
|
+
var styles$h = {"container":"_v1b-5","wrapper":"_3mrLu","interactionDisabled":"_1J9dh","DayPicker-Day":"_8FcQE","navBar":"_1SPuq","todayButton":"_24FJ6","navButtonInteractionDisabled":"_Oxdm9","navButtonPrev":"_20uqc","navButtonNext":"_3C53z","months":"_M_eHz","month":"_3RPpJ","caption":"_1FXNw","weekdays":"_3KcRU","weekdaysRow":"_1fO_e","weekday":"_c1Y-X","body":"_34mA1","week":"_1PmqZ","day":"_1AWH2","disabled":"_3vJkw","selected":"_1DR0N","outside":"_276GV","footer":"_2M5xr","today":"_3N6fj","overlayWrapper":"_3Zqgu","overlay":"_20Ncd","weekNumber":"_2hb-S"};
|
|
4719
4735
|
|
|
4720
|
-
|
|
4721
|
-
onClick(event);
|
|
4722
|
-
actions && ((_actions$onPressEnter = actions.onPressEnter) === null || _actions$onPressEnter === void 0 ? void 0 : _actions$onPressEnter.call(actions));
|
|
4723
|
-
}
|
|
4736
|
+
var styles$i = {"container":"_okDvi","wrapper":"_17XdD","interactionDisabled":"_1O7OT","DayPicker-Day":"_3noGA","navBar":"_1Hl3Q","todayButton":"_m0Vs9","navButtonInteractionDisabled":"_1ULWH","navButtonPrev":"_3gjq8","navButtonNext":"_1m-Kd","months":"_Fq6Xh","month":"_3i0Oo","caption":"_36X9Y","weekdays":"_1aWPn","weekdaysRow":"_3HXCK","weekday":"_t-ctd","body":"_XAbiR","week":"_3Nwep","day":"_3nNcG","disabled":"_1M4ZF","selected":"_2PEs8","outside":"_1PIJa","footer":"_2T_z1","today":"_1hVM6","overlayWrapper":"_1L-hI","overlay":"_dDPZb","weekNumber":"_1alhT"};
|
|
4724
4737
|
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
focusedItem: focusedItem,
|
|
4730
|
-
setFocusOnItem: setFocusOnItem
|
|
4731
|
-
};
|
|
4732
|
-
};
|
|
4738
|
+
function parseDate(str, format, locale) {
|
|
4739
|
+
var parsed = dateFnsParse(str, format, new Date(), {
|
|
4740
|
+
locale: locale
|
|
4741
|
+
});
|
|
4733
4742
|
|
|
4734
|
-
|
|
4743
|
+
if (str.length === format.length && DateUtils.isDate(parsed)) {
|
|
4744
|
+
return parsed;
|
|
4745
|
+
}
|
|
4735
4746
|
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4747
|
+
return undefined;
|
|
4748
|
+
}
|
|
4749
|
+
function formatDate(date, format, locale) {
|
|
4750
|
+
return dateFnsFormat(date, format, {
|
|
4751
|
+
locale: locale
|
|
4741
4752
|
});
|
|
4742
|
-
}
|
|
4743
|
-
|
|
4744
|
-
|
|
4753
|
+
}
|
|
4754
|
+
function setToMidnight(date) {
|
|
4755
|
+
return date && startOfDay(date);
|
|
4756
|
+
}
|
|
4757
|
+
function getStartOfWeek(date, weekIndex) {
|
|
4758
|
+
var d = new Date(date);
|
|
4759
|
+
var firstDay = d.getDate() - d.getDay() + weekIndex;
|
|
4760
|
+
var firstDayAdjusted = firstDay > d.getDate() ? firstDay - 7 : firstDay;
|
|
4761
|
+
return new Date(d.setDate(firstDayAdjusted));
|
|
4762
|
+
}
|
|
4763
|
+
function getEndOfWeek(date, weekIndex) {
|
|
4764
|
+
var startOfWeek = getStartOfWeek(date, weekIndex);
|
|
4765
|
+
var endDay = startOfWeek.getDate() + 6;
|
|
4766
|
+
return new Date(startOfWeek.setDate(endDay));
|
|
4767
|
+
}
|
|
4768
|
+
function createWeekRange(date, weekStart) {
|
|
4769
|
+
return {
|
|
4770
|
+
start: getStartOfWeek(date, weekStart),
|
|
4771
|
+
end: getEndOfWeek(date, weekStart)
|
|
4772
|
+
};
|
|
4773
|
+
}
|
|
4774
|
+
var DAYS = [getLocalizedString('time.sunday'), getLocalizedString('time.monday'), getLocalizedString('time.tuesday'), getLocalizedString('time.wednesday'), getLocalizedString('time.thursday'), getLocalizedString('time.friday'), getLocalizedString('time.saturday')];
|
|
4775
|
+
var MONTH_NAMES = [getLocalizedString('time.january'), getLocalizedString('time.february'), getLocalizedString('time.march'), getLocalizedString('time.april'), getLocalizedString('time.may'), getLocalizedString('time.june'), getLocalizedString('time.july'), getLocalizedString('time.august'), getLocalizedString('time.september'), getLocalizedString('time.october'), getLocalizedString('time.november'), getLocalizedString('time.december')];
|
|
4745
4776
|
|
|
4746
|
-
var
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
H1: 'h1',
|
|
4750
|
-
H2: 'h2',
|
|
4751
|
-
H3: 'h3',
|
|
4752
|
-
H4: 'h4',
|
|
4753
|
-
H5: 'h5',
|
|
4754
|
-
INSIGHT: 'insight'
|
|
4755
|
-
};
|
|
4756
|
-
var FONT_EMPHASIS = {
|
|
4757
|
-
BOLD: 'bold',
|
|
4758
|
-
ITALIC: 'italic',
|
|
4759
|
-
UNDERLINE: 'underline',
|
|
4760
|
-
MONOSPACE: 'monospace'
|
|
4777
|
+
var CALENDAR_MODE = {
|
|
4778
|
+
DAY: 'day',
|
|
4779
|
+
WEEK: 'week'
|
|
4761
4780
|
};
|
|
4762
|
-
var
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
CENTER: 'center',
|
|
4766
|
-
JUSTIFY: 'justify'
|
|
4781
|
+
var CALENDAR_PLACEMENT = {
|
|
4782
|
+
BOTTOM: 'bottom',
|
|
4783
|
+
TOP: 'top'
|
|
4767
4784
|
};
|
|
4768
4785
|
|
|
4769
|
-
var
|
|
4786
|
+
var calculateCalendarPosition = function calculateCalendarPosition(placement, anchorPosition, calendarDimensions) {
|
|
4787
|
+
if (!calendarDimensions) {
|
|
4788
|
+
return {
|
|
4789
|
+
left: 0,
|
|
4790
|
+
top: 0
|
|
4791
|
+
};
|
|
4792
|
+
}
|
|
4770
4793
|
|
|
4771
|
-
var
|
|
4794
|
+
var horizontalPosition = getHorizontalPosition(anchorPosition, calendarDimensions);
|
|
4795
|
+
var verticalPosition = getVerticalPosition(anchorPosition, placement, calendarDimensions);
|
|
4796
|
+
return _extends({}, horizontalPosition, verticalPosition);
|
|
4797
|
+
};
|
|
4772
4798
|
|
|
4773
|
-
var
|
|
4774
|
-
var
|
|
4799
|
+
var getHorizontalPosition = function getHorizontalPosition(anchorPosition, calendarDimensions) {
|
|
4800
|
+
var innerWidth = window.innerWidth;
|
|
4801
|
+
var calendarRight = anchorPosition.left + calendarDimensions.width;
|
|
4775
4802
|
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
color = _ref.color,
|
|
4782
|
-
testId = _ref.testId,
|
|
4783
|
-
positionProps = _objectWithoutPropertiesLoose(_ref, _excluded$2g);
|
|
4803
|
+
if (innerWidth > calendarRight + BUFFER) {
|
|
4804
|
+
return {
|
|
4805
|
+
left: anchorPosition.left
|
|
4806
|
+
};
|
|
4807
|
+
}
|
|
4784
4808
|
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
style: _extends({
|
|
4788
|
-
color: color
|
|
4789
|
-
}, positionStyles),
|
|
4790
|
-
className: classnames(styles$g['text'], (_classnames = {}, _classnames[styles$g['text--bold']] = emphasis === null || emphasis === void 0 ? void 0 : emphasis.includes(FONT_EMPHASIS.BOLD), _classnames[styles$g['text--italic']] = emphasis === null || emphasis === void 0 ? void 0 : emphasis.includes(FONT_EMPHASIS.ITALIC), _classnames[styles$g['text--underline']] = emphasis === null || emphasis === void 0 ? void 0 : emphasis.includes(FONT_EMPHASIS.UNDERLINE), _classnames[styles$g['text--monospace']] = emphasis === null || emphasis === void 0 ? void 0 : emphasis.includes(FONT_EMPHASIS.MONOSPACE), _classnames[styles$g['text--align-left']] = alignment === ALIGNMENTS.LEFT, _classnames[styles$g['text--align-right']] = alignment === ALIGNMENTS.RIGHT, _classnames[styles$g['text--align-center']] = alignment === ALIGNMENTS.CENTER, _classnames[styles$g['text--align-justify']] = alignment === ALIGNMENTS.JUSTIFY, _classnames[styles$g['text__body']] = as === TEXT_TYPES.BODY, _classnames[styles$g['text__insight']] = as === TEXT_TYPES.INSIGHT, _classnames[styles$g['text__caption']] = as === TEXT_TYPES.CAPTION, _classnames)),
|
|
4791
|
-
'data-testid': testId
|
|
4809
|
+
return {
|
|
4810
|
+
left: anchorPosition.right - calendarDimensions.width
|
|
4792
4811
|
};
|
|
4793
|
-
var pTypes = [TEXT_TYPES.BODY, TEXT_TYPES.CAPTION, TEXT_TYPES.INSIGHT];
|
|
4794
|
-
var element = pTypes.includes(as) ? 'p' : as;
|
|
4795
|
-
return React__default.createElement(element, elementProps, children);
|
|
4796
4812
|
};
|
|
4797
4813
|
|
|
4798
|
-
var
|
|
4799
|
-
var
|
|
4800
|
-
|
|
4801
|
-
className: classnames(styles$g['text--bold'], styles$g['text'])
|
|
4802
|
-
}, children);
|
|
4803
|
-
};
|
|
4804
|
-
|
|
4805
|
-
var Underline = function Underline(_ref) {
|
|
4806
|
-
var children = _ref.children;
|
|
4807
|
-
return React__default.createElement("span", {
|
|
4808
|
-
className: classnames(styles$g['text--underline'], styles$g['text'])
|
|
4809
|
-
}, children);
|
|
4810
|
-
};
|
|
4814
|
+
var getVerticalPosition = function getVerticalPosition(anchorPosition, placement, calendarDimensions) {
|
|
4815
|
+
var calendarTopAboveTrigger = anchorPosition.top - calendarDimensions.height - PADDING;
|
|
4816
|
+
var calendarTopBelowTrigger = anchorPosition.bottom + PADDING;
|
|
4811
4817
|
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
}
|
|
4818
|
+
if (placement === CALENDAR_PLACEMENT.TOP) {
|
|
4819
|
+
if (calendarTopAboveTrigger < 0) {
|
|
4820
|
+
return {
|
|
4821
|
+
top: anchorPosition.bottom + PADDING
|
|
4822
|
+
};
|
|
4823
|
+
}
|
|
4818
4824
|
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
var GREY300 = '#949494';
|
|
4829
|
-
var GREY400 = '#767676';
|
|
4830
|
-
var GREY500 = '#464646';
|
|
4825
|
+
return {
|
|
4826
|
+
top: calendarTopAboveTrigger + window.scrollY
|
|
4827
|
+
};
|
|
4828
|
+
} else {
|
|
4829
|
+
if (calendarTopBelowTrigger + calendarDimensions.height > window.innerHeight) {
|
|
4830
|
+
return {
|
|
4831
|
+
top: calendarTopAboveTrigger + window.scrollY
|
|
4832
|
+
};
|
|
4833
|
+
}
|
|
4831
4834
|
|
|
4832
|
-
|
|
4833
|
-
|
|
4835
|
+
return {
|
|
4836
|
+
top: calendarTopBelowTrigger + window.scrollY
|
|
4837
|
+
};
|
|
4838
|
+
}
|
|
4839
|
+
};
|
|
4834
4840
|
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4841
|
+
var Calendar = function Calendar(_ref) {
|
|
4842
|
+
var _ref$mode = _ref.mode,
|
|
4843
|
+
mode = _ref$mode === void 0 ? CALENDAR_MODE.DAY : _ref$mode,
|
|
4844
|
+
_ref$position = _ref.position,
|
|
4845
|
+
position = _ref$position === void 0 ? CALENDAR_PLACEMENT.BOTTOM : _ref$position,
|
|
4846
|
+
_ref$weekStart = _ref.weekStart,
|
|
4847
|
+
weekStart = _ref$weekStart === void 0 ? 0 : _ref$weekStart,
|
|
4839
4848
|
selected = _ref.selected,
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4849
|
+
onSelect = _ref.onSelect,
|
|
4850
|
+
onClickOutside = _ref.onClickOutside,
|
|
4851
|
+
disabledDays = _ref.disabledDays,
|
|
4852
|
+
anchorRef = _ref.anchorRef,
|
|
4853
|
+
testId = _ref.testId;
|
|
4843
4854
|
|
|
4844
|
-
var
|
|
4845
|
-
|
|
4855
|
+
var _useState = useState(null),
|
|
4856
|
+
calendarRef = _useState[0],
|
|
4857
|
+
setCalendarRef = _useState[1];
|
|
4846
4858
|
|
|
4847
|
-
var
|
|
4848
|
-
|
|
4859
|
+
var style = mode === CALENDAR_MODE.DAY ? styles$h : styles$i;
|
|
4860
|
+
var anchorNode = anchorRef.current;
|
|
4861
|
+
useOnClickOutside({
|
|
4862
|
+
current: calendarRef
|
|
4863
|
+
}, function (event) {
|
|
4864
|
+
var _anchorRef$current;
|
|
4849
4865
|
|
|
4850
|
-
if (
|
|
4851
|
-
|
|
4866
|
+
if (!((_anchorRef$current = anchorRef.current) !== null && _anchorRef$current !== void 0 && _anchorRef$current.contains(event === null || event === void 0 ? void 0 : event.srcElement))) {
|
|
4867
|
+
onClickOutside();
|
|
4852
4868
|
}
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4869
|
+
});
|
|
4870
|
+
var weekRange = selected ? createWeekRange(selected, weekStart) : undefined;
|
|
4871
|
+
var selectedRange = weekRange && {
|
|
4872
|
+
from: weekRange.start,
|
|
4873
|
+
to: weekRange.end
|
|
4856
4874
|
};
|
|
4857
4875
|
|
|
4858
|
-
var
|
|
4859
|
-
|
|
4860
|
-
return EGGPLANT500;
|
|
4861
|
-
}
|
|
4876
|
+
var handleSelect = function handleSelect(day) {
|
|
4877
|
+
var selectedDate = setToMidnight(day);
|
|
4862
4878
|
|
|
4863
|
-
if (
|
|
4864
|
-
|
|
4879
|
+
if (mode === CALENDAR_MODE.DAY) {
|
|
4880
|
+
onSelect(selectedDate);
|
|
4881
|
+
} else {
|
|
4882
|
+
var _weekRange = createWeekRange(selectedDate, weekStart);
|
|
4883
|
+
|
|
4884
|
+
onSelect(_weekRange.start);
|
|
4865
4885
|
}
|
|
4866
4886
|
|
|
4867
|
-
|
|
4887
|
+
setTimeout(function () {
|
|
4888
|
+
onClickOutside();
|
|
4889
|
+
}, 100);
|
|
4868
4890
|
};
|
|
4869
4891
|
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4892
|
+
if (!anchorNode) {
|
|
4893
|
+
return null;
|
|
4894
|
+
}
|
|
4895
|
+
|
|
4896
|
+
var anchorPosition = anchorNode.getBoundingClientRect();
|
|
4897
|
+
var calendarPosition = calculateCalendarPosition(position, anchorPosition, calendarRef === null || calendarRef === void 0 ? void 0 : calendarRef.getBoundingClientRect());
|
|
4898
|
+
return React__default.createElement(Portal, null, React__default.createElement("div", {
|
|
4899
|
+
className: style.overlayWrapper
|
|
4900
|
+
}, React__default.createElement("div", {
|
|
4901
|
+
className: style.overlay,
|
|
4902
|
+
ref: function ref(_ref2) {
|
|
4903
|
+
return setCalendarRef(_ref2);
|
|
4904
|
+
},
|
|
4905
|
+
style: _extends({}, calendarPosition, {
|
|
4906
|
+
zIndex: Z_INDEX_LAYERS.MODAL
|
|
4907
|
+
}),
|
|
4875
4908
|
"data-testid": testId
|
|
4876
|
-
},
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4909
|
+
}, React__default.createElement(DayPicker, {
|
|
4910
|
+
format: "MM/dd/yyyy",
|
|
4911
|
+
classNames: style,
|
|
4912
|
+
onDayClick: function onDayClick(day, activeModifiers) {
|
|
4913
|
+
var isDateDisabled = Object.keys(activeModifiers).find(function (modifier) {
|
|
4914
|
+
return modifier.includes('disabled');
|
|
4915
|
+
});
|
|
4916
|
+
|
|
4917
|
+
if (!Boolean(isDateDisabled)) {
|
|
4918
|
+
handleSelect(day);
|
|
4919
|
+
}
|
|
4920
|
+
},
|
|
4921
|
+
selectedDays: mode === CALENDAR_MODE.DAY ? selected : selectedRange,
|
|
4922
|
+
disabledDays: disabledDays,
|
|
4923
|
+
months: MONTH_NAMES,
|
|
4924
|
+
weekdaysLong: DAYS,
|
|
4925
|
+
initialMonth: selected,
|
|
4926
|
+
weekdaysShort: DAYS.map(function (day) {
|
|
4927
|
+
return day.substring(0, 2);
|
|
4928
|
+
}),
|
|
4929
|
+
showOutsideDays: mode === CALENDAR_MODE.WEEK,
|
|
4930
|
+
firstDayOfWeek: weekStart
|
|
4931
|
+
}))));
|
|
4885
4932
|
};
|
|
4886
4933
|
|
|
4887
|
-
var
|
|
4888
|
-
var itemType = getItemType(child);
|
|
4934
|
+
var styles$j = {"dropdown-list":"_1v1df","dropdown-list__item--hover":"_eAjpa"};
|
|
4889
4935
|
|
|
4890
|
-
|
|
4891
|
-
|
|
4936
|
+
var findNextActiveIndex = function findNextActiveIndex(items, startAt) {
|
|
4937
|
+
var startIndex = 0;
|
|
4938
|
+
|
|
4939
|
+
if (startAt !== null && startAt + 1 <= items.length) {
|
|
4940
|
+
startIndex = startAt + 1;
|
|
4892
4941
|
}
|
|
4893
4942
|
|
|
4894
|
-
|
|
4895
|
-
|
|
4943
|
+
var hasEnabledItems = items.slice(startIndex).some(function (item) {
|
|
4944
|
+
return !item.disabled;
|
|
4945
|
+
});
|
|
4896
4946
|
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4947
|
+
if (hasEnabledItems) {
|
|
4948
|
+
var _nextEnabledIndex = items.findIndex(function (item, index) {
|
|
4949
|
+
if (index < startIndex) {
|
|
4950
|
+
return false;
|
|
4951
|
+
}
|
|
4901
4952
|
|
|
4902
|
-
|
|
4903
|
-
|
|
4953
|
+
return !item.disabled;
|
|
4954
|
+
});
|
|
4904
4955
|
|
|
4905
|
-
|
|
4906
|
-
throw new Error('DropdownList - dropdown items should be using DropdownListDivider or DropdownListItem components');
|
|
4956
|
+
return _nextEnabledIndex;
|
|
4907
4957
|
}
|
|
4958
|
+
|
|
4959
|
+
var nextEnabledIndex = items.findIndex(function (item) {
|
|
4960
|
+
return !item.disabled;
|
|
4961
|
+
});
|
|
4962
|
+
return nextEnabledIndex >= 0 ? nextEnabledIndex : null;
|
|
4908
4963
|
};
|
|
4964
|
+
var findPreviousEnabledIndex = function findPreviousEnabledIndex(items, startAt) {
|
|
4965
|
+
for (var i = startAt - 1; i >= 0; i--) {
|
|
4966
|
+
if (!items[i].disabled) {
|
|
4967
|
+
return i;
|
|
4968
|
+
}
|
|
4969
|
+
}
|
|
4909
4970
|
|
|
4910
|
-
var
|
|
4911
|
-
|
|
4912
|
-
|
|
4971
|
+
for (var _i = items.length - 1; _i > startAt - 1; _i--) {
|
|
4972
|
+
if (!items[_i].disabled) {
|
|
4973
|
+
return _i;
|
|
4974
|
+
}
|
|
4975
|
+
}
|
|
4913
4976
|
|
|
4914
|
-
|
|
4915
|
-
|
|
4977
|
+
return null;
|
|
4978
|
+
};
|
|
4916
4979
|
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4980
|
+
var useListKeyboardNavigation = function useListKeyboardNavigation(listItems, actions) {
|
|
4981
|
+
var _useState = useState(null),
|
|
4982
|
+
focusedItem = _useState[0],
|
|
4983
|
+
setFocusedItem = _useState[1];
|
|
4984
|
+
|
|
4985
|
+
var focusOnNextItem = function focusOnNextItem(callback) {
|
|
4986
|
+
var nextFocusItem = findNextActiveIndex(listItems, focusedItem);
|
|
4987
|
+
setFocusedItem(nextFocusItem);
|
|
4988
|
+
callback(nextFocusItem);
|
|
4989
|
+
};
|
|
4990
|
+
|
|
4991
|
+
var focusOnPrevItem = function focusOnPrevItem(callback) {
|
|
4992
|
+
var prevFocusItem = findPreviousEnabledIndex(listItems, focusedItem || 0);
|
|
4993
|
+
setFocusedItem(prevFocusItem);
|
|
4994
|
+
callback(prevFocusItem);
|
|
4995
|
+
};
|
|
4996
|
+
|
|
4997
|
+
var setFocusOnItem = function setFocusOnItem(index) {
|
|
4998
|
+
if (index < 0) {
|
|
4999
|
+
setFocusedItem(null);
|
|
5000
|
+
return;
|
|
4920
5001
|
}
|
|
4921
5002
|
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
};
|
|
4926
|
-
});
|
|
5003
|
+
if (listItems[index].disabled) {
|
|
5004
|
+
return;
|
|
5005
|
+
}
|
|
4927
5006
|
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
}),
|
|
4931
|
-
focusedItem = _useListKeyboardNavig.focusedItem,
|
|
4932
|
-
setFocusOnItem = _useListKeyboardNavig.setFocusOnItem;
|
|
5007
|
+
setFocusedItem(index);
|
|
5008
|
+
};
|
|
4933
5009
|
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
var _classNames;
|
|
5010
|
+
var handleKeyPress = useCallback(function (event) {
|
|
5011
|
+
if (event.key === 'ArrowDown') {
|
|
5012
|
+
focusOnNextItem(function (focusItem) {
|
|
5013
|
+
var _actions$onNavigate;
|
|
4939
5014
|
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
onMouseEnter: function onMouseEnter() {
|
|
4944
|
-
return setFocusOnItem(index);
|
|
4945
|
-
}
|
|
4946
|
-
}, child);
|
|
4947
|
-
}));
|
|
4948
|
-
};
|
|
5015
|
+
return actions === null || actions === void 0 ? void 0 : (_actions$onNavigate = actions.onNavigate) === null || _actions$onNavigate === void 0 ? void 0 : _actions$onNavigate.call(actions, focusItem);
|
|
5016
|
+
});
|
|
5017
|
+
}
|
|
4949
5018
|
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
5019
|
+
if (event.key === 'ArrowUp') {
|
|
5020
|
+
focusOnPrevItem(function (focusItem) {
|
|
5021
|
+
var _actions$onNavigate2;
|
|
5022
|
+
|
|
5023
|
+
return actions === null || actions === void 0 ? void 0 : (_actions$onNavigate2 = actions.onNavigate) === null || _actions$onNavigate2 === void 0 ? void 0 : _actions$onNavigate2.call(actions, focusItem);
|
|
5024
|
+
});
|
|
5025
|
+
}
|
|
5026
|
+
|
|
5027
|
+
if (event.key === 'Enter' && focusedItem !== null) {
|
|
5028
|
+
var _actions$onPressEnter;
|
|
5029
|
+
|
|
5030
|
+
var onClick = listItems[focusedItem].onClick;
|
|
5031
|
+
onClick(event);
|
|
5032
|
+
actions && ((_actions$onPressEnter = actions.onPressEnter) === null || _actions$onPressEnter === void 0 ? void 0 : _actions$onPressEnter.call(actions));
|
|
5033
|
+
}
|
|
5034
|
+
|
|
5035
|
+
event.preventDefault();
|
|
5036
|
+
}, [focusedItem]);
|
|
5037
|
+
useKeyPress(['ArrowDown', 'ArrowUp', 'Enter'], handleKeyPress);
|
|
5038
|
+
return {
|
|
5039
|
+
focusedItem: focusedItem,
|
|
5040
|
+
setFocusOnItem: setFocusOnItem
|
|
5041
|
+
};
|
|
4963
5042
|
};
|
|
4964
5043
|
|
|
4965
|
-
var styles$
|
|
5044
|
+
var styles$k = {"dropdown-list-divider":"_3x1F6"};
|
|
4966
5045
|
|
|
4967
|
-
var
|
|
5046
|
+
var DropdownListDivider = function DropdownListDivider(_ref) {
|
|
5047
|
+
var testId = _ref.testId;
|
|
5048
|
+
return React__default.createElement("div", {
|
|
5049
|
+
className: styles$k['dropdown-list-divider'],
|
|
5050
|
+
"data-testid": testId
|
|
5051
|
+
});
|
|
5052
|
+
};
|
|
4968
5053
|
|
|
4969
|
-
var styles$
|
|
5054
|
+
var styles$l = {"dropdown-list-item":"_B3_I5","dropdown-list-item--selected":"_1mr1h","dropdown-list-item__content":"_2b7Fg","dropdown-list-item--disabled":"_2l0Cb"};
|
|
4970
5055
|
|
|
4971
|
-
var
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
5056
|
+
var TEXT_TYPES = {
|
|
5057
|
+
CAPTION: 'caption',
|
|
5058
|
+
BODY: 'body',
|
|
5059
|
+
H1: 'h1',
|
|
5060
|
+
H2: 'h2',
|
|
5061
|
+
H3: 'h3',
|
|
5062
|
+
H4: 'h4',
|
|
5063
|
+
H5: 'h5',
|
|
5064
|
+
INSIGHT: 'insight'
|
|
5065
|
+
};
|
|
5066
|
+
var FONT_EMPHASIS = {
|
|
5067
|
+
BOLD: 'bold',
|
|
5068
|
+
ITALIC: 'italic',
|
|
5069
|
+
UNDERLINE: 'underline',
|
|
5070
|
+
MONOSPACE: 'monospace'
|
|
5071
|
+
};
|
|
5072
|
+
var ALIGNMENTS = {
|
|
5073
|
+
LEFT: 'left',
|
|
5074
|
+
RIGHT: 'right',
|
|
5075
|
+
CENTER: 'center',
|
|
5076
|
+
JUSTIFY: 'justify'
|
|
4990
5077
|
};
|
|
4991
5078
|
|
|
4992
|
-
var
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
_ref$
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
var
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
},
|
|
5014
|
-
|
|
5015
|
-
zIndex: zIndex
|
|
5016
|
-
}
|
|
5079
|
+
var styles$m = {"text":"_3CIA3","text__body":"_1nnj8","text__caption":"_37K6o","text__insight":"_avqxy","text--bold":"_2TG6E","text--italic":"_2hlsn","text--underline":"_1Pjo6","text--monospace":"_eDdDI","text--align-left":"_2gNwS","text--align-right":"_ufv1W","text--align-center":"_2WMN6","text--align-justify":"_2iH-J"};
|
|
5080
|
+
|
|
5081
|
+
var _excluded$2g = ["children", "as", "emphasis", "alignment", "color", "testId"];
|
|
5082
|
+
|
|
5083
|
+
var Text = function Text(_ref) {
|
|
5084
|
+
var _classnames;
|
|
5085
|
+
|
|
5086
|
+
var children = _ref.children,
|
|
5087
|
+
_ref$as = _ref.as,
|
|
5088
|
+
as = _ref$as === void 0 ? TEXT_TYPES.BODY : _ref$as,
|
|
5089
|
+
emphasis = _ref.emphasis,
|
|
5090
|
+
alignment = _ref.alignment,
|
|
5091
|
+
color = _ref.color,
|
|
5092
|
+
testId = _ref.testId,
|
|
5093
|
+
positionProps = _objectWithoutPropertiesLoose(_ref, _excluded$2g);
|
|
5094
|
+
|
|
5095
|
+
var positionStyles = usePositionStyles(positionProps);
|
|
5096
|
+
var elementProps = {
|
|
5097
|
+
style: _extends({
|
|
5098
|
+
color: color
|
|
5099
|
+
}, positionStyles),
|
|
5100
|
+
className: classnames(styles$m['text'], (_classnames = {}, _classnames[styles$m['text--bold']] = emphasis === null || emphasis === void 0 ? void 0 : emphasis.includes(FONT_EMPHASIS.BOLD), _classnames[styles$m['text--italic']] = emphasis === null || emphasis === void 0 ? void 0 : emphasis.includes(FONT_EMPHASIS.ITALIC), _classnames[styles$m['text--underline']] = emphasis === null || emphasis === void 0 ? void 0 : emphasis.includes(FONT_EMPHASIS.UNDERLINE), _classnames[styles$m['text--monospace']] = emphasis === null || emphasis === void 0 ? void 0 : emphasis.includes(FONT_EMPHASIS.MONOSPACE), _classnames[styles$m['text--align-left']] = alignment === ALIGNMENTS.LEFT, _classnames[styles$m['text--align-right']] = alignment === ALIGNMENTS.RIGHT, _classnames[styles$m['text--align-center']] = alignment === ALIGNMENTS.CENTER, _classnames[styles$m['text--align-justify']] = alignment === ALIGNMENTS.JUSTIFY, _classnames[styles$m['text__body']] = as === TEXT_TYPES.BODY, _classnames[styles$m['text__insight']] = as === TEXT_TYPES.INSIGHT, _classnames[styles$m['text__caption']] = as === TEXT_TYPES.CAPTION, _classnames)),
|
|
5101
|
+
'data-testid': testId
|
|
5017
5102
|
};
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
shouldCloseOnEsc: true,
|
|
5022
|
-
shouldCloseOnOverlayClick: false,
|
|
5023
|
-
shouldReturnFocusAfterClose: shouldReturnFocusAfterClose,
|
|
5024
|
-
onRequestClose: onClose && !loading ? onClose : undefined,
|
|
5025
|
-
style: style,
|
|
5026
|
-
closeTimeoutMS: 200,
|
|
5027
|
-
contentLabel: "Modal",
|
|
5028
|
-
appElement: rootElementId && document.getElementById(rootElementId) || undefined,
|
|
5029
|
-
overlayClassName: {
|
|
5030
|
-
base: styles$i['overlay'],
|
|
5031
|
-
afterOpen: styles$i['overlay--after-open'],
|
|
5032
|
-
beforeClose: styles$i['overlay--before-close']
|
|
5033
|
-
},
|
|
5034
|
-
className: {
|
|
5035
|
-
base: styles$i['content'],
|
|
5036
|
-
afterOpen: styles$i['content--after-open'],
|
|
5037
|
-
beforeClose: styles$i['content--before-close']
|
|
5038
|
-
}
|
|
5039
|
-
}, React__default.createElement(ModalHeader, {
|
|
5040
|
-
header: header,
|
|
5041
|
-
subHeader: subHeader,
|
|
5042
|
-
onClose: onClose,
|
|
5043
|
-
loading: loading
|
|
5044
|
-
}), children);
|
|
5103
|
+
var pTypes = [TEXT_TYPES.BODY, TEXT_TYPES.CAPTION, TEXT_TYPES.INSIGHT];
|
|
5104
|
+
var element = pTypes.includes(as) ? 'p' : as;
|
|
5105
|
+
return React__default.createElement(element, elementProps, children);
|
|
5045
5106
|
};
|
|
5046
5107
|
|
|
5047
|
-
|
|
5048
|
-
|
|
5108
|
+
var Bold = function Bold(_ref) {
|
|
5109
|
+
var children = _ref.children;
|
|
5110
|
+
return React__default.createElement("span", {
|
|
5111
|
+
className: classnames(styles$m['text--bold'], styles$m['text'])
|
|
5112
|
+
}, children);
|
|
5049
5113
|
};
|
|
5050
5114
|
|
|
5051
|
-
var
|
|
5052
|
-
var
|
|
5053
|
-
|
|
5115
|
+
var Underline = function Underline(_ref) {
|
|
5116
|
+
var children = _ref.children;
|
|
5117
|
+
return React__default.createElement("span", {
|
|
5118
|
+
className: classnames(styles$m['text--underline'], styles$m['text'])
|
|
5119
|
+
}, children);
|
|
5120
|
+
};
|
|
5054
5121
|
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5122
|
+
var Italic = function Italic(_ref) {
|
|
5123
|
+
var children = _ref.children;
|
|
5124
|
+
return React__default.createElement("span", {
|
|
5125
|
+
className: classnames(styles$m['text--italic'], styles$m['text'])
|
|
5126
|
+
}, children);
|
|
5127
|
+
};
|
|
5058
5128
|
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5129
|
+
var WHITE = '#ffffff';
|
|
5130
|
+
var EGGPLANT200 = '#d3dbf4';
|
|
5131
|
+
var EGGPLANT300 = '#a7b7ea';
|
|
5132
|
+
var EGGPLANT400 = '#6d87dd';
|
|
5133
|
+
var EGGPLANT500 = '#6179c6';
|
|
5134
|
+
var EGGPLANT600 = '#415184';
|
|
5135
|
+
var RADISH400 = '#e76767';
|
|
5136
|
+
var GREY100 = '#F3F3F3';
|
|
5137
|
+
var GREY200 = '#D5D5D5';
|
|
5138
|
+
var GREY300 = '#949494';
|
|
5139
|
+
var GREY400 = '#767676';
|
|
5140
|
+
var GREY500 = '#464646';
|
|
5063
5141
|
|
|
5064
|
-
|
|
5142
|
+
var DropdownListItem = function DropdownListItem(_ref) {
|
|
5143
|
+
var _classNames;
|
|
5065
5144
|
|
|
5066
|
-
|
|
5067
|
-
|
|
5145
|
+
var onClick = _ref.onClick,
|
|
5146
|
+
prefix = _ref.prefix,
|
|
5147
|
+
suffix = _ref.suffix,
|
|
5148
|
+
caption = _ref.caption,
|
|
5149
|
+
selected = _ref.selected,
|
|
5150
|
+
disabled = _ref.disabled,
|
|
5151
|
+
testId = _ref.testId,
|
|
5152
|
+
children = _ref.children;
|
|
5153
|
+
|
|
5154
|
+
var _useDropdownContext = useDropdownContext(),
|
|
5155
|
+
onToggleDropdown = _useDropdownContext.onToggleDropdown;
|
|
5156
|
+
|
|
5157
|
+
var handleClick = function handleClick(e) {
|
|
5158
|
+
e.stopPropagation();
|
|
5159
|
+
|
|
5160
|
+
if (disabled) {
|
|
5161
|
+
return;
|
|
5068
5162
|
}
|
|
5069
|
-
}, []);
|
|
5070
|
-
return {
|
|
5071
|
-
ref: ref,
|
|
5072
|
-
showScrollShadow: showScrollShadow
|
|
5073
|
-
};
|
|
5074
|
-
};
|
|
5075
5163
|
|
|
5076
|
-
|
|
5164
|
+
onToggleDropdown();
|
|
5165
|
+
onClick(e);
|
|
5166
|
+
};
|
|
5077
5167
|
|
|
5078
|
-
var
|
|
5079
|
-
|
|
5168
|
+
var getCaptionColor = function getCaptionColor() {
|
|
5169
|
+
if (selected) {
|
|
5170
|
+
return EGGPLANT500;
|
|
5171
|
+
}
|
|
5080
5172
|
|
|
5081
|
-
|
|
5082
|
-
|
|
5173
|
+
if (disabled) {
|
|
5174
|
+
return GREY400;
|
|
5175
|
+
}
|
|
5083
5176
|
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
showScrollShadow = _useScrollShadow.showScrollShadow;
|
|
5177
|
+
return undefined;
|
|
5178
|
+
};
|
|
5087
5179
|
|
|
5088
|
-
return React__default.createElement("
|
|
5089
|
-
className: classnames(styles$
|
|
5090
|
-
|
|
5180
|
+
return React__default.createElement("li", {
|
|
5181
|
+
className: classnames(styles$l['dropdown-list-item'], (_classNames = {}, _classNames[styles$l['dropdown-list-item--selected']] = selected, _classNames[styles$l['dropdown-list-item--disabled']] = disabled, _classNames)),
|
|
5182
|
+
onClick: handleClick,
|
|
5183
|
+
onKeyPress: handleClick,
|
|
5184
|
+
role: "menuitem",
|
|
5091
5185
|
"data-testid": testId
|
|
5092
|
-
},
|
|
5186
|
+
}, prefix, React__default.createElement("div", {
|
|
5187
|
+
className: styles$l['dropdown-list-item__content']
|
|
5188
|
+
}, React__default.createElement(Stack, {
|
|
5189
|
+
space: 4,
|
|
5190
|
+
flex: [1]
|
|
5191
|
+
}, children, caption && React__default.createElement(Text, {
|
|
5192
|
+
as: "caption",
|
|
5193
|
+
color: getCaptionColor()
|
|
5194
|
+
}, caption))), suffix);
|
|
5093
5195
|
};
|
|
5094
5196
|
|
|
5095
|
-
var
|
|
5096
|
-
|
|
5097
|
-
var updateButtonProps = function updateButtonProps(button, newProps) {
|
|
5098
|
-
if (!button) {
|
|
5099
|
-
return null;
|
|
5100
|
-
}
|
|
5197
|
+
var canInteractWithItem = function canInteractWithItem(child) {
|
|
5198
|
+
var itemType = getItemType(child);
|
|
5101
5199
|
|
|
5102
|
-
if (
|
|
5103
|
-
return
|
|
5200
|
+
if (itemType === 'DropdownListDivider') {
|
|
5201
|
+
return false;
|
|
5104
5202
|
}
|
|
5105
5203
|
|
|
5106
|
-
return
|
|
5204
|
+
return !child.props.disabled || false;
|
|
5107
5205
|
};
|
|
5108
5206
|
|
|
5109
|
-
var
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5207
|
+
var getItemType = function getItemType(child) {
|
|
5208
|
+
switch (child.type) {
|
|
5209
|
+
case DropdownListDivider:
|
|
5210
|
+
return 'DropdownListDivider';
|
|
5113
5211
|
|
|
5114
|
-
|
|
5115
|
-
|
|
5212
|
+
case DropdownListItem:
|
|
5213
|
+
return 'DropdownListItem';
|
|
5116
5214
|
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
5120
|
-
});
|
|
5121
|
-
var secondaryButton = updateButtonProps(actions.secondary, {
|
|
5122
|
-
theme: (actions === null || actions === void 0 ? void 0 : (_actions$secondary = actions.secondary) === null || _actions$secondary === void 0 ? void 0 : _actions$secondary.props.theme) || 'default',
|
|
5123
|
-
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
5124
|
-
});
|
|
5125
|
-
var tertiaryButton = updateButtonProps(actions.tertiary, {
|
|
5126
|
-
theme: (actions === null || actions === void 0 ? void 0 : (_actions$tertiary = actions.tertiary) === null || _actions$tertiary === void 0 ? void 0 : _actions$tertiary.props.theme) || 'link-primary',
|
|
5127
|
-
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
5128
|
-
});
|
|
5129
|
-
return React__default.createElement(FooterContainer, {
|
|
5130
|
-
testId: testId
|
|
5131
|
-
}, React__default.createElement(Inline, {
|
|
5132
|
-
justifyContent: "space-between"
|
|
5133
|
-
}, React__default.createElement("div", {
|
|
5134
|
-
className: classnames((_classnames = {}, _classnames[styles$l['tertiary-container']] = tertiaryButton && tertiaryButton.props.theme.startsWith('link'), _classnames))
|
|
5135
|
-
}, tertiaryButton || React__default.createElement("div", null)), React__default.createElement(Inline, {
|
|
5136
|
-
space: 12
|
|
5137
|
-
}, secondaryButton, primaryButton)));
|
|
5215
|
+
default:
|
|
5216
|
+
throw new Error('DropdownList - dropdown items should be using DropdownListDivider or DropdownListItem components');
|
|
5138
5217
|
}
|
|
5139
|
-
|
|
5140
|
-
return React__default.createElement(FooterContainer, null, children);
|
|
5141
5218
|
};
|
|
5142
5219
|
|
|
5143
|
-
var
|
|
5144
|
-
var
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
}, React__default.createElement(Inline, {
|
|
5152
|
-
justifyContent: "end",
|
|
5153
|
-
space: 12,
|
|
5154
|
-
flex: hasCustomAlignment ? [1] : undefined
|
|
5155
|
-
}, children));
|
|
5220
|
+
var calculateScrollYPosition = function calculateScrollYPosition(newFocusItem, lastFocusItem, paneScrollTop, maxPaneHeight, elementYPosition) {
|
|
5221
|
+
var directionCoeff = !lastFocusItem || newFocusItem > lastFocusItem ? -1 * maxPaneHeight : 0;
|
|
5222
|
+
|
|
5223
|
+
if (elementYPosition > paneScrollTop + maxPaneHeight || elementYPosition < paneScrollTop) {
|
|
5224
|
+
return elementYPosition + directionCoeff;
|
|
5225
|
+
}
|
|
5226
|
+
|
|
5227
|
+
return null;
|
|
5156
5228
|
};
|
|
5157
5229
|
|
|
5158
|
-
var
|
|
5230
|
+
var DropdownList = function DropdownList(_ref) {
|
|
5231
|
+
var testId = _ref.testId,
|
|
5232
|
+
children = _ref.children,
|
|
5233
|
+
highlightItemIndex = _ref.highlightItemIndex;
|
|
5159
5234
|
|
|
5160
|
-
var
|
|
5235
|
+
var _useDropdownContext = useDropdownContext(),
|
|
5236
|
+
onToggleDropdown = _useDropdownContext.onToggleDropdown;
|
|
5161
5237
|
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5238
|
+
var items = React__default.Children.toArray(children).map(function (child) {
|
|
5239
|
+
if (!React__default.isValidElement(child)) {
|
|
5240
|
+
throw new Error('DropdownList - dropdown items should be using DropdownListDivider or DropdownListItem components');
|
|
5241
|
+
}
|
|
5242
|
+
|
|
5243
|
+
return {
|
|
5244
|
+
disabled: !canInteractWithItem(child),
|
|
5245
|
+
onClick: child.props.onClick
|
|
5246
|
+
};
|
|
5165
5247
|
});
|
|
5248
|
+
var listRef = useRef(null);
|
|
5166
5249
|
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5250
|
+
var scrollToItem = function scrollToItem(newFocusItem) {
|
|
5251
|
+
if (listRef.current && newFocusItem !== null && listRef.current.parentNode) {
|
|
5252
|
+
var element = listRef.current.querySelector(":nth-child(" + (newFocusItem + 1) + ")");
|
|
5253
|
+
var parentList = listRef.current.parentNode;
|
|
5254
|
+
var scrollYPosition = calculateScrollYPosition(newFocusItem, focusedItem || 0, parentList.scrollTop, 354, element.offsetTop);
|
|
5170
5255
|
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
locale: locale
|
|
5176
|
-
});
|
|
5177
|
-
}
|
|
5178
|
-
function setToMidnight(date) {
|
|
5179
|
-
return date && startOfDay(date);
|
|
5180
|
-
}
|
|
5181
|
-
function getStartOfWeek(date, weekIndex) {
|
|
5182
|
-
var d = new Date(date);
|
|
5183
|
-
var firstDay = d.getDate() - d.getDay() + weekIndex;
|
|
5184
|
-
var firstDayAdjusted = firstDay > d.getDate() ? firstDay - 7 : firstDay;
|
|
5185
|
-
return new Date(d.setDate(firstDayAdjusted));
|
|
5186
|
-
}
|
|
5187
|
-
function getEndOfWeek(date, weekIndex) {
|
|
5188
|
-
var startOfWeek = getStartOfWeek(date, weekIndex);
|
|
5189
|
-
var endDay = startOfWeek.getDate() + 6;
|
|
5190
|
-
return new Date(startOfWeek.setDate(endDay));
|
|
5191
|
-
}
|
|
5192
|
-
function createWeekRange(date, weekStart) {
|
|
5193
|
-
return {
|
|
5194
|
-
start: getStartOfWeek(date, weekStart),
|
|
5195
|
-
end: getEndOfWeek(date, weekStart)
|
|
5256
|
+
if (scrollYPosition !== null) {
|
|
5257
|
+
parentList.scrollTo(0, scrollYPosition);
|
|
5258
|
+
}
|
|
5259
|
+
}
|
|
5196
5260
|
};
|
|
5197
|
-
}
|
|
5198
|
-
var DAYS = [getLocalizedString('time.sunday'), getLocalizedString('time.monday'), getLocalizedString('time.tuesday'), getLocalizedString('time.wednesday'), getLocalizedString('time.thursday'), getLocalizedString('time.friday'), getLocalizedString('time.saturday')];
|
|
5199
|
-
var MONTH_NAMES = [getLocalizedString('time.january'), getLocalizedString('time.february'), getLocalizedString('time.march'), getLocalizedString('time.april'), getLocalizedString('time.may'), getLocalizedString('time.june'), getLocalizedString('time.july'), getLocalizedString('time.august'), getLocalizedString('time.september'), getLocalizedString('time.october'), getLocalizedString('time.november'), getLocalizedString('time.december')];
|
|
5200
5261
|
|
|
5201
|
-
var
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
}
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5262
|
+
var _useListKeyboardNavig = useListKeyboardNavigation(items, {
|
|
5263
|
+
onPressEnter: onToggleDropdown,
|
|
5264
|
+
onNavigate: scrollToItem
|
|
5265
|
+
}),
|
|
5266
|
+
focusedItem = _useListKeyboardNavig.focusedItem,
|
|
5267
|
+
setFocusOnItem = _useListKeyboardNavig.setFocusOnItem;
|
|
5268
|
+
|
|
5269
|
+
useEffect(function () {
|
|
5270
|
+
if (highlightItemIndex !== undefined) {
|
|
5271
|
+
setFocusOnItem(highlightItemIndex);
|
|
5272
|
+
|
|
5273
|
+
if (highlightItemIndex >= 0) {
|
|
5274
|
+
scrollToItem(highlightItemIndex);
|
|
5275
|
+
}
|
|
5276
|
+
}
|
|
5277
|
+
}, [highlightItemIndex]);
|
|
5278
|
+
return React__default.createElement("ul", {
|
|
5279
|
+
className: styles$j['dropdown-list'],
|
|
5280
|
+
"data-testid": testId,
|
|
5281
|
+
ref: listRef
|
|
5282
|
+
}, React__default.Children.map(children, function (child, index) {
|
|
5283
|
+
var _classNames;
|
|
5284
|
+
|
|
5285
|
+
return React__default.createElement("div", {
|
|
5286
|
+
key: index,
|
|
5287
|
+
className: classnames(styles$j['dropdown-list__item'], (_classNames = {}, _classNames[styles$j['dropdown-list__item--hover']] = focusedItem === index, _classNames)),
|
|
5288
|
+
onMouseEnter: function onMouseEnter() {
|
|
5289
|
+
return setFocusOnItem(index);
|
|
5290
|
+
}
|
|
5291
|
+
}, child);
|
|
5292
|
+
}));
|
|
5208
5293
|
};
|
|
5209
5294
|
|
|
5210
|
-
var
|
|
5211
|
-
if (!calendarDimensions) {
|
|
5212
|
-
return {
|
|
5213
|
-
left: 0,
|
|
5214
|
-
top: 0
|
|
5215
|
-
};
|
|
5216
|
-
}
|
|
5295
|
+
var styles$n = {"label":"_h724f","label--truncate":"_1VUoF"};
|
|
5217
5296
|
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
return _extends({}, horizontalPosition, verticalPosition);
|
|
5297
|
+
var isEllipsisActive = function isEllipsisActive(e) {
|
|
5298
|
+
return e.offsetWidth < e.scrollWidth;
|
|
5221
5299
|
};
|
|
5222
5300
|
|
|
5223
|
-
var
|
|
5224
|
-
var
|
|
5225
|
-
|
|
5301
|
+
var useLabelTooltip = function useLabelTooltip(labelId, tooltipContent, truncate) {
|
|
5302
|
+
var _useState = useState(false),
|
|
5303
|
+
showTooltip = _useState[0],
|
|
5304
|
+
setShowTooltip = _useState[1];
|
|
5226
5305
|
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5306
|
+
var shouldTruncate = typeof tooltipContent === 'string' && truncate;
|
|
5307
|
+
var labelElement = document.getElementById(labelId);
|
|
5308
|
+
var isHidden = labelElement && labelElement.offsetParent === null;
|
|
5309
|
+
var handleApplyTooltip = useCallback(function () {
|
|
5310
|
+
if (!shouldTruncate) {
|
|
5311
|
+
return;
|
|
5312
|
+
}
|
|
5313
|
+
|
|
5314
|
+
var labelElement = document.getElementById(labelId);
|
|
5315
|
+
|
|
5316
|
+
if (!labelElement) {
|
|
5317
|
+
return;
|
|
5318
|
+
}
|
|
5319
|
+
|
|
5320
|
+
var shouldShowTooltip = isEllipsisActive(labelElement);
|
|
5232
5321
|
|
|
5322
|
+
if (showTooltip !== shouldShowTooltip) {
|
|
5323
|
+
setShowTooltip(shouldShowTooltip);
|
|
5324
|
+
}
|
|
5325
|
+
}, [shouldTruncate, isHidden]);
|
|
5326
|
+
useEffect(function () {
|
|
5327
|
+
var onWindowResize = debounce(handleApplyTooltip, 300);
|
|
5328
|
+
window.addEventListener('resize', onWindowResize);
|
|
5329
|
+
return function () {
|
|
5330
|
+
return window.removeEventListener('resize', onWindowResize);
|
|
5331
|
+
};
|
|
5332
|
+
}, [handleApplyTooltip]);
|
|
5333
|
+
useLayoutEffect(handleApplyTooltip, [handleApplyTooltip]);
|
|
5233
5334
|
return {
|
|
5234
|
-
|
|
5335
|
+
showTooltip: showTooltip,
|
|
5336
|
+
shouldTruncate: shouldTruncate
|
|
5235
5337
|
};
|
|
5236
5338
|
};
|
|
5237
5339
|
|
|
5238
|
-
var
|
|
5239
|
-
var
|
|
5240
|
-
var calendarTopBelowTrigger = anchorPosition.bottom + PADDING;
|
|
5340
|
+
var Label = function Label(_ref) {
|
|
5341
|
+
var _classNames;
|
|
5241
5342
|
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
}
|
|
5343
|
+
var htmlFor = _ref.htmlFor,
|
|
5344
|
+
children = _ref.children,
|
|
5345
|
+
_ref$truncate = _ref.truncate,
|
|
5346
|
+
truncate = _ref$truncate === void 0 ? true : _ref$truncate;
|
|
5347
|
+
var labelId = "label-" + htmlFor;
|
|
5248
5348
|
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
} else {
|
|
5253
|
-
if (calendarTopBelowTrigger + calendarDimensions.height > window.innerHeight) {
|
|
5254
|
-
return {
|
|
5255
|
-
top: calendarTopAboveTrigger + window.scrollY
|
|
5256
|
-
};
|
|
5257
|
-
}
|
|
5349
|
+
var _useLabelTooltip = useLabelTooltip(labelId, children, truncate),
|
|
5350
|
+
showTooltip = _useLabelTooltip.showTooltip,
|
|
5351
|
+
shouldTruncate = _useLabelTooltip.shouldTruncate;
|
|
5258
5352
|
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5353
|
+
var LabelElement = React__default.createElement("label", {
|
|
5354
|
+
htmlFor: htmlFor,
|
|
5355
|
+
id: labelId,
|
|
5356
|
+
className: classnames(styles$n['label'], (_classNames = {}, _classNames[styles$n['label--truncate']] = shouldTruncate, _classNames))
|
|
5357
|
+
}, children);
|
|
5358
|
+
|
|
5359
|
+
if (showTooltip) {
|
|
5360
|
+
return React__default.createElement(Tooltip$1, {
|
|
5361
|
+
overlay: children,
|
|
5362
|
+
placement: "top"
|
|
5363
|
+
}, LabelElement);
|
|
5262
5364
|
}
|
|
5365
|
+
|
|
5366
|
+
return LabelElement;
|
|
5263
5367
|
};
|
|
5264
5368
|
|
|
5265
|
-
var
|
|
5266
|
-
var _ref$mode = _ref.mode,
|
|
5267
|
-
mode = _ref$mode === void 0 ? CALENDAR_MODE.DAY : _ref$mode,
|
|
5268
|
-
_ref$position = _ref.position,
|
|
5269
|
-
position = _ref$position === void 0 ? CALENDAR_PLACEMENT.BOTTOM : _ref$position,
|
|
5270
|
-
_ref$weekStart = _ref.weekStart,
|
|
5271
|
-
weekStart = _ref$weekStart === void 0 ? 0 : _ref$weekStart,
|
|
5272
|
-
selected = _ref.selected,
|
|
5273
|
-
onSelect = _ref.onSelect,
|
|
5274
|
-
onClickOutside = _ref.onClickOutside,
|
|
5275
|
-
disabledDays = _ref.disabledDays,
|
|
5276
|
-
anchorRef = _ref.anchorRef,
|
|
5277
|
-
testId = _ref.testId;
|
|
5369
|
+
var styles$o = {"caption":"_1DWBq"};
|
|
5278
5370
|
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5371
|
+
var Caption = function Caption(_ref) {
|
|
5372
|
+
var fieldId = _ref.fieldId,
|
|
5373
|
+
children = _ref.children;
|
|
5374
|
+
return React__default.createElement("div", {
|
|
5375
|
+
id: fieldId && fieldId + "-describer",
|
|
5376
|
+
className: styles$o['caption']
|
|
5377
|
+
}, children);
|
|
5378
|
+
};
|
|
5282
5379
|
|
|
5283
|
-
|
|
5284
|
-
var anchorNode = anchorRef.current;
|
|
5285
|
-
useOnClickOutside({
|
|
5286
|
-
current: calendarRef
|
|
5287
|
-
}, function (event) {
|
|
5288
|
-
var _anchorRef$current;
|
|
5380
|
+
var styles$p = {"error-message":"_nZ2MD"};
|
|
5289
5381
|
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
}
|
|
5382
|
+
var ErrorMessage = function ErrorMessage(_ref) {
|
|
5383
|
+
var fieldId = _ref.fieldId,
|
|
5384
|
+
children = _ref.children,
|
|
5385
|
+
testId = _ref.testId;
|
|
5386
|
+
return React__default.createElement("div", {
|
|
5387
|
+
id: fieldId && fieldId + "-error-message",
|
|
5388
|
+
className: styles$p['error-message'],
|
|
5389
|
+
"data-testid": testId
|
|
5390
|
+
}, React__default.createElement(Inline, {
|
|
5391
|
+
space: 8,
|
|
5392
|
+
alignItems: "center"
|
|
5393
|
+
}, React__default.createElement(IconTimesOctagon, {
|
|
5394
|
+
color: RADISH400,
|
|
5395
|
+
size: "medium"
|
|
5396
|
+
}), children));
|
|
5397
|
+
};
|
|
5299
5398
|
|
|
5300
|
-
|
|
5301
|
-
|
|
5399
|
+
var Field = function Field(_ref) {
|
|
5400
|
+
var id = _ref.id,
|
|
5401
|
+
label = _ref.label,
|
|
5402
|
+
caption = _ref.caption,
|
|
5403
|
+
error = _ref.error,
|
|
5404
|
+
children = _ref.children;
|
|
5405
|
+
var shouldRenderLabel = label || typeof label === 'string';
|
|
5406
|
+
return React__default.createElement(Stack, {
|
|
5407
|
+
space: 8,
|
|
5408
|
+
flexItems: true
|
|
5409
|
+
}, shouldRenderLabel && React__default.createElement(Label, {
|
|
5410
|
+
htmlFor: id
|
|
5411
|
+
}, label), children, caption && React__default.createElement(Caption, {
|
|
5412
|
+
fieldId: id
|
|
5413
|
+
}, caption), error && React__default.createElement(ErrorMessage, {
|
|
5414
|
+
fieldId: id
|
|
5415
|
+
}, error));
|
|
5416
|
+
};
|
|
5302
5417
|
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5418
|
+
var Context$1 = createContext({});
|
|
5419
|
+
var useFormContext = function useFormContext() {
|
|
5420
|
+
var context = useContext(Context$1);
|
|
5421
|
+
return context || {};
|
|
5422
|
+
};
|
|
5307
5423
|
|
|
5308
|
-
|
|
5309
|
-
|
|
5424
|
+
var useFieldId = function useFieldId(_ref) {
|
|
5425
|
+
var name = _ref.name,
|
|
5426
|
+
inputId = _ref.id;
|
|
5427
|
+
var id = useMemo(function () {
|
|
5428
|
+
return inputId ? inputId : name + "-" + Math.random();
|
|
5429
|
+
}, [inputId, name]);
|
|
5430
|
+
return id;
|
|
5431
|
+
};
|
|
5310
5432
|
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
}
|
|
5433
|
+
var getFormikState = function getFormikState(name, formik) {
|
|
5434
|
+
if (formik === undefined) {
|
|
5435
|
+
return null;
|
|
5436
|
+
}
|
|
5315
5437
|
|
|
5316
|
-
|
|
5438
|
+
var formikPath = getFormikArrayPath(name);
|
|
5439
|
+
|
|
5440
|
+
if (formikPath.length === 0) {
|
|
5317
5441
|
return null;
|
|
5318
5442
|
}
|
|
5319
5443
|
|
|
5320
|
-
var
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5444
|
+
var formikLatestLevel = formikPath.reduce(function (acc, path) {
|
|
5445
|
+
var _acc$touched, _acc$error, _acc$value;
|
|
5446
|
+
|
|
5447
|
+
return {
|
|
5448
|
+
touched: (_acc$touched = acc.touched) === null || _acc$touched === void 0 ? void 0 : _acc$touched[path],
|
|
5449
|
+
error: (_acc$error = acc.error) === null || _acc$error === void 0 ? void 0 : _acc$error[path],
|
|
5450
|
+
value: (_acc$value = acc.value) === null || _acc$value === void 0 ? void 0 : _acc$value[path]
|
|
5451
|
+
};
|
|
5452
|
+
}, {
|
|
5453
|
+
touched: formik.touched,
|
|
5454
|
+
error: formik.errors,
|
|
5455
|
+
value: formik.values
|
|
5456
|
+
});
|
|
5457
|
+
return {
|
|
5458
|
+
error: formikLatestLevel.touched ? formikLatestLevel.error : undefined,
|
|
5459
|
+
value: formikLatestLevel.value
|
|
5460
|
+
};
|
|
5461
|
+
};
|
|
5462
|
+
var getFormikArrayPath = function getFormikArrayPath(name) {
|
|
5463
|
+
return name.split(/[^a-zA-Z0-9]/).filter(Boolean);
|
|
5464
|
+
};
|
|
5465
|
+
|
|
5466
|
+
var useFieldControllers = function useFieldControllers(_ref) {
|
|
5467
|
+
var name = _ref.name,
|
|
5468
|
+
inputId = _ref.id,
|
|
5469
|
+
value = _ref.value,
|
|
5470
|
+
_onChange = _ref.onChange,
|
|
5471
|
+
_onBlur = _ref.onBlur,
|
|
5472
|
+
_onFocus = _ref.onFocus,
|
|
5473
|
+
_onKeyDown = _ref.onKeyDown,
|
|
5474
|
+
error = _ref.error,
|
|
5475
|
+
_ref$type = _ref.type,
|
|
5476
|
+
type = _ref$type === void 0 ? 'text' : _ref$type;
|
|
5477
|
+
|
|
5478
|
+
var _useFormContext = useFormContext(),
|
|
5479
|
+
formik = _useFormContext.formik;
|
|
5480
|
+
|
|
5481
|
+
var id = useFieldId({
|
|
5482
|
+
name: name,
|
|
5483
|
+
id: inputId
|
|
5484
|
+
});
|
|
5485
|
+
var controllers = {
|
|
5486
|
+
id: id,
|
|
5487
|
+
error: error,
|
|
5488
|
+
value: value,
|
|
5489
|
+
onChange: function onChange(e) {
|
|
5490
|
+
return _onChange && _onChange(e.target.value);
|
|
5328
5491
|
},
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
}
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5492
|
+
onBlur: function onBlur(e) {
|
|
5493
|
+
return _onBlur && _onBlur(e.target.value);
|
|
5494
|
+
},
|
|
5495
|
+
onFocus: function onFocus(e) {
|
|
5496
|
+
return _onFocus && _onFocus(e.target.value);
|
|
5497
|
+
},
|
|
5498
|
+
onKeyDown: function onKeyDown(e) {
|
|
5499
|
+
return _onKeyDown && _onKeyDown(e.key);
|
|
5500
|
+
}
|
|
5501
|
+
};
|
|
5502
|
+
var formikState = getFormikState(name, formik);
|
|
5340
5503
|
|
|
5341
|
-
|
|
5342
|
-
|
|
5504
|
+
if (formik && formikState) {
|
|
5505
|
+
var currencyBlur = function currencyBlur() {
|
|
5506
|
+
if (type === 'currency') {
|
|
5507
|
+
formik.setFieldValue(name, Number(value).toFixed(2));
|
|
5343
5508
|
}
|
|
5344
|
-
}
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5509
|
+
};
|
|
5510
|
+
|
|
5511
|
+
controllers = _extends({}, controllers, {
|
|
5512
|
+
error: error !== undefined ? controllers.error : formikState.error,
|
|
5513
|
+
value: value !== undefined ? controllers.value : formikState.value,
|
|
5514
|
+
onChange: _onChange ? controllers.onChange : function (e) {
|
|
5515
|
+
return formik.setFieldValue(name, e.target.value);
|
|
5516
|
+
},
|
|
5517
|
+
onBlur: _onBlur ? function (e) {
|
|
5518
|
+
_onBlur && _onBlur(e.target.value);
|
|
5519
|
+
formik.setFieldTouched(name);
|
|
5520
|
+
currencyBlur();
|
|
5521
|
+
} : function () {
|
|
5522
|
+
formik.setFieldTouched(name);
|
|
5523
|
+
currencyBlur();
|
|
5524
|
+
}
|
|
5525
|
+
});
|
|
5526
|
+
}
|
|
5527
|
+
|
|
5528
|
+
return controllers;
|
|
5356
5529
|
};
|
|
5357
5530
|
|
|
5358
|
-
var
|
|
5359
|
-
var _columns$columnIndex, _classnames, _classnames2, _classnames3;
|
|
5531
|
+
var textFieldStyles = {"text-field":"_20YOA","text-field--invalid":"_3kUSh","text-field--prefixed":"_3IU3Q","text-field--suffixed":"_QXJOD"};
|
|
5360
5532
|
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
error = _ref.error,
|
|
5364
|
-
_ref$delayOnCloseErro = _ref.delayOnCloseError,
|
|
5365
|
-
delayOnCloseError = _ref$delayOnCloseErro === void 0 ? false : _ref$delayOnCloseErro,
|
|
5366
|
-
_ref$noPadding = _ref.noPadding,
|
|
5367
|
-
noPadding = _ref$noPadding === void 0 ? false : _ref$noPadding,
|
|
5368
|
-
colSpan = _ref.colSpan;
|
|
5533
|
+
var useTextField = function useTextField(_ref) {
|
|
5534
|
+
var _classnames;
|
|
5369
5535
|
|
|
5370
|
-
var
|
|
5371
|
-
|
|
5372
|
-
|
|
5536
|
+
var autoComplete = _ref.autoComplete,
|
|
5537
|
+
autoFocus = _ref.autoFocus,
|
|
5538
|
+
defaultValue = _ref.defaultValue,
|
|
5539
|
+
disabled = _ref.disabled,
|
|
5540
|
+
error = _ref.error,
|
|
5541
|
+
id = _ref.id,
|
|
5542
|
+
maxLength = _ref.maxLength,
|
|
5543
|
+
name = _ref.name,
|
|
5544
|
+
caption = _ref.caption,
|
|
5545
|
+
label = _ref.label,
|
|
5546
|
+
onBlur = _ref.onBlur,
|
|
5547
|
+
onChange = _ref.onChange,
|
|
5548
|
+
onFocus = _ref.onFocus,
|
|
5549
|
+
onKeyDown = _ref.onKeyDown,
|
|
5550
|
+
placeholder = _ref.placeholder,
|
|
5551
|
+
value = _ref.value,
|
|
5552
|
+
ref = _ref.ref,
|
|
5553
|
+
testId = _ref.testId;
|
|
5554
|
+
var controllers = useFieldControllers({
|
|
5555
|
+
error: error,
|
|
5556
|
+
id: id,
|
|
5557
|
+
name: name,
|
|
5558
|
+
onChange: onChange,
|
|
5559
|
+
onBlur: onBlur,
|
|
5560
|
+
onFocus: onFocus,
|
|
5561
|
+
onKeyDown: onKeyDown,
|
|
5562
|
+
value: value
|
|
5563
|
+
});
|
|
5564
|
+
var hasError = !!controllers.error;
|
|
5565
|
+
var inputProps = {
|
|
5566
|
+
'aria-describedby': hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
5567
|
+
'aria-invalid': hasError,
|
|
5568
|
+
autoComplete: autoComplete,
|
|
5569
|
+
autoFocus: autoFocus,
|
|
5570
|
+
className: classnames(textFieldStyles['text-field'], (_classnames = {}, _classnames[textFieldStyles['text-field--invalid']] = hasError, _classnames)),
|
|
5571
|
+
'data-testid': testId,
|
|
5572
|
+
disabled: disabled,
|
|
5573
|
+
defaultValue: defaultValue,
|
|
5574
|
+
id: controllers.id,
|
|
5575
|
+
maxLength: maxLength,
|
|
5576
|
+
name: name,
|
|
5577
|
+
onBlur: controllers.onBlur,
|
|
5578
|
+
onChange: controllers.onChange,
|
|
5579
|
+
onFocus: controllers.onFocus,
|
|
5580
|
+
onKeyDown: controllers.onKeyDown,
|
|
5581
|
+
placeholder: placeholder,
|
|
5582
|
+
ref: ref,
|
|
5583
|
+
size: 1,
|
|
5584
|
+
type: 'text',
|
|
5585
|
+
value: controllers.value
|
|
5586
|
+
};
|
|
5587
|
+
var fieldProps = {
|
|
5588
|
+
caption: caption,
|
|
5589
|
+
error: controllers.error,
|
|
5590
|
+
label: label,
|
|
5591
|
+
id: inputProps.id,
|
|
5592
|
+
name: name
|
|
5593
|
+
};
|
|
5594
|
+
return {
|
|
5595
|
+
inputProps: inputProps,
|
|
5596
|
+
fieldProps: fieldProps
|
|
5597
|
+
};
|
|
5598
|
+
};
|
|
5373
5599
|
|
|
5374
|
-
|
|
5375
|
-
var
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5600
|
+
var TimeFieldInput = function TimeFieldInput(_ref) {
|
|
5601
|
+
var inputProps = _ref.inputProps,
|
|
5602
|
+
allOtherProps = _ref.allOtherProps;
|
|
5603
|
+
return React__default.createElement("input", Object.assign({}, inputProps, {
|
|
5604
|
+
onBlur: function onBlur(e) {
|
|
5605
|
+
e.target.value = parseTime(e.target.value, 'g:i A');
|
|
5606
|
+
inputProps.onChange(e);
|
|
5607
|
+
inputProps.onBlur(e);
|
|
5608
|
+
},
|
|
5609
|
+
onClick: allOtherProps.onClick,
|
|
5610
|
+
onMouseEnter: allOtherProps.onMouseEnter,
|
|
5611
|
+
onMouseLeave: allOtherProps.onMouseLeave,
|
|
5612
|
+
onInput: function onInput(e) {
|
|
5613
|
+
var target = e.target;
|
|
5614
|
+
allOtherProps.onInputChange(target.value);
|
|
5615
|
+
}
|
|
5383
5616
|
}));
|
|
5384
|
-
var TableCell = React__default.createElement("td", {
|
|
5385
|
-
className: classnames((_classnames2 = {}, _classnames2[styles$h['data-table-cell--invalid']] = hasError, _classnames2[styles$h['data-table-cell--no-padding']] = noPadding, _classnames2[styles$h['data-table-cell--vertical-border']] = hasVerticalBorders, _classnames2), styles$h['data-table-cell']),
|
|
5386
|
-
colSpan: colSpan,
|
|
5387
|
-
ref: ref
|
|
5388
|
-
}, React__default.createElement("div", {
|
|
5389
|
-
className: classnames(styles$h['data-table-cell__content'], (_classnames3 = {}, _classnames3[styles$h['data-table-cell__content--with-error']] = hasError, _classnames3[styles$h['data-table-cell__content--right-align']] = isRightAligned, _classnames3))
|
|
5390
|
-
}, isRightAligned && icon, children, !isRightAligned && icon));
|
|
5391
|
-
return React__default.createElement(Tooltip$1, {
|
|
5392
|
-
overlay: errorMessage,
|
|
5393
|
-
delayOnClose: delayOnCloseError,
|
|
5394
|
-
placement: "top",
|
|
5395
|
-
theme: "white"
|
|
5396
|
-
}, TableCell);
|
|
5397
5617
|
};
|
|
5398
5618
|
|
|
5399
|
-
var
|
|
5619
|
+
var _excluded$2h = ["placeholder", "autoComplete"];
|
|
5400
5620
|
|
|
5401
|
-
var
|
|
5402
|
-
var
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
},
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
}, sideActions.length > 0 && sideActions.map(function (action) {
|
|
5416
|
-
return React__default.createElement(Button$1, Object.assign({
|
|
5417
|
-
key: action.action,
|
|
5418
|
-
onClick: action.onAction,
|
|
5419
|
-
theme: typeof action.label === 'string' ? 'default' : 'link-icon'
|
|
5420
|
-
}, action.showInKebab === false ? action.buttonProps : {}), action.label);
|
|
5421
|
-
}), kebabMenuItems.length > 0 && React__default.createElement(KebabMenu, {
|
|
5422
|
-
actions: kebabMenuItems
|
|
5423
|
-
})));
|
|
5424
|
-
};
|
|
5621
|
+
var TimeFieldDropdownElement = function TimeFieldDropdownElement(_ref, ref) {
|
|
5622
|
+
var _ref$placeholder = _ref.placeholder,
|
|
5623
|
+
placeholder = _ref$placeholder === void 0 ? '9:00 AM' : _ref$placeholder,
|
|
5624
|
+
_ref$autoComplete = _ref.autoComplete,
|
|
5625
|
+
autoComplete = _ref$autoComplete === void 0 ? 'off' : _ref$autoComplete,
|
|
5626
|
+
allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2h);
|
|
5627
|
+
|
|
5628
|
+
var _useTextField = useTextField(_extends({}, allOtherProps, {
|
|
5629
|
+
placeholder: placeholder,
|
|
5630
|
+
autoComplete: autoComplete,
|
|
5631
|
+
ref: ref
|
|
5632
|
+
})),
|
|
5633
|
+
inputProps = _useTextField.inputProps,
|
|
5634
|
+
fieldProps = _useTextField.fieldProps;
|
|
5425
5635
|
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
5636
|
+
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(TimeFieldInput, {
|
|
5637
|
+
inputProps: inputProps,
|
|
5638
|
+
allOtherProps: allOtherProps
|
|
5639
|
+
}));
|
|
5430
5640
|
};
|
|
5431
5641
|
|
|
5432
|
-
var
|
|
5433
|
-
var name = _ref.name,
|
|
5434
|
-
inputId = _ref.id;
|
|
5435
|
-
var id = useMemo(function () {
|
|
5436
|
-
return inputId ? inputId : name + "-" + Math.random();
|
|
5437
|
-
}, [inputId, name]);
|
|
5438
|
-
return id;
|
|
5439
|
-
};
|
|
5642
|
+
var TimeFieldDropdownTrigger = forwardRef(TimeFieldDropdownElement);
|
|
5440
5643
|
|
|
5441
|
-
var
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5644
|
+
var Dropdown = function Dropdown(_ref) {
|
|
5645
|
+
var trigger = _ref.trigger,
|
|
5646
|
+
_ref$triggersOn = _ref.triggersOn,
|
|
5647
|
+
triggersOn = _ref$triggersOn === void 0 ? DROPDOWN_TRIGGER.CLICK : _ref$triggersOn,
|
|
5648
|
+
_ref$alignment = _ref.alignment,
|
|
5649
|
+
alignment = _ref$alignment === void 0 ? DROPDOWN_ALIGNEMNT.RIGHT : _ref$alignment,
|
|
5650
|
+
width = _ref.width,
|
|
5651
|
+
maxHeight = _ref.maxHeight,
|
|
5652
|
+
testId = _ref.testId,
|
|
5653
|
+
children = _ref.children,
|
|
5654
|
+
triggerWidth = _ref.triggerWidth;
|
|
5445
5655
|
|
|
5446
|
-
var
|
|
5656
|
+
var _useState = useState(false),
|
|
5657
|
+
isOpen = _useState[0],
|
|
5658
|
+
setIsOpen = _useState[1];
|
|
5447
5659
|
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5660
|
+
var triggerRef = useRef(null);
|
|
5661
|
+
var paneRef = useRef(null);
|
|
5662
|
+
var isFocusingOverlay = useRef(false);
|
|
5451
5663
|
|
|
5452
|
-
var
|
|
5453
|
-
|
|
5664
|
+
var handleToggleDropdown = function handleToggleDropdown() {
|
|
5665
|
+
return setIsOpen(!isOpen);
|
|
5666
|
+
};
|
|
5454
5667
|
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
value: formikLatestLevel.value
|
|
5668
|
+
var handleMouseClick = function handleMouseClick(e) {
|
|
5669
|
+
if (trigger.type === TimeFieldDropdownTrigger) {
|
|
5670
|
+
setIsOpen(true);
|
|
5671
|
+
} else {
|
|
5672
|
+
handleToggleDropdown();
|
|
5673
|
+
}
|
|
5674
|
+
|
|
5675
|
+
e.stopPropagation();
|
|
5676
|
+
|
|
5677
|
+
if ('onClick' in trigger.props) {
|
|
5678
|
+
trigger.props.onClick(e);
|
|
5679
|
+
}
|
|
5468
5680
|
};
|
|
5469
|
-
};
|
|
5470
|
-
var getFormikArrayPath = function getFormikArrayPath(name) {
|
|
5471
|
-
return name.split(/[^a-zA-Z0-9]/).filter(Boolean);
|
|
5472
|
-
};
|
|
5473
5681
|
|
|
5474
|
-
var
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
_onChange = _ref.onChange,
|
|
5479
|
-
_onBlur = _ref.onBlur,
|
|
5480
|
-
_onFocus = _ref.onFocus,
|
|
5481
|
-
_onKeyDown = _ref.onKeyDown,
|
|
5482
|
-
error = _ref.error,
|
|
5483
|
-
_ref$type = _ref.type,
|
|
5484
|
-
type = _ref$type === void 0 ? 'text' : _ref$type;
|
|
5682
|
+
var handleMouseEnter = function handleMouseEnter(e) {
|
|
5683
|
+
if (triggersOn !== 'hover') {
|
|
5684
|
+
return;
|
|
5685
|
+
}
|
|
5485
5686
|
|
|
5486
|
-
|
|
5487
|
-
formik = _useFormContext.formik;
|
|
5687
|
+
setIsOpen(true);
|
|
5488
5688
|
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
id: inputId
|
|
5492
|
-
});
|
|
5493
|
-
var controllers = {
|
|
5494
|
-
id: id,
|
|
5495
|
-
error: error,
|
|
5496
|
-
value: value,
|
|
5497
|
-
onChange: function onChange(e) {
|
|
5498
|
-
return _onChange && _onChange(e.target.value);
|
|
5499
|
-
},
|
|
5500
|
-
onBlur: function onBlur(e) {
|
|
5501
|
-
return _onBlur && _onBlur(e.target.value);
|
|
5502
|
-
},
|
|
5503
|
-
onFocus: function onFocus(e) {
|
|
5504
|
-
return _onFocus && _onFocus(e.target.value);
|
|
5505
|
-
},
|
|
5506
|
-
onKeyDown: function onKeyDown(e) {
|
|
5507
|
-
return _onKeyDown && _onKeyDown(e.key);
|
|
5689
|
+
if ('onMouseEnter' in trigger.props) {
|
|
5690
|
+
trigger.props.onMouseEnter(e);
|
|
5508
5691
|
}
|
|
5509
5692
|
};
|
|
5510
|
-
var formikState = getFormikState(name, formik);
|
|
5511
5693
|
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
if (type ===
|
|
5515
|
-
|
|
5694
|
+
var handleFocus = function handleFocus(e) {
|
|
5695
|
+
if (triggersOn !== 'hover') {
|
|
5696
|
+
if (trigger.type === TimeFieldDropdownTrigger && !isOpen) {
|
|
5697
|
+
setIsOpen(true);
|
|
5516
5698
|
}
|
|
5517
|
-
};
|
|
5518
5699
|
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
value: value !== undefined ? controllers.value : formikState.value,
|
|
5522
|
-
onChange: _onChange ? controllers.onChange : function (e) {
|
|
5523
|
-
return formik.setFieldValue(name, e.target.value);
|
|
5524
|
-
},
|
|
5525
|
-
onBlur: _onBlur ? function (e) {
|
|
5526
|
-
_onBlur && _onBlur(e.target.value);
|
|
5527
|
-
formik.setFieldTouched(name);
|
|
5528
|
-
currencyBlur();
|
|
5529
|
-
} : function () {
|
|
5530
|
-
formik.setFieldTouched(name);
|
|
5531
|
-
currencyBlur();
|
|
5700
|
+
if ('onFocus' in trigger.props) {
|
|
5701
|
+
trigger.props.onFocus(e);
|
|
5532
5702
|
}
|
|
5533
|
-
});
|
|
5534
|
-
}
|
|
5535
5703
|
|
|
5536
|
-
|
|
5537
|
-
}
|
|
5538
|
-
|
|
5539
|
-
var styles$o = {"label":"_h724f","label--truncate":"_1VUoF"};
|
|
5704
|
+
return;
|
|
5705
|
+
}
|
|
5540
5706
|
|
|
5541
|
-
|
|
5542
|
-
return e.offsetWidth < e.scrollWidth;
|
|
5543
|
-
};
|
|
5707
|
+
setIsOpen(true);
|
|
5544
5708
|
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5709
|
+
if ('onFocus' in trigger.props) {
|
|
5710
|
+
trigger.props.onFocus(e);
|
|
5711
|
+
}
|
|
5712
|
+
};
|
|
5549
5713
|
|
|
5550
|
-
var
|
|
5551
|
-
|
|
5552
|
-
var isHidden = labelElement && labelElement.offsetParent === null;
|
|
5553
|
-
var handleApplyTooltip = useCallback(function () {
|
|
5554
|
-
if (!shouldTruncate) {
|
|
5714
|
+
var handleMouseLeave = function handleMouseLeave(e) {
|
|
5715
|
+
if (triggersOn !== 'hover' || !paneRef.current) {
|
|
5555
5716
|
return;
|
|
5556
5717
|
}
|
|
5557
5718
|
|
|
5558
|
-
var
|
|
5719
|
+
var panePosition = paneRef.current.getBoundingClientRect();
|
|
5559
5720
|
|
|
5560
|
-
if (!
|
|
5561
|
-
|
|
5721
|
+
if (!isGoingTowardsPane(panePosition, e.clientY)) {
|
|
5722
|
+
setIsOpen(false);
|
|
5723
|
+
|
|
5724
|
+
if ('onMouseLeave' in trigger.props) {
|
|
5725
|
+
trigger.props.onMouseLeave && trigger.props.onMouseLeave(e);
|
|
5726
|
+
}
|
|
5562
5727
|
}
|
|
5728
|
+
};
|
|
5563
5729
|
|
|
5564
|
-
|
|
5730
|
+
var handlePaneMouseEnter = function handlePaneMouseEnter() {
|
|
5731
|
+
isFocusingOverlay.current = true;
|
|
5732
|
+
};
|
|
5565
5733
|
|
|
5566
|
-
|
|
5567
|
-
|
|
5734
|
+
var handlePaneMouseLeave = function handlePaneMouseLeave() {
|
|
5735
|
+
isFocusingOverlay.current = false;
|
|
5736
|
+
|
|
5737
|
+
if (triggersOn === 'hover') {
|
|
5738
|
+
setIsOpen(false);
|
|
5568
5739
|
}
|
|
5569
|
-
}, [shouldTruncate, isHidden]);
|
|
5570
|
-
useEffect(function () {
|
|
5571
|
-
var onWindowResize = debounce(handleApplyTooltip, 300);
|
|
5572
|
-
window.addEventListener('resize', onWindowResize);
|
|
5573
|
-
return function () {
|
|
5574
|
-
return window.removeEventListener('resize', onWindowResize);
|
|
5575
|
-
};
|
|
5576
|
-
}, [handleApplyTooltip]);
|
|
5577
|
-
useLayoutEffect(handleApplyTooltip, [handleApplyTooltip]);
|
|
5578
|
-
return {
|
|
5579
|
-
showTooltip: showTooltip,
|
|
5580
|
-
shouldTruncate: shouldTruncate
|
|
5581
5740
|
};
|
|
5582
|
-
};
|
|
5583
5741
|
|
|
5584
|
-
var
|
|
5585
|
-
|
|
5742
|
+
var handleOnBlur = function handleOnBlur() {
|
|
5743
|
+
if (!paneRef || !(paneRef !== null && paneRef !== void 0 && paneRef.current)) {
|
|
5744
|
+
return;
|
|
5745
|
+
}
|
|
5586
5746
|
|
|
5587
|
-
|
|
5588
|
-
children = _ref.children,
|
|
5589
|
-
_ref$truncate = _ref.truncate,
|
|
5590
|
-
truncate = _ref$truncate === void 0 ? true : _ref$truncate;
|
|
5591
|
-
var labelId = "label-" + htmlFor;
|
|
5747
|
+
var focusableElements = getKeyboardFocusableElements(paneRef.current);
|
|
5592
5748
|
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5749
|
+
if (focusableElements.length > 0) {
|
|
5750
|
+
window.setTimeout(function () {
|
|
5751
|
+
return focusableElements[0].focus();
|
|
5752
|
+
}, 0);
|
|
5753
|
+
} else if (!isFocusingOverlay.current) {
|
|
5754
|
+
setIsOpen(false);
|
|
5755
|
+
}
|
|
5756
|
+
};
|
|
5596
5757
|
|
|
5597
|
-
var
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
}, children);
|
|
5758
|
+
var getRef = function getRef() {
|
|
5759
|
+
if ((trigger.type === Button$1 || trigger.type === TimeFieldDropdownTrigger) && trigger.ref) {
|
|
5760
|
+
return trigger.ref;
|
|
5761
|
+
}
|
|
5602
5762
|
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
overlay: children,
|
|
5606
|
-
placement: "top"
|
|
5607
|
-
}, LabelElement);
|
|
5608
|
-
}
|
|
5763
|
+
return triggerRef;
|
|
5764
|
+
};
|
|
5609
5765
|
|
|
5610
|
-
|
|
5766
|
+
var updatedRef = getRef();
|
|
5767
|
+
var triggerProps = {
|
|
5768
|
+
onClick: handleMouseClick,
|
|
5769
|
+
onMouseEnter: handleMouseEnter,
|
|
5770
|
+
onMouseLeave: handleMouseLeave,
|
|
5771
|
+
onBlur: handleOnBlur,
|
|
5772
|
+
ref: updatedRef,
|
|
5773
|
+
style: {
|
|
5774
|
+
width: triggerWidth === 'full' ? '100%' : 'fit-content'
|
|
5775
|
+
},
|
|
5776
|
+
onFocus: handleFocus
|
|
5777
|
+
};
|
|
5778
|
+
return React__default.createElement(DropdownContext.Provider, {
|
|
5779
|
+
value: {
|
|
5780
|
+
isOpen: isOpen,
|
|
5781
|
+
onToggleDropdown: handleToggleDropdown,
|
|
5782
|
+
triggerRef: updatedRef,
|
|
5783
|
+
paneRef: paneRef
|
|
5784
|
+
}
|
|
5785
|
+
}, trigger.type === Button$1 || trigger.type === TimeFieldDropdownTrigger ? React__default.cloneElement(trigger, _extends({}, trigger.props, triggerProps)) : React__default.createElement("button", Object.assign({}, triggerProps, {
|
|
5786
|
+
className: styles$c['dropdown__trigger'],
|
|
5787
|
+
ref: updatedRef,
|
|
5788
|
+
onFocus: handleFocus
|
|
5789
|
+
}), trigger), React__default.createElement(DropdownPane, {
|
|
5790
|
+
width: width,
|
|
5791
|
+
maxHeight: maxHeight,
|
|
5792
|
+
onMouseEnter: handlePaneMouseEnter,
|
|
5793
|
+
onMouseLeave: handlePaneMouseLeave,
|
|
5794
|
+
alignment: alignment,
|
|
5795
|
+
testId: testId
|
|
5796
|
+
}, children));
|
|
5797
|
+
};
|
|
5798
|
+
|
|
5799
|
+
var KebabMenu = function KebabMenu(_ref) {
|
|
5800
|
+
var actions = _ref.actions;
|
|
5801
|
+
return React__default.createElement(Dropdown, {
|
|
5802
|
+
trigger: React__default.createElement(Button$1, {
|
|
5803
|
+
theme: "link-icon"
|
|
5804
|
+
}, React__default.createElement(IconEllipsisV, null)),
|
|
5805
|
+
alignment: "right"
|
|
5806
|
+
}, React__default.createElement(DropdownList, null, actions.map(function (action) {
|
|
5807
|
+
return React__default.createElement(DropdownListItem, {
|
|
5808
|
+
onClick: action.onAction,
|
|
5809
|
+
key: action.action
|
|
5810
|
+
}, action.label);
|
|
5811
|
+
})));
|
|
5611
5812
|
};
|
|
5612
5813
|
|
|
5613
|
-
var styles$
|
|
5814
|
+
var styles$q = {"data-table-cell":"_2Ybjx","data-table-cell--no-padding":"_5KXHH","data-table-cell--vertical-border":"_2-I0j","data-table-cell--invalid":"_D73Vx","data-table-cell__content":"_3A9-M","data-table-cell__content--right-align":"_17Km7","data-table-cell__content--with-error":"_2c6KQ","data-table-cell__error-icon":"_2hIl3","data-table-cell__error-icon--right-align":"_8Uhyd","data-table-cell__error-icon--left-align":"_3X51R"};
|
|
5614
5815
|
|
|
5615
|
-
var
|
|
5616
|
-
var
|
|
5617
|
-
children = _ref.children;
|
|
5618
|
-
return React__default.createElement("div", {
|
|
5619
|
-
id: fieldId && fieldId + "-describer",
|
|
5620
|
-
className: styles$p['caption']
|
|
5621
|
-
}, children);
|
|
5622
|
-
};
|
|
5816
|
+
var DataTableCellElement = function DataTableCellElement(_ref, ref) {
|
|
5817
|
+
var _columns$columnIndex, _classnames, _classnames2, _classnames3;
|
|
5623
5818
|
|
|
5624
|
-
var
|
|
5819
|
+
var children = _ref.children,
|
|
5820
|
+
columnIndex = _ref.columnIndex,
|
|
5821
|
+
error = _ref.error,
|
|
5822
|
+
_ref$delayOnCloseErro = _ref.delayOnCloseError,
|
|
5823
|
+
delayOnCloseError = _ref$delayOnCloseErro === void 0 ? false : _ref$delayOnCloseErro,
|
|
5824
|
+
_ref$noPadding = _ref.noPadding,
|
|
5825
|
+
noPadding = _ref$noPadding === void 0 ? false : _ref$noPadding,
|
|
5826
|
+
colSpan = _ref.colSpan;
|
|
5625
5827
|
|
|
5626
|
-
var
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
alignItems: "center"
|
|
5828
|
+
var _useDataTableContext = useDataTableContext(),
|
|
5829
|
+
columns = _useDataTableContext.columns,
|
|
5830
|
+
hasVerticalBorders = _useDataTableContext.hasVerticalBorders;
|
|
5831
|
+
|
|
5832
|
+
var column = (_columns$columnIndex = columns === null || columns === void 0 ? void 0 : columns[columnIndex]) != null ? _columns$columnIndex : null;
|
|
5833
|
+
var isRightAligned = column ? column.isRightAligned : false;
|
|
5834
|
+
var hasError = !!error;
|
|
5835
|
+
var errorMessage = error;
|
|
5836
|
+
var icon = hasError && React__default.createElement("div", {
|
|
5837
|
+
className: classnames(styles$q['data-table-cell__error-icon'], (_classnames = {}, _classnames[styles$q['data-table-cell__error-icon--right-align']] = isRightAligned, _classnames[styles$q['data-table-cell__error-icon--left-align']] = !isRightAligned, _classnames))
|
|
5637
5838
|
}, React__default.createElement(IconTimesOctagon, {
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
})
|
|
5839
|
+
size: "medium",
|
|
5840
|
+
color: RADISH400
|
|
5841
|
+
}));
|
|
5842
|
+
var TableCell = React__default.createElement("td", {
|
|
5843
|
+
className: classnames((_classnames2 = {}, _classnames2[styles$q['data-table-cell--invalid']] = hasError, _classnames2[styles$q['data-table-cell--no-padding']] = noPadding, _classnames2[styles$q['data-table-cell--vertical-border']] = hasVerticalBorders, _classnames2), styles$q['data-table-cell']),
|
|
5844
|
+
colSpan: colSpan,
|
|
5845
|
+
ref: ref
|
|
5846
|
+
}, React__default.createElement("div", {
|
|
5847
|
+
className: classnames(styles$q['data-table-cell__content'], (_classnames3 = {}, _classnames3[styles$q['data-table-cell__content--with-error']] = hasError, _classnames3[styles$q['data-table-cell__content--right-align']] = isRightAligned, _classnames3))
|
|
5848
|
+
}, isRightAligned && icon, children, !isRightAligned && icon));
|
|
5849
|
+
return React__default.createElement(Tooltip$1, {
|
|
5850
|
+
overlay: errorMessage,
|
|
5851
|
+
delayOnClose: delayOnCloseError,
|
|
5852
|
+
placement: "top",
|
|
5853
|
+
theme: "white"
|
|
5854
|
+
}, TableCell);
|
|
5641
5855
|
};
|
|
5642
5856
|
|
|
5643
|
-
var
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
}
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
},
|
|
5857
|
+
var DataTableCell = forwardRef(DataTableCellElement);
|
|
5858
|
+
|
|
5859
|
+
var DataTableRowActions = function DataTableRowActions(_ref) {
|
|
5860
|
+
var actions = _ref.actions,
|
|
5861
|
+
columnIndex = _ref.columnIndex;
|
|
5862
|
+
var kebabMenuItems = actions.filter(function (action) {
|
|
5863
|
+
return action.showInKebab === undefined || action.showInKebab;
|
|
5864
|
+
});
|
|
5865
|
+
var sideActions = actions.filter(function (action) {
|
|
5866
|
+
return action.showInKebab === false;
|
|
5867
|
+
});
|
|
5868
|
+
return React__default.createElement(DataTableCell, {
|
|
5869
|
+
columnIndex: columnIndex
|
|
5870
|
+
}, React__default.createElement("div", {
|
|
5871
|
+
className: styles$a['actions'],
|
|
5872
|
+
"data-testid": "data-table-dropdown-menu"
|
|
5873
|
+
}, sideActions.length > 0 && sideActions.map(function (action) {
|
|
5874
|
+
return React__default.createElement(Button$1, Object.assign({
|
|
5875
|
+
key: action.action,
|
|
5876
|
+
onClick: action.onAction,
|
|
5877
|
+
theme: typeof action.label === 'string' ? 'default' : 'link-icon'
|
|
5878
|
+
}, action.showInKebab === false ? action.buttonProps : {}), action.label);
|
|
5879
|
+
}), kebabMenuItems.length > 0 && React__default.createElement(KebabMenu, {
|
|
5880
|
+
actions: kebabMenuItems
|
|
5881
|
+
})));
|
|
5660
5882
|
};
|
|
5661
5883
|
|
|
5662
5884
|
var styles$r = {"affix-container":"_ybKOk","affix-container--prefixed":"_2COk3","affix-container--suffixed":"_1xXXN","prefix":"_eX5OL","suffix":"__YH01"};
|
|
@@ -5796,7 +6018,7 @@ var DataTableEditableCellElement = function DataTableEditableCellElement(_ref, r
|
|
|
5796
6018
|
|
|
5797
6019
|
var DataTableEditableCell = forwardRef(DataTableEditableCellElement);
|
|
5798
6020
|
|
|
5799
|
-
var _excluded$
|
|
6021
|
+
var _excluded$2i = ["children", "onClick", "isSelected", "actions", "hasDefaultPadding", "hasDefaultCell", "testId"];
|
|
5800
6022
|
|
|
5801
6023
|
var DataTableRowComponent = function DataTableRowComponent(_ref, ref) {
|
|
5802
6024
|
var _classnames;
|
|
@@ -5810,7 +6032,7 @@ var DataTableRowComponent = function DataTableRowComponent(_ref, ref) {
|
|
|
5810
6032
|
_ref$hasDefaultCell = _ref.hasDefaultCell,
|
|
5811
6033
|
hasDefaultCell = _ref$hasDefaultCell === void 0 ? true : _ref$hasDefaultCell,
|
|
5812
6034
|
testId = _ref.testId,
|
|
5813
|
-
nativeDivProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
6035
|
+
nativeDivProps = _objectWithoutPropertiesLoose(_ref, _excluded$2i);
|
|
5814
6036
|
|
|
5815
6037
|
var _useDataTableContext = useDataTableContext(),
|
|
5816
6038
|
showActionMenu = _useDataTableContext.showActionMenu;
|
|
@@ -6218,13 +6440,13 @@ var isReactSelectElement = function isReactSelectElement(element) {
|
|
|
6218
6440
|
|
|
6219
6441
|
var styles$w = {"custom-control":"_1cDCR"};
|
|
6220
6442
|
|
|
6221
|
-
var _excluded$
|
|
6443
|
+
var _excluded$2j = ["children"];
|
|
6222
6444
|
|
|
6223
6445
|
function CustomControl(_ref) {
|
|
6224
6446
|
var _props$getValue;
|
|
6225
6447
|
|
|
6226
6448
|
var children = _ref.children,
|
|
6227
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
6449
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2j);
|
|
6228
6450
|
|
|
6229
6451
|
var SelectedOptionPrefix = props.selectProps.componentsProps.SelectedOptionPrefix;
|
|
6230
6452
|
var selectedOption = (_props$getValue = props.getValue()) === null || _props$getValue === void 0 ? void 0 : _props$getValue[0];
|
|
@@ -6242,11 +6464,11 @@ function CustomControl(_ref) {
|
|
|
6242
6464
|
}, props)), children)) : children);
|
|
6243
6465
|
}
|
|
6244
6466
|
|
|
6245
|
-
var _excluded$
|
|
6467
|
+
var _excluded$2k = ["children"];
|
|
6246
6468
|
|
|
6247
6469
|
function CustomOption(_ref) {
|
|
6248
6470
|
var children = _ref.children,
|
|
6249
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
6471
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2k);
|
|
6250
6472
|
|
|
6251
6473
|
var UserCustomOption = props.selectProps.componentsProps.UserCustomOption;
|
|
6252
6474
|
return React__default.createElement(components.Option, Object.assign({}, props), React__default.createElement(UserCustomOption, Object.assign({}, props), children));
|
|
@@ -6399,13 +6621,11 @@ var CustomContainer = function CustomContainer(props) {
|
|
|
6399
6621
|
|
|
6400
6622
|
var styles$x = {"custom-menu-text-field":"_2-zhH","custom-menu-hr":"_3sdnK","custom-menu-div":"_2F1jP"};
|
|
6401
6623
|
|
|
6402
|
-
var
|
|
6403
|
-
|
|
6404
|
-
var _excluded$2k = ["children"];
|
|
6624
|
+
var _excluded$2l = ["children"];
|
|
6405
6625
|
|
|
6406
6626
|
function CustomMenu(_ref) {
|
|
6407
6627
|
var children = _ref.children,
|
|
6408
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
6628
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2l);
|
|
6409
6629
|
|
|
6410
6630
|
var _props$selectProps$co = props.selectProps.componentsProps,
|
|
6411
6631
|
creatableButton = _props$selectProps$co.creatableButton,
|
|
@@ -6416,6 +6636,10 @@ function CustomMenu(_ref) {
|
|
|
6416
6636
|
showFooter = _useState[0],
|
|
6417
6637
|
setShowFooter = _useState[1];
|
|
6418
6638
|
|
|
6639
|
+
var _useState2 = useState(''),
|
|
6640
|
+
inputDefaultValue = _useState2[0],
|
|
6641
|
+
setInputDefaultValue = _useState2[1];
|
|
6642
|
+
|
|
6419
6643
|
var textFieldRef = useRef(null);
|
|
6420
6644
|
var containerRef = useRef(null);
|
|
6421
6645
|
|
|
@@ -6426,7 +6650,11 @@ function CustomMenu(_ref) {
|
|
|
6426
6650
|
return React__default.createElement(Button$1, {
|
|
6427
6651
|
theme: "link-primary",
|
|
6428
6652
|
onClick: function onClick() {
|
|
6429
|
-
|
|
6653
|
+
if (props.selectProps.inputValue) {
|
|
6654
|
+
setInputDefaultValue(props.selectProps.inputValue);
|
|
6655
|
+
}
|
|
6656
|
+
|
|
6657
|
+
setShowFooter(true);
|
|
6430
6658
|
},
|
|
6431
6659
|
size: "full-width"
|
|
6432
6660
|
}, React__default.createElement(Inline, {
|
|
@@ -6448,6 +6676,8 @@ function CustomMenu(_ref) {
|
|
|
6448
6676
|
if (textFieldRef.current && textFieldRef.current.value.trim() !== '') {
|
|
6449
6677
|
onCreate(textFieldRef.current.value);
|
|
6450
6678
|
textFieldRef.current.value = '';
|
|
6679
|
+
setShowFooter(false);
|
|
6680
|
+
setInputDefaultValue('');
|
|
6451
6681
|
}
|
|
6452
6682
|
};
|
|
6453
6683
|
|
|
@@ -6467,7 +6697,7 @@ function CustomMenu(_ref) {
|
|
|
6467
6697
|
flex: [1],
|
|
6468
6698
|
flexItems: true
|
|
6469
6699
|
}, React__default.createElement("input", {
|
|
6470
|
-
className: classnames(
|
|
6700
|
+
className: classnames(textFieldStyles['text-field'], styles$x['custom-menu-text-field']),
|
|
6471
6701
|
autoCorrect: "off",
|
|
6472
6702
|
autoComplete: "off",
|
|
6473
6703
|
spellCheck: "false",
|
|
@@ -6497,7 +6727,8 @@ function CustomMenu(_ref) {
|
|
|
6497
6727
|
},
|
|
6498
6728
|
ref: textFieldRef,
|
|
6499
6729
|
"data-testid": "select-create-option-input",
|
|
6500
|
-
autoFocus: true
|
|
6730
|
+
autoFocus: true,
|
|
6731
|
+
defaultValue: inputDefaultValue
|
|
6501
6732
|
}), React__default.createElement(Button$1, {
|
|
6502
6733
|
onClick: onCreateButton,
|
|
6503
6734
|
onKeyDown: function onKeyDown(e) {
|
|
@@ -6649,9 +6880,9 @@ var ToolbarSelect = function ToolbarSelect(_ref) {
|
|
|
6649
6880
|
});
|
|
6650
6881
|
};
|
|
6651
6882
|
|
|
6652
|
-
var styles$
|
|
6883
|
+
var styles$y = {"date-filter":"_2X-yg","date-filter--wide":"_3O5Kh"};
|
|
6653
6884
|
|
|
6654
|
-
var styles$
|
|
6885
|
+
var styles$z = {"date-filter-display":"_23gnr","date-filter-display--non-interactive":"_Zv1Se","date-filter-display--wide":"_18V8V","date-filter-display__display-icon":"_2v9v_"};
|
|
6655
6886
|
|
|
6656
6887
|
var DATE_FILTER_MODE = {
|
|
6657
6888
|
DAY: 'day',
|
|
@@ -6693,12 +6924,10 @@ var DateFilterText = function DateFilterText(_ref) {
|
|
|
6693
6924
|
var weekRange = createWeekRange(selectedDate, weekStart);
|
|
6694
6925
|
return React__default.createElement(Inline, {
|
|
6695
6926
|
space: 12
|
|
6696
|
-
}, React__default.createElement("span", null, getDateString(weekRange.start, mode)), React__default.createElement(
|
|
6697
|
-
className: "date-filter__to_date_icon"
|
|
6698
|
-
}, React__default.createElement(IconArrowRight, {
|
|
6927
|
+
}, React__default.createElement("span", null, getDateString(weekRange.start, mode)), React__default.createElement(IconArrowRight, {
|
|
6699
6928
|
size: "small",
|
|
6700
6929
|
color: GREY400
|
|
6701
|
-
})
|
|
6930
|
+
}), React__default.createElement("span", null, getDateString(weekRange.end, mode)));
|
|
6702
6931
|
|
|
6703
6932
|
default:
|
|
6704
6933
|
return React__default.createElement("span", null, getDateString(selectedDate, mode));
|
|
@@ -6713,14 +6942,14 @@ var DateFilterDisplay = function DateFilterDisplay(_ref) {
|
|
|
6713
6942
|
weekStart = _ref.weekStart,
|
|
6714
6943
|
onClick = _ref.onClick;
|
|
6715
6944
|
return React__default.createElement("button", {
|
|
6716
|
-
className: classnames(styles$
|
|
6945
|
+
className: classnames(styles$z['date-filter-display'], (_classnames = {}, _classnames[styles$z['date-filter-display--wide']] = mode === DATE_FILTER_MODE.WEEK, _classnames[styles$z['date-filter-display--non-interactive']] = mode === DATE_FILTER_MODE.MONTH, _classnames)),
|
|
6717
6946
|
onClick: onClick,
|
|
6718
6947
|
tabIndex: mode === DATE_FILTER_MODE.MONTH ? -1 : undefined
|
|
6719
6948
|
}, React__default.createElement(Inline, {
|
|
6720
6949
|
space: 12,
|
|
6721
6950
|
alignItems: "center"
|
|
6722
6951
|
}, React__default.createElement("div", {
|
|
6723
|
-
className: classnames(styles$
|
|
6952
|
+
className: classnames(styles$z['date-filter-display__display-icon'])
|
|
6724
6953
|
}, React__default.createElement(IconCalendarAlt, {
|
|
6725
6954
|
size: "flexible",
|
|
6726
6955
|
color: GREY400
|
|
@@ -6731,7 +6960,7 @@ var DateFilterDisplay = function DateFilterDisplay(_ref) {
|
|
|
6731
6960
|
})));
|
|
6732
6961
|
};
|
|
6733
6962
|
|
|
6734
|
-
var styles$
|
|
6963
|
+
var styles$A = {"date-stepper":"_s8MoI","date-stepper--backward":"_34Yoi","date-stepper--forward":"_BeWpb"};
|
|
6735
6964
|
|
|
6736
6965
|
var handleDateStepper = function handleDateStepper(date, mode, stepDirection, onChange) {
|
|
6737
6966
|
var step = stepDirection === STEP_DIRECTION.FORWARD ? 1 : -1;
|
|
@@ -6766,7 +6995,7 @@ var DateFilterStepper = function DateFilterStepper(_ref) {
|
|
|
6766
6995
|
onChange = _ref.onChange,
|
|
6767
6996
|
date = _ref.date;
|
|
6768
6997
|
return React__default.createElement("button", {
|
|
6769
|
-
className: classnames(styles$
|
|
6998
|
+
className: classnames(styles$A['date-stepper'], (_classnames = {}, _classnames[styles$A['date-stepper--backward']] = stepDirection === STEP_DIRECTION.BACKWARD, _classnames[styles$A['date-stepper--forward']] = stepDirection === STEP_DIRECTION.FORWARD, _classnames)),
|
|
6770
6999
|
onClick: function onClick() {
|
|
6771
7000
|
return handleDateStepper(date, mode, stepDirection, onChange);
|
|
6772
7001
|
}
|
|
@@ -6802,7 +7031,7 @@ var DateFilter = function DateFilter(_ref) {
|
|
|
6802
7031
|
return React__default.createElement("div", {
|
|
6803
7032
|
"data-testid": testId,
|
|
6804
7033
|
ref: calendarAnchorRef,
|
|
6805
|
-
className: classnames(styles$
|
|
7034
|
+
className: classnames(styles$y['date-filter'], (_classnames = {}, _classnames[styles$y['date-filter--wide']] = mode === DATE_FILTER_MODE.WEEK, _classnames))
|
|
6806
7035
|
}, React__default.createElement(Inline, {
|
|
6807
7036
|
space: 0
|
|
6808
7037
|
}, React__default.createElement(DateFilterStepper, {
|
|
@@ -6843,7 +7072,7 @@ var DateFilter = function DateFilter(_ref) {
|
|
|
6843
7072
|
}));
|
|
6844
7073
|
};
|
|
6845
7074
|
|
|
6846
|
-
var styles$
|
|
7075
|
+
var styles$B = {"segmented-control":"_J5ph7","segmented-control__button":"_2xgv4","segmented-control__button--selected":"_1vG3O","segmented-control__divider":"_1uKNF"};
|
|
6847
7076
|
|
|
6848
7077
|
var SegmentedControl = function SegmentedControl(_ref) {
|
|
6849
7078
|
var options = _ref.options,
|
|
@@ -6860,7 +7089,7 @@ var SegmentedControl = function SegmentedControl(_ref) {
|
|
|
6860
7089
|
};
|
|
6861
7090
|
|
|
6862
7091
|
return React__default.createElement("div", {
|
|
6863
|
-
className: styles$
|
|
7092
|
+
className: styles$B['segmented-control'],
|
|
6864
7093
|
"data-testid": testId
|
|
6865
7094
|
}, options.map(function (option, i) {
|
|
6866
7095
|
var _classnames;
|
|
@@ -6871,18 +7100,18 @@ var SegmentedControl = function SegmentedControl(_ref) {
|
|
|
6871
7100
|
onClick: function onClick() {
|
|
6872
7101
|
return onChange(option);
|
|
6873
7102
|
},
|
|
6874
|
-
className: classnames(styles$
|
|
7103
|
+
className: classnames(styles$B['segmented-control__button'], (_classnames = {}, _classnames[styles$B['segmented-control__button--selected']] = isSelected(option), _classnames))
|
|
6875
7104
|
}, option), !isLastElement(i) && React__default.createElement("div", {
|
|
6876
|
-
className: classnames(styles$
|
|
7105
|
+
className: classnames(styles$B['segmented-control__divider'])
|
|
6877
7106
|
}));
|
|
6878
7107
|
}));
|
|
6879
7108
|
};
|
|
6880
7109
|
|
|
6881
|
-
var styles$
|
|
7110
|
+
var styles$C = {"form--standard-size":"_3CaV0"};
|
|
6882
7111
|
|
|
6883
|
-
var styles$
|
|
7112
|
+
var styles$D = {"card":"_29ZIp","card__body":"_3Q8NT","card__body--interactive":"_2Fah6","card--focus":"_SGno0","card__body--focus":"_1zqRN","card__body--with-kebab":"_3Hwms","card__kebab":"_TmEUS"};
|
|
6884
7113
|
|
|
6885
|
-
var _excluded$
|
|
7114
|
+
var _excluded$2m = ["children", "onClick", "isSelected", "actions", "testId"];
|
|
6886
7115
|
|
|
6887
7116
|
var Card = function Card(_ref) {
|
|
6888
7117
|
var _classnames, _classnames2;
|
|
@@ -6893,22 +7122,22 @@ var Card = function Card(_ref) {
|
|
|
6893
7122
|
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
6894
7123
|
actions = _ref.actions,
|
|
6895
7124
|
testId = _ref.testId,
|
|
6896
|
-
positionProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
7125
|
+
positionProps = _objectWithoutPropertiesLoose(_ref, _excluded$2m);
|
|
6897
7126
|
|
|
6898
7127
|
var positionStyles = usePositionStyles(positionProps);
|
|
6899
7128
|
return React__default.createElement("div", {
|
|
6900
|
-
className: classnames(styles$
|
|
7129
|
+
className: classnames(styles$D['card']),
|
|
6901
7130
|
style: positionStyles
|
|
6902
7131
|
}, onClick ? React__default.createElement("button", {
|
|
6903
|
-
className: classnames(styles$
|
|
7132
|
+
className: classnames(styles$D['card__body'], styles$D['card__body--interactive'], (_classnames = {}, _classnames[styles$D['card__body--focus']] = isSelected, _classnames[styles$D['card__body--with-kebab']] = actions, _classnames)),
|
|
6904
7133
|
"data-testid": testId,
|
|
6905
7134
|
tabIndex: 0,
|
|
6906
7135
|
onClick: onClick
|
|
6907
7136
|
}, children) : React__default.createElement("div", {
|
|
6908
|
-
className: classnames(styles$
|
|
7137
|
+
className: classnames(styles$D['card__body'], (_classnames2 = {}, _classnames2[styles$D['card__body--focus']] = isSelected, _classnames2[styles$D['card__body--with-kebab']] = actions, _classnames2)),
|
|
6909
7138
|
"data-testid": testId
|
|
6910
7139
|
}, children), actions && React__default.createElement("div", {
|
|
6911
|
-
className: classnames(styles$
|
|
7140
|
+
className: classnames(styles$D['card__kebab'])
|
|
6912
7141
|
}, React__default.createElement(KebabMenu, {
|
|
6913
7142
|
actions: actions
|
|
6914
7143
|
})));
|
|
@@ -6922,7 +7151,7 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
|
6922
7151
|
}, children);
|
|
6923
7152
|
};
|
|
6924
7153
|
|
|
6925
|
-
var styles$
|
|
7154
|
+
var styles$E = {"breadcrumb-item":"_XFvYB"};
|
|
6926
7155
|
|
|
6927
7156
|
var BreadcrumbItem = function BreadcrumbItem(_ref) {
|
|
6928
7157
|
var href = _ref.href,
|
|
@@ -6935,24 +7164,24 @@ var BreadcrumbItem = function BreadcrumbItem(_ref) {
|
|
|
6935
7164
|
}), children);
|
|
6936
7165
|
return reloadDocument ? React__default.createElement("a", {
|
|
6937
7166
|
href: href,
|
|
6938
|
-
className: styles$
|
|
7167
|
+
className: styles$E['breadcrumb-item'],
|
|
6939
7168
|
"data-testid": testId
|
|
6940
7169
|
}, content) : React__default.createElement(Link$1, {
|
|
6941
7170
|
to: href,
|
|
6942
|
-
className: styles$
|
|
7171
|
+
className: styles$E['breadcrumb-item'],
|
|
6943
7172
|
relative: "path",
|
|
6944
7173
|
reloadDocument: reloadDocument,
|
|
6945
7174
|
"data-testid": testId
|
|
6946
7175
|
}, content);
|
|
6947
7176
|
};
|
|
6948
7177
|
|
|
6949
|
-
var styles$
|
|
7178
|
+
var styles$F = {"page-breadcrumbs":"_HAJCd"};
|
|
6950
7179
|
|
|
6951
7180
|
var PageBreadcrumbs = function PageBreadcrumbs(_ref) {
|
|
6952
7181
|
var breadcrumbs = _ref.breadcrumbs;
|
|
6953
7182
|
var items = getBreadbrumbItems(breadcrumbs);
|
|
6954
7183
|
return React__default.createElement("div", {
|
|
6955
|
-
className: styles$
|
|
7184
|
+
className: styles$F['page-breadcrumbs']
|
|
6956
7185
|
}, React__default.createElement(Breadcrumbs, null, items));
|
|
6957
7186
|
};
|
|
6958
7187
|
|
|
@@ -6977,7 +7206,7 @@ var getBreadbrumbItems = function getBreadbrumbItems(breadcrumbs) {
|
|
|
6977
7206
|
}, breadcrumbs.label);
|
|
6978
7207
|
};
|
|
6979
7208
|
|
|
6980
|
-
var styles$
|
|
7209
|
+
var styles$G = {"page":"_FbhTM","page--fullwidth":"_3QyAE","page--restricted":"_17aOG"};
|
|
6981
7210
|
|
|
6982
7211
|
var PAGE_SIZES = {
|
|
6983
7212
|
FULL_WIDTH: 'fullwidth',
|
|
@@ -7000,7 +7229,7 @@ var Page = function Page(_ref) {
|
|
|
7000
7229
|
var hasHeader = title || actions;
|
|
7001
7230
|
var hasPageBlocks = hasHeader || banner || filterBar;
|
|
7002
7231
|
return React__default.createElement("div", {
|
|
7003
|
-
className: classnames(styles$
|
|
7232
|
+
className: classnames(styles$G['page'], (_classNames = {}, _classNames[styles$G['page--restricted']] = size === PAGE_SIZES.RESTRICTED, _classNames[styles$G['page--fullwidth']] = size === PAGE_SIZES.FULL_WIDTH, _classNames)),
|
|
7004
7233
|
"data-testid": testId
|
|
7005
7234
|
}, React__default.createElement(Stack, {
|
|
7006
7235
|
space: 20
|
|
@@ -7020,7 +7249,7 @@ var Page = function Page(_ref) {
|
|
|
7020
7249
|
}, title), actions), subtitle && React__default.createElement(Text, null, subtitle)), banner, filterBar)), children));
|
|
7021
7250
|
};
|
|
7022
7251
|
|
|
7023
|
-
var styles$
|
|
7252
|
+
var styles$H = {"form-section":"_7-5gD","form-section__title":"_a83vM","form-section__subtitle":"_1lKv8","form-section--no-margin":"_lZyFQ"};
|
|
7024
7253
|
|
|
7025
7254
|
var FormSection = function FormSection(_ref) {
|
|
7026
7255
|
var _classnames;
|
|
@@ -7032,14 +7261,14 @@ var FormSection = function FormSection(_ref) {
|
|
|
7032
7261
|
noMargin = _ref$noMargin === void 0 ? false : _ref$noMargin,
|
|
7033
7262
|
testId = _ref.testId;
|
|
7034
7263
|
return React__default.createElement("div", {
|
|
7035
|
-
className: classnames(styles$
|
|
7264
|
+
className: classnames(styles$H['form-section'], (_classnames = {}, _classnames[styles$H['form-section--no-margin']] = noMargin, _classnames)),
|
|
7036
7265
|
"data-testid": testId
|
|
7037
7266
|
}, React__default.createElement(Stack, null, React__default.createElement(Stack, {
|
|
7038
7267
|
space: 8
|
|
7039
7268
|
}, title && React__default.createElement("h2", {
|
|
7040
|
-
className: classnames(styles$
|
|
7269
|
+
className: classnames(styles$H['form-section__title'])
|
|
7041
7270
|
}, title), subtitle && React__default.createElement("h3", {
|
|
7042
|
-
className: classnames(styles$
|
|
7271
|
+
className: classnames(styles$H['form-section__subtitle'])
|
|
7043
7272
|
}, subtitle)), children));
|
|
7044
7273
|
};
|
|
7045
7274
|
|
|
@@ -7057,7 +7286,7 @@ var updateButtonProps$1 = function updateButtonProps(child, newProps) {
|
|
|
7057
7286
|
}, newProps, child.props));
|
|
7058
7287
|
};
|
|
7059
7288
|
|
|
7060
|
-
var styles$
|
|
7289
|
+
var styles$I = {"form-footer":"_3vVBF"};
|
|
7061
7290
|
|
|
7062
7291
|
var FormFooterActions = function FormFooterActions(_ref) {
|
|
7063
7292
|
var _actions$primary, _actions$secondary, _actions$tertiary;
|
|
@@ -7092,7 +7321,7 @@ var FormFooter = function FormFooter(_ref) {
|
|
|
7092
7321
|
});
|
|
7093
7322
|
var isInlineChildren = React__default.Children.count(children) === 1 && React__default.isValidElement(children) && children.type === Inline;
|
|
7094
7323
|
return React__default.createElement("div", {
|
|
7095
|
-
className: classnames(styles$
|
|
7324
|
+
className: classnames(styles$I['form-footer']),
|
|
7096
7325
|
"data-testid": testId
|
|
7097
7326
|
}, actions && React__default.createElement(FormFooterActions, {
|
|
7098
7327
|
actions: actions
|
|
@@ -7134,12 +7363,12 @@ var Form = function Form(_ref) {
|
|
|
7134
7363
|
}
|
|
7135
7364
|
}, React__default.createElement("form", {
|
|
7136
7365
|
onSubmit: onSubmit ? handleSubmit : formik === null || formik === void 0 ? void 0 : formik.handleSubmit,
|
|
7137
|
-
className: classnames((_classnames = {}, _classnames[styles$
|
|
7366
|
+
className: classnames((_classnames = {}, _classnames[styles$C['form--standard-size']] = !wide, _classnames)),
|
|
7138
7367
|
"data-testid": testId
|
|
7139
7368
|
}, stackContent ? React__default.createElement(Stack, null, formattedChildren) : formattedChildren));
|
|
7140
7369
|
};
|
|
7141
7370
|
|
|
7142
|
-
var styles$
|
|
7371
|
+
var styles$J = {"form-row":"_2i-Ll"};
|
|
7143
7372
|
|
|
7144
7373
|
var SIZE_25_PERCENT = '25%';
|
|
7145
7374
|
var SIZE_33_PERCENT = '33.333%';
|
|
@@ -7170,7 +7399,7 @@ var FormRow = function FormRow(_ref) {
|
|
|
7170
7399
|
space: 20,
|
|
7171
7400
|
testId: testId,
|
|
7172
7401
|
alignItems: "stretch",
|
|
7173
|
-
extraClass: styles$
|
|
7402
|
+
extraClass: styles$J['form-row']
|
|
7174
7403
|
}, children, additionalColumns.map(function (_, index) {
|
|
7175
7404
|
return React__default.createElement("span", {
|
|
7176
7405
|
key: index,
|
|
@@ -7179,7 +7408,7 @@ var FormRow = function FormRow(_ref) {
|
|
|
7179
7408
|
}));
|
|
7180
7409
|
};
|
|
7181
7410
|
|
|
7182
|
-
var styles$
|
|
7411
|
+
var styles$K = {"text-field":"_BkzdC","text-field--focus":"_Rop31","text-field--disabled":"_2x3Cm","text-field--invalid":"_3zOwV","text-field__toolbar":"_rQqnL"};
|
|
7183
7412
|
|
|
7184
7413
|
var useGrowTextAreaRef = function useGrowTextAreaRef(minHeight, maxHeight, autoGrow, forwardedRef) {
|
|
7185
7414
|
var textareaRef = useRef(null);
|
|
@@ -7255,7 +7484,7 @@ var TextAreaField = function TextAreaField(_ref) {
|
|
|
7255
7484
|
updateHeight = _useGrowTextAreaRef.updateHeight;
|
|
7256
7485
|
|
|
7257
7486
|
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement("div", {
|
|
7258
|
-
className: classnames(styles$
|
|
7487
|
+
className: classnames(styles$K['text-field'], (_classnames = {}, _classnames[styles$K['text-field--invalid']] = hasError, _classnames[styles$K['text-field--disabled']] = disabled, _classnames[styles$K['text-field--focus']] = hasFocus, _classnames)),
|
|
7259
7488
|
ref: containerRef,
|
|
7260
7489
|
onClick: function onClick(event) {
|
|
7261
7490
|
if (event.target === (containerRef === null || containerRef === void 0 ? void 0 : containerRef.current)) {
|
|
@@ -7287,7 +7516,7 @@ var TextAreaField = function TextAreaField(_ref) {
|
|
|
7287
7516
|
},
|
|
7288
7517
|
ref: textAreaRef
|
|
7289
7518
|
}), toolbar && React__default.createElement("div", {
|
|
7290
|
-
className: styles$
|
|
7519
|
+
className: styles$K['text-field__toolbar'],
|
|
7291
7520
|
id: controllers.id + "-toolbar",
|
|
7292
7521
|
ref: toolbarRef,
|
|
7293
7522
|
onClick: function onClick(event) {
|
|
@@ -7300,79 +7529,12 @@ var TextAreaField = function TextAreaField(_ref) {
|
|
|
7300
7529
|
}, toolbar)));
|
|
7301
7530
|
};
|
|
7302
7531
|
|
|
7303
|
-
var
|
|
7304
|
-
var _classnames;
|
|
7305
|
-
|
|
7306
|
-
var autoComplete = _ref.autoComplete,
|
|
7307
|
-
autoFocus = _ref.autoFocus,
|
|
7308
|
-
defaultValue = _ref.defaultValue,
|
|
7309
|
-
disabled = _ref.disabled,
|
|
7310
|
-
error = _ref.error,
|
|
7311
|
-
id = _ref.id,
|
|
7312
|
-
maxLength = _ref.maxLength,
|
|
7313
|
-
name = _ref.name,
|
|
7314
|
-
caption = _ref.caption,
|
|
7315
|
-
label = _ref.label,
|
|
7316
|
-
onBlur = _ref.onBlur,
|
|
7317
|
-
onChange = _ref.onChange,
|
|
7318
|
-
onFocus = _ref.onFocus,
|
|
7319
|
-
onKeyDown = _ref.onKeyDown,
|
|
7320
|
-
placeholder = _ref.placeholder,
|
|
7321
|
-
value = _ref.value,
|
|
7322
|
-
ref = _ref.ref,
|
|
7323
|
-
testId = _ref.testId;
|
|
7324
|
-
var controllers = useFieldControllers({
|
|
7325
|
-
error: error,
|
|
7326
|
-
id: id,
|
|
7327
|
-
name: name,
|
|
7328
|
-
onChange: onChange,
|
|
7329
|
-
onBlur: onBlur,
|
|
7330
|
-
onFocus: onFocus,
|
|
7331
|
-
onKeyDown: onKeyDown,
|
|
7332
|
-
value: value
|
|
7333
|
-
});
|
|
7334
|
-
var hasError = !!controllers.error;
|
|
7335
|
-
var inputProps = {
|
|
7336
|
-
'aria-describedby': hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
7337
|
-
'aria-invalid': hasError,
|
|
7338
|
-
autoComplete: autoComplete,
|
|
7339
|
-
autoFocus: autoFocus,
|
|
7340
|
-
className: classnames(styles$y['text-field'], (_classnames = {}, _classnames[styles$y['text-field--invalid']] = hasError, _classnames)),
|
|
7341
|
-
'data-testid': testId,
|
|
7342
|
-
disabled: disabled,
|
|
7343
|
-
defaultValue: defaultValue,
|
|
7344
|
-
id: controllers.id,
|
|
7345
|
-
maxLength: maxLength,
|
|
7346
|
-
name: name,
|
|
7347
|
-
onBlur: controllers.onBlur,
|
|
7348
|
-
onChange: controllers.onChange,
|
|
7349
|
-
onFocus: controllers.onFocus,
|
|
7350
|
-
onKeyDown: controllers.onKeyDown,
|
|
7351
|
-
placeholder: placeholder,
|
|
7352
|
-
ref: ref,
|
|
7353
|
-
size: 1,
|
|
7354
|
-
type: 'text',
|
|
7355
|
-
value: controllers.value
|
|
7356
|
-
};
|
|
7357
|
-
var fieldProps = {
|
|
7358
|
-
caption: caption,
|
|
7359
|
-
error: controllers.error,
|
|
7360
|
-
label: label,
|
|
7361
|
-
id: inputProps.id,
|
|
7362
|
-
name: name
|
|
7363
|
-
};
|
|
7364
|
-
return {
|
|
7365
|
-
inputProps: inputProps,
|
|
7366
|
-
fieldProps: fieldProps
|
|
7367
|
-
};
|
|
7368
|
-
};
|
|
7369
|
-
|
|
7370
|
-
var _excluded$2m = ["prefix", "suffix"];
|
|
7532
|
+
var _excluded$2n = ["prefix", "suffix"];
|
|
7371
7533
|
|
|
7372
7534
|
var TextFieldElement = function TextFieldElement(_ref, ref) {
|
|
7373
7535
|
var prefix = _ref.prefix,
|
|
7374
7536
|
suffix = _ref.suffix,
|
|
7375
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
7537
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2n);
|
|
7376
7538
|
|
|
7377
7539
|
var _useTextField = useTextField(_extends({}, props, {
|
|
7378
7540
|
ref: ref
|
|
@@ -7434,7 +7596,7 @@ var useCheckBoxFieldControllers = function useCheckBoxFieldControllers(_ref) {
|
|
|
7434
7596
|
return controllers;
|
|
7435
7597
|
};
|
|
7436
7598
|
|
|
7437
|
-
var styles$
|
|
7599
|
+
var styles$L = {"check-box-field":"_2sg0c","check-box-field__caption":"_2LdrP","check-box-field__custom-input":"_2mA8e"};
|
|
7438
7600
|
|
|
7439
7601
|
var CheckboxField = function CheckboxField(_ref) {
|
|
7440
7602
|
var name = _ref.name,
|
|
@@ -7464,7 +7626,7 @@ var CheckboxField = function CheckboxField(_ref) {
|
|
|
7464
7626
|
flexItems: true,
|
|
7465
7627
|
flex: ['0 0 auto']
|
|
7466
7628
|
}, React__default.createElement("div", {
|
|
7467
|
-
className: styles$
|
|
7629
|
+
className: styles$L['check-box-field']
|
|
7468
7630
|
}, React__default.createElement("input", {
|
|
7469
7631
|
name: name,
|
|
7470
7632
|
id: controllers.id,
|
|
@@ -7477,12 +7639,12 @@ var CheckboxField = function CheckboxField(_ref) {
|
|
|
7477
7639
|
onChange: controllers.onChange,
|
|
7478
7640
|
onBlur: controllers.onBlur
|
|
7479
7641
|
}), React__default.createElement("span", {
|
|
7480
|
-
className: styles$
|
|
7642
|
+
className: styles$L['check-box-field__custom-input']
|
|
7481
7643
|
})), label && React__default.createElement(Label, {
|
|
7482
7644
|
htmlFor: controllers.id,
|
|
7483
7645
|
truncate: false
|
|
7484
7646
|
}, label)), caption && React__default.createElement("div", {
|
|
7485
|
-
className: styles$
|
|
7647
|
+
className: styles$L['check-box-field__caption']
|
|
7486
7648
|
}, React__default.createElement(Caption, {
|
|
7487
7649
|
fieldId: controllers.id
|
|
7488
7650
|
}, caption)), controllers.error && React__default.createElement(ErrorMessage, {
|
|
@@ -7490,7 +7652,7 @@ var CheckboxField = function CheckboxField(_ref) {
|
|
|
7490
7652
|
}, controllers.error));
|
|
7491
7653
|
};
|
|
7492
7654
|
|
|
7493
|
-
var styles$
|
|
7655
|
+
var styles$M = {"pill-select-field":"_g6T-p","pill-select-field__custom-input":"_1i2AX"};
|
|
7494
7656
|
|
|
7495
7657
|
var useMultiSelectFieldControllers = function useMultiSelectFieldControllers(_ref) {
|
|
7496
7658
|
var name = _ref.name,
|
|
@@ -7582,7 +7744,7 @@ var PillSelectField = function PillSelectField(_ref) {
|
|
|
7582
7744
|
var itemId = controllers.id + "-" + itemIdentifier;
|
|
7583
7745
|
return React__default.createElement("div", {
|
|
7584
7746
|
key: itemIdentifier,
|
|
7585
|
-
className: styles$
|
|
7747
|
+
className: styles$M['pill-select-field']
|
|
7586
7748
|
}, React__default.createElement("input", {
|
|
7587
7749
|
name: name + "-" + itemIdentifier,
|
|
7588
7750
|
id: itemId,
|
|
@@ -7604,7 +7766,7 @@ var PillSelectField = function PillSelectField(_ref) {
|
|
|
7604
7766
|
controllers.onChange(newValue);
|
|
7605
7767
|
}
|
|
7606
7768
|
}), React__default.createElement("span", {
|
|
7607
|
-
className: styles$
|
|
7769
|
+
className: styles$M['pill-select-field__custom-input']
|
|
7608
7770
|
}, option.label));
|
|
7609
7771
|
})));
|
|
7610
7772
|
};
|
|
@@ -7652,9 +7814,9 @@ var useRadioGroupFieldContext = function useRadioGroupFieldContext() {
|
|
|
7652
7814
|
return context;
|
|
7653
7815
|
};
|
|
7654
7816
|
|
|
7655
|
-
var styles$
|
|
7817
|
+
var styles$N = {"label":"_1WGz2","label--truncate":"_mQ9Rd","radio-group-field__label":"_RXyG_"};
|
|
7656
7818
|
|
|
7657
|
-
var styles$
|
|
7819
|
+
var styles$O = {"label":"_1Tw96","label--truncate":"_1o8rK","radio-group-box-option":"_2OGKE","radio-group-box-option__box":"_23M9k","radio-group-box-option__label":"_1r-Wg"};
|
|
7658
7820
|
|
|
7659
7821
|
var RadioGroupBoxOption = function RadioGroupBoxOption(_ref) {
|
|
7660
7822
|
var value = _ref.value,
|
|
@@ -7669,7 +7831,7 @@ var RadioGroupBoxOption = function RadioGroupBoxOption(_ref) {
|
|
|
7669
7831
|
id: inputId
|
|
7670
7832
|
});
|
|
7671
7833
|
return React__default.createElement("label", {
|
|
7672
|
-
className: styles$
|
|
7834
|
+
className: styles$O['radio-group-box-option']
|
|
7673
7835
|
}, React__default.createElement("input", {
|
|
7674
7836
|
type: "radio",
|
|
7675
7837
|
"data-testid": testId,
|
|
@@ -7680,7 +7842,7 @@ var RadioGroupBoxOption = function RadioGroupBoxOption(_ref) {
|
|
|
7680
7842
|
checked: radioGroupContext.value !== undefined ? radioGroupContext.value === value : undefined,
|
|
7681
7843
|
disabled: radioGroupContext.disabled
|
|
7682
7844
|
}), React__default.createElement("div", {
|
|
7683
|
-
className: styles$
|
|
7845
|
+
className: styles$O['radio-group-box-option__box']
|
|
7684
7846
|
}, React__default.createElement(Stack, {
|
|
7685
7847
|
space: 16,
|
|
7686
7848
|
alignItems: "center",
|
|
@@ -7689,13 +7851,13 @@ var RadioGroupBoxOption = function RadioGroupBoxOption(_ref) {
|
|
|
7689
7851
|
space: 8,
|
|
7690
7852
|
alignItems: "center"
|
|
7691
7853
|
}, label && React__default.createElement("div", {
|
|
7692
|
-
className: styles$
|
|
7854
|
+
className: styles$O['radio-group-box-option__label']
|
|
7693
7855
|
}, label), caption && React__default.createElement(Caption, {
|
|
7694
7856
|
fieldId: id
|
|
7695
7857
|
}, caption)))));
|
|
7696
7858
|
};
|
|
7697
7859
|
|
|
7698
|
-
var styles$
|
|
7860
|
+
var styles$P = {"radio-group-option":"_1Clmp","radio-group-option__caption":"_3UmWA","radio-group-option__custom-input":"_1tMq-"};
|
|
7699
7861
|
|
|
7700
7862
|
var RadioGroupOption = function RadioGroupOption(_ref) {
|
|
7701
7863
|
var value = _ref.value,
|
|
@@ -7714,7 +7876,7 @@ var RadioGroupOption = function RadioGroupOption(_ref) {
|
|
|
7714
7876
|
space: 8,
|
|
7715
7877
|
alignItems: "center"
|
|
7716
7878
|
}, React__default.createElement("div", {
|
|
7717
|
-
className: styles$
|
|
7879
|
+
className: styles$P['radio-group-option']
|
|
7718
7880
|
}, React__default.createElement("input", {
|
|
7719
7881
|
type: "radio",
|
|
7720
7882
|
"data-testid": testId,
|
|
@@ -7725,11 +7887,11 @@ var RadioGroupOption = function RadioGroupOption(_ref) {
|
|
|
7725
7887
|
checked: radioGroupContext.value !== undefined ? radioGroupContext.value === value : undefined,
|
|
7726
7888
|
disabled: radioGroupContext.disabled
|
|
7727
7889
|
}), React__default.createElement("span", {
|
|
7728
|
-
className: styles$
|
|
7890
|
+
className: styles$P['radio-group-option__custom-input']
|
|
7729
7891
|
})), label && React__default.createElement(Label, {
|
|
7730
7892
|
htmlFor: id
|
|
7731
7893
|
}, label)), caption && React__default.createElement("div", {
|
|
7732
|
-
className: styles$
|
|
7894
|
+
className: styles$P['radio-group-option__caption']
|
|
7733
7895
|
}, React__default.createElement(Caption, {
|
|
7734
7896
|
fieldId: id
|
|
7735
7897
|
}, caption)));
|
|
@@ -7864,7 +8026,7 @@ var RadioGroupField = function RadioGroupField(_ref) {
|
|
|
7864
8026
|
}, React__default.createElement(Stack, {
|
|
7865
8027
|
space: 12
|
|
7866
8028
|
}, label && React__default.createElement("div", {
|
|
7867
|
-
className: styles$
|
|
8029
|
+
className: styles$N['radio-group-field__label']
|
|
7868
8030
|
}, label), React__default.createElement(Stack, {
|
|
7869
8031
|
space: 8
|
|
7870
8032
|
}, optionsType === OPTION_TYPES.RADIO ? React__default.createElement(RadioOptions, {
|
|
@@ -7877,9 +8039,9 @@ var RadioGroupField = function RadioGroupField(_ref) {
|
|
|
7877
8039
|
}, children), controllers.error && React__default.createElement(ErrorMessage, null, controllers.error))));
|
|
7878
8040
|
};
|
|
7879
8041
|
|
|
7880
|
-
var styles$
|
|
8042
|
+
var styles$Q = {"text-field":"_18Rzv","text-field--invalid":"_3eD7t","text-field--prefixed":"_2evrG","text-field--suffixed":"_-MgeO","password-container":"_-Rf3c","password-toggle":"_yinPY"};
|
|
7881
8043
|
|
|
7882
|
-
var styles$
|
|
8044
|
+
var styles$R = {"password-criteria":"_U0krC","password-criteria--invalid":"_2XIl4"};
|
|
7883
8045
|
|
|
7884
8046
|
var PasswordCriteria = function PasswordCriteria(_ref) {
|
|
7885
8047
|
var _classnames;
|
|
@@ -7887,7 +8049,7 @@ var PasswordCriteria = function PasswordCriteria(_ref) {
|
|
|
7887
8049
|
var met = _ref.met,
|
|
7888
8050
|
children = _ref.children;
|
|
7889
8051
|
return React__default.createElement("span", {
|
|
7890
|
-
className: classnames(styles$
|
|
8052
|
+
className: classnames(styles$R['password-criteria'], (_classnames = {}, _classnames[styles$R['password-criteria--invalid']] = !met, _classnames))
|
|
7891
8053
|
}, React__default.createElement(Inline, {
|
|
7892
8054
|
space: met ? 4 : 8
|
|
7893
8055
|
}, met ? React__default.createElement(IconCheck, {
|
|
@@ -7972,11 +8134,11 @@ var PasswordField = function PasswordField(_ref) {
|
|
|
7972
8134
|
error: controllers.error
|
|
7973
8135
|
};
|
|
7974
8136
|
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement("div", {
|
|
7975
|
-
className: styles$
|
|
8137
|
+
className: styles$Q['password-container']
|
|
7976
8138
|
}, React__default.createElement("input", {
|
|
7977
8139
|
name: name,
|
|
7978
8140
|
id: controllers.id,
|
|
7979
|
-
className: classnames(styles$
|
|
8141
|
+
className: classnames(styles$Q['text-field'], (_classnames = {}, _classnames[styles$Q['text-field--invalid']] = hasError, _classnames)),
|
|
7980
8142
|
type: type,
|
|
7981
8143
|
"data-testid": testId,
|
|
7982
8144
|
"aria-describedby": hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
@@ -7988,7 +8150,7 @@ var PasswordField = function PasswordField(_ref) {
|
|
|
7988
8150
|
onChange: controllers.onChange,
|
|
7989
8151
|
onBlur: controllers.onBlur
|
|
7990
8152
|
}), React__default.createElement("div", {
|
|
7991
|
-
className: styles$
|
|
8153
|
+
className: styles$Q['password-toggle'],
|
|
7992
8154
|
onClick: toggleType,
|
|
7993
8155
|
onKeyPress: toggleType,
|
|
7994
8156
|
"data-testid": testId && testId + "-toggle",
|
|
@@ -8079,15 +8241,15 @@ var MultiSelectField = function MultiSelectField(_ref) {
|
|
|
8079
8241
|
}));
|
|
8080
8242
|
};
|
|
8081
8243
|
|
|
8082
|
-
var styles$
|
|
8244
|
+
var styles$S = {"custom-list":"_uC4zU"};
|
|
8083
8245
|
|
|
8084
|
-
var _excluded$
|
|
8246
|
+
var _excluded$2o = ["children", "hasMoreOptions", "hasMoreOptionsFirstLoad"];
|
|
8085
8247
|
|
|
8086
8248
|
var CustomList = function CustomList(_ref) {
|
|
8087
8249
|
var children = _ref.children,
|
|
8088
8250
|
hasMoreOptions = _ref.hasMoreOptions,
|
|
8089
8251
|
hasMoreOptionsFirstLoad = _ref.hasMoreOptionsFirstLoad,
|
|
8090
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
8252
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2o);
|
|
8091
8253
|
|
|
8092
8254
|
var showFooter = hasMoreOptions;
|
|
8093
8255
|
|
|
@@ -8098,15 +8260,15 @@ var CustomList = function CustomList(_ref) {
|
|
|
8098
8260
|
return React__default.createElement(components.MenuList, Object.assign({}, props), React__default.createElement(Fragment, null, children, showFooter && React__default.createElement(Inline, {
|
|
8099
8261
|
justifyContent: "center"
|
|
8100
8262
|
}, React__default.createElement("div", {
|
|
8101
|
-
className: styles$
|
|
8263
|
+
className: styles$S['custom-list']
|
|
8102
8264
|
}, getLocalizedString('main.START_TYPING_TO_SEE_MORE_OPTIONS')))));
|
|
8103
8265
|
};
|
|
8104
8266
|
|
|
8105
|
-
var _excluded$
|
|
8267
|
+
var _excluded$2p = ["loadOptions"];
|
|
8106
8268
|
|
|
8107
8269
|
var AsyncSelectField = function AsyncSelectField(_ref) {
|
|
8108
8270
|
var loadOptions = _ref.loadOptions,
|
|
8109
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
8271
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2p);
|
|
8110
8272
|
|
|
8111
8273
|
var _useState = useState(false),
|
|
8112
8274
|
hasMoreOptions = _useState[0],
|
|
@@ -8327,7 +8489,7 @@ var DateField = function DateField(_ref) {
|
|
|
8327
8489
|
error: controllers.error
|
|
8328
8490
|
};
|
|
8329
8491
|
var dayPickerProps = {
|
|
8330
|
-
classNames: styles$
|
|
8492
|
+
classNames: styles$h,
|
|
8331
8493
|
disabledDays: function disabledDays(day) {
|
|
8332
8494
|
return _disabledDays && _disabledDays(setToMidnight(day));
|
|
8333
8495
|
},
|
|
@@ -8345,7 +8507,7 @@ var DateField = function DateField(_ref) {
|
|
|
8345
8507
|
})
|
|
8346
8508
|
}, React__default.createElement(DayPickerInput, {
|
|
8347
8509
|
format: format,
|
|
8348
|
-
classNames: styles$
|
|
8510
|
+
classNames: styles$h,
|
|
8349
8511
|
formatDate: formatDate,
|
|
8350
8512
|
parseDate: parseDate,
|
|
8351
8513
|
placeholder: placeholder || format.toUpperCase(),
|
|
@@ -8454,7 +8616,7 @@ var getFormikError = function getFormikError(error) {
|
|
|
8454
8616
|
return undefined;
|
|
8455
8617
|
};
|
|
8456
8618
|
|
|
8457
|
-
var styles$
|
|
8619
|
+
var styles$T = {"container":"_1Ini2","wrapper":"_21VnL","interactionDisabled":"_wJ6Cb","DayPicker-Day":"_1c48y","navBar":"_3KwsN","todayButton":"_10CBO","navButtonInteractionDisabled":"_dHL-D","navButtonPrev":"_6kNi3","navButtonNext":"_13W_e","months":"_1FeSY","month":"_wU6A4","caption":"_AMbAo","weekdays":"_1LEst","weekdaysRow":"_2XECo","weekday":"_1C5ry","body":"_11F-Y","week":"_3MAFk","day":"_mG73F","disabled":"_2pgnH","selected":"_MtLaz","outside":"_CRqyX","footer":"_2KG9-","today":"_2JA2y","overlayWrapper":"_1JWbc","overlay":"_2tL6g","weekNumber":"_3u72O","text-field":"_25rf7","date-range-field":"_3qVhi","text-field--invalid":"_2M9Ud","text-field--prefixed":"_3TUb2","text-field--suffixed":"_foqL0","date-range-field--invalid":"_3df9R","date-range-field--disabled":"_2Nkht"};
|
|
8458
8620
|
|
|
8459
8621
|
var FromDate = function FromDate(_ref) {
|
|
8460
8622
|
var name = _ref.name,
|
|
@@ -8493,7 +8655,7 @@ var FromDate = function FromDate(_ref) {
|
|
|
8493
8655
|
}
|
|
8494
8656
|
|
|
8495
8657
|
var dayPickerProps = {
|
|
8496
|
-
classNames: styles$
|
|
8658
|
+
classNames: styles$T,
|
|
8497
8659
|
months: MONTH_NAMES,
|
|
8498
8660
|
weekdaysLong: DAYS,
|
|
8499
8661
|
weekdaysShort: DAYS.map(function (day) {
|
|
@@ -8520,7 +8682,7 @@ var FromDate = function FromDate(_ref) {
|
|
|
8520
8682
|
};
|
|
8521
8683
|
return React__default.createElement(DayPickerInput, {
|
|
8522
8684
|
format: format,
|
|
8523
|
-
classNames: styles$
|
|
8685
|
+
classNames: styles$T,
|
|
8524
8686
|
selectedDay: start,
|
|
8525
8687
|
value: start,
|
|
8526
8688
|
formatDate: formatDate,
|
|
@@ -8594,7 +8756,7 @@ var ToDate = function ToDate(_ref, ref) {
|
|
|
8594
8756
|
}
|
|
8595
8757
|
|
|
8596
8758
|
var dayPickerProps = {
|
|
8597
|
-
classNames: styles$
|
|
8759
|
+
classNames: styles$T,
|
|
8598
8760
|
months: MONTH_NAMES,
|
|
8599
8761
|
weekdaysLong: DAYS,
|
|
8600
8762
|
weekdaysShort: DAYS.map(function (day) {
|
|
@@ -8613,7 +8775,7 @@ var ToDate = function ToDate(_ref, ref) {
|
|
|
8613
8775
|
};
|
|
8614
8776
|
return React__default.createElement(DayPickerInput, {
|
|
8615
8777
|
format: format,
|
|
8616
|
-
classNames: styles$
|
|
8778
|
+
classNames: styles$T,
|
|
8617
8779
|
selectedDay: end,
|
|
8618
8780
|
value: end,
|
|
8619
8781
|
formatDate: formatDate,
|
|
@@ -8698,7 +8860,7 @@ var DateRangeField = function DateRangeField(_ref) {
|
|
|
8698
8860
|
start = _controllers$value.start,
|
|
8699
8861
|
end = _controllers$value.end;
|
|
8700
8862
|
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement("div", {
|
|
8701
|
-
className: classnames(styles$
|
|
8863
|
+
className: classnames(styles$T['date-range-field'], (_classnames = {}, _classnames[styles$T['date-range-field--invalid']] = hasError, _classnames[styles$T['date-range-field--disabled']] = disabled, _classnames)),
|
|
8702
8864
|
"data-testid": testId
|
|
8703
8865
|
}, React__default.createElement(IconCalendarAlt, {
|
|
8704
8866
|
size: "medium",
|
|
@@ -8825,7 +8987,7 @@ var WeekField = function WeekField(_ref) {
|
|
|
8825
8987
|
};
|
|
8826
8988
|
|
|
8827
8989
|
var dayPickerProps = {
|
|
8828
|
-
classNames: styles$
|
|
8990
|
+
classNames: styles$i,
|
|
8829
8991
|
disabledDays: function disabledDays(day) {
|
|
8830
8992
|
return _disabledDays && _disabledDays(setToMidnight(day));
|
|
8831
8993
|
},
|
|
@@ -8855,7 +9017,7 @@ var WeekField = function WeekField(_ref) {
|
|
|
8855
9017
|
})
|
|
8856
9018
|
}, React__default.createElement(DayPickerInput, {
|
|
8857
9019
|
format: format,
|
|
8858
|
-
classNames: styles$
|
|
9020
|
+
classNames: styles$i,
|
|
8859
9021
|
formatDate: formatDate,
|
|
8860
9022
|
parseDate: parseDate,
|
|
8861
9023
|
placeholder: placeholder || format.toUpperCase(),
|
|
@@ -8894,42 +9056,149 @@ var WeekField = function WeekField(_ref) {
|
|
|
8894
9056
|
})));
|
|
8895
9057
|
};
|
|
8896
9058
|
|
|
8897
|
-
var
|
|
9059
|
+
var getTimeOptions = function getTimeOptions(interval, startTime) {
|
|
9060
|
+
if (startTime === void 0) {
|
|
9061
|
+
startTime = new Date('Janurary 1 2023 00:00:00');
|
|
9062
|
+
}
|
|
8898
9063
|
|
|
8899
|
-
var
|
|
8900
|
-
var
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
autoComplete = _ref$autoComplete === void 0 ? 'off' : _ref$autoComplete,
|
|
8904
|
-
allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2p);
|
|
9064
|
+
var optionsCount = 60 * 24 / interval;
|
|
9065
|
+
var timeOptions = [];
|
|
9066
|
+
var intervalCoeffecient = 1000 * 60 * interval;
|
|
9067
|
+
var rounded = new Date(Math.ceil(startTime.getTime() / intervalCoeffecient) * intervalCoeffecient);
|
|
8905
9068
|
|
|
8906
|
-
var
|
|
8907
|
-
|
|
8908
|
-
|
|
8909
|
-
|
|
8910
|
-
|
|
8911
|
-
|
|
8912
|
-
|
|
9069
|
+
var formatHours = function formatHours(hours) {
|
|
9070
|
+
if (hours === 0) {
|
|
9071
|
+
return 12;
|
|
9072
|
+
} else if (hours > 12) {
|
|
9073
|
+
return hours - 12;
|
|
9074
|
+
} else {
|
|
9075
|
+
return hours;
|
|
9076
|
+
}
|
|
9077
|
+
};
|
|
8913
9078
|
|
|
8914
|
-
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8918
|
-
|
|
9079
|
+
for (var i = 0; i < optionsCount; i++) {
|
|
9080
|
+
var newDate = new Date(rounded.getTime());
|
|
9081
|
+
newDate.setMinutes(rounded.getMinutes() + interval * i);
|
|
9082
|
+
var minutes = newDate.getMinutes();
|
|
9083
|
+
timeOptions.push(formatHours(newDate.getHours()) + ":" + (minutes === 0 ? '00' : minutes) + " " + (newDate.getHours() < 12 ? 'AM' : 'PM'));
|
|
9084
|
+
}
|
|
9085
|
+
|
|
9086
|
+
return timeOptions;
|
|
9087
|
+
};
|
|
9088
|
+
|
|
9089
|
+
var TimeFieldDropdown = function TimeFieldDropdown(_ref) {
|
|
9090
|
+
var trigger = _ref.trigger,
|
|
9091
|
+
interval = _ref.interval,
|
|
9092
|
+
startTime = _ref.startTime,
|
|
9093
|
+
onOptionClick = _ref.onOptionClick,
|
|
9094
|
+
inputValue = _ref.inputValue,
|
|
9095
|
+
width = _ref.width;
|
|
9096
|
+
var startTimeParsed;
|
|
9097
|
+
|
|
9098
|
+
if (startTime) {
|
|
9099
|
+
startTimeParsed = startTime === 'now' ? new Date() : new Date('Janurary 1 2023 ' + parseTime(startTime, 'g:i A'));
|
|
9100
|
+
}
|
|
9101
|
+
|
|
9102
|
+
var timeOptions = useMemo(function () {
|
|
9103
|
+
return getTimeOptions(interval, startTimeParsed);
|
|
9104
|
+
}, [interval, startTime]);
|
|
9105
|
+
|
|
9106
|
+
var _useState = useState(undefined),
|
|
9107
|
+
index = _useState[0],
|
|
9108
|
+
setIndex = _useState[1];
|
|
9109
|
+
|
|
9110
|
+
useEffect(function () {
|
|
9111
|
+
if (inputValue) {
|
|
9112
|
+
setIndex(timeOptions.findIndex(function (option) {
|
|
9113
|
+
return option.toLowerCase().startsWith(inputValue.toLowerCase());
|
|
9114
|
+
}));
|
|
8919
9115
|
}
|
|
9116
|
+
}, [inputValue]);
|
|
9117
|
+
return React__default.createElement(Dropdown, {
|
|
9118
|
+
triggerWidth: "full",
|
|
9119
|
+
trigger: trigger,
|
|
9120
|
+
alignment: "left",
|
|
9121
|
+
width: width,
|
|
9122
|
+
maxHeight: 397
|
|
9123
|
+
}, React__default.createElement(DropdownList, {
|
|
9124
|
+
highlightItemIndex: index
|
|
9125
|
+
}, timeOptions.map(function (option) {
|
|
9126
|
+
return React__default.createElement(DropdownListItem, {
|
|
9127
|
+
key: option,
|
|
9128
|
+
onClick: function onClick() {
|
|
9129
|
+
onOptionClick(option);
|
|
9130
|
+
}
|
|
9131
|
+
}, option);
|
|
8920
9132
|
})));
|
|
8921
9133
|
};
|
|
8922
9134
|
|
|
9135
|
+
var _excluded$2q = ["interval", "startTime"];
|
|
9136
|
+
|
|
9137
|
+
var TimeFieldElement = function TimeFieldElement(_ref, forwardedRef) {
|
|
9138
|
+
var _ref$interval = _ref.interval,
|
|
9139
|
+
interval = _ref$interval === void 0 ? 15 : _ref$interval,
|
|
9140
|
+
startTime = _ref.startTime,
|
|
9141
|
+
allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2q);
|
|
9142
|
+
|
|
9143
|
+
var internalRef = useRef(null);
|
|
9144
|
+
var ref = forwardedRef || internalRef;
|
|
9145
|
+
|
|
9146
|
+
var _useState = useState(allOtherProps.defaultValue),
|
|
9147
|
+
inputValue = _useState[0],
|
|
9148
|
+
setInputValue = _useState[1];
|
|
9149
|
+
|
|
9150
|
+
var onOptionClick = function onOptionClick(option) {
|
|
9151
|
+
setInputValue(option);
|
|
9152
|
+
allOtherProps.onChange && allOtherProps.onChange(option);
|
|
9153
|
+
ref.current.value = option;
|
|
9154
|
+
ref.current.focus();
|
|
9155
|
+
ref.current.select();
|
|
9156
|
+
};
|
|
9157
|
+
|
|
9158
|
+
var _useState2 = useState(),
|
|
9159
|
+
width = _useState2[0],
|
|
9160
|
+
setWidth = _useState2[1];
|
|
9161
|
+
|
|
9162
|
+
useEffect(function () {
|
|
9163
|
+
updateDropdownWidth();
|
|
9164
|
+
window.addEventListener('resize', updateDropdownWidth);
|
|
9165
|
+
return function () {
|
|
9166
|
+
window.removeEventListener('resize', updateDropdownWidth);
|
|
9167
|
+
};
|
|
9168
|
+
}, []);
|
|
9169
|
+
|
|
9170
|
+
var updateDropdownWidth = function updateDropdownWidth() {
|
|
9171
|
+
setWidth(ref.current.offsetWidth);
|
|
9172
|
+
};
|
|
9173
|
+
|
|
9174
|
+
return React__default.createElement(TimeFieldDropdown, {
|
|
9175
|
+
interval: interval,
|
|
9176
|
+
trigger: React__default.createElement(TimeFieldDropdownTrigger, Object.assign({}, allOtherProps, {
|
|
9177
|
+
onClick: function onClick() {
|
|
9178
|
+
return ref.current.select();
|
|
9179
|
+
},
|
|
9180
|
+
ref: ref,
|
|
9181
|
+
onInputChange: function onInputChange(e) {
|
|
9182
|
+
return setInputValue(e);
|
|
9183
|
+
}
|
|
9184
|
+
})),
|
|
9185
|
+
startTime: startTime,
|
|
9186
|
+
onOptionClick: onOptionClick,
|
|
9187
|
+
inputValue: inputValue,
|
|
9188
|
+
width: width
|
|
9189
|
+
});
|
|
9190
|
+
};
|
|
9191
|
+
|
|
8923
9192
|
var TimeField = forwardRef(TimeFieldElement);
|
|
8924
9193
|
|
|
8925
|
-
var _excluded$
|
|
9194
|
+
var _excluded$2r = ["currencySymbol", "step"];
|
|
8926
9195
|
|
|
8927
9196
|
var CurrencyFieldElement = function CurrencyFieldElement(_ref, ref) {
|
|
8928
9197
|
var _ref$currencySymbol = _ref.currencySymbol,
|
|
8929
9198
|
currencySymbol = _ref$currencySymbol === void 0 ? '$' : _ref$currencySymbol,
|
|
8930
9199
|
_ref$step = _ref.step,
|
|
8931
9200
|
step = _ref$step === void 0 ? 0.01 : _ref$step,
|
|
8932
|
-
allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9201
|
+
allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2r);
|
|
8933
9202
|
|
|
8934
9203
|
var _useTextField = useTextField(_extends({}, allOtherProps, {
|
|
8935
9204
|
ref: ref
|
|
@@ -8968,7 +9237,7 @@ var CurrencyFieldElement = function CurrencyFieldElement(_ref, ref) {
|
|
|
8968
9237
|
|
|
8969
9238
|
var CurrencyField = forwardRef(CurrencyFieldElement);
|
|
8970
9239
|
|
|
8971
|
-
var _excluded$
|
|
9240
|
+
var _excluded$2s = ["max", "min", "precision", "stepSize"];
|
|
8972
9241
|
|
|
8973
9242
|
var PercentageElement = function PercentageElement(_ref, ref) {
|
|
8974
9243
|
var _ref$max = _ref.max,
|
|
@@ -8979,7 +9248,7 @@ var PercentageElement = function PercentageElement(_ref, ref) {
|
|
|
8979
9248
|
precision = _ref$precision === void 0 ? 0 : _ref$precision,
|
|
8980
9249
|
_ref$stepSize = _ref.stepSize,
|
|
8981
9250
|
stepSize = _ref$stepSize === void 0 ? 1 : _ref$stepSize,
|
|
8982
|
-
allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9251
|
+
allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2s);
|
|
8983
9252
|
|
|
8984
9253
|
var _useTextField = useTextField(_extends({}, allOtherProps, {
|
|
8985
9254
|
ref: ref
|
|
@@ -9084,7 +9353,7 @@ var BUTTON_THEME = {
|
|
|
9084
9353
|
UPSELL: 'upsell'
|
|
9085
9354
|
};
|
|
9086
9355
|
|
|
9087
|
-
var styles$
|
|
9356
|
+
var styles$U = {"banner":"_vgLin","banner__title":"_63TwY","banner__body":"_3n6S7","banner__body--multilineCTA":"_2pMYs","banner--info":"_ON6Eg","banner__icon":"_1-D-E","banner--success":"_1FFZh","banner--danger":"_2R34O","banner--warning":"_3Cfhe","banner--upsell":"_1SIOw","banner__close":"_3SNQ1","banner--single-line":"_3nLTI"};
|
|
9088
9357
|
|
|
9089
9358
|
var ButtonCTA = function ButtonCTA(_ref) {
|
|
9090
9359
|
var button = _ref.button,
|
|
@@ -9107,7 +9376,7 @@ var ButtonCTA = function ButtonCTA(_ref) {
|
|
|
9107
9376
|
}, button.props));
|
|
9108
9377
|
};
|
|
9109
9378
|
|
|
9110
|
-
var styles$
|
|
9379
|
+
var styles$V = {"banner__caption":"_1jqm8"};
|
|
9111
9380
|
|
|
9112
9381
|
var InlineBannerCTA = function InlineBannerCTA(_ref) {
|
|
9113
9382
|
var primaryButton = _ref.primaryButton,
|
|
@@ -9138,7 +9407,7 @@ var InlineBannerCTA = function InlineBannerCTA(_ref) {
|
|
|
9138
9407
|
bannerTheme: bannerTheme,
|
|
9139
9408
|
primaryCTA: true
|
|
9140
9409
|
})), caption && multiLine && React__default.createElement("div", {
|
|
9141
|
-
className: styles$
|
|
9410
|
+
className: styles$V['banner__caption']
|
|
9142
9411
|
}, caption));
|
|
9143
9412
|
};
|
|
9144
9413
|
|
|
@@ -9163,7 +9432,7 @@ var InlineBannerIcon = function InlineBannerIcon(_ref) {
|
|
|
9163
9432
|
}
|
|
9164
9433
|
};
|
|
9165
9434
|
|
|
9166
|
-
var _excluded$
|
|
9435
|
+
var _excluded$2t = ["children", "theme", "title", "onClose", "caption", "primaryButton", "secondaryButton", "testId"];
|
|
9167
9436
|
|
|
9168
9437
|
var InlineBanner = function InlineBanner(_ref) {
|
|
9169
9438
|
var _classnames, _classnames2;
|
|
@@ -9177,7 +9446,7 @@ var InlineBanner = function InlineBanner(_ref) {
|
|
|
9177
9446
|
primaryButton = _ref.primaryButton,
|
|
9178
9447
|
secondaryButton = _ref.secondaryButton,
|
|
9179
9448
|
testId = _ref.testId,
|
|
9180
|
-
positionProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9449
|
+
positionProps = _objectWithoutPropertiesLoose(_ref, _excluded$2t);
|
|
9181
9450
|
|
|
9182
9451
|
var positionStyles = usePositionStyles(positionProps);
|
|
9183
9452
|
var multiLine = !!title;
|
|
@@ -9185,14 +9454,14 @@ var InlineBanner = function InlineBanner(_ref) {
|
|
|
9185
9454
|
var Layout = multiLine ? Stack : Inline;
|
|
9186
9455
|
return React__default.createElement("div", {
|
|
9187
9456
|
"data-testid": testId,
|
|
9188
|
-
className: classnames(styles$
|
|
9457
|
+
className: classnames(styles$U['banner'], (_classnames = {}, _classnames[styles$U['banner--info']] = theme === BANNER_THEME.INFO, _classnames[styles$U['banner--warning']] = theme === BANNER_THEME.WARNING, _classnames[styles$U['banner--success']] = theme === BANNER_THEME.SUCCESS, _classnames[styles$U['banner--danger']] = theme === BANNER_THEME.DANGER, _classnames[styles$U['banner--upsell']] = theme === BANNER_THEME.UPSELL, _classnames[styles$U['banner--single-line']] = !multiLine, _classnames)),
|
|
9189
9458
|
style: positionStyles
|
|
9190
9459
|
}, React__default.createElement(Inline, {
|
|
9191
9460
|
alignItems: multiLine ? undefined : 'center',
|
|
9192
9461
|
flex: ['0 1 auto', 1],
|
|
9193
9462
|
space: 12
|
|
9194
9463
|
}, React__default.createElement("div", {
|
|
9195
|
-
className: styles$
|
|
9464
|
+
className: styles$U['banner__icon']
|
|
9196
9465
|
}, React__default.createElement(InlineBannerIcon, {
|
|
9197
9466
|
theme: theme
|
|
9198
9467
|
})), React__default.createElement(Layout, {
|
|
@@ -9202,9 +9471,9 @@ var InlineBanner = function InlineBanner(_ref) {
|
|
|
9202
9471
|
flex: ['min-content'],
|
|
9203
9472
|
flexWrap: multiLine ? undefined : 'wrap'
|
|
9204
9473
|
}, title && React__default.createElement("div", {
|
|
9205
|
-
className: styles$
|
|
9474
|
+
className: styles$U['banner__title']
|
|
9206
9475
|
}, title), React__default.createElement("div", {
|
|
9207
|
-
className: classnames(styles$
|
|
9476
|
+
className: classnames(styles$U['banner__body'], (_classnames2 = {}, _classnames2[styles$U['banner__body--multilineCTA']] = primaryButton && multiLine, _classnames2))
|
|
9208
9477
|
}, children), primaryButton && React__default.createElement(InlineBannerCTA, {
|
|
9209
9478
|
primaryButton: primaryButton,
|
|
9210
9479
|
secondaryButton: secondaryButton,
|
|
@@ -9212,7 +9481,7 @@ var InlineBanner = function InlineBanner(_ref) {
|
|
|
9212
9481
|
multiLine: multiLine,
|
|
9213
9482
|
bannerTheme: theme
|
|
9214
9483
|
})), dismissable && React__default.createElement("div", {
|
|
9215
|
-
className: styles$
|
|
9484
|
+
className: styles$U['banner__close']
|
|
9216
9485
|
}, React__default.createElement(Button$1, {
|
|
9217
9486
|
theme: "link-icon",
|
|
9218
9487
|
type: "button",
|
|
@@ -9226,7 +9495,7 @@ var PERSISTENT_BANNER_THEME = {
|
|
|
9226
9495
|
DANGER: 'danger'
|
|
9227
9496
|
};
|
|
9228
9497
|
|
|
9229
|
-
var styles$
|
|
9498
|
+
var styles$W = {"persistent-banner":"_1KO1J","persistent-banner--info":"_2mTN3","persistent-banner--danger":"_1YuCF","persistent-banner--upsell":"_tlNFk"};
|
|
9230
9499
|
|
|
9231
9500
|
var PersistentBanner = function PersistentBanner(_ref) {
|
|
9232
9501
|
var _classNames;
|
|
@@ -9255,7 +9524,7 @@ var PersistentBanner = function PersistentBanner(_ref) {
|
|
|
9255
9524
|
};
|
|
9256
9525
|
|
|
9257
9526
|
return React__default.createElement("div", {
|
|
9258
|
-
className: classnames(styles$
|
|
9527
|
+
className: classnames(styles$W['persistent-banner'], (_classNames = {}, _classNames[styles$W['persistent-banner--info']] = theme === PERSISTENT_BANNER_THEME.INFO, _classNames[styles$W['persistent-banner--danger']] = theme === PERSISTENT_BANNER_THEME.DANGER, _classNames[styles$W['persistent-banner--upsell']] = theme === PERSISTENT_BANNER_THEME.UPSELL, _classNames)),
|
|
9259
9528
|
"data-testid": testId
|
|
9260
9529
|
}, onDismiss ? React__default.createElement(Inline, {
|
|
9261
9530
|
flex: [1],
|
|
@@ -9327,7 +9596,7 @@ var useProgress = function useProgress(progress, maxValue, getMetric) {
|
|
|
9327
9596
|
};
|
|
9328
9597
|
};
|
|
9329
9598
|
|
|
9330
|
-
var styles$
|
|
9599
|
+
var styles$X = {"circular-progress":"_1XR7V","circular-progress__label":"_1BygP","circular-progress__track":"_1Ak-z","circular-progress__indicator":"_22YIp"};
|
|
9331
9600
|
|
|
9332
9601
|
var CircularProgress = function CircularProgress(_ref) {
|
|
9333
9602
|
var progress = _ref.progress,
|
|
@@ -9342,7 +9611,7 @@ var CircularProgress = function CircularProgress(_ref) {
|
|
|
9342
9611
|
|
|
9343
9612
|
var determinant = metric.percentage * 2.79;
|
|
9344
9613
|
return React__default.createElement("div", Object.assign({}, elementProps, {
|
|
9345
|
-
className: styles$
|
|
9614
|
+
className: styles$X['circular-progress'],
|
|
9346
9615
|
"data-testid": testId
|
|
9347
9616
|
}), React__default.createElement("svg", {
|
|
9348
9617
|
viewBox: "0 0 100 100"
|
|
@@ -9351,21 +9620,21 @@ var CircularProgress = function CircularProgress(_ref) {
|
|
|
9351
9620
|
cy: 50,
|
|
9352
9621
|
r: 45,
|
|
9353
9622
|
strokeWidth: "10px",
|
|
9354
|
-
className: styles$
|
|
9623
|
+
className: styles$X['circular-progress__track']
|
|
9355
9624
|
}), React__default.createElement("circle", {
|
|
9356
9625
|
cx: 50,
|
|
9357
9626
|
cy: 50,
|
|
9358
9627
|
r: 45,
|
|
9359
9628
|
strokeWidth: "10px",
|
|
9360
|
-
className: styles$
|
|
9629
|
+
className: styles$X['circular-progress__indicator'],
|
|
9361
9630
|
strokeDashoffset: "66",
|
|
9362
9631
|
strokeDasharray: determinant + " " + (279 - determinant)
|
|
9363
9632
|
})), React__default.createElement("div", {
|
|
9364
|
-
className: styles$
|
|
9633
|
+
className: styles$X['circular-progress__label']
|
|
9365
9634
|
}, children || metric.progress + "/" + metric.maxValue));
|
|
9366
9635
|
};
|
|
9367
9636
|
|
|
9368
|
-
var styles$
|
|
9637
|
+
var styles$Y = {"progress-bar":"_3nyZN","progress-bar__indicator":"_11TEp","progress-bar__steps":"_3XFTU"};
|
|
9369
9638
|
|
|
9370
9639
|
var ProgressBar = function ProgressBar(_ref) {
|
|
9371
9640
|
var progress = _ref.progress,
|
|
@@ -9380,15 +9649,15 @@ var ProgressBar = function ProgressBar(_ref) {
|
|
|
9380
9649
|
metric = _useProgress.metric;
|
|
9381
9650
|
|
|
9382
9651
|
return React__default.createElement(Stack, null, React__default.createElement("div", Object.assign({}, elementProps, {
|
|
9383
|
-
className: styles$
|
|
9652
|
+
className: styles$Y['progress-bar'],
|
|
9384
9653
|
"data-testid": testId
|
|
9385
9654
|
}), React__default.createElement("div", {
|
|
9386
|
-
className: styles$
|
|
9655
|
+
className: styles$Y['progress-bar__indicator'],
|
|
9387
9656
|
style: {
|
|
9388
9657
|
width: metric.percentage + "%"
|
|
9389
9658
|
}
|
|
9390
9659
|
})), steps && steps.length > 0 && React__default.createElement("div", {
|
|
9391
|
-
className: styles$
|
|
9660
|
+
className: styles$Y['progress-bar__steps']
|
|
9392
9661
|
}, steps.map(function (step) {
|
|
9393
9662
|
return React__default.createElement("div", {
|
|
9394
9663
|
key: step
|
|
@@ -9396,9 +9665,9 @@ var ProgressBar = function ProgressBar(_ref) {
|
|
|
9396
9665
|
})));
|
|
9397
9666
|
};
|
|
9398
9667
|
|
|
9399
|
-
var styles$
|
|
9668
|
+
var styles$Z = {"badge":"_2f81N","badge--warning":"_2g1GI","badge--danger":"_2zLnM","badge--success":"_27QOo","badge--info":"_2gmsM"};
|
|
9400
9669
|
|
|
9401
|
-
var _excluded$
|
|
9670
|
+
var _excluded$2u = ["children", "theme", "title", "testId"];
|
|
9402
9671
|
|
|
9403
9672
|
var Badge = function Badge(_ref, forwardedRef) {
|
|
9404
9673
|
var _classnames;
|
|
@@ -9407,7 +9676,7 @@ var Badge = function Badge(_ref, forwardedRef) {
|
|
|
9407
9676
|
theme = _ref.theme,
|
|
9408
9677
|
title = _ref.title,
|
|
9409
9678
|
testId = _ref.testId,
|
|
9410
|
-
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9679
|
+
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2u);
|
|
9411
9680
|
|
|
9412
9681
|
var internalRef = useRef(null);
|
|
9413
9682
|
var ref = forwardedRef || internalRef;
|
|
@@ -9420,7 +9689,7 @@ var Badge = function Badge(_ref, forwardedRef) {
|
|
|
9420
9689
|
overlay: title,
|
|
9421
9690
|
ref: ref
|
|
9422
9691
|
}, React__default.createElement("div", Object.assign({
|
|
9423
|
-
className: classnames(styles$
|
|
9692
|
+
className: classnames(styles$Z['badge'], (_classnames = {}, _classnames[styles$Z['badge--success']] = theme === 'success', _classnames[styles$Z['badge--danger']] = theme === 'danger', _classnames[styles$Z['badge--info']] = theme === 'info', _classnames[styles$Z['badge--warning']] = theme === 'warning', _classnames)),
|
|
9424
9693
|
ref: ref,
|
|
9425
9694
|
"data-testid": testId
|
|
9426
9695
|
}, otherProps), children));
|
|
@@ -9428,9 +9697,9 @@ var Badge = function Badge(_ref, forwardedRef) {
|
|
|
9428
9697
|
|
|
9429
9698
|
var Badge$1 = forwardRef(Badge);
|
|
9430
9699
|
|
|
9431
|
-
var styles
|
|
9700
|
+
var styles$_ = {"avatar":"_2wJGB","avatar--small":"_3QTSo","avatar__badge":"_2Rl8S","avatar--medium":"_1zwj0","avatar--large":"_3-U6x","avatar--extra-large":"_3qn2q"};
|
|
9432
9701
|
|
|
9433
|
-
var styles
|
|
9702
|
+
var styles$$ = {"avatar-image":"_GKL9P"};
|
|
9434
9703
|
|
|
9435
9704
|
var AvatarImage = function AvatarImage(_ref) {
|
|
9436
9705
|
var url = _ref.url,
|
|
@@ -9455,7 +9724,7 @@ var AvatarImage = function AvatarImage(_ref) {
|
|
|
9455
9724
|
}
|
|
9456
9725
|
|
|
9457
9726
|
return React__default.createElement("div", {
|
|
9458
|
-
className: styles
|
|
9727
|
+
className: styles$$['avatar-image']
|
|
9459
9728
|
}, React__default.createElement(IconUserSolid, {
|
|
9460
9729
|
size: "flexible",
|
|
9461
9730
|
color: color
|
|
@@ -9524,7 +9793,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
9524
9793
|
|
|
9525
9794
|
var backgroundColor = url ? GREY200 : color;
|
|
9526
9795
|
return React__default.createElement("div", {
|
|
9527
|
-
className: classnames(styles
|
|
9796
|
+
className: classnames(styles$_['avatar'], (_classnames = {}, _classnames[styles$_['avatar--small']] = size === 'small', _classnames[styles$_['avatar--medium']] = size === 'medium', _classnames[styles$_['avatar--large']] = size === 'large', _classnames[styles$_['avatar--extra-large']] = size === 'extra-large', _classnames)),
|
|
9528
9797
|
style: {
|
|
9529
9798
|
backgroundColor: children || url && !showIconInsteadOfImage ? backgroundColor : defaultProfilePictureColors.backgroundColor
|
|
9530
9799
|
},
|
|
@@ -9537,7 +9806,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
9537
9806
|
return setShowIconInsteadOfImage(true);
|
|
9538
9807
|
}
|
|
9539
9808
|
}), badge && size !== 'small' && React__default.createElement("div", {
|
|
9540
|
-
className: styles
|
|
9809
|
+
className: styles$_['avatar__badge']
|
|
9541
9810
|
}, badge));
|
|
9542
9811
|
};
|
|
9543
9812
|
|
|
@@ -9550,7 +9819,7 @@ var CHIP_THEME = {
|
|
|
9550
9819
|
DANGER: 'danger'
|
|
9551
9820
|
};
|
|
9552
9821
|
|
|
9553
|
-
var styles$
|
|
9822
|
+
var styles$10 = {"chip":"_1fIeV","chip--marketing":"_V4byU","chip--success":"_37gN9","chip--upsell":"_Tw7tp","chip--warning":"_t94VZ","chip--info":"_3SmeO","chip--danger":"_2eoX0"};
|
|
9554
9823
|
|
|
9555
9824
|
var Chip = function Chip(_ref) {
|
|
9556
9825
|
var _classnames;
|
|
@@ -9561,11 +9830,11 @@ var Chip = function Chip(_ref) {
|
|
|
9561
9830
|
testId = _ref.testId;
|
|
9562
9831
|
return React__default.createElement("div", {
|
|
9563
9832
|
"data-testid": testId,
|
|
9564
|
-
className: classnames(styles$
|
|
9833
|
+
className: classnames(styles$10['chip'], (_classnames = {}, _classnames[styles$10['chip--marketing']] = theme === CHIP_THEME.MARKETING, _classnames[styles$10['chip--success']] = theme === CHIP_THEME.SUCCESS, _classnames[styles$10['chip--upsell']] = theme === CHIP_THEME.UPSELL, _classnames[styles$10['chip--warning']] = theme === CHIP_THEME.WARNING, _classnames[styles$10['chip--info']] = theme === CHIP_THEME.INFO, _classnames[styles$10['chip--danger']] = theme === CHIP_THEME.DANGER, _classnames))
|
|
9565
9834
|
}, children);
|
|
9566
9835
|
};
|
|
9567
9836
|
|
|
9568
|
-
var styles$
|
|
9837
|
+
var styles$11 = {"pill":"_23q4Y","pill--default":"_niDEM","pill--success":"_IwDRB","pill--danger":"_MPji-","pill--warning":"_3S2m8","pill--info":"_2G3ML"};
|
|
9569
9838
|
|
|
9570
9839
|
var PILL_THEME = {
|
|
9571
9840
|
INFO: 'info',
|
|
@@ -9584,7 +9853,7 @@ var Pill = function Pill(_ref) {
|
|
|
9584
9853
|
testId = _ref.testId;
|
|
9585
9854
|
return React__default.createElement("div", {
|
|
9586
9855
|
"data-testid": testId,
|
|
9587
|
-
className: classnames(styles$
|
|
9856
|
+
className: classnames(styles$11['pill'], (_classnames = {}, _classnames[styles$11['pill--default']] = theme === PILL_THEME.DEFAULT, _classnames[styles$11['pill--warning']] = theme === PILL_THEME.WARNING, _classnames[styles$11['pill--success']] = theme === PILL_THEME.SUCCESS, _classnames[styles$11['pill--danger']] = theme === PILL_THEME.DANGER, _classnames[styles$11['pill--info']] = theme === PILL_THEME.INFO, _classnames))
|
|
9588
9857
|
}, children);
|
|
9589
9858
|
};
|
|
9590
9859
|
|
|
@@ -9594,14 +9863,16 @@ var EMPTY_STATE_SIZE = {
|
|
|
9594
9863
|
LARGE: 'large'
|
|
9595
9864
|
};
|
|
9596
9865
|
|
|
9597
|
-
var styles$
|
|
9866
|
+
var styles$12 = {"empty-state-container-stack":"_2B8Vd","empty-state-container-stack__content":"_NBTDp","empty-state-container-stack__content--full-page":"_1UWbP","empty-state-container-stack__content--inline-horizontal":"_2BVOy","empty-state-container-stack__body":"_1LuiZ"};
|
|
9598
9867
|
|
|
9599
|
-
var styles$
|
|
9868
|
+
var styles$13 = {"empty-state-container-cta":"_1Cx9N","empty-state-container-cta--inside-modal":"_WbcaM"};
|
|
9600
9869
|
|
|
9601
9870
|
var EmptyStateContainerCTA = function EmptyStateContainerCTA(_ref) {
|
|
9602
|
-
var _actions$primary, _actions$secondary;
|
|
9871
|
+
var _actions$primary, _actions$secondary, _classNames;
|
|
9603
9872
|
|
|
9604
9873
|
var isPaywall = _ref.isPaywall,
|
|
9874
|
+
_ref$isInsideModal = _ref.isInsideModal,
|
|
9875
|
+
isInsideModal = _ref$isInsideModal === void 0 ? false : _ref$isInsideModal,
|
|
9605
9876
|
actions = _ref.actions;
|
|
9606
9877
|
var primaryButton = updateButtonProps(actions.primary, {
|
|
9607
9878
|
theme: actions !== null && actions !== void 0 && (_actions$primary = actions.primary) !== null && _actions$primary !== void 0 && _actions$primary.props.theme || isPaywall ? 'upsell' : 'primary',
|
|
@@ -9612,7 +9883,7 @@ var EmptyStateContainerCTA = function EmptyStateContainerCTA(_ref) {
|
|
|
9612
9883
|
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
9613
9884
|
});
|
|
9614
9885
|
return React__default.createElement("div", {
|
|
9615
|
-
className: styles$
|
|
9886
|
+
className: classnames(styles$13['empty-state-container-cta'], (_classNames = {}, _classNames[styles$13['empty-state-container-cta--inside-modal']] = isInsideModal, _classNames))
|
|
9616
9887
|
}, primaryButton, secondaryButton);
|
|
9617
9888
|
};
|
|
9618
9889
|
|
|
@@ -9627,7 +9898,7 @@ var EmptyStateContainerStack = function EmptyStateContainerStack(_ref) {
|
|
|
9627
9898
|
isPaywall = _ref$isPaywall === void 0 ? false : _ref$isPaywall,
|
|
9628
9899
|
testId = _ref.testId;
|
|
9629
9900
|
return React__default.createElement("div", {
|
|
9630
|
-
className: styles$
|
|
9901
|
+
className: styles$12['empty-state-container-stack'],
|
|
9631
9902
|
"data-testid": testId
|
|
9632
9903
|
}, React__default.createElement("img", {
|
|
9633
9904
|
src: mediaUrl,
|
|
@@ -9643,7 +9914,7 @@ var EmptyStateContainerStack = function EmptyStateContainerStack(_ref) {
|
|
|
9643
9914
|
emphasis: "bold",
|
|
9644
9915
|
as: "body"
|
|
9645
9916
|
}, title), React__default.createElement("div", {
|
|
9646
|
-
className: styles$
|
|
9917
|
+
className: styles$12['empty-state-container-stack__body']
|
|
9647
9918
|
}, children)), React__default.createElement(Stack, {
|
|
9648
9919
|
space: 8,
|
|
9649
9920
|
alignItems: "center"
|
|
@@ -9655,10 +9926,10 @@ var EmptyStateContainerStack = function EmptyStateContainerStack(_ref) {
|
|
|
9655
9926
|
}, caption)));
|
|
9656
9927
|
};
|
|
9657
9928
|
|
|
9658
|
-
var styles$
|
|
9929
|
+
var styles$14 = {"empty-state-container-inline":"_eMr1V","empty-state-container-inline--inside-modal":"_2sweG","empty-state-container-inline__content":"_2jreb","empty-state-container-inline__content--full-page":"_3RLfH","empty-state-container-inline__content--inline-horizontal":"_3BMpx","empty-state-container-inline__body":"_2J5vn","empty-state-container-inline__image":"_G2VtA"};
|
|
9659
9930
|
|
|
9660
9931
|
var EmptyStateContainerInline = function EmptyStateContainerInline(_ref) {
|
|
9661
|
-
var _classnames;
|
|
9932
|
+
var _classNames, _classnames;
|
|
9662
9933
|
|
|
9663
9934
|
var header = _ref.header,
|
|
9664
9935
|
title = _ref.title,
|
|
@@ -9671,11 +9942,15 @@ var EmptyStateContainerInline = function EmptyStateContainerInline(_ref) {
|
|
|
9671
9942
|
_ref$isPaywall = _ref.isPaywall,
|
|
9672
9943
|
isPaywall = _ref$isPaywall === void 0 ? false : _ref$isPaywall,
|
|
9673
9944
|
testId = _ref.testId;
|
|
9945
|
+
|
|
9946
|
+
var _useModalContext = useModalContext(),
|
|
9947
|
+
isInsideModal = _useModalContext.isModalMounted;
|
|
9948
|
+
|
|
9674
9949
|
return React__default.createElement("div", {
|
|
9675
|
-
className: styles$
|
|
9950
|
+
className: classnames(styles$14['empty-state-container-inline'], (_classNames = {}, _classNames[styles$14['empty-state-container-inline--inside-modal']] = isInsideModal, _classNames)),
|
|
9676
9951
|
"data-testid": testId
|
|
9677
9952
|
}, React__default.createElement("div", {
|
|
9678
|
-
className: classnames(styles$
|
|
9953
|
+
className: classnames(styles$14['empty-state-container-inline__content'], (_classnames = {}, _classnames[styles$14['empty-state-container__content--full-page']] = size === EMPTY_STATE_SIZE.LARGE, _classnames[styles$14['empty-state-container__content--inline-horizontal']] = size === EMPTY_STATE_SIZE.MEDIUM, _classnames))
|
|
9679
9954
|
}, React__default.createElement(Stack, {
|
|
9680
9955
|
space: 8
|
|
9681
9956
|
}, header && React__default.createElement(Text, {
|
|
@@ -9684,19 +9959,23 @@ var EmptyStateContainerInline = function EmptyStateContainerInline(_ref) {
|
|
|
9684
9959
|
}, header), React__default.createElement(Text, {
|
|
9685
9960
|
as: "h1"
|
|
9686
9961
|
}, title)), React__default.createElement("div", {
|
|
9687
|
-
className: styles$
|
|
9962
|
+
className: styles$14['empty-state-container-inline__body']
|
|
9688
9963
|
}, children), React__default.createElement(Stack, {
|
|
9689
|
-
space: 8
|
|
9964
|
+
space: 8,
|
|
9965
|
+
marginTop: 12
|
|
9690
9966
|
}, actions && React__default.createElement(EmptyStateContainerCTA, {
|
|
9691
9967
|
actions: actions,
|
|
9692
|
-
isPaywall: isPaywall
|
|
9968
|
+
isPaywall: isPaywall,
|
|
9969
|
+
isInsideModal: isInsideModal
|
|
9693
9970
|
}), caption && React__default.createElement(Text, {
|
|
9694
9971
|
as: "caption"
|
|
9695
|
-
}, caption))), React__default.createElement("
|
|
9972
|
+
}, caption))), React__default.createElement("div", {
|
|
9973
|
+
className: styles$14['empty-state-container-inline__image']
|
|
9974
|
+
}, React__default.createElement("img", {
|
|
9696
9975
|
src: mediaUrl,
|
|
9697
9976
|
alt: String(title),
|
|
9698
9977
|
width: size === EMPTY_STATE_SIZE.LARGE ? '500px' : '333px'
|
|
9699
|
-
}));
|
|
9978
|
+
})));
|
|
9700
9979
|
};
|
|
9701
9980
|
|
|
9702
9981
|
var EmptyStateContainer = function EmptyStateContainer(_ref) {
|