ybd-ui 1.0.1 → 1.0.3

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/style.css CHANGED
@@ -1 +1 @@
1
- .my-btn[data-v-f424331c]{padding:8px 16px;border:1px solid #dcdfe6;border-radius:4px;background:#fff;cursor:pointer;transition:all .3s}.my-btn[data-v-f424331c]:hover{opacity:.8}.my-btn--primary[data-v-f424331c]{background:#409eff;color:#fff;border-color:#409eff}.my-btn--danger[data-v-f424331c]{background:#f56c6c;color:#fff;border-color:#f56c6c}.my-btn--disabled[data-v-f424331c]{opacity:.6;cursor:not-allowed}
1
+ .my-btn[data-v-7bc2a422]{padding:8px 16px;border:1px solid #dcdfe6;border-radius:4px;background:#fff;cursor:pointer;transition:all .3s}.my-btn[data-v-7bc2a422]:hover{opacity:.8}.my-btn--primary[data-v-7bc2a422]{background:#409eff;color:#fff;border-color:#409eff}.my-btn--danger[data-v-7bc2a422]{background:#f56c6c;color:#fff;border-color:#f56c6c}.my-btn--disabled[data-v-7bc2a422]{opacity:.6;cursor:not-allowed}
@@ -0,0 +1,62 @@
1
+ import { defineComponent as c, createElementBlock as r, openBlock as u, normalizeClass as f, renderSlot as m } from "vue";
2
+ const b = ["disabled"], p = /* @__PURE__ */ c({
3
+ name: "YbButton",
4
+ __name: "main",
5
+ props: {
6
+ btntype: {
7
+ type: String,
8
+ default: "default",
9
+ // default, primary, danger
10
+ validator: (t) => ["default", "primary", "danger"].includes(t)
11
+ },
12
+ disabled: {
13
+ type: Boolean,
14
+ default: !1
15
+ }
16
+ },
17
+ emits: ["click"],
18
+ setup(t, { emit: e }) {
19
+ const o = t, l = (n) => {
20
+ o.disabled || e("click", n);
21
+ };
22
+ return (n, k) => (u(), r("button", {
23
+ class: f([
24
+ "my-btn",
25
+ `my-btn--${t.btntype}`,
26
+ { "my-btn--disabled": t.disabled }
27
+ ]),
28
+ disabled: t.disabled,
29
+ onClick: l
30
+ }, [
31
+ m(n.$slots, "default", {}, void 0, !0)
32
+ ], 10, b));
33
+ }
34
+ }), y = (t, e) => {
35
+ const o = t.__vccOpts || t;
36
+ for (const [l, n] of e)
37
+ o[l] = n;
38
+ return o;
39
+ }, a = /* @__PURE__ */ y(p, [["__scopeId", "data-v-7bc2a422"]]);
40
+ a.install = function(t) {
41
+ t.component(a.name || "YbButton", a);
42
+ };
43
+ const s = [
44
+ a
45
+ ];
46
+ let d = !1;
47
+ const i = function(t) {
48
+ d || (d = !0, s.map((e) => {
49
+ t.component(e.name || "YbButton", e);
50
+ }));
51
+ };
52
+ typeof window < "u" && window.Vue && i(window.Vue);
53
+ const _ = {
54
+ // 导出的对象必须具备一个 install 方法
55
+ install: i,
56
+ // 组件列表
57
+ ...s
58
+ };
59
+ export {
60
+ _ as default,
61
+ a as ybButton
62
+ };
@@ -0,0 +1 @@
1
+ (function(n,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(n=typeof globalThis<"u"?globalThis:n||self,t(n["ybd-ui"]={},n.Vue))})(this,function(n,t){"use strict";const f=["disabled"],i=((e,o)=>{const s=e.__vccOpts||e;for(const[l,d]of o)s[l]=d;return s})(t.defineComponent({name:"YbButton",__name:"main",props:{btntype:{type:String,default:"default",validator:e=>["default","primary","danger"].includes(e)},disabled:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:o}){const s=e,l=d=>{s.disabled||o("click",d)};return(d,p)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["my-btn",`my-btn--${e.btntype}`,{"my-btn--disabled":e.disabled}]),disabled:e.disabled,onClick:l},[t.renderSlot(d.$slots,"default",{},void 0,!0)],10,f))}}),[["__scopeId","data-v-7bc2a422"]]);i.install=function(e){e.component(i.name||"YbButton",i)};const a=[i];let c=!1;const u=function(e){c||(c=!0,a.map(o=>{e.component(o.name||"YbButton",o)}))};typeof window<"u"&&window.Vue&&u(window.Vue);const r={install:u,...a};n.default=r,n.ybButton=i,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ybd-ui",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "description": "A Vue 3 component library built with Vite",
6
6
  "main": "./dist/ybd-ui.umd.js",
