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
@@ -0,0 +1,67 @@
1
+ export type ScrollIntoViewPosition = 'start' | 'center' | 'end' | 'nearest';
2
+ export interface ScrollIntoViewValueOptions {
3
+ position?: ScrollIntoViewPosition;
4
+ startOffset?: number;
5
+ endOffset?: number;
6
+ }
7
+ export interface ScrollIntoViewOptions {
8
+ position?: ScrollIntoViewPosition;
9
+ startOffset?: number;
10
+ endOffset?: number;
11
+ duration?: number;
12
+ }
13
+ /**
14
+ ```
15
+ page
16
+
17
+ ╭───────────────╮ viewport
18
+ ╭─│─ ─ ─ ─ ─ ─ ─ ─│─╮ ╱
19
+ │ │ ╭───────────╮ │ │
20
+ │ │ │ element │ │ │
21
+ │ │ ╰───────────╯ │ │
22
+ ╰─│─ ─ ─ ─ ─ ─ ─ ─│─╯
23
+ │ │
24
+ │ │
25
+ ╰───────────────╯
26
+ ```
27
+
28
+ # 参数
29
+ - viewportHeight: viewport 高度
30
+ - viewportScrollTop: viewport 垂直滚动值
31
+ - elementHeight: element 高度
32
+ - elementOffsetTop: element 距离页面顶部距离
33
+
34
+ # 选项
35
+ - position: element 在视窗中的位置(start, center, end, nearest)
36
+ - startOffset: element 距离视窗顶部的偏移量
37
+ - endOffset: element 距离视窗底部的偏移量
38
+
39
+ # 结果值
40
+ - viewportScrollTop: viewport 新的垂直滚动值
41
+
42
+ */
43
+ export declare function getScrollIntoViewValue(viewportHeight: number, viewportScrollTop: number, elementHeight: number, elementOffsetTop: number, options?: ScrollIntoViewValueOptions): number;
44
+ export interface NodeRect {
45
+ top: number;
46
+ right: number;
47
+ bottom: number;
48
+ left: number;
49
+ height: number;
50
+ width: number;
51
+ }
52
+ interface MatchScrollVisibleOptions {
53
+ offset?: number;
54
+ errorValue?: number;
55
+ }
56
+ /**
57
+ * @description: 匹配元素列表中第一个位于滚动盒子可视区域的元素
58
+ */
59
+ export declare function matchScrollVisible(rects: NodeRect[], callback: (index: number) => unknown, options?: MatchScrollVisibleOptions): Promise<unknown>;
60
+ export declare function getAspectFillSize(origWidth: number, origHeight: number, containerWidth: number, containerHeight: number): [number, number];
61
+ export declare function getAspectFitSize(origWidth: number, origHeight: number, containerWidth: number, containerHeight: number): [number, number];
62
+ interface Point {
63
+ x: number;
64
+ y: number;
65
+ }
66
+ export declare function getTwoPointsDistance(p1: Point, p2: Point): number;
67
+ export {};
@@ -0,0 +1,127 @@
1
+ /**
2
+ ```
3
+ page
4
+
5
+ ╭───────────────╮ viewport
6
+ ╭─│─ ─ ─ ─ ─ ─ ─ ─│─╮ ╱
7
+ │ │ ╭───────────╮ │ │
8
+ │ │ │ element │ │ │
9
+ │ │ ╰───────────╯ │ │
10
+ ╰─│─ ─ ─ ─ ─ ─ ─ ─│─╯
11
+ │ │
12
+ │ │
13
+ ╰───────────────╯
14
+ ```
15
+
16
+ # 参数
17
+ - viewportHeight: viewport 高度
18
+ - viewportScrollTop: viewport 垂直滚动值
19
+ - elementHeight: element 高度
20
+ - elementOffsetTop: element 距离页面顶部距离
21
+
22
+ # 选项
23
+ - position: element 在视窗中的位置(start, center, end, nearest)
24
+ - startOffset: element 距离视窗顶部的偏移量
25
+ - endOffset: element 距离视窗底部的偏移量
26
+
27
+ # 结果值
28
+ - viewportScrollTop: viewport 新的垂直滚动值
29
+
30
+ */
31
+ export function getScrollIntoViewValue(viewportHeight, viewportScrollTop, elementHeight, elementOffsetTop, options = {}) {
32
+ const { startOffset = 0, endOffset = 0 } = options;
33
+ let position = options.position || 'nearest';
34
+ const elementToViewportTopOffset = elementOffsetTop - viewportScrollTop - startOffset;
35
+ const elementToViewportBottomOffset = elementOffsetTop +
36
+ elementHeight -
37
+ viewportScrollTop -
38
+ viewportHeight +
39
+ endOffset;
40
+ if (position === 'nearest') {
41
+ if (elementToViewportTopOffset >= 0 && elementToViewportBottomOffset <= 0) {
42
+ return viewportScrollTop;
43
+ }
44
+ else {
45
+ position =
46
+ Math.abs(elementToViewportTopOffset) >
47
+ Math.abs(elementToViewportBottomOffset)
48
+ ? 'end'
49
+ : 'start';
50
+ }
51
+ }
52
+ let nextScrollTop = 0;
53
+ switch (position) {
54
+ case 'start':
55
+ nextScrollTop = elementOffsetTop - startOffset;
56
+ break;
57
+ case 'center':
58
+ nextScrollTop =
59
+ elementOffsetTop -
60
+ (viewportHeight - elementHeight - endOffset - startOffset) / 2 +
61
+ startOffset;
62
+ break;
63
+ case 'end':
64
+ nextScrollTop =
65
+ elementOffsetTop + elementHeight - viewportHeight + endOffset;
66
+ break;
67
+ }
68
+ return nextScrollTop;
69
+ }
70
+ /**
71
+ * @description: 匹配元素列表中第一个位于滚动盒子可视区域的元素
72
+ */
73
+ export async function matchScrollVisible(rects, callback, options = {}) {
74
+ const { offset: optionOffset = 0, errorValue = 3 } = options;
75
+ const offset = optionOffset + errorValue;
76
+ const convertedRect = rects.map((rect, i) => {
77
+ return {
78
+ top: rect.top,
79
+ bottom: i < rects.length - 1 ? rects[i + 1].top : 0,
80
+ };
81
+ });
82
+ for (let i = 0, l = convertedRect.length; i < l; i++) {
83
+ const rect = convertedRect[i];
84
+ if (i === 0 && rect.top > offset) {
85
+ return callback(0);
86
+ }
87
+ if (rect.top <= offset && rect.bottom > offset) {
88
+ return callback(i);
89
+ }
90
+ if (i === l - 1 && rect.bottom <= offset) {
91
+ return callback(i);
92
+ }
93
+ }
94
+ }
95
+ export function getAspectFillSize(origWidth, origHeight, containerWidth, containerHeight) {
96
+ let width = 0;
97
+ let height = 0;
98
+ if (origWidth > 0 && origHeight > 0) {
99
+ if (origWidth / origHeight > containerWidth / containerHeight) {
100
+ height = containerHeight;
101
+ width = (origWidth / origHeight) * containerHeight;
102
+ }
103
+ else {
104
+ width = containerWidth;
105
+ height = (origHeight / origWidth) * containerWidth;
106
+ }
107
+ }
108
+ return [width, height];
109
+ }
110
+ export function getAspectFitSize(origWidth, origHeight, containerWidth, containerHeight) {
111
+ let width = 0;
112
+ let height = 0;
113
+ if (origWidth > 0 && origHeight > 0) {
114
+ if (origWidth / origHeight > containerWidth / containerHeight) {
115
+ width = containerWidth;
116
+ height = (origHeight / origWidth) * containerWidth;
117
+ }
118
+ else {
119
+ height = containerHeight;
120
+ width = (origWidth / origHeight) * containerHeight;
121
+ }
122
+ }
123
+ return [width, height];
124
+ }
125
+ export function getTwoPointsDistance(p1, p2) {
126
+ return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));
127
+ }
package/utils/index.d.ts CHANGED
@@ -9,3 +9,5 @@ export * from './lwa.slim';
9
9
  export * from './qrcode';
