@can2421/ui-components 1.0.38 → 1.0.39
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/components/src/index.d.ts +5 -0
- package/dist/index.es.d.ts +0 -5
- package/dist/ui-components.mjs +65 -60
- package/dist/ui-components.umd.js +1 -1
- package/package.json +1 -1
- package/dist/components/index.d.ts +0 -6
- package/dist/components/src/types/baseProps.d.ts +0 -6
- package/dist/components/vite.config.d.ts +0 -2
package/dist/index.es.d.ts
CHANGED
package/dist/ui-components.mjs
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(".c-button[data-v-2fe69762]{display:inline-block;padding:5px 15px;border-radius:4px;background:#fff;outline:none;color:#606266;font-size:14px;border:1px solid #dcdfe6;cursor:pointer;-webkit-user-select:none;user-select:none}.c-button~.c-button[data-v-2fe69762]{margin-left:8px}.c-button[data-v-2fe69762]:not(.c-button--primary,.c-button--danger,.c-button--warning,.c-button--info,.c-button--success,.c-button--plain,.c-button--disabled):hover{border-color:#57abff;background:#ecf5ff;color:#409eff}.c-button--primary[data-v-2fe69762]:not(.c-button--disabled):hover,.c-button--danger[data-v-2fe69762]:not(.c-button--disabled):hover,.c-button--warning[data-v-2fe69762]:not(.c-button--disabled):hover,.c-button--info[data-v-2fe69762]:not(.c-button--disabled):hover,.c-button--success[data-v-2fe69762]:not(.c-button--disabled):hover{opacity:.8}.c-button[data-v-2fe69762]:active:not(.c-button--disabled){transform:scale(.95)}.c-button--disabled[data-v-2fe69762]{opacity:.5;cursor:not-allowed}.c-button--round[data-v-2fe69762]{border-radius:20px}.c-button--plain[data-v-2fe69762]{background:#fff;border:1px solid #dcdfe6;color:#606266}.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{border-color:#409eff;color:#409eff}.c-button--primary[data-v-2fe69762]{background:#409eff;border-color:#409eff;color:#fff}.c-button--primary.c-button--plain[data-v-2fe69762]{background:#ecf5ff;border:1px solid #409eff;color:#409eff}.c-button--primary.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#409eff;border-color:#409eff;color:#fff}.c-button--success[data-v-2fe69762]{background:#70c646;border-color:#70c646;color:#fff}.c-button--success.c-button--plain[data-v-2fe69762]{background:#f0f9eb;border:1px solid #70c646;color:#70c646}.c-button--success.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#70c646;border-color:#70c646;color:#fff}.c-button--warning[data-v-2fe69762]{background:#e6a23c;border-color:#e6a23c;color:#fff}.c-button--warning.c-button--plain[data-v-2fe69762]{background:#fdf6ec;border:1px solid #e6a23c;color:#e6a23c}.c-button--warning.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#e6a23c;border-color:#e6a23c;color:#fff}.c-button--info[data-v-2fe69762]{background:#909399;border-color:#909399;color:#fff}.c-button--info.c-button--plain[data-v-2fe69762]{background:#f4f4f5;border:1px solid #909399;color:#909399}.c-button--info.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#909399;border-color:#909399;color:#fff}.c-button--danger[data-v-2fe69762]{background:#f56c6c;border-color:#f56c6c;color:#fff}.c-button--danger.c-button--plain[data-v-2fe69762]{background:#fef0f0;border:1px solid #f56c6c;color:#f56c6c}.c-button--danger.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#f56c6c;border-color:#f56c6c;color:#fff}.c-button--small[data-v-2fe69762]{padding:2px 7px;font-size:12px}.c-button--large[data-v-2fe69762]{padding:8px 19px;font-size:14px}")),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
import { ref as l, getCurrentInstance as u, computed as
|
|
3
|
-
function m(
|
|
4
|
-
return
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
},
|
|
2
|
+
import { ref as l, getCurrentInstance as u, computed as d, unref as s, provide as y, inject as B, defineComponent as p, createElementBlock as S, openBlock as $, normalizeClass as h, renderSlot as f, watch as k } from "vue";
|
|
3
|
+
function m(n) {
|
|
4
|
+
return n.install = (e) => {
|
|
5
|
+
const o = n.name || "UnknownComponent";
|
|
6
|
+
e.component(o, n);
|
|
7
|
+
}, n;
|
|
8
8
|
}
|
|
9
|
-
const b = Symbol("c"),
|
|
9
|
+
const b = Symbol("c"), i = "c", r = l({
|
|
10
10
|
namespace: "c"
|
|
11
11
|
});
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
var
|
|
16
|
-
return ((
|
|
12
|
+
function x(n, e = void 0) {
|
|
13
|
+
const o = u() ? B(b, r) : r;
|
|
14
|
+
return d(() => {
|
|
15
|
+
var t;
|
|
16
|
+
return ((t = o.value) == null ? void 0 : t[n]) ?? e;
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
const
|
|
21
|
-
if (!
|
|
19
|
+
function P(n, e) {
|
|
20
|
+
const t = !!u() ? y : void 0;
|
|
21
|
+
if (!t) {
|
|
22
22
|
console.warn("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
const c =
|
|
26
|
-
return
|
|
25
|
+
const c = d(() => s(n));
|
|
26
|
+
return t(b, c), c;
|
|
27
27
|
}
|
|
28
|
-
function a(
|
|
29
|
-
return `${
|
|
28
|
+
function a(n) {
|
|
29
|
+
return `${x("namespace", i).value}-${n}`;
|
|
30
30
|
}
|
|
31
31
|
const g = {
|
|
32
32
|
type: {
|
|
@@ -37,71 +37,76 @@ const g = {
|
|
|
37
37
|
disabled: Boolean,
|
|
38
38
|
plain: Boolean,
|
|
39
39
|
round: Boolean
|
|
40
|
-
},
|
|
40
|
+
}, z = ["disabled"], j = /* @__PURE__ */ p({
|
|
41
41
|
name: "CButton",
|
|
42
42
|
__name: "button",
|
|
43
43
|
props: g,
|
|
44
|
-
setup(
|
|
45
|
-
const
|
|
46
|
-
function
|
|
44
|
+
setup(n) {
|
|
45
|
+
const e = n;
|
|
46
|
+
function o() {
|
|
47
47
|
console.log("click");
|
|
48
48
|
}
|
|
49
|
-
return (
|
|
50
|
-
class:
|
|
49
|
+
return (t, c) => ($(), S("button", {
|
|
50
|
+
class: h([
|
|
51
51
|
s(a)("button"),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
e.type && s(a)(`button--${e.type}`),
|
|
53
|
+
e.size && s(a)(`button--${e.size}`),
|
|
54
|
+
e.disabled && s(a)("button--disabled"),
|
|
55
|
+
e.plain && s(a)("button--plain"),
|
|
56
|
+
e.round && s(a)("button--round")
|
|
57
57
|
]),
|
|
58
|
-
disabled:
|
|
59
|
-
onClick:
|
|
58
|
+
disabled: e.disabled,
|
|
59
|
+
onClick: o
|
|
60
60
|
}, [
|
|
61
|
-
f(
|
|
62
|
-
], 10,
|
|
61
|
+
f(t.$slots, "default", {}, void 0, !0)
|
|
62
|
+
], 10, z));
|
|
63
63
|
}
|
|
64
|
-
}),
|
|
65
|
-
const
|
|
66
|
-
for (const [
|
|
67
|
-
t
|
|
68
|
-
return
|
|
69
|
-
},
|
|
64
|
+
}), w = (n, e) => {
|
|
65
|
+
const o = n.__vccOpts || n;
|
|
66
|
+
for (const [t, c] of e)
|
|
67
|
+
o[t] = c;
|
|
68
|
+
return o;
|
|
69
|
+
}, G = /* @__PURE__ */ w(j, [["__scopeId", "data-v-2fe69762"]]), C = m(G), O = /* @__PURE__ */ p({
|
|
70
70
|
name: "CConfigProvider",
|
|
71
71
|
__name: "index",
|
|
72
72
|
props: {
|
|
73
|
-
namespace: { default:
|
|
73
|
+
namespace: { default: i }
|
|
74
74
|
},
|
|
75
|
-
setup(
|
|
76
|
-
const
|
|
77
|
-
namespace:
|
|
78
|
-
}),
|
|
79
|
-
return
|
|
80
|
-
() =>
|
|
75
|
+
setup(n) {
|
|
76
|
+
const e = n, o = l({
|
|
77
|
+
namespace: i
|
|
78
|
+
}), t = P(o);
|
|
79
|
+
return k(
|
|
80
|
+
() => e,
|
|
81
81
|
(c) => {
|
|
82
|
-
|
|
82
|
+
o.value.namespace = c == null ? void 0 : c.namespace;
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
85
|
immediate: !0,
|
|
86
86
|
deep: !0
|
|
87
87
|
}
|
|
88
|
-
), (c,
|
|
88
|
+
), (c, v) => f(c.$slots, "default", { config: s(t) });
|
|
89
89
|
}
|
|
90
|
-
}),
|
|
90
|
+
}), _ = m(O), I = {
|
|
91
|
+
install(n) {
|
|
92
|
+
n.component("CButton", C), n.component("CConfigProvider", _);
|
|
93
|
+
}
|
|
94
|
+
}, E = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
91
95
|
__proto__: null,
|
|
92
|
-
CButton:
|
|
93
|
-
CConfigProvider:
|
|
94
|
-
buttonProps: g
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
CButton: C,
|
|
97
|
+
CConfigProvider: _,
|
|
98
|
+
buttonProps: g,
|
|
99
|
+
default: I
|
|
100
|
+
}, Symbol.toStringTag, { value: "Module" })), F = {
|
|
101
|
+
install(n) {
|
|
102
|
+
Object.entries(E).forEach(([e, o]) => {
|
|
103
|
+
n.component(e, o);
|
|
99
104
|
});
|
|
100
105
|
}
|
|
101
106
|
};
|
|
102
107
|
export {
|
|
103
|
-
|
|
104
|
-
|
|
108
|
+
C as CButton,
|
|
109
|
+
_ as CConfigProvider,
|
|
105
110
|
g as buttonProps,
|
|
106
|
-
|
|
111
|
+
F as default
|
|
107
112
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(".c-button[data-v-2fe69762]{display:inline-block;padding:5px 15px;border-radius:4px;background:#fff;outline:none;color:#606266;font-size:14px;border:1px solid #dcdfe6;cursor:pointer;-webkit-user-select:none;user-select:none}.c-button~.c-button[data-v-2fe69762]{margin-left:8px}.c-button[data-v-2fe69762]:not(.c-button--primary,.c-button--danger,.c-button--warning,.c-button--info,.c-button--success,.c-button--plain,.c-button--disabled):hover{border-color:#57abff;background:#ecf5ff;color:#409eff}.c-button--primary[data-v-2fe69762]:not(.c-button--disabled):hover,.c-button--danger[data-v-2fe69762]:not(.c-button--disabled):hover,.c-button--warning[data-v-2fe69762]:not(.c-button--disabled):hover,.c-button--info[data-v-2fe69762]:not(.c-button--disabled):hover,.c-button--success[data-v-2fe69762]:not(.c-button--disabled):hover{opacity:.8}.c-button[data-v-2fe69762]:active:not(.c-button--disabled){transform:scale(.95)}.c-button--disabled[data-v-2fe69762]{opacity:.5;cursor:not-allowed}.c-button--round[data-v-2fe69762]{border-radius:20px}.c-button--plain[data-v-2fe69762]{background:#fff;border:1px solid #dcdfe6;color:#606266}.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{border-color:#409eff;color:#409eff}.c-button--primary[data-v-2fe69762]{background:#409eff;border-color:#409eff;color:#fff}.c-button--primary.c-button--plain[data-v-2fe69762]{background:#ecf5ff;border:1px solid #409eff;color:#409eff}.c-button--primary.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#409eff;border-color:#409eff;color:#fff}.c-button--success[data-v-2fe69762]{background:#70c646;border-color:#70c646;color:#fff}.c-button--success.c-button--plain[data-v-2fe69762]{background:#f0f9eb;border:1px solid #70c646;color:#70c646}.c-button--success.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#70c646;border-color:#70c646;color:#fff}.c-button--warning[data-v-2fe69762]{background:#e6a23c;border-color:#e6a23c;color:#fff}.c-button--warning.c-button--plain[data-v-2fe69762]{background:#fdf6ec;border:1px solid #e6a23c;color:#e6a23c}.c-button--warning.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#e6a23c;border-color:#e6a23c;color:#fff}.c-button--info[data-v-2fe69762]{background:#909399;border-color:#909399;color:#fff}.c-button--info.c-button--plain[data-v-2fe69762]{background:#f4f4f5;border:1px solid #909399;color:#909399}.c-button--info.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#909399;border-color:#909399;color:#fff}.c-button--danger[data-v-2fe69762]{background:#f56c6c;border-color:#f56c6c;color:#fff}.c-button--danger.c-button--plain[data-v-2fe69762]{background:#fef0f0;border:1px solid #f56c6c;color:#f56c6c}.c-button--danger.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#f56c6c;border-color:#f56c6c;color:#fff}.c-button--small[data-v-2fe69762]{padding:2px 7px;font-size:12px}.c-button--large[data-v-2fe69762]{padding:8px 19px;font-size:14px}")),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
(function(
|
|
2
|
+
(function(s,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(s=typeof globalThis<"u"?globalThis:s||self,n(s["@can2421/ui-components"]={},s.Vue))})(this,(function(s,n){"use strict";function u(e){return e.install=t=>{const o=e.name||"UnknownComponent";t.component(o,e)},e}const p=Symbol("c"),a="c",m=n.ref({namespace:"c"});function _(e,t=void 0){const o=n.getCurrentInstance()?n.inject(p,m):m;return n.computed(()=>{var c;return((c=o.value)==null?void 0:c[e])??t})}function b(e,t){const c=!!n.getCurrentInstance()?n.provide:void 0;if(!c){console.warn("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const i=n.computed(()=>n.unref(e));return c(p,i),i}function r(e){return`${_("namespace",a).value}-${e}`}const d={type:{type:String,default:""},size:String,disabled:Boolean,plain:Boolean,round:Boolean},C=["disabled"],l=u(((e,t)=>{const o=e.__vccOpts||e;for(const[c,i]of t)o[c]=i;return o})(n.defineComponent({name:"CButton",__name:"button",props:d,setup(e){const t=e;function o(){console.log("click")}return(c,i)=>(n.openBlock(),n.createElementBlock("button",{class:n.normalizeClass([n.unref(r)("button"),t.type&&n.unref(r)(`button--${t.type}`),t.size&&n.unref(r)(`button--${t.size}`),t.disabled&&n.unref(r)("button--disabled"),t.plain&&n.unref(r)("button--plain"),t.round&&n.unref(r)("button--round")]),disabled:t.disabled,onClick:o},[n.renderSlot(c.$slots,"default",{},void 0,!0)],10,C))}}),[["__scopeId","data-v-2fe69762"]])),f=u(n.defineComponent({name:"CConfigProvider",__name:"index",props:{namespace:{default:a}},setup(e){const t=e,o=n.ref({namespace:a}),c=b(o);return n.watch(()=>t,i=>{o.value.namespace=i==null?void 0:i.namespace},{immediate:!0,deep:!0}),(i,B)=>n.renderSlot(i.$slots,"default",{config:n.unref(c)})}})),g=Object.freeze(Object.defineProperty({__proto__:null,CButton:l,CConfigProvider:f,buttonProps:d,default:{install(e){e.component("CButton",l),e.component("CConfigProvider",f)}}},Symbol.toStringTag,{value:"Module"})),y={install(e){Object.entries(g).forEach(([t,o])=>{e.component(t,o)})}};s.CButton=l,s.CConfigProvider=f,s.buttonProps=d,s.default=y,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
package/package.json
CHANGED