sard-uniapp 1.24.1 → 1.24.3
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 +35 -0
- package/components/cascader-input/cascader-input.vue +1 -0
- package/components/cascader-popout/cascader-popout.vue +1 -0
- package/components/config/index.d.ts +7 -0
- package/components/config/index.js +6 -0
- package/components/count-down/README.md +8 -6
- package/components/count-down/common.d.ts +3 -0
- package/components/count-down/count-down.vue +20 -4
- package/components/count-down/index.scss +10 -0
- package/components/datetime-picker/datetime-picker.vue +2 -2
- package/components/fab/README.md +87 -33
- package/components/fab/common.d.ts +36 -0
- package/components/fab/common.js +1 -0
- package/components/fab/fab.d.ts +21 -2
- package/components/fab/fab.vue +116 -57
- package/components/fab/index.d.ts +1 -1
- package/components/fab/index.scss +29 -52
- package/components/fab-item/common.d.ts +23 -0
- package/components/fab-item/common.js +1 -0
- package/components/fab-item/fab-item.d.ts +14 -0
- package/components/fab-item/fab-item.vue +93 -0
- package/components/fab-item/index.d.ts +1 -0
- package/components/fab-item/index.js +1 -0
- package/components/fab-item/index.scss +44 -0
- package/components/floating-bubble/README.md +12 -9
- package/components/floating-bubble/common.d.ts +4 -0
- package/components/floating-bubble/floating-bubble.d.ts +1 -0
- package/components/floating-bubble/floating-bubble.vue +25 -128
- package/components/floating-bubble/useFloatingBubble.d.ts +46 -0
- package/components/floating-bubble/useFloatingBubble.js +144 -0
- package/components/input/input.vue +0 -3
- package/components/popout/README.md +25 -24
- package/components/popout/common.d.ts +13 -2
- package/components/popout/popout.vue +76 -45
- package/components/popup/README.md +12 -11
- package/components/popup/popup.vue +1 -0
- package/components/share-sheet/share-sheet.vue +1 -0
- package/components/tag/tag.vue +5 -1
- package/components/toast/common.d.ts +1 -0
- package/components/toast/index.scss +0 -16
- package/components/toast/toast.d.ts +1 -0
- package/components/toast/toast.vue +2 -5
- package/components/toast-agent/common.d.ts +1 -0
- package/components/toast-agent/toast-agent.d.ts +1 -0
- package/global.d.ts +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +1 -1
- package/utils/dom.d.ts +1 -1
- package/utils/dom.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
## [1.24.3](https://github.com/sutras/sard-uniapp/compare/v1.24.2...v1.24.3) (2025-09-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **cascader:** 修复allLevels属性透传问题 ([ab36e14](https://github.com/sutras/sard-uniapp/commit/ab36e14f4dee3c5162fa37514667e8362b084744))
|
|
7
|
+
* **datetime-picker:** 修复农历转公历错误的问题 ([9906925](https://github.com/sutras/sard-uniapp/commit/9906925e43b4ca0f5845d932e54db0fccc4e1841))
|
|
8
|
+
* **fab, floating-bubble:** 修复定位不准确的问题 ([de86205](https://github.com/sutras/sard-uniapp/commit/de862051a02c9ba9b4bda963937d07330171dbfd))
|
|
9
|
+
* **input,textarea:** 修复有些机型在输入合成时被最大输入长度阻碍的问题 ([057e800](https://github.com/sutras/sard-uniapp/commit/057e8004fa06849a2e6423d56bf3c4fc85318a8a))
|
|
10
|
+
* 修复web pc端展示默认导航时虚拟触摸事件clientY偏差问题 ([224c052](https://github.com/sutras/sard-uniapp/commit/224c0525e1f1171b05ed212bf4906e09e9c9374e))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **fab:** 允许自定义按钮 ([312b425](https://github.com/sutras/sard-uniapp/commit/312b4252497b3ab2d030e10057cc73ef6a7c116b))
|
|
16
|
+
* **toast:** 添加transparent属性的全局配置 ([ba14176](https://github.com/sutras/sard-uniapp/commit/ba14176e73d88413a864e35e787233b164028427))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## [1.24.2](https://github.com/sutras/sard-uniapp/compare/v1.24.1...v1.24.2) (2025-09-06)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* **count-down:** 修复行内嵌套块的问题 ([fd8112c](https://github.com/sutras/sard-uniapp/commit/fd8112c3885c0069b34f6709c7190a298d680726))
|
|
26
|
+
* **popout:** 修正按钮插槽内容 ([7f29d80](https://github.com/sutras/sard-uniapp/commit/7f29d8059ac1dd342f85a5de54f42e867879ecfc))
|
|
27
|
+
* **tag:** 阻止点击关闭时的事件冒泡 ([4220f31](https://github.com/sutras/sard-uniapp/commit/4220f311f0c5564ae095db6863f415f483f7f22e))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
* **fab:** 添加拖拽功能 ([4d24318](https://github.com/sutras/sard-uniapp/commit/4d243186b4ba22ebe50722c67466eb702c88cbf5))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
1
36
|
## [1.24.1](https://github.com/sutras/sard-uniapp/compare/v1.24.0...v1.24.1) (2025-08-31)
|
|
2
37
|
|
|
3
38
|
|
|
@@ -13,6 +13,7 @@ import { type DatetimeRangePickerInputProps } from '../datetime-range-picker-inp
|
|
|
13
13
|
import { type DialogProps } from '../dialog';
|
|
14
14
|
import { type DividerProps } from '../divider';
|
|
15
15
|
import { type DropdownProps } from '../dropdown';
|
|
16
|
+
import { type FabProps } from '../fab';
|
|
16
17
|
import { type FloatingBubbleProps } from '../floating-bubble';
|
|
17
18
|
import { type FormProps } from '../form';
|
|
18
19
|
import { type GridProps } from '../grid';
|
|
@@ -202,8 +203,13 @@ export declare const defaultConfig: {
|
|
|
202
203
|
overlayClosable: boolean;
|
|
203
204
|
hideName: boolean;
|
|
204
205
|
duration: number;
|
|
206
|
+
draggable: boolean;
|
|
207
|
+
axis: FabProps["axis"];
|
|
208
|
+
gapX: number;
|
|
209
|
+
gapY: number;
|
|
205
210
|
};
|
|
206
211
|
floatingBubble: {
|
|
212
|
+
draggable: boolean;
|
|
207
213
|
axis: FloatingBubbleProps["axis"];
|
|
208
214
|
gapX: number;
|
|
209
215
|
gapY: number;
|
|
@@ -478,6 +484,7 @@ export declare const defaultConfig: {
|
|
|
478
484
|
type: ToastProps["type"];
|
|
479
485
|
position: ToastProps["position"];
|
|
480
486
|
overlay: boolean;
|
|
487
|
+
transparent: boolean;
|
|
481
488
|
timeout: number;
|
|
482
489
|
duration: number;
|
|
483
490
|
};
|
|
@@ -152,8 +152,13 @@ export const defaultConfig = {
|
|
|
152
152
|
overlayClosable: false,
|
|
153
153
|
hideName: false,
|
|
154
154
|
duration: 150,
|
|
155
|
+
draggable: false,
|
|
156
|
+
axis: 'y',
|
|
157
|
+
gapX: 24,
|
|
158
|
+
gapY: 24,
|
|
155
159
|
},
|
|
156
160
|
floatingBubble: {
|
|
161
|
+
draggable: true,
|
|
157
162
|
axis: 'y',
|
|
158
163
|
gapX: 24,
|
|
159
164
|
gapY: 24,
|
|
@@ -428,6 +433,7 @@ export const defaultConfig = {
|
|
|
428
433
|
type: 'text',
|
|
429
434
|
position: 'center',
|
|
430
435
|
overlay: false,
|
|
436
|
+
transparent: false,
|
|
431
437
|
timeout: 1500,
|
|
432
438
|
duration: 200,
|
|
433
439
|
},
|
|
@@ -57,12 +57,14 @@ import CountDown from 'sard-uniapp/components/count-down/count-down.vue'
|
|
|
57
57
|
|
|
58
58
|
### CountDownProps
|
|
59
59
|
|
|
60
|
-
| 属性
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
60
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
61
|
+
| ----------------------------- | ---------------------- | ---------- | ---------- |
|
|
62
|
+
| root-class <sup>1.24.2+</sup> | 组件根元素类名 | string | - |
|
|
63
|
+
| root-style <sup>1.24.2+</sup> | 组件根元素样式 | StyleValue | - |
|
|
64
|
+
| time | 倒计时总时长,单位毫秒 | number | 0 |
|
|
65
|
+
| auto-start | 是否自动开始倒计时 | boolean | true |
|
|
66
|
+
| format | 时间格式 | string | 'HH:mm:ss' |
|
|
67
|
+
| millisecond | 是否开启毫秒级别渲染 | boolean | false |
|
|
66
68
|
|
|
67
69
|
### CountDownSlots
|
|
68
70
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<view :class="countDownClass" :style="countDownStyle">
|
|
3
3
|
<slot :time="currentTime">
|
|
4
4
|
{{ formatTime(format, currentTime) }}
|
|
5
5
|
</slot>
|
|
6
|
-
</
|
|
6
|
+
</view>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script>
|
|
@@ -14,7 +14,10 @@ import {
|
|
|
14
14
|
formatTime,
|
|
15
15
|
defaultCountDownProps
|
|
16
16
|
} from "./common";
|
|
17
|
+
import { classNames, stringifyStyle, createBem } from "../../utils";
|
|
17
18
|
/**
|
|
19
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
20
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
18
21
|
* @property {number} time 倒计时总时长,单位毫秒,默认值:0。
|
|
19
22
|
* @property {boolean} autoStart 是否自动开始倒计时,默认值:true。
|
|
20
23
|
* @property {string} format 时间格式,默认值:'HH:mm:ss'。
|
|
@@ -31,6 +34,8 @@ export default _defineComponent({
|
|
|
31
34
|
},
|
|
32
35
|
__name: "count-down",
|
|
33
36
|
props: _mergeDefaults({
|
|
37
|
+
rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
38
|
+
rootClass: { type: String, required: false },
|
|
34
39
|
time: { type: Number, required: false },
|
|
35
40
|
autoStart: { type: Boolean, required: false },
|
|
36
41
|
format: { type: String, required: false },
|
|
@@ -40,6 +45,7 @@ export default _defineComponent({
|
|
|
40
45
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
41
46
|
const props = __props;
|
|
42
47
|
const emit = __emit;
|
|
48
|
+
const bem = createBem("count-down");
|
|
43
49
|
const remainTime = ref(props.time);
|
|
44
50
|
let endTime = 0;
|
|
45
51
|
let timer = null;
|
|
@@ -102,7 +108,13 @@ export default _defineComponent({
|
|
|
102
108
|
onBeforeUnmount(() => {
|
|
103
109
|
pause();
|
|
104
110
|
});
|
|
105
|
-
const
|
|
111
|
+
const countDownClass = computed(() => {
|
|
112
|
+
return classNames(bem.b(), props.rootClass);
|
|
113
|
+
});
|
|
114
|
+
const countDownStyle = computed(() => {
|
|
115
|
+
return stringifyStyle(props.rootStyle);
|
|
116
|
+
});
|
|
117
|
+
const __returned__ = { props, emit, bem, remainTime, get endTime() {
|
|
106
118
|
return endTime;
|
|
107
119
|
}, set endTime(v) {
|
|
108
120
|
endTime = v;
|
|
@@ -114,10 +126,14 @@ export default _defineComponent({
|
|
|
114
126
|
return paused;
|
|
115
127
|
}, set paused(v) {
|
|
116
128
|
paused = v;
|
|
117
|
-
}, tick, start, pause, reset, precisionTime, currentTime, get formatTime() {
|
|
129
|
+
}, tick, start, pause, reset, precisionTime, currentTime, countDownClass, countDownStyle, get formatTime() {
|
|
118
130
|
return formatTime;
|
|
119
131
|
} };
|
|
120
132
|
return __returned__;
|
|
121
133
|
}
|
|
122
134
|
});
|
|
123
135
|
</script>
|
|
136
|
+
|
|
137
|
+
<style lang="scss">
|
|
138
|
+
@import './index.scss';
|
|
139
|
+
</style>
|
|
@@ -148,7 +148,7 @@ export default _defineComponent({
|
|
|
148
148
|
} else {
|
|
149
149
|
const lunarDate = solarToLunar(
|
|
150
150
|
innerValue.value.getFullYear(),
|
|
151
|
-
innerValue.value.getMonth(),
|
|
151
|
+
innerValue.value.getMonth() + 1,
|
|
152
152
|
innerValue.value.getDate()
|
|
153
153
|
);
|
|
154
154
|
const yearIndex = innerType.value.indexOf("y");
|
|
@@ -246,7 +246,7 @@ export default _defineComponent({
|
|
|
246
246
|
} else {
|
|
247
247
|
const lunarDate = solarToLunar(
|
|
248
248
|
innerValue.value.getFullYear(),
|
|
249
|
-
innerValue.value.getMonth(),
|
|
249
|
+
innerValue.value.getMonth() + 1,
|
|
250
250
|
innerValue.value.getDate()
|
|
251
251
|
);
|
|
252
252
|
return innerType.value.map((letter) => {
|
package/components/fab/README.md
CHANGED
|
@@ -14,6 +14,7 @@ version: 1.5+
|
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
16
|
import Fab from 'sard-uniapp/components/fab/fab.vue'
|
|
17
|
+
import FabItem from 'sard-uniapp/components/fab-item/fab-item.vue'
|
|
17
18
|
```
|
|
18
19
|
|
|
19
20
|
## 代码演示
|
|
@@ -24,7 +25,7 @@ import Fab from 'sard-uniapp/components/fab/fab.vue'
|
|
|
24
25
|
|
|
25
26
|
@code('${DEMO_PATH}/fab/demo/Basic.vue')
|
|
26
27
|
|
|
27
|
-
###
|
|
28
|
+
### 自定义颜色
|
|
28
29
|
|
|
29
30
|
设置 `background` 属性以及按钮项的 `background` 自定义背景色。
|
|
30
31
|
|
|
@@ -54,51 +55,80 @@ import Fab from 'sard-uniapp/components/fab/fab.vue'
|
|
|
54
55
|
|
|
55
56
|
@code('${DEMO_PATH}/fab/demo/BottomLeft.vue')
|
|
56
57
|
|
|
57
|
-
### 无扩展按钮显示
|
|
58
|
-
|
|
59
|
-
当不设置 `item-list` 属性,或其数组长度为 0,则不显示扩展按钮。
|
|
60
|
-
|
|
61
|
-
@code('${DEMO_PATH}/fab/demo/NonItemList.vue')
|
|
62
|
-
|
|
63
58
|
### 自定义图标
|
|
64
59
|
|
|
65
60
|
使用 `icon` 和 `icon-family` 可自定义悬浮按钮图标。
|
|
66
61
|
|
|
67
62
|
@code('${DEMO_PATH}/fab/demo/Icon.vue')
|
|
68
63
|
|
|
64
|
+
### 自定义插槽内容 <sup>1.24.3+</sup>
|
|
65
|
+
|
|
66
|
+
使用 `default` 插槽自定义入口按钮内容,使用 `list` 插槽自定义扩展按钮内容,需要自行循环 `FabItem` 组件。
|
|
67
|
+
|
|
68
|
+
@code('${DEMO_PATH}/fab/demo/Slots.vue')
|
|
69
|
+
|
|
70
|
+
### 可拖拽的 <sup>1.24.2+</sup>
|
|
71
|
+
|
|
72
|
+
设置 `draggable` 属性,悬浮按钮展示在右下角,允许在 y 轴方向上下拖拽。
|
|
73
|
+
|
|
74
|
+
@code('${DEMO_PATH}/fab/demo/Draggable.vue')
|
|
75
|
+
|
|
76
|
+
### 自由拖拽和磁吸 <sup>1.24.2+</sup>
|
|
77
|
+
|
|
78
|
+
`axis` 属性设置允许在 x 或 y 轴方向拖拽,`magnet` 属性设置松开手指后吸附到指定轴方向的最近一边。
|
|
79
|
+
|
|
80
|
+
@code('${DEMO_PATH}/fab/demo/Magnet.vue')
|
|
81
|
+
|
|
82
|
+
### 双向绑定 <sup>1.24.2+</sup>
|
|
83
|
+
|
|
84
|
+
使用 `v-model:offset` 控制悬浮按钮的位置。
|
|
85
|
+
|
|
86
|
+
@code('${DEMO_PATH}/fab/demo/Offset.vue')
|
|
87
|
+
|
|
69
88
|
## API
|
|
70
89
|
|
|
71
90
|
### FabProps
|
|
72
91
|
|
|
73
|
-
| 属性
|
|
74
|
-
|
|
|
75
|
-
| root-class
|
|
76
|
-
| root-style
|
|
77
|
-
| top
|
|
78
|
-
| right
|
|
79
|
-
| bottom
|
|
80
|
-
| left
|
|
81
|
-
| color
|
|
82
|
-
| background
|
|
83
|
-
| icon
|
|
84
|
-
| icon
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
|
|
|
92
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
93
|
+
| ----------------------------------- | --------------------------------------------------------- | ------------------------------ | ------ |
|
|
94
|
+
| root-class | 组件根元素类名 | string | - |
|
|
95
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
96
|
+
| top | 设置距离窗口顶部的距离,优先级比 `bottom` 高 | string | - |
|
|
97
|
+
| right | 设置距离窗口右边的距离 | string | - |
|
|
98
|
+
| bottom | 设置距离窗口底部的距离 | string | - |
|
|
99
|
+
| left | 设置距离窗口左边的距离,优先级比 `right` 高 | string | - |
|
|
100
|
+
| color | 设置按钮图标的颜色 | string | - |
|
|
101
|
+
| background | 设置按钮的背景色 | string | - |
|
|
102
|
+
| icon | 设置入口按钮的图标 | string | - |
|
|
103
|
+
| visible-icon <sup>1.24.3+</sup> | 设置弹出扩展按钮时的入口按钮的图标 | string | - |
|
|
104
|
+
| icon-family | 设置入口按钮的图标族 | string | - |
|
|
105
|
+
| item-list | 设置扩展按钮 | FabItem[] | [] |
|
|
106
|
+
| hide-name | 是否隐藏按钮名称 | boolean | false |
|
|
107
|
+
| overlay-closable | 点击遮罩是否隐藏扩展按钮 | boolean | false |
|
|
108
|
+
| duration | 扩展按钮显隐动画时长,单位 ms | number | 150 |
|
|
109
|
+
| draggable <sup>1.24.2+</sup> | 是否可拖拽 | boolean | false |
|
|
110
|
+
| axis <sup>1.24.2+</sup> | 允许拖拽的方向轴 | 'x' \| 'y' \| 'both' \| 'none' | 'y' |
|
|
111
|
+
| magnet <sup>1.24.2+</sup> | 吸附到指定轴最近的一边,在拖拽时使用 | 'x' \| 'y' | - |
|
|
112
|
+
| gap-x <sup>1.24.2+</sup> | 悬浮按钮与窗口左右两边的最小间距,单位为 px,在拖拽时使用 | number | 24 |
|
|
113
|
+
| gap-y <sup>1.24.2+</sup> | 悬浮按钮与窗口上下两边的最小间距,单位为 px,在拖拽时使用 | number | 24 |
|
|
114
|
+
| offset (v-model) <sup>1.24.2+</sup> | 控制悬浮按钮的位置,在拖拽时使用 | { x: number; y: number } | - |
|
|
115
|
+
| navbar-height <sup>1.24.3+</sup> | 自定义顶部导航栏的高度,在拖拽时使用 | number | 0 |
|
|
116
|
+
| tabbar-height <sup>1.24.3+</sup> | 自定义底部标签栏的高度,在拖拽时使用 | number | 0 |
|
|
117
|
+
|
|
118
|
+
### FabSlots <sup>1.24.3+</sup>
|
|
119
|
+
|
|
120
|
+
| 插槽 | 描述 | 属性 |
|
|
121
|
+
| ------- | ------------------ | ------------------------------------------------------- |
|
|
122
|
+
| default | 自定义入口按钮内容 | { visible: boolean } |
|
|
123
|
+
| list | 自定义扩展按钮内容 | { onItemClick: (item: FabItem, index: number) => void } |
|
|
95
124
|
|
|
96
125
|
### FabEmits
|
|
97
126
|
|
|
98
|
-
| 事件
|
|
99
|
-
|
|
|
100
|
-
| click
|
|
101
|
-
| select
|
|
127
|
+
| 事件 | 描述 | 类型 |
|
|
128
|
+
| -------------------------------- | ---------------------------- | ------------------------------------------ |
|
|
129
|
+
| click | 点击入口按钮时触发 | (event: any) => void |
|
|
130
|
+
| select | 点击扩展按钮时触发 | (item: FabItem, index: number) => void |
|
|
131
|
+
| update:offset <sup>1.24.2+</sup> | 因用户拖拽导致位置改变时触发 | (offset: { x: number; y: number }) => void |
|
|
102
132
|
|
|
103
133
|
### FabItem
|
|
104
134
|
|
|
@@ -110,6 +140,30 @@ import Fab from 'sard-uniapp/components/fab/fab.vue'
|
|
|
110
140
|
| icon | 按钮图标 | string | - |
|
|
111
141
|
| icon-family | 按钮图标族 | string | - |
|
|
112
142
|
|
|
143
|
+
### FabItemProps <sup>1.24.3+</sup>
|
|
144
|
+
|
|
145
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
146
|
+
| ----------- | -------------- | ---------- | ------ |
|
|
147
|
+
| root-class | 组件根元素类名 | string | - |
|
|
148
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
149
|
+
| name | 按钮名称 | string | - |
|
|
150
|
+
| color | 按钮图标颜色 | string | - |
|
|
151
|
+
| background | 按钮背景色 | string | - |
|
|
152
|
+
| icon | 按钮图标 | string | - |
|
|
153
|
+
| icon-family | 按钮图标族 | string | - |
|
|
154
|
+
|
|
155
|
+
### FabItemSlots <sup>1.24.3+</sup>
|
|
156
|
+
|
|
157
|
+
| 插槽 | 描述 | 属性 |
|
|
158
|
+
| ------- | -------------- | ---- |
|
|
159
|
+
| default | 自定义按钮内容 | - |
|
|
160
|
+
|
|
161
|
+
### FabItemEmits <sup>1.24.3+</sup>
|
|
162
|
+
|
|
163
|
+
| 事件 | 描述 | 类型 |
|
|
164
|
+
| ----- | -------------- | -------------------- |
|
|
165
|
+
| click | 点击按钮时触发 | (event: any) => void |
|
|
166
|
+
|
|
113
167
|
## 主题定制
|
|
114
168
|
|
|
115
169
|
### CSS 变量
|
|
@@ -9,21 +9,49 @@ export interface FabProps {
|
|
|
9
9
|
color?: string;
|
|
10
10
|
background?: string;
|
|
11
11
|
icon?: string;
|
|
12
|
+
visibleIcon?: string;
|
|
12
13
|
iconFamily?: string;
|
|
13
14
|
itemList?: FabItem[];
|
|
14
15
|
hideName?: boolean;
|
|
15
16
|
overlayClosable?: boolean;
|
|
16
17
|
duration?: number;
|
|
18
|
+
draggable?: boolean;
|
|
19
|
+
axis?: 'x' | 'y' | 'both' | 'none';
|
|
20
|
+
magnet?: 'x' | 'y';
|
|
21
|
+
gapX?: number;
|
|
22
|
+
gapY?: number;
|
|
23
|
+
offset?: {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
};
|
|
27
|
+
navbarHeight?: number;
|
|
28
|
+
tabbarHeight?: number;
|
|
17
29
|
}
|
|
18
30
|
export declare const defaultFabProps: () => {
|
|
19
31
|
itemList: () => never[];
|
|
20
32
|
overlayClosable: boolean;
|
|
21
33
|
hideName: boolean;
|
|
22
34
|
duration: number;
|
|
35
|
+
draggable: boolean;
|
|
36
|
+
axis: FabProps["axis"];
|
|
37
|
+
gapX: number;
|
|
38
|
+
gapY: number;
|
|
23
39
|
};
|
|
40
|
+
export interface FabSlots {
|
|
41
|
+
default?(props: {
|
|
42
|
+
visible: boolean;
|
|
43
|
+
}): any;
|
|
44
|
+
list?(props: {
|
|
45
|
+
onItemClick: (item: FabItem, index: number) => void;
|
|
46
|
+
}): any;
|
|
47
|
+
}
|
|
24
48
|
export interface FabEmits {
|
|
25
49
|
(e: 'click', event: any): void;
|
|
26
50
|
(e: 'select', item: FabItem, index: number): void;
|
|
51
|
+
(e: 'update:offset', offset: {
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
}): void;
|
|
27
55
|
}
|
|
28
56
|
export interface FabItem {
|
|
29
57
|
name?: string;
|
|
@@ -31,4 +59,12 @@ export interface FabItem {
|
|
|
31
59
|
background?: string;
|
|
32
60
|
icon?: string;
|
|
33
61
|
iconFamily?: string;
|
|
62
|
+
[key: PropertyKey]: any;
|
|
63
|
+
}
|
|
64
|
+
export interface FabContext {
|
|
65
|
+
hideName?: boolean;
|
|
66
|
+
visible?: boolean;
|
|
67
|
+
isLeft?: boolean;
|
|
68
|
+
onItemClick: (item: FabItem, index: number) => void;
|
|
34
69
|
}
|
|
70
|
+
export declare const fabContextSymbol: unique symbol;
|
package/components/fab/common.js
CHANGED
package/components/fab/fab.d.ts
CHANGED
|
@@ -1,14 +1,33 @@
|
|
|
1
|
-
import { type FabProps, FabItem } from './common';
|
|
2
|
-
declare
|
|
1
|
+
import { type FabProps, type FabSlots, type FabItem } from './common';
|
|
2
|
+
declare function __VLS_template(): Readonly<FabSlots> & FabSlots;
|
|
3
|
+
declare const __VLS_component: import("vue").DefineComponent<FabProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
3
4
|
click: (event: any) => any;
|
|
4
5
|
select: (item: FabItem, index: number) => any;
|
|
6
|
+
"update:offset": (offset: {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
}) => any;
|
|
5
10
|
}, string, import("vue").PublicProps, Readonly<FabProps> & Readonly<{
|
|
6
11
|
onClick?: ((event: any) => any) | undefined;
|
|
7
12
|
onSelect?: ((item: FabItem, index: number) => any) | undefined;
|
|
13
|
+
"onUpdate:offset"?: ((offset: {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
}) => any) | undefined;
|
|
8
17
|
}>, {
|
|
18
|
+
axis: "x" | "y" | "both" | "none";
|
|
9
19
|
duration: number;
|
|
10
20
|
overlayClosable: boolean;
|
|
21
|
+
draggable: boolean;
|
|
11
22
|
itemList: FabItem[];
|
|
12
23
|
hideName: boolean;
|
|
24
|
+
gapX: number;
|
|
25
|
+
gapY: number;
|
|
13
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
14
28
|
export default _default;
|
|
29
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|