@carbon/react 1.3.0 → 1.4.0-rc.0

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 (35) hide show
  1. package/es/components/ComposedModal/next/ComposedModal.js +11 -11
  2. package/es/components/DatePicker/DatePicker.js +264 -334
  3. package/es/components/DatePickerInput/DatePickerInput.js +141 -168
  4. package/es/components/FileUploader/FileUploader.js +3 -3
  5. package/es/components/FileUploader/FileUploaderButton.js +4 -4
  6. package/es/components/FileUploader/FileUploaderDropContainer.js +3 -3
  7. package/es/components/IconButton/index.js +2 -2
  8. package/es/components/MultiSelect/FilterableMultiSelect.js +10 -0
  9. package/es/components/MultiSelect/next/FilterableMultiSelect.js +11 -0
  10. package/es/components/Slider/Slider.js +11 -0
  11. package/es/components/StructuredList/next/StructuredList.js +19 -3
  12. package/es/components/UIShell/SideNav.js +1 -1
  13. package/es/index.js +3 -3
  14. package/lib/components/ComposedModal/next/ComposedModal.js +11 -11
  15. package/lib/components/DatePicker/DatePicker.js +261 -331
  16. package/lib/components/DatePickerInput/DatePickerInput.js +138 -165
  17. package/lib/components/FileUploader/FileUploader.js +3 -3
  18. package/lib/components/FileUploader/FileUploaderButton.js +4 -4
  19. package/lib/components/FileUploader/FileUploaderDropContainer.js +3 -3
  20. package/lib/components/IconButton/index.js +1 -1
  21. package/lib/components/MultiSelect/FilterableMultiSelect.js +10 -0
  22. package/lib/components/MultiSelect/next/FilterableMultiSelect.js +11 -0
  23. package/lib/components/Slider/Slider.js +11 -0
  24. package/lib/components/StructuredList/next/StructuredList.js +19 -3
  25. package/lib/components/UIShell/SideNav.js +1 -1
  26. package/lib/index.js +100 -100
  27. package/package.json +3 -3
  28. package/es/components/DatePicker/index.js +0 -15
  29. package/es/components/DatePicker/next/DatePicker.js +0 -562
  30. package/es/components/DatePickerInput/index.js +0 -15
  31. package/es/components/DatePickerInput/next/DatePickerInput.js +0 -244
  32. package/lib/components/DatePicker/index.js +0 -39
  33. package/lib/components/DatePicker/next/DatePicker.js +0 -573
  34. package/lib/components/DatePickerInput/index.js +0 -39
  35. package/lib/components/DatePickerInput/next/DatePickerInput.js +0 -254
