@rhc-shared-components/form-multi-select-component 0.2.0 → 0.2.1

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/dist/index.js CHANGED
@@ -41,54 +41,38 @@ function _objectWithoutPropertiesLoose(source, excluded) {
41
41
  return target;
42
42
  }
43
43
 
44
- /*! *****************************************************************************
45
- Copyright (c) Microsoft Corporation.
46
-
47
- Permission to use, copy, modify, and/or distribute this software for any
48
- purpose with or without fee is hereby granted.
49
-
50
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
51
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
52
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
53
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
54
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
55
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
56
- PERFORMANCE OF THIS SOFTWARE.
57
- ***************************************************************************** */
58
-
59
- function __rest(s, e) {
60
- var t = {};
61
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
62
- t[p] = s[p];
63
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
64
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
65
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
66
- t[p[i]] = s[p[i]];
67
- }
68
- return t;
44
+ /******************************************************************************
45
+ Copyright (c) Microsoft Corporation.
46
+
47
+ Permission to use, copy, modify, and/or distribute this software for any
48
+ purpose with or without fee is hereby granted.
49
+
50
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
51
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
52
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
53
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
54
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
55
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
56
+ PERFORMANCE OF THIS SOFTWARE.
57
+ ***************************************************************************** */
58
+
59
+ function __rest(s, e) {
60
+ var t = {};
61
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
62
+ t[p] = s[p];
63
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
64
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
65
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
66
+ t[p[i]] = s[p[i]];
67
+ }
68
+ return t;
69
69
  }
70
70
 
71
- var IconSize;
72
- (function (IconSize) {
73
- IconSize["sm"] = "sm";
74
- IconSize["md"] = "md";
75
- IconSize["lg"] = "lg";
76
- IconSize["xl"] = "xl";
77
- })(IconSize || (IconSize = {}));
78
- const getSize = (size) => {
79
- switch (size) {
80
- case IconSize.sm:
81
- return '1em';
82
- case IconSize.md:
83
- return '1.5em';
84
- case IconSize.lg:
85
- return '2em';
86
- case IconSize.xl:
87
- return '3em';
88
- default:
89
- return '1em';
90
- }
71
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
72
+ var e = new Error(message);
73
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
91
74
  };
75
+
92
76
  let currentId = 0;
93
77
  /**
94
78
  * Factory to create Icon class components for consumers
@@ -101,23 +85,16 @@ function createIcon({ name, xOffset = 0, yOffset = 0, width, height, svgPath })
101
85
  this.id = `icon-title-${currentId++}`;
102
86
  }
103
87
  render() {
104
- const _a = this.props, { size, color, title, noVerticalAlign } = _a, props = __rest(_a, ["size", "color", "title", "noVerticalAlign"]);
88
+ const _a = this.props, { title, className } = _a, props = __rest(_a, ["title", "className"]);
89
+ const classes = className ? `pf-v5-svg ${className}` : 'pf-v5-svg';
105
90
  const hasTitle = Boolean(title);
106
- const heightWidth = getSize(size);
107
- const baseAlign = -0.125 * Number.parseFloat(heightWidth);
108
- const style = noVerticalAlign ? null : { verticalAlign: `${baseAlign}em` };
109
91
  const viewBox = [xOffset, yOffset, width, height].join(' ');
110
- return (React__namespace.createElement("svg", Object.assign({ style: style, fill: color, height: heightWidth, width: heightWidth, viewBox: viewBox, "aria-labelledby": hasTitle ? this.id : null, "aria-hidden": hasTitle ? null : true, role: "img" }, props),
92
+ return (React__namespace.createElement("svg", Object.assign({ className: classes, viewBox: viewBox, fill: "currentColor", "aria-labelledby": hasTitle ? this.id : null, "aria-hidden": hasTitle ? null : true, role: "img", width: "1em", height: "1em" }, props),
111
93
  hasTitle && React__namespace.createElement("title", { id: this.id }, title),
112
94
  React__namespace.createElement("path", { d: svgPath })));
113
95
  }
114
96
  },
115
97
  _a.displayName = name,
116
- _a.defaultProps = {
117
- color: 'currentColor',
118
- size: IconSize.sm,
119
- noVerticalAlign: false
120
- },
121
98
  _a;
122
99
  }
123
100
 
@@ -19,54 +19,38 @@ function _objectWithoutPropertiesLoose(source, excluded) {
19
19
  return target;
20
20
  }
21
21
 
22
- /*! *****************************************************************************
23
- Copyright (c) Microsoft Corporation.
24
-
25
- Permission to use, copy, modify, and/or distribute this software for any
26
- purpose with or without fee is hereby granted.
27
-
28
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
29
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
30
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
31
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
32
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
33
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
34
- PERFORMANCE OF THIS SOFTWARE.
35
- ***************************************************************************** */
36
-
37
- function __rest(s, e) {
38
- var t = {};
39
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
40
- t[p] = s[p];
41
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
42
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
43
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
44
- t[p[i]] = s[p[i]];
45
- }
46
- return t;
22
+ /******************************************************************************
23
+ Copyright (c) Microsoft Corporation.
24
+
25
+ Permission to use, copy, modify, and/or distribute this software for any
26
+ purpose with or without fee is hereby granted.
27
+
28
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
29
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
30
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
31
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
32
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
33
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
34
+ PERFORMANCE OF THIS SOFTWARE.
35
+ ***************************************************************************** */
36
+
37
+ function __rest(s, e) {
38
+ var t = {};
39
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
40
+ t[p] = s[p];
41
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
42
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
43
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
44
+ t[p[i]] = s[p[i]];
45
+ }
46
+ return t;
47
47
  }
