sard-uniapp 1.13.3 → 1.14.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 +18 -0
- package/components/accordion/variables.scss +2 -1
- package/components/action-sheet/variables.scss +2 -1
- package/components/alert/variables.scss +2 -1
- package/components/avatar/variables.scss +2 -1
- package/components/back-top/variables.scss +2 -1
- package/components/badge/variables.scss +2 -1
- package/components/button/variables.scss +2 -1
- package/components/calendar/variables.scss +2 -1
- package/components/card/variables.scss +2 -1
- package/components/cascader/cascader.vue +12 -17
- package/components/cascader/common.d.ts +1 -0
- package/components/cascader/variables.scss +2 -1
- package/components/cascader-input/cascader-input.vue +11 -6
- package/components/check-icon/variables.scss +2 -1
- package/components/checkbox/variables.scss +2 -1
- package/components/checkbox-input/variables.scss +2 -1
- package/components/collapse/variables.scss +2 -1
- package/components/datetime-range-picker/variables.scss +2 -1
- package/components/dialog/common.d.ts +2 -0
- package/components/dialog/dialog.vue +11 -2
- package/components/dialog/variables.scss +2 -1
- package/components/dialog-agent/dialog-agent.vue +2 -0
- package/components/divider/variables.scss +2 -1
- package/components/dropdown/variables.scss +2 -1
- package/components/empty/variables.scss +2 -1
- package/components/fab/variables.scss +2 -1
- package/components/floating-bubble/variables.scss +2 -1
- package/components/floating-panel/variables.scss +2 -1
- package/components/form/variables.scss +2 -1
- package/components/grid/variables.scss +2 -1
- package/components/indexes/variables.scss +2 -1
- package/components/input/index.scss +1 -0
- package/components/input/variables.scss +2 -1
- package/components/keyboard/variables.scss +2 -1
- package/components/list/variables.scss +2 -1
- package/components/load-more/variables.scss +2 -1
- package/components/loading/variables.scss +2 -1
- package/components/menu/variables.scss +2 -1
- package/components/navbar/variables.scss +2 -1
- package/components/notice-bar/variables.scss +2 -1
- package/components/notify/variables.scss +2 -1
- package/components/overlay/variables.scss +2 -1
- package/components/pagination/variables.scss +2 -1
- package/components/password-input/variables.scss +2 -1
- package/components/picker/variables.scss +2 -1
- package/components/popout/variables.scss +2 -1
- package/components/popout-input/variables.scss +2 -1
- package/components/popover/variables.scss +2 -1
- package/components/popup/popup.vue +32 -18
- package/components/popup/variables.scss +2 -1
- package/components/progress-bar/variables.scss +2 -1
- package/components/progress-circle/variables.scss +2 -1
- package/components/pull-down-refresh/variables.scss +2 -1
- package/components/qrcode/variables.scss +1 -1
- package/components/radio/variables.scss +2 -1
- package/components/radio-input/variables.scss +2 -1
- package/components/rate/variables.scss +2 -1
- package/components/result/variables.scss +2 -1
- package/components/search/variables.scss +2 -1
- package/components/share-sheet/variables.scss +2 -1
- package/components/sidebar/variables.scss +2 -1
- package/components/signature/variables.scss +2 -1
- package/components/skeleton/variables.scss +2 -1
- package/components/slider/variables.scss +2 -1
- package/components/space/variables.scss +2 -1
- package/components/stepper/variables.scss +2 -1
- package/components/steps/variables.scss +2 -1
- package/components/style/mixins/theme-dark.scss +4 -2
- package/components/style/variables.scss +2 -1
- package/components/swiper-dot/variables.scss +2 -1
- package/components/switch/variables.scss +2 -1
- package/components/tabbar/variables.scss +2 -1
- package/components/table/variables.scss +2 -1
- package/components/tabs/variables.scss +2 -1
- package/components/tag/variables.scss +2 -1
- package/components/timeline/variables.scss +2 -1
- package/components/toast/variables.scss +2 -1
- package/components/tree/variables.scss +2 -1
- package/components/upload/variables.scss +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## [1.14.1](https://github.com/sutras/sard-uniapp/compare/v1.14.0...v1.14.1) (2025-05-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* 修复 popup 组件 transform+fixed 渲染问题 ([5d0bf10](https://github.com/sutras/sard-uniapp/commit/5d0bf106df39e9c48c84bd7f76c71bb9306070c9))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# [1.14.0](https://github.com/sutras/sard-uniapp/compare/v1.13.3...v1.14.0) (2025-05-12)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* cascader 新增 change-on-select 属性 ([71c1329](https://github.com/sutras/sard-uniapp/commit/71c13291780eea13ac7c198ae31a39e0dc49d531))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
1
19
|
## [1.13.3](https://github.com/sutras/sard-uniapp/compare/v1.13.2...v1.13.3) (2025-05-12)
|
|
2
20
|
|
|
3
21
|
|
|
@@ -112,7 +112,8 @@ export default _defineComponent({
|
|
|
112
112
|
options: { type: Array, required: false },
|
|
113
113
|
fieldKeys: { type: Object, required: false },
|
|
114
114
|
hintText: { type: String, required: false },
|
|
115
|
-
labelRender: { type: Function, required: false }
|
|
115
|
+
labelRender: { type: Function, required: false },
|
|
116
|
+
changeOnSelect: { type: Boolean, required: false }
|
|
116
117
|
}, defaultCascaderProps),
|
|
117
118
|
emits: ["update:model-value", "change", "select"],
|
|
118
119
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -177,31 +178,25 @@ export default _defineComponent({
|
|
|
177
178
|
if (selectBack) {
|
|
178
179
|
nextTabs = nextTabs.slice(0, tabIndex + 1);
|
|
179
180
|
}
|
|
180
|
-
|
|
181
|
+
const isLast = isLastOption(option);
|
|
182
|
+
if (!isLast) {
|
|
181
183
|
const nextTab = {
|
|
182
184
|
options: option[mergedFieldKeys.value.children],
|
|
183
185
|
selected: null
|
|
184
186
|
};
|
|
185
187
|
nextTabs.push(nextTab);
|
|
186
|
-
tabsCurrent.value = nextTabs.length - 1;
|
|
187
|
-
} else {
|
|
188
|
-
tabsCurrent.value = tabIndex;
|
|
189
|
-
const nextValue = option[mergedFieldKeys.value.value];
|
|
190
|
-
innerValue.value = nextValue;
|
|
191
|
-
emit(
|
|
192
|
-
"update:model-value",
|
|
193
|
-
nextValue,
|
|
194
|
-
nextTabs.map((tab) => tab.selected)
|
|
195
|
-
);
|
|
196
|
-
emit(
|
|
197
|
-
"change",
|
|
198
|
-
nextValue,
|
|
199
|
-
nextTabs.map((tab) => tab.selected)
|
|
200
|
-
);
|
|
201
188
|
}
|
|
189
|
+
tabsCurrent.value = isLast ? tabIndex : nextTabs.length - 1;
|
|
202
190
|
tempValue = option[mergedFieldKeys.value.value];
|
|
203
191
|
tabs.value = nextTabs;
|
|
204
192
|
emit("select", option, tabIndex);
|
|
193
|
+
if (isLast || props.changeOnSelect) {
|
|
194
|
+
const nextValue = option[mergedFieldKeys.value.value];
|
|
195
|
+
innerValue.value = nextValue;
|
|
196
|
+
const selectedOptions = nextTabs.map((tab) => tab.selected).filter(Boolean);
|
|
197
|
+
emit("update:model-value", nextValue, selectedOptions);
|
|
198
|
+
emit("change", nextValue, selectedOptions);
|
|
199
|
+
}
|
|
205
200
|
};
|
|
206
201
|
const innerPaceholder = computed(() => {
|
|
207
202
|
return props.hintText || t("pleaseSelect");
|
|
@@ -23,11 +23,13 @@
|
|
|
23
23
|
<sar-cascader
|
|
24
24
|
v-if="already"
|
|
25
25
|
:model-value="popoutValue"
|
|
26
|
-
@change="onChange"
|
|
27
26
|
:options="options"
|
|
28
27
|
:field-keys="fieldKeys"
|
|
29
|
-
:
|
|
28
|
+
:hint-text="hintText"
|
|
29
|
+
:change-on-select="changeOnSelect"
|
|
30
|
+
:label-render="labelRender"
|
|
30
31
|
@select="(option, tabIndex) => $emit('select', option, tabIndex)"
|
|
32
|
+
@change="onChange"
|
|
31
33
|
>
|
|
32
34
|
<template #top="{ tabIndex }">
|
|
33
35
|
<slot name="top" :tab-index="tabIndex"></slot>
|
|
@@ -77,6 +79,7 @@ export default _defineComponent({
|
|
|
77
79
|
fieldKeys: { type: Object, required: false },
|
|
78
80
|
hintText: { type: String, required: false },
|
|
79
81
|
labelRender: { type: Function, required: false },
|
|
82
|
+
changeOnSelect: { type: Boolean, required: false },
|
|
80
83
|
placeholder: { type: String, required: false },
|
|
81
84
|
readonly: { type: Boolean, required: false },
|
|
82
85
|
disabled: { type: Boolean, required: false },
|
|
@@ -114,10 +117,12 @@ export default _defineComponent({
|
|
|
114
117
|
}
|
|
115
118
|
};
|
|
116
119
|
const onConfirm = () => {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
if (popoutValue.value !== innerValue.value) {
|
|
121
|
+
innerValue.value = popoutValue.value;
|
|
122
|
+
inputValue.value = getInputValue();
|
|
123
|
+
emit("update:model-value", innerValue.value, popoutOptions.value);
|
|
124
|
+
emit("change", innerValue.value, popoutOptions.value);
|
|
125
|
+
}
|
|
121
126
|
};
|
|
122
127
|
const inputValue = ref("");
|
|
123
128
|
const fieldkeys = computed(() => {
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
effect="zoom"
|
|
4
4
|
:visible="visible"
|
|
5
5
|
:duration="duration"
|
|
6
|
-
:root-
|
|
6
|
+
:root-class="popupClass"
|
|
7
|
+
:root-style="mergedPopupStyle"
|
|
7
8
|
@overlay-click="onOverlayClick"
|
|
8
9
|
@visible-hook="onVisibleHook"
|
|
9
10
|
>
|
|
@@ -107,6 +108,8 @@ export default _defineComponent({
|
|
|
107
108
|
props: _mergeDefaults({
|
|
108
109
|
rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
109
110
|
rootClass: { type: String, required: false },
|
|
111
|
+
popupStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
112
|
+
popupClass: { type: String, required: false },
|
|
110
113
|
visible: { type: Boolean, required: false },
|
|
111
114
|
title: { type: String, required: false },
|
|
112
115
|
message: { type: String, required: false },
|
|
@@ -219,7 +222,13 @@ export default _defineComponent({
|
|
|
219
222
|
const dialogStyle = computed(() => {
|
|
220
223
|
return stringifyStyle(props.rootStyle);
|
|
221
224
|
});
|
|
222
|
-
const
|
|
225
|
+
const mergedPopupStyle = computed(() => {
|
|
226
|
+
return stringifyStyle(
|
|
227
|
+
{ maxWidth: "var(--sar-dialog-max-width)" },
|
|
228
|
+
props.popupStyle
|
|
229
|
+
);
|
|
230
|
+
});
|
|
231
|
+
const __returned__ = { props, emit, bem, t, innerVisible, loading, perhapsClose, onOverlayClick, onClose, onConfirm, onCancel, buttonProps, onVisibleHook, dialogClass, dialogStyle, mergedPopupStyle, SarPopup, SarButton, SarIcon };
|
|
223
232
|
return __returned__;
|
|
224
233
|
}
|
|
225
234
|
});
|
|
@@ -26,6 +26,8 @@ export default _defineComponent({
|
|
|
26
26
|
id: { type: String, required: false },
|
|
27
27
|
rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
28
28
|
rootClass: { type: String, required: false },
|
|
29
|
+
popupStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
30
|
+
popupClass: { type: String, required: false },
|
|
29
31
|
visible: { type: Boolean, required: false },
|
|
30
32
|
title: { type: String, required: false },
|
|
31
33
|
message: { type: String, required: false },
|
|
@@ -1,22 +1,36 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
<!-- #ifdef WEB -->
|
|
3
|
+
<teleport to="body">
|
|
4
|
+
<!-- #endif -->
|
|
5
|
+
<!-- #ifdef MP -->
|
|
6
|
+
<root-portal>
|
|
7
|
+
<!-- #endif -->
|
|
8
|
+
<view class="sar-portal">
|
|
9
|
+
<sar-overlay
|
|
10
|
+
v-if="overlay"
|
|
11
|
+
:visible="visible"
|
|
12
|
+
:duration="duration"
|
|
13
|
+
:z-index="zIndex"
|
|
14
|
+
:background="background"
|
|
15
|
+
:transparent="transparent"
|
|
16
|
+
:root-style="overlayStyle"
|
|
17
|
+
:root-class="overlayClass"
|
|
18
|
+
@click="onOverlayClick"
|
|
19
|
+
/>
|
|
20
|
+
<view
|
|
21
|
+
:class="popupClass"
|
|
22
|
+
:style="popupStyle"
|
|
23
|
+
@transitionend="onTransitionEnd"
|
|
24
|
+
>
|
|
25
|
+
<slot></slot>
|
|
26
|
+
</view>
|
|
27
|
+
</view>
|
|
28
|
+
<!-- #ifdef MP -->
|
|
29
|
+
</root-portal>
|
|
30
|
+
<!-- #endif -->
|
|
31
|
+
<!-- #ifdef WEB -->
|
|
32
|
+
</teleport>
|
|
33
|
+
<!-- #endif -->
|
|
20
34
|
</template>
|
|
21
35
|
|
|
22
36
|
<script>
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
@mixin theme-dark {
|
|
2
2
|
@media (prefers-color-scheme: dark) {
|
|
3
|
-
page
|
|
3
|
+
page,
|
|
4
|
+
.sar-portal {
|
|
4
5
|
@content;
|
|
5
6
|
}
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
/* #ifdef WEB */
|
|
9
|
-
:root[data-sard-theme='dark'] page
|
|
10
|
+
:root[data-sard-theme='dark'] page,
|
|
11
|
+
:root[data-sard-theme='dark'] .sar-portal {
|
|
10
12
|
@content;
|
|
11
13
|
}
|
|
12
14
|
/* #endif */
|