@7shifts/sous-chef 3.35.0 → 3.36.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.
- package/dist/core/SousChefProvider/SousChefProvider.d.ts +3 -1
- package/dist/i18n/TranslationsContext.d.ts +7 -0
- package/dist/i18n/locales/en.json +37 -0
- package/dist/i18n/locales/es.json +37 -0
- package/dist/i18n/locales/fr.json +37 -0
- package/dist/i18n/types.d.ts +3 -0
- package/dist/i18n/useTranslation.d.ts +2 -0
- package/dist/index.js +115 -61
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +111 -57
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/date.d.ts +9 -2
- package/package.json +1 -1
- package/dist/utils/i18n.d.ts +0 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import en from '../../i18n/locales/en.json';
|
|
2
3
|
type Props = {
|
|
4
|
+
i18n?: typeof en;
|
|
3
5
|
children: React.ReactNode;
|
|
4
6
|
};
|
|
5
|
-
declare const SousChefProvider: ({ children }: Props) => React.JSX.Element;
|
|
7
|
+
declare const SousChefProvider: ({ children, i18n }: Props) => React.JSX.Element;
|
|
6
8
|
export default SousChefProvider;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"PaginationControls": {
|
|
3
|
+
"previousButton": "Previous",
|
|
4
|
+
"nextButton": "Next"
|
|
5
|
+
},
|
|
6
|
+
"AsyncSelectField": {
|
|
7
|
+
"moreOptionsPlaceholder": "Start typing to see more options"
|
|
8
|
+
},
|
|
9
|
+
"SelectField": {
|
|
10
|
+
"createOption": "Create option",
|
|
11
|
+
"createButton": "Create"
|
|
12
|
+
},
|
|
13
|
+
"HintModal": {
|
|
14
|
+
"dontShowAgainLabel": "Don’t show this again"
|
|
15
|
+
},
|
|
16
|
+
"Calendar": {
|
|
17
|
+
"sunday": "Sunday",
|
|
18
|
+
"monday": "Monday",
|
|
19
|
+
"tuesday": "Tuesday",
|
|
20
|
+
"wednesday": "Wednesday",
|
|
21
|
+
"thursday": "Thursday",
|
|
22
|
+
"friday": "Friday",
|
|
23
|
+
"saturday": "Saturday",
|
|
24
|
+
"january": "January",
|
|
25
|
+
"february": "February",
|
|
26
|
+
"march": "March",
|
|
27
|
+
"april": "April",
|
|
28
|
+
"may": "May",
|
|
29
|
+
"june": "June",
|
|
30
|
+
"july": "July",
|
|
31
|
+
"august": "August",
|
|
32
|
+
"september": "September",
|
|
33
|
+
"october": "October",
|
|
34
|
+
"november": "November",
|
|
35
|
+
"december": "December"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"PaginationControls": {
|
|
3
|
+
"previousButton": "Anterior",
|
|
4
|
+
"nextButton": "Siguiente"
|
|
5
|
+
},
|
|
6
|
+
"AsyncSelectField": {
|
|
7
|
+
"moreOptionsPlaceholder": "Empieza a escribir para ver más opciones"
|
|
8
|
+
},
|
|
9
|
+
"SelectField": {
|
|
10
|
+
"createOption": "Crear opción",
|
|
11
|
+
"createButton": "Crear"
|
|
12
|
+
},
|
|
13
|
+
"HintModal": {
|
|
14
|
+
"dontShowAgainLabel": "No mostrar esto otra vez"
|
|
15
|
+
},
|
|
16
|
+
"Calendar": {
|
|
17
|
+
"sunday": "Domingo",
|
|
18
|
+
"monday": "Lunes",
|
|
19
|
+
"tuesday": "Martes",
|
|
20
|
+
"wednesday": "Miércoles",
|
|
21
|
+
"thursday": "Jueves",
|
|
22
|
+
"friday": "Viernes",
|
|
23
|
+
"saturday": "Sábado",
|
|
24
|
+
"january": "Enero",
|
|
25
|
+
"february": "Febrero",
|
|
26
|
+
"march": "Marzo",
|
|
27
|
+
"april": "Abril",
|
|
28
|
+
"may": "Mayo",
|
|
29
|
+
"june": "Junio",
|
|
30
|
+
"july": "Julio",
|
|
31
|
+
"august": "Agosto",
|
|
32
|
+
"september": "Septiembre",
|
|
33
|
+
"october": "Octubre",
|
|
34
|
+
"november": "Noviembre",
|
|
35
|
+
"december": "Diciembre"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"PaginationControls": {
|
|
3
|
+
"previousButton": "Précédent",
|
|
4
|
+
"nextButton": "Suivant"
|
|
5
|
+
},
|
|
6
|
+
"AsyncSelectField": {
|
|
7
|
+
"moreOptionsPlaceholder": "Commencez à taper pour voir plus d’options"
|
|
8
|
+
},
|
|
9
|
+
"SelectField": {
|
|
10
|
+
"createOption": "Créer une option",
|
|
11
|
+
"createButton": "Créer"
|
|
12
|
+
},
|
|
13
|
+
"HintModal": {
|
|
14
|
+
"dontShowAgainLabel": "Ne plus afficher ce message"
|
|
15
|
+
},
|
|
16
|
+
"Calendar": {
|
|
17
|
+
"sunday": "Dimanche",
|
|
18
|
+
"monday": "Lundi",
|
|
19
|
+
"tuesday": "Mardi",
|
|
20
|
+
"wednesday": "Mercredi",
|
|
21
|
+
"thursday": "Jeudi",
|
|
22
|
+
"friday": "Vendredi",
|
|
23
|
+
"saturday": "Samedi",
|
|
24
|
+
"january": "Janvier",
|
|
25
|
+
"february": "Février",
|
|
26
|
+
"march": "Mars",
|
|
27
|
+
"april": "Avril",
|
|
28
|
+
"may": "Mai",
|
|
29
|
+
"june": "Juin",
|
|
30
|
+
"july": "Juillet",
|
|
31
|
+
"august": "Août",
|
|
32
|
+
"september": "Septembre",
|
|
33
|
+
"october": "Octobre",
|
|
34
|
+
"november": "Novembre",
|
|
35
|
+
"december": "Décembre"
|
|
36
|
+
}
|
|
37
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -4216,34 +4216,6 @@ IconWrench.displayName = 'IconWrench';
|
|
|
4216
4216
|
|
|
4217
4217
|
var styles$6 = {"pagination-controls":"_SMSPF"};
|
|
4218
4218
|
|
|
4219
|
-
var getLocalizedString = function getLocalizedString(key) {
|
|
4220
|
-
if (!window.Shifts) {
|
|
4221
|
-
return getLocalTranslation(key);
|
|
4222
|
-
}
|
|
4223
|
-
return getWebAppTranslation(key);
|
|
4224
|
-
};
|
|
4225
|
-
var getWebAppTranslation = function getWebAppTranslation(key) {
|
|
4226
|
-
var _Shifts, _Shifts$Lang;
|
|
4227
|
-
if (!Shifts || ((_Shifts = Shifts) === null || _Shifts === void 0 ? void 0 : (_Shifts$Lang = _Shifts.Lang) === null || _Shifts$Lang === void 0 ? void 0 : _Shifts$Lang.cache) === undefined) {
|
|
4228
|
-
return getLocalTranslation(key);
|
|
4229
|
-
}
|
|
4230
|
-
var _key$split = key.split('.'),
|
|
4231
|
-
moduleName = _key$split[0],
|
|
4232
|
-
id = _key$split[1];
|
|
4233
|
-
if (Shifts.Lang.cache === undefined || Shifts.Lang.cache[moduleName] === undefined || Shifts.Lang.cache[moduleName][id] === undefined) {
|
|
4234
|
-
return key;
|
|
4235
|
-
}
|
|
4236
|
-
return Shifts.Lang.cache[moduleName][id];
|
|
4237
|
-
};
|
|
4238
|
-
var getLocalTranslation = function getLocalTranslation(key) {
|
|
4239
|
-
var translationParts = key.split('.');
|
|
4240
|
-
if (translationParts.length > 1) {
|
|
4241
|
-
var literal = translationParts[1];
|
|
4242
|
-
return literal.charAt(0).toUpperCase() + literal.slice(1).toLowerCase().replace(/_/g, ' ');
|
|
4243
|
-
}
|
|
4244
|
-
return key;
|
|
4245
|
-
};
|
|
4246
|
-
|
|
4247
4219
|
var styles$7 = {"keyboard-key":"_14Od2","keyboard-key--light":"_3hU2t","keyboard-key__character":"_31UYJ"};
|
|
4248
4220
|
|
|
4249
4221
|
var KeyboardKey = function KeyboardKey(_ref) {
|
|
@@ -4289,8 +4261,75 @@ var isFocusingEditableElement = function isFocusingEditableElement() {
|
|
|
4289
4261
|
return false;
|
|
4290
4262
|
};
|
|
4291
4263
|
|
|
4264
|
+
var PaginationControls = {
|
|
4265
|
+
previousButton: "Previous",
|
|
4266
|
+
nextButton: "Next"
|
|
4267
|
+
};
|
|
4268
|
+
var AsyncSelectField = {
|
|
4269
|
+
moreOptionsPlaceholder: "Start typing to see more options"
|
|
4270
|
+
};
|
|
4271
|
+
var SelectField = {
|
|
4272
|
+
createOption: "Create option",
|
|
4273
|
+
createButton: "Create"
|
|
4274
|
+
};
|
|
4275
|
+
var HintModal = {
|
|
4276
|
+
dontShowAgainLabel: "Don’t show this again"
|
|
4277
|
+
};
|
|
4278
|
+
var Calendar = {
|
|
4279
|
+
sunday: "Sunday",
|
|
4280
|
+
monday: "Monday",
|
|
4281
|
+
tuesday: "Tuesday",
|
|
4282
|
+
wednesday: "Wednesday",
|
|
4283
|
+
thursday: "Thursday",
|
|
4284
|
+
friday: "Friday",
|
|
4285
|
+
saturday: "Saturday",
|
|
4286
|
+
january: "January",
|
|
4287
|
+
february: "February",
|
|
4288
|
+
march: "March",
|
|
4289
|
+
april: "April",
|
|
4290
|
+
may: "May",
|
|
4291
|
+
june: "June",
|
|
4292
|
+
july: "July",
|
|
4293
|
+
august: "August",
|
|
4294
|
+
september: "September",
|
|
4295
|
+
october: "October",
|
|
4296
|
+
november: "November",
|
|
4297
|
+
december: "December"
|
|
4298
|
+
};
|
|
4299
|
+
var en = {
|
|
4300
|
+
PaginationControls: PaginationControls,
|
|
4301
|
+
AsyncSelectField: AsyncSelectField,
|
|
4302
|
+
SelectField: SelectField,
|
|
4303
|
+
HintModal: HintModal,
|
|
4304
|
+
Calendar: Calendar
|
|
4305
|
+
};
|
|
4306
|
+
|
|
4307
|
+
var initialValue = {
|
|
4308
|
+
i18n: en
|
|
4309
|
+
};
|
|
4310
|
+
var TranslationsContext = React.createContext(initialValue);
|
|
4311
|
+
|
|
4312
|
+
var useTranslation = function useTranslation(context) {
|
|
4313
|
+
var _useContext = React.useContext(TranslationsContext),
|
|
4314
|
+
i18n = _useContext.i18n;
|
|
4315
|
+
var translate = function translate(key) {
|
|
4316
|
+
var keys = key.includes('.') ? key.split('.') : [key];
|
|
4317
|
+
if (context) {
|
|
4318
|
+
keys.unshift(context);
|
|
4319
|
+
}
|
|
4320
|
+
var translation = keys.reduce(function (acc, key) {
|
|
4321
|
+
if (typeof acc === 'string') {
|
|
4322
|
+
return acc;
|
|
4323
|
+
}
|
|
4324
|
+
return acc.hasOwnProperty(key) ? acc[key] : '';
|
|
4325
|
+
}, i18n);
|
|
4326
|
+
return typeof translation === 'string' && translation !== '' ? translation : keys.join('.');
|
|
4327
|
+
};
|
|
4328
|
+
return translate;
|
|
4329
|
+
};
|
|
4330
|
+
|
|
4292
4331
|
var _excluded$2n = ["hasPrevious", "hasNext", "onPreviousClick", "onNextClick", "testId", "scrollTarget"];
|
|
4293
|
-
var PaginationControls = function PaginationControls(_ref) {
|
|
4332
|
+
var PaginationControls$1 = function PaginationControls(_ref) {
|
|
4294
4333
|
var _ref$hasPrevious = _ref.hasPrevious,
|
|
4295
4334
|
hasPrevious = _ref$hasPrevious === void 0 ? true : _ref$hasPrevious,
|
|
4296
4335
|
_ref$hasNext = _ref.hasNext,
|
|
@@ -4300,6 +4339,7 @@ var PaginationControls = function PaginationControls(_ref) {
|
|
|
4300
4339
|
testId = _ref.testId,
|
|
4301
4340
|
scrollTarget = _ref.scrollTarget,
|
|
4302
4341
|
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2n);
|
|
4342
|
+
var __ = useTranslation('PaginationControls');
|
|
4303
4343
|
var _getDataProps = getDataProps(otherProps),
|
|
4304
4344
|
dataProps = _getDataProps.dataProps;
|
|
4305
4345
|
var scrollToTop = function scrollToTop() {
|
|
@@ -4339,7 +4379,7 @@ var PaginationControls = function PaginationControls(_ref) {
|
|
|
4339
4379
|
}), React__default.createElement(Button$1, {
|
|
4340
4380
|
disabled: !hasPrevious,
|
|
4341
4381
|
onClick: handlePreviousClick,
|
|
4342
|
-
title: React__default.createElement(React__default.Fragment, null, capitalizeFirstLetter(
|
|
4382
|
+
title: React__default.createElement(React__default.Fragment, null, capitalizeFirstLetter(__('previousButton')), "\xA0\xA0", React__default.createElement(KeyboardKey, {
|
|
4343
4383
|
theme: "light"
|
|
4344
4384
|
}, SHORTCUTS.PREVIOUS.toLocaleUpperCase()))
|
|
4345
4385
|
}, React__default.createElement(IconArrowLeft, {
|
|
@@ -4347,7 +4387,7 @@ var PaginationControls = function PaginationControls(_ref) {
|
|
|
4347
4387
|
})), React__default.createElement(Button$1, {
|
|
4348
4388
|
disabled: !hasNext,
|
|
4349
4389
|
onClick: handleNextClick,
|
|
4350
|
-
title: React__default.createElement(React__default.Fragment, null, capitalizeFirstLetter(
|
|
4390
|
+
title: React__default.createElement(React__default.Fragment, null, capitalizeFirstLetter(__('nextButton')), "\xA0\xA0", React__default.createElement(KeyboardKey, {
|
|
4351
4391
|
theme: "light"
|
|
4352
4392
|
}, SHORTCUTS.NEXT.toLocaleUpperCase()))
|
|
4353
4393
|
}, React__default.createElement(IconArrowRight, {
|
|
@@ -4431,8 +4471,14 @@ var ToastContainer = function ToastContainer(_ref2) {
|
|
|
4431
4471
|
};
|
|
4432
4472
|
|
|
4433
4473
|
var SousChefProvider = function SousChefProvider(_ref) {
|
|
4434
|
-
var children = _ref.children
|
|
4435
|
-
|
|
4474
|
+
var children = _ref.children,
|
|
4475
|
+
_ref$i18n = _ref.i18n,
|
|
4476
|
+
i18n = _ref$i18n === void 0 ? en : _ref$i18n;
|
|
4477
|
+
return React__default.createElement(TranslationsContext.Provider, {
|
|
4478
|
+
value: {
|
|
4479
|
+
i18n: i18n
|
|
4480
|
+
}
|
|
4481
|
+
}, React__default.createElement(ToastContainer, null), children);
|
|
4436
4482
|
};
|
|
4437
4483
|
|
|
4438
4484
|
var styles$a = {"data-table-header":"_1vpCK","data-table-header__item":"_dJWps","data-table-header__item--sortable":"_14AEw","data-table-header__itemfocus":"_2JSFR","data-table-header__item--action":"_29TM7","data-table-header__item-content":"_2Zpt5","data-table-header__item-content--right-align":"_3WtwH","data-table-header__sort-icon":"_3codU"};
|
|
@@ -4591,12 +4637,12 @@ var DATA_TABLE_SCROLL_STATES = {
|
|
|
4591
4637
|
};
|
|
4592
4638
|
var AMOUNT_OF_SKELETON_ROWS = 10;
|
|
4593
4639
|
|
|
4594
|
-
var initialValue = {
|
|
4640
|
+
var initialValue$1 = {
|
|
4595
4641
|
columns: [],
|
|
4596
4642
|
numberOfRows: 0,
|
|
4597
4643
|
state: DATA_TABLE_STATES.SKELETON_LOADING
|
|
4598
4644
|
};
|
|
4599
|
-
var Context = React.createContext(initialValue);
|
|
4645
|
+
var Context = React.createContext(initialValue$1);
|
|
4600
4646
|
var useDataTableContext = function useDataTableContext() {
|
|
4601
4647
|
var context = React.useContext(Context);
|
|
4602
4648
|
if (!context) {
|
|
@@ -6426,12 +6472,12 @@ function createWeekRange(date, weekStart) {
|
|
|
6426
6472
|
end: getEndOfWeek(date, weekStart)
|
|
6427
6473
|
};
|
|
6428
6474
|
}
|
|
6429
|
-
var getDays = function getDays() {
|
|
6430
|
-
var DAYS = [
|
|
6475
|
+
var getDays = function getDays(translate) {
|
|
6476
|
+
var DAYS = [translate('Calendar.sunday'), translate('Calendar.monday'), translate('Calendar.tuesday'), translate('Calendar.wednesday'), translate('Calendar.thursday'), translate('Calendar.friday'), translate('Calendar.saturday')];
|
|
6431
6477
|
return DAYS;
|
|
6432
6478
|
};
|
|
6433
|
-
var getMonths = function getMonths() {
|
|
6434
|
-
var MONTH_NAMES = [
|
|
6479
|
+
var getMonths = function getMonths(translate) {
|
|
6480
|
+
var MONTH_NAMES = [translate('Calendar.january'), translate('Calendar.february'), translate('Calendar.march'), translate('Calendar.april'), translate('Calendar.may'), translate('Calendar.june'), translate('Calendar.july'), translate('Calendar.august'), translate('Calendar.september'), translate('Calendar.october'), translate('Calendar.november'), translate('Calendar.december')];
|
|
6435
6481
|
return MONTH_NAMES;
|
|
6436
6482
|
};
|
|
6437
6483
|
|
|
@@ -6491,7 +6537,7 @@ var getVerticalPosition = function getVerticalPosition(anchorPosition, placement
|
|
|
6491
6537
|
}
|
|
6492
6538
|
};
|
|
6493
6539
|
|
|
6494
|
-
var Calendar = function Calendar(_ref) {
|
|
6540
|
+
var Calendar$1 = function Calendar(_ref) {
|
|
6495
6541
|
var _ref$mode = _ref.mode,
|
|
6496
6542
|
mode = _ref$mode === void 0 ? CALENDAR_MODE.DAY : _ref$mode,
|
|
6497
6543
|
_ref$position = _ref.position,
|
|
@@ -6506,6 +6552,7 @@ var Calendar = function Calendar(_ref) {
|
|
|
6506
6552
|
anchorRef = _ref.anchorRef,
|
|
6507
6553
|
testId = _ref.testId,
|
|
6508
6554
|
onMonthChange = _ref.onMonthChange;
|
|
6555
|
+
var translate = useTranslation();
|
|
6509
6556
|
var _useState = React.useState(null),
|
|
6510
6557
|
calendarRef = _useState[0],
|
|
6511
6558
|
setCalendarRef = _useState[1];
|
|
@@ -6541,7 +6588,8 @@ var Calendar = function Calendar(_ref) {
|
|
|
6541
6588
|
var anchorPosition = anchorNode.getBoundingClientRect();
|
|
6542
6589
|
var calendarPosition = calculateCalendarPosition(position, anchorPosition, calendarRef === null || calendarRef === void 0 ? void 0 : calendarRef.getBoundingClientRect());
|
|
6543
6590
|
var styleOverrides = mode === CALENDAR_MODE.WEEK ? weekOverridesStyles : dayOverridesStyles;
|
|
6544
|
-
var MONTH_NAMES = getMonths();
|
|
6591
|
+
var MONTH_NAMES = getMonths(translate);
|
|
6592
|
+
var DAYS = getDays(translate);
|
|
6545
6593
|
var defaultProps = {
|
|
6546
6594
|
classNames: _extends({}, originalStylers, styleOverrides),
|
|
6547
6595
|
onDayClick: function onDayClick(day, activeModifiers) {
|
|
@@ -6560,6 +6608,9 @@ var Calendar = function Calendar(_ref) {
|
|
|
6560
6608
|
weekStartsOn: weekStart,
|
|
6561
6609
|
onMonthChange: onMonthChange,
|
|
6562
6610
|
formatters: {
|
|
6611
|
+
formatMonthCaption: function formatMonthCaption(date) {
|
|
6612
|
+
return MONTH_NAMES[date.getMonth()];
|
|
6613
|
+
},
|
|
6563
6614
|
formatCaption: function formatCaption(date) {
|
|
6564
6615
|
return MONTH_NAMES[date.getMonth()] + ' ' + date.getFullYear();
|
|
6565
6616
|
},
|
|
@@ -6568,7 +6619,6 @@ var Calendar = function Calendar(_ref) {
|
|
|
6568
6619
|
}
|
|
6569
6620
|
}
|
|
6570
6621
|
};
|
|
6571
|
-
var DAYS = getDays();
|
|
6572
6622
|
return React__default.createElement(Portal, null, React__default.createElement("div", {
|
|
6573
6623
|
className: styles$G['calendar']
|
|
6574
6624
|
}, React__default.createElement("div", {
|
|
@@ -6717,7 +6767,7 @@ var useLocalStorage = function useLocalStorage(key, initialValue) {
|
|
|
6717
6767
|
var styles$I = {"hint-modal":"_1b47y","hint-modal--after-open":"_2MB4p","hint-modal--before-close":"_3VYQo","hint-modal__overlay":"_3Enme","hint-modal__image":"_2Nn7v","hint-modal__body":"_bzN9e","hint-modal__close-button":"_3xbis"};
|
|
6718
6768
|
|
|
6719
6769
|
var _excluded$2y = ["header", "children", "mediaUrl", "onClose", "modalId", "primaryButton", "testId"];
|
|
6720
|
-
var HintModal = function HintModal(_ref) {
|
|
6770
|
+
var HintModal$1 = function HintModal(_ref) {
|
|
6721
6771
|
var header = _ref.header,
|
|
6722
6772
|
children = _ref.children,
|
|
6723
6773
|
mediaUrl = _ref.mediaUrl,
|
|
@@ -6726,6 +6776,7 @@ var HintModal = function HintModal(_ref) {
|
|
|
6726
6776
|
primaryButton = _ref.primaryButton,
|
|
6727
6777
|
testId = _ref.testId,
|
|
6728
6778
|
positionProps = _objectWithoutPropertiesLoose(_ref, _excluded$2y);
|
|
6779
|
+
var __ = useTranslation('HintModal');
|
|
6729
6780
|
var _useState = React.useState(false),
|
|
6730
6781
|
doNotShowAgain = _useState[0],
|
|
6731
6782
|
setDoNotShowAgain = _useState[1];
|
|
@@ -6790,7 +6841,7 @@ var HintModal = function HintModal(_ref) {
|
|
|
6790
6841
|
}, React__default.createElement(CheckboxField, {
|
|
6791
6842
|
name: "hint-modal-do-not-show-checkbox",
|
|
6792
6843
|
checked: doNotShowAgain,
|
|
6793
|
-
label:
|
|
6844
|
+
label: __('dontShowAgainLabel'),
|
|
6794
6845
|
onChange: function onChange() {
|
|
6795
6846
|
return setDoNotShowAgain(!doNotShowAgain);
|
|
6796
6847
|
}
|
|
@@ -7235,7 +7286,7 @@ var DataTable = function DataTable(_ref) {
|
|
|
7235
7286
|
return React__default.createElement("div", {
|
|
7236
7287
|
className: styles$b['data-table__pagination-controls'],
|
|
7237
7288
|
"data-testid": testId && testId + "-pagination-controls"
|
|
7238
|
-
}, React__default.createElement(PaginationControls, {
|
|
7289
|
+
}, React__default.createElement(PaginationControls$1, {
|
|
7239
7290
|
hasPrevious: isLoading ? false : hasPrevious,
|
|
7240
7291
|
hasNext: isLoading ? false : hasNext,
|
|
7241
7292
|
onPreviousClick: onPreviousClick,
|
|
@@ -7570,6 +7621,7 @@ function CustomMenu(_ref) {
|
|
|
7570
7621
|
setInputDefaultValue = _useState2[1];
|
|
7571
7622
|
var textFieldRef = React.useRef(null);
|
|
7572
7623
|
var containerRef = React.useRef(null);
|
|
7624
|
+
var __ = useTranslation('SelectField');
|
|
7573
7625
|
var CreatableButton = function CreatableButton() {
|
|
7574
7626
|
var button = creatableButton;
|
|
7575
7627
|
if (!button || typeof button === 'string') {
|
|
@@ -7587,7 +7639,7 @@ function CustomMenu(_ref) {
|
|
|
7587
7639
|
justifyContent: "center"
|
|
7588
7640
|
}, React__default.createElement(IconPlus, {
|
|
7589
7641
|
size: "medium"
|
|
7590
|
-
}), button ||
|
|
7642
|
+
}), button || __('createOption')));
|
|
7591
7643
|
}
|
|
7592
7644
|
return React__default.cloneElement(button, {
|
|
7593
7645
|
onClick: function onClick() {
|
|
@@ -7653,7 +7705,7 @@ function CustomMenu(_ref) {
|
|
|
7653
7705
|
onKeyDown: function onKeyDown(e) {
|
|
7654
7706
|
e.stopPropagation();
|
|
7655
7707
|
}
|
|
7656
|
-
},
|
|
7708
|
+
}, __('createButton'))))));
|
|
7657
7709
|
}
|
|
7658
7710
|
|
|
7659
7711
|
var useShouldScrollMenuIntoView = function useShouldScrollMenuIntoView(menuShouldScrollIntoView) {
|
|
@@ -7771,7 +7823,7 @@ var useSelectField = function useSelectField(_ref) {
|
|
|
7771
7823
|
};
|
|
7772
7824
|
};
|
|
7773
7825
|
|
|
7774
|
-
var SelectField = function SelectField(props) {
|
|
7826
|
+
var SelectField$1 = function SelectField(props) {
|
|
7775
7827
|
var _useSelectField = useSelectField(props),
|
|
7776
7828
|
fieldProps = _useSelectField.fieldProps,
|
|
7777
7829
|
selectProps = _useSelectField.selectProps;
|
|
@@ -7792,7 +7844,7 @@ var ToolbarSelect = function ToolbarSelect(_ref) {
|
|
|
7792
7844
|
disabled = _ref.disabled,
|
|
7793
7845
|
prefix = _ref.prefix,
|
|
7794
7846
|
testId = _ref.testId;
|
|
7795
|
-
return React__default.createElement(SelectField, {
|
|
7847
|
+
return React__default.createElement(SelectField$1, {
|
|
7796
7848
|
name: name,
|
|
7797
7849
|
value: value,
|
|
7798
7850
|
options: options,
|
|
@@ -7966,7 +8018,7 @@ var DateFilter = function DateFilter(_ref) {
|
|
|
7966
8018
|
}, React__default.createElement(IconChevronRight, {
|
|
7967
8019
|
size: "small",
|
|
7968
8020
|
color: "grey-400"
|
|
7969
|
-
}))), calendarOpen && mode !== DATE_FILTER_MODE.MONTH && React__default.createElement(Calendar, {
|
|
8021
|
+
}))), calendarOpen && mode !== DATE_FILTER_MODE.MONTH && React__default.createElement(Calendar$1, {
|
|
7970
8022
|
onSelect: handleChange,
|
|
7971
8023
|
selected: value,
|
|
7972
8024
|
onClickOutside: function onClickOutside() {
|
|
@@ -8874,6 +8926,7 @@ var CustomList = function CustomList(_ref) {
|
|
|
8874
8926
|
hasMoreOptions = _ref.hasMoreOptions,
|
|
8875
8927
|
hasMoreOptionsFirstLoad = _ref.hasMoreOptionsFirstLoad,
|
|
8876
8928
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$2F);
|
|
8929
|
+
var __ = useTranslation('AsyncSelectField');
|
|
8877
8930
|
var showFooter = hasMoreOptions;
|
|
8878
8931
|
if (props.selectProps.inputValue === '' && typeof hasMoreOptionsFirstLoad === 'boolean') {
|
|
8879
8932
|
showFooter = hasMoreOptionsFirstLoad;
|
|
@@ -8882,11 +8935,11 @@ var CustomList = function CustomList(_ref) {
|
|
|
8882
8935
|
justifyContent: "center"
|
|
8883
8936
|
}, React__default.createElement("div", {
|
|
8884
8937
|
className: styles$11['custom-list']
|
|
8885
|
-
},
|
|
8938
|
+
}, __('moreOptionsPlaceholder')))));
|
|
8886
8939
|
};
|
|
8887
8940
|
|
|
8888
8941
|
var _excluded$2G = ["loadOptions"];
|
|
8889
|
-
var AsyncSelectField = function AsyncSelectField(_ref) {
|
|
8942
|
+
var AsyncSelectField$1 = function AsyncSelectField(_ref) {
|
|
8890
8943
|
var loadOptions = _ref.loadOptions,
|
|
8891
8944
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$2G);
|
|
8892
8945
|
var _useState = React.useState(false),
|
|
@@ -9106,7 +9159,7 @@ var DateField = function DateField(_ref) {
|
|
|
9106
9159
|
onBlur: controllers.onBlur,
|
|
9107
9160
|
maxLength: format.length,
|
|
9108
9161
|
value: inputValue
|
|
9109
|
-
})), showCalendar && React__default.createElement(Calendar, {
|
|
9162
|
+
})), showCalendar && React__default.createElement(Calendar$1, {
|
|
9110
9163
|
onSelect: function onSelect(date) {
|
|
9111
9164
|
var _inputRef$current;
|
|
9112
9165
|
setInputValue(formatDate(date, format));
|
|
@@ -9203,6 +9256,7 @@ var DateRangeCalendar = function DateRangeCalendar(_ref) {
|
|
|
9203
9256
|
testId = _ref.testId,
|
|
9204
9257
|
onMonthChange = _ref.onMonthChange,
|
|
9205
9258
|
mode = _ref.mode;
|
|
9259
|
+
var translate = useTranslation();
|
|
9206
9260
|
var position = CALENDAR_PLACEMENT.BOTTOM;
|
|
9207
9261
|
var _useState = React.useState(null),
|
|
9208
9262
|
calendarRef = _useState[0],
|
|
@@ -9236,8 +9290,8 @@ var DateRangeCalendar = function DateRangeCalendar(_ref) {
|
|
|
9236
9290
|
fromMonth: start
|
|
9237
9291
|
};
|
|
9238
9292
|
var datePickerProps = mode === 'start-date' ? startDateProps : endDateProps;
|
|
9239
|
-
var DAYS = getDays();
|
|
9240
|
-
var MONTH_NAMES = getMonths();
|
|
9293
|
+
var DAYS = getDays(translate);
|
|
9294
|
+
var MONTH_NAMES = getMonths(translate);
|
|
9241
9295
|
return React__default.createElement(Portal, null, React__default.createElement("div", {
|
|
9242
9296
|
className: styles$G['calendar']
|
|
9243
9297
|
}, React__default.createElement("div", {
|
|
@@ -9576,7 +9630,7 @@ var WeekField = function WeekField(_ref) {
|
|
|
9576
9630
|
onBlur: controllers.onBlur,
|
|
9577
9631
|
maxLength: format.length,
|
|
9578
9632
|
value: inputValue
|
|
9579
|
-
})), showCalendar && React__default.createElement(Calendar, {
|
|
9633
|
+
})), showCalendar && React__default.createElement(Calendar$1, {
|
|
9580
9634
|
onSelect: function onSelect(date) {
|
|
9581
9635
|
var _inputRef$current;
|
|
9582
9636
|
setInputValue(formatDate(date, format));
|
|
@@ -11403,7 +11457,7 @@ var EmptyState = function EmptyState(_ref) {
|
|
|
11403
11457
|
}, children);
|
|
11404
11458
|
};
|
|
11405
11459
|
|
|
11406
|
-
exports.AsyncSelectField = AsyncSelectField;
|
|
11460
|
+
exports.AsyncSelectField = AsyncSelectField$1;
|
|
11407
11461
|
exports.Avatar = Avatar;
|
|
11408
11462
|
exports.Badge = Badge$1;
|
|
11409
11463
|
exports.Bold = Bold;
|
|
@@ -11411,7 +11465,7 @@ exports.BreadcrumbItem = BreadcrumbItem;
|
|
|
11411
11465
|
exports.Breadcrumbs = Breadcrumbs;
|
|
11412
11466
|
exports.Button = Button$1;
|
|
11413
11467
|
exports.COLORS = COLORS;
|
|
11414
|
-
exports.Calendar = Calendar;
|
|
11468
|
+
exports.Calendar = Calendar$1;
|
|
11415
11469
|
exports.CalloutCard = CalloutCard;
|
|
11416
11470
|
exports.Card = Card;
|
|
11417
11471
|
exports.CheckboxField = CheckboxField;
|
|
@@ -11435,7 +11489,7 @@ exports.FormFeedback = FormFeedback;
|
|
|
11435
11489
|
exports.FormFooter = FormFooter;
|
|
11436
11490
|
exports.FormRow = FormRow;
|
|
11437
11491
|
exports.FormSection = FormSection;
|
|
11438
|
-
exports.HintModal = HintModal;
|
|
11492
|
+
exports.HintModal = HintModal$1;
|
|
11439
11493
|
exports.IconAnalytics = IconAnalytics;
|
|
11440
11494
|
exports.IconArrowDown = IconArrowDown;
|
|
11441
11495
|
exports.IconArrowDownWideShort = IconArrowDownWideShort;
|
|
@@ -11591,7 +11645,7 @@ exports.ModalBody = ModalBody;
|
|
|
11591
11645
|
exports.ModalFooter = ModalFooter;
|
|
11592
11646
|
exports.MultiSelectField = MultiSelectField;
|
|
11593
11647
|
exports.Page = Page;
|
|
11594
|
-
exports.PaginationControls = PaginationControls;
|
|
11648
|
+
exports.PaginationControls = PaginationControls$1;
|
|
11595
11649
|
exports.PasswordField = PasswordField;
|
|
11596
11650
|
exports.Paywall = Paywall;
|
|
11597
11651
|
exports.PercentageField = PercentageField;
|
|
@@ -11609,7 +11663,7 @@ exports.SIZE_50_PERCENT = SIZE_50_PERCENT;
|
|
|
11609
11663
|
exports.SIZE_66_PERCENT = SIZE_66_PERCENT;
|
|
11610
11664
|
exports.SIZE_75_PERCENT = SIZE_75_PERCENT;
|
|
11611
11665
|
exports.SegmentedControl = SegmentedControl;
|
|
11612
|
-
exports.SelectField = SelectField;
|
|
11666
|
+
exports.SelectField = SelectField$1;
|
|
11613
11667
|
exports.Skeleton = Skeleton;
|
|
11614
11668
|
exports.SousChefProvider = SousChefProvider;
|
|
11615
11669
|
exports.Spinner = Spinner;
|