@justeattakeaway/pie-button 0.45.0 → 0.45.2
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/index.js +550 -547
- package/package.json +5 -5
- package/src/react.ts +2 -3
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { property as
|
|
3
|
-
import { ifDefined as
|
|
4
|
-
import { FormControlMixin as
|
|
1
|
+
import { LitElement as zt, html as N, nothing as B, unsafeCSS as Ct } from "lit";
|
|
2
|
+
import { property as m } from "lit/decorators.js";
|
|
3
|
+
import { ifDefined as St } from "lit/directives/if-defined.js";
|
|
4
|
+
import { FormControlMixin as Ft, validPropertyValues as P, defineCustomElement as Lt } from "@justeattakeaway/pie-webc-core";
|
|
5
5
|
import "@justeattakeaway/pie-spinner";
|
|
6
|
-
const
|
|
6
|
+
const At = ["xsmall", "small-productive", "small-expressive", "medium", "large"], Bt = ["productive", "expressive"], It = ["submit", "button", "reset"], Tt = [
|
|
7
7
|
"primary",
|
|
8
8
|
"secondary",
|
|
9
9
|
"outline",
|
|
@@ -13,513 +13,516 @@ const Mt = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
13
13
|
"ghost-inverse",
|
|
14
14
|
"destructive",
|
|
15
15
|
"destructive-ghost"
|
|
16
|
-
], Ft = ["leading", "trailing"], Dt = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], $t = ["post", "get", "dialog"], Ot = ["_self", "_blank", "_parent", "_top"], St = `*,*:before,*:after{box-sizing:border-box}.o-btn{--btn-border-radius: var(--dt-radius-rounded-e);--btn-font-family: var(--dt-font-interactive-m-family);--btn-font-weight: var(--dt-font-interactive-m-weight);--btn-bg-color: var(--dt-color-interactive-brand);--btn-text-color: var(--dt-color-content-interactive-primary);--btn-height--xsmall: 32px;--btn-height--small: 40px;--btn-height--medium: 48px;--btn-height--large: 56px;--icon-display-override: block;position:relative;display:flex;gap:var(--dt-spacing-b);align-items:center;justify-content:center;box-sizing:border-box;height:var(--btn-height);padding:var(--btn-padding);border:none;border-radius:var(--btn-border-radius);outline:none;background-color:var(--btn-bg-color);font-family:var(--btn-font-family);font-size:var(--btn-font-size);font-weight:var(--btn-font-weight);color:var(--btn-text-color);line-height:var(--btn-line-height);cursor:pointer;user-select:none;inline-size:var(--btn-inline-size)}.o-btn[variant=primary]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--hover-modifier)))}.o-btn[variant=primary]:active:not(:disabled),.o-btn[variant=primary][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--active-modifier)))}.o-btn[variant=primary][size=xsmall],.o-btn[variant=primary][size=small-productive]{--btn-bg-color: var(--dt-color-interactive-primary)}.o-btn[variant=primary][size=xsmall]:hover:not(:disabled),.o-btn[variant=primary][size=small-productive]:hover:not(:disabled){--hover-modifier: var(--dt-color-hover-02);--btn-bg-color: hsl(var(--dt-color-interactive-primary-h), var(--dt-color-interactive-primary-s), calc(var(--dt-color-interactive-primary-l) + var(--hover-modifier)))}.o-btn[variant=primary][size=xsmall]:active:not(:disabled),.o-btn[variant=primary][size=xsmall][isLoading]:not(:disabled),.o-btn[variant=primary][size=small-productive]:active:not(:disabled),.o-btn[variant=primary][size=small-productive][isLoading]:not(:disabled){--active-modifier: var(--dt-color-active-02);--btn-bg-color: hsl(var(--dt-color-interactive-primary-h), var(--dt-color-interactive-primary-s), calc(var(--dt-color-interactive-primary-l) + var(--active-modifier)))}.o-btn[variant=secondary]{--btn-bg-color: var(--dt-color-interactive-secondary);--btn-text-color: var(--dt-color-content-interactive-secondary)}.o-btn[variant=secondary]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-secondary-h), var(--dt-color-interactive-secondary-s), calc(var(--dt-color-interactive-secondary-l) + var(--hover-modifier)))}.o-btn[variant=secondary]:active:not(:disabled),.o-btn[variant=secondary][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-secondary-h), var(--dt-color-interactive-secondary-s), calc(var(--dt-color-interactive-secondary-l) + var(--active-modifier)))}.o-btn[variant=outline]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-secondary);border:1px solid var(--dt-color-border-strong)}.o-btn[variant=outline]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn[variant=outline]:active:not(:disabled),.o-btn[variant=outline][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn[variant=ghost]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-link)}.o-btn[variant=ghost]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn[variant=ghost]:active:not(:disabled),.o-btn[variant=ghost][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn[variant=inverse]{--btn-bg-color: var(--dt-color-interactive-inverse);--btn-text-color: var(--dt-color-content-interactive-secondary)}.o-btn[variant=inverse]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-inverse-h), var(--dt-color-interactive-inverse-s), calc(var(--dt-color-interactive-inverse-l) + var(--hover-modifier)))}.o-btn[variant=inverse]:active:not(:disabled),.o-btn[variant=inverse][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-inverse-h), var(--dt-color-interactive-inverse-s), calc(var(--dt-color-interactive-inverse-l) + var(--active-modifier)))}.o-btn[variant=ghost-inverse],.o-btn[variant=outline-inverse]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-primary)}.o-btn[variant=ghost-inverse]:hover:not(:disabled),.o-btn[variant=outline-inverse]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), var(--dt-color-container-default-l), var(--hover-modifier))}.o-btn[variant=ghost-inverse]:active:not(:disabled),.o-btn[variant=ghost-inverse][isLoading]:not(:disabled),.o-btn[variant=outline-inverse]:active:not(:disabled),.o-btn[variant=outline-inverse][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), var(--dt-color-container-default-l), var(--active-modifier))}.o-btn[variant=outline-inverse]:not([disabled]){border:1px solid var(--dt-color-border-strong)}.o-btn[variant=destructive]{--btn-bg-color: var(--dt-color-support-error)}.o-btn[variant=destructive]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-support-error-h), var(--dt-color-support-error-s), calc(var(--dt-color-support-error-l) + var(--hover-modifier)))}.o-btn[variant=destructive]:active:not(:disabled),.o-btn[variant=destructive][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-support-error-h), var(--dt-color-support-error-s), calc(var(--dt-color-support-error-l) + var(--active-modifier)))}.o-btn[variant=destructive-ghost]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-error)}.o-btn[variant=destructive-ghost]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn[variant=destructive-ghost]:active:not(:disabled),.o-btn[variant=destructive-ghost][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn[isFullWidth]{--btn-inline-size: 100%}.o-btn[disabled]{--btn-text-color: var(--dt-color-content-disabled) !important;cursor:not-allowed}.o-btn[disabled]:not([variant=ghost],[variant=ghost-inverse],[variant=destructive-ghost]){--btn-bg-color: var(--dt-color-disabled-01) !important}.o-btn[disabled][variant=outline]{border-color:var(--dt-color-disabled-01)!important}.o-btn[size=xsmall]{--btn-height: var(--btn-height--xsmall);--btn-padding: 6px var(--dt-spacing-b);--btn-font-size: calc(var(--dt-font-size-14) * 1px);--btn-line-height: calc(var(--dt-font-size-14-line-height) * 1px);--icon-size-override: 16px}@media (min-width: 768px){.o-btn[size=xsmall][isResponsive]{--btn-height: var(--btn-height--small);--btn-padding: 8px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-16) * 1px);--btn-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--icon-size-override: 20px}.o-btn[size=xsmall][isResponsive][responsiveSize=expressive]{--btn-height: var(--btn-height--small);--btn-padding: 6px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 20px}}.o-btn[size=small-expressive]{--btn-height: var(--btn-height--small);--btn-padding: 6px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 20px}@media (min-width: 768px){.o-btn[size=small-expressive][isResponsive]{--btn-height: var(--btn-height--medium);--btn-padding: 10px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}}.o-btn[size=small-productive]{--btn-height: var(--btn-height--small);--btn-padding: 8px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-16) * 1px);--btn-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--icon-size-override: 20px}@media (min-width: 768px){.o-btn[size=small-productive][isResponsive]{--btn-height: var(--btn-height--medium);--btn-padding: 10px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}}.o-btn[size=medium]{--btn-height: var(--btn-height--medium);--btn-padding: 10px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}@media (min-width: 768px){.o-btn[size=medium][isResponsive]{--btn-height: var(--btn-height--large);--btn-padding: 14px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}}.o-btn[size=large]{--btn-height: var(--btn-height--large);--btn-padding: 14px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}.o-btn[isLoading]>*:not(pie-spinner){visibility:hidden}.o-btn[isLoading] pie-spinner{position:absolute}.o-btn:focus-visible{box-shadow:0 0 0 2px var(--dt-color-focus-inner),0 0 0 4px var(--dt-color-focus-outer);outline:none}::slotted(svg){height:var(--icon-size-override);width:var(--icon-size-override)}
|
|
16
|
+
], Vt = ["leading", "trailing"], Kt = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], Ut = ["post", "get", "dialog"], qt = ["_self", "_blank", "_parent", "_top"], Nt = `*,*:before,*:after{box-sizing:border-box}.o-btn{--btn-border-radius: var(--dt-radius-rounded-e);--btn-font-family: var(--dt-font-interactive-m-family);--btn-font-weight: var(--dt-font-interactive-m-weight);--btn-bg-color: var(--dt-color-interactive-brand);--btn-text-color: var(--dt-color-content-interactive-primary);--btn-height--xsmall: 32px;--btn-height--small: 40px;--btn-height--medium: 48px;--btn-height--large: 56px;--icon-display-override: block;position:relative;display:flex;gap:var(--dt-spacing-b);align-items:center;justify-content:center;box-sizing:border-box;height:var(--btn-height);padding:var(--btn-padding);border:none;border-radius:var(--btn-border-radius);outline:none;background-color:var(--btn-bg-color);font-family:var(--btn-font-family);font-size:var(--btn-font-size);font-weight:var(--btn-font-weight);color:var(--btn-text-color);line-height:var(--btn-line-height);cursor:pointer;user-select:none;inline-size:var(--btn-inline-size)}.o-btn[variant=primary]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--hover-modifier)))}.o-btn[variant=primary]:active:not(:disabled),.o-btn[variant=primary][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--active-modifier)))}.o-btn[variant=primary][size=xsmall],.o-btn[variant=primary][size=small-productive]{--btn-bg-color: var(--dt-color-interactive-primary)}.o-btn[variant=primary][size=xsmall]:hover:not(:disabled),.o-btn[variant=primary][size=small-productive]:hover:not(:disabled){--hover-modifier: var(--dt-color-hover-02);--btn-bg-color: hsl(var(--dt-color-interactive-primary-h), var(--dt-color-interactive-primary-s), calc(var(--dt-color-interactive-primary-l) + var(--hover-modifier)))}.o-btn[variant=primary][size=xsmall]:active:not(:disabled),.o-btn[variant=primary][size=xsmall][isLoading]:not(:disabled),.o-btn[variant=primary][size=small-productive]:active:not(:disabled),.o-btn[variant=primary][size=small-productive][isLoading]:not(:disabled){--active-modifier: var(--dt-color-active-02);--btn-bg-color: hsl(var(--dt-color-interactive-primary-h), var(--dt-color-interactive-primary-s), calc(var(--dt-color-interactive-primary-l) + var(--active-modifier)))}.o-btn[variant=secondary]{--btn-bg-color: var(--dt-color-interactive-secondary);--btn-text-color: var(--dt-color-content-interactive-secondary)}.o-btn[variant=secondary]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-secondary-h), var(--dt-color-interactive-secondary-s), calc(var(--dt-color-interactive-secondary-l) + var(--hover-modifier)))}.o-btn[variant=secondary]:active:not(:disabled),.o-btn[variant=secondary][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-secondary-h), var(--dt-color-interactive-secondary-s), calc(var(--dt-color-interactive-secondary-l) + var(--active-modifier)))}.o-btn[variant=outline]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-secondary);border:1px solid var(--dt-color-border-strong)}.o-btn[variant=outline]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn[variant=outline]:active:not(:disabled),.o-btn[variant=outline][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn[variant=ghost]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-link)}.o-btn[variant=ghost]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn[variant=ghost]:active:not(:disabled),.o-btn[variant=ghost][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn[variant=inverse]{--btn-bg-color: var(--dt-color-interactive-inverse);--btn-text-color: var(--dt-color-content-interactive-secondary)}.o-btn[variant=inverse]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-inverse-h), var(--dt-color-interactive-inverse-s), calc(var(--dt-color-interactive-inverse-l) + var(--hover-modifier)))}.o-btn[variant=inverse]:active:not(:disabled),.o-btn[variant=inverse][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-inverse-h), var(--dt-color-interactive-inverse-s), calc(var(--dt-color-interactive-inverse-l) + var(--active-modifier)))}.o-btn[variant=ghost-inverse],.o-btn[variant=outline-inverse]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-primary)}.o-btn[variant=ghost-inverse]:hover:not(:disabled),.o-btn[variant=outline-inverse]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), var(--dt-color-container-default-l), var(--hover-modifier))}.o-btn[variant=ghost-inverse]:active:not(:disabled),.o-btn[variant=ghost-inverse][isLoading]:not(:disabled),.o-btn[variant=outline-inverse]:active:not(:disabled),.o-btn[variant=outline-inverse][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), var(--dt-color-container-default-l), var(--active-modifier))}.o-btn[variant=outline-inverse]:not([disabled]){border:1px solid var(--dt-color-border-strong)}.o-btn[variant=destructive]{--btn-bg-color: var(--dt-color-support-error)}.o-btn[variant=destructive]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-support-error-h), var(--dt-color-support-error-s), calc(var(--dt-color-support-error-l) + var(--hover-modifier)))}.o-btn[variant=destructive]:active:not(:disabled),.o-btn[variant=destructive][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-support-error-h), var(--dt-color-support-error-s), calc(var(--dt-color-support-error-l) + var(--active-modifier)))}.o-btn[variant=destructive-ghost]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-error)}.o-btn[variant=destructive-ghost]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn[variant=destructive-ghost]:active:not(:disabled),.o-btn[variant=destructive-ghost][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn[isFullWidth]{--btn-inline-size: 100%}.o-btn[disabled]{--btn-text-color: var(--dt-color-content-disabled) !important;cursor:not-allowed}.o-btn[disabled]:not([variant=ghost],[variant=ghost-inverse],[variant=destructive-ghost]){--btn-bg-color: var(--dt-color-disabled-01) !important}.o-btn[disabled][variant=outline]{border-color:var(--dt-color-disabled-01)!important}.o-btn[size=xsmall]{--btn-height: var(--btn-height--xsmall);--btn-padding: 6px var(--dt-spacing-b);--btn-font-size: calc(var(--dt-font-size-14) * 1px);--btn-line-height: calc(var(--dt-font-size-14-line-height) * 1px);--icon-size-override: 16px}@media (min-width: 768px){.o-btn[size=xsmall][isResponsive]{--btn-height: var(--btn-height--small);--btn-padding: 8px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-16) * 1px);--btn-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--icon-size-override: 20px}.o-btn[size=xsmall][isResponsive][responsiveSize=expressive]{--btn-height: var(--btn-height--small);--btn-padding: 6px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 20px}}.o-btn[size=small-expressive]{--btn-height: var(--btn-height--small);--btn-padding: 6px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 20px}@media (min-width: 768px){.o-btn[size=small-expressive][isResponsive]{--btn-height: var(--btn-height--medium);--btn-padding: 10px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}}.o-btn[size=small-productive]{--btn-height: var(--btn-height--small);--btn-padding: 8px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-16) * 1px);--btn-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--icon-size-override: 20px}@media (min-width: 768px){.o-btn[size=small-productive][isResponsive]{--btn-height: var(--btn-height--medium);--btn-padding: 10px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}}.o-btn[size=medium]{--btn-height: var(--btn-height--medium);--btn-padding: 10px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}@media (min-width: 768px){.o-btn[size=medium][isResponsive]{--btn-height: var(--btn-height--large);--btn-padding: 14px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}}.o-btn[size=large]{--btn-height: var(--btn-height--large);--btn-padding: 14px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}.o-btn[isLoading]>*:not(pie-spinner){visibility:hidden}.o-btn[isLoading] pie-spinner{position:absolute}.o-btn:focus-visible{box-shadow:0 0 0 2px var(--dt-color-focus-inner),0 0 0 4px var(--dt-color-focus-outer);outline:none}::slotted(svg){height:var(--icon-size-override);width:var(--icon-size-override)}
|
|
17
17
|
`;
|
|
18
18
|
(function() {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
19
|
+
(function(E) {
|
|
20
|
+
const a = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), A = {
|
|
21
|
+
ariaAtomic: "aria-atomic",
|
|
22
|
+
ariaAutoComplete: "aria-autocomplete",
|
|
23
|
+
ariaBusy: "aria-busy",
|
|
24
|
+
ariaChecked: "aria-checked",
|
|
25
|
+
ariaColCount: "aria-colcount",
|
|
26
|
+
ariaColIndex: "aria-colindex",
|
|
27
|
+
ariaColIndexText: "aria-colindextext",
|
|
28
|
+
ariaColSpan: "aria-colspan",
|
|
29
|
+
ariaCurrent: "aria-current",
|
|
30
|
+
ariaDisabled: "aria-disabled",
|
|
31
|
+
ariaExpanded: "aria-expanded",
|
|
32
|
+
ariaHasPopup: "aria-haspopup",
|
|
33
|
+
ariaHidden: "aria-hidden",
|
|
34
|
+
ariaInvalid: "aria-invalid",
|
|
35
|
+
ariaKeyShortcuts: "aria-keyshortcuts",
|
|
36
|
+
ariaLabel: "aria-label",
|
|
37
|
+
ariaLevel: "aria-level",
|
|
38
|
+
ariaLive: "aria-live",
|
|
39
|
+
ariaModal: "aria-modal",
|
|
40
|
+
ariaMultiLine: "aria-multiline",
|
|
41
|
+
ariaMultiSelectable: "aria-multiselectable",
|
|
42
|
+
ariaOrientation: "aria-orientation",
|
|
43
|
+
ariaPlaceholder: "aria-placeholder",
|
|
44
|
+
ariaPosInSet: "aria-posinset",
|
|
45
|
+
ariaPressed: "aria-pressed",
|
|
46
|
+
ariaReadOnly: "aria-readonly",
|
|
47
|
+
ariaRelevant: "aria-relevant",
|
|
48
|
+
ariaRequired: "aria-required",
|
|
49
|
+
ariaRoleDescription: "aria-roledescription",
|
|
50
|
+
ariaRowCount: "aria-rowcount",
|
|
51
|
+
ariaRowIndex: "aria-rowindex",
|
|
52
|
+
ariaRowIndexText: "aria-rowindextext",
|
|
53
|
+
ariaRowSpan: "aria-rowspan",
|
|
54
|
+
ariaSelected: "aria-selected",
|
|
55
|
+
ariaSetSize: "aria-setsize",
|
|
56
|
+
ariaSort: "aria-sort",
|
|
57
|
+
ariaValueMax: "aria-valuemax",
|
|
58
|
+
ariaValueMin: "aria-valuemin",
|
|
59
|
+
ariaValueNow: "aria-valuenow",
|
|
60
|
+
ariaValueText: "aria-valuetext",
|
|
61
|
+
role: "role"
|
|
62
|
+
}, ct = (e, t) => {
|
|
63
|
+
for (let i in A) {
|
|
64
|
+
t[i] = null;
|
|
65
|
+
let r = null;
|
|
66
|
+
const o = A[i];
|
|
67
|
+
Object.defineProperty(t, i, {
|
|
68
|
+
get() {
|
|
69
|
+
return r;
|
|
70
|
+
},
|
|
71
|
+
set(s) {
|
|
72
|
+
r = s, e.isConnected ? e.setAttribute(o, s) : F.set(e, t);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
function G(e) {
|
|
78
|
+
const t = c.get(e), { form: i } = t;
|
|
79
|
+
tt(e, i, t), Z(e, t.labels);
|
|
80
|
+
}
|
|
81
|
+
const J = (e, t = !1) => {
|
|
82
|
+
const i = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
83
|
+
acceptNode(s) {
|
|
84
|
+
return c.has(s) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
72
85
|
}
|
|
73
86
|
});
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
});
|
|
86
|
-
let r = e.nextNode();
|
|
87
|
-
const o = !t || i.disabled;
|
|
88
|
-
for (; r; )
|
|
89
|
-
r.formDisabledCallback && o && D(r, i.disabled), r = e.nextNode();
|
|
90
|
-
}, G = { attributes: !0, attributeFilter: ["disabled", "name"] }, z = I() ? new MutationObserver((i) => {
|
|
91
|
-
for (const t of i) {
|
|
92
|
-
const e = t.target;
|
|
93
|
-
if (t.attributeName === "disabled" && (e.constructor.formAssociated ? D(e, e.hasAttribute("disabled")) : e.localName === "fieldset" && j(e)), t.attributeName === "name" && e.constructor.formAssociated) {
|
|
94
|
-
const r = c.get(e), o = M.get(e);
|
|
95
|
-
r.setFormValue(o);
|
|
87
|
+
let r = i.nextNode();
|
|
88
|
+
const o = !t || e.disabled;
|
|
89
|
+
for (; r; )
|
|
90
|
+
r.formDisabledCallback && o && D(r, e.disabled), r = i.nextNode();
|
|
91
|
+
}, Q = { attributes: !0, attributeFilter: ["disabled", "name"] }, k = V() ? new MutationObserver((e) => {
|
|
92
|
+
for (const t of e) {
|
|
93
|
+
const i = t.target;
|
|
94
|
+
if (t.attributeName === "disabled" && (i.constructor.formAssociated ? D(i, i.hasAttribute("disabled")) : i.localName === "fieldset" && J(i)), t.attributeName === "name" && i.constructor.formAssociated) {
|
|
95
|
+
const r = c.get(i), o = S.get(i);
|
|
96
|
+
r.setFormValue(o);
|
|
97
|
+
}
|
|
96
98
|
}
|
|
99
|
+
}) : {};
|
|
100
|
+
function R(e) {
|
|
101
|
+
e.forEach((t) => {
|
|
102
|
+
const { addedNodes: i, removedNodes: r } = t, o = Array.from(i), s = Array.from(r);
|
|
103
|
+
o.forEach((l) => {
|
|
104
|
+
var u;
|
|
105
|
+
if (c.has(l) && l.constructor.formAssociated && G(l), F.has(l)) {
|
|
106
|
+
const d = F.get(l);
|
|
107
|
+
Object.keys(A).filter((g) => d[g] !== null).forEach((g) => {
|
|
108
|
+
l.setAttribute(A[g], d[g]);
|
|
109
|
+
}), F.delete(l);
|
|
110
|
+
}
|
|
111
|
+
if (L.has(l)) {
|
|
112
|
+
const d = L.get(l);
|
|
113
|
+
l.setAttribute("internals-valid", d.validity.valid.toString()), l.setAttribute("internals-invalid", (!d.validity.valid).toString()), l.setAttribute("aria-invalid", (!d.validity.valid).toString()), L.delete(l);
|
|
114
|
+
}
|
|
115
|
+
if (l.localName === "form") {
|
|
116
|
+
const d = b.get(l), x = document.createTreeWalker(l, NodeFilter.SHOW_ELEMENT, {
|
|
117
|
+
acceptNode(H) {
|
|
118
|
+
return c.has(H) && H.constructor.formAssociated && !(d && d.has(H)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
let g = x.nextNode();
|
|
122
|
+
for (; g; )
|
|
123
|
+
G(g), g = x.nextNode();
|
|
124
|
+
}
|
|
125
|
+
l.localName === "fieldset" && ((u = k.observe) == null || u.call(k, l, Q), J(l, !0));
|
|
126
|
+
}), s.forEach((l) => {
|
|
127
|
+
const u = c.get(l);
|
|
128
|
+
u && h.get(u) && X(u), M.has(l) && M.get(l).disconnect();
|
|
129
|
+
});
|
|
130
|
+
});
|
|
97
131
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
132
|
+
function dt(e) {
|
|
133
|
+
e.forEach((t) => {
|
|
134
|
+
const { removedNodes: i } = t;
|
|
135
|
+
i.forEach((r) => {
|
|
136
|
+
const o = q.get(t.target);
|
|
137
|
+
c.has(r) && it(r), o.disconnect();
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
const vt = (e) => {
|
|
142
|
+
var i, r;
|
|
143
|
+
const t = new MutationObserver(dt);
|
|
144
|
+
(i = window == null ? void 0 : window.ShadyDOM) != null && i.inUse && e.mode && e.host && (e = e.host), (r = t.observe) == null || r.call(t, e, { childList: !0 }), q.set(e, t);
|
|
145
|
+
};
|
|
146
|
+
V() && new MutationObserver(R);
|
|
147
|
+
const _ = {
|
|
148
|
+
childList: !0,
|
|
149
|
+
subtree: !0
|
|
150
|
+
}, D = (e, t) => {
|
|
151
|
+
e.toggleAttribute("internals-disabled", t), t ? e.setAttribute("aria-disabled", "true") : e.removeAttribute("aria-disabled"), e.formDisabledCallback && e.formDisabledCallback.apply(e, [t]);
|
|
152
|
+
}, X = (e) => {
|
|
153
|
+
h.get(e).forEach((i) => {
|
|
154
|
+
i.remove();
|
|
155
|
+
}), h.set(e, []);
|
|
156
|
+
}, Y = (e, t) => {
|
|
157
|
+
const i = document.createElement("input");
|
|
158
|
+
return i.type = "hidden", i.name = e.getAttribute("name"), e.after(i), h.get(t).push(i), i;
|
|
159
|
+
}, ht = (e, t) => {
|
|
160
|
+
var i;
|
|
161
|
+
h.set(t, []), (i = k.observe) == null || i.call(k, e, Q);
|
|
162
|
+
}, Z = (e, t) => {
|
|
163
|
+
if (t.length) {
|
|
164
|
+
Array.from(t).forEach((r) => r.addEventListener("click", e.click.bind(e)));
|
|
165
|
+
let i = t[0].id;
|
|
166
|
+
t[0].id || (i = `${t[0].htmlFor}_Label`, t[0].id = i), e.setAttribute("aria-labelledby", i);
|
|
167
|
+
}
|
|
168
|
+
}, I = (e) => {
|
|
169
|
+
const t = Array.from(e.elements).filter((s) => !s.tagName.includes("-") && s.validity).map((s) => s.validity.valid), i = b.get(e) || [], r = Array.from(i).filter((s) => s.isConnected).map((s) => c.get(s).validity.valid), o = [...t, ...r].includes(!1);
|
|
170
|
+
e.toggleAttribute("internals-invalid", o), e.toggleAttribute("internals-valid", !o);
|
|
171
|
+
}, mt = (e) => {
|
|
172
|
+
I(T(e.target));
|
|
173
|
+
}, pt = (e) => {
|
|
174
|
+
I(T(e.target));
|
|
175
|
+
}, ut = (e) => {
|
|
176
|
+
const t = ["button[type=submit]", "input[type=submit]", "button:not([type])"].map((i) => `${i}:not([disabled])`).map((i) => `${i}:not([form])${e.id ? `,${i}[form='${e.id}']` : ""}`).join(",");
|
|
177
|
+
e.addEventListener("click", (i) => {
|
|
178
|
+
if (i.target.closest(t)) {
|
|
179
|
+
const o = b.get(e);
|
|
180
|
+
if (e.noValidate)
|
|
181
|
+
return;
|
|
182
|
+
o.size && Array.from(o).reverse().map((u) => c.get(u).reportValidity()).includes(!1) && i.preventDefault();
|
|
123
183
|
}
|
|
124
|
-
n.localName === "fieldset" && ((b = z.observe) == null || b.call(z, n, G), j(n, !0));
|
|
125
|
-
}), l.forEach((n) => {
|
|
126
|
-
const b = c.get(n);
|
|
127
|
-
b && a.get(b) && J(b), g.has(n) && g.get(n).disconnect();
|
|
128
184
|
});
|
|
129
|
-
})
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
const { removedNodes: e } = t;
|
|
134
|
-
e.forEach((r) => {
|
|
135
|
-
const o = K.get(t.target);
|
|
136
|
-
c.has(r) && tt(r), o.disconnect();
|
|
185
|
+
}, ft = (e) => {
|
|
186
|
+
const t = b.get(e.target);
|
|
187
|
+
t && t.size && t.forEach((i) => {
|
|
188
|
+
i.constructor.formAssociated && i.formResetCallback && i.formResetCallback.apply(i);
|
|
137
189
|
});
|
|
138
|
-
})
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}, lt = (i) => {
|
|
171
|
-
A(T(i.target));
|
|
172
|
-
}, ct = (i) => {
|
|
173
|
-
A(T(i.target));
|
|
174
|
-
}, dt = (i) => {
|
|
175
|
-
const t = ["button[type=submit]", "input[type=submit]", "button:not([type])"].map((e) => `${e}:not([disabled])`).map((e) => `${e}:not([form])${i.id ? `,${e}[form='${i.id}']` : ""}`).join(",");
|
|
176
|
-
i.addEventListener("click", (e) => {
|
|
177
|
-
if (e.target.closest(t)) {
|
|
178
|
-
const o = y.get(i);
|
|
179
|
-
if (i.noValidate)
|
|
180
|
-
return;
|
|
181
|
-
o.size && Array.from(o).reverse().map((b) => c.get(b).reportValidity()).includes(!1) && e.preventDefault();
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
}, vt = (i) => {
|
|
185
|
-
const t = y.get(i.target);
|
|
186
|
-
t && t.size && t.forEach((e) => {
|
|
187
|
-
e.constructor.formAssociated && e.formResetCallback && e.formResetCallback.apply(e);
|
|
188
|
-
});
|
|
189
|
-
}, Y = (i, t, e) => {
|
|
190
|
-
if (t) {
|
|
191
|
-
const r = y.get(t);
|
|
192
|
-
if (r)
|
|
193
|
-
r.add(i);
|
|
194
|
-
else {
|
|
195
|
-
const o = /* @__PURE__ */ new Set();
|
|
196
|
-
o.add(i), y.set(t, o), dt(t), t.addEventListener("reset", vt), t.addEventListener("input", lt), t.addEventListener("change", ct);
|
|
197
|
-
}
|
|
198
|
-
f.set(t, { ref: i, internals: e }), i.constructor.formAssociated && i.formAssociatedCallback && setTimeout(() => {
|
|
199
|
-
i.formAssociatedCallback.apply(i, [t]);
|
|
200
|
-
}, 0), A(t);
|
|
201
|
-
}
|
|
202
|
-
}, T = (i) => {
|
|
203
|
-
let t = i.parentNode;
|
|
204
|
-
return t && t.tagName !== "FORM" && (t = T(t)), t;
|
|
205
|
-
}, x = (i, t, e = DOMException) => {
|
|
206
|
-
if (!i.constructor.formAssociated)
|
|
207
|
-
throw new e(t);
|
|
208
|
-
}, Z = (i, t, e) => {
|
|
209
|
-
const r = y.get(i);
|
|
210
|
-
return r && r.size && r.forEach((o) => {
|
|
211
|
-
c.get(o)[e]() || (t = !1);
|
|
212
|
-
}), t;
|
|
213
|
-
}, tt = (i) => {
|
|
214
|
-
if (i.constructor.formAssociated) {
|
|
215
|
-
const t = c.get(i), { labels: e, form: r } = t;
|
|
216
|
-
X(i, e), Y(i, r, t);
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
function I() {
|
|
220
|
-
return typeof MutationObserver < "u";
|
|
221
|
-
}
|
|
222
|
-
class ht {
|
|
223
|
-
constructor() {
|
|
224
|
-
this.badInput = !1, this.customError = !1, this.patternMismatch = !1, this.rangeOverflow = !1, this.rangeUnderflow = !1, this.stepMismatch = !1, this.tooLong = !1, this.tooShort = !1, this.typeMismatch = !1, this.valid = !0, this.valueMissing = !1, Object.seal(this);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
const mt = (i) => (i.badInput = !1, i.customError = !1, i.patternMismatch = !1, i.rangeOverflow = !1, i.rangeUnderflow = !1, i.stepMismatch = !1, i.tooLong = !1, i.tooShort = !1, i.typeMismatch = !1, i.valid = !0, i.valueMissing = !1, i), pt = (i, t, e) => (i.valid = ut(t), Object.keys(t).forEach((r) => i[r] = t[r]), e && A(e), i), ut = (i) => {
|
|
228
|
-
let t = !0;
|
|
229
|
-
for (let e in i)
|
|
230
|
-
e !== "valid" && i[e] !== !1 && (t = !1);
|
|
231
|
-
return t;
|
|
232
|
-
}, $ = /* @__PURE__ */ new WeakMap();
|
|
233
|
-
function et(i, t) {
|
|
234
|
-
i.toggleAttribute(t, !0), i.part && i.part.add(t);
|
|
235
|
-
}
|
|
236
|
-
class V extends Set {
|
|
237
|
-
static get isPolyfilled() {
|
|
238
|
-
return !0;
|
|
239
|
-
}
|
|
240
|
-
constructor(t) {
|
|
241
|
-
if (super(), !t || !t.tagName || t.tagName.indexOf("-") === -1)
|
|
242
|
-
throw new TypeError("Illegal constructor");
|
|
243
|
-
$.set(this, t);
|
|
244
|
-
}
|
|
245
|
-
add(t) {
|
|
246
|
-
if (!/^--/.test(t) || typeof t != "string")
|
|
247
|
-
throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);
|
|
248
|
-
const e = super.add(t), r = $.get(this), o = `state${t}`;
|
|
249
|
-
return r.isConnected ? et(r, o) : setTimeout(() => {
|
|
250
|
-
et(r, o);
|
|
251
|
-
}), e;
|
|
252
|
-
}
|
|
253
|
-
clear() {
|
|
254
|
-
for (let [t] of this.entries())
|
|
255
|
-
this.delete(t);
|
|
256
|
-
super.clear();
|
|
257
|
-
}
|
|
258
|
-
delete(t) {
|
|
259
|
-
const e = super.delete(t), r = $.get(this);
|
|
260
|
-
return r.isConnected ? (r.toggleAttribute(`state${t}`, !1), r.part && r.part.remove(`state${t}`)) : setTimeout(() => {
|
|
261
|
-
r.toggleAttribute(`state${t}`, !1), r.part && r.part.remove(`state${t}`);
|
|
262
|
-
}), e;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
function it(i, t, e, r) {
|
|
266
|
-
if (e === "a" && !r)
|
|
267
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
268
|
-
if (typeof t == "function" ? i !== t || !r : !t.has(i))
|
|
269
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
270
|
-
return e === "m" ? r : e === "a" ? r.call(i) : r ? r.value : t.get(i);
|
|
271
|
-
}
|
|
272
|
-
function bt(i, t, e, r, o) {
|
|
273
|
-
if (r === "m")
|
|
274
|
-
throw new TypeError("Private method is not writable");
|
|
275
|
-
if (r === "a" && !o)
|
|
276
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
277
|
-
if (typeof t == "function" ? i !== t || !o : !t.has(i))
|
|
278
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
279
|
-
return r === "a" ? o.call(i, e) : o ? o.value = e : t.set(i, e), e;
|
|
280
|
-
}
|
|
281
|
-
var C;
|
|
282
|
-
class ft {
|
|
283
|
-
constructor(t) {
|
|
284
|
-
C.set(this, void 0), bt(this, C, t, "f");
|
|
285
|
-
for (let e = 0; e < t.length; e++) {
|
|
286
|
-
let r = t[e];
|
|
287
|
-
this[e] = r, r.hasAttribute("name") && (this[r.getAttribute("name")] = r);
|
|
288
|
-
}
|
|
289
|
-
Object.freeze(this);
|
|
290
|
-
}
|
|
291
|
-
get length() {
|
|
292
|
-
return it(this, C, "f").length;
|
|
293
|
-
}
|
|
294
|
-
[(C = /* @__PURE__ */ new WeakMap(), Symbol.iterator)]() {
|
|
295
|
-
return it(this, C, "f")[Symbol.iterator]();
|
|
296
|
-
}
|
|
297
|
-
item(t) {
|
|
298
|
-
return this[t] == null ? null : this[t];
|
|
299
|
-
}
|
|
300
|
-
namedItem(t) {
|
|
301
|
-
return this[t] == null ? null : this[t];
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
function gt() {
|
|
305
|
-
const i = HTMLFormElement.prototype.checkValidity;
|
|
306
|
-
HTMLFormElement.prototype.checkValidity = e;
|
|
307
|
-
const t = HTMLFormElement.prototype.reportValidity;
|
|
308
|
-
HTMLFormElement.prototype.reportValidity = r;
|
|
309
|
-
function e(...l) {
|
|
310
|
-
let n = i.apply(this, l);
|
|
311
|
-
return Z(this, n, "checkValidity");
|
|
312
|
-
}
|
|
313
|
-
function r(...l) {
|
|
314
|
-
let n = t.apply(this, l);
|
|
315
|
-
return Z(this, n, "reportValidity");
|
|
316
|
-
}
|
|
317
|
-
const { get: o } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
|
|
318
|
-
Object.defineProperty(HTMLFormElement.prototype, "elements", {
|
|
319
|
-
get(...l) {
|
|
320
|
-
const n = o.call(this, ...l), b = Array.from(y.get(this) || []);
|
|
321
|
-
if (b.length === 0)
|
|
322
|
-
return n;
|
|
323
|
-
const d = Array.from(n).concat(b).sort((E, w) => E.compareDocumentPosition ? E.compareDocumentPosition(w) & 2 ? 1 : -1 : 0);
|
|
324
|
-
return new ft(d);
|
|
325
|
-
}
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
class rt {
|
|
329
|
-
static get isPolyfilled() {
|
|
330
|
-
return !0;
|
|
190
|
+
}, tt = (e, t, i) => {
|
|
191
|
+
if (t) {
|
|
192
|
+
const r = b.get(t);
|
|
193
|
+
if (r)
|
|
194
|
+
r.add(e);
|
|
195
|
+
else {
|
|
196
|
+
const o = /* @__PURE__ */ new Set();
|
|
197
|
+
o.add(e), b.set(t, o), ut(t), t.addEventListener("reset", ft), t.addEventListener("input", mt), t.addEventListener("change", pt);
|
|
198
|
+
}
|
|
199
|
+
y.set(t, { ref: e, internals: i }), e.constructor.formAssociated && e.formAssociatedCallback && setTimeout(() => {
|
|
200
|
+
e.formAssociatedCallback.apply(e, [t]);
|
|
201
|
+
}, 0), I(t);
|
|
202
|
+
}
|
|
203
|
+
}, T = (e) => {
|
|
204
|
+
let t = e.parentNode;
|
|
205
|
+
return t && t.tagName !== "FORM" && (t = T(t)), t;
|
|
206
|
+
}, w = (e, t, i = DOMException) => {
|
|
207
|
+
if (!e.constructor.formAssociated)
|
|
208
|
+
throw new i(t);
|
|
209
|
+
}, et = (e, t, i) => {
|
|
210
|
+
const r = b.get(e);
|
|
211
|
+
return r && r.size && r.forEach((o) => {
|
|
212
|
+
c.get(o)[i]() || (t = !1);
|
|
213
|
+
}), t;
|
|
214
|
+
}, it = (e) => {
|
|
215
|
+
if (e.constructor.formAssociated) {
|
|
216
|
+
const t = c.get(e), { labels: i, form: r } = t;
|
|
217
|
+
Z(e, i), tt(e, r, t);
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
function V() {
|
|
221
|
+
return typeof MutationObserver < "u";
|
|
331
222
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
this.states = new V(t), p.set(this, t), s.set(this, r), c.set(t, this), ot(t, this), st(t, this), Object.seal(this), e instanceof DocumentFragment && nt(e);
|
|
223
|
+
class bt {
|
|
224
|
+
constructor() {
|
|
225
|
+
this.badInput = !1, this.customError = !1, this.patternMismatch = !1, this.rangeOverflow = !1, this.rangeUnderflow = !1, this.stepMismatch = !1, this.tooLong = !1, this.tooShort = !1, this.typeMismatch = !1, this.valid = !0, this.valueMissing = !1, Object.seal(this);
|
|
226
|
+
}
|
|
337
227
|
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
228
|
+
const gt = (e) => (e.badInput = !1, e.customError = !1, e.patternMismatch = !1, e.rangeOverflow = !1, e.rangeUnderflow = !1, e.stepMismatch = !1, e.tooLong = !1, e.tooShort = !1, e.typeMismatch = !1, e.valid = !0, e.valueMissing = !1, e), yt = (e, t, i) => (e.valid = wt(t), Object.keys(t).forEach((r) => e[r] = t[r]), i && I(i), e), wt = (e) => {
|
|
229
|
+
let t = !0;
|
|
230
|
+
for (let i in e)
|
|
231
|
+
i !== "valid" && e[i] !== !1 && (t = !1);
|
|
232
|
+
return t;
|
|
233
|
+
}, O = /* @__PURE__ */ new WeakMap();
|
|
234
|
+
function rt(e, t) {
|
|
235
|
+
e.toggleAttribute(t, !0), e.part && e.part.add(t);
|
|
236
|
+
}
|
|
237
|
+
class $ extends Set {
|
|
238
|
+
static get isPolyfilled() {
|
|
341
239
|
return !0;
|
|
342
|
-
const e = s.get(this);
|
|
343
|
-
if (!e.valid) {
|
|
344
|
-
const r = new Event("invalid", {
|
|
345
|
-
bubbles: !1,
|
|
346
|
-
cancelable: !0,
|
|
347
|
-
composed: !1
|
|
348
|
-
});
|
|
349
|
-
t.dispatchEvent(r);
|
|
350
240
|
}
|
|
351
|
-
|
|
241
|
+
constructor(t) {
|
|
242
|
+
if (super(), !t || !t.tagName || t.tagName.indexOf("-") === -1)
|
|
243
|
+
throw new TypeError("Illegal constructor");
|
|
244
|
+
O.set(this, t);
|
|
245
|
+
}
|
|
246
|
+
add(t) {
|
|
247
|
+
if (!/^--/.test(t) || typeof t != "string")
|
|
248
|
+
throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);
|
|
249
|
+
const i = super.add(t), r = O.get(this), o = `state${t}`;
|
|
250
|
+
return r.isConnected ? rt(r, o) : setTimeout(() => {
|
|
251
|
+
rt(r, o);
|
|
252
|
+
}), i;
|
|
253
|
+
}
|
|
254
|
+
clear() {
|
|
255
|
+
for (let [t] of this.entries())
|
|
256
|
+
this.delete(t);
|
|
257
|
+
super.clear();
|
|
258
|
+
}
|
|
259
|
+
delete(t) {
|
|
260
|
+
const i = super.delete(t), r = O.get(this);
|
|
261
|
+
return r.isConnected ? (r.toggleAttribute(`state${t}`, !1), r.part && r.part.remove(`state${t}`)) : setTimeout(() => {
|
|
262
|
+
r.toggleAttribute(`state${t}`, !1), r.part && r.part.remove(`state${t}`);
|
|
263
|
+
}), i;
|
|
264
|
+
}
|
|
352
265
|
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
266
|
+
function ot(e, t, i, r) {
|
|
267
|
+
if (i === "a" && !r)
|
|
268
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
269
|
+
if (typeof t == "function" ? e !== t || !r : !t.has(e))
|
|
270
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
271
|
+
return i === "m" ? r : i === "a" ? r.call(e) : r ? r.value : t.get(e);
|
|
272
|
+
}
|
|
273
|
+
function xt(e, t, i, r, o) {
|
|
274
|
+
if (r === "m")
|
|
275
|
+
throw new TypeError("Private method is not writable");
|
|
276
|
+
if (r === "a" && !o)
|
|
277
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
278
|
+
if (typeof t == "function" ? e !== t || !o : !t.has(e))
|
|
279
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
280
|
+
return r === "a" ? o.call(e, i) : o ? o.value = i : t.set(e, i), i;
|
|
281
|
+
}
|
|
282
|
+
var z;
|
|
283
|
+
class Et {
|
|
284
|
+
constructor(t) {
|
|
285
|
+
z.set(this, void 0), xt(this, z, t, "f");
|
|
286
|
+
for (let i = 0; i < t.length; i++) {
|
|
287
|
+
let r = t[i];
|
|
288
|
+
this[i] = r, r.hasAttribute("name") && (this[r.getAttribute("name")] = r);
|
|
289
|
+
}
|
|
290
|
+
Object.freeze(this);
|
|
291
|
+
}
|
|
292
|
+
get length() {
|
|
293
|
+
return ot(this, z, "f").length;
|
|
294
|
+
}
|
|
295
|
+
[(z = /* @__PURE__ */ new WeakMap(), Symbol.iterator)]() {
|
|
296
|
+
return ot(this, z, "f")[Symbol.iterator]();
|
|
297
|
+
}
|
|
298
|
+
item(t) {
|
|
299
|
+
return this[t] == null ? null : this[t];
|
|
300
|
+
}
|
|
301
|
+
namedItem(t) {
|
|
302
|
+
return this[t] == null ? null : this[t];
|
|
303
|
+
}
|
|
358
304
|
}
|
|
359
|
-
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
const
|
|
363
|
-
|
|
305
|
+
function kt() {
|
|
306
|
+
const e = HTMLFormElement.prototype.checkValidity;
|
|
307
|
+
HTMLFormElement.prototype.checkValidity = i;
|
|
308
|
+
const t = HTMLFormElement.prototype.reportValidity;
|
|
309
|
+
HTMLFormElement.prototype.reportValidity = r;
|
|
310
|
+
function i(...s) {
|
|
311
|
+
let l = e.apply(this, s);
|
|
312
|
+
return et(this, l, "checkValidity");
|
|
313
|
+
}
|
|
314
|
+
function r(...s) {
|
|
315
|
+
let l = t.apply(this, s);
|
|
316
|
+
return et(this, l, "reportValidity");
|
|
317
|
+
}
|
|
318
|
+
const { get: o } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
|
|
319
|
+
Object.defineProperty(HTMLFormElement.prototype, "elements", {
|
|
320
|
+
get(...s) {
|
|
321
|
+
const l = o.call(this, ...s), u = Array.from(b.get(this) || []);
|
|
322
|
+
if (u.length === 0)
|
|
323
|
+
return l;
|
|
324
|
+
const d = Array.from(l).concat(u).sort((x, g) => x.compareDocumentPosition ? x.compareDocumentPosition(g) & 2 ? 1 : -1 : 0);
|
|
325
|
+
return new Et(d);
|
|
326
|
+
}
|
|
327
|
+
});
|
|
364
328
|
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
if (x(t, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
|
|
329
|
+
class at {
|
|
330
|
+
static get isPolyfilled() {
|
|
368
331
|
return !0;
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
332
|
+
}
|
|
333
|
+
constructor(t) {
|
|
334
|
+
if (!t || !t.tagName || t.tagName.indexOf("-") === -1)
|
|
335
|
+
throw new TypeError("Illegal constructor");
|
|
336
|
+
const i = t.getRootNode(), r = new bt();
|
|
337
|
+
this.states = new $(t), a.set(this, t), n.set(this, r), c.set(t, this), ct(t, this), ht(t, this), Object.seal(this), i instanceof DocumentFragment && vt(i);
|
|
338
|
+
}
|
|
339
|
+
checkValidity() {
|
|
340
|
+
const t = a.get(this);
|
|
341
|
+
if (w(t, "Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
|
|
342
|
+
return !0;
|
|
343
|
+
const i = n.get(this);
|
|
344
|
+
if (!i.valid) {
|
|
345
|
+
const r = new Event("invalid", {
|
|
346
|
+
bubbles: !1,
|
|
347
|
+
cancelable: !0,
|
|
348
|
+
composed: !1
|
|
349
|
+
});
|
|
350
|
+
t.dispatchEvent(r);
|
|
380
351
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
352
|
+
return i.valid;
|
|
353
|
+
}
|
|
354
|
+
get form() {
|
|
355
|
+
const t = a.get(this);
|
|
356
|
+
w(t, "Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");
|
|
357
|
+
let i;
|
|
358
|
+
return t.constructor.formAssociated === !0 && (i = T(t)), i;
|
|
359
|
+
}
|
|
360
|
+
get labels() {
|
|
361
|
+
const t = a.get(this);
|
|
362
|
+
w(t, "Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");
|
|
363
|
+
const i = t.getAttribute("id"), r = t.getRootNode();
|
|
364
|
+
return r && i ? r.querySelectorAll(`[for="${i}"]`) : [];
|
|
365
|
+
}
|
|
366
|
+
reportValidity() {
|
|
367
|
+
const t = a.get(this);
|
|
368
|
+
if (w(t, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
|
|
369
|
+
return !0;
|
|
370
|
+
const i = this.checkValidity(), r = U.get(this);
|
|
371
|
+
if (r && !t.constructor.formAssociated)
|
|
372
|
+
throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");
|
|
373
|
+
return !i && r && (t.focus(), r.focus()), i;
|
|
374
|
+
}
|
|
375
|
+
setFormValue(t) {
|
|
376
|
+
const i = a.get(this);
|
|
377
|
+
if (w(i, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), X(this), t != null && !(t instanceof FormData)) {
|
|
378
|
+
if (i.getAttribute("name")) {
|
|
379
|
+
const r = Y(i, this);
|
|
380
|
+
r.value = t;
|
|
386
381
|
}
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
constructor() {
|
|
428
|
-
super(), this.internals = this.attachInternals();
|
|
382
|
+
} else
|
|
383
|
+
t != null && t instanceof FormData && Array.from(t).reverse().forEach(([r, o]) => {
|
|
384
|
+
if (typeof o == "string") {
|
|
385
|
+
const s = Y(i, this);
|
|
386
|
+
s.name = r, s.value = o;
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
S.set(i, t);
|
|
390
|
+
}
|
|
391
|
+
setValidity(t, i, r) {
|
|
392
|
+
const o = a.get(this);
|
|
393
|
+
if (w(o, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !t)
|
|
394
|
+
throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
|
|
395
|
+
U.set(this, r);
|
|
396
|
+
const s = n.get(this), l = {};
|
|
397
|
+
for (const x in t)
|
|
398
|
+
l[x] = t[x];
|
|
399
|
+
Object.keys(l).length === 0 && gt(s);
|
|
400
|
+
const u = { ...s, ...l };
|
|
401
|
+
delete u.valid;
|
|
402
|
+
const { valid: d } = yt(s, u, this.form);
|
|
403
|
+
if (!d && !i)
|
|
404
|
+
throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");
|
|
405
|
+
f.set(this, d ? "" : i), o.isConnected ? (o.toggleAttribute("internals-invalid", !d), o.toggleAttribute("internals-valid", d), o.setAttribute("aria-invalid", `${!d}`)) : L.set(o, this);
|
|
406
|
+
}
|
|
407
|
+
get shadowRoot() {
|
|
408
|
+
const t = a.get(this), i = K.get(t);
|
|
409
|
+
return i || null;
|
|
410
|
+
}
|
|
411
|
+
get validationMessage() {
|
|
412
|
+
const t = a.get(this);
|
|
413
|
+
return w(t, "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), f.get(this);
|
|
414
|
+
}
|
|
415
|
+
get validity() {
|
|
416
|
+
const t = a.get(this);
|
|
417
|
+
return w(t, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), n.get(this);
|
|
418
|
+
}
|
|
419
|
+
get willValidate() {
|
|
420
|
+
const t = a.get(this);
|
|
421
|
+
return w(t, "Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."), !(t.disabled || t.hasAttribute("disabled") || t.hasAttribute("readonly"));
|
|
429
422
|
}
|
|
430
423
|
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
"
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
424
|
+
function Mt() {
|
|
425
|
+
if (typeof window > "u" || !window.ElementInternals || !HTMLElement.prototype.attachInternals)
|
|
426
|
+
return !1;
|
|
427
|
+
class e extends HTMLElement {
|
|
428
|
+
constructor() {
|
|
429
|
+
super(), this.internals = this.attachInternals();
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
const t = `element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g, "")}`;
|
|
433
|
+
customElements.define(t, e);
|
|
434
|
+
const i = new e();
|
|
435
|
+
return [
|
|
436
|
+
"shadowRoot",
|
|
437
|
+
"form",
|
|
438
|
+
"willValidate",
|
|
439
|
+
"validity",
|
|
440
|
+
"validationMessage",
|
|
441
|
+
"labels",
|
|
442
|
+
"setFormValue",
|
|
443
|
+
"setValidity",
|
|
444
|
+
"checkValidity",
|
|
445
|
+
"reportValidity"
|
|
446
|
+
].every((r) => r in i.internals);
|
|
447
|
+
}
|
|
448
|
+
let nt = !1, st = !1;
|
|
449
|
+
function W(e) {
|
|
450
|
+
st || (st = !0, window.CustomStateSet = $, e && (HTMLElement.prototype.attachInternals = function(...t) {
|
|
451
|
+
const i = e.call(this, t);
|
|
452
|
+
return i.states = new $(this), i;
|
|
453
|
+
}));
|
|
454
|
+
}
|
|
455
|
+
function lt(e = !0) {
|
|
456
|
+
if (!nt) {
|
|
457
|
+
if (nt = !0, typeof window < "u" && (window.ElementInternals = at), typeof CustomElementRegistry < "u") {
|
|
458
|
+
const t = CustomElementRegistry.prototype.define;
|
|
459
|
+
CustomElementRegistry.prototype.define = function(i, r, o) {
|
|
460
|
+
if (r.formAssociated) {
|
|
461
|
+
const s = r.prototype.connectedCallback;
|
|
462
|
+
r.prototype.connectedCallback = function() {
|
|
463
|
+
j.has(this) || (j.set(this, !0), this.hasAttribute("disabled") && D(this, !0)), s != null && s.apply(this), it(this);
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
t.call(this, i, r, o);
|
|
464
467
|
};
|
|
465
468
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
469
|
+
if (typeof HTMLElement < "u" && (HTMLElement.prototype.attachInternals = function() {
|
|
470
|
+
if (this.tagName) {
|
|
471
|
+
if (this.tagName.indexOf("-") === -1)
|
|
472
|
+
throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.");
|
|
473
|
+
} else
|
|
474
|
+
return {};
|
|
475
|
+
if (c.has(this))
|
|
476
|
+
throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");
|
|
477
|
+
return new at(this);
|
|
478
|
+
}), typeof Element < "u") {
|
|
479
|
+
let t = function(...r) {
|
|
480
|
+
const o = i.apply(this, r);
|
|
481
|
+
if (K.set(this, o), V()) {
|
|
482
|
+
const s = new MutationObserver(R);
|
|
483
|
+
window.ShadyDOM ? s.observe(this, _) : s.observe(o, _), M.set(this, s);
|
|
484
|
+
}
|
|
485
|
+
return o;
|
|
486
|
+
};
|
|
487
|
+
const i = Element.prototype.attachShadow;
|
|
488
|
+
Element.prototype.attachShadow = t;
|
|
484
489
|
}
|
|
485
|
-
|
|
486
|
-
}
|
|
487
|
-
const t = Element.prototype.attachShadow;
|
|
488
|
-
Element.prototype.attachShadow = i;
|
|
490
|
+
V() && typeof document < "u" && new MutationObserver(R).observe(document.documentElement, _), typeof HTMLFormElement < "u" && kt(), (e || typeof window < "u" && !window.CustomStateSet) && W();
|
|
491
|
+
}
|
|
489
492
|
}
|
|
490
|
-
|
|
491
|
-
}
|
|
493
|
+
return !!customElements.polyfillWrapFlushCallback || (Mt() ? typeof window < "u" && !window.CustomStateSet && W(HTMLElement.prototype.attachInternals) : lt(!1)), E.forceCustomStateSetPolyfill = W, E.forceElementInternalsPolyfill = lt, Object.defineProperty(E, "__esModule", { value: !0 }), E;
|
|
494
|
+
})({});
|
|
492
495
|
})();
|
|
493
|
-
var
|
|
494
|
-
for (var
|
|
495
|
-
(
|
|
496
|
-
return
|
|
496
|
+
var Pt = Object.defineProperty, Rt = Object.getOwnPropertyDescriptor, p = (E, a, n, h) => {
|
|
497
|
+
for (var c = h > 1 ? void 0 : h ? Rt(a, n) : a, f = E.length - 1, y; f >= 0; f--)
|
|
498
|
+
(y = E[f]) && (c = (h ? y(a, n, c) : y(c)) || c);
|
|
499
|
+
return h && c && Pt(a, n, c), c;
|
|
497
500
|
};
|
|
498
|
-
const
|
|
499
|
-
class v extends
|
|
501
|
+
const C = "pie-button";
|
|
502
|
+
class v extends Ft(zt) {
|
|
500
503
|
constructor() {
|
|
501
|
-
super(...arguments), this.size = "medium", this.type = "submit", this.variant = "primary", this.iconPlacement = "leading", this.disabled = !1, this.isLoading = !1, this.isFullWidth = !1, this.isResponsive = !1, this._handleFormKeyDown = (
|
|
502
|
-
if (!(
|
|
503
|
-
if (
|
|
504
|
-
const
|
|
505
|
-
if (
|
|
504
|
+
super(...arguments), this.size = "medium", this.type = "submit", this.variant = "primary", this.iconPlacement = "leading", this.disabled = !1, this.isLoading = !1, this.isFullWidth = !1, this.isResponsive = !1, this._handleFormKeyDown = (a) => {
|
|
505
|
+
if (!(a.key !== "Enter" || this.type !== "submit" || this.disabled)) {
|
|
506
|
+
if (a.target instanceof HTMLElement) {
|
|
507
|
+
const n = a.target.tagName.toLowerCase();
|
|
508
|
+
if (n === "button" || n === "pie-button")
|
|
506
509
|
return;
|
|
507
510
|
}
|
|
508
|
-
|
|
511
|
+
a.preventDefault(), this._handleClick();
|
|
509
512
|
}
|
|
510
513
|
};
|
|
511
514
|
}
|
|
512
515
|
connectedCallback() {
|
|
513
|
-
var
|
|
514
|
-
super.connectedCallback(), this.type === "submit" && ((
|
|
516
|
+
var a;
|
|
517
|
+
super.connectedCallback(), this.type === "submit" && ((a = this.form) == null || a.addEventListener("keydown", this._handleFormKeyDown));
|
|
515
518
|
}
|
|
516
519
|
disconnectedCallback() {
|
|
517
|
-
var
|
|
518
|
-
super.disconnectedCallback(), this.type === "submit" && ((
|
|
520
|
+
var a;
|
|
521
|
+
super.disconnectedCallback(), this.type === "submit" && ((a = this.form) == null || a.removeEventListener("keydown", this._handleFormKeyDown));
|
|
519
522
|
}
|
|
520
|
-
updated(
|
|
521
|
-
var
|
|
522
|
-
super.updated(
|
|
523
|
+
updated(a) {
|
|
524
|
+
var n, h;
|
|
525
|
+
super.updated(a), a.has("type") && (this.type === "submit" ? (n = this.form) == null || n.addEventListener("keydown", this._handleFormKeyDown) : (h = this.form) == null || h.removeEventListener("keydown", this._handleFormKeyDown));
|
|
523
526
|
}
|
|
524
527
|
/**
|
|
525
528
|
* This method creates an invisible button of the same type as pie-button. It is then clicked, and immediately removed from the DOM.
|
|
@@ -529,11 +532,11 @@ class v extends kt(wt) {
|
|
|
529
532
|
*
|
|
530
533
|
* TODO: if we need to repeat this logic elsewhere, then we should consider moving this code to a shared class or mixin.
|
|
531
534
|
*/
|
|
532
|
-
_simulateNativeButtonClick(
|
|
535
|
+
_simulateNativeButtonClick(a) {
|
|
533
536
|
if (!this.form)
|
|
534
537
|
return;
|
|
535
|
-
const
|
|
536
|
-
|
|
538
|
+
const n = document.createElement("button");
|
|
539
|
+
n.type = a, n.style.position = "absolute", n.style.width = "1px", n.style.height = "1px", n.style.padding = "0", n.style.margin = "-1px", n.style.overflow = "hidden", n.style.border = "0", n.style.whiteSpace = "nowrap", a === "submit" && (this.name && (n.name = this.name), this.value && (n.value = this.value), this.formaction && n.setAttribute("formaction", this.formaction), this.formenctype && n.setAttribute("formenctype", this.formenctype), this.formmethod && n.setAttribute("formmethod", this.formmethod), this.formnovalidate && n.setAttribute("formnovalidate", "formnovalidate"), this.formtarget && n.setAttribute("formtarget", this.formtarget)), this.form.append(n), n.click(), n.remove();
|
|
537
540
|
}
|
|
538
541
|
_handleClick() {
|
|
539
542
|
!this.isLoading && this.form && (this.type === "submit" && (this.formnovalidate || this.form.reportValidity()) && this._simulateNativeButtonClick("submit"), this.type === "reset" && this._simulateNativeButtonClick("reset"));
|
|
@@ -544,111 +547,111 @@ class v extends kt(wt) {
|
|
|
544
547
|
* @private
|
|
545
548
|
*/
|
|
546
549
|
renderSpinner() {
|
|
547
|
-
const { size:
|
|
550
|
+
const { size: a, variant: n, disabled: h } = this, c = a && a.includes("small") ? "small" : "medium";
|
|
548
551
|
let f;
|
|
549
|
-
return
|
|
552
|
+
return h ? f = n === "ghost-inverse" ? "inverse" : "secondary" : f = ["primary", "destructive", "outline-inverse", "ghost-inverse"].includes(this.variant) ? "inverse" : "secondary", N`
|
|
550
553
|
<pie-spinner
|
|
551
|
-
size="${
|
|
554
|
+
size="${c}"
|
|
552
555
|
variant="${f}">
|
|
553
556
|
</pie-spinner>`;
|
|
554
557
|
}
|
|
555
558
|
render() {
|
|
556
559
|
const {
|
|
557
|
-
type:
|
|
558
|
-
disabled:
|
|
559
|
-
isFullWidth:
|
|
560
|
-
variant:
|
|
560
|
+
type: a,
|
|
561
|
+
disabled: n,
|
|
562
|
+
isFullWidth: h,
|
|
563
|
+
variant: c,
|
|
561
564
|
size: f,
|
|
562
|
-
isLoading:
|
|
563
|
-
isResponsive:
|
|
564
|
-
iconPlacement:
|
|
565
|
-
responsiveSize:
|
|
565
|
+
isLoading: y,
|
|
566
|
+
isResponsive: M,
|
|
567
|
+
iconPlacement: b,
|
|
568
|
+
responsiveSize: S
|
|
566
569
|
} = this;
|
|
567
570
|
return N`
|
|
568
571
|
<button
|
|
569
572
|
@click=${this._handleClick}
|
|
570
573
|
class="o-btn"
|
|
571
|
-
type=${
|
|
572
|
-
variant=${
|
|
574
|
+
type=${a || "submit"}
|
|
575
|
+
variant=${c || "primary"}
|
|
573
576
|
size=${f || "medium"}
|
|
574
|
-
responsiveSize=${
|
|
575
|
-
?disabled=${
|
|
576
|
-
?isFullWidth=${
|
|
577
|
-
?isResponsive=${
|
|
578
|
-
?isLoading=${
|
|
579
|
-
${
|
|
580
|
-
${
|
|
577
|
+
responsiveSize=${St(S)}
|
|
578
|
+
?disabled=${n}
|
|
579
|
+
?isFullWidth=${h}
|
|
580
|
+
?isResponsive=${M}
|
|
581
|
+
?isLoading=${y}>
|
|
582
|
+
${y ? this.renderSpinner() : B}
|
|
583
|
+
${b === "leading" ? N`<slot name="icon"></slot>` : B}
|
|
581
584
|
<slot></slot>
|
|
582
|
-
${
|
|
585
|
+
${b === "trailing" ? N`<slot name="icon"></slot>` : B}
|
|
583
586
|
</button>`;
|
|
584
587
|
}
|
|
585
588
|
focus() {
|
|
586
|
-
var
|
|
587
|
-
(
|
|
589
|
+
var a, n;
|
|
590
|
+
(n = (a = this.shadowRoot) == null ? void 0 : a.querySelector("button")) == null || n.focus();
|
|
588
591
|
}
|
|
589
592
|
}
|
|
590
|
-
v.styles =
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
593
|
+
v.styles = Ct(Nt);
|
|
594
|
+
p([
|
|
595
|
+
m(),
|
|
596
|
+
P(C, At, "medium")
|
|
594
597
|
], v.prototype, "size", 2);
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
+
p([
|
|
599
|
+
m(),
|
|
600
|
+
P(C, It, "submit")
|
|
598
601
|
], v.prototype, "type", 2);
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
+
p([
|
|
603
|
+
m(),
|
|
604
|
+
P(C, Tt, "primary")
|
|
602
605
|
], v.prototype, "variant", 2);
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
+
p([
|
|
607
|
+
m({ type: String }),
|
|
608
|
+
P(C, Vt, "leading")
|
|
606
609
|
], v.prototype, "iconPlacement", 2);
|
|
607
|
-
|
|
608
|
-
|
|
610
|
+
p([
|
|
611
|
+
m({ type: Boolean })
|
|
609
612
|
], v.prototype, "disabled", 2);
|
|
610
|
-
|
|
611
|
-
|
|
613
|
+
p([
|
|
614
|
+
m({ type: Boolean, reflect: !0 })
|
|
612
615
|
], v.prototype, "isLoading", 2);
|
|
613
|
-
|
|
614
|
-
|
|
616
|
+
p([
|
|
617
|
+
m({ type: Boolean })
|
|
615
618
|
], v.prototype, "isFullWidth", 2);
|
|
616
|
-
|
|
617
|
-
|
|
619
|
+
p([
|
|
620
|
+
m({ type: Boolean })
|
|
618
621
|
], v.prototype, "isResponsive", 2);
|
|
619
|
-
|
|
620
|
-
|
|
622
|
+
p([
|
|
623
|
+
m({ type: String })
|
|
621
624
|
], v.prototype, "name", 2);
|
|
622
|
-
|
|
623
|
-
|
|
625
|
+
p([
|
|
626
|
+
m({ type: String })
|
|
624
627
|
], v.prototype, "value", 2);
|
|
625
|
-
|
|
626
|
-
|
|
628
|
+
p([
|
|
629
|
+
m()
|
|
627
630
|
], v.prototype, "formaction", 2);
|
|
628
|
-
|
|
629
|
-
|
|
631
|
+
p([
|
|
632
|
+
m()
|
|
630
633
|
], v.prototype, "formenctype", 2);
|
|
631
|
-
|
|
632
|
-
|
|
634
|
+
p([
|
|
635
|
+
m()
|
|
633
636
|
], v.prototype, "formmethod", 2);
|
|
634
|
-
|
|
635
|
-
|
|
637
|
+
p([
|
|
638
|
+
m({ type: Boolean })
|
|
636
639
|
], v.prototype, "formnovalidate", 2);
|
|
637
|
-
|
|
638
|
-
|
|
640
|
+
p([
|
|
641
|
+
m()
|
|
639
642
|
], v.prototype, "formtarget", 2);
|
|
640
|
-
|
|
641
|
-
|
|
643
|
+
p([
|
|
644
|
+
m({ type: String })
|
|
642
645
|
], v.prototype, "responsiveSize", 2);
|
|
643
|
-
|
|
646
|
+
Lt(C, v);
|
|
644
647
|
export {
|
|
645
648
|
v as PieButton,
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
649
|
+
Kt as formEncodingtypes,
|
|
650
|
+
Ut as formMethodTypes,
|
|
651
|
+
qt as formTargetTypes,
|
|
652
|
+
Vt as iconPlacements,
|
|
653
|
+
Bt as responsiveSizes,
|
|
654
|
+
At as sizes,
|
|
655
|
+
It as types,
|
|
656
|
+
Tt as variants
|
|
654
657
|
};
|