@can2421/ui-components 1.0.31 → 1.0.33

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