@can2421/ui-components 1.0.32 → 1.0.34
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/packages/components/src/button/button.d.ts +0 -9
- package/dist/packages/components/src/button/button.types.d.ts +0 -4
- package/dist/packages/components/src/button/index.d.ts +0 -15
- package/dist/packages/components/src/config-provider/index.d.ts +20 -15
- package/dist/packages/components/src/config-provider/props.d.ts +3 -6
- package/dist/ui-components.mjs +44 -54
- package/dist/ui-components.umd.js +1 -1
- package/package.json +1 -1
|
@@ -13,22 +13,13 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
13
13
|
readonly default: "primary";
|
|
14
14
|
};
|
|
15
15
|
readonly size: StringConstructor;
|
|
16
|
-
readonly namespace: {
|
|
17
|
-
readonly type: StringConstructor;
|
|
18
|
-
readonly default: "c";
|
|
19
|
-
};
|
|
20
16
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
21
17
|
readonly type: {
|
|
22
18
|
readonly type: import('vue').PropType<import('./button.types').ButtonType>;
|
|
23
19
|
readonly default: "primary";
|
|
24
20
|
};
|
|
25
21
|
readonly size: StringConstructor;
|
|
26
|
-
readonly namespace: {
|
|
27
|
-
readonly type: StringConstructor;
|
|
28
|
-
readonly default: "c";
|
|
29
|
-
};
|
|
30
22
|
}>> & Readonly<{}>, {
|
|
31
|
-
readonly namespace: string;
|
|
32
23
|
readonly type: import('./button.types').ButtonType;
|
|
33
24
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
34
25
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -6,9 +6,5 @@ export declare const buttonProps: {
|
|
|
6
6
|
readonly default: "primary";
|
|
7
7
|
};
|
|
8
8
|
readonly size: StringConstructor;
|
|
9
|
-
readonly namespace: {
|
|
10
|
-
readonly type: StringConstructor;
|
|
11
|
-
readonly default: "c";
|
|
12
|
-
};
|
|
13
9
|
};
|
|
14
10
|
export type ButtonProps = ExtractPropTypes<typeof buttonProps>;
|
|
@@ -5,12 +5,7 @@ declare const CButton: import('../../../utils/install').SFCWithInstall<{
|
|
|
5
5
|
readonly default: "primary";
|
|
6
6
|
};
|
|
7
7
|
readonly size: StringConstructor;
|
|
8
|
-
readonly namespace: {
|
|
9
|
-
readonly type: StringConstructor;
|
|
10
|
-
readonly default: "c";
|
|
11
|
-
};
|
|
12
8
|
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
13
|
-
readonly namespace: string;
|
|
14
9
|
readonly type: import('./button.types').ButtonType;
|
|
15
10
|
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
16
11
|
P: {};
|
|
@@ -25,12 +20,7 @@ declare const CButton: import('../../../utils/install').SFCWithInstall<{
|
|
|
25
20
|
readonly default: "primary";
|
|
26
21
|
};
|
|
27
22
|
readonly size: StringConstructor;
|
|
28
|
-
readonly namespace: {
|
|
29
|
-
readonly type: StringConstructor;
|
|
30
|
-
readonly default: "c";
|
|
31
|
-
};
|
|
32
23
|
}>> & Readonly<{}>, {}, {}, {}, {}, {
|
|
33
|
-
readonly namespace: string;
|
|
34
24
|
readonly type: import('./button.types').ButtonType;
|
|
35
25
|
}>;
|
|
36
26
|
__isFragment?: never;
|
|
@@ -42,12 +32,7 @@ declare const CButton: import('../../../utils/install').SFCWithInstall<{
|
|
|
42
32
|
readonly default: "primary";
|
|
43
33
|
};
|
|
44
34
|
readonly size: StringConstructor;
|
|
45
|
-
readonly namespace: {
|
|
46
|
-
readonly type: StringConstructor;
|
|
47
|
-
readonly default: "c";
|
|
48
|
-
};
|
|
49
35
|
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
50
|
-
readonly namespace: string;
|
|
51
36
|
readonly type: import('./button.types').ButtonType;
|
|
52
37
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
53
38
|
$slots: {
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
default:
|
|
1
|
+
import { ConfigProviderContext } from './types';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {
|
|
6
|
+
config: ConfigProviderContext | undefined;
|
|
7
|
+
}): any;
|
|
6
8
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
default: string;
|
|
13
|
-
};
|
|
14
|
-
}>> & Readonly<{}>, {
|
|
9
|
+
refs: {};
|
|
10
|
+
rootEl: any;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
13
|
+
declare const __VLS_component: import('vue').DefineComponent<ConfigProviderContext, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ConfigProviderContext> & Readonly<{}>, {
|
|
15
14
|
namespace: string;
|
|
16
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions,
|
|
17
|
-
|
|
15
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
package/dist/ui-components.mjs
CHANGED
|
@@ -1,106 +1,96 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".c-button[data-v-c8316dbd]{display:inline-block;padding:.5em 1em;outline:unset;border:unset;border-radius:4px;background:#fff;cursor:pointer}.c-button[data-v-c8316dbd]:active{box-shadow:inset 0 0 0 1px #eaeaea}.c-button--primary[data-v-c8316dbd]{background:#409eff;color:#fff}.c-button--disabled[data-v-c8316dbd]{cursor:not-allowed;opacity:.5}")),document.head.appendChild(e)}}catch(d){console.error("vite-plugin-css-injected-by-js",d)}})();
|
|
2
|
-
import { ref as
|
|
3
|
-
function
|
|
2
|
+
import { ref as u, getCurrentInstance as p, computed as l, unref as s, provide as b, inject as v, defineComponent as f, createElementBlock as y, openBlock as S, normalizeClass as k, renderSlot as d, watch as h } from "vue";
|
|
3
|
+
function m(e) {
|
|
4
4
|
return e.install = (t) => {
|
|
5
5
|
const n = e.name || "UnknownComponent";
|
|
6
6
|
t.component(n, e);
|
|
7
7
|
}, e;
|
|
8
8
|
}
|
|
9
|
-
const
|
|
10
|
-
namespace: "
|
|
9
|
+
const g = Symbol("c"), r = "c", a = u({
|
|
10
|
+
namespace: "c"
|
|
11
11
|
});
|
|
12
|
-
function
|
|
13
|
-
const n = p() ? v(
|
|
14
|
-
return
|
|
12
|
+
function x(e, t = void 0) {
|
|
13
|
+
const n = p() ? v(g, a) : a;
|
|
14
|
+
return l(() => {
|
|
15
15
|
var o;
|
|
16
16
|
return ((o = n.value) == null ? void 0 : o[e]) ?? t;
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
const o = !!p() ?
|
|
19
|
+
function $(e, t) {
|
|
20
|
+
const o = !!p() ? b : void 0;
|
|
21
21
|
if (!o) {
|
|
22
22
|
console.warn("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
const c =
|
|
26
|
-
return o(
|
|
25
|
+
const c = l(() => s(e));
|
|
26
|
+
return o(g, c), c;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
return `${
|
|
28
|
+
function i(e) {
|
|
29
|
+
return `${x("namespace", r).value}-${e}`;
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
namespace: {
|
|
33
|
-
type: String,
|
|
34
|
-
default: "c"
|
|
35
|
-
}
|
|
36
|
-
}, g = {
|
|
37
|
-
...x,
|
|
31
|
+
const _ = {
|
|
38
32
|
type: {
|
|
39
33
|
type: String,
|
|
40
34
|
default: "primary"
|
|
41
35
|
},
|
|
42
36
|
size: String
|
|
43
|
-
}, B = /* @__PURE__ */
|
|
37
|
+
}, B = /* @__PURE__ */ f({
|
|
44
38
|
name: "CButton",
|
|
45
39
|
__name: "button",
|
|
46
|
-
props:
|
|
40
|
+
props: _,
|
|
47
41
|
setup(e) {
|
|
48
42
|
const t = e;
|
|
49
43
|
function n() {
|
|
50
44
|
console.log("click");
|
|
51
45
|
}
|
|
52
|
-
return (o, c) => (
|
|
53
|
-
class:
|
|
46
|
+
return (o, c) => (S(), y("div", {
|
|
47
|
+
class: k([s(i)("button"), s(i)(`button--${t.type}`)]),
|
|
54
48
|
onClick: n
|
|
55
49
|
}, [
|
|
56
|
-
|
|
50
|
+
d(o.$slots, "default", {}, void 0, !0)
|
|
57
51
|
], 2));
|
|
58
52
|
}
|
|
59
|
-
}),
|
|
53
|
+
}), P = (e, t) => {
|
|
60
54
|
const n = e.__vccOpts || e;
|
|
61
55
|
for (const [o, c] of t)
|
|
62
56
|
n[o] = c;
|
|
63
57
|
return n;
|
|
64
|
-
},
|
|
65
|
-
namespace: {
|
|
66
|
-
type: String,
|
|
67
|
-
default: "c"
|
|
68
|
-
}
|
|
69
|
-
}, $ = l({
|
|
58
|
+
}, j = /* @__PURE__ */ P(B, [["__scopeId", "data-v-c8316dbd"]]), w = m(j), G = /* @__PURE__ */ f({
|
|
70
59
|
name: "CConfigProvider",
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
60
|
+
__name: "index",
|
|
61
|
+
props: {
|
|
62
|
+
namespace: { default: r }
|
|
63
|
+
},
|
|
64
|
+
setup(e) {
|
|
65
|
+
const t = e, n = u({
|
|
66
|
+
namespace: r
|
|
67
|
+
}), o = $(n);
|
|
68
|
+
return h(
|
|
69
|
+
() => t,
|
|
78
70
|
(c) => {
|
|
79
71
|
n.value.namespace = c == null ? void 0 : c.namespace;
|
|
80
72
|
},
|
|
81
73
|
{
|
|
82
|
-
|
|
83
|
-
|
|
74
|
+
immediate: !0,
|
|
75
|
+
deep: !0
|
|
84
76
|
}
|
|
85
|
-
);
|
|
86
|
-
const o = h(n);
|
|
87
|
-
return () => f(t, "default", { config: o == null ? void 0 : o.value });
|
|
77
|
+
), (c, C) => d(c.$slots, "default", { config: s(o) });
|
|
88
78
|
}
|
|
89
|
-
}),
|
|
79
|
+
}), O = m(G), z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
90
80
|
__proto__: null,
|
|
91
|
-
CButton:
|
|
92
|
-
CConfigProvider:
|
|
93
|
-
buttonProps:
|
|
94
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
81
|
+
CButton: w,
|
|
82
|
+
CConfigProvider: O,
|
|
83
|
+
buttonProps: _
|
|
84
|
+
}, Symbol.toStringTag, { value: "Module" })), E = {
|
|
95
85
|
install(e) {
|
|
96
|
-
Object.entries(
|
|
86
|
+
Object.entries(z).forEach(([t, n]) => {
|
|
97
87
|
e.component(t, n);
|
|
98
88
|
});
|
|
99
89
|
}
|
|
100
90
|
};
|
|
101
91
|
export {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
92
|
+
w as CButton,
|
|
93
|
+
O as CConfigProvider,
|
|
94
|
+
_ as buttonProps,
|
|
95
|
+
E as default
|
|
106
96
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".c-button[data-v-c8316dbd]{display:inline-block;padding:.5em 1em;outline:unset;border:unset;border-radius:4px;background:#fff;cursor:pointer}.c-button[data-v-c8316dbd]:active{box-shadow:inset 0 0 0 1px #eaeaea}.c-button--primary[data-v-c8316dbd]{background:#409eff;color:#fff}.c-button--disabled[data-v-c8316dbd]{cursor:not-allowed;opacity:.5}")),document.head.appendChild(e)}}catch(d){console.error("vite-plugin-css-injected-by-js",d)}})();
|
|
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["can-lib"]={},s.Vue))})(this,(function(s,n){"use strict";function f(e){return e.install=o=>{const t=e.name||"UnknownComponent";o.component(t,e)},e}const u=Symbol("c"),i="c",p=n.ref({namespace:"c"});function _(e,o=void 0){const t=n.getCurrentInstance()?n.inject(u,p):p;return n.computed(()=>{var c;return((c=t.value)==null?void 0:c[e])??o})}function g(e,o){const c=!!n.getCurrentInstance()?n.provide:void 0;if(!c){console.warn("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const r=n.computed(()=>n.unref(e));return c(u,r),r}function l(e){return`${_("namespace",i).value}-${e}`}const a={type:{type:String,default:"primary"},size:String},d=f(((e,o)=>{const t=e.__vccOpts||e;for(const[c,r]of o)t[c]=r;return t})(n.defineComponent({name:"CButton",__name:"button",props:a,setup(e){const o=e;function t(){console.log("click")}return(c,r)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass([n.unref(l)("button"),n.unref(l)(`button--${o.type}`)]),onClick:t},[n.renderSlot(c.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-c8316dbd"]])),m=f(n.defineComponent({name:"CConfigProvider",__name:"index",props:{namespace:{default:i}},setup(e){const o=e,t=n.ref({namespace:i}),c=g(t);return n.watch(()=>o,r=>{t.value.namespace=r==null?void 0:r.namespace},{immediate:!0,deep:!0}),(r,y)=>n.renderSlot(r.$slots,"default",{config:n.unref(c)})}})),C=Object.freeze(Object.defineProperty({__proto__:null,CButton:d,CConfigProvider:m,buttonProps:a},Symbol.toStringTag,{value:"Module"})),b={install(e){Object.entries(C).forEach(([o,t])=>{e.component(o,t)})}};s.CButton=d,s.CConfigProvider=m,s.buttonProps=a,s.default=b,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|