@can2421/ui-components 1.0.40 → 1.0.42

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.
@@ -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,2 +1,12 @@
1
- export * from './button';
2
- export * from './config-provider';
1
+ import { App } from 'vue';
2
+ import { CButton } from './button';
3
+ import { CConfigProvider } from './config-provider';
4
+ export { CButton, CConfigProvider };
5
+ export * from './button/button.types';
6
+ export * from './config-provider/types';
7
+ declare function install(app: App): void;
8
+ declare const _default: {
9
+ install: typeof install;
10
+ };
11
+ export default _default;
12
+ export { install };
@@ -1,34 +1,34 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(".c-button[data-v-2fe69762]{display:inline-block;padding:5px 15px;border-radius:4px;background:#fff;outline:none;color:#606266;font-size:14px;border:1px solid #dcdfe6;cursor:pointer;-webkit-user-select:none;user-select:none}.c-button~.c-button[data-v-2fe69762]{margin-left:8px}.c-button[data-v-2fe69762]:not(.c-button--primary,.c-button--danger,.c-button--warning,.c-button--info,.c-button--success,.c-button--plain,.c-button--disabled):hover{border-color:#57abff;background:#ecf5ff;color:#409eff}.c-button--primary[data-v-2fe69762]:not(.c-button--disabled):hover,.c-button--danger[data-v-2fe69762]:not(.c-button--disabled):hover,.c-button--warning[data-v-2fe69762]:not(.c-button--disabled):hover,.c-button--info[data-v-2fe69762]:not(.c-button--disabled):hover,.c-button--success[data-v-2fe69762]:not(.c-button--disabled):hover{opacity:.8}.c-button[data-v-2fe69762]:active:not(.c-button--disabled){transform:scale(.95)}.c-button--disabled[data-v-2fe69762]{opacity:.5;cursor:not-allowed}.c-button--round[data-v-2fe69762]{border-radius:20px}.c-button--plain[data-v-2fe69762]{background:#fff;border:1px solid #dcdfe6;color:#606266}.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{border-color:#409eff;color:#409eff}.c-button--primary[data-v-2fe69762]{background:#409eff;border-color:#409eff;color:#fff}.c-button--primary.c-button--plain[data-v-2fe69762]{background:#ecf5ff;border:1px solid #409eff;color:#409eff}.c-button--primary.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#409eff;border-color:#409eff;color:#fff}.c-button--success[data-v-2fe69762]{background:#70c646;border-color:#70c646;color:#fff}.c-button--success.c-button--plain[data-v-2fe69762]{background:#f0f9eb;border:1px solid #70c646;color:#70c646}.c-button--success.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#70c646;border-color:#70c646;color:#fff}.c-button--warning[data-v-2fe69762]{background:#e6a23c;border-color:#e6a23c;color:#fff}.c-button--warning.c-button--plain[data-v-2fe69762]{background:#fdf6ec;border:1px solid #e6a23c;color:#e6a23c}.c-button--warning.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#e6a23c;border-color:#e6a23c;color:#fff}.c-button--info[data-v-2fe69762]{background:#909399;border-color:#909399;color:#fff}.c-button--info.c-button--plain[data-v-2fe69762]{background:#f4f4f5;border:1px solid #909399;color:#909399}.c-button--info.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#909399;border-color:#909399;color:#fff}.c-button--danger[data-v-2fe69762]{background:#f56c6c;border-color:#f56c6c;color:#fff}.c-button--danger.c-button--plain[data-v-2fe69762]{background:#fef0f0;border:1px solid #f56c6c;color:#f56c6c}.c-button--danger.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#f56c6c;border-color:#f56c6c;color:#fff}.c-button--small[data-v-2fe69762]{padding:2px 7px;font-size:12px}.c-button--large[data-v-2fe69762]{padding:8px 19px;font-size:14px}")),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- import { ref as l, getCurrentInstance as u, computed as p, unref as s, provide as C, inject as v, defineComponent as d, createElementBlock as y, openBlock as B, normalizeClass as S, renderSlot as f, watch as h } from "vue";
3
- function m(e) {
4
- return e.install = (n) => {
5
- const t = e.name || "UnknownComponent";
6
- n.component(t, e);
7
- }, e;
2
+ import { ref as d, getCurrentInstance as p, computed as f, unref as c, provide as v, inject as B, defineComponent as m, createElementBlock as y, openBlock as k, normalizeClass as $, renderSlot as b, watch as h } from "vue";
3
+ function C(n) {
4
+ return n.install = (e) => {
5
+ const o = n.name || "UnknownComponent";
6
+ e.component(o, n);
7
+ }, n;
8
8
  }
9
- const b = Symbol("c"), r = "c", i = l({
9
+ const g = Symbol("c"), i = "c", r = d({
10
10
  namespace: "c"
11
11
  });
12
- function k(e, n = void 0) {
13
- const t = u() ? v(b, i) : i;
14
- return p(() => {
15
- var o;
16
- return ((o = t.value) == null ? void 0 : o[e]) ?? n;
12
+ function x(n, e = void 0) {
13
+ const o = p() ? B(g, r) : r;
14
+ return f(() => {
15
+ var t;
16
+ return ((t = o.value) == null ? void 0 : t[n]) ?? e;
17
17
  });
18
18
  }
19
- function $(e, n) {
20
- const o = !!u() ? C : void 0;
21
- if (!o) {
19
+ function S(n, e) {
20
+ const t = !!p() ? v : void 0;
21
+ if (!t) {
22
22
  console.warn("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
23
23
  return;
24
24
  }
25
- const c = p(() => s(e));
26
- return o(b, c), c;
25
+ const s = f(() => c(n));
26
+ return t(g, s), s;
27
27
  }
28
- function a(e) {
29
- return `${k("namespace", r).value}-${e}`;
28
+ function a(n) {
29
+ return `${x("namespace", i).value}-${n}`;
30
30
  }
31
- const g = {
31
+ const P = {
32
32
  type: {
33
33
  type: String,
34
34
  default: ""
@@ -37,71 +37,65 @@ const g = {
37
37
  disabled: Boolean,
38
38
  plain: Boolean,
39
39
  round: Boolean
40
- }, x = ["disabled"], z = /* @__PURE__ */ d({
40
+ }, w = ["disabled"], z = /* @__PURE__ */ m({
41
41
  name: "CButton",
42
42
  __name: "button",
43
- props: g,
44
- setup(e) {
45
- const n = e;
46
- function t() {
43
+ props: P,
44
+ setup(n) {
45
+ const e = n;
46
+ function o() {
47
47
  console.log("click");
48
48
  }
49
- return (o, c) => (B(), y("button", {
50
- class: S([
51
- s(a)("button"),
52
- n.type && s(a)(`button--${n.type}`),
53
- n.size && s(a)(`button--${n.size}`),
54
- n.disabled && s(a)("button--disabled"),
55
- n.plain && s(a)("button--plain"),
56
- n.round && s(a)("button--round")
49
+ return (t, s) => (k(), y("button", {
50
+ class: $([
51
+ c(a)("button"),
52
+ e.type && c(a)(`button--${e.type}`),
53
+ e.size && c(a)(`button--${e.size}`),
54
+ e.disabled && c(a)("button--disabled"),
55
+ e.plain && c(a)("button--plain"),
56
+ e.round && c(a)("button--round")
57
57
  ]),
58
- disabled: n.disabled,
59
- onClick: t
58
+ disabled: e.disabled,
59
+ onClick: o
60
60
  }, [
61
- f(o.$slots, "default", {}, void 0, !0)
62
- ], 10, x));
61
+ b(t.$slots, "default", {}, void 0, !0)
62
+ ], 10, w));
63
63
  }
64
- }), P = (e, n) => {
65
- const t = e.__vccOpts || e;
66
- for (const [o, c] of n)
67
- t[o] = c;
68
- return t;
69
- }, j = /* @__PURE__ */ P(z, [["__scopeId", "data-v-2fe69762"]]), w = m(j), G = /* @__PURE__ */ d({
64
+ }), G = (n, e) => {
65
+ const o = n.__vccOpts || n;
66
+ for (const [t, s] of e)
67
+ o[t] = s;
68
+ return o;
69
+ }, I = /* @__PURE__ */ G(z, [["__scopeId", "data-v-2fe69762"]]), u = C(I), N = /* @__PURE__ */ m({
70
70
  name: "CConfigProvider",
71
71
  __name: "index",
72
72
  props: {
73
- namespace: { default: r }
73
+ namespace: { default: i }
74
74
  },
75
- setup(e) {
76
- const n = e, t = l({
77
- namespace: r
78
- }), o = $(t);
75
+ setup(n) {
76
+ const e = n, o = d({
77
+ namespace: i
78
+ }), t = S(o);
79
79
  return h(
80
- () => n,
81
- (c) => {
82
- t.value.namespace = c == null ? void 0 : c.namespace;
80
+ () => e,
81
+ (s) => {
82
+ o.value.namespace = s == null ? void 0 : s.namespace;
83
83
  },
84
84
  {
85
85
  immediate: !0,
86
86
  deep: !0
87
87
  }
88
- ), (c, _) => f(c.$slots, "default", { config: s(o) });
88
+ ), (s, _) => b(s.$slots, "default", { config: c(t) });
89
89
  }
90
- }), O = m(G), I = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
91
- __proto__: null,
92
- CButton: w,
93
- CConfigProvider: O,
94
- buttonProps: g
95
- }, Symbol.toStringTag, { value: "Module" })), N = {
96
- install(e) {
97
- Object.entries(I).forEach(([n, t]) => {
98
- e.component(n, t);
99
- });
100
- }
101
- };
90
+ }), l = C(N);
91
+ function j(n) {
92
+ n.component(u.name || "CButton", u), n.component(l.name || "CConfigProvider", l);
93
+ }
94
+ const F = { install: j };
102
95
  export {
103
- w as CButton,
104
- O as CConfigProvider,
105
- g as buttonProps,
106
- N as default
96
+ u as CButton,
97
+ l as CConfigProvider,
98
+ P as buttonProps,
99
+ F as default,
100
+ j as install
107
101
  };
@@ -1,2 +1,2 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(".c-button[data-v-2fe69762]{display:inline-block;padding:5px 15px;border-radius:4px;background:#fff;outline:none;color:#606266;font-size:14px;border:1px solid #dcdfe6;cursor:pointer;-webkit-user-select:none;user-select:none}.c-button~.c-button[data-v-2fe69762]{margin-left:8px}.c-button[data-v-2fe69762]:not(.c-button--primary,.c-button--danger,.c-button--warning,.c-button--info,.c-button--success,.c-button--plain,.c-button--disabled):hover{border-color:#57abff;background:#ecf5ff;color:#409eff}.c-button--primary[data-v-2fe69762]:not(.c-button--disabled):hover,.c-button--danger[data-v-2fe69762]:not(.c-button--disabled):hover,.c-button--warning[data-v-2fe69762]:not(.c-button--disabled):hover,.c-button--info[data-v-2fe69762]:not(.c-button--disabled):hover,.c-button--success[data-v-2fe69762]:not(.c-button--disabled):hover{opacity:.8}.c-button[data-v-2fe69762]:active:not(.c-button--disabled){transform:scale(.95)}.c-button--disabled[data-v-2fe69762]{opacity:.5;cursor:not-allowed}.c-button--round[data-v-2fe69762]{border-radius:20px}.c-button--plain[data-v-2fe69762]{background:#fff;border:1px solid #dcdfe6;color:#606266}.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{border-color:#409eff;color:#409eff}.c-button--primary[data-v-2fe69762]{background:#409eff;border-color:#409eff;color:#fff}.c-button--primary.c-button--plain[data-v-2fe69762]{background:#ecf5ff;border:1px solid #409eff;color:#409eff}.c-button--primary.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#409eff;border-color:#409eff;color:#fff}.c-button--success[data-v-2fe69762]{background:#70c646;border-color:#70c646;color:#fff}.c-button--success.c-button--plain[data-v-2fe69762]{background:#f0f9eb;border:1px solid #70c646;color:#70c646}.c-button--success.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#70c646;border-color:#70c646;color:#fff}.c-button--warning[data-v-2fe69762]{background:#e6a23c;border-color:#e6a23c;color:#fff}.c-button--warning.c-button--plain[data-v-2fe69762]{background:#fdf6ec;border:1px solid #e6a23c;color:#e6a23c}.c-button--warning.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#e6a23c;border-color:#e6a23c;color:#fff}.c-button--info[data-v-2fe69762]{background:#909399;border-color:#909399;color:#fff}.c-button--info.c-button--plain[data-v-2fe69762]{background:#f4f4f5;border:1px solid #909399;color:#909399}.c-button--info.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#909399;border-color:#909399;color:#fff}.c-button--danger[data-v-2fe69762]{background:#f56c6c;border-color:#f56c6c;color:#fff}.c-button--danger.c-button--plain[data-v-2fe69762]{background:#fef0f0;border:1px solid #f56c6c;color:#f56c6c}.c-button--danger.c-button--plain[data-v-2fe69762]:not(.c-button--disabled):hover{background:#f56c6c;border-color:#f56c6c;color:#fff}.c-button--small[data-v-2fe69762]{padding:2px 7px;font-size:12px}.c-button--large[data-v-2fe69762]{padding:8px 19px;font-size:14px}")),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- (function(i,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(i=typeof globalThis<"u"?globalThis:i||self,n(i["@can2421/ui-components"]={},i.Vue))})(this,(function(i,n){"use strict";function f(t){return t.install=e=>{const o=t.name||"UnknownComponent";e.component(o,t)},t}const l=Symbol("c"),a="c",u=n.ref({namespace:"c"});function _(t,e=void 0){const o=n.getCurrentInstance()?n.inject(l,u):u;return n.computed(()=>{var s;return((s=o.value)==null?void 0:s[t])??e})}function b(t,e){const s=!!n.getCurrentInstance()?n.provide:void 0;if(!s){console.warn("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const c=n.computed(()=>n.unref(t));return s(l,c),c}function r(t){return`${_("namespace",a).value}-${t}`}const d={type:{type:String,default:""},size:String,disabled:Boolean,plain:Boolean,round:Boolean},g=["disabled"],p=f(((t,e)=>{const o=t.__vccOpts||t;for(const[s,c]of e)o[s]=c;return o})(n.defineComponent({name:"CButton",__name:"button",props:d,setup(t){const e=t;function o(){console.log("click")}return(s,c)=>(n.openBlock(),n.createElementBlock("button",{class:n.normalizeClass([n.unref(r)("button"),e.type&&n.unref(r)(`button--${e.type}`),e.size&&n.unref(r)(`button--${e.size}`),e.disabled&&n.unref(r)("button--disabled"),e.plain&&n.unref(r)("button--plain"),e.round&&n.unref(r)("button--round")]),disabled:e.disabled,onClick:o},[n.renderSlot(s.$slots,"default",{},void 0,!0)],10,g))}}),[["__scopeId","data-v-2fe69762"]])),m=f(n.defineComponent({name:"CConfigProvider",__name:"index",props:{namespace:{default:a}},setup(t){const e=t,o=n.ref({namespace:a}),s=b(o);return n.watch(()=>e,c=>{o.value.namespace=c==null?void 0:c.namespace},{immediate:!0,deep:!0}),(c,S)=>n.renderSlot(c.$slots,"default",{config:n.unref(s)})}})),C=Object.freeze(Object.defineProperty({__proto__:null,CButton:p,CConfigProvider:m,buttonProps:d},Symbol.toStringTag,{value:"Module"})),y={install(t){Object.entries(C).forEach(([e,o])=>{t.component(e,o)})}};i.CButton=p,i.CConfigProvider=m,i.buttonProps=d,i.default=y,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
2
+ (function(i,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(i=typeof globalThis<"u"?globalThis:i||self,n(i.CanUICpmonents={},i.Vue))})(this,(function(i,n){"use strict";function u(e){return e.install=t=>{const o=e.name||"UnknownComponent";t.component(o,e)},e}const l=Symbol("c"),a="c",p=n.ref({namespace:"c"});function _(e,t=void 0){const o=n.getCurrentInstance()?n.inject(l,p):p;return n.computed(()=>{var s;return((s=o.value)==null?void 0:s[e])??t})}function b(e,t){const s=!!n.getCurrentInstance()?n.provide:void 0;if(!s){console.warn("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const c=n.computed(()=>n.unref(e));return s(l,c),c}function r(e){return`${_("namespace",a).value}-${e}`}const m={type:{type:String,default:""},size:String,disabled:Boolean,plain:Boolean,round:Boolean},g=["disabled"],d=u(((e,t)=>{const o=e.__vccOpts||e;for(const[s,c]of t)o[s]=c;return o})(n.defineComponent({name:"CButton",__name:"button",props:m,setup(e){const t=e;function o(){console.log("click")}return(s,c)=>(n.openBlock(),n.createElementBlock("button",{class:n.normalizeClass([n.unref(r)("button"),t.type&&n.unref(r)(`button--${t.type}`),t.size&&n.unref(r)(`button--${t.size}`),t.disabled&&n.unref(r)("button--disabled"),t.plain&&n.unref(r)("button--plain"),t.round&&n.unref(r)("button--round")]),disabled:t.disabled,onClick:o},[n.renderSlot(s.$slots,"default",{},void 0,!0)],10,g))}}),[["__scopeId","data-v-2fe69762"]])),f=u(n.defineComponent({name:"CConfigProvider",__name:"index",props:{namespace:{default:a}},setup(e){const t=e,o=n.ref({namespace:a}),s=b(o);return n.watch(()=>t,c=>{o.value.namespace=c==null?void 0:c.namespace},{immediate:!0,deep:!0}),(c,B)=>n.renderSlot(c.$slots,"default",{config:n.unref(s)})}}));function C(e){e.component(d.name||"CButton",d),e.component(f.name||"CConfigProvider",f)}const y={install:C};i.CButton=d,i.CConfigProvider=f,i.buttonProps=m,i.default=y,i.install=C,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@can2421/ui-components",
3
- "version": "1.0.40",
3
+ "version": "1.0.42",
4
4
  "exports": {
5
5
  ".": {
6
- "types": "./dist/index.es.d.ts",
6
+ "types": "./dist/components/src/index.d.ts",
7
7
  "import": "./dist/ui-components.mjs",
8
8
  "require": "./dist/ui-components.umd.js"
9
9
  },
@@ -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,6 +0,0 @@
1
- export declare const baseProps: {
2
- readonly namespace: {
3
- readonly type: StringConstructor;
4
- readonly default: "c";
5
- };
6
- };
@@ -1,2 +0,0 @@
1
- export * from '../button/button.types';
2
- export * from '../config-provider/types';
@@ -1,2 +0,0 @@
1
- declare const _default: import('vite').UserConfig;
2
- export default _default;
@@ -1,6 +0,0 @@
1
- export * from './components/index'
2
- export {}
3
- import can2421uiComponents from './components/index'
4
- export default can2421uiComponents
5
- export * from './components/index'
6
- export {}