sard-uniapp 1.11.1 → 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 (195) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +5 -3
  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/tree.vue +6 -4
  148. package/components/tree-node/tree-node.vue +12 -10
  149. package/components/upload/upload.vue +3 -2
  150. package/dark.scss +1 -0
  151. package/global.d.ts +9 -0
  152. package/index.d.ts +8 -0
  153. package/index.js +8 -0
  154. package/index.scss +2 -0
  155. package/package.json +28 -24
  156. package/use/index.d.ts +4 -0
  157. package/use/index.js +4 -0
  158. package/use/useDragPinch.d.ts +15 -0
  159. package/use/useDragPinch.js +88 -0
  160. package/use/useImperative.js +1 -0
  161. package/use/useInitialVelocity.d.ts +13 -0
  162. package/use/useInitialVelocity.js +65 -0
  163. package/use/useMouseDown.js +3 -4
  164. package/use/useScrollSide.d.ts +6 -0
  165. package/use/useScrollSide.js +34 -0
  166. package/use/useScrollSpy.d.ts +19 -0
  167. package/use/useScrollSpy.js +99 -0
  168. package/use/useTimeoutLoading.d.ts +6 -0
  169. package/use/useTimeoutLoading.js +53 -0
  170. package/use/useZIndex.js +7 -3
  171. package/utils/bem.d.ts +8 -8
  172. package/utils/dom.d.ts +3 -69
  173. package/utils/dom.js +32 -109
  174. package/utils/file.d.ts +1 -0
  175. package/utils/file.js +14 -0
  176. package/utils/geometry.d.ts +67 -0
  177. package/utils/geometry.js +127 -0
  178. package/utils/index.d.ts +2 -0
  179. package/utils/index.js +2 -0
  180. package/utils/inertialAnimate.d.ts +10 -0
  181. package/utils/inertialAnimate.js +42 -0
  182. package/utils/is.d.ts +8 -0
  183. package/utils/is.js +8 -0
  184. package/utils/system.d.ts +2 -0
  185. package/utils/system.js +6 -3
  186. package/utils/utils.d.ts +7 -0
  187. package/utils/utils.js +13 -0
  188. package/components/_template/_template.d.ts +0 -16
  189. package/components/_template/_template.vue +0 -45
  190. package/components/_template/common.d.ts +0 -14
  191. package/components/_template/index.d.ts +0 -1
  192. package/components/_template/index.scss +0 -17
  193. package/components/_template/variables.scss +0 -5
  194. /package/components/{_template → crop-image}/index.js +0 -0
  195. /package/components/{_template → scroll-spy-anchor}/common.js +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,37 @@
