@ed.yakovich/component-library 0.0.10 → 0.0.12
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/dist/components/InfoBanner/index.js +14 -15
- package/dist/lib/main.d.ts +0 -13
- package/dist/main.js +6 -32
- package/package.json +2 -5
- package/dist/components/Accordion/context/index.js +0 -7
- package/dist/components/Accordion/index.js +0 -38
- package/dist/components/Accordion/types/index.js +0 -1
- package/dist/components/Cart/index.js +0 -35
- package/dist/components/EquipmentSummary/context/index.js +0 -10
- package/dist/components/EquipmentSummary/index.js +0 -65
- package/dist/components/EquipmentSummary/types/index.js +0 -1
- package/dist/components/Grid/index.js +0 -19
- package/dist/components/HeroBanner/context/index.js +0 -7
- package/dist/components/HeroBanner/index.js +0 -33
- package/dist/components/HeroBanner/types/index.js +0 -1
- package/dist/components/Nav/index.js +0 -23
- package/dist/components/OfferCards/context/index.js +0 -7
- package/dist/components/OfferCards/index.js +0 -30
- package/dist/components/OfferCards/subComponents/OfferCard.js +0 -62
- package/dist/components/OfferCards/types/index.js +0 -1
- package/dist/components/SaleBanner/context/index.js +0 -7
- package/dist/components/SaleBanner/index.js +0 -59
- package/dist/components/SaleBanner/types/index.js +0 -1
- package/dist/index-0d8e0844-BJzWsYCM.js +0 -7403
- package/dist/index-C9Rf5U9q.js +0 -29143
- package/dist/index-b30029d4-E1YxEHFH.js +0 -12
- package/dist/index-e6818ded-r_t6ryaW.js +0 -57
- package/dist/index.esm-322571ff-D1REhsOg.js +0 -41
- package/dist/lib/components/Accordion/context/index.d.ts +0 -10
- package/dist/lib/components/Accordion/index.d.ts +0 -2
- package/dist/lib/components/Accordion/types/index.d.ts +0 -13
- package/dist/lib/components/Cart/index.d.ts +0 -6
- package/dist/lib/components/EquipmentSummary/context/index.d.ts +0 -10
- package/dist/lib/components/EquipmentSummary/index.d.ts +0 -2
- package/dist/lib/components/EquipmentSummary/types/index.d.ts +0 -14
- package/dist/lib/components/Grid/index.d.ts +0 -13
- package/dist/lib/components/HeroBanner/context/index.d.ts +0 -10
- package/dist/lib/components/HeroBanner/index.d.ts +0 -2
- package/dist/lib/components/HeroBanner/types/index.d.ts +0 -11
- package/dist/lib/components/Nav/index.d.ts +0 -8
- package/dist/lib/components/OfferCards/context/index.d.ts +0 -9
- package/dist/lib/components/OfferCards/index.d.ts +0 -2
- package/dist/lib/components/OfferCards/subComponents/OfferCard.d.ts +0 -3
- package/dist/lib/components/OfferCards/types/index.d.ts +0 -26
- package/dist/lib/components/SaleBanner/context/index.d.ts +0 -10
- package/dist/lib/components/SaleBanner/index.d.ts +0 -2
- package/dist/lib/components/SaleBanner/types/index.d.ts +0 -11
- package/dist/link-DO_Jvm9n.js +0 -685
- package/dist/prism-accordion.entry-DeyFGNx-.js +0 -51
- package/dist/prism-avatar_2.entry-MLbdVrJg.js +0 -68
- package/dist/prism-badge.entry-BG5y7O5U.js +0 -58
- package/dist/prism-banner.entry-DChrjpFH.js +0 -82
- package/dist/prism-breadcrumb.entry-1YzYlKen.js +0 -33
- package/dist/prism-button_2.entry-DO8IGIoS.js +0 -110
- package/dist/prism-card.entry-DQ6P4TZP.js +0 -119
- package/dist/prism-carousel.entry-BA8zsHRW.js +0 -3111
- package/dist/prism-checkbox-group.entry-CP4-gghb.js +0 -62
- package/dist/prism-checkbox.entry-CJCy8fvC.js +0 -99
- package/dist/prism-data-table.entry--0djw8ls.js +0 -10475
- package/dist/prism-datepicker.entry-DPm7tpKB.js +0 -249
- package/dist/prism-form.entry-CS1zRoMt.js +0 -42
- package/dist/prism-grid.entry-jcx2aMUm.js +0 -28
- package/dist/prism-header.entry-CBSIpa0M.js +0 -202
- package/dist/prism-hero.entry-B0CKL5y9.js +0 -23
- package/dist/prism-icon_2.entry-Aja4QGUK.js +0 -118
- package/dist/prism-image.entry-B--khr6E.js +0 -38
- package/dist/prism-input-file.entry-i5qJkwEK.js +0 -119
- package/dist/prism-input-otp.entry-DXoARuzH.js +0 -63
- package/dist/prism-input-text.entry-D4QQ-dYX.js +0 -228
- package/dist/prism-input-textarea.entry-eeQHnhqC.js +0 -140
- package/dist/prism-layout.entry-bfKqOEnU.js +0 -20
- package/dist/prism-lineitem.entry-YIRZPVe_.js +0 -44
- package/dist/prism-menu.entry-BIlRCiaA.js +0 -231
- package/dist/prism-modal.entry-Kc-SpAR-.js +0 -94
- package/dist/prism-pagination.entry-BCo9aMdq.js +0 -60
- package/dist/prism-popover.entry-LmDvzCiR.js +0 -1013
- package/dist/prism-popper.entry-BqrcyTkE.js +0 -959
- package/dist/prism-progress.entry-29_ezvop.js +0 -79
- package/dist/prism-radio-group.entry-cL6AqjTk.js +0 -66
- package/dist/prism-radio.entry-CM_vZFZA.js +0 -101
- package/dist/prism-select.entry-B6A3gk7B.js +0 -230
- package/dist/prism-switch.entry-CtEfKB58.js +0 -95
- package/dist/prism-tab.entry-DIDUhFlk.js +0 -20
- package/dist/prism-tabs.entry-Cj3dW5_E.js +0 -70
- package/dist/prism-tooltip.entry-DEdY5eRd.js +0 -52
- package/dist/prism-typeahead.entry-D2XrvXaG.js +0 -1234
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { r as y, e as f, h as a, H as _, g as E, F as g } from "./index-C9Rf5U9q.js";
|
|
2
|
-
import { g as M, u as b, m as C, a as v, e as z, b as w } from "./index-e6818ded-r_t6ryaW.js";
|
|
3
|
-
/*!
|
|
4
|
-
* Copyright (c) 2025 Comcast. Prism UI - v7.32.2 - made with ❤️ in Philadelphia
|
|
5
|
-
*/
|
|
6
|
-
const A = '.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}:host{--width:100%;--justify:"left";--prism-menu-margin:0.25rem 0;--prism-menu-parent-button-padding:0 0 12px 0;--prism-menu-horizontal-dropdown-max-height:75vh;--prism-menu-horizontal-dropdown-max-width:50vw;display:block;margin:var(--prism-menu-margin);max-width:var(--width);position:relative}.menu-item,.menu-items{list-style-type:none;margin:0;padding:0}.menu-item>:not([hidden])~:not([hidden]),.menu-items>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.list-items{list-style-type:none;margin:0;padding:0}.collapsible{transition:max-height .25s ease-in-out}.menu-children{margin-top:.5rem;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content}.list-children,.menu-children{margin-left:1.75rem;max-height:0;overflow-y:hidden}.overflow-wrapper.expanded>ul.menu-children,li.expanded>ul.list-children,li.expanded>ul.menu-children{display:block;max-height:500vh;overflow:auto}.menu-horizontal .overflow-wrapper.expanded>ul.menu-children,.menu-horizontal>li.expanded>ul.list-children,.menu-horizontal>li.expanded>ul.menu-children{display:block;max-height:var(--prism-menu-horizontal-dropdown-max-height);max-width:var(--prism-menu-horizontal-dropdown-max-width);overflow:auto;white-space:break-spaces}.collapse{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.menu,.menu ul{list-style-type:none;margin:0;padding:0;width:100%}.menu ul>li{margin-left:1.75rem}.menu-horizontal.gap{-moz-column-gap:1.5rem;column-gap:1.5rem}.menu-item>span{align-items:center;display:flex}.menu-collapse{margin-top:.75rem}.menu-text{--text-body1-leading:var(--text-body1-line-height);--text-body1-family:var(--text-family-default);font-family:var(--text-body1-family);font-size:var(--text-body1-size);font-weight:var(--text-body1-weight);letter-spacing:var(--text-body1-letter-spacing);line-height:var(--text-body1-leading);text-transform:var(--text-body1-text-transform)}.menu-horizontal,.menu-horizontal nav{max-width:100%}.menu-horizontal .single-menu-item prism-button[data-root],.menu-horizontal prism-button[data-root]{--button-padding:var(--prism-menu-parent-button-padding)}.menu-horizontal prism-button[data-child]{--button-padding:0 0.75rem}.menu-horizontal,[part=overflow-menu] ul,ul.menu-horizontal ul{list-style-type:none;margin:0;padding:0;width:100%}.menu-horizontal ul>li,[part=overflow-menu] ul>li{margin-left:1.75rem;position:relative}.fadeout{opacity:0;transition:opacity .2s ease-in-out}.menu-horizontal [data-root]{white-space:nowrap}.menu-horizontal{align-items:center;display:flex;justify-content:var(--button-group-justify,flex-start)}.menu-horizontal>.menu-item-parent>ul.menu-children,.overflow-wrapper>ul.menu-children{--tw-bg-opacity:1;--tw-shadow:0px 4px 8px -4px var(--shadow-color);--tw-shadow-colored:0px 4px 8px -4px var(--tw-shadow-color);--shadow-color:var(--material-neutral-base-shadow);background-color:rgb(var(--background-color-material-neutral-base)/var(--tw-bg-opacity));border-radius:var(--border-radius-medium,8px);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);margin-top:.25rem;position:absolute;transition:opacity .25s ease-in-out;width:-webkit-max-content;width:-moz-max-content;width:max-content}.menu-horizontal .overflow-wrapper>ul.menu-children>li,.menu-horizontal>.menu-item-parent>ul.menu-children>li{margin-left:0}.menu-nav{display:flex}.overflow-wrapper{position:absolute;right:.25rem;transform:translateX(-105%)}.overflow-wrapper>ul.menu-children{display:block;right:0}.overflow-wrapper>ul.menu-children prism-button,.overflow-wrapper>ul.menu-children prism-button[data-root]{--button-padding:0.75rem}.tree-list,.tree-list ul{list-style-type:none;margin:0;padding:0}.tree-list ul>li{margin-left:1.75rem}.tree-list .menu-item{padding-bottom:.75rem;padding-top:.75rem}.tree-list .list-items{margin-top:.75rem}.item-text{--text-body1-leading:var(--text-body1-line-height);--text-body1-family:var(--text-family-default);font-family:var(--text-body1-family);font-size:var(--text-body1-size);font-weight:var(--text-body1-weight);letter-spacing:var(--text-body1-letter-spacing);line-height:var(--text-body1-leading);text-decoration-line:underline;text-transform:var(--text-body1-text-transform)}.tree-list .single-menu-item{align-items:center;display:flex}.single-menu-item{width:100%}.badge{padding-left:.5rem}.children-icon,.trailing-icon{margin-left:auto}@media (prefers-reduced-motion){.collapsible{transition:none}}.relative{position:relative}.pointer-events-none{pointer-events:none}', P = A, I = class {
|
|
7
|
-
constructor(u) {
|
|
8
|
-
y(this, u), this.prismMenu = f(this, "prismMenu", 7), this.prismClick = f(this, "prismClick", 7), this.prismClose = f(this, "prismClose", 7), this._uid = M(), this.mapPointers = (o, t) => {
|
|
9
|
-
var n, s;
|
|
10
|
-
const e = Object.assign({}, o), l = !!(!((n = e == null ? void 0 : e.children) === null || n === void 0) && n.length);
|
|
11
|
-
return t && (e._parentRef = t), t && l && ((s = e == null ? void 0 : e.children) === null || s === void 0 || s.map((r) => this.mapPointers(r, e))), e.expanded && (e._preserveExpanded = !0, this.initiallyExpanded.push(e)), e.active && this.activeChildren.push(e), e;
|
|
12
|
-
}, this.expandActiveMenus = () => {
|
|
13
|
-
const o = (t) => {
|
|
14
|
-
const n = !!(t != null && t._parentRef), s = this.expandActiveParents === !0, e = this.variant === "menu-horizontal", l = this.overflowMenu.findIndex((i) => i.uid === t.uid), r = l !== -1, h = this.initiallyExpanded.findIndex((i) => i.uid === t.uid) !== -1;
|
|
15
|
-
!n && e && s && (t.expanded = !!h, r && (this.overflowMenu[l].expanded = !0)), n && s && (t._parentRef.expanded = !0, o(t._parentRef)), n && !s && (delete t._parentRef.expanded, h && (t.expanded = !0), o(t._parentRef));
|
|
16
|
-
};
|
|
17
|
-
this.activeChildren.map(o);
|
|
18
|
-
}, this.initializeMenu = () => {
|
|
19
|
-
this.activeChildren = [], this.initiallyExpanded = [];
|
|
20
|
-
const o = this.menu.map((t, n) => {
|
|
21
|
-
var s;
|
|
22
|
-
const e = Object.assign(Object.assign({}, t), { uid: `${b((t == null ? void 0 : t.label) || (t == null ? void 0 : t.title))}-${this._uid}-${n}` }), l = !!(!((s = e == null ? void 0 : e.children) === null || s === void 0) && s.length);
|
|
23
|
-
return e.expanded && (e._preserveExpanded = !0, this.initiallyExpanded.push(e)), l && (e.children = e.children.map((r) => this.mapPointers(r, e))), e;
|
|
24
|
-
});
|
|
25
|
-
return this.expandActiveParents === !0 && this.activeChildren.length && this.expandActiveMenus(), o;
|
|
26
|
-
}, this.updateOverflowKeys = (o) => {
|
|
27
|
-
o ? (this.overflowKeys = Object.assign(Object.assign({}, this.overflowKeys), o), this.overflowMenu = [...this.menu.filter((t) => this.overflowKeys[t.uid])]) : this.overflowMenu = [...this.menu.filter((t) => this.overflowKeys[t.uid])];
|
|
28
|
-
}, this.handleIntersection = (o) => {
|
|
29
|
-
o.forEach((t) => {
|
|
30
|
-
const { target: n, isIntersecting: s } = t;
|
|
31
|
-
s ? (n.classList.remove("fadeout"), n.classList.remove("pointer-events-none"), n.setAttribute("aria-hidden", "false"), this.updateOverflowKeys({ [n.dataset.uid]: !1 })) : (n.classList.add("fadeout"), n.classList.add("pointer-events-none"), n.setAttribute("aria-hidden", "true"), this.updateOverflowKeys({ [n.dataset.uid]: !0 }));
|
|
32
|
-
});
|
|
33
|
-
}, this.collapseMenu = () => {
|
|
34
|
-
this.collapse = !this.collapse;
|
|
35
|
-
}, this.subMenuExpanded = !1, this.subMenuIcon = "caret_down_button", this.overflowButtonId = "overflow-menu-button", this.menuItemClicked = (o, t) => {
|
|
36
|
-
const n = o.currentTarget, s = n.closest("[part=overflow-menu]");
|
|
37
|
-
if (t.root && (t != null && t.children) && this.variant === "menu-horizontal" && !s && this._collapseAll(o.detail.id), o.detail.id !== this.overflowButtonId && !s && this.overflowExpanded && (this.overflowExpanded = !1, this._collapseAll(this.overflowButtonId)), o.detail.id === this.overflowButtonId && (this.overflowExpanded = !this.overflowExpanded, this._collapseAll(o.detail.id)), t != null && t.children) {
|
|
38
|
-
const { label: e, prismId: l } = n;
|
|
39
|
-
this._itemClickToggle(n), o.detail.id !== this.overflowButtonId && this.prismClick.emit({
|
|
40
|
-
data: t,
|
|
41
|
-
id: l,
|
|
42
|
-
label: e,
|
|
43
|
-
name: t != null && t.root ? "menu-dropdown-root" : "menu-dropdown",
|
|
44
|
-
target: n,
|
|
45
|
-
isParent: !0,
|
|
46
|
-
isRoot: (t == null ? void 0 : t.root) || !1,
|
|
47
|
-
isInsideOverflow: !!s
|
|
48
|
-
});
|
|
49
|
-
} else {
|
|
50
|
-
const { label: e, prismId: l } = n;
|
|
51
|
-
this.prismClick.emit({
|
|
52
|
-
data: t,
|
|
53
|
-
id: l,
|
|
54
|
-
label: e,
|
|
55
|
-
name: "menu-item",
|
|
56
|
-
target: n,
|
|
57
|
-
isParent: !1,
|
|
58
|
-
isRoot: (t == null ? void 0 : t.root) || !1,
|
|
59
|
-
isInsideOverflow: !!s
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
this.toggleFocusChildren();
|
|
63
|
-
}, this._collapseAll = (o) => {
|
|
64
|
-
this.el.shadowRoot.querySelectorAll("li.expanded:not(.overflow-root) prism-button[data-root], .overflow-wrapper.expanded > prism-button[data-root]").forEach((s) => {
|
|
65
|
-
s.prismId !== o && this._itemClickToggle(s);
|
|
66
|
-
});
|
|
67
|
-
}, this._expandMenuParent = (o) => (t) => {
|
|
68
|
-
const n = t.parentElement.closest(".menu-item-parent"), s = n.querySelector("[data-type=icon]"), e = n.querySelector("[data-display]");
|
|
69
|
-
o && (n.classList.add("expanded"), e.setAttribute("expanded", "true"), s.setAttribute("name", "caret_up_button")), o || (n.classList.remove("expanded"), e.setAttribute("expanded", "false"), s.setAttribute("name", this.subMenuIcon));
|
|
70
|
-
}, this._expandActiveParentElements = (o) => (t) => {
|
|
71
|
-
const n = t.parentElement.closest(".menu-item-parent");
|
|
72
|
-
!!t.attributes["data-root"] || !n || (this._expandMenuParent(o)(t), this._expandActiveParentElements(o)(n));
|
|
73
|
-
}, this._itemClickToggle = (o) => {
|
|
74
|
-
var t, n, s, e;
|
|
75
|
-
const l = this.variant === "menu-horizontal", r = this.expandActiveParents === !0, d = !!o.attributes["data-root"], h = !!o.classList.contains("overflow-menu-button-toggle"), i = o.querySelector("[data-type=icon]");
|
|
76
|
-
o.expanded = !o.expanded, i == null || i.setAttribute("name", o.expanded ? "caret_up_button" : this.subMenuIcon), (t = o.closest("li")) === null || t === void 0 || t.classList.toggle("expanded");
|
|
77
|
-
const p = o.closest("li");
|
|
78
|
-
d && l && r && p && (p.querySelectorAll("[data-child] [aria-current='page']").forEach(this._expandActiveParentElements(o.expanded)), p.querySelectorAll("[data-preserve-expanded]").forEach(this._expandMenuParent(o.expanded))), h && l && r && ((e = (s = ((n = this.el.shadowRoot) === null || n === void 0 ? void 0 : n.querySelectorAll("div.overflow-wrapper"))[0]) === null || s === void 0 ? void 0 : s.querySelectorAll("li.overflow-root")) === null || e === void 0 || e.forEach((c) => {
|
|
79
|
-
const x = c.querySelectorAll("[data-child] [aria-current='page']");
|
|
80
|
-
x.forEach(this._expandActiveParentElements(o.expanded)), x || c.querySelectorAll("[data-preserve-expanded]").forEach(this._expandMenuParent(o.expanded));
|
|
81
|
-
}));
|
|
82
|
-
}, this.menu = [], this.collapse = !1, this.collapsible = !1, this.expandActiveParents = !1, this.variant = "menu", this.gap = !1, this.navLabel = void 0, this.navRole = void 0, this.overflow = !1, this.useCustomRouting = void 0, this.overflowKeys = {}, this.overflowMenu = [], this.overflowExpanded = !1, this.activeChildren = [], this.initiallyExpanded = [];
|
|
83
|
-
}
|
|
84
|
-
// Track Open Menus
|
|
85
|
-
// private openMenus: NodeListOf<Element>;
|
|
86
|
-
// Watch for Menu Object Changes
|
|
87
|
-
updateMenu() {
|
|
88
|
-
}
|
|
89
|
-
// Init
|
|
90
|
-
connectedCallback() {
|
|
91
|
-
C("prism-menu");
|
|
92
|
-
}
|
|
93
|
-
toggleFocusChildren() {
|
|
94
|
-
var u, o, t, n, s, e;
|
|
95
|
-
(u = this.el.shadowRoot) === null || u === void 0 || u.querySelectorAll("li").forEach((r) => {
|
|
96
|
-
v(r).forEach(z);
|
|
97
|
-
});
|
|
98
|
-
const l = (o = this.el.shadowRoot) === null || o === void 0 ? void 0 : o.querySelectorAll("li.menu-item-parent:not(.expanded)");
|
|
99
|
-
if (l == null || l.forEach((r) => {
|
|
100
|
-
v(r.querySelector("ul")).forEach(w);
|
|
101
|
-
}), this.overflow) {
|
|
102
|
-
this.overflowExpanded || (s = (n = ((t = this.el.shadowRoot) === null || t === void 0 ? void 0 : t.querySelectorAll("div.overflow-wrapper"))[0]) === null || n === void 0 ? void 0 : n.querySelectorAll("li.overflow-root")) === null || s === void 0 || s.forEach((h) => {
|
|
103
|
-
v(h).forEach(w);
|
|
104
|
-
});
|
|
105
|
-
const r = (e = this.el.shadowRoot) === null || e === void 0 ? void 0 : e.querySelectorAll('li[aria-hidden="true"]');
|
|
106
|
-
r == null || r.forEach((d) => {
|
|
107
|
-
v(d).forEach(w);
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Initiates an Intersection Observer to monitor menu items and move them to the overflow menu if necessary.
|
|
113
|
-
*/
|
|
114
|
-
observeMenu() {
|
|
115
|
-
const u = {
|
|
116
|
-
root: this.el,
|
|
117
|
-
// Rems don't seem to work 😢
|
|
118
|
-
// -48px clears the overflow button's width
|
|
119
|
-
// This makes a menu item disappear as soon as the overflow button "touches" it.
|
|
120
|
-
rootMargin: "0px -48px 0px 0px",
|
|
121
|
-
threshold: 1
|
|
122
|
-
};
|
|
123
|
-
this.variant === "menu-horizontal" && this.el.getBoundingClientRect().width > 0 && (this._observer = new IntersectionObserver(this.handleIntersection, u), this._nav.querySelectorAll("li:not([part=overflow-menu])").forEach((o) => {
|
|
124
|
-
o.parentElement.hasAttribute("part") && this._observer.observe(o);
|
|
125
|
-
}));
|
|
126
|
-
}
|
|
127
|
-
componentDidLoad() {
|
|
128
|
-
var u, o;
|
|
129
|
-
this.overflow && this.observeMenu();
|
|
130
|
-
const t = this.el.shadowRoot.querySelectorAll("prism-button[data-root]"), n = "li.expanded:not(.overflow-root) prism-button[data-root], .overflow-wrapper.expanded > prism-button[data-root]";
|
|
131
|
-
this.variant === "menu-horizontal" && (t && t.forEach((s) => {
|
|
132
|
-
s == null || s.addEventListener("focusin", (e) => {
|
|
133
|
-
var l, r;
|
|
134
|
-
const d = this.el.shadowRoot.querySelectorAll(n);
|
|
135
|
-
e.target.id !== ((r = (l = d[0]) === null || l === void 0 ? void 0 : l.children[0]) === null || r === void 0 ? void 0 : r.id) && d.forEach((h) => {
|
|
136
|
-
var i, p;
|
|
137
|
-
this._itemClickToggle(h), this.toggleFocusChildren(), this.overflowExpanded = !1, this.prismClose.emit({ name: "root-dropdown-closed-focus-off-dropdown", id: (i = h.children[0]) === null || i === void 0 ? void 0 : i.id, label: (p = h.children[0]) === null || p === void 0 ? void 0 : p.textContent });
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
}), (u = this.el) === null || u === void 0 || u.addEventListener("focusout", () => {
|
|
141
|
-
this.el.shadowRoot.querySelectorAll(n).forEach((e) => {
|
|
142
|
-
var l, r;
|
|
143
|
-
this._itemClickToggle(e), this.toggleFocusChildren(), this.overflowExpanded = !1, this.prismClose.emit({ name: "root-dropdown-closed-focus-out-of-menu", id: (l = e.children[0]) === null || l === void 0 ? void 0 : l.id, label: (r = e.children[0]) === null || r === void 0 ? void 0 : r.textContent });
|
|
144
|
-
});
|
|
145
|
-
})), (o = this.el) === null || o === void 0 || o.addEventListener("keydown", (s) => {
|
|
146
|
-
s.code === "Escape" && this.el.shadowRoot.querySelectorAll(n).forEach((l) => {
|
|
147
|
-
var r, d;
|
|
148
|
-
this._itemClickToggle(l), this.toggleFocusChildren(), this.overflowExpanded = !1, l.setFocus(), this.prismClose.emit({ name: "root-dropdown-closed-escape-key", id: (r = l.children[0]) === null || r === void 0 ? void 0 : r.id, label: (d = l.children[0]) === null || d === void 0 ? void 0 : d.textContent });
|
|
149
|
-
});
|
|
150
|
-
}), document.addEventListener("mousedown", (s) => {
|
|
151
|
-
const e = s.target, l = this.el.tagName.toLowerCase(), r = this.el.shadowRoot.querySelectorAll(n);
|
|
152
|
-
e.closest(l) !== this.el && r.forEach((d) => {
|
|
153
|
-
var h, i;
|
|
154
|
-
this._itemClickToggle(d), this.overflowExpanded = !1, this.toggleFocusChildren(), this.prismClose.emit({ name: "root-dropdown-closed-click-outside-menu", id: (h = d.children[0]) === null || h === void 0 ? void 0 : h.id, label: (i = d.children[0]) === null || i === void 0 ? void 0 : i.textContent });
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
componentDidRender() {
|
|
159
|
-
this.prismMenu.emit({ menu: this.menu }), this.toggleFocusChildren();
|
|
160
|
-
}
|
|
161
|
-
componentWillRender() {
|
|
162
|
-
this.menu = this.initializeMenu(), this.overflow && this.updateOverflowKeys(null);
|
|
163
|
-
}
|
|
164
|
-
render() {
|
|
165
|
-
const u = {
|
|
166
|
-
children: this.overflowMenu
|
|
167
|
-
}, o = () => {
|
|
168
|
-
this.el.shadowRoot.querySelectorAll("li.expanded:not(.overflow-root) prism-button[data-root], .overflow-wrapper.expanded > prism-button[data-root]").forEach((r) => {
|
|
169
|
-
var d;
|
|
170
|
-
((d = r.children[0]) === null || d === void 0 ? void 0 : d.id) !== this.overflowButtonId && (this._itemClickToggle(r), this.toggleFocusChildren());
|
|
171
|
-
});
|
|
172
|
-
}, t = (e) => {
|
|
173
|
-
const l = this.variant === "menu-horizontal";
|
|
174
|
-
return this.overflow && a("prism-button", { onPrismFocus: o, class: "overflow-menu-button-toggle", display: "ghost", tone: this.overflowExpanded ? "theme1" : "neutral", prismId: this.overflowButtonId, expanded: (e == null ? void 0 : e.expanded) || !1, onPrismPress: (r) => {
|
|
175
|
-
this.menuItemClicked(r, e), e != null && e.onPrismPress && (e == null || e.onPrismPress(r)), this.prismClick.emit({ name: "overflow", open: this.overflowExpanded });
|
|
176
|
-
}, "data-root": !0, state: l && this.overflowExpanded ? "active" : null, size: "xs", label: "more" }, a("prism-icon", { class: "icon", tone: l && e.active ? "theme1" : "neutral", name: "more_horizontal", size: "sm" }));
|
|
177
|
-
}, n = (e) => {
|
|
178
|
-
var l;
|
|
179
|
-
const r = (l = e == null ? void 0 : e.children) === null || l === void 0 ? void 0 : l.length, d = this.variant === "menu-horizontal", h = d && (e == null ? void 0 : e.root) && !this.overflowKeys[e.uid];
|
|
180
|
-
return a("div", { class: "single-menu-item" }, a("prism-button", { display: this.variant === "tree-list" ? "link" : h ? "ghost" : "menu", tone: e.active ? "theme1" : "neutral", current: e.active && !r ? "page" : !!(e.active && r), target: e.target, expanded: r ? (e == null ? void 0 : e.expanded) || (e == null ? void 0 : e._preserveExpanded) || !1 : void 0, href: e.children ? void 0 : e.href, onPrismPress: (i) => {
|
|
181
|
-
this.useCustomRouting && i.preventDefault(), this.menuItemClicked(i, e), e != null && e.onPrismPress && (e == null || e.onPrismPress(i));
|
|
182
|
-
}, state: d && e.active ? "active" : null, "data-root": e == null ? void 0 : e.root, "data-child": !e.root, "data-preserve-expanded": e == null ? void 0 : e._preserveExpanded }, e.icon && a("prism-icon", { slot: "icon", class: "icon", tone: e.active ? "theme1" : "neutral", name: e.icon, size: "sm" }), this.variant.includes("menu") && (e.children || e.active) && a(g, null, d && e.root && !this.overflowKeys[e.uid] && e.active && !r ? null : a("prism-icon", { class: "trailing-icon", slot: "icon-trailing", tone: e.children ? "custom" : "theme1", name: e.children ? e.expanded || e != null && e._preserveExpanded ? "caret_up_button" : "caret_down_button" : "check", "data-type": "icon" })), a("span", { class: {
|
|
183
|
-
collapse: this.collapse,
|
|
184
|
-
"item-text": this.variant === "tree-list",
|
|
185
|
-
"menu-text": this.variant.includes("menu") && !e.root
|
|
186
|
-
} }, e.title), e.label && a("prism-badge", { label: e.badgeA11yLabel, priority: e.active ? "high" : void 0, tone: e.active ? "theme1" : void 0, slot: "label", class: "badge", size: "md" }, e.label)), e.children && !this.variant.includes("menu") && a("prism-button", { label: `Toggle Sub Menu for ${e.title}`, expanded: this.subMenuExpanded, onPrismPress: (i) => this.menuItemClicked(i, e), display: this.variant === "tree-list" ? "ghost-icon" : "ghost", "aria-hidden": this.collapse.toString(), class: { "children-icon": !0, collapse: this.collapse } }, a("prism-icon", { size: "xs", name: this.subMenuIcon, "data-type": "icon" })));
|
|
187
|
-
}, s = (e) => {
|
|
188
|
-
var l, r;
|
|
189
|
-
const d = (l = e == null ? void 0 : e.children) === null || l === void 0 ? void 0 : l.length, h = (i, p) => `${b((i == null ? void 0 : i.label) || (i == null ? void 0 : i.title))}-${this._uid}-${p}`;
|
|
190
|
-
return a("ul", { class: {
|
|
191
|
-
"menu-children": this.variant.includes("menu"),
|
|
192
|
-
"list-children": this.variant === "tree-list",
|
|
193
|
-
collapsible: !this.collapsible
|
|
194
|
-
} }, d > 0 && ((r = e == null ? void 0 : e.children) === null || r === void 0 ? void 0 : r.map((i, p) => {
|
|
195
|
-
var m;
|
|
196
|
-
const c = this.overflowKeys[i.uid];
|
|
197
|
-
return a(g, null, ((m = i == null ? void 0 : i.children) === null || m === void 0 ? void 0 : m.length) > 0 ? a("li", { key: `${i.uid}-${p}`, id: i != null && i.root ? `menu-root-${i.uid}` : `menu-child-${h(i, p)}`, "data-uid": i.uid, class: {
|
|
198
|
-
"menu-item-parent": d > 0,
|
|
199
|
-
"menu-item": d <= 0,
|
|
200
|
-
expanded: (i == null ? void 0 : i.expanded) || (i == null ? void 0 : i._preserveExpanded),
|
|
201
|
-
"overflow-root": c
|
|
202
|
-
} }, a(n, Object.assign({}, i)), a(s, Object.assign({}, i))) : a("li", { id: i != null && i.root ? `menu-root-${i.uid}` : `menu-child-${h(i, p)}`, "data-uid": e.uid, key: `${i.uid}-${p}`, class: { "menu-item": !0, "overflow-root": c } }, a(n, Object.assign({}, i))));
|
|
203
|
-
})));
|
|
204
|
-
};
|
|
205
|
-
return a(_, null, a("nav", { class: "menu-nav", "aria-label": this.navLabel, role: this.navRole }, a("ul", { class: {
|
|
206
|
-
[this.variant]: !0,
|
|
207
|
-
collapsible: !this.collapsible,
|
|
208
|
-
gap: this.gap
|
|
209
|
-
}, ref: (e) => this._nav = e, part: "menu" }, this.menu.map((e, l) => {
|
|
210
|
-
var r;
|
|
211
|
-
return a("li", { key: `${e.uid}-${l}`, id: `menu-root-${e.uid}`, "data-uid": e.uid, "data-root": e.root, class: {
|
|
212
|
-
relative: this.variant === "menu-horizontal",
|
|
213
|
-
"menu-item-parent": ((r = e == null ? void 0 : e.children) === null || r === void 0 ? void 0 : r.length) > 0,
|
|
214
|
-
"menu-item": !(e != null && e.children),
|
|
215
|
-
expanded: (e == null ? void 0 : e.expanded) || (e == null ? void 0 : e._preserveExpanded)
|
|
216
|
-
} }, a(n, Object.assign({}, e)), e.children && a(s, Object.assign({}, e)));
|
|
217
|
-
}), a("slot", null)), this.overflow && this.overflowMenu.length > 0 ? a("div", { part: "overflow-menu", class: "relative menu-horizontal" }, a("div", { class: { expanded: this.overflowExpanded, "overflow-wrapper relative": !0 } }, a(t, Object.assign({}, u)), a(s, Object.assign({}, u)))) : null, this.collapsible && a("prism-button", { class: "menu-collapse", type: "button", display: "ghost-icon", label: this.collapse ? "expand menu" : "collapse menu", onPrismPress: () => this.collapseMenu(), "aria-expanded": (!this.collapse).toString() || "false" }, a("prism-icon", { slot: "icon", name: this.collapse ? "caret_right_button" : "caret_left_button", size: "xs" }))));
|
|
218
|
-
}
|
|
219
|
-
get el() {
|
|
220
|
-
return E(this);
|
|
221
|
-
}
|
|
222
|
-
static get watchers() {
|
|
223
|
-
return {
|
|
224
|
-
menu: ["updateMenu"]
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
I.style = P;
|
|
229
|
-
export {
|
|
230
|
-
I as prism_menu
|
|
231
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { r as l, e as r, h as s, H as n, g as c } from "./index-C9Rf5U9q.js";
|
|
2
|
-
import { g as m, a as o, m as h } from "./index-e6818ded-r_t6ryaW.js";
|
|
3
|
-
/*!
|
|
4
|
-
* Copyright (c) 2025 Comcast. Prism UI - v7.32.2 - made with ❤️ in Philadelphia
|
|
5
|
-
*/
|
|
6
|
-
const b = ".sc-prism-modal-h{--modal-w:75vw;--prism-modal-max-height:75vh;--tw-bg-opacity:1;--tw-bg-opacity:var(--background-opacity-secondary,0.6);--shadow-color:var(--fill-neutral-base-shadow);-webkit-backdrop-filter:blur(.1875rem);backdrop-filter:blur(.1875rem);background-color:rgb(var(--background-color-fill-neutral-base)/var(--tw-bg-opacity));bottom:0;display:none;height:0;isolation:isolate;left:0;opacity:0;position:fixed;right:0;top:0;width:0;z-index:540}.open.sc-prism-modal-h{display:block;height:100%;min-height:100vh;opacity:1;width:100%}.modal-container.sc-prism-modal:focus,.sc-prism-modal-h:focus{outline:2px solid transparent;outline-offset:2px}.modal.sc-prism-modal{display:flex;flex-direction:column;height:100vh;justify-content:center;position:relative}.modal-container.sc-prism-modal{--tw-bg-opacity:1;--shadow-color:var(--material-neutral-base-shadow);background-color:rgb(var(--background-color-material-neutral-base)/var(--tw-bg-opacity));margin-left:auto;margin-right:auto;padding:1.5rem;position:relative}.modal-container.flush.sc-prism-modal{padding:0}.modal-container.flush.sc-prism-modal .header-actions.sc-prism-modal{right:var(--modal-close-right,.25rem);top:var(--modal-close-top,.25rem)}.header-actions.sc-prism-modal{position:absolute;right:.75rem;top:.75rem;z-index:0}.modal-content.dismissible.sc-prism-modal .header.sc-prism-modal{padding-right:2rem}.header.sc-prism-modal{margin-bottom:1rem}.modal-content-header.sc-prism-modal{display:flex;flex-direction:column;gap:1rem}.show.sc-prism-modal{--tw-shadow:0px 12px 12px -8px var(--shadow-color);--tw-shadow-colored:0px 12px 12px -8px var(--tw-shadow-color);animation:modal-animation .3s cubic-bezier(.25,.46,.45,.94) both;-webkit-backface-visibility:hidden;backface-visibility:hidden;border-radius:var(--border-radius-medium,8px);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:-webkit-min-content;height:-moz-min-content;height:min-content;max-height:var(--prism-modal-max-height);max-width:var(--modal-w);overflow:auto;width:100%}@media (max-width:767px){.show.behavior-fullscreen.sc-prism-modal{--modal-w:100vw;--prism-modal-max-height:100vh;border-radius:var(--border-radius-none,0);height:100%;width:100%}}@media (min-width:768px){.show.sc-prism-modal{max-height:var(--prism-modal-max-height)}.modal-container.sc-prism-modal{padding:2.5rem}.header-actions.sc-prism-modal{right:1.75rem;top:1.75rem}.modal-content.dismissible.sc-prism-modal .header.sc-prism-modal{padding-right:2.5rem}}footer.sc-prism-modal{margin-top:2rem}footer.persistant.sc-prism-modal{--tw-translate-y:2.5rem;--tw-bg-opacity:1;--shadow-color:var(--material-neutral-base-shadow);background-color:rgb(var(--background-color-material-neutral-base)/var(--tw-bg-opacity));bottom:0;margin-top:1.5rem;padding-bottom:2.5rem;padding-top:.5rem;position:-webkit-sticky;position:sticky;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));width:100%}@keyframes modal-animation{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@media (prefers-reduced-motion){.show.sc-prism-modal{animation:none}}", p = b, f = class {
|
|
7
|
-
constructor(e) {
|
|
8
|
-
l(this, e), this.prismClick = r(this, "prismClick", 7), this.prismClosed = r(this, "prismClosed", 7), this.uid = m(), this.hasHeader = !1, this.hasFooter = !1, this.hasAsset = !1, this.body = this.el.closest("body"), this.dismiss = (i) => {
|
|
9
|
-
if (this.open = !1, i) {
|
|
10
|
-
const { currentTarget: t } = i;
|
|
11
|
-
i instanceof KeyboardEvent || this.prismClick.emit({
|
|
12
|
-
name: "modal-closed",
|
|
13
|
-
dismissed: !0,
|
|
14
|
-
target: t,
|
|
15
|
-
host: this.el
|
|
16
|
-
}), this.prismClosed.emit({
|
|
17
|
-
name: "modal-closed",
|
|
18
|
-
dismissed: !0,
|
|
19
|
-
target: t,
|
|
20
|
-
host: this.el
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}, this._disableBodyFocusTarget = () => {
|
|
24
|
-
this.body.classList.contains("sb-main-fullscreen") || (this.body.style.overflow = "hidden"), this.referElement = document.activeElement, setTimeout(() => {
|
|
25
|
-
o(this.el)[1].focus();
|
|
26
|
-
}, 0);
|
|
27
|
-
}, this._resetBodyFocusTarget = () => {
|
|
28
|
-
this.body.classList.contains("sb-main-fullscreen") || (this.body.style.overflow = "auto"), setTimeout(() => {
|
|
29
|
-
var i;
|
|
30
|
-
(i = this.referElement) === null || i === void 0 || i.focus();
|
|
31
|
-
}, 0);
|
|
32
|
-
}, this.open = !1, this.header = void 0, this.label = void 0, this.dismissable = !1, this.dismissible = !0, this.dismissibleByKeyboard = !0, this.dismissibleByPointer = !0, this.closeIconPath = void 0, this.sticky = void 0, this.flush = !1, this.headingDisplay = "heading2", this.closeLabel = "close dialog", this.mobileBehavior = "default", this.prismId = `prism-modal-${this.uid}`;
|
|
33
|
-
}
|
|
34
|
-
// Listen for Tabbing or Window Swapping
|
|
35
|
-
handleVisibilityChange(e) {
|
|
36
|
-
}
|
|
37
|
-
connectedCallback() {
|
|
38
|
-
h("prism-modal");
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* @description Public: Open Modal
|
|
42
|
-
*/
|
|
43
|
-
async setOpen() {
|
|
44
|
-
this.open = !0;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* @description Public: Close Modal
|
|
48
|
-
*/
|
|
49
|
-
async setClose() {
|
|
50
|
-
this.dismiss(null);
|
|
51
|
-
}
|
|
52
|
-
watchHandler(e) {
|
|
53
|
-
e ? this._disableBodyFocusTarget() : this._resetBodyFocusTarget();
|
|
54
|
-
}
|
|
55
|
-
startingFocus(e) {
|
|
56
|
-
let i = o(this.el);
|
|
57
|
-
o(this.el)[i.length - 2].focus();
|
|
58
|
-
}
|
|
59
|
-
endingFocus(e) {
|
|
60
|
-
o(this.el)[1].focus();
|
|
61
|
-
}
|
|
62
|
-
componentDidLoad() {
|
|
63
|
-
var e, i;
|
|
64
|
-
this.hasFooter = !!this.element.querySelector('[slot="footer"]'), this.hasAsset = !!this.element.querySelector('[slot="asset-leading"]'), (e = this.el) === null || e === void 0 || e.addEventListener("keydown", (t) => {
|
|
65
|
-
var a;
|
|
66
|
-
let d = !(!((a = document.activeElement) === null || a === void 0) && a.closest("form"));
|
|
67
|
-
t.code === "Escape" && this.dismissibleByKeyboard && (this.dismissable || this.dismissible) && d && this.dismiss(t);
|
|
68
|
-
}), (i = this.el) === null || i === void 0 || i.addEventListener("click", (t) => {
|
|
69
|
-
!t.target.closest("[role=dialog]") && this.dismissibleByPointer && (this.dismissable || this.dismissible) && this.dismiss(t);
|
|
70
|
-
}), this.open === !0 && this._disableBodyFocusTarget();
|
|
71
|
-
}
|
|
72
|
-
disconnectedCallback() {
|
|
73
|
-
this._resetBodyFocusTarget();
|
|
74
|
-
}
|
|
75
|
-
render() {
|
|
76
|
-
return s(n, {
|
|
77
|
-
key: "f5e49a5a2a40dfb74fad47880d589ffc485ff326",
|
|
78
|
-
tabindex: "-1",
|
|
79
|
-
class: { open: this.open }
|
|
80
|
-
}, s("section", { key: "340e8ddd7f9ac5bb0d9f6b8121569e295973c6f2", class: "modal" }, s("div", { key: "a6fc6ccfdd70abed3d2f2678a772b02269891216", role: "dialog", "aria-modal": "true", inert: !this.open, "aria-label": this.label || this.header, class: { "modal-container": !0, flush: this.flush, show: this.open, [`behavior-${this.mobileBehavior}`]: !0 }, ref: (e) => this.element = e }, s("span", { key: "a7b50cc608733f7fb4ea373440f21211566e9de2", onFocus: (e) => this.startingFocus(e), id: `start-${this.prismId}`, tabindex: "0" }), (this.dismissable || this.dismissible) && s("div", { key: "77e37e9010f690ea49d04757f82ef99daba57e2e", class: "header-actions" }, s("prism-button", { key: "857e9abe67802f93063742d2a86e83f77c974604", display: "ghost-icon", tone: "neutral", class: "close", size: "xs", label: this.closeLabel, onClick: (e) => this.dismiss(e), type: "button" }, s("prism-icon", { key: "ae21e34f986da318b0e1995369d4f86e1990bc5f", role: "presentation", theme: "outline", class: "icon", size: "sm", name: "close", path: this.closeIconPath }, this.closeLabel))), s("div", { key: "d3e1d16fc802c11dcc3d8c0c18c5253575868d51", class: { "modal-content": !0, dismissible: this.dismissable || this.dismissible } }, s("div", { key: "7fde4fac1f929b5a3405402f864fc14b7b830ce4", class: "modal-content-header" }, s("slot", { key: "ade5e5a2441b8173ec4587843d69be1f2e18ee25", name: "asset-leading" }), this.header && s("prism-text", { key: "f9c7540299ca768ce8c37dc22824bd1415a59928", class: "header", tag: "h2", display: this.headingDisplay }, this.header)), s("slot", { key: "c209036e3aaea15d0caf86469ee7a70e5d8a6ed9" })), s("footer", { key: "9798ab4372251914a1802d83aeda1f17664a4cb4", class: { footer: this.hasFooter, persistant: this.sticky === "footer" } }, s("slot", { key: "cb300bd25a3c2e122257535d187f06163d7c33ea", name: "footer" })), s("span", { key: "0b52517b715ab5962b2c22f2122740b29f4f3b93", onFocus: (e) => this.endingFocus(e), id: `end-${this.prismId}`, tabindex: "0" }))));
|
|
81
|
-
}
|
|
82
|
-
get el() {
|
|
83
|
-
return c(this);
|
|
84
|
-
}
|
|
85
|
-
static get watchers() {
|
|
86
|
-
return {
|
|
87
|
-
open: ["watchHandler"]
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
f.style = p;
|
|
92
|
-
export {
|
|
93
|
-
f as prism_modal
|
|
94
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { r as e, e as s, h as i, H as a } from "./index-C9Rf5U9q.js";
|
|
2
|
-
import { g as r, m as n } from "./index-e6818ded-r_t6ryaW.js";
|
|
3
|
-
/*!
|
|
4
|
-
* Copyright (c) 2025 Comcast. Prism UI - v7.32.2 - made with ❤️ in Philadelphia
|
|
5
|
-
*/
|
|
6
|
-
const c = ".sc-prism-pagination-h{align-items:center;display:inline-flex;width:100%}.max.sc-prism-pagination{white-space:nowrap}.input.sc-prism-pagination{--text-align:center;-webkit-appearance:textfield;appearance:textfield;-moz-appearance:textfield}.current.sc-prism-pagination{margin-left:.5rem;width:4rem}.current.sc-prism-pagination,.previous.sc-prism-pagination{margin-right:.5rem}.next.sc-prism-pagination{margin-left:.5rem}", h = c, p = class {
|
|
7
|
-
constructor(t) {
|
|
8
|
-
e(this, t), this.prismChange = s(this, "prismChange", 7), this.uid = r(), this.first = !0, this.last = !1, this.max = void 0, this.current = 1, this.prismId = `prism-pagination-${this.uid}`, this.variant = "contained", this.iconVariant = "outline", this.tone = "neutral";
|
|
9
|
-
}
|
|
10
|
-
connectedCallback() {
|
|
11
|
-
n("prism-pagination");
|
|
12
|
-
}
|
|
13
|
-
// Check for current page
|
|
14
|
-
_checkCurrentPage() {
|
|
15
|
-
this.first = this.current === 1 || this.current <= 1, this.last = this.current === this.max || this.current >= this.max;
|
|
16
|
-
}
|
|
17
|
-
// On Value Change of the input text box
|
|
18
|
-
_valueChange(t) {
|
|
19
|
-
this.current = t.detail.value, this._checkCurrentPage(), this.prismChange.emit({
|
|
20
|
-
scope: this.prismId,
|
|
21
|
-
element: t.detail.id,
|
|
22
|
-
action: "change",
|
|
23
|
-
page: this.current,
|
|
24
|
-
first: this.first,
|
|
25
|
-
last: this.last
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
// On click of previous button
|
|
29
|
-
_previousPage(t) {
|
|
30
|
-
this.current <= this.max && this.current !== 1 && (this.current--, this._checkCurrentPage(), this.prismChange.emit({
|
|
31
|
-
scope: this.prismId,
|
|
32
|
-
element: t.detail.id,
|
|
33
|
-
action: "previous",
|
|
34
|
-
page: this.current,
|
|
35
|
-
first: this.first,
|
|
36
|
-
last: this.last
|
|
37
|
-
}));
|
|
38
|
-
}
|
|
39
|
-
// On click of next button
|
|
40
|
-
_nextPage(t) {
|
|
41
|
-
this.current < this.max && (this.current++, this._checkCurrentPage(), this.prismChange.emit({
|
|
42
|
-
scope: this.prismId,
|
|
43
|
-
element: t.detail.id,
|
|
44
|
-
action: "next",
|
|
45
|
-
page: this.current,
|
|
46
|
-
first: this.first,
|
|
47
|
-
last: this.last
|
|
48
|
-
}));
|
|
49
|
-
}
|
|
50
|
-
componentWillRender() {
|
|
51
|
-
this._checkCurrentPage();
|
|
52
|
-
}
|
|
53
|
-
render() {
|
|
54
|
-
return i(a, { key: "330e59f63d2d31559dae90e1866a502a47e83a37" }, i("prism-button", { key: "1fc283c21d410e9e693de109f5762c52dcacfaad", size: "xs", prismId: `${this.prismId}-previous-page`, "data-testid": `${this.prismId}-previous-page`, label: "Previous Page", class: "previous", disabled: this.first, onPrismPress: (t) => this._previousPage(t), display: "ghost-icon", tone: this.tone }, i("prism-icon", { key: "19f0742ef05f0ed7b984fff7416877dc5c20003d", theme: this.iconVariant, tone: "custom", name: "caret_left_button" })), i("section", { key: "f19c74938b97af12a11a5cf18f1fc7041195fd01", class: "current" }, i("prism-input-text", { key: "3df4e59dfb4834d82ef47673715e6d2853660635", hideLabel: !0, hideInvalid: !0, variant: this.variant, prismId: this.prismId, "data-testid": this.prismId, class: "input", invalidMessage: `Max of ${this.max}`, label: "set current page", onPrismChange: (t) => this._valueChange(t), max: this.max, min: "1", type: "number", inputMode: "numeric", value: this.current.toString() })), i("prism-text", { key: "2719f134c364fff449e0e4faaab53af44d1d6e93", class: "max", display: "body1" }, "of ", this.max), i("prism-button", { key: "408207b46d813244b321f36b5a07226e5faa6db8", prismId: `${this.prismId}-next-page`, "data-testid": `${this.prismId}-next-page`, label: "Next Page", class: "next", disabled: this.last, onPrismPress: (t) => this._nextPage(t), size: "xs", display: "ghost-icon", tone: this.tone }, i("prism-icon", { key: "31fc586e0ff1d01ccf722b9f69987a94b03389b5", theme: this.iconVariant, tone: "custom", name: "caret_right_button" })));
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
p.style = h;
|
|
58
|
-
export {
|
|
59
|
-
p as prism_pagination
|
|
60
|
-
};
|