@bagelink/vue 0.0.232-beta.0 → 0.0.233-beta.0

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.
Files changed (71) hide show
  1. package/dist/components/AccordionItem.vue.d.ts.map +1 -1
  2. package/dist/components/Card.vue.d.ts +2 -0
  3. package/dist/components/Card.vue.d.ts.map +1 -1
  4. package/dist/components/ModalBglForm.vue.d.ts.map +1 -1
  5. package/dist/components/TableSchema.vue.d.ts +3 -39
  6. package/dist/components/TableSchema.vue.d.ts.map +1 -1
  7. package/dist/components/form/BglField.vue.d.ts.map +1 -1
  8. package/dist/components/form/BglForm.vue.d.ts +4 -0
  9. package/dist/components/form/BglForm.vue.d.ts.map +1 -1
  10. package/dist/components/form/inputs/CheckInput.vue.d.ts +9 -22
  11. package/dist/components/form/inputs/CheckInput.vue.d.ts.map +1 -1
  12. package/dist/components/form/inputs/Checkbox.vue.d.ts +4 -10
  13. package/dist/components/form/inputs/Checkbox.vue.d.ts.map +1 -1
  14. package/dist/components/form/inputs/ColorPicker.vue.d.ts +6 -2
  15. package/dist/components/form/inputs/ColorPicker.vue.d.ts.map +1 -1
  16. package/dist/components/form/inputs/DateInput.vue.d.ts +44 -35
  17. package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
  18. package/dist/components/form/inputs/FileUpload.vue.d.ts.map +1 -1
  19. package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
  20. package/dist/components/form/inputs/index.d.ts +0 -10
  21. package/dist/components/form/inputs/index.d.ts.map +1 -1
  22. package/dist/components/formkit/index.d.ts +1 -13
  23. package/dist/components/formkit/index.d.ts.map +1 -1
  24. package/dist/components/index.d.ts +0 -1
  25. package/dist/components/index.d.ts.map +1 -1
  26. package/dist/index.cjs +1101 -3976
  27. package/dist/index.mjs +1102 -3977
  28. package/dist/plugins/bagel.d.ts +1 -1
  29. package/dist/plugins/bagel.d.ts.map +1 -1
  30. package/dist/plugins/modal.d.ts +1 -2
  31. package/dist/plugins/modal.d.ts.map +1 -1
  32. package/dist/style.css +266 -1014
  33. package/dist/types/BagelForm.d.ts +2 -3
  34. package/dist/types/BagelForm.d.ts.map +1 -1
  35. package/package.json +1 -1
  36. package/src/components/AccordionItem.vue +25 -53
  37. package/src/components/Card.vue +2 -1
  38. package/src/components/ModalBglForm.vue +6 -22
  39. package/src/components/TableSchema.vue +1 -3
  40. package/src/components/form/BglField.vue +15 -3
  41. package/src/components/form/BglForm.vue +19 -18
  42. package/src/components/form/inputs/CheckInput.vue +17 -24
  43. package/src/components/form/inputs/Checkbox.vue +3 -24
  44. package/src/components/form/inputs/ColorPicker.vue +8 -19
  45. package/src/components/form/inputs/DateInput.vue +21 -2
  46. package/src/components/form/inputs/FileUpload.vue +11 -23
  47. package/src/components/form/inputs/SelectInput.vue +9 -11
  48. package/src/components/form/inputs/index.ts +0 -10
  49. package/src/components/formkit/index.ts +19 -27
  50. package/src/components/index.ts +0 -1
  51. package/src/plugins/bagel.ts +6 -6
  52. package/src/plugins/modal.ts +1 -2
  53. package/src/styles/modal.css +59 -57
  54. package/src/styles/theme.css +0 -18
  55. package/src/types/BagelForm.ts +7 -11
  56. package/src/components/ContactArray.vue +0 -113
  57. package/src/components/Drop.vue +0 -150
  58. package/src/components/form/inputs/CurrencyInput.vue +0 -137
  59. package/src/components/form/inputs/DatetimeInput.vue +0 -49
  60. package/src/components/form/inputs/DurationInput.vue +0 -55
  61. package/src/components/form/inputs/FloatInput.vue +0 -53
  62. package/src/components/form/inputs/IntInput.vue +0 -52
  63. package/src/components/form/inputs/LinkField.vue +0 -300
  64. package/src/components/form/inputs/Password.vue +0 -90
  65. package/src/components/form/inputs/PasswordInput.vue +0 -85
  66. package/src/components/form/inputs/PlainText.vue +0 -63
  67. package/src/components/form/inputs/ReadOnlyInput.vue +0 -28
  68. package/src/components/form/inputs/SelectField.vue +0 -202
  69. package/src/components/formkit/AddressArray.vue +0 -250
  70. package/src/components/formkit/BankDetailsArray.vue +0 -274
  71. package/src/components/formkit/ContactArrayFormKit.vue +0 -203
