@5minds/node-red-dashboard-2-processcube-dynamic-table 2.0.1-develop-ac58f3-mccdrc9q → 2.0.1-develop-23f8bd-md5ls48x

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.
@@ -1,36 +1,52 @@
1
1
  <template>
2
- <v-data-table :headers="headers" :items="tasks" :search="search" :sort-by="sortBy" :items-per-page="itemsPerPage"
3
- :items-per-page-options="itemsPerPageOptions" @update:sort-by="updateSortBy"
4
- @update:items-per-page="updateItemsPerPage" class="full-width-table">
5
- <template v-slot:top>
6
- <v-toolbar flat class="py-2">
7
- <v-text-field class="mx-3 search-input" v-model="search" label="Search" prepend-inner-icon="mdi-magnify"
8
- variant="outlined" hide-details single-line></v-text-field>
9
- </v-toolbar>
10
- </template>
11
- <template v-slot:item.actions="{ item }">
12
- <v-container class="action-button-container">
13
- <v-container v-for="(action, index) in actions"
14
- style="padding: 0px; display: inline; width: fit-content; margin: 0px">
15
- <v-btn style="margin: 0px 2px" class="action-button" v-if="conditionCheck(action.condition, item)"
16
- :key="index" size="small" @click="actionFn(action, item)">
17
- {{ action.label }}
18
- </v-btn>
2
+ <div class="ui-dynamic-table-container">
3
+ <UIDynamicTableTitleText v-if="props.title_text && props.title_text.length > 0" :title="props.title_text"
4
+ :style="props.title_style || 'default'" :customStyles="props.title_custom_text_styling || ''"
5
+ :titleIcon="props.title_icon || ''" />
6
+ <v-data-table :headers="headers" :items="tasks" :search="search" :sort-by="sortBy"
7
+ :items-per-page="itemsPerPage" :items-per-page-options="itemsPerPageOptions" @update:sort-by="updateSortBy"
8
+ @update:items-per-page="updateItemsPerPage" class="full-width-table">
9
+ <template v-slot:top>
10
+ <v-toolbar flat class="pb-4 pt-8">
11
+ <v-text-field class="ml-3 search-input" style="margin-right: 50%;" v-model="search" label="Suchen"
12
+ prepend-inner-icon="mdi-magnify" variant="outlined" hide-details single-line></v-text-field>
13
+ </v-toolbar>
14
+ </template>
15
+ <template v-slot:header.actions>
16
+ <v-btn class="reload-button" @click="reloadData" :disabled="isReloading" size="small"
17
+ variant="outlined">
18
+ <v-icon left :class="{ 'reload-spin': isReloading }">mdi-refresh</v-icon>
19
+ </v-btn>
20
+ </template>
21
+ <template v-slot:item.actions="{ item }">
22
+ <v-container class="action-button-container">
23
+ <v-container v-for="(action, index) in actions"
24
+ style="padding: 0px; display: inline; width: fit-content; margin: 0px">
25
+ <v-btn style="margin: 0px 2px" class="action-button"
26
+ v-if="conditionCheck(action.condition, item)" :key="index" size="small"
27
+ @click="actionFn(action, item)">
28
+ {{ action.label }}
29
+ </v-btn>
30
+ </v-container>
19
31
  </v-container>
20
- </v-container>
21
- </template>
22
- <template v-slot:no-data>
23
- <v-alert text="No Data" style="margin: 12px"></v-alert>
24
- </template>
25
- </v-data-table>
32
+ </template>
33
+ <template v-slot:no-data>
34
+ <v-alert text="Keine Daten" style="margin: 12px"></v-alert>
35
+ </template>
36
+ </v-data-table>
37
+ </div>
26
38
  </template>
27
39
 
28
40
  <script>
29
41
  import { mapState } from 'vuex';
42
+ import UIDynamicTableTitleText from './TitleText.vue'
30
43
  import { debounce } from 'lodash';
31
44
 