@@ -1,562 +0,0 @@
1
- /**
2
- * Copyright IBM Corp. 2016, 2022
3
- *
4
- * This source code is licensed under the Apache-2.0 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, typeof as _typeof, objectSpread2 as _objectSpread2, extends as _extends, toConsumableArray as _toConsumableArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
9
- import PropTypes from 'prop-types';
10
- import React__default, { useRef, useEffect } from 'react';
11
- import cx from 'classnames';
12
- import flatpickr from 'flatpickr';
13
- import l10n from '../../../node_modules/flatpickr/dist/l10n/index.js';
14
- import DatePickerInput from '../../DatePickerInput/index.js';
15
- import carbonFlatpickrAppendToPlugin from '../plugins/appendToPlugin.js';
16
- import carbonFlatpickrFixEventsPlugin from '../plugins/fixEventsPlugin.js';
17
- import carbonFlatpickrRangePlugin from '../plugins/rangePlugin.js';
18
- import { usePrefix } from '../../../internal/usePrefix.js';
19
- import { useSavedCallback } from '../../../internal/useSavedCallback.js';
20
- import { match } from '../../../internal/keyboard/match.js';
21
- import { ArrowDown } from '../../../internal/keyboard/keys.js';
22
-
23
- var _excluded = ["allowInput", "appendTo", "children", "className", "dateFormat", "datePickerType", "disable", "enable", "inline", "light", "locale", "maxDate", "minDate", "onChange", "onClose", "onOpen", "short", "value"];
24
-
25
- l10n.en.weekdays.shorthand.forEach(function (_day, index) {
26
- var currentDay = l10n.en.weekdays.shorthand;
27
-
28
- if (currentDay[index] === 'Thu' || currentDay[index] === 'Th') {
29
- currentDay[index] = 'Th';
30
- } else {
31
- currentDay[index] = currentDay[index].charAt(0);
32
- }
33
- });
34
- var forEach = Array.prototype.forEach;
35
- /**
36
- * @param {number} monthNumber The month number.
37
- * @param {boolean} shorthand `true` to use shorthand month.
38
- * @param {Locale} locale The Flatpickr locale data.
39
- * @returns {string} The month string.
40
- */
41
-
42
- var monthToStr = function monthToStr(monthNumber, shorthand, locale) {
43
- return locale.months[shorthand ? 'shorthand' : 'longhand'][monthNumber];
44
- };
45
- /**
46
- * @param {object} config Plugin configuration.
47
- * @param {boolean} [config.shorthand] `true` to use shorthand month.
48
- * @param {string} config.selectorFlatpickrMonthYearContainer The CSS selector for the container of month/year selection UI.
49
- * @param {string} config.selectorFlatpickrYearContainer The CSS selector for the container of year selection UI.
50
- * @param {string} config.selectorFlatpickrCurrentMonth The CSS selector for the text-based month selection UI.
51
- * @param {string} config.classFlatpickrCurrentMonth The CSS class for the text-based month selection UI.
52
- * @returns {Plugin} A Flatpickr plugin to use text instead of `<select>` for month picker.
53
- */
54
-
55
-
56
- var carbonFlatpickrMonthSelectPlugin = function carbonFlatpickrMonthSelectPlugin(config) {
57
- return function (fp) {
58
- var setupElements = function setupElements() {
59
- var _fp$monthElements;
60
-
61
- if (!fp.monthElements) {
62
- return;
63
- }
64
-
65
- fp.monthElements.forEach(function (elem) {
66
- if (!elem.parentNode) {
67
- return;
68
- }
69
-
70
- elem.parentNode.removeChild(elem);
71
- });
72
-
73
- (_fp$monthElements = fp.monthElements).splice.apply(_fp$monthElements, [0, fp.monthElements.length].concat(_toConsumableArray(fp.monthElements.map(function () {
74
- // eslint-disable-next-line no-underscore-dangle
75
- var monthElement = fp._createElement('span', config.classFlatpickrCurrentMonth);
76
-
77
- monthElement.textContent = monthToStr(fp.currentMonth, config.shorthand === true, fp.l10n);
78
- fp.yearElements[0].closest(config.selectorFlatpickrMonthYearContainer).insertBefore(monthElement, fp.yearElements[0].closest(config.selectorFlatpickrYearContainer));
79
- return monthElement;
80
- }))));
81
- };
82
-
83
- var updateCurrentMonth = function updateCurrentMonth() {
84
- var monthStr = monthToStr(fp.currentMonth, config.shorthand === true, fp.l10n);
85
- fp.yearElements.forEach(function (elem) {
86
- var currentMonthContainer = elem.closest(config.selectorFlatpickrMonthYearContainer);
87
- Array.prototype.forEach.call(currentMonthContainer.querySelectorAll('.cur-month'), function (monthElement) {
88
- monthElement.textContent = monthStr;
89
- });
90
- });
91
- };
92
-
93
- var register = function register() {
94
- fp.loadedPlugins.push('carbonFlatpickrMonthSelectPlugin');
95
- };
96
-
97
- return {
98
- onMonthChange: updateCurrentMonth,
99
- onValueUpdate: updateCurrentMonth,
100
- onOpen: updateCurrentMonth,
101
- onReady: [setupElements, updateCurrentMonth, register]
102
- };
103
- };
104
- };
105
- /**
106
- * Determine if every child in a list of children has no label specified
107
- * @param {Array<ReactElement>} children
108
- * @returns {boolean}
109
- */
110
-
111
-
112
- function isLabelTextEmpty(children) {
113
- return children.every(function (child) {
114
- return !child.props.labelText;
115
- });
116
- }
117
-
118
- var rightArrowHTML = "<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\n <polygon points=\"11,8 6,13 5.3,12.3 9.6,8 5.3,3.7 6,3 \"/>\n <rect width=\"16\" height=\"16\" style=\"fill:none\" />\n</svg>";
119
- var leftArrowHTML = "<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\n <polygon points=\"5,8 10,3 10.7,3.7 6.4,8 10.7,12.3 10,13 \"/>\n <rect width=\"16\" height=\"16\" style=\"fill:none\" />\n</svg>";
120
-
121
- function updateClassNames(calendar, prefix) {
122
- var calendarContainer = calendar.calendarContainer;
123
- var daysContainer = calendar.days;
124
-
125
- if (calendarContainer && daysContainer) {
126
- // calendarContainer and daysContainer are undefined if flatpickr detects a mobile device
127
- calendarContainer.classList.add("".concat(prefix, "--date-picker__calendar"));
128
- calendarContainer.querySelector('.flatpickr-month').classList.add("".concat(prefix, "--date-picker__month"));
129
- calendarContainer.querySelector('.flatpickr-weekdays').classList.add("".concat(prefix, "--date-picker__weekdays"));
130
- calendarContainer.querySelector('.flatpickr-days').classList.add("".concat(prefix, "--date-picker__days"));
131
- forEach.call(calendarContainer.querySelectorAll('.flatpickr-weekday'), function (item) {
132
- var currentItem = item;
133
- currentItem.innerHTML = currentItem.innerHTML.replace(/\s+/g, '');
134
- currentItem.classList.add("".concat(prefix, "--date-picker__weekday"));
135
- });
136
- forEach.call(daysContainer.querySelectorAll('.flatpickr-day'), function (item) {
137
- item.classList.add("".concat(prefix, "--date-picker__day"));
138
-
139
- if (item.classList.contains('today') && calendar.selectedDates.length > 0) {
140
- item.classList.add('no-border');
141
- } else if (item.classList.contains('today') && calendar.selectedDates.length === 0) {
142
- item.classList.remove('no-border');
143
- }
144
- });
145
- }
146
- }
147
-
148
- function DatePicker(_ref) {
149
- var _cx;
150
-
151
- var allowInput = _ref.allowInput,
152
- appendTo = _ref.appendTo,
153
- children = _ref.children,
154
- className = _ref.className,
155
- _ref$dateFormat = _ref.dateFormat,
156
- dateFormat = _ref$dateFormat === void 0 ? 'm/d/Y' : _ref$dateFormat,
157
- datePickerType = _ref.datePickerType,
158
- disable = _ref.disable,
159
- enable = _ref.enable,
160
- inline = _ref.inline,
161
- _ref$light = _ref.light,
162
- light = _ref$light === void 0 ? false : _ref$light,
163
- _ref$locale = _ref.locale,
164
- locale = _ref$locale === void 0 ? 'en' : _ref$locale,
165
- maxDate = _ref.maxDate,
166
- minDate = _ref.minDate,
167
- onChange = _ref.onChange,
168
- onClose = _ref.onClose,
169
- onOpen = _ref.onOpen,
170
- _ref$short = _ref.short,
171
- short = _ref$short === void 0 ? false : _ref$short,
172
- value = _ref.value,
173
- rest = _objectWithoutProperties(_ref, _excluded);
174
-
175
- var prefix = usePrefix();
176
- var startInputField = useRef(null);
177
- var endInputField = useRef(null);
178
- var calendarRef = useRef(null);
179
- var savedOnChange = useSavedCallback(onChange);
180
- var savedOnClose = useSavedCallback(onClose);
181
- var savedOnOpen = useSavedCallback(onOpen);
182
- var datePickerClasses = cx("".concat(prefix, "--date-picker"), (_cx = {}, _defineProperty(_cx, "".concat(prefix, "--date-picker--short"), short), _defineProperty(_cx, "".concat(prefix, "--date-picker--light"), light), _defineProperty(_cx, "".concat(prefix, "--date-picker--simple"), datePickerType === 'simple'), _defineProperty(_cx, "".concat(prefix, "--date-picker--single"), datePickerType === 'single'), _defineProperty(_cx, "".concat(prefix, "--date-picker--range"), datePickerType === 'range'), _defineProperty(_cx, "".concat(prefix, "--date-picker--nolabel"), datePickerType === 'range' && isLabelTextEmpty(children)), _cx));
183
- var wrapperClasses = cx("".concat(prefix, "--form-item"), _defineProperty({}, className, className));
184
- var childrenWithProps = React__default.Children.toArray(children).map(function (child, index) {
185
- if (index === 0 && child.type === React__default.createElement(DatePickerInput, child.props).type) {
186
- return /*#__PURE__*/React__default.cloneElement(child, {
187
- datePickerType: datePickerType,
188
- ref: startInputField,
189
- openCalendar: function openCalendar() {
190
- if (calendarRef.current) {
191
- calendarRef.current.open();
192
- }
193
- }
194
- });
195
- }
196
-
197
- if (index === 1 && child.type === React__default.createElement(DatePickerInput, child.props).type) {
198
- return /*#__PURE__*/React__default.cloneElement(child, {
199
- datePickerType: datePickerType,
200
- ref: endInputField,
201
- openCalendar: function openCalendar() {
202
- if (calendarRef.current) {
203
- calendarRef.current.open();
204
- }
205
- }
206
- });
207
- }
208
-
209
- if (index === 0) {
210
- return /*#__PURE__*/React__default.cloneElement(child, {
211
- ref: startInputField
212
- });
213
- }
214
-
215
- if (index === 1) {
216
- return /*#__PURE__*/React__default.cloneElement(child, {
217
- ref: endInputField
218
- });
219
- }
220
- });
221
- useEffect(function () {
222
- var _flatpickr;
223
-
224
- if (datePickerType !== 'single' && datePickerType !== 'range') {
225
- return;
226
- }
227
-
228
- if (startInputField.current === null) {
229
- return;
230
- }
231
-
232
- var onHook = function onHook(_electedDates, _dateStr, instance, prefix) {
233
- updateClassNames(instance, prefix);
234
- }; // Logic to determine if `enable` or `disable` will be passed down. If neither
235
- // is provided, we return the default empty disabled array, allowing all dates.
236
-
237
-
238
- var enableOrDisable = enable ? 'enable' : 'disable';
239
- var enableOrDisableArr;
240
-
241
- if (!enable && !disable) {
242
- enableOrDisableArr = [];
243
- } else if (enable) {
244
- enableOrDisableArr = enable;
245
- } else {
246
- enableOrDisableArr = disable;
247
- }
248
-
249
- var localeData;
250
-
251
- if (_typeof(locale) === 'object') {
252
- var location = locale.locale ? locale.locale : 'en';
253
- localeData = _objectSpread2(_objectSpread2({}, l10n[location]), locale);
254
- } else {
255
- localeData = l10n[locale];
256
- }
257
-
258
- var start = startInputField.current;
259
- var end = endInputField.current;
260
- var calendar = new flatpickr(start, (_flatpickr = {
261
- inline: inline !== null && inline !== void 0 ? inline : false,
262
- disableMobile: true,
263
- defaultDate: value,
264
- mode: datePickerType,
265
- allowInput: allowInput !== null && allowInput !== void 0 ? allowInput : true,
266
- dateFormat: dateFormat,
267
- locale: localeData
268
- }, _defineProperty(_flatpickr, enableOrDisable, enableOrDisableArr), _defineProperty(_flatpickr, "minDate", minDate), _defineProperty(_flatpickr, "maxDate", maxDate), _defineProperty(_flatpickr, "plugins", [datePickerType === 'range' ? new carbonFlatpickrRangePlugin({
269
- input: endInputField.current
270
- }) : function () {}, appendTo ? carbonFlatpickrAppendToPlugin({
271
- appendTo: appendTo
272
- }) : function () {}, carbonFlatpickrMonthSelectPlugin({
273
- selectorFlatpickrMonthYearContainer: '.flatpickr-current-month',
274
- selectorFlatpickrYearContainer: '.numInputWrapper',
275
- selectorFlatpickrCurrentMonth: '.cur-month',
276
- classFlatpickrCurrentMonth: 'cur-month'
277
- }), carbonFlatpickrFixEventsPlugin({
278
- inputFrom: startInputField.current,
279
- inputTo: endInputField.current
280
- })]), _defineProperty(_flatpickr, "clickOpens", true), _defineProperty(_flatpickr, "nextArrow", rightArrowHTML), _defineProperty(_flatpickr, "prevArrow", leftArrowHTML), _defineProperty(_flatpickr, "onChange", function onChange() {
281
- if (savedOnChange) {
282
- savedOnChange.apply(void 0, arguments);
283
- }
284
- }), _defineProperty(_flatpickr, "onClose", savedOnClose), _defineProperty(_flatpickr, "onReady", onHook), _defineProperty(_flatpickr, "onMonthChange", onHook), _defineProperty(_flatpickr, "onYearChange", onHook), _defineProperty(_flatpickr, "onOpen", function onOpen() {
285
- onHook.apply(void 0, arguments);
286
- savedOnOpen.apply(void 0, arguments);
287
- }), _defineProperty(_flatpickr, "onValueUpdate", onHook), _flatpickr));
288
- calendarRef.current = calendar;
289
-
290
- function handleArrowDown(event) {
291
- if (match(event, ArrowDown)) {
292
- var calendarContainer = calendar.calendarContainer,
293
- fpSelectedDateElem = calendar.selectedDateElem,
294
- fptodayDateElem = calendar.todayDateElem;
295
- var selectedDateElem = calendarContainer.querySelector('.selected') && fpSelectedDateElem;
296
- var todayDateElem = calendarContainer.querySelector('.today') && fptodayDateElem;
297
- (selectedDateElem || todayDateElem || calendarContainer.querySelector('.flatpickr-day[tabindex]') || calendarContainer).focus();
298
- }
299
- }
300
-
301
- function handleOnChange() {
302
- if (start.value !== '') {
303
- return;
304
- }
305
-
306
- if (!calendar.selectedDates) {
307
- return;
308
- }
309
-
310
- if (calendar.selectedDates.length === 0) {
311
- return;
312
- }
313
-
314
- calendar.clear();
315
- calendar.input.focus();
316
- }
317
-
318
- if (start) {
319
- start.addEventListener('keydown', handleArrowDown);
320
- start.addEventListener('change', handleOnChange); // Flatpickr's calendar dialog is not rendered in a landmark causing an
321
- // error with IBM Equal Access Accessibility Checker so we add an aria
322
- // role to the container div.
323
-
324
- calendar.calendarContainer.setAttribute('role', 'region'); // IBM EAAC requires an aria-label on a role='region'
325
-
326
- calendar.calendarContainer.setAttribute('aria-label', 'calendar-container');
327
- }
328
-
329
- if (end) {
330
- end.addEventListener('keydown', handleArrowDown);
331
- end.addEventListener('change', handleOnChange);
332
- } //component did unmount equivalent
333
-
334
-
335
- return function () {
336
- // Note: if the `startInputField` ref is undefined then calendar will be
337
- // of type: Array and `destroy` will not be defined
338
- if (calendar && calendar.destroy) {
339
- calendar.destroy();
340
- }
341
-
342
- if (start) {
343
- start.removeEventListener('keydown', handleArrowDown);
344
- start.removeEventListener('change', handleOnChange);
345
- }
346
-
347
- if (end) {
348
- end.removeEventListener('keydown', handleArrowDown);
349
- end.removeEventListener('change', handleOnChange);
350
- }
351
- };
352
- }, [savedOnChange, savedOnClose, savedOnOpen]); //eslint-disable-line react-hooks/exhaustive-deps
353
-
354
- useEffect(function () {
355
- if (calendarRef.current) {
356
- calendarRef.current.set({
357
- dateFormat: dateFormat
358
- });
359
- }
360
- }, [dateFormat]);
361
- useEffect(function () {
362
- if (calendarRef.current && minDate) {
363
- calendarRef.current.set('minDate', minDate);
364
- }
365
- }, [minDate]);
366
- useEffect(function () {
367
- if (calendarRef.current && maxDate) {
368
- calendarRef.current.set('maxDate', maxDate);
369
- }
370
- }, [maxDate]);
371
- useEffect(function () {
372
- if (calendarRef.current && disable) {
373
- calendarRef.current.set('disbale', disable);
374
- }
375
- }, [disable]);
376
- useEffect(function () {
377
- if (calendarRef.current && enable) {
378
- calendarRef.current.set('enable', enable);
379
- }
380
- }, [enable]);
381
- useEffect(function () {
382
- if (calendarRef.current && inline) {
383
- calendarRef.current.set('inline', inline);
384
- }
385
- }, [inline]);
386
- useEffect(function () {
387
- if (calendarRef.current) {
388
- calendarRef.current.set({
389
- value: value
390
- });
391
- updateClassNames(calendarRef.current, prefix); //for simple date picker w/o calendar; initial mount may not have value
392
- } else if (!calendarRef.current && value) {
393
- startInputField.current.value = value;
394
- }
395
- }, [value, prefix]);
396
- return /*#__PURE__*/React__default.createElement("div", _extends({
397
- className: wrapperClasses
398
- }, rest), /*#__PURE__*/React__default.createElement("div", {
399
- className: datePickerClasses
400
- }, childrenWithProps));
401
- }
402
-
403
- DatePicker.propTypes = {
404
- /**
405
- * flatpickr prop passthrough. Allows the user to enter a date directly
406
- * into the input field
407
- */
408
- allowInput: PropTypes.bool,
409
-
410
- /**
411
- * The DOM element the Flatpicker should be inserted into. `<body>` by default.
412
- */
413
- appendTo: PropTypes.object,
414
-
415
- /**
416
- * The child nodes.
417
- */
418
- children: PropTypes.node,
419
-
420
- /**
421
- * The CSS class names.
422
- */
423
- className: PropTypes.string,
424
-
425
- /**
426
- * The date format.
427
- */
428
- dateFormat: PropTypes.string,
429
-
430
- /**
431
- * The type of the date picker:
432
- *
433
- * * `simple` - Without calendar dropdown.
434
- * * `single` - With calendar dropdown and single date.
435
- * * `range` - With calendar dropdown and a date range.
436
- */
437
- datePickerType: PropTypes.oneOf(['simple', 'single', 'range']),
438
-
439
- /**
440
- * The flatpickr `disable` option that allows a user to disable certain dates.
441
- */
442
- disable: PropTypes.array,
443
-
444
- /**
445
- * The flatpickr `enable` option that allows a user to enable certain dates.
446
- */
447
- enable: PropTypes.array,
448
-
449
- /**
450
- * The flatpickr `inline` option.
451
- */
452
- inline: PropTypes.bool,
453
-
454
- /**
455
- * `true` to use the light version.
456
- */
457
- light: PropTypes.bool,
458
-
459
- /**
460
- * The language locale used to format the days of the week, months, and numbers. The full list of supported locales can be found here https://github.com/flatpickr/flatpickr/tree/master/src/l10n
461
- */
462
- locale: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf(['ar', // Arabic
463
- 'at', // Austria
464
- 'az', // Azerbaijan
465
- 'be', // Belarusian
466
- 'bg', // Bulgarian
467
- 'bn', // Bangla
468
- 'bs', // Bosnia
469
- 'cat', // Catalan
470
- 'cs', // Czech
471
- 'cy', // Welsh
472
- 'da', // Danish
473
- 'de', // German
474
- 'en', // English
475
- 'eo', // Esperanto
476
- 'es', // Spanish
477
- 'et', // Estonian
478
- 'fa', // Persian
479
- 'fi', // Finnish
480
- 'fo', // Faroese
481
- 'fr', // French
482
- 'ga', // Gaelic
483
- 'gr', // Greek
484
- 'he', // Hebrew
485
- 'hi', // Hindi
486
- 'hr', // Croatian
487
- 'hu', // Hungarian
488
- 'id', // Indonesian
489
- 'is', // Icelandic
490
- 'it', // Italian
491
- 'ja', // Japanese
492
- 'ka', // Georgian
493
- 'km', // Khmer
494
- 'ko', // Korean
495
- 'kz', // Kazakh
496
- 'lt', // Lithuanian
497
- 'lv', // Latvian
498
- 'mk', // Macedonian
499
- 'mn', // Mongolian
500
- 'ms', // Malaysian
501
- 'my', // Burmese
502
- 'nl', // Dutch
503
- 'no', // Norwegian
504
- 'pa', // Punjabi
505
- 'pl', // Polish
506
- 'pt', // Portuguese
507
- 'ro', // Romanian
508
- 'ru', // Russian
509
- 'si', // Sinhala
510
- 'sk', // Slovak
511
- 'sl', // Slovenian
512
- 'sq', // Albanian
513
- 'sr', // Serbian
514
- 'sv', // Swedish
515
- 'th', // Thai
516
- 'tr', // Turkish
517
- 'uk', // Ukrainian
518
- 'uz', // Uzbek
519
- 'uz_latn', // Uzbek Latin
520
- 'vn', // Vietnamese
521
- 'zh_tw', // Mandarin Traditional
522
- 'zh' // Mandarin
523
- ])]),
524
-
525
- /**
526
- * The maximum date that a user can pick to.
527
- */
528
- maxDate: PropTypes.string,
529
-
530
- /**
531
- * The minimum date that a user can start picking from.
532
- */
533
- minDate: PropTypes.string,
534
-
535
- /**
536
- * The `change` event handler.
537
- */
538
- onChange: PropTypes.func,
539
-
540
- /**
541
- * The `close` event handler.
542
- */
543
- onClose: PropTypes.func,
544
-
545
- /**
546
- * The `open` event handler.
547
- */
548
- onOpen: PropTypes.func,
549
-
550
- /**
551
- * `true` to use the short version.
552
- */
553
- short: PropTypes.bool,
554
-
555
- /**
556
- * The value of the date value provided to flatpickr, could
557
- * be a date, a date number, a date string, an array of dates.
558
- */
559
- value: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object])), PropTypes.object, PropTypes.number])
560
- };
561
-
562
- export { DatePicker as default };
@@ -1,15 +0,0 @@
1
- /**
2
- * Copyright IBM Corp. 2016, 2022
3
- *
4
- * This source code is licensed under the Apache-2.0 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- import * as FeatureFlags from '@carbon/feature-flags';
9
- import DatePickerInputNext from './next/DatePickerInput.js';
10
- import DatePickerInput$2 from './DatePickerInput.js';
11
-
12
- var DatePickerInput = FeatureFlags.enabled('enable-v11-release') ? DatePickerInputNext : DatePickerInput$2;
13
- var DatePickerInput$1 = DatePickerInput;
14
-
15
- export { DatePickerInput$1 as default };