sard-uniapp 1.23.0 → 1.23.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 +24 -0
- package/components/config/index.d.ts +1 -1
- package/components/form-item-plain/form-item-plain.vue +17 -0
- package/components/form-plain/form-plain.vue +19 -0
- package/components/navbar/README.md +12 -10
- package/components/navbar/common.d.ts +2 -0
- package/components/navbar/navbar.vue +10 -3
- package/components/picker/picker.vue +3 -0
- package/components/picker-input/picker-input.vue +9 -3
- package/components/rate/README.md +21 -21
- package/components/rate/rate.vue +4 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
## [1.23.2](https://github.com/sutras/sard-uniapp/compare/v1.23.1...v1.23.2) (2025-07-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **picker-input:** 修复异步加载数据回显问题 ([76615e4](https://github.com/sutras/sard-uniapp/commit/76615e4f397265e0c110c082ace579c7fb24396a))
|
|
7
|
+
* **picker-input:** 允许设置 loaidng 属性 ([5f1f91c](https://github.com/sutras/sard-uniapp/commit/5f1f91c4f7a4ae6275b2909cc8da7058b2af5471))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* navbar 新增 fixationStyle, fixationClasss 属性 ([bdc70f1](https://github.com/sutras/sard-uniapp/commit/bdc70f1282f7a232ed8cadae2699ec5f4074a37c))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [1.23.1](https://github.com/sutras/sard-uniapp/compare/v1.23.0...v1.23.1) (2025-07-28)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* 修复 rate 清空问题 ([ac43638](https://github.com/sutras/sard-uniapp/commit/ac43638b3802d759221df5b65cb36c71c21a50ef))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
1
25
|
# [1.23.0](https://github.com/sutras/sard-uniapp/compare/v1.22.2...v1.23.0) (2025-07-26)
|
|
2
26
|
|
|
3
27
|
|
|
@@ -9,6 +9,7 @@ import { type CheckboxInputProps } from '../checkbox-input';
|
|
|
9
9
|
import { type DatetimePickerInputProps } from '../datetime-picker-input';
|
|
10
10
|
import { type DatetimeRangePickerInputProps } from '../datetime-range-picker-input';
|
|
11
11
|
import { type DialogProps } from '../dialog';
|
|
12
|
+
import { type DividerProps } from '../divider';
|
|
12
13
|
import { type DropdownProps } from '../dropdown';
|
|
13
14
|
import { type FloatingBubbleProps } from '../floating-bubble';
|
|
14
15
|
import { type FormProps } from '../form';
|
|
@@ -42,7 +43,6 @@ import { type TagProps } from '../tag';
|
|
|
42
43
|
import { type ToastProps } from '../toast';
|
|
43
44
|
import { type TreeProps } from '../tree';
|
|
44
45
|
import { type UploadPreviewProps, type UploadProps } from '../upload';
|
|
45
|
-
import { type DividerProps } from '../divider';
|
|
46
46
|
type DeepPartial<T> = {
|
|
47
47
|
[P in keyof T]?: T[P] extends Record<any, any> ? DeepPartial<T[P]> : T[P];
|
|
48
48
|
};
|
|
@@ -21,6 +21,23 @@
|
|
|
21
21
|
import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
|
|
22
22
|
import { useFormItem } from "../form-item/useFormItem";
|
|
23
23
|
import { defaultFormItemProps } from "../form/common";
|
|
24
|
+
/**
|
|
25
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
26
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
27
|
+
* @property {'horizontal' | 'vertical'} direction 表单排列方向,默认值:'horizontal'。
|
|
28
|
+
* @property {string} labelWidth 标签宽度,默认值:-。
|
|
29
|
+
* @property {'start' | 'center' | 'end'} labelAlign 标签水平对齐方式,默认值:'start'。
|
|
30
|
+
* @property {'start' | 'center' | 'end'} labelValign 标签垂直对齐方式,默认值:'start'。
|
|
31
|
+
* @property {'left' | 'right'} starPosition 必填星号在标签的左边或右边,默认值:'left'。
|
|
32
|
+
* @property {string} label 标签文本,默认值:-。
|
|
33
|
+
* @property {boolean} required 是否为必填项,如不设置,则会根据校验规则确认,默认值:-。
|
|
34
|
+
* @property {FieldName} name 表单域 `model` 字段,在使用 `validate、reset` 方法的情况下,该属性是必填的。,默认值:-。
|
|
35
|
+
* @property {Rule | Rule[]} rules 表单验证规则,默认值:-。
|
|
36
|
+
* @property {TriggerType} validateTrigger 设置字段校验的时机,默认值:change。
|
|
37
|
+
* @property {string} error 表单域验证错误时的提示信息。设置该值会导致表单验证状态变为 `error`,并显示该错误信息。,默认值:-。
|
|
38
|
+
* @property {boolean} showError 是否显示校验错误信息,默认值:true。
|
|
39
|
+
* @property {boolean} inlaid 去掉边框和内边距,用于嵌入到其他组件中,默认值:false。
|
|
40
|
+
*/
|
|
24
41
|
export default _defineComponent({
|
|
25
42
|
...{
|
|
26
43
|
options: {
|
|
@@ -8,6 +8,25 @@
|
|
|
8
8
|
import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
|
|
9
9
|
import { useForm } from "../form/useForm";
|
|
10
10
|
import { defaultFormProps } from "../form/common";
|
|
11
|
+
/**
|
|
12
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
13
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
14
|
+
* @property {Record\<string, any>} model 表单数据对象,默认值:-。
|
|
15
|
+
* @property {FormRules} rules 表单验证规则,默认值:-。
|
|
16
|
+
* @property {TriggerType} validateTrigger 设置字段校验的时机,默认值:change。
|
|
17
|
+
* @property {boolean} validateOnRuleChange 是否在 `rules` 属性改变后立即触发一次验证,默认值:true。
|
|
18
|
+
* @property {'horizontal' | 'vertical'} direction 表单排列方向,默认值:'horizontal'。
|
|
19
|
+
* @property {string} labelWidth 标签宽度,默认值:-。
|
|
20
|
+
* @property {'start' | 'center' | 'end'} labelAlign 标签水平对齐方式,默认值:'start'。
|
|
21
|
+
* @property {'start' | 'center' | 'end'} labelValign 标签垂直对齐方式,默认值:'start'。
|
|
22
|
+
* @property {'left' | 'right'} starPosition 必填星号在标签的左边或右边,默认值:'left'。
|
|
23
|
+
* @property {boolean} hideStar 是否隐藏必填时的星号,默认值:false。
|
|
24
|
+
* @property {boolean} showError 是否显示校验错误信息,默认值:true。
|
|
25
|
+
* @property {boolean} scrollToFirstError 当校验失败时,滚动到第一个错误表单项,默认值:false。
|
|
26
|
+
* @property {[ScrollIntoViewOptions](../utilities/geometry#ScrollIntoViewOptions)} scrollIntoViewOptions 自定义滚动配置选项,默认值:{position: 'nearest', startOffset: 0, endOffset: 0}。
|
|
27
|
+
* @property {boolean} disabled 是否禁用该表单内的所有组件。 如果设置为 `true`, 它将覆盖内部组件的 `disabled` 属性,默认值:false。
|
|
28
|
+
* @property {boolean} readonly 是否只读该表单内的所有组件。 如果设置为 `true`, 它将覆盖内部组件的 `readonly` 属性,默认值:false。
|
|
29
|
+
*/
|
|
11
30
|
export default _defineComponent({
|
|
12
31
|
...{
|
|
13
32
|
options: {
|
|
@@ -66,16 +66,18 @@ import NavbarItem from 'sard-uniapp/components/navbar-item/navbar-item.vue'
|
|
|
66
66
|
|
|
67
67
|
### NavbarProps
|
|
68
68
|
|
|
69
|
-
| 属性
|
|
70
|
-
|
|
|
71
|
-
| root-class
|
|
72
|
-
| root-style
|
|
73
|
-
| title
|
|
74
|
-
| flow
|
|
75
|
-
| show-back <sup>1.12+</sup>
|
|
76
|
-
| back-text <sup>1.12+</sup>
|
|
77
|
-
| fixed <sup>1.12+</sup>
|
|
78
|
-
| status-bar <sup>1.12+</sup>
|
|
69
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
70
|
+
| --------------------------------- | ---------------------------------------------------------------------------------- | ---------- | ------ |
|
|
71
|
+
| root-class | 组件根元素类名 | string | - |
|
|
72
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
73
|
+
| title | 自定义标题 | string | - |
|
|
74
|
+
| flow | 默认 `left/right` 绝对定位于左右两侧,标题居中;可以使用 `flow` 使其变为流动布局。 | boolean | false |
|
|
75
|
+
| show-back <sup>1.12+</sup> | 是否显示返回按钮(仅显示,返回逻辑需自行编写) | boolean | false |
|
|
76
|
+
| back-text <sup>1.12+</sup> | 返回按钮的文本 | string | - |
|
|
77
|
+
| fixed <sup>1.12+</sup> | 是否固定到页面顶部 | boolean | false |
|
|
78
|
+
| status-bar <sup>1.12+</sup> | 是否包含状态栏 | boolean | false |
|
|
79
|
+
| fixation-class <sup>1.23.2+</sup> | 固定栏元素类名 | string | - |
|
|
80
|
+
| fixation-style <sup>1.23.2+</sup> | 固定栏元素样式 | StyleValue | - |
|
|
79
81
|
|
|
80
82
|
### NavbarSlots
|
|
81
83
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view :class="navbarClass" :style="navbarStyle">
|
|
3
|
-
<view :class="
|
|
3
|
+
<view :class="fixationCls" :style="fixationStyle">
|
|
4
4
|
<sar-status-bar v-if="statusBar" />
|
|
5
5
|
<view :class="bem.e('wrapper')">
|
|
6
6
|
<view v-if="$slots.left || showBack" :class="bem.e('left')">
|
|
@@ -46,6 +46,8 @@ import SarNavbarPit from "../navbar-pit/navbar-pit.vue";
|
|
|
46
46
|
* @property {string} backText 返回按钮的文本,默认值:-。
|
|
47
47
|
* @property {boolean} fixed 是否固定到页面顶部,默认值:false。
|
|
48
48
|
* @property {boolean} statusBar 是否包含状态栏,默认值:false。
|
|
49
|
+
* @property {string} fixationClass 固定栏元素类名,默认值:-。
|
|
50
|
+
* @property {StyleValue} fixationStyle 固定栏元素样式,默认值:-。
|
|
49
51
|
* @event {(event: any) => void} back 点击返回按钮项时触发
|
|
50
52
|
*/
|
|
51
53
|
export default _defineComponent({
|
|
@@ -69,7 +71,9 @@ export default _defineComponent({
|
|
|
69
71
|
showBack: { type: Boolean, required: false },
|
|
70
72
|
backText: { type: String, required: false },
|
|
71
73
|
fixed: { type: Boolean, required: false },
|
|
72
|
-
statusBar: { type: Boolean, required: false }
|
|
74
|
+
statusBar: { type: Boolean, required: false },
|
|
75
|
+
fixationStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
76
|
+
fixationClass: { type: String, required: false }
|
|
73
77
|
},
|
|
74
78
|
emits: ["back"],
|
|
75
79
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -93,7 +97,10 @@ export default _defineComponent({
|
|
|
93
97
|
const navbarStyle = computed(() => {
|
|
94
98
|
return stringifyStyle(props.rootStyle);
|
|
95
99
|
});
|
|
96
|
-
const
|
|
100
|
+
const fixationCls = computed(() => {
|
|
101
|
+
return classNames(bem.e("fixation"), props.fixationClass);
|
|
102
|
+
});
|
|
103
|
+
const __returned__ = { props, slots, emit, bem, onBack, navbarClass, navbarStyle, fixationCls, SarNavbarItem, SarStatusBar, SarNavbarPit };
|
|
97
104
|
return __returned__;
|
|
98
105
|
}
|
|
99
106
|
});
|
|
@@ -124,6 +124,9 @@ export default _defineComponent({
|
|
|
124
124
|
}
|
|
125
125
|
);
|
|
126
126
|
const onChange = (event) => {
|
|
127
|
+
if (!props.columns || props.columns.length === 0) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
127
130
|
let indexes = event.detail.value;
|
|
128
131
|
if (indexes.some((index) => index === Infinity)) {
|
|
129
132
|
nextTick(() => {
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
:arrow="arrow"
|
|
11
11
|
:internal-arrow="$slots.arrow ? 1 : 0"
|
|
12
12
|
:input-props="inputProps"
|
|
13
|
+
:loading="loading"
|
|
13
14
|
@clear="onClear"
|
|
14
|
-
@click="
|
|
15
|
+
@click="onClick"
|
|
15
16
|
>
|
|
16
17
|
<template v-if="$slots.arrow" #arrow>
|
|
17
18
|
<slot name="arrow"></slot>
|
|
@@ -159,6 +160,11 @@ export default _defineComponent({
|
|
|
159
160
|
onClear,
|
|
160
161
|
onVisibleHook
|
|
161
162
|
} = usePopoutInput(props, emit);
|
|
163
|
+
const onClick = () => {
|
|
164
|
+
if (props.columns && props.columns.length > 0) {
|
|
165
|
+
show();
|
|
166
|
+
}
|
|
167
|
+
};
|
|
162
168
|
const fieldKeys = computed(() => {
|
|
163
169
|
return Object.assign({}, defaultOptionKeys, props.optionKeys);
|
|
164
170
|
});
|
|
@@ -177,7 +183,7 @@ export default _defineComponent({
|
|
|
177
183
|
return getOutletText(props.columns, fieldKeys.value, innerValue.value);
|
|
178
184
|
}
|
|
179
185
|
watch(
|
|
180
|
-
innerValue,
|
|
186
|
+
[innerValue, () => props.columns],
|
|
181
187
|
() => {
|
|
182
188
|
inputValue.value = getInputValue();
|
|
183
189
|
},
|
|
@@ -188,7 +194,7 @@ export default _defineComponent({
|
|
|
188
194
|
const onConfirm = () => {
|
|
189
195
|
emit("confirm");
|
|
190
196
|
};
|
|
191
|
-
const __returned__ = { props, emit, innerVisible, innerValue, inputValue, show, onChange, onClear, onVisibleHook, fieldKeys, getOutletText, getInputValue, onConfirm, SarPopoutInput, SarPickerPopout };
|
|
197
|
+
const __returned__ = { props, emit, innerVisible, innerValue, inputValue, show, onChange, onClear, onVisibleHook, onClick, fieldKeys, getOutletText, getInputValue, onConfirm, SarPopoutInput, SarPickerPopout };
|
|
192
198
|
return __returned__;
|
|
193
199
|
}
|
|
194
200
|
});
|
|
@@ -57,7 +57,7 @@ import Rate from 'sard-uniapp/components/rate/rate.vue'
|
|
|
57
57
|
|
|
58
58
|
### 允许清空
|
|
59
59
|
|
|
60
|
-
当 `clearable` 属性设置为 `true
|
|
60
|
+
当 `clearable` 属性设置为 `true`,再次点击相同的值,或划到最左边时,可以将值重置为 0。
|
|
61
61
|
|
|
62
62
|
@code('${DEMO_PATH}/rate/demo/Clearable.vue')
|
|
63
63
|
|
|
@@ -71,26 +71,26 @@ import Rate from 'sard-uniapp/components/rate/rate.vue'
|
|
|
71
71
|
|
|
72
72
|
### RateProps
|
|
73
73
|
|
|
74
|
-
| 属性 | 描述
|
|
75
|
-
| -------------- |
|
|
76
|
-
| root-class | 组件根元素类名
|
|
77
|
-
| root-style | 组件根元素样式
|
|
78
|
-
| model-value | 选中图标数
|
|
79
|
-
| allow-half | 是否允许半选
|
|
80
|
-
| clearable |
|
|
81
|
-
| count | 图标总数
|
|
82
|
-
| size | 图标大小
|
|
83
|
-
| gap | 图标间距
|
|
84
|
-
| icon-family | 图标字体
|
|
85
|
-
| icon | 自定义选中时的图标
|
|
86
|
-
| void-icon | 自定义未选中时的图标
|
|
87
|
-
| text | 自定义选中时的文字
|
|
88
|
-
| void-text | 自定义未选中时的文字
|
|
89
|
-
| color | 选中时的颜色
|
|
90
|
-
| void-color | 未选中时的颜色
|
|
91
|
-
| disabled | 禁用状态
|
|
92
|
-
| readonly | 只读状态
|
|
93
|
-
| validate-event | 是否触发表单验证
|
|
74
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
75
|
+
| -------------- | ---------------------------------------------- | ---------- | ------ |
|
|
76
|
+
| root-class | 组件根元素类名 | string | - |
|
|
77
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
78
|
+
| model-value | 选中图标数 | number | - |
|
|
79
|
+
| allow-half | 是否允许半选 | boolean | false |
|
|
80
|
+
| clearable | 在点击相同值,或划到最左边时,是否将值重置为 0 | boolean | false |
|
|
81
|
+
| count | 图标总数 | number | 5 |
|
|
82
|
+
| size | 图标大小 | string | - |
|
|
83
|
+
| gap | 图标间距 | string | - |
|
|
84
|
+
| icon-family | 图标字体 | string | - |
|
|
85
|
+
| icon | 自定义选中时的图标 | string | - |
|
|
86
|
+
| void-icon | 自定义未选中时的图标 | string | - |
|
|
87
|
+
| text | 自定义选中时的文字 | string | - |
|
|
88
|
+
| void-text | 自定义未选中时的文字 | string | - |
|
|
89
|
+
| color | 选中时的颜色 | string | - |
|
|
90
|
+
| void-color | 未选中时的颜色 | string | - |
|
|
91
|
+
| disabled | 禁用状态 | boolean | false |
|
|
92
|
+
| readonly | 只读状态 | boolean | false |
|
|
93
|
+
| validate-event | 是否触发表单验证 | boolean | true |
|
|
94
94
|
|
|
95
95
|
### RateEmits
|
|
96
96
|
|
package/components/rate/rate.vue
CHANGED
|
@@ -71,7 +71,7 @@ import { useMouseDown } from "../../use";
|
|
|
71
71
|
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
72
72
|
* @property {number} modelValue 选中图标数,默认值:-。
|
|
73
73
|
* @property {boolean} allowHalf 是否允许半选,默认值:false。
|
|
74
|
-
* @property {boolean} clearable
|
|
74
|
+
* @property {boolean} clearable 在点击相同值,或划到最左边时,是否将值重置为 0,默认值:false。
|
|
75
75
|
* @property {number} count 图标总数,默认值:5。
|
|
76
76
|
* @property {string} size 图标大小,默认值:-。
|
|
77
77
|
* @property {string} gap 图标间距,默认值:-。
|
|
@@ -225,6 +225,9 @@ export default _defineComponent({
|
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
|
+
if (nextValue === 0 && !props.clearable) {
|
|
229
|
+
nextValue = props.allowHalf ? 0.5 : 1;
|
|
230
|
+
}
|
|
228
231
|
if (nextValue !== void 0 && nextValue !== innerValue.value) {
|
|
229
232
|
innerValue.value = nextValue;
|
|
230
233
|
emit("update:model-value", nextValue);
|