@bagelink/vue 0.0.190 → 0.0.196

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 (36) hide show
  1. package/dist/components/Btn.vue.d.ts +11 -8
  2. package/dist/components/Btn.vue.d.ts.map +1 -1
  3. package/dist/components/ListView.vue.d.ts.map +1 -1
  4. package/dist/components/form/inputs/DatePicker.vue.d.ts +4 -4
  5. package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
  6. package/dist/components/form/inputs/RadioPillsInput.vue.d.ts +31 -0
  7. package/dist/components/form/inputs/RadioPillsInput.vue.d.ts.map +1 -0
  8. package/dist/components/form/inputs/TextInput.vue.d.ts +5 -0
  9. package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
  10. package/dist/components/form/inputs/index.d.ts +1 -0
  11. package/dist/components/form/inputs/index.d.ts.map +1 -1
  12. package/dist/components/formkit/AddressArray.vue.d.ts.map +1 -1
  13. package/dist/components/formkit/BankDetailsArray.vue.d.ts.map +1 -1
  14. package/dist/components/formkit/ContactArrayFormKit.vue.d.ts.map +1 -1
  15. package/dist/index.cjs +13036 -3561
  16. package/dist/index.mjs +13037 -3562
  17. package/dist/style.css +479 -350
  18. package/dist/types/BtnOptions.d.ts +3 -2
  19. package/dist/types/BtnOptions.d.ts.map +1 -1
  20. package/dist/types/index.d.ts +1 -0
  21. package/dist/types/index.d.ts.map +1 -1
  22. package/package.json +1 -1
  23. package/src/components/Btn.vue +169 -146
  24. package/src/components/ListView.vue +0 -1
  25. package/src/components/PersonPreview.vue +1 -1
  26. package/src/components/form/inputs/DatePicker.vue +96 -80
  27. package/src/components/form/inputs/RadioPillsInput.vue +89 -0
  28. package/src/components/form/inputs/TextInput.vue +56 -11
  29. package/src/components/form/inputs/index.ts +1 -0
  30. package/src/components/formkit/AddressArray.vue +173 -150
  31. package/src/components/formkit/BankDetailsArray.vue +197 -174
  32. package/src/components/formkit/ContactArrayFormKit.vue +140 -123
  33. package/src/styles/layout.css +83 -0
  34. package/src/styles/theme.css +45 -16
  35. package/src/types/BtnOptions.ts +4 -2
  36. package/src/types/index.ts +2 -0
@@ -1,185 +1,202 @@
1
1
  <template>
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>
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>
55
73
  </template>
56
74
 
57
75
  <script setup lang="ts">
58
- import { watch } from "vue";
76
+ import { watch } from 'vue';
59
77
  // import type { BagelField } from '@bagelink/vue';
60
78
 
61
- import { Btn, useBagel } from "@bagelink/vue";
62
- import Checkbox from "../form/inputs/Checkbox.vue";
79
+ import { Btn, useBagel } from '@bagelink/vue';
80
+ import Checkbox from '../form/inputs/Checkbox.vue';
63
81
 
64
82
  export interface ContactArrContext {
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
- };
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
+ };
80
98
  }
81
99
  const bagel = useBagel();
82
100
 
83
101
  const props = defineProps<{
84
- context: ContactArrContext;
102
+ context: ContactArrContext;
85
103
  }>();
86
104
 
87
105
  const formPlaceholders = $computed(
88
- () => props.context?.attrs?.formPlaceholders
106
+ () => props.context?.attrs?.formPlaceholders,
89
107
  );
90
108
 
91
109
  let val = $ref<any[]>([]);
92
110
  let deleteCandidate = $ref<number>(-1);
93
111
 
94
112
  const del = (i: number) => {
95
- val.splice(i, 1);
113
+ val.splice(i, 1);
96
114
  };
97
115
 
98
116
  const deleteContact = async (id: string) => {
99
- if (id) await bagel.delete(`/person/contact/${id}`);
100
- const index = val.findIndex((v) => v.id === id);
101
- del(index);
102
- deleteCandidate = -1;
117
+ if (id) await bagel.delete(`/person/contact/${id}`);
118
+ const index = val.findIndex((v) => v.id === id);
119
+ del(index);
120
+ deleteCandidate = -1;
103
121
  };
104
122
 
105
123
  const primaryHandler = (i: number, isPrimary: boolean) => {
106
- if (!isPrimary) return;
107
- val.forEach((contact, index) => {
108
- if (index !== i) contact.primary = false;
109
- });
124
+ if (!isPrimary) return;
125
+ val.forEach((contact, index) => {
126
+ if (index !== i) contact.primary = false;
127
+ });
110
128
  };
