@bagelink/vue 1.4.87 → 1.4.91
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/bin/generateFormSchema.ts +6 -6
- package/dist/components/Btn.vue.d.ts +1 -1
- package/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/dataTable/useTableData.d.ts.map +1 -1
- package/dist/components/form/BagelForm.vue.d.ts.map +1 -1
- package/dist/composables/useExcel.d.ts.map +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +5 -5
- package/dist/style.css +1 -1
- package/dist/types/BagelForm.d.ts +6 -4
- package/dist/types/BagelForm.d.ts.map +1 -1
- package/dist/utils/BagelFormUtils.d.ts.map +1 -1
- package/dist/utils/elementUtils.d.ts +1 -0
- package/dist/utils/elementUtils.d.ts.map +1 -1
- package/dist/utils/schema.d.ts +4 -0
- package/dist/utils/schema.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/Btn.vue +111 -78
- package/src/components/dataTable/useTableData.ts +5 -2
- package/src/components/form/BagelForm.vue +6 -17
- package/src/components/form/BglMultiStepForm.vue +3 -3
- package/src/composables/useExcel.ts +19 -8
- package/src/styles/buttons.css +74 -78
- package/src/styles/pillColors.css +0 -0
- package/src/types/BagelForm.ts +10 -4
- package/src/utils/BagelFormUtils.ts +15 -0
- package/src/utils/elementUtils.ts +2 -0
package/src/styles/buttons.css
CHANGED
|
@@ -1,144 +1,140 @@
|
|
|
1
1
|
.bgl_btn,
|
|
2
2
|
.bgl_flatBtn,
|
|
3
3
|
.bgl_btn-icon {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
font-family: inherit;
|
|
5
|
+
white-space: nowrap;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
user-select: none;
|
|
9
|
+
border: none;
|
|
10
|
+
transition: var(--bgl-transition);
|
|
11
|
+
border-radius: var(--btn-border-radius);
|
|
12
|
+
line-height: var(--btn-height);
|
|
13
|
+
font-size: var(--input-font-size);
|
|
14
|
+
display: inline-block;
|
|
15
|
+
height: var(--btn-height);
|
|
16
|
+
padding: 0;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.btn-close {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
margin-top: -20px;
|
|
21
|
+
margin-inline-end: -20px;
|
|
22
|
+
margin-inline-start: auto;
|
|
23
|
+
margin-bottom: 15px;
|
|
24
|
+
transition: var(--bgl-transition);
|
|
25
|
+
height: 30px;
|
|
26
|
+
width: 30px;
|
|
27
|
+
opacity: 0.6;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
border-radius: 100%;
|
|
30
|
+
outline: 2px solid transparent;
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.btn-close:hover {
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
background: var(--bgl-gray-light);
|
|
38
|
+
opacity: 1;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
.btn-close:active {
|
|
42
|
-
|
|
42
|
+
background: var(--bgl-gray);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.btn-close::before {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
content: 'close';
|
|
47
|
+
font-family: 'Material Symbols Outlined', serif;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
.bgl_btn.thin {
|
|
51
|
-
height: calc(var(--btn-height) * 0.7);
|
|
52
|
-
line-height: calc(var(--btn-height) * 0.7);
|
|
53
|
-
}
|
|
54
50
|
|
|
55
51
|
.hover {
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
transition: all 400ms ease;
|
|
58
54
|
}
|
|
59
55
|
|
|
60
56
|
.hover:hover {
|
|
61
|
-
|
|
57
|
+
filter: brightness(90%);
|
|
62
58
|
}
|
|
63
59
|
|
|
64
60
|
.hover:active {
|
|
65
|
-
|
|
61
|
+
filter: brightness(80%);
|
|
66
62
|
}
|
|
67
63
|
|
|
68
64
|
.border {
|
|
69
|
-
|
|
65
|
+
border: 1px solid var(--border-color);
|
|
70
66
|
}
|
|
71
67
|
|
|
72
68
|
.border-primary {
|
|
73
|
-
|
|
69
|
+
border: 1px solid var(--bgl-primary);
|
|
74
70
|
}
|
|
75
71
|
|
|
76
72
|
.outline {
|
|
77
|
-
|
|
73
|
+
outline: 1px solid var(--border-color);
|
|
78
74
|
}
|
|
79
75
|
|
|
80
76
|
.outline-dashed {
|
|
81
|
-
|
|
77
|
+
outline: 2px dashed var(--border-color);
|
|
82
78
|
}
|
|
83
79
|
|
|
84
80
|
.outline-primary {
|
|
85
|
-
|
|
81
|
+
outline: 1px solid var(--bgl-primary);
|
|
86
82
|
}
|
|
87
83
|
|
|
88
84
|
.rotate-270 {
|
|
89
|
-
|
|
85
|
+
transform: rotate(270deg);
|
|
90
86
|
}
|
|
91
87
|
|
|
92
88
|
.rotate-180 {
|
|
93
|
-
|
|
89
|
+
transform: rotate(180deg);
|
|
94
90
|
}
|
|
95
91
|
|
|
96
92
|
.rotate-90 {
|
|
97
|
-
|
|
93
|
+
transform: rotate(90deg);
|
|
98
94
|
}
|
|
99
95
|
|
|
100
96
|
.rotate-0 {
|
|
101
|
-
|
|
97
|
+
transform: rotate(0deg) !important;
|
|
102
98
|
}
|
|
103
99
|
|
|
104
100
|
@media screen and (max-width: 910px) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
.bgl_btn {
|
|
102
|
+
padding: 0 20px;
|
|
103
|
+
}
|
|
108
104
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
105
|
+
.m_border {
|
|
106
|
+
border: 1px solid var(--border-color);
|
|
107
|
+
}
|
|
112
108
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
.m_rotate-270 {
|
|
110
|
+
transform: rotate(270deg);
|
|
111
|
+
}
|
|
116
112
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
113
|
+
.m_rotate-180 {
|
|
114
|
+
transform: rotate(180deg);
|
|
115
|
+
}
|
|
120
116
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
117
|
+
.m_rotate-90 {
|
|
118
|
+
transform: rotate(90deg);
|
|
119
|
+
}
|
|
124
120
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
.m_rotate-0 {
|
|
122
|
+
transform: rotate(0deg) !important;
|
|
123
|
+
}
|
|
128
124
|
}
|
|
129
125
|
|
|
130
126
|
.ripple {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
127
|
+
position: absolute;
|
|
128
|
+
border-radius: 50%;
|
|
129
|
+
transform: scale(0);
|
|
130
|
+
background: rgba(0, 0, 0, 0.3);
|
|
131
|
+
pointer-events: none;
|
|
132
|
+
animation: rippleEffect 0.6s ease-out;
|
|
137
133
|
}
|
|
138
134
|
|
|
139
135
|
@keyframes rippleEffect {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
136
|
+
to {
|
|
137
|
+
transform: scale(4);
|
|
138
|
+
opacity: 0;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
File without changes
|
package/src/types/BagelForm.ts
CHANGED
|
@@ -84,6 +84,7 @@ export interface ElementField<
|
|
|
84
84
|
style?: Record<string, any>
|
|
85
85
|
attrs?: Record<string, any>
|
|
86
86
|
onClick?: () => void
|
|
87
|
+
transform?: (val?: any, rowData?: T) => any
|
|
87
88
|
children?: ElementField<T, PO>[]
|
|
88
89
|
}
|
|
89
90
|
|
|
@@ -108,8 +109,8 @@ export interface BaseBagelField<
|
|
|
108
109
|
'disabled'?: boolean
|
|
109
110
|
'helptext'?: string
|
|
110
111
|
'options'?: BagelFieldOptions<T, P>
|
|
111
|
-
'children'?: SchemaChild<T,
|
|
112
|
-
'slots'?: { [key: string]: SchemaChild<T,
|
|
112
|
+
'children'?: SchemaChild<T, Path<T, PO>, PO>[]
|
|
113
|
+
'slots'?: { [key: string]: SchemaChild<T, Path<T, PO>, PO>[] }
|
|
113
114
|
'defaultValue'?: any
|
|
114
115
|
'vIf'?: VIfType<T, P>
|
|
115
116
|
'v-if'?: VIfType<T, P>
|
|
@@ -147,15 +148,20 @@ export type BglFieldT<
|
|
|
147
148
|
PO extends PathsOptions = DefaultPathsOptions,
|
|
148
149
|
> = Field<T, PO>
|
|
149
150
|
|
|
151
|
+
export type SchemaField<
|
|
152
|
+
T,
|
|
153
|
+
PO extends PathsOptions = DefaultPathsOptions,
|
|
154
|
+
> = Field<T, PO> | ElementField<T, PO>
|
|
155
|
+
|
|
150
156
|
export type BglFormSchemaT<
|
|
151
157
|
T,
|
|
152
158
|
PO extends PathsOptions = DefaultPathsOptions,
|
|
153
|
-
> =
|
|
159
|
+
> = SchemaField<T, PO>[]
|
|
154
160
|
|
|
155
161
|
export type ShallowBglFormSchemaT<
|
|
156
162
|
T,
|
|
157
163
|
PO extends PathsOptions = ShallowPathsOptions,
|
|
158
|
-
> =
|
|
164
|
+
> = SchemaField<T, PO>[]
|
|
159
165
|
|
|
160
166
|
export interface InputBagelField<
|
|
161
167
|
T,
|
|
@@ -74,6 +74,7 @@ export function richText<
|
|
|
74
74
|
id,
|
|
75
75
|
label,
|
|
76
76
|
vIf: options?.vIf,
|
|
77
|
+
transform: options?.transform,
|
|
77
78
|
placeholder: options?.placeholder,
|
|
78
79
|
attrs: {
|
|
79
80
|
height: options?.height,
|
|
@@ -103,6 +104,8 @@ export function txtField<
|
|
|
103
104
|
defaultValue: options?.defaultValue,
|
|
104
105
|
validate: options?.validate,
|
|
105
106
|
onUpdate: options?.onUpdate,
|
|
107
|
+
helptext: options?.helptext,
|
|
108
|
+
transform: options?.transform,
|
|
106
109
|
attrs: {
|
|
107
110
|
type: options?.type,
|
|
108
111
|
pattern: options?.pattern,
|
|
@@ -137,6 +140,9 @@ export function selectField<
|
|
|
137
140
|
label,
|
|
138
141
|
defaultValue: config?.defaultValue,
|
|
139
142
|
vIf: config?.vIf,
|
|
143
|
+
validate: config?.validate,
|
|
144
|
+
onUpdate: config?.onUpdate,
|
|
145
|
+
transform: config?.transform,
|
|
140
146
|
attrs: {
|
|
141
147
|
disabled: config?.disabled,
|
|
142
148
|
searchable: config?.searchable,
|
|
@@ -169,6 +175,7 @@ export function checkField<
|
|
|
169
175
|
required: options?.required,
|
|
170
176
|
id,
|
|
171
177
|
label,
|
|
178
|
+
transform: options?.transform,
|
|
172
179
|
attrs: {
|
|
173
180
|
value: options?.value,
|
|
174
181
|
},
|
|
@@ -197,6 +204,7 @@ export function emailField<
|
|
|
197
204
|
class: options?.class,
|
|
198
205
|
required: options?.required,
|
|
199
206
|
vIf: options?.vIf,
|
|
207
|
+
transform: options?.transform,
|
|
200
208
|
attrs: {
|
|
201
209
|
autocorrect: options?.autocorrect,
|
|
202
210
|
serverValidate: options?.serverValidate,
|
|
@@ -224,6 +232,7 @@ export function dateField<
|
|
|
224
232
|
label,
|
|
225
233
|
defaultValue: options?.defaultValue,
|
|
226
234
|
vIf: options?.vIf,
|
|
235
|
+
transform: options?.transform,
|
|
227
236
|
attrs: {
|
|
228
237
|
disabled: options?.disabled,
|
|
229
238
|
autocomplete: options?.autocomplete,
|
|
@@ -255,6 +264,7 @@ export function numField<
|
|
|
255
264
|
placeholder: options?.placeholder,
|
|
256
265
|
helptext: options?.helptext,
|
|
257
266
|
vIf: options?.vIf,
|
|
267
|
+
transform: options?.transform,
|
|
258
268
|
attrs: {
|
|
259
269
|
autocomplete: options?.autocomplete,
|
|
260
270
|
step: options?.step,
|
|
@@ -298,6 +308,7 @@ export function uploadField<
|
|
|
298
308
|
id,
|
|
299
309
|
label,
|
|
300
310
|
vIf: options?.vIf,
|
|
311
|
+
transform: options?.transform,
|
|
301
312
|
attrs: {
|
|
302
313
|
...options,
|
|
303
314
|
},
|
|
@@ -327,6 +338,7 @@ export function rangeField<
|
|
|
327
338
|
id,
|
|
328
339
|
label,
|
|
329
340
|
vIf: options?.vIf,
|
|
341
|
+
transform: options?.transform,
|
|
330
342
|
attrs: {
|
|
331
343
|
autocomplete: options?.autocomplete,
|
|
332
344
|
min: options?.min,
|
|
@@ -373,6 +385,7 @@ export function telField<
|
|
|
373
385
|
vIf: options?.vIf,
|
|
374
386
|
attrs: options,
|
|
375
387
|
class: options?.class,
|
|
388
|
+
transform: options?.transform,
|
|
376
389
|
}
|
|
377
390
|
}
|
|
378
391
|
|
|
@@ -392,6 +405,7 @@ export function colorField<
|
|
|
392
405
|
vIf: options?.vIf,
|
|
393
406
|
attrs: options,
|
|
394
407
|
class: options?.class,
|
|
408
|
+
transform: options?.transform,
|
|
395
409
|
}
|
|
396
410
|
}
|
|
397
411
|
|
|
@@ -449,6 +463,7 @@ export function arrField<
|
|
|
449
463
|
class: options?.class,
|
|
450
464
|
$el: 'array',
|
|
451
465
|
vIf: options?.vIf,
|
|
466
|
+
transform: options?.transform,
|
|
452
467
|
attrs,
|
|
453
468
|
}
|
|
454
469
|
}
|
|
@@ -30,6 +30,7 @@ export interface TxtElementOptions<
|
|
|
30
30
|
weight?: 'light' | 'normal' | 'medium' | 'semibold' | 'bold'
|
|
31
31
|
color?: string
|
|
32
32
|
align?: 'left' | 'center' | 'right' | 'justify'
|
|
33
|
+
transform?: (val?: any, rowData?: T) => any
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
export interface ImgElementOptions<
|
|
@@ -302,6 +303,7 @@ export function txt<
|
|
|
302
303
|
color: finalOptions.color,
|
|
303
304
|
align: finalOptions.align,
|
|
304
305
|
},
|
|
306
|
+
transform: finalOptions.transform,
|
|
305
307
|
}
|
|
306
308
|
}
|
|
307
309
|
|