sard-uniapp 1.14.1 → 1.14.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,12 @@
1
+ ## [1.14.2](https://github.com/sutras/sard-uniapp/compare/v1.14.1...v1.14.2) (2025-05-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * 使 *-input 弹出式输入框组件只有一个根节点 ([91fe1c0](https://github.com/sutras/sard-uniapp/commit/91fe1c0af91cf0aef3f3e7429483613a743e0520))
7
+
8
+
9
+
1
10
  ## [1.14.1](https://github.com/sutras/sard-uniapp/compare/v1.14.0...v1.14.1) (2025-05-13)
2
11
 
3
12
 
@@ -78,24 +78,23 @@
78
78
  />
79
79
  </scroll-view>
80
80
  </view>
81
+ <sar-popout
82
+ v-if="!severalMonths"
83
+ v-model:visible="pickerVisible"
84
+ type="compact"
85
+ @confirm="onPickerConfirm"
86
+ >
87
+ <template #visible="{ already }">
88
+ <sar-datetime-picker
89
+ v-if="already"
90
+ type="yM"
91
+ v-model="pickerValue"
92
+ :min="minDate"
93
+ :max="maxDate"
94
+ />
95
+ </template>
96
+ </sar-popout>
81
97
  </view>
82
-
83
- <sar-popout
84
- v-if="!severalMonths"
85
- v-model:visible="pickerVisible"
86
- type="compact"
87
- @confirm="onPickerConfirm"
88
- >
89
- <template #visible="{ already }">
90
- <sar-datetime-picker
91
- v-if="already"
92
- type="yM"
93
- v-model="pickerValue"
94
- :min="minDate"
95
- :max="maxDate"
96
- />
97
- </template>
98
- </sar-popout>
99
98
  </template>
100
99
 
101
100
  <script>
@@ -5,40 +5,42 @@
5
5
  :readonly="readonly"
6
6
  :disabled="disabled"
7
7
  :clearable="clearable"
8
- @clear="onClear"
9
- @click="onInputClick"
10
- />
11
-
12
- <sar-popout
13
8
  :root-class="rootClass"
14
9
  :root-style="rootStyle"
15
- :visible="innerVisible"
16
- @update:visible="onVisible"
17
- :title="title ?? placeholder"
18
- :show-confirm="showConfirm"
19
- :confirm-disabled="confirmDisabled"
20
- @confirm="onConfirm"
10
+ @clear="onClear"
11
+ @click="onInputClick"
21
12
  >
22
- <template #visible="{ already }">
23
- <sar-calendar
24
- v-if="already"
25
- :model-value="popoutValue"
26
- @change="onChange"
27
- :type="type"
28
- :min="min"
29
- :max="max"
30
- :current-date="currentDate"
31
- :disabled-date="disabledDate"
32
- :max-days="maxDays"
33
- :over-max-days="overMaxDays"
34
- :week-starts-on="weekStartsOn"
35
- :formatter="formatter"
36
- :allow-same-day="allowSameDay"
37
- :several-months="severalMonths"
38
- :value-format="valueFormat"
39
- />
40
- </template>
41
- </sar-popout>
13
+ <sar-popout
14
+ :visible="innerVisible"
15
+ :title="title ?? placeholder"
16
+ :show-confirm="showConfirm"
17
+ :confirm-disabled="confirmDisabled"
18
+ :root-class="popoutClass"
19
+ :root-style="popoutStyle"
20
+ @update:visible="onVisible"
21
+ @confirm="onConfirm"
22
+ >
23
+ <template #visible="{ already }">
24
+ <sar-calendar
25
+ v-if="already"
26
+ :model-value="popoutValue"
27
+ @change="onChange"
28
+ :type="type"
29
+ :min="min"
30
+ :max="max"
31
+ :current-date="currentDate"
32
+ :disabled-date="disabledDate"
33
+ :max-days="maxDays"
34
+ :over-max-days="overMaxDays"
35
+ :week-starts-on="weekStartsOn"
36
+ :formatter="formatter"
37
+ :allow-same-day="allowSameDay"
38
+ :several-months="severalMonths"
39
+ :value-format="valueFormat"
40
+ />
41
+ </template>
42
+ </sar-popout>
43
+ </sar-popout-input>
42
44
  </template>
43
45
 
44
46
  <script>
