@can2421/ui-components 1.0.27 → 1.0.28
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 +1 -1
- package/dist/packages/components/src/button/index.d.ts +3 -3
- package/dist/packages/components/src/config-provider/hooks.d.ts +6 -0
- package/dist/packages/components/src/config-provider/index.d.ts +17 -0
- package/dist/packages/components/src/config-provider/props.d.ts +6 -0
- package/dist/packages/components/src/config-provider/token.d.ts +4 -0
- package/dist/packages/components/src/config-provider/types.d.ts +3 -0
- package/dist/ui-components.mjs +43 -29
- package/dist/ui-components.umd.js +2 -2
- package/package.json +1 -1
- package/dist/index.css +0 -1
|
@@ -28,8 +28,8 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
28
28
|
readonly default: "c";
|
|
29
29
|
};
|
|
30
30
|
}>> & Readonly<{}>, {
|
|
31
|
-
readonly type: import('./button.types').ButtonType;
|
|
32
31
|
readonly namespace: string;
|
|
32
|
+
readonly type: import('./button.types').ButtonType;
|
|
33
33
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
34
34
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
35
35
|
export default _default;
|
|
@@ -10,8 +10,8 @@ declare const CButton: import('../../../utils/install').SFCWithInstall<{
|
|
|
10
10
|
readonly default: "c";
|
|
11
11
|
};
|
|
12
12
|
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
13
|
-
readonly type: import('./button.types').ButtonType;
|
|
14
13
|
readonly namespace: string;
|
|
14
|
+
readonly type: import('./button.types').ButtonType;
|
|
15
15
|
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
16
16
|
P: {};
|
|
17
17
|
B: {};
|
|
@@ -30,8 +30,8 @@ declare const CButton: import('../../../utils/install').SFCWithInstall<{
|
|
|
30
30
|
readonly default: "c";
|
|
31
31
|
};
|
|
32
32
|
}>> & Readonly<{}>, {}, {}, {}, {}, {
|
|
33
|
-
readonly type: import('./button.types').ButtonType;
|
|
34
33
|
readonly namespace: string;
|
|
34
|
+
readonly type: import('./button.types').ButtonType;
|
|
35
35
|
}>;
|
|
36
36
|
__isFragment?: never;
|
|
37
37
|
__isTeleport?: never;
|
|
@@ -47,8 +47,8 @@ declare const CButton: import('../../../utils/install').SFCWithInstall<{
|
|
|
47
47
|
readonly default: "c";
|
|
48
48
|
};
|
|
49
49
|
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
50
|
-
readonly type: import('./button.types').ButtonType;
|
|
51
50
|
readonly namespace: string;
|
|
51
|
+
readonly type: import('./button.types').ButtonType;
|
|
52
52
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
53
53
|
$slots: {
|
|
54
54
|
default?(_: {}): any;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { App, MaybeRef, Ref } from 'vue';
|
|
2
|
+
import { ConfigProviderContext } from './types';
|
|
3
|
+
export declare function useGlobalConfig<K extends keyof ConfigProviderContext, D extends ConfigProviderContext[K]>(key: K, defaultValue?: D): Ref<Exclude<ConfigProviderContext[K], undefined> | D>;
|
|
4
|
+
export declare function useGlobalConfig(): Ref<ConfigProviderContext>;
|
|
5
|
+
export declare function provideGlobalConfig(config: MaybeRef<ConfigProviderContext>, app?: App): Ref<ConfigProviderContext, ConfigProviderContext> | undefined;
|
|
6
|
+
export declare function useNamespace(className: string): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const ConfigProvider: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
namespace: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
9
|
+
namespace: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
}>> & Readonly<{}>, {
|
|
14
|
+
namespace: string;
|
|
15
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
16
|
+
export type ConfigProviderInstance = InstanceType<typeof ConfigProvider>;
|
|
17
|
+
export default ConfigProvider;
|
package/dist/ui-components.mjs
CHANGED
|
@@ -1,53 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
n.
|
|
5
|
-
|
|
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 i, inject as p, computed as f, defineComponent as m, createElementBlock as d, openBlock as _, normalizeClass as b, unref as s, renderSlot as g } from "vue";
|
|
3
|
+
const y = (t) => (t.install = (e) => {
|
|
4
|
+
const n = t.name || "UnknownComponent";
|
|
5
|
+
e.component(n, t);
|
|
6
|
+
}, t), C = Symbol("c"), v = "c", a = u({
|
|
7
|
+
namespace: "ctsy"
|
|
8
|
+
});
|
|
9
|
+
function k(t, e = void 0) {
|
|
10
|
+
const n = i() ? p(C, a) : a;
|
|
11
|
+
return f(() => {
|
|
12
|
+
var o;
|
|
13
|
+
return ((o = n.value) == null ? void 0 : o[t]) ?? e;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function r(t) {
|
|
17
|
+
return `${k("namespace", v).value}-${t}`;
|
|
18
|
+
}
|
|
19
|
+
const S = {
|
|
6
20
|
namespace: {
|
|
7
21
|
type: String,
|
|
8
22
|
default: "c"
|
|
9
23
|
}
|
|
10
|
-
},
|
|
11
|
-
...
|
|
24
|
+
}, l = {
|
|
25
|
+
...S,
|
|
12
26
|
type: {
|
|
13
27
|
type: String,
|
|
14
28
|
default: "primary"
|
|
15
29
|
},
|
|
16
30
|
size: String
|
|
17
|
-
},
|
|
31
|
+
}, B = /* @__PURE__ */ m({
|
|
18
32
|
name: "CButton",
|
|
19
33
|
__name: "button",
|
|
20
|
-
props:
|
|
34
|
+
props: l,
|
|
21
35
|
setup(t) {
|
|
22
|
-
const
|
|
23
|
-
function
|
|
36
|
+
const e = t;
|
|
37
|
+
function n() {
|
|
24
38
|
console.log("click");
|
|
25
39
|
}
|
|
26
|
-
return (o,
|
|
27
|
-
class:
|
|
28
|
-
onClick:
|
|
40
|
+
return (o, c) => (_(), d("div", {
|
|
41
|
+
class: b([s(r)("button"), s(r)(`button--${e.type}`)]),
|
|
42
|
+
onClick: n
|
|
29
43
|
}, [
|
|
30
|
-
|
|
44
|
+
g(o.$slots, "default", {}, void 0, !0)
|
|
31
45
|
], 2));
|
|
32
46
|
}
|
|
33
|
-
}),
|
|
34
|
-
const
|
|
35
|
-
for (const [o,
|
|
36
|
-
|
|
37
|
-
return
|
|
38
|
-
},
|
|
47
|
+
}), h = (t, e) => {
|
|
48
|
+
const n = t.__vccOpts || t;
|
|
49
|
+
for (const [o, c] of e)
|
|
50
|
+
n[o] = c;
|
|
51
|
+
return n;
|
|
52
|
+
}, j = /* @__PURE__ */ h(B, [["__scopeId", "data-v-c8316dbd"]]), x = y(j), O = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
39
53
|
__proto__: null,
|
|
40
|
-
CButton:
|
|
41
|
-
buttonProps:
|
|
42
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
54
|
+
CButton: x,
|
|
55
|
+
buttonProps: l
|
|
56
|
+
}, Symbol.toStringTag, { value: "Module" })), $ = {
|
|
43
57
|
install(t) {
|
|
44
|
-
Object.entries(
|
|
45
|
-
t.component(
|
|
58
|
+
Object.entries(O).forEach(([e, n]) => {
|
|
59
|
+
t.component(e, n);
|
|
46
60
|
});
|
|
47
61
|
}
|
|
48
62
|
};
|
|
49
63
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
64
|
+
x as CButton,
|
|
65
|
+
l as buttonProps,
|
|
66
|
+
$ as default
|
|
53
67
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
|
|
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(c,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(c=typeof globalThis<"u"?globalThis:c||self,e(c["can-lib"]={},c.Vue))})(this,(function(c,e){"use strict";const f=t=>(t.install=n=>{const o=t.name||"UnknownComponent";n.component(o,t)},t),p=Symbol("c"),d="c",r=e.ref({namespace:"ctsy"});function m(t,n=void 0){const o=e.getCurrentInstance()?e.inject(p,r):r;return e.computed(()=>{var s;return((s=o.value)==null?void 0:s[t])??n})}function i(t){return`${m("namespace",d).value}-${t}`}const a={...{namespace:{type:String,default:"c"}},type:{type:String,default:"primary"},size:String},l=f(((t,n)=>{const o=t.__vccOpts||t;for(const[s,u]of n)o[s]=u;return o})(e.defineComponent({name:"CButton",__name:"button",props:a,setup(t){const n=t;function o(){console.log("click")}return(s,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(i)("button"),e.unref(i)(`button--${n.type}`)]),onClick:o},[e.renderSlot(s.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-c8316dbd"]])),_=Object.freeze(Object.defineProperty({__proto__:null,CButton:l,buttonProps:a},Symbol.toStringTag,{value:"Module"})),b={install(t){Object.entries(_).forEach(([n,o])=>{t.component(n,o)})}};c.CButton=l,c.buttonProps=a,c.default=b,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
package/package.json
CHANGED
package/dist/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.c-button[data-v-e76271b0]{display:inline-block;padding:.5em 1em;outline:unset;border:unset;border-radius:4px;background:#fff;cursor:pointer}.c-button[data-v-e76271b0]:active{box-shadow:inset 0 0 0 1px #eaeaea}.c-button--primary[data-v-e76271b0]{background:#409eff;color:#fff}.c-button--disabled[data-v-e76271b0]{cursor:not-allowed;opacity:.5}
|