yc-design-vue 1.4.3 → 1.4.5

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 (99) hide show
  1. package/es/Breadcrumb/BreadcrumbSeparator.vue2.js +1 -1
  2. package/es/Calendar/Calendar.vue.d.ts +1 -1
  3. package/es/Calendar/index.d.ts +3 -3
  4. package/es/Collapse/Collapse.vue.d.ts +1 -1
  5. package/es/Collapse/index.d.ts +3 -3
  6. package/es/ColorPicker/ColorPicker.vue.d.ts +1 -1
  7. package/es/ColorPicker/index.d.ts +3 -3
  8. package/es/Dropdown/Dgroup.vue.js +1 -1
  9. package/es/Dropdown/Dgroup.vue2.js +2 -2
  10. package/es/Dropdown/Doption.vue.js +1 -1
  11. package/es/Dropdown/Doption.vue2.js +3 -1
  12. package/es/Dropdown/Dropdown.vue.d.ts +0 -1
  13. package/es/Dropdown/Dropdown.vue.js +4 -3
  14. package/es/Dropdown/Dsubmenu.vue.js +1 -1
  15. package/es/Dropdown/Dsubmenu.vue2.js +3 -4
  16. package/es/Dropdown/hooks/useContext.d.ts +1 -3
  17. package/es/Dropdown/hooks/useContext.js +1 -4
  18. package/es/Dropdown/index.d.ts +0 -3
  19. package/es/Dropdown/type.d.ts +1 -2
  20. package/es/Layout/LayoutSider.vue.d.ts +2 -2
  21. package/es/Layout/LayoutSider.vue.js +1 -1
  22. package/es/Layout/LayoutSider.vue2.js +4 -5
  23. package/es/Layout/hooks/useSiderContext.d.ts +1 -0
  24. package/es/Layout/hooks/useSiderContext.js +21 -2
  25. package/es/Layout/index.d.ts +6 -6
  26. package/es/Menu/Menu.vue.d.ts +7 -7
  27. package/es/Menu/Menu.vue2.js +2 -2
  28. package/es/Menu/MenuEllipsis.vue.js +1 -1
  29. package/es/Menu/MenuEllipsis.vue2.js +3 -4
  30. package/es/Menu/MenuItem.vue.js +1 -1
  31. package/es/Menu/MenuItem.vue2.js +3 -4
  32. package/es/Menu/MenuItemGroup.vue2.js +2 -2
  33. package/es/Menu/SubMenu.vue2.js +2 -2
  34. package/es/Menu/hooks/useContext.js +2 -2
  35. package/es/Menu/index.d.ts +20 -20
  36. package/es/Transfer/TransferPanel.vue2.js +2 -2
  37. package/es/Typography/TypographyBase.vue2.js +2 -2
  38. package/es/_shared/icons/IconCopy.vue.js +1 -16
  39. package/es/_shared/icons/IconCopy.vue2.js +16 -1
  40. package/es/_shared/icons/IconDelete.vue.js +16 -1
  41. package/es/_shared/icons/IconDelete.vue2.js +1 -16
  42. package/es/_shared/icons/IconEdit.vue.js +1 -16
  43. package/es/_shared/icons/IconEdit.vue2.js +16 -1
  44. package/es/_shared/icons/IconSearch.vue.js +16 -1
  45. package/es/_shared/icons/IconSearch.vue2.js +1 -16
  46. package/es/_shared/icons/IconSeparator.vue.js +1 -16
  47. package/es/_shared/icons/IconSeparator.vue2.js +16 -1
  48. package/es/index.d.ts +6 -6
  49. package/es/node_modules/@vueuse/core/index.js +319 -4
  50. package/es/node_modules/@vueuse/shared/index.js +65 -2
  51. package/es/style.css +1 -1
  52. package/lib/Breadcrumb/BreadcrumbSeparator.vue2.js +1 -1
  53. package/lib/Calendar/Calendar.vue.d.ts +1 -1
  54. package/lib/Calendar/index.d.ts +3 -3
  55. package/lib/Collapse/Collapse.vue.d.ts +1 -1
  56. package/lib/Collapse/index.d.ts +3 -3
  57. package/lib/ColorPicker/ColorPicker.vue.d.ts +1 -1
  58. package/lib/ColorPicker/index.d.ts +3 -3
  59. package/lib/Dropdown/Dgroup.vue.js +1 -1
  60. package/lib/Dropdown/Dgroup.vue2.js +1 -1
  61. package/lib/Dropdown/Doption.vue.js +1 -1
  62. package/lib/Dropdown/Doption.vue2.js +1 -1
  63. package/lib/Dropdown/Dropdown.vue.d.ts +0 -1
  64. package/lib/Dropdown/Dropdown.vue.js +1 -1
  65. package/lib/Dropdown/Dsubmenu.vue.js +1 -1
  66. package/lib/Dropdown/Dsubmenu.vue2.js +1 -1
  67. package/lib/Dropdown/hooks/useContext.d.ts +1 -3
  68. package/lib/Dropdown/hooks/useContext.js +1 -1
  69. package/lib/Dropdown/index.d.ts +0 -3
  70. package/lib/Dropdown/type.d.ts +1 -2
  71. package/lib/Layout/LayoutSider.vue.d.ts +2 -2
  72. package/lib/Layout/LayoutSider.vue.js +1 -1
  73. package/lib/Layout/LayoutSider.vue2.js +1 -1
  74. package/lib/Layout/hooks/useSiderContext.d.ts +1 -0
  75. package/lib/Layout/hooks/useSiderContext.js +1 -1
  76. package/lib/Layout/index.d.ts +6 -6
  77. package/lib/Menu/Menu.vue.d.ts +7 -7
  78. package/lib/Menu/MenuEllipsis.vue.js +1 -1
  79. package/lib/Menu/MenuEllipsis.vue2.js +1 -1
  80. package/lib/Menu/MenuItem.vue.js +1 -1
  81. package/lib/Menu/MenuItem.vue2.js +1 -1
  82. package/lib/Menu/index.d.ts +20 -20
  83. package/lib/Transfer/TransferPanel.vue2.js +1 -1
  84. package/lib/Typography/TypographyBase.vue2.js +1 -1
  85. package/lib/_shared/icons/IconCopy.vue.js +1 -1
  86. package/lib/_shared/icons/IconCopy.vue2.js +1 -1
  87. package/lib/_shared/icons/IconDelete.vue.js +1 -1
  88. package/lib/_shared/icons/IconDelete.vue2.js +1 -1
  89. package/lib/_shared/icons/IconEdit.vue.js +1 -1
  90. package/lib/_shared/icons/IconEdit.vue2.js +1 -1
  91. package/lib/_shared/icons/IconSearch.vue.js +1 -1
  92. package/lib/_shared/icons/IconSearch.vue2.js +1 -1
  93. package/lib/_shared/icons/IconSeparator.vue.js +1 -1
  94. package/lib/_shared/icons/IconSeparator.vue2.js +1 -1
  95. package/lib/index.d.ts +6 -6
  96. package/lib/node_modules/@vueuse/core/index.js +1 -1
  97. package/lib/node_modules/@vueuse/shared/index.js +1 -1
  98. package/lib/style.css +1 -1
  99. package/package.json +1 -1
