@gindow/element-go 1.0.5 → 1.0.6

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.
package/package.json CHANGED
@@ -1,24 +1,31 @@
1
1
  {
2
2
  "name": "@gindow/element-go",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "基于 Element Plus 的桌面端扩展组件库",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
- "main": "./dist/element-go.cjs",
7
+ "main": "./dist/@gindow/element-go.cjs",
8
8
  "types": "./dist/src/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
+ "@source": "./src/index.ts",
11
12
  "types": "./dist/src/index.d.ts",
12
- "import": "./dist/element-go.mjs",
13
- "require": "./dist/element-go.cjs"
13
+ "import": "./dist/@gindow/element-go.mjs",
14
+ "require": "./dist/@gindow/element-go.cjs"
14
15
  },
15
16
  "./resolver": {
17
+ "@source": "./src/resolver.ts",
16
18
  "types": "./dist/src/resolver.d.ts",
17
19
  "import": "./dist/resolver.mjs",
18
20
  "require": "./dist/resolver.cjs"
19
21
  },
20
- "./styles/index.css": "./dist/styles/index.css",
22
+ "./styles/index.css": {
23
+ "@source": "./src/styles/index.css",
24
+ "import": "./dist/styles/index.css",
25
+ "require": "./dist/styles/index.css"
26
+ },
21
27
  "./styles/arco.css": "./src/styles/arco.css",
28
+ "./styles/purple.css": "./src/styles/purple.css",
22
29
  "./src/*": "./src/*",
23
30
  "./package.json": "./package.json"
24
31
  },
@@ -34,8 +41,8 @@
34
41
  "build": "vue-tsc --noEmit && vite build"
35
42
  },
36
43
  "peerDependencies": {
37
- "@iconify/vue": "^5.0.0",
38
44
  "@gindow/vue": "^1.0.3",
45
+ "@iconify/vue": "^5.0.0",
39
46
  "@vueuse/core": "^12.0.0",
40
47
  "axios": "^1.6.0",
41
48
  "compressorjs": "^1.2.0",
@@ -98,7 +105,7 @@
98
105
  },
