yc-design-vue 1.1.8 → 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.
Files changed (45) hide show
  1. package/es/Button/Button.vue.d.ts +1 -0
  2. package/es/Button/Button.vue.js +1 -1
  3. package/es/Button/Button.vue2.js +7 -4
  4. package/es/Button/index.d.ts +3 -0
  5. package/es/Button/type.d.ts +1 -0
  6. package/es/Divider/index.d.ts +3 -3
  7. package/es/Divider/index.vue.d.ts +1 -1
  8. package/es/Divider/index.vue.js +1 -1
  9. package/es/Divider/type.d.ts +1 -1
  10. package/es/Space/index.d.ts +3 -3
  11. package/es/Space/index.vue.d.ts +1 -1
  12. package/es/Space/index.vue.js +1 -1
  13. package/es/Space/index.vue2.js +8 -2
  14. package/es/Space/type.d.ts +2 -1
  15. package/es/Typography/TypographyBase.vue2.js +2 -2
  16. package/es/_shared/icons/IconCopy.vue.js +16 -1
  17. package/es/_shared/icons/IconCopy.vue2.js +1 -16
  18. package/es/_shared/icons/IconEdit.vue.js +16 -1
  19. package/es/_shared/icons/IconEdit.vue2.js +1 -16
  20. package/es/_shared/utils/dom.d.ts +1 -1
  21. package/es/_shared/utils/dom.js +4 -3
  22. package/es/style.css +1 -1
  23. package/lib/Button/Button.vue.d.ts +1 -0
  24. package/lib/Button/Button.vue.js +1 -1
  25. package/lib/Button/Button.vue2.js +1 -1
  26. package/lib/Button/index.d.ts +3 -0
  27. package/lib/Button/type.d.ts +1 -0
  28. package/lib/Divider/index.d.ts +3 -3
  29. package/lib/Divider/index.vue.d.ts +1 -1
  30. package/lib/Divider/index.vue.js +1 -1
  31. package/lib/Divider/type.d.ts +1 -1
  32. package/lib/Space/index.d.ts +3 -3
  33. package/lib/Space/index.vue.d.ts +1 -1
  34. package/lib/Space/index.vue.js +1 -1
  35. package/lib/Space/index.vue2.js +1 -1
  36. package/lib/Space/type.d.ts +2 -1
  37. package/lib/Typography/TypographyBase.vue2.js +1 -1
  38. package/lib/_shared/icons/IconCopy.vue.js +1 -1
  39. package/lib/_shared/icons/IconCopy.vue2.js +1 -1
  40. package/lib/_shared/icons/IconEdit.vue.js +1 -1
  41. package/lib/_shared/icons/IconEdit.vue2.js +1 -1
  42. package/lib/_shared/utils/dom.d.ts +1 -1
  43. package/lib/_shared/utils/dom.js +1 -1
  44. package/lib/style.css +1 -1
  45. package/package.json +1 -1
@@ -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;
@@ -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-2327bc3e"]]);
4
+ const _Button = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1536384b"]]);
5
5
  export {
6
6
  _Button as default
7
7
  };
