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
@@ -1,6 +1,6 @@
|
|
1
1
|
import { defineComponent, ref, watch, onBeforeUnmount, createElementBlock, openBlock, normalizeClass, createElementVNode, createCommentVNode, unref, Fragment, renderList, createBlock, resolveDynamicComponent, createVNode } from "vue";
|
2
2
|
import { isObject } from "../_shared/utils/is.js";
|
3
|
-
import
|
3
|
+
import useCarouselContext from "./hooks/useContext.js";
|
4
4
|
import _sfc_main$2 from "./CarouselArrow.vue.js";
|
5
5
|
/* empty css */
|
6
6
|
import _sfc_main$1 from "./CarouselIndicator.vue.js";
|
@@ -37,7 +37,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
37
37
|
setup(__props, { emit: __emit }) {
|
38
38
|
const props = __props;
|
39
39
|
const emits = __emit;
|
40
|
-
const { slideTo, computedCurrent, autoPlay, carouselItems } =
|
40
|
+
const { slideTo, computedCurrent, autoPlay, carouselItems } = useCarouselContext().provide(props, emits);
|
41
41
|
const autoPlayTimer = ref(0);
|
42
42
|
const stopAutoPlay = () => {
|
43
43
|
if (!autoPlayTimer.value) return;
|
@@ -4,7 +4,7 @@ import "../_shared/utils/dom.js";
|
|
4
4
|
/* empty css */
|
5
5
|
/* empty css */
|
6
6
|
import _sfc_main$1 from "../_shared/icons/IconArrowRight.vue.js";
|
7
|
-
import
|
7
|
+
import useCarouselContext from "./hooks/useContext.js";
|
8
8
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
9
9
|
__name: "CarouselArrow",
|
10
10
|
props: {
|
@@ -14,7 +14,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
14
|
setup(__props) {
|
15
15
|
const props = __props;
|
16
16
|
const { type } = toRefs(props);
|
17
|
-
const { showArrow, direction, arrowClass, computedCurrent } =
|
17
|
+
const { showArrow, direction, arrowClass, computedCurrent } = useCarouselContext().inject();
|
18
18
|
const rotate = computed(() => {
|
19
19
|
if (type.value == "next") {
|
20
20
|
return direction.value == "horizontal" ? 0 : 90;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { defineComponent, createElementBlock, openBlock, normalizeClass, createCommentVNode, Fragment, renderList, unref, normalizeStyle } from "vue";
|
2
2
|
import { valueToPx } from "../_shared/utils/dom.js";
|
3
|
-
import
|
3
|
+
import useCarouselContext from "./hooks/useContext.js";
|
4
4
|
const _hoisted_1 = ["onMouseenter", "onClick"];
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
6
6
|
__name: "CarouselIndicator",
|
@@ -12,7 +12,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
12
|
},
|
13
13
|
emits: ["change"],
|
14
14
|
setup(__props) {
|
15
|
-
const { length, computedCurrent } =
|
15
|
+
const { length, computedCurrent } = useCarouselContext().inject();
|
16
16
|
return (_ctx, _cache) => {
|
17
17
|
return openBlock(), createElementBlock("div", {
|
18
18
|
class: normalizeClass([
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { defineComponent, useAttrs, computed, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, renderSlot } from "vue";
|
2
|
-
import
|
2
|
+
import useCarouselContext from "./hooks/useContext.js";
|
3
3
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
4
4
|
...{
|
5
5
|
name: "CarouselItem"
|
@@ -15,7 +15,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
15
|
animationName,
|
16
16
|
transitionTimingFunction,
|
17
17
|
getValidIndex
|
18
|
-
} =
|
18
|
+
} = useCarouselContext().inject();
|
19
19
|
const attrs = useAttrs();
|
20
20
|
const index = computed(() => attrs.index);
|
21
21
|
const slideClass = computed(() => {
|
@@ -15,7 +15,7 @@ type CarouselContext = {
|
|
15
15
|
getValidIndex: (val: number) => number;
|
16
16
|
};
|
17
17
|
type MoveType = 'positive' | 'negative';
|
18
|
-
|
18
|
+
export default function useCarouselContext(): {
|
19
19
|
provide: (props: RecordType, emits: CarouselEmits) => {
|
20
20
|
carouselItems: import('vue').ComputedRef<RecordType[]>;
|
21
21
|
computedCurrent: import('vue').WritableComputedRef<number, number>;
|
@@ -25,4 +25,4 @@ declare const _default: () => {
|
|
25
25
|
};
|
26
26
|
inject: () => CarouselContext;
|
27
27
|
};
|
28
|
-
export
|
28
|
+
export {};
|
@@ -5,7 +5,7 @@ import { findComponentsFromVnodes } from "../../_shared/utils/vue-utils.js";
|
|
5
5
|
import _sfc_main from "../CarouselItem.vue.js";
|
6
6
|
/* empty css */
|
7
7
|
const CAROUSEL_CONTEXT_KEY = "carousel-context";
|
8
|
-
|
8
|
+
function useCarouselContext() {
|
9
9
|
const provide$1 = (props, emits) => {
|
10
10
|
const {
|
11
11
|
current,
|
@@ -97,7 +97,7 @@ const useContext = () => {
|
|
97
97
|
provide: provide$1,
|
98
98
|
inject: inject$1
|
99
99
|
};
|
100
|
-
}
|
100
|
+
}
|
101
101
|
export {
|
102
|
-
|
102
|
+
useCarouselContext as default
|
103
103
|
};
|
@@ -33,10 +33,10 @@ declare function __VLS_template(): {
|
|
33
33
|
readonly invisibleButton?: boolean | undefined;
|
34
34
|
readonly showInput?: boolean | undefined;
|
35
35
|
readonly onChange?: ((value: string, ev: Event) => any) | undefined;
|
36
|
-
readonly onFocus?: ((ev: FocusEvent) => any) | undefined;
|
37
36
|
readonly onClear?: ((ev: MouseEvent) => any) | undefined;
|
38
37
|
readonly onInput?: ((value: string, ev: Event) => any) | undefined;
|
39
38
|
readonly onBlur?: ((ev: FocusEvent) => any) | undefined;
|
39
|
+
readonly onFocus?: ((ev: FocusEvent) => any) | undefined;
|
40
40
|
readonly onKeydown?: ((ev: KeyboardEvent) => any) | undefined;
|
41
41
|
readonly "onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
42
42
|
readonly "onUpdate:visibility"?: ((value: boolean) => any) | undefined;
|
@@ -57,14 +57,14 @@ declare function __VLS_template(): {
|
|
57
57
|
$root: import('vue').ComponentPublicInstance | null;
|
58
58
|
$parent: import('vue').ComponentPublicInstance | null;
|
59
59
|
$host: Element | null;
|
60
|
-
$emit: ((event: "change", value: string, ev: Event) => void) & ((event: "
|
60
|
+
$emit: ((event: "change", value: string, ev: Event) => void) & ((event: "clear", ev: MouseEvent) => void) & ((event: "input", value: string, ev: Event) => void) & ((event: "blur", ev: FocusEvent) => void) & ((event: "focus", ev: FocusEvent) => void) & ((event: "keydown", ev: KeyboardEvent) => void) & ((event: "update:modelValue", value: string) => void) & ((event: "update:visibility", value: boolean) => void) & ((event: "visibility-change", value: boolean) => void) & ((event: "pressEnter", ev: KeyboardEvent) => void);
|
61
61
|
$el: HTMLDivElement;
|
62
62
|
$options: import('vue').ComponentOptionsBase<Readonly<import('../Input').InputProps> & Readonly<{
|
63
63
|
onChange?: ((value: string, ev: Event) => any) | undefined;
|
64
|
-
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
65
64
|
onClear?: ((ev: MouseEvent) => any) | undefined;
|
66
65
|
onInput?: ((value: string, ev: Event) => any) | undefined;
|
67
66
|
onBlur?: ((ev: FocusEvent) => any) | undefined;
|
67
|
+
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
68
68
|
onKeydown?: ((ev: KeyboardEvent) => any) | undefined;
|
69
69
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
70
70
|
"onUpdate:visibility"?: ((value: boolean) => any) | undefined;
|
@@ -76,10 +76,10 @@ declare function __VLS_template(): {
|
|
76
76
|
getInputRef(): HTMLInputElement;
|
77
77
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
78
78
|
change: (value: string, ev: Event) => any;
|
79
|
-
focus: (ev: FocusEvent) => any;
|
80
79
|
clear: (ev: MouseEvent) => any;
|
81
80
|
input: (value: string, ev: Event) => any;
|
82
81
|
blur: (ev: FocusEvent) => any;
|
82
|
+
focus: (ev: FocusEvent) => any;
|
83
83
|
keydown: (ev: KeyboardEvent) => any;
|
84
84
|
"update:modelValue": (value: string) => any;
|
85
85
|
"update:visibility": (value: boolean) => any;
|
@@ -145,16 +145,16 @@ declare function __VLS_template(): {
|
|
145
145
|
showInput: boolean;
|
146
146
|
}> & Omit<Readonly<import('../Input').InputProps> & Readonly<{
|
147
147
|
onChange?: ((value: string, ev: Event) => any) | undefined;
|
148
|
-
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
149
148
|
onClear?: ((ev: MouseEvent) => any) | undefined;
|
150
149
|
onInput?: ((value: string, ev: Event) => any) | undefined;
|
151
150
|
onBlur?: ((ev: FocusEvent) => any) | undefined;
|
151
|
+
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
152
152
|
onKeydown?: ((ev: KeyboardEvent) => any) | undefined;
|
153
153
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
154
154
|
"onUpdate:visibility"?: ((value: boolean) => any) | undefined;
|
155
155
|
"onVisibility-change"?: ((value: boolean) => any) | undefined;
|
156
156
|
onPressEnter?: ((ev: KeyboardEvent) => any) | undefined;
|
157
|
-
}>, "
|
157
|
+
}>, "blur" | "focus" | "getInputRef" | ("size" | "error" | "disabled" | "placeholder" | "modelValue" | "defaultValue" | "maxLength" | "showWordLimit" | "allowClear" | "readonly" | "wordLength" | "wordSlice" | "inputAttrs" | "isPassword" | "visibility" | "defaultVisibility" | "invisibleButton" | "showInput")> & import('vue').ShallowUnwrapRef<{
|
158
158
|
focus(): void;
|
159
159
|
blur(): void;
|
160
160
|
getInputRef(): HTMLInputElement;
|
@@ -167,23 +167,23 @@ declare function __VLS_template(): {
|
|
167
167
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
168
168
|
declare const __VLS_component: import('vue').DefineComponent<CascaderProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
169
169
|
change: (value: import('./type').CascaderValue) => any;
|
170
|
-
focus: (ev: FocusEvent) => any;
|
171
|
-
"update:popupVisible": (value: boolean) => any;
|
172
|
-
"popup-visible-change": (value: boolean) => any;
|
173
170
|
clear: () => any;
|
174
171
|
search: (value: string) => any;
|
175
172
|
blur: (ev: FocusEvent) => any;
|
173
|
+
focus: (ev: FocusEvent) => any;
|
174
|
+
"update:popupVisible": (value: boolean) => any;
|
175
|
+
"popup-visible-change": (value: boolean) => any;
|
176
176
|
"update:modelValue": (value: import('./type').CascaderValue) => any;
|
177
177
|
"update:inputValue": (value: string) => any;
|
178
178
|
"input-value-change": (value: string) => any;
|
179
179
|
}, string, import('vue').PublicProps, Readonly<CascaderProps> & Readonly<{
|
180
180
|
onChange?: ((value: import('./type').CascaderValue) => any) | undefined;
|
181
|
-
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
182
|
-
"onUpdate:popupVisible"?: ((value: boolean) => any) | undefined;
|
183
|
-
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
184
181
|
onClear?: (() => any) | undefined;
|
185
182
|
onSearch?: ((value: string) => any) | undefined;
|
186
183
|
onBlur?: ((ev: FocusEvent) => any) | undefined;
|
184
|
+
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
185
|
+
"onUpdate:popupVisible"?: ((value: boolean) => any) | undefined;
|
186
|
+
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
187
187
|
"onUpdate:modelValue"?: ((value: import('./type').CascaderValue) => any) | undefined;
|
188
188
|
"onUpdate:inputValue"?: ((value: string) => any) | undefined;
|
189
189
|
"onInput-value-change"?: ((value: string) => any) | undefined;
|
@@ -242,10 +242,10 @@ declare const __VLS_component: import('vue').DefineComponent<CascaderProps, {},
|
|
242
242
|
readonly invisibleButton?: boolean | undefined;
|
243
243
|
readonly showInput?: boolean | undefined;
|
244
244
|
readonly onChange?: ((value: string, ev: Event) => any) | undefined;
|
245
|
-
readonly onFocus?: ((ev: FocusEvent) => any) | undefined;
|
246
245
|
readonly onClear?: ((ev: MouseEvent) => any) | undefined;
|
247
246
|
readonly onInput?: ((value: string, ev: Event) => any) | undefined;
|
248
247
|
readonly onBlur?: ((ev: FocusEvent) => any) | undefined;
|
248
|
+
readonly onFocus?: ((ev: FocusEvent) => any) | undefined;
|
249
249
|
readonly onKeydown?: ((ev: KeyboardEvent) => any) | undefined;
|
250
250
|
readonly "onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
251
251
|
readonly "onUpdate:visibility"?: ((value: boolean) => any) | undefined;
|
@@ -266,14 +266,14 @@ declare const __VLS_component: import('vue').DefineComponent<CascaderProps, {},
|
|
266
266
|
$root: import('vue').ComponentPublicInstance | null;
|
267
267
|
$parent: import('vue').ComponentPublicInstance | null;
|
268
268
|
$host: Element | null;
|
269
|
-
$emit: ((event: "change", value: string, ev: Event) => void) & ((event: "
|
269
|
+
$emit: ((event: "change", value: string, ev: Event) => void) & ((event: "clear", ev: MouseEvent) => void) & ((event: "input", value: string, ev: Event) => void) & ((event: "blur", ev: FocusEvent) => void) & ((event: "focus", ev: FocusEvent) => void) & ((event: "keydown", ev: KeyboardEvent) => void) & ((event: "update:modelValue", value: string) => void) & ((event: "update:visibility", value: boolean) => void) & ((event: "visibility-change", value: boolean) => void) & ((event: "pressEnter", ev: KeyboardEvent) => void);
|
270
270
|
$el: HTMLDivElement;
|
271
271
|
$options: import('vue').ComponentOptionsBase<Readonly<import('../Input').InputProps> & Readonly<{
|
272
272
|
onChange?: ((value: string, ev: Event) => any) | undefined;
|
273
|
-
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
274
273
|
onClear?: ((ev: MouseEvent) => any) | undefined;
|
275
274
|
onInput?: ((value: string, ev: Event) => any) | undefined;
|
276
275
|
onBlur?: ((ev: FocusEvent) => any) | undefined;
|
276
|
+
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
277
277
|
onKeydown?: ((ev: KeyboardEvent) => any) | undefined;
|
278
278
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
279
279
|
"onUpdate:visibility"?: ((value: boolean) => any) | undefined;
|
@@ -285,10 +285,10 @@ declare const __VLS_component: import('vue').DefineComponent<CascaderProps, {},
|
|
285
285
|
getInputRef(): HTMLInputElement;
|
286
286
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
287
287
|
change: (value: string, ev: Event) => any;
|
288
|
-
focus: (ev: FocusEvent) => any;
|
289
288
|
clear: (ev: MouseEvent) => any;
|
290
289
|
input: (value: string, ev: Event) => any;
|
291
290
|
blur: (ev: FocusEvent) => any;
|
291
|
+
focus: (ev: FocusEvent) => any;
|
292
292
|
keydown: (ev: KeyboardEvent) => any;
|
293
293
|
"update:modelValue": (value: string) => any;
|
294
294
|
"update:visibility": (value: boolean) => any;
|
@@ -354,16 +354,16 @@ declare const __VLS_component: import('vue').DefineComponent<CascaderProps, {},
|
|
354
354
|
showInput: boolean;
|
355
355
|
}> & Omit<Readonly<import('../Input').InputProps> & Readonly<{
|
356
356
|
onChange?: ((value: string, ev: Event) => any) | undefined;
|
357
|
-
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
358
357
|
onClear?: ((ev: MouseEvent) => any) | undefined;
|
359
358
|
onInput?: ((value: string, ev: Event) => any) | undefined;
|
360
359
|
onBlur?: ((ev: FocusEvent) => any) | undefined;
|
360
|
+
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
361
361
|
onKeydown?: ((ev: KeyboardEvent) => any) | undefined;
|
362
362
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
363
363
|
"onUpdate:visibility"?: ((value: boolean) => any) | undefined;
|
364
364
|
"onVisibility-change"?: ((value: boolean) => any) | undefined;
|
365
365
|
onPressEnter?: ((ev: KeyboardEvent) => any) | undefined;
|
366
|
-
}>, "
|
366
|
+
}>, "blur" | "focus" | "getInputRef" | ("size" | "error" | "disabled" | "placeholder" | "modelValue" | "defaultValue" | "maxLength" | "showWordLimit" | "allowClear" | "readonly" | "wordLength" | "wordSlice" | "inputAttrs" | "isPassword" | "visibility" | "defaultVisibility" | "invisibleButton" | "showInput")> & import('vue').ShallowUnwrapRef<{
|
367
367
|
focus(): void;
|
368
368
|
blur(): void;
|
369
369
|
getInputRef(): HTMLInputElement;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { defineComponent, ref, computed, createBlock, openBlock, unref, mergeProps, isRef, withCtx, createElementVNode, normalizeStyle, normalizeClass, createSlots, createVNode, renderSlot, normalizeProps, guardReactiveProps, toDisplayString } from "vue";
|
2
2
|
import { sleep } from "../_shared/utils/dom.js";
|
3
|
-
import
|
3
|
+
import useCascaderContext from "./hooks/useContext.js";
|
4
4
|
import Input from "../Input/index.js";
|
5
5
|
import InputTag from "../InputTag/index.js";
|
6
6
|
import Trigger from "../Trigger/index.js";
|
@@ -77,7 +77,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
77
77
|
curPath,
|
78
78
|
getValueKey,
|
79
79
|
getOption
|
80
|
-
} =
|
80
|
+
} = useCascaderContext().provide(props, emits, inputRef);
|
81
81
|
const showClearBtn = computed(() => {
|
82
82
|
let hasValue;
|
83
83
|
if (pathMode.value) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { defineComponent, resolveComponent, createBlock, createElementBlock, openBlock, unref, createSlots, withCtx, resolveDynamicComponent, Fragment, createElementVNode, createCommentVNode, withModifiers } from "vue";
|
2
|
-
import
|
2
|
+
import useCascaderContext from "./hooks/useContext.js";
|
3
3
|
import _sfc_main$1 from "../_shared/icons/IconArrowDown.vue.js";
|
4
4
|
import _sfc_main$2 from "../_shared/components/IconButton/index.vue.js";
|
5
5
|
/* empty css */
|
@@ -22,7 +22,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
22
22
|
},
|
23
23
|
emits: ["clear"],
|
24
24
|
setup(__props) {
|
25
|
-
const { slots } =
|
25
|
+
const { slots } = useCascaderContext().inject();
|
26
26
|
const renderIcon = (name) => {
|
27
27
|
return slots[name];
|
28
28
|
};
|
@@ -7,7 +7,7 @@ import _sfc_main$1 from "../_shared/icons/IconArrowRight.vue.js";
|
|
7
7
|
import _sfc_main$2 from "../_shared/icons/IconLoading.vue.js";
|
8
8
|
import { isFunction } from "../_shared/utils/is.js";
|
9
9
|
import Checkbox from "../Checkbox/index.js";
|
10
|
-
import
|
10
|
+
import useCascaderContext, { getLeafNodes, findOptionByValueAndLevel } from "./hooks/useContext.js";
|
11
11
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
12
12
|
__name: "CascaderOption",
|
13
13
|
props: {
|
@@ -41,7 +41,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
41
41
|
getValueKey,
|
42
42
|
blur,
|
43
43
|
loadMore
|
44
|
-
} =
|
44
|
+
} = useCascaderContext().inject();
|
45
45
|
const loading = ref(false);
|
46
46
|
const showArrow = computed(() => {
|
47
47
|
if (isFunction(loadMore)) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { defineComponent, createBlock, openBlock, TransitionGroup, withCtx, createElementBlock, unref, resolveDynamicComponent, Fragment, renderList, withDirectives, normalizeStyle, createVNode, createElementVNode, mergeProps, vShow } from "vue";
|
2
|
-
import
|
2
|
+
import useCascaderContext, { findOptions } from "./hooks/useContext.js";
|
3
3
|
import _sfc_main$1 from "./CascaderOption.vue.js";
|
4
4
|
/* empty css */
|
5
5
|
import Scrollbar from "../Scrollbar/index.js";
|
@@ -12,7 +12,7 @@ const _hoisted_1 = {
|
|
12
12
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
13
13
|
__name: "CascaderPanel",
|
14
14
|
setup(__props) {
|
15
|
-
const { options, curLevel, curPath, maxLevel, loading, slots } =
|
15
|
+
const { options, curLevel, curPath, maxLevel, loading, slots } = useCascaderContext().inject();
|
16
16
|
return (_ctx, _cache) => {
|
17
17
|
return openBlock(), createBlock(TransitionGroup, {
|
18
18
|
tag: "div",
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { defineComponent, createElementBlock, openBlock, createCommentVNode, createVNode, unref, createBlock, resolveDynamicComponent, withCtx, createElementVNode, Fragment, renderList, mergeProps } from "vue";
|
2
|
-
import
|
2
|
+
import useCascaderContext from "./hooks/useContext.js";
|
3
3
|
import _sfc_main$1 from "./CascaderOption.vue.js";
|
4
4
|
/* empty css */
|
5
5
|
import Scrollbar from "../Scrollbar/index.js";
|
@@ -16,7 +16,7 @@ const _hoisted_3 = {
|
|
16
16
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
17
17
|
__name: "CascaderSearchPanel",
|
18
18
|
setup(__props) {
|
19
|
-
const { searchOptions, slots } =
|
19
|
+
const { searchOptions, slots } = useCascaderContext().inject();
|
20
20
|
return (_ctx, _cache) => {
|
21
21
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
22
22
|
!unref(searchOptions).length ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
@@ -27,7 +27,7 @@ export declare const flattenOptions: (options: CascaderOptionProps[]) => Cascade
|
|
27
27
|
export declare const findOptions: (options: CascaderOptionProps[], level: number, parentPath: number[]) => CascaderOptionProps[];
|
28
28
|
export declare function findOptionByValueAndLevel(options: CascaderOption[], value: CascaderOptionValue, level: number, currentLevel?: number): CascaderOption | undefined;
|
29
29
|
export declare const getLeafNodes: (nodes: CascaderOptionProps[]) => CascaderOptionProps[];
|
30
|
-
|
30
|
+
export default function useCascaderContext(): {
|
31
31
|
provide: (props: RecordType, emits: CascaderEmits, inputRef: Ref<InputInstance | undefined>) => {
|
32
32
|
computedValue: import('vue').WritableComputedRef<CascaderValue, CascaderValue>;
|
33
33
|
computedInputValue: import('vue').WritableComputedRef<string, string>;
|
@@ -50,4 +50,4 @@ declare const _default: () => {
|
|
50
50
|
};
|
51
51
|
inject: () => CascaderContext;
|
52
52
|
};
|
53
|
-
export
|
53
|
+
export {};
|
@@ -105,7 +105,7 @@ function transformField(options, fieldKeys) {
|
|
105
105
|
return transformed;
|
106
106
|
});
|
107
107
|
}
|
108
|
-
|
108
|
+
function useCascaderContext() {
|
109
109
|
const provide$1 = (props, emits, inputRef) => {
|
110
110
|
const {
|
111
111
|
modelValue,
|
@@ -318,9 +318,9 @@ const useContext = () => {
|
|
318
318
|
provide: provide$1,
|
319
319
|
inject: inject$1
|
320
320
|
};
|
321
|
-
}
|
321
|
+
}
|
322
322
|
export {
|
323
|
-
|
323
|
+
useCascaderContext as default,
|
324
324
|
findOptionByValueAndLevel,
|
325
325
|
findOptions,
|
326
326
|
flattenOptions,
|
package/es/Cascader/index.d.ts
CHANGED
@@ -5,23 +5,23 @@ export * from './type';
|
|
5
5
|
declare const Cascader: {
|
6
6
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./type').CascaderProps> & Readonly<{
|
7
7
|
onChange?: ((value: import('./type').CascaderValue) => any) | undefined;
|
8
|
-
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
9
|
-
"onUpdate:popupVisible"?: ((value: boolean) => any) | undefined;
|
10
|
-
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
11
8
|
onClear?: (() => any) | undefined;
|
12
9
|
onSearch?: ((value: string) => any) | undefined;
|
13
10
|
onBlur?: ((ev: FocusEvent) => any) | undefined;
|
11
|
+
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
12
|
+
"onUpdate:popupVisible"?: ((value: boolean) => any) | undefined;
|
13
|
+
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
14
14
|
"onUpdate:modelValue"?: ((value: import('./type').CascaderValue) => any) | undefined;
|
15
15
|
"onUpdate:inputValue"?: ((value: string) => any) | undefined;
|
16
16
|
"onInput-value-change"?: ((value: string) => any) | undefined;
|
17
17
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
18
18
|
change: (value: import('./type').CascaderValue) => any;
|
19
|
-
focus: (ev: FocusEvent) => any;
|
20
|
-
"update:popupVisible": (value: boolean) => any;
|
21
|
-
"popup-visible-change": (value: boolean) => any;
|
22
19
|
clear: () => any;
|
23
20
|
search: (value: string) => any;
|
24
21
|
blur: (ev: FocusEvent) => any;
|
22
|
+
focus: (ev: FocusEvent) => any;
|
23
|
+
"update:popupVisible": (value: boolean) => any;
|
24
|
+
"popup-visible-change": (value: boolean) => any;
|
25
25
|
"update:modelValue": (value: import('./type').CascaderValue) => any;
|
26
26
|
"update:inputValue": (value: string) => any;
|
27
27
|
"input-value-change": (value: string) => any;
|
@@ -80,10 +80,10 @@ declare const Cascader: {
|
|
80
80
|
readonly invisibleButton?: boolean | undefined;
|
81
81
|
readonly showInput?: boolean | undefined;
|
82
82
|
readonly onChange?: ((value: string, ev: Event) => any) | undefined;
|
83
|
-
readonly onFocus?: ((ev: FocusEvent) => any) | undefined;
|
84
83
|
readonly onClear?: ((ev: MouseEvent) => any) | undefined;
|
85
84
|
readonly onInput?: ((value: string, ev: Event) => any) | undefined;
|
86
85
|
readonly onBlur?: ((ev: FocusEvent) => any) | undefined;
|
86
|
+
readonly onFocus?: ((ev: FocusEvent) => any) | undefined;
|
87
87
|
readonly onKeydown?: ((ev: KeyboardEvent) => any) | undefined;
|
88
88
|
readonly "onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
89
89
|
readonly "onUpdate:visibility"?: ((value: boolean) => any) | undefined;
|
@@ -104,14 +104,14 @@ declare const Cascader: {
|
|
104
104
|
$root: import('vue').ComponentPublicInstance | null;
|
105
105
|
$parent: import('vue').ComponentPublicInstance | null;
|
106
106
|
$host: Element | null;
|
107
|
-
$emit: ((event: "change", value: string, ev: Event) => void) & ((event: "
|
107
|
+
$emit: ((event: "change", value: string, ev: Event) => void) & ((event: "clear", ev: MouseEvent) => void) & ((event: "input", value: string, ev: Event) => void) & ((event: "blur", ev: FocusEvent) => void) & ((event: "focus", ev: FocusEvent) => void) & ((event: "keydown", ev: KeyboardEvent) => void) & ((event: "update:modelValue", value: string) => void) & ((event: "update:visibility", value: boolean) => void) & ((event: "visibility-change", value: boolean) => void) & ((event: "pressEnter", ev: KeyboardEvent) => void);
|
108
108
|
$el: HTMLDivElement;
|
109
109
|
$options: import('vue').ComponentOptionsBase<Readonly<import('..').InputProps> & Readonly<{
|
110
110
|
onChange?: ((value: string, ev: Event) => any) | undefined;
|
111
|
-
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
112
111
|
onClear?: ((ev: MouseEvent) => any) | undefined;
|
113
112
|
onInput?: ((value: string, ev: Event) => any) | undefined;
|
114
113
|
onBlur?: ((ev: FocusEvent) => any) | undefined;
|
114
|
+
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
115
115
|
onKeydown?: ((ev: KeyboardEvent) => any) | undefined;
|
116
116
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
117
117
|
"onUpdate:visibility"?: ((value: boolean) => any) | undefined;
|
@@ -123,10 +123,10 @@ declare const Cascader: {
|
|
123
123
|
getInputRef(): HTMLInputElement;
|
124
124
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
125
125
|
change: (value: string, ev: Event) => any;
|
126
|
-
focus: (ev: FocusEvent) => any;
|
127
126
|
clear: (ev: MouseEvent) => any;
|
128
127
|
input: (value: string, ev: Event) => any;
|
129
128
|
blur: (ev: FocusEvent) => any;
|
129
|
+
focus: (ev: FocusEvent) => any;
|
130
130
|
keydown: (ev: KeyboardEvent) => any;
|
131
131
|
"update:modelValue": (value: string) => any;
|
132
132
|
"update:visibility": (value: boolean) => any;
|
@@ -192,16 +192,16 @@ declare const Cascader: {
|
|
192
192
|
showInput: boolean;
|
193
193
|
}> & Omit<Readonly<import('..').InputProps> & Readonly<{
|
194
194
|
onChange?: ((value: string, ev: Event) => any) | undefined;
|
195
|
-
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
196
195
|
onClear?: ((ev: MouseEvent) => any) | undefined;
|
197
196
|
onInput?: ((value: string, ev: Event) => any) | undefined;
|
198
197
|
onBlur?: ((ev: FocusEvent) => any) | undefined;
|
198
|
+
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
199
199
|
onKeydown?: ((ev: KeyboardEvent) => any) | undefined;
|
200
200
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
201
201
|
"onUpdate:visibility"?: ((value: boolean) => any) | undefined;
|
202
202
|
"onVisibility-change"?: ((value: boolean) => any) | undefined;
|
203
203
|
onPressEnter?: ((ev: KeyboardEvent) => any) | undefined;
|
204
|
-
}>, "
|
204
|
+
}>, "blur" | "focus" | "getInputRef" | ("size" | "error" | "disabled" | "placeholder" | "modelValue" | "defaultValue" | "maxLength" | "showWordLimit" | "allowClear" | "readonly" | "wordLength" | "wordSlice" | "inputAttrs" | "isPassword" | "visibility" | "defaultVisibility" | "invisibleButton" | "showInput")> & import('vue').ShallowUnwrapRef<{
|
205
205
|
focus(): void;
|
206
206
|
blur(): void;
|
207
207
|
getInputRef(): HTMLInputElement;
|
@@ -217,12 +217,12 @@ declare const Cascader: {
|
|
217
217
|
Defaults: {};
|
218
218
|
}, Readonly<import('./type').CascaderProps> & Readonly<{
|
219
219
|
onChange?: ((value: import('./type').CascaderValue) => any) | undefined;
|
220
|
-
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
221
|
-
"onUpdate:popupVisible"?: ((value: boolean) => any) | undefined;
|
222
|
-
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
223
220
|
onClear?: (() => any) | undefined;
|
224
221
|
onSearch?: ((value: string) => any) | undefined;
|
225
222
|
onBlur?: ((ev: FocusEvent) => any) | undefined;
|
223
|
+
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
224
|
+
"onUpdate:popupVisible"?: ((value: boolean) => any) | undefined;
|
225
|
+
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
226
226
|
"onUpdate:modelValue"?: ((value: import('./type').CascaderValue) => any) | undefined;
|
227
227
|
"onUpdate:inputValue"?: ((value: string) => any) | undefined;
|
228
228
|
"onInput-value-change"?: ((value: string) => any) | undefined;
|
@@ -263,23 +263,23 @@ declare const Cascader: {
|
|
263
263
|
__isSuspense?: never;
|
264
264
|
} & import('vue').ComponentOptionsBase<Readonly<import('./type').CascaderProps> & Readonly<{
|
265
265
|
onChange?: ((value: import('./type').CascaderValue) => any) | undefined;
|
266
|
-
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
267
|
-
"onUpdate:popupVisible"?: ((value: boolean) => any) | undefined;
|
268
|
-
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
269
266
|
onClear?: (() => any) | undefined;
|
270
267
|
onSearch?: ((value: string) => any) | undefined;
|
271
268
|
onBlur?: ((ev: FocusEvent) => any) | undefined;
|
269
|
+
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
270
|
+
"onUpdate:popupVisible"?: ((value: boolean) => any) | undefined;
|
271
|
+
"onPopup-visible-change"?: ((value: boolean) => any) | undefined;
|
272
272
|
"onUpdate:modelValue"?: ((value: import('./type').CascaderValue) => any) | undefined;
|
273
273
|
"onUpdate:inputValue"?: ((value: string) => any) | undefined;
|
274
274
|
"onInput-value-change"?: ((value: string) => any) | undefined;
|
275
275
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
276
276
|
change: (value: import('./type').CascaderValue) => any;
|
277
|
-
focus: (ev: FocusEvent) => any;
|
278
|
-
"update:popupVisible": (value: boolean) => any;
|
279
|
-
"popup-visible-change": (value: boolean) => any;
|
280
277
|
clear: () => any;
|
281
278
|
search: (value: string) => any;
|
282
279
|
blur: (ev: FocusEvent) => any;
|
280
|
+
focus: (ev: FocusEvent) => any;
|
281
|
+
"update:popupVisible": (value: boolean) => any;
|
282
|
+
"popup-visible-change": (value: boolean) => any;
|
283
283
|
"update:modelValue": (value: import('./type').CascaderValue) => any;
|
284
284
|
"update:inputValue": (value: string) => any;
|
285
285
|
"input-value-change": (value: string) => any;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { defineComponent, useSlots, toRefs, computed, createElementBlock, openBlock, normalizeClass, createElementVNode, renderSlot, createVNode, createCommentVNode, unref, withCtx } from "vue";
|
2
2
|
import { isUndefined } from "../_shared/utils/is.js";
|
3
3
|
import { useControlValue } from "../_shared/utils/control.js";
|
4
|
-
import
|
4
|
+
import useCheckboxContext from "./hooks/useContext.js";
|
5
5
|
import _sfc_main$1 from "../_shared/components/IconButton/index.vue.js";
|
6
6
|
/* empty css */
|
7
7
|
import "../_shared/utils/dom.js";
|
@@ -42,7 +42,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
42
42
|
max,
|
43
43
|
hasGroup,
|
44
44
|
disabled: injectDisabled
|
45
|
-
} =
|
45
|
+
} = useCheckboxContext().inject();
|
46
46
|
const checked = useControlValue(
|
47
47
|
modelValue,
|
48
48
|
defaultChecked.value,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { defineComponent, useSlots, createElementBlock, openBlock, normalizeClass, renderSlot, Fragment, renderList, unref, createBlock, createSlots, withCtx, createTextVNode, toDisplayString, mergeProps } from "vue";
|
2
|
-
import
|
2
|
+
import useCheckboxContext from "./hooks/useContext.js";
|
3
3
|
import _sfc_main$1 from "./Checkbox.vue.js";
|
4
4
|
/* empty css */
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
@@ -20,7 +20,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
20
20
|
const $slots = useSlots();
|
21
21
|
const props = __props;
|
22
22
|
const emits = __emit;
|
23
|
-
const { options } =
|
23
|
+
const { options } = useCheckboxContext().provide(props, emits);
|
24
24
|
return (_ctx, _cache) => {
|
25
25
|
return openBlock(), createElementBlock("div", {
|
26
26
|
class: normalizeClass(["yc-checkbox-group", `yc-checkbox-group-direction-${_ctx.direction}`])
|
@@ -7,10 +7,10 @@ type CheckboxContext = {
|
|
7
7
|
disabled: Ref<boolean>;
|
8
8
|
hasGroup: Ref<boolean>;
|
9
9
|
};
|
10
|
-
|
10
|
+
export default function useCheckboxContext(): {
|
11
11
|
provide: (props: RecordType, emits: CheckboxGroupEmits) => {
|
12
12
|
options: import('vue').ComputedRef<RecordType[]>;
|
13
13
|
};
|
14
14
|
inject: () => CheckboxContext;
|
15
15
|
};
|
16
|
-
export
|
16
|
+
export {};
|
@@ -2,7 +2,7 @@ import { toRefs, computed, provide, ref, inject } from "vue";
|
|
2
2
|
import { isObject } from "../../_shared/utils/is.js";
|
3
3
|
import { useControlValue } from "../../_shared/utils/control.js";
|
4
4
|
const CHECKBOX_GROUP_CONTEXT_KEY = "checkbox-group-context";
|
5
|
-
|
5
|
+
function useCheckboxContext() {
|
6
6
|
const provide$1 = (props, emits) => {
|
7
7
|
const {
|
8
8
|
modelValue,
|
@@ -46,7 +46,7 @@ const useContext = () => {
|
|
46
46
|
provide: provide$1,
|
47
47
|
inject: inject$1
|
48
48
|
};
|
49
|
-
}
|
49
|
+
}
|
50
50
|
export {
|
51
|
-
|
51
|
+
useCheckboxContext as default
|
52
52
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot } from "vue";
|
2
|
-
import
|
2
|
+
import useCollapseContext from "./hooks/useContext.js";
|
3
3
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
4
4
|
...{
|
5
5
|
name: "Collapse"
|
@@ -18,7 +18,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
18
18
|
setup(__props, { emit: __emit }) {
|
19
19
|
const props = __props;
|
20
20
|
const emits = __emit;
|
21
|
-
|
21
|
+
useCollapseContext().provide(props, emits);
|
22
22
|
return (_ctx, _cache) => {
|
23
23
|
return openBlock(), createElementBlock("div", {
|
24
24
|
class: normalizeClass([
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { defineComponent, toRefs, createElementBlock, openBlock, normalizeClass, unref, createElementVNode, createVNode, createBlock, createCommentVNode, withCtx, renderSlot, resolveDynamicComponent, createTextVNode, toDisplayString, withDirectives, vShow } from "vue";
|
2
|
-
import
|
2
|
+
import useCollapseContext from "./hooks/useContext.js";
|
3
3
|
import _sfc_main$1 from "../_shared/components/IconButton/index.vue.js";
|
4
4
|
/* empty css */
|
5
5
|
import _sfc_main$3 from "../_shared/components/ExpandTransition/index.vue2.js";
|
@@ -40,7 +40,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
40
40
|
expandIconPosition,
|
41
41
|
showExpandIcon,
|
42
42
|
destroyOnHide
|
43
|
-
} =
|
43
|
+
} = useCollapseContext().inject(props);
|
44
44
|
const handleClick = () => {
|
45
45
|
if (disabled.value) return;
|
46
46
|
if (computedActiveKey.value.includes(path.value)) {
|