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
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
data() {
|
|
3
|
-
return {
|
|
4
|
-
filterOperators: {
|
|
5
|
-
common: [
|
|
6
|
-
{
|
|
7
|
-
text: 'equal',
|
|
8
|
-
value: 'eq'
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
text: 'notEqual',
|
|
12
|
-
value: 'ne'
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
text: 'isNotNull',
|
|
16
|
-
value: 'nn'
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
text: 'isNull',
|
|
20
|
-
value: 'nu'
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
text: 'in',
|
|
24
|
-
value: 'in'
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
text: 'notIn',
|
|
28
|
-
value: 'ni'
|
|
29
|
-
}
|
|
30
|
-
],
|
|
31
|
-
numeric: [
|
|
32
|
-
{
|
|
33
|
-
text: 'lessThan',
|
|
34
|
-
value: 'lt'
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
text: 'greaterEqualThan',
|
|
38
|
-
value: 'ge'
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
text: 'lessEqualThan',
|
|
42
|
-
value: 'le'
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
text: 'greaterThan',
|
|
46
|
-
value: 'gt'
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
text: 'between',
|
|
50
|
-
value: 'bt'
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
text: 'notBetween',
|
|
54
|
-
value: 'nbt'
|
|
55
|
-
}
|
|
56
|
-
],
|
|
57
|
-
text: [
|
|
58
|
-
{
|
|
59
|
-
text: 'contains',
|
|
60
|
-
value: 'cn'
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
text: 'notContains',
|
|
64
|
-
value: 'nc'
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
text: 'endsWith',
|
|
68
|
-
value: 'ew'
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
text: 'notEndsWith',
|
|
72
|
-
value: 'en'
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
text: 'beginsWith',
|
|
76
|
-
value: 'bw'
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
text: 'notBeginsWith',
|
|
80
|
-
value: 'bn'
|
|
81
|
-
}
|
|
82
|
-
],
|
|
83
|
-
date: [], //son igual que los numericos, solo que tendran un datetime picker en el input,
|
|
84
|
-
datetime: [
|
|
85
|
-
{
|
|
86
|
-
text: 'equalToday',
|
|
87
|
-
value: 'eqt'
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
text: 'notEqualToday',
|
|
91
|
-
value: 'net'
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
text: 'lessThanToday',
|
|
95
|
-
value: 'ltt'
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
text: 'greaterThanToday',
|
|
99
|
-
value: 'gtt'
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
text: 'lessEqualThanToday',
|
|
103
|
-
value: 'let'
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
text: 'greaterEqualThanToday',
|
|
107
|
-
value: 'get'
|
|
108
|
-
}
|
|
109
|
-
], //idem
|
|
110
|
-
decimal: [] //idem
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
},
|
|
114
|
-
props: {
|
|
115
|
-
columns: {
|
|
116
|
-
type: Array,
|
|
117
|
-
required: true
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
created() {
|
|
121
|
-
this.translateFilterOperators();
|
|
122
|
-
this.addCommonAndDecimalAndDateFilterOperators();
|
|
123
|
-
},
|
|
124
|
-
methods: {
|
|
125
|
-
getRules() {
|
|
126
|
-
return [(value) => !!value || 'Required'];
|
|
127
|
-
},
|
|
128
|
-
translateFilterOperators() {
|
|
129
|
-
for (const colType in this.filterOperators) {
|
|
130
|
-
for (let i = 0, length = this.filterOperators[colType].length; i < length; i++) {
|
|
131
|
-
this.filterOperators[colType][i].text = this.$t(this.filterOperators[colType][i].text);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
addCommonAndDecimalAndDateFilterOperators() {
|
|
136
|
-
const commonKey = 'common';
|
|
137
|
-
for (const colType in this.filterOperators) {
|
|
138
|
-
if (colType === commonKey) {
|
|
139
|
-
continue;
|
|
140
|
-
} else if (colType === 'decimal') {
|
|
141
|
-
this.filterOperators[colType] = this.filterOperators.numeric;
|
|
142
|
-
} else if (colType === 'date' || colType === 'datetime') {
|
|
143
|
-
this.filterOperators[colType] = this.filterOperators[colType].concat(this.filterOperators.numeric);
|
|
144
|
-
}
|
|
145
|
-
this.filterOperators[colType] = this.filterOperators[colType].concat(this.filterOperators[commonKey]);
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
getColumnType(columnName) {
|
|
149
|
-
for (let i = 0, columnsLength = this.columns.length; i < columnsLength; i++) {
|
|
150
|
-
if (this.columns[i].name === columnName) {
|
|
151
|
-
return this.columns[i].type;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return null;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
};
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
props: {
|
|
3
|
-
value: {
|
|
4
|
-
required: false
|
|
5
|
-
},
|
|
6
|
-
/* Array of Objects provided by the parent component */
|
|
7
|
-
items: {
|
|
8
|
-
type: Array,
|
|
9
|
-
default: null,
|
|
10
|
-
required: true
|
|
11
|
-
},
|
|
12
|
-
/**
|
|
13
|
-
* Los items seleccionados que se pasan de inicio, se pasa en la directiva v-model al utilizar este componente
|
|
14
|
-
* puede ser un array de Items igual que en la propiedad :items, o un array con los id's solamente
|
|
15
|
-
*/
|
|
16
|
-
itemsToSelect: {
|
|
17
|
-
type: Array,
|
|
18
|
-
default: () => []
|
|
19
|
-
},
|
|
20
|
-
trackItemsToSelect: {
|
|
21
|
-
type: Boolean,
|
|
22
|
-
default: false
|
|
23
|
-
},
|
|
24
|
-
/* Type: String
|
|
25
|
-
The items text property name */
|
|
26
|
-
itemText: {
|
|
27
|
-
type: [String, Array, Function],
|
|
28
|
-
default: 'text'
|
|
29
|
-
},
|
|
30
|
-
/* Type: String
|
|
31
|
-
The items id property name */
|
|
32
|
-
itemValue: {
|
|
33
|
-
type: [String, Array, Function],
|
|
34
|
-
default: 'value'
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
data() {
|
|
38
|
-
return {
|
|
39
|
-
itemTextMultiple: false,
|
|
40
|
-
itemValueMultiple: false,
|
|
41
|
-
itemTextNested: false,
|
|
42
|
-
itemValueNested: false,
|
|
43
|
-
search: '',
|
|
44
|
-
selected: false
|
|
45
|
-
};
|
|
46
|
-
},
|
|
47
|
-
watch: {
|
|
48
|
-
items(newValue, oldValue) {
|
|
49
|
-
const newValueStr = JSON.stringify(newValue);
|
|
50
|
-
const oldValueStr = JSON.stringify(oldValue);
|
|
51
|
-
if (newValueStr !== oldValueStr) {
|
|
52
|
-
this.selectItems();
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
itemsToSelect: {
|
|
56
|
-
handler() {
|
|
57
|
-
this.trackItemsToSelect === true && this.selectItems();
|
|
58
|
-
},
|
|
59
|
-
deep: true
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
created() {
|
|
63
|
-
this.checkItemText();
|
|
64
|
-
this.checkItemValue();
|
|
65
|
-
|
|
66
|
-
this.selectItems();
|
|
67
|
-
},
|
|
68
|
-
methods: {
|
|
69
|
-
checkForNestedFields(stringField) {
|
|
70
|
-
if (stringField instanceof Function) {
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return stringField.split('.').length > 1;
|
|
75
|
-
},
|
|
76
|
-
checkItemText() {
|
|
77
|
-
this.itemTextMultiple = Array.isArray(this.itemText);
|
|
78
|
-
if (this.itemTextMultiple === false) {
|
|
79
|
-
this.itemTextNested = this.checkForNestedFields(this.itemText);
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
checkItemValue() {
|
|
83
|
-
this.itemValueMultiple = Array.isArray(this.itemValue);
|
|
84
|
-
if (this.itemValueMultiple === false) {
|
|
85
|
-
this.itemValueNested = this.checkForNestedFields(this.itemValue);
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
selectItems() {
|
|
89
|
-
this.selectedItems = [];
|
|
90
|
-
|
|
91
|
-
this.setAvailableItems && this.setAvailableItems();
|
|
92
|
-
if (!this.itemsToSelect || this.itemsToSelect.length === 0) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
this.getSelectedItems();
|
|
97
|
-
|
|
98
|
-
this.selected = true;
|
|
99
|
-
},
|
|
100
|
-
getSelectedItems() {
|
|
101
|
-
for (let i = 0, length = this.itemsToSelect.length; i < length; i++) {
|
|
102
|
-
this.selectItemById(this.itemsToSelect[i][this.itemValue] || this.itemsToSelect[i], this.itemsToSelect[i]);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
};
|