@vaadin/grid-pro 22.0.0-alpha7

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.
Files changed (35) hide show
  1. package/LICENSE +262 -0
  2. package/README.md +72 -0
  3. package/package.json +58 -0
  4. package/src/interfaces.d.ts +1 -0
  5. package/src/vaadin-grid-pro-edit-checkbox.js +21 -0
  6. package/src/vaadin-grid-pro-edit-column.d.ts +85 -0
  7. package/src/vaadin-grid-pro-edit-column.js +282 -0
  8. package/src/vaadin-grid-pro-edit-select.js +128 -0
  9. package/src/vaadin-grid-pro-edit-text-field.js +26 -0
  10. package/src/vaadin-grid-pro-inline-editing-mixin.d.ts +40 -0
  11. package/src/vaadin-grid-pro-inline-editing-mixin.js +483 -0
  12. package/src/vaadin-grid-pro.d.ts +95 -0
  13. package/src/vaadin-grid-pro.js +68 -0
  14. package/theme/lumo/vaadin-grid-pro-edit-checkbox.js +2 -0
  15. package/theme/lumo/vaadin-grid-pro-edit-column.js +4 -0
  16. package/theme/lumo/vaadin-grid-pro-edit-select-styles.js +24 -0
  17. package/theme/lumo/vaadin-grid-pro-edit-select.js +5 -0
  18. package/theme/lumo/vaadin-grid-pro-edit-text-field-styles.js +6 -0
  19. package/theme/lumo/vaadin-grid-pro-edit-text-field.js +3 -0
  20. package/theme/lumo/vaadin-grid-pro-editor-styles.js +41 -0
  21. package/theme/lumo/vaadin-grid-pro-styles.js +19 -0
  22. package/theme/lumo/vaadin-grid-pro.js +3 -0
  23. package/theme/material/vaadin-grid-pro-edit-checkbox.js +2 -0
  24. package/theme/material/vaadin-grid-pro-edit-column.js +4 -0
  25. package/theme/material/vaadin-grid-pro-edit-select-styles.js +17 -0
  26. package/theme/material/vaadin-grid-pro-edit-select.js +5 -0
  27. package/theme/material/vaadin-grid-pro-edit-text-field-styles.js +6 -0
  28. package/theme/material/vaadin-grid-pro-edit-text-field.js +3 -0
  29. package/theme/material/vaadin-grid-pro-editor-styles.js +21 -0
  30. package/theme/material/vaadin-grid-pro-styles.js +13 -0
  31. package/theme/material/vaadin-grid-pro.js +3 -0
  32. package/vaadin-grid-pro-edit-column.d.ts +1 -0
  33. package/vaadin-grid-pro-edit-column.js +3 -0
  34. package/vaadin-grid-pro.d.ts +2 -0
  35. package/vaadin-grid-pro.js +3 -0