32
45
  export default {
33
46
  name: 'UIDynamicTable',
47
+ components: {
48
+ UIDynamicTableTitleText
49
+ },
34
50
  inject: ['$socket'],
35
51
  props: {
36
52
  id: { type: String, required: true },
@@ -58,6 +74,7 @@ export default {
58
74
  actions: [],
59
75
  tasks: [],
60
76
  headers: [],
77
+ isReloading: false,
61
78
  isInitialized: false,
62
79
  sortBy: [],
63
80
  itemsPerPage: 10,
@@ -125,7 +142,7 @@ export default {
125
142
  }));
126
143
 
127
144
  this.headers.push({
128
- title: ' ',
145
+ title: '',
129
146
  align: 'center',
130
147
  key: 'actions',
131
148
  sortable: false
@@ -141,6 +158,23 @@ export default {
141
158
  return false;
142
159
  }
143
160
  },
161
+ reloadData() {
162
+ this.isReloading = true;
163
+
164
+ this.send({
165
+ _client: {
166
+ socketId: this.$socket.id,
167
+ widgetId: this.id,
168
+ },
169
+ payload: {
170
+ action: 'reload',
171
+ },
172
+ }, 0);
173
+
174
+ setTimeout(() => {
175
+ this.isReloading = false;
176
+ }, 1000);
177
+ },
144
178
  updateSearchParam: debounce(function (searchValue) {
145
179
  const currentQuery = { ...this.$route.query };
146
180
 
@@ -1,96 +1,129 @@
1
1
  h1 {
2
- margin-bottom: 10px
2
+ margin-bottom: 10px;
3
3
  }
4
4
 
5
5
  h2 {
6
- margin-top: 1.5rem;
7
- margin-bottom: 0.75rem;
6
+ margin-top: 1.5rem;
7
+ margin-bottom: 0.75rem;
8
8
  }
9
9
 
10
10
  h3 {
11
- margin-top: 1rem;
11
+ margin-top: 1rem;
12
12
  }
13
13
 
14
14
  p {
15
- margin-bottom: 5px;
15
+ margin-bottom: 5px;
16
16
  }
17
17
 
18
18
  ul li {
19
- list-style-type: circle;
20
- list-style-position: inside;
21
- margin-left: 15px;
19
+ list-style-type: circle;
20
+ list-style-position: inside;
21
+ margin-left: 15px;
22
22
  }
23
23
 
24
24
  pre {
25
- padding: 12px;
26
- margin: 12px;
27
- background-color: #eee;
25
+ padding: 12px;
26
+ margin: 12px;
27
+ background-color: #eee;
28
28
  }
29
29
 
30
30
  code {
31
- font-size: 0.825rem;
32
- color: #ae0000;
31
+ font-size: 0.825rem;
32
+ color: #ae0000;
33
33
  }
34
34
 
35
35
  input {
36
- padding: 12px;
37
- margin: 12px;
38
- background-color: #eee;
36
+ margin: 6px;
37
+ background-color: #eee;
38
+ }
39
+
40
+ .v-field--prepended {
41
+ padding-inline-start: 4px;
39
42
  }
40
43
 
41
44
  .task-div {
42
- padding: 8px;
43
- margin: 16px;
44
- border: solid;
45
- border-radius: 4px;
46
- border-color: #303030;
45
+ padding: 8px;
46
+ margin: 16px;
47
+ border: solid;
48
+ border-radius: 4px;
49
+ border-color: #303030;
47
50
  }
48
51
 
49
52
  .action-button-container {
50
- width: 100%;
51
- display: flex;
52
- justify-content: center;
53
+ width: 100%;
54
+ display: flex;
55
+ justify-content: center;
53
56
  }
54
57
 
55
58
  .full-width-table {
56
59
  --v-table-header-height: 40px !important;
60
+ background-color: #fff;
61
+ border-radius: 0px 0px 8px 8px;
57
62
  }
58
63
 
59
64
  .full-width-table .v-toolbar {
60
- background: unset !important;
61
- color: unset !important;
65
+ background: unset !important;
66
+ color: unset !important;
62
67
  }
63
68
 
64
69
  .full-width-table .v-table__wrapper .v-alert--variant-flat {
65
- background: unset !important;
66
- color: unset !important;
70
+ background: unset !important;
71
+ color: unset !important;
67
72
  }
68
73
 
69
- .full-width-table >>> thead th {
74
+ .full-width-table :deep(thead th) {
70
75
  border-bottom: 4px solid rgb(var(--v-theme-primary)) !important;
71
76
  font-weight: 700 !important;
72
77
  font-size: 16px !important;
73
78
  }
74
79
 
75
- .full-width-table >>> tbody {
76
- background-color: #F6F5FA !important;
80
+ .full-width-table :deep(tbody) {
81
+ background-color: unset !important;
77
82
  --widget-row-height: 40px !important;
78
83
  font-size: 16px;
79
84
  }
80
85
 
81
- .search-input >>> .v-field__outline__end {
82
- border-right: none;
83
- border-top: none;
84
- border-radius: 0px;
86
+ .search-input :deep(.v-field__outline__end) {
87
+ border: none !important;
88
+ }
89
+
90
+ .search-input :deep(.v-field__outline__start) {
91
+ border: none !important;
85
92
  }
86
93
 
87
- .search-input >>> .v-label {
94
+ .search-input :deep(.v-field__outline) {
95
+ display: none !important;
96
+ }
97
+
98
+ .search-input :deep(.v-label) {
88
99
  font-size: 14px !important;
89
100
  }
90
101
 
91
- .search-input >>> .v-field__outline__start {
102
+ .search-input :deep(.v-field) {
92
103
  border-radius: 0px 0px 0px 8px;
93
- border-top: none;
104
+ border-bottom: 2px solid rgb(var(--v-theme-primary)) !important;
105
+ border-left: 2px solid rgb(var(--v-theme-primary)) !important;
106
+ border-right: none !important;
107
+ border-top: none !important;
108
+ transition: border-width 0.1s ease-in-out;
109
+ margin-bottom: 8px;
110
+ }
111
+
112
+ .search-input :deep(.v-field__input) {
113
+ font-size: 18px;
114
+ font-weight: 400;
115
+ font-style: normal;
116
+ padding: 0px 8px;
117
+ }
118
+
119
+ .search-input:focus-within :deep(.v-field) {
120
+ border-bottom: 4px solid rgb(var(--v-theme-primary)) !important;
121
+ border-left: 4px solid rgb(var(--v-theme-primary)) !important;
122
+ }
123
+
124
+ .search-input:focus-within :deep(.v-field__input) {
125
+ background-color: #f6f5fa;
126
+ border-radius: 0 8px 0px 5px;
94
127
  }
95
128
 
96
129
  .action-button {
@@ -99,5 +132,80 @@ input {
99
132
  border-color: rgb(var(--v-theme-primary));
100
133
  border: 2px solid;
101
134
  color: rgb(var(--v-theme-primary));
102
- padding: 8px;
135
+ padding: 4px 8px;
136
+ }
137
+
138
+ .ui-dynamic-table-container {
139
+ border-radius: 8px;
140
+ border-bottom: 4px solid rgb(var(--v-theme-primary));
141
+ box-shadow: 0 4px 16px -3px rgba(0, 0, 0, 0.5);
142
+ }
143
+
144
+ .ui-dynamic-table-title-default {
145
+ background: linear-gradient(131deg, #18181a 26.76%, #242326 100.16%);
146
+ padding: 32px;
147
+ color: #ffffff;
148
+ font-size: 36px;
149
+ font-weight: 700;
150
+ border-radius: 8px 8px 0px 0px;
151
+ margin-top: 0px;
152
+ border: 2px solid #f6f5fa;
153
+ border-bottom: none;
154
+ text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
155
+ }
156
+
157
+ .ui-dynamic-table-title-default hr {
158
+ border: 4px solid rgb(var(--v-theme-primary));
159
+ border-radius: 2px;
160
+ }
161
+
162
+ .ui-dynamic-table-title-minimal {
163
+ padding: 16px;
164
+ margin-top: 0px;
165
+ border: 2px solid #f6f5fa;
166
+ border-bottom: none;
167
+ }
168
+
169
+ .ui-dynamic-table-title-outside {
170
+ padding-bottom: 24px;
171
+ padding-top: 24px;
172
+ font-size: 24px;
173
+ font-weight: 700;
174
+ }
175
+
176
+ .reload-button {
177
+ border-radius: 8px !important;
178
+ background-color: transparent !important;
179
+ border-color: rgb(var(--v-theme-primary)) !important;
180
+ border: 2px solid !important;
181
+ color: rgb(var(--v-theme-primary)) !important;
182
+ padding: 8px !important;
183
+ min-height: 36px !important;
184
+ font-weight: 500 !important;
185
+ margin-bottom: 8px !important;
186
+ }
187
+
188
+ .reload-button:hover {
189
+ background-color: rgba(var(--v-theme-primary), 0.08) !important;
190
+ }
191
+
192
+ .reload-button:disabled {
193
+ opacity: 0.6 !important;
194
+ }
195
+
196
+ .reload-spin {
197
+ animation: spin 1s linear infinite;
198
+ }
199
+
200
+ .v-container {
201
+ padding: 12px;
202
+ }
203
+
204
+ @keyframes spin {
205
+ from {
206
+ transform: rotate(0deg);
207
+ }
208
+ to {
209
+ transform: rotate(360deg);
210
+ }
103
211
  }