@dile/crud 0.0.13 → 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/components/crud/src/DileCrud.js +58 -44
- package/lib/defaultConfig.js +1 -0
- package/package.json +2 -2
|
@@ -99,13 +99,15 @@ export class DileCrud extends DileCrudMixin(LitElement) {
|
|
|
99
99
|
get modalInsert() {
|
|
100
100
|
return this.shadowRoot.getElementById('modalInsert');
|
|
101
101
|
}
|
|
102
|
-
|
|
103
102
|
get listElement() {
|
|
104
103
|
return this.shadowRoot.querySelector('dile-crud-list');
|
|
105
104
|
}
|
|
106
105
|
get deleteElement() {
|
|
107
106
|
return this.shadowRoot.getElementById('eldelete');
|
|
108
107
|
}
|
|
108
|
+
get filtersElement() {
|
|
109
|
+
return this.shadowRoot.getElementById('elfilters');
|
|
110
|
+
}
|
|
109
111
|
|
|
110
112
|
// TEMPLATES
|
|
111
113
|
|
|
@@ -117,7 +119,7 @@ export class DileCrud extends DileCrudMixin(LitElement) {
|
|
|
117
119
|
: ''
|
|
118
120
|
}
|
|
119
121
|
${this.config.customization.disableInsert ? '' : this.insertButtomTemplate}
|
|
120
|
-
|
|
122
|
+
${this.config.customization.disableKeywordSearch ? '' : html`<dile-input-search @dile-input-search=${this.keywordChanged}></dile-input-search>`}
|
|
121
123
|
</header>
|
|
122
124
|
|
|
123
125
|
<main>
|
|
@@ -197,52 +199,65 @@ export class DileCrud extends DileCrudMixin(LitElement) {
|
|
|
197
199
|
|
|
198
200
|
get navActionsTemplate() {
|
|
199
201
|
return html`
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
<div class="actions" slot="actions">
|
|
206
|
-
${this.actionsTemplate}
|
|
207
|
-
${this.config.customization.disableFilter
|
|
208
|
-
? ''
|
|
209
|
-
: html`
|
|
210
|
-
<dile-crud-filters
|
|
211
|
-
class="action-controller"
|
|
212
|
-
id="elfilters"
|
|
213
|
-
@filters-changed=${this.filtersChanged}
|
|
214
|
-
.filters=${this.config.availableFilters || []}
|
|
215
|
-
></dile-crud-filters>
|
|
216
|
-
`
|
|
217
|
-
}
|
|
218
|
-
${this.config.customization.disablePagination
|
|
219
|
-
? ''
|
|
220
|
-
: html`
|
|
221
|
-
<dile-crud-page-size
|
|
222
|
-
class="action-controller"
|
|
223
|
-
@page-size-changed=${this.pageSizeChanged}
|
|
224
|
-
.pageSizes=${this.config.pageSize.available || [10, 25, 50]}
|
|
225
|
-
pageSize="${this.config.pageSize.initial}"
|
|
226
|
-
></dile-crud-page-size>
|
|
227
|
-
`
|
|
228
|
-
}
|
|
229
|
-
${this.config.customization.disableSort
|
|
202
|
+
${this.disableAllActionFunctionalities
|
|
203
|
+
? ''
|
|
204
|
+
: html`
|
|
205
|
+
<dile-nav>
|
|
206
|
+
${this.config.customization.disableHelp
|
|
230
207
|
? ''
|
|
231
|
-
: html
|
|
232
|
-
<dile-crud-sort-form
|
|
233
|
-
class="action-controller"
|
|
234
|
-
.sortOptions=${this.config.sort.options || []}
|
|
235
|
-
sortField="${this.config.sort.initialSortField}"
|
|
236
|
-
sortDirection="${this.config.sort.initialSortDirection || 'desc'}"
|
|
237
|
-
@sort-changed=${this.sortFormChanged}
|
|
238
|
-
></dile-crud-sort-form>
|
|
239
|
-
`
|
|
208
|
+
: html`<div slot="menu">${this.helpTemplate}</div>`
|
|
240
209
|
}
|
|
241
|
-
|
|
242
|
-
|
|
210
|
+
<div class="actions" slot="actions">
|
|
211
|
+
${this.actionsTemplate}
|
|
212
|
+
${this.config.customization.disableFilter
|
|
213
|
+
? ''
|
|
214
|
+
: html`
|
|
215
|
+
<dile-crud-filters
|
|
216
|
+
class="action-controller"
|
|
217
|
+
id="elfilters"
|
|
218
|
+
@filters-changed=${this.filtersChanged}
|
|
219
|
+
.filters=${this.config.availableFilters || []}
|
|
220
|
+
></dile-crud-filters>
|
|
221
|
+
`
|
|
222
|
+
}
|
|
223
|
+
${this.config.customization.disablePagination
|
|
224
|
+
? ''
|
|
225
|
+
: html`
|
|
226
|
+
<dile-crud-page-size
|
|
227
|
+
class="action-controller"
|
|
228
|
+
@page-size-changed=${this.pageSizeChanged}
|
|
229
|
+
.pageSizes=${this.config.pageSize.available || [10, 25, 50]}
|
|
230
|
+
pageSize="${this.config.pageSize.initial}"
|
|
231
|
+
></dile-crud-page-size>
|
|
232
|
+
`
|
|
233
|
+
}
|
|
234
|
+
${this.config.customization.disableSort
|
|
235
|
+
? ''
|
|
236
|
+
: html`
|
|
237
|
+
<dile-crud-sort-form
|
|
238
|
+
class="action-controller"
|
|
239
|
+
.sortOptions=${this.config.sort.options || []}
|
|
240
|
+
sortField="${this.config.sort.initialSortField}"
|
|
241
|
+
sortDirection="${this.config.sort.initialSortDirection || 'desc'}"
|
|
242
|
+
@sort-changed=${this.sortFormChanged}
|
|
243
|
+
></dile-crud-sort-form>
|
|
244
|
+
`
|
|
245
|
+
}
|
|
246
|
+
</div>
|
|
247
|
+
</dile-nav>
|
|
248
|
+
`
|
|
249
|
+
}
|
|
243
250
|
`
|
|
244
251
|
}
|
|
245
252
|
|
|
253
|
+
get disableAllActionFunctionalities() {
|
|
254
|
+
const customization = this.config.customization;
|
|
255
|
+
return customization.disableHelp
|
|
256
|
+
&& customization.disableFilter
|
|
257
|
+
&& customization.disablePagination
|
|
258
|
+
&& customization.disableSort
|
|
259
|
+
&& customization.hideCheckboxSelection;
|
|
260
|
+
}
|
|
246
261
|
// BEHAVIOURS
|
|
247
262
|
|
|
248
263
|
openInsert() {
|
|
@@ -302,7 +317,6 @@ export class DileCrud extends DileCrudMixin(LitElement) {
|
|
|
302
317
|
this.count = this.actionIds.length;
|
|
303
318
|
}
|
|
304
319
|
this.actionIds = [...this.actionIds]
|
|
305
|
-
//this.actionsElement.setActionIds(this.actionIds);
|
|
306
320
|
}
|
|
307
321
|
|
|
308
322
|
actionSuccess(e) {
|
package/lib/defaultConfig.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dile/crud",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "Components to create a generic crud system based on Web Components and Lit",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "2bcf90ee8a323d9a57f6ef42fc200e111482cc74"
|
|
35
35
|
}
|