sard 1.1.0 → 1.2.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/.DS_Store +0 -0
- package/README.md +1 -2
- package/all-components.js +2 -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/index.css +1 -1
- 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 +1 -0
- package/components/index.js +2 -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/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.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 +1 -0
- package/index.css +1 -1
- package/index.js +2 -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,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
package/components/index.js
CHANGED
|
@@ -134,6 +134,7 @@ import { Table } from "./table/index.js";
|
|
|
134
134
|
import { Tab, Tabs } from "./tabs/index.js";
|
|
135
135
|
import { Tag } from "./tag/index.js";
|
|
136
136
|
import { Text } from "./text/index.js";
|
|
137
|
+
import { TextShrink } from "./text-shrink/index.js";
|
|
137
138
|
import { Timeline, TimelineItem } from "./timeline/index.js";
|
|
138
139
|
import { createToast, toast } from "./toast/imperative.js";
|
|
139
140
|
import { Toast } from "./toast/index.js";
|
|
@@ -141,4 +142,4 @@ import { Tree, TreeBranch, TreeNode } from "./tree/index.js";
|
|
|
141
142
|
import { Upload, UploadPreview } from "./upload/index.js";
|
|
142
143
|
import { Waterfall, WaterfallItem, WaterfallLoad } from "./waterfall/index.js";
|
|
143
144
|
import { Watermark } from "./watermark/index.js";
|
|
144
|
-
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, 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)}
|
|
@@ -81,10 +81,10 @@ var load_more_default = /*@__PURE__*/ defineComponent({
|
|
|
81
81
|
ref: "loadMore",
|
|
82
82
|
class: normalizeClass(loadMoreClass.value),
|
|
83
83
|
onClick
|
|
84
|
-
}, [__props.status === "incomplete" ? renderSlot(_ctx.$slots, "incomplete", {
|
|
84
|
+
}, [__props.status === "incomplete" ? renderSlot(_ctx.$slots, "incomplete", {}, () => [createTextVNode(toDisplayString(__props.incompleteText || unref(t)("incompleteText")), 1)], void 0, 0) : __props.status === "loading" ? renderSlot(_ctx.$slots, "loading", {}, () => [createVNode(loading_default, null, {
|
|
85
85
|
default: withCtx(() => [createTextVNode(toDisplayString(__props.loadingText || unref(t)("loadingText")), 1)]),
|
|
86
86
|
_: 1
|
|
87
|
-
})]) : __props.status === "complete" ? renderSlot(_ctx.$slots, "complete", {
|
|
87
|
+
})], void 0, 1) : __props.status === "complete" ? renderSlot(_ctx.$slots, "complete", {}, () => [createTextVNode(toDisplayString(__props.completeText || unref(t)("completeText")), 1)], void 0, 2) : __props.status === "error" ? renderSlot(_ctx.$slots, "error", {}, () => [createTextVNode(toDisplayString(__props.errorText || unref(t)("errorText")), 1)], void 0, 3) : createCommentVNode("v-if", true)], 2);
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
});
|
|
@@ -76,7 +76,7 @@ var loading_default = /*@__PURE__*/ defineComponent({
|
|
|
76
76
|
return openBlock(), createElementBlock("div", { class: normalizeClass(loadingClass.value) }, [createElementVNode("div", {
|
|
77
77
|
class: normalizeClass(iconClass.value),
|
|
78
78
|
style: normalizeStyle(iconStyle.value)
|
|
79
|
-
}, [__props.type === "circular" ? renderSlot(_ctx.$slots, "circular", {
|
|
79
|
+
}, [__props.type === "circular" ? renderSlot(_ctx.$slots, "circular", {}, () => [createElementVNode("div", { class: normalizeClass(unref(bem).e("spinner")) }, null, 2)], void 0, 0) : __props.type === "clock" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, renderList(8, (i) => {
|
|
80
80
|
return createElementVNode("div", {
|
|
81
81
|
key: i,
|
|
82
82
|
class: normalizeClass([
|
|
@@ -65,7 +65,7 @@ var motion_default = /*@__PURE__*/ defineComponent({
|
|
|
65
65
|
onVisibleHook("leave-cancelled", el);
|
|
66
66
|
};
|
|
67
67
|
return (_ctx, _cache) => {
|
|
68
|
-
return __props.disalbed ? renderSlot(_ctx.$slots, "default", {
|
|
68
|
+
return __props.disalbed ? renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 0) : (openBlock(), createBlock(Transition, {
|
|
69
69
|
key: 1,
|
|
70
70
|
type: __props.type,
|
|
71
71
|
name: mergedName.value,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { createBem } from "../../utils/bem.js";
|
|
2
2
|
import { defaultOverlayProps } from "./common.js";
|
|
3
3
|
import motion_default from "../motion/motion.vue.js";
|
|
4
|
-
import { computed, createBlock, createElementVNode, defineComponent, mergeDefaults,
|
|
4
|
+
import { computed, createBlock, createElementVNode, defineComponent, mergeDefaults, mergeProps, openBlock, renderSlot, vShow, withCtx, withDirectives, withModifiers } from "vue";
|
|
5
5
|
//#region packages/sard/components/overlay/overlay.vue
|
|
6
6
|
var overlay_default = /*@__PURE__*/ defineComponent({
|
|
7
|
+
inheritAttrs: false,
|
|
7
8
|
__name: "overlay",
|
|
8
9
|
props: /*@__PURE__*/ mergeDefaults({
|
|
9
10
|
visible: {
|
|
@@ -42,12 +43,12 @@ var overlay_default = /*@__PURE__*/ defineComponent({
|
|
|
42
43
|
});
|
|
43
44
|
return (_ctx, _cache) => {
|
|
44
45
|
return openBlock(), createBlock(motion_default, { name: "fade" }, {
|
|
45
|
-
default: withCtx(() => [withDirectives(createElementVNode("div", {
|
|
46
|
-
class:
|
|
47
|
-
style:
|
|
46
|
+
default: withCtx(() => [withDirectives(createElementVNode("div", mergeProps(_ctx.$attrs, {
|
|
47
|
+
class: overlayClass.value,
|
|
48
|
+
style: overlayStyle.value,
|
|
48
49
|
onClick,
|
|
49
50
|
onTouchmove: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop", "prevent"]))
|
|
50
|
-
}, [renderSlot(_ctx.$slots, "default")],
|
|
51
|
+
}), [renderSlot(_ctx.$slots, "default")], 16), [[vShow, __props.visible]])]),
|
|
51
52
|
_: 3
|
|
52
53
|
});
|
|
53
54
|
};
|
|
@@ -3,8 +3,8 @@ import { nestedToMulti } from "../../utils/object.js";
|
|
|
3
3
|
import { arrayEqual, toArray } from "../../utils/array.js";
|
|
4
4
|
import { useOptionKeys } from "../../use/useOptionKeys.js";
|
|
5
5
|
import { defaultPickerProps, getCascaderValidIndexes, getColumnsType, getIndexesByValue, getMaySingleValueByOptions, getOptionsByIndexes } from "./common.js";
|
|
6
|
-
import picker_view_default from "../picker-view/picker-view.js";
|
|
7
|
-
import picker_view_column_default from "../picker-view/picker-view-column.js";
|
|
6
|
+
import picker_view_default from "../picker-view/picker-view.vue.js";
|
|
7
|
+
import picker_view_column_default from "../picker-view/picker-view-column.vue.js";
|
|
8
8
|
import { Fragment, computed, createBlock, createElementBlock, createTextVNode, createVNode, defineComponent, mergeDefaults, normalizeClass, openBlock, ref, renderList, renderSlot, toDisplayString, unref, useSlots, watch, withCtx } from "vue";
|
|
9
9
|
//#region packages/sard/components/picker/picker.vue
|
|
10
10
|
var picker_default = /*@__PURE__*/ defineComponent({
|
|
@@ -82,14 +82,17 @@ var picker_default = /*@__PURE__*/ defineComponent({
|
|
|
82
82
|
const pickerViewClass = bem.e("picker-view");
|
|
83
83
|
const indicatorClass = bem.e("indicator");
|
|
84
84
|
return (_ctx, _cache) => {
|
|
85
|
-
return openBlock(), createElementBlock("div", { class: normalizeClass(unref(pickerClass)) }, [createVNode(
|
|
85
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(unref(pickerClass)) }, [createVNode(picker_view_default, {
|
|
86
86
|
class: normalizeClass(unref(pickerViewClass)),
|
|
87
87
|
"indicator-class": unref(indicatorClass),
|
|
88
88
|
value: columnIndexes.value,
|
|
89
89
|
onChange
|
|
90
90
|
}, {
|
|
91
91
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(renderedColumns.value, (column, i) => {
|
|
92
|
-
return openBlock(), createBlock(
|
|
92
|
+
return openBlock(), createBlock(picker_view_column_default, {
|
|
93
|
+
key: i,
|
|
94
|
+
"item-count": column.length
|
|
95
|
+
}, {
|
|
93
96
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(column, (option, j) => {
|
|
94
97
|
return openBlock(), createElementBlock("div", {
|
|
95
98
|
key: j,
|
|
@@ -101,7 +104,7 @@ var picker_default = /*@__PURE__*/ defineComponent({
|
|
|
101
104
|
}, () => [createTextVNode(toDisplayString(unref(optionKeys).getLabel(option)), 1)])], 2);
|
|
102
105
|
}), 128))]),
|
|
103
106
|
_: 2
|
|
104
|
-
},
|
|
107
|
+
}, 1032, ["item-count"]);
|
|
105
108
|
}), 128))]),
|
|
106
109
|
_: 3
|
|
107
110
|
}, 8, [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type PickerSlots, type PickerProps } from '../picker/common';
|
|
2
2
|
import { type DefaultProps } from '../config';
|
|
3
3
|
import { type FormPopoutProps } from '../popout/useFormPopout';
|
|
4
|
-
import type { MotionEmits } from '../motion';
|
|
4
|
+
import type { MotionEmits } from '../motion/common';
|
|
5
5
|
export interface PickerPopoutProps<T> extends FormPopoutProps, PickerProps<T> {
|
|
6
6
|
}
|
|
7
7
|
export declare const defaultPickerPopoutProps: DefaultProps<PickerPopoutProps<any>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ClassValue,
|
|
1
|
+
import type { ClassValue, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, StyleValue, WritableComputedRef } from 'vue';
|
|
2
2
|
import { type DefaultProps } from '../config';
|
|
3
3
|
export declare const pickerViewProps: {
|
|
4
4
|
value: {
|
|
@@ -32,6 +32,12 @@ export interface PickerViewEmits {
|
|
|
32
32
|
export interface PickerViewExpose {
|
|
33
33
|
}
|
|
34
34
|
export interface PickerViewColumnProps {
|
|
35
|
+
/**
|
|
36
|
+
* 选项数量。**推荐由知道数据的那一层传入**(如 Picker 会传 `column.length`):不传时
|
|
37
|
+
* 回落到观察 DOM 子节点数,而整列重建时 DOM 会有中间态(少到 1 个),会被按列数夹取
|
|
38
|
+
* 的逻辑误判成 0,导致整列跳回第一行。
|
|
39
|
+
*/
|
|
40
|
+
itemCount?: number;
|
|
35
41
|
}
|
|
36
42
|
export declare const defaultPickerViewColumnProps: DefaultProps<PickerViewColumnProps>;
|
|
37
43
|
export interface PickerViewColumnSlots {
|
|
@@ -41,11 +47,25 @@ export interface PickerViewColumnEmits {
|
|
|
41
47
|
}
|
|
42
48
|
export interface PickerViewColumnExpose {
|
|
43
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* 列的身份句柄:由 `PickerViewColumn` 在 setup 里自建一个普通对象,交给 PickerView
|
|
52
|
+
* 按登记顺序定位「当前位于第几列」。
|
|
53
|
+
*
|
|
54
|
+
* ⚠️ 不要用组件实例(`getCurrentInstance()`)代替它:vapor 渲染子组件期间,它返回的是
|
|
55
|
+
* **发起本次渲染的组件**(实测三列 PickerViewColumn 都拿到页面组件的实例),据此定位会
|
|
56
|
+
* 把所有列都算成第 0 列,导致所有列共用同一个 `innerValue[0]`:滚动第一列后取值/写值
|
|
57
|
+
* 互相串列,级联 Picker 会因此把值夹取到 0(回到第一行)。
|
|
58
|
+
*/
|
|
59
|
+
export interface PickerViewColumnHandle {
|
|
60
|
+
readonly __pickerViewColumn: true;
|
|
61
|
+
}
|
|
44
62
|
export interface PickerViewContext {
|
|
45
63
|
maskStyle: any;
|
|
46
64
|
maskClass: any;
|
|
47
65
|
indicatorClass: any;
|
|
48
66
|
indicatorStyle: any;
|
|
49
|
-
|
|
67
|
+
registerColumn: (handle: PickerViewColumnHandle) => void;
|
|
68
|
+
unregisterColumn: (handle: PickerViewColumnHandle) => void;
|
|
69
|
+
getColumnValue: (handle: PickerViewColumnHandle) => WritableComputedRef<number>;
|
|
50
70
|
}
|
|
51
71
|
export declare const pickerViewContextKey: InjectionKey<PickerViewContext>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type EnhancedComponent } from '../../utils';
|
|
2
|
-
import _PickerView from './picker-view';
|
|
3
|
-
import _PickerViewColumn from './picker-view-column';
|
|
2
|
+
import _PickerView from './picker-view.vue';
|
|
3
|
+
import _PickerViewColumn from './picker-view-column.vue';
|
|
4
4
|
export declare const PickerView: EnhancedComponent<typeof _PickerView>;
|
|
5
5
|
export declare const PickerViewColumn: EnhancedComponent<typeof _PickerViewColumn>;
|
|
6
6
|
export default PickerView;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { enhanceComponent } from "../../utils/component.js";
|
|
2
|
-
import picker_view_default from "./picker-view.js";
|
|
3
|
-
import picker_view_column_default from "./picker-view-column.js";
|
|
2
|
+
import picker_view_default from "./picker-view.vue.js";
|
|
3
|
+
import picker_view_column_default from "./picker-view-column.vue.js";
|
|
4
4
|
//#region packages/sard/components/picker-view/index.ts
|
|
5
5
|
const PickerView = enhanceComponent(picker_view_default);
|
|
6
6
|
const PickerViewColumn = enhanceComponent(picker_view_column_default);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type PickerViewColumnSlots } from './common';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/**
|
|
4
|
+
* 选项数量。**推荐由知道数据的那一层传入**(如 Picker 会传 `column.length`):
|
|
5
|
+
* 不传时回落到观察 DOM 子节点数,但整列重建时 DOM 会有中间态(少到 1 个),
|
|
6
|
+
* 会被下文的「按列数夹取」误判成 0,导致整列跳回第一行。
|
|
7
|
+
*/
|
|
8
|
+
itemCount?: number;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_Slots = PickerViewColumnSlots;
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|