yc-design-vue 1.1.9 → 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/es/Badge/index.vue.js +1 -1
- package/es/Button/Button.vue.d.ts +1 -0
- package/es/Button/Button.vue.js +1 -1
- package/es/Button/Button.vue2.js +7 -4
- package/es/Button/index.d.ts +3 -0
- package/es/Button/type.d.ts +1 -0
- package/es/Divider/index.d.ts +3 -3
- package/es/Divider/index.vue.d.ts +1 -1
- package/es/Divider/index.vue.js +1 -1
- package/es/Divider/type.d.ts +1 -1
- package/es/Slider/hooks/useContext.js +10 -9
- package/es/Space/index.d.ts +3 -3
- package/es/Space/index.vue.d.ts +1 -1
- package/es/Space/index.vue.js +1 -1
- package/es/Space/index.vue2.js +8 -2
- package/es/Space/type.d.ts +2 -1
- package/es/style.css +1 -1
- package/lib/Badge/index.vue.js +1 -1
- package/lib/Button/Button.vue.d.ts +1 -0
- package/lib/Button/Button.vue.js +1 -1
- package/lib/Button/Button.vue2.js +1 -1
- package/lib/Button/index.d.ts +3 -0
- package/lib/Button/type.d.ts +1 -0
- package/lib/Divider/index.d.ts +3 -3
- package/lib/Divider/index.vue.d.ts +1 -1
- package/lib/Divider/index.vue.js +1 -1
- package/lib/Divider/type.d.ts +1 -1
- package/lib/Slider/hooks/useContext.js +1 -1
- package/lib/Space/index.d.ts +3 -3
- package/lib/Space/index.vue.d.ts +1 -1
- package/lib/Space/index.vue.js +1 -1
- package/lib/Space/index.vue2.js +1 -1
- package/lib/Space/type.d.ts +2 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/es/Badge/index.vue.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import _sfc_main from "./index.vue2.js";
|
2
2
|
/* empty css */
|
3
3
|
import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
|
4
|
-
const _Badge = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
4
|
+
const _Badge = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-03650e28"]]);
|
5
5
|
export {
|
6
6
|
_Badge as default
|
7
7
|
};
|
@@ -28,6 +28,7 @@ declare const __VLS_component: import('vue').DefineComponent<ButtonProps, {}, {}
|
|
28
28
|
status: import('./type').ButtonStatus;
|
29
29
|
long: boolean;
|
30
30
|
htmlType: import('./type').ButtonHtmlType;
|
31
|
+
autofocus: boolean;
|
31
32
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
32
33
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
33
34
|
export default _default;
|
package/es/Button/Button.vue.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import _sfc_main from "./Button.vue2.js";
|
2
2
|
/* empty css */
|
3
3
|
import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
|
4
|
-
const _Button = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
4
|
+
const _Button = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1536384b"]]);
|
5
5
|
export {
|
6
6
|
_Button as default
|
7
7
|
};
|
package/es/Button/Button.vue2.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
import { defineComponent, useSlots, toRefs, computed, createElementBlock, openBlock, mergeProps, createCommentVNode, renderSlot, unref, createBlock } from "vue";
|
2
2
|
import useContext from "./hooks/useContext.js";
|
3
3
|
import Spin from "../Spin/index.js";
|
4
|
-
const _hoisted_1 = ["href"];
|
4
|
+
const _hoisted_1 = ["href", "autofocus"];
|
5
5
|
const _hoisted_2 = {
|
6
6
|
key: 0,
|
7
7
|
class: "yc-button-icon"
|
8
8
|
};
|
9
|
-
const _hoisted_3 = ["type", "disabled"];
|
9
|
+
const _hoisted_3 = ["type", "disabled", "autofocus"];
|
10
10
|
const _hoisted_4 = {
|
11
11
|
key: 0,
|
12
12
|
class: "yc-button-icon"
|
@@ -25,6 +25,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
25
25
|
loading: { type: Boolean, default: false },
|
26
26
|
disabled: { type: Boolean, default: void 0 },
|
27
27
|
htmlType: { default: "button" },
|
28
|
+
autofocus: { type: Boolean, default: false },
|
28
29
|
href: { default: "" }
|
29
30
|
},
|
30
31
|
emits: ["mousedown", "mouseup", "click", "dblclick", "contextmenu"],
|
@@ -64,7 +65,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
64
65
|
return _ctx.href ? (openBlock(), createElementBlock("a", mergeProps({
|
65
66
|
key: 0,
|
66
67
|
href: _ctx.href,
|
67
|
-
class: className.value
|
68
|
+
class: className.value,
|
69
|
+
autofocus: _ctx.autofocus
|
68
70
|
}, _ctx.$attrs, {
|
69
71
|
onMousedown: _cache[0] || (_cache[0] = ($event) => handleEvent("mousedown", $event)),
|
70
72
|
onMouseup: _cache[1] || (_cache[1] = ($event) => handleEvent("mouseup", $event)),
|
@@ -83,7 +85,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
83
85
|
key: 1,
|
84
86
|
type: _ctx.htmlType,
|
85
87
|
disabled: unref(disabled),
|
86
|
-
class: className.value
|
88
|
+
class: className.value,
|
89
|
+
autofocus: _ctx.autofocus
|
87
90
|
}, _ctx.$attrs, {
|
88
91
|
onMousedown: _cache[5] || (_cache[5] = ($event) => handleEvent("mousedown", $event)),
|
89
92
|
onMouseup: _cache[6] || (_cache[6] = ($event) => handleEvent("mouseup", $event)),
|
package/es/Button/index.d.ts
CHANGED
@@ -27,6 +27,7 @@ declare const Button: {
|
|
27
27
|
status: import('./type').ButtonStatus;
|
28
28
|
long: boolean;
|
29
29
|
htmlType: import('./type').ButtonHtmlType;
|
30
|
+
autofocus: boolean;
|
30
31
|
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
31
32
|
P: {};
|
32
33
|
B: {};
|
@@ -50,6 +51,7 @@ declare const Button: {
|
|
50
51
|
status: import('./type').ButtonStatus;
|
51
52
|
long: boolean;
|
52
53
|
htmlType: import('./type').ButtonHtmlType;
|
54
|
+
autofocus: boolean;
|
53
55
|
}>;
|
54
56
|
__isFragment?: never;
|
55
57
|
__isTeleport?: never;
|
@@ -76,6 +78,7 @@ declare const Button: {
|
|
76
78
|
status: import('./type').ButtonStatus;
|
77
79
|
long: boolean;
|
78
80
|
htmlType: import('./type').ButtonHtmlType;
|
81
|
+
autofocus: boolean;
|
79
82
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
80
83
|
$slots: Readonly<import('./type').ButtonSlots> & import('./type').ButtonSlots;
|
81
84
|
}) & {
|
package/es/Button/type.d.ts
CHANGED
package/es/Divider/index.d.ts
CHANGED
@@ -7,7 +7,7 @@ declare const Divider: {
|
|
7
7
|
size: number;
|
8
8
|
type: import('./type').DividerType;
|
9
9
|
direction: import('..').Direction;
|
10
|
-
margin: number;
|
10
|
+
margin: number | string;
|
11
11
|
orientation: import('./type').Orientation;
|
12
12
|
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
13
13
|
P: {};
|
@@ -20,7 +20,7 @@ declare const Divider: {
|
|
20
20
|
size: number;
|
21
21
|
type: import('./type').DividerType;
|
22
22
|
direction: import('..').Direction;
|
23
|
-
margin: number;
|
23
|
+
margin: number | string;
|
24
24
|
orientation: import('./type').Orientation;
|
25
25
|
}>;
|
26
26
|
__isFragment?: never;
|
@@ -30,7 +30,7 @@ declare const Divider: {
|
|
30
30
|
size: number;
|
31
31
|
type: import('./type').DividerType;
|
32
32
|
direction: import('..').Direction;
|
33
|
-
margin: number;
|
33
|
+
margin: number | string;
|
34
34
|
orientation: import('./type').Orientation;
|
35
35
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
36
36
|
$slots: Readonly<import('./type').DividerSlots> & import('./type').DividerSlots;
|
@@ -10,7 +10,7 @@ declare const __VLS_component: import('vue').DefineComponent<DividerProps, {}, {
|
|
10
10
|
size: number;
|
11
11
|
type: import('./type').DividerType;
|
12
12
|
direction: import('..').Direction;
|
13
|
-
margin: number;
|
13
|
+
margin: number | string;
|
14
14
|
orientation: import('./type').Orientation;
|
15
15
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
16
16
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
package/es/Divider/index.vue.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import _sfc_main from "./index.vue2.js";
|
2
2
|
/* empty css */
|
3
3
|
import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
|
4
|
-
const _Divider = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
4
|
+
const _Divider = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5d3da063"]]);
|
5
5
|
export {
|
6
6
|
_Divider as default
|
7
7
|
};
|
package/es/Divider/type.d.ts
CHANGED
@@ -84,17 +84,18 @@ const useContext = () => {
|
|
84
84
|
return decimalIndex === -1 ? 0 : str.length - decimalIndex - 1;
|
85
85
|
}
|
86
86
|
function normalizeValue(value) {
|
87
|
-
|
88
|
-
const
|
89
|
-
|
90
|
-
return Math.round(normalized);
|
87
|
+
if (max.value - min.value === 0) return 0;
|
88
|
+
const normalized = (value - min.value) / (max.value - min.value) * 100;
|
89
|
+
return normalized;
|
91
90
|
}
|
92
|
-
function denormalizeValue(
|
93
|
-
const
|
94
|
-
const
|
95
|
-
const
|
91
|
+
function denormalizeValue(percent) {
|
92
|
+
const estimatedValue = min.value + percent / 100 * (max.value - min.value);
|
93
|
+
const steps = (estimatedValue - min.value) / step.value;
|
94
|
+
const closestStep = Math.round(steps);
|
95
|
+
const finalValue = min.value + closestStep * step.value;
|
96
96
|
const digit = getDecimalPlaces(step.value);
|
97
|
-
|
97
|
+
const clampedValue = Math.max(min.value, Math.min(finalValue, max.value));
|
98
|
+
return +clampedValue.toFixed(digit);
|
98
99
|
}
|
99
100
|
provide(SLIDER_CONTEXT_KEY, {
|
100
101
|
startValue,
|
package/es/Space/index.d.ts
CHANGED
@@ -4,7 +4,7 @@ export type SpaceInstance = InstanceType<typeof _Space>;
|
|
4
4
|
export * from './type';
|
5
5
|
declare const Space: {
|
6
6
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./type').SpaceProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
7
|
-
size: import('
|
7
|
+
size: import('./type').SpaceSize | [import('./type').SpaceSize, import('./type').SpaceSize];
|
8
8
|
fill: boolean;
|
9
9
|
wrap: boolean;
|
10
10
|
direction: import('..').Direction;
|
@@ -17,7 +17,7 @@ declare const Space: {
|
|
17
17
|
M: {};
|
18
18
|
Defaults: {};
|
19
19
|
}, Readonly<import('./type').SpaceProps> & Readonly<{}>, {}, {}, {}, {}, {
|
20
|
-
size: import('
|
20
|
+
size: import('./type').SpaceSize | [import('./type').SpaceSize, import('./type').SpaceSize];
|
21
21
|
fill: boolean;
|
22
22
|
wrap: boolean;
|
23
23
|
direction: import('..').Direction;
|
@@ -27,7 +27,7 @@ declare const Space: {
|
|
27
27
|
__isTeleport?: never;
|
28
28
|
__isSuspense?: never;
|
29
29
|
} & import('vue').ComponentOptionsBase<Readonly<import('./type').SpaceProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
30
|
-
size: import('
|
30
|
+
size: import('./type').SpaceSize | [import('./type').SpaceSize, import('./type').SpaceSize];
|
31
31
|
fill: boolean;
|
32
32
|
wrap: boolean;
|
33
33
|
direction: import('..').Direction;
|
package/es/Space/index.vue.d.ts
CHANGED
@@ -7,7 +7,7 @@ declare function __VLS_template(): {
|
|
7
7
|
};
|
8
8
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
9
9
|
declare const __VLS_component: import('vue').DefineComponent<SpaceProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SpaceProps> & Readonly<{}>, {
|
10
|
-
size: import('
|
10
|
+
size: import('./type').SpaceSize | [import('./type').SpaceSize, import('./type').SpaceSize];
|
11
11
|
fill: boolean;
|
12
12
|
wrap: boolean;
|
13
13
|
direction: import('..').Direction;
|
package/es/Space/index.vue.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import _sfc_main from "./index.vue2.js";
|
2
2
|
/* empty css */
|
3
3
|
import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
|
4
|
-
const _Space = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
4
|
+
const _Space = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4f9e1543"]]);
|
5
5
|
export {
|
6
6
|
_Space as default
|
7
7
|
};
|
package/es/Space/index.vue2.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { defineComponent, useSlots, toRefs, computed, Fragment, Comment, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, renderSlot, createCommentVNode, renderList, createElementVNode, createBlock, resolveDynamicComponent } from "vue";
|
2
2
|
import "../node_modules/tinycolor2/esm/tinycolor.js";
|
3
3
|
import { valueToPx } from "../_shared/utils/dom.js";
|
4
|
-
import { isNumber, isUndefined } from "../_shared/utils/is.js";
|
4
|
+
import { isNumber, isArray, isUndefined } from "../_shared/utils/is.js";
|
5
5
|
import "../_shared/utils/time.js";
|
6
6
|
import { getSlotFunction } from "../_shared/utils/vue-utils.js";
|
7
7
|
import "../Empty/index.js";
|
@@ -34,7 +34,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
34
34
|
medium: 16,
|
35
35
|
large: 24
|
36
36
|
};
|
37
|
-
|
37
|
+
if (isNumber(size.value)) {
|
38
|
+
return valueToPx(size.value);
|
39
|
+
} else if (isArray(size.value)) {
|
40
|
+
return size.value.map((v) => valueToPx(v)).join(" ");
|
41
|
+
} else {
|
42
|
+
return valueToPx(map[size.value]);
|
43
|
+
}
|
38
44
|
});
|
39
45
|
const align = computed(() => {
|
40
46
|
if (!isUndefined(_align.value)) {
|
package/es/Space/type.d.ts
CHANGED
@@ -5,10 +5,11 @@ export interface SpaceProps {
|
|
5
5
|
direction?: Direction;
|
6
6
|
wrap?: boolean;
|
7
7
|
fill?: boolean;
|
8
|
-
size?:
|
8
|
+
size?: SpaceSize | [SpaceSize, SpaceSize];
|
9
9
|
}
|
10
10
|
export interface SpaceSlots {
|
11
11
|
default?: () => VNode[];
|
12
12
|
split?: () => VNode[];
|
13
13
|
}
|
14
14
|
export type SpaceAlign = 'start' | 'end' | 'center' | 'baseline';
|
15
|
+
export type SpaceSize = Size | number;
|