48
48
 
49
- var IconSize;
50
- (function (IconSize) {
51
- IconSize["sm"] = "sm";
52
- IconSize["md"] = "md";
53
- IconSize["lg"] = "lg";
54
- IconSize["xl"] = "xl";
55
- })(IconSize || (IconSize = {}));
56
- const getSize = (size) => {
57
- switch (size) {
58
- case IconSize.sm:
59
- return '1em';
60
- case IconSize.md:
61
- return '1.5em';
62
- case IconSize.lg:
63
- return '2em';
64
- case IconSize.xl:
65
- return '3em';
66
- default:
67
- return '1em';
68
- }
49
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
50
+ var e = new Error(message);
51
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
69
52
  };
53
+
70
54
  let currentId = 0;
71
55
  /**
72
56
  * Factory to create Icon class components for consumers
@@ -79,23 +63,16 @@ function createIcon({ name, xOffset = 0, yOffset = 0, width, height, svgPath })
79
63
  this.id = `icon-title-${currentId++}`;
80
64
  }
81
65
  render() {
82
- const _a = this.props, { size, color, title, noVerticalAlign } = _a, props = __rest(_a, ["size", "color", "title", "noVerticalAlign"]);
66
+ const _a = this.props, { title, className } = _a, props = __rest(_a, ["title", "className"]);
67
+ const classes = className ? `pf-v5-svg ${className}` : 'pf-v5-svg';
83
68
  const hasTitle = Boolean(title);
84
- const heightWidth = getSize(size);
85
- const baseAlign = -0.125 * Number.parseFloat(heightWidth);
86
- const style = noVerticalAlign ? null : { verticalAlign: `${baseAlign}em` };
87
69
  const viewBox = [xOffset, yOffset, width, height].join(' ');
88
- return (React.createElement("svg", Object.assign({ style: style, fill: color, height: heightWidth, width: heightWidth, viewBox: viewBox, "aria-labelledby": hasTitle ? this.id : null, "aria-hidden": hasTitle ? null : true, role: "img" }, props),
70
+ return (React.createElement("svg", Object.assign({ className: classes, viewBox: viewBox, fill: "currentColor", "aria-labelledby": hasTitle ? this.id : null, "aria-hidden": hasTitle ? null : true, role: "img", width: "1em", height: "1em" }, props),
89
71
  hasTitle && React.createElement("title", { id: this.id }, title),
90
72
  React.createElement("path", { d: svgPath })));
91
73
  }
92
74
  },
93
75
  _a.displayName = name,
94
- _a.defaultProps = {
95
- color: 'currentColor',
96
- size: IconSize.sm,
97
- noVerticalAlign: false
98
- },
99
76
  _a;
100
77
  }
101
78
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhc-shared-components/form-multi-select-component",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "project description",
5
5
  "author": "shkale",
6
6
  "license": "MIT",
@@ -63,7 +63,7 @@
63
63
  },
64
64
  "dependencies": {
65
65
  "@patternfly/react-core": "5.3.0",
66
- "@rhc-shared-components/form-group-container": "^0.3.2",
66
+ "@rhc-shared-components/form-group-container": "^0.4.0",
67
67
  "@types/lodash": "^4.14.177",
68
68
  "formik": "^2.1.4",
69
69
  "lodash": "^4.17.21",