pui9-components 2.0.7 → 3.0.0
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 +5403 -22189
- package/dist/pui9-components.css +3 -6
- package/package-lock.json +635 -774
- package/package.json +1 -5
- package/src/App.vue +0 -117
- package/src/components/PuiAutocomplete.vue +0 -196
- package/src/components/PuiCauDialog.vue +0 -192
- package/src/components/PuiCheckbox.vue +0 -126
- package/src/components/PuiCodeEditor.vue +0 -124
- package/src/components/PuiDateField.vue +0 -1043
- package/src/components/PuiField.vue +0 -30
- package/src/components/PuiFieldSet.vue +0 -27
- package/src/components/PuiFileUpload.vue +0 -275
- package/src/components/PuiFileUploadGroup.vue +0 -241
- package/src/components/PuiFilter.vue +0 -104
- package/src/components/PuiFilterGroup.vue +0 -291
- package/src/components/PuiFilterRule.vue +0 -683
- package/src/components/PuiFormFooter.vue +0 -48
- package/src/components/PuiFormFooterBtns.vue +0 -118
- package/src/components/PuiFormHeader.vue +0 -25
- package/src/components/PuiFormLoading.vue +0 -14
- package/src/components/PuiFormMiniAudit.vue +0 -53
- package/src/components/PuiFormTooltip.vue +0 -50
- package/src/components/PuiMasterDetail.vue +0 -103
- package/src/components/PuiModalDialog.vue +0 -91
- package/src/components/PuiModalDialogForm.vue +0 -209
- package/src/components/PuiMultiSelect.vue +0 -636
- package/src/components/PuiNumberField.vue +0 -434
- package/src/components/PuiPasswordField.vue +0 -105
- package/src/components/PuiRadioGroup.vue +0 -105
- package/src/components/PuiRichTextEditor.vue +0 -116
- package/src/components/PuiSelect.vue +0 -1675
- package/src/components/PuiSelectDetailDialog.vue +0 -113
- package/src/components/PuiSelectTextService.vue +0 -61
- package/src/components/PuiSelectorList.vue +0 -169
- package/src/components/PuiSort.vue +0 -98
- package/src/components/PuiSpinnerField.vue +0 -464
- package/src/components/PuiSwitch.vue +0 -104
- package/src/components/PuiTextArea.vue +0 -204
- package/src/components/PuiTextField.vue +0 -389
- package/src/dateTimeUtils.js +0 -78
- package/src/index.js +0 -89
- package/src/main.js +0 -34
- package/src/mixins/PuiFormComponentMixin.js +0 -77
- package/src/mixins/PuiSortMixin.js +0 -136
- package/src/mixins/PuiUtilsNumberMixin.js +0 -29
- package/src/plugins/vuetify.js +0 -33
- package/src/tests/TestAutocomplete.vue +0 -138
- package/src/tests/TestCodeEditor.vue +0 -48
- package/src/tests/TestField.vue +0 -22
- package/src/tests/TestFieldSet.vue +0 -30
- package/src/tests/TestInputCheckbox.vue +0 -53
- package/src/tests/TestInputDate.vue +0 -146
- package/src/tests/TestInputNumber.vue +0 -77
- package/src/tests/TestInputRadioGroup.vue +0 -86
- package/src/tests/TestInputSpinner.vue +0 -77
- package/src/tests/TestInputSwitch.vue +0 -52
- package/src/tests/TestInputText.vue +0 -120
- package/src/tests/TestInputTextArea.vue +0 -73
- package/src/tests/TestMultiSelect.vue +0 -127
- package/src/tests/TestPuiForm.vue +0 -68
- package/src/tests/TestRichTextEditor.vue +0 -54
- package/src/tests/unit/PuiCheckbox.spec.js +0 -86
- package/src/tests/unit/PuiTextArea.spec.js +0 -62
- package/src/tests/unit/PuiTextField.spec.js +0 -119
- package/src/tests/unit/index.js +0 -5
- package/src/utils.js +0 -158
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-container class="pa-2 mb-2 puiFilterGroup" @mouseover.stop="showGroupBtns = true" @mouseout="showGroupBtns = false">
|
|
3
|
-
<!-- Operador lógico para el grupo -->
|
|
4
|
-
<v-col xs="12" class="pa-0 mb-n2 d-flex">
|
|
5
|
-
<span class="pa-0 pt-2 pr-3">{{ $t('labelGroup') }}</span>
|
|
6
|
-
<v-select
|
|
7
|
-
v-model="filterGroupModel.groupOp"
|
|
8
|
-
class="pr-2"
|
|
9
|
-
style="max-width: 100px !important"
|
|
10
|
-
:items="groupOperators"
|
|
11
|
-
:label="$t('or')"
|
|
12
|
-
append-icon="fa fa-angle-down"
|
|
13
|
-
:disabled="disabled"
|
|
14
|
-
solo
|
|
15
|
-
flat
|
|
16
|
-
hide-details
|
|
17
|
-
></v-select>
|
|
18
|
-
</v-col>
|
|
19
|
-
|
|
20
|
-
<!-- Selects reglas -->
|
|
21
|
-
<v-col cols="12" v-if="filterGroupModel.rules && filterGroupModel.rules.length > 0">
|
|
22
|
-
<v-row v-for="(rule, index) in filterGroupModel.rules" :key="index">
|
|
23
|
-
<v-col xs12 class="pt-2 pa-0 pl-0 pr-2 d-flex">
|
|
24
|
-
<pui-filter-rule
|
|
25
|
-
:ref="`rule${index}`"
|
|
26
|
-
:ruleIndexProp="index"
|
|
27
|
-
:groupName="groupName"
|
|
28
|
-
:columnsProp="columnsProp"
|
|
29
|
-
:filterColumnValues="filterColumnValues"
|
|
30
|
-
:filterRuleProp="rule"
|
|
31
|
-
:disabled="disabled"
|
|
32
|
-
@change="onFilterRuleChanges(index)"
|
|
33
|
-
></pui-filter-rule>
|
|
34
|
-
<v-icon v-if="disabled === false" class="mt-2 ml-2 mr-n1" small v-ripple="false" @click="removeRule(index)"
|
|
35
|
-
>fa fa-trash-alt</v-icon
|
|
36
|
-
>
|
|
37
|
-
</v-col>
|
|
38
|
-
</v-row>
|
|
39
|
-
</v-col>
|
|
40
|
-
|
|
41
|
-
<!-- Filter group -->
|
|
42
|
-
<v-col cols="12" v-if="filterGroupModel.groups.length > 0" class="pa-0 pt-4">
|
|
43
|
-
<pui-filter-group
|
|
44
|
-
v-for="(group, index) in filterGroupModel.groups"
|
|
45
|
-
:ref="`group${index}`"
|
|
46
|
-
:groupIndexProp="index"
|
|
47
|
-
:filterGroupProp="group"
|
|
48
|
-
:columnsProp="columnsProp"
|
|
49
|
-
:filterColumnValues="filterColumnValues"
|
|
50
|
-
:showSubgroupBtn="showSubgroupBtn"
|
|
51
|
-
:disabled="disabled"
|
|
52
|
-
:key="index"
|
|
53
|
-
@change="onFilterGroupChanges(index)"
|
|
54
|
-
></pui-filter-group>
|
|
55
|
-
</v-col>
|
|
56
|
-
|
|
57
|
-
<!-- Buttons acciones -->
|
|
58
|
-
<v-col cols="12" class="elevation-0" :class="isRootGroup && filterGroupModel.groups.length > 0 ? 'pa-0 pt-0' : 'pa-0 pt-3'">
|
|
59
|
-
<v-btn v-if="disabled === false" class="btnGroup btnAddRule elevation-0" @click="addRule">
|
|
60
|
-
<v-icon small>far fa-plus</v-icon>
|
|
61
|
-
<span>{{ $t('addRule') }}</span>
|
|
62
|
-
</v-btn>
|
|
63
|
-
<v-btn v-if="showSubgroupBtn && disabled === false" class="btnGroup btnAddGroup elevation-0 ml-1" @click="addSubGroup">
|
|
64
|
-
<v-icon small>fa fa-layer-group</v-icon>
|
|
65
|
-
<span>{{ $t('addSubGroup') }}</span>
|
|
66
|
-
</v-btn>
|
|
67
|
-
<v-btn v-if="!isRootGroup && disabled === false" class="btnGroup btnRemGroup elevation-0 ml-1" @click="removeGroup">
|
|
68
|
-
<v-icon small>fa fa-trash-alt</v-icon>
|
|
69
|
-
<span>{{ $t('removeGroup') }}</span>
|
|
70
|
-
</v-btn>
|
|
71
|
-
</v-col>
|
|
72
|
-
</v-container>
|
|
73
|
-
</template>
|
|
74
|
-
|
|
75
|
-
<script>
|
|
76
|
-
import PuiFilterRule from './PuiFilterRule';
|
|
77
|
-
|
|
78
|
-
export default {
|
|
79
|
-
name: 'PuiFilterGroup',
|
|
80
|
-
components: {
|
|
81
|
-
PuiFilterRule
|
|
82
|
-
},
|
|
83
|
-
props: {
|
|
84
|
-
isRootGroup: {
|
|
85
|
-
type: Boolean,
|
|
86
|
-
default: false
|
|
87
|
-
},
|
|
88
|
-
groupIndexProp: {
|
|
89
|
-
type: Number,
|
|
90
|
-
default: 0
|
|
91
|
-
},
|
|
92
|
-
filterGroupProp: {
|
|
93
|
-
required: true
|
|
94
|
-
},
|
|
95
|
-
columnsProp: {
|
|
96
|
-
type: Array,
|
|
97
|
-
required: true
|
|
98
|
-
},
|
|
99
|
-
filterColumnValues: {
|
|
100
|
-
type: Object,
|
|
101
|
-
required: false,
|
|
102
|
-
},
|
|
103
|
-
disabled: {
|
|
104
|
-
type: Boolean,
|
|
105
|
-
default: false
|
|
106
|
-
},
|
|
107
|
-
showSubgroupBtn: {
|
|
108
|
-
type: Boolean
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
data() {
|
|
112
|
-
return {
|
|
113
|
-
filterGroupModel: this.getDefaultFilterGroupModel(),
|
|
114
|
-
showDeleteRule: null,
|
|
115
|
-
showGroupBtns: null,
|
|
116
|
-
groupOperators: [
|
|
117
|
-
{
|
|
118
|
-
text: 'and',
|
|
119
|
-
value: 'and'
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
text: 'or',
|
|
123
|
-
value: 'or'
|
|
124
|
-
}
|
|
125
|
-
]
|
|
126
|
-
};
|
|
127
|
-
},
|
|
128
|
-
computed: {
|
|
129
|
-
groupName() {
|
|
130
|
-
return this.isRootGroup ? this.groupIndexProp.toString() : this.$parent.groupName + '-' + this.groupIndexProp;
|
|
131
|
-
},
|
|
132
|
-
parentGroupName() {
|
|
133
|
-
return this.isRootGroup ? null : this.$parent.groupName;
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
watch: {
|
|
137
|
-
filterGroupProp() {
|
|
138
|
-
if (this.filterGroupProp) {
|
|
139
|
-
this.filterGroupModel = this.filterGroupProp;
|
|
140
|
-
this.filterGroupModel.groupOp ? '':this.filterGroupModel.groupOp = 'and';
|
|
141
|
-
this.filterGroupModel.groups ? '':this.filterGroupModel.groups = [];
|
|
142
|
-
this.filterGroupModel.rules ? '':this.filterGroupModel.rules = [];
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
filterGroupModel: {
|
|
146
|
-
deep: true,
|
|
147
|
-
handler() {
|
|
148
|
-
this.$emit('change', this.filterGroupModel);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
created() {
|
|
153
|
-
this.translateGroupOperators();
|
|
154
|
-
if (this.filterGroupProp) {
|
|
155
|
-
this.filterGroupModel = this.filterGroupProp;
|
|
156
|
-
this.filterGroupModel.groupOp ? '':this.filterGroupModel.groupOp = 'and';
|
|
157
|
-
this.filterGroupModel.groups ? '':this.filterGroupModel.groups = [];
|
|
158
|
-
this.filterGroupModel.rules ? '':this.filterGroupModel.rules = [];
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
mounted() {
|
|
162
|
-
this.$puiEvents.$on('reset-filtering', this.reset);
|
|
163
|
-
this.$puiEvents.$on(`groupRemoved-${this.groupName}`, this.onGroupRemoved);
|
|
164
|
-
this.$puiEvents.$on(`subGroupAdded-${this.groupName}`, this.onSubGroupAdded);
|
|
165
|
-
|
|
166
|
-
if (this.filterGroupModel.rules.length === 0 && this.filterGroupModel.groups.length === 0) {
|
|
167
|
-
this.addRule();
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
destroyed() {
|
|
171
|
-
this.$puiEvents.$off('reset-filtering');
|
|
172
|
-
this.$puiEvents.$off(`groupRemoved-${this.groupName}`);
|
|
173
|
-
this.$puiEvents.$off(`subGroupAdded-${this.groupName}`);
|
|
174
|
-
},
|
|
175
|
-
methods: {
|
|
176
|
-
getUniqueIndex() {
|
|
177
|
-
let numberSTR = Math.random().toString().replace('.', Math.random().toString().replace('.', '').substring(0, 10)).substring(0, 20);
|
|
178
|
-
let numberInt = parseInt(numberSTR).toFixed();
|
|
179
|
-
let integer = parseInt(numberInt);
|
|
180
|
-
return integer;
|
|
181
|
-
},
|
|
182
|
-
translateGroupOperators() {
|
|
183
|
-
for (let i = 0, length = this.groupOperators.length; i < length; i++) {
|
|
184
|
-
this.groupOperators[i].text = this.$t(this.groupOperators[i].text);
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
reset() {
|
|
188
|
-
if(this.isRootGroup) {
|
|
189
|
-
this.filterGroupModel = this.getDefaultFilterGroupModel();
|
|
190
|
-
this.addRule();
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
},
|
|
194
|
-
onGroupRemoved(index) {
|
|
195
|
-
//alert('soy el grupo ' + this.groupName + ` recibo el evento en el grupo ${this.groupName} con el indice ${index}`);
|
|
196
|
-
this.filterGroupModel.groups.splice(index, 1);
|
|
197
|
-
},
|
|
198
|
-
onFilterGroupChanges(index) {
|
|
199
|
-
this.filterGroupModel.groups[index] = this.$refs[`group${index}`][0].filterGroupModel;
|
|
200
|
-
},
|
|
201
|
-
onFilterRuleChanges(index) {
|
|
202
|
-
this.filterGroupModel.rules[index] = this.$refs[`rule${index}`][0].filterRuleModel;
|
|
203
|
-
},
|
|
204
|
-
addSubGroup() {
|
|
205
|
-
this.filterGroupModel.groups.push(this.getDefaultFilterGroupModel());
|
|
206
|
-
this.filterGroupModel.groups.at(-1).rules.push(PuiFilterRule.methods.getDefaultFilterRuleModel());
|
|
207
|
-
},
|
|
208
|
-
removeGroup() {
|
|
209
|
-
// alert('soy el grupo ' + this.groupName + ` mando el evento al grupo ${this.parentGroupName} con el indice ${this.groupIndexProp}`);
|
|
210
|
-
if (!this.isRootGroup) {
|
|
211
|
-
this.$puiEvents.$emit(`groupRemoved-${this.parentGroupName}`, this.groupIndexProp);
|
|
212
|
-
} else {
|
|
213
|
-
this.groupFilterModel.groups = [];
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
addRule() {
|
|
217
|
-
this.filterGroupModel.rules.push(PuiFilterRule.methods.getDefaultFilterRuleModel());
|
|
218
|
-
},
|
|
219
|
-
removeRule(index) {
|
|
220
|
-
this.filterGroupModel.rules.splice(index, 1);
|
|
221
|
-
},
|
|
222
|
-
getDefaultFilterGroupModel() {
|
|
223
|
-
return {
|
|
224
|
-
rules: [],
|
|
225
|
-
groups: [],
|
|
226
|
-
groupOp: 'and',
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
</script>
|
|
232
|
-
|
|
233
|
-
<style lang="postcss" scoped>
|
|
234
|
-
.btnGroup {
|
|
235
|
-
height: 28px !important;
|
|
236
|
-
color: var(--N-500);
|
|
237
|
-
& span {
|
|
238
|
-
padding-left: 6px;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
.puiFilterGroup {
|
|
242
|
-
background-color: var(--N-0);
|
|
243
|
-
border-color: var(--N-100);
|
|
244
|
-
border-style: solid;
|
|
245
|
-
border-radius: 5px;
|
|
246
|
-
border-width: 1px;
|
|
247
|
-
|
|
248
|
-
&__groupOperator {
|
|
249
|
-
height: 50px;
|
|
250
|
-
}
|
|
251
|
-
&__bottombar {
|
|
252
|
-
background-color: transparent !important;
|
|
253
|
-
}
|
|
254
|
-
& .puiFilterGroup {
|
|
255
|
-
background-color: var(--N-10);
|
|
256
|
-
& .v-btn {
|
|
257
|
-
background-color: var(--N-10);
|
|
258
|
-
}
|
|
259
|
-
& .puiFilterGroup {
|
|
260
|
-
background-color: var(--N-0);
|
|
261
|
-
& .v-btn {
|
|
262
|
-
background-color: var(--N-0);
|
|
263
|
-
}
|
|
264
|
-
& .puiFilterGroup {
|
|
265
|
-
background-color: var(--N-10);
|
|
266
|
-
& .v-btn {
|
|
267
|
-
background-color: var(--N-10);
|
|
268
|
-
}
|
|
269
|
-
& .puiFilterGroup {
|
|
270
|
-
background-color: var(--N-0);
|
|
271
|
-
& .v-btn {
|
|
272
|
-
background-color: var(--N-0);
|
|
273
|
-
}
|
|
274
|
-
& .puiFilterGroup {
|
|
275
|
-
background-color: var(--N-10);
|
|
276
|
-
& .v-btn {
|
|
277
|
-
background-color: var(--N-10);
|
|
278
|
-
}
|
|
279
|
-
& .puiFilterGroup {
|
|
280
|
-
background-color: var(--N-0);
|
|
281
|
-
& .v-btn {
|
|
282
|
-
background-color: var(--N-0);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
</style>
|