@bagelink/vue 0.0.188 → 0.0.192
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 +11 -7
- package/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/ListView.vue.d.ts.map +1 -1
- package/dist/components/TableSchema.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DatePicker.vue.d.ts +20 -0
- package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -0
- package/dist/components/form/inputs/RadioPillsInput.vue.d.ts +31 -0
- package/dist/components/form/inputs/RadioPillsInput.vue.d.ts.map +1 -0
- package/dist/components/form/inputs/TextInput.vue.d.ts +5 -0
- package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/index.d.ts +2 -0
- package/dist/components/form/inputs/index.d.ts.map +1 -1
- package/dist/components/formkit/AddressArray.vue.d.ts.map +1 -1
- package/dist/components/formkit/BankDetailsArray.vue.d.ts.map +1 -1
- package/dist/components/formkit/ContactArrayFormKit.vue.d.ts.map +1 -1
- package/dist/index.cjs +13151 -3614
- package/dist/index.mjs +13152 -3615
- package/dist/style.css +597 -366
- package/package.json +6 -2
- package/src/components/Btn.vue +165 -146
- package/src/components/ListView.vue +0 -1
- package/src/components/PersonPreview.vue +1 -1
- package/src/components/TableSchema.vue +79 -70
- package/src/components/form/inputs/DatePicker.vue +169 -0
- package/src/components/form/inputs/RadioPillsInput.vue +89 -0
- package/src/components/form/inputs/TextInput.vue +53 -11
- package/src/components/form/inputs/index.ts +2 -0
- package/src/components/formkit/AddressArray.vue +173 -150
- package/src/components/formkit/BankDetailsArray.vue +197 -174
- package/src/components/formkit/ContactArrayFormKit.vue +140 -123
- package/src/components/formkit/FileUploader.vue +4 -4
- package/src/styles/layout.css +83 -0
- package/src/styles/theme.css +45 -16
|
@@ -1,226 +1,249 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
2
|
+
<div class="bagel-input">
|
|
3
|
+
<div class="mt-1">
|
|
4
|
+
<div
|
|
5
|
+
class="bglform-contact mb-3"
|
|
6
|
+
v-for="(address, i) in val"
|
|
7
|
+
:key="i"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
class="bglform-contact-confirm"
|
|
11
|
+
v-if="deleteCandidate === i"
|
|
12
|
+
>
|
|
13
|
+
<p class="txt14">
|
|
14
|
+
{{ formPlaceholders?.sure }}
|
|
15
|
+
</p>
|
|
16
|
+
<Btn
|
|
17
|
+
thin
|
|
18
|
+
color="red"
|
|
19
|
+
@click="deleteContact(address.id)"
|
|
20
|
+
>
|
|
21
|
+
{{ formPlaceholders?.delete }}
|
|
22
|
+
</Btn>
|
|
23
|
+
<Btn
|
|
24
|
+
thin
|
|
25
|
+
@click="deleteCandidate = -1"
|
|
26
|
+
>
|
|
27
|
+
{{ formPlaceholders?.cancel }}
|
|
28
|
+
</Btn>
|
|
29
|
+
</div>
|
|
30
|
+
<Checkbox
|
|
31
|
+
v-model="address.primary"
|
|
32
|
+
@update:model-value="($event) => primaryHandler(i, $event)"
|
|
33
|
+
/>
|
|
34
|
+
<input
|
|
35
|
+
class="bglform-contact-label"
|
|
36
|
+
v-model="address.label"
|
|
37
|
+
type="text"
|
|
38
|
+
:placeholder="formPlaceholders?.label"
|
|
39
|
+
>
|
|
40
|
+
<div class="bglform-contact-address">
|
|
41
|
+
<input
|
|
42
|
+
v-model="address.street"
|
|
43
|
+
:placeholder="formPlaceholders?.street"
|
|
44
|
+
type="text"
|
|
45
|
+
>
|
|
46
|
+
<div class="bglform-contact-address-flex">
|
|
47
|
+
<input
|
|
48
|
+
v-model="address.city"
|
|
49
|
+
:placeholder="formPlaceholders?.city"
|
|
50
|
+
type="text"
|
|
51
|
+
>
|
|
52
|
+
<input
|
|
53
|
+
v-model="address.postal_code"
|
|
54
|
+
:placeholder="formPlaceholders?.zip"
|
|
55
|
+
type="text"
|
|
56
|
+
>
|
|
57
|
+
</div>
|
|
58
|
+
<input
|
|
59
|
+
v-model="address.country"
|
|
60
|
+
:placeholder="formPlaceholders?.country"
|
|
61
|
+
type="text"
|
|
62
|
+
>
|
|
63
|
+
</div>
|
|
64
|
+
<div class="bglform-address-del">
|
|
65
|
+
<Btn
|
|
66
|
+
thin
|
|
67
|
+
@click="deleteCandidate = i"
|
|
68
|
+
icon="delete"
|
|
69
|
+
color="gray"
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
<Btn
|
|
74
|
+
class="add-btn"
|
|
75
|
+
flat
|
|
76
|
+
thin
|
|
77
|
+
@click="addNew"
|
|
78
|
+
>
|
|
79
|
+
{{ formPlaceholders?.add }}
|
|
80
|
+
{{ context?.label }}
|
|
81
|
+
</Btn>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
60
84
|
</template>
|
|
61
85
|
|
|
62
86
|
<script setup lang="ts">
|
|
63
|
-
import { watch } from
|
|
87
|
+
import { watch } from 'vue';
|
|
64
88
|
// import type { BagelField } from '@bagelink/vue';
|
|
65
89
|
|
|
66
|
-
import { Btn, useBagel } from
|
|
67
|
-
import Checkbox from
|
|
90
|
+
import { Btn, useBagel } from '@bagelink/vue';
|
|
91
|
+
import Checkbox from '../form/inputs/Checkbox.vue';
|
|
68
92
|
|
|
69
93
|
export interface AddressArrContext {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
94
|
+
label?: string;
|
|
95
|
+
id?: string;
|
|
96
|
+
value: any[];
|
|
97
|
+
node: Record<string, any>;
|
|
98
|
+
attrs: {
|
|
99
|
+
formPlaceholders?: {
|
|
100
|
+
add?: string;
|
|
101
|
+
cancel?: string;
|
|
102
|
+
city?: string;
|
|
103
|
+
country?: string;
|
|
104
|
+
delete?: string;
|
|
105
|
+
label?: string;
|
|
106
|
+
sure?: string;
|
|
107
|
+
zip?: string;
|
|
108
|
+
street?: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
87
111
|
}
|
|
88
112
|
const bagel = useBagel();
|
|
89
113
|
const props = defineProps<{
|
|
90
|
-
|
|
114
|
+
context: AddressArrContext;
|
|
91
115
|
}>();
|
|
92
116
|
const formPlaceholders = $computed(
|
|
93
|
-
|
|
117
|
+
() => props.context?.attrs?.formPlaceholders,
|
|
94
118
|
);
|
|
95
119
|
|
|
96
120
|
let val = $ref<any[]>([]);
|
|
97
121
|
const addNew = () => {
|
|
98
|
-
|
|
99
|
-
|
|
122
|
+
if (!val) val = [{}];
|
|
123
|
+
else val.push({});
|
|
100
124
|
};
|
|
101
125
|
|
|
102
126
|
let deleteCandidate = $ref<number>(-1);
|
|
103
127
|
|
|
104
128
|
const del = (i: number) => {
|
|
105
|
-
|
|
129
|
+
val.splice(i, 1);
|
|
106
130
|
};
|
|
107
131
|
|
|
108
132
|
const deleteContact = async (id: string) => {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
133
|
+
await bagel.delete(`/person/contact/${id}`);
|
|
134
|
+
const index = val.findIndex((v) => v.id === id);
|
|
135
|
+
deleteCandidate = -1;
|
|
136
|
+
del(index);
|
|
113
137
|
};
|
|
114
138
|
|
|
115
139
|
const primaryHandler = (i: number, isPrimary: boolean) => {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
140
|
+
if (!isPrimary) return;
|
|
141
|
+
val?.forEach((contact, index) => {
|
|
142
|
+
if (index !== i) contact.primary = false;
|
|
143
|
+
});
|
|
120
144
|
};
|
|
121
145
|
|
|
122
146
|
watch(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
147
|
+
() => props.context?.value,
|
|
148
|
+
() => {
|
|
149
|
+
val = props.context?.value;
|
|
150
|
+
},
|
|
151
|
+
{ immediate: true },
|
|
128
152
|
);
|
|
129
153
|
|
|
130
154
|
watch(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
155
|
+
() => val,
|
|
156
|
+
() => {
|
|
157
|
+
props.context?.node.input(val);
|
|
158
|
+
},
|
|
135
159
|
);
|
|
136
160
|
</script>
|
|
137
161
|
|
|
138
162
|
<style>
|
|
139
163
|
.bglform-contact-confirm {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
164
|
+
position: absolute;
|
|
165
|
+
background: rgba(255, 255, 255, 0.5);
|
|
166
|
+
height: 100%;
|
|
167
|
+
width: 100%;
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
justify-content: center;
|
|
171
|
+
gap: 0.5rem;
|
|
172
|
+
backdrop-filter: blur(1px);
|
|
149
173
|
}
|
|
150
174
|
</style>
|
|
151
175
|
<style scoped>
|
|
152
176
|
.bglform-contact {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
177
|
+
display: flex;
|
|
178
|
+
gap: 0.5rem;
|
|
179
|
+
max-width: 700px;
|
|
180
|
+
position: relative;
|
|
157
181
|
}
|
|
158
182
|
|
|
159
183
|
.bglform-contact-label {
|
|
160
|
-
|
|
184
|
+
flex-basis: 140px;
|
|
161
185
|
}
|
|
162
186
|
|
|
163
187
|
.bglform-contact-address {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
188
|
+
display: flex;
|
|
189
|
+
flex-direction: column;
|
|
190
|
+
gap: 0.5rem;
|
|
167
191
|
}
|
|
168
192
|
|
|
169
193
|
.bglform-contact input[type="checkbox"] {
|
|
170
|
-
|
|
171
|
-
|
|
194
|
+
width: 30px;
|
|
195
|
+
min-width: 0;
|
|
172
196
|
}
|
|
173
197
|
|
|
174
198
|
.light.thin.btn-txt.btn {
|
|
175
|
-
|
|
176
|
-
|
|
199
|
+
padding-left: calc(var(--btn-padding) / 4);
|
|
200
|
+
padding-right: calc(var(--btn-padding) / 4);
|
|
177
201
|
}
|
|
178
202
|
|
|
179
203
|
.bglform-address-del {
|
|
180
|
-
|
|
204
|
+
margin-top: 6px;
|
|
181
205
|
}
|
|
182
206
|
|
|
183
207
|
.bglform-contact-address-flex {
|
|
184
|
-
|
|
185
|
-
|
|
208
|
+
display: flex;
|
|
209
|
+
gap: 0.5rem;
|
|
186
210
|
}
|
|
187
211
|
|
|
188
212
|
.add-btn {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
213
|
+
display: flex;
|
|
214
|
+
gap: 0.5rem;
|
|
215
|
+
align-items: center;
|
|
216
|
+
margin-inline-start: 1rem;
|
|
193
217
|
}
|
|
194
218
|
|
|
195
219
|
.add-btn:active {
|
|
196
|
-
|
|
220
|
+
background: none !important;
|
|
197
221
|
}
|
|
198
222
|
|
|
199
223
|
.add-btn::before {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
224
|
+
content: "+";
|
|
225
|
+
font-size: 10px;
|
|
226
|
+
background: var(--bgl-blue-light);
|
|
227
|
+
border-radius: 100%;
|
|
228
|
+
height: 14px;
|
|
229
|
+
width: 14px;
|
|
230
|
+
display: flex;
|
|
231
|
+
align-items: center;
|
|
232
|
+
justify-content: center;
|
|
233
|
+
color: var(--bgl-primary);
|
|
210
234
|
}
|
|
211
235
|
|
|
212
236
|
.add-btn:hover::before {
|
|
213
|
-
|
|
214
|
-
|
|
237
|
+
background: var(--bgl-primary);
|
|
238
|
+
color: var(--bgl-white);
|
|
215
239
|
}
|
|
216
240
|
|
|
217
241
|
@media screen and (max-width: 910px) {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}
|
|
226
|
-
</style>
|
|
242
|
+
.bglform-contact-address-flex {
|
|
243
|
+
flex-wrap: wrap;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.bglform-contact-label {
|
|
247
|
+
min-width: 0;
|
|
248
|
+
}
|
|
249
|
+
}</style>
|