@majoo-ui/react 2.2.1 → 2.4.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/components/alertDialog/AlertDialog.esm.js +28 -15
- package/components/alertDialog/locale.esm.js +20 -0
- package/components/chart/lineChart/LineChart.esm.js +4 -0
- package/components/datePicker/DatePicker.esm.js +16 -6
- package/components/datePicker/DatePickerMulti.esm.js +5 -3
- package/components/datePicker/InputDatePicker.esm.js +14 -12
- package/components/datePicker/components/Calendar.esm.js +17 -23
- package/components/datePicker/components/CalendarMulti.esm.js +4 -7
- package/components/datePicker/components/CalendarTimePicker.esm.js +6 -9
- package/components/datePicker/components/MobileCalendar.esm.js +13 -17
- package/components/datePicker/locale.esm.js +92 -0
- package/components/devicePreview/DevicePreview.esm.js +4 -0
- package/components/editableTable/EditableMobile.esm.js +4 -6
- package/components/editableTable/EditableTable.esm.js +7 -7
- package/components/form/components/InputCombobox/InputCombobox.esm.js +3 -0
- package/components/form/components/InputCreatable/InputCreatable.esm.js +16 -8
- package/components/form/components/InputCreatable/locale.esm.js +15 -0
- package/components/form/components/InputDateRange/InputDateRange.esm.js +15 -11
- package/components/form/components/InputDateRange/locale.esm.js +15 -0
- package/components/form/components/InputOTP/InputOTP.esm.js +9 -6
- package/components/form/components/InputOTP/locale.esm.js +15 -0
- package/components/form/components/InputResourceList/InputResourceList.esm.js +8 -11
- package/components/form/components/InputResourceList/locale.esm.js +27 -0
- package/components/form/components/InputSearchbox/InputSearchbox.esm.js +15 -6
- package/components/form/components/InputSearchbox/locale.esm.js +16 -0
- package/components/form/components/InputSelect/InputSelect.esm.js +29 -16
- package/components/form/components/InputSelect/locale.esm.js +23 -0
- package/components/form/components/InputSelectCheck/InputSelectCheck.esm.js +32 -23
- package/components/form/components/InputSelectCheck/locale.esm.js +30 -0
- package/components/form/components/InputSignature/InputSignature.esm.js +7 -8
- package/components/form/components/InputSignature/SignatureModal.esm.js +3 -3
- package/components/form/components/InputSignature/locale.esm.js +27 -0
- package/components/image/Image.esm.js +15 -9
- package/components/image/locale.esm.js +15 -0
- package/components/mapPicker/InputMapPicker.esm.js +5 -0
- package/components/pageDialog/PageDialog.esm.js +4 -0
- package/components/periodSelect/PeriodSelect.esm.js +11 -12
- package/components/periodSelect/locale.esm.js +25 -0
- package/components/table/MobileTable.esm.js +4 -6
- package/components/table/Table.esm.js +63 -95
- package/components/table/components/columns/RowMenuColumn.esm.js +0 -5
- package/components/table/locale.esm.js +91 -0
- package/components/tagList/TagList.esm.js +6 -7
- package/components/tagList/locale.esm.js +22 -0
- package/components/toast/context/ToastProvider.esm.js +13 -9
- package/components/toast/context/locale.esm.js +20 -0
- package/config/locale/LocaleContext.esm.js +29 -0
- package/config/locale/LocaleTextContext.esm.js +5 -0
- package/config/locale/useLocaleText.esm.js +30 -0
- package/index.esm.css +249 -249
- package/index.esm.js +13 -0
- package/majoo-provider/MajooProvider.esm.js +41 -4
- package/package.json +2 -2
- package/src/components/alertDialog/locale.d.ts +10 -0
- package/src/components/datePicker/DatePickerMulti.d.ts +2 -1
- package/src/components/datePicker/InputDatePicker.d.ts +13 -2
- package/src/components/datePicker/components/Calendar.d.ts +12 -1
- package/src/components/datePicker/components/CalendarMulti.d.ts +6 -1
- package/src/components/datePicker/components/CalendarTimePicker.d.ts +4 -1
- package/src/components/datePicker/components/MobileCalendar.d.ts +1 -1
- package/src/components/datePicker/index.d.ts +2 -0
- package/src/components/datePicker/locale.d.ts +45 -0
- package/src/components/editableTable/EditableMobile.d.ts +1 -0
- package/src/components/editableTable/EditableTable.d.ts +9 -18
- package/src/components/form/components/InputCreatable/locale.d.ts +13 -0
- package/src/components/form/components/InputDateRange/InputDateRange.d.ts +16 -1
- package/src/components/form/components/InputDateRange/index.d.ts +2 -0
- package/src/components/form/components/InputDateRange/locale.d.ts +10 -0
- package/src/components/form/components/InputOTP/InputOTP.d.ts +7 -1
- package/src/components/form/components/InputOTP/index.d.ts +2 -0
- package/src/components/form/components/InputOTP/locale.d.ts +10 -0
- package/src/components/form/components/InputResourceList/InputResourceList.d.ts +8 -1
- package/src/components/form/components/InputResourceList/locale.d.ts +17 -0
- package/src/components/form/components/InputSearchbox/locale.d.ts +11 -0
- package/src/components/form/components/InputSelect/index.d.ts +2 -0
- package/src/components/form/components/InputSelect/locale.d.ts +15 -0
- package/src/components/form/components/InputSelectCheck/locale.d.ts +20 -0
- package/src/components/form/components/InputSignature/InputSignature.d.ts +7 -1
- package/src/components/form/components/InputSignature/SignatureModal.d.ts +2 -1
- package/src/components/form/components/InputSignature/index.d.ts +2 -0
- package/src/components/form/components/InputSignature/locale.d.ts +16 -0
- package/src/components/form/components/index.d.ts +4 -0
- package/src/components/image/index.d.ts +2 -0
- package/src/components/image/locale.d.ts +10 -0
- package/src/components/periodSelect/PeriodSelect.d.ts +14 -3
- package/src/components/periodSelect/index.d.ts +2 -0
- package/src/components/periodSelect/locale.d.ts +15 -0
- package/src/components/table/MobileTable.d.ts +1 -0
- package/src/components/table/index.d.ts +2 -0
- package/src/components/table/locale.d.ts +40 -0
- package/src/components/tagList/TagList.d.ts +8 -2
- package/src/components/tagList/index.d.ts +2 -0
- package/src/components/tagList/locale.d.ts +13 -0
- package/src/components/toast/context/locale.d.ts +11 -0
- package/src/config/locale/LocaleContext.d.ts +13 -0
- package/src/config/locale/LocaleTextContext.d.ts +38 -0
- package/src/config/locale/useLocaleText.d.ts +10 -0
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { ADVANCE_PICKER, RANGE_PICKER, SINGLE_PICKER, WEEKLY, MONTHLY, DATE_RANGE_PICKER } from './DatePicker';
|
|
3
3
|
import { CSS } from '../../config/stitches.config';
|
|
4
4
|
import { PopoverPlacement } from '../../type/base.types';
|
|
5
|
+
import { DatePickerLocaleText } from './locale';
|
|
5
6
|
interface TimePickerProps {
|
|
6
7
|
/**
|
|
7
8
|
Resize time picker.
|
|
@@ -54,7 +55,7 @@ export interface InputDatePickerProps {
|
|
|
54
55
|
*/
|
|
55
56
|
rangePickerType?: typeof WEEKLY | typeof MONTHLY;
|
|
56
57
|
/**
|
|
57
|
-
* Specify the InputDatePicker placeholder.
|
|
58
|
+
* Specify the InputDatePicker placeholder. Wins over `localeText.placeholder`.
|
|
58
59
|
*/
|
|
59
60
|
placeholder?: string;
|
|
60
61
|
/**
|
|
@@ -165,6 +166,16 @@ export interface InputDatePickerProps {
|
|
|
165
166
|
* Max range date picker in days
|
|
166
167
|
*/
|
|
167
168
|
maxRange?: number;
|
|
169
|
+
/**
|
|
170
|
+
* Language of the month and weekday names and the picked dates. Falls back to `MajooProvider`'s
|
|
171
|
+
* `locale`, then the app's i18next language, then `id`.
|
|
172
|
+
*/
|
|
173
|
+
locale?: string;
|
|
174
|
+
/**
|
|
175
|
+
* Texts of this date picker. Keys left unset fall back to `MajooProvider`'s `localeText.datePicker`,
|
|
176
|
+
* then to the Indonesian defaults (`defaultDatePickerLocaleText`).
|
|
177
|
+
*/
|
|
178
|
+
localeText?: Partial<DatePickerLocaleText>;
|
|
168
179
|
}
|
|
169
|
-
export declare function InputDatePicker({ type, showRangeControl, rangePickerType, placeholder, size, disabled, onChange, onDateSelected, defaultValue: defaultDateValue, value: dateValue, defaultDate, date, advanceView, placement, css, showTimePicker, timePickerProps, minDate, maxDate, readOnly, isInvalid, allowReset, portalled, portalledMobile, onClose, mobileOnly, desktopOnly, drawerCss, drawerContentCss, isMobile, maxRange, }: InputDatePickerProps): JSX.Element;
|
|
180
|
+
export declare function InputDatePicker({ type, showRangeControl, rangePickerType, placeholder, size, disabled, onChange, onDateSelected, defaultValue: defaultDateValue, value: dateValue, defaultDate, date, advanceView, placement, css, showTimePicker, timePickerProps, minDate, maxDate, readOnly, isInvalid, allowReset, portalled, portalledMobile, onClose, mobileOnly, desktopOnly, drawerCss, drawerContentCss, isMobile, maxRange, locale, localeText, }: InputDatePickerProps): JSX.Element;
|
|
170
181
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RenderProps } from 'dayzed';
|
|
2
2
|
import React, { Dispatch, SetStateAction } from 'react';
|
|
3
3
|
import { CSS } from '../../../config/stitches.config';
|
|
4
|
+
import { DatePickerLocaleText } from '../locale';
|
|
4
5
|
export declare const DATE_PICKER = 0;
|
|
5
6
|
export declare const MONTH_PICKER = 1;
|
|
6
7
|
export declare const YEAR_PICKER = 2;
|
|
@@ -27,6 +28,16 @@ export interface CalendarProps extends RenderProps {
|
|
|
27
28
|
timePickerProps?: {
|
|
28
29
|
minDate?: Date;
|
|
29
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Language of the month and weekday names and the picked dates. Falls back to `MajooProvider`'s
|
|
33
|
+
* `locale`, then the app's i18next language, then `id`.
|
|
34
|
+
*/
|
|
35
|
+
locale?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Texts of this calendar. Keys left unset fall back to `MajooProvider`'s `localeText.datePicker`,
|
|
38
|
+
* then to the Indonesian defaults (`defaultDatePickerLocaleText`).
|
|
39
|
+
*/
|
|
40
|
+
localeText?: Partial<DatePickerLocaleText>;
|
|
30
41
|
}
|
|
31
|
-
declare const Calendar: ({ calendars, getDateProps, advanceView, onCalendarDateChange, onIsMultiDateChange, onUpdate, onCancel, onReset, selected, containerStyle, disabled, showTimePicker, renderTimePicker, minDate, maxDate, allowReset, onSetDateValue, maxRange, overMaxRange, timePickerProps, }: CalendarProps) => JSX.Element | null;
|
|
42
|
+
declare const Calendar: ({ calendars, getDateProps, advanceView, onCalendarDateChange, onIsMultiDateChange, onUpdate, onCancel, onReset, selected, containerStyle, disabled, showTimePicker, renderTimePicker, minDate, maxDate, allowReset, onSetDateValue, maxRange, overMaxRange, timePickerProps, locale, localeText, }: CalendarProps) => JSX.Element | null;
|
|
32
43
|
export default Calendar;
|
|
@@ -16,6 +16,11 @@ export interface CalendarProps extends RenderProps {
|
|
|
16
16
|
minDate?: Date;
|
|
17
17
|
maxDate?: Date;
|
|
18
18
|
disabledDate?: Date[];
|
|
19
|
+
/**
|
|
20
|
+
* Language of the month and weekday names. Falls back to `MajooProvider`'s `locale`, then the
|
|
21
|
+
* app's i18next language, then `id`.
|
|
22
|
+
*/
|
|
23
|
+
locale?: string;
|
|
19
24
|
}
|
|
20
|
-
declare const CalendarMulti: ({ calendars, getDateProps, onCalendarDateChange, selected, containerStyle, disabled, minDate, maxDate, disabledDate, }: CalendarProps) => JSX.Element | null;
|
|
25
|
+
declare const CalendarMulti: ({ calendars, getDateProps, onCalendarDateChange, selected, containerStyle, disabled, minDate, maxDate, disabledDate, locale, }: CalendarProps) => JSX.Element | null;
|
|
21
26
|
export default CalendarMulti;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import type { DatePickerLocaleText } from '../locale';
|
|
2
3
|
interface CalendarProps {
|
|
3
4
|
selected?: Date[];
|
|
4
5
|
disabled?: boolean;
|
|
@@ -6,6 +7,8 @@ interface CalendarProps {
|
|
|
6
7
|
onSetDateValue?: Dispatch<SetStateAction<Date[]>>;
|
|
7
8
|
isSingle?: boolean;
|
|
8
9
|
timePickerProps?: object;
|
|
10
|
+
/** Texts already resolved by the calendar. */
|
|
11
|
+
text: DatePickerLocaleText;
|
|
9
12
|
}
|
|
10
|
-
declare const CalendarTimePicker: ({ selected, disabled, language, onSetDateValue, isSingle, timePickerProps }: CalendarProps) => JSX.Element;
|
|
13
|
+
declare const CalendarTimePicker: ({ selected, disabled, language, onSetDateValue, isSingle, timePickerProps, text }: CalendarProps) => JSX.Element;
|
|
11
14
|
export default CalendarTimePicker;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CalendarProps } from './Calendar';
|
|
3
|
-
declare const MobileCalendar: ({ calendars, getDateProps, advanceView, onCalendarDateChange, onIsMultiDateChange, onUpdate, onCancel, onReset, selected, containerStyle, disabled, minDate, maxDate, allowReset, maxRange, overMaxRange, }: CalendarProps) => JSX.Element | null;
|
|
3
|
+
declare const MobileCalendar: ({ calendars, getDateProps, advanceView, onCalendarDateChange, onIsMultiDateChange, onUpdate, onCancel, onReset, selected, containerStyle, disabled, minDate, maxDate, allowReset, maxRange, overMaxRange, locale, localeText, }: CalendarProps) => JSX.Element | null;
|
|
4
4
|
export default MobileCalendar;
|
|
@@ -5,3 +5,5 @@ export * from './AdvancedOption';
|
|
|
5
5
|
export * from './state/reducer';
|
|
6
6
|
export * from './timePicker';
|
|
7
7
|
export * from './DatePickerMulti';
|
|
8
|
+
export type { DatePickerAdvanceOptionLabels, DatePickerLocaleText } from './locale';
|
|
9
|
+
export { defaultDatePickerLocaleText } from './locale';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { MajooLocale } from '../../config/locale/LocaleContext';
|
|
2
|
+
/** Labels of the quick range options, keyed by the option `value` (`TODAY`, `LAST_7_DAYS`, …). */
|
|
3
|
+
export type DatePickerAdvanceOptionLabels = Record<string, string>;
|
|
4
|
+
export interface DatePickerLocaleText {
|
|
5
|
+
/** Placeholder of the input. The `placeholder` prop still wins. */
|
|
6
|
+
placeholder: string;
|
|
7
|
+
cancelButton: string;
|
|
8
|
+
saveButton: string;
|
|
9
|
+
processButton: string;
|
|
10
|
+
resetButton: string;
|
|
11
|
+
/** Footer text of a range picker before any date is picked. */
|
|
12
|
+
emptySelection: string;
|
|
13
|
+
/** Footer text when the picked range is longer than `maxRange`. */
|
|
14
|
+
maxRangeExceeded: (params: {
|
|
15
|
+
maxRange: number;
|
|
16
|
+
}) => string;
|
|
17
|
+
/** Mobile toggle that shows the quick range options. */
|
|
18
|
+
selectRangeToggle: string;
|
|
19
|
+
/** Time picker labels of a single picker. */
|
|
20
|
+
dateLabel: string;
|
|
21
|
+
timeLabel: string;
|
|
22
|
+
/** Time picker labels of a range picker. */
|
|
23
|
+
dateFromLabel: string;
|
|
24
|
+
dateUntilLabel: string;
|
|
25
|
+
timeFromLabel: string;
|
|
26
|
+
timeUntilLabel: string;
|
|
27
|
+
advanceOptions: DatePickerAdvanceOptionLabels;
|
|
28
|
+
}
|
|
29
|
+
export declare const defaultDatePickerLocaleText: DatePickerLocaleText;
|
|
30
|
+
export declare const i18nDatePickerLocaleText: (t: any, locale: MajooLocale) => DatePickerLocaleText;
|
|
31
|
+
/** Later sources win; an `undefined` value never erases an earlier one. */
|
|
32
|
+
export declare const mergeDatePickerLocaleText: (base: DatePickerLocaleText, ...overrides: (Partial<DatePickerLocaleText> | undefined)[]) => DatePickerLocaleText;
|
|
33
|
+
/**
|
|
34
|
+
* Resolves the date picker texts. Precedence: the component's own `localeText`, then `MajooProvider`'s
|
|
35
|
+
* `localeText.datePicker`, then the app's `MajooUI/datePicker` translations, then the Indonesian defaults.
|
|
36
|
+
*/
|
|
37
|
+
export declare const useDatePickerLocaleText: (locale: MajooLocale, localeText?: Partial<DatePickerLocaleText>) => DatePickerLocaleText;
|
|
38
|
+
/** The quick range options with their labels taken from the resolved texts. */
|
|
39
|
+
export declare const localizeAdvanceOptions: (options: {
|
|
40
|
+
label: string;
|
|
41
|
+
value: string;
|
|
42
|
+
}[], text: DatePickerLocaleText) => {
|
|
43
|
+
label: string;
|
|
44
|
+
value: string;
|
|
45
|
+
}[];
|
|
@@ -18,6 +18,7 @@ interface EditableMobileProps<Data extends object> {
|
|
|
18
18
|
hiddenColumns?: string[];
|
|
19
19
|
customEmptyDataProps?: EmptyDataProps;
|
|
20
20
|
virtualized?: boolean;
|
|
21
|
+
sortColumnTitle?: string;
|
|
21
22
|
}
|
|
22
23
|
export default function EditableTableMobile(props: EditableMobileProps<any>): JSX.Element;
|
|
23
24
|
export {};
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Column, Row, SortingRule } from 'react-table';
|
|
3
3
|
import { CSS } from '../../config/stitches.config';
|
|
4
4
|
import { EmptyDataProps } from '../table/Table';
|
|
5
|
+
import { TableLocaleText } from '../table/locale';
|
|
5
6
|
interface CustomRows {
|
|
6
7
|
predicate: boolean;
|
|
7
8
|
css?: CSS;
|
|
@@ -88,6 +89,11 @@ interface EditableTableProps<Data extends object> {
|
|
|
88
89
|
* Sort by changes callback
|
|
89
90
|
*/
|
|
90
91
|
onSortByChange?: (sortBy: SortingRule<object>[]) => void;
|
|
92
|
+
/**
|
|
93
|
+
* Texts of this table, same as `Table`'s `localeText`. Only `sortColumnTitle`, `emptyDataTitle`
|
|
94
|
+
* and `emptyDataDescription` apply.
|
|
95
|
+
*/
|
|
96
|
+
localeText?: Partial<TableLocaleText>;
|
|
91
97
|
}
|
|
92
98
|
interface RemoveProps {
|
|
93
99
|
position?: 'leftBottom' | 'rightBottom' | 'leftTop' | 'rightTop';
|
|
@@ -160,9 +166,7 @@ declare namespace EditableTable {
|
|
|
160
166
|
}) => {
|
|
161
167
|
marginBottom: {
|
|
162
168
|
readonly [$$ScaleValue]: "space";
|
|
163
|
-
};
|
|
164
|
-
* Additional height of the rows.
|
|
165
|
-
*/
|
|
169
|
+
};
|
|
166
170
|
};
|
|
167
171
|
ml: (value: {
|
|
168
172
|
readonly [$$ScaleValue]: "space";
|
|
@@ -194,9 +198,6 @@ declare namespace EditableTable {
|
|
|
194
198
|
size: (value: {
|
|
195
199
|
readonly [$$PropertyValue]: "width";
|
|
196
200
|
}) => {
|
|
197
|
-
/**
|
|
198
|
-
* Change event handler table selection.
|
|
199
|
-
*/
|
|
200
201
|
width: {
|
|
201
202
|
readonly [$$PropertyValue]: "width";
|
|
202
203
|
};
|
|
@@ -273,9 +274,7 @@ declare namespace EditableTable {
|
|
|
273
274
|
}) => {
|
|
274
275
|
marginBottom: {
|
|
275
276
|
readonly [$$ScaleValue]: "space";
|
|
276
|
-
};
|
|
277
|
-
* Additional height of the rows.
|
|
278
|
-
*/
|
|
277
|
+
};
|
|
279
278
|
};
|
|
280
279
|
ml: (value: {
|
|
281
280
|
readonly [$$ScaleValue]: "space";
|
|
@@ -307,9 +306,6 @@ declare namespace EditableTable {
|
|
|
307
306
|
size: (value: {
|
|
308
307
|
readonly [$$PropertyValue]: "width";
|
|
309
308
|
}) => {
|
|
310
|
-
/**
|
|
311
|
-
* Change event handler table selection.
|
|
312
|
-
*/
|
|
313
309
|
width: {
|
|
314
310
|
readonly [$$PropertyValue]: "width";
|
|
315
311
|
};
|
|
@@ -384,9 +380,7 @@ declare namespace EditableTable {
|
|
|
384
380
|
}) => {
|
|
385
381
|
marginBottom: {
|
|
386
382
|
readonly [$$ScaleValue]: "space";
|
|
387
|
-
};
|
|
388
|
-
* Additional height of the rows.
|
|
389
|
-
*/
|
|
383
|
+
};
|
|
390
384
|
};
|
|
391
385
|
ml: (value: {
|
|
392
386
|
readonly [$$ScaleValue]: "space";
|
|
@@ -418,9 +412,6 @@ declare namespace EditableTable {
|
|
|
418
412
|
size: (value: {
|
|
419
413
|
readonly [$$PropertyValue]: "width";
|
|
420
414
|
}) => {
|
|
421
|
-
/**
|
|
422
|
-
* Change event handler table selection.
|
|
423
|
-
*/
|
|
424
415
|
width: {
|
|
425
416
|
readonly [$$PropertyValue]: "width";
|
|
426
417
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface InputCreatableLocaleText {
|
|
2
|
+
/** Option that creates the typed value; receives it so each language can place it. */
|
|
3
|
+
addOptionLabel: (params: {
|
|
4
|
+
value: string;
|
|
5
|
+
}) => string;
|
|
6
|
+
}
|
|
7
|
+
export declare const defaultInputCreatableLocaleText: InputCreatableLocaleText;
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the creatable input texts. Precedence: the input's own `localeText`, then `MajooProvider`'s
|
|
10
|
+
* `localeText.inputCreatable`, then the app's `MajooUI/inputCreatable` translations, then the Indonesian
|
|
11
|
+
* defaults.
|
|
12
|
+
*/
|
|
13
|
+
export declare const useInputCreatableLocaleText: (localeText?: Partial<InputCreatableLocaleText>) => InputCreatableLocaleText;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { CSS } from '../../../../config/stitches.config';
|
|
3
3
|
import { InputSelectProps } from '../InputSelect/InputSelect';
|
|
4
|
+
import { DatePickerAdvanceOptionLabels } from '../../../datePicker/locale';
|
|
5
|
+
import { InputDateRangeLocaleText } from './locale';
|
|
4
6
|
interface InputDateRangeProps extends InputSelectProps {
|
|
5
7
|
/**
|
|
6
|
-
* Specify the InputDateRange placeholder.
|
|
8
|
+
* Specify the InputDateRange placeholder. Wins over `localeText.placeholder`.
|
|
7
9
|
*/
|
|
8
10
|
placeholder?: string;
|
|
9
11
|
/**
|
|
@@ -34,6 +36,19 @@ interface InputDateRangeProps extends InputSelectProps {
|
|
|
34
36
|
* Additional CSS InputDateRange styles
|
|
35
37
|
*/
|
|
36
38
|
css?: CSS;
|
|
39
|
+
/**
|
|
40
|
+
* Language the quick range labels follow while the transition lasts (`en` keeps the English ones).
|
|
41
|
+
* Falls back to `MajooProvider`'s `locale`, then the app's i18next language, then `id`.
|
|
42
|
+
*/
|
|
43
|
+
locale?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Texts of this select. `placeholder` falls back to `MajooProvider`'s `localeText.inputDateRange`;
|
|
46
|
+
* `advanceOptions` to its `localeText.datePicker.advanceOptions`, shared with the date picker. Both end
|
|
47
|
+
* at the Indonesian defaults.
|
|
48
|
+
*/
|
|
49
|
+
localeText?: Partial<InputDateRangeLocaleText> & {
|
|
50
|
+
advanceOptions?: DatePickerAdvanceOptionLabels;
|
|
51
|
+
};
|
|
37
52
|
}
|
|
38
53
|
export declare const InputDateRange: React.ForwardRefExoticComponent<InputDateRangeProps & React.RefAttributes<HTMLInputElement>>;
|
|
39
54
|
export default InputDateRange;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface InputDateRangeLocaleText {
|
|
2
|
+
/** Placeholder of the select. The `placeholder` prop still wins. */
|
|
3
|
+
placeholder: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const defaultInputDateRangeLocaleText: InputDateRangeLocaleText;
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the date range select texts. Precedence: the select's own `localeText`, then `MajooProvider`'s
|
|
8
|
+
* `localeText.inputDateRange`, then the app's `translation` keys, then the Indonesian defaults.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useInputDateRangeLocaleText: (localeText?: Partial<InputDateRangeLocaleText>) => InputDateRangeLocaleText;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { InputOtpLocaleText } from './locale';
|
|
2
3
|
interface InputOTPProps {
|
|
3
4
|
/**
|
|
4
5
|
* Number of input boxes.
|
|
@@ -98,8 +99,13 @@ interface ResendOTPProps {
|
|
|
98
99
|
* For adding class to root component.
|
|
99
100
|
*/
|
|
100
101
|
className?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Texts of this button. Keys left unset fall back to `MajooProvider`'s `localeText.inputOtp`, then the
|
|
104
|
+
* Indonesian defaults.
|
|
105
|
+
*/
|
|
106
|
+
localeText?: Partial<InputOtpLocaleText>;
|
|
101
107
|
}
|
|
102
|
-
export declare function ResendOTP(props: ResendOTPProps): JSX.Element;
|
|
108
|
+
export declare function ResendOTP({ localeText, ...props }: ResendOTPProps): JSX.Element;
|
|
103
109
|
export declare namespace ResendOTP {
|
|
104
110
|
var defaultProps: {
|
|
105
111
|
maxTime: number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface InputOtpLocaleText {
|
|
2
|
+
/** Label of `ResendOTP`; the remaining seconds follow it while the timer runs. */
|
|
3
|
+
resendButton: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const defaultInputOtpLocaleText: InputOtpLocaleText;
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the OTP texts. Precedence: the component's own `localeText`, then `MajooProvider`'s
|
|
8
|
+
* `localeText.inputOtp`, then the app's `MajooUI/inputOtp` translations, then the Indonesian defaults.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useInputOtpLocaleText: (localeText?: Partial<InputOtpLocaleText>) => InputOtpLocaleText;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type * as Stitches from '@stitches/react';
|
|
3
|
+
import { InputResourceListLocaleText } from './locale';
|
|
3
4
|
export interface IResource {
|
|
4
5
|
value: string;
|
|
5
6
|
label: string;
|
|
@@ -34,6 +35,12 @@ export interface InputResourceListProps {
|
|
|
34
35
|
customHeader?: JSX.Element;
|
|
35
36
|
expandable?: boolean;
|
|
36
37
|
searchable?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Texts of this list. Keys left unset fall back to `MajooProvider`'s `localeText.inputResourceList`,
|
|
40
|
+
* then the Indonesian defaults. `searchPlaceholder`, `title`, `emptyDataMessage` and
|
|
41
|
+
* `counterFooterText` still win.
|
|
42
|
+
*/
|
|
43
|
+
localeText?: Partial<InputResourceListLocaleText>;
|
|
37
44
|
}
|
|
38
|
-
declare function InputResourceList({ data: dataProp, disabled, onChange, searchPlaceholder, counterFooter, counterFooterText, isLoading, disabledItems, emptyDataMessage, value, fetchData, onQueryChange, css, wrapperCss, defaultSort, title, hideSelectAll, renderSelectAll, customHeader, expandable, searchable, }: InputResourceListProps): JSX.Element;
|
|
45
|
+
declare function InputResourceList({ data: dataProp, disabled, onChange, searchPlaceholder, counterFooter, counterFooterText, isLoading, disabledItems, emptyDataMessage, value, fetchData, onQueryChange, css, wrapperCss, defaultSort, title, hideSelectAll, renderSelectAll, customHeader, expandable, searchable, localeText, }: InputResourceListProps): JSX.Element;
|
|
39
46
|
export default InputResourceList;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface InputResourceListLocaleText {
|
|
2
|
+
/** The `searchPlaceholder` prop still wins. */
|
|
3
|
+
searchPlaceholder: string;
|
|
4
|
+
/** Heading next to the sort toggle. The `title` prop still wins. */
|
|
5
|
+
title: string;
|
|
6
|
+
/** The `emptyDataMessage` prop still wins. */
|
|
7
|
+
emptyDataText: string;
|
|
8
|
+
/** Follows the number of checked items. The `counterFooterText` prop still wins. */
|
|
9
|
+
counterLabel: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const defaultInputResourceListLocaleText: InputResourceListLocaleText;
|
|
12
|
+
/**
|
|
13
|
+
* Resolves the resource list texts. Precedence: the list's own `localeText`, then `MajooProvider`'s
|
|
14
|
+
* `localeText.inputResourceList`, then the app's `MajooUI/inputResourceList` translations, then the
|
|
15
|
+
* Indonesian defaults.
|
|
16
|
+
*/
|
|
17
|
+
export declare const useInputResourceListLocaleText: (localeText?: Partial<InputResourceListLocaleText>) => InputResourceListLocaleText;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface InputSearchboxLocaleText {
|
|
2
|
+
/** The `placeholder` prop still wins. */
|
|
3
|
+
placeholder: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const defaultInputSearchboxLocaleText: InputSearchboxLocaleText;
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the search box texts. Precedence: the search box's own `localeText`, then `MajooProvider`'s
|
|
8
|
+
* `localeText.inputSearchbox`, then the app's `MajooUI/inputSearchbox` translations, then the Indonesian
|
|
9
|
+
* defaults.
|
|
10
|
+
*/
|
|
11
|
+
export declare const useInputSearchboxLocaleText: (localeText?: Partial<InputSearchboxLocaleText>) => InputSearchboxLocaleText;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface InputSelectLocaleText {
|
|
2
|
+
/** Shown while nothing is selected, and as the mobile dialog title. The `placeholder` prop still wins. */
|
|
3
|
+
placeholder: string;
|
|
4
|
+
/** The `searchPlaceholder` prop still wins. */
|
|
5
|
+
searchPlaceholder: string;
|
|
6
|
+
/** Shown when no option matches. The `emptyDataMessage` prop still wins. */
|
|
7
|
+
emptyDataText: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const defaultInputSelectLocaleText: InputSelectLocaleText;
|
|
10
|
+
/**
|
|
11
|
+
* Resolves the select texts. Precedence: the select's own `localeText`, then `MajooProvider`'s
|
|
12
|
+
* `localeText.inputSelect`, then the app's `MajooUI/inputSelect` translations, then the Indonesian
|
|
13
|
+
* defaults.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useInputSelectLocaleText: (localeText?: Partial<InputSelectLocaleText>) => InputSelectLocaleText;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface InputSelectCheckLocaleText {
|
|
2
|
+
/** The `placeholder` prop still wins. */
|
|
3
|
+
placeholder: string;
|
|
4
|
+
/** The `selectAllLabel` prop still wins. */
|
|
5
|
+
selectAllLabel: string;
|
|
6
|
+
/** Toggle that expands or collapses the selected tags. */
|
|
7
|
+
showAllButton: string;
|
|
8
|
+
showLessButton: string;
|
|
9
|
+
/** Follows the number of selected items. The `labelCounter` prop still wins. */
|
|
10
|
+
counterLabel: string;
|
|
11
|
+
/** Shown when no option matches. The `textEmptyItem` prop still wins. */
|
|
12
|
+
emptyDataText: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const defaultInputSelectCheckLocaleText: InputSelectCheckLocaleText;
|
|
15
|
+
/**
|
|
16
|
+
* Resolves the multi-select texts. Precedence: the select's own `localeText`, then `MajooProvider`'s
|
|
17
|
+
* `localeText.inputSelectCheck`, then the app's `MajooUI/inputSelectCheck` translations, then the
|
|
18
|
+
* Indonesian defaults.
|
|
19
|
+
*/
|
|
20
|
+
export declare const useInputSelectCheckLocaleText: (localeText?: Partial<InputSelectCheckLocaleText>, locale?: string) => InputSelectCheckLocaleText;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CSS } from '@stitches/react';
|
|
3
|
+
import { InputSignatureLocaleText } from './locale';
|
|
3
4
|
interface InputSignatureProps {
|
|
4
5
|
onChange?: (value: string) => void;
|
|
5
6
|
title?: string;
|
|
@@ -7,6 +8,11 @@ interface InputSignatureProps {
|
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
css?: CSS;
|
|
9
10
|
isMobile?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Texts of this input. Keys left unset fall back to `MajooProvider`'s `localeText.inputSignature`,
|
|
13
|
+
* then the Indonesian defaults.
|
|
14
|
+
*/
|
|
15
|
+
localeText?: Partial<InputSignatureLocaleText>;
|
|
10
16
|
}
|
|
11
|
-
export declare function InputSignature({ title, onChange, defaultValue, disabled, css, isMobile, }: InputSignatureProps): JSX.Element;
|
|
17
|
+
export declare function InputSignature({ title, onChange, defaultValue, disabled, css, isMobile, localeText, }: InputSignatureProps): JSX.Element;
|
|
12
18
|
export default InputSignature;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface InputSignatureLocaleText {
|
|
2
|
+
/** Text inside the empty signature box. */
|
|
3
|
+
placeholder: string;
|
|
4
|
+
/** Modal title before and after a signature is drawn. The `title` prop still wins. */
|
|
5
|
+
addTitle: string;
|
|
6
|
+
editTitle: string;
|
|
7
|
+
cancelButton: string;
|
|
8
|
+
saveButton: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const defaultInputSignatureLocaleText: InputSignatureLocaleText;
|
|
11
|
+
/**
|
|
12
|
+
* Resolves the signature input texts. Precedence: the input's own `localeText`, then `MajooProvider`'s
|
|
13
|
+
* `localeText.inputSignature`, then the app's `MajooUI/inputSignature` translations, then the Indonesian
|
|
14
|
+
* defaults.
|
|
15
|
+
*/
|
|
16
|
+
export declare const useInputSignatureLocaleText: (localeText?: Partial<InputSignatureLocaleText>) => InputSignatureLocaleText;
|
|
@@ -14,12 +14,16 @@ export { default as InputTags } from './InputTags/InputTags';
|
|
|
14
14
|
export { default as InputSwitch } from './InputSwitch/InputSwitch';
|
|
15
15
|
export { default as InputSwitchWithImage } from './InputSwitch/InputSwitchWithImage';
|
|
16
16
|
export { default as InputSearchbox } from './InputSearchbox/InputSearchbox';
|
|
17
|
+
export type { InputSearchboxLocaleText } from './InputSearchbox/locale';
|
|
18
|
+
export { defaultInputSearchboxLocaleText } from './InputSearchbox/locale';
|
|
17
19
|
export { default as InputSelect } from './InputSelect/InputSelect';
|
|
18
20
|
export * from './InputSelect';
|
|
19
21
|
export { default as InputSelectCheck } from './InputSelectCheck/InputSelectCheck';
|
|
20
22
|
export { default as InputSelectTag } from './InputSelectTag/InputSelectTag';
|
|
21
23
|
export { default as InputCreatable } from './InputCreatable/InputCreatable';
|
|
22
24
|
export { default as InputResourceList } from './InputResourceList/InputResourceList';
|
|
25
|
+
export type { InputResourceListLocaleText } from './InputResourceList/locale';
|
|
26
|
+
export { defaultInputResourceListLocaleText } from './InputResourceList/locale';
|
|
23
27
|
export * from './InputCombobox';
|
|
24
28
|
export * from './InputOTP';
|
|
25
29
|
export * from './InputCounter';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ImageLocaleText {
|
|
2
|
+
/** Text of the default fallback shown when there is no `src` and no `fallback`. */
|
|
3
|
+
fallbackTitle: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const defaultImageLocaleText: ImageLocaleText;
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the image texts. Precedence: the image's own `localeText`, then `MajooProvider`'s
|
|
8
|
+
* `localeText.image`, then the app's `translation` keys, then the Indonesian defaults.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useImageLocaleText: (localeText?: Partial<ImageLocaleText>) => ImageLocaleText;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CSS } from '../../config/stitches.config';
|
|
3
|
+
import { PeriodSelectLocaleText } from './locale';
|
|
3
4
|
export type PeriodValue = 'day' | 'week' | 'month';
|
|
4
5
|
export interface PeriodSelectProps {
|
|
5
6
|
/**
|
|
@@ -53,12 +54,12 @@ export interface PeriodSelectProps {
|
|
|
53
54
|
*/
|
|
54
55
|
align?: 'start' | 'center' | 'end';
|
|
55
56
|
/**
|
|
56
|
-
* Replaces the label of one or more periods. Anything left out keeps
|
|
57
|
-
*
|
|
57
|
+
* Replaces the label of one or more periods. Anything left out keeps `localeText`'s `dayLabel`,
|
|
58
|
+
* `weekLabel` or `monthLabel`.
|
|
58
59
|
*/
|
|
59
60
|
periodLabels?: Partial<Record<PeriodValue, React.ReactNode>>;
|
|
60
61
|
/**
|
|
61
|
-
* Replaces the submenu heading above the start-day options.
|
|
62
|
+
* Replaces the submenu heading above the start-day options. Wins over `localeText.startWeekLabel`.
|
|
62
63
|
*/
|
|
63
64
|
startWeekLabel?: React.ReactNode;
|
|
64
65
|
/**
|
|
@@ -71,6 +72,16 @@ export interface PeriodSelectProps {
|
|
|
71
72
|
* Additional CSS trigger styles.
|
|
72
73
|
*/
|
|
73
74
|
css?: CSS;
|
|
75
|
+
/**
|
|
76
|
+
* Language of the weekday names. Falls back to `MajooProvider`'s `locale`, then the app's i18next
|
|
77
|
+
* language, then `id`.
|
|
78
|
+
*/
|
|
79
|
+
locale?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Texts of this select. Keys left unset fall back to `MajooProvider`'s `localeText.periodSelect`, then
|
|
82
|
+
* the Indonesian defaults.
|
|
83
|
+
*/
|
|
84
|
+
localeText?: Partial<PeriodSelectLocaleText>;
|
|
74
85
|
}
|
|
75
86
|
export interface WeekRange {
|
|
76
87
|
startDay: number;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface PeriodSelectLocaleText {
|
|
3
|
+
dayLabel: ReactNode;
|
|
4
|
+
weekLabel: ReactNode;
|
|
5
|
+
monthLabel: ReactNode;
|
|
6
|
+
/** Submenu heading above the start-day options. */
|
|
7
|
+
startWeekLabel: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const defaultPeriodSelectLocaleText: PeriodSelectLocaleText;
|
|
10
|
+
/**
|
|
11
|
+
* Resolves the period select texts. Precedence: the select's own `localeText`, then `MajooProvider`'s
|
|
12
|
+
* `localeText.periodSelect`, then the app's `MajooUI/periodSelect` translations, then the Indonesian
|
|
13
|
+
* defaults.
|
|
14
|
+
*/
|
|
15
|
+
export declare const usePeriodSelectLocaleText: (localeText?: Partial<PeriodSelectLocaleText>) => PeriodSelectLocaleText;
|
|
@@ -38,6 +38,7 @@ interface MobileTableProps {
|
|
|
38
38
|
footerColumnIds?: Set<string>;
|
|
39
39
|
headerRowSpan?: boolean;
|
|
40
40
|
keyId?: string;
|
|
41
|
+
sortColumnTitle?: string;
|
|
41
42
|
}
|
|
42
43
|
declare const MobileTable: React.ForwardRefExoticComponent<MobileTableProps & React.RefAttributes<HTMLDivElement>>;
|
|
43
44
|
export default MobileTable;
|