@ttdk-design-system/library-vue 0.0.0-stage → 1.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/AI_GUIDE.md +6518 -0
- package/llms.txt +6518 -0
- package/package.json +1096 -4
- package/src/core/index.ts +2 -0
- package/src/core/tailwind-preset.cjs +62 -0
- package/src/core/tailwind-preset.ts +85 -0
- package/src/core/theme/tokens.css +663 -0
- package/src/core/types.ts +836 -0
- package/src/index.ts +17 -0
- package/src/tailwind-preset.cjs +62 -0
- package/src/tailwind-preset.ts +85 -0
- package/src/types.ts +1 -0
- package/src/web/accordion/AI_GUIDE.md +149 -0
- package/src/web/accordion/accordion.css +1 -0
- package/src/web/accordion/accordion.vue +432 -0
- package/src/web/accordion/accordion.vue.d.ts +227 -0
- package/src/web/accordion/index.ts +3 -0
- package/src/web/accordion/manifest.json +351 -0
- package/src/web/alert/AI_GUIDE.md +139 -0
- package/src/web/alert/alert.css +1 -0
- package/src/web/alert/alert.vue +290 -0
- package/src/web/alert/alert.vue.d.ts +154 -0
- package/src/web/alert/index.ts +3 -0
- package/src/web/alert/manifest.json +240 -0
- package/src/web/avatar/AI_GUIDE.md +118 -0
- package/src/web/avatar/avatar.css +1 -0
- package/src/web/avatar/avatar.vue +217 -0
- package/src/web/avatar/avatar.vue.d.ts +135 -0
- package/src/web/avatar/index.ts +3 -0
- package/src/web/avatar/manifest.json +195 -0
- package/src/web/badge/AI_GUIDE.md +94 -0
- package/src/web/badge/badge.css +1 -0
- package/src/web/badge/badge.vue +135 -0
- package/src/web/badge/badge.vue.d.ts +108 -0
- package/src/web/badge/index.ts +3 -0
- package/src/web/badge/manifest.json +141 -0
- package/src/web/banner/AI_GUIDE.md +130 -0
- package/src/web/banner/banner.css +1 -0
- package/src/web/banner/banner.vue +303 -0
- package/src/web/banner/banner.vue.d.ts +162 -0
- package/src/web/banner/index.ts +3 -0
- package/src/web/banner/manifest.json +240 -0
- package/src/web/breadcrumb/AI_GUIDE.md +120 -0
- package/src/web/breadcrumb/breadcrumb.css +1 -0
- package/src/web/breadcrumb/breadcrumb.vue +313 -0
- package/src/web/breadcrumb/breadcrumb.vue.d.ts +139 -0
- package/src/web/breadcrumb/index.ts +3 -0
- package/src/web/breadcrumb/manifest.json +225 -0
- package/src/web/button/AI_GUIDE.md +121 -0
- package/src/web/button/button.css +1 -0
- package/src/web/button/button.vue +283 -0
- package/src/web/button/button.vue.d.ts +147 -0
- package/src/web/button/index.ts +3 -0
- package/src/web/button/manifest.json +177 -0
- package/src/web/calendar/AI_GUIDE.md +151 -0
- package/src/web/calendar/calendar.css +1 -0
- package/src/web/calendar/calendar.vue +1536 -0
- package/src/web/calendar/calendar.vue.d.ts +261 -0
- package/src/web/calendar/index.ts +3 -0
- package/src/web/calendar/manifest.json +470 -0
- package/src/web/card/AI_GUIDE.md +133 -0
- package/src/web/card/card.css +1 -0
- package/src/web/card/card.vue +423 -0
- package/src/web/card/card.vue.d.ts +232 -0
- package/src/web/card/index.ts +3 -0
- package/src/web/card/manifest.json +357 -0
- package/src/web/checkbox/AI_GUIDE.md +146 -0
- package/src/web/checkbox/checkbox.css +1 -0
- package/src/web/checkbox/checkbox.vue +304 -0
- package/src/web/checkbox/checkbox.vue.d.ts +189 -0
- package/src/web/checkbox/index.ts +3 -0
- package/src/web/checkbox/manifest.json +294 -0
- package/src/web/chip/AI_GUIDE.md +186 -0
- package/src/web/chip/chip.css +1 -0
- package/src/web/chip/chip.vue +220 -0
- package/src/web/chip/chip.vue.d.ts +140 -0
- package/src/web/chip/index.ts +3 -0
- package/src/web/chip/manifest.json +186 -0
- package/src/web/dropdown/AI_GUIDE.md +167 -0
- package/src/web/dropdown/dropdown.css +1 -0
- package/src/web/dropdown/dropdown.vue +1257 -0
- package/src/web/dropdown/dropdown.vue.d.ts +381 -0
- package/src/web/dropdown/index.ts +3 -0
- package/src/web/dropdown/manifest.json +576 -0
- package/src/web/flex/AI_GUIDE.md +113 -0
- package/src/web/flex/flex-item.vue +94 -0
- package/src/web/flex/flex-item.vue.d.ts +84 -0
- package/src/web/flex/flex.css +1 -0
- package/src/web/flex/flex.vue +103 -0
- package/src/web/flex/flex.vue.d.ts +92 -0
- package/src/web/flex/index.ts +5 -0
- package/src/web/flex/manifest.json +162 -0
- package/src/web/form/index.ts +7 -0
- package/src/web/grid/AI_GUIDE.md +112 -0
- package/src/web/grid/grid-item.vue +109 -0
- package/src/web/grid/grid-item.vue.d.ts +99 -0
- package/src/web/grid/grid.css +1 -0
- package/src/web/grid/grid.vue +94 -0
- package/src/web/grid/grid.vue.d.ts +84 -0
- package/src/web/grid/index.ts +5 -0
- package/src/web/grid/manifest.json +153 -0
- package/src/web/index.ts +86 -0
- package/src/web/input/AI_GUIDE.md +159 -0
- package/src/web/input/index.ts +3 -0
- package/src/web/input/input.css +1 -0
- package/src/web/input/input.vue +521 -0
- package/src/web/input/input.vue.d.ts +274 -0
- package/src/web/input/manifest.json +465 -0
- package/src/web/input-number/AI_GUIDE.md +164 -0
- package/src/web/input-number/index.ts +3 -0
- package/src/web/input-number/input-number.css +1 -0
- package/src/web/input-number/input-number.vue +1153 -0
- package/src/web/input-number/input-number.vue.d.ts +343 -0
- package/src/web/input-number/manifest.json +575 -0
- package/src/web/modal/AI_GUIDE.md +171 -0
- package/src/web/modal/index.ts +3 -0
- package/src/web/modal/manifest.json +375 -0
- package/src/web/modal/modal.css +1 -0
- package/src/web/modal/modal.vue +344 -0
- package/src/web/modal/modal.vue.d.ts +64 -0
- package/src/web/pagination/AI_GUIDE.md +148 -0
- package/src/web/pagination/index.ts +21 -0
- package/src/web/pagination/manifest.json +432 -0
- package/src/web/pagination/pagination-content.vue +42 -0
- package/src/web/pagination/pagination-content.vue.d.ts +28 -0
- package/src/web/pagination/pagination-ellipsis.vue +55 -0
- package/src/web/pagination/pagination-ellipsis.vue.d.ts +28 -0
- package/src/web/pagination/pagination-first.vue +161 -0
- package/src/web/pagination/pagination-first.vue.d.ts +67 -0
- package/src/web/pagination/pagination-item.vue +42 -0
- package/src/web/pagination/pagination-item.vue.d.ts +28 -0
- package/src/web/pagination/pagination-last.vue +161 -0
- package/src/web/pagination/pagination-last.vue.d.ts +67 -0
- package/src/web/pagination/pagination-link.vue +118 -0
- package/src/web/pagination/pagination-link.vue.d.ts +61 -0
- package/src/web/pagination/pagination-next.vue +160 -0
- package/src/web/pagination/pagination-next.vue.d.ts +68 -0
- package/src/web/pagination/pagination-previous.vue +160 -0
- package/src/web/pagination/pagination-previous.vue.d.ts +68 -0
- package/src/web/pagination/pagination.css +1 -0
- package/src/web/pagination/pagination.vue +730 -0
- package/src/web/pagination/pagination.vue.d.ts +247 -0
- package/src/web/popover/AI_GUIDE.md +163 -0
- package/src/web/popover/index.ts +3 -0
- package/src/web/popover/manifest.json +396 -0
- package/src/web/popover/popover.css +1 -0
- package/src/web/popover/popover.vue +579 -0
- package/src/web/popover/popover.vue.d.ts +83 -0
- package/src/web/radio/AI_GUIDE.md +155 -0
- package/src/web/radio/index.ts +3 -0
- package/src/web/radio/manifest.json +294 -0
- package/src/web/radio/radio.css +1 -0
- package/src/web/radio/radio.vue +288 -0
- package/src/web/radio/radio.vue.d.ts +182 -0
- package/src/web/selectbox/AI_GUIDE.md +216 -0
- package/src/web/selectbox/index.ts +3 -0
- package/src/web/selectbox/manifest.json +477 -0
- package/src/web/selectbox/selectbox.css +1 -0
- package/src/web/selectbox/selectbox.vue +1024 -0
- package/src/web/selectbox/selectbox.vue.d.ts +300 -0
- package/src/web/sonner/AI_GUIDE.md +98 -0
- package/src/web/sonner/index.ts +114 -0
- package/src/web/sonner/manifest.json +132 -0
- package/src/web/sonner/sonner.css +1 -0
- package/src/web/sonner/sonner.vue +180 -0
- package/src/web/sonner/sonner.vue.d.ts +113 -0
- package/src/web/table/AI_GUIDE.md +145 -0
- package/src/web/table/index.ts +34 -0
- package/src/web/table/manifest.json +168 -0
- package/src/web/table/table-body.vue +42 -0
- package/src/web/table/table-body.vue.d.ts +28 -0
- package/src/web/table/table-caption.vue +42 -0
- package/src/web/table/table-caption.vue.d.ts +28 -0
- package/src/web/table/table-cell.vue +71 -0
- package/src/web/table/table-cell.vue.d.ts +49 -0
- package/src/web/table/table-empty.vue +105 -0
- package/src/web/table/table-empty.vue.d.ts +57 -0
- package/src/web/table/table-footer.vue +42 -0
- package/src/web/table/table-footer.vue.d.ts +28 -0
- package/src/web/table/table-head.vue +78 -0
- package/src/web/table/table-head.vue.d.ts +50 -0
- package/src/web/table/table-header.vue +42 -0
- package/src/web/table/table-header.vue.d.ts +28 -0
- package/src/web/table/table-row.vue +70 -0
- package/src/web/table/table-row.vue.d.ts +44 -0
- package/src/web/table/table.css +1 -0
- package/src/web/table/table.vue +298 -0
- package/src/web/table/table.vue.d.ts +119 -0
- package/src/web/tabs/AI_GUIDE.md +150 -0
- package/src/web/tabs/index.ts +2 -0
- package/src/web/tabs/manifest.json +315 -0
- package/src/web/tabs/tabs.css +1 -0
- package/src/web/tabs/tabs.vue +164 -0
- package/src/web/tabs/tabs.vue.d.ts +60 -0
- package/src/web/text/AI_GUIDE.md +129 -0
- package/src/web/text/index.ts +2 -0
- package/src/web/text/manifest.json +195 -0
- package/src/web/text/text.css +1 -0
- package/src/web/text/text.vue +195 -0
- package/src/web/text/text.vue.d.ts +161 -0
- package/src/web/textarea/AI_GUIDE.md +141 -0
- package/src/web/textarea/index.ts +3 -0
- package/src/web/textarea/manifest.json +438 -0
- package/src/web/textarea/textarea.css +1 -0
- package/src/web/textarea/textarea.vue +458 -0
- package/src/web/textarea/textarea.vue.d.ts +265 -0
- package/src/web/tooltip/AI_GUIDE.md +110 -0
- package/src/web/tooltip/index.ts +3 -0
- package/src/web/tooltip/manifest.json +222 -0
- package/src/web/tooltip/tooltip.css +1 -0
- package/src/web/tooltip/tooltip.vue +417 -0
- package/src/web/tooltip/tooltip.vue.d.ts +150 -0
- package/src/webview/bottomsheet/AI_GUIDE.md +141 -0
- package/src/webview/bottomsheet/bottomsheet.css +1 -0
- package/src/webview/bottomsheet/bottomsheet.vue +441 -0
- package/src/webview/bottomsheet/bottomsheet.vue.d.ts +178 -0
- package/src/webview/bottomsheet/index.ts +4 -0
- package/src/webview/bottomsheet/manifest.json +377 -0
- package/src/webview/button/AI_GUIDE.md +79 -0
- package/src/webview/button/button-ios.css +1 -0
- package/src/webview/button/button-ios.vue +138 -0
- package/src/webview/button/button-ios.vue.d.ts +102 -0
- package/src/webview/button/button-material.css +1 -0
- package/src/webview/button/button-material.vue +138 -0
- package/src/webview/button/button-material.vue.d.ts +102 -0
- package/src/webview/button/index.ts +7 -0
- package/src/webview/button/manifest.json +148 -0
- package/src/webview/index.ts +7 -0
- package/tailwind-preset.cjs +62 -0
- package/tailwind-preset.js +62 -0
- package/ttdk-manifest.json +10188 -0
- package/README.md +0 -3
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// Auto-generated by TTDK Design System Vue Type Generator
|
|
3
|
+
import type { DefineComponent } from "vue";
|
|
4
|
+
import { buildUiVars, UiProps } from "../../core/types";
|
|
5
|
+
|
|
6
|
+
export type PaginationUiProps = UiProps;
|
|
7
|
+
|
|
8
|
+
export interface PaginationPageItem {
|
|
9
|
+
type: "page" | "ellipsis";
|
|
10
|
+
value: number | string;
|
|
11
|
+
key: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface PaginationProps {
|
|
15
|
+
/**
|
|
16
|
+
* Nomor halaman saat ini (1-indexed).
|
|
17
|
+
* @default 1
|
|
18
|
+
*/
|
|
19
|
+
page?: number;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Jumlah total halaman maksimum (alias untuk totalPages).
|
|
23
|
+
* @default 1
|
|
24
|
+
*/
|
|
25
|
+
maxPages?: number;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Jumlah total halaman (alias maxPages).
|
|
29
|
+
* @default 1
|
|
30
|
+
*/
|
|
31
|
+
totalPages?: number;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Jumlah baris/item data per halaman (page size).
|
|
35
|
+
* @default 10
|
|
36
|
+
*/
|
|
37
|
+
limit?: number;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Callback saat jumlah baris per halaman diubah via select box.
|
|
41
|
+
*/
|
|
42
|
+
onLimitChange?: (limit: number) => void;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Pilihan angka baris per halaman pada select box.
|
|
46
|
+
* @default [10, 20, 50, 100]
|
|
47
|
+
*/
|
|
48
|
+
limitOptions?: number[];
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Menentukan apakah navigasi ke halaman sebelumnya diizinkan (false = tombol Previous dinonaktifkan).
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
canPrevPage?: boolean;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Menentukan apakah navigasi ke halaman berikutnya diizinkan (false = tombol Next dinonaktifkan).
|
|
58
|
+
* @default false
|
|
59
|
+
*/
|
|
60
|
+
canNextPage?: boolean;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Callback saat tombol First Page (halaman pertama) diklik.
|
|
64
|
+
*/
|
|
65
|
+
onFirstPage?: () => void;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Callback saat tombol Previous Page (halaman sebelumnya) diklik.
|
|
69
|
+
*/
|
|
70
|
+
onPrevPage?: () => void;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Callback saat tombol Next Page (halaman selanjutnya) diklik.
|
|
74
|
+
*/
|
|
75
|
+
onNextPage?: () => void;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Callback saat tombol Last Page (halaman terakhir) diklik.
|
|
79
|
+
*/
|
|
80
|
+
onLastPage?: () => void;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Callback saat nomor halaman tertentu diklik.
|
|
84
|
+
*/
|
|
85
|
+
onPageChange?: (page: number) => void;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Jumlah tetangga nomor halaman di samping kiri dan kanan halaman aktif.
|
|
89
|
+
* @default 1
|
|
90
|
+
*/
|
|
91
|
+
siblingCount?: number;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Menampilkan tombol First (<<) dan Last (>>).
|
|
95
|
+
* @default false
|
|
96
|
+
*/
|
|
97
|
+
showEdges?: boolean;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Menampilkan nomor halaman terpaginasi (1, 2, 3...).
|
|
101
|
+
* @default true
|
|
102
|
+
*/
|
|
103
|
+
showPageNumbers?: boolean;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Skala ukuran pagination:
|
|
107
|
+
* - `'sm'`: 28px
|
|
108
|
+
* - `'md'`: 36px (standar)
|
|
109
|
+
* - `'lg'`: 44px
|
|
110
|
+
* @default 'md'
|
|
111
|
+
*/
|
|
112
|
+
size?: "sm" | "md" | "lg";
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Inline CSS style object native.
|
|
116
|
+
*/
|
|
117
|
+
style?: any;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Kustomisasi visual granular root kontainer pagination (UiProps).
|
|
121
|
+
*/
|
|
122
|
+
ui?: UiProps;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Style kustom untuk kontainer daftar pagination content (ul.ttdk-pagination-content).
|
|
126
|
+
*/
|
|
127
|
+
contentStyle?: UiProps;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Class CSS kustom untuk kontainer daftar pagination content.
|
|
131
|
+
*/
|
|
132
|
+
contentClass?: string;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Style kustom untuk tombol link nomor halaman / navigasi.
|
|
136
|
+
*/
|
|
137
|
+
linkStyle?: UiProps;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Class CSS kustom untuk tombol link nomor halaman / navigasi.
|
|
141
|
+
*/
|
|
142
|
+
linkClass?: string;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Style kustom untuk tombol nomor halaman saat aktif.
|
|
146
|
+
*/
|
|
147
|
+
activeLinkStyle?: UiProps;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Class CSS kustom untuk tombol nomor halaman saat aktif.
|
|
151
|
+
*/
|
|
152
|
+
activeLinkClass?: string;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Style kustom untuk kontainer baris per halaman (limit).
|
|
156
|
+
*/
|
|
157
|
+
limitStyle?: UiProps;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Class CSS kustom untuk kontainer baris per halaman (limit).
|
|
161
|
+
*/
|
|
162
|
+
limitClass?: string;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Style kustom untuk elemen Selectbox baris per halaman (limit).
|
|
166
|
+
*/
|
|
167
|
+
limitSelectStyle?: UiProps;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Slot kustom untuk menggantikan elemen limit selector bawaan.
|
|
171
|
+
*/
|
|
172
|
+
limitSlot?: any;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Menentukan apakah kontrol baris per halaman (limit selectbox) ditampilkan.
|
|
176
|
+
* Jika tidak disetel, otomatis mengikuti keberadaan callback onLimitChange.
|
|
177
|
+
*/
|
|
178
|
+
showLimit?: boolean;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Menentukan apakah teks label 'Baris per halaman:' ditampilkan di samping selectbox limit.
|
|
182
|
+
* @default true
|
|
183
|
+
*/
|
|
184
|
+
showLimitLabel?: boolean;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Teks label untuk opsi baris per halaman.
|
|
188
|
+
* @default 'Baris per halaman:'
|
|
189
|
+
*/
|
|
190
|
+
limitLabel?: string;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Ikon kustom untuk tombol halaman pertama (first page, menggantikan <<).
|
|
194
|
+
*/
|
|
195
|
+
firstIcon?: any;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Ikon kustom untuk tombol halaman sebelumnya (previous page, menggantikan <).
|
|
199
|
+
*/
|
|
200
|
+
prevIcon?: any;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Ikon kustom untuk tombol halaman selanjutnya (next page, menggantikan >).
|
|
204
|
+
*/
|
|
205
|
+
nextIcon?: any;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Ikon kustom untuk tombol halaman terakhir (last page, menggantikan >>).
|
|
209
|
+
*/
|
|
210
|
+
lastIcon?: any;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Ikon kustom untuk separator elipsis (menggantikan ...).
|
|
214
|
+
*/
|
|
215
|
+
ellipsisIcon?: any;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Label teks tombol Previous.
|
|
219
|
+
* @default 'Previous'
|
|
220
|
+
*/
|
|
221
|
+
prevText?: string;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Label teks tombol Next.
|
|
225
|
+
* @default 'Next'
|
|
226
|
+
*/
|
|
227
|
+
nextText?: string;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Mode hanya menampilkan ikon pada tombol Previous dan Next tanpa teks label.
|
|
231
|
+
* @default false
|
|
232
|
+
*/
|
|
233
|
+
iconOnly?: boolean;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Class CSS kustom.
|
|
237
|
+
*/
|
|
238
|
+
className?: string;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Konten kustom atau subkomponen compound (PaginationContent, PaginationItem, dll).
|
|
242
|
+
*/
|
|
243
|
+
children?: any;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
declare const component: DefineComponent<PaginationProps>;
|
|
247
|
+
export default component;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# <Popover /> — TTDK Component Reference
|
|
2
|
+
|
|
3
|
+
Komponen Popover TTDK Design System — Selaras dengan Spesifikasi Nuxt UI Popover (UPopover): - Mendukung mode 'click' dan mode 'hover' dengan configurable openDelay dan closeDelay - Floating UI otomatis (computePosition, autoUpdate, flip, shift, offset, arrow) - Posisi cerdas (top, bottom, left, right, start, end) - Elemen panah (arrow) penunjuk arah dinamis - Mode modal dengan backdrop overlay - Penanganan dismissible & closePrevent (Esc key, outside click) - Dukungan controlled state (v-model:open) dan uncontrolled defaultOpen
|
|
4
|
+
|
|
5
|
+
## 1. Stylesheets & Theming (Pure CSS)
|
|
6
|
+
Import the corresponding stylesheet for the theme you wish to use:
|
|
7
|
+
- **COMMON Theme**: `import "@ttdk-design-system/library-<react|vue|svelte>/web/popover/popover.css";`
|
|
8
|
+
|
|
9
|
+
## 2. Subpath Component Import
|
|
10
|
+
```ts
|
|
11
|
+
// React
|
|
12
|
+
import Popover from "@ttdk-design-system/library-react/web/popover";
|
|
13
|
+
|
|
14
|
+
// Vue 3
|
|
15
|
+
import Popover from "@ttdk-design-system/library-vue/web/popover";
|
|
16
|
+
|
|
17
|
+
// Svelte
|
|
18
|
+
import Popover from "@ttdk-design-system/library-svelte/web/popover";
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 3. Props & API Reference
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Default | Description |
|
|
24
|
+
| :--- | :--- | :--- | :--- |
|
|
25
|
+
| `open?` | `boolean` | `-` | Status visibilitas popover (mode terkontrol / controlled state). Mendukung `v-model:open` pada Vue 3 dan controlled prop `open` pada React. |
|
|
26
|
+
| `defaultOpen?` | `boolean` | `false` | Status visibilitas awal saat pertama kali dirender (mode tidak terkontrol / uncontrolled initial state). |
|
|
27
|
+
| `arrow?` | `boolean` | `false` | Menampilkan elemen panah (arrow) penunjuk arah yang menunjuk ke elemen pemicu. |
|
|
28
|
+
| `dismissible?` | `boolean` | `true` | Mengizinkan popover ditutup saat pengguna mengeklik area di luar popover atau menekan tombol `Escape`. Jika bernilai `false`, popover tidak akan tertutup dan event `onClosePrevent` akan dipanggil. |
|
|
29
|
+
| `modal?` | `boolean` | `false` | Mengaktifkan mode modal dengan menampilkan lapisan latar belakang redup (backdrop overlay) serta memblokir interaksi di luar popover dan mengunci scroll latar belakang. |
|
|
30
|
+
| `preventScroll?` | `boolean` | `false` | Mengunci pengguliran halaman web (body scroll lock) saat popover sedang terbuka, sehingga pengguna tidak dapat menggulir halaman di latar belakang. Otomatis aktif saat `modal={true}` kecuali dinyatakan `false`. |
|
|
31
|
+
| `lockScroll?` | `boolean` | `false` | Alias untuk `preventScroll`. |
|
|
32
|
+
| `disabled?` | `boolean` | `false` | Menonaktifkan pemicu sehingga popover tidak dapat dibuka. |
|
|
33
|
+
| `content?` | `PopoverContentOptions | any` | `-` | Opsi konfigurasi penempatan dan benturan popover (side, align, sideOffset, dsb.) ATAU elemen konten popover secara langsung jika tidak menggunakan slot/children. |
|
|
34
|
+
| `panel?` | `any` | `-` | Konten kustom panel popover (alias untuk konten popover jika `content` dipakai untuk konfigurasi). Menerima ReactNode, VNode, string, atau render function `({ close }) => ReactNode`. |
|
|
35
|
+
| `panelContent?` | `any` | `-` | Konten kustom panel popover (kompatibilitas selaras dengan Dropdown panelContent). Menerima ReactNode, VNode, string, atau render function `({ close }) => ReactNode`. |
|
|
36
|
+
| `placement?` | `| 'top'
|
|
37
|
+
| 'top-start'
|
|
38
|
+
| 'top-end'
|
|
39
|
+
| 'bottom'
|
|
40
|
+
| 'bottom-start'
|
|
41
|
+
| 'bottom-end'
|
|
42
|
+
| 'left'
|
|
43
|
+
| 'left-start'
|
|
44
|
+
| 'left-end'
|
|
45
|
+
| 'right'
|
|
46
|
+
| 'right-start'
|
|
47
|
+
| 'right-end'` | `bottom` | Pintasan posisi penempatan panel popover Floating UI ('top', 'bottom', 'left', 'right', dsb.) Selaras dengan konfigurasi content.side dan content.align. |
|
|
48
|
+
| `offsetDistance?` | `number` | `8` | Jarak offset dalam pixel dari elemen pemicu (shorthand untuk content.sideOffset). |
|
|
49
|
+
| `block?` | `boolean` | `false` | Menjadikan popover memenuhi lebar kontainer penuh (full width 100%). |
|
|
50
|
+
| `ui?` | `PopoverUiProps` | `-` | Kustomisasi visual granular wrapper utama (UiProps). |
|
|
51
|
+
| `style?` | `any` | `-` | Style inline CSS native untuk wrapper luar. |
|
|
52
|
+
| `className?` | `string` | `-` | Class CSS kustom untuk wrapper luar. |
|
|
53
|
+
| `triggerClass?` | `string` | `-` | Class CSS kustom untuk pemicu (trigger container). |
|
|
54
|
+
| `triggerStyle?` | `UiProps` | `-` | Style kustom untuk pemicu (UiProps). |
|
|
55
|
+
| `contentClass?` | `string` | `-` | Class CSS kustom untuk panel popover konten. |
|
|
56
|
+
| `contentStyle?` | `UiProps` | `-` | Style kustom untuk panel popover konten (UiProps). |
|
|
57
|
+
| `arrowClass?` | `string` | `-` | Class CSS kustom untuk elemen panah (arrow). |
|
|
58
|
+
| `arrowStyle?` | `UiProps` | `-` | Style kustom untuk elemen panah (UiProps). |
|
|
59
|
+
| `overlayClass?` | `string` | `-` | Class CSS kustom untuk lapisan latar belakang redup (modal overlay). |
|
|
60
|
+
| `overlayStyle?` | `UiProps` | `-` | Style kustom untuk lapisan latar belakang redup (UiProps). |
|
|
61
|
+
| `onUpdateOpen?` | `(open: boolean) => void` | `-` | Callback event saat status terbuka/tertutup berubah (kompatibel dengan v-model:open pada Vue 3). |
|
|
62
|
+
| `onOpenChange?` | `(open: boolean) => void` | `-` | Callback event saat status terbuka/tertutup berubah (alias standar React). |
|
|
63
|
+
| `onOpen?` | `() => void` | `-` | Callback event saat popover terbuka. |
|
|
64
|
+
| `onClose?` | `() => void` | `-` | Callback event saat popover ditutup. |
|
|
65
|
+
| `onClosePrevent?` | `() => void` | `-` | Callback event saat pengguna mencoba menutup popover tetapi dicegah karena dismissible={false}. |
|
|
66
|
+
| `children?` | `any` | `-` | Elemen pemicu (trigger), tombol, atau komponen anak lainnya. |
|
|
67
|
+
|
|
68
|
+
### Sub-interface: `PopoverContentOptions`
|
|
69
|
+
|
|
70
|
+
| Field | Type | Default | Description |
|
|
71
|
+
| :--- | :--- | :--- | :--- |
|
|
72
|
+
| `side?` | `'top' | 'right' | 'bottom' | 'left'` | `bottom` | Sisi penempatan relatif terhadap elemen pemicu (trigger). |
|
|
73
|
+
| `align?` | `'start' | 'center' | 'end'` | `center` | Penjajaran di sepanjang sumbu sisi yang dipilih. |
|
|
74
|
+
| `sideOffset?` | `number` | `8` | Jarak offset dalam pixel dari elemen pemicu (trigger). |
|
|
75
|
+
| `alignOffset?` | `number` | `0` | Offset dalam pixel di sepanjang sumbu penjajaran (alignment axis). |
|
|
76
|
+
| `avoidCollisions?` | `boolean` | `true` | Mencegah popover terpotong keluar dari batas viewport layar dengan memanfaatkan middleware flip dan shift. |
|
|
77
|
+
| `collisionBoundary?` | `any` | `-` | Batas kontainer pendeteksi benturan viewport. |
|
|
78
|
+
| `collisionPadding?` | `number` | `8` | Jarak padding minimal dalam pixel dari tepi layar saat terjadi benturan. |
|
|
79
|
+
| `arrowPadding?` | `number` | `8` | Jarak padding minimal dalam pixel untuk elemen panah (arrow) dari sudut popover. |
|
|
80
|
+
| `sticky?` | `'partial' | 'always'` | `-` | Perilaku popover saat elemen pemicu tergulung keluar layar ('partial' | 'always'). |
|
|
81
|
+
| `hideWhenDetached?` | `boolean` | `false` | Sembunyikan popover ketika pemicu terpisah atau tidak terlihat di viewport. |
|
|
82
|
+
|
|
83
|
+
## 4. Usage Examples
|
|
84
|
+
|
|
85
|
+
### React Example
|
|
86
|
+
```tsx
|
|
87
|
+
import { useState } from "react";
|
|
88
|
+
import Popover from "@ttdk-design-system/library-react/web/popover";
|
|
89
|
+
import Button from "@ttdk-design-system/library-react/button";
|
|
90
|
+
import "@ttdk-design-system/library-react/web/popover/popover.css";
|
|
91
|
+
import "@ttdk-design-system/library-react/button/button.css";
|
|
92
|
+
|
|
93
|
+
export function Example() {
|
|
94
|
+
const [open, setOpen] = useState(false);
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<Popover
|
|
98
|
+
open={open}
|
|
99
|
+
onOpenChange={setOpen}
|
|
100
|
+
arrow={true}
|
|
101
|
+
content={{ side: "bottom", align: "center", sideOffset: 8 }}
|
|
102
|
+
panel={
|
|
103
|
+
<div style={{ padding: "8px", maxWidth: "260px" }}>
|
|
104
|
+
<h4 style={{ margin: "0 0 6px 0", fontSize: "14px", fontWeight: 600 }}>Informasi Pasien</h4>
|
|
105
|
+
<p style={{ margin: 0, fontSize: "13px", color: "#6b7280" }}>
|
|
106
|
+
Data rekam medis terhubung langsung ke SATUSEHAT HL7 FHIR.
|
|
107
|
+
</p>
|
|
108
|
+
</div>
|
|
109
|
+
}
|
|
110
|
+
>
|
|
111
|
+
<Button variant="primary">Buka Popover</Button>
|
|
112
|
+
</Popover>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Vue 3 Example
|
|
118
|
+
```vue
|
|
119
|
+
<script setup lang="ts">
|
|
120
|
+
import { ref } from "vue";
|
|
121
|
+
import Popover from "@ttdk-design-system/library-vue/web/popover";
|
|
122
|
+
import Button from "@ttdk-design-system/library-vue/button";
|
|
123
|
+
import "@ttdk-design-system/library-vue/web/popover/popover.css";
|
|
124
|
+
import "@ttdk-design-system/library-vue/button/button.css";
|
|
125
|
+
|
|
126
|
+
const isOpen = ref(false);
|
|
127
|
+
</script>
|
|
128
|
+
|
|
129
|
+
<template>
|
|
130
|
+
<Popover v-model:open="isOpen" arrow :content="{ side: 'bottom', align: 'center', sideOffset: 8 }">
|
|
131
|
+
<Button variant="primary">Buka Popover</Button>
|
|
132
|
+
<template #content="{ close }">
|
|
133
|
+
<div style="padding: 8px; max-width: 260px">
|
|
134
|
+
<h4 style="margin: 0 0 6px 0; font-size: 14px; font-weight: 600">Informasi Pasien</h4>
|
|
135
|
+
<p style="margin: 0 0 12px 0; font-size: 13px; color: #6b7280">
|
|
136
|
+
Data rekam medis terhubung langsung ke SATUSEHAT HL7 FHIR.
|
|
137
|
+
</p>
|
|
138
|
+
<Button size="sm" variant="outline" @click="close">Tutup</Button>
|
|
139
|
+
</div>
|
|
140
|
+
</template>
|
|
141
|
+
</Popover>
|
|
142
|
+
</template>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Svelte Example
|
|
146
|
+
```svelte
|
|
147
|
+
<script lang="ts">
|
|
148
|
+
import Popover from "@ttdk-design-system/library-svelte/web/popover";
|
|
149
|
+
import Button from "@ttdk-design-system/library-svelte/button";
|
|
150
|
+
import "@ttdk-design-system/library-svelte/web/popover/popover.css";
|
|
151
|
+
import "@ttdk-design-system/library-svelte/button/button.css";
|
|
152
|
+
|
|
153
|
+
let isOpen = false;
|
|
154
|
+
</script>
|
|
155
|
+
|
|
156
|
+
<Popover
|
|
157
|
+
open={isOpen}
|
|
158
|
+
arrow={true}
|
|
159
|
+
panel="Data rekam medis terintegrasi HL7 FHIR SATUSEHAT."
|
|
160
|
+
>
|
|
161
|
+
<Button variant="primary">Buka Popover</Button>
|
|
162
|
+
</Popover>
|
|
163
|
+
```
|