@hortiview/shared-components 2.7.0 → 2.8.1
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/CHANGELOG.md +25 -0
- package/README.md +49 -22
- package/dist/{AlertBanner-JnX0tJGC.js → AlertBanner-DlgFtlZm.js} +3 -3
- package/dist/{BigLoadingSpinner-chQoiNY9.js → BigLoadingSpinner-B_HFhx2F.js} +1 -1
- package/dist/{GenericCard-c9yuyN3m.js → GenericCard-Cv8qaFLu.js} +3 -3
- package/dist/{ListAreaService-BY6ZTds9.js → ListAreaService-D9HRsvH0.js} +5 -5
- package/dist/{OfflineView-BUSWAKez.js → OfflineView-Bw-sbsym.js} +3 -3
- package/dist/{_baseIsEqual-CZNn3LMM.js → _baseIsEqual-Df2URKWm.js} +27 -28
- package/dist/{_getAllKeys-tc1bcd1W.js → _getAllKeys-BQWmkEw5.js} +9 -9
- package/dist/_getTag-BkGSRa18.js +79 -0
- package/dist/_setToString-B6E13pDg.js +580 -0
- package/dist/components/AlertBanner/AlertBanner.js +4 -4
- package/dist/components/AlertBanner/AlertBanner.test.js +1 -1
- package/dist/components/AlertBanner/LinkBanner.js +3 -3
- package/dist/components/BaseView/BaseView.js +2 -2
- package/dist/components/BasicHeading/BasicHeading.js +2 -2
- package/dist/components/BasicHeading/BasicHeading.test.js +1 -1
- package/dist/components/BlockView/BlockView.js +1 -1
- package/dist/components/ChipCard/ChipCard.js +5 -5
- package/dist/components/ContextMenu/ContextMenu.js +4 -4
- package/dist/components/DeleteModal/DeleteModal.js +10 -10
- package/dist/components/DetailContentWrapper/DetailContentWrapper.js +1 -1
- package/dist/components/Disclaimer/Disclaimer.js +3 -3
- package/dist/components/EmptyView/EmptyView.js +4 -4
- package/dist/components/Filter/Filter.js +33 -33
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +1 -1
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +4936 -4927
- package/dist/components/FormComponents/FormNumber/CustomTextField.js +3 -3
- package/dist/components/FormComponents/FormRadio/FormRadio.js +1 -1
- package/dist/components/FormComponents/FormSelect/FormSelect.js +2 -2
- package/dist/components/FormComponents/FormSelect/SelectTooltipText.js +2 -2
- package/dist/components/FormComponents/FormSlider/FormSlider.js +4 -4
- package/dist/components/FormComponents/FormText/FormText.js +2 -2
- package/dist/components/FormComponents/FormToggle/FormToggle.js +4 -4
- package/dist/components/GenericTable/GenericTable.js +20 -20
- package/dist/components/GenericTable/Mobile/GenericCard.js +4 -4
- package/dist/components/GenericTable/Mobile/GenericCard.test.js +1 -1
- package/dist/components/GenericTable/Mobile/GenericCardList.js +4 -4
- package/dist/components/HashTabView/HashTabView.js +6 -6
- package/dist/components/HeaderFilter/HeaderFilter.js +1 -1
- package/dist/components/HealthCheckFailed/HealthCheckFailed.js +4 -4
- package/dist/components/Iconify/Iconify.js +2 -2
- package/dist/components/InfoGroup/InfoGroup.js +3 -3
- package/dist/components/ListArea/ListArea.js +6 -6
- package/dist/components/ListArea/ListArea.test.js +3 -3
- package/dist/components/ListArea/ListAreaService.js +6 -6
- package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +2 -2
- package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +1 -1
- package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +6 -6
- package/dist/components/Modal/Modal.d.ts +5 -4
- package/dist/components/Modal/Modal.js +94 -92
- package/dist/components/ModulePadding/ModulePadding.js +8 -8
- package/dist/components/OfflineView/OfflineView.js +4 -4
- package/dist/components/OfflineView/OfflineView.test.js +1 -1
- package/dist/components/OnboardingBanner/OnboardingBanner.js +7 -7
- package/dist/components/OverflowTooltip/OverflowTooltip.js +1 -1
- package/dist/components/OverflowTooltip/OverflowTooltip.test.js +1 -1
- package/dist/components/SafeForm/SafeForm.d.ts +11 -0
- package/dist/components/SafeForm/SafeForm.js +9 -0
- package/dist/components/SafeForm/SafeForm.test.d.ts +1 -0
- package/dist/components/SafeForm/SafeForm.test.js +91 -0
- package/dist/components/SearchBar/SearchBar.js +20 -19
- package/dist/components/Select/Select.js +2 -2
- package/dist/components/Stepper/Stepper.js +1 -1
- package/dist/components/Stepper/components/StepperButton.js +1 -1
- package/dist/components/Stepper/components/StepperHeader.js +2 -2
- package/dist/components/Stepper/components/StepperIndicator.js +1 -1
- package/dist/{get-B8c-T4F8.js → get-CqneoueQ.js} +1 -1
- package/dist/{get-C7KpEkVs.js → get-DQr2KQKm.js} +12 -13
- package/dist/hooks/useHelperText.js +1 -1
- package/dist/index-D5m--65X.js +1491 -0
- package/dist/{index.es--yyG47az.js → index.es-1zrFd4Te.js} +2 -2
- package/dist/{index.es-DErA6zWG.js → index.es-8MVlRCi4.js} +2 -2
- package/dist/{index.es-CzUKBF7E.js → index.es-BaX-8joZ.js} +10 -10
- package/dist/{index.es-6c1Xbl0N.js → index.es-BbaCXS9-.js} +1 -1
- package/dist/{index.es-CPqaUyn3.js → index.es-BikIx4uw.js} +10 -10
- package/dist/{index.es-DDo_AHL0.js → index.es-CDMu_yu0.js} +7 -7
- package/dist/{index.es-Bf149BSP.js → index.es-Cdu6tjUC.js} +4 -4
- package/dist/{index.es-DlzwTKbh.js → index.es-ChSlnpSq.js} +88 -90
- package/dist/{index.es-CqgVUhln.js → index.es-CyjMwj5g.js} +3 -3
- package/dist/{index.es-BoWmBoqO.js → index.es-D66OkZJH.js} +8 -8
- package/dist/{index.es-D-ph6ImM.js → index.es-DFFyENnI.js} +1 -1
- package/dist/{index.es-zQBuWUgU.js → index.es-DTMwaJ6B.js} +2 -2
- package/dist/{index.es-DOX4XTz_.js → index.es-DgTJmbgD.js} +2 -2
- package/dist/{index.es-Bx1E5MPK.js → index.es-DmsyeHLO.js} +4 -4
- package/dist/{index.es-oOD85ZwA.js → index.es-Dnrk7XL6.js} +4 -4
- package/dist/{index.es-CbBdaRO2.js → index.es-Dw1eih7R.js} +2 -2
- package/dist/{index.es-DxDU9C_B.js → index.es-eKuwB1ll.js} +1 -1
- package/dist/{index.es-CUuzYysw.js → index.es-jFaPNuBO.js} +4 -4
- package/dist/{index.es-BTc2I5pe.js → index.es-ks_RnHLh.js} +2 -2
- package/dist/{index.es-DMGNht46.js → index.es-nQ0lMwpE.js} +1 -1
- package/dist/{index.es-U5-b20Gv.js → index.es-p4O33fMu.js} +4 -4
- package/dist/{index.es-DF11ERDs.js → index.es-qxTN-Bb2.js} +2 -2
- package/dist/{index.es-Kg9soDed.js → index.es-xnSvM9b9.js} +3 -3
- package/dist/{isArray-Dub1wGJM.js → isArray-CSaAxHlq.js} +1 -1
- package/dist/isArray-DDZrq40X.js +456 -0
- package/dist/{isEmpty-DsdC9UUD.js → isEmpty-SkzPhavO.js} +3 -3
- package/dist/{isString-BW9UHONv.js → isString-CZsZiWgW.js} +2 -2
- package/dist/main.d.ts +2 -1
- package/dist/main.js +38 -36
- package/dist/{omit-1Eom1PmQ.js → omit-BN3qeeaj.js} +62 -64
- package/dist/{orderBy-CyjsW2ET.js → orderBy-D4LvP9Az.js} +40 -41
- package/dist/services/UtilService.d.ts +1 -1
- package/dist/services/UtilService.js +25 -15
- package/dist/services/services.test.js +3 -0
- package/dist/{toString-CrgB_7Pe.js → toString-BFJes2_D.js} +1 -1
- package/dist/{uniqueId-NU3-C36A.js → uniqueId-DrPMzA-E.js} +1 -1
- package/package.json +1 -1
- package/dist/_MapCache-B75dXJyg.js +0 -376
- package/dist/_getTag-DYHrLaIw.js +0 -81
- package/dist/_setToString-Do1lSQTZ.js +0 -2034
- package/dist/isArray-DN9s620O.js +0 -83
- package/dist/isPlainObject-C273y67K.js +0 -40
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsxs as ft, jsx as C, Fragment as pt } from "react/jsx-runtime";
|
|
2
|
-
import { G as
|
|
3
|
-
import { I as it } from "../../index.es-
|
|
4
|
-
import { _ as ht, c as B, P as s } from "../../
|
|
5
|
-
import d, { forwardRef as gt, useRef as et, useImperativeHandle as _t, useState as nt, useEffect as E, useCallback as
|
|
6
|
-
import { i as Ct, c as b, a as St } from "../../index.es-
|
|
2
|
+
import { G as j } from "../../index.es-Dw1eih7R.js";
|
|
3
|
+
import { I as it } from "../../index.es-xnSvM9b9.js";
|
|
4
|
+
import { _ as ht, c as B, P as s } from "../../index-D5m--65X.js";
|
|
5
|
+
import d, { forwardRef as gt, useRef as et, useImperativeHandle as _t, useState as nt, useEffect as E, useCallback as q, useMemo as J, Fragment as Et } from "react";
|
|
6
|
+
import { i as Ct, c as b, a as St } from "../../index.es-ChSlnpSq.js";
|
|
7
7
|
import { b as at, c as ot, d as vt } from "../../tslib.es6-BDCynO9F.js";
|
|
8
8
|
import { M as yt, a as Ot } from "../../component-neHBNHRu.js";
|
|
9
9
|
import { M as Tt, c as At, m as bt } from "../../component-DsB0poTj.js";
|
|
10
10
|
import { A as Dt } from "../../animationframe-EMBh6XeO.js";
|
|
11
|
-
import { P as It } from "../../index.es-
|
|
12
|
-
import { b as Nt } from "../../index.es
|
|
11
|
+
import { P as It } from "../../index.es-DFFyENnI.js";
|
|
12
|
+
import { b as Nt } from "../../index.es-1zrFd4Te.js";
|
|
13
13
|
import { Iconify as Lt } from "../Iconify/Iconify.js";
|
|
14
|
-
import { O as Ft } from "../../OfflineView-
|
|
14
|
+
import { O as Ft } from "../../OfflineView-Bw-sbsym.js";
|
|
15
15
|
import '../../assets/Modal.css';/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2016 Google Inc.
|
|
@@ -74,7 +74,7 @@ function kt(i) {
|
|
|
74
74
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
75
75
|
* THE SOFTWARE.
|
|
76
76
|
*/
|
|
77
|
-
var
|
|
77
|
+
var $ = "mdc-dom-focus-sentinel", Ht = (
|
|
78
78
|
/** @class */
|
|
79
79
|
function() {
|
|
80
80
|
function i(e, t) {
|
|
@@ -86,7 +86,7 @@ var q = "mdc-dom-focus-sentinel", Ht = (
|
|
|
86
86
|
throw new Error("FocusTrap: Element must have at least one focusable child.");
|
|
87
87
|
this.elFocusedBeforeTrapFocus = document.activeElement instanceof HTMLElement ? document.activeElement : null, this.wrapTabFocus(this.root), this.options.skipInitialFocus || this.focusInitialElement(e, this.options.initialFocusEl);
|
|
88
88
|
}, i.prototype.releaseFocus = function() {
|
|
89
|
-
[].slice.call(this.root.querySelectorAll("." +
|
|
89
|
+
[].slice.call(this.root.querySelectorAll("." + $)).forEach(function(e) {
|
|
90
90
|
e.parentElement.removeChild(e);
|
|
91
91
|
}), !this.options.skipRestoreFocus && this.elFocusedBeforeTrapFocus && this.elFocusedBeforeTrapFocus.focus();
|
|
92
92
|
}, i.prototype.wrapTabFocus = function(e) {
|
|
@@ -104,16 +104,16 @@ var q = "mdc-dom-focus-sentinel", Ht = (
|
|
|
104
104
|
}, i.prototype.getFocusableElements = function(e) {
|
|
105
105
|
var t = [].slice.call(e.querySelectorAll("[autofocus], [tabindex], a, input, textarea, select, button"));
|
|
106
106
|
return t.filter(function(n) {
|
|
107
|
-
var o = n.getAttribute("aria-disabled") === "true" || n.getAttribute("disabled") != null || n.getAttribute("hidden") != null || n.getAttribute("aria-hidden") === "true", a = n.tabIndex >= 0 && n.getBoundingClientRect().width > 0 && !n.classList.contains(
|
|
107
|
+
var o = n.getAttribute("aria-disabled") === "true" || n.getAttribute("disabled") != null || n.getAttribute("hidden") != null || n.getAttribute("aria-hidden") === "true", a = n.tabIndex >= 0 && n.getBoundingClientRect().width > 0 && !n.classList.contains($) && !o, f = !1;
|
|
108
108
|
if (a) {
|
|
109
|
-
var
|
|
110
|
-
f =
|
|
109
|
+
var p = getComputedStyle(n);
|
|
110
|
+
f = p.display === "none" || p.visibility === "hidden";
|
|
111
111
|
}
|
|
112
112
|
return a && !f;
|
|
113
113
|
});
|
|
114
114
|
}, i.prototype.createSentinel = function() {
|
|
115
115
|
var e = document.createElement("div");
|
|
116
|
-
return e.setAttribute("tabindex", "0"), e.setAttribute("aria-hidden", "true"), e.classList.add(
|
|
116
|
+
return e.setAttribute("tabindex", "0"), e.setAttribute("aria-hidden", "true"), e.classList.add($), e;
|
|
117
117
|
}, i;
|
|
118
118
|
}()
|
|
119
119
|
);
|
|
@@ -172,7 +172,7 @@ var r = {
|
|
|
172
172
|
// to prevent interactions with the content behind this scrim, and to capture
|
|
173
173
|
// scrim clicks.
|
|
174
174
|
SCRIM_HIDDEN: "mdc-dialog__scrim--hidden"
|
|
175
|
-
},
|
|
175
|
+
}, y = {
|
|
176
176
|
ACTION_ATTRIBUTE: "data-mdc-dialog-action",
|
|
177
177
|
BUTTON_DEFAULT_ATTRIBUTE: "data-mdc-dialog-button-default",
|
|
178
178
|
BUTTON_SELECTOR: ".mdc-dialog__button",
|
|
@@ -192,7 +192,7 @@ var r = {
|
|
|
192
192
|
".mdc-menu .mdc-deprecated-list-item"
|
|
193
193
|
].join(", "),
|
|
194
194
|
SURFACE_SELECTOR: ".mdc-dialog__surface"
|
|
195
|
-
},
|
|
195
|
+
}, Y = {
|
|
196
196
|
DIALOG_ANIMATION_CLOSE_TIME_MS: 75,
|
|
197
197
|
DIALOG_ANIMATION_OPEN_TIME_MS: 150
|
|
198
198
|
};
|
|
@@ -228,7 +228,7 @@ var rt = (
|
|
|
228
228
|
at(e, i);
|
|
229
229
|
function e(t) {
|
|
230
230
|
var n = i.call(this, ot(ot({}, e.defaultAdapter), t)) || this;
|
|
231
|
-
return n.dialogOpen = !1, n.isFullscreen = !1, n.animationFrame = 0, n.animationTimer = 0, n.escapeKeyAction =
|
|
231
|
+
return n.dialogOpen = !1, n.isFullscreen = !1, n.animationFrame = 0, n.animationTimer = 0, n.escapeKeyAction = y.CLOSE_ACTION, n.scrimClickAction = y.CLOSE_ACTION, n.autoStackButtons = !0, n.areButtonsStacked = !1, n.suppressDefaultPressSelector = y.SUPPRESS_DEFAULT_PRESS_SELECTOR, n.animFrame = new Dt(), n.contentScrollHandler = function() {
|
|
232
232
|
n.handleScrollEvent();
|
|
233
233
|
}, n.windowResizeHandler = function() {
|
|
234
234
|
n.layout();
|
|
@@ -244,13 +244,13 @@ var rt = (
|
|
|
244
244
|
configurable: !0
|
|
245
245
|
}), Object.defineProperty(e, "strings", {
|
|
246
246
|
get: function() {
|
|
247
|
-
return
|
|
247
|
+
return y;
|
|
248
248
|
},
|
|
249
249
|
enumerable: !1,
|
|
250
250
|
configurable: !0
|
|
251
251
|
}), Object.defineProperty(e, "numbers", {
|
|
252
252
|
get: function() {
|
|
253
|
-
return
|
|
253
|
+
return Y;
|
|
254
254
|
},
|
|
255
255
|
enumerable: !1,
|
|
256
256
|
configurable: !0
|
|
@@ -320,19 +320,19 @@ var rt = (
|
|
|
320
320
|
}), e.prototype.init = function() {
|
|
321
321
|
this.adapter.hasClass(r.STACKED) && this.setAutoStackButtons(!1), this.isFullscreen = this.adapter.hasClass(r.FULLSCREEN);
|
|
322
322
|
}, e.prototype.destroy = function() {
|
|
323
|
-
this.dialogOpen && this.close(
|
|
323
|
+
this.dialogOpen && this.close(y.DESTROY_ACTION), this.animationTimer && (clearTimeout(this.animationTimer), this.handleAnimationTimerEnd()), this.isFullscreen && this.adapter.deregisterContentEventHandler("scroll", this.contentScrollHandler), this.animFrame.cancelAll(), this.adapter.deregisterWindowEventHandler("resize", this.windowResizeHandler), this.adapter.deregisterWindowEventHandler("orientationchange", this.windowOrientationChangeHandler);
|
|
324
324
|
}, e.prototype.open = function(t) {
|
|
325
325
|
var n = this;
|
|
326
326
|
this.dialogOpen = !0, this.adapter.notifyOpening(), this.adapter.addClass(r.OPENING), this.isFullscreen && this.adapter.registerContentEventHandler("scroll", this.contentScrollHandler), t && t.isAboveFullscreenDialog && this.adapter.addClass(r.SCRIM_HIDDEN), this.adapter.registerWindowEventHandler("resize", this.windowResizeHandler), this.adapter.registerWindowEventHandler("orientationchange", this.windowOrientationChangeHandler), this.runNextAnimationFrame(function() {
|
|
327
327
|
n.adapter.addClass(r.OPEN), n.adapter.addBodyClass(r.SCROLL_LOCK), n.layout(), n.animationTimer = setTimeout(function() {
|
|
328
328
|
n.handleAnimationTimerEnd(), n.adapter.trapFocus(n.adapter.getInitialFocusEl()), n.adapter.notifyOpened();
|
|
329
|
-
},
|
|
329
|
+
}, Y.DIALOG_ANIMATION_OPEN_TIME_MS);
|
|
330
330
|
});
|
|
331
331
|
}, e.prototype.close = function(t) {
|
|
332
332
|
var n = this;
|
|
333
333
|
t === void 0 && (t = ""), this.dialogOpen && (this.dialogOpen = !1, this.adapter.notifyClosing(t), this.adapter.addClass(r.CLOSING), this.adapter.removeClass(r.OPEN), this.adapter.removeBodyClass(r.SCROLL_LOCK), this.isFullscreen && this.adapter.deregisterContentEventHandler("scroll", this.contentScrollHandler), this.adapter.deregisterWindowEventHandler("resize", this.windowResizeHandler), this.adapter.deregisterWindowEventHandler("orientationchange", this.windowOrientationChangeHandler), cancelAnimationFrame(this.animationFrame), this.animationFrame = 0, clearTimeout(this.animationTimer), this.animationTimer = setTimeout(function() {
|
|
334
334
|
n.adapter.releaseFocus(), n.handleAnimationTimerEnd(), n.adapter.notifyClosed(t);
|
|
335
|
-
},
|
|
335
|
+
}, Y.DIALOG_ANIMATION_CLOSE_TIME_MS));
|
|
336
336
|
}, e.prototype.showSurfaceScrim = function() {
|
|
337
337
|
var t = this;
|
|
338
338
|
this.adapter.addClass(r.SURFACE_SCRIM_SHOWING), this.runNextAnimationFrame(function() {
|
|
@@ -366,7 +366,7 @@ var rt = (
|
|
|
366
366
|
t.layoutInternal();
|
|
367
367
|
});
|
|
368
368
|
}, e.prototype.handleClick = function(t) {
|
|
369
|
-
var n = this.adapter.eventTargetMatches(t.target,
|
|
369
|
+
var n = this.adapter.eventTargetMatches(t.target, y.SCRIM_SELECTOR);
|
|
370
370
|
if (n && this.scrimClickAction !== "")
|
|
371
371
|
this.close(this.scrimClickAction);
|
|
372
372
|
else {
|
|
@@ -478,23 +478,23 @@ var u = rt.strings, Pt = (
|
|
|
478
478
|
return new e(t);
|
|
479
479
|
}, e.prototype.initialize = function(t) {
|
|
480
480
|
var n, o;
|
|
481
|
-
t === void 0 && (t = function(
|
|
482
|
-
return new Ht(
|
|
481
|
+
t === void 0 && (t = function(h, S) {
|
|
482
|
+
return new Ht(h, S);
|
|
483
483
|
});
|
|
484
484
|
var a = this.root.querySelector(u.CONTAINER_SELECTOR);
|
|
485
485
|
if (!a)
|
|
486
486
|
throw new Error("Dialog component requires a " + u.CONTAINER_SELECTOR + " container element");
|
|
487
487
|
this.container = a, this.content = this.root.querySelector(u.CONTENT_SELECTOR), this.buttons = [].slice.call(this.root.querySelectorAll(u.BUTTON_SELECTOR)), this.defaultButton = this.root.querySelector("[" + u.BUTTON_DEFAULT_ATTRIBUTE + "]"), this.focusTrapFactory = t, this.buttonRipples = [];
|
|
488
488
|
try {
|
|
489
|
-
for (var f = vt(this.buttons),
|
|
490
|
-
var
|
|
491
|
-
this.buttonRipples.push(new Tt(
|
|
489
|
+
for (var f = vt(this.buttons), p = f.next(); !p.done; p = f.next()) {
|
|
490
|
+
var v = p.value;
|
|
491
|
+
this.buttonRipples.push(new Tt(v));
|
|
492
492
|
}
|
|
493
|
-
} catch (
|
|
494
|
-
n = { error:
|
|
493
|
+
} catch (h) {
|
|
494
|
+
n = { error: h };
|
|
495
495
|
} finally {
|
|
496
496
|
try {
|
|
497
|
-
|
|
497
|
+
p && !p.done && (o = f.return) && o.call(f);
|
|
498
498
|
} finally {
|
|
499
499
|
if (n) throw n.error;
|
|
500
500
|
}
|
|
@@ -796,38 +796,38 @@ const Ut = {
|
|
|
796
796
|
badge: o,
|
|
797
797
|
backButton: a,
|
|
798
798
|
children: f,
|
|
799
|
-
className:
|
|
800
|
-
content:
|
|
801
|
-
defaultButton:
|
|
802
|
-
dismissiveButton:
|
|
803
|
-
footerSupplemental:
|
|
804
|
-
headerActions:
|
|
805
|
-
hideCloseIcon:
|
|
799
|
+
className: p,
|
|
800
|
+
content: v,
|
|
801
|
+
defaultButton: h,
|
|
802
|
+
dismissiveButton: S,
|
|
803
|
+
footerSupplemental: g,
|
|
804
|
+
headerActions: H,
|
|
805
|
+
hideCloseIcon: P,
|
|
806
806
|
indicator: st,
|
|
807
807
|
initialFocus: O,
|
|
808
|
-
mobileStackedButtons:
|
|
808
|
+
mobileStackedButtons: U,
|
|
809
809
|
modalSize: _,
|
|
810
810
|
nextButton: T,
|
|
811
811
|
noActions: A,
|
|
812
|
-
onClose:
|
|
813
|
-
onClosed:
|
|
812
|
+
onClose: x,
|
|
813
|
+
onClosed: G,
|
|
814
814
|
onOpen: D,
|
|
815
815
|
onOpened: I,
|
|
816
816
|
open: Q,
|
|
817
|
-
preventClose:
|
|
817
|
+
preventClose: K,
|
|
818
818
|
preventPrimaryAccept: X,
|
|
819
819
|
primaryButton: c,
|
|
820
|
-
returnFocusSelector:
|
|
820
|
+
returnFocusSelector: W,
|
|
821
821
|
scrollable: Z,
|
|
822
822
|
title: tt,
|
|
823
823
|
...lt
|
|
824
824
|
} = i, N = et(), l = et();
|
|
825
825
|
_t(e, () => N.current, []);
|
|
826
|
-
const [
|
|
826
|
+
const [V, ct] = nt(), [z, dt] = nt(() => T || a);
|
|
827
827
|
E(() => {
|
|
828
828
|
dt(T || a);
|
|
829
829
|
}, [T, a]);
|
|
830
|
-
const L =
|
|
830
|
+
const L = q(() => {
|
|
831
831
|
ct(window.innerWidth <= 600);
|
|
832
832
|
}, []);
|
|
833
833
|
E(() => (L(), window.addEventListener("resize", L), () => {
|
|
@@ -835,18 +835,18 @@ const Ut = {
|
|
|
835
835
|
}), [L]), E(() => (l.current = Pt.attachTo(N.current), () => {
|
|
836
836
|
l.current.destroy();
|
|
837
837
|
}), [l, N]), E(() => {
|
|
838
|
-
l.current.foundation.setAutoStackButtons(
|
|
839
|
-
}, [
|
|
838
|
+
l.current.foundation.setAutoStackButtons(U);
|
|
839
|
+
}, [U]), E(() => {
|
|
840
840
|
A && (l.current.foundation.adapter.trapFocus = () => {
|
|
841
841
|
});
|
|
842
842
|
}, [A]), E(() => {
|
|
843
|
-
l.current.scrimClickAction =
|
|
844
|
-
}, [
|
|
845
|
-
const F =
|
|
846
|
-
|
|
847
|
-
}, [
|
|
848
|
-
|
|
849
|
-
}, [
|
|
843
|
+
l.current.scrimClickAction = K ? "" : "close", l.current.escapeKeyAction = K ? "" : "close";
|
|
844
|
+
}, [K]);
|
|
845
|
+
const F = q((m) => {
|
|
846
|
+
x && x(m);
|
|
847
|
+
}, [x]), R = q((m) => {
|
|
848
|
+
W && Ct(W), G && G(m);
|
|
849
|
+
}, [W, G]);
|
|
850
850
|
E(() => (l.current.unlisten("MDCDialog: opening", D), l.current.listen("MDCDialog: opening", D), () => {
|
|
851
851
|
l.current.unlisten("MDCDialog: opening", D);
|
|
852
852
|
}), [l, D]), E(() => (l.current.unlisten("MDCDialog:opened", I), l.current.listen("MDCDialog:opened", I), () => {
|
|
@@ -858,59 +858,59 @@ const Ut = {
|
|
|
858
858
|
}), [l, R]), E(() => {
|
|
859
859
|
Q ? l.current.open() : l.current.close();
|
|
860
860
|
}, [l, Q]);
|
|
861
|
-
const ut =
|
|
861
|
+
const ut = J(() => () => {
|
|
862
862
|
const m = {
|
|
863
863
|
className: "lmnt-modal__button mdc-dialog__button",
|
|
864
864
|
elevation: t?.props.elevation !== "default" ? t?.props.elevation : "flat",
|
|
865
865
|
variant: t?.props.variant || "filled"
|
|
866
866
|
};
|
|
867
|
-
return
|
|
868
|
-
}, [t?.props.elevation, t?.props.variant,
|
|
867
|
+
return h === "action" && (m["data-mdc-dialog-button-default"] = !0), O === "action" && (m["data-mdc-dialog-initial-focus"] = !0), m;
|
|
868
|
+
}, [t?.props.elevation, t?.props.variant, h, O]), mt = J(() => () => {
|
|
869
869
|
const m = {
|
|
870
870
|
className: "lmnt-modal__button mdc-dialog__button",
|
|
871
871
|
"data-mdc-dialog-action": X ? "" : "accept",
|
|
872
872
|
elevation: c?.props.elevation !== "default" ? c?.props.elevation : "flat",
|
|
873
873
|
variant: c?.props.variant || "filled"
|
|
874
874
|
};
|
|
875
|
-
return
|
|
876
|
-
}, [X,
|
|
875
|
+
return h === "primary" && (m["data-mdc-dialog-button-default"] = !0), O === "primary" && (m["data-mdc-dialog-initial-focus"] = !0), m;
|
|
876
|
+
}, [X, h, O, c?.props.elevation, c?.props.variant]);
|
|
877
877
|
return /* @__PURE__ */ d.createElement("aside", ht({
|
|
878
878
|
ref: N,
|
|
879
|
-
className: B("lmnt", "lmnt-modal", "mdc-dialog", Z && "lmnt-modal--scrollable mdc-dialog--scrollable",
|
|
879
|
+
className: B("lmnt", "lmnt-modal", "mdc-dialog", Z && "lmnt-modal--scrollable mdc-dialog--scrollable", p),
|
|
880
880
|
role: "alertdialog"
|
|
881
881
|
}, lt), /* @__PURE__ */ d.createElement("div", {
|
|
882
|
-
className: B("lmnt-modal__container", "mdc-dialog__container", _ === "fullscreen" && "mdc-dialog--fullscreen", _ === "max" && "lmnt-modal__max", _ === "xlarge" && "lmnt-modal__xl", _ === "large" && "lmnt-modal__lg", _ === "medium" && "lmnt-modal__md", _ === "small" && "lmnt-modal__sm", (_ === "mobile" ||
|
|
882
|
+
className: B("lmnt-modal__container", "mdc-dialog__container", _ === "fullscreen" && "mdc-dialog--fullscreen", _ === "max" && "lmnt-modal__max", _ === "xlarge" && "lmnt-modal__xl", _ === "large" && "lmnt-modal__lg", _ === "medium" && "lmnt-modal__md", _ === "small" && "lmnt-modal__sm", (_ === "mobile" || V) && "lmnt-modal__mobile", _ === "dialog" && "lmnt-modal__dialog", A && "lmnt-modal-no-actions")
|
|
883
883
|
}, /* @__PURE__ */ d.createElement("div", {
|
|
884
884
|
className: "lmnt-modal__surface mdc-dialog__surface"
|
|
885
885
|
}, /* @__PURE__ */ d.createElement("header", {
|
|
886
|
-
className: B("lmnt-modal__title", "mdc-dialog__title", (_ === "dialog" ||
|
|
887
|
-
}, !
|
|
886
|
+
className: B("lmnt-modal__title", "mdc-dialog__title", (_ === "dialog" || P) && "lmnt-modal_title-hide-close-icon", n && "lmnt-modal_title-actionsIcons", Z && "lmnt-modal__title-scrollable", (P || _ === "dialog" || A) && "lmnt-modal--no-close-icon")
|
|
887
|
+
}, !P && _ !== "dialog" && !A && /* @__PURE__ */ d.createElement(it, {
|
|
888
888
|
className: "mdc-icon-button material-icons mdc-dialog__close",
|
|
889
889
|
"data-mdc-dialog-action": "close",
|
|
890
890
|
icon: "clear"
|
|
891
|
-
}), tt && /* @__PURE__ */ d.createElement("div", null, tt),
|
|
891
|
+
}), tt && /* @__PURE__ */ d.createElement("div", null, tt), H && /* @__PURE__ */ d.createElement("div", {
|
|
892
892
|
className: "lmnt-dialog__title-actions"
|
|
893
|
-
},
|
|
893
|
+
}, H), o && /* @__PURE__ */ d.createElement("div", {
|
|
894
894
|
className: "lmnt-badge--modal",
|
|
895
895
|
style: {
|
|
896
896
|
marginLeft: "0"
|
|
897
897
|
}
|
|
898
|
-
}, o)), (
|
|
898
|
+
}, o)), (v || f) && /* @__PURE__ */ d.createElement("section", {
|
|
899
899
|
className: "lmnt-modal__content mdc-dialog__content"
|
|
900
|
-
},
|
|
901
|
-
className: B("lmnt-modal__actions", "mdc-dialog__actions",
|
|
902
|
-
}, !
|
|
900
|
+
}, v || f), st, (t || a || S || T || c || g) && /* @__PURE__ */ d.createElement("footer", {
|
|
901
|
+
className: B("lmnt-modal__actions", "mdc-dialog__actions", V && "lmnt-dialog__actions__mobile", g && "lmnt-modal__actions--supplemental-btn", V && U && "lmnt-modal_actions-mobile-stacked")
|
|
902
|
+
}, !z && g && /* @__PURE__ */ d.createElement("div", {
|
|
903
903
|
className: "lmnt-dialog__actions__supplemental"
|
|
904
|
-
}, b(
|
|
904
|
+
}, b(g, () => {
|
|
905
905
|
const m = {};
|
|
906
|
-
return
|
|
907
|
-
})), !
|
|
906
|
+
return h === "footerSupplemental" && (m["data-mdc-dialog-button-default"] = !0), O === "footerSupplemental" && (m["data-mdc-dialog-initial-focus"] = !0), m;
|
|
907
|
+
})), !z && (t || S || c) && /* @__PURE__ */ d.createElement("div", {
|
|
908
908
|
className: "lmnt-dialog__actions__right-align lmnt-modal_actions_button"
|
|
909
|
-
},
|
|
909
|
+
}, S && b(S, {
|
|
910
910
|
variant: "text",
|
|
911
911
|
className: "lmnt-modal__button mdc-dialog__button",
|
|
912
912
|
"data-mdc-dialog-action": "close"
|
|
913
|
-
}), t && !c && b(t, ut), c && b(c, mt)),
|
|
913
|
+
}), t && !c && b(t, ut), c && b(c, mt)), z && /* @__PURE__ */ d.createElement("div", {
|
|
914
914
|
className: "lmnt-modal_actions_button lmnt-dialog__actions__directional"
|
|
915
915
|
}, /* @__PURE__ */ d.createElement("div", null, St(a, "lmnt-modal__button")), /* @__PURE__ */ d.createElement("div", null, b(T, {
|
|
916
916
|
className: "lmnt-modal__button",
|
|
@@ -931,18 +931,19 @@ const Gt = "_modal_fr8bw_1", Kt = "_title_fr8bw_6", Wt = "_titleWithoutCloseIcon
|
|
|
931
931
|
onClose: i,
|
|
932
932
|
title: e,
|
|
933
933
|
headerActions: t,
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
934
|
+
actionButton: n,
|
|
935
|
+
hideCloseIcon: o,
|
|
936
|
+
leadingIcon: a,
|
|
937
|
+
isOnline: f = !0,
|
|
938
|
+
offlineViewProps: p,
|
|
939
|
+
children: v,
|
|
940
|
+
...h
|
|
940
941
|
}) => {
|
|
941
|
-
const
|
|
942
|
-
const
|
|
942
|
+
const S = J(() => {
|
|
943
|
+
const g = {
|
|
943
944
|
id: "base",
|
|
944
|
-
action: /* @__PURE__ */ ft(
|
|
945
|
-
!
|
|
945
|
+
action: /* @__PURE__ */ ft(j, { primaryAlign: "center", secondaryAlign: "center", children: [
|
|
946
|
+
!o && /* @__PURE__ */ C(
|
|
946
947
|
it,
|
|
947
948
|
{
|
|
948
949
|
icon: "close",
|
|
@@ -951,29 +952,30 @@ const Gt = "_modal_fr8bw_1", Kt = "_title_fr8bw_6", Wt = "_titleWithoutCloseIcon
|
|
|
951
952
|
className: w.closeButton
|
|
952
953
|
}
|
|
953
954
|
),
|
|
954
|
-
|
|
955
|
+
a ? /* @__PURE__ */ C(It, { customPadding: "0.25rem 0 0 0.75rem", children: /* @__PURE__ */ C(Lt, { icon: a }) }) : /* @__PURE__ */ C(pt, {}),
|
|
955
956
|
/* @__PURE__ */ C(
|
|
956
957
|
Nt,
|
|
957
958
|
{
|
|
958
959
|
level: 6,
|
|
959
|
-
className:
|
|
960
|
+
className: o && !a ? w.titleWithoutCloseIcon : "",
|
|
960
961
|
children: e
|
|
961
962
|
}
|
|
962
963
|
)
|
|
963
964
|
] }, "base-group")
|
|
964
965
|
};
|
|
965
|
-
return t ? Array.isArray(t) ? [
|
|
966
|
-
}, [t,
|
|
966
|
+
return t ? Array.isArray(t) ? [g, { id: "action-group", action: /* @__PURE__ */ C(j, { children: t }, "action-group") }] : [g, { id: "action", action: t }] : [g];
|
|
967
|
+
}, [t, o, a, i, e]);
|
|
967
968
|
return /* @__PURE__ */ C(
|
|
968
969
|
k,
|
|
969
970
|
{
|
|
970
|
-
...
|
|
971
|
+
...h,
|
|
971
972
|
"data-testid": "modal",
|
|
972
|
-
className: `${w.modal} ${w.title} ${
|
|
973
|
+
className: `${w.modal} ${w.title} ${h.className ?? ""}`,
|
|
973
974
|
hideCloseIcon: !0,
|
|
974
|
-
|
|
975
|
+
actionButton: n,
|
|
976
|
+
headerActions: /* @__PURE__ */ C(j, { primaryAlign: "space-between", secondaryAlign: "center", children: S.map((g) => /* @__PURE__ */ C(Et, { children: g.action }, g.id)) }, "header-group"),
|
|
975
977
|
preventClose: !0,
|
|
976
|
-
children:
|
|
978
|
+
children: f ? v : /* @__PURE__ */ C(Ft, { ...p })
|
|
977
979
|
}
|
|
978
980
|
);
|
|
979
981
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { P as r } from "../../index.es-
|
|
3
|
-
import "../../isEmpty-
|
|
2
|
+
import { P as r } from "../../index.es-DFFyENnI.js";
|
|
3
|
+
import "../../isEmpty-SkzPhavO.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { u as m } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
6
6
|
import "../../react-tooltip.min-DSY6KDqS.js";
|
|
7
|
-
import "../../orderBy-
|
|
8
|
-
import "../../uniqueId-
|
|
7
|
+
import "../../orderBy-D4LvP9Az.js";
|
|
8
|
+
import "../../uniqueId-DrPMzA-E.js";
|
|
9
9
|
import "react-hook-form";
|
|
10
|
-
import "../../get-
|
|
11
|
-
import "../../omit-
|
|
12
|
-
import "../../isArray-
|
|
13
|
-
import "../../isString-
|
|
10
|
+
import "../../get-CqneoueQ.js";
|
|
11
|
+
import "../../omit-BN3qeeaj.js";
|
|
12
|
+
import "../../isArray-CSaAxHlq.js";
|
|
13
|
+
import "../../isString-CZsZiWgW.js";
|
|
14
14
|
import "../../types/Time.js";
|
|
15
15
|
const j = ({ children: o }) => {
|
|
16
16
|
const { isDesktop: t } = m();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "../../index.es-
|
|
2
|
+
import "../../index.es-Dw1eih7R.js";
|
|
3
3
|
import "../Iconify/Iconify.js";
|
|
4
|
-
import "../../index.es
|
|
5
|
-
import { O as f } from "../../OfflineView-
|
|
6
|
-
import "../../index.es-
|
|
4
|
+
import "../../index.es-1zrFd4Te.js";
|
|
5
|
+
import { O as f } from "../../OfflineView-Bw-sbsym.js";
|
|
6
|
+
import "../../index.es-DmsyeHLO.js";
|
|
7
7
|
export {
|
|
8
8
|
f as OfflineView
|
|
9
9
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { a as n, s as t, f as u } from "../../react.esm-CX1WJ2Pp.js";
|
|
3
|
-
import { s as r, O as i } from "../../OfflineView-
|
|
3
|
+
import { s as r, O as i } from "../../OfflineView-Bw-sbsym.js";
|
|
4
4
|
import { d as B, t as l, g as e, a as c } from "../../vi.CjhMlMwf-CKxPQtd6.js";
|
|
5
5
|
B("OfflineView", () => {
|
|
6
6
|
l("should render OfflineView with title and subtitle", () => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as o, jsxs as r } from "react/jsx-runtime";
|
|
2
|
-
import { G as a } from "../../index.es-
|
|
3
|
-
import { I as m } from "../../index.es-
|
|
4
|
-
import { B as b } from "../../index.es-
|
|
5
|
-
import { b as h, T as u } from "../../index.es
|
|
6
|
-
import { E as g } from "../../index.es-
|
|
7
|
-
import { G as f, a as v, b as i } from "../../index.es-
|
|
8
|
-
import { I as y } from "../../index.es-
|
|
2
|
+
import { G as a } from "../../index.es-Dw1eih7R.js";
|
|
3
|
+
import { I as m } from "../../index.es-xnSvM9b9.js";
|
|
4
|
+
import { B as b } from "../../index.es-DmsyeHLO.js";
|
|
5
|
+
import { b as h, T as u } from "../../index.es-1zrFd4Te.js";
|
|
6
|
+
import { E as g } from "../../index.es-qxTN-Bb2.js";
|
|
7
|
+
import { G as f, a as v, b as i } from "../../index.es-DgTJmbgD.js";
|
|
8
|
+
import { I as y } from "../../index.es-8MVlRCi4.js";
|
|
9
9
|
import { u as C } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
10
10
|
import '../../assets/OnboardingBanner.css';const G = "_elevation_5dfyt_1", k = {
|
|
11
11
|
elevation: G
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as c, Fragment as m, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { T as p } from "../../index.es
|
|
2
|
+
import { T as p } from "../../index.es-1zrFd4Te.js";
|
|
3
3
|
import { useState as d, useMemo as h, cloneElement as f } from "react";
|
|
4
4
|
import { M as w } from "../../react-tooltip.min-DSY6KDqS.js";
|
|
5
5
|
import { hasChildWithGreaterWidth as W } from "./OverflowTooltipService.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { b as n } from "../../index.es
|
|
2
|
+
import { b as n } from "../../index.es-1zrFd4Te.js";
|
|
3
3
|
import { a as i, s as e, w as s } from "../../react.esm-CX1WJ2Pp.js";
|
|
4
4
|
import { u as a } from "../../index-I7uTh4Tr.js";
|
|
5
5
|
import { OverflowTooltip as c } from "./OverflowTooltip.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A form component that prevents accidental submission when pressing Enter in input fields.
|
|
3
|
+
* It handles the 'keydown' event and intercepts the Enter key press.
|
|
4
|
+
* If the focused element is a button, submit button or text area, it allows the default behavior.
|
|
5
|
+
* Otherwise, it prevents the default action to avoid unintended submissions.
|
|
6
|
+
*
|
|
7
|
+
* @param children - The form children elements.
|
|
8
|
+
* @param props - Additional form props.
|
|
9
|
+
* @returns JSX.Element
|
|
10
|
+
*/
|
|
11
|
+
export declare const SafeForm: ({ children, ...props }: JSX.IntrinsicElements["form"]) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
const a = ({ children: t, ...r }) => /* @__PURE__ */ e("form", { onKeyDown: n, ...r, children: t }), n = async (t) => {
|
|
3
|
+
if (t.key !== "Enter") return;
|
|
4
|
+
const r = t.target;
|
|
5
|
+
r?.type !== "submit" && r?.type !== "button" && r?.type !== "textarea" && (t.preventDefault(), t.stopPropagation());
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
a as SafeForm
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { a as u, s as i, f as r } from "../../react.esm-CX1WJ2Pp.js";
|
|
3
|
+
import { u as y } from "../../index-I7uTh4Tr.js";
|
|
4
|
+
import { SafeForm as p } from "./SafeForm.js";
|
|
5
|
+
import { d as b, t as c, g as s, v as l } from "../../vi.CjhMlMwf-CKxPQtd6.js";
|
|
6
|
+
b("SafeForm", () => {
|
|
7
|
+
c("renders form with children", () => {
|
|
8
|
+
u(
|
|
9
|
+
/* @__PURE__ */ a(p, { children: [
|
|
10
|
+
/* @__PURE__ */ t("input", { "data-testid": "test-input", type: "text" }),
|
|
11
|
+
/* @__PURE__ */ t("button", { "data-testid": "submit-button", type: "submit", children: "Submit" })
|
|
12
|
+
] })
|
|
13
|
+
), s(i.getByTestId("test-input")).toBeInTheDocument(), s(i.getByTestId("submit-button")).toBeInTheDocument();
|
|
14
|
+
}), c("prevents Enter key default behavior on text inputs", async () => {
|
|
15
|
+
const e = y.setup();
|
|
16
|
+
u(
|
|
17
|
+
/* @__PURE__ */ a(p, { children: [
|
|
18
|
+
/* @__PURE__ */ t("input", { "data-testid": "text-input", type: "text" }),
|
|
19
|
+
/* @__PURE__ */ t("button", { "data-testid": "submit-button", type: "submit", children: "Submit" })
|
|
20
|
+
] })
|
|
21
|
+
);
|
|
22
|
+
const n = i.getByTestId("text-input");
|
|
23
|
+
await e.click(n);
|
|
24
|
+
const o = r.keyDown(n, { key: "Enter" });
|
|
25
|
+
s(o).toBe(!1);
|
|
26
|
+
}), c("allows Enter key press on submit button (does not prevent default)", async () => {
|
|
27
|
+
u(
|
|
28
|
+
/* @__PURE__ */ a(p, { children: [
|
|
29
|
+
/* @__PURE__ */ t("input", { type: "text" }),
|
|
30
|
+
/* @__PURE__ */ t("button", { "data-testid": "submit-button", type: "submit", children: "Submit" })
|
|
31
|
+
] })
|
|
32
|
+
);
|
|
33
|
+
const e = i.getByTestId("submit-button");
|
|
34
|
+
e.focus();
|
|
35
|
+
const n = r.keyDown(e, { key: "Enter" });
|
|
36
|
+
s(n).toBe(!0);
|
|
37
|
+
}), c("allows Enter key press on regular button (does not prevent default)", async () => {
|
|
38
|
+
const e = l.fn();
|
|
39
|
+
u(
|
|
40
|
+
/* @__PURE__ */ a(p, { children: [
|
|
41
|
+
/* @__PURE__ */ t("input", { type: "text" }),
|
|
42
|
+
/* @__PURE__ */ t("button", { "data-testid": "cancel-button", type: "button", onClick: e, children: "Cancel" })
|
|
43
|
+
] })
|
|
44
|
+
);
|
|
45
|
+
const n = i.getByTestId("cancel-button");
|
|
46
|
+
n.focus();
|
|
47
|
+
const o = r.keyDown(n, { key: "Enter" });
|
|
48
|
+
s(o).toBe(!0);
|
|
49
|
+
}), c("allows Enter key press on textarea (does not prevent default)", async () => {
|
|
50
|
+
u(
|
|
51
|
+
/* @__PURE__ */ a(p, { children: [
|
|
52
|
+
/* @__PURE__ */ t("input", { type: "text" }),
|
|
53
|
+
/* @__PURE__ */ t("textarea", { "data-testid": "textarea" }),
|
|
54
|
+
/* @__PURE__ */ t("button", { type: "submit", children: "Submit" })
|
|
55
|
+
] })
|
|
56
|
+
);
|
|
57
|
+
const e = i.getByTestId("textarea");
|
|
58
|
+
e.focus();
|
|
59
|
+
const n = r.keyDown(e, { key: "Enter" });
|
|
60
|
+
s(n).toBe(!0);
|
|
61
|
+
}), c("does not interfere with other key presses", async () => {
|
|
62
|
+
const e = y.setup();
|
|
63
|
+
u(
|
|
64
|
+
/* @__PURE__ */ a(p, { children: [
|
|
65
|
+
/* @__PURE__ */ t("input", { "data-testid": "text-input", type: "text" }),
|
|
66
|
+
/* @__PURE__ */ t("button", { type: "submit", children: "Submit" })
|
|
67
|
+
] })
|
|
68
|
+
);
|
|
69
|
+
const n = i.getByTestId("text-input");
|
|
70
|
+
await e.click(n), await e.keyboard("a"), await e.keyboard("{Tab}"), await e.keyboard("{Escape}"), s(n).toHaveValue("a");
|
|
71
|
+
const o = r.keyDown(n, { key: "Tab" }), d = r.keyDown(n, { key: "Escape" });
|
|
72
|
+
s(o).toBe(!0), s(d).toBe(!0);
|
|
73
|
+
}), c("prevents Enter key on various input types", async () => {
|
|
74
|
+
u(
|
|
75
|
+
/* @__PURE__ */ a(p, { children: [
|
|
76
|
+
/* @__PURE__ */ t("input", { "data-testid": "input1", type: "text" }),
|
|
77
|
+
/* @__PURE__ */ t("input", { "data-testid": "input2", type: "email" }),
|
|
78
|
+
/* @__PURE__ */ t("input", { "data-testid": "input3", type: "password" }),
|
|
79
|
+
/* @__PURE__ */ t("input", { "data-testid": "input4", type: "number" }),
|
|
80
|
+
/* @__PURE__ */ t("button", { type: "submit", children: "Submit" })
|
|
81
|
+
] })
|
|
82
|
+
);
|
|
83
|
+
const e = ["input1", "input2", "input3", "input4"];
|
|
84
|
+
for (const n of e) {
|
|
85
|
+
const o = i.getByTestId(n);
|
|
86
|
+
o.focus();
|
|
87
|
+
const d = r.keyDown(o, { key: "Enter" });
|
|
88
|
+
s(d).toBe(!1);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
});
|