@vaadin/crud 24.2.0-dev.f254716fe → 24.2.0-rc1
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/LICENSE +45 -23
- package/package.json +13 -13
- package/src/vaadin-crud-controllers.d.ts +32 -0
- package/src/vaadin-crud-controllers.js +114 -0
- package/src/vaadin-crud-dialog.js +4 -2
- package/src/vaadin-crud-edit-column.js +3 -1
- package/src/vaadin-crud-edit.js +3 -1
- package/src/vaadin-crud-form.js +3 -1
- package/src/vaadin-crud-grid.js +4 -3
- package/src/vaadin-crud.js +6 -79
- package/web-types.json +604 -0
- package/web-types.lit.json +293 -0
package/LICENSE
CHANGED
|
@@ -14,7 +14,7 @@ AND DESTROY OR RETURN ALL COPIES OF THE PRODUCT.
|
|
|
14
14
|
IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF YOURSELF IN YOUR INDIVIDUAL
|
|
15
15
|
CAPACITY, THEN YOU ARE THE CUSTOMER. IF YOU ARE AGREEING TO THESE TERMS ON
|
|
16
16
|
BEHALF OF YOUR COMPANY, THEN YOUR COMPANY IS THE CUSTOMER.
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
1. Definitions
|
|
19
19
|
1.1. In these Commercial Terms, unless the context requires otherwise, the
|
|
20
20
|
following words and phrases shall have the following meanings:
|
|
@@ -219,11 +219,12 @@ License as set forth herein and in the applicable Order.
|
|
|
219
219
|
|
|
220
220
|
4.3. Developer License
|
|
221
221
|
4.3.1 General Provisions
|
|
222
|
-
4.3.1.
|
|
222
|
+
4.3.1.1 This Section 4.3 contains the terms and conditions of Vaadin’s
|
|
223
223
|
developer License (“Developer License”), under which Vaadin licenses
|
|
224
224
|
development components for use by a Developer.
|
|
225
|
-
|
|
226
|
-
|
|
225
|
+
|
|
226
|
+
4.3.1.2 Vaadin grants to Customer, based on full payment of the Subscription
|
|
227
|
+
fee, a worldwide, royalty-free, non-exclusive, limited License to Use Licensed
|
|
227
228
|
Software in Project(s).
|
|
228
229
|
|
|
229
230
|
4.3.1.3 Customer must procure the right to Use Licensed Software for each
|
|
@@ -309,7 +310,7 @@ in the applicable Order.
|
|
|
309
310
|
4.4.3. Customer may grant licenses, for free or based on a payment, to the
|
|
310
311
|
Authorized Application(s) including Licensed Software, whether regarded as
|
|
311
312
|
derivative works or not, as long as Customer has obtained from Vaadin a valid
|
|
312
|
-
Runtime License for and on behalf of Customer’s own
|
|
313
|
+
Runtime License for and on behalf of Customer’s own customers (that Use
|
|
313
314
|
Licensed Software), or Customer clearly communicates that anyone Using Licensed
|
|
314
315
|
Software needs to obtain a valid Runtime License from Vaadin prior to
|
|
315
316
|
installation and use of the Authorized Application(s) including Licensed
|
|
@@ -402,7 +403,7 @@ and components for the duration of the Subscription in accordance with the
|
|
|
402
403
|
applicable license terms set for each tool and component. Unless otherwise set
|
|
403
404
|
out in the applicable license terms set for each tool or component, Customer’s
|
|
404
405
|
right of use shall expire without a separate notice when the Subscription is
|
|
405
|
-
terminated or expires.
|
|
406
|
+
terminated or expires.
|
|
406
407
|
|
|
407
408
|
6.4. Expert Chat
|
|
408
409
|
6.4.1. Customer is offered access to a chat service, where Vaadin’s expert team
|
|
@@ -446,10 +447,6 @@ does not authorize the continuation of the service request at their expense.
|
|
|
446
447
|
Software to be fixed. There can be only one open warranty request at a time per
|
|
447
448
|
Subscription. Vaadin reserves the right to choose, at its sole discretion,
|
|
448
449
|
which warranty requests will be fixed.
|
|
449
|
-
During the Support Hours, the resolution of a support request will be started
|
|
450
|
-
within two (2) business days. If Vaadin fails to start the resolution as
|
|
451
|
-
agreed, Customer will be compensated with one (1) free Expert on Demand hour
|
|
452
|
-
that is added to the time balance.
|
|
453
450
|
|
|
454
451
|
6.6.2. During the Support Hours, the resolution of a support request will be
|
|
455
452
|
started within two (2) business days. If Vaadin fails to start the resolution
|
|
@@ -491,7 +488,8 @@ and corresponds with the deliverables and which product or service is offered
|
|
|
491
488
|
for use to Customer by Vaadin without separate charge. The aforesaid indemnity
|
|
492
489
|
obligation of Vaadin shall, however, always be limited to an amount equal to
|
|
493
490
|
three times the yearly Subscription fee, and Vaadin’s liability for indemnified
|
|
494
|
-
claims shall be limited to this Section 6.
|
|
491
|
+
claims shall be limited to this Section 6.8.
|
|
492
|
+
|
|
495
493
|
|
|
496
494
|
6.9. Extended Maintenance for Vaadin
|
|
497
495
|
6.9.1. The extended maintenance for Vaadin Service extends the coverage of the
|
|
@@ -506,7 +504,7 @@ that the latest minor versions of Vaadin platform versions 10, 14, and 23+ are
|
|
|
506
504
|
covered for the duration of the Subscription term.
|
|
507
505
|
|
|
508
506
|
6.9.3. Any and all changes to the software covered by Extended Maintenance may
|
|
509
|
-
be published under commercial or non-commercial License and will be made
|
|
507
|
+
be published under a commercial or non-commercial License and will be made
|
|
510
508
|
available exclusively to Customers that have subscribed to the extended
|
|
511
509
|
maintenance for Vaadin Service.
|
|
512
510
|
|
|
@@ -531,6 +529,23 @@ that is added to the time balance.
|
|
|
531
529
|
6.10.3. Vaadin will build a new version of the Custom Build on demand basis,
|
|
532
530
|
however, at most once a month.
|
|
533
531
|
|
|
532
|
+
6.11. Technical Success Manager
|
|
533
|
+
6.11.1 Technical Success Manager (“TSM”) is a technical expert allocated to
|
|
534
|
+
help Customer to use Vaadin’s products and services in a productive manner.
|
|
535
|
+
TSM's areas of expertise include, but are not limited to, answering technical
|
|
536
|
+
questions, disseminating best practices, and coordinating work between Customer
|
|
537
|
+
and Vaadin.
|
|
538
|
+
|
|
539
|
+
6.11.2. Customer may request regular meetings with the TSM with a maximum
|
|
540
|
+
monthly total of four (4) hours of active meeting time. Preparation and
|
|
541
|
+
coordination time related to the meetings is not included in the above
|
|
542
|
+
mentioned monthly total.
|
|
543
|
+
|
|
544
|
+
6.11.3. Software programming and project management are not included in the
|
|
545
|
+
scope of this TSM service referred to in this Section 6.11. Programming and
|
|
546
|
+
project management services are provided under Expert on Demand and Consulting
|
|
547
|
+
services.
|
|
548
|
+
|
|
534
549
|
7. Consulting
|
|
535
550
|
7.1. Delivery of Consulting
|
|
536
551
|
7.1.1 The Parties may agree upon the delivery of Consulting in an Order, SOW,
|
|
@@ -584,7 +599,7 @@ of this Section and is not to be interpreted as a penalty or punishment
|
|
|
584
599
|
therefor.
|
|
585
600
|
|
|
586
601
|
7.4. Sponsored Development
|
|
587
|
-
The Parties may agree upon the delivery of Sponsored Development in an
|
|
602
|
+
7.4.1 The Parties may agree upon the delivery of Sponsored Development in an
|
|
588
603
|
Agreement. This Service is provided as Consulting in accordance with this
|
|
589
604
|
Section 7. Intellectual Property Rights to Sponsored Development results are
|
|
590
605
|
regulated by Section 11 below.
|
|
@@ -651,14 +666,20 @@ or other Agreement document. As regards Trial Licenses, no Subscription fee is
|
|
|
651
666
|
charged.
|
|
652
667
|
|
|
653
668
|
10.2. Consulting
|
|
654
|
-
10.2.1.
|
|
669
|
+
10.2.1. All cost and effort estimates given by Vaadin to Customer are
|
|
670
|
+
indicative by nature and do not affect the calculation of the fees. If not
|
|
671
|
+
otherwise specified in the Agreement, the Services are provided on
|
|
672
|
+
time-and-material basis. The fee is determined by multiplying the hourly rates
|
|
673
|
+
set forth in the Agreement by the hours that Vaadin has worked on the Services.
|
|
674
|
+
|
|
675
|
+
10.2.2. The applicable prices and hourly rates are detailed in the Agreement
|
|
655
676
|
and/or its appendices. If a price for a Service has not been agreed, the price
|
|
656
677
|
in Vaadin’s price list effective on the order date shall apply.
|
|
657
678
|
|
|
658
|
-
10.2.
|
|
679
|
+
10.2.3. Vaadin shall be entitled to adjust its prices with thirty (30) days’
|
|
659
680
|
notice to Customer.
|
|
660
681
|
|
|
661
|
-
10.2.
|
|
682
|
+
10.2.4. Vaadin shall, if pre-approved by Customer, be entitled to charge for
|
|
662
683
|
customary and reasonable travel and accommodation costs as well as other travel
|
|
663
684
|
costs relating to Services. Traveling time shall be charged as 50% of the
|
|
664
685
|
agreed hourly rates.
|
|
@@ -971,6 +992,7 @@ PURPOSE, ANY IMPLIED WARRANTY THAT ANY SOFTWARE, PRODUCT OR SERVICE WILL MEET
|
|
|
971
992
|
ALL NEEDS AND EXPECTATIONS, BE ERROR-FREE, OR BE OF CERTAIN CONDITION, QUALITY
|
|
972
993
|
OR DURABILITY, OR FUNCTION OR PERFORM IN A CERTAIN WAY. ALL SUCH WARRANTIES,
|
|
973
994
|
CONDITIONS, UNDERTAKINGS AND TERMS ARE HEREBY EXCLUDED.
|
|
995
|
+
|
|
974
996
|
23. Limitation of Liability
|
|
975
997
|
23.1. VAADIN AND ITS AFFILIATES AND SUPPLIERS SHALL NOT BE LIABLE FOR ANY
|
|
976
998
|
INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, INCLUDING BUT
|
|
@@ -985,9 +1007,9 @@ A PARTY TOWARDS THE OTHER PARTY IN RELATION TO THE AGREEMENT IS LIMITED TO A
|
|
|
985
1007
|
MAXIMUM OF 50 % OF THE PRICE PAYABLE FOR THE AGREED SUBSCRIPTION, PRODUCT OR
|
|
986
1008
|
SERVICE DIRECTLY RELATED TO THE CAUSE OF ACTION ASSERTED UNDER THE RELEVANT
|
|
987
1009
|
AGREEMENT. IN CASE OF SUBSCRIPTIONS, THE AFOREMENTIONED 50 % LIMIT IS
|
|
988
|
-
CALCULATED BASED ON THE
|
|
989
|
-
IN CASE OF CONSULTING CARRIED OUT OUTSIDE A SUBSCRIPTION, THE AFOREMENTIONED
|
|
990
|
-
|
|
1010
|
+
CALCULATED BASED ON THE SUBSCRIPTION FEE FOR THE MOST RECENT SUBSCRIPTION TERM.
|
|
1011
|
+
IN CASE OF CONSULTING CARRIED OUT OUTSIDE A SUBSCRIPTION, THE AFOREMENTIONED 50
|
|
1012
|
+
% LIMIT IS CALCULATED BASED ON THE TOTAL VALUE OF THE CONSULTING UNDER THE
|
|
991
1013
|
RELEVANT SOW.
|
|
992
1014
|
|
|
993
1015
|
23.3. THIS LIMITATION OF LIABILITY SHALL APPLY REGARDLESS OF THE CAUSE OF
|
|
@@ -1083,13 +1105,13 @@ interpretation of the Commercial Terms or any provision hereof.
|
|
|
1083
1105
|
|
|
1084
1106
|
27.6. Severability
|
|
1085
1107
|
27.6.1. If any provision of the Agreement shall be held invalid, illegal or
|
|
1086
|
-
unenforceable, the remaining provisions shall not be affected or impaired.
|
|
1108
|
+
unenforceable, the remaining provisions shall not be affected or impaired.
|
|
1087
1109
|
|
|
1088
1110
|
27.7. Export Control
|
|
1089
1111
|
27.7.1. The Licensed Software may be subject to import and export controls in
|
|
1090
1112
|
other countries. Customer agrees to strictly comply with all applicable import
|
|
1091
1113
|
and export regulations and acknowledge that Customer has the responsibility to
|
|
1092
|
-
obtain licenses to export, re-export, transfer or import Licensed Software.
|
|
1114
|
+
obtain licenses to export, re-export, transfer or import Licensed Software.
|
|
1093
1115
|
|
|
1094
1116
|
27.8. Assignment
|
|
1095
1117
|
27.8.1. Neither Party shall have the right to assign the Agreement to a third
|
|
@@ -1105,8 +1127,8 @@ Agreement.
|
|
|
1105
1127
|
statements required hereby shall be in English.
|
|
1106
1128
|
|
|
1107
1129
|
27.10. Changes to these Commercial Terms
|
|
1108
|
-
Vaadin may change these Commercial Terms at any time, upon thirty (30)
|
|
1109
|
-
prior written notice. The changed Commercial Terms shall apply to any new
|
|
1130
|
+
27.10.1 Vaadin may change these Commercial Terms at any time, upon thirty (30)
|
|
1131
|
+
days prior written notice. The changed Commercial Terms shall apply to any new
|
|
1110
1132
|
Orders and Agreements entered into after the effective date of the change. As
|
|
1111
1133
|
regards Subscriptions, the changed Commercial Terms shall apply from the
|
|
1112
1134
|
beginning of a renewed Subscription term, provided that Vaadin has notified
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/crud",
|
|
3
|
-
"version": "24.2.0-
|
|
3
|
+
"version": "24.2.0-rc1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -37,20 +37,20 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
39
39
|
"@polymer/polymer": "^3.0.0",
|
|
40
|
-
"@vaadin/button": "24.2.0-
|
|
41
|
-
"@vaadin/component-base": "24.2.0-
|
|
42
|
-
"@vaadin/confirm-dialog": "24.2.0-
|
|
43
|
-
"@vaadin/dialog": "24.2.0-
|
|
44
|
-
"@vaadin/form-layout": "24.2.0-
|
|
45
|
-
"@vaadin/grid": "24.2.0-
|
|
46
|
-
"@vaadin/text-field": "24.2.0-
|
|
47
|
-
"@vaadin/vaadin-lumo-styles": "24.2.0-
|
|
48
|
-
"@vaadin/vaadin-material-styles": "24.2.0-
|
|
49
|
-
"@vaadin/vaadin-themable-mixin": "24.2.0-
|
|
40
|
+
"@vaadin/button": "24.2.0-rc1",
|
|
41
|
+
"@vaadin/component-base": "24.2.0-rc1",
|
|
42
|
+
"@vaadin/confirm-dialog": "24.2.0-rc1",
|
|
43
|
+
"@vaadin/dialog": "24.2.0-rc1",
|
|
44
|
+
"@vaadin/form-layout": "24.2.0-rc1",
|
|
45
|
+
"@vaadin/grid": "24.2.0-rc1",
|
|
46
|
+
"@vaadin/text-field": "24.2.0-rc1",
|
|
47
|
+
"@vaadin/vaadin-lumo-styles": "24.2.0-rc1",
|
|
48
|
+
"@vaadin/vaadin-material-styles": "24.2.0-rc1",
|
|
49
|
+
"@vaadin/vaadin-themable-mixin": "24.2.0-rc1"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@esm-bundle/chai": "^4.3.4",
|
|
53
|
-
"@vaadin/testing-helpers": "^0.
|
|
53
|
+
"@vaadin/testing-helpers": "^0.5.0",
|
|
54
54
|
"sinon": "^13.0.2"
|
|
55
55
|
},
|
|
56
56
|
"cvdlName": "vaadin-crud",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"web-types.json",
|
|
59
59
|
"web-types.lit.json"
|
|
60
60
|
],
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "012bef350bbf29865748f4c78338dd17c6f61a74"
|
|
62
62
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2000 - 2023 Vaadin Ltd.
|
|
4
|
+
*
|
|
5
|
+
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
+
* license.
|
|
10
|
+
*/
|
|
11
|
+
import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A controller for initializing slotted button.
|
|
15
|
+
*/
|
|
16
|
+
export class ButtonSlotController extends SlotController {
|
|
17
|
+
constructor(host: HTMLElement);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A controller for initializing slotted form.
|
|
22
|
+
*/
|
|
23
|
+
export class FormSlotController extends SlotController {
|
|
24
|
+
constructor(host: HTMLElement);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A controller for initializing slotted grid.
|
|
29
|
+
*/
|
|
30
|
+
export class GridSlotController extends SlotController {
|
|
31
|
+
constructor(host: HTMLElement);
|
|
32
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2000 - 2023 Vaadin Ltd.
|
|
4
|
+
*
|
|
5
|
+
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
+
* license.
|
|
10
|
+
*/
|
|
11
|
+
import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A controller for initializing slotted button.
|
|
15
|
+
* @protected
|
|
16
|
+
*/
|
|
17
|
+
export class ButtonSlotController extends SlotController {
|
|
18
|
+
constructor(host, type, theme) {
|
|
19
|
+
super(host, `${type}-button`, 'vaadin-button');
|
|
20
|
+
|
|
21
|
+
this.type = type;
|
|
22
|
+
this.theme = theme;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Override method inherited from `SlotController`
|
|
27
|
+
* to mark custom slotted button as the default.
|
|
28
|
+
*
|
|
29
|
+
* @param {Node} node
|
|
30
|
+
* @protected
|
|
31
|
+
* @override
|
|
32
|
+
*/
|
|
33
|
+
initNode(node) {
|
|
34
|
+
// Needed by Flow counterpart to apply i18n to custom button
|
|
35
|
+
if (node._isDefault) {
|
|
36
|
+
this.defaultNode = node;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (node === this.defaultNode) {
|
|
40
|
+
node.setAttribute('theme', this.theme);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const { host, type } = this;
|
|
44
|
+
const property = `_${type}Button`;
|
|
45
|
+
const listener = `__${type}`;
|
|
46
|
+
|
|
47
|
+
// TODO: restore default button when a corresponding slotted button is removed.
|
|
48
|
+
// This would require us to detect where to insert a button after teleporting it,
|
|
49
|
+
// which happens after opening a dialog and closing it (default editor position).
|
|
50
|
+
if (host[property] && host[property] !== node) {
|
|
51
|
+
host[property].remove();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
node.addEventListener('click', host[listener]);
|
|
55
|
+
host[property] = node;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* A controller for initializing slotted form.
|
|
61
|
+
* @protected
|
|
62
|
+
*/
|
|
63
|
+
export class FormSlotController extends SlotController {
|
|
64
|
+
constructor(host) {
|
|
65
|
+
super(host, 'form', 'vaadin-crud-form');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Override method inherited from `SlotController`
|
|
70
|
+
* to move slotted form to the overlay if needed.
|
|
71
|
+
*
|
|
72
|
+
* @param {Node} node
|
|
73
|
+
* @protected
|
|
74
|
+
* @override
|
|
75
|
+
*/
|
|
76
|
+
initNode(node) {
|
|
77
|
+
this.host._form = node;
|
|
78
|
+
|
|
79
|
+
if (this.host.editorOpened) {
|
|
80
|
+
this.host.__ensureChildren();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* A controller for initializing slotted grid.
|
|
87
|
+
* @protected
|
|
88
|
+
*/
|
|
89
|
+
export class GridSlotController extends SlotController {
|
|
90
|
+
constructor(host) {
|
|
91
|
+
super(host, 'grid', 'vaadin-crud-grid');
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Override method inherited from `SlotController`
|
|
96
|
+
* to initialize `active-item-changed` listener.
|
|
97
|
+
*
|
|
98
|
+
* @param {Node} node
|
|
99
|
+
* @protected
|
|
100
|
+
* @override
|
|
101
|
+
*/
|
|
102
|
+
initNode(node) {
|
|
103
|
+
const { host } = this;
|
|
104
|
+
|
|
105
|
+
// Wait for all the properties e.g. `noFilter` and `noSort`
|
|
106
|
+
// to be set, to ensure columns are configured correctly.
|
|
107
|
+
queueMicrotask(() => {
|
|
108
|
+
// Force to remove listener on previous grid first
|
|
109
|
+
host.__editOnClickChanged(false, host._grid);
|
|
110
|
+
host._grid = node;
|
|
111
|
+
host.__editOnClickChanged(host.editOnClick, host._grid);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* license.
|
|
10
10
|
*/
|
|
11
11
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
12
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
12
13
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
13
14
|
import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
|
|
14
15
|
import { DialogBaseMixin } from '@vaadin/dialog/src/vaadin-dialog-base-mixin.js';
|
|
@@ -57,6 +58,7 @@ registerStyles('vaadin-crud-dialog-overlay', [overlayStyles, dialogOverlay, resi
|
|
|
57
58
|
/**
|
|
58
59
|
* An element used internally by `<vaadin-crud>`. Not intended to be used separately.
|
|
59
60
|
*
|
|
61
|
+
* @customElement
|
|
60
62
|
* @extends HTMLElement
|
|
61
63
|
* @mixes DirMixin
|
|
62
64
|
* @mixes OverlayMixin
|
|
@@ -100,7 +102,7 @@ class CrudDialogOverlay extends OverlayMixin(DirMixin(ThemableMixin(PolymerEleme
|
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
104
|
|
|
103
|
-
|
|
105
|
+
defineCustomElement(CrudDialogOverlay);
|
|
104
106
|
|
|
105
107
|
/**
|
|
106
108
|
* An element used internally by `<vaadin-crud>`. Not intended to be used separately.
|
|
@@ -149,4 +151,4 @@ class CrudDialog extends DialogBaseMixin(OverlayClassMixin(ThemePropertyMixin(Po
|
|
|
149
151
|
}
|
|
150
152
|
}
|
|
151
153
|
|
|
152
|
-
|
|
154
|
+
defineCustomElement(CrudDialog);
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* license.
|
|
10
10
|
*/
|
|
11
11
|
import './vaadin-crud-edit.js';
|
|
12
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
12
13
|
import { GridColumn } from '@vaadin/grid/src/vaadin-grid-column.js';
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -26,6 +27,7 @@ import { GridColumn } from '@vaadin/grid/src/vaadin-grid-column.js';
|
|
|
26
27
|
* ...
|
|
27
28
|
* ```
|
|
28
29
|
*
|
|
30
|
+
* @customElement
|
|
29
31
|
* @extends GridColumn
|
|
30
32
|
*/
|
|
31
33
|
class CrudEditColumn extends GridColumn {
|
|
@@ -85,6 +87,6 @@ class CrudEditColumn extends GridColumn {
|
|
|
85
87
|
}
|
|
86
88
|
}
|
|
87
89
|
|
|
88
|
-
|
|
90
|
+
defineCustomElement(CrudEditColumn);
|
|
89
91
|
|
|
90
92
|
export { CrudEditColumn };
|
package/src/vaadin-crud-edit.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { html } from '@polymer/polymer/polymer-element.js';
|
|
12
12
|
import { Button } from '@vaadin/button/src/vaadin-button.js';
|
|
13
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
13
14
|
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -34,6 +35,7 @@ registerStyles(
|
|
|
34
35
|
* Typical usage is in a `<vaadin-grid-column>` of a custom `<vaadin-grid>` inside
|
|
35
36
|
* a `<vaadin-crud>` to enable editing.
|
|
36
37
|
*
|
|
38
|
+
* @customElement
|
|
37
39
|
* @extends HTMLElement
|
|
38
40
|
* @mixes ThemableMixin
|
|
39
41
|
*/
|
|
@@ -73,4 +75,4 @@ class CrudEdit extends Button {
|
|
|
73
75
|
*/
|
|
74
76
|
}
|
|
75
77
|
|
|
76
|
-
|
|
78
|
+
defineCustomElement(CrudEdit);
|
package/src/vaadin-crud-form.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* license.
|
|
10
10
|
*/
|
|
11
11
|
import '@vaadin/text-field/src/vaadin-text-field.js';
|
|
12
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
12
13
|
import { FormLayout } from '@vaadin/form-layout/src/vaadin-form-layout.js';
|
|
13
14
|
import { capitalize } from './vaadin-crud-helpers.js';
|
|
14
15
|
import { IncludedMixin } from './vaadin-crud-include-mixin.js';
|
|
@@ -16,6 +17,7 @@ import { IncludedMixin } from './vaadin-crud-include-mixin.js';
|
|
|
16
17
|
/**
|
|
17
18
|
* An element used internally by `<vaadin-crud>`. Not intended to be used separately.
|
|
18
19
|
*
|
|
20
|
+
* @customElement
|
|
19
21
|
* @extends FormLayout
|
|
20
22
|
* @mixes IncludedMixin
|
|
21
23
|
* @private
|
|
@@ -90,6 +92,6 @@ class CrudForm extends IncludedMixin(FormLayout) {
|
|
|
90
92
|
}
|
|
91
93
|
}
|
|
92
94
|
|
|
93
|
-
|
|
95
|
+
defineCustomElement(CrudForm);
|
|
94
96
|
|
|
95
97
|
export { CrudForm };
|
package/src/vaadin-crud-grid.js
CHANGED
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
9
|
* license.
|
|
10
10
|
*/
|
|
11
|
-
import '@vaadin/grid/src/vaadin-grid-column.js';
|
|
12
11
|
import '@vaadin/grid/src/vaadin-grid-column-group.js';
|
|
13
|
-
import '@vaadin/grid/src/vaadin-grid-
|
|
12
|
+
import '@vaadin/grid/src/vaadin-grid-column.js';
|
|
14
13
|
import '@vaadin/grid/src/vaadin-grid-filter.js';
|
|
14
|
+
import '@vaadin/grid/src/vaadin-grid-sorter.js';
|
|
15
15
|
import './vaadin-crud-edit-column.js';
|
|
16
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
16
17
|
import { Grid } from '@vaadin/grid/src/vaadin-grid.js';
|
|
17
18
|
import { capitalize, getProperty } from './vaadin-crud-helpers.js';
|
|
18
19
|
import { IncludedMixin } from './vaadin-crud-include-mixin.js';
|
|
@@ -275,6 +276,6 @@ class CrudGrid extends IncludedMixin(Grid) {
|
|
|
275
276
|
}
|
|
276
277
|
}
|
|
277
278
|
|
|
278
|
-
|
|
279
|
+
defineCustomElement(CrudGrid);
|
|
279
280
|
|
|
280
281
|
export { CrudGrid };
|
package/src/vaadin-crud.js
CHANGED
|
@@ -14,63 +14,18 @@ import '@vaadin/confirm-dialog/src/vaadin-confirm-dialog.js';
|
|
|
14
14
|
import './vaadin-crud-dialog.js';
|
|
15
15
|
import './vaadin-crud-grid.js';
|
|
16
16
|
import './vaadin-crud-form.js';
|
|
17
|
-
import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
|
|
18
17
|
import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
|
|
19
18
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
20
19
|
import { FocusRestorationController } from '@vaadin/a11y-base/src/focus-restoration-controller.js';
|
|
21
20
|
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
21
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
22
22
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
23
23
|
import { MediaQueryController } from '@vaadin/component-base/src/media-query-controller.js';
|
|
24
24
|
import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
|
|
25
25
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
26
|
+
import { ButtonSlotController, FormSlotController, GridSlotController } from './vaadin-crud-controllers.js';
|
|
26
27
|
import { getProperty, setProperty } from './vaadin-crud-helpers.js';
|
|
27
28
|
|
|
28
|
-
/**
|
|
29
|
-
* A controller for initializing slotted button.
|
|
30
|
-
* @private
|
|
31
|
-
*/
|
|
32
|
-
class ButtonSlotController extends SlotController {
|
|
33
|
-
constructor(host, type, theme) {
|
|
34
|
-
super(host, `${type}-button`, 'vaadin-button');
|
|
35
|
-
|
|
36
|
-
this.type = type;
|
|
37
|
-
this.theme = theme;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Override method inherited from `SlotController`
|
|
42
|
-
* to mark custom slotted button as the default.
|
|
43
|
-
*
|
|
44
|
-
* @param {Node} node
|
|
45
|
-
* @protected
|
|
46
|
-
* @override
|
|
47
|
-
*/
|
|
48
|
-
initNode(node) {
|
|
49
|
-
// Needed by Flow counterpart to apply i18n to custom button
|
|
50
|
-
if (node._isDefault) {
|
|
51
|
-
this.defaultNode = node;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (node === this.defaultNode) {
|
|
55
|
-
node.setAttribute('theme', this.theme);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const { host, type } = this;
|
|
59
|
-
const property = `_${type}Button`;
|
|
60
|
-
const listener = `__${type}`;
|
|
61
|
-
|
|
62
|
-
// TODO: restore default button when a corresponding slotted button is removed.
|
|
63
|
-
// This would require us to detect where to insert a button after teleporting it,
|
|
64
|
-
// which happens after opening a dialog and closing it (default editor position).
|
|
65
|
-
if (host[property] && host[property] !== node) {
|
|
66
|
-
host[property].remove();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
node.addEventListener('click', host[listener]);
|
|
70
|
-
host[property] = node;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
29
|
/**
|
|
75
30
|
* `<vaadin-crud>` is a Web Component for [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) operations.
|
|
76
31
|
*
|
|
@@ -213,6 +168,7 @@ class ButtonSlotController extends SlotController {
|
|
|
213
168
|
* @fires {CustomEvent} save - Fired when user wants to save a new or an existing item.
|
|
214
169
|
* @fires {CustomEvent} cancel - Fired when user discards edition.
|
|
215
170
|
*
|
|
171
|
+
* @customElement
|
|
216
172
|
* @extends HTMLElement
|
|
217
173
|
* @mixes ControllerMixin
|
|
218
174
|
* @mixes ElementMixin
|
|
@@ -711,10 +667,6 @@ class Crud extends ControllerMixin(ElementMixin(ThemableMixin(PolymerElement)))
|
|
|
711
667
|
this._deleteButtonController = new ButtonSlotController(this, 'delete', 'tertiary error');
|
|
712
668
|
|
|
713
669
|
this.__focusRestorationController = new FocusRestorationController();
|
|
714
|
-
|
|
715
|
-
this._observer = new FlattenedNodesObserver(this, (info) => {
|
|
716
|
-
this.__onDomChange(info.addedNodes);
|
|
717
|
-
});
|
|
718
670
|
}
|
|
719
671
|
|
|
720
672
|
/** @protected */
|
|
@@ -748,10 +700,10 @@ class Crud extends ControllerMixin(ElementMixin(ThemableMixin(PolymerElement)))
|
|
|
748
700
|
});
|
|
749
701
|
this.addController(this._headerController);
|
|
750
702
|
|
|
751
|
-
this._gridController = new
|
|
703
|
+
this._gridController = new GridSlotController(this);
|
|
752
704
|
this.addController(this._gridController);
|
|
753
705
|
|
|
754
|
-
this.addController(new
|
|
706
|
+
this.addController(new FormSlotController(this));
|
|
755
707
|
|
|
756
708
|
this.addController(this._newButtonController);
|
|
757
709
|
|
|
@@ -919,31 +871,6 @@ class Crud extends ControllerMixin(ElementMixin(ThemableMixin(PolymerElement)))
|
|
|
919
871
|
this.editorOpened = event.detail.value;
|
|
920
872
|
}
|
|
921
873
|
|
|
922
|
-
/** @private */
|
|
923
|
-
__onDomChange(addedNodes) {
|
|
924
|
-
addedNodes
|
|
925
|
-
.filter((node) => node.nodeType === Node.ELEMENT_NODE)
|
|
926
|
-
.forEach((node) => {
|
|
927
|
-
const slotAttributeValue = node.getAttribute('slot');
|
|
928
|
-
if (!slotAttributeValue) {
|
|
929
|
-
return;
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
if (slotAttributeValue === 'grid') {
|
|
933
|
-
// Force to remove listener on previous grid first
|
|
934
|
-
this.__editOnClickChanged(false, this._grid);
|
|
935
|
-
this._grid = node;
|
|
936
|
-
this.__editOnClickChanged(this.editOnClick, this._grid);
|
|
937
|
-
} else if (slotAttributeValue === 'form') {
|
|
938
|
-
this._form = node;
|
|
939
|
-
}
|
|
940
|
-
});
|
|
941
|
-
|
|
942
|
-
if (this.editorOpened) {
|
|
943
|
-
this.__ensureChildren();
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
|
|
947
874
|
/** @private */
|
|
948
875
|
__onGridEdit(event) {
|
|
949
876
|
event.stopPropagation();
|
|
@@ -1432,6 +1359,6 @@ class Crud extends ControllerMixin(ElementMixin(ThemableMixin(PolymerElement)))
|
|
|
1432
1359
|
*/
|
|
1433
1360
|
}
|
|
1434
1361
|
|
|
1435
|
-
|
|
1362
|
+
defineCustomElement(Crud);
|
|
1436
1363
|
|
|
1437
1364
|
export { Crud };
|