sard-uniapp 1.11.2 → 1.12.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.
Files changed (194) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +3 -2
  3. package/components/action-sheet/action-sheet.vue +8 -2
  4. package/components/action-sheet/index.scss +1 -1
  5. package/components/back-top/back-top.d.ts +1 -1
  6. package/components/badge/badge.vue +1 -1
  7. package/components/button/button.d.ts +1 -0
  8. package/components/button/button.vue +2 -0
  9. package/components/button/common.d.ts +2 -0
  10. package/components/button/index.scss +6 -1
  11. package/components/calendar/calendar.d.ts +1 -1
  12. package/components/calendar/calendar.vue +49 -22
  13. package/components/calendar/index.scss +5 -5
  14. package/components/calendar/variables.scss +1 -1
  15. package/components/calendar-input/calendar-input.d.ts +1 -1
  16. package/components/calendar-month/index.scss +1 -0
  17. package/components/cascader/cascader.d.ts +6 -6
  18. package/components/cascader/cascader.vue +9 -4
  19. package/components/cascader/common.d.ts +3 -3
  20. package/components/cascader/index.scss +1 -0
  21. package/components/checkbox-input/checkbox-input.vue +59 -32
  22. package/components/checkbox-input/index.scss +4 -0
  23. package/components/config/index.d.ts +23 -0
  24. package/components/config/index.js +47 -18
  25. package/components/crop-image/common.d.ts +32 -0
  26. package/components/crop-image/common.js +2 -0
  27. package/components/crop-image/crop-image.d.ts +19 -0
  28. package/components/crop-image/crop-image.vue +671 -0
  29. package/components/crop-image/index.d.ts +1 -0
  30. package/components/crop-image/index.scss +81 -0
  31. package/components/crop-image-agent/common.d.ts +19 -0
  32. package/components/crop-image-agent/common.js +16 -0
  33. package/components/crop-image-agent/crop-image-agent.d.ts +9 -0
  34. package/components/crop-image-agent/crop-image-agent.vue +70 -0
  35. package/components/crop-image-agent/index.d.ts +1 -0
  36. package/components/crop-image-agent/index.js +1 -0
  37. package/components/datetime-picker-input/datetime-picker-input.vue +4 -4
  38. package/components/datetime-range-picker/datetime-range-picker.vue +4 -3
  39. package/components/datetime-range-picker-input/datetime-range-picker-input.vue +4 -4
  40. package/components/dialog/common.d.ts +2 -3
  41. package/components/dialog/dialog.d.ts +6 -13
  42. package/components/dialog/dialog.vue +15 -4
  43. package/components/dialog-agent/dialog-agent.d.ts +1 -1
  44. package/components/dropdown-item/dropdown-item.vue +6 -6
  45. package/components/fab/fab.d.ts +1 -1
  46. package/components/floating-bubble/floating-bubble.vue +14 -19
  47. package/components/form-item/form-item.vue +4 -3
  48. package/components/grid/common.d.ts +4 -0
  49. package/components/grid-item/grid-item.vue +33 -18
  50. package/components/grid-item/index.scss +12 -4
  51. package/components/icon/index.scss +1 -0
  52. package/components/icon/sari.scss +9 -1
  53. package/components/indexes/common.d.ts +3 -5
  54. package/components/indexes/indexes.d.ts +2 -0
  55. package/components/indexes/indexes.vue +45 -109
  56. package/components/indexes-anchor/indexes-anchor.vue +9 -9
  57. package/components/indexes-nav/indexes-nav.vue +26 -22
  58. package/components/input/input.d.ts +4 -4
  59. package/components/loading/index.scss +1 -1
  60. package/components/locale/lang/en-US.d.ts +9 -0
  61. package/components/locale/lang/en-US.js +9 -0
  62. package/components/locale/lang/zh-CN.d.ts +9 -0
  63. package/components/locale/lang/zh-CN.js +9 -0
  64. package/components/navbar/common.d.ts +12 -0
  65. package/components/navbar/index.scss +17 -10
  66. package/components/navbar/navbar.d.ts +5 -1
  67. package/components/navbar/navbar.vue +45 -15
  68. package/components/navbar/variables.scss +4 -1
  69. package/components/navbar-item/index.scss +10 -0
  70. package/components/navbar-item/navbar-item.vue +27 -4
  71. package/components/navbar-pit/navbar-pit.d.ts +2 -0
  72. package/components/navbar-pit/navbar-pit.vue +22 -0
  73. package/components/notify/common.d.ts +1 -0
  74. package/components/notify/index.scss +12 -7
  75. package/components/notify/notify.vue +9 -3
  76. package/components/notify-agent/notify-agent.vue +9 -11
  77. package/components/pagination/pagination.d.ts +1 -1
  78. package/components/picker-input/picker-input.vue +4 -4
  79. package/components/popout/common.d.ts +2 -3
  80. package/components/popout/popout.d.ts +5 -12
  81. package/components/popout/popout.vue +16 -5
  82. package/components/popover/utils.js +2 -4
  83. package/components/popover-reference/popover-reference.vue +3 -3
  84. package/components/popup/common.d.ts +5 -3
  85. package/components/popup/index.scss +25 -3
  86. package/components/popup/popup.d.ts +1 -1
  87. package/components/pull-down-refresh/pull-down-refresh.d.ts +1 -1
  88. package/components/qrcode/qrcode.d.ts +1 -1
  89. package/components/qrcode/qrcode.vue +4 -7
  90. package/components/radio-input/index.scss +5 -1
  91. package/components/radio-input/radio-input.vue +59 -32
  92. package/components/scroll-spy/common.d.ts +29 -0
  93. package/components/scroll-spy/common.js +1 -0
  94. package/components/scroll-spy/index.d.ts +1 -0
  95. package/components/scroll-spy/index.js +1 -0
  96. package/components/scroll-spy/scroll-spy.d.ts +28 -0
  97. package/components/scroll-spy/scroll-spy.vue +120 -0
  98. package/components/scroll-spy-anchor/common.d.ts +13 -0
  99. package/components/scroll-spy-anchor/index.d.ts +1 -0
  100. package/components/scroll-spy-anchor/index.js +1 -0
  101. package/components/scroll-spy-anchor/scroll-spy-anchor.d.ts +10 -0
  102. package/components/scroll-spy-anchor/scroll-spy-anchor.vue +50 -0
  103. package/components/search/search.vue +2 -0
  104. package/components/share-sheet/share-sheet.vue +3 -2
  105. package/components/sidebar/common.d.ts +28 -0
  106. package/components/sidebar/common.js +1 -0
  107. package/components/sidebar/index.d.ts +1 -0
  108. package/components/sidebar/index.js +1 -0
  109. package/components/sidebar/index.scss +15 -0
  110. package/components/sidebar/sidebar.d.ts +16 -0
  111. package/components/sidebar/sidebar.vue +136 -0
  112. package/components/sidebar/variables.scss +20 -0
  113. package/components/sidebar-item/common.d.ts +16 -0
  114. package/components/sidebar-item/common.js +1 -0
  115. package/components/sidebar-item/index.d.ts +1 -0
  116. package/components/sidebar-item/index.js +1 -0
  117. package/components/sidebar-item/index.scss +70 -0
  118. package/components/sidebar-item/sidebar-item.d.ts +14 -0
  119. package/components/sidebar-item/sidebar-item.vue +111 -0
  120. package/components/signature/common.d.ts +41 -0
  121. package/components/signature/common.js +2 -0
  122. package/components/signature/index.d.ts +1 -0
  123. package/components/signature/index.js +1 -0
  124. package/components/signature/index.scss +109 -0
  125. package/components/signature/signature.d.ts +32 -0
  126. package/components/signature/signature.vue +580 -0
  127. package/components/signature/variables-dark.scss +7 -0
  128. package/components/signature/variables.scss +9 -0
  129. package/components/status-bar/common.d.ts +17 -0
  130. package/components/status-bar/common.js +2 -0
  131. package/components/status-bar/index.d.ts +1 -0
  132. package/components/status-bar/index.js +1 -0
  133. package/components/status-bar/index.scss +7 -0
  134. package/components/status-bar/status-bar.d.ts +12 -0
  135. package/components/status-bar/status-bar.vue +56 -0
  136. package/components/style/mixins/ellipsis.scss +7 -0
  137. package/components/style/mixins/scroll-shadow.scss +40 -0
  138. package/components/style/mixins.scss +1 -0
  139. package/components/style/variables.scss +3 -0
  140. package/components/swiper-dot/swiper-dot.d.ts +1 -1
  141. package/components/tab/tab.vue +4 -3
  142. package/components/tabbar/common.d.ts +1 -0
  143. package/components/tabbar/tabbar.d.ts +2 -0
  144. package/components/tabbar/tabbar.vue +2 -1
  145. package/components/table-cell/index.scss +1 -2
  146. package/components/table-fixation/table-fixation.vue +16 -8
  147. package/components/tree-node/tree-node.vue +3 -3
  148. package/components/upload/upload.vue +3 -2
  149. package/dark.scss +1 -0
  150. package/global.d.ts +9 -0
  151. package/index.d.ts +8 -0
  152. package/index.js +8 -0
  153. package/index.scss +2 -0
  154. package/package.json +28 -24
  155. package/use/index.d.ts +4 -0
  156. package/use/index.js +4 -0
  157. package/use/useDragPinch.d.ts +15 -0
  158. package/use/useDragPinch.js +88 -0
  159. package/use/useImperative.js +1 -0
  160. package/use/useInitialVelocity.d.ts +13 -0
  161. package/use/useInitialVelocity.js +65 -0
  162. package/use/useMouseDown.js +3 -4
  163. package/use/useScrollSide.d.ts +6 -0
  164. package/use/useScrollSide.js +34 -0
  165. package/use/useScrollSpy.d.ts +19 -0
  166. package/use/useScrollSpy.js +99 -0
  167. package/use/useTimeoutLoading.d.ts +6 -0
  168. package/use/useTimeoutLoading.js +53 -0
  169. package/use/useZIndex.js +7 -3
  170. package/utils/bem.d.ts +8 -8
  171. package/utils/dom.d.ts +3 -69
  172. package/utils/dom.js +32 -109
  173. package/utils/file.d.ts +1 -0
  174. package/utils/file.js +14 -0
  175. package/utils/geometry.d.ts +67 -0
  176. package/utils/geometry.js +127 -0
  177. package/utils/index.d.ts +2 -0
  178. package/utils/index.js +2 -0
  179. package/utils/inertialAnimate.d.ts +10 -0
  180. package/utils/inertialAnimate.js +42 -0
  181. package/utils/is.d.ts +8 -0
  182. package/utils/is.js +8 -0
  183. package/utils/system.d.ts +2 -0
  184. package/utils/system.js +6 -3
  185. package/utils/utils.d.ts +7 -0
  186. package/utils/utils.js +13 -0
  187. package/components/_template/_template.d.ts +0 -16
  188. package/components/_template/_template.vue +0 -45
  189. package/components/_template/common.d.ts +0 -14
  190. package/components/_template/index.d.ts +0 -1
  191. package/components/_template/index.scss +0 -17
  192. package/components/_template/variables.scss +0 -5
  193. /package/components/{_template → crop-image}/index.js +0 -0
  194. /package/components/{_template → scroll-spy-anchor}/common.js +0 -0
