sard-uniapp 1.15.4 → 1.16.0

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.
Files changed (106) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/components/calendar-input/calendar-input.vue +26 -89
  3. package/components/calendar-input/common.d.ts +7 -17
  4. package/components/calendar-input/common.js +2 -1
  5. package/components/calendar-popout/calendar-popout.d.ts +17 -0
  6. package/components/calendar-popout/calendar-popout.vue +102 -0
  7. package/components/calendar-popout/common.d.ts +27 -0
  8. package/components/calendar-popout/common.js +5 -0
  9. package/components/calendar-popout/index.d.ts +1 -0
  10. package/components/calendar-popout/index.js +1 -0
  11. package/components/cascader-input/cascader-input.vue +26 -89
  12. package/components/cascader-input/common.d.ts +5 -19
  13. package/components/cascader-input/common.js +3 -1
  14. package/components/cascader-popout/cascader-popout.d.ts +23 -0
  15. package/components/cascader-popout/cascader-popout.vue +88 -0
  16. package/components/cascader-popout/common.d.ts +27 -0
  17. package/components/cascader-popout/common.js +2 -0
  18. package/components/cascader-popout/index.d.ts +1 -0
  19. package/components/cascader-popout/index.js +1 -0
  20. package/components/checkbox-input/checkbox-input.vue +21 -141
  21. package/components/checkbox-input/common.d.ts +4 -11
  22. package/components/checkbox-input/common.js +2 -5
  23. package/components/checkbox-popout/checkbox-popout.d.ts +21 -0
  24. package/components/checkbox-popout/checkbox-popout.vue +136 -0
  25. package/components/checkbox-popout/common.d.ts +22 -0
  26. package/components/checkbox-popout/common.js +5 -0
  27. package/components/checkbox-popout/index.d.ts +1 -0
  28. package/components/checkbox-popout/index.js +1 -0
  29. package/components/{checkbox-input → checkbox-popout}/index.scss +2 -2
  30. package/components/{checkbox-input → checkbox-popout}/variables.scss +1 -1
  31. package/components/config/index.d.ts +9 -7
  32. package/components/config/index.js +9 -7
  33. package/components/datetime-picker-input/common.d.ts +3 -13
  34. package/components/datetime-picker-input/common.js +1 -1
  35. package/components/datetime-picker-input/datetime-picker-input.vue +22 -109
  36. package/components/datetime-picker-popout/common.d.ts +23 -0
  37. package/components/datetime-picker-popout/common.js +5 -0
  38. package/components/datetime-picker-popout/datetime-picker-popout.d.ts +21 -0
  39. package/components/datetime-picker-popout/datetime-picker-popout.vue +113 -0
  40. package/components/datetime-picker-popout/index.d.ts +1 -0
  41. package/components/datetime-picker-popout/index.js +1 -0
  42. package/components/datetime-range-picker-input/common.d.ts +3 -13
  43. package/components/datetime-range-picker-input/common.js +1 -1
  44. package/components/datetime-range-picker-input/datetime-range-picker-input.vue +23 -97
  45. package/components/datetime-range-picker-popout/common.d.ts +23 -0
  46. package/components/datetime-range-picker-popout/common.js +5 -0
  47. package/components/datetime-range-picker-popout/datetime-range-picker-popout.d.ts +21 -0
  48. package/components/datetime-range-picker-popout/datetime-range-picker-popout.vue +102 -0
  49. package/components/datetime-range-picker-popout/index.d.ts +1 -0
  50. package/components/datetime-range-picker-popout/index.js +1 -0
  51. package/components/navbar/navbar.vue +1 -1
  52. package/components/navbar-pit/common.d.ts +6 -0
  53. package/components/navbar-pit/common.js +1 -0
  54. package/components/navbar-pit/index.d.ts +1 -0
  55. package/components/navbar-pit/index.js +1 -0
  56. package/components/navbar-pit/index.scss +11 -0
  57. package/components/navbar-pit/navbar-pit.d.ts +2 -1
  58. package/components/navbar-pit/navbar-pit.vue +29 -4
  59. package/components/picker-input/common.d.ts +3 -12
  60. package/components/picker-input/common.js +2 -4
  61. package/components/picker-input/picker-input.vue +16 -77
  62. package/components/picker-popout/common.d.ts +24 -0
  63. package/components/picker-popout/common.js +6 -0
  64. package/components/picker-popout/index.d.ts +1 -0
  65. package/components/picker-popout/index.js +1 -0
  66. package/components/picker-popout/picker-popout.d.ts +22 -0
  67. package/components/picker-popout/picker-popout.vue +84 -0
  68. package/components/popout-input/common.d.ts +2 -0
  69. package/components/popout-input/popout-input.d.ts +2 -0
  70. package/components/popout-input/popout-input.vue +4 -0
  71. package/components/radio-input/common.d.ts +4 -11
  72. package/components/radio-input/common.js +2 -5
  73. package/components/radio-input/radio-input.vue +21 -140
  74. package/components/radio-popout/common.d.ts +23 -0
  75. package/components/radio-popout/common.js +5 -0
  76. package/components/radio-popout/index.d.ts +1 -0
  77. package/components/radio-popout/index.js +1 -0
  78. package/components/{radio-input → radio-popout}/index.scss +2 -2
  79. package/components/radio-popout/radio-popout.d.ts +22 -0
  80. package/components/radio-popout/radio-popout.vue +135 -0
  81. package/components/{radio-input → radio-popout}/variables.scss +1 -1
  82. package/components/signature/signature.d.ts +2 -2
  83. package/components/tabbar/common.d.ts +2 -0
  84. package/components/tabbar/index.scss +13 -0
  85. package/components/tabbar/tabbar.vue +10 -2
  86. package/components/tabbar/variables.scss +1 -0
  87. package/components/tabbar-pit/common.d.ts +13 -0
  88. package/components/tabbar-pit/common.js +1 -0
  89. package/components/tabbar-pit/index.d.ts +1 -0
  90. package/components/tabbar-pit/index.js +1 -0
  91. package/components/tabbar-pit/index.scss +12 -0
  92. package/components/tabbar-pit/tabbar-pit.d.ts +10 -0
  93. package/components/tabbar-pit/tabbar-pit.vue +46 -0
  94. package/global.d.ts +8 -0
  95. package/index.d.ts +9 -0
  96. package/index.js +9 -0
  97. package/index.scss +2 -2
  98. package/package.json +3 -3
  99. package/use/index.d.ts +3 -0
  100. package/use/index.js +3 -0
  101. package/use/useFormPopout.d.ts +20 -0
  102. package/use/useFormPopout.js +42 -0
  103. package/use/usePopoutInput.d.ts +19 -0
  104. package/use/usePopoutInput.js +39 -0
  105. package/use/useTwoWayVisible.d.ts +9 -0
  106. package/use/useTwoWayVisible.js +13 -0