@@ -5,7 +5,7 @@ import { isUndefined } from "../_shared/utils/is.js";
5
5
  import "../_shared/utils/time.js";
6
6
  import "../Empty/index.js";
7
7
  /* empty css */
8
- import _sfc_main$1 from "../_shared/icons/IconSeparator.vue.js";
8
+ import _sfc_main$1 from "../_shared/icons/IconSeparator.vue2.js";
9
9
  const _hoisted_1 = { class: "yc-breadcrumb-item-separator" };
10
10
  const _sfc_main = /* @__PURE__ */ defineComponent({
11
11
  __name: "BreadcrumbSeparator",
@@ -20,8 +20,8 @@ declare const __VLS_component: import('vue').DefineComponent<CalendarProps, {},
20
20
  mode: CalendarMode;
21
21
  modelValue: Date;
22
22
  defaultValue: Date;
23
- defaultMode: CalendarMode;
24
23
  modes: CalendarMode[];
24
+ defaultMode: CalendarMode;
25
25
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
26
26
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
27
27
  export default _default;
@@ -17,8 +17,8 @@ declare const Calendar: {
17
17
  mode: import('./type').CalendarMode;
18
18
  modelValue: Date;
19
19
  defaultValue: Date;
20
- defaultMode: import('./type').CalendarMode;
21
20
  modes: import('./type').CalendarMode[];
21
+ defaultMode: import('./type').CalendarMode;
22
22
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
23
23
  P: {};
24
24
  B: {};
@@ -35,8 +35,8 @@ declare const Calendar: {
35
35
  mode: import('./type').CalendarMode;
36
36
  modelValue: Date;
37
37
  defaultValue: Date;
38
- defaultMode: import('./type').CalendarMode;
39
38
  modes: import('./type').CalendarMode[];
39
+ defaultMode: import('./type').CalendarMode;
40
40
  }>;
41
41
  __isFragment?: never;
42
42
  __isTeleport?: never;
@@ -55,8 +55,8 @@ declare const Calendar: {
55
55
  mode: import('./type').CalendarMode;
56
56
  modelValue: Date;
57
57
  defaultValue: Date;
58
- defaultMode: import('./type').CalendarMode;
59
58
  modes: import('./type').CalendarMode[];
59
+ defaultMode: import('./type').CalendarMode;
60
60
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
61
61
  $slots: Readonly<import('./type').CalendarSlots> & import('./type').CalendarSlots;
62
62
  }) & {
@@ -14,9 +14,9 @@ declare const __VLS_component: import('vue').DefineComponent<CollapseProps, {},
14
14
  "onUpdate:activekey"?: ((value: import('./type').CollapseValue) => any) | undefined;
15
15
  }>, {
16
16
  bordered: boolean;
17
+ accordion: boolean;
17
18
  activeKey: import('./type').CollapseValue[];
18
19
  defaultActiveKey: import('./type').CollapseValue[];
19
- accordion: boolean;
20
20
  expandIconPosition: import('./type').ExpandIconPosition;
21
21
  showExpandIcon: boolean;
22
22
  destroyOnHide: boolean;
@@ -13,9 +13,9 @@ declare const Collapse: {
13
13
  "update:activekey": (value: import('./type').CollapseValue) => any;
14
14
  }, import('vue').PublicProps, {
15
15
  bordered: boolean;
16
+ accordion: boolean;
16
17
  activeKey: import('./type').CollapseValue[];
17
18
  defaultActiveKey: import('./type').CollapseValue[];
18
- accordion: boolean;
19
19
  expandIconPosition: import('./type').ExpandIconPosition;
20
20
  showExpandIcon: boolean;
21
21
  destroyOnHide: boolean;
@@ -31,9 +31,9 @@ declare const Collapse: {
31
31
  "onUpdate:activekey"?: ((value: import('./type').CollapseValue) => any) | undefined;
32
32
  }>, {}, {}, {}, {}, {
33
33
  bordered: boolean;
34
+ accordion: boolean;
34
35
  activeKey: import('./type').CollapseValue[];
35
36
  defaultActiveKey: import('./type').CollapseValue[];
36
- accordion: boolean;
37
37
  expandIconPosition: import('./type').ExpandIconPosition;
38
38
  showExpandIcon: boolean;
39
39
  destroyOnHide: boolean;
@@ -49,9 +49,9 @@ declare const Collapse: {
49
49
  "update:activekey": (value: import('./type').CollapseValue) => any;
50
50
  }, string, {
51
51
  bordered: boolean;
52
+ accordion: boolean;
52
53
  activeKey: import('./type').CollapseValue[];
53
54
  defaultActiveKey: import('./type').CollapseValue[];
54
- accordion: boolean;
55
55
  expandIconPosition: import('./type').ExpandIconPosition;
56
56
  showExpandIcon: boolean;
57
57
  destroyOnHide: boolean;
@@ -22,13 +22,13 @@ declare const __VLS_component: import('vue').DefineComponent<ColorPickerProps, {
22
22
  modelValue: string;
23
23
  defaultValue: string;
24
24
  triggerProps: import('../Trigger').TriggerProps;
25
+ hideTrigger: boolean;
25
26
  format: import('./type').ColorFormat;
26
27
  disabledAlpha: boolean;
27
28
  showHistory: boolean;
28
29
  showPreset: boolean;
29
30
  historyColors: string[];
30
31
  presetColors: string[];
31
- hideTrigger: boolean;
32
32
  showText: boolean;
33
33
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
34
34
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -17,13 +17,13 @@ declare const ColorPicker: {
17
17
  modelValue: string;
18
18
  defaultValue: string;
19
19
  triggerProps: import('..').TriggerProps;
20
+ hideTrigger: boolean;
20
21
  format: import('./type').ColorFormat;
21
22
  disabledAlpha: boolean;
22
23
  showHistory: boolean;
23
24
  showPreset: boolean;
24
25
  historyColors: string[];
25
26
  presetColors: string[];
26
- hideTrigger: boolean;
27
27
  showText: boolean;
28
28
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
29
29
  P: {};
@@ -42,13 +42,13 @@ declare const ColorPicker: {
42
42
  modelValue: string;
43
43
  defaultValue: string;
44
44
  triggerProps: import('..').TriggerProps;
45
+ hideTrigger: boolean;
45
46
  format: import('./type').ColorFormat;
46
47
  disabledAlpha: boolean;
47
48
  showHistory: boolean;
48
49
  showPreset: boolean;
49
50
  historyColors: string[];
50
51
  presetColors: string[];
51
- hideTrigger: boolean;
52
52
  showText: boolean;
53
53
  }>;
54
54
  __isFragment?: never;
@@ -68,13 +68,13 @@ declare const ColorPicker: {
68
68
  modelValue: string;
69
69
  defaultValue: string;
70
70
  triggerProps: import('..').TriggerProps;
71
+ hideTrigger: boolean;
71
72
  format: import('./type').ColorFormat;
72
73
  disabledAlpha: boolean;
73
74
  showHistory: boolean;
74
75
  showPreset: boolean;
75
76
  historyColors: string[];
76
77
  presetColors: string[];
77
- hideTrigger: boolean;
78
78
  showText: boolean;
79
79
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
80
80
  $slots: {
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./Dgroup.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
- const Dgroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-28066848"]]);
4
+ const Dgroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9647daa0"]]);
5
5
  export {
6
6
  Dgroup as default
7
7
  };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, createElementBlock, openBlock, Fragment, createElementVNode, renderSlot, normalizeClass, unref, createTextVNode, toDisplayString } from "vue";
2
- import useContext from "./hooks/useContext.js";
2
+ import useMenuContext from "../Menu/hooks/useContext.js";
3
3
  const _sfc_main = /* @__PURE__ */ defineComponent({
4
4
  ...{
5
5
  name: "Dgroup"
@@ -9,7 +9,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
9
9
  title: {}
10
10
  },
11
11
  setup(__props) {
12
- const { theme } = useContext().inject();
12
+ const { theme } = useMenuContext().inject();
13
13
  return (_ctx, _cache) => {
14
14
  return openBlock(), createElementBlock(Fragment, null, [
15
15
  createElementVNode("div", {
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./Doption.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
- const Doption = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-05a4bb68"]]);
4
+ const Doption = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4d0a3b0c"]]);
5
5
  export {
6
6
  Doption as default
7
7
  };
@@ -1,5 +1,6 @@
1
1
  import { defineComponent, toRefs, createElementBlock, openBlock, normalizeClass, unref, createCommentVNode, createElementVNode, renderSlot } from "vue";
2
2
  import useContext from "./hooks/useContext.js";
3
+ import useMenuContext from "../Menu/hooks/useContext.js";
3
4
  const _hoisted_1 = {
4
5
  key: 0,
5
6
  class: "yc-dropdown-option-icon"
@@ -25,7 +26,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
25
26
  const props = __props;
26
27
  const emits = __emit;
27
28
  const { value: optionValue, disabled, isSubmenu } = toRefs(props);
28
- const { select, theme } = useContext().inject();
29
+ const { select } = useContext().inject();
30
+ const { theme } = useMenuContext().inject();
29
31
  const handleClick = (ev) => {
30
32
  if (disabled.value) return;
31
33
  emits("click", ev);
@@ -26,7 +26,6 @@ declare const __VLS_component: import('vue').DefineComponent<DropdownProps, {
26
26
  popupContainer: import('..').PopupContainer;
27
27
  triggerProps: import('../Trigger').TriggerProps;
28
28
  hideOnSelect: boolean;
29
- theme: import('..').Theme;
30
29
  popupMaxHeight: number | boolean;
31
30
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
32
31
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -6,6 +6,7 @@ import "../_shared/utils/time.js";
6
6
  import "../Empty/index.js";
7
7
  /* empty css */
8
8
  import useContext from "./hooks/useContext.js";
9
+ import useMenuContext from "../Menu/hooks/useContext.js";
9
10
  import Trigger from "../Trigger/index.js";
10
11
  import Scrollbar from "../Scrollbar/index.js";
11
12
  const _hoisted_1 = { class: "yc-dropdown" };
@@ -30,8 +31,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
30
31
  triggerProps: { default: () => {
31
32
  return {};
32
33
  } },
33
- popupMaxHeight: { type: [Number, Boolean], default: 200 },
34
- theme: { default: "light" }
34
+ popupMaxHeight: { type: [Number, Boolean], default: 200 }
35
35
  },
36
36
  emits: ["update:popupVisible", "popup-visible-change", "select"],
37
37
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -43,6 +43,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
43
43
  popupMaxHeight: _popupMaxHeight
44
44
  } = toRefs(props);
45
45
  const { computedVisible } = useContext().provide(props, emits);
46
+ const { theme } = useMenuContext().inject();
46
47
  const position = computed(() => {
47
48
  return ["top", "tl", "tr", "bottom", "bl", "br"].includes(_position.value) ? _position.value : "bottom";
48
49
  });
@@ -73,7 +74,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
73
74
  "mouse-leave-delay": 150,
74
75
  alignPoint: _ctx.alignPoint,
75
76
  "auto-fit-popup-min-width": !_ctx.alignPoint && ["top", "bottom"].includes(position.value),
76
- class: ["yc-dropdown-popup", , `yc-dropdown-theme-${_ctx.theme}`, _ctx.$attrs.class],
77
+ class: ["yc-dropdown-popup", , `yc-dropdown-theme-${unref(theme)}`, _ctx.$attrs.class],
77
78
  style: _ctx.$attrs.style,
78
79
  "animation-name": "slide-dynamic-origin",
79
80
  "need-transform-origin": ""
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./Dsubmenu.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
- const Dsubmenu = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7a40c502"]]);
4
+ const Dsubmenu = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6ea1704e"]]);
5
5
  export {
6
6
  Dsubmenu as default
7
7
  };
@@ -8,7 +8,7 @@ import "../Empty/index.js";
8
8
  /* empty css */
9
9
  import _sfc_main$1 from "../_shared/icons/IconArrowRight.vue.js";
10
10
  import useControlValue from "../_shared/utils/control.js";
11
- import useContext from "./hooks/useContext.js";
11
+ import useMenuContext from "../Menu/hooks/useContext.js";
12
12
  import "./index.js";
13
13
  import Trigger from "../Trigger/index.js";
14
14
  import Scrollbar from "../Scrollbar/index.js";
@@ -45,7 +45,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
45
45
  position: _position,
46
46
  popupMaxHeight: _popupMaxHeight
47
47
  } = toRefs(props);
48
- const { theme } = useContext().inject();
48
+ const { theme } = useMenuContext().inject();
49
49
  const computedVisible = useControlValue(
50
50
  popupVisible,
51
51
  defaultPopupVisible.value,
@@ -130,7 +130,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
130
130
  default: withCtx(() => [
131
131
  createVNode(unref(Doption), {
132
132
  disabled: _ctx.disabled,
133
- theme: unref(theme),
134
133
  class: normalizeClass(_ctx.$attrs.class),
135
134
  style: normalizeStyle(_ctx.$attrs.style),
136
135
  "is-submenu": "",
@@ -144,7 +143,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
144
143
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
145
144
  ]),
146
145
  _: 3
147
- }, 8, ["disabled", "theme", "class", "style"])
146
+ }, 8, ["disabled", "class", "style"])
148
147
  ]),
149
148
  _: 3
150
149
  }, 16, ["popup-visible", "trigger", "position", "disabled"]);
@@ -1,8 +1,6 @@
1
- import { Ref } from 'vue';
2
1
  import { DoptionValue, DropdownEmits } from '../type';
3
- import { Props, Theme } from '../../_shared/type';
2
+ import { Props } from '../../_shared/type';
4
3
  type DropdownContext = {
5
- theme: Ref<Theme>;
6
4
  select: (value: DoptionValue, ev: MouseEvent) => void;
7
5
  };
8
6
  declare const _default: () => {
@@ -1,4 +1,4 @@
1
- import { toRefs, provide, inject, ref } from "vue";
1
+ import { toRefs, provide, inject } from "vue";
2
2
  import "../../node_modules/tinycolor2/esm/tinycolor.js";
3
3
  import "../../_shared/utils/dom.js";
4
4
  import "../../_shared/utils/time.js";
@@ -12,7 +12,6 @@ const useContext = () => {
12
12
  popupVisible,
13
13
  defaultPopupVisible,
14
14
  hideOnSelect,
15
- theme,
16
15
  position: _position
17
16
  } = toRefs(props);
18
17
  const computedVisible = useControlValue(
@@ -24,7 +23,6 @@ const useContext = () => {
24
23
  }
25
24
  );
26
25
  provide(DROPDOWN_CONTEXT_KEY, {
27
- theme,
28
26
  select: (value, ev) => {
29
27
  emits("select", value, ev);
30
28
  if (!hideOnSelect.value) return;
@@ -37,7 +35,6 @@ const useContext = () => {
37
35
  };
38
36
  const inject$1 = () => {
39
37
  return inject(DROPDOWN_CONTEXT_KEY, {
40
- theme: ref("light"),
41
38
  select: () => {
42
39
  }
43
40
  });
@@ -31,7 +31,6 @@ declare const Dropdown: {
31
31
  popupContainer: import('..').PopupContainer;
32
32
  triggerProps: import('..').TriggerProps;
33
33
  hideOnSelect: boolean;
34
- theme: import('..').Theme;
35
34
  popupMaxHeight: number | boolean;
36
35
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
37
36
  P: {};
@@ -56,7 +55,6 @@ declare const Dropdown: {
56
55
  popupContainer: import('..').PopupContainer;
57
56
  triggerProps: import('..').TriggerProps;
58
57
  hideOnSelect: boolean;
59
- theme: import('..').Theme;
60
58
  popupMaxHeight: number | boolean;
61
59
  }>;
62
60
  __isFragment?: never;
@@ -82,7 +80,6 @@ declare const Dropdown: {
82
80
  popupContainer: import('..').PopupContainer;
83
81
  triggerProps: import('..').TriggerProps;
84
82
  hideOnSelect: boolean;
85
- theme: import('..').Theme;
86
83
  popupMaxHeight: number | boolean;
87
84
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
88
85
  $slots: Readonly<import('./type').DropdownSlots> & import('./type').DropdownSlots;
@@ -1,4 +1,4 @@
1
- import { ObjectData, PopupContainer, Theme, Size } from '../_shared/type';
1
+ import { ObjectData, PopupContainer, Size } from '../_shared/type';
2
2
  import { TriggerProps, TriggerType } from '../Trigger';
3
3
  import { ButtonProps, ButtonType } from '../Button';
4
4
  import { VNode } from 'vue';
@@ -12,7 +12,6 @@ export interface DropdownProps {
12
12
  alignPoint?: boolean;
13
13
  triggerProps?: TriggerProps;
14
14
  popupMaxHeight?: number | boolean;
15
- theme?: Theme;
16
15
  }
17
16
  export interface DropdownEmits {
18
17
  (e: 'update:popupVisible', value: boolean): void;
@@ -19,11 +19,11 @@ declare const __VLS_component: import('vue').DefineComponent<LayoutSiderProps, {
19
19
  collapsed: boolean;
20
20
  breakpoint: import('..').BreakpointName;
21
21
  theme: import('..').Theme;
22
- hideTrigger: boolean;
23
22
  defaultCollapsed: boolean;
24
- collapsible: boolean;
25
23
  collapsedWidth: number;
24
+ collapsible: boolean;
26
25
  reverseArrow: boolean;
26
+ hideTrigger: boolean;
27
27
  resizeDirections: import('./type').ResizeDirections;
28
28
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
29
29
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./LayoutSider.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
- const LayoutSider = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-36d02bbe"]]);
4
+ const LayoutSider = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d230ef01"]]);
5
5
  export {
6
6
  LayoutSider as default
7
7
  };
@@ -13,7 +13,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13
13
  },
14
14
  __name: "LayoutSider",
15
15
  props: {
16
- theme: { default: "light" },
16
+ theme: { default: void 0 },
17
17
  collapsed: { type: Boolean, default: void 0 },
18
18
  defaultCollapsed: { type: Boolean, default: false },
19
19
  collapsible: { type: Boolean, default: false },
@@ -29,8 +29,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
29
29
  emits: ["update:collapsed", "collapse", "breakpoint"],
30
30
  setup(__props, { emit: __emit }) {
31
31
  useCssVars((_ctx) => ({
32
- "72f002a1": computedWidth.value,
33
- "216762c7": collapsedWidth.value
32
+ "0a49ed96": computedWidth.value,
33
+ "754ad672": collapsedWidth.value
34
34
  }));
35
35
  const props = __props;
36
36
  const emits = __emit;
@@ -38,11 +38,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
38
38
  collapsible,
39
39
  breakpoint,
40
40
  hideTrigger,
41
- theme,
42
41
  width: _width,
43
42
  collapsedWidth: _collapsedWidth
44
43
  } = toRefs(props);
45
- const { computedCollapsed } = useSiderContext().provide(props, emits);
44
+ const { theme, computedCollapsed } = useSiderContext().provide(props, emits);
46
45
  const asideWidth = ref(_width.value);
47
46
  const computedWidth = computed(() => valueToPx(asideWidth.value));
48
47
  const collapsedWidth = computed(() => valueToPx(_collapsedWidth.value));
@@ -8,6 +8,7 @@ export type LayoutContext = {
8
8
  };
9
9
  declare const _default: () => {
10
10
  provide: (props: Props, emits: LayoutSiderEmits) => {
11
+ theme: import('vue').ComputedRef<Theme>;
11
12
  computedCollapsed: import('vue').WritableComputedRef<boolean, boolean>;
12
13
  };
13
14
  inject: () => LayoutContext;
@@ -1,14 +1,26 @@
1
- import { toRefs, provide, inject, ref } from "vue";
1
+ import { toRefs, computed, provide, inject, ref } from "vue";
2
2
  import "../../node_modules/tinycolor2/esm/tinycolor.js";
3
3
  import "../../_shared/utils/dom.js";
4
+ import { isUndefined } from "../../_shared/utils/is.js";
4
5
  import "../../_shared/utils/time.js";
5
6
  import "../../Empty/index.js";
6
7
  /* empty css */
7
8
  import useControlValue from "../../_shared/utils/control.js";
9
+ import { useDark } from "../../node_modules/@vueuse/core/index.js";
8
10
  const LAYOUT_CONTEXT_KEY = "LAYOUT-CONTEXT";
9
11
  const useSiderContext = () => {
10
12
  const provide$1 = (props, emits) => {
11
- const { theme, collapsed, defaultCollapsed } = toRefs(props);
13
+ const {
14
+ theme: _theme,
15
+ collapsed,
16
+ defaultCollapsed
17
+ } = toRefs(props);
18
+ const isDark = useDark({
19
+ selector: "body",
20
+ attribute: "yc-design-theme",
21
+ valueDark: "dark",
22
+ valueLight: "light"
23
+ });
12
24
  const computedCollapsed = useControlValue(
13
25
  collapsed,
14
26
  defaultCollapsed.value,
@@ -16,11 +28,18 @@ const useSiderContext = () => {
16
28
  emits("update:collapsed", val);
17
29
  }
18
30
  );
31
+ const theme = computed(() => {
32
+ if (!isUndefined(_theme.value)) {
33
+ return _theme.value;
34
+ }
35
+ return isDark.value ? "dark" : "light";
36
+ });
19
37
  provide(LAYOUT_CONTEXT_KEY, {
20
38
  theme,
21
39
  collapsed: computedCollapsed
22
40
  });
23
41
  return {
42
+ theme,
24
43
  computedCollapsed
25
44
  };
26
45
  };
@@ -90,11 +90,11 @@ declare const Layout: {
90
90
  collapsed: boolean;
91
91
  breakpoint: import('..').BreakpointName;
92
92
  theme: import('..').Theme;
93
- hideTrigger: boolean;
94
93
  defaultCollapsed: boolean;
95
- collapsible: boolean;
96
94
  collapsedWidth: number;
95
+ collapsible: boolean;
97
96
  reverseArrow: boolean;
97
+ hideTrigger: boolean;
98
98
  resizeDirections: import('./type').ResizeDirections;
99
99
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
100
100
  P: {};
@@ -112,11 +112,11 @@ declare const Layout: {
112
112
  collapsed: boolean;
113
113
  breakpoint: import('..').BreakpointName;
114
114
  theme: import('..').Theme;
115
- hideTrigger: boolean;
116
115
  defaultCollapsed: boolean;
117
- collapsible: boolean;
118
116
  collapsedWidth: number;
117
+ collapsible: boolean;
119
118
  reverseArrow: boolean;
119
+ hideTrigger: boolean;
120
120
  resizeDirections: import('./type').ResizeDirections;
121
121
  }>;
122
122
  __isFragment?: never;
@@ -135,11 +135,11 @@ declare const Layout: {
135
135
  collapsed: boolean;
136
136
  breakpoint: import('..').BreakpointName;
137
137
  theme: import('..').Theme;
138
- hideTrigger: boolean;
139
138
  defaultCollapsed: boolean;
140
- collapsible: boolean;
141
139
  collapsedWidth: number;
140
+ collapsible: boolean;
142
141
  reverseArrow: boolean;
142
+ hideTrigger: boolean;
143
143
  resizeDirections: import('./type').ResizeDirections;
144
144
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
145
145
  $slots: Readonly<import('./type').LayoutSiderSlots> & import('./type').LayoutSiderSlots;
@@ -10,16 +10,16 @@ declare function __VLS_template(): {
10
10
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
11
  declare const __VLS_component: import('vue').DefineComponent<MenuProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
12
12
  collapse: (collapsed: boolean, type: "clickTrigger" | "responsive") => any;
13
- "update:collapsed": (value: boolean) => any;
14
13
  "update:selectedKeys": (value: string) => any;
15
14
  "update:openKeys": (value: string) => any;
15
+ "update:collapsed": (value: boolean) => any;
16
16
  "menu-item-click": (key: string) => any;
17
17
  "sub-menu-click": (key: string, openKeys: string[]) => any;
18
18
  }, string, import('vue').PublicProps, Readonly<MenuProps> & Readonly<{
19
19
  onCollapse?: ((collapsed: boolean, type: "clickTrigger" | "responsive") => any) | undefined;
20
- "onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
21
20
  "onUpdate:selectedKeys"?: ((value: string) => any) | undefined;
22
21
  "onUpdate:openKeys"?: ((value: string) => any) | undefined;
22
+ "onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
23
23
  "onMenu-item-click"?: ((key: string) => any) | undefined;
24
24
  "onSub-menu-click"?: ((key: string, openKeys: string[]) => any) | undefined;
25
25
  }>, {
@@ -27,21 +27,21 @@ declare const __VLS_component: import('vue').DefineComponent<MenuProps, {}, {},
27
27
  triggerProps: import('..').TriggerProps;
28
28
  collapsed: boolean;
29
29
  breakpoint: import('..').BreakpointName;
30
- theme: import('..').Theme;
31
30
  popupMaxHeight: import('./type').PopupMaxHeight;
32
- accordion: boolean;
31
+ theme: import('..').Theme;
32
+ levelIndent: number;
33
+ autoOpen: boolean;
33
34
  defaultCollapsed: boolean;
34
35
  collapsedWidth: number | string;
36
+ accordion: boolean;
37
+ showCollapseButton: boolean;
35
38
  selectedKeys: string;
36
39
  defaultSelectedKeys: string;
37
40
  openKeys: string[];
38
41
  defaultOpenKeys: string[];
39
- levelIndent: number;
40
- autoOpen: boolean;
41
42
  tooltipProps: import('..').TooltipProps;
42
43
  autoOpenSelected: boolean;
43
44
  autoScrollIntoView: boolean;
44
- showCollapseButton: boolean;
45
45
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
46
46
  menuRef: HTMLDivElement;
47
47
  }, HTMLDivElement>;
@@ -6,7 +6,7 @@ import "../Empty/index.js";
6
6
  /* empty css */
7
7
  import _sfc_main$1 from "../_shared/icons/IconMenuFold.vue.js";
8
8
  import _sfc_main$2 from "../_shared/icons/IconMenuUnfold.vue.js";
9
- import useContext from "./hooks/useContext.js";
9
+ import useMenuContext from "./hooks/useContext.js";
10
10
  import MenuEllipsis from "./MenuEllipsis.vue.js";
11
11
  const _sfc_main = /* @__PURE__ */ defineComponent({
12
12
  ...{
@@ -47,7 +47,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
47
47
  const props = __props;
48
48
  const emits = __emit;
49
49
  const menuRef = ref();
50
- const { computedCollapsed, collapsedWidth, breakpoint, menuTree, max, theme } = useContext().provide(props, emits, menuRef);
50
+ const { computedCollapsed, collapsedWidth, breakpoint, menuTree, max, theme } = useMenuContext().provide(props, emits, menuRef);
51
51
  const handleClick = () => {
52
52
  const value = !computedCollapsed.value;
53
53
  computedCollapsed.value = value;
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./MenuEllipsis.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
- const MenuEllipsis = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b37dd55e"]]);
4
+ const MenuEllipsis = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c409e211"]]);
5
5
  export {
6
6
  MenuEllipsis as default
7
7
  };
@@ -6,7 +6,7 @@ import "../_shared/utils/time.js";
6
6
  import "../Empty/index.js";
7
7
  /* empty css */
8
8
  import _sfc_main$1 from "../_shared/icons/IconMore.vue.js";
9
- import useContext, { isMenuItemActive } from "./hooks/useContext.js";
9
+ import useMenuContext, { isMenuItemActive } from "./hooks/useContext.js";
10
10
  import _sfc_main$3 from "./MenuPopOption.vue.js";
11
11
  import Dropdown from "../Dropdown/index.js";
12
12
  const _hoisted_1 = {
@@ -25,7 +25,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
25
25
  menuTree,
26
26
  max,
27
27
  emits
28
- } = useContext().inject();
28
+ } = useMenuContext().inject();
29
29
  const submenus = computed(() => menuTree.value.slice(max.value));
30
30
  const isSelected = computed(() => {
31
31
  return submenus.value.some((item) => {
@@ -45,7 +45,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
45
45
  return openBlock(), createElementBlock("div", _hoisted_1, [
46
46
  createVNode(unref(Dropdown), {
47
47
  "popup-max-height": unref(popupMaxHeight),
48
- theme: unref(theme),
49
48
  "trigger-props": {
50
49
  position: "bl",
51
50
  popupOffset: 20,
@@ -85,7 +84,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
85
84
  ], 2)
86
85
  ]),
87
86
  _: 1
88
- }, 8, ["popup-max-height", "theme", "trigger-props"])
87
+ }, 8, ["popup-max-height", "trigger-props"])
89
88
  ]);
90
89
  };
91
90
  }