pui9-components 1.17.3 → 2.0.7
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/dist/pui9-components.common.js +75007 -52512
- package/dist/pui9-components.css +9 -2
- package/package-lock.json +6651 -6827
- package/package.json +22 -26
- package/src/components/PuiCauDialog.vue +192 -0
- package/src/components/PuiCheckbox.vue +25 -4
- package/src/components/PuiCodeEditor.vue +2 -1
- package/src/components/PuiDateField.vue +653 -614
- package/src/components/PuiField.vue +1 -1
- package/src/components/PuiFileUpload.vue +275 -0
- package/src/components/PuiFileUploadGroup.vue +241 -0
- package/src/components/PuiFilter.vue +54 -52
- package/src/components/PuiFilterGroup.vue +179 -179
- package/src/components/PuiFilterRule.vue +481 -162
- package/src/components/PuiFormFooter.vue +5 -38
- package/src/components/PuiFormTooltip.vue +50 -0
- package/src/components/PuiMasterDetail.vue +18 -11
- package/src/components/PuiModalDialog.vue +4 -1
- package/src/components/PuiModalDialogForm.vue +5 -1
- package/src/components/PuiMultiSelect.vue +383 -280
- package/src/components/PuiNumberField.vue +216 -285
- package/src/components/PuiRichTextEditor.vue +43 -44
- package/src/components/PuiSelect.vue +382 -355
- package/src/components/PuiSelectDetailDialog.vue +10 -3
- package/src/components/PuiSelectorList.vue +169 -0
- package/src/components/PuiSort.vue +98 -0
- package/src/components/PuiSpinnerField.vue +101 -121
- package/src/components/PuiTextField.vue +374 -258
- package/src/index.js +8 -0
- package/src/main.js +1 -0
- package/src/mixins/PuiFormComponentMixin.js +2 -8
- package/src/mixins/PuiSortMixin.js +136 -0
- package/src/mixins/PuiUtilsNumberMixin.js +15 -5
- package/src/plugins/vuetify.js +2 -1
- package/src/utils.js +10 -0
- package/dist/demo.html +0 -10
- package/dist/pui9-components.common.js.map +0 -1
- package/dist/pui9-components.umd.js +0 -86432
- package/dist/pui9-components.umd.js.map +0 -1
- package/dist/pui9-components.umd.min.js +0 -308
- package/dist/pui9-components.umd.min.js.map +0 -1
- package/src/mixins/PuiFilterMixin.js +0 -157
- package/src/mixins/PuiMultiSelectMixin.js +0 -106
package/package.json
CHANGED
|
@@ -4,42 +4,40 @@
|
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Prodevelop S.L."
|
|
6
6
|
},
|
|
7
|
-
"version": "
|
|
7
|
+
"version": "2.0.7",
|
|
8
8
|
"license": "Copyright",
|
|
9
9
|
"main": "dist/pui9-components.common.js",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"serve": "vue-cli-service serve",
|
|
12
|
-
"build-bundle": "vue-cli-service build --target lib --name pui9-components ./src/index.js",
|
|
12
|
+
"build-bundle": "vue-cli-service build --target lib --formats commonjs --name pui9-components ./src/index.js",
|
|
13
13
|
"prepare": "npm run build-bundle",
|
|
14
14
|
"lint": "vue-cli-service lint",
|
|
15
|
-
"test:unit": "vue-cli-service test:unit"
|
|
15
|
+
"test:unit": "vue-cli-service test:unit --watchAll"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"moment-timezone": "0.5.34",
|
|
18
|
+
"jodit": "3.24.9",
|
|
19
|
+
"moment": "2.29.4",
|
|
20
|
+
"sanitize-html": "2.7.3",
|
|
22
21
|
"vue-codemirror": "4.0.6",
|
|
23
22
|
"vue-infinite-loading": "2.4.5",
|
|
24
|
-
"sanitize-html": "2.7.3",
|
|
25
23
|
"vuedraggable": "2.24.3"
|
|
26
24
|
},
|
|
27
25
|
"devDependencies": {
|
|
28
|
-
"@
|
|
29
|
-
"@vue/cli-plugin-
|
|
30
|
-
"@vue/cli-plugin-
|
|
31
|
-
"@vue/cli-
|
|
32
|
-
"@vue/cli-service": "4.5.15",
|
|
26
|
+
"@vue/cli-plugin-babel": "4.5.19",
|
|
27
|
+
"@vue/cli-plugin-eslint": "4.5.19",
|
|
28
|
+
"@vue/cli-plugin-unit-jest": "5.0.8",
|
|
29
|
+
"@vue/cli-service": "4.5.19",
|
|
33
30
|
"autoprefixer": "9.8.6",
|
|
34
|
-
"@vue/test-utils": "1.
|
|
35
|
-
"@vue/vue2-jest": "
|
|
31
|
+
"@vue/test-utils": "1.3.3",
|
|
32
|
+
"@vue/vue2-jest": "29.2.1",
|
|
36
33
|
"babel-eslint": "10.1.0",
|
|
37
|
-
"babel-jest": "
|
|
38
|
-
"css-loader": "
|
|
39
|
-
"core-js": "3.
|
|
34
|
+
"babel-jest": "29.3.1",
|
|
35
|
+
"css-loader": "5.2.7",
|
|
36
|
+
"core-js": "3.26.1",
|
|
40
37
|
"deepmerge": "4.2.2",
|
|
41
38
|
"eslint": "6.8.0",
|
|
42
39
|
"eslint-plugin-vue": "6.2.2",
|
|
40
|
+
"postcss": "8.4.20",
|
|
43
41
|
"postcss-css-variables": "0.18.0",
|
|
44
42
|
"postcss-import": "12.0.1",
|
|
45
43
|
"postcss-loader": "4.3.0",
|
|
@@ -47,14 +45,12 @@
|
|
|
47
45
|
"postcss-url": "8.0.0",
|
|
48
46
|
"sass": "1.27.0",
|
|
49
47
|
"sass-loader": "10.0.2",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"vue": "2.
|
|
53
|
-
"vue-
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"vuetify-loader": "1.7.3",
|
|
57
|
-
"vuetify": "2.6.6",
|
|
48
|
+
"vue": "2.7.14",
|
|
49
|
+
"vue-i18n": "8.28.2",
|
|
50
|
+
"vue-cli-plugin-vuetify": "2.5.8",
|
|
51
|
+
"vue-template-compiler": "2.7.14",
|
|
52
|
+
"vuetify-loader": "1.9.2",
|
|
53
|
+
"vuetify": "2.6.12",
|
|
58
54
|
"vuex": "3.6.2"
|
|
59
55
|
},
|
|
60
56
|
"eslintConfig": {
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-container class="puiCau">
|
|
3
|
+
<v-dialog v-model="dialogModel" width="700" @click:outside="closeDialog()">
|
|
4
|
+
<v-card>
|
|
5
|
+
<v-toolbar elevation="3" height="50" color="light-blue darken-3">
|
|
6
|
+
<v-spacer></v-spacer>
|
|
7
|
+
<v-toolbar-title style="color: white">{{ getBtnTitle }}</v-toolbar-title>
|
|
8
|
+
<v-spacer></v-spacer>
|
|
9
|
+
<v-icon color="white" @click="closeDialog()">fas fa-window-close</v-icon>
|
|
10
|
+
</v-toolbar>
|
|
11
|
+
|
|
12
|
+
<v-card-text>
|
|
13
|
+
<v-form ref="form">
|
|
14
|
+
<v-container class="pa-0 pt-4">
|
|
15
|
+
<pui-text-field v-model="model.subject" :label="$t('puicau.subject')" toplabel required></pui-text-field>
|
|
16
|
+
<pui-text-area v-model="model.content" :label="$t('puicau.content')" toplabel required></pui-text-area>
|
|
17
|
+
<pui-select
|
|
18
|
+
v-if="dialogModel"
|
|
19
|
+
:label="$t('puicau.urgency')"
|
|
20
|
+
v-model="model"
|
|
21
|
+
:items="urgencyValues"
|
|
22
|
+
:modelFormMapping="{ urgency: 'urgency' }"
|
|
23
|
+
:itemsToSelect="itemsToSelect"
|
|
24
|
+
:itemValue="['urgency']"
|
|
25
|
+
itemText="text"
|
|
26
|
+
toplabel
|
|
27
|
+
required
|
|
28
|
+
></pui-select>
|
|
29
|
+
|
|
30
|
+
<!-- adjuntos -->
|
|
31
|
+
<pui-field-set v-if="isLogged" :title="$t('form.puidocument.title')" class="mt-0 mb-8">
|
|
32
|
+
<pui-file-upload-group v-model="model.files" ref="fileUploadGroup" :minDocuments="0"></pui-file-upload-group>
|
|
33
|
+
</pui-field-set>
|
|
34
|
+
|
|
35
|
+
<pui-field-set :title="$t('puicau.contact')" class="pa-4 pb-0">
|
|
36
|
+
<pui-text-field
|
|
37
|
+
v-model="model.name"
|
|
38
|
+
:label="$t('puicau.name')"
|
|
39
|
+
toplabel
|
|
40
|
+
required
|
|
41
|
+
:readonly="getUser != null"
|
|
42
|
+
></pui-text-field>
|
|
43
|
+
<pui-text-field
|
|
44
|
+
v-model="model.email"
|
|
45
|
+
:label="$t('puicau.email')"
|
|
46
|
+
toplabel
|
|
47
|
+
emailMask
|
|
48
|
+
required
|
|
49
|
+
:readonly="getEmail != null"
|
|
50
|
+
></pui-text-field>
|
|
51
|
+
<pui-text-field v-model="model.phone" :label="$t('puicau.phone')" toplabel required></pui-text-field>
|
|
52
|
+
</pui-field-set>
|
|
53
|
+
</v-container>
|
|
54
|
+
</v-form>
|
|
55
|
+
</v-card-text>
|
|
56
|
+
|
|
57
|
+
<v-divider></v-divider>
|
|
58
|
+
|
|
59
|
+
<v-card-actions>
|
|
60
|
+
<v-btn color="primary" text @click="closeDialog()">Cancelar</v-btn>
|
|
61
|
+
<v-spacer></v-spacer>
|
|
62
|
+
<v-btn color="secondary" text @click="send(model)">Enviar</v-btn>
|
|
63
|
+
</v-card-actions>
|
|
64
|
+
</v-card>
|
|
65
|
+
</v-dialog>
|
|
66
|
+
</v-container>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<script>
|
|
70
|
+
export default {
|
|
71
|
+
name: 'PuiCauDialog',
|
|
72
|
+
props: {
|
|
73
|
+
dialogModel: {
|
|
74
|
+
required: true
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
data() {
|
|
78
|
+
return {
|
|
79
|
+
model: null,
|
|
80
|
+
urgencyValues: [
|
|
81
|
+
{
|
|
82
|
+
text: this.$t('puicau.urgencyValues.maximum'),
|
|
83
|
+
urgency: 'MAXIMUM'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
text: this.$t('puicau.urgencyValues.high'),
|
|
87
|
+
urgency: 'HIGH'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
text: this.$t('puicau.urgencyValues.medium'),
|
|
91
|
+
urgency: 'MEDIUM'
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
text: this.$t('puicau.urgencyValues.low'),
|
|
95
|
+
urgency: 'LOW'
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
computed: {
|
|
101
|
+
isIssueTicketActive() {
|
|
102
|
+
return this.$store.getters.isIssueTicketActive;
|
|
103
|
+
},
|
|
104
|
+
getUser() {
|
|
105
|
+
return this.$store.getters.getSession.name;
|
|
106
|
+
},
|
|
107
|
+
getEmail() {
|
|
108
|
+
return this.$store.getters.getSession.email;
|
|
109
|
+
},
|
|
110
|
+
isLogged() {
|
|
111
|
+
return this.getUser != null;
|
|
112
|
+
},
|
|
113
|
+
getBtnTitle() {
|
|
114
|
+
return this.isLogged ? this.$t('puicau.menu_entry') : this.$t('puicau.title');
|
|
115
|
+
},
|
|
116
|
+
itemsToSelect() {
|
|
117
|
+
return [{urgency: this.model.urgency}]
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
created() {
|
|
121
|
+
this.setInitialValues();
|
|
122
|
+
},
|
|
123
|
+
methods: {
|
|
124
|
+
setInitialValues() {
|
|
125
|
+
this.model = this.getEmptyModel();
|
|
126
|
+
this.model.name = this.getUser;
|
|
127
|
+
this.model.email = this.getEmail;
|
|
128
|
+
},
|
|
129
|
+
getEmptyModel() {
|
|
130
|
+
return {
|
|
131
|
+
subject: null,
|
|
132
|
+
content: null,
|
|
133
|
+
urgency: null,
|
|
134
|
+
name: null,
|
|
135
|
+
email: null,
|
|
136
|
+
phone: null,
|
|
137
|
+
files: []
|
|
138
|
+
};
|
|
139
|
+
},
|
|
140
|
+
send(formData) {
|
|
141
|
+
if (this.$refs.form.validate() && this.validateFileUploads()) {
|
|
142
|
+
let fileData = new window.FormData();
|
|
143
|
+
if (this.isLogged && this.model && this.model.files && this.model.files.length > 0) {
|
|
144
|
+
this.model.files.forEach((file) =>
|
|
145
|
+
fileData.append('files', file.selectedFile, file.selectedFile.name)
|
|
146
|
+
);
|
|
147
|
+
} /*else {
|
|
148
|
+
fileData.append('files', new Blob(), ''); // EMPTY BLOB
|
|
149
|
+
}*/
|
|
150
|
+
|
|
151
|
+
delete formData.files;
|
|
152
|
+
|
|
153
|
+
this.$puiRequests.uploadFileRequest(
|
|
154
|
+
'/issueTicket',
|
|
155
|
+
fileData,
|
|
156
|
+
() => {
|
|
157
|
+
this.closeDialog();
|
|
158
|
+
},
|
|
159
|
+
(error) => {
|
|
160
|
+
console.log(error)
|
|
161
|
+
this.$puiNotify.error(error.message);
|
|
162
|
+
this.dialog = false;
|
|
163
|
+
},
|
|
164
|
+
formData // as parameters
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
validateFileUploads() {
|
|
169
|
+
if (!this.isLogged) {
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return this.$refs.fileUploadGroup.validateFileUploads();
|
|
174
|
+
},
|
|
175
|
+
closeDialog() {
|
|
176
|
+
this.setInitialValues();
|
|
177
|
+
this.$puiEvents.$emit('pui-modalDialogForm-cau-close');
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
</script>
|
|
182
|
+
|
|
183
|
+
<style lang="postcss">
|
|
184
|
+
.puiCau {
|
|
185
|
+
position: absolute;
|
|
186
|
+
bottom: 0;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.v-btn--plain .v-btn__content {
|
|
190
|
+
opacity: 1 !important;
|
|
191
|
+
}
|
|
192
|
+
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-checkbox
|
|
3
3
|
:class="isRequired"
|
|
4
|
-
class="ml-2 mr-2"
|
|
4
|
+
class="d-flex ml-2 mr-2"
|
|
5
5
|
:label="getLabel"
|
|
6
6
|
:rules="getRules"
|
|
7
7
|
v-model="internalModel"
|
|
@@ -12,7 +12,14 @@
|
|
|
12
12
|
:true-value="trueValue"
|
|
13
13
|
color="primary"
|
|
14
14
|
:error="internalError"
|
|
15
|
-
|
|
15
|
+
>
|
|
16
|
+
<template v-slot:label>
|
|
17
|
+
<v-container class="d-flex pa-0 align-center">
|
|
18
|
+
<span>{{ label }}</span>
|
|
19
|
+
<pui-form-tooltip v-bind="{ tooltipDescription, tooltipIcon }" v-if="showTooltip" ref="tooltip"></pui-form-tooltip>
|
|
20
|
+
</v-container>
|
|
21
|
+
</template>
|
|
22
|
+
</v-checkbox>
|
|
16
23
|
</template>
|
|
17
24
|
|
|
18
25
|
<script>
|
|
@@ -41,7 +48,15 @@ export default {
|
|
|
41
48
|
type: [Boolean, String, Number],
|
|
42
49
|
default: true,
|
|
43
50
|
required: false
|
|
44
|
-
}
|
|
51
|
+
},
|
|
52
|
+
tooltipDescription: {
|
|
53
|
+
type: String,
|
|
54
|
+
required: false
|
|
55
|
+
},
|
|
56
|
+
tooltipIcon: {
|
|
57
|
+
type: String,
|
|
58
|
+
required: false,
|
|
59
|
+
},
|
|
45
60
|
},
|
|
46
61
|
computed: {
|
|
47
62
|
getRules() {
|
|
@@ -64,7 +79,13 @@ export default {
|
|
|
64
79
|
},
|
|
65
80
|
requiredMessage() {
|
|
66
81
|
return this.$t('pui9.error.field_selected');
|
|
67
|
-
}
|
|
82
|
+
},
|
|
83
|
+
showTooltip() {
|
|
84
|
+
if (this.getLabel === '' || this.getLabel === null) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
return this.tooltipDescription || this.tooltip;
|
|
88
|
+
}
|
|
68
89
|
},
|
|
69
90
|
watch: {
|
|
70
91
|
value(val) {
|
|
@@ -91,7 +91,8 @@ export default {
|
|
|
91
91
|
const self = this;
|
|
92
92
|
this.editor = CodeMirror.fromTextArea(this.$refs.codemirror, {
|
|
93
93
|
mode: this.mode,
|
|
94
|
-
lineNumbers: true
|
|
94
|
+
lineNumbers: true,
|
|
95
|
+
lineWrapping: true
|
|
95
96
|
});
|
|
96
97
|
this.editor.on('change', (editor) => {
|
|
97
98
|
this.data = editor.getValue();
|