sard-uniapp 1.23.1 → 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 CHANGED
@@ -1,3 +1,18 @@
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
+
1
16
  ## [1.23.1](https://github.com/sutras/sard-uniapp/compare/v1.23.0...v1.23.1) (2025-07-28)
2
17
 
3
18
 
@@ -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 | 组件根元素类名 | 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 |
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
 
@@ -8,6 +8,8 @@ export interface NavbarProps {
8
8
  backText?: string;
9
9
  fixed?: boolean;
10
10
  statusBar?: boolean;
11
+ fixationStyle?: StyleValue;
12
+ fixationClass?: string;
11
13
  }
12
14
  export interface NavbarSlots {
13
15
  default?(props: Record<string, never>): any;
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <view :class="navbarClass" :style="navbarStyle">
3
- <view :class="bem.e('fixation')">
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 __returned__ = { props, slots, emit, bem, onBack, navbarClass, navbarStyle, SarNavbarItem, SarStatusBar, SarNavbarPit };
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="show"
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
  });
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.23.1",
5
+ "version": "1.23.2",
6
6
  "description": "sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库",
7
7
  "main": "index.js",
8
8
  "scripts": {