99
106
  "devDependencies": {
100
107
  "@iconify/vue": "^5.0.1",
101
- "@tailwindcss/vite": "^4.3.1",
108
+ "@tailwindcss/vite": "^4.3.2",
102
109
  "@types/js-cookie": "^3.0.6",
103
110
  "@types/lodash": "^4.17.24",
104
111
  "@types/node": "^22.20.0",
@@ -115,16 +122,16 @@
115
122
  "heic2any": "^0.0.4",
116
123
  "js-cookie": "^3.0.8",
117
124
  "lodash": "^4.18.1",
118
- "nanoid": "^5.1.15",
125
+ "nanoid": "^5.1.16",
119
126
  "rxjs": "^7.8.2",
120
127
  "sortablejs": "^1.15.7",
121
- "tailwindcss": "^4.3.1",
128
+ "tailwindcss": "^4.3.2",
122
129
  "typescript": "^6.0.3",
123
130
  "unplugin-auto-import": "^21.0.0",
124
131
  "unplugin-vue-components": "^32.1.0",
125
- "vite": "^8.1.0",
132
+ "vite": "^8.1.1",
126
133
  "vite-plugin-dts": "^4.5.4",
127
- "vue": "^3.5.38",
134
+ "vue": "^3.5.39",
128
135
  "vue-i18n": "^11.4.6",
129
136
  "vue-request": "^2.0.4",
130
137
  "vue-router": "^4.6.4",
@@ -61,7 +61,7 @@ const { fields: fieldsData, formColumns, labelPosition, destroyOnClose, ...props
61
61
 
62
62
  const emit = defineEmits(['submit', 'reset', 'cancel'])
63
63
 
64
- const model = defineModel({ type: Object as PropType<IModel>, default: () => ({}) })
64
+ const model = defineModel<IModel>({ default: () => ({}) })
65
65
  const show = defineModel('show', { type: Boolean, default: false })
66
66
 
67
67
  const { t } = useLocale()
@@ -31,7 +31,7 @@ const props = defineProps({
31
31
  field: { type: Object as PropType<IField>, required: true },
32
32
  })
33
33
 
34
- const model = defineModel({ type: Object as PropType<any> })
34
+ const model = defineModel<any>({ type: Object as PropType<any> })
35
35
 
36
36
  const emit = defineEmits(['change'])
37
37
 
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <el-aside class="main min-h-screen" :style="{ width: collapse ? 'auto' : `${width}px`}">
2
+ <el-aside class="main min-h-screen" :style="collapse ? { width: 'auto' } : width != null ? { width: `${width}px` } : {}">
3
3
  <ex-menu :menu="topMenu" :menu-width="width" :active :unique-opened :collapse>
4
4
  <div class="logo gap-2 flex-center">
5
5
  <el-image :src="logo ?? icon" class="size-6" />
@@ -5,6 +5,7 @@
5
5
  <template v-else>
6
6
  <!-- 数据表格 -->
7
7
  <el-table ref="refTable" class="ex-table" v-bind="$attrs" v-loading="loading" :data :size="density" row-key="id">
8
+ <slot />
8
9
  <ex-table-column v-if="sorting" type="sort" /><!-- 排序字段 -->
9
10
  <ex-table-column v-for="col in columns" v-bind="col">
10
11
  <template v-if="col.customRender" #default="{ row }">
@@ -14,7 +15,6 @@
14
15
  <slot name="cell" :row :col>{{ col.value && typeof col.value === 'function' ? col.value(row, col) : col.value ?? get(row, col.prop) ?? col.defaultValue }}</slot>
15
16
  </template>
16
17
  </ex-table-column>
17
- <slot />
18
18
  </el-table>
19
19
  <!-- 批量操作 -->
20
20
  <el-space class="mt-5">
@@ -52,6 +52,14 @@ import get from 'lodash/get'
52
52
 
53
53
  defineOptions({ inheritAttrs: false })
54
54
 
55
+ defineSlots<{
56
+ default(): any
57
+ batch(): any
58
+ cell(props: { row: IModel; col: IModel }): any
59
+ formItem(): any
60
+ formField(props: { field: any; model: IModel }): any
61
+ }>()
62
+
55
63
  const {
56
64
  columns: columnData, actions: actionData, model: modelData, actionShow, formColumns, formWidth,
57
65
  onSelect, onDelete, onUpdate, onInsert
@@ -83,9 +91,9 @@ const loaded = defineModel('loaded', { type: Boolean, default: false })
83
91
  const loading = defineModel('loading', { type: Boolean, default: false })
84
92
  const page = defineModel('page', { type: Number, default: 1 })
85
93
  const size = defineModel('size', { type: Number, default: 15 })
86
- const data = defineModel('data', { type: Array as PropType<IModel[]>, default: () => [] })
94
+ const data = defineModel<IModel[]>('data', { default: () => [] })
87
95
  const total = defineModel('total', { type: Number, default: 0 })
88
- const params = defineModel('params', { type: Object as PropType<any>, default: () => ({ filter: {}, search: '' }) })
96
+ const params = defineModel<any>('params', { default: () => ({ filter: {}, search: '' }) })
89
97
 
90
98
  const { t } = useLocale()
91
99
  const { confirm, success, error } = useMessage()
@@ -31,7 +31,7 @@ import { useUpload } from '../hooks/useUpload'
31
31
  import ExIcon from './ExIcon.vue'
32
32
 
33
33
  const emit = defineEmits(['change'])
34
- const files = defineModel('fileList', { type: Array as PropType<IUploadUserFile[]>, default: () => ([]) })
34
+ const files = defineModel<IUploadUserFile[]>('fileList', { default: () => ([]) })
35
35
  const { limit, disabled, multiple, showFileList, showProgress, compressor } = defineProps({
36
36
  limit: { type: Number, default: 500 },
37
37
  disabled: { type: Boolean, default: false },
package/src/index.ts CHANGED
@@ -20,7 +20,7 @@ import ExTable from './components/ExTable.vue'
20
20
  import ExTableColumn from './components/ExTableColumn.vue'
21
21
  import ExUpload from './components/ExUpload.vue'
22
22
  import ExUploadAsset from './components/ExUploadAsset.vue'
23
- import './styles/index.css'
23
+ // import './styles/index.css'
24
24
 
25
25
  export * from './types'
26
26
  export { useMessage } from './hooks/useMessage'
@@ -57,7 +57,6 @@ declare global {
57
57
  const unref: typeof import('vue').unref
58
58
  const useAttrs: typeof import('vue').useAttrs
59
59
  const useBreak: typeof import('../hooks/useBreak').useBreak
60
- const useChat: typeof import('../hooks/useChat').useChat
61
60
  const useClipboard: typeof import('@vueuse/core').useClipboard
62
61
  const useCssModule: typeof import('vue').useCssModule
63
62
  const useCssVars: typeof import('vue').useCssVars
@@ -88,7 +87,4 @@ declare global {
88
87
  // @ts-ignore
89
88
  export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, ShallowRef, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
90
89
  import('vue')
91
- // @ts-ignore
92
- export type { IChatMessage, IMessageEvent, IUsageEvent, IErrorEvent, ISendMessageParams } from '../hooks/useChat'
93
- import('../hooks/useChat')
94
90
  }
package/src/resolver.ts CHANGED
@@ -8,18 +8,14 @@ export interface ElementGoResolverOptions {
8
8
  importStyle?: boolean
9
9
  /** 自定义前缀,默认 'Ex' */
10
10
  prefix?: string
11
- /** 需要排除的组件名列表(不包含前缀),例如 ['SelectDictionary'] */
12
- exclude?: string[]
13
11
  }
14
12
 
15
13
  export function ElementGoResolver(options: ElementGoResolverOptions = {}) {
16
- const { importStyle = true, prefix = 'Ex', exclude = [] } = options
14
+ const { importStyle = true, prefix = 'Ex' } = options
17
15
  return {
18
16
  type: 'component' as const,
19
17
  resolve(name: string) {
20
18
  if (!name.startsWith(prefix)) return
21
- const componentName = name.slice(prefix.length)
22
- if (exclude.includes(componentName)) return
23
19
  return {
24
20
  name,
25
21
  from: '@gindow/element-go',
@@ -2,7 +2,7 @@
2
2
  * Arco Design 风格主题 —— 把 Arco 设计令牌映射成 Element Plus 支持的 CSS 变量(--el-*)。
3
3
  *
4
4
  * 用法:在应用入口、element-go 基础样式之后引入即可:
5
- * import 'element-go/styles/arco.css'
5
+ * import '@gindow/element-go/styles/arco.css'
6
6
  *
7
7
  * 说明:
8
8
  * - 选择器用 `html:root` / `html.dark:root` 提升优先级,确保覆盖 element-plus 与
@@ -5,6 +5,8 @@
5
5
 
6
6
  @source "../";
7
7
 
8
+ body { background-color: var(--el-bg-color); }
9
+
8
10
  /* @layer theme, base, components, utilities; */
9
11
 
10
12
  /* @import "tailwindcss/theme.css" layer(theme); */
@@ -0,0 +1,204 @@
1
+ /**
2
+ * Purple 风格主题 —— 世界级 SaaS 紫色配色,映射成 Element Plus 的 CSS 变量(--el-*)。
3
+ *
4
+ * 用法:在应用入口、element-go 基础样式之后引入即可:
5
+ * import '@gindow/element-go/styles/purple.css'
6
+ *
7
+ * 设计来源(世界主流 SaaS 紫色体系):
8
+ * - 主色取 Tailwind violet-600 #7c3aed —— Linear / Stripe / Untitled UI 一脉的高级感紫,
9
+ * 白底对比度 ~5:1(达 WCAG AA),是被广泛采用的「premium SaaS purple」。
10
+ * - 语义色用 Tailwind 调色板的 green/amber/red/slate,与紫主色和谐且久经验证。
11
+ * - 中性色不用纯灰,而是带极轻微紫调的 lavender-gray,让整体「成主题」而非「紫点缀灰」。
12
+ * - 暗色用带紫调的近黑(参考 Linear 暗色面板),而非死灰;语义 light-* 用 color-mix
13
+ * 按 Element Plus 混色规则向暗背景(#0d0b14)派生。
14
+ *
15
+ * 说明:选择器用 `html:root` / `html.dark:root` 提升优先级,确保覆盖 element-plus 与
16
+ * element-go 基础变量,且不依赖 import 顺序。
17
+ */
18
+
19
+ /* ============ 亮色 ============ */
20
+ html:root {
21
+ /* 主色 violet(Tailwind violet 50~700 映射 Element 的 light-9~dark-2) */
22
+ --el-color-primary: #7c3aed;
23
+ --el-color-primary-light-3: #a78bfa;
24
+ --el-color-primary-light-5: #c4b5fd;
25
+ --el-color-primary-light-7: #ddd6fe;
26
+ --el-color-primary-light-8: #ede9fe;
27
+ --el-color-primary-light-9: #f5f3ff;
28
+ --el-color-primary-dark-2: #6d28d9;
29
+
30
+ /* 成功 green */
31
+ --el-color-success: #16a34a;
32
+ --el-color-success-light-3: #4ade80;
33
+ --el-color-success-light-5: #86efac;
34
+ --el-color-success-light-7: #bbf7d0;
35
+ --el-color-success-light-8: #dcfce7;
36
+ --el-color-success-light-9: #f0fdf4;
37
+ --el-color-success-dark-2: #15803d;
38
+
39
+ /* 警告 amber */
40
+ --el-color-warning: #f59e0b;
41
+ --el-color-warning-light-3: #fbbf24;
42
+ --el-color-warning-light-5: #fcd34d;
43
+ --el-color-warning-light-7: #fde68a;
44
+ --el-color-warning-light-8: #fef3c7;
45
+ --el-color-warning-light-9: #fffbeb;
46
+ --el-color-warning-dark-2: #d97706;
47
+
48
+ /* 危险 / 错误 red(Element Plus 同时用 danger 与 error 两套变量) */
49
+ --el-color-danger: #ef4444;
50
+ --el-color-danger-light-3: #f87171;
51
+ --el-color-danger-light-5: #fca5a5;
52
+ --el-color-danger-light-7: #fecaca;
53
+ --el-color-danger-light-8: #fee2e2;
54
+ --el-color-danger-light-9: #fef2f2;
55
+ --el-color-danger-dark-2: #dc2626;
56
+ --el-color-error: #ef4444;
57
+ --el-color-error-light-3: #f87171;
58
+ --el-color-error-light-5: #fca5a5;
59
+ --el-color-error-light-7: #fecaca;
60
+ --el-color-error-light-8: #fee2e2;
61
+ --el-color-error-light-9: #fef2f2;
62
+ --el-color-error-dark-2: #dc2626;
63
+
64
+ /* 信息 slate */
65
+ --el-color-info: #64748b;
66
+ --el-color-info-light-3: #94a3b8;
67
+ --el-color-info-light-5: #cbd5e1;
68
+ --el-color-info-light-7: #e2e8f0;
69
+ --el-color-info-light-8: #f1f5f9;
70
+ --el-color-info-light-9: #f8fafc;
71
+ --el-color-info-dark-2: #475569;
72
+
73
+ /* 文本 text(带极轻微紫调的 lavender-gray) */
74
+ --el-text-color-primary: #1d192b;
75
+ --el-text-color-regular: #474357;
76
+ --el-text-color-secondary: #6b6780;
77
+ --el-text-color-placeholder: #9d99ad;
78
+ --el-text-color-disabled: #c7c4d4;
79
+
80
+ /* 边框 */
81
+ --el-border-color-darker: #c7c4d4;
82
+ --el-border-color-dark: #d8d5e3;
83
+ --el-border-color: #e7e5f0;
84
+ --el-border-color-light: #eeecf5;
85
+ --el-border-color-lighter: #f3f1f9;
86
+ --el-border-color-extra-light: #faf9fd;
87
+
88
+ /* 填充 fill 1~4 */
89
+ --el-fill-color-darker: #d8d5e3;
90
+ --el-fill-color-dark: #e7e5f0;
91
+ --el-fill-color: #f3f1f9;
92
+ --el-fill-color-light: #f7f6fb;
93
+ --el-fill-color-lighter: #faf9fd;
94
+ --el-fill-color-blank: #ffffff;
95
+
96
+ /* 背景 */
97
+ --el-bg-color: #ffffff;
98
+ --el-bg-color-page: #faf9fd;
99
+ --el-bg-color-overlay: #ffffff;
100
+
101
+ /* 圆角(SaaS 偏大圆角,更现代) */
102
+ /* --el-border-radius-base: 8px; */
103
+ /* --el-border-radius-small: 6px; */
104
+ /* --el-border-radius-round: 9999px; */
105
+
106
+ /* 阴影(柔和、带深紫调的层叠投影) */
107
+ --el-box-shadow-lighter: 0 1px 2px rgba(29, 25, 43, 0.06);
108
+ --el-box-shadow-light: 0 2px 8px rgba(29, 25, 43, 0.06);
109
+ --el-box-shadow: 0 6px 24px -4px rgba(29, 25, 43, 0.1), 0 2px 6px -2px rgba(29, 25, 43, 0.06);
110
+ --el-box-shadow-dark: 0 12px 40px -8px rgba(29, 25, 43, 0.16);
111
+
112
+ /* 字体(优先 Inter,世界级 SaaS 通用字体栈) */
113
+ --el-font-family: 'Inter', -apple-system, blinkmacsystemfont, 'PingFang SC', 'Helvetica Neue', helvetica, 'Microsoft YaHei', arial, sans-serif;
114
+ }
115
+
116
+ /* ============ 暗色(带紫调近黑面板,html.dark 时生效) ============ */
117
+ html.dark {
118
+ /* 背景(violet-tinted near-black) */
119
+ --el-bg-color: #15121e;
120
+ --el-bg-color-page: #0d0b14;
121
+ --el-bg-color-overlay: #1c1828;
122
+
123
+ /* 文本(白色不同透明度,保证层级) */
124
+ --el-text-color-primary: rgba(255, 255, 255, 0.92);
125
+ --el-text-color-regular: rgba(255, 255, 255, 0.72);
126
+ --el-text-color-secondary: rgba(255, 255, 255, 0.5);
127
+ --el-text-color-placeholder: rgba(255, 255, 255, 0.36);
128
+ --el-text-color-disabled: rgba(255, 255, 255, 0.28);
129
+
130
+ /* 边框(紫调深灰) */
131
+ --el-border-color-darker: #554f68;
132
+ --el-border-color-dark: #423d54;
133
+ --el-border-color: #332e42;
134
+ --el-border-color-light: #292435;
135
+ --el-border-color-lighter: #201c2c;
136
+ --el-border-color-extra-light: #15121e;
137
+
138
+ /* 填充 */
139
+ --el-fill-color-darker: #423d54;
140
+ --el-fill-color-dark: #2e2a3e;
141
+ --el-fill-color: #232030;
142
+ --el-fill-color-light: #1c1828;
143
+ --el-fill-color-lighter: #15121e;
144
+ --el-fill-color-blank: transparent;
145
+
146
+ /* 语义色:暗色下基色提亮一档,light-* 用 color-mix 向暗背景(#0d0b14)混合派生 */
147
+ --el-color-primary: #8b5cf6;
148
+ --el-color-primary-light-3: color-mix(in srgb, #8b5cf6 70%, #0d0b14);
149
+ --el-color-primary-light-5: color-mix(in srgb, #8b5cf6 50%, #0d0b14);
150
+ --el-color-primary-light-7: color-mix(in srgb, #8b5cf6 30%, #0d0b14);
151
+ --el-color-primary-light-8: color-mix(in srgb, #8b5cf6 20%, #0d0b14);
152
+ --el-color-primary-light-9: color-mix(in srgb, #8b5cf6 10%, #0d0b14);
153
+ --el-color-primary-dark-2: color-mix(in srgb, #8b5cf6 80%, #fff);
154
+
155
+ --el-color-success: #22c55e;
156
+ --el-color-success-light-3: color-mix(in srgb, #22c55e 70%, #0d0b14);
157
+ --el-color-success-light-5: color-mix(in srgb, #22c55e 50%, #0d0b14);
158
+ --el-color-success-light-7: color-mix(in srgb, #22c55e 30%, #0d0b14);
159
+ --el-color-success-light-8: color-mix(in srgb, #22c55e 20%, #0d0b14);
160
+ --el-color-success-light-9: color-mix(in srgb, #22c55e 10%, #0d0b14);
161
+ --el-color-success-dark-2: color-mix(in srgb, #22c55e 80%, #fff);
162
+
163
+ --el-color-warning: #fbbf24;
164
+ --el-color-warning-light-3: color-mix(in srgb, #fbbf24 70%, #0d0b14);
165
+ --el-color-warning-light-5: color-mix(in srgb, #fbbf24 50%, #0d0b14);
166
+ --el-color-warning-light-7: color-mix(in srgb, #fbbf24 30%, #0d0b14);
167
+ --el-color-warning-light-8: color-mix(in srgb, #fbbf24 20%, #0d0b14);
168
+ --el-color-warning-light-9: color-mix(in srgb, #fbbf24 10%, #0d0b14);
169
+ --el-color-warning-dark-2: color-mix(in srgb, #fbbf24 80%, #fff);
170
+
171
+ --el-color-danger: #f87171;
172
+ --el-color-danger-light-3: color-mix(in srgb, #f87171 70%, #0d0b14);
173
+ --el-color-danger-light-5: color-mix(in srgb, #f87171 50%, #0d0b14);
174
+ --el-color-danger-light-7: color-mix(in srgb, #f87171 30%, #0d0b14);
175
+ --el-color-danger-light-8: color-mix(in srgb, #f87171 20%, #0d0b14);
176
+ --el-color-danger-light-9: color-mix(in srgb, #f87171 10%, #0d0b14);
177
+ --el-color-danger-dark-2: color-mix(in srgb, #f87171 80%, #fff);
178
+ --el-color-error: #f87171;
179
+ --el-color-error-light-3: color-mix(in srgb, #f87171 70%, #0d0b14);
180
+ --el-color-error-light-5: color-mix(in srgb, #f87171 50%, #0d0b14);
181
+ --el-color-error-light-7: color-mix(in srgb, #f87171 30%, #0d0b14);
182
+ --el-color-error-light-8: color-mix(in srgb, #f87171 20%, #0d0b14);
183
+ --el-color-error-light-9: color-mix(in srgb, #f87171 10%, #0d0b14);
184
+ --el-color-error-dark-2: color-mix(in srgb, #f87171 80%, #fff);
185
+
186
+ --el-color-info: #94a3b8;
187
+ --el-color-info-light-3: color-mix(in srgb, #94a3b8 70%, #0d0b14);
188
+ --el-color-info-light-5: color-mix(in srgb, #94a3b8 50%, #0d0b14);
189
+ --el-color-info-light-7: color-mix(in srgb, #94a3b8 30%, #0d0b14);
190
+ --el-color-info-light-8: color-mix(in srgb, #94a3b8 20%, #0d0b14);
191
+ --el-color-info-light-9: color-mix(in srgb, #94a3b8 10%, #0d0b14);
192
+ --el-color-info-dark-2: color-mix(in srgb, #94a3b8 80%, #fff);
193
+
194
+ /* 阴影(暗色下更深,营造层次) */
195
+ --el-box-shadow-lighter: 0 1px 2px rgba(0, 0, 0, 0.4);
196
+ --el-box-shadow-light: 0 2px 8px rgba(0, 0, 0, 0.4);
197
+ --el-box-shadow: 0 8px 28px -6px rgba(0, 0, 0, 0.55);
198
+ --el-box-shadow-dark: 0 16px 48px -8px rgba(0, 0, 0, 0.65);
199
+ }
200
+
201
+ .el-button.is-text { --el-button-text-color: #fff; }
202
+ .el-button--primary { background: linear-gradient(135deg, #7c3aed, #a855f7); border: none; }
203
+ .el-button--primary:hover { background: linear-gradient(135deg, #6d28d9, #9333ea); }
204
+ .el-button--primary.is-link:hover { background: none; }