carbon-react 8.1.5 → 8.1.6
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/lib/__experimental__/components/input/input-presentation.component.js +35 -29
- package/lib/__experimental__/components/input/input.component.js +36 -28
- package/lib/__experimental__/components/input-decorator-bridge/input-decorator-bridge.component.js +45 -35
- package/lib/__experimental__/components/select/index.js +4 -4
- package/lib/__experimental__/components/select/option.component.js +6 -4
- package/lib/__experimental__/components/select/select-list.component.js +39 -35
- package/lib/__experimental__/components/select/select.component.js +45 -39
- package/lib/__experimental__/components/select-async/index.js +4 -4
- package/lib/__experimental__/components/select-async/select-async.component.js +53 -37
- package/lib/__experimental__/components/textbox/textbox.component.js +6 -4
- package/lib/__spec_helper__/index.js +1 -1
- package/lib/components/action-toolbar/action-toolbar.js +43 -37
- package/lib/components/alert/alert.js +35 -29
- package/lib/components/alert/alert.stories.js +4 -4
- package/lib/components/animated-menu-button/animated-menu-button.js +36 -32
- package/lib/components/animated-menu-button/animated-menu-button.stories.js +16 -24
- package/lib/components/app-wrapper/app-wrapper.js +29 -25
- package/lib/components/app-wrapper/app-wrapper.stories.js +1 -1
- package/lib/components/button/button.js +30 -26
- package/lib/components/button/button.stories.js +1 -1
- package/lib/components/button-toggle/button-toggle.js +52 -46
- package/lib/components/button-toggle/button-toggle.stories.js +23 -15
- package/lib/components/button-toggle-group/button-toggle-group.js +54 -48
- package/lib/components/button-toggle-group/button-toggle-group.stories.js +4 -4
- package/lib/components/carousel/carousel.js +48 -42
- package/lib/components/carousel/slide/slide.js +4 -4
- package/lib/components/checkbox/checkbox.js +68 -72
- package/lib/components/configurable-items/configurable-item-row/configurable-item-row.js +37 -33
- package/lib/components/configurable-items/configurable-items.js +38 -34
- package/lib/components/confirm/confirm.js +60 -54
- package/lib/components/content/content.js +31 -25
- package/lib/components/create/create.js +32 -24
- package/lib/components/date/date.js +187 -181
- package/lib/components/date/navbar/navbar.js +5 -5
- package/lib/components/date-range/date-range.js +97 -93
- package/lib/components/decimal/decimal.js +62 -56
- package/lib/components/detail/detail.js +51 -47
- package/lib/components/dialog/dialog.js +80 -72
- package/lib/components/dialog-full-screen/dialog-full-screen.js +53 -47
- package/lib/components/dialog-full-screen/full-screen-heading/full-screen-heading.js +9 -7
- package/lib/components/drag-and-drop/custom-drag-layer/custom-drag-layer.js +28 -24
- package/lib/components/drag-and-drop/drag-and-drop.js +6 -6
- package/lib/components/drag-and-drop/draggable-context/draggable-context.js +40 -37
- package/lib/components/drag-and-drop/with-drag/with-drag.js +26 -22
- package/lib/components/drag-and-drop/with-drop/with-drop.js +26 -20
- package/lib/components/dropdown/dropdown.js +146 -143
- package/lib/components/dropdown-filter/dropdown-filter.js +94 -88
- package/lib/components/dropdown-filter-ajax/dropdown-filter-ajax.js +54 -50
- package/lib/components/fieldset/fieldset.js +50 -42
- package/lib/components/filter/filter.js +43 -46
- package/lib/components/flash/flash.js +72 -64
- package/lib/components/form/cancel-button/cancel-button.js +11 -11
- package/lib/components/form/form-summary/form-summary.js +7 -7
- package/lib/components/form/form.js +68 -69
- package/lib/components/form/save-button/save-button.js +11 -11
- package/lib/components/grouped-character/grouped-character.js +49 -43
- package/lib/components/heading/heading.js +65 -59
- package/lib/components/help/help.js +46 -40
- package/lib/components/i18n/i18n.js +30 -22
- package/lib/components/icon/icon.js +55 -51
- package/lib/components/inline-inputs/inline-inputs.js +6 -6
- package/lib/components/link/link.js +45 -37
- package/lib/components/menu/menu-item/menu-item.js +55 -49
- package/lib/components/menu/menu.js +47 -41
- package/lib/components/menu/submenu-block/submenu-block.js +43 -37
- package/lib/components/menu-list/menu-list-item/menu-list-item.js +29 -25
- package/lib/components/menu-list/menu-list.js +49 -43
- package/lib/components/message/message.js +47 -41
- package/lib/components/modal/modal.js +77 -71
- package/lib/components/mount-in-app/mount-in-app.js +32 -26
- package/lib/components/multi-action-button/multi-action-button.js +52 -46
- package/lib/components/multi-step-wizard/multi-step-wizard.js +60 -54
- package/lib/components/multi-step-wizard/step/step.js +68 -69
- package/lib/components/navigation-bar/navigation-bar.js +44 -38
- package/lib/components/number/number.js +58 -52
- package/lib/components/pager/pager.js +75 -71
- package/lib/components/pages/page/page.js +6 -6
- package/lib/components/pages/pages.js +4 -4
- package/lib/components/pill/pill.js +33 -27
- package/lib/components/pod/pod.js +84 -80
- package/lib/components/portal/portal.js +34 -26
- package/lib/components/portrait/portrait.js +52 -48
- package/lib/components/preview/preview.js +4 -4
- package/lib/components/profile/profile.js +51 -45
- package/lib/components/radio-button/radio-button.js +51 -45
- package/lib/components/rainbow/rainbow.js +44 -38
- package/lib/components/row/column/column.js +1 -1
- package/lib/components/row/row.js +47 -41
- package/lib/components/scrollable-list/as-scrollable-list-item.wrapper.js +8 -8
- package/lib/components/scrollable-list/scrollable-list-item.component.js +27 -35
- package/lib/components/scrollable-list/scrollable-list.component.js +53 -37
- package/lib/components/scrollable-list/scrollable-list.style.js +5 -13
- package/lib/components/scrollable-list/test-utils.js +38 -28
- package/lib/components/settings-row/settings-row.js +49 -43
- package/lib/components/show-edit-pod/show-edit-pod.js +67 -63
- package/lib/components/sidebar/sidebar-header/sidebar-header.js +43 -37
- package/lib/components/sidebar/sidebar.js +54 -48
- package/lib/components/simple-color-picker/color-option/color-option.js +47 -41
- package/lib/components/simple-color-picker/simple-color-picker.js +53 -47
- package/lib/components/spinner/spinner.js +43 -37
- package/lib/components/split-button/split-button.js +69 -69
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.js +15 -13
- package/lib/components/step-sequence/step-sequence.js +4 -4
- package/lib/components/switch/switch.js +23 -21
- package/lib/components/table/draggable-table-cell/draggable-table-cell.js +4 -4
- package/lib/components/table/table-cell/table-cell.js +45 -39
- package/lib/components/table/table-header/table-header.js +107 -110
- package/lib/components/table/table-row/table-row.js +62 -58
- package/lib/components/table/table-subheader/table-subheader.js +32 -26
- package/lib/components/table/table.js +166 -169
- package/lib/components/table-ajax/table-ajax.js +67 -70
- package/lib/components/tabs/tab/tab.js +48 -44
- package/lib/components/tabs/tabs.js +73 -67
- package/lib/components/textarea/textarea.js +52 -49
- package/lib/components/textbox/textbox.js +49 -43
- package/lib/components/toast/toast.js +56 -50
- package/lib/components/tooltip/tooltip.js +47 -41
- package/lib/patterns/configurable-items/configurable-items-content/configurable-items-content.js +35 -29
- package/lib/patterns/configurable-items/configurable-items.js +55 -51
- package/lib/patterns/configurable-items/store/store.js +35 -27
- package/lib/style/index.js +1 -1
- package/lib/style/palette/index.js +4 -2
- package/lib/style/themes/base/index.js +7 -7
- package/lib/style/themes/test-utils.js +19 -21
- package/lib/style/utils/add-hex-symbols.js +4 -2
- package/lib/style/utils/at-opacity.js +10 -8
- package/lib/style/utils/merge-deep.js +15 -15
- package/lib/style/utils/mix.js +32 -20
- package/lib/utils/decorators/input/input.js +46 -42
- package/lib/utils/decorators/input-icon/input-icon.js +37 -33
- package/lib/utils/decorators/input-label/input-label.js +37 -31
- package/lib/utils/decorators/input-validation/input-validation.js +40 -36
- package/lib/utils/decorators/should-component-update/should-component-update.js +29 -23
- package/lib/utils/decorators/tooltip-decorator/tooltip-decorator.js +38 -34
- package/lib/utils/ether/ether.js +16 -14
- package/lib/utils/filter-children/filter-children.util.js +10 -8
- package/lib/utils/handlers/base-registry/base-registry.js +12 -13
- package/lib/utils/helpers/browser/browser.js +15 -13
- package/lib/utils/helpers/date/date.js +4 -2
- package/lib/utils/helpers/element-resize/element-resize.js +6 -4
- package/lib/utils/helpers/events/events.js +2 -2
- package/lib/utils/helpers/guid/guid.js +6 -6
- package/lib/utils/helpers/i18n/i18n.js +11 -9
- package/lib/utils/helpers/immutable/immutable.js +13 -13
- package/lib/utils/helpers/prop-types/prop-types.js +2 -2
- package/lib/utils/helpers/scrollable-parent/scrollable-parent.js +2 -0
- package/lib/utils/helpers/serialize/serialize.js +12 -12
- package/lib/utils/helpers/tags/tags-specs/tags-specs.js +6 -4
- package/lib/utils/helpers/to-array/to-array.js +8 -6
- package/lib/utils/router/router.js +2 -2
- package/lib/utils/service/service.js +34 -34
- package/lib/utils/validations/blank/blank.js +6 -2
- package/lib/utils/validations/date/date.js +6 -2
- package/lib/utils/validations/date-range/date-range.js +6 -2
- package/lib/utils/validations/date-within-range/date-within-range.js +6 -2
- package/lib/utils/validations/email/email.js +6 -2
- package/lib/utils/validations/exclusion/exclusion.js +6 -2
- package/lib/utils/validations/inclusion/inclusion.js +6 -2
- package/lib/utils/validations/length/length.js +6 -2
- package/lib/utils/validations/numeral/numeral-type/numeral-type.js +8 -2
- package/lib/utils/validations/numeral/numeral.js +6 -2
- package/lib/utils/validations/presence/presence.js +12 -4
- package/lib/utils/validations/regex/regex.js +8 -2
- package/lib/utils/validations/validator/validator.js +14 -14
- package/package.json +13 -13
|
@@ -1,31 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
|
-
require("core-js/modules/es.
|
|
5
|
+
require("core-js/modules/es.object.get-prototype-of.js");
|
|
6
6
|
|
|
7
|
-
require("core-js/modules/es.
|
|
7
|
+
require("core-js/modules/es.object.to-string.js");
|
|
8
8
|
|
|
9
|
-
require("core-js/modules/es.
|
|
9
|
+
require("core-js/modules/es.reflect.construct.js");
|
|
10
10
|
|
|
11
|
-
require("core-js/modules/es.
|
|
11
|
+
require("core-js/modules/es.object.keys.js");
|
|
12
12
|
|
|
13
|
-
require("core-js/modules/es.
|
|
13
|
+
require("core-js/modules/es.symbol.js");
|
|
14
14
|
|
|
15
|
-
require("core-js/modules/es.object.
|
|
15
|
+
require("core-js/modules/es.object.assign.js");
|
|
16
16
|
|
|
17
|
-
require("core-js/modules/es.
|
|
17
|
+
require("core-js/modules/es.symbol.description.js");
|
|
18
18
|
|
|
19
|
-
require("core-js/modules/es.
|
|
19
|
+
require("core-js/modules/es.symbol.iterator.js");
|
|
20
20
|
|
|
21
|
-
require("core-js/modules/es.
|
|
21
|
+
require("core-js/modules/es.array.iterator.js");
|
|
22
22
|
|
|
23
|
-
require("core-js/modules/
|
|
23
|
+
require("core-js/modules/es.string.iterator.js");
|
|
24
|
+
|
|
25
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
24
26
|
|
|
25
27
|
Object.defineProperty(exports, "__esModule", {
|
|
26
28
|
value: true
|
|
27
29
|
});
|
|
28
|
-
exports.
|
|
30
|
+
exports.InputPresentationContext = exports.InputPresentation = void 0;
|
|
31
|
+
|
|
32
|
+
require("core-js/modules/es.array.concat.js");
|
|
29
33
|
|
|
30
34
|
var _react = _interopRequireDefault(require("react"));
|
|
31
35
|
|
|
@@ -35,11 +39,11 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
35
39
|
|
|
36
40
|
require("./input-presentation.style.scss");
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
var _excluded = ["children"];
|
|
39
43
|
|
|
40
|
-
function
|
|
44
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
41
45
|
|
|
42
|
-
function _extends() { _extends = Object.assign
|
|
46
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
43
47
|
|
|
44
48
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
45
49
|
|
|
@@ -49,17 +53,21 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
49
53
|
|
|
50
54
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
51
55
|
|
|
52
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
56
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
53
57
|
|
|
54
|
-
function
|
|
58
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
55
59
|
|
|
56
|
-
function
|
|
60
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
61
|
+
|
|
62
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
63
|
+
|
|
64
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
57
65
|
|
|
58
66
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
59
67
|
|
|
60
|
-
function
|
|
68
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
61
69
|
|
|
62
|
-
function
|
|
70
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
63
71
|
|
|
64
72
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
65
73
|
|
|
@@ -74,14 +82,12 @@ var InputPresentationContext = _react.default.createContext(); // This is a comp
|
|
|
74
82
|
|
|
75
83
|
exports.InputPresentationContext = InputPresentationContext;
|
|
76
84
|
|
|
77
|
-
var InputPresentation =
|
|
78
|
-
/*#__PURE__*/
|
|
79
|
-
function (_React$Component) {
|
|
85
|
+
var InputPresentation = /*#__PURE__*/function (_React$Component) {
|
|
80
86
|
_inherits(InputPresentation, _React$Component);
|
|
81
87
|
|
|
82
|
-
|
|
83
|
-
var _getPrototypeOf2;
|
|
88
|
+
var _super = _createSuper(InputPresentation);
|
|
84
89
|
|
|
90
|
+
function InputPresentation() {
|
|
85
91
|
var _this;
|
|
86
92
|
|
|
87
93
|
_classCallCheck(this, InputPresentation);
|
|
@@ -90,7 +96,7 @@ function (_React$Component) {
|
|
|
90
96
|
args[_key] = arguments[_key];
|
|
91
97
|
}
|
|
92
98
|
|
|
93
|
-
_this =
|
|
99
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
94
100
|
|
|
95
101
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
96
102
|
hasFocus: false
|
|
@@ -149,14 +155,14 @@ function (_React$Component) {
|
|
|
149
155
|
value: function render() {
|
|
150
156
|
var _this$props = this.props,
|
|
151
157
|
children = _this$props.children,
|
|
152
|
-
props = _objectWithoutProperties(_this$props,
|
|
158
|
+
props = _objectWithoutProperties(_this$props, _excluded);
|
|
153
159
|
|
|
154
|
-
return _react.default.createElement("div", _extends({}, props, {
|
|
160
|
+
return /*#__PURE__*/_react.default.createElement("div", _extends({}, props, {
|
|
155
161
|
role: "presentation",
|
|
156
162
|
className: this.classNames(),
|
|
157
163
|
ref: this.container,
|
|
158
164
|
onMouseDown: this.handleMouseDown
|
|
159
|
-
}), _react.default.createElement(InputPresentationContext.Provider, {
|
|
165
|
+
}), /*#__PURE__*/_react.default.createElement(InputPresentationContext.Provider, {
|
|
160
166
|
value: this.contextForInput()
|
|
161
167
|
}, children));
|
|
162
168
|
}
|
|
@@ -1,34 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
|
-
require("core-js/modules/es.
|
|
5
|
+
require("core-js/modules/es.object.get-prototype-of.js");
|
|
6
6
|
|
|
7
|
-
require("core-js/modules/es.
|
|
7
|
+
require("core-js/modules/es.object.to-string.js");
|
|
8
8
|
|
|
9
|
-
require("core-js/modules/es.
|
|
9
|
+
require("core-js/modules/es.reflect.construct.js");
|
|
10
10
|
|
|
11
|
-
require("core-js/modules/es.
|
|
11
|
+
require("core-js/modules/es.object.keys.js");
|
|
12
12
|
|
|
13
|
-
require("core-js/modules/es.
|
|
13
|
+
require("core-js/modules/es.symbol.js");
|
|
14
14
|
|
|
15
|
-
require("core-js/modules/es.object.
|
|
15
|
+
require("core-js/modules/es.object.assign.js");
|
|
16
16
|
|
|
17
|
-
require("core-js/modules/es.
|
|
17
|
+
require("core-js/modules/es.symbol.description.js");
|
|
18
18
|
|
|
19
|
-
require("core-js/modules/es.
|
|
19
|
+
require("core-js/modules/es.symbol.iterator.js");
|
|
20
20
|
|
|
21
|
-
require("core-js/modules/es.
|
|
21
|
+
require("core-js/modules/es.array.iterator.js");
|
|
22
22
|
|
|
23
|
-
require("core-js/modules/es.string.
|
|
23
|
+
require("core-js/modules/es.string.iterator.js");
|
|
24
24
|
|
|
25
|
-
require("core-js/modules/web.dom-collections.iterator");
|
|
25
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
26
26
|
|
|
27
27
|
Object.defineProperty(exports, "__esModule", {
|
|
28
28
|
value: true
|
|
29
29
|
});
|
|
30
30
|
exports.default = void 0;
|
|
31
31
|
|
|
32
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
33
|
+
|
|
34
|
+
require("core-js/modules/es.string.replace.js");
|
|
35
|
+
|
|
36
|
+
require("core-js/modules/es.array.concat.js");
|
|
37
|
+
|
|
32
38
|
var _react = _interopRequireDefault(require("react"));
|
|
33
39
|
|
|
34
40
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -37,11 +43,11 @@ var _inputPresentation = require("./input-presentation.component");
|
|
|
37
43
|
|
|
38
44
|
require("./input.style.scss");
|
|
39
45
|
|
|
40
|
-
|
|
46
|
+
var _excluded = ["className", "inputRef"];
|
|
41
47
|
|
|
42
|
-
function
|
|
48
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
43
49
|
|
|
44
|
-
function _extends() { _extends = Object.assign
|
|
50
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
45
51
|
|
|
46
52
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
47
53
|
|
|
@@ -51,17 +57,21 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
51
57
|
|
|
52
58
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
53
59
|
|
|
54
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
60
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
55
61
|
|
|
56
|
-
function
|
|
62
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
57
63
|
|
|
58
|
-
function
|
|
64
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
65
|
+
|
|
66
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
67
|
+
|
|
68
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
59
69
|
|
|
60
70
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
61
71
|
|
|
62
|
-
function
|
|
72
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
63
73
|
|
|
64
|
-
function
|
|
74
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
65
75
|
|
|
66
76
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
67
77
|
|
|
@@ -89,14 +99,12 @@ var selectTextOnFocus = function selectTextOnFocus(input) {
|
|
|
89
99
|
});
|
|
90
100
|
};
|
|
91
101
|
|
|
92
|
-
var Input =
|
|
93
|
-
/*#__PURE__*/
|
|
94
|
-
function (_React$Component) {
|
|
102
|
+
var Input = /*#__PURE__*/function (_React$Component) {
|
|
95
103
|
_inherits(Input, _React$Component);
|
|
96
104
|
|
|
97
|
-
|
|
98
|
-
var _getPrototypeOf2;
|
|
105
|
+
var _super = _createSuper(Input);
|
|
99
106
|
|
|
107
|
+
function Input() {
|
|
100
108
|
var _this;
|
|
101
109
|
|
|
102
110
|
_classCallCheck(this, Input);
|
|
@@ -105,7 +113,7 @@ function (_React$Component) {
|
|
|
105
113
|
args[_key] = arguments[_key];
|
|
106
114
|
}
|
|
107
115
|
|
|
108
|
-
_this =
|
|
116
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
109
117
|
|
|
110
118
|
_defineProperty(_assertThisInitialized(_this), "input", _react.default.createRef());
|
|
111
119
|
|
|
@@ -141,9 +149,9 @@ function (_React$Component) {
|
|
|
141
149
|
var _this$props = this.props,
|
|
142
150
|
className = _this$props.className,
|
|
143
151
|
inputRef = _this$props.inputRef,
|
|
144
|
-
props = _objectWithoutProperties(_this$props,
|
|
152
|
+
props = _objectWithoutProperties(_this$props, _excluded);
|
|
145
153
|
|
|
146
|
-
return _react.default.createElement("input", _extends({}, props, {
|
|
154
|
+
return /*#__PURE__*/_react.default.createElement("input", _extends({}, props, {
|
|
147
155
|
ref: this.input,
|
|
148
156
|
className: classNamesForInput(className),
|
|
149
157
|
onFocus: this.handleFocus,
|
package/lib/__experimental__/components/input-decorator-bridge/input-decorator-bridge.component.js
CHANGED
|
@@ -1,32 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
|
-
require("core-js/modules/es.
|
|
5
|
+
require("core-js/modules/es.object.get-prototype-of.js");
|
|
6
6
|
|
|
7
|
-
require("core-js/modules/es.
|
|
7
|
+
require("core-js/modules/es.object.to-string.js");
|
|
8
8
|
|
|
9
|
-
require("core-js/modules/es.
|
|
9
|
+
require("core-js/modules/es.reflect.construct.js");
|
|
10
10
|
|
|
11
|
-
require("core-js/modules/es.object.
|
|
11
|
+
require("core-js/modules/es.object.keys.js");
|
|
12
12
|
|
|
13
|
-
require("core-js/modules/es.
|
|
13
|
+
require("core-js/modules/es.symbol.js");
|
|
14
14
|
|
|
15
|
-
require("core-js/modules/es.object.
|
|
15
|
+
require("core-js/modules/es.object.assign.js");
|
|
16
16
|
|
|
17
|
-
require("core-js/modules/es.
|
|
17
|
+
require("core-js/modules/es.symbol.description.js");
|
|
18
18
|
|
|
19
|
-
require("core-js/modules/es.
|
|
19
|
+
require("core-js/modules/es.symbol.iterator.js");
|
|
20
20
|
|
|
21
|
-
require("core-js/modules/es.
|
|
21
|
+
require("core-js/modules/es.array.iterator.js");
|
|
22
22
|
|
|
23
|
-
require("core-js/modules/
|
|
23
|
+
require("core-js/modules/es.string.iterator.js");
|
|
24
|
+
|
|
25
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
24
26
|
|
|
25
27
|
Object.defineProperty(exports, "__esModule", {
|
|
26
28
|
value: true
|
|
27
29
|
});
|
|
28
30
|
exports.default = void 0;
|
|
29
31
|
|
|
32
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
33
|
+
|
|
34
|
+
require("core-js/modules/es.string.replace.js");
|
|
35
|
+
|
|
30
36
|
var _react = _interopRequireDefault(require("react"));
|
|
31
37
|
|
|
32
38
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -45,13 +51,13 @@ var _tags = _interopRequireDefault(require("../../../utils/helpers/tags"));
|
|
|
45
51
|
|
|
46
52
|
var _textbox = _interopRequireDefault(require("../textbox"));
|
|
47
53
|
|
|
48
|
-
var
|
|
54
|
+
var _excluded = ["className"];
|
|
49
55
|
|
|
50
|
-
|
|
56
|
+
var _class;
|
|
51
57
|
|
|
52
|
-
function
|
|
58
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
53
59
|
|
|
54
|
-
function _extends() { _extends = Object.assign
|
|
60
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
55
61
|
|
|
56
62
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
57
63
|
|
|
@@ -61,34 +67,44 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
61
67
|
|
|
62
68
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
63
69
|
|
|
64
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
70
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
65
71
|
|
|
66
|
-
function
|
|
72
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
67
73
|
|
|
68
|
-
function
|
|
74
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
75
|
+
|
|
76
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
69
77
|
|
|
70
|
-
function
|
|
78
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
79
|
+
|
|
80
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
71
81
|
|
|
72
|
-
function
|
|
82
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
73
83
|
|
|
74
|
-
function
|
|
84
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
75
85
|
|
|
76
86
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
77
87
|
|
|
78
88
|
// This component creates a bridge between the new Textbox component and the old decorator classes.
|
|
79
89
|
// As we remove the decorators, this bridge will become less useful and can be removed.
|
|
80
|
-
var InputDecoratorBridge = (0, _input.default)((0, _inputLabel.default)((0, _inputValidation.default)((0, _inputIcon.default)((
|
|
81
|
-
/*#__PURE__*/
|
|
82
|
-
function (_React$Component) {
|
|
90
|
+
var InputDecoratorBridge = (0, _input.default)((0, _inputLabel.default)((0, _inputValidation.default)((0, _inputIcon.default)((_class = /*#__PURE__*/function (_React$Component) {
|
|
83
91
|
_inherits(InputDecoratorBridge, _React$Component);
|
|
84
92
|
|
|
93
|
+
var _super = _createSuper(InputDecoratorBridge);
|
|
94
|
+
|
|
85
95
|
function InputDecoratorBridge() {
|
|
86
96
|
_classCallCheck(this, InputDecoratorBridge);
|
|
87
97
|
|
|
88
|
-
return
|
|
98
|
+
return _super.apply(this, arguments);
|
|
89
99
|
}
|
|
90
100
|
|
|
91
101
|
_createClass(InputDecoratorBridge, [{
|
|
102
|
+
key: "inputProps",
|
|
103
|
+
get: // this method is required as part of the InputDecorator API
|
|
104
|
+
function get() {
|
|
105
|
+
return (0, _ether.validProps)(this);
|
|
106
|
+
}
|
|
107
|
+
}, {
|
|
92
108
|
key: "classes",
|
|
93
109
|
value: function classes() {
|
|
94
110
|
var classes = this.mainClasses;
|
|
@@ -106,7 +122,7 @@ function (_React$Component) {
|
|
|
106
122
|
value: function render() {
|
|
107
123
|
var _this$inputProps = this.inputProps,
|
|
108
124
|
className = _this$inputProps.className,
|
|
109
|
-
inputProps = _objectWithoutProperties(_this$inputProps,
|
|
125
|
+
inputProps = _objectWithoutProperties(_this$inputProps, _excluded);
|
|
110
126
|
|
|
111
127
|
inputProps.inputRef = this.props.inputRef;
|
|
112
128
|
delete inputProps.ref; // ref is added by decorator, but we would like to move away from needing it
|
|
@@ -114,17 +130,12 @@ function (_React$Component) {
|
|
|
114
130
|
delete inputProps['data-component']; // only apply to wrapper
|
|
115
131
|
|
|
116
132
|
if (typeof this.props.formattedValue === 'string') inputProps.value = this.props.formattedValue;
|
|
117
|
-
return _react.default.createElement("div", _extends({}, this.dataAttributes(), {
|
|
133
|
+
return /*#__PURE__*/_react.default.createElement("div", _extends({}, this.dataAttributes(), {
|
|
118
134
|
className: this.classes()
|
|
119
|
-
}), this.labelHTML, _react.default.createElement("div", this.fieldProps, _react.default.createElement(_textbox.default, _extends({}, inputProps, {
|
|
135
|
+
}), this.labelHTML, /*#__PURE__*/_react.default.createElement("div", this.fieldProps, /*#__PURE__*/_react.default.createElement(_textbox.default, _extends({}, inputProps, {
|
|
120
136
|
leftChildren: this.props.leftChildren
|
|
121
137
|
}), this.props.children), this.props.inputIcon && this.inputIconHTML(this.props.inputIcon)), this.validationHTML, this.fieldHelpHTML);
|
|
122
138
|
}
|
|
123
|
-
}, {
|
|
124
|
-
key: "inputProps",
|
|
125
|
-
get: function get() {
|
|
126
|
-
return (0, _ether.validProps)(this);
|
|
127
|
-
}
|
|
128
139
|
}]);
|
|
129
140
|
|
|
130
141
|
return InputDecoratorBridge;
|
|
@@ -140,8 +151,7 @@ function (_React$Component) {
|
|
|
140
151
|
inputRef: _propTypes.default.func,
|
|
141
152
|
// optional: a callback to retrieve the input reference
|
|
142
153
|
'data-component': _propTypes.default.string // optional: helpful for automation
|
|
143
|
-
// this method is required as part of the InputDecorator API
|
|
144
154
|
|
|
145
|
-
}),
|
|
155
|
+
}), _class)))));
|
|
146
156
|
var _default = InputDecoratorBridge;
|
|
147
157
|
exports.default = _default;
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "Option", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _option.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "Select", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function get() {
|
|
15
|
-
return
|
|
15
|
+
return _select.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.
|
|
3
|
+
require("core-js/modules/es.object.keys.js");
|
|
4
4
|
|
|
5
|
-
require("core-js/modules/es.
|
|
5
|
+
require("core-js/modules/es.symbol.js");
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
@@ -13,6 +13,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
13
13
|
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
15
|
|
|
16
|
+
var _excluded = ["text", "children"];
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
20
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -22,9 +24,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
22
24
|
var Option = function Option(_ref) {
|
|
23
25
|
var text = _ref.text,
|
|
24
26
|
children = _ref.children,
|
|
25
|
-
props = _objectWithoutProperties(_ref,
|
|
27
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
28
|
|
|
27
|
-
return _react.default.createElement("div", props, children || text);
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement("div", props, children || text);
|
|
28
30
|
};
|
|
29
31
|
|
|
30
32
|
Option.propTypes = {
|