@5minds/node-red-dashboard-2-processcube-dynamic-form 1.1.2 → 2.0.0-develop-5015e2-madmxd10

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.
@@ -0,0 +1,55 @@
1
+ <template>
2
+ <div style="display: flex; justify-content: space-between; width: 100%">
3
+ <div style="display: flex; gap: 8px;">
4
+ <div v-for="(action, index) in actions" :key="index">
5
+ <v-btn
6
+ v-if="action.alignment === 'left' || !action.alignment"
7
+ :key="index"
8
+ style="min-height: 36px"
9
+ :class="getActionButtonClass(action)"
10
+ :disabled="formIsFinished"
11
+ @click="actionCallback(action)"
12
+ >
13
+ {{ action.label }}
14
+ </v-btn>
15
+ </div>
16
+ </div>
17
+ <div style="display: flex; gap: 8px;">
18
+ <div v-for="(action, index) in actions" :key="index">
19
+ <v-btn
20
+ v-if="action.alignment === 'right'"
21
+ :key="index"
22
+ style="min-height: 36px"
23
+ :class="getActionButtonClass(action)"
24
+ :disabled="formIsFinished"
25
+ @click="actionCallback(action)"
26
+ >
27
+ {{ action.label }}
28
+ </v-btn>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ </template>
33
+
34
+ <script>
35
+
36
+ export default {
37
+ name: 'UIDynamicFormFooterAction',
38
+ props: {
39
+ actions: { type: Array, default () { return [] } },
40
+ actionCallback: { type: Function, default (action) {} },
41
+ formIsFinished: { type: Boolean, default () { return false } }
42
+ },
43
+ methods: {
44
+ getActionButtonClass (action) {
45
+ return action.primary === 'true' ? 'ui-dynamic-form-footer-action-primary' : 'ui-dynamic-form-footer-action-secondary'
46
+ }
47
+ }
48
+ }
49
+
50
+ </script>
51
+
52
+ <style>
53
+ /* CSS is auto scoped, but using named classes is still recommended */
54
+ @import '../stylesheets/ui-dynamic-form.css';
55
+ </style>
@@ -0,0 +1,56 @@
1
+ <template>
2
+ <div v-if="title.length > 0">
3
+ <h3 :class="typeSpecificStyling" style="display: flex; gap: 25px; align-items: center">
4
+ <svg
5
+ v-if="collapsible && !collapsed"
6
+ style="width: 25px; height: 25px; cursor: pointer;"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ viewBox="0 0 448 512"
9
+ @click="toggleCollapse"
10
+ >
11
+ <path :fill="style === 'default' ? 'white' : 'black'" d="M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"/>
12
+ </svg>
13
+ <svg
14
+ v-if="collapsible && collapsed"
15
+ style="width: 25px; height: 25px; cursor: pointer;"
16
+ xmlns="http://www.w3.org/2000/svg"
17
+ viewBox="0 0 320 512"
18
+ @click="toggleCollapse"
19
+ >
20
+ <path :fill="style === 'default' ? 'white' : 'black'" d="M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"/>
21
+ </svg>
22
+ <div :style="{width: 'fit-content', display: style === 'default' ? '' : 'flex'}">
23
+ <img v-if="titleIcon.length > 0" :src="titleIcon" style="padding-right: 16px;">
24
+ <span :style="customStyles">{{ title }}</span>
25
+ <hr v-if="style === 'default'">
26
+ </div>
27
+ </h3>
28
+ </div>
29
+ </template>
30
+
31
+ <script>
32
+
33
+ export default {
34
+ name: 'UIDynamicFormTitleText',
35
+ props: {
36
+ style: { type: String, default () { return 'default' } },
37
+ title: { type: String, default () { return '' } },
38
+ customStyles: { type: String, default () { return '' } },
39
+ collapsible: { type: Boolean, default () { return false } },
40
+ collapsed: { type: Boolean, default () { return false } },
41
+ titleIcon: { type: String, default () { return '' } },
42
+ toggleCollapse: { type: Function, default () {} }
43
+ },
44
+ computed: {
45
+ typeSpecificStyling () {
46
+ return `ui-dynamic-form-title-${this.style}`
47
+ }
48
+ }
49
+ }
50
+
51
+ </script>
52
+
53
+ <style>
54
+ /* CSS is auto scoped, but using named classes is still recommended */
55
+ @import '../stylesheets/ui-dynamic-form.css';
56
+ </style>