@zextras/carbonio-design-system 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/zapp-ui.bundle.d.ts +1 -0
- package/dist/zapp-ui.bundle.js +183 -146
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.4.1](https://github.com/Zextras/carbonio-design-system/compare/v0.4.0...v0.4.1) (2022-09-27)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **Dropdown:** add tooltip on disabled items ([4dce432](https://github.com/Zextras/carbonio-design-system/commit/4dce43254a6221e8c6e93be9aaab53ae4aa3f83b)), closes [#124](https://github.com/Zextras/carbonio-design-system/issues/124)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **ChipInput:** hide scrollbar when not in overflow ([2da4ea6](https://github.com/Zextras/carbonio-design-system/commit/2da4ea6b18f7cd124a4dcb84d2ec9f28adf23965))
|
|
16
|
+
* **Dropdown:** align content to flex-start when item has subitems ([6d755a5](https://github.com/Zextras/carbonio-design-system/commit/6d755a5d681f8f715908ebf59118a3ad2149662c))
|
|
17
|
+
* **Dropdown:** prevent dropdown from closing before calling click callback of nested items ([e8cea00](https://github.com/Zextras/carbonio-design-system/commit/e8cea004d7cf64a542dac0bce774201244801c97))
|
|
18
|
+
* **Modal:** avoid button text overflow, if is it possible, when optionalFooter is provided ([3a10888](https://github.com/Zextras/carbonio-design-system/commit/3a10888e9597801a0dc04cbfa3f156b6a11b3377))
|
|
19
|
+
|
|
5
20
|
## [0.4.0](https://github.com/Zextras/carbonio-design-system/compare/v0.3.10...v0.4.0) (2022-09-02)
|
|
6
21
|
|
|
7
22
|
|
package/dist/zapp-ui.bundle.d.ts
CHANGED
|
@@ -734,6 +734,7 @@ export declare interface DropdownItem {
|
|
|
734
734
|
disabled?: boolean;
|
|
735
735
|
items?: Array<DropdownItem>;
|
|
736
736
|
keepOpen?: boolean;
|
|
737
|
+
tooltipLabel?: string | undefined;
|
|
737
738
|
}
|
|
738
739
|
|
|
739
740
|
export declare interface DropdownProps extends Omit<HTMLAttributes<HTMLDivElement>, 'contextMenu'> {
|
package/dist/zapp-ui.bundle.js
CHANGED
|
@@ -21398,6 +21398,81 @@ const Chip = /*#__PURE__*/React__default["default"].forwardRef(function ChipFn(_
|
|
|
21398
21398
|
}, actionItems))));
|
|
21399
21399
|
});
|
|
21400
21400
|
|
|
21401
|
+
var baseEach = _baseEach;
|
|
21402
|
+
|
|
21403
|
+
/**
|
|
21404
|
+
* The base implementation of `_.some` without support for iteratee shorthands.
|
|
21405
|
+
*
|
|
21406
|
+
* @private
|
|
21407
|
+
* @param {Array|Object} collection The collection to iterate over.
|
|
21408
|
+
* @param {Function} predicate The function invoked per iteration.
|
|
21409
|
+
* @returns {boolean} Returns `true` if any element passes the predicate check,
|
|
21410
|
+
* else `false`.
|
|
21411
|
+
*/
|
|
21412
|
+
function baseSome$1(collection, predicate) {
|
|
21413
|
+
var result;
|
|
21414
|
+
|
|
21415
|
+
baseEach(collection, function(value, index, collection) {
|
|
21416
|
+
result = predicate(value, index, collection);
|
|
21417
|
+
return !result;
|
|
21418
|
+
});
|
|
21419
|
+
return !!result;
|
|
21420
|
+
}
|
|
21421
|
+
|
|
21422
|
+
var _baseSome = baseSome$1;
|
|
21423
|
+
|
|
21424
|
+
var arraySome = _arraySome,
|
|
21425
|
+
baseIteratee = _baseIteratee,
|
|
21426
|
+
baseSome = _baseSome,
|
|
21427
|
+
isArray = isArray_1,
|
|
21428
|
+
isIterateeCall = _isIterateeCall;
|
|
21429
|
+
|
|
21430
|
+
/**
|
|
21431
|
+
* Checks if `predicate` returns truthy for **any** element of `collection`.
|
|
21432
|
+
* Iteration is stopped once `predicate` returns truthy. The predicate is
|
|
21433
|
+
* invoked with three arguments: (value, index|key, collection).
|
|
21434
|
+
*
|
|
21435
|
+
* @static
|
|
21436
|
+
* @memberOf _
|
|
21437
|
+
* @since 0.1.0
|
|
21438
|
+
* @category Collection
|
|
21439
|
+
* @param {Array|Object} collection The collection to iterate over.
|
|
21440
|
+
* @param {Function} [predicate=_.identity] The function invoked per iteration.
|
|
21441
|
+
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
|
|
21442
|
+
* @returns {boolean} Returns `true` if any element passes the predicate check,
|
|
21443
|
+
* else `false`.
|
|
21444
|
+
* @example
|
|
21445
|
+
*
|
|
21446
|
+
* _.some([null, 0, 'yes', false], Boolean);
|
|
21447
|
+
* // => true
|
|
21448
|
+
*
|
|
21449
|
+
* var users = [
|
|
21450
|
+
* { 'user': 'barney', 'active': true },
|
|
21451
|
+
* { 'user': 'fred', 'active': false }
|
|
21452
|
+
* ];
|
|
21453
|
+
*
|
|
21454
|
+
* // The `_.matches` iteratee shorthand.
|
|
21455
|
+
* _.some(users, { 'user': 'barney', 'active': false });
|
|
21456
|
+
* // => false
|
|
21457
|
+
*
|
|
21458
|
+
* // The `_.matchesProperty` iteratee shorthand.
|
|
21459
|
+
* _.some(users, ['active', false]);
|
|
21460
|
+
* // => true
|
|
21461
|
+
*
|
|
21462
|
+
* // The `_.property` iteratee shorthand.
|
|
21463
|
+
* _.some(users, 'active');
|
|
21464
|
+
* // => true
|
|
21465
|
+
*/
|
|
21466
|
+
function some(collection, predicate, guard) {
|
|
21467
|
+
var func = isArray(collection) ? arraySome : baseSome;
|
|
21468
|
+
if (guard && isIterateeCall(collection, predicate, guard)) {
|
|
21469
|
+
predicate = undefined;
|
|
21470
|
+
}
|
|
21471
|
+
return func(collection, baseIteratee(predicate));
|
|
21472
|
+
}
|
|
21473
|
+
|
|
21474
|
+
var some_1 = some;
|
|
21475
|
+
|
|
21401
21476
|
const ContainerEl$3 = styled__default["default"](Container).withConfig({
|
|
21402
21477
|
displayName: "Dropdown__ContainerEl",
|
|
21403
21478
|
componentId: "sc-1jmq2vf-0"
|
|
@@ -21418,9 +21493,17 @@ function ListItemContent(_ref2) {
|
|
|
21418
21493
|
disabled,
|
|
21419
21494
|
itemIconSize,
|
|
21420
21495
|
itemTextSize,
|
|
21421
|
-
itemPaddingBetween
|
|
21496
|
+
itemPaddingBetween,
|
|
21497
|
+
tooltipLabel
|
|
21422
21498
|
} = _ref2;
|
|
21423
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
21499
|
+
return /*#__PURE__*/React__default["default"].createElement(Tooltip, {
|
|
21500
|
+
disabled: !disabled || !tooltipLabel,
|
|
21501
|
+
label: tooltipLabel,
|
|
21502
|
+
placement: "bottom-end"
|
|
21503
|
+
}, /*#__PURE__*/React__default["default"].createElement(Container, {
|
|
21504
|
+
orientation: "horizontal",
|
|
21505
|
+
mainAlignment: "flex-start"
|
|
21506
|
+
}, icon && /*#__PURE__*/React__default["default"].createElement(Padding, {
|
|
21424
21507
|
right: itemPaddingBetween
|
|
21425
21508
|
}, /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
21426
21509
|
icon: icon,
|
|
@@ -21434,7 +21517,7 @@ function ListItemContent(_ref2) {
|
|
|
21434
21517
|
weight: selected ? 'bold' : 'regular',
|
|
21435
21518
|
color: disabled ? 'secondary.regular' : 'text',
|
|
21436
21519
|
disabled: disabled
|
|
21437
|
-
}, label));
|
|
21520
|
+
}, label)));
|
|
21438
21521
|
}
|
|
21439
21522
|
|
|
21440
21523
|
function PopperListItem(_ref3) {
|
|
@@ -21450,6 +21533,7 @@ function PopperListItem(_ref3) {
|
|
|
21450
21533
|
itemTextSize,
|
|
21451
21534
|
keepOpen,
|
|
21452
21535
|
itemPaddingBetween,
|
|
21536
|
+
tooltipLabel,
|
|
21453
21537
|
...rest
|
|
21454
21538
|
} = _ref3;
|
|
21455
21539
|
const itemRef = React.useRef(null);
|
|
@@ -21489,7 +21573,8 @@ function PopperListItem(_ref3) {
|
|
|
21489
21573
|
disabled: disabled,
|
|
21490
21574
|
itemIconSize: itemIconSize,
|
|
21491
21575
|
itemTextSize: itemTextSize,
|
|
21492
|
-
itemPaddingBetween: itemPaddingBetween
|
|
21576
|
+
itemPaddingBetween: itemPaddingBetween,
|
|
21577
|
+
tooltipLabel: tooltipLabel
|
|
21493
21578
|
}));
|
|
21494
21579
|
}
|
|
21495
21580
|
|
|
@@ -21508,6 +21593,8 @@ function NestListItem(_ref4) {
|
|
|
21508
21593
|
itemTextSize,
|
|
21509
21594
|
itemPaddingBetween,
|
|
21510
21595
|
keepOpen,
|
|
21596
|
+
dropdownListRef,
|
|
21597
|
+
tooltipLabel,
|
|
21511
21598
|
...rest
|
|
21512
21599
|
} = _ref4;
|
|
21513
21600
|
const itemRef = React.useRef(null);
|
|
@@ -21538,10 +21625,11 @@ function NestListItem(_ref4) {
|
|
|
21538
21625
|
selectedBackgroundColor: selectedBackgroundColor,
|
|
21539
21626
|
itemIconSize: itemIconSize,
|
|
21540
21627
|
itemTextSize: itemTextSize,
|
|
21541
|
-
itemPaddingBetween: itemPaddingBetween
|
|
21628
|
+
itemPaddingBetween: itemPaddingBetween,
|
|
21629
|
+
dropdownListRef: dropdownListRef
|
|
21542
21630
|
}, /*#__PURE__*/React__default["default"].createElement(Container, {
|
|
21543
21631
|
orientation: "horizontal",
|
|
21544
|
-
mainAlignment: "
|
|
21632
|
+
mainAlignment: "flex-start"
|
|
21545
21633
|
}, customComponent || /*#__PURE__*/React__default["default"].createElement(ListItemContent, {
|
|
21546
21634
|
icon: icon,
|
|
21547
21635
|
label: label,
|
|
@@ -21549,12 +21637,14 @@ function NestListItem(_ref4) {
|
|
|
21549
21637
|
disabled: disabled,
|
|
21550
21638
|
itemIconSize: itemIconSize,
|
|
21551
21639
|
itemTextSize: itemTextSize,
|
|
21552
|
-
itemPaddingBetween: itemPaddingBetween
|
|
21640
|
+
itemPaddingBetween: itemPaddingBetween,
|
|
21641
|
+
tooltipLabel: tooltipLabel
|
|
21553
21642
|
}), /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
21554
21643
|
size: itemIconSize,
|
|
21555
21644
|
icon: "ChevronRight",
|
|
21556
21645
|
style: {
|
|
21557
|
-
|
|
21646
|
+
marginRight: 0,
|
|
21647
|
+
marginLeft: 'auto'
|
|
21558
21648
|
}
|
|
21559
21649
|
}))));
|
|
21560
21650
|
}
|
|
@@ -21655,6 +21745,7 @@ const Dropdown = /*#__PURE__*/React__default["default"].forwardRef(function Drop
|
|
|
21655
21745
|
const [position, setPosition] = React.useState(null);
|
|
21656
21746
|
const [currentHover, setCurrentHover] = React.useState(null);
|
|
21657
21747
|
const openPopperTimoutRef = React.useRef();
|
|
21748
|
+
const nestedDropdownsRef = React.useRef([]);
|
|
21658
21749
|
React.useEffect( // clear timers on unmount
|
|
21659
21750
|
() => () => {
|
|
21660
21751
|
openPopperTimoutRef.current && clearTimeout(openPopperTimoutRef.current);
|
|
@@ -21669,6 +21760,7 @@ const Dropdown = /*#__PURE__*/React__default["default"].forwardRef(function Drop
|
|
|
21669
21760
|
const closePopper = React.useCallback(e => {
|
|
21670
21761
|
e && e.stopPropagation();
|
|
21671
21762
|
setOpen(forceOpen);
|
|
21763
|
+
setCurrentHover(null);
|
|
21672
21764
|
!disableRestoreFocus && innerTriggerRef.current && innerTriggerRef.current.focus();
|
|
21673
21765
|
onClose && onClose();
|
|
21674
21766
|
}, [disableRestoreFocus, forceOpen, innerTriggerRef, onClose]);
|
|
@@ -21712,7 +21804,12 @@ const Dropdown = /*#__PURE__*/React__default["default"].forwardRef(function Drop
|
|
|
21712
21804
|
const clickOutsidePopper = React.useCallback(e => {
|
|
21713
21805
|
var _innerTriggerRef$curr, _e$composedPath;
|
|
21714
21806
|
|
|
21715
|
-
|
|
21807
|
+
const clickedOnDropdown = dropdownRef.current && (e.target === dropdownRef.current || dropdownRef.current.contains(e.target));
|
|
21808
|
+
const clickedOnTrigger = innerTriggerRef.current && (e.target === innerTriggerRef.current || ((_innerTriggerRef$curr = innerTriggerRef.current) === null || _innerTriggerRef$curr === void 0 ? void 0 : _innerTriggerRef$curr.contains(e.target)));
|
|
21809
|
+
|
|
21810
|
+
const clickedOnNestedItem = nestedDropdownsRef.current && some_1(nestedDropdownsRef.current, nestedItemRef => nestedItemRef.current && nestedItemRef.current.contains(e.target));
|
|
21811
|
+
|
|
21812
|
+
if (!clickedOnDropdown && !clickedOnTrigger && !clickedOnNestedItem && // check if the attribute is in the event path
|
|
21716
21813
|
!find_1(((_e$composedPath = e.composedPath) === null || _e$composedPath === void 0 ? void 0 : _e$composedPath.call(e)) ?? [], el => el.hasAttribute && el.hasAttribute('data-keep-open'))) {
|
|
21717
21814
|
closePopper();
|
|
21718
21815
|
}
|
|
@@ -21819,56 +21916,65 @@ const Dropdown = /*#__PURE__*/React__default["default"].forwardRef(function Drop
|
|
|
21819
21916
|
const listItemMouseEnterHandler = React.useCallback(id => () => {
|
|
21820
21917
|
setCurrentHover(id);
|
|
21821
21918
|
}, []);
|
|
21822
|
-
const popperListItems = React.useMemo(() =>
|
|
21823
|
-
|
|
21824
|
-
|
|
21825
|
-
|
|
21826
|
-
|
|
21827
|
-
|
|
21828
|
-
|
|
21829
|
-
|
|
21830
|
-
|
|
21831
|
-
|
|
21832
|
-
|
|
21833
|
-
|
|
21834
|
-
|
|
21835
|
-
|
|
21836
|
-
|
|
21837
|
-
|
|
21838
|
-
|
|
21839
|
-
|
|
21840
|
-
|
|
21841
|
-
|
|
21842
|
-
|
|
21843
|
-
|
|
21844
|
-
|
|
21845
|
-
|
|
21846
|
-
|
|
21847
|
-
|
|
21848
|
-
|
|
21849
|
-
|
|
21850
|
-
|
|
21851
|
-
|
|
21852
|
-
|
|
21853
|
-
|
|
21854
|
-
|
|
21855
|
-
|
|
21856
|
-
|
|
21857
|
-
|
|
21858
|
-
|
|
21859
|
-
|
|
21860
|
-
|
|
21861
|
-
|
|
21862
|
-
|
|
21863
|
-
|
|
21864
|
-
|
|
21865
|
-
|
|
21866
|
-
|
|
21867
|
-
|
|
21868
|
-
|
|
21869
|
-
|
|
21870
|
-
|
|
21871
|
-
|
|
21919
|
+
const popperListItems = React.useMemo(() => {
|
|
21920
|
+
nestedDropdownsRef.current = [];
|
|
21921
|
+
|
|
21922
|
+
if (items) {
|
|
21923
|
+
return items.map((_ref15, index) => {
|
|
21924
|
+
let {
|
|
21925
|
+
id,
|
|
21926
|
+
icon,
|
|
21927
|
+
label,
|
|
21928
|
+
click,
|
|
21929
|
+
selected,
|
|
21930
|
+
customComponent,
|
|
21931
|
+
items: subItems,
|
|
21932
|
+
disabled: itemDisabled,
|
|
21933
|
+
type,
|
|
21934
|
+
keepOpen,
|
|
21935
|
+
...itemProps
|
|
21936
|
+
} = _ref15;
|
|
21937
|
+
const nestedRef = /*#__PURE__*/React__default["default"].createRef();
|
|
21938
|
+
nestedDropdownsRef.current.push(nestedRef);
|
|
21939
|
+
return type === 'divider' && /*#__PURE__*/React__default["default"].createElement(Divider, {
|
|
21940
|
+
key: id ?? `divider-${index}`
|
|
21941
|
+
}) || subItems && /*#__PURE__*/React__default["default"].createElement(NestListItem, _extends({
|
|
21942
|
+
icon: icon,
|
|
21943
|
+
label: label,
|
|
21944
|
+
click: listItemClickHandler(click, keepOpen),
|
|
21945
|
+
keepOpen: keepOpen,
|
|
21946
|
+
selected: selected,
|
|
21947
|
+
open: currentHover === id,
|
|
21948
|
+
key: id,
|
|
21949
|
+
customComponent: customComponent,
|
|
21950
|
+
disabled: itemDisabled,
|
|
21951
|
+
items: subItems,
|
|
21952
|
+
onMouseEnter: listItemMouseEnterHandler(id),
|
|
21953
|
+
selectedBackgroundColor: selectedBackgroundColor,
|
|
21954
|
+
itemIconSize: itemIconSize,
|
|
21955
|
+
itemTextSize: itemTextSize,
|
|
21956
|
+
itemPaddingBetween: itemPaddingBetween,
|
|
21957
|
+
dropdownListRef: nestedRef
|
|
21958
|
+
}, itemProps)) || /*#__PURE__*/React__default["default"].createElement(PopperListItem, _extends({
|
|
21959
|
+
icon: icon,
|
|
21960
|
+
label: label,
|
|
21961
|
+
click: listItemClickHandler(click, keepOpen),
|
|
21962
|
+
keepOpen: keepOpen,
|
|
21963
|
+
selected: selected,
|
|
21964
|
+
key: id,
|
|
21965
|
+
customComponent: customComponent,
|
|
21966
|
+
disabled: itemDisabled,
|
|
21967
|
+
onMouseEnter: listItemMouseEnterHandler(id),
|
|
21968
|
+
selectedBackgroundColor: selectedBackgroundColor,
|
|
21969
|
+
itemIconSize: itemIconSize,
|
|
21970
|
+
itemTextSize: itemTextSize,
|
|
21971
|
+
itemPaddingBetween: itemPaddingBetween
|
|
21972
|
+
}, itemProps));
|
|
21973
|
+
});
|
|
21974
|
+
}
|
|
21975
|
+
|
|
21976
|
+
return null;
|
|
21977
|
+
}, [items, listItemClickHandler, currentHover, listItemMouseEnterHandler, selectedBackgroundColor, itemIconSize, itemTextSize, itemPaddingBetween]);
|
|
21872
21978
|
const popperListPreventDefaultHandler = React.useCallback(event => {
|
|
21873
21979
|
preventDefault && event.preventDefault();
|
|
21874
21980
|
}, [preventDefault]);
|
|
@@ -21959,7 +22065,7 @@ const ContainerEl$2 = styled__default["default"](Container).withConfig({
|
|
|
21959
22065
|
const ScrollContainer = styled__default["default"].div.withConfig({
|
|
21960
22066
|
displayName: "ChipInput__ScrollContainer",
|
|
21961
22067
|
componentId: "sc-1y52mik-1"
|
|
21962
|
-
})(["display:flex;flex:1 1 auto;justify-content:flex-start;align-items:center;width:auto;gap:8px;flex-wrap:", ";overflow-x:auto;overflow-x:overlay;-ms-overflow-style:", ";scrollbar-width:", ";&::-webkit-scrollbar{display:", ";}margin-top:", ";max-height:", ";overflow-y:
|
|
22068
|
+
})(["display:flex;flex:1 1 auto;justify-content:flex-start;align-items:center;width:auto;gap:8px;flex-wrap:", ";overflow-x:auto;overflow-x:overlay;-ms-overflow-style:", ";scrollbar-width:", ";&::-webkit-scrollbar{display:", ";}margin-top:", ";max-height:", ";overflow-y:auto;"], _ref6 => {
|
|
21963
22069
|
let {
|
|
21964
22070
|
wrap
|
|
21965
22071
|
} = _ref6;
|
|
@@ -23418,81 +23524,6 @@ const SearchInput = /*#__PURE__*/React__default["default"].forwardRef(function S
|
|
|
23418
23524
|
})));
|
|
23419
23525
|
});
|
|
23420
23526
|
|
|
23421
|
-
var baseEach = _baseEach;
|
|
23422
|
-
|
|
23423
|
-
/**
|
|
23424
|
-
* The base implementation of `_.some` without support for iteratee shorthands.
|
|
23425
|
-
*
|
|
23426
|
-
* @private
|
|
23427
|
-
* @param {Array|Object} collection The collection to iterate over.
|
|
23428
|
-
* @param {Function} predicate The function invoked per iteration.
|
|
23429
|
-
* @returns {boolean} Returns `true` if any element passes the predicate check,
|
|
23430
|
-
* else `false`.
|
|
23431
|
-
*/
|
|
23432
|
-
function baseSome$1(collection, predicate) {
|
|
23433
|
-
var result;
|
|
23434
|
-
|
|
23435
|
-
baseEach(collection, function(value, index, collection) {
|
|
23436
|
-
result = predicate(value, index, collection);
|
|
23437
|
-
return !result;
|
|
23438
|
-
});
|
|
23439
|
-
return !!result;
|
|
23440
|
-
}
|
|
23441
|
-
|
|
23442
|
-
var _baseSome = baseSome$1;
|
|
23443
|
-
|
|
23444
|
-
var arraySome = _arraySome,
|
|
23445
|
-
baseIteratee = _baseIteratee,
|
|
23446
|
-
baseSome = _baseSome,
|
|
23447
|
-
isArray = isArray_1,
|
|
23448
|
-
isIterateeCall = _isIterateeCall;
|
|
23449
|
-
|
|
23450
|
-
/**
|
|
23451
|
-
* Checks if `predicate` returns truthy for **any** element of `collection`.
|
|
23452
|
-
* Iteration is stopped once `predicate` returns truthy. The predicate is
|
|
23453
|
-
* invoked with three arguments: (value, index|key, collection).
|
|
23454
|
-
*
|
|
23455
|
-
* @static
|
|
23456
|
-
* @memberOf _
|
|
23457
|
-
* @since 0.1.0
|
|
23458
|
-
* @category Collection
|
|
23459
|
-
* @param {Array|Object} collection The collection to iterate over.
|
|
23460
|
-
* @param {Function} [predicate=_.identity] The function invoked per iteration.
|
|
23461
|
-
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
|
|
23462
|
-
* @returns {boolean} Returns `true` if any element passes the predicate check,
|
|
23463
|
-
* else `false`.
|
|
23464
|
-
* @example
|
|
23465
|
-
*
|
|
23466
|
-
* _.some([null, 0, 'yes', false], Boolean);
|
|
23467
|
-
* // => true
|
|
23468
|
-
*
|
|
23469
|
-
* var users = [
|
|
23470
|
-
* { 'user': 'barney', 'active': true },
|
|
23471
|
-
* { 'user': 'fred', 'active': false }
|
|
23472
|
-
* ];
|
|
23473
|
-
*
|
|
23474
|
-
* // The `_.matches` iteratee shorthand.
|
|
23475
|
-
* _.some(users, { 'user': 'barney', 'active': false });
|
|
23476
|
-
* // => false
|
|
23477
|
-
*
|
|
23478
|
-
* // The `_.matchesProperty` iteratee shorthand.
|
|
23479
|
-
* _.some(users, ['active', false]);
|
|
23480
|
-
* // => true
|
|
23481
|
-
*
|
|
23482
|
-
* // The `_.property` iteratee shorthand.
|
|
23483
|
-
* _.some(users, 'active');
|
|
23484
|
-
* // => true
|
|
23485
|
-
*/
|
|
23486
|
-
function some(collection, predicate, guard) {
|
|
23487
|
-
var func = isArray(collection) ? arraySome : baseSome;
|
|
23488
|
-
if (guard && isIterateeCall(collection, predicate, guard)) {
|
|
23489
|
-
predicate = undefined;
|
|
23490
|
-
}
|
|
23491
|
-
return func(collection, baseIteratee(predicate));
|
|
23492
|
-
}
|
|
23493
|
-
|
|
23494
|
-
var some_1 = some;
|
|
23495
|
-
|
|
23496
23527
|
const Label = styled__default["default"](Text).withConfig({
|
|
23497
23528
|
displayName: "Select__Label",
|
|
23498
23529
|
componentId: "sc-1l1iaf2-0"
|
|
@@ -33339,7 +33370,12 @@ const OptionalFooterContainer = styled__default["default"](Container).withConfig
|
|
|
33339
33370
|
const ButtonContainer = styled__default["default"](Container).withConfig({
|
|
33340
33371
|
displayName: "Modal__ButtonContainer",
|
|
33341
33372
|
componentId: "sc-1lygj44-3"
|
|
33342
|
-
})(["min-width:1px;flex-basis:auto;flex-grow:1;"]
|
|
33373
|
+
})(["min-width:1px;flex-basis:auto;flex-grow:1;", ""], _ref3 => {
|
|
33374
|
+
let {
|
|
33375
|
+
$pushLeftFirstChild
|
|
33376
|
+
} = _ref3;
|
|
33377
|
+
return $pushLeftFirstChild && styled.css(["> *{&:first-child{margin-right:auto;}}"]);
|
|
33378
|
+
});
|
|
33343
33379
|
const DismissButton = styled__default["default"](Button$1).withConfig({
|
|
33344
33380
|
displayName: "Modal__DismissButton",
|
|
33345
33381
|
componentId: "sc-1lygj44-4"
|
|
@@ -33349,7 +33385,7 @@ const ConfirmButton = styled__default["default"](Button$1).withConfig({
|
|
|
33349
33385
|
componentId: "sc-1lygj44-5"
|
|
33350
33386
|
})(["flex-basis:auto;min-width:100px;flex-shrink:1;"]);
|
|
33351
33387
|
|
|
33352
|
-
const ModalFooter =
|
|
33388
|
+
const ModalFooter = _ref4 => {
|
|
33353
33389
|
let {
|
|
33354
33390
|
type,
|
|
33355
33391
|
centered,
|
|
@@ -33363,7 +33399,7 @@ const ModalFooter = _ref3 => {
|
|
|
33363
33399
|
copyLabel,
|
|
33364
33400
|
optionalFooter,
|
|
33365
33401
|
onCopyClipboard
|
|
33366
|
-
} =
|
|
33402
|
+
} = _ref4;
|
|
33367
33403
|
const secondaryButton = React.useMemo(() => {
|
|
33368
33404
|
let button;
|
|
33369
33405
|
|
|
@@ -33388,25 +33424,26 @@ const ModalFooter = _ref3 => {
|
|
|
33388
33424
|
|
|
33389
33425
|
return button;
|
|
33390
33426
|
}, [type, onCopyClipboard, copyLabel, onSecondaryAction, secondaryActionLabel, dismissLabel, onClose]);
|
|
33391
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, optionalFooter && /*#__PURE__*/React__default["default"].createElement(OptionalFooterContainer, {
|
|
33392
|
-
padding:
|
|
33427
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, optionalFooter && centered && /*#__PURE__*/React__default["default"].createElement(OptionalFooterContainer, {
|
|
33428
|
+
padding: {
|
|
33393
33429
|
bottom: 'large'
|
|
33394
|
-
} : {
|
|
33395
|
-
right: 'large'
|
|
33396
33430
|
},
|
|
33397
33431
|
orientation: "horizontal",
|
|
33398
33432
|
mainAlignment: "flex-start"
|
|
33399
33433
|
}, optionalFooter), /*#__PURE__*/React__default["default"].createElement(ButtonContainer, {
|
|
33400
33434
|
orientation: "horizontal",
|
|
33401
|
-
mainAlignment: centered ? 'center' : 'flex-end'
|
|
33402
|
-
|
|
33435
|
+
mainAlignment: centered ? 'center' : 'flex-end',
|
|
33436
|
+
$pushLeftFirstChild: optionalFooter != null && !centered
|
|
33437
|
+
}, !centered && optionalFooter, !centered && /*#__PURE__*/React__default["default"].createElement(Padding, {
|
|
33438
|
+
right: "large"
|
|
33439
|
+
}), secondaryButton, (onConfirm || onClose) && /*#__PURE__*/React__default["default"].createElement(ConfirmButton, {
|
|
33403
33440
|
color: confirmColor,
|
|
33404
33441
|
onClick: onConfirm || onClose,
|
|
33405
33442
|
label: confirmLabel
|
|
33406
33443
|
})));
|
|
33407
33444
|
};
|
|
33408
33445
|
|
|
33409
|
-
const Modal = /*#__PURE__*/React__default["default"].forwardRef(function ModalFn(
|
|
33446
|
+
const Modal = /*#__PURE__*/React__default["default"].forwardRef(function ModalFn(_ref5, ref) {
|
|
33410
33447
|
let {
|
|
33411
33448
|
background = 'gray6',
|
|
33412
33449
|
type = 'default',
|
|
@@ -33431,7 +33468,7 @@ const Modal = /*#__PURE__*/React__default["default"].forwardRef(function ModalFn
|
|
|
33431
33468
|
disablePortal = false,
|
|
33432
33469
|
zIndex = 999,
|
|
33433
33470
|
...rest
|
|
33434
|
-
} =
|
|
33471
|
+
} = _ref5;
|
|
33435
33472
|
const [delayedOpen, setDelayedOpen] = React.useState(false);
|
|
33436
33473
|
const {
|
|
33437
33474
|
windowObj
|