@ed.yakovich/component-library 0.0.15 → 0.0.16
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/Accordion/context/index.js +7 -0
- package/dist/components/Accordion/index.js +38 -0
- package/dist/components/Accordion/types/index.js +1 -0
- package/dist/components/Cart/index.js +35 -0
- package/dist/components/EquipmentSummary/context/index.js +10 -0
- package/dist/components/EquipmentSummary/index.js +65 -0
- package/dist/components/EquipmentSummary/types/index.js +1 -0
- package/dist/components/Grid/index.js +19 -0
- package/dist/components/HeroBanner/context/index.js +7 -0
- package/dist/components/HeroBanner/index.js +33 -0
- package/dist/components/HeroBanner/types/index.js +1 -0
- package/dist/components/InfoBanner/index.js +24 -4
- package/dist/components/Nav/index.js +23 -0
- package/dist/components/OfferCards/context/index.js +7 -0
- package/dist/components/OfferCards/index.js +30 -0
- package/dist/components/OfferCards/subComponents/OfferCard.js +62 -0
- package/dist/components/OfferCards/types/index.js +1 -0
- package/dist/components/SaleBanner/context/index.js +7 -0
- package/dist/components/SaleBanner/index.js +59 -0
- package/dist/components/SaleBanner/types/index.js +1 -0
- package/dist/{index-ba31999b-V1s4iffq.js → index-0d8e0844-BJzWsYCM.js} +2443 -2491
- package/dist/index-C9Rf5U9q.js +29143 -0
- package/dist/index-b30029d4-E1YxEHFH.js +12 -0
- package/dist/index-e6818ded-r_t6ryaW.js +57 -0
- package/dist/{index.esm-a7c99373-DUoLYEEM.js → index.esm-322571ff-D1REhsOg.js} +1 -1
- package/dist/lib/components/Accordion/context/index.d.ts +10 -0
- package/dist/lib/components/Accordion/index.d.ts +2 -0
- package/dist/lib/components/Accordion/types/index.d.ts +13 -0
- package/dist/lib/components/Cart/index.d.ts +6 -0
- package/dist/lib/components/EquipmentSummary/context/index.d.ts +10 -0
- package/dist/lib/components/EquipmentSummary/index.d.ts +2 -0
- package/dist/lib/components/EquipmentSummary/types/index.d.ts +14 -0
- package/dist/lib/components/Grid/index.d.ts +13 -0
- package/dist/lib/components/HeroBanner/context/index.d.ts +10 -0
- package/dist/lib/components/HeroBanner/index.d.ts +2 -0
- package/dist/lib/components/HeroBanner/types/index.d.ts +11 -0
- package/dist/lib/components/Nav/index.d.ts +8 -0
- package/dist/lib/components/OfferCards/context/index.d.ts +9 -0
- package/dist/lib/components/OfferCards/index.d.ts +2 -0
- package/dist/lib/components/OfferCards/subComponents/OfferCard.d.ts +3 -0
- package/dist/lib/components/OfferCards/types/index.d.ts +26 -0
- package/dist/lib/components/SaleBanner/context/index.d.ts +10 -0
- package/dist/lib/components/SaleBanner/index.d.ts +2 -0
- package/dist/lib/components/SaleBanner/types/index.d.ts +11 -0
- package/dist/lib/main.d.ts +13 -0
- package/dist/link-DO_Jvm9n.js +685 -0
- package/dist/main.js +32 -6
- package/dist/prism-accordion.entry-DeyFGNx-.js +51 -0
- package/dist/prism-avatar_2.entry-MLbdVrJg.js +68 -0
- package/dist/prism-badge.entry-BG5y7O5U.js +58 -0
- package/dist/prism-banner.entry-DChrjpFH.js +82 -0
- package/dist/prism-breadcrumb.entry-1YzYlKen.js +33 -0
- package/dist/prism-button_2.entry-DO8IGIoS.js +110 -0
- package/dist/prism-card.entry-DQ6P4TZP.js +119 -0
- package/dist/prism-carousel.entry-BA8zsHRW.js +3111 -0
- package/dist/prism-checkbox-group.entry-CP4-gghb.js +62 -0
- package/dist/prism-checkbox.entry-CJCy8fvC.js +99 -0
- package/dist/prism-data-table.entry--0djw8ls.js +10475 -0
- package/dist/prism-datepicker.entry-DPm7tpKB.js +249 -0
- package/dist/{prism-form.entry-C8VzGp6c.js → prism-form.entry-CS1zRoMt.js} +11 -11
- package/dist/prism-grid.entry-jcx2aMUm.js +28 -0
- package/dist/prism-header.entry-CBSIpa0M.js +202 -0
- package/dist/prism-hero.entry-B0CKL5y9.js +23 -0
- package/dist/prism-icon_2.entry-Aja4QGUK.js +118 -0
- package/dist/prism-image.entry-B--khr6E.js +38 -0
- package/dist/prism-input-file.entry-i5qJkwEK.js +119 -0
- package/dist/prism-input-otp.entry-DXoARuzH.js +63 -0
- package/dist/prism-input-text.entry-D4QQ-dYX.js +228 -0
- package/dist/prism-input-textarea.entry-eeQHnhqC.js +140 -0
- package/dist/prism-layout.entry-bfKqOEnU.js +20 -0
- package/dist/prism-lineitem.entry-YIRZPVe_.js +44 -0
- package/dist/prism-menu.entry-BIlRCiaA.js +231 -0
- package/dist/prism-modal.entry-Kc-SpAR-.js +94 -0
- package/dist/prism-pagination.entry-BCo9aMdq.js +60 -0
- package/dist/prism-popover.entry-LmDvzCiR.js +1013 -0
- package/dist/prism-popper.entry-BqrcyTkE.js +959 -0
- package/dist/prism-progress.entry-29_ezvop.js +79 -0
- package/dist/prism-radio-group.entry-cL6AqjTk.js +66 -0
- package/dist/prism-radio.entry-CM_vZFZA.js +101 -0
- package/dist/prism-select.entry-B6A3gk7B.js +230 -0
- package/dist/prism-switch.entry-CtEfKB58.js +95 -0
- package/dist/prism-tab.entry-DIDUhFlk.js +20 -0
- package/dist/prism-tabs.entry-Cj3dW5_E.js +70 -0
- package/dist/prism-tooltip.entry-DEdY5eRd.js +52 -0
- package/dist/prism-typeahead.entry-D2XrvXaG.js +1234 -0
- package/package.json +4 -2
- package/dist/index-44540db3-BN5vFHKr.js +0 -44
- package/dist/index-4d46d9ca-BtyZMEt1.js +0 -12
- package/dist/index-D9BZSjMp.js +0 -21158
- package/dist/prism-accordion.entry-D4g7wdXB.js +0 -51
- package/dist/prism-avatar_3.entry-C1H9bg9y.js +0 -335
- package/dist/prism-badge.entry-CWLalQsR.js +0 -56
- package/dist/prism-banner.entry-D1sce4tY.js +0 -105
- package/dist/prism-breadcrumb.entry-C282yHQl.js +0 -33
- package/dist/prism-button_3.entry-DIg1AEXF.js +0 -240
- package/dist/prism-card.entry-DaxGD-uX.js +0 -152
- package/dist/prism-carousel.entry-BGmaoDVM.js +0 -3346
- package/dist/prism-checkbox-group.entry-Dwa_mvjd.js +0 -62
- package/dist/prism-checkbox.entry-CZvx2AHI.js +0 -116
- package/dist/prism-data-table.entry-DACAS8BE.js +0 -3591
- package/dist/prism-datepicker.entry-CHUyjilE.js +0 -279
- package/dist/prism-dialog.entry-DdO9Kt32.js +0 -73
- package/dist/prism-drawer.entry-Dn0rvW9U.js +0 -43
- package/dist/prism-header.entry-D0PypuC3.js +0 -227
- package/dist/prism-hero.entry-DQ8G7Jb_.js +0 -23
- package/dist/prism-image.entry-tx9Pc3k_.js +0 -38
- package/dist/prism-input-file.entry-CO-2LZxG.js +0 -119
- package/dist/prism-input-otp.entry-ZAxExI2D.js +0 -79
- package/dist/prism-input-text.entry-EXsN4rgi.js +0 -278
- package/dist/prism-input-textarea.entry-CRqY4mr9.js +0 -145
- package/dist/prism-input-time.entry-BJ9he6MX.js +0 -85
- package/dist/prism-layout.entry-ulDWjtj8.js +0 -20
- package/dist/prism-lineitem.entry-DJk6X6mR.js +0 -47
- package/dist/prism-modal.entry-C795YZic.js +0 -95
- package/dist/prism-pagination.entry-DYQieAu3.js +0 -69
- package/dist/prism-popover.entry-BgLcACZw.js +0 -1114
- package/dist/prism-progress.entry-Z21rpoTm.js +0 -79
- package/dist/prism-radio_2.entry-C0HPCb3G.js +0 -159
- package/dist/prism-select.entry-B_l-ab1d.js +0 -286
- package/dist/prism-switch.entry-OkC8X1bD.js +0 -95
- package/dist/prism-tab.entry-szftB_wL.js +0 -20
- package/dist/prism-tabs.entry-0UR3WF52.js +0 -72
- package/dist/prism-text.entry-BEAZ8xEV.js +0 -28
- package/dist/prism-treelist.entry-UX4FM4Bi.js +0 -135
- package/dist/prism-typeahead.entry-CwOiAFQE.js +0 -1264
- package/dist/purify-9647b094-0-ZyuBNz.js +0 -572
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { r as s, c, h as a, H as r, g as n } from "./index-D9BZSjMp.js";
|
|
2
|
-
import { g as o, m as h } from "./index-44540db3-BN5vFHKr.js";
|
|
3
|
-
/*!
|
|
4
|
-
* Copyright (c) 2025 Comcast. Prism UI - v8.28.0 - made with ❤️ in Philadelphia
|
|
5
|
-
*/
|
|
6
|
-
const p = ".sc-prism-checkbox-group-h{display:block}.parent.sc-prism-checkbox-group{--prism-checkbox-spacing-margin:0}.options.sc-prism-checkbox-group{margin-left:var(--prism-checkbox-group-spacing-gutter,var(--prism-spacer-size-3xl));padding-left:var(--prism-spacer-size-sm)}.group-row.sc-prism-checkbox-group{align-items:center;display:flex;justify-content:space-between;margin-top:var(--prism-spacer-size-lg)}.expandable-content.sc-prism-checkbox-group{max-height:0;overflow:hidden;transition:max-height var(--prism-animation-duration-normal) var(--prism-animation-timing-function);will-change:max-height,opacity}.expandable-content.visible.sc-prism-checkbox-group{display:block;max-height:500vh}.toggle.sc-prism-checkbox-group{margin-left:var(--prism-spacer-size-lg)}.container.sc-prism-checkbox-group{width:100%}@media (min-width:640px){.container.sc-prism-checkbox-group{max-width:640px}}@media (min-width:768px){.container.sc-prism-checkbox-group{max-width:768px}}@media (min-width:1024px){.container.sc-prism-checkbox-group{max-width:1024px}}@media (min-width:1280px){.container.sc-prism-checkbox-group{max-width:1280px}}@media (min-width:1536px){.container.sc-prism-checkbox-group{max-width:1536px}}", d = p, m = class {
|
|
7
|
-
constructor(e) {
|
|
8
|
-
s(this, e), this.prismChange = c(this, "prismChange", 7), this.uid = o(), this.toggleSelections = (i) => {
|
|
9
|
-
this.checkBoxes.forEach((t) => {
|
|
10
|
-
i.detail.checked ? t.checked = !0 : t.checked = !1;
|
|
11
|
-
});
|
|
12
|
-
}, this.name = void 0, this.loading = !1, this.prismId = `prism-checkbox-group-${this.uid}`, this.variant = "static", this.expanded = !0;
|
|
13
|
-
}
|
|
14
|
-
connectedCallback() {
|
|
15
|
-
h("prism-checkbox-group");
|
|
16
|
-
}
|
|
17
|
-
_setParentUnchecked() {
|
|
18
|
-
this.parentCheckbox.checked = !1, this.parentCheckbox.indeterminate = !1;
|
|
19
|
-
}
|
|
20
|
-
_setParentChecked() {
|
|
21
|
-
this.parentCheckbox.checked = !0, this.parentCheckbox.indeterminate = !1;
|
|
22
|
-
}
|
|
23
|
-
_setParentIndeterminate() {
|
|
24
|
-
this.parentCheckbox.checked = !1, this.parentCheckbox.indeterminate = !0;
|
|
25
|
-
}
|
|
26
|
-
_setParentCheckbox() {
|
|
27
|
-
const e = this.checkBoxes.length, i = this.checkBoxes.filter((t) => t.checked === !0).length;
|
|
28
|
-
return i === 0 ? this._setParentUnchecked() : i === e ? this._setParentChecked() : this._setParentIndeterminate();
|
|
29
|
-
}
|
|
30
|
-
componentDidRender() {
|
|
31
|
-
this.checkBoxes = Array.from(this.checkboxCollection.getElementsByTagName("prism-checkbox")), this.checkBoxes.forEach((e) => {
|
|
32
|
-
this.loading ? e.setAttribute("disabled", "true") : e.removeAttribute("disabled");
|
|
33
|
-
}), this._setParentCheckbox();
|
|
34
|
-
}
|
|
35
|
-
onCheckboxChange(e) {
|
|
36
|
-
const i = e.detail, t = i.target;
|
|
37
|
-
i.target.id !== this.prismId && (this._setParentCheckbox(), this.prismChange.emit({
|
|
38
|
-
name: "checkbox-group-changed",
|
|
39
|
-
checked: t.checked,
|
|
40
|
-
group: t.name,
|
|
41
|
-
id: t.id,
|
|
42
|
-
invalid: t.invalid,
|
|
43
|
-
loading: t.loading,
|
|
44
|
-
target: t,
|
|
45
|
-
value: t.value
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
48
|
-
render() {
|
|
49
|
-
return a(r, { key: "a14a1de5e8adebfeefe2c766d1303051709175fb" }, a("span", { key: "964a7e842881b182edceb0ce2a694554a651e2b3", class: "group-row" }, a("prism-checkbox", { key: "a164bc10a36329078a08ae16199bf9cb39efe98b", ref: (e) => this.parentCheckbox = e, prismId: this.prismId, loading: this.loading, onPrismInput: (e) => this.toggleSelections(e), name: this.name, class: "parent" }), this.variant === "tree" && a("prism-button", { key: "8b8a23ba3a8a86a721969ffcee17cf5ccf4a7f71", class: "toggle", onPrismClick: () => this.expanded = !this.expanded, expanded: this.expanded, size: "xs", display: "ghost-icon", label: `toggle ${this.name}` }, " ", a("prism-icon", { key: "3eb5e14682ca8a1e5192932edbd52a8ecfb70c94", "aria-hidden": "true", priority: "secondary", display: "outline", name: this.expanded ? "caret_up_button" : "caret_down_button" }))), a("div", { key: "6834fd881abc643a76392b7d52da508ccc7a280d", role: "group", "aria-label": this.name, "aria-hidden": this.expanded && this.variant === "tree" ? "false" : this.variant === "tree" ? "true" : null, ref: (e) => this.checkboxCollection = e, class: {
|
|
50
|
-
options: !0,
|
|
51
|
-
"expandable-content": this.variant === "tree",
|
|
52
|
-
visible: this.expanded && this.variant === "tree"
|
|
53
|
-
} }, a("slot", { key: "9a6942344271a6ca9921fdee014d5b04f122d376" })));
|
|
54
|
-
}
|
|
55
|
-
get el() {
|
|
56
|
-
return n(this);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
m.style = d;
|
|
60
|
-
export {
|
|
61
|
-
m as prism_checkbox_group
|
|
62
|
-
};
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { r as s, c, h as r, H as t } from "./index-D9BZSjMp.js";
|
|
2
|
-
import { g as a, m as o } from "./index-44540db3-BN5vFHKr.js";
|
|
3
|
-
import { A as n } from "./index-4d46d9ca-BtyZMEt1.js";
|
|
4
|
-
/*!
|
|
5
|
-
* Copyright (c) 2025 Comcast. Prism UI - v8.28.0 - made with ❤️ in Philadelphia
|
|
6
|
-
*/
|
|
7
|
-
const h = '.sr-input.sc-prism-checkbox{margin:0;opacity:0;overflow:hidden;padding:0;position:absolute!important;visibility:visible}.sc-prism-checkbox-h{display:block;margin:var(--prism-checkbox-spacing-margin,var(--prism-spacer-size-lg) 0);position:relative;width:auto}.screen-reader-text.sc-prism-checkbox{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.label.sc-prism-checkbox{grid-column-gap:var(--prism-spacer-size-lg);align-items:center;-moz-column-gap:var(--prism-spacer-size-lg);column-gap:var(--prism-spacer-size-lg);display:grid;grid-template-areas:"checkbox label" "checkbox hint";grid-template-columns:-webkit-max-content 1fr;grid-template-columns:max-content 1fr;grid-template-rows:1fr}.no-visual.label.sc-prism-checkbox{gap:0}.label.right.sc-prism-checkbox{grid-template-areas:"label checkbox" "hint checkbox"}.label.sc-prism-checkbox:not(.loading):hover{cursor:pointer}.input.sc-prism-checkbox:hover+.label.sc-prism-checkbox .checkbox.checked.sc-prism-checkbox,.input.sc-prism-checkbox:hover+.label.sc-prism-checkbox .checkbox.indeterminate.sc-prism-checkbox,.label.sc-prism-checkbox:hover .checkbox.checked.sc-prism-checkbox,.label.sc-prism-checkbox:hover .checkbox.indeterminate.sc-prism-checkbox{background-color:var(--prism-color-fill-brand-primary-hover);border-color:var(--prism-color-border-brand-primary-hover)}.input[disabled].sc-prism-checkbox:hover,.label.disabled.sc-prism-checkbox:hover{cursor:not-allowed}.label-text.sc-prism-checkbox{color:var(--prism-color-text-primary-base);display:inline-block;grid-area:label;vertical-align:middle}.input.sc-prism-checkbox:hover+.label.sc-prism-checkbox:not(.loading) .checkbox.sc-prism-checkbox:not(.checked):not(.invalid){border-color:var(--prism-color-border-secondary-hover)}.checkbox.sc-prism-checkbox{background-color:var(--prism-color-material-primary-base);border-color:var(--prism-color-border-secondary-base);border-radius:var(--prism-radius-size-sm);border-style:solid;border-width:1px;display:inline-block;flex-shrink:0;grid-area:checkbox;height:1.5rem;outline:2px solid transparent;outline-offset:var(--prism-spacer-size-xxs);pointer-events:none;text-align:center;transition:all var(--prism-animation-duration-normal) var(--prism-animation-timing-function);vertical-align:middle;width:1.5rem}.loading.sc-prism-checkbox .checkbox.sc-prism-checkbox{align-items:center;border-color:color-mix(in srgb,var(--prism-color-border-secondary-base) var(--prism-alpha-inactive-percentage),transparent);color:var(--prism-color-text-secondary-base);display:flex;justify-content:center}.input.sc-prism-checkbox{border-style:solid;border-width:1px;cursor:pointer;height:1.5rem;left:var(--prism-spacer-size-xxs);margin:0;opacity:0;overflow:hidden;padding:0;position:absolute;top:var(--prism-spacer-size-xxs);transition:all var(--prism-animation-duration-normal) var(--prism-animation-timing-function);visibility:visible;width:1.5rem}.sc-prism-checkbox-h:focus-within .label.sc-prism-checkbox:not(.loading) .checkbox.sc-prism-checkbox{outline:var(--prism-spacer-size-3xs) solid var(--prism-color-border-secondary-focus)}.sc-prism-checkbox-h:focus-within .label.sc-prism-checkbox:not(.loading) .checkbox.sc-prism-checkbox:not(.invalid){border-color:var(--prism-color-border-secondary-focus)}.sc-prism-checkbox-h:focus-within .label.sc-prism-checkbox:not(.loading) .checked.sc-prism-checkbox,.sc-prism-checkbox-h:focus-within .label.sc-prism-checkbox:not(.loading) .indeterminate.sc-prism-checkbox{background-color:var(--prism-color-fill-brand-primary-focus);border-color:var(--prism-color-border-brand-primary-focus);outline-color:var(--prism-color-border-brand-primary-base)}.checked.sc-prism-checkbox,.indeterminate.sc-prism-checkbox{align-items:center;background-color:var(--prism-color-fill-brand-primary-base);border-width:0;display:inline-flex;justify-content:center}.checked.sc-prism-checkbox,.indeterminate.sc-prism-checkbox,.loading.sc-prism-checkbox .checked.sc-prism-checkbox{color:var(--prism-color-text-primary-inverse-base)}.loading.sc-prism-checkbox .checked.sc-prism-checkbox{border-color:color-mix(in srgb,var(--prism-color-border-brand-primary-base) var(--prism-alpha-inactive-percentage),transparent)}.invalid.sc-prism-checkbox,.invalid.checked.sc-prism-checkbox,.invalid.indeterminate.sc-prism-checkbox{border-color:var(--prism-color-border-danger-base)}.invalid.checked.sc-prism-checkbox,.invalid.indeterminate.sc-prism-checkbox{background-color:var(--prism-color-fill-danger-base)}.input.sc-prism-checkbox:hover+.label.sc-prism-checkbox .invalid.sc-prism-checkbox{border-color:var(--prism-color-border-danger-hover)}.input.sc-prism-checkbox:hover+.label.sc-prism-checkbox .invalid.checked.sc-prism-checkbox,.input.sc-prism-checkbox:hover+.label.sc-prism-checkbox .invalid.indeterminate.sc-prism-checkbox{background-color:var(--prism-color-fill-danger-hover)}.sc-prism-checkbox-h:focus-within .label.sc-prism-checkbox .invalid.sc-prism-checkbox{border-color:var(--prism-color-border-danger-focus)}.sc-prism-checkbox-h:focus-within .label.sc-prism-checkbox .invalid.checked.sc-prism-checkbox,.sc-prism-checkbox-h:focus-within .label.sc-prism-checkbox .invalid.indeterminate.sc-prism-checkbox{background-color:var(--prism-color-fill-danger-focus);outline-color:var(--prism-color-border-danger-focus)}.disabled.sc-prism-checkbox{cursor:not-allowed;opacity:var(--prism-alpha-disabled)}.icon.sc-prism-checkbox{color:var(--prism-color-text-primary-inverse-base);display:block;height:1rem;width:1rem}.hint-container.sc-prism-checkbox{align-items:center;display:flex;margin-top:.25rem}.hint-container.sc-prism-checkbox>.sc-prism-checkbox:not([hidden])~.sc-prism-checkbox:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.25rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.25rem*var(--tw-space-x-reverse))}.hint-text.sc-prism-checkbox{display:block;grid-area:hint;text-align:left}.invalid-text.sc-prism-checkbox{color:var(--prism-color-text-danger-base)}.loading.sc-prism-checkbox{cursor:wait;pointer-events:none}@media (prefers-reduced-motion:reduce){.checkbox.sc-prism-checkbox{transition:none}}', d = h, l = class {
|
|
8
|
-
constructor(i) {
|
|
9
|
-
s(this, i), this.prismChange = c(this, "prismChange", 7), this.prismWatch = c(this, "prismWatch", 7), this.prismInput = c(this, "prismInput", 7), this.prismBlur = c(this, "prismBlur", 7), this.prismFocus = c(this, "prismFocus", 7), this.uid = a(), this.isDirty = !1, this.prismId = `prism-checkbox-${this.uid}`, this.name = this.prismId, this.label = this.name.charAt(0).toUpperCase() + this.name.replace(/-/g, " ").substring(1), this.checked = !1, this.indeterminate = !1, this.required = !1, this.disabled = !1, this.loading = !1, this.hideLabel = !1, this.hideInvalid = !1, this.hint = void 0, this.invalid = !1, this.value = void 0, this.invalidMessage = "This field is required", this.describedby = "", this.alignment = "left", this.validation = "native", this.hintId = `${this.prismId}-hint`, this.customDescribedBy = void 0;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* @description Public: Set Focus on Input
|
|
13
|
-
*/
|
|
14
|
-
async setFocus() {
|
|
15
|
-
this.element && this.element.focus();
|
|
16
|
-
}
|
|
17
|
-
watchChecked(i) {
|
|
18
|
-
this.prismWatch.emit({
|
|
19
|
-
name: "checked-changed",
|
|
20
|
-
id: this.prismId,
|
|
21
|
-
checked: i,
|
|
22
|
-
indeterminate: this.indeterminate,
|
|
23
|
-
invalid: this.invalid,
|
|
24
|
-
value: this.value,
|
|
25
|
-
target: this.element,
|
|
26
|
-
type: "checkbox"
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Listen to Reset Events
|
|
31
|
-
*/
|
|
32
|
-
handleReset() {
|
|
33
|
-
this.checked = !1;
|
|
34
|
-
}
|
|
35
|
-
/** @internal Emit onChange of Value Event */
|
|
36
|
-
valueChanged(i) {
|
|
37
|
-
this.prismChange.emit({
|
|
38
|
-
name: "value-changed",
|
|
39
|
-
checked: this.checked,
|
|
40
|
-
indeterminate: this.indeterminate,
|
|
41
|
-
invalid: this.invalid,
|
|
42
|
-
value: i.target.value,
|
|
43
|
-
type: "checkbox"
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
/** @internal Native Event Handling */
|
|
47
|
-
inputChanged(i) {
|
|
48
|
-
this.isDirty = !0, this.customDescribedBy = `${this.hintId} ${this.describedby}`.trim();
|
|
49
|
-
let e = i.currentTarget;
|
|
50
|
-
this.checked = e.checked, this.checked && (this.indeterminate = !1), this.prismInput.emit({
|
|
51
|
-
name: "input-change",
|
|
52
|
-
checked: this.checked,
|
|
53
|
-
indeterminate: this.indeterminate,
|
|
54
|
-
invalid: this.invalid,
|
|
55
|
-
value: e.value,
|
|
56
|
-
type: "checkbox",
|
|
57
|
-
target: e
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
onCheckValidity(i) {
|
|
61
|
-
i.preventDefault();
|
|
62
|
-
let e = i.currentTarget;
|
|
63
|
-
this.validation === "native" && (this.invalid = !e.validity.valid), this.customDescribedBy = `${this.hintId} ${this.describedby}`.trim(), this.prismChange.emit({ name: "check-validity", checked: this.checked, target: e, reason: e.validity });
|
|
64
|
-
}
|
|
65
|
-
// Input has focus or blurred
|
|
66
|
-
inputState(i) {
|
|
67
|
-
let e = i.currentTarget;
|
|
68
|
-
switch (i.type) {
|
|
69
|
-
case "blur":
|
|
70
|
-
this.isDirty && this.validation === "native" && (this.invalid = !e.validity.valid), this.prismBlur.emit({
|
|
71
|
-
name: "input-blurred",
|
|
72
|
-
checked: this.checked,
|
|
73
|
-
type: "checkbox",
|
|
74
|
-
value: e.value,
|
|
75
|
-
target: e
|
|
76
|
-
});
|
|
77
|
-
break;
|
|
78
|
-
case "focus":
|
|
79
|
-
this.prismFocus.emit({
|
|
80
|
-
name: "input-focused",
|
|
81
|
-
checked: this.checked,
|
|
82
|
-
type: "checkbox",
|
|
83
|
-
value: e.value,
|
|
84
|
-
target: e
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Listen to Keydown Events
|
|
90
|
-
*/
|
|
91
|
-
inputKeyDown(i) {
|
|
92
|
-
this.loading && i.key === " " && i.preventDefault();
|
|
93
|
-
}
|
|
94
|
-
connectedCallback() {
|
|
95
|
-
this.customDescribedBy = this.hint ? `${this.hintId} ${this.describedby}`.trim() : this.describedby, o("prism-checkbox");
|
|
96
|
-
}
|
|
97
|
-
render() {
|
|
98
|
-
const i = this.invalid;
|
|
99
|
-
return r(t, { key: "75531849391de2eb30a083fae2bcc3a2c93d96de" }, r("input", { key: "cd83535ced64ae00d8739d209e4a1b5bfc9c94f2", onInput: (e) => this.inputChanged(e), onChange: (e) => this.valueChanged(e), onInvalid: (e) => this.onCheckValidity(e), onBlur: (e) => this.inputState(e), onFocus: (e) => this.inputState(e), onKeyDown: (e) => this.inputKeyDown(e), checked: this.checked, indeterminate: this.indeterminate, id: this.prismId, ref: (e) => this.element = e, name: this.name.replace(/ /g, "-"), type: "checkbox", disabled: this.disabled, required: this.required, "aria-invalid": this.invalid.toString(), "aria-required": this.required.toString(), "aria-describedby": this.customDescribedBy ? this.customDescribedBy : !1, value: this.value, class: { input: !0, loading: this.loading } }), r("label", { key: "5cbb0d9b778dd2cabdc132f018bfcdc8c5fae15b", class: { label: !0, disabled: this.disabled, loading: this.loading, [this.alignment]: !0, "no-visual": this.hideLabel }, htmlFor: this.prismId }, r("span", { key: "9ee44e01be89782b6facc930cc774ac1e1ea3d2e", class: { checkbox: !0, checked: this.checked, indeterminate: this.indeterminate, invalid: this.invalid } }, this.loading && r("prism-loading", { key: "65cb120191326acde572f77270d59e9e1f9d3f9e", as: "spinner", size: "sm" }), this.checked && !this.loading && r("prism-icon", { key: "55f13a8a96de3ce9adf3dd49e8e20b9e744a8914", tone: "primary-inverse", display: "outline", size: "sm", name: "check" }), this.indeterminate && r("prism-icon", { key: "4035de208983a8a7187a8816d7fb42523b0dd416", tone: "primary-inverse", display: "outline", size: "sm", name: "minus" })), r("prism-text", { key: "88d227507f4d31a89e5505db09a09ee76595d1e6", family: "body", size: "400", class: { "label-text": !0, "screen-reader-text": this.hideLabel } }, this.label, this.required && r(n, { key: "55a3e2724ad4c07fe4b7e46027a8046339ba089e" })), this.hint && r("prism-text", { key: "223b4814ebae074b3ed8405db5b2d780a9621512", as: "caption", priority: "secondary", class: { "hint-text": !0, "screen-reader-text": this.hideLabel } }, this.hint)), r("span", { key: "bb1f1a859b4e9aff867eb8404d5488bdd8139ad3", "aria-live": "polite", id: this.hintId }, i && r("span", { key: "d87c25b5cd8c110ac3b57b6fbff82941e9f6afbf", class: {
|
|
100
|
-
"hint-container": !0,
|
|
101
|
-
"screen-reader-text": this.invalid && this.hideInvalid
|
|
102
|
-
} }, this.invalid && r("prism-icon", { key: "2675f21caa0a524048ea2da83b22a8039c9d5440", display: "fill", slot: "icon-trailing", size: "xs", tone: "danger", name: "alert" }), r("prism-text", { key: "5f1da372389b849612efd71666e42560816b902e", class: {
|
|
103
|
-
"invalid-text": this.invalid,
|
|
104
|
-
"hint-text": !0
|
|
105
|
-
}, as: "caption" }, this.invalidMessage))));
|
|
106
|
-
}
|
|
107
|
-
static get watchers() {
|
|
108
|
-
return {
|
|
109
|
-
checked: ["watchChecked"]
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
l.style = d;
|
|
114
|
-
export {
|
|
115
|
-
l as prism_checkbox
|
|
116
|
-
};
|