package/LICENSE ADDED
@@ -0,0 +1,262 @@
1
+ Commercial Vaadin Developer License version 4
2
+
3
+ Terms and Conditions for Use, Reproduction and Distribution
4
+
5
+ NOTICE TO USER: PLEASE READ THIS LICENSE AGREEMENT CAREFULLY.
6
+
7
+ BY USING ALL OR ANY PART OF THE LICENSED SOFTWARE YOU ACCEPT ALL THE TERMS AND
8
+ CONDITIONS OF THIS AGREEMENT, INCLUDING, IN PARTICULAR THE RESTRICTIONS ON: USE
9
+ AND TRANSFERABILITY CONTAINED IN CLAUSE 2; WARRANTY IN CLAUSE 6; LIABILITY IN
10
+ CLAUSE 7. YOU ACCEPT THAT THIS AGREEMENT IS ENFORCEABLE LIKE ANY WRITTEN
11
+ NEGOTIATED AGREEMENT DULY SIGNED BY YOU. IF YOU DO NOT AGREE ON ALL THE TERMS
12
+ AND CONDITIONS OF THIS AGREEMENT, STOP THE USE OF THE LICENSED SOFTWARE
13
+ IMMEDIATELY.
14
+
15
+ 1. Definitions
16
+ In this Agreement, unless the context requires otherwise, the following words
17
+ and phrases shall have the following meanings:
18
+
19
+ * "Developer" shall mean a software developer, tester, designer or other
20
+ person developing a software application.
21
+ * "Vaadin Platform" shall mean the Vaadin web framework, components, themes,
22
+ tools and libraries that help Developers in building software applications.
23
+ * "Licensed Software" shall mean an add-on software component, extended
24
+ support version of Vaadin Platform, library, theme, tool or other software
25
+ or resource that is part of or adds functionality to Vaadin Platform or
26
+ helps Developers in developing applications. Licensed Software include, but
27
+ are not limited to, user interface components, integration components,
28
+ themes, libraries and development tools.
29
+ * "Use Licensed Software" shall mean either directly interacting with,
30
+ including without limitations using the user interface of, running or
31
+ installing, the Licensed Software during Project or editing Project source
32
+ code file that refers to or depends on Licensed Software either directly or
33
+ indirectly. Developer who edits source code that can not be compiled and/or
34
+ run without a copy of Licensed Software is considered to Use Licensed
35
+ Software. Interacting with a server that runs Licensed Software as a part
36
+ of an automated test suite or a design system is not considered as Use of
37
+ Licensed Software, but the maintainers of the mentioned test suite or
38
+ design system are considered to Use Licensed Software.
39
+ * "Agreement" shall mean this Commercial Vaadin Developer License version 4
40
+ agreement. Previous versions of the agreement were called Commercial Vaadin
41
+ Add-on License.
42
+ * "License" shall mean the right to Use Licensed Software according to
43
+ Agreement by one Developer.
44
+ * "Intellectual Property Rights" shall mean any and all patent, copyright,
45
+ trademark, design right, petty patent, service mark, domain name or any
46
+ other right or trade secret whether registered or not.
47
+ * "Licensee" shall mean the entity that has subscribed to a Subscription that
48
+ includes the right to Use Licensed Software.
49
+ * "Licensor" shall mean Vaadin Ltd. or a third party licensing Licensed
50
+ Software under the Agreement.
51
+ * "Parties/Party" shall mean Licensee and Licensor, or either of them.
52
+ * "Project" shall mean Licensee's software development project during which
53
+ the participating Developers Use Licensed Software and which aims to
54
+ produce Project Result.
55
+ * "Project Result" shall mean the outcome of the Project.
56
+ * “End User” shall mean a person using Project Result that does not involve
57
+ changing any source code.
58
+ * "Subscription" shall mean a subscription offered by Licensor in which
59
+ Licensor grants rights to Use Licensed Software according to the terms of
60
+ the subscription agreement and this Agreement.
61
+
62
+ 2. Grant of License
63
+ 2.1 Licensor grants to Licensee, against full payment of the Subscription fee, a
64
+ worldwide, royalty-free, non-exclusive limited License to Use Licensed Software
65
+ in Project(s) by a Developer.
66
+
67
+ 2.2 Licensee shall not, unless expressly provided in Agreement or in the
68
+ applicable legislation
69
+
70
+ 2.2.1 rent, lease or loan Licensed Software or any copy of it;
71
+
72
+ 2.2.2 remove, obliterate, deface or in any way alter the notice of Licensor’s or
73
+ a third party’s proprietary rights related to Licensed Software;
74
+
75
+ 2.2.3 grant sub-licenses to Licensed Software or assign its rights or
76
+ obligations under this Agreement to a third party.
77
+
78
+ 2.3 Licensee may grant licenses, for free or against a payment, to the Project
79
+ Result including Licensed Software whether regarded as derivative works or not.
80
+ End Users are not required to have a valid License. If the Project Result is
81
+ further developed or modified by changing its source code or the Project Results
82
+ is used as a software component or framework in a software development project,
83
+ all Developers who Use Licensed Software in such a context need to have a valid
84
+ License. If the Project Result is a software development tool, component or
85
+ environment that provides the functionality of the Licensed Software for use in
86
+ software development projects, all Developers who Use Licensed Software need to
87
+ have a valid License.
88
+
89
+ 3. Intellectual Property Rights
90
+ 3.1 All Intellectual Property Rights in and to Licensed Software are and shall
91
+ at all times remain the sole and exclusive property of Licensor and its third
92
+ party licensors, if any.
93
+
94
+ 3.2 Licensee will not at any time do or cause to be done any such act or thing
95
+ which in any way impairs, or intends to impair, any right, title, interest or
96
+ any Intellectual Property Right of Licensor or its third party licensors.
97
+ Licensee shall not in any manner represent that it has any ownership of any kind
98
+ in any of the above mentioned Intellectual Property Rights.
99
+
100
+ 4. Subscription fee and Subscription term
101
+ 4.1 In consideration for the Subscription based license granted herein, Licensor
102
+ shall charge a recurring Subscription fee from the Licensee.
103
+
104
+ 4.2 Licensee must have a valid License for all Developers who Use Licensed
105
+ Software in the Project. During the Subscription term, the License may be Used
106
+ in many Projects simultaneously without additional payments. The Project Result
107
+ may be copied an unlimited number of times and deployed to an unlimited number
108
+ of computers without additional payments.
109
+
110
+ 4.3 Licensee's License will be valid starting from the beginning of the
111
+ Subscription term and remain in force until the end of the Subscription term.
112
+ The start date of the Subscription term and its possible renewal mechanism are
113
+ set out in the Subscription agreement or the Licensor’s invoice to the Licensee.
114
+ If no Subscription start date is specified in the Subscription agreement or the
115
+ invoice, the start date shall be the date when the Licensor provides the
116
+ Licensee access to the Licensed Software.
117
+
118
+ 4.4 If License is given without a fee, the License is valid for the time defined
119
+ by the Licensor.
120
+
121
+ 5. Term and termination
122
+ 5.1 This Agreement is effective as of the effective date of the Subscription and
123
+ expires on the day that the Subscription term for the Licensed Software has
124
+ expired. Notwithstanding the aforesaid, in the event that the Licensee fails to
125
+ comply with the terms set in this Agreement, the License granted herein shall
126
+ not be valid and Licensee must at once cease the use of Licensed Software and
127
+ any of its rights under Clause 2, and delete all copies of Licensed Software.
128
+
129
+ 5.2 Licensor has the right, in addition and without prejudice to any other
130
+ rights or remedies, to terminate this Agreement immediately as follows:
131
+
132
+ 5.2.1 for any material breach of Agreement, that is not cured within seven (7)
133
+ days of receipt by Licensee in default of a written notice specifying the breach
134
+ and requiring its cure;
135
+
136
+ 5.2.2 upon receiving a written notice, if (a) all or a substantial portion of
137
+ the assets of Licensee are transferred to an assignee for the benefit of
138
+ creditors, or to a receiver or a trustee in bankruptcy, (b) a proceeding is
139
+ commenced by or against Licensee for relief under bankruptcy or similar laws and
140
+ such proceeding is not dismissed within sixty (60) days, or (c) Licensee is
141
+ adjudged bankrupt.
142
+
143
+ 5.3 If and when this Agreement is terminated due to any reason or cause
144
+ whatsoever, the Licensee shall cease to Use Licensed Software and any of its
145
+ rights under Clause 2, and delete all copies of Licensed Software. For clarity,
146
+ the termination of this Agreement shall not affect the validity of any licenses
147
+ granted by the Licensee to End Users with respect to Project Results prior to
148
+ the termination of this Agreement, but the Licensee shall not be entitled to
149
+ Use Licensed Software after the termination of the Agreement.
150
+
151
+ 5.4 Provisions of the Agreement which, by their nature, are intended to survive
152
+ its termination or expiration, shall survive its termination or expiration.
153
+
154
+ 6. Warranties
155
+ THE LICENSED SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EXPRESS
156
+ OR IMPLIED, AND TO THE MAXIMUM EXTENT PERMITTED BY THE APPLICABLE LAW. EXCEPT AS
157
+ EXPRESSLY PROVIDED IN THIS CLAUSE, NO WARRANTY, CONDITION, UNDERTAKING,
158
+ LIABILITY OR TERM, EXPRESS OR IMPLIED, STATUTORY OR OTHERWISE, AS TO CONDITION,
159
+ QUALITY, PERFORMANCE, FUNCTIONALITY, INFRINGEMENT, MERCHANTABILITY, DURABILITY
160
+ OR FITNESS FOR PURPOSE, IS GIVEN OR ASSUMED BY VAADIN LTD., LICENSOR OR ITS
161
+ LICENSORS AND ALL SUCH WARRANTIES, CONDITIONS, UNDERTAKINGS AND TERMS ARE HEREBY
162
+ EXCLUDED.
163
+
164
+ 7. Limitation of Liability
165
+ VAADIN LTD. AND/OR LICENSOR WILL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
166
+ PUNITIVE OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER
167
+ AND HOWSOEVER CAUSED (INCLUDING BUSINESS INTERRUPTION, OR ANY LOSS OF BUSINESS,
168
+ ANTICIPATED SAVINGS, REVENUE, GOODWILL, MANAGEMENT TIME, LOSS OF PROFITS OR OF
169
+ CONTRACTS, LOSS OF OPERATION TIME, LOSS OF REPUTATION OR OF DATA) INCLUDING
170
+ NEGLIGENCE, WHETHER IN CONTRACT OR TORT, EVEN IF THEY HAVE BEEN ADVISED OF THE
171
+ POSSIBILITY. DEVELOPER AND/OR LICENSEE WILL USE REASONABLE EFFORTS TO MITIGATE
172
+ THEIR LOSS SUFFERED. VAADIN LTD'S AND/OR LICENSOR'S AGGREGATE LIABILITY AND THAT
173
+ OF ITS AFFILIATES AND SUPPLIERS UNDER OR IN CONNECTION WITH THIS LICENSE
174
+ AGREEMENT WILL BE LIMITED TO THE AMOUNT ACTUALLY PAID FOR THE LICENSED SOFTWARE
175
+ DURING THE MOST RECENT SUBSCRIPTION PERIOD.
176
+
177
+ 8. Updates, new versions maintenance and support
178
+ Licensor may, at its sole discretion, during the Subscription term provide
179
+ maintenance releases, updates and upgrades as new versions of the Licensed
180
+ Software.
181
+
182
+ Licensee is not entitled to receive support for the Licensed Software, but
183
+ Licensor may, at its sole discretion during the Subscription term, provide
184
+ support either for free or for a fee.
185
+
186
+ 9. Miscellaneous
187
+ 9.1 No Waiver
188
+
189
+ The failure of Licensor to exercise any of its rights under this Agreement or to
190
+ require the performance of any term or provision of this Agreement, or any
191
+ waiver by the Licensor of any term or provision or breach of this Agreement,
192
+ shall not prevent a subsequent exercise or enforcement of such right or be
193
+ deemed a waiver of any subsequent breach of the same or any other term or
194
+ provision of this Agreement. Any waiver of the performance of any of the terms
195
+ or conditions of this Agreement shall be effective only if in writing and signed
196
+ by the Party against which such waiver is to be enforced.
197
+
198
+ 9.2 Headings
199
+
200
+ The headings in this Agreement are for the convenience of the Parties only and
201
+ are not intended to define or limit the scope or interpretation of the Agreement
202
+ or any provision hereof.
203
+
204
+ 9.3 Severability
205
+
206
+ If any term of this Agreement is invalid or unenforceable, such terms or
207
+ provisions shall not invalidate the rest of the Agreement which shall remain in
208
+ full force and effect as if such invalidated or unenforceable terms or
209
+ conditions had not been made a part of this Agreement. In the event this Clause
210
+ (Severability) becomes operative, Parties agree to attempt to negotiate
211
+ settlement that carries out the economic intent of the terms or provisions found
212
+ invalid or unenforceable.
213
+
214
+ 9.4 Export Control
215
+
216
+ The Licensed Software may be subject to import and export controls in other
217
+ countries. Licensee agrees to strictly comply with all applicable import and
218
+ export regulations and acknowledge that Licensee has the responsibility to
219
+ obtain licenses to export, re-export, transfer or import Licensed Software.
220
+
221
+ 9.5 Entire Agreement and Assignment
222
+
223
+ Agreement sets forth the entire agreement between the Parties with respect to
224
+ the subject matter hereof and supersedes any prior proposals and
225
+ representations, whether written or oral. Neither Party shall have the right to
226
+ assign this Agreement to a third party without the prior written consent of the
227
+ other party. However, Licensor shall have the right to assign this Agreement and
228
+ the rights and obligations contained therein to a company belonging to the same
229
+ group of companies as Licensor, and to a third party to which the business of
230
+ Licensor is transferred.
231
+
232
+ 9.6 Governing Law and Jurisdiction
233
+
234
+ 9.6.1 For customers domiciled in the United States
235
+
236
+ If the Customer’s domicile is in the United States, the Agreement shall be
237
+ governed by and construed in accordance with the substantive laws of the State
238
+ of California. The Agreement shall be construed and enforced without regard to
239
+ the United Nations Convention on the International Sale of Goods (CISG). Any
240
+ dispute or controversy or claim arising out of or relating to this Agreement, or
241
+ the breach, termination or validity thereof, shall be resolved by final and
242
+ binding arbitration in accordance with the International Chamber of Commerce
243
+ Rules of Arbitration, by one (1) arbitrator appointed according to the
244
+ aforementioned rules. The arbitration shall be conducted in the English
245
+ language in San Francisco, California, United States.
246
+
247
+ 9.6.2 For customers domiciled outside the United States
248
+
249
+ If the Customer’s domicile is outside the United States, the Agreement shall be
250
+ governed by and construed in accordance with the substantive laws of Finland,
251
+ excluding its choice of law provisions and the United Nations Convention on
252
+ Contracts for the International Sale of Goods (CISG). Any dispute, controversy
253
+ or claim arising out of or relating to the Agreement, or the breach, termination
254
+ or validity thereof, shall be finally settled by arbitration in accordance with
255
+ the Arbitration Rules of the Finland Chamber of Commerce. The number of
256
+ arbitrators shall be one. The seat of arbitration shall be Turku, Finland. The
257
+ language of the arbitration shall be English.
258
+
259
+ 9.7 Language
260
+
261
+ The official text of the Agreement or any notices given or accounts or
262
+ statements required hereby shall be in English.
package/README.md ADDED
@@ -0,0 +1,72 @@
1
+ # <vaadin-grid-pro>
2
+
3
+ [Live Demo ↗](https://vaadin.com/components/vaadin-grid-pro/html-examples)
4
+ |
5
+ [API documentation ↗](https://vaadin.com/components/vaadin-grid-pro/html-api)
6
+
7
+ [<vaadin-grid-pro>](https://vaadin.com/components/vaadin-grid-pro) is a high quality data grid / data table Web Component with extended functionality, part of the [Vaadin components](https://vaadin.com/components).
8
+
9
+ [![npm version](https://badgen.net/npm/v/@vaadin/grid-pro)](https://www.npmjs.com/package/@vaadin/grid-pro)
10
+ [![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-grid-pro)
11
+ [![Discord](https://img.shields.io/discord/732335336448852018?label=discord)](https://discord.gg/PHmkCKC)
12
+
13
+ ```html
14
+ <vaadin-grid-pro>
15
+ <vaadin-grid-pro-edit-column path="firstName" header="First Name"></vaadin-grid-pro-edit-column>
16
+ <vaadin-grid-pro-edit-column path="lastName" header="Last Name"></vaadin-grid-pro-edit-column>
17
+ <vaadin-grid-pro-edit-column path="email" header="Email"></vaadin-grid-pro-edit-column>
18
+ </vaadin-grid-pro>
19
+ <script>
20
+ // Populate the grid with data
21
+ const grid = document.querySelector('vaadin-grid-pro');
22
+ fetch('https://demo.vaadin.com/demo-data/1.0/people?count=200')
23
+ .then((res) => res.json())
24
+ .then((json) => (grid.items = json.result));
25
+ </script>
26
+ ```
27
+
28
+ [<img src="https://raw.githubusercontent.com/vaadin/vaadin-grid-pro/master/screenshot.png" width="900" alt="Screenshot of vaadin-grid-pro">](https://vaadin.com/components/vaadin-grid-pro)
29
+
30
+ ## Installation
31
+
32
+ Install `vaadin-grid-pro`:
33
+
34
+ ```sh
35
+ npm i @vaadin/vaadin-pro --save
36
+ ```
37
+
38
+ Once installed, import it in your application:
39
+
40
+ ```js
41
+ import '@vaadin/grid-pro/vaadin-grid-pro.js';
42
+ ```
43
+
44
+ ## Getting started
45
+
46
+ Vaadin components use the Lumo theme by default.
47
+
48
+ To use the Material theme, import the correspondent file from the `theme/material` folder.
49
+
50
+ ## Entry points
51
+
52
+ - The component with the Lumo theme:
53
+
54
+ `theme/lumo/vaadin-grid-pro.js`
55
+
56
+ - The component with the Material theme:
57
+
58
+ `theme/material/vaadin-grid-pro.js`
59
+
60
+ - Alias for `theme/lumo/vaadin-grid-pro.js`:
61
+
62
+ `vaadin-grid-pro.js`
63
+
64
+ ## Contributing
65
+
66
+ Read the [contributing guide](https://vaadin.com/docs/latest/guide/contributing/overview) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
67
+
68
+ ## License
69
+
70
+ Commercial Vaadin Developer License 4.0 (CVDLv4). For license terms, see LICENSE.
71
+
72
+ Vaadin collects development time usage statistics to improve this product. For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@vaadin/grid-pro",
3
+ "version": "22.0.0-alpha7",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "description": "vaadin-grid-pro",
8
+ "license": "https://raw.githubusercontent.com/vaadin/web-components/master/packages/grid-pro/LICENSE",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/vaadin/web-components.git",
12
+ "directory": "packages/grid-pro"
13
+ },
14
+ "author": "Vaadin Ltd",
15
+ "homepage": "https://vaadin.com/components",
16
+ "bugs": {
17
+ "url": "https://github.com/vaadin/web-components/issues"
18
+ },
19
+ "main": "vaadin-grid-pro.js",
20
+ "module": "vaadin-grid-pro.js",
21
+ "files": [
22
+ "src",
23
+ "theme",
24
+ "vaadin-*.d.ts",
25
+ "vaadin-*.js"
26
+ ],
27
+ "keywords": [
28
+ "Vaadin",
29
+ "vaadin-grid-pro",
30
+ "web-components",
31
+ "web-component",
32
+ "polymer"
33
+ ],
34
+ "dependencies": {
35
+ "@polymer/polymer": "^3.0.0",
36
+ "@vaadin/checkbox": "22.0.0-alpha7",
37
+ "@vaadin/component-base": "22.0.0-alpha7",
38
+ "@vaadin/grid": "22.0.0-alpha7",
39
+ "@vaadin/item": "22.0.0-alpha7",
40
+ "@vaadin/list-box": "22.0.0-alpha7",
41
+ "@vaadin/select": "22.0.0-alpha7",
42
+ "@vaadin/text-field": "22.0.0-alpha7",
43
+ "@vaadin/vaadin-license-checker": "^2.1.0",
44
+ "@vaadin/vaadin-lumo-styles": "22.0.0-alpha7",
45
+ "@vaadin/vaadin-material-styles": "22.0.0-alpha7",
46
+ "@vaadin/vaadin-themable-mixin": "22.0.0-alpha7"
47
+ },
48
+ "devDependencies": {
49
+ "@esm-bundle/chai": "^4.3.4",
50
+ "@vaadin/date-picker": "22.0.0-alpha7",
51
+ "@vaadin/dialog": "22.0.0-alpha7",
52
+ "@vaadin/polymer-legacy-adapter": "22.0.0-alpha7",
53
+ "@vaadin/testing-helpers": "^0.3.0",
54
+ "lit": "^2.0.0",
55
+ "sinon": "^9.2.1"
56
+ },
57
+ "gitHead": "8e89419c6b44a1d225d5859e180d7b35e47ddb52"
58
+ }
@@ -0,0 +1 @@
1
+ export type GridProEditorType = 'text' | 'checkbox' | 'select' | 'custom';
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2019 - 2021 Vaadin Ltd.
4
+ * This program is available under Commercial Vaadin Developer License 4.0 (CVDLv4).
5
+ * See <a href="https://vaadin.com/license/cvdl-4.0">the website</a> for the complete license.
6
+ */
7
+ import { Checkbox } from '@vaadin/checkbox/src/vaadin-checkbox.js';
8
+
9
+ /**
10
+ * An element used internally by `<vaadin-grid-pro>`. Not intended to be used separately.
11
+ *
12
+ * @extends Checkbox
13
+ * @private
14
+ */
15
+ class GridProEditCheckbox extends Checkbox {
16
+ static get is() {
17
+ return 'vaadin-grid-pro-edit-checkbox';
18
+ }
19
+ }
20
+
21
+ customElements.define(GridProEditCheckbox.is, GridProEditCheckbox);
@@ -0,0 +1,85 @@
1
+ import { GridColumn } from '@vaadin/grid/src/vaadin-grid-column.js';
2
+
3
+ import { GridDefaultItem, GridBodyRenderer, GridItemModel } from '@vaadin/grid';
4
+
5
+ import { GridProEditorType } from './interfaces';
6
+
7
+ /**
8
+ * `<vaadin-grid-pro-edit-column>` is a helper element for the `<vaadin-grid-pro>`
9
+ * that provides default inline editing for the items.
10
+ *
11
+ * __Note that the `path` property must be explicitly specified for edit column.__
12
+ *
13
+ * #### Example:
14
+ * ```html
15
+ * <vaadin-grid-pro items="[[items]]">
16
+ * <vaadin-grid-pro-edit-column path="name.first"></vaadin-grid-pro-edit-column>
17
+ *
18
+ * <vaadin-grid-column>
19
+ * ...
20
+ * ```
21
+ */
22
+ declare class GridProEditColumn<TItem = GridDefaultItem> extends GridColumn<TItem> {
23
+ /**
24
+ * JS Path of the property in the item used for the editable content.
25
+ */
26
+ path: string | null | undefined;
27
+
28
+ /**
29
+ * Custom function for rendering the cell content in edit mode.
30
+ * Receives three arguments:
31
+ *
32
+ * - `root` The cell content DOM element. Append your editor component to it.
33
+ * - `column` The `<vaadin-grid-pro-edit-column>` element.
34
+ * - `model` The object with the properties related with
35
+ * the rendered item, contains:
36
+ * - `model.index` The index of the item.
37
+ * - `model.item` The item.
38
+ * - `model.expanded` Sublevel toggle state.
39
+ * - `model.level` Level of the tree represented with a horizontal offset of the toggle button.
40
+ * - `model.selected` Selected state.
41
+ * - `model.detailsOpened` Details opened state.
42
+ */
43
+ editModeRenderer: GridBodyRenderer<TItem> | null | undefined;
44
+
45
+ /**
46
+ * The list of options which should be passed to cell editor component.
47
+ * Used with the `select` editor type, to provide a list of items.
48
+ */
49
+ editorOptions: string[];
50
+
51
+ /**
52
+ * Type of the cell editor component to be rendered. Allowed values:
53
+ * - `text` (default) - renders a text field
54
+ * - `checkbox` - renders a checkbox
55
+ * - `select` - renders a select with a list of items passed as `editorOptions`
56
+ *
57
+ * Editor type is set to `custom` when `editModeRenderer` is set.
58
+ * @attr {text|checkbox|select|custom} editor-type
59
+ */
60
+ editorType: GridProEditorType;
61
+
62
+ /**
63
+ * Path of the property used for the value of the editor component.
64
+ * @attr {string} editor-value-path
65
+ */
66
+ editorValuePath: string;
67
+
68
+ _getEditorTagName(cell: HTMLElement): string;
69
+
70
+ _getEditorComponent(cell: HTMLElement): HTMLElement | null;
71
+
72
+ _getEditorValue(editor: HTMLElement): unknown | null;
73
+
74
+ _startCellEdit(cell: HTMLElement, model: GridItemModel<TItem>): void;
75
+
76
+ _stopCellEdit(cell: HTMLElement, model: GridItemModel<TItem>): void;
77
+ }
78
+
79
+ declare global {
80
+ interface HTMLElementTagNameMap {
81
+ 'vaadin-grid-pro-edit-column': GridProEditColumn<GridDefaultItem>;
82
+ }
83
+ }
84
+
85
+ export { GridProEditColumn };