10
10
  export * from './system';
11
11
  export * from './object';
12
+ export * from './geometry';
13
+ export * from './inertialAnimate';
package/utils/index.js CHANGED
@@ -9,3 +9,5 @@ export * from './lwa.slim';
9
9
  export * from './qrcode';
10
10
  export * from './system';
11
11
  export * from './object';
12
+ export * from './geometry';
13
+ export * from './inertialAnimate';
@@ -0,0 +1,10 @@
1
+ export interface InertialAnimateOptions {
2
+ update?: (value: number) => void;
3
+ complete?: () => void;
4
+ }
5
+ export declare function createInertialAnimate(v: number, options: InertialAnimateOptions): {
6
+ stop: () => void;
7
+ play: () => void;
8
+ isAnimating(): boolean;
9
+ };
10
+ export type InertialAnimate = ReturnType<typeof createInertialAnimate>;
@@ -0,0 +1,42 @@
1
+ import { ticker } from './lwa.slim';
2
+ const friction = 0.95; // 摩擦系数
3
+ const minVelocity = 0.1; // 最小速度
4
+ export function createInertialAnimate(v, options) {
5
+ const initialVelocity = Math.abs(v);
6
+ let isAnimating = false;
7
+ const reversed = v < 0;
8
+ const { update, complete } = options;
9
+ let velocity = initialVelocity;
10
+ function animate() {
11
+ if (!isAnimating)
12
+ return;
13
+ velocity *= friction;
14
+ let displacement = velocity * 15;
15
+ displacement *= reversed ? -1 : 1;
16
+ update?.(displacement);
17
+ if (velocity < minVelocity) {
18
+ isAnimating = false;
19
+ ticker.remove(animate);
20
+ complete?.();
21
+ }
22
+ }
23
+ function play() {
24
+ if (!isAnimating) {
25
+ isAnimating = true;
26
+ ticker.add(animate);
27
+ }
28
+ }
29
+ function stop() {
30
+ if (isAnimating) {
31
+ isAnimating = false;
32
+ ticker.remove(animate);
33
+ }
34
+ }
35
+ return {
36
+ stop,
37
+ play,
38
+ isAnimating() {
39
+ return isAnimating;
40
+ },
41
+ };
42
+ }
package/utils/is.d.ts CHANGED
@@ -4,6 +4,14 @@
4
4
  * @return {boolean}