@@ -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)),
@@ -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
  }) & {
@@ -9,6 +9,7 @@ export interface ButtonProps {
9
9
  loading?: boolean;
10
10
  disabled?: boolean;
11
11
  htmlType?: ButtonHtmlType;
12
+ autofocus?: boolean;
12
13
  href?: string;
13
14
  }
14
15
  export interface ButtonEmits {
@@ -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"]>;
@@ -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-a009a00c"]]);
4
+ const _Divider = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5d3da063"]]);
5
5
  export {
6
6
  _Divider as default
7
7
  };
@@ -5,7 +5,7 @@ export interface DividerProps {
5
5
  orientation?: Orientation;
6
6
  type?: DividerType;
7
7
  size?: number;
8
- margin?: number;
8
+ margin?: number | string;
9
9
  }
10
10
  export interface DividerSlots {
11
11
  default?: () => VNode[];
@@ -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('..').Size | number;
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('..').Size | number;
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('..').Size | number;
30
+ size: import('./type').SpaceSize | [import('./type').SpaceSize, import('./type').SpaceSize];
31
31
  fill: boolean;
32
32
  wrap: boolean;
33
33
  direction: import('..').Direction;
@@ -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('..').Size | number;
10
+ size: import('./type').SpaceSize | [import('./type').SpaceSize, import('./type').SpaceSize];
11
11
  fill: boolean;
12
12
  wrap: boolean;
13
13
  direction: import('..').Direction;
@@ -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-7a9a36b0"]]);
4
+ const _Space = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4f9e1543"]]);
5
5
  export {
6
6
  _Space as default
7
7
  };
@@ -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
- return valueToPx(isNumber(size.value) ? size.value : map[size.value]);
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)) {
@@ -5,10 +5,11 @@ export interface SpaceProps {
5
5
  direction?: Direction;
6
6
  wrap?: boolean;
7
7
  fill?: boolean;
8
- size?: Size | number;
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;
@@ -5,8 +5,8 @@ import { getDomText, sleep } from "../_shared/utils/dom.js";
5
5
  import "../_shared/utils/time.js";
6
6
  import "../Empty/index.js";
7
7
  /* empty css */
8
- import _sfc_main$3 from "../_shared/icons/IconCopy.vue2.js";
9
- import _sfc_main$1 from "../_shared/icons/IconEdit.vue2.js";
8
+ import _sfc_main$3 from "../_shared/icons/IconCopy.vue.js";
9
+ import _sfc_main$1 from "../_shared/icons/IconEdit.vue.js";
10
10
  import _sfc_main$2 from "../_shared/icons/IconInfo.vue.js";
11
11
  import useControlValue from "../_shared/utils/control.js";
12
12
  import Input from "../Input/index.js";
@@ -1,4 +1,19 @@
1
- import _sfc_main from "./IconCopy.vue2.js";
1
+ import { defineComponent, createBlock, openBlock, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
2
+ import YcIcon from "../components/Icon.vue2.js";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ __name: "IconCopy",
5
+ setup(__props) {
6
+ return (_ctx, _cache) => {
7
+ return openBlock(), createBlock(YcIcon, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
8
+ default: withCtx(() => _cache[0] || (_cache[0] = [
9
+ createElementVNode("path", { d: "M20 6h18a2 2 0 0 1 2 2v22M8 16v24c0 1.105.891 2 1.996 2h20.007A1.99 1.99 0 0 0 32 40.008V15.997A1.997 1.997 0 0 0 30 14H10a2 2 0 0 0-2 2Z" }, null, -1)
10
+ ])),
11
+ _: 1,
12
+ __: [0]
13
+ }, 16);
14
+ };
15
+ }
16
+ });
2
17
  export {
3
18
  _sfc_main as default
4
19
  };
@@ -1,19 +1,4 @@
1
- import { defineComponent, createBlock, openBlock, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
2
- import YcIcon from "../components/Icon.vue2.js";
3
- const _sfc_main = /* @__PURE__ */ defineComponent({
4
- __name: "IconCopy",
5
- setup(__props) {
6
- return (_ctx, _cache) => {
7
- return openBlock(), createBlock(YcIcon, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
8
- default: withCtx(() => _cache[0] || (_cache[0] = [
9
- createElementVNode("path", { d: "M20 6h18a2 2 0 0 1 2 2v22M8 16v24c0 1.105.891 2 1.996 2h20.007A1.99 1.99 0 0 0 32 40.008V15.997A1.997 1.997 0 0 0 30 14H10a2 2 0 0 0-2 2Z" }, null, -1)
10
- ])),
11
- _: 1,
12
- __: [0]
13
- }, 16);
14
- };
15
- }
16
- });
1
+ import _sfc_main from "./IconCopy.vue.js";
17
2
  export {
18
3
  _sfc_main as default
19
4
  };
@@ -1,4 +1,19 @@
1
- import _sfc_main from "./IconEdit.vue2.js";
1
+ import { defineComponent, createBlock, openBlock, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
2
+ import YcIcon from "../components/Icon.vue2.js";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ __name: "IconEdit",
5
+ setup(__props) {
6
+ return (_ctx, _cache) => {
7
+ return openBlock(), createBlock(YcIcon, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
8
+ default: withCtx(() => _cache[0] || (_cache[0] = [
9
+ createElementVNode("path", { d: "m30.48 19.038 5.733-5.734a1 1 0 0 0 0-1.414l-5.586-5.586a1 1 0 0 0-1.414 0l-5.734 5.734m7 7L15.763 33.754a1 1 0 0 1-.59.286l-6.048.708a1 1 0 0 1-1.113-1.069l.477-6.31a1 1 0 0 1 .29-.631l14.7-14.7m7 7-7-7M6 42h36" }, null, -1)
10
+ ])),
11
+ _: 1,
12
+ __: [0]
13
+ }, 16);
14
+ };
15
+ }
16
+ });
2
17
  export {
3
18
  _sfc_main as default
4
19
  };
