carbon-react 8.1.3 → 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/change_log/v8_1_4/position_date_picker.yml +1 -0
- package/change_log/v8_1_5/fix_path.yml +1 -0
- 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 +216 -194
- 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/options-helper/options-helper.js +2 -1
- 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
- package/release_notes/v8_1_4.html.md +5 -0
- package/release_notes/v8_1_5.html.md +5 -0
|
@@ -1,43 +1,49 @@
|
|
|
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.reflect.construct.js");
|
|
8
8
|
|
|
9
|
-
require("core-js/modules/es.
|
|
9
|
+
require("core-js/modules/es.reflect.get.js");
|
|
10
10
|
|
|
11
|
-
require("core-js/modules/es.
|
|
11
|
+
require("core-js/modules/es.object.get-own-property-descriptor.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.
|
|
15
|
+
require("core-js/modules/es.symbol.description.js");
|
|
16
16
|
|
|
17
|
-
require("core-js/modules/es.
|
|
17
|
+
require("core-js/modules/es.symbol.iterator.js");
|
|
18
18
|
|
|
19
|
-
require("core-js/modules/es.
|
|
19
|
+
require("core-js/modules/es.array.iterator.js");
|
|
20
20
|
|
|
21
|
-
require("core-js/modules/es.
|
|
21
|
+
require("core-js/modules/es.string.iterator.js");
|
|
22
22
|
|
|
23
|
-
require("core-js/modules/
|
|
23
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Object.defineProperty(exports, "__esModule", {
|
|
26
|
+
value: true
|
|
27
|
+
});
|
|
28
|
+
exports.default = void 0;
|
|
26
29
|
|
|
27
|
-
require("core-js/modules/es.
|
|
30
|
+
require("core-js/modules/es.array.concat.js");
|
|
28
31
|
|
|
29
|
-
require("core-js/modules/es.
|
|
32
|
+
require("core-js/modules/es.array.filter.js");
|
|
30
33
|
|
|
31
|
-
require("core-js/modules/es.string.
|
|
34
|
+
require("core-js/modules/es.object.to-string.js");
|
|
32
35
|
|
|
33
|
-
require("core-js/modules/es.
|
|
36
|
+
require("core-js/modules/es.array.find.js");
|
|
34
37
|
|
|
35
|
-
require("core-js/modules/
|
|
38
|
+
require("core-js/modules/es.regexp.constructor.js");
|
|
36
39
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
41
|
+
|
|
42
|
+
require("core-js/modules/es.regexp.to-string.js");
|
|
43
|
+
|
|
44
|
+
require("core-js/modules/es.function.name.js");
|
|
45
|
+
|
|
46
|
+
require("core-js/modules/es.string.search.js");
|
|
41
47
|
|
|
42
48
|
var _react = _interopRequireDefault(require("react"));
|
|
43
49
|
|
|
@@ -59,27 +65,29 @@ require("./dropdown-filter.scss");
|
|
|
59
65
|
|
|
60
66
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
61
67
|
|
|
62
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
63
|
-
|
|
64
68
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
65
69
|
|
|
66
70
|
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); } }
|
|
67
71
|
|
|
68
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
72
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
69
73
|
|
|
70
|
-
function
|
|
74
|
+
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
71
75
|
|
|
72
|
-
function
|
|
76
|
+
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
73
77
|
|
|
74
|
-
function
|
|
78
|
+
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); }
|
|
75
79
|
|
|
76
|
-
function
|
|
80
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
77
81
|
|
|
78
|
-
function
|
|
82
|
+
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); }; }
|
|
79
83
|
|
|
80
|
-
function
|
|
84
|
+
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); }
|
|
85
|
+
|
|
86
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
81
87
|
|
|
82
|
-
function
|
|
88
|
+
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; } }
|
|
89
|
+
|
|
90
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
83
91
|
|
|
84
92
|
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; }
|
|
85
93
|
|
|
@@ -115,11 +123,11 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
115
123
|
* @class DropdownFilter
|
|
116
124
|
* @constructor
|
|
117
125
|
*/
|
|
118
|
-
var DropdownFilter =
|
|
119
|
-
/*#__PURE__*/
|
|
120
|
-
function (_Dropdown) {
|
|
126
|
+
var DropdownFilter = /*#__PURE__*/function (_Dropdown) {
|
|
121
127
|
_inherits(DropdownFilter, _Dropdown);
|
|
122
128
|
|
|
129
|
+
var _super = _createSuper(DropdownFilter);
|
|
130
|
+
|
|
123
131
|
/**
|
|
124
132
|
* Constructor
|
|
125
133
|
*
|
|
@@ -127,8 +135,6 @@ function (_Dropdown) {
|
|
|
127
135
|
* @param {Array} args - Arguments
|
|
128
136
|
*/
|
|
129
137
|
function DropdownFilter() {
|
|
130
|
-
var _getPrototypeOf2;
|
|
131
|
-
|
|
132
138
|
var _this;
|
|
133
139
|
|
|
134
140
|
_classCallCheck(this, DropdownFilter);
|
|
@@ -137,7 +143,7 @@ function (_Dropdown) {
|
|
|
137
143
|
args[_key] = arguments[_key];
|
|
138
144
|
}
|
|
139
145
|
|
|
140
|
-
_this =
|
|
146
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
141
147
|
/**
|
|
142
148
|
* The user input search text.
|
|
143
149
|
*
|
|
@@ -260,11 +266,11 @@ function (_Dropdown) {
|
|
|
260
266
|
} // build JSX object
|
|
261
267
|
|
|
262
268
|
|
|
263
|
-
var newValue = [_react.default.createElement("span", {
|
|
269
|
+
var newValue = [/*#__PURE__*/_react.default.createElement("span", {
|
|
264
270
|
key: "beginning"
|
|
265
|
-
}, beginning), _react.default.createElement("strong", {
|
|
271
|
+
}, beginning), /*#__PURE__*/_react.default.createElement("strong", {
|
|
266
272
|
key: "middle"
|
|
267
|
-
}, _react.default.createElement("u", null, middle)), _react.default.createElement("span", {
|
|
273
|
+
}, /*#__PURE__*/_react.default.createElement("u", null, middle)), /*#__PURE__*/_react.default.createElement("span", {
|
|
268
274
|
key: "end"
|
|
269
275
|
}, end)];
|
|
270
276
|
return newValue;
|
|
@@ -368,17 +374,17 @@ function (_Dropdown) {
|
|
|
368
374
|
|
|
369
375
|
}, {
|
|
370
376
|
key: "results",
|
|
371
|
-
|
|
377
|
+
value:
|
|
372
378
|
/**
|
|
373
379
|
* Function that returns search results. Builds each list item with relevant handlers and classes.
|
|
374
380
|
*
|
|
375
381
|
* @method results
|
|
376
382
|
*/
|
|
377
|
-
|
|
383
|
+
function results(options) {
|
|
378
384
|
var items = _get(_getPrototypeOf(DropdownFilter.prototype), "results", this).call(this, options);
|
|
379
385
|
|
|
380
386
|
if (!items.length) {
|
|
381
|
-
items = _react.default.createElement("li", {
|
|
387
|
+
items = /*#__PURE__*/_react.default.createElement("li", {
|
|
382
388
|
className: "carbon-dropdown__list-item carbon-dropdown__list-item--no-results"
|
|
383
389
|
}, _i18nJs.default.t('dropdownlist.no_results', {
|
|
384
390
|
defaultValue: 'No results match "%{term}"',
|
|
@@ -394,54 +400,15 @@ function (_Dropdown) {
|
|
|
394
400
|
* @method highlighted
|
|
395
401
|
*/
|
|
396
402
|
|
|
397
|
-
}, {
|
|
398
|
-
key: "showArrow",
|
|
399
|
-
|
|
400
|
-
/**
|
|
401
|
-
* Overrides Dropdown method to conditionally show arrow
|
|
402
|
-
*
|
|
403
|
-
* @method showArrow
|
|
404
|
-
* @return {Boolean}
|
|
405
|
-
*/
|
|
406
|
-
value: function showArrow() {
|
|
407
|
-
return !this.writeable;
|
|
408
|
-
}
|
|
409
|
-
/**
|
|
410
|
-
* Returns the list options in the correct format
|
|
411
|
-
*
|
|
412
|
-
* @method options
|
|
413
|
-
*/
|
|
414
|
-
|
|
415
|
-
}, {
|
|
416
|
-
key: "hasFreetextValue",
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* Returns whether properties indicate a freetext write-in value
|
|
420
|
-
*
|
|
421
|
-
* @method hasFreetextValue
|
|
422
|
-
* @return {Boolean}
|
|
423
|
-
*/
|
|
424
|
-
value: function hasFreetextValue() {
|
|
425
|
-
return this.props.freetext && this.props.visibleValue && !this.props.value;
|
|
426
|
-
}
|
|
427
|
-
}, {
|
|
428
|
-
key: "componentTags",
|
|
429
|
-
value: function componentTags(props) {
|
|
430
|
-
return {
|
|
431
|
-
'data-component': 'dropdown-filter',
|
|
432
|
-
'data-element': props['data-element'],
|
|
433
|
-
'data-role': props['data-role']
|
|
434
|
-
};
|
|
435
|
-
}
|
|
436
403
|
}, {
|
|
437
404
|
key: "listHTML",
|
|
438
|
-
|
|
405
|
+
get:
|
|
439
406
|
/**
|
|
440
407
|
* Getter to return HTML for list to render method.
|
|
441
408
|
*
|
|
442
409
|
* @method listHTML
|
|
443
410
|
*/
|
|
444
|
-
|
|
411
|
+
function get() {
|
|
445
412
|
var original = _get(_getPrototypeOf(DropdownFilter.prototype), "listHTML", this),
|
|
446
413
|
html = [original];
|
|
447
414
|
|
|
@@ -460,7 +427,7 @@ function (_Dropdown) {
|
|
|
460
427
|
});
|
|
461
428
|
}
|
|
462
429
|
|
|
463
|
-
html.push(_react.default.createElement(_link.default, {
|
|
430
|
+
html.push( /*#__PURE__*/_react.default.createElement(_link.default, {
|
|
464
431
|
icon: this.props.createIconType || 'add',
|
|
465
432
|
iconAlign: "left",
|
|
466
433
|
className: "carbon-dropdown__action",
|
|
@@ -472,6 +439,24 @@ function (_Dropdown) {
|
|
|
472
439
|
|
|
473
440
|
return html;
|
|
474
441
|
}
|
|
442
|
+
/**
|
|
443
|
+
* Overrides Dropdown method to conditionally show arrow
|
|
444
|
+
*
|
|
445
|
+
* @method showArrow
|
|
446
|
+
* @return {Boolean}
|
|
447
|
+
*/
|
|
448
|
+
|
|
449
|
+
}, {
|
|
450
|
+
key: "showArrow",
|
|
451
|
+
value: function showArrow() {
|
|
452
|
+
return !this.writeable;
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Returns the list options in the correct format
|
|
456
|
+
*
|
|
457
|
+
* @method options
|
|
458
|
+
*/
|
|
459
|
+
|
|
475
460
|
}, {
|
|
476
461
|
key: "options",
|
|
477
462
|
get: function get() {
|
|
@@ -560,7 +545,7 @@ function (_Dropdown) {
|
|
|
560
545
|
return null;
|
|
561
546
|
}
|
|
562
547
|
|
|
563
|
-
return _react.default.createElement("input", this.alternateHiddenInputProps);
|
|
548
|
+
return /*#__PURE__*/_react.default.createElement("input", this.alternateHiddenInputProps);
|
|
564
549
|
}
|
|
565
550
|
/**
|
|
566
551
|
* Find and highlights search terms in text
|
|
@@ -572,16 +557,37 @@ function (_Dropdown) {
|
|
|
572
557
|
|
|
573
558
|
}, {
|
|
574
559
|
key: "writeable",
|
|
575
|
-
|
|
560
|
+
get:
|
|
576
561
|
/**
|
|
577
562
|
* Returns whether input is writeable (for suggest or freetext modes)
|
|
578
563
|
*
|
|
579
564
|
* @method writeable
|
|
580
565
|
* @return {Boolean}
|
|
581
566
|
*/
|
|
582
|
-
|
|
567
|
+
function get() {
|
|
583
568
|
return this.props.suggest || this.props.freetext;
|
|
584
569
|
}
|
|
570
|
+
/**
|
|
571
|
+
* Returns whether properties indicate a freetext write-in value
|
|
572
|
+
*
|
|
573
|
+
* @method hasFreetextValue
|
|
574
|
+
* @return {Boolean}
|
|
575
|
+
*/
|
|
576
|
+
|
|
577
|
+
}, {
|
|
578
|
+
key: "hasFreetextValue",
|
|
579
|
+
value: function hasFreetextValue() {
|
|
580
|
+
return this.props.freetext && this.props.visibleValue && !this.props.value;
|
|
581
|
+
}
|
|
582
|
+
}, {
|
|
583
|
+
key: "componentTags",
|
|
584
|
+
value: function componentTags(props) {
|
|
585
|
+
return {
|
|
586
|
+
'data-component': 'dropdown-filter',
|
|
587
|
+
'data-element': props['data-element'],
|
|
588
|
+
'data-role': props['data-role']
|
|
589
|
+
};
|
|
590
|
+
}
|
|
585
591
|
}]);
|
|
586
592
|
|
|
587
593
|
return DropdownFilter;
|
|
@@ -1,34 +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.reflect.construct.js");
|
|
8
8
|
|
|
9
|
-
require("core-js/modules/es.
|
|
9
|
+
require("core-js/modules/es.reflect.get.js");
|
|
10
10
|
|
|
11
|
-
require("core-js/modules/es.
|
|
11
|
+
require("core-js/modules/es.object.get-own-property-descriptor.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.
|
|
15
|
+
require("core-js/modules/es.symbol.description.js");
|
|
16
16
|
|
|
17
|
-
require("core-js/modules/es.
|
|
17
|
+
require("core-js/modules/es.symbol.iterator.js");
|
|
18
18
|
|
|
19
|
-
require("core-js/modules/es.
|
|
19
|
+
require("core-js/modules/es.array.iterator.js");
|
|
20
20
|
|
|
21
|
-
require("core-js/modules/es.
|
|
21
|
+
require("core-js/modules/es.string.iterator.js");
|
|
22
22
|
|
|
23
|
-
require("core-js/modules/
|
|
24
|
-
|
|
25
|
-
require("core-js/modules/web.dom-collections.iterator");
|
|
23
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
26
24
|
|
|
27
25
|
Object.defineProperty(exports, "__esModule", {
|
|
28
26
|
value: true
|
|
29
27
|
});
|
|
30
28
|
exports.default = void 0;
|
|
31
29
|
|
|
30
|
+
require("core-js/modules/es.array.concat.js");
|
|
31
|
+
|
|
32
|
+
require("core-js/modules/es.array.filter.js");
|
|
33
|
+
|
|
34
|
+
require("core-js/modules/es.object.to-string.js");
|
|
35
|
+
|
|
32
36
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
33
37
|
|
|
34
38
|
var _superagent = _interopRequireDefault(require("superagent"));
|
|
@@ -39,27 +43,29 @@ var _dropdownFilter = _interopRequireDefault(require("../dropdown-filter"));
|
|
|
39
43
|
|
|
40
44
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
41
45
|
|
|
42
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
43
|
-
|
|
44
46
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
45
47
|
|
|
46
48
|
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); } }
|
|
47
49
|
|
|
48
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
50
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
49
51
|
|
|
50
|
-
function
|
|
52
|
+
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
51
53
|
|
|
52
|
-
function
|
|
54
|
+
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
53
55
|
|
|
54
|
-
function
|
|
56
|
+
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
57
|
|
|
56
|
-
function
|
|
58
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
59
|
+
|
|
60
|
+
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); }; }
|
|
57
61
|
|
|
58
|
-
function
|
|
62
|
+
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); }
|
|
63
|
+
|
|
64
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
59
65
|
|
|
60
|
-
function
|
|
66
|
+
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
67
|
|
|
62
|
-
function
|
|
68
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
63
69
|
|
|
64
70
|
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
71
|
|
|
@@ -88,14 +94,12 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
88
94
|
* @class DropdownFilterAjax
|
|
89
95
|
* @constructor
|
|
90
96
|
*/
|
|
91
|
-
var DropdownFilterAjax =
|
|
92
|
-
/*#__PURE__*/
|
|
93
|
-
function (_DropdownFilter) {
|
|
97
|
+
var DropdownFilterAjax = /*#__PURE__*/function (_DropdownFilter) {
|
|
94
98
|
_inherits(DropdownFilterAjax, _DropdownFilter);
|
|
95
99
|
|
|
96
|
-
|
|
97
|
-
var _getPrototypeOf2;
|
|
100
|
+
var _super = _createSuper(DropdownFilterAjax);
|
|
98
101
|
|
|
102
|
+
function DropdownFilterAjax() {
|
|
99
103
|
var _this;
|
|
100
104
|
|
|
101
105
|
_classCallCheck(this, DropdownFilterAjax);
|
|
@@ -104,7 +108,7 @@ function (_DropdownFilter) {
|
|
|
104
108
|
args[_key] = arguments[_key];
|
|
105
109
|
}
|
|
106
110
|
|
|
107
|
-
_this =
|
|
111
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
108
112
|
/**
|
|
109
113
|
* A collection of results for the list.
|
|
110
114
|
*
|
|
@@ -280,7 +284,14 @@ function (_DropdownFilter) {
|
|
|
280
284
|
|
|
281
285
|
_createClass(DropdownFilterAjax, [{
|
|
282
286
|
key: "handleVisibleChange",
|
|
283
|
-
value:
|
|
287
|
+
value:
|
|
288
|
+
/*
|
|
289
|
+
* Handles changes to the visible input field. Updates filter and displayed value.
|
|
290
|
+
*
|
|
291
|
+
* @method handleVisibleChange
|
|
292
|
+
* @param {Object} ev event
|
|
293
|
+
*/
|
|
294
|
+
function handleVisibleChange(ev) {
|
|
284
295
|
var _this2 = this;
|
|
285
296
|
|
|
286
297
|
_get(_getPrototypeOf(DropdownFilterAjax.prototype), "handleVisibleChange", this).call(this, ev);
|
|
@@ -300,24 +311,15 @@ function (_DropdownFilter) {
|
|
|
300
311
|
* @method handleBlur
|
|
301
312
|
*/
|
|
302
313
|
|
|
303
|
-
}, {
|
|
304
|
-
key: "componentTags",
|
|
305
|
-
value: function componentTags(props) {
|
|
306
|
-
return {
|
|
307
|
-
'data-component': 'dropdown-filter-ajax',
|
|
308
|
-
'data-element': props['data-element'],
|
|
309
|
-
'data-role': props['data-role']
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
314
|
}, {
|
|
313
315
|
key: "listProps",
|
|
314
|
-
|
|
316
|
+
get:
|
|
315
317
|
/**
|
|
316
318
|
* Properties to be assigned to the list.
|
|
317
319
|
*
|
|
318
320
|
* @method listProps
|
|
319
321
|
*/
|
|
320
|
-
|
|
322
|
+
function get() {
|
|
321
323
|
var props = _get(_getPrototypeOf(DropdownFilterAjax.prototype), "listProps", this);
|
|
322
324
|
|
|
323
325
|
props.onScroll = this.handleScroll;
|
|
@@ -340,13 +342,13 @@ function (_DropdownFilter) {
|
|
|
340
342
|
|
|
341
343
|
}, {
|
|
342
344
|
key: "inputProps",
|
|
343
|
-
|
|
345
|
+
get:
|
|
344
346
|
/**
|
|
345
347
|
* Input props for the dropdown, extended from the base dropdown component.
|
|
346
348
|
*
|
|
347
349
|
* @method inputProps
|
|
348
350
|
*/
|
|
349
|
-
|
|
351
|
+
function get() {
|
|
350
352
|
var props = _get(_getPrototypeOf(DropdownFilterAjax.prototype), "inputProps", this);
|
|
351
353
|
|
|
352
354
|
if (typeof this.state.filter !== 'string') {
|
|
@@ -357,6 +359,15 @@ function (_DropdownFilter) {
|
|
|
357
359
|
|
|
358
360
|
return props;
|
|
359
361
|
}
|
|
362
|
+
}, {
|
|
363
|
+
key: "componentTags",
|
|
364
|
+
value: function componentTags(props) {
|
|
365
|
+
return {
|
|
366
|
+
'data-component': 'dropdown-filter-ajax',
|
|
367
|
+
'data-element': props['data-element'],
|
|
368
|
+
'data-role': props['data-role']
|
|
369
|
+
};
|
|
370
|
+
}
|
|
360
371
|
}]);
|
|
361
372
|
|
|
362
373
|
return DropdownFilterAjax;
|
|
@@ -491,13 +502,6 @@ _defineProperty(DropdownFilterAjax, "defaultProps", {
|
|
|
491
502
|
acceptHeader: 'application/json',
|
|
492
503
|
visibleValue: '',
|
|
493
504
|
dataRequestTimeout: 500
|
|
494
|
-
/*
|
|
495
|
-
* Handles changes to the visible input field. Updates filter and displayed value.
|
|
496
|
-
*
|
|
497
|
-
* @method handleVisibleChange
|
|
498
|
-
* @param {Object} ev event
|
|
499
|
-
*/
|
|
500
|
-
|
|
501
505
|
});
|
|
502
506
|
|
|
503
507
|
var _default = DropdownFilterAjax;
|