@can2421/ui-components 1.0.31 → 1.0.33
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,17 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ConfigProviderContext } from './types';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {
|
|
6
|
+
config: ConfigProviderContext | undefined;
|
|
7
|
+
}): any;
|
|
5
8
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
default: string;
|
|
12
|
-
};
|
|
13
|
-
}>> & 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<{}>, {
|
|
14
14
|
namespace: string;
|
|
15
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions,
|
|
16
|
-
|
|
17
|
-
export
|
|
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,56 +1,59 @@
|
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { ref as p, getCurrentInstance as u, 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
|
+
return e.install = (t) => {
|
|
5
|
+
const n = e.name || "UnknownComponent";
|
|
6
|
+
t.component(n, e);
|
|
7
|
+
}, e;
|
|
8
|
+
}
|
|
9
|
+
const g = Symbol("c"), r = "c", a = p({
|
|
10
|
+
namespace: "c"
|
|
8
11
|
});
|
|
9
|
-
function
|
|
10
|
-
const n =
|
|
11
|
-
return
|
|
12
|
+
function x(e, t = void 0) {
|
|
13
|
+
const n = u() ? v(g, a) : a;
|
|
14
|
+
return l(() => {
|
|
12
15
|
var o;
|
|
13
16
|
return ((o = n.value) == null ? void 0 : o[e]) ?? t;
|
|
14
17
|
});
|
|
15
18
|
}
|
|
16
|
-
function
|
|
17
|
-
const o = !!
|
|
19
|
+
function P(e, t) {
|
|
20
|
+
const o = !!u() ? b : void 0;
|
|
18
21
|
if (!o) {
|
|
19
22
|
console.warn("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
|
|
20
23
|
return;
|
|
21
24
|
}
|
|
22
|
-
const c =
|
|
23
|
-
return o(
|
|
25
|
+
const c = l(() => s(e));
|
|
26
|
+
return o(g, c), c;
|
|
24
27
|
}
|
|
25
|
-
function
|
|
26
|
-
return `${
|
|
28
|
+
function i(e) {
|
|
29
|
+
return `${x("namespace", r).value}-${e}`;
|
|
27
30
|
}
|
|
28
|
-
const
|
|
31
|
+
const $ = {
|
|
29
32
|
namespace: {
|
|
30
33
|
type: String,
|
|
31
34
|
default: "c"
|
|
32
35
|
}
|
|
33
|
-
},
|
|
34
|
-
|
|
36
|
+
}, _ = {
|
|
37
|
+
...$,
|
|
35
38
|
type: {
|
|
36
39
|
type: String,
|
|
37
40
|
default: "primary"
|
|
38
41
|
},
|
|
39
42
|
size: String
|
|
40
|
-
}, B = /* @__PURE__ */
|
|
43
|
+
}, B = /* @__PURE__ */ f({
|
|
41
44
|
name: "CButton",
|
|
42
45
|
__name: "button",
|
|
43
|
-
props:
|
|
46
|
+
props: _,
|
|
44
47
|
setup(e) {
|
|
45
48
|
const t = e;
|
|
46
49
|
function n() {
|
|
47
50
|
console.log("click");
|
|
48
51
|
}
|
|
49
|
-
return (o, c) => (
|
|
50
|
-
class:
|
|
52
|
+
return (o, c) => (S(), y("div", {
|
|
53
|
+
class: k([s(i)("button"), s(i)(`button--${t.type}`)]),
|
|
51
54
|
onClick: n
|
|
52
55
|
}, [
|
|
53
|
-
|
|
56
|
+
d(o.$slots, "default", {}, void 0, !0)
|
|
54
57
|
], 2));
|
|
55
58
|
}
|
|
56
59
|
}), j = (e, t) => {
|
|
@@ -58,46 +61,42 @@ const x = {
|
|
|
58
61
|
for (const [o, c] of t)
|
|
59
62
|
n[o] = c;
|
|
60
63
|
return n;
|
|
61
|
-
}, w = /* @__PURE__ */ j(B, [["__scopeId", "data-v-c8316dbd"]]), G =
|
|
62
|
-
namespace: {
|
|
63
|
-
type: String,
|
|
64
|
-
default: "c"
|
|
65
|
-
}
|
|
66
|
-
}, $ = l({
|
|
64
|
+
}, w = /* @__PURE__ */ j(B, [["__scopeId", "data-v-c8316dbd"]]), G = m(w), O = /* @__PURE__ */ f({
|
|
67
65
|
name: "CConfigProvider",
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
66
|
+
__name: "index",
|
|
67
|
+
props: {
|
|
68
|
+
namespace: { default: r }
|
|
69
|
+
},
|
|
70
|
+
setup(e) {
|
|
71
|
+
const t = e, n = p({
|
|
72
|
+
namespace: r
|
|
73
|
+
}), o = P(n);
|
|
74
|
+
return h(
|
|
75
|
+
() => t,
|
|
75
76
|
(c) => {
|
|
76
77
|
n.value.namespace = c == null ? void 0 : c.namespace;
|
|
77
78
|
},
|
|
78
79
|
{
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
immediate: !0,
|
|
81
|
+
deep: !0
|
|
81
82
|
}
|
|
82
|
-
);
|
|
83
|
-
const o = h(n);
|
|
84
|
-
return () => f(t, "default", { config: o == null ? void 0 : o.value });
|
|
83
|
+
), (c, C) => d(c.$slots, "default", { config: s(o) });
|
|
85
84
|
}
|
|
86
|
-
}), z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
85
|
+
}), z = m(O), I = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
87
86
|
__proto__: null,
|
|
88
87
|
CButton: G,
|
|
89
|
-
CConfigProvider:
|
|
90
|
-
buttonProps:
|
|
88
|
+
CConfigProvider: z,
|
|
89
|
+
buttonProps: _
|
|
91
90
|
}, Symbol.toStringTag, { value: "Module" })), N = {
|
|
92
91
|
install(e) {
|
|
93
|
-
Object.entries(
|
|
92
|
+
Object.entries(I).forEach(([t, n]) => {
|
|
94
93
|
e.component(t, n);
|
|
95
94
|
});
|
|
96
95
|
}
|
|
97
96
|
};
|
|
98
97
|
export {
|
|
99
98
|
G as CButton,
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
z as CConfigProvider,
|
|
100
|
+
_ as buttonProps,
|
|
102
101
|
N as default
|
|
103
102
|
};
|
|
@@ -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(r,
|
|
2
|
+
(function(r,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(r=typeof globalThis<"u"?globalThis:r||self,n(r["can-lib"]={},r.Vue))})(this,(function(r,n){"use strict";function f(e){return e.install=o=>{const t=e.name||"UnknownComponent";o.component(t,e)},e}const p=Symbol("c"),i="c",u=n.ref({namespace:"c"});function _(e,o=void 0){const t=n.getCurrentInstance()?n.inject(p,u):u;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 s=n.computed(()=>n.unref(e));return c(p,s),s}function l(e){return`${_("namespace",i).value}-${e}`}const a={...{namespace:{type:String,default:"c"}},type:{type:String,default:"primary"},size:String},d=f(((e,o)=>{const t=e.__vccOpts||e;for(const[c,s]of o)t[c]=s;return t})(n.defineComponent({name:"CButton",__name:"button",props:a,setup(e){const o=e;function t(){console.log("click")}return(c,s)=>(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,s=>{t.value.namespace=s==null?void 0:s.namespace},{immediate:!0,deep:!0}),(s,y)=>n.renderSlot(s.$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)})}};r.CButton=d,r.CConfigProvider=m,r.buttonProps=a,r.default=b,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|