@@ -1,7 +1,10 @@
1
+ // #defaultConfig
1
2
  export const defaultConfig = {
3
+ // 全局初始 zIndex
4
+ initialZIndex: 1000,
2
5
  actionSheet: {
3
6
  overlayClosable: true,
4
- duration: 300,
7
+ duration: 250,
5
8
  },
6
9
  alert: {
7
10
  type: 'primary',
@@ -23,6 +26,7 @@ export const defaultConfig = {
23
26
  hoverStopPropagation: false,
24
27
  lang: 'en',
25
28
  showMessageCard: false,
29
+ block: true,
26
30
  },
27
31
  calendar: {
28
32
  type: 'single',
@@ -59,6 +63,15 @@ export const defaultConfig = {
59
63
  separatorDigit: 3,
60
64
  duration: 2000,
61
65
  },
66
+ cropImage: {
67
+ duration: 150,
68
+ cropScale: '1:1',
69
+ type: 'png',
70
+ quality: 0.92,
71
+ },
72
+ cropImageAgent: {
73
+ id: 'cropImage',
74
+ },
62
75
  datetimePicker: {
63
76
  type: 'yMd',
64
77
  },
@@ -77,7 +90,7 @@ export const defaultConfig = {
77
90
  showCancel: true,
78
91
  showConfirm: true,
79
92
  overlayClosable: true,
80
- duration: 300,
93
+ duration: 200,
81
94
  },
82
95
  dialogAgent: {
83
96
  id: 'dialog',
@@ -87,7 +100,7 @@ export const defaultConfig = {
87
100
  disabled: false,
88
101
  awayClosable: true,
89
102
  overlayClosable: true,
90
- duration: 300,
103
+ duration: 200,
91
104
  },
92
105
  empty: {
93
106
  icon: 'empty',
@@ -164,14 +177,14 @@ export const defaultConfig = {
164
177
  notify: {
165
178
  type: 'primary',
166
179
  position: 'top',
167
- duration: 300,
180
+ duration: 250,
168
181
  timeout: 3000,
169
182
  },
170
183
  notifyAgent: {
171
184
  id: 'notify',
172
185
  },
173
186
  overlay: {
174
- duration: 300,
187
+ duration: 250,
175
188
  },
176
189
  pagination: {
177
190
  total: 0,
@@ -198,7 +211,7 @@ export const defaultConfig = {
198
211
  showClose: true,
199
212
  showFooter: true,
200
213
  overlayClosable: true,
201
- duration: 300,
214
+ duration: 250,
202
215
  },
203
216
  popover: {
204
217
  position: 'bottom',
@@ -210,7 +223,7 @@ export const defaultConfig = {
210
223
  duration: 150,
211
224
  },
212
225
  popup: {
213
- duration: 300,
226
+ duration: 250,
214
227
  effect: 'fade',
215
228
  overlay: true,
216
229
  },
@@ -244,7 +257,7 @@ export const defaultConfig = {
244
257
  },
245
258
  radioInput: {
246
259
  validateEvent: true,
247
- type: 'record',
260
+ type: 'circle',
248
261
  },
249
262
  rate: {
250
263
  count: 5,
@@ -261,7 +274,16 @@ export const defaultConfig = {
261
274
  },
262
275
  shareSheet: {
263
276
  overlayClosable: true,
264
- duration: 300,
277
+ duration: 250,
278
+ },
279
+ signature: {
280
+ lineWidth: 3,
281
+ fullScreen: false,
282
+ color: '#000',
283
+ duration: 150,
284
+ type: 'png',
285
+ target: 'dataURL',
286
+ quality: 0.92,
265
287
  },
266
288
  skeleton: {
267
289
  rows: 3,
@@ -277,6 +299,9 @@ export const defaultConfig = {
277
299
  direction: 'horizontal',
278
300
  size: 'middle',
279
301
  },
302
+ statusBar: {
303
+ height: '',
304
+ },
280
305
  stepper: {
281
306
  min: Number.MIN_SAFE_INTEGER,
282
307
  max: Number.MAX_SAFE_INTEGER,
@@ -327,7 +352,7 @@ export const defaultConfig = {
327
352
  position: 'center',
328
353
  overlay: false,
329
354
  timeout: 1500,
330
- duration: 300,
355
+ duration: 200,
331
356
  },
332
357
  toastAgent: {
333
358
  id: 'toast',
@@ -352,16 +377,20 @@ export const defaultConfig = {
352
377
  },
353
378
  };
354
379
  function extendProps(source, target) {
355
- for (const name in target) {
356
- const sourceProps = source[name];
357
- const targetProps = target[name];
358
- if (sourceProps) {
359
- for (const prop in targetProps) {
360
- const targetValue = targetProps[prop];
361
- sourceProps[prop] = targetValue;
380
+ Object.keys(target).forEach((key) => {
381
+ if (key in source) {
382
+ const sourceValue = source[key];
383
+ const targetValue = target[key];
384
+ if (targetValue !== undefined && targetValue !== null) {
385
+ if (typeof sourceValue !== 'object') {
386
+ source[key] = targetValue;
387
+ }
388
+ else if (typeof targetValue === 'object') {
389
+ extendProps(sourceValue, targetValue);
390
+ }
362
391
  }
363
392
  }
364
- }
393
+ });
365
394
  }
366
395
  export function setConfig(...optionsArgs) {
367
396
  optionsArgs.forEach((options) => {
@@ -0,0 +1,32 @@
1
+ import { type StyleValue } from 'vue';
2
+ export interface CropImageProps {
3
+ rootStyle?: StyleValue;
4
+ rootClass?: string;
5
+ visible?: boolean;
6
+ src?: string;
7
+ cropScale?: string;
8
+ type?: 'png' | 'jpg';
9
+ quality?: number;
10
+ duration?: number;
11
+ success?: (filePath: string) => void;
12
+ fail?: (err: any) => void;
13
+ complete?: () => void;
14
+ id?: string;
15
+ beforeCrop?: (width: number, height: number) => number;
16
+ cancelText?: string;
17
+ confirmText?: string;
18
+ }
19
+ export declare const defaultCropImageProps: {
20
+ duration: number;
21
+ cropScale: string;
22
+ type: "png";
23
+ quality: number;
24
+ };
25
+ export interface CropImageSlots {
26
+ default?(props: Record<string, never>): any;
27
+ }
28
+ export interface CropImageEmits {
29
+ (e: 'update:visible', visible: boolean): void;
30
+ }
31
+ export interface CropImageExpose {
32
+ }
@@ -0,0 +1,2 @@
1
+ import { defaultConfig } from '../config';
2
+ export const defaultCropImageProps = defaultConfig.cropImage;
@@ -0,0 +1,19 @@
1
+ import { type CropImageProps, type CropImageSlots } from './common';
2
+ declare function __VLS_template(): Readonly<CropImageSlots> & CropImageSlots;
3
+ declare const __VLS_component: import("vue").DefineComponent<CropImageProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
+ "update:visible": (visible: boolean) => any;
5
+ }, string, import("vue").PublicProps, Readonly<CropImageProps> & Readonly<{
6
+ "onUpdate:visible"?: ((visible: boolean) => any) | undefined;
7
+ }>, {
8
+ type: "png" | "jpg";
9
+ duration: number;
10
+ cropScale: string;
11
+ quality: number;
12
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
14
+ export default _default;
15
+ type __VLS_WithTemplateSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };