@can2421/ui-components 1.0.42 → 1.0.44
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/button/index.d.ts +5 -0
- package/dist/config-provider/index.d.ts +5 -0
- package/dist/{components/src/config-provider/index.d.ts → config-provider/index.vue.d.ts} +0 -11
- package/dist/ui-components.mjs +54 -53
- package/dist/ui-components.umd.js +1 -1
- package/package.json +1 -1
- package/dist/components/src/button/index.d.ts +0 -61
- /package/dist/{components/src/button → button}/button.types.d.ts +0 -0
- /package/dist/{components/src/button/button.d.ts → button/button.vue.d.ts} +0 -0
- /package/dist/{components/src/config-provider → config-provider}/hooks.d.ts +0 -0
- /package/dist/{components/src/config-provider → config-provider}/props.d.ts +0 -0
- /package/dist/{components/src/config-provider → config-provider}/token.d.ts +0 -0
- /package/dist/{components/src/config-provider → config-provider}/types.d.ts +0 -0
- /package/dist/{components/src/index.d.ts → index.d.ts} +0 -0
|
@@ -20,14 +20,3 @@ type __VLS_WithTemplateSlots<T, S> = T & {
|
|
|
20
20
|
$slots: S;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
-
rContext> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
24
|
-
namespace: string;
|
|
25
|
-
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
26
|
-
$slots: {
|
|
27
|
-
default?(_: {
|
|
28
|
-
config: import('./types').ConfigProviderContext | undefined;
|
|
29
|
-
}): any;
|
|
30
|
-
};
|
|
31
|
-
})>;
|
|
32
|
-
export * from './types';
|
|
33
|
-
export { CConfigProvider, };
|
package/dist/ui-components.mjs
CHANGED
|
@@ -1,34 +1,28 @@
|
|
|
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
|
-
|
|
4
|
-
return n.install = (e) => {
|
|
5
|
-
const o = n.name || "UnknownComponent";
|
|
6
|
-
e.component(o, n);
|
|
7
|
-
}, n;
|
|
8
|
-
}
|
|
9
|
-
const g = Symbol("c"), i = "c", r = d({
|
|
2
|
+
import { ref as p, getCurrentInstance as d, inject as _, computed as f, unref as a, provide as v, defineComponent as m, createElementBlock as y, openBlock as B, normalizeClass as $, renderSlot as b, watch as k } from "vue";
|
|
3
|
+
const g = Symbol("c"), u = "c", l = p({
|
|
10
4
|
namespace: "c"
|
|
11
5
|
});
|
|
12
6
|
function x(n, e = void 0) {
|
|
13
|
-
const
|
|
7
|
+
const c = d() ? _(g, l) : l;
|
|
14
8
|
return f(() => {
|
|
15
|
-
var
|
|
16
|
-
return ((
|
|
9
|
+
var o;
|
|
10
|
+
return ((o = c.value) == null ? void 0 : o[n]) ?? e;
|
|
17
11
|
});
|
|
18
12
|
}
|
|
19
13
|
function S(n, e) {
|
|
20
|
-
const
|
|
21
|
-
if (!
|
|
14
|
+
const o = !!d() ? v : void 0;
|
|
15
|
+
if (!o) {
|
|
22
16
|
console.warn("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
|
|
23
17
|
return;
|
|
24
18
|
}
|
|
25
|
-
const
|
|
26
|
-
return
|
|
19
|
+
const t = f(() => a(n));
|
|
20
|
+
return o(g, t), t;
|
|
27
21
|
}
|
|
28
|
-
function
|
|
29
|
-
return `${x("namespace",
|
|
22
|
+
function s(n) {
|
|
23
|
+
return `${x("namespace", u).value}-${n}`;
|
|
30
24
|
}
|
|
31
|
-
const
|
|
25
|
+
const h = {
|
|
32
26
|
type: {
|
|
33
27
|
type: String,
|
|
34
28
|
default: ""
|
|
@@ -37,65 +31,72 @@ const P = {
|
|
|
37
31
|
disabled: Boolean,
|
|
38
32
|
plain: Boolean,
|
|
39
33
|
round: Boolean
|
|
40
|
-
},
|
|
34
|
+
}, P = ["disabled"], z = /* @__PURE__ */ m({
|
|
41
35
|
name: "CButton",
|
|
42
36
|
__name: "button",
|
|
43
|
-
props:
|
|
37
|
+
props: h,
|
|
44
38
|
setup(n) {
|
|
45
39
|
const e = n;
|
|
46
|
-
function
|
|
40
|
+
function c() {
|
|
47
41
|
console.log("click");
|
|
48
42
|
}
|
|
49
|
-
return (
|
|
43
|
+
return (o, t) => (B(), y("button", {
|
|
50
44
|
class: $([
|
|
51
|
-
|
|
52
|
-
e.type &&
|
|
53
|
-
e.size &&
|
|
54
|
-
e.disabled &&
|
|
55
|
-
e.plain &&
|
|
56
|
-
e.round &&
|
|
45
|
+
a(s)("button"),
|
|
46
|
+
e.type && a(s)(`button--${e.type}`),
|
|
47
|
+
e.size && a(s)(`button--${e.size}`),
|
|
48
|
+
e.disabled && a(s)("button--disabled"),
|
|
49
|
+
e.plain && a(s)("button--plain"),
|
|
50
|
+
e.round && a(s)("button--round")
|
|
57
51
|
]),
|
|
58
52
|
disabled: e.disabled,
|
|
59
|
-
onClick:
|
|
53
|
+
onClick: c
|
|
60
54
|
}, [
|
|
61
|
-
b(
|
|
62
|
-
], 10,
|
|
55
|
+
b(o.$slots, "default", {}, void 0, !0)
|
|
56
|
+
], 10, P));
|
|
63
57
|
}
|
|
64
58
|
}), G = (n, e) => {
|
|
65
|
-
const
|
|
66
|
-
for (const [
|
|
67
|
-
o
|
|
68
|
-
return
|
|
69
|
-
},
|
|
59
|
+
const c = n.__vccOpts || n;
|
|
60
|
+
for (const [o, t] of e)
|
|
61
|
+
c[o] = t;
|
|
62
|
+
return c;
|
|
63
|
+
}, i = /* @__PURE__ */ G(z, [["__scopeId", "data-v-2fe69762"]]);
|
|
64
|
+
i.install = (n) => {
|
|
65
|
+
n.component(i.name, i);
|
|
66
|
+
};
|
|
67
|
+
const r = /* @__PURE__ */ m({
|
|
70
68
|
name: "CConfigProvider",
|
|
71
69
|
__name: "index",
|
|
72
70
|
props: {
|
|
73
|
-
namespace: { default:
|
|
71
|
+
namespace: { default: u }
|
|
74
72
|
},
|
|
75
73
|
setup(n) {
|
|
76
|
-
const e = n,
|
|
77
|
-
namespace:
|
|
78
|
-
}),
|
|
79
|
-
return
|
|
74
|
+
const e = n, c = p({
|
|
75
|
+
namespace: u
|
|
76
|
+
}), o = S(c);
|
|
77
|
+
return k(
|
|
80
78
|
() => e,
|
|
81
|
-
(
|
|
82
|
-
|
|
79
|
+
(t) => {
|
|
80
|
+
c.value.namespace = t == null ? void 0 : t.namespace;
|
|
83
81
|
},
|
|
84
82
|
{
|
|
85
83
|
immediate: !0,
|
|
86
84
|
deep: !0
|
|
87
85
|
}
|
|
88
|
-
), (
|
|
86
|
+
), (t, C) => b(t.$slots, "default", { config: a(o) });
|
|
89
87
|
}
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
n.component(
|
|
88
|
+
});
|
|
89
|
+
r.install = (n) => {
|
|
90
|
+
n.component(r.name, r);
|
|
91
|
+
};
|
|
92
|
+
function w(n) {
|
|
93
|
+
n.component(i.name || "CButton", i), n.component(r.name || "CConfigProvider", r);
|
|
93
94
|
}
|
|
94
|
-
const
|
|
95
|
+
const N = { install: w };
|
|
95
96
|
export {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
i as CButton,
|
|
98
|
+
r as CConfigProvider,
|
|
99
|
+
h as buttonProps,
|
|
100
|
+
N as default,
|
|
101
|
+
w as install
|
|
101
102
|
};
|
|
@@ -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(o,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(o=typeof globalThis<"u"?globalThis:o||self,n(o.CanUICpmonents={},o.Vue))})(this,(function(o,n){"use strict";const f=Symbol("c"),l="c",u=n.ref({namespace:"c"});function C(e,t=void 0){const c=n.getCurrentInstance()?n.inject(f,u):u;return n.computed(()=>{var i;return((i=c.value)==null?void 0:i[e])??t})}function b(e,t){const i=!!n.getCurrentInstance()?n.provide:void 0;if(!i){console.warn("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const s=n.computed(()=>n.unref(e));return i(f,s),s}function a(e){return`${C("namespace",l).value}-${e}`}const p={type:{type:String,default:""},size:String,disabled:Boolean,plain:Boolean,round:Boolean},_=["disabled"],r=((e,t)=>{const c=e.__vccOpts||e;for(const[i,s]of t)c[i]=s;return c})(n.defineComponent({name:"CButton",__name:"button",props:p,setup(e){const t=e;function c(){console.log("click")}return(i,s)=>(n.openBlock(),n.createElementBlock("button",{class:n.normalizeClass([n.unref(a)("button"),t.type&&n.unref(a)(`button--${t.type}`),t.size&&n.unref(a)(`button--${t.size}`),t.disabled&&n.unref(a)("button--disabled"),t.plain&&n.unref(a)("button--plain"),t.round&&n.unref(a)("button--round")]),disabled:t.disabled,onClick:c},[n.renderSlot(i.$slots,"default",{},void 0,!0)],10,_))}}),[["__scopeId","data-v-2fe69762"]]);r.install=e=>{e.component(r.name,r)};const d=n.defineComponent({name:"CConfigProvider",__name:"index",props:{namespace:{default:l}},setup(e){const t=e,c=n.ref({namespace:l}),i=b(c);return n.watch(()=>t,s=>{c.value.namespace=s==null?void 0:s.namespace},{immediate:!0,deep:!0}),(s,y)=>n.renderSlot(s.$slots,"default",{config:n.unref(i)})}});d.install=e=>{e.component(d.name,d)};function m(e){e.component(r.name||"CButton",r),e.component(d.name||"CConfigProvider",d)}const g={install:m};o.CButton=r,o.CConfigProvider=d,o.buttonProps=p,o.default=g,o.install=m,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
package/package.json
CHANGED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
declare const CButton: import('../../../utils/install').SFCWithInstall<{
|
|
2
|
-
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
3
|
-
readonly type: {
|
|
4
|
-
readonly type: import('vue').PropType<import('./button.types').ButtonType>;
|
|
5
|
-
readonly default: "";
|
|
6
|
-
};
|
|
7
|
-
readonly size: StringConstructor;
|
|
8
|
-
readonly disabled: BooleanConstructor;
|
|
9
|
-
readonly plain: BooleanConstructor;
|
|
10
|
-
readonly round: BooleanConstructor;
|
|
11
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
12
|
-
readonly type: import('./button.types').ButtonType;
|
|
13
|
-
readonly disabled: boolean;
|
|
14
|
-
readonly plain: boolean;
|
|
15
|
-
readonly round: boolean;
|
|
16
|
-
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLButtonElement, import('vue').ComponentProvideOptions, {
|
|
17
|
-
P: {};
|
|
18
|
-
B: {};
|
|
19
|
-
D: {};
|
|
20
|
-
C: {};
|
|
21
|
-
M: {};
|
|
22
|
-
Defaults: {};
|
|
23
|
-
}, Readonly<import('vue').ExtractPropTypes<{
|
|
24
|
-
readonly type: {
|
|
25
|
-
readonly type: import('vue').PropType<import('./button.types').ButtonType>;
|
|
26
|
-
readonly default: "";
|
|
27
|
-
};
|
|
28
|
-
readonly size: StringConstructor;
|
|
29
|
-
readonly disabled: BooleanConstructor;
|
|
30
|
-
readonly plain: BooleanConstructor;
|
|
31
|
-
readonly round: BooleanConstructor;
|
|
32
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, {
|
|
33
|
-
readonly type: import('./button.types').ButtonType;
|
|
34
|
-
readonly disabled: boolean;
|
|
35
|
-
readonly plain: boolean;
|
|
36
|
-
readonly round: boolean;
|
|
37
|
-
}>;
|
|
38
|
-
__isFragment?: never;
|
|
39
|
-
__isTeleport?: never;
|
|
40
|
-
__isSuspense?: never;
|
|
41
|
-
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
42
|
-
readonly type: {
|
|
43
|
-
readonly type: import('vue').PropType<import('./button.types').ButtonType>;
|
|
44
|
-
readonly default: "";
|
|
45
|
-
};
|
|
46
|
-
readonly size: StringConstructor;
|
|
47
|
-
readonly disabled: BooleanConstructor;
|
|
48
|
-
readonly plain: BooleanConstructor;
|
|
49
|
-
readonly round: BooleanConstructor;
|
|
50
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
51
|
-
readonly type: import('./button.types').ButtonType;
|
|
52
|
-
readonly disabled: boolean;
|
|
53
|
-
readonly plain: boolean;
|
|
54
|
-
readonly round: boolean;
|
|
55
|
-
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
56
|
-
$slots: {
|
|
57
|
-
default?(_: {}): any;
|
|
58
|
-
};
|
|
59
|
-
})>;
|
|
60
|
-
export * from './button.types';
|
|
61
|
-
export { CButton, };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|