@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
|
@@ -143,7 +143,23 @@ const Item = styled('div', {
|
|
|
143
143
|
cursor: 'pointer',
|
|
144
144
|
lineHeight: '20px'
|
|
145
145
|
});
|
|
146
|
-
const InputCreatable =
|
|
146
|
+
const InputCreatable =
|
|
147
|
+
/*#__PURE__*/
|
|
148
|
+
/**
|
|
149
|
+
* @type {React.ForwardRefExoticComponent<{
|
|
150
|
+
* placeholder?: string,
|
|
151
|
+
* size?: string,
|
|
152
|
+
* value?: string,
|
|
153
|
+
* onChange?: Function,
|
|
154
|
+
* onClickItem?: Function,
|
|
155
|
+
* maxChar?: number,
|
|
156
|
+
* isInvalid?: boolean,
|
|
157
|
+
* disabled?: boolean,
|
|
158
|
+
* readOnly?: boolean,
|
|
159
|
+
* localeText?: { addOptionLabel?: Function },
|
|
160
|
+
* } & React.RefAttributes<HTMLInputElement>>}
|
|
161
|
+
*/
|
|
162
|
+
React__default.forwardRef(function InputCreatable({
|
|
147
163
|
size,
|
|
148
164
|
isInvalid,
|
|
149
165
|
placeholder,
|
|
@@ -5,16 +5,10 @@ const defaultInputCreatableLocaleText = {
|
|
|
5
5
|
value
|
|
6
6
|
}) => `Tambah "${value}"`
|
|
7
7
|
};
|
|
8
|
-
const i18nInputCreatableLocaleText = t => ({
|
|
9
|
-
addOptionLabel: ({
|
|
10
|
-
value
|
|
11
|
-
}) => `${t('addText', 'Tambah')} "${value}"`
|
|
12
|
-
});
|
|
13
8
|
/**
|
|
14
9
|
* Resolves the creatable input texts. Precedence: the input's own `localeText`, then `MajooProvider`'s
|
|
15
|
-
* `localeText.inputCreatable`, then the
|
|
16
|
-
* defaults.
|
|
10
|
+
* `localeText.inputCreatable`, then the Indonesian defaults.
|
|
17
11
|
*/
|
|
18
|
-
const useInputCreatableLocaleText = localeText => useLocaleText('inputCreatable',
|
|
12
|
+
const useInputCreatableLocaleText = localeText => useLocaleText('inputCreatable', defaultInputCreatableLocaleText, localeText);
|
|
19
13
|
|
|
20
14
|
export { defaultInputCreatableLocaleText, useInputCreatableLocaleText };
|
|
@@ -3,13 +3,10 @@ import { useLocaleText } from '../../../../config/locale/useLocaleText.esm.js';
|
|
|
3
3
|
const defaultInputDateRangeLocaleText = {
|
|
4
4
|
placeholder: 'Pilih'
|
|
5
5
|
};
|
|
6
|
-
const i18nInputDateRangeLocaleText = t => ({
|
|
7
|
-
placeholder: t('placeholder.select', defaultInputDateRangeLocaleText.placeholder)
|
|
8
|
-
});
|
|
9
6
|
/**
|
|
10
7
|
* Resolves the date range select texts. Precedence: the select's own `localeText`, then `MajooProvider`'s
|
|
11
|
-
* `localeText.inputDateRange`, then the
|
|
8
|
+
* `localeText.inputDateRange`, then the Indonesian defaults.
|
|
12
9
|
*/
|
|
13
|
-
const useInputDateRangeLocaleText = localeText => useLocaleText('inputDateRange',
|
|
10
|
+
const useInputDateRangeLocaleText = localeText => useLocaleText('inputDateRange', defaultInputDateRangeLocaleText, localeText);
|
|
14
11
|
|
|
15
12
|
export { defaultInputDateRangeLocaleText, useInputDateRangeLocaleText };
|
|
@@ -140,7 +140,19 @@ const InputGroupStyle = styled('div', {
|
|
|
140
140
|
size: 'lg'
|
|
141
141
|
}
|
|
142
142
|
});
|
|
143
|
-
const InputGroup = (
|
|
143
|
+
const InputGroup = (
|
|
144
|
+
/**
|
|
145
|
+
* @type {{
|
|
146
|
+
* children: import('react').ReactNode,
|
|
147
|
+
* size?: 'sm' | 'lg',
|
|
148
|
+
* isInvalid?: boolean,
|
|
149
|
+
* readOnly?: boolean,
|
|
150
|
+
* disabled?: boolean,
|
|
151
|
+
* css?: object,
|
|
152
|
+
* [key: string]: any,
|
|
153
|
+
* }}
|
|
154
|
+
*/
|
|
155
|
+
{
|
|
144
156
|
children,
|
|
145
157
|
size = 'lg',
|
|
146
158
|
...rest
|
|
@@ -3,13 +3,10 @@ import { useLocaleText } from '../../../../config/locale/useLocaleText.esm.js';
|
|
|
3
3
|
const defaultInputOtpLocaleText = {
|
|
4
4
|
resendButton: 'Kirim Ulang'
|
|
5
5
|
};
|
|
6
|
-
const i18nInputOtpLocaleText = t => ({
|
|
7
|
-
resendButton: t('resendingText', defaultInputOtpLocaleText.resendButton)
|
|
8
|
-
});
|
|
9
6
|
/**
|
|
10
7
|
* Resolves the OTP texts. Precedence: the component's own `localeText`, then `MajooProvider`'s
|
|
11
|
-
* `localeText.inputOtp`, then the
|
|
8
|
+
* `localeText.inputOtp`, then the Indonesian defaults.
|
|
12
9
|
*/
|
|
13
|
-
const useInputOtpLocaleText = localeText => useLocaleText('inputOtp',
|
|
10
|
+
const useInputOtpLocaleText = localeText => useLocaleText('inputOtp', defaultInputOtpLocaleText, localeText);
|
|
14
11
|
|
|
15
12
|
export { defaultInputOtpLocaleText, useInputOtpLocaleText };
|
|
@@ -166,7 +166,25 @@ const ContainerLabel = styled('label', {
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
});
|
|
169
|
-
const InputRadio = (
|
|
169
|
+
const InputRadio = (
|
|
170
|
+
/**
|
|
171
|
+
* @type {{
|
|
172
|
+
* id?: string,
|
|
173
|
+
* value?: string,
|
|
174
|
+
* label?: import('react').ReactNode,
|
|
175
|
+
* description?: import('react').ReactNode,
|
|
176
|
+
* disabled?: boolean,
|
|
177
|
+
* readOnly?: boolean,
|
|
178
|
+
* css?: object,
|
|
179
|
+
* inputType?: 'number' | 'text' | 'default',
|
|
180
|
+
* inputProps?: object,
|
|
181
|
+
* onChange?: Function,
|
|
182
|
+
* outlined?: boolean,
|
|
183
|
+
* block?: boolean,
|
|
184
|
+
* [key: string]: any,
|
|
185
|
+
* }}
|
|
186
|
+
*/
|
|
187
|
+
{
|
|
170
188
|
id,
|
|
171
189
|
disabled,
|
|
172
190
|
css,
|
|
@@ -268,7 +286,7 @@ InputRadio.propTypes = {
|
|
|
268
286
|
css: PropTypes.object,
|
|
269
287
|
inputType: PropTypes.oneOf(['number', 'text', 'default']),
|
|
270
288
|
onChange: PropTypes.func,
|
|
271
|
-
description: PropTypes.
|
|
289
|
+
description: PropTypes.node,
|
|
272
290
|
readOnly: PropTypes.bool
|
|
273
291
|
};
|
|
274
292
|
InputRadio.displayName = 'InputRadio';
|
|
@@ -9,7 +9,21 @@ import { InputRadioContext } from './context.esm.js';
|
|
|
9
9
|
import { jsx } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
11
|
const RadioGroup = styled(RadioGroupPrimitive.Root, Flex);
|
|
12
|
-
const InputRadioGroup =
|
|
12
|
+
const InputRadioGroup =
|
|
13
|
+
/*#__PURE__*/
|
|
14
|
+
/**
|
|
15
|
+
* @type {React.ForwardRefExoticComponent<{
|
|
16
|
+
* children?: React.ReactNode,
|
|
17
|
+
* defaultValue?: string,
|
|
18
|
+
* value?: string,
|
|
19
|
+
* onValueChange?: (value: string) => void,
|
|
20
|
+
* disabled?: boolean,
|
|
21
|
+
* outlined?: boolean,
|
|
22
|
+
* block?: boolean,
|
|
23
|
+
* [key: string]: any,
|
|
24
|
+
* } & React.RefAttributes<HTMLDivElement>>}
|
|
25
|
+
*/
|
|
26
|
+
React__default.forwardRef(function InputRadioGroup(props, ref) {
|
|
13
27
|
const {
|
|
14
28
|
children,
|
|
15
29
|
outlined: _outlined,
|
|
@@ -6,22 +6,10 @@ const defaultInputResourceListLocaleText = {
|
|
|
6
6
|
emptyDataText: 'Tidak ada data',
|
|
7
7
|
counterLabel: 'kategori dipilih'
|
|
8
8
|
};
|
|
9
|
-
const i18nInputResourceListLocaleText = t => {
|
|
10
|
-
const d = defaultInputResourceListLocaleText;
|
|
11
|
-
return {
|
|
12
|
-
searchPlaceholder: t('placeholder.search', d.searchPlaceholder),
|
|
13
|
-
title: t('defaultTitle', d.title),
|
|
14
|
-
emptyDataText: t('label.noData', d.emptyDataText, {
|
|
15
|
-
ns: 'translation'
|
|
16
|
-
}),
|
|
17
|
-
counterLabel: t('counterFooterText', d.counterLabel)
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
9
|
/**
|
|
21
10
|
* Resolves the resource list texts. Precedence: the list's own `localeText`, then `MajooProvider`'s
|
|
22
|
-
* `localeText.inputResourceList`, then the
|
|
23
|
-
* Indonesian defaults.
|
|
11
|
+
* `localeText.inputResourceList`, then the Indonesian defaults.
|
|
24
12
|
*/
|
|
25
|
-
const useInputResourceListLocaleText = localeText => useLocaleText('inputResourceList',
|
|
13
|
+
const useInputResourceListLocaleText = localeText => useLocaleText('inputResourceList', defaultInputResourceListLocaleText, localeText);
|
|
26
14
|
|
|
27
15
|
export { defaultInputResourceListLocaleText, useInputResourceListLocaleText };
|
|
@@ -3,14 +3,10 @@ import { useLocaleText } from '../../../../config/locale/useLocaleText.esm.js';
|
|
|
3
3
|
const defaultInputSearchboxLocaleText = {
|
|
4
4
|
placeholder: 'Cari ...'
|
|
5
5
|
};
|
|
6
|
-
const i18nInputSearchboxLocaleText = t => ({
|
|
7
|
-
placeholder: t('placeholder', defaultInputSearchboxLocaleText.placeholder)
|
|
8
|
-
});
|
|
9
6
|
/**
|
|
10
7
|
* Resolves the search box texts. Precedence: the search box's own `localeText`, then `MajooProvider`'s
|
|
11
|
-
* `localeText.inputSearchbox`, then the
|
|
12
|
-
* defaults.
|
|
8
|
+
* `localeText.inputSearchbox`, then the Indonesian defaults.
|
|
13
9
|
*/
|
|
14
|
-
const useInputSearchboxLocaleText = localeText => useLocaleText('inputSearchbox',
|
|
10
|
+
const useInputSearchboxLocaleText = localeText => useLocaleText('inputSearchbox', defaultInputSearchboxLocaleText, localeText);
|
|
15
11
|
|
|
16
12
|
export { defaultInputSearchboxLocaleText, useInputSearchboxLocaleText };
|
|
@@ -7,7 +7,7 @@ import 'core-js/modules/es.iterator.map.js';
|
|
|
7
7
|
import 'core-js/modules/es.iterator.reduce.js';
|
|
8
8
|
import { __rest, __awaiter } from 'tslib';
|
|
9
9
|
import * as React from 'react';
|
|
10
|
-
import { useState, useRef,
|
|
10
|
+
import { useState, useRef, useEffect, useCallback, createElement } from 'react';
|
|
11
11
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
12
12
|
import { renderToString } from 'react-dom/server';
|
|
13
13
|
import Downshift from 'downshift';
|
|
@@ -411,6 +411,24 @@ const InputSelect = /*#__PURE__*/React.forwardRef((_a, ref) => {
|
|
|
411
411
|
const selectBoxRef = useRef(null);
|
|
412
412
|
const scrollerRef = useRef(null);
|
|
413
413
|
const downshiftMenuRef = useRef();
|
|
414
|
+
const footerRef = useRef(null);
|
|
415
|
+
const isReleaseInFooterRef = useRef(false);
|
|
416
|
+
const hasFooter = typeof renderFooter === 'function';
|
|
417
|
+
// Captured on document so it is set before Downshift's own mouseup/touchend listeners on window read it.
|
|
418
|
+
useEffect(() => {
|
|
419
|
+
if (!open || !hasFooter || isMobile) return undefined;
|
|
420
|
+
const handleRelease = event => {
|
|
421
|
+
var _a;
|
|
422
|
+
isReleaseInFooterRef.current = Boolean((_a = footerRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target));
|
|
423
|
+
};
|
|
424
|
+
document.addEventListener('mouseup', handleRelease, true);
|
|
425
|
+
document.addEventListener('touchend', handleRelease, true);
|
|
426
|
+
return () => {
|
|
427
|
+
isReleaseInFooterRef.current = false;
|
|
428
|
+
document.removeEventListener('mouseup', handleRelease, true);
|
|
429
|
+
document.removeEventListener('touchend', handleRelease, true);
|
|
430
|
+
};
|
|
431
|
+
}, [open, hasFooter, isMobile]);
|
|
414
432
|
// The desktop menu shows only while Downshift's isOpen and the Popover's own open state are both true,
|
|
415
433
|
// and each one opens and closes itself: the search input toggles Downshift only while it is closed, the
|
|
416
434
|
// Popover trigger toggles on every click and also closes on outside press or ancestor scroll. Kept as two
|
|
@@ -553,6 +571,11 @@ const InputSelect = /*#__PURE__*/React.forwardRef((_a, ref) => {
|
|
|
553
571
|
return {
|
|
554
572
|
isOpen: state.isOpen
|
|
555
573
|
};
|
|
574
|
+
// The desktop footer sits outside getMenuProps, so Downshift takes a press on it for an outside click;
|
|
575
|
+
// closing here unmounts the Popover before the footer's click fires. The footer closes the menu itself.
|
|
576
|
+
case Downshift.stateChangeTypes.mouseUp:
|
|
577
|
+
case Downshift.stateChangeTypes.touchEnd:
|
|
578
|
+
return isReleaseInFooterRef.current ? {} : changes;
|
|
556
579
|
// Downshift wipes selectedItem on Escape whenever its own isOpen is already false,
|
|
557
580
|
// firing onChange(null) on consumers that never asked to clear the selection.
|
|
558
581
|
// Escape only closes the menu and restores the label of the current selection.
|
|
@@ -741,6 +764,8 @@ const InputSelect = /*#__PURE__*/React.forwardRef((_a, ref) => {
|
|
|
741
764
|
width: '100%'
|
|
742
765
|
},
|
|
743
766
|
children: [child, renderFooter && typeof renderFooter === 'function' && jsx(StyledFooter, {
|
|
767
|
+
ref: footerRef,
|
|
768
|
+
onClick: () => closeMenu(),
|
|
744
769
|
children: renderFooter === null || renderFooter === void 0 ? void 0 : renderFooter()
|
|
745
770
|
})]
|
|
746
771
|
}),
|
|
@@ -5,19 +5,10 @@ const defaultInputSelectLocaleText = {
|
|
|
5
5
|
searchPlaceholder: 'Cari ...',
|
|
6
6
|
emptyDataText: 'Item tidak ditemukan'
|
|
7
7
|
};
|
|
8
|
-
const i18nInputSelectLocaleText = t => {
|
|
9
|
-
const d = defaultInputSelectLocaleText;
|
|
10
|
-
return {
|
|
11
|
-
placeholder: t('placeholder', d.placeholder),
|
|
12
|
-
searchPlaceholder: t('searchPlaceholder', d.searchPlaceholder),
|
|
13
|
-
emptyDataText: t('noItemPlaceholder', d.emptyDataText)
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
8
|
/**
|
|
17
9
|
* Resolves the select texts. Precedence: the select's own `localeText`, then `MajooProvider`'s
|
|
18
|
-
* `localeText.inputSelect`, then the
|
|
19
|
-
* defaults.
|
|
10
|
+
* `localeText.inputSelect`, then the Indonesian defaults.
|
|
20
11
|
*/
|
|
21
|
-
const useInputSelectLocaleText = localeText => useLocaleText('inputSelect',
|
|
12
|
+
const useInputSelectLocaleText = localeText => useLocaleText('inputSelect', defaultInputSelectLocaleText, localeText);
|
|
22
13
|
|
|
23
14
|
export { defaultInputSelectLocaleText, useInputSelectLocaleText };
|
|
@@ -288,7 +288,62 @@ const IndeterminateFilled = styled('div', {
|
|
|
288
288
|
justifyContent: 'center',
|
|
289
289
|
alignItems: 'center'
|
|
290
290
|
});
|
|
291
|
-
const InputSelectCheck =
|
|
291
|
+
const InputSelectCheck =
|
|
292
|
+
/*#__PURE__*/
|
|
293
|
+
/**
|
|
294
|
+
* @type {React.ForwardRefExoticComponent<{
|
|
295
|
+
* placeholder?: string,
|
|
296
|
+
* option: any[],
|
|
297
|
+
* size?: string,
|
|
298
|
+
* disabled?: boolean,
|
|
299
|
+
* readOnly?: boolean,
|
|
300
|
+
* isInvalid?: boolean,
|
|
301
|
+
* sortBy?: string | null,
|
|
302
|
+
* value?: string[] | number[],
|
|
303
|
+
* onChange?: Function,
|
|
304
|
+
* onRemoveItem?: Function,
|
|
305
|
+
* search?: boolean,
|
|
306
|
+
* placement?: 'top' | 'bottom',
|
|
307
|
+
* disabledOptions?: string[],
|
|
308
|
+
* disabledSortChecked?: boolean,
|
|
309
|
+
* unremovableTags?: string[],
|
|
310
|
+
* textEmptyItem?: string,
|
|
311
|
+
* showSelectAll?: boolean,
|
|
312
|
+
* selectAllLabel?: string,
|
|
313
|
+
* showSelectedTag?: boolean,
|
|
314
|
+
* css?: object,
|
|
315
|
+
* helperText?: string,
|
|
316
|
+
* showCounter?: boolean,
|
|
317
|
+
* labelCounter?: string,
|
|
318
|
+
* collapsible?: boolean,
|
|
319
|
+
* toggleInput?: boolean,
|
|
320
|
+
* defaultValue?: string[] | number[],
|
|
321
|
+
* fetchData?: Function,
|
|
322
|
+
* onSearch?: Function,
|
|
323
|
+
* isLoading?: boolean,
|
|
324
|
+
* showTagSelectAll?: boolean,
|
|
325
|
+
* maxSelectedItem?: number,
|
|
326
|
+
* mobileOnly?: boolean,
|
|
327
|
+
* desktopOnly?: boolean,
|
|
328
|
+
* label?: string,
|
|
329
|
+
* tagCss?: object,
|
|
330
|
+
* checkBoxCss?: object,
|
|
331
|
+
* optionListCss?: object,
|
|
332
|
+
* showCollapsibleCounter?: boolean,
|
|
333
|
+
* collapsibleLimit?: number,
|
|
334
|
+
* clearSearchOnSelect?: boolean,
|
|
335
|
+
* onItemClick?: Function,
|
|
336
|
+
* virtualized?: boolean,
|
|
337
|
+
* virtualizedThreshold?: number,
|
|
338
|
+
* locale?: string,
|
|
339
|
+
* localeText?: object,
|
|
340
|
+
* pageIndex?: number,
|
|
341
|
+
* onSelectAllChecked?: Function,
|
|
342
|
+
* totalOptions?: number,
|
|
343
|
+
* [key: string]: any,
|
|
344
|
+
* } & React.RefAttributes<HTMLInputElement>>}
|
|
345
|
+
*/
|
|
346
|
+
forwardRef(({
|
|
292
347
|
placeholder,
|
|
293
348
|
option,
|
|
294
349
|
value,
|
|
@@ -1364,8 +1419,8 @@ InputSelectCheck.propTypes = {
|
|
|
1364
1419
|
virtualized: PropTypes.bool,
|
|
1365
1420
|
virtualizedThreshold: PropTypes.number,
|
|
1366
1421
|
/**
|
|
1367
|
-
* Language the select-all label follows
|
|
1368
|
-
*
|
|
1422
|
+
* Language the select-all label follows (`en` defaults to "Select All"). Falls back to
|
|
1423
|
+
* `MajooProvider`'s `locale`, then `id`.
|
|
1369
1424
|
*/
|
|
1370
1425
|
locale: PropTypes.string,
|
|
1371
1426
|
/**
|
|
@@ -9,22 +9,13 @@ const defaultInputSelectCheckLocaleText = {
|
|
|
9
9
|
emptyDataText: 'Item tidak ditemukan'
|
|
10
10
|
};
|
|
11
11
|
// `en` keeps the English select-all label the component used to pick by language.
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
placeholder: t('placeholder', d.placeholder),
|
|
16
|
-
selectAllLabel: t('selectAllLabelText', locale === 'en' ? 'Select All' : d.selectAllLabel),
|
|
17
|
-
showAllButton: t('showAllText', d.showAllButton),
|
|
18
|
-
showLessButton: t('showSomeText', d.showLessButton),
|
|
19
|
-
counterLabel: t('labelCounterText', d.counterLabel),
|
|
20
|
-
emptyDataText: t('emptyItemText', d.emptyDataText)
|
|
21
|
-
};
|
|
22
|
-
};
|
|
12
|
+
const inputSelectCheckDefaultsFor = locale => locale === 'en' ? Object.assign(Object.assign({}, defaultInputSelectCheckLocaleText), {
|
|
13
|
+
selectAllLabel: 'Select All'
|
|
14
|
+
}) : defaultInputSelectCheckLocaleText;
|
|
23
15
|
/**
|
|
24
16
|
* Resolves the multi-select texts. Precedence: the select's own `localeText`, then `MajooProvider`'s
|
|
25
|
-
* `localeText.inputSelectCheck`, then the
|
|
26
|
-
* Indonesian defaults.
|
|
17
|
+
* `localeText.inputSelectCheck`, then the defaults (Indonesian, except `selectAllLabel` for `en`).
|
|
27
18
|
*/
|
|
28
|
-
const useInputSelectCheckLocaleText = (localeText, locale) => useLocaleText('inputSelectCheck',
|
|
19
|
+
const useInputSelectCheckLocaleText = (localeText, locale) => useLocaleText('inputSelectCheck', inputSelectCheckDefaultsFor, localeText, locale);
|
|
29
20
|
|
|
30
21
|
export { defaultInputSelectCheckLocaleText, useInputSelectCheckLocaleText };
|
|
@@ -3,7 +3,12 @@ import InputSelectCheck from '../InputSelectCheck/InputSelectCheck.esm.js';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
|
-
const InputSelectTag =
|
|
6
|
+
const InputSelectTag =
|
|
7
|
+
/*#__PURE__*/
|
|
8
|
+
/**
|
|
9
|
+
* @type {React.ForwardRefExoticComponent<React.ComponentProps<typeof InputSelectCheck>>}
|
|
10
|
+
*/
|
|
11
|
+
React.forwardRef((props, ref) => {
|
|
7
12
|
return /*#__PURE__*/jsx(InputSelectCheck, {
|
|
8
13
|
ref: ref,
|
|
9
14
|
showSelectedTag: true,
|
|
@@ -7,21 +7,10 @@ const defaultInputSignatureLocaleText = {
|
|
|
7
7
|
cancelButton: 'Batal',
|
|
8
8
|
saveButton: 'Simpan'
|
|
9
9
|
};
|
|
10
|
-
const i18nInputSignatureLocaleText = t => {
|
|
11
|
-
const d = defaultInputSignatureLocaleText;
|
|
12
|
-
return {
|
|
13
|
-
placeholder: t('placeholder', d.placeholder),
|
|
14
|
-
addTitle: t('addTitle', d.addTitle),
|
|
15
|
-
editTitle: t('editTitle', d.editTitle),
|
|
16
|
-
cancelButton: t('label.cancel', d.cancelButton),
|
|
17
|
-
saveButton: t('label.save', d.saveButton)
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
10
|
/**
|
|
21
11
|
* Resolves the signature input texts. Precedence: the input's own `localeText`, then `MajooProvider`'s
|
|
22
|
-
* `localeText.inputSignature`, then the
|
|
23
|
-
* defaults.
|
|
12
|
+
* `localeText.inputSignature`, then the Indonesian defaults.
|
|
24
13
|
*/
|
|
25
|
-
const useInputSignatureLocaleText = localeText => useLocaleText('inputSignature',
|
|
14
|
+
const useInputSignatureLocaleText = localeText => useLocaleText('inputSignature', defaultInputSignatureLocaleText, localeText);
|
|
26
15
|
|
|
27
16
|
export { defaultInputSignatureLocaleText, useInputSignatureLocaleText };
|
|
@@ -66,7 +66,21 @@ const StyledSwitch = styled(SwitchPrimitive.Root, {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
|
-
const InputSwitch =
|
|
69
|
+
const InputSwitch =
|
|
70
|
+
/*#__PURE__*/
|
|
71
|
+
/**
|
|
72
|
+
* @type {React.ForwardRefExoticComponent<{
|
|
73
|
+
* id?: string,
|
|
74
|
+
* disabled?: boolean,
|
|
75
|
+
* dataOnLabel?: string,
|
|
76
|
+
* dataOffLabel?: string,
|
|
77
|
+
* defaultChecked?: boolean,
|
|
78
|
+
* checked?: boolean,
|
|
79
|
+
* onCheckedChange?: (checked: boolean) => void,
|
|
80
|
+
* [key: string]: any,
|
|
81
|
+
* } & React.RefAttributes<HTMLButtonElement>>}
|
|
82
|
+
*/
|
|
83
|
+
React__default.forwardRef(({
|
|
70
84
|
id,
|
|
71
85
|
defaultChecked,
|
|
72
86
|
dataOnLabel,
|
|
@@ -88,7 +88,25 @@ const StyledSwitch = styled(SwitchPrimitive.Root, {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
|
-
const InputSwitchWithImage =
|
|
91
|
+
const InputSwitchWithImage =
|
|
92
|
+
/*#__PURE__*/
|
|
93
|
+
/**
|
|
94
|
+
* @type {React.ForwardRefExoticComponent<{
|
|
95
|
+
* id?: string,
|
|
96
|
+
* disabled?: boolean,
|
|
97
|
+
* dataOnLabel?: string,
|
|
98
|
+
* dataOffLabel?: string,
|
|
99
|
+
* defaultChecked?: boolean,
|
|
100
|
+
* checked?: boolean,
|
|
101
|
+
* onCheckedChange?: (checked: boolean) => void,
|
|
102
|
+
* onImage?: string,
|
|
103
|
+
* offImage?: string,
|
|
104
|
+
* thumbAltOn?: string,
|
|
105
|
+
* thumbAltOff?: string,
|
|
106
|
+
* [key: string]: any,
|
|
107
|
+
* } & React.RefAttributes<HTMLButtonElement>>}
|
|
108
|
+
*/
|
|
109
|
+
React__default.forwardRef(({
|
|
92
110
|
id,
|
|
93
111
|
defaultChecked,
|
|
94
112
|
dataOnLabel,
|
|
@@ -115,7 +115,30 @@ const TagWrapper = styled(Box, {
|
|
|
115
115
|
marginTop: '5px',
|
|
116
116
|
gap: '5px'
|
|
117
117
|
});
|
|
118
|
-
const InputTags =
|
|
118
|
+
const InputTags =
|
|
119
|
+
/*#__PURE__*/
|
|
120
|
+
/**
|
|
121
|
+
* @type {React.ForwardRefExoticComponent<{
|
|
122
|
+
* placeholder?: string,
|
|
123
|
+
* size?: string,
|
|
124
|
+
* value?: string[],
|
|
125
|
+
* onChange?: Function,
|
|
126
|
+
* onRemoveItem?: Function,
|
|
127
|
+
* onEnter?: Function,
|
|
128
|
+
* onInputChange?: Function,
|
|
129
|
+
* max?: number,
|
|
130
|
+
* maxChar?: number,
|
|
131
|
+
* isInvalid?: boolean,
|
|
132
|
+
* disabled?: boolean,
|
|
133
|
+
* unremovableTags?: string[],
|
|
134
|
+
* readOnly?: boolean,
|
|
135
|
+
* helperText?: string,
|
|
136
|
+
* pattern?: { regex: string, errorMessage?: string },
|
|
137
|
+
* css?: object,
|
|
138
|
+
* [key: string]: any,
|
|
139
|
+
* } & React.RefAttributes<HTMLInputElement>>}
|
|
140
|
+
*/
|
|
141
|
+
React__default.forwardRef(function InputTags({
|
|
119
142
|
size,
|
|
120
143
|
isInvalid,
|
|
121
144
|
placeholder,
|
|
@@ -21,7 +21,22 @@ const StyledTextArea = styled(StyledInput, {
|
|
|
21
21
|
size: 'lg'
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
const InputTextArea =
|
|
24
|
+
const InputTextArea =
|
|
25
|
+
/*#__PURE__*/
|
|
26
|
+
/**
|
|
27
|
+
* @type {React.ForwardRefExoticComponent<{
|
|
28
|
+
* placeholder?: string,
|
|
29
|
+
* value?: string,
|
|
30
|
+
* onChange?: Function,
|
|
31
|
+
* disabled?: boolean,
|
|
32
|
+
* readOnly?: boolean,
|
|
33
|
+
* isInvalid?: boolean,
|
|
34
|
+
* size?: string,
|
|
35
|
+
* isPicker?: boolean,
|
|
36
|
+
* [key: string]: any,
|
|
37
|
+
* } & React.RefAttributes<HTMLTextAreaElement>>}
|
|
38
|
+
*/
|
|
39
|
+
React__default.forwardRef(({
|
|
25
40
|
disabled,
|
|
26
41
|
readOnly,
|
|
27
42
|
...props
|
|
@@ -3,13 +3,10 @@ import { useLocaleText } from '../../config/locale/useLocaleText.esm.js';
|
|
|
3
3
|
const defaultImageLocaleText = {
|
|
4
4
|
fallbackTitle: 'Tidak ada foto'
|
|
5
5
|
};
|
|
6
|
-
const i18nImageLocaleText = t => ({
|
|
7
|
-
fallbackTitle: t('fallbackTitle', defaultImageLocaleText.fallbackTitle)
|
|
8
|
-
});
|
|
9
6
|
/**
|
|
10
7
|
* Resolves the image texts. Precedence: the image's own `localeText`, then `MajooProvider`'s
|
|
11
|
-
* `localeText.image`, then the
|
|
8
|
+
* `localeText.image`, then the Indonesian defaults.
|
|
12
9
|
*/
|
|
13
|
-
const useImageLocaleText = localeText => useLocaleText('image',
|
|
10
|
+
const useImageLocaleText = localeText => useLocaleText('image', defaultImageLocaleText, localeText);
|
|
14
11
|
|
|
15
12
|
export { defaultImageLocaleText, useImageLocaleText };
|
|
@@ -99,7 +99,20 @@ const NotificationBadgeStyle = styled('span', {
|
|
|
99
99
|
anchorHorizontal: 'right'
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
|
-
const NotificationBadge = (
|
|
102
|
+
const NotificationBadge = (
|
|
103
|
+
/**
|
|
104
|
+
* @type {{
|
|
105
|
+
* anchorHorizontal?: 'left' | 'right',
|
|
106
|
+
* anchorVertical?: 'top' | 'bottom',
|
|
107
|
+
* variant?: 'info' | 'important' | 'warning' | 'success' | 'alpha' | 'dot',
|
|
108
|
+
* variantIcon?: 'leading' | 'trailing',
|
|
109
|
+
* value?: number,
|
|
110
|
+
* dot?: boolean,
|
|
111
|
+
* children?: import('react').ReactNode,
|
|
112
|
+
* [key: string]: any,
|
|
113
|
+
* }}
|
|
114
|
+
*/
|
|
115
|
+
{
|
|
103
116
|
children,
|
|
104
117
|
variantIcon,
|
|
105
118
|
variant,
|
|
@@ -7,7 +7,32 @@ import PaginationButton from './PaginationButton.esm.js';
|
|
|
7
7
|
import PaginationInfo from './PaginationInfo.esm.js';
|
|
8
8
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
|
-
function Pagination(
|
|
10
|
+
function Pagination(
|
|
11
|
+
/**
|
|
12
|
+
* @type {{
|
|
13
|
+
* limit?: number,
|
|
14
|
+
* currentPage?: number,
|
|
15
|
+
* totalData?: number,
|
|
16
|
+
* totalPage?: number,
|
|
17
|
+
* hideDataInfo?: boolean,
|
|
18
|
+
* onLimitChange?: Function,
|
|
19
|
+
* onPageChange?: Function,
|
|
20
|
+
* hidePagination?: boolean,
|
|
21
|
+
* hideInputPageSection?: boolean,
|
|
22
|
+
* showingText?: string,
|
|
23
|
+
* showingCountText?: Function | string,
|
|
24
|
+
* dialogShowingText?: string,
|
|
25
|
+
* previousButton?: string,
|
|
26
|
+
* nextButton?: string,
|
|
27
|
+
* gotoPageText?: string,
|
|
28
|
+
* goToPagePlaceholder?: string,
|
|
29
|
+
* btnCancelText?: string,
|
|
30
|
+
* btnSubmitText?: string,
|
|
31
|
+
* rowsPerPageOptions?: number[],
|
|
32
|
+
* [key: string]: any,
|
|
33
|
+
* }}
|
|
34
|
+
*/
|
|
35
|
+
{
|
|
11
36
|
limit,
|
|
12
37
|
currentPage,
|
|
13
38
|
totalData,
|
|
@@ -38,7 +38,20 @@ const PaperComponent = styled('div', {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
|
-
const Paper = (
|
|
41
|
+
const Paper = (
|
|
42
|
+
/**
|
|
43
|
+
* @type {{
|
|
44
|
+
* className?: string,
|
|
45
|
+
* radius?: string | number,
|
|
46
|
+
* padding?: string,
|
|
47
|
+
* width?: string | number,
|
|
48
|
+
* height?: string | number,
|
|
49
|
+
* children?: import('react').ReactNode,
|
|
50
|
+
* css?: object,
|
|
51
|
+
* [key: string]: any,
|
|
52
|
+
* }}
|
|
53
|
+
*/
|
|
54
|
+
{
|
|
42
55
|
className,
|
|
43
56
|
children,
|
|
44
57
|
radius,
|
|
@@ -6,20 +6,10 @@ const defaultPeriodSelectLocaleText = {
|
|
|
6
6
|
monthLabel: 'Bulan',
|
|
7
7
|
startWeekLabel: 'Mulai minggu dari:'
|
|
8
8
|
};
|
|
9
|
-
const i18nPeriodSelectLocaleText = t => {
|
|
10
|
-
const d = defaultPeriodSelectLocaleText;
|
|
11
|
-
return {
|
|
12
|
-
dayLabel: t('day', d.dayLabel),
|
|
13
|
-
weekLabel: t('week', d.weekLabel),
|
|
14
|
-
monthLabel: t('month', d.monthLabel),
|
|
15
|
-
startWeekLabel: t('startWeekFrom', d.startWeekLabel)
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
9
|
/**
|
|
19
10
|
* Resolves the period select texts. Precedence: the select's own `localeText`, then `MajooProvider`'s
|
|
20
|
-
* `localeText.periodSelect`, then the
|
|
21
|
-
* defaults.
|
|
11
|
+
* `localeText.periodSelect`, then the Indonesian defaults.
|
|
22
12
|
*/
|
|
23
|
-
const usePeriodSelectLocaleText = localeText => useLocaleText('periodSelect',
|
|
13
|
+
const usePeriodSelectLocaleText = localeText => useLocaleText('periodSelect', defaultPeriodSelectLocaleText, localeText);
|
|
24
14
|
|
|
25
15
|
export { defaultPeriodSelectLocaleText, usePeriodSelectLocaleText };
|