@@ -1,274 +0,0 @@
1
- <template>
2
- <div class="bagel-input">
3
- <div class="mt-1">
4
- <div
5
- class="bglform-contact mb-3"
6
- v-for="(bank_account, 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(bank_account.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="bank_account.primary"
32
- @update:model-value="($event) => primaryHandler(i, $event)"
33
- />
34
- <input
35
- class="bglform-contact-label"
36
- v-model="bank_account.label"
37
- type="text"
38
- :placeholder="formPlaceholders?.label"
39
- >
40
- <div class="bglform-contact-address">
41
- <input
42
- v-model="bank_account.bank_name"
43
- :placeholder="formPlaceholders?.bankName"
44
- type="text"
45
- required
46
- >
47
- <div class="bglform-contact-address-flex">
48
- <input
49
- v-model="bank_account.branch"
50
- :placeholder="formPlaceholders?.bankBranch"
51
- type="text"
52
- required
53
- >
54
- <input
55
- v-model="bank_account.account_number"
56
- :placeholder="formPlaceholders?.bankAccount"
57
- type="text"
58
- required
59
- >
60
- </div>
61
- <div class="grid gap-2">
62
- <input
63
- v-model="bank_account.bank_account_holder"
64
- :placeholder="formPlaceholders?.bankAccountHolder"
65
- type="text"
66
- required
67
- >
68
- <input
69
- v-model="bank_account.bank_account_holder_id"
70
- :placeholder="formPlaceholders?.bankAccountHolderID"
71
- type="text"
72
- >
73
- <input
74
- v-model="bank_account.iban"
75
- placeholder="IBAN"
76
- type="text"
77
- >
78
- <input
79
- v-model="bank_account.swift"
80
- placeholder="SWIFT"
81
- type="text"
82
- >
83
- <input
84
- v-model="bank_account.bank_address"
85
- :placeholder="formPlaceholders?.bankAddress"
86
- type="text"
87
- >
88
- </div>
89
- </div>
90
- <div class="bglform-address-del">
91
- <Btn
92
- thin
93
- @click="deleteCandidate = i"
94
- icon="delete"
95
- color="gray"
96
- />
97
- </div>
98
- </div>
99
- <Btn
100
- class="add-btn"
101
- flat
102
- thin
103
- @click="val.push({})"
104
- >
105
- {{ formPlaceholders?.add }} {{ context?.label }}
106
- </Btn>
107
- </div>
108
- </div>
109
- </template>
110
-
111
- <script setup lang="ts">
112
- import { watch } from 'vue';
113
- // import type { BagelField } from '@bagelink/vue';
114
-
115
- import { Btn, useBagel } from '@bagelink/vue';
116
- import Checkbox from '../form/inputs/Checkbox.vue';
117
-
118
- export interface BankDetailsContext {
119
- label?: string;
120
- id?: string;
121
- value: any[];
122
- node: Record<string, any>;
123
- attrs: {
124
- formPlaceholders?: {
125
- sure?: string;
126
- delete?: string;
127
- cancel?: string;
128
- label?: string;
129
- bankName?: string;
130
- bankBranch?: string;
131
- bankAccount?: string;
132
- bankAccountHolder?: string;
133
- bankAccountHolderID?: string;
134
- bankAddress?: string;
135
- add?: string;
136
- };
137
- };
138
- }
139
- const bagel = useBagel();
140
-
141
- const props = defineProps<{
142
- context: BankDetailsContext;
143
- }>();
144
- const formPlaceholders = $computed(
145
- () => props.context?.attrs?.formPlaceholders,
146
- );
147
-
148
- let val = $ref<any[]>([]);
149
-
150
- let deleteCandidate = $ref<number>(-1);
151
-
152
- const del = (i: number) => {
153
- val.splice(i, 1);
154
- };
155
-
156
- const deleteContact = async (id: string) => {
157
- await bagel.delete(`/person/contact/${id}`);
158
- const index = val.findIndex((v) => v.id === id);
159
- deleteCandidate = -1;
160
- del(index);
161
- };
162
-
163
- const primaryHandler = (i: number, isPrimary: boolean) => {
164
- if (!isPrimary) return;
165
- val?.forEach((contact, index) => {
166
- if (index !== i) contact.primary = false;
167
- });
168
- };
169
-
170
- watch(
171
- () => props.context?.value,
172
- () => {
173
- val = props.context?.value;
174
- },
175
- { immediate: true },
176
- );
177
-
178
- watch(
179
- () => val,
180
- () => {
181
- props.context?.node.input(val);
182
- },
183
- );
184
- </script>
185
-
186
- <style>
187
- .bglform-contact-confirm {
188
- position: absolute;
189
- background: rgba(255, 255, 255, 0.5);
190
- height: 100%;
191
- width: 100%;
192
- display: flex;
193
- align-items: center;
194
- justify-content: center;
195
- gap: 0.5rem;
196
- backdrop-filter: blur(1px);
197
- }
198
- </style>
199
- <style scoped>
200
- .bglform-contact {
201
- display: flex;
202
- gap: 0.5rem;
203
- max-width: 700px;
204
- position: relative;
205
- }
206
-
207
- .bglform-contact-label {
208
- flex-basis: 140px;
209
- }
210
-
211
- .bglform-contact-address {
212
- display: flex;
213
- flex-direction: column;
214
- gap: 0.5rem;
215
- }
216
-
217
- .bglform-contact input[type="checkbox"] {
218
- width: 30px;
219
- min-width: 0;
220
- }
221
-
222
- .light.thin.flatBtn.btn {
223
- padding-left: calc(var(--btn-padding) / 4);
224
- padding-right: calc(var(--btn-padding) / 4);
225
- }
226
-
227
- .bglform-address-del {
228
- margin-top: 6px;
229
- }
230
-
231
- .bglform-contact-address-flex {
232
- display: flex;
233
- gap: 0.5rem;
234
- }
235
-
236
- .add-btn {
237
- display: flex;
238
- gap: 0.5rem;
239
- align-items: center;
240
- margin-inline-start: 1rem;
241
- }
242
-
243
- .add-btn:active {
244
- background: none !important;
245
- }
246
-
247
- .add-btn::before {
248
- content: "+";
249
- font-size: 10px;
250
- background: var(--bgl-blue-light);
251
- border-radius: 100%;
252
- height: 14px;
253
- width: 14px;
254
- display: flex;
255
- align-items: center;
256
- justify-content: center;
257
- color: var(--bgl-primary);
258
- }
259
-
260
- .add-btn:hover::before {
261
- background: var(--bgl-primary);
262
- color: var(--bgl-white);
263
- }
264
-
265
- @media screen and (max-width: 910px) {
266
- .bglform-contact-address-flex {
267
- flex-wrap: wrap;
268
- }
269
-
270
- .bglform-contact-label {
271
- min-width: 0;
272
- }
273
- }
274
- </style>
@@ -1,203 +0,0 @@
1
- <template>
2
- <div class="bagel-input">
3
- <div class="mt-1">
4
- <div
5
- class="bglform-contact mb-2"
6
- v-for="(contact, 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(contact.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="contact.primary"
32
- @update:model-value="($event) => primaryHandler(i, $event)"
33
- />
34
- <input
35
- class="bglform-contact-label"
36
- v-model="contact.label"
37
- type="text"
38
- :placeholder="formPlaceholders?.label"
39
- >
40
-
41
- <input
42
- v-model="contact.email"
43
- :placeholder="formPlaceholders?.email"
44
- v-if="context?.id === 'email'"
45
- type="email"
46
- >
47
- <input
48
- v-model="contact.phone"
49
- :placeholder="formPlaceholders?.phone"
50
- v-if="context?.id === 'phone'"
51
- type="tel"
52
- >
53
- <!-- <MaterialIcon @click="del(i)" icon="delete" class="btn-float" /> -->
54
- <Btn
55
- thin
56
- @click="deleteCandidate = i"
57
- icon="delete"
58
- color="gray"
59
- :disabled="contact.primary || val.length === 1 || deleteCandidate !== -1
60
- "
61
- />
62
- </div>
63
- <Btn
64
- class="add-btn"
65
- flat
66
- thin
67
- @click="val.push({})"
68
- >
69
- {{ formPlaceholders?.add }} {{ context?.label }}
70
- </Btn>
71
- </div>
72
- </div>
73
- </template>
74
-
75
- <script setup lang="ts">
76
- import { watch } from 'vue';
77
- // import type { BagelField } from '@bagelink/vue';
78
-
79
- import { Btn, useBagel } from '@bagelink/vue';
80
- import Checkbox from '../form/inputs/Checkbox.vue';
81
-
82
- export interface ContactArrContext {
83
- label?: string;
84
- id?: string;
85
- value: any[];
86
- node: Record<string, any>;
87
- attrs: {
88
- formPlaceholders?: {
89
- sure?: string;
90
- delete?: string;
91
- cancel?: string;
92
- label?: string;
93
- email?: string;
94
- phone?: string;
95
- add?: string;
96
- };
97
- };
98
- }
99
- const bagel = useBagel();
100
-
101
- const props = defineProps<{
102
- context: ContactArrContext;
103
- }>();
104
-
105
- const formPlaceholders = $computed(
106
- () => props.context?.attrs?.formPlaceholders,
107
- );
108
-
109
- let val = $ref<any[]>([]);
110
- let deleteCandidate = $ref<number>(-1);
111
-
112
- const del = (i: number) => {
113
- val.splice(i, 1);
114
- };
115
-
116
- const deleteContact = async (id: string) => {
117
- if (id) await bagel.delete(`/person/contact/${id}`);
118
- const index = val.findIndex((v) => v.id === id);
119
- del(index);
120
- deleteCandidate = -1;
121
- };
122
-
123
- const primaryHandler = (i: number, isPrimary: boolean) => {
124
- if (!isPrimary) return;
125
- val.forEach((contact, index) => {
126
- if (index !== i) contact.primary = false;
127
- });
128
- };
129
-
130
- watch(
131
- () => props.context?.value,
132
- () => {
133
- val = props.context?.value;
134
- },
135
- { immediate: true },
136
- );
137
-
138
- watch(
139
- () => val,
140
- () => {
141
- props.context?.node.input(val);
142
- },
143
- );
144
- </script>
145
-
146
- <style scoped>
147
- .bglform-contact {
148
- display: flex;
149
- align-items: center;
150
- gap: 0.5rem;
151
- max-width: 700px;
152
- position: relative;
153
- }
154
-
155
- .bglform-contact-label {
156
- flex-basis: 140px;
157
- }
158
-
159
- .bglform-contact input[type="checkbox"] {
160
- width: 30px;
161
- min-width: 0;
162
- }
163
-
164
- .light.thin.flatBtn.btn {
165
- padding-left: calc(var(--btn-padding) / 4);
166
- padding-right: calc(var(--btn-padding) / 4);
167
- }
168
-
169
- .add-btn {
170
- display: flex;
171
- gap: 0.5rem;
172
- align-items: center;
173
- margin-inline-start: 1rem;
174
- }
175
-
176
- .add-btn:active {
177
- background: none !important;
178
- }
179
-
180
- .add-btn::before {
181
- content: "+";
182
- font-size: 10px;
183
- background: var(--bgl-blue-light);
184
- border-radius: 100%;
185
- height: 14px;
186
- width: 14px;
187
- display: flex;
188
- align-items: center;
189
- justify-content: center;
190
- color: var(--bgl-primary);
191
- }
192
-
193
- .add-btn:hover::before {
194
- background: var(--bgl-primary);
195
- color: var(--bgl-white);
196
- }
197
-
198
- @media screen and (max-width: 910px) {
199
- .bglform-contact-label {
200
- min-width: 0;
201
- }
202
- }
203
- </style>