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