@bagelink/vue 0.0.192 → 0.0.198
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/components/Btn.vue.d.ts +5 -8
- package/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/formkit/MiscFields.vue.d.ts.map +1 -1
- package/dist/index.cjs +28 -22
- package/dist/index.mjs +28 -22
- package/dist/style.css +163 -164
- package/dist/types/BtnOptions.d.ts +3 -2
- package/dist/types/BtnOptions.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Btn.vue +45 -45
- package/src/components/form/inputs/TableField.vue +1 -1
- package/src/components/form/inputs/TextInput.vue +10 -7
- package/src/components/formkit/AddressArray.vue +3 -2
- package/src/components/formkit/BankDetailsArray.vue +3 -2
- package/src/components/formkit/ContactArrayFormKit.vue +3 -2
- package/src/components/formkit/MiscFields.vue +42 -42
- package/src/styles/buttons.css +1 -1
- package/src/styles/inputs.css +2 -2
- package/src/styles/layout.css +1 -1
- package/src/types/BtnOptions.ts +4 -2
- package/src/types/index.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BtnOptions.d.ts","sourceRoot":"","sources":["../../src/types/BtnOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"BtnOptions.d.ts","sourceRoot":"","sources":["../../src/types/BtnOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC;AAElD,MAAM,WAAW,UAAU;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAC,SAAS,CAAC;IACjB,KAAK,CAAC,EAAC,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAEf"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ export type { Tables, TableToTypeMapping } from '@bagelink/sdk';
|
|
|
4
4
|
export type { StorageFile } from './file';
|
|
5
5
|
export * from './BagelField';
|
|
6
6
|
export * from './BtnOptions';
|
|
7
|
+
export type ThemeType = 'light' | 'red' | 'gray' | 'gray-light' | 'black' | 'green';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACxE,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAChE,YAAY,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACxE,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAChE,YAAY,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAE7B,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,YAAY,GAAG,OAAO,GAAG,OAAO,CAAC"}
|
package/package.json
CHANGED
package/src/components/Btn.vue
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
btn: !icon || slots['default'] || value,
|
|
11
11
|
thin,
|
|
12
12
|
round,
|
|
13
|
-
'
|
|
13
|
+
'flatBtn': flat,
|
|
14
14
|
'btn-border': border
|
|
15
15
|
}"
|
|
16
16
|
>
|
|
@@ -42,18 +42,16 @@
|
|
|
42
42
|
import { useSlots } from 'vue';
|
|
43
43
|
|
|
44
44
|
const slots = useSlots();
|
|
45
|
-
import type { MaterialIcons } from '@bagelink/vue';
|
|
45
|
+
import type { MaterialIcons, ThemeType } from '@bagelink/vue';
|
|
46
46
|
import { MaterialIcon } from '@bagelink/vue';
|
|
47
47
|
|
|
48
|
-
type ThemeTypes = 'light' | 'red' | 'gray' | 'gray-light' | 'black' | 'green';
|
|
49
|
-
|
|
50
48
|
const props = withDefaults(
|
|
51
49
|
defineProps<{
|
|
52
50
|
disabled?: boolean;
|
|
53
51
|
icon?: MaterialIcons;
|
|
54
52
|
'icon.end'?: MaterialIcons;
|
|
55
|
-
color?:
|
|
56
|
-
theme?:
|
|
53
|
+
color?: ThemeType;
|
|
54
|
+
theme?: ThemeType;
|
|
57
55
|
flat?: boolean;
|
|
58
56
|
border?: boolean;
|
|
59
57
|
thin?: boolean;
|
|
@@ -64,7 +62,6 @@ const props = withDefaults(
|
|
|
64
62
|
to?: string;
|
|
65
63
|
round?: boolean;
|
|
66
64
|
is?: string;
|
|
67
|
-
borderColor?: string
|
|
68
65
|
}>(),
|
|
69
66
|
{
|
|
70
67
|
loading: false,
|
|
@@ -76,25 +73,32 @@ const props = withDefaults(
|
|
|
76
73
|
},
|
|
77
74
|
);
|
|
78
75
|
|
|
79
|
-
const computedTheme = $computed(
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
const computedTheme = $computed(
|
|
77
|
+
() => (props?.color || props?.theme)
|
|
78
|
+
);
|
|
82
79
|
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
80
|
+
const computedDefaultColors = $computed(
|
|
81
|
+
() => ({
|
|
82
|
+
backgroundColor: 'var(--bgl-primary)',
|
|
83
|
+
color: props.flat ? 'var(--bgl-black)' : 'var(--bgl-white)'
|
|
84
|
+
})
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
const themes: { [key in ThemeType]: typeof computedDefaultColors } = {
|
|
88
|
+
red: { ...computedDefaultColors, backgroundColor: 'var(--bgl-red)', },
|
|
89
|
+
black: { ...computedDefaultColors, backgroundColor: 'var(--bgl-black)' },
|
|
90
|
+
green: { ...computedDefaultColors, backgroundColor: 'var(--bgl-green)', color: 'var(--bgl-white)' },
|
|
91
|
+
gray: { ...computedDefaultColors, backgroundColor: 'var(--bgl-gray-light)', color: 'var(--bgl-black)' },
|
|
92
|
+
light: { ...computedDefaultColors, backgroundColor: 'var(--bgl-primary-light)', color: 'var(--bgl-primary)' },
|
|
93
|
+
'gray-light': { ...computedDefaultColors, backgroundColor: 'var(--bgl-gray-light)', color: 'var(--bgl-gray)' },
|
|
90
94
|
};
|
|
91
95
|
|
|
92
96
|
const cumputedTextColor = $computed(
|
|
93
|
-
() => (themes?.[computedTheme as
|
|
97
|
+
() => (themes?.[computedTheme as ThemeType]?.color || computedDefaultColors.color),
|
|
94
98
|
);
|
|
95
99
|
|
|
96
100
|
const computedBackgroundColor = $computed(
|
|
97
|
-
() => (themes?.[computedTheme as
|
|
101
|
+
() => (themes?.[computedTheme as ThemeType]?.backgroundColor || computedDefaultColors.backgroundColor),
|
|
98
102
|
);
|
|
99
103
|
</script>
|
|
100
104
|
|
|
@@ -131,8 +135,6 @@ const computedBackgroundColor = $computed(
|
|
|
131
135
|
}
|
|
132
136
|
|
|
133
137
|
.btn {
|
|
134
|
-
background: var(--bgl-primary);
|
|
135
|
-
color: var(--bgl-white);
|
|
136
138
|
padding-left: var(--btn-padding);
|
|
137
139
|
padding-right: var(--btn-padding);
|
|
138
140
|
transition: var(--bgl-transition);
|
|
@@ -155,6 +157,12 @@ const computedBackgroundColor = $computed(
|
|
|
155
157
|
font-size: calc(var(--input-font-size) * 1.3);
|
|
156
158
|
}
|
|
157
159
|
|
|
160
|
+
.btn,
|
|
161
|
+
.btn-icon {
|
|
162
|
+
background-color: v-bind(computedBackgroundColor);
|
|
163
|
+
color: v-bind(cumputedTextColor);
|
|
164
|
+
}
|
|
165
|
+
|
|
158
166
|
.btn:hover,
|
|
159
167
|
.btn-icon:hover {
|
|
160
168
|
filter: var(--bgl-hover-filter);
|
|
@@ -165,53 +173,45 @@ const computedBackgroundColor = $computed(
|
|
|
165
173
|
filter: var(--bgl-active-filter);
|
|
166
174
|
}
|
|
167
175
|
|
|
168
|
-
.btn,
|
|
169
|
-
.btn-icon {
|
|
170
|
-
background-color: v-bind(computedBackgroundColor);
|
|
171
|
-
color: v-bind(cumputedTextColor);
|
|
172
|
-
|
|
173
|
-
}
|
|
174
176
|
|
|
175
|
-
.btn.
|
|
176
|
-
color: var(--bgl-primary);
|
|
177
|
+
.btn.flatBtn {
|
|
177
178
|
padding-left: var(--btn-padding);
|
|
178
179
|
padding-right: var(--btn-padding);
|
|
179
180
|
background: transparent;
|
|
180
181
|
}
|
|
181
182
|
|
|
182
|
-
.btn-icon.
|
|
183
|
-
color: var(--bgl-primary);
|
|
183
|
+
.btn-icon.flatBtn {
|
|
184
184
|
background: transparent;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
.btn.
|
|
188
|
-
.btn-icon.
|
|
187
|
+
.btn.flatBtn:hover,
|
|
188
|
+
.btn-icon.flatBtn:hover {
|
|
189
189
|
filter: var(--bgl-active-filter);
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
.btn.
|
|
193
|
-
.btn-icon.
|
|
192
|
+
.btn.flatBtn:active,
|
|
193
|
+
.btn-icon.flatBtn:active {
|
|
194
194
|
background: var(--bgl-white);
|
|
195
195
|
filter: var(--bgl-hover-filter);
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
.btn.
|
|
199
|
-
.btn-icon.
|
|
198
|
+
.btn.flatBtn.red,
|
|
199
|
+
.btn-icon.flatBtn.red {
|
|
200
200
|
color: var(--bgl-red);
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
.btn.
|
|
204
|
-
.btn-icon.
|
|
203
|
+
.btn.flatBtn.light,
|
|
204
|
+
.btn-icon.flatBtn.light {
|
|
205
205
|
color: var(--bgl-primary-tint);
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
.btn.
|
|
209
|
-
.btn-icon.
|
|
208
|
+
.btn.flatBtn.black,
|
|
209
|
+
.btn-icon.flatBtn.black {
|
|
210
210
|
color: var(--bgl-black);
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
.btn.
|
|
214
|
-
.btn-icon.
|
|
213
|
+
.btn.flatBtn.gray,
|
|
214
|
+
.btn-icon.flatBtn.gray {
|
|
215
215
|
color: var(--bgl-gray);
|
|
216
216
|
}
|
|
217
217
|
|
|
@@ -237,11 +237,11 @@ const computedBackgroundColor = $computed(
|
|
|
237
237
|
.btn-border {
|
|
238
238
|
outline: 1px solid v-bind(computedBackgroundColor);
|
|
239
239
|
color: v-bind(computedBackgroundColor);
|
|
240
|
-
background:
|
|
240
|
+
background: transparent;
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
.btn-border:hover {
|
|
244
|
-
color:
|
|
244
|
+
color: var(--bgl-white);
|
|
245
245
|
background: v-bind(computedBackgroundColor);
|
|
246
246
|
filter: brightness(100%);
|
|
247
247
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
class="bagel-input"
|
|
4
|
-
:class="{ small, shrink, toggleEdit, editMode, textInputIconWrap:icon, txtInputIconStart:iconStart}"
|
|
4
|
+
:class="{ small, shrink, toggleEdit, editMode, textInputIconWrap: icon, txtInputIconStart: iconStart }"
|
|
5
5
|
:title="title"
|
|
6
6
|
>
|
|
7
7
|
<label :for="id">
|
|
@@ -138,21 +138,24 @@ watch(
|
|
|
138
138
|
.textInputIconWrap {
|
|
139
139
|
position: relative;
|
|
140
140
|
}
|
|
141
|
+
|
|
141
142
|
.textInputIconWrap .icon-font {
|
|
142
143
|
position: absolute;
|
|
143
144
|
inset-inline-end: 0.7rem;
|
|
144
|
-
|
|
145
|
+
bottom: 50%;
|
|
145
146
|
line-height: 0;
|
|
146
|
-
|
|
147
|
+
color: var(--bgl-gray);
|
|
147
148
|
}
|
|
148
|
-
|
|
149
|
+
|
|
150
|
+
.txtInputIconStart .iconStart {
|
|
149
151
|
position: absolute;
|
|
150
152
|
inset-inline-start: 0.7rem;
|
|
151
|
-
top:50%;
|
|
153
|
+
top: 50%;
|
|
152
154
|
line-height: 0;
|
|
153
|
-
|
|
155
|
+
color: var(--bgl-gray);
|
|
154
156
|
}
|
|
155
|
-
|
|
157
|
+
|
|
158
|
+
.txtInputIconStart input {
|
|
156
159
|
padding-inline-start: 2rem;
|
|
157
160
|
}
|
|
158
161
|
|
|
@@ -195,7 +195,7 @@ watch(
|
|
|
195
195
|
min-width: 0;
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
.light.thin.
|
|
198
|
+
.light.thin.flatBtn.btn {
|
|
199
199
|
padding-left: calc(var(--btn-padding) / 4);
|
|
200
200
|
padding-right: calc(var(--btn-padding) / 4);
|
|
201
201
|
}
|
|
@@ -246,4 +246,5 @@ watch(
|
|
|
246
246
|
.bglform-contact-label {
|
|
247
247
|
min-width: 0;
|
|
248
248
|
}
|
|
249
|
-
}
|
|
249
|
+
}
|
|
250
|
+
</style>
|
|
@@ -219,7 +219,7 @@ watch(
|
|
|
219
219
|
min-width: 0;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
.light.thin.
|
|
222
|
+
.light.thin.flatBtn.btn {
|
|
223
223
|
padding-left: calc(var(--btn-padding) / 4);
|
|
224
224
|
padding-right: calc(var(--btn-padding) / 4);
|
|
225
225
|
}
|
|
@@ -270,4 +270,5 @@ watch(
|
|
|
270
270
|
.bglform-contact-label {
|
|
271
271
|
min-width: 0;
|
|
272
272
|
}
|
|
273
|
-
}
|
|
273
|
+
}
|
|
274
|
+
</style>
|
|
@@ -161,7 +161,7 @@ watch(
|
|
|
161
161
|
min-width: 0;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
.light.thin.
|
|
164
|
+
.light.thin.flatBtn.btn {
|
|
165
165
|
padding-left: calc(var(--btn-padding) / 4);
|
|
166
166
|
padding-right: calc(var(--btn-padding) / 4);
|
|
167
167
|
}
|
|
@@ -199,4 +199,5 @@ watch(
|
|
|
199
199
|
.bglform-contact-label {
|
|
200
200
|
min-width: 0;
|
|
201
201
|
}
|
|
202
|
-
}
|
|
202
|
+
}
|
|
203
|
+
</style>
|
|
@@ -1,74 +1,74 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
<div class="misc-wrap">
|
|
3
|
+
<Btn
|
|
4
|
+
class="add-btn"
|
|
5
|
+
color="gray"
|
|
6
|
+
flat
|
|
7
|
+
@click="addToField(field)"
|
|
8
|
+
v-for="(field, i) in fields.filter(
|
|
9
9
|
(field: any) => field.value?.length === 0,
|
|
10
10
|
)"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
:key="i"
|
|
12
|
+
thin
|
|
13
|
+
>
|
|
14
|
+
{{ addBtnLabel }} {{ field.context?.label }}
|
|
15
|
+
</Btn>
|
|
16
|
+
</div>
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script lang="ts" setup>
|
|
20
20
|
import { Btn } from "@bagelink/vue";
|
|
21
21
|
|
|
22
22
|
const props = defineProps<{
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
context: Record<string, any>;
|
|
24
|
+
addBtnLabel: string;
|
|
25
25
|
}>();
|
|
26
26
|
|
|
27
27
|
const fields = $computed(() => props.context?.node?.parent?.children || []);
|
|
28
28
|
|
|
29
29
|
const addToField = (field: any) => {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
field.input([{}]);
|
|
31
|
+
console.log(fields);
|
|
32
32
|
};
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
35
|
<style scoped>
|
|
36
36
|
.misc-wrap {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
display: flex;
|
|
38
|
+
gap: 1rem;
|
|
39
|
+
border-top: 1px solid var(--border-color);
|
|
40
|
+
padding-top: 0.5rem;
|
|
41
|
+
margin-bottom: auto;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
.gray.thin.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
.gray.thin.flatBtn.btn.add-btn {
|
|
45
|
+
display: flex;
|
|
46
|
+
gap: 0.5rem;
|
|
47
|
+
align-items: center;
|
|
48
|
+
padding-left: 0;
|
|
49
|
+
padding-right: 0;
|
|
50
|
+
transition: var(--bgl-transition);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.add-btn:active {
|
|
54
|
-
|
|
54
|
+
background: none !important;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
.add-btn::before {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
58
|
+
content: "+";
|
|
59
|
+
font-size: 10px;
|
|
60
|
+
background: var(--bgl-gray-light);
|
|
61
|
+
border-radius: 100%;
|
|
62
|
+
height: 14px;
|
|
63
|
+
width: 14px;
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
color: var(--bgl-gray);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
.add-btn:hover::before {
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
background: var(--bgl-primary);
|
|
72
|
+
color: var(--bgl-white);
|
|
73
73
|
}
|
|
74
74
|
</style>
|
package/src/styles/buttons.css
CHANGED
package/src/styles/inputs.css
CHANGED
|
@@ -291,12 +291,12 @@ label.active {
|
|
|
291
291
|
display: none;
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
-
.label-count-0 button.btn.
|
|
294
|
+
.label-count-0 button.btn.flatBtn {
|
|
295
295
|
/* background: var(--bgl-blue-light); */
|
|
296
296
|
margin-right: 5px;
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
.label-count-0 button.btn.
|
|
299
|
+
.label-count-0 button.btn.flatBtn:hover {
|
|
300
300
|
background: var(--bgl-hover-filter);
|
|
301
301
|
}
|
|
302
302
|
|
package/src/styles/layout.css
CHANGED
package/src/types/BtnOptions.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { MaterialIcons } from '
|
|
1
|
+
import type { ThemeType, MaterialIcons } from '.';
|
|
2
2
|
|
|
3
3
|
export interface BtnOptions {
|
|
4
4
|
onClick?: () => void;
|
|
5
|
-
color?:
|
|
5
|
+
color?:ThemeType;
|
|
6
|
+
theme?:ThemeType;
|
|
6
7
|
disabled?: boolean;
|
|
7
8
|
icon?: MaterialIcons;
|
|
8
9
|
flat?: boolean;
|
|
@@ -11,4 +12,5 @@ export interface BtnOptions {
|
|
|
11
12
|
loading?: boolean;
|
|
12
13
|
role?: string;
|
|
13
14
|
value?: string;
|
|
15
|
+
|
|
14
16
|
}
|
package/src/types/index.ts
CHANGED