@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
package/cjs/deprecated/index.js
CHANGED
|
@@ -1,43 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
__reExport(deprecated_exports, __toESM(require("./PillGroup")));
|
|
35
|
-
__reExport(deprecated_exports, __toESM(require("./LabeledDropdownPills")));
|
|
36
|
-
__reExport(deprecated_exports, __toESM(require("./LabeledPills")));
|
|
37
|
-
__reExport(deprecated_exports, __toESM(require("./DropdownPill")));
|
|
38
|
-
__reExport(deprecated_exports, __toESM(require("./RemovablePill")));
|
|
39
|
-
__reExport(deprecated_exports, __toESM(require("./ReadOnlyPill")));
|
|
40
|
-
__reExport(deprecated_exports, __toESM(require("./OverflowPill")));
|
|
41
|
-
var import_Pill = __toESM(require("./Pill"));
|
|
42
|
-
module.exports = __toCommonJS(deprecated_exports);
|
|
43
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Pill = require('./Pill.js');
|
|
6
|
+
var PillGroup = require('./PillGroup.js');
|
|
7
|
+
var LabeledDropdownPills = require('./LabeledDropdownPills.js');
|
|
8
|
+
var LabeledPills = require('./LabeledPills.js');
|
|
9
|
+
var DropdownPill = require('./DropdownPill.js');
|
|
10
|
+
var RemovablePill = require('./RemovablePill.js');
|
|
11
|
+
var ReadOnlyPill = require('./ReadOnlyPill.js');
|
|
12
|
+
var OverflowPill = require('./OverflowPill.js');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.DSPillWithSchema = Pill.DSPillWithSchema;
|
|
17
|
+
exports.Pill = Pill.Pill;
|
|
18
|
+
exports["default"] = Pill.Pill;
|
|
19
|
+
exports.Container = PillGroup.Container;
|
|
20
|
+
exports.DSPillGroupWithSchema = PillGroup.DSPillGroupWithSchema;
|
|
21
|
+
exports.PillGroup = PillGroup.PillGroup;
|
|
22
|
+
exports.DSLabeledDropdownPillsWithSchema = LabeledDropdownPills.DSLabeledDropdownPillsWithSchema;
|
|
23
|
+
exports.LabeledDropdownPills = LabeledDropdownPills.LabeledDropdownPills;
|
|
24
|
+
exports.DSLabeledPillsWithSchema = LabeledPills.DSLabeledPillsWithSchema;
|
|
25
|
+
exports.LabeledPills = LabeledPills.LabeledPills;
|
|
26
|
+
exports.DSDropdownPillWithSchema = DropdownPill.DSDropdownPillWithSchema;
|
|
27
|
+
exports.DropdownPill = DropdownPill.DropdownPill;
|
|
28
|
+
exports.DSRemovablePillWithSchema = RemovablePill.DSRemovablePillWithSchema;
|
|
29
|
+
exports.RemovablePill = RemovablePill.RemovablePill;
|
|
30
|
+
exports.DSReadOnlyPillWithSchema = ReadOnlyPill.DSReadOnlyPillWithSchema;
|
|
31
|
+
exports.ReadOnlyPill = ReadOnlyPill.ReadOnlyPill;
|
|
32
|
+
exports.DSOverflowPillWithSchema = OverflowPill.DSOverflowPillWithSchema;
|
|
33
|
+
exports.OverflowPill = OverflowPill.OverflowPill;
|
package/cjs/index.d.js
CHANGED
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
9
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(module2))
|
|
11
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (module2, isNodeMode) => {
|
|
17
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
-
var index_d_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
|
-
module.exports = __toCommonJS(index_d_exports);
|
|
27
|
-
//# sourceMappingURL=index.d.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
package/cjs/index.js
CHANGED
|
@@ -1,37 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Pill = require('./deprecated/Pill.js');
|
|
6
|
+
var PillGroup = require('./deprecated/PillGroup.js');
|
|
7
|
+
var LabeledDropdownPills = require('./deprecated/LabeledDropdownPills.js');
|
|
8
|
+
var LabeledPills = require('./deprecated/LabeledPills.js');
|
|
9
|
+
var DropdownPill = require('./deprecated/DropdownPill.js');
|
|
10
|
+
var RemovablePill = require('./deprecated/RemovablePill.js');
|
|
11
|
+
var ReadOnlyPill = require('./deprecated/ReadOnlyPill.js');
|
|
12
|
+
var OverflowPill = require('./deprecated/OverflowPill.js');
|
|
13
|
+
var Pill$1 = require('./components/Pill.js');
|
|
14
|
+
var PillGroup$1 = require('./components/PillGroup.js');
|
|
15
|
+
var PillButton = require('./components/PillButton.js');
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
exports.DSPillWithSchema = Pill.DSPillWithSchema;
|
|
20
|
+
exports.Pill = Pill.Pill;
|
|
21
|
+
exports["default"] = Pill.Pill;
|
|
22
|
+
exports.Container = PillGroup.Container;
|
|
23
|
+
exports.DSPillGroupWithSchema = PillGroup.DSPillGroupWithSchema;
|
|
24
|
+
exports.PillGroup = PillGroup.PillGroup;
|
|
25
|
+
exports.DSLabeledDropdownPillsWithSchema = LabeledDropdownPills.DSLabeledDropdownPillsWithSchema;
|
|
26
|
+
exports.LabeledDropdownPills = LabeledDropdownPills.LabeledDropdownPills;
|
|
27
|
+
exports.DSLabeledPillsWithSchema = LabeledPills.DSLabeledPillsWithSchema;
|
|
28
|
+
exports.LabeledPills = LabeledPills.LabeledPills;
|
|
29
|
+
exports.DSDropdownPillWithSchema = DropdownPill.DSDropdownPillWithSchema;
|
|
30
|
+
exports.DropdownPill = DropdownPill.DropdownPill;
|
|
31
|
+
exports.DSRemovablePillWithSchema = RemovablePill.DSRemovablePillWithSchema;
|
|
32
|
+
exports.RemovablePill = RemovablePill.RemovablePill;
|
|
33
|
+
exports.DSReadOnlyPillWithSchema = ReadOnlyPill.DSReadOnlyPillWithSchema;
|
|
34
|
+
exports.ReadOnlyPill = ReadOnlyPill.ReadOnlyPill;
|
|
35
|
+
exports.DSOverflowPillWithSchema = OverflowPill.DSOverflowPillWithSchema;
|
|
36
|
+
exports.OverflowPill = OverflowPill.OverflowPill;
|
|
37
|
+
exports.DSPillV2 = Pill$1.DSPillV2;
|
|
38
|
+
exports.DSPillV2WithSchema = Pill$1.DSPillV2WithSchema;
|
|
39
|
+
exports.DSPillGroupV2 = PillGroup$1.DSPillGroupV2;
|
|
40
|
+
exports.DSPillGroupV2Context = PillGroup$1.DSPillGroupV2Context;
|
|
41
|
+
exports.DSPillGroupV2WithSchema = PillGroup$1.DSPillGroupV2WithSchema;
|
|
42
|
+
exports.DSPillButton = PillButton.DSPillButton;
|
|
43
|
+
exports.DSPillButtonWithSchema = PillButton.DSPillButtonWithSchema;
|
package/cjs/props.js
CHANGED
|
@@ -1,95 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var props_exports = {};
|
|
29
|
-
__export(props_exports, {
|
|
30
|
-
DSPillButtonDefaultProps: () => DSPillButtonDefaultProps,
|
|
31
|
-
DSPillButtonPropTypes: () => DSPillButtonPropTypes,
|
|
32
|
-
DSPillGroupDefaultProps: () => DSPillGroupDefaultProps,
|
|
33
|
-
DSPillGroupPropTypes: () => DSPillGroupPropTypes,
|
|
34
|
-
DSPillV2DefaultProps: () => DSPillV2DefaultProps,
|
|
35
|
-
DSPillV2PropTypes: () => DSPillV2PropTypes
|
|
36
|
-
});
|
|
37
|
-
var React = __toESM(require("react"));
|
|
38
|
-
var import_react_desc = __toESM(require("react-desc"));
|
|
39
|
-
var import_ds_form = __toESM(require("@elliemae/ds-form"));
|
|
40
|
-
const pillTypes = import_react_desc.PropTypes.oneOf(["label", "value", "input", "dropdown", "removable", "readonly"]);
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var reactDesc = require('react-desc');
|
|
6
|
+
var dsForm = require('@elliemae/ds-form');
|
|
7
|
+
|
|
8
|
+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
9
|
+
const pillTypes = reactDesc.PropTypes.oneOf(['label', 'value', 'input', 'dropdown', 'removable', 'readonly']);
|
|
41
10
|
const DSPillV2PropTypes = {
|
|
42
|
-
label:
|
|
43
|
-
type: pillTypes.description(
|
|
44
|
-
innerRef:
|
|
45
|
-
size:
|
|
46
|
-
ariaLabel:
|
|
47
|
-
labelTruncated:
|
|
48
|
-
tooltipValue:
|
|
49
|
-
iconLeft:
|
|
50
|
-
iconRight:
|
|
51
|
-
onRemove:
|
|
52
|
-
inputPlaceholder:
|
|
53
|
-
onInputChange:
|
|
54
|
-
onInputClear:
|
|
55
|
-
inputWidth:
|
|
56
|
-
dropdownProps:
|
|
57
|
-
onDropdownClick:
|
|
11
|
+
label: reactDesc.PropTypes.string.description('Label to show in the pill').isRequired,
|
|
12
|
+
type: pillTypes.description('The type of pill that you want to render').isRequired,
|
|
13
|
+
innerRef: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.object, reactDesc.PropTypes.func]).description('Reference to the focuseable internal element of each pill (remove icons, inputs, dropdown, etc.)').defaultValue(() => null),
|
|
14
|
+
size: reactDesc.PropTypes.oneOf(['s', 'm']).description('Vertical pill size').defaultValue('m'),
|
|
15
|
+
ariaLabel: reactDesc.PropTypes.string.description('Aria label for the pill. If not provided we will use the label').defaultValue(''),
|
|
16
|
+
labelTruncated: reactDesc.PropTypes.bool.description('Whether to truncate the pills label').defaultValue(true),
|
|
17
|
+
tooltipValue: reactDesc.PropTypes.string.description('String to show as a tooltip in the value pill').defaultValue(''),
|
|
18
|
+
iconLeft: reactDesc.PropTypes.node.description('A component to show int the left of a readonly pill').defaultValue(null),
|
|
19
|
+
iconRight: reactDesc.PropTypes.node.description('A component to show in the right of a readonly pill').defaultValue(null),
|
|
20
|
+
onRemove: reactDesc.PropTypes.func.description('Callback triggered when removing a pill with the close icon').defaultValue(() => null),
|
|
21
|
+
inputPlaceholder: reactDesc.PropTypes.string.description('Placeholder for the input pill').defaultValue(''),
|
|
22
|
+
onInputChange: reactDesc.PropTypes.func.description('Callback triggered when user provides input to the input pill').defaultValue(() => null),
|
|
23
|
+
onInputClear: reactDesc.PropTypes.func.description('Callback triggered when the user clears an input pill').defaultValue(() => null),
|
|
24
|
+
inputWidth: reactDesc.PropTypes.number.description('Width in pixels for the input tag in the input pill').defaultValue(150),
|
|
25
|
+
dropdownProps: reactDesc.PropTypes.object.description('Properties that will be used for the dropdown-menu').defaultValue({}),
|
|
26
|
+
onDropdownClick: reactDesc.PropTypes.func.description('Callback when dropdown button is clicked or pressed').defaultValue(() => null)
|
|
58
27
|
};
|
|
59
28
|
const DSPillButtonPropTypes = {
|
|
60
|
-
type:
|
|
61
|
-
width:
|
|
62
|
-
height:
|
|
29
|
+
type: reactDesc.PropTypes.oneOf(['only', 'left', 'right']).description('The position in which this button will be placed. Only used for css styling internally').defaultValue('right'),
|
|
30
|
+
width: reactDesc.PropTypes.string.description('Width of the button').defaultValue('100%'),
|
|
31
|
+
height: reactDesc.PropTypes.string.description('Height of the button').defaultValue('100%')
|
|
63
32
|
};
|
|
64
33
|
const DSPillGroupPropTypes = {
|
|
65
|
-
width:
|
|
66
|
-
innerRef:
|
|
34
|
+
width: reactDesc.PropTypes.string.description('Width of the group').defaultValue('fit-content'),
|
|
35
|
+
innerRef: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.object, reactDesc.PropTypes.func]).description('Reference to the pill group wrapper').defaultValue(() => null)
|
|
67
36
|
};
|
|
68
37
|
const DSPillV2DefaultProps = {
|
|
69
38
|
innerRef: () => null,
|
|
70
|
-
ariaLabel:
|
|
71
|
-
size:
|
|
39
|
+
ariaLabel: '',
|
|
40
|
+
size: 'm',
|
|
72
41
|
labelTruncated: true,
|
|
73
|
-
tooltipValue:
|
|
42
|
+
tooltipValue: '',
|
|
74
43
|
iconLeft: null,
|
|
75
44
|
iconRight: null,
|
|
76
45
|
onRemove: () => null,
|
|
77
|
-
inputPlaceholder:
|
|
46
|
+
inputPlaceholder: '',
|
|
78
47
|
onInputChange: () => null,
|
|
79
48
|
onInputClear: () => null,
|
|
80
49
|
inputWidth: 72,
|
|
81
|
-
inputRender:
|
|
50
|
+
inputRender: dsForm.DSInput,
|
|
82
51
|
dropdownProps: {},
|
|
83
52
|
onDropdownClick: () => null
|
|
84
53
|
};
|
|
85
54
|
const DSPillButtonDefaultProps = {
|
|
86
|
-
type:
|
|
87
|
-
width:
|
|
88
|
-
height:
|
|
55
|
+
type: 'right',
|
|
56
|
+
width: '100%',
|
|
57
|
+
height: '100%'
|
|
89
58
|
};
|
|
90
59
|
const DSPillGroupDefaultProps = {
|
|
91
|
-
width:
|
|
60
|
+
width: 'fit-content',
|
|
92
61
|
innerRef: () => null
|
|
93
62
|
};
|
|
94
|
-
|
|
95
|
-
|
|
63
|
+
|
|
64
|
+
exports.DSPillButtonDefaultProps = DSPillButtonDefaultProps;
|
|
65
|
+
exports.DSPillButtonPropTypes = DSPillButtonPropTypes;
|
|
66
|
+
exports.DSPillGroupDefaultProps = DSPillGroupDefaultProps;
|
|
67
|
+
exports.DSPillGroupPropTypes = DSPillGroupPropTypes;
|
|
68
|
+
exports.DSPillV2DefaultProps = DSPillV2DefaultProps;
|
|
69
|
+
exports.DSPillV2PropTypes = DSPillV2PropTypes;
|
package/cjs/utils.js
CHANGED
|
@@ -1,46 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
|
+
|
|
9
|
+
const setMultipleRefs = function () {
|
|
10
|
+
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
11
|
+
refs[_key] = arguments[_key];
|
|
17
12
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
|
|
14
|
+
return _ref => {
|
|
15
|
+
refs.forEach(ref => {
|
|
16
|
+
if (!ref || !_ref) return;
|
|
17
|
+
|
|
18
|
+
if (typeof ref === 'function') {
|
|
19
|
+
ref(_ref);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (ref) ref.current = _ref;
|
|
24
|
+
});
|
|
26
25
|
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var utils_exports = {};
|
|
29
|
-
__export(utils_exports, {
|
|
30
|
-
setMultipleRefs: () => setMultipleRefs
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
const setMultipleRefs = (...refs) => (_ref) => {
|
|
34
|
-
refs.forEach((ref) => {
|
|
35
|
-
if (!ref || !_ref)
|
|
36
|
-
return;
|
|
37
|
-
if (typeof ref === "function") {
|
|
38
|
-
ref(_ref);
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
if (ref)
|
|
42
|
-
ref.current = _ref;
|
|
43
|
-
});
|
|
44
26
|
};
|
|
45
|
-
|
|
46
|
-
|
|
27
|
+
|
|
28
|
+
exports.setMultipleRefs = setMultipleRefs;
|
package/esm/components/Pill.js
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import 'react';
|
|
8
|
+
import { describe } from 'react-desc';
|
|
9
|
+
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
|
|
10
|
+
import { DSPillV2PropTypes, DSPillV2DefaultProps } from '../props.js';
|
|
11
|
+
import { DropdownPill } from './types/DropdownPill.js';
|
|
12
|
+
import { InputPill } from './types/InputPill.js';
|
|
13
|
+
import { LabelPill } from './types/LabelPill.js';
|
|
14
|
+
import { ReadOnlyPill } from './types/ReadOnlyPill.js';
|
|
15
|
+
import { RemovablePill } from './types/RemovablePill.js';
|
|
16
|
+
import { ValuePill } from './types/ValuePill.js';
|
|
17
|
+
import { jsx } from 'react/jsx-runtime';
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
|
|
21
|
+
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(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; }
|
|
7
22
|
const pillComponentGetter = {
|
|
8
23
|
dropdown: DropdownPill,
|
|
9
24
|
input: InputPill,
|
|
@@ -12,20 +27,18 @@ const pillComponentGetter = {
|
|
|
12
27
|
removable: RemovablePill,
|
|
13
28
|
value: ValuePill
|
|
14
29
|
};
|
|
15
|
-
|
|
30
|
+
|
|
31
|
+
const DSPillV2 = props => {
|
|
16
32
|
const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillV2DefaultProps);
|
|
17
33
|
useValidateTypescriptPropTypes(propsWithDefaults, DSPillV2PropTypes);
|
|
18
|
-
const {
|
|
34
|
+
const {
|
|
35
|
+
type
|
|
36
|
+
} = propsWithDefaults;
|
|
19
37
|
const PillComponent = pillComponentGetter[type];
|
|
20
|
-
return
|
|
21
|
-
...propsWithDefaults
|
|
22
|
-
});
|
|
38
|
+
return /*#__PURE__*/jsx(PillComponent, _objectSpread({}, propsWithDefaults));
|
|
23
39
|
};
|
|
24
|
-
|
|
25
|
-
const DSPillV2WithSchema = describe(DSPillV2).description(
|
|
40
|
+
|
|
41
|
+
const DSPillV2WithSchema = describe(DSPillV2).description('Pill');
|
|
26
42
|
DSPillV2WithSchema.propTypes = DSPillV2PropTypes;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
DSPillV2WithSchema
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=Pill.js.map
|
|
43
|
+
|
|
44
|
+
export { DSPillV2, DSPillV2WithSchema };
|
|
@@ -1,29 +1,46 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _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); 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 = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(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; }
|
|
7
20
|
const typeToClassName = {
|
|
8
|
-
only:
|
|
9
|
-
left:
|
|
10
|
-
right:
|
|
21
|
+
only: 'ds-pill-button-only',
|
|
22
|
+
left: 'ds-pill-button-left',
|
|
23
|
+
right: 'ds-pill-button-right'
|
|
11
24
|
};
|
|
12
|
-
|
|
25
|
+
|
|
26
|
+
const DSPillButton = props => {
|
|
13
27
|
const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillButtonDefaultProps);
|
|
14
28
|
useValidateTypescriptPropTypes(propsWithDefaults, DSPillButtonPropTypes);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
29
|
+
|
|
30
|
+
const {
|
|
31
|
+
type,
|
|
32
|
+
children
|
|
33
|
+
} = propsWithDefaults,
|
|
34
|
+
rest = _objectWithoutProperties(propsWithDefaults, _excluded);
|
|
35
|
+
|
|
36
|
+
return /*#__PURE__*/jsx(StyledPillButton, _objectSpread(_objectSpread({}, rest), {}, {
|
|
18
37
|
buttonType: "raw",
|
|
19
|
-
className:
|
|
20
|
-
|
|
38
|
+
className: "".concat(typeToClassName[type], " ").concat(rest.className),
|
|
39
|
+
children: children
|
|
40
|
+
}));
|
|
21
41
|
};
|
|
22
|
-
|
|
23
|
-
const DSPillButtonWithSchema = describe(DSPillButton).description(
|
|
42
|
+
|
|
43
|
+
const DSPillButtonWithSchema = describe(DSPillButton).description('Pill button');
|
|
24
44
|
DSPillButtonWithSchema.propTypes = DSPillButtonPropTypes;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
DSPillButtonWithSchema
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=PillButton.js.map
|
|
45
|
+
|
|
46
|
+
export { DSPillButton, DSPillButtonWithSchema };
|
|
@@ -1,43 +1,53 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
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({
|
|
9
14
|
onKeyboardRemove: () => null
|
|
10
15
|
});
|
|
11
|
-
|
|
16
|
+
|
|
17
|
+
const DSPillGroupV2 = props => {
|
|
12
18
|
const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillGroupDefaultProps);
|
|
13
19
|
useValidateTypescriptPropTypes(propsWithDefaults, DSPillGroupPropTypes);
|
|
14
|
-
const pillGroupUid = useMemo(() =>
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
+
|
|
19
30
|
if (pillIndex > 0) {
|
|
20
31
|
elems[pillIndex - 1].focus();
|
|
21
32
|
} else if (pillIndex + 1 < elems.length) {
|
|
22
33
|
elems[pillIndex + 1].focus();
|
|
23
34
|
}
|
|
24
35
|
}, [pillGroupUid]);
|
|
25
|
-
return
|
|
26
|
-
value: {
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
return /*#__PURE__*/_jsx(DSPillGroupV2Context.Provider, {
|
|
37
|
+
value: {
|
|
38
|
+
onKeyboardRemove
|
|
39
|
+
}
|
|
40
|
+
}, void 0, /*#__PURE__*/jsx(StyledPillGroup, {
|
|
41
|
+
width: width,
|
|
29
42
|
id: pillGroupUid,
|
|
30
|
-
cols:
|
|
43
|
+
cols: React.Children.map(children, () => 'auto'),
|
|
31
44
|
gutter: "2px",
|
|
32
|
-
ref: innerRef
|
|
33
|
-
|
|
45
|
+
ref: innerRef,
|
|
46
|
+
children: children
|
|
47
|
+
}));
|
|
34
48
|
};
|
|
35
|
-
|
|
49
|
+
|
|
36
50
|
const DSPillGroupV2WithSchema = describe(DSPillGroupV2);
|
|
37
51
|
DSPillGroupV2WithSchema.propTypes = DSPillGroupPropTypes;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
DSPillGroupV2Context,
|
|
41
|
-
DSPillGroupV2WithSchema
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=PillGroup.js.map
|
|
52
|
+
|
|
53
|
+
export { DSPillGroupV2, DSPillGroupV2Context, DSPillGroupV2WithSchema };
|