@@ -1,19 +1,4 @@
1
- import { defineComponent, createBlock, openBlock, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
2
- import YcIcon from "../components/Icon.vue2.js";
3
- const _sfc_main = /* @__PURE__ */ defineComponent({
4
- __name: "IconEdit",
5
- setup(__props) {
6
- return (_ctx, _cache) => {
7
- return openBlock(), createBlock(YcIcon, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
8
- default: withCtx(() => _cache[0] || (_cache[0] = [
9
- createElementVNode("path", { d: "m30.48 19.038 5.733-5.734a1 1 0 0 0 0-1.414l-5.586-5.586a1 1 0 0 0-1.414 0l-5.734 5.734m7 7L15.763 33.754a1 1 0 0 1-.59.286l-6.048.708a1 1 0 0 1-1.113-1.069l.477-6.31a1 1 0 0 1 .29-.631l14.7-14.7m7 7-7-7M6 42h36" }, null, -1)
10
- ])),
11
- _: 1,
12
- __: [0]
13
- }, 16);
14
- };
15
- }
16
- });
1
+ import _sfc_main from "./IconEdit.vue.js";
17
2
  export {
18
3
  _sfc_main as default
19
4
  };
@@ -6,7 +6,7 @@ export declare const getElement: (target: string | HTMLElement | undefined, cont
6
6
  export declare const getDomText: (dom: Ref<HTMLElement | undefined>) => string;
7
7
  export declare const getBreakpointValue: (breakpoint: BreakpointName, value: string | number | ResponsiveValue, defaultValue?: number | string) => number | string | undefined;
8
8
  export declare const mediaQueryHandler: (onBreakpoint: (breakpoint: BreakpointName, order: Record<string, number>, index: number) => void, queries?: Record<string, string>) => void;
9
- export declare const findFirstScrollableParent: (element?: HTMLElement) => HTMLElement | undefined;
9
+ export declare const findFirstScrollableParent: (element?: HTMLElement | null) => HTMLElement | undefined;
10
10
  export declare const sleep: (ms: number) => Promise<unknown>;
11
11
  export declare const throttleByRaf: (cb: (...args: any[]) => void) => {
12
12
  (...args: any[]): void;
@@ -65,11 +65,11 @@ const mediaQueryHandler = (onBreakpoint, queries = MEDICA_QUERY_QUERUES) => {
65
65
  );
66
66
  };
67
67
  const findFirstScrollableParent = (element) => {
68
- if (!element || element === document.body) {
69
- return;
68
+ if (!element) {
69
+ return void 0;
70
70
  }
71
71
  let currentElement = element.parentElement;
72
- while (currentElement && currentElement !== document.body) {
72
+ while (currentElement) {
73
73
  const style = getComputedStyle(currentElement);
74
74
  const overflow = style.overflowY || style.overflow;
75
75
  const isScrollable = ["auto", "scroll"].includes(overflow);
@@ -79,6 +79,7 @@ const findFirstScrollableParent = (element) => {
79
79
  }
80
80
  currentElement = currentElement.parentElement;
81
81
  }
82
+ return void 0;
82
83
  };
83
84
  const sleep = (ms) => {
84
85
  return new Promise((resolve) => {