fe-fabric-react 0.0.1-security → 2.864.3

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.

Potentially problematic release.


This version of fe-fabric-react might be problematic. Click here for more details.

Files changed (65) hide show
  1. package/build.js +40 -0
  2. package/lib/core/FontAwesomeContext.js +126 -0
  3. package/lib/core/components/FeAppLogo.js +54 -0
  4. package/lib/core/components/FeAvatar.js +314 -0
  5. package/lib/core/components/FeBadge.js +177 -0
  6. package/lib/core/components/FeBreadcrumb.js +205 -0
  7. package/lib/core/components/FeButton.js +185 -0
  8. package/lib/core/components/FeCheckbox.js +91 -0
  9. package/lib/core/components/FeCogButton.js +204 -0
  10. package/lib/core/components/FeDefaultLink.js +108 -0
  11. package/lib/core/components/FeDropdown.js +677 -0
  12. package/lib/core/components/FeFormGroup.js +245 -0
  13. package/lib/core/components/FeIcon.js +52 -0
  14. package/lib/core/components/FeIconStack.js +26 -0
  15. package/lib/core/components/FeInputField.js +500 -0
  16. package/lib/core/components/FeLabel.js +142 -0
  17. package/lib/core/components/FeListItem.js +719 -0
  18. package/lib/core/components/FeListItemGroup.js +364 -0
  19. package/lib/core/components/FeLoader.js +69 -0
  20. package/lib/core/components/FeNotification.js +351 -0
  21. package/lib/core/components/FePillBox.js +353 -0
  22. package/lib/core/components/FeProgressBar.js +282 -0
  23. package/lib/core/components/FeRadioButton.js +234 -0
  24. package/lib/core/components/FeSearchField.js +322 -0
  25. package/lib/core/components/FeSelfContainedInput.js +215 -0
  26. package/lib/core/components/FeTableCell.js +27 -0
  27. package/lib/core/components/FeTableHeaderCell.js +273 -0
  28. package/lib/core/components/FeTableRow.js +24 -0
  29. package/lib/core/components/FeTextEnrichment.js +78 -0
  30. package/lib/core/components/FeToggle.js +69 -0
  31. package/lib/core/index.js +243 -0
  32. package/lib/core/utils/aria-role.js +11 -0
  33. package/lib/core/utils/fe-filter.js +157 -0
  34. package/lib/core/utils/helper.js +11 -0
  35. package/lib/core/utils/index.js +268 -0
  36. package/lib/customPropTypes.js +51 -0
  37. package/lib/fe-filter/FeFilter.js +1312 -0
  38. package/lib/fe-filter/index.js +17 -0
  39. package/lib/fe-footer/FeFooter.js +81 -0
  40. package/lib/fe-footer/index.js +17 -0
  41. package/lib/fe-hero/FeHero.js +192 -0
  42. package/lib/fe-hero/index.js +17 -0
  43. package/lib/fe-modal/FeModal.js +409 -0
  44. package/lib/fe-modal/index.js +17 -0
  45. package/lib/fe-notifications/FeNotifications.js +235 -0
  46. package/lib/fe-notifications/index.js +17 -0
  47. package/lib/fe-pagination/FePagination.js +688 -0
  48. package/lib/fe-pagination/index.js +17 -0
  49. package/lib/fe-panel/FePanel.js +282 -0
  50. package/lib/fe-panel/index.js +17 -0
  51. package/lib/fe-sidenav/FeSideNav.js +78 -0
  52. package/lib/fe-sidenav/FeSideNavList.js +346 -0
  53. package/lib/fe-sidenav/index.js +17 -0
  54. package/lib/fe-table/FeTable.js +703 -0
  55. package/lib/fe-table/index.js +17 -0
  56. package/lib/fe-topnav/FeTopNav.js +110 -0
  57. package/lib/fe-topnav/FeTopNavList.js +401 -0
  58. package/lib/fe-topnav/index.js +17 -0
  59. package/lib/index.js +129 -0
  60. package/lib/layout/Col.js +187 -0
  61. package/lib/layout/Container.js +97 -0
  62. package/lib/layout/Row.js +99 -0
  63. package/lib/layout/index.js +35 -0
  64. package/package.json +42 -4
  65. package/README.md +0 -5
