@bagelink/vue 0.0.25 → 0.0.35

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 (82) hide show
  1. package/package.json +34 -9
  2. package/src/components/Btn.vue +221 -0
  3. package/src/components/Comments.vue +284 -0
  4. package/src/components/ContactArray.vue +142 -0
  5. package/src/components/ContactSubmissions.vue +45 -0
  6. package/src/components/DataPreview.vue +85 -0
  7. package/src/components/DropDown.vue +122 -0
  8. package/src/components/FileUploader.vue +353 -0
  9. package/src/components/FormKitTable.vue +299 -0
  10. package/src/components/FormSchema.vue +79 -0
  11. package/src/components/LangText.vue +32 -0
  12. package/src/components/ListItem.vue +20 -0
  13. package/src/components/ListView.vue +54 -0
  14. package/src/components/MaterialIcon.vue +19 -0
  15. package/src/components/Modal.vue +62 -0
  16. package/src/components/ModalForm.vue +109 -0
  17. package/src/components/NavBar.vue +353 -0
  18. package/src/components/PageTitle.vue +17 -0
  19. package/src/components/PersonPreview.vue +203 -0
  20. package/src/components/PersonPreviewFormkit.vue +205 -0
  21. package/src/components/RTXEditor.vue +151 -0
  22. package/src/components/RouterWrapper.vue +17 -0
  23. package/src/components/TabbedLayout.vue +83 -0
  24. package/src/components/TableSchema.vue +248 -0
  25. package/src/components/TopBar.vue +5 -0
  26. package/src/components/charts/BarChart.vue +316 -0
  27. package/src/components/dashboard/Lineart.vue +197 -0
  28. package/src/components/form/ItemRef.vue +45 -0
  29. package/src/components/form/MaterialIcon.vue +19 -0
  30. package/src/components/form/PlainInputField.vue +79 -0
  31. package/src/components/form/inputs/CheckInput.vue +143 -0
  32. package/src/components/form/inputs/Checkbox.vue +77 -0
  33. package/src/components/form/inputs/ColorPicker.vue +47 -0
  34. package/src/components/form/inputs/CurrencyInput.vue +137 -0
  35. package/src/components/form/inputs/DateInput.vue +55 -0
  36. package/src/components/form/inputs/DatetimeInput.vue +50 -0
  37. package/src/components/form/inputs/DurationInput.vue +55 -0
  38. package/src/components/form/inputs/DynamicLinkField.vue +142 -0
  39. package/src/components/form/inputs/EmailInput.vue +57 -0
  40. package/src/components/form/inputs/FloatInput.vue +52 -0
  41. package/src/components/form/inputs/IntInput.vue +53 -0
  42. package/src/components/form/inputs/JSONInput.vue +55 -0
  43. package/src/components/form/inputs/LinkField.vue +300 -0
  44. package/src/components/form/inputs/Password.vue +91 -0
  45. package/src/components/form/inputs/PasswordInput.vue +92 -0
  46. package/src/components/form/inputs/PlainText.vue +63 -0
  47. package/src/components/form/inputs/ReadOnlyInput.vue +28 -0
  48. package/src/components/form/inputs/RichTextEditor.vue +56 -0
  49. package/src/components/form/inputs/SelectField.vue +258 -0
  50. package/src/components/form/inputs/TableField.vue +319 -0
  51. package/src/components/form/inputs/TextArea.vue +79 -0
  52. package/src/components/form/inputs/TextInput.vue +63 -0
  53. package/src/components/form/inputs/index.ts +16 -0
  54. package/src/components/formkit/AddressArray.vue +240 -0
  55. package/src/components/formkit/BankDetailsArray.vue +265 -0
  56. package/src/components/formkit/ContactArrayFormKit.vue +192 -0
  57. package/src/components/formkit/FileUploader.vue +391 -0
  58. package/src/components/formkit/MiscFields.vue +74 -0
  59. package/src/components/formkit/Toggle.vue +164 -0
  60. package/src/components/formkit/index.ts +29 -0
  61. package/src/components/index.ts +20 -0
  62. package/src/components/whatsapp/form/MsgTemplate.vue +227 -0
  63. package/src/components/whatsapp/form/TextVariableExamples.vue +79 -0
  64. package/src/components/whatsapp/interfaces.ts +58 -0
  65. package/src/index.ts +1 -26
  66. package/src/plugins/bagel.ts +26 -0
  67. package/src/styles/modal.css +90 -0
  68. package/src/types/BagelField.ts +57 -0
  69. package/src/types/BtnOptions.ts +14 -0
  70. package/src/types/Person.ts +51 -0
  71. package/src/types/file.ts +12 -0
  72. package/src/types/index.ts +4 -0
  73. package/src/types/materialIcons.d.ts +3005 -0
  74. package/src/utils/index.ts +62 -0
  75. package/src/utils/modal.ts +101 -0
  76. package/src/utils/objects.ts +81 -0
  77. package/src/utils/strings.ts +36 -0
  78. package/dist/index.cjs +0 -23
  79. package/dist/index.d.cts +0 -12
  80. package/dist/index.d.mts +0 -12
  81. package/dist/index.d.ts +0 -12
  82. package/dist/index.mjs +0 -19
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.25",
4
+ "version": "0.0.35",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -42,22 +42,47 @@
42
42
  "dist",