111
129
 
112
130
  watch(
113
- () => props.context?.value,
114
- () => {
115
- val = props.context?.value;
116
- },
117
- { immediate: true }
131
+ () => props.context?.value,
132
+ () => {
133
+ val = props.context?.value;
134
+ },
135
+ { immediate: true },
118
136
  );
119
137
 
120
138
  watch(
121
- () => val,
122
- () => {
123
- props.context?.node.input(val);
124
- }
139
+ () => val,
140
+ () => {
141
+ props.context?.node.input(val);
142
+ },
125
143
  );
126
144
  </script>
127
145
 
128
146
  <style scoped>
129
147
  .bglform-contact {
130
- display: flex;
131
- align-items: center;
132
- gap: 0.5rem;
133
- max-width: 700px;
134
- position: relative;
148
+ display: flex;
149
+ align-items: center;
150
+ gap: 0.5rem;
151
+ max-width: 700px;
152
+ position: relative;
135
153
  }
136
154
 
137
155
  .bglform-contact-label {
138
- flex-basis: 140px;
156
+ flex-basis: 140px;
139
157
  }
140
158
 
141
159
  .bglform-contact input[type="checkbox"] {
142
- width: 30px;
143
- min-width: 0;
160
+ width: 30px;
161
+ min-width: 0;
144
162
  }
145
163
 
146
164
  .light.thin.btn-txt.btn {
147
- padding-left: calc(var(--btn-padding) / 4);
148
- padding-right: calc(var(--btn-padding) / 4);
165
+ padding-left: calc(var(--btn-padding) / 4);
166
+ padding-right: calc(var(--btn-padding) / 4);
149
167
  }
150
168
 
151
169
  .add-btn {
152
- display: flex;
153
- gap: 0.5rem;
154
- align-items: center;
155
- margin-inline-start: 1rem;
170
+ display: flex;
171
+ gap: 0.5rem;
172
+ align-items: center;
173
+ margin-inline-start: 1rem;
156
174
  }
157
175
 
158
176
  .add-btn:active {
159
- background: none !important;
177
+ background: none !important;
160
178
  }
161
179
 
162
180
  .add-btn::before {
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);
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);
173
191
  }
174
192
 
175
193
  .add-btn:hover::before {
176
- background: var(--bgl-primary);
177
- color: var(--bgl-white);
194
+ background: var(--bgl-primary);
195
+ color: var(--bgl-white);
178
196
  }
179
197
 
180
198
  @media screen and (max-width: 910px) {
181
- .bglform-contact-label {
182
- min-width: 0;
183
- }
184
- }
185
- </style>
199
+ .bglform-contact-label {
200
+ min-width: 0;
201
+ }
202
+ }</style>
@@ -47,6 +47,10 @@
47
47
  row-gap: 1rem;
48
48
  }
49
49
 
50
+ .align-items-end {
51
+ align-items: end !important;
52
+ }
53
+
50
54
  .fit-content {
51
55
  width: fit-content;
52
56
  height: fit-content;
@@ -124,6 +128,10 @@
124
128
  right: 0px;
125
129
  }
126
130
 
131
+ .position-absolute {
132
+ position: absolute;
133
+ }
134
+
127
135
  .position-relative {
128
136
  position: relative;
129
137
  }
@@ -156,6 +164,56 @@
156
164
  width: 100%;
157
165
  }
158
166
 
167
+ .w300,
168
+ .w350,
169
+ .w400,
170
+ .w450,
171
+ .w500,
172
+ .w550,
173
+ .w600,
174
+ .w650,
175
+ .w700 {
176
+ margin-left: auto;
177
+ margin-right: auto;
178
+ width: 98%;
179
+ }
180
+
181
+ .w300 {
182
+ max-width: 300px;
183
+ }
184
+
185
+ .w350 {
186
+ max-width: 350px;
187
+ }
188
+
189
+ .w400 {
190
+ max-width: 400px;
191
+ }
192
+
193
+ .w450 {
194
+ max-width: 450px;
195
+ }
196
+
197
+ .w500 {
198
+ max-width: 500px;
199
+ }
200
+
201
+ .w550 {
202
+ max-width: 550px;
203
+ }
204
+
205
+ .w600 {
206
+ max-width: 600px;
207
+ }
208
+
209
+ .w650 {
210
+ max-width: 650px;
211
+ }
212
+
213
+ .w650 {
214
+ max-width: 700px;
215
+ }
216
+
159
217
  .gap-1 {
160
218
  gap: 0.25rem;
161
219
  }
