@semi-kit/component 1.4.11 → 1.4.13
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/lib/app-provider/index.d.ts +1 -1
- package/lib/app-provider/index.js +1 -1
- package/lib/{app-provider-BNtVdZn9.js → app-provider-chfjw9Ns.js} +4 -2
- package/lib/index-BYo86iJS.d.ts +41 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/tab-view/index.d.ts +6 -3
- package/lib/tab-view/index.js +1 -1
- package/lib/{tab-view-DN-KFQWP.js → tab-view-DUJ_O5Nk.js} +22 -4
- package/lib/wrapper/flex-col-wrapper/index.d.ts +2 -2
- package/lib/wrapper/flex-row-wrapper/index.d.ts +2 -2
- package/lib/wrapper/scroll-wrapper/index.d.ts +2 -2
- package/package.json +7 -3
- package/lib/index-Bvg8aJV4.d.ts +0 -35
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "../index-
|
|
1
|
+
import { t as _default } from "../index-BYo86iJS.js";
|
|
2
2
|
export { _default as default };
|
|
@@ -4,7 +4,8 @@ import { defineComponent, provide, toRef } from "vue";
|
|
|
4
4
|
const appProviderProps = {
|
|
5
5
|
locale: String,
|
|
6
6
|
formRuleConfig: Object,
|
|
7
|
-
theme: Object
|
|
7
|
+
theme: Object,
|
|
8
|
+
tab: Object
|
|
8
9
|
};
|
|
9
10
|
|
|
10
11
|
//#endregion
|
|
@@ -16,7 +17,8 @@ var app_provider_default = /* @__PURE__ */ defineComponent({
|
|
|
16
17
|
provide("app-provider", {
|
|
17
18
|
locale: toRef(props, "locale"),
|
|
18
19
|
formRuleConfig: toRef(props, "formRuleConfig"),
|
|
19
|
-
theme: toRef(props, "theme")
|
|
20
|
+
theme: toRef(props, "theme"),
|
|
21
|
+
tab: toRef(props, "tab")
|
|
20
22
|
});
|
|
21
23
|
return () => {
|
|
22
24
|
return slots.default?.();
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as vue0 from "vue";
|
|
2
|
+
import { Ref } from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/app-provider/type.d.ts
|
|
5
|
+
interface AppProviderFormRuleConfig {
|
|
6
|
+
stringLength?: number;
|
|
7
|
+
numberLength?: number;
|
|
8
|
+
numberSize?: number;
|
|
9
|
+
decimalPlace?: number;
|
|
10
|
+
}
|
|
11
|
+
interface AppProviderTheme {
|
|
12
|
+
primaryColor?: string;
|
|
13
|
+
secondaryColor?: string;
|
|
14
|
+
radius?: number;
|
|
15
|
+
}
|
|
16
|
+
interface AppProviderTab {
|
|
17
|
+
sortable?: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface AppProviderContext {
|
|
20
|
+
locale?: Ref<string | undefined>;
|
|
21
|
+
formRuleConfig?: Ref<AppProviderFormRuleConfig>;
|
|
22
|
+
theme?: Ref<AppProviderTheme | undefined>;
|
|
23
|
+
tab?: Ref<AppProviderTab | undefined>;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/app-provider/index.d.ts
|
|
27
|
+
declare const _default: vue0.DefineComponent<vue0.ExtractPropTypes<{
|
|
28
|
+
readonly locale: StringConstructor;
|
|
29
|
+
readonly formRuleConfig: vue0.PropType<AppProviderFormRuleConfig>;
|
|
30
|
+
readonly theme: vue0.PropType<AppProviderTheme>;
|
|
31
|
+
readonly tab: vue0.PropType<AppProviderTab>;
|
|
32
|
+
}>, () => vue0.VNode<vue0.RendererNode, vue0.RendererElement, {
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}>[] | undefined, {}, {}, {}, vue0.ComponentOptionsMixin, vue0.ComponentOptionsMixin, {}, string, vue0.PublicProps, Readonly<vue0.ExtractPropTypes<{
|
|
35
|
+
readonly locale: StringConstructor;
|
|
36
|
+
readonly formRuleConfig: vue0.PropType<AppProviderFormRuleConfig>;
|
|
37
|
+
readonly theme: vue0.PropType<AppProviderTheme>;
|
|
38
|
+
readonly tab: vue0.PropType<AppProviderTab>;
|
|
39
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, vue0.ComponentProvideOptions, true, {}, any>;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { AppProviderContext as n, AppProviderFormRuleConfig as r, _default as t };
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as AppProviderContext, r as AppProviderFormRuleConfig, t as _default } from "./index-
|
|
1
|
+
import { n as AppProviderContext, r as AppProviderFormRuleConfig, t as _default } from "./index-BYo86iJS.js";
|
|
2
2
|
import _default$3 from "./wrapper/scroll-wrapper/index.js";
|
|
3
3
|
import _default$2 from "./wrapper/flex-row-wrapper/index.js";
|
|
4
4
|
import _default$1 from "./wrapper/flex-col-wrapper/index.js";
|
package/lib/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { n as getAppProvider, t as tab_view_default } from "./tab-view-
|
|
1
|
+
import { n as getAppProvider, t as tab_view_default } from "./tab-view-DUJ_O5Nk.js";
|
|
2
2
|
import "./cssr-D9_M6jAV.js";
|
|
3
3
|
import { t as scroll_wrapper_default } from "./scroll-wrapper-DVAnbCLj.js";
|
|
4
4
|
import { t as flex_row_wrapper_default } from "./flex-row-wrapper-70R3tK7w.js";
|
|
5
5
|
import { t as flex_col_wrapper_default } from "./flex-col-wrapper-BYnCXcY5.js";
|
|
6
|
-
import { t as app_provider_default } from "./app-provider-
|
|
6
|
+
import { t as app_provider_default } from "./app-provider-chfjw9Ns.js";
|
|
7
7
|
import { SemiComponentResolver } from "./resolver.js";
|
|
8
8
|
|
|
9
9
|
export { app_provider_default as AppProvider, flex_col_wrapper_default as FlexColWrapper, flex_row_wrapper_default as FlexRowWrapper, scroll_wrapper_default as ScrollWrapper, SemiComponentResolver, tab_view_default as TabView, getAppProvider };
|
package/lib/tab-view/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vue25 from "vue";
|
|
2
2
|
import { VNode } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/tab-view/index.d.ts
|
|
@@ -12,6 +12,7 @@ interface PropsType<T> {
|
|
|
12
12
|
onMouseUpItem?: (e: MouseEvent, item: T, index: number) => void;
|
|
13
13
|
onDropdownSelect?: (key: TabActionType, index: number) => void;
|
|
14
14
|
onContextMenuItem?: (e: MouseEvent, item: T, index: number) => void;
|
|
15
|
+
onSortEnd?: (newIndex: number, oldIndex: number) => void;
|
|
15
16
|
}
|
|
16
17
|
interface SlotType<T> {
|
|
17
18
|
default?: (props: {
|
|
@@ -20,7 +21,7 @@ interface SlotType<T> {
|
|
|
20
21
|
}) => VNode;
|
|
21
22
|
extra?: () => VNode;
|
|
22
23
|
}
|
|
23
|
-
declare const TabView:
|
|
24
|
+
declare const TabView: vue25.DefineSetupFnComponent<{
|
|
24
25
|
tabs: any;
|
|
25
26
|
rowKey: any;
|
|
26
27
|
activeTab: any;
|
|
@@ -28,6 +29,7 @@ declare const TabView: vue23.DefineSetupFnComponent<{
|
|
|
28
29
|
onClickItem: any;
|
|
29
30
|
onMouseUpItem: any;
|
|
30
31
|
onContextMenuItem: any;
|
|
32
|
+
onSortEnd: any;
|
|
31
33
|
}, {}, {}, {
|
|
32
34
|
tabs: any;
|
|
33
35
|
rowKey: any;
|
|
@@ -36,6 +38,7 @@ declare const TabView: vue23.DefineSetupFnComponent<{
|
|
|
36
38
|
onClickItem: any;
|
|
37
39
|
onMouseUpItem: any;
|
|
38
40
|
onContextMenuItem: any;
|
|
39
|
-
|
|
41
|
+
onSortEnd: any;
|
|
42
|
+
} & {}, vue25.PublicProps>;
|
|
40
43
|
//#endregion
|
|
41
44
|
export { PropsType, SlotType, TabActionType, TabView as default };
|
package/lib/tab-view/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { a as useStyle, i as cM, n as cB, r as cE, t as c } from "./cssr-D9_M6jAV.js";
|
|
2
|
-
import { computed, createVNode, defineComponent, getCurrentInstance, inject, isVNode, nextTick, onMounted, ref } from "vue";
|
|
2
|
+
import { computed, createVNode, defineComponent, getCurrentInstance, inject, isVNode, nextTick, onMounted, onUnmounted, ref, watch } from "vue";
|
|
3
3
|
import { NTag } from "naive-ui";
|
|
4
4
|
import { useRouter } from "vue-router";
|
|
5
5
|
import { useEventListener } from "@vueuse/core";
|
|
6
|
+
import { useSortable } from "@semi-kit/hooks/sortable";
|
|
6
7
|
|
|
7
8
|
//#region src/_utils/get-provider.ts
|
|
8
9
|
let cachedProvider = null;
|
|
@@ -101,7 +102,8 @@ var styles_default = c([cB("tab-view", {
|
|
|
101
102
|
}), c("&:hover .n-tag", {
|
|
102
103
|
color: "var(--sk-tab-primary-color)",
|
|
103
104
|
backgroundColor: "var(--sk-tab-secondary-color)"
|
|
104
|
-
}, [c("button", { color: "var(--sk-tab-primary-color)" })])])])
|
|
105
|
+
}, [c("button", { color: "var(--sk-tab-primary-color)" })])])]),
|
|
106
|
+
c(".sk-tab-view-ghost", { opacity: .4 }, [c("*", { opacity: 0 })])
|
|
105
107
|
])]);
|
|
106
108
|
|
|
107
109
|
//#endregion
|
|
@@ -130,7 +132,22 @@ const TabView = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
130
132
|
});
|
|
131
133
|
});
|
|
132
134
|
};
|
|
133
|
-
|
|
135
|
+
watch(() => provider.tab?.value?.sortable, (v) => {
|
|
136
|
+
const instance = getInstance();
|
|
137
|
+
if (instance) instance.option("disabled", !v);
|
|
138
|
+
});
|
|
139
|
+
const { initSortable, destroy, getInstance } = useSortable(".sk-tab-view__tabs-wrapper", {
|
|
140
|
+
ghostClass: "sk-tab-view-ghost",
|
|
141
|
+
onEnd({ newIndex, oldIndex }) {
|
|
142
|
+
if (newIndex === void 0 || oldIndex === void 0 || newIndex === oldIndex) return;
|
|
143
|
+
props.onSortEnd?.(newIndex, oldIndex);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
onMounted(() => {
|
|
147
|
+
nextTick(initSortable);
|
|
148
|
+
syncScroll();
|
|
149
|
+
});
|
|
150
|
+
onUnmounted(destroy);
|
|
134
151
|
router.afterEach(syncScroll);
|
|
135
152
|
useEventListener(scrollContainer, "wheel", (e) => {
|
|
136
153
|
if (e.deltaY === 0) return;
|
|
@@ -186,7 +203,8 @@ const TabView = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
186
203
|
"type",
|
|
187
204
|
"onClickItem",
|
|
188
205
|
"onMouseUpItem",
|
|
189
|
-
"onContextMenuItem"
|
|
206
|
+
"onContextMenuItem",
|
|
207
|
+
"onSortEnd"
|
|
190
208
|
] });
|
|
191
209
|
var tab_view_default = TabView;
|
|
192
210
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vue27 from "vue";
|
|
2
2
|
import * as vue_jsx_runtime1 from "vue/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/wrapper/flex-col-wrapper/index.d.ts
|
|
5
|
-
declare const _default:
|
|
5
|
+
declare const _default: vue27.DefineComponent<{}, () => vue_jsx_runtime1.JSX.Element, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vue20 from "vue";
|
|
2
2
|
import * as vue_jsx_runtime0 from "vue/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/wrapper/flex-row-wrapper/index.d.ts
|
|
5
|
-
declare const _default:
|
|
5
|
+
declare const _default: vue20.DefineComponent<{}, () => vue_jsx_runtime0.JSX.Element, {}, {}, {}, vue20.ComponentOptionsMixin, vue20.ComponentOptionsMixin, {}, string, vue20.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue20.ComponentProvideOptions, true, {}, any>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vue15 from "vue";
|
|
2
2
|
import * as vue_jsx_runtime0 from "vue/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/wrapper/scroll-wrapper/index.d.ts
|
|
5
|
-
declare const _default:
|
|
5
|
+
declare const _default: vue15.DefineComponent<{}, () => vue_jsx_runtime0.JSX.Element, {}, {}, {}, vue15.ComponentOptionsMixin, vue15.ComponentOptionsMixin, {}, string, vue15.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue15.ComponentProvideOptions, true, {}, any>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semi-kit/component",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.13",
|
|
4
4
|
"description": "Semi-Kit Component Library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -61,7 +61,9 @@
|
|
|
61
61
|
"vite": "catalog:",
|
|
62
62
|
"vue": "catalog:",
|
|
63
63
|
"vue-router": "catalog:",
|
|
64
|
-
"vue-tsc": "catalog:"
|
|
64
|
+
"vue-tsc": "catalog:",
|
|
65
|
+
"sortablejs": "catalog:",
|
|
66
|
+
"@types/sortablejs": "catalog:"
|
|
65
67
|
},
|
|
66
68
|
"peerDependencies": {
|
|
67
69
|
"@css-render/plugin-bem": "*",
|
|
@@ -73,6 +75,8 @@
|
|
|
73
75
|
"less": "*",
|
|
74
76
|
"naive-ui": "*",
|
|
75
77
|
"vue": "*",
|
|
76
|
-
"vue-router": "*"
|
|
78
|
+
"vue-router": "*",
|
|
79
|
+
"sortablejs": "*",
|
|
80
|
+
"@types/sortablejs": "*"
|
|
77
81
|
}
|
|
78
82
|
}
|
package/lib/index-Bvg8aJV4.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as vue9 from "vue";
|
|
2
|
-
import { Ref } from "vue";
|
|
3
|
-
|
|
4
|
-
//#region src/app-provider/type.d.ts
|
|
5
|
-
interface AppProviderFormRuleConfig {
|
|
6
|
-
stringLength?: number;
|
|
7
|
-
numberLength?: number;
|
|
8
|
-
numberSize?: number;
|
|
9
|
-
decimalPlace?: number;
|
|
10
|
-
}
|
|
11
|
-
interface AppProviderTheme {
|
|
12
|
-
primaryColor?: string;
|
|
13
|
-
secondaryColor?: string;
|
|
14
|
-
radius?: number;
|
|
15
|
-
}
|
|
16
|
-
interface AppProviderContext {
|
|
17
|
-
locale?: Ref<string | undefined>;
|
|
18
|
-
formRuleConfig?: Ref<AppProviderFormRuleConfig>;
|
|
19
|
-
theme?: Ref<AppProviderTheme | undefined>;
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region src/app-provider/index.d.ts
|
|
23
|
-
declare const _default: vue9.DefineComponent<vue9.ExtractPropTypes<{
|
|
24
|
-
readonly locale: StringConstructor;
|
|
25
|
-
readonly formRuleConfig: vue9.PropType<AppProviderFormRuleConfig>;
|
|
26
|
-
readonly theme: vue9.PropType<AppProviderTheme>;
|
|
27
|
-
}>, () => vue9.VNode<vue9.RendererNode, vue9.RendererElement, {
|
|
28
|
-
[key: string]: any;
|
|
29
|
-
}>[] | undefined, {}, {}, {}, vue9.ComponentOptionsMixin, vue9.ComponentOptionsMixin, {}, string, vue9.PublicProps, Readonly<vue9.ExtractPropTypes<{
|
|
30
|
-
readonly locale: StringConstructor;
|
|
31
|
-
readonly formRuleConfig: vue9.PropType<AppProviderFormRuleConfig>;
|
|
32
|
-
readonly theme: vue9.PropType<AppProviderTheme>;
|
|
33
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, vue9.ComponentProvideOptions, true, {}, any>;
|
|
34
|
-
//#endregion
|
|
35
|
-
export { AppProviderContext as n, AppProviderFormRuleConfig as r, _default as t };
|