@processmaker/screen-builder 2.99.3 → 3.0.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 (48) hide show
  1. package/dist/vue-form-builder.css +1 -1
  2. package/dist/vue-form-builder.es.js +9091 -7132
  3. package/dist/vue-form-builder.es.js.map +1 -1
  4. package/dist/vue-form-builder.umd.js +53 -53
  5. package/dist/vue-form-builder.umd.js.map +1 -1
  6. package/package.json +2 -1
  7. package/src/App.vue +14 -2
  8. package/src/DataProvider.js +42 -1
  9. package/src/VariableDataTypeProperties.js +1 -1
  10. package/src/components/ClipboardButton.vue +77 -0
  11. package/src/components/CssIcon.vue +21 -0
  12. package/src/components/ScreenTemplateCard.vue +257 -0
  13. package/src/components/ScreenTemplates.vue +216 -0
  14. package/src/components/ScreenToolbar.vue +24 -2
  15. package/src/components/SelectUserGroup.vue +274 -0
  16. package/src/components/TabsBar.vue +47 -1
  17. package/src/components/accordions.js +7 -1
  18. package/src/components/editor/loop.vue +22 -1
  19. package/src/components/editor/multi-column.vue +22 -2
  20. package/src/components/editor/pagesDropdown.vue +20 -2
  21. package/src/components/index.js +7 -1
  22. package/src/components/inspector/collection-data-source.vue +200 -0
  23. package/src/components/inspector/collection-display-mode.vue +87 -0
  24. package/src/components/inspector/collection-records-list.vue +156 -0
  25. package/src/components/inspector/column-setup.vue +123 -7
  26. package/src/components/inspector/encrypted-config.vue +78 -0
  27. package/src/components/inspector/index.js +4 -0
  28. package/src/components/inspector/page-select.vue +1 -0
  29. package/src/components/renderer/file-upload.vue +136 -3
  30. package/src/components/renderer/form-collection-record-control.vue +248 -0
  31. package/src/components/renderer/form-collection-view-control.vue +236 -0
  32. package/src/components/renderer/form-masked-input.vue +194 -9
  33. package/src/components/renderer/form-record-list.vue +271 -69
  34. package/src/components/renderer/index.js +2 -0
  35. package/src/components/screen-renderer.vue +2 -0
  36. package/src/components/task.vue +2 -1
  37. package/src/components/vue-form-builder.vue +156 -22
  38. package/src/components/vue-form-renderer.vue +10 -2
  39. package/src/form-builder-controls.js +168 -21
  40. package/src/global-properties.js +8 -0
  41. package/src/main.js +60 -1
  42. package/src/mixins/Clipboard.js +153 -0
  43. package/src/mixins/ScreenBase.js +7 -1
  44. package/src/mixins/index.js +1 -0
  45. package/src/store/modules/ClipboardManager.js +79 -0
  46. package/src/store/modules/clipboardModule.js +210 -0
  47. package/src/stories/ClipboardButton.stories.js +66 -0
  48. package/src/stories/PagesDropdown.stories.js +11 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processmaker/screen-builder",
3
- "version": "2.99.3",
3
+ "version": "3.0.0",
4
4
  "scripts": {
5
5
  "dev": "VITE_COVERAGE=true vite",
6
6
  "build": "vite build",
@@ -40,6 +40,7 @@
40
40
  "moment-timezone": "^0.5.45",
41
41
  "monaco-editor": "^0.34.0",
42
42
  "scrollparent": "^2.0.1",
43
+ "uuid": "^10.0.0",
43
44
  "vue-loader": "^15.9.2",
44
45
  "vue-monaco": "^0.3.2",
45
46
  "vue-simple-uploader": "^0.7.4",
package/src/App.vue CHANGED
@@ -50,8 +50,10 @@
50
50
 
51
51
  <b-col v-if="displayBuilder && !displayPreview" class="text-right">
52
52
  <screen-toolbar
53
+ :disabled="$refs.builder?.isCurrentPageClipboard"
53
54
  @undo="$refs.builder.undo()"
54
55
  @redo="$refs.builder.redo()"
56
+ @open-templates="openTemplatesPanel"
55
57
  @open-calc="openComputedProperties"
56
58
  @open-customCss="openCustomCSS"
57
59
  @open-watchers="openWatchersPopup"
@@ -443,7 +445,9 @@ export default {
443
445
  minimap: {
444
446
  enabled: false
445
447
  }
446
- }
448
+ },
449
+ showTemplatesPanel: false,
450
+ sharedTemplatesData: null,
447
451
  };
