@semi-kit/component 1.4.11 → 1.4.12
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-D5VhkB_N.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-CaI2kmjx.js} +23 -4
- package/lib/wrapper/flex-col-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-D5VhkB_N.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 vue11 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: vue11.DefineComponent<vue11.ExtractPropTypes<{
|
|
28
|
+
readonly locale: StringConstructor;
|
|
29
|
+
readonly formRuleConfig: vue11.PropType<AppProviderFormRuleConfig>;
|
|
30
|
+
readonly theme: vue11.PropType<AppProviderTheme>;
|
|
31
|
+
readonly tab: vue11.PropType<AppProviderTab>;
|
|
32
|
+
}>, () => vue11.VNode<vue11.RendererNode, vue11.RendererElement, {
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}>[] | undefined, {}, {}, {}, vue11.ComponentOptionsMixin, vue11.ComponentOptionsMixin, {}, string, vue11.PublicProps, Readonly<vue11.ExtractPropTypes<{
|
|
35
|
+
readonly locale: StringConstructor;
|
|
36
|
+
readonly formRuleConfig: vue11.PropType<AppProviderFormRuleConfig>;
|
|
37
|
+
readonly theme: vue11.PropType<AppProviderTheme>;
|
|
38
|
+
readonly tab: vue11.PropType<AppProviderTab>;
|
|
39
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, vue11.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-D5VhkB_N.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-CaI2kmjx.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 vue9 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: vue9.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
|
+
} & {}, vue9.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,23 @@ const TabView = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
130
132
|
});
|
|
131
133
|
});
|
|
132
134
|
};
|
|
133
|
-
|
|
135
|
+
watch(() => provider.tab?.value?.sortable, (v) => {
|
|
136
|
+
console.log(v, 222);
|
|
137
|
+
const instance = getInstance();
|
|
138
|
+
if (instance) instance.option("disabled", !v);
|
|
139
|
+
});
|
|
140
|
+
const { initSortable, destroy, getInstance } = useSortable(".sk-tab-view__tabs-wrapper", {
|
|
141
|
+
ghostClass: "sk-tab-view-ghost",
|
|
142
|
+
onEnd({ newIndex, oldIndex }) {
|
|
143
|
+
if (newIndex === void 0 || oldIndex === void 0 || newIndex === oldIndex) return;
|
|
144
|
+
props.onSortEnd?.(newIndex, oldIndex);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
onMounted(() => {
|
|
148
|
+
nextTick(initSortable);
|
|
149
|
+
syncScroll();
|
|
150
|
+
});
|
|
151
|
+
onUnmounted(destroy);
|
|
134
152
|
router.afterEach(syncScroll);
|
|
135
153
|
useEventListener(scrollContainer, "wheel", (e) => {
|
|
136
154
|
if (e.deltaY === 0) return;
|
|
@@ -186,7 +204,8 @@ const TabView = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
186
204
|
"type",
|
|
187
205
|
"onClickItem",
|
|
188
206
|
"onMouseUpItem",
|
|
189
|
-
"onContextMenuItem"
|
|
207
|
+
"onContextMenuItem",
|
|
208
|
+
"onSortEnd"
|
|
190
209
|
] });
|
|
191
210
|
var tab_view_default = TabView;
|
|
192
211
|
|
|
@@ -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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semi-kit/component",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.12",
|
|
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 };
|