@majoo-ui/react 2.4.10 → 3.0.1
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 +45 -3
- package/components/alertDialog/locale.esm.js +2 -9
- package/components/avatar/Avatar.esm.js +14 -1
- package/components/banner/Banner.esm.js +47 -8
- package/components/buttonGroup/ButtonGroup.esm.js +39 -2
- package/components/datePicker/CustomDatePicker.esm.js +28 -14
- package/components/datePicker/InputDatePicker.esm.js +1 -3
- package/components/datePicker/locale.esm.js +8 -47
- package/components/drawer/Drawer.esm.js +26 -2
- package/components/dropdownMenu/DropdownMenu.esm.js +25 -2
- package/components/form/components/FormGroup/FormGroup.esm.js +12 -1
- package/components/form/components/FormHelper/Helper.esm.js +10 -1
- package/components/form/components/FormLabel/Label.esm.js +15 -1
- package/components/form/components/InputCheckbox/CheckboxGroup.esm.js +11 -1
- package/components/form/components/InputCounter/InputCounter.esm.js +4 -1
- package/components/form/components/InputCreatable/InputCreatable.esm.js +17 -1
- package/components/form/components/InputCreatable/locale.esm.js +2 -8
- package/components/form/components/InputDateRange/locale.esm.js +2 -5
- package/components/form/components/InputGroup/InputGroup.esm.js +13 -1
- package/components/form/components/InputOTP/locale.esm.js +2 -5
- package/components/form/components/InputRadio/InputRadio.esm.js +20 -2
- package/components/form/components/InputRadio/InputRadioGroup.esm.js +15 -1
- package/components/form/components/InputResourceList/locale.esm.js +2 -14
- package/components/form/components/InputSearchbox/locale.esm.js +2 -6
- package/components/form/components/InputSelect/InputSelect.esm.js +26 -1
- package/components/form/components/InputSelect/locale.esm.js +2 -11
- package/components/form/components/InputSelectCheck/InputSelectCheck.esm.js +58 -3
- package/components/form/components/InputSelectCheck/locale.esm.js +5 -14
- package/components/form/components/InputSelectTag/InputSelectTag.esm.js +6 -1
- package/components/form/components/InputSignature/locale.esm.js +2 -13
- package/components/form/components/InputSwitch/InputSwitch.esm.js +15 -1
- package/components/form/components/InputSwitch/InputSwitchWithImage.esm.js +19 -1
- package/components/form/components/InputTags/InputTags.esm.js +24 -1
- package/components/form/components/InputTextArea/InputTextArea.esm.js +16 -1
- package/components/image/locale.esm.js +2 -5
- package/components/notificationBadge/NotificationBadge.esm.js +14 -1
- package/components/pagination/Pagination.esm.js +26 -1
- package/components/paper/Paper.esm.js +14 -1
- package/components/periodSelect/locale.esm.js +2 -12
- package/components/popover/Popover.esm.js +41 -4
- package/components/progress/Progress.esm.js +16 -1
- package/components/slider/Slider.esm.js +24 -1
- package/components/table/Table.esm.js +4 -13
- package/components/table/components/columns/DateColumn.esm.js +2 -1
- package/components/table/locale.esm.js +4 -47
- package/components/tableOfContent/TableOfContent.esm.js +4 -0
- package/components/tabs/Tabs.esm.js +45 -4
- package/components/tagList/locale.esm.js +2 -10
- package/components/tagStatus/TagStatus.esm.js +14 -1
- package/components/toast/context/ToastProvider.esm.js +9 -1
- package/components/toast/context/locale.esm.js +2 -9
- package/components/upload/Upload.esm.js +50 -1
- package/config/locale/LocaleContext.esm.js +2 -8
- package/config/locale/useLocaleText.esm.js +4 -12
- package/index.esm.css +4 -4
- package/layout/grid/Grid.esm.js +29 -3
- package/layout/pageContainer/PageContainer.esm.js +12 -1
- package/majoo-provider/MajooProvider.esm.js +43 -13
- package/package.json +2 -4
- package/src/components/alertDialog/locale.d.ts +1 -1
- package/src/components/datePicker/CustomDatePicker.d.ts +12 -1
- package/src/components/datePicker/InputDatePicker.d.ts +10 -10
- package/src/components/datePicker/components/CalendarMulti.d.ts +1 -2
- package/src/components/datePicker/locale.d.ts +1 -2
- package/src/components/editableTable/EditableTable.d.ts +1 -0
- package/src/components/form/components/InputCounter/InputCounter.d.ts +1 -1
- package/src/components/form/components/InputCreatable/locale.d.ts +1 -2
- package/src/components/form/components/InputDateRange/InputDateRange.d.ts +2 -2
- package/src/components/form/components/InputDateRange/locale.d.ts +1 -1
- package/src/components/form/components/InputOTP/locale.d.ts +1 -1
- package/src/components/form/components/InputResourceList/locale.d.ts +1 -2
- package/src/components/form/components/InputSearchbox/locale.d.ts +1 -2
- package/src/components/form/components/InputSelect/locale.d.ts +1 -2
- package/src/components/form/components/InputSelectCheck/locale.d.ts +1 -2
- package/src/components/form/components/InputSignature/locale.d.ts +1 -2
- package/src/components/image/locale.d.ts +1 -1
- package/src/components/periodSelect/PeriodSelect.d.ts +1 -2
- package/src/components/periodSelect/locale.d.ts +1 -2
- package/src/components/table/locale.d.ts +2 -4
- package/src/components/tagList/locale.d.ts +1 -1
- package/src/components/toast/context/locale.d.ts +1 -1
- package/src/config/locale/LocaleContext.d.ts +1 -1
- package/src/config/locale/useLocaleText.d.ts +3 -3
|
@@ -1,29 +1,58 @@
|
|
|
1
|
-
import 'react';
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import ThemeProvider from './ThemeProvider.esm.js';
|
|
3
3
|
import { applyGlobalStyles } from './globalStyles.esm.js';
|
|
4
4
|
import { theme } from '../config/stitches.config.esm.js';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import { useTranslation } from 'react-i18next';
|
|
7
6
|
import moment from 'moment';
|
|
8
7
|
import { LocaleTextContext } from '../config/locale/LocaleTextContext.esm.js';
|
|
9
8
|
import { LocaleContext } from '../config/locale/LocaleContext.esm.js';
|
|
10
9
|
import { jsx } from 'react/jsx-runtime';
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
function MajooProvider(
|
|
12
|
+
/**
|
|
13
|
+
* @type {{
|
|
14
|
+
* name?: string,
|
|
15
|
+
* theme?: object,
|
|
16
|
+
* children: import('react').ReactNode,
|
|
17
|
+
* extendStyle?: object,
|
|
18
|
+
* disableGlobalStyle?: boolean,
|
|
19
|
+
* locale?: string,
|
|
20
|
+
* localeText?: {
|
|
21
|
+
* alertDialog?: object,
|
|
22
|
+
* datePicker?: object,
|
|
23
|
+
* image?: object,
|
|
24
|
+
* inputCreatable?: object,
|
|
25
|
+
* inputDateRange?: object,
|
|
26
|
+
* inputOtp?: object,
|
|
27
|
+
* inputResourceList?: object,
|
|
28
|
+
* inputSearchbox?: object,
|
|
29
|
+
* inputSelect?: object,
|
|
30
|
+
* inputSelectCheck?: object,
|
|
31
|
+
* inputSignature?: object,
|
|
32
|
+
* periodSelect?: object,
|
|
33
|
+
* table?: object,
|
|
34
|
+
* tagList?: object,
|
|
35
|
+
* toast?: object,
|
|
36
|
+
* },
|
|
37
|
+
* }}
|
|
38
|
+
*/
|
|
39
|
+
{
|
|
14
40
|
children,
|
|
15
41
|
name,
|
|
16
42
|
theme: theme$1 = theme,
|
|
17
43
|
extendStyle,
|
|
18
44
|
disableGlobalStyle,
|
|
19
|
-
locale,
|
|
20
|
-
localeText
|
|
45
|
+
locale: ownLocale,
|
|
46
|
+
localeText: ownLocaleText
|
|
21
47
|
}) {
|
|
48
|
+
// Left unset, both come from an enclosing MajooProvider. DevicePreview renders its preview inside
|
|
49
|
+
// one, which would otherwise switch the app-wide moment locale to `id`.
|
|
50
|
+
const enclosingLocale = React__default.useContext(LocaleContext);
|
|
51
|
+
const enclosingLocaleText = React__default.useContext(LocaleTextContext);
|
|
52
|
+
const locale = ownLocale || enclosingLocale;
|
|
53
|
+
const localeText = ownLocaleText || enclosingLocaleText;
|
|
22
54
|
!disableGlobalStyle && applyGlobalStyles(extendStyle, theme$1);
|
|
23
|
-
|
|
24
|
-
i18n
|
|
25
|
-
} = useTranslation();
|
|
26
|
-
moment.locale(locale || i18n && i18n.language || 'id');
|
|
55
|
+
moment.locale(locale || 'id');
|
|
27
56
|
return /*#__PURE__*/jsx(ThemeProvider, {
|
|
28
57
|
name: name,
|
|
29
58
|
theme: theme$1,
|
|
@@ -43,13 +72,14 @@ MajooProvider.propTypes = {
|
|
|
43
72
|
extendStyle: PropTypes.object,
|
|
44
73
|
disableGlobalStyle: PropTypes.bool,
|
|
45
74
|
/**
|
|
46
|
-
* Language of the components, e.g. `en` or `en-US`. Unset,
|
|
47
|
-
*
|
|
75
|
+
* Language of the components, e.g. `en` or `en-US`. Unset, an enclosing `MajooProvider`'s is used,
|
|
76
|
+
* else `id`. Also sets the `moment` locale.
|
|
48
77
|
*/
|
|
49
78
|
locale: PropTypes.string,
|
|
50
79
|
/**
|
|
51
80
|
* Component texts for the whole app, e.g. `{ table: { emptyDataTitle: 'No data' } }`.
|
|
52
|
-
* Memoize it: every new object re-renders all components that read it.
|
|
81
|
+
* Memoize it: every new object re-renders all components that read it. Unset, an enclosing
|
|
82
|
+
* `MajooProvider`'s is used.
|
|
53
83
|
*/
|
|
54
84
|
localeText: PropTypes.shape({
|
|
55
85
|
alertDialog: PropTypes.object,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@majoo-ui/react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"main": "./index.esm.js",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@floating-ui/react": "^0.19.2",
|
|
38
38
|
"@majoo-ui/core": "1.32.0",
|
|
39
39
|
"@majoo-ui/helpers": "1.30.10",
|
|
40
|
-
"@majoo-ui/icons": "1.
|
|
40
|
+
"@majoo-ui/icons": "1.41.0",
|
|
41
41
|
"@monsonjeremy/react-leaflet": "^3.2.2",
|
|
42
42
|
"@radix-ui/react-accordion": "^1.0.0",
|
|
43
43
|
"@radix-ui/react-alert-dialog": "^1.0.3",
|
|
@@ -62,7 +62,6 @@
|
|
|
62
62
|
"dayzed": "^3.2.3",
|
|
63
63
|
"downshift": "^6.1.7",
|
|
64
64
|
"draft-js": "^0.11.7",
|
|
65
|
-
"i18next": "^22.0.8",
|
|
66
65
|
"leaflet": "1.9.3",
|
|
67
66
|
"leaflet-defaulticon-compatibility": "^0.1.2",
|
|
68
67
|
"lodash": "^4.17.21",
|
|
@@ -73,7 +72,6 @@
|
|
|
73
72
|
"react-color": "^2.19.3",
|
|
74
73
|
"react-draft-wysiwyg": "^1.15.0",
|
|
75
74
|
"react-hook-form": "^7.31.3",
|
|
76
|
-
"react-i18next": "^12.0.0",
|
|
77
75
|
"react-image-crop": "^10.0.4",
|
|
78
76
|
"react-infinite-scroller": "^1.2.6",
|
|
79
77
|
"react-loading-skeleton": "^3.1.0",
|
|
@@ -5,6 +5,6 @@ export interface AlertDialogLocaleText {
|
|
|
5
5
|
export declare const defaultAlertDialogLocaleText: AlertDialogLocaleText;
|
|
6
6
|
/**
|
|
7
7
|
* Resolves the alert dialog texts. Precedence: the dialog's own `localeText`, then `MajooProvider`'s
|
|
8
|
-
* `localeText.alertDialog`, then the
|
|
8
|
+
* `localeText.alertDialog`, then the Indonesian defaults.
|
|
9
9
|
*/
|
|
10
10
|
export declare const useAlertDialogLocaleText: (localeText?: Partial<AlertDialogLocaleText>) => AlertDialogLocaleText;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ADVANCE_PICKER, RANGE_PICKER, SINGLE_PICKER, DATE_RANGE_PICKER } from './DatePicker';
|
|
3
3
|
import { PopoverPlacement } from '../../type/base.types';
|
|
4
|
+
import { DatePickerLocaleText } from './locale';
|
|
4
5
|
export interface CustomDatePickerProps {
|
|
5
6
|
children: React.ReactElement<any>;
|
|
6
7
|
/**
|
|
@@ -59,5 +60,15 @@ export interface CustomDatePickerProps {
|
|
|
59
60
|
* Specify distance between the children and DatePicker.
|
|
60
61
|
*/
|
|
61
62
|
sideOffset?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Language of the month and weekday names and the picked dates. Falls back to `MajooProvider`'s
|
|
65
|
+
* `locale`, then `id`.
|
|
66
|
+
*/
|
|
67
|
+
locale?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Texts of this date picker. Keys left unset fall back to `MajooProvider`'s `localeText.datePicker`,
|
|
70
|
+
* then to the Indonesian defaults (`defaultDatePickerLocaleText`).
|
|
71
|
+
*/
|
|
72
|
+
localeText?: Partial<DatePickerLocaleText>;
|
|
62
73
|
}
|
|
63
|
-
export declare function CustomDatePicker({ children, type, disabled, onChange, defaultValue: defaultDateValue, value: dateValue, defaultDate, date, advanceView, placement, showTimePicker, minDate, maxDate, allowReset, sideOffset, }: CustomDatePickerProps): JSX.Element;
|
|
74
|
+
export declare function CustomDatePicker({ children, type, disabled, onChange, defaultValue: defaultDateValue, value: dateValue, defaultDate, date, advanceView, placement, showTimePicker, minDate, maxDate, allowReset, sideOffset, locale, localeText, }: CustomDatePickerProps): JSX.Element;
|
|
@@ -7,39 +7,39 @@ interface TimePickerProps {
|
|
|
7
7
|
/**
|
|
8
8
|
Resize time picker.
|
|
9
9
|
*/
|
|
10
|
-
size
|
|
10
|
+
size?: 'sm' | 'lg';
|
|
11
11
|
/**
|
|
12
12
|
Change handler.
|
|
13
13
|
*/
|
|
14
|
-
onChange
|
|
14
|
+
onChange?: () => void;
|
|
15
15
|
/**
|
|
16
16
|
Time picker default value; support moment format.
|
|
17
17
|
*/
|
|
18
|
-
defaultValue
|
|
18
|
+
defaultValue?: Date;
|
|
19
19
|
/**
|
|
20
20
|
Time picker value; support moment format.
|
|
21
21
|
*/
|
|
22
|
-
value
|
|
22
|
+
value?: Date;
|
|
23
23
|
/**
|
|
24
24
|
Disabled state.
|
|
25
25
|
*/
|
|
26
|
-
disabled
|
|
26
|
+
disabled?: boolean;
|
|
27
27
|
/**
|
|
28
28
|
Disabled hour state.
|
|
29
29
|
*/
|
|
30
|
-
disabledHour
|
|
30
|
+
disabledHour?: boolean;
|
|
31
31
|
/**
|
|
32
32
|
Disabled minute state.
|
|
33
33
|
*/
|
|
34
|
-
disabledMinute
|
|
34
|
+
disabledMinute?: boolean;
|
|
35
35
|
/**
|
|
36
36
|
Specify the minimum date.
|
|
37
37
|
*/
|
|
38
|
-
minDate
|
|
38
|
+
minDate?: Date;
|
|
39
39
|
/**
|
|
40
40
|
Specify the maximum date.
|
|
41
41
|
*/
|
|
42
|
-
maxDate
|
|
42
|
+
maxDate?: Date;
|
|
43
43
|
}
|
|
44
44
|
export interface InputDatePickerProps {
|
|
45
45
|
/**
|
|
@@ -177,7 +177,7 @@ export interface InputDatePickerProps {
|
|
|
177
177
|
monthRangeHelper?: React.ReactNode;
|
|
178
178
|
/**
|
|
179
179
|
* Language of the month and weekday names and the picked dates. Falls back to `MajooProvider`'s
|
|
180
|
-
* `locale`, then
|
|
180
|
+
* `locale`, then `id`.
|
|
181
181
|
*/
|
|
182
182
|
locale?: string;
|
|
183
183
|
/**
|
|
@@ -17,8 +17,7 @@ export interface CalendarProps extends RenderProps {
|
|
|
17
17
|
maxDate?: Date;
|
|
18
18
|
disabledDate?: Date[];
|
|
19
19
|
/**
|
|
20
|
-
* Language of the month and weekday names. Falls back to `MajooProvider`'s `locale`, then
|
|
21
|
-
* app's i18next language, then `id`.
|
|
20
|
+
* Language of the month and weekday names. Falls back to `MajooProvider`'s `locale`, then `id`.
|
|
22
21
|
*/
|
|
23
22
|
locale?: string;
|
|
24
23
|
}
|
|
@@ -37,12 +37,11 @@ export interface DatePickerLocaleText {
|
|
|
37
37
|
nextYearLabel: string;
|
|
38
38
|
}
|
|
39
39
|
export declare const defaultDatePickerLocaleText: DatePickerLocaleText;
|
|
40
|
-
export declare const i18nDatePickerLocaleText: (t: any, locale: MajooLocale) => DatePickerLocaleText;
|
|
41
40
|
/** Later sources win; an `undefined` value never erases an earlier one. */
|
|
42
41
|
export declare const mergeDatePickerLocaleText: (base: DatePickerLocaleText, ...overrides: (Partial<DatePickerLocaleText> | undefined)[]) => DatePickerLocaleText;
|
|
43
42
|
/**
|
|
44
43
|
* Resolves the date picker texts. Precedence: the component's own `localeText`, then `MajooProvider`'s
|
|
45
|
-
* `localeText.datePicker`, then the
|
|
44
|
+
* `localeText.datePicker`, then the defaults (Indonesian, except the quick range and month range texts for `en`).
|
|
46
45
|
*/
|
|
47
46
|
export declare const useDatePickerLocaleText: (locale: MajooLocale, localeText?: Partial<DatePickerLocaleText>) => DatePickerLocaleText;
|
|
48
47
|
/** The quick range options with their labels taken from the resolved texts. */
|
|
@@ -7,7 +7,6 @@ export interface InputCreatableLocaleText {
|
|
|
7
7
|
export declare const defaultInputCreatableLocaleText: InputCreatableLocaleText;
|
|
8
8
|
/**
|
|
9
9
|
* Resolves the creatable input texts. Precedence: the input's own `localeText`, then `MajooProvider`'s
|
|
10
|
-
* `localeText.inputCreatable`, then the
|
|
11
|
-
* defaults.
|
|
10
|
+
* `localeText.inputCreatable`, then the Indonesian defaults.
|
|
12
11
|
*/
|
|
13
12
|
export declare const useInputCreatableLocaleText: (localeText?: Partial<InputCreatableLocaleText>) => InputCreatableLocaleText;
|
|
@@ -37,8 +37,8 @@ interface InputDateRangeProps extends InputSelectProps {
|
|
|
37
37
|
*/
|
|
38
38
|
css?: CSS;
|
|
39
39
|
/**
|
|
40
|
-
* Language the quick range labels follow
|
|
41
|
-
*
|
|
40
|
+
* Language the quick range labels follow (`en` defaults to the English ones). Falls back to
|
|
41
|
+
* `MajooProvider`'s `locale`, then `id`.
|
|
42
42
|
*/
|
|
43
43
|
locale?: string;
|
|
44
44
|
/**
|
|
@@ -5,6 +5,6 @@ export interface InputDateRangeLocaleText {
|
|
|
5
5
|
export declare const defaultInputDateRangeLocaleText: InputDateRangeLocaleText;
|
|
6
6
|
/**
|
|
7
7
|
* Resolves the date range select texts. Precedence: the select's own `localeText`, then `MajooProvider`'s
|
|
8
|
-
* `localeText.inputDateRange`, then the
|
|
8
|
+
* `localeText.inputDateRange`, then the Indonesian defaults.
|
|
9
9
|
*/
|
|
10
10
|
export declare const useInputDateRangeLocaleText: (localeText?: Partial<InputDateRangeLocaleText>) => InputDateRangeLocaleText;
|
|
@@ -5,6 +5,6 @@ export interface InputOtpLocaleText {
|
|
|
5
5
|
export declare const defaultInputOtpLocaleText: InputOtpLocaleText;
|
|
6
6
|
/**
|
|
7
7
|
* Resolves the OTP texts. Precedence: the component's own `localeText`, then `MajooProvider`'s
|
|
8
|
-
* `localeText.inputOtp`, then the
|
|
8
|
+
* `localeText.inputOtp`, then the Indonesian defaults.
|
|
9
9
|
*/
|
|
10
10
|
export declare const useInputOtpLocaleText: (localeText?: Partial<InputOtpLocaleText>) => InputOtpLocaleText;
|
|
@@ -11,7 +11,6 @@ export interface InputResourceListLocaleText {
|
|
|
11
11
|
export declare const defaultInputResourceListLocaleText: InputResourceListLocaleText;
|
|
12
12
|
/**
|
|
13
13
|
* Resolves the resource list texts. Precedence: the list's own `localeText`, then `MajooProvider`'s
|
|
14
|
-
* `localeText.inputResourceList`, then the
|
|
15
|
-
* Indonesian defaults.
|
|
14
|
+
* `localeText.inputResourceList`, then the Indonesian defaults.
|
|
16
15
|
*/
|
|
17
16
|
export declare const useInputResourceListLocaleText: (localeText?: Partial<InputResourceListLocaleText>) => InputResourceListLocaleText;
|
|
@@ -5,7 +5,6 @@ export interface InputSearchboxLocaleText {
|
|
|
5
5
|
export declare const defaultInputSearchboxLocaleText: InputSearchboxLocaleText;
|
|
6
6
|
/**
|
|
7
7
|
* Resolves the search box texts. Precedence: the search box's own `localeText`, then `MajooProvider`'s
|
|
8
|
-
* `localeText.inputSearchbox`, then the
|
|
9
|
-
* defaults.
|
|
8
|
+
* `localeText.inputSearchbox`, then the Indonesian defaults.
|
|
10
9
|
*/
|
|
11
10
|
export declare const useInputSearchboxLocaleText: (localeText?: Partial<InputSearchboxLocaleText>) => InputSearchboxLocaleText;
|
|
@@ -9,7 +9,6 @@ export interface InputSelectLocaleText {
|
|
|
9
9
|
export declare const defaultInputSelectLocaleText: InputSelectLocaleText;
|
|
10
10
|
/**
|
|
11
11
|
* Resolves the select texts. Precedence: the select's own `localeText`, then `MajooProvider`'s
|
|
12
|
-
* `localeText.inputSelect`, then the
|
|
13
|
-
* defaults.
|
|
12
|
+
* `localeText.inputSelect`, then the Indonesian defaults.
|
|
14
13
|
*/
|
|
15
14
|
export declare const useInputSelectLocaleText: (localeText?: Partial<InputSelectLocaleText>) => InputSelectLocaleText;
|
|
@@ -14,7 +14,6 @@ export interface InputSelectCheckLocaleText {
|
|
|
14
14
|
export declare const defaultInputSelectCheckLocaleText: InputSelectCheckLocaleText;
|
|
15
15
|
/**
|
|
16
16
|
* Resolves the multi-select texts. Precedence: the select's own `localeText`, then `MajooProvider`'s
|
|
17
|
-
* `localeText.inputSelectCheck`, then the
|
|
18
|
-
* Indonesian defaults.
|
|
17
|
+
* `localeText.inputSelectCheck`, then the defaults (Indonesian, except `selectAllLabel` for `en`).
|
|
19
18
|
*/
|
|
20
19
|
export declare const useInputSelectCheckLocaleText: (localeText?: Partial<InputSelectCheckLocaleText>, locale?: string) => InputSelectCheckLocaleText;
|
|
@@ -10,7 +10,6 @@ export interface InputSignatureLocaleText {
|
|
|
10
10
|
export declare const defaultInputSignatureLocaleText: InputSignatureLocaleText;
|
|
11
11
|
/**
|
|
12
12
|
* Resolves the signature input texts. Precedence: the input's own `localeText`, then `MajooProvider`'s
|
|
13
|
-
* `localeText.inputSignature`, then the
|
|
14
|
-
* defaults.
|
|
13
|
+
* `localeText.inputSignature`, then the Indonesian defaults.
|
|
15
14
|
*/
|
|
16
15
|
export declare const useInputSignatureLocaleText: (localeText?: Partial<InputSignatureLocaleText>) => InputSignatureLocaleText;
|
|
@@ -5,6 +5,6 @@ export interface ImageLocaleText {
|
|
|
5
5
|
export declare const defaultImageLocaleText: ImageLocaleText;
|
|
6
6
|
/**
|
|
7
7
|
* Resolves the image texts. Precedence: the image's own `localeText`, then `MajooProvider`'s
|
|
8
|
-
* `localeText.image`, then the
|
|
8
|
+
* `localeText.image`, then the Indonesian defaults.
|
|
9
9
|
*/
|
|
10
10
|
export declare const useImageLocaleText: (localeText?: Partial<ImageLocaleText>) => ImageLocaleText;
|
|
@@ -73,8 +73,7 @@ export interface PeriodSelectProps {
|
|
|
73
73
|
*/
|
|
74
74
|
css?: CSS;
|
|
75
75
|
/**
|
|
76
|
-
* Language of the weekday names. Falls back to `MajooProvider`'s `locale`, then
|
|
77
|
-
* language, then `id`.
|
|
76
|
+
* Language of the weekday names. Falls back to `MajooProvider`'s `locale`, then `id`.
|
|
78
77
|
*/
|
|
79
78
|
locale?: string;
|
|
80
79
|
/**
|
|
@@ -9,7 +9,6 @@ export interface PeriodSelectLocaleText {
|
|
|
9
9
|
export declare const defaultPeriodSelectLocaleText: PeriodSelectLocaleText;
|
|
10
10
|
/**
|
|
11
11
|
* Resolves the period select texts. Precedence: the select's own `localeText`, then `MajooProvider`'s
|
|
12
|
-
* `localeText.periodSelect`, then the
|
|
13
|
-
* defaults.
|
|
12
|
+
* `localeText.periodSelect`, then the Indonesian defaults.
|
|
14
13
|
*/
|
|
15
14
|
export declare const usePeriodSelectLocaleText: (localeText?: Partial<PeriodSelectLocaleText>) => PeriodSelectLocaleText;
|
|
@@ -29,12 +29,10 @@ export interface TableLocaleText {
|
|
|
29
29
|
pagination: PaginationLabel;
|
|
30
30
|
}
|
|
31
31
|
export declare const defaultTableLocaleText: TableLocaleText;
|
|
32
|
-
export declare const i18nTableLocaleText: (t: any) => TableLocaleText;
|
|
33
32
|
/** Later sources win; an `undefined` value never erases an earlier one. */
|
|
34
33
|
export declare const mergeTableLocaleText: (base: TableLocaleText, ...overrides: (Partial<TableLocaleText> | undefined)[]) => TableLocaleText;
|
|
35
34
|
/**
|
|
36
35
|
* Resolves the table texts. Precedence: the table's own `localeText`, then `MajooProvider`'s
|
|
37
|
-
* `localeText.table`, then the
|
|
38
|
-
* Several table-level overrides may be passed; later ones win. Pass the same number on every render.
|
|
36
|
+
* `localeText.table`, then the Indonesian defaults.
|
|
39
37
|
*/
|
|
40
|
-
export declare const useTableLocaleText: (
|
|
38
|
+
export declare const useTableLocaleText: (localeText?: Partial<TableLocaleText>) => TableLocaleText;
|
|
@@ -8,6 +8,6 @@ export interface TagListLocaleText {
|
|
|
8
8
|
export declare const defaultTagListLocaleText: TagListLocaleText;
|
|
9
9
|
/**
|
|
10
10
|
* Resolves the tag list texts. Precedence: the list's own `localeText`, then `MajooProvider`'s
|
|
11
|
-
* `localeText.tagList`, then the
|
|
11
|
+
* `localeText.tagList`, then the Indonesian defaults.
|
|
12
12
|
*/
|
|
13
13
|
export declare const useTagListLocaleText: (localeText?: Partial<TagListLocaleText>) => TagListLocaleText;
|
|
@@ -6,6 +6,6 @@ export interface ToastLocaleText {
|
|
|
6
6
|
export declare const defaultToastLocaleText: ToastLocaleText;
|
|
7
7
|
/**
|
|
8
8
|
* Resolves the toast texts. Precedence: `ToastProvider`'s own `localeText`, then `MajooProvider`'s
|
|
9
|
-
* `localeText.toast`, then the
|
|
9
|
+
* `localeText.toast`, then the Indonesian defaults.
|
|
10
10
|
*/
|
|
11
11
|
export declare const useToastLocaleText: (localeText?: Partial<ToastLocaleText>) => ToastLocaleText;
|
|
@@ -8,6 +8,6 @@ export declare const LocaleContext: React.Context<string | undefined>;
|
|
|
8
8
|
export declare const normalizeLocale: (locale?: string | null) => MajooLocale;
|
|
9
9
|
/**
|
|
10
10
|
* Resolves the language. Precedence: the component's own `locale`, then `MajooProvider`'s `locale`,
|
|
11
|
-
* then
|
|
11
|
+
* then `id`.
|
|
12
12
|
*/
|
|
13
13
|
export declare const useLocale: (locale?: string) => MajooLocale;
|
|
@@ -4,7 +4,7 @@ import { MajooLocale } from './LocaleContext';
|
|
|
4
4
|
export declare const mergeLocaleText: <T extends object>(base: T, ...overrides: (Partial<T> | undefined)[]) => T;
|
|
5
5
|
/**
|
|
6
6
|
* Resolves the flat texts of a component. Precedence: the component's own `localeText`, then
|
|
7
|
-
* `MajooProvider`'s `localeText[key]`, then
|
|
8
|
-
*
|
|
7
|
+
* `MajooProvider`'s `localeText[key]`, then `defaults`. Pass `defaults` as a function of the resolved
|
|
8
|
+
* language when some default texts differ per language.
|
|
9
9
|
*/
|
|
10
|
-
export declare const useLocaleText: <T extends object>(key: keyof MajooLocaleText,
|
|
10
|
+
export declare const useLocaleText: <T extends object>(key: keyof MajooLocaleText, defaults: T | ((locale: MajooLocale) => T), localeText?: Partial<T>, locale?: string) => T;
|