sard-uniapp 1.16.0 → 1.17.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/components/config/index.d.ts +1 -0
  3. package/components/config/index.js +1 -0
  4. package/components/count-down/count-down.vue +5 -3
  5. package/components/datetime-picker/common.d.ts +3 -0
  6. package/components/datetime-picker/datetime-picker.d.ts +9 -2
  7. package/components/datetime-picker-input/common.d.ts +3 -1
  8. package/components/datetime-picker-input/datetime-picker-input.d.ts +9 -2
  9. package/components/datetime-picker-popout/common.d.ts +2 -3
  10. package/components/datetime-range-picker/common.d.ts +2 -3
  11. package/components/datetime-range-picker-input/common.d.ts +3 -1
  12. package/components/datetime-range-picker-input/datetime-range-picker-input.d.ts +9 -2
  13. package/components/datetime-range-picker-popout/common.d.ts +2 -3
  14. package/components/picker/common.d.ts +11 -0
  15. package/components/picker/index.scss +0 -13
  16. package/components/picker/picker.d.ts +9 -2
  17. package/components/picker/picker.vue +31 -9
  18. package/components/picker/variables.scss +4 -1
  19. package/components/picker-input/common.d.ts +3 -1
  20. package/components/picker-input/picker-input.d.ts +9 -2
  21. package/components/picker-input/picker-input.vue +25 -1
  22. package/components/picker-item/common.d.ts +12 -0
  23. package/components/picker-item/common.js +1 -0
  24. package/components/picker-item/index.d.ts +1 -0
  25. package/components/picker-item/index.js +1 -0
  26. package/components/picker-item/index.scss +12 -0
  27. package/components/picker-item/picker-item.d.ts +10 -0
  28. package/components/picker-item/picker-item.vue +41 -0
  29. package/components/picker-popout/common.d.ts +2 -3
  30. package/components/picker-popout/common.js +1 -1
  31. package/components/picker-popout/picker-popout.vue +32 -4
  32. package/components/popup/popup.vue +29 -4
  33. package/components/step/common.d.ts +22 -0
  34. package/components/step/common.js +1 -0
  35. package/components/step/index.d.ts +1 -0
  36. package/components/step/index.js +1 -0
  37. package/components/step/index.scss +215 -0
  38. package/components/step/step.d.ts +10 -0
  39. package/components/step/step.vue +97 -0
  40. package/components/steps/common.d.ts +18 -1
  41. package/components/steps/common.js +1 -0
  42. package/components/steps/index.d.ts +1 -1
  43. package/components/steps/index.scss +0 -216
  44. package/components/steps/steps.d.ts +10 -2
  45. package/components/steps/steps.vue +34 -56
  46. package/components/tree/common.d.ts +11 -0
  47. package/components/tree/index.d.ts +1 -1
  48. package/components/tree/tree.d.ts +8 -2
  49. package/components/tree/tree.vue +28 -5
  50. package/components/tree/variables.scss +2 -2
  51. package/components/tree-node/index.scss +2 -1
  52. package/components/tree-node/tree-node.vue +25 -3
  53. package/global.d.ts +2 -0
  54. package/index.d.ts +2 -0
  55. package/index.js +2 -0
  56. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,32 @@
