carbon-react 106.7.0 → 107.1.1

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.
Files changed (205) hide show
  1. package/esm/__internal__/click-away-wrapper/click-away-wrapper.component.d.ts +12 -0
  2. package/esm/__internal__/click-away-wrapper/click-away-wrapper.component.js +43 -0
  3. package/esm/__internal__/click-away-wrapper/index.d.ts +2 -0
  4. package/esm/__internal__/click-away-wrapper/index.js +1 -0
  5. package/esm/{components/radio-button → __internal__/radio-button-mapper}/radio-button-mapper.component.d.ts +0 -0
  6. package/esm/{components/radio-button → __internal__/radio-button-mapper}/radio-button-mapper.component.js +0 -0
  7. package/esm/components/badge/badge.style.d.ts +1 -1
  8. package/esm/components/button/button.component.d.ts +1 -3
  9. package/esm/components/button/button.component.js +1 -12
  10. package/esm/components/button/button.style.d.ts +1 -1
  11. package/esm/components/button-toggle-group/button-toggle-group.component.js +1 -1
  12. package/esm/components/confirm/confirm.component.d.ts +1 -5
  13. package/esm/components/confirm/confirm.component.js +2 -14
  14. package/esm/components/confirm/confirm.d.ts +0 -2
  15. package/esm/components/date/date.component.js +19 -20
  16. package/esm/components/date/date.d.ts +10 -1
  17. package/esm/components/date/index.d.ts +1 -0
  18. package/esm/components/date-range/date-range.d.ts +3 -3
  19. package/esm/components/date-range/index.d.ts +1 -0
  20. package/esm/components/dialog-full-screen/content.style.js +4 -10
  21. package/esm/components/heading/heading.component.d.ts +27 -52
  22. package/esm/components/heading/heading.component.js +86 -170
  23. package/esm/components/heading/heading.d.ts +5 -3
  24. package/esm/components/i18n-provider/i18n-provider.component.d.ts +0 -9
  25. package/esm/components/i18n-provider/i18n-provider.component.js +0 -9
  26. package/esm/components/menu/__internal__/submenu/submenu.component.js +11 -17
  27. package/esm/components/menu/index.d.ts +0 -1
  28. package/esm/components/menu/index.js +0 -1
  29. package/esm/components/menu/menu-item/menu-item.component.js +0 -6
  30. package/esm/components/multi-action-button/multi-action-button.component.d.ts +1 -1
  31. package/esm/components/multi-action-button/multi-action-button.component.js +1 -11
  32. package/esm/components/navigation-bar/navigation-bar.component.d.ts +1 -6
  33. package/esm/components/navigation-bar/navigation-bar.component.js +1 -15
  34. package/esm/components/navigation-bar/navigation-bar.style.d.ts +0 -4
  35. package/esm/components/navigation-bar/navigation-bar.style.js +0 -8
  36. package/esm/components/popover-container/popover-container.component.js +16 -3
  37. package/esm/components/radio-button/radio-button-group.component.js +1 -1
  38. package/esm/components/select/select-list/select-list.component.js +2 -2
  39. package/esm/components/simple-color-picker/simple-color-picker.component.js +1 -1
  40. package/esm/components/split-button/split-button-toggle.style.d.ts +1 -1
  41. package/esm/components/split-button/split-button.component.d.ts +1 -4
  42. package/esm/components/split-button/split-button.component.js +3 -16
  43. package/esm/components/split-button/split-button.d.ts +0 -2
  44. package/esm/components/tile/tile.component.d.ts +1 -2
  45. package/esm/components/tile/tile.component.js +1 -13
  46. package/esm/components/tile/tile.d.ts +0 -2
  47. package/esm/components/tile-select/tile-select-group.component.js +1 -1
  48. package/esm/components/toast/toast.component.d.ts +1 -4
  49. package/esm/components/toast/toast.component.js +1 -13
  50. package/esm/components/toast/toast.d.ts +0 -2
  51. package/esm/locales/en-gb.js +0 -9
  52. package/esm/locales/locale.d.ts +0 -9
  53. package/esm/locales/pl-pl.js +0 -9
  54. package/lib/__internal__/click-away-wrapper/click-away-wrapper.component.d.ts +12 -0
  55. package/lib/__internal__/click-away-wrapper/click-away-wrapper.component.js +59 -0
  56. package/lib/__internal__/click-away-wrapper/index.d.ts +2 -0
  57. package/lib/{components/menu/submenu-block → __internal__/click-away-wrapper}/index.js +2 -2
  58. package/lib/{components/scrollable-list → __internal__/click-away-wrapper}/package.json +1 -1
  59. package/lib/{components/radio-button → __internal__/radio-button-mapper}/radio-button-mapper.component.d.ts +0 -0
  60. package/lib/{components/radio-button → __internal__/radio-button-mapper}/radio-button-mapper.component.js +0 -0
  61. package/lib/components/badge/badge.style.d.ts +1 -1
  62. package/lib/components/button/button.component.d.ts +1 -3
  63. package/lib/components/button/button.component.js +1 -14
  64. package/lib/components/button/button.style.d.ts +1 -1
  65. package/lib/components/button-toggle-group/button-toggle-group.component.js +1 -1
  66. package/lib/components/confirm/confirm.component.d.ts +1 -5
  67. package/lib/components/confirm/confirm.component.js +2 -17
  68. package/lib/components/confirm/confirm.d.ts +0 -2
  69. package/lib/components/date/date.component.js +20 -20
  70. package/lib/components/date/date.d.ts +10 -1
  71. package/lib/components/date/index.d.ts +1 -0
  72. package/lib/components/date-range/date-range.d.ts +3 -3
  73. package/lib/components/date-range/index.d.ts +1 -0
  74. package/lib/components/dialog-full-screen/content.style.js +4 -10
  75. package/lib/components/heading/heading.component.d.ts +27 -52
  76. package/lib/components/heading/heading.component.js +86 -170
  77. package/lib/components/heading/heading.d.ts +5 -3
  78. package/lib/components/i18n-provider/i18n-provider.component.d.ts +0 -9
  79. package/lib/components/i18n-provider/i18n-provider.component.js +0 -9
  80. package/lib/components/menu/__internal__/submenu/submenu.component.js +12 -17
  81. package/lib/components/menu/index.d.ts +0 -1
  82. package/lib/components/menu/index.js +0 -8
  83. package/lib/components/menu/menu-item/menu-item.component.js +0 -7
  84. package/lib/components/multi-action-button/multi-action-button.component.d.ts +1 -1
  85. package/lib/components/multi-action-button/multi-action-button.component.js +1 -14
  86. package/lib/components/navigation-bar/navigation-bar.component.d.ts +1 -6
  87. package/lib/components/navigation-bar/navigation-bar.component.js +1 -18
  88. package/lib/components/navigation-bar/navigation-bar.style.d.ts +0 -4
  89. package/lib/components/navigation-bar/navigation-bar.style.js +0 -8
  90. package/lib/components/popover-container/popover-container.component.js +17 -3
  91. package/lib/components/radio-button/radio-button-group.component.js +1 -1
  92. package/lib/components/select/select-list/select-list.component.js +2 -2
  93. package/lib/components/simple-color-picker/simple-color-picker.component.js +1 -1
  94. package/lib/components/split-button/split-button-toggle.style.d.ts +1 -1
  95. package/lib/components/split-button/split-button.component.d.ts +1 -4
  96. package/lib/components/split-button/split-button.component.js +3 -18
  97. package/lib/components/split-button/split-button.d.ts +0 -2
  98. package/lib/components/tile/tile.component.d.ts +1 -2
  99. package/lib/components/tile/tile.component.js +1 -16
  100. package/lib/components/tile/tile.d.ts +0 -2
  101. package/lib/components/tile-select/tile-select-group.component.js +1 -1
  102. package/lib/components/toast/toast.component.d.ts +1 -4
  103. package/lib/components/toast/toast.component.js +1 -16
  104. package/lib/components/toast/toast.d.ts +0 -2
  105. package/lib/locales/en-gb.js +0 -9
  106. package/lib/locales/locale.d.ts +0 -9
  107. package/lib/locales/pl-pl.js +0 -9
  108. package/package.json +1 -1
  109. package/esm/components/app-wrapper/app-wrapper.component.d.ts +0 -25
  110. package/esm/components/app-wrapper/app-wrapper.component.js +0 -104
  111. package/esm/components/app-wrapper/app-wrapper.d.ts +0 -12
  112. package/esm/components/app-wrapper/app-wrapper.style.d.ts +0 -2
  113. package/esm/components/app-wrapper/app-wrapper.style.js +0 -17
  114. package/esm/components/app-wrapper/index.d.ts +0 -1
  115. package/esm/components/app-wrapper/index.js +0 -1
  116. package/esm/components/menu/submenu-block/index.d.ts +0 -2
  117. package/esm/components/menu/submenu-block/index.js +0 -1
  118. package/esm/components/menu/submenu-block/submenu-block.component.d.ts +0 -12
  119. package/esm/components/menu/submenu-block/submenu-block.component.js +0 -34
  120. package/esm/components/menu/submenu-block/submenu-block.d.ts +0 -12
  121. package/esm/components/menu/submenu-block/submenu-block.style.d.ts +0 -2
  122. package/esm/components/menu/submenu-block/submenu-block.style.js +0 -16
  123. package/esm/components/mount-in-app/__spec__.d.ts +0 -1
  124. package/esm/components/mount-in-app/__spec__.js +0 -47
  125. package/esm/components/mount-in-app/index.d.ts +0 -1
  126. package/esm/components/mount-in-app/mount-in-app.d.ts +0 -12
  127. package/esm/components/mount-in-app/mount-in-app.js +0 -90
  128. package/esm/components/mount-in-app/package.json +0 -3
  129. package/esm/components/multi-step-wizard/__spec__.d.ts +0 -1
  130. package/esm/components/multi-step-wizard/__spec__.js +0 -191
  131. package/esm/components/multi-step-wizard/multi-step-wizard.d.ts +0 -109
  132. package/esm/components/multi-step-wizard/multi-step-wizard.js +0 -383
  133. package/esm/components/multi-step-wizard/multi-step-wizard.style.d.ts +0 -2
  134. package/esm/components/multi-step-wizard/multi-step-wizard.style.js +0 -10
  135. package/esm/components/multi-step-wizard/package.json +0 -4
  136. package/esm/components/multi-step-wizard/step/__spec__.d.ts +0 -1
  137. package/esm/components/multi-step-wizard/step/__spec__.js +0 -399
  138. package/esm/components/multi-step-wizard/step/package.json +0 -4
  139. package/esm/components/multi-step-wizard/step/step.d.ts +0 -166
  140. package/esm/components/multi-step-wizard/step/step.js +0 -407
  141. package/esm/components/multi-step-wizard/step/step.style.d.ts +0 -13
  142. package/esm/components/multi-step-wizard/step/step.style.js +0 -138
  143. package/esm/components/scrollable-list/as-scrollable-list-item.wrapper.d.ts +0 -2
  144. package/esm/components/scrollable-list/as-scrollable-list-item.wrapper.js +0 -10
  145. package/esm/components/scrollable-list/index.d.ts +0 -4
  146. package/esm/components/scrollable-list/index.js +0 -4
  147. package/esm/components/scrollable-list/scrollable-list-item.component.d.ts +0 -2
  148. package/esm/components/scrollable-list/scrollable-list-item.component.js +0 -26
  149. package/esm/components/scrollable-list/scrollable-list.component.d.ts +0 -52
  150. package/esm/components/scrollable-list/scrollable-list.component.js +0 -306
  151. package/esm/components/scrollable-list/scrollable-list.context.d.ts +0 -3
  152. package/esm/components/scrollable-list/scrollable-list.context.js +0 -2
  153. package/esm/components/scrollable-list/scrollable-list.style.d.ts +0 -2
  154. package/esm/components/scrollable-list/scrollable-list.style.js +0 -30
  155. package/esm/components/scrollable-list/test-utils.d.ts +0 -2
  156. package/esm/components/scrollable-list/test-utils.js +0 -25
  157. package/lib/components/app-wrapper/app-wrapper.component.d.ts +0 -25
  158. package/lib/components/app-wrapper/app-wrapper.component.js +0 -120
  159. package/lib/components/app-wrapper/app-wrapper.d.ts +0 -12
  160. package/lib/components/app-wrapper/app-wrapper.style.d.ts +0 -2
  161. package/lib/components/app-wrapper/app-wrapper.style.js +0 -28
  162. package/lib/components/app-wrapper/index.d.ts +0 -1
  163. package/lib/components/app-wrapper/index.js +0 -15
  164. package/lib/components/app-wrapper/package.json +0 -6
  165. package/lib/components/menu/submenu-block/index.d.ts +0 -2
  166. package/lib/components/menu/submenu-block/package.json +0 -6
  167. package/lib/components/menu/submenu-block/submenu-block.component.d.ts +0 -12
  168. package/lib/components/menu/submenu-block/submenu-block.component.js +0 -53
  169. package/lib/components/menu/submenu-block/submenu-block.d.ts +0 -12
  170. package/lib/components/menu/submenu-block/submenu-block.style.d.ts +0 -2
  171. package/lib/components/menu/submenu-block/submenu-block.style.js +0 -33
  172. package/lib/components/mount-in-app/__spec__.d.ts +0 -1
  173. package/lib/components/mount-in-app/__spec__.js +0 -55
  174. package/lib/components/mount-in-app/index.d.ts +0 -1
  175. package/lib/components/mount-in-app/mount-in-app.d.ts +0 -12
  176. package/lib/components/mount-in-app/mount-in-app.js +0 -105
  177. package/lib/components/mount-in-app/package.json +0 -3
  178. package/lib/components/multi-step-wizard/__spec__.d.ts +0 -1
  179. package/lib/components/multi-step-wizard/__spec__.js +0 -202
  180. package/lib/components/multi-step-wizard/multi-step-wizard.d.ts +0 -109
  181. package/lib/components/multi-step-wizard/multi-step-wizard.js +0 -397
  182. package/lib/components/multi-step-wizard/multi-step-wizard.style.d.ts +0 -2
  183. package/lib/components/multi-step-wizard/multi-step-wizard.style.js +0 -21
  184. package/lib/components/multi-step-wizard/package.json +0 -4
  185. package/lib/components/multi-step-wizard/step/__spec__.d.ts +0 -1
  186. package/lib/components/multi-step-wizard/step/__spec__.js +0 -409
  187. package/lib/components/multi-step-wizard/step/package.json +0 -4
  188. package/lib/components/multi-step-wizard/step/step.d.ts +0 -166
  189. package/lib/components/multi-step-wizard/step/step.js +0 -421
  190. package/lib/components/multi-step-wizard/step/step.style.d.ts +0 -13
  191. package/lib/components/multi-step-wizard/step/step.style.js +0 -162
  192. package/lib/components/scrollable-list/as-scrollable-list-item.wrapper.d.ts +0 -2
  193. package/lib/components/scrollable-list/as-scrollable-list-item.wrapper.js +0 -21
  194. package/lib/components/scrollable-list/index.d.ts +0 -4
  195. package/lib/components/scrollable-list/index.js +0 -31
  196. package/lib/components/scrollable-list/scrollable-list-item.component.d.ts +0 -2
  197. package/lib/components/scrollable-list/scrollable-list-item.component.js +0 -42
  198. package/lib/components/scrollable-list/scrollable-list.component.d.ts +0 -52
  199. package/lib/components/scrollable-list/scrollable-list.component.js +0 -328
  200. package/lib/components/scrollable-list/scrollable-list.context.d.ts +0 -3
  201. package/lib/components/scrollable-list/scrollable-list.context.js +0 -14
  202. package/lib/components/scrollable-list/scrollable-list.style.d.ts +0 -2
  203. package/lib/components/scrollable-list/scrollable-list.style.js +0 -41
  204. package/lib/components/scrollable-list/test-utils.d.ts +0 -2
  205. package/lib/components/scrollable-list/test-utils.js +0 -37