5
5
  */
6
6
  export declare function isPlainObject(target: any): target is Record<PropertyKey, any>;
7
+ /**
8
+ * @description: 判断是否为对象
9
+ * @param {any} target
10
+ * @return {boolean}
11
+ */
12
+ export declare function isObject(target: any): target is object & {
13
+ [key: PropertyKey]: any;
14
+ };
7
15
  /**
8
16
  * @description: 判断是否为函数
9
17
  * @param {any} target
package/utils/is.js CHANGED
@@ -6,6 +6,14 @@
6
6
  export function isPlainObject(target) {
7
7
  return Object.prototype.toString.call(target) === '[object Object]';
8
8
  }
9
+ /**
10
+ * @description: 判断是否为对象
11
+ * @param {any} target
12
+ * @return {boolean}
13
+ */
14
+ export function isObject(target) {
15
+ return target !== null && typeof target === 'object';
16
+ }
9
17
  /**
10
18
  * @description: 判断是否为函数
11
19
  * @param {any} target
package/utils/system.d.ts CHANGED
@@ -2,3 +2,5 @@ export declare const systemInfo: UniApp.GetSystemInfoResult;
2
2
  export declare const isApp: boolean;
3
3
  export declare const isWeb: boolean;
4
4
  export declare const isMp: boolean;
5
+ export declare const isAlipay: boolean;
6
+ export declare const isWeixin: boolean;
package/utils/system.js CHANGED
@@ -1,4 +1,7 @@
1
1
  export const systemInfo = uni.getSystemInfoSync();
2
- export const isApp = systemInfo.uniPlatform === 'app';
3
- export const isWeb = systemInfo.uniPlatform === 'web';
4
- export const isMp = systemInfo.uniPlatform.startsWith('mp-');
2
+ const platform = systemInfo.uniPlatform;
3
+ export const isApp = platform === 'app';
4
+ export const isWeb = platform === 'web';
5
+ export const isMp = platform.startsWith('mp-');
6
+ export const isAlipay = platform === 'mp-alipay';
7
+ export const isWeixin = platform === 'mp-weixin';
package/utils/utils.d.ts CHANGED
@@ -119,6 +119,12 @@ export declare function isEmptyValue(value: any, whitespace?: boolean): boolean;
119
119
  * @return {boolean}
120
120
  */
121
121
  export declare function isRenderVisible(value: any): boolean;
122
+ /**
123
+ * @description: 判断是否绑定为空值
124
+ * @param {any} target
125
+ * @return {boolean}
126
+ */
127
+ export declare function isEmptyBinding(target: any): target is '' | null | undefined;
122
128
  export interface DebounceOptions {
123
129
  leading?: boolean;
124
130
  trailing?: boolean;
@@ -216,4 +222,5 @@ export declare function getDistanceBetweenTwoPoints(c1: Coord, c2: Coord): numbe
216
222
  export declare function getMayPrimitiveOption(option: string | number | boolean | {
217
223
  [key: PropertyKey]: any;
218
224
  }, key: string): any;
225
+ export declare function sleep(time: number): Promise<unknown>;
219
226
  export {};
package/utils/utils.js CHANGED
@@ -253,6 +253,14 @@ export function isRenderVisible(value) {
253
253
  value !== undefined &&
254
254
  (typeof value !== 'string' || value.trim() !== ''));
255
255
  }
