@bagelink/vue 0.0.158 → 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.
Files changed (88) hide show
  1. package/dist/components/Btn.vue.d.ts +2 -2
  2. package/dist/components/Btn.vue.d.ts.map +1 -1
  3. package/dist/components/Comments.vue.d.ts.map +1 -1
  4. package/dist/components/DropDown.vue.d.ts.map +1 -1
  5. package/dist/components/FileUploader.vue.d.ts +60 -0
  6. package/dist/components/FileUploader.vue.d.ts.map +1 -0
  7. package/dist/components/LangText.vue.d.ts.map +1 -1
  8. package/dist/components/NavBar.vue.d.ts.map +1 -1
  9. package/dist/components/PersonPreview.vue.d.ts +1 -1
  10. package/dist/components/PersonPreview.vue.d.ts.map +1 -1
  11. package/dist/components/PersonPreviewFormkit.vue.d.ts +1 -1
  12. package/dist/components/PersonPreviewFormkit.vue.d.ts.map +1 -1
  13. package/dist/components/RTXEditor.vue.d.ts.map +1 -1
  14. package/dist/components/TableSchema.vue.d.ts.map +1 -1
  15. package/dist/components/charts/BarChart.vue.d.ts.map +1 -1
  16. package/dist/components/dashboard/Lineart.vue.d.ts +1 -1
  17. package/dist/components/dashboard/Lineart.vue.d.ts.map +1 -1
  18. package/dist/components/form/inputs/CheckInput.vue.d.ts.map +1 -1
  19. package/dist/components/form/inputs/Checkbox.vue.d.ts.map +1 -1
  20. package/dist/components/form/inputs/PasswordInput.vue.d.ts.map +1 -1
  21. package/dist/components/formkit/AddressArray.vue.d.ts.map +1 -1
  22. package/dist/components/formkit/BankDetailsArray.vue.d.ts.map +1 -1
  23. package/dist/components/formkit/ContactArrayFormKit.vue.d.ts.map +1 -1
  24. package/dist/components/formkit/FileUploader.vue.d.ts.map +1 -1
  25. package/dist/components/formkit/MiscFields.vue.d.ts.map +1 -1
  26. package/dist/components/formkit/index.d.ts.map +1 -1
  27. package/dist/components/index.d.ts +2 -1
  28. package/dist/components/index.d.ts.map +1 -1
  29. package/dist/index.cjs +442 -269
  30. package/dist/index.mjs +442 -269
  31. package/dist/style.css +1600 -1404
  32. package/package.json +1 -1
  33. package/src/components/Btn.vue +127 -132
  34. package/src/components/Comments.vue +155 -169
  35. package/src/components/DropDown.vue +73 -77
  36. package/src/components/FileUploader.vue +133 -141
  37. package/src/components/FormKitTable.vue +191 -205
  38. package/src/components/LangText.vue +14 -14
  39. package/src/components/NavBar.vue +264 -261
  40. package/src/components/PersonPreview.vue +123 -148
  41. package/src/components/PersonPreviewFormkit.vue +124 -148
  42. package/src/components/RTXEditor.vue +91 -91
  43. package/src/components/TableSchema.vue +150 -156
  44. package/src/components/charts/BarChart.vue +212 -227
  45. package/src/components/dashboard/Lineart.vue +117 -130
  46. package/src/components/form/inputs/CheckInput.vue +90 -90
  47. package/src/components/form/inputs/Checkbox.vue +38 -41
  48. package/src/components/form/inputs/PasswordInput.vue +56 -63
  49. package/src/components/formkit/AddressArray.vue +150 -173
  50. package/src/components/formkit/BankDetailsArray.vue +175 -198
  51. package/src/components/formkit/ContactArrayFormKit.vue +124 -142
  52. package/src/components/formkit/FileUploader.vue +256 -260
  53. package/src/components/formkit/MiscFields.vue +42 -42
  54. package/src/components/formkit/Toggle.vue +97 -97
  55. package/src/components/formkit/index.ts +3 -3
  56. package/src/components/index.ts +2 -1
  57. package/src/styles/bagel.css +1 -0
  58. package/src/styles/buttons.css +5 -0
  59. package/src/styles/dark.css +46 -0
  60. package/src/styles/fonts/Ploni.css +8 -8
  61. package/src/styles/inputs.css +57 -13
  62. package/src/styles/layout.css +43 -0
  63. package/src/styles/text.css +83 -10
  64. package/src/styles/theme.css +25 -155
  65. package/src/styles/fonts/Ploni/ploni-black.eot +0 -0
  66. package/src/styles/fonts/Ploni/ploni-black.woff +0 -0
  67. package/src/styles/fonts/Ploni/ploni-black.woff2 +0 -0
  68. package/src/styles/fonts/Ploni/ploni-bold.eot +0 -0
  69. package/src/styles/fonts/Ploni/ploni-bold.woff +0 -0
  70. package/src/styles/fonts/Ploni/ploni-bold.woff2 +0 -0
  71. package/src/styles/fonts/Ploni/ploni-demibold.eot +0 -0
  72. package/src/styles/fonts/Ploni/ploni-demibold.woff +0 -0
  73. package/src/styles/fonts/Ploni/ploni-demibold.woff2 +0 -0
  74. package/src/styles/fonts/Ploni/ploni-light.eot +0 -0
  75. package/src/styles/fonts/Ploni/ploni-light.woff +0 -0
  76. package/src/styles/fonts/Ploni/ploni-light.woff2 +0 -0
  77. package/src/styles/fonts/Ploni/ploni-medium.eot +0 -0
  78. package/src/styles/fonts/Ploni/ploni-medium.woff +0 -0
  79. package/src/styles/fonts/Ploni/ploni-medium.woff2 +0 -0
  80. package/src/styles/fonts/Ploni/ploni-regular.eot +0 -0
  81. package/src/styles/fonts/Ploni/ploni-regular.woff +0 -0
  82. package/src/styles/fonts/Ploni/ploni-regular.woff2 +0 -0
  83. package/src/styles/fonts/Ploni/ploni-ultrabold.eot +0 -0
  84. package/src/styles/fonts/Ploni/ploni-ultrabold.woff +0 -0
  85. package/src/styles/fonts/Ploni/ploni-ultrabold.woff2 +0 -0
  86. package/src/styles/fonts/Ploni/ploni-ultralight.eot +0 -0
  87. package/src/styles/fonts/Ploni/ploni-ultralight.woff +0 -0
  88. package/src/styles/fonts/Ploni/ploni-ultralight.woff2 +0 -0
