@dxc-technology/halstack-react 0.0.0-c796a1b → 0.0.0-c8b251f
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/BackgroundColorContext.js +0 -1
- package/ThemeContext.d.ts +4 -9
- package/ThemeContext.js +32 -32
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +11 -43
- package/accordion/Accordion.stories.tsx +307 -0
- package/accordion/Accordion.test.js +72 -0
- package/accordion/types.d.ts +8 -8
- package/accordion-group/AccordionGroup.d.ts +1 -1
- package/accordion-group/AccordionGroup.js +13 -15
- package/accordion-group/AccordionGroup.stories.tsx +1 -1
- package/accordion-group/AccordionGroup.test.js +151 -0
- package/accordion-group/types.d.ts +8 -8
- package/alert/Alert.test.js +92 -0
- package/badge/Badge.d.ts +4 -0
- package/badge/types.d.ts +4 -0
- package/badge/types.js +5 -0
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +84 -0
- package/bleed/Bleed.stories.tsx +342 -0
- package/bleed/types.d.ts +37 -0
- package/bleed/types.js +5 -0
- package/box/Box.test.js +18 -0
- package/button/Button.d.ts +1 -1
- package/button/Button.js +9 -17
- package/button/Button.stories.tsx +6 -8
- package/button/Button.test.js +35 -0
- package/button/types.d.ts +3 -7
- package/card/Card.stories.tsx +1 -1
- package/card/Card.test.js +50 -0
- package/checkbox/Checkbox.d.ts +1 -1
- package/checkbox/Checkbox.js +7 -13
- package/checkbox/Checkbox.stories.tsx +14 -14
- package/checkbox/Checkbox.test.js +78 -0
- package/checkbox/types.d.ts +5 -1
- package/chip/Chip.d.ts +1 -1
- package/chip/Chip.js +16 -54
- package/chip/Chip.stories.tsx +6 -8
- package/chip/Chip.test.js +56 -0
- package/chip/types.d.ts +7 -15
- package/common/variables.js +43 -245
- package/date-input/DateInput.js +50 -39
- package/date-input/DateInput.stories.tsx +7 -7
- package/date-input/DateInput.test.js +479 -0
- package/date-input/types.d.ts +16 -9
- package/dialog/Dialog.js +6 -33
- package/dialog/Dialog.test.js +40 -0
- package/dropdown/Dropdown.d.ts +1 -1
- package/dropdown/Dropdown.js +12 -34
- package/dropdown/Dropdown.stories.tsx +249 -0
- package/dropdown/Dropdown.test.js +189 -0
- package/dropdown/types.d.ts +5 -14
- package/file-input/FileInput.js +102 -33
- package/file-input/FileInput.stories.tsx +507 -0
- package/file-input/FileInput.test.js +457 -0
- package/footer/Footer.js +19 -96
- package/footer/Footer.test.js +109 -0
- package/header/Header.js +20 -44
- package/header/Header.stories.tsx +46 -36
- package/header/Header.test.js +79 -0
- package/heading/Heading.stories.tsx +3 -2
- package/heading/Heading.test.js +186 -0
- package/inset/Inset.d.ts +3 -0
- package/inset/Inset.js +84 -0
- package/inset/Inset.stories.tsx +229 -0
- package/inset/types.d.ts +37 -0
- package/inset/types.js +5 -0
- package/layout/ApplicationLayout.js +7 -14
- package/link/Link.js +7 -15
- package/link/Link.stories.tsx +6 -1
- package/link/Link.test.js +91 -0
- package/link/types.d.ts +5 -9
- package/list/List.d.ts +3 -6
- package/list/List.js +17 -7
- package/list/List.stories.tsx +25 -0
- package/list/types.d.ts +7 -0
- package/list/types.js +5 -0
- package/main.d.ts +5 -6
- package/main.js +28 -36
- package/number-input/NumberInput.js +11 -18
- package/number-input/NumberInput.stories.tsx +5 -5
- package/number-input/NumberInput.test.js +506 -0
- package/number-input/types.d.ts +16 -9
- package/package.json +6 -3
- package/paginator/Paginator.test.js +266 -0
- package/password-input/PasswordInput.stories.tsx +3 -3
- package/password-input/PasswordInput.test.js +181 -0
- package/password-input/types.d.ts +13 -10
- package/progress-bar/ProgressBar.js +2 -2
- package/progress-bar/ProgressBar.test.js +65 -0
- package/quick-nav/QuickNav.d.ts +4 -0
- package/quick-nav/QuickNav.js +66 -0
- package/quick-nav/QuickNav.stories.tsx +237 -0
- package/quick-nav/types.d.ts +21 -0
- package/quick-nav/types.js +5 -0
- package/radio/Radio.test.js +71 -0
- package/radio-group/Radio.d.ts +4 -0
- package/radio-group/Radio.js +141 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +280 -0
- package/radio-group/RadioGroup.stories.tsx +100 -0
- package/radio-group/RadioGroup.test.js +695 -0
- package/radio-group/types.d.ts +114 -0
- package/radio-group/types.js +5 -0
- package/resultsetTable/ResultsetTable.js +5 -2
- package/resultsetTable/ResultsetTable.stories.tsx +7 -8
- package/resultsetTable/ResultsetTable.test.js +306 -0
- package/row/Row.d.ts +3 -11
- package/row/Row.js +12 -9
- package/row/Row.stories.tsx +20 -6
- package/row/types.d.ts +28 -0
- package/row/types.js +5 -0
- package/select/Icons.d.ts +10 -0
- package/select/Icons.js +93 -0
- package/select/Listbox.d.ts +4 -0
- package/select/Listbox.js +148 -0
- package/select/Option.d.ts +4 -0
- package/select/Option.js +110 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +94 -302
- package/select/Select.stories.tsx +91 -81
- package/select/Select.test.js +2057 -0
- package/select/types.d.ts +213 -0
- package/select/types.js +5 -0
- package/sidenav/Sidenav.stories.tsx +18 -1
- package/sidenav/Sidenav.test.js +56 -0
- package/slider/Slider.d.ts +1 -1
- package/slider/Slider.js +2 -1
- package/slider/Slider.stories.tsx +8 -8
- package/slider/Slider.test.js +150 -0
- package/slider/types.d.ts +4 -0
- package/spinner/Spinner.stories.jsx +1 -0
- package/spinner/Spinner.test.js +64 -0
- package/stack/Stack.d.ts +3 -10
- package/stack/Stack.js +12 -9
- package/stack/Stack.stories.tsx +20 -6
- package/stack/types.d.ts +24 -0
- package/stack/types.js +5 -0
- package/switch/Switch.d.ts +1 -1
- package/switch/Switch.js +19 -6
- package/switch/Switch.stories.tsx +7 -7
- package/switch/Switch.test.js +98 -0
- package/switch/types.d.ts +4 -0
- package/table/Table.stories.jsx +2 -1
- package/table/Table.test.js +26 -0
- package/tabs/Tabs.d.ts +1 -1
- package/tabs/Tabs.js +16 -18
- package/tabs/Tabs.stories.tsx +8 -11
- package/tabs/Tabs.test.js +140 -0
- package/tabs/types.d.ts +27 -15
- package/tag/Tag.d.ts +1 -1
- package/tag/Tag.js +15 -22
- package/tag/Tag.stories.tsx +26 -29
- package/tag/Tag.test.js +60 -0
- package/tag/types.d.ts +23 -14
- package/text/Text.js +1 -1
- package/text-input/TextInput.js +22 -12
- package/text-input/TextInput.stories.tsx +34 -16
- package/text-input/TextInput.test.js +1712 -0
- package/text-input/types.d.ts +18 -11
- package/textarea/Textarea.d.ts +4 -0
- package/textarea/Textarea.js +10 -38
- package/textarea/Textarea.stories.jsx +37 -15
- package/textarea/Textarea.test.js +437 -0
- package/textarea/types.d.ts +137 -0
- package/textarea/types.js +5 -0
- package/toggle-group/ToggleGroup.d.ts +1 -1
- package/toggle-group/ToggleGroup.js +12 -14
- package/toggle-group/ToggleGroup.stories.tsx +27 -32
- package/toggle-group/ToggleGroup.test.js +156 -0
- package/toggle-group/types.d.ts +46 -25
- package/wizard/Wizard.d.ts +1 -1
- package/wizard/Wizard.js +71 -16
- package/wizard/{Wizard.stories.jsx → Wizard.stories.tsx} +13 -23
- package/wizard/Wizard.test.js +141 -0
- package/wizard/types.d.ts +8 -8
- package/V3Select/V3Select.js +0 -455
- package/V3Select/index.d.ts +0 -27
- package/V3Textarea/V3Textarea.js +0 -260
- package/V3Textarea/index.d.ts +0 -27
- package/date/Date.js +0 -373
- package/date/index.d.ts +0 -27
- package/input-text/Icons.js +0 -22
- package/input-text/InputText.js +0 -611
- package/input-text/index.d.ts +0 -36
- package/select/index.d.ts +0 -131
- package/textarea/index.d.ts +0 -127
- package/toggle/Toggle.js +0 -186
- package/toggle/index.d.ts +0 -21
- package/upload/Upload.js +0 -201
- package/upload/buttons-upload/ButtonsUpload.js +0 -111
- package/upload/buttons-upload/Icons.js +0 -40
- package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
- package/upload/dragAndDropArea/Icons.js +0 -39
- package/upload/file-upload/FileToUpload.js +0 -115
- package/upload/file-upload/Icons.js +0 -66
- package/upload/files-upload/FilesToUpload.js +0 -109
- package/upload/index.d.ts +0 -15
- package/upload/transaction/Icons.js +0 -160
- package/upload/transaction/Transaction.js +0 -104
- package/upload/transactions/Transactions.js +0 -94
- package/wizard/Icons.js +0 -65
package/file-input/FileInput.js
CHANGED
|
@@ -17,6 +17,8 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
17
17
|
|
|
18
18
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
19
19
|
|
|
20
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
21
|
+
|
|
20
22
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
21
23
|
|
|
22
24
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -41,6 +43,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
41
43
|
|
|
42
44
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
43
45
|
|
|
46
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
47
|
+
|
|
48
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
49
|
+
|
|
44
50
|
var audioIcon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
45
51
|
xmlns: "http://www.w3.org/2000/svg",
|
|
46
52
|
width: "24",
|
|
@@ -122,11 +128,74 @@ var DxcFileInput = function DxcFileInput(_ref) {
|
|
|
122
128
|
|
|
123
129
|
var colorsTheme = (0, _useTheme["default"])();
|
|
124
130
|
(0, _react.useEffect)(function () {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
131
|
+
var getFiles = /*#__PURE__*/function () {
|
|
132
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
133
|
+
var valueFiles;
|
|
134
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
135
|
+
while (1) {
|
|
136
|
+
switch (_context2.prev = _context2.next) {
|
|
137
|
+
case 0:
|
|
138
|
+
if (!value) {
|
|
139
|
+
_context2.next = 5;
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
_context2.next = 3;
|
|
144
|
+
return Promise.all(value.map( /*#__PURE__*/function () {
|
|
145
|
+
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(file) {
|
|
146
|
+
var preview;
|
|
147
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
148
|
+
while (1) {
|
|
149
|
+
switch (_context.prev = _context.next) {
|
|
150
|
+
case 0:
|
|
151
|
+
if (!file.preview) {
|
|
152
|
+
_context.next = 4;
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return _context.abrupt("return", file);
|
|
157
|
+
|
|
158
|
+
case 4:
|
|
159
|
+
_context.next = 6;
|
|
160
|
+
return getFilePreview(file.file);
|
|
161
|
+
|
|
162
|
+
case 6:
|
|
163
|
+
preview = _context.sent;
|
|
164
|
+
return _context.abrupt("return", _objectSpread(_objectSpread({}, file), {}, {
|
|
165
|
+
preview: preview
|
|
166
|
+
}));
|
|
167
|
+
|
|
168
|
+
case 8:
|
|
169
|
+
case "end":
|
|
170
|
+
return _context.stop();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}, _callee);
|
|
174
|
+
}));
|
|
175
|
+
|
|
176
|
+
return function (_x) {
|
|
177
|
+
return _ref3.apply(this, arguments);
|
|
178
|
+
};
|
|
179
|
+
}()));
|
|
180
|
+
|
|
181
|
+
case 3:
|
|
182
|
+
valueFiles = _context2.sent;
|
|
183
|
+
setFiles(valueFiles);
|
|
184
|
+
|
|
185
|
+
case 5:
|
|
186
|
+
case "end":
|
|
187
|
+
return _context2.stop();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}, _callee2);
|
|
191
|
+
}));
|
|
192
|
+
|
|
193
|
+
return function getFiles() {
|
|
194
|
+
return _ref2.apply(this, arguments);
|
|
195
|
+
};
|
|
196
|
+
}();
|
|
197
|
+
|
|
198
|
+
getFiles();
|
|
130
199
|
}, [value]);
|
|
131
200
|
|
|
132
201
|
var handleClick = function handleClick() {
|
|
@@ -167,13 +236,13 @@ var DxcFileInput = function DxcFileInput(_ref) {
|
|
|
167
236
|
};
|
|
168
237
|
|
|
169
238
|
var getFilesToAdd = /*#__PURE__*/function () {
|
|
170
|
-
var
|
|
239
|
+
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(selectedFiles) {
|
|
171
240
|
var filesToAdd;
|
|
172
|
-
return _regenerator["default"].wrap(function
|
|
241
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
173
242
|
while (1) {
|
|
174
|
-
switch (
|
|
243
|
+
switch (_context3.prev = _context3.next) {
|
|
175
244
|
case 0:
|
|
176
|
-
|
|
245
|
+
_context3.next = 2;
|
|
177
246
|
return Promise.all(selectedFiles.map(function (selectedFile) {
|
|
178
247
|
return getFilePreview(selectedFile);
|
|
179
248
|
})).then(function (previews) {
|
|
@@ -188,71 +257,71 @@ var DxcFileInput = function DxcFileInput(_ref) {
|
|
|
188
257
|
});
|
|
189
258
|
|
|
190
259
|
case 2:
|
|
191
|
-
filesToAdd =
|
|
192
|
-
return
|
|
260
|
+
filesToAdd = _context3.sent;
|
|
261
|
+
return _context3.abrupt("return", filesToAdd);
|
|
193
262
|
|
|
194
263
|
case 4:
|
|
195
264
|
case "end":
|
|
196
|
-
return
|
|
265
|
+
return _context3.stop();
|
|
197
266
|
}
|
|
198
267
|
}
|
|
199
|
-
},
|
|
268
|
+
}, _callee3);
|
|
200
269
|
}));
|
|
201
270
|
|
|
202
|
-
return function getFilesToAdd(
|
|
203
|
-
return
|
|
271
|
+
return function getFilesToAdd(_x2) {
|
|
272
|
+
return _ref4.apply(this, arguments);
|
|
204
273
|
};
|
|
205
274
|
}();
|
|
206
275
|
|
|
207
276
|
var addFile = /*#__PURE__*/function () {
|
|
208
|
-
var
|
|
277
|
+
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(selectedFiles) {
|
|
209
278
|
var filesToAdd, finalFiles, fileToAdd;
|
|
210
|
-
return _regenerator["default"].wrap(function
|
|
279
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
211
280
|
while (1) {
|
|
212
|
-
switch (
|
|
281
|
+
switch (_context4.prev = _context4.next) {
|
|
213
282
|
case 0:
|
|
214
283
|
if (!multiple) {
|
|
215
|
-
|
|
284
|
+
_context4.next = 8;
|
|
216
285
|
break;
|
|
217
286
|
}
|
|
218
287
|
|
|
219
|
-
|
|
288
|
+
_context4.next = 3;
|
|
220
289
|
return getFilesToAdd(selectedFiles);
|
|
221
290
|
|
|
222
291
|
case 3:
|
|
223
|
-
filesToAdd =
|
|
292
|
+
filesToAdd = _context4.sent;
|
|
224
293
|
finalFiles = [].concat((0, _toConsumableArray2["default"])(files), (0, _toConsumableArray2["default"])(filesToAdd));
|
|
225
294
|
|
|
226
295
|
if (typeof callbackFile === "function") {
|
|
227
296
|
callbackFile(finalFiles);
|
|
228
297
|
}
|
|
229
298
|
|
|
230
|
-
|
|
299
|
+
_context4.next = 19;
|
|
231
300
|
break;
|
|
232
301
|
|
|
233
302
|
case 8:
|
|
234
303
|
if (!(selectedFiles.length === 1)) {
|
|
235
|
-
|
|
304
|
+
_context4.next = 14;
|
|
236
305
|
break;
|
|
237
306
|
}
|
|
238
307
|
|
|
239
|
-
|
|
308
|
+
_context4.next = 11;
|
|
240
309
|
return getFilesToAdd(selectedFiles);
|
|
241
310
|
|
|
242
311
|
case 11:
|
|
243
|
-
|
|
244
|
-
|
|
312
|
+
_context4.t0 = _context4.sent;
|
|
313
|
+
_context4.next = 17;
|
|
245
314
|
break;
|
|
246
315
|
|
|
247
316
|
case 14:
|
|
248
|
-
|
|
317
|
+
_context4.next = 16;
|
|
249
318
|
return getFilesToAdd([selectedFiles[0]]);
|
|
250
319
|
|
|
251
320
|
case 16:
|
|
252
|
-
|
|
321
|
+
_context4.t0 = _context4.sent;
|
|
253
322
|
|
|
254
323
|
case 17:
|
|
255
|
-
fileToAdd =
|
|
324
|
+
fileToAdd = _context4.t0;
|
|
256
325
|
|
|
257
326
|
if (typeof callbackFile === "function") {
|
|
258
327
|
callbackFile(fileToAdd);
|
|
@@ -260,14 +329,14 @@ var DxcFileInput = function DxcFileInput(_ref) {
|
|
|
260
329
|
|
|
261
330
|
case 19:
|
|
262
331
|
case "end":
|
|
263
|
-
return
|
|
332
|
+
return _context4.stop();
|
|
264
333
|
}
|
|
265
334
|
}
|
|
266
|
-
},
|
|
335
|
+
}, _callee4);
|
|
267
336
|
}));
|
|
268
337
|
|
|
269
|
-
return function addFile(
|
|
270
|
-
return
|
|
338
|
+
return function addFile(_x3) {
|
|
339
|
+
return _ref5.apply(this, arguments);
|
|
271
340
|
};
|
|
272
341
|
}();
|
|
273
342
|
|