yc-design-vue 1.4.0 → 1.4.2

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/Calendar/CalendarMonth.vue.d.ts +3 -3
  2. package/es/Calendar/CalendarYear.vue.d.ts +3 -3
  3. package/es/Carousel/hooks/useContext.d.ts +1 -1
  4. package/es/Cascader/Cascader.vue.d.ts +13 -1
  5. package/es/Cascader/hooks/useContext.d.ts +16 -4
  6. package/es/Cascader/index.d.ts +13 -1
  7. package/es/ColorPicker/hooks/useContext.d.ts +2 -2
  8. package/es/ConfigProvider/index.d.ts +0 -3
  9. package/es/ConfigProvider/index.vue.d.ts +0 -1
  10. package/es/ConfigProvider/index.vue.js +2 -11
  11. package/es/ConfigProvider/type.d.ts +0 -1
  12. package/es/Descriptions/hooks/useContext.d.ts +1 -1
  13. package/es/Dropdown/hooks/useContext.d.ts +1 -1
  14. package/es/Image/hooks/useContext.d.ts +2 -2
  15. package/es/Input/InputSuffix.vue2.js +2 -2
  16. package/es/Input/hooks/useLimitedInput.d.ts +2 -2
  17. package/es/InputNumber/InputNumber.vue.js +1 -1
  18. package/es/InputTag/index.vue.js +1 -1
  19. package/es/Layout/LayoutSider.vue.js +1 -1
  20. package/es/Layout/LayoutSider.vue2.js +7 -14
  21. package/es/Layout/hooks/useSiderContext.d.ts +15 -0
  22. package/es/Layout/hooks/useSiderContext.js +41 -0
  23. package/es/Menu/Menu.vue.js +1 -1
  24. package/es/Menu/Menu.vue2.js +4 -4
  25. package/es/Menu/hooks/useContext.d.ts +2 -1
  26. package/es/Menu/hooks/useContext.js +7 -1
  27. package/es/Pagination/Pagination.vue.js +1 -1
  28. package/es/Pagination/Pagination.vue2.js +1 -1
  29. package/es/Pagination/PaginationItem.vue.js +1 -1
  30. package/es/Pagination/PaginationItem.vue2.js +2 -2
  31. package/es/Pagination/hooks/useContext.d.ts +4 -4
  32. package/es/Radio/Radio.vue.js +1 -1
  33. package/es/Select/hooks/useContext.d.ts +3 -3
  34. package/es/Slider/hooks/useContext.d.ts +3 -3
  35. package/es/Slider/hooks/useContext.js +6 -4
  36. package/es/Tabs/hooks/useContext.d.ts +2 -2
  37. package/es/TimePicker/TimePicker.vue.js +1 -1
  38. package/es/TimePicker/hooks/useContext.d.ts +3 -3
  39. package/es/Transfer/Transfer.vue.js +1 -1
  40. package/es/Transfer/hooks/useContext.d.ts +4 -4
  41. package/es/Trigger/hooks/useTriggerVisible.d.ts +1 -1
  42. package/es/_shared/icons/IconEyeClose.vue.js +20 -1
  43. package/es/_shared/icons/IconEyeClose.vue2.js +1 -20
  44. package/es/_shared/icons/IconEyeOpen.vue.js +17 -1
  45. package/es/_shared/icons/IconEyeOpen.vue2.js +1 -17
  46. package/es/_shared/utils/control.d.ts +1 -1
  47. package/es/_shared/utils/global-config.d.ts +4 -8
  48. package/es/_shared/utils/global-config.js +1 -5
  49. package/es/style.css +1 -1
  50. package/lib/Calendar/CalendarMonth.vue.d.ts +3 -3
  51. package/lib/Calendar/CalendarYear.vue.d.ts +3 -3
  52. package/lib/Carousel/hooks/useContext.d.ts +1 -1
  53. package/lib/Cascader/Cascader.vue.d.ts +13 -1
  54. package/lib/Cascader/hooks/useContext.d.ts +16 -4
  55. package/lib/Cascader/index.d.ts +13 -1
  56. package/lib/ColorPicker/hooks/useContext.d.ts +2 -2
  57. package/lib/ConfigProvider/index.d.ts +0 -3
  58. package/lib/ConfigProvider/index.vue.d.ts +0 -1
  59. package/lib/ConfigProvider/index.vue.js +1 -1
  60. package/lib/ConfigProvider/type.d.ts +0 -1
  61. package/lib/Descriptions/hooks/useContext.d.ts +1 -1
  62. package/lib/Dropdown/hooks/useContext.d.ts +1 -1
  63. package/lib/Image/hooks/useContext.d.ts +2 -2
  64. package/lib/Input/InputSuffix.vue2.js +1 -1
  65. package/lib/Input/hooks/useLimitedInput.d.ts +2 -2
  66. package/lib/InputNumber/InputNumber.vue.js +1 -1
  67. package/lib/InputTag/index.vue.js +1 -1
  68. package/lib/Layout/LayoutSider.vue.js +1 -1
  69. package/lib/Layout/LayoutSider.vue2.js +1 -1
  70. package/lib/Layout/hooks/useSiderContext.d.ts +15 -0
  71. package/lib/Layout/hooks/useSiderContext.js +1 -0
  72. package/lib/Menu/Menu.vue.js +1 -1
  73. package/lib/Menu/Menu.vue2.js +1 -1
  74. package/lib/Menu/hooks/useContext.d.ts +2 -1
  75. package/lib/Menu/hooks/useContext.js +1 -1
  76. package/lib/Pagination/Pagination.vue.js +1 -1
  77. package/lib/Pagination/Pagination.vue2.js +1 -1
  78. package/lib/Pagination/PaginationItem.vue.js +1 -1
  79. package/lib/Pagination/PaginationItem.vue2.js +1 -1
  80. package/lib/Pagination/hooks/useContext.d.ts +4 -4
  81. package/lib/Radio/Radio.vue.js +1 -1
  82. package/lib/Select/hooks/useContext.d.ts +3 -3
  83. package/lib/Slider/hooks/useContext.d.ts +3 -3
  84. package/lib/Slider/hooks/useContext.js +1 -1
  85. package/lib/Tabs/hooks/useContext.d.ts +2 -2
  86. package/lib/TimePicker/TimePicker.vue.js +1 -1
  87. package/lib/TimePicker/hooks/useContext.d.ts +3 -3
  88. package/lib/Transfer/Transfer.vue.js +1 -1
  89. package/lib/Transfer/hooks/useContext.d.ts +4 -4
  90. package/lib/Trigger/hooks/useTriggerVisible.d.ts +1 -1
  91. package/lib/_shared/icons/IconEyeClose.vue.js +1 -1
  92. package/lib/_shared/icons/IconEyeClose.vue2.js +1 -1
  93. package/lib/_shared/icons/IconEyeOpen.vue.js +1 -1
  94. package/lib/_shared/icons/IconEyeOpen.vue2.js +1 -1
  95. package/lib/_shared/utils/control.d.ts +1 -1
  96. package/lib/_shared/utils/global-config.d.ts +4 -8
  97. package/lib/_shared/utils/global-config.js +1 -1
  98. package/lib/style.css +1 -1
  99. package/package.json +1 -2
