@qikdev/vue-ui 0.1.2 → 0.1.8
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/README.md +4 -89
- package/dist/favicon.ico +0 -0
- package/dist/index.css +1 -0
- package/dist/lib.es.js +17802 -0
- package/dist/lib.es.js.map +1 -0
- package/dist/lib.umd.js +9 -0
- package/dist/lib.umd.js.map +1 -0
- package/package.json +31 -24
- package/.gitlab-ci.yml +0 -13
- package/jsdoc.conf +0 -10
- package/src/components.js +0 -255
- package/src/content/browser.vue +0 -842
- package/src/content/item.vue +0 -48
- package/src/content/render/field.vue +0 -431
- package/src/content/render/group.vue +0 -65
- package/src/content/render/render-mixin.js +0 -101
- package/src/content/render/render.vue +0 -86
- package/src/filter/FilterBuilder.vue +0 -145
- package/src/filter/FilterCondition.vue +0 -373
- package/src/filter/FilterRule.vue +0 -259
- package/src/form/expressions/index.js +0 -83
- package/src/form/field.vue +0 -640
- package/src/form/form.vue +0 -280
- package/src/form/getDefaultValue.js +0 -226
- package/src/form/inputs/button-select.vue +0 -208
- package/src/form/inputs/checkbox.vue +0 -91
- package/src/form/inputs/content-select.vue +0 -187
- package/src/form/inputs/currency.vue +0 -205
- package/src/form/inputs/datefield.vue +0 -132
- package/src/form/inputs/group.vue +0 -155
- package/src/form/inputs/html.vue +0 -39
- package/src/form/inputs/input-mixin.js +0 -440
- package/src/form/inputs/native-select-old.vue +0 -43
- package/src/form/inputs/object-field.vue +0 -50
- package/src/form/inputs/option.vue +0 -19
- package/src/form/inputs/options-manager.vue +0 -244
- package/src/form/inputs/phone-number-input.vue +0 -235
- package/src/form/inputs/search.vue +0 -117
- package/src/form/inputs/select.vue +0 -229
- package/src/form/inputs/switch.vue +0 -87
- package/src/form/inputs/textarea.vue +0 -80
- package/src/form/inputs/textfield.vue +0 -185
- package/src/form/inputs/timezone.vue +0 -642
- package/src/form/inputs/type-select.vue +0 -247
- package/src/form/inputs/upload/filedrop.vue +0 -72
- package/src/form/inputs/upload/upload.vue +0 -323
- package/src/form/parseBoolean.js +0 -24
- package/src/layout/flex-body.vue +0 -23
- package/src/layout/flex-cell.vue +0 -45
- package/src/layout/flex-column.vue +0 -31
- package/src/layout/flex-footer.vue +0 -14
- package/src/layout/flex-header.vue +0 -14
- package/src/layout/flex-row.vue +0 -39
- package/src/layout/flex-spacer.vue +0 -18
- package/src/layout/panel-body.vue +0 -13
- package/src/layout/panel-footer.vue +0 -20
- package/src/layout/panel-header.vue +0 -20
- package/src/layout/panel.vue +0 -23
- package/src/layout/tab.vue +0 -34
- package/src/layout/tabset.vue +0 -72
- package/src/mixins/RememberScroll.js +0 -30
- package/src/modal/ConfirmModal.vue +0 -50
- package/src/modal/ContentModal.vue +0 -107
- package/src/modal/Modal.vue +0 -86
- package/src/modal/ModalMixin.js +0 -21
- package/src/modal/OptionsModal.vue +0 -31
- package/src/modal/PromptModal.vue +0 -31
- package/src/services/device.js +0 -211
- package/src/services/selection.js +0 -165
- package/src/table/Table.vue +0 -316
- package/src/table/TableCell.vue +0 -113
- package/src/table/TableRow.vue +0 -82
- package/src/table/cells/Button.vue +0 -56
- package/src/table/cells/TableCellMixin.js +0 -15
- package/src/table/cells/Thumbnail.vue +0 -39
- package/src/table/cells/Value.vue +0 -46
- package/src/ui/button.vue +0 -255
- package/src/ui/checkbox.vue +0 -79
- package/src/ui/icon.vue +0 -57
- package/src/ui/image.vue +0 -158
- package/src/ui/link.vue +0 -62
- package/src/ui/list-item.vue +0 -22
- package/src/ui/list.vue +0 -26
- package/src/ui/menu.vue +0 -147
- package/src/ui/pager.vue +0 -156
- package/src/ui/progressbar.vue +0 -77
- package/src/ui/spinner.vue +0 -26
- package/src/ui/switch.vue +0 -89
- package/src/version.js +0 -1
- package/test/index.spec.js +0 -42
- package/test/mocha.opts +0 -0
- package/yarn-error.log +0 -2923
package/src/table/Table.vue
DELETED
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="table-wrapper">
|
|
3
|
-
<div class="table-scroll" ref="scroll">
|
|
4
|
-
<table>
|
|
5
|
-
<thead>
|
|
6
|
-
<tr>
|
|
7
|
-
<th v-if="enableSelection" class="first table-select shrink">
|
|
8
|
-
<ux-menu>
|
|
9
|
-
<template #activator="{ on }">
|
|
10
|
-
<ux-checkbox v-on="on" :value="pageSelected"></ux-checkbox>
|
|
11
|
-
</template>
|
|
12
|
-
<ux-list>
|
|
13
|
-
<ux-list-item @click="selectPage()">
|
|
14
|
-
Select Page
|
|
15
|
-
</ux-list-item>
|
|
16
|
-
<ux-list-item v-if="someSelectedOnPage" @click="deselectPage()">
|
|
17
|
-
Deselect Page
|
|
18
|
-
</ux-list-item>
|
|
19
|
-
<ux-list-item v-if="selectAll" @click="selectAll()">
|
|
20
|
-
Select All ({{total}})
|
|
21
|
-
</ux-list-item>
|
|
22
|
-
<ux-list-item v-if="deselectAll" @click="deselectAll()">
|
|
23
|
-
Deselect All
|
|
24
|
-
</ux-list-item>
|
|
25
|
-
</ux-list>
|
|
26
|
-
</ux-menu>
|
|
27
|
-
</th>
|
|
28
|
-
<th @click="toggleSort(column)" :class="column.class" v-for="column in renderColumns">
|
|
29
|
-
{{column.title}}
|
|
30
|
-
</th>
|
|
31
|
-
<th v-if="enableActions" class="last shrink">
|
|
32
|
-
<slot name="corner"></slot>
|
|
33
|
-
</th>
|
|
34
|
-
</tr>
|
|
35
|
-
</thead>
|
|
36
|
-
<tbody>
|
|
37
|
-
<table-row :enableSelection="enableSelection" :enableActions="enableActions" :key="row._id" @click:cell="clickCell" @click:row="clickRow" @click:select="clickSelect" @click:actions="clickActions" :selected="isSelected(row)" :row="row" :columns="columns" v-for="row in renderRows" />
|
|
38
|
-
</tbody>
|
|
39
|
-
</table>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
</template>
|
|
43
|
-
<script>
|
|
44
|
-
import TableRow from './TableRow.vue';
|
|
45
|
-
import TableCell from './TableCell.vue';
|
|
46
|
-
|
|
47
|
-
import RememberScrollMixin from '../mixins/RememberScroll.js';
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
export default {
|
|
51
|
-
mixins:[RememberScrollMixin],
|
|
52
|
-
components: {
|
|
53
|
-
TableRow,
|
|
54
|
-
TableCell,
|
|
55
|
-
},
|
|
56
|
-
watch: {
|
|
57
|
-
rows() {
|
|
58
|
-
this.$refs.scroll.scroll({
|
|
59
|
-
top: 0,
|
|
60
|
-
left: 0,
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
props: {
|
|
65
|
-
total: {
|
|
66
|
-
type: Number,
|
|
67
|
-
},
|
|
68
|
-
columns: {
|
|
69
|
-
type: Array,
|
|
70
|
-
default () {
|
|
71
|
-
return []
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
rows: {
|
|
75
|
-
type: Array,
|
|
76
|
-
default () {
|
|
77
|
-
return [];
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
scrollable: {
|
|
81
|
-
type: Boolean,
|
|
82
|
-
default () {
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
enableActions: {
|
|
87
|
-
type: Boolean,
|
|
88
|
-
default () {
|
|
89
|
-
return false;
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
enableSelection: {
|
|
93
|
-
type: Boolean,
|
|
94
|
-
default () {
|
|
95
|
-
return true;
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
selection: {
|
|
99
|
-
type: Array,
|
|
100
|
-
default () {
|
|
101
|
-
return []
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
selectAll: {
|
|
105
|
-
type: Function,
|
|
106
|
-
},
|
|
107
|
-
deselectAll: {
|
|
108
|
-
type: Function,
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
computed: {
|
|
112
|
-
selectionHash() {
|
|
113
|
-
var self = this;
|
|
114
|
-
return self.selection.reduce(function(set, row) {
|
|
115
|
-
var id = row._id || row.id;
|
|
116
|
-
set[id] = row;
|
|
117
|
-
return set;
|
|
118
|
-
}, {})
|
|
119
|
-
},
|
|
120
|
-
pageSelected() {
|
|
121
|
-
var self = this;
|
|
122
|
-
|
|
123
|
-
if (!self.rows || !self.rows.length) {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
//Check to see if any rows are not selected
|
|
128
|
-
return !self.rows.some(function(row) {
|
|
129
|
-
return !(self.selectionHash[row._id || row.id]);
|
|
130
|
-
})
|
|
131
|
-
},
|
|
132
|
-
renderColumns() {
|
|
133
|
-
return this.columns.map(function(column) {
|
|
134
|
-
|
|
135
|
-
var col = Object.assign({}, column);
|
|
136
|
-
|
|
137
|
-
col.class = [];
|
|
138
|
-
if (col.shrink) {
|
|
139
|
-
col.class.push('shrink')
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
return col;
|
|
143
|
-
});
|
|
144
|
-
},
|
|
145
|
-
renderRows() {
|
|
146
|
-
return this.rows;
|
|
147
|
-
},
|
|
148
|
-
someSelectedOnPage() {
|
|
149
|
-
return this.rows.some(this.isSelected);
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
methods: {
|
|
153
|
-
togglePage() {
|
|
154
|
-
|
|
155
|
-
var self = this;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
if (self.pageSelected) {
|
|
159
|
-
self.deselectPage();
|
|
160
|
-
} else {
|
|
161
|
-
self.selectPage();
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
selectPage() {
|
|
165
|
-
var self = this;
|
|
166
|
-
self.$emit('select:multiple', self.rows);
|
|
167
|
-
},
|
|
168
|
-
deselectPage() {
|
|
169
|
-
var self = this;
|
|
170
|
-
self.$emit('deselect:multiple', self.rows);
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
isSelected(row) {
|
|
174
|
-
|
|
175
|
-
var self = this;
|
|
176
|
-
var rowID = row._id || row.id;
|
|
177
|
-
return self.selection.some(function(r) {
|
|
178
|
-
var rid = r._id || r.id;
|
|
179
|
-
return r == row || rid == rowID;
|
|
180
|
-
});
|
|
181
|
-
},
|
|
182
|
-
classes(row) {
|
|
183
|
-
let array = [];
|
|
184
|
-
if (this.isSelected(row)) {
|
|
185
|
-
array.push('selected');
|
|
186
|
-
}
|
|
187
|
-
return array;
|
|
188
|
-
},
|
|
189
|
-
|
|
190
|
-
toggleSort(column) {
|
|
191
|
-
|
|
192
|
-
},
|
|
193
|
-
clickRow(row) {
|
|
194
|
-
|
|
195
|
-
this.$emit('click:row', row);
|
|
196
|
-
},
|
|
197
|
-
clickCell({ row, column }) {
|
|
198
|
-
|
|
199
|
-
this.$emit('click:cell', { row, column });
|
|
200
|
-
},
|
|
201
|
-
clickActions(row) {
|
|
202
|
-
this.$emit('click:actions', row);
|
|
203
|
-
},
|
|
204
|
-
clickSelect(row) {
|
|
205
|
-
|
|
206
|
-
this.$emit('select:row:toggle', row);
|
|
207
|
-
},
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
</script>
|
|
212
|
-
<style scoped lang="scss">
|
|
213
|
-
.table-wrapper {
|
|
214
|
-
// box-sizing:border-box;
|
|
215
|
-
display: flex;
|
|
216
|
-
flex: 1;
|
|
217
|
-
overflow: hidden;
|
|
218
|
-
|
|
219
|
-
.table-scroll {
|
|
220
|
-
overflow: auto;
|
|
221
|
-
position: relative;
|
|
222
|
-
width: 100%;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
:deep(table) {
|
|
228
|
-
width: 100%;
|
|
229
|
-
border-collapse: collapse;
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
thead {
|
|
234
|
-
th {
|
|
235
|
-
top: 0;
|
|
236
|
-
position: sticky;
|
|
237
|
-
text-transform: uppercase;
|
|
238
|
-
letter-spacing: 0.05em;
|
|
239
|
-
line-height: 20px;
|
|
240
|
-
white-space: nowrap;
|
|
241
|
-
font-size: 11px;
|
|
242
|
-
padding: 0.5em;
|
|
243
|
-
background: #fff;
|
|
244
|
-
z-index: 2;
|
|
245
|
-
text-align: left;
|
|
246
|
-
|
|
247
|
-
&.table-select {
|
|
248
|
-
font-size: clamp(17px, 1em, 20px);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
border-bottom: 1px solid rgba(#000, 0.05);
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
th.first,
|
|
257
|
-
td.first {
|
|
258
|
-
position: sticky;
|
|
259
|
-
left: 0;
|
|
260
|
-
// z-index: 1;
|
|
261
|
-
text-align: center;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
th.last,
|
|
265
|
-
td.last {
|
|
266
|
-
position: sticky;
|
|
267
|
-
right: 0;
|
|
268
|
-
// z-index: 1;
|
|
269
|
-
text-align: center;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
td,
|
|
273
|
-
th {
|
|
274
|
-
padding: 0.5em;
|
|
275
|
-
font-size: clamp(17px, 1em, 20px);
|
|
276
|
-
|
|
277
|
-
&.shrink {
|
|
278
|
-
width: 1px;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
tr {
|
|
283
|
-
border-bottom: 1px solid rgba(#000, 0.05);
|
|
284
|
-
|
|
285
|
-
&:last-of-type {
|
|
286
|
-
border-bottom: none;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
tr:nth-child(odd) {
|
|
291
|
-
background: darken(#fff, 1%);
|
|
292
|
-
|
|
293
|
-
th.first,
|
|
294
|
-
td.first,
|
|
295
|
-
th.last,
|
|
296
|
-
td.last {
|
|
297
|
-
background: darken(#fff, 1%);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
tr:nth-child(even) {
|
|
302
|
-
|
|
303
|
-
th.first,
|
|
304
|
-
td.first,
|
|
305
|
-
th.last,
|
|
306
|
-
td.last {
|
|
307
|
-
background: #fff;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
tr.selected {
|
|
312
|
-
background: rgba(orange, 0.1);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
</style>
|
package/src/table/TableCell.vue
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component v-if="component" :is="component" :column="column" :row="row" :value="value" />
|
|
3
|
-
<td v-else class="table-cell">
|
|
4
|
-
<template v-if="multiValue">
|
|
5
|
-
<template v-if="complex">
|
|
6
|
-
<span class="value" v-for="entry in value">
|
|
7
|
-
<value-renderer :value="entry" />
|
|
8
|
-
</span>
|
|
9
|
-
</template>
|
|
10
|
-
<template v-else>
|
|
11
|
-
<span class="value" v-for="entry in value">
|
|
12
|
-
<value-renderer :value="entry" />,
|
|
13
|
-
</span>
|
|
14
|
-
</template>
|
|
15
|
-
</template>
|
|
16
|
-
<template v-else>
|
|
17
|
-
<value-renderer :value="value" />
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</td>
|
|
22
|
-
</template>
|
|
23
|
-
<script>
|
|
24
|
-
import _get from 'lodash/get';
|
|
25
|
-
import { defineAsyncComponent } from 'vue';
|
|
26
|
-
|
|
27
|
-
import ThumbnailCell from './cells/Thumbnail.vue';
|
|
28
|
-
import ButtonCell from './cells/Button.vue';
|
|
29
|
-
import ValueRenderer from './cells/Value.vue';
|
|
30
|
-
|
|
31
|
-
export default {
|
|
32
|
-
data() {
|
|
33
|
-
return {
|
|
34
|
-
component: null,
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
components: {
|
|
38
|
-
ValueRenderer,
|
|
39
|
-
},
|
|
40
|
-
async created() {
|
|
41
|
-
var self = this;
|
|
42
|
-
|
|
43
|
-
var component;
|
|
44
|
-
|
|
45
|
-
///////////////////////////////
|
|
46
|
-
|
|
47
|
-
switch (this.column.renderer) {
|
|
48
|
-
case 'button':
|
|
49
|
-
component = ButtonCell;
|
|
50
|
-
break;
|
|
51
|
-
case 'thumbnail':
|
|
52
|
-
// simple usage
|
|
53
|
-
component = ThumbnailCell;
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
///////////////////////////////
|
|
58
|
-
|
|
59
|
-
this.component = component;
|
|
60
|
-
},
|
|
61
|
-
props: {
|
|
62
|
-
column: {
|
|
63
|
-
type: Object,
|
|
64
|
-
required: true,
|
|
65
|
-
},
|
|
66
|
-
row: {
|
|
67
|
-
type: Object,
|
|
68
|
-
required: true,
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
computed: {
|
|
72
|
-
multiValue() {
|
|
73
|
-
return Array.isArray(this.value);
|
|
74
|
-
},
|
|
75
|
-
complex() {
|
|
76
|
-
if (this.multiValue) {
|
|
77
|
-
|
|
78
|
-
} else {
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
renderer() {
|
|
83
|
-
return this.column.renderer;
|
|
84
|
-
},
|
|
85
|
-
renderValue() {
|
|
86
|
-
|
|
87
|
-
var value = this.value;
|
|
88
|
-
|
|
89
|
-
if (value === undefined || value === null) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return value.title || value.name || value;
|
|
94
|
-
},
|
|
95
|
-
value() {
|
|
96
|
-
var v = _get(this.row, this.column.key);
|
|
97
|
-
|
|
98
|
-
if(!v) {
|
|
99
|
-
console.log(this.row, this.column.key)
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return v;
|
|
103
|
-
},
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
</script>
|
|
107
|
-
<style scoped lang="scss">
|
|
108
|
-
.value {
|
|
109
|
-
display: inline-block;
|
|
110
|
-
margin: 0.05em;
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
</style>
|
package/src/table/TableRow.vue
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<tr :class="classes" class="table-row">
|
|
3
|
-
<slot>
|
|
4
|
-
<th v-if="enableSelection" class="table-cell table-select first shrink" @click.stop.prevent="clickSelect(row)">
|
|
5
|
-
<ux-checkbox :value="selected">
|
|
6
|
-
</ux-checkbox>
|
|
7
|
-
</th>
|
|
8
|
-
<table-cell @click.stop.prevent="clickCell(column)" :column="column" :row="row" v-for="column in columns">
|
|
9
|
-
</table-cell>
|
|
10
|
-
<th v-if="enableActions" class="table-cell last shrink" @click.stop.prevent="clickActions(row)">
|
|
11
|
-
<ux-button size="xs" icon>
|
|
12
|
-
<ux-icon icon="fa-ellipsis" />
|
|
13
|
-
</ux-button>
|
|
14
|
-
</th>
|
|
15
|
-
</slot>
|
|
16
|
-
</tr>
|
|
17
|
-
</template>
|
|
18
|
-
<script>
|
|
19
|
-
import TableCell from './TableCell.vue';
|
|
20
|
-
|
|
21
|
-
export default {
|
|
22
|
-
components: {
|
|
23
|
-
TableCell,
|
|
24
|
-
},
|
|
25
|
-
props: {
|
|
26
|
-
selected: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
},
|
|
29
|
-
row: {
|
|
30
|
-
type: Object,
|
|
31
|
-
required: true,
|
|
32
|
-
},
|
|
33
|
-
columns: {
|
|
34
|
-
type: Array,
|
|
35
|
-
required: true,
|
|
36
|
-
},
|
|
37
|
-
enableActions:{
|
|
38
|
-
type:Boolean,
|
|
39
|
-
default() {
|
|
40
|
-
return false;
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
enableSelection:{
|
|
44
|
-
type:Boolean,
|
|
45
|
-
default() {
|
|
46
|
-
return true;
|
|
47
|
-
},
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
methods:{
|
|
51
|
-
clickCell(column) {
|
|
52
|
-
this.$emit('click:cell', {row:this.row, column});
|
|
53
|
-
this.$emit('click:row', this.row);
|
|
54
|
-
},
|
|
55
|
-
clickActions(row) {
|
|
56
|
-
console.log('click actions')
|
|
57
|
-
this.$emit('click:actions', row);
|
|
58
|
-
},
|
|
59
|
-
clickSelect(row) {
|
|
60
|
-
console.log('click select')
|
|
61
|
-
this.$emit('click:select', row);
|
|
62
|
-
// this.$emit('click:row', this.row);
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
computed: {
|
|
66
|
-
classes() {
|
|
67
|
-
var array = [];
|
|
68
|
-
|
|
69
|
-
if (this.selected) {
|
|
70
|
-
array.push('selected');
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return array;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
</script>
|
|
78
|
-
<style scoped lang="scss">
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
</style>
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<td class="table-button-cell">
|
|
3
|
-
<ux-button :size="button.size" :loading="processing" @click.stop.prevent="clicked">
|
|
4
|
-
<template v-if="button.text">{{button.text}}</template><ux-icon v-if="button.icon" :icon="button.icon" right/>
|
|
5
|
-
</ux-button>
|
|
6
|
-
</td>
|
|
7
|
-
</template>
|
|
8
|
-
<script>
|
|
9
|
-
|
|
10
|
-
import TableCellMixin from './TableCellMixin.js';
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
data() {
|
|
14
|
-
return {
|
|
15
|
-
processing:false,
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
mixins:[TableCellMixin],
|
|
19
|
-
computed:{
|
|
20
|
-
button() {
|
|
21
|
-
return this.column.button;
|
|
22
|
-
},
|
|
23
|
-
type() {
|
|
24
|
-
return this.row?.meta?.type
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
methods:{
|
|
28
|
-
async clicked() {
|
|
29
|
-
|
|
30
|
-
this.processing = true;
|
|
31
|
-
await this.button.action(this.row);
|
|
32
|
-
this.processing = false;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<style scoped lang="scss">
|
|
40
|
-
|
|
41
|
-
td {
|
|
42
|
-
width:60px;
|
|
43
|
-
padding:0.3em !important;
|
|
44
|
-
|
|
45
|
-
.ux-image {
|
|
46
|
-
border-radius:0.1em;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
:deep .ux-btn-text {
|
|
50
|
-
display: block;
|
|
51
|
-
white-space: nowrap;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
</style>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<td class="table-image-cell">
|
|
3
|
-
<template v-if="type == 'image' || type == 'video'">
|
|
4
|
-
<ux-image :item="row" :type="type" :width="50"/>
|
|
5
|
-
</template>
|
|
6
|
-
<template v-else>
|
|
7
|
-
<ux-icon icon="fa-file"/>
|
|
8
|
-
</template>
|
|
9
|
-
</td>
|
|
10
|
-
</template>
|
|
11
|
-
<script>
|
|
12
|
-
|
|
13
|
-
import TableCellMixin from './TableCellMixin.js';
|
|
14
|
-
|
|
15
|
-
export default {
|
|
16
|
-
mixins:[TableCellMixin],
|
|
17
|
-
computed:{
|
|
18
|
-
type() {
|
|
19
|
-
return this.row?.meta?.type
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<style scoped lang="scss">
|
|
27
|
-
|
|
28
|
-
td {
|
|
29
|
-
min-width:60px;
|
|
30
|
-
width:60px;
|
|
31
|
-
padding:0.3em !important;
|
|
32
|
-
|
|
33
|
-
.ux-image {
|
|
34
|
-
border-radius:0.1em;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
</style>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a @click.stop.prevent="clicked(value)" v-if="reference">{{renderValue}}</a>
|
|
3
|
-
<template v-else>{{renderValue}}</template>
|
|
4
|
-
</template>
|
|
5
|
-
<script>
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
props:{
|
|
9
|
-
value:{
|
|
10
|
-
required:true,
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
computed:{
|
|
14
|
-
reference() {
|
|
15
|
-
return !!(this.value && this.value._id)
|
|
16
|
-
},
|
|
17
|
-
renderValue() {
|
|
18
|
-
return this.value ? this.value.title || this.value.name || this.value : undefined;
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
methods:{
|
|
22
|
-
clicked(item) {
|
|
23
|
-
this.$qik.dispatch('item:view', item);
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
}
|
|
27
|
-
</script>
|
|
28
|
-
<style lang="scss" scoped>
|
|
29
|
-
a {
|
|
30
|
-
padding: 0.5em 1em;
|
|
31
|
-
margin: 0.1em;
|
|
32
|
-
background: rgba(#000, 0.05);
|
|
33
|
-
border-radius: 0.5em;
|
|
34
|
-
display: inline-block;
|
|
35
|
-
line-height: 1;
|
|
36
|
-
font-size: 0.7em;
|
|
37
|
-
cursor:pointer;
|
|
38
|
-
white-space: nowrap;
|
|
39
|
-
text-overflow: ellipsis;
|
|
40
|
-
overflow: hidden ;
|
|
41
|
-
|
|
42
|
-
&:hover {
|
|
43
|
-
background: rgba(#000, 0.1);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
</style>
|