@mooncellwiki/prts-design-vue 0.1.24 → 0.1.26
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/dist/components/Field/context.d.ts +4 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -34,13 +34,16 @@ export declare function useField(kind?: "control" | "group"): {
|
|
|
34
34
|
required: import("vue").ComputedRef<boolean>;
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
|
-
* 外面包了一层 <label> / <div>
|
|
37
|
+
* 外面包了一层 <label> / <div> 的控件(勾选、单选、开关、步进器、搜索框):class / style 给外层,其余属性(name、autocomplete、@focus …)给原生控件。
|
|
38
|
+
* data-ak-tip 也给外层:气泡是载体的 ::after,原生 <input> 上画不出来;挂在外层,悬停名称文字也出提示,聚焦里面的控件时由 :has(:focus-visible) 显示。
|
|
39
|
+
* 这样不用为了提示再包一层 <span>——行内的 span 里控件按基线排,在 align-items: center 的一行里会比旁边没包的同类高几像素。
|
|
38
40
|
* 配合 defineOptions({ inheritAttrs: false })。
|
|
39
41
|
*/
|
|
40
42
|
export declare function useSplitAttrs(): {
|
|
41
43
|
root: import("vue").ComputedRef<{
|
|
42
44
|
class: import("vue").ClassValue;
|
|
43
45
|
style: import("vue").StyleValue;
|
|
46
|
+
"data-ak-tip": unknown;
|
|
44
47
|
}>;
|
|
45
48
|
control: import("vue").ComputedRef<{
|
|
46
49
|
[x: string]: unknown;
|
package/dist/index.js
CHANGED
|
@@ -2847,7 +2847,9 @@ function useField(kind = "control") {
|
|
|
2847
2847
|
};
|
|
2848
2848
|
}
|
|
2849
2849
|
/**
|
|
2850
|
-
* 外面包了一层 <label> / <div>
|
|
2850
|
+
* 外面包了一层 <label> / <div> 的控件(勾选、单选、开关、步进器、搜索框):class / style 给外层,其余属性(name、autocomplete、@focus …)给原生控件。
|
|
2851
|
+
* data-ak-tip 也给外层:气泡是载体的 ::after,原生 <input> 上画不出来;挂在外层,悬停名称文字也出提示,聚焦里面的控件时由 :has(:focus-visible) 显示。
|
|
2852
|
+
* 这样不用为了提示再包一层 <span>——行内的 span 里控件按基线排,在 align-items: center 的一行里会比旁边没包的同类高几像素。
|
|
2851
2853
|
* 配合 defineOptions({ inheritAttrs: false })。
|
|
2852
2854
|
*/
|
|
2853
2855
|
function useSplitAttrs() {
|
|
@@ -2855,10 +2857,11 @@ function useSplitAttrs() {
|
|
|
2855
2857
|
return {
|
|
2856
2858
|
root: computed(() => ({
|
|
2857
2859
|
class: attrs.class,
|
|
2858
|
-
style: attrs.style
|
|
2860
|
+
style: attrs.style,
|
|
2861
|
+
"data-ak-tip": attrs["data-ak-tip"]
|
|
2859
2862
|
})),
|
|
2860
2863
|
control: computed(() => {
|
|
2861
|
-
const { class: _c, style: _s, ...rest } = attrs;
|
|
2864
|
+
const { class: _c, style: _s, "data-ak-tip": _t, ...rest } = attrs;
|
|
2862
2865
|
return rest;
|
|
2863
2866
|
})
|
|
2864
2867
|
};
|