@@ -72,6 +74,8 @@ export default _defineComponent({
72
74
  showConfirm: { type: Boolean, required: false },
73
75
  outletFormat: { type: String, required: false },
74
76
  validateEvent: { type: Boolean, required: false },
77
+ popoutClass: { type: String, required: false },
78
+ popoutStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
75
79
  rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
76
80
  rootClass: { type: String, required: false },
77
81
  type: { type: String, required: false },
@@ -1,11 +1,14 @@
1
1
  import { type CalendarProps } from '../calendar/common';
2
2
  import { type PopoutInputProps } from '../popout-input/common';
3
+ import { type StyleValue } from 'vue';
3
4
  export interface CalendarInputProps extends CalendarProps, Omit<PopoutInputProps, 'modelValue' | 'loading'> {
4
5
  visible?: boolean;
5
6
  title?: string;
6
7
  showConfirm?: boolean;
7
8
  outletFormat?: string;
8
9
  validateEvent?: boolean;
10
+ popoutClass?: string;
11
+ popoutStyle?: StyleValue;
9
12
  }
10
13
  export declare const defaultCalendarInputProps: () => {
11
14
  type: CalendarProps["type"];
@@ -5,38 +5,40 @@
5
5
  :readonly="readonly"
6
6
  :disabled="disabled"
7
7
  :clearable="clearable"
8
- @clear="onClear"
9
- @click="onInputClick"
10
8
  :loading="loading"
11
- />
12
-
13
- <sar-popout
14
9
  :root-class="rootClass"
15
10
  :root-style="rootStyle"
16
- :visible="innerVisible"
17
- @update:visible="onVisible"
18
- :title="title ?? placeholder"
19
- :show-confirm="showConfirm"
20
- @confirm="onConfirm"
11
+ @clear="onClear"
12
+ @click="onInputClick"
21
13
  >
22
- <template #visible="{ already }">
23
- <sar-cascader
24
- v-if="already"
25
- :model-value="popoutValue"
26
- :options="options"
27
- :field-keys="fieldKeys"
28
- :hint-text="hintText"
29
- :change-on-select="changeOnSelect"
30
- :label-render="labelRender"
31
- @select="(option, tabIndex) => $emit('select', option, tabIndex)"
32
- @change="onChange"
33
- >
34
- <template #top="{ tabIndex }">
35
- <slot name="top" :tab-index="tabIndex"></slot>
36
- </template>
37
- </sar-cascader>
38
- </template>
39
- </sar-popout>
14
+ <sar-popout
15
+ :visible="innerVisible"
16
+ :title="title ?? placeholder"
17
+ :show-confirm="showConfirm"
18
+ :root-class="popoutClass"
19
+ :root-style="popoutStyle"
20
+ @confirm="onConfirm"
21
+ @update:visible="onVisible"
22
+ >
23
+ <template #visible="{ already }">
24
+ <sar-cascader
25
+ v-if="already"
26
+ :model-value="popoutValue"
27
+ :options="options"
28
+ :field-keys="fieldKeys"
29
+ :hint-text="hintText"
30
+ :change-on-select="changeOnSelect"
31
+ :label-render="labelRender"
32
+ @select="(option, tabIndex) => $emit('select', option, tabIndex)"
33
+ @change="onChange"
34
+ >
35
+ <template #top="{ tabIndex }">
36
+ <slot name="top" :tab-index="tabIndex"></slot>
37
+ </template>
38
+ </sar-cascader>
39
+ </template>
40
+ </sar-popout>
41
+ </sar-popout-input>
40
42
  </template>
41
43
 
42
44
  <script>
@@ -72,6 +74,8 @@ export default _defineComponent({
72
74
  title: { type: String, required: false },
73
75
  showConfirm: { type: Boolean, required: false },
74
76
  validateEvent: { type: Boolean, required: false },
77
+ popoutClass: { type: String, required: false },
78
+ popoutStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
75
79
  rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
76
80
  rootClass: { type: String, required: false },
77
81
  modelValue: { type: [String, Number], required: false },
@@ -1,10 +1,13 @@
1
1
  import { type CascaderProps, type CascaderOption } from '../cascader/common';
2
2
  import { type PopoutInputProps } from '../popout-input/common';
3
+ import { type StyleValue } from 'vue';
3
4
  export interface CascaderInputProps extends CascaderProps, Omit<PopoutInputProps, 'modelValue'> {
4
5
  visible?: boolean;
5
6
  title?: string;
6
7
  showConfirm?: boolean;
7
8
  validateEvent?: boolean;
9
+ popoutClass?: string;
10
+ popoutStyle?: StyleValue;
8
11
  }
9
12
  export declare const defaultCascaderInputProps: {
10
13
  showConfirm: boolean;
@@ -6,66 +6,68 @@
6
6
  :disabled="disabled"
7
7
  :clearable="clearable"
8
8
  multiline
9
- @clear="onClear"
10
- @click="onInputClick"
11
- />
12
-
13
- <sar-popout
14
9
  :root-class="rootClass"
15
10
  :root-style="rootStyle"
16
- :visible="innerVisible"
17
- @update:visible="onVisible"
18
- :title="title ?? placeholder"
19
- @confirm="onConfirm"
11
+ @clear="onClear"
12
+ @click="onInputClick"
20
13
  >
21
- <template #visible="{ already }">
22
- <view v-if="already" :class="containerClass">
23
- <scroll-view
24
- :class="bem.e('scroll')"
25
- scroll-y
26
- trap-scroll
27
- :upper-threshold="0"
28
- :lower-threshold="0"
29
- :throttle="false"
30
- @scroll="onScroll"
31
- @scrolltoupper="onScrolltoupper"
32
- @scrolltolower="onScrolltolower"
33
- >
34
- <sar-checkbox-group
35
- :size="size"
36
- :type="type"
37
- :checkedColor="checkedColor"
38
- :direction="direction"
39
- :validate-event="false"
40
- :model-value="popoutValue"
41
- @change="onChange"
14
+ <sar-popout
15
+ :visible="innerVisible"
16
+ :title="title ?? placeholder"
17
+ :root-class="popoutClass"
18
+ :root-style="popoutStyle"
19
+ @update:visible="onVisible"
20
+ @confirm="onConfirm"
21
+ >
22
+ <template #visible="{ already }">
23
+ <view v-if="already" :class="containerClass">
24
+ <scroll-view
25
+ :class="bem.e('scroll')"
26
+ scroll-y
27
+ trap-scroll
28
+ :upper-threshold="0"
29
+ :lower-threshold="0"
30
+ :throttle="false"
31
+ @scroll="onScroll"
32
+ @scrolltoupper="onScrolltoupper"
33
+ @scrolltolower="onScrolltolower"
42
34
  >
43
- <template #custom="{ toggle }">
44
- <sar-list inlaid>
45
- <sar-list-item
46
- v-for="option in options"
47
- :key="getMayPrimitiveOption(option, fieldKeys.value)"
48
- :title="getMayPrimitiveOption(option, fieldKeys.label)"
49
- hover
50
- @click="
51
- toggle(getMayPrimitiveOption(option, fieldKeys.value))
52
- "
53
- >
54
- <template #value>
55
- <sar-checkbox
56
- readonly
57
- :value="getMayPrimitiveOption(option, fieldKeys.value)"
58
- :validate-event="false"
59
- />
60
- </template>
61
- </sar-list-item>
62
- </sar-list>
63
- </template>
64
- </sar-checkbox-group>
65
- </scroll-view>
66
- </view>
67
- </template>
68
- </sar-popout>
35
+ <sar-checkbox-group
36
+ :size="size"
37
+ :type="type"
38
+ :checkedColor="checkedColor"
39
+ :direction="direction"
40
+ :validate-event="false"
41
+ :model-value="popoutValue"
42
+ @change="onChange"
43
+ >
44
+ <template #custom="{ toggle }">
45
+ <sar-list inlaid>
46
+ <sar-list-item
47
+ v-for="option in options"
48
+ :key="getMayPrimitiveOption(option, fieldKeys.value)"
49
+ :title="getMayPrimitiveOption(option, fieldKeys.label)"
50
+ hover
51
+ @click="
52
+ toggle(getMayPrimitiveOption(option, fieldKeys.value))
53
+ "
54
+ >
55
+ <template #value>
56
+ <sar-checkbox
57
+ readonly
58
+ :value="getMayPrimitiveOption(option, fieldKeys.value)"
59
+ :validate-event="false"
60
+ />
61
+ </template>
62
+ </sar-list-item>
63
+ </sar-list>
64
+ </template>
65
+ </sar-checkbox-group>
66
+ </scroll-view>
67
+ </view>
68
+ </template>
69
+ </sar-popout>
70
+ </sar-popout-input>
69
71
  </template>
70
72
 
71
73
  <script>
@@ -110,6 +112,8 @@ export default _defineComponent({
110
112
  props: _mergeDefaults({
111
113
  visible: { type: Boolean, required: false },
112
114
  title: { type: String, required: false },
115
+ popoutClass: { type: String, required: false },
116
+ popoutStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
113
117
  rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
114
118
  rootClass: { type: String, required: false },
115
119
  modelValue: { type: Array, required: false },
@@ -1,9 +1,12 @@
1
1
  import { type CheckboxGroupOption, type CheckboxGroupProps } from '../checkbox/common';
2
2
  import { type PopoutInputProps } from '../popout-input/common';
3
+ import { type StyleValue } from 'vue';
3
4
  export type CheckboxInputOption = CheckboxGroupOption;
4
5
  export interface CheckboxInputProps extends CheckboxGroupProps, Omit<PopoutInputProps, 'modelValue'> {
5
6
  visible?: boolean;
6
7
  title?: string;
8
+ popoutClass?: string;
9
+ popoutStyle?: StyleValue;
7
10
  }
8
11
  export declare const defaultCheckboxInputProps: () => {
9
12
  options: () => never[];
@@ -1,11 +1,14 @@
1
1
  import { type DatetimePickerProps } from '../datetime-picker/common';
2
2
  import { type PopoutInputProps } from '../popout-input/common';
3
+ import { type StyleValue } from 'vue';
3
4
  export interface DatetimePickerInputProps extends DatetimePickerProps, Omit<PopoutInputProps, 'modelValue' | 'loading'> {
4
5
  visible?: boolean;
5
6
  title?: string;
6
7
  outletFormat?: string;
7
8
  valueFormat?: string;
8
9
  validateEvent?: boolean;
10
+ popoutClass?: string;
11
+ popoutStyle?: StyleValue;
9
12
  }
10
13
  export declare const defaultDatetimePickerInputProps: () => {
11
14
  validateEvent: boolean;
@@ -5,34 +5,36 @@
5
5
  :readonly="readonly"
6
6
  :disabled="disabled"
7
7
  :clearable="clearable"
8
- @clear="onClear"
9
- @click="onInputClick"
10
- />
11
-
12
- <sar-popout
13
8
  :root-class="rootClass"
14
9
  :root-style="rootStyle"
15
- keep-render
16
- :visible="innerVisible"
17
- @update:visible="onVisible"
18
- :title="title ?? placeholder"
19
- @confirm="onConfirm"
20
- @enter="onEnter"
10
+ @clear="onClear"
11
+ @click="onInputClick"
21
12
  >
22
- <template #visible="{ already }">
23
- <sar-datetime-picker
24
- v-if="already"
25
- :model-value="popoutValue"
26
- @change="onChange"
27
- :type="type"
28
- :min="min"
29
- :max="max"
30
- :filter="filter"
31
- :formatter="formatter"
32
- :value-format="valueFormat"
33
- />
34
- </template>
35
- </sar-popout>
13
+ <sar-popout
14
+ keep-render
15
+ :visible="innerVisible"
16
+ :title="title ?? placeholder"
17
+ :root-class="popoutClass"
18
+ :root-style="popoutStyle"
19
+ @update:visible="onVisible"
20
+ @confirm="onConfirm"
21
+ @enter="onEnter"
22
+ >
23
+ <template #visible="{ already }">
24
+ <sar-datetime-picker
25
+ v-if="already"
26
+ :model-value="popoutValue"
27
+ @change="onChange"
28
+ :type="type"
29
+ :min="min"
30
+ :max="max"
31
+ :filter="filter"
32
+ :formatter="formatter"
33
+ :value-format="valueFormat"
34
+ />
35
+ </template>
36
+ </sar-popout>
37
+ </sar-popout-input>
36
38
  </template>
37
39
 
38
40
  <script>
@@ -71,6 +73,8 @@ export default _defineComponent({
71
73
  outletFormat: { type: String, required: false },
72
74
  valueFormat: { type: String, required: false },
73
75
  validateEvent: { type: Boolean, required: false },
76
+ popoutClass: { type: String, required: false },
77
+ popoutStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
74
78
  rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
75
79
  rootClass: { type: String, required: false },
76
80
  type: { type: String, required: false },
@@ -1,11 +1,14 @@
1
1
  import { type DatetimeRangePickerProps } from '../datetime-range-picker/common';
2
2
  import { type PopoutInputProps } from '../popout-input/common';
3
+ import { type StyleValue } from 'vue';
3
4
  export interface DatetimeRangePickerInputProps extends DatetimeRangePickerProps, Omit<PopoutInputProps, 'modelValue' | 'loading'> {
4
5
  visible?: boolean;
5
6
  title?: string;
6
7
  outletFormat?: string;
7
8
  valueFormat?: string;
8
9
  validateEvent?: boolean;
10
+ popoutClass?: string;
11
+ popoutStyle?: StyleValue;
9
12
  }
10
13
  export declare const defaultDatetimeRangePickerInputProps: () => {
11
14
  validateEvent: boolean;
@@ -5,35 +5,37 @@
5
5
  :readonly="readonly"
6
6
  :disabled="disabled"
7
7
  :clearable="clearable"
8
- @clear="onClear"
9
- @click="onInputClick"
10
- />
11
-
12
- <sar-popout
13
8
  :root-class="rootClass"
14
9
  :root-style="rootStyle"
15
- keep-render
16
- :visible="innerVisible"
17
- @update:visible="onVisible"
18
- :title="title ?? placeholder"
19
- @confirm="onConfirm"
20
- @enter="onEnter"
10
+ @clear="onClear"
11
+ @click="onInputClick"
21
12
  >
22
- <template #visible="{ already }">
23
- <sar-datetime-range-picker
24
- v-if="already"
25
- :model-value="popoutValue"
26
- @change="onChange"
27
- :type="type"
28
- :min="min"
29
- :max="max"
30
- :filter="filter"
31
- :formatter="formatter"
32
- :value-format="valueFormat"
33
- :tabs="tabs"
34
- />
35
- </template>
36
- </sar-popout>
13
+ <sar-popout
14
+ keep-render
15
+ :visible="innerVisible"
16
+ :title="title ?? placeholder"
17
+ :root-class="popoutClass"
18
+ :root-style="popoutStyle"
19
+ @update:visible="onVisible"
20
+ @confirm="onConfirm"
21
+ @enter="onEnter"
22
+ >
23
+ <template #visible="{ already }">
24
+ <sar-datetime-range-picker
25
+ v-if="already"
26
+ :model-value="popoutValue"
27
+ @change="onChange"
28
+ :type="type"
29
+ :min="min"
30
+ :max="max"
31
+ :filter="filter"
32
+ :formatter="formatter"
33
+ :value-format="valueFormat"
34
+ :tabs="tabs"
35
+ />
36
+ </template>
37
+ </sar-popout>
38
+ </sar-popout-input>
37
39
  </template>
38
40
 
39
41
  <script>
@@ -73,6 +75,8 @@ export default _defineComponent({
73
75
  outletFormat: { type: String, required: false },
74
76
  valueFormat: { type: String, required: false },
75
77
  validateEvent: { type: Boolean, required: false },
78
+ popoutClass: { type: String, required: false },
79
+ popoutStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
76
80
  modelValue: { type: Array, required: false },
77
81
  tabs: { type: Array, required: false },
78
82
  rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
@@ -76,4 +76,5 @@ export interface InputEmits {
76
76
  (e: 'linechange', event: any): void;
77
77
  (e: 'confirm', event: any): void;
78
78
  (e: 'keyboardheightchange', event: any): void;
79
+ (e: 'click', event: any): void;
79
80
  }
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view :class="inputClass" :style="inputStyle">
2
+ <view :class="inputClass" :style="inputStyle" @click="onClick">
3
3
  <view :class="bem.e('content')">
4
4
  <view v-if="$slots.prepend" :class="bem.e('prepend')">
5
5
  <slot name="prepend"></slot>
@@ -185,7 +185,7 @@ export default _defineComponent({
185
185
  minHeight: { type: String, required: false },
186
186
  validateEvent: { type: Boolean, required: false }
187
187
  }, defaultInputProps),
188
- emits: ["update:model-value", "change", "input", "clear", "focus", "blur", "linechange", "confirm", "keyboardheightchange"],
188
+ emits: ["update:model-value", "change", "input", "clear", "focus", "blur", "linechange", "confirm", "keyboardheightchange", "click"],
189
189
  setup(__props, { expose: __expose, emit: __emit }) {
190
190
  __expose();
191
191
  const props = __props;
@@ -276,6 +276,9 @@ export default _defineComponent({
276
276
  const onKeyboardheightchange = (event) => {
277
277
  emit("keyboardheightchange", event);
278
278
  };
279
+ const onClick = (event) => {
280
+ emit("click", event);
281
+ };
279
282
  const inputClass = computed(() => {
280
283
  return classNames(
281
284
  bem.b(),
@@ -308,7 +311,7 @@ export default _defineComponent({
308
311
  return oldValue;
309
312
  }, set oldValue(v) {
310
313
  oldValue = v;
311
- }, onFocus, onBlur, clearVisible, holdupClear, onClearTouchStart, onClearTouchEnd, onClearMouseDown, onClearClick, onLinechange, onConfirm, onKeyboardheightchange, inputClass, inputStyle, controlStyle, mergedPlaceholderStyle, get classNames() {
314
+ }, onFocus, onBlur, clearVisible, holdupClear, onClearTouchStart, onClearTouchEnd, onClearMouseDown, onClearClick, onLinechange, onConfirm, onKeyboardheightchange, onClick, inputClass, inputStyle, controlStyle, mergedPlaceholderStyle, get classNames() {
312
315
  return classNames;
313
316
  }, SarIcon };
314
317
  return __returned__;
@@ -1,9 +1,12 @@
1
1
  import { type PickerProps } from '../picker/common';
2
2
  import { type PopoutInputProps } from '../popout-input/common';
3
+ import { type StyleValue } from 'vue';
3
4
  export interface PickerInputProps extends PickerProps, Omit<PopoutInputProps, 'modelValue'> {
4
5
  visible?: boolean;
5
6
  title?: string;
6
7
  validateEvent?: boolean;
8
+ popoutClass?: string;
9
+ popoutStyle?: StyleValue;
7
10
  }
8
11
  export declare const defaultPickerInputProps: () => {
9
12
  validateEvent: boolean;
@@ -5,31 +5,33 @@
5
5
  :readonly="readonly"
6
6
  :disabled="disabled"
7
7
  :clearable="clearable"
8
- @clear="onClear"
9
- @click="onInputClick"
10
- />
11
-
12
- <sar-popout
13
8
  :root-class="rootClass"
14
9
  :root-style="rootStyle"
15
- keep-render
16
- :visible="innerVisible"
17
- @update:visible="onVisible"
18
- :title="title ?? placeholder"
19
- @confirm="onConfirm"
20
- @enter="onEnter"
10
+ @clear="onClear"
11
+ @click="onInputClick"
21
12
  >
22
- <template #visible="{ already }">
23
- <sar-picker
24
- v-if="already"
25
- :model-value="popoutValue"
26
- @change="onChange"
27
- :columns="columns"
28
- :option-keys="optionKeys"
29
- :immediate-change="immediateChange"
30
- />
31
- </template>
32
- </sar-popout>
13
+ <sar-popout
14
+ keep-render
15
+ :visible="innerVisible"
16
+ :title="title ?? placeholder"
17
+ :root-class="popoutClass"
18
+ :root-style="popoutStyle"
19
+ @update:visible="onVisible"
20
+ @confirm="onConfirm"
21
+ @enter="onEnter"
22
+ >
23
+ <template #visible="{ already }">
24
+ <sar-picker
25
+ v-if="already"
26
+ :model-value="popoutValue"
27
+ @change="onChange"
28
+ :columns="columns"
29
+ :option-keys="optionKeys"
30
+ :immediate-change="immediateChange"
31
+ />
32
+ </template>
33
+ </sar-popout>
34
+ </sar-popout-input>
33
35
  </template>
34
36
 
35
37
  <script>
@@ -67,6 +69,8 @@ export default _defineComponent({
67
69
  visible: { type: Boolean, required: false },
68
70
  title: { type: String, required: false },
69
71
  validateEvent: { type: Boolean, required: false },
72
+ popoutClass: { type: String, required: false },
73
+ popoutStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
70
74
  rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
71
75
  rootClass: { type: String, required: false },
72
76
  columns: { type: Array, required: false },
@@ -1,5 +1,8 @@
1
1
  import { type PopoutInputProps } from './common';
2
- declare const _default: import("vue").DefineComponent<PopoutInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
2
+ declare function __VLS_template(): {
3
+ default?(_: {}): any;
4
+ };
5
+ declare const __VLS_component: import("vue").DefineComponent<PopoutInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
3
6
  "update:model-value": (value: string) => any;
4
7
  click: (event: any) => any;
5
8
  change: (value: string) => any;
@@ -10,4 +13,10 @@ declare const _default: import("vue").DefineComponent<PopoutInputProps, {}, {},
10
13
  onChange?: ((value: string) => any) | undefined;
11
14
  onClear?: (() => any) | undefined;
12
15
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
13
17
  export default _default;
18
+ type __VLS_WithTemplateSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -31,10 +31,12 @@
31
31
  @touchstart="onSealTouchStart"
32
32
  @touchend="onSealTouchEnd"
33
33
  @touchcancel="onSealTouchEnd"
34
- @click="onClick"
34
+ @click="onSealClick"
35
35
  />
36
36
  </template>
37
37
  </sar-input>
38
+
39
+ <slot></slot>
38
40
  </view>
39
41
  </template>
40
42
 
@@ -126,7 +128,7 @@ export default _defineComponent({
126
128
  document.addEventListener("mouseup", upHandler);
127
129
  // #endif
128
130
  };
129
- const onClick = (event) => {
131
+ const onSealClick = (event) => {
130
132
  if (interoperable.value) {
131
133
  emit("click", event);
132
134
  }
@@ -144,7 +146,7 @@ export default _defineComponent({
144
146
  const popoutInputStyle = computed(() => {
145
147
  return stringifyStyle(props.rootStyle);
146
148
  });
147
- const __returned__ = { props, emit, bem, formContext, isDisabled, isReadonly, innerValue, setInnerValue, onChange, onClear, isSealDown, interoperable, onSealTouchStart, onSealTouchEnd, onSealMouseDown, onClick, popoutInputClass, popoutInputStyle, SarInput, SarIcon, SarLoading };
149
+ const __returned__ = { props, emit, bem, formContext, isDisabled, isReadonly, innerValue, setInnerValue, onChange, onClear, isSealDown, interoperable, onSealTouchStart, onSealTouchEnd, onSealMouseDown, onSealClick, popoutInputClass, popoutInputStyle, SarInput, SarIcon, SarLoading };
148
150
  return __returned__;
149
151
  }
150
152
  });
@@ -1,9 +1,12 @@
1
1
  import { type RadioGroupOption, type RadioGroupProps } from '../radio/common';
2
2
  import { type PopoutInputProps } from '../popout-input/common';
3
+ import { type StyleValue } from 'vue';
3
4
  export type RadioInputOption = RadioGroupOption;
4
5
  export interface RadioInputProps extends RadioGroupProps, Omit<PopoutInputProps, 'modelValue'> {
5
6
  visible?: boolean;
6
7
  title?: string;
8
+ popoutClass?: string;
9
+ popoutStyle?: StyleValue;
7
10
  }
8
11
  export declare const defaultRadioInputProps: () => {
9
12
  options: () => never[];
@@ -5,66 +5,67 @@
5
5
  :readonly="readonly"
6
6
  :disabled="disabled"
7
7
  :clearable="clearable"
8
- @clear="onClear"
9
- @click="onInputClick"
10
- />
11
-
12
- <sar-popout
13
8
  :root-class="rootClass"
14
9
  :root-style="rootStyle"
15
- :visible="innerVisible"
16
- @update:visible="onVisible"
17
- :title="title ?? placeholder"
18
- :show-footer="false"
19
- @confirm="onConfirm"
10
+ @clear="onClear"
11
+ @click="onInputClick"
20
12
  >
21
- <template #visible="{ already }">
22
- <view v-if="already" :class="containerClass">
23
- <scroll-view
24
- :class="bem.e('scroll')"
25
- scroll-y
26
- trap-scroll
27
- :upper-threshold="0"
28
- :lower-threshold="0"
29
- :throttle="false"
30
- @scroll="onScroll"
31
- @scrolltoupper="onScrolltoupper"
32
- @scrolltolower="onScrolltolower"
33
- >
34
- <sar-radio-group
35
- :size="size"
36
- :type="type"
37
- :checkedColor="checkedColor"
38
- :direction="direction"
39
- :validate-event="false"
40
- :model-value="popoutValue"
41
- @change="onChange"
13
+ <sar-popout
14
+ :visible="innerVisible"
15
+ :title="title ?? placeholder"
16
+ :root-class="popoutClass"
17
+ :root-style="popoutStyle"
18
+ @update:visible="onVisible"
19
+ @confirm="onConfirm"
20
+ >
21
+ <template #visible="{ already }">
22
+ <view v-if="already" :class="containerClass">
23
+ <scroll-view
24
+ :class="bem.e('scroll')"
25
+ scroll-y
26
+ trap-scroll
27
+ :upper-threshold="0"
28
+ :lower-threshold="0"
29
+ :throttle="false"
30
+ @scroll="onScroll"
31
+ @scrolltoupper="onScrolltoupper"
32
+ @scrolltolower="onScrolltolower"
42
33
  >
43
- <template #custom="{ toggle }">
44
- <sar-list inlaid>
45
- <sar-list-item
46
- v-for="option in options"
47
- :key="getMayPrimitiveOption(option, fieldKeys.value)"
48
- :title="getMayPrimitiveOption(option, fieldKeys.label)"
49
- hover
50
- @click="
51
- toggle(getMayPrimitiveOption(option, fieldKeys.value))
52
- "
53
- >
54
- <template #value>
55
- <sar-radio
56
- readonly
57
- :value="getMayPrimitiveOption(option, fieldKeys.value)"
58
- />
59
- </template>
60
- </sar-list-item>
61
- </sar-list>
62
- </template>
63
- </sar-radio-group>
64
- </scroll-view>
65
- </view>
66
- </template>
67
- </sar-popout>
34
+ <sar-radio-group
35
+ :size="size"
36
+ :type="type"
37
+ :checkedColor="checkedColor"
38
+ :direction="direction"
39
+ :validate-event="false"
40
+ :model-value="popoutValue"
41
+ @change="onChange"
42
+ >
43
+ <template #custom="{ toggle }">
44
+ <sar-list inlaid>
45
+ <sar-list-item
46
+ v-for="option in options"
47
+ :key="getMayPrimitiveOption(option, fieldKeys.value)"
48
+ :title="getMayPrimitiveOption(option, fieldKeys.label)"
49
+ hover
50
+ @click="
51
+ toggle(getMayPrimitiveOption(option, fieldKeys.value))
52
+ "
53
+ >
54
+ <template #value>
55
+ <sar-radio
56
+ readonly
57
+ :value="getMayPrimitiveOption(option, fieldKeys.value)"
58
+ />
59
+ </template>
60
+ </sar-list-item>
61
+ </sar-list>
62
+ </template>
63
+ </sar-radio-group>
64
+ </scroll-view>
65
+ </view>
66
+ </template>
67
+ </sar-popout>
68
+ </sar-popout-input>
68
69
  </template>
69
70
 
70
71
  <script>
@@ -107,6 +108,8 @@ export default _defineComponent({
107
108
  props: _mergeDefaults({
108
109
  visible: { type: Boolean, required: false },
109
110
  title: { type: String, required: false },
111
+ popoutClass: { type: String, required: false },
112
+ popoutStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
110
113
  rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
111
114
  rootClass: { type: String, required: false },
112
115
  modelValue: { type: null, required: false },
@@ -150,8 +153,6 @@ export default _defineComponent({
150
153
  });
151
154
  const onChange = (value) => {
152
155
  popoutValue.value = value;
153
- onConfirm();
154
- innerVisible.value = false;
155
156
  };
156
157
  const onConfirm = () => {
157
158
  innerValue.value = popoutValue.value;
@@ -1,16 +1,19 @@
1
1
  import { type StyleValue } from 'vue';
2
2
  export type SpaceSize = 'small' | 'middle' | 'large';
3
3
  export type SpaceAlign = 'start' | 'end' | 'center' | 'baseline';
4
+ export type SpaceJustify = 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
4
5
  export interface SpaceProps {
5
6
  rootStyle?: StyleValue;
6
7
  rootClass?: string;
7
8
  direction?: 'vertical' | 'horizontal';
8
9
  size?: SpaceSize | (string & {});
9
10
  align?: SpaceAlign | (string & {});
11
+ justify?: SpaceJustify | (string & {});
10
12
  wrap?: boolean;
11
13
  }
12
14
  export declare const spaceSizes: string[];
13
15
  export declare const spaceMapAlign: Record<string, string>;
16
+ export declare const spaceMapJustify: Record<string, string>;
14
17
  export declare const defaultSpaceProps: {
15
18
  direction: SpaceProps["direction"];
16
19
  size: SpaceProps["size"];
@@ -4,4 +4,11 @@ export const spaceMapAlign = {
4
4
  start: 'flex-start',
5
5
  end: 'flex-end',
6
6
  };
7
+ export const spaceMapJustify = {
8
+ start: 'flex-start',
9
+ end: 'flex-end',
10
+ between: 'space-between',
11
+ around: 'space-around',
12
+ evenly: 'space-evenly',
13
+ };
7
14
  export const defaultSpaceProps = defaultConfig.space;
@@ -11,6 +11,7 @@ import { classNames, stringifyStyle, createBem } from "../../utils";
11
11
  import {
12
12
  defaultSpaceProps,
13
13
  spaceMapAlign,
14
+ spaceMapJustify,
14
15
  spaceSizes
15
16
  } from "./common";
16
17
  export default _defineComponent({
@@ -27,6 +28,7 @@ export default _defineComponent({
27
28
  direction: { type: String, required: false },
28
29
  size: { type: [String, Object], required: false },
29
30
  align: { type: [String, Object], required: false },
31
+ justify: { type: [String, Object], required: false },
30
32
  wrap: { type: Boolean, required: false }
31
33
  }, defaultSpaceProps),
32
34
  setup(__props, { expose: __expose }) {
@@ -49,7 +51,8 @@ export default _defineComponent({
49
51
  return stringifyStyle(
50
52
  {
51
53
  gap: presetSize.value ? null : props.size,
52
- alignItems: (props.align && spaceMapAlign[props.align]) ?? props.align
54
+ alignItems: (props.align && spaceMapAlign[props.align]) ?? props.align,
55
+ justifyContent: (props.justify && spaceMapJustify[props.justify]) ?? props.justify
53
56
  },
54
57
  props.rootStyle
55
58
  );
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.14.1",
5
+ "version": "1.14.2",
6
6
  "description": "sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库",
7
7
  "main": "index.js",
8
8
  "scripts": {