@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,36 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import { useRef, useState, useEffect } from 'react';
|
|
3
7
|
import { PropTypes, describe } from 'react-desc';
|
|
4
8
|
import useFocusGroupItem from '@elliemae/ds-shared/FocusGroup/useFocusGroupItem';
|
|
5
9
|
import DSTooltip from '@elliemae/ds-tooltip';
|
|
6
10
|
import { Pill } from './Pill.js';
|
|
7
|
-
import '@babel/runtime/helpers/esm/extends';
|
|
8
|
-
import '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
9
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
10
|
-
import '@elliemae/ds-classnames';
|
|
11
11
|
|
|
12
12
|
function OverflowPill(_ref) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
setTooltipIsOpen = _useState2[1];
|
|
25
|
-
|
|
26
|
-
var _useState3 = useState(''),
|
|
27
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
28
|
-
tooltipText = _useState4[0],
|
|
29
|
-
setTooltipText = _useState4[1];
|
|
30
|
-
|
|
31
|
-
useEffect(function () {
|
|
32
|
-
var text = '';
|
|
33
|
-
options.forEach(function (option) {
|
|
13
|
+
let {
|
|
14
|
+
containerProps = {},
|
|
15
|
+
label = '',
|
|
16
|
+
options = []
|
|
17
|
+
} = _ref;
|
|
18
|
+
const ref = useRef(null);
|
|
19
|
+
const [tooltipIsOpen, setTooltipIsOpen] = useState(false);
|
|
20
|
+
const [tooltipText, setTooltipText] = useState('');
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
let text = '';
|
|
23
|
+
options.forEach(option => {
|
|
34
24
|
if (!tooltipText || option === options[0]) {
|
|
35
25
|
text = "".concat(option.label);
|
|
36
26
|
} else {
|
|
@@ -40,27 +30,23 @@ function OverflowPill(_ref) {
|
|
|
40
30
|
setTooltipText(text);
|
|
41
31
|
}, [options]);
|
|
42
32
|
useFocusGroupItem(ref);
|
|
43
|
-
return /*#__PURE__*/
|
|
33
|
+
return /*#__PURE__*/_jsx(DSTooltip, {
|
|
44
34
|
isOpen: tooltipIsOpen,
|
|
45
35
|
title: tooltipText,
|
|
46
36
|
zIndex: 11,
|
|
47
|
-
triggerComponent: /*#__PURE__*/
|
|
37
|
+
triggerComponent: /*#__PURE__*/_jsx(Pill, {
|
|
48
38
|
className: "overflow-pill",
|
|
49
39
|
containerProps: containerProps,
|
|
50
40
|
innerRef: ref,
|
|
51
41
|
label: label,
|
|
52
42
|
tabIndex: -1,
|
|
53
|
-
onMouseEnter:
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
onMouseLeave: function onMouseLeave() {
|
|
57
|
-
return setTooltipIsOpen(false);
|
|
58
|
-
}
|
|
43
|
+
onMouseEnter: () => setTooltipIsOpen(true),
|
|
44
|
+
onMouseLeave: () => setTooltipIsOpen(false)
|
|
59
45
|
})
|
|
60
46
|
});
|
|
61
47
|
}
|
|
62
48
|
|
|
63
|
-
|
|
49
|
+
const props = {
|
|
64
50
|
/** props to inject to pill wrapper */
|
|
65
51
|
containerProps: PropTypes.object.description('props to inject to pill wrapper'),
|
|
66
52
|
|
|
@@ -70,9 +56,7 @@ var props = {
|
|
|
70
56
|
/** overflow pills options */
|
|
71
57
|
options: PropTypes.array.description('overflow pills options')
|
|
72
58
|
};
|
|
73
|
-
|
|
74
|
-
var DSOverflowPillWithSchema = describe(OverflowPill);
|
|
59
|
+
const DSOverflowPillWithSchema = describe(OverflowPill);
|
|
75
60
|
DSOverflowPillWithSchema.propTypes = props;
|
|
76
61
|
|
|
77
62
|
export { DSOverflowPillWithSchema, OverflowPill };
|
|
78
|
-
//# sourceMappingURL=OverflowPill.js.map
|
package/esm/deprecated/Pill.js
CHANGED
|
@@ -1,44 +1,57 @@
|
|
|
1
|
-
import
|
|
2
|
-
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';
|
|
3
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
4
|
-
import
|
|
7
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
9
|
+
import 'react';
|
|
5
10
|
import { PropTypes, describe } from 'react-desc';
|
|
6
11
|
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
12
|
+
import { jsxs } from 'react/jsx-runtime';
|
|
13
|
+
|
|
14
|
+
const _excluded = ["containerProps", "label", "leftAddon", "rightAddon", "variant", "size"];
|
|
7
15
|
|
|
8
|
-
var
|
|
9
|
-
var pillBlockName = 'pill';
|
|
10
|
-
var PillWrapper = aggregatedClasses('div')(pillBlockName, null, function (_ref) {
|
|
11
|
-
var _ref2;
|
|
16
|
+
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; }
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
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; }
|
|
19
|
+
const pillBlockName = 'pill';
|
|
20
|
+
const PillWrapper = aggregatedClasses('div')(pillBlockName, null, _ref => {
|
|
21
|
+
let {
|
|
22
|
+
size,
|
|
23
|
+
variant
|
|
24
|
+
} = _ref;
|
|
25
|
+
return {
|
|
26
|
+
[variant]: !!variant,
|
|
27
|
+
[size]: !!size
|
|
28
|
+
};
|
|
16
29
|
});
|
|
17
|
-
|
|
18
|
-
|
|
30
|
+
const PillLabel = aggregatedClasses('span')(pillBlockName, 'label');
|
|
31
|
+
const PillAddon = aggregatedClasses('div')(pillBlockName, 'addon');
|
|
19
32
|
|
|
20
|
-
function Pill(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
size = _ref3$size === void 0 ? 'm' : _ref3$size,
|
|
31
|
-
otherProps = _objectWithoutProperties(_ref3, _excluded);
|
|
33
|
+
function Pill(_ref2) {
|
|
34
|
+
let {
|
|
35
|
+
containerProps = {},
|
|
36
|
+
label = '',
|
|
37
|
+
leftAddon,
|
|
38
|
+
rightAddon,
|
|
39
|
+
variant = 'value',
|
|
40
|
+
size = 'm'
|
|
41
|
+
} = _ref2,
|
|
42
|
+
otherProps = _objectWithoutProperties(_ref2, _excluded);
|
|
32
43
|
|
|
33
|
-
return /*#__PURE__*/
|
|
44
|
+
return /*#__PURE__*/jsxs(PillWrapper, _objectSpread(_objectSpread(_objectSpread({}, containerProps), {}, {
|
|
34
45
|
classProps: {
|
|
35
|
-
variant
|
|
36
|
-
size
|
|
46
|
+
variant,
|
|
47
|
+
size
|
|
37
48
|
}
|
|
38
|
-
}, otherProps),
|
|
49
|
+
}, otherProps), {}, {
|
|
50
|
+
children: [leftAddon && /*#__PURE__*/_jsx(PillAddon, {}, void 0, leftAddon), /*#__PURE__*/_jsx(PillLabel, {}, void 0, label), rightAddon && /*#__PURE__*/_jsx(PillAddon, {}, void 0, rightAddon)]
|
|
51
|
+
}));
|
|
39
52
|
}
|
|
40
53
|
|
|
41
|
-
|
|
54
|
+
const props = {
|
|
42
55
|
/** props to inject to pill wrapper */
|
|
43
56
|
containerProps: PropTypes.object.description('props to inject to pill wrapper'),
|
|
44
57
|
|
|
@@ -57,9 +70,7 @@ var props = {
|
|
|
57
70
|
/** addon component to right */
|
|
58
71
|
rightAddon: PropTypes.node.description('addon component to right')
|
|
59
72
|
};
|
|
60
|
-
|
|
61
|
-
var DSPillWithSchema = describe(Pill);
|
|
73
|
+
const DSPillWithSchema = describe(Pill);
|
|
62
74
|
DSPillWithSchema.propTypes = props;
|
|
63
75
|
|
|
64
76
|
export { DSPillWithSchema, Pill, Pill as default };
|
|
65
|
-
//# sourceMappingURL=Pill.js.map
|
|
@@ -1,19 +1,31 @@
|
|
|
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';
|
|
8
|
+
import 'react';
|
|
2
9
|
import { PropTypes, describe } from 'react-desc';
|
|
3
10
|
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
4
11
|
import FocusGroupProvider from '@elliemae/ds-shared/FocusGroup/FocusGroupManager';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
import { jsx } from 'react/jsx-runtime';
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
const pillGroupBlockName = 'pill-group';
|
|
18
|
+
const Container = aggregatedClasses('div')(pillGroupBlockName);
|
|
19
|
+
|
|
20
|
+
const PillGroup = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
containerProps = {},
|
|
23
|
+
onFocusNextGroup,
|
|
24
|
+
onFocusPreviousGroup,
|
|
25
|
+
onFocusGroupSet,
|
|
26
|
+
children
|
|
27
|
+
} = _ref;
|
|
28
|
+
return /*#__PURE__*/_jsx(FocusGroupProvider, {
|
|
17
29
|
keyBindings: {
|
|
18
30
|
Tab: 'next'
|
|
19
31
|
},
|
|
@@ -21,10 +33,12 @@ var PillGroup = function PillGroup(_ref) {
|
|
|
21
33
|
onFocusNextGroup: onFocusNextGroup,
|
|
22
34
|
onFocusPreviousGroup: onFocusPreviousGroup,
|
|
23
35
|
orientation: "horizontal"
|
|
24
|
-
}, /*#__PURE__*/
|
|
36
|
+
}, void 0, /*#__PURE__*/jsx(Container, _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
37
|
+
children: children
|
|
38
|
+
})));
|
|
25
39
|
};
|
|
26
40
|
|
|
27
|
-
|
|
41
|
+
const props = {
|
|
28
42
|
/** props injected to component wrapper */
|
|
29
43
|
containerProps: PropTypes.object.description('props injected to component wrapper'),
|
|
30
44
|
|
|
@@ -40,9 +54,7 @@ var props = {
|
|
|
40
54
|
/** pill components */
|
|
41
55
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired.description('pill components')
|
|
42
56
|
};
|
|
43
|
-
|
|
44
|
-
var DSPillGroupWithSchema = describe(PillGroup);
|
|
57
|
+
const DSPillGroupWithSchema = describe(PillGroup);
|
|
45
58
|
DSPillGroupWithSchema.propTypes = props;
|
|
46
59
|
|
|
47
60
|
export { Container, DSPillGroupWithSchema, PillGroup };
|
|
48
|
-
//# sourceMappingURL=PillGroup.js.map
|
|
@@ -1,86 +1,73 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
+
import { useRef, useState } from 'react';
|
|
3
4
|
import { PropTypes, describe } from 'react-desc';
|
|
4
5
|
import { InfoCircleSmall } from '@elliemae/ds-icons';
|
|
5
6
|
import DSModal, { MODAL_TYPE_V2 } from '@elliemae/ds-modal';
|
|
6
7
|
import Popover from '@elliemae/ds-popover';
|
|
7
8
|
import { Pill } from './Pill.js';
|
|
8
|
-
import '
|
|
9
|
-
import '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
10
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
11
|
-
import '@elliemae/ds-classnames';
|
|
9
|
+
import { jsxs, Fragment } from 'react/jsx-runtime';
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var ref = useRef(null);
|
|
11
|
+
const ReadOnlyPill = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
containerProps = {},
|
|
14
|
+
modalContent = '',
|
|
15
|
+
label = '',
|
|
16
|
+
leftAddon,
|
|
17
|
+
modalTitle = '',
|
|
18
|
+
tooltipText = ''
|
|
19
|
+
} = _ref;
|
|
20
|
+
const ref = useRef(null);
|
|
21
|
+
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
22
|
+
const [isTooltipOpen, setIsTooltipOpen] = useState(false);
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
-
isModalOpen = _useState2[0],
|
|
30
|
-
setIsModalOpen = _useState2[1];
|
|
31
|
-
|
|
32
|
-
var _useState3 = useState(false),
|
|
33
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
34
|
-
isTooltipOpen = _useState4[0],
|
|
35
|
-
setIsTooltipOpen = _useState4[1];
|
|
36
|
-
|
|
37
|
-
var toggle = function toggle() {
|
|
24
|
+
const toggle = () => {
|
|
38
25
|
setIsModalOpen(!isModalOpen);
|
|
39
26
|
};
|
|
40
27
|
|
|
41
|
-
return /*#__PURE__*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
28
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
29
|
+
children: [/*#__PURE__*/_jsx(Pill, {
|
|
30
|
+
"data-testid": "read-only-pill",
|
|
31
|
+
className: "removable-pill",
|
|
32
|
+
containerProps: containerProps,
|
|
33
|
+
innerRef: ref,
|
|
34
|
+
label: label,
|
|
35
|
+
leftAddon: leftAddon,
|
|
36
|
+
rightAddon: /*#__PURE__*/_jsx(Popover, {
|
|
37
|
+
isOpen: tooltipText && isTooltipOpen,
|
|
38
|
+
content: tooltipText,
|
|
39
|
+
placement: "top",
|
|
40
|
+
showArrow: true,
|
|
41
|
+
renderTrigger: _ref2 => {
|
|
42
|
+
let {
|
|
43
|
+
ref
|
|
44
|
+
} = _ref2;
|
|
45
|
+
return /*#__PURE__*/_jsx(InfoCircleSmall, {
|
|
46
|
+
role: "button",
|
|
47
|
+
"data-testid": "read-only-info-btn",
|
|
48
|
+
className: "remove-pill-button",
|
|
49
|
+
onClick: toggle,
|
|
50
|
+
onMouseEnter: () => setIsTooltipOpen(true),
|
|
51
|
+
onMouseLeave: () => setIsTooltipOpen(false),
|
|
52
|
+
color: ['brand-primary', '600'],
|
|
53
|
+
innerRef: ref
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}),
|
|
57
|
+
tabIndex: -1
|
|
58
|
+
}), /*#__PURE__*/_jsx(DSModal, {
|
|
59
|
+
isOpen: isModalOpen,
|
|
60
|
+
showClose: true,
|
|
61
|
+
shouldCloseOnOverlayClick: true,
|
|
62
|
+
modalTitle: modalTitle,
|
|
63
|
+
modalType: MODAL_TYPE_V2.INFORMATION,
|
|
64
|
+
onClose: toggle,
|
|
65
|
+
version: 2
|
|
66
|
+
}, void 0, modalContent)]
|
|
67
|
+
});
|
|
81
68
|
};
|
|
82
69
|
|
|
83
|
-
|
|
70
|
+
const props = {
|
|
84
71
|
/** props injected to component wrapper */
|
|
85
72
|
containerProps: PropTypes.object.description('props injected to component wrapper'),
|
|
86
73
|
|
|
@@ -97,9 +84,7 @@ var props = {
|
|
|
97
84
|
modalTitle: PropTypes.string.description('read only pill modal title'),
|
|
98
85
|
tooltipText: PropTypes.string.description('text to display in tooltip')
|
|
99
86
|
};
|
|
100
|
-
|
|
101
|
-
var DSReadOnlyPillWithSchema = describe(ReadOnlyPill);
|
|
87
|
+
const DSReadOnlyPillWithSchema = describe(ReadOnlyPill);
|
|
102
88
|
DSReadOnlyPillWithSchema.propTypes = props;
|
|
103
89
|
|
|
104
90
|
export { DSReadOnlyPillWithSchema, ReadOnlyPill };
|
|
105
|
-
//# sourceMappingURL=ReadOnlyPill.js.map
|
|
@@ -1,29 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import { useRef } from 'react';
|
|
2
3
|
import { PropTypes, describe } from 'react-desc';
|
|
3
4
|
import { isFunction } from '@elliemae/ds-utilities';
|
|
4
5
|
import { CloseXsmall } from '@elliemae/ds-icons';
|
|
5
6
|
import useFocusGroupItem from '@elliemae/ds-shared/FocusGroup/useFocusGroupItem';
|
|
6
7
|
import { Pill } from './Pill.js';
|
|
7
|
-
import '@babel/runtime/helpers/esm/extends';
|
|
8
|
-
import '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
9
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
10
|
-
import '@elliemae/ds-classnames';
|
|
11
8
|
|
|
12
9
|
function RemovablePill(_ref) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return /*#__PURE__*/React.createElement(Pill, {
|
|
10
|
+
let {
|
|
11
|
+
containerProps = {},
|
|
12
|
+
label = '',
|
|
13
|
+
onRemove,
|
|
14
|
+
size = 'm',
|
|
15
|
+
leftAddon
|
|
16
|
+
} = _ref;
|
|
17
|
+
const ref = useRef(null);
|
|
18
|
+
const {
|
|
19
|
+
focusPrevious
|
|
20
|
+
} = useFocusGroupItem(ref);
|
|
21
|
+
return /*#__PURE__*/_jsx(Pill, {
|
|
27
22
|
className: "removable-pill",
|
|
28
23
|
"data-testid": "removable-pill",
|
|
29
24
|
containerProps: containerProps,
|
|
@@ -31,13 +26,13 @@ function RemovablePill(_ref) {
|
|
|
31
26
|
size: size,
|
|
32
27
|
label: label,
|
|
33
28
|
leftAddon: leftAddon,
|
|
34
|
-
onKeyDown:
|
|
29
|
+
onKeyDown: e => {
|
|
35
30
|
if (e.key === 'Backspace' && isFunction(onRemove)) {
|
|
36
31
|
onRemove();
|
|
37
32
|
if (isFunction(focusPrevious)) focusPrevious();
|
|
38
33
|
}
|
|
39
34
|
},
|
|
40
|
-
rightAddon: /*#__PURE__*/
|
|
35
|
+
rightAddon: /*#__PURE__*/_jsx(CloseXsmall, {
|
|
41
36
|
role: "button",
|
|
42
37
|
"data-testid": "remove-pill-button",
|
|
43
38
|
className: "remove-pill-button",
|
|
@@ -47,7 +42,7 @@ function RemovablePill(_ref) {
|
|
|
47
42
|
});
|
|
48
43
|
}
|
|
49
44
|
|
|
50
|
-
|
|
45
|
+
const props = {
|
|
51
46
|
/** props injected to component wrapper */
|
|
52
47
|
containerProps: PropTypes.object.description('props injected to component wrapper'),
|
|
53
48
|
|
|
@@ -63,9 +58,7 @@ var props = {
|
|
|
63
58
|
/** addon component to left */
|
|
64
59
|
leftAddon: PropTypes.node.description('addon component to left')
|
|
65
60
|
};
|
|
66
|
-
|
|
67
|
-
var DSRemovablePillWithSchema = describe(RemovablePill);
|
|
61
|
+
const DSRemovablePillWithSchema = describe(RemovablePill);
|
|
68
62
|
DSRemovablePillWithSchema.propTypes = props;
|
|
69
63
|
|
|
70
64
|
export { DSRemovablePillWithSchema, RemovablePill };
|
|
71
|
-
//# sourceMappingURL=RemovablePill.js.map
|
package/esm/deprecated/index.js
CHANGED
|
@@ -6,28 +6,3 @@ export { DSDropdownPillWithSchema, DropdownPill } from './DropdownPill.js';
|
|
|
6
6
|
export { DSRemovablePillWithSchema, RemovablePill } from './RemovablePill.js';
|
|
7
7
|
export { DSReadOnlyPillWithSchema, ReadOnlyPill } from './ReadOnlyPill.js';
|
|
8
8
|
export { DSOverflowPillWithSchema, OverflowPill } from './OverflowPill.js';
|
|
9
|
-
import '@babel/runtime/helpers/esm/extends';
|
|
10
|
-
import '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
11
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
12
|
-
import 'react';
|
|
13
|
-
import 'react-desc';
|
|
14
|
-
import '@elliemae/ds-classnames';
|
|
15
|
-
import '@elliemae/ds-shared/FocusGroup/FocusGroupManager';
|
|
16
|
-
import './LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js';
|
|
17
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
18
|
-
import 'prop-types';
|
|
19
|
-
import '@elliemae/ds-utilities';
|
|
20
|
-
import './InputPill.js';
|
|
21
|
-
import '@elliemae/ds-icons';
|
|
22
|
-
import '@elliemae/ds-form';
|
|
23
|
-
import './LabeledDropdownPillsTypes/utils.js';
|
|
24
|
-
import 'lodash';
|
|
25
|
-
import '@elliemae/ds-dropdownmenu';
|
|
26
|
-
import '@elliemae/ds-shared/FocusGroup/useFocusGroupItem';
|
|
27
|
-
import './LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js';
|
|
28
|
-
import '@elliemae/ds-tooltip';
|
|
29
|
-
import './LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js';
|
|
30
|
-
import '@babel/runtime/helpers/esm/toConsumableArray';
|
|
31
|
-
import '@elliemae/ds-modal';
|
|
32
|
-
import '@elliemae/ds-popover';
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
package/esm/index.d.js
CHANGED
package/esm/index.js
CHANGED
|
@@ -9,43 +9,3 @@ export { DSOverflowPillWithSchema, OverflowPill } from './deprecated/OverflowPil
|
|
|
9
9
|
export { DSPillV2, DSPillV2WithSchema } from './components/Pill.js';
|
|
10
10
|
export { DSPillGroupV2, DSPillGroupV2Context, DSPillGroupV2WithSchema } from './components/PillGroup.js';
|
|
11
11
|
export { DSPillButton, DSPillButtonWithSchema } from './components/PillButton.js';
|
|
12
|
-
import '@babel/runtime/helpers/esm/extends';
|
|
13
|
-
import '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
14
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
15
|
-
import 'react';
|
|
16
|
-
import 'react-desc';
|
|
17
|
-
import '@elliemae/ds-classnames';
|
|
18
|
-
import '@elliemae/ds-shared/FocusGroup/FocusGroupManager';
|
|
19
|
-
import './deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js';
|
|
20
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
21
|
-
import 'prop-types';
|
|
22
|
-
import '@elliemae/ds-utilities';
|
|
23
|
-
import './deprecated/InputPill.js';
|
|
24
|
-
import '@elliemae/ds-icons';
|
|
25
|
-
import '@elliemae/ds-form';
|
|
26
|
-
import './deprecated/LabeledDropdownPillsTypes/utils.js';
|
|
27
|
-
import 'lodash';
|
|
28
|
-
import './deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js';
|
|
29
|
-
import './deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js';
|
|
30
|
-
import '@babel/runtime/helpers/esm/toConsumableArray';
|
|
31
|
-
import '@elliemae/ds-dropdownmenu';
|
|
32
|
-
import '@elliemae/ds-shared/FocusGroup/useFocusGroupItem';
|
|
33
|
-
import '@elliemae/ds-modal';
|
|
34
|
-
import '@elliemae/ds-popover';
|
|
35
|
-
import '@elliemae/ds-tooltip';
|
|
36
|
-
import '@elliemae/ds-props-helpers';
|
|
37
|
-
import './props.js';
|
|
38
|
-
import './components/types/DropdownPill.js';
|
|
39
|
-
import 'uid';
|
|
40
|
-
import '@elliemae/ds-truncated-tooltip-text';
|
|
41
|
-
import './components/styled.js';
|
|
42
|
-
import 'styled-components';
|
|
43
|
-
import '@elliemae/ds-grid';
|
|
44
|
-
import '@elliemae/ds-button';
|
|
45
|
-
import './utils.js';
|
|
46
|
-
import './components/types/InputPill.js';
|
|
47
|
-
import './components/types/LabelPill.js';
|
|
48
|
-
import './components/types/ReadOnlyPill.js';
|
|
49
|
-
import './components/types/RemovablePill.js';
|
|
50
|
-
import './components/types/ValuePill.js';
|
|
51
|
-
//# sourceMappingURL=index.js.map
|