yc-design-vue 2.0.4 → 2.0.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.
- package/dist/index.umd.js +1 -0
- package/dist/style.css +1 -0
- package/es/Affix/index.vue.js +1 -1
- package/es/Anchor/Anchor.vue.js +2 -2
- package/es/Anchor/AnchorLink.vue.js +2 -2
- package/es/Anchor/hooks/useContext.d.ts +2 -2
- package/es/Anchor/hooks/useContext.js +3 -3
- package/es/AutoComplete/index.d.ts +24 -24
- package/es/AutoComplete/index.vue.d.ts +40 -40
- package/es/Avatar/Avatar.vue.js +3 -3
- package/es/Avatar/AvatarGroup.vue.js +2 -2
- package/es/Avatar/hooks/useContext.d.ts +1 -2
- package/es/Avatar/hooks/useContext.js +3 -3
- package/es/BackTop/index.vue.js +1 -1
- package/es/Breadcrumb/BreadcrumbSeparator.vue.js +1 -1
- package/es/Button/Button.vue.js +2 -2
- package/es/Button/ButtonGroup.vue.js +2 -2
- package/es/Button/hooks/useContext.d.ts +1 -2
- package/es/Button/hooks/useContext.js +3 -3
- package/es/Card/Card.vue.js +2 -2
- package/es/Card/CardMeta.vue.js +2 -2
- package/es/Card/hooks/useContext.d.ts +2 -2
- package/es/Card/hooks/useContext.js +3 -3
- package/es/Carousel/Carousel.vue.js +2 -2
- package/es/Carousel/CarouselArrow.vue.js +2 -2
- package/es/Carousel/CarouselIndicator.vue.js +2 -2
- package/es/Carousel/CarouselItem.vue.js +2 -2
- package/es/Carousel/hooks/useContext.d.ts +2 -2
- package/es/Carousel/hooks/useContext.js +3 -3
- package/es/Cascader/Cascader.vue.d.ts +18 -18
- package/es/Cascader/Cascader.vue.js +2 -2
- package/es/Cascader/CascaderIcon.vue.js +2 -2
- package/es/Cascader/CascaderOption.vue.js +2 -2
- package/es/Cascader/CascaderPanel.vue.js +2 -2
- package/es/Cascader/CascaderSearchPanel.vue.js +2 -2
- package/es/Cascader/hooks/useContext.d.ts +2 -2
- package/es/Cascader/hooks/useContext.js +3 -3
- package/es/Cascader/index.d.ts +21 -21
- package/es/Checkbox/Checkbox.vue.js +2 -2
- package/es/Checkbox/CheckboxGroup.vue.js +2 -2
- package/es/Checkbox/hooks/useContext.d.ts +2 -2
- package/es/Checkbox/hooks/useContext.js +3 -3
- package/es/Collapse/Collapse.vue.js +2 -2
- package/es/Collapse/CollapseItem.vue.js +2 -2
- package/es/Collapse/hooks/useContext.d.ts +1 -2
- package/es/Collapse/hooks/useContext.js +3 -3
- package/es/ColorPicker/ColorControl.vue.js +1 -1
- package/es/ColorPicker/ColorPalette.vue.js +1 -1
- package/es/ColorPicker/ColorPanel.vue.js +2 -2
- package/es/ColorPicker/ColorPicker.vue.js +2 -2
- package/es/ColorPicker/hooks/useContext.d.ts +2 -2
- package/es/ColorPicker/hooks/useContext.js +3 -3
- package/es/Comment/hooks/useContext.d.ts +1 -2
- package/es/Comment/hooks/useContext.js +3 -3
- package/es/Comment/index.vue.js +2 -2
- package/es/Descriptions/Descriptions.vue.js +2 -2
- package/es/Descriptions/ReuseItem.vue.js +2 -2
- package/es/Descriptions/ReuseTd.vue.js +2 -2
- package/es/Descriptions/hooks/useContext.d.ts +2 -2
- package/es/Descriptions/hooks/useContext.js +3 -3
- package/es/Dropdown/Doption.vue.js +2 -2
- package/es/Dropdown/Dropdown.vue.d.ts +2 -2
- package/es/Dropdown/Dropdown.vue.js +2 -2
- package/es/Dropdown/DropdownButton.vue.d.ts +2 -2
- package/es/Dropdown/Dsubmenu.vue.js +1 -1
- package/es/Dropdown/hooks/useContext.d.ts +2 -2
- package/es/Dropdown/hooks/useContext.js +3 -3
- package/es/Dropdown/index.d.ts +10 -10
- package/es/Grid/Grid.vue.js +2 -2
- package/es/Grid/GridCol.vue.js +2 -2
- package/es/Grid/GridItem.vue.js +2 -2
- package/es/Grid/GridRow.vue.js +2 -2
- package/es/Grid/hooks/useContext.d.ts +1 -2
- package/es/Grid/hooks/useContext.js +3 -3
- package/es/Image/Image.vue.js +2 -2
- package/es/Image/ImagePreview.vue.js +1 -1
- package/es/Image/ImagePreviewGroup.vue.js +2 -2
- package/es/Image/hooks/useContext.d.ts +2 -2
- package/es/Image/hooks/useContext.js +3 -3
- package/es/Input/Input.vue.d.ts +2 -2
- package/es/Input/InputSuffix.vue.js +2 -2
- package/es/Input/index.d.ts +5 -5
- package/es/InputNumber/InputNumber.vue.d.ts +14 -14
- package/es/InputNumber/index.d.ts +11 -11
- package/es/InputTag/index.d.ts +5 -5
- package/es/InputTag/index.vue.d.ts +2 -2
- package/es/InputTag/index.vue.js +1 -1
- package/es/Layout/LayoutSider.vue.js +2 -2
- package/es/Layout/hooks/useSiderContext.d.ts +1 -2
- package/es/Layout/hooks/useSiderContext.js +3 -3
- package/es/List/hooks/useScrollReach.js +1 -0
- package/es/Mention/index.d.ts +30 -30
- package/es/Mention/index.vue.d.ts +52 -52
- package/es/Menu/MenuItem.vue.js +1 -1
- package/es/Menu/hooks/useContext.d.ts +2 -2
- package/es/Menu/hooks/useContext.js +5 -5
- package/es/OverflowList/index.vue.js +2 -2
- package/es/Pagination/Pagination.vue.js +2 -2
- package/es/Pagination/PaginationItem.vue.js +2 -2
- package/es/Pagination/hooks/useContext.d.ts +2 -2
- package/es/Pagination/hooks/useContext.js +3 -3
- package/es/Popconfirm/index.d.ts +5 -5
- package/es/Popconfirm/index.vue.d.ts +2 -2
- package/es/Radio/Radio.vue.js +2 -2
- package/es/Radio/RadioGroup.vue.js +2 -2
- package/es/Radio/hooks/useContext.d.ts +2 -2
- package/es/Radio/hooks/useContext.js +3 -3
- package/es/Scrollbar/Scrollbar.vue.js +2 -2
- package/es/Scrollbar/ScrollbarTrack.vue.js +2 -2
- package/es/Scrollbar/hooks/useContext.d.ts +2 -2
- package/es/Scrollbar/hooks/useContext.js +3 -3
- package/es/Select/Option.vue.js +2 -2
- package/es/Select/Select.vue.d.ts +16 -16
- package/es/Select/Select.vue.js +2 -2
- package/es/Select/SelectIcon.vue.js +2 -2
- package/es/Select/SelectRealList.vue.js +2 -2
- package/es/Select/SelectView.vue.js +2 -2
- package/es/Select/SelectVirtualList.vue.js +3 -3
- package/es/Select/hooks/useContext.d.ts +2 -2
- package/es/Select/hooks/useContext.js +3 -3
- package/es/Select/index.d.ts +16 -16
- package/es/Slider/Slider.vue.js +2 -2
- package/es/Slider/SliderBtn.vue.js +2 -2
- package/es/Slider/SliderInput.vue.js +2 -2
- package/es/Slider/SliderTicks.vue.js +2 -2
- package/es/Slider/hooks/useContext.d.ts +2 -2
- package/es/Slider/hooks/useContext.js +3 -3
- package/es/Spin/index.vue.js +1 -1
- package/es/Steps/Step.vue.js +2 -2
- package/es/Steps/Steps.vue.js +2 -2
- package/es/Steps/hooks/useContext.d.ts +1 -2
- package/es/Steps/hooks/useContext.js +3 -3
- package/es/Switch/index.d.ts +5 -5
- package/es/Switch/index.vue.d.ts +2 -2
- package/es/Tabs/TabPane.vue.js +2 -2
- package/es/Tabs/Tabs.vue.js +2 -2
- package/es/Tabs/TabsNavInk.vue.js +2 -2
- package/es/Tabs/TabsTab.vue.js +2 -2
- package/es/Tabs/hooks/useContext.d.ts +2 -2
- package/es/Tabs/hooks/useContext.js +3 -3
- package/es/Textarea/hooks/useTextareaHeight.js +1 -1
- package/es/Textarea/index.d.ts +5 -5
- package/es/Textarea/index.vue.d.ts +2 -2
- package/es/TimePicker/TimePicker.vue.d.ts +4 -4
- package/es/TimePicker/TimePicker.vue.js +2 -2
- package/es/TimePicker/TimePickerPanel.vue.js +2 -2
- package/es/TimePicker/hooks/useContext.d.ts +2 -2
- package/es/TimePicker/hooks/useContext.js +3 -3
- package/es/TimePicker/index.d.ts +10 -10
- package/es/Timeline/Timeline.vue.js +2 -2
- package/es/Timeline/TimelineItem.vue.js +2 -2
- package/es/Timeline/hooks/useContext.d.ts +2 -2
- package/es/Timeline/hooks/useContext.js +3 -3
- package/es/Transfer/Transfer.vue.js +2 -2
- package/es/Transfer/TransferPanel.vue.js +2 -2
- package/es/Transfer/hooks/useContext.d.ts +2 -2
- package/es/Transfer/hooks/useContext.js +3 -3
- package/es/Trigger/hooks/useContext.d.ts +2 -3
- package/es/Trigger/hooks/useContext.js +4 -4
- package/es/Trigger/hooks/useTriggerPosition.js +1 -1
- package/es/Trigger/hooks/useTriggerVisible.js +2 -2
- package/es/Typography/TypographyBase.vue.d.ts +12 -12
- package/es/Typography/TypographyBase.vue.js +3 -3
- package/es/Watermark/index.vue.js +1 -1
- package/es/_shared/icons/IconCopy.vue.js +19 -1
- package/es/_shared/icons/IconCopy.vue2.js +1 -19
- package/es/_shared/icons/IconEdit.vue.js +19 -1
- package/es/_shared/icons/IconEdit.vue2.js +1 -19
- package/es/_shared/icons/IconEyeClose.vue.js +1 -23
- package/es/_shared/icons/IconEyeClose.vue2.js +23 -1
- package/es/_shared/icons/IconEyeOpen.vue.js +1 -20
- package/es/_shared/icons/IconEyeOpen.vue2.js +20 -1
- package/es/_shared/icons/IconSeparator.vue.js +1 -19
- package/es/_shared/icons/IconSeparator.vue2.js +19 -1
- package/es/_shared/utils/is.d.ts +0 -15
- package/es/_shared/utils/vue-utils.d.ts +1 -0
- package/es/index.d.ts +5 -5
- package/lib/Affix/index.vue.js +1 -1
- package/lib/Anchor/hooks/useContext.d.ts +2 -2
- package/lib/Anchor/hooks/useContext.js +1 -1
- package/lib/AutoComplete/index.d.ts +24 -24
- package/lib/AutoComplete/index.vue.d.ts +40 -40
- package/lib/Avatar/Avatar.vue.js +1 -1
- package/lib/Avatar/hooks/useContext.d.ts +1 -2
- package/lib/Avatar/hooks/useContext.js +1 -1
- package/lib/BackTop/index.vue.js +1 -1
- package/lib/Breadcrumb/BreadcrumbSeparator.vue.js +1 -1
- package/lib/Button/hooks/useContext.d.ts +1 -2
- package/lib/Button/hooks/useContext.js +1 -1
- package/lib/Card/hooks/useContext.d.ts +2 -2
- package/lib/Card/hooks/useContext.js +1 -1
- package/lib/Carousel/hooks/useContext.d.ts +2 -2
- package/lib/Carousel/hooks/useContext.js +1 -1
- package/lib/Cascader/Cascader.vue.d.ts +18 -18
- package/lib/Cascader/hooks/useContext.d.ts +2 -2
- package/lib/Cascader/hooks/useContext.js +1 -1
- package/lib/Cascader/index.d.ts +21 -21
- package/lib/Checkbox/hooks/useContext.d.ts +2 -2
- package/lib/Checkbox/hooks/useContext.js +1 -1
- package/lib/Collapse/hooks/useContext.d.ts +1 -2
- package/lib/Collapse/hooks/useContext.js +1 -1
- package/lib/ColorPicker/ColorControl.vue.js +1 -1
- package/lib/ColorPicker/ColorPalette.vue.js +1 -1
- package/lib/ColorPicker/hooks/useContext.d.ts +2 -2
- package/lib/ColorPicker/hooks/useContext.js +1 -1
- package/lib/Comment/hooks/useContext.d.ts +1 -2
- package/lib/Comment/hooks/useContext.js +1 -1
- package/lib/Descriptions/hooks/useContext.d.ts +2 -2
- package/lib/Descriptions/hooks/useContext.js +1 -1
- package/lib/Dropdown/Dropdown.vue.d.ts +2 -2
- package/lib/Dropdown/DropdownButton.vue.d.ts +2 -2
- package/lib/Dropdown/Dsubmenu.vue.js +1 -1
- package/lib/Dropdown/hooks/useContext.d.ts +2 -2
- package/lib/Dropdown/hooks/useContext.js +1 -1
- package/lib/Dropdown/index.d.ts +10 -10
- package/lib/Grid/hooks/useContext.d.ts +1 -2
- package/lib/Grid/hooks/useContext.js +1 -1
- package/lib/Image/ImagePreview.vue.js +1 -1
- package/lib/Image/hooks/useContext.d.ts +2 -2
- package/lib/Image/hooks/useContext.js +1 -1
- package/lib/Input/Input.vue.d.ts +2 -2
- package/lib/Input/InputSuffix.vue.js +1 -1
- package/lib/Input/index.d.ts +5 -5
- package/lib/InputNumber/InputNumber.vue.d.ts +14 -14
- package/lib/InputNumber/index.d.ts +11 -11
- package/lib/InputTag/index.d.ts +5 -5
- package/lib/InputTag/index.vue.d.ts +2 -2
- package/lib/InputTag/index.vue.js +1 -1
- package/lib/Layout/hooks/useSiderContext.d.ts +1 -2
- package/lib/Layout/hooks/useSiderContext.js +1 -1
- package/lib/List/hooks/useScrollReach.js +1 -1
- package/lib/Mention/index.d.ts +30 -30
- package/lib/Mention/index.vue.d.ts +52 -52
- package/lib/Menu/MenuItem.vue.js +1 -1
- package/lib/Menu/hooks/useContext.d.ts +2 -2
- package/lib/Menu/hooks/useContext.js +1 -1
- package/lib/OverflowList/index.vue.js +1 -1
- package/lib/Pagination/hooks/useContext.d.ts +2 -2
- package/lib/Pagination/hooks/useContext.js +1 -1
- package/lib/Popconfirm/index.d.ts +5 -5
- package/lib/Popconfirm/index.vue.d.ts +2 -2
- package/lib/Radio/hooks/useContext.d.ts +2 -2
- package/lib/Radio/hooks/useContext.js +1 -1
- package/lib/Scrollbar/hooks/useContext.d.ts +2 -2
- package/lib/Scrollbar/hooks/useContext.js +1 -1
- package/lib/Select/Select.vue.d.ts +16 -16
- package/lib/Select/SelectVirtualList.vue.js +1 -1
- package/lib/Select/hooks/useContext.d.ts +2 -2
- package/lib/Select/hooks/useContext.js +1 -1
- package/lib/Select/index.d.ts +16 -16
- package/lib/Slider/hooks/useContext.d.ts +2 -2
- package/lib/Slider/hooks/useContext.js +1 -1
- package/lib/Spin/index.vue.js +1 -1
- package/lib/Steps/hooks/useContext.d.ts +1 -2
- package/lib/Steps/hooks/useContext.js +1 -1
- package/lib/Switch/index.d.ts +5 -5
- package/lib/Switch/index.vue.d.ts +2 -2
- package/lib/Tabs/hooks/useContext.d.ts +2 -2
- package/lib/Tabs/hooks/useContext.js +1 -1
- package/lib/Textarea/hooks/useTextareaHeight.js +1 -1
- package/lib/Textarea/index.d.ts +5 -5
- package/lib/Textarea/index.vue.d.ts +2 -2
- package/lib/TimePicker/TimePicker.vue.d.ts +4 -4
- package/lib/TimePicker/hooks/useContext.d.ts +2 -2
- package/lib/TimePicker/hooks/useContext.js +1 -1
- package/lib/TimePicker/index.d.ts +10 -10
- package/lib/Timeline/hooks/useContext.d.ts +2 -2
- package/lib/Timeline/hooks/useContext.js +1 -1
- package/lib/Transfer/hooks/useContext.d.ts +2 -2
- package/lib/Transfer/hooks/useContext.js +1 -1
- package/lib/Trigger/hooks/useContext.d.ts +2 -3
- package/lib/Trigger/hooks/useContext.js +1 -1
- package/lib/Trigger/hooks/useTriggerPosition.js +1 -1
- package/lib/Trigger/hooks/useTriggerVisible.js +1 -1
- package/lib/Typography/TypographyBase.vue.d.ts +12 -12
- package/lib/Typography/TypographyBase.vue.js +1 -1
- package/lib/Watermark/index.vue.js +1 -1
- package/lib/_shared/icons/IconCopy.vue.js +1 -1
- package/lib/_shared/icons/IconCopy.vue2.js +1 -1
- package/lib/_shared/icons/IconEdit.vue.js +1 -1
- package/lib/_shared/icons/IconEdit.vue2.js +1 -1
- package/lib/_shared/icons/IconEyeClose.vue.js +1 -1
- package/lib/_shared/icons/IconEyeClose.vue2.js +1 -1
- package/lib/_shared/icons/IconEyeOpen.vue.js +1 -1
- package/lib/_shared/icons/IconEyeOpen.vue2.js +1 -1
- package/lib/_shared/icons/IconSeparator.vue.js +1 -1
- package/lib/_shared/icons/IconSeparator.vue2.js +1 -1
- package/lib/_shared/utils/is.d.ts +0 -15
- package/lib/_shared/utils/vue-utils.d.ts +1 -0
- package/lib/index.d.ts +5 -5
- package/package.json +1 -1
@@ -12,7 +12,7 @@ export type CollapseContext = {
|
|
12
12
|
};
|
13
13
|
export type CollapseProps = Required<_CollapseProps>;
|
14
14
|
export type CollapseItemProps = Required<_CollapseItemProps>;
|
15
|
-
|
15
|
+
export default function useCollapseContext(): {
|
16
16
|
provide: (props: RecordType, emits: CollapseEmits) => void;
|
17
17
|
inject: (props: RecordType) => {
|
18
18
|
showExpandIcon: import('vue').ComputedRef<boolean>;
|
@@ -23,4 +23,3 @@ declare const _default: () => {
|
|
23
23
|
slots: Slots;
|
24
24
|
};
|
25
25
|
};
|
26
|
-
export default _default;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { toRefs, useSlots, provide, inject, ref, computed } from "vue";
|
2
2
|
import { useControlValue } from "../../_shared/utils/control.js";
|
3
3
|
const COLLAPSE_CONTEXT_KEY = "collapse-context";
|
4
|
-
|
4
|
+
function useCollapseContext() {
|
5
5
|
const provide$1 = (props, emits) => {
|
6
6
|
const {
|
7
7
|
activeKey,
|
@@ -56,8 +56,8 @@ const useContext = () => {
|
|
56
56
|
provide: provide$1,
|
57
57
|
inject: inject$1
|
58
58
|
};
|
59
|
-
}
|
59
|
+
}
|
60
60
|
export {
|
61
61
|
COLLAPSE_CONTEXT_KEY,
|
62
|
-
|
62
|
+
useCollapseContext as default
|
63
63
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { defineComponent, toRefs, ref, watch, createElementBlock, openBlock, normalizeStyle, unref, createElementVNode } from "vue";
|
2
|
-
import { useDraggable } from "../node_modules/@vueuse/core/index.js";
|
3
2
|
import { sleep, valueToPx } from "../_shared/utils/dom.js";
|
3
|
+
import { useDraggable } from "../node_modules/@vueuse/core/index.js";
|
4
4
|
import { parseColor, GradientColorCalculator } from "../_shared/utils/color.js";
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
6
6
|
__name: "ColorControl",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { defineComponent, toRefs, ref, computed, watch, createElementBlock, openBlock, normalizeStyle, unref, createElementVNode } from "vue";
|
2
|
-
import { useElementBounding, useDraggable } from "../node_modules/@vueuse/core/index.js";
|
3
2
|
import { sleep, valueToPx } from "../_shared/utils/dom.js";
|
3
|
+
import { useElementBounding, useDraggable } from "../node_modules/@vueuse/core/index.js";
|
4
4
|
import { parseColor } from "../_shared/utils/color.js";
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
6
6
|
__name: "ColorPalette",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { defineComponent, ref, createElementBlock, openBlock, normalizeClass, unref, createVNode, createElementVNode, createCommentVNode, isRef, normalizeStyle, createBlock } from "vue";
|
2
2
|
import { useI18n } from "../_shared/utils/locale.js";
|
3
|
-
import
|
3
|
+
import useColorPickerContext from "./hooks/useContext.js";
|
4
4
|
import _sfc_main$1 from "./ColorPalette.vue.js";
|
5
5
|
/* empty css */
|
6
6
|
import _sfc_main$3 from "./ColorInput.vue.js";
|
@@ -31,7 +31,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
31
31
|
hideTrigger,
|
32
32
|
presetColors,
|
33
33
|
historyColors
|
34
|
-
} =
|
34
|
+
} = useColorPickerContext().inject();
|
35
35
|
const { t } = useI18n();
|
36
36
|
const colorBarRef = ref();
|
37
37
|
const alphaBarRef = ref();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { defineComponent, createBlock, openBlock, unref, mergeProps, isRef, withCtx, renderSlot, createElementVNode, normalizeStyle, normalizeClass, createElementBlock, createCommentVNode, toDisplayString, createVNode } from "vue";
|
2
2
|
import { COLOR_PICKER_PRESET_COLORS } from "../_shared/constants/index.js";
|
3
|
-
import
|
3
|
+
import useColorPickerContext from "./hooks/useContext.js";
|
4
4
|
import _sfc_main$1 from "./ColorPanel.vue.js";
|
5
5
|
/* empty css */
|
6
6
|
import Trigger from "../Trigger/index.js";
|
@@ -34,7 +34,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
34
34
|
setup(__props, { emit: __emit }) {
|
35
35
|
const props = __props;
|
36
36
|
const emits = __emit;
|
37
|
-
const { popupVisible, computedColor, size } =
|
37
|
+
const { popupVisible, computedColor, size } = useColorPickerContext().provide(
|
38
38
|
props,
|
39
39
|
emits
|
40
40
|
);
|
@@ -16,7 +16,7 @@ type ColorPickerContext = {
|
|
16
16
|
presetColors: Ref<string[]>;
|
17
17
|
emits: ColorPickerEmits;
|
18
18
|
};
|
19
|
-
|
19
|
+
export default function useColorPickerContext(): {
|
20
20
|
provide: (props: RecordType, emits: ColorPickerEmits) => {
|
21
21
|
popupVisible: Ref<boolean, boolean>;
|
22
22
|
size: import('vue').ComputedRef<any>;
|
@@ -24,4 +24,4 @@ declare const _default: () => {
|
|
24
24
|
};
|
25
25
|
inject: () => ColorPickerContext;
|
26
26
|
};
|
27
|
-
export
|
27
|
+
export {};
|
@@ -3,7 +3,7 @@ import { parseColor } from "../../_shared/utils/color.js";
|
|
3
3
|
import { getGlobalConfig } from "../../_shared/utils/global-config.js";
|
4
4
|
import { useControlValue } from "../../_shared/utils/control.js";
|
5
5
|
const COLOR_PICKER_CONTEXT_KEY = "color-picker-context";
|
6
|
-
|
6
|
+
function useColorPickerContext() {
|
7
7
|
const provide$1 = (props, emits) => {
|
8
8
|
const {
|
9
9
|
modelValue,
|
@@ -84,7 +84,7 @@ const useContext = () => {
|
|
84
84
|
provide: provide$1,
|
85
85
|
inject: inject$1
|
86
86
|
};
|
87
|
-
}
|
87
|
+
}
|
88
88
|
export {
|
89
|
-
|
89
|
+
useColorPickerContext as default
|
90
90
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { inject, reactive, computed, onBeforeUnmount, provide } from "vue";
|
2
2
|
import { nanoid } from "../../node_modules/nanoid/index.browser.js";
|
3
3
|
const COMMENT_CONTEXT_KEY = "comment-context";
|
4
|
-
|
4
|
+
function useCommentContext() {
|
5
5
|
const { depths } = inject(COMMENT_CONTEXT_KEY, {
|
6
6
|
depths: reactive(/* @__PURE__ */ new Map())
|
7
7
|
});
|
@@ -17,7 +17,7 @@ const useContext = () => {
|
|
17
17
|
return {
|
18
18
|
hasChildren
|
19
19
|
};
|
20
|
-
}
|
20
|
+
}
|
21
21
|
export {
|
22
|
-
|
22
|
+
useCommentContext as default
|
23
23
|
};
|
package/es/Comment/index.vue.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { defineComponent, useSlots, createElementBlock, openBlock, createCommentVNode, createElementVNode, renderSlot, createVNode, unref, normalizeClass, createTextVNode, toDisplayString } from "vue";
|
2
2
|
import { isObject } from "../_shared/utils/is.js";
|
3
|
-
import
|
3
|
+
import useCommentContext from "./hooks/useContext.js";
|
4
4
|
import Avatar from "../Avatar/index.js";
|
5
5
|
const _hoisted_1 = {
|
6
6
|
Comment: "",
|
@@ -42,7 +42,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
42
42
|
},
|
43
43
|
setup(__props) {
|
44
44
|
const $slots = useSlots();
|
45
|
-
const { hasChildren } =
|
45
|
+
const { hasChildren } = useCommentContext();
|
46
46
|
return (_ctx, _cache) => {
|
47
47
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
48
48
|
$slots.avatar || _ctx.avatar ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
@@ -3,7 +3,7 @@ import _sfc_main$1 from "./ReuseTd.vue.js";
|
|
3
3
|
/* empty css */
|
4
4
|
import _sfc_main$2 from "./ReuseItem.vue.js";
|
5
5
|
/* empty css */
|
6
|
-
import
|
6
|
+
import useDescContext from "./hooks/useContext.js";
|
7
7
|
const _hoisted_1 = {
|
8
8
|
key: 0,
|
9
9
|
class: "yc-descriptions-title"
|
@@ -36,7 +36,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
36
36
|
setup(__props) {
|
37
37
|
const $slots = useSlots();
|
38
38
|
const props = __props;
|
39
|
-
const { column, size, data, layout } =
|
39
|
+
const { column, size, data, layout } = useDescContext().provide(props);
|
40
40
|
const renderArr = computed(() => {
|
41
41
|
var _a, _b;
|
42
42
|
let count = 0;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { defineComponent, createElementBlock, openBlock, createElementVNode, normalizeStyle, unref, createBlock, resolveDynamicComponent } from "vue";
|
2
2
|
import { isObject } from "../_shared/utils/is.js";
|
3
3
|
import { getSlotFunction } from "../_shared/utils/vue-utils.js";
|
4
|
-
import
|
4
|
+
import useDescContext from "./hooks/useContext.js";
|
5
5
|
const _hoisted_1 = { class: "yc-descriptions-item" };
|
6
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
7
7
|
__name: "ReuseItem",
|
@@ -10,7 +10,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
10
|
index: {}
|
11
11
|
},
|
12
12
|
setup(__props) {
|
13
|
-
const { labelStyle, valueStyle, slots, align } =
|
13
|
+
const { labelStyle, valueStyle, slots, align } = useDescContext().inject();
|
14
14
|
return (_ctx, _cache) => {
|
15
15
|
var _a, _b, _c, _d;
|
16
16
|
return openBlock(), createElementBlock("td", _hoisted_1, [
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { defineComponent, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createBlock, resolveDynamicComponent } from "vue";
|
2
2
|
import { isObject } from "../_shared/utils/is.js";
|
3
3
|
import { getSlotFunction } from "../_shared/utils/vue-utils.js";
|
4
|
-
import
|
4
|
+
import useDescContext from "./hooks/useContext.js";
|
5
5
|
const _hoisted_1 = ["colspan"];
|
6
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
7
7
|
__name: "ReuseTd",
|
@@ -12,7 +12,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
12
|
colspan: {}
|
13
13
|
},
|
14
14
|
setup(__props) {
|
15
|
-
const { labelStyle, valueStyle, bordered, size, align, slots } =
|
15
|
+
const { labelStyle, valueStyle, bordered, size, align, slots } = useDescContext().inject();
|
16
16
|
return (_ctx, _cache) => {
|
17
17
|
var _a, _b, _c, _d;
|
18
18
|
return openBlock(), createElementBlock("td", {
|
@@ -9,7 +9,7 @@ type DescriptionsContext = {
|
|
9
9
|
size: Ref<Size>;
|
10
10
|
slots: Slots;
|
11
11
|
};
|
12
|
-
|
12
|
+
export default function useDescContext(): {
|
13
13
|
provide: (props: RecordType) => {
|
14
14
|
data: import('vue').ComputedRef<DescData[]>;
|
15
15
|
size: import('vue').ComputedRef<any>;
|
@@ -18,4 +18,4 @@ declare const _default: () => {
|
|
18
18
|
};
|
19
19
|
inject: () => DescriptionsContext;
|
20
20
|
};
|
21
|
-
export
|
21
|
+
export {};
|
@@ -4,7 +4,7 @@ import { getGlobalConfig } from "../../_shared/utils/global-config.js";
|
|
4
4
|
import { findComponentsFromVnodes } from "../../_shared/utils/vue-utils.js";
|
5
5
|
import _sfc_main from "../DescriptionsItem.vue.js";
|
6
6
|
const DESCRIPTIONS_CONTEXT_KEY = "radio-group-context";
|
7
|
-
|
7
|
+
function useDescContext() {
|
8
8
|
const provide$1 = (props) => {
|
9
9
|
const {
|
10
10
|
data: _data,
|
@@ -69,7 +69,7 @@ const useContext = () => {
|
|
69
69
|
provide: provide$1,
|
70
70
|
inject: inject$1
|
71
71
|
};
|
72
|
-
}
|
72
|
+
}
|
73
73
|
export {
|
74
|
-
|
74
|
+
useDescContext as default
|
75
75
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { defineComponent, useSlots, toRefs, createElementBlock, openBlock, normalizeClass, unref, createCommentVNode, createElementVNode, renderSlot } from "vue";
|
2
|
-
import
|
2
|
+
import useDropdownContext from "./hooks/useContext.js";
|
3
3
|
const _hoisted_1 = {
|
4
4
|
key: 0,
|
5
5
|
class: "yc-dropdown-option-icon"
|
@@ -26,7 +26,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
26
26
|
const props = __props;
|
27
27
|
const emits = __emit;
|
28
28
|
const { value: optionValue, disabled, isSubmenu } = toRefs(props);
|
29
|
-
const { select } =
|
29
|
+
const { select } = useDropdownContext().inject();
|
30
30
|
const handleClick = (ev) => {
|
31
31
|
if (disabled.value) return;
|
32
32
|
emits("click", ev);
|
@@ -10,13 +10,13 @@ declare const __VLS_component: import('vue').DefineComponent<DropdownProps, {
|
|
10
10
|
show(): void;
|
11
11
|
hide(): void;
|
12
12
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
13
|
+
select: (value: DoptionValue, ev: MouseEvent) => any;
|
13
14
|
"update:popupVisible": (value: boolean) => any;
|
14
15
|
"popup-visible-change": (value: boolean) => any;
|
15
|
-
select: (value: DoptionValue, ev: MouseEvent) => any;
|
16
16
|
}, string, import('vue').PublicProps, Readonly<DropdownProps> & Readonly<{
|
17
|
+
onSelect?: ((value: DoptionValue, ev: MouseEvent) => any) | undefined;
|
17
18
|
"onUpdate:popupVisible"?: ((value: boolean) => any) | undefined;
|
18
19
|
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
19
|
-
onSelect?: ((value: DoptionValue, ev: MouseEvent) => any) | undefined;
|
20
20
|
}>, {
|
21
21
|
popupContainer: import('..').PopupContainer;
|
22
22
|
trigger: import('../Trigger').TriggerType;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { defineComponent, useSlots, toRefs, computed, createBlock, openBlock, unref, mergeProps, isRef, withCtx, renderSlot, createElementVNode, createVNode, createElementBlock, createCommentVNode, normalizeStyle } from "vue";
|
2
2
|
import { isBoolean, isUndefined } from "../_shared/utils/is.js";
|
3
3
|
import { valueToPx } from "../_shared/utils/dom.js";
|
4
|
-
import
|
4
|
+
import useDropdownContext from "./hooks/useContext.js";
|
5
5
|
import Trigger from "../Trigger/index.js";
|
6
6
|
import Scrollbar from "../Scrollbar/index.js";
|
7
7
|
const _hoisted_1 = { class: "yc-dropdown" };
|
@@ -38,7 +38,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
38
38
|
position: _position,
|
39
39
|
popupMaxHeight: _popupMaxHeight
|
40
40
|
} = toRefs(props);
|
41
|
-
const { computedVisible } =
|
41
|
+
const { computedVisible } = useDropdownContext().provide(props, emits);
|
42
42
|
const position = computed(() => {
|
43
43
|
return ["top", "tl", "tr", "bottom", "bl", "br"].includes(_position.value) ? _position.value : "bottom";
|
44
44
|
});
|
@@ -8,12 +8,12 @@ declare function __VLS_template(): {
|
|
8
8
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
9
9
|
declare const __VLS_component: import('vue').DefineComponent<DropdownButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
10
10
|
click: (ev: MouseEvent) => any;
|
11
|
-
"popup-visible-change": (value: boolean) => any;
|
12
11
|
select: (value: DoptionValue) => any;
|
12
|
+
"popup-visible-change": (value: boolean) => any;
|
13
13
|
}, string, import('vue').PublicProps, Readonly<DropdownButtonProps> & Readonly<{
|
14
14
|
onClick?: ((ev: MouseEvent) => any) | undefined;
|
15
|
-
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
16
15
|
onSelect?: ((value: DoptionValue) => any) | undefined;
|
16
|
+
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
17
17
|
}>, {
|
18
18
|
size: import('..').Size;
|
19
19
|
type: import('../Button').ButtonType;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { defineComponent, useSlots, toRefs, ref, computed, createBlock, openBlock, unref, mergeProps, isRef, withCtx, createVNode, normalizeStyle, normalizeClass, renderSlot, createElementVNode, createElementBlock, createCommentVNode, nextTick } from "vue";
|
2
|
-
import { unrefElement } from "../node_modules/@vueuse/core/index.js";
|
3
2
|
import { isBoolean, isUndefined } from "../_shared/utils/is.js";
|
4
3
|
import { valueToPx } from "../_shared/utils/dom.js";
|
5
4
|
import { useControlValue } from "../_shared/utils/control.js";
|
5
|
+
import { unrefElement } from "../node_modules/@vueuse/core/index.js";
|
6
6
|
/* empty css */
|
7
7
|
/* empty css */
|
8
8
|
/* empty css */
|
@@ -3,10 +3,10 @@ import { RecordType } from '../../_shared/type';
|
|
3
3
|
type DropdownContext = {
|
4
4
|
select: (value: DoptionValue, ev: MouseEvent) => void;
|
5
5
|
};
|
6
|
-
|
6
|
+
export default function useDropdownContext(): {
|
7
7
|
provide: (props: RecordType, emits: DropdownEmits) => {
|
8
8
|
computedVisible: import('vue').WritableComputedRef<boolean, boolean>;
|
9
9
|
};
|
10
10
|
inject: () => DropdownContext;
|
11
11
|
};
|
12
|
-
export
|
12
|
+
export {};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { toRefs, provide, inject } from "vue";
|
2
2
|
import { useControlValue } from "../../_shared/utils/control.js";
|
3
3
|
const DROPDOWN_CONTEXT_KEY = "dropdown-context";
|
4
|
-
|
4
|
+
function useDropdownContext() {
|
5
5
|
const provide$1 = (props, emits) => {
|
6
6
|
const {
|
7
7
|
popupVisible,
|
@@ -38,7 +38,7 @@ const useContext = () => {
|
|
38
38
|
provide: provide$1,
|
39
39
|
inject: inject$1
|
40
40
|
};
|
41
|
-
}
|
41
|
+
}
|
42
42
|
export {
|
43
|
-
|
43
|
+
useDropdownContext as default
|
44
44
|
};
|
package/es/Dropdown/index.d.ts
CHANGED
@@ -12,16 +12,16 @@ export type DsubmenuInstance = InstanceType<typeof _Dsubmenu>;
|
|
12
12
|
export * from './type';
|
13
13
|
declare const Dropdown: {
|
14
14
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./type').DropdownProps> & Readonly<{
|
15
|
+
onSelect?: ((value: import('./type').DoptionValue, ev: MouseEvent) => any) | undefined;
|
15
16
|
"onUpdate:popupVisible"?: ((value: boolean) => any) | undefined;
|
16
17
|
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
17
|
-
onSelect?: ((value: import('./type').DoptionValue, ev: MouseEvent) => any) | undefined;
|
18
18
|
}>, {
|
19
19
|
show(): void;
|
20
20
|
hide(): void;
|
21
21
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
22
|
+
select: (value: import('./type').DoptionValue, ev: MouseEvent) => any;
|
22
23
|
"update:popupVisible": (value: boolean) => any;
|
23
24
|
"popup-visible-change": (value: boolean) => any;
|
24
|
-
select: (value: import('./type').DoptionValue, ev: MouseEvent) => any;
|
25
25
|
}, import('vue').PublicProps, {
|
26
26
|
popupContainer: import('..').PopupContainer;
|
27
27
|
trigger: import('..').TriggerType;
|
@@ -40,9 +40,9 @@ declare const Dropdown: {
|
|
40
40
|
M: {};
|
41
41
|
Defaults: {};
|
42
42
|
}, Readonly<import('./type').DropdownProps> & Readonly<{
|
43
|
+
onSelect?: ((value: import('./type').DoptionValue, ev: MouseEvent) => any) | undefined;
|
43
44
|
"onUpdate:popupVisible"?: ((value: boolean) => any) | undefined;
|
44
45
|
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
45
|
-
onSelect?: ((value: import('./type').DoptionValue, ev: MouseEvent) => any) | undefined;
|
46
46
|
}>, {
|
47
47
|
show(): void;
|
48
48
|
hide(): void;
|
@@ -61,16 +61,16 @@ declare const Dropdown: {
|
|
61
61
|
__isTeleport?: never;
|
62
62
|
__isSuspense?: never;
|
63
63
|
} & import('vue').ComponentOptionsBase<Readonly<import('./type').DropdownProps> & Readonly<{
|
64
|
+
onSelect?: ((value: import('./type').DoptionValue, ev: MouseEvent) => any) | undefined;
|
64
65
|
"onUpdate:popupVisible"?: ((value: boolean) => any) | undefined;
|
65
66
|
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
66
|
-
onSelect?: ((value: import('./type').DoptionValue, ev: MouseEvent) => any) | undefined;
|
67
67
|
}>, {
|
68
68
|
show(): void;
|
69
69
|
hide(): void;
|
70
70
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
71
|
+
select: (value: import('./type').DoptionValue, ev: MouseEvent) => any;
|
71
72
|
"update:popupVisible": (value: boolean) => any;
|
72
73
|
"popup-visible-change": (value: boolean) => any;
|
73
|
-
select: (value: import('./type').DoptionValue, ev: MouseEvent) => any;
|
74
74
|
}, string, {
|
75
75
|
popupContainer: import('..').PopupContainer;
|
76
76
|
trigger: import('..').TriggerType;
|
@@ -139,12 +139,12 @@ declare const Dropdown: {
|
|
139
139
|
button: {
|
140
140
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./type').DropdownButtonProps> & Readonly<{
|
141
141
|
onClick?: ((ev: MouseEvent) => any) | undefined;
|
142
|
-
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
143
142
|
onSelect?: ((value: import('./type').DoptionValue) => any) | undefined;
|
143
|
+
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
144
144
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
145
145
|
click: (ev: MouseEvent) => any;
|
146
|
-
"popup-visible-change": (value: boolean) => any;
|
147
146
|
select: (value: import('./type').DoptionValue) => any;
|
147
|
+
"popup-visible-change": (value: boolean) => any;
|
148
148
|
}, import('vue').PublicProps, {
|
149
149
|
size: import('..').Size;
|
150
150
|
type: import('..').ButtonType;
|
@@ -165,8 +165,8 @@ declare const Dropdown: {
|
|
165
165
|
Defaults: {};
|
166
166
|
}, Readonly<import('./type').DropdownButtonProps> & Readonly<{
|
167
167
|
onClick?: ((ev: MouseEvent) => any) | undefined;
|
168
|
-
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
169
168
|
onSelect?: ((value: import('./type').DoptionValue) => any) | undefined;
|
169
|
+
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
170
170
|
}>, {}, {}, {}, {}, {
|
171
171
|
size: import('..').Size;
|
172
172
|
type: import('..').ButtonType;
|
@@ -184,12 +184,12 @@ declare const Dropdown: {
|
|
184
184
|
__isSuspense?: never;
|
185
185
|
} & import('vue').ComponentOptionsBase<Readonly<import('./type').DropdownButtonProps> & Readonly<{
|
186
186
|
onClick?: ((ev: MouseEvent) => any) | undefined;
|
187
|
-
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
188
187
|
onSelect?: ((value: import('./type').DoptionValue) => any) | undefined;
|
188
|
+
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
189
189
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
190
190
|
click: (ev: MouseEvent) => any;
|
191
|
-
"popup-visible-change": (value: boolean) => any;
|
192
191
|
select: (value: import('./type').DoptionValue) => any;
|
192
|
+
"popup-visible-change": (value: boolean) => any;
|
193
193
|
}, string, {
|
194
194
|
size: import('..').Size;
|
195
195
|
type: import('..').ButtonType;
|
package/es/Grid/Grid.vue.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { defineComponent, createElementBlock, openBlock, normalizeStyle, unref, renderSlot } from "vue";
|
2
2
|
import { mediaQueryHandler, valueToPx } from "../_shared/utils/dom.js";
|
3
|
-
import
|
3
|
+
import useGridContext from "./hooks/useContext.js";
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
5
5
|
...{
|
6
6
|
name: "Grid"
|
@@ -15,7 +15,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
15
|
},
|
16
16
|
setup(__props) {
|
17
17
|
const props = __props;
|
18
|
-
const { breakpoint, cols, rowGap, colGap } =
|
18
|
+
const { breakpoint, cols, rowGap, colGap } = useGridContext().provide(props);
|
19
19
|
mediaQueryHandler((name) => {
|
20
20
|
breakpoint.value = name;
|
21
21
|
});
|
package/es/Grid/GridCol.vue.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { defineComponent, toRefs, computed, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, renderSlot } from "vue";
|
2
2
|
import { getBreakpointValue, valueToPx } from "../_shared/utils/dom.js";
|
3
3
|
import { isString } from "../_shared/utils/is.js";
|
4
|
-
import
|
4
|
+
import useGridContext from "./hooks/useContext.js";
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
6
6
|
...{
|
7
7
|
name: "Col"
|
@@ -16,7 +16,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
16
|
setup(__props) {
|
17
17
|
const props = __props;
|
18
18
|
const { span, order, offset, flex } = toRefs(props);
|
19
|
-
const { gutter, div, breakpoint } =
|
19
|
+
const { gutter, div, breakpoint } = useGridContext().inject();
|
20
20
|
const style = computed(() => {
|
21
21
|
const curFlex = getBreakpointValue(breakpoint.value, flex.value);
|
22
22
|
const curSpan = getBreakpointValue(
|
package/es/Grid/GridItem.vue.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { defineComponent, toRefs, computed, withDirectives, createElementBlock, openBlock, normalizeStyle, renderSlot, vShow } from "vue";
|
2
2
|
import { getBreakpointValue, valueToPx } from "../_shared/utils/dom.js";
|
3
|
-
import
|
3
|
+
import useGridContext from "./hooks/useContext.js";
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
5
5
|
...{
|
6
6
|
name: "GridItem"
|
@@ -22,7 +22,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
22
22
|
spanMap,
|
23
23
|
breakpoint,
|
24
24
|
collectSpan
|
25
|
-
} =
|
25
|
+
} = useGridContext().inject();
|
26
26
|
const offset = computed(() => {
|
27
27
|
return getBreakpointValue(breakpoint.value, _offset.value);
|
28
28
|
});
|
package/es/Grid/GridRow.vue.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { defineComponent, toRefs, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, renderSlot } from "vue";
|
2
2
|
import { mediaQueryHandler, valueToPx } from "../_shared/utils/dom.js";
|
3
|
-
import
|
3
|
+
import useGridContext from "./hooks/useContext.js";
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
5
5
|
...{
|
6
6
|
name: "Row"
|
@@ -16,7 +16,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
16
|
setup(__props) {
|
17
17
|
const props = __props;
|
18
18
|
const { div, wrap, justify, align } = toRefs(props);
|
19
|
-
const { breakpoint, gutter } =
|
19
|
+
const { breakpoint, gutter } = useGridContext().provide(props);
|
20
20
|
mediaQueryHandler((name) => {
|
21
21
|
breakpoint.value = name;
|
22
22
|
});
|
@@ -18,7 +18,7 @@ export type SpanMap = Map<string, {
|
|
18
18
|
suffix: boolean;
|
19
19
|
}>;
|
20
20
|
export type GutterValue = GridRowGutter | [GridRowGutter, GridRowGutter];
|
21
|
-
|
21
|
+
export default function useGridContext(): {
|
22
22
|
provide: (props: RecordType) => {
|
23
23
|
breakpoint: Ref<BreakpointName, BreakpointName>;
|
24
24
|
cols: import('vue').ComputedRef<number>;
|
@@ -40,4 +40,3 @@ declare const _default: () => {
|
|
40
40
|
collapsedRows: Ref<number>;
|
41
41
|
};
|
42
42
|
};
|
43
|
-
export default _default;
|
@@ -3,7 +3,7 @@ import { nanoid } from "../../node_modules/nanoid/index.browser.js";
|
|
3
3
|
import { isArray } from "../../_shared/utils/is.js";
|
4
4
|
import { getBreakpointValue } from "../../_shared/utils/dom.js";
|
5
5
|
const GRID_CONTEXT_KEY = "grid-context";
|
6
|
-
|
6
|
+
function useGridContext() {
|
7
7
|
const provide$1 = (props) => {
|
8
8
|
const {
|
9
9
|
gutter: _gutter = ref(0),
|
@@ -86,8 +86,8 @@ const useContext = () => {
|
|
86
86
|
provide: provide$1,
|
87
87
|
inject: inject$1
|
88
88
|
};
|
89
|
-
}
|
89
|
+
}
|
90
90
|
export {
|
91
91
|
GRID_CONTEXT_KEY,
|
92
|
-
|
92
|
+
useGridContext as default
|
93
93
|
};
|
package/es/Image/Image.vue.js
CHANGED
@@ -6,7 +6,7 @@ import { useI18n } from "../_shared/utils/locale.js";
|
|
6
6
|
/* empty css */
|
7
7
|
/* empty css */
|
8
8
|
import _sfc_main$2 from "../_shared/icons/IconImageClose.vue.js";
|
9
|
-
import
|
9
|
+
import useImageContext from "./hooks/useContext.js";
|
10
10
|
import Spin from "../Spin/index.js";
|
11
11
|
import _sfc_main$1 from "./ImagePreview.vue.js";
|
12
12
|
/* empty css */
|
@@ -60,7 +60,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
60
60
|
const props = __props;
|
61
61
|
const emits = __emit;
|
62
62
|
const { src, preview, previewVisible, defaultPreviewVisible } = toRefs(props);
|
63
|
-
const { hasGroupFather, handleClick: previewImage } =
|
63
|
+
const { hasGroupFather, handleClick: previewImage } = useImageContext().inject();
|
64
64
|
const { t } = useI18n();
|
65
65
|
const computedVisible = useControlValue(
|
66
66
|
previewVisible,
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { defineComponent, useSlots, toRefs, ref, createBlock, openBlock, Teleport, unref, createElementBlock, createCommentVNode, normalizeStyle, normalizeClass, createVNode, Transition, withCtx, withDirectives, createElementVNode, vShow, withModifiers, renderSlot, createSlots } from "vue";
|
2
|
-
import { useEventListener, onKeyStroke } from "../node_modules/@vueuse/core/index.js";
|
3
2
|
import "../_shared/utils/dom.js";
|
4
3
|
/* empty css */
|
5
4
|
/* empty css */
|
@@ -7,6 +6,7 @@ import "../_shared/utils/dom.js";
|
|
7
6
|
import _sfc_main$2 from "../_shared/icons/IconClose.vue.js";
|
8
7
|
import { useControlValue } from "../_shared/utils/control.js";
|
9
8
|
import { getGlobalConfig } from "../_shared/utils/global-config.js";
|
9
|
+
import { useEventListener, onKeyStroke } from "../node_modules/@vueuse/core/index.js";
|
10
10
|
import useModalClose from "../Modal/hooks/useModalClose.js";
|
11
11
|
import _sfc_main$1 from "./ImagePreviewToolbar.vue.js";
|
12
12
|
/* empty css */
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { defineComponent, useSlots, toRefs, createElementBlock, openBlock, Fragment, renderSlot, createCommentVNode, createVNode, unref, mergeProps, isRef, createSlots, withCtx, createElementVNode } from "vue";
|
2
2
|
import { onKeyStroke } from "../node_modules/@vueuse/core/index.js";
|
3
|
-
import
|
3
|
+
import useImageContext from "./hooks/useContext.js";
|
4
4
|
import _sfc_main$1 from "./ImagePreview.vue.js";
|
5
5
|
/* empty css */
|
6
6
|
import _sfc_main$2 from "./ImagePreviewArrow.vue.js";
|
@@ -42,7 +42,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
42
42
|
const props = __props;
|
43
43
|
const emits = __emit;
|
44
44
|
const { srcList: _srcList, infinite, keyboard } = toRefs(props);
|
45
|
-
const { src, srcList, computedCurrent, computedVisible } =
|
45
|
+
const { src, srcList, computedCurrent, computedVisible } = useImageContext().provide(
|
46
46
|
props,
|
47
47
|
emits
|
48
48
|
);
|
@@ -5,7 +5,7 @@ type ImageContext = {
|
|
5
5
|
hasGroupFather: Ref<boolean>;
|
6
6
|
handleClick: (src: string) => void;
|
7
7
|
};
|
8
|
-
|
8
|
+
export default function useImageContext(): {
|
9
9
|
provide: (props: RecordType, emits: ImagePreviewGroupEmits) => {
|
10
10
|
src: import('vue').ComputedRef<string>;
|
11
11
|
srcList: import('vue').ComputedRef<string[]>;
|
@@ -14,4 +14,4 @@ declare const _default: () => {
|
|
14
14
|
};
|
15
15
|
inject: () => ImageContext;
|
16
16
|
};
|
17
|
-
export
|
17
|
+
export {};
|