pui9-datatables 1.16.4
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 +24 -0
- package/dist/demo.html +10 -0
- package/dist/pui9-datatables.common.js +89206 -0
- package/dist/pui9-datatables.common.js.map +1 -0
- package/dist/pui9-datatables.css +5 -0
- package/dist/pui9-datatables.umd.js +89216 -0
- package/dist/pui9-datatables.umd.js.map +1 -0
- package/dist/pui9-datatables.umd.min.js +55 -0
- package/dist/pui9-datatables.umd.min.js.map +1 -0
- package/package-lock.json +15982 -0
- package/package.json +89 -0
- package/src/App.vue +37 -0
- package/src/components/desktop/PuiDatatable.vue +709 -0
- package/src/components/desktop/PuiQuickEditionDatatable.vue +548 -0
- package/src/components/desktop/PuiSimpleDatatable.vue +1498 -0
- package/src/components/desktop/datatables.net-plugins/pagination/input.js +213 -0
- package/src/components/desktop/footer/PuiDatatableFooter.vue +65 -0
- package/src/components/desktop/footer/PuiGridActionFooter.vue +132 -0
- package/src/components/desktop/quickedition/PuiQuickEditionExportBtn.vue +138 -0
- package/src/components/desktop/quickedition/PuiQuickEditionForm.vue +60 -0
- package/src/components/desktop/quickedition/PuiQuickEditionToolbar.vue +144 -0
- package/src/components/desktop/row/PuiGridRowActions.vue +112 -0
- package/src/components/desktop/subdialogs/PuiDatatableColumnMenu.vue +186 -0
- package/src/components/desktop/toolbar/PuiGridToolbar.vue +310 -0
- package/src/components/desktop/toolbar/actions/PuiGridActionListItem.vue +34 -0
- package/src/components/desktop/toolbar/actions/PuiGridActionsBtn.vue +56 -0
- package/src/components/desktop/toolbar/actions/PuiGridActionsDialog.vue +66 -0
- package/src/components/desktop/toolbar/actions/audit/PuiAuditDialog.vue +92 -0
- package/src/components/desktop/toolbar/actions/docgen/PuiDocgenTemplateMatchingsDialog.vue +139 -0
- package/src/components/desktop/toolbar/actions/docgen/PuiDocgenTemplateParametersDialog.vue +317 -0
- package/src/components/desktop/toolbar/actions/importexport/PuiGridExportDialog.vue +187 -0
- package/src/components/desktop/toolbar/actions/importexport/PuiGridImportDialog.vue +421 -0
- package/src/components/desktop/toolbar/export/PuiGridExportBtn.vue +175 -0
- package/src/components/desktop/toolbar/filtercombo/PuiGridFilterCombo.vue +237 -0
- package/src/components/desktop/toolbar/filtering/PuiGridFilterBtns.vue +163 -0
- package/src/components/desktop/toolbar/filtering/PuiGridFilterDialog.vue +434 -0
- package/src/components/desktop/toolbar/filtering/PuiGridFilterGroup.vue +313 -0
- package/src/components/desktop/toolbar/filtering/PuiGridFilterListBtn.vue +85 -0
- package/src/components/desktop/toolbar/filtering/PuiGridFilterListDialog.vue +254 -0
- package/src/components/desktop/toolbar/filtering/PuiGridFilterListItem.vue +192 -0
- package/src/components/desktop/toolbar/filtering/PuiGridFilterRule.vue +517 -0
- package/src/components/desktop/toolbar/grid-configuration/PuiGridConfBtns.vue +99 -0
- package/src/components/desktop/toolbar/grid-configuration/PuiGridConfDialog.vue +640 -0
- package/src/components/desktop/toolbar/grid-configuration/PuiSaveConfigDialog.vue +154 -0
- package/src/components/desktop/toolbar/row/PuiGridCreateBtn.vue +39 -0
- package/src/components/desktop/toolbar/row/PuiGridDeleteBtn.vue +86 -0
- package/src/components/desktop/toolbar/row/PuiGridRefreshBtn.vue +39 -0
- package/src/components/desktop/toolbar/row/PuiGridUpdateBtn.vue +56 -0
- package/src/components/desktop/toolbar/searching/PuiGridSearcher.vue +67 -0
- package/src/components/desktop/toolbar/searching/PuiGridSearcherColumnsList.vue +43 -0
- package/src/components/desktop/toolbar/sorting/PuiGridSortBtn.vue +44 -0
- package/src/components/desktop/toolbar/sorting/PuiGridSortDialog.vue +113 -0
- package/src/components/mobile/PuiDatalist.vue +477 -0
- package/src/components/mobile/PuiSimpleDatalist.vue +313 -0
- package/src/components/mobile/actions/PuiListActionListItem.vue +34 -0
- package/src/components/mobile/actions/PuiListActionsBtn.vue +38 -0
- package/src/components/mobile/actions/PuiListActionsDialog.vue +66 -0
- package/src/components/mobile/footer/PuiListActionFooter.vue +56 -0
- package/src/components/mobile/toolbar/PuiListToolbar.vue +60 -0
- package/src/components/mobile/toolbar/searching/PuiListSearcher.vue +53 -0
- package/src/components/mobile/toolbar/searching/PuiListSearcherColumnsList.vue +43 -0
- package/src/components/mobile/toolbar/sorting/PuiListSortBtn.vue +46 -0
- package/src/components/mobile/toolbar/sorting/PuiListSortDialog.vue +140 -0
- package/src/components/puiaudit/PuiAuditForm.vue +107 -0
- package/src/generalActions.js +135 -0
- package/src/index.js +31 -0
- package/src/main.js +67 -0
- package/src/mixins/PuiActionsBtnMixin.js +287 -0
- package/src/mixins/PuiActionsDialogMixin.js +161 -0
- package/src/mixins/PuiActionsListItemMixin.js +62 -0
- package/src/mixins/PuiDatatablesKeepPage.js +15 -0
- package/src/mixins/PuiGridFormMethodsMixin.js +133 -0
- package/src/mixins/PuiModelConfigurationMixin.js +15 -0
- package/src/mixins/PuiSearcherColumnsListMixin.js +108 -0
- package/src/mixins/PuiSearcherMixin.js +192 -0
- package/src/mixins/PuiSortBtnMixin.js +54 -0
- package/src/mixins/PuiSortDialogMixin.js +256 -0
- package/src/mixins/PuiToolbarBtnMixin.js +66 -0
- package/src/mixins/PuiToolbarDialogMixin.js +12 -0
- package/src/router.js +18 -0
- package/src/tests/PuiContainer.vue +139 -0
- package/src/tests/PuiProfileTestSimpleDatatable.vue +66 -0
- package/src/tests/PuiUserTestCompleteDatatable.vue +126 -0
- package/src/tests/PuiVariableTestQuickEditionDatatable.vue +39 -0
- package/src/tests/PuiVariableTestQuickEditionForm.vue +18 -0
- package/src/tests/modelConfigurations.json +3516 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-dialog v-model="dialog" persistent max-width="700px">
|
|
3
|
+
<v-card flat style="border-radius: 6px" class="pa-2">
|
|
4
|
+
<v-card-title>
|
|
5
|
+
<v-layout :ref="'header'" wrap>
|
|
6
|
+
<v-toolbar class="elevation-0 pui-dialog__bar" height="50">
|
|
7
|
+
<v-toolbar-title class="pui-dialog__title pui-dialog__title--margin pui-dialog__margin">
|
|
8
|
+
{{ getEditSaveTitle }}
|
|
9
|
+
</v-toolbar-title>
|
|
10
|
+
<v-spacer></v-spacer>
|
|
11
|
+
<v-btn text class="pui-dialog__toolbarBtn elevation-0" @click="$parent.dialogs.edit = false">
|
|
12
|
+
<v-icon>far fa-times</v-icon>
|
|
13
|
+
</v-btn>
|
|
14
|
+
</v-toolbar>
|
|
15
|
+
</v-layout>
|
|
16
|
+
</v-card-title>
|
|
17
|
+
<v-card-text>
|
|
18
|
+
<v-form ref="form" v-model="valid" lazy-validation @submit.prevent>
|
|
19
|
+
<pui-switch
|
|
20
|
+
:true-value="'update'"
|
|
21
|
+
:false-value="'create'"
|
|
22
|
+
:label="$t('puidatatables.overwrite_configuration')"
|
|
23
|
+
v-model="method"
|
|
24
|
+
></pui-switch>
|
|
25
|
+
<v-layout v-if="method === 'update' && modelSetted === true">
|
|
26
|
+
<v-flex xs12>
|
|
27
|
+
<label :class="{ 'v-label--required': true }">{{ $t('puidatatables.choose_configuration') }}</label>
|
|
28
|
+
</v-flex>
|
|
29
|
+
</v-layout>
|
|
30
|
+
<v-layout v-if="method === 'update' && modelSetted === true">
|
|
31
|
+
<v-flex xs12>
|
|
32
|
+
<v-autocomplete
|
|
33
|
+
class="puiConf-dialog__select"
|
|
34
|
+
:items="availableConfigurations"
|
|
35
|
+
v-model="model"
|
|
36
|
+
solo
|
|
37
|
+
flat
|
|
38
|
+
required
|
|
39
|
+
:rules="[(value) => !!value || $t('pui9.error.field_required')]"
|
|
40
|
+
:return-object="true"
|
|
41
|
+
item-value="id"
|
|
42
|
+
:item-text="(item) => item.configuration && item.configuration.name"
|
|
43
|
+
/>
|
|
44
|
+
</v-flex>
|
|
45
|
+
</v-layout>
|
|
46
|
+
<pui-text-field
|
|
47
|
+
:disabled="method === 'update'"
|
|
48
|
+
class="pt-3"
|
|
49
|
+
:label="$t('puidatatables.name_configuration')"
|
|
50
|
+
v-model="model.configuration.name"
|
|
51
|
+
toplabel
|
|
52
|
+
maxlength="100"
|
|
53
|
+
required
|
|
54
|
+
noeditable
|
|
55
|
+
></pui-text-field>
|
|
56
|
+
<pui-text-area
|
|
57
|
+
:disabled="method === 'update'"
|
|
58
|
+
:label="$t('puidatatables.description_configuration')"
|
|
59
|
+
v-model="model.configuration.description"
|
|
60
|
+
toplabel
|
|
61
|
+
maxlength="500"
|
|
62
|
+
noeditable
|
|
63
|
+
></pui-text-area>
|
|
64
|
+
<pui-switch
|
|
65
|
+
:true-value="true"
|
|
66
|
+
:false-value="false"
|
|
67
|
+
:label="$t('puidatatables.default_configuration')"
|
|
68
|
+
v-model="model.configuration.isdefault"
|
|
69
|
+
></pui-switch>
|
|
70
|
+
</v-form>
|
|
71
|
+
</v-card-text>
|
|
72
|
+
<v-card-actions>
|
|
73
|
+
<v-btn text outlined @click="$parent.dialogs.edit = false" class="elevation-0">{{ $t('form.cancel') }}</v-btn>
|
|
74
|
+
<v-spacer />
|
|
75
|
+
<v-btn color="primary" :disabled="modelGridConfigurations.length === 0" @click="save()" class="elevation-0">
|
|
76
|
+
{{ $t('form.save') }}
|
|
77
|
+
</v-btn>
|
|
78
|
+
</v-card-actions>
|
|
79
|
+
</v-card>
|
|
80
|
+
</v-dialog>
|
|
81
|
+
</template>
|
|
82
|
+
|
|
83
|
+
<script>
|
|
84
|
+
import PuiGridFormMethodsMixin from '../../../../mixins/PuiGridFormMethodsMixin';
|
|
85
|
+
|
|
86
|
+
export default {
|
|
87
|
+
name: 'PuiSaveConfigDialog',
|
|
88
|
+
mixins: [PuiGridFormMethodsMixin],
|
|
89
|
+
props: ['modelName'],
|
|
90
|
+
data() {
|
|
91
|
+
return {
|
|
92
|
+
modelDependencyName: 'puiusermodelconfig',
|
|
93
|
+
dialog: true,
|
|
94
|
+
method: 'create',
|
|
95
|
+
model: {
|
|
96
|
+
configuration: {}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
computed: {
|
|
101
|
+
getEditSaveTitle() {
|
|
102
|
+
if (this.method === 'create') {
|
|
103
|
+
return this.$t('puidatatables.new_configuration');
|
|
104
|
+
} else {
|
|
105
|
+
return this.$t('puidatatables.edit_configuration');
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
availableConfigurations() {
|
|
109
|
+
return this.modelGridConfigurations.filter((config) => {
|
|
110
|
+
return config.id !== -1;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
watch: {
|
|
115
|
+
method(newVal) {
|
|
116
|
+
this.modelSetted = false;
|
|
117
|
+
if (newVal === 'update') {
|
|
118
|
+
const availableConfigurations = this.availableConfigurations;
|
|
119
|
+
if (availableConfigurations.length > 0) {
|
|
120
|
+
this.model = availableConfigurations[0];
|
|
121
|
+
this.modelSetted = true;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
created() {
|
|
127
|
+
this.modelGridConfigurations = this.$store.getters.getGridConfigurationsForModel(this.modelName);
|
|
128
|
+
},
|
|
129
|
+
methods: {
|
|
130
|
+
beforeSave() {
|
|
131
|
+
if (!this.model.configuration.name) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
this.model = this.$parent.beforeSave({
|
|
135
|
+
name: this.model.configuration.name,
|
|
136
|
+
description: this.model.configuration.description,
|
|
137
|
+
isdefault: this.model.configuration.isdefault
|
|
138
|
+
});
|
|
139
|
+
if (this.method === 'create') {
|
|
140
|
+
this.model.id = null;
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
afterSave(savedConfig) {
|
|
144
|
+
this.$parent.afterSave(savedConfig);
|
|
145
|
+
},
|
|
146
|
+
onSaveError() {
|
|
147
|
+
this.$parent.onSaveError();
|
|
148
|
+
},
|
|
149
|
+
getData() {
|
|
150
|
+
this.$parent.getData();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
</script>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pui-gridActionsBtn">
|
|
3
|
+
<v-btn
|
|
4
|
+
:id="`gridbtn-create-${modelName}`"
|
|
5
|
+
icon
|
|
6
|
+
class="elevation-0 pui-toolbar__actionBtn primary white--text"
|
|
7
|
+
:class="compClass"
|
|
8
|
+
:title="$t('puigridcreate.title')"
|
|
9
|
+
@click.native.stop="onCreateBtn"
|
|
10
|
+
>
|
|
11
|
+
<v-icon>far fa-plus-circle</v-icon>
|
|
12
|
+
</v-btn>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
export default {
|
|
18
|
+
name: 'PuiGridCreateBtn',
|
|
19
|
+
data() {
|
|
20
|
+
return {};
|
|
21
|
+
},
|
|
22
|
+
props: {
|
|
23
|
+
modelName: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: true
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
computed: {
|
|
29
|
+
compClass() {
|
|
30
|
+
return this.$store.getters.isMobile ? 'pui-toolbar__actionBtn--mobile' : 'pui-toolbar__actionBtn--desktop';
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
methods: {
|
|
34
|
+
onCreateBtn() {
|
|
35
|
+
this.$parent.$parent.$refs.table.goToElement(null, 'create');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
</script>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pui-gridActionsBtn">
|
|
3
|
+
<v-btn
|
|
4
|
+
:id="`gridbtn-delete-${modelName}`"
|
|
5
|
+
icon
|
|
6
|
+
class="elevation-0 pui-toolbar__actionBtn white--text secondary"
|
|
7
|
+
:class="compClass"
|
|
8
|
+
:title="$t('puigriddelete.title')"
|
|
9
|
+
@click.native.stop="onDeleteBtnShowDialog"
|
|
10
|
+
>
|
|
11
|
+
<v-icon>far fa-trash-alt</v-icon>
|
|
12
|
+
</v-btn>
|
|
13
|
+
<!-- delete registry modal dialog -->
|
|
14
|
+
<pui-modal-dialog
|
|
15
|
+
v-if="showDeleteRegistryDialog"
|
|
16
|
+
:cancelText="$t('form.cancel')"
|
|
17
|
+
:okText="$t('pui9.accept')"
|
|
18
|
+
:titleText="$t('pui9.delete.title')"
|
|
19
|
+
:messageText="$t('pui9.delete.confirm')"
|
|
20
|
+
:dialogName="`deleteRegistry-${this.modelName}`"
|
|
21
|
+
></pui-modal-dialog>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
import $ from 'jquery';
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
name: 'PuiGridDeleteBtn',
|
|
30
|
+
data() {
|
|
31
|
+
return {
|
|
32
|
+
completeGridName: null,
|
|
33
|
+
showDeleteRegistryDialog: false,
|
|
34
|
+
selectedRow: null
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
props: {
|
|
38
|
+
modelName: {
|
|
39
|
+
type: String,
|
|
40
|
+
required: true
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
computed: {
|
|
44
|
+
compClass() {
|
|
45
|
+
return this.$store.getters.isMobile ? 'pui-toolbar__actionBtn--mobile' : 'pui-toolbar__actionBtn--desktop';
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
created() {
|
|
49
|
+
this.completeGridName = this.modelName + '_' + this.$store.getters.getGridNumberOfInstances(this.modelName);
|
|
50
|
+
},
|
|
51
|
+
mounted() {
|
|
52
|
+
// delete registry modal
|
|
53
|
+
this.$puiEvents.$on(`pui-modalDialog-deleteRegistry-${this.modelName}-ok`, () => {
|
|
54
|
+
this.$puiEvents.$emit(`onPui-apply-delete-${this.modelName}`, this.selectedRow);
|
|
55
|
+
this.showDeleteRegistryDialog = false;
|
|
56
|
+
});
|
|
57
|
+
this.$puiEvents.$on(`pui-modalDialog-deleteRegistry-${this.modelName}-cancel`, () => {
|
|
58
|
+
this.showDeleteRegistryDialog = false;
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
destroyed() {
|
|
62
|
+
this.$puiEvents.$off(`pui-modalDialog-deleteRegistry-${this.modelName}-ok`);
|
|
63
|
+
this.$puiEvents.$off(`pui-modalDialog-deleteRegistry-${this.modelName}-cancel`);
|
|
64
|
+
},
|
|
65
|
+
methods: {
|
|
66
|
+
onDeleteBtnShowDialog() {
|
|
67
|
+
const selectedRows = $('#' + this.completeGridName)
|
|
68
|
+
.DataTable()
|
|
69
|
+
.rows('.selected')[0].length;
|
|
70
|
+
|
|
71
|
+
if (selectedRows > 1) {
|
|
72
|
+
this.$puiNotify.warning(this.$t('puigriddelete.notdeletemorethanone'), '', null, false);
|
|
73
|
+
} else {
|
|
74
|
+
this.selectedRow = $('#' + this.completeGridName)
|
|
75
|
+
.DataTable()
|
|
76
|
+
.row('.selected');
|
|
77
|
+
if (this.selectedRow && this.selectedRow.data()) {
|
|
78
|
+
this.showDeleteRegistryDialog = true;
|
|
79
|
+
} else {
|
|
80
|
+
this.$puiNotify.warning(this.$t('puigriddelete.notselectedrow'), '', null, false);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
</script>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pui-gridActionsBtn">
|
|
3
|
+
<v-btn
|
|
4
|
+
:id="`gridbtn-refresh-${modelName}`"
|
|
5
|
+
icon
|
|
6
|
+
class="elevation-0 pui-toolbar__actionBtn white--text primary"
|
|
7
|
+
:class="compClass"
|
|
8
|
+
:title="$t('puigridrefresh.title')"
|
|
9
|
+
@click.native.stop="onRefreshBtn"
|
|
10
|
+
>
|
|
11
|
+
<v-icon>far fa-redo</v-icon>
|
|
12
|
+
</v-btn>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
export default {
|
|
18
|
+
name: 'PuiGridRefreshBtn',
|
|
19
|
+
data() {
|
|
20
|
+
return {};
|
|
21
|
+
},
|
|
22
|
+
props: {
|
|
23
|
+
modelName: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: true
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
computed: {
|
|
29
|
+
compClass() {
|
|
30
|
+
return this.$store.getters.isMobile ? 'pui-toolbar__actionBtn--mobile' : 'pui-toolbar__actionBtn--desktop';
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
methods: {
|
|
34
|
+
onRefreshBtn() {
|
|
35
|
+
this.$parent.$parent.$refs.table.reloadGrid();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
</script>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pui-gridActionsBtn">
|
|
3
|
+
<v-btn
|
|
4
|
+
:id="`gridbtn-update-${modelName}`"
|
|
5
|
+
icon
|
|
6
|
+
class="elevation-0 pui-toolbar__actionBtn white--text primary"
|
|
7
|
+
:class="compClass"
|
|
8
|
+
:title="$t('puigridupdate.title')"
|
|
9
|
+
@click.native.stop="onUpdateBtn"
|
|
10
|
+
>
|
|
11
|
+
<v-icon>far fa-edit</v-icon>
|
|
12
|
+
</v-btn>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
import $ from 'jquery';
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
name: 'PuiGridUpdateBtn',
|
|
21
|
+
data() {
|
|
22
|
+
return {
|
|
23
|
+
completeGridName: null,
|
|
24
|
+
selectedRow: null
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
props: {
|
|
28
|
+
modelName: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: true
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
computed: {
|
|
34
|
+
compClass() {
|
|
35
|
+
return this.$store.getters.isMobile ? 'pui-toolbar__actionBtn--mobile' : 'pui-toolbar__actionBtn--desktop';
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
mounted() {
|
|
39
|
+
this.completeGridName = this.modelName + '_' + this.$store.getters.getGridNumberOfInstances(this.modelName);
|
|
40
|
+
},
|
|
41
|
+
methods: {
|
|
42
|
+
onUpdateBtn() {
|
|
43
|
+
this.selectedRow = $('#' + this.completeGridName)
|
|
44
|
+
.DataTable()
|
|
45
|
+
.row('.selected');
|
|
46
|
+
|
|
47
|
+
if (this.selectedRow && this.selectedRow.data()) {
|
|
48
|
+
const data = { row: this.selectedRow, method: 'update' };
|
|
49
|
+
this.$puiEvents.$emit(`onPui-apply-edit-${this.modelName}`, data);
|
|
50
|
+
} else {
|
|
51
|
+
this.$puiNotify.warning(this.$t('puigridedit.notselectedrow'), '', null, false);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
</script>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex-grow-1 puiGridSearcher" :class="compClass" @click.stop>
|
|
3
|
+
<div
|
|
4
|
+
class="v-btn__content flex-grow-0 puiGridSearcher__icon"
|
|
5
|
+
@click="
|
|
6
|
+
states.active = !states.active;
|
|
7
|
+
goDialog();
|
|
8
|
+
"
|
|
9
|
+
:title="getTitle"
|
|
10
|
+
>
|
|
11
|
+
<v-icon style="font-size: 1.2rem" small :class="compIconClass">fa fa-search</v-icon>
|
|
12
|
+
<v-icon v-if="!active" style="font-size: 0.75rem" :class="compIconClass">fa fa-sm fa-caret-down</v-icon>
|
|
13
|
+
<v-icon v-else style="font-size: 0.75rem" :class="compIconClass">fa fa-sm fa-caret-up</v-icon>
|
|
14
|
+
</div>
|
|
15
|
+
<v-text-field
|
|
16
|
+
id="puigridsearcherinput"
|
|
17
|
+
@focus="
|
|
18
|
+
states.active = !states.active;
|
|
19
|
+
hideDialog();
|
|
20
|
+
"
|
|
21
|
+
v-model="input.searchingText"
|
|
22
|
+
class="puiGridSearcher__textInput"
|
|
23
|
+
hide-details
|
|
24
|
+
single-line
|
|
25
|
+
solo
|
|
26
|
+
outlined
|
|
27
|
+
flat
|
|
28
|
+
:placeholder="getPlaceholder"
|
|
29
|
+
@keyup="goSearch"
|
|
30
|
+
@click:clear="goClearSearch"
|
|
31
|
+
clearable
|
|
32
|
+
></v-text-field>
|
|
33
|
+
<pui-grid-searcher-columns-list
|
|
34
|
+
v-show="active"
|
|
35
|
+
:position="panel.position"
|
|
36
|
+
:modelName="modelName"
|
|
37
|
+
ref="searchdialog"
|
|
38
|
+
></pui-grid-searcher-columns-list>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script>
|
|
43
|
+
import PuiSearcherMixin from '../../../../mixins/PuiSearcherMixin';
|
|
44
|
+
import PuiGridSearcherColumnsList from './PuiGridSearcherColumnsList';
|
|
45
|
+
|
|
46
|
+
export default {
|
|
47
|
+
name: 'PuiGridSearcher',
|
|
48
|
+
mixins: [PuiSearcherMixin],
|
|
49
|
+
components: {
|
|
50
|
+
PuiGridSearcherColumnsList
|
|
51
|
+
},
|
|
52
|
+
data() {
|
|
53
|
+
return {
|
|
54
|
+
idTool: 'gridsearcher'
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<style>
|
|
61
|
+
#puigridsearcherinput {
|
|
62
|
+
margin-left: 20px !important;
|
|
63
|
+
}
|
|
64
|
+
.puiGridSearcher .v-input__control {
|
|
65
|
+
max-height: 36px !important;
|
|
66
|
+
}
|
|
67
|
+
</style>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-card flat class="puiSearcherColumnsList pl-3 pr-3 pt-1 pb-1 elevation-5" :style="compStyle" :ref="'dialog'" @click.stop>
|
|
3
|
+
<v-layout class="mt-1">
|
|
4
|
+
<v-flex xs8 class="puiSearcherColumnsList__textSwitch">{{ $t('puidatatables.searchAll') }}</v-flex>
|
|
5
|
+
<v-flex xs2>
|
|
6
|
+
<pui-switch label v-model="searchAll"></pui-switch>
|
|
7
|
+
</v-flex>
|
|
8
|
+
</v-layout>
|
|
9
|
+
<v-layout>
|
|
10
|
+
<v-flex xs12>{{ $t('puidatatables.columns') }}</v-flex>
|
|
11
|
+
</v-layout>
|
|
12
|
+
<v-layout class="mt-2" :style="compStyleMaxHeight">
|
|
13
|
+
<v-flex xs12>
|
|
14
|
+
<pui-checkbox
|
|
15
|
+
v-for="column in checkColumns"
|
|
16
|
+
:key="column.title"
|
|
17
|
+
:label="column.title"
|
|
18
|
+
:disabled="searchAll"
|
|
19
|
+
v-model="column.checked"
|
|
20
|
+
@input="onChange"
|
|
21
|
+
></pui-checkbox>
|
|
22
|
+
</v-flex>
|
|
23
|
+
</v-layout>
|
|
24
|
+
</v-card>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
import PuiSearcherColumnsListMixin from '../../../../mixins/PuiSearcherColumnsListMixin';
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
name: 'PuiGridSearcherColumnsList',
|
|
32
|
+
mixins: [PuiSearcherColumnsListMixin],
|
|
33
|
+
methods: {
|
|
34
|
+
onChange() {
|
|
35
|
+
setTimeout(() => {
|
|
36
|
+
if (!this.checkColumns.find(c => c.checked)) {
|
|
37
|
+
this.checkFirstElement();
|
|
38
|
+
}
|
|
39
|
+
}, 100);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
</script>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pui-toolbar__multiBtn ml-2" :class="compClass">
|
|
3
|
+
<div ref="btn">
|
|
4
|
+
<v-btn
|
|
5
|
+
class="elevation-0 pui-toolbar__bt pui-toolbar__btn pui-toolbar__miniBtn"
|
|
6
|
+
:class="compClass"
|
|
7
|
+
@click.native="toggleSorting()"
|
|
8
|
+
:title="$t('puidatatables.titleBtnEnableDisableSorting')"
|
|
9
|
+
>
|
|
10
|
+
<v-icon small>fa fa-sort-amount-down</v-icon>
|
|
11
|
+
</v-btn>
|
|
12
|
+
<div class="pui-toolbar__multiBtnSeparator">|</div>
|
|
13
|
+
<v-btn
|
|
14
|
+
class="elevation-0 pui-toolbar__btn pui-toolbar__superMiniBtn"
|
|
15
|
+
@click.native.stop="states.active = !states.active"
|
|
16
|
+
:class="compClass"
|
|
17
|
+
:title="$t('puidatatables.titleBtnShowHideSorting')"
|
|
18
|
+
>
|
|
19
|
+
<v-icon v-if="!states.active" small>fa fa-angle-down</v-icon>
|
|
20
|
+
<v-icon v-else small>fa fa-angle-up</v-icon>
|
|
21
|
+
</v-btn>
|
|
22
|
+
</div>
|
|
23
|
+
<pui-grid-sort-dialog
|
|
24
|
+
:columns="columns"
|
|
25
|
+
:modelName="modelName"
|
|
26
|
+
:position="panel.position"
|
|
27
|
+
:groupedColumn="groupedColumn"
|
|
28
|
+
v-show="states.active"
|
|
29
|
+
></pui-grid-sort-dialog>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script>
|
|
34
|
+
import PuiSortBtnMixin from '../../../../mixins/PuiSortBtnMixin';
|
|
35
|
+
import PuiGridSortDialog from './PuiGridSortDialog';
|
|
36
|
+
|
|
37
|
+
export default {
|
|
38
|
+
name: 'PuiGridSortBtn',
|
|
39
|
+
mixins: [PuiSortBtnMixin],
|
|
40
|
+
components: {
|
|
41
|
+
PuiGridSortDialog
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
</script>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pui-dialog pui-dialog--sorting elevation-5" ref="dialog" @click.stop>
|
|
3
|
+
<v-layout wrap>
|
|
4
|
+
<v-flex xs-8 md-6 lg-4 xl-3>
|
|
5
|
+
<v-card flat>
|
|
6
|
+
<v-card-text class="pt-0 pr-2 pl-0 pb-0">
|
|
7
|
+
<!-- slot1, TODO MAKE SLOTS IN FILTER AND SORTING DIALOGS-->
|
|
8
|
+
<v-list-item>
|
|
9
|
+
<v-list-item-action-text class="pui-dialog__title">{{ $t('puidatatables.sort') }}</v-list-item-action-text>
|
|
10
|
+
</v-list-item>
|
|
11
|
+
<v-flex xs12 class="pui-dialog__ruleContainer mb-1" :style="{ height: heightPanel }">
|
|
12
|
+
<draggable v-model="rules" v-bind="{ group: 'rules' }" @end="removeSelectsFocus">
|
|
13
|
+
<div v-for="(rule, index) in rules" class="pui-dialog__rule pui-dialog__rule--small ml-1" :key="index">
|
|
14
|
+
<v-layout wrap class="rule">
|
|
15
|
+
<v-flex xs1>
|
|
16
|
+
<v-list-item class="move draggable_point" v-show="(grouped === true && index === 0) === false">
|
|
17
|
+
<v-icon small>far fa-ellipsis-v</v-icon>
|
|
18
|
+
<v-icon small>far fa-ellipsis-v</v-icon>
|
|
19
|
+
</v-list-item>
|
|
20
|
+
</v-flex>
|
|
21
|
+
<v-flex xs6 class="pr-2">
|
|
22
|
+
<v-autocomplete
|
|
23
|
+
class="font-size-12"
|
|
24
|
+
label="column"
|
|
25
|
+
append-icon="fa fa-angle-down"
|
|
26
|
+
v-model="rule.column"
|
|
27
|
+
:ref="`${index}-column`"
|
|
28
|
+
:disabled="grouped === true && index === 0"
|
|
29
|
+
solo
|
|
30
|
+
flat
|
|
31
|
+
@change="setIndex(index), onRuleNameChanged($event, index)"
|
|
32
|
+
:items="getAvailableColumns(index)"
|
|
33
|
+
item-text="title"
|
|
34
|
+
item-value="name"
|
|
35
|
+
hide-selected
|
|
36
|
+
></v-autocomplete>
|
|
37
|
+
</v-flex>
|
|
38
|
+
<v-flex xs4>
|
|
39
|
+
<v-select
|
|
40
|
+
append-icon="fa fa-angle-down"
|
|
41
|
+
class="font-size-12"
|
|
42
|
+
v-model="rule.direction"
|
|
43
|
+
:ref="`${index}-sortType`"
|
|
44
|
+
solo
|
|
45
|
+
flat
|
|
46
|
+
:items="sortingTypes"
|
|
47
|
+
:label="$t('puidatatables.ascendent')"
|
|
48
|
+
></v-select>
|
|
49
|
+
</v-flex>
|
|
50
|
+
<v-flex xs1 class="pointer" @click="removeRule(index)" v-show="(grouped === true && index === 0) === false">
|
|
51
|
+
<v-list-item>
|
|
52
|
+
<v-icon small class="trashIcon" :title="getTitleRemove">fa fa-trash-alt</v-icon>
|
|
53
|
+
</v-list-item>
|
|
54
|
+
</v-flex>
|
|
55
|
+
</v-layout>
|
|
56
|
+
</div>
|
|
57
|
+
</draggable>
|
|
58
|
+
</v-flex>
|
|
59
|
+
<v-flex xs12 v-show="showAddBtn">
|
|
60
|
+
<v-btn class="btnAdd elevation-0 mt-0 mb-1" @click="addRule()">
|
|
61
|
+
<v-icon small>far fa-plus</v-icon>
|
|
62
|
+
<span>{{ $t('puidatatables.addRule') }}</span>
|
|
63
|
+
</v-btn>
|
|
64
|
+
</v-flex>
|
|
65
|
+
</v-card-text>
|
|
66
|
+
<!-- slot1-->
|
|
67
|
+
<v-card-actions class="ma-0 pb-1 pr-1 pl-1">
|
|
68
|
+
<v-btn text outlined @click="reset()" class="pui-dialog__button">{{ $t('puidatatables.reset') }}</v-btn>
|
|
69
|
+
<v-spacer></v-spacer>
|
|
70
|
+
<v-btn color="primary" @click="publishSorting()" class="elevation-0">{{ $t('form.apply') }}</v-btn>
|
|
71
|
+
</v-card-actions>
|
|
72
|
+
</v-card>
|
|
73
|
+
</v-flex>
|
|
74
|
+
</v-layout>
|
|
75
|
+
</div>
|
|
76
|
+
</template>
|
|
77
|
+
|
|
78
|
+
<script>
|
|
79
|
+
import PuiSortDialogMixin from '../../../../mixins/PuiSortDialogMixin';
|
|
80
|
+
|
|
81
|
+
export default {
|
|
82
|
+
name: 'PuiGridSortDialog',
|
|
83
|
+
mixins: [PuiSortDialogMixin]
|
|
84
|
+
};
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<style lang="postcss" scoped>
|
|
88
|
+
.trashIcon {
|
|
89
|
+
top: 10px;
|
|
90
|
+
position: absolute;
|
|
91
|
+
}
|
|
92
|
+
.btnAdd {
|
|
93
|
+
height: 28px !important;
|
|
94
|
+
color: var(--N-500);
|
|
95
|
+
&.v-btn {
|
|
96
|
+
background-color: var(--N-0) !important;
|
|
97
|
+
}
|
|
98
|
+
& span {
|
|
99
|
+
padding-left: 6px;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.draggable_point .v-icon {
|
|
104
|
+
margin-top: -12px;
|
|
105
|
+
color: var(--N-50);
|
|
106
|
+
}
|
|
107
|
+
.draggable_btn {
|
|
108
|
+
width: 20px !important;
|
|
109
|
+
& .v-icon {
|
|
110
|
+
margin-top: -12px;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
</style>
|