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

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;
@@ -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
  >