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