@tripup-company/element-ui-extended 0.0.10 → 0.0.14
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 +126 -52
- package/dist/element-ui-extended.common.js +384 -101
- package/dist/element-ui-extended.common.js.map +1 -1
- package/dist/element-ui-extended.umd.js +384 -101
- package/dist/element-ui-extended.umd.js.map +1 -1
- package/dist/element-ui-extended.umd.min.js +1 -1
- package/dist/element-ui-extended.umd.min.js.map +1 -1
- package/package.json +3 -3
- package/src/components/CompositeTable/index.vue +24 -29
- package/src/components/GenericFilters/FilterRow.vue +143 -49
- package/src/components/GenericFilters/QuickSearchFilter.vue +2 -1
- package/src/components/GenericTable/index.vue +0 -4
- package/src/App.vue +0 -64
- package/src/components/HelloWorld.vue +0 -122
- package/src/filters.js +0 -64
- package/src/models/contact-model.ts +0 -23
- package/src/test/unit/components/TestComponent.vue +0 -15
- package/src/types/article.js +0 -6
- package/src/types/article.js.map +0 -1
- package/src/types/icontact.ts +0 -17
package/README.md
CHANGED
|
@@ -1,34 +1,114 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
# Element-ui-extended
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
|
|
5
|
+
- [Install](#install)
|
|
6
|
+
- [Features](#features)
|
|
7
|
+
- [Usage](#usage)
|
|
8
|
+
* [CompositeTable](#compositeTable)
|
|
9
|
+
* [EditableField](#editableField)
|
|
10
|
+
* [GenericFilter](#genericFilter)
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
# using in your project
|
|
16
|
+
npm i @tripup-company/element-ui-extended
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
|
|
21
|
+
- Create the table with filters and pagination (CompositeTable)
|
|
22
|
+
- Use directly components:
|
|
23
|
+
- CompositeTable
|
|
24
|
+
- EditableField
|
|
25
|
+
- GenericFilter
|
|
26
|
+
- GenericTable
|
|
27
|
+
- GeneticPaginator
|
|
28
|
+
- NewField
|
|
29
|
+
- PartColumnEdit
|
|
30
|
+
- PartColumnNew
|
|
31
|
+
- PartForm
|
|
32
|
+
- QuickSearchFilter
|
|
33
|
+
___
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
### CompositeTable
|
|
37
|
+
CompositeTable is component that combine such components GenericTable, GenericFilters, GenericTopFilters
|
|
7
38
|
|
|
8
|
-
|
|
39
|
+

|
|
40
|
+
|
|
41
|
+
[CompositeTable docs](/docs/index.html#/components/CompositeTable)
|
|
42
|
+
```vue
|
|
43
|
+
<composite-table :storage-key="key" :fields="fields" :top-filter="topFilter" :filters="filters" :repository="$api.countries()" />
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
import config from '../settings/config';
|
|
48
|
+
import { CompositeTable } from '@tripup-company/element-ui-extended';
|
|
49
|
+
export default {
|
|
50
|
+
components: { CompositeTable },
|
|
51
|
+
data () {
|
|
52
|
+
return {
|
|
53
|
+
fields: config.tableFields(this.$router),
|
|
54
|
+
filters: config.filters,
|
|
55
|
+
key: 'storage.key',
|
|
56
|
+
topFilter: {
|
|
57
|
+
name: 'first_name,last_name,email,phone,mobile,position,street,city,state,second_email,department',
|
|
58
|
+
label: 'Search',
|
|
59
|
+
type: 'string',
|
|
60
|
+
operator: 'like_fields',
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
9
65
|
```
|
|
10
|
-
|
|
66
|
+
config.js
|
|
67
|
+
```json config.js
|
|
68
|
+
export default {
|
|
69
|
+
tableFields: ($router) =>
|
|
70
|
+
[
|
|
71
|
+
{
|
|
72
|
+
prop: 'id',
|
|
73
|
+
label: '#',
|
|
74
|
+
width: 70,
|
|
75
|
+
callback: (field, index, row) => {
|
|
76
|
+
$router.push('/cruises/edit/' + row.id);
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
prop: 'ship.data.ship', label: 'Ship', callback: (field, index, row) => {
|
|
81
|
+
$router.push('/cruises/edit/' + row.id);
|
|
82
|
+
},
|
|
83
|
+
formatter: row => {
|
|
84
|
+
return row.ship.data.ship;
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
filters: [
|
|
89
|
+
{
|
|
90
|
+
name: 'created_at',
|
|
91
|
+
label: 'Created at',
|
|
92
|
+
type: 'date',
|
|
93
|
+
operator: 'between_date',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'country',
|
|
97
|
+
label: 'Country',
|
|
98
|
+
type: 'string',
|
|
99
|
+
},
|
|
100
|
+
]
|
|
101
|
+
}
|
|
11
102
|
```
|
|
103
|
+
___
|
|
12
104
|
|
|
13
|
-
###
|
|
14
|
-
|
|
15
|
-
npm run build
|
|
16
|
-
```
|
|
105
|
+
### EditableField
|
|
106
|
+
NewField, EditableField- components that combine such components of element io: el-checkbox, el-input-number, el-select, el-date-picker, el-input
|
|
17
107
|
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
npm run lint
|
|
21
|
-
```
|
|
108
|
+
These components are quickly configurable through the config and are needed to shorten the code, we can render elements use loop
|
|
22
109
|
|
|
23
|
-
|
|
24
|
-
See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
110
|
+
[EditableField docs](/docs/index.html#/components/EditableField)
|
|
25
111
|
|
|
26
|
-
NewField, EditableField are powerful components that combine such components of element io: el-checkbox, el-input-number, el-select, el-date-picker, el-input
|
|
27
|
-
====
|
|
28
|
-
These components are quickly configurable through the config and are needed to shorten the code, we can render elements use loop
|
|
29
|
-
---
|
|
30
|
-
Works with Vue 2.*, example:
|
|
31
|
-
---
|
|
32
112
|
```
|
|
33
113
|
<editable-field
|
|
34
114
|
v-model="data[prop]"
|
|
@@ -44,21 +124,22 @@ Works with Vue 2.*, example:
|
|
|
44
124
|
@editable:save="updateValue"
|
|
45
125
|
/>
|
|
46
126
|
```
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
127
|
+
___
|
|
128
|
+
### GenericFilter
|
|
129
|
+
|
|
130
|
+
GenericFilter - component for work with filter ( template with checkbox for use selected filters)
|
|
131
|
+
|
|
132
|
+
[GenericFilter docs](/docs/index.html#/components/GenericFilter)
|
|
133
|
+
|
|
134
|
+
```vue
|
|
135
|
+
<generic-filter
|
|
136
|
+
v-if="filters.length"
|
|
137
|
+
:filters="filters"
|
|
138
|
+
:search="search"
|
|
139
|
+
@apply:filter="handleApplyFilter"
|
|
140
|
+
@reset:filter="handleResetFilter"
|
|
141
|
+
/>
|
|
142
|
+
```
|
|
62
143
|
|
|
63
144
|
PartColumn is component that show part of form with it title and configured column resolution
|
|
64
145
|
====
|
|
@@ -85,14 +166,13 @@ Attributes
|
|
|
85
166
|
|data|data biding values for fields|Object|—|{}|
|
|
86
167
|
|errors|errors for fields|Object|—|{}|
|
|
87
168
|
|
|
88
|
-
|
|
89
|
-
===
|
|
169
|
+
|
|
90
170
|
Attributes
|
|
91
171
|
---
|
|
92
|
-
|Attribute name|Description|Type|
|
|
93
|
-
| --- | --- | --- | --- |
|
|
94
|
-
|filters| all filters for show| Array | [] |
|
|
95
|
-
|search| selected filters | Array | [] |
|
|
172
|
+
|Attribute name|Description|Type|Default|
|
|
173
|
+
| --- | --- | --- | --- |
|
|
174
|
+
|filters| all filters for show| Array | [] |
|
|
175
|
+
|search| selected filters | Array | [] |
|
|
96
176
|
|
|
97
177
|
Example filters:
|
|
98
178
|
```
|
|
@@ -120,7 +200,6 @@ Example search:
|
|
|
120
200
|
},
|
|
121
201
|
first_name,last_name,email,phone,mobile,position,street,city,state,second_email,department: {
|
|
122
202
|
operator: "like_fields"
|
|
123
|
-
position: "top"
|
|
124
203
|
value: ""
|
|
125
204
|
}
|
|
126
205
|
}
|
|
@@ -132,11 +211,6 @@ Events
|
|
|
132
211
|
|
|
133
212
|
@reset:filter
|
|
134
213
|
|
|
135
|
-
GenericTopFilters - component for work with filter (template without checkbox)
|
|
136
|
-
===
|
|
137
|
-
Attributes and events such as GenericFilter component
|
|
138
|
-
---
|
|
139
|
-
|
|
140
214
|
|
|
141
215
|
GenericTable - component for show table
|
|
142
216
|
===
|
|
@@ -168,7 +242,7 @@ Events
|
|
|
168
242
|
|
|
169
243
|
@page:change
|
|
170
244
|
|
|
171
|
-
CompositeTable is component that combine such components GenericTable, GenericFilters, GenericTopFilters
|
|
172
245
|
====
|
|
173
246
|
|
|
174
247
|
|
|
248
|
+
|