@can2421/ui-components 1.0.34 → 1.0.35
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 → components}/src/config-provider/index.d.ts +11 -0
- package/dist/index.es.d.ts +0 -5
- package/dist/ui-components.mjs +35 -47
- package/dist/ui-components.umd.js +1 -1
- package/package.json +1 -1
- package/dist/packages/components/index.d.ts +0 -6
- package/dist/packages/components/vite.config.d.ts +0 -2
- package/dist/packages/utils/install.d.ts +0 -3
- package/dist/play/src/App.d.ts +0 -2
- package/dist/play/src/main.d.ts +0 -1
- package/dist/play/vite.config.d.ts +0 -2
- /package/dist/{packages/components → components}/src/button/button.d.ts +0 -0
- /package/dist/{packages/components → components}/src/button/button.types.d.ts +0 -0
- /package/dist/{packages/components → components}/src/button/index.d.ts +0 -0
- /package/dist/{packages/components → components}/src/config-provider/hooks.d.ts +0 -0
- /package/dist/{packages/components → components}/src/config-provider/props.d.ts +0 -0
- /package/dist/{packages/components → components}/src/config-provider/token.d.ts +0 -0
- /package/dist/{packages/components → components}/src/config-provider/types.d.ts +0 -0
- /package/dist/{packages/components → components}/src/index.d.ts +0 -0
- /package/dist/{packages/components → components}/src/types/baseProps.d.ts +0 -0
|
@@ -20,3 +20,14 @@ 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/index.es.d.ts
CHANGED
package/dist/ui-components.mjs
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
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 u, getCurrentInstance as p, computed as l, unref as s, provide as
|
|
3
|
-
function m(
|
|
4
|
-
return
|
|
5
|
-
const
|
|
6
|
-
t.component(
|
|
7
|
-
},
|
|
2
|
+
import { ref as u, getCurrentInstance as p, computed as l, unref as s, provide as _, inject as v, defineComponent as f, createElementBlock as b, openBlock as y, normalizeClass as k, renderSlot as d, watch as S } from "vue";
|
|
3
|
+
function m(n) {
|
|
4
|
+
return n.install = (t) => {
|
|
5
|
+
const e = n.name || "UnknownComponent";
|
|
6
|
+
t.component(e, n);
|
|
7
|
+
}, n;
|
|
8
8
|
}
|
|
9
9
|
const g = Symbol("c"), r = "c", a = u({
|
|
10
10
|
namespace: "c"
|
|
11
11
|
});
|
|
12
|
-
function
|
|
13
|
-
const
|
|
12
|
+
function $(n, t = void 0) {
|
|
13
|
+
const e = p() ? v(g, a) : a;
|
|
14
14
|
return l(() => {
|
|
15
15
|
var o;
|
|
16
|
-
return ((o =
|
|
16
|
+
return ((o = e.value) == null ? void 0 : o[n]) ?? t;
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
const o = !!p() ?
|
|
19
|
+
function h(n, t) {
|
|
20
|
+
const o = !!p() ? _ : 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 = l(() => s(
|
|
25
|
+
const c = l(() => s(n));
|
|
26
26
|
return o(g, c), c;
|
|
27
27
|
}
|
|
28
|
-
function i(
|
|
29
|
-
return `${
|
|
28
|
+
function i(n) {
|
|
29
|
+
return `${$("namespace", r).value}-${n}`;
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const x = {
|
|
32
32
|
type: {
|
|
33
33
|
type: String,
|
|
34
34
|
default: "primary"
|
|
@@ -37,38 +37,38 @@ const _ = {
|
|
|
37
37
|
}, B = /* @__PURE__ */ f({
|
|
38
38
|
name: "CButton",
|
|
39
39
|
__name: "button",
|
|
40
|
-
props:
|
|
41
|
-
setup(
|
|
42
|
-
const t =
|
|
43
|
-
function
|
|
40
|
+
props: x,
|
|
41
|
+
setup(n) {
|
|
42
|
+
const t = n;
|
|
43
|
+
function e() {
|
|
44
44
|
console.log("click");
|
|
45
45
|
}
|
|
46
|
-
return (o, c) => (
|
|
46
|
+
return (o, c) => (y(), b("div", {
|
|
47
47
|
class: k([s(i)("button"), s(i)(`button--${t.type}`)]),
|
|
48
|
-
onClick:
|
|
48
|
+
onClick: e
|
|
49
49
|
}, [
|
|
50
50
|
d(o.$slots, "default", {}, void 0, !0)
|
|
51
51
|
], 2));
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
54
|
-
const
|
|
53
|
+
}), w = (n, t) => {
|
|
54
|
+
const e = n.__vccOpts || n;
|
|
55
55
|
for (const [o, c] of t)
|
|
56
|
-
|
|
57
|
-
return
|
|
58
|
-
},
|
|
56
|
+
e[o] = c;
|
|
57
|
+
return e;
|
|
58
|
+
}, G = /* @__PURE__ */ w(B, [["__scopeId", "data-v-c8316dbd"]]), z = m(G), P = /* @__PURE__ */ f({
|
|
59
59
|
name: "CConfigProvider",
|
|
60
60
|
__name: "index",
|
|
61
61
|
props: {
|
|
62
62
|
namespace: { default: r }
|
|
63
63
|
},
|
|
64
|
-
setup(
|
|
65
|
-
const t =
|
|
64
|
+
setup(n) {
|
|
65
|
+
const t = n, e = u({
|
|
66
66
|
namespace: r
|
|
67
|
-
}), o =
|
|
68
|
-
return
|
|
67
|
+
}), o = h(e);
|
|
68
|
+
return S(
|
|
69
69
|
() => t,
|
|
70
70
|
(c) => {
|
|
71
|
-
|
|
71
|
+
e.value.namespace = c == null ? void 0 : c.namespace;
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
immediate: !0,
|
|
@@ -76,21 +76,9 @@ const _ = {
|
|
|
76
76
|
}
|
|
77
77
|
), (c, C) => d(c.$slots, "default", { config: s(o) });
|
|
78
78
|
}
|
|
79
|
-
}),
|
|
80
|
-
__proto__: null,
|
|
81
|
-
CButton: w,
|
|
82
|
-
CConfigProvider: O,
|
|
83
|
-
buttonProps: _
|
|
84
|
-
}, Symbol.toStringTag, { value: "Module" })), E = {
|
|
85
|
-
install(e) {
|
|
86
|
-
Object.entries(z).forEach(([t, n]) => {
|
|
87
|
-
e.component(t, n);
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
};
|
|
79
|
+
}), N = m(P);
|
|
91
80
|
export {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
E as default
|
|
81
|
+
z as CButton,
|
|
82
|
+
N as CConfigProvider,
|
|
83
|
+
x as buttonProps
|
|
96
84
|
};
|
|
@@ -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(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
|
|
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 a(e){return e.install=o=>{const t=e.name||"UnknownComponent";o.component(t,e)},e}const f=Symbol("c"),i="c",p=n.ref({namespace:"c"});function l(e,o=void 0){const t=n.getCurrentInstance()?n.inject(f,p):p;return n.computed(()=>{var c;return((c=t.value)==null?void 0:c[e])??o})}function m(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(f,r),r}function u(e){return`${l("namespace",i).value}-${e}`}const d={type:{type:String,default:"primary"},size:String},C=a(((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:d,setup(e){const o=e;function t(){console.log("click")}return(c,r)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass([n.unref(u)("button"),n.unref(u)(`button--${o.type}`)]),onClick:t},[n.renderSlot(c.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-c8316dbd"]])),g=a(n.defineComponent({name:"CConfigProvider",__name:"index",props:{namespace:{default:i}},setup(e){const o=e,t=n.ref({namespace:i}),c=m(t);return n.watch(()=>o,r=>{t.value.namespace=r==null?void 0:r.namespace},{immediate:!0,deep:!0}),(r,_)=>n.renderSlot(r.$slots,"default",{config:n.unref(c)})}}));s.CButton=C,s.CConfigProvider=g,s.buttonProps=d,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
package/dist/play/src/App.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
-
export default _default;
|
package/dist/play/src/main.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|