@can2421/ui-components 1.0.30 → 1.0.31
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,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const CConfigProvider: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
2
|
namespace: {
|
|
3
3
|
type: StringConstructor;
|
|
4
4
|
default: string;
|
|
@@ -13,5 +13,5 @@ declare const ConfigProvider: import('vue').DefineComponent<import('vue').Extrac
|
|
|
13
13
|
}>> & Readonly<{}>, {
|
|
14
14
|
namespace: string;
|
|
15
15
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
16
|
-
export type
|
|
17
|
-
export
|
|
16
|
+
export type CConfigProviderInstance = InstanceType<typeof CConfigProvider>;
|
|
17
|
+
export { CConfigProvider, };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './button';
|
|
2
|
-
export * from './config-provider
|
|
2
|
+
export * from './config-provider';
|
package/dist/ui-components.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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 i, getCurrentInstance as p, computed as u, unref as r, provide as g, inject as
|
|
2
|
+
import { ref as i, getCurrentInstance as p, computed as u, unref as r, provide as g, inject as C, defineComponent as l, createElementBlock as b, openBlock as v, normalizeClass as _, renderSlot as f, watch as y } from "vue";
|
|
3
3
|
const S = (e) => (e.install = (t) => {
|
|
4
4
|
const n = e.name || "UnknownComponent";
|
|
5
5
|
t.component(n, e);
|
|
@@ -7,7 +7,7 @@ const S = (e) => (e.install = (t) => {
|
|
|
7
7
|
namespace: "ctsy"
|
|
8
8
|
});
|
|
9
9
|
function P(e, t = void 0) {
|
|
10
|
-
const n = p() ?
|
|
10
|
+
const n = p() ? C(d, s) : s;
|
|
11
11
|
return u(() => {
|
|
12
12
|
var o;
|
|
13
13
|
return ((o = n.value) == null ? void 0 : o[e]) ?? t;
|
|
@@ -46,7 +46,7 @@ const x = {
|
|
|
46
46
|
function n() {
|
|
47
47
|
console.log("click");
|
|
48
48
|
}
|
|
49
|
-
return (o, c) => (v(),
|
|
49
|
+
return (o, c) => (v(), b("div", {
|
|
50
50
|
class: _([r(a)("button"), r(a)(`button--${t.type}`)]),
|
|
51
51
|
onClick: n
|
|
52
52
|
}, [
|
|
@@ -63,8 +63,7 @@ const x = {
|
|
|
63
63
|
type: String,
|
|
64
64
|
default: "c"
|
|
65
65
|
}
|
|
66
|
-
}
|
|
67
|
-
l({
|
|
66
|
+
}, $ = l({
|
|
68
67
|
name: "CConfigProvider",
|
|
69
68
|
props: O,
|
|
70
69
|
setup(e, { slots: t }) {
|
|
@@ -84,20 +83,21 @@ l({
|
|
|
84
83
|
const o = h(n);
|
|
85
84
|
return () => f(t, "default", { config: o == null ? void 0 : o.value });
|
|
86
85
|
}
|
|
87
|
-
})
|
|
88
|
-
const $ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
86
|
+
}), z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
89
87
|
__proto__: null,
|
|
90
88
|
CButton: G,
|
|
89
|
+
CConfigProvider: $,
|
|
91
90
|
buttonProps: m
|
|
92
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
91
|
+
}, Symbol.toStringTag, { value: "Module" })), N = {
|
|
93
92
|
install(e) {
|
|
94
|
-
Object.entries(
|
|
93
|
+
Object.entries(z).forEach(([t, n]) => {
|
|
95
94
|
e.component(t, n);
|
|
96
95
|
});
|
|
97
96
|
}
|
|
98
97
|
};
|
|
99
98
|
export {
|
|
100
99
|
G as CButton,
|
|
100
|
+
$ as CConfigProvider,
|
|
101
101
|
m as buttonProps,
|
|
102
|
-
|
|
102
|
+
N as default
|
|
103
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(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
|
|
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 d=n=>(n.install=o=>{const t=n.name||"UnknownComponent";o.component(t,n)},n),a=Symbol("c"),m="c",p=e.ref({namespace:"ctsy"});function g(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 C(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`${g("namespace",m).value}-${n}`}const i={...{namespace:{type:String,default:"c"}},type:{type:String,default:"primary"},size:String},f=d(((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"}},l=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=C(t);return()=>e.renderSlot(o,"default",{config:c==null?void 0:c.value})}}),_=Object.freeze(Object.defineProperty({__proto__:null,CButton:f,CConfigProvider:l,buttonProps:i},Symbol.toStringTag,{value:"Module"})),y={install(n){Object.entries(_).forEach(([o,t])=>{n.component(o,t)})}};r.CButton=f,r.CConfigProvider=l,r.buttonProps=i,r.default=y,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|