1
+ # [1.12.0](https://github.com/sutras/sard-uniapp/compare/v1.11.2...v1.12.0) (2025-03-25)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **cascader:** 允许空字符串作为未选择初始值 ([c0073ec](https://github.com/sutras/sard-uniapp/commit/c0073ec8b3bc285443fca6c17b86dbdb7976ec08))
7
+ * 修复 table 组件右边固定阴影显示问题 ([4e7869a](https://github.com/sutras/sard-uniapp/commit/4e7869a70f60d4f9d6f01c68fdc90a00080adad9))
8
+ * 修复cascader在支付宝端的展示问题 ([e5ab136](https://github.com/sutras/sard-uniapp/commit/e5ab136da081fbcfc6a8f07d00482231cd7270fe))
9
+ * 修复因uniapp会修改元素id导致获取不到元素的问题 ([10dbfe0](https://github.com/sutras/sard-uniapp/commit/10dbfe0adf49f32f85d6902c7a255b7a84d400fe))
10
+
11
+
12
+ ### Features
13
+
14
+ * button 组件新增 block 属性 ([bb4d39b](https://github.com/sutras/sard-uniapp/commit/bb4d39b0dd417273fcf9fac3f132a26332d6bd8d))
15
+ * grid 组件新增 badge 相关属性 ([0c33247](https://github.com/sutras/sard-uniapp/commit/0c3324750a1ee48a9f2801e7e20defeddad70003))
16
+ * navbar组件新增属性,修改样式 ([dc4e747](https://github.com/sutras/sard-uniapp/commit/dc4e7478dedeb4aaecb659b99eb9ecc9acfba2e6))
17
+ * 新增 crop-image 组件 ([5b89f0e](https://github.com/sutras/sard-uniapp/commit/5b89f0ea3b5f09e28534222e4eecd9726ad03b97))
18
+ * 新增 ScrollSpy 组件 ([d4c0e92](https://github.com/sutras/sard-uniapp/commit/d4c0e92d2a9aab60687f08b384937f5276e53c5e))
19
+ * 新增 Sidebar 组件 ([4c1487a](https://github.com/sutras/sard-uniapp/commit/4c1487a9fa77f01ea0be962d64c49167afb29ece))
20
+ * 新增 signature 组件 ([04b7bf8](https://github.com/sutras/sard-uniapp/commit/04b7bf84149c78ad336f0a23eac8a60b0f5b2396))
21
+ * 新增 status-bar 组件 ([49339d7](https://github.com/sutras/sard-uniapp/commit/49339d79738e829a34edc4a83a237ed3814e24c1))
22
+ * 新增 zIndex 全局配置 ([77802cd](https://github.com/sutras/sard-uniapp/commit/77802cd2c772bd3c6c67e8a09254a1e0b501cece))
23
+
24
+
25
+
26
+ ## [1.11.2](https://github.com/sutras/sard-uniapp/compare/v1.11.1...v1.11.2) (2025-03-06)
27
+
28
+
29
+ ### Bug Fixes
30
+
31
+ * 修复tree组件递归引用问题 ([25c48b7](https://github.com/sutras/sard-uniapp/commit/25c48b7d57fd178ea9a08688757da41b1394d297))
32
+
33
+
34
+
1
35
  ## [1.11.1](https://github.com/sutras/sard-uniapp/compare/v1.11.0...v1.11.1) (2025-03-06)
2
36
 
3
37
 
package/README.md CHANGED
@@ -25,7 +25,7 @@
25
25
 
26
26
  ## 特性
27
27
 
28
- - 🧩 76+个高质量组件,覆盖移动端主流场景
28
+ - 🧩 80+个高质量组件,覆盖移动端主流场景
29
29
  - 💪 支持一套代码同时开发 H5 / 小程序 / App
30
30
  - 🌿 支持按需引入和 `Tree Shaking`
31
31
  - 📖 详尽的文档和案例展示
@@ -114,7 +114,8 @@ npm run release
114
114
  - 修复问题
115
115
  - 测试
116
116
  - 修改版本号
117
- - 暂存、提交 `git commit -a -m 'fix: '`
117
+ - 暂存 `git add .`
118
+ - 提交 `git commit -m 'fix: '`
118
119
  - 给提交打标签 `npm run tag`
119
120
  - 生成 changelog `npm run changelog`
120
121
  - 暂存、提交 changelog `git commit -a -m 'chore: changelog'`
@@ -128,7 +129,8 @@ npm run release
128
129
 
129
130
  ## 新增组件流程
130
131
 
131
- - 运行 `npm run newComponent` 命令自动创建组件
132
+ - 运行 `npm run nc` 命令创建组件
133
+ - 运行 `npm run nsc` 命令创建子组件
132
134
  - 编写组件代码
133
135
  - 编写案例代码
134
136
  - 编写组件文档
@@ -49,7 +49,13 @@
49
49
  <script>
50
50
  import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
51
51
  import { computed, ref, watch } from "vue";
52
- import { classNames, stringifyStyle, createBem, noop } from "../../utils";
52
+ import {
53
+ classNames,
54
+ stringifyStyle,
55
+ createBem,
56
+ noop,
57
+ isFunction
58
+ } from "../../utils";
53
59
  import SarPopup from "../popup/popup.vue";
54
60
  import SarLoading from "../loading/loading.vue";
55
61
  import {
@@ -92,7 +98,7 @@ export default _defineComponent({
92
98
  }
93
99
  );
94
100
  const perhapsClose = (type) => {
95
- if (typeof props.beforeClose === "function") {
101
+ if (isFunction(props.beforeClose)) {
96
102
  const result = props.beforeClose(type);
97
103
  if (result instanceof Promise) {
98
104
  return result.then(() => {
@@ -40,7 +40,7 @@
40
40
  cursor: pointer;
41
41
 
42
42
  &:not(:first-child) {
43
- &:before {
43
+ &::before {
44
44
  @include border-top(var(--sar-action-sheet-border-color));
45
45
  }
46
46
  }
@@ -5,8 +5,8 @@ declare const __VLS_component: import("vue").DefineComponent<BackTopProps, {}, {
5
5
  }, string, import("vue").PublicProps, Readonly<BackTopProps> & Readonly<{
6
6
  onClick?: ((event: any) => any) | undefined;
7
7
  }>, {
8
- visibleHeight: number;
9
8
  scrollTop: number;
9
+ visibleHeight: number;
10
10
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
11
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
12
12
  export default _default;
@@ -47,7 +47,7 @@ export default _defineComponent({
47
47
  return !props.dot && props.value === 0 && !props.showZero && !slots.value;
48
48
  });
49
49
  const innerValue = computed(() => {
50
- return props.dot ? "" : typeof props.value === "number" && props.value > props.max ? `${props.max}+` : props.value;
50
+ return props.dot ? "" : typeof props.value === "number" && props.value > props.max ? `${props.max}+` : props.value === 0 && !props.showZero ? "" : props.value;
51
51
  });
52
52
  const badgeClass = computed(() => {
53
53
  return classNames(
@@ -10,6 +10,7 @@ declare const __VLS_component: import("vue").DefineComponent<ButtonProps, {}, {}
10
10
  size: "mini" | "small" | "medium" | "large";
11
11
  type: "default" | "pale" | "mild" | "outline" | "text" | "pale-text";
12
12
  theme: "primary" | "secondary" | "success" | "info" | "warning" | "danger" | "neutral";
13
+ block: boolean;
13
14
  hoverStopPropagation: boolean;
14
15
  lang: string;
15
16
  showMessageCard: boolean;
@@ -79,6 +79,7 @@ export default _defineComponent({
79
79
  loadingType: { type: String, required: false },
80
80
  color: { type: String, required: false },
81
81
  background: { type: String, required: false },
82
+ block: { type: Boolean, required: false },
82
83
  formType: { type: String, required: false },
83
84
  openType: { type: String, required: false },
84
85
  appParameter: { type: String, required: false },
@@ -154,6 +155,7 @@ export default _defineComponent({
154
155
  bem.m("round", props.round),
155
156
  bem.m("disabled", isDisabled.value),
156
157
  bem.m("loading", props.loading),
158
+ bem.m("block", props.block),
157
159
  props.rootClass
158
160
  );
159
161
  });
@@ -11,6 +11,7 @@ export interface ButtonProps {
11
11
  loadingType?: 'clock' | 'circular';
12
12
  color?: string;
13
13
  background?: string;
14
+ block?: boolean;
14
15
  formType?: string;
15
16
  openType?: string;
16
17
  appParameter?: string;
@@ -32,6 +33,7 @@ export declare const defaultButtonProps: {
32
33
  hoverStopPropagation: boolean;
33
34
  lang: string;
34
35
  showMessageCard: boolean;
36
+ block: boolean;
35
37
  };
36
38
  export interface ButtonSlots {
37
39
  default?(props: Record<string, never>): any;
@@ -4,10 +4,10 @@
4
4
  @include bem(button) {
5
5
  @include b() {
6
6
  @include universal;
7
+ display: inline-flex;
7
8
  flex-direction: row;
8
9
  align-items: center;
9
10
  justify-content: center;
10
- flex: auto;
11
11
  width: auto;
12
12
  margin: 0;
13
13
  border: none;
@@ -21,6 +21,11 @@
21
21
  overflow: visible;
22
22
  }
23
23
 
24
+ @include m(block) {
25
+ display: flex;
26
+ flex: auto;
27
+ }
28
+
24
29
  // border
25
30
  &::after {
26
31
  @include border-surround(currentColor);
@@ -7,7 +7,7 @@ declare const _default: import("vue").DefineComponent<CalendarProps, {}, {}, {},
7
7
  onChange?: ((value: string | string[] | Date | Date[]) => any) | undefined;
8
8
  }>, {
9
9
  type: import("./common").CalendarType;
10
- maxDays: number;
11
10
  weekStartsOn: number;
11
+ maxDays: number;
12
12
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
13
  export default _default;
@@ -9,11 +9,17 @@
9
9
  :disabled="
10
10
  toMonthNumber(innerCurrentDate) <= toMonthNumber(minDate)
11
11
  "
12
+ :block="false"
12
13
  @click="onPrevMonthClick"
13
14
  >
14
15
  <sar-icon name="left" size="32rpx" />
15
16
  </sar-button>
16
- <sar-button type="pale-text" theme="neutral" @click="onMonthClick">
17
+ <sar-button
18
+ type="pale-text"
19
+ theme="neutral"
20
+ :block="false"
21
+ @click="onMonthClick"
22
+ >
17
23
  {{
18
24
  t('monthTitle', {
19
25
  year: innerCurrentDate.getFullYear(),
@@ -27,6 +33,7 @@
27
33
  :disabled="
28
34
  toMonthNumber(innerCurrentDate) >= toMonthNumber(maxDate)
29
35
  "
36
+ :block="false"
30
37
  @click="onNextMonthClick"
31
38
  >
32
39
  <sar-icon name="right" size="32rpx" />
@@ -39,26 +46,38 @@
39
46
  </view>
40
47
  </view>
41
48
  </view>
42
- <scroll-view :scroll-y="severalMonths" :class="bem.e('body')">
43
- <sar-calendar-month
44
- v-for="(month, i) in months"
45
- :key="i"
46
- :year="month[0]"
47
- :month="month[1]"
48
- :type="type"
49
- :min-date="minDate"
50
- :max-date="maxDate"
51
- :current-dates="currentDates"
52
- :formatter="formatter"
53
- :disabled-date="disabledDate"
54
- :today-number="todayNumber"
55
- :week-starts-on="weekStartsOn"
56
- :several-months="severalMonths"
57
- :t="t"
58
- :bem="bem"
59
- @day-click="onDayClick"
60
- />
61
- </scroll-view>
49
+ <view :class="bodyClass">
50
+ <scroll-view
51
+ :class="bem.e('scroll')"
52
+ :scroll-y="severalMonths"
53
+ trap-scroll
54
+ :upper-threshold="0"
55
+ :lower-threshold="0"
56
+ :throttle="false"
57
+ @scroll="onScroll"
58
+ @scrolltoupper="onScrolltoupper"
59
+ @scrolltolower="onScrolltolower"
60
+ >
61
+ <sar-calendar-month
62
+ v-for="(month, i) in months"
63
+ :key="i"
64
+ :year="month[0]"
65
+ :month="month[1]"
66
+ :type="type"
67
+ :min-date="minDate"
68
+ :max-date="maxDate"
69
+ :current-dates="currentDates"
70
+ :formatter="formatter"
71
+ :disabled-date="disabledDate"
72
+ :today-number="todayNumber"
73
+ :week-starts-on="weekStartsOn"
74
+ :several-months="severalMonths"
75
+ :t="t"
76
+ :bem="bem"
77
+ @day-click="onDayClick"
78
+ />
79
+ </scroll-view>
80
+ </view>
62
81
  </view>
63
82
 
64
83
  <sar-popout
@@ -109,6 +128,7 @@ import { useTranslate } from "../locale";
109
128
  import SarCalendarMonth from "../calendar-month/calendar-month.vue";
110
129
  import SarPopout from "../popout/popout.vue";
111
130
  import SarDatetimePicker from "../datetime-picker/datetime-picker.vue";
131
+ import { useScrollSide } from "../../use";
112
132
  export default _defineComponent({
113
133
  components: {
114
134
  SarButton,
@@ -316,6 +336,13 @@ export default _defineComponent({
316
336
  const preventPageScroll = computed(() => {
317
337
  return inPopup && !props.severalMonths;
318
338
  });
339
+ const { scrollSide, onScroll, onScrolltoupper, onScrolltolower } = useScrollSide();
340
+ const bodyClass = computed(() => {
341
+ return classNames(
342
+ bem.e("body"),
343
+ bem.em("body", scrollSide.value, scrollSide.value)
344
+ );
345
+ });
319
346
  const calendarClass = computed(() => {
320
347
  return classNames(
321
348
  bem.b(),
@@ -331,7 +358,7 @@ export default _defineComponent({
331
358
  return currentEmitValue;
332
359
  }, set currentEmitValue(v) {
333
360
  currentEmitValue = v;
334
- }, getInitialCurrentDate, innerCurrentDate, startDate, onPrevMonthClick, onNextMonthClick, pickerVisible, pickerValue, onMonthClick, onPickerConfirm, weeks, months, todayNumber, currentDates, onDayClick, inPopup, preventPageScroll, calendarClass, calendarStyle, get toMonthNumber() {
361
+ }, getInitialCurrentDate, innerCurrentDate, startDate, onPrevMonthClick, onNextMonthClick, pickerVisible, pickerValue, onMonthClick, onPickerConfirm, weeks, months, todayNumber, currentDates, onDayClick, inPopup, preventPageScroll, scrollSide, onScroll, onScrolltoupper, onScrolltolower, bodyClass, calendarClass, calendarStyle, get toMonthNumber() {
335
362
  return toMonthNumber;
336
363
  }, SarButton, SarIcon, SarCalendarMonth, SarPopout, SarDatetimePicker };
337
364
  return __returned__;
@@ -14,7 +14,6 @@
14
14
  @include universal;
15
15
  z-index: 1;
16
16
  flex: none;
17
- margin-bottom: var(--sar-calendar-header-margin-bottom);
18
17
 
19
18
  &::after {
20
19
  @include border-bottom(var(--sar-border-color));
@@ -56,15 +55,16 @@
56
55
  @include universal;
57
56
  z-index: 0;
58
57
  flex: none;
58
+
59
+ @include scroll-shadow;
59
60
  }
60
61
 
61
62
  @include m(several) {
62
- @include e(header) {
63
- box-shadow: var(--sar-shadow-lg);
64
- }
65
-
66
63
  @include e(body) {
67
64
  height: 360px;
68
65
  }
66
+ @include e(scroll) {
67
+ height: 100%;
68
+ }
69
69
  }
70
70
  }
@@ -1,11 +1,11 @@
1
1
  // #variables
2
2
  page {
3
- --sar-calendar-header-margin-bottom: 8rpx;
4
3
  --sar-calendar-current-month-font-size: var(--sar-text-lg);
5
4
 
6
5
  --sar-calendar-week-item-height: 64rpx;
7
6
  --sar-calendar-week-item-font-size: var(--sar-text-base);
8
7
 
8
+ --sar-calendar-month-padding: 8rpx;
9
9
  --sar-calendar-month-title-height: 88rpx;
10
10
  --sar-calendar-month-title-font-size: var(--sar-text-base);
11
11
 
@@ -11,9 +11,9 @@ declare const _default: import("vue").DefineComponent<CalendarInputProps, {}, {}
11
11
  }>, {
12
12
  type: CalendarType;
13
13
  validateEvent: boolean;
14
- maxDays: number;
15
14
  weekStartsOn: number;
16
15
  showConfirm: boolean;
16
+ maxDays: number;
17
17
  outletFormat: string;
18
18
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
19
  export default _default;
@@ -4,6 +4,7 @@
4
4
  @include bem(calendar) {
5
5
  @include e(month) {
6
6
  @include universal;
7
+ padding: var(--sar-calendar-month-padding);
7
8
  }
8
9
 
9
10
  @include e(days) {
@@ -1,13 +1,13 @@
1
1
  import { type CascaderProps, type CascaderSlots, type CascaderOption } from './common';
2
2
  declare function __VLS_template(): Readonly<CascaderSlots> & CascaderSlots;
3
3
  declare const __VLS_component: import("vue").DefineComponent<CascaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
- "update:model-value": (value: string | number, selectedOptions: CascaderOption[]) => any;
5
- change: (value: string | number, selectedOptions: CascaderOption[]) => any;
6
- select: (option: CascaderOption, tabIndex: number) => any;
4
+ "update:model-value": (value: string | number, selectedOptions: any[]) => any;
5
+ change: (value: string | number, selectedOptions: any[]) => any;
6
+ select: (option: any, tabIndex: number) => any;
7
7
  }, string, import("vue").PublicProps, Readonly<CascaderProps> & Readonly<{
8
- "onUpdate:model-value"?: ((value: string | number, selectedOptions: CascaderOption[]) => any) | undefined;
9
- onChange?: ((value: string | number, selectedOptions: CascaderOption[]) => any) | undefined;
10
- onSelect?: ((option: CascaderOption, tabIndex: number) => any) | undefined;
8
+ "onUpdate:model-value"?: ((value: string | number, selectedOptions: any[]) => any) | undefined;
9
+ onChange?: ((value: string | number, selectedOptions: any[]) => any) | undefined;
10
+ onSelect?: ((option: any, tabIndex: number) => any) | undefined;
11
11
  }>, {
12
12
  options: CascaderOption[];
13
13
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -20,7 +20,7 @@
20
20
  :class="bem.e('pane')"
21
21
  >
22
22
  <view :class="bem.e('options')">
23
- <scroll-view scroll-y :class="bem.e('scroll')">
23
+ <scroll-view scroll-y trap-scroll :class="bem.e('scroll')">
24
24
  <view
25
25
  v-for="(option, optionIndex) in tab.options"
26
26
  :key="optionIndex"
@@ -77,7 +77,12 @@
77
77
  <script>
78
78
  import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
79
79
  import { computed, ref, watch } from "vue";
80
- import { classNames, stringifyStyle, createBem } from "../../utils";
80
+ import {
81
+ classNames,
82
+ stringifyStyle,
83
+ createBem,
84
+ isEmptyBinding
85
+ } from "../../utils";
81
86
  import { useTranslate } from "../locale";
82
87
  import SarTabs from "../tabs/tabs.vue";
83
88
  import SarIcon from "../icon/icon.vue";
@@ -118,7 +123,7 @@ export default _defineComponent({
118
123
  const { t } = useTranslate("cascader");
119
124
  const updateTabs = () => {
120
125
  let nextTabs;
121
- if (tempValue === void 0) {
126
+ if (isEmptyBinding(tempValue)) {
122
127
  nextTabs = [
123
128
  {
124
129
  options: props.options || [],
@@ -226,7 +231,7 @@ export default _defineComponent({
226
231
  () => props.modelValue,
227
232
  () => {
228
233
  innerValue.value = props.modelValue;
229
- if (props.modelValue !== void 0) {
234
+ if (!isEmptyBinding(props.modelValue)) {
230
235
  if (tabs.value.some(
231
236
  (tab) => tab.selected?.[mergedFieldKeys.value.value] === props.modelValue
232
237
  )) {
@@ -30,9 +30,9 @@ export interface CascaderSlots {
30
30
  }): any;
31
31
  }
32
32
  export interface CascaderEmits {
33
- (e: 'update:model-value', value: string | number, selectedOptions: CascaderOption[]): void;
34
- (e: 'change', value: string | number, selectedOptions: CascaderOption[]): void;
35
- (e: 'select', option: CascaderOption, tabIndex: number): void;
33
+ (e: 'update:model-value', value: string | number, selectedOptions: any[]): void;
34
+ (e: 'change', value: string | number, selectedOptions: any[]): void;
35
+ (e: 'select', option: any, tabIndex: number): void;
36
36
  }
37
37
  export interface CascaderTab {
38
38
  options: CascaderOption[];
@@ -31,6 +31,7 @@
31
31
  }
32
32
 
33
33
  @include e(scroll) {
34
+ width: 100%;
34
35
  height: 100%;
35
36
  }
36
37
 
@@ -19,37 +19,51 @@
19
19
  @confirm="onConfirm"
20
20
  >
21
21
  <template #visible="{ already }">
22
- <scroll-view v-if="already" scroll-y :class="bem.e('scroll')">
23
- <sar-checkbox-group
24
- :size="size"
25
- :type="type"
26
- :checkedColor="checkedColor"
27
- :direction="direction"
28
- :validate-event="false"
29
- :model-value="popoutValue"
30
- @change="onChange"
22
+ <view v-if="already" :class="containerClass">
23
+ <scroll-view
24
+ :class="bem.e('scroll')"
25
+ scroll-y
26
+ trap-scroll
27
+ :upper-threshold="0"
28
+ :lower-threshold="0"
29
+ :throttle="false"
30
+ @scroll="onScroll"
31
+ @scrolltoupper="onScrolltoupper"
32
+ @scrolltolower="onScrolltolower"
31
33
  >
32
- <template #custom="{ toggle }">
33
- <sar-list inlaid>
34
- <sar-list-item
35
- v-for="option in options"
36
- :key="getMayPrimitiveOption(option, fieldKeys.value)"
37
- :title="getMayPrimitiveOption(option, fieldKeys.label)"
38
- hover
39
- @click="toggle(getMayPrimitiveOption(option, fieldKeys.value))"
40
- >
41
- <template #value>
42
- <sar-checkbox
43
- readonly
44
- :value="getMayPrimitiveOption(option, fieldKeys.value)"
45
- :validate-event="false"
46
- />
47
- </template>
48
- </sar-list-item>
49
- </sar-list>
50
- </template>
51
- </sar-checkbox-group>
52
- </scroll-view>
34
+ <sar-checkbox-group
35
+ :size="size"
36
+ :type="type"
37
+ :checkedColor="checkedColor"
38
+ :direction="direction"
39
+ :validate-event="false"
40
+ :model-value="popoutValue"
41
+ @change="onChange"
42
+ >
43
+ <template #custom="{ toggle }">
44
+ <sar-list inlaid>
45
+ <sar-list-item
46
+ v-for="option in options"
47
+ :key="getMayPrimitiveOption(option, fieldKeys.value)"
48
+ :title="getMayPrimitiveOption(option, fieldKeys.label)"
49
+ hover
50
+ @click="
51
+ toggle(getMayPrimitiveOption(option, fieldKeys.value))
52
+ "
53
+ >
54
+ <template #value>
55
+ <sar-checkbox
56
+ readonly
57
+ :value="getMayPrimitiveOption(option, fieldKeys.value)"
58
+ :validate-event="false"
59
+ />
60
+ </template>
61
+ </sar-list-item>
62
+ </sar-list>
63
+ </template>
64
+ </sar-checkbox-group>
65
+ </scroll-view>
66
+ </view>
53
67
  </template>
54
68
  </sar-popout>
55
69
  </template>
@@ -69,8 +83,14 @@ import {
69
83
  import {
70
84
  defaultCheckboxInputProps
71
85
  } from "./common";
72
- import { createBem, getMayPrimitiveOption, isNullish } from "../../utils";
86
+ import {
87
+ classNames,
88
+ createBem,
89
+ getMayPrimitiveOption,
90
+ isNullish
91
+ } from "../../utils";
73
92
  import { useFormItemContext } from "../form/common";
93
+ import { useScrollSide } from "../../use";
74
94
  export default _defineComponent({
75
95
  components: {
76
96
  SarPopoutInput,
@@ -188,7 +208,14 @@ export default _defineComponent({
188
208
  innerVisible.value = true;
189
209
  emit("update:visible", true);
190
210
  };
191
- const __returned__ = { props, emit, bem, formItemContext, fieldKeys, innerValue, popoutValue, onChange, onConfirm, inputValue, getOutletText, getInputValue, onClear, innerVisible, onVisible, onInputClick, SarPopoutInput, SarPopout, SarCheckboxGroup, SarCheckbox, SarList, SarListItem, get getMayPrimitiveOption() {
211
+ const { scrollSide, onScroll, onScrolltoupper, onScrolltolower } = useScrollSide();
212
+ const containerClass = computed(() => {
213
+ return classNames(
214
+ bem.e("container"),
215
+ bem.em("container", scrollSide.value, scrollSide.value)
216
+ );
217
+ });
218
+ const __returned__ = { props, emit, bem, formItemContext, fieldKeys, innerValue, popoutValue, onChange, onConfirm, inputValue, getOutletText, getInputValue, onClear, innerVisible, onVisible, onInputClick, scrollSide, onScroll, onScrolltoupper, onScrolltolower, containerClass, SarPopoutInput, SarPopout, SarCheckboxGroup, SarCheckbox, SarList, SarListItem, get getMayPrimitiveOption() {
192
219
  return getMayPrimitiveOption;
193
220
  } };
194
221
  return __returned__;
@@ -1,6 +1,10 @@
1
1
  @use '../style/base' as *;
2
2
 
3
3
  @include bem(checkbox-input) {
4
+ @include e(container) {
5
+ @include scroll-shadow;
6
+ }
7
+
4
8
  @include e(scroll) {
5
9
  max-height: var(--sar-checkbox-input-max-height);
6
10
  }
@@ -38,6 +38,7 @@ type DeepPartial<T> = {
38
38
  [P in keyof T]?: T[P] extends Record<any, any> ? DeepPartial<T[P]> : T[P];
39
39
  };
40
40
  export declare const defaultConfig: {
41
+ initialZIndex: number;
41
42
  actionSheet: {
42
43
  overlayClosable: boolean;
43
44
  duration: number;
@@ -62,6 +63,7 @@ export declare const defaultConfig: {
62
63
  hoverStopPropagation: boolean;
63
64
  lang: string;
64
65
  showMessageCard: boolean;
66
+ block: boolean;
65
67
  };
66
68
  calendar: {
67
69
  type: CalendarProps["type"];
@@ -98,6 +100,15 @@ export declare const defaultConfig: {
98
100
  separatorDigit: number;
99
101
  duration: number;
100
102
  };
103
+ cropImage: {
104
+ duration: number;
105
+ cropScale: string;
106
+ type: "png";
107
+ quality: number;
108
+ };
109
+ cropImageAgent: {
110
+ id: string;
111
+ };
101
112
  datetimePicker: {
102
113
  type: string;
103
114
  };
@@ -302,6 +313,15 @@ export declare const defaultConfig: {
302
313
  overlayClosable: boolean;
303
314
  duration: number;
304
315
  };
316
+ signature: {
317
+ lineWidth: number;
318
+ fullScreen: boolean;
319
+ color: string;
320
+ duration: number;
321
+ type: "png";
322
+ target: "dataURL";
323
+ quality: number;
324
+ };
305
325
  skeleton: {
306
326
  rows: number;
307
327
  loading: boolean;
@@ -316,6 +336,9 @@ export declare const defaultConfig: {
316
336
  direction: SpaceProps["direction"];
317
337
  size: SpaceProps["size"];
318
338
  };
339
+ statusBar: {
340
+ height: string;
341
+ };
319
342
  stepper: {
320
343
  min: number;
321
344
  max: number;