256
+ /**
257
+ * @description: 判断是否绑定为空值
258
+ * @param {any} target
259
+ * @return {boolean}
260
+ */
261
+ export function isEmptyBinding(target) {
262
+ return target === null || target === undefined || target === '';
263
+ }
256
264
  export function debounce(func, wait, options = {}) {
257
265
  let lastArgs, lastThis, maxWait, result, timerId, lastCallTime;
258
266
  let lastInvokeTime = 0;
@@ -652,3 +660,8 @@ export function getDistanceBetweenTwoPoints(c1, c2) {
652
660
  export function getMayPrimitiveOption(option, key) {
653
661
  return isPrimitive(option) ? option : option[key];
654
662
  }
663
+ export async function sleep(time) {
664
+ return new Promise((resolve) => {
665
+ setTimeout(resolve, time);
666
+ });
667
+ }
@@ -1,16 +0,0 @@
1
- import { type _TemplateProps, type _TemplateSlots } from './common';
2
- declare function __VLS_template(): Readonly<_TemplateSlots> & _TemplateSlots;
3
- declare const __VLS_component: import("vue").DefineComponent<_TemplateProps, {
4
- reset: () => void;
5
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
6
- click: (event: any) => any;
7
- }, string, import("vue").PublicProps, Readonly<_TemplateProps> & Readonly<{
8
- onClick?: ((event: any) => any) | undefined;
9
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
11
- export default _default;
12
- type __VLS_WithTemplateSlots<T, S> = T & {
13
- new (): {
14
- $slots: S;
15
- };
16
- };
@@ -1,45 +0,0 @@
1
- <template>
2
- <view :class="_templateClass" :style="_templateStyle">
3
- <slot></slot>
4
- </view>
5
- </template>
6
-
7
- <script>
8
- import { defineComponent as _defineComponent } from "vue";
9
- import { computed } from "vue";
10
- import { classNames, stringifyStyle, createBem } from "../../utils";
11
- export default _defineComponent({
12
- ...{
13
- options: {
14
- virtualHost: true,
15
- styleIsolation: "shared"
16
- }
17
- },
18
- __name: "_template",
19
- props: {
20
- rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
21
- rootClass: { type: String, required: false }
22
- },
23
- emits: ["click"],
24
- setup(__props, { expose: __expose }) {
25
- const props = __props;
26
- const bem = createBem("_template");
27
- __expose({
28
- reset: () => {
29
- }
30
- });
31
- const _templateClass = computed(() => {
32
- return classNames(bem.b(), props.rootClass);
33
- });
34
- const _templateStyle = computed(() => {
35
- return stringifyStyle(props.rootStyle);
36
- });
37
- const __returned__ = { props, bem, _templateClass, _templateStyle };
38
- return __returned__;
39
- }
40
- });
41
- </script>
42
-
43
- <style lang="scss">
44
- @import './index.scss';
45
- </style>
@@ -1,14 +0,0 @@
1
- import { type StyleValue } from 'vue';
2
- export interface _TemplateProps {
3
- rootStyle?: StyleValue;
4
- rootClass?: string;
5
- }
6
- export interface _TemplateSlots {
7
- default?(props: Record<string, never>): any;
8
- }
9
- export interface _TemplateEmits {
10
- (e: 'click', event: any): void;
11
- }
12
- export interface _TemplateExpose {
13
- reset: () => void;
14
- }
@@ -1 +0,0 @@
1
- export type { _TemplateProps, _TemplateSlots, _TemplateEmits, _TemplateExpose, } from './common';
@@ -1,17 +0,0 @@
1
- @use '../style/base' as *;
2
-
3
- @include bem(_template) {
4
- @include b() {
5
- @include universal;
6
- }
7
-
8
- @include e(element) {
9
- @include universal;
10
-
11
- @include m(modifier) {
12
- }
13
- }
14
-
15
- @include m(modifier) {
16
- }
17
- }
@@ -1,5 +0,0 @@
1
- // #variables
2
- page {
3
- --sar-template-bg: #fff;
4
- }
5
- // #endvariables
File without changes