zkit-ui 1.0.5 → 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 +28 -14
- 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 +7 -0
- package/dist/ZKitProvider.d.ts.map +1 -0
- package/dist/ZKitProvider.js +17 -0
- package/dist/all.d.ts +59 -0
- package/dist/all.d.ts.map +1 -0
- package/dist/all.js +92 -0
- package/dist/config.d.ts +6 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +15 -15
- package/dist/index.d.ts +4 -48
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -74
- package/dist/services/PermissionPurposeDialogService/index.d.ts +2 -2
- package/dist/services/PermissionPurposeDialogService/index.js +2 -2
- package/dist/services/PickerService/index.d.ts +2 -2
- package/dist/services/PickerService/index.js +2 -2
- package/dist/theme/ThemeProvider.js +1 -1
- package/package.json +164 -2
- package/src/ZKitCoreProvider.tsx +34 -0
- package/src/ZKitProvider.tsx +48 -0
- package/src/all.ts +397 -0
- package/src/config.ts +18 -18
- package/src/index.ts +7 -376
- package/src/services/ActionDialogService/README.md +4 -3
- package/src/services/CardToastService/README.md +3 -3
- package/src/services/ImagePreviewService/README.md +3 -3
- package/src/services/LoadingService/README.md +5 -5
- package/src/services/PermissionPurposeDialogService/README.md +5 -5
- package/src/services/PermissionPurposeDialogService/index.tsx +2 -2
- package/src/services/PickerService/README.md +5 -5
- package/src/services/PickerService/index.tsx +2 -2
- package/src/theme/ThemeProvider.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/dist/ComponentLibProvider.d.ts +0 -15
- package/dist/ComponentLibProvider.d.ts.map +0 -1
- package/dist/ComponentLibProvider.js +0 -18
- package/src/ComponentLibProvider.tsx +0 -56
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';
|
|
244
|
-
|
|
245
|
-
export
|
|
4
|
+
|
|
5
|
+
export { configureZKit } from './config';
|
|
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';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
- `ActionDialog`:声明式组件,支持 `open/defaultOpen/onOpenChange`
|
|
6
6
|
- `actionDialog`:全局命令式服务,适合路由守卫、请求确认、跨组件业务流程
|
|
7
7
|
|
|
8
|
-
`
|
|
8
|
+
`ZKitProvider` 已内置 `ActionDialogProvider`;只有单独使用 `actionDialog` 服务时才需要确认 Provider 已挂载。
|
|
9
9
|
|
|
10
10
|
## 设计取舍
|
|
11
11
|
|
|
@@ -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: '删除确认',
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
全局卡片 Toast 服务,适合保存成功、网络失败、轻量操作反馈这类不应打断用户流程的提示。
|
|
4
4
|
|
|
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={[
|
|
@@ -33,10 +33,10 @@ import { ImagePreview } from 'zkit-ui';
|
|
|
33
33
|
|
|
34
34
|
## 命令式用法
|
|
35
35
|
|
|
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,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# LoadingService
|
|
2
2
|
|
|
3
|
-
全局加载 HUD 服务,用于短时阻塞、Promise 生命周期反馈和轻量结果态。`
|
|
3
|
+
全局加载 HUD 服务,用于短时阻塞、Promise 生命周期反馈和轻量结果态。`ZKitProvider` 已内置 `LoadingProvider`,普通业务入口只需要导入 `loading`。
|
|
4
4
|
|
|
5
5
|
## 设计要点
|
|
6
6
|
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
- `loading.promise()` 绑定异步任务,成功/失败结果只会更新当前仍活跃的 handle
|
|
10
10
|
- `loading` 默认 15s 超时自动关闭,`success/error` 默认短暂停留后关闭
|
|
11
11
|
- Android 不使用 `elevation` 或额外阴影层;iOS/Web 阴影跟随同一动画层,退出完成后卸载,避免残影
|
|
12
|
-
- 默认文案来自 i18n,可通过 `
|
|
12
|
+
- 默认文案来自 i18n,可通过 `ZKitProvider loading` 或 `LoadingProvider defaults` 覆盖
|
|
13
13
|
|
|
14
14
|
## 基础用法
|
|
15
15
|
|
|
16
16
|
```tsx
|
|
17
|
-
import { loading } from 'zkit-ui';
|
|
17
|
+
import { loading } from 'zkit-ui/loading';
|
|
18
18
|
|
|
19
19
|
const handle = loading.show('正在保存');
|
|
20
20
|
|
|
@@ -88,7 +88,7 @@ loading.hide(); // 隐藏当前 HUD
|
|
|
88
88
|
## Provider 配置
|
|
89
89
|
|
|
90
90
|
```tsx
|
|
91
|
-
<
|
|
91
|
+
<ZKitProvider
|
|
92
92
|
loading={{
|
|
93
93
|
loadingTimeout: 20000,
|
|
94
94
|
successDuration: 1000,
|
|
@@ -104,7 +104,7 @@ loading.hide(); // 隐藏当前 HUD
|
|
|
104
104
|
}}
|
|
105
105
|
>
|
|
106
106
|
<App />
|
|
107
|
-
</
|
|
107
|
+
</ZKitProvider>
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
## 关键类型
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
## 前置条件
|
|
6
6
|
|
|
7
|
-
确保应用根组件已包裹 `
|
|
7
|
+
确保应用根组件已包裹 `ZKitProvider`(已内置 `PermissionPurposeDialogProvider`):
|
|
8
8
|
|
|
9
9
|
```tsx
|
|
10
|
-
import {
|
|
10
|
+
import { ZKitProvider } from 'zkit-ui/provider';
|
|
11
11
|
|
|
12
12
|
export default function App() {
|
|
13
13
|
return (
|
|
14
|
-
<
|
|
14
|
+
<ZKitProvider>
|
|
15
15
|
{/* 你的应用内容 */}
|
|
16
|
-
</
|
|
16
|
+
</ZKitProvider>
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
```
|
|
@@ -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' });
|
|
@@ -387,7 +387,7 @@ function PermissionPurposeCard({
|
|
|
387
387
|
|
|
388
388
|
/**
|
|
389
389
|
* 权限用途说明 Provider
|
|
390
|
-
* @description 需要在应用根组件中包裹,已内置于
|
|
390
|
+
* @description 需要在应用根组件中包裹,已内置于 ZKitProvider
|
|
391
391
|
*/
|
|
392
392
|
export function PermissionPurposeDialogProvider({ children }: { children: React.ReactNode }) {
|
|
393
393
|
const [state, setState] = React.useState<PermissionPurposeDialogState>(initialState);
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
## 前置条件
|
|
6
6
|
|
|
7
|
-
确保应用根组件已包裹 `
|
|
7
|
+
确保应用根组件已包裹 `ZKitProvider`(已内置 `PickerServiceProvider`):
|
|
8
8
|
|
|
9
9
|
```tsx
|
|
10
|
-
import {
|
|
10
|
+
import { ZKitProvider } from 'zkit-ui/provider';
|
|
11
11
|
|
|
12
12
|
export default function App() {
|
|
13
13
|
return (
|
|
14
|
-
<
|
|
14
|
+
<ZKitProvider>
|
|
15
15
|
{/* 你的应用内容 */}
|
|
16
|
-
</
|
|
16
|
+
</ZKitProvider>
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
```
|
|
@@ -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' });
|
|
@@ -221,7 +221,7 @@ const initialState: PickerState = {
|
|
|
221
221
|
|
|
222
222
|
/**
|
|
223
223
|
* 选择器服务 Provider
|
|
224
|
-
* @description 需要在应用根组件中包裹,已内置于
|
|
224
|
+
* @description 需要在应用根组件中包裹,已内置于 ZKitProvider
|
|
225
225
|
*/
|
|
226
226
|
export function PickerServiceProvider({ children }: { children: React.ReactNode }) {
|
|
227
227
|
const [state, setState] = React.useState<PickerState>(initialState);
|
|
@@ -30,7 +30,7 @@ export function ThemeProvider({ baseTheme, theme, children }: ThemeProviderProps
|
|
|
30
30
|
const value = React.useMemo(() => {
|
|
31
31
|
// 优先级(低 -> 高):
|
|
32
32
|
// 1) defaultTheme
|
|
33
|
-
// 2)
|
|
33
|
+
// 2) configureZKit({ theme })
|
|
34
34
|
// 3) ThemeProvider({ baseTheme })
|
|
35
35
|
// 4) ThemeProvider({ theme })
|
|
36
36
|
const finalTheme = mergeTheme(baseTheme ?? getDefaultTheme(), theme);
|
|
@@ -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
|
{
|