@@ -9,9 +9,9 @@ declare function __VLS_template(): {
9
9
  attrs: Partial<{}>;
10
10
  slots: {
11
11
  default?(_: {
12
- year: any;
13
- month: any;
14
- day: any;
12
+ year: number;
13
+ month: number;
14
+ day: number;
15
15
  }): any;
16
16
  };
17
17
  refs: {};
@@ -7,9 +7,9 @@ declare function __VLS_template(): {
7
7
  attrs: Partial<{}>;
8
8
  slots: {
9
9
  default?(_: {
10
- year: any;
11
- month: any;
12
- day: any;
10
+ year: number;
11
+ month: number;
12
+ day: number;
13
13
  }): any;
14
14
  };
15
15
  refs: {};
@@ -18,7 +18,7 @@ type MoveType = 'positive' | 'negative';
18
18
  declare const _default: () => {
19
19
  provide: (props: Props, emits: CarouselEmits) => {
20
20
  carouselItems: import('vue').ComputedRef<import('../../_shared/type').ObjectData[]>;
21
- computedCurrent: import('vue').WritableComputedRef<any, number>;
21
+ computedCurrent: import('vue').WritableComputedRef<number, number>;
22
22
  length: import('vue').ComputedRef<number>;
23
23
  autoPlay: Ref<import('..').AutoPlay, import('..').AutoPlay>;
24
24
  slideTo: (targetIndex: number) => Promise<void>;
@@ -6,7 +6,19 @@ declare function __VLS_template(): {
6
6
  tag: import('../_shared/type').ObjectData;
7
7
  }): any;
8
8
  label?(_: {
9
- data: any;
9
+ data: {
10
+ id: string | undefined;
11
+ label: string;
12
+ level?: number;
13
+ index?: number;
14
+ nodePath?: import('./type').CascaderOptionProps[];
15
+ value?: import('./type').CascaderOptionValue;
16
+ render?: import('vue').RenderFunction;
17
+ disabled?: boolean;
18
+ tagProps?: import('..').TagProps;
19
+ children?: import('./type').CascaderOption[];
20
+ isLeaf?: boolean;
21
+ } | null;
10
22
  }): any;
11
23
  prefix?(_: {}): any;
12
24
  prefix?(_: {}): any;
@@ -29,12 +29,24 @@ export declare function findOptionByValueAndLevel(options: CascaderOption[], val
29
29
  export declare const getLeafNodes: (nodes: CascaderOptionProps[]) => CascaderOptionProps[];
30
30
  declare const _default: () => {
31
31
  provide: (props: Props, emits: CascaderEmits, inputRef: Ref<InputInstance | undefined>) => {
32
- computedValue: import('vue').WritableComputedRef<any, CascaderValue>;
33
- computedInputValue: import('vue').WritableComputedRef<any, string>;
34
- computedVisible: import('vue').WritableComputedRef<any, boolean>;
32
+ computedValue: import('vue').WritableComputedRef<CascaderValue, CascaderValue>;
33
+ computedInputValue: import('vue').WritableComputedRef<string, string>;
34
+ computedVisible: import('vue').WritableComputedRef<boolean, boolean>;
35
35
  options: import('vue').ComputedRef<CascaderOptionProps[]>;
36
36
  optionMap: import('vue').ComputedRef<any>;
37
- selectOptions: import('vue').ComputedRef<any>;
37
+ selectOptions: import('vue').ComputedRef<({
38
+ id: string | undefined;
39
+ label: string;
40
+ level?: number;
41
+ index?: number;
42
+ nodePath?: CascaderOptionProps[];
43
+ value?: CascaderOptionValue;
44
+ render?: import('vue').RenderFunction;
45
+ disabled?: boolean;
46
+ tagProps?: import('../..').TagProps;
47
+ children?: CascaderOption[];
48
+ isLeaf?: boolean;
49
+ } | null)[]>;
38
50
  curLevel: Ref<number, number>;
39
51
  curPath: Ref<number[], number[]>;
40
52
  multiple: Ref<boolean, boolean>;
@@ -320,7 +320,19 @@ declare const Cascader: {
320
320
  tag: import('../_shared/type').ObjectData;
321
321
  }): any;
322
322
  label?(_: {
323
- data: any;
323
+ data: {
324
+ id: string | undefined;
325
+ label: string;
326
+ level?: number;
327
+ index?: number;
328
+ nodePath?: import('./type').CascaderOptionProps[];
329
+ value?: import('./type').CascaderOptionValue;
330
+ render?: import('vue').RenderFunction;
331
+ disabled?: boolean;
332
+ tagProps?: import('..').TagProps;
333
+ children?: import('./type').CascaderOption[];
334
+ isLeaf?: boolean;
335
+ } | null;
324
336
  }): any;
325
337
  prefix?(_: {}): any;
326
338
  prefix?(_: {}): any;
@@ -19,8 +19,8 @@ type ColorPickerContext = {
19
19
  declare const _default: () => {
20
20
  provide: (props: Props, emits: ColorPickerEmits) => {
21
21
  popupVisible: Ref<boolean, boolean>;
22
- size: import('vue').ComputedRef<number | boolean | import('../../_shared/type').PopupContainer | undefined>;
23
- computedColor: import('vue').WritableComputedRef<any, string>;
22
+ size: import('vue').ComputedRef<any>;
23
+ computedColor: import('vue').WritableComputedRef<string, string>;
24
24
  };
25
25
  inject: () => ColorPickerContext;
26
26
  };
@@ -9,7 +9,6 @@ declare const ConfigProvider: {
9
9
  updateAtScroll: boolean;
10
10
  scrollToClose: boolean;
11
11
  zIndex: number;
12
- exchangeTime: boolean;
13
12
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
14
13
  P: {};
15
14
  B: {};
@@ -23,7 +22,6 @@ declare const ConfigProvider: {
23
22
  updateAtScroll: boolean;
24
23
  scrollToClose: boolean;
25
24
  zIndex: number;
26
- exchangeTime: boolean;
27
25
  }>;
28
26
  __isFragment?: never;
29
27
  __isTeleport?: never;
@@ -34,7 +32,6 @@ declare const ConfigProvider: {
34
32
  updateAtScroll: boolean;
35
33
  scrollToClose: boolean;
36
34
  zIndex: number;
37
- exchangeTime: boolean;
38
35
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
39
36
  $slots: Readonly<import('./type').ConfigconfigSlots> & import('./type').ConfigconfigSlots;
40
37
  }) & {
@@ -12,7 +12,6 @@ declare const __VLS_component: import('vue').DefineComponent<ConfigProviderProps
12
12
  updateAtScroll: boolean;
13
13
  scrollToClose: boolean;
14
14
  zIndex: number;
15
- exchangeTime: boolean;
16
15
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
17
16
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
18
17
  export default _default;
@@ -13,27 +13,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13
13
  size: { default: "medium" },
14
14
  popupContainer: { default: "body" },
15
15
  updateAtScroll: { type: Boolean, default: true },
16
- scrollToClose: { type: Boolean, default: false },
17
- exchangeTime: { type: Boolean, default: true }
16
+ scrollToClose: { type: Boolean, default: false }
18
17
  },
19
18
  setup(__props) {
20
19
  const slots = useSlots();
21
20
  const props = __props;
22
- const {
23
- zIndex,
24
- size,
25
- updateAtScroll,
26
- scrollToClose,
27
- exchangeTime,
28
- popupContainer
29
- } = toRefs(props);
21
+ const { zIndex, size, updateAtScroll, scrollToClose, popupContainer } = toRefs(props);
30
22
  provide(CONFIG_PROVIDER_PROVIDE_KEY, {
31
23
  slots,
32
24
  zIndex,
33
25
  size,
34
26
  updateAtScroll,
35
27
  scrollToClose,
36
- exchangeTime,
37
28
  popupContainer
38
29
  });
39
30
  return (_ctx, _cache) => {
@@ -6,7 +6,6 @@ export interface ConfigProviderProps {
6
6
  popupContainer?: PopupContainer;
7
7
  updateAtScroll?: boolean;
8
8
  scrollToClose?: boolean;
9
- exchangeTime?: boolean;
10
9
  }
11
10
  export interface ConfigconfigSlots {
12
11
  default?: () => VNode[];
@@ -12,7 +12,7 @@ type DescriptionsContext = {
12
12
  declare const _default: () => {
13
13
  provide: (props: Props) => {
14
14
  data: import('vue').ComputedRef<DescData[]>;
15
- size: import('vue').ComputedRef<number | boolean | import('../../_shared/type').PopupContainer | undefined>;
15
+ size: import('vue').ComputedRef<any>;
16
16
  column: import('vue').ComputedRef<number>;
17
17
  layout: Ref<import('..').DescriptionsLayout, import('..').DescriptionsLayout>;
18
18
  };
@@ -7,7 +7,7 @@ type DropdownContext = {
7
7
  };
8
8
  declare const _default: () => {
9
9
  provide: (props: Props, emits: DropdownEmits) => {
10
- computedVisible: import('vue').WritableComputedRef<any, boolean>;
10
+ computedVisible: import('vue').WritableComputedRef<boolean, boolean>;
11
11
  };
12
12
  inject: () => DropdownContext;
13
13
  };
@@ -9,8 +9,8 @@ declare const _default: () => {
9
9
  provide: (props: Props, emits: ImagePreviewGroupEmits) => {
10
10
  src: import('vue').ComputedRef<string>;
11
11
  srcList: import('vue').ComputedRef<string[]>;
12
- computedCurrent: import('vue').WritableComputedRef<any, number>;
13
- computedVisible: import('vue').WritableComputedRef<any, boolean>;
12
+ computedCurrent: import('vue').WritableComputedRef<number, number>;
13
+ computedVisible: import('vue').WritableComputedRef<boolean, boolean>;
14
14
  };
15
15
  inject: () => ImageContext;
16
16
  };
@@ -4,8 +4,8 @@ import "../_shared/utils/dom.js";
4
4
  import "../_shared/utils/time.js";
5
5
  import "../Empty/index.js";
6
6
  /* empty css */
7
- import _sfc_main$3 from "../_shared/icons/IconEyeClose.vue2.js";
8
- import _sfc_main$2 from "../_shared/icons/IconEyeOpen.vue2.js";
7
+ import _sfc_main$3 from "../_shared/icons/IconEyeClose.vue.js";
8
+ import _sfc_main$2 from "../_shared/icons/IconEyeOpen.vue.js";
9
9
  import IconButton from "../_shared/components/IconButton.vue.js";
10
10
  import _sfc_main$1 from "../_shared/components/PreventFocus.vue.js";
11
11
  /* empty css */
@@ -8,11 +8,11 @@ declare const _default: (params: {
8
8
  emits: InputEmits | TextareaEmits;
9
9
  inputRef: Ref<HTMLInputElement | HTMLTextAreaElement | undefined>;
10
10
  }) => {
11
- computedValue: import('vue').WritableComputedRef<any, string>;
11
+ computedValue: import('vue').WritableComputedRef<string, string>;
12
12
  showClearBtn: import('vue').ComputedRef<boolean>;
13
13
  showWordLimit: import('vue').ComputedRef<boolean>;
14
14
  curLength: import('vue').ComputedRef<any>;
15
- error: import('vue').WritableComputedRef<any, boolean>;
15
+ error: import('vue').WritableComputedRef<boolean, boolean>;
16
16
  disabled: Ref<boolean, boolean>;
17
17
  maxLength: import('vue').ComputedRef<number>;
18
18
  handleInput: (e: Event) => Promise<void>;
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./InputNumber.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
- const _InputNumber = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e3993db7"]]);
4
+ const _InputNumber = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-046012fc"]]);
5
5
  export {
6
6
  _InputNumber as default
7
7
  };
@@ -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 _InputTag = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-353d8392"]]);
4
+ const _InputTag = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d5a3df97"]]);
5
5
  export {
6
6
  _InputTag as default
7
7
  };
@@ -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-9f5b46bd"]]);
4
+ const LayoutSider = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-36d02bbe"]]);
5
5
  export {
6
6
  LayoutSider as default
7
7
  };
@@ -5,7 +5,7 @@ import "../_shared/utils/time.js";
5
5
  import "../Empty/index.js";
6
6
  /* empty css */
7
7
  import _sfc_main$1 from "../_shared/icons/IconArrowRight.vue.js";
8
- import useControlValue from "../_shared/utils/control.js";
8
+ import useSiderContext from "./hooks/useSiderContext.js";
9
9
  import ResizeBox from "../ResizeBox/index.js";
10
10
  const _sfc_main = /* @__PURE__ */ defineComponent({
11
11
  ...{
@@ -29,30 +29,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
29
29
  emits: ["update:collapsed", "collapse", "breakpoint"],
30
30
  setup(__props, { emit: __emit }) {
31
31
  useCssVars((_ctx) => ({
32
- "6d1005b6": computedWidth.value,
33
- "c8428e7a": collapsedWidth.value
32
+ "72f002a1": computedWidth.value,
33
+ "216762c7": collapsedWidth.value
34
34
  }));
35
35
  const props = __props;
36
36
  const emits = __emit;
37
37
  const {
38
- collapsed,
39
- defaultCollapsed,
40
38
  collapsible,
41
39
  breakpoint,
42
40
  hideTrigger,
41
+ theme,
43
42
  width: _width,
44
43
  collapsedWidth: _collapsedWidth
45
44
  } = toRefs(props);
45
+ const { computedCollapsed } = useSiderContext().provide(props, emits);
46
46
  const asideWidth = ref(_width.value);
47
47
  const computedWidth = computed(() => valueToPx(asideWidth.value));
48
48
  const collapsedWidth = computed(() => valueToPx(_collapsedWidth.value));
49
- const computedCollapsed = useControlValue(
50
- collapsed,
51
- defaultCollapsed.value,
52
- (val) => {
53
- emits("update:collapsed", val);
54
- }
55
- );
56
49
  const showTrigger = computed(() => {
57
50
  return !hideTrigger.value && collapsible.value;
58
51
  });
@@ -79,7 +72,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
79
72
  directions: _ctx.resizeDirections,
80
73
  class: normalizeClass([
81
74
  "yc-layout-sider",
82
- `yc-layout-sider-${_ctx.theme}`,
75
+ `yc-layout-sider-${unref(theme)}`,
83
76
  {
84
77
  "yc-layout-sider-has-trigger": showTrigger.value
85
78
  }
@@ -105,7 +98,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
105
98
  class: normalizeClass([
106
99
  "yc-layout-sider",
107
100
  "yc-layout-sider-translation",
108
- `yc-layout-sider-${_ctx.theme}`,
101
+ `yc-layout-sider-${unref(theme)}`,
109
102
  {
110
103
  "yc-layout-sider-collapsed": unref(computedCollapsed),
111
104
  "yc-layout-sider-has-trigger": showTrigger.value
@@ -0,0 +1,15 @@
1
+ import { Ref } from 'vue';
2
+ import { Props, Theme } from '../../_shared/type';
3
+ import { LayoutSiderEmits } from '../type';
4
+ export declare const LAYOUT_CONTEXT_KEY = "LAYOUT-CONTEXT";
5
+ export type LayoutContext = {
6
+ theme: Ref<Theme>;
7
+ collapsed: Ref<boolean>;
8
+ };
9
+ declare const _default: () => {
10
+ provide: (props: Props, emits: LayoutSiderEmits) => {
11
+ computedCollapsed: import('vue').WritableComputedRef<boolean, boolean>;
12
+ };
13
+ inject: () => LayoutContext;
14
+ };
15
+ export default _default;
@@ -0,0 +1,41 @@
1
+ import { toRefs, provide, inject, ref } from "vue";
2
+ import "../../node_modules/tinycolor2/esm/tinycolor.js";
3
+ import "../../_shared/utils/dom.js";
4
+ import "../../_shared/utils/time.js";
5
+ import "../../Empty/index.js";
6
+ /* empty css */
7
+ import useControlValue from "../../_shared/utils/control.js";
8
+ const LAYOUT_CONTEXT_KEY = "LAYOUT-CONTEXT";
9
+ const useSiderContext = () => {
10
+ const provide$1 = (props, emits) => {
11
+ const { theme, collapsed, defaultCollapsed } = toRefs(props);
12
+ const computedCollapsed = useControlValue(
13
+ collapsed,
14
+ defaultCollapsed.value,
15
+ (val) => {
16
+ emits("update:collapsed", val);
17
+ }
18
+ );
19
+ provide(LAYOUT_CONTEXT_KEY, {
20
+ theme,
21
+ collapsed: computedCollapsed
22
+ });
23
+ return {
24
+ computedCollapsed
25
+ };
26
+ };
27
+ const inject$1 = () => {
28
+ return inject(LAYOUT_CONTEXT_KEY, {
29
+ theme: ref("light"),
30
+ collapsed: ref(false)
31
+ });
32
+ };
33
+ return {
34
+ provide: provide$1,
35
+ inject: inject$1
36
+ };
37
+ };
38
+ export {
39
+ LAYOUT_CONTEXT_KEY,
40
+ useSiderContext as default
41
+ };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./Menu.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
- const _Menu = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-08122c0d"]]);
4
+ const _Menu = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0373627f"]]);
5
5
  export {
6
6
  _Menu as default
7
7
  };
@@ -14,7 +14,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
14
14
  },
15
15
  __name: "Menu",
16
16
  props: {
17
- theme: { default: "light" },
17
+ theme: { default: void 0 },
18
18
  mode: { default: "vertical" },
19
19
  levelIndent: { default: 20 },
20
20
  autoOpen: { type: Boolean, default: false },
@@ -42,12 +42,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
42
42
  emits: ["update:selectedKeys", "update:openKeys", "update:collapsed", "collapse", "menu-item-click", "sub-menu-click"],
43
43
  setup(__props, { emit: __emit }) {
44
44
  useCssVars((_ctx) => ({
45
- "05704ab3": unref(collapsedWidth)
45
+ "fb3e51e2": unref(collapsedWidth)
46
46
  }));
47
47
  const props = __props;
48
48
  const emits = __emit;
49
49
  const menuRef = ref();
50
- const { computedCollapsed, collapsedWidth, breakpoint, menuTree, max } = useContext().provide(props, emits, menuRef);
50
+ const { computedCollapsed, collapsedWidth, breakpoint, menuTree, max, theme } = useContext().provide(props, emits, menuRef);
51
51
  const handleClick = () => {
52
52
  const value = !computedCollapsed.value;
53
53
  computedCollapsed.value = value;
@@ -64,7 +64,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
64
64
  class: normalizeClass([
65
65
  "yc-menu",
66
66
  `yc-menu-mode-${_ctx.mode}`,
67
- `yc-menu-theme-${_ctx.theme}`,
67
+ `yc-menu-theme-${unref(theme)}`,
68
68
  {
69
69
  "yc-menu-collapsed": unref(computedCollapsed) && _ctx.mode != "horizontal"
70
70
  }
@@ -39,7 +39,8 @@ export declare function isMenuItemActive(menuTree: MenuTreeNode[], currentPath:
39
39
  export declare const getPopupMaxHeight: (popupMaxHeight: PopupMaxHeight) => number | undefined;
40
40
  declare const _default: () => {
41
41
  provide: (props: Props, emits: MenuEmits, menuRef: Ref<HTMLDivElement | undefined>) => {
42
- computedCollapsed: import('vue').WritableComputedRef<any, boolean>;
42
+ theme: import('vue').ComputedRef<any>;
43
+ computedCollapsed: import('vue').WritableComputedRef<boolean, boolean>;
43
44
  breakpoint: Ref<import('../..').BreakpointName, import('../..').BreakpointName>;
44
45
  collapsedWidth: import('vue').ComputedRef<string>;
45
46
  menuTree: import('vue').ComputedRef<MenuTreeNode[]>;
@@ -9,6 +9,7 @@ import useControlValue from "../../_shared/utils/control.js";
9
9
  import "../index.js";
10
10
  import { nanoid } from "../../node_modules/nanoid/index.browser.js";
11
11
  import { useResizeObserver } from "../../node_modules/@vueuse/core/index.js";
12
+ import useSiderContext from "../../Layout/hooks/useSiderContext.js";
12
13
  import SubMenu from "../SubMenu.vue.js";
13
14
  import MenuItem from "../MenuItem.vue.js";
14
15
  const MENU_CONTEXT_KEY = "menu-context";
@@ -130,12 +131,12 @@ const useContext = () => {
130
131
  tooltipProps,
131
132
  autoOpenSelected,
132
133
  mode,
133
- theme,
134
134
  autoScrollIntoView,
135
135
  scrollConfig,
136
136
  collapsedWidth,
137
137
  popupMaxHeight: _popupMaxHeight
138
138
  } = toRefs(props);
139
+ const { theme: injectTheme, collapsed: injectCollapsed } = useSiderContext().inject();
139
140
  const computedSelectedKeys = useControlValue(
140
141
  selectedKeys,
141
142
  defaultSelectedKeys.value,
@@ -151,6 +152,9 @@ const useContext = () => {
151
152
  computedOpenKeys.value = [];
152
153
  }
153
154
  emits("update:collapsed", val);
155
+ },
156
+ (val) => {
157
+ return val || injectCollapsed.value;
154
158
  }
155
159
  );
156
160
  const computedOpenKeys = useControlValue(
@@ -174,6 +178,7 @@ const useContext = () => {
174
178
  const menuItemWidths = ref([]);
175
179
  const menuTree = computed(() => buildMenuTree(menuTreeNodes.value));
176
180
  const max = ref(1e6);
181
+ const theme = computed(() => props.theme || injectTheme.value);
177
182
  if (mode.value == "horizontal") {
178
183
  useResizeObserver(
179
184
  menuRef,
@@ -216,6 +221,7 @@ const useContext = () => {
216
221
  emits
217
222
  });
218
223
  return {
224
+ theme,
219
225
  computedCollapsed,
220
226
  breakpoint,
221
227
  collapsedWidth: computed(() => valueToPx(collapsedWidth.value)),
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./Pagination.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
- const _Pagination = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2482f597"]]);
4
+ const _Pagination = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-77c4d3a0"]]);
5
5
  export {
6
6
  _Pagination as default
7
7
  };
@@ -87,7 +87,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
87
87
  await sleep(0);
88
88
  const target = e.target;
89
89
  if (+target.value != computedCurrent.value) {
90
- target.value = computedCurrent.value;
90
+ target.value = String(computedCurrent.value);
91
91
  }
92
92
  };
93
93
  return (_ctx, _cache) => {
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./PaginationItem.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
- const PaginationItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8b8d9ae0"]]);
4
+ const PaginationItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-db2c3eef"]]);
5
5
  export {
6
6
  PaginationItem as default
7
7
  };
@@ -31,9 +31,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
31
31
  if (["item", "more-right", "more-left"].includes(type.value)) {
32
32
  return _disabled.value;
33
33
  } else if (type.value == "pre") {
34
- return computedCurrent.value <= 1;
34
+ return computedCurrent.value <= 1 || _disabled.value;
35
35
  } else {
36
- return computedCurrent.value >= pages.value;
36
+ return computedCurrent.value >= pages.value || _disabled.value;
37
37
  }
38
38
  });
39
39
  const handleClick = () => {
@@ -13,12 +13,12 @@ interface PaginationContext {
13
13
  }
14
14
  declare const _default: () => {
15
15
  provide: (props: Props, emits: PaginationEmits) => {
16
- total: import('vue').WritableComputedRef<any, number>;
17
- size: import('vue').ComputedRef<number | boolean | import('../../_shared/type').PopupContainer | undefined>;
16
+ total: import('vue').WritableComputedRef<number, number>;
17
+ size: import('vue').ComputedRef<any>;
18
18
  pages: import('vue').ComputedRef<number>;
19
19
  pagesArray: import('vue').ComputedRef<(string | number)[]>;
20
- computedCurrent: import('vue').WritableComputedRef<any, number>;
21
- computedPageSize: import('vue').WritableComputedRef<any, number>;
20
+ computedCurrent: import('vue').WritableComputedRef<number, number>;
21
+ computedPageSize: import('vue').WritableComputedRef<number, number>;
22
22
  sizeOptions: import('vue').ComputedRef<{
23
23
  label: string;
24
24
  value: number;
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./Radio.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
- const _Radio = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-63331c6a"]]);
4
+ const _Radio = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-351c0cc3"]]);
5
5
  export {
6
6
  _Radio as default
7
7
  };
@@ -21,9 +21,9 @@ type SelectContext = {
21
21
  };
22
22
  declare const _default: () => {
23
23
  provide: (props: Props, emits: SelectEmits, inputRef: Ref<InputInstance | undefined>) => {
24
- computedVisible: import('vue').WritableComputedRef<any, boolean>;
25
- computedValue: import('vue').WritableComputedRef<any, SelectValue>;
26
- computedInputValue: import('vue').WritableComputedRef<any, string>;
24
+ computedVisible: import('vue').WritableComputedRef<boolean, boolean>;
25
+ computedValue: import('vue').WritableComputedRef<SelectValue, SelectValue>;
26
+ computedInputValue: import('vue').WritableComputedRef<string, string>;
27
27
  selectOptions: import('vue').ComputedRef<{
28
28
  id: string;
29
29
  label: SelectValue | undefined;
@@ -23,11 +23,11 @@ declare const _default: () => {
23
23
  provide: (props: Props, emits: SliderEmits, trackRef: Ref<HTMLDivElement | undefined>) => {
24
24
  range: Ref<boolean, boolean>;
25
25
  direction: Ref<Direction, Direction>;
26
- startValue: import('vue').WritableComputedRef<any, any>;
27
- endValue: import('vue').WritableComputedRef<any, any>;
26
+ startValue: import('vue').WritableComputedRef<number, number>;
27
+ endValue: import('vue').WritableComputedRef<number, number>;
28
28
  tempStartValue: Ref<number, number>;
29
29
  tempEndValue: Ref<number, number>;
30
- computedValue: import('vue').WritableComputedRef<any, SliderValue>;
30
+ computedValue: import('vue').WritableComputedRef<SliderValue, SliderValue>;
31
31
  ticks: import('vue').ComputedRef<{
32
32
  label: number;
33
33
  value: number;
@@ -32,10 +32,11 @@ const useContext = () => {
32
32
  );
33
33
  const startValue = computed({
34
34
  get() {
35
- return range.value ? computedValue.value[0] : computedValue.value;
35
+ const value = range.value && isArray(computedValue.value) ? computedValue.value[0] : computedValue.value;
36
+ return value;
36
37
  },
37
38
  set(val) {
38
- if (range.value) {
39
+ if (range.value && isArray(computedValue.value)) {
39
40
  computedValue.value[0] = val;
40
41
  } else {
41
42
  computedValue.value = val;
@@ -46,10 +47,11 @@ const useContext = () => {
46
47
  const tempStartValue = ref(startValue.value);
47
48
  const endValue = computed({
48
49
  get() {
49
- return range.value ? computedValue.value[1] : computedValue.value;
50
+ const value = range.value && isArray(computedValue.value) ? computedValue.value[1] : computedValue.value;
51
+ return value;
50
52
  },
51
53
  set(val) {
52
- if (range.value) {
54
+ if (range.value && isArray(computedValue.value)) {
53
55
  computedValue.value[1] = val;
54
56
  } else {
55
57
  computedValue.value = val;