@@ -8,95 +8,41 @@
8
8
  :root-class="rootClass"
9
9
  :root-style="rootStyle"
10
10
  @clear="onClear"
11
- @click="onInputClick"
11
+ @click="show"
12
12
  >
13
- <sar-popout
14
- :visible="innerVisible"
13
+ <sar-radio-popout
14
+ v-model:visible="innerVisible"
15
+ v-model="innerValue"
15
16
  :title="title ?? placeholder"
16
17
  :root-class="popoutClass"
17
18
  :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"
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"
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>
19
+ :size="size"
20
+ :type="type"
21
+ :checkedColor="checkedColor"
22
+ :direction="direction"
23
+ :options="options"
24
+ :option-keys="optionKeys"
25
+ :validate-event="validateEvent"
26
+ @change="onChange"
27
+ />
68
28
  </sar-popout-input>
69
29
  </template>
70
30
 
71
31
  <script>
72
32
  import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
73
- import { ref, watch, computed } from "vue";
33
+ import { watch, computed } from "vue";
74
34
  import SarPopoutInput from "../popout-input/popout-input.vue";
75
- import SarPopout from "../popout/popout.vue";
76
- import SarRadioGroup from "../radio-group/radio-group.vue";
77
- import SarRadio from "../radio/radio.vue";
78
- import SarList from "../list/list.vue";
79
- import SarListItem from "../list-item/list-item.vue";
35
+ import SarRadioPopout from "../radio-popout/radio-popout.vue";
80
36
  import { defaultOptionKeys } from "../radio/common";
