@can2421/ui-components 1.0.39 → 1.0.41
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.
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { App } from 'vue';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { CButton } from './button';
|
|
3
|
+
import { CConfigProvider } from './config-provider';
|
|
4
|
+
export { CButton, CConfigProvider };
|
|
5
|
+
export * from './button/button.types';
|
|
6
|
+
export * from './config-provider/types';
|
|
7
|
+
declare function install(app: App): void;
|
|
4
8
|
declare const _default: {
|
|
5
|
-
install
|
|
9
|
+
install: typeof install;
|
|
6
10
|
};
|
|
7
11
|
export default _default;
|
|
12
|
+
export { install };
|
package/dist/ui-components.mjs
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
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
|
|
3
|
-
function
|
|
2
|
+
import { ref as d, getCurrentInstance as p, computed as f, unref as s, provide as B, inject as S, defineComponent as m, createElementBlock as $, openBlock as h, normalizeClass as k, renderSlot as b, watch as x } from "vue";
|
|
3
|
+
function g(n) {
|
|
4
4
|
return n.install = (e) => {
|
|
5
5
|
const o = n.name || "UnknownComponent";
|
|
6
6
|
e.component(o, n);
|
|
7
7
|
}, n;
|
|
8
8
|
}
|
|
9
|
-
const
|
|
9
|
+
const C = Symbol("c"), i = "c", u = d({
|
|
10
10
|
namespace: "c"
|
|
11
11
|
});
|
|
12
|
-
function
|
|
13
|
-
const o =
|
|
14
|
-
return
|
|
12
|
+
function P(n, e = void 0) {
|
|
13
|
+
const o = p() ? S(C, u) : u;
|
|
14
|
+
return f(() => {
|
|
15
15
|
var t;
|
|
16
16
|
return ((t = o.value) == null ? void 0 : t[n]) ?? e;
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
const t = !!
|
|
19
|
+
function z(n, e) {
|
|
20
|
+
const t = !!p() ? B : void 0;
|
|
21
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 t(
|
|
25
|
+
const c = f(() => s(n));
|
|
26
|
+
return t(C, c), c;
|
|
27
27
|
}
|
|
28
28
|
function a(n) {
|
|
29
|
-
return `${
|
|
29
|
+
return `${P("namespace", i).value}-${n}`;
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const _ = {
|
|
32
32
|
type: {
|
|
33
33
|
type: String,
|
|
34
34
|
default: ""
|
|
@@ -37,17 +37,17 @@ const g = {
|
|
|
37
37
|
disabled: Boolean,
|
|
38
38
|
plain: Boolean,
|
|
39
39
|
round: Boolean
|
|
40
|
-
},
|
|
40
|
+
}, j = ["disabled"], w = /* @__PURE__ */ m({
|
|
41
41
|
name: "CButton",
|
|
42
42
|
__name: "button",
|
|
43
|
-
props:
|
|
43
|
+
props: _,
|
|
44
44
|
setup(n) {
|
|
45
45
|
const e = n;
|
|
46
46
|
function o() {
|
|
47
47
|
console.log("click");
|
|
48
48
|
}
|
|
49
|
-
return (t, c) => (
|
|
50
|
-
class:
|
|
49
|
+
return (t, c) => (h(), $("button", {
|
|
50
|
+
class: k([
|
|
51
51
|
s(a)("button"),
|
|
52
52
|
e.type && s(a)(`button--${e.type}`),
|
|
53
53
|
e.size && s(a)(`button--${e.size}`),
|
|
@@ -58,25 +58,25 @@ const g = {
|
|
|
58
58
|
disabled: e.disabled,
|
|
59
59
|
onClick: o
|
|
60
60
|
}, [
|
|
61
|
-
|
|
62
|
-
], 10,
|
|
61
|
+
b(t.$slots, "default", {}, void 0, !0)
|
|
62
|
+
], 10, j));
|
|
63
63
|
}
|
|
64
|
-
}),
|
|
64
|
+
}), G = (n, e) => {
|
|
65
65
|
const o = n.__vccOpts || n;
|
|
66
66
|
for (const [t, c] of e)
|
|
67
67
|
o[t] = c;
|
|
68
68
|
return o;
|
|
69
|
-
},
|
|
69
|
+
}, O = /* @__PURE__ */ G(w, [["__scopeId", "data-v-2fe69762"]]), r = g(O), I = /* @__PURE__ */ m({
|
|
70
70
|
name: "CConfigProvider",
|
|
71
71
|
__name: "index",
|
|
72
72
|
props: {
|
|
73
73
|
namespace: { default: i }
|
|
74
74
|
},
|
|
75
75
|
setup(n) {
|
|
76
|
-
const e = n, o =
|
|
76
|
+
const e = n, o = d({
|
|
77
77
|
namespace: i
|
|
78
|
-
}), t =
|
|
79
|
-
return
|
|
78
|
+
}), t = z(o);
|
|
79
|
+
return x(
|
|
80
80
|
() => e,
|
|
81
81
|
(c) => {
|
|
82
82
|
o.value.namespace = c == null ? void 0 : c.namespace;
|
|
@@ -85,28 +85,30 @@ const g = {
|
|
|
85
85
|
immediate: !0,
|
|
86
86
|
deep: !0
|
|
87
87
|
}
|
|
88
|
-
), (c,
|
|
88
|
+
), (c, y) => b(c.$slots, "default", { config: s(t) });
|
|
89
89
|
}
|
|
90
|
-
}),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
90
|
+
}), l = g(I);
|
|
91
|
+
function v(n) {
|
|
92
|
+
n.component(r.name || "CButton", r), n.component(l.name || "CConfigProvider", l);
|
|
93
|
+
}
|
|
94
|
+
const E = { install: v }, N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
95
95
|
__proto__: null,
|
|
96
|
-
CButton:
|
|
97
|
-
CConfigProvider:
|
|
98
|
-
buttonProps:
|
|
99
|
-
default:
|
|
100
|
-
|
|
96
|
+
CButton: r,
|
|
97
|
+
CConfigProvider: l,
|
|
98
|
+
buttonProps: _,
|
|
99
|
+
default: E,
|
|
100
|
+
install: v
|
|
101
|
+
}, Symbol.toStringTag, { value: "Module" })), K = {
|
|
101
102
|
install(n) {
|
|
102
|
-
Object.entries(
|
|
103
|
+
Object.entries(N).forEach(([e, o]) => {
|
|
103
104
|
n.component(e, o);
|
|
104
105
|
});
|
|
105
106
|
}
|
|
106
107
|
};
|
|
107
108
|
export {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
r as CButton,
|
|
110
|
+
l as CConfigProvider,
|
|
111
|
+
_ as buttonProps,
|
|
112
|
+
K as default,
|
|
113
|
+
v as install
|
|
112
114
|
};
|
|
@@ -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(i,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(i=typeof globalThis<"u"?globalThis:i||self,n(i.CanUICpmonents={},i.Vue))})(this,(function(i,n){"use strict";function p(e){return e.install=t=>{const o=e.name||"UnknownComponent";t.component(o,e)},e}const m=Symbol("c"),d="c",_=n.ref({namespace:"c"});function b(e,t=void 0){const o=n.getCurrentInstance()?n.inject(m,_):_;return n.computed(()=>{var s;return((s=o.value)==null?void 0:s[e])??t})}function C(e,t){const s=!!n.getCurrentInstance()?n.provide:void 0;if(!s){console.warn("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const c=n.computed(()=>n.unref(e));return s(m,c),c}function r(e){return`${b("namespace",d).value}-${e}`}const f={type:{type:String,default:""},size:String,disabled:Boolean,plain:Boolean,round:Boolean},g=["disabled"],a=p(((e,t)=>{const o=e.__vccOpts||e;for(const[s,c]of t)o[s]=c;return o})(n.defineComponent({name:"CButton",__name:"button",props:f,setup(e){const t=e;function o(){console.log("click")}return(s,c)=>(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(s.$slots,"default",{},void 0,!0)],10,g))}}),[["__scopeId","data-v-2fe69762"]])),l=p(n.defineComponent({name:"CConfigProvider",__name:"index",props:{namespace:{default:d}},setup(e){const t=e,o=n.ref({namespace:d}),s=C(o);return n.watch(()=>t,c=>{o.value.namespace=c==null?void 0:c.namespace},{immediate:!0,deep:!0}),(c,S)=>n.renderSlot(c.$slots,"default",{config:n.unref(s)})}}));function u(e){e.component(a.name||"CButton",a),e.component(l.name||"CConfigProvider",l)}const y=Object.freeze(Object.defineProperty({__proto__:null,CButton:a,CConfigProvider:l,buttonProps:f,default:{install:u},install:u},Symbol.toStringTag,{value:"Module"})),B={install(e){Object.entries(y).forEach(([t,o])=>{e.component(t,o)})}};i.CButton=a,i.CConfigProvider=l,i.buttonProps=f,i.default=B,i.install=u,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@can2421/ui-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.41",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
|
-
"types": "./dist/index.
|
|
6
|
+
"types": "./dist/components/src/index.d.ts",
|
|
7
7
|
"import": "./dist/ui-components.mjs",
|
|
8
8
|
"require": "./dist/ui-components.umd.js"
|
|
9
9
|
},
|