@@ -1,421 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
- var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
- var _i18nContext = _interopRequireDefault(require("../../../__internal__/i18n-context"));
15
-
16
- var _step = require("./step.style");
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21
-
22
- 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); } }
23
-
24
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
25
-
26
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
27
-
28
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
-
30
- 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); }; }
31
-
32
- function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
33
-
34
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
35
-
36
- 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; } }
37
-
38
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
-
40
- 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; }
41
-
42
- /**
43
- * A Step widget.
44
- * This widget is part of MultiStepWizard and it is a wrapper for a step element that is passed to MultiStepWizard.
45
- *
46
- * == How to use a Step Widget in a component:
47
- * See MultiStepWizard widget
48
- *
49
- * @class Step
50
- * @constructor
51
- */
52
- let Step = /*#__PURE__*/function (_React$Component) {
53
- _inherits(Step, _React$Component);
54
-
55
- var _super = _createSuper(Step);
56
-
57
- function Step(...args) {
58
- var _this;
59
-
60
- _classCallCheck(this, Step);
61
-
62
- _this = _super.call(this, ...args);
63
-
64
- _defineProperty(_assertThisInitialized(_this), "handleOnSubmit", ev => {
65
- let valid = true;
66
-
67
- if (_this.wizard.beforeSubmitValidation) {
68
- valid = _this.wizard.beforeSubmitValidation(ev, _this.currentStepNumber);
69
- }
70
-
71
- if (valid === true) {
72
- _this.wizard.complete();
73
-
74
- _this.wizard.submitHandler(ev);
75
- }
76
- });
77
-
78
- _defineProperty(_assertThisInitialized(_this), "handleOnNext", ev => {
79
- if (_this.props.onNext) {
80
- _this.props.onNext(ev, _this.currentStepNumber);
81
- } else {
82
- _this.wizard.next();
83
- }
84
- });
85
-
86
- _defineProperty(_assertThisInitialized(_this), "handleOnBack", ev => {
87
- if (_this.props.onBack) {
88
- _this.props.onBack(ev, _this.currentStepNumber);
89
- } else {
90
- _this.wizard.back();
91
- }
92
- });
93
-
94
- return _this;
95
- }
96
-
97
- _createClass(Step, [{
98
- key: "wizard",
99
- get:
100
- /**
101
- * Gets the step's wizard
102
- *
103
- * @method wizard
104
- * @return {Object}
105
- */
106
- function () {
107
- return this.context.wizard;
108
- }
109
- /**
110
- * Gets the current step number
111
- *
112
- * @method currentStepNumber
113
- * @return {Number}
114
- */
115
-
116
- }, {
117
- key: "currentStepNumber",
118
- get: function () {
119
- return this.wizard.currentStep;
120
- }
121
- /**
122
- * Checks if the step is the first step
123
- *
124
- * @method isFirstStep
125
- * @return {Boolean}
126
- */
127
-
128
- }, {
129
- key: "isFirstStep",
130
- get: function () {
131
- return this.props.stepNumber === 1;
132
- }
133
- /**
134
- * Checks if the step is the last step
135
- *
136
- * @method isLastStep
137
- * @return {Boolean}
138
- */
139
-
140
- }, {
141
- key: "isLastStep",
142
- get: function () {
143
- return this.props.stepNumber === this.wizard.totalSteps;
144
- }
145
- /**
146
- * Checks if step component should be disabled.
147
- *
148
- * @method stepDisabled
149
- * @return {Boolean}
150
- */
151
-
152
- }, {
153
- key: "stepDisabled",
154
- get: function () {
155
- if (this.wizard.enableInactiveSteps || this.props.enabled) {
156
- return false;
157
- }
158
-
159
- return this.props.stepNumber !== this.currentStepNumber;
160
- }
161
- /**
162
- * Checks if step has been processed.
163
- *
164
- * @method stepProcessed
165
- * @return {Boolean}
166
- */
167
-
168
- }, {
169
- key: "stepProcessed",
170
- get: function () {
171
- if (this.isLastStep) {
172
- return this.stepsCompleted;
173
- }
174
-
175
- return this.props.stepNumber < this.currentStepNumber;
176
- }
177
- /**
178
- * Checks if all steps are completed
179
- *
180
- * @method stepsCompleted
181
- * @return {Boolean}
182
- */
183
-
184
- }, {
185
- key: "stepsCompleted",
186
- get: function () {
187
- return this.wizard.completed === true;
188
- }
189
- /**
190
- * Returns the computed HTML for the step.
191
- *
192
- * @method stepHTML
193
- * @return {Object} JSX
194
- */
195
-
196
- }, {
197
- key: "stepHTML",
198
- get: function () {
199
- return /*#__PURE__*/_react.default.createElement(_step.StyledStepContent, null, this.props.children, this.buttonHTML);
200
- }
201
- /**
202
- * Returns the computed HTML for the buttons.
203
- *
204
- * @method buttonHTML
205
- * @return {Object} JSX
206
- */
207
-
208
- }, {
209
- key: "buttonHTML",
210
- get: function () {
211
- if (this.props.defaultButton === false) {
212
- return this.extraButtonHTML;
213
- }
214
-
215
- let nextButton, backButton, submitButton;
216
-
217
- if (this.isLastStep) {
218
- submitButton = /*#__PURE__*/_react.default.createElement(_i18nContext.default.Consumer, null, l => /*#__PURE__*/_react.default.createElement(_step.StyledStepButton, {
219
- buttonType: "primary",
220
- "data-element": "submit",
221
- onClick: this.handleOnSubmit
222
- }, l.wizards.multiStep.buttons.submit()));
223
- } else {
224
- nextButton = /*#__PURE__*/_react.default.createElement(_i18nContext.default.Consumer, null, l => /*#__PURE__*/_react.default.createElement(_step.StyledStepButton, {
225
- buttonType: "primary",
226
- "data-element": "next",
227
- onClick: this.handleOnNext
228
- }, l.wizards.multiStep.buttons.next()));
229
- }
230
-
231
- if (!this.isFirstStep) {
232
- backButton = /*#__PURE__*/_react.default.createElement(_i18nContext.default.Consumer, null, l => /*#__PURE__*/_react.default.createElement(_step.StyledStepButton, {
233
- "data-element": "back",
234
- onClick: this.handleOnBack
235
- }, l.wizards.multiStep.buttons.back()));
236
- }
237
-
238
- return /*#__PURE__*/_react.default.createElement("div", null, nextButton, submitButton, backButton, this.extraButtonHTML);
239
- }
240
- /**
241
- * Returns the computed HTML for the step indicator.
242
- *
243
- * @method indicatorHTML
244
- * @return {Object} JSX
245
- */
246
-
247
- }, {
248
- key: "indicatorHTML",
249
- get: function () {
250
- if (this.stepProcessed) {
251
- return /*#__PURE__*/_react.default.createElement(_step.StyledStepIndicatorIcon, {
252
- type: "white-tick"
253
- });
254
- }
255
-
256
- return /*#__PURE__*/_react.default.createElement("div", null, this.props.stepNumber);
257
- }
258
- /**
259
- * Returns the step indicator status.
260
- *
261
- * @method indicatorStatus
262
- * @return {Boolean}
263
- */
264
-
265
- }, {
266
- key: "indicatorStatus",
267
- get: function () {
268
- return this.stepProcessed ? "processed" : "pending";
269
- }
270
- /**
271
- * Returns the computed HTML for the extra buttons.
272
- *
273
- * @method extraButtonHTML
274
- * @return {Object} JSX
275
- */
276
-
277
- }, {
278
- key: "extraButtonHTML",
279
- get: function () {
280
- return this.props.extraButtons.map((button, index) => {
281
- return (
282
- /*#__PURE__*/
283
- // Would change behaviour to supply a uuid on each button
284
-
285
- /* eslint-disable react/no-array-index-key */
286
- _react.default.createElement("span", {
287
- key: `multi-step-wizard-step-custom-buttons-${index}`
288
- }, button)
289
- /* eslint-enable react/no-array-index-key */
290
-
291
- );
292
- });
293
- }
294
- /**
295
- * Main class getter
296
- *
297
- * @method mainClasses
298
- * @return {String}
299
- */
300
-
301
- }, {
302
- key: "mainClasses",
303
- get: function () {
304
- return (0, _classnames.default)(`multi-step-wizard-step-${this.props.stepNumber}`, {
305
- "multi-step-wizard-step-final": this.isLastStep
306
- }, this.props.className);
307
- }
308
- /**
309
- * Renders the component.
310
- *
311
- * @method render
312
- */
313
-
314
- }, {
315
- key: "render",
316
- value: function render() {
317
- if (this.wizard) {
318
- return /*#__PURE__*/_react.default.createElement(_step.StyledStep, {
319
- disabled: this.stepDisabled,
320
- isLastStep: this.isLastStep,
321
- isStepProcessed: this.stepProcessed
322
- }, /*#__PURE__*/_react.default.createElement(_step.StyledStepIndicatorBar, {
323
- className: this.indicatorStatus,
324
- isStepProcessed: this.stepProcessed
325
- }, /*#__PURE__*/_react.default.createElement(_step.StyledStepIndicatorBackground, null)), /*#__PURE__*/_react.default.createElement(_step.StyledStepIndicatorIconContainer, null, /*#__PURE__*/_react.default.createElement(_step.StepIndicatorIconPlaceholder, null, /*#__PURE__*/_react.default.createElement(_step.StepIndicatorIconContent, {
326
- className: this.indicatorStatus,
327
- isStepProcessed: this.stepProcessed
328
- }, this.indicatorHTML))), this.stepHTML);
329
- }
330
-
331
- return /*#__PURE__*/_react.default.createElement("div", {
332
- className: "multi-step-wizard-step--none"
333
- });
334
- }
335
- }]);
336
-
337
- return Step;
338
- }(_react.default.Component);
339
-
340
- Step.propTypes = {
341
- /**
342
- * Step number
343
- *
344
- * @property stepNumber
345
- * @type {Number}
346
- */
347
- stepNumber: _propTypes.default.number.isRequired,
348
-
349
- /**
350
- * Determines if the step renders default buttons
351
- *
352
- * @property defaultButton
353
- * @type {Boolean}
354
- * @default true
355
- */
356
- defaultButton: _propTypes.default.bool,
357
-
358
- /**
359
- * Custom function that is called when moving the step forward.
360
- * This function overrides the step's default behaviour of moving next.
361
- *
362
- * @property onNext
363
- * @type {Function}
364
- */
365
- onNext: _propTypes.default.func,
366
-
367
- /**
368
- * Custom function that is called when moving the step backward.
369
- * This function overrides the step's default behaviour of moving back.
370
- *
371
- * @property onBack
372
- * @type {Function}
373
- */
374
- onBack: _propTypes.default.func,
375
-
376
- /**
377
- * Additional buttons
378
- *
379
- * @property extraButtons
380
- * @type {Array}
381
- */
382
- extraButtons: _propTypes.default.arrayOf(_propTypes.default.object),
383
-
384
- /**
385
- * Determines if the step is enabled
386
- *
387
- * @property enabled
388
- * @type {Boolean}
389
- */
390
- enabled: _propTypes.default.bool,
391
-
392
- /**
393
- * Custom className
394
- *
395
- * @property className
396
- * @type {String}
397
- */
398
- className: _propTypes.default.string,
399
-
400
- /**
401
- * Children elements
402
- *
403
- * @property children
404
- * @type {Node}
405
- */
406
- children: _propTypes.default.node
407
- };
408
- Step.defaultProps = {
409
- children: null,
410
- className: "",
411
- defaultButton: true,
412
- enabled: false,
413
- extraButtons: [],
414
- onBack: null,
415
- onNext: null
416
- };
417
- Step.contextTypes = {
418
- wizard: _propTypes.default.object
419
- };
420
- var _default = Step;
421
- exports.default = _default;
@@ -1,13 +0,0 @@
1
- export const StyledStep: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export const StyledStepContent: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export const StyledStepButton: import("styled-components").StyledComponent<{
4
- ({ size, subtext, as, children, forwardRef, "aria-label": ariaLabel, disabled, destructive, buttonType: buttonTypeProp, iconType, iconPosition, href, m, px, noWrap, target, rel, iconTooltipMessage, iconTooltipPosition, fullWidth, ...rest }: import("../../button").ButtonProps): JSX.Element;
5
- displayName: string;
6
- }, any, {}, never>;
7
- export const StyledStepIndicatorBar: import("styled-components").StyledComponent<"div", any, {}, never>;
8
- export const StyledStepIndicatorBackground: import("styled-components").StyledComponent<"div", any, {}, never>;
9
- export const StyledStepIndicatorIconContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
10
- export const StepIndicatorIconPlaceholder: import("styled-components").StyledComponent<"div", any, {}, never>;
11
- export const StepIndicatorIconContent: import("styled-components").StyledComponent<"div", any, {}, never>;
12
- export const StyledStepIndicatorIcon: import("styled-components").StyledComponent<typeof Icon, any, {}, never>;
13
- import Icon from "../../icon";
@@ -1,162 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.StyledStepIndicatorIcon = exports.StepIndicatorIconContent = exports.StepIndicatorIconPlaceholder = exports.StyledStepIndicatorIconContainer = exports.StyledStepIndicatorBackground = exports.StyledStepIndicatorBar = exports.StyledStepButton = exports.StyledStepContent = exports.StyledStep = void 0;
7
-
8
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
-
10
- var _button = _interopRequireDefault(require("../../button"));
11
-
12
- var _icon = _interopRequireDefault(require("../../icon"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
17
-
18
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
-
20
- const StyledStepContent = _styledComponents.default.div`
21
- display: table-cell;
22
- padding-left: 30px;
23
- padding-top: 5px;
24
- padding-bottom: 40px;
25
- width: 100%;
26
- `;
27
- exports.StyledStepContent = StyledStepContent;
28
- const StyledStepButton = (0, _styledComponents.default)(_button.default)`
29
- margin-top: 10px;
30
- margin-right: 10px;
31
-
32
- :first-child {
33
- background-color: #255bc7;
34
- border-color: #255bc7;
35
- color: #fff;
36
- }
37
- `;
38
- exports.StyledStepButton = StyledStepButton;
39
- const StyledStepIndicatorBackground = _styledComponents.default.div`
40
- height: 100%;
41
- display: inline-block;
42
- width: 2px;
43
- `;
44
- exports.StyledStepIndicatorBackground = StyledStepIndicatorBackground;
45
- const StyledStepIndicatorBar = _styledComponents.default.div`
46
- display: table-cell;
47
- vertical-align: top;
48
-
49
- ${({
50
- isStepProcessed
51
- }) => !isStepProcessed && (0, _styledComponents.css)`
52
- background-color: #ccd6db;
53
-
54
- ${StyledStepIndicatorBackground} {
55
- background-color: #ccd6db;
56
- }
57
- `}
58
-
59
- ${({
60
- isStepProcessed
61
- }) => isStepProcessed && (0, _styledComponents.css)`
62
- background-color: #38c72a;
63
-
64
- ${StyledStepIndicatorBackground} {
65
- background-color: #38c72a;
66
- }
67
- `}
68
- `;
69
- exports.StyledStepIndicatorBar = StyledStepIndicatorBar;
70
- const StyledStepIndicatorIconContainer = _styledComponents.default.div`
71
- display: table-cell;
72
- vertical-align: top;
73
- `;
74
- exports.StyledStepIndicatorIconContainer = StyledStepIndicatorIconContainer;
75
- const StepIndicatorIconPlaceholder = _styledComponents.default.div`
76
- display: inline-block;
77
- width: 26px;
78
- height: 36px;
79
- margin-left: -14px;
80
- background-color: #fff;
81
- `;
82
- exports.StepIndicatorIconPlaceholder = StepIndicatorIconPlaceholder;
83
- const StepIndicatorIconContent = _styledComponents.default.div`
84
- border-radius: 50%;
85
- display: block;
86
- width: 26px;
87
- height: 26px;
88
- line-height: 26px;
89
- text-align: center;
90
- font-size: 12px;
91
- font-weight: bold;
92
- color: #fff;
93
-
94
- ${({
95
- isStepProcessed
96
- }) => !isStepProcessed && (0, _styledComponents.css)`
97
- background-color: #ff7d00;
98
- `}
99
-
100
- ${({
101
- isStepProcessed
102
- }) => isStepProcessed && (0, _styledComponents.css)`
103
- background-color: #38c72a;
104
- `}
105
- `;
106
- exports.StepIndicatorIconContent = StepIndicatorIconContent;
107
- const StyledStepIndicatorIcon = (0, _styledComponents.default)(_icon.default)`
108
- vertical-align: middle;
109
- padding: 0px;
110
- `;
111
- exports.StyledStepIndicatorIcon = StyledStepIndicatorIcon;
112
- const StyledStep = _styledComponents.default.div`
113
- display: table;
114
- margin-bottom: 10px;
115
-
116
- ${({
117
- disabled
118
- }) => disabled && (0, _styledComponents.css)`
119
- pointer-events: none;
120
- opacity: 0.5;
121
-
122
- ${({
123
- isStepProcessed
124
- }) => isStepProcessed && (0, _styledComponents.css)`
125
- ${StyledStepButton} {
126
- background-color: #ccd6db;
127
- color: #7f98a3;
128
- border-color: #ccd6db;
129
- }
130
- `}
131
-
132
- ${({
133
- isStepProcessed
134
- }) => !isStepProcessed && (0, _styledComponents.css)`
135
- ${StepIndicatorIconContent} {
136
- background-color: #b3c2c8;
137
- }
138
- `}
139
- `}
140
-
141
- ${({
142
- isLastStep
143
- }) => isLastStep && (0, _styledComponents.css)`
144
- ${StyledStepIndicatorBar} {
145
- background-color: transparent;
146
-
147
- ${StyledStepIndicatorBackground} {
148
- background-color: transparent;
149
- }
150
- }
151
- `}
152
-
153
- ${({
154
- isStepProcessed
155
- }) => isStepProcessed && (0, _styledComponents.css)`
156
- input {
157
- pointer-events: none;
158
- background-color: #e6ebed;
159
- }
160
- `}
161
- `;
162
- exports.StyledStep = StyledStep;
@@ -1,2 +0,0 @@
1
- export default asScrollableListItem;
2
- declare function asScrollableListItem(CaptiveComponent: any, index: any, isSelected: any): JSX.Element;
@@ -1,21 +0,0 @@
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 _scrollableList = _interopRequireDefault(require("./scrollable-list.context"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- const asScrollableListItem = (CaptiveComponent, index, isSelected) => /*#__PURE__*/_react.default.createElement(_scrollableList.default.Consumer, null, context => /*#__PURE__*/_react.default.cloneElement(CaptiveComponent, { ...CaptiveComponent.props,
15
- onMouseOver: () => context.onMouseOver(index),
16
- onClick: () => context.onClick(index),
17
- isSelected
18
- }));
19
-
20
- var _default = asScrollableListItem;
21
- exports.default = _default;
@@ -1,4 +0,0 @@
1
- import ScrollableList from "./scrollable-list.component";
2
- import ScrollableListItem from "./scrollable-list-item.component";
3
- import asScrollableListItem from "./as-scrollable-list-item.wrapper";
4
- export { ScrollableList, ScrollableListItem, asScrollableListItem };
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "ScrollableList", {
7
- enumerable: true,
8
- get: function () {
9
- return _scrollableList.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "ScrollableListItem", {
13
- enumerable: true,
14
- get: function () {
15
- return _scrollableListItem.default;
16
- }
17
- });
18
- Object.defineProperty(exports, "asScrollableListItem", {
19
- enumerable: true,
20
- get: function () {
21
- return _asScrollableListItem.default;
22
- }
23
- });
24
-
25
- var _scrollableList = _interopRequireDefault(require("./scrollable-list.component"));
26
-
27
- var _scrollableListItem = _interopRequireDefault(require("./scrollable-list-item.component"));
28
-
29
- var _asScrollableListItem = _interopRequireDefault(require("./as-scrollable-list-item.wrapper"));
30
-
31
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,2 +0,0 @@
1
- export default ScrollableListItem;
2
- declare const ScrollableListItem: import("styled-components").StyledComponent<"li", any, {}, never>;