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