1mpacto-react-ui 1.0.0 → 2.0.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/dist/assets/_mixins.scss +43 -43
- package/dist/assets/core.css +1 -1
- package/dist/assets/fontfamily.css +1 -1
- package/dist/assets/icons/arrow-narrow-down.svg +3 -3
- package/dist/assets/style.css +1 -1
- package/dist/assets/toast.css +194 -98
- package/dist/index.cjs +154 -145
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +26996 -26119
- package/dist/package.json.d.ts +132 -131
- package/dist/src/components/Alert/index.d.ts +0 -1
- package/dist/src/components/Badges/Badges.d.ts +0 -1
- package/dist/src/components/Badges/Badges.stories.d.ts +1 -2
- package/dist/src/components/Breadcrumbs/Breadcrumbs.d.ts +0 -1
- package/dist/src/components/Breadcrumbs/Breadcrumbs.stories.d.ts +1 -2
- package/dist/src/components/Button/Button.d.ts +0 -1
- package/dist/src/components/Button/Button.stories.d.ts +1 -2
- package/dist/src/components/ButtonIcon/ButtonIcon.d.ts +0 -1
- package/dist/src/components/ButtonIcon/ButtonIcon.stories.d.ts +1 -2
- package/dist/src/components/ButtonPopover/ButtonPopover.d.ts +0 -1
- package/dist/src/components/ButtonPopover/ButtonPopover.stories.d.ts +1 -2
- package/dist/src/components/Calendar/Calendar.d.ts +0 -1
- package/dist/src/components/Calendar/Calendar.stories.d.ts +1 -2
- package/dist/src/components/Calendar/CalendarButton.d.ts +0 -1
- package/dist/src/components/Calendar/CalendarCell.d.ts +0 -1
- package/dist/src/components/Calendar/CalendarMonth.d.ts +0 -1
- package/dist/src/components/Calendar/CalendarRange.d.ts +0 -1
- package/dist/src/components/Calendar/CalendarYear.d.ts +0 -1
- package/dist/src/components/Chart/DoughnutChart.d.ts +0 -1
- package/dist/src/components/Chart/GradientBarChart.d.ts +0 -1
- package/dist/src/components/Chart/GradientBarChart.stories.d.ts +3 -4
- package/dist/src/components/Chart/GradientLineChart.d.ts +0 -1
- package/dist/src/components/Chart/GradientLineChart.stories.d.ts +3 -4
- package/dist/src/components/Chart/LineChart.d.ts +0 -1
- package/dist/src/components/Chart/LineChart.stories.d.ts +1 -2
- package/dist/src/components/Chips/Chips.d.ts +0 -1
- package/dist/src/components/Chips/Chips.stories.d.ts +1 -2
- package/dist/src/components/Collapse/Collapse.d.ts +0 -1
- package/dist/src/components/Collapse/Collapse.stories.d.ts +1 -2
- package/dist/src/components/Collapse/CollapseV2.d.ts +0 -1
- package/dist/src/components/Collapse/CollapseV2.stories.d.ts +1 -2
- package/dist/src/components/Colors/Colors.stories.d.ts +1 -2
- package/dist/src/components/DatePicker/DatePicker.d.ts +0 -1
- package/dist/src/components/DatePicker/DatePicker.stories.d.ts +1 -2
- package/dist/src/components/DatePicker/DateRangePicker.d.ts +0 -1
- package/dist/src/components/DatePicker/FilterDate.d.ts +0 -1
- package/dist/src/components/DatePicker/FilterDate.stories.d.ts +1 -2
- package/dist/src/components/DatePicker/MonthYearPicker.d.ts +0 -1
- package/dist/src/components/DatePicker/MonthYearPicker.stories.d.ts +1 -2
- package/dist/src/components/ErrorMessage/ErrorMessage.d.ts +0 -1
- package/dist/src/components/ErrorMessage/ErrorMessage.stories.d.ts +1 -2
- package/dist/src/components/FilterContainer/FilterContainer.d.ts +0 -1
- package/dist/src/components/FilterContainer/FilterContainer.stories.d.ts +1 -2
- package/dist/src/components/Input/InputFloatingInner.d.ts +0 -1
- package/dist/src/components/Input/InputFloatingInner.stories.d.ts +1 -2
- package/dist/src/components/Input/InputInnerLabel.d.ts +0 -1
- package/dist/src/components/Input/InputInnerLabel.stories.d.ts +1 -2
- package/dist/src/components/Input/InputNative.d.ts +0 -1
- package/dist/src/components/Input/InputNative.stories.d.ts +1 -2
- package/dist/src/components/Input/InputReguler.d.ts +0 -1
- package/dist/src/components/Input/InputReguler.stories.d.ts +1 -2
- package/dist/src/components/Modal/ModalDialog.d.ts +0 -1
- package/dist/src/components/Modal/ModalDialog.stories.d.ts +1 -2
- package/dist/src/components/NumberFormat/NumberFormat.d.ts +0 -1
- package/dist/src/components/NumberFormat/NumberFormat.stories.d.ts +1 -2
- package/dist/src/components/Pagination/Pagination.d.ts +0 -1
- package/dist/src/components/Pagination/Pagination.stories.d.ts +1 -2
- package/dist/src/components/Popover/Popover.d.ts +0 -1
- package/dist/src/components/Popover/Popover.stories.d.ts +3 -4
- package/dist/src/components/PortalComponent/PortalComponent.d.ts +0 -1
- package/dist/src/components/PortalComponent/PortalComponent.stories.d.ts +1 -2
- package/dist/src/components/RadioCheckbox/CheckboxTable.d.ts +0 -1
- package/dist/src/components/RadioCheckbox/RadioCheckbox.d.ts +0 -1
- package/dist/src/components/RadioCheckbox/RadioCheckbox.stories.d.ts +1 -2
- package/dist/src/components/RadioCheckbox/RadioCheckboxLabel.d.ts +0 -1
- package/dist/src/components/RadioCheckbox/RadioCheckboxLabel.stories.d.ts +1 -2
- package/dist/src/components/SelectDropdownContainer/SelectDropdownContainer.d.ts +1 -2
- package/dist/src/components/SelectDropdownContainer/SelectDropdownContainer.stories.d.ts +4 -5
- package/dist/src/components/SelectDropdownContainer/styleConfig.d.ts +0 -1
- package/dist/src/components/Sidebar/ItemSidebar.d.ts +0 -1
- package/dist/src/components/Sidebar/Sidebar.d.ts +1 -2
- package/dist/src/components/Sidebar/Sidebar.stories.d.ts +5 -6
- package/dist/src/components/Step/Step.d.ts +0 -1
- package/dist/src/components/Step/Step.stories.d.ts +1 -2
- package/dist/src/components/Step/StepIndicator.d.ts +0 -1
- package/dist/src/components/Step/StepIndicator.stories.d.ts +1 -2
- package/dist/src/components/Switch/Switch.d.ts +0 -1
- package/dist/src/components/Switch/Switch.stories.d.ts +1 -2
- package/dist/src/components/Table/Table.config.d.ts +0 -1
- package/dist/src/components/Table/Table.d.ts +0 -1
- package/dist/src/components/Table/Table.stories.d.ts +1 -2
- package/dist/src/components/Table/TableSubMobile.d.ts +0 -1
- package/dist/src/components/Tabs/TabPanel.d.ts +0 -1
- package/dist/src/components/Tabs/Tabs.d.ts +0 -1
- package/dist/src/components/Tabs/Tabs.stories.d.ts +1 -2
- package/dist/src/components/TextEditor/TextEditor.d.ts +0 -1
- package/dist/src/components/TextEditor/TextEditor.stories.d.ts +1 -2
- package/dist/src/components/Textarea/Textarea.d.ts +0 -1
- package/dist/src/components/Textarea/Textarea.stories.d.ts +1 -2
- package/dist/src/components/Textarea/TextareaFloatingInner.d.ts +0 -1
- package/dist/src/components/Textarea/TextareaFloatingInner.stories.d.ts +1 -2
- package/dist/src/components/Textarea/TextareaInnerLabel.d.ts +0 -1
- package/dist/src/components/Textarea/TextareaInnerLabel.stories.d.ts +1 -2
- package/dist/src/components/TimeRange/TimeRange.d.ts +0 -1
- package/dist/src/components/TimeRange/TimeRange.stories.d.ts +1 -2
- package/dist/src/components/Timeline/Timeline.d.ts +0 -1
- package/dist/src/components/Timeline/Timeline.stories.d.ts +1 -2
- package/dist/src/components/Tooltip/Tooltip.d.ts +0 -1
- package/dist/src/components/Tooltip/Tooltip.stories.d.ts +1 -2
- package/dist/src/components/TruncateComponent/TruncateComponent.d.ts +0 -1
- package/dist/src/components/TruncateComponent/TruncateComponent.stories.d.ts +1 -2
- package/dist/src/components/Typography/Typography.stories.d.ts +1 -2
- package/dist/src/components/Upload/UploadFile.d.ts +0 -1
- package/dist/src/components/Upload/UploadFile.stories.d.ts +1 -2
- package/dist/src/components/Upload/UploadImage.d.ts +0 -1
- package/dist/src/components/Upload/UploadImage.stories.d.ts +1 -2
- package/dist/src/components/Upload/UploadMultipleFile.d.ts +0 -1
- package/dist/src/components/Upload/UploadMultipleFile.stories.d.ts +1 -2
- package/dist/src/components/Virtualization/ListVirtualization.d.ts +0 -1
- package/dist/src/components/Virtualization/ListVirtualization.stories.d.ts +1 -2
- package/dist/src/components/Virtualization/TableVirtualization.d.ts +0 -1
- package/dist/src/components/Virtualization/TableVirtualization.stories.d.ts +1 -2
- package/dist/src/components/index.d.ts +0 -1
- package/dist/src/components/screens/Screens.stories.d.ts +1 -2
- package/dist/src/config/bigNumber/index.d.ts +0 -1
- package/dist/src/config/components/tinymce.d.ts +0 -1
- package/dist/src/config/tailwind/index.d.ts +0 -1
- package/dist/src/hooks/index.d.ts +0 -1
- package/dist/src/hooks/useAsyncDebounce.d.ts +9 -0
- package/dist/src/hooks/useCombinedResizeObserver.d.ts +66 -1
- package/dist/src/hooks/useCountdown.d.ts +61 -0
- package/dist/src/hooks/useDeepCompareEffect.d.ts +13 -1
- package/dist/src/hooks/useElementOrWindowMediaQuery.d.ts +9 -0
- package/dist/src/hooks/useEventListener.d.ts +27 -1
- package/dist/src/hooks/useMasonry.d.ts +79 -1
- package/dist/src/hooks/useMergeRefs.d.ts +26 -1
- package/dist/src/hooks/useOtpInput.d.ts +157 -1
- package/dist/src/hooks/useStateRef.d.ts +8 -1
- package/dist/src/interfaces/components/Alert/index.d.ts +8 -1
- package/dist/src/interfaces/components/Badges/index.d.ts +28 -1
- package/dist/src/interfaces/components/Breadcrumbs/index.d.ts +79 -1
- package/dist/src/interfaces/components/Button/index.d.ts +44 -1
- package/dist/src/interfaces/components/ButtonIcon/index.d.ts +36 -1
- package/dist/src/interfaces/components/ButtonPopover/index.d.ts +78 -1
- package/dist/src/interfaces/components/Calendar/index.d.ts +364 -1
- package/dist/src/interfaces/components/Chart/index.d.ts +460 -1
- package/dist/src/interfaces/components/Checkbox/index.d.ts +12 -1
- package/dist/src/interfaces/components/Chips/index.d.ts +36 -1
- package/dist/src/interfaces/components/Collapse/index.d.ts +60 -1
- package/dist/src/interfaces/components/DatePicker/index.d.ts +274 -1
- package/dist/src/interfaces/components/ErrorMessage/index.d.ts +16 -0
- package/dist/src/interfaces/components/FilterContainer/index.d.ts +102 -1
- package/dist/src/interfaces/components/Input/index.d.ts +180 -1
- package/dist/src/interfaces/components/Modal/index.d.ts +45 -1
- package/dist/src/interfaces/components/NumberFormat/index.d.ts +25 -1
- package/dist/src/interfaces/components/Pagination/index.d.ts +81 -1
- package/dist/src/interfaces/components/Popover/index.d.ts +95 -1
- package/dist/src/interfaces/components/RadioCheckbox/RadioCheckbox.d.ts +56 -1
- package/dist/src/interfaces/components/RadioCheckbox/RadioCheckboxLabel.d.ts +44 -1
- package/dist/src/interfaces/components/SelectDropdownContainer/index.d.ts +195 -2
- package/dist/src/interfaces/components/Sidebar/index.d.ts +226 -1
- package/dist/src/interfaces/components/Step/index.d.ts +153 -1
- package/dist/src/interfaces/components/Switch/index.d.ts +53 -0
- package/dist/src/interfaces/components/Table/index.d.ts +364 -1
- package/dist/src/interfaces/components/Tabs/index.d.ts +126 -1
- package/dist/src/interfaces/components/TextEditor/index.d.ts +12 -1
- package/dist/src/interfaces/components/Textarea/index.d.ts +156 -1
- package/dist/src/interfaces/components/TimeRange/index.d.ts +100 -1
- package/dist/src/interfaces/components/Timeline/index.d.ts +36 -1
- package/dist/src/interfaces/components/Tooltip/index.d.ts +56 -1
- package/dist/src/interfaces/components/TruncateComponent/index.d.ts +34 -0
- package/dist/src/interfaces/components/UploadFile/index.d.ts +184 -2
- package/dist/src/interfaces/components/Virtualization/ListVirtualization.d.ts +138 -1
- package/dist/src/interfaces/components/Virtualization/TableVirtualization.d.ts +143 -1
- package/dist/src/main.d.ts +0 -1
- package/dist/src/utils/common.d.ts +0 -1
- package/dist/tinymce/CHANGELOG.md +3785 -3785
- package/dist/tinymce/js/tinymce/langs/README.md +3 -3
- package/dist/tinymce/js/tinymce/license.md +6 -6
- package/dist/tinymce/js/tinymce/notices.txt +21 -21
- package/dist/tinymce/js/tinymce/plugins/codesample/plugin.min.js +8 -8
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/ar.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/bg_BG.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/ca.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/cs.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/da.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/de.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/el.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/en.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/es.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/eu.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/fa.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/fi.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/fr_FR.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/he_IL.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/hi.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/hr.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/hu_HU.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/id.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/it.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/ja.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/kk.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/ko_KR.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/ms.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/nb_NO.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/nl.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/pl.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/pt_BR.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/pt_PT.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/ro.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/ru.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/sk.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/sl_SI.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/sv_SE.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/th_TH.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/tr.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/uk.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/vi.js +92 -92
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/zh_CN.js +86 -86
- package/dist/tinymce/js/tinymce/plugins/help/js/i18n/keynav/zh_TW.js +92 -92
- package/dist/tinymce/js/tinymce/skins/content/dark/content.js +9 -9
- package/dist/tinymce/js/tinymce/skins/content/dark/content.min.css +10 -10
- package/dist/tinymce/js/tinymce/skins/content/default/content.js +9 -9
- package/dist/tinymce/js/tinymce/skins/content/default/content.min.css +10 -10
- package/dist/tinymce/js/tinymce/skins/content/document/content.js +9 -9
- package/dist/tinymce/js/tinymce/skins/content/document/content.min.css +10 -10
- package/dist/tinymce/js/tinymce/skins/content/tinymce-5/content.js +9 -9
- package/dist/tinymce/js/tinymce/skins/content/tinymce-5/content.min.css +10 -10
- package/dist/tinymce/js/tinymce/skins/content/tinymce-5-dark/content.js +9 -9
- package/dist/tinymce/js/tinymce/skins/content/tinymce-5-dark/content.min.css +10 -10
- package/dist/tinymce/js/tinymce/skins/content/writer/content.js +9 -9
- package/dist/tinymce/js/tinymce/skins/content/writer/content.min.css +10 -10
- package/dist/tinymce/js/tinymce/skins/ui/oxide/content.inline.js +9 -9
- package/dist/tinymce/js/tinymce/skins/ui/oxide/content.inline.min.css +10 -10
- package/dist/tinymce/js/tinymce/skins/ui/oxide/content.js +9 -9
- package/dist/tinymce/js/tinymce/skins/ui/oxide/content.min.css +10 -10
- package/dist/tinymce/js/tinymce/skins/ui/oxide/skin.min.css +1 -1
- package/dist/tinymce/js/tinymce/skins/ui/oxide/skin.shadowdom.min.css +1 -1
- package/dist/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.js +9 -9
- package/dist/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.min.css +10 -10
- package/dist/tinymce/js/tinymce/skins/ui/oxide-dark/content.js +9 -9
- package/dist/tinymce/js/tinymce/skins/ui/oxide-dark/content.min.css +10 -10
- package/dist/tinymce/js/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
- package/dist/tinymce/js/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -1
- package/dist/tinymce/js/tinymce/skins/ui/tinymce-5/content.inline.js +9 -9
- package/dist/tinymce/js/tinymce/skins/ui/tinymce-5/content.inline.min.css +10 -10
- package/dist/tinymce/js/tinymce/skins/ui/tinymce-5/content.js +9 -9
- package/dist/tinymce/js/tinymce/skins/ui/tinymce-5/content.min.css +10 -10
- package/dist/tinymce/js/tinymce/skins/ui/tinymce-5/skin.min.css +1 -1
- package/dist/tinymce/js/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css +1 -1
- package/dist/tinymce/js/tinymce/skins/ui/tinymce-5-dark/content.inline.js +9 -9
- package/dist/tinymce/js/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +10 -10
- package/dist/tinymce/js/tinymce/skins/ui/tinymce-5-dark/content.js +9 -9
- package/dist/tinymce/js/tinymce/skins/ui/tinymce-5-dark/content.min.css +10 -10
- package/dist/tinymce/js/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -1
- package/dist/tinymce/js/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +1 -1
- package/dist/tinymce/js/tinymce/tinymce.d.ts +3350 -3350
- package/dist/tinymce/js/tinymce/tinymce.min.js +10 -10
- package/dist/types-external/table.d.ts +15 -15
- package/package.json +132 -131
|
@@ -2,5 +2,4 @@ import { default as ConfigColors } from './colors';
|
|
|
2
2
|
import { default as configTypography, configTypographyLabaBisnis, configTypographyPayhere } from './typography';
|
|
3
3
|
import { default as configScreens } from './screen';
|
|
4
4
|
import { default as configNativeScreens } from './nativeScreen';
|
|
5
|
-
|
|
6
5
|
export { ConfigColors, configTypography, configTypographyLabaBisnis, configTypographyPayhere, configScreens, configNativeScreens, };
|
|
@@ -8,6 +8,5 @@ import { useDeepCompareEffect, useDeepCompareMemoize } from './useDeepCompareEff
|
|
|
8
8
|
import { useEventListener } from './useEventListener';
|
|
9
9
|
import { default as useMasonry, IMasonryLayout } from './useMasonry';
|
|
10
10
|
import { default as useOtpInput, IUseOtpInput, IUseOtpInputReturn } from './useOtpInput';
|
|
11
|
-
|
|
12
11
|
export { useElementOrWindowMediaQuery, useCountdown, useAsyncDebounce, useCombinedResizeObserver, useStateRef, useDeepCompareEffect, useDeepCompareMemoize, useMergeRefs, useEventListener, useMasonry, useOtpInput, };
|
|
13
12
|
export type { IUseOtpInput, IUseOtpInputReturn, IMasonryLayout, IUseCountdownReturn, IUseCountdown };
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [ID] : Hook untuk melakukan debounce pada fungsi asinkron.
|
|
3
|
+
* [EN] : Hook to debounce an asynchronous function.
|
|
4
|
+
* @template T - [ID] : Tipe fungsi asinkron. [EN] : Asynchronous function type.
|
|
5
|
+
* @param defaultFn - [ID] : Fungsi yang akan di-debounce. [EN] : Function to be debounced.
|
|
6
|
+
* @param defaultWait - [ID] : Waktu tunggu default dalam milidetik (default: 0).
|
|
7
|
+
* [EN] : Default wait time in milliseconds (default: 0).
|
|
8
|
+
* @returns [ID] : Fungsi yang sudah di-debounce. [EN] : Debounced function.
|
|
9
|
+
*/
|
|
1
10
|
declare function useAsyncDebounce<T extends (...args: any[]) => Promise<any>>(defaultFn: T, defaultWait?: number): (...args: Parameters<T>) => Promise<ReturnType<T>>;
|
|
2
11
|
export default useAsyncDebounce;
|
|
@@ -1,23 +1,88 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* [ID] : Interface untuk persegi panjang konten.
|
|
4
|
+
* [EN] : Interface for content rect.
|
|
5
|
+
*/
|
|
3
6
|
interface ContentRect {
|
|
7
|
+
/**
|
|
8
|
+
* [ID] : Lebar elemen.
|
|
9
|
+
* [EN] : Element width.
|
|
10
|
+
*/
|
|
4
11
|
width: number;
|
|
12
|
+
/**
|
|
13
|
+
* [ID] : Tinggi elemen.
|
|
14
|
+
* [EN] : Element height.
|
|
15
|
+
*/
|
|
5
16
|
height: number;
|
|
17
|
+
/**
|
|
18
|
+
* [ID] : Posisi atas elemen.
|
|
19
|
+
* [EN] : Element top position.
|
|
20
|
+
*/
|
|
6
21
|
top: number;
|
|
22
|
+
/**
|
|
23
|
+
* [ID] : Posisi kiri elemen.
|
|
24
|
+
* [EN] : Element left position.
|
|
25
|
+
*/
|
|
7
26
|
left: number;
|
|
27
|
+
/**
|
|
28
|
+
* [ID] : Posisi bawah elemen.
|
|
29
|
+
* [EN] : Element bottom position.
|
|
30
|
+
*/
|
|
8
31
|
bottom: number;
|
|
32
|
+
/**
|
|
33
|
+
* [ID] : Posisi kanan elemen.
|
|
34
|
+
* [EN] : Element right position.
|
|
35
|
+
*/
|
|
9
36
|
right: number;
|
|
37
|
+
/**
|
|
38
|
+
* [ID] : Posisi X elemen.
|
|
39
|
+
* [EN] : Element X position.
|
|
40
|
+
*/
|
|
10
41
|
x: number;
|
|
42
|
+
/**
|
|
43
|
+
* [ID] : Posisi Y elemen.
|
|
44
|
+
* [EN] : Element Y position.
|
|
45
|
+
*/
|
|
11
46
|
y: number;
|
|
12
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* [ID] : Interface untuk hook CombinedResizeObserver.
|
|
50
|
+
* [EN] : Interface for CombinedResizeObserver hook.
|
|
51
|
+
* @template T - [ID] : Tipe elemen HTML. [EN] : HTML element type.
|
|
52
|
+
*/
|
|
13
53
|
interface CombinedResizeObserverHook<T extends HTMLElement> {
|
|
54
|
+
/**
|
|
55
|
+
* [ID] : Referensi ke elemen.
|
|
56
|
+
* [EN] : Reference to the element.
|
|
57
|
+
*/
|
|
14
58
|
ref: React.RefObject<T>;
|
|
59
|
+
/**
|
|
60
|
+
* [ID] : Ukuran jendela.
|
|
61
|
+
* [EN] : Window size.
|
|
62
|
+
*/
|
|
15
63
|
windowSize: {
|
|
16
64
|
width: number;
|
|
17
65
|
height: number;
|
|
18
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* [ID] : Persegi panjang konten elemen.
|
|
69
|
+
* [EN] : Element content rect.
|
|
70
|
+
*/
|
|
19
71
|
contentRect: ContentRect;
|
|
20
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* [ID] : Hook layout effect isomorfik (aman untuk SSR).
|
|
75
|
+
* [EN] : Isomorphic layout effect hook (SSR safe).
|
|
76
|
+
*/
|
|
21
77
|
export declare const useIsomorphicLayoutEffect: typeof React.useEffect;
|
|
78
|
+
/**
|
|
79
|
+
* [ID] : Hook untuk mengamati perubahan ukuran elemen dan jendela.
|
|
80
|
+
* [EN] : Hook to observe element and window resize changes.
|
|
81
|
+
* @template T - [ID] : Tipe elemen HTML. [EN] : HTML element type.
|
|
82
|
+
* @param dependencies - [ID] : Daftar dependensi (opsional). [EN] : Dependency list (optional).
|
|
83
|
+
* @param selector - [ID] : Selektor CSS untuk elemen (opsional). [EN] : CSS selector for element (optional).
|
|
84
|
+
* @returns [ID] : Objek berisi ref, ukuran jendela, dan rect konten.
|
|
85
|
+
* [EN] : Object containing ref, window size, and content rect.
|
|
86
|
+
*/
|
|
22
87
|
declare const useCombinedResizeObserver: <T extends HTMLElement>(dependencies?: unknown[], selector?: string) => CombinedResizeObserverHook<T>;
|
|
23
88
|
export default useCombinedResizeObserver;
|
|
@@ -1,17 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [ID] : Interface untuk opsi hook useCountdown.
|
|
3
|
+
* [EN] : Interface for useCountdown hook options.
|
|
4
|
+
*/
|
|
1
5
|
export interface IUseCountdown {
|
|
6
|
+
/**
|
|
7
|
+
* [ID] : Tanggal target hitung mundur.
|
|
8
|
+
* [EN] : Countdown target date.
|
|
9
|
+
*/
|
|
2
10
|
date: string;
|
|
11
|
+
/**
|
|
12
|
+
* [ID] : Interval waktu dalam milidetik.
|
|
13
|
+
* [EN] : Time interval in milliseconds.
|
|
14
|
+
*/
|
|
3
15
|
intervalMs: number;
|
|
16
|
+
/**
|
|
17
|
+
* [ID] : Status berjalan atau tidak.
|
|
18
|
+
* [EN] : Running status.
|
|
19
|
+
*/
|
|
4
20
|
running: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* [ID] : Penyesuaian waktu dalam jam (opsional).
|
|
23
|
+
* [EN] : Time adjustment in hours (optional).
|
|
24
|
+
*/
|
|
5
25
|
adjustTimesTime?: number;
|
|
26
|
+
/**
|
|
27
|
+
* [ID] : Callback saat hitung mundur selesai (opsional).
|
|
28
|
+
* [EN] : Callback when countdown is done (optional).
|
|
29
|
+
*/
|
|
6
30
|
callbackDone?: () => void;
|
|
7
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* [ID] : Interface untuk nilai kembalian hook useCountdown.
|
|
34
|
+
* [EN] : Interface for useCountdown hook return value.
|
|
35
|
+
*/
|
|
8
36
|
export interface IUseCountdownReturn {
|
|
37
|
+
/**
|
|
38
|
+
* [ID] : Sisa waktu dalam detik.
|
|
39
|
+
* [EN] : Remaining time in seconds.
|
|
40
|
+
*/
|
|
9
41
|
count: number;
|
|
42
|
+
/**
|
|
43
|
+
* [ID] : Status apakah hitung mundur sedang berjalan.
|
|
44
|
+
* [EN] : Status whether countdown is running.
|
|
45
|
+
*/
|
|
10
46
|
isRunning: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* [ID] : Fungsi untuk memulai hitung mundur.
|
|
49
|
+
* [EN] : Function to start countdown.
|
|
50
|
+
*/
|
|
11
51
|
startCountdown: () => void;
|
|
52
|
+
/**
|
|
53
|
+
* [ID] : Fungsi untuk menghentikan hitung mundur.
|
|
54
|
+
* [EN] : Function to stop countdown.
|
|
55
|
+
*/
|
|
12
56
|
stopCountdown: () => void;
|
|
57
|
+
/**
|
|
58
|
+
* [ID] : Fungsi untuk mereset hitung mundur.
|
|
59
|
+
* [EN] : Function to reset countdown.
|
|
60
|
+
* @param value - [ID] : Nilai reset (opsional, bisa Date atau number).
|
|
61
|
+
* [EN] : Reset value (optional, can be Date or number).
|
|
62
|
+
*/
|
|
13
63
|
resetCountdown: (value?: Date | number) => void;
|
|
64
|
+
/**
|
|
65
|
+
* [ID] : Fungsi untuk mengatur callback saat selesai.
|
|
66
|
+
* [EN] : Function to set callback when done.
|
|
67
|
+
* @param val - [ID] : Fungsi callback. [EN] : Callback function.
|
|
68
|
+
*/
|
|
14
69
|
setCallbackDone: (val: () => void) => void;
|
|
15
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* [ID] : Hook untuk hitung mundur waktu.
|
|
73
|
+
* [EN] : Hook for countdown timer.
|
|
74
|
+
* @param options - [ID] : Opsi hitung mundur. [EN] : Countdown options.
|
|
75
|
+
* @returns [ID] : Objek kontrol hitung mundur. [EN] : Countdown control object.
|
|
76
|
+
*/
|
|
16
77
|
declare const useCountdown: (options: IUseCountdown) => IUseCountdownReturn;
|
|
17
78
|
export default useCountdown;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* [ID] : Hook untuk memoize nilai dengan perbandingan mendalam.
|
|
4
|
+
* [EN] : Hook to memoize value with deep comparison.
|
|
5
|
+
* @template T - [ID] : Tipe nilai. [EN] : Value type.
|
|
6
|
+
* @param value - [ID] : Nilai yang akan di-memoize. [EN] : Value to be memoized.
|
|
7
|
+
* @returns [ID] : Nilai yang sudah di-memoize. [EN] : Memoized value.
|
|
8
|
+
*/
|
|
3
9
|
export declare function useDeepCompareMemoize<T>(value: T): T;
|
|
10
|
+
/**
|
|
11
|
+
* [ID] : Hook useEffect dengan perbandingan dependensi mendalam.
|
|
12
|
+
* [EN] : useEffect hook with deep dependency comparison.
|
|
13
|
+
* @param callback - [ID] : Fungsi efek yang akan dijalankan. [EN] : Effect function to be executed.
|
|
14
|
+
* @param dependencies - [ID] : Daftar dependensi. [EN] : Dependency list.
|
|
15
|
+
*/
|
|
4
16
|
export declare function useDeepCompareEffect(callback: React.EffectCallback, dependencies: React.DependencyList): void;
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [ID] : Hook untuk memeriksa media query pada elemen atau jendela.
|
|
3
|
+
* [EN] : Hook to check media query on element or window.
|
|
4
|
+
* @param query - [ID] : String media query (gunakan 'WIDTH' sebagai placeholder lebar).
|
|
5
|
+
* [EN] : Media query string (use 'WIDTH' as width placeholder).
|
|
6
|
+
* @param elementId - [ID] : ID elemen target (opsional, jika null menggunakan window).
|
|
7
|
+
* [EN] : Target element ID (optional, if null uses window).
|
|
8
|
+
* @returns [ID] : Boolean apakah query cocok. [EN] : Boolean whether query matches.
|
|
9
|
+
*/
|
|
1
10
|
declare function useElementOrWindowMediaQuery(query: string, elementId?: string | null): boolean;
|
|
2
11
|
export default useElementOrWindowMediaQuery;
|
|
@@ -1,10 +1,36 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* [ID] : Interface untuk opsi hook useEventListener.
|
|
4
|
+
* [EN] : Interface for useEventListener hook options.
|
|
5
|
+
*/
|
|
3
6
|
interface UseEventListenerOptions {
|
|
7
|
+
/**
|
|
8
|
+
* [ID] : Referensi elemen target.
|
|
9
|
+
* [EN] : Target element reference.
|
|
10
|
+
*/
|
|
4
11
|
ref: React.RefObject<HTMLElement>;
|
|
12
|
+
/**
|
|
13
|
+
* [ID] : Fungsi handler utama.
|
|
14
|
+
* [EN] : Main handler function.
|
|
15
|
+
* @param ref - [ID] : Referensi elemen. [EN] : Element reference.
|
|
16
|
+
* @param event - [ID] : Objek event. [EN] : Event object.
|
|
17
|
+
*/
|
|
5
18
|
handlerMain: (ref: React.RefObject<HTMLElement>, event: Event) => void;
|
|
19
|
+
/**
|
|
20
|
+
* [ID] : Jenis event listener (default: 'mousedown').
|
|
21
|
+
* [EN] : Event listener type (default: 'mousedown').
|
|
22
|
+
*/
|
|
6
23
|
eventListener?: keyof DocumentEventMap | (string & {});
|
|
24
|
+
/**
|
|
25
|
+
* [ID] : Dependensi tambahan untuk useEffect (opsional).
|
|
26
|
+
* [EN] : Additional dependencies for useEffect (optional).
|
|
27
|
+
*/
|
|
7
28
|
useEffectDependency?: unknown[];
|
|
8
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* [ID] : Hook untuk menambahkan event listener ke dokumen.
|
|
32
|
+
* [EN] : Hook to add event listener to document.
|
|
33
|
+
* @param options - [ID] : Opsi event listener. [EN] : Event listener options.
|
|
34
|
+
*/
|
|
9
35
|
export declare function useEventListener({ ref, handlerMain, eventListener, useEffectDependency, }: UseEventListenerOptions): void;
|
|
10
36
|
export {};
|
|
@@ -1,25 +1,103 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* [ID] : Tipe arah layout masonry.
|
|
4
|
+
* [EN] : Masonry layout direction type.
|
|
5
|
+
*/
|
|
3
6
|
export type TMasonryDirection = 'masonry-ltr' | 'masonry-rtl' | 'top-down-ltr' | 'top-down-rtl';
|
|
7
|
+
/**
|
|
8
|
+
* [ID] : Tipe hook useMasonry.
|
|
9
|
+
* [EN] : useMasonry hook type.
|
|
10
|
+
* @template T - [ID] : Tipe elemen HTML kontainer. [EN] : Container HTML element type.
|
|
11
|
+
* @param params - [ID] : Parameter hook. [EN] : Hook parameters.
|
|
12
|
+
* @returns [ID] : Objek berisi fungsi hitung ulang layout. [EN] : Object containing recalculate layout function.
|
|
13
|
+
*/
|
|
4
14
|
export type TUseMasonry = <T extends HTMLElement>(params: {
|
|
15
|
+
/**
|
|
16
|
+
* [ID] : Referensi kontainer.
|
|
17
|
+
* [EN] : Container reference.
|
|
18
|
+
*/
|
|
5
19
|
containerRef: React.RefObject<T>;
|
|
20
|
+
/**
|
|
21
|
+
* [ID] : Elemen anak.
|
|
22
|
+
* [EN] : Children elements.
|
|
23
|
+
*/
|
|
6
24
|
children: React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* [ID] : Jumlah kolom.
|
|
27
|
+
* [EN] : Column count.
|
|
28
|
+
*/
|
|
7
29
|
columnCount: number;
|
|
30
|
+
/**
|
|
31
|
+
* [ID] : Jarak horizontal antar item.
|
|
32
|
+
* [EN] : Horizontal gap between items.
|
|
33
|
+
*/
|
|
8
34
|
gapX: number;
|
|
35
|
+
/**
|
|
36
|
+
* [ID] : Jarak vertikal antar item.
|
|
37
|
+
* [EN] : Vertical gap between items.
|
|
38
|
+
*/
|
|
9
39
|
gapY: number;
|
|
40
|
+
/**
|
|
41
|
+
* [ID] : Arah layout (opsional).
|
|
42
|
+
* [EN] : Layout direction (optional).
|
|
43
|
+
*/
|
|
10
44
|
direction?: TMasonryDirection;
|
|
45
|
+
/**
|
|
46
|
+
* [ID] : Waktu debounce hitung ulang (ms) (opsional).
|
|
47
|
+
* [EN] : Recalculate debounce time (ms) (optional).
|
|
48
|
+
*/
|
|
11
49
|
debounceRecalculate?: number;
|
|
50
|
+
/**
|
|
51
|
+
* [ID] : Durasi animasi (ms) (opsional).
|
|
52
|
+
* [EN] : Animation duration (ms) (optional).
|
|
53
|
+
*/
|
|
12
54
|
durationAnimation?: number;
|
|
55
|
+
/**
|
|
56
|
+
* [ID] : Aktifkan animasi (opsional).
|
|
57
|
+
* [EN] : Enable animation (optional).
|
|
58
|
+
*/
|
|
13
59
|
enableAnimation?: boolean;
|
|
14
60
|
}) => {
|
|
61
|
+
/**
|
|
62
|
+
* [ID] : Fungsi untuk menghitung ulang layout.
|
|
63
|
+
* [EN] : Function to recalculate layout.
|
|
64
|
+
*/
|
|
15
65
|
recalculateLayout: () => void;
|
|
16
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* [ID] : Interface untuk properti layout masonry.
|
|
69
|
+
* [EN] : Interface for masonry layout properties.
|
|
70
|
+
*/
|
|
17
71
|
export interface IMasonryLayout {
|
|
72
|
+
/**
|
|
73
|
+
* [ID] : Elemen anak.
|
|
74
|
+
* [EN] : Children elements.
|
|
75
|
+
*/
|
|
18
76
|
children: React.ReactNode | React.ReactNode[];
|
|
77
|
+
/**
|
|
78
|
+
* [ID] : Jumlah kolom (opsional).
|
|
79
|
+
* [EN] : Column count (optional).
|
|
80
|
+
*/
|
|
19
81
|
columnCount?: number;
|
|
82
|
+
/**
|
|
83
|
+
* [ID] : Jarak horizontal (opsional).
|
|
84
|
+
* [EN] : Horizontal gap (optional).
|
|
85
|
+
*/
|
|
20
86
|
gapX?: number;
|
|
87
|
+
/**
|
|
88
|
+
* [ID] : Jarak vertikal (opsional).
|
|
89
|
+
* [EN] : Vertical gap (optional).
|
|
90
|
+
*/
|
|
21
91
|
gapY?: number;
|
|
92
|
+
/**
|
|
93
|
+
* [ID] : Arah layout (opsional).
|
|
94
|
+
* [EN] : Layout direction (optional).
|
|
95
|
+
*/
|
|
22
96
|
direction?: TMasonryDirection;
|
|
23
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* [ID] : Hook untuk mengatur layout masonry.
|
|
100
|
+
* [EN] : Hook to manage masonry layout.
|
|
101
|
+
*/
|
|
24
102
|
declare const useMasonry: TUseMasonry;
|
|
25
103
|
export default useMasonry;
|
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* [ID] : Tipe referensi React (callback atau objek).
|
|
4
|
+
* [EN] : React reference type (callback or object).
|
|
5
|
+
* @template T - [ID] : Tipe elemen. [EN] : Element type.
|
|
6
|
+
*/
|
|
3
7
|
export type ReactRef<T> = React.RefCallback<T> | React.MutableRefObject<T>;
|
|
8
|
+
/**
|
|
9
|
+
* [ID] : Menetapkan nilai ke referensi.
|
|
10
|
+
* [EN] : Assigns a value to a reference.
|
|
11
|
+
* @template T - [ID] : Tipe nilai. [EN] : Value type.
|
|
12
|
+
* @param ref - [ID] : Referensi target. [EN] : Target reference.
|
|
13
|
+
* @param value - [ID] : Nilai yang akan ditetapkan. [EN] : Value to assign.
|
|
14
|
+
*/
|
|
4
15
|
export declare function assignRef<T = unknown>(ref: ReactRef<T> | null | undefined, value: T): void;
|
|
16
|
+
/**
|
|
17
|
+
* [ID] : Menggabungkan beberapa referensi menjadi satu fungsi callback.
|
|
18
|
+
* [EN] : Merges multiple references into a single callback function.
|
|
19
|
+
* @template T - [ID] : Tipe elemen. [EN] : Element type.
|
|
20
|
+
* @param refs - [ID] : Daftar referensi. [EN] : List of references.
|
|
21
|
+
* @returns [ID] : Fungsi callback referensi. [EN] : Reference callback function.
|
|
22
|
+
*/
|
|
5
23
|
export declare function mergeRefs<T>(...refs: (ReactRef<T> | null | undefined)[]): (node: T | null) => void;
|
|
24
|
+
/**
|
|
25
|
+
* [ID] : Hook untuk menggabungkan beberapa referensi.
|
|
26
|
+
* [EN] : Hook to merge multiple references.
|
|
27
|
+
* @template T - [ID] : Tipe elemen. [EN] : Element type.
|
|
28
|
+
* @param refs - [ID] : Daftar referensi. [EN] : List of references.
|
|
29
|
+
* @returns [ID] : Referensi gabungan yang di-memoize. [EN] : Memoized merged reference.
|
|
30
|
+
*/
|
|
6
31
|
export declare function useMergeRefs<T>(...refs: (ReactRef<T> | null | undefined)[]): (node: T | null) => void;
|
|
@@ -1,43 +1,199 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* [ID] : Interface untuk opsi hook useOtpInput.
|
|
4
|
+
* [EN] : Interface for useOtpInput hook options.
|
|
5
|
+
*/
|
|
3
6
|
export interface IUseOtpInput {
|
|
7
|
+
/**
|
|
8
|
+
* [ID] : ID komponen (opsional).
|
|
9
|
+
* [EN] : Component ID (optional).
|
|
10
|
+
*/
|
|
4
11
|
id?: string;
|
|
12
|
+
/**
|
|
13
|
+
* [ID] : Jumlah input OTP.
|
|
14
|
+
* [EN] : Number of OTP inputs.
|
|
15
|
+
*/
|
|
5
16
|
numInputs: number;
|
|
17
|
+
/**
|
|
18
|
+
* [ID] : Callback saat OTP lengkap (opsional).
|
|
19
|
+
* [EN] : Callback when OTP is complete (optional).
|
|
20
|
+
* @param otp - [ID] : String OTP lengkap. [EN] : Complete OTP string.
|
|
21
|
+
*/
|
|
6
22
|
onComplete?: (otp: string) => void;
|
|
23
|
+
/**
|
|
24
|
+
* [ID] : Nonaktifkan fokus saat edit (opsional).
|
|
25
|
+
* [EN] : Disable focus on edit (optional).
|
|
26
|
+
*/
|
|
7
27
|
disableFocusOnEdit?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* [ID] : Blur saat lengkap (opsional).
|
|
30
|
+
* [EN] : Blur on complete (optional).
|
|
31
|
+
*/
|
|
8
32
|
blurOnComplete?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* [ID] : Nonaktifkan input saat lengkap (opsional).
|
|
35
|
+
* [EN] : Disable input on complete (optional).
|
|
36
|
+
*/
|
|
9
37
|
disableOnComplete?: boolean;
|
|
10
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* [ID] : Interface untuk properti input.
|
|
41
|
+
* [EN] : Interface for input properties.
|
|
42
|
+
*/
|
|
11
43
|
export interface IInputProps {
|
|
44
|
+
/**
|
|
45
|
+
* [ID] : ID input.
|
|
46
|
+
* [EN] : Input ID.
|
|
47
|
+
*/
|
|
12
48
|
id: string;
|
|
49
|
+
/**
|
|
50
|
+
* [ID] : Fungsi referensi input.
|
|
51
|
+
* [EN] : Input reference function.
|
|
52
|
+
* @param el - [ID] : Elemen input. [EN] : Input element.
|
|
53
|
+
*/
|
|
13
54
|
ref: (el: HTMLInputElement | null) => void;
|
|
55
|
+
/**
|
|
56
|
+
* [ID] : Nilai input.
|
|
57
|
+
* [EN] : Input value.
|
|
58
|
+
*/
|
|
14
59
|
value: string;
|
|
60
|
+
/**
|
|
61
|
+
* [ID] : Handler perubahan input.
|
|
62
|
+
* [EN] : Input change handler.
|
|
63
|
+
* @param e - [ID] : Event perubahan. [EN] : Change event.
|
|
64
|
+
*/
|
|
15
65
|
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
66
|
+
/**
|
|
67
|
+
* [ID] : Handler tombol ditekan.
|
|
68
|
+
* [EN] : Key down handler.
|
|
69
|
+
* @param e - [ID] : Event keyboard. [EN] : Keyboard event.
|
|
70
|
+
*/
|
|
16
71
|
onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
72
|
+
/**
|
|
73
|
+
* [ID] : Handler paste.
|
|
74
|
+
* [EN] : Paste handler.
|
|
75
|
+
* @param e - [ID] : Event clipboard. [EN] : Clipboard event.
|
|
76
|
+
*/
|
|
17
77
|
onPaste: (e: React.ClipboardEvent<HTMLInputElement>) => void;
|
|
78
|
+
/**
|
|
79
|
+
* [ID] : Handler fokus.
|
|
80
|
+
* [EN] : Focus handler.
|
|
81
|
+
* @param e - [ID] : Event fokus. [EN] : Focus event.
|
|
82
|
+
*/
|
|
18
83
|
onFocus: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
84
|
+
/**
|
|
85
|
+
* [ID] : Status non-aktif.
|
|
86
|
+
* [EN] : Disabled status.
|
|
87
|
+
*/
|
|
19
88
|
disabled: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* [ID] : Tipe input.
|
|
91
|
+
* [EN] : Input type.
|
|
92
|
+
*/
|
|
20
93
|
type: 'text';
|
|
94
|
+
/**
|
|
95
|
+
* [ID] : Mode input.
|
|
96
|
+
* [EN] : Input mode.
|
|
97
|
+
*/
|
|
21
98
|
inputMode: 'numeric';
|
|
99
|
+
/**
|
|
100
|
+
* [ID] : Auto complete.
|
|
101
|
+
* [EN] : Auto complete.
|
|
102
|
+
*/
|
|
22
103
|
autoComplete: 'one-time-code';
|
|
104
|
+
/**
|
|
105
|
+
* [ID] : Label ARIA.
|
|
106
|
+
* [EN] : ARIA label.
|
|
107
|
+
*/
|
|
23
108
|
'aria-label': string;
|
|
24
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* [ID] : Interface untuk data input.
|
|
112
|
+
* [EN] : Interface for input data.
|
|
113
|
+
*/
|
|
25
114
|
export interface IInputData {
|
|
115
|
+
/**
|
|
116
|
+
* [ID] : ID input.
|
|
117
|
+
* [EN] : Input ID.
|
|
118
|
+
*/
|
|
26
119
|
id: string;
|
|
120
|
+
/**
|
|
121
|
+
* [ID] : Fungsi referensi input.
|
|
122
|
+
* [EN] : Input reference function.
|
|
123
|
+
* @param el - [ID] : Elemen input. [EN] : Input element.
|
|
124
|
+
*/
|
|
27
125
|
ref: (el: HTMLInputElement | null) => void;
|
|
126
|
+
/**
|
|
127
|
+
* [ID] : Nilai input.
|
|
128
|
+
* [EN] : Input value.
|
|
129
|
+
*/
|
|
28
130
|
value: string;
|
|
131
|
+
/**
|
|
132
|
+
* [ID] : Status non-aktif.
|
|
133
|
+
* [EN] : Disabled status.
|
|
134
|
+
*/
|
|
29
135
|
disabled: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* [ID] : Tipe input.
|
|
138
|
+
* [EN] : Input type.
|
|
139
|
+
*/
|
|
30
140
|
type: 'text';
|
|
141
|
+
/**
|
|
142
|
+
* [ID] : Mode input.
|
|
143
|
+
* [EN] : Input mode.
|
|
144
|
+
*/
|
|
31
145
|
inputMode: 'numeric';
|
|
146
|
+
/**
|
|
147
|
+
* [ID] : Status apakah OTP terisi.
|
|
148
|
+
* [EN] : Status whether OTP is filled.
|
|
149
|
+
*/
|
|
32
150
|
isOtpFilled: boolean;
|
|
33
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* [ID] : Interface untuk nilai kembalian hook useOtpInput.
|
|
154
|
+
* [EN] : Interface for useOtpInput hook return value.
|
|
155
|
+
*/
|
|
34
156
|
export interface IUseOtpInputReturn {
|
|
157
|
+
/**
|
|
158
|
+
* [ID] : Fungsi mendapatkan properti input berdasarkan indeks.
|
|
159
|
+
* [EN] : Function to get input properties by index.
|
|
160
|
+
* @param index - [ID] : Indeks input. [EN] : Input index.
|
|
161
|
+
* @returns [ID] : Properti input. [EN] : Input properties.
|
|
162
|
+
*/
|
|
35
163
|
getInputProps: (index: number) => IInputProps;
|
|
164
|
+
/**
|
|
165
|
+
* [ID] : Fungsi mendapatkan data input berdasarkan indeks.
|
|
166
|
+
* [EN] : Function to get input data by index.
|
|
167
|
+
* @param index - [ID] : Indeks input. [EN] : Input index.
|
|
168
|
+
* @returns [ID] : Data input. [EN] : Input data.
|
|
169
|
+
*/
|
|
36
170
|
getInputData: (index: number) => IInputData;
|
|
171
|
+
/**
|
|
172
|
+
* [ID] : Fungsi membersihkan OTP.
|
|
173
|
+
* [EN] : Function to clear OTP.
|
|
174
|
+
*/
|
|
37
175
|
clearOtp: () => void;
|
|
176
|
+
/**
|
|
177
|
+
* [ID] : Array nilai OTP.
|
|
178
|
+
* [EN] : OTP values array.
|
|
179
|
+
*/
|
|
38
180
|
otpValues: string[];
|
|
181
|
+
/**
|
|
182
|
+
* [ID] : String OTP gabungan.
|
|
183
|
+
* [EN] : Joined OTP string.
|
|
184
|
+
*/
|
|
39
185
|
otpString: string;
|
|
186
|
+
/**
|
|
187
|
+
* [ID] : Status apakah OTP lengkap.
|
|
188
|
+
* [EN] : Status whether OTP is complete.
|
|
189
|
+
*/
|
|
40
190
|
isOtpComplete: boolean;
|
|
41
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* [ID] : Hook untuk mengelola input OTP.
|
|
194
|
+
* [EN] : Hook to manage OTP input.
|
|
195
|
+
* @param options - [ID] : Opsi hook. [EN] : Hook options.
|
|
196
|
+
* @returns [ID] : Objek kontrol OTP. [EN] : OTP control object.
|
|
197
|
+
*/
|
|
42
198
|
export declare const useOtpInput: ({ id, numInputs, onComplete, disableFocusOnEdit, blurOnComplete, disableOnComplete, }: IUseOtpInput) => IUseOtpInputReturn;
|
|
43
199
|
export default useOtpInput;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* [ID] : Hook untuk menggunakan state dengan referensi mutable.
|
|
4
|
+
* [EN] : Hook to use state with mutable reference.
|
|
5
|
+
* @template T - [ID] : Tipe nilai state. [EN] : State value type.
|
|
6
|
+
* @param initialValue - [ID] : Nilai awal. [EN] : Initial value.
|
|
7
|
+
* @returns [ID] : Tuple berisi nilai, fungsi setter, dan referensi.
|
|
8
|
+
* [EN] : Tuple containing value, setter function, and reference.
|
|
9
|
+
*/
|
|
3
10
|
declare function useStateRef<T>(initialValue: T): [T, React.Dispatch<React.SetStateAction<T>>, React.MutableRefObject<T>];
|
|
4
11
|
export default useStateRef;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { ToastOptions } from 'react-toastify';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* [ID] : Interface untuk opsi komponen Alert.
|
|
4
|
+
* [EN] : Interface for Alert component options.
|
|
5
|
+
*/
|
|
3
6
|
export interface IOptionAlert extends ToastOptions {
|
|
7
|
+
/**
|
|
8
|
+
* [ID] : Jenis alert (opsional).
|
|
9
|
+
* [EN] : Alert kind (optional).
|
|
10
|
+
*/
|
|
4
11
|
kind?: 'laba' | 'payhere';
|
|
5
12
|
}
|