43
43
  "src"
44
44
  ],
45
- "dependencies": {
46
- "vue": "^3.3.8"
47
- },
45
+ "dependencies": {},
48
46
  "devDependencies": {
49
- "@bagelink/sdk": "0.0.25"
47
+ "vue": "^3.3.8",
48
+ "vue-router": "^4.2.5",
49
+ "vue3-charts": "^1.1.33",
50
+ "@formkit/vue": "^1.3.0",
51
+ "@formkit/core": "1.3.0",
52
+ "vue-draggable-next": "^2.2.1",
53
+ "prosemirror-commands": "^1.5.2",
54
+ "prosemirror-history": "^1.3.2",
55
+ "prosemirror-keymap": "^1.2.2",
56
+ "prosemirror-model": "^1.19.3",
57
+ "prosemirror-schema-basic": "^1.2.2",
58
+ "prosemirror-state": "^1.4.3",
59
+ "prosemirror-view": "^1.32.4",
60
+ "@vue-macros/reactivity-transform": "^0.4.0",
61
+ "@bagelink/sdk": "0.0.35"
50
62
  },
51
63
  "peerDependencies": {
52
64
  "@bagelink/sdk": "*"
53
65
  },
66
+ "optionalDependencies": {
67
+ "vue-router": "^4.2.5",
68
+ "vue3-charts": "^1.1.33",
69
+ "@formkit/vue": "^1.3.0",
70
+ "@formkit/core": "1.3.0",
71
+ "vue-draggable-next": "^2.2.1",
72
+ "prosemirror-commands": "^1.5.2",
73
+ "prosemirror-history": "^1.3.2",
74
+ "prosemirror-keymap": "^1.2.2",
75
+ "prosemirror-model": "^1.19.3",
76
+ "prosemirror-schema-basic": "^1.2.2",
77
+ "prosemirror-state": "^1.4.3",
78
+ "prosemirror-view": "^1.32.4"
79
+ },
54
80
  "publishConfig": {
55
81
  "access": "public"
56
82
  },
57
83
  "scripts": {
58
- "dev": "unbuild --stub",
59
- "build": "unbuild",
60
- "start": "tsx src/index.ts",
61
- "watch": "tsx watch src/index.ts"
84
+ "dev": "tsx watch src/index.ts",
85
+ "build": "tsc --noEmit && vite build",
86
+ "start": "tsx src/index.ts"
62
87
  }
63
88
  }