@@ -1,203 +1,185 @@
1
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
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 'vue';
58
+ import { watch } from "vue";
79
59
  // import type { BagelField } from '@bagelink/vue';
80
60
 
81
- import { Btn, useBagel } from '@bagelink/vue';
82
- import Checkbox from '../form/inputs/Checkbox.vue';
61
+ import { Btn, useBagel } from "@bagelink/vue";
62
+ import Checkbox from "../form/inputs/Checkbox.vue";
83
63
 
84
64
  export interface ContactArrContext {
85
- label?: string;
86
- id?: string;
87
- value: any[];
88
- node: Record<string, any>;
89
- attrs: {
90
- formPlaceholders?: {
91
- sure?: string
92
- delete?: string
93
- cancel?: string
94
- label?: string
95
- email?: string
96
- phone?: string
97
- add?: string
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
- context: ContactArrContext
84
+ context: ContactArrContext;
105
85
  }>();
106
86
 
107
- const formPlaceholders = $computed(() => props.context?.attrs?.formPlaceholders);
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
- val.splice(i, 1);
95
+ val.splice(i, 1);
114
96
  };
115
97
 
116
98
  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;
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
- if (!isPrimary) return;
125
- val.forEach((contact, index) => {
126
- if (index !== i) contact.primary = false;
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
- () => props.context?.value,
132
- () => {
133
- val = props.context?.value;
134
- },
135
- { immediate: true },
113
+ () => props.context?.value,
114
+ () => {
115
+ val = props.context?.value;
116
+ },
117
+ { immediate: true }
136
118
  );
137
119
 
138
120
  watch(
139
- () => val,
140
- () => {
141
- props.context?.node.input(val);
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
- display: flex;
149
- align-items: center;
150
- gap: 0.5rem;
151
- max-width: 700px;
152
- position: relative;
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
- flex-basis: 140px;
138
+ flex-basis: 140px;
157
139
  }
158
140
 
159
- .bglform-contact input[type='checkbox'] {
160
- width: 30px;
161
- min-width: 0;
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
- padding-left: calc(var(--btn-padding) / 4);
166
- padding-right: calc(var(--btn-padding) / 4);
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
- display: flex;
171
- gap: 0.5rem;
172
- align-items: center;
173
- margin-inline-start: 1rem;
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
- background: none !important;
159
+ background: none !important;
178
160
  }
179
161
 
180
162
  .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-blue);
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
- background: var(--bgl-blue);
195
- color: var(--bgl-white);
176
+ background: var(--bgl-primary);
177
+ color: var(--bgl-white);
196
178
  }
197
179
 
198
180
  @media screen and (max-width: 910px) {
199
- .bglform-contact-label {
200
- min-width: 0;
201
- }
181
+ .bglform-contact-label {
182
+ min-width: 0;
183
+ }
202
184
  }
203
185
  </style>