@a2simcode/dui 0.0.1

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.
@@ -0,0 +1,51 @@
1
+ declare const DuiButton: {
2
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('..').ButtonProps> & Readonly<{
3
+ onClick?: ((event: MouseEvent) => any) | undefined;
4
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
5
+ click: (event: MouseEvent) => any;
6
+ }, import('vue').PublicProps, {
7
+ size: "large" | "default" | "small";
8
+ type: "primary" | "default" | "dashed" | "text";
9
+ shape: "default" | "round" | "circle";
10
+ loading: boolean;
11
+ disabled: boolean;
12
+ block: boolean;
13
+ }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLButtonElement, import('vue').ComponentProvideOptions, {
14
+ P: {};
15
+ B: {};
16
+ D: {};
17
+ C: {};
18
+ M: {};
19
+ Defaults: {};
20
+ }, Readonly<import('..').ButtonProps> & Readonly<{
21
+ onClick?: ((event: MouseEvent) => any) | undefined;
22
+ }>, {}, {}, {}, {}, {
23
+ size: "large" | "default" | "small";
24
+ type: "primary" | "default" | "dashed" | "text";
25
+ shape: "default" | "round" | "circle";
26
+ loading: boolean;
27
+ disabled: boolean;
28
+ block: boolean;
29
+ }>;
30
+ __isFragment?: never;
31
+ __isTeleport?: never;
32
+ __isSuspense?: never;
33
+ } & import('vue').ComponentOptionsBase<Readonly<import('..').ButtonProps> & Readonly<{
34
+ onClick?: ((event: MouseEvent) => any) | undefined;
35
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
36
+ click: (event: MouseEvent) => any;
37
+ }, string, {
38
+ size: "large" | "default" | "small";
39
+ type: "primary" | "default" | "dashed" | "text";
40
+ shape: "default" | "round" | "circle";
41
+ loading: boolean;
42
+ disabled: boolean;
43
+ block: boolean;
44
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
45
+ $slots: {
46
+ default?(_: {}): any;
47
+ };
48
+ }) & {
49
+ install: (app: import('vue').App) => void;
50
+ };
51
+ export default DuiButton;
@@ -0,0 +1,29 @@
1
+ import { ButtonProps } from './types';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ default?(_: {}): any;
6
+ };
7
+ refs: {};
8
+ rootEl: HTMLButtonElement;
9
+ };
10
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
+ declare const __VLS_component: import('vue').DefineComponent<ButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
12
+ click: (event: MouseEvent) => any;
13
+ }, string, import('vue').PublicProps, Readonly<ButtonProps> & Readonly<{
14
+ onClick?: ((event: MouseEvent) => any) | undefined;
15
+ }>, {
16
+ size: "large" | "default" | "small";
17
+ type: "primary" | "default" | "dashed" | "text";
18
+ shape: "default" | "round" | "circle";
19
+ loading: boolean;
20
+ disabled: boolean;
21
+ block: boolean;
22
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
23
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
24
+ export default _default;
25
+ type __VLS_WithTemplateSlots<T, S> = T & {
26
+ new (): {
27
+ $slots: S;
28
+ };
29
+ };
@@ -0,0 +1,9 @@
1
+ export interface ButtonProps {
2
+ type?: 'primary' | 'default' | 'dashed' | 'text';
3
+ size?: 'large' | 'default' | 'small';
4
+ shape?: 'default' | 'round' | 'circle';
5
+ icon?: string;
6
+ loading?: boolean;
7
+ disabled?: boolean;
8
+ block?: boolean;
9
+ }
package/dist/dui.css ADDED
@@ -0,0 +1 @@
1
+ .dui-button[data-v-6eec975a]{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 16px;font-size:14px;line-height:1.5;border:1px solid #d9d9d9;border-radius:4px;background-color:#fff;color:#000;cursor:pointer;transition:all .3s;outline:none}.dui-button[data-v-6eec975a]:hover:not(.dui-button-disabled):not(.dui-button-loading){border-color:#4080ff;color:#4080ff}.dui-button[data-v-6eec975a]:active:not(.dui-button-disabled):not(.dui-button-loading){transform:scale(.98)}.dui-button.dui-button-primary[data-v-6eec975a]{background-color:#4080ff;border-color:#4080ff;color:#fff}.dui-button.dui-button-primary[data-v-6eec975a]:hover:not(.dui-button-disabled):not(.dui-button-loading){background-color:#165dff;border-color:#165dff}.dui-button.dui-button-dashed[data-v-6eec975a]{border-style:dashed}.dui-button.dui-button-text[data-v-6eec975a]{border:none;background-color:transparent}.dui-button.dui-button-text[data-v-6eec975a]:hover:not(.dui-button-disabled):not(.dui-button-loading){background-color:#f5f5f5}.dui-button.dui-button-lg[data-v-6eec975a]{padding:12px 24px;font-size:16px}.dui-button.dui-button-sm[data-v-6eec975a]{padding:4px 12px;font-size:12px}.dui-button.dui-button-round[data-v-6eec975a]{border-radius:20px}.dui-button.dui-button-circle[data-v-6eec975a]{border-radius:50%;width:32px;height:32px;padding:0}.dui-button.dui-button-block[data-v-6eec975a]{width:100%}.dui-button.dui-button-loading[data-v-6eec975a],.dui-button.dui-button-disabled[data-v-6eec975a]{opacity:.6;cursor:not-allowed}.dui-button .dui-button-loading-icon[data-v-6eec975a]{animation:spin-6eec975a 1s linear infinite}@keyframes spin-6eec975a{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
package/dist/dui.es.js ADDED
@@ -0,0 +1,72 @@
1
+ import { defineComponent as s, openBlock as o, createElementBlock as d, normalizeClass as c, createCommentVNode as u, toDisplayString as b, renderSlot as f } from "vue";
2
+ const r = (t) => (t.install = (e) => {
3
+ e.component(t.name, t);
4
+ }, t), m = ["disabled"], y = {
5
+ key: 0,
6
+ class: "dui-button-loading-icon"
7
+ }, h = {
8
+ key: 1,
9
+ class: "dui-button-icon"
10
+ }, k = {
11
+ key: 2,
12
+ class: "dui-button-content"
13
+ }, g = /* @__PURE__ */ s({
14
+ name: "DuiButton",
15
+ __name: "button",
16
+ props: {
17
+ type: { default: "default" },
18
+ size: { default: "default" },
19
+ shape: { default: "default" },
20
+ icon: {},
21
+ loading: { type: Boolean, default: !1 },
22
+ disabled: { type: Boolean, default: !1 },
23
+ block: { type: Boolean, default: !1 }
24
+ },
25
+ emits: ["click"],
26
+ setup(t, { emit: e }) {
27
+ const n = t, l = e, i = (a) => {
28
+ !n.disabled && !n.loading && l("click", a);
29
+ };
30
+ return (a, D) => (o(), d("button", {
31
+ class: c([
32
+ "dui-button",
33
+ {
34
+ "dui-button-primary": t.type === "primary",
35
+ "dui-button-default": t.type === "default",
36
+ "dui-button-dashed": t.type === "dashed",
37
+ "dui-button-text": t.type === "text",
38
+ "dui-button-lg": t.size === "large",
39
+ "dui-button-sm": t.size === "small",
40
+ "dui-button-round": t.shape === "round",
41
+ "dui-button-circle": t.shape === "circle",
42
+ "dui-button-block": t.block,
43
+ "dui-button-loading": t.loading,
44
+ "dui-button-disabled": t.disabled
45
+ }
46
+ ]),
47
+ disabled: t.disabled || t.loading,
48
+ onClick: i
49
+ }, [
50
+ t.loading ? (o(), d("span", y, "⏳")) : u("", !0),
51
+ t.icon && !t.loading ? (o(), d("span", h, b(t.icon), 1)) : u("", !0),
52
+ a.$slots.default ? (o(), d("span", k, [
53
+ f(a.$slots, "default", {}, void 0, !0)
54
+ ])) : u("", !0)
55
+ ], 10, m));
56
+ }
57
+ }), B = (t, e) => {
58
+ const n = t.__vccOpts || t;
59
+ for (const [l, i] of e)
60
+ n[l] = i;
61
+ return n;
62
+ }, C = /* @__PURE__ */ B(g, [["__scopeId", "data-v-6eec975a"]]), v = r(C), x = [v], z = (t) => {
63
+ x.forEach((e) => {
64
+ t.component(e.name, e);
65
+ });
66
+ }, I = {
67
+ install: z
68
+ };
69
+ export {
70
+ v as DuiButton,
71
+ I as default
72
+ };
@@ -0,0 +1 @@
1
+ (function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.DuiUI={},n.Vue))})(this,(function(n,e){"use strict";const c=t=>(t.install=o=>{o.component(t.name,t)},t),s=["disabled"],f={key:0,class:"dui-button-loading-icon"},b={key:1,class:"dui-button-icon"},r={key:2,class:"dui-button-content"},u=c(((t,o)=>{const i=t.__vccOpts||t;for(const[d,a]of o)i[d]=a;return i})(e.defineComponent({name:"DuiButton",__name:"button",props:{type:{default:"default"},size:{default:"default"},shape:{default:"default"},icon:{},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},block:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:o}){const i=t,d=o,a=l=>{!i.disabled&&!i.loading&&d("click",l)};return(l,C)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["dui-button",{"dui-button-primary":t.type==="primary","dui-button-default":t.type==="default","dui-button-dashed":t.type==="dashed","dui-button-text":t.type==="text","dui-button-lg":t.size==="large","dui-button-sm":t.size==="small","dui-button-round":t.shape==="round","dui-button-circle":t.shape==="circle","dui-button-block":t.block,"dui-button-loading":t.loading,"dui-button-disabled":t.disabled}]),disabled:t.disabled||t.loading,onClick:a},[t.loading?(e.openBlock(),e.createElementBlock("span",f,"⏳")):e.createCommentVNode("",!0),t.icon&&!t.loading?(e.openBlock(),e.createElementBlock("span",b,e.toDisplayString(t.icon),1)):e.createCommentVNode("",!0),l.$slots.default?(e.openBlock(),e.createElementBlock("span",r,[e.renderSlot(l.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)],10,s))}}),[["__scopeId","data-v-6eec975a"]])),m=[u],k={install:t=>{m.forEach(o=>{t.component(o.name,o)})}};n.DuiButton=u,n.default=k,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
@@ -0,0 +1,8 @@
1
+ import { App } from 'vue';
2
+ import { default as DuiButton } from './button';
3
+ export { DuiButton };
4
+ export type { ButtonProps } from './button/src/types';
5
+ declare const _default: {
6
+ install: (app: App) => void;
7
+ };
8
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import { App, Component } from 'vue';
2
+ export declare const withInstall: <T extends Component>(component: T) => T & {
3
+ install: (app: App) => void;
4
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import('vite').UserConfig;
2
+ export default _default;
package/package.json ADDED
@@ -0,0 +1,102 @@
1
+ {
2
+ "name": "@a2simcode/dui",
3
+ "version": "0.0.1",
4
+ "description": "A Vue 3 DUI Component Library - 独立可发布的 DUI 组件子集",
5
+ "type": "module",
6
+ "main": "./dist/dui.umd.js",
7
+ "module": "./dist/dui.es.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/dui.es.js",
13
+ "require": "./dist/dui.umd.js"
14
+ },
15
+ "./dist/style.css": "./dist/style.css"
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "scripts": {
21
+ "build": "vite build",
22
+ "dev": "vite build --watch"
23
+ },
24
+ "keywords": [
25
+ "vue",
26
+ "vue3",
27
+ "component",
28
+ "dui",
29
+ "ui"
30
+ ],
31
+ "author": "苏州极简搭信息技术有限公司",
32
+ "license": "UNLICENSED",
33
+ "peerDependencies": {
34
+ "@bwip-js/browser": "^4.8.0",
35
+ "@codemirror/autocomplete": "^6.20.0",
36
+ "@codemirror/commands": "^6.10.1",
37
+ "@codemirror/lang-css": "^6.3.1",
38
+ "@codemirror/lang-html": "^6.4.11",
39
+ "@codemirror/lang-java": "^6.0.2",
40
+ "@codemirror/lang-javascript": "^6.2.4",
41
+ "@codemirror/lang-json": "^6.0.2",
42
+ "@codemirror/lang-markdown": "^6.5.0",
43
+ "@codemirror/lang-python": "^6.2.1",
44
+ "@codemirror/lang-sql": "^6.10.0",
45
+ "@codemirror/lang-xml": "^6.1.0",
46
+ "@codemirror/language": "^6.12.1",
47
+ "@codemirror/state": "^6.5.4",
48
+ "@codemirror/view": "^6.39.11",
49
+ "@iconify/vue": "^5.0.0",
50
+ "@visactor/vtable": "^1.22.9",
51
+ "@visactor/vtable-editors": "^1.22.9",
52
+ "@vueuse/core": "^14.1.0",
53
+ "async-validator": "^4.2.5",
54
+ "codemirror": "^6.0.2",
55
+ "countup.js": "^2.0.8",
56
+ "crypto-js": "^4.1.1",
57
+ "dayjs": "^1.11.19",
58
+ "echarts": "^6.0.0",
59
+ "element-plus": "^2.13.1",
60
+ "sortablejs": "^1.15.0",
61
+ "sql-formatter": "^15.6.12",
62
+ "vue": "^3.5.26",
63
+ "@wangeditor/editor": "^5.1.23",
64
+ "diagram-js": "^15.6.0",
65
+ "diagram-js-direct-editing": "^3.3.0",
66
+ "min-dom": "^5.2.0",
67
+ "inherits": "2.0.4",
68
+ "tiny-svg": "^4.1.4",
69
+ "min-dash": "^5.0.0"
70
+ },
71
+ "devDependencies": {
72
+ "@types/codemirror": "^5.60.17",
73
+ "@types/crypto-js": "^4.2.2",
74
+ "@types/lodash-es": "^4.17.12",
75
+ "@types/node": "^25.0.10",
76
+ "@types/sortablejs": "^1.15.9",
77
+ "@typescript-eslint/eslint-plugin": "^8.51.0",
78
+ "@typescript-eslint/parser": "^8.51.0",
79
+ "@vitejs/plugin-vue": "^6.0.3",
80
+ "@vitest/ui": "^4.0.18",
81
+ "@vue/test-utils": "^2.4.6",
82
+ "element-plus": "^2.13.0",
83
+ "eslint": "^9.39.2",
84
+ "eslint-config-prettier": "^10.1.8",
85
+ "eslint-plugin-vue": "^10.7.0",
86
+ "happy-dom": "^20.0.11",
87
+ "less": "^4.5.1",
88
+ "prettier": "^3.7.4",
89
+ "rollup-plugin-visualizer": "^6.0.5",
90
+ "shiki": "^3.20.0",
91
+ "terser": "^5.44.1",
92
+ "tsx": "^4.21.0",
93
+ "typescript": "^5.9.3",
94
+ "vite": "^7.3.0",
95
+ "vite-plugin-dts": "^4.5.4",
96
+ "vitepress": "^1.6.4",
97
+ "vitest": "^4.0.18",
98
+ "vue": "^3.5.26",
99
+ "vue-docgen-api": "^4.79.2",
100
+ "vue-tsc": "^3.2.3"
101
+ }
102
+ }