sard-uniapp 1.30.0 → 1.30.1

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/CHANGELOG.md CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ ## <small>1.30.1 (2026-05-10)</small>
3
+
4
+ * Bug Fixes: 修复弹窗中使用时滚动位置不正确问题 ([30fb9d9](https://github.com/sutras/sard-uniapp/commit/30fb9d9))
5
+ * Bug Fixes: 透传常用属性 ([cc21393](https://github.com/sutras/sard-uniapp/commit/cc21393))
6
+
2
7
  ## 1.30.0 (2026-05-02)
3
8
 
4
9
  * Features: 允许在开关里面展示文字 ([55b9f23](https://github.com/sutras/sard-uniapp/commit/55b9f23))
@@ -64,13 +64,7 @@
64
64
  <script>
65
65
  import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
66
66
  import { computed, inject, ref, watch } from "vue";
67
- import {
68
- classNames,
69
- stringifyStyle,
70
- createBem,
71
- isWeb,
72
- uniqid
73
- } from "../../utils";
67
+ import { classNames, stringifyStyle, createBem, uniqid } from "../../utils";
74
68
  import SarIcon from "../icon/icon.vue";
75
69
  import { useFormContext, useFormItemContext } from "../form/common";
76
70
  import {
@@ -235,16 +229,9 @@ export default _defineComponent({
235
229
  }
236
230
  }
237
231
  );
238
- const onInput = (event) => {
239
- let value = event.detail.value;
232
+ const onInput = (value) => {
240
233
  lastFocusInput.value = thisInput;
241
- if (!isWeb) {
242
- if (props.maxlength >= 0) {
243
- value = value.slice(0, props.maxlength);
244
- }
245
- }
246
234
  setInnerValue(value);
247
- return value;
248
235
  };
249
236
  const innerFocused = ref(props.focus || props.focused);
250
237
  watch([() => props.focus, () => props.focused], () => {
@@ -308,9 +295,6 @@ export default _defineComponent({
308
295
  const onClick = (event) => {
309
296
  emit("click", event);
310
297
  };
311
- const maxLength = computed(() => {
312
- return isWeb ? props.maxlength : -1;
313
- });
314
298
  const isPlainText = ref(false);
315
299
  const eyeIcon = computed(() => isPlainText.value ? "eye" : "eye-slash");
316
300
  const onEyeClick = () => {
@@ -367,7 +351,7 @@ export default _defineComponent({
367
351
  placeholderStyle: mergedPlaceholderStyle.value,
368
352
  placeholderClass: props.placeholderClass,
369
353
  disabled: isDisabled.value || isReadonly.value,
370
- maxlength: maxLength.value,
354
+ maxlength: props.maxlength,
371
355
  focus: props.focus,
372
356
  cursorSpacing: props.cursorSpacing,
373
357
  cursor: props.cursor,
@@ -429,7 +413,7 @@ export default _defineComponent({
429
413
  return oldValue;
430
414
  }, set oldValue(v) {
431
415
  oldValue = v;
432
- }, thisInput, onFocus, onBlur, clearVisible, holdupClear, onClearTouchStart, onClearTouchEnd, onClearMouseDown, onClearClick, onLinechange, onConfirm, onKeyboardheightchange, onClick, maxLength, isPlainText, eyeIcon, onEyeClick, showPassword, omittedType, mergedShowEye, inputClass, inputStyle, controlStyle, mergedPlaceholderStyle, fieldCommonProps, inputOnlyProps, inputProps, textareaOnlyProps, textareaProps, SarIcon, SarInputBase, SarTextareaBase };
416
+ }, thisInput, onFocus, onBlur, clearVisible, holdupClear, onClearTouchStart, onClearTouchEnd, onClearMouseDown, onClearClick, onLinechange, onConfirm, onKeyboardheightchange, onClick, isPlainText, eyeIcon, onEyeClick, showPassword, omittedType, mergedShowEye, inputClass, inputStyle, controlStyle, mergedPlaceholderStyle, fieldCommonProps, inputOnlyProps, inputProps, textareaOnlyProps, textareaProps, SarIcon, SarInputBase, SarTextareaBase };
433
417
  return __returned__;
434
418
  }
435
419
  });
@@ -7,7 +7,7 @@
7
7
  :placeholder-style="placeholderStyle"
8
8
  :placeholder-class="placeholderClass"
9
9
  :disabled="disabled"
10
- :maxlength="maxlength"
10
+ :maxlength="maxLength"
11
11
  :focus="focus"
12
12
  :cursor-spacing="cursorSpacing"
13
13
  :cursor="cursor"
@@ -44,7 +44,9 @@
44
44
 
45
45
  <script>
46
46
  import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
47
+ import { computed } from "vue";
47
48
  import { defaultInputBaseProps } from "./common";
49
+ import { isWeb } from "../../utils";
48
50
  export default _defineComponent({
49
51
  ...{
50
52
  options: {
@@ -91,9 +93,20 @@ export default _defineComponent({
91
93
  emits: ["input", "focus", "blur", "confirm", "keyboardheightchange"],
92
94
  setup(__props, { expose: __expose, emit: __emit }) {
93
95
  __expose();
96
+ const props = __props;
94
97
  const emit = __emit;
98
+ const maxLength = computed(() => {
99
+ return isWeb ? props.maxlength : -1;
100
+ });
95
101
  const onInput = (event) => {
96
- emit("input", event);
102
+ let value = event.detail.value;
103
+ if (!isWeb) {
104
+ if (props.maxlength >= 0) {
105
+ value = value.slice(0, props.maxlength);
106
+ }
107
+ }
108
+ emit("input", value);
109
+ return value;
97
110
  };
98
111
  const onFocus = (event) => {
99
112
  emit("focus", event);
@@ -107,7 +120,7 @@ export default _defineComponent({
107
120
  const onKeyboardheightchange = (event) => {
108
121
  emit("keyboardheightchange", event);
109
122
  };
110
- const __returned__ = { emit, onInput, onFocus, onBlur, onConfirm, onKeyboardheightchange };
123
+ const __returned__ = { props, emit, maxLength, onInput, onFocus, onBlur, onConfirm, onKeyboardheightchange };
111
124
  return __returned__;
112
125
  }
113
126
  });
@@ -3,6 +3,10 @@
3
3
  <swiper
4
4
  :class="swiperClass"
5
5
  :current="innerValue"
6
+ :autoplay="autoplay"
7
+ :interval="interval"
8
+ :duration="duration"
9
+ :circular="circular"
6
10
  :previous-margin="previousMargin"
7
11
  :next-margin="nextMargin"
8
12
  :display-multiple-items="displayMultipleItems"
@@ -7,7 +7,7 @@
7
7
  :placeholder-style="placeholderStyle"
8
8
  :placeholder-class="placeholderClass"
9
9
  :disabled="disabled"
10
- :maxlength="maxlength"
10
+ :maxlength="maxLength"
11
11
  :focus="focus"
12
12
  :cursor-spacing="cursorSpacing"
13
13
  :cursor="cursor"
@@ -37,6 +37,8 @@
37
37
 
38
38
  <script>
39
39
  import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
40
+ import { computed } from "vue";
41
+ import { isWeb } from "../../utils";
40
42
  import {
41
43
  defaultTextareaBaseProps
42
44
  } from "../input-base/common";
@@ -78,9 +80,20 @@ export default _defineComponent({
78
80
  emits: ["linechange", "input", "focus", "blur", "confirm", "keyboardheightchange"],
79
81
  setup(__props, { expose: __expose, emit: __emit }) {
80
82
  __expose();
83
+ const props = __props;
81
84
  const emit = __emit;
85
+ const maxLength = computed(() => {
86
+ return isWeb ? props.maxlength : -1;
87
+ });
82
88
  const onInput = (event) => {
83
- emit("input", event);
89
+ let value = event.detail.value;
90
+ if (!isWeb) {
91
+ if (props.maxlength >= 0) {
92
+ value = value.slice(0, props.maxlength);
93
+ }
94
+ }
95
+ emit("input", value);
96
+ return value;
84
97
  };
85
98
  const onFocus = (event) => {
86
99
  emit("focus", event);
@@ -94,7 +107,7 @@ export default _defineComponent({
94
107
  const onKeyboardheightchange = (event) => {
95
108
  emit("keyboardheightchange", event);
96
109
  };
97
- const __returned__ = { emit, onInput, onFocus, onBlur, onConfirm, onKeyboardheightchange };
110
+ const __returned__ = { props, emit, maxLength, onInput, onFocus, onBlur, onConfirm, onKeyboardheightchange };
98
111
  return __returned__;
99
112
  }
100
113
  });
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "sard-uniapp",
3
3
  "name": "sard-uniapp",
4
4
  "displayName": "sard-uniapp",
5
- "version": "1.30.0",
5
+ "version": "1.30.1",
6
6
  "description": "sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库",
7
7
  "main": "index.js",
8
8
  "author": "wuzhitao",
@@ -14,6 +14,6 @@ export declare function useScrollSpy(options: UseScrollSpyOptions): {
14
14
  unregister: (name: string | number) => void;
15
15
  onScroll: (event: any) => void;
16
16
  scrollTo: (name: string | number) => void;
17
- update: () => Promise<void>;
17
+ update: () => void;
18
18
  initialize: () => Promise<void>;
19
19
  };
@@ -1,6 +1,7 @@
1
1
  import { computed, nextTick, ref, shallowRef } from 'vue';
2
2
  import { useTimeout } from './useTimeout';
3
3
  import { isNullish, matchScrollVisible } from '../utils';
4
+ import { usePopupEnter } from '../components/popup';
4
5
  export function useScrollSpy(options) {
5
6
  const { defaultCurrent, initialScroll, onChange, getSpiedRect } = options;
6
7
  const startOffset = computed(() => options.startOffset || 0);
@@ -101,6 +102,9 @@ export function useScrollSpy(options) {
101
102
  scrollTo(innerCurrent.value);
102
103
  }
103
104
  };
105
+ usePopupEnter(() => {
106
+ queueUpdate();
107
+ });
104
108
  return {
105
109
  scrollTop,
106
110
  innerCurrent,
@@ -109,7 +113,7 @@ export function useScrollSpy(options) {
109
113
  unregister,
110
114
  onScroll,
111
115
  scrollTo,
112
- update,
116
+ update: queueUpdate,
113
117
  initialize,
114
118
  };
115
119
  }