@elliemae/ds-pills 2.2.0-alpha.2 → 2.2.0-beta.0
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 +49 -56
- package/cjs/components/PillButton.js +52 -54
- package/cjs/components/PillGroup.js +53 -61
- package/cjs/components/index.js +17 -30
- package/cjs/components/styled.js +78 -228
- package/cjs/components/types/DropdownPill.js +77 -79
- package/cjs/components/types/InputPill.js +48 -58
- package/cjs/components/types/LabelPill.js +38 -44
- package/cjs/components/types/ReadOnlyPill.js +43 -48
- package/cjs/components/types/RemovablePill.js +53 -60
- package/cjs/components/types/ValuePill.js +43 -48
- package/cjs/components/types/index.js +19 -33
- package/cjs/deprecated/DropdownPill.js +101 -80
- package/cjs/deprecated/InputPill.js +69 -67
- package/cjs/deprecated/LabeledDropdownPills.js +96 -92
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +94 -91
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +114 -106
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +127 -119
- package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js +15 -39
- package/cjs/deprecated/LabeledPills.js +52 -65
- package/cjs/deprecated/OverflowPill.js +53 -59
- package/cjs/deprecated/Pill.js +82 -67
- package/cjs/deprecated/PillGroup.js +68 -68
- package/cjs/deprecated/ReadOnlyPill.js +94 -93
- package/cjs/deprecated/RemovablePill.js +57 -61
- package/cjs/deprecated/index.js +33 -43
- package/cjs/index.d.js +2 -27
- package/cjs/index.js +43 -37
- package/cjs/props.js +46 -72
- package/cjs/utils.js +25 -43
- package/esm/components/Pill.js +31 -18
- package/esm/components/PillButton.js +39 -22
- package/esm/components/PillGroup.js +38 -28
- package/esm/components/index.js +3 -5
- package/esm/components/styled.js +66 -205
- package/esm/components/types/DropdownPill.js +67 -50
- package/esm/components/types/InputPill.js +35 -25
- package/esm/components/types/LabelPill.js +29 -15
- package/esm/components/types/ReadOnlyPill.js +34 -19
- package/esm/components/types/RemovablePill.js +44 -31
- package/esm/components/types/ValuePill.js +34 -19
- package/esm/components/types/index.js +6 -8
- package/esm/deprecated/DropdownPill.js +86 -49
- package/esm/deprecated/InputPill.js +59 -38
- package/esm/deprecated/LabeledDropdownPills.js +81 -59
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +84 -60
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +94 -65
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +108 -79
- package/esm/deprecated/LabeledDropdownPillsTypes/utils.js +10 -9
- package/esm/deprecated/LabeledPills.js +41 -34
- package/esm/deprecated/OverflowPill.js +37 -25
- package/esm/deprecated/Pill.js +71 -39
- package/esm/deprecated/PillGroup.js +56 -39
- package/esm/deprecated/ReadOnlyPill.js +79 -60
- package/esm/deprecated/RemovablePill.js +45 -30
- package/esm/deprecated/index.js +8 -14
- package/esm/index.d.js +1 -2
- package/esm/index.js +11 -8
- package/esm/props.js +36 -42
- package/esm/utils.js +23 -16
- package/package.json +15 -15
- package/types/components/PillGroup.d.ts +1 -1
- package/types/deprecated/DropdownPill.d.ts +1 -10
- package/types/deprecated/LabeledDropdownPills.d.ts +1 -12
- package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.d.ts +1 -3
- package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.d.ts +1 -3
- package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.d.ts +0 -1
- package/types/deprecated/LabeledPills.d.ts +1 -8
- package/types/deprecated/OverflowPill.d.ts +1 -5
- package/types/deprecated/Pill.d.ts +1 -9
- package/types/deprecated/PillGroup.d.ts +1 -7
- package/types/deprecated/ReadOnlyPill.d.ts +1 -8
- package/types/deprecated/RemovablePill.d.ts +1 -7
- package/cjs/components/Pill.js.map +0 -7
- package/cjs/components/PillButton.js.map +0 -7
- package/cjs/components/PillGroup.js.map +0 -7
- package/cjs/components/index.js.map +0 -7
- package/cjs/components/styled.js.map +0 -7
- package/cjs/components/types/DropdownPill.js.map +0 -7
- package/cjs/components/types/InputPill.js.map +0 -7
- package/cjs/components/types/LabelPill.js.map +0 -7
- package/cjs/components/types/ReadOnlyPill.js.map +0 -7
- package/cjs/components/types/RemovablePill.js.map +0 -7
- package/cjs/components/types/ValuePill.js.map +0 -7
- package/cjs/components/types/index.js.map +0 -7
- package/cjs/deprecated/DropdownPill.js.map +0 -7
- package/cjs/deprecated/InputPill.js.map +0 -7
- package/cjs/deprecated/LabeledDropdownPills.js.map +0 -7
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +0 -7
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +0 -7
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +0 -7
- package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js.map +0 -7
- package/cjs/deprecated/LabeledPills.js.map +0 -7
- package/cjs/deprecated/OverflowPill.js.map +0 -7
- package/cjs/deprecated/Pill.js.map +0 -7
- package/cjs/deprecated/PillGroup.js.map +0 -7
- package/cjs/deprecated/ReadOnlyPill.js.map +0 -7
- package/cjs/deprecated/RemovablePill.js.map +0 -7
- package/cjs/deprecated/index.js.map +0 -7
- package/cjs/index.d.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/props.js.map +0 -7
- package/cjs/utils.js.map +0 -7
- package/esm/components/Pill.js.map +0 -7
- package/esm/components/PillButton.js.map +0 -7
- package/esm/components/PillGroup.js.map +0 -7
- package/esm/components/index.js.map +0 -7
- package/esm/components/styled.js.map +0 -7
- package/esm/components/types/DropdownPill.js.map +0 -7
- package/esm/components/types/InputPill.js.map +0 -7
- package/esm/components/types/LabelPill.js.map +0 -7
- package/esm/components/types/ReadOnlyPill.js.map +0 -7
- package/esm/components/types/RemovablePill.js.map +0 -7
- package/esm/components/types/ValuePill.js.map +0 -7
- package/esm/components/types/index.js.map +0 -7
- package/esm/deprecated/DropdownPill.js.map +0 -7
- package/esm/deprecated/InputPill.js.map +0 -7
- package/esm/deprecated/LabeledDropdownPills.js.map +0 -7
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +0 -7
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +0 -7
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +0 -7
- package/esm/deprecated/LabeledDropdownPillsTypes/utils.js.map +0 -7
- package/esm/deprecated/LabeledPills.js.map +0 -7
- package/esm/deprecated/OverflowPill.js.map +0 -7
- package/esm/deprecated/Pill.js.map +0 -7
- package/esm/deprecated/PillGroup.js.map +0 -7
- package/esm/deprecated/ReadOnlyPill.js.map +0 -7
- package/esm/deprecated/RemovablePill.js.map +0 -7
- package/esm/deprecated/index.js.map +0 -7
- package/esm/index.d.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/props.js.map +0 -7
- package/esm/utils.js.map +0 -7
|
@@ -1,92 +1,113 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
closeMenuOnItemSelection = false,
|
|
46
|
-
maxWidth,
|
|
47
|
-
minWidth,
|
|
48
|
-
...dropdownProps
|
|
49
|
-
}) {
|
|
50
|
-
const ref = (0, import_react.useRef)(null);
|
|
51
|
-
const [chevronEl, chevronRef] = (0, import_react.useState)();
|
|
52
|
-
const { focusFirst } = (0, import_useFocusGroupItem.useFocusGroupItem)(ref);
|
|
53
|
-
return /* @__PURE__ */ import_react.default.createElement(import_ds_dropdownmenu.DSDropdownMenu, {
|
|
54
|
-
...dropdownProps,
|
|
55
|
-
closeMenuOnItemSelection,
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
8
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
14
|
+
var React = require('react');
|
|
15
|
+
var reactDesc = require('react-desc');
|
|
16
|
+
var DSDropdownMenu = require('@elliemae/ds-dropdownmenu');
|
|
17
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
18
|
+
var useFocusGroupItem = require('@elliemae/ds-shared/FocusGroup/useFocusGroupItem');
|
|
19
|
+
var Pill = require('./Pill.js');
|
|
20
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
21
|
+
|
|
22
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
|
+
|
|
24
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
25
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
26
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
27
|
+
var DSDropdownMenu__default = /*#__PURE__*/_interopDefaultLegacy(DSDropdownMenu);
|
|
28
|
+
var useFocusGroupItem__default = /*#__PURE__*/_interopDefaultLegacy(useFocusGroupItem);
|
|
29
|
+
|
|
30
|
+
var _ChevronDown;
|
|
31
|
+
|
|
32
|
+
const _excluded = ["containerProps", "label", "variant", "tabIndex", "closeMenuOnItemSelection", "maxWidth", "minWidth"];
|
|
33
|
+
|
|
34
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
35
|
+
|
|
36
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
37
|
+
|
|
38
|
+
function DropdownPill(_ref) {
|
|
39
|
+
let {
|
|
40
|
+
containerProps = {},
|
|
41
|
+
label = '',
|
|
42
|
+
variant,
|
|
43
|
+
tabIndex = -1,
|
|
44
|
+
closeMenuOnItemSelection = false,
|
|
56
45
|
maxWidth,
|
|
46
|
+
minWidth
|
|
47
|
+
} = _ref,
|
|
48
|
+
dropdownProps = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
49
|
+
|
|
50
|
+
const ref = React.useRef(null);
|
|
51
|
+
const [chevronEl, chevronRef] = React.useState();
|
|
52
|
+
const {
|
|
53
|
+
focusFirst
|
|
54
|
+
} = useFocusGroupItem__default["default"](ref);
|
|
55
|
+
return /*#__PURE__*/jsxRuntime.jsx(DSDropdownMenu__default["default"], _objectSpread(_objectSpread({}, dropdownProps), {}, {
|
|
56
|
+
closeMenuOnItemSelection: closeMenuOnItemSelection,
|
|
57
|
+
maxWidth: maxWidth,
|
|
57
58
|
hideIfNotVisible: true,
|
|
58
|
-
menuProps: {
|
|
59
|
-
|
|
59
|
+
menuProps: {
|
|
60
|
+
className: 'dropdown-pill-menu',
|
|
61
|
+
zIndex: 100
|
|
62
|
+
},
|
|
63
|
+
minWidth: minWidth,
|
|
60
64
|
onClose: focusFirst,
|
|
61
65
|
referenceNode: chevronEl,
|
|
62
|
-
triggerComponent:
|
|
66
|
+
triggerComponent: /*#__PURE__*/_jsx__default["default"](Pill.Pill, {
|
|
63
67
|
"data-testid": "dropdown-pill",
|
|
64
68
|
className: "dropdown-pill",
|
|
65
|
-
containerProps: {
|
|
69
|
+
containerProps: _objectSpread({
|
|
70
|
+
role: 'listbox'
|
|
71
|
+
}, containerProps),
|
|
66
72
|
innerRef: ref,
|
|
67
|
-
label,
|
|
68
|
-
rightAddon:
|
|
69
|
-
ref: chevronRef
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
label: label,
|
|
74
|
+
rightAddon: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
75
|
+
ref: chevronRef,
|
|
76
|
+
children: _ChevronDown || (_ChevronDown = /*#__PURE__*/_jsx__default["default"](dsIcons.ChevronDown, {
|
|
77
|
+
className: "dropdown-pill-chevron-down",
|
|
78
|
+
"data-testid": "dropdown-pill-button"
|
|
79
|
+
}))
|
|
80
|
+
}),
|
|
81
|
+
tabIndex: tabIndex,
|
|
82
|
+
variant: variant
|
|
76
83
|
})
|
|
77
|
-
});
|
|
84
|
+
}));
|
|
78
85
|
}
|
|
86
|
+
|
|
79
87
|
const props = {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
/** props injected to component wrapper */
|
|
89
|
+
containerProps: reactDesc.PropTypes.object.description('props injected to component wrapper'),
|
|
90
|
+
|
|
91
|
+
/** labeled pill text label */
|
|
92
|
+
label: reactDesc.PropTypes.string.isRequired.description('pill text label'),
|
|
93
|
+
|
|
94
|
+
/** pill variant */
|
|
95
|
+
variant: reactDesc.PropTypes.oneOf(['value', 'title']).description('pill variant'),
|
|
96
|
+
|
|
97
|
+
/** html focus border */
|
|
98
|
+
tabIndex: reactDesc.PropTypes.number.description('html focus order'),
|
|
99
|
+
|
|
100
|
+
/** close menu on item selection */
|
|
101
|
+
closeMenuOnItemSelection: reactDesc.PropTypes.bool.description('close menu on item selection'),
|
|
102
|
+
|
|
103
|
+
/** pill max width */
|
|
104
|
+
maxWidth: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.number]).description('pill max width'),
|
|
105
|
+
|
|
106
|
+
/** pill min width */
|
|
107
|
+
minWidth: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.number]).description('pill min width')
|
|
87
108
|
};
|
|
88
|
-
|
|
89
|
-
const DSDropdownPillWithSchema = (0, import_react_desc.describe)(DropdownPill);
|
|
109
|
+
const DSDropdownPillWithSchema = reactDesc.describe(DropdownPill);
|
|
90
110
|
DSDropdownPillWithSchema.propTypes = props;
|
|
91
|
-
|
|
92
|
-
|
|
111
|
+
|
|
112
|
+
exports.DSDropdownPillWithSchema = DSDropdownPillWithSchema;
|
|
113
|
+
exports.DropdownPill = DropdownPill;
|
|
@@ -1,76 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
11
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
12
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
13
|
+
require('react');
|
|
14
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
15
|
+
var dsClassnames = require('@elliemae/ds-classnames');
|
|
16
|
+
var dsForm = require('@elliemae/ds-form');
|
|
17
|
+
var Pill = require('./Pill.js');
|
|
18
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
19
|
+
|
|
20
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
21
|
+
|
|
22
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
23
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
24
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
25
|
+
|
|
26
|
+
const _excluded = ["containerProps", "placeholder", "onChange", "onRemove", "value", "type"];
|
|
27
|
+
|
|
28
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
29
|
+
|
|
30
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
31
|
+
const StyledInputPill = dsClassnames.aggregatedClasses(Pill.Pill)('input-pill', null, _ref => {
|
|
32
|
+
let {
|
|
33
|
+
value
|
|
34
|
+
} = _ref;
|
|
35
|
+
return {
|
|
36
|
+
value
|
|
26
37
|
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var InputPill_exports = {};
|
|
29
|
-
__export(InputPill_exports, {
|
|
30
|
-
InputPill: () => InputPill
|
|
31
38
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
onRemove,
|
|
47
|
-
value,
|
|
48
|
-
type,
|
|
49
|
-
...otherProps
|
|
50
|
-
}) {
|
|
51
|
-
let TypeOfInput = import_ds_form.DSInput;
|
|
39
|
+
function InputPill(_ref2) {
|
|
40
|
+
let {
|
|
41
|
+
containerProps = {},
|
|
42
|
+
placeholder = 'Enter Value',
|
|
43
|
+
onChange = () => {},
|
|
44
|
+
onRemove,
|
|
45
|
+
value,
|
|
46
|
+
type
|
|
47
|
+
} = _ref2,
|
|
48
|
+
otherProps = _objectWithoutProperties__default["default"](_ref2, _excluded);
|
|
49
|
+
|
|
50
|
+
let TypeOfInput = dsForm.DSInput; // TODO: implement the DSTimeInput, see how because it returns a moment()
|
|
51
|
+
// TODO: implement the DSDateInput
|
|
52
|
+
|
|
52
53
|
switch (type) {
|
|
53
|
-
case
|
|
54
|
-
TypeOfInput =
|
|
55
|
-
break;
|
|
56
|
-
case "inputMask":
|
|
57
|
-
TypeOfInput = import_ds_form.DSInputMask;
|
|
54
|
+
case 'inputText':
|
|
55
|
+
TypeOfInput = dsForm.DSInput;
|
|
58
56
|
break;
|
|
59
|
-
|
|
57
|
+
|
|
58
|
+
case 'inputMask':
|
|
59
|
+
TypeOfInput = dsForm.DSInputMask;
|
|
60
60
|
break;
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
|
|
63
|
+
return /*#__PURE__*/_jsx__default["default"](StyledInputPill, {
|
|
63
64
|
className: "input-pill",
|
|
64
|
-
classProps: {
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
classProps: {
|
|
66
|
+
value
|
|
67
|
+
},
|
|
68
|
+
containerProps: containerProps,
|
|
69
|
+
label: /*#__PURE__*/jsxRuntime.jsx(TypeOfInput, _objectSpread({
|
|
67
70
|
"data-testid": "input-pill",
|
|
68
|
-
onChange,
|
|
69
|
-
placeholder,
|
|
70
|
-
value
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
rightAddon: value && /* @__PURE__ */ import_react.default.createElement(import_ds_icons.CloseXsmall, {
|
|
71
|
+
onChange: onChange,
|
|
72
|
+
placeholder: placeholder,
|
|
73
|
+
value: value
|
|
74
|
+
}, otherProps)),
|
|
75
|
+
rightAddon: value && /*#__PURE__*/_jsx__default["default"](dsIcons.CloseXsmall, {
|
|
74
76
|
className: "remove-pill-button",
|
|
75
77
|
"data-testid": "remove-pill-button",
|
|
76
78
|
onClick: onRemove
|
|
@@ -78,5 +80,5 @@ function InputPill({
|
|
|
78
80
|
tabIndex: -1
|
|
79
81
|
});
|
|
80
82
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
|
|
84
|
+
exports.InputPill = InputPill;
|
|
@@ -1,102 +1,106 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
33
|
-
var React = __toESM(require("react"));
|
|
34
|
-
var import_react = __toESM(require("react"));
|
|
35
|
-
var import_react_desc = __toESM(require("react-desc"));
|
|
36
|
-
var import_PillGroup = __toESM(require("./PillGroup"));
|
|
37
|
-
var import_LabeledDropdownSinglePill = __toESM(require("./LabeledDropdownPillsTypes/LabeledDropdownSinglePill"));
|
|
38
|
-
var import_LabeledDropdownMultiPill = __toESM(require("./LabeledDropdownPillsTypes/LabeledDropdownMultiPill"));
|
|
39
|
-
var import_LabeledDropdownCascadeMenuPill = __toESM(require("./LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill"));
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
11
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
12
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
13
|
+
require('react');
|
|
14
|
+
var reactDesc = require('react-desc');
|
|
15
|
+
var PillGroup = require('./PillGroup.js');
|
|
16
|
+
var LabeledDropdownSinglePill = require('./LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js');
|
|
17
|
+
var LabeledDropdownMultiPill = require('./LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js');
|
|
18
|
+
var LabeledDropdownCascadeMenuPill = require('./LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js');
|
|
19
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
20
|
+
|
|
21
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
|
+
|
|
23
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
24
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
25
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
26
|
+
|
|
27
|
+
const _excluded = ["label", "value", "type", "onFocusNextGroup", "onFocusPreviousGroup", "onFocusGroupSet", "maxWidth", "minWidth", "fixed"];
|
|
28
|
+
|
|
29
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
30
|
+
|
|
31
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
40
32
|
const DropdownPills = {
|
|
41
|
-
single:
|
|
42
|
-
multi:
|
|
43
|
-
cascaded:
|
|
33
|
+
single: LabeledDropdownSinglePill,
|
|
34
|
+
multi: LabeledDropdownMultiPill,
|
|
35
|
+
cascaded: LabeledDropdownCascadeMenuPill
|
|
44
36
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
maxWidth,
|
|
54
|
-
minWidth,
|
|
55
|
-
fixed,
|
|
56
|
-
...menuProps
|
|
57
|
-
}) {
|
|
58
|
-
const Component = createDropdownPill(type);
|
|
59
|
-
return /* @__PURE__ */ import_react.default.createElement(import_PillGroup.PillGroup, {
|
|
60
|
-
onFocusGroupSet,
|
|
37
|
+
|
|
38
|
+
const createDropdownPill = type => DropdownPills[type] || DropdownPills.single;
|
|
39
|
+
|
|
40
|
+
function LabeledDropdownPills(_ref) {
|
|
41
|
+
let {
|
|
42
|
+
label = '',
|
|
43
|
+
value,
|
|
44
|
+
type,
|
|
61
45
|
onFocusNextGroup,
|
|
62
|
-
onFocusPreviousGroup
|
|
63
|
-
|
|
64
|
-
...menuProps,
|
|
65
|
-
label,
|
|
46
|
+
onFocusPreviousGroup,
|
|
47
|
+
onFocusGroupSet,
|
|
66
48
|
maxWidth,
|
|
67
49
|
minWidth,
|
|
68
|
-
value,
|
|
69
50
|
fixed
|
|
70
|
-
}
|
|
51
|
+
} = _ref,
|
|
52
|
+
menuProps = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
53
|
+
|
|
54
|
+
const Component = createDropdownPill(type);
|
|
55
|
+
return /*#__PURE__*/_jsx__default["default"](PillGroup.PillGroup, {
|
|
56
|
+
onFocusGroupSet: onFocusGroupSet,
|
|
57
|
+
onFocusNextGroup: onFocusNextGroup,
|
|
58
|
+
onFocusPreviousGroup: onFocusPreviousGroup
|
|
59
|
+
}, void 0, /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread(_objectSpread({}, menuProps), {}, {
|
|
60
|
+
label: label,
|
|
61
|
+
maxWidth: maxWidth,
|
|
62
|
+
minWidth: minWidth,
|
|
63
|
+
value: value,
|
|
64
|
+
fixed: fixed
|
|
65
|
+
})));
|
|
71
66
|
}
|
|
67
|
+
|
|
72
68
|
const props = {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
69
|
+
/** pill type */
|
|
70
|
+
type: reactDesc.PropTypes.oneOf(['single', 'multi', 'cascaded']).description('pill type'),
|
|
71
|
+
|
|
72
|
+
/** focus next group callback */
|
|
73
|
+
onFocusNextGroup: reactDesc.PropTypes.func.description('focus next group callback'),
|
|
74
|
+
|
|
75
|
+
/** focus prev group callback */
|
|
76
|
+
onFocusPreviousGroup: reactDesc.PropTypes.func.description('focus prev group callback'),
|
|
77
|
+
|
|
78
|
+
/** focus group set callback */
|
|
79
|
+
onFocusGroupSet: reactDesc.PropTypes.func.description('focus group set callback'),
|
|
80
|
+
|
|
81
|
+
/** pill max width */
|
|
82
|
+
maxWidth: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.number]).description('pill max width'),
|
|
83
|
+
|
|
84
|
+
/** pill min width */
|
|
85
|
+
minWidth: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.number]).description('pill min width'),
|
|
86
|
+
|
|
87
|
+
/** fixed pill */
|
|
88
|
+
fixed: reactDesc.PropTypes.bool.description('fixed pill'),
|
|
89
|
+
|
|
90
|
+
/** pill label text */
|
|
91
|
+
label: reactDesc.PropTypes.string.isRequired.description('pill label text'),
|
|
92
|
+
|
|
93
|
+
/** pill value */
|
|
94
|
+
value: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.shape({
|
|
95
|
+
id: reactDesc.PropTypes.string,
|
|
96
|
+
label: reactDesc.PropTypes.string
|
|
97
|
+
})), reactDesc.PropTypes.shape({
|
|
98
|
+
id: reactDesc.PropTypes.string,
|
|
99
|
+
label: reactDesc.PropTypes.string
|
|
100
|
+
})]).description('pill value')
|
|
97
101
|
};
|
|
98
|
-
|
|
99
|
-
const DSLabeledDropdownPillsWithSchema = (0, import_react_desc.describe)(LabeledDropdownPills);
|
|
102
|
+
const DSLabeledDropdownPillsWithSchema = reactDesc.describe(LabeledDropdownPills);
|
|
100
103
|
DSLabeledDropdownPillsWithSchema.propTypes = props;
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
|
|
105
|
+
exports.DSLabeledDropdownPillsWithSchema = DSLabeledDropdownPillsWithSchema;
|
|
106
|
+
exports.LabeledDropdownPills = LabeledDropdownPills;
|