@bagelink/vue 0.0.160 → 0.0.162
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 +2 -2
- package/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/Comments.vue.d.ts.map +1 -1
- package/dist/components/DropDown.vue.d.ts.map +1 -1
- package/dist/components/FileUploader.vue.d.ts.map +1 -1
- package/dist/components/LangText.vue.d.ts.map +1 -1
- package/dist/components/NavBar.vue.d.ts.map +1 -1
- package/dist/components/PersonPreview.vue.d.ts +1 -1
- package/dist/components/PersonPreview.vue.d.ts.map +1 -1
- package/dist/components/PersonPreviewFormkit.vue.d.ts +1 -1
- package/dist/components/PersonPreviewFormkit.vue.d.ts.map +1 -1
- package/dist/components/RTXEditor.vue.d.ts.map +1 -1
- package/dist/components/TableSchema.vue.d.ts.map +1 -1
- package/dist/components/charts/BarChart.vue.d.ts.map +1 -1
- package/dist/components/dashboard/Lineart.vue.d.ts +1 -1
- package/dist/components/dashboard/Lineart.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/CheckInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Checkbox.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/PasswordInput.vue.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/components/formkit/FileUploader.vue.d.ts.map +1 -1
- package/dist/components/formkit/MiscFields.vue.d.ts.map +1 -1
- package/dist/index.cjs +60 -49
- package/dist/index.mjs +60 -49
- package/dist/style.css +1468 -1402
- package/package.json +1 -1
- package/src/components/Btn.vue +127 -132
- package/src/components/Comments.vue +155 -169
- package/src/components/DropDown.vue +73 -77
- package/src/components/FileUploader.vue +133 -141
- package/src/components/FormKitTable.vue +191 -205
- package/src/components/LangText.vue +14 -14
- package/src/components/NavBar.vue +264 -261
- package/src/components/PersonPreview.vue +123 -148
- package/src/components/PersonPreviewFormkit.vue +124 -148
- package/src/components/RTXEditor.vue +91 -91
- package/src/components/TableSchema.vue +150 -156
- package/src/components/charts/BarChart.vue +212 -227
- package/src/components/dashboard/Lineart.vue +117 -130
- package/src/components/form/inputs/CheckInput.vue +90 -90
- package/src/components/form/inputs/Checkbox.vue +38 -41
- package/src/components/form/inputs/PasswordInput.vue +56 -63
- package/src/components/formkit/AddressArray.vue +150 -173
- package/src/components/formkit/BankDetailsArray.vue +175 -198
- package/src/components/formkit/ContactArrayFormKit.vue +124 -142
- package/src/components/formkit/FileUploader.vue +256 -260
- package/src/components/formkit/MiscFields.vue +42 -42
- package/src/components/formkit/Toggle.vue +97 -97
- package/src/styles/bagel.css +1 -0
- package/src/styles/buttons.css +5 -0
- package/src/styles/dark.css +46 -0
- package/src/styles/fonts/Ploni.css +8 -8
- package/src/styles/inputs.css +57 -13
- package/src/styles/layout.css +43 -0
- package/src/styles/text.css +83 -10
- package/src/styles/theme.css +25 -155
- package/src/styles/fonts/Ploni/ploni-black.eot +0 -0
- package/src/styles/fonts/Ploni/ploni-black.woff +0 -0
- package/src/styles/fonts/Ploni/ploni-black.woff2 +0 -0
- package/src/styles/fonts/Ploni/ploni-bold.eot +0 -0
- package/src/styles/fonts/Ploni/ploni-bold.woff +0 -0
- package/src/styles/fonts/Ploni/ploni-bold.woff2 +0 -0
- package/src/styles/fonts/Ploni/ploni-demibold.eot +0 -0
- package/src/styles/fonts/Ploni/ploni-demibold.woff +0 -0
- package/src/styles/fonts/Ploni/ploni-demibold.woff2 +0 -0
- package/src/styles/fonts/Ploni/ploni-light.eot +0 -0
- package/src/styles/fonts/Ploni/ploni-light.woff +0 -0
- package/src/styles/fonts/Ploni/ploni-light.woff2 +0 -0
- package/src/styles/fonts/Ploni/ploni-medium.eot +0 -0
- package/src/styles/fonts/Ploni/ploni-medium.woff +0 -0
- package/src/styles/fonts/Ploni/ploni-medium.woff2 +0 -0
- package/src/styles/fonts/Ploni/ploni-regular.eot +0 -0
- package/src/styles/fonts/Ploni/ploni-regular.woff +0 -0
- package/src/styles/fonts/Ploni/ploni-regular.woff2 +0 -0
- package/src/styles/fonts/Ploni/ploni-ultrabold.eot +0 -0
- package/src/styles/fonts/Ploni/ploni-ultrabold.woff +0 -0
- package/src/styles/fonts/Ploni/ploni-ultrabold.woff2 +0 -0
- package/src/styles/fonts/Ploni/ploni-ultralight.eot +0 -0
- package/src/styles/fonts/Ploni/ploni-ultralight.woff +0 -0
- package/src/styles/fonts/Ploni/ploni-ultralight.woff2 +0 -0
|
@@ -1,203 +1,185 @@
|
|
|
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
|
-
thin
|
|
56
|
-
@click="deleteCandidate = i"
|
|
57
|
-
icon="delete"
|
|
58
|
-
color="gray"
|
|
59
|
-
:disabled="contact.primary
|
|
60
|
-
|| val.length === 1
|
|
61
|
-
|| deleteCandidate !== -1"
|
|
62
|
-
/>
|
|
63
|
-
</div>
|
|
64
|
-
<Btn
|
|
65
|
-
class="add-btn"
|
|
66
|
-
color="blue"
|
|
67
|
-
flat
|
|
68
|
-
thin
|
|
69
|
-
@click="val.push({})"
|
|
70
|
-
>
|
|
71
|
-
{{ formPlaceholders?.add }} {{ context?.label }}
|
|
72
|
-
</Btn>
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
2
|
+
<div class="bagel-input">
|
|
3
|
+
<div class="mt-1">
|
|
4
|
+
<div class="bglform-contact mb-2" v-for="(contact, i) in val" :key="i">
|
|
5
|
+
<div class="bglform-contact-confirm" v-if="deleteCandidate === i">
|
|
6
|
+
<p class="txt14">
|
|
7
|
+
{{ formPlaceholders?.sure }}
|
|
8
|
+
</p>
|
|
9
|
+
<Btn thin color="red" @click="deleteContact(contact.id)">
|
|
10
|
+
{{ formPlaceholders?.delete }}
|
|
11
|
+
</Btn>
|
|
12
|
+
<Btn thin @click="deleteCandidate = -1">
|
|
13
|
+
{{ formPlaceholders?.cancel }}
|
|
14
|
+
</Btn>
|
|
15
|
+
</div>
|
|
16
|
+
<Checkbox
|
|
17
|
+
v-model="contact.primary"
|
|
18
|
+
@update:model-value="($event) => primaryHandler(i, $event)"
|
|
19
|
+
/>
|
|
20
|
+
<input
|
|
21
|
+
class="bglform-contact-label"
|
|
22
|
+
v-model="contact.label"
|
|
23
|
+
type="text"
|
|
24
|
+
:placeholder="formPlaceholders?.label"
|
|
25
|
+
/>
|
|
26
|
+
|
|
27
|
+
<input
|
|
28
|
+
v-model="contact.email"
|
|
29
|
+
:placeholder="formPlaceholders?.email"
|
|
30
|
+
v-if="context?.id === 'email'"
|
|
31
|
+
type="email"
|
|
32
|
+
/>
|
|
33
|
+
<input
|
|
34
|
+
v-model="contact.phone"
|
|
35
|
+
:placeholder="formPlaceholders?.phone"
|
|
36
|
+
v-if="context?.id === 'phone'"
|
|
37
|
+
type="tel"
|
|
38
|
+
/>
|
|
39
|
+
<!-- <MaterialIcon @click="del(i)" icon="delete" class="btn-float" /> -->
|
|
40
|
+
<Btn
|
|
41
|
+
thin
|
|
42
|
+
@click="deleteCandidate = i"
|
|
43
|
+
icon="delete"
|
|
44
|
+
color="gray"
|
|
45
|
+
:disabled="
|
|
46
|
+
contact.primary || val.length === 1 || deleteCandidate !== -1
|
|
47
|
+
"
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
<Btn class="add-btn" color="blue" flat thin @click="val.push({})">
|
|
51
|
+
{{ formPlaceholders?.add }} {{ context?.label }}
|
|
52
|
+
</Btn>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
75
55
|
</template>
|
|
76
56
|
|
|
77
57
|
<script setup lang="ts">
|
|
78
|
-
import { watch } from
|
|
58
|
+
import { watch } from "vue";
|
|
79
59
|
// import type { BagelField } from '@bagelink/vue';
|
|
80
60
|
|
|
81
|
-
import { Btn, useBagel } from
|
|
82
|
-
import Checkbox from
|
|
61
|
+
import { Btn, useBagel } from "@bagelink/vue";
|
|
62
|
+
import Checkbox from "../form/inputs/Checkbox.vue";
|
|
83
63
|
|
|
84
64
|
export interface ContactArrContext {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
65
|
+
label?: string;
|
|
66
|
+
id?: string;
|
|
67
|
+
value: any[];
|
|
68
|
+
node: Record<string, any>;
|
|
69
|
+
attrs: {
|
|
70
|
+
formPlaceholders?: {
|
|
71
|
+
sure?: string;
|
|
72
|
+
delete?: string;
|
|
73
|
+
cancel?: string;
|
|
74
|
+
label?: string;
|
|
75
|
+
email?: string;
|
|
76
|
+
phone?: string;
|
|
77
|
+
add?: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
100
80
|
}
|
|
101
81
|
const bagel = useBagel();
|
|
102
82
|
|
|
103
83
|
const props = defineProps<{
|
|
104
|
-
|
|
84
|
+
context: ContactArrContext;
|
|
105
85
|
}>();
|
|
106
86
|
|
|
107
|
-
const formPlaceholders = $computed(
|
|
87
|
+
const formPlaceholders = $computed(
|
|
88
|
+
() => props.context?.attrs?.formPlaceholders
|
|
89
|
+
);
|
|
108
90
|
|
|
109
91
|
let val = $ref<any[]>([]);
|
|
110
92
|
let deleteCandidate = $ref<number>(-1);
|
|
111
93
|
|
|
112
94
|
const del = (i: number) => {
|
|
113
|
-
|
|
95
|
+
val.splice(i, 1);
|
|
114
96
|
};
|
|
115
97
|
|
|
116
98
|
const deleteContact = async (id: string) => {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
99
|
+
if (id) await bagel.delete(`/person/contact/${id}`);
|
|
100
|
+
const index = val.findIndex((v) => v.id === id);
|
|
101
|
+
del(index);
|
|
102
|
+
deleteCandidate = -1;
|
|
121
103
|
};
|
|
122
104
|
|
|
123
105
|
const primaryHandler = (i: number, isPrimary: boolean) => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
106
|
+
if (!isPrimary) return;
|
|
107
|
+
val.forEach((contact, index) => {
|
|
108
|
+
if (index !== i) contact.primary = false;
|
|
109
|
+
});
|
|
128
110
|
};
|
|
129
111
|
|
|
130
112
|
watch(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
113
|
+
() => props.context?.value,
|
|
114
|
+
() => {
|
|
115
|
+
val = props.context?.value;
|
|
116
|
+
},
|
|
117
|
+
{ immediate: true }
|
|
136
118
|
);
|
|
137
119
|
|
|
138
120
|
watch(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
121
|
+
() => val,
|
|
122
|
+
() => {
|
|
123
|
+
props.context?.node.input(val);
|
|
124
|
+
}
|
|
143
125
|
);
|
|
144
126
|
</script>
|
|
145
127
|
|
|
146
128
|
<style scoped>
|
|
147
129
|
.bglform-contact {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
gap: 0.5rem;
|
|
133
|
+
max-width: 700px;
|
|
134
|
+
position: relative;
|
|
153
135
|
}
|
|
154
136
|
|
|
155
137
|
.bglform-contact-label {
|
|
156
|
-
|
|
138
|
+
flex-basis: 140px;
|
|
157
139
|
}
|
|
158
140
|
|
|
159
|
-
.bglform-contact input[type=
|
|
160
|
-
|
|
161
|
-
|
|
141
|
+
.bglform-contact input[type="checkbox"] {
|
|
142
|
+
width: 30px;
|
|
143
|
+
min-width: 0;
|
|
162
144
|
}
|
|
163
145
|
|
|
164
146
|
.light.thin.btn-txt.btn {
|
|
165
|
-
|
|
166
|
-
|
|
147
|
+
padding-left: calc(var(--btn-padding) / 4);
|
|
148
|
+
padding-right: calc(var(--btn-padding) / 4);
|
|
167
149
|
}
|
|
168
150
|
|
|
169
151
|
.add-btn {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
152
|
+
display: flex;
|
|
153
|
+
gap: 0.5rem;
|
|
154
|
+
align-items: center;
|
|
155
|
+
margin-inline-start: 1rem;
|
|
174
156
|
}
|
|
175
157
|
|
|
176
158
|
.add-btn:active {
|
|
177
|
-
|
|
159
|
+
background: none !important;
|
|
178
160
|
}
|
|
179
161
|
|
|
180
162
|
.add-btn::before {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
163
|
+
content: "+";
|
|
164
|
+
font-size: 10px;
|
|
165
|
+
background: var(--bgl-blue-light);
|
|
166
|
+
border-radius: 100%;
|
|
167
|
+
height: 14px;
|
|
168
|
+
width: 14px;
|
|
169
|
+
display: flex;
|
|
170
|
+
align-items: center;
|
|
171
|
+
justify-content: center;
|
|
172
|
+
color: var(--bgl-primary);
|
|
191
173
|
}
|
|
192
174
|
|
|
193
175
|
.add-btn:hover::before {
|
|
194
|
-
|
|
195
|
-
|
|
176
|
+
background: var(--bgl-primary);
|
|
177
|
+
color: var(--bgl-white);
|
|
196
178
|
}
|
|
197
179
|
|
|
198
180
|
@media screen and (max-width: 910px) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
181
|
+
.bglform-contact-label {
|
|
182
|
+
min-width: 0;
|
|
183
|
+
}
|
|
202
184
|
}
|
|
203
185
|
</style>
|