1
+ ## [1.17.1](https://github.com/sutras/sard-uniapp/compare/v1.17.0...v1.17.1) (2025-05-30)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * 修复Popup在H5 attrs 透传问题 ([4de8765](https://github.com/sutras/sard-uniapp/commit/4de87657580cb6525c1025bc3862d4f4eef3afb1))
7
+
8
+
9
+ ### Features
10
+
11
+ * steps组件新增自定义内容插槽 ([5f17466](https://github.com/sutras/sard-uniapp/commit/5f17466c9370d21f699f0ec691e0ea5f74888188))
12
+
13
+
14
+
15
+ # [1.17.0](https://github.com/sutras/sard-uniapp/compare/v1.16.0...v1.17.0) (2025-05-29)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * 修复popup在h5弹出状态跳转页面仍显示的问题 ([1187368](https://github.com/sutras/sard-uniapp/commit/11873685cc8017ec42b4ad02c4d74754d5d3fc6c))
21
+
22
+
23
+ ### Features
24
+
25
+ * picker 组件新增 custom 插槽 ([218d384](https://github.com/sutras/sard-uniapp/commit/218d3841459d65dec29d6cf35fd6fea7c713cca5))
26
+ * tree 组件新增单选功能 ([a1fb8a2](https://github.com/sutras/sard-uniapp/commit/a1fb8a2c54ac7fc32e3dab2a416636553893bc2f))
27
+
28
+
29
+
1
30
  # [1.16.0](https://github.com/sutras/sard-uniapp/compare/v1.15.4...v1.16.0) (2025-05-28)
2
31
 
3
32
 
@@ -367,6 +367,7 @@ export declare const defaultConfig: {
367
367
  steps: {
368
368
  current: number;
369
369
  center: boolean;
370
+ itemList: () => never[];
370
371
  direction: StepsProps["direction"];
371
372
  finishIcon: string;
372
373
  processIcon: string;
@@ -329,6 +329,7 @@ export const defaultConfig = {
329
329
  steps: {
330
330
  current: 0,
331
331
  center: false,
332
+ itemList: () => [],
332
333
  direction: 'horizontal',
333
334
  finishIcon: 'check-circle-fill',
334
335
  processIcon: 'circle',
@@ -1,7 +1,9 @@
1
1
  <template>
2
- <slot :time="currentTime">
3
- {{ formatTime(format, currentTime) }}
4
- </slot>
2
+ <text>
3
+ <slot :time="currentTime">
4
+ {{ formatTime(format, currentTime) }}
5
+ </slot>
6
+ </text>
5
7
  </template>
6
8
 
7
9
  <script>
@@ -1,4 +1,5 @@
1
1
  import { type StyleValue } from 'vue';
2
+ import { type PickerSlots } from '../picker/common';
2
3
  export interface DatetimePickerProps {
3
4
  rootStyle?: StyleValue;
4
5
  rootClass?: string;
@@ -13,6 +14,8 @@ export interface DatetimePickerProps {
13
14
  export declare const defaultDatetimePickerProps: {
14
15
  type: string;
15
16
  };
17
+ export interface DatetimePickerSlots extends PickerSlots {
18
+ }
16
19
  export interface DatetimePickerEmits {
17
20
  (e: 'update:model-value', date: Date | string): void;
18
21
  (e: 'change', date: Date | string): void;
@@ -1,5 +1,6 @@
1
- import { type DatetimePickerProps } from './common';
2
- declare const _default: import("vue").DefineComponent<DatetimePickerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
1
+ import { type DatetimePickerProps, type DatetimePickerSlots } from './common';
2
+ declare function __VLS_template(): Readonly<DatetimePickerSlots> & DatetimePickerSlots;
3
+ declare const __VLS_component: import("vue").DefineComponent<DatetimePickerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
3
4
  "update:model-value": (date: string | Date) => any;
4
5
  change: (date: string | Date) => any;
5
6
  }, string, import("vue").PublicProps, Readonly<DatetimePickerProps> & Readonly<{
@@ -8,4 +9,10 @@ declare const _default: import("vue").DefineComponent<DatetimePickerProps, {}, {
8
9
  }>, {
9
10
  type: string;
10
11
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
11
13
  export default _default;
14
+ type __VLS_WithTemplateSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
@@ -1,5 +1,5 @@
1
1
  import { type PopoutInputProps } from '../popout-input/common';
2
- import { type DatetimePickerPopoutProps, type DatetimePickerPopoutEmits } from '../datetime-picker-popout/common';
2
+ import { type DatetimePickerPopoutProps, type DatetimePickerPopoutEmits, type DatetimePickerPopoutSlots } from '../datetime-picker-popout/common';
3
3
  export interface DatetimePickerInputProps extends DatetimePickerPopoutProps, Omit<PopoutInputProps, 'modelValue' | 'loading'> {
4
4
  outletFormat?: string;
5
5
  }
@@ -7,6 +7,8 @@ export declare const defaultDatetimePickerInputProps: () => {
7
7
  validateEvent: boolean;
8
8
  type: string;
9
9
  };
10
+ export interface DatetimePickerInputSlots extends DatetimePickerPopoutSlots {
11
+ }
10
12
  export interface DatetimePickerInputEmits extends DatetimePickerPopoutEmits {
11
13
  }
12
14
  export declare const mapTypeFormat: {
@@ -1,5 +1,6 @@
1
- import { type DatetimePickerInputProps } from './common';
2
- declare const _default: import("vue").DefineComponent<DatetimePickerInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
1
+ import { type DatetimePickerInputProps, type DatetimePickerInputSlots } from './common';
2
+ declare function __VLS_template(): Readonly<DatetimePickerInputSlots> & DatetimePickerInputSlots;
3
+ declare const __VLS_component: import("vue").DefineComponent<DatetimePickerInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
3
4
  "update:model-value": (date: string | Date | undefined) => any;
4
5
  change: (date: string | Date | undefined) => any;
5
6
  "update:visible": (visible: boolean) => any;
@@ -11,4 +12,10 @@ declare const _default: import("vue").DefineComponent<DatetimePickerInputProps,
11
12
  type: string;
12
13
  validateEvent: boolean;
13
14
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
14
16
  export default _default;
17
+ type __VLS_WithTemplateSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
@@ -1,5 +1,5 @@
1
1
  import { type StyleValue } from 'vue';
2
- import { type DatetimePickerProps } from '../datetime-picker/common';
2
+ import { type DatetimePickerProps, type DatetimePickerSlots } from '../datetime-picker/common';
3
3
  export interface DatetimePickerPopoutProps extends DatetimePickerProps {
4
4
  visible?: boolean;
5
5
  title?: string;
@@ -11,8 +11,7 @@ export declare const defaultDatetimePickerPopoutProps: () => {
11
11
  validateEvent: boolean;
12
12
  type: string;
13
13
  };
14
- export interface DatetimePickerPopoutSlots {
15
- default?(props: Record<string, never>): any;
14
+ export interface DatetimePickerPopoutSlots extends DatetimePickerSlots {
16
15
  }
17
16
  export interface DatetimePickerPopoutEmits {
18
17
  (e: 'update:visible', visible: boolean): void;
@@ -1,4 +1,4 @@
1
- import { type DatetimePickerProps } from '../datetime-picker/common';
1
+ import { type DatetimePickerSlots, type DatetimePickerProps } from '../datetime-picker/common';
2
2
  export interface DatetimeRangePickerProps extends Omit<DatetimePickerProps, 'modelValue'> {
3
3
  modelValue?: (Date | string)[];
4
4
  tabs?: string[];
@@ -6,8 +6,7 @@ export interface DatetimeRangePickerProps extends Omit<DatetimePickerProps, 'mod
6
6
  export declare const defaultDatetimeRangePickerProps: {
7
7
  type: string;
8
8
  };
9
- export interface DatetimeRangePickerSlots {
10
- default?(props: Record<string, never>): any;
9
+ export interface DatetimeRangePickerSlots extends DatetimePickerSlots {
11
10
  }
12
11
  export interface DatetimeRangePickerEmits {
13
12
  (e: 'update:model-value', date: (Date | string)[]): void;
@@ -1,4 +1,4 @@
1
- import { type DatetimeRangePickerPopoutProps, type DatetimeRangePickerPopoutEmits } from '../datetime-range-picker-popout/common';
1
+ import { type DatetimeRangePickerPopoutProps, type DatetimeRangePickerPopoutSlots, type DatetimeRangePickerPopoutEmits } from '../datetime-range-picker-popout/common';
2
2
  import { type PopoutInputProps } from '../popout-input/common';
3
3
  export interface DatetimeRangePickerInputProps extends DatetimeRangePickerPopoutProps, Omit<PopoutInputProps, 'modelValue' | 'loading'> {
4
4
  outletFormat?: string;
@@ -7,5 +7,7 @@ export declare const defaultDatetimeRangePickerInputProps: () => {
7
7
  validateEvent: boolean;
8
8
  type: string;
9
9
  };
10
+ export interface DatetimeRangePickerInputSlots extends DatetimeRangePickerPopoutSlots {
11
+ }
10
12
  export interface DatetimeRangePickerInputEmits extends DatetimeRangePickerPopoutEmits {
11
13
  }
@@ -1,5 +1,6 @@
1
- import { type DatetimeRangePickerInputProps } from './common';
2
- declare const _default: import("vue").DefineComponent<DatetimeRangePickerInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
1
+ import { type DatetimeRangePickerInputProps, type DatetimeRangePickerInputSlots } from './common';
2
+ declare function __VLS_template(): Readonly<DatetimeRangePickerInputSlots> & DatetimeRangePickerInputSlots;
3
+ declare const __VLS_component: import("vue").DefineComponent<DatetimeRangePickerInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
3
4
  "update:model-value": (date: (string | Date)[] | undefined) => any;
4
5
  change: (date: (string | Date)[] | undefined) => any;
5
6
  "update:visible": (visible: boolean) => any;
@@ -11,4 +12,10 @@ declare const _default: import("vue").DefineComponent<DatetimeRangePickerInputPr
11
12
  type: string;
12
13
  validateEvent: boolean;
13
14
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
14
16
  export default _default;
17
+ type __VLS_WithTemplateSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
@@ -1,5 +1,5 @@
1
1
  import { type StyleValue } from 'vue';
2
- import { type DatetimeRangePickerProps } from '../datetime-range-picker/common';
2
+ import { type DatetimeRangePickerProps, type DatetimeRangePickerSlots } from '../datetime-range-picker/common';
3
3
  export interface DatetimeRangePickerPopoutProps extends DatetimeRangePickerProps {
4
4
  visible?: boolean;
5
5
  title?: string;
@@ -11,8 +11,7 @@ export declare const defaultDatetimeRangePickerInputProps: () => {
11
11
  validateEvent: boolean;
12
12
  type: string;
13
13
  };
14
- export interface DatetimeRangePickerPopoutSlots {
15
- default?(props: Record<string, never>): any;
14
+ export interface DatetimeRangePickerPopoutSlots extends DatetimeRangePickerSlots {
16
15
  }
17
16
  export interface DatetimeRangePickerPopoutEmits {
18
17
  (e: 'update:visible', visible: boolean): void;
@@ -15,11 +15,22 @@ export interface PickerProps {
15
15
  optionKeys?: PickerOptionKeys;
16
16
  modelValue?: any;
17
17
  immediateChange?: boolean;
18
+ internalCustom?: number;
18
19
  }
19
20
  export declare const defaultPickerProps: () => {
20
21
  columns: () => never[];
21
22
  immediateChange: boolean;
22
23
  };
24
+ export interface PickerSlots {
25
+ custom?(props: {
26
+ columns: any[][];
27
+ value: number[];
28
+ pickerViewClass: string;
29
+ maskClass: string;
30
+ indicatorClass: string;
31
+ onChange: (event: any) => void;
32
+ }): any;
33
+ }
23
34
  export interface PickerEmits {
24
35
  (e: 'update:model-value', value: any, selectedOptions: PickerOption[], indexes: number[]): void;
25
36
  (e: 'change', value: any, selectedOptions: PickerOption[], indexes: number[]): void;
@@ -5,17 +5,4 @@
5
5
  @include universal;
6
6
  height: var(--sar-picker-height);
7
7
  }
8
-
9
- @include e(picker-view) {
10
- height: 100%;
11
- }
12
-
13
- @include e(item) {
14
- height: var(--sar-picker-item-height);
15
- line-height: var(--sar-picker-item-height);
16
- font-size: var(--sar-picker-item-font-size);
17
- text-align: center;
18
- color: var(--sar-picker-item-color);
19
- @include ellipsis;
20
- }
21
8
  }
@@ -1,5 +1,6 @@
1
- import { type PickerProps, type PickerOption } from './common';
2
- declare const _default: import("vue").DefineComponent<PickerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
1
+ import { type PickerProps, type PickerSlots, type PickerOption } from './common';
2
+ declare function __VLS_template(): Readonly<PickerSlots> & PickerSlots;
3
+ declare const __VLS_component: import("vue").DefineComponent<PickerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
3
4
  "update:model-value": (value: any, selectedOptions: PickerOption[], indexes: number[]) => any;
4
5
  change: (value: any, selectedOptions: PickerOption[], indexes: number[]) => any;
5
6
  }, string, import("vue").PublicProps, Readonly<PickerProps> & Readonly<{
@@ -9,4 +10,10 @@ declare const _default: import("vue").DefineComponent<PickerProps, {}, {}, {}, {
9
10
  columns: PickerOption[] | PickerOption[][];
10
11
  immediateChange: boolean;
11
12
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
12
14
  export default _default;
15
+ type __VLS_WithTemplateSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };
@@ -1,17 +1,28 @@
1
1
  <template>
2
2
  <view :class="pickerClass" :style="pickerStyle">
3
- <picker-view
4
- :class="bem.e('picker-view')"
5
- :indicator-class="bem.e('indicator')"
6
- :mask-class="bem.e('mask')"
3
+ <slot
4
+ v-if="isNumber(internalCustom) ? internalCustom : $slots.custom"
5
+ name="custom"
6
+ :columns="renderedColumns"
7
+ :picker-view-class="pickerViewClass"
8
+ :mask-class="maskClass"
9
+ :indicator-class="indicatorClass"
7
10
  :value="columnIndexes"
11
+ :on-change="onChange"
12
+ ></slot>
13
+ <picker-view
14
+ v-else
15
+ :class="pickerViewClass"
8
16
  :immediate-change="immediateChange"
17
+ :indicator-class="indicatorClass"
18
+ :mask-class="maskClass"
19
+ :value="columnIndexes"
9
20
  @change="onChange"
10
21
  >
11
22
  <picker-view-column v-for="(column, i) in renderedColumns" :key="i">
12
- <view v-for="(option, j) in column" :key="j" :class="bem.e('item')">
23
+ <sar-picker-item v-for="(option, j) in column" :key="j">
13
24
  {{ getLabelByOption(option) }}
14
- </view>
25
+ </sar-picker-item>
15
26
  </picker-view-column>
16
27
  </picker-view>
17
28
  </view>
@@ -27,7 +38,8 @@ import {
27
38
  nestedToMulti,
28
39
  toArray,
29
40
  arrayEqual,
30
- isNullish
41
+ isNullish,
42
+ isNumber
31
43
  } from "../../utils";
32
44
  import {
33
45
  defaultOptionKeys,
@@ -39,7 +51,11 @@ import {
39
51
  getValueOrLabelByOption,
40
52
  defaultPickerProps
41
53
  } from "./common";
54
+ import SarPickerItem from "../picker-item/picker-item.vue";
42
55
  export default _defineComponent({
56
+ components: {
57
+ SarPickerItem,
58
+ },
43
59
  ...{
44
60
  options: {
45
61
  virtualHost: true,
@@ -53,7 +69,8 @@ export default _defineComponent({
53
69
  columns: { type: Array, required: false },
54
70
  optionKeys: { type: Object, required: false },
55
71
  modelValue: { type: null, required: false },
56
- immediateChange: { type: Boolean, required: false }
72
+ immediateChange: { type: Boolean, required: false },
73
+ internalCustom: { type: Number, required: false }
57
74
  }, defaultPickerProps()),
58
75
  emits: ["update:model-value", "change"],
59
76
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -173,7 +190,12 @@ export default _defineComponent({
173
190
  const pickerStyle = computed(() => {
174
191
  return stringifyStyle(props.rootStyle);
175
192
  });
176
- const __returned__ = { props, emit, bem, fieldKeys, columnsType, innerValue, columnIndexes, onChange, getRenderedColumns, renderedColumns, getLabelByOption, pickerClass, pickerStyle };
193
+ const pickerViewClass = bem.e("picker-view");
194
+ const indicatorClass = bem.e("indicator");
195
+ const maskClass = bem.e("mask");
196
+ const __returned__ = { props, emit, bem, fieldKeys, columnsType, innerValue, columnIndexes, onChange, getRenderedColumns, renderedColumns, getLabelByOption, pickerClass, pickerStyle, pickerViewClass, indicatorClass, maskClass, get isNumber() {
197
+ return isNumber;
198
+ }, SarPickerItem };
177
199
  return __returned__;
178
200
  }
179
201
  });
@@ -11,7 +11,8 @@ page,
11
11
 
12
12
  --sar-picker-indicator-border-color: var(--sar-border-color);
13
13
 
14
- --sar-picker-mask-bg-image: linear-gradient(
14
+ --sar-picker-mask-bg-image:
15
+ linear-gradient(
15
16
  to bottom,
16
17
  rgba(var(--sar-emphasis-bg-rgb), 0.95),
17
18
  rgba(var(--sar-emphasis-bg-rgb), 0.6)
@@ -27,6 +28,8 @@ page,
27
28
  // 放到全局,兼容app
28
29
  @include bem(picker) {
29
30
  @include e(picker-view) {
31
+ height: var(--sar-picker-height);
32
+
30
33
  @include e(indicator) {
31
34
  height: var(--sar-picker-item-height);
32
35
  &::before {
@@ -1,5 +1,5 @@
1
1
  import { type PopoutInputProps } from '../popout-input/common';
2
- import { type PickerPopoutEmits, type PickerPopoutProps } from '../picker-popout/common';
2
+ import { type PickerPopoutSlots, type PickerPopoutEmits, type PickerPopoutProps } from '../picker-popout/common';
3
3
  export interface PickerInputProps extends PickerPopoutProps, Omit<PopoutInputProps, 'modelValue'> {
4
4
  }
5
5
  export declare const defaultPickerInputProps: () => {
@@ -7,5 +7,7 @@ export declare const defaultPickerInputProps: () => {
7
7
  columns: () => never[];
8
8
  immediateChange: boolean;
9
9
  };
10
+ export interface PickerInputSlots extends PickerPopoutSlots {
11
+ }
10
12
  export interface PickerInputEmits extends PickerPopoutEmits {
11
13
  }
@@ -1,6 +1,7 @@
1
1
  import { type PickerOption } from '../picker/common';
2
- import { type PickerInputProps } from './common';
3
- declare const _default: import("vue").DefineComponent<PickerInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
2
+ import { type PickerInputProps, type PickerInputSlots } from './common';
3
+ declare function __VLS_template(): Readonly<PickerInputSlots> & PickerInputSlots;
4
+ declare const __VLS_component: import("vue").DefineComponent<PickerInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
5
  "update:model-value": (value: any) => any;
5
6
  change: (value: any) => any;
6
7
  "update:visible": (visible: boolean) => any;
@@ -13,4 +14,10 @@ declare const _default: import("vue").DefineComponent<PickerInputProps, {}, {},
13
14
  validateEvent: boolean;
14
15
  immediateChange: boolean;
15
16
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
16
18
  export default _default;
19
+ type __VLS_WithTemplateSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -21,8 +21,31 @@
21
21
  :option-keys="optionKeys"
22
22
  :immediate-change="immediateChange"
23
23
  :validate-event="validateEvent"
24
+ :internal-custom="$slots.custom ? 1 : 0"
24
25
  @change="onChange"
25
- />
26
+ >
27
+ <template
28
+ v-if="$slots.custom"
29
+ #custom="{
30
+ columns,
31
+ maskClass,
32
+ pickerViewClass,
33
+ indicatorClass,
34
+ value,
35
+ onChange,
36
+ }"
37
+ >
38
+ <slot
39
+ name="custom"
40
+ :columns="columns"
41
+ :picker-view-class="pickerViewClass"
42
+ :mask-class="maskClass"
43
+ :indicator-class="indicatorClass"
44
+ :value="value"
45
+ :on-change="onChange"
46
+ ></slot>
47
+ </template>
48
+ </sar-picker-popout>
26
49
  </sar-popout-input>
27
50
  </template>
28
51
 
@@ -66,6 +89,7 @@ export default _defineComponent({
66
89
  optionKeys: { type: Object, required: false },
67
90
  modelValue: { type: null, required: false },
68
91
  immediateChange: { type: Boolean, required: false },
92
+ internalCustom: { type: Number, required: false },
69
93
  placeholder: { type: String, required: false },
70
94
  readonly: { type: Boolean, required: false },
71
95
  disabled: { type: Boolean, required: false },
@@ -0,0 +1,12 @@
1
+ import { type StyleValue } from 'vue';
2
+ export interface PickerItemProps {
3
+ rootStyle?: StyleValue;
4
+ rootClass?: string;
5
+ }
6
+ export interface PickerItemSlots {
7
+ default?(props: Record<string, never>): any;
8
+ }
9
+ export interface PickerItemEmits {
10
+ }
11
+ export interface PickerItemExpose {
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export type { PickerItemProps, PickerItemSlots, PickerItemEmits, PickerItemExpose, } from './common';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ @use '../style/base' as *;
2
+
3
+ @include bem(picker) {
4
+ @include e(item) {
5
+ height: var(--sar-picker-item-height);
6
+ line-height: var(--sar-picker-item-height);
7
+ font-size: var(--sar-picker-item-font-size);
8
+ text-align: center;
9
+ color: var(--sar-picker-item-color);
10
+ @include ellipsis;
11
+ }
12
+ }
@@ -0,0 +1,10 @@
1
+ import { type PickerItemProps, type PickerItemSlots } from './common';
2
+ declare function __VLS_template(): Readonly<PickerItemSlots> & PickerItemSlots;
3
+ declare const __VLS_component: import("vue").DefineComponent<PickerItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PickerItemProps> & 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,41 @@
1
+ <template>
2
+ <view :class="pickerItemClass" :style="pickerItemStyle">
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: "picker-item",
19
+ props: {
20
+ rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
21
+ rootClass: { type: String, required: false }
22
+ },
23
+ setup(__props, { expose: __expose }) {
24
+ const props = __props;
25
+ const bem = createBem("picker");
26
+ __expose({});
27
+ const pickerItemClass = computed(() => {
28
+ return classNames(bem.e("item"), props.rootClass);
29
+ });
30
+ const pickerItemStyle = computed(() => {
31
+ return stringifyStyle(props.rootStyle);
32
+ });
33
+ const __returned__ = { props, bem, pickerItemClass, pickerItemStyle };
34
+ return __returned__;
35
+ }
36
+ });
37
+ </script>
38
+
39
+ <style lang="scss">
40
+ @import './index.scss';
41
+ </style>
@@ -1,5 +1,5 @@
1
1
  import { type StyleValue } from 'vue';
2
- import { type PickerProps } from '../picker/common';
2
+ import { type PickerSlots, type PickerProps } from '../picker/common';
3
3
  export interface PickerPopoutProps extends PickerProps {
4
4
  visible?: boolean;
5
5
  title?: string;
@@ -12,8 +12,7 @@ export declare const defaultPickerPopoutProps: () => {
12
12
  columns: () => never[];
13
13
  immediateChange: boolean;
14
14
  };
15
- export interface PickerPopoutSlots {
16
- default?(props: Record<string, never>): any;
15
+ export interface PickerPopoutSlots extends PickerSlots {
17
16
  }
18
17
  export interface PickerPopoutEmits {
19
18
  (e: 'update:visible', visible: boolean): void;
@@ -1,4 +1,4 @@
1
- import { defaultPickerProps } from '../picker/common';
1
+ import { defaultPickerProps, } from '../picker/common';
2
2
  import { defaultConfig } from '../config';
3
3
  export const defaultPickerPopoutProps = () => ({
4
4
  ...defaultPickerProps(),
@@ -15,8 +15,33 @@
15
15
  :columns="columns"
16
16
  :option-keys="optionKeys"
17
17
  :immediate-change="immediateChange"
18
+ :internal-custom="
19
+ isNumber(internalCustom) ? internalCustom : $slots.custom ? 1 : 0
20
+ "
18
21
  @change="onChange"
19
- />
22
+ >
23
+ <template
24
+ v-if="$slots.custom"
25
+ #custom="{
26
+ columns,
27
+ maskClass,
28
+ pickerViewClass,
29
+ indicatorClass,
30
+ value,
31
+ onChange,
32
+ }"
33
+ >
34
+ <slot
35
+ name="custom"
36
+ :columns="columns"
37
+ :picker-view-class="pickerViewClass"
38
+ :mask-class="maskClass"
39
+ :indicator-class="indicatorClass"
40
+ :value="value"
41
+ :on-change="onChange"
42
+ ></slot>
43
+ </template>
44
+ </sar-picker>
20
45
  </template>
21
46
  </sar-popout>
22
47
  </template>
@@ -28,7 +53,7 @@ import SarPicker from "../picker/picker.vue";
28
53
  import {
29
54
  defaultPickerPopoutProps
30
55
  } from "./common";
31
- import { isNullish } from "../../utils";
56
+ import { isNullish, isNumber } from "../../utils";
32
57
  import { defaultOptionKeys, getInitialValue } from "../picker/common";
33
58
  import { computed } from "vue";
34
59
  import { useFormPopout } from "../../use";
@@ -55,7 +80,8 @@ export default _defineComponent({
55
80
  columns: { type: Array, required: false },
56
81
  optionKeys: { type: Object, required: false },
57
82
  modelValue: { type: null, required: false },
58
- immediateChange: { type: Boolean, required: false }
83
+ immediateChange: { type: Boolean, required: false },
84
+ internalCustom: { type: Number, required: false }
59
85
  }, defaultPickerPopoutProps()),
60
86
  emits: ["update:visible", "update:model-value", "change"],
61
87
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -77,7 +103,9 @@ export default _defineComponent({
77
103
  popoutValue.value = innerValue.value;
78
104
  }
79
105
  };
80
- const __returned__ = { props, emit, innerVisible, innerValue, popoutValue, onChange, onConfirm, fieldKeys, onEnter, SarPopout, SarPicker };
106
+ const __returned__ = { props, emit, innerVisible, innerValue, popoutValue, onChange, onConfirm, fieldKeys, onEnter, SarPopout, SarPicker, get isNumber() {
107
+ return isNumber;
108
+ } };
81
109
  return __returned__;
82
110
  }
83
111
  });