@vaadin/crud 23.0.0-alpha4 → 23.0.0-beta3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/crud",
3
- "version": "23.0.0-alpha4",
3
+ "version": "23.0.0-beta3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -34,24 +34,23 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@open-wc/dedupe-mixin": "^1.3.0",
37
- "@polymer/iron-media-query": "^3.0.0",
38
37
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/button": "23.0.0-alpha4",
40
- "@vaadin/component-base": "23.0.0-alpha4",
41
- "@vaadin/confirm-dialog": "23.0.0-alpha4",
42
- "@vaadin/dialog": "23.0.0-alpha4",
43
- "@vaadin/form-layout": "23.0.0-alpha4",
44
- "@vaadin/grid": "23.0.0-alpha4",
45
- "@vaadin/text-field": "23.0.0-alpha4",
38
+ "@vaadin/button": "23.0.0-beta3",
39
+ "@vaadin/component-base": "23.0.0-beta3",
40
+ "@vaadin/confirm-dialog": "23.0.0-beta3",
41
+ "@vaadin/dialog": "23.0.0-beta3",
42
+ "@vaadin/form-layout": "23.0.0-beta3",
43
+ "@vaadin/grid": "23.0.0-beta3",
44
+ "@vaadin/text-field": "23.0.0-beta3",
46
45
  "@vaadin/vaadin-license-checker": "^2.1.0",
47
- "@vaadin/vaadin-lumo-styles": "23.0.0-alpha4",
48
- "@vaadin/vaadin-material-styles": "23.0.0-alpha4",
49
- "@vaadin/vaadin-themable-mixin": "23.0.0-alpha4"
46
+ "@vaadin/vaadin-lumo-styles": "23.0.0-beta3",
47
+ "@vaadin/vaadin-material-styles": "23.0.0-beta3",
48
+ "@vaadin/vaadin-themable-mixin": "23.0.0-beta3"
50
49
  },
51
50
  "devDependencies": {
52
51
  "@esm-bundle/chai": "^4.3.4",
53
52
  "@vaadin/testing-helpers": "^0.3.2",
54
53
  "sinon": "^9.2.1"
55
54
  },
56
- "gitHead": "81e2deee5147bb7c1f4884760f4598613306f1fb"
55
+ "gitHead": "4c87216666541f9eb58f56c475964727822aad53"
57
56
  }