448
452
  },
449
453
  computed: {
@@ -519,7 +523,11 @@ export default {
519
523
  });
520
524
  }
521
525
  return warnings;
522
- }
526
+ },
527
+ // Get clipboard items from Vuex store
528
+ clipboardItems() {
529
+ return this.$store.getters["clipboardModule/clipboardItems"];
530
+ },
523
531
  },
524
532
  created() {
525
533
  this.updateDataInput = debounce(this.updateDataInput, 1000);
@@ -602,6 +610,7 @@ export default {
602
610
  const savedWatchers = localStorage.getItem("savedWatchers");
603
611
  const customCSS = localStorage.getItem("customCSS");
604
612
  const computed = localStorage.getItem("computed");
613
+ const savedClipboard = localStorage.getItem("savedClipboard");
605
614
 
606
615
  if (savedConfig) {
607
616
  const config = JSON.parse(savedConfig);
@@ -696,6 +705,9 @@ export default {
696
705
  openWatchersPopup() {
697
706
  this.$refs.watchersPopup.show();
698
707
  },
708
+ openTemplatesPanel() {
709
+ this.$refs.builder.openTemplatesPanel();
710
+ },
699
711
  openComputedProperties() {
700
712
  this.$refs.computedProperties.show();
701
713
  },
@@ -231,7 +231,6 @@ export default {
231
231
  if (authParams) {
232
232
  query = `?${new URLSearchParams(authParams).toString()}`;
233
233
  }
234
-
235
234
  return query;
236
235
  },
237
236
 
@@ -296,5 +295,47 @@ export default {
296
295
  }
297
296
  throw error;
298
297
  });
298
+ },
299
+
300
+ getCollectionRecordsList(collectionId, options = null) {
301
+
302
+ return this.get(
303
+ `/collections/${collectionId}/records${this.authQueryString()}`,
304
+ options
305
+ )
306
+ .then((response) => {
307
+ const data = response ? response.data : null;
308
+ if (!data) {
309
+ throw new Error(i18next.t("No data returned"));
310
+ }
311
+ return data;
312
+ })
313
+ .catch((error) => {
314
+ if (error.response && error.response.status === 404) {
315
+ const data = { data: [] };
316
+ return [data];
317
+ }
318
+ throw error;
319
+ });
320
+ },
321
+
322
+ getCollectionRecordsView(collectionId, recordId) {
323
+ return this.get(
324
+ `/collections/${collectionId}/records/${recordId}`
325
+ )
326
+ .then((response) => {
327
+ const data = response ? response.data : null;
328
+ if (!data) {
329
+ throw new Error(i18next.t("No data returned"));
330
+ }
331
+ return data;
332
+ })
333
+ .catch((error) => {
334
+ if (error.response && error.response.status === 404) {
335
+ const data = { data: [] };
336
+ return data;
337
+ }
338
+ throw error;
339
+ });
299
340
  }
300
341
  };
