@onesy/ui-react 1.0.58 → 1.0.60
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/AudioPlayer/AudioPlayer.js +6 -23
- package/AudioRecorder/AudioRecorder.js +2 -1
- package/AutoComplete/AutoComplete.js +5 -4
- package/AutoCompleteCountry/AutoCompleteCountry.js +2 -1
- package/AutoCompleteCurrency/AutoCompleteCurrency.js +2 -1
- package/Breadcrumbs/Breadcrumbs.js +3 -2
- package/BubbleChart/BubbleChart.js +3 -2
- package/Calendar/Calendar.js +7 -6
- package/CalendarAvailability/CalendarAvailability.d.ts +4 -1
- package/CalendarAvailability/CalendarAvailability.js +23 -18
- package/CalendarMenu/CalendarMenu.js +6 -5
- package/CalendarMonth/CalendarMonth.js +8 -7
- package/CalendarViews/CalendarViews.d.ts +4 -1
- package/CalendarViews/CalendarViews.js +17 -12
- package/Chart/Chart.js +1 -0
- package/ColorTextField/ColorTextField.js +2 -1
- package/Confirm/Confirm.js +4 -3
- package/CookieBanner/CookieBanner.js +3 -2
- package/Countdown/Countdown.js +5 -4
- package/DatePicker/DatePicker.js +10 -9
- package/DateTimePicker/DateTimePicker.js +5 -4
- package/Drawing/Drawing.js +9 -8
- package/DropZone/DropZone.d.ts +1 -0
- package/DropZone/DropZone.js +3 -2
- package/Emojis/Emojis.js +46 -43
- package/Frame/Frame.js +6 -5
- package/ImageEdit/ImageEdit.js +21 -20
- package/Info/Info.js +2 -1
- package/Links/Links.d.ts +2 -0
- package/Links/Links.js +7 -6
- package/Medias/Medias.js +2 -1
- package/MenuDesktop/MenuDesktop.js +1 -3
- package/NavigationItem/NavigationItem.js +1 -1
- package/NotFound/NotFound.d.ts +1 -0
- package/NotFound/NotFound.js +3 -2
- package/Page/Page.js +2 -1
- package/PieChart/PieChart.js +4 -3
- package/RichTextEditor/RichTextEditor.js +57 -56
- package/ScreenCapture/ScreenCapture.js +2 -1
- package/SectionAction/SectionAction.js +2 -1
- package/SectionBoxes/SectionBoxes.js +2 -1
- package/SectionCards/SectionCards.js +2 -1
- package/SectionCarousel/SectionCarousel.js +2 -1
- package/SectionMedia/SectionMedia.js +2 -1
- package/SectionTextMedia/SectionTextMedia.js +2 -1
- package/Select/Select.js +9 -14
- package/Share/Share.js +15 -14
- package/SmartTextField/SmartTextField.js +13 -12
- package/SpeechToText/SpeechToText.js +3 -2
- package/SpeedDial/SpeedDial.js +1 -1
- package/SpeedDialItem/SpeedDialItem.js +1 -1
- package/TableCell/TableCell.js +2 -1
- package/TablePagination/TablePagination.js +2 -1
- package/TextField/TextField.d.ts +1 -0
- package/TextToSpeech/TextToSpeech.js +4 -3
- package/TimePicker/TimePicker.js +9 -8
- package/Timer/Timer.js +3 -2
- package/VideoPlayer/VideoPlayer.js +5 -4
- package/Widgets/Widgets.js +3 -2
- package/esm/AudioPlayer/AudioPlayer.js +7 -30
- package/esm/AudioRecorder/AudioRecorder.js +8 -7
- package/esm/AutoComplete/AutoComplete.js +5 -4
- package/esm/AutoCompleteCountry/AutoCompleteCountry.js +2 -0
- package/esm/AutoCompleteCurrency/AutoCompleteCurrency.js +2 -1
- package/esm/Breadcrumbs/Breadcrumbs.js +3 -2
- package/esm/BubbleChart/BubbleChart.js +3 -2
- package/esm/Calendar/Calendar.js +9 -8
- package/esm/CalendarAvailability/CalendarAvailability.js +31 -21
- package/esm/CalendarMenu/CalendarMenu.js +7 -6
- package/esm/CalendarMonth/CalendarMonth.js +8 -7
- package/esm/CalendarViews/CalendarViews.js +25 -15
- package/esm/Chart/Chart.js +1 -0
- package/esm/ColorTextField/ColorTextField.js +2 -1
- package/esm/Confirm/Confirm.js +7 -6
- package/esm/CookieBanner/CookieBanner.js +4 -3
- package/esm/Countdown/Countdown.js +10 -9
- package/esm/DatePicker/DatePicker.js +22 -21
- package/esm/DateTimePicker/DateTimePicker.js +11 -10
- package/esm/Drawing/Drawing.js +11 -10
- package/esm/DropZone/DropZone.js +4 -2
- package/esm/Emojis/Emojis.js +37 -34
- package/esm/Frame/Frame.js +6 -5
- package/esm/ImageEdit/ImageEdit.js +25 -24
- package/esm/Info/Info.js +2 -1
- package/esm/Links/Links.js +9 -6
- package/esm/Medias/Medias.js +2 -1
- package/esm/MenuDesktop/MenuDesktop.js +1 -2
- package/esm/NavigationItem/NavigationItem.js +1 -1
- package/esm/NotFound/NotFound.js +5 -3
- package/esm/Page/Page.js +3 -2
- package/esm/PieChart/PieChart.js +4 -4
- package/esm/RichTextEditor/RichTextEditor.js +76 -75
- package/esm/ScreenCapture/ScreenCapture.js +4 -3
- package/esm/SectionAction/SectionAction.js +2 -1
- package/esm/SectionBoxes/SectionBoxes.js +2 -1
- package/esm/SectionCards/SectionCards.js +2 -1
- package/esm/SectionCarousel/SectionCarousel.js +2 -1
- package/esm/SectionMedia/SectionMedia.js +2 -1
- package/esm/SectionTextMedia/SectionTextMedia.js +2 -1
- package/esm/Select/Select.js +11 -7
- package/esm/Share/Share.js +16 -15
- package/esm/SmartTextField/SmartTextField.js +15 -14
- package/esm/SpeechToText/SpeechToText.js +3 -2
- package/esm/SpeedDial/SpeedDial.js +1 -1
- package/esm/SpeedDialItem/SpeedDialItem.js +1 -1
- package/esm/TableCell/TableCell.js +2 -1
- package/esm/TablePagination/TablePagination.js +2 -1
- package/esm/TextToSpeech/TextToSpeech.js +4 -3
- package/esm/TimePicker/TimePicker.js +19 -18
- package/esm/Timer/Timer.js +7 -6
- package/esm/VideoPlayer/VideoPlayer.js +7 -6
- package/esm/Widgets/Widgets.js +3 -2
- package/esm/index.js +1 -1
- package/package.json +2 -2
@@ -113,6 +113,7 @@ const useStyle = styleMethod(theme => ({
|
|
113
113
|
});
|
114
114
|
const AudioPlayer = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
115
115
|
const theme = useOnesyTheme();
|
116
|
+
const l = theme.l;
|
116
117
|
const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyAudioPlayer?.props?.default), props_), [props_]);
|
117
118
|
const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
|
118
119
|
const Surface = React.useMemo(() => theme?.elements?.Surface || SurfaceElement, [theme]);
|
@@ -461,7 +462,7 @@ const AudioPlayer = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
461
462
|
}),
|
462
463
|
primary: /*#__PURE__*/React.createElement(Type, {
|
463
464
|
version: "b3"
|
464
|
-
}, "Back"),
|
465
|
+
}, "l('Back')"),
|
465
466
|
onClick: () => setOpenMenu(null)
|
466
467
|
}, itemProps)));
|
467
468
|
}
|
@@ -473,7 +474,7 @@ const AudioPlayer = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
473
474
|
}),
|
474
475
|
primary: /*#__PURE__*/React.createElement(Type, {
|
475
476
|
version: "b3"
|
476
|
-
}, "Playback speed"),
|
477
|
+
}, "l('Playback speed')"),
|
477
478
|
end: /*#__PURE__*/React.createElement(Type, {
|
478
479
|
version: "b3",
|
479
480
|
priority: "secondary"
|
@@ -487,11 +488,11 @@ const AudioPlayer = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
487
488
|
}),
|
488
489
|
primary: /*#__PURE__*/React.createElement(Type, {
|
489
490
|
version: "b3"
|
490
|
-
}, "Quality"),
|
491
|
+
}, "l('Quality')"),
|
491
492
|
end: /*#__PURE__*/React.createElement(Type, {
|
492
493
|
version: "b3",
|
493
494
|
priority: "secondary"
|
494
|
-
}, !quality ? 'Original' : `${quality?.meta?.resolution}p`),
|
495
|
+
}, !quality ? l('Original') : `${quality?.meta?.resolution}p`),
|
495
496
|
onClick: () => setOpenMenu('quality')
|
496
497
|
}, itemProps)));
|
497
498
|
} else if (openMenu === 'quality') {
|
@@ -499,34 +500,10 @@ const AudioPlayer = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
499
500
|
key: "original",
|
500
501
|
primary: /*#__PURE__*/React.createElement(Type, {
|
501
502
|
version: "b3"
|
502
|
-
}, "Original"),
|
503
|
+
}, "l('Original')"),
|
503
504
|
onClick: () => quality ? onQuality(null) : undefined,
|
504
505
|
selected: !quality
|
505
506
|
}, itemProps)));
|
506
|
-
|
507
|
-
// versions?.forEach((version: any, index: number) => {
|
508
|
-
// const isSelected = quality?.id === version?.id;
|
509
|
-
|
510
|
-
// items.push(
|
511
|
-
// <ListItem
|
512
|
-
// key={index}
|
513
|
-
|
514
|
-
// primary={(
|
515
|
-
// <Type
|
516
|
-
// version='b3'
|
517
|
-
// >
|
518
|
-
// {version?.meta?.resolution}p
|
519
|
-
// </Type>
|
520
|
-
// )}
|
521
|
-
|
522
|
-
// onClick={() => !isSelected ? onQuality(version) : undefined}
|
523
|
-
|
524
|
-
// selected={isSelected}
|
525
|
-
|
526
|
-
// {...itemProps}
|
527
|
-
// />
|
528
|
-
// );
|
529
|
-
// });
|
530
507
|
} else if (openMenu === 'playbackSpeed') {
|
531
508
|
const options = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];
|
532
509
|
options.forEach(option => {
|
@@ -534,7 +511,7 @@ const AudioPlayer = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
534
511
|
key: option,
|
535
512
|
primary: /*#__PURE__*/React.createElement(Type, {
|
536
513
|
version: "b3"
|
537
|
-
}, option === 1 ? 'Normal' : option),
|
514
|
+
}, option === 1 ? l('Normal') : option),
|
538
515
|
onClick: () => onPlaybackSpeed(option),
|
539
516
|
selected: playbackSpeed === option
|
540
517
|
}, itemProps)));
|
@@ -63,6 +63,7 @@ const useStyle = styleMethod(theme => ({
|
|
63
63
|
});
|
64
64
|
const AudioRecorder = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
65
65
|
const theme = useOnesyTheme();
|
66
|
+
const l = theme.l;
|
66
67
|
const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyAudioRecorder?.props?.default), props_), [props_]);
|
67
68
|
const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
|
68
69
|
const Fade = React.useMemo(() => theme?.elements?.Fade || FadeElement, [theme]);
|
@@ -299,7 +300,7 @@ const AudioRecorder = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
299
300
|
onStart,
|
300
301
|
supported
|
301
302
|
}) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, _extends({
|
302
|
-
|
303
|
+
name: l('Voice record')
|
303
304
|
}, TooltipProps), /*#__PURE__*/React.createElement(IconButton, _extends({
|
304
305
|
onClick: onStart,
|
305
306
|
disabled: !supported
|
@@ -307,30 +308,30 @@ const AudioRecorder = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
307
308
|
in: true,
|
308
309
|
add: true
|
309
310
|
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Tooltip, _extends({
|
310
|
-
|
311
|
+
name: l('Cancel')
|
311
312
|
}, TooltipProps), /*#__PURE__*/React.createElement(IconButton, _extends({
|
312
313
|
onClick: onStop
|
313
314
|
}, iconButtonProps), /*#__PURE__*/React.createElement(IconStop, iconProps))), pause && /*#__PURE__*/React.createElement(Tooltip, _extends({
|
314
|
-
|
315
|
+
name: l('Pause')
|
315
316
|
}, TooltipProps), /*#__PURE__*/React.createElement(IconButton, _extends({
|
316
317
|
onClick: onPause
|
317
318
|
}, iconButtonProps), /*#__PURE__*/React.createElement(IconPause, iconProps))), /*#__PURE__*/React.createElement(Tooltip, _extends({
|
318
|
-
|
319
|
+
name: l('Confirm')
|
319
320
|
}, TooltipProps), /*#__PURE__*/React.createElement(IconButton, _extends({
|
320
321
|
onClick: onConfirm
|
321
322
|
}, iconButtonProps), /*#__PURE__*/React.createElement(IconConfirm, iconProps))))), status === 'paused' && /*#__PURE__*/React.createElement(Fade, {
|
322
323
|
in: true,
|
323
324
|
add: true
|
324
325
|
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Tooltip, _extends({
|
325
|
-
|
326
|
+
name: l('Cancel')
|
326
327
|
}, TooltipProps), /*#__PURE__*/React.createElement(IconButton, _extends({
|
327
328
|
onClick: onStop
|
328
329
|
}, iconButtonProps), /*#__PURE__*/React.createElement(IconStop, iconProps))), /*#__PURE__*/React.createElement(Tooltip, _extends({
|
329
|
-
|
330
|
+
name: l('Resume')
|
330
331
|
}, TooltipProps), /*#__PURE__*/React.createElement(IconButton, _extends({
|
331
332
|
onClick: onResume
|
332
333
|
}, iconButtonProps), /*#__PURE__*/React.createElement(IconStart, iconProps))), /*#__PURE__*/React.createElement(Tooltip, _extends({
|
333
|
-
|
334
|
+
name: l('Confirm')
|
334
335
|
}, TooltipProps), /*#__PURE__*/React.createElement(IconButton, _extends({
|
335
336
|
onClick: onConfirm
|
336
337
|
}, iconButtonProps), /*#__PURE__*/React.createElement(IconConfirm, iconProps))))));
|
@@ -102,6 +102,7 @@ const getText = value => {
|
|
102
102
|
const getValue = value => value?.value !== undefined ? value.value : value;
|
103
103
|
const AutoComplete = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
104
104
|
const theme = useOnesyTheme();
|
105
|
+
const l = theme.l;
|
105
106
|
const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyAutoComplete?.props?.default), props_), [props_]);
|
106
107
|
const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
|
107
108
|
const Menu = React.useMemo(() => theme?.elements?.Menu || MenuElement, [theme]);
|
@@ -257,12 +258,12 @@ const AutoComplete = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
257
258
|
// reset
|
258
259
|
setFree(false);
|
259
260
|
if (loading) optionsValue = [{
|
260
|
-
label: 'Loading...',
|
261
|
+
label: l('Loading...'),
|
261
262
|
version: 'text'
|
262
263
|
}];else if (newOptions) optionsValue = newOptions;else optionsValue = is('function', filter) ? filter(valueInputNew, refs.optionsProps.current) : refs.optionsProps.current.filter(option => isEqualToInput(valueInputNew, option));
|
263
264
|
if (!optionsValue.length) {
|
264
265
|
if (noOptions) optionsValue.push(noOptionsObject !== undefined ? noOptionsObject : {
|
265
|
-
primary: 'No options',
|
266
|
+
primary: l('No options'),
|
266
267
|
version: 'text',
|
267
268
|
noOptions: true
|
268
269
|
});else {
|
@@ -466,7 +467,7 @@ const AutoComplete = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
466
467
|
const groups = {};
|
467
468
|
if (is('function', groupBy)) {
|
468
469
|
optionsToUse.forEach(option => {
|
469
|
-
const valueForGroupBy = groupBy(option) || 'Other';
|
470
|
+
const valueForGroupBy = groupBy(option) || l('Other');
|
470
471
|
if (!groups[valueForGroupBy]) groups[valueForGroupBy] = [];
|
471
472
|
groups[valueForGroupBy].push(option);
|
472
473
|
});
|
@@ -547,7 +548,7 @@ const AutoComplete = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
547
548
|
onClick: onClear,
|
548
549
|
size: "small",
|
549
550
|
fontSize: iconFontSize,
|
550
|
-
"aria-label":
|
551
|
+
"aria-label": l('Input clear')
|
551
552
|
}, IconButtonProps), /*#__PURE__*/React.createElement(IconClear, IconProps))] : []), /*#__PURE__*/React.createElement(IconButton, _extends({
|
552
553
|
key: 3,
|
553
554
|
onClick: onClickArrowDown,
|
@@ -18,6 +18,7 @@ const useStyle = styleMethod(theme => ({
|
|
18
18
|
});
|
19
19
|
const AutoCompleteCountry = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
20
20
|
const theme = useOnesyTheme();
|
21
|
+
const l = theme.l;
|
21
22
|
const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyAutoCompleteCountry?.props?.default), props_), [props_]);
|
22
23
|
const AutoComplete = React.useMemo(() => theme?.elements?.AutoComplete || AutoCompleteElement, [theme]);
|
23
24
|
const ListItem = React.useMemo(() => theme?.elements?.ListItem || ListItemElement, [theme]);
|
@@ -48,6 +49,7 @@ const AutoCompleteCountry = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
48
49
|
// }
|
49
50
|
const options = React.useMemo(() => {
|
50
51
|
return countries.map(item => _objectSpread(_objectSpread({}, item), {}, {
|
52
|
+
name: l(item.name),
|
51
53
|
value: item['alpha-2']
|
52
54
|
}));
|
53
55
|
}, [countries]);
|
@@ -15,6 +15,7 @@ const useStyle = styleMethod(theme => ({
|
|
15
15
|
});
|
16
16
|
const AutoCompleteCurrency = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
17
17
|
const theme = useOnesyTheme();
|
18
|
+
const l = theme.l;
|
18
19
|
const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyAutoCompleteCurrency?.props?.default), props_), [props_]);
|
19
20
|
const AutoComplete = React.useMemo(() => theme?.elements?.AutoComplete || AutoCompleteElement, [theme]);
|
20
21
|
const {
|
@@ -39,7 +40,7 @@ const AutoCompleteCurrency = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
39
40
|
// }
|
40
41
|
const options = React.useMemo(() => {
|
41
42
|
return [{
|
42
|
-
name: 'No currency',
|
43
|
+
name: l('No currency'),
|
43
44
|
value: ''
|
44
45
|
}, ...currencies.map(item => ({
|
45
46
|
name: `${item.code} ${item.name} (${item.symbol})`,
|
@@ -32,6 +32,7 @@ const useStyle = styleMethod(theme => ({
|
|
32
32
|
});
|
33
33
|
const Breadcrumbs = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
34
34
|
const theme = useOnesyTheme();
|
35
|
+
const l = theme.l;
|
35
36
|
const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyBreadcrumbs?.props?.default), props_), [props_]);
|
36
37
|
const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
|
37
38
|
const Type = React.useMemo(() => theme?.elements?.Type || TypeElement, [theme]);
|
@@ -91,7 +92,7 @@ const Breadcrumbs = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
91
92
|
color: "default",
|
92
93
|
size: "small",
|
93
94
|
onClick: onExpandMore,
|
94
|
-
"aria-label":
|
95
|
+
"aria-label": l('Expand more path')
|
95
96
|
}, MoreProps, {
|
96
97
|
className: classNames([staticClassName('Breadcrumbs', theme) && ['onesy-Breadcrumbs-expand-more'], MoreProps?.className, classes.expandMore])
|
97
98
|
}), /*#__PURE__*/React.createElement(IconMore, {
|
@@ -127,7 +128,7 @@ const Breadcrumbs = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
127
128
|
direction: "row",
|
128
129
|
align: "center",
|
129
130
|
wrap: "wrap",
|
130
|
-
"aria-label":
|
131
|
+
"aria-label": l('Breadcrumb'),
|
131
132
|
Component: Component
|
132
133
|
}, other, {
|
133
134
|
className: classNames([staticClassName('Breadcrumbs', theme) && ['onesy-Breadcrumbs-root'], className, classes.root])
|
@@ -50,6 +50,7 @@ const useStyle = styleMethod(theme => ({
|
|
50
50
|
});
|
51
51
|
const BubbleChart = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
52
52
|
const theme = useOnesyTheme();
|
53
|
+
const l = theme.l;
|
53
54
|
const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyBubbleChart?.props?.default), props_), [props_]);
|
54
55
|
const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
|
55
56
|
const Chart = React.useMemo(() => theme?.elements?.Chart || ChartElement, [theme]);
|
@@ -153,7 +154,7 @@ const BubbleChart = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
153
154
|
style: {
|
154
155
|
fontWeight: 600
|
155
156
|
}
|
156
|
-
},
|
157
|
+
}, l('Label')), /*#__PURE__*/React.createElement(Type, {
|
157
158
|
version: "b3",
|
158
159
|
style: {
|
159
160
|
fontWeight: 600
|
@@ -168,7 +169,7 @@ const BubbleChart = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
168
169
|
style: {
|
169
170
|
fontWeight: 600
|
170
171
|
}
|
171
|
-
}, names?.size || 'Size')), /*#__PURE__*/React.createElement(Line, {
|
172
|
+
}, names?.size || l('Size'))), /*#__PURE__*/React.createElement(Line, {
|
172
173
|
gap: 1,
|
173
174
|
direction: "column"
|
174
175
|
}, groupsSorted.map((group, index) => /*#__PURE__*/React.createElement(Line, {
|
package/esm/Calendar/Calendar.js
CHANGED
@@ -137,6 +137,7 @@ const useStyle = style(theme => ({
|
|
137
137
|
});
|
138
138
|
const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
|
139
139
|
const theme = useOnesyTheme();
|
140
|
+
const l = theme.l;
|
140
141
|
const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyCalendar?.props?.default), props__), [props__]);
|
141
142
|
const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
|
142
143
|
const Surface = React.useMemo(() => theme?.elements?.Surface || SurfaceElement, [theme]);
|
@@ -446,7 +447,7 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
|
|
446
447
|
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
447
448
|
onClick: () => move(false),
|
448
449
|
size: size,
|
449
|
-
"aria-label":
|
450
|
+
"aria-label": l('Previous month'),
|
450
451
|
disabled: open || +year <= 1970 && month === 'Jan'
|
451
452
|
}, optionButtonProps), /*#__PURE__*/React.createElement(IconPrevious, {
|
452
453
|
size: size
|
@@ -461,7 +462,7 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
|
|
461
462
|
size: size,
|
462
463
|
className: classNames([staticClassName('Calendar', theme) && ['onesy-Calendar-arrow'], classes.arrow, open === 'month' && classes.arrow_open])
|
463
464
|
})),
|
464
|
-
"aria-label":
|
465
|
+
"aria-label": `${l('Select month')}, ${l('current')} ${month}`
|
465
466
|
}, optionButtonProps, {
|
466
467
|
className: classNames([staticClassName('Calendar', theme) && ['onesy-Calendar-option'], optionButtonProps?.className, classes.option, open === 'year' && classes.option_secondary])
|
467
468
|
}), month), /*#__PURE__*/React.createElement(Fade, {
|
@@ -469,7 +470,7 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
|
|
469
470
|
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
470
471
|
onClick: () => move(),
|
471
472
|
size: size,
|
472
|
-
"aria-label":
|
473
|
+
"aria-label": l('Next month'),
|
473
474
|
disabled: open || +year === 2099 && month === 'Dec'
|
474
475
|
}, optionButtonProps), /*#__PURE__*/React.createElement(IconNext, {
|
475
476
|
size: size
|
@@ -482,7 +483,7 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
|
|
482
483
|
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
483
484
|
onClick: () => move(false, 'year'),
|
484
485
|
size: size,
|
485
|
-
"aria-label":
|
486
|
+
"aria-label": l('Previous year'),
|
486
487
|
disabled: open || +year <= 1970
|
487
488
|
}, optionButtonProps), /*#__PURE__*/React.createElement(IconPrevious, {
|
488
489
|
size: size
|
@@ -497,7 +498,7 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
|
|
497
498
|
size: size,
|
498
499
|
className: classNames([staticClassName('Calendar', theme) && ['onesy-Calendar-arrow'], classes.arrow, open === 'year' && classes.arrow_open])
|
499
500
|
})),
|
500
|
-
"aria-label":
|
501
|
+
"aria-label": `${l('Select year')}, ${l('current')} ${year}`
|
501
502
|
}, optionButtonProps, {
|
502
503
|
className: classNames([staticClassName('Calendar', theme) && ['onesy-Calendar-option'], optionButtonProps?.className, classes.option, open === 'month' && classes.option_secondary])
|
503
504
|
}), year), /*#__PURE__*/React.createElement(Fade, {
|
@@ -505,7 +506,7 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
|
|
505
506
|
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
506
507
|
onClick: () => move(true, 'year'),
|
507
508
|
size: size,
|
508
|
-
"aria-label":
|
509
|
+
"aria-label": l('Next year'),
|
509
510
|
disabled: open || +year === 2099
|
510
511
|
}, optionButtonProps), /*#__PURE__*/React.createElement(IconNext, {
|
511
512
|
size: size
|
@@ -533,7 +534,7 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
|
|
533
534
|
color: "inherit",
|
534
535
|
size: size,
|
535
536
|
onClick: () => move(false, menu_month_previous_unit || 'month'),
|
536
|
-
"aria-label":
|
537
|
+
"aria-label": l('Previous month'),
|
537
538
|
disabled: !!(open || +year === 1970 && month === 'Jan')
|
538
539
|
}, /*#__PURE__*/React.createElement(IconPrevious, {
|
539
540
|
size: size
|
@@ -544,7 +545,7 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
|
|
544
545
|
color: "inherit",
|
545
546
|
size: size,
|
546
547
|
onClick: () => move(true, menu_month_next_unit || 'month'),
|
547
|
-
"aria-label":
|
548
|
+
"aria-label": l('Next month'),
|
548
549
|
disabled: !!(open || +year === 2099 && month === 'Dec')
|
549
550
|
}, /*#__PURE__*/React.createElement(IconNext, {
|
550
551
|
size: size
|
@@ -112,6 +112,7 @@ const useStyle = styleMethod(theme => ({
|
|
112
112
|
});
|
113
113
|
const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
114
114
|
const theme = useOnesyTheme();
|
115
|
+
const l = theme.l;
|
115
116
|
const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyCalendarAvailability?.props?.default), props_), [props_]);
|
116
117
|
const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
|
117
118
|
const Type = React.useMemo(() => theme?.elements?.Type || TypeElement, [theme]);
|
@@ -133,7 +134,16 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
133
134
|
times: timesProps,
|
134
135
|
events,
|
135
136
|
meta,
|
136
|
-
views: viewsProps = [
|
137
|
+
views: viewsProps = [{
|
138
|
+
name: l('Week'),
|
139
|
+
value: 'week'
|
140
|
+
}, {
|
141
|
+
name: l('Day'),
|
142
|
+
value: 'day'
|
143
|
+
}, {
|
144
|
+
name: l('Simple'),
|
145
|
+
value: 'simple'
|
146
|
+
}],
|
137
147
|
onUpdate,
|
138
148
|
onRemove,
|
139
149
|
onChangeDate: onChangeDateProps,
|
@@ -232,25 +242,25 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
232
242
|
}, []);
|
233
243
|
const optionsStatus = React.useMemo(() => {
|
234
244
|
return [{
|
235
|
-
name: 'Working',
|
245
|
+
name: l('Working'),
|
236
246
|
value: 'working'
|
237
247
|
}, {
|
238
|
-
name: 'Not working',
|
248
|
+
name: l('Not working'),
|
239
249
|
value: 'not-working'
|
240
250
|
}, {
|
241
|
-
name: 'On a break',
|
251
|
+
name: l('On a break'),
|
242
252
|
value: 'break'
|
243
253
|
}, {
|
244
|
-
name: 'Scheduled',
|
254
|
+
name: l('Scheduled'),
|
245
255
|
value: 'pending'
|
246
256
|
}, {
|
247
|
-
name: 'Rescheduled',
|
257
|
+
name: l('Rescheduled'),
|
248
258
|
value: 'rescheduled'
|
249
259
|
}, {
|
250
|
-
name: 'Cancelled',
|
260
|
+
name: l('Cancelled'),
|
251
261
|
value: 'canceled'
|
252
262
|
}, {
|
253
|
-
name: 'Other',
|
263
|
+
name: l('Other'),
|
254
264
|
value: 'other'
|
255
265
|
}];
|
256
266
|
}, []);
|
@@ -320,8 +330,8 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
320
330
|
}, []);
|
321
331
|
const viewOptions = React.useMemo(() => {
|
322
332
|
return viewsProps?.map(item => ({
|
323
|
-
name: capitalize(item),
|
324
|
-
value: item
|
333
|
+
name: capitalize(item?.name),
|
334
|
+
value: item?.value
|
325
335
|
}));
|
326
336
|
}, [viewsProps]);
|
327
337
|
const days = React.useMemo(() => {
|
@@ -393,14 +403,14 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
393
403
|
}));
|
394
404
|
}) : /*#__PURE__*/React.createElement(Type, {
|
395
405
|
version: "b2"
|
396
|
-
},
|
406
|
+
}, l('No information for this day'))));
|
397
407
|
}));
|
398
408
|
};
|
399
409
|
const simpleExceptionsUI = () => {
|
400
410
|
const items = times.flatMap(item => getDatesWeek(item));
|
401
411
|
if (!items.length) return /*#__PURE__*/React.createElement(Type, {
|
402
412
|
version: "b1"
|
403
|
-
},
|
413
|
+
}, l('No exceptions this week'));
|
404
414
|
return /*#__PURE__*/React.createElement(React.Fragment, null, items.map((itemValue, index) => {
|
405
415
|
const day = set(index + 1, 'dayWeek');
|
406
416
|
const itemValueFrom = new OnesyDate(itemValue.from);
|
@@ -496,18 +506,18 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
496
506
|
size: "small",
|
497
507
|
onClick: onToday,
|
498
508
|
selected: now.days === date.days
|
499
|
-
},
|
509
|
+
}, l('Today')), /*#__PURE__*/React.createElement(Line, {
|
500
510
|
gap: 0,
|
501
511
|
direction: "row",
|
502
512
|
align: "center"
|
503
513
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
504
|
-
name:
|
514
|
+
name: `${l('Previous')} ${view}`
|
505
515
|
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
506
516
|
onClick: onPrevious
|
507
517
|
}, IconButtonProps), /*#__PURE__*/React.createElement(IconPrevious, {
|
508
518
|
size: "regular"
|
509
519
|
}))), /*#__PURE__*/React.createElement(Tooltip, {
|
510
|
-
name:
|
520
|
+
name: `${l('Next')} ${view}`
|
511
521
|
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
512
522
|
onClick: onNext
|
513
523
|
}, IconButtonProps), /*#__PURE__*/React.createElement(IconNext, {
|
@@ -525,8 +535,8 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
525
535
|
}, startRight, ['week', 'day'].includes(view) && /*#__PURE__*/React.createElement(Label, {
|
526
536
|
checked: displayTime,
|
527
537
|
onChange: onChangeDisplayTime
|
528
|
-
}, /*#__PURE__*/React.createElement(Switch, null),
|
529
|
-
name:
|
538
|
+
}, /*#__PURE__*/React.createElement(Switch, null), l('Display time')), /*#__PURE__*/React.createElement(Select, {
|
539
|
+
name: l('View'),
|
530
540
|
value: view,
|
531
541
|
onChange: onChangeView,
|
532
542
|
options: viewOptions,
|
@@ -562,7 +572,7 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
562
572
|
gap: 1.5
|
563
573
|
}, /*#__PURE__*/React.createElement(Type, {
|
564
574
|
version: "t2"
|
565
|
-
},
|
575
|
+
}, l('Exceptions this week')), /*#__PURE__*/React.createElement(Line, {
|
566
576
|
gap: 1
|
567
577
|
}, simpleExceptionsUI())))), ['week', 'day'].includes(view) && /*#__PURE__*/React.createElement(CalendarWeek, _extends({
|
568
578
|
onOpen: onOpen,
|
@@ -603,21 +613,21 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
603
613
|
direction: "row",
|
604
614
|
align: "center"
|
605
615
|
}, startRightModal, onUpdate && /*#__PURE__*/React.createElement(Tooltip, {
|
606
|
-
name:
|
616
|
+
name: l('Update')
|
607
617
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
608
618
|
onClick: () => {
|
609
619
|
onUpdate(modal?.object);
|
610
620
|
onClose();
|
611
621
|
}
|
612
622
|
}, /*#__PURE__*/React.createElement(IconEdit, IconProps))), onRemove && /*#__PURE__*/React.createElement(Tooltip, {
|
613
|
-
name:
|
623
|
+
name: l('Remove')
|
614
624
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
615
625
|
onClick: () => {
|
616
626
|
onRemove(modal?.object);
|
617
627
|
onClose();
|
618
628
|
}
|
619
629
|
}, /*#__PURE__*/React.createElement(IconRemove, IconProps))), /*#__PURE__*/React.createElement(Tooltip, {
|
620
|
-
name:
|
630
|
+
name: l('Close')
|
621
631
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
622
632
|
onClick: onClose
|
623
633
|
}, /*#__PURE__*/React.createElement(IconClose, IconProps))), endRightModal)), /*#__PURE__*/React.createElement(ModalMain, {
|
@@ -100,6 +100,7 @@ const useStyle = style(theme => ({
|
|
100
100
|
});
|
101
101
|
const CalendarMenu = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
102
102
|
const theme = useOnesyTheme();
|
103
|
+
const l = theme.l;
|
103
104
|
const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyCalendarAvailability?.props?.default), props_), [props_]);
|
104
105
|
const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
|
105
106
|
const Menu = React.useMemo(() => theme?.elements?.Menu || MenuElement, [theme]);
|
@@ -185,19 +186,19 @@ const CalendarMenu = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
185
186
|
size: 'regular'
|
186
187
|
};
|
187
188
|
const shortcuts = [{
|
188
|
-
name: 'Today',
|
189
|
+
name: l('Today'),
|
189
190
|
onClick: () => onChangeDate(new OnesyDate()),
|
190
191
|
icon: /*#__PURE__*/React.createElement(IconMaterialWbSunnyRounded, iconProps)
|
191
192
|
}, {
|
192
|
-
name: 'Tomorrow',
|
193
|
+
name: l('Tomorrow'),
|
193
194
|
onClick: () => onChangeDate(add(1, 'day')),
|
194
195
|
icon: /*#__PURE__*/React.createElement(IconMaterialWbTwilightRounded, iconProps)
|
195
196
|
}, {
|
196
|
-
name: '7 days',
|
197
|
+
name: l('7 days'),
|
197
198
|
onClick: () => onChangeDate(add(7, 'day')),
|
198
199
|
icon: /*#__PURE__*/React.createElement(IconMaterialCounter7Rounded, iconProps)
|
199
200
|
}, {
|
200
|
-
name: '1 month',
|
201
|
+
name: l('1 month'),
|
201
202
|
onClick: () => onChangeDate(add(1, 'month')),
|
202
203
|
icon: /*#__PURE__*/React.createElement(IconMaterialCalendarMonthRounded, iconProps)
|
203
204
|
}];
|
@@ -344,8 +345,8 @@ const CalendarMenu = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
344
345
|
version: "text",
|
345
346
|
size: "small",
|
346
347
|
disabled: !value?.[dateProperty]
|
347
|
-
},
|
348
|
-
name:
|
348
|
+
}, l('Clear')), !noRemove && /*#__PURE__*/React.createElement(Tooltip, {
|
349
|
+
name: l('Remove')
|
349
350
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
350
351
|
size: "small",
|
351
352
|
onClick: onRemove
|
@@ -178,6 +178,7 @@ const useStyle = style(theme => ({
|
|
178
178
|
});
|
179
179
|
const CalendarMonth = /*#__PURE__*/React.forwardRef((props__, ref) => {
|
180
180
|
const theme = useOnesyTheme();
|
181
|
+
const l = theme.l;
|
181
182
|
const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyCalendarMonth?.props?.default), props__), [props__]);
|
182
183
|
const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
|
183
184
|
const Surface = React.useMemo(() => theme?.elements?.Surface || SurfaceElement, [theme]);
|
@@ -310,13 +311,13 @@ const CalendarMonth = /*#__PURE__*/React.forwardRef((props__, ref) => {
|
|
310
311
|
if (weekStartDay === 'Monday') dayNames.push(7);else dayNames.unshift(7);
|
311
312
|
const renderDayNameMethod = is('function', renderDayName) ? renderDayName : order_ => {
|
312
313
|
const values = {
|
313
|
-
1: dayNamesFull ? 'Monday' : '
|
314
|
-
2: dayNamesFull ? 'Tuesday' : '
|
315
|
-
3: dayNamesFull ? 'Wednesday' : '
|
316
|
-
4: dayNamesFull ? 'Thursday' : '
|
317
|
-
5: dayNamesFull ? 'Friday' : '
|
318
|
-
6: dayNamesFull ? 'Saturday' : '
|
319
|
-
7: dayNamesFull ? 'Sunday' : '
|
314
|
+
1: dayNamesFull ? l('Monday') : l('Mo'),
|
315
|
+
2: dayNamesFull ? l('Tuesday') : l('Tu'),
|
316
|
+
3: dayNamesFull ? l('Wednesday') : l('We'),
|
317
|
+
4: dayNamesFull ? l('Thursday') : l('Th'),
|
318
|
+
5: dayNamesFull ? l('Friday') : l('Fr'),
|
319
|
+
6: dayNamesFull ? l('Saturday') : l('Sa'),
|
320
|
+
7: dayNamesFull ? l('Sunday') : l('Su')
|
320
321
|
};
|
321
322
|
return values[order_];
|
322
323
|
};
|