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,346 @@
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 _core = require("../core");
13
+
14
+ var _utils = require("../core/utils");
15
+
16
+ function _interopRequireDefault(obj) {
17
+ return obj && obj.__esModule ? obj : {
18
+ default: obj
19
+ };
20
+ }
21
+
22
+ function _interopRequireWildcard(obj) {
23
+ if (obj && obj.__esModule) {
24
+ return obj;
25
+ } else {
26
+ var newObj = {};
27
+
28
+ if (obj != null) {
29
+ for (var key in obj) {
30
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
31
+ var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
32
+
33
+ if (desc.get || desc.set) {
34
+ Object.defineProperty(newObj, key, desc);
35
+ } else {
36
+ newObj[key] = obj[key];
37
+ }
38
+ }
39
+ }
40
+ }
41
+
42
+ newObj.default = obj;
43
+ return newObj;
44
+ }
45
+ }
46
+
47
+ function _typeof(obj) {
48
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
49
+ _typeof = function _typeof(obj) {
50
+ return typeof obj;
51
+ };
52
+ } else {
53
+ _typeof = function _typeof(obj) {
54
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
55
+ };
56
+ }
57
+
58
+ return _typeof(obj);
59
+ }
60
+
61
+ function _extends() {
62
+ _extends = Object.assign || function (target) {
63
+ for (var i = 1; i < arguments.length; i++) {
64
+ var source = arguments[i];
65
+
66
+ for (var key in source) {
67
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
68
+ target[key] = source[key];
69
+ }
70
+ }
71
+ }
72
+
73
+ return target;
74
+ };
75
+
76
+ return _extends.apply(this, arguments);
77
+ }
78
+
79
+ function _slicedToArray(arr, i) {
80
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
81
+ }
82
+
83
+ function _nonIterableRest() {
84
+ throw new TypeError("Invalid attempt to destructure non-iterable instance");
85
+ }
86
+
87
+ function _iterableToArrayLimit(arr, i) {
88
+ var _arr = [];
89
+ var _n = true;
90
+ var _d = false;
91
+ var _e = undefined;
92
+
93
+ try {
94
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
95
+ _arr.push(_s.value);
96
+
97
+ if (i && _arr.length === i) break;
98
+ }
99
+ } catch (err) {
100
+ _d = true;
101
+ _e = err;
102
+ } finally {
103
+ try {
104
+ if (!_n && _i["return"] != null) _i["return"]();
105
+ } finally {
106
+ if (_d) throw _e;
107
+ }
108
+ }
109
+
110
+ return _arr;
111
+ }
112
+
113
+ function _arrayWithHoles(arr) {
114
+ if (Array.isArray(arr)) return arr;
115
+ }
116
+
117
+ function _classCallCheck(instance, Constructor) {
118
+ if (!(instance instanceof Constructor)) {
119
+ throw new TypeError("Cannot call a class as a function");
120
+ }
121
+ }
122
+
123
+ function _defineProperties(target, props) {
124
+ for (var i = 0; i < props.length; i++) {
125
+ var descriptor = props[i];
126
+ descriptor.enumerable = descriptor.enumerable || false;
127
+ descriptor.configurable = true;
128
+ if ("value" in descriptor) descriptor.writable = true;
129
+ Object.defineProperty(target, descriptor.key, descriptor);
130
+ }
131
+ }
132
+
133
+ function _createClass(Constructor, protoProps, staticProps) {
134
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
135
+ if (staticProps) _defineProperties(Constructor, staticProps);
136
+ return Constructor;
137
+ }
138
+
139
+ function _possibleConstructorReturn(self, call) {
140
+ if (call && (_typeof(call) === "object" || typeof call === "function")) {
141
+ return call;
142
+ }
143
+
144
+ return _assertThisInitialized(self);
145
+ }
146
+
147
+ function _getPrototypeOf(o) {
148
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
149
+ return o.__proto__ || Object.getPrototypeOf(o);
150
+ };
151
+ return _getPrototypeOf(o);
152
+ }
153
+
154
+ function _assertThisInitialized(self) {
155
+ if (self === void 0) {
156
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
157
+ }
158
+
159
+ return self;
160
+ }
161
+
162
+ function _inherits(subClass, superClass) {
163
+ if (typeof superClass !== "function" && superClass !== null) {
164
+ throw new TypeError("Super expression must either be null or a function");
165
+ }
166
+
167
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
168
+ constructor: {
169
+ value: subClass,
170
+ writable: true,
171
+ configurable: true
172
+ }
173
+ });
174
+ if (superClass) _setPrototypeOf(subClass, superClass);
175
+ }
176
+
177
+ function _setPrototypeOf(o, p) {
178
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
179
+ o.__proto__ = p;
180
+ return o;
181
+ };
182
+
183
+ return _setPrototypeOf(o, p);
184
+ }
185
+
186
+ var FeSideNavList =
187
+ /*#__PURE__*/
188
+ function (_Component) {
189
+ _inherits(FeSideNavList, _Component);
190
+
191
+ function FeSideNavList(props) {
192
+ var _this;
193
+
194
+ _classCallCheck(this, FeSideNavList);
195
+
196
+ _this = _possibleConstructorReturn(this, _getPrototypeOf(FeSideNavList).call(this, props));
197
+ var currentPathname = document.location.pathname;
198
+
199
+ var _getActiveIndex = (0, _utils.getActiveIndex)(props.navList, currentPathname),
200
+ _getActiveIndex2 = _slicedToArray(_getActiveIndex, 2),
201
+ activeItemIndex = _getActiveIndex2[0],
202
+ activeSubItemIndex = _getActiveIndex2[1];
203
+
204
+ _this.state = {
205
+ activeItemIndex: activeItemIndex >= 0 && "".concat(activeItemIndex),
206
+ activeSubItemIndex: activeSubItemIndex >= 0 && "".concat(activeSubItemIndex),
207
+ expandedIndex: activeItemIndex >= 0 && "".concat(activeItemIndex),
208
+ activeRoute: currentPathname,
209
+ displayList: _this.props.navList,
210
+ expandAll: false
211
+ };
212
+ _this.onItemClickHandler = _this.onItemClickHandler.bind(_assertThisInitialized(_this));
213
+ _this.searchEvent = _this.searchEvent.bind(_assertThisInitialized(_this));
214
+ return _this;
215
+ }
216
+
217
+ _createClass(FeSideNavList, [{
218
+ key: "onItemClickHandler",
219
+ value: function onItemClickHandler(event) {
220
+ var _this$state = this.state,
221
+ activeItemIndex = _this$state.activeItemIndex,
222
+ activeSubItemIndex = _this$state.activeSubItemIndex,
223
+ expandedIndex = _this$state.expandedIndex;
224
+ var itemIndex = event.itemIndex,
225
+ subItemIndex = event.subItemIndex,
226
+ hasSubItems = event.hasSubItems;
227
+ var state = {};
228
+
229
+ if (hasSubItems) {
230
+ state = {
231
+ activeItemIndex: activeItemIndex,
232
+ activeSubItemIndex: activeSubItemIndex,
233
+ expandedIndex: itemIndex !== expandedIndex ? itemIndex : null
234
+ };
235
+ } else {
236
+ state = {
237
+ activeItemIndex: itemIndex,
238
+ activeSubItemIndex: subItemIndex,
239
+ expandedIndex: subItemIndex ? itemIndex : null,
240
+ activeRoute: event.originalEvent.currentTarget.pathname
241
+ };
242
+ }
243
+
244
+ this.setState(state);
245
+
246
+ if (this.props.onItemClick) {
247
+ var options = Object.assign({}, event, state);
248
+ this.props.onItemClick(options);
249
+ }
250
+ }
251
+ }, {
252
+ key: "searchEvent",
253
+ value: function searchEvent(resp) {
254
+ var expanded;
255
+
256
+ if (resp.subStr !== null && resp.subStr !== '') {
257
+ expanded = true;
258
+ } else {
259
+ expanded = false;
260
+ }
261
+
262
+ this.setState({
263
+ displayList: resp.list,
264
+ expandAll: expanded
265
+ });
266
+ }
267
+ }, {
268
+ key: "render",
269
+ value: function render() {
270
+ var _this2 = this;
271
+
272
+ if (this.props.navList && this.props.navList.length === 0) {
273
+ return null;
274
+ } //Aria attributes
275
+
276
+
277
+ var ariaProps = {
278
+ 'aria-label': 'mainmenu',
279
+ 'role': 'menubar'
280
+ };
281
+ return _react.default.createElement("div", {
282
+ className: "fe-side-nav-list"
283
+ }, this.props.withSearch && _react.default.createElement(_core.FeSearchField, {
284
+ list: this.props.navList,
285
+ isMultiLevel: true,
286
+ multiLevelKey: "list",
287
+ onChange: function onChange(resp) {
288
+ return _this2.searchEvent(resp);
289
+ }
290
+ }), _react.default.createElement("nav", {
291
+ className: "fe-sidenav"
292
+ }, _react.default.createElement(_core.FeListItemGroup, _extends({}, ariaProps, {
293
+ onItemClick: this.onItemClickHandler,
294
+ list: this.state.displayList,
295
+ activeItemIndex: "".concat(this.state.activeItemIndex),
296
+ activeSubItemIndex: "".concat(this.state.activeSubItemIndex),
297
+ expandedIndex: "".concat(this.state.expandedIndex),
298
+ isExpandAll: this.state.expandAll,
299
+ customRenderLink: this.props.customRenderLink
300
+ }))));
301
+ }
302
+ }], [{
303
+ key: "getDerivedStateFromProps",
304
+ value: function getDerivedStateFromProps(props, state) {
305
+ var currentPathname = document.location.pathname;
306
+
307
+ if (currentPathname !== state.activeRoute) {
308
+ var _getActiveIndex3 = (0, _utils.getActiveIndex)(props.navList, currentPathname),
309
+ _getActiveIndex4 = _slicedToArray(_getActiveIndex3, 2),
310
+ activeItemIndex = _getActiveIndex4[0],
311
+ activeSubItemIndex = _getActiveIndex4[1];
312
+
313
+ return {
314
+ activeItemIndex: activeItemIndex >= 0 && "".concat(activeItemIndex),
315
+ activeSubItemIndex: activeSubItemIndex >= 0 && "".concat(activeSubItemIndex),
316
+ expandedIndex: activeItemIndex >= 0 && "".concat(activeItemIndex),
317
+ activeRoute: currentPathname
318
+ };
319
+ }
320
+
321
+ return null;
322
+ }
323
+ }]);
324
+
325
+ return FeSideNavList;
326
+ }(_react.Component);
327
+
328
+ FeSideNavList.defaultProps = {
329
+ withSearch: false,
330
+ navList: [],
331
+ customRenderLink: null
332
+ };
333
+ FeSideNavList.propTypes = {
334
+ /** Array of navigation items */
335
+ navList: _propTypes.default.array.isRequired,
336
+
337
+ /** Set to true to have seacrh box for nav items */
338
+ withSearch: _propTypes.default.bool,
339
+
340
+ /** A function that returns a react element to render the wrapping link.
341
+ * Will receive url, className, and children props
342
+ */
343
+ customRenderLink: _propTypes.default.func
344
+ };
345
+ var _default = FeSideNavList;
346
+ exports.default = _default;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _FeSideNav = _interopRequireDefault(require("./FeSideNav"));
9
+
10
+ function _interopRequireDefault(obj) {
11
+ return obj && obj.__esModule ? obj : {
12
+ default: obj
13
+ };
14
+ }
15
+
16
+ var _default = _FeSideNav.default;
17
+ exports.default = _default;