@elliemae/ds-pills 2.0.0-alpha.1 → 2.0.0-alpha.13
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 +53 -0
- package/cjs/components/PillButton.js +56 -0
- package/cjs/components/PillGroup.js +64 -0
- package/cjs/components/index.js +17 -0
- package/cjs/components/styled.js +85 -0
- package/cjs/components/types/DropdownPill.js +86 -0
- package/cjs/components/types/InputPill.js +74 -0
- package/cjs/components/types/LabelPill.js +46 -0
- package/cjs/components/types/ReadOnlyPill.js +50 -0
- package/cjs/components/types/RemovablePill.js +72 -0
- package/cjs/components/types/ValuePill.js +54 -0
- package/cjs/components/types/index.js +19 -0
- package/cjs/{DropdownPill.js → deprecated/DropdownPill.js} +16 -11
- package/cjs/{InputPill.js → deprecated/InputPill.js} +24 -20
- package/cjs/{LabeledDropdownPills.js → deprecated/LabeledDropdownPills.js} +8 -3
- package/cjs/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/LabeledDropdownCascadeMenuPill.js +25 -15
- package/cjs/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/LabeledDropdownMultiPill.js +28 -20
- package/cjs/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/LabeledDropdownSinglePill.js +29 -24
- package/cjs/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/utils.js +4 -2
- package/cjs/{LabeledPills.js → deprecated/LabeledPills.js} +11 -10
- package/cjs/{OverflowPill.js → deprecated/OverflowPill.js} +20 -15
- package/cjs/{Pill.js → deprecated/Pill.js} +21 -13
- package/cjs/{PillGroup.js → deprecated/PillGroup.js} +26 -18
- package/cjs/{ReadOnlyPill.js → deprecated/ReadOnlyPill.js} +33 -29
- package/cjs/{RemovablePill.js → deprecated/RemovablePill.js} +17 -17
- package/cjs/deprecated/index.js +33 -0
- package/cjs/index.d.js +2 -0
- package/cjs/index.js +19 -9
- package/cjs/props.js +69 -0
- package/cjs/utils.js +28 -0
- package/esm/components/Pill.js +44 -0
- package/esm/components/PillButton.js +46 -0
- package/esm/components/PillGroup.js +53 -0
- package/esm/components/index.js +3 -0
- package/esm/components/styled.js +67 -0
- package/esm/components/types/DropdownPill.js +76 -0
- package/esm/components/types/InputPill.js +65 -0
- package/esm/components/types/LabelPill.js +37 -0
- package/esm/components/types/ReadOnlyPill.js +41 -0
- package/esm/components/types/RemovablePill.js +63 -0
- package/esm/components/types/ValuePill.js +45 -0
- package/esm/components/types/index.js +6 -0
- package/esm/{DropdownPill.js → deprecated/DropdownPill.js} +7 -1
- package/esm/{InputPill.js → deprecated/InputPill.js} +18 -11
- package/esm/{LabeledDropdownPills.js → deprecated/LabeledDropdownPills.js} +5 -0
- package/esm/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/LabeledDropdownCascadeMenuPill.js +15 -5
- package/esm/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/LabeledDropdownMultiPill.js +10 -2
- package/esm/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/LabeledDropdownSinglePill.js +15 -8
- package/esm/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/utils.js +3 -1
- package/esm/{LabeledPills.js → deprecated/LabeledPills.js} +9 -8
- package/esm/{OverflowPill.js → deprecated/OverflowPill.js} +12 -7
- package/esm/{Pill.js → deprecated/Pill.js} +18 -10
- package/esm/{PillGroup.js → deprecated/PillGroup.js} +25 -17
- package/esm/{ReadOnlyPill.js → deprecated/ReadOnlyPill.js} +26 -21
- package/esm/{RemovablePill.js → deprecated/RemovablePill.js} +10 -9
- package/esm/deprecated/index.js +8 -0
- package/esm/index.d.js +1 -0
- package/esm/index.js +11 -8
- package/esm/props.js +60 -0
- package/esm/utils.js +24 -0
- package/package.json +120 -51
- 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/{InputPill.d.ts → deprecated/InputPill.d.ts} +0 -0
- package/types/deprecated/LabeledDropdownPills.d.ts +93 -0
- package/types/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/LabeledDropdownCascadeMenuPill.d.ts +0 -0
- package/types/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/LabeledDropdownMultiPill.d.ts +0 -0
- package/types/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/LabeledDropdownSinglePill.d.ts +0 -0
- package/types/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/utils.d.ts +1 -1
- 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 -9
- 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/package.json +0 -7
- package/esm/package.json +0 -7
- package/types/DropdownPill.d.ts +0 -31
- package/types/LabeledDropdownPills.d.ts +0 -37
- package/types/LabeledPills.d.ts +0 -27
- package/types/OverflowPill.d.ts +0 -18
- package/types/Pill.d.ts +0 -29
- package/types/PillGroup.d.ts +0 -25
- package/types/ReadOnlyPill.d.ts +0 -26
- package/types/RemovablePill.d.ts +0 -24
|
@@ -0,0 +1,46 @@
|
|
|
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 _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
8
|
+
import 'react';
|
|
9
|
+
import { describe } from 'react-desc';
|
|
10
|
+
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
|
|
11
|
+
import { StyledPillButton } from './styled.js';
|
|
12
|
+
import { DSPillButtonPropTypes, DSPillButtonDefaultProps } from '../props.js';
|
|
13
|
+
import { jsx } from 'react/jsx-runtime';
|
|
14
|
+
|
|
15
|
+
const _excluded = ["type", "children"];
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
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
|
+
const typeToClassName = {
|
|
21
|
+
only: 'ds-pill-button-only',
|
|
22
|
+
left: 'ds-pill-button-left',
|
|
23
|
+
right: 'ds-pill-button-right'
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const DSPillButton = props => {
|
|
27
|
+
const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillButtonDefaultProps);
|
|
28
|
+
useValidateTypescriptPropTypes(propsWithDefaults, DSPillButtonPropTypes);
|
|
29
|
+
|
|
30
|
+
const {
|
|
31
|
+
type,
|
|
32
|
+
children
|
|
33
|
+
} = propsWithDefaults,
|
|
34
|
+
rest = _objectWithoutProperties(propsWithDefaults, _excluded);
|
|
35
|
+
|
|
36
|
+
return /*#__PURE__*/jsx(StyledPillButton, _objectSpread(_objectSpread({}, rest), {}, {
|
|
37
|
+
buttonType: "raw",
|
|
38
|
+
className: "".concat(typeToClassName[type], " ").concat(rest.className),
|
|
39
|
+
children: children
|
|
40
|
+
}));
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const DSPillButtonWithSchema = describe(DSPillButton).description('Pill button');
|
|
44
|
+
DSPillButtonWithSchema.propTypes = DSPillButtonPropTypes;
|
|
45
|
+
|
|
46
|
+
export { DSPillButton, DSPillButtonWithSchema };
|
|
@@ -0,0 +1,53 @@
|
|
|
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.map.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
5
|
+
import React, { createContext, useMemo, useCallback } from 'react';
|
|
6
|
+
import { describe } from 'react-desc';
|
|
7
|
+
import { uid } from 'uid';
|
|
8
|
+
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
|
|
9
|
+
import { DSPillGroupPropTypes, DSPillGroupDefaultProps } from '../props.js';
|
|
10
|
+
import { StyledPillGroup } from './styled.js';
|
|
11
|
+
import { jsx } from 'react/jsx-runtime';
|
|
12
|
+
|
|
13
|
+
const DSPillGroupV2Context = /*#__PURE__*/createContext({
|
|
14
|
+
onKeyboardRemove: () => null
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const DSPillGroupV2 = props => {
|
|
18
|
+
const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillGroupDefaultProps);
|
|
19
|
+
useValidateTypescriptPropTypes(propsWithDefaults, DSPillGroupPropTypes);
|
|
20
|
+
const pillGroupUid = useMemo(() => "ds-pill-group-".concat(uid()), []);
|
|
21
|
+
const {
|
|
22
|
+
children,
|
|
23
|
+
width,
|
|
24
|
+
innerRef
|
|
25
|
+
} = propsWithDefaults;
|
|
26
|
+
const onKeyboardRemove = useCallback(pillUid => {
|
|
27
|
+
const elems = [...document.querySelectorAll("#".concat(pillGroupUid, " .ds-pill-focus-point"))];
|
|
28
|
+
const pillIndex = elems.findIndex(elem => elem.id === pillUid);
|
|
29
|
+
|
|
30
|
+
if (pillIndex > 0) {
|
|
31
|
+
elems[pillIndex - 1].focus();
|
|
32
|
+
} else if (pillIndex + 1 < elems.length) {
|
|
33
|
+
elems[pillIndex + 1].focus();
|
|
34
|
+
}
|
|
35
|
+
}, [pillGroupUid]);
|
|
36
|
+
return /*#__PURE__*/_jsx(DSPillGroupV2Context.Provider, {
|
|
37
|
+
value: {
|
|
38
|
+
onKeyboardRemove
|
|
39
|
+
}
|
|
40
|
+
}, void 0, /*#__PURE__*/jsx(StyledPillGroup, {
|
|
41
|
+
width: width,
|
|
42
|
+
id: pillGroupUid,
|
|
43
|
+
cols: React.Children.map(children, () => 'auto'),
|
|
44
|
+
gutter: "2px",
|
|
45
|
+
ref: innerRef,
|
|
46
|
+
children: children
|
|
47
|
+
}));
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const DSPillGroupV2WithSchema = describe(DSPillGroupV2);
|
|
51
|
+
DSPillGroupV2WithSchema.propTypes = DSPillGroupPropTypes;
|
|
52
|
+
|
|
53
|
+
export { DSPillGroupV2, DSPillGroupV2Context, DSPillGroupV2WithSchema };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { css } from '@elliemae/ds-system';
|
|
4
|
+
import Grid from '@elliemae/ds-grid';
|
|
5
|
+
import { DSButtonV2 } from '@elliemae/ds-button';
|
|
6
|
+
|
|
7
|
+
var _templateObject, _templateObject2;
|
|
8
|
+
// Common CSS
|
|
9
|
+
// =============================================================================
|
|
10
|
+
|
|
11
|
+
const borderOutside = function (color) {
|
|
12
|
+
let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
13
|
+
let zIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
|
|
14
|
+
let borderRadius = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '12px';
|
|
15
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n :after {\n content: ' ';\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n border: ", "px solid ", ";\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n pointer-events: none;\n z-index: ", ";\n }\n"])), size, color, borderRadius, borderRadius, borderRadius, borderRadius, zIndex);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const commonPillWrapperCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: ", ";\n\n position: relative;\n\n width: fit-content;\n\n background-color: ", ";\n\n outline: none;\n\n white-space: nowrap;\n\n padding: 0px 12px 0 12px;\n border-radius: 12px;\n\n font-size: 13px;\n line-height: 1;\n color: ", ";\n ", ";\n"])), props => (props === null || props === void 0 ? void 0 : props.size) === 'm' ? '24px' : '18px', props => props.theme.colors.brand[200], props => props.theme.colors.brand[800], props => borderOutside(props.theme.colors.brand[300])); // =============================================================================
|
|
19
|
+
// Pills wrappers
|
|
20
|
+
// =============================================================================
|
|
21
|
+
|
|
22
|
+
const StyledLabelPillWrapper = /*#__PURE__*/styled(Grid).withConfig({
|
|
23
|
+
componentId: "sc-j0tlch-0"
|
|
24
|
+
})(["", " font-weight:", ";padding-left:", ";"], commonPillWrapperCss, props => props.theme.fontWeights.semibold, props => props.hasIcon ? '0px !important' : '12px');
|
|
25
|
+
const StyledValuePillWrapper = /*#__PURE__*/styled(Grid).withConfig({
|
|
26
|
+
componentId: "sc-j0tlch-1"
|
|
27
|
+
})(["", " font-weight:", ";padding-left:", ";"], commonPillWrapperCss, props => props.theme.fontWeights.regular, props => props.hasIcon ? '0px !important' : '12px');
|
|
28
|
+
const StyledInputPillWrapper = /*#__PURE__*/styled(Grid).withConfig({
|
|
29
|
+
componentId: "sc-j0tlch-2"
|
|
30
|
+
})(["", " background:", ";padding:0;", ":focus-within{", "}:active{", "}& .em-ds-input{outline:none !important;border:none !important;box-shadow:none !important;border-radius:0 !important;height:100%;background:transparent;width:", ";padding:0;margin:0 0 0 8px;}& .em-ds-input__tooltip-ref{height:100%;}"], commonPillWrapperCss, props => props.theme.colors.neutral['000'], _ref => {
|
|
31
|
+
let {
|
|
32
|
+
value,
|
|
33
|
+
theme
|
|
34
|
+
} = _ref;
|
|
35
|
+
return borderOutside(value === '' ? theme.colors.neutral[400] : theme.colors.brand[500]);
|
|
36
|
+
}, props => props.inputHasFocus ? borderOutside(props.theme.colors.brand[700], 2) : '', props => props.inputHasFocus ? borderOutside(props.theme.colors.brand[500]) : '', props => "".concat(props.inputWidth + (props.value === '' ? 24 : 0), "px"));
|
|
37
|
+
const StyledDropdownPillWrapper = /*#__PURE__*/styled(Grid).withConfig({
|
|
38
|
+
componentId: "sc-j0tlch-3"
|
|
39
|
+
})(["", " font-weight:", ";padding:0 0 0 12px;"], commonPillWrapperCss, props => props.theme.fontWeights.semibold);
|
|
40
|
+
const StyledReadonlyPillWrapper = /*#__PURE__*/styled(Grid).withConfig({
|
|
41
|
+
componentId: "sc-j0tlch-4"
|
|
42
|
+
})(["", " font-weight:", ";padding-right:", ";padding-left:", ";"], commonPillWrapperCss, props => props.theme.fontWeights.semibold, props => props.hasIconRight ? '0 !important' : '12px', props => props.hasIconLeft ? '0 !important' : '12px');
|
|
43
|
+
const StyledRemovablePillWrapper = /*#__PURE__*/styled(Grid).withConfig({
|
|
44
|
+
componentId: "sc-j0tlch-5"
|
|
45
|
+
})(["", " font-weight:", ";padding:0 0 0 12px;"], commonPillWrapperCss, props => props.theme.fontWeights.regular); // =============================================================================
|
|
46
|
+
// Pill group
|
|
47
|
+
// =============================================================================
|
|
48
|
+
|
|
49
|
+
const StyledPillGroup = /*#__PURE__*/styled(Grid).withConfig({
|
|
50
|
+
componentId: "sc-j0tlch-6"
|
|
51
|
+
})(["width:", ";& .ds-pill-wrapper{&:not(:first-of-type){&,:after,:before,.ds-pill-tooltip-value:after{border-top-left-radius:0px;border-bottom-left-radius:0px;}}&:not(:last-of-type){&,:after,:before,.ds-pill-tooltip-value:after{border-top-right-radius:0px;border-bottom-right-radius:0px;}}}& .ds-pill-wrapper-label,& .ds-pill-wrapper-value,& .ds-pill-wrapper-readonly{&:not(:first-of-type){padding-left:8px;}&:not(:last-of-type){padding-right:8px;}}& .ds-pill-wrapper-removable:not(:first-of-type){padding-left:8px;}& .ds-pill-wrapper-dropdown:not(:first-of-type){padding-left:8px;}& .ds-pill-wrapper{:not(:first-of-type){.ds-pill-button-left{border-radius:0px;}.ds-pill-button-only{border-top-left-radius:0px;border-bottom-left-radius:0px;}}:not(:last-of-type){.ds-pill-button-right{border-radius:0px;}.ds-pill-button-only{border-top-right-radius:0px;border-bottom-right-radius:0px;}}}"], _ref2 => {
|
|
52
|
+
let {
|
|
53
|
+
width
|
|
54
|
+
} = _ref2;
|
|
55
|
+
return width;
|
|
56
|
+
}); // =============================================================================
|
|
57
|
+
// Extra stuff
|
|
58
|
+
// =============================================================================
|
|
59
|
+
|
|
60
|
+
const StyledSpanWithTooltip = /*#__PURE__*/styled.span.withConfig({
|
|
61
|
+
componentId: "sc-j0tlch-7"
|
|
62
|
+
})(["outline:none;:focus{", "}"], props => borderOutside(props.theme.colors.brand[700], 2, 3));
|
|
63
|
+
const StyledPillButton = /*#__PURE__*/styled(DSButtonV2).withConfig({
|
|
64
|
+
componentId: "sc-j0tlch-8"
|
|
65
|
+
})(["display:grid;place-items:center;position:relative;padding:0;width:", ";height:", ";border-radius:12px;:focus{", "}cursor:pointer;"], props => props.width, props => props.height, props => borderOutside(props.theme.colors.brand[700], 2, 3, 'inherit'));
|
|
66
|
+
|
|
67
|
+
export { StyledDropdownPillWrapper, StyledInputPillWrapper, StyledLabelPillWrapper, StyledPillButton, StyledPillGroup, StyledReadonlyPillWrapper, StyledRemovablePillWrapper, StyledSpanWithTooltip, StyledValuePillWrapper };
|
|
@@ -0,0 +1,76 @@
|
|
|
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 _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
+
import React, { useRef, useMemo } from 'react';
|
|
9
|
+
import { DSDropdownMenuV2 } from '@elliemae/ds-dropdownmenu';
|
|
10
|
+
import { uid } from 'uid';
|
|
11
|
+
import { ChevronSmallDown } from '@elliemae/ds-icons';
|
|
12
|
+
import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
|
|
13
|
+
import { StyledDropdownPillWrapper } from '../styled.js';
|
|
14
|
+
import { setMultipleRefs } from '../../utils.js';
|
|
15
|
+
import { DSPillButton } from '../PillButton.js';
|
|
16
|
+
import { jsx } from 'react/jsx-runtime';
|
|
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 DropdownPill = /*#__PURE__*/React.memo(_ref => {
|
|
22
|
+
let {
|
|
23
|
+
label,
|
|
24
|
+
size,
|
|
25
|
+
labelTruncated,
|
|
26
|
+
dropdownProps,
|
|
27
|
+
innerRef,
|
|
28
|
+
ariaLabel,
|
|
29
|
+
onDropdownClick
|
|
30
|
+
} = _ref;
|
|
31
|
+
const chevronRef = useRef(null);
|
|
32
|
+
const pillUid = useMemo(() => "ds-pill-".concat(uid()), []);
|
|
33
|
+
const TextComponent = labelTruncated ? _ref2 => {
|
|
34
|
+
let {
|
|
35
|
+
children
|
|
36
|
+
} = _ref2;
|
|
37
|
+
return /*#__PURE__*/_jsx(SimpleTruncatedTooltipText, {
|
|
38
|
+
value: children
|
|
39
|
+
});
|
|
40
|
+
} : React.Fragment;
|
|
41
|
+
return /*#__PURE__*/_jsx(StyledDropdownPillWrapper, {
|
|
42
|
+
size: size,
|
|
43
|
+
id: pillUid,
|
|
44
|
+
className: "ds-pill-wrapper ds-pill-wrapper-dropdown",
|
|
45
|
+
"data-testid": "ds-pill-wrapper",
|
|
46
|
+
cols: ['auto', '24px'],
|
|
47
|
+
gutter: "2px",
|
|
48
|
+
alignItems: "center",
|
|
49
|
+
justifyItems: "center"
|
|
50
|
+
}, void 0, /*#__PURE__*/_jsx(TextComponent, {}, void 0, label), /*#__PURE__*/jsx(DSDropdownMenuV2, _objectSpread(_objectSpread({
|
|
51
|
+
placementOrderPreference: ['bottom-start', 'bottom', 'bottom-end', 'right-end', 'top-start', 'top', 'top-end']
|
|
52
|
+
}, dropdownProps), {}, {
|
|
53
|
+
onClickOutside: e => {
|
|
54
|
+
if (e.code === 'Escape') chevronRef.current.focus();
|
|
55
|
+
if (dropdownProps.onClickOutside) dropdownProps.onClickOutside(e);
|
|
56
|
+
},
|
|
57
|
+
wrapperStyles: {
|
|
58
|
+
width: '100%',
|
|
59
|
+
height: '100%'
|
|
60
|
+
},
|
|
61
|
+
children: /*#__PURE__*/_jsx(DSPillButton, {
|
|
62
|
+
className: "ds-pill-focus-point",
|
|
63
|
+
"data-testid": "ds-pill-dropdown-chevron",
|
|
64
|
+
innerRef: setMultipleRefs(chevronRef, innerRef),
|
|
65
|
+
"aria-label": ariaLabel || label,
|
|
66
|
+
type: "right",
|
|
67
|
+
onClick: onDropdownClick
|
|
68
|
+
}, void 0, /*#__PURE__*/_jsx(ChevronSmallDown, {
|
|
69
|
+
color: ['brand-primary', '800'],
|
|
70
|
+
width: 20,
|
|
71
|
+
height: 20
|
|
72
|
+
}))
|
|
73
|
+
})));
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
export { DropdownPill };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
+
import React, { useRef, useMemo, useCallback, useState } from 'react';
|
|
4
|
+
import { uid } from 'uid';
|
|
5
|
+
import { CloseXsmall } from '@elliemae/ds-icons';
|
|
6
|
+
import { StyledInputPillWrapper } from '../styled.js';
|
|
7
|
+
import { setMultipleRefs } from '../../utils.js';
|
|
8
|
+
import { DSPillButton } from '../PillButton.js';
|
|
9
|
+
|
|
10
|
+
const InputPill = /*#__PURE__*/React.memo(_ref => {
|
|
11
|
+
let {
|
|
12
|
+
label,
|
|
13
|
+
size,
|
|
14
|
+
inputPlaceholder,
|
|
15
|
+
inputWidth,
|
|
16
|
+
inputRender,
|
|
17
|
+
onInputChange,
|
|
18
|
+
onInputClear,
|
|
19
|
+
innerRef
|
|
20
|
+
} = _ref;
|
|
21
|
+
const ref = useRef(null);
|
|
22
|
+
const InputComponent = useMemo(() => inputRender, [inputRender]);
|
|
23
|
+
const pillUid = useMemo(() => "ds-pill-".concat(uid()), []);
|
|
24
|
+
const onCloseIconClick = useCallback(e => {
|
|
25
|
+
if ([undefined, 'Enter', 'Space'].includes(e.code)) {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
onInputClear(e);
|
|
28
|
+
ref.current.focus();
|
|
29
|
+
}
|
|
30
|
+
}, [onInputClear]);
|
|
31
|
+
const [inputHasFocus, setInputHasFocus] = useState(false);
|
|
32
|
+
return /*#__PURE__*/_jsx(StyledInputPillWrapper, {
|
|
33
|
+
size: size,
|
|
34
|
+
className: "ds-pill-wrapper",
|
|
35
|
+
"data-testid": "ds-pill-wrapper",
|
|
36
|
+
cols: label === '' ? ['auto'] : ['auto', '24px'],
|
|
37
|
+
inputWidth: inputWidth,
|
|
38
|
+
value: label,
|
|
39
|
+
inputHasFocus: inputHasFocus
|
|
40
|
+
}, void 0, /*#__PURE__*/_jsx(InputComponent, {
|
|
41
|
+
id: pillUid,
|
|
42
|
+
className: "ds-pill-focus-point",
|
|
43
|
+
"data-testid": "ds-pill-input",
|
|
44
|
+
innerRef: setMultipleRefs(ref, innerRef),
|
|
45
|
+
value: label,
|
|
46
|
+
onChange: onInputChange,
|
|
47
|
+
placeholder: inputPlaceholder,
|
|
48
|
+
onFocus: () => setInputHasFocus(true),
|
|
49
|
+
onBlur: () => setInputHasFocus(false),
|
|
50
|
+
disableTooltip: false
|
|
51
|
+
}), label !== '' && /*#__PURE__*/_jsx(DSPillButton, {
|
|
52
|
+
id: pillUid,
|
|
53
|
+
"data-testid": "ds-pill-clear-icon",
|
|
54
|
+
innerRef: innerRef,
|
|
55
|
+
onClick: onCloseIconClick,
|
|
56
|
+
onKeyDown: onCloseIconClick,
|
|
57
|
+
"aria-label": "Clear input",
|
|
58
|
+
type: "right"
|
|
59
|
+
}, void 0, /*#__PURE__*/_jsx(CloseXsmall, {
|
|
60
|
+
size: "s",
|
|
61
|
+
color: ['brand-primary', '700']
|
|
62
|
+
})));
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export { InputPill };
|
|
@@ -0,0 +1,37 @@
|
|
|
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';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
|
|
7
|
+
import { StyledLabelPillWrapper } from '../styled.js';
|
|
8
|
+
|
|
9
|
+
const LabelPill = /*#__PURE__*/React.memo(_ref => {
|
|
10
|
+
let {
|
|
11
|
+
label,
|
|
12
|
+
size,
|
|
13
|
+
labelTruncated,
|
|
14
|
+
iconLeft,
|
|
15
|
+
ariaLabel
|
|
16
|
+
} = _ref;
|
|
17
|
+
const TextComponent = labelTruncated ? _ref2 => {
|
|
18
|
+
let {
|
|
19
|
+
children
|
|
20
|
+
} = _ref2;
|
|
21
|
+
return /*#__PURE__*/_jsx(SimpleTruncatedTooltipText, {
|
|
22
|
+
value: children
|
|
23
|
+
});
|
|
24
|
+
} : React.Fragment;
|
|
25
|
+
return /*#__PURE__*/_jsx(StyledLabelPillWrapper, {
|
|
26
|
+
size: size,
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
className: "ds-pill-wrapper ds-pill-wrapper-label",
|
|
29
|
+
"data-testid": "ds-pill-wrapper",
|
|
30
|
+
"aria-label": ariaLabel || label,
|
|
31
|
+
cols: [iconLeft && 'min-content', 'auto'].filter(notFalse => notFalse),
|
|
32
|
+
gutter: "xxxs",
|
|
33
|
+
hasIcon: iconLeft !== null
|
|
34
|
+
}, void 0, iconLeft, /*#__PURE__*/_jsx(TextComponent, {}, void 0, label));
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export { LabelPill };
|
|
@@ -0,0 +1,41 @@
|
|
|
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';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
|
|
7
|
+
import { StyledReadonlyPillWrapper } from '../styled.js';
|
|
8
|
+
|
|
9
|
+
const ReadOnlyPill = /*#__PURE__*/React.memo(_ref => {
|
|
10
|
+
let {
|
|
11
|
+
label,
|
|
12
|
+
size,
|
|
13
|
+
labelTruncated,
|
|
14
|
+
iconLeft,
|
|
15
|
+
iconRight,
|
|
16
|
+
ariaLabel
|
|
17
|
+
} = _ref;
|
|
18
|
+
const hasIconLeft = iconLeft !== null || iconRight !== null && label === '';
|
|
19
|
+
const hasIconRight = iconRight !== null || iconLeft !== null && label === '';
|
|
20
|
+
const TextComponent = labelTruncated ? _ref2 => {
|
|
21
|
+
let {
|
|
22
|
+
children
|
|
23
|
+
} = _ref2;
|
|
24
|
+
return /*#__PURE__*/_jsx(SimpleTruncatedTooltipText, {
|
|
25
|
+
value: children
|
|
26
|
+
});
|
|
27
|
+
} : React.Fragment;
|
|
28
|
+
return /*#__PURE__*/_jsx(StyledReadonlyPillWrapper, {
|
|
29
|
+
size: size,
|
|
30
|
+
alignItems: "center",
|
|
31
|
+
className: "ds-pill-wrapper ds-pill-wrapper-readonly",
|
|
32
|
+
"data-testid": "ds-pill-wrapper",
|
|
33
|
+
"aria-label": ariaLabel || label,
|
|
34
|
+
cols: [iconLeft && 'min-content', label && 'auto', iconRight && 'min-content'].filter(notFalse => notFalse),
|
|
35
|
+
gutter: "xxxs",
|
|
36
|
+
hasIconRight: hasIconRight,
|
|
37
|
+
hasIconLeft: hasIconLeft
|
|
38
|
+
}, void 0, iconLeft, label ? /*#__PURE__*/_jsx(TextComponent, {}, void 0, label) : null, iconRight);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export { ReadOnlyPill };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import React, { useContext, useMemo, useCallback } from 'react';
|
|
3
|
+
import { uid } from 'uid';
|
|
4
|
+
import { CloseXsmall } from '@elliemae/ds-icons';
|
|
5
|
+
import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
|
|
6
|
+
import { StyledRemovablePillWrapper } from '../styled.js';
|
|
7
|
+
import { DSPillGroupV2Context } from '../PillGroup.js';
|
|
8
|
+
import { DSPillButton } from '../PillButton.js';
|
|
9
|
+
|
|
10
|
+
const RemovablePill = /*#__PURE__*/React.memo(_ref => {
|
|
11
|
+
let {
|
|
12
|
+
label,
|
|
13
|
+
size,
|
|
14
|
+
labelTruncated,
|
|
15
|
+
onRemove,
|
|
16
|
+
innerRef,
|
|
17
|
+
ariaLabel
|
|
18
|
+
} = _ref;
|
|
19
|
+
const {
|
|
20
|
+
onKeyboardRemove
|
|
21
|
+
} = useContext(DSPillGroupV2Context);
|
|
22
|
+
const pillUid = useMemo(() => "ds-pill-".concat(uid()), []);
|
|
23
|
+
const TextComponent = labelTruncated ? _ref2 => {
|
|
24
|
+
let {
|
|
25
|
+
children
|
|
26
|
+
} = _ref2;
|
|
27
|
+
return /*#__PURE__*/_jsx(SimpleTruncatedTooltipText, {
|
|
28
|
+
value: children
|
|
29
|
+
});
|
|
30
|
+
} : React.Fragment;
|
|
31
|
+
const onKeyDown = useCallback(e => {
|
|
32
|
+
if (['Enter', 'Space'].includes(e.code)) {
|
|
33
|
+
e.preventDefault();
|
|
34
|
+
if (onKeyboardRemove) onKeyboardRemove(pillUid);
|
|
35
|
+
onRemove(e);
|
|
36
|
+
}
|
|
37
|
+
}, [onKeyboardRemove, onRemove, pillUid]);
|
|
38
|
+
return /*#__PURE__*/_jsx(StyledRemovablePillWrapper, {
|
|
39
|
+
size: size,
|
|
40
|
+
cols: ['auto', '24px'],
|
|
41
|
+
gutter: "2px",
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
justifyItems: "center",
|
|
44
|
+
className: "ds-pill-wrapper ds-pill-wrapper-removable",
|
|
45
|
+
"data-testid": "ds-pill-wrapper",
|
|
46
|
+
"aria-label": ariaLabel || label
|
|
47
|
+
}, void 0, /*#__PURE__*/_jsx(TextComponent, {}, void 0, label), /*#__PURE__*/_jsx(DSPillButton, {
|
|
48
|
+
className: "ds-pill-focus-point",
|
|
49
|
+
id: pillUid,
|
|
50
|
+
"data-testid": "ds-pill-close-icon",
|
|
51
|
+
innerRef: innerRef,
|
|
52
|
+
onClick: onRemove,
|
|
53
|
+
onKeyDown: onKeyDown,
|
|
54
|
+
"aria-label": "Remove ".concat(label),
|
|
55
|
+
type: "right"
|
|
56
|
+
}, void 0, /*#__PURE__*/_jsx(CloseXsmall, {
|
|
57
|
+
width: 22.65,
|
|
58
|
+
height: 22.65,
|
|
59
|
+
color: ['brand-primary', '700']
|
|
60
|
+
})));
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export { RemovablePill };
|
|
@@ -0,0 +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';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { DSTooltipV2 } from '@elliemae/ds-tooltip';
|
|
7
|
+
import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
|
|
8
|
+
import { StyledValuePillWrapper, StyledSpanWithTooltip } from '../styled.js';
|
|
9
|
+
|
|
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, {
|
|
24
|
+
value: children
|
|
25
|
+
});
|
|
26
|
+
} : React.Fragment;
|
|
27
|
+
return /*#__PURE__*/_jsx(StyledValuePillWrapper, {
|
|
28
|
+
size: size,
|
|
29
|
+
alignItems: "center",
|
|
30
|
+
className: "ds-pill-wrapper ds-pill-wrapper-value",
|
|
31
|
+
"data-testid": "ds-pill-wrapper",
|
|
32
|
+
"aria-label": ariaLabel || label,
|
|
33
|
+
cols: [iconLeft && 'min-content', 'auto'].filter(notFalse => notFalse),
|
|
34
|
+
gutter: "xxxs",
|
|
35
|
+
hasIcon: iconLeft !== null
|
|
36
|
+
}, void 0, iconLeft, tooltipValue !== '' ? /*#__PURE__*/_jsx(DSTooltipV2, {
|
|
37
|
+
title: tooltipValue,
|
|
38
|
+
triggerComponent: /*#__PURE__*/_jsx(StyledSpanWithTooltip, {
|
|
39
|
+
className: "ds-pill-tooltip-value",
|
|
40
|
+
tabIndex: 0
|
|
41
|
+
}, void 0, label)
|
|
42
|
+
}) : /*#__PURE__*/_jsx(TextComponent, {}, void 0, label));
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export { ValuePill };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { DropdownPill } from './DropdownPill.js';
|
|
2
|
+
export { InputPill } from './InputPill.js';
|
|
3
|
+
export { LabelPill } from './LabelPill.js';
|
|
4
|
+
export { ReadOnlyPill } from './ReadOnlyPill.js';
|
|
5
|
+
export { RemovablePill } from './RemovablePill.js';
|
|
6
|
+
export { ValuePill } from './ValuePill.js';
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
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';
|
|
4
10
|
import { useRef, useState } from 'react';
|
|
5
11
|
import { PropTypes, describe } from 'react-desc';
|
|
6
12
|
import DSDropdownMenu from '@elliemae/ds-dropdownmenu';
|
|
7
|
-
import ChevronDown from '@elliemae/ds-icons
|
|
13
|
+
import { ChevronDown } from '@elliemae/ds-icons';
|
|
8
14
|
import useFocusGroupItem from '@elliemae/ds-shared/FocusGroup/useFocusGroupItem';
|
|
9
15
|
import { Pill } from './Pill.js';
|
|
10
16
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -1,11 +1,15 @@
|
|
|
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';
|
|
1
6
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
7
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
8
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
4
9
|
import 'react';
|
|
5
|
-
import CloseXsmall from '@elliemae/ds-icons
|
|
10
|
+
import { CloseXsmall } from '@elliemae/ds-icons';
|
|
6
11
|
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
7
|
-
import DSInputMask from '@elliemae/ds-form
|
|
8
|
-
import DSInput from '@elliemae/ds-form/Input';
|
|
12
|
+
import { DSInput, DSInputMask } from '@elliemae/ds-form';
|
|
9
13
|
import { Pill } from './Pill.js';
|
|
10
14
|
import { jsx } from 'react/jsx-runtime';
|
|
11
15
|
|
|
@@ -14,12 +18,15 @@ const _excluded = ["containerProps", "placeholder", "onChange", "onRemove", "val
|
|
|
14
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; }
|
|
15
19
|
|
|
16
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; }
|
|
17
|
-
const StyledInputPill = aggregatedClasses(Pill)('input-pill', null,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const StyledInputPill = aggregatedClasses(Pill)('input-pill', null, _ref => {
|
|
22
|
+
let {
|
|
23
|
+
value
|
|
24
|
+
} = _ref;
|
|
25
|
+
return {
|
|
26
|
+
value
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
function InputPill(_ref2) {
|
|
23
30
|
let {
|
|
24
31
|
containerProps = {},
|
|
25
32
|
placeholder = 'Enter Value',
|
|
@@ -27,8 +34,8 @@ function InputPill(_ref) {
|
|
|
27
34
|
onRemove,
|
|
28
35
|
value,
|
|
29
36
|
type
|
|
30
|
-
} =
|
|
31
|
-
otherProps = _objectWithoutProperties(
|
|
37
|
+
} = _ref2,
|
|
38
|
+
otherProps = _objectWithoutProperties(_ref2, _excluded);
|
|
32
39
|
|
|
33
40
|
let TypeOfInput = DSInput; // TODO: implement the DSTimeInput, see how because it returns a moment()
|
|
34
41
|
// TODO: implement the DSDateInput
|
|
@@ -1,3 +1,8 @@
|
|
|
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';
|
|
1
6
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
7
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
8
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
1
3
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
3
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';
|
|
4
12
|
import { createElement } from 'react';
|
|
5
|
-
import { isFunction, addOrRemove } from '@elliemae/ds-utilities
|
|
13
|
+
import { isFunction, addOrRemove } from '@elliemae/ds-utilities';
|
|
6
14
|
import { PillGroup } from '../PillGroup.js';
|
|
7
15
|
import { RemovablePill } from '../RemovablePill.js';
|
|
8
16
|
import { DropdownPill } from '../DropdownPill.js';
|
|
@@ -66,10 +74,12 @@ function LabeledDropdownCascadeMenuPill(_ref) {
|
|
|
66
74
|
const selectionValues = selection[selectionId] || '';
|
|
67
75
|
const dropdownLabel = Array.isArray(selectionValues) ? getSubmenuOptionLabelById(options, selectionId) : selectionValues;
|
|
68
76
|
|
|
69
|
-
const handleSelectChange =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
77
|
+
const handleSelectChange = _ref2 => {
|
|
78
|
+
let {
|
|
79
|
+
item,
|
|
80
|
+
group
|
|
81
|
+
} = _ref2;
|
|
82
|
+
|
|
73
83
|
if (isFunction(onChange)) {
|
|
74
84
|
const nextSelection = group ? {
|
|
75
85
|
[group.id]: addOrRemove([...(selection[group.id] || [])], item, o => o.id)
|