@can2421/ui 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/dist/index.es.js +59 -0
- package/dist/index.umd.js +1 -0
- package/dist/ui.css +1 -0
- package/package.json +43 -0
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { defineComponent as l, createElementBlock as a, openBlock as r, normalizeClass as d, renderSlot as p } from "vue";
|
|
2
|
+
const u = {
|
|
3
|
+
type: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: "primary"
|
|
6
|
+
},
|
|
7
|
+
disabled: {
|
|
8
|
+
type: Boolean,
|
|
9
|
+
default: !1
|
|
10
|
+
}
|
|
11
|
+
}, f = ["disabled"], m = /* @__PURE__ */ l({
|
|
12
|
+
__name: "Button",
|
|
13
|
+
props: u,
|
|
14
|
+
emits: ["click"],
|
|
15
|
+
setup(t, { emit: e }) {
|
|
16
|
+
const o = t, s = e;
|
|
17
|
+
function c(n) {
|
|
18
|
+
o.disabled || s("click", n);
|
|
19
|
+
}
|
|
20
|
+
return (n, C) => (r(), a("button", {
|
|
21
|
+
class: d(["hyc-button", [
|
|
22
|
+
`hyc-button--${n.type}`,
|
|
23
|
+
{ "hyc-button--disabled": n.disabled }
|
|
24
|
+
]]),
|
|
25
|
+
disabled: n.disabled,
|
|
26
|
+
onClick: c
|
|
27
|
+
}, [
|
|
28
|
+
p(n.$slots, "default")
|
|
29
|
+
], 10, f));
|
|
30
|
+
}
|
|
31
|
+
}), b = "Hyc";
|
|
32
|
+
function y(t) {
|
|
33
|
+
const e = {};
|
|
34
|
+
return Object.entries(t).forEach(([o, s]) => {
|
|
35
|
+
const c = `${b}${o}`;
|
|
36
|
+
e[c] = s;
|
|
37
|
+
}), e;
|
|
38
|
+
}
|
|
39
|
+
function h(t, e) {
|
|
40
|
+
Object.entries(e).forEach(([o, s]) => {
|
|
41
|
+
t.component(o, s);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
const B = {
|
|
45
|
+
Button: m
|
|
46
|
+
// 添加新组件示例:
|
|
47
|
+
// Input,
|
|
48
|
+
// Dialog,
|
|
49
|
+
}, i = y(B), E = i.HycButton, _ = {
|
|
50
|
+
install(t) {
|
|
51
|
+
h(t, i);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
m as Button,
|
|
56
|
+
E as HycButton,
|
|
57
|
+
u as buttonProps,
|
|
58
|
+
_ as default
|
|
59
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.HycUILib={},e.Vue))})(this,(function(e,t){"use strict";const l={type:{type:String,default:"primary"},disabled:{type:Boolean,default:!1}},r=["disabled"],u=t.defineComponent({__name:"Button",props:l,emits:["click"],setup(n,{emit:o}){const s=n,c=o;function d(i){s.disabled||c("click",i)}return(i,B)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["hyc-button",[`hyc-button--${i.type}`,{"hyc-button--disabled":i.disabled}]]),disabled:i.disabled,onClick:d},[t.renderSlot(i.$slots,"default")],10,r))}}),a="Hyc";function p(n){const o={};return Object.entries(n).forEach(([s,c])=>{const d=`${a}${s}`;o[d]=c}),o}function b(n,o){Object.entries(o).forEach(([s,c])=>{n.component(s,c)})}const f=p({Button:u}),m=f.HycButton,y={install(n){b(n,f)}};e.Button=u,e.HycButton=m,e.buttonProps=l,e.default=y,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
package/dist/ui.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.hyc-button{padding:8px 16px;border-radius:4px;border:none;cursor:pointer;font-size:14px;transition:all .3s}.hyc-button--primary{background-color:#1890ff;color:#fff}.hyc-button--secondary{background-color:#f5f5f5;color:#333}.hyc-button--text{background-color:transparent;color:#1890ff}.hyc-button--disabled{opacity:.6;cursor:not-allowed}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@can2421/ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "dist/index.umd.js",
|
|
5
|
+
"module": "dist/index.es.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"unpkg": "dist/index.umd.js",
|
|
8
|
+
"jsdelivr": "dist/index.umd.js",
|
|
9
|
+
"style": "dist/style.css",
|
|
10
|
+
"files": ["dist"],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "vite build",
|
|
13
|
+
"dev": "vite build --watch"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.esm.js",
|
|
19
|
+
"require": "./dist/index.cjs.js",
|
|
20
|
+
"style": "./dist/style.css"
|
|
21
|
+
},
|
|
22
|
+
"./*": {
|
|
23
|
+
"types": "./dist/*/index.d.ts",
|
|
24
|
+
"import": "./dist/*/index.esm.js",
|
|
25
|
+
"require": "./dist/*/index.cjs.js",
|
|
26
|
+
"style": "./dist/*/style.css"
|
|
27
|
+
},
|
|
28
|
+
"./dist/style.css": "./dist/style.css"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@hyc-ui-lib/shared": "workspace:*"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@vitejs/plugin-vue": "^4.6.2",
|
|
35
|
+
"vite": "^7.3.0",
|
|
36
|
+
"typescript": "^5.9.3"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public",
|
|
40
|
+
"registry": "https://registry.npmjs.org",
|
|
41
|
+
"tag": "latest"
|
|
42
|
+
}
|
|
43
|
+
}
|