81
37
  import {
82
38
  defaultRadioInputProps
83
39
  } from "./common";
84
- import {
85
- classNames,
86
- createBem,
87
- getMayPrimitiveOption,
88
- isNullish
89
- } from "../../utils";
90
- import { useFormItemContext } from "../form/common";
91
- import { useScrollSide } from "../../use";
40
+ import { getMayPrimitiveOption, isNullish } from "../../utils";
41
+ import { usePopoutInput } from "../../use";
92
42
  export default _defineComponent({
93
43
  components: {
94
44
  SarPopoutInput,
95
- SarPopout,
96
- SarRadioGroup,
97
- SarRadio,
98
- SarList,
99
- SarListItem,
45
+ SarRadioPopout,
100
46
  },
101
47
  ...{
102
48
  options: {
@@ -132,35 +78,10 @@ export default _defineComponent({
132
78
  __expose();
133
79
  const props = __props;
134
80
  const emit = __emit;
135
- const bem = createBem("radio-input");
136
- const formItemContext = useFormItemContext();
81
+ const { innerVisible, innerValue, inputValue, show, onChange, onClear } = usePopoutInput(props, emit);
137
82
  const fieldKeys = computed(() => {
138
83
  return Object.assign({}, defaultOptionKeys, props.optionKeys);
139
84
  });
140
- const innerValue = ref(props.modelValue);
141
- watch(
142
- () => props.modelValue,
143
- () => {
144
- innerValue.value = props.modelValue;
145
- if (props.validateEvent) {
146
- formItemContext?.onChange();
147
- }
148
- }
149
- );
150
- const popoutValue = ref(props.modelValue);
151
- watch(innerValue, () => {
152
- popoutValue.value = innerValue.value;
153
- });
154
- const onChange = (value) => {
155
- popoutValue.value = value;
156
- };
157
- const onConfirm = () => {
158
- innerValue.value = popoutValue.value;
159
- emit("update:model-value", popoutValue.value);
160
- emit("change", popoutValue.value);
161
- inputValue.value = getInputValue();
162
- };
163
- const inputValue = ref("");
164
85
  function getOutletText(options, optionKeys, value) {
165
86
  const option = options.find(
166
87
  (option2) => getMayPrimitiveOption(option2, optionKeys.value) === value
@@ -174,7 +95,7 @@ export default _defineComponent({
174
95
  return getOutletText(props.options, fieldKeys.value, innerValue.value);
175
96
  }
176
97
  watch(
177
- innerValue,
98
+ [innerValue, () => props.options],
178
99
  () => {
179
100
  inputValue.value = getInputValue();
180
101
  },
@@ -182,48 +103,8 @@ export default _defineComponent({
182
103
  immediate: true
183
104
  }
184
105
  );
185
- watch(
186
- () => props.options,
187
- () => {
188
- inputValue.value = getInputValue();
189
- }
190
- );
191
- const onClear = () => {
192
- inputValue.value = "";
193
- innerValue.value = void 0;
194
- emit("update:model-value", void 0);
195
- emit("change", void 0);
196
- };
197
- const innerVisible = ref(props.visible);
198
- watch(
199
- () => props.visible,
200
- () => {
201
- innerVisible.value = props.visible;
202
- }
203
- );
204
- const onVisible = (visible) => {
205
- innerVisible.value = visible;
206
- emit("update:visible", visible);
207
- };
208
- const onInputClick = () => {
209
- innerVisible.value = true;
210
- emit("update:visible", true);
211
- };
212
- const { scrollSide, onScroll, onScrolltoupper, onScrolltolower } = useScrollSide();
213
- const containerClass = computed(() => {
214
- return classNames(
215
- bem.e("container"),
216
- bem.em("container", scrollSide.value, scrollSide.value)
217
- );
218
- });
219
- const __returned__ = { props, emit, bem, formItemContext, fieldKeys, innerValue, popoutValue, onChange, onConfirm, inputValue, getOutletText, getInputValue, onClear, innerVisible, onVisible, onInputClick, scrollSide, onScroll, onScrolltoupper, onScrolltolower, containerClass, SarPopoutInput, SarPopout, SarRadioGroup, SarRadio, SarList, SarListItem, get getMayPrimitiveOption() {
220
- return getMayPrimitiveOption;
221
- } };
106
+ const __returned__ = { props, emit, innerVisible, innerValue, inputValue, show, onChange, onClear, fieldKeys, getOutletText, getInputValue, SarPopoutInput, SarRadioPopout };
222
107
  return __returned__;
223
108
  }
224
109
  });
225
110
  </script>
226
-
227
- <style lang="scss">
228
- @import './index.scss';
229
- </style>
@@ -0,0 +1,23 @@
1
+ import { type StyleValue } from 'vue';
2
+ import { type RadioGroupProps } from '../radio/common';
3
+ export interface RadioPopoutProps extends RadioGroupProps {
4
+ visible?: boolean;
5
+ title?: string;
6
+ popoutClass?: string;
7
+ popoutStyle?: StyleValue;
8
+ }
9
+ export declare const defaultRadioPopoutProps: () => {
10
+ options: () => never[];
11
+ validateEvent: boolean;
12
+ type: import("../radio-input").RadioInputProps["type"];
13
+ };
14
+ export interface RadioPopoutSlots {
15
+ default?(props: Record<string, never>): any;
16
+ }
17
+ export interface RadioPopoutEmits {
18
+ (e: 'update:visible', visible: boolean): void;
19
+ (e: 'update:model-value', value: any): void;
20
+ (e: 'change', value: any): void;
21
+ }
22
+ export interface RadioPopoutExpose {
23
+ }
@@ -0,0 +1,5 @@
1
+ import { defaultConfig } from '../config';
2
+ export const defaultRadioPopoutProps = () => ({
3
+ ...defaultConfig.radioPopout,
4
+ options: () => [],
5
+ });
@@ -0,0 +1 @@
1
+ export type { RadioPopoutProps, RadioPopoutSlots, RadioPopoutEmits, RadioPopoutExpose, } from './common';
@@ -0,0 +1 @@
1
+ export {};
@@ -1,11 +1,11 @@
1
1
  @use '../style/base' as *;
2
2
 
3
- @include bem(radio-input) {
3
+ @include bem(radio-popout) {
4
4
  @include e(container) {
5
5
  @include scroll-shadow;
6
6
  }
7
7
 
8
8
  @include e(scroll) {
9
- max-height: var(--sar-checkbox-input-max-height);
9
+ max-height: var(--sar-radio-popout-max-height);
10
10
  }
11
11
  }
@@ -0,0 +1,22 @@
1
+ import { type RadioPopoutProps, type RadioPopoutSlots } from './common';
2
+ declare function __VLS_template(): Readonly<RadioPopoutSlots> & RadioPopoutSlots;
3
+ declare const __VLS_component: import("vue").DefineComponent<RadioPopoutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
+ "update:model-value": (value: any) => any;
5
+ change: (value: any) => any;
6
+ "update:visible": (visible: boolean) => any;
7
+ }, string, import("vue").PublicProps, Readonly<RadioPopoutProps> & Readonly<{
8
+ "onUpdate:model-value"?: ((value: any) => any) | undefined;
9
+ onChange?: ((value: any) => any) | undefined;
10
+ "onUpdate:visible"?: ((visible: boolean) => any) | undefined;
11
+ }>, {
12
+ options: import("../radio/common").RadioGroupOption[];
13
+ type: import("../radio/common").IconType;
14
+ validateEvent: boolean;
15
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
17
+ export default _default;
18
+ type __VLS_WithTemplateSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1,135 @@
1
+ <template>
2
+ <sar-popout
3
+ v-model:visible="innerVisible"
4
+ :title="title"
5
+ :root-class="popoutClass"
6
+ :root-style="popoutStyle"
7
+ @confirm="onConfirm"
8
+ >
9
+ <template #visible="{ already }">
10
+ <view v-if="already" :class="containerClass">
11
+ <scroll-view
12
+ :class="bem.e('scroll')"
13
+ scroll-y
14
+ trap-scroll
15
+ :upper-threshold="0"
16
+ :lower-threshold="0"
17
+ :throttle="false"
18
+ @scroll="onScroll"
19
+ @scrolltoupper="onScrolltoupper"
20
+ @scrolltolower="onScrolltolower"
21
+ >
22
+ <sar-radio-group
23
+ :size="size"
24
+ :type="type"
25
+ :checkedColor="checkedColor"
26
+ :direction="direction"
27
+ :validate-event="false"
28
+ :model-value="popoutValue"
29
+ @change="onChange"
30
+ >
31
+ <template #custom="{ toggle }">
32
+ <sar-list inlaid>
33
+ <sar-list-item
34
+ v-for="option in options"
35
+ :key="getMayPrimitiveOption(option, fieldKeys.value)"
36
+ :title="getMayPrimitiveOption(option, fieldKeys.label)"
37
+ hover
38
+ @click="
39
+ toggle(getMayPrimitiveOption(option, fieldKeys.value))
40
+ "
41
+ >
42
+ <template #value>
43
+ <sar-radio
44
+ readonly
45
+ :value="getMayPrimitiveOption(option, fieldKeys.value)"
46
+ />
47
+ </template>
48
+ </sar-list-item>
49
+ </sar-list>
50
+ </template>
51
+ </sar-radio-group>
52
+ </scroll-view>
53
+ </view>
54
+ </template>
55
+ </sar-popout>
56
+ </template>
57
+
58
+ <script>
59
+ import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
60
+ import { computed } from "vue";
61
+ import SarPopout from "../popout/popout.vue";
62
+ import SarRadioGroup from "../radio-group/radio-group.vue";
63
+ import SarRadio from "../radio/radio.vue";
64
+ import SarList from "../list/list.vue";
65
+ import SarListItem from "../list-item/list-item.vue";
66
+ import { classNames, createBem, getMayPrimitiveOption } from "../../utils";
67
+ import {
68
+ defaultRadioPopoutProps
69
+ } from "./common";
70
+ import { defaultOptionKeys } from "../radio/common";
71
+ import { useScrollSide, useFormPopout } from "../../use";
72
+ export default _defineComponent({
73
+ components: {
74
+ SarPopout,
75
+ SarRadioGroup,
76
+ SarRadio,
77
+ SarList,
78
+ SarListItem,
79
+ },
80
+ ...{
81
+ options: {
82
+ virtualHost: true,
83
+ styleIsolation: "shared"
84
+ }
85
+ },
86
+ __name: "radio-popout",
87
+ props: _mergeDefaults({
88
+ visible: { type: Boolean, required: false },
89
+ title: { type: String, required: false },
90
+ popoutClass: { type: String, required: false },
91
+ popoutStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
92
+ rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
93
+ rootClass: { type: String, required: false },
94
+ modelValue: { type: null, required: false },
95
+ disabled: { type: Boolean, required: false },
96
+ readonly: { type: Boolean, required: false },
97
+ size: { type: String, required: false },
98
+ type: { type: String, required: false },
99
+ checkedColor: { type: String, required: false },
100
+ direction: { type: String, required: false },
101
+ validateEvent: { type: Boolean, required: false },
102
+ options: { type: Array, required: false },
103
+ optionKeys: { type: Object, required: false }
104
+ }, defaultRadioPopoutProps()),
105
+ emits: ["update:visible", "update:model-value", "change"],
106
+ setup(__props, { expose: __expose, emit: __emit }) {
107
+ __expose();
108
+ const props = __props;
109
+ const emit = __emit;
110
+ const bem = createBem("radio-popout");
111
+ const { innerVisible, popoutValue, onChange, onConfirm } = useFormPopout(
112
+ props,
113
+ emit
114
+ );
115
+ const fieldKeys = computed(() => {
116
+ return Object.assign({}, defaultOptionKeys, props.optionKeys);
117
+ });
118
+ const { scrollSide, onScroll, onScrolltoupper, onScrolltolower } = useScrollSide();
119
+ const containerClass = computed(() => {
120
+ return classNames(
121
+ bem.e("container"),
122
+ bem.em("container", scrollSide.value, scrollSide.value)
123
+ );
124
+ });
125
+ const __returned__ = { props, emit, bem, innerVisible, popoutValue, onChange, onConfirm, fieldKeys, scrollSide, onScroll, onScrolltoupper, onScrolltolower, containerClass, SarPopout, SarRadioGroup, SarRadio, SarList, SarListItem, get getMayPrimitiveOption() {
126
+ return getMayPrimitiveOption;
127
+ } };
128
+ return __returned__;
129
+ }
130
+ });
131
+ </script>
132
+
133
+ <style lang="scss">
134
+ @import './index.scss';
135
+ </style>
@@ -1,6 +1,6 @@
1
1
  // #variables
2
2
  page,
3
3
  .sar-portal {
4
- --sar-radio-input-max-height: 640rpx;
4
+ --sar-radio-popout-max-height: 640rpx;
5
5
  }
6
6
  // #endvariables
@@ -7,13 +7,13 @@ declare const __VLS_component: import("vue").DefineComponent<SignatureProps, {
7
7
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
8
8
  cancel: () => any;
9
9
  clear: () => any;
10
- confirm: (dataURL: string) => any;
11
10
  "update:visible": (visible: boolean) => any;
11
+ confirm: (dataURL: string) => any;
12
12
  }, string, import("vue").PublicProps, Readonly<SignatureProps> & Readonly<{
13
13
  onCancel?: (() => any) | undefined;
14
14
  onClear?: (() => any) | undefined;
15
- onConfirm?: ((dataURL: string) => any) | undefined;
16
15
  "onUpdate:visible"?: ((visible: boolean) => any) | undefined;
16
+ onConfirm?: ((dataURL: string) => any) | undefined;
17
17
  }>, {
18
18
  type: "png" | "jpg";
19
19
  duration: number;
@@ -6,6 +6,8 @@ export interface TabbarProps {
6
6
  color?: string;
7
7
  activeColor?: string;
8
8
  bordered?: boolean;
9
+ fixed?: boolean;
10
+ safeAreaInsetBottom?: boolean;
9
11
  }
10
12
  export declare const defaultTabbarProps: {
11
13
  bordered: boolean;
@@ -10,6 +10,19 @@
10
10
  background-color: var(--sar-tabbar-bg);
11
11
  }
12
12
 
13
+ @include m(fixed) {
14
+ position: fixed;
15
+ bottom: 0;
16
+ left: 0;
17
+ width: 100%;
18
+ z-index: var(--sar-tabbar-z-index);
19
+ }
20
+
21
+ @include m(safe) {
22
+ height: calc(var(--sar-tabbar-height) + env(safe-area-inset-bottom));
23
+ padding-bottom: env(safe-area-inset-bottom);
24
+ }
25
+
13
26
  @include m(bordered) {
14
27
  &::before {
15
28
  @include border-top(var(--sar-tabbar-border-color));
@@ -26,7 +26,9 @@ export default _defineComponent({
26
26
  current: { type: [Number, String], required: false },
27
27
  color: { type: String, required: false },
28
28
  activeColor: { type: String, required: false },
29
- bordered: { type: Boolean, required: false }
29
+ bordered: { type: Boolean, required: false },
30
+ fixed: { type: Boolean, required: false },
31
+ safeAreaInsetBottom: { type: Boolean, required: false }
30
32
  }, defaultTabbarProps),
31
33
  emits: ["update:current", "change"],
32
34
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -58,7 +60,13 @@ export default _defineComponent({
58
60
  })
59
61
  );
60
62
  const tabbarClass = computed(() => {
61
- return classNames(bem.b(), bem.m("bordered", props.bordered), props.rootClass);
63
+ return classNames(
64
+ bem.b(),
65
+ bem.m("bordered", props.bordered),
66
+ bem.m("fixed", props.fixed),
67
+ bem.m("safe", props.safeAreaInsetBottom),
68
+ props.rootClass
69
+ );
62
70
  });
63
71
  const tabbarStyle = computed(() => {
64
72
  return stringifyStyle(props.rootStyle);
@@ -1,6 +1,7 @@
1
1
  // #variables
2
2
  page,
3
3
  .sar-portal {
4
+ --sar-tabbar-z-index: 999;
4
5
  --sar-tabbar-height: 100rpx;
5
6
  --sar-tabbar-border-color: var(--sar-border-color);
6
7
  --sar-tabbar-bg: var(--sar-emphasis-bg);
@@ -0,0 +1,13 @@
1
+ import { type StyleValue } from 'vue';
2
+ export interface TabbarPitProps {
3
+ rootStyle?: StyleValue;
4
+ rootClass?: string;
5
+ safeAreaInsetBottom?: boolean;
6
+ }
7
+ export interface TabbarPitSlots {
8
+ default?(props: Record<string, never>): any;
9
+ }
10
+ export interface TabbarPitEmits {
11
+ }
12
+ export interface TabbarPitExpose {
13
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export type { TabbarPitProps, TabbarPitSlots, TabbarPitEmits, TabbarPitExpose, } from './common';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ @use '../style/base' as *;
2
+
3
+ @include bem(tabbar-pit) {
4
+ @include b() {
5
+ @include universal;
6
+ height: var(--sar-tabbar-height);
7
+ }
8
+
9
+ @include m(safe) {
10
+ height: calc(var(--sar-tabbar-height) + env(safe-area-inset-bottom));
11
+ }
12
+ }
@@ -0,0 +1,10 @@
1
+ import { type TabbarPitProps, type TabbarPitSlots } from './common';
2
+ declare function __VLS_template(): Readonly<TabbarPitSlots> & TabbarPitSlots;
3
+ declare const __VLS_component: import("vue").DefineComponent<TabbarPitProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TabbarPitProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
5
+ export default _default;
6
+ type __VLS_WithTemplateSlots<T, S> = T & {
7
+ new (): {
8
+ $slots: S;
9
+ };
10
+ };
@@ -0,0 +1,46 @@
1
+ <template>
2
+ <view :class="tabbarPitClass" :style="tabbarPitStyle">
3
+ <slot></slot>
4
+ </view>
5
+ </template>
6
+
7
+ <script>
8
+ import { defineComponent as _defineComponent } from "vue";
9
+ import { computed } from "vue";
10
+ import { classNames, stringifyStyle, createBem } from "../../utils";
11
+ export default _defineComponent({
12
+ ...{
13
+ options: {
14
+ virtualHost: true,
15
+ styleIsolation: "shared"
16
+ }
17
+ },
18
+ __name: "tabbar-pit",
19
+ props: {
20
+ rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
21
+ rootClass: { type: String, required: false },
22
+ safeAreaInsetBottom: { type: Boolean, required: false }
23
+ },
24
+ setup(__props, { expose: __expose }) {
25
+ const props = __props;
26
+ const bem = createBem("tabbar-pit");
27
+ __expose({});
28
+ const tabbarPitClass = computed(() => {
29
+ return classNames(
30
+ bem.b(),
31
+ bem.m("safe", props.safeAreaInsetBottom),
32
+ props.rootClass
33
+ );
34
+ });
35
+ const tabbarPitStyle = computed(() => {
36
+ return stringifyStyle(props.rootStyle);
37
+ });
38
+ const __returned__ = { props, bem, tabbarPitClass, tabbarPitStyle };
39
+ return __returned__;
40
+ }
41
+ });
42
+ </script>
43
+
44
+ <style lang="scss">
45
+ @import './index.scss';
46
+ </style>
package/global.d.ts CHANGED
@@ -10,12 +10,15 @@ declare module 'vue' {
10
10
  SarButton: typeof import('./components/button/button').default
11
11
  SarCalendar: typeof import('./components/calendar/calendar').default
12
12
  SarCalendarInput: typeof import('./components/calendar-input/calendar-input').default
13
+ SarCalendarPopout: typeof import('./components/calendar-popout/calendar-popout').default
13
14
  SarCard: typeof import('./components/card/card').default
14
15
  SarCascader: typeof import('./components/cascader/cascader').default
15
16
  SarCascaderInput: typeof import('./components/cascader-input/cascader-input').default
17
+ SarCascaderPopout: typeof import('./components/cascader-popout/cascader-popout').default
16
18
  SarCheckbox: typeof import('./components/checkbox/checkbox').default
17
19
  SarCheckboxGroup: typeof import('./components/checkbox-group/checkbox-group').default
18
20
  SarCheckboxInput: typeof import('./components/checkbox-input/checkbox-input').default
21
+ SarCheckboxPopout: typeof import('./components/checkbox-popout/checkbox-popout').default
19
22
  SarCol: typeof import('./components/col/col').default
20
23
  SarCollapse: typeof import('./components/collapse/collapse').default
21
24
  SarCountDown: typeof import('./components/count-down/count-down').default
@@ -24,8 +27,10 @@ declare module 'vue' {
24
27
  SarCropImageAgent: typeof import('./components/crop-image-agent/crop-image-agent').default
25
28
  SarDatetimePicker: typeof import('./components/datetime-picker/datetime-picker').default
26
29
  SarDatetimePickerInput: typeof import('./components/datetime-picker-input/datetime-picker-input').default
30
+ SarDatetimePickerPopout: typeof import('./components/datetime-picker-popout/datetime-picker-popout').default
27
31
  SarDatetimeRangePicker: typeof import('./components/datetime-range-picker/datetime-range-picker').default
28
32
  SarDatetimeRangePickerInput: typeof import('./components/datetime-range-picker-input/datetime-range-picker-input').default
33
+ SarDatetimeRangePickerPopout: typeof import('./components/datetime-range-picker-popout/datetime-range-picker-popout').default
29
34
  SarDialog: typeof import('./components/dialog/dialog').default
30
35
  SarDialogAgent: typeof import('./components/dialog-agent/dialog-agent').default
31
36
  SarDivider: typeof import('./components/divider/divider').default
@@ -61,6 +66,7 @@ declare module 'vue' {
61
66
  SarPasswordInput: typeof import('./components/password-input/password-input').default
62
67
  SarPicker: typeof import('./components/picker/picker').default
63
68
  SarPickerInput: typeof import('./components/picker-input/picker-input').default
69
+ SarPickerPopout: typeof import('./components/picker-popout/picker-popout').default
64
70
  SarPopout: typeof import('./components/popout/popout').default
65
71
  SarPopoutInput: typeof import('./components/popout-input/popout-input').default
66
72
  SarPopover: typeof import('./components/popover/popover').default
@@ -73,6 +79,7 @@ declare module 'vue' {
73
79
  SarRadio: typeof import('./components/radio/radio').default
74
80
  SarRadioGroup: typeof import('./components/radio-group/radio-group').default
75
81
  SarRadioInput: typeof import('./components/radio-input/radio-input').default
82
+ SarRadioPopout: typeof import('./components/radio-popout/radio-popout').default
76
83
  SarRate: typeof import('./components/rate/rate').default
77
84
  SarResult: typeof import('./components/result/result').default
78
85
  SarRow: typeof import('./components/row/row').default
@@ -98,6 +105,7 @@ declare module 'vue' {
98
105
  SarTab: typeof import('./components/tab/tab').default
99
106
  SarTabbar: typeof import('./components/tabbar/tabbar').default
100
107
  SarTabbarItem: typeof import('./components/tabbar-item/tabbar-item').default
108
+ SarTabbarPit: typeof import('./components/tabbar-pit/tabbar-pit').default
101
109
  SarTable: typeof import('./components/table/table').default
102
110
  SarTableCell: typeof import('./components/table-cell/table-cell').default
103
111
  SarTableRow: typeof import('./components/table-row/table-row').default