@firerian/fireui 1.0.1 → 1.0.3
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/dist/fireui.cjs +1 -1
- package/dist/fireui.cjs.map +1 -1
- package/dist/fireui.css +7 -1
- package/dist/fireui.es.mjs +14155 -74
- package/dist/fireui.es.mjs.map +1 -1
- package/dist/fireui.umd.js +1 -1
- package/dist/fireui.umd.js.map +1 -1
- package/dist/types/index.d.ts +57 -4
- package/package.json +4 -2
- package/src/components/index.ts +5 -1
- package/src/components/input/index.ts +3 -3
- package/src/components/input/input.test.ts +12 -12
- package/src/components/input/input.vue +34 -31
- package/src/components/rich-text/index.ts +8 -0
- package/src/components/rich-text/rich-text.vue +210 -0
- package/src/components/rich-text/types.ts +52 -0
- package/src/index.ts +21 -3
- package/src/styles/components.scss +230 -0
- package/src/styles/variables.scss +5 -1
- package/src/utils/install.ts +5 -2
package/src/index.ts
CHANGED
|
@@ -17,10 +17,28 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import type { App, Plugin, Component } from 'vue'
|
|
20
|
-
import { FButton, FireRow, FireCol, FireContainer, FireHeader, FireAside, FireMain, FireFooter, FireTooltip, FireTips,
|
|
20
|
+
import { FButton, FireRow, FireCol, FireContainer, FireHeader, FireAside, FireMain, FireFooter, FireTooltip, FireTips, FInput, FireForm, FireFormItem, FireTable, FireTableColumn, FireRichText } from './components'
|
|
21
|
+
|
|
22
|
+
// 导入组件样式
|
|
23
|
+
import './components/button/button.vue'
|
|
24
|
+
import './components/input/input.vue'
|
|
25
|
+
import './components/rich-text/rich-text.vue'
|
|
26
|
+
import './components/grid/row.vue'
|
|
27
|
+
import './components/grid/col.vue'
|
|
28
|
+
import './components/layout/container.vue'
|
|
29
|
+
import './components/layout/header.vue'
|
|
30
|
+
import './components/layout/aside.vue'
|
|
31
|
+
import './components/layout/main.vue'
|
|
32
|
+
import './components/layout/footer.vue'
|
|
33
|
+
import './components/tooltip/tooltip.vue'
|
|
34
|
+
import './components/tips/tips.vue'
|
|
35
|
+
import './components/form/form.vue'
|
|
36
|
+
import './components/form/form-item.vue'
|
|
37
|
+
import './components/table/table.vue'
|
|
38
|
+
import './components/table/table-column.vue'
|
|
21
39
|
|
|
22
40
|
// 所有组件列表
|
|
23
|
-
const components = [FButton, FireRow, FireCol, FireContainer, FireHeader, FireAside, FireMain, FireFooter, FireTooltip, FireTips,
|
|
41
|
+
const components = [FButton, FireRow, FireCol, FireContainer, FireHeader, FireAside, FireMain, FireFooter, FireTooltip, FireTips, FInput, FireForm, FireFormItem, FireTable, FireTableColumn, FireRichText]
|
|
24
42
|
|
|
25
43
|
/**
|
|
26
44
|
* 安装函数 - 自动注册所有组件
|
|
@@ -35,7 +53,7 @@ const install = (app: App): void => {
|
|
|
35
53
|
}
|
|
36
54
|
|
|
37
55
|
// 导出所有组件
|
|
38
|
-
export { FButton, FireRow, FireCol, FireContainer, FireHeader, FireAside, FireMain, FireFooter, FireTooltip, FireTips,
|
|
56
|
+
export { FButton, FireRow, FireCol, FireContainer, FireHeader, FireAside, FireMain, FireFooter, FireTooltip, FireTips, FInput, FireForm, FireFormItem, FireTable, FireTableColumn, FireRichText }
|
|
39
57
|
|
|
40
58
|
// 导出组件库插件
|
|
41
59
|
export default {
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/* Input 组件样式 */
|
|
2
|
+
.fire-input {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
width: 100%;
|
|
7
|
+
border: 1px solid #d9d9d9;
|
|
8
|
+
border-radius: 4px;
|
|
9
|
+
transition: all 0.2s ease;
|
|
10
|
+
background-color: #fff;
|
|
11
|
+
|
|
12
|
+
&:hover {
|
|
13
|
+
border-color: #3b82f6;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&:focus-within {
|
|
17
|
+
border-color: #3b82f6;
|
|
18
|
+
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&--disabled {
|
|
22
|
+
background-color: #f5f5f5;
|
|
23
|
+
border-color: #d9d9d9;
|
|
24
|
+
cursor: not-allowed;
|
|
25
|
+
|
|
26
|
+
.fire-input__inner {
|
|
27
|
+
background-color: #f5f5f5;
|
|
28
|
+
cursor: not-allowed;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&--prefix {
|
|
33
|
+
.fire-input__inner {
|
|
34
|
+
padding-left: 8px;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&--suffix {
|
|
39
|
+
.fire-input__inner {
|
|
40
|
+
padding-right: 8px;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&--large {
|
|
45
|
+
height: 40px;
|
|
46
|
+
|
|
47
|
+
.fire-input__inner {
|
|
48
|
+
height: 40px;
|
|
49
|
+
font-size: 14px;
|
|
50
|
+
padding: 0 12px;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&--medium {
|
|
55
|
+
height: 32px;
|
|
56
|
+
|
|
57
|
+
.fire-input__inner {
|
|
58
|
+
height: 32px;
|
|
59
|
+
font-size: 14px;
|
|
60
|
+
padding: 0 12px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&--small {
|
|
65
|
+
height: 24px;
|
|
66
|
+
|
|
67
|
+
.fire-input__inner {
|
|
68
|
+
height: 24px;
|
|
69
|
+
font-size: 12px;
|
|
70
|
+
padding: 0 8px;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&__inner {
|
|
75
|
+
flex: 1;
|
|
76
|
+
border: none;
|
|
77
|
+
outline: none;
|
|
78
|
+
background: transparent;
|
|
79
|
+
font-size: 14px;
|
|
80
|
+
color: #333333;
|
|
81
|
+
transition: all 0.2s ease;
|
|
82
|
+
|
|
83
|
+
&::placeholder {
|
|
84
|
+
color: #666666;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&__prefix {
|
|
89
|
+
padding: 0 8px;
|
|
90
|
+
color: #666666;
|
|
91
|
+
font-size: 14px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&__suffix {
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
padding: 0 8px;
|
|
98
|
+
color: #666666;
|
|
99
|
+
font-size: 14px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&__word-limit {
|
|
103
|
+
font-size: 12px;
|
|
104
|
+
color: #666666;
|
|
105
|
+
margin-right: 8px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&__password-toggle {
|
|
109
|
+
margin-right: 4px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&__password-icon {
|
|
113
|
+
background: transparent;
|
|
114
|
+
border: none;
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
padding: 0;
|
|
117
|
+
color: #666666;
|
|
118
|
+
transition: color 0.2s ease;
|
|
119
|
+
|
|
120
|
+
&:hover {
|
|
121
|
+
color: #3b82f6;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* RichText 组件样式 */
|
|
127
|
+
.fire-rich-text {
|
|
128
|
+
border: 1px solid #d9d9d9;
|
|
129
|
+
border-radius: 4px;
|
|
130
|
+
transition: all 0.2s ease;
|
|
131
|
+
|
|
132
|
+
&:hover {
|
|
133
|
+
border-color: #3b82f6;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&--disabled {
|
|
137
|
+
background-color: #f5f5f5;
|
|
138
|
+
border-color: #d9d9d9;
|
|
139
|
+
cursor: not-allowed;
|
|
140
|
+
|
|
141
|
+
.ql-container {
|
|
142
|
+
background-color: #f5f5f5;
|
|
143
|
+
cursor: not-allowed;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.ql-container {
|
|
148
|
+
font-size: 14px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.ql-editor {
|
|
152
|
+
min-height: calc(100% - 42px);
|
|
153
|
+
line-height: 1.5;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.ql-toolbar.ql-snow {
|
|
157
|
+
border-bottom: 1px solid #d9d9d9;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.ql-snow .ql-picker-label {
|
|
161
|
+
color: #333333;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.ql-snow .ql-picker-options {
|
|
165
|
+
color: #333333;
|
|
166
|
+
background-color: #fff;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.ql-snow .ql-picker-item:hover {
|
|
170
|
+
background-color: rgba(59, 130, 246, 0.1);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.ql-snow .ql-picker-item.ql-selected {
|
|
174
|
+
color: #3b82f6;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.ql-snow .ql-button:hover {
|
|
178
|
+
color: #3b82f6;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.ql-snow .ql-active {
|
|
182
|
+
color: #3b82f6;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.ql-snow .ql-tooltip {
|
|
186
|
+
background-color: #fff;
|
|
187
|
+
border: 1px solid #d9d9d9;
|
|
188
|
+
border-radius: 4px;
|
|
189
|
+
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.ql-snow .ql-tooltip input[type=text] {
|
|
193
|
+
border: 1px solid #d9d9d9;
|
|
194
|
+
border-radius: 4px;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.ql-snow .ql-tooltip input[type=text]:focus {
|
|
198
|
+
border-color: #3b82f6;
|
|
199
|
+
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.ql-snow .ql-tooltip button {
|
|
203
|
+
background-color: #3b82f6;
|
|
204
|
+
color: #fff;
|
|
205
|
+
border: none;
|
|
206
|
+
border-radius: 4px;
|
|
207
|
+
padding: 4px 8px;
|
|
208
|
+
cursor: pointer;
|
|
209
|
+
|
|
210
|
+
&:hover {
|
|
211
|
+
background-color: #1d4ed8;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.ql-snow .ql-tooltip button.ql-action {
|
|
216
|
+
background-color: #22c55e;
|
|
217
|
+
|
|
218
|
+
&:hover {
|
|
219
|
+
background-color: #16a34a;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.ql-snow .ql-tooltip button.ql-remove {
|
|
224
|
+
background-color: #ef4444;
|
|
225
|
+
|
|
226
|
+
&:hover {
|
|
227
|
+
background-color: #dc2626;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
@@ -4,9 +4,13 @@ $namespace: fire;
|
|
|
4
4
|
// 颜色变量
|
|
5
5
|
$primary-color: #3b82f6;
|
|
6
6
|
$primary-color-hover: #2563eb;
|
|
7
|
+
$primary-color-light: rgba(59, 130, 246, 0.1);
|
|
8
|
+
$primary-color-dark: #1d4ed8;
|
|
7
9
|
$success-color: #22c55e;
|
|
8
|
-
$
|
|
10
|
+
$success-color-dark: #16a34a;
|
|
9
11
|
$danger-color: #ef4444;
|
|
12
|
+
$danger-color-dark: #dc2626;
|
|
13
|
+
$warning-color: #f59e0b;
|
|
10
14
|
$info-color: #6b7280;
|
|
11
15
|
|
|
12
16
|
// 字体
|
package/src/utils/install.ts
CHANGED
|
@@ -3,14 +3,17 @@ import type { App, Component } from 'vue'
|
|
|
3
3
|
export function withInstall<T>(component: T & { name?: string }) {
|
|
4
4
|
const comp = component as any
|
|
5
5
|
comp.install = (app: App) => {
|
|
6
|
-
|
|
6
|
+
// 优先使用组件的 name 属性,然后是 __name,最后使用组件的文件名
|
|
7
|
+
const componentName = comp.name || comp.__name || (typeof comp === 'object' ? 'UnnamedComponent' : 'Unknown')
|
|
8
|
+
app.component(componentName, component)
|
|
7
9
|
}
|
|
8
10
|
return component as T & { install: (app: App) => void }
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
export function registerComponent(app: App, component: Component) {
|
|
12
14
|
const comp = component as any
|
|
13
|
-
|
|
15
|
+
const componentName = comp.name || comp.__name || (typeof comp === 'object' ? 'UnnamedComponent' : 'Unknown')
|
|
16
|
+
app.component(componentName, component)
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
export function registerComponents(app: App, components: Component[]) {
|