sard-uniapp 1.11.0 → 1.11.2
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 +18 -0
- package/README.md +2 -1
- package/components/datetime-picker-input/datetime-picker-input.vue +16 -1
- package/components/datetime-range-picker-input/datetime-range-picker-input.vue +1 -0
- package/components/picker-input/picker-input.vue +1 -0
- package/components/popout/common.d.ts +1 -0
- package/components/popout/popout.vue +3 -1
- package/components/popup/common.d.ts +1 -0
- package/components/popup/index.scss +24 -4
- package/components/popup/popup.vue +13 -5
- package/components/tree/tree.vue +6 -4
- package/components/tree-node/tree-node.vue +9 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## [1.11.2](https://github.com/sutras/sard-uniapp/compare/v1.11.1...v1.11.2) (2025-03-06)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* 修复tree组件递归引用问题 ([25c48b7](https://github.com/sutras/sard-uniapp/commit/25c48b7d57fd178ea9a08688757da41b1394d297))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## [1.11.1](https://github.com/sutras/sard-uniapp/compare/v1.11.0...v1.11.1) (2025-03-06)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* 修复日期时间选择器min, max联动问题 ([81d9256](https://github.com/sutras/sard-uniapp/commit/81d9256c872b5711664abf1e8ff75de3b146f3da))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
1
19
|
# [1.11.0](https://github.com/sutras/sard-uniapp/compare/v1.10.4...v1.11.0) (2025-03-04)
|
|
2
20
|
|
|
3
21
|
|
package/README.md
CHANGED
|
@@ -114,7 +114,8 @@ npm run release
|
|
|
114
114
|
- 修复问题
|
|
115
115
|
- 测试
|
|
116
116
|
- 修改版本号
|
|
117
|
-
-
|
|
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'`
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
<sar-popout
|
|
13
13
|
:root-class="rootClass"
|
|
14
14
|
:root-style="rootStyle"
|
|
15
|
+
keep-render
|
|
15
16
|
:visible="innerVisible"
|
|
16
17
|
@update:visible="onVisible"
|
|
17
18
|
:title="title ?? placeholder"
|
|
@@ -116,6 +117,20 @@ export default _defineComponent({
|
|
|
116
117
|
const maxDate2 = toDate(props.max || getMaxDate());
|
|
117
118
|
return maxDate2 < minDate.value ? new Date(minDate.value) : maxDate2;
|
|
118
119
|
});
|
|
120
|
+
const normalizeValue = (value) => {
|
|
121
|
+
const date = value ? toDate(value, props.valueFormat) : new Date();
|
|
122
|
+
return date < minDate.value ? new Date(minDate.value) : date > maxDate.value ? new Date(maxDate.value) : date;
|
|
123
|
+
};
|
|
124
|
+
watch([minDate, maxDate], () => {
|
|
125
|
+
if (innerValue.value) {
|
|
126
|
+
const oldDate = toDate(innerValue.value, props.valueFormat);
|
|
127
|
+
const value = normalizeValue(innerValue.value);
|
|
128
|
+
if (value.getTime() !== oldDate.getTime()) {
|
|
129
|
+
popoutValue.value = value;
|
|
130
|
+
onConfirm();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
});
|
|
119
134
|
const onConfirm = () => {
|
|
120
135
|
if (!popoutValue.value) {
|
|
121
136
|
const initialValue = getInitialValue(minDate.value, maxDate.value);
|
|
@@ -175,7 +190,7 @@ export default _defineComponent({
|
|
|
175
190
|
innerVisible.value = true;
|
|
176
191
|
emit("update:visible", true);
|
|
177
192
|
};
|
|
178
|
-
const __returned__ = { props, emit, formItemContext, innerValue, popoutValue, onChange, onVisibleHook, minDate, maxDate, onConfirm, inputValue, getOutletText, getInputValue, onClear, innerVisible, onVisible, onInputClick, SarPopoutInput, SarPopout, SarDatetimePicker };
|
|
193
|
+
const __returned__ = { props, emit, formItemContext, innerValue, popoutValue, onChange, onVisibleHook, minDate, maxDate, normalizeValue, onConfirm, inputValue, getOutletText, getInputValue, onClear, innerVisible, onVisible, onInputClick, SarPopoutInput, SarPopout, SarDatetimePicker };
|
|
179
194
|
return __returned__;
|
|
180
195
|
}
|
|
181
196
|
});
|
|
@@ -16,6 +16,7 @@ export interface PopoutProps {
|
|
|
16
16
|
showFooter?: boolean;
|
|
17
17
|
overlayClosable?: boolean;
|
|
18
18
|
beforeClose?: (type: 'close' | 'cancel' | 'confirm') => boolean | undefined | Promise<any>;
|
|
19
|
+
keepRender?: boolean;
|
|
19
20
|
}
|
|
20
21
|
export declare const defaultPopoutProps: {
|
|
21
22
|
type: PopoutProps["type"];
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
effect="slide-bottom"
|
|
4
4
|
:visible="visible"
|
|
5
5
|
:duration="duration"
|
|
6
|
+
:keep-render="keepRender"
|
|
6
7
|
@overlay-click="onOverlayClick"
|
|
7
8
|
@before-enter="onBeforeEnter"
|
|
8
9
|
@after-leave="onAfterLeave"
|
|
@@ -126,7 +127,8 @@ export default _defineComponent({
|
|
|
126
127
|
showClose: { type: Boolean, required: false },
|
|
127
128
|
showFooter: { type: Boolean, required: false },
|
|
128
129
|
overlayClosable: { type: Boolean, required: false },
|
|
129
|
-
beforeClose: { type: Function, required: false }
|
|
130
|
+
beforeClose: { type: Function, required: false },
|
|
131
|
+
keepRender: { type: Boolean, required: false }
|
|
130
132
|
}, defaultPopoutProps),
|
|
131
133
|
emits: ["update:visible", "close", "cancel", "confirm", "visible-hook"],
|
|
132
134
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -76,19 +76,39 @@
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
// slide
|
|
79
|
-
@include m(
|
|
79
|
+
@include m(
|
|
80
|
+
slide-top-enter-from,
|
|
81
|
+
slide-top-leave-to,
|
|
82
|
+
slide-top-keep,
|
|
83
|
+
slide-top-after-leave-keep
|
|
84
|
+
) {
|
|
80
85
|
transform: translate3d(0, -100%, 0);
|
|
81
86
|
}
|
|
82
87
|
|
|
83
|
-
@include m(
|
|
88
|
+
@include m(
|
|
89
|
+
slide-right-enter-from,
|
|
90
|
+
slide-right-leave-to,
|
|
91
|
+
slide-right-keep,
|
|
92
|
+
slide-right-after-leave-keep
|
|
93
|
+
) {
|
|
84
94
|
transform: translate3d(100%, 0, 0);
|
|
85
95
|
}
|
|
86
96
|
|
|
87
|
-
@include m(
|
|
97
|
+
@include m(
|
|
98
|
+
slide-bottom-enter-from,
|
|
99
|
+
slide-bottom-leave-to,
|
|
100
|
+
slide-bottom-keep,
|
|
101
|
+
slide-bottom-after-leave-keep
|
|
102
|
+
) {
|
|
88
103
|
transform: translate3d(0, 100%, 0);
|
|
89
104
|
}
|
|
90
105
|
|
|
91
|
-
@include m(
|
|
106
|
+
@include m(
|
|
107
|
+
slide-left-enter-from,
|
|
108
|
+
slide-left-leave-to,
|
|
109
|
+
slide-left-keep,
|
|
110
|
+
slide-left-after-leave-keep
|
|
111
|
+
) {
|
|
92
112
|
transform: translate3d(-100%, 0, 0);
|
|
93
113
|
}
|
|
94
114
|
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
<script>
|
|
23
23
|
import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
|
|
24
|
-
import { computed, reactive, toRef } from "vue";
|
|
24
|
+
import { computed, reactive, ref, toRef } from "vue";
|
|
25
25
|
import { classNames, stringifyStyle, createBem } from "../../utils";
|
|
26
26
|
import { useTransition, useZIndex } from "../../use";
|
|
27
27
|
import SarOverlay from "../overlay/overlay.vue";
|
|
@@ -50,7 +50,8 @@ export default _defineComponent({
|
|
|
50
50
|
overlayClass: { type: String, required: false },
|
|
51
51
|
overlayStyle: { type: String, required: false },
|
|
52
52
|
background: { type: String, required: false },
|
|
53
|
-
transparent: { type: Boolean, required: false }
|
|
53
|
+
transparent: { type: Boolean, required: false },
|
|
54
|
+
keepRender: { type: Boolean, required: false }
|
|
54
55
|
}, defaultPopupProps),
|
|
55
56
|
emits: ["overlay-click", "before-enter", "enter", "after-enter", "enter-cancelled", "before-leave", "leave", "after-leave", "leave-cancelled", "visible-hook"],
|
|
56
57
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -60,6 +61,9 @@ export default _defineComponent({
|
|
|
60
61
|
const bem = createBem("popup");
|
|
61
62
|
const [zIndex, increaseZIndex] = useZIndex();
|
|
62
63
|
const callVisibleHook = usePopupVisibleHookProvide();
|
|
64
|
+
const keepRenderClass = ref(
|
|
65
|
+
props.keepRender ? bem.m(props.effect) + "-keep" : ""
|
|
66
|
+
);
|
|
63
67
|
const onVisibleHook = (name) => {
|
|
64
68
|
callVisibleHook(name);
|
|
65
69
|
emit("visible-hook", name);
|
|
@@ -67,6 +71,9 @@ export default _defineComponent({
|
|
|
67
71
|
if (name === "before-enter") {
|
|
68
72
|
increaseZIndex();
|
|
69
73
|
}
|
|
74
|
+
if (props.keepRender) {
|
|
75
|
+
keepRenderClass.value = name === "after-leave" ? bem.m(props.effect) + "-" + name + "-keep" : "";
|
|
76
|
+
}
|
|
70
77
|
};
|
|
71
78
|
const { realVisible, transitionClass, onTransitionEnd } = useTransition(
|
|
72
79
|
reactive({
|
|
@@ -84,17 +91,18 @@ export default _defineComponent({
|
|
|
84
91
|
bem.b(),
|
|
85
92
|
bem.m(props.effect),
|
|
86
93
|
props.rootClass,
|
|
87
|
-
transitionClass.value
|
|
94
|
+
transitionClass.value,
|
|
95
|
+
keepRenderClass.value
|
|
88
96
|
);
|
|
89
97
|
});
|
|
90
98
|
const popupStyle = computed(() => {
|
|
91
99
|
return stringifyStyle(props.rootStyle, {
|
|
92
100
|
zIndex: zIndex.value,
|
|
93
|
-
display: realVisible.value ? "flex" : "none",
|
|
101
|
+
display: props.keepRender || realVisible.value ? "flex" : "none",
|
|
94
102
|
transitionDuration: props.duration + "ms"
|
|
95
103
|
});
|
|
96
104
|
});
|
|
97
|
-
const __returned__ = { props, emit, bem, zIndex, increaseZIndex, callVisibleHook, onVisibleHook, realVisible, transitionClass, onTransitionEnd, onOverlayClick, popupClass, popupStyle, SarOverlay };
|
|
105
|
+
const __returned__ = { props, emit, bem, zIndex, increaseZIndex, callVisibleHook, keepRenderClass, onVisibleHook, realVisible, transitionClass, onTransitionEnd, onOverlayClick, popupClass, popupStyle, SarOverlay };
|
|
98
106
|
return __returned__;
|
|
99
107
|
}
|
|
100
108
|
});
|
package/components/tree/tree.vue
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view :class="treeClass" :style="treeStyle">
|
|
3
|
-
<
|
|
3
|
+
<template v-for="(node, index) of treeData" :key="node.key">
|
|
4
|
+
<sar-tree-node v-if="node.visible" :index="index" :node="node" />
|
|
5
|
+
</template>
|
|
4
6
|
</view>
|
|
5
7
|
|
|
6
8
|
<sar-popover
|
|
@@ -45,7 +47,7 @@ import {
|
|
|
45
47
|
treeContextSymbol,
|
|
46
48
|
defaultTreeProps
|
|
47
49
|
} from "./common";
|
|
48
|
-
import
|
|
50
|
+
import SarTreeNode from "../tree-node/tree-node.vue";
|
|
49
51
|
import SarPopover from "../popover/popover.vue";
|
|
50
52
|
import { usePopover } from "../popover";
|
|
51
53
|
import SarInput from "../input/input.vue";
|
|
@@ -55,7 +57,7 @@ import { useTranslate } from "../locale";
|
|
|
55
57
|
import { recurAncestor, recurDescendant, recurNodes } from "./utils";
|
|
56
58
|
export default _defineComponent({
|
|
57
59
|
components: {
|
|
58
|
-
|
|
60
|
+
SarTreeNode,
|
|
59
61
|
SarPopover,
|
|
60
62
|
SarInput,
|
|
61
63
|
SarDialog,
|
|
@@ -552,7 +554,7 @@ export default _defineComponent({
|
|
|
552
554
|
return currentEditNode;
|
|
553
555
|
}, set currentEditNode(v) {
|
|
554
556
|
currentEditNode = v;
|
|
555
|
-
}, currentEditType, currentEditValue, mapEditTypeTitle, currentEditTitle, dialogVisible, toastVisible, onPopoverSelect, beforeClose, edit, focused, onVisibleHook, defaultFilterMethod, filter, treeClass, treeStyle,
|
|
557
|
+
}, currentEditType, currentEditValue, mapEditTypeTitle, currentEditTitle, dialogVisible, toastVisible, onPopoverSelect, beforeClose, edit, focused, onVisibleHook, defaultFilterMethod, filter, treeClass, treeStyle, SarTreeNode, SarPopover, SarInput, SarDialog, SarToast };
|
|
556
558
|
return __returned__;
|
|
557
559
|
}
|
|
558
560
|
});
|
|
@@ -68,10 +68,13 @@
|
|
|
68
68
|
</view>
|
|
69
69
|
</view>
|
|
70
70
|
|
|
71
|
-
<
|
|
72
|
-
v-if="!isLeaf && node.expanded"
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
<template
|
|
72
|
+
v-if="!isLeaf && node.expanded && node.children && node.children.length > 0"
|
|
73
|
+
>
|
|
74
|
+
<template v-for="(node, index) of node.children" :key="node.key">
|
|
75
|
+
<sar-tree-node v-if="node.visible" :index="index" :node="node" />
|
|
76
|
+
</template>
|
|
77
|
+
</template>
|
|
75
78
|
|
|
76
79
|
<sar-popover
|
|
77
80
|
v-if="treeContext.draggable"
|
|
@@ -99,7 +102,6 @@ import {
|
|
|
99
102
|
treeContextSymbol
|
|
100
103
|
} from "../tree/common";
|
|
101
104
|
import { useMouseDown, useSimulatedClick, useSimulatedPress } from "../../use";
|
|
102
|
-
import SarTreeBranch from "../tree-branch/tree-branch.vue";
|
|
103
105
|
import SarIcon from "../icon/icon.vue";
|
|
104
106
|
import SarCheckbox from "../checkbox/checkbox.vue";
|
|
105
107
|
import SarPopover from "../popover/popover.vue";
|
|
@@ -107,12 +109,12 @@ import { usePopover } from "../popover";
|
|
|
107
109
|
import { getNodeLevel, recurDescendant } from "../tree/utils";
|
|
108
110
|
export default _defineComponent({
|
|
109
111
|
components: {
|
|
110
|
-
SarTreeBranch,
|
|
111
112
|
SarIcon,
|
|
112
113
|
SarCheckbox,
|
|
113
114
|
SarPopover,
|
|
114
115
|
},
|
|
115
116
|
...{
|
|
117
|
+
name: "SarTreeNode",
|
|
116
118
|
options: {
|
|
117
119
|
virtualHost: true,
|
|
118
120
|
styleIsolation: "shared"
|
|
@@ -353,7 +355,7 @@ export default _defineComponent({
|
|
|
353
355
|
return obviousNodes;
|
|
354
356
|
}, set obviousNodes(v) {
|
|
355
357
|
obviousNodes = v;
|
|
356
|
-
}, onDragStart, onDragMove, onDragEnd, onDragSimulatedClickTouchStart, onDragSimulatedClickTouchEnd, onDragSimulatedPressTouchStart, onDragSimulatedPressTouchMove, onDragSimulatedPressTouchEnd, onDragTouchStart, onDragTouchMove, onDragTouchEnd, onDragMouseDown, dragId, popover, isLastNode, popoverOptions, onPopoverSelect, isLeaf, onNodeClick, nodeActive, onNodeTouchStart, onNodeTouchEnd, onNodeMouseDown, onSelectionTouchStart, onSelectionTouchEnd, onSelectionMouseDown, editId, getEditRect, onEditTouchStart, onEditTouchEnd, onEditMouseDown, nodeClass, nodeStyle, editClass, indentStyle, arrowClass, selectionClass,
|
|
358
|
+
}, onDragStart, onDragMove, onDragEnd, onDragSimulatedClickTouchStart, onDragSimulatedClickTouchEnd, onDragSimulatedPressTouchStart, onDragSimulatedPressTouchMove, onDragSimulatedPressTouchEnd, onDragTouchStart, onDragTouchMove, onDragTouchEnd, onDragMouseDown, dragId, popover, isLastNode, popoverOptions, onPopoverSelect, isLeaf, onNodeClick, nodeActive, onNodeTouchStart, onNodeTouchEnd, onNodeMouseDown, onSelectionTouchStart, onSelectionTouchEnd, onSelectionMouseDown, editId, getEditRect, onEditTouchStart, onEditTouchEnd, onEditMouseDown, nodeClass, nodeStyle, editClass, indentStyle, arrowClass, selectionClass, SarIcon, SarCheckbox, SarPopover };
|
|
357
359
|
return __returned__;
|
|
358
360
|
}
|
|
359
361
|
});
|