@@ -167,6 +167,10 @@ class CrudGrid extends IncludedMixin(Grid) {
167
167
  if (!this.noHead && path) {
168
168
  // Create a header renderer for the column (or column group)
169
169
  col.headerRenderer = (root) => {
170
+ if (root.firstElementChild) {
171
+ return;
172
+ }
173
+
170
174
  const label = this._generateHeader(path);
171
175
 
172
176
  if (col.__sortColumnGroup || (this.noFilter && !this.noSort)) {
@@ -174,12 +178,16 @@ class CrudGrid extends IncludedMixin(Grid) {
174
178
  // sort column (in case a filter isn't used at all) => add the sort indicator
175
179
  const sorter = document.createElement('vaadin-grid-sorter');
176
180
  sorter.setAttribute('path', path);
181
+ // TODO: Localize aria labels
182
+ sorter.setAttribute('aria-label', `Sort by ${label}`);
177
183
  sorter.textContent = label;
178
184
  root.appendChild(sorter);
179
185
  } else if (!this.noFilter) {
180
186
  // Filtering is enabled in this crud-grid, create the filter element
181
187
  const filter = document.createElement('vaadin-grid-filter');
182
188
  filter.setAttribute('path', path);
189
+ // TODO: Localize aria labels
190
+ filter.setAttribute('aria-label', `Filter by ${label}`);
183
191
  filter.style.display = 'flex';
184
192
 
185
193
  const textField = window.document.createElement('vaadin-text-field');
@@ -3,6 +3,7 @@
3
3
  * Copyright (c) 2018 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
6
7
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
7
8
  import { GridFilterDefinition, GridSorterDefinition } from '@vaadin/grid/src/vaadin-grid.js';
8
9
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
@@ -237,7 +238,7 @@ export type CrudEventMap<T> = HTMLElementEventMap & CrudCustomEventMap<T>;
237
238
  * @fires {CustomEvent} save - Fired when user wants to save a new or an existing item.
238
239
  * @fires {CustomEvent} cancel - Fired when user discards edition.
239
240
  */
240
- declare class Crud<Item> extends ElementMixin(ThemableMixin(HTMLElement)) {
241
+ declare class Crud<Item> extends ControllerMixin(ElementMixin(ThemableMixin(HTMLElement))) {
241
242
  /**
242
243
  * A reference to all fields inside the [`_form`](#/elements/vaadin-crud#property-_form) element
243
244
  */
@@ -3,7 +3,6 @@
3
3
  * Copyright (c) 2018 - 2022 Vaadin Ltd.
4
4
  * This program is available under Commercial Vaadin Developer License 4.0, available at https://vaadin.com/license/cvdl-4.0.
5
5
  */
6
- import '@polymer/iron-media-query/iron-media-query.js';
7
6
  import '@vaadin/button/src/vaadin-button.js';
8
7
  import '@vaadin/dialog/src/vaadin-dialog.js';
9
8
  import '@vaadin/confirm-dialog/src/vaadin-confirm-dialog.js';
@@ -14,7 +13,9 @@ import './vaadin-crud-form.js';
14
13
  import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
15
14
  import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
16
15
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
16
+ import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
17
17
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
18
+ import { MediaQueryController } from '@vaadin/component-base/src/media-query-controller.js';
18
19
  import { SlotMixin } from '@vaadin/component-base/src/slot-mixin.js';
19
20
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
20
21
 
@@ -148,15 +149,18 @@ const HOST_PROPS = {
148
149
  * @fires {CustomEvent} cancel - Fired when user discards edition.
149
150
  *
150
151
  * @extends HTMLElement
152
+ * @mixes ControllerMixin
151
153
  * @mixes ElementMixin
152
154
  * @mixes SlotMixin
153
155
  * @mixes ThemableMixin
154
156
  */
155
- class Crud extends SlotMixin(ElementMixin(ThemableMixin(PolymerElement))) {
157
+ class Crud extends SlotMixin(ControllerMixin(ElementMixin(ThemableMixin(PolymerElement)))) {
156
158
  static get template() {
157
159
  return html`
158
160
  <style>
159
161
  :host {
162
+ width: 100%;
163
+ height: 400px;
160
164
  --vaadin-crud-editor-max-height: 40%;
161
165
  --vaadin-crud-editor-max-width: 40%;
162
166
  }
@@ -165,14 +169,13 @@ class Crud extends SlotMixin(ElementMixin(ThemableMixin(PolymerElement))) {
165
169
  #main {
166
170
  display: flex;
167
171
  flex-direction: column;
168
- height: 400px;
169
- flex: 1 1 100%;
170
172
  align-self: stretch;
171
173
  position: relative;
172
174
  overflow: hidden;
173
175
  }
174
176
 
175
177
  #main {
178
+ flex: 1 1 100%;
176
179
  height: 100%;
177
180
  }
178
181
 
@@ -306,8 +309,6 @@ class Crud extends SlotMixin(ElementMixin(ThemableMixin(PolymerElement))) {
306
309
  message="[[i18n.confirm.delete.content]]"
307
310
  confirm-theme="primary error"
308
311
  ></vaadin-confirm-dialog>
309
-
310
- <iron-media-query query="[[_fullscreenMediaQuery]]" query-matches="{{_fullscreen}}"></iron-media-query>
311
312
  `;
312
313
  }
313
314
 
@@ -685,6 +686,12 @@ class Crud extends SlotMixin(ElementMixin(ThemableMixin(PolymerElement))) {
685
686
  this.$.dialog.$.overlay.addEventListener('vaadin-overlay-escape-press', this.__cancelBound);
686
687
  // Initialize the default buttons
687
688
  this.__propagateHostAttributes();
689
+
690
+ this.addController(
691
+ new MediaQueryController(this._fullscreenMediaQuery, (matches) => {
692
+ this._fullscreen = matches;
693
+ })
694
+ );
688
695
  }
689
696
 
690
697
  /** @private */