1mpacto-react-ui 0.2.0-beta.9 → 1.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/dist/assets/_colors.scss +80 -0
- package/dist/assets/_mixins.scss +32 -5
- package/dist/assets/_typography.scss +582 -0
- package/dist/assets/colors.css +40 -0
- package/dist/assets/core.css +1 -1
- package/dist/assets/fontfamily.css +1 -1
- package/dist/assets/fonts/PlusJakartaSans-Italic.ttf +0 -0
- package/dist/assets/fonts/PlusJakartaSans.ttf +0 -0
- package/dist/assets/style.css +1 -1
- package/dist/assets/toast.css +98 -194
- package/dist/assets/typography.css +96 -0
- package/dist/index.cjs +120 -117
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +27703 -27059
- package/dist/package.json.d.ts +46 -47
- package/dist/src/components/Alert/index.d.ts +1 -0
- package/dist/src/components/Badges/Badges.config.d.ts +57 -0
- package/dist/src/components/Badges/Badges.d.ts +1 -0
- package/dist/src/components/Badges/Badges.stories.d.ts +117 -2
- package/dist/src/components/Breadcrumbs/Breadcrumbs.config.d.ts +113 -0
- package/dist/src/components/Breadcrumbs/Breadcrumbs.d.ts +2 -1
- package/dist/src/components/Breadcrumbs/Breadcrumbs.stories.d.ts +221 -6
- package/dist/src/components/Button/Button.config.d.ts +70 -0
- package/dist/src/components/Button/Button.d.ts +1 -0
- package/dist/src/components/Button/Button.stories.d.ts +129 -4
- package/dist/src/components/ButtonIcon/ButtonIcon.config.d.ts +53 -0
- package/dist/src/components/ButtonIcon/ButtonIcon.d.ts +1 -0
- package/dist/src/components/ButtonIcon/ButtonIcon.stories.d.ts +123 -4
- package/dist/src/components/ButtonPopover/ButtonPopover.d.ts +1 -0
- package/dist/src/components/ButtonPopover/ButtonPopover.stories.d.ts +258 -2
- package/dist/src/components/Calendar/Calendar.d.ts +3 -1
- package/dist/src/components/Calendar/Calendar.stories.d.ts +283 -2
- package/dist/src/components/Calendar/CalendarButton.d.ts +1 -0
- package/dist/src/components/Calendar/CalendarCell.d.ts +1 -0
- package/dist/src/components/Calendar/CalendarMonth.d.ts +1 -0
- package/dist/src/components/Calendar/CalendarRange.d.ts +1 -0
- package/dist/src/components/Calendar/CalendarYear.d.ts +1 -0
- package/dist/src/components/Chart/DoughnutChart.d.ts +1 -0
- package/dist/src/components/Chart/GradientBarChart.d.ts +1 -0
- package/dist/src/components/Chart/GradientBarChart.stories.d.ts +71 -4
- package/dist/src/components/Chart/GradientLineChart.d.ts +1 -0
- package/dist/src/components/Chart/GradientLineChart.stories.d.ts +82 -4
- package/dist/src/components/Chart/LineChart.d.ts +1 -0
- package/dist/src/components/Chart/LineChart.stories.d.ts +35 -2
- package/dist/src/components/Chips/Chips.config.d.ts +35 -0
- package/dist/src/components/Chips/Chips.d.ts +1 -0
- package/dist/src/components/Chips/Chips.stories.d.ts +137 -2
- package/dist/src/components/Collapse/Collapse.d.ts +1 -0
- package/dist/src/components/Collapse/Collapse.stories.d.ts +89 -2
- package/dist/src/components/Collapse/CollapseV2.d.ts +1 -0
- package/dist/src/components/Collapse/CollapseV2.stories.d.ts +59 -2
- package/dist/src/components/Colors/Colors.stories.d.ts +2 -1
- package/dist/src/components/DatePicker/DatePicker.d.ts +1 -0
- package/dist/src/components/DatePicker/DatePicker.stories.d.ts +221 -2
- package/dist/src/components/DatePicker/DateRangePicker.d.ts +1 -0
- package/dist/src/components/DatePicker/FilterDate.d.ts +2 -1
- package/dist/src/components/DatePicker/FilterDate.stories.d.ts +232 -3
- package/dist/src/components/DatePicker/MonthYearPicker.d.ts +1 -0
- package/dist/src/components/DatePicker/MonthYearPicker.stories.d.ts +198 -2
- package/dist/src/components/ErrorMessage/ErrorMessage.config.d.ts +8 -0
- package/dist/src/components/ErrorMessage/ErrorMessage.d.ts +1 -0
- package/dist/src/components/ErrorMessage/ErrorMessage.stories.d.ts +39 -2
- package/dist/src/components/FilterContainer/FilterContainer.d.ts +1 -0
- package/dist/src/components/FilterContainer/FilterContainer.stories.d.ts +165 -0
- package/dist/src/components/Input/InputFloatingInner.config.d.ts +9 -0
- package/dist/src/components/Input/InputFloatingInner.d.ts +1 -0
- package/dist/src/components/Input/InputFloatingInner.stories.d.ts +177 -6
- package/dist/src/components/Input/InputInnerLabel.config.d.ts +8 -0
- package/dist/src/components/Input/InputInnerLabel.d.ts +5 -0
- package/dist/src/components/Input/InputInnerLabel.stories.d.ts +205 -0
- package/dist/src/components/Input/InputNative.config.d.ts +9 -0
- package/dist/src/components/Input/InputNative.d.ts +1 -0
- package/dist/src/components/Input/InputNative.stories.d.ts +149 -5
- package/dist/src/components/Input/InputReguler.config.d.ts +9 -0
- package/dist/src/components/Input/InputReguler.d.ts +1 -0
- package/dist/src/components/Input/InputReguler.stories.d.ts +177 -6
- package/dist/src/components/Modal/ModalDialog.config.d.ts +9 -0
- package/dist/src/components/Modal/ModalDialog.d.ts +1 -0
- package/dist/src/components/Modal/ModalDialog.stories.d.ts +121 -2
- package/dist/src/components/NumberFormat/NumberFormat.d.ts +1 -0
- package/dist/src/components/NumberFormat/NumberFormat.stories.d.ts +373 -18
- package/dist/src/components/Pagination/Pagination.config.d.ts +5 -0
- package/dist/src/components/Pagination/Pagination.d.ts +2 -1
- package/dist/src/components/Pagination/Pagination.stories.d.ts +200 -3
- package/dist/src/components/Popover/Popover.d.ts +1 -0
- package/dist/src/components/Popover/Popover.stories.d.ts +216 -7
- package/dist/src/components/PortalComponent/PortalComponent.d.ts +1 -0
- package/dist/src/components/PortalComponent/PortalComponent.stories.d.ts +61 -0
- package/dist/src/components/RadioCheckbox/CheckboxTable.d.ts +1 -0
- package/dist/src/components/RadioCheckbox/RadioCheckbox.config.d.ts +41 -0
- package/dist/src/components/RadioCheckbox/RadioCheckbox.d.ts +1 -0
- package/dist/src/components/RadioCheckbox/RadioCheckbox.stories.d.ts +230 -8
- package/dist/src/components/RadioCheckbox/RadioCheckboxLabel.config.d.ts +25 -0
- package/dist/src/components/RadioCheckbox/RadioCheckboxLabel.d.ts +1 -0
- package/dist/src/components/RadioCheckbox/RadioCheckboxLabel.stories.d.ts +196 -4
- package/dist/src/components/SelectDropdownContainer/SelectDropdownContainer.config.d.ts +26 -0
- package/dist/src/components/SelectDropdownContainer/SelectDropdownContainer.d.ts +2 -1
- package/dist/src/components/SelectDropdownContainer/SelectDropdownContainer.stories.d.ts +5 -4
- package/dist/src/components/SelectDropdownContainer/styleConfig.d.ts +5 -1
- package/dist/src/components/Sidebar/ItemSidebar.config.d.ts +34 -0
- package/dist/src/components/Sidebar/ItemSidebar.d.ts +1 -0
- package/dist/src/components/Sidebar/Sidebar.config.d.ts +16 -0
- package/dist/src/components/Sidebar/Sidebar.d.ts +2 -1
- package/dist/src/components/Sidebar/Sidebar.stories.d.ts +6 -5
- package/dist/src/components/Step/Step.d.ts +1 -0
- package/dist/src/components/Step/Step.stories.d.ts +135 -2
- package/dist/src/components/Step/StepIndicator.d.ts +1 -0
- package/dist/src/components/Step/StepIndicator.stories.d.ts +148 -2
- package/dist/src/components/Switch/Switch.config.d.ts +26 -0
- package/dist/src/components/Switch/Switch.d.ts +1 -0
- package/dist/src/components/Switch/Switch.stories.d.ts +128 -2
- package/dist/src/components/Table/Table.config.d.ts +5 -0
- package/dist/src/components/Table/Table.d.ts +3 -3
- package/dist/src/components/Table/Table.stories.d.ts +71 -52
- package/dist/src/components/Table/TableSubMobile.d.ts +4 -0
- package/dist/src/components/Tabs/TabPanel.d.ts +1 -0
- package/dist/src/components/Tabs/Tabs.config.d.ts +31 -0
- package/dist/src/components/Tabs/Tabs.d.ts +2 -1
- package/dist/src/components/Tabs/Tabs.stories.d.ts +220 -3
- package/dist/src/components/TextEditor/TextEditor.d.ts +1 -0
- package/dist/src/components/TextEditor/TextEditor.stories.d.ts +59 -10
- package/dist/src/components/Textarea/Textarea.config.d.ts +31 -0
- package/dist/src/components/Textarea/Textarea.d.ts +1 -0
- package/dist/src/components/Textarea/Textarea.stories.d.ts +250 -3
- package/dist/src/components/Textarea/TextareaFloatingInner.config.d.ts +6 -0
- package/dist/src/components/Textarea/TextareaFloatingInner.d.ts +1 -0
- package/dist/src/components/Textarea/TextareaFloatingInner.stories.d.ts +260 -3
- package/dist/src/components/Textarea/TextareaInnerLabel.config.d.ts +7 -0
- package/dist/src/components/Textarea/TextareaInnerLabel.d.ts +5 -0
- package/dist/src/components/Textarea/TextareaInnerLabel.stories.d.ts +259 -0
- package/dist/src/components/TimeRange/TimeRange.d.ts +4 -0
- package/dist/src/components/TimeRange/TimeRange.stories.d.ts +186 -0
- package/dist/src/components/Timeline/Timeline.d.ts +1 -0
- package/dist/src/components/Timeline/Timeline.stories.d.ts +40 -2
- package/dist/src/components/Tooltip/Tooltip.d.ts +1 -0
- package/dist/src/components/Tooltip/Tooltip.stories.d.ts +159 -2
- package/dist/src/components/TruncateComponent/TruncateComponent.d.ts +1 -0
- package/dist/src/components/TruncateComponent/TruncateComponent.stories.d.ts +106 -2
- package/dist/src/components/Typography/Typography.stories.d.ts +2 -1
- package/dist/src/components/Upload/UploadFile.d.ts +1 -0
- package/dist/src/components/Upload/UploadFile.stories.d.ts +127 -2
- package/dist/src/components/Upload/UploadImage.d.ts +2 -1
- package/dist/src/components/Upload/UploadImage.stories.d.ts +145 -3
- package/dist/src/components/Upload/UploadMultipleFile.d.ts +2 -1
- package/dist/src/components/Upload/UploadMultipleFile.stories.d.ts +190 -3
- package/dist/src/components/Virtualization/ListVirtualization.d.ts +1 -0
- package/dist/src/components/Virtualization/ListVirtualization.stories.d.ts +279 -2
- package/dist/src/components/Virtualization/TableVirtualization.d.ts +1 -0
- package/dist/src/components/Virtualization/TableVirtualization.stories.d.ts +296 -2
- package/dist/src/components/index.d.ts +15 -8
- package/dist/src/components/screens/Screens.stories.d.ts +14 -0
- package/dist/src/config/bigNumber/index.d.ts +1 -0
- package/dist/src/config/components/borderRadius.d.ts +1 -0
- package/dist/src/config/components/font.d.ts +7 -0
- package/dist/src/config/components/gap.d.ts +1 -0
- package/dist/src/config/components/tinymce.d.ts +1 -0
- package/dist/src/config/components/typography.d.ts +3 -49
- package/dist/src/config/tailwind/index.d.ts +3 -1
- package/dist/src/config/tailwind/nativeScreen.d.ts +3 -0
- package/dist/src/config/tailwind/typography.d.ts +1 -0
- package/dist/src/hooks/index.d.ts +6 -3
- package/dist/src/hooks/useAsyncDebounce.d.ts +9 -0
- package/dist/src/hooks/useCombinedResizeObserver.d.ts +67 -0
- package/dist/src/hooks/useCountdown.d.ts +67 -3
- package/dist/src/hooks/useDeepCompareEffect.d.ts +14 -0
- package/dist/src/hooks/useElementOrWindowMediaQuery.d.ts +9 -0
- package/dist/src/hooks/useEventListener.d.ts +28 -0
- package/dist/src/hooks/useMasonry.d.ts +80 -0
- package/dist/src/hooks/useMergeRefs.d.ts +27 -0
- package/dist/src/hooks/useOtpInput.d.ts +200 -0
- package/dist/src/hooks/useStateRef.d.ts +9 -0
- package/dist/src/interfaces/components/Alert/index.d.ts +9 -0
- package/dist/src/interfaces/components/Badges/index.d.ts +31 -1
- package/dist/src/interfaces/components/Breadcrumbs/index.d.ts +86 -2
- package/dist/src/interfaces/components/Button/index.d.ts +47 -2
- package/dist/src/interfaces/components/ButtonIcon/index.d.ts +37 -0
- package/dist/src/interfaces/components/ButtonPopover/index.d.ts +79 -0
- package/dist/src/interfaces/components/Calendar/index.d.ts +385 -3
- package/dist/src/interfaces/components/Chart/index.d.ts +461 -0
- package/dist/src/interfaces/components/Checkbox/index.d.ts +13 -0
- package/dist/src/interfaces/components/Chips/index.d.ts +39 -1
- package/dist/src/interfaces/components/Collapse/index.d.ts +61 -0
- package/dist/src/interfaces/components/DatePicker/index.d.ts +278 -1
- package/dist/src/interfaces/components/ErrorMessage/index.d.ts +17 -1
- package/dist/src/interfaces/components/FilterContainer/index.d.ts +103 -0
- package/dist/src/interfaces/components/Input/index.d.ts +194 -0
- package/dist/src/interfaces/components/Modal/index.d.ts +46 -0
- package/dist/src/interfaces/components/NumberFormat/index.d.ts +26 -0
- package/dist/src/interfaces/components/Pagination/index.d.ts +84 -0
- package/dist/src/interfaces/components/Popover/index.d.ts +99 -1
- package/dist/src/interfaces/components/RadioCheckbox/RadioCheckbox.d.ts +60 -2
- package/dist/src/interfaces/components/RadioCheckbox/RadioCheckboxLabel.d.ts +47 -1
- package/dist/src/interfaces/components/SelectDropdownContainer/index.d.ts +197 -2
- package/dist/src/interfaces/components/Sidebar/index.d.ts +230 -1
- package/dist/src/interfaces/components/Step/index.d.ts +154 -0
- package/dist/src/interfaces/components/Switch/index.d.ts +54 -1
- package/dist/src/interfaces/components/Table/index.d.ts +403 -6
- package/dist/src/interfaces/components/Tabs/index.d.ts +131 -1
- package/dist/src/interfaces/components/TextEditor/index.d.ts +13 -0
- package/dist/src/interfaces/components/Textarea/index.d.ts +170 -0
- package/dist/src/interfaces/components/TimeRange/index.d.ts +129 -0
- package/dist/src/interfaces/components/Timeline/index.d.ts +37 -0
- package/dist/src/interfaces/components/Tooltip/index.d.ts +57 -0
- package/dist/src/interfaces/components/TruncateComponent/index.d.ts +34 -0
- package/dist/src/interfaces/components/UploadFile/index.d.ts +187 -0
- package/dist/src/interfaces/components/Virtualization/ListVirtualization.d.ts +139 -0
- package/dist/src/interfaces/components/Virtualization/TableVirtualization.d.ts +144 -0
- package/dist/src/main.d.ts +1 -0
- package/dist/src/utils/common.d.ts +5 -4
- package/dist/src/utils/constant.d.ts +1 -0
- package/dist/types-external/table.d.ts +3 -0
- package/package.json +46 -47
- package/dist/index.cjs.map +0 -1
- package/dist/index.mjs.map +0 -1
|
@@ -1,51 +1,246 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { Props as SelectProps, ActionMeta, GroupBase, SelectComponentsConfig, MultiValue, SingleValue } from 'react-select';
|
|
3
3
|
import { AutoPlacementOptions, FlipOptions, OffsetOptions, UseFloatingOptions } from '@floating-ui/react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* [ID] : Interface untuk komponen SelectDropdownContainer.
|
|
7
|
+
* [EN] : Interface for SelectDropdownContainer component.
|
|
8
|
+
* @template T - [ID] : Tipe data opsi. [EN] : Option data type.
|
|
9
|
+
*/
|
|
4
10
|
export interface ISelectDropdownContainer<T> extends Omit<SelectProps<T, boolean, GroupBase<T>>, 'onChange' | 'getOptionLabel'> {
|
|
11
|
+
/**
|
|
12
|
+
* [ID] : Lebar dropdown (opsional).
|
|
13
|
+
* [EN] : Dropdown width (optional).
|
|
14
|
+
*/
|
|
5
15
|
width?: number | string | ((width: number, value: MultiValue<T> | SingleValue<T> | T | T[] | object) => string | number);
|
|
16
|
+
/**
|
|
17
|
+
* [ID] : Fungsi render props untuk anak.
|
|
18
|
+
* [EN] : Render props function for children.
|
|
19
|
+
* @param params - [ID] : Parameter anak SelectDropdownContainer. [EN] : SelectDropdownContainer child parameters.
|
|
20
|
+
* @returns [ID] : Node React. [EN] : React Node.
|
|
21
|
+
*/
|
|
6
22
|
children: ((params: IChildrenSelectDropdownContainer<T>) => React.ReactNode) | ((params: IChildrenSelectDropdownContainer<T>) => React.ReactNode[]);
|
|
23
|
+
/**
|
|
24
|
+
* [ID] : Nama kelas CSS untuk kontainer (opsional).
|
|
25
|
+
* [EN] : CSS class name for container (optional).
|
|
26
|
+
*/
|
|
7
27
|
classNameContainer?: string;
|
|
28
|
+
/**
|
|
29
|
+
* [ID] : Nama kelas CSS saat select ditampilkan (opsional).
|
|
30
|
+
* [EN] : CSS class name when select is shown (optional).
|
|
31
|
+
*/
|
|
8
32
|
classNameContainerShowSelect?: string;
|
|
33
|
+
/**
|
|
34
|
+
* [ID] : Nama kelas CSS untuk select (opsional).
|
|
35
|
+
* [EN] : CSS class name for select (optional).
|
|
36
|
+
*/
|
|
9
37
|
classNameContainerSelect?: string;
|
|
38
|
+
/**
|
|
39
|
+
* [ID] : Nama kelas CSS untuk label error (opsional).
|
|
40
|
+
* [EN] : CSS class name for error label (optional).
|
|
41
|
+
*/
|
|
10
42
|
classNameLabelError?: string;
|
|
43
|
+
/**
|
|
44
|
+
* [ID] : Pesan error (opsional).
|
|
45
|
+
* [EN] : Error message (optional).
|
|
46
|
+
*/
|
|
11
47
|
error?: string;
|
|
48
|
+
/**
|
|
49
|
+
* [ID] : Handler perubahan nilai (opsional).
|
|
50
|
+
* [EN] : Value change handler (optional).
|
|
51
|
+
* @param newValue - [ID] : Nilai baru. [EN] : New value.
|
|
52
|
+
* @param actionMeta - [ID] : Meta aksi. [EN] : Action meta.
|
|
53
|
+
*/
|
|
12
54
|
onChange?: (newValue: MultiValue<T> | SingleValue<T> | T | T[] | object, actionMeta: ActionMeta<T>) => void;
|
|
55
|
+
/**
|
|
56
|
+
* [ID] : Menggunakan nilai eksternal (opsional).
|
|
57
|
+
* [EN] : Use external value (optional).
|
|
58
|
+
*/
|
|
13
59
|
externalValue?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* [ID] : Nilai default tombol dropdown (opsional).
|
|
62
|
+
* [EN] : Default dropdown button value (optional).
|
|
63
|
+
*/
|
|
14
64
|
defaultValueButtonDropdown?: object | T | T[];
|
|
65
|
+
/**
|
|
66
|
+
* [ID] : Tutup otomatis (opsional).
|
|
67
|
+
* [EN] : Auto close (optional).
|
|
68
|
+
*/
|
|
15
69
|
autoClose?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* [ID] : Handler saat menu dibuka (opsional).
|
|
72
|
+
* [EN] : On menu open handler (optional).
|
|
73
|
+
*/
|
|
16
74
|
onMenuOpen?: () => void;
|
|
75
|
+
/**
|
|
76
|
+
* [ID] : Tutup otomatis saat klik di luar (opsional).
|
|
77
|
+
* [EN] : Auto close outside (optional).
|
|
78
|
+
*/
|
|
17
79
|
autoCloseOutside?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* [ID] : Gaya CSS internal popper (opsional).
|
|
82
|
+
* [EN] : Internal popper CSS style (optional).
|
|
83
|
+
*/
|
|
18
84
|
styleInnerPopper?: React.CSSProperties;
|
|
85
|
+
/**
|
|
86
|
+
* [ID] : Handler saat menu ditutup (opsional).
|
|
87
|
+
* [EN] : On menu close handler (optional).
|
|
88
|
+
*/
|
|
19
89
|
onMenuClose?: () => void;
|
|
90
|
+
/**
|
|
91
|
+
* [ID] : Z-index popper (opsional).
|
|
92
|
+
* [EN] : Popper z-index (optional).
|
|
93
|
+
*/
|
|
20
94
|
zIndexPopper?: number | undefined | string;
|
|
95
|
+
/**
|
|
96
|
+
* [ID] : ID elemen (opsional).
|
|
97
|
+
* [EN] : Element ID (optional).
|
|
98
|
+
*/
|
|
21
99
|
id?: string;
|
|
100
|
+
/**
|
|
101
|
+
* [ID] : ID popover (opsional).
|
|
102
|
+
* [EN] : Popover ID (optional).
|
|
103
|
+
*/
|
|
22
104
|
idPopover?: string;
|
|
105
|
+
/**
|
|
106
|
+
* [ID] : Menggunakan penempatan otomatis (opsional).
|
|
107
|
+
* [EN] : Use auto placement (optional).
|
|
108
|
+
*/
|
|
23
109
|
useAutoPlacement?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* [ID] : Opsi flip (opsional).
|
|
112
|
+
* [EN] : Flip options (optional).
|
|
113
|
+
*/
|
|
24
114
|
flipOptions?: FlipOptions;
|
|
115
|
+
/**
|
|
116
|
+
* [ID] : Opsi penempatan otomatis (opsional).
|
|
117
|
+
* [EN] : Auto placement options (optional).
|
|
118
|
+
*/
|
|
25
119
|
autoPlacementOptions?: AutoPlacementOptions;
|
|
120
|
+
/**
|
|
121
|
+
* [ID] : Opsi floating UI (opsional).
|
|
122
|
+
* [EN] : Floating UI options (optional).
|
|
123
|
+
*/
|
|
26
124
|
floatingOptions?: UseFloatingOptions;
|
|
125
|
+
/**
|
|
126
|
+
* [ID] : Menampilkan pencarian (opsional).
|
|
127
|
+
* [EN] : Show search (optional).
|
|
128
|
+
*/
|
|
27
129
|
withSearch?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* [ID] : Komponen kustom select (opsional).
|
|
132
|
+
* [EN] : Custom select components (optional).
|
|
133
|
+
*/
|
|
28
134
|
components?: SelectComponentsConfig<T, boolean, GroupBase<T>>;
|
|
135
|
+
/**
|
|
136
|
+
* [ID] : Fungsi untuk mendapatkan label opsi (opsional).
|
|
137
|
+
* [EN] : Function to get option label (optional).
|
|
138
|
+
* @param option - [ID] : Opsi. [EN] : Option.
|
|
139
|
+
* @returns [ID] : Label opsi. [EN] : Option label.
|
|
140
|
+
*/
|
|
29
141
|
getOptionLabel?: (option: T) => React.ReactNode | Element | string;
|
|
142
|
+
/**
|
|
143
|
+
* [ID] : Properti tambahan select (opsional).
|
|
144
|
+
* [EN] : Additional select properties (optional).
|
|
145
|
+
*/
|
|
30
146
|
selectProps?: object;
|
|
147
|
+
/**
|
|
148
|
+
* [ID] : Offset popover (opsional).
|
|
149
|
+
* [EN] : Popover offset (optional).
|
|
150
|
+
*/
|
|
31
151
|
offsetPopover?: OffsetOptions;
|
|
32
|
-
|
|
152
|
+
/**
|
|
153
|
+
* [ID] : Label error (opsional).
|
|
154
|
+
* [EN] : Error label (optional).
|
|
155
|
+
*/
|
|
156
|
+
errorLabel?: 'payhere' | 'laba' | 'bill';
|
|
157
|
+
/**
|
|
158
|
+
* [ID] : Handler perubahan nilai aksi (opsional).
|
|
159
|
+
* [EN] : Action value change handler (optional).
|
|
160
|
+
* @param value - [ID] : Nilai baru. [EN] : New value.
|
|
161
|
+
*/
|
|
33
162
|
actionValueChange?: (value: MultiValue<T> | SingleValue<T> | T | T[] | object) => void;
|
|
34
|
-
|
|
163
|
+
/**
|
|
164
|
+
* [ID] : Tipe kontrol (opsional).
|
|
165
|
+
* [EN] : Control type (optional).
|
|
166
|
+
*/
|
|
167
|
+
controlType?: 'laba' | 'payhere' | 'bill';
|
|
35
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* [ID] : Interface untuk properti anak SelectDropdownContainer.
|
|
171
|
+
* [EN] : Interface for SelectDropdownContainer child properties.
|
|
172
|
+
* @template T - [ID] : Tipe data opsi. [EN] : Option data type.
|
|
173
|
+
*/
|
|
36
174
|
export interface IChildrenSelectDropdownContainer<T> {
|
|
175
|
+
/**
|
|
176
|
+
* [ID] : Nilai select.
|
|
177
|
+
* [EN] : Select value.
|
|
178
|
+
*/
|
|
37
179
|
selectValue: T | T[] | object;
|
|
180
|
+
/**
|
|
181
|
+
* [ID] : Fungsi pengatur nilai select.
|
|
182
|
+
* [EN] : Select value setter function.
|
|
183
|
+
*/
|
|
38
184
|
setSelectValue: React.Dispatch<React.SetStateAction<T>>;
|
|
185
|
+
/**
|
|
186
|
+
* [ID] : Handler tutup.
|
|
187
|
+
* [EN] : Close handler.
|
|
188
|
+
*/
|
|
39
189
|
handlerClose: () => void;
|
|
190
|
+
/**
|
|
191
|
+
* [ID] : Handler tampilkan.
|
|
192
|
+
* [EN] : Show handler.
|
|
193
|
+
* @param e - [ID] : Event mouse. [EN] : Mouse event.
|
|
194
|
+
*/
|
|
40
195
|
handlerShow: <U extends HTMLElement>(e: React.MouseEvent<U, unknown>) => void;
|
|
196
|
+
/**
|
|
197
|
+
* [ID] : Status visibilitas.
|
|
198
|
+
* [EN] : Visibility status.
|
|
199
|
+
*/
|
|
41
200
|
show: boolean;
|
|
201
|
+
/**
|
|
202
|
+
* [ID] : Fungsi pengatur visibilitas.
|
|
203
|
+
* [EN] : Visibility setter function.
|
|
204
|
+
* @param v - [ID] : Status visibilitas baru. [EN] : New visibility status.
|
|
205
|
+
*/
|
|
42
206
|
setShow: (v: boolean) => void;
|
|
43
207
|
}
|
|
208
|
+
/**
|
|
209
|
+
* [ID] : Interface untuk referensi SelectDropdownContainer.
|
|
210
|
+
* [EN] : Interface for SelectDropdownContainer reference.
|
|
211
|
+
* @template T - [ID] : Tipe data opsi. [EN] : Option data type.
|
|
212
|
+
*/
|
|
44
213
|
export interface IRefSelectDropdownContainer<T> {
|
|
214
|
+
/**
|
|
215
|
+
* [ID] : Nilai select.
|
|
216
|
+
* [EN] : Select value.
|
|
217
|
+
*/
|
|
45
218
|
selectValue: T | T[] | object;
|
|
219
|
+
/**
|
|
220
|
+
* [ID] : Fungsi pengatur nilai select.
|
|
221
|
+
* [EN] : Select value setter function.
|
|
222
|
+
*/
|
|
46
223
|
setSelectValue: React.Dispatch<React.SetStateAction<T>>;
|
|
224
|
+
/**
|
|
225
|
+
* [ID] : Handler tutup.
|
|
226
|
+
* [EN] : Close handler.
|
|
227
|
+
*/
|
|
47
228
|
handlerClose: () => void;
|
|
229
|
+
/**
|
|
230
|
+
* [ID] : Handler tampilkan.
|
|
231
|
+
* [EN] : Show handler.
|
|
232
|
+
* @param e - [ID] : Event mouse. [EN] : Mouse event.
|
|
233
|
+
*/
|
|
48
234
|
handlerShow: <U extends HTMLElement>(e: React.MouseEvent<U, unknown>) => void;
|
|
235
|
+
/**
|
|
236
|
+
* [ID] : Status visibilitas.
|
|
237
|
+
* [EN] : Visibility status.
|
|
238
|
+
*/
|
|
49
239
|
show: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* [ID] : Fungsi pengatur visibilitas.
|
|
242
|
+
* [EN] : Visibility setter function.
|
|
243
|
+
* @param v - [ID] : Status visibilitas baru. [EN] : New visibility status.
|
|
244
|
+
*/
|
|
50
245
|
setShow: (v: boolean) => void;
|
|
51
246
|
}
|
|
@@ -1,58 +1,287 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* [ID] : Tipe varian sidebar.
|
|
5
|
+
* [EN] : Sidebar variant type.
|
|
6
|
+
*/
|
|
7
|
+
export type TVariantSidebarType = 'payhere-brand-base-white' | 'payhere-brand-base-transparent' | 'laba-white' | 'lpd-brand-base-transparent' | 'lpd-brand-base-transparent-responsive' | 'lpd-brand-base-white' | 'lpd-brand-base-white-responsive' | 'bill-brand-base-white' | 'bill-brand-base-white-responsive';
|
|
8
|
+
/**
|
|
9
|
+
* [ID] : Interface untuk modul sidebar.
|
|
10
|
+
* [EN] : Interface for sidebar module.
|
|
11
|
+
*/
|
|
3
12
|
export interface ISidebarModule {
|
|
13
|
+
/**
|
|
14
|
+
* [ID] : Nama modul.
|
|
15
|
+
* [EN] : Module name.
|
|
16
|
+
*/
|
|
4
17
|
name: string;
|
|
18
|
+
/**
|
|
19
|
+
* [ID] : Label modul.
|
|
20
|
+
* [EN] : Module label.
|
|
21
|
+
*/
|
|
5
22
|
label: string;
|
|
23
|
+
/**
|
|
24
|
+
* [ID] : Slug modul.
|
|
25
|
+
* [EN] : Module slug.
|
|
26
|
+
*/
|
|
6
27
|
slug: string;
|
|
28
|
+
/**
|
|
29
|
+
* [ID] : Sub-modul.
|
|
30
|
+
* [EN] : Sub-modules.
|
|
31
|
+
*/
|
|
7
32
|
subs: ISidebarModule[];
|
|
33
|
+
/**
|
|
34
|
+
* [ID] : Status ditampilkan.
|
|
35
|
+
* [EN] : Is shown status.
|
|
36
|
+
*/
|
|
8
37
|
isShow: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* [ID] : ID induk.
|
|
40
|
+
* [EN] : Parent ID.
|
|
41
|
+
*/
|
|
9
42
|
parent: number;
|
|
43
|
+
/**
|
|
44
|
+
* [ID] : Ikon modul (opsional).
|
|
45
|
+
* [EN] : Module icon (optional).
|
|
46
|
+
*/
|
|
10
47
|
icon?: string;
|
|
48
|
+
/**
|
|
49
|
+
* [ID] : Ikon SVG (opsional).
|
|
50
|
+
* [EN] : SVG icon (optional).
|
|
51
|
+
*/
|
|
11
52
|
svgIcon?: React.ReactNode | null;
|
|
53
|
+
/**
|
|
54
|
+
* [ID] : Ikon SVG saat aktif (opsional).
|
|
55
|
+
* [EN] : SVG icon when active (optional).
|
|
56
|
+
*/
|
|
12
57
|
svgIconActive?: React.ReactNode | null;
|
|
58
|
+
/**
|
|
59
|
+
* [ID] : Ikon SVG saat hover (opsional).
|
|
60
|
+
* [EN] : SVG icon when hover (optional).
|
|
61
|
+
*/
|
|
62
|
+
svgIconHover?: React.ReactNode | null;
|
|
63
|
+
/**
|
|
64
|
+
* [ID] : Rute manual (opsional).
|
|
65
|
+
* [EN] : Manual route (optional).
|
|
66
|
+
*/
|
|
13
67
|
manualRoute?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* [ID] : Fungsi properti link (opsional).
|
|
70
|
+
* [EN] : Link properties function (optional).
|
|
71
|
+
* @param value - [ID] : Nilai link. [EN] : Link value.
|
|
72
|
+
* @param item - [ID] : Item modul. [EN] : Module item.
|
|
73
|
+
* @returns [ID] : Objek properti. [EN] : Property object.
|
|
74
|
+
*/
|
|
14
75
|
propsLink?: (value: string, item: ISidebarModule) => object;
|
|
76
|
+
/**
|
|
77
|
+
* [ID] : Properti dinamis lainnya.
|
|
78
|
+
* [EN] : Other dynamic properties.
|
|
79
|
+
*/
|
|
15
80
|
[key: string]: unknown;
|
|
16
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* [ID] : Interface untuk komponen Sidebar.
|
|
84
|
+
* [EN] : Interface for Sidebar component.
|
|
85
|
+
* @template T - [ID] : Tipe elemen React. [EN] : React element type.
|
|
86
|
+
*/
|
|
17
87
|
export interface ISidebar<T extends React.ElementType> extends React.HTMLAttributes<HTMLDivElement> {
|
|
88
|
+
/**
|
|
89
|
+
* [ID] : Elemen HTML yang akan dirender (opsional).
|
|
90
|
+
* [EN] : HTML element to be rendered (optional).
|
|
91
|
+
*/
|
|
18
92
|
as?: T;
|
|
93
|
+
/**
|
|
94
|
+
* [ID] : Konten anak sidebar.
|
|
95
|
+
* [EN] : Sidebar child content.
|
|
96
|
+
*/
|
|
19
97
|
children: React.ReactNode | React.ReactNode[];
|
|
98
|
+
/**
|
|
99
|
+
* [ID] : Patch (opsional).
|
|
100
|
+
* [EN] : Patch (optional).
|
|
101
|
+
*/
|
|
20
102
|
patch?: string;
|
|
103
|
+
/**
|
|
104
|
+
* [ID] : Ikon perusahaan.
|
|
105
|
+
* [EN] : Company icon.
|
|
106
|
+
*/
|
|
21
107
|
iconCompany: React.ReactNode | React.ReactNode[] | ((params: IChildrenIconCompany) => React.ReactNode) | ((params: IChildrenIconCompany) => React.ReactNode[]);
|
|
108
|
+
/**
|
|
109
|
+
* [ID] : Ikon sub-menu (opsional).
|
|
110
|
+
* [EN] : Sub-menu icon (optional).
|
|
111
|
+
*/
|
|
22
112
|
iconSubs?: React.ReactNode | React.ReactNode[];
|
|
113
|
+
/**
|
|
114
|
+
* [ID] : Ikon collapse (opsional).
|
|
115
|
+
* [EN] : Collapse icon (optional).
|
|
116
|
+
*/
|
|
23
117
|
iconCollapse?: React.ReactNode | React.ReactNode[];
|
|
118
|
+
/**
|
|
119
|
+
* [ID] : Ikon collapse tutup (opsional).
|
|
120
|
+
* [EN] : Collapse close icon (optional).
|
|
121
|
+
*/
|
|
24
122
|
iconCollapseClose?: React.ReactNode | React.ReactNode[];
|
|
123
|
+
/**
|
|
124
|
+
* [ID] : Varian sidebar (opsional).
|
|
125
|
+
* [EN] : Sidebar variant (optional).
|
|
126
|
+
*/
|
|
25
127
|
variant?: TVariantSidebarType;
|
|
128
|
+
/**
|
|
129
|
+
* [ID] : Daftar modul.
|
|
130
|
+
* [EN] : Module list.
|
|
131
|
+
*/
|
|
26
132
|
modules: ISidebarModule[];
|
|
133
|
+
/**
|
|
134
|
+
* [ID] : Toleransi lebar ikon perusahaan (opsional).
|
|
135
|
+
* [EN] : Company icon width tolerance (optional).
|
|
136
|
+
*/
|
|
27
137
|
toleranceWidthIconCompany?: number;
|
|
138
|
+
/**
|
|
139
|
+
* [ID] : Footer sidebar (opsional).
|
|
140
|
+
* [EN] : Sidebar footer (optional).
|
|
141
|
+
*/
|
|
28
142
|
footer?: React.ReactNode | React.ReactNode[] | (() => React.ReactNode) | (() => React.ReactNode[]);
|
|
143
|
+
/**
|
|
144
|
+
* [ID] : Handler klik item (opsional).
|
|
145
|
+
* [EN] : Item click handler (optional).
|
|
146
|
+
* @param v - [ID] : Modul yang diklik. [EN] : Clicked module.
|
|
147
|
+
*/
|
|
29
148
|
onClickItems?: (v: ISidebarModule) => void;
|
|
149
|
+
/**
|
|
150
|
+
* [ID] : Fungsi properti link (opsional).
|
|
151
|
+
* [EN] : Link properties function (optional).
|
|
152
|
+
* @param value - [ID] : Nilai link. [EN] : Link value.
|
|
153
|
+
* @param item - [ID] : Item modul. [EN] : Module item.
|
|
154
|
+
* @returns [ID] : Objek properti. [EN] : Property object.
|
|
155
|
+
*/
|
|
30
156
|
propsLink?: (value: string, item: ISidebarModule) => object;
|
|
157
|
+
/**
|
|
158
|
+
* [ID] : Menggunakan pewarisan (opsional).
|
|
159
|
+
* [EN] : Use inheritance (optional).
|
|
160
|
+
*/
|
|
31
161
|
withInheritance?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* [ID] : ID elemen (opsional).
|
|
164
|
+
* [EN] : Element ID (optional).
|
|
165
|
+
*/
|
|
166
|
+
id?: string;
|
|
32
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* [ID] : Interface untuk item sidebar.
|
|
170
|
+
* [EN] : Interface for sidebar item.
|
|
171
|
+
* @template T - [ID] : Tipe elemen React. [EN] : React element type.
|
|
172
|
+
*/
|
|
33
173
|
export interface IItemSidebar<T extends React.ElementType> extends ISidebarModule {
|
|
174
|
+
/**
|
|
175
|
+
* [ID] : Elemen HTML yang akan dirender (opsional).
|
|
176
|
+
* [EN] : HTML element to be rendered (optional).
|
|
177
|
+
*/
|
|
34
178
|
as?: T;
|
|
179
|
+
/**
|
|
180
|
+
* [ID] : Status tampilan.
|
|
181
|
+
* [EN] : Show status.
|
|
182
|
+
*/
|
|
35
183
|
show: string;
|
|
184
|
+
/**
|
|
185
|
+
* [ID] : Status terbuka.
|
|
186
|
+
* [EN] : Open status.
|
|
187
|
+
*/
|
|
36
188
|
open: boolean | null;
|
|
189
|
+
/**
|
|
190
|
+
* [ID] : Patch (opsional).
|
|
191
|
+
* [EN] : Patch (optional).
|
|
192
|
+
*/
|
|
37
193
|
patch?: string;
|
|
194
|
+
/**
|
|
195
|
+
* [ID] : Ikon sub-menu (opsional).
|
|
196
|
+
* [EN] : Sub-menu icon (optional).
|
|
197
|
+
*/
|
|
38
198
|
iconSubs?: React.ReactNode | React.ReactNode[] | (() => React.ReactNode) | (() => React.ReactNode[]);
|
|
199
|
+
/**
|
|
200
|
+
* [ID] : Varian sidebar (opsional).
|
|
201
|
+
* [EN] : Sidebar variant (optional).
|
|
202
|
+
*/
|
|
39
203
|
variant?: TVariantSidebarType;
|
|
204
|
+
/**
|
|
205
|
+
* [ID] : Fungsi pengatur tampilan.
|
|
206
|
+
* [EN] : Show setter function.
|
|
207
|
+
* @param v - [ID] : Nilai tampilan baru. [EN] : New show value.
|
|
208
|
+
*/
|
|
40
209
|
setShow: (v: string) => void;
|
|
210
|
+
/**
|
|
211
|
+
* [ID] : Handler klik item (opsional).
|
|
212
|
+
* [EN] : Item click handler (optional).
|
|
213
|
+
* @param v - [ID] : Modul yang diklik. [EN] : Clicked module.
|
|
214
|
+
*/
|
|
41
215
|
onClickItems?: (v: ISidebarModule) => void;
|
|
216
|
+
/**
|
|
217
|
+
* [ID] : Fungsi properti link (opsional).
|
|
218
|
+
* [EN] : Link properties function (optional).
|
|
219
|
+
* @param value - [ID] : Nilai link. [EN] : Link value.
|
|
220
|
+
* @param item - [ID] : Item modul. [EN] : Module item.
|
|
221
|
+
* @returns [ID] : Objek properti. [EN] : Property object.
|
|
222
|
+
*/
|
|
42
223
|
propsLink?: (value: string, item: ISidebarModule) => object;
|
|
224
|
+
/**
|
|
225
|
+
* [ID] : Komponen link (opsional).
|
|
226
|
+
* [EN] : Link component (optional).
|
|
227
|
+
*/
|
|
43
228
|
linkComponent?: T;
|
|
44
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* [ID] : Interface untuk elemen kloning sidebar.
|
|
232
|
+
* [EN] : Interface for sidebar clone element.
|
|
233
|
+
*/
|
|
45
234
|
export interface ICloneElementSidebar {
|
|
235
|
+
/**
|
|
236
|
+
* [ID] : Status sidebar terbuka (opsional).
|
|
237
|
+
* [EN] : Sidebar open status (optional).
|
|
238
|
+
*/
|
|
46
239
|
openSidebar?: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* [ID] : Fungsi pengatur status sidebar terbuka (opsional).
|
|
242
|
+
* [EN] : Sidebar open status setter function (optional).
|
|
243
|
+
*/
|
|
47
244
|
setOpenSidebar?: React.Dispatch<React.SetStateAction<boolean | null>>;
|
|
245
|
+
/**
|
|
246
|
+
* [ID] : Handler klik collapse (opsional).
|
|
247
|
+
* [EN] : Collapse click handler (optional).
|
|
248
|
+
*/
|
|
48
249
|
handlerClickCollapse?: () => void;
|
|
49
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* [ID] : Interface untuk referensi sidebar.
|
|
253
|
+
* [EN] : Interface for sidebar reference.
|
|
254
|
+
*/
|
|
50
255
|
export interface IRefSidebar {
|
|
256
|
+
/**
|
|
257
|
+
* [ID] : Status sidebar terbuka.
|
|
258
|
+
* [EN] : Sidebar open status.
|
|
259
|
+
*/
|
|
51
260
|
openSidebar: boolean | null;
|
|
261
|
+
/**
|
|
262
|
+
* [ID] : Fungsi pengatur status sidebar terbuka.
|
|
263
|
+
* [EN] : Sidebar open status setter function.
|
|
264
|
+
*/
|
|
52
265
|
setOpenSidebar: React.Dispatch<React.SetStateAction<boolean | null>>;
|
|
266
|
+
/**
|
|
267
|
+
* [ID] : Handler klik collapse.
|
|
268
|
+
* [EN] : Collapse click handler.
|
|
269
|
+
*/
|
|
53
270
|
handlerClickCollapse: () => void;
|
|
54
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* [ID] : Interface untuk anak ikon perusahaan.
|
|
274
|
+
* [EN] : Interface for company icon children.
|
|
275
|
+
*/
|
|
55
276
|
export interface IChildrenIconCompany {
|
|
277
|
+
/**
|
|
278
|
+
* [ID] : Status sidebar terbuka.
|
|
279
|
+
* [EN] : Sidebar open status.
|
|
280
|
+
*/
|
|
56
281
|
openSidebar: boolean | null;
|
|
282
|
+
/**
|
|
283
|
+
* [ID] : Fungsi pengatur status sidebar terbuka.
|
|
284
|
+
* [EN] : Sidebar open status setter function.
|
|
285
|
+
*/
|
|
57
286
|
setOpenSidebar: React.Dispatch<React.SetStateAction<boolean | null>>;
|
|
58
287
|
}
|