@@ -279,6 +337,14 @@
279
337
  padding-bottom: 2rem;
280
338
  }
281
339
 
340
+ .pb-3 {
341
+ padding-bottom: 3rem;
342
+ }
343
+
344
+ .pb-025 {
345
+ padding-bottom: 0.25rem;
346
+ }
347
+
282
348
  .pt-1 {
283
349
  padding-top: 1rem;
284
350
  }
@@ -287,6 +353,14 @@
287
353
  padding-top: 2rem;
288
354
  }
289
355
 
356
+ .pt-3 {
357
+ padding-top: 3rem;
358
+ }
359
+
360
+ .pt-025 {
361
+ padding-top: 0.25rem;
362
+ }
363
+
290
364
 
291
365
  .flex {
292
366
  display: flex;
@@ -308,4 +382,13 @@
308
382
 
309
383
  .space-between {
310
384
  justify-content: space-between;
385
+ }
386
+
387
+ label,
388
+ .label {
389
+ display: block;
390
+ font-size: var(--input-font-size);
391
+ margin-bottom: 2px;
392
+ line-height: 1.3;
393
+ color: var(--label-color);
311
394
  }
@@ -7,6 +7,7 @@
7
7
  :root {
8
8
  --bgl-primary: #2E5BFF;
9
9
  --bgl-primary-tint: #2E5BFF80;
10
+ --bgl-primary-light: #eef6ff;
10
11
 
11
12
  --bgl-blue-20: rgba(46, 91, 255, 20%);
12
13
  --bgl-blue-dark: #191c30;
@@ -62,6 +63,11 @@
62
63
  line-height: 1rem;
63
64
  }
64
65
 
66
+ ::-moz-selection {
67
+ color: var(--bgl-white);
68
+ background: var(--bgl-blue-dark);
69
+ }
70
+
65
71
  ::selection {
66
72
  color: var(--bgl-white);
67
73
  background: var(--bgl-blue-dark);
@@ -82,16 +88,17 @@
82
88
  text-align: center;
83
89
  font-weight: 600;
84
90
  font-size: 20px;
85
- margin-top: 0;
91
+ margin-top: 0.5rem;
86
92
  margin-bottom: 20px;
87
93
  width: 100%;
88
- padding-inline-end: 40px;
94
+ -webkit-padding-end: 40px;
95
+ padding-inline-end: 40px;
89
96
  }
90
97
 
91
98
  .modal-footer {
92
99
  gap: 1rem;
93
100
  display: flex;
94
- justify-content: space-around;
101
+ justify-content: space-between;
95
102
  }
96
103
 
97
104
  .formkit-actions .formkit-wrapper {
@@ -170,7 +177,8 @@ body {
170
177
  }
171
178
 
172
179
  .login-card .forgot-password:active {
173
- filter: brightness(70%);
180
+ -webkit-filter: brightness(70%);
181
+ filter: brightness(70%);
174
182
  color: var(--bgl-primary);
175
183
  }
176
184
 
@@ -191,13 +199,16 @@ body {
191
199
  }
192
200
 
193
201
  .tabs {
194
- column-gap: 1rem;
202
+ -moz-column-gap: 1rem;
203
+ column-gap: 1rem;
195
204
  margin-top: 20px;
196
205
  margin-bottom: -2rem;
197
206
  border-top: 1px solid var(--border-color);
198
207
  width: calc(100% + 4rem);
199
- margin-inline-start: -2rem;
200
- padding-inline-start: 2rem;
208
+ -webkit-margin-start: -2rem;
209
+ margin-inline-start: -2rem;
210
+ -webkit-padding-start: 2rem;
211
+ padding-inline-start: 2rem;
201
212
  overflow: auto;
202
213
  display: flex;
203
214
  }
@@ -233,7 +244,8 @@ body {
233
244
  }
234
245
 
235
246
  .tab:active {
236
- filter: brightness(70%);
247
+ -webkit-filter: brightness(70%);
248
+ filter: brightness(70%);
237
249
  }
238
250
 
239
251
  .router-tab {
@@ -259,7 +271,8 @@ body {
259
271
  }
260
272
 
261
273
  .router-tab:active {
262
- filter: brightness(70%);
274
+ -webkit-filter: brightness(70%);
275
+ filter: brightness(70%);
263
276
  }
264
277
 
265
278
  .pill {
@@ -317,6 +330,8 @@ body {
317
330
 
318
331
  .list-item {
319
332
  padding: 0.5rem 1rem;
333
+ min-height: -webkit-fit-content;
334
+ min-height: -moz-fit-content;
320
335
  min-height: fit-content;
321
336
  margin: 0.25rem 0;
322
337
  border-radius: 10px;
@@ -342,7 +357,8 @@ body {
342
357
  }
343
358
 
344
359
  .list-item:active {
345
- filter: var(--bgl-hover-filter);
360
+ -webkit-filter: var(--bgl-hover-filter);
361
+ filter: var(--bgl-hover-filter);
346
362
  }
347
363
 
348
364
  .entity-container {
@@ -351,10 +367,12 @@ body {
351
367
  /* grid-template-columns: 2fr 0fr; */
352
368
  grid-template-columns: minmax(300px, 1fr) 3fr;
353
369
  grid-gap: 1rem;
354
- column-gap: 1rem;
370
+ -moz-column-gap: 1rem;
371
+ column-gap: 1rem;
355
372
  grid-template-rows: 1fr;
356
373
  grid-template-areas: "list-view detail-view";
357
374
  transition: grid-template-columns 0.4s cubic-bezier(0.79, 0.01, 0.34, 0.99);
375
+ transition: grid-template-columns 0.4s cubic-bezier(0.79, 0.01, 0.34, 0.99), -ms-grid-columns 0.4s cubic-bezier(0.79, 0.01, 0.34, 0.99);
358
376
  transition: all 0.5s cubic-bezier(0.79, 0.01, 0.34, 0.99);
359
377
  }
360
378
 
@@ -407,6 +425,7 @@ body {
407
425
  display: grid;
408
426
  height: 100%;
409
427
  overflow: hidden;
428
+ grid-template-rows: -webkit-max-content 1fr;
410
429
  grid-template-rows: max-content 1fr;
411
430
  gap: 1rem;
412
431
  }
@@ -428,11 +447,13 @@ body {
428
447
  .list-logo {
429
448
  width: 50px;
430
449
  aspect-ratio: 1;
431
- object-fit: contain;
450
+ -o-object-fit: contain;
451
+ object-fit: contain;
432
452
  line-height: 1;
433
453
  }
434
454
 
435
455
  .list-content {
456
+ grid-auto-rows: -webkit-max-content;
436
457
  grid-auto-rows: max-content;
437
458
  overflow-y: auto;
438
459
  }
@@ -446,6 +467,7 @@ body {
446
467
  }
447
468
 
448
469
  .DonationsDashbored .tabs-top {
470
+ position: -webkit-sticky;
449
471
  position: sticky;
450
472
  padding-top: 1rem;
451
473
  inset-inline-start: 0;
@@ -480,6 +502,7 @@ body {
480
502
  grid-template-areas: "list-header""list-content";
481
503
  grid-template-columns: 1fr;
482
504
  overflow-y: auto;
505
+ grid-template-rows: -webkit-max-content 1fr;
483
506
  grid-template-rows: max-content 1fr;
484
507
  transition: var(--transition);
485
508
  }
@@ -558,12 +581,15 @@ body {
558
581
  }
559
582
 
560
583
  .tabs {
561
- column-gap: 10px;
584
+ -moz-column-gap: 10px;
585
+ column-gap: 10px;
562
586
  margin-top: 10px;
563
587
  margin-bottom: -15px;
564
588
  box-sizing: border-box;
565
- margin-inline-start: -1rem;
566
- padding-inline-start: 1rem;
589
+ -webkit-margin-start: -1rem;
590
+ margin-inline-start: -1rem;
591
+ -webkit-padding-start: 1rem;
592
+ padding-inline-start: 1rem;
567
593
  max-width: calc(100vw - 2rem);
568
594
  }
569
595
 
@@ -593,6 +619,8 @@ body {
593
619
  }
594
620
 
595
621
  .detail-section {
622
+ height: -webkit-fit-content;
623
+ height: -moz-fit-content;
596
624
  height: fit-content;
597
625
  }
598
626
 
@@ -607,6 +635,7 @@ body {
607
635
  font-size: 1.25em;
608
636
  margin-bottom: 1rem;
609
637
  font-weight: 400;
610
- margin-inline-start: 0.5rem;
638
+ -webkit-margin-start: 0.5rem;
639
+ margin-inline-start: 0.5rem;
611
640
  }
612
641
  }
@@ -1,8 +1,9 @@
1
- import type { MaterialIcons } from './materialIcons';
1
+ import type { ThemeType, MaterialIcons } from '.';
2
2
 
3
3
  export interface BtnOptions {
4
4
  onClick?: () => void;
5
- color?: 'light' | 'red' | 'gray' | 'black' | 'blue';
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
  }
@@ -4,3 +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
+
8
+ export type ThemeType = 'light' | 'red' | 'gray' | 'gray-light' | 'black' | 'green';