@@ -30,7 +30,7 @@ function dataTypeFactory(options) {
30
30
  function dataFormatFactory() {
31
31
 
32
32
  return {
33
- type: SelectDataTypeMask,
33
+ type: 'SelectDataTypeMask',
34
34
  field: 'dataMask',
35
35
  config: {
36
36
  label: 'Data Format',
@@ -0,0 +1,77 @@
1
+ <template>
2
+ <!-- Conditionally render buttons based on clipboardContent -->
3
+ <button
4
+ v-if="isInClipboard"
5
+ class="btn btn-sm btn-outline-secondary mr-2 remove-btn"
6
+ :title="removeTitle"
7
+ @click="removeFromClipboard"
8
+ data-cy="removeFromClipboard"
9
+ >
10
+ <i class="fas fa-minus"></i>
11
+ </button>
12
+
13
+ <button
14
+ v-else
15
+ class="btn btn-sm btn-success mr-2 add-btn"
16
+ :title="addTitle"
17
+ @click="addToClipboard(index)"
18
+ data-cy="addToClipboard"
19
+ >
20
+ <i class="fas fa-plus"></i>
21
+ </button>
22
+ </template>
23
+
24
+ <script>
25
+ export default {
26
+ props: {
27
+ index: {
28
+ type: Number,
29
+ required: true,
30
+ },
31
+ config: {
32
+ type: Object,
33
+ required: true,
34
+ },
35
+ isInClipboard: {
36
+ type: Boolean,
37
+ required: true,
38
+ },
39
+ addTitle: {
40
+ type: String,
41
+ required: false,
42
+ default: 'Add to clipboard',
43
+ },
44
+ removeTitle: {
45
+ type: String,
46
+ required: false,
47
+ default: 'Remove from clipboard',
48
+ }
49
+ },
50
+
51
+
52
+ methods: {
53
+ // Method to handle adding to clipboard
54
+ addToClipboard(index) {
55
+ this.$emit('addToClipboard');
56
+ },
57
+ // Method to handle removing from clipboard
58
+ removeFromClipboard() {
59
+ this.$emit('removeFromClipboard');
60
+ },
61
+ },
62
+ };
63
+ </script>
64
+
65
+ <style scoped>
66
+ .remove-btn {
67
+ background-color: #FFFFFF;
68
+ color: #596372;
69
+ }
70
+ .remove-btn:hover {
71
+ background-color: #f8f9fa;
72
+ color: #596372;
73
+ }
74
+ .add-btn {
75
+ background-color: #0CA442;
76
+ }
77
+ </style>
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <svg width="58" height="58" viewBox="0 0 71 77" fill="none" xmlns="http://www.w3.org/2000/svg">
3
+ <rect x="34.9456" y="16.7" width="31.6" height="59.6" rx="1.8" fill="#EAF2FF" stroke="#E9ECF1" stroke-width="0.4"/>
4
+ <rect x="38.1" y="21.1" width="26.8" height="4.8" rx="1.9" fill="#CCDFFF" stroke="#E9ECF1" stroke-width="0.2"/>
5
+ <rect x="38.1" y="28.1" width="26.8" height="4.8" rx="1.9" fill="#CCDFFF" stroke="#E9ECF1" stroke-width="0.2"/>
6
+ <rect x="38.1" y="35.1" width="26.8" height="4.8" rx="1.9" fill="#CCDFFF" stroke="#E9ECF1" stroke-width="0.2"/>
7
+ <rect x="0.945605" y="16.7" width="31.6" height="59.6" rx="1.8" fill="#EAF2FF" stroke="#E9ECF1" stroke-width="0.4"/>
8
+ <rect x="3.84561" y="20.6" width="26.8" height="4.8" rx="1.9" fill="#CCDFFF" stroke="#E9ECF1" stroke-width="0.2"/>
9
+ <rect x="3.84561" y="27.6" width="26.8" height="4.8" rx="1.9" fill="#CCDFFF" stroke="#E9ECF1" stroke-width="0.2"/>
10
+ <rect x="3.84561" y="34.6" width="26.8" height="4.8" rx="1.9" fill="#CCDFFF" stroke="#E9ECF1" stroke-width="0.2"/>
11
+ <rect x="3.84561" y="41.6" width="26.8" height="4.8" rx="1.9" fill="#CCDFFF" stroke="#E9ECF1" stroke-width="0.2"/>
12
+ <rect x="3.84561" y="48.6" width="26.8" height="4.8" rx="1.9" fill="#CCDFFF" stroke="#E9ECF1" stroke-width="0.2"/>
13
+ <rect x="1.2" y="0.2" width="65.6" height="13.1882" rx="1.8" fill="#81AFFF" stroke="#E9ECF1" stroke-width="0.4"/>
14
+ </svg>
15
+ </template>
16
+
17
+ <script>
18
+ export default {
19
+ name: "CssIcon",
20
+ };
21
+ </script>
@@ -0,0 +1,257 @@
1
+ <template>
2
+ <div>
3
+ <b-card
4
+ img-top
5
+ class="mb-2 screenbuilder-template-card"
6
+ @click="showDetails"
7
+ >
8
+ <div
9
+ v-if="thumbnail"
10
+ class="thumbnail-container thumbnail-image-container"
11
+ >
12
+ <img class="thumbnail-image" :src="thumbnail" :alt="`${template.name}`"/>
13
+ </div>
14
+ <div
15
+ v-else
16
+ class="thumbnail-container thumbnail-icon-container d-flex align-items-center justify-content-center"
17
+ >
18
+ <i class="p-4 fas fa-palette thumbnail-icon"></i>
19
+ </div>
20
+ <hr class="card-divider">
21
+ <b-card-body class="p-1">
22
+ <div class="template-details">
23
+ <span class="template-name d-block pt-1">{{ template.name }}</span>
24
+ <span class="template-description d-block">{{ template.description }}</span>
25
+ </div>
26
+ <b-collapse v-model="showApplyOptions">
27
+ <b-form-checkbox-group
28
+ class="apply-options-group p-2"
29
+ v-model="selected"
30
+ name="apply-options"
31
+ >
32
+ <div class="row row-cols-3 icons-row">
33
+ <div
34
+ v-for="option in applyOptions"
35
+ :key="option.value"
36
+ class="col apply-options-container d-flex align-items-baseline flex-column"
37
+ >
38
+ <div class="icon-container">
39
+ <div v-if="option.value === 'CSS'">
40
+ <css-icon />
41
+ </div>
42
+ <div v-else>
43
+ <i :class="option.icon"></i>
44
+ </div>
45
+ </div>
46
+ <b-form-checkbox
47
+ class="option-checkbox"
48
+ :value="option.value"
49
+ >
50
+ {{ option.text }}
51
+ </b-form-checkbox>
52
+ </div>
53
+ </div>
54
+ </b-form-checkbox-group>
55
+ <hr class="bottom-card-divider">
56
+ <div class="apply-btn-container d-flex justify-content-end">
57
+ <button
58
+ type="button"
59
+ size="sm"
60
+ class="btn btn-outline-secondary card-btn"
61
+ @click="onCancel"
62
+ >
63
+ {{ $t("Cancel") }}
64
+ </button>
65
+ <button
66
+ :disabled="!selected.length"
67
+ type="button"
68
+ size="sm"
69
+ class="btn btn-primary ml-2 card-btn"
70
+ @click="applyTemplate"
71
+ >
72
+ {{ $t("Apply") }}
73
+ </button>
74
+ </div>
75
+ </b-collapse>
76
+ </b-card-body>
77
+ </b-card>
78
+
79
+ </div>
80
+ </template>
81
+
82
+ <script>
83
+ import CssIcon from './CssIcon.vue';
84
+
85
+ export default {
86
+ components: {
87
+ CssIcon,
88
+ },
89
+ mixins: [],
90
+ props: ['template', 'screenId', 'currentScreenPage'],
91
+ data() {
92
+ return {
93
+ showApplyOptions: false,
94
+ selected: [],
95
+ applyOptions: [
96
+ { text: 'CSS', value: 'CSS' },
97
+ { text: 'Fields', value: 'Fields', icon: 'fp-fields-icon' },
98
+ { text: 'Layout', value: 'Layout', icon: 'fp-layout-icon' },
99
+ ],
100
+ };
101
+ },
102
+ computed: {
103
+ thumbnail() {
104
+ if (this.template?.template_media && this.template.template_media.length > 0) {
105
+ return this.template.template_media[0].url;
106
+ } else if (this.template?.template_media?.thumbnail?.url) {
107
+ return this.template?.template_media.thumbnail.url
108
+ }
109
+ return null;
110
+ },
111
+ },
112
+ mounted() {
113
+ },
114
+ methods: {
115
+ showDetails() {
116
+ this.showApplyOptions = !this.showApplyOptions;
117
+ },
118
+ applyTemplate() {
119
+ ProcessMaker.apiClient
120
+ .post(`/template/screen/${this.template.id}/apply`, {
121
+ screenId: this.screenId,
122
+ templateOptions: this.selected,
123
+ currentScreenPage: this.currentScreenPage,
124
+ })
125
+ .then((response) => {
126
+ ProcessMaker.alert(this.$t("The template options have been applied."), "success");
127
+ window.location.reload();
128
+ })
129
+ .catch((error) => {
130
+ const errorMessage = error.response?.data?.message || error.message;
131
+ ProcessMaker.alert(errorMessage, "danger");
132
+ });
133
+ },
134
+ onCancel() {
135
+ this.showApplyOptions = false;
136
+ this.selected = [];
137
+ }
138
+ },
139
+ };
140
+ </script>
141
+
142
+ <style lang="scss" scoped>
143
+
144
+ .fp-fields-icon, .fp-layout-icon {
145
+ color: #EAF2FF;
146
+ }
147
+
148
+ .screenbuilder-template-card {
149
+ width: 225px;
150
+ margin: 8px;
151
+ border: 1px solid #D7DDE5;
152
+ border-radius: 8px;
153
+ box-shadow: 0px 3px 6px -3px rgb(0, 0, 0, 0.05), 0px 2px 4px -2px rgba(0, 0, 0, 0.05);
154
+ cursor: pointer;
155
+ }
156
+
157
+ .card-divider {
158
+ width: 100%;
159
+ margin: 0px;
160
+ background-color: #D7DDE5;
161
+ }
162
+
163
+ .thumbnail-container:hover,
164
+ .thumbnail-container.active {
165
+ border-color: #1572C2;
166
+ cursor: pointer;
167
+ }
168
+
169
+ .thumbnail-image {
170
+ width: 100%;
171
+ border-radius: 8px 8px 0px 0px;
172
+ }
173
+
174
+ .thumbnail-image-container {
175
+ border-radius: 8px;
176
+ padding: 0px !important;
177
+ background-size: contain;
178
+ background-position: center;
179
+ background-repeat: no-repeat;
180
+ }
181
+
182
+ .thumbnail-icon {
183
+ color: #CDDDEE;
184
+ font-size: 59px;
185
+ }
186
+
187
+ .template-details {
188
+ padding: 10px;
189
+ }
190
+
191
+ .template-name {
192
+ font-size: 14px;
193
+ font-weight: 600;
194
+ line-height: 20px;
195
+ color: #2F343B;
196
+ }
197
+
198
+ .template-description {
199
+ font-size: 12.5px;
200
+ font-weight: 400;
201
+ line-height: 18px;
202
+ color: #4E5663;
203
+ }
204
+
205
+ .apply-options-group {
206
+ display: flex;
207
+ align-items: center;
208
+ justify-content: space-between;
209
+ }
210
+
211
+ .icons-row {
212
+ margin-right: -5px !important;
213
+ margin-left: -5px !important;
214
+ }
215
+
216
+ .apply-options-container {
217
+ padding: 5px;
218
+ }
219
+
220
+ .apply-options-group i {
221
+ display: block;
222
+ font-size: 58px;
223
+ }
224
+
225
+ .icon-container {
226
+ display: flex;
227
+ align-items: center;
228
+ justify-content: center;
229
+ width: 66px;
230
+ height: 76px;
231
+ border: 0.7px solid #D7DDE5;
232
+ border-radius: 8px;
233
+ margin-bottom: 10px;
234
+ }
235
+
236
+ .option-checkbox {
237
+ font-size: 12px;
238
+ }
239
+
240
+ .bottom-card-divider {
241
+ width: 90%;
242
+ background-color: #E9ECF1;
243
+ margin-top: 0px;
244
+ }
245
+
246
+ .apply-btn-container {
247
+ padding: 0px 10px 10px 0px;
248
+ }
249
+
250
+ .card-btn {
251
+ font-size: 14px;
252
+ text-transform: none;
253
+ border-radius: 8px;
254
+ padding: 5px 10px;
255
+ }
256
+
257
+ </style>
@@ -0,0 +1,216 @@
1
+ <template>
2
+ <div
3
+ class="screen-templates-container"
4
+ data-cy="screen-templates-section"
5
+ >
6
+ <div class="d-flex justify-content-between">
7
+ <h6 class="pt-2">{{ $t("Select a Template") }}</h6>
8
+ <button
9
+ class="panel-close-btn"
10
+ @click="$emit('close-templates-panel')"
11
+ data-cy="close-templates-section"
12
+ >
13
+ <i class="fas fa-times"></i>
14
+ </button>
15
+ </div>
16
+ <div class="d-flex template-tabs justify-content-center">
17
+ <b-button
18
+ @click="showMyTemplates"
19
+ class="d-inline default-template-btn px-1"
20
+ :class="{ 'my-templates-selected': myTemplatesSelected }"
21
+ data-cy="my-templates-tab"
22
+ >
23
+ {{ $t("My Templates") }}
24
+ </b-button>
25
+ <b-button
26
+ @click="showSharedTemplates"
27
+ class="d-inline default-template-btn"
28
+ :class="{ 'shared-templates-selected': sharedTemplatesSelected }"
29
+ data-cy="shared-templates-tab"
30
+ >
31
+ {{ $t("Shared Templates") }}
32
+ </b-button>
33
+ </div>
34
+ <div class="d-flex justify-content-center cards-container">
35
+ <div
36
+ v-if="myTemplatesSelected"
37
+ class="d-flex justify-content-center p-0"
38
+ data-cy="my-templates-list"
39
+ >
40
+ <b-card-group>
41
+ <b-card-body
42
+ v-if="noMyTemplatesFound"
43
+ class="p-2 h-100 overflow-auto"
44
+ >
45
+ <h5>{{ $t("No templates found.") }}</h5>
46
+ </b-card-body>
47
+ <screen-template-card
48
+ v-else
49
+ v-for="template in myTemplatesData"
50
+ :key="template.id"
51
+ :template="template"
52
+ :screen-id="screenId"
53
+ :currentScreenPage="currentScreenPage"
54
+ />
55
+ </b-card-group>
56
+ </div>
57
+ <div
58
+ v-if="sharedTemplatesSelected"
59
+ class="d-flex justify-content-center p-0"
60
+ data-cy="shared-templates-list"
61
+ >
62
+ <b-card-group>
63
+ <b-card-body
64
+ v-if="noSharedTemplatesFound"
65
+ class="p-2 h-100 overflow-auto"
66
+ >
67
+ <h5>{{ $t("No templates found.") }}</h5>
68
+ </b-card-body>
69
+ <screen-template-card
70
+ v-else
71
+ v-for="template in sharedTemplatesData"
72
+ :key="template.id"
73
+ :template="template"
74
+ :screen-id="screenId"
75
+ :currentScreenPage="currentScreenPage"
76
+ />
77
+ </b-card-group>
78
+ </div>
79
+ </div>
80
+ </div>
81
+ </template>
82
+
83
+ <script>
84
+ import ScreenTemplateCard from './ScreenTemplateCard.vue';
85
+
86
+ export default {
87
+ components: {
88
+ ScreenTemplateCard,
89
+ },
90
+ props: {
91
+ screenId: {
92
+ type: Number,
93
+ required: true,
94
+ },
95
+ currentScreenPage: {
96
+ type: Number,
97
+ default: 0,
98
+ },
99
+ screenType: {
100
+ type: String,
101
+ default: 'FORM',
102
+ }
103
+ },
104
+ data() {
105
+ return {
106
+ myTemplatesData: null,
107
+ sharedTemplatesData: null,
108
+ myTemplatesSelected: true,
109
+ sharedTemplatesSelected: false,
110
+ noMyTemplatesFound: false,
111
+ noSharedTemplatesFound: false,
112
+ };
113
+ },
114
+ methods: {
115
+ showMyTemplates() {
116
+ this.myTemplatesSelected = true;
117
+ this.sharedTemplatesSelected = false;
118
+ this.fetchMyTemplates();
119
+ },
120
+ fetchMyTemplates() {
121
+ ProcessMaker.apiClient
122
+ .get(
123
+ `templates/screen?is_public=0&screen_type=${this.screenType}`,
124
+ )
125
+ .then((response) => {
126
+ this.myTemplatesData = response.data.data;
127
+ if (this.myTemplatesData.length === 0 || this.myTemplatesData === undefined) {
128
+ this.noMyTemplatesFound = true;
129
+ }
130
+ })
131
+ .catch((error) => {
132
+ console.error(error);
133
+ });
134
+ },
135
+ fetchSharedTemplates() {
136
+ ProcessMaker.apiClient
137
+ .get(
138
+ `templates/screen?is_public=1&screen_type=${this.screenType}`,
139
+ )
140
+ .then((response) => {
141
+ this.sharedTemplatesData = response.data.data;
142
+ if (this.sharedTemplatesData.length === 0 || this.sharedTemplatesData === undefined) {
143
+ this.noSharedTemplatesFound = true;
144
+ }
145
+ })
146
+ .catch((error) => {
147
+ console.error(error);
148
+ });
149
+ },
150
+ showSharedTemplates() {
151
+ this.myTemplatesSelected = false;
152
+ this.sharedTemplatesSelected = true;
153
+ this.fetchSharedTemplates();
154
+ },
155
+ },
156
+ mounted() {
157
+ this.showMyTemplates();
158
+ }
159
+ };
160
+ </script>
161
+
162
+ <style lang="scss" scoped>
163
+ .cards-container {
164
+ height: 100%;
165
+ }
166
+
167
+ .panel-close-btn {
168
+ background-color: transparent;
169
+ border: none;
170
+ color: #596372;
171
+ }
172
+
173
+ .template-tabs {
174
+ padding: 4px;
175
+ background-color: #E9ECF1;
176
+ border-radius: 8px;
177
+ margin-top: 0.5rem;
178
+ margin-bottom: 0.5rem;
179
+ }
180
+
181
+ .default-template-btn {
182
+ width: 50%;
183
+ background-color: transparent;
184
+ border: none;
185
+ color: #596372;
186
+ font-size: 12px;
187
+ padding-left: 0px;
188
+ padding-right: 0px;
189
+ text-transform: none;
190
+ }
191
+
192
+ .my-templates-selected {
193
+ background-color: #ffffff;
194
+ color: #20242A;
195
+ border-radius: 8px;
196
+ border: none;
197
+ font-weight: 600;
198
+ font-size: 12px;
199
+ padding-left: 0px;
200
+ padding-right: 0px;
201
+ box-shadow: 0px 3px 6px -3px rgb(0, 0, 0, 0.05), 0px 2px 4px -2px rgba(0, 0, 0, 0.05), 0px 1px 2px -1px rgb(0, 0, 0, 0.05), 0px 1px 0px -1px rgb(0, 0, 0, 0.05);
202
+ }
203
+
204
+ .shared-templates-selected {
205
+ background-color: #ffffff;
206
+ color: #20242A;
207
+ border-radius: 8px;
208
+ border: none;
209
+ font-weight: 600;
210
+ font-size: 12px;
211
+ padding-left: 0px;
212
+ padding-right: 0px;
213
+ box-shadow: 0px 3px 6px -3px rgb(0, 0, 0, 0.05), 0px 2px 4px -2px rgba(0, 0, 0, 0.05), 0px 1px 2px -1px rgb(0, 0, 0, 0.05), 0px 1px 0px -1px rgb(0, 0, 0, 0.05);
214
+ }
215
+
216
+ </style>