@hortiview/shared-components 2.3.0 → 2.5.0
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 +24 -0
- package/README.md +11 -0
- package/dist/{AlertBanner-75jjene1.js → AlertBanner-JnX0tJGC.js} +9 -9
- package/dist/{BigLoadingSpinner-BbXMCKpm.js → BigLoadingSpinner-chQoiNY9.js} +1 -1
- package/dist/{GenericCard-BFYKwkzI.js → GenericCard-c9yuyN3m.js} +3 -3
- package/dist/ListAreaService-BY6ZTds9.js +124 -0
- package/dist/OfflineView-HbuDPpQL.js +48 -0
- package/dist/{_MapCache-B75yWNNd.js → _MapCache-B75dXJyg.js} +2 -2
- package/dist/_baseIsEqual-CZNn3LMM.js +241 -0
- package/dist/_getAllKeys-tc1bcd1W.js +86 -0
- package/dist/{_getTag-BCf9b56Z.js → _getTag-DYHrLaIw.js} +2 -2
- package/dist/_setToString-Do1lSQTZ.js +2034 -0
- package/dist/assets/ContextMenu.css +1 -1
- package/dist/assets/ListAreaService.css +1 -1
- package/dist/assets/OfflineView.css +1 -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.d.ts +14 -1
- package/dist/components/BaseView/BaseView.js +47 -41
- package/dist/components/BaseView/BaseView.test.js +51 -34
- 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 +4 -4
- package/dist/components/ContextMenu/ContextMenu.d.ts +12 -1
- package/dist/components/ContextMenu/ContextMenu.js +40 -36
- package/dist/components/ContextMenu/ContextMenu.test.js +42 -19
- package/dist/components/DeleteModal/DeleteModal.d.ts +13 -1
- package/dist/components/DeleteModal/DeleteModal.js +53 -49
- package/dist/components/DeleteModal/DeleteModal.test.js +35 -11
- 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 +17 -16
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +1 -1
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +4 -4
- package/dist/components/FormComponents/FormNumber/CustomTextField.js +13 -12
- package/dist/components/FormComponents/FormRadio/FormRadio.js +1 -1
- package/dist/components/FormComponents/FormSelect/FormSelect.js +1 -1
- 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 +3 -3
- package/dist/components/GenericTable/GenericTable.d.ts +3 -1
- package/dist/components/GenericTable/GenericTable.js +2013 -2030
- package/dist/components/GenericTable/GenericTable.test.js +36 -6
- 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 +36 -35
- package/dist/components/ListArea/ListArea.test.js +14 -9
- package/dist/components/ListArea/ListAreaService.js +9 -7
- 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 +6 -1
- package/dist/components/Modal/Modal.js +134 -118
- package/dist/components/ModulePadding/ModulePadding.js +9 -8
- package/dist/components/OfflineView/OfflineView.d.ts +68 -0
- package/dist/components/OfflineView/OfflineView.js +9 -0
- package/dist/components/OfflineView/OfflineView.test.d.ts +1 -0
- package/dist/components/OfflineView/OfflineView.test.js +24 -0
- 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/SearchBar/SearchBar.js +2 -2
- package/dist/components/Select/Select.js +1 -1
- 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-DFv1gXfq.js → get-B8c-T4F8.js} +1 -1
- package/dist/{get-7ACccM2X.js → get-C7KpEkVs.js} +1 -1
- package/dist/hooks/useHelperText.js +1 -1
- package/dist/{index.es-D54RuMc_.js → index.es--yyG47az.js} +2 -2
- package/dist/{index.es-DKDgy7Kt.js → index.es-6c1Xbl0N.js} +1 -1
- package/dist/{index.es-BWgXLqXn.js → index.es-BTc2I5pe.js} +2 -2
- package/dist/{index.es-BtjV0oNv.js → index.es-Bf149BSP.js} +4 -4
- package/dist/{index.es-CoFul5zR.js → index.es-BoWmBoqO.js} +8 -8
- package/dist/{index.es-CiqbARoC.js → index.es-Bx1E5MPK.js} +4 -4
- package/dist/{index.es-fnFnw2P1.js → index.es-CPqaUyn3.js} +10 -10
- package/dist/{index.es-25EARqhH.js → index.es-CUuzYysw.js} +4 -4
- package/dist/{index.es-DntoATwO.js → index.es-CbBdaRO2.js} +2 -2
- package/dist/{index.es-8GOVkuo-.js → index.es-CqgVUhln.js} +3 -3
- package/dist/{index.es-BNHI3ZIK.js → index.es-CzUKBF7E.js} +10 -10
- package/dist/{index.es-D-CKRzIB.js → index.es-D-ph6ImM.js} +1 -1
- package/dist/{index.es-6TJ1S8Jr.js → index.es-DDo_AHL0.js} +7 -7
- package/dist/{index.es-3043KTnb.js → index.es-DErA6zWG.js} +2 -2
- package/dist/{index.es-h2lMdt7G.js → index.es-DF11ERDs.js} +2 -2
- package/dist/{index.es-B-_jXDuz.js → index.es-DMGNht46.js} +1 -1
- package/dist/{index.es-Dvj_qpAp.js → index.es-DOX4XTz_.js} +2 -2
- package/dist/index.es-DlzwTKbh.js +311 -0
- package/dist/{index.es-CL_Heu1n.js → index.es-DxDU9C_B.js} +1 -1
- package/dist/{index.es-0lQcz8m1.js → index.es-Kg9soDed.js} +3 -3
- package/dist/{index.es-41ztjcFT.js → index.es-U5-b20Gv.js} +4 -4
- package/dist/{index.es-BvrQnJ3j.js → index.es-oOD85ZwA.js} +4 -4
- package/dist/{index.es-D6N-XWHe.js → index.es-zQBuWUgU.js} +2 -2
- package/dist/{isEmpty-B4GG2s-V.js → isEmpty-DsdC9UUD.js} +2 -2
- package/dist/main.d.ts +1 -0
- package/dist/main.js +66 -64
- package/dist/omit-1Eom1PmQ.js +366 -0
- package/dist/{orderBy-Bd48bw88.js → orderBy-CyjsW2ET.js} +31 -30
- package/dist/types/GenericTable.d.ts +9 -0
- package/dist/types/ListElement.d.ts +23 -9
- package/package.json +1 -1
- package/dist/ListAreaService-BVtuBN0K.js +0 -110
- package/dist/_baseIsEqual-D0Dsajdb.js +0 -317
- package/dist/identity-DLWZln-X.js +0 -1763
- package/dist/index.es-da0cf7oE.js +0 -569
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { jsxs as ft, jsx as
|
|
2
|
-
import { G as z } from "../../index.es-
|
|
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
|
|
6
|
-
import { i as
|
|
7
|
-
import { b as at, c as ot, d as
|
|
8
|
-
import { M as
|
|
9
|
-
import { M as
|
|
10
|
-
import { A as
|
|
11
|
-
import { P as
|
|
12
|
-
import { b as
|
|
13
|
-
import { Iconify as
|
|
1
|
+
import { jsxs as ft, jsx as C, Fragment as pt } from "react/jsx-runtime";
|
|
2
|
+
import { G as z } from "../../index.es-CbBdaRO2.js";
|
|
3
|
+
import { I as it } from "../../index.es-Kg9soDed.js";
|
|
4
|
+
import { _ as ht, c as B, P as s } from "../../_setToString-Do1lSQTZ.js";
|
|
5
|
+
import d, { forwardRef as gt, useRef as et, useImperativeHandle as _t, useState as nt, useEffect as E, useCallback as j, useMemo as Y, Fragment as Et } from "react";
|
|
6
|
+
import { i as Ct, c as b, a as St } from "../../index.es-DlzwTKbh.js";
|
|
7
|
+
import { b as at, c as ot, d as vt } from "../../tslib.es6-BDCynO9F.js";
|
|
8
|
+
import { M as yt, a as Ot } from "../../component-neHBNHRu.js";
|
|
9
|
+
import { M as Tt, c as At, m as bt } from "../../component-DsB0poTj.js";
|
|
10
|
+
import { A as Dt } from "../../animationframe-EMBh6XeO.js";
|
|
11
|
+
import { P as It } from "../../index.es-D-ph6ImM.js";
|
|
12
|
+
import { b as Nt } from "../../index.es--yyG47az.js";
|
|
13
|
+
import { Iconify as Lt } from "../Iconify/Iconify.js";
|
|
14
|
+
import { O as Ft } from "../../OfflineView-HbuDPpQL.js";
|
|
14
15
|
import '../../assets/Modal.css';/**
|
|
15
16
|
* @license
|
|
16
17
|
* Copyright 2016 Google Inc.
|
|
@@ -33,19 +34,19 @@ import '../../assets/Modal.css';/**
|
|
|
33
34
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
34
35
|
* THE SOFTWARE.
|
|
35
36
|
*/
|
|
36
|
-
function
|
|
37
|
+
function Rt(i, e, t) {
|
|
37
38
|
return e(i, { initialFocusEl: t });
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
+
function Bt(i) {
|
|
40
41
|
return i ? i.scrollHeight > i.offsetHeight : !1;
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
+
function wt(i) {
|
|
43
44
|
return i ? i.scrollTop === 0 : !1;
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
+
function Mt(i) {
|
|
46
47
|
return i ? Math.ceil(i.scrollHeight - i.scrollTop) === i.clientHeight : !1;
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
+
function kt(i) {
|
|
49
50
|
var e = /* @__PURE__ */ new Set();
|
|
50
51
|
return [].forEach.call(i, function(t) {
|
|
51
52
|
return e.add(t.offsetTop);
|
|
@@ -73,7 +74,7 @@ function wt(i) {
|
|
|
73
74
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
74
75
|
* THE SOFTWARE.
|
|
75
76
|
*/
|
|
76
|
-
var q = "mdc-dom-focus-sentinel",
|
|
77
|
+
var q = "mdc-dom-focus-sentinel", Ht = (
|
|
77
78
|
/** @class */
|
|
78
79
|
function() {
|
|
79
80
|
function i(e, t) {
|
|
@@ -105,8 +106,8 @@ var q = "mdc-dom-focus-sentinel", Mt = (
|
|
|
105
106
|
return t.filter(function(n) {
|
|
106
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(q) && !o, f = !1;
|
|
107
108
|
if (a) {
|
|
108
|
-
var
|
|
109
|
-
f =
|
|
109
|
+
var h = getComputedStyle(n);
|
|
110
|
+
f = h.display === "none" || h.visibility === "hidden";
|
|
110
111
|
}
|
|
111
112
|
return a && !f;
|
|
112
113
|
});
|
|
@@ -171,7 +172,7 @@ var r = {
|
|
|
171
172
|
// to prevent interactions with the content behind this scrim, and to capture
|
|
172
173
|
// scrim clicks.
|
|
173
174
|
SCRIM_HIDDEN: "mdc-dialog__scrim--hidden"
|
|
174
|
-
},
|
|
175
|
+
}, v = {
|
|
175
176
|
ACTION_ATTRIBUTE: "data-mdc-dialog-action",
|
|
176
177
|
BUTTON_DEFAULT_ATTRIBUTE: "data-mdc-dialog-button-default",
|
|
177
178
|
BUTTON_SELECTOR: ".mdc-dialog__button",
|
|
@@ -227,7 +228,7 @@ var rt = (
|
|
|
227
228
|
at(e, i);
|
|
228
229
|
function e(t) {
|
|
229
230
|
var n = i.call(this, ot(ot({}, e.defaultAdapter), t)) || this;
|
|
230
|
-
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 = v.CLOSE_ACTION, n.scrimClickAction = v.CLOSE_ACTION, n.autoStackButtons = !0, n.areButtonsStacked = !1, n.suppressDefaultPressSelector = v.SUPPRESS_DEFAULT_PRESS_SELECTOR, n.animFrame = new Dt(), n.contentScrollHandler = function() {
|
|
231
232
|
n.handleScrollEvent();
|
|
232
233
|
}, n.windowResizeHandler = function() {
|
|
233
234
|
n.layout();
|
|
@@ -243,7 +244,7 @@ var rt = (
|
|
|
243
244
|
configurable: !0
|
|
244
245
|
}), Object.defineProperty(e, "strings", {
|
|
245
246
|
get: function() {
|
|
246
|
-
return
|
|
247
|
+
return v;
|
|
247
248
|
},
|
|
248
249
|
enumerable: !1,
|
|
249
250
|
configurable: !0
|
|
@@ -319,7 +320,7 @@ var rt = (
|
|
|
319
320
|
}), e.prototype.init = function() {
|
|
320
321
|
this.adapter.hasClass(r.STACKED) && this.setAutoStackButtons(!1), this.isFullscreen = this.adapter.hasClass(r.FULLSCREEN);
|
|
321
322
|
}, e.prototype.destroy = function() {
|
|
322
|
-
this.dialogOpen && this.close(
|
|
323
|
+
this.dialogOpen && this.close(v.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);
|
|
323
324
|
}, e.prototype.open = function(t) {
|
|
324
325
|
var n = this;
|
|
325
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() {
|
|
@@ -365,7 +366,7 @@ var rt = (
|
|
|
365
366
|
t.layoutInternal();
|
|
366
367
|
});
|
|
367
368
|
}, e.prototype.handleClick = function(t) {
|
|
368
|
-
var n = this.adapter.eventTargetMatches(t.target,
|
|
369
|
+
var n = this.adapter.eventTargetMatches(t.target, v.SCRIM_SELECTOR);
|
|
369
370
|
if (n && this.scrimClickAction !== "")
|
|
370
371
|
this.close(this.scrimClickAction);
|
|
371
372
|
else {
|
|
@@ -409,7 +410,7 @@ var rt = (
|
|
|
409
410
|
}, e.prototype.toggleScrollDividerFooter = function() {
|
|
410
411
|
this.adapter.isScrollableContentAtBottom() ? this.adapter.hasClass(r.SCROLL_DIVIDER_FOOTER) && this.adapter.removeClass(r.SCROLL_DIVIDER_FOOTER) : this.adapter.addClass(r.SCROLL_DIVIDER_FOOTER);
|
|
411
412
|
}, e;
|
|
412
|
-
}(
|
|
413
|
+
}(yt)
|
|
413
414
|
);
|
|
414
415
|
/**
|
|
415
416
|
* @license
|
|
@@ -433,7 +434,7 @@ var rt = (
|
|
|
433
434
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
434
435
|
* THE SOFTWARE.
|
|
435
436
|
*/
|
|
436
|
-
var u = rt.strings,
|
|
437
|
+
var u = rt.strings, Pt = (
|
|
437
438
|
/** @class */
|
|
438
439
|
function(i) {
|
|
439
440
|
at(e, i);
|
|
@@ -477,30 +478,30 @@ var u = rt.strings, kt = (
|
|
|
477
478
|
return new e(t);
|
|
478
479
|
}, e.prototype.initialize = function(t) {
|
|
479
480
|
var n, o;
|
|
480
|
-
t === void 0 && (t = function(
|
|
481
|
-
return new
|
|
481
|
+
t === void 0 && (t = function(g, p) {
|
|
482
|
+
return new Ht(g, p);
|
|
482
483
|
});
|
|
483
484
|
var a = this.root.querySelector(u.CONTAINER_SELECTOR);
|
|
484
485
|
if (!a)
|
|
485
486
|
throw new Error("Dialog component requires a " + u.CONTAINER_SELECTOR + " container element");
|
|
486
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 = [];
|
|
487
488
|
try {
|
|
488
|
-
for (var f =
|
|
489
|
-
var
|
|
490
|
-
this.buttonRipples.push(new
|
|
489
|
+
for (var f = vt(this.buttons), h = f.next(); !h.done; h = f.next()) {
|
|
490
|
+
var S = h.value;
|
|
491
|
+
this.buttonRipples.push(new Tt(S));
|
|
491
492
|
}
|
|
492
|
-
} catch (
|
|
493
|
-
n = { error:
|
|
493
|
+
} catch (g) {
|
|
494
|
+
n = { error: g };
|
|
494
495
|
} finally {
|
|
495
496
|
try {
|
|
496
|
-
|
|
497
|
+
h && !h.done && (o = f.return) && o.call(f);
|
|
497
498
|
} finally {
|
|
498
499
|
if (n) throw n.error;
|
|
499
500
|
}
|
|
500
501
|
}
|
|
501
502
|
}, e.prototype.initialSyncWithDOM = function() {
|
|
502
503
|
var t = this;
|
|
503
|
-
this.focusTrap =
|
|
504
|
+
this.focusTrap = Rt(this.container, this.focusTrapFactory, this.getInitialFocusEl() || void 0), this.handleClick = this.foundation.handleClick.bind(this.foundation), this.handleKeydown = this.foundation.handleKeydown.bind(this.foundation), this.handleDocumentKeydown = this.foundation.handleDocumentKeydown.bind(this.foundation), this.handleOpening = function() {
|
|
504
505
|
document.addEventListener("keydown", t.handleDocumentKeydown);
|
|
505
506
|
}, this.handleClosing = function() {
|
|
506
507
|
document.removeEventListener("keydown", t.handleDocumentKeydown);
|
|
@@ -524,18 +525,18 @@ var u = rt.strings, kt = (
|
|
|
524
525
|
return t.root.classList.add(o);
|
|
525
526
|
},
|
|
526
527
|
areButtonsStacked: function() {
|
|
527
|
-
return
|
|
528
|
+
return kt(t.buttons);
|
|
528
529
|
},
|
|
529
530
|
clickDefaultButton: function() {
|
|
530
531
|
t.defaultButton && t.defaultButton.click();
|
|
531
532
|
},
|
|
532
533
|
eventTargetMatches: function(o, a) {
|
|
533
|
-
return o ?
|
|
534
|
+
return o ? bt(o, a) : !1;
|
|
534
535
|
},
|
|
535
536
|
getActionFromEvent: function(o) {
|
|
536
537
|
if (!o.target)
|
|
537
538
|
return "";
|
|
538
|
-
var a =
|
|
539
|
+
var a = At(o.target, "[" + u.ACTION_ATTRIBUTE + "]");
|
|
539
540
|
return a && a.getAttribute(u.ACTION_ATTRIBUTE);
|
|
540
541
|
},
|
|
541
542
|
getInitialFocusEl: function() {
|
|
@@ -545,7 +546,7 @@ var u = rt.strings, kt = (
|
|
|
545
546
|
return t.root.classList.contains(o);
|
|
546
547
|
},
|
|
547
548
|
isContentScrollable: function() {
|
|
548
|
-
return
|
|
549
|
+
return Bt(t.content);
|
|
549
550
|
},
|
|
550
551
|
notifyClosed: function(o) {
|
|
551
552
|
return t.emit(u.CLOSED_EVENT, o ? { action: o } : {});
|
|
@@ -583,10 +584,10 @@ var u = rt.strings, kt = (
|
|
|
583
584
|
t.content instanceof HTMLElement && t.content.removeEventListener(o, a);
|
|
584
585
|
},
|
|
585
586
|
isScrollableContentAtTop: function() {
|
|
586
|
-
return
|
|
587
|
+
return wt(t.content);
|
|
587
588
|
},
|
|
588
589
|
isScrollableContentAtBottom: function() {
|
|
589
|
-
return
|
|
590
|
+
return Mt(t.content);
|
|
590
591
|
},
|
|
591
592
|
registerWindowEventHandler: function(o, a) {
|
|
592
593
|
window.addEventListener(o, a);
|
|
@@ -599,9 +600,9 @@ var u = rt.strings, kt = (
|
|
|
599
600
|
}, e.prototype.getInitialFocusEl = function() {
|
|
600
601
|
return this.root.querySelector("[" + u.INITIAL_FOCUS_ATTRIBUTE + "]");
|
|
601
602
|
}, e;
|
|
602
|
-
}(
|
|
603
|
+
}(Ot)
|
|
603
604
|
);
|
|
604
|
-
const
|
|
605
|
+
const Ut = {
|
|
605
606
|
/**
|
|
606
607
|
* An action button that will not automatically trigger a dismiss or accept. It is meant to be used only in certain circumstances where more control of the modal is required such as validating forms. If primaryButton is sent with actionButton, actionButton will be ignored.
|
|
607
608
|
*
|
|
@@ -764,7 +765,7 @@ const Ht = {
|
|
|
764
765
|
* Defaults to **null**.
|
|
765
766
|
*/
|
|
766
767
|
title: s.string
|
|
767
|
-
},
|
|
768
|
+
}, xt = {
|
|
768
769
|
actionButton: null,
|
|
769
770
|
backButton: null,
|
|
770
771
|
badge: void 0,
|
|
@@ -795,19 +796,19 @@ const Ht = {
|
|
|
795
796
|
badge: o,
|
|
796
797
|
backButton: a,
|
|
797
798
|
children: f,
|
|
798
|
-
className:
|
|
799
|
-
content:
|
|
800
|
-
defaultButton:
|
|
801
|
-
dismissiveButton:
|
|
802
|
-
footerSupplemental:
|
|
799
|
+
className: h,
|
|
800
|
+
content: S,
|
|
801
|
+
defaultButton: g,
|
|
802
|
+
dismissiveButton: p,
|
|
803
|
+
footerSupplemental: y,
|
|
803
804
|
headerActions: J,
|
|
804
805
|
hideCloseIcon: H,
|
|
805
806
|
indicator: st,
|
|
806
|
-
initialFocus:
|
|
807
|
+
initialFocus: O,
|
|
807
808
|
mobileStackedButtons: P,
|
|
808
|
-
modalSize:
|
|
809
|
-
nextButton:
|
|
810
|
-
noActions:
|
|
809
|
+
modalSize: _,
|
|
810
|
+
nextButton: T,
|
|
811
|
+
noActions: A,
|
|
811
812
|
onClose: U,
|
|
812
813
|
onClosed: x,
|
|
813
814
|
onOpen: D,
|
|
@@ -822,39 +823,39 @@ const Ht = {
|
|
|
822
823
|
...lt
|
|
823
824
|
} = i, N = et(), l = et();
|
|
824
825
|
_t(e, () => N.current, []);
|
|
825
|
-
const [W, ct] = nt(), [V, dt] = nt(() =>
|
|
826
|
-
|
|
827
|
-
dt(
|
|
828
|
-
}, [
|
|
826
|
+
const [W, ct] = nt(), [V, dt] = nt(() => T || a);
|
|
827
|
+
E(() => {
|
|
828
|
+
dt(T || a);
|
|
829
|
+
}, [T, a]);
|
|
829
830
|
const L = j(() => {
|
|
830
831
|
ct(window.innerWidth <= 600);
|
|
831
832
|
}, []);
|
|
832
|
-
|
|
833
|
+
E(() => (L(), window.addEventListener("resize", L), () => {
|
|
833
834
|
window.removeEventListener("resize", L);
|
|
834
|
-
}), [L]),
|
|
835
|
+
}), [L]), E(() => (l.current = Pt.attachTo(N.current), () => {
|
|
835
836
|
l.current.destroy();
|
|
836
|
-
}), [l, N]),
|
|
837
|
+
}), [l, N]), E(() => {
|
|
837
838
|
l.current.foundation.setAutoStackButtons(P);
|
|
838
|
-
}, [P]),
|
|
839
|
-
|
|
839
|
+
}, [P]), E(() => {
|
|
840
|
+
A && (l.current.foundation.adapter.trapFocus = () => {
|
|
840
841
|
});
|
|
841
|
-
}, [
|
|
842
|
+
}, [A]), E(() => {
|
|
842
843
|
l.current.scrimClickAction = G ? "" : "close", l.current.escapeKeyAction = G ? "" : "close";
|
|
843
844
|
}, [G]);
|
|
844
845
|
const F = j((m) => {
|
|
845
846
|
U && U(m);
|
|
846
847
|
}, [U]), R = j((m) => {
|
|
847
|
-
K &&
|
|
848
|
+
K && Ct(K), x && x(m);
|
|
848
849
|
}, [K, x]);
|
|
849
|
-
|
|
850
|
+
E(() => (l.current.unlisten("MDCDialog: opening", D), l.current.listen("MDCDialog: opening", D), () => {
|
|
850
851
|
l.current.unlisten("MDCDialog: opening", D);
|
|
851
|
-
}), [l, D]),
|
|
852
|
+
}), [l, D]), E(() => (l.current.unlisten("MDCDialog:opened", I), l.current.listen("MDCDialog:opened", I), () => {
|
|
852
853
|
l.current.unlisten("MDCDialog:opened", I);
|
|
853
|
-
}), [l, I]),
|
|
854
|
+
}), [l, I]), E(() => (l.current.unlisten("MDCDialog:closing", F), l.current.listen("MDCDialog:closing", F), () => {
|
|
854
855
|
l.current.unlisten("MDCDialog:closing", F);
|
|
855
|
-
}), [l, F]),
|
|
856
|
+
}), [l, F]), E(() => (l.current.unlisten("MDCDialog:closed", R), l.current.listen("MDCDialog:closed", R), () => {
|
|
856
857
|
l.current.unlisten("MDCDialog:closed", R);
|
|
857
|
-
}), [l, R]),
|
|
858
|
+
}), [l, R]), E(() => {
|
|
858
859
|
Q ? l.current.open() : l.current.close();
|
|
859
860
|
}, [l, Q]);
|
|
860
861
|
const ut = Y(() => () => {
|
|
@@ -863,27 +864,27 @@ const Ht = {
|
|
|
863
864
|
elevation: t?.props.elevation !== "default" ? t?.props.elevation : "flat",
|
|
864
865
|
variant: t?.props.variant || "filled"
|
|
865
866
|
};
|
|
866
|
-
return
|
|
867
|
-
}, [t?.props.elevation, t?.props.variant,
|
|
867
|
+
return g === "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, g, O]), mt = Y(() => () => {
|
|
868
869
|
const m = {
|
|
869
870
|
className: "lmnt-modal__button mdc-dialog__button",
|
|
870
871
|
"data-mdc-dialog-action": X ? "" : "accept",
|
|
871
872
|
elevation: c?.props.elevation !== "default" ? c?.props.elevation : "flat",
|
|
872
873
|
variant: c?.props.variant || "filled"
|
|
873
874
|
};
|
|
874
|
-
return
|
|
875
|
-
}, [X,
|
|
875
|
+
return g === "primary" && (m["data-mdc-dialog-button-default"] = !0), O === "primary" && (m["data-mdc-dialog-initial-focus"] = !0), m;
|
|
876
|
+
}, [X, g, O, c?.props.elevation, c?.props.variant]);
|
|
876
877
|
return /* @__PURE__ */ d.createElement("aside", ht({
|
|
877
878
|
ref: N,
|
|
878
|
-
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", h),
|
|
879
880
|
role: "alertdialog"
|
|
880
881
|
}, lt), /* @__PURE__ */ d.createElement("div", {
|
|
881
|
-
className: B("lmnt-modal__container", "mdc-dialog__container",
|
|
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" || W) && "lmnt-modal__mobile", _ === "dialog" && "lmnt-modal__dialog", A && "lmnt-modal-no-actions")
|
|
882
883
|
}, /* @__PURE__ */ d.createElement("div", {
|
|
883
884
|
className: "lmnt-modal__surface mdc-dialog__surface"
|
|
884
885
|
}, /* @__PURE__ */ d.createElement("header", {
|
|
885
|
-
className: B("lmnt-modal__title", "mdc-dialog__title", (
|
|
886
|
-
}, !H &&
|
|
886
|
+
className: B("lmnt-modal__title", "mdc-dialog__title", (_ === "dialog" || H) && "lmnt-modal_title-hide-close-icon", n && "lmnt-modal_title-actionsIcons", Z && "lmnt-modal__title-scrollable", (H || _ === "dialog" || A) && "lmnt-modal--no-close-icon")
|
|
887
|
+
}, !H && _ !== "dialog" && !A && /* @__PURE__ */ d.createElement(it, {
|
|
887
888
|
className: "mdc-icon-button material-icons mdc-dialog__close",
|
|
888
889
|
"data-mdc-dialog-action": "close",
|
|
889
890
|
icon: "clear"
|
|
@@ -894,24 +895,24 @@ const Ht = {
|
|
|
894
895
|
style: {
|
|
895
896
|
marginLeft: "0"
|
|
896
897
|
}
|
|
897
|
-
}, o)), (
|
|
898
|
+
}, o)), (S || f) && /* @__PURE__ */ d.createElement("section", {
|
|
898
899
|
className: "lmnt-modal__content mdc-dialog__content"
|
|
899
|
-
},
|
|
900
|
-
className: B("lmnt-modal__actions", "mdc-dialog__actions", W && "lmnt-dialog__actions__mobile",
|
|
901
|
-
}, !V &&
|
|
900
|
+
}, S || f), st, (t || a || p || T || c || y) && /* @__PURE__ */ d.createElement("footer", {
|
|
901
|
+
className: B("lmnt-modal__actions", "mdc-dialog__actions", W && "lmnt-dialog__actions__mobile", y && "lmnt-modal__actions--supplemental-btn", W && P && "lmnt-modal_actions-mobile-stacked")
|
|
902
|
+
}, !V && y && /* @__PURE__ */ d.createElement("div", {
|
|
902
903
|
className: "lmnt-dialog__actions__supplemental"
|
|
903
|
-
},
|
|
904
|
+
}, b(y, () => {
|
|
904
905
|
const m = {};
|
|
905
|
-
return
|
|
906
|
-
})), !V && (t ||
|
|
906
|
+
return g === "footerSupplemental" && (m["data-mdc-dialog-button-default"] = !0), O === "footerSupplemental" && (m["data-mdc-dialog-initial-focus"] = !0), m;
|
|
907
|
+
})), !V && (t || p || c) && /* @__PURE__ */ d.createElement("div", {
|
|
907
908
|
className: "lmnt-dialog__actions__right-align lmnt-modal_actions_button"
|
|
908
|
-
},
|
|
909
|
+
}, p && b(p, {
|
|
909
910
|
variant: "text",
|
|
910
911
|
className: "lmnt-modal__button mdc-dialog__button",
|
|
911
912
|
"data-mdc-dialog-action": "close"
|
|
912
|
-
}), t && !c &&
|
|
913
|
+
}), t && !c && b(t, ut), c && b(c, mt)), V && /* @__PURE__ */ d.createElement("div", {
|
|
913
914
|
className: "lmnt-modal_actions_button lmnt-dialog__actions__directional"
|
|
914
|
-
}, /* @__PURE__ */ d.createElement("div", null,
|
|
915
|
+
}, /* @__PURE__ */ d.createElement("div", null, St(a, "lmnt-modal__button")), /* @__PURE__ */ d.createElement("div", null, b(T, {
|
|
915
916
|
className: "lmnt-modal__button",
|
|
916
917
|
"data-mdc-dialog-initial-focus": !0
|
|
917
918
|
})))))), /* @__PURE__ */ d.createElement("div", {
|
|
@@ -919,48 +920,63 @@ const Ht = {
|
|
|
919
920
|
}));
|
|
920
921
|
});
|
|
921
922
|
k.displayName = "Modal";
|
|
922
|
-
k.propTypes =
|
|
923
|
-
k.defaultProps =
|
|
924
|
-
const
|
|
925
|
-
modal:
|
|
926
|
-
title:
|
|
927
|
-
titleWithoutCloseIcon:
|
|
928
|
-
closeButton:
|
|
929
|
-
},
|
|
923
|
+
k.propTypes = Ut;
|
|
924
|
+
k.defaultProps = xt;
|
|
925
|
+
const Gt = "_modal_fr8bw_1", Kt = "_title_fr8bw_6", Wt = "_titleWithoutCloseIcon_fr8bw_18", Vt = "_closeButton_fr8bw_22", w = {
|
|
926
|
+
modal: Gt,
|
|
927
|
+
title: Kt,
|
|
928
|
+
titleWithoutCloseIcon: Wt,
|
|
929
|
+
closeButton: Vt
|
|
930
|
+
}, ae = ({
|
|
930
931
|
onClose: i,
|
|
931
932
|
title: e,
|
|
932
933
|
headerActions: t,
|
|
933
934
|
hideCloseIcon: n,
|
|
934
935
|
leadingIcon: o,
|
|
935
|
-
|
|
936
|
+
isOnline: a = !0,
|
|
937
|
+
offlineViewProps: f,
|
|
938
|
+
children: h,
|
|
939
|
+
...S
|
|
936
940
|
}) => {
|
|
937
|
-
const
|
|
938
|
-
const p =
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
941
|
+
const g = Y(() => {
|
|
942
|
+
const p = {
|
|
943
|
+
id: "base",
|
|
944
|
+
action: /* @__PURE__ */ ft(z, { primaryAlign: "center", secondaryAlign: "center", children: [
|
|
945
|
+
!n && /* @__PURE__ */ C(
|
|
946
|
+
it,
|
|
947
|
+
{
|
|
948
|
+
icon: "close",
|
|
949
|
+
onClick: () => i?.(),
|
|
950
|
+
type: "button",
|
|
951
|
+
className: w.closeButton
|
|
952
|
+
}
|
|
953
|
+
),
|
|
954
|
+
o ? /* @__PURE__ */ C(It, { customPadding: "0.25rem 0 0 0.75rem", children: /* @__PURE__ */ C(Lt, { icon: o }) }) : /* @__PURE__ */ C(pt, {}),
|
|
955
|
+
/* @__PURE__ */ C(
|
|
956
|
+
Nt,
|
|
957
|
+
{
|
|
958
|
+
level: 6,
|
|
959
|
+
className: n && !o ? w.titleWithoutCloseIcon : "",
|
|
960
|
+
children: e
|
|
961
|
+
}
|
|
962
|
+
)
|
|
963
|
+
] }, "base-group")
|
|
964
|
+
};
|
|
965
|
+
return t ? Array.isArray(t) ? [p, { id: "action-group", action: /* @__PURE__ */ C(z, { children: t }, "action-group") }] : [p, { id: "action", action: t }] : [p];
|
|
951
966
|
}, [t, n, o, i, e]);
|
|
952
|
-
return /* @__PURE__ */
|
|
967
|
+
return /* @__PURE__ */ C(
|
|
953
968
|
k,
|
|
954
969
|
{
|
|
955
|
-
...
|
|
970
|
+
...S,
|
|
956
971
|
"data-testid": "modal",
|
|
957
|
-
className: `${w.modal} ${w.title} ${
|
|
972
|
+
className: `${w.modal} ${w.title} ${S.className ?? ""}`,
|
|
958
973
|
hideCloseIcon: !0,
|
|
959
|
-
headerActions: /* @__PURE__ */
|
|
960
|
-
preventClose: !0
|
|
974
|
+
headerActions: /* @__PURE__ */ C(z, { primaryAlign: "space-between", secondaryAlign: "center", children: g.map((p) => /* @__PURE__ */ C(Et, { children: p.action }, p.id)) }, "header-group"),
|
|
975
|
+
preventClose: !0,
|
|
976
|
+
children: a ? h : /* @__PURE__ */ C(Ft, { ...f })
|
|
961
977
|
}
|
|
962
978
|
);
|
|
963
979
|
};
|
|
964
980
|
export {
|
|
965
|
-
|
|
981
|
+
ae as Modal
|
|
966
982
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { P as r } from "../../index.es-D-
|
|
3
|
-
import "../../isEmpty-
|
|
2
|
+
import { P as r } from "../../index.es-D-ph6ImM.js";
|
|
3
|
+
import "../../isEmpty-DsdC9UUD.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { u as
|
|
5
|
+
import { u as m } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
6
6
|
import "../../react-tooltip.min-DSY6KDqS.js";
|
|
7
|
-
import "../../orderBy-
|
|
7
|
+
import "../../orderBy-CyjsW2ET.js";
|
|
8
8
|
import "../../uniqueId-NU3-C36A.js";
|
|
9
9
|
import "react-hook-form";
|
|
10
|
-
import "../../get-
|
|
10
|
+
import "../../get-B8c-T4F8.js";
|
|
11
|
+
import "../../omit-1Eom1PmQ.js";
|
|
11
12
|
import "../../isArray-Dub1wGJM.js";
|
|
12
13
|
import "../../isString-BW9UHONv.js";
|
|
13
|
-
const
|
|
14
|
-
const { isDesktop: t } =
|
|
14
|
+
const x = ({ children: o }) => {
|
|
15
|
+
const { isDesktop: t } = m();
|
|
15
16
|
return /* @__PURE__ */ i(
|
|
16
17
|
r,
|
|
17
18
|
{
|
|
@@ -23,5 +24,5 @@ const k = ({ children: o }) => {
|
|
|
23
24
|
);
|
|
24
25
|
};
|
|
25
26
|
export {
|
|
26
|
-
|
|
27
|
+
x as ModulePadding
|
|
27
28
|
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export type OfflineViewProps = {
|
|
2
|
+
/**
|
|
3
|
+
* The title of the offline view
|
|
4
|
+
*
|
|
5
|
+
* Defaults to **You’re currently offline**
|
|
6
|
+
*/
|
|
7
|
+
title?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The subtitle of the offline view, optional
|
|
10
|
+
*/
|
|
11
|
+
subtitle?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The Icon of the offline view
|
|
14
|
+
*
|
|
15
|
+
* Defaults to **cloud_off**.
|
|
16
|
+
*/
|
|
17
|
+
icon?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The offline view size
|
|
20
|
+
*
|
|
21
|
+
* Defaults to **large**
|
|
22
|
+
*/
|
|
23
|
+
size?: 'large' | 'small';
|
|
24
|
+
/**
|
|
25
|
+
* Visual variant
|
|
26
|
+
*
|
|
27
|
+
* Defaults to **basic**
|
|
28
|
+
*/
|
|
29
|
+
variant?: 'basic' | 'filled';
|
|
30
|
+
/**
|
|
31
|
+
* The button label. If provided, a button will be shown.
|
|
32
|
+
*/
|
|
33
|
+
buttonLabel?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Click handler for the button (used only if a button is rendered).
|
|
36
|
+
*/
|
|
37
|
+
onClick?: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* Optional test id pass-through.
|
|
40
|
+
*/
|
|
41
|
+
'data-testid'?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Optional CSS class for the root element
|
|
44
|
+
*/
|
|
45
|
+
className?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Stretch to the container’s full width.
|
|
48
|
+
*
|
|
49
|
+
* Defaults to **false**.
|
|
50
|
+
*/
|
|
51
|
+
fullWidth?: boolean;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Offline placeholder/view shown when no network connection is available.
|
|
55
|
+
*
|
|
56
|
+
* @param {string} title - The title of the offline view
|
|
57
|
+
* @param {string} subtitle - Optional subtitle
|
|
58
|
+
* @param {string} icon - The Icon of the offline view, default is cloud_off
|
|
59
|
+
* @param {'large' | 'small'} size - The offline view size, default is large
|
|
60
|
+
* @param {'basic' | 'filled'} variant - Visual variant, default is basic
|
|
61
|
+
* @param {string} buttonLabel - The button label, if defined, the button will be displayed
|
|
62
|
+
* @param {() => void} onClick - Event handler for the button
|
|
63
|
+
* @param {string} 'data-testid' - Optional test id passthrough
|
|
64
|
+
* @param {string} className - Optional CSS class for the root element
|
|
65
|
+
* @param {boolean} fullWidth - Stretch to the container’s full width.
|
|
66
|
+
* @returns {JSX.Element}
|
|
67
|
+
*/
|
|
68
|
+
export declare const OfflineView: ({ title, subtitle, icon, size, variant, "data-testid": dataTestId, buttonLabel, fullWidth, className, onClick, }: OfflineViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "../../index.es-CbBdaRO2.js";
|
|
3
|
+
import "../Iconify/Iconify.js";
|
|
4
|
+
import "../../index.es--yyG47az.js";
|
|
5
|
+
import { O as f } from "../../OfflineView-HbuDPpQL.js";
|
|
6
|
+
import "../../index.es-Bx1E5MPK.js";
|
|
7
|
+
export {
|
|
8
|
+
f as OfflineView
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
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-HbuDPpQL.js";
|
|
4
|
+
import { d as B, t as l, g as e, a as c } from "../../vi.CjhMlMwf-CKxPQtd6.js";
|
|
5
|
+
B("OfflineView", () => {
|
|
6
|
+
l("should render OfflineView with title and subtitle", () => {
|
|
7
|
+
n(/* @__PURE__ */ o(i, { title: "test-title", subtitle: "test-subtitle" })), e(t.getByTestId("offline-view-container")).toBeInTheDocument(), e(t.getByText("test-title")).toBeInTheDocument(), e(t.getByText("test-subtitle")).toBeInTheDocument(), e(t.queryByText("cloud_off")).toBeInTheDocument();
|
|
8
|
+
}), l("should render without subtitle", () => {
|
|
9
|
+
n(/* @__PURE__ */ o(i, { title: "test-title" })), e(t.getByTestId("offline-view-container")).toBeInTheDocument(), e(t.getByText("test-title")).toBeInTheDocument(), e(t.queryByText("test-subtitle")).not.toBeInTheDocument();
|
|
10
|
+
}), l("should render custom icon", () => {
|
|
11
|
+
n(/* @__PURE__ */ o(i, { title: "test-title", icon: "add" })), e(t.getByTestId("offline-view-container")).toBeInTheDocument(), e(t.getByText("test-title")).toBeInTheDocument(), e(t.getByText("add")).toBeInTheDocument();
|
|
12
|
+
}), l("should render the small offline view", () => {
|
|
13
|
+
n(/* @__PURE__ */ o(i, { title: "test-title", size: "small" })), e(t.getByText("test-title")).toHaveClass("mdc-typography--subtitle1");
|
|
14
|
+
}), l("should render the filled offline view", () => {
|
|
15
|
+
n(/* @__PURE__ */ o(i, { title: "test-title", variant: "filled", "data-testid": "test" })), e(t.getByTestId("test")).toHaveClass(r.bgGrey);
|
|
16
|
+
}), l("should render OfflineView with button", () => {
|
|
17
|
+
n(/* @__PURE__ */ o(i, { title: "test-title", buttonLabel: "Button" })), e(t.getByText("Button")).toBeInTheDocument(), e(t.getByRole("button")).toBeInTheDocument();
|
|
18
|
+
}), l("calls onClick when button is clicked", () => {
|
|
19
|
+
const s = c.fn();
|
|
20
|
+
n(/* @__PURE__ */ o(i, { title: "test-title", buttonLabel: "Button", onClick: s })), u.click(t.getByText("Button")), e(s).toHaveBeenCalled();
|
|
21
|
+
}), l("should render OfflineView without button", () => {
|
|
22
|
+
n(/* @__PURE__ */ o(i, { title: "test-title" })), e(t.queryByText("Button")).not.toBeInTheDocument(), e(t.queryByRole("button")).not.toBeInTheDocument();
|
|
23
|
+
});
|
|
24
|
+
});
|