@onesy/ui-react 1.0.74 → 1.0.75
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/Calendar/Calendar.js +4 -4
- package/CalendarAvailability/CalendarAvailability.js +7 -7
- package/CalendarMenu/CalendarMenu.js +2 -2
- package/CalendarMonth/CalendarMonth.js +1 -1
- package/CalendarViews/CalendarViews.js +4 -4
- package/CalendarWeek/CalendarWeek.js +7 -6
- package/DatePicker/DatePicker.js +3 -3
- package/Watch/Watch.js +3 -2
- package/esm/Calendar/Calendar.js +16 -4
- package/esm/CalendarAvailability/CalendarAvailability.js +34 -8
- package/esm/CalendarMenu/CalendarMenu.js +6 -2
- package/esm/CalendarMonth/CalendarMonth.js +3 -1
- package/esm/CalendarViews/CalendarViews.js +14 -4
- package/esm/CalendarWeek/CalendarWeek.js +21 -6
- package/esm/DatePicker/DatePicker.js +23 -3
- package/esm/Watch/Watch.js +10 -3
- package/esm/index.js +1 -1
- package/package.json +3 -3
package/Calendar/Calendar.js
CHANGED
@@ -289,7 +289,7 @@ const Calendar = react_1.default.forwardRef((props__, ref) => {
|
|
289
289
|
classes.carousel_item
|
290
290
|
]) }, { children: [(0, jsx_runtime_1.jsxs)(Type, Object.assign({ version: size === 'large' ? 'l1' : size === 'regular' ? 'l2' : 'l3', className: (0, style_react_1.classNames)([
|
291
291
|
classes.carousel_item_label
|
292
|
-
]) }, { children: [(0, date_1.format)(calendarOnesyDate, 'MMMM'), " ", (0, date_1.format)(calendarOnesyDate, 'YYYY')] })), (0, jsx_runtime_1.jsx)(CalendarMonth, Object.assign({ color: 'default', value: value, calendar: calendarOnesyDate, valid: valid, now: now, size: size, range: range, offset: index, min: min, max: max, validate: validate, outside: false, noTransition: true }, calendarMonthProps, { onChange: onCalendarMonthChange, onChangeCalendar: onCalendarMonthChangeCalendar, TransitionProps: {
|
292
|
+
]) }, { children: [(0, date_1.format)(calendarOnesyDate, 'MMMM', { l }), " ", (0, date_1.format)(calendarOnesyDate, 'YYYY', { l })] })), (0, jsx_runtime_1.jsx)(CalendarMonth, Object.assign({ color: 'default', value: value, calendar: calendarOnesyDate, valid: valid, now: now, size: size, range: range, offset: index, min: min, max: max, validate: validate, outside: false, noTransition: true }, calendarMonthProps, { onChange: onCalendarMonthChange, onChangeCalendar: onCalendarMonthChangeCalendar, TransitionProps: {
|
293
293
|
onTransition
|
294
294
|
}, className: (0, style_react_1.classNames)([
|
295
295
|
(0, utils_2.staticClassName)('Calendar', theme) && [
|
@@ -322,7 +322,7 @@ const Calendar = react_1.default.forwardRef((props__, ref) => {
|
|
322
322
|
width: '100%'
|
323
323
|
} }, { children: [calendars > 1 && ((0, jsx_runtime_1.jsx)(Type, Object.assign({ version: size === 'large' ? 'l1' : size === 'regular' ? 'l2' : 'l3', style: {
|
324
324
|
paddingInlineStart: '16px'
|
325
|
-
} }, { children:
|
325
|
+
} }, { children: (0, date_1.format)(calendarOnesyDate, 'MMMM', { l }) }))), (0, jsx_runtime_1.jsx)(CalendarMonth, Object.assign({ color: 'default', value: value, calendar: calendarOnesyDate, valid: valid, now: now, size: size, range: range, offset: index, min: min, max: max, validate: validate }, calendarMonthProps, { onChange: onCalendarMonthChange, onChangeCalendar: onCalendarMonthChangeCalendar, TransitionProps: {
|
326
326
|
onTransition
|
327
327
|
}, className: (0, style_react_1.classNames)([
|
328
328
|
(0, utils_2.staticClassName)('Calendar', theme) && [
|
@@ -398,7 +398,7 @@ const Calendar = react_1.default.forwardRef((props__, ref) => {
|
|
398
398
|
],
|
399
399
|
optionButtonProps === null || optionButtonProps === void 0 ? void 0 : optionButtonProps.className,
|
400
400
|
classes.option
|
401
|
-
]) }, { children: [(0, date_1.format)(calendar, 'MMMM'), " ", (0, date_1.format)(calendar, 'YYYY')] })), (0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0, direction: 'row', align: 'center' }, { children: [(0, jsx_runtime_1.jsx)(Fade, Object.assign({ in: !open }, { children: (0, jsx_runtime_1.jsx)(IconButton, Object.assign({ tonal: tonal, color: 'inherit', size: size, onClick: () => move(false, menu_month_previous_unit || 'month'), "aria-label": l('Previous month'), disabled: !!(open || (+year === 1970 && month === 'Jan')) }, { children: (0, jsx_runtime_1.jsx)(IconPrevious, { size: size }) })) })), (0, jsx_runtime_1.jsx)(Fade, Object.assign({ in: !open }, { children: (0, jsx_runtime_1.jsx)(IconButton, Object.assign({ tonal: tonal, color: 'inherit', size: size, onClick: () => move(true, menu_month_next_unit || 'month'), "aria-label": l('Next month'), disabled: !!(open || (+year === 2099 && month === 'Dec')) }, { children: (0, jsx_runtime_1.jsx)(IconNext, { size: size }) })) }))] }))] }) })), !open && ((0, jsx_runtime_1.jsx)(Fade, Object.assign({ in: true }, { children: main() }))), open && ((0, jsx_runtime_1.jsx)(Divider, { tonal: false, className: (0, style_react_1.classNames)([
|
401
|
+
]) }, { children: [(0, date_1.format)(calendar, 'MMMM', { l }), " ", (0, date_1.format)(calendar, 'YYYY', { l })] })), (0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0, direction: 'row', align: 'center' }, { children: [(0, jsx_runtime_1.jsx)(Fade, Object.assign({ in: !open }, { children: (0, jsx_runtime_1.jsx)(IconButton, Object.assign({ tonal: tonal, color: 'inherit', size: size, onClick: () => move(false, menu_month_previous_unit || 'month'), "aria-label": l('Previous month'), disabled: !!(open || (+year === 1970 && month === 'Jan')) }, { children: (0, jsx_runtime_1.jsx)(IconPrevious, { size: size }) })) })), (0, jsx_runtime_1.jsx)(Fade, Object.assign({ in: !open }, { children: (0, jsx_runtime_1.jsx)(IconButton, Object.assign({ tonal: tonal, color: 'inherit', size: size, onClick: () => move(true, menu_month_next_unit || 'month'), "aria-label": l('Next month'), disabled: !!(open || (+year === 2099 && month === 'Dec')) }, { children: (0, jsx_runtime_1.jsx)(IconNext, { size: size }) })) }))] }))] }) })), !open && ((0, jsx_runtime_1.jsx)(Fade, Object.assign({ in: true }, { children: main() }))), open && ((0, jsx_runtime_1.jsx)(Divider, { tonal: false, className: (0, style_react_1.classNames)([
|
402
402
|
(0, utils_2.staticClassName)('Calendar', theme) && [
|
403
403
|
'onesy-Calendar-divider'
|
404
404
|
],
|
@@ -411,7 +411,7 @@ const Calendar = react_1.default.forwardRef((props__, ref) => {
|
|
411
411
|
]) }, { children: getMonths(value, calendar, props).map((item, index) => {
|
412
412
|
const onesyDate = item.value;
|
413
413
|
const selected = calendar.month === onesyDate.month;
|
414
|
-
return ((0, jsx_runtime_1.jsx)(ListItem, { onClick: () => onUpdateCalendarOption(onesyDate), primary:
|
414
|
+
return ((0, jsx_runtime_1.jsx)(ListItem, { onClick: () => onUpdateCalendarOption(onesyDate), primary: (0, date_1.format)(onesyDate, 'MMMM', { l }), inset: !selected, startAlign: 'center', size: size, start: selected ? ((0, jsx_runtime_1.jsx)(Buttons_1.IconDoneAnimated, { in: true, add: true, simple: true, size: size })) : undefined, disabled: (!valid(onesyDate, 'month')), selected: selected, button: true, PrimaryProps: {
|
415
415
|
version: size === 'regular' ? 'b2' : size === 'small' ? 'b3' : 'b1'
|
416
416
|
}, "data-value": index, className: (0, style_react_1.classNames)([
|
417
417
|
(0, utils_2.staticClassName)('Calendar', theme) && [
|
@@ -311,15 +311,15 @@ const CalendarAvailability = react_1.default.forwardRef((props_, ref) => {
|
|
311
311
|
}, className: classes.simpleTimes, fullWidth: true }, { children: days.map((itemDay, index) => {
|
312
312
|
const values = times.filter(item => { var _a; return (_a = item.weekly.days[index + 1]) === null || _a === void 0 ? void 0 : _a.active; }).flatMap(item => item.weekly.days[index + 1].values).filter(item => item && [undefined, true].includes(refs.statuses.current[item.status || 'working']));
|
313
313
|
values.sort((a, b) => b.from > a.from ? -1 : 1);
|
314
|
-
return ((0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 1.5, direction: 'column' }, { children: [(0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0, align: 'center', fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'h3', weight: 400 }, { children: (0, date_1.format)(itemDay, 'dd') })), (0, jsx_runtime_1.jsx)(Line, Object.assign({ align: 'center', justify: 'center', className: (0, style_react_1.classNames)([
|
314
|
+
return ((0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 1.5, direction: 'column' }, { children: [(0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0, align: 'center', fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'h3', weight: 400 }, { children: (0, date_1.format)(itemDay, 'dd', { l }) })), (0, jsx_runtime_1.jsx)(Line, Object.assign({ align: 'center', justify: 'center', className: (0, style_react_1.classNames)([
|
315
315
|
classes.weekDay,
|
316
316
|
itemDay.year === now.year && itemDay.dayYear === now.dayYear && classes.today
|
317
|
-
]) }, { children: (0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'b2', weight: 200 }, { children: (0, date_1.format)(itemDay, 'DD.MM.') })) }))] })), (0, jsx_runtime_1.jsx)(Line, Object.assign({ gap: 2, fullWidth: true }, { children: !!values.length ? values.map((itemValue, indexItem) => {
|
317
|
+
]) }, { children: (0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'b2', weight: 200 }, { children: (0, date_1.format)(itemDay, 'DD.MM.', { l }) })) }))] })), (0, jsx_runtime_1.jsx)(Line, Object.assign({ gap: 2, fullWidth: true }, { children: !!values.length ? values.map((itemValue, indexItem) => {
|
318
318
|
const itemValueFrom = new date_1.OnesyDate(itemValue.from);
|
319
319
|
const itemValueTo = new date_1.OnesyDate(itemValue.to);
|
320
320
|
return ((0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0.5, className: classes.dayWeekSimple }, { children: [(0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 1, direction: 'row', align: 'center' }, { children: [(0, jsx_runtime_1.jsx)(Line, { className: classes.palettePreview, style: {
|
321
321
|
background: getColor(itemValue)
|
322
|
-
} }), (0, jsx_runtime_1.jsxs)(Type, Object.assign({ version: 'b2', weight: 300 }, { children: [(0, date_1.format)(itemValueFrom, 'hh:mm a'), " \u2014 ", (0, date_1.format)(itemValueTo, 'hh:mm a')] }))] })), itemValue.description && ((0, jsx_runtime_1.jsx)(Type, { version: 'b2', weight: 200, whiteSpace: 'pre-wrap', className: (0, style_react_1.classNames)([
|
322
|
+
} }), (0, jsx_runtime_1.jsxs)(Type, Object.assign({ version: 'b2', weight: 300 }, { children: [(0, date_1.format)(itemValueFrom, 'hh:mm a', { l }), " \u2014 ", (0, date_1.format)(itemValueTo, 'hh:mm a', { l })] }))] })), itemValue.description && ((0, jsx_runtime_1.jsx)(Type, { version: 'b2', weight: 200, whiteSpace: 'pre-wrap', className: (0, style_react_1.classNames)([
|
323
323
|
classes.timeDescription,
|
324
324
|
!refs.displayTime.current && 'onesy-work-day-time'
|
325
325
|
]), dangerouslySetInnerHTML: {
|
@@ -338,7 +338,7 @@ const CalendarAvailability = react_1.default.forwardRef((props_, ref) => {
|
|
338
338
|
const itemValueTo = new date_1.OnesyDate(itemValue.to);
|
339
339
|
return ((0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 1, direction: 'column' }, { children: [(0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 1, direction: 'row', align: 'center', fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(Line, { className: classes.palettePreview, style: {
|
340
340
|
background: getColor(itemValue)
|
341
|
-
} }), (0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 1, direction: 'row', align: 'center' }, { children: [(0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'b2', weight: 400 }, { children: (0, date_1.format)(day, 'dd') })), (0, jsx_runtime_1.jsxs)(Type, Object.assign({ version: 'b2' }, { children: [(0, date_1.format)(itemValueFrom, utils_2.formats.entire), " \u2014 ", (0, date_1.format)(itemValueTo, utils_2.formats.entire)] }))] }))] })), itemValue.description && ((0, jsx_runtime_1.jsx)(Type, { version: 'b2', weight: 200, whiteSpace: 'pre-wrap', className: (0, style_react_1.classNames)([
|
341
|
+
} }), (0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 1, direction: 'row', align: 'center' }, { children: [(0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'b2', weight: 400 }, { children: (0, date_1.format)(day, 'dd', { l }) })), (0, jsx_runtime_1.jsxs)(Type, Object.assign({ version: 'b2' }, { children: [(0, date_1.format)(itemValueFrom, utils_2.formats.entire, { l }), " \u2014 ", (0, date_1.format)(itemValueTo, utils_2.formats.entire, { l })] }))] }))] })), itemValue.description && ((0, jsx_runtime_1.jsx)(Type, { version: 'b2', weight: 200, whiteSpace: 'pre-wrap', className: (0, style_react_1.classNames)([
|
342
342
|
classes.timeDescription,
|
343
343
|
!refs.displayTime.current && 'onesy-work-day-time'
|
344
344
|
]), dangerouslySetInnerHTML: {
|
@@ -348,9 +348,9 @@ const CalendarAvailability = react_1.default.forwardRef((props_, ref) => {
|
|
348
348
|
};
|
349
349
|
const formattedDate = react_1.default.useMemo(() => {
|
350
350
|
if (view === 'day')
|
351
|
-
return (0, date_1.format)(date, `MMMM DD, YYYY
|
351
|
+
return (0, date_1.format)(date, `MMMM DD, YYYY`, { l });
|
352
352
|
if (['week', 'simple'].includes(view))
|
353
|
-
return `${(0, date_1.format)((0, date_1.startOf)(date, 'week'), `MMM DD, YYYY
|
353
|
+
return `${(0, date_1.format)((0, date_1.startOf)(date, 'week'), `MMM DD, YYYY`, { l })} – ${(0, date_1.format)((0, date_1.endOf)(date, 'week'), `MMM DD, YYYY`, { l })}`;
|
354
354
|
}, [view, date]);
|
355
355
|
const legend = react_1.default.useMemo(() => {
|
356
356
|
return ((0, jsx_runtime_1.jsx)(Line, Object.assign({ rowGap: 1.5, direction: 'row', align: 'center', className: classes.legend }, { children: optionsStatus.map((item, index) => ((0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 1, direction: 'row', align: 'center', onClick: () => onStatusToggle(item.value), flexNo: true, className: (0, style_react_1.classNames)([
|
@@ -397,7 +397,7 @@ const CalendarAvailability = react_1.default.forwardRef((props_, ref) => {
|
|
397
397
|
} }, { children: (0, jsx_runtime_1.jsx)(IconEdit, Object.assign({}, IconProps)) })) }))), onRemove && ((0, jsx_runtime_1.jsx)(Tooltip, Object.assign({ name: l('Remove') }, { children: (0, jsx_runtime_1.jsx)(IconButton, Object.assign({ onClick: () => {
|
398
398
|
onRemove(modal === null || modal === void 0 ? void 0 : modal.object);
|
399
399
|
onClose();
|
400
|
-
} }, { children: (0, jsx_runtime_1.jsx)(IconRemove, Object.assign({}, IconProps)) })) }))), (0, jsx_runtime_1.jsx)(Tooltip, Object.assign({ name: l('Close') }, { children: (0, jsx_runtime_1.jsx)(IconButton, Object.assign({ onClick: onClose }, { children: (0, jsx_runtime_1.jsx)(IconClose, Object.assign({}, IconProps)) })) })), endRightModal] }))] })), (0, jsx_runtime_1.jsx)(ModalMain, Object.assign({ align: 'flex-start', className: classes.modalMain }, { children: (0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 1.5, fullWidth: true }, { children: [(0, jsx_runtime_1.jsxs)(Type, Object.assign({ version: 'l1', weight: 200 }, { children: [(0, date_1.format)(modal === null || modal === void 0 ? void 0 : modal.day, 'dd'), " ", (0, date_1.format)(new date_1.OnesyDate(modal === null || modal === void 0 ? void 0 : modal.from), (modal === null || modal === void 0 ? void 0 : modal.weekly) ? `hh:mm a` : utils_2.formats.entire), " \u2014 ", (0, date_1.format)(new date_1.OnesyDate(modal === null || modal === void 0 ? void 0 : modal.to), (modal === null || modal === void 0 ? void 0 : modal.weekly) ? `hh:mm a` : utils_2.formats.entire)] })), (modal === null || modal === void 0 ? void 0 : modal.description) && ((0, jsx_runtime_1.jsx)(Type, { version: 'b2', dangerouslySetInnerHTML: {
|
400
|
+
} }, { children: (0, jsx_runtime_1.jsx)(IconRemove, Object.assign({}, IconProps)) })) }))), (0, jsx_runtime_1.jsx)(Tooltip, Object.assign({ name: l('Close') }, { children: (0, jsx_runtime_1.jsx)(IconButton, Object.assign({ onClick: onClose }, { children: (0, jsx_runtime_1.jsx)(IconClose, Object.assign({}, IconProps)) })) })), endRightModal] }))] })), (0, jsx_runtime_1.jsx)(ModalMain, Object.assign({ align: 'flex-start', className: classes.modalMain }, { children: (0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 1.5, fullWidth: true }, { children: [(0, jsx_runtime_1.jsxs)(Type, Object.assign({ version: 'l1', weight: 200 }, { children: [(0, date_1.format)(modal === null || modal === void 0 ? void 0 : modal.day, 'dd', { l }), " ", (0, date_1.format)(new date_1.OnesyDate(modal === null || modal === void 0 ? void 0 : modal.from), (modal === null || modal === void 0 ? void 0 : modal.weekly) ? `hh:mm a` : utils_2.formats.entire, { l }), " \u2014 ", (0, date_1.format)(new date_1.OnesyDate(modal === null || modal === void 0 ? void 0 : modal.to), (modal === null || modal === void 0 ? void 0 : modal.weekly) ? `hh:mm a` : utils_2.formats.entire, { l })] })), (modal === null || modal === void 0 ? void 0 : modal.description) && ((0, jsx_runtime_1.jsx)(Type, { version: 'b2', dangerouslySetInnerHTML: {
|
401
401
|
__html: (0, utils_1.textToInnerHTML)(modal.description)
|
402
402
|
} }))] })) }))] })))] })));
|
403
403
|
});
|
@@ -278,7 +278,7 @@ const CalendarMenu = react_1.default.forwardRef((props_, ref) => {
|
|
278
278
|
'onesy-time'
|
279
279
|
]), style: {
|
280
280
|
width: (_a = refs.time.current) === null || _a === void 0 ? void 0 : _a.clientWidth
|
281
|
-
} }, { children: (0, jsx_runtime_1.jsx)(ListItem, { ref: refs.time, start: ((0, jsx_runtime_1.jsx)(IconMaterialScheduleW100_1.default, Object.assign({}, iconProps))), primary: ((0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'b2', color: 'inherit' }, { children: (0, date_1.format)(date, 'HH:mm') }))), startAlign: 'center', size: 'small', button: true, Component: 'div', className: classes.item }) }))), endBottom, (0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0.4, direction: 'row', align: 'center', justify: 'space-between', fullWidth: true, className: classes.menuFooter }, { children: [(0, jsx_runtime_1.jsx)(Button, Object.assign({ onClick: onClear, version: 'text', size: 'small', disabled: !(value === null || value === void 0 ? void 0 : value[dateProperty]) }, { children: l('Clear') })), !noRemove && ((0, jsx_runtime_1.jsx)(Tooltip, Object.assign({ name: l('Remove') }, { children: (0, jsx_runtime_1.jsx)(IconButton, Object.assign({ size: 'small', onClick: onRemove }, { children: (0, jsx_runtime_1.jsx)(IconMaterialDeleteW100_1.default, Object.assign({}, iconProps)) })) })))] }))] }))), CalendarMonthProps: {
|
281
|
+
} }, { children: (0, jsx_runtime_1.jsx)(ListItem, { ref: refs.time, start: ((0, jsx_runtime_1.jsx)(IconMaterialScheduleW100_1.default, Object.assign({}, iconProps))), primary: ((0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'b2', color: 'inherit' }, { children: (0, date_1.format)(date, 'HH:mm', { l }) }))), startAlign: 'center', size: 'small', button: true, Component: 'div', className: classes.item }) }))), endBottom, (0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0.4, direction: 'row', align: 'center', justify: 'space-between', fullWidth: true, className: classes.menuFooter }, { children: [(0, jsx_runtime_1.jsx)(Button, Object.assign({ onClick: onClear, version: 'text', size: 'small', disabled: !(value === null || value === void 0 ? void 0 : value[dateProperty]) }, { children: l('Clear') })), !noRemove && ((0, jsx_runtime_1.jsx)(Tooltip, Object.assign({ name: l('Remove') }, { children: (0, jsx_runtime_1.jsx)(IconButton, Object.assign({ size: 'small', onClick: onRemove }, { children: (0, jsx_runtime_1.jsx)(IconMaterialDeleteW100_1.default, Object.assign({}, iconProps)) })) })))] }))] }))), CalendarMonthProps: {
|
282
282
|
renderDay: (dayOnesyDate, propsDay, day, outside) => {
|
283
283
|
const repeating = repeats(dayOnesyDate);
|
284
284
|
return ((0, jsx_runtime_1.jsx)(PaginationItem, Object.assign({ tonal: true, color: 'inherit', size: 'small', InteractionProps: {
|
@@ -286,7 +286,7 @@ const CalendarMenu = react_1.default.forwardRef((props_, ref) => {
|
|
286
286
|
}, TypeProps: {
|
287
287
|
version: 'b3',
|
288
288
|
priority: !day.selected ? !day.weekend ? 'primary' : 'secondary' : undefined
|
289
|
-
}, "aria-label": (0, date_1.format)(dayOnesyDate, 'DD-MM-YYYY'), className: (0, style_react_1.classNames)([
|
289
|
+
}, "aria-label": (0, date_1.format)(dayOnesyDate, 'DD-MM-YYYY', { l }), className: (0, style_react_1.classNames)([
|
290
290
|
classes.dayValue,
|
291
291
|
repeating && classes.dayValueRepeating
|
292
292
|
]), style: Object.assign(Object.assign({}, (day.today ? {
|
@@ -464,7 +464,7 @@ const CalendarMonth = react_1.default.forwardRef((props__, ref) => {
|
|
464
464
|
}, TypeProps: {
|
465
465
|
version: size === 'large' ? 'b1' : size === 'regular' ? 'b2' : 'b3',
|
466
466
|
priority: !day.selected ? !day.weekend ? 'primary' : 'secondary' : undefined
|
467
|
-
}, "aria-label": (0, date_1.format)(day.onesyDate, 'DD-MM-YYYY') }, PaginationItemProps, { className: (0, style_react_1.classNames)([
|
467
|
+
}, "aria-label": (0, date_1.format)(day.onesyDate, 'DD-MM-YYYY', { l }) }, PaginationItemProps, { className: (0, style_react_1.classNames)([
|
468
468
|
(0, utils_2.staticClassName)('CalendarMonth', theme) && [
|
469
469
|
'onesy-CalendarMonth-day-value',
|
470
470
|
day.in && 'onesy-CalendarMonth-day-in',
|
@@ -166,11 +166,11 @@ const CalendarViews = react_1.default.forwardRef((props_, ref) => {
|
|
166
166
|
}, [viewsProps]);
|
167
167
|
const formattedDate = react_1.default.useMemo(() => {
|
168
168
|
if (view === 'day')
|
169
|
-
return (0, date_1.format)(date, `MMMM DD, YYYY
|
169
|
+
return (0, date_1.format)(date, `MMMM DD, YYYY`, { l });
|
170
170
|
if (view === 'week')
|
171
|
-
return `${(0, date_1.format)((0, date_1.startOf)(date, 'week'), `MMM DD, YYYY
|
171
|
+
return `${(0, date_1.format)((0, date_1.startOf)(date, 'week'), `MMM DD, YYYY`, { l })} – ${(0, date_1.format)((0, date_1.endOf)(date, 'week'), `MMM DD, YYYY`, { l })}`;
|
172
172
|
if (view === 'month')
|
173
|
-
return (0, date_1.format)(date, `MMMM YYYY
|
173
|
+
return (0, date_1.format)(date, `MMMM YYYY`, { l });
|
174
174
|
}, [view, date]);
|
175
175
|
const onChangeView = react_1.default.useCallback((valueNew) => {
|
176
176
|
setView(valueNew);
|
@@ -205,7 +205,7 @@ const CalendarViews = react_1.default.forwardRef((props_, ref) => {
|
|
205
205
|
return ((0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0.5, direction: 'column', align: 'center', flex: true, fullWidth: true, className: classes.dayWrapper }, { children: [(0, jsx_runtime_1.jsx)(Line, Object.assign({ direction: 'row', justify: 'center', align: 'center', fullWidth: true, className: (0, style_react_1.classNames)([
|
206
206
|
classes.monthDay,
|
207
207
|
day.today && classes.today
|
208
|
-
]) }, { children: (0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'b2' }, { children: (0, date_1.format)(valueCalendarMonth, 'D') })) })), (0, jsx_runtime_1.jsx)(Line, Object.assign({ gap: 0.5, flex: true, fullWidth: true, className: classes.contentItemsMonth }, { children: (0, utils_1.is)('function', render) && render(valueCalendarMonth, view) }))] })));
|
208
|
+
]) }, { children: (0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'b2' }, { children: (0, date_1.format)(valueCalendarMonth, 'D', { l }) })) })), (0, jsx_runtime_1.jsx)(Line, Object.assign({ gap: 0.5, flex: true, fullWidth: true, className: classes.contentItemsMonth }, { children: (0, utils_1.is)('function', render) && render(valueCalendarMonth, view) }))] })));
|
209
209
|
}, [render, view]);
|
210
210
|
const renderDayName = react_1.default.useCallback((order) => {
|
211
211
|
const values = {
|
@@ -135,6 +135,7 @@ const useStyle = (0, style_react_1.style)(theme => ({
|
|
135
135
|
}), { name: 'onesy-CalendarWeek' });
|
136
136
|
const CalendarWeek = react_1.default.forwardRef((props_, ref) => {
|
137
137
|
const theme = (0, style_react_1.useOnesyTheme)();
|
138
|
+
const l = theme.l;
|
138
139
|
const props = react_1.default.useMemo(() => { var _a, _b, _c, _d, _e, _f, _g, _h; return (Object.assign(Object.assign(Object.assign({}, (_d = (_c = (_b = (_a = theme === null || theme === void 0 ? void 0 : theme.ui) === null || _a === void 0 ? void 0 : _a.elements) === null || _b === void 0 ? void 0 : _b.all) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.default), (_h = (_g = (_f = (_e = theme === null || theme === void 0 ? void 0 : theme.ui) === null || _e === void 0 ? void 0 : _e.elements) === null || _f === void 0 ? void 0 : _f.onesyCalendarWeek) === null || _g === void 0 ? void 0 : _g.props) === null || _h === void 0 ? void 0 : _h.default), props_)); }, [props_]);
|
139
140
|
const Line = react_1.default.useMemo(() => { var _a; return ((_a = theme === null || theme === void 0 ? void 0 : theme.elements) === null || _a === void 0 ? void 0 : _a.Line) || Line_1.default; }, [theme]);
|
140
141
|
const Type = react_1.default.useMemo(() => { var _a; return ((_a = theme === null || theme === void 0 ? void 0 : theme.elements) === null || _a === void 0 ? void 0 : _a.Type) || Type_1.default; }, [theme]);
|
@@ -314,7 +315,7 @@ const CalendarWeek = react_1.default.forwardRef((props_, ref) => {
|
|
314
315
|
}));
|
315
316
|
const elementRendered = (0, utils_1.is)('function', render) ? render(item, dayProp ? 'day' : 'week') : ((0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0.5, align: 'center', justify: 'center' }, itemProps, { children: [!minimal && refs.displayTime.current && ((0, jsx_runtime_1.jsxs)(Type, Object.assign({ version: 'l2', weight: 300, align: 'center', className: classes.time, style: {
|
316
317
|
background: getColor(item)
|
317
|
-
} }, { children: [(0, date_1.format)(from, 'hh:mm a'), " - ", renderTo((0, date_1.format)(to, 'hh:mm a'))] }))), item.description && ((0, jsx_runtime_1.jsx)(Type, { version: 'b2', dangerouslySetInnerHTML: {
|
318
|
+
} }, { children: [(0, date_1.format)(from, 'hh:mm a', { l }), " - ", renderTo((0, date_1.format)(to, 'hh:mm a', { l }))] }))), item.description && ((0, jsx_runtime_1.jsx)(Type, { version: 'b2', dangerouslySetInnerHTML: {
|
318
319
|
__html: (0, utils_1.textToInnerHTML)(item.description)
|
319
320
|
}, style: {
|
320
321
|
maxHeight: 24,
|
@@ -365,13 +366,13 @@ const CalendarWeek = react_1.default.forwardRef((props_, ref) => {
|
|
365
366
|
classes.hours
|
366
367
|
]) }, { children: [(0, jsx_runtime_1.jsx)(Line, { className: classes.dayHeader }), (0, jsx_runtime_1.jsx)(Line, Object.assign({ gap: 0, flex: true, fullWidth: true, className: classes.hourWrapper }, { children: hours.map((itemHour, index) => ((0, jsx_runtime_1.jsx)(Line, Object.assign({ gap: 1, align: 'unset', className: classes.hour, style: {
|
367
368
|
top: `${(100 / 24) * index}%`
|
368
|
-
} }, { children: (0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'b3', whiteSpace: 'nowrap' }, { children: (0, date_1.format)(itemHour, 'h A') })) }), index))) }))] })), dayProp && ((0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0, direction: 'column', align: 'center', flex: true, className: (0, style_react_1.classNames)([
|
369
|
+
} }, { children: (0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'b3', whiteSpace: 'nowrap' }, { children: (0, date_1.format)(itemHour, 'h A', { l }) })) }), index))) }))] })), dayProp && ((0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0, direction: 'column', align: 'center', flex: true, className: (0, style_react_1.classNames)([
|
369
370
|
'onesy-day',
|
370
371
|
classes.day
|
371
|
-
]) }, { children: [(0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0, align: 'center', fullWidth: true, className: classes.dayHeader }, { children: [(0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'l1', weight: 200 }, { children: (0, date_1.format)(date, 'd') })), (0, jsx_runtime_1.jsx)(Line, Object.assign({ align: 'center', justify: 'center', className: (0, style_react_1.classNames)([
|
372
|
+
]) }, { children: [(0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0, align: 'center', fullWidth: true, className: classes.dayHeader }, { children: [(0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'l1', weight: 200 }, { children: (0, date_1.format)(date, 'd', { l }) })), (0, jsx_runtime_1.jsx)(Line, Object.assign({ align: 'center', justify: 'center', className: (0, style_react_1.classNames)([
|
372
373
|
classes.weekDay,
|
373
374
|
date.year === now.year && date.dayYear === now.dayYear && classes.today
|
374
|
-
]) }, { children: (0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'h3', weight: 400, align: 'center' }, { children: (0, date_1.format)(date, 'D') })) }))] })), (0, jsx_runtime_1.jsxs)(Line, Object.assign({ className: classes.dayBody, flex: true, fullWidth: true, onClick: (event) => onTimeClickMethod(date, event) }, { children: [timesUI(date), hours.map((itemGuide, indexGuide) => ((0, jsx_runtime_1.jsx)(Line, { className: classes.guide, fullWidth: true, style: {
|
375
|
+
]) }, { children: (0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'h3', weight: 400, align: 'center' }, { children: (0, date_1.format)(date, 'D', { l }) })) }))] })), (0, jsx_runtime_1.jsxs)(Line, Object.assign({ className: classes.dayBody, flex: true, fullWidth: true, onClick: (event) => onTimeClickMethod(date, event) }, { children: [timesUI(date), hours.map((itemGuide, indexGuide) => ((0, jsx_runtime_1.jsx)(Line, { className: classes.guide, fullWidth: true, style: {
|
375
376
|
top: `${(100 / 24) * indexGuide}%`
|
376
377
|
} }, indexGuide))), ((0, date_1.format)(now, utils_2.formats.date) === (0, date_1.format)(date, utils_2.formats.date)) && ((0, jsx_runtime_1.jsx)(Line, { className: classes.guidelineHour, fullWidth: true, style: {
|
377
378
|
top: `${(((now.hour * 60) + now.minute) / (24 * 60)) * 100}%`
|
@@ -379,10 +380,10 @@ const CalendarWeek = react_1.default.forwardRef((props_, ref) => {
|
|
379
380
|
return ((0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0, direction: 'column', align: 'center', flex: true, className: (0, style_react_1.classNames)([
|
380
381
|
'onesy-day',
|
381
382
|
classes.day
|
382
|
-
]) }, { children: [(0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0, align: 'center', fullWidth: true, className: classes.dayHeader }, { children: [(0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'l1', weight: 200 }, { children: (0, date_1.format)(itemDay, 'd') })), (0, jsx_runtime_1.jsx)(Line, Object.assign({ align: 'center', justify: 'center', className: (0, style_react_1.classNames)([
|
383
|
+
]) }, { children: [(0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0, align: 'center', fullWidth: true, className: classes.dayHeader }, { children: [(0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'l1', weight: 200 }, { children: (0, date_1.format)(itemDay, 'd', { l }) })), (0, jsx_runtime_1.jsx)(Line, Object.assign({ align: 'center', justify: 'center', className: (0, style_react_1.classNames)([
|
383
384
|
classes.weekDay,
|
384
385
|
itemDay.year === now.year && itemDay.dayYear === now.dayYear && classes.today
|
385
|
-
]) }, { children: (0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'h3', weight: 400, align: 'center' }, { children: (0, date_1.format)(itemDay, 'D') })) }))] })), (0, jsx_runtime_1.jsxs)(Line, Object.assign({ className: classes.dayBody, flex: true, fullWidth: true, onClick: (event) => onTimeClickMethod(itemDay, event) }, { children: [timesUI(itemDay), hours.map((itemGuide, indexGuide) => ((0, jsx_runtime_1.jsx)(Line, { className: classes.guide, fullWidth: true, style: {
|
386
|
+
]) }, { children: (0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'h3', weight: 400, align: 'center' }, { children: (0, date_1.format)(itemDay, 'D', { l }) })) }))] })), (0, jsx_runtime_1.jsxs)(Line, Object.assign({ className: classes.dayBody, flex: true, fullWidth: true, onClick: (event) => onTimeClickMethod(itemDay, event) }, { children: [timesUI(itemDay), hours.map((itemGuide, indexGuide) => ((0, jsx_runtime_1.jsx)(Line, { className: classes.guide, fullWidth: true, style: {
|
386
387
|
top: `${(100 / 24) * indexGuide}%`
|
387
388
|
} }, indexGuide))), ((0, date_1.format)(now, utils_2.formats.date) === (0, date_1.format)(itemDay, utils_2.formats.date)) && ((0, jsx_runtime_1.jsx)(Line, { className: classes.guidelineHour, fullWidth: true, style: {
|
388
389
|
top: `${(((now.hour * 60) + now.minute) / (24 * 60)) * 100}%`
|
package/DatePicker/DatePicker.js
CHANGED
@@ -176,7 +176,7 @@ const DatePicker = react_1.default.forwardRef((props__, ref) => {
|
|
176
176
|
const [from, to] = (0, utils_1.is)('array', valueNew) ? valueNew : [valueNew];
|
177
177
|
if (!(from || to))
|
178
178
|
return '';
|
179
|
-
const method = (item) => `${(0, date_1.format)(item, 'DD')}/${(0, date_1.format)(item, 'MM')}/${(0, date_1.format)(item, 'YYYY')}`;
|
179
|
+
const method = (item) => `${(0, date_1.format)(item, 'DD', { l })}/${(0, date_1.format)(item, 'MM', { l })}/${(0, date_1.format)(item, 'YYYY', { l })}`;
|
180
180
|
result += `${method(from)}`;
|
181
181
|
if (range && to)
|
182
182
|
result += `${exports.SEPARATOR}${method(to)}`;
|
@@ -439,9 +439,9 @@ const DatePicker = react_1.default.forwardRef((props__, ref) => {
|
|
439
439
|
if (!(readOnly || disabled))
|
440
440
|
moreProps.onClick = onOpen;
|
441
441
|
}
|
442
|
-
let textHeading = `${(0, date_1.format)(value[0], 'd')}, ${(0, date_1.format)(value[0], 'MMM')} ${(0, date_1.format)(value[0], 'DD')}`;
|
442
|
+
let textHeading = `${(0, date_1.format)(value[0], 'd', { l })}, ${(0, date_1.format)(value[0], 'MMM', { l })} ${(0, date_1.format)(value[0], 'DD', { l })}`;
|
443
443
|
if (range) {
|
444
|
-
textHeading = `${(0, date_1.format)(value[0], 'MMM')} ${(0, date_1.format)(value[0], 'DD')}${exports.SEPARATOR}${(0, date_1.format)(value[1], 'MMM')} ${(0, date_1.format)(value[1], 'DD')}`;
|
444
|
+
textHeading = `${(0, date_1.format)(value[0], 'MMM', { l })} ${(0, date_1.format)(value[0], 'DD', { l })}${exports.SEPARATOR}${(0, date_1.format)(value[1], 'MMM', { l })} ${(0, date_1.format)(value[1], 'DD', { l })}`;
|
445
445
|
}
|
446
446
|
const dayNames = [l('Mo'), l('Tu'), l('We'), l('Th'), l('Fr'), l('Sa'), l('Su')];
|
447
447
|
const mobile = ((0, jsx_runtime_1.jsxs)(Surface, Object.assign({ color: 'default', tonal: tonal, gap: 0, direction: 'column', Component: Line, className: (0, style_react_1.classNames)([
|
package/Watch/Watch.js
CHANGED
@@ -91,6 +91,7 @@ const useStyle = (0, style_react_1.style)(theme => ({
|
|
91
91
|
}), { name: 'onesy-Watch' });
|
92
92
|
const Watch = react_1.default.forwardRef((props_, ref) => {
|
93
93
|
const theme = (0, style_react_1.useOnesyTheme)();
|
94
|
+
const l = theme.l;
|
94
95
|
const props = react_1.default.useMemo(() => { var _a, _b, _c, _d, _e, _f, _g, _h; return (Object.assign(Object.assign(Object.assign({}, (_d = (_c = (_b = (_a = theme === null || theme === void 0 ? void 0 : theme.ui) === null || _a === void 0 ? void 0 : _a.elements) === null || _b === void 0 ? void 0 : _b.all) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.default), (_h = (_g = (_f = (_e = theme === null || theme === void 0 ? void 0 : theme.ui) === null || _e === void 0 ? void 0 : _e.elements) === null || _f === void 0 ? void 0 : _f.onesyWatch) === null || _g === void 0 ? void 0 : _g.props) === null || _h === void 0 ? void 0 : _h.default), props_)); }, [props_]);
|
95
96
|
const Line = react_1.default.useMemo(() => { var _a; return ((_a = theme === null || theme === void 0 ? void 0 : theme.elements) === null || _a === void 0 ? void 0 : _a.Line) || Line_1.default; }, [theme]);
|
96
97
|
const Path = react_1.default.useMemo(() => { var _a; return ((_a = theme === null || theme === void 0 ? void 0 : theme.elements) === null || _a === void 0 ? void 0 : _a.Path) || Path_1.default; }, [theme]);
|
@@ -220,7 +221,7 @@ const Watch = react_1.default.forwardRef((props_, ref) => {
|
|
220
221
|
],
|
221
222
|
RegularProps === null || RegularProps === void 0 ? void 0 : RegularProps.className,
|
222
223
|
classes.regular
|
223
|
-
]) }, { children: [timeVisible && ((0, utils_1.is)('function', renderTime) ? renderTime(value) : ((0, jsx_runtime_1.jsx)(Type, Object.assign({ version: size === 'large' ? 'h1' : size === 'regular' ? 'h2' : 'h3' }, { children: (0, date_1.format)(value, timeFormatString) })))), dateVisible && ((0, utils_1.is)('function', renderDate) ? renderDate(value) : ((0, jsx_runtime_1.jsx)(Type, Object.assign({ version: size === 'large' ? 'b1' : size === 'regular' ? 'b2' : 'b3', priority: 'secondary' }, { children: (0, date_1.format)(value, dateFormatString) }))))] }))), version === 'analog' && ((0, jsx_runtime_1.jsxs)(RoundMeter, Object.assign({ tonal: tonal, color: color, size: size, marks: marks.analog, labels: labels.analog, background: true }, AnalogProps, { children: [timeOfDayVisible && ((0, jsx_runtime_1.jsx)("text", Object.assign({ x: 120, y: 74, stroke: 'none', fill: 'currentColor', className: (0, style_react_1.classNames)([
|
224
|
+
]) }, { children: [timeVisible && ((0, utils_1.is)('function', renderTime) ? renderTime(value) : ((0, jsx_runtime_1.jsx)(Type, Object.assign({ version: size === 'large' ? 'h1' : size === 'regular' ? 'h2' : 'h3' }, { children: (0, date_1.format)(value, timeFormatString, { l }) })))), dateVisible && ((0, utils_1.is)('function', renderDate) ? renderDate(value) : ((0, jsx_runtime_1.jsx)(Type, Object.assign({ version: size === 'large' ? 'b1' : size === 'regular' ? 'b2' : 'b3', priority: 'secondary' }, { children: (0, date_1.format)(value, dateFormatString, { l }) }))))] }))), version === 'analog' && ((0, jsx_runtime_1.jsxs)(RoundMeter, Object.assign({ tonal: tonal, color: color, size: size, marks: marks.analog, labels: labels.analog, background: true }, AnalogProps, { children: [timeOfDayVisible && ((0, jsx_runtime_1.jsx)("text", Object.assign({ x: 120, y: 74, stroke: 'none', fill: 'currentColor', className: (0, style_react_1.classNames)([
|
224
225
|
(0, utils_2.staticClassName)('Watch', theme) && [
|
225
226
|
'onesy-Watch-time-of-day'
|
226
227
|
],
|
@@ -276,7 +277,7 @@ const Watch = react_1.default.forwardRef((props_, ref) => {
|
|
276
277
|
classes.modernDate
|
277
278
|
]), style: {
|
278
279
|
fontSize: 19
|
279
|
-
} }, { children: (0, date_1.format)(value, `d DD
|
280
|
+
} }, { children: (0, date_1.format)(value, `d DD`, { l }) })) })), (0, jsx_runtime_1.jsx)(Path, { d: `M 120 114 L 170 114 A 1 1 0 0 1 170 126 L 120 126 A 1 1 0 0 1 120 114`, value: (100 / 12) * value.hour, style: {
|
280
281
|
transformOrigin: '50% 50%',
|
281
282
|
stroke: 'none',
|
282
283
|
fill: palette[20]
|
package/esm/Calendar/Calendar.js
CHANGED
@@ -345,7 +345,11 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
|
|
345
345
|
}, /*#__PURE__*/React.createElement(Type, {
|
346
346
|
version: size === 'large' ? 'l1' : size === 'regular' ? 'l2' : 'l3',
|
347
347
|
className: classNames([classes.carousel_item_label])
|
348
|
-
}, format(calendarOnesyDate, 'MMMM'
|
348
|
+
}, format(calendarOnesyDate, 'MMMM', {
|
349
|
+
l
|
350
|
+
}), " ", format(calendarOnesyDate, 'YYYY', {
|
351
|
+
l
|
352
|
+
})), /*#__PURE__*/React.createElement(CalendarMonth, _extends({
|
349
353
|
color: "default",
|
350
354
|
value: value,
|
351
355
|
calendar: calendarOnesyDate,
|
@@ -403,7 +407,9 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
|
|
403
407
|
style: {
|
404
408
|
paddingInlineStart: '16px'
|
405
409
|
}
|
406
|
-
},
|
410
|
+
}, format(calendarOnesyDate, 'MMMM', {
|
411
|
+
l
|
412
|
+
})), /*#__PURE__*/React.createElement(CalendarMonth, _extends({
|
407
413
|
color: "default",
|
408
414
|
value: value,
|
409
415
|
calendar: calendarOnesyDate,
|
@@ -531,7 +537,11 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
|
|
531
537
|
})
|
532
538
|
}, optionButtonProps, {
|
533
539
|
className: classNames([staticClassName('Calendar', theme) && ['onesy-Calendar-option'], optionButtonProps?.className, classes.option])
|
534
|
-
}), format(calendar, 'MMMM'
|
540
|
+
}), format(calendar, 'MMMM', {
|
541
|
+
l
|
542
|
+
}), " ", format(calendar, 'YYYY', {
|
543
|
+
l
|
544
|
+
})), /*#__PURE__*/React.createElement(Line, {
|
535
545
|
gap: 0,
|
536
546
|
direction: "row",
|
537
547
|
align: "center"
|
@@ -576,7 +586,9 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
|
|
576
586
|
return /*#__PURE__*/React.createElement(ListItem, {
|
577
587
|
key: index,
|
578
588
|
onClick: () => onUpdateCalendarOption(onesyDate),
|
579
|
-
primary:
|
589
|
+
primary: format(onesyDate, 'MMMM', {
|
590
|
+
l
|
591
|
+
}),
|
580
592
|
inset: !selected,
|
581
593
|
startAlign: "center",
|
582
594
|
size: size,
|
@@ -363,14 +363,18 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
363
363
|
}, /*#__PURE__*/React.createElement(Type, {
|
364
364
|
version: "h3",
|
365
365
|
weight: 400
|
366
|
-
}, format(itemDay, 'dd'
|
366
|
+
}, format(itemDay, 'dd', {
|
367
|
+
l
|
368
|
+
})), /*#__PURE__*/React.createElement(Line, {
|
367
369
|
align: "center",
|
368
370
|
justify: "center",
|
369
371
|
className: classNames([classes.weekDay, itemDay.year === now.year && itemDay.dayYear === now.dayYear && classes.today])
|
370
372
|
}, /*#__PURE__*/React.createElement(Type, {
|
371
373
|
version: "b2",
|
372
374
|
weight: 200
|
373
|
-
}, format(itemDay, 'DD.MM.'
|
375
|
+
}, format(itemDay, 'DD.MM.', {
|
376
|
+
l
|
377
|
+
})))), /*#__PURE__*/React.createElement(Line, {
|
374
378
|
gap: 2,
|
375
379
|
fullWidth: true
|
376
380
|
}, !!values.length ? values.map((itemValue, indexItem) => {
|
@@ -392,7 +396,11 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
392
396
|
}), /*#__PURE__*/React.createElement(Type, {
|
393
397
|
version: "b2",
|
394
398
|
weight: 300
|
395
|
-
}, format(itemValueFrom, 'hh:mm a'
|
399
|
+
}, format(itemValueFrom, 'hh:mm a', {
|
400
|
+
l
|
401
|
+
}), " \u2014 ", format(itemValueTo, 'hh:mm a', {
|
402
|
+
l
|
403
|
+
}))), itemValue.description && /*#__PURE__*/React.createElement(Type, {
|
396
404
|
version: "b2",
|
397
405
|
weight: 200,
|
398
406
|
whiteSpace: "pre-wrap",
|
@@ -436,9 +444,15 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
436
444
|
}, /*#__PURE__*/React.createElement(Type, {
|
437
445
|
version: "b2",
|
438
446
|
weight: 400
|
439
|
-
}, format(day, 'dd'
|
447
|
+
}, format(day, 'dd', {
|
448
|
+
l
|
449
|
+
})), /*#__PURE__*/React.createElement(Type, {
|
440
450
|
version: "b2"
|
441
|
-
}, format(itemValueFrom, formats.entire
|
451
|
+
}, format(itemValueFrom, formats.entire, {
|
452
|
+
l
|
453
|
+
}), " \u2014 ", format(itemValueTo, formats.entire, {
|
454
|
+
l
|
455
|
+
})))), itemValue.description && /*#__PURE__*/React.createElement(Type, {
|
442
456
|
version: "b2",
|
443
457
|
weight: 200,
|
444
458
|
whiteSpace: "pre-wrap",
|
@@ -450,8 +464,14 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
450
464
|
}));
|
451
465
|
};
|
452
466
|
const formattedDate = React.useMemo(() => {
|
453
|
-
if (view === 'day') return format(date, `MMMM DD, YYYY
|
454
|
-
|
467
|
+
if (view === 'day') return format(date, `MMMM DD, YYYY`, {
|
468
|
+
l
|
469
|
+
});
|
470
|
+
if (['week', 'simple'].includes(view)) return `${format(startOf(date, 'week'), `MMM DD, YYYY`, {
|
471
|
+
l
|
472
|
+
})} – ${format(endOf(date, 'week'), `MMM DD, YYYY`, {
|
473
|
+
l
|
474
|
+
})}`;
|
455
475
|
}, [view, date]);
|
456
476
|
const legend = React.useMemo(() => {
|
457
477
|
return /*#__PURE__*/React.createElement(Line, {
|
@@ -639,7 +659,13 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
639
659
|
}, /*#__PURE__*/React.createElement(Type, {
|
640
660
|
version: "l1",
|
641
661
|
weight: 200
|
642
|
-
}, format(modal?.day, 'dd'
|
662
|
+
}, format(modal?.day, 'dd', {
|
663
|
+
l
|
664
|
+
}), " ", format(new OnesyDate(modal?.from), modal?.weekly ? `hh:mm a` : formats.entire, {
|
665
|
+
l
|
666
|
+
}), " \u2014 ", format(new OnesyDate(modal?.to), modal?.weekly ? `hh:mm a` : formats.entire, {
|
667
|
+
l
|
668
|
+
})), modal?.description && /*#__PURE__*/React.createElement(Type, {
|
643
669
|
version: "b2",
|
644
670
|
dangerouslySetInnerHTML: {
|
645
671
|
__html: textToInnerHTML(modal.description)
|
@@ -327,7 +327,9 @@ const CalendarMenu = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
327
327
|
primary: /*#__PURE__*/React.createElement(Type, {
|
328
328
|
version: "b2",
|
329
329
|
color: "inherit"
|
330
|
-
}, format(date, 'HH:mm'
|
330
|
+
}, format(date, 'HH:mm', {
|
331
|
+
l
|
332
|
+
})),
|
331
333
|
startAlign: "center",
|
332
334
|
size: "small",
|
333
335
|
button: true,
|
@@ -365,7 +367,9 @@ const CalendarMenu = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
365
367
|
version: 'b3',
|
366
368
|
priority: !day.selected ? !day.weekend ? 'primary' : 'secondary' : undefined
|
367
369
|
},
|
368
|
-
"aria-label": format(dayOnesyDate, 'DD-MM-YYYY'
|
370
|
+
"aria-label": format(dayOnesyDate, 'DD-MM-YYYY', {
|
371
|
+
l
|
372
|
+
}),
|
369
373
|
className: classNames([classes.dayValue, repeating && classes.dayValueRepeating]),
|
370
374
|
style: _objectSpread(_objectSpread({}, day.today ? {
|
371
375
|
boxShadow: `inset 0px 0px 0px 1px ${palette[40]}`
|
@@ -471,7 +471,9 @@ const CalendarMonth = /*#__PURE__*/React.forwardRef((props__, ref) => {
|
|
471
471
|
version: size === 'large' ? 'b1' : size === 'regular' ? 'b2' : 'b3',
|
472
472
|
priority: !day.selected ? !day.weekend ? 'primary' : 'secondary' : undefined
|
473
473
|
},
|
474
|
-
"aria-label": format(day.onesyDate, 'DD-MM-YYYY'
|
474
|
+
"aria-label": format(day.onesyDate, 'DD-MM-YYYY', {
|
475
|
+
l
|
476
|
+
})
|
475
477
|
}, PaginationItemProps, {
|
476
478
|
className: classNames([staticClassName('CalendarMonth', theme) && ['onesy-CalendarMonth-day-value', day.in && 'onesy-CalendarMonth-day-in', day.dayWeek && 'onesy-CalendarMonth-day-day-week', day.weekend && 'onesy-CalendarMonth-day-weekend', day.today && 'onesy-CalendarMonth-day-today', day.between && 'onesy-CalendarMonth-day-between', day.selected && 'onesy-CalendarMonth-day-selected', day.start && 'onesy-CalendarMonth-day-start', day.end && 'onesy-CalendarMonth-day-end'], PaginationItemProps?.className, classes.dayValue]),
|
477
479
|
style: _objectSpread(_objectSpread(_objectSpread({}, day.today ? {
|
@@ -185,9 +185,17 @@ const CalendarViews = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
185
185
|
}));
|
186
186
|
}, [viewsProps]);
|
187
187
|
const formattedDate = React.useMemo(() => {
|
188
|
-
if (view === 'day') return format(date, `MMMM DD, YYYY
|
189
|
-
|
190
|
-
|
188
|
+
if (view === 'day') return format(date, `MMMM DD, YYYY`, {
|
189
|
+
l
|
190
|
+
});
|
191
|
+
if (view === 'week') return `${format(startOf(date, 'week'), `MMM DD, YYYY`, {
|
192
|
+
l
|
193
|
+
})} – ${format(endOf(date, 'week'), `MMM DD, YYYY`, {
|
194
|
+
l
|
195
|
+
})}`;
|
196
|
+
if (view === 'month') return format(date, `MMMM YYYY`, {
|
197
|
+
l
|
198
|
+
});
|
191
199
|
}, [view, date]);
|
192
200
|
const onChangeView = React.useCallback(valueNew => {
|
193
201
|
setView(valueNew);
|
@@ -230,7 +238,9 @@ const CalendarViews = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
230
238
|
className: classNames([classes.monthDay, day.today && classes.today])
|
231
239
|
}, /*#__PURE__*/React.createElement(Type, {
|
232
240
|
version: "b2"
|
233
|
-
}, format(valueCalendarMonth, 'D'
|
241
|
+
}, format(valueCalendarMonth, 'D', {
|
242
|
+
l
|
243
|
+
}))), /*#__PURE__*/React.createElement(Line, {
|
234
244
|
gap: 0.5,
|
235
245
|
flex: true,
|
236
246
|
fullWidth: true,
|
@@ -126,6 +126,7 @@ const useStyle = styleMethod(theme => ({
|
|
126
126
|
});
|
127
127
|
const CalendarWeek = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
128
128
|
const theme = useOnesyTheme();
|
129
|
+
const l = theme.l;
|
129
130
|
const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyCalendarWeek?.props?.default), props_), [props_]);
|
130
131
|
const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
|
131
132
|
const Type = React.useMemo(() => theme?.elements?.Type || TypeElement, [theme]);
|
@@ -317,7 +318,11 @@ const CalendarWeek = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
317
318
|
style: {
|
318
319
|
background: getColor(item)
|
319
320
|
}
|
320
|
-
}, format(from, 'hh:mm a'
|
321
|
+
}, format(from, 'hh:mm a', {
|
322
|
+
l
|
323
|
+
}), " - ", renderTo(format(to, 'hh:mm a', {
|
324
|
+
l
|
325
|
+
}))), item.description && /*#__PURE__*/React.createElement(Type, {
|
321
326
|
version: "b2",
|
322
327
|
dangerouslySetInnerHTML: {
|
323
328
|
__html: textToInnerHTML(item.description)
|
@@ -398,7 +403,9 @@ const CalendarWeek = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
398
403
|
}, /*#__PURE__*/React.createElement(Type, {
|
399
404
|
version: "b3",
|
400
405
|
whiteSpace: "nowrap"
|
401
|
-
}, format(itemHour, 'h A'
|
406
|
+
}, format(itemHour, 'h A', {
|
407
|
+
l
|
408
|
+
})))))), dayProp && /*#__PURE__*/React.createElement(Line, {
|
402
409
|
gap: 0,
|
403
410
|
direction: "column",
|
404
411
|
align: "center",
|
@@ -412,7 +419,9 @@ const CalendarWeek = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
412
419
|
}, /*#__PURE__*/React.createElement(Type, {
|
413
420
|
version: "l1",
|
414
421
|
weight: 200
|
415
|
-
}, format(date, 'd'
|
422
|
+
}, format(date, 'd', {
|
423
|
+
l
|
424
|
+
})), /*#__PURE__*/React.createElement(Line, {
|
416
425
|
align: "center",
|
417
426
|
justify: "center",
|
418
427
|
className: classNames([classes.weekDay, date.year === now.year && date.dayYear === now.dayYear && classes.today])
|
@@ -420,7 +429,9 @@ const CalendarWeek = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
420
429
|
version: "h3",
|
421
430
|
weight: 400,
|
422
431
|
align: "center"
|
423
|
-
}, format(date, 'D'
|
432
|
+
}, format(date, 'D', {
|
433
|
+
l
|
434
|
+
})))), /*#__PURE__*/React.createElement(Line, {
|
424
435
|
className: classes.dayBody,
|
425
436
|
flex: true,
|
426
437
|
fullWidth: true,
|
@@ -454,7 +465,9 @@ const CalendarWeek = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
454
465
|
}, /*#__PURE__*/React.createElement(Type, {
|
455
466
|
version: "l1",
|
456
467
|
weight: 200
|
457
|
-
}, format(itemDay, 'd'
|
468
|
+
}, format(itemDay, 'd', {
|
469
|
+
l
|
470
|
+
})), /*#__PURE__*/React.createElement(Line, {
|
458
471
|
align: "center",
|
459
472
|
justify: "center",
|
460
473
|
className: classNames([classes.weekDay, itemDay.year === now.year && itemDay.dayYear === now.dayYear && classes.today])
|
@@ -462,7 +475,9 @@ const CalendarWeek = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
462
475
|
version: "h3",
|
463
476
|
weight: 400,
|
464
477
|
align: "center"
|
465
|
-
}, format(itemDay, 'D'
|
478
|
+
}, format(itemDay, 'D', {
|
479
|
+
l
|
480
|
+
})))), /*#__PURE__*/React.createElement(Line, {
|
466
481
|
className: classes.dayBody,
|
467
482
|
flex: true,
|
468
483
|
fullWidth: true,
|
@@ -235,7 +235,13 @@ const DatePicker = /*#__PURE__*/React.forwardRef((props__, ref) => {
|
|
235
235
|
let result = '';
|
236
236
|
const [from, to] = is('array', valueNew) ? valueNew : [valueNew];
|
237
237
|
if (!(from || to)) return '';
|
238
|
-
const method = item => `${format(item, 'DD'
|
238
|
+
const method = item => `${format(item, 'DD', {
|
239
|
+
l
|
240
|
+
})}/${format(item, 'MM', {
|
241
|
+
l
|
242
|
+
})}/${format(item, 'YYYY', {
|
243
|
+
l
|
244
|
+
})}`;
|
239
245
|
result += `${method(from)}`;
|
240
246
|
if (range && to) result += `${SEPARATOR}${method(to)}`;
|
241
247
|
return result;
|
@@ -542,9 +548,23 @@ const DatePicker = /*#__PURE__*/React.forwardRef((props__, ref) => {
|
|
542
548
|
if (version === 'mobile') {
|
543
549
|
if (!(readOnly || disabled)) moreProps.onClick = onOpen;
|
544
550
|
}
|
545
|
-
let textHeading = `${format(value[0], 'd'
|
551
|
+
let textHeading = `${format(value[0], 'd', {
|
552
|
+
l
|
553
|
+
})}, ${format(value[0], 'MMM', {
|
554
|
+
l
|
555
|
+
})} ${format(value[0], 'DD', {
|
556
|
+
l
|
557
|
+
})}`;
|
546
558
|
if (range) {
|
547
|
-
textHeading = `${format(value[0], 'MMM'
|
559
|
+
textHeading = `${format(value[0], 'MMM', {
|
560
|
+
l
|
561
|
+
})} ${format(value[0], 'DD', {
|
562
|
+
l
|
563
|
+
})}${SEPARATOR}${format(value[1], 'MMM', {
|
564
|
+
l
|
565
|
+
})} ${format(value[1], 'DD', {
|
566
|
+
l
|
567
|
+
})}`;
|
548
568
|
}
|
549
569
|
const dayNames = [l('Mo'), l('Tu'), l('We'), l('Th'), l('Fr'), l('Sa'), l('Su')];
|
550
570
|
const mobile = /*#__PURE__*/React.createElement(Surface, _extends({
|
package/esm/Watch/Watch.js
CHANGED
@@ -86,6 +86,7 @@ const useStyle = styleMethod(theme => ({
|
|
86
86
|
});
|
87
87
|
const Watch = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
88
88
|
const theme = useOnesyTheme();
|
89
|
+
const l = theme.l;
|
89
90
|
const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyWatch?.props?.default), props_), [props_]);
|
90
91
|
const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
|
91
92
|
const Path = React.useMemo(() => theme?.elements?.Path || PathElement, [theme]);
|
@@ -242,10 +243,14 @@ const Watch = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
242
243
|
className: classNames([staticClassName('Watch', theme) && ['onesy-Watch-regular'], RegularProps?.className, classes.regular])
|
243
244
|
}), timeVisible && (is('function', renderTime) ? renderTime(value) : /*#__PURE__*/React.createElement(Type, {
|
244
245
|
version: size === 'large' ? 'h1' : size === 'regular' ? 'h2' : 'h3'
|
245
|
-
}, format(value, timeFormatString
|
246
|
+
}, format(value, timeFormatString, {
|
247
|
+
l
|
248
|
+
}))), dateVisible && (is('function', renderDate) ? renderDate(value) : /*#__PURE__*/React.createElement(Type, {
|
246
249
|
version: size === 'large' ? 'b1' : size === 'regular' ? 'b2' : 'b3',
|
247
250
|
priority: "secondary"
|
248
|
-
}, format(value, dateFormatString
|
251
|
+
}, format(value, dateFormatString, {
|
252
|
+
l
|
253
|
+
})))), version === 'analog' && /*#__PURE__*/React.createElement(RoundMeter, _extends({
|
249
254
|
tonal: tonal,
|
250
255
|
color: color,
|
251
256
|
size: size,
|
@@ -377,7 +382,9 @@ const Watch = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
377
382
|
style: {
|
378
383
|
fontSize: 19
|
379
384
|
}
|
380
|
-
}, format(value, `d DD
|
385
|
+
}, format(value, `d DD`, {
|
386
|
+
l
|
387
|
+
}))), /*#__PURE__*/React.createElement(Path, {
|
381
388
|
d: `M 120 114 L 170 114 A 1 1 0 0 1 170 126 L 120 126 A 1 1 0 0 1 120 114`,
|
382
389
|
value: 100 / 12 * value.hour,
|
383
390
|
style: {
|
package/esm/index.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@onesy/ui-react",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.75",
|
4
4
|
"description": "UI for React",
|
5
5
|
"repository": "https://github.com/onesy-me/onesy.git",
|
6
6
|
"author": "Lazar <lazareric2@gmail.com>",
|
@@ -36,9 +36,9 @@
|
|
36
36
|
"react-router-dom": "^6.15.0"
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
|
-
"@onesy/date": "^1.0.
|
39
|
+
"@onesy/date": "^1.0.2",
|
40
40
|
"@onesy/errors": "^1.0.0",
|
41
|
-
"@onesy/icons-material-rounded-react": "
|
41
|
+
"@onesy/icons-material-rounded-react": "1.0.4",
|
42
42
|
"@onesy/log": "^1.0.0",
|
43
43
|
"@onesy/models": "^1.0.0",
|
44
44
|
"@onesy/subscription": "^1.0.0",
|