@elliemae/ds-pills 1.57.0-rc.3 → 1.57.0-rc.4
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 +2 -3
- package/cjs/components/Pill.js.map +1 -1
- package/cjs/components/PillButton.js +1 -1
- package/cjs/components/index.js +2 -3
- package/cjs/components/index.js.map +1 -1
- package/cjs/components/types/DropdownPill.js +3 -4
- package/cjs/components/types/DropdownPill.js.map +1 -1
- package/cjs/components/types/InputPill.js +3 -4
- package/cjs/components/types/InputPill.js.map +1 -1
- package/cjs/components/types/RemovablePill.js +3 -4
- package/cjs/components/types/RemovablePill.js.map +1 -1
- package/cjs/components/types/index.js +2 -3
- package/cjs/components/types/index.js.map +1 -1
- package/cjs/deprecated/DropdownPill.js +2 -3
- package/cjs/deprecated/DropdownPill.js.map +1 -1
- package/cjs/deprecated/InputPill.js +6 -10
- package/cjs/deprecated/InputPill.js.map +1 -1
- package/cjs/deprecated/LabeledDropdownPills.js +3 -7
- package/cjs/deprecated/LabeledDropdownPills.js.map +1 -1
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +5 -6
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +1 -1
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +5 -6
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +1 -1
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +7 -13
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +1 -1
- package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js +2 -2
- package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js.map +1 -1
- package/cjs/deprecated/LabeledPills.js +2 -2
- package/cjs/deprecated/ReadOnlyPill.js +2 -3
- package/cjs/deprecated/ReadOnlyPill.js.map +1 -1
- package/cjs/deprecated/RemovablePill.js +5 -6
- package/cjs/deprecated/RemovablePill.js.map +1 -1
- package/cjs/deprecated/index.js +3 -8
- package/cjs/deprecated/index.js.map +1 -1
- package/cjs/index.js +3 -9
- package/cjs/index.js.map +1 -1
- package/cjs/props.js +2 -6
- package/cjs/props.js.map +1 -1
- package/esm/components/Pill.js +2 -3
- package/esm/components/Pill.js.map +1 -1
- package/esm/components/PillButton.js +1 -1
- package/esm/components/index.js +2 -3
- package/esm/components/index.js.map +1 -1
- package/esm/components/types/DropdownPill.js +3 -3
- package/esm/components/types/DropdownPill.js.map +1 -1
- package/esm/components/types/InputPill.js +2 -2
- package/esm/components/types/InputPill.js.map +1 -1
- package/esm/components/types/RemovablePill.js +2 -2
- package/esm/components/types/RemovablePill.js.map +1 -1
- package/esm/components/types/index.js +2 -3
- package/esm/components/types/index.js.map +1 -1
- package/esm/deprecated/DropdownPill.js +1 -1
- package/esm/deprecated/DropdownPill.js.map +1 -1
- package/esm/deprecated/InputPill.js +2 -3
- package/esm/deprecated/InputPill.js.map +1 -1
- package/esm/deprecated/LabeledDropdownPills.js +3 -7
- package/esm/deprecated/LabeledDropdownPills.js.map +1 -1
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +2 -3
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +1 -1
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +2 -3
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +1 -1
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +3 -7
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +1 -1
- package/esm/deprecated/LabeledDropdownPillsTypes/utils.js +1 -1
- package/esm/deprecated/LabeledDropdownPillsTypes/utils.js.map +1 -1
- package/esm/deprecated/LabeledPills.js +2 -2
- package/esm/deprecated/ReadOnlyPill.js +1 -1
- package/esm/deprecated/ReadOnlyPill.js.map +1 -1
- package/esm/deprecated/RemovablePill.js +2 -2
- package/esm/deprecated/RemovablePill.js.map +1 -1
- package/esm/deprecated/index.js +3 -8
- package/esm/deprecated/index.js.map +1 -1
- package/esm/index.js +3 -9
- package/esm/index.js.map +1 -1
- package/esm/props.js +1 -1
- package/esm/props.js.map +1 -1
- package/package.json +12 -12
package/cjs/components/Pill.js
CHANGED
|
@@ -12,11 +12,11 @@ var components_types_LabelPill = require('./types/LabelPill.js');
|
|
|
12
12
|
var components_types_ReadOnlyPill = require('./types/ReadOnlyPill.js');
|
|
13
13
|
var components_types_RemovablePill = require('./types/RemovablePill.js');
|
|
14
14
|
var components_types_ValuePill = require('./types/ValuePill.js');
|
|
15
|
-
require('@elliemae/ds-form
|
|
15
|
+
require('@elliemae/ds-form');
|
|
16
16
|
require('@babel/runtime/helpers/extends');
|
|
17
17
|
require('@elliemae/ds-dropdownmenu');
|
|
18
18
|
require('uid');
|
|
19
|
-
require('@elliemae/ds-icons
|
|
19
|
+
require('@elliemae/ds-icons');
|
|
20
20
|
require('@elliemae/ds-truncated-tooltip-text');
|
|
21
21
|
require('./styled.js');
|
|
22
22
|
require('styled-components');
|
|
@@ -26,7 +26,6 @@ require('../utils.js');
|
|
|
26
26
|
require('./PillButton.js');
|
|
27
27
|
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
28
28
|
require('@babel/runtime/helpers/slicedToArray');
|
|
29
|
-
require('@elliemae/ds-icons/CloseXsmall');
|
|
30
29
|
require('./PillGroup.js');
|
|
31
30
|
require('@babel/runtime/helpers/toConsumableArray');
|
|
32
31
|
require('@elliemae/ds-tooltip');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pill.js","sources":["../../../src/components/Pill.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { describe } from 'react-desc';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { DSPillProps } from '../index.d';\nimport { DSPillV2DefaultProps, DSPillV2PropTypes } from '../props';\nimport { DropdownPill, LabelPill, ValuePill, InputPill, ReadOnlyPill, RemovablePill } from './types';\n\nconst pillComponentGetter: Record<string, React.ComponentType<DSPillProps>> = {\n dropdown: DropdownPill,\n input: InputPill,\n label: LabelPill,\n readonly: ReadOnlyPill,\n removable: RemovablePill,\n value: ValuePill,\n};\n\nconst DSPillV2: React.ComponentType<DSPillProps> = (props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillV2DefaultProps);\n useValidateTypescriptPropTypes(propsWithDefaults, DSPillV2WithSchema.toTypescript());\n const { type } = propsWithDefaults;\n const PillComponent = pillComponentGetter[type];\n\n return <PillComponent {...propsWithDefaults} />;\n};\n\nDSPillV2.propTypes = DSPillV2PropTypes;\nconst DSPillV2WithSchema = describe(DSPillV2).description('Pill');\nDSPillV2WithSchema.propTypes = DSPillV2PropTypes;\n\nexport { DSPillV2, DSPillV2WithSchema };\n"],"names":["pillComponentGetter","dropdown","DropdownPill","input","InputPill","label","LabelPill","readonly","ReadOnlyPill","removable","RemovablePill","value","ValuePill","DSPillV2","props","propsWithDefaults","useMemoMergePropsWithDefault","DSPillV2DefaultProps","useValidateTypescriptPropTypes","DSPillV2WithSchema","toTypescript","type","PillComponent","React","propTypes","DSPillV2PropTypes","describe","description"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Pill.js","sources":["../../../src/components/Pill.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { describe } from 'react-desc';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { DSPillProps } from '../index.d';\nimport { DSPillV2DefaultProps, DSPillV2PropTypes } from '../props';\nimport { DropdownPill, LabelPill, ValuePill, InputPill, ReadOnlyPill, RemovablePill } from './types';\n\nconst pillComponentGetter: Record<string, React.ComponentType<DSPillProps>> = {\n dropdown: DropdownPill,\n input: InputPill,\n label: LabelPill,\n readonly: ReadOnlyPill,\n removable: RemovablePill,\n value: ValuePill,\n};\n\nconst DSPillV2: React.ComponentType<DSPillProps> = (props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillV2DefaultProps);\n useValidateTypescriptPropTypes(propsWithDefaults, DSPillV2WithSchema.toTypescript());\n const { type } = propsWithDefaults;\n const PillComponent = pillComponentGetter[type];\n\n return <PillComponent {...propsWithDefaults} />;\n};\n\nDSPillV2.propTypes = DSPillV2PropTypes;\nconst DSPillV2WithSchema = describe(DSPillV2).description('Pill');\nDSPillV2WithSchema.propTypes = DSPillV2PropTypes;\n\nexport { DSPillV2, DSPillV2WithSchema };\n"],"names":["pillComponentGetter","dropdown","DropdownPill","input","InputPill","label","LabelPill","readonly","ReadOnlyPill","removable","RemovablePill","value","ValuePill","DSPillV2","props","propsWithDefaults","useMemoMergePropsWithDefault","DSPillV2DefaultProps","useValidateTypescriptPropTypes","DSPillV2WithSchema","toTypescript","type","PillComponent","React","propTypes","DSPillV2PropTypes","describe","description"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAQA,IAAMA,mBAAqE,GAAG;AAC5EC,EAAAA,QAAQ,EAAEC,0CADkE;AAE5EC,EAAAA,KAAK,EAAEC,oCAFqE;AAG5EC,EAAAA,KAAK,EAAEC,oCAHqE;AAI5EC,EAAAA,QAAQ,EAAEC,0CAJkE;AAK5EC,EAAAA,SAAS,EAAEC,4CALiE;AAM5EC,EAAAA,KAAK,EAAEC;AANqE,CAA9E;;IASMC,QAA0C,GAAG,SAA7CA,QAA6C,CAACC,OAAD,EAAW;AAC5D,MAAMC,iBAAiB,GAAGC,2CAA4B,CAACF,OAAD,EAAQG,0BAAR,CAAtD;AACAC,EAAAA,6CAA8B,CAACH,iBAAD,EAAoBI,kBAAkB,CAACC,YAAnB,EAApB,CAA9B;AACA,MAAQC,IAAR,GAAiBN,iBAAjB,CAAQM,IAAR;AACA,MAAMC,aAAa,GAAGtB,mBAAmB,CAACqB,IAAD,CAAzC;AAEA,sBAAOE,wCAAC,aAAD,EAAmBR,iBAAnB,CAAP;AACD;;AAEDF,QAAQ,CAACW,SAAT,GAAqBC,uBAArB;IACMN,kBAAkB,GAAGO,kBAAQ,CAACb,QAAD,CAAR,CAAmBc,WAAnB,CAA+B,MAA/B;AAC3BR,kBAAkB,CAACK,SAAnB,GAA+BC,uBAA/B;;;;;"}
|
|
@@ -12,7 +12,7 @@ var props = require('../props.js');
|
|
|
12
12
|
require('styled-components');
|
|
13
13
|
require('@elliemae/ds-grid');
|
|
14
14
|
require('@elliemae/ds-button');
|
|
15
|
-
require('@elliemae/ds-form
|
|
15
|
+
require('@elliemae/ds-form');
|
|
16
16
|
|
|
17
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
18
|
|
package/cjs/components/index.js
CHANGED
|
@@ -9,12 +9,12 @@ require('react');
|
|
|
9
9
|
require('react-desc');
|
|
10
10
|
require('@elliemae/ds-props-helpers');
|
|
11
11
|
require('../props.js');
|
|
12
|
-
require('@elliemae/ds-form
|
|
12
|
+
require('@elliemae/ds-form');
|
|
13
13
|
require('./types/DropdownPill.js');
|
|
14
14
|
require('@babel/runtime/helpers/extends');
|
|
15
15
|
require('@elliemae/ds-dropdownmenu');
|
|
16
16
|
require('uid');
|
|
17
|
-
require('@elliemae/ds-icons
|
|
17
|
+
require('@elliemae/ds-icons');
|
|
18
18
|
require('@elliemae/ds-truncated-tooltip-text');
|
|
19
19
|
require('./styled.js');
|
|
20
20
|
require('styled-components');
|
|
@@ -24,7 +24,6 @@ require('../utils.js');
|
|
|
24
24
|
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
25
25
|
require('./types/InputPill.js');
|
|
26
26
|
require('@babel/runtime/helpers/slicedToArray');
|
|
27
|
-
require('@elliemae/ds-icons/CloseXsmall');
|
|
28
27
|
require('./types/LabelPill.js');
|
|
29
28
|
require('./types/ReadOnlyPill.js');
|
|
30
29
|
require('./types/RemovablePill.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -6,7 +6,7 @@ var _extends = require('@babel/runtime/helpers/extends');
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var DSDropdownMenu = require('@elliemae/ds-dropdownmenu');
|
|
8
8
|
var uid = require('uid');
|
|
9
|
-
var
|
|
9
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
10
10
|
var dsTruncatedTooltipText = require('@elliemae/ds-truncated-tooltip-text');
|
|
11
11
|
var components_styled = require('../styled.js');
|
|
12
12
|
var utils = require('../../utils.js');
|
|
@@ -18,14 +18,13 @@ require('@babel/runtime/helpers/objectWithoutProperties');
|
|
|
18
18
|
require('react-desc');
|
|
19
19
|
require('@elliemae/ds-props-helpers');
|
|
20
20
|
require('../../props.js');
|
|
21
|
-
require('@elliemae/ds-form
|
|
21
|
+
require('@elliemae/ds-form');
|
|
22
22
|
|
|
23
23
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
24
|
|
|
25
25
|
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
26
26
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
27
27
|
var DSDropdownMenu__default = /*#__PURE__*/_interopDefaultLegacy(DSDropdownMenu);
|
|
28
|
-
var ChevronDown__default = /*#__PURE__*/_interopDefaultLegacy(ChevronDown);
|
|
29
28
|
|
|
30
29
|
var DropdownPill = /*#__PURE__*/React__default['default'].memo(function (_ref) {
|
|
31
30
|
var label = _ref.label,
|
|
@@ -61,7 +60,7 @@ var DropdownPill = /*#__PURE__*/React__default['default'].memo(function (_ref) {
|
|
|
61
60
|
innerRef: utils.setMultipleRefs(chevronRef, innerRef),
|
|
62
61
|
"aria-label": ariaLabel || label,
|
|
63
62
|
type: "right"
|
|
64
|
-
}, /*#__PURE__*/React__default['default'].createElement(
|
|
63
|
+
}, /*#__PURE__*/React__default['default'].createElement(dsIcons.ChevronSmallDown, {
|
|
65
64
|
color: ['brand-primary', '700'],
|
|
66
65
|
size: "s"
|
|
67
66
|
}))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownPill.js","sources":["../../../../src/components/types/DropdownPill.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React, { useMemo, useRef } from 'react';\nimport DSDropdownMenu from '@elliemae/ds-dropdownmenu';\nimport { uid } from 'uid';\nimport
|
|
1
|
+
{"version":3,"file":"DropdownPill.js","sources":["../../../../src/components/types/DropdownPill.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React, { useMemo, useRef } from 'react';\nimport DSDropdownMenu from '@elliemae/ds-dropdownmenu';\nimport { uid } from 'uid';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { StyledDropdownPillWrapper } from '../styled';\nimport type { DSPillProps } from '../../index.d';\nimport { setMultipleRefs } from '../../utils';\nimport { DSPillButton } from '../PillButton';\n\nexport const DropdownPill = React.memo<DSPillProps>(({ label, dropdownProps, innerRef, ariaLabel }) => {\n const chevronRef = useRef(null);\n\n const pillUid = useMemo(() => `ds-pill-${uid()}`, []);\n\n return (\n <StyledDropdownPillWrapper\n id={pillUid}\n className=\"ds-pill-wrapper ds-pill-wrapper-dropdown\"\n data-testid=\"ds-pill-wrapper\"\n cols={['auto', '24px']}\n gutter=\"2px\"\n alignItems=\"center\"\n justifyItems=\"center\"\n >\n <SimpleTruncatedTooltipText value={label} />\n <DSDropdownMenu\n hideIfNotVisible\n onClose={() => chevronRef.current.focus()}\n menuProps={{ zIndex: 100 }}\n {...dropdownProps}\n triggerComponent={\n <DSPillButton\n className=\"ds-pill-focus-point\"\n data-testid=\"ds-pill-dropdown-chevron\"\n innerRef={setMultipleRefs(chevronRef, innerRef)}\n aria-label={ariaLabel || label}\n type=\"right\"\n >\n <ChevronSmallDown color={['brand-primary', '700']} size=\"s\" />\n </DSPillButton>\n }\n />\n </StyledDropdownPillWrapper>\n );\n});\n"],"names":["DropdownPill","React","memo","label","dropdownProps","innerRef","ariaLabel","chevronRef","useRef","pillUid","useMemo","uid","StyledDropdownPillWrapper","SimpleTruncatedTooltipText","DSDropdownMenu","current","focus","zIndex","DSPillButton","setMultipleRefs","ChevronSmallDown"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;IAWaA,YAAY,gBAAGC,yBAAK,CAACC,IAAN,CAAwB,gBAAmD;AAAA,MAAhDC,KAAgD,QAAhDA,KAAgD;AAAA,MAAzCC,aAAyC,QAAzCA,aAAyC;AAAA,MAA1BC,QAA0B,QAA1BA,QAA0B;AAAA,MAAhBC,SAAgB,QAAhBA,SAAgB;AACrG,MAAMC,UAAU,GAAGC,YAAM,CAAC,IAAD,CAAzB;AAEA,MAAMC,OAAO,GAAGC,aAAO,CAAC;AAAA,6BAAiBC,OAAG,EAApB;AAAA,GAAD,EAA2B,EAA3B,CAAvB;AAEA,sBACEV,wCAACW,2CAAD;AACE,IAAA,EAAE,EAAEH,OADN;AAEE,IAAA,SAAS,EAAC,0CAFZ;AAGE,mBAAY,iBAHd;AAIE,IAAA,IAAI,EAAE,CAAC,MAAD,EAAS,MAAT,CAJR;AAKE,IAAA,MAAM,EAAC,KALT;AAME,IAAA,UAAU,EAAC,QANb;AAOE,IAAA,YAAY,EAAC;AAPf,kBASER,wCAACY,iDAAD;AAA4B,IAAA,KAAK,EAAEV;AAAnC,IATF,eAUEF,wCAACa,kCAAD;AACE,IAAA,gBAAgB,MADlB;AAEE,IAAA,OAAO,EAAE;AAAA,aAAMP,UAAU,CAACQ,OAAX,CAAmBC,KAAnB,EAAN;AAAA,KAFX;AAGE,IAAA,SAAS,EAAE;AAAEC,MAAAA,MAAM,EAAE;AAAV;AAHb,KAIMb,aAJN;AAKE,IAAA,gBAAgB,eACdH,wCAACiB,kCAAD;AACE,MAAA,SAAS,EAAC,qBADZ;AAEE,qBAAY,0BAFd;AAGE,MAAA,QAAQ,EAAEC,qBAAe,CAACZ,UAAD,EAAaF,QAAb,CAH3B;AAIE,oBAAYC,SAAS,IAAIH,KAJ3B;AAKE,MAAA,IAAI,EAAC;AALP,oBAOEF,wCAACmB,wBAAD;AAAkB,MAAA,KAAK,EAAE,CAAC,eAAD,EAAkB,KAAlB,CAAzB;AAAmD,MAAA,IAAI,EAAC;AAAxD,MAPF;AANJ,KAVF,CADF;AA8BD,CAnC2B;;;;"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var uid = require('uid');
|
|
8
|
-
var
|
|
8
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
9
9
|
var components_styled = require('../styled.js');
|
|
10
10
|
var utils = require('../../utils.js');
|
|
11
11
|
var components_PillButton = require('../PillButton.js');
|
|
@@ -17,13 +17,12 @@ require('@babel/runtime/helpers/objectWithoutProperties');
|
|
|
17
17
|
require('react-desc');
|
|
18
18
|
require('@elliemae/ds-props-helpers');
|
|
19
19
|
require('../../props.js');
|
|
20
|
-
require('@elliemae/ds-form
|
|
20
|
+
require('@elliemae/ds-form');
|
|
21
21
|
|
|
22
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
23
|
|
|
24
24
|
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
25
25
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
26
|
-
var CloseXsmall__default = /*#__PURE__*/_interopDefaultLegacy(CloseXsmall);
|
|
27
26
|
|
|
28
27
|
var InputPill = /*#__PURE__*/React__default['default'].memo(function (_ref) {
|
|
29
28
|
var label = _ref.label,
|
|
@@ -83,7 +82,7 @@ var InputPill = /*#__PURE__*/React__default['default'].memo(function (_ref) {
|
|
|
83
82
|
onKeyDown: onCloseIconClick,
|
|
84
83
|
"aria-label": "Clear input",
|
|
85
84
|
type: "right"
|
|
86
|
-
}, /*#__PURE__*/React__default['default'].createElement(
|
|
85
|
+
}, /*#__PURE__*/React__default['default'].createElement(dsIcons.CloseXsmall, {
|
|
87
86
|
size: "s",
|
|
88
87
|
color: ['brand-primary', '700']
|
|
89
88
|
})));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputPill.js","sources":["../../../../src/components/types/InputPill.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { uid } from 'uid';\nimport
|
|
1
|
+
{"version":3,"file":"InputPill.js","sources":["../../../../src/components/types/InputPill.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { uid } from 'uid';\nimport { CloseXsmall } from '@elliemae/ds-icons';\nimport type { DSPillProps } from '../../index.d';\nimport { StyledInputPillWrapper } from '../styled';\nimport { setMultipleRefs } from '../../utils';\nimport { DSPillButton } from '../PillButton';\n\nexport const InputPill = React.memo<DSPillProps>(\n ({ label, inputPlaceholder, inputWidth, inputRender, onInputChange, onInputClear, innerRef }) => {\n const ref = useRef<HTMLElement>(null);\n\n const InputComponent = useMemo(() => inputRender, [inputRender]);\n\n const pillUid = useMemo(() => `ds-pill-${uid()}`, []);\n\n const onCloseIconClick: React.MouseEventHandler & React.KeyboardEventHandler = useCallback(\n (e) => {\n if ([undefined, 'Enter', 'Space'].includes(e.code)) {\n e.preventDefault();\n onInputClear(e);\n ref.current.focus();\n }\n },\n [onInputClear],\n );\n\n const [inputHasFocus, setInputHasFocus] = useState(false);\n\n return (\n <StyledInputPillWrapper\n className=\"ds-pill-wrapper\"\n data-testid=\"ds-pill-wrapper\"\n cols={label === '' ? ['auto'] : ['auto', '24px']}\n inputWidth={inputWidth}\n value={label}\n inputHasFocus={inputHasFocus}\n >\n <InputComponent\n id={pillUid}\n className=\"ds-pill-focus-point\"\n data-testid=\"ds-pill-input\"\n innerRef={setMultipleRefs(ref, innerRef)}\n value={label}\n onChange={onInputChange}\n placeholder={inputPlaceholder}\n onFocus={() => setInputHasFocus(true)}\n onBlur={() => setInputHasFocus(false)}\n disableTooltip={false}\n />\n {label !== '' && (\n <DSPillButton\n id={pillUid}\n data-testid=\"ds-pill-clear-icon\"\n innerRef={innerRef}\n onClick={onCloseIconClick}\n onKeyDown={onCloseIconClick}\n aria-label=\"Clear input\"\n type=\"right\"\n >\n <CloseXsmall size=\"s\" color={['brand-primary', '700']} />\n </DSPillButton>\n )}\n </StyledInputPillWrapper>\n );\n },\n);\n"],"names":["InputPill","React","memo","label","inputPlaceholder","inputWidth","inputRender","onInputChange","onInputClear","innerRef","ref","useRef","InputComponent","useMemo","pillUid","uid","onCloseIconClick","useCallback","e","undefined","includes","code","preventDefault","current","focus","useState","inputHasFocus","setInputHasFocus","StyledInputPillWrapper","setMultipleRefs","DSPillButton","CloseXsmall"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;IASaA,SAAS,gBAAGC,yBAAK,CAACC,IAAN,CACvB,gBAAiG;AAAA,MAA9FC,KAA8F,QAA9FA,KAA8F;AAAA,MAAvFC,gBAAuF,QAAvFA,gBAAuF;AAAA,MAArEC,UAAqE,QAArEA,UAAqE;AAAA,MAAzDC,WAAyD,QAAzDA,WAAyD;AAAA,MAA5CC,aAA4C,QAA5CA,aAA4C;AAAA,MAA7BC,YAA6B,QAA7BA,YAA6B;AAAA,MAAfC,QAAe,QAAfA,QAAe;AAC/F,MAAMC,GAAG,GAAGC,YAAM,CAAc,IAAd,CAAlB;AAEA,MAAMC,cAAc,GAAGC,aAAO,CAAC;A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M,EAAE;AAAA,aAAMA,gBAAgB,CAAC,KAAD,CAAtB;AAAA,KATV;AAUE,IAAA,cAAc,EAAE;AAVlB,IARF,EAoBGxB,KAAK,KAAK,EAAV,iBACCF,wCAAC6B,kCAAD;AACE,IAAA,EAAE,EAAEhB,OADN;AAEE,mBAAY,oBAFd;AAGE,IAAA,QAAQ,EAAEL,QAHZ;AAIE,IAAA,OAAO,EAAEO,gBAJX;AAKE,IAAA,SAAS,EAAEA,gBALb;AAME,kBAAW,aANb;AAOE,IAAA,IAAI,EAAC;AAPP,kBASEf,wCAAC8B,mBAAD;AAAa,IAAA,IAAI,EAAC,GAAlB;AAAsB,IAAA,KAAK,EAAE,CAAC,eAAD,EAAkB,KAAlB;AAA7B,IATF,CArBJ,CADF;AAoCD,CAzDsB;;;;"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var uid = require('uid');
|
|
7
|
-
var
|
|
7
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
8
8
|
var dsTruncatedTooltipText = require('@elliemae/ds-truncated-tooltip-text');
|
|
9
9
|
var components_styled = require('../styled.js');
|
|
10
10
|
var components_PillGroup = require('../PillGroup.js');
|
|
@@ -18,12 +18,11 @@ require('@babel/runtime/helpers/extends');
|
|
|
18
18
|
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
19
19
|
require('@elliemae/ds-props-helpers');
|
|
20
20
|
require('../../props.js');
|
|
21
|
-
require('@elliemae/ds-form
|
|
21
|
+
require('@elliemae/ds-form');
|
|
22
22
|
|
|
23
23
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
24
|
|
|
25
25
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
26
|
-
var CloseXsmall__default = /*#__PURE__*/_interopDefaultLegacy(CloseXsmall);
|
|
27
26
|
|
|
28
27
|
/* eslint-disable react/prop-types */
|
|
29
28
|
var RemovablePill = /*#__PURE__*/React__default['default'].memo(function (_ref) {
|
|
@@ -64,7 +63,7 @@ var RemovablePill = /*#__PURE__*/React__default['default'].memo(function (_ref)
|
|
|
64
63
|
onKeyDown: onKeyDown,
|
|
65
64
|
"aria-label": "Remove ".concat(label),
|
|
66
65
|
type: "right"
|
|
67
|
-
}, /*#__PURE__*/React__default['default'].createElement(
|
|
66
|
+
}, /*#__PURE__*/React__default['default'].createElement(dsIcons.CloseXsmall, {
|
|
68
67
|
size: "s",
|
|
69
68
|
color: ['brand-primary', '700']
|
|
70
69
|
})));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemovablePill.js","sources":["../../../../src/components/types/RemovablePill.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport { uid } from 'uid';\nimport
|
|
1
|
+
{"version":3,"file":"RemovablePill.js","sources":["../../../../src/components/types/RemovablePill.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport { uid } from 'uid';\nimport { CloseXsmall } from '@elliemae/ds-icons';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport type { DSPillProps } from '../../index.d';\nimport { StyledRemovablePillWrapper } from '../styled';\nimport { DSPillGroupV2Context } from '../PillGroup';\nimport { DSPillButton } from '../PillButton';\n\nexport const RemovablePill = React.memo<DSPillProps>(({ label, onRemove, innerRef, ariaLabel }) => {\n const { onKeyboardRemove } = useContext(DSPillGroupV2Context);\n const pillUid = useMemo(() => `ds-pill-${uid()}`, []);\n\n const onKeyDown: React.MouseEventHandler & React.KeyboardEventHandler = useCallback(\n (e) => {\n if (['Enter', 'Space'].includes(e.code)) {\n e.preventDefault();\n if (onKeyboardRemove) onKeyboardRemove(pillUid);\n onRemove(e);\n }\n },\n [onKeyboardRemove, onRemove, pillUid],\n );\n\n return (\n <StyledRemovablePillWrapper\n cols={['auto', '24px']}\n gutter=\"2px\"\n alignItems=\"center\"\n justifyItems=\"center\"\n className=\"ds-pill-wrapper ds-pill-wrapper-removable\"\n data-testid=\"ds-pill-wrapper\"\n aria-label={ariaLabel || label}\n >\n <SimpleTruncatedTooltipText value={label} />\n <DSPillButton\n className=\"ds-pill-focus-point\"\n id={pillUid}\n data-testid=\"ds-pill-close-icon\"\n innerRef={innerRef}\n onClick={onRemove}\n onKeyDown={onKeyDown}\n aria-label={`Remove ${label}`}\n type=\"right\"\n >\n <CloseXsmall size=\"s\" color={['brand-primary', '700']} />\n </DSPillButton>\n </StyledRemovablePillWrapper>\n );\n});\n"],"names":["RemovablePill","React","memo","label","onRemove","innerRef","ariaLabel","useContext","DSPillGroupV2Context","onKeyboardRemove","pillUid","useMemo","uid","onKeyDown","useCallback","e","includes","code","preventDefault","StyledRemovablePillWrapper","SimpleTruncatedTooltipText","DSPillButton","CloseXsmall"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;IAUaA,aAAa,gBAAGC,yBAAK,CAACC,IAAN,CAAwB,gBAA8C;AAAA,MAA3CC,KAA2C,QAA3CA,KAA2C;AAAA,MAApCC,QAAoC,QAApCA,QAAoC;AAAA,MAA1BC,QAA0B,QAA1BA,QAA0B;AAAA,MAAhBC,SAAgB,QAAhBA,SAAgB;;AACjG,oBAA6BC,gBAAU,CAACC,yCAAD,CAAvC;AAAA,MAAQC,gBAAR,eAAQA,gBAAR;;AACA,MAAMC,OAAO,GAAGC,aAAO,CAAC;AAAA,6BAAiBC,OAAG,EAApB;AAAA,GAAD,EAA2B,EAA3B,CAAvB;AAEA,MAAMC,SAA+D,GAAGC,iBAAW,CACjF,UAACC,CAAD,EAAO;AACL,QAAI,CAAC,OAAD,EAAU,OAAV,EAAmBC,QAAnB,CAA4BD,CAAC,CAACE,IAA9B,CAAJ,EAAyC;AACvCF,MAAAA,CAAC,CAACG,cAAF;AACA,UAAIT,gBAAJ,EAAsBA,gBAAgB,CAACC,OAAD,CAAhB;AACtBN,MAAAA,QAAQ,CAACW,CAAD,CAAR;AACD;AACF,GAPgF,EAQjF,CAACN,gBAAD,EAAmBL,QAAnB,EAA6BM,OAA7B,CARiF,CAAnF;AAWA,sBACET,wCAACkB,4CAAD;AACE,IAAA,IAAI,EAAE,CAAC,MAAD,EAAS,MAAT,CADR;AAEE,IAAA,MAAM,EAAC,KAFT;AAGE,IAAA,UAAU,EAAC,QAHb;AAIE,IAAA,YAAY,EAAC,QAJf;AAKE,IAAA,SAAS,EAAC,2CALZ;AAME,mBAAY,iBANd;AAOE,kBAAYb,SAAS,IAAIH;AAP3B,kBASEF,wCAACmB,iDAAD;AAA4B,IAAA,KAAK,EAAEjB;AAAnC,IATF,eAUEF,wCAACoB,kCAAD;AACE,IAAA,SAAS,EAAC,qBADZ;AAEE,IAAA,EAAE,EAAEX,OAFN;AAGE,mBAAY,oBAHd;AAIE,IAAA,QAAQ,EAAEL,QAJZ;AAKE,IAAA,OAAO,EAAED,QALX;AAME,IAAA,SAAS,EAAES,SANb;AAOE,mCAAsBV,KAAtB,CAPF;AAQE,IAAA,IAAI,EAAC;AARP,kBAUEF,wCAACqB,mBAAD;AAAa,IAAA,IAAI,EAAC,GAAlB;AAAsB,IAAA,KAAK,EAAE,CAAC,eAAD,EAAkB,KAAlB;AAA7B,IAVF,CAVF,CADF;AAyBD,CAxC4B;;;;"}
|
|
@@ -12,7 +12,7 @@ require('@babel/runtime/helpers/extends');
|
|
|
12
12
|
require('react');
|
|
13
13
|
require('@elliemae/ds-dropdownmenu');
|
|
14
14
|
require('uid');
|
|
15
|
-
require('@elliemae/ds-icons
|
|
15
|
+
require('@elliemae/ds-icons');
|
|
16
16
|
require('@elliemae/ds-truncated-tooltip-text');
|
|
17
17
|
require('../styled.js');
|
|
18
18
|
require('styled-components');
|
|
@@ -24,9 +24,8 @@ require('@babel/runtime/helpers/objectWithoutProperties');
|
|
|
24
24
|
require('react-desc');
|
|
25
25
|
require('@elliemae/ds-props-helpers');
|
|
26
26
|
require('../../props.js');
|
|
27
|
-
require('@elliemae/ds-form
|
|
27
|
+
require('@elliemae/ds-form');
|
|
28
28
|
require('@babel/runtime/helpers/slicedToArray');
|
|
29
|
-
require('@elliemae/ds-icons/CloseXsmall');
|
|
30
29
|
require('../PillGroup.js');
|
|
31
30
|
require('@babel/runtime/helpers/toConsumableArray');
|
|
32
31
|
require('@elliemae/ds-tooltip');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -9,7 +9,7 @@ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProp
|
|
|
9
9
|
var React = require('react');
|
|
10
10
|
var reactDesc = require('react-desc');
|
|
11
11
|
var DSDropdownMenu = require('@elliemae/ds-dropdownmenu');
|
|
12
|
-
var
|
|
12
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
13
13
|
var useFocusGroupItem = require('@elliemae/ds-shared/FocusGroup/useFocusGroupItem');
|
|
14
14
|
var deprecated_Pill = require('./Pill.js');
|
|
15
15
|
require('@elliemae/ds-classnames');
|
|
@@ -22,7 +22,6 @@ var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray)
|
|
|
22
22
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
23
23
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
24
|
var DSDropdownMenu__default = /*#__PURE__*/_interopDefaultLegacy(DSDropdownMenu);
|
|
25
|
-
var ChevronDown__default = /*#__PURE__*/_interopDefaultLegacy(ChevronDown);
|
|
26
25
|
var useFocusGroupItem__default = /*#__PURE__*/_interopDefaultLegacy(useFocusGroupItem);
|
|
27
26
|
|
|
28
27
|
var _excluded = ["containerProps", "label", "variant", "tabIndex", "closeMenuOnItemSelection", "maxWidth", "minWidth"];
|
|
@@ -76,7 +75,7 @@ function DropdownPill(_ref) {
|
|
|
76
75
|
label: label,
|
|
77
76
|
rightAddon: /*#__PURE__*/React__default['default'].createElement("div", {
|
|
78
77
|
ref: chevronRef
|
|
79
|
-
}, /*#__PURE__*/React__default['default'].createElement(
|
|
78
|
+
}, /*#__PURE__*/React__default['default'].createElement(dsIcons.ChevronDown, {
|
|
80
79
|
className: "dropdown-pill-chevron-down",
|
|
81
80
|
"data-testid": "dropdown-pill-button"
|
|
82
81
|
})),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownPill.js","sources":["../../../src/deprecated/DropdownPill.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport DSDropdownMenu from '@elliemae/ds-dropdownmenu';\nimport ChevronDown from '@elliemae/ds-icons
|
|
1
|
+
{"version":3,"file":"DropdownPill.js","sources":["../../../src/deprecated/DropdownPill.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport DSDropdownMenu from '@elliemae/ds-dropdownmenu';\nimport { ChevronDown } from '@elliemae/ds-icons';\nimport useFocusGroupItem from '@elliemae/ds-shared/FocusGroup/useFocusGroupItem';\nimport { Pill } from './Pill';\n\nfunction DropdownPill({\n containerProps = {},\n label = '',\n variant,\n tabIndex = -1,\n closeMenuOnItemSelection = false,\n maxWidth,\n minWidth,\n ...dropdownProps\n}) {\n const ref = useRef(null);\n const [chevronEl, chevronRef] = useState();\n const { focusFirst } = useFocusGroupItem(ref);\n return (\n <DSDropdownMenu\n {...dropdownProps}\n closeMenuOnItemSelection={closeMenuOnItemSelection}\n maxWidth={maxWidth}\n hideIfNotVisible\n menuProps={{ className: 'dropdown-pill-menu', zIndex: 100 }}\n minWidth={minWidth}\n onClose={focusFirst}\n referenceNode={chevronEl}\n triggerComponent={\n <Pill\n data-testid=\"dropdown-pill\"\n className=\"dropdown-pill\"\n containerProps={{ role: 'listbox', ...containerProps }}\n innerRef={ref}\n label={label}\n rightAddon={\n <div ref={chevronRef}>\n <ChevronDown className=\"dropdown-pill-chevron-down\" data-testid=\"dropdown-pill-button\" />\n </div>\n }\n tabIndex={tabIndex}\n variant={variant}\n />\n }\n />\n );\n}\n\nconst props = {\n /** props injected to component wrapper */\n containerProps: PropTypes.object.description('props injected to component wrapper'),\n /** labeled pill text label */\n label: PropTypes.string.isRequired.description('pill text label'),\n /** pill variant */\n variant: PropTypes.oneOf(['value', 'title']).description('pill variant'),\n /** html focus border */\n tabIndex: PropTypes.number.description('html focus order'),\n /** close menu on item selection */\n closeMenuOnItemSelection: PropTypes.bool.description('close menu on item selection'),\n /** pill max width */\n maxWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('pill max width'),\n /** pill min width */\n minWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('pill min width'),\n};\n\nDropdownPill.propTypes = props;\nconst DSDropdownPillWithSchema = describe(DropdownPill);\nDSDropdownPillWithSchema.propTypes = props;\n\nexport { DropdownPill, DSDropdownPillWithSchema };\n"],"names":["DropdownPill","containerProps","label","variant","tabIndex","closeMenuOnItemSelection","maxWidth","minWidth","dropdownProps","ref","useRef","useState","chevronEl","chevronRef","useFocusGroupItem","focusFirst","React","DSDropdownMenu","className","zIndex","Pill","role","ChevronDown","props","PropTypes","object","description","string","isRequired","oneOf","number","bool","oneOfType","propTypes","DSDropdownPillWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,SAASA,YAAT,OASG;AAAA,iCARDC,cAQC;AAAA,MARDA,cAQC,oCARgB,EAQhB;AAAA,wBAPDC,KAOC;AAAA,MAPDA,KAOC,2BAPO,EAOP;AAAA,MANDC,OAMC,QANDA,OAMC;AAAA,2BALDC,QAKC;AAAA,MALDA,QAKC,8BALU,CAAC,CAKX;AAAA,mCAJDC,wBAIC;AAAA,M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xB,EAAAA,KAAK,EAAEsB,mBAAS,CAACG,MAAV,CAAiBC,UAAjB,CAA4BF,WAA5B,CAAwC,iBAAxC,CAJK;;AAKZ;AACAvB,EAAAA,OAAO,EAAEqB,mBAAS,CAACK,KAAV,CAAgB,CAAC,OAAD,EAAU,OAAV,CAAhB,EAAoCH,WAApC,CAAgD,cAAhD,CANG;;AAOZ;AACAtB,EAAAA,QAAQ,EAAEoB,mBAAS,CAACM,MAAV,CAAiBJ,WAAjB,CAA6B,kBAA7B,CARE;;AASZ;AACArB,EAAAA,wBAAwB,EAAEmB,mBAAS,CAACO,IAAV,CAAeL,WAAf,CAA2B,8BAA3B,CAVd;;AAWZ;AACApB,EAAAA,QAAQ,EAAEkB,mBAAS,CAACQ,SAAV,CAAoB,CAACR,mBAAS,CAACG,MAAX,EAAmBH,mBAAS,CAACM,MAA7B,CAApB,EAA0DJ,WAA1D,CAAsE,gBAAtE,CAZE;;AAaZ;AACAnB,EAAAA,QAAQ,EAAEiB,mBAAS,CAACQ,SAAV,CAAoB,CAACR,mBAAS,CAACG,MAAX,EAAmBH,mBAAS,CAACM,MAA7B,CAApB,EAA0DJ,WAA1D,CAAsE,gBAAtE;AAdE,CAAd;AAiBA1B,YAAY,CAACiC,SAAb,GAAyBV,KAAzB;IACMW,wBAAwB,GAAGC,kBAAQ,CAACnC,YAAD;AACzCkC,wBAAwB,CAACD,SAAzB,GAAqCV,KAArC;;;;;"}
|
|
@@ -5,10 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
6
6
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
7
|
var React = require('react');
|
|
8
|
-
var
|
|
8
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
9
9
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
10
|
-
var
|
|
11
|
-
var DSInput = require('@elliemae/ds-form/Input');
|
|
10
|
+
var dsForm = require('@elliemae/ds-form');
|
|
12
11
|
var deprecated_Pill = require('./Pill.js');
|
|
13
12
|
require('@babel/runtime/helpers/defineProperty');
|
|
14
13
|
require('react-desc');
|
|
@@ -18,9 +17,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
18
17
|
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
19
18
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
20
19
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
21
|
-
var CloseXsmall__default = /*#__PURE__*/_interopDefaultLegacy(CloseXsmall);
|
|
22
|
-
var DSInputMask__default = /*#__PURE__*/_interopDefaultLegacy(DSInputMask);
|
|
23
|
-
var DSInput__default = /*#__PURE__*/_interopDefaultLegacy(DSInput);
|
|
24
20
|
|
|
25
21
|
var _excluded = ["containerProps", "placeholder", "onChange", "onRemove", "value", "type"];
|
|
26
22
|
var StyledInputPill = dsClassnames.aggregatedClasses(deprecated_Pill.Pill)('input-pill', null, function (_ref) {
|
|
@@ -41,16 +37,16 @@ function InputPill(_ref2) {
|
|
|
41
37
|
type = _ref2.type,
|
|
42
38
|
otherProps = _objectWithoutProperties__default['default'](_ref2, _excluded);
|
|
43
39
|
|
|
44
|
-
var TypeOfInput =
|
|
40
|
+
var TypeOfInput = dsForm.DSInput; // TODO: implement the DSTimeInput, see how because it returns a moment()
|
|
45
41
|
// TODO: implement the DSDateInput
|
|
46
42
|
|
|
47
43
|
switch (type) {
|
|
48
44
|
case 'inputText':
|
|
49
|
-
TypeOfInput =
|
|
45
|
+
TypeOfInput = dsForm.DSInput;
|
|
50
46
|
break;
|
|
51
47
|
|
|
52
48
|
case 'inputMask':
|
|
53
|
-
TypeOfInput =
|
|
49
|
+
TypeOfInput = dsForm.DSInputMask;
|
|
54
50
|
break;
|
|
55
51
|
}
|
|
56
52
|
|
|
@@ -66,7 +62,7 @@ function InputPill(_ref2) {
|
|
|
66
62
|
placeholder: placeholder,
|
|
67
63
|
value: value
|
|
68
64
|
}, otherProps)),
|
|
69
|
-
rightAddon: value && /*#__PURE__*/React__default['default'].createElement(
|
|
65
|
+
rightAddon: value && /*#__PURE__*/React__default['default'].createElement(dsIcons.CloseXsmall, {
|
|
70
66
|
className: "remove-pill-button",
|
|
71
67
|
"data-testid": "remove-pill-button",
|
|
72
68
|
onClick: onRemove
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputPill.js","sources":["../../../src/deprecated/InputPill.tsx"],"sourcesContent":["import React from 'react';\nimport CloseXsmall from '@elliemae/ds-icons
|
|
1
|
+
{"version":3,"file":"InputPill.js","sources":["../../../src/deprecated/InputPill.tsx"],"sourcesContent":["import React from 'react';\nimport { CloseXsmall } from '@elliemae/ds-icons';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { DSInput, DSInputMask } from '@elliemae/ds-form';\nimport { Pill } from './Pill';\n\nconst StyledInputPill = aggregatedClasses(Pill)('input-pill', null, ({ value }) => ({\n value,\n}));\n\nexport function InputPill({\n containerProps = {},\n placeholder = 'Enter Value',\n onChange = () => {},\n onRemove,\n value,\n type,\n ...otherProps\n}) {\n let TypeOfInput = DSInput;\n // TODO: implement the DSTimeInput, see how because it returns a moment()\n // TODO: implement the DSDateInput\n switch (type) {\n case 'inputText':\n TypeOfInput = DSInput;\n break;\n case 'inputMask':\n TypeOfInput = DSInputMask;\n break;\n default:\n break;\n }\n\n return (\n <StyledInputPill\n className=\"input-pill\"\n classProps={{ value }}\n containerProps={containerProps}\n label={\n <TypeOfInput\n data-testid=\"input-pill\"\n onChange={onChange}\n placeholder={placeholder}\n value={value}\n {...otherProps}\n />\n }\n rightAddon={\n value && <CloseXsmall className=\"remove-pill-button\" data-testid=\"remove-pill-button\" onClick={onRemove} />\n }\n tabIndex={-1}\n />\n );\n}\n"],"names":["StyledInputPill","aggregatedClasses","Pill","value","InputPill","containerProps","placeholder","onChange","onRemove","type","otherProps","Typ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AAE,CAAC;AAhBb,IADF;AAoBD;;;;"}
|
|
@@ -15,18 +15,14 @@ require('@elliemae/ds-shared/FocusGroup/FocusGroupManager');
|
|
|
15
15
|
require('@babel/runtime/helpers/defineProperty');
|
|
16
16
|
require('@babel/runtime/helpers/slicedToArray');
|
|
17
17
|
require('prop-types');
|
|
18
|
-
require('@elliemae/ds-utilities
|
|
19
|
-
require('@elliemae/ds-utilities/hooks/useShouldRecalculate');
|
|
20
|
-
require('@elliemae/ds-utilities/utils');
|
|
18
|
+
require('@elliemae/ds-utilities');
|
|
21
19
|
require('./DropdownPill.js');
|
|
22
20
|
require('@elliemae/ds-dropdownmenu');
|
|
23
|
-
require('@elliemae/ds-icons
|
|
21
|
+
require('@elliemae/ds-icons');
|
|
24
22
|
require('@elliemae/ds-shared/FocusGroup/useFocusGroupItem');
|
|
25
23
|
require('./Pill.js');
|
|
26
24
|
require('./InputPill.js');
|
|
27
|
-
require('@elliemae/ds-
|
|
28
|
-
require('@elliemae/ds-form/InputMask');
|
|
29
|
-
require('@elliemae/ds-form/Input');
|
|
25
|
+
require('@elliemae/ds-form');
|
|
30
26
|
require('./RemovablePill.js');
|
|
31
27
|
require('./LabeledDropdownPillsTypes/utils.js');
|
|
32
28
|
require('lodash');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabeledDropdownPills.js","sources":["../../../src/deprecated/LabeledDropdownPills.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { PillGroup } from './PillGroup';\nimport LabeledDropdownSinglePill from './LabeledDropdownPillsTypes/LabeledDropdownSinglePill';\nimport LabeledDropdownMultiPills from './LabeledDropdownPillsTypes/LabeledDropdownMultiPill';\nimport LabeledDropdownCascadeMenuPill from './LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill';\n\nconst DropdownPills = {\n single: LabeledDropdownSinglePill,\n multi: LabeledDropdownMultiPills,\n cascaded: LabeledDropdownCascadeMenuPill,\n};\n\nconst createDropdownPill = (type) =>\n DropdownPills[type] || DropdownPills.single;\n\nfunction LabeledDropdownPills({\n label = '',\n value,\n type,\n onFocusNextGroup,\n onFocusPreviousGroup,\n onFocusGroupSet,\n maxWidth,\n minWidth,\n fixed,\n ...menuProps\n}) {\n const Component = createDropdownPill(type);\n\n return (\n <PillGroup\n onFocusGroupSet={onFocusGroupSet}\n onFocusNextGroup={onFocusNextGroup}\n onFocusPreviousGroup={onFocusPreviousGroup}\n >\n <Component\n {...menuProps}\n label={label}\n maxWidth={maxWidth}\n minWidth={minWidth}\n value={value}\n fixed={fixed}\n />\n </PillGroup>\n );\n}\n\nconst props = {\n /** pill type */\n type: PropTypes.oneOf(['single', 'multi', 'cascaded']).description(\n 'pill type',\n ),\n /** focus next group callback */\n onFocusNextGroup: PropTypes.func.description('focus next group callback'),\n /** focus prev group callback */\n onFocusPreviousGroup: PropTypes.func.description('focus prev group callback'),\n /** focus group set callback */\n onFocusGroupSet: PropTypes.func.description('focus group set callback'),\n /** pill max width */\n maxWidth: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number,\n ]).description('pill max width'),\n /** pill min width */\n minWidth: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number,\n ]).description('pill min width'),\n /** fixed pill */\n fixed: PropTypes.bool.description('fixed pill'),\n /** pill label text */\n label: PropTypes.string.isRequired.description('pill label text'),\n /** pill value */\n value: PropTypes.oneOfType([\n PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string,\n label: PropTypes.string,\n }),\n ),\n PropTypes.shape({\n id: PropTypes.string,\n label: PropTypes.string,\n }),\n ]).description('pill value'),\n};\n\nLabeledDropdownPills.propTypes = props;\nconst DSLabeledDropdownPillsWithSchema = describe(LabeledDropdownPills);\nDSLabeledDropdownPillsWithSchema.propTypes = props;\n\nexport { LabeledDropdownPills, DSLabeledDropdownPillsWithSchema };\n"],"names":["DropdownPills","single","LabeledDropdownSinglePill","multi","LabeledDropdownMultiPills","cascaded","LabeledDropdownCascadeMenuPill","createDropdownPill","type","LabeledDropdownPills","label","value","onFocusNextGroup","onFocusPreviousGroup","onFocusGroupSet","maxWidth","minWidth","fixed","menuProps","Component","React","PillGroup","props","PropTypes","oneOf","description","func","oneOfType","string","number","bool","isRequired","arrayOf","shape","id","propTypes","DSLabeledDropdownPillsWithSchema","describe"],"mappings":"
|
|
1
|
+
{"version":3,"file":"LabeledDropdownPills.js","sources":["../../../src/deprecated/LabeledDropdownPills.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { PillGroup } from './PillGroup';\nimport LabeledDropdownSinglePill from './LabeledDropdownPillsTypes/LabeledDropdownSinglePill';\nimport LabeledDropdownMultiPills from './LabeledDropdownPillsTypes/LabeledDropdownMultiPill';\nimport LabeledDropdownCascadeMenuPill from './LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill';\n\nconst DropdownPills = {\n single: LabeledDropdownSinglePill,\n multi: LabeledDropdownMultiPills,\n cascaded: LabeledDropdownCascadeMenuPill,\n};\n\nconst createDropdownPill = (type) =>\n DropdownPills[type] || DropdownPills.single;\n\nfunction LabeledDropdownPills({\n label = '',\n value,\n type,\n onFocusNextGroup,\n onFocusPreviousGroup,\n onFocusGroupSet,\n maxWidth,\n minWidth,\n fixed,\n ...menuProps\n}) {\n const Component = createDropdownPill(type);\n\n return (\n <PillGroup\n onFocusGroupSet={onFocusGroupSet}\n onFocusNextGroup={onFocusNextGroup}\n onFocusPreviousGroup={onFocusPreviousGroup}\n >\n <Component\n {...menuProps}\n label={label}\n maxWidth={maxWidth}\n minWidth={minWidth}\n value={value}\n fixed={fixed}\n />\n </PillGroup>\n );\n}\n\nconst props = {\n /** pill type */\n type: PropTypes.oneOf(['single', 'multi', 'cascaded']).description(\n 'pill type',\n ),\n /** focus next group callback */\n onFocusNextGroup: PropTypes.func.description('focus next group callback'),\n /** focus prev group callback */\n onFocusPreviousGroup: PropTypes.func.description('focus prev group callback'),\n /** focus group set callback */\n onFocusGroupSet: PropTypes.func.description('focus group set callback'),\n /** pill max width */\n maxWidth: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number,\n ]).description('pill max width'),\n /** pill min width */\n minWidth: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number,\n ]).description('pill min width'),\n /** fixed pill */\n fixed: PropTypes.bool.description('fixed pill'),\n /** pill label text */\n label: PropTypes.string.isRequired.description('pill label text'),\n /** pill value */\n value: PropTypes.oneOfType([\n PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string,\n label: PropTypes.string,\n }),\n ),\n PropTypes.shape({\n id: PropTypes.string,\n label: PropTypes.string,\n }),\n ]).description('pill value'),\n};\n\nLabeledDropdownPills.propTypes = props;\nconst DSLabeledDropdownPillsWithSchema = describe(LabeledDropdownPills);\nDSLabeledDropdownPillsWithSchema.propTypes = props;\n\nexport { LabeledDropdownPills, DSLabeledDropdownPillsWithSchema };\n"],"names":["DropdownPills","single","LabeledDropdownSinglePill","multi","LabeledDropdownMultiPills","cascaded","LabeledDropdownCascadeMenuPill","createDropdownPill","type","LabeledDropdownPills","label","value","onFocusNextGroup","onFocusPreviousGroup","onFocusGroupSet","maxWidth","minWidth","fixed","menuProps","Component","React","PillGroup","props","PropTypes","oneOf","description","func","oneOfType","string","number","bool","isRequired","arrayOf","shape","id","propTypes","DSLabeledDropdownPillsWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAMA,aAAa,GAAG;AACpBC,EAAAA,MAAM,EAAEC,8DADY;AAEpBC,EAAAA,KAAK,EAAEC,6DAFa;AAGpBC,EAAAA,QAAQ,EAAEC;AAHU,CAAtB;;AAMA,IAAMC,kBAAkB,GAAG,SAArBA,kBAAqB,CAACC,IAAD;AAAA,SACzBR,aAAa,CAACQ,IAAD,CAAb,IAAuBR,aAAa,CAACC,MADZ;AAAA,CAA3B;;AAGA,SAASQ,oBAAT,OAWG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kB,EAE5BL,mBAAS,CAACM,MAFkB,CAApB,EAGPJ,WAHO,CAGK,gBAHL,CAZE;;AAgBZ;AACAT,EAAAA,QAAQ,EAAEO,mBAAS,CAACI,SAAV,CAAoB,CAC5BJ,mBAAS,CAACK,MADkB,EAE5BL,mBAAS,CAACM,MAFkB,CAApB,EAGPJ,WAHO,CAGK,gBAHL,CAjBE;;AAqBZ;AACAR,EAAAA,KAAK,EAAEM,mBAAS,CAACO,IAAV,CAAeL,WAAf,CAA2B,YAA3B,CAtBK;;AAuBZ;AACAf,EAAAA,KAAK,EAAEa,mBAAS,CAACK,MAAV,CAAiBG,UAAjB,CAA4BN,WAA5B,CAAwC,iBAAxC,CAxBK;;AAyBZ;AACAd,EAAAA,KAAK,EAAEY,mBAAS,CAACI,SAAV,CAAoB,CACzBJ,mBAAS,CAACS,OAAV,CACET,mBAAS,CAACU,KAAV,CAAgB;AACdC,IAAAA,EAAE,EAAEX,mBAAS,CAACK,MADA;AAEdlB,IAAAA,KAAK,EAAEa,mBAAS,CAACK;AAFH,GAAhB,CADF,CADyB,EAOzBL,mBAAS,CAACU,KAAV,CAAgB;AACdC,IAAAA,EAAE,EAAEX,mBAAS,CAACK,MADA;AAEdlB,IAAAA,KAAK,EAAEa,mBAAS,CAACK;AAFH,GAAhB,CAPyB,CAApB,EAWJH,WAXI,CAWQ,YAXR;AA1BK,CAAd;AAwCAhB,oBAAoB,CAAC0B,SAArB,GAAiCb,KAAjC;IACMc,gCAAgC,GAAGC,kBAAQ,CAAC5B,oBAAD;AACjD2B,gCAAgC,CAACD,SAAjC,GAA6Cb,KAA7C;;;;;"}
|
|
@@ -5,19 +5,18 @@ var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
|
5
5
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
|
-
var
|
|
8
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
9
9
|
var deprecated_PillGroup = require('../PillGroup.js');
|
|
10
10
|
var deprecated_RemovablePill = require('../RemovablePill.js');
|
|
11
11
|
var deprecated_DropdownPill = require('../DropdownPill.js');
|
|
12
12
|
require('react-desc');
|
|
13
13
|
require('@elliemae/ds-classnames');
|
|
14
14
|
require('@elliemae/ds-shared/FocusGroup/FocusGroupManager');
|
|
15
|
-
require('@elliemae/ds-icons
|
|
15
|
+
require('@elliemae/ds-icons');
|
|
16
16
|
require('@elliemae/ds-shared/FocusGroup/useFocusGroupItem');
|
|
17
17
|
require('../Pill.js');
|
|
18
18
|
require('@babel/runtime/helpers/slicedToArray');
|
|
19
19
|
require('@elliemae/ds-dropdownmenu');
|
|
20
|
-
require('@elliemae/ds-icons/ChevronDown');
|
|
21
20
|
|
|
22
21
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
22
|
|
|
@@ -89,8 +88,8 @@ function LabeledDropdownCascadeMenuPill(_ref) {
|
|
|
89
88
|
var item = _ref2.item,
|
|
90
89
|
group = _ref2.group;
|
|
91
90
|
|
|
92
|
-
if (
|
|
93
|
-
var nextSelection = group ? _defineProperty__default['default']({}, group.id,
|
|
91
|
+
if (dsUtilities.isFunction(onChange)) {
|
|
92
|
+
var nextSelection = group ? _defineProperty__default['default']({}, group.id, dsUtilities.addOrRemove(_toConsumableArray__default['default'](selection[group.id] || []), item, function (o) {
|
|
94
93
|
return o.id;
|
|
95
94
|
})) : _defineProperty__default['default']({}, item.id, item.label);
|
|
96
95
|
onChange(nextSelection);
|
|
@@ -98,7 +97,7 @@ function LabeledDropdownCascadeMenuPill(_ref) {
|
|
|
98
97
|
};
|
|
99
98
|
|
|
100
99
|
var removeOption = function removeOption(option) {
|
|
101
|
-
if (
|
|
100
|
+
if (dsUtilities.isFunction(onChange)) {
|
|
102
101
|
var nextSelection = _defineProperty__default['default']({}, selectionId, selectionValues.filter(function (val) {
|
|
103
102
|
return option.id !== val.id;
|
|
104
103
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabeledDropdownCascadeMenuPill.js","sources":["../../../../src/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.tsx"],"sourcesContent":["import React from 'react';\nimport { isFunction, addOrRemove } from '@elliemae/ds-utilities
|
|
1
|
+
{"version":3,"file":"LabeledDropdownCascadeMenuPill.js","sources":["../../../../src/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.tsx"],"sourcesContent":["import React from 'react';\nimport { isFunction, addOrRemove } from '@elliemae/ds-utilities';\nimport { PillGroup } from '../PillGroup';\nimport { RemovablePill } from '../RemovablePill';\nimport { DropdownPill } from '../DropdownPill';\n\nfunction renderMenuItems(options, factory) {\n return options.map((option, index) => {\n const ItemComponent = factory('radio');\n\n if (option.type === 'submenu') {\n const SubmenuComponent = factory('submenu');\n const ChildComponent = factory('selection-group');\n return (\n <SubmenuComponent {...option} key={option.id} item={option}>\n <ChildComponent\n {...option}\n id={option.id}\n item={option}\n items={option.items}\n itemValueAccessor={(item) => item}\n multi\n />\n </SubmenuComponent>\n );\n }\n\n return <ItemComponent {...option} key={option.id || index} item={option} />;\n });\n}\n\nconst getSubmenuOptionLabelById = (options, id) => {\n const index = options.findIndex((option) => option.id === id);\n return index ? options[index].label : '';\n};\n\nexport default function LabeledDropdownCascadeMenuPill({\n label,\n options,\n value: optionValue,\n onChange,\n onRemove,\n value: selection = {},\n placeholder = '---',\n onFocusNextGroup,\n onFocusPreviousGroup,\n onFocusGroupSet,\n maxWidth,\n minWidth,\n ...menuProps\n}) {\n const selectionId = Object.keys(selection)[0];\n const selectionValues = selection[selectionId] || '';\n const dropdownLabel = Array.isArray(selectionValues)\n ? getSubmenuOptionLabelById(options, selectionId)\n : selectionValues;\n\n const handleSelectChange = ({ item, group }) => {\n if (isFunction(onChange)) {\n const nextSelection = group\n ? {\n [group.id]: addOrRemove([...(selection[group.id] || [])], item, (o) => o.id),\n }\n : {\n [item.id]: item.label,\n };\n onChange(nextSelection);\n }\n };\n\n const removeOption = (option) => {\n if (isFunction(onChange)) {\n const nextSelection = {\n [selectionId]: selectionValues.filter((val) => option.id !== val.id),\n };\n onChange(nextSelection);\n }\n onRemove(option);\n };\n\n return (\n <PillGroup\n onFocusGroupSet={onFocusGroupSet}\n onFocusNextGroup={onFocusNextGroup}\n onFocusPreviousGroup={onFocusPreviousGroup}\n >\n <DropdownPill\n {...menuProps}\n itemsRenderer={renderMenuItems}\n label={dropdownLabel || placeholder}\n maxWidth={maxWidth}\n minWidth={minWidth}\n onSelectChange={handleSelectChange}\n options={options}\n selection={{\n [selectionId]: Array.isArray(selectionValues) ? selectionValues.map((v) => v.id) : selectionValues,\n }}\n singleGroupSelection\n variant=\"title\"\n />\n {Array.isArray(selectionValues) &&\n selectionValues.map((option) => (\n <RemovablePill key={option.id} label={option.label} onRemove={() => removeOption(option)} />\n ))}\n </PillGroup>\n );\n}\n"],"names":["renderMenuItems","options","factory","map","option","index","ItemComponent","type","SubmenuComponent","ChildComponent","React","id","items","item","getSubmenuOptionLabelById","findIndex","label","LabeledDropdownCascadeMenuPill","value","onChange","onRemove","selection","placeholder","onFocusNextGroup","onFocusPreviousGroup","onFocusGroupSet","maxWidth","minWidth","menuProps","selectionId","Object","keys","selectionValues","dropdownLabel","Array","isArray","handleSelectChange","group","isFunction","nextSelection","addOrRemove","o","removeOption","filter","val","PillGroup","DropdownPill","v","RemovablePill"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,SAASA,eAAT,CAAyBC,OAAzB,EAAkCC,OAAlC,EAA2C;AACzC,SAAOD,OAAO,CAACE,GAAR,CAAY,UAACC,MAAD,EAASC,KAAT,EAAmB;AACpC,QAAMC,aAAa,GAAGJ,OAAO,CAAC,OAAD,CAA7B;;AAEA,QAAIE,MAAM,CAACG,IAAP,KAAgB,SAApB,EAA+B;AAC7B,UAAMC,gBAAgB,GAAGN,OAAO,CAA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ACDnB,IAAAA,QAAQ,CAAChB,MAAD,CAAR;AACD,GARD;;AAUA,sBACEM,wCAACmC,8BAAD;AACE,IAAA,eAAe,EAAEpB,eADnB;AAEE,IAAA,gBAAgB,EAAEF,gBAFpB;AAGE,IAAA,oBAAoB,EAAEC;AAHxB,kBAKEd,wCAACoC,oCAAD,mCACMlB,SADN;AAEE,IAAA,aAAa,EAAE5B,eAFjB;AAGE,IAAA,KAAK,EAAEiC,aAAa,IAAIX,WAH1B;AAIE,IAAA,QAAQ,EAAEI,QAJZ;AAKE,IAAA,QAAQ,EAAEC,QALZ;AAME,IAAA,cAAc,EAAES,kBANlB;AAOE,IAAA,OAAO,EAAEnC,OAPX;AAQE,IAAA,SAAS,0CACN4B,WADM,EACQK,KAAK,CAACC,OAAN,CAAcH,eAAd,IAAiCA,eAAe,CAAC7B,GAAhB,CAAoB,UAAC4C,CAAD;AAAA,aAAOA,CAAC,CAACpC,EAAT;AAAA,KAApB,CAAjC,GAAoEqB,eAD5E,CARX;AAWE,IAAA,oBAAoB,MAXtB;AAYE,IAAA,OAAO,EAAC;AAZV,KALF,EAmBGE,KAAK,CAACC,OAAN,CAAcH,eAAd,KACCA,eAAe,CAAC7B,GAAhB,CAAoB,UAACC,MAAD;AAAA,wBAClBM,wCAACsC,sCAAD;AAAe,MAAA,GAAG,EAAE5C,MAAM,CAACO,EAA3B;AAA+B,MAAA,KAAK,EAAEP,MAAM,CAACY,KAA7C;AAAoD,MAAA,QAAQ,EAAE;AAAA,eAAM0B,YAAY,CAACtC,MAAD,CAAlB;AAAA;AAA9D,MADkB;AAAA,GAApB,CApBJ,CADF;AA0BD;;;;"}
|
|
@@ -6,18 +6,17 @@ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
|
6
6
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var lodash = require('lodash');
|
|
9
|
-
var
|
|
9
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
10
10
|
var deprecated_RemovablePill = require('../RemovablePill.js');
|
|
11
11
|
var deprecated_Pill = require('../Pill.js');
|
|
12
12
|
var deprecated_OverflowPill = require('../OverflowPill.js');
|
|
13
13
|
var deprecated_DropdownPill = require('../DropdownPill.js');
|
|
14
14
|
require('react-desc');
|
|
15
|
-
require('@elliemae/ds-icons
|
|
15
|
+
require('@elliemae/ds-icons');
|
|
16
16
|
require('@elliemae/ds-shared/FocusGroup/useFocusGroupItem');
|
|
17
17
|
require('@elliemae/ds-classnames');
|
|
18
18
|
require('@elliemae/ds-tooltip');
|
|
19
19
|
require('@elliemae/ds-dropdownmenu');
|
|
20
|
-
require('@elliemae/ds-icons/ChevronDown');
|
|
21
20
|
|
|
22
21
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
22
|
|
|
@@ -114,8 +113,8 @@ function LabeledDropdownMultiPills(_ref) {
|
|
|
114
113
|
}, [selectedOptions]);
|
|
115
114
|
var selectOption = React.useCallback(function (option) {
|
|
116
115
|
if (!option.fixedItem) {
|
|
117
|
-
if (
|
|
118
|
-
var nextValue =
|
|
116
|
+
if (dsUtilities.isFunction(onChange)) {
|
|
117
|
+
var nextValue = dsUtilities.addOrRemove(selectedOptions, option, function (item) {
|
|
119
118
|
return item.id;
|
|
120
119
|
});
|
|
121
120
|
setSelectedOptions(nextValue);
|
|
@@ -127,7 +126,7 @@ function LabeledDropdownMultiPills(_ref) {
|
|
|
127
126
|
}, [selectedOptions]);
|
|
128
127
|
var removeOption = React.useCallback(function (option) {
|
|
129
128
|
if (!option.fixedItem || selectedOptions.length > totalDefaultOptions) {
|
|
130
|
-
if (
|
|
129
|
+
if (dsUtilities.isFunction(onChange)) {
|
|
131
130
|
var nextValue = selectedOptions.filter(function (val) {
|
|
132
131
|
return option.id !== val.id;
|
|
133
132
|
});
|