sard-uniapp 1.25.4 → 1.25.6
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 +25 -0
- package/components/accordion/accordion.vue +1 -1
- package/components/accordion-item/accordion-item.vue +1 -1
- package/components/action-sheet/README.md +106 -12
- package/components/action-sheet/action-sheet.d.ts +2 -1
- package/components/action-sheet/action-sheet.vue +42 -12
- package/components/action-sheet/common.d.ts +51 -12
- package/components/action-sheet-agent/action-sheet-agent.d.ts +35 -0
- package/components/action-sheet-agent/action-sheet-agent.vue +194 -0
- package/components/action-sheet-agent/common.d.ts +613 -0
- package/components/action-sheet-agent/common.js +35 -0
- package/components/action-sheet-agent/index.d.ts +1 -0
- package/components/action-sheet-agent/index.js +1 -0
- package/components/alert/alert.vue +1 -1
- package/components/avatar/avatar.vue +1 -1
- package/components/avatar-group/avatar-group.vue +1 -1
- package/components/back-top/back-top.vue +1 -1
- package/components/badge/badge.vue +1 -1
- package/components/button/button.vue +1 -1
- package/components/calendar/calendar.vue +1 -1
- package/components/calendar-input/calendar-input.vue +2 -2
- package/components/calendar-popout/calendar-popout.vue +2 -2
- package/components/card/card.vue +1 -1
- package/components/cascader/README.md +89 -18
- package/components/cascader/cascader.d.ts +6 -6
- package/components/cascader/cascader.vue +201 -182
- package/components/cascader/common.d.ts +32 -7
- package/components/cascader/common.js +39 -23
- package/components/cascader/index.d.ts +1 -1
- package/components/cascader/index.scss +40 -4
- package/components/cascader/useCascaderTabs.d.ts +12 -0
- package/components/cascader/useCascaderTabs.js +59 -0
- package/components/cascader/useCascaderTree.d.ts +66 -0
- package/components/cascader/useCascaderTree.js +194 -0
- package/components/cascader/variables.scss +9 -2
- package/components/cascader-input/README.md +26 -13
- package/components/cascader-input/cascader-input.d.ts +7 -2
- package/components/cascader-input/cascader-input.vue +70 -16
- package/components/cascader-input/common.d.ts +356 -30
- package/components/cascader-popout/README.md +6 -0
- package/components/cascader-popout/cascader-popout.d.ts +5 -1
- package/components/cascader-popout/cascader-popout.vue +16 -4
- package/components/cascader-popout/common.d.ts +169 -17
- package/components/check-icon/check-icon.vue +1 -1
- package/components/checkbox/checkbox.d.ts +2 -2
- package/components/checkbox/checkbox.vue +1 -1
- package/components/checkbox-group/checkbox-group.vue +1 -1
- package/components/checkbox-input/checkbox-input.vue +2 -2
- package/components/checkbox-popout/checkbox-popout.vue +2 -2
- package/components/col/col.vue +1 -1
- package/components/collapse/collapse.vue +1 -1
- package/components/config/index.d.ts +2 -0
- package/components/config/index.js +7 -1
- package/components/cool-icon/cool-icon.vue +1 -1
- package/components/count-down/count-down.vue +1 -1
- package/components/crop-image/crop-image.vue +1 -1
- package/components/crop-image-agent/crop-image-agent.vue +1 -1
- package/components/datetime-picker/datetime-picker.vue +1 -1
- package/components/datetime-picker-input/datetime-picker-input.vue +2 -2
- package/components/datetime-picker-popout/datetime-picker-popout.vue +2 -2
- package/components/datetime-range-picker/datetime-range-picker.vue +1 -1
- package/components/datetime-range-picker-input/datetime-range-picker-input.vue +2 -2
- package/components/datetime-range-picker-popout/datetime-range-picker-popout.vue +2 -2
- package/components/dialog/dialog.d.ts +1 -1
- package/components/dialog/dialog.vue +7 -7
- package/components/dialog-agent/dialog-agent.d.ts +11 -11
- package/components/dialog-agent/dialog-agent.vue +2 -2
- package/components/divider/divider.vue +1 -1
- package/components/dnd/dnd.vue +1 -1
- package/components/dnd-handle/dnd-handle.vue +1 -1
- package/components/dnd-item/dnd-item.vue +1 -1
- package/components/dropdown/dropdown.vue +1 -1
- package/components/dropdown-item/dropdown-item.vue +7 -2
- package/components/empty/empty.vue +1 -1
- package/components/fab/fab.vue +1 -1
- package/components/fab-item/fab-item.vue +1 -1
- package/components/floating-bubble/floating-bubble.vue +1 -1
- package/components/floating-panel/floating-panel.vue +1 -1
- package/components/form/form.vue +1 -1
- package/components/form-item/form-item.vue +1 -1
- package/components/form-item-plain/form-item-plain.vue +1 -1
- package/components/form-plain/form-plain.vue +1 -1
- package/components/grid/grid.vue +1 -1
- package/components/grid-item/grid-item.vue +2 -2
- package/components/icon/icon.vue +1 -1
- package/components/icon/sari.scss +17 -17
- package/components/image/image.vue +10 -4
- package/components/indexes/indexes.vue +1 -1
- package/components/indexes-anchor/indexes-anchor.vue +1 -1
- package/components/input/input.vue +1 -1
- package/components/keyboard/keyboard.vue +1 -1
- package/components/list/list.vue +1 -1
- package/components/list-item/list-item.vue +1 -1
- package/components/load-more/load-more.vue +1 -1
- package/components/loading/loading.vue +1 -1
- package/components/locale/lang/ar-SA.d.ts +5 -0
- package/components/locale/lang/ar-SA.js +5 -0
- package/components/locale/lang/en-US.d.ts +5 -0
- package/components/locale/lang/en-US.js +5 -0
- package/components/locale/lang/vi-VN.d.ts +5 -0
- package/components/locale/lang/vi-VN.js +5 -0
- package/components/locale/lang/zh-CN.d.ts +5 -0
- package/components/locale/lang/zh-CN.js +5 -0
- package/components/marquee/marquee.vue +1 -1
- package/components/menu/menu.vue +1 -1
- package/components/navbar/navbar.vue +2 -2
- package/components/navbar-item/navbar-item.vue +1 -1
- package/components/navbar-pit/navbar-pit.vue +1 -1
- package/components/notice-bar/notice-bar.vue +1 -1
- package/components/notify/notify.vue +2 -1
- package/components/notify-agent/notify-agent.d.ts +1 -1
- package/components/notify-agent/notify-agent.vue +1 -1
- package/components/overlay/overlay.vue +1 -1
- package/components/pagination/pagination.vue +1 -1
- package/components/password-input/password-input.vue +1 -1
- package/components/picker/picker.vue +1 -1
- package/components/picker-input/picker-input.vue +2 -2
- package/components/picker-item/picker-item.vue +1 -1
- package/components/picker-popout/picker-popout.vue +2 -2
- package/components/popout/popout.d.ts +1 -1
- package/components/popout/popout.vue +1 -1
- package/components/popout-input/popout-input.vue +1 -1
- package/components/popover/popover.vue +3 -2
- package/components/popover-reference/popover-reference.vue +1 -1
- package/components/popup/README.md +1 -0
- package/components/popup/common.d.ts +28 -0
- package/components/popup/index.scss +4 -2
- package/components/popup/popup.d.ts +1 -0
- package/components/popup/popup.vue +82 -16
- package/components/popup/variables.scss +6 -0
- package/components/progress-bar/progress-bar.vue +1 -1
- package/components/progress-circle/progress-circle.vue +1 -1
- package/components/pull-down-refresh/pull-down-refresh.vue +1 -1
- package/components/qrcode/qrcode.vue +6 -5
- package/components/radio/radio.vue +1 -1
- package/components/radio-group/radio-group.vue +1 -1
- package/components/radio-input/radio-input.vue +2 -2
- package/components/radio-popout/radio-popout.vue +2 -2
- package/components/rate/rate.vue +1 -1
- package/components/read-more/read-more.vue +1 -1
- package/components/resize-sensor/index.scss +7 -0
- package/components/resize-sensor/resize-sensor.vue +10 -3
- package/components/result/result.vue +1 -1
- package/components/row/row.vue +1 -1
- package/components/scroll-list/scroll-list.vue +1 -1
- package/components/scroll-spy/scroll-spy.vue +1 -1
- package/components/scroll-spy-anchor/scroll-spy-anchor.vue +1 -1
- package/components/search/search.vue +1 -1
- package/components/segmented/segmented.vue +1 -1
- package/components/segmented-item/segmented-item.vue +1 -1
- package/components/share-sheet/share-sheet.vue +2 -1
- package/components/sidebar/sidebar.vue +1 -1
- package/components/sidebar-item/sidebar-item.vue +1 -1
- package/components/signature/signature.vue +1 -1
- package/components/skeleton/skeleton.vue +1 -1
- package/components/skeleton-avatar/skeleton-avatar.vue +1 -1
- package/components/skeleton-block/skeleton-block.vue +1 -1
- package/components/skeleton-paragraph/skeleton-paragraph.vue +1 -1
- package/components/skeleton-title/skeleton-title.vue +1 -1
- package/components/slider/slider.vue +1 -1
- package/components/space/space.vue +1 -1
- package/components/status-bar/status-bar.vue +1 -1
- package/components/step/step.vue +1 -1
- package/components/stepper/stepper.vue +1 -1
- package/components/steps/steps.vue +1 -1
- package/components/sticky/sticky.vue +1 -1
- package/components/sticky-box/sticky-box.vue +1 -1
- package/components/swipe-action/swipe-action.vue +1 -1
- package/components/swiper-dot/swiper-dot.vue +1 -1
- package/components/switch/switch.vue +1 -1
- package/components/tab/tab.vue +1 -1
- package/components/tabbar/tabbar.vue +1 -1
- package/components/tabbar-item/tabbar-item.vue +1 -1
- package/components/tabbar-pit/tabbar-pit.vue +1 -1
- package/components/table/table.vue +1 -1
- package/components/table-cell/table-cell.vue +1 -1
- package/components/table-fixation/table-fixation.vue +1 -1
- package/components/table-row/table-row.vue +1 -1
- package/components/tabs/tabs.vue +1 -1
- package/components/tag/tag.vue +1 -1
- package/components/timeline/timeline.vue +1 -1
- package/components/timeline-item/timeline-item.vue +1 -1
- package/components/toast/toast.vue +2 -1
- package/components/toast-agent/toast-agent.vue +1 -1
- package/components/tree/README.md +0 -2
- package/components/tree/tree.d.ts +1 -1
- package/components/tree/tree.vue +36 -81
- package/components/tree-node/tree-node.vue +8 -4
- package/components/upload/upload.vue +1 -1
- package/components/upload-preview/upload-preview.vue +1 -1
- package/components/waterfall/waterfall.vue +1 -1
- package/components/waterfall-item/waterfall-item.vue +1 -1
- package/components/waterfall-load/waterfall-load.vue +1 -1
- package/components/watermark/watermark.vue +6 -8
- package/global.d.ts +2 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +2 -1
- package/use/index.d.ts +1 -0
- package/use/index.js +1 -0
- package/use/useLockScroll.d.ts +8 -0
- package/use/useLockScroll.js +88 -0
- package/utils/file.d.ts +6 -0
- package/utils/file.js +33 -11
- package/utils/index.d.ts +2 -0
- package/utils/index.js +2 -0
- package/utils/log.d.ts +1 -0
- package/utils/log.js +4 -0
- package/utils/router.js +2 -1
- package/utils/system.d.ts +2 -0
- package/utils/system.js +6 -1
- package/utils/tree.d.ts +18 -0
- package/utils/tree.js +94 -0
- package/components/tree/utils.d.ts +0 -5
- package/components/tree/utils.js +0 -29
|
@@ -45,7 +45,7 @@ export default _defineComponent({
|
|
|
45
45
|
},
|
|
46
46
|
__name: "switch",
|
|
47
47
|
props: _mergeDefaults({
|
|
48
|
-
rootStyle: { type:
|
|
48
|
+
rootStyle: { type: null, required: false },
|
|
49
49
|
rootClass: { type: String, required: false },
|
|
50
50
|
modelValue: { type: null, required: false },
|
|
51
51
|
disabled: { type: Boolean, required: false },
|
package/components/tab/tab.vue
CHANGED
|
@@ -38,7 +38,7 @@ export default _defineComponent({
|
|
|
38
38
|
},
|
|
39
39
|
__name: "tab",
|
|
40
40
|
props: {
|
|
41
|
-
rootStyle: { type:
|
|
41
|
+
rootStyle: { type: null, required: false },
|
|
42
42
|
rootClass: { type: String, required: false },
|
|
43
43
|
title: { type: String, required: false },
|
|
44
44
|
name: { type: [String, Number, Boolean], required: true },
|
|
@@ -33,7 +33,7 @@ export default _defineComponent({
|
|
|
33
33
|
},
|
|
34
34
|
__name: "tabbar",
|
|
35
35
|
props: _mergeDefaults({
|
|
36
|
-
rootStyle: { type:
|
|
36
|
+
rootStyle: { type: null, required: false },
|
|
37
37
|
rootClass: { type: String, required: false },
|
|
38
38
|
current: { type: [Number, String], required: false },
|
|
39
39
|
color: { type: String, required: false },
|
|
@@ -48,7 +48,7 @@ export default _defineComponent({
|
|
|
48
48
|
},
|
|
49
49
|
__name: "tabbar-item",
|
|
50
50
|
props: {
|
|
51
|
-
rootStyle: { type:
|
|
51
|
+
rootStyle: { type: null, required: false },
|
|
52
52
|
rootClass: { type: String, required: false },
|
|
53
53
|
name: { type: [String, Number], required: false },
|
|
54
54
|
icon: { type: String, required: false },
|
|
@@ -22,7 +22,7 @@ export default _defineComponent({
|
|
|
22
22
|
},
|
|
23
23
|
__name: "tabbar-pit",
|
|
24
24
|
props: {
|
|
25
|
-
rootStyle: { type:
|
|
25
|
+
rootStyle: { type: null, required: false },
|
|
26
26
|
rootClass: { type: String, required: false },
|
|
27
27
|
safeAreaInsetBottom: { type: Boolean, required: false }
|
|
28
28
|
},
|
|
@@ -57,7 +57,7 @@ export default _defineComponent({
|
|
|
57
57
|
},
|
|
58
58
|
__name: "table",
|
|
59
59
|
props: _mergeDefaults({
|
|
60
|
-
rootStyle: { type:
|
|
60
|
+
rootStyle: { type: null, required: false },
|
|
61
61
|
rootClass: { type: String, required: false },
|
|
62
62
|
bordered: { type: Boolean, required: false },
|
|
63
63
|
underline: { type: Boolean, required: false },
|
|
@@ -24,7 +24,7 @@ export default _defineComponent({
|
|
|
24
24
|
},
|
|
25
25
|
__name: "table-cell",
|
|
26
26
|
props: {
|
|
27
|
-
rootStyle: { type:
|
|
27
|
+
rootStyle: { type: null, required: false },
|
|
28
28
|
rootClass: { type: String, required: false },
|
|
29
29
|
width: { type: String, required: false },
|
|
30
30
|
bold: { type: Boolean, required: false },
|
|
@@ -42,7 +42,7 @@ export default _defineComponent({
|
|
|
42
42
|
},
|
|
43
43
|
__name: "table-fixation",
|
|
44
44
|
props: {
|
|
45
|
-
rootStyle: { type:
|
|
45
|
+
rootStyle: { type: null, required: false },
|
|
46
46
|
rootClass: { type: String, required: false },
|
|
47
47
|
tableWidth: { type: Number, required: false },
|
|
48
48
|
scrollY: { type: Boolean, required: false },
|
|
@@ -22,7 +22,7 @@ export default _defineComponent({
|
|
|
22
22
|
},
|
|
23
23
|
__name: "table-row",
|
|
24
24
|
props: {
|
|
25
|
-
rootStyle: { type:
|
|
25
|
+
rootStyle: { type: null, required: false },
|
|
26
26
|
rootClass: { type: String, required: false },
|
|
27
27
|
fixed: { type: Boolean, required: false }
|
|
28
28
|
},
|
package/components/tabs/tabs.vue
CHANGED
|
@@ -78,7 +78,7 @@ export default _defineComponent({
|
|
|
78
78
|
},
|
|
79
79
|
__name: "tabs",
|
|
80
80
|
props: _mergeDefaults({
|
|
81
|
-
rootStyle: { type:
|
|
81
|
+
rootStyle: { type: null, required: false },
|
|
82
82
|
rootClass: { type: String, required: false },
|
|
83
83
|
current: { type: [String, Number, Boolean], required: false },
|
|
84
84
|
list: { type: Array, required: false },
|
package/components/tag/tag.vue
CHANGED
|
@@ -45,7 +45,7 @@ export default _defineComponent({
|
|
|
45
45
|
},
|
|
46
46
|
__name: "tag",
|
|
47
47
|
props: _mergeDefaults({
|
|
48
|
-
rootStyle: { type:
|
|
48
|
+
rootStyle: { type: null, required: false },
|
|
49
49
|
rootClass: { type: String, required: false },
|
|
50
50
|
theme: { type: String, required: false },
|
|
51
51
|
plain: { type: Boolean, required: false },
|
|
@@ -21,7 +21,7 @@ export default _defineComponent({
|
|
|
21
21
|
},
|
|
22
22
|
__name: "timeline",
|
|
23
23
|
props: {
|
|
24
|
-
rootStyle: { type:
|
|
24
|
+
rootStyle: { type: null, required: false },
|
|
25
25
|
rootClass: { type: String, required: false }
|
|
26
26
|
},
|
|
27
27
|
setup(__props, { expose: __expose }) {
|
|
@@ -52,7 +52,7 @@ export default _defineComponent({
|
|
|
52
52
|
},
|
|
53
53
|
__name: "timeline-item",
|
|
54
54
|
props: {
|
|
55
|
-
rootStyle: { type:
|
|
55
|
+
rootStyle: { type: null, required: false },
|
|
56
56
|
rootClass: { type: String, required: false },
|
|
57
57
|
title: { type: String, required: false },
|
|
58
58
|
time: { type: String, required: false },
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
:duration="duration"
|
|
6
6
|
:transparent="transparent"
|
|
7
7
|
:root-style="popupStyle"
|
|
8
|
+
:lock-scroll="false"
|
|
8
9
|
effect="fade"
|
|
9
10
|
@visible-hook="onVisibleHook"
|
|
10
11
|
>
|
|
@@ -65,7 +66,7 @@ export default _defineComponent({
|
|
|
65
66
|
...__default__,
|
|
66
67
|
__name: "toast",
|
|
67
68
|
props: _mergeDefaults({
|
|
68
|
-
rootStyle: { type:
|
|
69
|
+
rootStyle: { type: null, required: false },
|
|
69
70
|
rootClass: { type: String, required: false },
|
|
70
71
|
type: { type: String, required: false },
|
|
71
72
|
title: { type: [String, Number], required: false },
|
|
@@ -76,7 +76,7 @@ export default _defineComponent({
|
|
|
76
76
|
__name: "toast-agent",
|
|
77
77
|
props: _mergeDefaults({
|
|
78
78
|
id: { type: String, required: false },
|
|
79
|
-
rootStyle: { type:
|
|
79
|
+
rootStyle: { type: null, required: false },
|
|
80
80
|
rootClass: { type: String, required: false },
|
|
81
81
|
type: { type: String, required: false },
|
|
82
82
|
title: { type: [String, Number], required: false },
|
|
@@ -40,6 +40,7 @@ declare const _default: import("vue").DefineComponent<TreeProps, {
|
|
|
40
40
|
rootStyle: string | false | import("vue").CSSProperties | import("vue").StyleValue[] | null;
|
|
41
41
|
rootClass: string;
|
|
42
42
|
accordion: boolean;
|
|
43
|
+
checkStrictly: boolean;
|
|
43
44
|
draggable: boolean;
|
|
44
45
|
current: string | number;
|
|
45
46
|
selectable: boolean;
|
|
@@ -49,7 +50,6 @@ declare const _default: import("vue").DefineComponent<TreeProps, {
|
|
|
49
50
|
nodeKeys: import("./common").TreeNodeKeys;
|
|
50
51
|
defaultExpandAll: boolean;
|
|
51
52
|
defaultExpandedKeys: (string | number)[];
|
|
52
|
-
checkStrictly: boolean;
|
|
53
53
|
defaultCheckedKeys: (string | number)[];
|
|
54
54
|
filterMode: "lenient" | "strict";
|
|
55
55
|
filterMethod: (value: string, node: TreeStateNode) => boolean;
|
package/components/tree/tree.vue
CHANGED
|
@@ -53,7 +53,15 @@ import {
|
|
|
53
53
|
classNames,
|
|
54
54
|
stringifyStyle,
|
|
55
55
|
createBem,
|
|
56
|
-
uniqid
|
|
56
|
+
uniqid,
|
|
57
|
+
walkAncestor,
|
|
58
|
+
walkNodes,
|
|
59
|
+
walkDescendant,
|
|
60
|
+
setCheckedRecursively,
|
|
61
|
+
updateAncestorsChecked,
|
|
62
|
+
initializeCheckNodes,
|
|
63
|
+
getTreeCheckedKeys,
|
|
64
|
+
getTreeHalfCheckedKeys
|
|
57
65
|
} from "../../utils";
|
|
58
66
|
import {
|
|
59
67
|
defaultNodeKeys,
|
|
@@ -68,7 +76,6 @@ import SarInput from "../input/input.vue";
|
|
|
68
76
|
import SarDialog from "../dialog/dialog.vue";
|
|
69
77
|
import SarToast from "../toast/toast.vue";
|
|
70
78
|
import { useTranslate } from "../locale";
|
|
71
|
-
import { recurAncestor, recurDescendant, recurNodes } from "./utils";
|
|
72
79
|
/**
|
|
73
80
|
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
74
81
|
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
@@ -111,7 +118,7 @@ export default _defineComponent({
|
|
|
111
118
|
},
|
|
112
119
|
__name: "tree",
|
|
113
120
|
props: _mergeDefaults({
|
|
114
|
-
rootStyle: { type:
|
|
121
|
+
rootStyle: { type: null, required: false },
|
|
115
122
|
rootClass: { type: String, required: false },
|
|
116
123
|
data: { type: Array, required: false },
|
|
117
124
|
nodeKeys: { type: Object, required: false },
|
|
@@ -171,7 +178,7 @@ export default _defineComponent({
|
|
|
171
178
|
const setExpandedByNode = (node, expanded, reflow = true) => {
|
|
172
179
|
node.expanded = expanded;
|
|
173
180
|
if (node.expanded) {
|
|
174
|
-
|
|
181
|
+
walkAncestor(node.parent, (node2) => {
|
|
175
182
|
node2.expanded = true;
|
|
176
183
|
});
|
|
177
184
|
if (props.accordion) {
|
|
@@ -203,7 +210,7 @@ export default _defineComponent({
|
|
|
203
210
|
}
|
|
204
211
|
};
|
|
205
212
|
const setExpandedKeys = (keys) => {
|
|
206
|
-
|
|
213
|
+
walkNodes(treeData.value, (node) => {
|
|
207
214
|
node.expanded = false;
|
|
208
215
|
});
|
|
209
216
|
keys.forEach((key) => {
|
|
@@ -216,57 +223,21 @@ export default _defineComponent({
|
|
|
216
223
|
};
|
|
217
224
|
const getExpandedKeys = () => {
|
|
218
225
|
const expandedKeys = [];
|
|
219
|
-
treeData.value
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
});
|
|
226
|
+
walkNodes(treeData.value, (node) => {
|
|
227
|
+
if (node.expanded) {
|
|
228
|
+
expandedKeys.push(node.key);
|
|
229
|
+
}
|
|
225
230
|
});
|
|
226
231
|
return expandedKeys;
|
|
227
232
|
};
|
|
228
233
|
const setCheckedByNode = (node, checked) => {
|
|
229
|
-
|
|
230
|
-
node.checked = checked;
|
|
231
|
-
} else {
|
|
232
|
-
recurDescendant(node, (node2) => {
|
|
233
|
-
node2.checked = checked;
|
|
234
|
-
node2.indeterminate = false;
|
|
235
|
-
});
|
|
236
|
-
updateAncestorChecked(node.parent);
|
|
237
|
-
}
|
|
234
|
+
setCheckedRecursively(node, checked, props.checkStrictly);
|
|
238
235
|
};
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
recurAncestor(parentNode, (node) => {
|
|
242
|
-
const children = node.children || [];
|
|
243
|
-
const numChecked = children.filter((node2) => node2.checked).length;
|
|
244
|
-
node.checked = numChecked > 0 && numChecked === children.length;
|
|
245
|
-
node.indeterminate = !node.checked && (numChecked > 0 || children.some((node2) => node2.indeterminate));
|
|
246
|
-
});
|
|
247
|
-
}
|
|
236
|
+
const bubbleChecked = (parentNode) => {
|
|
237
|
+
updateAncestorsChecked(parentNode, props.checkStrictly);
|
|
248
238
|
};
|
|
249
239
|
const setCheckedKeys = (keys) => {
|
|
250
|
-
|
|
251
|
-
const mapKeys = keys.reduce((map, key) => {
|
|
252
|
-
map[key] = true;
|
|
253
|
-
return map;
|
|
254
|
-
}, {});
|
|
255
|
-
recurNodes(treeData.value, (node) => {
|
|
256
|
-
node.checked = mapKeys[node.key] ? true : false;
|
|
257
|
-
});
|
|
258
|
-
} else {
|
|
259
|
-
recurNodes(treeData.value, (node) => {
|
|
260
|
-
node.checked = false;
|
|
261
|
-
node.indeterminate = false;
|
|
262
|
-
});
|
|
263
|
-
keys.forEach((key) => {
|
|
264
|
-
const node = treeMap[key];
|
|
265
|
-
if (node && !node.checked) {
|
|
266
|
-
setCheckedByNode(node, true);
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
}
|
|
240
|
+
initializeCheckNodes(treeData.value, treeMap, keys, props.checkStrictly);
|
|
270
241
|
};
|
|
271
242
|
const setChecked = (key, checked) => {
|
|
272
243
|
const node = treeMap[key];
|
|
@@ -275,34 +246,18 @@ export default _defineComponent({
|
|
|
275
246
|
}
|
|
276
247
|
};
|
|
277
248
|
const getCheckedKeys = () => {
|
|
278
|
-
|
|
279
|
-
treeData.value.forEach((node) => {
|
|
280
|
-
recurDescendant(node, (node2) => {
|
|
281
|
-
if (node2.checked) {
|
|
282
|
-
checkedKeys.push(node2.key);
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
});
|
|
286
|
-
return checkedKeys;
|
|
249
|
+
return getTreeCheckedKeys(treeData.value);
|
|
287
250
|
};
|
|
288
251
|
const getHalfCheckedKeys = () => {
|
|
289
|
-
|
|
290
|
-
treeData.value.forEach((node) => {
|
|
291
|
-
recurDescendant(node, (node2) => {
|
|
292
|
-
if (node2.indeterminate) {
|
|
293
|
-
halfCheckedKeys.push(node2.key);
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
});
|
|
297
|
-
return halfCheckedKeys;
|
|
252
|
+
return getTreeHalfCheckedKeys(treeData.value);
|
|
298
253
|
};
|
|
299
254
|
const prepend = (node, newNode) => {
|
|
300
255
|
const children = node.children ??= [];
|
|
301
256
|
children.unshift(newNode);
|
|
302
257
|
newNode.parent = node;
|
|
303
258
|
node.expanded = true;
|
|
304
|
-
|
|
305
|
-
|
|
259
|
+
bubbleChecked(node.parent);
|
|
260
|
+
walkDescendant(newNode, (node2) => {
|
|
306
261
|
treeMap[node2.key] = node2;
|
|
307
262
|
});
|
|
308
263
|
setRenderPosition();
|
|
@@ -312,8 +267,8 @@ export default _defineComponent({
|
|
|
312
267
|
children.push(newNode);
|
|
313
268
|
newNode.parent = node;
|
|
314
269
|
node.expanded = true;
|
|
315
|
-
|
|
316
|
-
|
|
270
|
+
bubbleChecked(node.parent);
|
|
271
|
+
walkDescendant(newNode, (node2) => {
|
|
317
272
|
treeMap[node2.key] = node2;
|
|
318
273
|
});
|
|
319
274
|
setRenderPosition();
|
|
@@ -321,7 +276,7 @@ export default _defineComponent({
|
|
|
321
276
|
const appendRoot = (newNode) => {
|
|
322
277
|
treeData.value.push(newNode);
|
|
323
278
|
newNode.parent = null;
|
|
324
|
-
|
|
279
|
+
walkDescendant(newNode, (node) => {
|
|
325
280
|
treeMap[node.key] = node;
|
|
326
281
|
});
|
|
327
282
|
setRenderPosition();
|
|
@@ -330,8 +285,8 @@ export default _defineComponent({
|
|
|
330
285
|
const siblings = node.parent ? node.parent.children : treeData.value;
|
|
331
286
|
siblings.splice(siblings.indexOf(node), 0, newNode);
|
|
332
287
|
newNode.parent = node.parent;
|
|
333
|
-
|
|
334
|
-
|
|
288
|
+
bubbleChecked(node.parent);
|
|
289
|
+
walkDescendant(newNode, (node2) => {
|
|
335
290
|
treeMap[node2.key] = node2;
|
|
336
291
|
});
|
|
337
292
|
setRenderPosition();
|
|
@@ -340,8 +295,8 @@ export default _defineComponent({
|
|
|
340
295
|
const siblings = node.parent ? node.parent.children : treeData.value;
|
|
341
296
|
siblings.splice(siblings.indexOf(node) + 1, 0, newNode);
|
|
342
297
|
newNode.parent = node.parent;
|
|
343
|
-
|
|
344
|
-
|
|
298
|
+
bubbleChecked(node.parent);
|
|
299
|
+
walkDescendant(newNode, (node2) => {
|
|
345
300
|
treeMap[node2.key] = node2;
|
|
346
301
|
});
|
|
347
302
|
setRenderPosition();
|
|
@@ -352,8 +307,8 @@ export default _defineComponent({
|
|
|
352
307
|
if (siblings.length === 0 && node.parent) {
|
|
353
308
|
node.parent.children = void 0;
|
|
354
309
|
}
|
|
355
|
-
|
|
356
|
-
|
|
310
|
+
bubbleChecked(node.parent);
|
|
311
|
+
walkDescendant(node, (node2) => {
|
|
357
312
|
delete treeMap[node2.key];
|
|
358
313
|
});
|
|
359
314
|
if (reflow) {
|
|
@@ -566,7 +521,7 @@ export default _defineComponent({
|
|
|
566
521
|
node.visible = filterMethod(searchString, node);
|
|
567
522
|
if (node.children) {
|
|
568
523
|
if (node.visible && props.filterMode === "lenient") {
|
|
569
|
-
|
|
524
|
+
walkNodes(node.children, (node2) => {
|
|
570
525
|
node2.visible = true;
|
|
571
526
|
});
|
|
572
527
|
} else {
|
|
@@ -577,7 +532,7 @@ export default _defineComponent({
|
|
|
577
532
|
}
|
|
578
533
|
}
|
|
579
534
|
if (node.visible) {
|
|
580
|
-
|
|
535
|
+
walkAncestor(node.parent, (node2) => {
|
|
581
536
|
node2.expanded = true;
|
|
582
537
|
});
|
|
583
538
|
}
|
|
@@ -658,7 +613,7 @@ export default _defineComponent({
|
|
|
658
613
|
return treeMap;
|
|
659
614
|
}, set treeMap(v) {
|
|
660
615
|
treeMap = v;
|
|
661
|
-
}, totalLevel, toTreeStateNodes, setExpandedByNode, toggleExpandedByNode, setExpanded, toggleExpanded, setExpandedKeys, getExpandedKeys, setCheckedByNode,
|
|
616
|
+
}, totalLevel, toTreeStateNodes, setExpandedByNode, toggleExpandedByNode, setExpanded, toggleExpanded, setExpandedKeys, getExpandedKeys, setCheckedByNode, bubbleChecked, setCheckedKeys, setChecked, getCheckedKeys, getHalfCheckedKeys, prepend, append, appendRoot, before, after, remove, levelup, leveldown, drop, addRootNode, getCleanTreeData, setRenderPosition, toggleCheck, loadStatus, initialize, initializeTree, onErrorClick, popoverOptions, popover, get currentEditNode() {
|
|
662
617
|
return currentEditNode;
|
|
663
618
|
}, set currentEditNode(v) {
|
|
664
619
|
currentEditNode = v;
|
|
@@ -111,7 +111,9 @@ import {
|
|
|
111
111
|
getBoundingClientRect,
|
|
112
112
|
clamp,
|
|
113
113
|
stringifyStyle,
|
|
114
|
-
uniqid
|
|
114
|
+
uniqid,
|
|
115
|
+
getNodeLevel,
|
|
116
|
+
walkDescendant
|
|
115
117
|
} from "../../utils";
|
|
116
118
|
import {
|
|
117
119
|
treeContextSymbol
|
|
@@ -123,7 +125,6 @@ import SarRadio from "../radio/radio.vue";
|
|
|
123
125
|
import SarPopover from "../popover/popover.vue";
|
|
124
126
|
import SarLoading from "../loading/loading.vue";
|
|
125
127
|
import { usePopover } from "../popover";
|
|
126
|
-
import { getNodeLevel, recurDescendant } from "../tree/utils";
|
|
127
128
|
export default _defineComponent({
|
|
128
129
|
components: {
|
|
129
130
|
SarIcon,
|
|
@@ -169,7 +170,7 @@ export default _defineComponent({
|
|
|
169
170
|
const onDragStart = () => {
|
|
170
171
|
obviousNodes = [];
|
|
171
172
|
treeContext.treeData.forEach((node) => {
|
|
172
|
-
|
|
173
|
+
walkDescendant(node, (node2) => {
|
|
173
174
|
obviousNodes.push(node2);
|
|
174
175
|
if (!node2.expanded) {
|
|
175
176
|
return true;
|
|
@@ -308,7 +309,10 @@ export default _defineComponent({
|
|
|
308
309
|
if (!isMergedLeaf.value) {
|
|
309
310
|
treeContext.toggleExpandedByNode(node);
|
|
310
311
|
}
|
|
311
|
-
if (
|
|
312
|
+
if (treeContext.selectable && !node.disabled && isMergedLeaf.value) {
|
|
313
|
+
treeContext.toggleCheck(node, !node.checked);
|
|
314
|
+
}
|
|
315
|
+
if (canSingleSelectable.value && !node.disabled && isMergedLeaf.value) {
|
|
312
316
|
treeContext.singleSelect(node);
|
|
313
317
|
}
|
|
314
318
|
treeContext.nodeClick(node, event);
|
|
@@ -100,7 +100,7 @@ export default _defineComponent({
|
|
|
100
100
|
},
|
|
101
101
|
__name: "upload",
|
|
102
102
|
props: _mergeDefaults({
|
|
103
|
-
rootStyle: { type:
|
|
103
|
+
rootStyle: { type: null, required: false },
|
|
104
104
|
rootClass: { type: String, required: false },
|
|
105
105
|
accept: { type: [String, Array], required: false },
|
|
106
106
|
multiple: { type: Boolean, required: false },
|
|
@@ -89,7 +89,7 @@ export default _defineComponent({
|
|
|
89
89
|
},
|
|
90
90
|
__name: "upload-preview",
|
|
91
91
|
props: _mergeDefaults({
|
|
92
|
-
rootStyle: { type:
|
|
92
|
+
rootStyle: { type: null, required: false },
|
|
93
93
|
rootClass: { type: String, required: false },
|
|
94
94
|
file: { type: Object, required: false },
|
|
95
95
|
url: { type: String, required: false },
|
|
@@ -46,7 +46,7 @@ export default _defineComponent({
|
|
|
46
46
|
},
|
|
47
47
|
__name: "waterfall",
|
|
48
48
|
props: _mergeDefaults({
|
|
49
|
-
rootStyle: { type:
|
|
49
|
+
rootStyle: { type: null, required: false },
|
|
50
50
|
rootClass: { type: String, required: false },
|
|
51
51
|
columns: { type: Number, required: false },
|
|
52
52
|
columnGap: { type: Number, required: false },
|
|
@@ -38,7 +38,7 @@ export default _defineComponent({
|
|
|
38
38
|
},
|
|
39
39
|
__name: "waterfall-item",
|
|
40
40
|
props: {
|
|
41
|
-
rootStyle: { type:
|
|
41
|
+
rootStyle: { type: null, required: false },
|
|
42
42
|
rootClass: { type: String, required: false }
|
|
43
43
|
},
|
|
44
44
|
setup(__props, { expose: __expose }) {
|
|
@@ -27,7 +27,7 @@ export default _defineComponent({
|
|
|
27
27
|
},
|
|
28
28
|
__name: "waterfall-load",
|
|
29
29
|
props: {
|
|
30
|
-
rootStyle: { type:
|
|
30
|
+
rootStyle: { type: null, required: false },
|
|
31
31
|
rootClass: { type: String, required: false },
|
|
32
32
|
maxWait: { type: Number, required: false },
|
|
33
33
|
width: { type: Number, required: false },
|
|
@@ -26,7 +26,10 @@ import {
|
|
|
26
26
|
createBem,
|
|
27
27
|
uniqid,
|
|
28
28
|
toArray,
|
|
29
|
-
getRotatedRect
|
|
29
|
+
getRotatedRect,
|
|
30
|
+
readAsDataURL,
|
|
31
|
+
isWeixin,
|
|
32
|
+
isHarmony
|
|
30
33
|
} from "../../utils";
|
|
31
34
|
import {
|
|
32
35
|
defaultWatermarkProps,
|
|
@@ -54,7 +57,7 @@ export default _defineComponent({
|
|
|
54
57
|
},
|
|
55
58
|
__name: "watermark",
|
|
56
59
|
props: _mergeDefaults({
|
|
57
|
-
rootStyle: { type:
|
|
60
|
+
rootStyle: { type: null, required: false },
|
|
58
61
|
rootClass: { type: String, required: false },
|
|
59
62
|
width: { type: Number, required: false },
|
|
60
63
|
height: { type: Number, required: false },
|
|
@@ -205,12 +208,7 @@ export default _defineComponent({
|
|
|
205
208
|
destHeight: clipHeight,
|
|
206
209
|
canvasId,
|
|
207
210
|
success(res) {
|
|
208
|
-
|
|
209
|
-
dataURL.value = "data:image/png;base64," + uni.getFileSystemManager().readFileSync(res.tempFilePath, "base64");
|
|
210
|
-
// #endif
|
|
211
|
-
// #ifndef MP-WEIXIN
|
|
212
|
-
dataURL.value = res.tempFilePath;
|
|
213
|
-
// #endif
|
|
211
|
+
dataURL.value = isWeixin || isHarmony ? readAsDataURL(res.tempFilePath) : res.tempFilePath;
|
|
214
212
|
}
|
|
215
213
|
},
|
|
216
214
|
instance
|
package/global.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ declare module 'vue' {
|
|
|
3
3
|
SarAccordion: typeof import('./components/accordion/accordion').default
|
|
4
4
|
SarAccordionItem: typeof import('./components/accordion-item/accordion-item').default
|
|
5
5
|
SarActionSheet: typeof import('./components/action-sheet/action-sheet').default
|
|
6
|
+
SarActionSheetAgent: typeof import('./components/action-sheet-agent/action-sheet-agent').default
|
|
6
7
|
SarAlert: typeof import('./components/alert/alert').default
|
|
7
8
|
SarAvatar: typeof import('./components/avatar/avatar').default
|
|
8
9
|
SarAvatarGroup: typeof import('./components/avatar-group/avatar-group').default
|
|
@@ -119,6 +120,7 @@ declare module 'vue' {
|
|
|
119
120
|
SarSticky: typeof import('./components/sticky/sticky').default
|
|
120
121
|
SarStickyBox: typeof import('./components/sticky-box/sticky-box').default
|
|
121
122
|
SarSwipeAction: typeof import('./components/swipe-action/swipe-action').default
|
|
123
|
+
SarSwipeActionAgent: typeof import('./components/swipe-action-agent/swipe-action-agent').default
|
|
122
124
|
SarSwiperDot: typeof import('./components/swiper-dot/swiper-dot').default
|
|
123
125
|
SarSwitch: typeof import('./components/switch/switch').default
|
|
124
126
|
SarTab: typeof import('./components/tab/tab').default
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
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.25.
|
|
5
|
+
"version": "1.25.6",
|
|
6
6
|
"description": "sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"scripts": {
|
|
@@ -142,6 +142,7 @@
|
|
|
142
142
|
"author": "wuzhitao",
|
|
143
143
|
"license": "MIT",
|
|
144
144
|
"repository": "https://github.com/sutras/sard-uniapp",
|
|
145
|
+
"homepage": "https://sard.wzt.zone/sard-uniapp-docs/",
|
|
145
146
|
"keywords": [
|
|
146
147
|
"uniapp",
|
|
147
148
|
"UI",
|
package/use/index.d.ts
CHANGED
package/use/index.js
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
2
|
+
export declare function useLockScroll(_visible: MaybeRefOrGetter<boolean>, lockScroll?: boolean): void;
|
|
3
|
+
/**
|
|
4
|
+
* 用于小程序端判断 page-meta 是否应加上溢出隐藏
|
|
5
|
+
*/
|
|
6
|
+
export declare function useCurrentPageLock(): {
|
|
7
|
+
isLocked: import("vue").ComputedRef<boolean>;
|
|
8
|
+
};
|