@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 CHANGED
@@ -1,34 +1,114 @@
1
- # element-ui-extended
2
-
3
- ## Project setup
4
- ```
5
- npm install
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
- ### Compiles and hot-reloads for development
39
+ ![CompositeTable diagram](https://github.com/tripup-company/element-ui-extended/blob/added_documentation/docs/diagram.jpg?raw=true)
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
- npm run serve
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
- ### Compiles and minifies for production
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
- ### Lints and fixes files
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
- ### Customize configuration
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
- Attributes
48
- ---
49
- |Attribute name|Description|Type|Accepted values|Default|
50
- | --- | --- | --- | --- | --- |
51
- |field|field key in model|String|—|''|
52
- |value|field value - binding value|String, Boolean, Date, Number, Array|—|''|
53
- |type|type element from Accepted values|String|checkbox select date-picker number textarea input|input|
54
- |placeholder|placeholder for this field|String|—|''|
55
- |select-key|selectKey in select-list|String|—|''|
56
- |select-label|selectLabel in select-list|String|—|''|
57
- |remote-method|remote method for select search|Object|—|null|
58
- |step|incremental step|Number|—|1|
59
- |precision|precision of input value|Number|—|0|
60
- |select-multiple|is select Multiple|Boolean|—|false|
61
- |select-list|list for select|Array|—|[]|
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
- GenericFilters - component for work with filter ( template with checkbox for use selected filters)
89
- ===
169
+
90
170
  Attributes
91
171
  ---
92
- |Attribute name|Description|Type|Accepted values|Default|
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
+