sard-uniapp 1.25.1 → 1.25.3
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,3 +1,22 @@
|
|
|
1
|
+
## [1.25.3](https://github.com/sutras/sard-uniapp/compare/v1.25.2...v1.25.3) (2025-11-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* 修复ios微信端水印渲染失败问题 ([0bea433](https://github.com/sutras/sard-uniapp/commit/0bea433bf0246bbbb1f4cf7701fb75a2879aed90))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## [1.25.2](https://github.com/sutras/sard-uniapp/compare/v1.25.1...v1.25.2) (2025-11-11)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **cascader:** 节点值相同时优先绑定后代节点 ([3937b2d](https://github.com/sutras/sard-uniapp/commit/3937b2d3ee47afe875d5d1544d211ca31f7490a0))
|
|
16
|
+
* **input:** 修复web端最大字数限制无效问题 ([8811d13](https://github.com/sutras/sard-uniapp/commit/8811d13ef1c5294ad16fb52b1d1b56fd2c37f356))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
1
20
|
## [1.25.1](https://github.com/sutras/sard-uniapp/compare/v1.25.0...v1.25.1) (2025-11-07)
|
|
2
21
|
|
|
3
22
|
|
|
@@ -24,15 +24,17 @@ export function getSelectedOptionsByValue(options, value, fieldKeys) {
|
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
26
26
|
for (const option of options) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
27
|
+
// 优先在子结点中查找,找到后再向上回溯路径
|
|
28
|
+
// 这样可以处理存在重复值场景时候更偏向于更深层次的选项
|
|
30
29
|
if (Array.isArray(option[fieldKeys.children])) {
|
|
31
30
|
const selectedOptions = getSelectedOptionsByValue(option[fieldKeys.children], value, fieldKeys);
|
|
32
31
|
if (selectedOptions) {
|
|
33
32
|
return [option, ...selectedOptions];
|
|
34
33
|
}
|
|
35
34
|
}
|
|
35
|
+
if (option[fieldKeys.value] === value) {
|
|
36
|
+
return [option];
|
|
37
|
+
}
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
}
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
)
|
|
18
18
|
"
|
|
19
19
|
:enableNative="enableNative"
|
|
20
|
+
:controlled="controlled"
|
|
20
21
|
:value="innerValue"
|
|
21
22
|
:placeholder="placeholder"
|
|
22
23
|
:placeholder-style="mergedPlaceholderStyle"
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
:fixed="fixed"
|
|
39
40
|
:show-confirm-bar="showConfirmBar"
|
|
40
41
|
:disable-default-padding="disableDefaultPadding"
|
|
42
|
+
:maxlength="maxLength"
|
|
41
43
|
@input="onInput"
|
|
42
44
|
@focus="onFocus"
|
|
43
45
|
@blur="onBlur"
|
|
@@ -52,6 +54,7 @@
|
|
|
52
54
|
v-if="type !== 'textarea' && showPassword"
|
|
53
55
|
:class="classNames(bem.e('control'), bem.em('control', 'input'))"
|
|
54
56
|
:enableNative="enableNative"
|
|
57
|
+
:controlled="controlled"
|
|
55
58
|
:value="innerValue"
|
|
56
59
|
:placeholder="placeholder"
|
|
57
60
|
:placeholder-style="mergedPlaceholderStyle"
|
|
@@ -70,6 +73,7 @@
|
|
|
70
73
|
:ignore-composition-event="ignoreCompositionEvent"
|
|
71
74
|
:inputmode="inputmode"
|
|
72
75
|
autocomplete="off"
|
|
76
|
+
:maxlength="maxLength"
|
|
73
77
|
@input="onInput"
|
|
74
78
|
@focus="onFocus"
|
|
75
79
|
@blur="onBlur"
|
|
@@ -85,12 +89,12 @@
|
|
|
85
89
|
:safe-password-salt="safePasswordSalt"
|
|
86
90
|
:safe-password-custom-hash="safePasswordCustomHash"
|
|
87
91
|
:random-number="randomNumber"
|
|
88
|
-
:controlled="controlled"
|
|
89
92
|
:always-system="alwaysSystem"
|
|
90
93
|
/>
|
|
91
94
|
<input
|
|
92
95
|
v-if="type !== 'textarea' && !showPassword"
|
|
93
96
|
:class="classNames(bem.e('control'), bem.em('control', 'input'))"
|
|
97
|
+
:controlled="controlled"
|
|
94
98
|
:enableNative="enableNative"
|
|
95
99
|
:value="innerValue"
|
|
96
100
|
:placeholder="placeholder"
|
|
@@ -110,6 +114,7 @@
|
|
|
110
114
|
:ignore-composition-event="ignoreCompositionEvent"
|
|
111
115
|
:inputmode="inputmode"
|
|
112
116
|
autocomplete="off"
|
|
117
|
+
:maxlength="maxLength"
|
|
113
118
|
@input="onInput"
|
|
114
119
|
@focus="onFocus"
|
|
115
120
|
@blur="onBlur"
|
|
@@ -125,7 +130,6 @@
|
|
|
125
130
|
:safe-password-salt="safePasswordSalt"
|
|
126
131
|
:safe-password-custom-hash="safePasswordCustomHash"
|
|
127
132
|
:random-number="randomNumber"
|
|
128
|
-
:controlled="controlled"
|
|
129
133
|
:always-system="alwaysSystem"
|
|
130
134
|
/>
|
|
131
135
|
<view :class="bem.e('tools')">
|
|
@@ -154,7 +158,8 @@
|
|
|
154
158
|
<slot name="addon"></slot>
|
|
155
159
|
</view>
|
|
156
160
|
<view v-if="showCount" :class="bem.e('count')">
|
|
157
|
-
{{ innerValue.length }}
|
|
161
|
+
<view v-if="maxlength === -1">{{ innerValue.length }}</view>
|
|
162
|
+
<view v-else>{{ innerValue.length }} / {{ maxlength }}</view>
|
|
158
163
|
</view>
|
|
159
164
|
</view>
|
|
160
165
|
</template>
|
|
@@ -162,7 +167,7 @@
|
|
|
162
167
|
<script>
|
|
163
168
|
import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
|
|
164
169
|
import { computed, ref, watch } from "vue";
|
|
165
|
-
import { classNames, stringifyStyle, createBem } from "../../utils";
|
|
170
|
+
import { classNames, stringifyStyle, createBem, isWeb } from "../../utils";
|
|
166
171
|
import SarIcon from "../icon/icon.vue";
|
|
167
172
|
import { useFormContext, useFormItemContext } from "../form/common";
|
|
168
173
|
import {
|
|
@@ -317,8 +322,10 @@ export default _defineComponent({
|
|
|
317
322
|
);
|
|
318
323
|
const onInput = (event) => {
|
|
319
324
|
let value = event.detail.value;
|
|
320
|
-
if (
|
|
321
|
-
|
|
325
|
+
if (!isWeb) {
|
|
326
|
+
if (props.maxlength >= 0) {
|
|
327
|
+
value = value.slice(0, props.maxlength);
|
|
328
|
+
}
|
|
322
329
|
}
|
|
323
330
|
setInnerValue(value);
|
|
324
331
|
return value;
|
|
@@ -380,6 +387,9 @@ export default _defineComponent({
|
|
|
380
387
|
const onClick = (event) => {
|
|
381
388
|
emit("click", event);
|
|
382
389
|
};
|
|
390
|
+
const maxLength = computed(() => {
|
|
391
|
+
return isWeb ? props.maxlength : -1;
|
|
392
|
+
});
|
|
383
393
|
const isPlainText = ref(false);
|
|
384
394
|
const eyeIcon = computed(() => isPlainText.value ? "eye" : "eye-slash");
|
|
385
395
|
const onEyeClick = () => {
|
|
@@ -430,7 +440,7 @@ export default _defineComponent({
|
|
|
430
440
|
return oldValue;
|
|
431
441
|
}, set oldValue(v) {
|
|
432
442
|
oldValue = v;
|
|
433
|
-
}, onFocus, onBlur, clearVisible, holdupClear, onClearTouchStart, onClearTouchEnd, onClearMouseDown, onClearClick, onLinechange, onConfirm, onKeyboardheightchange, onClick, isPlainText, eyeIcon, onEyeClick, showPassword, mergedType, mergedShowEye, inputClass, inputStyle, controlStyle, mergedPlaceholderStyle, get classNames() {
|
|
443
|
+
}, onFocus, onBlur, clearVisible, holdupClear, onClearTouchStart, onClearTouchEnd, onClearMouseDown, onClearClick, onLinechange, onConfirm, onKeyboardheightchange, onClick, maxLength, isPlainText, eyeIcon, onEyeClick, showPassword, mergedType, mergedShowEye, inputClass, inputStyle, controlStyle, mergedPlaceholderStyle, get classNames() {
|
|
434
444
|
return classNames;
|
|
435
445
|
}, SarIcon };
|
|
436
446
|
return __returned__;
|
|
@@ -121,6 +121,7 @@ import SarIcon from "../icon/icon.vue";
|
|
|
121
121
|
import SarCheckbox from "../checkbox/checkbox.vue";
|
|
122
122
|
import SarRadio from "../radio/radio.vue";
|
|
123
123
|
import SarPopover from "../popover/popover.vue";
|
|
124
|
+
import SarLoading from "../loading/loading.vue";
|
|
124
125
|
import { usePopover } from "../popover";
|
|
125
126
|
import { getNodeLevel, recurDescendant } from "../tree/utils";
|
|
126
127
|
export default _defineComponent({
|
|
@@ -129,6 +130,7 @@ export default _defineComponent({
|
|
|
129
130
|
SarCheckbox,
|
|
130
131
|
SarRadio,
|
|
131
132
|
SarPopover,
|
|
133
|
+
SarLoading,
|
|
132
134
|
},
|
|
133
135
|
...{
|
|
134
136
|
name: "SarTreeNode",
|
|
@@ -412,7 +414,7 @@ export default _defineComponent({
|
|
|
412
414
|
return obviousNodes;
|
|
413
415
|
}, set obviousNodes(v) {
|
|
414
416
|
obviousNodes = v;
|
|
415
|
-
}, onDragStart, onDragMove, onDragEnd, onDragSimulatedClickTouchStart, onDragSimulatedClickTouchEnd, onDragSimulatedPressTouchStart, onDragSimulatedPressTouchMove, onDragSimulatedPressTouchEnd, onDragTouchStart, onDragTouchMove, onDragTouchEnd, onDragMouseDown, dragId, popover, isLastNode, popoverOptions, onPopoverSelect, isMergedLeaf, onNodeClick, nodeActive, onNodeTouchStart, onNodeTouchEnd, onNodeMouseDown, canSingleSelectable, isSingleChecked, onSelectionTouchStart, onSelectionTouchEnd, onSelectionMouseDown, editId, getEditRect, onEditTouchStart, onEditTouchEnd, onEditMouseDown, nodeClass, nodeStyle, editClass, indentStyle, arrowClass, selectionClass, SarIcon, SarCheckbox, SarRadio, SarPopover };
|
|
417
|
+
}, onDragStart, onDragMove, onDragEnd, onDragSimulatedClickTouchStart, onDragSimulatedClickTouchEnd, onDragSimulatedPressTouchStart, onDragSimulatedPressTouchMove, onDragSimulatedPressTouchEnd, onDragTouchStart, onDragTouchMove, onDragTouchEnd, onDragMouseDown, dragId, popover, isLastNode, popoverOptions, onPopoverSelect, isMergedLeaf, onNodeClick, nodeActive, onNodeTouchStart, onNodeTouchEnd, onNodeMouseDown, canSingleSelectable, isSingleChecked, onSelectionTouchStart, onSelectionTouchEnd, onSelectionMouseDown, editId, getEditRect, onEditTouchStart, onEditTouchEnd, onEditMouseDown, nodeClass, nodeStyle, editClass, indentStyle, arrowClass, selectionClass, SarIcon, SarCheckbox, SarRadio, SarPopover, SarLoading };
|
|
416
418
|
return __returned__;
|
|
417
419
|
}
|
|
418
420
|
});
|
|
@@ -205,7 +205,12 @@ export default _defineComponent({
|
|
|
205
205
|
destHeight: clipHeight,
|
|
206
206
|
canvasId,
|
|
207
207
|
success(res) {
|
|
208
|
+
// #ifdef MP-WEIXIN
|
|
209
|
+
dataURL.value = "data:image/png;base64," + uni.getFileSystemManager().readFileSync(res.tempFilePath, "base64");
|
|
210
|
+
// #endif
|
|
211
|
+
// #ifndef MP-WEIXIN
|
|
208
212
|
dataURL.value = res.tempFilePath;
|
|
213
|
+
// #endif
|
|
209
214
|
}
|
|
210
215
|
},
|
|
211
216
|
instance
|