@emuanalytics/flow-rdf-ui 4.1.0-preview.25 → 4.1.0-preview.27

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.
@@ -185,7 +185,6 @@ class FlowUiInput extends FlowRdfFormControl {
185
185
  }
186
186
  });
187
187
  }
188
- event.stopPropagation();
189
188
  }
190
189
  handlePasswordToggle() {
191
190
  this.passwordVisible = !this.passwordVisible;
@@ -67,6 +67,8 @@ class FlowUiMap extends FlowRdfElement {
67
67
  handleBaseStyleChange() {
68
68
  if (this._map) {
69
69
  this._map.setBaseStyle(this.baseStyle);
70
+ } else {
71
+ this._pendingBaseStyle = this.baseStyle;
70
72
  }
71
73
  }
72
74
  async connectedCallback() {
@@ -103,6 +105,10 @@ class FlowUiMap extends FlowRdfElement {
103
105
  map.setCenter(this._pendingCenter);
104
106
  this._pendingCenter = void 0;
105
107
  }
108
+ if (this._pendingBaseStyle) {
109
+ map.setBaseStyle(this._pendingBaseStyle);
110
+ this._pendingBaseStyle = void 0;
111
+ }
106
112
  map.on("loading", (ev) => {
107
113
  this._mapLoading = ev.loading;
108
114
  });
@@ -26,6 +26,8 @@ const _FlowUiQueryBuilder = class _FlowUiQueryBuilder extends FlowRdfElement {
26
26
  constructor() {
27
27
  super(...arguments);
28
28
  this._value = { condition: "and", rules: [{ field: "", operator: "=", enabled: true }] };
29
+ // Track the last value control that had focus when the enter key was pressed
30
+ this.enterKeyElement = null;
29
31
  this.hasSlotController = new HasSlotController(
30
32
  this,
31
33
  "help-text",
@@ -176,6 +178,19 @@ const _FlowUiQueryBuilder = class _FlowUiQueryBuilder extends FlowRdfElement {
176
178
  this.emitValueChange();
177
179
  });
178
180
  }
181
+ handleValueKeyDown(ev) {
182
+ const hasModifier = ev.metaKey || ev.ctrlKey || ev.shiftKey || ev.altKey;
183
+ if (ev.key === "Enter" && !hasModifier) {
184
+ if (ev.target === this.enterKeyElement) {
185
+ this.enterKeyElement = null;
186
+ this.emit("flow-ui-apply");
187
+ } else {
188
+ this.enterKeyElement = ev.target;
189
+ }
190
+ } else {
191
+ this.enterKeyElement = null;
192
+ }
193
+ }
179
194
  handleToolbarMenuSelect(ev) {
180
195
  const menuItem = ev.detail.item;
181
196
  const emptyRuleSet = {
@@ -349,6 +364,7 @@ const _FlowUiQueryBuilder = class _FlowUiQueryBuilder extends FlowRdfElement {
349
364
  return html`
350
365
  <div
351
366
  class="query-builder__rule-value-wrapper"
367
+ @keydown=${this.handleValueKeyDown}
352
368
  @flow-ui-change=${(ev) => ev.stopPropagation()}
353
369
  @flow-ui-input=${(ev) => ev.stopPropagation()}
354
370
  >