@bruce_cao/vue3-component-library 0.0.7

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/README.md ADDED
@@ -0,0 +1,11 @@
1
+ src/
2
+ ├── components/ # 公共组件目录
3
+ │ ├── Button/ # 示例组件(按钮)
4
+ │ │ ├── index.ts # 组件导出
5
+ │ │ ├── Button.vue # 组件源码
6
+ │ ├── index.ts # 所有组件统一导出
7
+ ├── types/ # 类型定义目录
8
+ │ ├── index.d.ts # 全局类型
9
+ ├── styles/ # 全局样式
10
+ │ ├── index.scss # 样式入口(可安装sass支持)
11
+ ├── index.ts # 组件库入口(供外部引入)
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,40 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
+ type: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ validator: (val: string) => boolean;
10
+ };
11
+ disabled: {
12
+ type: BooleanConstructor;
13
+ default: boolean;
14
+ };
15
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
+ click: (e: MouseEvent) => any;
17
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
18
+ type: {
19
+ type: StringConstructor;
20
+ default: string;
21
+ validator: (val: string) => boolean;
22
+ };
23
+ disabled: {
24
+ type: BooleanConstructor;
25
+ default: boolean;
26
+ };
27
+ }>> & Readonly<{
28
+ onClick?: ((e: MouseEvent) => any) | undefined;
29
+ }>, {
30
+ type: string;
31
+ disabled: boolean;
32
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
33
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
34
+ declare const _default: typeof __VLS_export;
35
+ export default _default;
36
+ type __VLS_WithSlots<T, S> = T & {
37
+ new (): {
38
+ $slots: S;
39
+ };
40
+ };
@@ -0,0 +1,2 @@
1
+ import Button from './Button.vue';
2
+ export default Button;
@@ -0,0 +1,7 @@
1
+ import Button from './Button';
2
+ import type { App } from 'vue';
3
+ export { Button };
4
+ declare const _default: {
5
+ install: (app: App) => void;
6
+ };
7
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import './styles/index.scss';
2
+ export * from './components';
3
+ declare const _default: {
4
+ install: (app: any) => void;
5
+ };
6
+ export default _default;
@@ -0,0 +1 @@
1
+ import './style.css';
package/dist/vite.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1 @@
1
+ .v-btn[data-v-32268c3b]{padding:8px 16px;border:none;border-radius:4px;cursor:pointer;transition:background-color .2s}.v-btn--default[data-v-32268c3b]{background:#f5f5f5;color:#333;border:1px solid #333}.v-btn--default[data-v-32268c3b]:hover{background:#e5e5e5}.v-btn--primary[data-v-32268c3b]{background:#409eff;color:#fff}.v-btn--primary[data-v-32268c3b]:hover{background:#66b1ff}.v-btn[data-v-32268c3b]:disabled{opacity:.6;cursor:not-allowed}
@@ -0,0 +1,53 @@
1
+ import { defineComponent as c, createElementBlock as i, openBlock as d, normalizeClass as r, renderSlot as u } from "vue";
2
+ const f = ["disabled"], m = /* @__PURE__ */ c({
3
+ __name: "Button",
4
+ props: {
5
+ type: {
6
+ type: String,
7
+ default: "default",
8
+ validator: (t) => ["primary", "default"].includes(t)
9
+ },
10
+ disabled: {
11
+ type: Boolean,
12
+ default: !1
13
+ }
14
+ },
15
+ emits: ["click"],
16
+ setup(t, { emit: e }) {
17
+ const o = t, l = e, a = (s) => {
18
+ o.disabled || l("click", s);
19
+ };
20
+ return (s, B) => (d(), i("button", {
21
+ class: r(["v-btn", [{ "v-btn--primary": t.type === "primary" }, { "v-btn--default": t.type === "default" }]]),
22
+ disabled: t.disabled,
23
+ onClick: a
24
+ }, [
25
+ u(s.$slots, "default", {}, void 0, !0)
26
+ ], 10, f));
27
+ }
28
+ }), p = (t, e) => {
29
+ const o = t.__vccOpts || t;
30
+ for (const [l, a] of e)
31
+ o[l] = a;
32
+ return o;
33
+ }, n = /* @__PURE__ */ p(m, [["__scopeId", "data-v-32268c3b"]]);
34
+ n.install = (t) => {
35
+ t.component(n.name || "VButton", n);
36
+ };
37
+ const b = [n], y = (t) => {
38
+ b.forEach((e) => {
39
+ t.component(e.name || "", e);
40
+ });
41
+ }, _ = { install: y }, v = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
42
+ __proto__: null,
43
+ Button: n,
44
+ default: _
45
+ }, Symbol.toStringTag, { value: "Module" })), k = (t) => {
46
+ Object.values(v).forEach((e) => {
47
+ e.install && t.use(e);
48
+ });
49
+ }, g = { install: k };
50
+ export {
51
+ n as Button,
52
+ g as default
53
+ };
@@ -0,0 +1 @@
1
+ (function(o,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(o=typeof globalThis<"u"?globalThis:o||self,t(o.Vue3ComponentLibrary={},o.Vue))})(this,(function(o,t){"use strict";const d=["disabled"],l=((e,n)=>{const i=e.__vccOpts||e;for(const[s,a]of n)i[s]=a;return i})(t.defineComponent({__name:"Button",props:{type:{type:String,default:"default",validator:e=>["primary","default"].includes(e)},disabled:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:n}){const i=e,s=n,a=c=>{i.disabled||s("click",c)};return(c,v)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["v-btn",[{"v-btn--primary":e.type==="primary"},{"v-btn--default":e.type==="default"}]]),disabled:e.disabled,onClick:a},[t.renderSlot(c.$slots,"default",{},void 0,!0)],10,d))}}),[["__scopeId","data-v-32268c3b"]]);l.install=e=>{e.component(l.name||"VButton",l)};const u=[l],r=Object.freeze(Object.defineProperty({__proto__:null,Button:l,default:{install:e=>{u.forEach(n=>{e.component(n.name||"",n)})}}},Symbol.toStringTag,{value:"Module"})),f={install:e=>{Object.values(r).forEach(n=>{n.install&&e.use(n)})}};o.Button=l,o.default=f,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@bruce_cao/vue3-component-library",
3
+ "private": false,
4
+ "version": "0.0.7",
5
+ "scripts": {
6
+ "dev": "vite",
7
+ "build": "vite build && echo '开始生成类型声明' && vue-tsc",
8
+ "build:types": "vue-tsc --noEmit false --declaration true --emitDeclarationOnly true",
9
+ "preview": "vite preview",
10
+ "lint": "eslint . --fix --debug",
11
+ "lint:check": "eslint .",
12
+ "format": "prettier --write \"src/**/*.{vue,ts,scss}\"",
13
+ "test": "vitest run",
14
+ "test:watch": "vitest",
15
+ "test:coverage": "vitest run --coverage",
16
+ "docs:dev": "vitepress dev docs",
17
+ "docs:build": "vitepress build docs",
18
+ "docs:preview": "vitepress preview docs"
19
+ },
20
+ "dependencies": {
21
+ "vue": "^3.5.24"
22
+ },
23
+ "devDependencies": {
24
+ "@eslint/js": "^9.39.2",
25
+ "@types/jest": "^30.0.0",
26
+ "@types/node": "^25.0.3",
27
+ "@typescript-eslint/eslint-plugin": "^8.50.0",
28
+ "@typescript-eslint/parser": "^8.50.0",
29
+ "@vitejs/plugin-vue": "^6.0.1",
30
+ "@vitest/coverage-v8": "^4.0.16",
31
+ "@vue/test-utils": "^2.4.6",
32
+ "@vue/tsconfig": "^0.8.1",
33
+ "eslint": "^9.39.2",
34
+ "eslint-config-prettier": "^10.1.8",
35
+ "eslint-plugin-prettier": "^5.5.4",
36
+ "eslint-plugin-vue": "^10.6.2",
37
+ "happy-dom": "^20.0.11",
38
+ "markdown-it": "^14.1.0",
39
+ "markdown-it-container": "^4.0.0",
40
+ "prettier": "^3.7.4",
41
+ "sass": "^1.97.0",
42
+ "typescript": "~5.9.3",
43
+ "vite": "^7.2.4",
44
+ "vitepress": "^1.6.4",
45
+ "vitest": "^4.0.16",
46
+ "vue-eslint-parser": "^10.2.0",
47
+ "vue-tsc": "^3.1.4"
48
+ },
49
+ "main": "./dist/vue3-component-library.umd.js",
50
+ "module": "./dist/vue3-component-library.es.js",
51
+ "types": "./dist/types/index.d.ts",
52
+ "files": [
53
+ "dist"
54
+ ],
55
+ "peerDependencies": {
56
+ "vue": "^3.0.0"
57
+ },
58
+ "license": "MIT",
59
+ "repository": {
60
+ "type": "git",
61
+ "url": "https://jihulab.com/chj_158-group/vue3-component-library.git"
62
+ },
63
+ "keywords": ["vue3", "Component library", "ts", "vite"],
64
+ "author": "bruce_cao 15833355879@163.com"
65
+ }