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.
- package/build.js +40 -0
- package/lib/core/FontAwesomeContext.js +126 -0
- package/lib/core/components/FeAppLogo.js +54 -0
- package/lib/core/components/FeAvatar.js +314 -0
- package/lib/core/components/FeBadge.js +177 -0
- package/lib/core/components/FeBreadcrumb.js +205 -0
- package/lib/core/components/FeButton.js +185 -0
- package/lib/core/components/FeCheckbox.js +91 -0
- package/lib/core/components/FeCogButton.js +204 -0
- package/lib/core/components/FeDefaultLink.js +108 -0
- package/lib/core/components/FeDropdown.js +677 -0
- package/lib/core/components/FeFormGroup.js +245 -0
- package/lib/core/components/FeIcon.js +52 -0
- package/lib/core/components/FeIconStack.js +26 -0
- package/lib/core/components/FeInputField.js +500 -0
- package/lib/core/components/FeLabel.js +142 -0
- package/lib/core/components/FeListItem.js +719 -0
- package/lib/core/components/FeListItemGroup.js +364 -0
- package/lib/core/components/FeLoader.js +69 -0
- package/lib/core/components/FeNotification.js +351 -0
- package/lib/core/components/FePillBox.js +353 -0
- package/lib/core/components/FeProgressBar.js +282 -0
- package/lib/core/components/FeRadioButton.js +234 -0
- package/lib/core/components/FeSearchField.js +322 -0
- package/lib/core/components/FeSelfContainedInput.js +215 -0
- package/lib/core/components/FeTableCell.js +27 -0
- package/lib/core/components/FeTableHeaderCell.js +273 -0
- package/lib/core/components/FeTableRow.js +24 -0
- package/lib/core/components/FeTextEnrichment.js +78 -0
- package/lib/core/components/FeToggle.js +69 -0
- package/lib/core/index.js +243 -0
- package/lib/core/utils/aria-role.js +11 -0
- package/lib/core/utils/fe-filter.js +157 -0
- package/lib/core/utils/helper.js +11 -0
- package/lib/core/utils/index.js +268 -0
- package/lib/customPropTypes.js +51 -0
- package/lib/fe-filter/FeFilter.js +1312 -0
- package/lib/fe-filter/index.js +17 -0
- package/lib/fe-footer/FeFooter.js +81 -0
- package/lib/fe-footer/index.js +17 -0
- package/lib/fe-hero/FeHero.js +192 -0
- package/lib/fe-hero/index.js +17 -0
- package/lib/fe-modal/FeModal.js +409 -0
- package/lib/fe-modal/index.js +17 -0
- package/lib/fe-notifications/FeNotifications.js +235 -0
- package/lib/fe-notifications/index.js +17 -0
- package/lib/fe-pagination/FePagination.js +688 -0
- package/lib/fe-pagination/index.js +17 -0
- package/lib/fe-panel/FePanel.js +282 -0
- package/lib/fe-panel/index.js +17 -0
- package/lib/fe-sidenav/FeSideNav.js +78 -0
- package/lib/fe-sidenav/FeSideNavList.js +346 -0
- package/lib/fe-sidenav/index.js +17 -0
- package/lib/fe-table/FeTable.js +703 -0
- package/lib/fe-table/index.js +17 -0
- package/lib/fe-topnav/FeTopNav.js +110 -0
- package/lib/fe-topnav/FeTopNavList.js +401 -0
- package/lib/fe-topnav/index.js +17 -0
- package/lib/index.js +129 -0
- package/lib/layout/Col.js +187 -0
- package/lib/layout/Container.js +97 -0
- package/lib/layout/Row.js +99 -0
- package/lib/layout/index.js +35 -0
- package/package.json +42 -4
- package/README.md +0 -5
@@ -0,0 +1,322 @@
|
|
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 _feFilter = _interopRequireDefault(require("../utils/fe-filter"));
|
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
|
+
function _interopRequireWildcard(obj) {
|
25
|
+
if (obj && obj.__esModule) {
|
26
|
+
return obj;
|
27
|
+
} else {
|
28
|
+
var newObj = {};
|
29
|
+
|
30
|
+
if (obj != null) {
|
31
|
+
for (var key in obj) {
|
32
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
33
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
|
34
|
+
|
35
|
+
if (desc.get || desc.set) {
|
36
|
+
Object.defineProperty(newObj, key, desc);
|
37
|
+
} else {
|
38
|
+
newObj[key] = obj[key];
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
newObj.default = obj;
|
45
|
+
return newObj;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
function _typeof(obj) {
|
50
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
51
|
+
_typeof = function _typeof(obj) {
|
52
|
+
return typeof obj;
|
53
|
+
};
|
54
|
+
} else {
|
55
|
+
_typeof = function _typeof(obj) {
|
56
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
57
|
+
};
|
58
|
+
}
|
59
|
+
|
60
|
+
return _typeof(obj);
|
61
|
+
}
|
62
|
+
|
63
|
+
function _extends() {
|
64
|
+
_extends = Object.assign || function (target) {
|
65
|
+
for (var i = 1; i < arguments.length; i++) {
|
66
|
+
var source = arguments[i];
|
67
|
+
|
68
|
+
for (var key in source) {
|
69
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
70
|
+
target[key] = source[key];
|
71
|
+
}
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
return target;
|
76
|
+
};
|
77
|
+
|
78
|
+
return _extends.apply(this, arguments);
|
79
|
+
}
|
80
|
+
|
81
|
+
function _classCallCheck(instance, Constructor) {
|
82
|
+
if (!(instance instanceof Constructor)) {
|
83
|
+
throw new TypeError("Cannot call a class as a function");
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
function _defineProperties(target, props) {
|
88
|
+
for (var i = 0; i < props.length; i++) {
|
89
|
+
var descriptor = props[i];
|
90
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
91
|
+
descriptor.configurable = true;
|
92
|
+
if ("value" in descriptor) descriptor.writable = true;
|
93
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
98
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
99
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
100
|
+
return Constructor;
|
101
|
+
}
|
102
|
+
|
103
|
+
function _possibleConstructorReturn(self, call) {
|
104
|
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
105
|
+
return call;
|
106
|
+
}
|
107
|
+
|
108
|
+
return _assertThisInitialized(self);
|
109
|
+
}
|
110
|
+
|
111
|
+
function _getPrototypeOf(o) {
|
112
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
113
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
114
|
+
};
|
115
|
+
return _getPrototypeOf(o);
|
116
|
+
}
|
117
|
+
|
118
|
+
function _assertThisInitialized(self) {
|
119
|
+
if (self === void 0) {
|
120
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
121
|
+
}
|
122
|
+
|
123
|
+
return self;
|
124
|
+
}
|
125
|
+
|
126
|
+
function _inherits(subClass, superClass) {
|
127
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
128
|
+
throw new TypeError("Super expression must either be null or a function");
|
129
|
+
}
|
130
|
+
|
131
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
132
|
+
constructor: {
|
133
|
+
value: subClass,
|
134
|
+
writable: true,
|
135
|
+
configurable: true
|
136
|
+
}
|
137
|
+
});
|
138
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
139
|
+
}
|
140
|
+
|
141
|
+
function _setPrototypeOf(o, p) {
|
142
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
143
|
+
o.__proto__ = p;
|
144
|
+
return o;
|
145
|
+
};
|
146
|
+
|
147
|
+
return _setPrototypeOf(o, p);
|
148
|
+
}
|
149
|
+
|
150
|
+
var FeSearchField =
|
151
|
+
/*#__PURE__*/
|
152
|
+
function (_Component) {
|
153
|
+
_inherits(FeSearchField, _Component);
|
154
|
+
|
155
|
+
function FeSearchField(props) {
|
156
|
+
var _this;
|
157
|
+
|
158
|
+
_classCallCheck(this, FeSearchField);
|
159
|
+
|
160
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(FeSearchField).call(this, props));
|
161
|
+
_this.state = {
|
162
|
+
inputValue: ''
|
163
|
+
};
|
164
|
+
_this.onClearHandler = _this.onClearHandler.bind(_assertThisInitialized(_this));
|
165
|
+
_this.onChangeHandler = _this.onChangeHandler.bind(_assertThisInitialized(_this));
|
166
|
+
return _this;
|
167
|
+
}
|
168
|
+
|
169
|
+
_createClass(FeSearchField, [{
|
170
|
+
key: "onChangeHandler",
|
171
|
+
value: function onChangeHandler(event) {
|
172
|
+
var inputValue = event.currentTarget.value;
|
173
|
+
this.setState({
|
174
|
+
inputValue: inputValue
|
175
|
+
});
|
176
|
+
var filteredList = this.filterList(inputValue, this.props.list);
|
177
|
+
|
178
|
+
if (this.props.onChange) {
|
179
|
+
this.props.onChange({
|
180
|
+
subStr: inputValue,
|
181
|
+
queryAt: this.props.queryAt,
|
182
|
+
list: filteredList
|
183
|
+
});
|
184
|
+
}
|
185
|
+
}
|
186
|
+
}, {
|
187
|
+
key: "filterList",
|
188
|
+
value: function filterList(subStr, list) {
|
189
|
+
var config = {
|
190
|
+
queryAt: this.props.queryAt,
|
191
|
+
isMultiLevel: this.props.isMultiLevel,
|
192
|
+
multiLevelKey: this.props.multiLevelKey,
|
193
|
+
isDeepSearch: this.props.isDeepSearch
|
194
|
+
};
|
195
|
+
|
196
|
+
var filteredList = _feFilter.default.filter(subStr, list, config);
|
197
|
+
|
198
|
+
return filteredList;
|
199
|
+
}
|
200
|
+
}, {
|
201
|
+
key: "onClearHandler",
|
202
|
+
value: function onClearHandler() {
|
203
|
+
this.clear();
|
204
|
+
|
205
|
+
if (this.props.onChange) {
|
206
|
+
this.props.onChange({
|
207
|
+
subStr: '',
|
208
|
+
queryAt: this.props.queryAt,
|
209
|
+
list: this.props.list
|
210
|
+
});
|
211
|
+
}
|
212
|
+
}
|
213
|
+
}, {
|
214
|
+
key: "clear",
|
215
|
+
value: function clear() {
|
216
|
+
this.setState({
|
217
|
+
inputValue: ''
|
218
|
+
});
|
219
|
+
}
|
220
|
+
}, {
|
221
|
+
key: "render",
|
222
|
+
value: function render() {
|
223
|
+
var _this2 = this;
|
224
|
+
/** Minimum condition required to render*/
|
225
|
+
|
226
|
+
/** Rendering of component */
|
227
|
+
|
228
|
+
|
229
|
+
var className = (0, _classnames.default)('fe-search', {
|
230
|
+
'fe-search__background--light': this.props.feBackground === 'light'
|
231
|
+
}, this.props.className);
|
232
|
+
var leftSectionClassName = (0, _classnames.default)('fe-search__section--left', 'fe-search__icon--section');
|
233
|
+
var inputClassName = (0, _classnames.default)({
|
234
|
+
'filled': this.state.inputValue ? true : false
|
235
|
+
});
|
236
|
+
var rightSectionClassName = (0, _classnames.default)('fe-search__section--right', 'fe-search__icon--section');
|
237
|
+
var inputProps = Object.assign({}, this.props);
|
238
|
+
delete inputProps.iconSearch;
|
239
|
+
delete inputProps.iconClear;
|
240
|
+
delete inputProps.list;
|
241
|
+
delete inputProps.feBackground;
|
242
|
+
delete inputProps.queryAt;
|
243
|
+
delete inputProps.isMultiLevel;
|
244
|
+
delete inputProps.multiLevelKey;
|
245
|
+
delete inputProps.isDeepSearch;
|
246
|
+
delete inputProps.onChange;
|
247
|
+
delete inputProps.className;
|
248
|
+
return _react.default.createElement("div", {
|
249
|
+
className: className,
|
250
|
+
ref: function ref(node) {
|
251
|
+
return _this2.node = node;
|
252
|
+
}
|
253
|
+
}, _react.default.createElement("input", _extends({
|
254
|
+
"aria-label": "search input"
|
255
|
+
}, inputProps, {
|
256
|
+
type: "text",
|
257
|
+
value: this.state.inputValue,
|
258
|
+
className: inputClassName,
|
259
|
+
onChange: this.onChangeHandler,
|
260
|
+
required: true
|
261
|
+
})), _react.default.createElement("span", {
|
262
|
+
className: leftSectionClassName
|
263
|
+
}, _react.default.createElement(_FeIcon.default, {
|
264
|
+
family: "regular",
|
265
|
+
icon: "search"
|
266
|
+
})), _react.default.createElement("span", {
|
267
|
+
className: rightSectionClassName,
|
268
|
+
role: "button",
|
269
|
+
"aria-label": "clear",
|
270
|
+
onClick: this.onClearHandler
|
271
|
+
}, _react.default.createElement(_FeIcon.default, {
|
272
|
+
family: "regular",
|
273
|
+
icon: "times-circle"
|
274
|
+
})));
|
275
|
+
}
|
276
|
+
}]);
|
277
|
+
|
278
|
+
return FeSearchField;
|
279
|
+
}(_react.Component);
|
280
|
+
|
281
|
+
FeSearchField.defaultProps = {
|
282
|
+
feBackground: 'default',
|
283
|
+
onChange: null,
|
284
|
+
placeholder: 'Search',
|
285
|
+
list: [],
|
286
|
+
queryAt: 'label',
|
287
|
+
isMultiLevel: true,
|
288
|
+
multiLevelKey: 'list',
|
289
|
+
isDeepSearch: false,
|
290
|
+
disabled: false
|
291
|
+
};
|
292
|
+
FeSearchField.propTypes = {
|
293
|
+
/** Set to 'light' for dark theme containers with light backgrounds */
|
294
|
+
feBackground: _propTypes.default.oneOf(['default', 'light']),
|
295
|
+
|
296
|
+
/** Function to trigger when input value changes */
|
297
|
+
onChange: _propTypes.default.func,
|
298
|
+
|
299
|
+
/** Provide icon placeholder for search field*/
|
300
|
+
placeholder: _propTypes.default.string,
|
301
|
+
|
302
|
+
/** Provide list[{`FeListItem` props}] for search field to search*/
|
303
|
+
list: _propTypes.default.array,
|
304
|
+
|
305
|
+
/** Provide key to apply search incase array of Object is passed*/
|
306
|
+
queryAt: _propTypes.default.string,
|
307
|
+
|
308
|
+
/** Set true/false incase to support multi-level search*/
|
309
|
+
isMultiLevel: _propTypes.default.bool,
|
310
|
+
|
311
|
+
/** Provide multi level search key*/
|
312
|
+
multiLevelKey: _propTypes.default.string,
|
313
|
+
|
314
|
+
/** Set true/false incase to support deep search*/
|
315
|
+
isDeepSearch: _propTypes.default.bool,
|
316
|
+
|
317
|
+
/** Set true/false to change search field disabled state*/
|
318
|
+
disabled: _propTypes.default.bool
|
319
|
+
};
|
320
|
+
FeSearchField.displayName = 'FeSearchField';
|
321
|
+
var _default = FeSearchField;
|
322
|
+
exports.default = _default;
|
@@ -0,0 +1,215 @@
|
|
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
|
+
function _interopRequireDefault(obj) {
|
15
|
+
return obj && obj.__esModule ? obj : {
|
16
|
+
default: obj
|
17
|
+
};
|
18
|
+
}
|
19
|
+
|
20
|
+
function _interopRequireWildcard(obj) {
|
21
|
+
if (obj && obj.__esModule) {
|
22
|
+
return obj;
|
23
|
+
} else {
|
24
|
+
var newObj = {};
|
25
|
+
|
26
|
+
if (obj != null) {
|
27
|
+
for (var key in obj) {
|
28
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
29
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
|
30
|
+
|
31
|
+
if (desc.get || desc.set) {
|
32
|
+
Object.defineProperty(newObj, key, desc);
|
33
|
+
} else {
|
34
|
+
newObj[key] = obj[key];
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
newObj.default = obj;
|
41
|
+
return newObj;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
function _typeof(obj) {
|
46
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
47
|
+
_typeof = function _typeof(obj) {
|
48
|
+
return typeof obj;
|
49
|
+
};
|
50
|
+
} else {
|
51
|
+
_typeof = function _typeof(obj) {
|
52
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
53
|
+
};
|
54
|
+
}
|
55
|
+
|
56
|
+
return _typeof(obj);
|
57
|
+
}
|
58
|
+
|
59
|
+
function _extends() {
|
60
|
+
_extends = Object.assign || function (target) {
|
61
|
+
for (var i = 1; i < arguments.length; i++) {
|
62
|
+
var source = arguments[i];
|
63
|
+
|
64
|
+
for (var key in source) {
|
65
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
66
|
+
target[key] = source[key];
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
return target;
|
72
|
+
};
|
73
|
+
|
74
|
+
return _extends.apply(this, arguments);
|
75
|
+
}
|
76
|
+
|
77
|
+
function _classCallCheck(instance, Constructor) {
|
78
|
+
if (!(instance instanceof Constructor)) {
|
79
|
+
throw new TypeError("Cannot call a class as a function");
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
function _defineProperties(target, props) {
|
84
|
+
for (var i = 0; i < props.length; i++) {
|
85
|
+
var descriptor = props[i];
|
86
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
87
|
+
descriptor.configurable = true;
|
88
|
+
if ("value" in descriptor) descriptor.writable = true;
|
89
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
94
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
95
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
96
|
+
return Constructor;
|
97
|
+
}
|
98
|
+
|
99
|
+
function _possibleConstructorReturn(self, call) {
|
100
|
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
101
|
+
return call;
|
102
|
+
}
|
103
|
+
|
104
|
+
return _assertThisInitialized(self);
|
105
|
+
}
|
106
|
+
|
107
|
+
function _assertThisInitialized(self) {
|
108
|
+
if (self === void 0) {
|
109
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
110
|
+
}
|
111
|
+
|
112
|
+
return self;
|
113
|
+
}
|
114
|
+
|
115
|
+
function _getPrototypeOf(o) {
|
116
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
117
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
118
|
+
};
|
119
|
+
return _getPrototypeOf(o);
|
120
|
+
}
|
121
|
+
|
122
|
+
function _inherits(subClass, superClass) {
|
123
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
124
|
+
throw new TypeError("Super expression must either be null or a function");
|
125
|
+
}
|
126
|
+
|
127
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
128
|
+
constructor: {
|
129
|
+
value: subClass,
|
130
|
+
writable: true,
|
131
|
+
configurable: true
|
132
|
+
}
|
133
|
+
});
|
134
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
135
|
+
}
|
136
|
+
|
137
|
+
function _setPrototypeOf(o, p) {
|
138
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
139
|
+
o.__proto__ = p;
|
140
|
+
return o;
|
141
|
+
};
|
142
|
+
|
143
|
+
return _setPrototypeOf(o, p);
|
144
|
+
}
|
145
|
+
|
146
|
+
var FeSelfContainedInput =
|
147
|
+
/*#__PURE__*/
|
148
|
+
function (_Component) {
|
149
|
+
_inherits(FeSelfContainedInput, _Component);
|
150
|
+
|
151
|
+
function FeSelfContainedInput() {
|
152
|
+
_classCallCheck(this, FeSelfContainedInput);
|
153
|
+
|
154
|
+
return _possibleConstructorReturn(this, _getPrototypeOf(FeSelfContainedInput).apply(this, arguments));
|
155
|
+
}
|
156
|
+
|
157
|
+
_createClass(FeSelfContainedInput, [{
|
158
|
+
key: "render",
|
159
|
+
value: function render() {
|
160
|
+
var _this = this;
|
161
|
+
/** Minimum condition required to render*/
|
162
|
+
|
163
|
+
/** Rendering of component */
|
164
|
+
|
165
|
+
|
166
|
+
var WrapperClassName = (0, _classnames.default)({
|
167
|
+
'fe-form__input-wrapper--has-icon': this.props.optionalComponent
|
168
|
+
}, this.props.className);
|
169
|
+
var className = (0, _classnames.default)('fe-input', {
|
170
|
+
'fe-input--light-bg': this.props.feBackground === 'light'
|
171
|
+
}, 'fe-input--self-contained');
|
172
|
+
var inputProps = Object.assign({}, this.props);
|
173
|
+
delete inputProps.isInline;
|
174
|
+
delete inputProps.feBackground;
|
175
|
+
delete inputProps.optionalComponent;
|
176
|
+
return _react.default.createElement("div", {
|
177
|
+
className: WrapperClassName
|
178
|
+
}, _react.default.createElement("input", _extends({
|
179
|
+
type: "text"
|
180
|
+
}, inputProps, {
|
181
|
+
className: className,
|
182
|
+
ref: function ref(node) {
|
183
|
+
return _this.input = node;
|
184
|
+
}
|
185
|
+
})), this.props.optionalComponent ? _react.default.createElement("div", {
|
186
|
+
className: "fe-input-icon"
|
187
|
+
}, this.props.optionalComponent) : null);
|
188
|
+
}
|
189
|
+
}]);
|
190
|
+
|
191
|
+
return FeSelfContainedInput;
|
192
|
+
}(_react.Component);
|
193
|
+
|
194
|
+
FeSelfContainedInput.defaultProps = {
|
195
|
+
feBackground: 'default',
|
196
|
+
placeholder: '',
|
197
|
+
optionalComponent: null,
|
198
|
+
disabled: false
|
199
|
+
};
|
200
|
+
FeSelfContainedInput.propTypes = {
|
201
|
+
/** Provide background for input */
|
202
|
+
feBackground: _propTypes.default.oneOf(['default', 'light']),
|
203
|
+
|
204
|
+
/** Provide placeholder for input */
|
205
|
+
placeholder: _propTypes.default.string,
|
206
|
+
|
207
|
+
/** Provide optional custom componentr*/
|
208
|
+
optionalComponent: _propTypes.default.element,
|
209
|
+
|
210
|
+
/** Set true/false to change button disabled state*/
|
211
|
+
disabled: _propTypes.default.bool
|
212
|
+
};
|
213
|
+
FeSelfContainedInput.displayName = 'FeSelfContainedInput';
|
214
|
+
var _default = FeSelfContainedInput;
|
215
|
+
exports.default = _default;
|
@@ -0,0 +1,27 @@
|
|
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 _classnames = _interopRequireDefault(require("classnames"));
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) {
|
13
|
+
return obj && obj.__esModule ? obj : {
|
14
|
+
default: obj
|
15
|
+
};
|
16
|
+
}
|
17
|
+
|
18
|
+
var FeTableCell = function FeTableCell(props) {
|
19
|
+
var className = (0, _classnames.default)('fe-table__cell', props.columnClass, props.className);
|
20
|
+
return _react.default.createElement("div", {
|
21
|
+
className: className,
|
22
|
+
role: "cell"
|
23
|
+
}, props.children);
|
24
|
+
};
|
25
|
+
|
26
|
+
var _default = FeTableCell;
|
27
|
+
exports.default = _default;
|