@@ -12,12 +12,13 @@
12
12
  },
13
13
  "./style.css": "./dist/style.css"
14
14
  },
15
+ "types": "./dist/index.d.ts",
15
16
  "files": [
16
17
  "dist/*"
17
18
  ],
18
19
  "scripts": {
19
20
  "dev": "vite",
20
- "build": "vite build",
21
+ "build": "vite build && vue-tsc --declaration --emitDeclarationOnly --outDir dist",
21
22
  "preview": "vite preview"
22
23
  },
23
24
  "keywords": [
@@ -31,6 +32,8 @@
31
32
  "devDependencies": {
32
33
  "@vitejs/plugin-vue": "^6.0.3",
33
34
  "@vitejs/plugin-vue-jsx": "^5.1.2",
34
- "vite": "^5.0.0"
35
+ "typescript": "^5.9.3",
36
+ "vite": "^5.0.0",
37
+ "vue-tsc": "^3.2.1"
35
38
  }
36
- }
39
+ }
package/dist/yb-ui.es.js DELETED
@@ -1,57 +0,0 @@
1
- import { createElementBlock as r, openBlock as u, normalizeClass as c, renderSlot as f } from "vue";
2
- const p = (e, n) => {
3
- const d = e.__vccOpts || e;
4
- for (const [a, l] of n)
5
- d[a] = l;
6
- return d;
7
- }, m = {
8
- name: "YbButton"
9
- };
10
- defineProps({
11
- type: {
12
- type: String,
13
- default: "default",
14
- // default, primary, danger
15
- validator: (e) => ["default", "primary", "danger"].includes(e)
16
- },
17
- disabled: {
18
- type: Boolean,
19
- default: !1
20
- }
21
- });
22
- defineEmits(["click"]);
23
- const b = ["disabled"];
24
- function y(e, n, d, a, l, k) {
25
- return u(), r("button", {
26
- class: c([
27
- "my-btn",
28
- `my-btn--${e.type}`,
29
- { "my-btn--disabled": e.disabled }
30
- ]),
31
- disabled: e.disabled,
32
- onClick: n[0] || (n[0] = (...i) => e.handleClick && e.handleClick(...i))
33
- }, [
34
- f(e.$slots, "default", {}, void 0, !0)
35
- ], 10, b);
36
- }
37
- const t = /* @__PURE__ */ p(m, [["render", y], ["__scopeId", "data-v-f424331c"]]);
38
- t.install = function(e) {
39
- e.component(t.name, t);
40
- };
41
- const s = [
42
- t
43
- ], o = function(e) {
44
- o.installed || (o.installed = !0, s.map((n) => {
45
- e.component(n.name, n);
46
- }));
47
- };
48
- typeof window < "u" && window.Vue && o(window.Vue);
49
- const _ = {
50
- // 导出的对象必须具备一个 install 方法
51
- install: o,
52
- // 组件列表
53
- ...s
54
- };
55
- export {
56
- _ as default
57
- };