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