br-dionysus 0.0.1
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/.idea/dionysus.iml +12 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/LICENSE +21 -0
- package/README.md +0 -0
- package/build/base.config.ts +20 -0
- package/build/doc.config.ts +10 -0
- package/build/lib.config.ts +31 -0
- package/dist/index.css +1 -0
- package/dist/my-kit.es.js +254 -0
- package/dist/my-kit.umd.js +2 -0
- package/dist/packages/Button/index.d.ts +4 -0
- package/dist/packages/Button/src/index.vue.d.ts +4 -0
- package/dist/packages/Foo/index.d.ts +4 -0
- package/dist/packages/TabPage/index.d.ts +4 -0
- package/dist/packages/TabPage/src/index.vue.d.ts +70 -0
- package/dist/packages/index.d.ts +11 -0
- package/dist/src/env.d.ts +11 -0
- package/docs/assets/README.04f9b87a.js +1 -0
- package/docs/assets/README.e027c703.js +1 -0
- package/docs/assets/index.55b9c1a5.js +1 -0
- package/docs/assets/index.f005ac77.css +1 -0
- package/docs/assets/vendor.234e3e3c.js +12 -0
- package/docs/index.html +16 -0
- package/docs/packages/Button/docs/README.md +9 -0
- package/docs/packages/Button/docs/demo.vue +11 -0
- package/docs/packages/Button/index.ts +10 -0
- package/docs/packages/Button/src/index.vue +26 -0
- package/docs/packages/Foo/docs/README.md +28 -0
- package/docs/packages/Foo/docs/demo.vue +5 -0
- package/docs/packages/Foo/index.ts +12 -0
- package/docs/packages/Foo/src/index.vue +15 -0
- package/docs/packages/index.ts +23 -0
- package/docs/packages/list.json +14 -0
- package/index.html +13 -0
- package/package.json +30 -0
- package/packages/Button/docs/README.md +9 -0
- package/packages/Button/docs/demo.vue +11 -0
- package/packages/Button/index.ts +10 -0
- package/packages/Button/src/index.vue +26 -0
- package/packages/Foo/docs/README.md +28 -0
- package/packages/Foo/docs/demo.vue +5 -0
- package/packages/Foo/index.ts +12 -0
- package/packages/Foo/src/index.vue +15 -0
- package/packages/TabPage/index.ts +10 -0
- package/packages/TabPage/src/index.vue +499 -0
- package/packages/index.ts +26 -0
- package/packages/list.json +20 -0
- package/script/copyDir.js +7 -0
- package/script/genNewComp/.template/docs/README.md.tpl +28 -0
- package/script/genNewComp/.template/docs/demo.vue.tpl +5 -0
- package/script/genNewComp/.template/index.ts.tpl +12 -0
- package/script/genNewComp/.template/install.ts.tpl +20 -0
- package/script/genNewComp/.template/router.ts.tpl +25 -0
- package/script/genNewComp/.template/src/index.vue.tpl +15 -0
- package/script/genNewComp/index.js +9 -0
- package/script/genNewComp/infoCollector.js +63 -0
- package/script/genNewComp/tplReplacer.js +95 -0
- package/src/App.vue +46 -0
- package/src/assets/markdown.css +273 -0
- package/src/assets/prism.css +429 -0
- package/src/components/Preview.vue +101 -0
- package/src/env.d.ts +11 -0
- package/src/main.ts +12 -0
- package/src/router.ts +35 -0
- package/tsconfig.json +30 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$">
|
|
5
|
+
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
7
|
+
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
+
</content>
|
|
9
|
+
<orderEntry type="inheritedJdk" />
|
|
10
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
11
|
+
</component>
|
|
12
|
+
</module>
|
package/.idea/vcs.xml
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 JrainLau
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { resolve } from 'path';
|
|
2
|
+
import { defineConfig } from 'vite';
|
|
3
|
+
import vue from '@vitejs/plugin-vue';
|
|
4
|
+
import Markdown from 'vite-plugin-md';
|
|
5
|
+
|
|
6
|
+
// 文档: https://vitejs.dev/config/
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
resolve: {
|
|
9
|
+
alias: {
|
|
10
|
+
'@': resolve(__dirname, '../src'),
|
|
11
|
+
packages: resolve(__dirname, '../packages'),
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
plugins: [
|
|
15
|
+
vue({
|
|
16
|
+
include: [/\.vue$/, /\.md$/],
|
|
17
|
+
}),
|
|
18
|
+
Markdown(),
|
|
19
|
+
],
|
|
20
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import baseConfig from './base.config';
|
|
2
|
+
import { defineConfig } from 'vite';
|
|
3
|
+
import { resolve } from 'path';
|
|
4
|
+
import dts from 'vite-plugin-dts';
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
...baseConfig,
|
|
8
|
+
build: {
|
|
9
|
+
outDir: 'dist',
|
|
10
|
+
cssCodeSplit: true,
|
|
11
|
+
lib: {
|
|
12
|
+
entry: resolve(__dirname, '../packages/index.ts'),
|
|
13
|
+
name: 'MYKit',
|
|
14
|
+
fileName: (format) => `dionysus.${format}.js`,
|
|
15
|
+
},
|
|
16
|
+
rollupOptions: {
|
|
17
|
+
// 确保外部化处理那些你不想打包进库的依赖
|
|
18
|
+
external: ['vue'],
|
|
19
|
+
output: {
|
|
20
|
+
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
|
|
21
|
+
globals: {
|
|
22
|
+
vue: 'Vue'
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
plugins: [
|
|
28
|
+
...(baseConfig as any).plugins,
|
|
29
|
+
dts(),
|
|
30
|
+
]
|
|
31
|
+
});
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.my-button[data-v-5102a2ab]{appearance:none;padding:5px 10px;background:lightskyblue;border:none;border-radius:4px;color:#fff}.my-button[data-v-5102a2ab]:active{background:#5cb9f3}.my-button[data-v-5102a2ab]:not(:last-child){margin-right:15px}.g-box[data-v-e78ee1fa]{position:relative;overflow:hidden;padding-left:16px;padding-right:16px;width:100%;background-color:#fff;box-sizing:border-box}.g-box .u-page-btn[data-v-e78ee1fa]{position:absolute;bottom:0;height:33px;border:0;box-sizing:border-box;background-color:#fff;opacity:.6;cursor:pointer}.g-box .s-previous-btn[data-v-e78ee1fa]{left:0}.g-box .s-next-btn[data-v-e78ee1fa]{right:0;transform:rotate(180deg)}.g-dionysus-box[data-v-e78ee1fa]{overflow:hidden;width:100%}.g-tab-page-box[data-v-e78ee1fa]{display:flex;color:#4a4a4a;white-space:nowrap;box-sizing:border-box;box-shadow:2px 0 8px #1d23290d;transform:translate(0);transition:.2s}.g-tab-page-box .u-li[data-v-e78ee1fa]{display:inline-block;position:relative;height:33px;font-size:14px;box-sizing:border-box;cursor:pointer}.g-tab-page-box .u-li .u-gp[data-v-e78ee1fa]{display:flex;position:relative;z-index:1;padding:6px 8px;height:100%;align-items:center;background-color:#fff;border-radius:6px 6px 0 0;box-sizing:border-box}.g-tab-page-box .u-li .u-gp[data-v-e78ee1fa]:after{position:absolute;bottom:0;right:0;z-index:1;content:"";width:12px;height:12px;border-radius:6px 6px 0;pointer-events:none}.g-tab-page-box .u-li .u-gp[data-v-e78ee1fa]:before{position:absolute;bottom:0;left:0;z-index:1;content:"";width:12px;height:12px;border-radius:6px 6px 6px 0;pointer-events:none}.g-tab-page-box .u-li[data-v-e78ee1fa]:after{position:absolute;bottom:0;right:0;z-index:2;content:"";width:12px;height:12px;border-radius:6px;pointer-events:none}.g-tab-page-box .u-li[data-v-e78ee1fa]:before{position:absolute;bottom:0;left:0;z-index:2;content:"";width:12px;height:12px;border-radius:6px;pointer-events:none}.g-tab-page-box .u-li[data-hover=true] .u-gp[data-v-e78ee1fa],.g-tab-page-box .u-li[data-hover=true] .u-gp[data-v-e78ee1fa]:after,.g-tab-page-box .u-li[data-hover=true] .u-gp[data-v-e78ee1fa]:before,.g-tab-page-box .u-li[data-hover=true][data-active=false][data-v-e78ee1fa]:after,.g-tab-page-box .u-li[data-hover=true][data-active=false][data-v-e78ee1fa]:before{background-color:#dfe1e5}.g-tab-page-box .u-li[data-hover-before=true] .u-gp[data-v-e78ee1fa]:after{background-color:#dfe1e5}.g-tab-page-box .u-li[data-hover-before=true][data-v-e78ee1fa]:after{background-color:#fff}.g-tab-page-box .u-li[data-hover-after=true] .u-gp[data-v-e78ee1fa]:before{background-color:#dfe1e5}.g-tab-page-box .u-li[data-hover-after=true][data-v-e78ee1fa]:before{background-color:#fff}.g-tab-page-box .u-li[data-active-before=true] .u-gp[data-v-e78ee1fa]:after{background-color:#f0f0ff}.g-tab-page-box .u-li[data-active-before=true][data-v-e78ee1fa]:after{background-color:#fff}.g-tab-page-box .u-li[data-active-after=true] .u-gp[data-v-e78ee1fa]:before{background-color:#f0f0ff}.g-tab-page-box .u-li[data-active-after=true][data-v-e78ee1fa]:before{background-color:#fff}.g-tab-page-box .u-li[data-active=true][data-v-e78ee1fa]{color:#646cff}.g-tab-page-box .u-li[data-active=true] .u-gp[data-v-e78ee1fa],.g-tab-page-box .u-li[data-active=true] .u-gp[data-v-e78ee1fa]:before,.g-tab-page-box .u-li[data-active=true] .u-gp[data-v-e78ee1fa]:after,.g-tab-page-box .u-li[data-active=true][data-v-e78ee1fa]:after,.g-tab-page-box .u-li[data-active=true][data-v-e78ee1fa]:before{background-color:#f0f0ff}.g-tab-page-box .u-li .u-icon[data-v-e78ee1fa]{margin-right:14px;pointer-events:none}.g-tab-page-box .u-li .u-sn[data-v-e78ee1fa]{pointer-events:none}.g-tab-page-box .u-li .u-btn[data-v-e78ee1fa]{position:relative;margin-left:14px;width:14px;height:14px;font-size:14px;border-radius:50%}.g-tab-page-box .u-li .u-btn[data-v-e78ee1fa]:after{position:absolute;top:0;left:0;z-index:1;width:100%;height:100%;content:"";border-radius:50%}.g-tab-page-box .u-li .u-btn[data-v-e78ee1fa]:hover{color:#fff;background-color:#9ca3af}.g-tab-page-box .u-li[data-active=true] .u-btn[data-v-e78ee1fa]:hover{color:#fff;background-color:#646cff}.g-tab-page-box .s-icon[data-v-e78ee1fa]{display:block;position:relative;width:14px;height:14px}.g-tab-page-box .s-icon[data-v-e78ee1fa]:after{position:absolute;top:50%;left:50%;content:"";width:1px;height:10px;background-color:#303133;transform:translate(-50%,-50%) rotate(45deg)}.g-tab-page-box .s-icon[data-v-e78ee1fa]:before{position:absolute;top:50%;left:50%;content:"";width:1px;height:10px;background-color:#303133;transform:translate(-50%,-50%) rotate(-45deg)}.g-tab-page-box .u-li[data-active=true] .s-icon[data-v-e78ee1fa]:after,.g-tab-page-box .u-li[data-active=true] .s-icon[data-v-e78ee1fa]:before{background-color:#646cff}.g-tab-page-box .u-li .u-btn:hover .s-icon[data-v-e78ee1fa]:after,.g-tab-page-box .u-li .u-btn:hover .s-icon[data-v-e78ee1fa]:before{background-color:#fff}.g-tab-page-box .u-li[data-active=true] .u-btn:hover .s-icon[data-v-e78ee1fa]:after,.g-tab-page-box .u-li[data-active=true] .u-btn:hover .s-icon[data-v-e78ee1fa]:before{background-color:#fff}.g-tab-page-box .u-li[data-active=false][data-hover=false][data-active-before=false][data-hover-before=false] .u-sn[data-v-e78ee1fa]:after{position:absolute;top:50%;right:0;z-index:2;content:"";width:1px;height:50%;transform:translateY(-50%);background-color:#4a4a4a}.g-tab-page-box .u-li:nth-last-of-type(1)[data-active=false][data-hover=false] .u-sn[data-v-e78ee1fa]:after{background-color:#0000!important}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, renderSlot, ref, watch, computed, onMounted, createCommentVNode, createElementVNode, normalizeStyle, unref, Fragment, renderList, toDisplayString, withModifiers, pushScopeId, popScopeId } from "vue";
|
|
2
|
+
var index_vue_vue_type_style_index_0_scoped_true_lang$2 = "";
|
|
3
|
+
var _export_sfc = (sfc, props) => {
|
|
4
|
+
const target = sfc.__vccOpts || sfc;
|
|
5
|
+
for (const [key, val] of props) {
|
|
6
|
+
target[key] = val;
|
|
7
|
+
}
|
|
8
|
+
return target;
|
|
9
|
+
};
|
|
10
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
11
|
+
emits: ["click"],
|
|
12
|
+
setup(__props) {
|
|
13
|
+
return (_ctx, _cache) => {
|
|
14
|
+
return openBlock(), createElementBlock("button", {
|
|
15
|
+
class: "my-button",
|
|
16
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
|
|
17
|
+
}, [
|
|
18
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
19
|
+
]);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
var Button = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-5102a2ab"]]);
|
|
24
|
+
const ButtonPlugin = {
|
|
25
|
+
install(app) {
|
|
26
|
+
app.component("my-button", Button);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var index_vue_vue_type_style_index_0_scoped_true_lang$1 = "";
|
|
30
|
+
const _sfc_main$1 = {};
|
|
31
|
+
const _hoisted_1$1 = { class: "my-foo" };
|
|
32
|
+
function _sfc_render(_ctx, _cache) {
|
|
33
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, " \u6211\u662F\u6D4B\u8BD5\u7EC4\u4EF6\u7EC4\u4EF6 ");
|
|
34
|
+
}
|
|
35
|
+
var Foo = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__scopeId", "data-v-1df37c44"]]);
|
|
36
|
+
const FooPlugin = {
|
|
37
|
+
install(app) {
|
|
38
|
+
app.component("my-foo", Foo);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var index_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
42
|
+
const _withScopeId = (n) => (pushScopeId("data-v-e78ee1fa"), n = n(), popScopeId(), n);
|
|
43
|
+
const _hoisted_1 = { class: "g-box" };
|
|
44
|
+
const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("svg", {
|
|
45
|
+
t: "1704703004061",
|
|
46
|
+
class: "icon",
|
|
47
|
+
viewBox: "0 0 1024 1024",
|
|
48
|
+
version: "1.1",
|
|
49
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
50
|
+
"p-id": "4356",
|
|
51
|
+
width: "16",
|
|
52
|
+
height: "16"
|
|
53
|
+
}, [
|
|
54
|
+
/* @__PURE__ */ createElementVNode("path", {
|
|
55
|
+
d: "M671.807 927.804l-415.632-415.804 415.632-415.803 63.445 63.616-352.017 352.209 352.017 352.102z",
|
|
56
|
+
fill: "#272636",
|
|
57
|
+
"p-id": "4357"
|
|
58
|
+
})
|
|
59
|
+
], -1));
|
|
60
|
+
const _hoisted_3 = [
|
|
61
|
+
_hoisted_2
|
|
62
|
+
];
|
|
63
|
+
const _hoisted_4 = { class: "g-dionysus-box" };
|
|
64
|
+
const _hoisted_5 = ["data-active", "data-active-before", "data-active-after", "onMouseenter", "data-hover", "data-hover-before", "data-hover-after", "onClick"];
|
|
65
|
+
const _hoisted_6 = { class: "u-gp" };
|
|
66
|
+
const _hoisted_7 = { class: "u-sn" };
|
|
67
|
+
const _hoisted_8 = ["onClick"];
|
|
68
|
+
const _hoisted_9 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("i", { class: "s-icon" }, null, -1));
|
|
69
|
+
const _hoisted_10 = [
|
|
70
|
+
_hoisted_9
|
|
71
|
+
];
|
|
72
|
+
const _hoisted_11 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("svg", {
|
|
73
|
+
t: "1704703004061",
|
|
74
|
+
class: "icon",
|
|
75
|
+
viewBox: "0 0 1024 1024",
|
|
76
|
+
version: "1.1",
|
|
77
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
78
|
+
"p-id": "4356",
|
|
79
|
+
width: "16",
|
|
80
|
+
height: "16"
|
|
81
|
+
}, [
|
|
82
|
+
/* @__PURE__ */ createElementVNode("path", {
|
|
83
|
+
d: "M671.807 927.804l-415.632-415.804 415.632-415.803 63.445 63.616-352.017 352.209 352.017 352.102z",
|
|
84
|
+
fill: "#272636",
|
|
85
|
+
"p-id": "4357"
|
|
86
|
+
})
|
|
87
|
+
], -1));
|
|
88
|
+
const _hoisted_12 = [
|
|
89
|
+
_hoisted_11
|
|
90
|
+
];
|
|
91
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
92
|
+
props: {
|
|
93
|
+
modelValue: { default: () => [] },
|
|
94
|
+
activeKey: { default: "" },
|
|
95
|
+
showRightClickMenu: { type: Boolean, default: false }
|
|
96
|
+
},
|
|
97
|
+
emits: ["close", "click"],
|
|
98
|
+
setup(__props, { emit }) {
|
|
99
|
+
const props = __props;
|
|
100
|
+
const isContentOverflowing = (element) => {
|
|
101
|
+
return {
|
|
102
|
+
horizontal: element.scrollWidth > element.clientWidth,
|
|
103
|
+
vertical: element.scrollHeight > element.clientHeight
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
const activeKey = ref(props.activeKey);
|
|
107
|
+
watch(() => props.activeKey, (newVal) => {
|
|
108
|
+
activeKey.value = newVal;
|
|
109
|
+
});
|
|
110
|
+
const list = computed(() => {
|
|
111
|
+
return props.modelValue.map((item) => {
|
|
112
|
+
return {
|
|
113
|
+
key: item.key,
|
|
114
|
+
title: item.title
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
const isHorizontal = ref(false);
|
|
119
|
+
const horizontalMaxSize = ref(0);
|
|
120
|
+
const horizontalSize = ref(0);
|
|
121
|
+
const ulStyle = computed(() => {
|
|
122
|
+
const size = horizontalSize.value > horizontalMaxSize.value ? horizontalMaxSize.value : horizontalSize.value;
|
|
123
|
+
return {
|
|
124
|
+
transform: "translateX(-" + (isHorizontal.value ? size : 0) + "px)"
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
const previous = () => {
|
|
128
|
+
horizontalSize.value -= 300;
|
|
129
|
+
};
|
|
130
|
+
const next = () => {
|
|
131
|
+
horizontalSize.value += 300;
|
|
132
|
+
};
|
|
133
|
+
const checkHorizontal = () => {
|
|
134
|
+
const el = document.querySelector(".g-tab-page-box");
|
|
135
|
+
if (!el)
|
|
136
|
+
return false;
|
|
137
|
+
const { horizontal } = isContentOverflowing(el);
|
|
138
|
+
isHorizontal.value = horizontal;
|
|
139
|
+
if (horizontal)
|
|
140
|
+
horizontalMaxSize.value = el.scrollWidth - el.clientWidth;
|
|
141
|
+
};
|
|
142
|
+
watch(() => list.value, () => {
|
|
143
|
+
setTimeout(() => {
|
|
144
|
+
checkHorizontal();
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
onMounted(() => {
|
|
148
|
+
checkHorizontal();
|
|
149
|
+
});
|
|
150
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
151
|
+
checkHorizontal();
|
|
152
|
+
});
|
|
153
|
+
onMounted(() => {
|
|
154
|
+
const el = document.querySelector(".g-tab-page-box");
|
|
155
|
+
if (!el)
|
|
156
|
+
return false;
|
|
157
|
+
resizeObserver.observe(el);
|
|
158
|
+
});
|
|
159
|
+
const activeBeforeKey = computed(() => {
|
|
160
|
+
var _a;
|
|
161
|
+
const index = list.value.findIndex((item) => item.key === props.activeKey);
|
|
162
|
+
if (index === -1)
|
|
163
|
+
return -1;
|
|
164
|
+
return (_a = list.value[index - 1]) == null ? void 0 : _a.key;
|
|
165
|
+
});
|
|
166
|
+
const activeAfterKey = computed(() => {
|
|
167
|
+
var _a;
|
|
168
|
+
const index = list.value.findIndex((item) => item.key === props.activeKey);
|
|
169
|
+
if (index === -1)
|
|
170
|
+
return -1;
|
|
171
|
+
return (_a = list.value[index + 1]) == null ? void 0 : _a.key;
|
|
172
|
+
});
|
|
173
|
+
const hoverKey = ref(2);
|
|
174
|
+
const hoverBeforeKey = computed(() => {
|
|
175
|
+
var _a;
|
|
176
|
+
const index = list.value.findIndex((item) => item.key === hoverKey.value);
|
|
177
|
+
if (index === -1)
|
|
178
|
+
return -1;
|
|
179
|
+
return (_a = list.value[index - 1]) == null ? void 0 : _a.key;
|
|
180
|
+
});
|
|
181
|
+
const hoverAfterKey = computed(() => {
|
|
182
|
+
var _a;
|
|
183
|
+
const index = list.value.findIndex((item) => item.key === hoverKey.value);
|
|
184
|
+
if (index === -1)
|
|
185
|
+
return -1;
|
|
186
|
+
return (_a = list.value[index + 1]) == null ? void 0 : _a.key;
|
|
187
|
+
});
|
|
188
|
+
const openPage = (key) => {
|
|
189
|
+
emit("click", key);
|
|
190
|
+
};
|
|
191
|
+
const close = (keys = []) => {
|
|
192
|
+
emit("close", keys);
|
|
193
|
+
};
|
|
194
|
+
return (_ctx, _cache) => {
|
|
195
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
196
|
+
isHorizontal.value ? (openBlock(), createElementBlock("button", {
|
|
197
|
+
key: 0,
|
|
198
|
+
class: "u-page-btn s-previous-btn",
|
|
199
|
+
onClick: previous
|
|
200
|
+
}, _hoisted_3)) : createCommentVNode("", true),
|
|
201
|
+
createElementVNode("div", _hoisted_4, [
|
|
202
|
+
createElementVNode("ul", {
|
|
203
|
+
class: "g-tab-page-box",
|
|
204
|
+
style: normalizeStyle(unref(ulStyle)),
|
|
205
|
+
onMouseleave: _cache[0] || (_cache[0] = ($event) => hoverKey.value = -1)
|
|
206
|
+
}, [
|
|
207
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(props.modelValue, (item) => {
|
|
208
|
+
return openBlock(), createElementBlock("li", {
|
|
209
|
+
class: "u-li",
|
|
210
|
+
key: item.key,
|
|
211
|
+
"data-active": props.activeKey === item.key,
|
|
212
|
+
"data-active-before": unref(activeBeforeKey) === item.key,
|
|
213
|
+
"data-active-after": unref(activeAfterKey) === item.key,
|
|
214
|
+
onMouseenter: ($event) => hoverKey.value = item.key,
|
|
215
|
+
"data-hover": hoverKey.value === item.key,
|
|
216
|
+
"data-hover-before": unref(hoverBeforeKey) === item.key,
|
|
217
|
+
"data-hover-after": unref(hoverAfterKey) === item.key,
|
|
218
|
+
onClick: ($event) => openPage(item.key)
|
|
219
|
+
}, [
|
|
220
|
+
createElementVNode("div", _hoisted_6, [
|
|
221
|
+
createElementVNode("span", _hoisted_7, toDisplayString(item.title), 1),
|
|
222
|
+
createElementVNode("div", {
|
|
223
|
+
class: "u-btn",
|
|
224
|
+
onClick: withModifiers(($event) => close([item.key]), ["stop"])
|
|
225
|
+
}, _hoisted_10, 8, _hoisted_8)
|
|
226
|
+
])
|
|
227
|
+
], 40, _hoisted_5);
|
|
228
|
+
}), 128))
|
|
229
|
+
], 36)
|
|
230
|
+
]),
|
|
231
|
+
isHorizontal.value ? (openBlock(), createElementBlock("button", {
|
|
232
|
+
key: 1,
|
|
233
|
+
class: "u-page-btn s-next-btn",
|
|
234
|
+
onClick: next
|
|
235
|
+
}, _hoisted_12)) : createCommentVNode("", true)
|
|
236
|
+
]);
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
var TabPage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e78ee1fa"]]);
|
|
241
|
+
const TabPagePlugin = {
|
|
242
|
+
install(app) {
|
|
243
|
+
app.component("tab-page", TabPage);
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
const MYKitPlugin = {
|
|
247
|
+
install(app) {
|
|
248
|
+
var _a, _b, _c;
|
|
249
|
+
(_a = ButtonPlugin.install) == null ? void 0 : _a.call(ButtonPlugin, app);
|
|
250
|
+
(_b = FooPlugin.install) == null ? void 0 : _b.call(FooPlugin, app);
|
|
251
|
+
(_c = TabPagePlugin.install) == null ? void 0 : _c.call(TabPagePlugin, app);
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
export { Button, ButtonPlugin, Foo, FooPlugin, TabPage, TabPagePlugin, MYKitPlugin as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var __vite_style__=document.createElement("style");__vite_style__.innerHTML=`.my-button[data-v-5102a2ab]{appearance:none;padding:5px 10px;background:lightskyblue;border:none;border-radius:4px;color:#fff}.my-button[data-v-5102a2ab]:active{background:#5cb9f3}.my-button[data-v-5102a2ab]:not(:last-child){margin-right:15px}.g-box[data-v-e78ee1fa]{position:relative;overflow:hidden;padding-left:16px;padding-right:16px;width:100%;background-color:#fff;box-sizing:border-box}.g-box .u-page-btn[data-v-e78ee1fa]{position:absolute;bottom:0;height:33px;border:0;box-sizing:border-box;background-color:#fff;opacity:.6;cursor:pointer}.g-box .s-previous-btn[data-v-e78ee1fa]{left:0}.g-box .s-next-btn[data-v-e78ee1fa]{right:0;transform:rotate(180deg)}.g-dionysus-box[data-v-e78ee1fa]{overflow:hidden;width:100%}.g-tab-page-box[data-v-e78ee1fa]{display:flex;color:#4a4a4a;white-space:nowrap;box-sizing:border-box;box-shadow:2px 0 8px #1d23290d;transform:translate(0);transition:.2s}.g-tab-page-box .u-li[data-v-e78ee1fa]{display:inline-block;position:relative;height:33px;font-size:14px;box-sizing:border-box;cursor:pointer}.g-tab-page-box .u-li .u-gp[data-v-e78ee1fa]{display:flex;position:relative;z-index:1;padding:6px 8px;height:100%;align-items:center;background-color:#fff;border-radius:6px 6px 0 0;box-sizing:border-box}.g-tab-page-box .u-li .u-gp[data-v-e78ee1fa]:after{position:absolute;bottom:0;right:0;z-index:1;content:"";width:12px;height:12px;border-radius:6px 6px 0;pointer-events:none}.g-tab-page-box .u-li .u-gp[data-v-e78ee1fa]:before{position:absolute;bottom:0;left:0;z-index:1;content:"";width:12px;height:12px;border-radius:6px 6px 6px 0;pointer-events:none}.g-tab-page-box .u-li[data-v-e78ee1fa]:after{position:absolute;bottom:0;right:0;z-index:2;content:"";width:12px;height:12px;border-radius:6px;pointer-events:none}.g-tab-page-box .u-li[data-v-e78ee1fa]:before{position:absolute;bottom:0;left:0;z-index:2;content:"";width:12px;height:12px;border-radius:6px;pointer-events:none}.g-tab-page-box .u-li[data-hover=true] .u-gp[data-v-e78ee1fa],.g-tab-page-box .u-li[data-hover=true] .u-gp[data-v-e78ee1fa]:after,.g-tab-page-box .u-li[data-hover=true] .u-gp[data-v-e78ee1fa]:before,.g-tab-page-box .u-li[data-hover=true][data-active=false][data-v-e78ee1fa]:after,.g-tab-page-box .u-li[data-hover=true][data-active=false][data-v-e78ee1fa]:before{background-color:#dfe1e5}.g-tab-page-box .u-li[data-hover-before=true] .u-gp[data-v-e78ee1fa]:after{background-color:#dfe1e5}.g-tab-page-box .u-li[data-hover-before=true][data-v-e78ee1fa]:after{background-color:#fff}.g-tab-page-box .u-li[data-hover-after=true] .u-gp[data-v-e78ee1fa]:before{background-color:#dfe1e5}.g-tab-page-box .u-li[data-hover-after=true][data-v-e78ee1fa]:before{background-color:#fff}.g-tab-page-box .u-li[data-active-before=true] .u-gp[data-v-e78ee1fa]:after{background-color:#f0f0ff}.g-tab-page-box .u-li[data-active-before=true][data-v-e78ee1fa]:after{background-color:#fff}.g-tab-page-box .u-li[data-active-after=true] .u-gp[data-v-e78ee1fa]:before{background-color:#f0f0ff}.g-tab-page-box .u-li[data-active-after=true][data-v-e78ee1fa]:before{background-color:#fff}.g-tab-page-box .u-li[data-active=true][data-v-e78ee1fa]{color:#646cff}.g-tab-page-box .u-li[data-active=true] .u-gp[data-v-e78ee1fa],.g-tab-page-box .u-li[data-active=true] .u-gp[data-v-e78ee1fa]:before,.g-tab-page-box .u-li[data-active=true] .u-gp[data-v-e78ee1fa]:after,.g-tab-page-box .u-li[data-active=true][data-v-e78ee1fa]:after,.g-tab-page-box .u-li[data-active=true][data-v-e78ee1fa]:before{background-color:#f0f0ff}.g-tab-page-box .u-li .u-icon[data-v-e78ee1fa]{margin-right:14px;pointer-events:none}.g-tab-page-box .u-li .u-sn[data-v-e78ee1fa]{pointer-events:none}.g-tab-page-box .u-li .u-btn[data-v-e78ee1fa]{position:relative;margin-left:14px;width:14px;height:14px;font-size:14px;border-radius:50%}.g-tab-page-box .u-li .u-btn[data-v-e78ee1fa]:after{position:absolute;top:0;left:0;z-index:1;width:100%;height:100%;content:"";border-radius:50%}.g-tab-page-box .u-li .u-btn[data-v-e78ee1fa]:hover{color:#fff;background-color:#9ca3af}.g-tab-page-box .u-li[data-active=true] .u-btn[data-v-e78ee1fa]:hover{color:#fff;background-color:#646cff}.g-tab-page-box .s-icon[data-v-e78ee1fa]{display:block;position:relative;width:14px;height:14px}.g-tab-page-box .s-icon[data-v-e78ee1fa]:after{position:absolute;top:50%;left:50%;content:"";width:1px;height:10px;background-color:#303133;transform:translate(-50%,-50%) rotate(45deg)}.g-tab-page-box .s-icon[data-v-e78ee1fa]:before{position:absolute;top:50%;left:50%;content:"";width:1px;height:10px;background-color:#303133;transform:translate(-50%,-50%) rotate(-45deg)}.g-tab-page-box .u-li[data-active=true] .s-icon[data-v-e78ee1fa]:after,.g-tab-page-box .u-li[data-active=true] .s-icon[data-v-e78ee1fa]:before{background-color:#646cff}.g-tab-page-box .u-li .u-btn:hover .s-icon[data-v-e78ee1fa]:after,.g-tab-page-box .u-li .u-btn:hover .s-icon[data-v-e78ee1fa]:before{background-color:#fff}.g-tab-page-box .u-li[data-active=true] .u-btn:hover .s-icon[data-v-e78ee1fa]:after,.g-tab-page-box .u-li[data-active=true] .u-btn:hover .s-icon[data-v-e78ee1fa]:before{background-color:#fff}.g-tab-page-box .u-li[data-active=false][data-hover=false][data-active-before=false][data-hover-before=false] .u-sn[data-v-e78ee1fa]:after{position:absolute;top:50%;right:0;z-index:2;content:"";width:1px;height:50%;transform:translateY(-50%);background-color:#4a4a4a}.g-tab-page-box .u-li:nth-last-of-type(1)[data-active=false][data-hover=false] .u-sn[data-v-e78ee1fa]:after{background-color:#0000!important}
|
|
2
|
+
`;document.head.appendChild(__vite_style__);(function(i,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis!="undefined"?globalThis:i||self,e(i.MYKit={},i.Vue))})(this,function(i,e){"use strict";var X="",v=(a,d)=>{const r=a.__vccOpts||a;for(const[c,h]of d)r[c]=h;return r},y=v(e.defineComponent({emits:["click"],setup(a){return(d,r)=>(e.openBlock(),e.createElementBlock("button",{class:"my-button",onClick:r[0]||(r[0]=c=>d.$emit("click",c))},[e.renderSlot(d.$slots,"default",{},void 0,!0)]))}}),[["__scopeId","data-v-5102a2ab"]]);const f={install(a){a.component("my-button",y)}};var J="";const B={},E={class:"my-foo"};function V(a,d){return e.openBlock(),e.createElementBlock("div",E," \u6211\u662F\u6D4B\u8BD5\u7EC4\u4EF6\u7EC4\u4EF6 ")}var m=v(B,[["render",V],["__scopeId","data-v-1df37c44"]]);const b={install(a){a.component("my-foo",m)}};var Q="";const x=a=>(e.pushScopeId("data-v-e78ee1fa"),a=a(),e.popScopeId(),a),M={class:"g-box"},C=[x(()=>e.createElementVNode("svg",{t:"1704703004061",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4356",width:"16",height:"16"},[e.createElementVNode("path",{d:"M671.807 927.804l-415.632-415.804 415.632-415.803 63.445 63.616-352.017 352.209 352.017 352.102z",fill:"#272636","p-id":"4357"})],-1))],K={class:"g-dionysus-box"},S=["data-active","data-active-before","data-active-after","onMouseenter","data-hover","data-hover-before","data-hover-after","onClick"],N={class:"u-gp"},$={class:"u-sn"},I=["onClick"],T=[x(()=>e.createElementVNode("i",{class:"s-icon"},null,-1))],H=[x(()=>e.createElementVNode("svg",{t:"1704703004061",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4356",width:"16",height:"16"},[e.createElementVNode("path",{d:"M671.807 927.804l-415.632-415.804 415.632-415.803 63.445 63.616-352.017 352.209 352.017 352.102z",fill:"#272636","p-id":"4357"})],-1))];var w=v(e.defineComponent({props:{modelValue:{default:()=>[]},activeKey:{default:""},showRightClickMenu:{type:Boolean,default:!1}},emits:["close","click"],setup(a,{emit:d}){const r=a,c=t=>({horizontal:t.scrollWidth>t.clientWidth,vertical:t.scrollHeight>t.clientHeight}),h=e.ref(r.activeKey);e.watch(()=>r.activeKey,t=>{h.value=t});const l=e.computed(()=>r.modelValue.map(t=>({key:t.key,title:t.title}))),p=e.ref(!1),_=e.ref(0),g=e.ref(0),P=e.computed(()=>{const t=g.value>_.value?_.value:g.value;return{transform:"translateX(-"+(p.value?t:0)+"px)"}}),W=()=>{g.value-=300},q=()=>{g.value+=300},k=()=>{const t=document.querySelector(".g-tab-page-box");if(!t)return!1;const{horizontal:n}=c(t);p.value=n,n&&(_.value=t.scrollWidth-t.clientWidth)};e.watch(()=>l.value,()=>{setTimeout(()=>{k()})}),e.onMounted(()=>{k()});const F=new ResizeObserver(()=>{k()});e.onMounted(()=>{const t=document.querySelector(".g-tab-page-box");if(!t)return!1;F.observe(t)});const Y=e.computed(()=>{var n;const t=l.value.findIndex(o=>o.key===r.activeKey);return t===-1?-1:(n=l.value[t-1])==null?void 0:n.key}),j=e.computed(()=>{var n;const t=l.value.findIndex(o=>o.key===r.activeKey);return t===-1?-1:(n=l.value[t+1])==null?void 0:n.key}),s=e.ref(2),A=e.computed(()=>{var n;const t=l.value.findIndex(o=>o.key===s.value);return t===-1?-1:(n=l.value[t-1])==null?void 0:n.key}),L=e.computed(()=>{var n;const t=l.value.findIndex(o=>o.key===s.value);return t===-1?-1:(n=l.value[t+1])==null?void 0:n.key}),R=t=>{d("click",t)},D=(t=[])=>{d("close",t)};return(t,n)=>(e.openBlock(),e.createElementBlock("div",M,[p.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"u-page-btn s-previous-btn",onClick:W},C)):e.createCommentVNode("",!0),e.createElementVNode("div",K,[e.createElementVNode("ul",{class:"g-tab-page-box",style:e.normalizeStyle(e.unref(P)),onMouseleave:n[0]||(n[0]=o=>s.value=-1)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.modelValue,o=>(e.openBlock(),e.createElementBlock("li",{class:"u-li",key:o.key,"data-active":r.activeKey===o.key,"data-active-before":e.unref(Y)===o.key,"data-active-after":e.unref(j)===o.key,onMouseenter:z=>s.value=o.key,"data-hover":s.value===o.key,"data-hover-before":e.unref(A)===o.key,"data-hover-after":e.unref(L)===o.key,onClick:z=>R(o.key)},[e.createElementVNode("div",N,[e.createElementVNode("span",$,e.toDisplayString(o.title),1),e.createElementVNode("div",{class:"u-btn",onClick:e.withModifiers(z=>D([o.key]),["stop"])},T,8,I)])],40,S))),128))],36)]),p.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"u-page-btn s-next-btn",onClick:q},H)):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-e78ee1fa"]]);const u={install(a){a.component("tab-page",w)}},O={install(a){var d,r,c;(d=f.install)==null||d.call(f,a),(r=b.install)==null||r.call(b,a),(c=u.install)==null||c.call(u,a)}};i.Button=y,i.ButtonPlugin=f,i.Foo=m,i.FooPlugin=b,i.TabPage=w,i.TabPagePlugin=u,i.default=O,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _sfc_main: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{} & {} & {}> & {
|
|
2
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
3
|
+
}, {}>;
|
|
4
|
+
export default _sfc_main;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
interface MenuItem {
|
|
2
|
+
title: string;
|
|
3
|
+
key: string;
|
|
4
|
+
}
|
|
5
|
+
declare const _sfc_main: import("vue").DefineComponent<{
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: ArrayConstructor;
|
|
8
|
+
required: false;
|
|
9
|
+
default: () => never[];
|
|
10
|
+
};
|
|
11
|
+
activeKey: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
required: false;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
showRightClickMenu: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
required: false;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
21
|
+
}, {
|
|
22
|
+
isContentOverflowing: (element: Element) => {
|
|
23
|
+
horizontal: boolean;
|
|
24
|
+
vertical: boolean;
|
|
25
|
+
};
|
|
26
|
+
props: {
|
|
27
|
+
modelValue: MenuItem[];
|
|
28
|
+
activeKey: string;
|
|
29
|
+
showRightClickMenu: boolean;
|
|
30
|
+
};
|
|
31
|
+
activeKey: import("vue").Ref<string>;
|
|
32
|
+
emit: (event: "click" | "close", ...args: any[]) => void;
|
|
33
|
+
list: import("vue").ComputedRef<{
|
|
34
|
+
key: string;
|
|
35
|
+
title: string;
|
|
36
|
+
}[]>;
|
|
37
|
+
isHorizontal: import("vue").Ref<boolean>;
|
|
38
|
+
horizontalMaxSize: import("vue").Ref<number>;
|
|
39
|
+
horizontalSize: import("vue").Ref<number>;
|
|
40
|
+
ulStyle: import("vue").ComputedRef<{
|
|
41
|
+
transform: string;
|
|
42
|
+
}>;
|
|
43
|
+
previous: () => void;
|
|
44
|
+
next: () => void;
|
|
45
|
+
checkHorizontal: () => false | undefined;
|
|
46
|
+
resizeObserver: ResizeObserver;
|
|
47
|
+
activeBeforeKey: import("vue").ComputedRef<string | -1>;
|
|
48
|
+
activeAfterKey: import("vue").ComputedRef<string | -1>;
|
|
49
|
+
hoverKey: any;
|
|
50
|
+
hoverBeforeKey: import("vue").ComputedRef<string | -1>;
|
|
51
|
+
hoverAfterKey: import("vue").ComputedRef<string | -1>;
|
|
52
|
+
openPage: (key: string) => void;
|
|
53
|
+
close: (keys?: string[]) => void;
|
|
54
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "close")[], "click" | "close", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
55
|
+
modelValue?: unknown;
|
|
56
|
+
activeKey?: unknown;
|
|
57
|
+
showRightClickMenu?: unknown;
|
|
58
|
+
} & {
|
|
59
|
+
modelValue: unknown[];
|
|
60
|
+
activeKey: string;
|
|
61
|
+
showRightClickMenu: boolean;
|
|
62
|
+
} & {}> & {
|
|
63
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
64
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
65
|
+
}, {
|
|
66
|
+
modelValue: unknown[];
|
|
67
|
+
activeKey: string;
|
|
68
|
+
showRightClickMenu: boolean;
|
|
69
|
+
}>;
|
|
70
|
+
export default _sfc_main;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* !--------- FBI WARNING ----------!
|
|
3
|
+
*
|
|
4
|
+
* 根据 /packages 目录下的组件所生成的模块导出,请勿手动修改
|
|
5
|
+
*/
|
|
6
|
+
import { Plugin } from 'vue';
|
|
7
|
+
declare const MYKitPlugin: Plugin;
|
|
8
|
+
export default MYKitPlugin;
|
|
9
|
+
export * from './Button';
|
|
10
|
+
export * from './Foo';
|
|
11
|
+
export * from './TabPage';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare module '*.vue' {
|
|
2
|
+
import { DefineComponent } from 'vue';
|
|
3
|
+
const component: DefineComponent<{}, {}, any>;
|
|
4
|
+
export default component;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
declare module '*.md' {
|
|
8
|
+
import { ComponentOptions } from 'vue';
|
|
9
|
+
const Component: ComponentOptions;
|
|
10
|
+
export default Component;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,o as d,c as l,e as o,w as r,g as c,b as i}from"./vendor.234e3e3c.js";const u=c("\u7B2C\u4E00\u4E2A"),p=c("\u7B2C\u4E8C\u4E2A"),f=c("\u7B2C\u4E09\u4E2A"),v={setup(m){const e=_=>{console.log(`\u6211\u662F\u7B2C ${_} \u4E2A\u81EA\u5B9A\u4E49\u6309\u94AE`)};return(_,t)=>{const n=a("my-button");return d(),l("div",null,[o(n,{onClick:t[0]||(t[0]=s=>e(1))},{default:r(()=>[u]),_:1}),o(n,{onClick:t[1]||(t[1]=s=>e(2))},{default:r(()=>[p]),_:1}),o(n,{onClick:t[2]||(t[2]=s=>e(3))},{default:r(()=>[f]),_:1})])}}},k={class:"markdown-body"},$=i("h1",null,"\u6309\u94AE\u7EC4\u4EF6",-1),w={setup(m,{expose:e}){return e({frontmatter:{}}),(t,n)=>{const s=a("Preview");return d(),l("div",k,[$,o(s,{"comp-name":"Button","demo-name":"demo"},{default:r(()=>[o(v)]),_:1})])}}};export{w as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as s}from"./index.55b9c1a5.js";import{a as c,o as l,c as r,e as t,w as i,b as e,n as h}from"./vendor.234e3e3c.js";const y={};function x(a,n){const d=c("my-foo");return l(),r("div",null,[t(d)])}var g=s(y,[["render",x]]);const _={class:"markdown-body"},m=e("h1",null,"\u6D4B\u8BD5\u7EC4\u4EF6",-1),f=e("p",null,"\u9ED8\u8BA4\uFF1A\u8FD9\u662F\u4E00\u4E2A\u65B0\u7EC4\u4EF6",-1),u=e("h2",null,"\u57FA\u7840\u7528\u6CD5",-1),b=h('<h2>\u5C5E\u6027</h2><table><thead><tr><th style="text-align:center;">\u53C2\u6570</th><th style="text-align:center;">\u8BF4\u660E</th><th style="text-align:center;">\u7C7B\u578B</th><th style="text-align:center;">\u53EF\u9009\u503C</th><th style="text-align:center;">\u9ED8\u8BA4\u503C</th><th style="text-align:center;">\u662F\u5426\u5FC5\u586B</th></tr></thead><tbody><tr><td style="text-align:center;"><code>arg1</code></td><td style="text-align:center;">\u7B2C\u4E00\u4E2A\u53C2\u6570</td><td style="text-align:center;">string</td><td style="text-align:center;">-</td><td style="text-align:center;"><code>default</code></td><td style="text-align:center;">\u5426</td></tr><tr><td style="text-align:center;"><code>arg2</code></td><td style="text-align:center;">\u7B2C\u4E8C\u4E2A\u53C2\u6570</td><td style="text-align:center;">string</td><td style="text-align:center;">-</td><td style="text-align:center;"><code>default</code></td><td style="text-align:center;">\u5426</td></tr></tbody></table><h2>\u4E8B\u4EF6</h2><table><thead><tr><th style="text-align:center;">\u4E8B\u4EF6\u540D</th><th style="text-align:center;">\u8BF4\u660E</th><th style="text-align:center;">\u53C2\u6570\u5217\u8868</th><th style="text-align:center;">\u53C2\u6570\u8BF4\u660E</th></tr></thead><tbody><tr><td style="text-align:center;"><code>click</code></td><td style="text-align:center;">\u70B9\u51FB\u4E8B\u4EF6</td><td style="text-align:center;">$event</td><td style="text-align:center;">\u539F\u751F\u7684 dom event</td></tr><tr><td style="text-align:center;"><code>customEvent</code></td><td style="text-align:center;">\u81EA\u5B9A\u4E49\u4E8B\u4EF6</td><td style="text-align:center;">[a, b, c]</td><td style="text-align:center;">a\uFF1A\u53C2\u6570\u4E00\uFF1Bb\uFF1A\u53C2\u6570\u4E8C\uFF1Bc\uFF1A\u53C2\u6570\u4E09</td></tr></tbody></table>',4),B={setup(a,{expose:n}){return n({frontmatter:{}}),(p,v)=>{const o=c("Preview");return l(),r("div",_,[m,f,u,t(o,{"comp-name":"Foo","demo-name":"demo"},{default:i(()=>[t(g)]),_:1}),b])}}};export{B as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as C,a as p,o as a,c as l,b as i,F as w,d as N,u as $,e as b,f as E,w as x,g as S,t as f,h as L,i as P,j as B,k as h,P as D,l as A,v as V,m as O}from"./vendor.234e3e3c.js";const F=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))n(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const c of r.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function s(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerpolicy&&(r.referrerPolicy=e.referrerpolicy),e.crossorigin==="use-credentials"?r.credentials="include":e.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(e){if(e.ep)return;e.ep=!0;const r=s(e);fetch(e.href,r)}};F();var R=[{compName:"Button",compZhName:"\u6309\u94AE",compDesc:"\u8FD9\u662F\u4E00\u4E2A\u6309\u94AE",compClassName:"button"},{compName:"Foo",compZhName:"\u6D4B\u8BD5\u7EC4\u4EF6",compDesc:"\u9ED8\u8BA4\uFF1A\u8FD9\u662F\u4E00\u4E2A\u65B0\u7EC4\u4EF6",compClassName:"foo"}];const I={class:"my-kit-doc"},M={setup(o){const t=C({links:R.map(s=>({path:`/components/${s.compName}`,name:s.compZhName}))});return(s,n)=>{const e=p("router-link"),r=p("router-view");return a(),l("div",I,[i("aside",null,[(a(!0),l(w,null,N($(t).links,(c,u)=>(a(),E(e,{key:u,to:c.path},{default:x(()=>[S(f(c.name),1)]),_:2},1032,["to"]))),128))]),i("main",null,[b(r)])])}}},j="modulepreload",v={},q="/MY-Kit/",y=function(t,s){return!s||s.length===0?t():Promise.all(s.map(n=>{if(n=`${q}${n}`,n in v)return;v[n]=!0;const e=n.endsWith(".css"),r=e?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${n}"]${r}`))return;const c=document.createElement("link");if(c.rel=e?"stylesheet":j,e||(c.as="script",c.crossOrigin=""),c.href=n,document.head.appendChild(c),e)return new Promise((u,k)=>{c.addEventListener("load",u),c.addEventListener("error",k)})})).then(()=>t())},K=[{title:"\u6309\u94AE",name:"Button",path:"/components/Button",component:()=>y(()=>import("./README.04f9b87a.js"),["assets/README.04f9b87a.js","assets/vendor.234e3e3c.js"])},{title:"\u6D4B\u8BD5\u7EC4\u4EF6",name:"Foo",path:"/components/Foo",component:()=>y(()=>import("./README.e027c703.js"),["assets/README.e027c703.js","assets/vendor.234e3e3c.js"])}],T={history:L(),routes:K,scrollBehavior(o,t){if(o.path!==t.path)return{top:0}}},Y=P(T);var d=(o,t)=>{const s=o.__vccOpts||o;for(const[n,e]of t)s[n]=e;return s};const Z=B({emits:["click"],setup(o){return(t,s)=>(a(),l("button",{class:"my-button",onClick:s[0]||(s[0]=n=>t.$emit("click",n))},[h(t.$slots,"default",{},void 0,!0)]))}});var H=d(Z,[["__scopeId","data-v-5102a2ab"]]);const m={install(o){o.component("my-button",H)}};const W={},z={class:"my-foo"};function G(o,t){return a(),l("div",z," \u6211\u662F\u6D4B\u8BD5\u7EC4\u4EF6\u7EC4\u4EF6 ")}var J=d(W,[["render",G],["__scopeId","data-v-1df37c44"]]);const _={install(o){o.component("my-foo",J)}},Q={install(o){var t,s;(t=m.install)==null||t.call(m,o),(s=_.install)==null||s.call(_,o)}};const U={props:{compName:{type:String,default:"",require:!0},demoName:{type:String,default:"",require:!0}},data(){return{sourceCode:"",codeVisible:!1}},computed:{previewSourceCode(){return this.sourceCode.replace(/'\.\.\/\.\.\/index'/g,"'@tencent/my-kit'")}},async mounted(){this.compName&&this.demoName&&(this.sourceCode=await fetch(`/MY-Kit/packages/${this.compName}/docs/${this.demoName}.vue`).then(o=>o.text())),await this.$nextTick(),D.highlightAll()},methods:{async copyCode(){},showSourceCode(){this.codeVisible=!this.codeVisible}}},X={class:"mykit-preview"},ee={class:"source-code"},te={class:"language-html"},oe={class:"language-html"},se={class:"preview-bottom"};function re(o,t,s,n,e,r){return a(),l("div",X,[i("section",null,[h(o.$slots,"default")]),A(i("div",ee,[i("pre",te,[i("code",oe,f(r.previewSourceCode),1)])],512),[[V,e.codeVisible]]),i("div",se,[i("span",{name:"Code",onClick:t[0]||(t[0]=(...c)=>r.showSourceCode&&r.showSourceCode(...c))},"\u67E5\u770B\u4EE3\u7801")])])}var ne=d(U,[["render",re]]);const g=O(M);g.component("Preview",ne);g.use(Q).use(Y).mount("#app");export{d as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
html,body{margin:0;padding:0}.my-kit-doc{display:flex;min-height:100vh}.my-kit-doc aside{width:200px;padding:15px;border-right:1px solid #ccc;display:flex;flex-direction:column}.my-kit-doc main{width:100%;flex:1;padding:15px}:root{--side-bar-bg-color: #fff;--control-text-color: #777;--font-sans-serif: "Ubuntu", "Source Sans Pro", sans-serif !important;--font-monospace: "Fira Code", "Roboto Mono", monospace !important}html{font-size:16px}body{font-family:var(--font-sans-serif);color:#34495e;-webkit-font-smoothing:antialiased;line-height:1.6rem;letter-spacing:0;margin:0;overflow-x:hidden}body>*:first-child{margin-top:0!important}body>*:last-child{margin-bottom:0!important}a{color:#42b983;font-weight:600;padding:0 2px;text-decoration:none}h1,h2,h3,h4,h5,h6{position:relative;margin-top:1rem;margin-bottom:1rem;font-weight:700;line-height:1.4;cursor:text}h1:hover a.anchor,h2:hover a.anchor,h3:hover a.anchor,h4:hover a.anchor,h5:hover a.anchor,h6:hover a.anchor{text-decoration:none}h1 tt,h1 code{font-size:inherit!important}h2 tt,h2 code{font-size:inherit!important}h3 tt,h3 code{font-size:inherit!important}h4 tt,h4 code{font-size:inherit!important}h5 tt,h5 code{font-size:inherit!important}h6 tt,h6 code{font-size:inherit!important}h2 a,h3 a{color:#34495e}h1{padding-bottom:.4rem;font-size:2.2rem;line-height:1.3}h2{font-size:1.75rem;line-height:1.225;margin:35px 0 15px;padding-bottom:.5em;border-bottom:1px solid #ddd}h3{font-size:1.4rem;line-height:1.43;margin:20px 0 7px}h4{font-size:1.2rem}h5{font-size:1rem}h6{font-size:1rem;color:#777}p,blockquote,ul,ol,dl,table{margin:.8em 0}li>ol,li>ul{margin:0}hr{height:2px;padding:0;margin:16px 0;background-color:#e7e7e7;border:0 none;overflow:hidden;box-sizing:content-box}body>h2:first-child{margin-top:0;padding-top:0}body>h1:first-child{margin-top:0;padding-top:0}body>h1:first-child+h2{margin-top:0;padding-top:0}body>h3:first-child,body>h4:first-child,body>h5:first-child,body>h6:first-child{margin-top:0;padding-top:0}a:first-child h1,a:first-child h2,a:first-child h3,a:first-child h4,a:first-child h5,a:first-child h6{margin-top:0;padding-top:0}h1 p,h2 p,h3 p,h4 p,h5 p,h6 p{margin-top:0}li p.first{display:inline-block}ul,ol{padding-left:30px}ul:first-child,ol:first-child{margin-top:0}ul:last-child,ol:last-child{margin-bottom:0}blockquote{border-left:4px solid #42b983;padding:10px 15px;color:#777;background-color:#42b9831a}table{padding:0;word-break:initial}table tr{border-top:1px solid #dfe2e5;margin:0;padding:0}table tr:nth-child(2n),thead{background-color:#fafafa}table tr th{font-weight:700;border:1px solid #dfe2e5;border-bottom:0;text-align:left;margin:0;padding:6px 13px}table tr td{border:1px solid #dfe2e5;text-align:left;margin:0;padding:6px 13px}table tr th:first-child,table tr td:first-child{margin-top:0}table tr th:last-child,table tr td:last-child{margin-bottom:0}code{color:#476582;padding:.25rem .5rem;margin:0;font-size:.85em;background-color:#1b1f230d;border-radius:3px}pre{max-height:500px}.my-button[data-v-5102a2ab]{appearance:none;padding:5px 10px;background:lightskyblue;border:none;border-radius:4px;color:#fff}.my-button[data-v-5102a2ab]:active{background:#5cb9f3}.my-button[data-v-5102a2ab]:not(:last-child){margin-right:15px}code[class*=language-],pre[class*=language-]{padding:0;background:hsl(230,1%,98%);color:#383a42;font-family:Fira Code,Fira Mono,Menlo,Consolas,DejaVu Sans Mono,monospace;direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;line-height:1.5;-moz-tab-size:2;-o-tab-size:2;tab-size:2;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-]::-moz-selection,code[class*=language-] *::-moz-selection,pre[class*=language-] *::-moz-selection{background:hsl(230,1%,90%);color:inherit}code[class*=language-]::selection,code[class*=language-] *::selection,pre[class*=language-] *::selection{background:hsl(230,1%,90%);color:inherit}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border-radius:.3em}:not(pre)>code[class*=language-]{padding:.2em .3em;border-radius:.3em;white-space:normal}.token.comment,.token.prolog,.token.cdata{color:#a0a1a7}.token.doctype,.token.punctuation,.token.entity{color:#383a42}.token.attr-name,.token.class-name,.token.boolean,.token.constant,.token.number,.token.atrule{color:#b76b01}.token.keyword{color:#a626a4}.token.property,.token.tag,.token.symbol,.token.deleted,.token.important{color:#e45649}.token.selector,.token.string,.token.char,.token.builtin,.token.inserted,.token.regex,.token.attr-value,.token.attr-value>.token.punctuation{color:#50a14f}.token.variable,.token.operator,.token.function{color:#4078f2}.token.url{color:#0184bc}.token.attr-value>.token.punctuation.attr-equals,.token.special-attr>.token.attr-value>.token.value.css{color:#383a42}.language-css .token.selector{color:#e45649}.language-css .token.property{color:#383a42}.language-css .token.function,.language-css .token.url>.token.function{color:#0184bc}.language-css .token.url>.token.string.url{color:#50a14f}.language-css .token.important,.language-css .token.atrule .token.rule,.language-javascript .token.operator{color:#a626a4}.language-javascript .token.template-string>.token.interpolation>.token.interpolation-punctuation.punctuation{color:#ca1243}.language-json .token.operator{color:#383a42}.language-json .token.null.keyword{color:#b76b01}.language-markdown .token.url,.language-markdown .token.url>.token.operator,.language-markdown .token.url-reference.url>.token.string{color:#383a42}.language-markdown .token.url>.token.content{color:#4078f2}.language-markdown .token.url>.token.url,.language-markdown .token.url-reference.url{color:#0184bc}.language-markdown .token.blockquote.punctuation,.language-markdown .token.hr.punctuation{color:#a0a1a7;font-style:italic}.language-markdown .token.code-snippet{color:#50a14f}.language-markdown .token.bold .token.content{color:#b76b01}.language-markdown .token.italic .token.content{color:#a626a4}.language-markdown .token.strike .token.content,.language-markdown .token.strike .token.punctuation,.language-markdown .token.list.punctuation,.language-markdown .token.title.important>.token.punctuation{color:#e45649}.token.bold{font-weight:700}.token.comment,.token.italic{font-style:italic}.token.entity{cursor:help}.token.namespace{opacity:.8}.token.token.tab:not(:empty):before,.token.token.cr:before,.token.token.lf:before,.token.token.space:before{color:#383a4233}div.code-toolbar>.toolbar.toolbar>.toolbar-item{margin-right:.4em}div.code-toolbar>.toolbar.toolbar>.toolbar-item>button,div.code-toolbar>.toolbar.toolbar>.toolbar-item>a,div.code-toolbar>.toolbar.toolbar>.toolbar-item>span{background:hsl(230,1%,90%);color:#696c77;padding:.1em .4em;border-radius:.3em}div.code-toolbar>.toolbar.toolbar>.toolbar-item>button:hover,div.code-toolbar>.toolbar.toolbar>.toolbar-item>button:focus,div.code-toolbar>.toolbar.toolbar>.toolbar-item>a:hover,div.code-toolbar>.toolbar.toolbar>.toolbar-item>a:focus,div.code-toolbar>.toolbar.toolbar>.toolbar-item>span:hover,div.code-toolbar>.toolbar.toolbar>.toolbar-item>span:focus{background:hsl(230,1%,78%);color:#383a42}.line-highlight.line-highlight{background:hsla(230,8%,24%,.05)}.line-highlight.line-highlight:before,.line-highlight.line-highlight[data-end]:after{background:hsl(230,1%,90%);color:#383a42;padding:.1em .6em;border-radius:.3em;box-shadow:0 2px #0003}pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows>span:hover:before{background-color:#383a420d}.line-numbers.line-numbers .line-numbers-rows,.command-line .command-line-prompt{border-right-color:#383a4233}.line-numbers .line-numbers-rows>span:before,.command-line .command-line-prompt>span:before{color:#9d9d9f}.rainbow-braces .token.token.punctuation.brace-level-1,.rainbow-braces .token.token.punctuation.brace-level-5,.rainbow-braces .token.token.punctuation.brace-level-9{color:#e45649}.rainbow-braces .token.token.punctuation.brace-level-2,.rainbow-braces .token.token.punctuation.brace-level-6,.rainbow-braces .token.token.punctuation.brace-level-10{color:#50a14f}.rainbow-braces .token.token.punctuation.brace-level-3,.rainbow-braces .token.token.punctuation.brace-level-7,.rainbow-braces .token.token.punctuation.brace-level-11{color:#4078f2}.rainbow-braces .token.token.punctuation.brace-level-4,.rainbow-braces .token.token.punctuation.brace-level-8,.rainbow-braces .token.token.punctuation.brace-level-12{color:#a626a4}pre.diff-highlight>code .token.token.deleted:not(.prefix),pre>code.diff-highlight .token.token.deleted:not(.prefix){background-color:#ff526626}pre.diff-highlight>code .token.token.deleted:not(.prefix)::-moz-selection,pre.diff-highlight>code .token.token.deleted:not(.prefix) *::-moz-selection,pre>code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection,pre>code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection{background-color:#fb566940}pre.diff-highlight>code .token.token.deleted:not(.prefix)::selection,pre.diff-highlight>code .token.token.deleted:not(.prefix) *::selection,pre>code.diff-highlight .token.token.deleted:not(.prefix)::selection,pre>code.diff-highlight .token.token.deleted:not(.prefix) *::selection{background-color:#fb566940}pre.diff-highlight>code .token.token.inserted:not(.prefix),pre>code.diff-highlight .token.token.inserted:not(.prefix){background-color:#1aff5b26}pre.diff-highlight>code .token.token.inserted:not(.prefix)::-moz-selection,pre.diff-highlight>code .token.token.inserted:not(.prefix) *::-moz-selection,pre>code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection,pre>code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection{background-color:#38e06240}pre.diff-highlight>code .token.token.inserted:not(.prefix)::selection,pre.diff-highlight>code .token.token.inserted:not(.prefix) *::selection,pre>code.diff-highlight .token.token.inserted:not(.prefix)::selection,pre>code.diff-highlight .token.token.inserted:not(.prefix) *::selection{background-color:#38e06240}.prism-previewer.prism-previewer:before,.prism-previewer-gradient.prism-previewer-gradient div{border-color:hsl(0,0,95%)}.prism-previewer-color.prism-previewer-color:before,.prism-previewer-gradient.prism-previewer-gradient div,.prism-previewer-easing.prism-previewer-easing:before{border-radius:.3em}.prism-previewer.prism-previewer:after{border-top-color:hsl(0,0,95%)}.prism-previewer-flipped.prism-previewer-flipped.after{border-bottom-color:hsl(0,0,95%)}.prism-previewer-angle.prism-previewer-angle:before,.prism-previewer-time.prism-previewer-time:before,.prism-previewer-easing.prism-previewer-easing{background:hsl(0,0%,100%)}.prism-previewer-angle.prism-previewer-angle circle,.prism-previewer-time.prism-previewer-time circle{stroke:#383a42;stroke-opacity:1}.prism-previewer-easing.prism-previewer-easing circle,.prism-previewer-easing.prism-previewer-easing path,.prism-previewer-easing.prism-previewer-easing line{stroke:#383a42}.prism-previewer-easing.prism-previewer-easing circle{fill:transparent}pre{line-height:0}.mykit-preview{border:4px;border:1px dashed #e7e7e7;padding:10px;border-bottom:1px dashed #e7e7e7}.mykit-preview section{margin:15px}.source-code{max-height:500px}.language-html{margin:0;padding:0 15px}.preview-bottom{height:40px;display:flex;justify-content:center;align-items:center;border-top:1px dashed #e7e7e7}
|