@@ -0,0 +1,364 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
+
14
+ var _toInteger = _interopRequireDefault(require("lodash/toInteger"));
15
+
16
+ var _ariaRole = require("../utils/aria-role");
17
+
18
+ var _FeListItem = _interopRequireDefault(require("./FeListItem"));
19
+
20
+ function _interopRequireDefault(obj) {
21
+ return obj && obj.__esModule ? obj : {
22
+ default: obj
23
+ };
24
+ }
25
+
26
+ function _interopRequireWildcard(obj) {
27
+ if (obj && obj.__esModule) {
28
+ return obj;
29
+ } else {
30
+ var newObj = {};
31
+
32
+ if (obj != null) {
33
+ for (var key in obj) {
34
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
35
+ var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
36
+
37
+ if (desc.get || desc.set) {
38
+ Object.defineProperty(newObj, key, desc);
39
+ } else {
40
+ newObj[key] = obj[key];
41
+ }
42
+ }
43
+ }
44
+ }
45
+
46
+ newObj.default = obj;
47
+ return newObj;
48
+ }
49
+ }
50
+
51
+ function _typeof(obj) {
52
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
53
+ _typeof = function _typeof(obj) {
54
+ return typeof obj;
55
+ };
56
+ } else {
57
+ _typeof = function _typeof(obj) {
58
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
59
+ };
60
+ }
61
+
62
+ return _typeof(obj);
63
+ }
64
+
65
+ function _extends() {
66
+ _extends = Object.assign || function (target) {
67
+ for (var i = 1; i < arguments.length; i++) {
68
+ var source = arguments[i];
69
+
70
+ for (var key in source) {
71
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
72
+ target[key] = source[key];
73
+ }
74
+ }
75
+ }
76
+
77
+ return target;
78
+ };
79
+
80
+ return _extends.apply(this, arguments);
81
+ }
82
+
83
+ function _classCallCheck(instance, Constructor) {
84
+ if (!(instance instanceof Constructor)) {
85
+ throw new TypeError("Cannot call a class as a function");
86
+ }
87
+ }
88
+
89
+ function _defineProperties(target, props) {
90
+ for (var i = 0; i < props.length; i++) {
91
+ var descriptor = props[i];
92
+ descriptor.enumerable = descriptor.enumerable || false;
93
+ descriptor.configurable = true;
94
+ if ("value" in descriptor) descriptor.writable = true;
95
+ Object.defineProperty(target, descriptor.key, descriptor);
96
+ }
97
+ }
98
+
99
+ function _createClass(Constructor, protoProps, staticProps) {
100
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
101
+ if (staticProps) _defineProperties(Constructor, staticProps);
102
+ return Constructor;
103
+ }
104
+
105
+ function _possibleConstructorReturn(self, call) {
106
+ if (call && (_typeof(call) === "object" || typeof call === "function")) {
107
+ return call;
108
+ }
109
+
110
+ return _assertThisInitialized(self);
111
+ }
112
+
113
+ function _assertThisInitialized(self) {
114
+ if (self === void 0) {
115
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
116
+ }
117
+
118
+ return self;
119
+ }
120
+
121
+ function _getPrototypeOf(o) {
122
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
123
+ return o.__proto__ || Object.getPrototypeOf(o);
124
+ };
125
+ return _getPrototypeOf(o);
126
+ }
127
+
128
+ function _inherits(subClass, superClass) {
129
+ if (typeof superClass !== "function" && superClass !== null) {
130
+ throw new TypeError("Super expression must either be null or a function");
131
+ }
132
+
133
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
134
+ constructor: {
135
+ value: subClass,
136
+ writable: true,
137
+ configurable: true
138
+ }
139
+ });
140
+ if (superClass) _setPrototypeOf(subClass, superClass);
141
+ }
142
+
143
+ function _setPrototypeOf(o, p) {
144
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
145
+ o.__proto__ = p;
146
+ return o;
147
+ };
148
+
149
+ return _setPrototypeOf(o, p);
150
+ }
151
+
152
+ var FeListItemGroup =
153
+ /*#__PURE__*/
154
+ function (_Component) {
155
+ _inherits(FeListItemGroup, _Component);
156
+
157
+ function FeListItemGroup() {
158
+ _classCallCheck(this, FeListItemGroup);
159
+
160
+ return _possibleConstructorReturn(this, _getPrototypeOf(FeListItemGroup).apply(this, arguments));
161
+ }
162
+
163
+ _createClass(FeListItemGroup, [{
164
+ key: "isActiveItem",
165
+ value: function isActiveItem(item) {
166
+ if (this.props.activeId && (item.id || this.props.idAttribute)) {
167
+ return this.props.activeId === (item.id || item[this.props.idAttribute]);
168
+ } else {
169
+ return false;
170
+ }
171
+ }
172
+ }, {
173
+ key: "render",
174
+ value: function render() {
175
+ var _this = this;
176
+ /** Minimum condition required to render*/
177
+
178
+
179
+ if (this.props.list && this.props.list.length === 0) {
180
+ return null;
181
+ }
182
+ /** Rendering of component */
183
+
184
+
185
+ var className = (0, _classnames.default)('fe-list', {
186
+ 'fe-sub-list': this.props.isSublist,
187
+ 'fe-dropdown__list': this.props.feStyle === 'dropdown',
188
+ 'fe-list--collapsed': this.props.feStyle === 'list' && this.props.isCollapsed
189
+ }, this.props.className);
190
+ var listGroupProps = Object.assign({}, this.props);
191
+ delete listGroupProps.feStyle;
192
+ delete listGroupProps.idAttribute;
193
+ delete listGroupProps.isCollapsed;
194
+ delete listGroupProps.icon;
195
+ delete listGroupProps.iconRight;
196
+ delete listGroupProps.iconMultiLevel;
197
+ delete listGroupProps.iconExpand;
198
+ delete listGroupProps.iconCollapse;
199
+ delete listGroupProps.list;
200
+ delete listGroupProps.activeId;
201
+ delete listGroupProps.activeIds;
202
+ delete listGroupProps.onItemClick;
203
+ delete listGroupProps.onIconRighClick;
204
+ delete listGroupProps.onItemHover;
205
+ delete listGroupProps.activeParent;
206
+ delete listGroupProps.textHighlight;
207
+ delete listGroupProps.isSectioned;
208
+ delete listGroupProps.isSelectBox;
209
+ delete listGroupProps.activeItemIndex;
210
+ delete listGroupProps.activeSubItemIndex;
211
+ delete listGroupProps.expandedIndex;
212
+ delete listGroupProps.isExpandAll;
213
+ delete listGroupProps.isSublist;
214
+ delete listGroupProps.withDropIcon;
215
+ delete listGroupProps.customRenderLink;
216
+ var setActive = this.props.activeParent || !this.props.isSublist;
217
+ return _react.default.createElement("ul", _extends({}, listGroupProps, {
218
+ className: className
219
+ }), this.props.list.map(function (item, key) {
220
+ var active = setActive && (_this.props.activeItemIndex && (0, _toInteger.default)(_this.props.activeItemIndex) === key || _this.isActiveItem(item));
221
+
222
+ var activeSubItemIndex = active && !_this.props.isSublist ? _this.props.activeSubItemIndex : null;
223
+ var expanded = _this.props.isExpandAll || _this.props.isSectioned || !_this.props.isSublist && _this.props.expandedIndex && (0, _toInteger.default)(_this.props.expandedIndex) === key;
224
+ var role = (0, _ariaRole.getRole)(_this.props.role);
225
+ var itemIndex = key;
226
+ var iconRight = !_this.props.isSectioned && item.list && item.list.length ? _this.props.iconMultiLevel : _this.props.iconRight;
227
+ return _react.default.createElement(_FeListItem.default, _extends({
228
+ key: key,
229
+ feStyle: _this.props.feStyle,
230
+ icon: _this.props.icon,
231
+ iconRight: iconRight,
232
+ iconCollapse: _this.props.iconCollapse,
233
+ iconExpand: _this.props.iconExpand,
234
+ groupClickHandler: _this.props.onItemClick,
235
+ groupIconRighClickHandler: _this.props.onIconRighClick,
236
+ groupHoverHandler: _this.props.onItemHover,
237
+ withDropIcon: _this.props.feStyle === 'list' && _this.props.withDropIcon
238
+ }, item, {
239
+ idAttribute: _this.props.idAttribute,
240
+ activeId: _this.props.activeId,
241
+ activeIds: _this.props.activeIds,
242
+ textHighlight: _this.props.textHighlight,
243
+ role: role,
244
+ active: active,
245
+ activeItemIndex: activeSubItemIndex,
246
+ expanded: expanded,
247
+ isSectioned: _this.props.isSectioned,
248
+ itemIndex: "".concat(itemIndex),
249
+ customRenderLink: _this.props.customRenderLink
250
+ }));
251
+ }));
252
+ }
253
+ }]);
254
+
255
+ return FeListItemGroup;
256
+ }(_react.Component);
257
+
258
+ FeListItemGroup.defaultProps = {
259
+ feStyle: 'list',
260
+ idAttribute: null,
261
+ list: [],
262
+ activeId: null,
263
+ activeIds: null,
264
+ role: 'listbox',
265
+ icon: null,
266
+ iconRight: null,
267
+ iconCollapse: 'fa fa-chevron-down',
268
+ iconExpand: 'fa fa-chevron-up',
269
+ activeItemIndex: null,
270
+ activeSubItemIndex: null,
271
+ expandedIndex: null,
272
+ textHighlight: null,
273
+ isSectioned: false,
274
+ isSelectBox: false,
275
+ isExpandAll: false,
276
+ isSublist: false,
277
+ withDropIcon: true,
278
+ isCollapsed: false,
279
+ onItemClick: null,
280
+ onIconRighClick: null,
281
+ onItemHover: null,
282
+ customRenderLink: null
283
+ };
284
+ FeListItemGroup.propTypes = {
285
+ /** Provide list group variants like 'list', 'dropdown'*/
286
+ feStyle: _propTypes.default.oneOf(['list', 'dropdown']),
287
+
288
+ /** Provide idAttribute for list item if id attributes is not passes and other attribute can be assumed as id and same for subitems*/
289
+ idAttribute: _propTypes.default.string,
290
+
291
+ /** Provide list group item list*/
292
+ list: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
293
+
294
+ /** Provide active ids*/
295
+ activeId: _propTypes.default.string,
296
+
297
+ /** Provide active ids*/
298
+ activeIds: _propTypes.default.array,
299
+
300
+ /** Provide list group role for aria-attribute*/
301
+ role: _propTypes.default.string,
302
+
303
+ /** Provide icon class*/
304
+ icon: _propTypes.default.string,
305
+
306
+ /** Provide icon class*/
307
+ iconRight: _propTypes.default.string,
308
+
309
+ /** Provide icon class*/
310
+ iconCollapse: _propTypes.default.string,
311
+
312
+ /** Provide icon class*/
313
+ iconExpand: _propTypes.default.string,
314
+
315
+ /** Provide icon class*/
316
+ iconMultiLevel: _propTypes.default.string,
317
+
318
+ /** Provide item index to set active*/
319
+ activeItemIndex: _propTypes.default.string,
320
+
321
+ /** Provide subitem index to set active*/
322
+ activeSubItemIndex: _propTypes.default.string,
323
+
324
+ /** Provide item index for expanded state*/
325
+ expandedIndex: _propTypes.default.string,
326
+
327
+ /** Provide substring to highlight*/
328
+ textHighlight: _propTypes.default.string,
329
+
330
+ /** Set true/false to change list group sectioned state*/
331
+ isSectioned: _propTypes.default.bool,
332
+
333
+ /** Set true/false to change list group selectbox*/
334
+ isSelectBox: _propTypes.default.bool,
335
+
336
+ /** Set true/false to change expand state of all items*/
337
+ isExpandAll: _propTypes.default.bool,
338
+
339
+ /** Set true/false to change list type sublist*/
340
+ isSublist: _propTypes.default.bool,
341
+
342
+ /** Set true/false to add/remove dropdown icon*/
343
+ withDropIcon: _propTypes.default.bool,
344
+
345
+ /** Set true/false to change collapsed state of list group*/
346
+ isCollapsed: _propTypes.default.bool,
347
+
348
+ /** Provide right icon click handler for group items*/
349
+ onIconRighClick: _propTypes.default.func,
350
+
351
+ /** Provide item click handler for group items*/
352
+ onItemClick: _propTypes.default.func,
353
+
354
+ /** Provide item hover handler for group items*/
355
+ onItemHover: _propTypes.default.func,
356
+
357
+ /** A function that returns a react element to render the wrapping link.
358
+ * Will receive url, className, and children props
359
+ */
360
+ customRenderLink: _propTypes.default.func
361
+ };
362
+ FeListItemGroup.displayName = 'FeListItemGroup';
363
+ var _default = FeListItemGroup;
364
+ exports.default = _default;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
+
14
+ var _FeIconStack = _interopRequireDefault(require("./FeIconStack"));
15
+
16
+ var _FeIcon = _interopRequireDefault(require("./FeIcon"));
17
+
18
+ function _interopRequireDefault(obj) {
19
+ return obj && obj.__esModule ? obj : {
20
+ default: obj
21
+ };
22
+ }
23
+
24
+ var FeLoader = function FeLoader(_ref) {
25
+ var feSize = _ref.feSize,
26
+ label = _ref.label,
27
+ isLabelInline = _ref.isLabelInline,
28
+ className = _ref.className;
29
+ var classNames = (0, _classnames.default)({
30
+ 'fe-compact-spinner': isLabelInline,
31
+ 'fe-stacked-spinner': !isLabelInline
32
+ }, className);
33
+ var spinnerClass = "fe-spinner fe-spinner--".concat(feSize);
34
+ return _react.default.createElement("div", {
35
+ className: classNames
36
+ }, _react.default.createElement(_FeIconStack.default, {
37
+ className: spinnerClass
38
+ }, _react.default.createElement(_FeIcon.default, {
39
+ family: "regular",
40
+ icon: "circle",
41
+ className: "fe-spinner__circle"
42
+ }), _react.default.createElement(_FeIcon.default, {
43
+ family: "regular",
44
+ icon: "spinner-third",
45
+ className: "fe-spinner__circle",
46
+ spin: true
47
+ })), label && _react.default.createElement("span", {
48
+ className: "caption"
49
+ }, label));
50
+ };
51
+
52
+ FeLoader.defaultProps = {
53
+ feSize: 'l',
54
+ label: null,
55
+ isLabelInline: false
56
+ };
57
+ FeLoader.propTypes = {
58
+ /** Provide size for loader*/
59
+ feSize: _propTypes.default.oneOf(['xxl', 'xl', 'l', 'sm']),
60
+
61
+ /** Provide label for loader*/
62
+ label: _propTypes.default.string,
63
+
64
+ /** Set true/false to change inline label*/
65
+ isLabelInline: _propTypes.default.bool
66
+ };
67
+ FeLoader.displayName = 'FeLoader';
68
+ var _default = FeLoader;
69
+ exports.default = _default;