sard 1.0.29 → 1.2.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.
- package/README.md +1 -2
- package/all-components.js +4 -0
- package/components/action-sheet/action-sheet-item.vue.js +1 -1
- package/components/action-sheet/common.d.ts +1 -1
- package/components/button/button.vue.js +1 -1
- package/components/calendar-popout/common.d.ts +1 -1
- package/components/cascader-popout/common.d.ts +1 -1
- package/components/checkbox-popout/common.d.ts +1 -1
- package/components/color-picker-popout/common.d.ts +1 -1
- package/components/crop-image/common.d.ts +1 -1
- package/components/danmaku/common.d.ts +38 -0
- package/components/danmaku/common.js +14 -0
- package/components/danmaku/danmaku.vue.d.ts +23 -0
- package/components/danmaku/danmaku.vue.js +370 -0
- package/components/danmaku/index.css +1 -0
- package/components/danmaku/index.d.ts +5 -0
- package/components/danmaku/index.js +6 -0
- package/components/datetime-picker-popout/common.d.ts +1 -1
- package/components/datetime-range-picker-popout/common.d.ts +1 -1
- package/components/descriptions/common.d.ts +8 -3
- package/components/descriptions/descriptions-item.vue.d.ts +0 -2
- package/components/descriptions/descriptions-item.vue.js +20 -21
- package/components/descriptions/descriptions.vue.js +56 -28
- package/components/descriptions/index.css +1 -1
- package/components/dialog/common.d.ts +1 -1
- package/components/dnd/dnd-item.vue.js +19 -9
- package/components/dnd/index.css +1 -1
- package/components/dropdown/common.d.ts +1 -1
- package/components/ellipsis/ellipsis.vue.js +62 -58
- package/components/ellipsis/index.css +1 -1
- package/components/image/image.vue.d.ts +1 -1
- package/components/index.d.ts +2 -0
- package/components/index.js +3 -1
- package/components/keyboard/keyboard.vue.d.ts +1 -1
- package/components/keyboard-popout/common.d.ts +1 -1
- package/components/keyboard-popout/keyboard-popout.vue.d.ts +1 -1
- package/components/list/index.css +1 -1
- package/components/load-more/load-more.vue.js +2 -2
- package/components/loading/loading.vue.js +1 -1
- package/components/motion/motion.vue.js +1 -1
- package/components/notify/common.d.ts +1 -1
- package/components/overlay/overlay.vue.js +6 -5
- package/components/picker/picker.vue.js +8 -5
- package/components/picker-popout/common.d.ts +1 -1
- package/components/picker-view/common.d.ts +22 -2
- package/components/picker-view/index.d.ts +2 -2
- package/components/picker-view/index.js +2 -2
- package/components/picker-view/picker-view-column.vue.d.ts +19 -0
- package/components/picker-view/picker-view-column.vue.js +167 -0
- package/components/picker-view/picker-view.vue.d.ts +55 -0
- package/components/picker-view/picker-view.vue.js +60 -0
- package/components/popout/common.d.ts +1 -1
- package/components/popout/popout.vue.js +2 -4
- package/components/popover/common.js +1 -1
- package/components/popover/popover.vue.js +11 -10
- package/components/popup/popup.vue.js +1 -1
- package/components/preview-image/common.d.ts +1 -1
- package/components/preview-image/preview-image.vue.d.ts +1 -1
- package/components/preview-image/preview-image.vue.js +4 -4
- package/components/pull-down-refresh/pull-down-refresh.vue.js +4 -7
- package/components/radio-popout/common.d.ts +1 -1
- package/components/rate/rate.vue.js +2 -2
- package/components/select-popout/common.d.ts +1 -1
- package/components/share-sheet/common.d.ts +1 -1
- package/components/skeleton/skeleton.vue.js +1 -1
- package/components/swiper/index.d.ts +2 -2
- package/components/swiper/index.js +2 -2
- package/components/swiper/swiper-item.vue.d.ts +11 -0
- package/components/swiper/swiper-item.vue.js +32 -0
- package/components/swiper/swiper.vue.d.ts +147 -0
- package/components/swiper/swiper.vue.js +51 -0
- package/components/swiper/useSwiper.d.ts +1 -2
- package/components/swiper/useSwiper.js +12 -12
- package/components/table/table.vue.js +1 -2
- package/components/text-shrink/common.d.ts +28 -0
- package/components/text-shrink/common.js +8 -0
- package/components/text-shrink/index.css +1 -0
- package/components/text-shrink/index.d.ts +5 -0
- package/components/text-shrink/index.js +6 -0
- package/components/text-shrink/text-shrink.vue.d.ts +16 -0
- package/components/text-shrink/text-shrink.vue.js +252 -0
- package/components/toast/common.d.ts +1 -1
- package/global.d.ts +2 -0
- package/index.css +1 -1
- package/index.js +3 -2
- package/package.json +1 -1
- package/utils/createImperativeComponent.d.ts +12 -5
- package/utils/createImperativeComponent.js +13 -37
- package/utils/imperative/agent-runtime.d.ts +28 -0
- package/utils/imperative/agent-runtime.js +33 -0
- package/utils/imperative/imperative-agent.vue.d.ts +35 -0
- package/utils/imperative/imperative-agent.vue.js +60 -0
- package/utils/index.d.ts +0 -1
- package/utils/index.js +1 -2
- package/utils/is.d.ts +4 -1
- package/utils/is.js +5 -3
- package/utils/number.d.ts +1 -1
- package/utils/number.js +20 -19
- package/components/picker-view/picker-view-column.d.ts +0 -3
- package/components/picker-view/picker-view-column.js +0 -139
- package/components/picker-view/picker-view.d.ts +0 -21
- package/components/picker-view/picker-view.js +0 -57
- package/components/swiper/swiper-item.d.ts +0 -3
- package/components/swiper/swiper-item.js +0 -34
- package/components/swiper/swiper.d.ts +0 -57
- package/components/swiper/swiper.js +0 -43
- package/utils/vnode.d.ts +0 -9
- package/utils/vnode.js +0 -69
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { createBem } from "../../utils/bem.js";
|
|
2
2
|
import { defaultDescriptionsItemProps, descriptionsContextKey } from "./common.js";
|
|
3
|
-
import { Fragment, computed, createElementBlock, createElementVNode, createTextVNode, defineComponent, inject, mergeDefaults, normalizeClass, normalizeStyle, openBlock, renderSlot, toDisplayString } from "vue";
|
|
3
|
+
import { Fragment, computed, createElementBlock, createElementVNode, createTextVNode, defineComponent, inject, mergeDefaults, normalizeClass, normalizeStyle, onUnmounted, openBlock, renderSlot, toDisplayString } from "vue";
|
|
4
4
|
//#region packages/sard/components/descriptions/descriptions-item.vue
|
|
5
|
-
const _hoisted_1 = ["rowspan"];
|
|
6
|
-
const _hoisted_2 = ["colspan", "rowspan"];
|
|
7
5
|
var descriptions_item_default = /*@__PURE__*/ defineComponent({
|
|
8
6
|
__name: "descriptions-item",
|
|
9
7
|
props: /*@__PURE__*/ mergeDefaults({
|
|
@@ -19,17 +17,9 @@ var descriptions_item_default = /*@__PURE__*/ defineComponent({
|
|
|
19
17
|
type: Number,
|
|
20
18
|
required: false
|
|
21
19
|
},
|
|
22
|
-
labelWidth: {
|
|
23
|
-
type: String,
|
|
24
|
-
required: false
|
|
25
|
-
},
|
|
26
20
|
labelAlign: {
|
|
27
21
|
type: String,
|
|
28
22
|
required: false
|
|
29
|
-
},
|
|
30
|
-
contentColspan: {
|
|
31
|
-
type: Number,
|
|
32
|
-
required: false
|
|
33
23
|
}
|
|
34
24
|
}, defaultDescriptionsItemProps),
|
|
35
25
|
setup(__props) {
|
|
@@ -39,15 +29,27 @@ var descriptions_item_default = /*@__PURE__*/ defineComponent({
|
|
|
39
29
|
if (!context) throw new Error("DescriptionsItem must be included in Descriptions.");
|
|
40
30
|
const colspan = computed(() => props.colspan ?? 1);
|
|
41
31
|
const rowspan = computed(() => props.rowspan ?? 1);
|
|
42
|
-
const
|
|
43
|
-
|
|
32
|
+
const meta = {
|
|
33
|
+
colspan: () => colspan.value,
|
|
34
|
+
rowspan: () => rowspan.value
|
|
35
|
+
};
|
|
36
|
+
onUnmounted(context.registerItem(meta));
|
|
37
|
+
const contentSpan = computed(() => {
|
|
38
|
+
return context.getContentSpan(meta) ?? colspan.value * 2 - 1;
|
|
39
|
+
});
|
|
44
40
|
const effectiveLabelAlign = computed(() => props.labelAlign ?? context.labelAlign);
|
|
45
41
|
const labelStyle = computed(() => {
|
|
46
42
|
const style = {};
|
|
47
|
-
if (
|
|
43
|
+
if (context.labelWidth) style.width = context.labelWidth;
|
|
48
44
|
if (effectiveLabelAlign.value) style.textAlign = effectiveLabelAlign.value;
|
|
45
|
+
if (rowspan.value > 1) style.gridRow = `span ${rowspan.value}`;
|
|
49
46
|
return Object.keys(style).length ? style : void 0;
|
|
50
47
|
});
|
|
48
|
+
const contentStyle = computed(() => {
|
|
49
|
+
const style = { "--s-descriptions-content-span": String(contentSpan.value) };
|
|
50
|
+
if (rowspan.value > 1) style.gridRow = `span ${rowspan.value}`;
|
|
51
|
+
return style;
|
|
52
|
+
});
|
|
51
53
|
const labelCellClass = computed(() => {
|
|
52
54
|
return [
|
|
53
55
|
bem.e("item-label"),
|
|
@@ -59,16 +61,13 @@ var descriptions_item_default = /*@__PURE__*/ defineComponent({
|
|
|
59
61
|
return [bem.e("item-content"), bem.is("bordered", context.bordered)];
|
|
60
62
|
});
|
|
61
63
|
return (_ctx, _cache) => {
|
|
62
|
-
return openBlock(), createElementBlock(Fragment, null, [createElementVNode("
|
|
64
|
+
return openBlock(), createElementBlock(Fragment, null, [createElementVNode("div", {
|
|
63
65
|
class: normalizeClass(labelCellClass.value),
|
|
64
|
-
colspan: "1",
|
|
65
|
-
rowspan: rowspan.value,
|
|
66
66
|
style: normalizeStyle(labelStyle.value)
|
|
67
|
-
}, [renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])],
|
|
67
|
+
}, [renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])], 6), createElementVNode("div", {
|
|
68
68
|
class: normalizeClass(contentCellClass.value),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_2)], 64);
|
|
69
|
+
style: normalizeStyle(contentStyle.value)
|
|
70
|
+
}, [renderSlot(_ctx.$slots, "default")], 6)], 64);
|
|
72
71
|
};
|
|
73
72
|
}
|
|
74
73
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createBem } from "../../utils/bem.js";
|
|
2
|
-
import { flatVNode } from "../../utils/vnode.js";
|
|
3
2
|
import { defaultDescriptionsProps, descriptionsContextKey } from "./common.js";
|
|
4
|
-
import {
|
|
3
|
+
import { computed, createElementBlock, defineComponent, mergeDefaults, normalizeClass, normalizeStyle, openBlock, provide, reactive, ref, renderSlot, toRef } from "vue";
|
|
5
4
|
//#region packages/sard/components/descriptions/descriptions.vue
|
|
6
5
|
var descriptions_default = /*@__PURE__*/ defineComponent({
|
|
7
6
|
__name: "descriptions",
|
|
@@ -30,24 +29,36 @@ var descriptions_default = /*@__PURE__*/ defineComponent({
|
|
|
30
29
|
setup(__props) {
|
|
31
30
|
const props = __props;
|
|
32
31
|
const bem = createBem("descriptions");
|
|
33
|
-
provide(descriptionsContextKey, reactive({
|
|
34
|
-
bordered: toRef(() => props.bordered),
|
|
35
|
-
colon: toRef(() => props.colon),
|
|
36
|
-
labelWidth: toRef(() => props.labelWidth),
|
|
37
|
-
labelAlign: toRef(() => props.labelAlign)
|
|
38
|
-
}));
|
|
39
|
-
const slots = useSlots();
|
|
40
32
|
const columns = computed(() => props.columns ?? 1);
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
const items = [];
|
|
34
|
+
const registeredVersion = ref(0);
|
|
35
|
+
function registerItem(meta) {
|
|
36
|
+
items.push(meta);
|
|
37
|
+
registeredVersion.value++;
|
|
38
|
+
return () => {
|
|
39
|
+
const index = items.indexOf(meta);
|
|
40
|
+
if (index !== -1) {
|
|
41
|
+
items.splice(index, 1);
|
|
42
|
+
registeredVersion.value++;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 计算每个描述项内容格的列跨度。
|
|
48
|
+
* 一个描述项占 `colspan * 2` 列(标签 1 列 + 内容 `colspan * 2 - 1` 列),
|
|
49
|
+
* 最后一项的内容会填满当前行剩余列。
|
|
50
|
+
*/
|
|
51
|
+
const contentSpans = computed(() => {
|
|
52
|
+
registeredVersion.value;
|
|
53
|
+
const spans = /* @__PURE__ */ new Map();
|
|
54
|
+
const columnCount = columns.value;
|
|
44
55
|
const result = [];
|
|
45
56
|
let temp = [];
|
|
46
|
-
let count =
|
|
57
|
+
let count = columnCount;
|
|
47
58
|
const rowspanTemp = [];
|
|
48
|
-
|
|
49
|
-
const nodeColspan =
|
|
50
|
-
const nodeRowspan =
|
|
59
|
+
items.forEach((meta, index) => {
|
|
60
|
+
const nodeColspan = meta.colspan();
|
|
61
|
+
const nodeRowspan = meta.rowspan();
|
|
51
62
|
let rowNo = result.length;
|
|
52
63
|
rowspanTemp[rowNo] ||= 0;
|
|
53
64
|
if (nodeRowspan > 1) for (let i = 1; i < nodeRowspan; i++) {
|
|
@@ -60,28 +71,42 @@ var descriptions_default = /*@__PURE__*/ defineComponent({
|
|
|
60
71
|
if (count <= 0) {
|
|
61
72
|
result.push(temp);
|
|
62
73
|
temp = [];
|
|
63
|
-
count =
|
|
74
|
+
count = columnCount;
|
|
64
75
|
rowNo++;
|
|
65
76
|
}
|
|
66
77
|
}
|
|
67
|
-
if (index ===
|
|
68
|
-
|
|
78
|
+
if (index === items.length - 1) {
|
|
79
|
+
spans.set(meta, (nodeColspan < count ? count : nodeColspan) * 2 - 1);
|
|
80
|
+
temp.push(index);
|
|
69
81
|
result.push(temp);
|
|
70
82
|
return;
|
|
71
83
|
}
|
|
72
84
|
if (nodeColspan < count) {
|
|
73
85
|
count -= nodeColspan;
|
|
74
|
-
|
|
86
|
+
spans.set(meta, nodeColspan * 2 - 1);
|
|
87
|
+
temp.push(index);
|
|
75
88
|
} else {
|
|
76
89
|
const span = Math.min(nodeColspan, count);
|
|
77
|
-
|
|
90
|
+
spans.set(meta, span * 2 - 1);
|
|
91
|
+
temp.push(index);
|
|
78
92
|
result.push(temp);
|
|
79
|
-
count =
|
|
93
|
+
count = columnCount;
|
|
80
94
|
temp = [];
|
|
81
95
|
}
|
|
82
96
|
});
|
|
83
|
-
return
|
|
97
|
+
return spans;
|
|
84
98
|
});
|
|
99
|
+
function getContentSpan(meta) {
|
|
100
|
+
return contentSpans.value.get(meta);
|
|
101
|
+
}
|
|
102
|
+
provide(descriptionsContextKey, reactive({
|
|
103
|
+
bordered: toRef(() => props.bordered),
|
|
104
|
+
colon: toRef(() => props.colon),
|
|
105
|
+
labelWidth: toRef(() => props.labelWidth),
|
|
106
|
+
labelAlign: toRef(() => props.labelAlign),
|
|
107
|
+
registerItem,
|
|
108
|
+
getContentSpan
|
|
109
|
+
}));
|
|
85
110
|
const descriptionsClass = computed(() => {
|
|
86
111
|
return [
|
|
87
112
|
bem.b(),
|
|
@@ -89,12 +114,15 @@ var descriptions_default = /*@__PURE__*/ defineComponent({
|
|
|
89
114
|
bem.has("colon", props.colon)
|
|
90
115
|
];
|
|
91
116
|
});
|
|
117
|
+
const descriptionsStyle = computed(() => {
|
|
118
|
+
const labelWidth = props.labelWidth;
|
|
119
|
+
return { gridTemplateColumns: labelWidth ? `repeat(${columns.value}, ${labelWidth} minmax(0, 1fr))` : `repeat(${columns.value * 2}, minmax(0, 1fr))` };
|
|
120
|
+
});
|
|
92
121
|
return (_ctx, _cache) => {
|
|
93
|
-
return openBlock(), createElementBlock("
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}), 128))])], 2);
|
|
122
|
+
return openBlock(), createElementBlock("div", {
|
|
123
|
+
class: normalizeClass(descriptionsClass.value),
|
|
124
|
+
style: normalizeStyle(descriptionsStyle.value)
|
|
125
|
+
}, [renderSlot(_ctx.$slots, "default")], 6);
|
|
98
126
|
};
|
|
99
127
|
}
|
|
100
128
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--s-descriptions-label-color:var(--s-text-color-tertiary);--s-descriptions-label-font-size:var(--s-font-size);--s-descriptions-label-bg:var(--s-fill-color-fourth);--s-descriptions-content-color:var(--s-text-color-primary);--s-descriptions-content-font-size:var(--s-font-size);--s-descriptions-item-padding-y:var(--s-size-xs);--s-descriptions-item-padding-x:var(--s-size-sm);--s-descriptions-border-color:var(--s-border-color)}.s-descriptions{width:100%;
|
|
1
|
+
:root{--s-descriptions-label-color:var(--s-text-color-tertiary);--s-descriptions-label-font-size:var(--s-font-size);--s-descriptions-label-bg:var(--s-fill-color-fourth);--s-descriptions-content-color:var(--s-text-color-primary);--s-descriptions-content-font-size:var(--s-font-size);--s-descriptions-item-padding-y:var(--s-size-xs);--s-descriptions-item-padding-x:var(--s-size-sm);--s-descriptions-border-color:var(--s-border-color)}.s-descriptions{display:grid;width:100%;column-gap:var(--s-descriptions-item-padding-x);row-gap:var(--s-descriptions-item-padding-y)}.s-descriptions:is(.is-bordered){column-gap:0;row-gap:0;border-block-start:var(--s-border-width) solid var(--s-descriptions-border-color);border-inline-start:var(--s-border-width) solid var(--s-descriptions-border-color)}.s-descriptions__item-label{color:var(--s-descriptions-label-color);font-size:var(--s-descriptions-label-font-size);word-break:break-word}.s-descriptions__item-label:is(.is-bordered){padding:var(--s-descriptions-item-padding-y) var(--s-descriptions-item-padding-x);border-inline-end:var(--s-border-width) solid var(--s-descriptions-border-color);border-block-end:var(--s-border-width) solid var(--s-descriptions-border-color);background:var(--s-descriptions-label-bg)}.s-descriptions__item-label:is(.has-colon)::after{content:":"}.s-descriptions__item-content{grid-column:span var(--s-descriptions-content-span, 1);color:var(--s-descriptions-content-color);font-size:var(--s-descriptions-content-font-size);word-break:break-word}.s-descriptions__item-content:is(.is-bordered){padding:var(--s-descriptions-item-padding-y) var(--s-descriptions-item-padding-x);border-inline-end:var(--s-border-width) solid var(--s-descriptions-border-color);border-block-end:var(--s-border-width) solid var(--s-descriptions-border-color)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DefaultProps } from '../config';
|
|
2
2
|
import { type ButtonProps } from '../button';
|
|
3
|
-
import type { MotionEmits } from '../motion';
|
|
3
|
+
import type { MotionEmits } from '../motion/common';
|
|
4
4
|
export type DialogBeforeClose = (type: 'close' | 'cancel' | 'confirm', loading: {
|
|
5
5
|
readonly cancel: boolean;
|
|
6
6
|
readonly confirm: boolean;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createBem } from "../../utils/bem.js";
|
|
2
|
-
import { OnlyChild } from "../../utils/vnode.js";
|
|
3
2
|
import { dndContextKey, dndItemContextKey } from "./common.js";
|
|
4
|
-
import { computed,
|
|
3
|
+
import { computed, createElementBlock, defineComponent, inject, normalizeClass, onBeforeUnmount, onMounted, onUpdated, openBlock, provide, ref, renderSlot, shallowRef, useAttrs, useTemplateRef, watchPostEffect } from "vue";
|
|
5
4
|
//#region packages/sard/components/dnd/dnd-item.vue
|
|
6
5
|
var dnd_item_default = /*@__PURE__*/ defineComponent({
|
|
7
6
|
__name: "dnd-item",
|
|
@@ -14,9 +13,19 @@ var dnd_item_default = /*@__PURE__*/ defineComponent({
|
|
|
14
13
|
const bem = createBem("dnd-item");
|
|
15
14
|
const dndContext = inject(dndContextKey);
|
|
16
15
|
if (!dndContext) throw new Error("DndItem must be included in Dnd.");
|
|
16
|
+
const wrapperRef = useTemplateRef("wrapperRef");
|
|
17
17
|
const elRef = shallowRef(null);
|
|
18
|
-
const
|
|
18
|
+
const attrs = useAttrs();
|
|
19
|
+
let forwardedClass = "";
|
|
20
|
+
const syncElRef = () => {
|
|
21
|
+
const wrapper = wrapperRef.value;
|
|
22
|
+
const el = wrapper?.firstElementChild ?? wrapper ?? null;
|
|
19
23
|
elRef.value = el;
|
|
24
|
+
if (!el) return;
|
|
25
|
+
const next = normalizeClass(attrs.class);
|
|
26
|
+
for (const name of forwardedClass.split(" ")) if (name) el.classList.remove(name);
|
|
27
|
+
for (const name of next.split(" ")) if (name) el.classList.add(name);
|
|
28
|
+
forwardedClass = next;
|
|
20
29
|
};
|
|
21
30
|
let dropItemInfo = null;
|
|
22
31
|
let currentIndex = -1;
|
|
@@ -26,8 +35,10 @@ var dnd_item_default = /*@__PURE__*/ defineComponent({
|
|
|
26
35
|
return elRef.value.getBoundingClientRect();
|
|
27
36
|
};
|
|
28
37
|
onMounted(() => {
|
|
38
|
+
syncElRef();
|
|
29
39
|
dndContext.addRectItem(getNodeRect);
|
|
30
40
|
});
|
|
41
|
+
onUpdated(syncElRef);
|
|
31
42
|
onBeforeUnmount(() => {
|
|
32
43
|
dndContext.removeRectItem(getNodeRect);
|
|
33
44
|
});
|
|
@@ -117,13 +128,12 @@ var dnd_item_default = /*@__PURE__*/ defineComponent({
|
|
|
117
128
|
});
|
|
118
129
|
__expose({});
|
|
119
130
|
return (_ctx, _cache) => {
|
|
120
|
-
return openBlock(),
|
|
131
|
+
return openBlock(), createElementBlock("span", {
|
|
132
|
+
ref_key: "wrapperRef",
|
|
133
|
+
ref: wrapperRef,
|
|
121
134
|
class: normalizeClass(dndItemClass.value),
|
|
122
|
-
|
|
123
|
-
},
|
|
124
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
125
|
-
_: 3
|
|
126
|
-
}, 8, ["class"]);
|
|
135
|
+
style: { "display": "contents" }
|
|
136
|
+
}, [renderSlot(_ctx.$slots, "default")], 2);
|
|
127
137
|
};
|
|
128
138
|
}
|
|
129
139
|
});
|
package/components/dnd/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.s-dnd-item{position:relative}.s-dnd-item--active{z-index:1;box-shadow:var(--s-box-shadow-secondary)}.s-dnd-item--passive{transition:transform var(--s-duration)}.s-dnd-handle{cursor:pointer;-webkit-user-select:none;user-select:none}.s-dnd-handle--dragging{touch-action:none}
|
|
1
|
+
.s-dnd-item{border-radius:inherit}.s-dnd-item>*{position:relative}.s-dnd-item--active>*{z-index:1;box-shadow:var(--s-box-shadow-secondary)}.s-dnd-item--passive>*{transition:transform var(--s-duration)}.s-dnd-handle{cursor:pointer;-webkit-user-select:none;user-select:none}.s-dnd-handle--dragging{touch-action:none}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type InjectionKey } from 'vue';
|
|
2
2
|
import { type DefaultProps } from '../config';
|
|
3
|
-
import type { MotionEmits } from '../motion';
|
|
3
|
+
import type { MotionEmits } from '../motion/common';
|
|
4
4
|
export interface DropdownProps {
|
|
5
5
|
direction?: 'down' | 'up';
|
|
6
6
|
disabled?: boolean;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { createBem } from "../../utils/bem.js";
|
|
2
2
|
import { useResizeObserver } from "../../use/useResizeObserver.js";
|
|
3
3
|
import { defaultEllipsisProps } from "./common.js";
|
|
4
|
-
import { computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, mergeDefaults,
|
|
4
|
+
import { computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, mergeDefaults, normalizeClass, normalizeStyle, onMounted, openBlock, ref, toDisplayString, unref, useModel, useTemplateRef, watch } from "vue";
|
|
5
5
|
//#region packages/sard/components/ellipsis/ellipsis.vue
|
|
6
|
+
const HEIGHT_TOLERANCE = .5;
|
|
6
7
|
var ellipsis_default = /*@__PURE__*/ defineComponent({
|
|
7
8
|
__name: "ellipsis",
|
|
8
9
|
props: /*@__PURE__*/ mergeDefaults({
|
|
@@ -40,6 +41,10 @@ var ellipsis_default = /*@__PURE__*/ defineComponent({
|
|
|
40
41
|
const props = __props;
|
|
41
42
|
const emit = __emit;
|
|
42
43
|
const bem = createBem("ellipsis");
|
|
44
|
+
const measureClass = bem.e("measure");
|
|
45
|
+
const actionClass = bem.e("action");
|
|
46
|
+
/** 测量层里的按钮占位:只负责排版占位,不带 __action 类,避免同一个类名在 DOM 里出现两次 */
|
|
47
|
+
const measureActionClass = bem.e("measure-action");
|
|
43
48
|
const innerExpanded = useModel(props, "expanded");
|
|
44
49
|
const onToggle = () => {
|
|
45
50
|
const expanded = !innerExpanded.value;
|
|
@@ -53,58 +58,73 @@ var ellipsis_default = /*@__PURE__*/ defineComponent({
|
|
|
53
58
|
return innerExpanded.value ? props.collapseText : props.expandText;
|
|
54
59
|
});
|
|
55
60
|
const rootRef = useTemplateRef("root");
|
|
56
|
-
const
|
|
57
|
-
const lineRef = useTemplateRef("line");
|
|
58
|
-
const calcRef = useTemplateRef("calc");
|
|
61
|
+
const measureRef = useTemplateRef("measure");
|
|
59
62
|
const isOverflow = ref(false);
|
|
60
63
|
const truncatedContent = ref(props.content);
|
|
61
|
-
const measureContent = ref(props.content);
|
|
62
64
|
const resizeWidth = ref(0);
|
|
63
|
-
const initialized = ref(false);
|
|
64
65
|
const isMeasuring = ref(true);
|
|
65
|
-
|
|
66
|
+
/** 一轮探测的判定容差(px) */
|
|
66
67
|
const getCharacters = (content) => {
|
|
67
68
|
return Array.from(content);
|
|
68
69
|
};
|
|
69
|
-
const buildEllipsisText = (
|
|
70
|
-
const
|
|
71
|
-
if (keepCount >=
|
|
70
|
+
const buildEllipsisText = (characters, keepCount, position, dots) => {
|
|
71
|
+
const total = characters.length;
|
|
72
|
+
if (keepCount >= total) return characters.join("");
|
|
72
73
|
if (keepCount <= 0) return dots;
|
|
73
|
-
if (position === "start") return dots + characters.slice(
|
|
74
|
+
if (position === "start") return dots + characters.slice(total - keepCount).join("");
|
|
74
75
|
if (position === "middle") {
|
|
75
76
|
const leftCount = Math.ceil(keepCount / 2);
|
|
76
77
|
const rightCount = Math.floor(keepCount / 2);
|
|
77
|
-
return characters.slice(0, leftCount).join("") + dots + characters.slice(
|
|
78
|
+
return characters.slice(0, leftCount).join("") + dots + characters.slice(total - rightCount).join("");
|
|
78
79
|
}
|
|
79
80
|
return characters.slice(0, keepCount).join("") + dots;
|
|
80
81
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
/**
|
|
83
|
+
* 测量层里的两个节点,挂载后建一次就复用。
|
|
84
|
+
* 不用模板声明是因为 `white-space: pre-wrap` 会把模板的换行缩进变成真实空格/空行,
|
|
85
|
+
* 量高度时全算进去。
|
|
86
|
+
*/
|
|
87
|
+
let measureText;
|
|
88
|
+
let measureAction;
|
|
89
|
+
function ensureMeasureDom(measure) {
|
|
90
|
+
if (measureText?.parentElement === measure) return;
|
|
91
|
+
measureText = document.createElement("span");
|
|
92
|
+
measureAction = document.createElement("span");
|
|
93
|
+
measureAction.className = measureActionClass;
|
|
94
|
+
measure.replaceChildren(measureText, measureAction);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* 写入一轮要测量的内容。
|
|
98
|
+
* withAction 为 false 时把按钮藏起来,用来量「纯正文」到底占几行。
|
|
99
|
+
*/
|
|
100
|
+
function writeMeasure(text, withAction) {
|
|
101
|
+
if (!measureText || !measureAction) return;
|
|
102
|
+
measureText.textContent = text;
|
|
103
|
+
measureAction.textContent = ` ${props.expandText ?? ""}`;
|
|
104
|
+
measureAction.style.display = withAction && hasAction.value ? "" : "none";
|
|
105
|
+
}
|
|
106
|
+
const measureHeight = () => measureRef.value?.getBoundingClientRect().height ?? 0;
|
|
107
|
+
const update = () => {
|
|
86
108
|
const content = props.content || "";
|
|
109
|
+
const measure = measureRef.value;
|
|
110
|
+
if (!measure) return;
|
|
111
|
+
ensureMeasureDom(measure);
|
|
87
112
|
isMeasuring.value = true;
|
|
88
113
|
if (!content) {
|
|
89
|
-
truncatedContent.value =
|
|
90
|
-
measureContent.value = content;
|
|
114
|
+
truncatedContent.value = "";
|
|
91
115
|
isOverflow.value = false;
|
|
92
|
-
|
|
93
|
-
if (token === updateToken) isMeasuring.value = false;
|
|
116
|
+
isMeasuring.value = false;
|
|
94
117
|
return;
|
|
95
118
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const lineHeight = getHeight(lineRef.value);
|
|
101
|
-
if (token !== updateToken) return;
|
|
119
|
+
writeMeasure(content, false);
|
|
120
|
+
measure.style.whiteSpace = "nowrap";
|
|
121
|
+
const lineHeight = measureHeight();
|
|
122
|
+
measure.style.whiteSpace = "";
|
|
102
123
|
const clampHeight = lineHeight * props.rows;
|
|
103
|
-
if (
|
|
124
|
+
if (measureHeight() - clampHeight <= HEIGHT_TOLERANCE) {
|
|
104
125
|
truncatedContent.value = content;
|
|
105
126
|
isOverflow.value = false;
|
|
106
|
-
|
|
107
|
-
if (token === updateToken) isMeasuring.value = false;
|
|
127
|
+
isMeasuring.value = false;
|
|
108
128
|
return;
|
|
109
129
|
}
|
|
110
130
|
const characters = getCharacters(content);
|
|
@@ -113,23 +133,15 @@ var ellipsis_default = /*@__PURE__*/ defineComponent({
|
|
|
113
133
|
let best = 0;
|
|
114
134
|
while (low <= high) {
|
|
115
135
|
const middle = Math.floor((low + high) / 2);
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
await nextTick();
|
|
119
|
-
if (token !== updateToken) return;
|
|
120
|
-
const height = getHeight(calcRef.value);
|
|
121
|
-
if (token !== updateToken) return;
|
|
122
|
-
if (height <= clampHeight + .5) {
|
|
136
|
+
writeMeasure(buildEllipsisText(characters, middle, props.position, props.dots), true);
|
|
137
|
+
if (measureHeight() <= clampHeight + HEIGHT_TOLERANCE) {
|
|
123
138
|
best = middle;
|
|
124
139
|
low = middle + 1;
|
|
125
140
|
} else high = middle - 1;
|
|
126
141
|
}
|
|
127
|
-
|
|
128
|
-
if (token !== updateToken) return;
|
|
129
|
-
truncatedContent.value = nextTruncatedContent;
|
|
142
|
+
truncatedContent.value = buildEllipsisText(characters, best, props.position, props.dots);
|
|
130
143
|
isOverflow.value = true;
|
|
131
|
-
|
|
132
|
-
if (token === updateToken) isMeasuring.value = false;
|
|
144
|
+
isMeasuring.value = false;
|
|
133
145
|
};
|
|
134
146
|
useResizeObserver(rootRef, (size) => {
|
|
135
147
|
if (resizeWidth.value && Math.abs(size.width - resizeWidth.value) <= .5) return;
|
|
@@ -140,7 +152,8 @@ var ellipsis_default = /*@__PURE__*/ defineComponent({
|
|
|
140
152
|
() => props.content,
|
|
141
153
|
() => props.rows,
|
|
142
154
|
() => props.position,
|
|
143
|
-
() => props.dots
|
|
155
|
+
() => props.dots,
|
|
156
|
+
() => props.expandText
|
|
144
157
|
], () => {
|
|
145
158
|
update();
|
|
146
159
|
});
|
|
@@ -177,24 +190,15 @@ var ellipsis_default = /*@__PURE__*/ defineComponent({
|
|
|
177
190
|
style: normalizeStyle(contentStyle.value)
|
|
178
191
|
}, [createTextVNode(toDisplayString(displayContent.value) + " ", 1), showAction.value ? (openBlock(), createElementBlock("span", {
|
|
179
192
|
key: 0,
|
|
180
|
-
class: normalizeClass(unref(
|
|
193
|
+
class: normalizeClass(unref(actionClass)),
|
|
181
194
|
onClick: onToggle
|
|
182
195
|
}, toDisplayString(actionText.value), 3)) : createCommentVNode("v-if", true)], 6),
|
|
196
|
+
createCommentVNode(" 唯一的测量层:整段高度、单行高度、二分候选都在这一块里量。\n 内容是空的,两个 span(正文 + 展开按钮)由 JS 建、由 JS 直接改 textContent,\n 每轮探测只有「一次写入 + 一次读取」,不触发组件重渲染。\n 绝对定位 + contain,测量引起的布局失效既不会撑开可见布局,也不会传到祖先链。 "),
|
|
183
197
|
createElementVNode("div", {
|
|
184
|
-
ref: "
|
|
185
|
-
class: normalizeClass(unref(
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
ref: "line",
|
|
189
|
-
class: normalizeClass([unref(bem).e("measure"), unref(bem).em("measure", "line")])
|
|
190
|
-
}, toDisplayString(props.content), 3),
|
|
191
|
-
createElementVNode("div", {
|
|
192
|
-
ref: "calc",
|
|
193
|
-
class: normalizeClass(unref(bem).e("measure"))
|
|
194
|
-
}, [createTextVNode(toDisplayString(measureContent.value) + " ", 1), hasAction.value ? (openBlock(), createElementBlock("span", {
|
|
195
|
-
key: 0,
|
|
196
|
-
class: normalizeClass(unref(bem).e("action"))
|
|
197
|
-
}, toDisplayString(props.expandText), 3)) : createCommentVNode("v-if", true)], 2)
|
|
198
|
+
ref: "measure",
|
|
199
|
+
class: normalizeClass(unref(measureClass)),
|
|
200
|
+
"aria-hidden": "true"
|
|
201
|
+
}, null, 2)
|
|
198
202
|
], 2);
|
|
199
203
|
};
|
|
200
204
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--s-ellipsis-action-margin-start:var(--s-size-2xs);--s-ellipsis-action-color:var(--s-color-primary)}.s-ellipsis{position:relative}.s-ellipsis__content{display:block;white-space:pre-wrap;word-break:break-all}.s-ellipsis__content--clamp{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}.s-ellipsis__action{position:relative;display:inline;margin-inline-start:var(--s-ellipsis-action-margin-start);color:var(--s-ellipsis-action-color);line-height:inherit;cursor:pointer;vertical-align:bottom;white-space:nowrap}.s-ellipsis__measure{position:absolute;display:block;left:0;top:0;z-index:-1;width:100%;opacity:0;pointer-events:none;white-space:pre-wrap;word-break:break-all
|
|
1
|
+
:root{--s-ellipsis-action-margin-start:var(--s-size-2xs);--s-ellipsis-action-color:var(--s-color-primary)}.s-ellipsis{position:relative}.s-ellipsis__content{display:block;white-space:pre-wrap;word-break:break-all}.s-ellipsis__content--clamp{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}.s-ellipsis__action{position:relative;display:inline;margin-inline-start:var(--s-ellipsis-action-margin-start);color:var(--s-ellipsis-action-color);line-height:inherit;cursor:pointer;vertical-align:bottom;white-space:nowrap}.s-ellipsis__measure-action{margin-inline-start:var(--s-ellipsis-action-margin-start);line-height:inherit;vertical-align:bottom;white-space:nowrap}.s-ellipsis__measure{position:absolute;display:block;left:0;top:0;z-index:-1;width:100%;opacity:0;pointer-events:none;white-space:pre-wrap;word-break:break-all;contain:layout style}
|
|
@@ -12,9 +12,9 @@ declare const __VLS_base: import("vue").DefineComponent<ImageProps, ImageExpose,
|
|
|
12
12
|
width: string;
|
|
13
13
|
height: string;
|
|
14
14
|
background: string;
|
|
15
|
-
mode: import("./common").ImageMode;
|
|
16
15
|
fade: boolean;
|
|
17
16
|
loading: "eager" | "lazy";
|
|
17
|
+
mode: import("./common").ImageMode;
|
|
18
18
|
shape: "circle" | "square";
|
|
19
19
|
src: string;
|
|
20
20
|
showError: boolean;
|
package/components/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export * from './cool-icon';
|
|
|
26
26
|
export * from './count-down';
|
|
27
27
|
export * from './count-to';
|
|
28
28
|
export * from './crop-image';
|
|
29
|
+
export * from './danmaku';
|
|
29
30
|
export * from './date-strip';
|
|
30
31
|
export * from './datetime-picker';
|
|
31
32
|
export * from './datetime-picker-input';
|
|
@@ -113,6 +114,7 @@ export * from './table';
|
|
|
113
114
|
export * from './tabs';
|
|
114
115
|
export * from './tag';
|
|
115
116
|
export * from './text';
|
|
117
|
+
export * from './text-shrink';
|
|
116
118
|
export * from './timeline';
|
|
117
119
|
export * from './toast';
|
|
118
120
|
export * from './tree';
|
package/components/index.js
CHANGED
|
@@ -36,6 +36,7 @@ import { CountDown } from "./count-down/index.js";
|
|
|
36
36
|
import { CountTo } from "./count-to/index.js";
|
|
37
37
|
import { createCropImage, cropImage } from "./crop-image/imperative.js";
|
|
38
38
|
import { CropImage } from "./crop-image/index.js";
|
|
39
|
+
import { Danmaku } from "./danmaku/index.js";
|
|
39
40
|
import { DateStrip } from "./date-strip/index.js";
|
|
40
41
|
import { DatetimePicker } from "./datetime-picker/index.js";
|
|
41
42
|
import { DatetimePickerInput } from "./datetime-picker-input/index.js";
|
|
@@ -133,6 +134,7 @@ import { Table } from "./table/index.js";
|
|
|
133
134
|
import { Tab, Tabs } from "./tabs/index.js";
|
|
134
135
|
import { Tag } from "./tag/index.js";
|
|
135
136
|
import { Text } from "./text/index.js";
|
|
137
|
+
import { TextShrink } from "./text-shrink/index.js";
|
|
136
138
|
import { Timeline, TimelineItem } from "./timeline/index.js";
|
|
137
139
|
import { createToast, toast } from "./toast/imperative.js";
|
|
138
140
|
import { Toast } from "./toast/index.js";
|
|
@@ -140,4 +142,4 @@ import { Tree, TreeBranch, TreeNode } from "./tree/index.js";
|
|
|
140
142
|
import { Upload, UploadPreview } from "./upload/index.js";
|
|
141
143
|
import { Waterfall, WaterfallItem, WaterfallLoad } from "./waterfall/index.js";
|
|
142
144
|
import { Watermark } from "./watermark/index.js";
|
|
143
|
-
export { ADD_SWIPER_CONTEXT_KEY, Accordion, AccordionItem, ActionSheet, ActionSheetItem, Alert, Avatar, AvatarGroup, BackTop, Badge, Barcode, Button, Calendar, CalendarInput, CalendarPopout, CancelError, Card, Cascader, CascaderInput, CascaderPopout, Checkbox, CheckboxGroup, CheckboxInput, CheckboxPopout, Col, Collapse, ColorPicker, ColorPickerInput, ColorPickerPopout, Compact, CoolIcon, CountDown, CountTo, CropImage, DateStrip, DatetimePicker, DatetimePickerInput, DatetimePickerPopout, DatetimeRangePicker, DatetimeRangePickerInput, DatetimeRangePickerPopout, Descriptions, DescriptionsItem, Dialog, Divider, Dnd, DndHandle, DndItem, Dropdown, DropdownItem, Ellipsis, Empty, Fab, FabItem, Flex, FloatingBubble, FloatingPanel, Form, FormItem, FormItemPlain, FormPlain, Grid, GridItem, Image, Indexes, IndexesAnchor, IndexesNav, Input, Keyboard, KeyboardPopout, List, ListItem, LoadMore, LoadMoreStatus, Loading, Marquee, Menu, MenuItem, Motion, Navbar, NavbarItem, NavbarPit, NoticeBar, Notify, Overlay, Pagination, PasswordInput, Picker, PickerInput, PickerPopout, PickerView, PickerViewColumn, Popout, PopoutInput, Popover, Popup, PreviewImage, ProgressBar, ProgressCircle, PullDownRefresh, PuzzleVerify, Qrcode, REMOVE_SWIPER_CONTEXT_KEY, Radio, RadioGroup, RadioInput, RadioPopout, Rate, ReadMore, Result, RotateVerify, Row, SWIPER_AUTO_HEIGHT_KEY, ScrollList, ScrollSpy, ScrollSpyAnchor, Search, Segmented, SegmentedItem, Select, SelectInput, SelectOption, SelectOptionGroup, SelectPopout, ShareSheet, ShareSheetIcon, ShareSheetItem, ShareSheetRow, Sidebar, SidebarItem, Signature, Skeleton, SkeletonAvatar, SkeletonBlock, SkeletonParagraph, SkeletonTitle, SlideVerify, Slider, StatusBar, Step, Stepper, Steps, Sticky, StickyBox, SwipeAction, Swiper, SwiperItem, Switch, Tab, Tabbar, TabbarItem, TabbarPit, Table, Tabs, Tag, Text, Timeline, TimelineItem, Toast, Tree, TreeBranch, TreeNode, Upload, UploadPreview, Waterfall, WaterfallItem, WaterfallLoad, Watermark, actionSheet, createActionSheet, createCropImage, createDialog, createNotify, createPreviewImage, createToast, cropImage, dialog, flexGap, formatTime, getCurrentTime, isCancelError, notify, omitFormPopoutProps, partitionPopoutInputProps, plateEnglishLetterKeys, plateProvinceKeys, plateSuffixKeys, popupManager, previewImage, safeAreaInsets, toast, useCountDown, useElementBackTop, useFormContext, useFormItem, useFormItemContext, useFormPopout, useInPopup, useMotioning, usePageBackTop, usePopoutInput, usePopupEnter, usePopupVisibleHookProvide, windowInfo };
|
|
145
|
+
export { ADD_SWIPER_CONTEXT_KEY, Accordion, AccordionItem, ActionSheet, ActionSheetItem, Alert, Avatar, AvatarGroup, BackTop, Badge, Barcode, Button, Calendar, CalendarInput, CalendarPopout, CancelError, Card, Cascader, CascaderInput, CascaderPopout, Checkbox, CheckboxGroup, CheckboxInput, CheckboxPopout, Col, Collapse, ColorPicker, ColorPickerInput, ColorPickerPopout, Compact, CoolIcon, CountDown, CountTo, CropImage, Danmaku, DateStrip, DatetimePicker, DatetimePickerInput, DatetimePickerPopout, DatetimeRangePicker, DatetimeRangePickerInput, DatetimeRangePickerPopout, Descriptions, DescriptionsItem, Dialog, Divider, Dnd, DndHandle, DndItem, Dropdown, DropdownItem, Ellipsis, Empty, Fab, FabItem, Flex, FloatingBubble, FloatingPanel, Form, FormItem, FormItemPlain, FormPlain, Grid, GridItem, Image, Indexes, IndexesAnchor, IndexesNav, Input, Keyboard, KeyboardPopout, List, ListItem, LoadMore, LoadMoreStatus, Loading, Marquee, Menu, MenuItem, Motion, Navbar, NavbarItem, NavbarPit, NoticeBar, Notify, Overlay, Pagination, PasswordInput, Picker, PickerInput, PickerPopout, PickerView, PickerViewColumn, Popout, PopoutInput, Popover, Popup, PreviewImage, ProgressBar, ProgressCircle, PullDownRefresh, PuzzleVerify, Qrcode, REMOVE_SWIPER_CONTEXT_KEY, Radio, RadioGroup, RadioInput, RadioPopout, Rate, ReadMore, Result, RotateVerify, Row, SWIPER_AUTO_HEIGHT_KEY, ScrollList, ScrollSpy, ScrollSpyAnchor, Search, Segmented, SegmentedItem, Select, SelectInput, SelectOption, SelectOptionGroup, SelectPopout, ShareSheet, ShareSheetIcon, ShareSheetItem, ShareSheetRow, Sidebar, SidebarItem, Signature, Skeleton, SkeletonAvatar, SkeletonBlock, SkeletonParagraph, SkeletonTitle, SlideVerify, Slider, StatusBar, Step, Stepper, Steps, Sticky, StickyBox, SwipeAction, Swiper, SwiperItem, Switch, Tab, Tabbar, TabbarItem, TabbarPit, Table, Tabs, Tag, Text, TextShrink, Timeline, TimelineItem, Toast, Tree, TreeBranch, TreeNode, Upload, UploadPreview, Waterfall, WaterfallItem, WaterfallLoad, Watermark, actionSheet, createActionSheet, createCropImage, createDialog, createNotify, createPreviewImage, createToast, cropImage, dialog, flexGap, formatTime, getCurrentTime, isCancelError, notify, omitFormPopoutProps, partitionPopoutInputProps, plateEnglishLetterKeys, plateProvinceKeys, plateSuffixKeys, popupManager, previewImage, safeAreaInsets, toast, useCountDown, useElementBackTop, useFormContext, useFormItem, useFormItemContext, useFormPopout, useInPopup, useMotioning, usePageBackTop, usePopoutInput, usePopupEnter, usePopupVisibleHookProvide, windowInfo };
|
|
@@ -9,8 +9,8 @@ declare const __VLS_base: import("vue").DefineComponent<KeyboardProps, KeyBoardE
|
|
|
9
9
|
onDelete?: (() => any) | undefined;
|
|
10
10
|
"onUpdate:mode"?: ((mode: KeyboardPlateMode) => any) | undefined;
|
|
11
11
|
}>, {
|
|
12
|
-
mode: KeyboardPlateMode;
|
|
13
12
|
type: "number" | "digit" | "idcard" | "random" | "plate";
|
|
13
|
+
mode: KeyboardPlateMode;
|
|
14
14
|
disabledKey: (key: string) => boolean;
|
|
15
15
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
16
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DefaultProps } from '../config';
|
|
2
2
|
import { type KeyboardProps, type KeyboardPlateMode, type KeyBoardExpose } from '../keyboard/common';
|
|
3
|
-
import type { MotionEmits } from '../motion';
|
|
3
|
+
import type { MotionEmits } from '../motion/common';
|
|
4
4
|
export interface KeyboardPopoutProps extends KeyboardProps {
|
|
5
5
|
visible?: boolean;
|
|
6
6
|
title?: string;
|
|
@@ -39,10 +39,10 @@ declare const __VLS_base: import("vue").DefineComponent<KeyboardPopoutProps, Key
|
|
|
39
39
|
"onUpdate:mode"?: ((mode: import("../index.ts").KeyboardPlateMode) => any) | undefined;
|
|
40
40
|
}>, {
|
|
41
41
|
title: string;
|
|
42
|
-
mode: import("../index.ts").KeyboardPlateMode;
|
|
43
42
|
type: "number" | "digit" | "idcard" | "random" | "plate";
|
|
44
43
|
visible: boolean;
|
|
45
44
|
transparent: boolean;
|
|
45
|
+
mode: import("../index.ts").KeyboardPlateMode;
|
|
46
46
|
showCancel: boolean;
|
|
47
47
|
showConfirm: boolean;
|
|
48
48
|
showShadow: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--s-list-border-color:var(--s-border-color);--s-list-title-margin-x:var(--s-size);--s-list-title-margin-top:var(--s-size-2xl);--s-list-title-margin-bottom:var(--s-size-xs);--s-list-title-font-size:var(--s-font-size-sm);--s-list-title-line-height:var(--s-line-height-snug);--s-list-title-color:var(--s-text-color-tertiary);--s-list-description-margin-x:var(--s-size);--s-list-description-margin-top:var(--s-size-xs);--s-list-description-font-size:var(--s-font-size-sm);--s-list-description-line-height:var(--s-line-height-snug);--s-list-description-color:var(--s-text-color-tertiary);--s-list-card-border-radius:var(--s-border-radius-lg);--s-list-item-min-height:var(--s-content-height);--s-list-item-padding-x:var(--s-content-padding-x);--s-list-item-padding-y:var(--s-content-padding-y);--s-list-item-bg:var(--s-bg-color-container);--s-list-item-bg-active:var(--s-bg-color-active);--s-list-item-opacity-disabled:var(--s-opacity-disabled);--s-list-item-icon-size:var(--s-size-lg);--s-list-item-icon-margin-end:var(--s-size-sm);--s-list-item-title-font-size:var(--s-font-size);--s-list-item-title-line-height:var(--s-line-height-snug);--s-list-item-value-font-size:var(--s-font-size);--s-list-item-value-line-height:var(--s-line-height-snug);--s-list-item-value-color:var(--s-text-color-tertiary);--s-list-item-description-margin-top:var(--s-size-2xs);--s-list-item-description-font-size:var(--s-font-size-sm);--s-list-item-description-line-height:var(--s-line-height-snug);--s-list-item-description-color:var(--s-text-color-tertiary);--s-list-item-arrow-margin-start:var(--s-size-xs);--s-list-item-arrow-font-size:var(--s-font-size);--s-list-item-arrow-color:var(--s-text-color-tertiary);--s-list-divider-start:var(--s-list-item-padding-x);--s-list-divider-end:var(--s-list-item-padding-x)}.s-list__title{margin-inline-start:var(--s-list-title-margin-x);margin-inline-end:var(--s-list-title-margin-x);margin-top:var(--s-list-title-margin-top);margin-bottom:var(--s-list-title-margin-bottom);font-size:var(--s-list-title-font-size);line-height:var(--s-list-title-line-height);color:var(--s-list-title-color)}.s-list__content{position:relative}.s-list__content::before{position:absolute;top:0;left:0;z-index:1;width:200%;height:200%;border:var(--s-border-width) var(--s-border-style) rgba(0,0,0,0);transform:scale(0.5);transform-origin:0 0;pointer-events:none;touch-action:none;content:"";border-top-color:var(--s-list-border-color);border-bottom-color:var(--s-list-border-color)}.s-list--borderless .s-list__content::before{display:none}.s-list__description{margin-inline-start:var(--s-list-description-margin-x);margin-inline-end:var(--s-list-description-margin-x);margin-top:var(--s-list-description-margin-top);font-size:var(--s-list-description-font-size);line-height:var(--s-list-description-line-height);color:var(--s-list-description-color)}.s-list--card .s-list__content{border-radius:var(--s-list-card-border-radius)}.s-list--not-card .s-list__content{border-radius:0}.s-list--card .s-list__content::before,.s-list--inlaid .s-list__content::before{display:none}.s-list-item{position:relative;display:flex;flex-wrap:nowrap;overflow:hidden;min-height:var(--s-list-item-min-height);padding:var(--s-list-item-padding-y) var(--s-list-item-padding-x);background:var(--s-list-item-bg)}.s-list-item:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.s-list-item:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.s-list-item::before{position:absolute;z-index:1;pointer-events:none;touch-action:none;opacity:1;content:"";left:0;right:0;transform:scaleY(0.5);top:0;border-top:var(--s-border-width) var(--s-border-style) var(--s-border-color);transform-origin:top center;inset-inline-start:var(--s-list-divider-start);inset-inline-end:var(--s-list-divider-end)}.s-list-item--borderless::before{display:none}.s-list-item:first-child::before{display:none}.s-list-item--hover{cursor:pointer}.s-list-item--hover:active{background:var(--s-list-item-bg-active)}.s-list-item--custom{flex-direction:column}.s-list-item__icon{display:flex;justify-content:center;align-items:center;flex:none;margin-inline-end:var(--s-list-item-icon-margin-end);font-size:var(--s-list-item-icon-size)}.s-list-item__title{display:flex;flex-direction:column;justify-content:center;flex:auto;font-size:var(--s-list-item-title-font-size);line-height:var(--s-list-item-title-line-height);word-break:break-all}.s-list-item__description{margin-top:var(--s-list-item-description-margin-top);font-size:var(--s-list-item-description-font-size);line-height:var(--s-list-item-description-line-height);color:var(--s-list-item-description-color);word-break:break-all}.s-list-item__value{display:flex;flex-direction:column;justify-content:center;align-items:flex-end;flex:auto;font-size:var(--s-list-item-value-font-size);line-height:var(--s-list-item-value-line-height);color:var(--s-list-item-value-color);text-align:right;word-break:break-all}.s-list-item__arrow{display:flex;align-items:center;justify-content:center;margin-inline-start:var(--s-list-item-arrow-margin-start);font-size:var(--s-list-item-arrow-font-size);color:var(--s-list-item-arrow-color)}:root[dir=rtl] .s-list-item__arrow{transform:scaleX(-1)}
|
|
1
|
+
:root{--s-list-border-color:var(--s-border-color);--s-list-title-margin-x:var(--s-size);--s-list-title-margin-top:var(--s-size-2xl);--s-list-title-margin-bottom:var(--s-size-xs);--s-list-title-font-size:var(--s-font-size-sm);--s-list-title-line-height:var(--s-line-height-snug);--s-list-title-color:var(--s-text-color-tertiary);--s-list-description-margin-x:var(--s-size);--s-list-description-margin-top:var(--s-size-xs);--s-list-description-font-size:var(--s-font-size-sm);--s-list-description-line-height:var(--s-line-height-snug);--s-list-description-color:var(--s-text-color-tertiary);--s-list-card-border-radius:var(--s-border-radius-lg);--s-list-item-min-height:var(--s-content-height);--s-list-item-padding-x:var(--s-content-padding-x);--s-list-item-padding-y:var(--s-content-padding-y);--s-list-item-bg:var(--s-bg-color-container);--s-list-item-bg-active:var(--s-bg-color-active);--s-list-item-opacity-disabled:var(--s-opacity-disabled);--s-list-item-icon-size:var(--s-size-lg);--s-list-item-icon-margin-end:var(--s-size-sm);--s-list-item-title-font-size:var(--s-font-size);--s-list-item-title-line-height:var(--s-line-height-snug);--s-list-item-value-font-size:var(--s-font-size);--s-list-item-value-line-height:var(--s-line-height-snug);--s-list-item-value-color:var(--s-text-color-tertiary);--s-list-item-description-margin-top:var(--s-size-2xs);--s-list-item-description-font-size:var(--s-font-size-sm);--s-list-item-description-line-height:var(--s-line-height-snug);--s-list-item-description-color:var(--s-text-color-tertiary);--s-list-item-arrow-margin-start:var(--s-size-xs);--s-list-item-arrow-font-size:var(--s-font-size);--s-list-item-arrow-color:var(--s-text-color-tertiary);--s-list-divider-start:var(--s-list-item-padding-x);--s-list-divider-end:var(--s-list-item-padding-x)}.s-list__title{margin-inline-start:var(--s-list-title-margin-x);margin-inline-end:var(--s-list-title-margin-x);margin-top:var(--s-list-title-margin-top);margin-bottom:var(--s-list-title-margin-bottom);font-size:var(--s-list-title-font-size);line-height:var(--s-list-title-line-height);color:var(--s-list-title-color)}.s-list__content{position:relative}.s-list__content::before{position:absolute;top:0;left:0;z-index:1;width:200%;height:200%;border:var(--s-border-width) var(--s-border-style) rgba(0,0,0,0);transform:scale(0.5);transform-origin:0 0;pointer-events:none;touch-action:none;content:"";border-top-color:var(--s-list-border-color);border-bottom-color:var(--s-list-border-color)}.s-list__content>:not(.s-list-item)>.s-list-item{border-radius:0}.s-list__content>:not(.s-list-item)>.s-list-item:not(.s-list-item--borderless)::before{display:block}.s-list__content>:not(.s-list-item):first-child>.s-list-item{border-top-left-radius:inherit;border-top-right-radius:inherit}.s-list__content>:not(.s-list-item):first-child>.s-list-item::before{display:none}.s-list__content>:not(.s-list-item):last-child>.s-list-item{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.s-list--borderless .s-list__content::before{display:none}.s-list__description{margin-inline-start:var(--s-list-description-margin-x);margin-inline-end:var(--s-list-description-margin-x);margin-top:var(--s-list-description-margin-top);font-size:var(--s-list-description-font-size);line-height:var(--s-list-description-line-height);color:var(--s-list-description-color)}.s-list--card .s-list__content{border-radius:var(--s-list-card-border-radius)}.s-list--not-card .s-list__content{border-radius:0}.s-list--card .s-list__content::before,.s-list--inlaid .s-list__content::before{display:none}.s-list-item{position:relative;display:flex;flex-wrap:nowrap;overflow:hidden;min-height:var(--s-list-item-min-height);padding:var(--s-list-item-padding-y) var(--s-list-item-padding-x);background:var(--s-list-item-bg)}.s-list-item:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.s-list-item:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.s-list-item::before{position:absolute;z-index:1;pointer-events:none;touch-action:none;opacity:1;content:"";left:0;right:0;transform:scaleY(0.5);top:0;border-top:var(--s-border-width) var(--s-border-style) var(--s-border-color);transform-origin:top center;inset-inline-start:var(--s-list-divider-start);inset-inline-end:var(--s-list-divider-end)}.s-list-item--borderless::before{display:none}.s-list-item:first-child::before{display:none}.s-list-item--hover{cursor:pointer}.s-list-item--hover:active{background:var(--s-list-item-bg-active)}.s-list-item--custom{flex-direction:column}.s-list-item__icon{display:flex;justify-content:center;align-items:center;flex:none;margin-inline-end:var(--s-list-item-icon-margin-end);font-size:var(--s-list-item-icon-size)}.s-list-item__title{display:flex;flex-direction:column;justify-content:center;flex:auto;font-size:var(--s-list-item-title-font-size);line-height:var(--s-list-item-title-line-height);word-break:break-all}.s-list-item__description{margin-top:var(--s-list-item-description-margin-top);font-size:var(--s-list-item-description-font-size);line-height:var(--s-list-item-description-line-height);color:var(--s-list-item-description-color);word-break:break-all}.s-list-item__value{display:flex;flex-direction:column;justify-content:center;align-items:flex-end;flex:auto;font-size:var(--s-list-item-value-font-size);line-height:var(--s-list-item-value-line-height);color:var(--s-list-item-value-color);text-align:right;word-break:break-all}.s-list-item__arrow{display:flex;align-items:center;justify-content:center;margin-inline-start:var(--s-list-item-arrow-margin-start);font-size:var(--s-list-item-arrow-font-size);color:var(--s-list-item-arrow-color)}:root[dir=rtl] .s-list-item__arrow{transform:scaleX(-1)}
|