sard-uniapp 1.21.2 → 1.22.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.
- package/CHANGELOG.md +26 -1
- package/README.md +1 -1
- package/components/accordion/README.md +13 -6
- package/components/accordion/accordion.vue +10 -3
- package/components/accordion/common.d.ts +2 -0
- package/components/accordion/index.scss +6 -0
- package/components/accordion-item/accordion-item.vue +6 -1
- package/components/accordion-item/index.scss +12 -0
- package/components/action-sheet/README.md +15 -6
- package/components/action-sheet/action-sheet.d.ts +6 -10
- package/components/action-sheet/action-sheet.vue +16 -2
- package/components/action-sheet/common.d.ts +2 -1
- package/components/calendar-input/README.md +9 -0
- package/components/calendar-input/calendar-input.d.ts +13 -8
- package/components/calendar-input/calendar-input.vue +39 -4
- package/components/calendar-input/common.d.ts +3 -1
- package/components/calendar-popout/README.md +15 -5
- package/components/calendar-popout/calendar-popout.d.ts +5 -7
- package/components/calendar-popout/calendar-popout.vue +19 -12
- package/components/calendar-popout/common.d.ts +3 -1
- package/components/cascader-input/README.md +8 -1
- package/components/cascader-input/cascader-input.d.ts +5 -10
- package/components/cascader-input/cascader-input.vue +39 -4
- package/components/cascader-input/common.d.ts +2 -2
- package/components/cascader-popout/README.md +16 -6
- package/components/cascader-popout/cascader-popout.d.ts +5 -9
- package/components/cascader-popout/cascader-popout.vue +19 -12
- package/components/cascader-popout/common.d.ts +3 -1
- package/components/checkbox-input/README.md +9 -0
- package/components/checkbox-input/checkbox-input.d.ts +13 -8
- package/components/checkbox-input/checkbox-input.vue +39 -4
- package/components/checkbox-input/common.d.ts +3 -1
- package/components/checkbox-popout/README.md +15 -5
- package/components/checkbox-popout/checkbox-popout.d.ts +5 -7
- package/components/checkbox-popout/checkbox-popout.vue +14 -6
- package/components/checkbox-popout/common.d.ts +3 -1
- package/components/config/index.d.ts +5 -0
- package/components/config/index.js +5 -0
- package/components/crop-image/README.md +12 -3
- package/components/crop-image/common.d.ts +2 -1
- package/components/crop-image/crop-image.d.ts +5 -3
- package/components/crop-image/crop-image.vue +16 -2
- package/components/datetime-picker-input/README.md +9 -0
- package/components/datetime-picker-input/common.d.ts +2 -2
- package/components/datetime-picker-input/datetime-picker-input.d.ts +5 -7
- package/components/datetime-picker-input/datetime-picker-input.vue +39 -4
- package/components/datetime-picker-popout/README.md +15 -5
- package/components/datetime-picker-popout/common.d.ts +3 -1
- package/components/datetime-picker-popout/datetime-picker-popout.d.ts +5 -7
- package/components/datetime-picker-popout/datetime-picker-popout.vue +21 -3
- package/components/datetime-range-picker-input/README.md +9 -0
- package/components/datetime-range-picker-input/common.d.ts +2 -2
- package/components/datetime-range-picker-input/datetime-range-picker-input.d.ts +5 -7
- package/components/datetime-range-picker-input/datetime-range-picker-input.vue +39 -4
- package/components/datetime-range-picker-popout/README.md +15 -5
- package/components/datetime-range-picker-popout/common.d.ts +3 -1
- package/components/datetime-range-picker-popout/datetime-range-picker-popout.d.ts +5 -7
- package/components/datetime-range-picker-popout/datetime-range-picker-popout.vue +21 -3
- package/components/dialog/dialog.d.ts +1 -1
- package/components/dialog-agent/dialog-agent.d.ts +1 -1
- package/components/dnd/README.md +120 -0
- package/components/dnd/common.d.ts +49 -0
- package/components/dnd/common.js +1 -0
- package/components/dnd/dnd.d.ts +37 -0
- package/components/dnd/dnd.vue +136 -0
- package/components/dnd/index.d.ts +1 -0
- package/components/dnd/index.js +1 -0
- package/components/dnd/index.scss +11 -0
- package/components/dnd/variables.scss +7 -0
- package/components/dnd-handle/common.d.ts +12 -0
- package/components/dnd-handle/common.js +1 -0
- package/components/dnd-handle/dnd-handle.d.ts +10 -0
- package/components/dnd-handle/dnd-handle.vue +89 -0
- package/components/dnd-handle/index.d.ts +1 -0
- package/components/dnd-handle/index.js +1 -0
- package/components/dnd-handle/index.scss +13 -0
- package/components/dnd-item/common.d.ts +21 -0
- package/components/dnd-item/common.js +1 -0
- package/components/dnd-item/dnd-item.d.ts +10 -0
- package/components/dnd-item/dnd-item.vue +193 -0
- package/components/dnd-item/index.d.ts +1 -0
- package/components/dnd-item/index.js +1 -0
- package/components/dnd-item/index.scss +28 -0
- package/components/floating-bubble/index.scss +1 -0
- package/components/form/README.md +6 -5
- package/components/form/common.d.ts +4 -0
- package/components/form-item/form-item.vue +10 -4
- package/components/picker-input/README.md +9 -0
- package/components/picker-input/common.d.ts +2 -2
- package/components/picker-input/picker-input.d.ts +6 -8
- package/components/picker-input/picker-input.vue +41 -4
- package/components/picker-popout/README.md +15 -5
- package/components/picker-popout/common.d.ts +3 -1
- package/components/picker-popout/picker-popout.d.ts +6 -8
- package/components/picker-popout/picker-popout.vue +21 -3
- package/components/popout/popout.d.ts +1 -1
- package/components/popout-input/README.md +20 -11
- package/components/popout-input/common.d.ts +10 -0
- package/components/popout-input/common.js +2 -1
- package/components/popout-input/index.scss +1 -0
- package/components/popout-input/popout-input.d.ts +5 -1
- package/components/popout-input/popout-input.vue +22 -7
- package/components/popup/README.md +24 -22
- package/components/popup/common.d.ts +3 -0
- package/components/popup/popup.d.ts +8 -5
- package/components/popup/popup.vue +25 -2
- package/components/radio-input/README.md +9 -0
- package/components/radio-input/common.d.ts +3 -1
- package/components/radio-input/radio-input.d.ts +13 -8
- package/components/radio-input/radio-input.vue +39 -4
- package/components/radio-popout/README.md +15 -5
- package/components/radio-popout/common.d.ts +3 -1
- package/components/radio-popout/radio-popout.d.ts +5 -7
- package/components/radio-popout/radio-popout.vue +14 -6
- package/components/rate/rate.d.ts +1 -1
- package/components/share-sheet/README.md +15 -6
- package/components/share-sheet/common.d.ts +2 -1
- package/components/share-sheet/share-sheet.d.ts +6 -10
- package/components/share-sheet/share-sheet.vue +17 -3
- package/components/stepper/common.d.ts +1 -1
- package/components/stepper/stepper.vue +1 -1
- package/components/style/mixins/disable-scroll.scss +14 -0
- package/components/style/mixins.scss +1 -0
- package/components/style/variables.scss +4 -0
- package/components/tree/common.d.ts +1 -0
- package/components/tree/index.scss +4 -0
- package/components/tree/tree.vue +33 -21
- package/components/tree/variables.scss +1 -2
- package/components/tree-node/tree-node.vue +2 -0
- package/global.d.ts +3 -0
- package/index.d.ts +3 -0
- package/index.js +3 -0
- package/index.scss +1 -0
- package/package.json +2 -2
- package/use/index.d.ts +1 -0
- package/use/index.js +1 -0
- package/use/useFormPopout.d.ts +6 -2
- package/use/useFormPopout.js +9 -1
- package/use/useKeyList.d.ts +5 -0
- package/use/useKeyList.js +15 -0
- package/use/usePopoutInput.d.ts +4 -1
- package/use/usePopoutInput.js +5 -0
- package/utils/array.js +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,34 @@
|
|
|
1
|
-
## [1.
|
|
1
|
+
## [1.22.1](https://github.com/sutras/sard-uniapp/compare/v1.22.0...v1.22.1) (2025-07-19)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Features
|
|
5
5
|
|
|
6
|
+
* 基于 popout 组件的带有确定按钮的组件添加 confirm 事件 ([d88f36f](https://github.com/sutras/sard-uniapp/commit/d88f36fd2f23a33eb56b2c7fd1f3919558a4f857))
|
|
7
|
+
* 所有基于 Popup 和 Popout 组件的组件都添加入场/退场相关事件 ([5178b00](https://github.com/sutras/sard-uniapp/commit/5178b00e0e4b092304013b5639a7f85c52ba65b3))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# [1.22.0](https://github.com/sutras/sard-uniapp/compare/v1.21.1...v1.22.0) (2025-07-15)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* 使popup组件在app端能传送到根节点 ([5008ce7](https://github.com/sutras/sard-uniapp/commit/5008ce7d72f2167b2c8c40b7b9cef16c4420ad69))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* *-input 类组件新增 inputProps 属性 ([837ed51](https://github.com/sutras/sard-uniapp/commit/837ed514a684c8547e0a23b410912eda6fd8435b))
|
|
22
|
+
* *-input 类组件新增arrow插槽和arrow, arrow-family属性 ([6555241](https://github.com/sutras/sard-uniapp/commit/655524171dd619461f4acfccbc3b7f753fc6e1d5))
|
|
23
|
+
* accordion 组件新增 hide-border 属性 ([ae3a093](https://github.com/sutras/sard-uniapp/commit/ae3a093df01ab788dee6e51cac551d7d352974dd))
|
|
24
|
+
* form-item 新增 error 插槽 ([b377e8e](https://github.com/sutras/sard-uniapp/commit/b377e8e082fcab3e03006a999bed2c2015910f67))
|
|
6
25
|
* input 组件新增 show-eye 属性 ([351a56e](https://github.com/sutras/sard-uniapp/commit/351a56ec77fabc44edb788b2e9e06ffdfb5a7cef))
|
|
26
|
+
* picker-input 新增 arrow 属性和 arrow 插槽 ([f9fc77f](https://github.com/sutras/sard-uniapp/commit/f9fc77f31fe58f879d97d9fd8c16efced2f4626e))
|
|
27
|
+
* popout-input 新增 arrow-family 属性 ([a97f280](https://github.com/sutras/sard-uniapp/commit/a97f28082ab6811dcc1731a01b13446880b3e8e1))
|
|
28
|
+
* popup-input 新增 arrow 属性和 arrow 插槽 ([4756536](https://github.com/sutras/sard-uniapp/commit/475653631e0142f9d9779908b5f2919e997abb22))
|
|
29
|
+
* **Popup:** 增加 close-on-click-overlay,支持点击遮罩关闭弹出层;visible 支持 v-model ([28e7d27](https://github.com/sutras/sard-uniapp/commit/28e7d2748b02679ca2a744522237fd69f6dedd38))
|
|
30
|
+
* 新增 dnd 组件 ([f9629a1](https://github.com/sutras/sard-uniapp/commit/f9629a10baa9b536f5d2ad07f0ef2b8b520d350a))
|
|
31
|
+
* 新增overlayClosable属性 ([d615537](https://github.com/sutras/sard-uniapp/commit/d61553721d0e3321ffc6ff8ec53e238c7b88117c))
|
|
7
32
|
|
|
8
33
|
|
|
9
34
|
|
package/README.md
CHANGED
|
@@ -38,16 +38,23 @@ import AccordionItem from 'sard-uniapp/components/accordion-item/accordion-item.
|
|
|
38
38
|
|
|
39
39
|
@code('${DEMO_PATH}/accordion/demo/Disabled.vue')
|
|
40
40
|
|
|
41
|
+
### 隐藏边框 <sup>1.22+</sup>
|
|
42
|
+
|
|
43
|
+
可以使用 `hide-border` 属性隐藏边框。
|
|
44
|
+
|
|
45
|
+
@code('${DEMO_PATH}/accordion/demo/HideBorder.vue')
|
|
46
|
+
|
|
41
47
|
## API
|
|
42
48
|
|
|
43
49
|
### AccordionProps
|
|
44
50
|
|
|
45
|
-
| 属性
|
|
46
|
-
|
|
|
47
|
-
| root-class
|
|
48
|
-
| root-style
|
|
49
|
-
| model-value
|
|
50
|
-
| multiple
|
|
51
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
52
|
+
| ---------------------------- | ---------------------- | ---------------------------------------- | ------ |
|
|
53
|
+
| root-class | 组件根元素类名 | string | - |
|
|
54
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
55
|
+
| model-value | 当前展开面板的 `name` | string \| number \| (string \| number)[] | - |
|
|
56
|
+
| multiple | 是否可同时展开多个面板 | boolean | false |
|
|
57
|
+
| hide-border <sup>1.22+</sup> | 是否隐藏边框 | boolean | false |
|
|
51
58
|
|
|
52
59
|
### AccordionSlots
|
|
53
60
|
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
17
17
|
* @property {string | number | (string | number)[]} modelValue 当前展开面板的 `name`,默认值:-。
|
|
18
18
|
* @property {boolean} multiple 是否可同时展开多个面板,默认值:false。
|
|
19
|
+
* @property {boolean} hideBorder 是否隐藏边框,默认值:false。
|
|
19
20
|
* @event {(value: string | number | (string | number)[]) => void} update 切换面板时触发
|
|
20
21
|
*/
|
|
21
22
|
export default _defineComponent({
|
|
@@ -30,7 +31,8 @@ export default _defineComponent({
|
|
|
30
31
|
rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
31
32
|
rootClass: { type: String, required: false },
|
|
32
33
|
modelValue: { type: [Array, String, Number], required: false },
|
|
33
|
-
multiple: { type: Boolean, required: false }
|
|
34
|
+
multiple: { type: Boolean, required: false },
|
|
35
|
+
hideBorder: { type: Boolean, required: false }
|
|
34
36
|
},
|
|
35
37
|
emits: ["update:model-value"],
|
|
36
38
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -69,11 +71,16 @@ export default _defineComponent({
|
|
|
69
71
|
reactive({
|
|
70
72
|
value: innerValue,
|
|
71
73
|
multiple: toRef(() => props.multiple),
|
|
72
|
-
toggle
|
|
74
|
+
toggle,
|
|
75
|
+
hideBorder: toRef(() => props.hideBorder)
|
|
73
76
|
})
|
|
74
77
|
);
|
|
75
78
|
const accordionClass = computed(() => {
|
|
76
|
-
return classNames(
|
|
79
|
+
return classNames(
|
|
80
|
+
bem.b(),
|
|
81
|
+
bem.m("borderless", props.hideBorder),
|
|
82
|
+
props.rootClass
|
|
83
|
+
);
|
|
77
84
|
});
|
|
78
85
|
const accordionStyle = computed(() => {
|
|
79
86
|
return stringifyStyle(props.rootStyle);
|
|
@@ -4,6 +4,7 @@ export interface AccordionProps {
|
|
|
4
4
|
rootClass?: string;
|
|
5
5
|
modelValue?: (string | number)[] | string | number;
|
|
6
6
|
multiple?: boolean;
|
|
7
|
+
hideBorder?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export interface AccordionEmits {
|
|
9
10
|
(e: 'update:model-value', event: any): void;
|
|
@@ -15,6 +16,7 @@ export interface AccoridonContext {
|
|
|
15
16
|
value: any;
|
|
16
17
|
multiple: AccordionProps['multiple'];
|
|
17
18
|
toggle: (name: string | number) => void;
|
|
19
|
+
hideBorder?: boolean;
|
|
18
20
|
}
|
|
19
21
|
export declare const accoridonContextSymbol: unique symbol;
|
|
20
22
|
export interface AccordionItemProps {
|
|
@@ -78,7 +78,12 @@ export default _defineComponent({
|
|
|
78
78
|
return visible.value ? "up" : "down";
|
|
79
79
|
});
|
|
80
80
|
const accordionItemClass = computed(() => {
|
|
81
|
-
return classNames(
|
|
81
|
+
return classNames(
|
|
82
|
+
bem.b(),
|
|
83
|
+
bem.m("disabled", props.disabled),
|
|
84
|
+
bem.m("borderless", context.hideBorder),
|
|
85
|
+
props.rootClass
|
|
86
|
+
);
|
|
82
87
|
});
|
|
83
88
|
const accordionItemStyle = computed(() => {
|
|
84
89
|
return stringifyStyle(props.rootStyle);
|
|
@@ -71,12 +71,21 @@ import ActionSheet from 'sard-uniapp/components/action-sheet/action-sheet.vue'
|
|
|
71
71
|
|
|
72
72
|
### ActionSheetEmits
|
|
73
73
|
|
|
74
|
-
| 事件
|
|
75
|
-
|
|
|
76
|
-
| update:visible
|
|
77
|
-
| close
|
|
78
|
-
| cancel
|
|
79
|
-
| select
|
|
74
|
+
| 事件 | 描述 | 类型 |
|
|
75
|
+
| ---------------------------------- | --------------------------- | ---------------------------------------------- |
|
|
76
|
+
| update:visible | 动作面板显隐时触发 | (visible: boolean) => void |
|
|
77
|
+
| close | 点击遮罩时触发 | () => void |
|
|
78
|
+
| cancel | 点击取消按钮时触发 | () => void |
|
|
79
|
+
| select | 点击动作按钮时触发 | (item: ActionSheetItem, index: number) => void |
|
|
80
|
+
| visible-hook <sup>1.22.1+</sup> | 入场/退场动画状态改变时触发 | (name: TransitionHookName) => void |
|
|
81
|
+
| before-enter <sup>1.22.1+</sup> | 入场动画开始前触发 | () => void |
|
|
82
|
+
| enter <sup>1.22.1+</sup> | 入场动画开始时触发 | () => void |
|
|
83
|
+
| after-enter <sup>1.22.1+</sup> | 入场动画结束时触发 | () => void |
|
|
84
|
+
| enter-cancelled <sup>1.22.1+</sup> | 入场动画取消时触发 | () => void |
|
|
85
|
+
| before-leave <sup>1.22.1+</sup> | 退场动画开始前触发 | () => void |
|
|
86
|
+
| leave <sup>1.22.1+</sup> | 退场动画开始时触发 | () => void |
|
|
87
|
+
| after-leave <sup>1.22.1+</sup> | 退场动画结束时触发 | () => void |
|
|
88
|
+
| leave-cancelled <sup>1.22.1+</sup> | 退场动画取消时触发 | () => void |
|
|
80
89
|
|
|
81
90
|
## 主题定制
|
|
82
91
|
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
declare const _default: import("vue").DefineComponent<ActionSheetProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"update:visible": (visible: boolean) => any;
|
|
1
|
+
import { type ActionSheetProps } from './common';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<ActionSheetProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
} & {
|
|
5
|
+
[x: string]: any;
|
|
7
6
|
}, string, import("vue").PublicProps, Readonly<ActionSheetProps> & Readonly<{
|
|
8
|
-
|
|
9
|
-
onClose?: (() => any) | undefined;
|
|
10
|
-
onSelect?: ((item: ActionSheetItem, index: number) => any) | undefined;
|
|
11
|
-
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
7
|
+
[x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
|
|
12
8
|
}>, {
|
|
13
9
|
duration: number;
|
|
14
10
|
overlayClosable: boolean;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
:visible="innerVisible"
|
|
5
5
|
:duration="duration"
|
|
6
6
|
@overlay-click="onOverlayClick"
|
|
7
|
+
@visible-hook="onVisibleHook"
|
|
7
8
|
>
|
|
8
9
|
<view :class="actionSheetClass" :style="actionSheetStyle">
|
|
9
10
|
<view v-if="description" :class="bem.e('description')">
|
|
@@ -76,6 +77,15 @@ import {
|
|
|
76
77
|
* @event {() => void} close 点击遮罩时触发
|
|
77
78
|
* @event {() => void} cancel 点击取消按钮时触发
|
|
78
79
|
* @event {(item: ActionSheetItem, index: number) => void} select 点击动作按钮时触发
|
|
80
|
+
* @event {(name: TransitionHookName) => void} visible-hook 入场/退场动画状态改变时触发
|
|
81
|
+
* @event {() => void} before-enter 入场动画开始前触发
|
|
82
|
+
* @event {() => void} enter 入场动画开始时触发
|
|
83
|
+
* @event {() => void} after-enter 入场动画结束时触发
|
|
84
|
+
* @event {() => void} enter-cancelled 入场动画取消时触发
|
|
85
|
+
* @event {() => void} before-leave 退场动画开始前触发
|
|
86
|
+
* @event {() => void} leave 退场动画开始时触发
|
|
87
|
+
* @event {() => void} after-leave 退场动画结束时触发
|
|
88
|
+
* @event {() => void} leave-cancelled 退场动画取消时触发
|
|
79
89
|
*/
|
|
80
90
|
export default _defineComponent({
|
|
81
91
|
components: {
|
|
@@ -100,7 +110,7 @@ export default _defineComponent({
|
|
|
100
110
|
beforeClose: { type: Function, required: false },
|
|
101
111
|
duration: { type: Number, required: false }
|
|
102
112
|
}, defaultActionSheetProps),
|
|
103
|
-
emits: ["update:visible", "close", "cancel", "select"],
|
|
113
|
+
emits: ["update:visible", "close", "cancel", "select", "before-enter", "enter", "after-enter", "enter-cancelled", "before-leave", "leave", "after-leave", "leave-cancelled", "visible-hook"],
|
|
104
114
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
105
115
|
__expose();
|
|
106
116
|
const props = __props;
|
|
@@ -144,6 +154,10 @@ export default _defineComponent({
|
|
|
144
154
|
emit("cancel");
|
|
145
155
|
perhapsClose("cancel");
|
|
146
156
|
};
|
|
157
|
+
const onVisibleHook = (name) => {
|
|
158
|
+
emit("visible-hook", name);
|
|
159
|
+
emit(name);
|
|
160
|
+
};
|
|
147
161
|
const actionSheetClass = computed(() => {
|
|
148
162
|
return classNames(
|
|
149
163
|
bem.b(),
|
|
@@ -154,7 +168,7 @@ export default _defineComponent({
|
|
|
154
168
|
const actionSheetStyle = computed(() => {
|
|
155
169
|
return stringifyStyle(props.rootStyle);
|
|
156
170
|
});
|
|
157
|
-
const __returned__ = { props, emit, bem, innerVisible, perhapsClose, onOverlayClick, onSelect, onCancel, actionSheetClass, actionSheetStyle, get classNames() {
|
|
171
|
+
const __returned__ = { props, emit, bem, innerVisible, perhapsClose, onOverlayClick, onSelect, onCancel, onVisibleHook, actionSheetClass, actionSheetStyle, get classNames() {
|
|
158
172
|
return classNames;
|
|
159
173
|
}, get stringifyStyle() {
|
|
160
174
|
return stringifyStyle;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type StyleValue } from 'vue';
|
|
2
|
+
import { type TransitionHookEmits } from '../popup/common';
|
|
2
3
|
export interface ActionSheetProps {
|
|
3
4
|
rootStyle?: StyleValue;
|
|
4
5
|
rootClass?: string;
|
|
@@ -14,7 +15,7 @@ export declare const defaultActionSheetProps: {
|
|
|
14
15
|
overlayClosable: boolean;
|
|
15
16
|
duration: number;
|
|
16
17
|
};
|
|
17
|
-
export interface ActionSheetEmits {
|
|
18
|
+
export interface ActionSheetEmits extends TransitionHookEmits {
|
|
18
19
|
(e: 'update:visible', visible: boolean): void;
|
|
19
20
|
(e: 'close'): void;
|
|
20
21
|
(e: 'cancel'): void;
|
|
@@ -59,6 +59,15 @@ import CalendarInput from 'sard-uniapp/components/calendar-input/calendar-input.
|
|
|
59
59
|
| placeholder | 输入框占位符内容 | string | - |
|
|
60
60
|
| outlet-format <sup>1.10+</sup> | 输出到输入框的日期格式 | string [详见特殊符号](../utilities/date#日期格式特殊符号) | 'YYYY-MM-DD' |
|
|
61
61
|
| value-on-clear <sup>1.19.2+</sup> | 设置点击清除按钮后的值 | () => any | () => undefined |
|
|
62
|
+
| arrow <sup>1.22+</sup> | 自定义箭头图标名 | string | 'caret-right' |
|
|
63
|
+
| arrow-family <sup>1.22+</sup> | 自定义箭头图标字体 | string | 'sari' |
|
|
64
|
+
| input-props <sup>1.22+</sup> | 自定义输入框组件属性 | InputProps | - |
|
|
65
|
+
|
|
66
|
+
### CalendarInputSlots
|
|
67
|
+
|
|
68
|
+
| 插槽 | 描述 | 属性 |
|
|
69
|
+
| ---------------------- | ---------- | ---------- |
|
|
70
|
+
| arrow <sup>1.22+</sup> | 自定义箭头 | () => void |
|
|
62
71
|
|
|
63
72
|
### CalendarInputEmits
|
|
64
73
|
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { type CalendarType } from '../calendar/common';
|
|
2
|
-
import { type CalendarInputProps } from './common';
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { type CalendarInputProps, type CalendarInputSlots } from './common';
|
|
3
|
+
declare function __VLS_template(): Readonly<CalendarInputSlots> & CalendarInputSlots;
|
|
4
|
+
declare const __VLS_component: import("vue").DefineComponent<CalendarInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
} & {
|
|
7
|
+
[x: string]: any;
|
|
7
8
|
}, string, import("vue").PublicProps, Readonly<CalendarInputProps> & Readonly<{
|
|
8
|
-
|
|
9
|
-
onChange?: ((value: string | string[] | Date | Date[] | undefined) => any) | undefined;
|
|
10
|
-
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
9
|
+
[x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
|
|
11
10
|
}>, {
|
|
12
11
|
type: CalendarType;
|
|
13
12
|
valueOnClear: () => any;
|
|
@@ -17,4 +16,10 @@ declare const _default: import("vue").DefineComponent<CalendarInputProps, {}, {}
|
|
|
17
16
|
weekStartsOn: number;
|
|
18
17
|
maxDays: number;
|
|
19
18
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
20
20
|
export default _default;
|
|
21
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -7,9 +7,14 @@
|
|
|
7
7
|
:clearable="clearable"
|
|
8
8
|
:root-class="rootClass"
|
|
9
9
|
:root-style="rootStyle"
|
|
10
|
+
:internal-arrow="$slots.arrow ? 1 : 0"
|
|
11
|
+
:input-props="inputProps"
|
|
10
12
|
@clear="onClear"
|
|
11
13
|
@click="show"
|
|
12
14
|
>
|
|
15
|
+
<template v-if="$slots.arrow" #arrow>
|
|
16
|
+
<slot name="arrow"></slot>
|
|
17
|
+
</template>
|
|
13
18
|
<sar-calendar-popout
|
|
14
19
|
v-model:visible="innerVisible"
|
|
15
20
|
v-model="innerValue"
|
|
@@ -34,6 +39,8 @@
|
|
|
34
39
|
:value-format="valueFormat"
|
|
35
40
|
:validate-event="validateEvent"
|
|
36
41
|
@change="onChange"
|
|
42
|
+
@visible-hook="onVisibleHook"
|
|
43
|
+
@confirm="onConfirm"
|
|
37
44
|
/>
|
|
38
45
|
</sar-popout-input>
|
|
39
46
|
</template>
|
|
@@ -80,8 +87,21 @@ import {
|
|
|
80
87
|
* @property {string} placeholder 输入框占位符内容,默认值:-。
|
|
81
88
|
* @property {string [详见特殊符号](../utilities/date#日期格式特殊符号)} outletFormat 输出到输入框的日期格式,默认值:'YYYY-MM-DD'。
|
|
82
89
|
* @property {() => any} valueOnClear 设置点击清除按钮后的值,默认值:() => undefined。
|
|
90
|
+
* @property {string} arrow 自定义箭头图标名,默认值:'caret-right'。
|
|
91
|
+
* @property {string} arrowFamily 自定义箭头图标字体,默认值:'sari'。
|
|
92
|
+
* @property {InputProps} inputProps 自定义输入框组件属性,默认值:-。
|
|
83
93
|
* @event {(visible: boolean) => void} update 弹出框显隐时触发
|
|
84
94
|
* @event {(value: Date | Date[] | string | string[] | undefined) => void} change 日历组件值改变时触发
|
|
95
|
+
* @event {() => void} confirm 点击确定按钮时触发
|
|
96
|
+
* @event {(name: TransitionHookName) => void} visible-hook 入场/退场动画状态改变时触发
|
|
97
|
+
* @event {() => void} before-enter 入场动画开始前触发
|
|
98
|
+
* @event {() => void} enter 入场动画开始时触发
|
|
99
|
+
* @event {() => void} after-enter 入场动画结束时触发
|
|
100
|
+
* @event {() => void} enter-cancelled 入场动画取消时触发
|
|
101
|
+
* @event {() => void} before-leave 退场动画开始前触发
|
|
102
|
+
* @event {() => void} leave 退场动画开始时触发
|
|
103
|
+
* @event {() => void} after-leave 退场动画结束时触发
|
|
104
|
+
* @event {() => void} leave-cancelled 退场动画取消时触发
|
|
85
105
|
*/
|
|
86
106
|
export default _defineComponent({
|
|
87
107
|
components: {
|
|
@@ -126,14 +146,26 @@ export default _defineComponent({
|
|
|
126
146
|
readonly: { type: Boolean, required: false },
|
|
127
147
|
disabled: { type: Boolean, required: false },
|
|
128
148
|
clearable: { type: Boolean, required: false },
|
|
129
|
-
multiline: { type: Boolean, required: false }
|
|
149
|
+
multiline: { type: Boolean, required: false },
|
|
150
|
+
arrow: { type: String, required: false },
|
|
151
|
+
arrowFamily: { type: String, required: false },
|
|
152
|
+
internalArrow: { type: Number, required: false },
|
|
153
|
+
inputProps: { type: Object, required: false }
|
|
130
154
|
}, defaultCalendarInputProps()),
|
|
131
|
-
emits: ["update:visible", "update:model-value", "change"],
|
|
155
|
+
emits: ["update:visible", "update:model-value", "change", "confirm", "before-enter", "enter", "after-enter", "enter-cancelled", "before-leave", "leave", "after-leave", "leave-cancelled", "visible-hook"],
|
|
132
156
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
133
157
|
__expose();
|
|
134
158
|
const props = __props;
|
|
135
159
|
const emit = __emit;
|
|
136
|
-
const {
|
|
160
|
+
const {
|
|
161
|
+
innerVisible,
|
|
162
|
+
innerValue,
|
|
163
|
+
inputValue,
|
|
164
|
+
show,
|
|
165
|
+
onChange,
|
|
166
|
+
onClear,
|
|
167
|
+
onVisibleHook
|
|
168
|
+
} = usePopoutInput(props, emit);
|
|
137
169
|
const { t } = useTranslate("calendar");
|
|
138
170
|
function getOutletTextMayByStr(date) {
|
|
139
171
|
if (isString(date) && props.valueFormat) {
|
|
@@ -176,7 +208,10 @@ export default _defineComponent({
|
|
|
176
208
|
immediate: true
|
|
177
209
|
}
|
|
178
210
|
);
|
|
179
|
-
const
|
|
211
|
+
const onConfirm = () => {
|
|
212
|
+
emit("confirm");
|
|
213
|
+
};
|
|
214
|
+
const __returned__ = { props, emit, innerVisible, innerValue, inputValue, show, onChange, onClear, onVisibleHook, t, getOutletTextMayByStr, getOutletText, getInputValue, onConfirm, SarPopoutInput, SarCalendarPopout };
|
|
180
215
|
return __returned__;
|
|
181
216
|
}
|
|
182
217
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CalendarPopoutEmits, type CalendarPopoutProps } from '../calendar-popout/common';
|
|
2
|
-
import { type PopoutInputProps } from '../popout-input/common';
|
|
2
|
+
import { type PopoutInputSlots, type PopoutInputProps } from '../popout-input/common';
|
|
3
3
|
export interface CalendarInputProps extends CalendarPopoutProps, Omit<PopoutInputProps, 'modelValue' | 'loading'> {
|
|
4
4
|
outletFormat?: string;
|
|
5
5
|
valueOnClear?: () => any;
|
|
@@ -13,5 +13,7 @@ export declare const defaultCalendarInputProps: () => {
|
|
|
13
13
|
maxDays: number;
|
|
14
14
|
weekStartsOn: number;
|
|
15
15
|
};
|
|
16
|
+
export interface CalendarInputSlots extends PopoutInputSlots {
|
|
17
|
+
}
|
|
16
18
|
export interface CalendarInputEmits extends CalendarPopoutEmits {
|
|
17
19
|
}
|
|
@@ -93,8 +93,18 @@ import CalendarPopout from 'sard-uniapp/components/calendar-popout/calendar-popo
|
|
|
93
93
|
|
|
94
94
|
### CalendarPopoutEmits
|
|
95
95
|
|
|
96
|
-
| 事件
|
|
97
|
-
|
|
|
98
|
-
| update:model-value
|
|
99
|
-
| change
|
|
100
|
-
| update:visible
|
|
96
|
+
| 事件 | 描述 | 类型 |
|
|
97
|
+
| ---------------------------------- | --------------------------- | ------------------------------------------------------------------ |
|
|
98
|
+
| update:model-value | 日历组件值改变时触发 | (value: Date \| Date[] \| string \| string[] \| undefined) => void |
|
|
99
|
+
| change | 日历组件值改变时触发 | (value: Date \| Date[] \| string \| string[] \| undefined) => void |
|
|
100
|
+
| update:visible | 弹出框显隐时触发 | (visible: boolean) => void |
|
|
101
|
+
| confirm <sup>1.22.1+</sup> | 点击确定按钮时触发 | () => void |
|
|
102
|
+
| visible-hook <sup>1.22.1+</sup> | 入场/退场动画状态改变时触发 | (name: TransitionHookName) => void |
|
|
103
|
+
| before-enter <sup>1.22.1+</sup> | 入场动画开始前触发 | () => void |
|
|
104
|
+
| enter <sup>1.22.1+</sup> | 入场动画开始时触发 | () => void |
|
|
105
|
+
| after-enter <sup>1.22.1+</sup> | 入场动画结束时触发 | () => void |
|
|
106
|
+
| enter-cancelled <sup>1.22.1+</sup> | 入场动画取消时触发 | () => void |
|
|
107
|
+
| before-leave <sup>1.22.1+</sup> | 退场动画开始前触发 | () => void |
|
|
108
|
+
| leave <sup>1.22.1+</sup> | 退场动画开始时触发 | () => void |
|
|
109
|
+
| after-leave <sup>1.22.1+</sup> | 退场动画结束时触发 | () => void |
|
|
110
|
+
| leave-cancelled <sup>1.22.1+</sup> | 退场动画取消时触发 | () => void |
|
|
@@ -3,14 +3,12 @@ declare function __VLS_template(): {
|
|
|
3
3
|
"title-prepend"?(_: {}): any;
|
|
4
4
|
title?(_: {}): any;
|
|
5
5
|
};
|
|
6
|
-
declare const __VLS_component: import("vue").DefineComponent<CalendarPopoutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
declare const __VLS_component: import("vue").DefineComponent<CalendarPopoutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
[x: string]: any;
|
|
8
|
+
} & {
|
|
9
|
+
[x: string]: any;
|
|
10
10
|
}, string, import("vue").PublicProps, Readonly<CalendarPopoutProps> & Readonly<{
|
|
11
|
-
|
|
12
|
-
onChange?: ((value: string | string[] | Date | Date[] | undefined) => any) | undefined;
|
|
13
|
-
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
11
|
+
[x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
|
|
14
12
|
}>, {
|
|
15
13
|
type: import("../calendar/common.js").CalendarType;
|
|
16
14
|
showConfirm: boolean;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
:root-class="popoutClass"
|
|
8
8
|
:root-style="popoutStyle"
|
|
9
9
|
@confirm="onConfirm"
|
|
10
|
+
@visible-hook="onVisibleHook"
|
|
10
11
|
>
|
|
11
12
|
<template #title-prepend>
|
|
12
13
|
<slot name="title-prepend"></slot>
|
|
@@ -75,6 +76,16 @@ import { useFormPopout } from "../../use";
|
|
|
75
76
|
* @property {boolean} validateEvent 是否触发表单验证,默认值:true。
|
|
76
77
|
* @event {(visible: boolean) => void} update 弹出框显隐时触发
|
|
77
78
|
* @event {(value: Date | Date[] | string | string[] | undefined) => void} change 日历组件值改变时触发
|
|
79
|
+
* @event {() => void} confirm 点击确定按钮时触发
|
|
80
|
+
* @event {(name: TransitionHookName) => void} visible-hook 入场/退场动画状态改变时触发
|
|
81
|
+
* @event {() => void} before-enter 入场动画开始前触发
|
|
82
|
+
* @event {() => void} enter 入场动画开始时触发
|
|
83
|
+
* @event {() => void} after-enter 入场动画结束时触发
|
|
84
|
+
* @event {() => void} enter-cancelled 入场动画取消时触发
|
|
85
|
+
* @event {() => void} before-leave 退场动画开始前触发
|
|
86
|
+
* @event {() => void} leave 退场动画开始时触发
|
|
87
|
+
* @event {() => void} after-leave 退场动画结束时触发
|
|
88
|
+
* @event {() => void} leave-cancelled 退场动画取消时触发
|
|
78
89
|
*/
|
|
79
90
|
export default _defineComponent({
|
|
80
91
|
components: {
|
|
@@ -114,28 +125,24 @@ export default _defineComponent({
|
|
|
114
125
|
endDateText: { type: String, required: false },
|
|
115
126
|
sameDateText: { type: String, required: false }
|
|
116
127
|
}, defaultCalendarPopoutProps()),
|
|
117
|
-
emits: ["update:visible", "update:model-value", "change"],
|
|
128
|
+
emits: ["update:visible", "update:model-value", "change", "confirm", "before-enter", "enter", "after-enter", "enter-cancelled", "before-leave", "leave", "after-leave", "leave-cancelled", "visible-hook"],
|
|
118
129
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
119
130
|
__expose();
|
|
120
131
|
const props = __props;
|
|
121
132
|
const emit = __emit;
|
|
122
|
-
const { innerVisible, popoutValue, onChange, onConfirm } = useFormPopout(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if (!props.showConfirm && !confirmDisabled.value) {
|
|
128
|
-
onConfirm();
|
|
129
|
-
innerVisible.value = false;
|
|
130
|
-
}
|
|
133
|
+
const { innerVisible, popoutValue, onChange, onConfirm, onVisibleHook } = useFormPopout(props, emit, {
|
|
134
|
+
onChange() {
|
|
135
|
+
if (!props.showConfirm && !confirmDisabled.value) {
|
|
136
|
+
onConfirm(false);
|
|
137
|
+
innerVisible.value = false;
|
|
131
138
|
}
|
|
132
139
|
}
|
|
133
|
-
);
|
|
140
|
+
});
|
|
134
141
|
const confirmDisabled = computed(() => {
|
|
135
142
|
const value = popoutValue.value;
|
|
136
143
|
return !value || Array.isArray(value) && value.length === 0;
|
|
137
144
|
});
|
|
138
|
-
const __returned__ = { props, emit, innerVisible, popoutValue, onChange, onConfirm, confirmDisabled, SarPopout, SarCalendar };
|
|
145
|
+
const __returned__ = { props, emit, innerVisible, popoutValue, onChange, onConfirm, onVisibleHook, confirmDisabled, SarPopout, SarCalendar };
|
|
139
146
|
return __returned__;
|
|
140
147
|
}
|
|
141
148
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type StyleValue } from 'vue';
|
|
2
2
|
import { type CalendarProps } from '../calendar/common';
|
|
3
|
+
import { type TransitionHookEmits } from '../popup/common';
|
|
3
4
|
export interface CalendarPopoutProps extends CalendarProps {
|
|
4
5
|
visible?: boolean;
|
|
5
6
|
title?: string;
|
|
@@ -20,10 +21,11 @@ export interface CalendarPopoutSlots {
|
|
|
20
21
|
title?(props: Record<string, never>): any;
|
|
21
22
|
'title-prepend'?(props: Record<string, never>): any;
|
|
22
23
|
}
|
|
23
|
-
export interface CalendarPopoutEmits {
|
|
24
|
+
export interface CalendarPopoutEmits extends TransitionHookEmits {
|
|
24
25
|
(e: 'update:visible', visible: boolean): void;
|
|
25
26
|
(e: 'update:model-value', value: Date | Date[] | string | string[] | undefined): void;
|
|
26
27
|
(e: 'change', value: Date | Date[] | string | string[] | undefined): void;
|
|
28
|
+
(e: 'confirm'): void;
|
|
27
29
|
}
|
|
28
30
|
export interface CalendarPopoutExpose {
|
|
29
31
|
}
|
|
@@ -41,10 +41,17 @@ import CascaderInput from 'sard-uniapp/components/cascader-input/cascader-input.
|
|
|
41
41
|
| clearable | 是否显示清空按钮 | boolean | false |
|
|
42
42
|
| placeholder | 输入框占位符内容 | string | - |
|
|
43
43
|
| value-on-clear <sup>1.19.2+</sup> | 设置点击清除按钮后的值 | () => any | () => undefined |
|
|
44
|
+
| arrow <sup>1.22+</sup> | 自定义箭头图标名 | string | 'caret-right' |
|
|
45
|
+
| arrow-family <sup>1.22+</sup> | 自定义箭头图标字体 | string | 'sari' |
|
|
46
|
+
| input-props <sup>1.22+</sup> | 自定义输入框组件属性 | InputProps | - |
|
|
44
47
|
|
|
45
48
|
### CascaderInputSlots
|
|
46
49
|
|
|
47
|
-
继承 [`CascaderPopoutSlots`](./cascader-popout#CascaderPopoutSlots)
|
|
50
|
+
继承 [`CascaderPopoutSlots`](./cascader-popout#CascaderPopoutSlots),并有以下额外插槽:
|
|
51
|
+
|
|
52
|
+
| 插槽 | 描述 | 属性 |
|
|
53
|
+
| ---------------------- | ---------- | ---------- |
|
|
54
|
+
| arrow <sup>1.22+</sup> | 自定义箭头 | () => void |
|
|
48
55
|
|
|
49
56
|
### CascaderInputEmits
|
|
50
57
|
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { type CascaderOption } from '../cascader/common';
|
|
2
1
|
import { type CascaderInputProps, type CascaderInputSlots } from './common';
|
|
3
2
|
declare function __VLS_template(): Readonly<CascaderInputSlots> & CascaderInputSlots;
|
|
4
|
-
declare const __VLS_component: import("vue").DefineComponent<CascaderInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"update:visible": (visible: boolean) => any;
|
|
3
|
+
declare const __VLS_component: import("vue").DefineComponent<CascaderInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
} & {
|
|
6
|
+
[x: string]: any;
|
|
9
7
|
}, string, import("vue").PublicProps, Readonly<CascaderInputProps> & Readonly<{
|
|
10
|
-
|
|
11
|
-
onChange?: ((value: any, selectedOptions: CascaderOption[]) => any) | undefined;
|
|
12
|
-
onSelect?: ((option: CascaderOption, tabIndex: number) => any) | undefined;
|
|
13
|
-
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
8
|
+
[x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
|
|
14
9
|
}>, {
|
|
15
10
|
valueOnClear: () => any;
|
|
16
11
|
showConfirm: boolean;
|