zkit-ui 1.0.6 → 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/README.md +25 -11
- package/dist/ZKitCoreProvider.d.ts +13 -0
- package/dist/ZKitCoreProvider.d.ts.map +1 -0
- package/dist/ZKitCoreProvider.js +10 -0
- package/dist/ZKitProvider.d.ts +2 -10
- package/dist/ZKitProvider.d.ts.map +1 -1
- package/dist/ZKitProvider.js +4 -5
- package/dist/all.d.ts +59 -0
- package/dist/all.d.ts.map +1 -0
- package/dist/all.js +92 -0
- package/dist/index.d.ts +2 -46
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -73
- package/dist/services/PermissionPurposeDialogService/index.d.ts +1 -1
- package/dist/services/PermissionPurposeDialogService/index.js +1 -1
- package/dist/services/PickerService/index.d.ts +1 -1
- package/dist/services/PickerService/index.js +1 -1
- package/package.json +164 -2
- package/src/ZKitCoreProvider.tsx +34 -0
- package/src/ZKitProvider.tsx +25 -33
- package/src/all.ts +397 -0
- package/src/index.ts +5 -374
- package/src/services/ActionDialogService/README.md +3 -2
- package/src/services/CardToastService/README.md +2 -2
- package/src/services/ImagePreviewService/README.md +2 -2
- package/src/services/LoadingService/README.md +1 -1
- package/src/services/PermissionPurposeDialogService/README.md +2 -2
- package/src/services/PermissionPurposeDialogService/index.tsx +1 -1
- package/src/services/PickerService/README.md +2 -2
- package/src/services/PickerService/index.tsx +1 -1
- package/src/ui/Accordion/README.md +2 -2
- package/src/ui/AddressCascader/README.md +4 -2
- package/src/ui/BetweenTime/README.md +12 -12
- package/src/ui/Button/README.md +7 -7
- package/src/ui/Checkbox/README.md +2 -2
- package/src/ui/DatePicker/README.md +2 -1
- package/src/ui/LinkedScroll/README.md +2 -1
- package/src/ui/Picker/README.md +2 -1
- package/src/ui/Radio/README.md +2 -1
- package/src/ui/Sheet/README.md +3 -1
- package/src/ui/SliderCaptcha/README.md +1 -1
- package/src/ui/Switch/README.md +1 -1
- package/src/ui/Text/README.md +2 -2
- package/src/ui/TextInput/README.md +6 -6
- package/src/ui/WheelColumn/README.md +1 -1
package/src/index.ts
CHANGED
|
@@ -1,248 +1,10 @@
|
|
|
1
|
-
export { Button } from './ui/Button/index';
|
|
2
|
-
export type {
|
|
3
|
-
ButtonBorder,
|
|
4
|
-
ButtonBorderStyle,
|
|
5
|
-
ButtonColors,
|
|
6
|
-
ButtonGradient,
|
|
7
|
-
ButtonGradientDirection,
|
|
8
|
-
ButtonGradientPoint,
|
|
9
|
-
ButtonIconPlacement,
|
|
10
|
-
ButtonLayout,
|
|
11
|
-
ButtonLoadingMode,
|
|
12
|
-
ButtonPressEffect,
|
|
13
|
-
ButtonProps,
|
|
14
|
-
ButtonRef,
|
|
15
|
-
ButtonShape,
|
|
16
|
-
ButtonShadow,
|
|
17
|
-
ButtonShadowConfig,
|
|
18
|
-
ButtonShadowSize,
|
|
19
|
-
ButtonSize,
|
|
20
|
-
ButtonTone,
|
|
21
|
-
ButtonVariant,
|
|
22
|
-
} from './ui/Button/index';
|
|
23
|
-
export { LoadingSpinner } from './ui/LoadingSpinner/index';
|
|
24
|
-
export type { LoadingSpinnerProps } from './ui/LoadingSpinner/index';
|
|
25
|
-
export { Checkbox, CheckboxGroup, CheckboxIndicator } from './ui/Checkbox/index';
|
|
26
|
-
export type {
|
|
27
|
-
CheckboxCheckedState,
|
|
28
|
-
CheckboxColors,
|
|
29
|
-
CheckboxGroupAlign,
|
|
30
|
-
CheckboxGroupOrientation,
|
|
31
|
-
CheckboxGroupProps,
|
|
32
|
-
CheckboxIndicatorProps,
|
|
33
|
-
CheckboxLabelPlacement,
|
|
34
|
-
CheckboxLayout,
|
|
35
|
-
CheckboxProps,
|
|
36
|
-
CheckboxRef,
|
|
37
|
-
CheckboxShape,
|
|
38
|
-
CheckboxSize,
|
|
39
|
-
CheckboxSlotProps,
|
|
40
|
-
CheckboxTone,
|
|
41
|
-
CheckboxValue,
|
|
42
|
-
CheckboxVariant,
|
|
43
|
-
} from './ui/Checkbox/index';
|
|
44
|
-
export { Text } from './ui/Text/index';
|
|
45
|
-
export type {
|
|
46
|
-
TextProps,
|
|
47
|
-
TextRef,
|
|
48
|
-
TextSize,
|
|
49
|
-
TextSizeValue,
|
|
50
|
-
TextTone,
|
|
51
|
-
TextTruncate,
|
|
52
|
-
TextVariant,
|
|
53
|
-
TextWeight,
|
|
54
|
-
} from './ui/Text/index';
|
|
55
|
-
export { TextInput, TextInputPrimitive } from './ui/TextInput/index';
|
|
56
|
-
export type {
|
|
57
|
-
TextInputColors,
|
|
58
|
-
TextInputLayout,
|
|
59
|
-
TextInputPrimitiveProps,
|
|
60
|
-
TextInputPrimitiveRef,
|
|
61
|
-
TextInputProps,
|
|
62
|
-
TextInputRef,
|
|
63
|
-
TextInputSize,
|
|
64
|
-
TextInputStatus,
|
|
65
|
-
TextInputTone,
|
|
66
|
-
TextInputVariant,
|
|
67
|
-
} from './ui/TextInput/index';
|
|
68
|
-
export {
|
|
69
|
-
Sheet,
|
|
70
|
-
SheetContent,
|
|
71
|
-
SheetFooter,
|
|
72
|
-
SheetHeader,
|
|
73
|
-
} from './ui/Sheet/index';
|
|
74
|
-
export type {
|
|
75
|
-
SheetAnimationConfig,
|
|
76
|
-
SheetBackdropConfig,
|
|
77
|
-
SheetCloseCompleteDetails,
|
|
78
|
-
SheetCloseOptions,
|
|
79
|
-
SheetCloseReason,
|
|
80
|
-
SheetContentProps,
|
|
81
|
-
SheetDetent,
|
|
82
|
-
SheetDetentChangePayload,
|
|
83
|
-
SheetFooterProps,
|
|
84
|
-
SheetHandleConfig,
|
|
85
|
-
SheetHeaderProps,
|
|
86
|
-
SheetNativeProps,
|
|
87
|
-
SheetOpenChangeDetails,
|
|
88
|
-
SheetOpenChangeReason,
|
|
89
|
-
SheetOpenCompleteDetails,
|
|
90
|
-
SheetOpenOptions,
|
|
91
|
-
SheetOpenReason,
|
|
92
|
-
SheetPlacement,
|
|
93
|
-
SheetProps,
|
|
94
|
-
SheetRef,
|
|
95
|
-
SheetRenderContext,
|
|
96
|
-
SheetSafeAreaEdges,
|
|
97
|
-
SheetSize,
|
|
98
|
-
SheetState,
|
|
99
|
-
} from './ui/Sheet/index';
|
|
100
|
-
export {
|
|
101
|
-
Accordion,
|
|
102
|
-
AccordionContent,
|
|
103
|
-
AccordionIndicator,
|
|
104
|
-
AccordionItem,
|
|
105
|
-
AccordionTrigger,
|
|
106
|
-
} from './ui/Accordion/index';
|
|
107
|
-
export type {
|
|
108
|
-
AccordionAnimationConfig,
|
|
109
|
-
AccordionContentProps,
|
|
110
|
-
AccordionIndicatorProps,
|
|
111
|
-
AccordionItemState,
|
|
112
|
-
AccordionItemProps,
|
|
113
|
-
AccordionMountStrategy,
|
|
114
|
-
AccordionMultipleProps,
|
|
115
|
-
AccordionPressEffect,
|
|
116
|
-
AccordionProps,
|
|
117
|
-
AccordionSingleProps,
|
|
118
|
-
AccordionSize,
|
|
119
|
-
AccordionSlot,
|
|
120
|
-
AccordionTone,
|
|
121
|
-
AccordionTriggerProps,
|
|
122
|
-
AccordionTriggerRenderState,
|
|
123
|
-
AccordionType,
|
|
124
|
-
AccordionValue,
|
|
125
|
-
AccordionVariant,
|
|
126
|
-
} from './ui/Accordion/index';
|
|
127
|
-
export { BetweenTime } from './ui/BetweenTime/index';
|
|
128
|
-
export type { BetweenTimeProps } from './ui/BetweenTime/index';
|
|
129
|
-
export { Picker } from './ui/Picker/index';
|
|
130
|
-
export type {
|
|
131
|
-
PickerChangePayload,
|
|
132
|
-
PickerColumnHeaderContext,
|
|
133
|
-
PickerConfirmPayload,
|
|
134
|
-
PickerDraftChangePayload,
|
|
135
|
-
PickerHandle,
|
|
136
|
-
PickerOption,
|
|
137
|
-
PickerPrimitiveValue,
|
|
138
|
-
PickerProps,
|
|
139
|
-
PickerSelection,
|
|
140
|
-
PickerTriggerContext,
|
|
141
|
-
PickerValue,
|
|
142
|
-
PickerValueMode,
|
|
143
|
-
} from './ui/Picker/index';
|
|
144
|
-
export {
|
|
145
|
-
WheelColumn,
|
|
146
|
-
WHEEL_AREA_HEIGHT,
|
|
147
|
-
WHEEL_AREA_VERTICAL_INSET,
|
|
148
|
-
WHEEL_ITEM_HEIGHT,
|
|
149
|
-
WHEEL_VIEWPORT_HEIGHT,
|
|
150
|
-
WHEEL_VISIBLE_ITEMS,
|
|
151
|
-
} from './ui/WheelColumn/index';
|
|
152
|
-
export type {
|
|
153
|
-
WheelColumnChangePayload,
|
|
154
|
-
WheelColumnChangeSource,
|
|
155
|
-
WheelColumnHandle,
|
|
156
|
-
WheelColumnOption,
|
|
157
|
-
WheelColumnProps,
|
|
158
|
-
WheelColumnValue,
|
|
159
|
-
WheelOption,
|
|
160
|
-
} from './ui/WheelColumn/index';
|
|
161
|
-
export { AddressCascader } from './ui/AddressCascader/index';
|
|
162
|
-
export type {
|
|
163
|
-
AddressCascaderChangePayload,
|
|
164
|
-
AddressCascaderConfirmPayload,
|
|
165
|
-
AddressCascaderHandle,
|
|
166
|
-
AddressCascaderOption,
|
|
167
|
-
AddressCascaderProps,
|
|
168
|
-
AddressCascaderRenderContext,
|
|
169
|
-
AddressCascaderValue,
|
|
170
|
-
} from './ui/AddressCascader/index';
|
|
171
|
-
export { DatePicker } from './ui/DatePicker/index';
|
|
172
|
-
export type {
|
|
173
|
-
DatePickerChangePayload,
|
|
174
|
-
DatePickerColumn,
|
|
175
|
-
DatePickerColumnHeaderContext,
|
|
176
|
-
DatePickerConfirmPayload,
|
|
177
|
-
DatePickerDisableContext,
|
|
178
|
-
DatePickerDraftChangePayload,
|
|
179
|
-
DatePickerHandle,
|
|
180
|
-
DatePickerInput,
|
|
181
|
-
DatePickerLabelFormat,
|
|
182
|
-
DatePickerOption,
|
|
183
|
-
DatePickerParts,
|
|
184
|
-
DatePickerPrecision,
|
|
185
|
-
DatePickerProps,
|
|
186
|
-
DatePickerRenderContext,
|
|
187
|
-
DatePickerSelection,
|
|
188
|
-
DatePickerValue,
|
|
189
|
-
} from './ui/DatePicker/index';
|
|
190
|
-
export { Switch } from './ui/Switch/index';
|
|
191
|
-
export type {
|
|
192
|
-
SwitchColors,
|
|
193
|
-
SwitchLabelPlacement,
|
|
194
|
-
SwitchLayout,
|
|
195
|
-
SwitchProps,
|
|
196
|
-
SwitchRef,
|
|
197
|
-
SwitchSize,
|
|
198
|
-
SwitchSlotProps,
|
|
199
|
-
SwitchStateText,
|
|
200
|
-
SwitchTone,
|
|
201
|
-
} from './ui/Switch/index';
|
|
202
|
-
export { SliderCaptcha } from './ui/SliderCaptcha/index';
|
|
203
|
-
export type {
|
|
204
|
-
SliderCaptchaChallenge,
|
|
205
|
-
SliderCaptchaErrorInfo,
|
|
206
|
-
SliderCaptchaErrorStage,
|
|
207
|
-
SliderCaptchaLoadReason,
|
|
208
|
-
SliderCaptchaProps,
|
|
209
|
-
SliderCaptchaStatus,
|
|
210
|
-
SliderCaptchaTexts,
|
|
211
|
-
SliderCaptchaVerifyPayload,
|
|
212
|
-
SliderCaptchaVerifyResult,
|
|
213
|
-
} from './ui/SliderCaptcha/index';
|
|
214
|
-
export { Radio, RadioGroup, RadioIndicator } from './ui/Radio/index';
|
|
215
|
-
export type {
|
|
216
|
-
RadioColors,
|
|
217
|
-
RadioGroupAlign,
|
|
218
|
-
RadioGroupOrientation,
|
|
219
|
-
RadioGroupProps,
|
|
220
|
-
RadioIndicatorProps,
|
|
221
|
-
RadioLabelPlacement,
|
|
222
|
-
RadioLayout,
|
|
223
|
-
RadioProps,
|
|
224
|
-
RadioRef,
|
|
225
|
-
RadioSize,
|
|
226
|
-
RadioSlotProps,
|
|
227
|
-
RadioTone,
|
|
228
|
-
RadioValue,
|
|
229
|
-
RadioVariant,
|
|
230
|
-
} from './ui/Radio/index';
|
|
231
|
-
export { LinkedScroll } from './ui/LinkedScroll/index';
|
|
232
|
-
export type {
|
|
233
|
-
LinkedScrollChangeMeta,
|
|
234
|
-
LinkedScrollChangeSource,
|
|
235
|
-
LinkedScrollItem,
|
|
236
|
-
LinkedScrollMenuItemRenderContext,
|
|
237
|
-
LinkedScrollProps,
|
|
238
|
-
LinkedScrollSectionRenderContext,
|
|
239
|
-
LinkedScrollValue,
|
|
240
|
-
} from './ui/LinkedScroll/index';
|
|
241
1
|
export { ThemeProvider } from './theme/ThemeProvider';
|
|
242
2
|
export { useTheme } from './theme/useTheme';
|
|
243
3
|
export type { Theme, ThemeOverride } from './theme/types';
|
|
4
|
+
|
|
244
5
|
export { configureZKit } from './config';
|
|
245
6
|
export type { ZKitConfig, ZKitI18nConfig } from './config';
|
|
7
|
+
|
|
246
8
|
export {
|
|
247
9
|
BUILTIN_I18N_LOCALES,
|
|
248
10
|
DEFAULT_I18N_LOCALE,
|
|
@@ -259,137 +21,6 @@ export type {
|
|
|
259
21
|
I18nTranslate,
|
|
260
22
|
I18nTranslateParams,
|
|
261
23
|
} from './i18n/types';
|
|
262
|
-
|
|
263
|
-
export
|
|
264
|
-
export {
|
|
265
|
-
export type {
|
|
266
|
-
AddressPickerResult,
|
|
267
|
-
BetweenTimePickerResult,
|
|
268
|
-
DatePickerResult,
|
|
269
|
-
PickOptions,
|
|
270
|
-
PickDateOptions,
|
|
271
|
-
PickAddressOptions,
|
|
272
|
-
PickBetweenTimeOptions,
|
|
273
|
-
PickerResult,
|
|
274
|
-
} from './services/PickerService/index';
|
|
275
|
-
export { toast, ToastProvider } from './services/CardToastService/index';
|
|
276
|
-
export type {
|
|
277
|
-
ToastAction,
|
|
278
|
-
ToastActionContext,
|
|
279
|
-
ToastCustomOptions,
|
|
280
|
-
ToastDefaults,
|
|
281
|
-
ToastDismissReason,
|
|
282
|
-
ToastHandle,
|
|
283
|
-
ToastIconRenderContext,
|
|
284
|
-
ToastItem,
|
|
285
|
-
ToastOpenChangeMeta,
|
|
286
|
-
ToastOpenChangeReason,
|
|
287
|
-
ToastOptions,
|
|
288
|
-
ToastPlacement,
|
|
289
|
-
ToastProviderProps,
|
|
290
|
-
ToastRenderContext,
|
|
291
|
-
ToastService,
|
|
292
|
-
ToastShortcutOptions,
|
|
293
|
-
ToastStrategy,
|
|
294
|
-
ToastTone,
|
|
295
|
-
ToastUpdateOptions,
|
|
296
|
-
} from './services/CardToastService/index';
|
|
297
|
-
export { ActionDialog, actionDialog, ActionDialogProvider } from './services/ActionDialogService/index';
|
|
298
|
-
export type {
|
|
299
|
-
ActionDialogAction,
|
|
300
|
-
ActionDialogActionContext,
|
|
301
|
-
ActionDialogActionPressResult,
|
|
302
|
-
ActionDialogActionResult,
|
|
303
|
-
ActionDialogActionRole,
|
|
304
|
-
ActionDialogActionTone,
|
|
305
|
-
ActionDialogActionVariant,
|
|
306
|
-
ActionDialogAlertOptions,
|
|
307
|
-
ActionDialogCollisionStrategy,
|
|
308
|
-
ActionDialogColors,
|
|
309
|
-
ActionDialogConfirmOptions,
|
|
310
|
-
ActionDialogDismissOptions,
|
|
311
|
-
ActionDialogDismissReason,
|
|
312
|
-
ActionDialogDismissResult,
|
|
313
|
-
ActionDialogFooterLayout,
|
|
314
|
-
ActionDialogFooterOptions,
|
|
315
|
-
ActionDialogFooterRenderContext,
|
|
316
|
-
ActionDialogHandle,
|
|
317
|
-
ActionDialogHostMode,
|
|
318
|
-
ActionDialogKeyboardOptions,
|
|
319
|
-
ActionDialogLabels,
|
|
320
|
-
ActionDialogLayerOptions,
|
|
321
|
-
ActionDialogLayoutOptions,
|
|
322
|
-
ActionDialogMotion,
|
|
323
|
-
ActionDialogOpenChangeMeta,
|
|
324
|
-
ActionDialogOpenChangeReason,
|
|
325
|
-
ActionDialogOpenOptions,
|
|
326
|
-
ActionDialogProps,
|
|
327
|
-
ActionDialogRef,
|
|
328
|
-
ActionDialogResolvedAction,
|
|
329
|
-
ActionDialogResolvedFooterLayout,
|
|
330
|
-
ActionDialogResult,
|
|
331
|
-
ActionDialogSemanticActionOptions,
|
|
332
|
-
ActionDialogService,
|
|
333
|
-
ActionDialogSnapshot,
|
|
334
|
-
} from './services/ActionDialogService/index';
|
|
335
|
-
export { loading, LoadingProvider } from './services/LoadingService/index';
|
|
336
|
-
export type {
|
|
337
|
-
LoadingColors,
|
|
338
|
-
LoadingDefaults,
|
|
339
|
-
LoadingDismissReason,
|
|
340
|
-
LoadingHandle,
|
|
341
|
-
LoadingIconRenderContext,
|
|
342
|
-
LoadingInput,
|
|
343
|
-
LoadingItem,
|
|
344
|
-
LoadingLabels,
|
|
345
|
-
LoadingLiveRegion,
|
|
346
|
-
LoadingOpenChangeMeta,
|
|
347
|
-
LoadingOpenChangeReason,
|
|
348
|
-
LoadingPromiseErrorInput,
|
|
349
|
-
LoadingPromiseOptions,
|
|
350
|
-
LoadingPromiseResultInput,
|
|
351
|
-
LoadingProviderProps,
|
|
352
|
-
LoadingRenderContext,
|
|
353
|
-
LoadingResolvedDefaults,
|
|
354
|
-
LoadingResultInput,
|
|
355
|
-
LoadingResultOptions,
|
|
356
|
-
LoadingService,
|
|
357
|
-
LoadingShowOptions,
|
|
358
|
-
LoadingSnapshot,
|
|
359
|
-
LoadingStatus,
|
|
360
|
-
LoadingUpdateOptions,
|
|
361
|
-
} from './services/LoadingService/index';
|
|
362
|
-
export {
|
|
363
|
-
permissionPurposeDialog,
|
|
364
|
-
PermissionPurposeDialogProvider,
|
|
365
|
-
} from './services/PermissionPurposeDialogService/index';
|
|
366
|
-
export type {
|
|
367
|
-
PermissionPurpose,
|
|
368
|
-
PermissionPurposeDialogHandle,
|
|
369
|
-
PermissionPurposeDialogOptions,
|
|
370
|
-
} from './services/PermissionPurposeDialogService/index';
|
|
371
|
-
export { imagePreview, ImagePreview, ImagePreviewProvider } from './services/ImagePreviewService/index';
|
|
372
|
-
export type {
|
|
373
|
-
ImagePreviewChangeMeta,
|
|
374
|
-
ImagePreviewChangeReason,
|
|
375
|
-
ImagePreviewCloseReason,
|
|
376
|
-
ImagePreviewColors,
|
|
377
|
-
ImagePreviewImage,
|
|
378
|
-
ImagePreviewImageDescriptor,
|
|
379
|
-
ImagePreviewImageProps,
|
|
380
|
-
ImagePreviewInteractions,
|
|
381
|
-
ImagePreviewLabels,
|
|
382
|
-
ImagePreviewOpenChangeMeta,
|
|
383
|
-
ImagePreviewOpenChangeReason,
|
|
384
|
-
ImagePreviewOpenOptions,
|
|
385
|
-
ImagePreviewPrefetchCachePolicy,
|
|
386
|
-
ImagePreviewProps,
|
|
387
|
-
ImagePreviewRef,
|
|
388
|
-
ImagePreviewRenderContext,
|
|
389
|
-
ImagePreviewResolvedImage,
|
|
390
|
-
ImagePreviewResult,
|
|
391
|
-
ImagePreviewServiceHandle,
|
|
392
|
-
ImagePreviewServiceSnapshot,
|
|
393
|
-
ImagePreviewSource,
|
|
394
|
-
ImagePreviewTapBehavior,
|
|
395
|
-
} from './services/ImagePreviewService/index';
|
|
24
|
+
|
|
25
|
+
export { ZKitCoreProvider } from './ZKitCoreProvider';
|
|
26
|
+
export type { ZKitCoreProviderProps } from './ZKitCoreProvider';
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
## 声明式使用
|
|
23
23
|
|
|
24
24
|
```tsx
|
|
25
|
-
import { ActionDialog } from 'zkit-ui';
|
|
25
|
+
import { ActionDialog } from 'zkit-ui/action-dialog';
|
|
26
26
|
|
|
27
27
|
<ActionDialog
|
|
28
28
|
open={open}
|
|
@@ -39,7 +39,8 @@ import { ActionDialog } from 'zkit-ui';
|
|
|
39
39
|
## 命令式确认
|
|
40
40
|
|
|
41
41
|
```tsx
|
|
42
|
-
import { actionDialog
|
|
42
|
+
import { actionDialog } from 'zkit-ui/action-dialog';
|
|
43
|
+
import { loading } from 'zkit-ui/loading';
|
|
43
44
|
|
|
44
45
|
const confirmed = await actionDialog.confirm({
|
|
45
46
|
title: '删除确认',
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
`ZKitProvider` 已内置 `ToastProvider`。如果单独接入,需要把 `ToastProvider` 放在应用根部。
|
|
6
6
|
|
|
7
7
|
```tsx
|
|
8
|
-
import { ToastProvider } from 'zkit-ui';
|
|
8
|
+
import { ToastProvider } from 'zkit-ui/toast';
|
|
9
9
|
|
|
10
10
|
export function App() {
|
|
11
11
|
return <ToastProvider>{/* app */}</ToastProvider>;
|
|
@@ -24,7 +24,7 @@ export function App() {
|
|
|
24
24
|
## 使用方式
|
|
25
25
|
|
|
26
26
|
```ts
|
|
27
|
-
import { toast } from 'zkit-ui';
|
|
27
|
+
import { toast } from 'zkit-ui/toast';
|
|
28
28
|
|
|
29
29
|
toast.success('保存成功');
|
|
30
30
|
toast.error('网络错误', {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
## 声明式用法
|
|
18
18
|
|
|
19
19
|
```tsx
|
|
20
|
-
import { ImagePreview } from 'zkit-ui';
|
|
20
|
+
import { ImagePreview } from 'zkit-ui/image-preview';
|
|
21
21
|
|
|
22
22
|
<ImagePreview
|
|
23
23
|
images={[
|
|
@@ -36,7 +36,7 @@ import { ImagePreview } from 'zkit-ui';
|
|
|
36
36
|
`ZKitProvider` 已内置 `ImagePreviewProvider`。如果没有使用统一 Provider,需要在应用根部单独挂载。
|
|
37
37
|
|
|
38
38
|
```tsx
|
|
39
|
-
import { imagePreview } from 'zkit-ui';
|
|
39
|
+
import { imagePreview } from 'zkit-ui/image-preview';
|
|
40
40
|
|
|
41
41
|
const handle = imagePreview.open({
|
|
42
42
|
images,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
确保应用根组件已包裹 `ZKitProvider`(已内置 `PermissionPurposeDialogProvider`):
|
|
8
8
|
|
|
9
9
|
```tsx
|
|
10
|
-
import { ZKitProvider } from 'zkit-ui';
|
|
10
|
+
import { ZKitProvider } from 'zkit-ui/provider';
|
|
11
11
|
|
|
12
12
|
export default function App() {
|
|
13
13
|
return (
|
|
@@ -21,7 +21,7 @@ export default function App() {
|
|
|
21
21
|
## 使用方式
|
|
22
22
|
|
|
23
23
|
```tsx
|
|
24
|
-
import { permissionPurposeDialog } from 'zkit-ui';
|
|
24
|
+
import { permissionPurposeDialog } from 'zkit-ui/permission-purpose-dialog';
|
|
25
25
|
|
|
26
26
|
// 展示说明(与系统权限框同时出现)
|
|
27
27
|
const purpose = permissionPurposeDialog.show({
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* 支持按权限自动填充默认文案,也支持完全自定义。
|
|
6
6
|
* @example
|
|
7
7
|
* ```tsx
|
|
8
|
-
* import { permissionPurposeDialog } from 'zkit-ui';
|
|
8
|
+
* import { permissionPurposeDialog } from 'zkit-ui/permission-purpose-dialog';
|
|
9
9
|
*
|
|
10
10
|
* // 展示说明
|
|
11
11
|
* const purpose = permissionPurposeDialog.show({ permission: 'location' });
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
确保应用根组件已包裹 `ZKitProvider`(已内置 `PickerServiceProvider`):
|
|
8
8
|
|
|
9
9
|
```tsx
|
|
10
|
-
import { ZKitProvider } from 'zkit-ui';
|
|
10
|
+
import { ZKitProvider } from 'zkit-ui/provider';
|
|
11
11
|
|
|
12
12
|
export default function App() {
|
|
13
13
|
return (
|
|
@@ -21,7 +21,7 @@ export default function App() {
|
|
|
21
21
|
## 使用方式
|
|
22
22
|
|
|
23
23
|
```tsx
|
|
24
|
-
import { pickerService } from 'zkit-ui';
|
|
24
|
+
import { pickerService } from 'zkit-ui/picker-service';
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
### 通用选择器
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @description 提供 pick、pickDate、pickAddress、pickBetweenTime 等方法
|
|
4
4
|
* @example
|
|
5
5
|
* ```tsx
|
|
6
|
-
* import { pickerService } from 'zkit-ui';
|
|
6
|
+
* import { pickerService } from 'zkit-ui/picker-service';
|
|
7
7
|
*
|
|
8
8
|
* const result = await pickerService.pick({ options: [...], value: 'id' });
|
|
9
9
|
* const date = await pickerService.pickDate({ value: '2024-01-01' });
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
```tsx
|
|
8
8
|
import * as React from 'react';
|
|
9
|
+
import { Text } from 'zkit-ui/text';
|
|
9
10
|
import {
|
|
10
11
|
Accordion,
|
|
11
12
|
AccordionContent,
|
|
12
13
|
AccordionItem,
|
|
13
14
|
AccordionTrigger,
|
|
14
|
-
|
|
15
|
-
} from 'zkit-ui';
|
|
15
|
+
} from 'zkit-ui/accordion';
|
|
16
16
|
|
|
17
17
|
export function DemoAccordion() {
|
|
18
18
|
const [value, setValue] = React.useState<string | null>('profile');
|
|
@@ -9,7 +9,8 @@ AddressCascader 是一个省/市/区(县)三级联动选择组件。
|
|
|
9
9
|
## 基础用法
|
|
10
10
|
|
|
11
11
|
```tsx
|
|
12
|
-
import { AddressCascader
|
|
12
|
+
import { AddressCascader } from 'zkit-ui/address-cascader';
|
|
13
|
+
import { Button } from 'zkit-ui/button';
|
|
13
14
|
|
|
14
15
|
export function Demo() {
|
|
15
16
|
const [value, setValue] = React.useState(['110000', '110100', '110101']);
|
|
@@ -28,7 +29,8 @@ export function Demo() {
|
|
|
28
29
|
`list` 的数据结构沿用 Picker 的树结构:每个节点包含 `value/text/children`。
|
|
29
30
|
|
|
30
31
|
```tsx
|
|
31
|
-
import { AddressCascader
|
|
32
|
+
import { AddressCascader } from 'zkit-ui/address-cascader';
|
|
33
|
+
import { Button } from 'zkit-ui/button';
|
|
32
34
|
|
|
33
35
|
const list = [
|
|
34
36
|
{
|
|
@@ -11,7 +11,7 @@ BetweenTime 是一个高性能的时间区间选择器组件:
|
|
|
11
11
|
## 基础用法
|
|
12
12
|
|
|
13
13
|
```tsx
|
|
14
|
-
import { BetweenTime } from 'zkit-ui';
|
|
14
|
+
import { BetweenTime } from 'zkit-ui/between-time';
|
|
15
15
|
import { Text } from 'react-native';
|
|
16
16
|
|
|
17
17
|
export function Demo() {
|
|
@@ -31,7 +31,7 @@ export function Demo() {
|
|
|
31
31
|
## 精度控制:type
|
|
32
32
|
|
|
33
33
|
```tsx
|
|
34
|
-
import { BetweenTime } from 'zkit-ui';
|
|
34
|
+
import { BetweenTime } from 'zkit-ui/between-time';
|
|
35
35
|
|
|
36
36
|
export function Demo() {
|
|
37
37
|
return (
|
|
@@ -83,7 +83,7 @@ export function Demo() {
|
|
|
83
83
|
## 时间范围限制:start / end
|
|
84
84
|
|
|
85
85
|
```tsx
|
|
86
|
-
import { BetweenTime } from 'zkit-ui';
|
|
86
|
+
import { BetweenTime } from 'zkit-ui/between-time';
|
|
87
87
|
|
|
88
88
|
export function Demo() {
|
|
89
89
|
return (
|
|
@@ -106,7 +106,7 @@ export function Demo() {
|
|
|
106
106
|
## 快捷选择:quickDate
|
|
107
107
|
|
|
108
108
|
```tsx
|
|
109
|
-
import { BetweenTime } from 'zkit-ui';
|
|
109
|
+
import { BetweenTime } from 'zkit-ui/between-time';
|
|
110
110
|
|
|
111
111
|
export function Demo() {
|
|
112
112
|
return (
|
|
@@ -131,7 +131,7 @@ export function Demo() {
|
|
|
131
131
|
## 自定义格式:format
|
|
132
132
|
|
|
133
133
|
```tsx
|
|
134
|
-
import { BetweenTime } from 'zkit-ui';
|
|
134
|
+
import { BetweenTime } from 'zkit-ui/between-time';
|
|
135
135
|
|
|
136
136
|
export function Demo() {
|
|
137
137
|
return (
|
|
@@ -163,7 +163,7 @@ export function Demo() {
|
|
|
163
163
|
## 受控模式
|
|
164
164
|
|
|
165
165
|
```tsx
|
|
166
|
-
import { BetweenTime } from 'zkit-ui';
|
|
166
|
+
import { BetweenTime } from 'zkit-ui/between-time';
|
|
167
167
|
|
|
168
168
|
export function Demo() {
|
|
169
169
|
const [value, setValue] = React.useState<string[]>(['2024-01-01', '2024-12-31']);
|
|
@@ -192,7 +192,7 @@ export function Demo() {
|
|
|
192
192
|
## 非受控模式
|
|
193
193
|
|
|
194
194
|
```tsx
|
|
195
|
-
import { BetweenTime } from 'zkit-ui';
|
|
195
|
+
import { BetweenTime } from 'zkit-ui/between-time';
|
|
196
196
|
|
|
197
197
|
export function Demo() {
|
|
198
198
|
return (
|
|
@@ -209,7 +209,7 @@ export function Demo() {
|
|
|
209
209
|
## 懒加载:lazyContent
|
|
210
210
|
|
|
211
211
|
```tsx
|
|
212
|
-
import { BetweenTime } from 'zkit-ui';
|
|
212
|
+
import { BetweenTime } from 'zkit-ui/between-time';
|
|
213
213
|
|
|
214
214
|
export function Demo() {
|
|
215
215
|
return (
|
|
@@ -230,7 +230,7 @@ export function Demo() {
|
|
|
230
230
|
## 自定义弹窗高度:drawerSize
|
|
231
231
|
|
|
232
232
|
```tsx
|
|
233
|
-
import { BetweenTime } from 'zkit-ui';
|
|
233
|
+
import { BetweenTime } from 'zkit-ui/between-time';
|
|
234
234
|
import { wp } from 'zkit-tools';
|
|
235
235
|
|
|
236
236
|
export function Demo() {
|
|
@@ -245,7 +245,7 @@ export function Demo() {
|
|
|
245
245
|
## 自定义单位名称:cellUnits
|
|
246
246
|
|
|
247
247
|
```tsx
|
|
248
|
-
import { BetweenTime } from 'zkit-ui';
|
|
248
|
+
import { BetweenTime } from 'zkit-ui/between-time';
|
|
249
249
|
|
|
250
250
|
export function Demo() {
|
|
251
251
|
return (
|
|
@@ -267,7 +267,7 @@ export function Demo() {
|
|
|
267
267
|
## 禁用状态:disabled
|
|
268
268
|
|
|
269
269
|
```tsx
|
|
270
|
-
import { BetweenTime } from 'zkit-ui';
|
|
270
|
+
import { BetweenTime } from 'zkit-ui/between-time';
|
|
271
271
|
|
|
272
272
|
export function Demo() {
|
|
273
273
|
return (
|
|
@@ -281,7 +281,7 @@ export function Demo() {
|
|
|
281
281
|
## 格式同步到值:formatSyncValue
|
|
282
282
|
|
|
283
283
|
```tsx
|
|
284
|
-
import { BetweenTime } from 'zkit-ui';
|
|
284
|
+
import { BetweenTime } from 'zkit-ui/between-time';
|
|
285
285
|
|
|
286
286
|
export function Demo() {
|
|
287
287
|
const [value, setValue] = React.useState<string[]>([]);
|