@elliemae/ds-pills 1.60.0 → 2.0.0-alpha.12
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/cjs/components/Pill.js +34 -42
- package/cjs/components/PillButton.js +29 -23
- package/cjs/components/PillGroup.js +29 -37
- package/cjs/components/index.js +10 -36
- package/cjs/components/styled.js +36 -70
- package/cjs/components/types/DropdownPill.js +53 -43
- package/cjs/components/types/InputPill.js +28 -46
- package/cjs/components/types/LabelPill.js +24 -20
- package/cjs/components/types/ReadOnlyPill.js +27 -23
- package/cjs/components/types/RemovablePill.js +31 -37
- package/cjs/components/types/ValuePill.js +28 -24
- package/cjs/components/types/index.js +12 -34
- package/cjs/deprecated/DropdownPill.js +41 -44
- package/cjs/deprecated/InputPill.js +36 -27
- package/cjs/deprecated/LabeledDropdownPills.js +43 -54
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +74 -79
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +81 -116
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +95 -110
- package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js +5 -8
- package/cjs/deprecated/LabeledPills.js +19 -27
- package/cjs/deprecated/OverflowPill.js +25 -42
- package/cjs/deprecated/Pill.js +48 -38
- package/cjs/deprecated/PillGroup.js +31 -18
- package/cjs/deprecated/ReadOnlyPill.js +60 -76
- package/cjs/deprecated/RemovablePill.js +19 -26
- package/cjs/deprecated/index.js +26 -51
- package/cjs/index.d.js +0 -1
- package/cjs/index.js +36 -76
- package/cjs/props.js +21 -44
- package/cjs/utils.js +7 -4
- package/esm/components/Pill.js +21 -29
- package/esm/components/PillButton.js +27 -20
- package/esm/components/PillGroup.js +27 -35
- package/esm/components/index.js +0 -26
- package/esm/components/styled.js +36 -71
- package/esm/components/types/DropdownPill.js +48 -39
- package/esm/components/types/InputPill.js +25 -43
- package/esm/components/types/LabelPill.js +21 -18
- package/esm/components/types/ReadOnlyPill.js +24 -21
- package/esm/components/types/RemovablePill.js +26 -33
- package/esm/components/types/ValuePill.js +25 -22
- package/esm/components/types/index.js +0 -22
- package/esm/deprecated/DropdownPill.js +37 -38
- package/esm/deprecated/InputPill.js +32 -23
- package/esm/deprecated/LabeledDropdownPills.js +33 -44
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +67 -70
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +72 -105
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +84 -96
- package/esm/deprecated/LabeledDropdownPillsTypes/utils.js +5 -8
- package/esm/deprecated/LabeledPills.js +14 -22
- package/esm/deprecated/OverflowPill.js +23 -39
- package/esm/deprecated/Pill.js +43 -32
- package/esm/deprecated/PillGroup.js +30 -18
- package/esm/deprecated/ReadOnlyPill.js +59 -74
- package/esm/deprecated/RemovablePill.js +18 -25
- package/esm/deprecated/index.js +0 -25
- package/esm/index.d.js +0 -1
- package/esm/index.js +0 -40
- package/esm/props.js +21 -44
- package/esm/utils.js +7 -4
- package/package.json +157 -23
- package/types/components/Pill.d.ts +5 -0
- package/types/components/PillButton.d.ts +5 -0
- package/types/components/PillGroup.d.ts +13 -0
- package/types/components/index.d.ts +3 -0
- package/types/components/styled.d.ts +24 -0
- package/types/components/types/DropdownPill.d.ts +3 -0
- package/types/components/types/InputPill.d.ts +3 -0
- package/types/components/types/LabelPill.d.ts +3 -0
- package/types/components/types/ReadOnlyPill.d.ts +3 -0
- package/types/components/types/RemovablePill.d.ts +3 -0
- package/types/components/types/ValuePill.d.ts +3 -0
- package/types/components/types/index.d.ts +6 -0
- package/types/deprecated/DropdownPill.d.ts +75 -0
- package/types/deprecated/InputPill.d.ts +10 -0
- package/types/deprecated/LabeledDropdownPills.d.ts +93 -0
- package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.d.ts +15 -0
- package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.d.ts +13 -0
- package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.d.ts +28 -0
- package/types/deprecated/LabeledDropdownPillsTypes/utils.d.ts +1 -0
- package/types/deprecated/LabeledPills.d.ts +59 -0
- package/types/deprecated/OverflowPill.d.ts +37 -0
- package/types/deprecated/Pill.d.ts +67 -0
- package/types/deprecated/PillGroup.d.ts +56 -0
- package/types/deprecated/ReadOnlyPill.d.ts +63 -0
- package/types/deprecated/RemovablePill.d.ts +55 -0
- package/types/deprecated/index.d.ts +9 -0
- package/types/index.d.ts +3 -0
- package/types/props.d.ts +92 -0
- package/types/tests/DSPill.test.d.ts +1 -0
- package/types/tests/DSPillGroup.test.d.ts +1 -0
- package/types/tests/events/DSPill.events.keyboard.test.d.ts +1 -0
- package/types/tests/events/DSPill.events.test.d.ts +1 -0
- package/types/tests/events/DSPillGroup.events.keyboard.test.d.ts +1 -0
- package/types/tests/events/DSPillGroup.events.test.d.ts +1 -0
- package/types/utils.d.ts +4 -0
- package/cjs/components/Pill.js.map +0 -1
- package/cjs/components/PillButton.js.map +0 -1
- package/cjs/components/PillGroup.js.map +0 -1
- package/cjs/components/index.js.map +0 -1
- package/cjs/components/styled.js.map +0 -1
- package/cjs/components/types/DropdownPill.js.map +0 -1
- package/cjs/components/types/InputPill.js.map +0 -1
- package/cjs/components/types/LabelPill.js.map +0 -1
- package/cjs/components/types/ReadOnlyPill.js.map +0 -1
- package/cjs/components/types/RemovablePill.js.map +0 -1
- package/cjs/components/types/ValuePill.js.map +0 -1
- package/cjs/components/types/index.js.map +0 -1
- package/cjs/deprecated/DropdownPill.js.map +0 -1
- package/cjs/deprecated/InputPill.js.map +0 -1
- package/cjs/deprecated/LabeledDropdownPills.js.map +0 -1
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +0 -1
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +0 -1
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +0 -1
- package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js.map +0 -1
- package/cjs/deprecated/LabeledPills.js.map +0 -1
- package/cjs/deprecated/OverflowPill.js.map +0 -1
- package/cjs/deprecated/Pill.js.map +0 -1
- package/cjs/deprecated/PillGroup.js.map +0 -1
- package/cjs/deprecated/ReadOnlyPill.js.map +0 -1
- package/cjs/deprecated/RemovablePill.js.map +0 -1
- package/cjs/deprecated/index.js.map +0 -1
- package/cjs/index.d.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/props.js.map +0 -1
- package/cjs/utils.js.map +0 -1
- package/components/Pill/package.json +0 -10
- package/components/PillButton/package.json +0 -10
- package/components/PillGroup/package.json +0 -10
- package/components/package.json +0 -10
- package/components/styled/package.json +0 -10
- package/components/types/DropdownPill/package.json +0 -10
- package/components/types/InputPill/package.json +0 -10
- package/components/types/LabelPill/package.json +0 -10
- package/components/types/ReadOnlyPill/package.json +0 -10
- package/components/types/RemovablePill/package.json +0 -10
- package/components/types/ValuePill/package.json +0 -10
- package/components/types/package.json +0 -10
- package/deprecated/DropdownPill/package.json +0 -10
- package/deprecated/InputPill/package.json +0 -10
- package/deprecated/LabeledDropdownPills/package.json +0 -10
- package/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill/package.json +0 -10
- package/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill/package.json +0 -10
- package/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill/package.json +0 -10
- package/deprecated/LabeledDropdownPillsTypes/utils/package.json +0 -10
- package/deprecated/LabeledPills/package.json +0 -10
- package/deprecated/OverflowPill/package.json +0 -10
- package/deprecated/Pill/package.json +0 -10
- package/deprecated/PillGroup/package.json +0 -10
- package/deprecated/ReadOnlyPill/package.json +0 -10
- package/deprecated/RemovablePill/package.json +0 -10
- package/deprecated/package.json +0 -10
- package/esm/components/Pill.js.map +0 -1
- package/esm/components/PillButton.js.map +0 -1
- package/esm/components/PillGroup.js.map +0 -1
- package/esm/components/index.js.map +0 -1
- package/esm/components/styled.js.map +0 -1
- package/esm/components/types/DropdownPill.js.map +0 -1
- package/esm/components/types/InputPill.js.map +0 -1
- package/esm/components/types/LabelPill.js.map +0 -1
- package/esm/components/types/ReadOnlyPill.js.map +0 -1
- package/esm/components/types/RemovablePill.js.map +0 -1
- package/esm/components/types/ValuePill.js.map +0 -1
- package/esm/components/types/index.js.map +0 -1
- package/esm/deprecated/DropdownPill.js.map +0 -1
- package/esm/deprecated/InputPill.js.map +0 -1
- package/esm/deprecated/LabeledDropdownPills.js.map +0 -1
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +0 -1
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +0 -1
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +0 -1
- package/esm/deprecated/LabeledDropdownPillsTypes/utils.js.map +0 -1
- package/esm/deprecated/LabeledPills.js.map +0 -1
- package/esm/deprecated/OverflowPill.js.map +0 -1
- package/esm/deprecated/Pill.js.map +0 -1
- package/esm/deprecated/PillGroup.js.map +0 -1
- package/esm/deprecated/ReadOnlyPill.js.map +0 -1
- package/esm/deprecated/RemovablePill.js.map +0 -1
- package/esm/deprecated/index.js.map +0 -1
- package/esm/index.d.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/props.js.map +0 -1
- package/esm/utils.js.map +0 -1
- package/props/package.json +0 -10
- package/utils/package.json +0 -10
|
@@ -1,42 +1,45 @@
|
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
1
5
|
import React from 'react';
|
|
2
6
|
import { DSTooltipV2 } from '@elliemae/ds-tooltip';
|
|
3
7
|
import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
|
|
4
8
|
import { StyledValuePillWrapper, StyledSpanWithTooltip } from '../styled.js';
|
|
5
|
-
import 'styled-components';
|
|
6
|
-
import '@elliemae/ds-grid';
|
|
7
|
-
import '@elliemae/ds-button';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
const ValuePill = /*#__PURE__*/React.memo(_ref => {
|
|
11
|
+
let {
|
|
12
|
+
label,
|
|
13
|
+
size,
|
|
14
|
+
labelTruncated,
|
|
15
|
+
tooltipValue,
|
|
16
|
+
iconLeft,
|
|
17
|
+
ariaLabel
|
|
18
|
+
} = _ref;
|
|
19
|
+
const TextComponent = labelTruncated ? _ref2 => {
|
|
20
|
+
let {
|
|
21
|
+
children
|
|
22
|
+
} = _ref2;
|
|
23
|
+
return /*#__PURE__*/_jsx(SimpleTruncatedTooltipText, {
|
|
19
24
|
value: children
|
|
20
25
|
});
|
|
21
26
|
} : React.Fragment;
|
|
22
|
-
return /*#__PURE__*/
|
|
27
|
+
return /*#__PURE__*/_jsx(StyledValuePillWrapper, {
|
|
28
|
+
size: size,
|
|
23
29
|
alignItems: "center",
|
|
24
30
|
className: "ds-pill-wrapper ds-pill-wrapper-value",
|
|
25
31
|
"data-testid": "ds-pill-wrapper",
|
|
26
32
|
"aria-label": ariaLabel || label,
|
|
27
|
-
cols: [iconLeft && 'min-content', 'auto'].filter(
|
|
28
|
-
return notFalse;
|
|
29
|
-
}),
|
|
33
|
+
cols: [iconLeft && 'min-content', 'auto'].filter(notFalse => notFalse),
|
|
30
34
|
gutter: "xxxs",
|
|
31
35
|
hasIcon: iconLeft !== null
|
|
32
|
-
}, iconLeft, tooltipValue !== '' ? /*#__PURE__*/
|
|
36
|
+
}, void 0, iconLeft, tooltipValue !== '' ? /*#__PURE__*/_jsx(DSTooltipV2, {
|
|
33
37
|
title: tooltipValue,
|
|
34
|
-
triggerComponent: /*#__PURE__*/
|
|
38
|
+
triggerComponent: /*#__PURE__*/_jsx(StyledSpanWithTooltip, {
|
|
35
39
|
className: "ds-pill-tooltip-value",
|
|
36
40
|
tabIndex: 0
|
|
37
|
-
}, label)
|
|
38
|
-
}) : /*#__PURE__*/
|
|
41
|
+
}, void 0, label)
|
|
42
|
+
}) : /*#__PURE__*/_jsx(TextComponent, {}, void 0, label));
|
|
39
43
|
});
|
|
40
44
|
|
|
41
45
|
export { ValuePill };
|
|
42
|
-
//# sourceMappingURL=ValuePill.js.map
|
|
@@ -4,25 +4,3 @@ export { LabelPill } from './LabelPill.js';
|
|
|
4
4
|
export { ReadOnlyPill } from './ReadOnlyPill.js';
|
|
5
5
|
export { RemovablePill } from './RemovablePill.js';
|
|
6
6
|
export { ValuePill } from './ValuePill.js';
|
|
7
|
-
import '@babel/runtime/helpers/esm/extends';
|
|
8
|
-
import 'react';
|
|
9
|
-
import '@elliemae/ds-dropdownmenu';
|
|
10
|
-
import 'uid';
|
|
11
|
-
import '@elliemae/ds-icons';
|
|
12
|
-
import '@elliemae/ds-truncated-tooltip-text';
|
|
13
|
-
import '../styled.js';
|
|
14
|
-
import 'styled-components';
|
|
15
|
-
import '@elliemae/ds-grid';
|
|
16
|
-
import '@elliemae/ds-button';
|
|
17
|
-
import '../../utils.js';
|
|
18
|
-
import '../PillButton.js';
|
|
19
|
-
import '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
20
|
-
import 'react-desc';
|
|
21
|
-
import '@elliemae/ds-props-helpers';
|
|
22
|
-
import '../../props.js';
|
|
23
|
-
import '@elliemae/ds-form';
|
|
24
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
25
|
-
import '../PillGroup.js';
|
|
26
|
-
import '@babel/runtime/helpers/esm/toConsumableArray';
|
|
27
|
-
import '@elliemae/ds-tooltip';
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
-
import _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';
|
|
4
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
5
|
-
import
|
|
4
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
6
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
8
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
10
|
+
import { useRef, useState } from 'react';
|
|
6
11
|
import { PropTypes, describe } from 'react-desc';
|
|
7
12
|
import DSDropdownMenu from '@elliemae/ds-dropdownmenu';
|
|
8
13
|
import { ChevronDown } from '@elliemae/ds-icons';
|
|
9
14
|
import useFocusGroupItem from '@elliemae/ds-shared/FocusGroup/useFocusGroupItem';
|
|
10
15
|
import { Pill } from './Pill.js';
|
|
11
|
-
import '
|
|
16
|
+
import { jsx } from 'react/jsx-runtime';
|
|
12
17
|
|
|
13
|
-
var
|
|
18
|
+
var _ChevronDown;
|
|
19
|
+
|
|
20
|
+
const _excluded = ["containerProps", "label", "variant", "tabIndex", "closeMenuOnItemSelection", "maxWidth", "minWidth"];
|
|
14
21
|
|
|
15
22
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
16
23
|
|
|
17
24
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
18
25
|
|
|
19
26
|
function DropdownPill(_ref) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
maxWidth = _ref.maxWidth,
|
|
30
|
-
minWidth = _ref.minWidth,
|
|
27
|
+
let {
|
|
28
|
+
containerProps = {},
|
|
29
|
+
label = '',
|
|
30
|
+
variant,
|
|
31
|
+
tabIndex = -1,
|
|
32
|
+
closeMenuOnItemSelection = false,
|
|
33
|
+
maxWidth,
|
|
34
|
+
minWidth
|
|
35
|
+
} = _ref,
|
|
31
36
|
dropdownProps = _objectWithoutProperties(_ref, _excluded);
|
|
32
37
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var _useFocusGroupItem = useFocusGroupItem(ref),
|
|
41
|
-
focusFirst = _useFocusGroupItem.focusFirst;
|
|
42
|
-
|
|
43
|
-
return /*#__PURE__*/React.createElement(DSDropdownMenu, _extends({}, dropdownProps, {
|
|
38
|
+
const ref = useRef(null);
|
|
39
|
+
const [chevronEl, chevronRef] = useState();
|
|
40
|
+
const {
|
|
41
|
+
focusFirst
|
|
42
|
+
} = useFocusGroupItem(ref);
|
|
43
|
+
return /*#__PURE__*/jsx(DSDropdownMenu, _objectSpread(_objectSpread({}, dropdownProps), {}, {
|
|
44
44
|
closeMenuOnItemSelection: closeMenuOnItemSelection,
|
|
45
45
|
maxWidth: maxWidth,
|
|
46
46
|
hideIfNotVisible: true,
|
|
@@ -51,7 +51,7 @@ function DropdownPill(_ref) {
|
|
|
51
51
|
minWidth: minWidth,
|
|
52
52
|
onClose: focusFirst,
|
|
53
53
|
referenceNode: chevronEl,
|
|
54
|
-
triggerComponent: /*#__PURE__*/
|
|
54
|
+
triggerComponent: /*#__PURE__*/_jsx(Pill, {
|
|
55
55
|
"data-testid": "dropdown-pill",
|
|
56
56
|
className: "dropdown-pill",
|
|
57
57
|
containerProps: _objectSpread({
|
|
@@ -59,19 +59,20 @@ function DropdownPill(_ref) {
|
|
|
59
59
|
}, containerProps),
|
|
60
60
|
innerRef: ref,
|
|
61
61
|
label: label,
|
|
62
|
-
rightAddon: /*#__PURE__*/
|
|
63
|
-
ref: chevronRef
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
rightAddon: /*#__PURE__*/jsx("div", {
|
|
63
|
+
ref: chevronRef,
|
|
64
|
+
children: _ChevronDown || (_ChevronDown = /*#__PURE__*/_jsx(ChevronDown, {
|
|
65
|
+
className: "dropdown-pill-chevron-down",
|
|
66
|
+
"data-testid": "dropdown-pill-button"
|
|
67
|
+
}))
|
|
68
|
+
}),
|
|
68
69
|
tabIndex: tabIndex,
|
|
69
70
|
variant: variant
|
|
70
71
|
})
|
|
71
72
|
}));
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
const props = {
|
|
75
76
|
/** props injected to component wrapper */
|
|
76
77
|
containerProps: PropTypes.object.description('props injected to component wrapper'),
|
|
77
78
|
|
|
@@ -93,9 +94,7 @@ var props = {
|
|
|
93
94
|
/** pill min width */
|
|
94
95
|
minWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('pill min width')
|
|
95
96
|
};
|
|
96
|
-
|
|
97
|
-
var DSDropdownPillWithSchema = describe(DropdownPill);
|
|
97
|
+
const DSDropdownPillWithSchema = describe(DropdownPill);
|
|
98
98
|
DSDropdownPillWithSchema.propTypes = props;
|
|
99
99
|
|
|
100
100
|
export { DSDropdownPillWithSchema, DropdownPill };
|
|
101
|
-
//# sourceMappingURL=DropdownPill.js.map
|
|
@@ -1,33 +1,43 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
7
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
8
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
3
|
-
import
|
|
9
|
+
import 'react';
|
|
4
10
|
import { CloseXsmall } from '@elliemae/ds-icons';
|
|
5
11
|
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
6
12
|
import { DSInput, DSInputMask } from '@elliemae/ds-form';
|
|
7
13
|
import { Pill } from './Pill.js';
|
|
8
|
-
import '
|
|
9
|
-
import 'react-desc';
|
|
14
|
+
import { jsx } from 'react/jsx-runtime';
|
|
10
15
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
const _excluded = ["containerProps", "placeholder", "onChange", "onRemove", "value", "type"];
|
|
17
|
+
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
+
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21
|
+
const StyledInputPill = aggregatedClasses(Pill)('input-pill', null, _ref => {
|
|
22
|
+
let {
|
|
23
|
+
value
|
|
24
|
+
} = _ref;
|
|
14
25
|
return {
|
|
15
|
-
value
|
|
26
|
+
value
|
|
16
27
|
};
|
|
17
28
|
});
|
|
18
29
|
function InputPill(_ref2) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
type = _ref2.type,
|
|
30
|
+
let {
|
|
31
|
+
containerProps = {},
|
|
32
|
+
placeholder = 'Enter Value',
|
|
33
|
+
onChange = () => {},
|
|
34
|
+
onRemove,
|
|
35
|
+
value,
|
|
36
|
+
type
|
|
37
|
+
} = _ref2,
|
|
28
38
|
otherProps = _objectWithoutProperties(_ref2, _excluded);
|
|
29
39
|
|
|
30
|
-
|
|
40
|
+
let TypeOfInput = DSInput; // TODO: implement the DSTimeInput, see how because it returns a moment()
|
|
31
41
|
// TODO: implement the DSDateInput
|
|
32
42
|
|
|
33
43
|
switch (type) {
|
|
@@ -40,19 +50,19 @@ function InputPill(_ref2) {
|
|
|
40
50
|
break;
|
|
41
51
|
}
|
|
42
52
|
|
|
43
|
-
return /*#__PURE__*/
|
|
53
|
+
return /*#__PURE__*/_jsx(StyledInputPill, {
|
|
44
54
|
className: "input-pill",
|
|
45
55
|
classProps: {
|
|
46
|
-
value
|
|
56
|
+
value
|
|
47
57
|
},
|
|
48
58
|
containerProps: containerProps,
|
|
49
|
-
label: /*#__PURE__*/
|
|
59
|
+
label: /*#__PURE__*/jsx(TypeOfInput, _objectSpread({
|
|
50
60
|
"data-testid": "input-pill",
|
|
51
61
|
onChange: onChange,
|
|
52
62
|
placeholder: placeholder,
|
|
53
63
|
value: value
|
|
54
64
|
}, otherProps)),
|
|
55
|
-
rightAddon: value && /*#__PURE__*/
|
|
65
|
+
rightAddon: value && /*#__PURE__*/_jsx(CloseXsmall, {
|
|
56
66
|
className: "remove-pill-button",
|
|
57
67
|
"data-testid": "remove-pill-button",
|
|
58
68
|
onClick: onRemove
|
|
@@ -62,4 +72,3 @@ function InputPill(_ref2) {
|
|
|
62
72
|
}
|
|
63
73
|
|
|
64
74
|
export { InputPill };
|
|
65
|
-
//# sourceMappingURL=InputPill.js.map
|
|
@@ -1,61 +1,52 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
7
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
8
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
3
|
-
import
|
|
9
|
+
import 'react';
|
|
4
10
|
import { PropTypes, describe } from 'react-desc';
|
|
5
11
|
import { PillGroup } from './PillGroup.js';
|
|
6
12
|
import LabeledDropdownSinglePill from './LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js';
|
|
7
13
|
import LabeledDropdownMultiPills from './LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js';
|
|
8
14
|
import LabeledDropdownCascadeMenuPill from './LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js';
|
|
9
|
-
import '
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import '@elliemae/ds-icons';
|
|
18
|
-
import '@elliemae/ds-shared/FocusGroup/useFocusGroupItem';
|
|
19
|
-
import './Pill.js';
|
|
20
|
-
import './InputPill.js';
|
|
21
|
-
import '@elliemae/ds-form';
|
|
22
|
-
import './RemovablePill.js';
|
|
23
|
-
import './LabeledDropdownPillsTypes/utils.js';
|
|
24
|
-
import 'lodash';
|
|
25
|
-
import './OverflowPill.js';
|
|
26
|
-
import '@elliemae/ds-tooltip';
|
|
27
|
-
import '@babel/runtime/helpers/esm/toConsumableArray';
|
|
28
|
-
|
|
29
|
-
var _excluded = ["label", "value", "type", "onFocusNextGroup", "onFocusPreviousGroup", "onFocusGroupSet", "maxWidth", "minWidth", "fixed"];
|
|
30
|
-
var DropdownPills = {
|
|
15
|
+
import { jsx } from 'react/jsx-runtime';
|
|
16
|
+
|
|
17
|
+
const _excluded = ["label", "value", "type", "onFocusNextGroup", "onFocusPreviousGroup", "onFocusGroupSet", "maxWidth", "minWidth", "fixed"];
|
|
18
|
+
|
|
19
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
+
|
|
21
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
22
|
+
const DropdownPills = {
|
|
31
23
|
single: LabeledDropdownSinglePill,
|
|
32
24
|
multi: LabeledDropdownMultiPills,
|
|
33
25
|
cascaded: LabeledDropdownCascadeMenuPill
|
|
34
26
|
};
|
|
35
27
|
|
|
36
|
-
|
|
37
|
-
return DropdownPills[type] || DropdownPills.single;
|
|
38
|
-
};
|
|
28
|
+
const createDropdownPill = type => DropdownPills[type] || DropdownPills.single;
|
|
39
29
|
|
|
40
30
|
function LabeledDropdownPills(_ref) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
31
|
+
let {
|
|
32
|
+
label = '',
|
|
33
|
+
value,
|
|
34
|
+
type,
|
|
35
|
+
onFocusNextGroup,
|
|
36
|
+
onFocusPreviousGroup,
|
|
37
|
+
onFocusGroupSet,
|
|
38
|
+
maxWidth,
|
|
39
|
+
minWidth,
|
|
40
|
+
fixed
|
|
41
|
+
} = _ref,
|
|
51
42
|
menuProps = _objectWithoutProperties(_ref, _excluded);
|
|
52
43
|
|
|
53
|
-
|
|
54
|
-
return /*#__PURE__*/
|
|
44
|
+
const Component = createDropdownPill(type);
|
|
45
|
+
return /*#__PURE__*/_jsx(PillGroup, {
|
|
55
46
|
onFocusGroupSet: onFocusGroupSet,
|
|
56
47
|
onFocusNextGroup: onFocusNextGroup,
|
|
57
48
|
onFocusPreviousGroup: onFocusPreviousGroup
|
|
58
|
-
}, /*#__PURE__*/
|
|
49
|
+
}, void 0, /*#__PURE__*/jsx(Component, _objectSpread(_objectSpread({}, menuProps), {}, {
|
|
59
50
|
label: label,
|
|
60
51
|
maxWidth: maxWidth,
|
|
61
52
|
minWidth: minWidth,
|
|
@@ -64,7 +55,7 @@ function LabeledDropdownPills(_ref) {
|
|
|
64
55
|
})));
|
|
65
56
|
}
|
|
66
57
|
|
|
67
|
-
|
|
58
|
+
const props = {
|
|
68
59
|
/** pill type */
|
|
69
60
|
type: PropTypes.oneOf(['single', 'multi', 'cascaded']).description('pill type'),
|
|
70
61
|
|
|
@@ -98,9 +89,7 @@ var props = {
|
|
|
98
89
|
label: PropTypes.string
|
|
99
90
|
})]).description('pill value')
|
|
100
91
|
};
|
|
101
|
-
|
|
102
|
-
var DSLabeledDropdownPillsWithSchema = describe(LabeledDropdownPills);
|
|
92
|
+
const DSLabeledDropdownPillsWithSchema = describe(LabeledDropdownPills);
|
|
103
93
|
DSLabeledDropdownPillsWithSchema.propTypes = props;
|
|
104
94
|
|
|
105
95
|
export { DSLabeledDropdownPillsWithSchema, LabeledDropdownPills };
|
|
106
|
-
//# sourceMappingURL=LabeledDropdownPills.js.map
|
|
@@ -1,129 +1,126 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
3
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
5
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
6
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
8
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
9
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
10
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
11
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
12
|
+
import { createElement } from 'react';
|
|
6
13
|
import { isFunction, addOrRemove } from '@elliemae/ds-utilities';
|
|
7
14
|
import { PillGroup } from '../PillGroup.js';
|
|
8
15
|
import { RemovablePill } from '../RemovablePill.js';
|
|
9
16
|
import { DropdownPill } from '../DropdownPill.js';
|
|
10
|
-
import 'react-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import '@elliemae/ds-icons';
|
|
14
|
-
import '@elliemae/ds-shared/FocusGroup/useFocusGroupItem';
|
|
15
|
-
import '../Pill.js';
|
|
16
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
17
|
-
import '@elliemae/ds-dropdownmenu';
|
|
17
|
+
import { jsx } from 'react/jsx-runtime';
|
|
18
|
+
|
|
19
|
+
const _excluded = ["label", "options", "value", "onChange", "onRemove", "value", "placeholder", "onFocusNextGroup", "onFocusPreviousGroup", "onFocusGroupSet", "maxWidth", "minWidth"];
|
|
18
20
|
|
|
19
|
-
var
|
|
21
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
22
|
+
|
|
23
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
20
24
|
|
|
21
25
|
function renderMenuItems(options, factory) {
|
|
22
|
-
return options.map(
|
|
23
|
-
|
|
26
|
+
return options.map((option, index) => {
|
|
27
|
+
const ItemComponent = factory('radio');
|
|
24
28
|
|
|
25
29
|
if (option.type === 'submenu') {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return /*#__PURE__*/
|
|
30
|
+
const SubmenuComponent = factory('submenu');
|
|
31
|
+
const ChildComponent = factory('selection-group');
|
|
32
|
+
return /*#__PURE__*/createElement(SubmenuComponent, _objectSpread(_objectSpread({}, option), {}, {
|
|
29
33
|
key: option.id,
|
|
30
34
|
item: option
|
|
31
|
-
}), /*#__PURE__*/
|
|
35
|
+
}), /*#__PURE__*/jsx(ChildComponent, _objectSpread(_objectSpread({}, option), {}, {
|
|
32
36
|
id: option.id,
|
|
33
37
|
item: option,
|
|
34
38
|
items: option.items,
|
|
35
|
-
itemValueAccessor:
|
|
36
|
-
return item;
|
|
37
|
-
},
|
|
39
|
+
itemValueAccessor: item => item,
|
|
38
40
|
multi: true
|
|
39
41
|
})));
|
|
40
42
|
}
|
|
41
43
|
|
|
42
|
-
return /*#__PURE__*/
|
|
44
|
+
return /*#__PURE__*/createElement(ItemComponent, _objectSpread(_objectSpread({}, option), {}, {
|
|
43
45
|
key: option.id || index,
|
|
44
46
|
item: option
|
|
45
47
|
}));
|
|
46
48
|
});
|
|
47
49
|
}
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return option.id === id;
|
|
52
|
-
});
|
|
51
|
+
const getSubmenuOptionLabelById = (options, id) => {
|
|
52
|
+
const index = options.findIndex(option => option.id === id);
|
|
53
53
|
return index ? options[index].label : '';
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
function LabeledDropdownCascadeMenuPill(_ref) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
57
|
+
let {
|
|
58
|
+
label,
|
|
59
|
+
options,
|
|
60
|
+
value: optionValue,
|
|
61
|
+
onChange,
|
|
62
|
+
onRemove,
|
|
63
|
+
value: selection = {},
|
|
64
|
+
placeholder = '---',
|
|
65
|
+
onFocusNextGroup,
|
|
66
|
+
onFocusPreviousGroup,
|
|
67
|
+
onFocusGroupSet,
|
|
68
|
+
maxWidth,
|
|
69
|
+
minWidth
|
|
70
|
+
} = _ref,
|
|
71
71
|
menuProps = _objectWithoutProperties(_ref, _excluded);
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
const selectionId = Object.keys(selection)[0];
|
|
74
|
+
const selectionValues = selection[selectionId] || '';
|
|
75
|
+
const dropdownLabel = Array.isArray(selectionValues) ? getSubmenuOptionLabelById(options, selectionId) : selectionValues;
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
const handleSelectChange = _ref2 => {
|
|
78
|
+
let {
|
|
79
|
+
item,
|
|
80
|
+
group
|
|
81
|
+
} = _ref2;
|
|
80
82
|
|
|
81
83
|
if (isFunction(onChange)) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
84
|
+
const nextSelection = group ? {
|
|
85
|
+
[group.id]: addOrRemove([...(selection[group.id] || [])], item, o => o.id)
|
|
86
|
+
} : {
|
|
87
|
+
[item.id]: item.label
|
|
88
|
+
};
|
|
85
89
|
onChange(nextSelection);
|
|
86
90
|
}
|
|
87
91
|
};
|
|
88
92
|
|
|
89
|
-
|
|
93
|
+
const removeOption = option => {
|
|
90
94
|
if (isFunction(onChange)) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
+
const nextSelection = {
|
|
96
|
+
[selectionId]: selectionValues.filter(val => option.id !== val.id)
|
|
97
|
+
};
|
|
95
98
|
onChange(nextSelection);
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
onRemove(option);
|
|
99
102
|
};
|
|
100
103
|
|
|
101
|
-
return /*#__PURE__*/
|
|
104
|
+
return /*#__PURE__*/_jsx(PillGroup, {
|
|
102
105
|
onFocusGroupSet: onFocusGroupSet,
|
|
103
106
|
onFocusNextGroup: onFocusNextGroup,
|
|
104
107
|
onFocusPreviousGroup: onFocusPreviousGroup
|
|
105
|
-
}, /*#__PURE__*/
|
|
108
|
+
}, void 0, /*#__PURE__*/jsx(DropdownPill, _objectSpread(_objectSpread({}, menuProps), {}, {
|
|
106
109
|
itemsRenderer: renderMenuItems,
|
|
107
110
|
label: dropdownLabel || placeholder,
|
|
108
111
|
maxWidth: maxWidth,
|
|
109
112
|
minWidth: minWidth,
|
|
110
113
|
onSelectChange: handleSelectChange,
|
|
111
114
|
options: options,
|
|
112
|
-
selection:
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
+
selection: {
|
|
116
|
+
[selectionId]: Array.isArray(selectionValues) ? selectionValues.map(v => v.id) : selectionValues
|
|
117
|
+
},
|
|
115
118
|
singleGroupSelection: true,
|
|
116
119
|
variant: "title"
|
|
117
|
-
})), Array.isArray(selectionValues) && selectionValues.map(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
onRemove: function onRemove() {
|
|
122
|
-
return removeOption(option);
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
}));
|
|
120
|
+
})), Array.isArray(selectionValues) && selectionValues.map(option => /*#__PURE__*/_jsx(RemovablePill, {
|
|
121
|
+
label: option.label,
|
|
122
|
+
onRemove: () => removeOption(option)
|
|
123
|
+
}, option.id)));
|
|
126
124
|
}
|
|
127
125
|
|
|
128
126
|
export { LabeledDropdownCascadeMenuPill as default };
|
|
129
|
-
//# sourceMappingURL=LabeledDropdownCascadeMenuPill.js.map
|