@@ -0,0 +1,221 @@
1
+ <template>
2
+ <component
3
+ :is="to?'router-link':is" :to="to" :type="type" :role="role" :disabled="disabled" :class="{
4
+ [props.color]: true,
5
+ 'btn-icon': icon && !slots['default'] && !value,
6
+ btn: !icon || slots['default'] || value,
7
+ thin: thin,
8
+ round: round,
9
+ 'btn-txt': flat,
10
+ }"
11
+ >
12
+ <div class="loading" v-if="loading" />
13
+ <div v-else class="btn-flex">
14
+ <MaterialIcon v-if="icon" :icon="icon" />
15
+ <slot />
16
+ <template v-if="!slots['default'] && value">
17
+ {{ value }}
18
+ </template>
19
+ <MaterialIcon v-if="props['icon.end']" :icon="props['icon.end']" />
20
+ </div>
21
+ </component>
22
+ </template>
23
+
24
+ <script setup lang="ts">
25
+ import { useSlots } from 'vue';
26
+
27
+ const slots = useSlots();
28
+ import { MaterialIcons } from '@/types/materialIcons';
29
+ import { MaterialIcon } from '@/components';
30
+
31
+ const props = withDefaults(
32
+ defineProps<{
33
+ disabled?: boolean;
34
+ icon?: MaterialIcons;
35
+ 'icon.end'?: MaterialIcons;
36
+ color?: 'light' | 'red' | 'gray' | 'gray-light' | 'black' | 'blue' | 'green';
37
+ flat?: boolean;
38
+ thin?: boolean;
39
+ type?: 'button' | 'submit' | 'reset';
40
+ loading?: boolean;
41
+ role?: string;
42
+ value?: string;
43
+ to?: string;
44
+ round?: boolean;
45
+ is?: string;
46
+ }>(),
47
+ {
48
+ loading: false,
49
+ round: false,
50
+ color: 'gray',
51
+ disabled: false,
52
+ type: 'button',
53
+ role: 'button',
54
+ is: 'button',
55
+ },
56
+ );
57
+ </script>
58
+
59
+ <style scoped>
60
+ .loading {
61
+ border: 1px solid var(--bgl-white);
62
+ border-bottom: 2px solid var(--bgl-white);
63
+ animation: spin 1s linear infinite;
64
+ border-radius: 100px;
65
+ width: 1rem;
66
+ height: 1rem;
67
+ margin: auto;
68
+ }
69
+
70
+ @keyframes spin {
71
+ 0% {
72
+ transform: rotate(0deg);
73
+ }
74
+
75
+ 100% {
76
+ transform: rotate(360deg);
77
+ }
78
+ }
79
+
80
+ .btn-icon {
81
+ height: var(--btn-height);
82
+ width: var(--btn-height);
83
+ border-radius: 100%;
84
+ font-size: 1rem;
85
+ background: var(--bgl-blue);
86
+ color: var(--bgl-white);
87
+ flex-shrink: 0;
88
+ transition: var(--bgl-transition);
89
+ }
90
+
91
+ .btn {
92
+ background: var(--bgl-blue);
93
+ color: var(--bgl-white);
94
+ padding-left: var(--btn-padding);
95
+ padding-right: var(--btn-padding);
96
+ transition: var(--bgl-transition);
97
+ text-decoration: none;
98
+ }
99
+
100
+ .btn[disabled='true'] {
101
+ opacity: 0.5;
102
+ cursor: not-allowed;
103
+ }
104
+
105
+ .btn-flex {
106
+ display: flex;
107
+ align-items: center;
108
+ gap: 0.5rem;
109
+ justify-content: center;
110
+ }
111
+
112
+ .btn .icon-font {
113
+ font-size: calc(var(--input-font-size) * 1.3);
114
+ }
115
+
116
+ .btn:hover,
117
+ .btn-icon:hover {
118
+ filter: var(--bgl-hover-filter);
119
+ }
120
+
121
+ .btn:active,
122
+ .btn-icon:active {
123
+ filter: var(--bgl-active-filter);
124
+ }
125
+
126
+ .btn.red,
127
+ .btn-icon.red {
128
+ background: var(--bgl-red);
129
+ }
130
+
131
+ .btn.light,
132
+ .btn-icon.light {
133
+ background: var(--bgl-blue-light);
134
+ color: var(--bgl-blue);
135
+ }
136
+
137
+ .btn.gray,
138
+ .btn-icon.gray {
139
+ background: var(--bgl-gray-light);
140
+ color: var(--bgl-black);
141
+ }
142
+
143
+ .btn.green,
144
+ .btn-icon.green {
145
+ background: var(--bgl-green);
146
+ color: var(--bgl-white)
147
+ }
148
+
149
+ .btn.gray-light,
150
+ .btn-icon.gray-light {
151
+ background: var(--bgl-gray-light);
152
+ color: var(--bgl-gray);
153
+ }
154
+
155
+ .btn.black,
156
+ .btn-icon.black {
157
+ background: var(--bgl-black);
158
+ }
159
+
160
+ .btn.btn-txt {
161
+ color: var(--bgl-blue);
162
+ padding-left: var(--btn-padding);
163
+ padding-right: var(--btn-padding);
164
+ background: transparent;
165
+ }
166
+
167
+ .btn-icon.btn-txt {
168
+ color: var(--bgl-blue);
169
+ background: transparent;
170
+ }
171
+
172
+ .btn.btn-txt:hover,
173
+ .btn-icon.btn-txt:hover {
174
+ filter: var(--bgl-active-filter);
175
+ }
176
+
177
+ .btn.btn-txt:active,
178
+ .btn-icon.btn-txt:active {
179
+ background: var(--bgl-white);
180
+ filter: var(--bgl-hover-filter);
181
+ }
182
+
183
+ .btn.btn-txt.red,
184
+ .btn-icon.btn-txt.red {
185
+ color: var(--bgl-red);
186
+ }
187
+
188
+ .btn.btn-txt.light,
189
+ .btn-icon.btn-txt.light {
190
+ color: var(--bgl-blue-tint);
191
+ }
192
+
193
+ .btn.btn-txt.black,
194
+ .btn-icon.btn-txt.black {
195
+ color: var(--bgl-black);
196
+ }
197
+
198
+ .btn.btn-txt.gray,
199
+ .btn-icon.btn-txt.gray {
200
+ color: var(--bgl-gray);
201
+ }
202
+
203
+ .btn.thin {
204
+ padding-left: calc(var(--btn-padding) / 2);
205
+ padding-right: calc(var(--btn-padding) / 2);
206
+ }
207
+
208
+ .btn.round {
209
+ border-radius: calc(var(--btn-border-radius) * 2);
210
+ }
211
+
212
+ .btn-icon.thin {
213
+ height: calc(var(--btn-height) / 1.5);
214
+ width: calc(var(--btn-height) / 1.5);
215
+ line-height: 1;
216
+ }
217
+
218
+ [dir='rtl'] .icon-font {
219
+ transform: rotateY(180deg);
220
+ }
221
+ </style>
@@ -0,0 +1,284 @@
1
+ <template>
2
+ <div class="comments-wrap">
3
+ <div class="comment-list">
4
+ <div
5
+ :class="{
6
+ editable: editComment?.id === comment.id,
7
+ me: comment.sender.id === bagel.auth.user?.id,
8
+ }"
9
+ class="comment"
10
+ v-for="comment in comments"
11
+ :key="comment.id"
12
+ >
13
+ <div class="comment-top">
14
+ <div class="comment-owner">
15
+ {{ comment.sender.first_name }} {{ comment.sender.last_name }}
16
+ </div>
17
+ <div class="comment-time">
18
+ {{ comment.updated_at.split('T')[0] }}
19
+ </div>
20
+ <div class="comment-actions">
21
+ <MaterialIcon
22
+ :size="1"
23
+ class="edit"
24
+ icon="edit"
25
+ @click="editComment = comment"
26
+ />
27
+ <MaterialIcon
28
+ :size="1.2"
29
+ class="delete"
30
+ icon="delete"
31
+ @click="deleteComment(comment.id)"
32
+ />
33
+ <MaterialIcon
34
+ :size="1.2"
35
+ class="save"
36
+ icon="save"
37
+ @click="save"
38
+ />
39
+ </div>
40
+ </div>
41
+ <RTXEditor
42
+ v-model="editComment.body_html"
43
+ @keydown.meta.enter="save"
44
+ v-if="editComment !== null && editComment?.id === comment.id"
45
+ />
46
+ <div
47
+ class="editor-wrapper"
48
+ v-html="comment.body_html"
49
+ v-else
50
+ />
51
+ </div>
52
+ </div>
53
+ <div class="new-comment">
54
+ <RTXEditor
55
+ class="comment-input"
56
+ v-model="bodyHtml"
57
+ @keydown.meta.enter="newComment"
58
+ />
59
+ <Btn
60
+ icon="send"
61
+ @click="newComment"
62
+ >
63
+ {{ form.send }}
64
+ </Btn>
65
+ </div>
66
+ </div>
67
+ </template>
68
+
69
+ <script lang="ts" setup>
70
+ import { onMounted, watch } from 'vue';
71
+ import { useBagel } from 'src/plugins/bagel';
72
+ import { Btn, MaterialIcon, RTXEditor } from '@/components';
73
+
74
+ const bagel = useBagel();
75
+ let comments = $ref<Record<string, any>>([]);
76
+
77
+ interface Comment {
78
+ id: string;
79
+ ref_table: string;
80
+ ref_id: string;
81
+ body_html: string;
82
+ type: 'Comment';
83
+ created_at: string;
84
+ updated_at: string;
85
+ }
86
+ let editComment = $ref<Comment | null>(null);
87
+
88
+ const props = defineProps<{
89
+ ref_table: string;
90
+ ref_id: string;
91
+ form: {
92
+ send: string;
93
+ }
94
+ }>();
95
+
96
+ const fetchData = async () => {
97
+ comments = [];
98
+ comments = (await bagel.get(
99
+ `comments/${props.ref_table}/${props.ref_id}`,
100
+ ));
101
+ };
102
+
103
+ onMounted(fetchData);
104
+ watch(() => props.ref_id, fetchData);
105
+
106
+ const save = async () => {
107
+ if (!editComment) return;
108
+ await bagel.put(`comments/${editComment.id}`, editComment);
109
+ void fetchData(); // TODO: Nati: should be awaited?
110
+ editComment = null;
111
+ };
112
+
113
+ let bodyHtml = $ref('');
114
+
115
+ const deleteComment = async (id: string) => {
116
+ await bagel.delete(`comments/${id}`);
117
+ void fetchData(); // TODO: Nati: should be awaited?
118
+ };
119
+
120
+ const newComment = async () => {
121
+ if (!bodyHtml) return;
122
+ await bagel.post('comments', {
123
+ ref_table: props.ref_table,
124
+ ref_id: props.ref_id,
125
+ body_html: bodyHtml,
126
+ type: 'Comment',
127
+ });
128
+ bodyHtml = '';
129
+ void fetchData(); // TODO: Nati: should be awaited?
130
+ };
131
+ </script>
132
+
133
+ <style scoped>
134
+ .comments-wrap {
135
+ display: grid;
136
+ grid-template-rows: 1fr 40px;
137
+ height: 100%;
138
+ position: relative;
139
+ gap: 0.5rem;
140
+ }
141
+
142
+ .comments-wrap p {
143
+ margin: 0;
144
+ }
145
+
146
+ .comments-wrap::before {
147
+ content: '';
148
+ inset-inline-start: 10px;
149
+ top: 0px;
150
+ width: 1px;
151
+ background: var(--border-color);
152
+ position: absolute;
153
+ bottom: 10px;
154
+ }
155
+
156
+ .comment-top {
157
+ display: flex;
158
+ align-items: baseline;
159
+ flex-wrap: wrap;
160
+ position: relative;
161
+ margin-inline-start: 1rem;
162
+ }
163
+
164
+ .comment-list {
165
+ padding: 0.5rem;
166
+ height: 100%;
167
+ overflow: auto;
168
+ }
169
+
170
+ .comment {
171
+ margin-bottom: 1rem;
172
+ }
173
+
174
+ .comment-owner {
175
+ font-size: 14px;
176
+ margin-inline-end: 0.5rem;
177
+ color: var(--bgl-gray);
178
+ }
179
+
180
+ .comment-owner::before {
181
+ content: '';
182
+ height: 12px;
183
+ width: 12px;
184
+ border-radius: 100%;
185
+ position: absolute;
186
+ background: var(--bgl-gray);
187
+ inset-inline-start: -1.2rem;
188
+ top: 0.2rem;
189
+ }
190
+
191
+ .me .comment-owner {
192
+ color: var(--bgl-blue);
193
+ }
194
+
195
+ .me .comment-owner::before {
196
+ background: var(--bgl-blue);
197
+ }
198
+
199
+ .comment-time {
200
+ color: var(--bgl-gray);
201
+ font-size: 10px;
202
+ white-space: nowrap;
203
+ }
204
+
205
+ .comment-actions {
206
+ background: red;
207
+ line-height: 0;
208
+ display: flex;
209
+ padding: 0 0.5rem;
210
+ flex-grow: 1;
211
+ gap: 0.25rem;
212
+ }
213
+
214
+ .comment .comment-actions .edit {
215
+ opacity: 0;
216
+ }
217
+
218
+ .comment-actions .edit {
219
+ margin-inline-end: auto;
220
+ }
221
+
222
+ .comment.me:hover .comment-actions .edit {
223
+ opacity: 0.4;
224
+ }
225
+
226
+ .comment-actions>div {
227
+ transition: all 200ms ease;
228
+ cursor: pointer;
229
+ opacity: 0.6;
230
+ }
231
+
232
+ .comment-actions>div:hover {
233
+ color: var(--bgl-blue);
234
+ }
235
+
236
+ .comment-actions .delete:hover {
237
+ color: var(--bgl-red);
238
+ }
239
+
240
+ .comment-actions>div:active {
241
+ filter: brightness(70%);
242
+ }
243
+
244
+ .icon-font.delete,
245
+ .icon-font.save {
246
+ display: none;
247
+ }
248
+
249
+ .editable .icon-font.delete,
250
+ .editable .icon-font.save {
251
+ display: block;
252
+ }
253
+
254
+ /* .editor-wrapper { */
255
+ /* margin-inline-start: 0.5rem; */
256
+ /* margin-top: 0.05em; */
257
+ /* margin-bottom: 0.05em; */
258
+ /* height: 100%; */
259
+ /* padding: 0.05em 0.5em; */
260
+ /* overflow: hidden; */
261
+ /* border-radius: 10px; */
262
+ /* } */
263
+ .editable .editor-wrapper {
264
+ background-color: var(--bgl-bg);
265
+ }
266
+
267
+ .new-comment {
268
+ display: flex;
269
+ align-items: flex-end;
270
+ position: relative;
271
+ z-index: 2;
272
+ gap: 0.5rem;
273
+ font-size: 12px;
274
+ color: var(--input-color);
275
+ line-height: 1.6;
276
+ }
277
+
278
+ .comment-input {
279
+ max-height: 100px;
280
+ overflow: auto;
281
+ flex-grow: 1;
282
+ border-radius: var(--btn-border-radius);
283
+ }
284
+ </style>
@@ -0,0 +1,142 @@
1
+ <template>
2
+ <div class="bagel-input mt-2">
3
+ {{ field.label }}
4
+ <div class="mb-2 mt-1">
5
+ <div
6
+ class="bglform-contact"
7
+ v-for="(contact, i) in val"
8
+ :key="i"
9
+ >
10
+ <input
11
+ v-model="contact.email"
12
+ :placeholder="placeholders.email"
13
+ type="email"
14
+ v-if="field.id === 'email'"
15
+ >
16
+ <input
17
+ v-model="contact.phone"
18
+ :placeholder="placeholders.phone"
19
+ type="tel"
20
+ v-if="field.id === 'phone'"
21
+ >
22
+ <input
23
+ v-if="contact.email || contact.phone"
24
+ v-model="contact.label"
25
+ type="text"
26
+ :placeholder="placeholders.label"
27
+ >
28
+ <div class="bglform-contact-opt">
29
+ <!-- <input v-model="contact.primary" id="primary" type="checkbox" > -->
30
+ <CheckInput
31
+ :field="{
32
+ id: 'primary',
33
+ inputType: 'CheckInput',
34
+ label: 'primary',
35
+ }"
36
+ v-model="contact.primary"
37
+ />
38
+ <MaterialIcon
39
+ @click="del(i)"
40
+ icon="delete"
41
+ class="btn-float"
42
+ />
43
+ </div>
44
+ </div>
45
+ <Btn
46
+ color="light"
47
+ thin
48
+ @click="val.push({})"
49
+ icon="add"
50
+ >
51
+ Add
52
+ </Btn>
53
+ </div>
54
+ </div>
55
+ </template>
56
+
57
+ <script setup lang="ts">
58
+ import { ref, watch } from 'vue';
59
+ import type { BagelField } from '@/types/BagelField';
60
+ import MaterialIcon from './MaterialIcon.vue';
61
+ import Btn from './Btn.vue';
62
+ import CheckInput from '@/components/form/inputs/CheckInput.vue';
63
+
64
+ const props = withDefaults(
65
+ defineProps<{
66
+ field: BagelField;
67
+ modelValue: any;
68
+ editMode?: boolean;
69
+ small?: boolean;
70
+ placeholders: {
71
+
72
+ email: string
73
+ phone: string
74
+ label: string
75
+ }
76
+ }>(),
77
+ {
78
+ editMode: true,
79
+ small: false,
80
+ },
81
+ );
82
+
83
+ const val = ref<any[]>([]);
84
+
85
+ const del = (i: number) => {
86
+ val.value.splice(i, 1);
87
+ };
88
+
89
+ const emit = defineEmits(['update:modelValue']);
90
+
91
+ watch(
92
+ () => props.modelValue,
93
+ () => {
94
+ val.value = [...props.modelValue];
95
+ },
96
+ { immediate: true },
97
+ );
98
+
99
+ watch(
100
+ () => val,
101
+ () => {
102
+ emit('update:modelValue', val.value);
103
+ },
104
+ );
105
+ </script>
106
+ <!--
107
+ <style>
108
+ .bglform-contact {
109
+ display: grid;
110
+ grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
111
+
112
+ gap: 1rem;
113
+ position: relative;
114
+ }
115
+ .bglform-contact-opt {
116
+ display: flex;
117
+ align-items: center;
118
+ gap: 1rem;
119
+ justify-content: start;
120
+ width: 80px;
121
+ }
122
+ .bglform-contact-opt:after {
123
+ content: '';
124
+ grid-column: span 2;
125
+ }
126
+ .bagel-input.checkbox {
127
+ width: auto;
128
+ padding: 0;
129
+ min-width: 0;
130
+ }
131
+ .btn-float {
132
+ cursor: pointer;
133
+ color: var(--bgl-gray);
134
+ transition: var(--bgl-transition);
135
+ }
136
+ .btn-float:hover {
137
+ color: var(--bgl-red);
138
+ }
139
+ .btn-float:active {
140
+ filter: brightness(0.8);
141
+ }
142
+ </style> -->