gffgf
This commit is contained in:
parent
57e97ea947
commit
40ac075db4
|
|
@ -0,0 +1,17 @@
|
|||
"use strict";const A=require("./class-map-DV5418hw.js");/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/function b(e){return A.n({...e,state:!0,attribute:!1})}/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/const i=(e,t,r)=>(r.configurable=!0,r.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(e,t,r),r);/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/function o(e,t){return(r,c,s)=>{const u=E=>{var n;return((n=E.renderRoot)==null?void 0:n.querySelector(e))??null};return i(r,c,{get(){return u(this)}})}}/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const l={STANDARD:"cubic-bezier(0.2, 0, 0, 1)",STANDARD_ACCELERATE:"cubic-bezier(.3,0,1,1)",STANDARD_DECELERATE:"cubic-bezier(0,0,0,1)",EMPHASIZED:"cubic-bezier(.3,0,0,1)",EMPHASIZED_ACCELERATE:"cubic-bezier(.3,0,.8,.15)",EMPHASIZED_DECELERATE:"cubic-bezier(.05,.7,.1,1)"};function a(){let e=null;return{start(){return e==null||e.abort(),e=new AbortController,e.signal},finish(){e=null}}}exports.EASING=l;exports.createAnimationSignal=a;exports.e=i;exports.e$1=o;exports.r=b;
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
import { n as E } from "./class-map-CwiboTfb.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
function a(e) {
|
||||
return E({ ...e, state: !0, attribute: !1 });
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const o = (e, t, r) => (r.configurable = !0, r.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(e, t, r), r);
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
function l(e, t) {
|
||||
return (r, i, b) => {
|
||||
const c = (u) => {
|
||||
var n;
|
||||
return ((n = u.renderRoot) == null ? void 0 : n.querySelector(e)) ?? null;
|
||||
};
|
||||
return o(r, i, { get() {
|
||||
return c(this);
|
||||
} });
|
||||
};
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const s = {
|
||||
STANDARD: "cubic-bezier(0.2, 0, 0, 1)",
|
||||
STANDARD_ACCELERATE: "cubic-bezier(.3,0,1,1)",
|
||||
STANDARD_DECELERATE: "cubic-bezier(0,0,0,1)",
|
||||
EMPHASIZED: "cubic-bezier(.3,0,0,1)",
|
||||
EMPHASIZED_ACCELERATE: "cubic-bezier(.3,0,.8,.15)",
|
||||
EMPHASIZED_DECELERATE: "cubic-bezier(.05,.7,.1,1)"
|
||||
};
|
||||
function D() {
|
||||
let e = null;
|
||||
return {
|
||||
start() {
|
||||
return e == null || e.abort(), e = new AbortController(), e.signal;
|
||||
},
|
||||
finish() {
|
||||
e = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
export {
|
||||
s as E,
|
||||
l as a,
|
||||
D as c,
|
||||
o as e,
|
||||
a as r
|
||||
};
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
"use strict";const c=require("./validator-DUxooTr6.js");/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/class t extends c.Validator{computeValidity(e){return this.checkboxControl||(this.checkboxControl=document.createElement("input"),this.checkboxControl.type="checkbox"),this.checkboxControl.checked=e.checked,this.checkboxControl.required=e.required,{validity:this.checkboxControl.validity,validationMessage:this.checkboxControl.validationMessage}}equals(e,o){return e.checked===o.checked&&e.required===o.required}copy({checked:e,required:o}){return{checked:e,required:o}}}exports.CheckboxValidator=t;
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
import { V as c } from "./validator-DZt1_yHv.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
class r extends c {
|
||||
computeValidity(e) {
|
||||
return this.checkboxControl || (this.checkboxControl = document.createElement("input"), this.checkboxControl.type = "checkbox"), this.checkboxControl.checked = e.checked, this.checkboxControl.required = e.required, {
|
||||
validity: this.checkboxControl.validity,
|
||||
validationMessage: this.checkboxControl.validationMessage
|
||||
};
|
||||
}
|
||||
equals(e, o) {
|
||||
return e.checked === o.checked && e.required === o.required;
|
||||
}
|
||||
copy({ checked: e, required: o }) {
|
||||
return { checked: e, required: o };
|
||||
}
|
||||
}
|
||||
export {
|
||||
r as C
|
||||
};
|
||||
|
|
@ -0,0 +1,661 @@
|
|||
function xt(r, t, e, s) {
|
||||
var i = arguments.length, n = i < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, e) : s, o;
|
||||
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(r, t, e, s);
|
||||
else for (var a = r.length - 1; a >= 0; a--) (o = r[a]) && (n = (i < 3 ? o(n) : i > 3 ? o(t, e, n) : o(t, e)) || n);
|
||||
return i > 3 && n && Object.defineProperty(t, e, n), n;
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const Ot = (r) => (t, e) => {
|
||||
e !== void 0 ? e.addInitializer(() => {
|
||||
customElements.define(r, t);
|
||||
}) : customElements.define(r, t);
|
||||
};
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const O = globalThis, B = O.ShadowRoot && (O.ShadyCSS === void 0 || O.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, D = Symbol(), W = /* @__PURE__ */ new WeakMap();
|
||||
let et = class {
|
||||
constructor(t, e, s) {
|
||||
if (this._$cssResult$ = !0, s !== D) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
||||
this.cssText = t, this.t = e;
|
||||
}
|
||||
get styleSheet() {
|
||||
let t = this.o;
|
||||
const e = this.t;
|
||||
if (B && t === void 0) {
|
||||
const s = e !== void 0 && e.length === 1;
|
||||
s && (t = W.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && W.set(e, t));
|
||||
}
|
||||
return t;
|
||||
}
|
||||
toString() {
|
||||
return this.cssText;
|
||||
}
|
||||
};
|
||||
const ot = (r) => new et(typeof r == "string" ? r : r + "", void 0, D), Ht = (r, ...t) => {
|
||||
const e = r.length === 1 ? r[0] : t.reduce((s, i, n) => s + ((o) => {
|
||||
if (o._$cssResult$ === !0) return o.cssText;
|
||||
if (typeof o == "number") return o;
|
||||
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
||||
})(i) + r[n + 1], r[0]);
|
||||
return new et(e, r, D);
|
||||
}, ht = (r, t) => {
|
||||
if (B) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
||||
else for (const e of t) {
|
||||
const s = document.createElement("style"), i = O.litNonce;
|
||||
i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
|
||||
}
|
||||
}, q = B ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
||||
let e = "";
|
||||
for (const s of t.cssRules) e += s.cssText;
|
||||
return ot(e);
|
||||
})(r) : r;
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const { is: at, defineProperty: lt, getOwnPropertyDescriptor: ct, getOwnPropertyNames: dt, getOwnPropertySymbols: pt, getPrototypeOf: ut } = Object, f = globalThis, J = f.trustedTypes, $t = J ? J.emptyScript : "", L = f.reactiveElementPolyfillSupport, b = (r, t) => r, H = { toAttribute(r, t) {
|
||||
switch (t) {
|
||||
case Boolean:
|
||||
r = r ? $t : null;
|
||||
break;
|
||||
case Object:
|
||||
case Array:
|
||||
r = r == null ? r : JSON.stringify(r);
|
||||
}
|
||||
return r;
|
||||
}, fromAttribute(r, t) {
|
||||
let e = r;
|
||||
switch (t) {
|
||||
case Boolean:
|
||||
e = r !== null;
|
||||
break;
|
||||
case Number:
|
||||
e = r === null ? null : Number(r);
|
||||
break;
|
||||
case Object:
|
||||
case Array:
|
||||
try {
|
||||
e = JSON.parse(r);
|
||||
} catch {
|
||||
e = null;
|
||||
}
|
||||
}
|
||||
return e;
|
||||
} }, z = (r, t) => !at(r, t), K = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: z };
|
||||
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), f.litPropertyMetadata ?? (f.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
||||
class v extends HTMLElement {
|
||||
static addInitializer(t) {
|
||||
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
||||
}
|
||||
static get observedAttributes() {
|
||||
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
||||
}
|
||||
static createProperty(t, e = K) {
|
||||
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
||||
const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
|
||||
i !== void 0 && lt(this.prototype, t, i);
|
||||
}
|
||||
}
|
||||
static getPropertyDescriptor(t, e, s) {
|
||||
const { get: i, set: n } = ct(this.prototype, t) ?? { get() {
|
||||
return this[e];
|
||||
}, set(o) {
|
||||
this[e] = o;
|
||||
} };
|
||||
return { get() {
|
||||
return i == null ? void 0 : i.call(this);
|
||||
}, set(o) {
|
||||
const a = i == null ? void 0 : i.call(this);
|
||||
n.call(this, o), this.requestUpdate(t, a, s);
|
||||
}, configurable: !0, enumerable: !0 };
|
||||
}
|
||||
static getPropertyOptions(t) {
|
||||
return this.elementProperties.get(t) ?? K;
|
||||
}
|
||||
static _$Ei() {
|
||||
if (this.hasOwnProperty(b("elementProperties"))) return;
|
||||
const t = ut(this);
|
||||
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
||||
}
|
||||
static finalize() {
|
||||
if (this.hasOwnProperty(b("finalized"))) return;
|
||||
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(b("properties"))) {
|
||||
const e = this.properties, s = [...dt(e), ...pt(e)];
|
||||
for (const i of s) this.createProperty(i, e[i]);
|
||||
}
|
||||
const t = this[Symbol.metadata];
|
||||
if (t !== null) {
|
||||
const e = litPropertyMetadata.get(t);
|
||||
if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i);
|
||||
}
|
||||
this._$Eh = /* @__PURE__ */ new Map();
|
||||
for (const [e, s] of this.elementProperties) {
|
||||
const i = this._$Eu(e, s);
|
||||
i !== void 0 && this._$Eh.set(i, e);
|
||||
}
|
||||
this.elementStyles = this.finalizeStyles(this.styles);
|
||||
}
|
||||
static finalizeStyles(t) {
|
||||
const e = [];
|
||||
if (Array.isArray(t)) {
|
||||
const s = new Set(t.flat(1 / 0).reverse());
|
||||
for (const i of s) e.unshift(q(i));
|
||||
} else t !== void 0 && e.push(q(t));
|
||||
return e;
|
||||
}
|
||||
static _$Eu(t, e) {
|
||||
const s = e.attribute;
|
||||
return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
|
||||
}
|
||||
constructor() {
|
||||
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
||||
}
|
||||
_$Ev() {
|
||||
var t;
|
||||
this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
|
||||
}
|
||||
addController(t) {
|
||||
var e;
|
||||
(this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
|
||||
}
|
||||
removeController(t) {
|
||||
var e;
|
||||
(e = this._$EO) == null || e.delete(t);
|
||||
}
|
||||
_$E_() {
|
||||
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
|
||||
for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
|
||||
t.size > 0 && (this._$Ep = t);
|
||||
}
|
||||
createRenderRoot() {
|
||||
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
||||
return ht(t, this.constructor.elementStyles), t;
|
||||
}
|
||||
connectedCallback() {
|
||||
var t;
|
||||
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
|
||||
var s;
|
||||
return (s = e.hostConnected) == null ? void 0 : s.call(e);
|
||||
});
|
||||
}
|
||||
enableUpdating(t) {
|
||||
}
|
||||
disconnectedCallback() {
|
||||
var t;
|
||||
(t = this._$EO) == null || t.forEach((e) => {
|
||||
var s;
|
||||
return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
|
||||
});
|
||||
}
|
||||
attributeChangedCallback(t, e, s) {
|
||||
this._$AK(t, s);
|
||||
}
|
||||
_$EC(t, e) {
|
||||
var n;
|
||||
const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
|
||||
if (i !== void 0 && s.reflect === !0) {
|
||||
const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : H).toAttribute(e, s.type);
|
||||
this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
|
||||
}
|
||||
}
|
||||
_$AK(t, e) {
|
||||
var n;
|
||||
const s = this.constructor, i = s._$Eh.get(t);
|
||||
if (i !== void 0 && this._$Em !== i) {
|
||||
const o = s.getPropertyOptions(i), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : H;
|
||||
this._$Em = i, this[i] = a.fromAttribute(e, o.type), this._$Em = null;
|
||||
}
|
||||
}
|
||||
requestUpdate(t, e, s) {
|
||||
if (t !== void 0) {
|
||||
if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? z)(this[t], e)) return;
|
||||
this.P(t, e, s);
|
||||
}
|
||||
this.isUpdatePending === !1 && (this._$ES = this._$ET());
|
||||
}
|
||||
P(t, e, s) {
|
||||
this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
|
||||
}
|
||||
async _$ET() {
|
||||
this.isUpdatePending = !0;
|
||||
try {
|
||||
await this._$ES;
|
||||
} catch (e) {
|
||||
Promise.reject(e);
|
||||
}
|
||||
const t = this.scheduleUpdate();
|
||||
return t != null && await t, !this.isUpdatePending;
|
||||
}
|
||||
scheduleUpdate() {
|
||||
return this.performUpdate();
|
||||
}
|
||||
performUpdate() {
|
||||
var s;
|
||||
if (!this.isUpdatePending) return;
|
||||
if (!this.hasUpdated) {
|
||||
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
|
||||
for (const [n, o] of this._$Ep) this[n] = o;
|
||||
this._$Ep = void 0;
|
||||
}
|
||||
const i = this.constructor.elementProperties;
|
||||
if (i.size > 0) for (const [n, o] of i) o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.P(n, this[n], o);
|
||||
}
|
||||
let t = !1;
|
||||
const e = this._$AL;
|
||||
try {
|
||||
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((i) => {
|
||||
var n;
|
||||
return (n = i.hostUpdate) == null ? void 0 : n.call(i);
|
||||
}), this.update(e)) : this._$EU();
|
||||
} catch (i) {
|
||||
throw t = !1, this._$EU(), i;
|
||||
}
|
||||
t && this._$AE(e);
|
||||
}
|
||||
willUpdate(t) {
|
||||
}
|
||||
_$AE(t) {
|
||||
var e;
|
||||
(e = this._$EO) == null || e.forEach((s) => {
|
||||
var i;
|
||||
return (i = s.hostUpdated) == null ? void 0 : i.call(s);
|
||||
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
||||
}
|
||||
_$EU() {
|
||||
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
||||
}
|
||||
get updateComplete() {
|
||||
return this.getUpdateComplete();
|
||||
}
|
||||
getUpdateComplete() {
|
||||
return this._$ES;
|
||||
}
|
||||
shouldUpdate(t) {
|
||||
return !0;
|
||||
}
|
||||
update(t) {
|
||||
this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EC(e, this[e]))), this._$EU();
|
||||
}
|
||||
updated(t) {
|
||||
}
|
||||
firstUpdated(t) {
|
||||
}
|
||||
}
|
||||
v.elementStyles = [], v.shadowRootOptions = { mode: "open" }, v[b("elementProperties")] = /* @__PURE__ */ new Map(), v[b("finalized")] = /* @__PURE__ */ new Map(), L == null || L({ ReactiveElement: v }), (f.reactiveElementVersions ?? (f.reactiveElementVersions = [])).push("2.0.4");
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const _t = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: z }, ft = (r = _t, t, e) => {
|
||||
const { kind: s, metadata: i } = e;
|
||||
let n = globalThis.litPropertyMetadata.get(i);
|
||||
if (n === void 0 && globalThis.litPropertyMetadata.set(i, n = /* @__PURE__ */ new Map()), n.set(e.name, r), s === "accessor") {
|
||||
const { name: o } = e;
|
||||
return { set(a) {
|
||||
const h = t.get.call(this);
|
||||
t.set.call(this, a), this.requestUpdate(o, h, r);
|
||||
}, init(a) {
|
||||
return a !== void 0 && this.P(o, void 0, r), a;
|
||||
} };
|
||||
}
|
||||
if (s === "setter") {
|
||||
const { name: o } = e;
|
||||
return function(a) {
|
||||
const h = this[o];
|
||||
t.call(this, a), this.requestUpdate(o, h, r);
|
||||
};
|
||||
}
|
||||
throw Error("Unsupported decorator location: " + s);
|
||||
};
|
||||
function Mt(r) {
|
||||
return (t, e) => typeof e == "object" ? ft(r, t, e) : ((s, i, n) => {
|
||||
const o = i.hasOwnProperty(n);
|
||||
return i.constructor.createProperty(n, o ? { ...s, wrapped: !0 } : s), o ? Object.getOwnPropertyDescriptor(i, n) : void 0;
|
||||
})(r, t, e);
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const w = globalThis, M = w.trustedTypes, Z = M ? M.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, st = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, it = "?" + _, At = `<${it}>`, g = document, P = () => g.createComment(""), C = (r) => r === null || typeof r != "object" && typeof r != "function", V = Array.isArray, mt = (r) => V(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", j = `[
|
||||
\f\r]`, S = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, F = /-->/g, Y = />/g, A = RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^
|
||||
\f\r"'\`<>=]|("|')|))|$)`, "g"), G = /'/g, Q = /"/g, rt = /^(?:script|style|textarea|title)$/i, gt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), Nt = gt(1), y = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), X = /* @__PURE__ */ new WeakMap(), m = g.createTreeWalker(g, 129);
|
||||
function nt(r, t) {
|
||||
if (!V(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
||||
return Z !== void 0 ? Z.createHTML(t) : t;
|
||||
}
|
||||
const yt = (r, t) => {
|
||||
const e = r.length - 1, s = [];
|
||||
let i, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = S;
|
||||
for (let a = 0; a < e; a++) {
|
||||
const h = r[a];
|
||||
let c, p, l = -1, u = 0;
|
||||
for (; u < h.length && (o.lastIndex = u, p = o.exec(h), p !== null); ) u = o.lastIndex, o === S ? p[1] === "!--" ? o = F : p[1] !== void 0 ? o = Y : p[2] !== void 0 ? (rt.test(p[2]) && (i = RegExp("</" + p[2], "g")), o = A) : p[3] !== void 0 && (o = A) : o === A ? p[0] === ">" ? (o = i ?? S, l = -1) : p[1] === void 0 ? l = -2 : (l = o.lastIndex - p[2].length, c = p[1], o = p[3] === void 0 ? A : p[3] === '"' ? Q : G) : o === Q || o === G ? o = A : o === F || o === Y ? o = S : (o = A, i = void 0);
|
||||
const $ = o === A && r[a + 1].startsWith("/>") ? " " : "";
|
||||
n += o === S ? h + At : l >= 0 ? (s.push(c), h.slice(0, l) + st + h.slice(l) + _ + $) : h + _ + (l === -2 ? a : $);
|
||||
}
|
||||
return [nt(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
||||
};
|
||||
class U {
|
||||
constructor({ strings: t, _$litType$: e }, s) {
|
||||
let i;
|
||||
this.parts = [];
|
||||
let n = 0, o = 0;
|
||||
const a = t.length - 1, h = this.parts, [c, p] = yt(t, e);
|
||||
if (this.el = U.createElement(c, s), m.currentNode = this.el.content, e === 2 || e === 3) {
|
||||
const l = this.el.content.firstChild;
|
||||
l.replaceWith(...l.childNodes);
|
||||
}
|
||||
for (; (i = m.nextNode()) !== null && h.length < a; ) {
|
||||
if (i.nodeType === 1) {
|
||||
if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(st)) {
|
||||
const u = p[o++], $ = i.getAttribute(l).split(_), x = /([.?@])?(.*)/.exec(u);
|
||||
h.push({ type: 1, index: n, name: x[2], strings: $, ctor: x[1] === "." ? Et : x[1] === "?" ? St : x[1] === "@" ? bt : N }), i.removeAttribute(l);
|
||||
} else l.startsWith(_) && (h.push({ type: 6, index: n }), i.removeAttribute(l));
|
||||
if (rt.test(i.tagName)) {
|
||||
const l = i.textContent.split(_), u = l.length - 1;
|
||||
if (u > 0) {
|
||||
i.textContent = M ? M.emptyScript : "";
|
||||
for (let $ = 0; $ < u; $++) i.append(l[$], P()), m.nextNode(), h.push({ type: 2, index: ++n });
|
||||
i.append(l[u], P());
|
||||
}
|
||||
}
|
||||
} else if (i.nodeType === 8) if (i.data === it) h.push({ type: 2, index: n });
|
||||
else {
|
||||
let l = -1;
|
||||
for (; (l = i.data.indexOf(_, l + 1)) !== -1; ) h.push({ type: 7, index: n }), l += _.length - 1;
|
||||
}
|
||||
n++;
|
||||
}
|
||||
}
|
||||
static createElement(t, e) {
|
||||
const s = g.createElement("template");
|
||||
return s.innerHTML = t, s;
|
||||
}
|
||||
}
|
||||
function E(r, t, e = r, s) {
|
||||
var o, a;
|
||||
if (t === y) return t;
|
||||
let i = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl;
|
||||
const n = C(t) ? void 0 : t._$litDirective$;
|
||||
return (i == null ? void 0 : i.constructor) !== n && ((a = i == null ? void 0 : i._$AO) == null || a.call(i, !1), n === void 0 ? i = void 0 : (i = new n(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = i : e._$Cl = i), i !== void 0 && (t = E(r, i._$AS(r, t.values), i, s)), t;
|
||||
}
|
||||
class vt {
|
||||
constructor(t, e) {
|
||||
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
||||
}
|
||||
get parentNode() {
|
||||
return this._$AM.parentNode;
|
||||
}
|
||||
get _$AU() {
|
||||
return this._$AM._$AU;
|
||||
}
|
||||
u(t) {
|
||||
const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? g).importNode(e, !0);
|
||||
m.currentNode = i;
|
||||
let n = m.nextNode(), o = 0, a = 0, h = s[0];
|
||||
for (; h !== void 0; ) {
|
||||
if (o === h.index) {
|
||||
let c;
|
||||
h.type === 2 ? c = new T(n, n.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (c = new wt(n, this, t)), this._$AV.push(c), h = s[++a];
|
||||
}
|
||||
o !== (h == null ? void 0 : h.index) && (n = m.nextNode(), o++);
|
||||
}
|
||||
return m.currentNode = g, i;
|
||||
}
|
||||
p(t) {
|
||||
let e = 0;
|
||||
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
||||
}
|
||||
}
|
||||
class T {
|
||||
get _$AU() {
|
||||
var t;
|
||||
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
||||
}
|
||||
constructor(t, e, s, i) {
|
||||
this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0;
|
||||
}
|
||||
get parentNode() {
|
||||
let t = this._$AA.parentNode;
|
||||
const e = this._$AM;
|
||||
return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
|
||||
}
|
||||
get startNode() {
|
||||
return this._$AA;
|
||||
}
|
||||
get endNode() {
|
||||
return this._$AB;
|
||||
}
|
||||
_$AI(t, e = this) {
|
||||
t = E(this, t, e), C(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== y && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : mt(t) ? this.k(t) : this._(t);
|
||||
}
|
||||
O(t) {
|
||||
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
||||
}
|
||||
T(t) {
|
||||
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
||||
}
|
||||
_(t) {
|
||||
this._$AH !== d && C(this._$AH) ? this._$AA.nextSibling.data = t : this.T(g.createTextNode(t)), this._$AH = t;
|
||||
}
|
||||
$(t) {
|
||||
var n;
|
||||
const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = U.createElement(nt(s.h, s.h[0]), this.options)), s);
|
||||
if (((n = this._$AH) == null ? void 0 : n._$AD) === i) this._$AH.p(e);
|
||||
else {
|
||||
const o = new vt(i, this), a = o.u(this.options);
|
||||
o.p(e), this.T(a), this._$AH = o;
|
||||
}
|
||||
}
|
||||
_$AC(t) {
|
||||
let e = X.get(t.strings);
|
||||
return e === void 0 && X.set(t.strings, e = new U(t)), e;
|
||||
}
|
||||
k(t) {
|
||||
V(this._$AH) || (this._$AH = [], this._$AR());
|
||||
const e = this._$AH;
|
||||
let s, i = 0;
|
||||
for (const n of t) i === e.length ? e.push(s = new T(this.O(P()), this.O(P()), this, this.options)) : s = e[i], s._$AI(n), i++;
|
||||
i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
|
||||
}
|
||||
_$AR(t = this._$AA.nextSibling, e) {
|
||||
var s;
|
||||
for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
|
||||
const i = t.nextSibling;
|
||||
t.remove(), t = i;
|
||||
}
|
||||
}
|
||||
setConnected(t) {
|
||||
var e;
|
||||
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
|
||||
}
|
||||
}
|
||||
class N {
|
||||
get tagName() {
|
||||
return this.element.tagName;
|
||||
}
|
||||
get _$AU() {
|
||||
return this._$AM._$AU;
|
||||
}
|
||||
constructor(t, e, s, i, n) {
|
||||
this.type = 1, this._$AH = d, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = d;
|
||||
}
|
||||
_$AI(t, e = this, s, i) {
|
||||
const n = this.strings;
|
||||
let o = !1;
|
||||
if (n === void 0) t = E(this, t, e, 0), o = !C(t) || t !== this._$AH && t !== y, o && (this._$AH = t);
|
||||
else {
|
||||
const a = t;
|
||||
let h, c;
|
||||
for (t = n[0], h = 0; h < n.length - 1; h++) c = E(this, a[s + h], e, h), c === y && (c = this._$AH[h]), o || (o = !C(c) || c !== this._$AH[h]), c === d ? t = d : t !== d && (t += (c ?? "") + n[h + 1]), this._$AH[h] = c;
|
||||
}
|
||||
o && !i && this.j(t);
|
||||
}
|
||||
j(t) {
|
||||
t === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
||||
}
|
||||
}
|
||||
class Et extends N {
|
||||
constructor() {
|
||||
super(...arguments), this.type = 3;
|
||||
}
|
||||
j(t) {
|
||||
this.element[this.name] = t === d ? void 0 : t;
|
||||
}
|
||||
}
|
||||
class St extends N {
|
||||
constructor() {
|
||||
super(...arguments), this.type = 4;
|
||||
}
|
||||
j(t) {
|
||||
this.element.toggleAttribute(this.name, !!t && t !== d);
|
||||
}
|
||||
}
|
||||
class bt extends N {
|
||||
constructor(t, e, s, i, n) {
|
||||
super(t, e, s, i, n), this.type = 5;
|
||||
}
|
||||
_$AI(t, e = this) {
|
||||
if ((t = E(this, t, e, 0) ?? d) === y) return;
|
||||
const s = this._$AH, i = t === d && s !== d || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== d && (s === d || i);
|
||||
i && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
||||
}
|
||||
handleEvent(t) {
|
||||
var e;
|
||||
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
||||
}
|
||||
}
|
||||
class wt {
|
||||
constructor(t, e, s) {
|
||||
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
||||
}
|
||||
get _$AU() {
|
||||
return this._$AM._$AU;
|
||||
}
|
||||
_$AI(t) {
|
||||
E(this, t);
|
||||
}
|
||||
}
|
||||
const k = w.litHtmlPolyfillSupport;
|
||||
k == null || k(U, T), (w.litHtmlVersions ?? (w.litHtmlVersions = [])).push("3.2.1");
|
||||
const Pt = (r, t, e) => {
|
||||
const s = (e == null ? void 0 : e.renderBefore) ?? t;
|
||||
let i = s._$litPart$;
|
||||
if (i === void 0) {
|
||||
const n = (e == null ? void 0 : e.renderBefore) ?? null;
|
||||
s._$litPart$ = i = new T(t.insertBefore(P(), n), n, void 0, e ?? {});
|
||||
}
|
||||
return i._$AI(r), i;
|
||||
};
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
class R extends v {
|
||||
constructor() {
|
||||
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
||||
}
|
||||
createRenderRoot() {
|
||||
var e;
|
||||
const t = super.createRenderRoot();
|
||||
return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
|
||||
}
|
||||
update(t) {
|
||||
const e = this.render();
|
||||
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Pt(e, this.renderRoot, this.renderOptions);
|
||||
}
|
||||
connectedCallback() {
|
||||
var t;
|
||||
super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0);
|
||||
}
|
||||
disconnectedCallback() {
|
||||
var t;
|
||||
super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
|
||||
}
|
||||
render() {
|
||||
return y;
|
||||
}
|
||||
}
|
||||
var tt;
|
||||
R._$litElement$ = !0, R.finalized = !0, (tt = globalThis.litElementHydrateSupport) == null || tt.call(globalThis, { LitElement: R });
|
||||
const I = globalThis.litElementPolyfillSupport;
|
||||
I == null || I({ LitElement: R });
|
||||
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.1");
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const Ct = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, Ut = (r) => (...t) => ({ _$litDirective$: r, values: t });
|
||||
class Tt {
|
||||
constructor(t) {
|
||||
}
|
||||
get _$AU() {
|
||||
return this._$AM._$AU;
|
||||
}
|
||||
_$AT(t, e, s) {
|
||||
this._$Ct = t, this._$AM = e, this._$Ci = s;
|
||||
}
|
||||
_$AS(t, e) {
|
||||
return this.update(t, e);
|
||||
}
|
||||
update(t, e) {
|
||||
return this.render(...e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const Lt = Ut(class extends Tt {
|
||||
constructor(r) {
|
||||
var t;
|
||||
if (super(r), r.type !== Ct.ATTRIBUTE || r.name !== "class" || ((t = r.strings) == null ? void 0 : t.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
|
||||
}
|
||||
render(r) {
|
||||
return " " + Object.keys(r).filter((t) => r[t]).join(" ") + " ";
|
||||
}
|
||||
update(r, [t]) {
|
||||
var s, i;
|
||||
if (this.st === void 0) {
|
||||
this.st = /* @__PURE__ */ new Set(), r.strings !== void 0 && (this.nt = new Set(r.strings.join(" ").split(/\s/).filter((n) => n !== "")));
|
||||
for (const n in t) t[n] && !((s = this.nt) != null && s.has(n)) && this.st.add(n);
|
||||
return this.render(t);
|
||||
}
|
||||
const e = r.element.classList;
|
||||
for (const n of this.st) n in t || (e.remove(n), this.st.delete(n));
|
||||
for (const n in t) {
|
||||
const o = !!t[n];
|
||||
o === this.st.has(n) || (i = this.nt) != null && i.has(n) || (o ? (e.add(n), this.st.add(n)) : (e.remove(n), this.st.delete(n)));
|
||||
}
|
||||
return y;
|
||||
}
|
||||
});
|
||||
export {
|
||||
Pt as B,
|
||||
d as E,
|
||||
y as T,
|
||||
xt as _,
|
||||
Ht as a,
|
||||
Ot as b,
|
||||
Lt as c,
|
||||
Ut as e,
|
||||
Tt as i,
|
||||
Mt as n,
|
||||
R as r,
|
||||
Ct as t,
|
||||
Nt as x
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,35 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const w = /* @__PURE__ */ new Set(["children", "localName", "ref", "style", "className"]), m = /* @__PURE__ */ new WeakMap(), y = (r, u, a, i, d) => {
|
||||
const f = d == null ? void 0 : d[u];
|
||||
f === void 0 ? (r[u] = a, a == null && u in HTMLElement.prototype && r.removeAttribute(u)) : a !== i && ((l, c, o) => {
|
||||
let s = m.get(l);
|
||||
s === void 0 && m.set(l, s = /* @__PURE__ */ new Map());
|
||||
let t = s.get(c);
|
||||
o !== void 0 ? t === void 0 ? (s.set(c, t = { handleEvent: o }), l.addEventListener(c, t)) : t.handleEvent = o : t !== void 0 && (s.delete(c), l.removeEventListener(c, t));
|
||||
})(r, f, a);
|
||||
}, h = ({ react: r, tagName: u, elementClass: a, events: i, displayName: d }) => {
|
||||
const f = new Set(Object.keys(i ?? {})), l = r.forwardRef((c, o) => {
|
||||
const s = r.useRef(/* @__PURE__ */ new Map()), t = r.useRef(null), p = {}, v = {};
|
||||
for (const [e, n] of Object.entries(c)) w.has(e) ? p[e === "className" ? "class" : e] = n : f.has(e) || e in a.prototype ? v[e] = n : p[e] = n;
|
||||
return r.useLayoutEffect(() => {
|
||||
if (t.current === null) return;
|
||||
const e = /* @__PURE__ */ new Map();
|
||||
for (const n in v) y(t.current, n, c[n], s.current.get(n), i), s.current.delete(n), e.set(n, c[n]);
|
||||
for (const [n, E] of s.current) y(t.current, n, void 0, E, i);
|
||||
s.current = e;
|
||||
}), r.useLayoutEffect(() => {
|
||||
var e;
|
||||
(e = t.current) == null || e.removeAttribute("defer-hydration");
|
||||
}, []), p.suppressHydrationWarning = !0, r.createElement(u, { ...p, ref: r.useCallback((e) => {
|
||||
t.current = e, typeof o == "function" ? o(e) : o !== null && (o.current = e);
|
||||
}, [o]) });
|
||||
});
|
||||
return l.displayName = d ?? a.name, l;
|
||||
};
|
||||
export {
|
||||
h as o
|
||||
};
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
"use strict";/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/const w=new Set(["children","localName","ref","style","className"]),p=new WeakMap,y=(r,l,a,i,d)=>{const f=d==null?void 0:d[l];f===void 0?(r[l]=a,a==null&&l in HTMLElement.prototype&&r.removeAttribute(l)):a!==i&&((u,c,o)=>{let s=p.get(u);s===void 0&&p.set(u,s=new Map);let t=s.get(c);o!==void 0?t===void 0?(s.set(c,t={handleEvent:o}),u.addEventListener(c,t)):t.handleEvent=o:t!==void 0&&(s.delete(c),u.removeEventListener(c,t))})(r,f,a)},h=({react:r,tagName:l,elementClass:a,events:i,displayName:d})=>{const f=new Set(Object.keys(i??{})),u=r.forwardRef((c,o)=>{const s=r.useRef(new Map),t=r.useRef(null),v={},m={};for(const[e,n]of Object.entries(c))w.has(e)?v[e==="className"?"class":e]=n:f.has(e)||e in a.prototype?m[e]=n:v[e]=n;return r.useLayoutEffect(()=>{if(t.current===null)return;const e=new Map;for(const n in m)y(t.current,n,c[n],s.current.get(n),i),s.current.delete(n),e.set(n,c[n]);for(const[n,E]of s.current)y(t.current,n,void 0,E,i);s.current=e}),r.useLayoutEffect(()=>{var e;(e=t.current)==null||e.removeAttribute("defer-hydration")},[]),v.suppressHydrationWarning=!0,r.createElement(l,{...v,ref:r.useCallback(e=>{t.current=e,typeof o=="function"?o(e):o!==null&&(o.current=e)},[o])})});return u.displayName=d??a.name,u};exports.o=h;
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
"use strict";require("./class-map-DV5418hw.js");/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const p=["role","ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText"],A=p.map(b);function n(e){return A.includes(e)}function b(e){return e.replace("aria","aria-").replace(/Elements?/g,"").toLowerCase()}/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const u=Symbol("privateIgnoreAttributeChangesFor");function h(e){var r;class a extends e{constructor(){super(...arguments),this[r]=new Set}attributeChangedCallback(t,i,s){if(!n(t)){super.attributeChangedCallback(t,i,s);return}if(this[u].has(t))return;this[u].add(t),this.removeAttribute(t),this[u].delete(t);const d=c(t);s===null?delete this.dataset[d]:this.dataset[d]=s,this.requestUpdate(c(t),i)}getAttribute(t){return n(t)?super.getAttribute(l(t)):super.getAttribute(t)}removeAttribute(t){super.removeAttribute(t),n(t)&&(super.removeAttribute(l(t)),this.requestUpdate())}}return r=u,f(a),a}function f(e){for(const r of p){const a=b(r),o=l(a),t=c(a);e.createProperty(r,{attribute:a,noAccessor:!0}),e.createProperty(Symbol(o),{attribute:o,noAccessor:!0}),Object.defineProperty(e.prototype,r,{configurable:!0,enumerable:!0,get(){return this.dataset[t]??null},set(i){const s=this.dataset[t]??null;i!==s&&(i===null?delete this.dataset[t]:this.dataset[t]=i,this.requestUpdate(r,s))}})}}function l(e){return`data-${e}`}function c(e){return e.replace(/-\w/,r=>r[1].toUpperCase())}exports.mixinDelegatesAria=h;
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
import "./class-map-CwiboTfb.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const d = [
|
||||
"role",
|
||||
"ariaAtomic",
|
||||
"ariaAutoComplete",
|
||||
"ariaBusy",
|
||||
"ariaChecked",
|
||||
"ariaColCount",
|
||||
"ariaColIndex",
|
||||
"ariaColSpan",
|
||||
"ariaCurrent",
|
||||
"ariaDisabled",
|
||||
"ariaExpanded",
|
||||
"ariaHasPopup",
|
||||
"ariaHidden",
|
||||
"ariaInvalid",
|
||||
"ariaKeyShortcuts",
|
||||
"ariaLabel",
|
||||
"ariaLevel",
|
||||
"ariaLive",
|
||||
"ariaModal",
|
||||
"ariaMultiLine",
|
||||
"ariaMultiSelectable",
|
||||
"ariaOrientation",
|
||||
"ariaPlaceholder",
|
||||
"ariaPosInSet",
|
||||
"ariaPressed",
|
||||
"ariaReadOnly",
|
||||
"ariaRequired",
|
||||
"ariaRoleDescription",
|
||||
"ariaRowCount",
|
||||
"ariaRowIndex",
|
||||
"ariaRowSpan",
|
||||
"ariaSelected",
|
||||
"ariaSetSize",
|
||||
"ariaSort",
|
||||
"ariaValueMax",
|
||||
"ariaValueMin",
|
||||
"ariaValueNow",
|
||||
"ariaValueText"
|
||||
], A = d.map(b);
|
||||
function n(e) {
|
||||
return A.includes(e);
|
||||
}
|
||||
function b(e) {
|
||||
return e.replace("aria", "aria-").replace(/Elements?/g, "").toLowerCase();
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const s = Symbol("privateIgnoreAttributeChangesFor");
|
||||
function g(e) {
|
||||
var r;
|
||||
class a extends e {
|
||||
constructor() {
|
||||
super(...arguments), this[r] = /* @__PURE__ */ new Set();
|
||||
}
|
||||
attributeChangedCallback(t, i, o) {
|
||||
if (!n(t)) {
|
||||
super.attributeChangedCallback(t, i, o);
|
||||
return;
|
||||
}
|
||||
if (this[s].has(t))
|
||||
return;
|
||||
this[s].add(t), this.removeAttribute(t), this[s].delete(t);
|
||||
const c = p(t);
|
||||
o === null ? delete this.dataset[c] : this.dataset[c] = o, this.requestUpdate(p(t), i);
|
||||
}
|
||||
getAttribute(t) {
|
||||
return n(t) ? super.getAttribute(l(t)) : super.getAttribute(t);
|
||||
}
|
||||
removeAttribute(t) {
|
||||
super.removeAttribute(t), n(t) && (super.removeAttribute(l(t)), this.requestUpdate());
|
||||
}
|
||||
}
|
||||
return r = s, h(a), a;
|
||||
}
|
||||
function h(e) {
|
||||
for (const r of d) {
|
||||
const a = b(r), u = l(a), t = p(a);
|
||||
e.createProperty(r, {
|
||||
attribute: a,
|
||||
noAccessor: !0
|
||||
}), e.createProperty(Symbol(u), {
|
||||
attribute: u,
|
||||
noAccessor: !0
|
||||
}), Object.defineProperty(e.prototype, r, {
|
||||
configurable: !0,
|
||||
enumerable: !0,
|
||||
get() {
|
||||
return this.dataset[t] ?? null;
|
||||
},
|
||||
set(i) {
|
||||
const o = this.dataset[t] ?? null;
|
||||
i !== o && (i === null ? delete this.dataset[t] : this.dataset[t] = i, this.requestUpdate(r, o));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function l(e) {
|
||||
return `data-${e}`;
|
||||
}
|
||||
function p(e) {
|
||||
return e.replace(/-\w/, (r) => r[1].toUpperCase());
|
||||
}
|
||||
export {
|
||||
g as m
|
||||
};
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
"use strict";const e=require("./class-map-DV5418hw.js");/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/class t extends e.r{constructor(){super(...arguments),this.inset=!1,this.insetStart=!1,this.insetEnd=!1}}e.__decorate([e.n({type:Boolean,reflect:!0})],t.prototype,"inset",void 0);e.__decorate([e.n({type:Boolean,reflect:!0,attribute:"inset-start"})],t.prototype,"insetStart",void 0);e.__decorate([e.n({type:Boolean,reflect:!0,attribute:"inset-end"})],t.prototype,"insetEnd",void 0);/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const r=e.i$1`:host{box-sizing:border-box;color:var(--md-divider-color, var(--md-sys-color-outline-variant, #cac4d0));display:flex;height:var(--md-divider-thickness, 1px);width:100%}:host([inset]),:host([inset-start]){padding-inline-start:16px}:host([inset]),:host([inset-end]){padding-inline-end:16px}:host::before{background:currentColor;content:"";height:100%;width:100%}@media(forced-colors: active){:host::before{background:CanvasText}}
|
||||
`;/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/let s=class extends t{};s.styles=[r];s=e.__decorate([e.t$1("md-divider")],s);
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
import { _ as t, n as i, r, a as n, b as d } from "./class-map-CwiboTfb.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
class e extends r {
|
||||
constructor() {
|
||||
super(...arguments), this.inset = !1, this.insetStart = !1, this.insetEnd = !1;
|
||||
}
|
||||
}
|
||||
t([
|
||||
i({ type: Boolean, reflect: !0 })
|
||||
], e.prototype, "inset", void 0);
|
||||
t([
|
||||
i({ type: Boolean, reflect: !0, attribute: "inset-start" })
|
||||
], e.prototype, "insetStart", void 0);
|
||||
t([
|
||||
i({ type: Boolean, reflect: !0, attribute: "inset-end" })
|
||||
], e.prototype, "insetEnd", void 0);
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const a = n`:host{box-sizing:border-box;color:var(--md-divider-color, var(--md-sys-color-outline-variant, #cac4d0));display:flex;height:var(--md-divider-thickness, 1px);width:100%}:host([inset]),:host([inset-start]){padding-inline-start:16px}:host([inset]),:host([inset-end]){padding-inline-end:16px}:host::before{background:currentColor;content:"";height:100%;width:100%}@media(forced-colors: active){:host::before{background:CanvasText}}
|
||||
`;
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
let s = class extends e {
|
||||
};
|
||||
s.styles = [a];
|
||||
s = t([
|
||||
d("md-divider")
|
||||
], s);
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const s = Symbol("internals"), t = Symbol("privateInternals");
|
||||
function i(n) {
|
||||
class e extends n {
|
||||
get [s]() {
|
||||
return this[t] || (this[t] = this.attachInternals()), this[t];
|
||||
}
|
||||
}
|
||||
return e;
|
||||
}
|
||||
export {
|
||||
s as i,
|
||||
i as m
|
||||
};
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
"use strict";/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const t=Symbol("internals"),n=Symbol("privateInternals");function i(e){class s extends e{get[t](){return this[n]||(this[n]=this.attachInternals()),this[n]}}return s}exports.internals=t;exports.mixinElementInternals=i;
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
"use strict";const a=require("./class-map-DV5418hw.js");/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/class o extends a.r{connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){return a.x`<span class="shadow"></span>`}}/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const r=a.i$1`:host,.shadow,.shadow::before,.shadow::after{border-radius:inherit;inset:0;position:absolute;transition-duration:inherit;transition-property:inherit;transition-timing-function:inherit}:host{display:flex;pointer-events:none;transition-property:box-shadow,opacity}.shadow::before,.shadow::after{content:"";transition-property:box-shadow,opacity;--_level: var(--md-elevation-level, 0);--_shadow-color: var(--md-elevation-shadow-color, var(--md-sys-color-shadow, #000))}.shadow::before{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 3,1) + 2*clamp(0,var(--_level) - 4,1))) calc(1px*(2*clamp(0,var(--_level),1) + clamp(0,var(--_level) - 2,1) + clamp(0,var(--_level) - 4,1))) 0px var(--_shadow-color);opacity:.3}.shadow::after{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 1,1) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(3*clamp(0,var(--_level),2) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(clamp(0,var(--_level),4) + 2*clamp(0,var(--_level) - 4,1))) var(--_shadow-color);opacity:.15}
|
||||
`;/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/let e=class extends o{};e.styles=[r];e=a.__decorate([a.t$1("md-elevation")],e);
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
import { r as l, x as o, a as r, _ as t, b as s } from "./class-map-CwiboTfb.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
class c extends l {
|
||||
connectedCallback() {
|
||||
super.connectedCallback(), this.setAttribute("aria-hidden", "true");
|
||||
}
|
||||
render() {
|
||||
return o`<span class="shadow"></span>`;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const i = r`:host,.shadow,.shadow::before,.shadow::after{border-radius:inherit;inset:0;position:absolute;transition-duration:inherit;transition-property:inherit;transition-timing-function:inherit}:host{display:flex;pointer-events:none;transition-property:box-shadow,opacity}.shadow::before,.shadow::after{content:"";transition-property:box-shadow,opacity;--_level: var(--md-elevation-level, 0);--_shadow-color: var(--md-elevation-shadow-color, var(--md-sys-color-shadow, #000))}.shadow::before{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 3,1) + 2*clamp(0,var(--_level) - 4,1))) calc(1px*(2*clamp(0,var(--_level),1) + clamp(0,var(--_level) - 2,1) + clamp(0,var(--_level) - 4,1))) 0px var(--_shadow-color);opacity:.3}.shadow::after{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 1,1) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(3*clamp(0,var(--_level),2) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(clamp(0,var(--_level),4) + 2*clamp(0,var(--_level) - 4,1))) var(--_shadow-color);opacity:.15}
|
||||
`;
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
let a = class extends c {
|
||||
};
|
||||
a.styles = [i];
|
||||
a = t([
|
||||
s("md-elevation")
|
||||
], a);
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
import { _ as h, n as x } from "./class-map-CwiboTfb.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const s = Symbol("isFocusable"), r = Symbol("privateIsFocusable"), a = Symbol("externalTabIndex"), n = Symbol("isUpdatingTabIndex"), i = Symbol("updateTabIndex");
|
||||
function m(l) {
|
||||
var b, o, c;
|
||||
class u extends l {
|
||||
constructor() {
|
||||
super(...arguments), this[b] = !0, this[o] = null, this[c] = !1;
|
||||
}
|
||||
get [s]() {
|
||||
return this[r];
|
||||
}
|
||||
set [s](t) {
|
||||
this[s] !== t && (this[r] = t, this[i]());
|
||||
}
|
||||
connectedCallback() {
|
||||
super.connectedCallback(), this[i]();
|
||||
}
|
||||
attributeChangedCallback(t, e, d) {
|
||||
if (t !== "tabindex") {
|
||||
super.attributeChangedCallback(t, e, d);
|
||||
return;
|
||||
}
|
||||
if (this.requestUpdate("tabIndex", Number(e ?? -1)), !this[n]) {
|
||||
if (!this.hasAttribute("tabindex")) {
|
||||
this[a] = null, this[i]();
|
||||
return;
|
||||
}
|
||||
this[a] = this.tabIndex;
|
||||
}
|
||||
}
|
||||
[(b = r, o = a, c = n, i)]() {
|
||||
const t = this[s] ? 0 : -1, e = this[a] ?? t;
|
||||
this[n] = !0, this.tabIndex = e, this[n] = !1;
|
||||
}
|
||||
}
|
||||
return h([
|
||||
x({ noAccessor: !0 })
|
||||
], u.prototype, "tabIndex", void 0), u;
|
||||
}
|
||||
export {
|
||||
m
|
||||
};
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
"use strict";const l=require("./class-map-DV5418hw.js");/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const s=Symbol("isFocusable"),r=Symbol("privateIsFocusable"),a=Symbol("externalTabIndex"),n=Symbol("isUpdatingTabIndex"),i=Symbol("updateTabIndex");function x(d){var b,c,u;class o extends d{constructor(){super(...arguments),this[b]=!0,this[c]=null,this[u]=!1}get[s](){return this[r]}set[s](t){this[s]!==t&&(this[r]=t,this[i]())}connectedCallback(){super.connectedCallback(),this[i]()}attributeChangedCallback(t,e,h){if(t!=="tabindex"){super.attributeChangedCallback(t,e,h);return}if(this.requestUpdate("tabIndex",Number(e??-1)),!this[n]){if(!this.hasAttribute("tabindex")){this[a]=null,this[i]();return}this[a]=this.tabIndex}}[(b=r,c=a,u=n,i)](){const t=this[s]?0:-1,e=this[a]??t;this[n]=!0,this.tabIndex=e,this[n]=!1}}return l.__decorate([l.n({noAccessor:!0})],o.prototype,"tabIndex",void 0),o}exports.mixinFocusable=x;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
"use strict";const s=require("./class-map-DV5418hw.js"),l=require("./element-internals-OOm6rgx-.js");/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const a=Symbol("getFormValue"),n=Symbol("getFormState");function d(o){class r extends o{get form(){return this[l.internals].form}get labels(){return this[l.internals].labels}get name(){return this.getAttribute("name")??""}set name(e){this.setAttribute("name",e)}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e)}attributeChangedCallback(e,t,i){if(e==="name"||e==="disabled"){const u=e==="disabled"?t!==null:t;this.requestUpdate(e,u);return}super.attributeChangedCallback(e,t,i)}requestUpdate(e,t,i){super.requestUpdate(e,t,i),this[l.internals].setFormValue(this[a](),this[n]())}[a](){throw new Error("Implement [getFormValue]")}[n](){return this[a]()}formDisabledCallback(e){this.disabled=e}}return r.formAssociated=!0,s.__decorate([s.n({noAccessor:!0})],r.prototype,"name",null),s.__decorate([s.n({type:Boolean,noAccessor:!0})],r.prototype,"disabled",null),r}exports.getFormState=n;exports.getFormValue=a;exports.mixinFormAssociated=d;
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
import { _ as i, n as l } from "./class-map-CwiboTfb.mjs";
|
||||
import { i as a } from "./element-internals-3IY9gE4L.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const o = Symbol("getFormValue"), n = Symbol("getFormState");
|
||||
function h(u) {
|
||||
class r extends u {
|
||||
get form() {
|
||||
return this[a].form;
|
||||
}
|
||||
get labels() {
|
||||
return this[a].labels;
|
||||
}
|
||||
// Use @property for the `name` and `disabled` properties to add them to the
|
||||
// `observedAttributes` array and trigger `attributeChangedCallback()`.
|
||||
//
|
||||
// We don't use Lit's default getter/setter (`noAccessor: true`) because
|
||||
// the attributes need to be updated synchronously to work with synchronous
|
||||
// form APIs, and Lit updates attributes async by default.
|
||||
get name() {
|
||||
return this.getAttribute("name") ?? "";
|
||||
}
|
||||
set name(t) {
|
||||
this.setAttribute("name", t);
|
||||
}
|
||||
get disabled() {
|
||||
return this.hasAttribute("disabled");
|
||||
}
|
||||
set disabled(t) {
|
||||
this.toggleAttribute("disabled", t);
|
||||
}
|
||||
attributeChangedCallback(t, e, s) {
|
||||
if (t === "name" || t === "disabled") {
|
||||
const d = t === "disabled" ? e !== null : e;
|
||||
this.requestUpdate(t, d);
|
||||
return;
|
||||
}
|
||||
super.attributeChangedCallback(t, e, s);
|
||||
}
|
||||
requestUpdate(t, e, s) {
|
||||
super.requestUpdate(t, e, s), this[a].setFormValue(this[o](), this[n]());
|
||||
}
|
||||
[o]() {
|
||||
throw new Error("Implement [getFormValue]");
|
||||
}
|
||||
[n]() {
|
||||
return this[o]();
|
||||
}
|
||||
formDisabledCallback(t) {
|
||||
this.disabled = t;
|
||||
}
|
||||
}
|
||||
return r.formAssociated = !0, i([
|
||||
l({ noAccessor: !0 })
|
||||
], r.prototype, "name", null), i([
|
||||
l({ type: Boolean, noAccessor: !0 })
|
||||
], r.prototype, "disabled", null), r;
|
||||
}
|
||||
export {
|
||||
n as a,
|
||||
o as g,
|
||||
h as m
|
||||
};
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
"use strict";/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/function c(t){const i=new MouseEvent("click",{bubbles:!0});return t.dispatchEvent(i),i}function n(t){return t.currentTarget!==t.target||t.composedPath()[0]!==t.target||t.target.disabled?!1:!s(t)}function s(t){const i=e;return i&&(t.preventDefault(),t.stopImmediatePropagation()),a(),i}let e=!1;async function a(){e=!0,await null,e=!1}exports.dispatchActivationClick=c;exports.isActivationClick=n;
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
function r(t) {
|
||||
const e = new MouseEvent("click", { bubbles: !0 });
|
||||
return t.dispatchEvent(e), e;
|
||||
}
|
||||
function s(t) {
|
||||
return t.currentTarget !== t.target || t.composedPath()[0] !== t.target || t.target.disabled ? !1 : !a(t);
|
||||
}
|
||||
function a(t) {
|
||||
const e = i;
|
||||
return e && (t.preventDefault(), t.stopImmediatePropagation()), n(), e;
|
||||
}
|
||||
let i = !1;
|
||||
async function n() {
|
||||
i = !0, await null, i = !1;
|
||||
}
|
||||
export {
|
||||
r as d,
|
||||
s as i
|
||||
};
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
import "./class-map-CwiboTfb.mjs";
|
||||
import { i as o } from "./element-internals-3IY9gE4L.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
function l(u) {
|
||||
u.addInitializer((s) => {
|
||||
const e = s;
|
||||
e.addEventListener("click", async (a) => {
|
||||
const { type: n, [o]: i } = e, { form: t } = i;
|
||||
if (!(!t || n === "button") && (await new Promise((r) => {
|
||||
setTimeout(r);
|
||||
}), !a.defaultPrevented)) {
|
||||
if (n === "reset") {
|
||||
t.reset();
|
||||
return;
|
||||
}
|
||||
t.addEventListener("submit", (r) => {
|
||||
Object.defineProperty(r, "submitter", {
|
||||
configurable: !0,
|
||||
enumerable: !0,
|
||||
get: () => e
|
||||
});
|
||||
}, { capture: !0, once: !0 }), i.setFormValue(e.value), t.requestSubmit();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
export {
|
||||
l as s
|
||||
};
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
"use strict";require("./class-map-DV5418hw.js");const m=require("./element-internals-OOm6rgx-.js");/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/function o(i){i.addInitializer(s=>{const e=s;e.addEventListener("click",async a=>{const{type:n,[m.internals]:u}=e,{form:t}=u;if(!(!t||n==="button")&&(await new Promise(r=>{setTimeout(r)}),!a.defaultPrevented)){if(n==="reset"){t.reset();return}t.addEventListener("submit",r=>{Object.defineProperty(r,"submitter",{configurable:!0,enumerable:!0,get:()=>e})},{capture:!0,once:!0}),u.setFormValue(e.value),t.requestSubmit()}})})}exports.setupFormSubmitter=o;
|
||||
|
|
@ -0,0 +1,286 @@
|
|||
import { _ as p, n as C, r as S, x as z, a as L, b as P } from "./class-map-CwiboTfb.mjs";
|
||||
import { e as k } from "./animation-DjClVFum.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
let $;
|
||||
function K(s) {
|
||||
return (e, t) => k(e, t, { get() {
|
||||
return (this.renderRoot ?? $ ?? ($ = document.createDocumentFragment())).querySelectorAll(s);
|
||||
} });
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
function x(s, e = c) {
|
||||
const t = A(s, e);
|
||||
return t && (t.tabIndex = 0, t.focus()), t;
|
||||
}
|
||||
function w(s, e = c) {
|
||||
const t = _(s, e);
|
||||
return t && (t.tabIndex = 0, t.focus()), t;
|
||||
}
|
||||
function W(s, e = c) {
|
||||
const t = h(s, e);
|
||||
return t && (t.item.tabIndex = -1), t;
|
||||
}
|
||||
function h(s, e = c) {
|
||||
for (let t = 0; t < s.length; t++) {
|
||||
const i = s[t];
|
||||
if (i.tabIndex === 0 && e(i))
|
||||
return {
|
||||
item: i,
|
||||
index: t
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function A(s, e = c) {
|
||||
for (const t of s)
|
||||
if (e(t))
|
||||
return t;
|
||||
return null;
|
||||
}
|
||||
function _(s, e = c) {
|
||||
for (let t = s.length - 1; t >= 0; t--) {
|
||||
const i = s[t];
|
||||
if (e(i))
|
||||
return i;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function q(s, e, t = c, i = !0) {
|
||||
for (let a = 1; a < s.length; a++) {
|
||||
const n = (a + e) % s.length;
|
||||
if (n < e && !i)
|
||||
return null;
|
||||
const d = s[n];
|
||||
if (t(d))
|
||||
return d;
|
||||
}
|
||||
return s[e] ? s[e] : null;
|
||||
}
|
||||
function H(s, e, t = c, i = !0) {
|
||||
for (let a = 1; a < s.length; a++) {
|
||||
const n = (e - a + s.length) % s.length;
|
||||
if (n > e && !i)
|
||||
return null;
|
||||
const d = s[n];
|
||||
if (t(d))
|
||||
return d;
|
||||
}
|
||||
return s[e] ? s[e] : null;
|
||||
}
|
||||
function y(s, e, t = c, i = !0) {
|
||||
if (e) {
|
||||
const a = q(s, e.index, t, i);
|
||||
return a && (a.tabIndex = 0, a.focus()), a;
|
||||
} else
|
||||
return x(s, t);
|
||||
}
|
||||
function I(s, e, t = c, i = !0) {
|
||||
if (e) {
|
||||
const a = H(s, e.index, t, i);
|
||||
return a && (a.tabIndex = 0, a.focus()), a;
|
||||
} else
|
||||
return w(s, t);
|
||||
}
|
||||
function B() {
|
||||
return new Event("deactivate-items", { bubbles: !0, composed: !0 });
|
||||
}
|
||||
function X() {
|
||||
return new Event("request-activation", { bubbles: !0, composed: !0 });
|
||||
}
|
||||
function c(s) {
|
||||
return !s.disabled;
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const f = {
|
||||
ArrowDown: "ArrowDown",
|
||||
ArrowLeft: "ArrowLeft",
|
||||
ArrowUp: "ArrowUp",
|
||||
ArrowRight: "ArrowRight",
|
||||
Home: "Home",
|
||||
End: "End"
|
||||
};
|
||||
class j {
|
||||
constructor(e) {
|
||||
this.handleKeydown = (r) => {
|
||||
const o = r.key;
|
||||
if (r.defaultPrevented || !this.isNavigableKey(o))
|
||||
return;
|
||||
const m = this.items;
|
||||
if (!m.length)
|
||||
return;
|
||||
const l = h(m, this.isActivatable);
|
||||
r.preventDefault();
|
||||
const v = this.isRtl(), D = v ? f.ArrowRight : f.ArrowLeft, T = v ? f.ArrowLeft : f.ArrowRight;
|
||||
let u = null;
|
||||
switch (o) {
|
||||
case f.ArrowDown:
|
||||
case T:
|
||||
u = y(m, l, this.isActivatable, this.wrapNavigation());
|
||||
break;
|
||||
case f.ArrowUp:
|
||||
case D:
|
||||
u = I(m, l, this.isActivatable, this.wrapNavigation());
|
||||
break;
|
||||
case f.Home:
|
||||
u = x(m, this.isActivatable);
|
||||
break;
|
||||
case f.End:
|
||||
u = w(m, this.isActivatable);
|
||||
break;
|
||||
}
|
||||
u && l && l.item !== u && (l.item.tabIndex = -1);
|
||||
}, this.onDeactivateItems = () => {
|
||||
const r = this.items;
|
||||
for (const o of r)
|
||||
this.deactivateItem(o);
|
||||
}, this.onRequestActivation = (r) => {
|
||||
this.onDeactivateItems();
|
||||
const o = r.target;
|
||||
this.activateItem(o), o.focus();
|
||||
}, this.onSlotchange = () => {
|
||||
const r = this.items;
|
||||
let o = !1;
|
||||
for (const l of r) {
|
||||
if (!l.disabled && l.tabIndex > -1 && !o) {
|
||||
o = !0, l.tabIndex = 0;
|
||||
continue;
|
||||
}
|
||||
l.tabIndex = -1;
|
||||
}
|
||||
if (o)
|
||||
return;
|
||||
const m = A(r, this.isActivatable);
|
||||
m && (m.tabIndex = 0);
|
||||
};
|
||||
const { isItem: t, getPossibleItems: i, isRtl: a, deactivateItem: n, activateItem: d, isNavigableKey: N, isActivatable: R, wrapNavigation: E } = e;
|
||||
this.isItem = t, this.getPossibleItems = i, this.isRtl = a, this.deactivateItem = n, this.activateItem = d, this.isNavigableKey = N, this.isActivatable = R, this.wrapNavigation = E ?? (() => !0);
|
||||
}
|
||||
/**
|
||||
* The items being managed by the list. Additionally, attempts to see if the
|
||||
* object has a sub-item in the `.item` property.
|
||||
*/
|
||||
get items() {
|
||||
const e = this.getPossibleItems(), t = [];
|
||||
for (const i of e) {
|
||||
if (this.isItem(i)) {
|
||||
t.push(i);
|
||||
continue;
|
||||
}
|
||||
const n = i.item;
|
||||
n && this.isItem(n) && t.push(n);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
/**
|
||||
* Activates the next item in the list. If at the end of the list, the first
|
||||
* item will be activated.
|
||||
*
|
||||
* @return The activated list item or `null` if there are no items.
|
||||
*/
|
||||
activateNextItem() {
|
||||
const e = this.items, t = h(e, this.isActivatable);
|
||||
return t && (t.item.tabIndex = -1), y(e, t, this.isActivatable, this.wrapNavigation());
|
||||
}
|
||||
/**
|
||||
* Activates the previous item in the list. If at the start of the list, the
|
||||
* last item will be activated.
|
||||
*
|
||||
* @return The activated list item or `null` if there are no items.
|
||||
*/
|
||||
activatePreviousItem() {
|
||||
const e = this.items, t = h(e, this.isActivatable);
|
||||
return t && (t.item.tabIndex = -1), I(e, t, this.isActivatable, this.wrapNavigation());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
class b extends S {
|
||||
constructor() {
|
||||
super(...arguments), this.multiline = !1;
|
||||
}
|
||||
render() {
|
||||
return z`
|
||||
<slot name="container"></slot>
|
||||
<slot class="non-text" name="start"></slot>
|
||||
<div class="text">
|
||||
<slot name="overline" @slotchange=${this.handleTextSlotChange}></slot>
|
||||
<slot
|
||||
class="default-slot"
|
||||
@slotchange=${this.handleTextSlotChange}></slot>
|
||||
<slot name="headline" @slotchange=${this.handleTextSlotChange}></slot>
|
||||
<slot
|
||||
name="supporting-text"
|
||||
@slotchange=${this.handleTextSlotChange}></slot>
|
||||
</div>
|
||||
<slot class="non-text" name="trailing-supporting-text"></slot>
|
||||
<slot class="non-text" name="end"></slot>
|
||||
`;
|
||||
}
|
||||
handleTextSlotChange() {
|
||||
let e = !1, t = 0;
|
||||
for (const i of this.textSlots)
|
||||
if (M(i) && (t += 1), t > 1) {
|
||||
e = !0;
|
||||
break;
|
||||
}
|
||||
this.multiline = e;
|
||||
}
|
||||
}
|
||||
p([
|
||||
C({ type: Boolean, reflect: !0 })
|
||||
], b.prototype, "multiline", void 0);
|
||||
p([
|
||||
K(".text slot")
|
||||
], b.prototype, "textSlots", void 0);
|
||||
function M(s) {
|
||||
var e;
|
||||
for (const t of s.assignedNodes({ flatten: !0 })) {
|
||||
const i = t.nodeType === Node.ELEMENT_NODE, a = t.nodeType === Node.TEXT_NODE && ((e = t.textContent) == null ? void 0 : e.match(/\S/));
|
||||
if (i || a)
|
||||
return !0;
|
||||
}
|
||||
return !1;
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const F = L`:host{color:var(--md-sys-color-on-surface, #1d1b20);font-family:var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-large-size, 1rem);font-weight:var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400));line-height:var(--md-sys-typescale-body-large-line-height, 1.5rem);align-items:center;box-sizing:border-box;display:flex;gap:16px;min-height:56px;overflow:hidden;padding:12px 16px;position:relative;text-overflow:ellipsis}:host([multiline]){min-height:72px}[name=overline]{color:var(--md-sys-color-on-surface-variant, #49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, 0.6875rem);font-weight:var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=supporting-text]{color:var(--md-sys-color-on-surface-variant, #49454f);font-family:var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-medium-size, 0.875rem);font-weight:var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400));line-height:var(--md-sys-typescale-body-medium-line-height, 1.25rem)}[name=trailing-supporting-text]{color:var(--md-sys-color-on-surface-variant, #49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, 0.6875rem);font-weight:var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=container]::slotted(*){inset:0;position:absolute}.default-slot{display:inline}.default-slot,.text ::slotted(*){overflow:hidden;text-overflow:ellipsis}.text{display:flex;flex:1;flex-direction:column;overflow:hidden}
|
||||
`;
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
let g = class extends b {
|
||||
};
|
||||
g.styles = [F];
|
||||
g = p([
|
||||
P("md-item")
|
||||
], g);
|
||||
export {
|
||||
j as L,
|
||||
f as N,
|
||||
X as a,
|
||||
h as b,
|
||||
B as c,
|
||||
W as d,
|
||||
_ as e,
|
||||
A as g
|
||||
};
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
"use strict";const u=require("./class-map-DV5418hw.js"),L=require("./animation-A38fZ1oY.js");/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/let S;function z(i){return(e,t)=>L.e(e,t,{get(){return(this.renderRoot??S??(S=document.createDocumentFragment())).querySelectorAll(i)}})}/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/function w(i,e=c){const t=y(i,e);return t&&(t.tabIndex=0,t.focus()),t}function A(i,e=c){const t=N(i,e);return t&&(t.tabIndex=0,t.focus()),t}function P(i,e=c){const t=v(i,e);return t&&(t.item.tabIndex=-1),t}function v(i,e=c){for(let t=0;t<i.length;t++){const s=i[t];if(s.tabIndex===0&&e(s))return{item:s,index:t}}return null}function y(i,e=c){for(const t of i)if(e(t))return t;return null}function N(i,e=c){for(let t=i.length-1;t>=0;t--){const s=i[t];if(e(s))return s}return null}function _(i,e,t=c,s=!0){for(let n=1;n<i.length;n++){const a=(n+e)%i.length;if(a<e&&!s)return null;const d=i[a];if(t(d))return d}return i[e]?i[e]:null}function k(i,e,t=c,s=!0){for(let n=1;n<i.length;n++){const a=(e-n+i.length)%i.length;if(a>e&&!s)return null;const d=i[a];if(t(d))return d}return i[e]?i[e]:null}function I(i,e,t=c,s=!0){if(e){const n=_(i,e.index,t,s);return n&&(n.tabIndex=0,n.focus()),n}else return w(i,t)}function x(i,e,t=c,s=!0){if(e){const n=k(i,e.index,t,s);return n&&(n.tabIndex=0,n.focus()),n}else return A(i,t)}function q(){return new Event("deactivate-items",{bubbles:!0,composed:!0})}function K(){return new Event("request-activation",{bubbles:!0,composed:!0})}function c(i){return!i.disabled}/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const f={ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",Home:"Home",End:"End"};class ${constructor(e){this.handleKeydown=r=>{const o=r.key;if(r.defaultPrevented||!this.isNavigableKey(o))return;const m=this.items;if(!m.length)return;const l=v(m,this.isActivatable);r.preventDefault();const g=this.isRtl(),C=g?f.ArrowRight:f.ArrowLeft,T=g?f.ArrowLeft:f.ArrowRight;let h=null;switch(o){case f.ArrowDown:case T:h=I(m,l,this.isActivatable,this.wrapNavigation());break;case f.ArrowUp:case C:h=x(m,l,this.isActivatable,this.wrapNavigation());break;case f.Home:h=w(m,this.isActivatable);break;case f.End:h=A(m,this.isActivatable);break}h&&l&&l.item!==h&&(l.item.tabIndex=-1)},this.onDeactivateItems=()=>{const r=this.items;for(const o of r)this.deactivateItem(o)},this.onRequestActivation=r=>{this.onDeactivateItems();const o=r.target;this.activateItem(o),o.focus()},this.onSlotchange=()=>{const r=this.items;let o=!1;for(const l of r){if(!l.disabled&&l.tabIndex>-1&&!o){o=!0,l.tabIndex=0;continue}l.tabIndex=-1}if(o)return;const m=y(r,this.isActivatable);m&&(m.tabIndex=0)};const{isItem:t,getPossibleItems:s,isRtl:n,deactivateItem:a,activateItem:d,isNavigableKey:R,isActivatable:E,wrapNavigation:D}=e;this.isItem=t,this.getPossibleItems=s,this.isRtl=n,this.deactivateItem=a,this.activateItem=d,this.isNavigableKey=R,this.isActivatable=E,this.wrapNavigation=D??(()=>!0)}get items(){const e=this.getPossibleItems(),t=[];for(const s of e){if(this.isItem(s)){t.push(s);continue}const a=s.item;a&&this.isItem(a)&&t.push(a)}return t}activateNextItem(){const e=this.items,t=v(e,this.isActivatable);return t&&(t.item.tabIndex=-1),I(e,t,this.isActivatable,this.wrapNavigation())}activatePreviousItem(){const e=this.items,t=v(e,this.isActivatable);return t&&(t.item.tabIndex=-1),x(e,t,this.isActivatable,this.wrapNavigation())}}/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/class p extends u.r{constructor(){super(...arguments),this.multiline=!1}render(){return u.x`
|
||||
<slot name="container"></slot>
|
||||
<slot class="non-text" name="start"></slot>
|
||||
<div class="text">
|
||||
<slot name="overline" @slotchange=${this.handleTextSlotChange}></slot>
|
||||
<slot
|
||||
class="default-slot"
|
||||
@slotchange=${this.handleTextSlotChange}></slot>
|
||||
<slot name="headline" @slotchange=${this.handleTextSlotChange}></slot>
|
||||
<slot
|
||||
name="supporting-text"
|
||||
@slotchange=${this.handleTextSlotChange}></slot>
|
||||
</div>
|
||||
<slot class="non-text" name="trailing-supporting-text"></slot>
|
||||
<slot class="non-text" name="end"></slot>
|
||||
`}handleTextSlotChange(){let e=!1,t=0;for(const s of this.textSlots)if(M(s)&&(t+=1),t>1){e=!0;break}this.multiline=e}}u.__decorate([u.n({type:Boolean,reflect:!0})],p.prototype,"multiline",void 0);u.__decorate([z(".text slot")],p.prototype,"textSlots",void 0);function M(i){var e;for(const t of i.assignedNodes({flatten:!0})){const s=t.nodeType===Node.ELEMENT_NODE,n=t.nodeType===Node.TEXT_NODE&&((e=t.textContent)==null?void 0:e.match(/\S/));if(s||n)return!0}return!1}/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const F=u.i$1`:host{color:var(--md-sys-color-on-surface, #1d1b20);font-family:var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-large-size, 1rem);font-weight:var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400));line-height:var(--md-sys-typescale-body-large-line-height, 1.5rem);align-items:center;box-sizing:border-box;display:flex;gap:16px;min-height:56px;overflow:hidden;padding:12px 16px;position:relative;text-overflow:ellipsis}:host([multiline]){min-height:72px}[name=overline]{color:var(--md-sys-color-on-surface-variant, #49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, 0.6875rem);font-weight:var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=supporting-text]{color:var(--md-sys-color-on-surface-variant, #49454f);font-family:var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-medium-size, 0.875rem);font-weight:var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400));line-height:var(--md-sys-typescale-body-medium-line-height, 1.25rem)}[name=trailing-supporting-text]{color:var(--md-sys-color-on-surface-variant, #49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, 0.6875rem);font-weight:var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=container]::slotted(*){inset:0;position:absolute}.default-slot{display:inline}.default-slot,.text ::slotted(*){overflow:hidden;text-overflow:ellipsis}.text{display:flex;flex:1;flex-direction:column;overflow:hidden}
|
||||
`;/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/let b=class extends p{};b.styles=[F];b=u.__decorate([u.t$1("md-item")],b);exports.ListController=$;exports.NavigableKeys=f;exports.createDeactivateItemsEvent=q;exports.createRequestActivationEvent=K;exports.deactivateActiveItem=P;exports.getActiveItem=v;exports.getFirstActivatableItem=y;exports.getLastActivatableItem=N;
|
||||
|
|
@ -0,0 +1,874 @@
|
|||
import { _ as r, n as u, r as J, x as z, c as ee, E as te, a as V, b as ie } from "./class-map-CwiboTfb.mjs";
|
||||
import "./elevation-Dg8ssDJC.mjs";
|
||||
import "./ripple-pQcEjR05.mjs";
|
||||
import { r as ne, a as j, c as se, E as _ } from "./animation-DjClVFum.mjs";
|
||||
import { o as oe } from "./query-assigned-elements-DUhez03i.mjs";
|
||||
import { o as ae } from "./style-map-CdUj7GnE.mjs";
|
||||
import { N as S, L as re, b as le, e as ce, g as de } from "./item-CpL4zUlE.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
function he(g, e) {
|
||||
return new CustomEvent("close-menu", {
|
||||
bubbles: !0,
|
||||
composed: !0,
|
||||
detail: { initiator: g, reason: e, itemPath: [g] }
|
||||
});
|
||||
}
|
||||
const Y = he;
|
||||
function Ae() {
|
||||
return new Event("deactivate-typeahead", { bubbles: !0, composed: !0 });
|
||||
}
|
||||
function Oe() {
|
||||
return new Event("activate-typeahead", { bubbles: !0, composed: !0 });
|
||||
}
|
||||
const Re = {
|
||||
UP: "ArrowUp",
|
||||
DOWN: "ArrowDown",
|
||||
RIGHT: "ArrowRight",
|
||||
LEFT: "ArrowLeft"
|
||||
}, W = {
|
||||
SPACE: "Space",
|
||||
ENTER: "Enter"
|
||||
}, q = {
|
||||
CLICK_SELECTION: "click-selection",
|
||||
KEYDOWN: "keydown"
|
||||
}, pe = {
|
||||
ESCAPE: "Escape",
|
||||
SPACE: W.SPACE,
|
||||
ENTER: W.ENTER
|
||||
};
|
||||
function Z(g) {
|
||||
return Object.values(pe).some((e) => e === g);
|
||||
}
|
||||
function ke(g) {
|
||||
return Object.values(W).some((e) => e === g);
|
||||
}
|
||||
function G(g, e) {
|
||||
const t = new Event("md-contains", { bubbles: !0, composed: !0 });
|
||||
let i = [];
|
||||
const s = (p) => {
|
||||
i = p.composedPath();
|
||||
};
|
||||
return e.addEventListener("md-contains", s), g.dispatchEvent(t), e.removeEventListener("md-contains", s), i.length > 0;
|
||||
}
|
||||
const B = {
|
||||
NONE: "none",
|
||||
LIST_ROOT: "list-root",
|
||||
FIRST_ITEM: "first-item",
|
||||
LAST_ITEM: "last-item"
|
||||
};
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const X = {
|
||||
END_START: "end-start",
|
||||
END_END: "end-end",
|
||||
START_START: "start-start",
|
||||
START_END: "start-end"
|
||||
};
|
||||
class ue {
|
||||
/**
|
||||
* @param host The host to connect the controller to.
|
||||
* @param getProperties A function that returns the properties for the
|
||||
* controller.
|
||||
*/
|
||||
constructor(e, t) {
|
||||
this.host = e, this.getProperties = t, this.surfaceStylesInternal = {
|
||||
display: "none"
|
||||
}, this.lastValues = {
|
||||
isOpen: !1
|
||||
}, this.host.addController(this);
|
||||
}
|
||||
/**
|
||||
* The StyleInfo map to apply to the surface via Lit's stylemap
|
||||
*/
|
||||
get surfaceStyles() {
|
||||
return this.surfaceStylesInternal;
|
||||
}
|
||||
/**
|
||||
* Calculates the surface's new position required so that the surface's
|
||||
* `surfaceCorner` aligns to the anchor's `anchorCorner` while keeping the
|
||||
* surface inside the window viewport. This positioning also respects RTL by
|
||||
* checking `getComputedStyle()` on the surface element.
|
||||
*/
|
||||
async position() {
|
||||
const { surfaceEl: e, anchorEl: t, anchorCorner: i, surfaceCorner: s, positioning: n, xOffset: p, yOffset: a, disableBlockFlip: o, disableInlineFlip: m, repositionStrategy: v } = this.getProperties(), I = i.toLowerCase().trim(), w = s.toLowerCase().trim();
|
||||
if (!e || !t)
|
||||
return;
|
||||
const b = window.innerWidth, C = window.innerHeight, c = document.createElement("div");
|
||||
c.style.opacity = "0", c.style.position = "fixed", c.style.display = "block", c.style.inset = "0", document.body.appendChild(c);
|
||||
const f = c.getBoundingClientRect();
|
||||
c.remove();
|
||||
const x = window.innerHeight - f.bottom, d = window.innerWidth - f.right;
|
||||
this.surfaceStylesInternal = {
|
||||
display: "block",
|
||||
opacity: "0"
|
||||
}, this.host.requestUpdate(), await this.host.updateComplete, e.popover && e.isConnected && e.showPopover();
|
||||
const E = e.getSurfacePositionClientRect ? e.getSurfacePositionClientRect() : e.getBoundingClientRect(), y = t.getSurfacePositionClientRect ? t.getSurfacePositionClientRect() : t.getBoundingClientRect(), [h, R] = w.split("-"), [k, L] = I.split("-"), N = getComputedStyle(e).direction === "ltr";
|
||||
let { blockInset: P, blockOutOfBoundsCorrection: A, surfaceBlockProperty: $ } = this.calculateBlock({
|
||||
surfaceRect: E,
|
||||
anchorRect: y,
|
||||
anchorBlock: k,
|
||||
surfaceBlock: h,
|
||||
yOffset: a,
|
||||
positioning: n,
|
||||
windowInnerHeight: C,
|
||||
blockScrollbarHeight: x
|
||||
});
|
||||
if (A && !o) {
|
||||
const M = h === "start" ? "end" : "start", U = k === "start" ? "end" : "start", O = this.calculateBlock({
|
||||
surfaceRect: E,
|
||||
anchorRect: y,
|
||||
anchorBlock: U,
|
||||
surfaceBlock: M,
|
||||
yOffset: a,
|
||||
positioning: n,
|
||||
windowInnerHeight: C,
|
||||
blockScrollbarHeight: x
|
||||
});
|
||||
A > O.blockOutOfBoundsCorrection && (P = O.blockInset, A = O.blockOutOfBoundsCorrection, $ = O.surfaceBlockProperty);
|
||||
}
|
||||
let { inlineInset: F, inlineOutOfBoundsCorrection: D, surfaceInlineProperty: K } = this.calculateInline({
|
||||
surfaceRect: E,
|
||||
anchorRect: y,
|
||||
anchorInline: L,
|
||||
surfaceInline: R,
|
||||
xOffset: p,
|
||||
positioning: n,
|
||||
isLTR: N,
|
||||
windowInnerWidth: b,
|
||||
inlineScrollbarWidth: d
|
||||
});
|
||||
if (D && !m) {
|
||||
const M = R === "start" ? "end" : "start", U = L === "start" ? "end" : "start", O = this.calculateInline({
|
||||
surfaceRect: E,
|
||||
anchorRect: y,
|
||||
anchorInline: U,
|
||||
surfaceInline: M,
|
||||
xOffset: p,
|
||||
positioning: n,
|
||||
isLTR: N,
|
||||
windowInnerWidth: b,
|
||||
inlineScrollbarWidth: d
|
||||
});
|
||||
Math.abs(D) > Math.abs(O.inlineOutOfBoundsCorrection) && (F = O.inlineInset, D = O.inlineOutOfBoundsCorrection, K = O.surfaceInlineProperty);
|
||||
}
|
||||
v === "move" && (P = P - A, F = F - D), this.surfaceStylesInternal = {
|
||||
display: "block",
|
||||
opacity: "1",
|
||||
[$]: `${P}px`,
|
||||
[K]: `${F}px`
|
||||
}, v === "resize" && (A && (this.surfaceStylesInternal.height = `${E.height - A}px`), D && (this.surfaceStylesInternal.width = `${E.width - D}px`)), this.host.requestUpdate();
|
||||
}
|
||||
/**
|
||||
* Calculates the css property, the inset, and the out of bounds correction
|
||||
* for the surface in the block direction.
|
||||
*/
|
||||
calculateBlock(e) {
|
||||
const { surfaceRect: t, anchorRect: i, anchorBlock: s, surfaceBlock: n, yOffset: p, positioning: a, windowInnerHeight: o, blockScrollbarHeight: m } = e, v = a === "fixed" || a === "document" ? 1 : 0, I = a === "document" ? 1 : 0, w = n === "start" ? 1 : 0, b = n === "end" ? 1 : 0, c = (s !== n ? 1 : 0) * i.height + p, f = w * i.top + b * (o - i.bottom - m), x = w * window.scrollY - b * window.scrollY, d = Math.abs(Math.min(0, o - f - c - t.height));
|
||||
return { blockInset: v * f + I * x + c, blockOutOfBoundsCorrection: d, surfaceBlockProperty: n === "start" ? "inset-block-start" : "inset-block-end" };
|
||||
}
|
||||
/**
|
||||
* Calculates the css property, the inset, and the out of bounds correction
|
||||
* for the surface in the inline direction.
|
||||
*/
|
||||
calculateInline(e) {
|
||||
const { isLTR: t, surfaceInline: i, anchorInline: s, anchorRect: n, surfaceRect: p, xOffset: a, positioning: o, windowInnerWidth: m, inlineScrollbarWidth: v } = e, I = o === "fixed" || o === "document" ? 1 : 0, w = o === "document" ? 1 : 0, b = t ? 1 : 0, C = t ? 0 : 1, c = i === "start" ? 1 : 0, f = i === "end" ? 1 : 0, d = (s !== i ? 1 : 0) * n.width + a, E = c * n.left + f * (m - n.right - v), y = c * (m - n.right - v) + f * n.left, h = b * E + C * y, R = c * window.scrollX - f * window.scrollX, k = f * window.scrollX - c * window.scrollX, L = b * R + C * k, N = Math.abs(Math.min(0, m - h - d - p.width)), P = I * h + d + w * L;
|
||||
let A = i === "start" ? "inset-inline-start" : "inset-inline-end";
|
||||
return (o === "document" || o === "fixed") && (i === "start" && t || i === "end" && !t ? A = "left" : A = "right"), {
|
||||
inlineInset: P,
|
||||
inlineOutOfBoundsCorrection: N,
|
||||
surfaceInlineProperty: A
|
||||
};
|
||||
}
|
||||
hostUpdate() {
|
||||
this.onUpdate();
|
||||
}
|
||||
hostUpdated() {
|
||||
this.onUpdate();
|
||||
}
|
||||
/**
|
||||
* Checks whether the properties passed into the controller have changed since
|
||||
* the last positioning. If so, it will reposition if the surface is open or
|
||||
* close it if the surface should close.
|
||||
*/
|
||||
async onUpdate() {
|
||||
const e = this.getProperties();
|
||||
let t = !1;
|
||||
for (const [p, a] of Object.entries(e))
|
||||
if (t = t || a !== this.lastValues[p], t)
|
||||
break;
|
||||
const i = this.lastValues.isOpen !== e.isOpen, s = !!e.anchorEl, n = !!e.surfaceEl;
|
||||
t && s && n && (this.lastValues.isOpen = e.isOpen, e.isOpen ? (this.lastValues = e, await this.position(), e.onOpen()) : i && (await e.beforeClose(), this.close(), e.onClose()));
|
||||
}
|
||||
/**
|
||||
* Hides the surface.
|
||||
*/
|
||||
close() {
|
||||
this.surfaceStylesInternal = {
|
||||
display: "none"
|
||||
}, this.host.requestUpdate();
|
||||
const e = this.getProperties().surfaceEl;
|
||||
e != null && e.popover && (e != null && e.isConnected) && e.hidePopover();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const T = {
|
||||
INDEX: 0,
|
||||
ITEM: 1,
|
||||
TEXT: 2
|
||||
};
|
||||
class me {
|
||||
/**
|
||||
* @param getProperties A function that returns the options of the typeahead
|
||||
* controller:
|
||||
*
|
||||
* {
|
||||
* getItems: A function that returns an array of menu items to be searched.
|
||||
* typeaheadBufferTime: The maximum time between each keystroke to keep the
|
||||
* current type buffer alive.
|
||||
* }
|
||||
*/
|
||||
constructor(e) {
|
||||
this.getProperties = e, this.typeaheadRecords = [], this.typaheadBuffer = "", this.cancelTypeaheadTimeout = 0, this.isTypingAhead = !1, this.lastActiveRecord = null, this.onKeydown = (t) => {
|
||||
this.isTypingAhead ? this.typeahead(t) : this.beginTypeahead(t);
|
||||
}, this.endTypeahead = () => {
|
||||
this.isTypingAhead = !1, this.typaheadBuffer = "", this.typeaheadRecords = [];
|
||||
};
|
||||
}
|
||||
get items() {
|
||||
return this.getProperties().getItems();
|
||||
}
|
||||
get active() {
|
||||
return this.getProperties().active;
|
||||
}
|
||||
/**
|
||||
* Sets up typingahead
|
||||
*/
|
||||
beginTypeahead(e) {
|
||||
this.active && (e.code === "Space" || e.code === "Enter" || e.code.startsWith("Arrow") || e.code === "Escape" || (this.isTypingAhead = !0, this.typeaheadRecords = this.items.map((t, i) => [
|
||||
i,
|
||||
t,
|
||||
t.typeaheadText.trim().toLowerCase()
|
||||
]), this.lastActiveRecord = this.typeaheadRecords.find((t) => t[T.ITEM].tabIndex === 0) ?? null, this.lastActiveRecord && (this.lastActiveRecord[T.ITEM].tabIndex = -1), this.typeahead(e)));
|
||||
}
|
||||
/**
|
||||
* Performs the typeahead. Based on the normalized items and the current text
|
||||
* buffer, finds the _next_ item with matching text and activates it.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* items: Apple, Banana, Olive, Orange, Cucumber
|
||||
* buffer: ''
|
||||
* user types: o
|
||||
*
|
||||
* activates Olive
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* items: Apple, Banana, Olive (active), Orange, Cucumber
|
||||
* buffer: 'o'
|
||||
* user types: l
|
||||
*
|
||||
* activates Olive
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* items: Apple, Banana, Olive (active), Orange, Cucumber
|
||||
* buffer: ''
|
||||
* user types: o
|
||||
*
|
||||
* activates Orange
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* items: Apple, Banana, Olive, Orange (active), Cucumber
|
||||
* buffer: ''
|
||||
* user types: o
|
||||
*
|
||||
* activates Olive
|
||||
*/
|
||||
typeahead(e) {
|
||||
if (e.defaultPrevented)
|
||||
return;
|
||||
if (clearTimeout(this.cancelTypeaheadTimeout), e.code === "Enter" || e.code.startsWith("Arrow") || e.code === "Escape") {
|
||||
this.endTypeahead(), this.lastActiveRecord && (this.lastActiveRecord[T.ITEM].tabIndex = -1);
|
||||
return;
|
||||
}
|
||||
e.code === "Space" && e.preventDefault(), this.cancelTypeaheadTimeout = setTimeout(this.endTypeahead, this.getProperties().typeaheadBufferTime), this.typaheadBuffer += e.key.toLowerCase();
|
||||
const t = this.lastActiveRecord ? this.lastActiveRecord[T.INDEX] : -1, i = this.typeaheadRecords.length, s = (o) => (o[T.INDEX] + i - t) % i, n = this.typeaheadRecords.filter((o) => !o[T.ITEM].disabled && o[T.TEXT].startsWith(this.typaheadBuffer)).sort((o, m) => s(o) - s(m));
|
||||
if (n.length === 0) {
|
||||
clearTimeout(this.cancelTypeaheadTimeout), this.lastActiveRecord && (this.lastActiveRecord[T.ITEM].tabIndex = -1), this.endTypeahead();
|
||||
return;
|
||||
}
|
||||
const p = this.typaheadBuffer.length === 1;
|
||||
let a;
|
||||
this.lastActiveRecord === n[0] && p ? a = n[1] ?? n[0] : a = n[0], this.lastActiveRecord && (this.lastActiveRecord[T.ITEM].tabIndex = -1), this.lastActiveRecord = a, a[T.ITEM].tabIndex = 0, a[T.ITEM].focus();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const fe = 200, Q = /* @__PURE__ */ new Set([
|
||||
S.ArrowDown,
|
||||
S.ArrowUp,
|
||||
S.Home,
|
||||
S.End
|
||||
]), ye = /* @__PURE__ */ new Set([
|
||||
S.ArrowLeft,
|
||||
S.ArrowRight,
|
||||
...Q
|
||||
]);
|
||||
function ge(g = document) {
|
||||
var t;
|
||||
let e = g.activeElement;
|
||||
for (; e && ((t = e == null ? void 0 : e.shadowRoot) != null && t.activeElement); )
|
||||
e = e.shadowRoot.activeElement;
|
||||
return e;
|
||||
}
|
||||
class l extends J {
|
||||
/**
|
||||
* Whether the menu is animating upwards or downwards when opening. This is
|
||||
* helpful for calculating some animation calculations.
|
||||
*/
|
||||
get openDirection() {
|
||||
return this.menuCorner.split("-")[0] === "start" ? "DOWN" : "UP";
|
||||
}
|
||||
/**
|
||||
* The element which the menu should align to. If `anchor` is set to a
|
||||
* non-empty idref string, then `anchorEl` will resolve to the element with
|
||||
* the given id in the same root node. Otherwise, `null`.
|
||||
*/
|
||||
get anchorElement() {
|
||||
return this.anchor ? this.getRootNode().querySelector(`#${this.anchor}`) : this.currentAnchorElement;
|
||||
}
|
||||
set anchorElement(e) {
|
||||
this.currentAnchorElement = e, this.requestUpdate("anchorElement");
|
||||
}
|
||||
constructor() {
|
||||
super(), this.anchor = "", this.positioning = "absolute", this.quick = !1, this.hasOverflow = !1, this.open = !1, this.xOffset = 0, this.yOffset = 0, this.noHorizontalFlip = !1, this.noVerticalFlip = !1, this.typeaheadDelay = fe, this.anchorCorner = X.END_START, this.menuCorner = X.START_START, this.stayOpenOnOutsideClick = !1, this.stayOpenOnFocusout = !1, this.skipRestoreFocus = !1, this.defaultFocus = B.FIRST_ITEM, this.noNavigationWrap = !1, this.typeaheadActive = !0, this.isSubmenu = !1, this.pointerPath = [], this.isRepositioning = !1, this.openCloseAnimationSignal = se(), this.listController = new re({
|
||||
isItem: (e) => e.hasAttribute("md-menu-item"),
|
||||
getPossibleItems: () => this.slotItems,
|
||||
isRtl: () => getComputedStyle(this).direction === "rtl",
|
||||
deactivateItem: (e) => {
|
||||
e.selected = !1, e.tabIndex = -1;
|
||||
},
|
||||
activateItem: (e) => {
|
||||
e.selected = !0, e.tabIndex = 0;
|
||||
},
|
||||
isNavigableKey: (e) => {
|
||||
if (!this.isSubmenu)
|
||||
return ye.has(e);
|
||||
const i = getComputedStyle(this).direction === "rtl" ? S.ArrowLeft : S.ArrowRight;
|
||||
return e === i ? !0 : Q.has(e);
|
||||
},
|
||||
wrapNavigation: () => !this.noNavigationWrap
|
||||
}), this.lastFocusedElement = null, this.typeaheadController = new me(() => ({
|
||||
getItems: () => this.items,
|
||||
typeaheadBufferTime: this.typeaheadDelay,
|
||||
active: this.typeaheadActive
|
||||
})), this.currentAnchorElement = null, this.internals = // Cast needed for closure
|
||||
this.attachInternals(), this.menuPositionController = new ue(this, () => ({
|
||||
anchorCorner: this.anchorCorner,
|
||||
surfaceCorner: this.menuCorner,
|
||||
surfaceEl: this.surfaceEl,
|
||||
anchorEl: this.anchorElement,
|
||||
positioning: this.positioning === "popover" ? "document" : this.positioning,
|
||||
isOpen: this.open,
|
||||
xOffset: this.xOffset,
|
||||
yOffset: this.yOffset,
|
||||
disableBlockFlip: this.noVerticalFlip,
|
||||
disableInlineFlip: this.noHorizontalFlip,
|
||||
onOpen: this.onOpened,
|
||||
beforeClose: this.beforeClose,
|
||||
onClose: this.onClosed,
|
||||
// We can't resize components that have overflow like menus with
|
||||
// submenus because the overflow-y will show menu items / content
|
||||
// outside the bounds of the menu. Popover API fixes this because each
|
||||
// submenu is hoisted to the top-layer and are not considered overflow
|
||||
// content.
|
||||
repositionStrategy: this.hasOverflow && this.positioning !== "popover" ? "move" : "resize"
|
||||
})), this.onWindowResize = () => {
|
||||
this.isRepositioning || this.positioning !== "document" && this.positioning !== "fixed" && this.positioning !== "popover" || (this.isRepositioning = !0, this.reposition(), this.isRepositioning = !1);
|
||||
}, this.handleFocusout = async (e) => {
|
||||
const t = this.anchorElement;
|
||||
if (this.stayOpenOnFocusout || !this.open || this.pointerPath.includes(t))
|
||||
return;
|
||||
if (e.relatedTarget) {
|
||||
if (G(e.relatedTarget, this) || this.pointerPath.length !== 0 && G(e.relatedTarget, t))
|
||||
return;
|
||||
} else if (this.pointerPath.includes(this))
|
||||
return;
|
||||
const i = this.skipRestoreFocus;
|
||||
this.skipRestoreFocus = !0, this.close(), await this.updateComplete, this.skipRestoreFocus = i;
|
||||
}, this.onOpened = async () => {
|
||||
this.lastFocusedElement = ge();
|
||||
const e = this.items, t = le(e);
|
||||
t && this.defaultFocus !== B.NONE && (t.item.tabIndex = -1);
|
||||
let i = !this.quick;
|
||||
switch (this.quick ? this.dispatchEvent(new Event("opening")) : i = !!await this.animateOpen(), this.defaultFocus) {
|
||||
case B.FIRST_ITEM:
|
||||
const s = de(e);
|
||||
s && (s.tabIndex = 0, s.focus(), await s.updateComplete);
|
||||
break;
|
||||
case B.LAST_ITEM:
|
||||
const n = ce(e);
|
||||
n && (n.tabIndex = 0, n.focus(), await n.updateComplete);
|
||||
break;
|
||||
case B.LIST_ROOT:
|
||||
this.focus();
|
||||
break;
|
||||
default:
|
||||
case B.NONE:
|
||||
break;
|
||||
}
|
||||
i || this.dispatchEvent(new Event("opened"));
|
||||
}, this.beforeClose = async () => {
|
||||
var e, t;
|
||||
this.open = !1, this.skipRestoreFocus || (t = (e = this.lastFocusedElement) == null ? void 0 : e.focus) == null || t.call(e), this.quick || await this.animateClose();
|
||||
}, this.onClosed = () => {
|
||||
this.quick && (this.dispatchEvent(new Event("closing")), this.dispatchEvent(new Event("closed")));
|
||||
}, this.onWindowPointerdown = (e) => {
|
||||
this.pointerPath = e.composedPath();
|
||||
}, this.onDocumentClick = (e) => {
|
||||
if (!this.open)
|
||||
return;
|
||||
const t = e.composedPath();
|
||||
!this.stayOpenOnOutsideClick && !t.includes(this) && !t.includes(this.anchorElement) && (this.open = !1);
|
||||
}, this.internals.role = "menu", this.addEventListener("keydown", this.handleKeydown), this.addEventListener("keydown", this.captureKeydown, { capture: !0 }), this.addEventListener("focusout", this.handleFocusout);
|
||||
}
|
||||
/**
|
||||
* The menu items associated with this menu. The items must be `MenuItem`s and
|
||||
* have both the `md-menu-item` and `md-list-item` attributes.
|
||||
*/
|
||||
get items() {
|
||||
return this.listController.items;
|
||||
}
|
||||
willUpdate(e) {
|
||||
if (e.has("open")) {
|
||||
if (this.open) {
|
||||
this.removeAttribute("aria-hidden");
|
||||
return;
|
||||
}
|
||||
this.setAttribute("aria-hidden", "true");
|
||||
}
|
||||
}
|
||||
update(e) {
|
||||
e.has("open") && (this.open ? this.setUpGlobalEventListeners() : this.cleanUpGlobalEventListeners()), e.has("positioning") && this.positioning === "popover" && // type required for Google JS conformance
|
||||
!this.showPopover && (this.positioning = "fixed"), super.update(e);
|
||||
}
|
||||
connectedCallback() {
|
||||
super.connectedCallback(), this.open && this.setUpGlobalEventListeners();
|
||||
}
|
||||
disconnectedCallback() {
|
||||
super.disconnectedCallback(), this.cleanUpGlobalEventListeners();
|
||||
}
|
||||
getBoundingClientRect() {
|
||||
return this.surfaceEl ? this.surfaceEl.getBoundingClientRect() : super.getBoundingClientRect();
|
||||
}
|
||||
getClientRects() {
|
||||
return this.surfaceEl ? this.surfaceEl.getClientRects() : super.getClientRects();
|
||||
}
|
||||
render() {
|
||||
return this.renderSurface();
|
||||
}
|
||||
/**
|
||||
* Renders the positionable surface element and its contents.
|
||||
*/
|
||||
renderSurface() {
|
||||
return z`
|
||||
<div
|
||||
class="menu ${ee(this.getSurfaceClasses())}"
|
||||
style=${ae(this.menuPositionController.surfaceStyles)}
|
||||
popover=${this.positioning === "popover" ? "manual" : te}>
|
||||
${this.renderElevation()}
|
||||
<div class="items">
|
||||
<div class="item-padding"> ${this.renderMenuItems()} </div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
/**
|
||||
* Renders the menu items' slot
|
||||
*/
|
||||
renderMenuItems() {
|
||||
return z`<slot
|
||||
@close-menu=${this.onCloseMenu}
|
||||
@deactivate-items=${this.onDeactivateItems}
|
||||
@request-activation=${this.onRequestActivation}
|
||||
@deactivate-typeahead=${this.handleDeactivateTypeahead}
|
||||
@activate-typeahead=${this.handleActivateTypeahead}
|
||||
@stay-open-on-focusout=${this.handleStayOpenOnFocusout}
|
||||
@close-on-focusout=${this.handleCloseOnFocusout}
|
||||
@slotchange=${this.listController.onSlotchange}></slot>`;
|
||||
}
|
||||
/**
|
||||
* Renders the elevation component.
|
||||
*/
|
||||
renderElevation() {
|
||||
return z`<md-elevation part="elevation"></md-elevation>`;
|
||||
}
|
||||
getSurfaceClasses() {
|
||||
return {
|
||||
open: this.open,
|
||||
fixed: this.positioning === "fixed",
|
||||
"has-overflow": this.hasOverflow
|
||||
};
|
||||
}
|
||||
captureKeydown(e) {
|
||||
e.target === this && !e.defaultPrevented && Z(e.code) && (e.preventDefault(), this.close()), this.typeaheadController.onKeydown(e);
|
||||
}
|
||||
/**
|
||||
* Performs the opening animation:
|
||||
*
|
||||
* https://direct.googleplex.com/#/spec/295000003+271060003
|
||||
*
|
||||
* @return A promise that resolve to `true` if the animation was aborted,
|
||||
* `false` if it was not aborted.
|
||||
*/
|
||||
async animateOpen() {
|
||||
const e = this.surfaceEl, t = this.slotEl;
|
||||
if (!e || !t)
|
||||
return !0;
|
||||
const i = this.openDirection;
|
||||
this.dispatchEvent(new Event("opening")), e.classList.toggle("animating", !0);
|
||||
const s = this.openCloseAnimationSignal.start(), n = e.offsetHeight, p = i === "UP", a = this.items, o = 500, m = 50, v = 250, I = (o - v) / a.length, w = e.animate([{ height: "0px" }, { height: `${n}px` }], {
|
||||
duration: o,
|
||||
easing: _.EMPHASIZED
|
||||
}), b = t.animate([
|
||||
{ transform: p ? `translateY(-${n}px)` : "" },
|
||||
{ transform: "" }
|
||||
], { duration: o, easing: _.EMPHASIZED }), C = e.animate([{ opacity: 0 }, { opacity: 1 }], m), c = [];
|
||||
for (let d = 0; d < a.length; d++) {
|
||||
const E = p ? a.length - 1 - d : d, y = a[E], h = y.animate([{ opacity: 0 }, { opacity: 1 }], {
|
||||
duration: v,
|
||||
delay: I * d
|
||||
});
|
||||
y.classList.toggle("md-menu-hidden", !0), h.addEventListener("finish", () => {
|
||||
y.classList.toggle("md-menu-hidden", !1);
|
||||
}), c.push([y, h]);
|
||||
}
|
||||
let f = (d) => {
|
||||
};
|
||||
const x = new Promise((d) => {
|
||||
f = d;
|
||||
});
|
||||
return s.addEventListener("abort", () => {
|
||||
w.cancel(), b.cancel(), C.cancel(), c.forEach(([d, E]) => {
|
||||
d.classList.toggle("md-menu-hidden", !1), E.cancel();
|
||||
}), f(!0);
|
||||
}), w.addEventListener("finish", () => {
|
||||
e.classList.toggle("animating", !1), this.openCloseAnimationSignal.finish(), f(!1);
|
||||
}), await x;
|
||||
}
|
||||
/**
|
||||
* Performs the closing animation:
|
||||
*
|
||||
* https://direct.googleplex.com/#/spec/295000003+271060003
|
||||
*/
|
||||
animateClose() {
|
||||
let e;
|
||||
const t = new Promise((h) => {
|
||||
e = h;
|
||||
}), i = this.surfaceEl, s = this.slotEl;
|
||||
if (!i || !s)
|
||||
return e(!1), t;
|
||||
const p = this.openDirection === "UP";
|
||||
this.dispatchEvent(new Event("closing")), i.classList.toggle("animating", !0);
|
||||
const a = this.openCloseAnimationSignal.start(), o = i.offsetHeight, m = this.items, v = 150, I = 50, w = v - I, b = 50, C = 50, c = 0.35, f = (v - C - b) / m.length, x = i.animate([
|
||||
{ height: `${o}px` },
|
||||
{ height: `${o * c}px` }
|
||||
], {
|
||||
duration: v,
|
||||
easing: _.EMPHASIZED_ACCELERATE
|
||||
}), d = s.animate([
|
||||
{ transform: "" },
|
||||
{
|
||||
transform: p ? `translateY(-${o * (1 - c)}px)` : ""
|
||||
}
|
||||
], { duration: v, easing: _.EMPHASIZED_ACCELERATE }), E = i.animate([{ opacity: 1 }, { opacity: 0 }], { duration: I, delay: w }), y = [];
|
||||
for (let h = 0; h < m.length; h++) {
|
||||
const R = p ? h : m.length - 1 - h, k = m[R], L = k.animate([{ opacity: 1 }, { opacity: 0 }], {
|
||||
duration: b,
|
||||
delay: C + f * h
|
||||
});
|
||||
L.addEventListener("finish", () => {
|
||||
k.classList.toggle("md-menu-hidden", !0);
|
||||
}), y.push([k, L]);
|
||||
}
|
||||
return a.addEventListener("abort", () => {
|
||||
x.cancel(), d.cancel(), E.cancel(), y.forEach(([h, R]) => {
|
||||
R.cancel(), h.classList.toggle("md-menu-hidden", !1);
|
||||
}), e(!1);
|
||||
}), x.addEventListener("finish", () => {
|
||||
i.classList.toggle("animating", !1), y.forEach(([h]) => {
|
||||
h.classList.toggle("md-menu-hidden", !1);
|
||||
}), this.openCloseAnimationSignal.finish(), this.dispatchEvent(new Event("closed")), e(!0);
|
||||
}), t;
|
||||
}
|
||||
handleKeydown(e) {
|
||||
this.pointerPath = [], this.listController.handleKeydown(e);
|
||||
}
|
||||
setUpGlobalEventListeners() {
|
||||
document.addEventListener("click", this.onDocumentClick, { capture: !0 }), window.addEventListener("pointerdown", this.onWindowPointerdown), document.addEventListener("resize", this.onWindowResize, { passive: !0 }), window.addEventListener("resize", this.onWindowResize, { passive: !0 });
|
||||
}
|
||||
cleanUpGlobalEventListeners() {
|
||||
document.removeEventListener("click", this.onDocumentClick, {
|
||||
capture: !0
|
||||
}), window.removeEventListener("pointerdown", this.onWindowPointerdown), document.removeEventListener("resize", this.onWindowResize), window.removeEventListener("resize", this.onWindowResize);
|
||||
}
|
||||
onCloseMenu() {
|
||||
this.close();
|
||||
}
|
||||
onDeactivateItems(e) {
|
||||
e.stopPropagation(), this.listController.onDeactivateItems();
|
||||
}
|
||||
onRequestActivation(e) {
|
||||
e.stopPropagation(), this.listController.onRequestActivation(e);
|
||||
}
|
||||
handleDeactivateTypeahead(e) {
|
||||
e.stopPropagation(), this.typeaheadActive = !1;
|
||||
}
|
||||
handleActivateTypeahead(e) {
|
||||
e.stopPropagation(), this.typeaheadActive = !0;
|
||||
}
|
||||
handleStayOpenOnFocusout(e) {
|
||||
e.stopPropagation(), this.stayOpenOnFocusout = !0;
|
||||
}
|
||||
handleCloseOnFocusout(e) {
|
||||
e.stopPropagation(), this.stayOpenOnFocusout = !1;
|
||||
}
|
||||
close() {
|
||||
this.open = !1, this.slotItems.forEach((t) => {
|
||||
var i;
|
||||
(i = t.close) == null || i.call(t);
|
||||
});
|
||||
}
|
||||
show() {
|
||||
this.open = !0;
|
||||
}
|
||||
/**
|
||||
* Activates the next item in the menu. If at the end of the menu, the first
|
||||
* item will be activated.
|
||||
*
|
||||
* @return The activated menu item or `null` if there are no items.
|
||||
*/
|
||||
activateNextItem() {
|
||||
return this.listController.activateNextItem() ?? null;
|
||||
}
|
||||
/**
|
||||
* Activates the previous item in the menu. If at the start of the menu, the
|
||||
* last item will be activated.
|
||||
*
|
||||
* @return The activated menu item or `null` if there are no items.
|
||||
*/
|
||||
activatePreviousItem() {
|
||||
return this.listController.activatePreviousItem() ?? null;
|
||||
}
|
||||
/**
|
||||
* Repositions the menu if it is open.
|
||||
*
|
||||
* Useful for the case where document or window-positioned menus have their
|
||||
* anchors moved while open.
|
||||
*/
|
||||
reposition() {
|
||||
this.open && this.menuPositionController.position();
|
||||
}
|
||||
}
|
||||
r([
|
||||
j(".menu")
|
||||
], l.prototype, "surfaceEl", void 0);
|
||||
r([
|
||||
j("slot")
|
||||
], l.prototype, "slotEl", void 0);
|
||||
r([
|
||||
u()
|
||||
], l.prototype, "anchor", void 0);
|
||||
r([
|
||||
u()
|
||||
], l.prototype, "positioning", void 0);
|
||||
r([
|
||||
u({ type: Boolean })
|
||||
], l.prototype, "quick", void 0);
|
||||
r([
|
||||
u({ type: Boolean, attribute: "has-overflow" })
|
||||
], l.prototype, "hasOverflow", void 0);
|
||||
r([
|
||||
u({ type: Boolean, reflect: !0 })
|
||||
], l.prototype, "open", void 0);
|
||||
r([
|
||||
u({ type: Number, attribute: "x-offset" })
|
||||
], l.prototype, "xOffset", void 0);
|
||||
r([
|
||||
u({ type: Number, attribute: "y-offset" })
|
||||
], l.prototype, "yOffset", void 0);
|
||||
r([
|
||||
u({ type: Boolean, attribute: "no-horizontal-flip" })
|
||||
], l.prototype, "noHorizontalFlip", void 0);
|
||||
r([
|
||||
u({ type: Boolean, attribute: "no-vertical-flip" })
|
||||
], l.prototype, "noVerticalFlip", void 0);
|
||||
r([
|
||||
u({ type: Number, attribute: "typeahead-delay" })
|
||||
], l.prototype, "typeaheadDelay", void 0);
|
||||
r([
|
||||
u({ attribute: "anchor-corner" })
|
||||
], l.prototype, "anchorCorner", void 0);
|
||||
r([
|
||||
u({ attribute: "menu-corner" })
|
||||
], l.prototype, "menuCorner", void 0);
|
||||
r([
|
||||
u({ type: Boolean, attribute: "stay-open-on-outside-click" })
|
||||
], l.prototype, "stayOpenOnOutsideClick", void 0);
|
||||
r([
|
||||
u({ type: Boolean, attribute: "stay-open-on-focusout" })
|
||||
], l.prototype, "stayOpenOnFocusout", void 0);
|
||||
r([
|
||||
u({ type: Boolean, attribute: "skip-restore-focus" })
|
||||
], l.prototype, "skipRestoreFocus", void 0);
|
||||
r([
|
||||
u({ attribute: "default-focus" })
|
||||
], l.prototype, "defaultFocus", void 0);
|
||||
r([
|
||||
u({ type: Boolean, attribute: "no-navigation-wrap" })
|
||||
], l.prototype, "noNavigationWrap", void 0);
|
||||
r([
|
||||
oe({ flatten: !0 })
|
||||
], l.prototype, "slotItems", void 0);
|
||||
r([
|
||||
ne()
|
||||
], l.prototype, "typeaheadActive", void 0);
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const ve = V`:host{--md-elevation-level: var(--md-menu-container-elevation, 2);--md-elevation-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));min-width:112px;color:unset;display:contents}md-focus-ring{--md-focus-ring-shape: var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px))}.menu{border-radius:var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px));display:none;inset:auto;border:none;padding:0px;overflow:visible;background-color:rgba(0,0,0,0);color:inherit;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit;max-width:inherit;scrollbar-width:inherit}.menu::backdrop{display:none}.fixed{position:fixed}.items{display:block;list-style-type:none;margin:0;outline:none;box-sizing:border-box;background-color:var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));height:inherit;max-height:inherit;overflow:auto;min-width:inherit;max-width:inherit;border-radius:inherit;scrollbar-width:inherit}.item-padding{padding-block:8px}.has-overflow:not([popover]) .items{overflow:visible}.has-overflow.animating .items,.animating .items{overflow:hidden}.has-overflow.animating .items{pointer-events:none}.animating ::slotted(.md-menu-hidden){opacity:0}slot{display:block;height:inherit;max-height:inherit}::slotted(:is(md-divider,[role=separator])){margin:8px 0}@media(forced-colors: active){.menu{border-style:solid;border-color:CanvasText;border-width:1px}}
|
||||
`;
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
let H = class extends l {
|
||||
};
|
||||
H.styles = [ve];
|
||||
H = r([
|
||||
ie("md-menu")
|
||||
], H);
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const Le = V`:host{display:flex;--md-ripple-hover-color: var(--md-menu-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-menu-item-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-menu-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-menu-item-pressed-state-layer-opacity, 0.12)}:host([disabled]){opacity:var(--md-menu-item-disabled-opacity, 0.3);pointer-events:none}md-focus-ring{z-index:1;--md-focus-ring-shape: 8px}a,button,li{background:none;border:none;padding:0;margin:0;text-align:unset;text-decoration:none}.list-item{border-radius:inherit;display:flex;flex:1;max-width:inherit;min-width:inherit;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.list-item:not(.disabled){cursor:pointer}[slot=container]{pointer-events:none}md-ripple{border-radius:inherit}md-item{border-radius:inherit;flex:1;color:var(--md-menu-item-label-text-color, var(--md-sys-color-on-surface, #1d1b20));font-family:var(--md-menu-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));line-height:var(--md-menu-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));font-weight:var(--md-menu-item-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));min-height:var(--md-menu-item-one-line-container-height, 56px);padding-top:var(--md-menu-item-top-space, 12px);padding-bottom:var(--md-menu-item-bottom-space, 12px);padding-inline-start:var(--md-menu-item-leading-space, 16px);padding-inline-end:var(--md-menu-item-trailing-space, 16px)}md-item[multiline]{min-height:var(--md-menu-item-two-line-container-height, 72px)}[slot=supporting-text]{color:var(--md-menu-item-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-menu-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-menu-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-menu-item-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)))}[slot=trailing-supporting-text]{color:var(--md-menu-item-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-menu-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, 0.6875rem));line-height:var(--md-menu-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));font-weight:var(--md-menu-item-trailing-supporting-text-weight, var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500)))}:is([slot=start],[slot=end])::slotted(*){fill:currentColor}[slot=start]{color:var(--md-menu-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}[slot=end]{color:var(--md-menu-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}.list-item{background-color:var(--md-menu-item-container-color, transparent)}.list-item.selected{background-color:var(--md-menu-item-selected-container-color, var(--md-sys-color-secondary-container, #e8def8))}.selected:not(.disabled) ::slotted(*){color:var(--md-menu-item-selected-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b))}@media(forced-colors: active){:host([disabled]),:host([disabled]) slot{color:GrayText;opacity:1}.list-item{position:relative}.list-item.selected::before{content:"";position:absolute;inset:0;box-sizing:border-box;border-radius:inherit;pointer-events:none;border:3px double CanvasText}}
|
||||
`;
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
class Pe {
|
||||
/**
|
||||
* @param host The MenuItem in which to attach this controller to.
|
||||
* @param config The object that configures this controller's behavior.
|
||||
*/
|
||||
constructor(e, t) {
|
||||
this.host = e, this.internalTypeaheadText = null, this.onClick = () => {
|
||||
this.host.keepOpen || this.host.dispatchEvent(Y(this.host, {
|
||||
kind: q.CLICK_SELECTION
|
||||
}));
|
||||
}, this.onKeydown = (i) => {
|
||||
if (this.host.href && i.code === "Enter") {
|
||||
const n = this.getInteractiveElement();
|
||||
n instanceof HTMLAnchorElement && n.click();
|
||||
}
|
||||
if (i.defaultPrevented)
|
||||
return;
|
||||
const s = i.code;
|
||||
this.host.keepOpen && s !== "Escape" || Z(s) && (i.preventDefault(), this.host.dispatchEvent(Y(this.host, {
|
||||
kind: q.KEYDOWN,
|
||||
key: s
|
||||
})));
|
||||
}, this.getHeadlineElements = t.getHeadlineElements, this.getSupportingTextElements = t.getSupportingTextElements, this.getDefaultElements = t.getDefaultElements, this.getInteractiveElement = t.getInteractiveElement, this.host.addController(this);
|
||||
}
|
||||
/**
|
||||
* The text that is selectable via typeahead. If not set, defaults to the
|
||||
* innerText of the item slotted into the `"headline"` slot, and if there are
|
||||
* no slotted elements into headline, then it checks the _default_ slot, and
|
||||
* then the `"supporting-text"` slot if nothing is in _default_.
|
||||
*/
|
||||
get typeaheadText() {
|
||||
if (this.internalTypeaheadText !== null)
|
||||
return this.internalTypeaheadText;
|
||||
const e = this.getHeadlineElements(), t = [];
|
||||
return e.forEach((i) => {
|
||||
i.textContent && i.textContent.trim() && t.push(i.textContent.trim());
|
||||
}), t.length === 0 && this.getDefaultElements().forEach((i) => {
|
||||
i.textContent && i.textContent.trim() && t.push(i.textContent.trim());
|
||||
}), t.length === 0 && this.getSupportingTextElements().forEach((i) => {
|
||||
i.textContent && i.textContent.trim() && t.push(i.textContent.trim());
|
||||
}), t.join(" ");
|
||||
}
|
||||
/**
|
||||
* The recommended tag name to render as the list item.
|
||||
*/
|
||||
get tagName() {
|
||||
switch (this.host.type) {
|
||||
case "link":
|
||||
return "a";
|
||||
case "button":
|
||||
return "button";
|
||||
default:
|
||||
case "menuitem":
|
||||
case "option":
|
||||
return "li";
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The recommended role of the menu item.
|
||||
*/
|
||||
get role() {
|
||||
return this.host.type === "option" ? "option" : "menuitem";
|
||||
}
|
||||
hostConnected() {
|
||||
this.host.toggleAttribute("md-menu-item", !0);
|
||||
}
|
||||
hostUpdate() {
|
||||
this.host.href && (this.host.type = "link");
|
||||
}
|
||||
/**
|
||||
* Use to set the typeaheadText when it changes.
|
||||
*/
|
||||
setTypeaheadText(e) {
|
||||
this.internalTypeaheadText = e;
|
||||
}
|
||||
}
|
||||
export {
|
||||
X as C,
|
||||
fe as D,
|
||||
B as F,
|
||||
pe as K,
|
||||
Pe as M,
|
||||
Re as N,
|
||||
W as S,
|
||||
T,
|
||||
Ae as a,
|
||||
q as b,
|
||||
Oe as c,
|
||||
H as d,
|
||||
ke as e,
|
||||
G as i,
|
||||
Le as s
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,5 @@
|
|||
"use strict";const l=require("./animation-A38fZ1oY.js");/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/function m(t){return(c,i)=>{const{slot:n,selector:r}=t??{},u="slot"+(n?`[name=${n}]`:":not([name])");return l.e(c,i,{get(){var s;const e=(s=this.renderRoot)==null?void 0:s.querySelector(u),o=(e==null?void 0:e.assignedElements(t))??[];return r===void 0?o:o.filter(a=>a.matches(r))}})}}exports.o=m;
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
import { e as u } from "./animation-DjClVFum.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
function d(t) {
|
||||
return (c, i) => {
|
||||
const { slot: r, selector: o } = t ?? {}, l = "slot" + (r ? `[name=${r}]` : ":not([name])");
|
||||
return u(c, i, { get() {
|
||||
var s;
|
||||
const e = (s = this.renderRoot) == null ? void 0 : s.querySelector(l), n = (e == null ? void 0 : e.assignedElements(t)) ?? [];
|
||||
return o === void 0 ? n : n.filter((m) => m.matches(o));
|
||||
} });
|
||||
};
|
||||
}
|
||||
export {
|
||||
d as o
|
||||
};
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
"use strict";const u=require("./animation-A38fZ1oY.js");/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/function c(n){return(o,s)=>{const{slot:t}=n??{},i="slot"+(t?`[name=${t}]`:":not([name])");return u.e(o,s,{get(){var r;const e=(r=this.renderRoot)==null?void 0:r.querySelector(i);return(e==null?void 0:e.assignedNodes(n))??[]}})}}exports.n=c;
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
import { e as c } from "./animation-DjClVFum.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
function m(t) {
|
||||
return (n, s) => {
|
||||
const { slot: o } = t ?? {}, u = "slot" + (o ? `[name=${o}]` : ":not([name])");
|
||||
return c(n, s, { get() {
|
||||
var r;
|
||||
const e = (r = this.renderRoot) == null ? void 0 : r.querySelector(u);
|
||||
return (e == null ? void 0 : e.assignedNodes(t)) ?? [];
|
||||
} });
|
||||
};
|
||||
}
|
||||
export {
|
||||
m as n
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1 @@
|
|||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./react-you-ui21.js"),r=require("./react-you-ui23.js"),s=require("./react-you-ui9.js"),i=require("./react-you-ui13.js"),c=require("./react-you-ui22.js"),p=require("./react-you-ui10.js"),u=require("./react-you-ui15.js"),a=require("./react-you-ui11.js"),m=require("./react-you-ui16.js"),l=require("./react-you-ui25.js"),q=require("./react-you-ui5.js"),B=require("./react-you-ui20.js"),e=require("./react-you-ui24.js"),o=require("./react-you-ui18.js"),n=require("./react-you-ui19.js"),_=require("./react-you-ui17.js"),h=require("./react-you-ui14.js"),d=require("./react-you-ui6.js"),C=require("./react-you-ui7.js"),F=require("./react-you-ui8.js");exports.TextField=t.TextField;exports.Button=r.Button;exports.Checkbox=s.Checkbox;exports.Radio=i.Radio;exports.Select=c.Select;exports.Switch=p.Switch;exports.Slider=u.Slider;exports.Dialog=a.Dialog;exports.List=m.List;exports.Box=l.Box;exports.Typography=q.Typography;exports.IconButton=B.IconButton;exports.AssistChip=e.AssistChip;exports.ChipSet=e.ChipSet;exports.FilterChip=e.FilterChip;exports.InputChip=e.InputChip;exports.BrandedFAB=o.BrandedFAB;exports.FAB=o.FAB;exports.Tab=n.Tab;exports.Tabs=n.Tabs;exports.CircularProgress=_.CircularProgress;exports.Menu=h.Menu;exports.Paper=d.Paper;exports.FormLabel=C.FormLabel;exports.AppBar=F.AppBar;
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
import { TextField as e } from "./react-you-ui21.mjs";
|
||||
import { Button as p } from "./react-you-ui23.mjs";
|
||||
import { Checkbox as m } from "./react-you-ui9.mjs";
|
||||
import { Radio as i } from "./react-you-ui13.mjs";
|
||||
import { Select as h } from "./react-you-ui22.mjs";
|
||||
import { Switch as s } from "./react-you-ui10.mjs";
|
||||
import { Slider as n } from "./react-you-ui15.mjs";
|
||||
import { Dialog as c } from "./react-you-ui11.mjs";
|
||||
import { List as u } from "./react-you-ui16.mjs";
|
||||
import { Box as b } from "./react-you-ui25.mjs";
|
||||
import { Typography as S } from "./react-you-ui5.mjs";
|
||||
import { IconButton as g } from "./react-you-ui20.mjs";
|
||||
import { AssistChip as I, ChipSet as L, FilterChip as P, InputChip as k } from "./react-you-ui24.mjs";
|
||||
import { BrandedFAB as D, FAB as M } from "./react-you-ui18.mjs";
|
||||
import { Tab as j, Tabs as q } from "./react-you-ui19.mjs";
|
||||
import { CircularProgress as z } from "./react-you-ui17.mjs";
|
||||
import { Menu as G } from "./react-you-ui14.mjs";
|
||||
import { Paper as J } from "./react-you-ui6.mjs";
|
||||
import { FormLabel as N } from "./react-you-ui7.mjs";
|
||||
import { AppBar as Q } from "./react-you-ui8.mjs";
|
||||
export {
|
||||
Q as AppBar,
|
||||
I as AssistChip,
|
||||
b as Box,
|
||||
D as BrandedFAB,
|
||||
p as Button,
|
||||
m as Checkbox,
|
||||
L as ChipSet,
|
||||
z as CircularProgress,
|
||||
c as Dialog,
|
||||
M as FAB,
|
||||
P as FilterChip,
|
||||
N as FormLabel,
|
||||
g as IconButton,
|
||||
k as InputChip,
|
||||
u as List,
|
||||
G as Menu,
|
||||
J as Paper,
|
||||
i as Radio,
|
||||
h as Select,
|
||||
n as Slider,
|
||||
s as Switch,
|
||||
j as Tab,
|
||||
q as Tabs,
|
||||
e as TextField,
|
||||
S as Typography
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,63 @@
|
|||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react/jsx-runtime"),F=require("react"),T=require("./create-component-D9KTUrcf.js"),t=require("./class-map-DV5418hw.js");require("./divider-B6Y1F7cS.js");const s=require("./animation-A38fZ1oY.js"),k=require("./delegate-4958lG3m.js"),D=require("./redispatch-event-C93E51ce.js");/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const I={dialog:[[[{transform:"translateY(-50px)"},{transform:"translateY(0)"}],{duration:500,easing:s.EASING.EMPHASIZED}]],scrim:[[[{opacity:0},{opacity:.32}],{duration:500,easing:"linear"}]],container:[[[{opacity:0},{opacity:1}],{duration:50,easing:"linear",pseudoElement:"::before"}],[[{height:"35%"},{height:"100%"}],{duration:500,easing:s.EASING.EMPHASIZED,pseudoElement:"::before"}]],headline:[[[{opacity:0},{opacity:0,offset:.2},{opacity:1}],{duration:250,easing:"linear",fill:"forwards"}]],content:[[[{opacity:0},{opacity:0,offset:.2},{opacity:1}],{duration:250,easing:"linear",fill:"forwards"}]],actions:[[[{opacity:0},{opacity:0,offset:.5},{opacity:1}],{duration:300,easing:"linear",fill:"forwards"}]]},O={dialog:[[[{transform:"translateY(0)"},{transform:"translateY(-50px)"}],{duration:150,easing:s.EASING.EMPHASIZED_ACCELERATE}]],scrim:[[[{opacity:.32},{opacity:0}],{duration:150,easing:"linear"}]],container:[[[{height:"100%"},{height:"35%"}],{duration:150,easing:s.EASING.EMPHASIZED_ACCELERATE,pseudoElement:"::before"}],[[{opacity:"1"},{opacity:"0"}],{delay:100,duration:50,easing:"linear",pseudoElement:"::before"}]],headline:[[[{opacity:1},{opacity:0}],{duration:100,easing:"linear",fill:"forwards"}]],content:[[[{opacity:1},{opacity:0}],{duration:100,easing:"linear",fill:"forwards"}]],actions:[[[{opacity:1},{opacity:0}],{duration:100,easing:"linear",fill:"forwards"}]]};/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const $=k.mixinDelegatesAria(t.r);let n=class extends ${get open(){return this.isOpen}set open(e){e!==this.isOpen&&(this.isOpen=e,e?(this.setAttribute("open",""),this.show()):(this.removeAttribute("open"),this.close()))}constructor(){super(),this.quick=!1,this.returnValue="",this.noFocusTrap=!1,this.getOpenAnimation=()=>I,this.getCloseAnimation=()=>O,this.isOpen=!1,this.isOpening=!1,this.isConnectedPromise=this.getIsConnectedPromise(),this.isAtScrollTop=!1,this.isAtScrollBottom=!1,this.nextClickIsFromContent=!1,this.hasHeadline=!1,this.hasActions=!1,this.hasIcon=!1,this.escapePressedWithoutCancel=!1,this.treewalker=document.createTreeWalker(this,NodeFilter.SHOW_ELEMENT),this.addEventListener("submit",this.handleSubmit)}async show(){var o;this.isOpening=!0,await this.isConnectedPromise,await this.updateComplete;const e=this.dialog;if(e.open||!this.isOpening){this.isOpening=!1;return}if(!this.dispatchEvent(new Event("open",{cancelable:!0}))){this.open=!1,this.isOpening=!1;return}e.showModal(),this.open=!0,this.scroller&&(this.scroller.scrollTop=0),(o=this.querySelector("[autofocus]"))==null||o.focus(),await this.animateDialog(this.getOpenAnimation()),this.dispatchEvent(new Event("opened")),this.isOpening=!1}async close(e=this.returnValue){if(this.isOpening=!1,!this.isConnected){this.open=!1;return}await this.updateComplete;const i=this.dialog;if(!i.open||this.isOpening){this.open=!1;return}const o=this.returnValue;if(this.returnValue=e,!this.dispatchEvent(new Event("close",{cancelable:!0}))){this.returnValue=o;return}await this.animateDialog(this.getCloseAnimation()),i.close(e),this.open=!1,this.dispatchEvent(new Event("closed"))}connectedCallback(){super.connectedCallback(),this.isConnectedPromiseResolve()}disconnectedCallback(){super.disconnectedCallback(),this.isConnectedPromise=this.getIsConnectedPromise()}render(){const e=this.open&&!(this.isAtScrollTop&&this.isAtScrollBottom),i={"has-headline":this.hasHeadline,"has-actions":this.hasActions,"has-icon":this.hasIcon,scrollable:e,"show-top-divider":e&&!this.isAtScrollTop,"show-bottom-divider":e&&!this.isAtScrollBottom},o=this.open&&!this.noFocusTrap,r=t.x`
|
||||
<div
|
||||
class="focus-trap"
|
||||
tabindex="0"
|
||||
aria-hidden="true"
|
||||
@focus=${this.handleFocusTrapFocus}></div>
|
||||
`,{ariaLabel:l}=this;return t.x`
|
||||
<div class="scrim"></div>
|
||||
<dialog
|
||||
class=${t.e$1(i)}
|
||||
aria-label=${l||t.E}
|
||||
aria-labelledby=${this.hasHeadline?"headline":t.E}
|
||||
role=${this.type==="alert"?"alertdialog":t.E}
|
||||
@cancel=${this.handleCancel}
|
||||
@click=${this.handleDialogClick}
|
||||
@close=${this.handleClose}
|
||||
@keydown=${this.handleKeydown}
|
||||
.returnValue=${this.returnValue||t.E}>
|
||||
${o?r:t.E}
|
||||
<div class="container" @click=${this.handleContentClick}>
|
||||
<div class="headline">
|
||||
<div class="icon" aria-hidden="true">
|
||||
<slot name="icon" @slotchange=${this.handleIconChange}></slot>
|
||||
</div>
|
||||
<h2 id="headline" aria-hidden=${!this.hasHeadline||t.E}>
|
||||
<slot
|
||||
name="headline"
|
||||
@slotchange=${this.handleHeadlineChange}></slot>
|
||||
</h2>
|
||||
<md-divider></md-divider>
|
||||
</div>
|
||||
<div class="scroller">
|
||||
<div class="content">
|
||||
<div class="top anchor"></div>
|
||||
<slot name="content"></slot>
|
||||
<div class="bottom anchor"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<md-divider></md-divider>
|
||||
<slot name="actions" @slotchange=${this.handleActionsChange}></slot>
|
||||
</div>
|
||||
</div>
|
||||
${o?r:t.E}
|
||||
</dialog>
|
||||
`}firstUpdated(){this.intersectionObserver=new IntersectionObserver(e=>{for(const i of e)this.handleAnchorIntersection(i)},{root:this.scroller}),this.intersectionObserver.observe(this.topAnchor),this.intersectionObserver.observe(this.bottomAnchor)}handleDialogClick(){if(this.nextClickIsFromContent){this.nextClickIsFromContent=!1;return}this.dispatchEvent(new Event("cancel",{cancelable:!0}))&&this.close()}handleContentClick(){this.nextClickIsFromContent=!0}handleSubmit(e){const i=e.target,{submitter:o}=e;i.method!=="dialog"||!o||this.close(o.getAttribute("value")??this.returnValue)}handleCancel(e){if(e.target!==this.dialog)return;this.escapePressedWithoutCancel=!1;const i=!D.redispatchEvent(this,e);e.preventDefault(),!i&&this.close()}handleClose(){var e;this.escapePressedWithoutCancel&&(this.escapePressedWithoutCancel=!1,(e=this.dialog)==null||e.dispatchEvent(new Event("cancel",{cancelable:!0})))}handleKeydown(e){e.key==="Escape"&&(this.escapePressedWithoutCancel=!0,setTimeout(()=>{this.escapePressedWithoutCancel=!1}))}async animateDialog(e){var A;if((A=this.cancelAnimations)==null||A.abort(),this.cancelAnimations=new AbortController,this.quick)return;const{dialog:i,scrim:o,container:r,headline:l,content:d,actions:c}=this;if(!i||!o||!r||!l||!d||!c)return;const{container:h,dialog:u,scrim:m,headline:p,content:y,actions:b}=e,x=[[i,u??[]],[o,m??[]],[r,h??[]],[l,p??[]],[d,y??[]],[c,b??[]]],g=[];for(const[C,E]of x)for(const _ of E){const w=C.animate(..._);this.cancelAnimations.signal.addEventListener("abort",()=>{w.cancel()}),g.push(w)}await Promise.all(g.map(C=>C.finished.catch(()=>{})))}handleHeadlineChange(e){const i=e.target;this.hasHeadline=i.assignedElements().length>0}handleActionsChange(e){const i=e.target;this.hasActions=i.assignedElements().length>0}handleIconChange(e){const i=e.target;this.hasIcon=i.assignedElements().length>0}handleAnchorIntersection(e){const{target:i,isIntersecting:o}=e;i===this.topAnchor&&(this.isAtScrollTop=o),i===this.bottomAnchor&&(this.isAtScrollBottom=o)}getIsConnectedPromise(){return new Promise(e=>{this.isConnectedPromiseResolve=e})}handleFocusTrapFocus(e){var p;const[i,o]=this.getFirstAndLastFocusableChildren();if(!i||!o){(p=this.dialog)==null||p.focus();return}const r=e.target===this.firstFocusTrap,l=!r,d=e.relatedTarget===i,c=e.relatedTarget===o,h=!d&&!c;if(l&&c||r&&h){i.focus();return}if(r&&d||l&&h){o.focus();return}}getFirstAndLastFocusableChildren(){if(!this.treewalker)return[null,null];let e=null,i=null;for(this.treewalker.currentNode=this.treewalker.root;this.treewalker.nextNode();){const o=this.treewalker.currentNode;S(o)&&(e||(e=o),i=o)}return[e,i]}};t.__decorate([t.n({type:Boolean})],n.prototype,"open",null);t.__decorate([t.n({type:Boolean})],n.prototype,"quick",void 0);t.__decorate([t.n({attribute:!1})],n.prototype,"returnValue",void 0);t.__decorate([t.n()],n.prototype,"type",void 0);t.__decorate([t.n({type:Boolean,attribute:"no-focus-trap"})],n.prototype,"noFocusTrap",void 0);t.__decorate([s.e$1("dialog")],n.prototype,"dialog",void 0);t.__decorate([s.e$1(".scrim")],n.prototype,"scrim",void 0);t.__decorate([s.e$1(".container")],n.prototype,"container",void 0);t.__decorate([s.e$1(".headline")],n.prototype,"headline",void 0);t.__decorate([s.e$1(".content")],n.prototype,"content",void 0);t.__decorate([s.e$1(".actions")],n.prototype,"actions",void 0);t.__decorate([s.r()],n.prototype,"isAtScrollTop",void 0);t.__decorate([s.r()],n.prototype,"isAtScrollBottom",void 0);t.__decorate([s.e$1(".scroller")],n.prototype,"scroller",void 0);t.__decorate([s.e$1(".top.anchor")],n.prototype,"topAnchor",void 0);t.__decorate([s.e$1(".bottom.anchor")],n.prototype,"bottomAnchor",void 0);t.__decorate([s.e$1(".focus-trap")],n.prototype,"firstFocusTrap",void 0);t.__decorate([s.r()],n.prototype,"hasHeadline",void 0);t.__decorate([s.r()],n.prototype,"hasActions",void 0);t.__decorate([s.r()],n.prototype,"hasIcon",void 0);function S(a){var l;const e=":is(button,input,select,textarea,object,:is(a,area)[href],[tabindex],[contenteditable=true])",i=":not(:disabled,[disabled])";return a.matches(e+i+':not([tabindex^="-"])')?!0:!a.localName.includes("-")||!a.matches(i)?!1:((l=a.shadowRoot)==null?void 0:l.delegatesFocus)??!1}/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const P=t.i$1`:host{border-start-start-radius:var(--md-dialog-container-shape-start-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-start-end-radius:var(--md-dialog-container-shape-start-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-end-radius:var(--md-dialog-container-shape-end-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-start-radius:var(--md-dialog-container-shape-end-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));display:contents;margin:auto;max-height:min(560px,100% - 48px);max-width:min(560px,100% - 48px);min-height:140px;min-width:280px;position:fixed;height:fit-content;width:fit-content}dialog{background:rgba(0,0,0,0);border:none;border-radius:inherit;flex-direction:column;height:inherit;margin:inherit;max-height:inherit;max-width:inherit;min-height:inherit;min-width:inherit;outline:none;overflow:visible;padding:0;width:inherit}dialog[open]{display:flex}::backdrop{background:none}.scrim{background:var(--md-sys-color-scrim, #000);display:none;inset:0;opacity:32%;pointer-events:none;position:fixed;z-index:1}:host([open]) .scrim{display:flex}h2{all:unset;align-self:stretch}.headline{align-items:center;color:var(--md-dialog-headline-color, var(--md-sys-color-on-surface, #1d1b20));display:flex;flex-direction:column;font-family:var(--md-dialog-headline-font, var(--md-sys-typescale-headline-small-font, var(--md-ref-typeface-brand, Roboto)));font-size:var(--md-dialog-headline-size, var(--md-sys-typescale-headline-small-size, 1.5rem));line-height:var(--md-dialog-headline-line-height, var(--md-sys-typescale-headline-small-line-height, 2rem));font-weight:var(--md-dialog-headline-weight, var(--md-sys-typescale-headline-small-weight, var(--md-ref-typeface-weight-regular, 400)));position:relative}slot[name=headline]::slotted(*){align-items:center;align-self:stretch;box-sizing:border-box;display:flex;gap:8px;padding:24px 24px 0}.icon{display:flex}slot[name=icon]::slotted(*){color:var(--md-dialog-icon-color, var(--md-sys-color-secondary, #625b71));fill:currentColor;font-size:var(--md-dialog-icon-size, 24px);margin-top:24px;height:var(--md-dialog-icon-size, 24px);width:var(--md-dialog-icon-size, 24px)}.has-icon slot[name=headline]::slotted(*){justify-content:center;padding-top:16px}.scrollable slot[name=headline]::slotted(*){padding-bottom:16px}.scrollable.has-headline slot[name=content]::slotted(*){padding-top:8px}.container{border-radius:inherit;display:flex;flex-direction:column;flex-grow:1;overflow:hidden;position:relative;transform-origin:top}.container::before{background:var(--md-dialog-container-color, var(--md-sys-color-surface-container-high, #ece6f0));border-radius:inherit;content:"";inset:0;position:absolute}.scroller{display:flex;flex:1;flex-direction:column;overflow:hidden;z-index:1}.scrollable .scroller{overflow-y:scroll}.content{color:var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-dialog-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-dialog-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-dialog-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));flex:1;font-weight:var(--md-dialog-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)));height:min-content;position:relative}slot[name=content]::slotted(*){box-sizing:border-box;padding:24px}.anchor{position:absolute}.top.anchor{top:0}.bottom.anchor{bottom:0}.actions{position:relative}slot[name=actions]::slotted(*){box-sizing:border-box;display:flex;gap:8px;justify-content:flex-end;padding:16px 24px 24px}.has-actions slot[name=content]::slotted(*){padding-bottom:8px}md-divider{display:none;position:absolute}.has-headline.show-top-divider .headline md-divider,.has-actions.show-bottom-divider .actions md-divider{display:flex}.headline md-divider{bottom:0}.actions md-divider{top:0}@media(forced-colors: active){dialog{outline:2px solid WindowText}}
|
||||
`;/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/let f=class extends n{};f.styles=[P];f=t.__decorate([t.t$1("md-dialog")],f);const N=T.o({react:F,tagName:"md-dialog",elementClass:f,events:{onClose:"close",onShow:"show",onOpen:"open",onOpened:"opened",onClosed:"closed",onCancel:"cancel"}}),L=a=>{const{children:e,quick:i,returnValue:o,noFocusTrap:r,open:l,fullScreen:d,style:c,className:h,id:u,onClose:m,onShow:p,onOpen:y,onOpened:b,onClosed:x,onCancel:g}=a;return v.jsx(N,{quick:i,returnValue:o,noFocusTrap:r,open:l,style:{...c,...d?{width:"100vw",height:"100vh",maxWidth:"100vw",maxHeight:"100vh"}:{}},className:h,id:u,onClose:m,onShow:p,onOpen:y,onOpened:b,onClosed:x,onCancel:g,children:e})},z=a=>v.jsx("div",{slot:"headline",...a,children:a.children}),H=a=>v.jsx("div",{slot:"content",...a,children:a.children}),q=a=>v.jsx("div",{slot:"actions",...a,children:a.children});exports.Dialog=L;exports.DialogActions=q;exports.DialogContent=H;exports.DialogTitle=z;
|
||||
|
|
@ -0,0 +1,495 @@
|
|||
import { jsx as C } from "react/jsx-runtime";
|
||||
import S from "react";
|
||||
import { o as P } from "./create-component-CVXl33PD.mjs";
|
||||
import { _ as o, n as u, r as $, x as O, c as L, E as h, a as N, b as z } from "./class-map-CwiboTfb.mjs";
|
||||
import "./divider-Diu_1O5h.mjs";
|
||||
import { E as b, r as g, a as l } from "./animation-DjClVFum.mjs";
|
||||
import { m as H } from "./delegate-BXi1gVeU.mjs";
|
||||
import { r as _ } from "./redispatch-event-taWUbWUt.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const M = {
|
||||
dialog: [
|
||||
[
|
||||
// Dialog slide down
|
||||
[{ transform: "translateY(-50px)" }, { transform: "translateY(0)" }],
|
||||
{ duration: 500, easing: b.EMPHASIZED }
|
||||
]
|
||||
],
|
||||
scrim: [
|
||||
[
|
||||
// Scrim fade in
|
||||
[{ opacity: 0 }, { opacity: 0.32 }],
|
||||
{ duration: 500, easing: "linear" }
|
||||
]
|
||||
],
|
||||
container: [
|
||||
[
|
||||
// Container fade in
|
||||
[{ opacity: 0 }, { opacity: 1 }],
|
||||
{ duration: 50, easing: "linear", pseudoElement: "::before" }
|
||||
],
|
||||
[
|
||||
// Container grow
|
||||
// Note: current spec says to grow from 0dp->100% and shrink from
|
||||
// 100%->35%. We change this to 35%->100% to simplify the animation that
|
||||
// is supposed to clip content as it grows. From 0dp it's possible to see
|
||||
// text/actions appear before the container has fully grown.
|
||||
[{ height: "35%" }, { height: "100%" }],
|
||||
{ duration: 500, easing: b.EMPHASIZED, pseudoElement: "::before" }
|
||||
]
|
||||
],
|
||||
headline: [
|
||||
[
|
||||
// Headline fade in
|
||||
[{ opacity: 0 }, { opacity: 0, offset: 0.2 }, { opacity: 1 }],
|
||||
{ duration: 250, easing: "linear", fill: "forwards" }
|
||||
]
|
||||
],
|
||||
content: [
|
||||
[
|
||||
// Content fade in
|
||||
[{ opacity: 0 }, { opacity: 0, offset: 0.2 }, { opacity: 1 }],
|
||||
{ duration: 250, easing: "linear", fill: "forwards" }
|
||||
]
|
||||
],
|
||||
actions: [
|
||||
[
|
||||
// Actions fade in
|
||||
[{ opacity: 0 }, { opacity: 0, offset: 0.5 }, { opacity: 1 }],
|
||||
{ duration: 300, easing: "linear", fill: "forwards" }
|
||||
]
|
||||
]
|
||||
}, V = {
|
||||
dialog: [
|
||||
[
|
||||
// Dialog slide up
|
||||
[{ transform: "translateY(0)" }, { transform: "translateY(-50px)" }],
|
||||
{ duration: 150, easing: b.EMPHASIZED_ACCELERATE }
|
||||
]
|
||||
],
|
||||
scrim: [
|
||||
[
|
||||
// Scrim fade out
|
||||
[{ opacity: 0.32 }, { opacity: 0 }],
|
||||
{ duration: 150, easing: "linear" }
|
||||
]
|
||||
],
|
||||
container: [
|
||||
[
|
||||
// Container shrink
|
||||
[{ height: "100%" }, { height: "35%" }],
|
||||
{
|
||||
duration: 150,
|
||||
easing: b.EMPHASIZED_ACCELERATE,
|
||||
pseudoElement: "::before"
|
||||
}
|
||||
],
|
||||
[
|
||||
// Container fade out
|
||||
[{ opacity: "1" }, { opacity: "0" }],
|
||||
{ delay: 100, duration: 50, easing: "linear", pseudoElement: "::before" }
|
||||
]
|
||||
],
|
||||
headline: [
|
||||
[
|
||||
// Headline fade out
|
||||
[{ opacity: 1 }, { opacity: 0 }],
|
||||
{ duration: 100, easing: "linear", fill: "forwards" }
|
||||
]
|
||||
],
|
||||
content: [
|
||||
[
|
||||
// Content fade out
|
||||
[{ opacity: 1 }, { opacity: 0 }],
|
||||
{ duration: 100, easing: "linear", fill: "forwards" }
|
||||
]
|
||||
],
|
||||
actions: [
|
||||
[
|
||||
// Actions fade out
|
||||
[{ opacity: 1 }, { opacity: 0 }],
|
||||
{ duration: 100, easing: "linear", fill: "forwards" }
|
||||
]
|
||||
]
|
||||
};
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const W = H($);
|
||||
let s = class extends W {
|
||||
// We do not use `delegatesFocus: true` due to a Chromium bug with
|
||||
// selecting text.
|
||||
// See https://bugs.chromium.org/p/chromium/issues/detail?id=950357
|
||||
/**
|
||||
* Opens the dialog when set to `true` and closes it when set to `false`.
|
||||
*/
|
||||
get open() {
|
||||
return this.isOpen;
|
||||
}
|
||||
set open(e) {
|
||||
e !== this.isOpen && (this.isOpen = e, e ? (this.setAttribute("open", ""), this.show()) : (this.removeAttribute("open"), this.close()));
|
||||
}
|
||||
constructor() {
|
||||
super(), this.quick = !1, this.returnValue = "", this.noFocusTrap = !1, this.getOpenAnimation = () => M, this.getCloseAnimation = () => V, this.isOpen = !1, this.isOpening = !1, this.isConnectedPromise = this.getIsConnectedPromise(), this.isAtScrollTop = !1, this.isAtScrollBottom = !1, this.nextClickIsFromContent = !1, this.hasHeadline = !1, this.hasActions = !1, this.hasIcon = !1, this.escapePressedWithoutCancel = !1, this.treewalker = document.createTreeWalker(this, NodeFilter.SHOW_ELEMENT), this.addEventListener("submit", this.handleSubmit);
|
||||
}
|
||||
/**
|
||||
* Opens the dialog and fires a cancelable `open` event. After a dialog's
|
||||
* animation, an `opened` event is fired.
|
||||
*
|
||||
* Add an `autofocus` attribute to a child of the dialog that should
|
||||
* receive focus after opening.
|
||||
*
|
||||
* @return A Promise that resolves after the animation is finished and the
|
||||
* `opened` event was fired.
|
||||
*/
|
||||
async show() {
|
||||
var i;
|
||||
this.isOpening = !0, await this.isConnectedPromise, await this.updateComplete;
|
||||
const e = this.dialog;
|
||||
if (e.open || !this.isOpening) {
|
||||
this.isOpening = !1;
|
||||
return;
|
||||
}
|
||||
if (!this.dispatchEvent(new Event("open", { cancelable: !0 }))) {
|
||||
this.open = !1, this.isOpening = !1;
|
||||
return;
|
||||
}
|
||||
e.showModal(), this.open = !0, this.scroller && (this.scroller.scrollTop = 0), (i = this.querySelector("[autofocus]")) == null || i.focus(), await this.animateDialog(this.getOpenAnimation()), this.dispatchEvent(new Event("opened")), this.isOpening = !1;
|
||||
}
|
||||
/**
|
||||
* Closes the dialog and fires a cancelable `close` event. After a dialog's
|
||||
* animation, a `closed` event is fired.
|
||||
*
|
||||
* @param returnValue A return value usually indicating which button was used
|
||||
* to close a dialog. If a dialog is canceled by clicking the scrim or
|
||||
* pressing Escape, it will not change the return value after closing.
|
||||
* @return A Promise that resolves after the animation is finished and the
|
||||
* `closed` event was fired.
|
||||
*/
|
||||
async close(e = this.returnValue) {
|
||||
if (this.isOpening = !1, !this.isConnected) {
|
||||
this.open = !1;
|
||||
return;
|
||||
}
|
||||
await this.updateComplete;
|
||||
const t = this.dialog;
|
||||
if (!t.open || this.isOpening) {
|
||||
this.open = !1;
|
||||
return;
|
||||
}
|
||||
const i = this.returnValue;
|
||||
if (this.returnValue = e, !this.dispatchEvent(new Event("close", { cancelable: !0 }))) {
|
||||
this.returnValue = i;
|
||||
return;
|
||||
}
|
||||
await this.animateDialog(this.getCloseAnimation()), t.close(e), this.open = !1, this.dispatchEvent(new Event("closed"));
|
||||
}
|
||||
connectedCallback() {
|
||||
super.connectedCallback(), this.isConnectedPromiseResolve();
|
||||
}
|
||||
disconnectedCallback() {
|
||||
super.disconnectedCallback(), this.isConnectedPromise = this.getIsConnectedPromise();
|
||||
}
|
||||
render() {
|
||||
const e = this.open && !(this.isAtScrollTop && this.isAtScrollBottom), t = {
|
||||
"has-headline": this.hasHeadline,
|
||||
"has-actions": this.hasActions,
|
||||
"has-icon": this.hasIcon,
|
||||
scrollable: e,
|
||||
"show-top-divider": e && !this.isAtScrollTop,
|
||||
"show-bottom-divider": e && !this.isAtScrollBottom
|
||||
}, i = this.open && !this.noFocusTrap, a = O`
|
||||
<div
|
||||
class="focus-trap"
|
||||
tabindex="0"
|
||||
aria-hidden="true"
|
||||
@focus=${this.handleFocusTrapFocus}></div>
|
||||
`, { ariaLabel: r } = this;
|
||||
return O`
|
||||
<div class="scrim"></div>
|
||||
<dialog
|
||||
class=${L(t)}
|
||||
aria-label=${r || h}
|
||||
aria-labelledby=${this.hasHeadline ? "headline" : h}
|
||||
role=${this.type === "alert" ? "alertdialog" : h}
|
||||
@cancel=${this.handleCancel}
|
||||
@click=${this.handleDialogClick}
|
||||
@close=${this.handleClose}
|
||||
@keydown=${this.handleKeydown}
|
||||
.returnValue=${this.returnValue || h}>
|
||||
${i ? a : h}
|
||||
<div class="container" @click=${this.handleContentClick}>
|
||||
<div class="headline">
|
||||
<div class="icon" aria-hidden="true">
|
||||
<slot name="icon" @slotchange=${this.handleIconChange}></slot>
|
||||
</div>
|
||||
<h2 id="headline" aria-hidden=${!this.hasHeadline || h}>
|
||||
<slot
|
||||
name="headline"
|
||||
@slotchange=${this.handleHeadlineChange}></slot>
|
||||
</h2>
|
||||
<md-divider></md-divider>
|
||||
</div>
|
||||
<div class="scroller">
|
||||
<div class="content">
|
||||
<div class="top anchor"></div>
|
||||
<slot name="content"></slot>
|
||||
<div class="bottom anchor"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<md-divider></md-divider>
|
||||
<slot name="actions" @slotchange=${this.handleActionsChange}></slot>
|
||||
</div>
|
||||
</div>
|
||||
${i ? a : h}
|
||||
</dialog>
|
||||
`;
|
||||
}
|
||||
firstUpdated() {
|
||||
this.intersectionObserver = new IntersectionObserver((e) => {
|
||||
for (const t of e)
|
||||
this.handleAnchorIntersection(t);
|
||||
}, { root: this.scroller }), this.intersectionObserver.observe(this.topAnchor), this.intersectionObserver.observe(this.bottomAnchor);
|
||||
}
|
||||
handleDialogClick() {
|
||||
if (this.nextClickIsFromContent) {
|
||||
this.nextClickIsFromContent = !1;
|
||||
return;
|
||||
}
|
||||
this.dispatchEvent(new Event("cancel", { cancelable: !0 })) && this.close();
|
||||
}
|
||||
handleContentClick() {
|
||||
this.nextClickIsFromContent = !0;
|
||||
}
|
||||
handleSubmit(e) {
|
||||
const t = e.target, { submitter: i } = e;
|
||||
t.method !== "dialog" || !i || this.close(i.getAttribute("value") ?? this.returnValue);
|
||||
}
|
||||
handleCancel(e) {
|
||||
if (e.target !== this.dialog)
|
||||
return;
|
||||
this.escapePressedWithoutCancel = !1;
|
||||
const t = !_(this, e);
|
||||
e.preventDefault(), !t && this.close();
|
||||
}
|
||||
handleClose() {
|
||||
var e;
|
||||
this.escapePressedWithoutCancel && (this.escapePressedWithoutCancel = !1, (e = this.dialog) == null || e.dispatchEvent(new Event("cancel", { cancelable: !0 })));
|
||||
}
|
||||
handleKeydown(e) {
|
||||
e.key === "Escape" && (this.escapePressedWithoutCancel = !0, setTimeout(() => {
|
||||
this.escapePressedWithoutCancel = !1;
|
||||
}));
|
||||
}
|
||||
async animateDialog(e) {
|
||||
var k;
|
||||
if ((k = this.cancelAnimations) == null || k.abort(), this.cancelAnimations = new AbortController(), this.quick)
|
||||
return;
|
||||
const { dialog: t, scrim: i, container: a, headline: r, content: d, actions: c } = this;
|
||||
if (!t || !i || !a || !r || !d || !c)
|
||||
return;
|
||||
const { container: p, dialog: f, scrim: v, headline: m, content: w, actions: A } = e, E = [
|
||||
[t, f ?? []],
|
||||
[i, v ?? []],
|
||||
[a, p ?? []],
|
||||
[r, m ?? []],
|
||||
[d, w ?? []],
|
||||
[c, A ?? []]
|
||||
], y = [];
|
||||
for (const [F, I] of E)
|
||||
for (const D of I) {
|
||||
const T = F.animate(...D);
|
||||
this.cancelAnimations.signal.addEventListener("abort", () => {
|
||||
T.cancel();
|
||||
}), y.push(T);
|
||||
}
|
||||
await Promise.all(y.map((F) => F.finished.catch(() => {
|
||||
})));
|
||||
}
|
||||
handleHeadlineChange(e) {
|
||||
const t = e.target;
|
||||
this.hasHeadline = t.assignedElements().length > 0;
|
||||
}
|
||||
handleActionsChange(e) {
|
||||
const t = e.target;
|
||||
this.hasActions = t.assignedElements().length > 0;
|
||||
}
|
||||
handleIconChange(e) {
|
||||
const t = e.target;
|
||||
this.hasIcon = t.assignedElements().length > 0;
|
||||
}
|
||||
handleAnchorIntersection(e) {
|
||||
const { target: t, isIntersecting: i } = e;
|
||||
t === this.topAnchor && (this.isAtScrollTop = i), t === this.bottomAnchor && (this.isAtScrollBottom = i);
|
||||
}
|
||||
getIsConnectedPromise() {
|
||||
return new Promise((e) => {
|
||||
this.isConnectedPromiseResolve = e;
|
||||
});
|
||||
}
|
||||
handleFocusTrapFocus(e) {
|
||||
var m;
|
||||
const [t, i] = this.getFirstAndLastFocusableChildren();
|
||||
if (!t || !i) {
|
||||
(m = this.dialog) == null || m.focus();
|
||||
return;
|
||||
}
|
||||
const a = e.target === this.firstFocusTrap, r = !a, d = e.relatedTarget === t, c = e.relatedTarget === i, p = !d && !c;
|
||||
if (r && c || a && p) {
|
||||
t.focus();
|
||||
return;
|
||||
}
|
||||
if (a && d || r && p) {
|
||||
i.focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
getFirstAndLastFocusableChildren() {
|
||||
if (!this.treewalker)
|
||||
return [null, null];
|
||||
let e = null, t = null;
|
||||
for (this.treewalker.currentNode = this.treewalker.root; this.treewalker.nextNode(); ) {
|
||||
const i = this.treewalker.currentNode;
|
||||
B(i) && (e || (e = i), t = i);
|
||||
}
|
||||
return [e, t];
|
||||
}
|
||||
};
|
||||
o([
|
||||
u({ type: Boolean })
|
||||
], s.prototype, "open", null);
|
||||
o([
|
||||
u({ type: Boolean })
|
||||
], s.prototype, "quick", void 0);
|
||||
o([
|
||||
u({ attribute: !1 })
|
||||
], s.prototype, "returnValue", void 0);
|
||||
o([
|
||||
u()
|
||||
], s.prototype, "type", void 0);
|
||||
o([
|
||||
u({ type: Boolean, attribute: "no-focus-trap" })
|
||||
], s.prototype, "noFocusTrap", void 0);
|
||||
o([
|
||||
l("dialog")
|
||||
], s.prototype, "dialog", void 0);
|
||||
o([
|
||||
l(".scrim")
|
||||
], s.prototype, "scrim", void 0);
|
||||
o([
|
||||
l(".container")
|
||||
], s.prototype, "container", void 0);
|
||||
o([
|
||||
l(".headline")
|
||||
], s.prototype, "headline", void 0);
|
||||
o([
|
||||
l(".content")
|
||||
], s.prototype, "content", void 0);
|
||||
o([
|
||||
l(".actions")
|
||||
], s.prototype, "actions", void 0);
|
||||
o([
|
||||
g()
|
||||
], s.prototype, "isAtScrollTop", void 0);
|
||||
o([
|
||||
g()
|
||||
], s.prototype, "isAtScrollBottom", void 0);
|
||||
o([
|
||||
l(".scroller")
|
||||
], s.prototype, "scroller", void 0);
|
||||
o([
|
||||
l(".top.anchor")
|
||||
], s.prototype, "topAnchor", void 0);
|
||||
o([
|
||||
l(".bottom.anchor")
|
||||
], s.prototype, "bottomAnchor", void 0);
|
||||
o([
|
||||
l(".focus-trap")
|
||||
], s.prototype, "firstFocusTrap", void 0);
|
||||
o([
|
||||
g()
|
||||
], s.prototype, "hasHeadline", void 0);
|
||||
o([
|
||||
g()
|
||||
], s.prototype, "hasActions", void 0);
|
||||
o([
|
||||
g()
|
||||
], s.prototype, "hasIcon", void 0);
|
||||
function B(n) {
|
||||
var r;
|
||||
const e = ":is(button,input,select,textarea,object,:is(a,area)[href],[tabindex],[contenteditable=true])", t = ":not(:disabled,[disabled])";
|
||||
return n.matches(e + t + ':not([tabindex^="-"])') ? !0 : !n.localName.includes("-") || !n.matches(t) ? !1 : ((r = n.shadowRoot) == null ? void 0 : r.delegatesFocus) ?? !1;
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const R = N`:host{border-start-start-radius:var(--md-dialog-container-shape-start-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-start-end-radius:var(--md-dialog-container-shape-start-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-end-radius:var(--md-dialog-container-shape-end-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-start-radius:var(--md-dialog-container-shape-end-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));display:contents;margin:auto;max-height:min(560px,100% - 48px);max-width:min(560px,100% - 48px);min-height:140px;min-width:280px;position:fixed;height:fit-content;width:fit-content}dialog{background:rgba(0,0,0,0);border:none;border-radius:inherit;flex-direction:column;height:inherit;margin:inherit;max-height:inherit;max-width:inherit;min-height:inherit;min-width:inherit;outline:none;overflow:visible;padding:0;width:inherit}dialog[open]{display:flex}::backdrop{background:none}.scrim{background:var(--md-sys-color-scrim, #000);display:none;inset:0;opacity:32%;pointer-events:none;position:fixed;z-index:1}:host([open]) .scrim{display:flex}h2{all:unset;align-self:stretch}.headline{align-items:center;color:var(--md-dialog-headline-color, var(--md-sys-color-on-surface, #1d1b20));display:flex;flex-direction:column;font-family:var(--md-dialog-headline-font, var(--md-sys-typescale-headline-small-font, var(--md-ref-typeface-brand, Roboto)));font-size:var(--md-dialog-headline-size, var(--md-sys-typescale-headline-small-size, 1.5rem));line-height:var(--md-dialog-headline-line-height, var(--md-sys-typescale-headline-small-line-height, 2rem));font-weight:var(--md-dialog-headline-weight, var(--md-sys-typescale-headline-small-weight, var(--md-ref-typeface-weight-regular, 400)));position:relative}slot[name=headline]::slotted(*){align-items:center;align-self:stretch;box-sizing:border-box;display:flex;gap:8px;padding:24px 24px 0}.icon{display:flex}slot[name=icon]::slotted(*){color:var(--md-dialog-icon-color, var(--md-sys-color-secondary, #625b71));fill:currentColor;font-size:var(--md-dialog-icon-size, 24px);margin-top:24px;height:var(--md-dialog-icon-size, 24px);width:var(--md-dialog-icon-size, 24px)}.has-icon slot[name=headline]::slotted(*){justify-content:center;padding-top:16px}.scrollable slot[name=headline]::slotted(*){padding-bottom:16px}.scrollable.has-headline slot[name=content]::slotted(*){padding-top:8px}.container{border-radius:inherit;display:flex;flex-direction:column;flex-grow:1;overflow:hidden;position:relative;transform-origin:top}.container::before{background:var(--md-dialog-container-color, var(--md-sys-color-surface-container-high, #ece6f0));border-radius:inherit;content:"";inset:0;position:absolute}.scroller{display:flex;flex:1;flex-direction:column;overflow:hidden;z-index:1}.scrollable .scroller{overflow-y:scroll}.content{color:var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-dialog-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-dialog-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-dialog-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));flex:1;font-weight:var(--md-dialog-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)));height:min-content;position:relative}slot[name=content]::slotted(*){box-sizing:border-box;padding:24px}.anchor{position:absolute}.top.anchor{top:0}.bottom.anchor{bottom:0}.actions{position:relative}slot[name=actions]::slotted(*){box-sizing:border-box;display:flex;gap:8px;justify-content:flex-end;padding:16px 24px 24px}.has-actions slot[name=content]::slotted(*){padding-bottom:8px}md-divider{display:none;position:absolute}.has-headline.show-top-divider .headline md-divider,.has-actions.show-bottom-divider .actions md-divider{display:flex}.headline md-divider{bottom:0}.actions md-divider{top:0}@media(forced-colors: active){dialog{outline:2px solid WindowText}}
|
||||
`;
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
let x = class extends s {
|
||||
};
|
||||
x.styles = [R];
|
||||
x = o([
|
||||
z("md-dialog")
|
||||
], x);
|
||||
const q = P({
|
||||
react: S,
|
||||
tagName: "md-dialog",
|
||||
elementClass: x,
|
||||
events: {
|
||||
onClose: "close",
|
||||
onShow: "show",
|
||||
onOpen: "open",
|
||||
onOpened: "opened",
|
||||
onClosed: "closed",
|
||||
onCancel: "cancel"
|
||||
}
|
||||
}), te = (n) => {
|
||||
const { children: e, quick: t, returnValue: i, noFocusTrap: a, open: r, fullScreen: d, style: c, className: p, id: f, onClose: v, onShow: m, onOpen: w, onOpened: A, onClosed: E, onCancel: y } = n;
|
||||
return /* @__PURE__ */ C(
|
||||
q,
|
||||
{
|
||||
quick: t,
|
||||
returnValue: i,
|
||||
noFocusTrap: a,
|
||||
open: r,
|
||||
style: {
|
||||
...c,
|
||||
...d ? {
|
||||
width: "100vw",
|
||||
height: "100vh",
|
||||
maxWidth: "100vw",
|
||||
maxHeight: "100vh"
|
||||
} : {}
|
||||
},
|
||||
className: p,
|
||||
id: f,
|
||||
onClose: v,
|
||||
onShow: m,
|
||||
onOpen: w,
|
||||
onOpened: A,
|
||||
onClosed: E,
|
||||
onCancel: y,
|
||||
children: e
|
||||
}
|
||||
);
|
||||
}, ie = (n) => /* @__PURE__ */ C("div", { slot: "headline", ...n, children: n.children }), oe = (n) => /* @__PURE__ */ C("div", { slot: "content", ...n, children: n.children }), se = (n) => /* @__PURE__ */ C("div", { slot: "actions", ...n, children: n.children });
|
||||
export {
|
||||
te as Dialog,
|
||||
se as DialogActions,
|
||||
oe as DialogContent,
|
||||
ie as DialogTitle
|
||||
};
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./string_utils-Bad7L8P5.js");/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/class p{static harmonize(r,t){const e=i.Hct.fromInt(r),n=i.Hct.fromInt(t),a=i.differenceDegrees(e.hue,n.hue),o=Math.min(a*.5,15),c=i.sanitizeDegreesDouble(e.hue+o*i.rotationDirection(e.hue,n.hue));return i.Hct.from(c,e.chroma,e.tone).toInt()}static hctHue(r,t,e){const n=p.cam16Ucs(r,t,e),a=i.Cam16.fromInt(n),o=i.Cam16.fromInt(r);return i.Hct.from(a.hue,o.chroma,i.lstarFromArgb(r)).toInt()}static cam16Ucs(r,t,e){const n=i.Cam16.fromInt(r),a=i.Cam16.fromInt(t),o=n.jstar,c=n.astar,f=n.bstar,C=a.jstar,d=a.astar,y=a.bstar,l=o+(C-o)*e,g=c+(d-c)*e,H=f+(y-f)*e;return i.Cam16.fromUcs(l,g,H).toInt()}}/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/class u{static fromInt(r){const t=i.Hct.fromInt(r);return u.fromHct(t)}static fromHct(r){return new u(r.hue,r.chroma,r)}static fromHueAndChroma(r,t){const e=new S(r,t).create();return new u(r,t,e)}constructor(r,t,e){this.hue=r,this.chroma=t,this.keyColor=e,this.cache=new Map}tone(r){let t=this.cache.get(r);return t===void 0&&(t=i.Hct.from(this.hue,this.chroma,r).toInt(),this.cache.set(r,t)),t}getHct(r){return i.Hct.fromInt(this.tone(r))}}class S{constructor(r,t){this.hue=r,this.requestedChroma=t,this.chromaCache=new Map,this.maxChromaValue=200}create(){let n=0,a=100;for(;n<a;){const o=Math.floor((n+a)/2),c=this.maxChroma(o)<this.maxChroma(o+1);if(this.maxChroma(o)>=this.requestedChroma-.01)if(Math.abs(n-50)<Math.abs(a-50))a=o;else{if(n===o)return i.Hct.from(this.hue,this.requestedChroma,n);n=o}else c?n=o+1:a=o}return i.Hct.from(this.hue,this.requestedChroma,n)}maxChroma(r){if(this.chromaCache.has(r))return this.chromaCache.get(r);const t=i.Hct.from(this.hue,this.maxChromaValue,r).chroma;return this.chromaCache.set(r,t),t}}/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/class s{static of(r){return new s(r,!1)}static contentOf(r){return new s(r,!0)}static fromColors(r){return s.createPaletteFromColors(!1,r)}static contentFromColors(r){return s.createPaletteFromColors(!0,r)}static createPaletteFromColors(r,t){const e=new s(t.primary,r);if(t.secondary){const n=new s(t.secondary,r);e.a2=n.a1}if(t.tertiary){const n=new s(t.tertiary,r);e.a3=n.a1}if(t.error){const n=new s(t.error,r);e.error=n.a1}if(t.neutral){const n=new s(t.neutral,r);e.n1=n.n1}if(t.neutralVariant){const n=new s(t.neutralVariant,r);e.n2=n.n2}return e}constructor(r,t){const e=i.Hct.fromInt(r),n=e.hue,a=e.chroma;t?(this.a1=u.fromHueAndChroma(n,a),this.a2=u.fromHueAndChroma(n,a/3),this.a3=u.fromHueAndChroma(n+60,a/2),this.n1=u.fromHueAndChroma(n,Math.min(a/12,4)),this.n2=u.fromHueAndChroma(n,Math.min(a/6,8))):(this.a1=u.fromHueAndChroma(n,Math.max(48,a)),this.a2=u.fromHueAndChroma(n,16),this.a3=u.fromHueAndChroma(n+60,24),this.n1=u.fromHueAndChroma(n,4),this.n2=u.fromHueAndChroma(n,8)),this.error=u.fromHueAndChroma(25,84)}}/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/class m{get primary(){return this.props.primary}get onPrimary(){return this.props.onPrimary}get primaryContainer(){return this.props.primaryContainer}get onPrimaryContainer(){return this.props.onPrimaryContainer}get secondary(){return this.props.secondary}get onSecondary(){return this.props.onSecondary}get secondaryContainer(){return this.props.secondaryContainer}get onSecondaryContainer(){return this.props.onSecondaryContainer}get tertiary(){return this.props.tertiary}get onTertiary(){return this.props.onTertiary}get tertiaryContainer(){return this.props.tertiaryContainer}get onTertiaryContainer(){return this.props.onTertiaryContainer}get error(){return this.props.error}get onError(){return this.props.onError}get errorContainer(){return this.props.errorContainer}get onErrorContainer(){return this.props.onErrorContainer}get background(){return this.props.background}get onBackground(){return this.props.onBackground}get surface(){return this.props.surface}get onSurface(){return this.props.onSurface}get surfaceVariant(){return this.props.surfaceVariant}get onSurfaceVariant(){return this.props.onSurfaceVariant}get outline(){return this.props.outline}get outlineVariant(){return this.props.outlineVariant}get shadow(){return this.props.shadow}get scrim(){return this.props.scrim}get inverseSurface(){return this.props.inverseSurface}get inverseOnSurface(){return this.props.inverseOnSurface}get inversePrimary(){return this.props.inversePrimary}static light(r){return m.lightFromCorePalette(s.of(r))}static dark(r){return m.darkFromCorePalette(s.of(r))}static lightContent(r){return m.lightFromCorePalette(s.contentOf(r))}static darkContent(r){return m.darkFromCorePalette(s.contentOf(r))}static lightFromCorePalette(r){return new m({primary:r.a1.tone(40),onPrimary:r.a1.tone(100),primaryContainer:r.a1.tone(90),onPrimaryContainer:r.a1.tone(10),secondary:r.a2.tone(40),onSecondary:r.a2.tone(100),secondaryContainer:r.a2.tone(90),onSecondaryContainer:r.a2.tone(10),tertiary:r.a3.tone(40),onTertiary:r.a3.tone(100),tertiaryContainer:r.a3.tone(90),onTertiaryContainer:r.a3.tone(10),error:r.error.tone(40),onError:r.error.tone(100),errorContainer:r.error.tone(90),onErrorContainer:r.error.tone(10),background:r.n1.tone(99),onBackground:r.n1.tone(10),surface:r.n1.tone(99),onSurface:r.n1.tone(10),surfaceVariant:r.n2.tone(90),onSurfaceVariant:r.n2.tone(30),outline:r.n2.tone(50),outlineVariant:r.n2.tone(80),shadow:r.n1.tone(0),scrim:r.n1.tone(0),inverseSurface:r.n1.tone(20),inverseOnSurface:r.n1.tone(95),inversePrimary:r.a1.tone(80)})}static darkFromCorePalette(r){return new m({primary:r.a1.tone(80),onPrimary:r.a1.tone(20),primaryContainer:r.a1.tone(30),onPrimaryContainer:r.a1.tone(90),secondary:r.a2.tone(80),onSecondary:r.a2.tone(20),secondaryContainer:r.a2.tone(30),onSecondaryContainer:r.a2.tone(90),tertiary:r.a3.tone(80),onTertiary:r.a3.tone(20),tertiaryContainer:r.a3.tone(30),onTertiaryContainer:r.a3.tone(90),error:r.error.tone(80),onError:r.error.tone(20),errorContainer:r.error.tone(30),onErrorContainer:r.error.tone(80),background:r.n1.tone(10),onBackground:r.n1.tone(90),surface:r.n1.tone(10),onSurface:r.n1.tone(90),surfaceVariant:r.n2.tone(30),onSurfaceVariant:r.n2.tone(80),outline:r.n2.tone(60),outlineVariant:r.n2.tone(30),shadow:r.n1.tone(0),scrim:r.n1.tone(0),inverseSurface:r.n1.tone(90),inverseOnSurface:r.n1.tone(20),inversePrimary:r.a1.tone(40)})}constructor(r){this.props=r}toJSON(){return{...this.props}}}/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/function w(h,r=[]){const t=s.of(h);return{source:h,schemes:{light:m.light(h),dark:m.dark(h)},palettes:{primary:t.a1,secondary:t.a2,tertiary:t.a3,neutral:t.n1,neutralVariant:t.n2,error:t.error},customColors:r.map(e=>b(h,e))}}function b(h,r){let t=r.value;const e=t,n=h;r.blend&&(t=p.harmonize(e,n));const o=s.of(t).a1;return{color:r,value:t,light:{color:o.tone(40),onColor:o.tone(100),colorContainer:o.tone(90),onColorContainer:o.tone(10)},dark:{color:o.tone(80),onColor:o.tone(20),colorContainer:o.tone(30),onColorContainer:o.tone(90)}}}function k(h){const r=i.argbFromHex(h);return w(r)}exports.createTheme=k;
|
||||
|
|
@ -0,0 +1,504 @@
|
|||
import { H as u, d as w, s as k, r as v, C as f, l as V, a as b } from "./string_utils-B4bsIQ5w.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
class C {
|
||||
/**
|
||||
* Blend the design color's HCT hue towards the key color's HCT
|
||||
* hue, in a way that leaves the original color recognizable and
|
||||
* recognizably shifted towards the key color.
|
||||
*
|
||||
* @param designColor ARGB representation of an arbitrary color.
|
||||
* @param sourceColor ARGB representation of the main theme color.
|
||||
* @return The design color with a hue shifted towards the
|
||||
* system's color, a slightly warmer/cooler variant of the design
|
||||
* color's hue.
|
||||
*/
|
||||
static harmonize(r, t) {
|
||||
const e = u.fromInt(r), n = u.fromInt(t), a = w(e.hue, n.hue), o = Math.min(a * 0.5, 15), c = k(e.hue + o * v(e.hue, n.hue));
|
||||
return u.from(c, e.chroma, e.tone).toInt();
|
||||
}
|
||||
/**
|
||||
* Blends hue from one color into another. The chroma and tone of
|
||||
* the original color are maintained.
|
||||
*
|
||||
* @param from ARGB representation of color
|
||||
* @param to ARGB representation of color
|
||||
* @param amount how much blending to perform; 0.0 >= and <= 1.0
|
||||
* @return from, with a hue blended towards to. Chroma and tone
|
||||
* are constant.
|
||||
*/
|
||||
static hctHue(r, t, e) {
|
||||
const n = C.cam16Ucs(r, t, e), a = f.fromInt(n), o = f.fromInt(r);
|
||||
return u.from(a.hue, o.chroma, V(r)).toInt();
|
||||
}
|
||||
/**
|
||||
* Blend in CAM16-UCS space.
|
||||
*
|
||||
* @param from ARGB representation of color
|
||||
* @param to ARGB representation of color
|
||||
* @param amount how much blending to perform; 0.0 >= and <= 1.0
|
||||
* @return from, blended towards to. Hue, chroma, and tone will
|
||||
* change.
|
||||
*/
|
||||
static cam16Ucs(r, t, e) {
|
||||
const n = f.fromInt(r), a = f.fromInt(t), o = n.jstar, c = n.astar, p = n.bstar, d = a.jstar, y = a.astar, l = a.bstar, g = o + (d - o) * e, S = c + (y - c) * e, H = p + (l - p) * e;
|
||||
return f.fromUcs(g, S, H).toInt();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
class i {
|
||||
/**
|
||||
* @param argb ARGB representation of a color
|
||||
* @return Tones matching that color's hue and chroma.
|
||||
*/
|
||||
static fromInt(r) {
|
||||
const t = u.fromInt(r);
|
||||
return i.fromHct(t);
|
||||
}
|
||||
/**
|
||||
* @param hct Hct
|
||||
* @return Tones matching that color's hue and chroma.
|
||||
*/
|
||||
static fromHct(r) {
|
||||
return new i(r.hue, r.chroma, r);
|
||||
}
|
||||
/**
|
||||
* @param hue HCT hue
|
||||
* @param chroma HCT chroma
|
||||
* @return Tones matching hue and chroma.
|
||||
*/
|
||||
static fromHueAndChroma(r, t) {
|
||||
const e = new A(r, t).create();
|
||||
return new i(r, t, e);
|
||||
}
|
||||
constructor(r, t, e) {
|
||||
this.hue = r, this.chroma = t, this.keyColor = e, this.cache = /* @__PURE__ */ new Map();
|
||||
}
|
||||
/**
|
||||
* @param tone HCT tone, measured from 0 to 100.
|
||||
* @return ARGB representation of a color with that tone.
|
||||
*/
|
||||
tone(r) {
|
||||
let t = this.cache.get(r);
|
||||
return t === void 0 && (t = u.from(this.hue, this.chroma, r).toInt(), this.cache.set(r, t)), t;
|
||||
}
|
||||
/**
|
||||
* @param tone HCT tone.
|
||||
* @return HCT representation of a color with that tone.
|
||||
*/
|
||||
getHct(r) {
|
||||
return u.fromInt(this.tone(r));
|
||||
}
|
||||
}
|
||||
class A {
|
||||
constructor(r, t) {
|
||||
this.hue = r, this.requestedChroma = t, this.chromaCache = /* @__PURE__ */ new Map(), this.maxChromaValue = 200;
|
||||
}
|
||||
/**
|
||||
* Creates a key color from a [hue] and a [chroma].
|
||||
* The key color is the first tone, starting from T50, matching the given hue
|
||||
* and chroma.
|
||||
*
|
||||
* @return Key color [Hct]
|
||||
*/
|
||||
create() {
|
||||
let n = 0, a = 100;
|
||||
for (; n < a; ) {
|
||||
const o = Math.floor((n + a) / 2), c = this.maxChroma(o) < this.maxChroma(o + 1);
|
||||
if (this.maxChroma(o) >= this.requestedChroma - 0.01)
|
||||
if (Math.abs(n - 50) < Math.abs(a - 50))
|
||||
a = o;
|
||||
else {
|
||||
if (n === o)
|
||||
return u.from(this.hue, this.requestedChroma, n);
|
||||
n = o;
|
||||
}
|
||||
else
|
||||
c ? n = o + 1 : a = o;
|
||||
}
|
||||
return u.from(this.hue, this.requestedChroma, n);
|
||||
}
|
||||
// Find the maximum chroma for a given tone
|
||||
maxChroma(r) {
|
||||
if (this.chromaCache.has(r))
|
||||
return this.chromaCache.get(r);
|
||||
const t = u.from(this.hue, this.maxChromaValue, r).chroma;
|
||||
return this.chromaCache.set(r, t), t;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
class s {
|
||||
/**
|
||||
* @param argb ARGB representation of a color
|
||||
*/
|
||||
static of(r) {
|
||||
return new s(r, !1);
|
||||
}
|
||||
/**
|
||||
* @param argb ARGB representation of a color
|
||||
*/
|
||||
static contentOf(r) {
|
||||
return new s(r, !0);
|
||||
}
|
||||
/**
|
||||
* Create a [CorePalette] from a set of colors
|
||||
*/
|
||||
static fromColors(r) {
|
||||
return s.createPaletteFromColors(!1, r);
|
||||
}
|
||||
/**
|
||||
* Create a content [CorePalette] from a set of colors
|
||||
*/
|
||||
static contentFromColors(r) {
|
||||
return s.createPaletteFromColors(!0, r);
|
||||
}
|
||||
static createPaletteFromColors(r, t) {
|
||||
const e = new s(t.primary, r);
|
||||
if (t.secondary) {
|
||||
const n = new s(t.secondary, r);
|
||||
e.a2 = n.a1;
|
||||
}
|
||||
if (t.tertiary) {
|
||||
const n = new s(t.tertiary, r);
|
||||
e.a3 = n.a1;
|
||||
}
|
||||
if (t.error) {
|
||||
const n = new s(t.error, r);
|
||||
e.error = n.a1;
|
||||
}
|
||||
if (t.neutral) {
|
||||
const n = new s(t.neutral, r);
|
||||
e.n1 = n.n1;
|
||||
}
|
||||
if (t.neutralVariant) {
|
||||
const n = new s(t.neutralVariant, r);
|
||||
e.n2 = n.n2;
|
||||
}
|
||||
return e;
|
||||
}
|
||||
constructor(r, t) {
|
||||
const e = u.fromInt(r), n = e.hue, a = e.chroma;
|
||||
t ? (this.a1 = i.fromHueAndChroma(n, a), this.a2 = i.fromHueAndChroma(n, a / 3), this.a3 = i.fromHueAndChroma(n + 60, a / 2), this.n1 = i.fromHueAndChroma(n, Math.min(a / 12, 4)), this.n2 = i.fromHueAndChroma(n, Math.min(a / 6, 8))) : (this.a1 = i.fromHueAndChroma(n, Math.max(48, a)), this.a2 = i.fromHueAndChroma(n, 16), this.a3 = i.fromHueAndChroma(n + 60, 24), this.n1 = i.fromHueAndChroma(n, 4), this.n2 = i.fromHueAndChroma(n, 8)), this.error = i.fromHueAndChroma(25, 84);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
class m {
|
||||
get primary() {
|
||||
return this.props.primary;
|
||||
}
|
||||
get onPrimary() {
|
||||
return this.props.onPrimary;
|
||||
}
|
||||
get primaryContainer() {
|
||||
return this.props.primaryContainer;
|
||||
}
|
||||
get onPrimaryContainer() {
|
||||
return this.props.onPrimaryContainer;
|
||||
}
|
||||
get secondary() {
|
||||
return this.props.secondary;
|
||||
}
|
||||
get onSecondary() {
|
||||
return this.props.onSecondary;
|
||||
}
|
||||
get secondaryContainer() {
|
||||
return this.props.secondaryContainer;
|
||||
}
|
||||
get onSecondaryContainer() {
|
||||
return this.props.onSecondaryContainer;
|
||||
}
|
||||
get tertiary() {
|
||||
return this.props.tertiary;
|
||||
}
|
||||
get onTertiary() {
|
||||
return this.props.onTertiary;
|
||||
}
|
||||
get tertiaryContainer() {
|
||||
return this.props.tertiaryContainer;
|
||||
}
|
||||
get onTertiaryContainer() {
|
||||
return this.props.onTertiaryContainer;
|
||||
}
|
||||
get error() {
|
||||
return this.props.error;
|
||||
}
|
||||
get onError() {
|
||||
return this.props.onError;
|
||||
}
|
||||
get errorContainer() {
|
||||
return this.props.errorContainer;
|
||||
}
|
||||
get onErrorContainer() {
|
||||
return this.props.onErrorContainer;
|
||||
}
|
||||
get background() {
|
||||
return this.props.background;
|
||||
}
|
||||
get onBackground() {
|
||||
return this.props.onBackground;
|
||||
}
|
||||
get surface() {
|
||||
return this.props.surface;
|
||||
}
|
||||
get onSurface() {
|
||||
return this.props.onSurface;
|
||||
}
|
||||
get surfaceVariant() {
|
||||
return this.props.surfaceVariant;
|
||||
}
|
||||
get onSurfaceVariant() {
|
||||
return this.props.onSurfaceVariant;
|
||||
}
|
||||
get outline() {
|
||||
return this.props.outline;
|
||||
}
|
||||
get outlineVariant() {
|
||||
return this.props.outlineVariant;
|
||||
}
|
||||
get shadow() {
|
||||
return this.props.shadow;
|
||||
}
|
||||
get scrim() {
|
||||
return this.props.scrim;
|
||||
}
|
||||
get inverseSurface() {
|
||||
return this.props.inverseSurface;
|
||||
}
|
||||
get inverseOnSurface() {
|
||||
return this.props.inverseOnSurface;
|
||||
}
|
||||
get inversePrimary() {
|
||||
return this.props.inversePrimary;
|
||||
}
|
||||
/**
|
||||
* @param argb ARGB representation of a color.
|
||||
* @return Light Material color scheme, based on the color's hue.
|
||||
*/
|
||||
static light(r) {
|
||||
return m.lightFromCorePalette(s.of(r));
|
||||
}
|
||||
/**
|
||||
* @param argb ARGB representation of a color.
|
||||
* @return Dark Material color scheme, based on the color's hue.
|
||||
*/
|
||||
static dark(r) {
|
||||
return m.darkFromCorePalette(s.of(r));
|
||||
}
|
||||
/**
|
||||
* @param argb ARGB representation of a color.
|
||||
* @return Light Material content color scheme, based on the color's hue.
|
||||
*/
|
||||
static lightContent(r) {
|
||||
return m.lightFromCorePalette(s.contentOf(r));
|
||||
}
|
||||
/**
|
||||
* @param argb ARGB representation of a color.
|
||||
* @return Dark Material content color scheme, based on the color's hue.
|
||||
*/
|
||||
static darkContent(r) {
|
||||
return m.darkFromCorePalette(s.contentOf(r));
|
||||
}
|
||||
/**
|
||||
* Light scheme from core palette
|
||||
*/
|
||||
static lightFromCorePalette(r) {
|
||||
return new m({
|
||||
primary: r.a1.tone(40),
|
||||
onPrimary: r.a1.tone(100),
|
||||
primaryContainer: r.a1.tone(90),
|
||||
onPrimaryContainer: r.a1.tone(10),
|
||||
secondary: r.a2.tone(40),
|
||||
onSecondary: r.a2.tone(100),
|
||||
secondaryContainer: r.a2.tone(90),
|
||||
onSecondaryContainer: r.a2.tone(10),
|
||||
tertiary: r.a3.tone(40),
|
||||
onTertiary: r.a3.tone(100),
|
||||
tertiaryContainer: r.a3.tone(90),
|
||||
onTertiaryContainer: r.a3.tone(10),
|
||||
error: r.error.tone(40),
|
||||
onError: r.error.tone(100),
|
||||
errorContainer: r.error.tone(90),
|
||||
onErrorContainer: r.error.tone(10),
|
||||
background: r.n1.tone(99),
|
||||
onBackground: r.n1.tone(10),
|
||||
surface: r.n1.tone(99),
|
||||
onSurface: r.n1.tone(10),
|
||||
surfaceVariant: r.n2.tone(90),
|
||||
onSurfaceVariant: r.n2.tone(30),
|
||||
outline: r.n2.tone(50),
|
||||
outlineVariant: r.n2.tone(80),
|
||||
shadow: r.n1.tone(0),
|
||||
scrim: r.n1.tone(0),
|
||||
inverseSurface: r.n1.tone(20),
|
||||
inverseOnSurface: r.n1.tone(95),
|
||||
inversePrimary: r.a1.tone(80)
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Dark scheme from core palette
|
||||
*/
|
||||
static darkFromCorePalette(r) {
|
||||
return new m({
|
||||
primary: r.a1.tone(80),
|
||||
onPrimary: r.a1.tone(20),
|
||||
primaryContainer: r.a1.tone(30),
|
||||
onPrimaryContainer: r.a1.tone(90),
|
||||
secondary: r.a2.tone(80),
|
||||
onSecondary: r.a2.tone(20),
|
||||
secondaryContainer: r.a2.tone(30),
|
||||
onSecondaryContainer: r.a2.tone(90),
|
||||
tertiary: r.a3.tone(80),
|
||||
onTertiary: r.a3.tone(20),
|
||||
tertiaryContainer: r.a3.tone(30),
|
||||
onTertiaryContainer: r.a3.tone(90),
|
||||
error: r.error.tone(80),
|
||||
onError: r.error.tone(20),
|
||||
errorContainer: r.error.tone(30),
|
||||
onErrorContainer: r.error.tone(80),
|
||||
background: r.n1.tone(10),
|
||||
onBackground: r.n1.tone(90),
|
||||
surface: r.n1.tone(10),
|
||||
onSurface: r.n1.tone(90),
|
||||
surfaceVariant: r.n2.tone(30),
|
||||
onSurfaceVariant: r.n2.tone(80),
|
||||
outline: r.n2.tone(60),
|
||||
outlineVariant: r.n2.tone(30),
|
||||
shadow: r.n1.tone(0),
|
||||
scrim: r.n1.tone(0),
|
||||
inverseSurface: r.n1.tone(90),
|
||||
inverseOnSurface: r.n1.tone(20),
|
||||
inversePrimary: r.a1.tone(40)
|
||||
});
|
||||
}
|
||||
constructor(r) {
|
||||
this.props = r;
|
||||
}
|
||||
toJSON() {
|
||||
return {
|
||||
...this.props
|
||||
};
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function I(h, r = []) {
|
||||
const t = s.of(h);
|
||||
return {
|
||||
source: h,
|
||||
schemes: {
|
||||
light: m.light(h),
|
||||
dark: m.dark(h)
|
||||
},
|
||||
palettes: {
|
||||
primary: t.a1,
|
||||
secondary: t.a2,
|
||||
tertiary: t.a3,
|
||||
neutral: t.n1,
|
||||
neutralVariant: t.n2,
|
||||
error: t.error
|
||||
},
|
||||
customColors: r.map((e) => F(h, e))
|
||||
};
|
||||
}
|
||||
function F(h, r) {
|
||||
let t = r.value;
|
||||
const e = t, n = h;
|
||||
r.blend && (t = C.harmonize(e, n));
|
||||
const o = s.of(t).a1;
|
||||
return {
|
||||
color: r,
|
||||
value: t,
|
||||
light: {
|
||||
color: o.tone(40),
|
||||
onColor: o.tone(100),
|
||||
colorContainer: o.tone(90),
|
||||
onColorContainer: o.tone(10)
|
||||
},
|
||||
dark: {
|
||||
color: o.tone(80),
|
||||
onColor: o.tone(20),
|
||||
colorContainer: o.tone(30),
|
||||
onColorContainer: o.tone(90)
|
||||
}
|
||||
};
|
||||
}
|
||||
function P(h) {
|
||||
const r = b(h);
|
||||
return I(r);
|
||||
}
|
||||
export {
|
||||
P as createTheme
|
||||
};
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),C=require("react"),E=require("./create-component-D9KTUrcf.js"),o=require("./class-map-DV5418hw.js");require("./ripple-DoKzzEey.js");const I=require("./animation-A38fZ1oY.js"),q=require("./form-label-activation-CYEOF_US.js"),f=require("./validator-DUxooTr6.js"),b=require("./element-internals-OOm6rgx-.js"),R=require("./focusable-D3uHX6nn.js"),k=require("./form-associated-CxXMoMPu.js");/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/class S extends f.Validator{computeValidity(e){this.radioElement||(this.radioElement=document.createElement("input"),this.radioElement.type="radio",this.radioElement.name="group");let i=!1,t=!1;for(const{checked:r,required:a}of e)a&&(i=!0),r&&(t=!0);return this.radioElement.checked=t,this.radioElement.required=i,{validity:{valueMissing:i&&!t},validationMessage:this.radioElement.validationMessage}}equals(e,i){if(e.length!==i.length)return!1;for(let t=0;t<e.length;t++){const r=e[t],a=i[t];if(r.checked!==a.checked||r.required!==a.required)return!1}return!0}copy(e){return e.map(({checked:i,required:t})=>({checked:i,required:t}))}}/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/class A{get controls(){const e=this.host.getAttribute("name");return!e||!this.root||!this.host.isConnected?[this.host]:Array.from(this.root.querySelectorAll(`[name="${e}"]`))}constructor(e){this.host=e,this.focused=!1,this.root=null,this.handleFocusIn=()=>{this.focused=!0,this.updateTabIndices()},this.handleFocusOut=()=>{this.focused=!1,this.updateTabIndices()},this.handleKeyDown=i=>{const t=i.key==="ArrowDown",r=i.key==="ArrowUp",a=i.key==="ArrowLeft",m=i.key==="ArrowRight";if(!a&&!m&&!t&&!r)return;const c=this.controls;if(!c.length)return;i.preventDefault();const p=getComputedStyle(this.host).direction==="rtl"?a||t:m||t,h=c.indexOf(this.host);let s=p?h+1:h-1;for(;s!==h;){s>=c.length?s=0:s<0&&(s=c.length-1);const n=c[s];if(n.hasAttribute("disabled")){p?s++:s--;continue}for(const d of c)d!==n&&(d.checked=!1,d.tabIndex=-1,d.blur());n.checked=!0,n.tabIndex=0,n.focus(),n.dispatchEvent(new Event("change",{bubbles:!0}));break}}}hostConnected(){this.root=this.host.getRootNode(),this.host.addEventListener("keydown",this.handleKeyDown),this.host.addEventListener("focusin",this.handleFocusIn),this.host.addEventListener("focusout",this.handleFocusOut),this.host.checked&&this.uncheckSiblings(),this.updateTabIndices()}hostDisconnected(){this.host.removeEventListener("keydown",this.handleKeyDown),this.host.removeEventListener("focusin",this.handleFocusIn),this.host.removeEventListener("focusout",this.handleFocusOut),this.updateTabIndices(),this.root=null}handleCheckedChange(){this.host.checked&&(this.uncheckSiblings(),this.updateTabIndices())}uncheckSiblings(){for(const e of this.controls)e!==this.host&&(e.checked=!1)}updateTabIndices(){const e=this.controls,i=e.find(t=>t.checked);if(i||this.focused){const t=i||this.host;t.tabIndex=0;for(const r of e)r!==t&&(r.tabIndex=-1);return}for(const t of e)t.tabIndex=0}}/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/var x;const y=Symbol("checked");let $=0;const L=f.mixinConstraintValidation(k.mixinFormAssociated(b.mixinElementInternals(R.mixinFocusable(o.r))));let u=class extends L{get checked(){return this[y]}set checked(e){const i=this.checked;i!==e&&(this[y]=e,this.requestUpdate("checked",i),this.selectionController.handleCheckedChange())}constructor(){super(),this.maskId=`cutout${++$}`,this[x]=!1,this.required=!1,this.value="on",this.selectionController=new A(this),this.addController(this.selectionController),this[b.internals].role="radio",this.addEventListener("click",this.handleClick.bind(this)),this.addEventListener("keydown",this.handleKeydown.bind(this))}render(){const e={checked:this.checked};return o.x`
|
||||
<div class="container ${o.e$1(e)}" aria-hidden="true">
|
||||
<md-ripple
|
||||
part="ripple"
|
||||
.control=${this}
|
||||
?disabled=${this.disabled}></md-ripple>
|
||||
<md-focus-ring part="focus-ring" .control=${this}></md-focus-ring>
|
||||
<svg class="icon" viewBox="0 0 20 20">
|
||||
<mask id="${this.maskId}">
|
||||
<rect width="100%" height="100%" fill="white" />
|
||||
<circle cx="10" cy="10" r="8" fill="black" />
|
||||
</mask>
|
||||
<circle
|
||||
class="outer circle"
|
||||
cx="10"
|
||||
cy="10"
|
||||
r="10"
|
||||
mask="url(#${this.maskId})" />
|
||||
<circle class="inner circle" cx="10" cy="10" r="5" />
|
||||
</svg>
|
||||
|
||||
<div class="touch-target"></div>
|
||||
</div>
|
||||
`}updated(){this[b.internals].ariaChecked=String(this.checked)}async handleClick(e){this.disabled||(await 0,!e.defaultPrevented&&(q.isActivationClick(e)&&this.focus(),this.checked=!0,this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))))}async handleKeydown(e){await 0,!(e.key!==" "||e.defaultPrevented)&&this.click()}[(x=y,k.getFormValue)](){return this.checked?this.value:null}[k.getFormState](){return String(this.checked)}formResetCallback(){this.checked=this.hasAttribute("checked")}formStateRestoreCallback(e){this.checked=e==="true"}[f.createValidator](){return new S(()=>this.selectionController?this.selectionController.controls:[this])}[f.getValidityAnchor](){return this.container}};o.__decorate([o.n({type:Boolean})],u.prototype,"checked",null);o.__decorate([o.n({type:Boolean})],u.prototype,"required",void 0);o.__decorate([o.n()],u.prototype,"value",void 0);o.__decorate([I.e$1(".container")],u.prototype,"container",void 0);/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const _=o.i$1`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20px);outline:none;position:relative;vertical-align:top;width:var(--md-radio-icon-size, 20px);-webkit-tap-highlight-color:rgba(0,0,0,0);cursor:pointer;--md-ripple-hover-color: var(--md-radio-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-radio-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-radio-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-pressed-opacity: var(--md-radio-pressed-state-layer-opacity, 0.12)}:host([disabled]){cursor:default}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--md-radio-icon-size, 20px))/2)}.container{display:flex;height:100%;place-content:center;place-items:center;width:100%}md-focus-ring{height:44px;inset:unset;width:44px}.checked{--md-ripple-hover-color: var(--md-radio-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-hover-opacity: var(--md-radio-selected-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-radio-selected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-radio-selected-pressed-state-layer-opacity, 0.12)}.touch-target{height:48px;position:absolute;width:48px}:host([touch-target=none]) .touch-target{display:none}md-ripple{border-radius:50%;height:var(--md-radio-state-layer-size, 40px);inset:unset;width:var(--md-radio-state-layer-size, 40px)}.icon{fill:var(--md-radio-icon-color, var(--md-sys-color-on-surface-variant, #49454f));inset:0;position:absolute}.outer.circle{transition:fill 50ms linear}.inner.circle{opacity:0;transform-origin:center;transition:opacity 50ms linear}.checked .icon{fill:var(--md-radio-selected-icon-color, var(--md-sys-color-primary, #6750a4))}.checked .inner.circle{animation:inner-circle-grow 300ms cubic-bezier(0.05, 0.7, 0.1, 1);opacity:1}@keyframes inner-circle-grow{from{transform:scale(0)}to{transform:scale(1)}}:host([disabled]) .circle{animation-duration:0s;transition-duration:0s}:host(:hover) .icon{fill:var(--md-radio-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20))}:host(:focus-within) .icon{fill:var(--md-radio-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20))}:host(:active) .icon{fill:var(--md-radio-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20))}:host([disabled]) .icon{fill:var(--md-radio-disabled-unselected-icon-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-radio-disabled-unselected-icon-opacity, 0.38)}:host(:hover) .checked .icon{fill:var(--md-radio-selected-hover-icon-color, var(--md-sys-color-primary, #6750a4))}:host(:focus-within) .checked .icon{fill:var(--md-radio-selected-focus-icon-color, var(--md-sys-color-primary, #6750a4))}:host(:active) .checked .icon{fill:var(--md-radio-selected-pressed-icon-color, var(--md-sys-color-primary, #6750a4))}:host([disabled]) .checked .icon{fill:var(--md-radio-disabled-selected-icon-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-radio-disabled-selected-icon-opacity, 0.38)}}@layer hcm{@media(forced-colors: active){.icon{fill:CanvasText}:host([disabled]) .icon{fill:GrayText;opacity:1}}}
|
||||
`;/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/let v=class extends u{};v.styles=[_];v=o.__decorate([o.t$1("md-radio")],v);const F=E.o({react:C,tagName:"md-radio",elementClass:v}),T=l=>{const{checked:e,value:i,required:t,disabled:r,name:a,ariaLabel:m,className:c,style:g,id:p,iconColor:h,selectedIconColor:s,iconSize:n,...d}=l;return w.jsx(F,{checked:e,value:i,required:t,disabled:r||!1,name:a,className:c,style:{...g,"--md-radio-icon-color":h||"var(--md-sys-on-surface-variant)","--md-radio-selected-icon-color":s||"var(--md-sys-color-primary)","--md-radio-icon-size":n||"20px"},id:p,"aria-label":m,...d})};exports.Radio=T;
|
||||
|
|
@ -0,0 +1,274 @@
|
|||
import { jsx as x } from "react/jsx-runtime";
|
||||
import w from "react";
|
||||
import { o as C } from "./create-component-CVXl33PD.mjs";
|
||||
import { _ as h, n as y, r as E, x as I, c as R, a as S, b as A } from "./class-map-CwiboTfb.mjs";
|
||||
import "./ripple-pQcEjR05.mjs";
|
||||
import { a as q } from "./animation-DjClVFum.mjs";
|
||||
import { i as L } from "./form-label-activation-ed0HgVsy.mjs";
|
||||
import { V as $, m as F, c as z, g as D } from "./validator-DZt1_yHv.mjs";
|
||||
import { m as T, i as k } from "./element-internals-3IY9gE4L.mjs";
|
||||
import { m as V } from "./focusable-CDJoU7XD.mjs";
|
||||
import { m as K, g as M, a as _ } from "./form-associated-CyYeHPMb.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
class B extends $ {
|
||||
computeValidity(e) {
|
||||
this.radioElement || (this.radioElement = document.createElement("input"), this.radioElement.type = "radio", this.radioElement.name = "group");
|
||||
let i = !1, t = !1;
|
||||
for (const { checked: o, required: r } of e)
|
||||
r && (i = !0), o && (t = !0);
|
||||
return this.radioElement.checked = t, this.radioElement.required = i, {
|
||||
validity: {
|
||||
valueMissing: i && !t
|
||||
},
|
||||
validationMessage: this.radioElement.validationMessage
|
||||
};
|
||||
}
|
||||
equals(e, i) {
|
||||
if (e.length !== i.length)
|
||||
return !1;
|
||||
for (let t = 0; t < e.length; t++) {
|
||||
const o = e[t], r = i[t];
|
||||
if (o.checked !== r.checked || o.required !== r.required)
|
||||
return !1;
|
||||
}
|
||||
return !0;
|
||||
}
|
||||
copy(e) {
|
||||
return e.map(({ checked: i, required: t }) => ({
|
||||
checked: i,
|
||||
required: t
|
||||
}));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
class O {
|
||||
/**
|
||||
* All single selection elements in the host element's root with the same
|
||||
* `name` attribute, including the host element.
|
||||
*/
|
||||
get controls() {
|
||||
const e = this.host.getAttribute("name");
|
||||
return !e || !this.root || !this.host.isConnected ? [this.host] : Array.from(this.root.querySelectorAll(`[name="${e}"]`));
|
||||
}
|
||||
constructor(e) {
|
||||
this.host = e, this.focused = !1, this.root = null, this.handleFocusIn = () => {
|
||||
this.focused = !0, this.updateTabIndices();
|
||||
}, this.handleFocusOut = () => {
|
||||
this.focused = !1, this.updateTabIndices();
|
||||
}, this.handleKeyDown = (i) => {
|
||||
const t = i.key === "ArrowDown", o = i.key === "ArrowUp", r = i.key === "ArrowLeft", u = i.key === "ArrowRight";
|
||||
if (!r && !u && !t && !o)
|
||||
return;
|
||||
const a = this.controls;
|
||||
if (!a.length)
|
||||
return;
|
||||
i.preventDefault();
|
||||
const p = getComputedStyle(this.host).direction === "rtl" ? r || t : u || t, l = a.indexOf(this.host);
|
||||
let s = p ? l + 1 : l - 1;
|
||||
for (; s !== l; ) {
|
||||
s >= a.length ? s = 0 : s < 0 && (s = a.length - 1);
|
||||
const c = a[s];
|
||||
if (c.hasAttribute("disabled")) {
|
||||
p ? s++ : s--;
|
||||
continue;
|
||||
}
|
||||
for (const n of a)
|
||||
n !== c && (n.checked = !1, n.tabIndex = -1, n.blur());
|
||||
c.checked = !0, c.tabIndex = 0, c.focus(), c.dispatchEvent(new Event("change", { bubbles: !0 }));
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
hostConnected() {
|
||||
this.root = this.host.getRootNode(), this.host.addEventListener("keydown", this.handleKeyDown), this.host.addEventListener("focusin", this.handleFocusIn), this.host.addEventListener("focusout", this.handleFocusOut), this.host.checked && this.uncheckSiblings(), this.updateTabIndices();
|
||||
}
|
||||
hostDisconnected() {
|
||||
this.host.removeEventListener("keydown", this.handleKeyDown), this.host.removeEventListener("focusin", this.handleFocusIn), this.host.removeEventListener("focusout", this.handleFocusOut), this.updateTabIndices(), this.root = null;
|
||||
}
|
||||
/**
|
||||
* Should be called whenever the host's `checked` property changes
|
||||
* synchronously.
|
||||
*/
|
||||
handleCheckedChange() {
|
||||
this.host.checked && (this.uncheckSiblings(), this.updateTabIndices());
|
||||
}
|
||||
uncheckSiblings() {
|
||||
for (const e of this.controls)
|
||||
e !== this.host && (e.checked = !1);
|
||||
}
|
||||
/**
|
||||
* Updates the `tabindex` of the host and its siblings.
|
||||
*/
|
||||
updateTabIndices() {
|
||||
const e = this.controls, i = e.find((t) => t.checked);
|
||||
if (i || this.focused) {
|
||||
const t = i || this.host;
|
||||
t.tabIndex = 0;
|
||||
for (const o of e)
|
||||
o !== t && (o.tabIndex = -1);
|
||||
return;
|
||||
}
|
||||
for (const t of e)
|
||||
t.tabIndex = 0;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
var g;
|
||||
const v = Symbol("checked");
|
||||
let N = 0;
|
||||
const U = F(K(T(V(E))));
|
||||
let m = class extends U {
|
||||
/**
|
||||
* Whether or not the radio is selected.
|
||||
*/
|
||||
get checked() {
|
||||
return this[v];
|
||||
}
|
||||
set checked(e) {
|
||||
const i = this.checked;
|
||||
i !== e && (this[v] = e, this.requestUpdate("checked", i), this.selectionController.handleCheckedChange());
|
||||
}
|
||||
constructor() {
|
||||
super(), this.maskId = `cutout${++N}`, this[g] = !1, this.required = !1, this.value = "on", this.selectionController = new O(this), this.addController(this.selectionController), this[k].role = "radio", this.addEventListener("click", this.handleClick.bind(this)), this.addEventListener("keydown", this.handleKeydown.bind(this));
|
||||
}
|
||||
render() {
|
||||
const e = { checked: this.checked };
|
||||
return I`
|
||||
<div class="container ${R(e)}" aria-hidden="true">
|
||||
<md-ripple
|
||||
part="ripple"
|
||||
.control=${this}
|
||||
?disabled=${this.disabled}></md-ripple>
|
||||
<md-focus-ring part="focus-ring" .control=${this}></md-focus-ring>
|
||||
<svg class="icon" viewBox="0 0 20 20">
|
||||
<mask id="${this.maskId}">
|
||||
<rect width="100%" height="100%" fill="white" />
|
||||
<circle cx="10" cy="10" r="8" fill="black" />
|
||||
</mask>
|
||||
<circle
|
||||
class="outer circle"
|
||||
cx="10"
|
||||
cy="10"
|
||||
r="10"
|
||||
mask="url(#${this.maskId})" />
|
||||
<circle class="inner circle" cx="10" cy="10" r="5" />
|
||||
</svg>
|
||||
|
||||
<div class="touch-target"></div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
updated() {
|
||||
this[k].ariaChecked = String(this.checked);
|
||||
}
|
||||
async handleClick(e) {
|
||||
this.disabled || (await 0, !e.defaultPrevented && (L(e) && this.focus(), this.checked = !0, this.dispatchEvent(new Event("change", { bubbles: !0 })), this.dispatchEvent(new InputEvent("input", { bubbles: !0, composed: !0 }))));
|
||||
}
|
||||
async handleKeydown(e) {
|
||||
await 0, !(e.key !== " " || e.defaultPrevented) && this.click();
|
||||
}
|
||||
[(g = v, M)]() {
|
||||
return this.checked ? this.value : null;
|
||||
}
|
||||
[_]() {
|
||||
return String(this.checked);
|
||||
}
|
||||
formResetCallback() {
|
||||
this.checked = this.hasAttribute("checked");
|
||||
}
|
||||
formStateRestoreCallback(e) {
|
||||
this.checked = e === "true";
|
||||
}
|
||||
[z]() {
|
||||
return new B(() => this.selectionController ? this.selectionController.controls : [this]);
|
||||
}
|
||||
[D]() {
|
||||
return this.container;
|
||||
}
|
||||
};
|
||||
h([
|
||||
y({ type: Boolean })
|
||||
], m.prototype, "checked", null);
|
||||
h([
|
||||
y({ type: Boolean })
|
||||
], m.prototype, "required", void 0);
|
||||
h([
|
||||
y()
|
||||
], m.prototype, "value", void 0);
|
||||
h([
|
||||
q(".container")
|
||||
], m.prototype, "container", void 0);
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const P = S`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20px);outline:none;position:relative;vertical-align:top;width:var(--md-radio-icon-size, 20px);-webkit-tap-highlight-color:rgba(0,0,0,0);cursor:pointer;--md-ripple-hover-color: var(--md-radio-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-radio-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-radio-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-pressed-opacity: var(--md-radio-pressed-state-layer-opacity, 0.12)}:host([disabled]){cursor:default}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--md-radio-icon-size, 20px))/2)}.container{display:flex;height:100%;place-content:center;place-items:center;width:100%}md-focus-ring{height:44px;inset:unset;width:44px}.checked{--md-ripple-hover-color: var(--md-radio-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-hover-opacity: var(--md-radio-selected-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-radio-selected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-radio-selected-pressed-state-layer-opacity, 0.12)}.touch-target{height:48px;position:absolute;width:48px}:host([touch-target=none]) .touch-target{display:none}md-ripple{border-radius:50%;height:var(--md-radio-state-layer-size, 40px);inset:unset;width:var(--md-radio-state-layer-size, 40px)}.icon{fill:var(--md-radio-icon-color, var(--md-sys-color-on-surface-variant, #49454f));inset:0;position:absolute}.outer.circle{transition:fill 50ms linear}.inner.circle{opacity:0;transform-origin:center;transition:opacity 50ms linear}.checked .icon{fill:var(--md-radio-selected-icon-color, var(--md-sys-color-primary, #6750a4))}.checked .inner.circle{animation:inner-circle-grow 300ms cubic-bezier(0.05, 0.7, 0.1, 1);opacity:1}@keyframes inner-circle-grow{from{transform:scale(0)}to{transform:scale(1)}}:host([disabled]) .circle{animation-duration:0s;transition-duration:0s}:host(:hover) .icon{fill:var(--md-radio-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20))}:host(:focus-within) .icon{fill:var(--md-radio-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20))}:host(:active) .icon{fill:var(--md-radio-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20))}:host([disabled]) .icon{fill:var(--md-radio-disabled-unselected-icon-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-radio-disabled-unselected-icon-opacity, 0.38)}:host(:hover) .checked .icon{fill:var(--md-radio-selected-hover-icon-color, var(--md-sys-color-primary, #6750a4))}:host(:focus-within) .checked .icon{fill:var(--md-radio-selected-focus-icon-color, var(--md-sys-color-primary, #6750a4))}:host(:active) .checked .icon{fill:var(--md-radio-selected-pressed-icon-color, var(--md-sys-color-primary, #6750a4))}:host([disabled]) .checked .icon{fill:var(--md-radio-disabled-selected-icon-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-radio-disabled-selected-icon-opacity, 0.38)}}@layer hcm{@media(forced-colors: active){.icon{fill:CanvasText}:host([disabled]) .icon{fill:GrayText;opacity:1}}}
|
||||
`;
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
let f = class extends m {
|
||||
};
|
||||
f.styles = [P];
|
||||
f = h([
|
||||
A("md-radio")
|
||||
], f);
|
||||
const j = C({
|
||||
react: w,
|
||||
tagName: "md-radio",
|
||||
elementClass: f
|
||||
}), re = (d) => {
|
||||
const {
|
||||
checked: e,
|
||||
value: i,
|
||||
required: t,
|
||||
disabled: o,
|
||||
name: r,
|
||||
ariaLabel: u,
|
||||
className: a,
|
||||
style: b,
|
||||
id: p,
|
||||
iconColor: l,
|
||||
selectedIconColor: s,
|
||||
iconSize: c,
|
||||
...n
|
||||
} = d;
|
||||
return /* @__PURE__ */ x(
|
||||
j,
|
||||
{
|
||||
checked: e,
|
||||
value: i,
|
||||
required: t,
|
||||
disabled: o || !1,
|
||||
name: r,
|
||||
className: a,
|
||||
style: {
|
||||
...b,
|
||||
"--md-radio-icon-color": l || "var(--md-sys-on-surface-variant)",
|
||||
"--md-radio-selected-icon-color": s || "var(--md-sys-color-primary)",
|
||||
"--md-radio-icon-size": c || "20px"
|
||||
},
|
||||
id: p,
|
||||
"aria-label": u,
|
||||
...n
|
||||
}
|
||||
);
|
||||
};
|
||||
export {
|
||||
re as Radio
|
||||
};
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react/jsx-runtime"),b=require("react"),f=require("./create-component-D9KTUrcf.js"),o=require("./menuItemController-XIsQ9HIe.js"),t=require("./class-map-DV5418hw.js");require("./ripple-DoKzzEey.js");const l=require("./item-DvSwYnPq.js"),g=require("./animation-A38fZ1oY.js"),p=require("./query-assigned-elements-BYttmtWz.js"),E=require("./query-assigned-nodes-Dl8k4w_-.js"),c=require("./static-B9XIUGOk.js"),C=require("./delegate-4958lG3m.js");/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const T=C.mixinDelegatesAria(t.r);class n extends T{constructor(){super(...arguments),this.disabled=!1,this.type="menuitem",this.href="",this.target="",this.keepOpen=!1,this.selected=!1,this.menuItemController=new o.MenuItemController(this,{getHeadlineElements:()=>this.headlineElements,getSupportingTextElements:()=>this.supportingTextElements,getDefaultElements:()=>this.defaultElements,getInteractiveElement:()=>this.listItemRoot})}get typeaheadText(){return this.menuItemController.typeaheadText}set typeaheadText(e){this.menuItemController.setTypeaheadText(e)}render(){return this.renderListItem(t.x`
|
||||
<md-item>
|
||||
<div slot="container">
|
||||
${this.renderRipple()} ${this.renderFocusRing()}
|
||||
</div>
|
||||
<slot name="start" slot="start"></slot>
|
||||
<slot name="end" slot="end"></slot>
|
||||
${this.renderBody()}
|
||||
</md-item>
|
||||
`)}renderListItem(e){const i=this.type==="link";let s;switch(this.menuItemController.tagName){case"a":s=c.i`a`;break;case"button":s=c.i`button`;break;default:case"li":s=c.i`li`;break}const r=i&&this.target?this.target:t.E;return c.u`
|
||||
<${s}
|
||||
id="item"
|
||||
tabindex=${this.disabled&&!i?-1:0}
|
||||
role=${this.menuItemController.role}
|
||||
aria-label=${this.ariaLabel||t.E}
|
||||
aria-selected=${this.ariaSelected||t.E}
|
||||
aria-checked=${this.ariaChecked||t.E}
|
||||
aria-expanded=${this.ariaExpanded||t.E}
|
||||
aria-haspopup=${this.ariaHasPopup||t.E}
|
||||
class="list-item ${t.e$1(this.getRenderClasses())}"
|
||||
href=${this.href||t.E}
|
||||
target=${r}
|
||||
@click=${this.menuItemController.onClick}
|
||||
@keydown=${this.menuItemController.onKeydown}
|
||||
>${e}</${s}>
|
||||
`}renderRipple(){return t.x` <md-ripple
|
||||
part="ripple"
|
||||
for="item"
|
||||
?disabled=${this.disabled}></md-ripple>`}renderFocusRing(){return t.x` <md-focus-ring
|
||||
part="focus-ring"
|
||||
for="item"
|
||||
inward></md-focus-ring>`}getRenderClasses(){return{disabled:this.disabled,selected:this.selected}}renderBody(){return t.x`
|
||||
<slot></slot>
|
||||
<slot name="overline" slot="overline"></slot>
|
||||
<slot name="headline" slot="headline"></slot>
|
||||
<slot name="supporting-text" slot="supporting-text"></slot>
|
||||
<slot
|
||||
name="trailing-supporting-text"
|
||||
slot="trailing-supporting-text"></slot>
|
||||
`}focus(){var e;(e=this.listItemRoot)==null||e.focus()}}n.shadowRootOptions={...t.r.shadowRootOptions,delegatesFocus:!0};t.__decorate([t.n({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0);t.__decorate([t.n()],n.prototype,"type",void 0);t.__decorate([t.n()],n.prototype,"href",void 0);t.__decorate([t.n()],n.prototype,"target",void 0);t.__decorate([t.n({type:Boolean,attribute:"keep-open"})],n.prototype,"keepOpen",void 0);t.__decorate([t.n({type:Boolean})],n.prototype,"selected",void 0);t.__decorate([g.e$1(".list-item")],n.prototype,"listItemRoot",void 0);t.__decorate([p.o({slot:"headline"})],n.prototype,"headlineElements",void 0);t.__decorate([p.o({slot:"supporting-text"})],n.prototype,"supportingTextElements",void 0);t.__decorate([E.n({slot:""})],n.prototype,"defaultElements",void 0);t.__decorate([t.n({attribute:"typeahead-text"})],n.prototype,"typeaheadText",null);/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/let h=class extends n{};h.styles=[o.styles];h=t.__decorate([t.t$1("md-menu-item")],h);/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/let u=class extends t.r{get item(){return this.items[0]??null}get menu(){return this.menus[0]??null}constructor(){super(),this.anchorCorner=o.Corner.START_END,this.menuCorner=o.Corner.START_START,this.hoverOpenDelay=400,this.hoverCloseDelay=400,this.isSubMenu=!0,this.previousOpenTimeout=0,this.previousCloseTimeout=0,this.onMouseenter=()=>{var e;clearTimeout(this.previousOpenTimeout),clearTimeout(this.previousCloseTimeout),!((e=this.menu)!=null&&e.open)&&(this.hoverOpenDelay?this.previousOpenTimeout=setTimeout(()=>{this.show()},this.hoverOpenDelay):this.show())},this.onMouseleave=()=>{clearTimeout(this.previousCloseTimeout),clearTimeout(this.previousOpenTimeout),this.hoverCloseDelay?this.previousCloseTimeout=setTimeout(()=>{this.close()},this.hoverCloseDelay):this.close()},this.addEventListener("mouseenter",this.onMouseenter),this.addEventListener("mouseleave",this.onMouseleave)}render(){return t.x`
|
||||
<slot
|
||||
name="item"
|
||||
@click=${this.onClick}
|
||||
@keydown=${this.onKeydown}
|
||||
@slotchange=${this.onSlotchange}>
|
||||
</slot>
|
||||
<slot
|
||||
name="menu"
|
||||
@keydown=${this.onSubMenuKeydown}
|
||||
@close-menu=${this.onCloseSubmenu}
|
||||
@slotchange=${this.onSlotchange}>
|
||||
</slot>
|
||||
`}firstUpdated(){this.onSlotchange()}async show(){const e=this.menu;if(!e||e.open)return;e.addEventListener("closed",()=>{this.item.ariaExpanded="false",this.dispatchEvent(o.createActivateTypeaheadEvent()),this.dispatchEvent(l.createDeactivateItemsEvent()),e.ariaHidden="true"},{once:!0}),e.positioning==="document"&&(e.positioning="absolute"),e.quick=!0,e.hasOverflow=!0,e.anchorCorner=this.anchorCorner,e.menuCorner=this.menuCorner,e.anchorElement=this.item,e.defaultFocus="first-item",e.removeAttribute("aria-hidden"),e.skipRestoreFocus=!1;const i=e.open;if(e.show(),this.item.ariaExpanded="true",this.item.ariaHasPopup="menu",e.id&&this.item.setAttribute("aria-controls",e.id),this.dispatchEvent(l.createDeactivateItemsEvent()),this.dispatchEvent(o.createDeactivateTypeaheadEvent()),this.item.selected=!0,!i){let s=d=>{};const r=new Promise(d=>{s=d});e.addEventListener("opened",s,{once:!0}),await r}}async close(){const e=this.menu;if(!e||!e.open)return;this.dispatchEvent(o.createActivateTypeaheadEvent()),e.quick=!0,e.close(),this.dispatchEvent(l.createDeactivateItemsEvent());let i=r=>{};const s=new Promise(r=>{i=r});e.addEventListener("closed",i,{once:!0}),await s}onSlotchange(){var i;if(!this.item)return;this.item.ariaExpanded="false",this.item.ariaHasPopup="menu",(i=this.menu)!=null&&i.id&&this.item.setAttribute("aria-controls",this.menu.id),this.item.keepOpen=!0;const e=this.menu;e&&(e.isSubmenu=!0,e.ariaHidden="true")}onClick(){this.show()}async onKeydown(e){const i=this.isSubmenuOpenKey(e.code);if(e.defaultPrevented)return;const s=i&&(o.NavigableKey.LEFT===e.code||o.NavigableKey.RIGHT===e.code);if((e.code===o.SelectionKey.SPACE||s)&&(e.preventDefault(),s&&e.stopPropagation()),!i)return;const r=this.menu;if(!r)return;const d=r.items,y=l.getFirstActivatableItem(d);if(y){await this.show(),y.tabIndex=0,y.focus();return}}onCloseSubmenu(e){const{itemPath:i,reason:s}=e.detail;if(i.push(this.item),this.dispatchEvent(o.createActivateTypeaheadEvent()),s.kind===o.CloseReason.KEYDOWN&&s.key===o.KeydownCloseKey.ESCAPE){e.stopPropagation(),this.item.dispatchEvent(l.createRequestActivationEvent());return}this.dispatchEvent(l.createDeactivateItemsEvent())}async onSubMenuKeydown(e){var r;if(e.defaultPrevented)return;const{close:i,keyCode:s}=this.isSubmenuCloseKey(e.code);i&&(e.preventDefault(),(s===o.NavigableKey.LEFT||s===o.NavigableKey.RIGHT)&&e.stopPropagation(),await this.close(),l.deactivateActiveItem(this.menu.items),(r=this.item)==null||r.focus(),this.item.tabIndex=0,this.item.focus())}isSubmenuOpenKey(e){const s=getComputedStyle(this).direction==="rtl"?o.NavigableKey.LEFT:o.NavigableKey.RIGHT;switch(e){case s:case o.SelectionKey.SPACE:case o.SelectionKey.ENTER:return!0;default:return!1}}isSubmenuCloseKey(e){const s=getComputedStyle(this).direction==="rtl"?o.NavigableKey.RIGHT:o.NavigableKey.LEFT;switch(e){case s:case o.KeydownCloseKey.ESCAPE:return{close:!0,keyCode:e};default:return{close:!1}}}};t.__decorate([t.n({attribute:"anchor-corner"})],u.prototype,"anchorCorner",void 0);t.__decorate([t.n({attribute:"menu-corner"})],u.prototype,"menuCorner",void 0);t.__decorate([t.n({type:Number,attribute:"hover-open-delay"})],u.prototype,"hoverOpenDelay",void 0);t.__decorate([t.n({type:Number,attribute:"hover-close-delay"})],u.prototype,"hoverCloseDelay",void 0);t.__decorate([t.n({type:Boolean,reflect:!0,attribute:"md-sub-menu"})],u.prototype,"isSubMenu",void 0);t.__decorate([p.o({slot:"item",flatten:!0})],u.prototype,"items",void 0);t.__decorate([p.o({slot:"menu",flatten:!0})],u.prototype,"menus",void 0);/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const _=t.i$1`:host{position:relative;display:flex;flex-direction:column}
|
||||
`;/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/let m=class extends u{};m.styles=[_];m=t.__decorate([t.t$1("md-sub-menu")],m);const S=f.o({react:b,tagName:"md-menu",elementClass:o.MdMenu}),x=f.o({react:b,tagName:"md-menu-item",elementClass:h,events:{"close-menu":"onCloseMenu"}}),M=f.o({react:b,tagName:"md-sub-menu",elementClass:m}),I=a=>v.jsx(S,{...a}),$=a=>v.jsx(M,{...a}),w=a=>v.jsx(x,{...a});exports.Menu=I;exports.MenuItem=w;exports.SubMenu=$;
|
||||
|
|
@ -0,0 +1,411 @@
|
|||
import { jsx as E } from "react/jsx-runtime";
|
||||
import T from "react";
|
||||
import { o as S } from "./create-component-CVXl33PD.mjs";
|
||||
import { M as I, s as R, C as M, c as b, a as k, N as l, S as g, b as O, K as x, d as A } from "./menuItemController-CeB921ip.mjs";
|
||||
import { r as $, _ as s, n as r, x as d, E as m, c as K, b as w, a as D } from "./class-map-CwiboTfb.mjs";
|
||||
import "./ripple-pQcEjR05.mjs";
|
||||
import { c as p, g as P, a as L, d as N } from "./item-CpL4zUlE.mjs";
|
||||
import { a as F } from "./animation-DjClVFum.mjs";
|
||||
import { o as f } from "./query-assigned-elements-DUhez03i.mjs";
|
||||
import { n as H } from "./query-assigned-nodes-MKI2zKDb.mjs";
|
||||
import { i as C, u as B } from "./static-DdXEOlS4.mjs";
|
||||
import { m as _ } from "./delegate-BXi1gVeU.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const G = _($);
|
||||
class i extends G {
|
||||
constructor() {
|
||||
super(...arguments), this.disabled = !1, this.type = "menuitem", this.href = "", this.target = "", this.keepOpen = !1, this.selected = !1, this.menuItemController = new I(this, {
|
||||
getHeadlineElements: () => this.headlineElements,
|
||||
getSupportingTextElements: () => this.supportingTextElements,
|
||||
getDefaultElements: () => this.defaultElements,
|
||||
getInteractiveElement: () => this.listItemRoot
|
||||
});
|
||||
}
|
||||
/**
|
||||
* The text that is selectable via typeahead. If not set, defaults to the
|
||||
* innerText of the item slotted into the `"headline"` slot.
|
||||
*/
|
||||
get typeaheadText() {
|
||||
return this.menuItemController.typeaheadText;
|
||||
}
|
||||
set typeaheadText(e) {
|
||||
this.menuItemController.setTypeaheadText(e);
|
||||
}
|
||||
render() {
|
||||
return this.renderListItem(d`
|
||||
<md-item>
|
||||
<div slot="container">
|
||||
${this.renderRipple()} ${this.renderFocusRing()}
|
||||
</div>
|
||||
<slot name="start" slot="start"></slot>
|
||||
<slot name="end" slot="end"></slot>
|
||||
${this.renderBody()}
|
||||
</md-item>
|
||||
`);
|
||||
}
|
||||
/**
|
||||
* Renders the root list item.
|
||||
*
|
||||
* @param content the child content of the list item.
|
||||
*/
|
||||
renderListItem(e) {
|
||||
const o = this.type === "link";
|
||||
let t;
|
||||
switch (this.menuItemController.tagName) {
|
||||
case "a":
|
||||
t = C`a`;
|
||||
break;
|
||||
case "button":
|
||||
t = C`button`;
|
||||
break;
|
||||
default:
|
||||
case "li":
|
||||
t = C`li`;
|
||||
break;
|
||||
}
|
||||
const n = o && this.target ? this.target : m;
|
||||
return B`
|
||||
<${t}
|
||||
id="item"
|
||||
tabindex=${this.disabled && !o ? -1 : 0}
|
||||
role=${this.menuItemController.role}
|
||||
aria-label=${this.ariaLabel || m}
|
||||
aria-selected=${this.ariaSelected || m}
|
||||
aria-checked=${this.ariaChecked || m}
|
||||
aria-expanded=${this.ariaExpanded || m}
|
||||
aria-haspopup=${this.ariaHasPopup || m}
|
||||
class="list-item ${K(this.getRenderClasses())}"
|
||||
href=${this.href || m}
|
||||
target=${n}
|
||||
@click=${this.menuItemController.onClick}
|
||||
@keydown=${this.menuItemController.onKeydown}
|
||||
>${e}</${t}>
|
||||
`;
|
||||
}
|
||||
/**
|
||||
* Handles rendering of the ripple element.
|
||||
*/
|
||||
renderRipple() {
|
||||
return d` <md-ripple
|
||||
part="ripple"
|
||||
for="item"
|
||||
?disabled=${this.disabled}></md-ripple>`;
|
||||
}
|
||||
/**
|
||||
* Handles rendering of the focus ring.
|
||||
*/
|
||||
renderFocusRing() {
|
||||
return d` <md-focus-ring
|
||||
part="focus-ring"
|
||||
for="item"
|
||||
inward></md-focus-ring>`;
|
||||
}
|
||||
/**
|
||||
* Classes applied to the list item root.
|
||||
*/
|
||||
getRenderClasses() {
|
||||
return {
|
||||
disabled: this.disabled,
|
||||
selected: this.selected
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Handles rendering the headline and supporting text.
|
||||
*/
|
||||
renderBody() {
|
||||
return d`
|
||||
<slot></slot>
|
||||
<slot name="overline" slot="overline"></slot>
|
||||
<slot name="headline" slot="headline"></slot>
|
||||
<slot name="supporting-text" slot="supporting-text"></slot>
|
||||
<slot
|
||||
name="trailing-supporting-text"
|
||||
slot="trailing-supporting-text"></slot>
|
||||
`;
|
||||
}
|
||||
focus() {
|
||||
var e;
|
||||
(e = this.listItemRoot) == null || e.focus();
|
||||
}
|
||||
}
|
||||
i.shadowRootOptions = {
|
||||
...$.shadowRootOptions,
|
||||
delegatesFocus: !0
|
||||
};
|
||||
s([
|
||||
r({ type: Boolean, reflect: !0 })
|
||||
], i.prototype, "disabled", void 0);
|
||||
s([
|
||||
r()
|
||||
], i.prototype, "type", void 0);
|
||||
s([
|
||||
r()
|
||||
], i.prototype, "href", void 0);
|
||||
s([
|
||||
r()
|
||||
], i.prototype, "target", void 0);
|
||||
s([
|
||||
r({ type: Boolean, attribute: "keep-open" })
|
||||
], i.prototype, "keepOpen", void 0);
|
||||
s([
|
||||
r({ type: Boolean })
|
||||
], i.prototype, "selected", void 0);
|
||||
s([
|
||||
F(".list-item")
|
||||
], i.prototype, "listItemRoot", void 0);
|
||||
s([
|
||||
f({ slot: "headline" })
|
||||
], i.prototype, "headlineElements", void 0);
|
||||
s([
|
||||
f({ slot: "supporting-text" })
|
||||
], i.prototype, "supportingTextElements", void 0);
|
||||
s([
|
||||
H({ slot: "" })
|
||||
], i.prototype, "defaultElements", void 0);
|
||||
s([
|
||||
r({ attribute: "typeahead-text" })
|
||||
], i.prototype, "typeaheadText", null);
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
let c = class extends i {
|
||||
};
|
||||
c.styles = [R];
|
||||
c = s([
|
||||
w("md-menu-item")
|
||||
], c);
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
let u = class extends $ {
|
||||
get item() {
|
||||
return this.items[0] ?? null;
|
||||
}
|
||||
get menu() {
|
||||
return this.menus[0] ?? null;
|
||||
}
|
||||
constructor() {
|
||||
super(), this.anchorCorner = M.START_END, this.menuCorner = M.START_START, this.hoverOpenDelay = 400, this.hoverCloseDelay = 400, this.isSubMenu = !0, this.previousOpenTimeout = 0, this.previousCloseTimeout = 0, this.onMouseenter = () => {
|
||||
var e;
|
||||
clearTimeout(this.previousOpenTimeout), clearTimeout(this.previousCloseTimeout), !((e = this.menu) != null && e.open) && (this.hoverOpenDelay ? this.previousOpenTimeout = setTimeout(() => {
|
||||
this.show();
|
||||
}, this.hoverOpenDelay) : this.show());
|
||||
}, this.onMouseleave = () => {
|
||||
clearTimeout(this.previousCloseTimeout), clearTimeout(this.previousOpenTimeout), this.hoverCloseDelay ? this.previousCloseTimeout = setTimeout(() => {
|
||||
this.close();
|
||||
}, this.hoverCloseDelay) : this.close();
|
||||
}, this.addEventListener("mouseenter", this.onMouseenter), this.addEventListener("mouseleave", this.onMouseleave);
|
||||
}
|
||||
render() {
|
||||
return d`
|
||||
<slot
|
||||
name="item"
|
||||
@click=${this.onClick}
|
||||
@keydown=${this.onKeydown}
|
||||
@slotchange=${this.onSlotchange}>
|
||||
</slot>
|
||||
<slot
|
||||
name="menu"
|
||||
@keydown=${this.onSubMenuKeydown}
|
||||
@close-menu=${this.onCloseSubmenu}
|
||||
@slotchange=${this.onSlotchange}>
|
||||
</slot>
|
||||
`;
|
||||
}
|
||||
firstUpdated() {
|
||||
this.onSlotchange();
|
||||
}
|
||||
/**
|
||||
* Shows the submenu.
|
||||
*/
|
||||
async show() {
|
||||
const e = this.menu;
|
||||
if (!e || e.open)
|
||||
return;
|
||||
e.addEventListener("closed", () => {
|
||||
this.item.ariaExpanded = "false", this.dispatchEvent(b()), this.dispatchEvent(p()), e.ariaHidden = "true";
|
||||
}, { once: !0 }), e.positioning === "document" && (e.positioning = "absolute"), e.quick = !0, e.hasOverflow = !0, e.anchorCorner = this.anchorCorner, e.menuCorner = this.menuCorner, e.anchorElement = this.item, e.defaultFocus = "first-item", e.removeAttribute("aria-hidden"), e.skipRestoreFocus = !1;
|
||||
const o = e.open;
|
||||
if (e.show(), this.item.ariaExpanded = "true", this.item.ariaHasPopup = "menu", e.id && this.item.setAttribute("aria-controls", e.id), this.dispatchEvent(p()), this.dispatchEvent(k()), this.item.selected = !0, !o) {
|
||||
let t = (h) => {
|
||||
};
|
||||
const n = new Promise((h) => {
|
||||
t = h;
|
||||
});
|
||||
e.addEventListener("opened", t, { once: !0 }), await n;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Closes the submenu.
|
||||
*/
|
||||
async close() {
|
||||
const e = this.menu;
|
||||
if (!e || !e.open)
|
||||
return;
|
||||
this.dispatchEvent(b()), e.quick = !0, e.close(), this.dispatchEvent(p());
|
||||
let o = (n) => {
|
||||
};
|
||||
const t = new Promise((n) => {
|
||||
o = n;
|
||||
});
|
||||
e.addEventListener("closed", o, { once: !0 }), await t;
|
||||
}
|
||||
onSlotchange() {
|
||||
var o;
|
||||
if (!this.item)
|
||||
return;
|
||||
this.item.ariaExpanded = "false", this.item.ariaHasPopup = "menu", (o = this.menu) != null && o.id && this.item.setAttribute("aria-controls", this.menu.id), this.item.keepOpen = !0;
|
||||
const e = this.menu;
|
||||
e && (e.isSubmenu = !0, e.ariaHidden = "true");
|
||||
}
|
||||
onClick() {
|
||||
this.show();
|
||||
}
|
||||
/**
|
||||
* On item keydown handles opening the submenu.
|
||||
*/
|
||||
async onKeydown(e) {
|
||||
const o = this.isSubmenuOpenKey(e.code);
|
||||
if (e.defaultPrevented)
|
||||
return;
|
||||
const t = o && (l.LEFT === e.code || l.RIGHT === e.code);
|
||||
if ((e.code === g.SPACE || t) && (e.preventDefault(), t && e.stopPropagation()), !o)
|
||||
return;
|
||||
const n = this.menu;
|
||||
if (!n)
|
||||
return;
|
||||
const h = n.items, v = P(h);
|
||||
if (v) {
|
||||
await this.show(), v.tabIndex = 0, v.focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
onCloseSubmenu(e) {
|
||||
const { itemPath: o, reason: t } = e.detail;
|
||||
if (o.push(this.item), this.dispatchEvent(b()), t.kind === O.KEYDOWN && t.key === x.ESCAPE) {
|
||||
e.stopPropagation(), this.item.dispatchEvent(L());
|
||||
return;
|
||||
}
|
||||
this.dispatchEvent(p());
|
||||
}
|
||||
async onSubMenuKeydown(e) {
|
||||
var n;
|
||||
if (e.defaultPrevented)
|
||||
return;
|
||||
const { close: o, keyCode: t } = this.isSubmenuCloseKey(e.code);
|
||||
o && (e.preventDefault(), (t === l.LEFT || t === l.RIGHT) && e.stopPropagation(), await this.close(), N(this.menu.items), (n = this.item) == null || n.focus(), this.item.tabIndex = 0, this.item.focus());
|
||||
}
|
||||
/**
|
||||
* Determines whether the given KeyboardEvent code is one that should open
|
||||
* the submenu. This is RTL-aware. By default, left, right, space, or enter.
|
||||
*
|
||||
* @param code The native KeyboardEvent code.
|
||||
* @return Whether or not the key code should open the submenu.
|
||||
*/
|
||||
isSubmenuOpenKey(e) {
|
||||
const t = getComputedStyle(this).direction === "rtl" ? l.LEFT : l.RIGHT;
|
||||
switch (e) {
|
||||
case t:
|
||||
case g.SPACE:
|
||||
case g.ENTER:
|
||||
return !0;
|
||||
default:
|
||||
return !1;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Determines whether the given KeyboardEvent code is one that should close
|
||||
* the submenu. This is RTL-aware. By default right, left, or escape.
|
||||
*
|
||||
* @param code The native KeyboardEvent code.
|
||||
* @return Whether or not the key code should close the submenu.
|
||||
*/
|
||||
isSubmenuCloseKey(e) {
|
||||
const t = getComputedStyle(this).direction === "rtl" ? l.RIGHT : l.LEFT;
|
||||
switch (e) {
|
||||
case t:
|
||||
case x.ESCAPE:
|
||||
return { close: !0, keyCode: e };
|
||||
default:
|
||||
return { close: !1 };
|
||||
}
|
||||
}
|
||||
};
|
||||
s([
|
||||
r({ attribute: "anchor-corner" })
|
||||
], u.prototype, "anchorCorner", void 0);
|
||||
s([
|
||||
r({ attribute: "menu-corner" })
|
||||
], u.prototype, "menuCorner", void 0);
|
||||
s([
|
||||
r({ type: Number, attribute: "hover-open-delay" })
|
||||
], u.prototype, "hoverOpenDelay", void 0);
|
||||
s([
|
||||
r({ type: Number, attribute: "hover-close-delay" })
|
||||
], u.prototype, "hoverCloseDelay", void 0);
|
||||
s([
|
||||
r({ type: Boolean, reflect: !0, attribute: "md-sub-menu" })
|
||||
], u.prototype, "isSubMenu", void 0);
|
||||
s([
|
||||
f({ slot: "item", flatten: !0 })
|
||||
], u.prototype, "items", void 0);
|
||||
s([
|
||||
f({ slot: "menu", flatten: !0 })
|
||||
], u.prototype, "menus", void 0);
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const q = D`:host{position:relative;display:flex;flex-direction:column}
|
||||
`;
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
let y = class extends u {
|
||||
};
|
||||
y.styles = [q];
|
||||
y = s([
|
||||
w("md-sub-menu")
|
||||
], y);
|
||||
const W = S({
|
||||
react: T,
|
||||
tagName: "md-menu",
|
||||
elementClass: A
|
||||
}), j = S({
|
||||
react: T,
|
||||
tagName: "md-menu-item",
|
||||
elementClass: c,
|
||||
events: {
|
||||
"close-menu": "onCloseMenu"
|
||||
}
|
||||
}), U = S({
|
||||
react: T,
|
||||
tagName: "md-sub-menu",
|
||||
elementClass: y
|
||||
}), le = (a) => /* @__PURE__ */ E(
|
||||
W,
|
||||
{
|
||||
...a
|
||||
}
|
||||
), ue = (a) => /* @__PURE__ */ E(
|
||||
U,
|
||||
{
|
||||
...a
|
||||
}
|
||||
), me = (a) => /* @__PURE__ */ E(j, { ...a });
|
||||
export {
|
||||
le as Menu,
|
||||
me as MenuItem,
|
||||
ue as SubMenu
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,72 @@
|
|||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react/jsx-runtime"),c=require("react"),p=require("./create-component-D9KTUrcf.js"),t=require("./class-map-DV5418hw.js"),y=require("./query-assigned-elements-BYttmtWz.js"),d=require("./item-DvSwYnPq.js");require("./ripple-DoKzzEey.js");const v=require("./animation-A38fZ1oY.js"),a=require("./static-B9XIUGOk.js"),f=require("./delegate-4958lG3m.js");/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const b=new Set(Object.values(d.NavigableKeys));let h=class extends t.r{get items(){return this.listController.items}constructor(){super(),this.listController=new d.ListController({isItem:e=>e.hasAttribute("md-list-item"),getPossibleItems:()=>this.slotItems,isRtl:()=>getComputedStyle(this).direction==="rtl",deactivateItem:e=>{e.tabIndex=-1},activateItem:e=>{e.tabIndex=0},isNavigableKey:e=>b.has(e),isActivatable:e=>!e.disabled&&e.type!=="text"}),this.internals=this.attachInternals(),this.internals.role="list",this.addEventListener("keydown",this.listController.handleKeydown)}render(){return t.x`
|
||||
<slot
|
||||
@deactivate-items=${this.listController.onDeactivateItems}
|
||||
@request-activation=${this.listController.onRequestActivation}
|
||||
@slotchange=${this.listController.onSlotchange}>
|
||||
</slot>
|
||||
`}activateNextItem(){return this.listController.activateNextItem()}activatePreviousItem(){return this.listController.activatePreviousItem()}};t.__decorate([y.o({flatten:!0})],h.prototype,"slotItems",void 0);/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const x=t.i$1`:host{background:var(--md-list-container-color, var(--md-sys-color-surface, #fef7ff));color:unset;display:flex;flex-direction:column;outline:none;padding:8px 0;position:relative}
|
||||
`;/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/let l=class extends h{};l.styles=[x];l=t.__decorate([t.t$1("md-list")],l);/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const $=f.mixinDelegatesAria(t.r);class s extends ${constructor(){super(...arguments),this.disabled=!1,this.type="text",this.isListItem=!0,this.href="",this.target=""}get isDisabled(){return this.disabled&&this.type!=="link"}willUpdate(e){this.href&&(this.type="link"),super.willUpdate(e)}render(){return this.renderListItem(t.x`
|
||||
<md-item>
|
||||
<div slot="container">
|
||||
${this.renderRipple()} ${this.renderFocusRing()}
|
||||
</div>
|
||||
<slot name="start" slot="start"></slot>
|
||||
<slot name="end" slot="end"></slot>
|
||||
${this.renderBody()}
|
||||
</md-item>
|
||||
`)}renderListItem(e){const o=this.type==="link";let r;switch(this.type){case"link":r=a.i`a`;break;case"button":r=a.i`button`;break;default:case"text":r=a.i`li`;break}const u=this.type!=="text",g=o&&this.target?this.target:t.E;return a.u`
|
||||
<${r}
|
||||
id="item"
|
||||
tabindex="${this.isDisabled||!u?-1:0}"
|
||||
?disabled=${this.isDisabled}
|
||||
role="listitem"
|
||||
aria-selected=${this.ariaSelected||t.E}
|
||||
aria-checked=${this.ariaChecked||t.E}
|
||||
aria-expanded=${this.ariaExpanded||t.E}
|
||||
aria-haspopup=${this.ariaHasPopup||t.E}
|
||||
class="list-item ${t.e$1(this.getRenderClasses())}"
|
||||
href=${this.href||t.E}
|
||||
target=${g}
|
||||
@focus=${this.onFocus}
|
||||
>${e}</${r}>
|
||||
`}renderRipple(){return this.type==="text"?t.E:t.x` <md-ripple
|
||||
part="ripple"
|
||||
for="item"
|
||||
?disabled=${this.isDisabled}></md-ripple>`}renderFocusRing(){return this.type==="text"?t.E:t.x` <md-focus-ring
|
||||
@visibility-changed=${this.onFocusRingVisibilityChanged}
|
||||
part="focus-ring"
|
||||
for="item"
|
||||
inward></md-focus-ring>`}onFocusRingVisibilityChanged(e){}getRenderClasses(){return{disabled:this.isDisabled}}renderBody(){return t.x`
|
||||
<slot></slot>
|
||||
<slot name="overline" slot="overline"></slot>
|
||||
<slot name="headline" slot="headline"></slot>
|
||||
<slot name="supporting-text" slot="supporting-text"></slot>
|
||||
<slot
|
||||
name="trailing-supporting-text"
|
||||
slot="trailing-supporting-text"></slot>
|
||||
`}onFocus(){this.tabIndex===-1&&this.dispatchEvent(d.createRequestActivationEvent())}focus(){var e;(e=this.listItemRoot)==null||e.focus()}}s.shadowRootOptions={...t.r.shadowRootOptions,delegatesFocus:!0};t.__decorate([t.n({type:Boolean,reflect:!0})],s.prototype,"disabled",void 0);t.__decorate([t.n({reflect:!0})],s.prototype,"type",void 0);t.__decorate([t.n({type:Boolean,attribute:"md-list-item",reflect:!0})],s.prototype,"isListItem",void 0);t.__decorate([t.n()],s.prototype,"href",void 0);t.__decorate([t.n()],s.prototype,"target",void 0);t.__decorate([v.e$1(".list-item")],s.prototype,"listItemRoot",void 0);/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const I=t.i$1`:host{display:flex;-webkit-tap-highlight-color:rgba(0,0,0,0);--md-ripple-hover-color: var(--md-list-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-list-item-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-list-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-list-item-pressed-state-layer-opacity, 0.12)}:host(:is([type=button]:not([disabled]),[type=link])){cursor:pointer}md-focus-ring{z-index:1;--md-focus-ring-shape: 8px}a,button,li{background:none;border:none;cursor:inherit;padding:0;margin:0;text-align:unset;text-decoration:none}.list-item{border-radius:inherit;display:flex;flex:1;max-width:inherit;min-width:inherit;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0);width:100%}.list-item.interactive{cursor:pointer}.list-item.disabled{opacity:var(--md-list-item-disabled-opacity, 0.3);pointer-events:none}[slot=container]{pointer-events:none}md-ripple{border-radius:inherit}md-item{border-radius:inherit;flex:1;height:100%;color:var(--md-list-item-label-text-color, var(--md-sys-color-on-surface, #1d1b20));font-family:var(--md-list-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));line-height:var(--md-list-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));font-weight:var(--md-list-item-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));min-height:var(--md-list-item-one-line-container-height, 56px);padding-top:var(--md-list-item-top-space, 12px);padding-bottom:var(--md-list-item-bottom-space, 12px);padding-inline-start:var(--md-list-item-leading-space, 16px);padding-inline-end:var(--md-list-item-trailing-space, 16px)}md-item[multiline]{min-height:var(--md-list-item-two-line-container-height, 72px)}[slot=supporting-text]{color:var(--md-list-item-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-list-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-list-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-list-item-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)))}[slot=trailing-supporting-text]{color:var(--md-list-item-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-list-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, 0.6875rem));line-height:var(--md-list-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));font-weight:var(--md-list-item-trailing-supporting-text-weight, var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500)))}:is([slot=start],[slot=end])::slotted(*){fill:currentColor}[slot=start]{color:var(--md-list-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}[slot=end]{color:var(--md-list-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}@media(forced-colors: active){.disabled slot{color:GrayText}.list-item.disabled{color:GrayText;opacity:1}}
|
||||
`;/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/let n=class extends s{};n.styles=[I];n=t.__decorate([t.t$1("md-list-item")],n);const w=p.o({react:c,tagName:"md-list",elementClass:l}),_=i=>{const{children:e,...o}=i;return m.jsx(w,{...o,children:e})},C=p.o({react:c,tagName:"md-list-item",elementClass:n}),L=i=>{const{children:e,...o}=i,r=i.type||"text";return m.jsx(C,{...o,type:r,children:e})};exports.List=_;exports.ListItem=L;
|
||||
|
|
@ -0,0 +1,260 @@
|
|||
import { jsx as h } from "react/jsx-runtime";
|
||||
import g from "react";
|
||||
import { o as u } from "./create-component-CVXl33PD.mjs";
|
||||
import { _ as e, r as c, x as l, a as y, b as v, n, E as s, c as I } from "./class-map-CwiboTfb.mjs";
|
||||
import { o as w } from "./query-assigned-elements-DUhez03i.mjs";
|
||||
import { N as $, L as C, a as L } from "./item-CpL4zUlE.mjs";
|
||||
import "./ripple-pQcEjR05.mjs";
|
||||
import { a as R } from "./animation-DjClVFum.mjs";
|
||||
import { i as p, u as k } from "./static-DdXEOlS4.mjs";
|
||||
import { m as z } from "./delegate-BXi1gVeU.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const E = new Set(Object.values($));
|
||||
let f = class extends c {
|
||||
/** @export */
|
||||
get items() {
|
||||
return this.listController.items;
|
||||
}
|
||||
constructor() {
|
||||
super(), this.listController = new C({
|
||||
isItem: (t) => t.hasAttribute("md-list-item"),
|
||||
getPossibleItems: () => this.slotItems,
|
||||
isRtl: () => getComputedStyle(this).direction === "rtl",
|
||||
deactivateItem: (t) => {
|
||||
t.tabIndex = -1;
|
||||
},
|
||||
activateItem: (t) => {
|
||||
t.tabIndex = 0;
|
||||
},
|
||||
isNavigableKey: (t) => E.has(t),
|
||||
isActivatable: (t) => !t.disabled && t.type !== "text"
|
||||
}), this.internals = // Cast needed for closure
|
||||
this.attachInternals(), this.internals.role = "list", this.addEventListener("keydown", this.listController.handleKeydown);
|
||||
}
|
||||
render() {
|
||||
return l`
|
||||
<slot
|
||||
@deactivate-items=${this.listController.onDeactivateItems}
|
||||
@request-activation=${this.listController.onRequestActivation}
|
||||
@slotchange=${this.listController.onSlotchange}>
|
||||
</slot>
|
||||
`;
|
||||
}
|
||||
/**
|
||||
* Activates the next item in the list. If at the end of the list, the first
|
||||
* item will be activated.
|
||||
*
|
||||
* @return The activated list item or `null` if there are no items.
|
||||
*/
|
||||
activateNextItem() {
|
||||
return this.listController.activateNextItem();
|
||||
}
|
||||
/**
|
||||
* Activates the previous item in the list. If at the start of the list, the
|
||||
* last item will be activated.
|
||||
*
|
||||
* @return The activated list item or `null` if there are no items.
|
||||
*/
|
||||
activatePreviousItem() {
|
||||
return this.listController.activatePreviousItem();
|
||||
}
|
||||
};
|
||||
e([
|
||||
w({ flatten: !0 })
|
||||
], f.prototype, "slotItems", void 0);
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const A = y`:host{background:var(--md-list-container-color, var(--md-sys-color-surface, #fef7ff));color:unset;display:flex;flex-direction:column;outline:none;padding:8px 0;position:relative}
|
||||
`;
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
let d = class extends f {
|
||||
};
|
||||
d.styles = [A];
|
||||
d = e([
|
||||
v("md-list")
|
||||
], d);
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const N = z(c);
|
||||
class r extends N {
|
||||
constructor() {
|
||||
super(...arguments), this.disabled = !1, this.type = "text", this.isListItem = !0, this.href = "", this.target = "";
|
||||
}
|
||||
get isDisabled() {
|
||||
return this.disabled && this.type !== "link";
|
||||
}
|
||||
willUpdate(t) {
|
||||
this.href && (this.type = "link"), super.willUpdate(t);
|
||||
}
|
||||
render() {
|
||||
return this.renderListItem(l`
|
||||
<md-item>
|
||||
<div slot="container">
|
||||
${this.renderRipple()} ${this.renderFocusRing()}
|
||||
</div>
|
||||
<slot name="start" slot="start"></slot>
|
||||
<slot name="end" slot="end"></slot>
|
||||
${this.renderBody()}
|
||||
</md-item>
|
||||
`);
|
||||
}
|
||||
/**
|
||||
* Renders the root list item.
|
||||
*
|
||||
* @param content the child content of the list item.
|
||||
*/
|
||||
renderListItem(t) {
|
||||
const a = this.type === "link";
|
||||
let o;
|
||||
switch (this.type) {
|
||||
case "link":
|
||||
o = p`a`;
|
||||
break;
|
||||
case "button":
|
||||
o = p`button`;
|
||||
break;
|
||||
default:
|
||||
case "text":
|
||||
o = p`li`;
|
||||
break;
|
||||
}
|
||||
const b = this.type !== "text", x = a && this.target ? this.target : s;
|
||||
return k`
|
||||
<${o}
|
||||
id="item"
|
||||
tabindex="${this.isDisabled || !b ? -1 : 0}"
|
||||
?disabled=${this.isDisabled}
|
||||
role="listitem"
|
||||
aria-selected=${this.ariaSelected || s}
|
||||
aria-checked=${this.ariaChecked || s}
|
||||
aria-expanded=${this.ariaExpanded || s}
|
||||
aria-haspopup=${this.ariaHasPopup || s}
|
||||
class="list-item ${I(this.getRenderClasses())}"
|
||||
href=${this.href || s}
|
||||
target=${x}
|
||||
@focus=${this.onFocus}
|
||||
>${t}</${o}>
|
||||
`;
|
||||
}
|
||||
/**
|
||||
* Handles rendering of the ripple element.
|
||||
*/
|
||||
renderRipple() {
|
||||
return this.type === "text" ? s : l` <md-ripple
|
||||
part="ripple"
|
||||
for="item"
|
||||
?disabled=${this.isDisabled}></md-ripple>`;
|
||||
}
|
||||
/**
|
||||
* Handles rendering of the focus ring.
|
||||
*/
|
||||
renderFocusRing() {
|
||||
return this.type === "text" ? s : l` <md-focus-ring
|
||||
@visibility-changed=${this.onFocusRingVisibilityChanged}
|
||||
part="focus-ring"
|
||||
for="item"
|
||||
inward></md-focus-ring>`;
|
||||
}
|
||||
onFocusRingVisibilityChanged(t) {
|
||||
}
|
||||
/**
|
||||
* Classes applied to the list item root.
|
||||
*/
|
||||
getRenderClasses() {
|
||||
return { disabled: this.isDisabled };
|
||||
}
|
||||
/**
|
||||
* Handles rendering the headline and supporting text.
|
||||
*/
|
||||
renderBody() {
|
||||
return l`
|
||||
<slot></slot>
|
||||
<slot name="overline" slot="overline"></slot>
|
||||
<slot name="headline" slot="headline"></slot>
|
||||
<slot name="supporting-text" slot="supporting-text"></slot>
|
||||
<slot
|
||||
name="trailing-supporting-text"
|
||||
slot="trailing-supporting-text"></slot>
|
||||
`;
|
||||
}
|
||||
onFocus() {
|
||||
this.tabIndex === -1 && this.dispatchEvent(L());
|
||||
}
|
||||
focus() {
|
||||
var t;
|
||||
(t = this.listItemRoot) == null || t.focus();
|
||||
}
|
||||
}
|
||||
r.shadowRootOptions = {
|
||||
...c.shadowRootOptions,
|
||||
delegatesFocus: !0
|
||||
};
|
||||
e([
|
||||
n({ type: Boolean, reflect: !0 })
|
||||
], r.prototype, "disabled", void 0);
|
||||
e([
|
||||
n({ reflect: !0 })
|
||||
], r.prototype, "type", void 0);
|
||||
e([
|
||||
n({ type: Boolean, attribute: "md-list-item", reflect: !0 })
|
||||
], r.prototype, "isListItem", void 0);
|
||||
e([
|
||||
n()
|
||||
], r.prototype, "href", void 0);
|
||||
e([
|
||||
n()
|
||||
], r.prototype, "target", void 0);
|
||||
e([
|
||||
R(".list-item")
|
||||
], r.prototype, "listItemRoot", void 0);
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const D = y`:host{display:flex;-webkit-tap-highlight-color:rgba(0,0,0,0);--md-ripple-hover-color: var(--md-list-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-list-item-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-list-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-list-item-pressed-state-layer-opacity, 0.12)}:host(:is([type=button]:not([disabled]),[type=link])){cursor:pointer}md-focus-ring{z-index:1;--md-focus-ring-shape: 8px}a,button,li{background:none;border:none;cursor:inherit;padding:0;margin:0;text-align:unset;text-decoration:none}.list-item{border-radius:inherit;display:flex;flex:1;max-width:inherit;min-width:inherit;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0);width:100%}.list-item.interactive{cursor:pointer}.list-item.disabled{opacity:var(--md-list-item-disabled-opacity, 0.3);pointer-events:none}[slot=container]{pointer-events:none}md-ripple{border-radius:inherit}md-item{border-radius:inherit;flex:1;height:100%;color:var(--md-list-item-label-text-color, var(--md-sys-color-on-surface, #1d1b20));font-family:var(--md-list-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));line-height:var(--md-list-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));font-weight:var(--md-list-item-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));min-height:var(--md-list-item-one-line-container-height, 56px);padding-top:var(--md-list-item-top-space, 12px);padding-bottom:var(--md-list-item-bottom-space, 12px);padding-inline-start:var(--md-list-item-leading-space, 16px);padding-inline-end:var(--md-list-item-trailing-space, 16px)}md-item[multiline]{min-height:var(--md-list-item-two-line-container-height, 72px)}[slot=supporting-text]{color:var(--md-list-item-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-list-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-list-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-list-item-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)))}[slot=trailing-supporting-text]{color:var(--md-list-item-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-list-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, 0.6875rem));line-height:var(--md-list-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));font-weight:var(--md-list-item-trailing-supporting-text-weight, var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500)))}:is([slot=start],[slot=end])::slotted(*){fill:currentColor}[slot=start]{color:var(--md-list-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}[slot=end]{color:var(--md-list-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}@media(forced-colors: active){.disabled slot{color:GrayText}.list-item.disabled{color:GrayText;opacity:1}}
|
||||
`;
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
let m = class extends r {
|
||||
};
|
||||
m.styles = [D];
|
||||
m = e([
|
||||
v("md-list-item")
|
||||
], m);
|
||||
const F = u({
|
||||
react: g,
|
||||
tagName: "md-list",
|
||||
elementClass: d
|
||||
}), Y = (i) => {
|
||||
const { children: t, ...a } = i;
|
||||
return /* @__PURE__ */ h(F, { ...a, children: t });
|
||||
}, _ = u({
|
||||
react: g,
|
||||
tagName: "md-list-item",
|
||||
elementClass: m
|
||||
}), J = (i) => {
|
||||
const { children: t, ...a } = i, o = i.type || "text";
|
||||
return /* @__PURE__ */ h(_, { ...a, type: o, children: t });
|
||||
};
|
||||
export {
|
||||
Y as List,
|
||||
J as ListItem
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,71 @@
|
|||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),g=require("react"),T=require("./create-component-D9KTUrcf.js"),t=require("./class-map-DV5418hw.js");require("./divider-B6Y1F7cS.js");const b=require("./animation-A38fZ1oY.js"),C=require("./query-assigned-elements-BYttmtWz.js");require("./elevation-CqmyG_RP.js");require("./ripple-DoKzzEey.js");const z=require("./query-assigned-nodes-Dl8k4w_-.js"),M=require("./focusable-D3uHX6nn.js");/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/var I;const y=Symbol("indicator"),E=Symbol("animateIndicator"),N=M.mixinFocusable(t.r);let l=class extends N{get selected(){return this.active}set selected(e){this.active=e}constructor(){super(),this.isTab=!0,this.active=!1,this.hasIcon=!1,this.iconOnly=!1,this.fullWidthIndicator=!1,this.internals=this.attachInternals(),this.internals.role="tab",this.addEventListener("keydown",this.handleKeydown.bind(this))}render(){const e=t.x`<div class="indicator"></div>`;return t.x`<div
|
||||
class="button"
|
||||
role="presentation"
|
||||
@click=${this.handleContentClick}>
|
||||
<md-focus-ring part="focus-ring" inward .control=${this}></md-focus-ring>
|
||||
<md-elevation part="elevation"></md-elevation>
|
||||
<md-ripple .control=${this}></md-ripple>
|
||||
<div
|
||||
class="content ${t.e$1(this.getContentClasses())}"
|
||||
role="presentation">
|
||||
<slot name="icon" @slotchange=${this.handleIconSlotChange}></slot>
|
||||
<slot @slotchange=${this.handleSlotChange}></slot>
|
||||
${this.fullWidthIndicator?t.E:e}
|
||||
</div>
|
||||
${this.fullWidthIndicator?e:t.E}
|
||||
</div>`}getContentClasses(){return{"has-icon":this.hasIcon,"has-label":!this.iconOnly}}updated(){this.internals.ariaSelected=String(this.active)}async handleKeydown(e){await 0,!e.defaultPrevented&&(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.click())}handleContentClick(e){e.stopPropagation(),this.click()}[(I=y,E)](e){if(!this[y])return;this[y].getAnimations().forEach(o=>{o.cancel()});const a=this.getKeyframes(e);a!==null&&this[y].animate(a,{duration:250,easing:b.EASING.EMPHASIZED})}getKeyframes(e){var h;const a=S();if(!this.active)return a?[{opacity:1},{transform:"none"}]:null;const o={},s=((h=e[y])==null?void 0:h.getBoundingClientRect())??{},i=s.left,c=s.width,r=this[y].getBoundingClientRect(),d=r.left,p=r.width,v=c/p;return!a&&i!==void 0&&d!==void 0&&!isNaN(v)?o.transform=`translateX(${(i-d).toFixed(4)}px) scaleX(${v.toFixed(4)})`:o.opacity=0,[o,{transform:"none"}]}handleSlotChange(){this.iconOnly=!1;for(const e of this.assignedDefaultNodes){const a=e.nodeType===Node.TEXT_NODE&&!!e.wholeText.match(/\S/);if(e.nodeType===Node.ELEMENT_NODE||a)return}this.iconOnly=!0}handleIconSlotChange(){this.hasIcon=this.assignedIcons.length>0}};t.__decorate([t.n({type:Boolean,reflect:!0,attribute:"md-tab"})],l.prototype,"isTab",void 0);t.__decorate([t.n({type:Boolean,reflect:!0})],l.prototype,"active",void 0);t.__decorate([t.n({type:Boolean})],l.prototype,"selected",null);t.__decorate([t.n({type:Boolean,attribute:"has-icon"})],l.prototype,"hasIcon",void 0);t.__decorate([t.n({type:Boolean,attribute:"icon-only"})],l.prototype,"iconOnly",void 0);t.__decorate([b.e$1(".indicator")],l.prototype,I,void 0);t.__decorate([b.r()],l.prototype,"fullWidthIndicator",void 0);t.__decorate([z.n({flatten:!0})],l.prototype,"assignedDefaultNodes",void 0);t.__decorate([C.o({slot:"icon",flatten:!0})],l.prototype,"assignedIcons",void 0);function S(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/let m=class extends t.r{get activeTab(){return this.tabs.find(e=>e.active)??null}set activeTab(e){e&&this.activateTab(e)}get activeTabIndex(){return this.tabs.findIndex(e=>e.active)}set activeTabIndex(e){const a=()=>{const o=this.tabs[e];o&&this.activateTab(o)};if(!this.slotElement){this.updateComplete.then(a);return}a()}get focusedTab(){return this.tabs.find(e=>e.matches(":focus-within"))}constructor(){super(),this.autoActivate=!1,this.internals=this.attachInternals(),this.internals.role="tablist",this.addEventListener("keydown",this.handleKeydown.bind(this)),this.addEventListener("keyup",this.handleKeyup.bind(this)),this.addEventListener("focusout",this.handleFocusout.bind(this))}async scrollToTab(e){await this.updateComplete;const{tabs:a}=this;if(e??(e=this.activeTab),!e||!a.includes(e)||!this.tabsScrollerElement)return;for(const u of this.tabs)await u.updateComplete;const o=e.offsetLeft,s=e.offsetWidth,i=this.scrollLeft,c=this.offsetWidth,r=48,d=o-r,p=o+s-c+r,v=Math.min(d,Math.max(p,i)),h=this.focusedTab?"auto":"instant";this.tabsScrollerElement.scrollTo({behavior:h,top:0,left:v})}render(){return t.x`
|
||||
<div class="tabs">
|
||||
<slot
|
||||
@slotchange=${this.handleSlotChange}
|
||||
@click=${this.handleTabClick}></slot>
|
||||
</div>
|
||||
<md-divider part="divider"></md-divider>
|
||||
`}async handleTabClick(e){const a=e.target;await 0,!(e.defaultPrevented||!A(a)||a.active)&&this.activateTab(a)}activateTab(e){const{tabs:a}=this,o=this.activeTab;if(!(!a.includes(e)||o===e)){for(const s of a)s.active=s===e;if(o){if(!this.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))){for(const i of a)i.active=i===o;return}e[E](o)}this.updateFocusableTab(e),this.scrollToTab(e)}}updateFocusableTab(e){for(const a of this.tabs)a.tabIndex=a===e?0:-1}async handleKeydown(e){await 0;const a=e.key==="ArrowLeft",o=e.key==="ArrowRight",s=e.key==="Home",i=e.key==="End";if(e.defaultPrevented||!a&&!o&&!s&&!i)return;const{tabs:c}=this;if(c.length<2)return;e.preventDefault();let r;if(s||i)r=s?0:c.length-1;else{const v=getComputedStyle(this).direction==="rtl"?a:o,{focusedTab:h}=this;if(!h)r=v?0:c.length-1;else{const u=this.tabs.indexOf(h);r=v?u+1:u-1,r>=c.length?r=0:r<0&&(r=c.length-1)}}const d=c[r];d.focus(),this.autoActivate?this.activateTab(d):this.updateFocusableTab(d)}handleKeyup(){this.scrollToTab(this.focusedTab??this.activeTab)}handleFocusout(){if(this.matches(":focus-within"))return;const{activeTab:e}=this;e&&this.updateFocusableTab(e)}handleSlotChange(){const e=this.tabs[0];!this.activeTab&&e&&this.activateTab(e),this.scrollToTab(this.activeTab)}};t.__decorate([C.o({flatten:!0,selector:"[md-tab]"})],m.prototype,"tabs",void 0);t.__decorate([t.n({type:Number,attribute:"active-tab-index"})],m.prototype,"activeTabIndex",null);t.__decorate([t.n({type:Boolean,attribute:"auto-activate"})],m.prototype,"autoActivate",void 0);t.__decorate([b.e$1(".tabs")],m.prototype,"tabsScrollerElement",void 0);t.__decorate([b.e$1("slot")],m.prototype,"slotElement",void 0);function A(n){return n instanceof HTMLElement&&n.hasAttribute("md-tab")}/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const P=t.i$1`:host{box-sizing:border-box;display:flex;flex-direction:column;overflow:auto;scroll-behavior:smooth;scrollbar-width:none;position:relative}:host([hidden]){display:none}:host::-webkit-scrollbar{display:none}.tabs{align-items:end;display:flex;height:100%;overflow:inherit;scroll-behavior:inherit;scrollbar-width:inherit;justify-content:space-between;width:100%}::slotted(*){flex:1}::slotted([active]){z-index:1}
|
||||
`;/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/let f=class extends m{};f.styles=[P];f=t.__decorate([t.t$1("md-tabs")],f);/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/class $ extends l{constructor(){super(...arguments),this.inlineIcon=!1}getContentClasses(){return{...super.getContentClasses(),stacked:!this.inlineIcon}}}t.__decorate([t.n({type:Boolean,attribute:"inline-icon"})],$.prototype,"inlineIcon",void 0);/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const R=t.i$1`:host{--_active-indicator-color: var(--md-primary-tab-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_active-indicator-height: var(--md-primary-tab-active-indicator-height, 3px);--_active-indicator-shape: var(--md-primary-tab-active-indicator-shape, 3px 3px 0px 0px);--_active-hover-state-layer-color: var(--md-primary-tab-active-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_active-hover-state-layer-opacity: var(--md-primary-tab-active-hover-state-layer-opacity, 0.08);--_active-pressed-state-layer-color: var(--md-primary-tab-active-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_active-pressed-state-layer-opacity: var(--md-primary-tab-active-pressed-state-layer-opacity, 0.12);--_container-color: var(--md-primary-tab-container-color, var(--md-sys-color-surface, #fef7ff));--_container-elevation: var(--md-primary-tab-container-elevation, 0);--_container-height: var(--md-primary-tab-container-height, 48px);--_with-icon-and-label-text-container-height: var(--md-primary-tab-with-icon-and-label-text-container-height, 64px);--_hover-state-layer-color: var(--md-primary-tab-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-primary-tab-hover-state-layer-opacity, 0.08);--_pressed-state-layer-color: var(--md-primary-tab-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-primary-tab-pressed-state-layer-opacity, 0.12);--_active-focus-icon-color: var(--md-primary-tab-active-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_active-hover-icon-color: var(--md-primary-tab-active-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_active-icon-color: var(--md-primary-tab-active-icon-color, var(--md-sys-color-primary, #6750a4));--_active-pressed-icon-color: var(--md-primary-tab-active-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-size: var(--md-primary-tab-icon-size, 24px);--_focus-icon-color: var(--md-primary-tab-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-icon-color: var(--md-primary-tab-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_icon-color: var(--md-primary-tab-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-icon-color: var(--md-primary-tab-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-font: var(--md-primary-tab-label-text-font, var(--md-sys-typescale-title-small-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-primary-tab-label-text-line-height, var(--md-sys-typescale-title-small-line-height, 1.25rem));--_label-text-size: var(--md-primary-tab-label-text-size, var(--md-sys-typescale-title-small-size, 0.875rem));--_label-text-weight: var(--md-primary-tab-label-text-weight, var(--md-sys-typescale-title-small-weight, var(--md-ref-typeface-weight-medium, 500)));--_active-focus-label-text-color: var(--md-primary-tab-active-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_active-hover-label-text-color: var(--md-primary-tab-active-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_active-label-text-color: var(--md-primary-tab-active-label-text-color, var(--md-sys-color-primary, #6750a4));--_active-pressed-label-text-color: var(--md-primary-tab-active-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-label-text-color: var(--md-primary-tab-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-primary-tab-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-color: var(--md-primary-tab-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-label-text-color: var(--md-primary-tab-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_container-shape-start-start: var(--md-primary-tab-container-shape-start-start, var(--md-primary-tab-container-shape, var(--md-sys-shape-corner-none, 0px)));--_container-shape-start-end: var(--md-primary-tab-container-shape-start-end, var(--md-primary-tab-container-shape, var(--md-sys-shape-corner-none, 0px)));--_container-shape-end-end: var(--md-primary-tab-container-shape-end-end, var(--md-primary-tab-container-shape, var(--md-sys-shape-corner-none, 0px)));--_container-shape-end-start: var(--md-primary-tab-container-shape-end-start, var(--md-primary-tab-container-shape, var(--md-sys-shape-corner-none, 0px)))}.content.stacked{flex-direction:column;gap:2px}.content.stacked.has-icon.has-label{height:var(--_with-icon-and-label-text-container-height)}
|
||||
`;/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const k=t.i$1`:host{display:inline-flex;align-items:center;justify-content:center;outline:none;padding:0 16px;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0);vertical-align:middle;user-select:none;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);color:var(--_label-text-color);z-index:0;--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity);--md-elevation-level: var(--_container-elevation)}md-focus-ring{--md-focus-ring-shape: 8px}:host([active]) md-focus-ring{margin-bottom:calc(var(--_active-indicator-height) + 1px)}.button::before{background:var(--_container-color);content:"";inset:0;position:absolute;z-index:-1}.button::before,md-ripple,md-elevation{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start)}.content{position:relative;box-sizing:border-box;display:inline-flex;flex-direction:row;align-items:center;justify-content:center;height:var(--_container-height);gap:8px}.indicator{position:absolute;box-sizing:border-box;z-index:-1;transform-origin:bottom left;background:var(--_active-indicator-color);border-radius:var(--_active-indicator-shape);height:var(--_active-indicator-height);inset:auto 0 0 0;opacity:0}::slotted([slot=icon]){display:inline-flex;position:relative;writing-mode:horizontal-tb;fill:currentColor;color:var(--_icon-color);font-size:var(--_icon-size);width:var(--_icon-size);height:var(--_icon-size)}:host(:hover){color:var(--_hover-label-text-color);cursor:pointer}:host(:hover) ::slotted([slot=icon]){color:var(--_hover-icon-color)}:host(:focus){color:var(--_focus-label-text-color)}:host(:focus) ::slotted([slot=icon]){color:var(--_focus-icon-color)}:host(:active){color:var(--_pressed-label-text-color)}:host(:active) ::slotted([slot=icon]){color:var(--_pressed-icon-color)}:host([active]) .indicator{opacity:1}:host([active]){color:var(--_active-label-text-color);--md-ripple-hover-color: var(--_active-hover-state-layer-color);--md-ripple-hover-opacity: var(--_active-hover-state-layer-opacity);--md-ripple-pressed-color: var(--_active-pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_active-pressed-state-layer-opacity)}:host([active]) ::slotted([slot=icon]){color:var(--_active-icon-color)}:host([active]:hover){color:var(--_active-hover-label-text-color)}:host([active]:hover) ::slotted([slot=icon]){color:var(--_active-hover-icon-color)}:host([active]:focus){color:var(--_active-focus-label-text-color)}:host([active]:focus) ::slotted([slot=icon]){color:var(--_active-focus-icon-color)}:host([active]:active){color:var(--_active-pressed-label-text-color)}:host([active]:active) ::slotted([slot=icon]){color:var(--_active-pressed-icon-color)}:host,::slotted(*){white-space:nowrap}@media(forced-colors: active){.indicator{background:CanvasText}}
|
||||
`;/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/let _=class extends ${};_.styles=[k,R];_=t.__decorate([t.t$1("md-primary-tab")],_);/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/class q extends l{constructor(){super(...arguments),this.fullWidthIndicator=!0}}/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const F=t.i$1`:host{--_active-indicator-color: var(--md-secondary-tab-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_active-indicator-height: var(--md-secondary-tab-active-indicator-height, 2px);--_active-label-text-color: var(--md-secondary-tab-active-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_container-color: var(--md-secondary-tab-container-color, var(--md-sys-color-surface, #fef7ff));--_container-elevation: var(--md-secondary-tab-container-elevation, 0);--_container-height: var(--md-secondary-tab-container-height, 48px);--_focus-label-text-color: var(--md-secondary-tab-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-secondary-tab-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-color: var(--md-secondary-tab-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-secondary-tab-hover-state-layer-opacity, 0.08);--_label-text-font: var(--md-secondary-tab-label-text-font, var(--md-sys-typescale-title-small-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-secondary-tab-label-text-line-height, var(--md-sys-typescale-title-small-line-height, 1.25rem));--_label-text-size: var(--md-secondary-tab-label-text-size, var(--md-sys-typescale-title-small-size, 0.875rem));--_label-text-weight: var(--md-secondary-tab-label-text-weight, var(--md-sys-typescale-title-small-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-label-text-color: var(--md-secondary-tab-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-state-layer-color: var(--md-secondary-tab-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-state-layer-opacity: var(--md-secondary-tab-pressed-state-layer-opacity, 0.12);--_active-focus-icon-color: var(--md-secondary-tab-active-focus-icon-color, );--_active-focus-label-text-color: var(--md-secondary-tab-active-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-hover-icon-color: var(--md-secondary-tab-active-hover-icon-color, );--_active-hover-label-text-color: var(--md-secondary-tab-active-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-hover-state-layer-color: var(--md-secondary-tab-active-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_active-hover-state-layer-opacity: var(--md-secondary-tab-active-hover-state-layer-opacity, 0.08);--_active-icon-color: var(--md-secondary-tab-active-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_active-indicator-shape: var(--md-secondary-tab-active-indicator-shape, 0);--_active-pressed-icon-color: var(--md-secondary-tab-active-pressed-icon-color, );--_active-pressed-label-text-color: var(--md-secondary-tab-active-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-pressed-state-layer-color: var(--md-secondary-tab-active-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_active-pressed-state-layer-opacity: var(--md-secondary-tab-active-pressed-state-layer-opacity, 0.12);--_label-text-color: var(--md-secondary-tab-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-icon-color: var(--md-secondary-tab-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-icon-color: var(--md-secondary-tab-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_icon-size: var(--md-secondary-tab-icon-size, 24px);--_icon-color: var(--md-secondary-tab-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-icon-color: var(--md-secondary-tab-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_container-shape-start-start: var(--md-secondary-tab-container-shape-start-start, var(--md-secondary-tab-container-shape, var(--md-sys-shape-corner-none, 0px)));--_container-shape-start-end: var(--md-secondary-tab-container-shape-start-end, var(--md-secondary-tab-container-shape, var(--md-sys-shape-corner-none, 0px)));--_container-shape-end-end: var(--md-secondary-tab-container-shape-end-end, var(--md-secondary-tab-container-shape, var(--md-sys-shape-corner-none, 0px)));--_container-shape-end-start: var(--md-secondary-tab-container-shape-end-start, var(--md-secondary-tab-container-shape, var(--md-sys-shape-corner-none, 0px)))}
|
||||
`;/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/let x=class extends q{};x.styles=[k,F];x=t.__decorate([t.t$1("md-secondary-tab")],x);const O=T.o({react:g,tagName:"md-tabs",elementClass:f}),B=T.o({react:g,tagName:"md-primary-tab",elementClass:_}),L=T.o({react:g,tagName:"md-secondary-tab",elementClass:x}),D=n=>{const{children:e,className:a,style:o,id:s,activeTabIndex:i,onChange:c,...r}=n;return w.jsx(O,{className:a,style:o,id:s,activeTabIndex:i,onChange:c,...r,children:e})},K=n=>{const{children:e,className:a,style:o,id:s,selected:i,variant:c="primary",onClick:r,...d}=n,p=c==="primary"?B:L;return w.jsx(p,{className:a,style:o,id:s,selected:i,onClick:r,...d,children:e})};exports.Tab=K;exports.Tabs=D;
|
||||
|
|
@ -0,0 +1,395 @@
|
|||
import { jsx as z } from "react/jsx-runtime";
|
||||
import w from "react";
|
||||
import { o as C } from "./create-component-CVXl33PD.mjs";
|
||||
import { _ as r, n as v, r as $, x as T, c as R, E as k, a as g, b as I } from "./class-map-CwiboTfb.mjs";
|
||||
import "./divider-Diu_1O5h.mjs";
|
||||
import { r as F, a as E, E as B } from "./animation-DjClVFum.mjs";
|
||||
import { o as M } from "./query-assigned-elements-DUhez03i.mjs";
|
||||
import "./elevation-Dg8ssDJC.mjs";
|
||||
import "./ripple-pQcEjR05.mjs";
|
||||
import { n as L } from "./query-assigned-nodes-MKI2zKDb.mjs";
|
||||
import { m as O } from "./focusable-CDJoU7XD.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
var N;
|
||||
const m = Symbol("indicator"), S = Symbol("animateIndicator"), D = O($);
|
||||
let l = class extends D {
|
||||
/**
|
||||
* @deprecated use `active`
|
||||
*/
|
||||
get selected() {
|
||||
return this.active;
|
||||
}
|
||||
set selected(t) {
|
||||
this.active = t;
|
||||
}
|
||||
constructor() {
|
||||
super(), this.isTab = !0, this.active = !1, this.hasIcon = !1, this.iconOnly = !1, this.fullWidthIndicator = !1, this.internals = // Cast needed for closure
|
||||
this.attachInternals(), this.internals.role = "tab", this.addEventListener("keydown", this.handleKeydown.bind(this));
|
||||
}
|
||||
render() {
|
||||
const t = T`<div class="indicator"></div>`;
|
||||
return T`<div
|
||||
class="button"
|
||||
role="presentation"
|
||||
@click=${this.handleContentClick}>
|
||||
<md-focus-ring part="focus-ring" inward .control=${this}></md-focus-ring>
|
||||
<md-elevation part="elevation"></md-elevation>
|
||||
<md-ripple .control=${this}></md-ripple>
|
||||
<div
|
||||
class="content ${R(this.getContentClasses())}"
|
||||
role="presentation">
|
||||
<slot name="icon" @slotchange=${this.handleIconSlotChange}></slot>
|
||||
<slot @slotchange=${this.handleSlotChange}></slot>
|
||||
${this.fullWidthIndicator ? k : t}
|
||||
</div>
|
||||
${this.fullWidthIndicator ? t : k}
|
||||
</div>`;
|
||||
}
|
||||
getContentClasses() {
|
||||
return {
|
||||
"has-icon": this.hasIcon,
|
||||
"has-label": !this.iconOnly
|
||||
};
|
||||
}
|
||||
updated() {
|
||||
this.internals.ariaSelected = String(this.active);
|
||||
}
|
||||
async handleKeydown(t) {
|
||||
await 0, !t.defaultPrevented && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.click());
|
||||
}
|
||||
handleContentClick(t) {
|
||||
t.stopPropagation(), this.click();
|
||||
}
|
||||
[(N = m, S)](t) {
|
||||
if (!this[m])
|
||||
return;
|
||||
this[m].getAnimations().forEach((a) => {
|
||||
a.cancel();
|
||||
});
|
||||
const e = this.getKeyframes(t);
|
||||
e !== null && this[m].animate(e, {
|
||||
duration: 250,
|
||||
easing: B.EMPHASIZED
|
||||
});
|
||||
}
|
||||
getKeyframes(t) {
|
||||
var p;
|
||||
const e = K();
|
||||
if (!this.active)
|
||||
return e ? [{ opacity: 1 }, { transform: "none" }] : null;
|
||||
const a = {}, s = ((p = t[m]) == null ? void 0 : p.getBoundingClientRect()) ?? {}, i = s.left, c = s.width, o = this[m].getBoundingClientRect(), d = o.left, b = o.width, h = c / b;
|
||||
return !e && i !== void 0 && d !== void 0 && !isNaN(h) ? a.transform = `translateX(${(i - d).toFixed(4)}px) scaleX(${h.toFixed(4)})` : a.opacity = 0, [a, { transform: "none" }];
|
||||
}
|
||||
handleSlotChange() {
|
||||
this.iconOnly = !1;
|
||||
for (const t of this.assignedDefaultNodes) {
|
||||
const e = t.nodeType === Node.TEXT_NODE && !!t.wholeText.match(/\S/);
|
||||
if (t.nodeType === Node.ELEMENT_NODE || e)
|
||||
return;
|
||||
}
|
||||
this.iconOnly = !0;
|
||||
}
|
||||
handleIconSlotChange() {
|
||||
this.hasIcon = this.assignedIcons.length > 0;
|
||||
}
|
||||
};
|
||||
r([
|
||||
v({ type: Boolean, reflect: !0, attribute: "md-tab" })
|
||||
], l.prototype, "isTab", void 0);
|
||||
r([
|
||||
v({ type: Boolean, reflect: !0 })
|
||||
], l.prototype, "active", void 0);
|
||||
r([
|
||||
v({ type: Boolean })
|
||||
], l.prototype, "selected", null);
|
||||
r([
|
||||
v({ type: Boolean, attribute: "has-icon" })
|
||||
], l.prototype, "hasIcon", void 0);
|
||||
r([
|
||||
v({ type: Boolean, attribute: "icon-only" })
|
||||
], l.prototype, "iconOnly", void 0);
|
||||
r([
|
||||
E(".indicator")
|
||||
], l.prototype, N, void 0);
|
||||
r([
|
||||
F()
|
||||
], l.prototype, "fullWidthIndicator", void 0);
|
||||
r([
|
||||
L({ flatten: !0 })
|
||||
], l.prototype, "assignedDefaultNodes", void 0);
|
||||
r([
|
||||
M({ slot: "icon", flatten: !0 })
|
||||
], l.prototype, "assignedIcons", void 0);
|
||||
function K() {
|
||||
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
let y = class extends $ {
|
||||
/**
|
||||
* The currently selected tab, `null` only when there are no tab children.
|
||||
*
|
||||
* @export
|
||||
*/
|
||||
get activeTab() {
|
||||
return this.tabs.find((t) => t.active) ?? null;
|
||||
}
|
||||
set activeTab(t) {
|
||||
t && this.activateTab(t);
|
||||
}
|
||||
/**
|
||||
* The index of the currently selected tab.
|
||||
*
|
||||
* @export
|
||||
*/
|
||||
get activeTabIndex() {
|
||||
return this.tabs.findIndex((t) => t.active);
|
||||
}
|
||||
set activeTabIndex(t) {
|
||||
const e = () => {
|
||||
const a = this.tabs[t];
|
||||
a && this.activateTab(a);
|
||||
};
|
||||
if (!this.slotElement) {
|
||||
this.updateComplete.then(e);
|
||||
return;
|
||||
}
|
||||
e();
|
||||
}
|
||||
get focusedTab() {
|
||||
return this.tabs.find((t) => t.matches(":focus-within"));
|
||||
}
|
||||
constructor() {
|
||||
super(), this.autoActivate = !1, this.internals = // Cast needed for closure
|
||||
this.attachInternals(), this.internals.role = "tablist", this.addEventListener("keydown", this.handleKeydown.bind(this)), this.addEventListener("keyup", this.handleKeyup.bind(this)), this.addEventListener("focusout", this.handleFocusout.bind(this));
|
||||
}
|
||||
/**
|
||||
* Scrolls the toolbar, if overflowing, to the active tab, or the provided
|
||||
* tab.
|
||||
*
|
||||
* @param tabToScrollTo The tab that should be scrolled to. Defaults to the
|
||||
* active tab.
|
||||
* @return A Promise that resolves after the tab has been scrolled to.
|
||||
*/
|
||||
async scrollToTab(t) {
|
||||
await this.updateComplete;
|
||||
const { tabs: e } = this;
|
||||
if (t ?? (t = this.activeTab), !t || !e.includes(t) || !this.tabsScrollerElement)
|
||||
return;
|
||||
for (const f of this.tabs)
|
||||
await f.updateComplete;
|
||||
const a = t.offsetLeft, s = t.offsetWidth, i = this.scrollLeft, c = this.offsetWidth, o = 48, d = a - o, b = a + s - c + o, h = Math.min(d, Math.max(b, i)), p = this.focusedTab ? "auto" : "instant";
|
||||
this.tabsScrollerElement.scrollTo({ behavior: p, top: 0, left: h });
|
||||
}
|
||||
render() {
|
||||
return T`
|
||||
<div class="tabs">
|
||||
<slot
|
||||
@slotchange=${this.handleSlotChange}
|
||||
@click=${this.handleTabClick}></slot>
|
||||
</div>
|
||||
<md-divider part="divider"></md-divider>
|
||||
`;
|
||||
}
|
||||
async handleTabClick(t) {
|
||||
const e = t.target;
|
||||
await 0, !(t.defaultPrevented || !W(e) || e.active) && this.activateTab(e);
|
||||
}
|
||||
activateTab(t) {
|
||||
const { tabs: e } = this, a = this.activeTab;
|
||||
if (!(!e.includes(t) || a === t)) {
|
||||
for (const s of e)
|
||||
s.active = s === t;
|
||||
if (a) {
|
||||
if (!this.dispatchEvent(new Event("change", { bubbles: !0, cancelable: !0 }))) {
|
||||
for (const i of e)
|
||||
i.active = i === a;
|
||||
return;
|
||||
}
|
||||
t[S](a);
|
||||
}
|
||||
this.updateFocusableTab(t), this.scrollToTab(t);
|
||||
}
|
||||
}
|
||||
updateFocusableTab(t) {
|
||||
for (const e of this.tabs)
|
||||
e.tabIndex = e === t ? 0 : -1;
|
||||
}
|
||||
// focus item on keydown and optionally select it
|
||||
async handleKeydown(t) {
|
||||
await 0;
|
||||
const e = t.key === "ArrowLeft", a = t.key === "ArrowRight", s = t.key === "Home", i = t.key === "End";
|
||||
if (t.defaultPrevented || !e && !a && !s && !i)
|
||||
return;
|
||||
const { tabs: c } = this;
|
||||
if (c.length < 2)
|
||||
return;
|
||||
t.preventDefault();
|
||||
let o;
|
||||
if (s || i)
|
||||
o = s ? 0 : c.length - 1;
|
||||
else {
|
||||
const h = getComputedStyle(this).direction === "rtl" ? e : a, { focusedTab: p } = this;
|
||||
if (!p)
|
||||
o = h ? 0 : c.length - 1;
|
||||
else {
|
||||
const f = this.tabs.indexOf(p);
|
||||
o = h ? f + 1 : f - 1, o >= c.length ? o = 0 : o < 0 && (o = c.length - 1);
|
||||
}
|
||||
}
|
||||
const d = c[o];
|
||||
d.focus(), this.autoActivate ? this.activateTab(d) : this.updateFocusableTab(d);
|
||||
}
|
||||
// scroll to item on keyup.
|
||||
handleKeyup() {
|
||||
this.scrollToTab(this.focusedTab ?? this.activeTab);
|
||||
}
|
||||
handleFocusout() {
|
||||
if (this.matches(":focus-within"))
|
||||
return;
|
||||
const { activeTab: t } = this;
|
||||
t && this.updateFocusableTab(t);
|
||||
}
|
||||
handleSlotChange() {
|
||||
const t = this.tabs[0];
|
||||
!this.activeTab && t && this.activateTab(t), this.scrollToTab(this.activeTab);
|
||||
}
|
||||
};
|
||||
r([
|
||||
M({ flatten: !0, selector: "[md-tab]" })
|
||||
], y.prototype, "tabs", void 0);
|
||||
r([
|
||||
v({ type: Number, attribute: "active-tab-index" })
|
||||
], y.prototype, "activeTabIndex", null);
|
||||
r([
|
||||
v({ type: Boolean, attribute: "auto-activate" })
|
||||
], y.prototype, "autoActivate", void 0);
|
||||
r([
|
||||
E(".tabs")
|
||||
], y.prototype, "tabsScrollerElement", void 0);
|
||||
r([
|
||||
E("slot")
|
||||
], y.prototype, "slotElement", void 0);
|
||||
function W(n) {
|
||||
return n instanceof HTMLElement && n.hasAttribute("md-tab");
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const j = g`:host{box-sizing:border-box;display:flex;flex-direction:column;overflow:auto;scroll-behavior:smooth;scrollbar-width:none;position:relative}:host([hidden]){display:none}:host::-webkit-scrollbar{display:none}.tabs{align-items:end;display:flex;height:100%;overflow:inherit;scroll-behavior:inherit;scrollbar-width:inherit;justify-content:space-between;width:100%}::slotted(*){flex:1}::slotted([active]){z-index:1}
|
||||
`;
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
let u = class extends y {
|
||||
};
|
||||
u.styles = [j];
|
||||
u = r([
|
||||
I("md-tabs")
|
||||
], u);
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
class P extends l {
|
||||
constructor() {
|
||||
super(...arguments), this.inlineIcon = !1;
|
||||
}
|
||||
getContentClasses() {
|
||||
return {
|
||||
...super.getContentClasses(),
|
||||
stacked: !this.inlineIcon
|
||||
};
|
||||
}
|
||||
}
|
||||
r([
|
||||
v({ type: Boolean, attribute: "inline-icon" })
|
||||
], P.prototype, "inlineIcon", void 0);
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const H = g`:host{--_active-indicator-color: var(--md-primary-tab-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_active-indicator-height: var(--md-primary-tab-active-indicator-height, 3px);--_active-indicator-shape: var(--md-primary-tab-active-indicator-shape, 3px 3px 0px 0px);--_active-hover-state-layer-color: var(--md-primary-tab-active-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_active-hover-state-layer-opacity: var(--md-primary-tab-active-hover-state-layer-opacity, 0.08);--_active-pressed-state-layer-color: var(--md-primary-tab-active-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_active-pressed-state-layer-opacity: var(--md-primary-tab-active-pressed-state-layer-opacity, 0.12);--_container-color: var(--md-primary-tab-container-color, var(--md-sys-color-surface, #fef7ff));--_container-elevation: var(--md-primary-tab-container-elevation, 0);--_container-height: var(--md-primary-tab-container-height, 48px);--_with-icon-and-label-text-container-height: var(--md-primary-tab-with-icon-and-label-text-container-height, 64px);--_hover-state-layer-color: var(--md-primary-tab-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-primary-tab-hover-state-layer-opacity, 0.08);--_pressed-state-layer-color: var(--md-primary-tab-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-primary-tab-pressed-state-layer-opacity, 0.12);--_active-focus-icon-color: var(--md-primary-tab-active-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_active-hover-icon-color: var(--md-primary-tab-active-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_active-icon-color: var(--md-primary-tab-active-icon-color, var(--md-sys-color-primary, #6750a4));--_active-pressed-icon-color: var(--md-primary-tab-active-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-size: var(--md-primary-tab-icon-size, 24px);--_focus-icon-color: var(--md-primary-tab-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-icon-color: var(--md-primary-tab-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_icon-color: var(--md-primary-tab-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-icon-color: var(--md-primary-tab-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-font: var(--md-primary-tab-label-text-font, var(--md-sys-typescale-title-small-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-primary-tab-label-text-line-height, var(--md-sys-typescale-title-small-line-height, 1.25rem));--_label-text-size: var(--md-primary-tab-label-text-size, var(--md-sys-typescale-title-small-size, 0.875rem));--_label-text-weight: var(--md-primary-tab-label-text-weight, var(--md-sys-typescale-title-small-weight, var(--md-ref-typeface-weight-medium, 500)));--_active-focus-label-text-color: var(--md-primary-tab-active-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_active-hover-label-text-color: var(--md-primary-tab-active-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_active-label-text-color: var(--md-primary-tab-active-label-text-color, var(--md-sys-color-primary, #6750a4));--_active-pressed-label-text-color: var(--md-primary-tab-active-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-label-text-color: var(--md-primary-tab-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-primary-tab-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-color: var(--md-primary-tab-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-label-text-color: var(--md-primary-tab-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_container-shape-start-start: var(--md-primary-tab-container-shape-start-start, var(--md-primary-tab-container-shape, var(--md-sys-shape-corner-none, 0px)));--_container-shape-start-end: var(--md-primary-tab-container-shape-start-end, var(--md-primary-tab-container-shape, var(--md-sys-shape-corner-none, 0px)));--_container-shape-end-end: var(--md-primary-tab-container-shape-end-end, var(--md-primary-tab-container-shape, var(--md-sys-shape-corner-none, 0px)));--_container-shape-end-start: var(--md-primary-tab-container-shape-end-start, var(--md-primary-tab-container-shape, var(--md-sys-shape-corner-none, 0px)))}.content.stacked{flex-direction:column;gap:2px}.content.stacked.has-icon.has-label{height:var(--_with-icon-and-label-text-container-height)}
|
||||
`;
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const A = g`:host{display:inline-flex;align-items:center;justify-content:center;outline:none;padding:0 16px;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0);vertical-align:middle;user-select:none;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);color:var(--_label-text-color);z-index:0;--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity);--md-elevation-level: var(--_container-elevation)}md-focus-ring{--md-focus-ring-shape: 8px}:host([active]) md-focus-ring{margin-bottom:calc(var(--_active-indicator-height) + 1px)}.button::before{background:var(--_container-color);content:"";inset:0;position:absolute;z-index:-1}.button::before,md-ripple,md-elevation{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start)}.content{position:relative;box-sizing:border-box;display:inline-flex;flex-direction:row;align-items:center;justify-content:center;height:var(--_container-height);gap:8px}.indicator{position:absolute;box-sizing:border-box;z-index:-1;transform-origin:bottom left;background:var(--_active-indicator-color);border-radius:var(--_active-indicator-shape);height:var(--_active-indicator-height);inset:auto 0 0 0;opacity:0}::slotted([slot=icon]){display:inline-flex;position:relative;writing-mode:horizontal-tb;fill:currentColor;color:var(--_icon-color);font-size:var(--_icon-size);width:var(--_icon-size);height:var(--_icon-size)}:host(:hover){color:var(--_hover-label-text-color);cursor:pointer}:host(:hover) ::slotted([slot=icon]){color:var(--_hover-icon-color)}:host(:focus){color:var(--_focus-label-text-color)}:host(:focus) ::slotted([slot=icon]){color:var(--_focus-icon-color)}:host(:active){color:var(--_pressed-label-text-color)}:host(:active) ::slotted([slot=icon]){color:var(--_pressed-icon-color)}:host([active]) .indicator{opacity:1}:host([active]){color:var(--_active-label-text-color);--md-ripple-hover-color: var(--_active-hover-state-layer-color);--md-ripple-hover-opacity: var(--_active-hover-state-layer-opacity);--md-ripple-pressed-color: var(--_active-pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_active-pressed-state-layer-opacity)}:host([active]) ::slotted([slot=icon]){color:var(--_active-icon-color)}:host([active]:hover){color:var(--_active-hover-label-text-color)}:host([active]:hover) ::slotted([slot=icon]){color:var(--_active-hover-icon-color)}:host([active]:focus){color:var(--_active-focus-label-text-color)}:host([active]:focus) ::slotted([slot=icon]){color:var(--_active-focus-icon-color)}:host([active]:active){color:var(--_active-pressed-label-text-color)}:host([active]:active) ::slotted([slot=icon]){color:var(--_active-pressed-icon-color)}:host,::slotted(*){white-space:nowrap}@media(forced-colors: active){.indicator{background:CanvasText}}
|
||||
`;
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
let x = class extends P {
|
||||
};
|
||||
x.styles = [A, H];
|
||||
x = r([
|
||||
I("md-primary-tab")
|
||||
], x);
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
class X extends l {
|
||||
constructor() {
|
||||
super(...arguments), this.fullWidthIndicator = !0;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const G = g`:host{--_active-indicator-color: var(--md-secondary-tab-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_active-indicator-height: var(--md-secondary-tab-active-indicator-height, 2px);--_active-label-text-color: var(--md-secondary-tab-active-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_container-color: var(--md-secondary-tab-container-color, var(--md-sys-color-surface, #fef7ff));--_container-elevation: var(--md-secondary-tab-container-elevation, 0);--_container-height: var(--md-secondary-tab-container-height, 48px);--_focus-label-text-color: var(--md-secondary-tab-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-secondary-tab-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-color: var(--md-secondary-tab-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-secondary-tab-hover-state-layer-opacity, 0.08);--_label-text-font: var(--md-secondary-tab-label-text-font, var(--md-sys-typescale-title-small-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-secondary-tab-label-text-line-height, var(--md-sys-typescale-title-small-line-height, 1.25rem));--_label-text-size: var(--md-secondary-tab-label-text-size, var(--md-sys-typescale-title-small-size, 0.875rem));--_label-text-weight: var(--md-secondary-tab-label-text-weight, var(--md-sys-typescale-title-small-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-label-text-color: var(--md-secondary-tab-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-state-layer-color: var(--md-secondary-tab-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-state-layer-opacity: var(--md-secondary-tab-pressed-state-layer-opacity, 0.12);--_active-focus-icon-color: var(--md-secondary-tab-active-focus-icon-color, );--_active-focus-label-text-color: var(--md-secondary-tab-active-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-hover-icon-color: var(--md-secondary-tab-active-hover-icon-color, );--_active-hover-label-text-color: var(--md-secondary-tab-active-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-hover-state-layer-color: var(--md-secondary-tab-active-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_active-hover-state-layer-opacity: var(--md-secondary-tab-active-hover-state-layer-opacity, 0.08);--_active-icon-color: var(--md-secondary-tab-active-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_active-indicator-shape: var(--md-secondary-tab-active-indicator-shape, 0);--_active-pressed-icon-color: var(--md-secondary-tab-active-pressed-icon-color, );--_active-pressed-label-text-color: var(--md-secondary-tab-active-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-pressed-state-layer-color: var(--md-secondary-tab-active-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_active-pressed-state-layer-opacity: var(--md-secondary-tab-active-pressed-state-layer-opacity, 0.12);--_label-text-color: var(--md-secondary-tab-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-icon-color: var(--md-secondary-tab-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-icon-color: var(--md-secondary-tab-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_icon-size: var(--md-secondary-tab-icon-size, 24px);--_icon-color: var(--md-secondary-tab-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-icon-color: var(--md-secondary-tab-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_container-shape-start-start: var(--md-secondary-tab-container-shape-start-start, var(--md-secondary-tab-container-shape, var(--md-sys-shape-corner-none, 0px)));--_container-shape-start-end: var(--md-secondary-tab-container-shape-start-end, var(--md-secondary-tab-container-shape, var(--md-sys-shape-corner-none, 0px)));--_container-shape-end-end: var(--md-secondary-tab-container-shape-end-end, var(--md-secondary-tab-container-shape, var(--md-sys-shape-corner-none, 0px)));--_container-shape-end-start: var(--md-secondary-tab-container-shape-end-start, var(--md-secondary-tab-container-shape, var(--md-sys-shape-corner-none, 0px)))}
|
||||
`;
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
let _ = class extends X {
|
||||
};
|
||||
_.styles = [A, G];
|
||||
_ = r([
|
||||
I("md-secondary-tab")
|
||||
], _);
|
||||
const Z = C({
|
||||
react: w,
|
||||
tagName: "md-tabs",
|
||||
elementClass: u
|
||||
}), q = C({
|
||||
react: w,
|
||||
tagName: "md-primary-tab",
|
||||
elementClass: x
|
||||
}), J = C({
|
||||
react: w,
|
||||
tagName: "md-secondary-tab",
|
||||
elementClass: _
|
||||
}), ht = (n) => {
|
||||
const { children: t, className: e, style: a, id: s, activeTabIndex: i, onChange: c, ...o } = n;
|
||||
return /* @__PURE__ */ z(Z, { className: e, style: a, id: s, activeTabIndex: i, onChange: c, ...o, children: t });
|
||||
}, pt = (n) => {
|
||||
const { children: t, className: e, style: a, id: s, selected: i, variant: c = "primary", onClick: o, ...d } = n;
|
||||
return /* @__PURE__ */ z(c === "primary" ? q : J, { className: e, style: a, id: s, selected: i, onClick: o, ...d, children: t });
|
||||
};
|
||||
export {
|
||||
pt as Tab,
|
||||
ht as Tabs
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
"use strict";
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,98 @@
|
|||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),r=require("./string_utils-Bad7L8P5.js"),l=require("react"),y=require("./react-you-ui4.js");;/* empty css */const n=l.createContext(void 0);function d({children:o,theme:s,scheme:e}){return a.jsxs(n.Provider,{value:s,children:[a.jsx("style",{children:`
|
||||
body {
|
||||
|
||||
--md-ref-typeface-brand: 'Roboto Flex';
|
||||
--md-ref-typeface-plain: 'Roboto Flex';
|
||||
|
||||
--md-sys-color-primary: ${r.hexFromArgb(s.schemes[e].primary)};
|
||||
--md-sys-color-primary-container: ${r.hexFromArgb(s.schemes[e].primaryContainer)};
|
||||
--md-sys-color-secondary: ${r.hexFromArgb(s.schemes[e].secondary)};
|
||||
--md-sys-color-secondary-container: ${r.hexFromArgb(s.schemes[e].secondaryContainer)};
|
||||
--md-sys-color-tertiary: ${r.hexFromArgb(s.schemes[e].tertiary)};
|
||||
--md-sys-color-tertiary-container: ${r.hexFromArgb(s.schemes[e].tertiaryContainer)};
|
||||
--md-sys-color-error: ${r.hexFromArgb(s.schemes[e].error)};
|
||||
--md-sys-color-error-container: ${r.hexFromArgb(s.schemes[e].errorContainer)};
|
||||
--md-sys-color-background: ${r.hexFromArgb(s.schemes[e].background)};
|
||||
--md-sys-color-surface: ${r.hexFromArgb(s.schemes[e].surface)};
|
||||
--md-sys-color-surface-bright: ${r.hexFromArgb(s.schemes[e].surface)};
|
||||
--md-sys-color-surface-dim: ${r.hexFromArgb(s.schemes[e].surface)};
|
||||
--md-sys-color-surface-container: ${r.hexFromArgb(s.schemes[e].surface)};
|
||||
--md-sys-color-surface-container-lowest: ${r.hexFromArgb(s.schemes[e].surface)};
|
||||
--md-sys-color-surface-container-low: ${r.hexFromArgb(s.schemes[e].surfaceVariant)};
|
||||
--md-sys-color-surface-container-high: ${r.hexFromArgb(s.schemes[e].surfaceVariant)};
|
||||
--md-sys-color-surface-container-highest: ${r.hexFromArgb(s.schemes[e].surfaceVariant)};
|
||||
--md-sys-color-outline: ${r.hexFromArgb(s.schemes[e].outline)};
|
||||
--md-sys-color-outline-variant: ${r.hexFromArgb(s.schemes[e].outlineVariant)};
|
||||
--md-sys-color-scrim: ${r.hexFromArgb(s.schemes[e].scrim)};
|
||||
--md-sys-color-shadow: ${r.hexFromArgb(s.schemes[e].shadow)};
|
||||
--md-sys-color-on-surface: ${r.hexFromArgb(s.schemes[e].onSurface)};
|
||||
--md-sys-color-on-surface-variant: ${r.hexFromArgb(s.schemes[e].onSurfaceVariant)};
|
||||
--md-sys-color-on-surface-bright: ${r.hexFromArgb(s.schemes[e].onSurface)};
|
||||
--md-sys-color-on-surface-dim: ${r.hexFromArgb(s.schemes[e].onSurface)};
|
||||
--md-sys-color-background: ${r.hexFromArgb(s.schemes[e].background)};
|
||||
--md-sys-color-background-variant: ${r.hexFromArgb(s.schemes[e].surface)};
|
||||
|
||||
--md-sys-color-on-primary: ${r.hexFromArgb(s.schemes[e].onPrimary)};
|
||||
--md-sys-color-on-primary-container: ${r.hexFromArgb(s.schemes[e].onPrimaryContainer)};
|
||||
--md-sys-color-on-secondary: ${r.hexFromArgb(s.schemes[e].onSecondary)};
|
||||
--md-sys-color-on-secondary-container: ${r.hexFromArgb(s.schemes[e].onSecondaryContainer)};
|
||||
--md-sys-color-on-tertiary: ${r.hexFromArgb(s.schemes[e].onTertiary)};
|
||||
--md-sys-color-on-tertiary-container: ${r.hexFromArgb(s.schemes[e].onTertiaryContainer)};
|
||||
--md-sys-color-on-error: ${r.hexFromArgb(s.schemes[e].onError)};
|
||||
--md-sys-color-on-error-container: ${r.hexFromArgb(s.schemes[e].onErrorContainer)};
|
||||
--md-sys-color-on-background: ${r.hexFromArgb(s.schemes[e].onBackground)};
|
||||
|
||||
--md-sys-typescale-headline-small-font: 'Roboto Flex';
|
||||
--md-sys-typescale-headline-medium-font: 'Roboto Flex';
|
||||
--md-sys-typescale-headline-large-font: 'Roboto Flex';
|
||||
|
||||
--md-sys-typescale-headline-small-size: 24px;
|
||||
--md-sys-typescale-headline-medium-size: 32px;
|
||||
--md-sys-typescale-headline-large-size: 40px;
|
||||
|
||||
--md-sys-typescale-headline-small-weight: 400;
|
||||
--md-sys-typescale-headline-medium-weight: 400;
|
||||
--md-sys-typescale-headline-large-weight: 400;
|
||||
|
||||
--md-sys-typescale-headline-small-line-height: 32px;
|
||||
--md-sys-typescale-headline-medium-line-height: 40px;
|
||||
--md-sys-typescale-headline-large-line-height: 48px;
|
||||
|
||||
--md-sys-typescale-body-small-font: 'Roboto Flex';
|
||||
--md-sys-typescale-body-medium-font: 'Roboto Flex';
|
||||
--md-sys-typescale-body-large-font: 'Roboto Flex';
|
||||
|
||||
--md-sys-typescale-body-small-size: 12px;
|
||||
--md-sys-typescale-body-medium-size: 14px;
|
||||
--md-sys-typescale-body-large-size: 16px;
|
||||
|
||||
--md-sys-typescale-body-small-weight: 400;
|
||||
--md-sys-typescale-body-medium-weight: 400;
|
||||
--md-sys-typescale-body-large-weight: 400;
|
||||
|
||||
--md-sys-typescale-body-small-line-height: 16px;
|
||||
--md-sys-typescale-body-medium-line-height: 20px;
|
||||
--md-sys-typescale-body-large-line-height: 24px;
|
||||
|
||||
|
||||
|
||||
--md-sys-typescale-label-small-font: 'Roboto Flex';
|
||||
--md-sys-typescale-label-medium-font: 'Roboto Flex';
|
||||
--md-sys-typescale-label-large-font: 'Roboto Flex';
|
||||
|
||||
--md-sys-typescale-label-small-size: 12px;
|
||||
--md-sys-typescale-label-medium-size: 14px;
|
||||
--md-sys-typescale-label-large-size: 16px;
|
||||
|
||||
--md-sys-typescale-label-small-weight: 400;
|
||||
--md-sys-typescale-label-medium-weight: 400;
|
||||
--md-sys-typescale-label-large-weight: 400;
|
||||
|
||||
--md-sys-typescale-label-small-line-height: 16px;
|
||||
--md-sys-typescale-label-medium-line-height: 20px;
|
||||
--md-sys-typescale-label-large-line-height: 24px;
|
||||
|
||||
background-color: var(--md-sys-color-background);
|
||||
color: var(--md-sys-color-on-background);
|
||||
}
|
||||
`}),o]})}function c(){const o=l.useContext(n);if(o===void 0)throw new Error("useTheme must be used within a ThemeProvider");return o}function i(){const o=c(),s=y.useScheme();return o.schemes[s]}exports.ThemeProvider=d;exports.usePalette=i;exports.useTheme=c;
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
import { jsxs as l, jsx as n } from "react/jsx-runtime";
|
||||
import { h as e } from "./string_utils-B4bsIQ5w.mjs";
|
||||
import { createContext as c, useContext as y } from "react";
|
||||
import { useScheme as d } from "./react-you-ui4.mjs";
|
||||
/* empty css */
|
||||
const a = c(void 0);
|
||||
function f({ children: r, theme: s, scheme: o }) {
|
||||
return /* @__PURE__ */ l(a.Provider, { value: s, children: [
|
||||
/* @__PURE__ */ n("style", { children: `
|
||||
body {
|
||||
|
||||
--md-ref-typeface-brand: 'Roboto Flex';
|
||||
--md-ref-typeface-plain: 'Roboto Flex';
|
||||
|
||||
--md-sys-color-primary: ${e(s.schemes[o].primary)};
|
||||
--md-sys-color-primary-container: ${e(s.schemes[o].primaryContainer)};
|
||||
--md-sys-color-secondary: ${e(s.schemes[o].secondary)};
|
||||
--md-sys-color-secondary-container: ${e(s.schemes[o].secondaryContainer)};
|
||||
--md-sys-color-tertiary: ${e(s.schemes[o].tertiary)};
|
||||
--md-sys-color-tertiary-container: ${e(s.schemes[o].tertiaryContainer)};
|
||||
--md-sys-color-error: ${e(s.schemes[o].error)};
|
||||
--md-sys-color-error-container: ${e(s.schemes[o].errorContainer)};
|
||||
--md-sys-color-background: ${e(s.schemes[o].background)};
|
||||
--md-sys-color-surface: ${e(s.schemes[o].surface)};
|
||||
--md-sys-color-surface-bright: ${e(s.schemes[o].surface)};
|
||||
--md-sys-color-surface-dim: ${e(s.schemes[o].surface)};
|
||||
--md-sys-color-surface-container: ${e(s.schemes[o].surface)};
|
||||
--md-sys-color-surface-container-lowest: ${e(s.schemes[o].surface)};
|
||||
--md-sys-color-surface-container-low: ${e(s.schemes[o].surfaceVariant)};
|
||||
--md-sys-color-surface-container-high: ${e(s.schemes[o].surfaceVariant)};
|
||||
--md-sys-color-surface-container-highest: ${e(s.schemes[o].surfaceVariant)};
|
||||
--md-sys-color-outline: ${e(s.schemes[o].outline)};
|
||||
--md-sys-color-outline-variant: ${e(s.schemes[o].outlineVariant)};
|
||||
--md-sys-color-scrim: ${e(s.schemes[o].scrim)};
|
||||
--md-sys-color-shadow: ${e(s.schemes[o].shadow)};
|
||||
--md-sys-color-on-surface: ${e(s.schemes[o].onSurface)};
|
||||
--md-sys-color-on-surface-variant: ${e(s.schemes[o].onSurfaceVariant)};
|
||||
--md-sys-color-on-surface-bright: ${e(s.schemes[o].onSurface)};
|
||||
--md-sys-color-on-surface-dim: ${e(s.schemes[o].onSurface)};
|
||||
--md-sys-color-background: ${e(s.schemes[o].background)};
|
||||
--md-sys-color-background-variant: ${e(s.schemes[o].surface)};
|
||||
|
||||
--md-sys-color-on-primary: ${e(s.schemes[o].onPrimary)};
|
||||
--md-sys-color-on-primary-container: ${e(s.schemes[o].onPrimaryContainer)};
|
||||
--md-sys-color-on-secondary: ${e(s.schemes[o].onSecondary)};
|
||||
--md-sys-color-on-secondary-container: ${e(s.schemes[o].onSecondaryContainer)};
|
||||
--md-sys-color-on-tertiary: ${e(s.schemes[o].onTertiary)};
|
||||
--md-sys-color-on-tertiary-container: ${e(s.schemes[o].onTertiaryContainer)};
|
||||
--md-sys-color-on-error: ${e(s.schemes[o].onError)};
|
||||
--md-sys-color-on-error-container: ${e(s.schemes[o].onErrorContainer)};
|
||||
--md-sys-color-on-background: ${e(s.schemes[o].onBackground)};
|
||||
|
||||
--md-sys-typescale-headline-small-font: 'Roboto Flex';
|
||||
--md-sys-typescale-headline-medium-font: 'Roboto Flex';
|
||||
--md-sys-typescale-headline-large-font: 'Roboto Flex';
|
||||
|
||||
--md-sys-typescale-headline-small-size: 24px;
|
||||
--md-sys-typescale-headline-medium-size: 32px;
|
||||
--md-sys-typescale-headline-large-size: 40px;
|
||||
|
||||
--md-sys-typescale-headline-small-weight: 400;
|
||||
--md-sys-typescale-headline-medium-weight: 400;
|
||||
--md-sys-typescale-headline-large-weight: 400;
|
||||
|
||||
--md-sys-typescale-headline-small-line-height: 32px;
|
||||
--md-sys-typescale-headline-medium-line-height: 40px;
|
||||
--md-sys-typescale-headline-large-line-height: 48px;
|
||||
|
||||
--md-sys-typescale-body-small-font: 'Roboto Flex';
|
||||
--md-sys-typescale-body-medium-font: 'Roboto Flex';
|
||||
--md-sys-typescale-body-large-font: 'Roboto Flex';
|
||||
|
||||
--md-sys-typescale-body-small-size: 12px;
|
||||
--md-sys-typescale-body-medium-size: 14px;
|
||||
--md-sys-typescale-body-large-size: 16px;
|
||||
|
||||
--md-sys-typescale-body-small-weight: 400;
|
||||
--md-sys-typescale-body-medium-weight: 400;
|
||||
--md-sys-typescale-body-large-weight: 400;
|
||||
|
||||
--md-sys-typescale-body-small-line-height: 16px;
|
||||
--md-sys-typescale-body-medium-line-height: 20px;
|
||||
--md-sys-typescale-body-large-line-height: 24px;
|
||||
|
||||
|
||||
|
||||
--md-sys-typescale-label-small-font: 'Roboto Flex';
|
||||
--md-sys-typescale-label-medium-font: 'Roboto Flex';
|
||||
--md-sys-typescale-label-large-font: 'Roboto Flex';
|
||||
|
||||
--md-sys-typescale-label-small-size: 12px;
|
||||
--md-sys-typescale-label-medium-size: 14px;
|
||||
--md-sys-typescale-label-large-size: 16px;
|
||||
|
||||
--md-sys-typescale-label-small-weight: 400;
|
||||
--md-sys-typescale-label-medium-weight: 400;
|
||||
--md-sys-typescale-label-large-weight: 400;
|
||||
|
||||
--md-sys-typescale-label-small-line-height: 16px;
|
||||
--md-sys-typescale-label-medium-line-height: 20px;
|
||||
--md-sys-typescale-label-large-line-height: 24px;
|
||||
|
||||
background-color: var(--md-sys-color-background);
|
||||
color: var(--md-sys-color-on-background);
|
||||
}
|
||||
` }),
|
||||
r
|
||||
] });
|
||||
}
|
||||
function i() {
|
||||
const r = y(a);
|
||||
if (r === void 0)
|
||||
throw new Error("useTheme must be used within a ThemeProvider");
|
||||
return r;
|
||||
}
|
||||
function g() {
|
||||
const r = i(), s = d();
|
||||
return r.schemes[s];
|
||||
}
|
||||
export {
|
||||
f as ThemeProvider,
|
||||
g as usePalette,
|
||||
i as useTheme
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),t=require("react"),r=t.createContext("light");function o({children:e,scheme:c}){return n.jsx(r.Provider,{value:c,children:e})}function u(){return t.useContext(r)}exports.SchemeProvider=o;exports.useScheme=u;
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
import { jsx as r } from "react/jsx-runtime";
|
||||
import { createContext as n, useContext as c } from "react";
|
||||
const t = n("light");
|
||||
function s({ children: e, scheme: o }) {
|
||||
return /* @__PURE__ */ r(t.Provider, { value: o, children: e });
|
||||
}
|
||||
function u() {
|
||||
return c(t);
|
||||
}
|
||||
export {
|
||||
s as SchemeProvider,
|
||||
u as useScheme
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),d=require("react");;/* empty css */const p=({children:r,variant:s="span",className:a,color:t="",align:i,style:n,noWrap:l,id:y,size:m="auto",htmlFor:f})=>{const o=d.useMemo(()=>t==="primary"?"var(--md-sys-color-primary)":t==="secondary"?"var(--md-sys-color-secondary)":t==="tertiary"?"var(--md-sys-color-tertiary)":t==="error"?"var(--md-sys-color-error)":t==="on-primary"?"var(--md-sys-color-on-primary)":t==="on-secondary"?"var(--md-sys-color-on-secondary)":t==="on-tertiary"?"var(--md-sys-color-on-tertiary)":t==="on-error"?"var(--md-sys-color-on-error)":t==="on-surface"?"var(--md-sys-color-on-surface)":t==="scrim"?"var(--md-sys-color-scrim)":t==="outline"?"var(--md-sys-color-outline)":t==="outline-variant"?"var(--md-sys-color-outline-variant)":t,[t]),e=d.useMemo(()=>{if(m==="auto")return{h1:"large",h2:"large",h3:"medium",h4:"medium",h5:"small",h6:"small",p:"large",span:"large",label:"large"}[s];if(m==="small")return"small";if(m==="medium")return"medium";if(m==="large")return"large"},[m]);return s==="h1"?h.jsx("h1",{className:a,style:{color:o,fontWeight:`var(--md-sys-typescale-headline-${e}-weight)`,fontSize:`var(--md-sys-typescale-headline-${e}-size)`,lineHeight:`var(--md-sys-typescale-headline-${e}-line-height)`,fontFamily:`var(--md-sys-typescale-headline-${e}-font)`,textAlign:i,whiteSpace:l?"nowrap":"normal",...n},id:y,children:r}):s==="h2"?h.jsx("h2",{className:a,style:{color:o,fontWeight:`var(--md-sys-typescale-headline-${e}-weight)`,fontSize:`var(--md-sys-typescale-headline-${e}-size)`,lineHeight:`var(--md-sys-typescale-headline-${e}-line-height)`,fontFamily:`var(--md-sys-typescale-headline-${e}-font)`,textAlign:i,whiteSpace:l?"nowrap":"normal",...n},id:y,children:r}):s==="h3"?h.jsx("h3",{className:a,style:{color:o,fontWeight:`var(--md-sys-typescale-headline-${e}-weight)`,fontSize:`var(--md-sys-typescale-headline-${e}-size)`,lineHeight:`var(--md-sys-typescale-headline-${e}-line-height)`,fontFamily:`var(--md-sys-typescale-headline-${e}-font)`,textAlign:i,whiteSpace:l?"nowrap":"normal",...n},id:y,children:r}):s==="h4"?h.jsx("h4",{className:a,style:{color:o,fontWeight:`var(--md-sys-typescale-headline-${e}-weight)`,fontSize:`var(--md-sys-typescale-headline-${e}-size)`,lineHeight:`var(--md-sys-typescale-headline-${e}-line-height)`,fontFamily:`var(--md-sys-typescale-headline-${e}-font)`,textAlign:i,whiteSpace:l?"nowrap":"normal",...n},id:y,children:r}):s==="h5"?h.jsx("h5",{className:a,style:{color:o,fontWeight:`var(--md-sys-typescale-headline-${e}-weight)`,fontSize:`var(--md-sys-typescale-headline-${e}-size)`,lineHeight:`var(--md-sys-typescale-headline-${e}-line-height)`,fontFamily:`var(--md-sys-typescale-headline-${e}-font)`,textAlign:i,whiteSpace:l?"nowrap":"normal",...n},id:y,children:r}):s==="h6"?h.jsx("h6",{className:a,style:{color:o,fontWeight:`var(--md-sys-typescale-headline-${e}-weight)`,fontSize:`var(--md-sys-typescale-headline-${e}-size)`,lineHeight:`var(--md-sys-typescale-headline-${e}-line-height)`,fontFamily:`var(--md-sys-typescale-headline-${e}-font)`,textAlign:i,whiteSpace:l?"nowrap":"normal",...n},id:y,children:r}):s==="p"?h.jsx("p",{className:a,style:{color:o,fontWeight:`var(--md-sys-typescale-body-${e}-weight)`,fontSize:`var(--md-sys-typescale-body-${e}-size)`,lineHeight:`var(--md-sys-typescale-body-${e}-line-height)`,fontFamily:`var(--md-sys-typescale-body-${e}-font)`,textAlign:i,whiteSpace:l?"nowrap":"normal",...n},id:y,children:r}):s==="span"?h.jsx("span",{className:a,style:{color:o,fontWeight:`var(--md-sys-typescale-body-${e}-weight)`,fontSize:`var(--md-sys-typescale-body-${e}-size)`,lineHeight:`var(--md-sys-typescale-body-${e}-line-height)`,fontFamily:`var(--md-sys-typescale-body-${e}-font)`,textAlign:i,whiteSpace:l?"nowrap":"normal",...n},id:y,children:r}):s==="label"?h.jsx("label",{htmlFor:f,className:a,style:{color:o,fontWeight:`var(--md-sys-typescale-label-${e}-weight)`,fontSize:`var(--md-sys-typescale-label-${e}-size)`,lineHeight:`var(--md-sys-typescale-label-${e}-line-height)`,fontFamily:`var(--md-sys-typescale-label-${e}-font)`,textAlign:i,whiteSpace:l?"nowrap":"normal",...n},id:y,children:r}):null};exports.Typography=p;
|
||||
|
|
@ -0,0 +1,180 @@
|
|||
import { jsx as h } from "react/jsx-runtime";
|
||||
import { useMemo as d } from "react";
|
||||
/* empty css */
|
||||
const v = ({ children: s, variant: r = "span", className: a, color: t = "", align: i, style: n, noWrap: l, id: y, size: m = "auto", htmlFor: f }) => {
|
||||
const o = d(() => t === "primary" ? "var(--md-sys-color-primary)" : t === "secondary" ? "var(--md-sys-color-secondary)" : t === "tertiary" ? "var(--md-sys-color-tertiary)" : t === "error" ? "var(--md-sys-color-error)" : t === "on-primary" ? "var(--md-sys-color-on-primary)" : t === "on-secondary" ? "var(--md-sys-color-on-secondary)" : t === "on-tertiary" ? "var(--md-sys-color-on-tertiary)" : t === "on-error" ? "var(--md-sys-color-on-error)" : t === "on-surface" ? "var(--md-sys-color-on-surface)" : t === "scrim" ? "var(--md-sys-color-scrim)" : t === "outline" ? "var(--md-sys-color-outline)" : t === "outline-variant" ? "var(--md-sys-color-outline-variant)" : t, [t]), e = d(() => {
|
||||
if (m === "auto")
|
||||
return {
|
||||
h1: "large",
|
||||
h2: "large",
|
||||
h3: "medium",
|
||||
h4: "medium",
|
||||
h5: "small",
|
||||
h6: "small",
|
||||
p: "large",
|
||||
span: "large",
|
||||
label: "large"
|
||||
}[r];
|
||||
if (m === "small") return "small";
|
||||
if (m === "medium") return "medium";
|
||||
if (m === "large") return "large";
|
||||
}, [m]);
|
||||
return r === "h1" ? /* @__PURE__ */ h(
|
||||
"h1",
|
||||
{
|
||||
className: a,
|
||||
style: {
|
||||
color: o,
|
||||
fontWeight: `var(--md-sys-typescale-headline-${e}-weight)`,
|
||||
fontSize: `var(--md-sys-typescale-headline-${e}-size)`,
|
||||
lineHeight: `var(--md-sys-typescale-headline-${e}-line-height)`,
|
||||
fontFamily: `var(--md-sys-typescale-headline-${e}-font)`,
|
||||
textAlign: i,
|
||||
whiteSpace: l ? "nowrap" : "normal",
|
||||
...n
|
||||
},
|
||||
id: y,
|
||||
children: s
|
||||
}
|
||||
) : r === "h2" ? /* @__PURE__ */ h(
|
||||
"h2",
|
||||
{
|
||||
className: a,
|
||||
style: {
|
||||
color: o,
|
||||
fontWeight: `var(--md-sys-typescale-headline-${e}-weight)`,
|
||||
fontSize: `var(--md-sys-typescale-headline-${e}-size)`,
|
||||
lineHeight: `var(--md-sys-typescale-headline-${e}-line-height)`,
|
||||
fontFamily: `var(--md-sys-typescale-headline-${e}-font)`,
|
||||
textAlign: i,
|
||||
whiteSpace: l ? "nowrap" : "normal",
|
||||
...n
|
||||
},
|
||||
id: y,
|
||||
children: s
|
||||
}
|
||||
) : r === "h3" ? /* @__PURE__ */ h(
|
||||
"h3",
|
||||
{
|
||||
className: a,
|
||||
style: {
|
||||
color: o,
|
||||
fontWeight: `var(--md-sys-typescale-headline-${e}-weight)`,
|
||||
fontSize: `var(--md-sys-typescale-headline-${e}-size)`,
|
||||
lineHeight: `var(--md-sys-typescale-headline-${e}-line-height)`,
|
||||
fontFamily: `var(--md-sys-typescale-headline-${e}-font)`,
|
||||
textAlign: i,
|
||||
whiteSpace: l ? "nowrap" : "normal",
|
||||
...n
|
||||
},
|
||||
id: y,
|
||||
children: s
|
||||
}
|
||||
) : r === "h4" ? /* @__PURE__ */ h(
|
||||
"h4",
|
||||
{
|
||||
className: a,
|
||||
style: {
|
||||
color: o,
|
||||
fontWeight: `var(--md-sys-typescale-headline-${e}-weight)`,
|
||||
fontSize: `var(--md-sys-typescale-headline-${e}-size)`,
|
||||
lineHeight: `var(--md-sys-typescale-headline-${e}-line-height)`,
|
||||
fontFamily: `var(--md-sys-typescale-headline-${e}-font)`,
|
||||
textAlign: i,
|
||||
whiteSpace: l ? "nowrap" : "normal",
|
||||
...n
|
||||
},
|
||||
id: y,
|
||||
children: s
|
||||
}
|
||||
) : r === "h5" ? /* @__PURE__ */ h(
|
||||
"h5",
|
||||
{
|
||||
className: a,
|
||||
style: {
|
||||
color: o,
|
||||
fontWeight: `var(--md-sys-typescale-headline-${e}-weight)`,
|
||||
fontSize: `var(--md-sys-typescale-headline-${e}-size)`,
|
||||
lineHeight: `var(--md-sys-typescale-headline-${e}-line-height)`,
|
||||
fontFamily: `var(--md-sys-typescale-headline-${e}-font)`,
|
||||
textAlign: i,
|
||||
whiteSpace: l ? "nowrap" : "normal",
|
||||
...n
|
||||
},
|
||||
id: y,
|
||||
children: s
|
||||
}
|
||||
) : r === "h6" ? /* @__PURE__ */ h(
|
||||
"h6",
|
||||
{
|
||||
className: a,
|
||||
style: {
|
||||
color: o,
|
||||
fontWeight: `var(--md-sys-typescale-headline-${e}-weight)`,
|
||||
fontSize: `var(--md-sys-typescale-headline-${e}-size)`,
|
||||
lineHeight: `var(--md-sys-typescale-headline-${e}-line-height)`,
|
||||
fontFamily: `var(--md-sys-typescale-headline-${e}-font)`,
|
||||
textAlign: i,
|
||||
whiteSpace: l ? "nowrap" : "normal",
|
||||
...n
|
||||
},
|
||||
id: y,
|
||||
children: s
|
||||
}
|
||||
) : r === "p" ? /* @__PURE__ */ h(
|
||||
"p",
|
||||
{
|
||||
className: a,
|
||||
style: {
|
||||
color: o,
|
||||
fontWeight: `var(--md-sys-typescale-body-${e}-weight)`,
|
||||
fontSize: `var(--md-sys-typescale-body-${e}-size)`,
|
||||
lineHeight: `var(--md-sys-typescale-body-${e}-line-height)`,
|
||||
fontFamily: `var(--md-sys-typescale-body-${e}-font)`,
|
||||
textAlign: i,
|
||||
whiteSpace: l ? "nowrap" : "normal",
|
||||
...n
|
||||
},
|
||||
id: y,
|
||||
children: s
|
||||
}
|
||||
) : r === "span" ? /* @__PURE__ */ h(
|
||||
"span",
|
||||
{
|
||||
className: a,
|
||||
style: {
|
||||
color: o,
|
||||
fontWeight: `var(--md-sys-typescale-body-${e}-weight)`,
|
||||
fontSize: `var(--md-sys-typescale-body-${e}-size)`,
|
||||
lineHeight: `var(--md-sys-typescale-body-${e}-line-height)`,
|
||||
fontFamily: `var(--md-sys-typescale-body-${e}-font)`,
|
||||
textAlign: i,
|
||||
whiteSpace: l ? "nowrap" : "normal",
|
||||
...n
|
||||
},
|
||||
id: y,
|
||||
children: s
|
||||
}
|
||||
) : r === "label" ? /* @__PURE__ */ h(
|
||||
"label",
|
||||
{
|
||||
htmlFor: f,
|
||||
className: a,
|
||||
style: {
|
||||
color: o,
|
||||
fontWeight: `var(--md-sys-typescale-label-${e}-weight)`,
|
||||
fontSize: `var(--md-sys-typescale-label-${e}-size)`,
|
||||
lineHeight: `var(--md-sys-typescale-label-${e}-line-height)`,
|
||||
fontFamily: `var(--md-sys-typescale-label-${e}-font)`,
|
||||
textAlign: i,
|
||||
whiteSpace: l ? "nowrap" : "normal",
|
||||
...n
|
||||
},
|
||||
id: y,
|
||||
children: s
|
||||
}
|
||||
) : null;
|
||||
};
|
||||
export {
|
||||
v as Typography
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),c=require("./react-you-ui25.js"),n=({children:e,style:o,...r})=>(console.log(r,o),s.jsx(c.Box,{...r,style:{borderRadius:"28px",backgroundColor:"var(--md-sys-color-surface)",color:"var(--md-sys-color-on-surface)",padding:"18px",display:"flex",...o},children:e}));exports.Paper=n;
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
import { jsx as a } from "react/jsx-runtime";
|
||||
import { Box as c } from "./react-you-ui25.mjs";
|
||||
const l = ({ children: s, style: o, ...r }) => (console.log(r, o), /* @__PURE__ */ a(
|
||||
c,
|
||||
{
|
||||
...r,
|
||||
style: {
|
||||
borderRadius: "28px",
|
||||
backgroundColor: "var(--md-sys-color-surface)",
|
||||
color: "var(--md-sys-color-on-surface)",
|
||||
padding: "18px",
|
||||
display: "flex",
|
||||
...o
|
||||
},
|
||||
children: s
|
||||
}
|
||||
));
|
||||
export {
|
||||
l as Paper
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),l=require("./create-component-D9KTUrcf.js"),n=l.o({tagName:"label",react:a,elementClass:HTMLLabelElement}),o=e=>{const{form:s,...t}=e;return r.jsx(n,{...t,style:{display:"flex",alignItems:"center",gap:"8px",...e.style,fontFamily:"var(--md-ref-typeface-plain)"}})};exports.FormLabel=o;
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
import { jsx as a } from "react/jsx-runtime";
|
||||
import r from "react";
|
||||
import { o as l } from "./create-component-CVXl33PD.mjs";
|
||||
const m = l({
|
||||
tagName: "label",
|
||||
react: r,
|
||||
elementClass: HTMLLabelElement
|
||||
}), p = (e) => {
|
||||
const { form: o, ...t } = e;
|
||||
return /* @__PURE__ */ a(
|
||||
m,
|
||||
{
|
||||
...t,
|
||||
style: {
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
gap: "8px",
|
||||
...e.style,
|
||||
fontFamily: "var(--md-ref-typeface-plain)"
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
export {
|
||||
p as FormLabel
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),c=require("./react-you-ui25.js"),i=e=>{const{className:t,id:n,children:r,style:s,...o}=e;return a.jsx(c.Box,{className:t,id:n,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",backgroundColor:"transparent",...s},...o,children:r})};exports.AppBar=i;
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
import { jsx as p } from "react/jsx-runtime";
|
||||
import { Box as a } from "./react-you-ui25.mjs";
|
||||
const c = (e) => {
|
||||
const { className: t, id: r, children: n, style: s, ...o } = e;
|
||||
return /* @__PURE__ */ p(
|
||||
a,
|
||||
{
|
||||
className: t,
|
||||
id: r,
|
||||
style: {
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "space-between",
|
||||
padding: "8px 16px",
|
||||
backgroundColor: "transparent",
|
||||
...s
|
||||
},
|
||||
...o,
|
||||
children: n
|
||||
}
|
||||
);
|
||||
};
|
||||
export {
|
||||
c as AppBar
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,5 @@
|
|||
"use strict";/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/function p(c,t){t.bubbles&&(!c.shadowRoot||t.composed)&&t.stopPropagation();const s=Reflect.construct(t.constructor,[t.type,t]),o=c.dispatchEvent(s);return o||t.preventDefault(),o}exports.redispatchEvent=p;
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
function p(t, o) {
|
||||
o.bubbles && (!t.shadowRoot || o.composed) && o.stopPropagation();
|
||||
const s = Reflect.construct(o.constructor, [o.type, o]), c = t.dispatchEvent(s);
|
||||
return c || o.preventDefault(), c;
|
||||
}
|
||||
export {
|
||||
p as r
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,391 @@
|
|||
import { _ as a, n as m, r as C, a as w, b as y, x as S, c as P } from "./class-map-CwiboTfb.mjs";
|
||||
import { r as A, a as _, E as N } from "./animation-DjClVFum.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const I = Symbol("attachableController");
|
||||
let c;
|
||||
c = new MutationObserver((i) => {
|
||||
var t;
|
||||
for (const e of i)
|
||||
(t = e.target[I]) == null || t.hostConnected();
|
||||
});
|
||||
class E {
|
||||
get htmlFor() {
|
||||
return this.host.getAttribute("for");
|
||||
}
|
||||
set htmlFor(t) {
|
||||
t === null ? this.host.removeAttribute("for") : this.host.setAttribute("for", t);
|
||||
}
|
||||
get control() {
|
||||
return this.host.hasAttribute("for") ? !this.htmlFor || !this.host.isConnected ? null : this.host.getRootNode().querySelector(`#${this.htmlFor}`) : this.currentControl || this.host.parentElement;
|
||||
}
|
||||
set control(t) {
|
||||
t ? this.attach(t) : this.detach();
|
||||
}
|
||||
/**
|
||||
* Creates a new controller for an `Attachable` element.
|
||||
*
|
||||
* @param host The `Attachable` element.
|
||||
* @param onControlChange A callback with two parameters for the previous and
|
||||
* next control. An `Attachable` element may perform setup or teardown
|
||||
* logic whenever the control changes.
|
||||
*/
|
||||
constructor(t, e) {
|
||||
this.host = t, this.onControlChange = e, this.currentControl = null, t.addController(this), t[I] = this, c == null || c.observe(t, { attributeFilter: ["for"] });
|
||||
}
|
||||
attach(t) {
|
||||
t !== this.currentControl && (this.setCurrentControl(t), this.host.removeAttribute("for"));
|
||||
}
|
||||
detach() {
|
||||
this.setCurrentControl(null), this.host.setAttribute("for", "");
|
||||
}
|
||||
/** @private */
|
||||
hostConnected() {
|
||||
this.setCurrentControl(this.control);
|
||||
}
|
||||
/** @private */
|
||||
hostDisconnected() {
|
||||
this.setCurrentControl(null);
|
||||
}
|
||||
setCurrentControl(t) {
|
||||
this.onControlChange(this.currentControl, t), this.currentControl = t;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const R = ["focusin", "focusout", "pointerdown"];
|
||||
class v extends C {
|
||||
constructor() {
|
||||
super(...arguments), this.visible = !1, this.inward = !1, this.attachableController = new E(this, this.onControlChange.bind(this));
|
||||
}
|
||||
get htmlFor() {
|
||||
return this.attachableController.htmlFor;
|
||||
}
|
||||
set htmlFor(t) {
|
||||
this.attachableController.htmlFor = t;
|
||||
}
|
||||
get control() {
|
||||
return this.attachableController.control;
|
||||
}
|
||||
set control(t) {
|
||||
this.attachableController.control = t;
|
||||
}
|
||||
attach(t) {
|
||||
this.attachableController.attach(t);
|
||||
}
|
||||
detach() {
|
||||
this.attachableController.detach();
|
||||
}
|
||||
connectedCallback() {
|
||||
super.connectedCallback(), this.setAttribute("aria-hidden", "true");
|
||||
}
|
||||
/** @private */
|
||||
handleEvent(t) {
|
||||
var e;
|
||||
if (!t[b]) {
|
||||
switch (t.type) {
|
||||
default:
|
||||
return;
|
||||
case "focusin":
|
||||
this.visible = ((e = this.control) == null ? void 0 : e.matches(":focus-visible")) ?? !1;
|
||||
break;
|
||||
case "focusout":
|
||||
case "pointerdown":
|
||||
this.visible = !1;
|
||||
break;
|
||||
}
|
||||
t[b] = !0;
|
||||
}
|
||||
}
|
||||
onControlChange(t, e) {
|
||||
for (const r of R)
|
||||
t == null || t.removeEventListener(r, this), e == null || e.addEventListener(r, this);
|
||||
}
|
||||
update(t) {
|
||||
t.has("visible") && this.dispatchEvent(new Event("visibility-changed")), super.update(t);
|
||||
}
|
||||
}
|
||||
a([
|
||||
m({ type: Boolean, reflect: !0 })
|
||||
], v.prototype, "visible", void 0);
|
||||
a([
|
||||
m({ type: Boolean, reflect: !0 })
|
||||
], v.prototype, "inward", void 0);
|
||||
const b = Symbol("handledByFocusRing");
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const k = w`:host{animation-delay:0s,calc(var(--md-focus-ring-duration, 600ms)*.25);animation-duration:calc(var(--md-focus-ring-duration, 600ms)*.25),calc(var(--md-focus-ring-duration, 600ms)*.75);animation-timing-function:cubic-bezier(0.2, 0, 0, 1);box-sizing:border-box;color:var(--md-focus-ring-color, var(--md-sys-color-secondary, #625b71));display:none;pointer-events:none;position:absolute}:host([visible]){display:flex}:host(:not([inward])){animation-name:outward-grow,outward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));inset:calc(-1*var(--md-focus-ring-outward-offset, 2px));outline:var(--md-focus-ring-width, 3px) solid currentColor}:host([inward]){animation-name:inward-grow,inward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border:var(--md-focus-ring-width, 3px) solid currentColor;inset:var(--md-focus-ring-inward-offset, 0px)}@keyframes outward-grow{from{outline-width:0}to{outline-width:var(--md-focus-ring-active-width, 8px)}}@keyframes outward-shrink{from{outline-width:var(--md-focus-ring-active-width, 8px)}}@keyframes inward-grow{from{border-width:0}to{border-width:var(--md-focus-ring-active-width, 8px)}}@keyframes inward-shrink{from{border-width:var(--md-focus-ring-active-width, 8px)}}@media(prefers-reduced-motion){:host{animation:none}}
|
||||
`;
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
let f = class extends v {
|
||||
};
|
||||
f.styles = [k];
|
||||
f = a([
|
||||
y("md-focus-ring")
|
||||
], f);
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const L = 450, g = 225, F = 0.2, M = 10, O = 75, z = 0.35, D = "::after", G = "forwards";
|
||||
var o;
|
||||
(function(i) {
|
||||
i[i.INACTIVE = 0] = "INACTIVE", i[i.TOUCH_DELAY = 1] = "TOUCH_DELAY", i[i.HOLDING = 2] = "HOLDING", i[i.WAITING_FOR_CLICK = 3] = "WAITING_FOR_CLICK";
|
||||
})(o || (o = {}));
|
||||
const B = [
|
||||
"click",
|
||||
"contextmenu",
|
||||
"pointercancel",
|
||||
"pointerdown",
|
||||
"pointerenter",
|
||||
"pointerleave",
|
||||
"pointerup"
|
||||
], $ = 150, u = window.matchMedia("(forced-colors: active)");
|
||||
class h extends C {
|
||||
constructor() {
|
||||
super(...arguments), this.disabled = !1, this.hovered = !1, this.pressed = !1, this.rippleSize = "", this.rippleScale = "", this.initialSize = 0, this.state = o.INACTIVE, this.checkBoundsAfterContextMenu = !1, this.attachableController = new E(this, this.onControlChange.bind(this));
|
||||
}
|
||||
get htmlFor() {
|
||||
return this.attachableController.htmlFor;
|
||||
}
|
||||
set htmlFor(t) {
|
||||
this.attachableController.htmlFor = t;
|
||||
}
|
||||
get control() {
|
||||
return this.attachableController.control;
|
||||
}
|
||||
set control(t) {
|
||||
this.attachableController.control = t;
|
||||
}
|
||||
attach(t) {
|
||||
this.attachableController.attach(t);
|
||||
}
|
||||
detach() {
|
||||
this.attachableController.detach();
|
||||
}
|
||||
connectedCallback() {
|
||||
super.connectedCallback(), this.setAttribute("aria-hidden", "true");
|
||||
}
|
||||
render() {
|
||||
const t = {
|
||||
hovered: this.hovered,
|
||||
pressed: this.pressed
|
||||
};
|
||||
return S`<div class="surface ${P(t)}"></div>`;
|
||||
}
|
||||
update(t) {
|
||||
t.has("disabled") && this.disabled && (this.hovered = !1, this.pressed = !1), super.update(t);
|
||||
}
|
||||
/**
|
||||
* TODO(b/269799771): make private
|
||||
* @private only public for slider
|
||||
*/
|
||||
handlePointerenter(t) {
|
||||
this.shouldReactToEvent(t) && (this.hovered = !0);
|
||||
}
|
||||
/**
|
||||
* TODO(b/269799771): make private
|
||||
* @private only public for slider
|
||||
*/
|
||||
handlePointerleave(t) {
|
||||
this.shouldReactToEvent(t) && (this.hovered = !1, this.state !== o.INACTIVE && this.endPressAnimation());
|
||||
}
|
||||
handlePointerup(t) {
|
||||
if (this.shouldReactToEvent(t)) {
|
||||
if (this.state === o.HOLDING) {
|
||||
this.state = o.WAITING_FOR_CLICK;
|
||||
return;
|
||||
}
|
||||
if (this.state === o.TOUCH_DELAY) {
|
||||
this.state = o.WAITING_FOR_CLICK, this.startPressAnimation(this.rippleStartEvent);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
async handlePointerdown(t) {
|
||||
if (this.shouldReactToEvent(t)) {
|
||||
if (this.rippleStartEvent = t, !this.isTouch(t)) {
|
||||
this.state = o.WAITING_FOR_CLICK, this.startPressAnimation(t);
|
||||
return;
|
||||
}
|
||||
this.checkBoundsAfterContextMenu && !this.inBounds(t) || (this.checkBoundsAfterContextMenu = !1, this.state = o.TOUCH_DELAY, await new Promise((e) => {
|
||||
setTimeout(e, $);
|
||||
}), this.state === o.TOUCH_DELAY && (this.state = o.HOLDING, this.startPressAnimation(t)));
|
||||
}
|
||||
}
|
||||
handleClick() {
|
||||
if (!this.disabled) {
|
||||
if (this.state === o.WAITING_FOR_CLICK) {
|
||||
this.endPressAnimation();
|
||||
return;
|
||||
}
|
||||
this.state === o.INACTIVE && (this.startPressAnimation(), this.endPressAnimation());
|
||||
}
|
||||
}
|
||||
handlePointercancel(t) {
|
||||
this.shouldReactToEvent(t) && this.endPressAnimation();
|
||||
}
|
||||
handleContextmenu() {
|
||||
this.disabled || (this.checkBoundsAfterContextMenu = !0, this.endPressAnimation());
|
||||
}
|
||||
determineRippleSize() {
|
||||
const { height: t, width: e } = this.getBoundingClientRect(), r = Math.max(t, e), n = Math.max(z * r, O), s = Math.floor(r * F), d = Math.sqrt(e ** 2 + t ** 2) + M;
|
||||
this.initialSize = s, this.rippleScale = `${(d + n) / s}`, this.rippleSize = `${s}px`;
|
||||
}
|
||||
getNormalizedPointerEventCoords(t) {
|
||||
const { scrollX: e, scrollY: r } = window, { left: n, top: s } = this.getBoundingClientRect(), l = e + n, d = r + s, { pageX: x, pageY: T } = t;
|
||||
return { x: x - l, y: T - d };
|
||||
}
|
||||
getTranslationCoordinates(t) {
|
||||
const { height: e, width: r } = this.getBoundingClientRect(), n = {
|
||||
x: (r - this.initialSize) / 2,
|
||||
y: (e - this.initialSize) / 2
|
||||
};
|
||||
let s;
|
||||
return t instanceof PointerEvent ? s = this.getNormalizedPointerEventCoords(t) : s = {
|
||||
x: r / 2,
|
||||
y: e / 2
|
||||
}, s = {
|
||||
x: s.x - this.initialSize / 2,
|
||||
y: s.y - this.initialSize / 2
|
||||
}, { startPoint: s, endPoint: n };
|
||||
}
|
||||
startPressAnimation(t) {
|
||||
var l;
|
||||
if (!this.mdRoot)
|
||||
return;
|
||||
this.pressed = !0, (l = this.growAnimation) == null || l.cancel(), this.determineRippleSize();
|
||||
const { startPoint: e, endPoint: r } = this.getTranslationCoordinates(t), n = `${e.x}px, ${e.y}px`, s = `${r.x}px, ${r.y}px`;
|
||||
this.growAnimation = this.mdRoot.animate({
|
||||
top: [0, 0],
|
||||
left: [0, 0],
|
||||
height: [this.rippleSize, this.rippleSize],
|
||||
width: [this.rippleSize, this.rippleSize],
|
||||
transform: [
|
||||
`translate(${n}) scale(1)`,
|
||||
`translate(${s}) scale(${this.rippleScale})`
|
||||
]
|
||||
}, {
|
||||
pseudoElement: D,
|
||||
duration: L,
|
||||
easing: N.STANDARD,
|
||||
fill: G
|
||||
});
|
||||
}
|
||||
async endPressAnimation() {
|
||||
this.rippleStartEvent = void 0, this.state = o.INACTIVE;
|
||||
const t = this.growAnimation;
|
||||
let e = 1 / 0;
|
||||
if (typeof (t == null ? void 0 : t.currentTime) == "number" ? e = t.currentTime : t != null && t.currentTime && (e = t.currentTime.to("ms").value), e >= g) {
|
||||
this.pressed = !1;
|
||||
return;
|
||||
}
|
||||
await new Promise((r) => {
|
||||
setTimeout(r, g - e);
|
||||
}), this.growAnimation === t && (this.pressed = !1);
|
||||
}
|
||||
/**
|
||||
* Returns `true` if
|
||||
* - the ripple element is enabled
|
||||
* - the pointer is primary for the input type
|
||||
* - the pointer is the pointer that started the interaction, or will start
|
||||
* the interaction
|
||||
* - the pointer is a touch, or the pointer state has the primary button
|
||||
* held, or the pointer is hovering
|
||||
*/
|
||||
shouldReactToEvent(t) {
|
||||
if (this.disabled || !t.isPrimary || this.rippleStartEvent && this.rippleStartEvent.pointerId !== t.pointerId)
|
||||
return !1;
|
||||
if (t.type === "pointerenter" || t.type === "pointerleave")
|
||||
return !this.isTouch(t);
|
||||
const e = t.buttons === 1;
|
||||
return this.isTouch(t) || e;
|
||||
}
|
||||
/**
|
||||
* Check if the event is within the bounds of the element.
|
||||
*
|
||||
* This is only needed for the "stuck" contextmenu longpress on Chrome.
|
||||
*/
|
||||
inBounds({ x: t, y: e }) {
|
||||
const { top: r, left: n, bottom: s, right: l } = this.getBoundingClientRect();
|
||||
return t >= n && t <= l && e >= r && e <= s;
|
||||
}
|
||||
isTouch({ pointerType: t }) {
|
||||
return t === "touch";
|
||||
}
|
||||
/** @private */
|
||||
async handleEvent(t) {
|
||||
if (!(u != null && u.matches))
|
||||
switch (t.type) {
|
||||
case "click":
|
||||
this.handleClick();
|
||||
break;
|
||||
case "contextmenu":
|
||||
this.handleContextmenu();
|
||||
break;
|
||||
case "pointercancel":
|
||||
this.handlePointercancel(t);
|
||||
break;
|
||||
case "pointerdown":
|
||||
await this.handlePointerdown(t);
|
||||
break;
|
||||
case "pointerenter":
|
||||
this.handlePointerenter(t);
|
||||
break;
|
||||
case "pointerleave":
|
||||
this.handlePointerleave(t);
|
||||
break;
|
||||
case "pointerup":
|
||||
this.handlePointerup(t);
|
||||
break;
|
||||
}
|
||||
}
|
||||
onControlChange(t, e) {
|
||||
for (const r of B)
|
||||
t == null || t.removeEventListener(r, this), e == null || e.addEventListener(r, this);
|
||||
}
|
||||
}
|
||||
a([
|
||||
m({ type: Boolean, reflect: !0 })
|
||||
], h.prototype, "disabled", void 0);
|
||||
a([
|
||||
A()
|
||||
], h.prototype, "hovered", void 0);
|
||||
a([
|
||||
A()
|
||||
], h.prototype, "pressed", void 0);
|
||||
a([
|
||||
_(".surface")
|
||||
], h.prototype, "mdRoot", void 0);
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2024 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const H = w`:host{display:flex;margin:auto;pointer-events:none}:host([disabled]){display:none}@media(forced-colors: active){:host{display:none}}:host,.surface{border-radius:inherit;position:absolute;inset:0;overflow:hidden}.surface{-webkit-tap-highlight-color:rgba(0,0,0,0)}.surface::before,.surface::after{content:"";opacity:0;position:absolute}.surface::before{background-color:var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1d1b20));inset:0;transition:opacity 15ms linear,background-color 15ms linear}.surface::after{background:radial-gradient(closest-side, var(--md-ripple-pressed-color, var(--md-sys-color-on-surface, #1d1b20)) max(100% - 70px, 65%), transparent 100%);transform-origin:center center;transition:opacity 375ms linear}.hovered::before{background-color:var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-ripple-hover-opacity, 0.08)}.pressed::after{opacity:var(--md-ripple-pressed-opacity, 0.12);transition-duration:105ms}
|
||||
`;
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2022 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
let p = class extends h {
|
||||
};
|
||||
p.styles = [H];
|
||||
p = a([
|
||||
y("md-ripple")
|
||||
], p);
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
"use strict";const S=require("./class-map-DV5418hw.js");/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/const p=Symbol.for(""),d=t=>{if((t==null?void 0:t.r)===p)return t==null?void 0:t._$litStatic$},h=(t,...e)=>({_$litStatic$:e.reduce((r,s,u)=>r+(a=>{if(a._$litStatic$!==void 0)return a._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${a}. Use 'unsafeStatic' to pass non-literal values, but
|
||||
take care to ensure page security.`)})(s)+t[u+1],t[0]),r:p}),f=new Map,v=t=>(e,...r)=>{const s=r.length;let u,a;const o=[],n=[];let l,i=0,c=!1;for(;i<s;){for(l=e[i];i<s&&(a=r[i],(u=d(a))!==void 0);)l+=u+e[++i],c=!0;i!==s&&n.push(a),o.push(l),i++}if(i===s&&o.push(e[s]),c){const $=o.join("$$lit$$");(e=f.get($))===void 0&&(o.raw=o,f.set($,e=o)),r=n}return t(e,...r)},_=v(S.x);exports.i=h;exports.u=_;
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
import { x as S } from "./class-map-CwiboTfb.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const p = Symbol.for(""), d = (t) => {
|
||||
if ((t == null ? void 0 : t.r) === p) return t == null ? void 0 : t._$litStatic$;
|
||||
}, v = (t, ...e) => ({ _$litStatic$: e.reduce((a, o, l) => a + ((r) => {
|
||||
if (r._$litStatic$ !== void 0) return r._$litStatic$;
|
||||
throw Error(`Value passed to 'literal' function must be a 'literal' result: ${r}. Use 'unsafeStatic' to pass non-literal values, but
|
||||
take care to ensure page security.`);
|
||||
})(o) + t[l + 1], t[0]), r: p }), f = /* @__PURE__ */ new Map(), h = (t) => (e, ...a) => {
|
||||
const o = a.length;
|
||||
let l, r;
|
||||
const s = [], u = [];
|
||||
let n, i = 0, c = !1;
|
||||
for (; i < o; ) {
|
||||
for (n = e[i]; i < o && (r = a[i], (l = d(r)) !== void 0); ) n += l + e[++i], c = !0;
|
||||
i !== o && u.push(r), s.push(n), i++;
|
||||
}
|
||||
if (i === o && s.push(e[o]), c) {
|
||||
const $ = s.join("$$lit$$");
|
||||
(e = f.get($)) === void 0 && (s.raw = s, f.set($, e = s)), a = u;
|
||||
}
|
||||
return t(e, ...a);
|
||||
}, _ = h(S);
|
||||
export {
|
||||
v as i,
|
||||
_ as u
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,5 @@
|
|||
"use strict";const i=require("./class-map-DV5418hw.js");/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/const l="important",c=" !"+l,u=i.e(class extends i.i{constructor(n){var t;if(super(n),n.type!==i.t.ATTRIBUTE||n.name!=="style"||((t=n.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((t,s)=>{const e=n[s];return e==null?t:t+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${e};`},"")}update(n,[t]){const{style:s}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)t[e]==null&&(this.ft.delete(e),e.includes("-")?s.removeProperty(e):s[e]=null);for(const e in t){const r=t[e];if(r!=null){this.ft.add(e);const o=typeof r=="string"&&r.endsWith(c);e.includes("-")||o?s.setProperty(e,o?r.slice(0,-11):r,o?l:""):s[e]=r}}return i.T}});exports.o=u;
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
import { e as l, i as u, t as c, T as d } from "./class-map-CwiboTfb.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
const o = "important", a = " !" + o, h = l(class extends u {
|
||||
constructor(n) {
|
||||
var e;
|
||||
if (super(n), n.type !== c.ATTRIBUTE || n.name !== "style" || ((e = n.strings) == null ? void 0 : e.length) > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
||||
}
|
||||
render(n) {
|
||||
return Object.keys(n).reduce((e, s) => {
|
||||
const t = n[s];
|
||||
return t == null ? e : e + `${s = s.includes("-") ? s : s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${t};`;
|
||||
}, "");
|
||||
}
|
||||
update(n, [e]) {
|
||||
const { style: s } = n.element;
|
||||
if (this.ft === void 0) return this.ft = new Set(Object.keys(e)), this.render(e);
|
||||
for (const t of this.ft) e[t] == null && (this.ft.delete(t), t.includes("-") ? s.removeProperty(t) : s[t] = null);
|
||||
for (const t in e) {
|
||||
const r = e[t];
|
||||
if (r != null) {
|
||||
this.ft.add(t);
|
||||
const i = typeof r == "string" && r.endsWith(a);
|
||||
t.includes("-") || i ? s.setProperty(t, i ? r.slice(0, -11) : r, i ? o : "") : s[t] = r;
|
||||
}
|
||||
}
|
||||
return d;
|
||||
}
|
||||
});
|
||||
export {
|
||||
h as o
|
||||
};
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
"use strict";require("./class-map-DV5418hw.js");const s=require("./element-internals-OOm6rgx-.js");/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const d=Symbol("createValidator"),h=Symbol("getValidityAnchor"),l=Symbol("privateValidator"),a=Symbol("privateSyncValidity"),r=Symbol("privateCustomValidationMessage");function V(c){var e;class u extends c{constructor(){super(...arguments),this[e]=""}get validity(){return this[a](),this[s.internals].validity}get validationMessage(){return this[a](),this[s.internals].validationMessage}get willValidate(){return this[a](),this[s.internals].willValidate}checkValidity(){return this[a](),this[s.internals].checkValidity()}reportValidity(){return this[a](),this[s.internals].reportValidity()}setCustomValidity(i){this[r]=i,this[a]()}requestUpdate(i,n,o){super.requestUpdate(i,n,o),this[a]()}firstUpdated(i){super.firstUpdated(i),this[a]()}[(e=r,a)](){this[l]||(this[l]=this[d]());const{validity:i,validationMessage:n}=this[l].getValidity(),o=!!this[r],y=this[r]||n;this[s.internals].setValidity({...i,customError:o},y,this[h]()??void 0)}[d](){throw new Error("Implement [createValidator]")}[h](){throw new Error("Implement [getValidityAnchor]")}}return u}/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/class g{constructor(e){this.getCurrentState=e,this.currentValidity={validity:{},validationMessage:""}}getValidity(){const e=this.getCurrentState();if(!(!this.prevState||!this.equals(this.prevState,e)))return this.currentValidity;const{validity:t,validationMessage:i}=this.computeValidity(e);return this.prevState=this.copy(e),this.currentValidity={validationMessage:i,validity:{badInput:t.badInput,customError:t.customError,patternMismatch:t.patternMismatch,rangeOverflow:t.rangeOverflow,rangeUnderflow:t.rangeUnderflow,stepMismatch:t.stepMismatch,tooLong:t.tooLong,tooShort:t.tooShort,typeMismatch:t.typeMismatch,valueMissing:t.valueMissing}},this.currentValidity}}exports.Validator=g;exports.createValidator=d;exports.getValidityAnchor=h;exports.mixinConstraintValidation=V;
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
import "./class-map-CwiboTfb.mjs";
|
||||
import { i as s } from "./element-internals-3IY9gE4L.mjs";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const c = Symbol("createValidator"), u = Symbol("getValidityAnchor"), l = Symbol("privateValidator"), a = Symbol("privateSyncValidity"), r = Symbol("privateCustomValidationMessage");
|
||||
function g(d) {
|
||||
var e;
|
||||
class h extends d {
|
||||
constructor() {
|
||||
super(...arguments), this[e] = "";
|
||||
}
|
||||
get validity() {
|
||||
return this[a](), this[s].validity;
|
||||
}
|
||||
get validationMessage() {
|
||||
return this[a](), this[s].validationMessage;
|
||||
}
|
||||
get willValidate() {
|
||||
return this[a](), this[s].willValidate;
|
||||
}
|
||||
checkValidity() {
|
||||
return this[a](), this[s].checkValidity();
|
||||
}
|
||||
reportValidity() {
|
||||
return this[a](), this[s].reportValidity();
|
||||
}
|
||||
setCustomValidity(i) {
|
||||
this[r] = i, this[a]();
|
||||
}
|
||||
requestUpdate(i, o, n) {
|
||||
super.requestUpdate(i, o, n), this[a]();
|
||||
}
|
||||
firstUpdated(i) {
|
||||
super.firstUpdated(i), this[a]();
|
||||
}
|
||||
[(e = r, a)]() {
|
||||
this[l] || (this[l] = this[c]());
|
||||
const { validity: i, validationMessage: o } = this[l].getValidity(), n = !!this[r], y = this[r] || o;
|
||||
this[s].setValidity({ ...i, customError: n }, y, this[u]() ?? void 0);
|
||||
}
|
||||
[c]() {
|
||||
throw new Error("Implement [createValidator]");
|
||||
}
|
||||
[u]() {
|
||||
throw new Error("Implement [getValidityAnchor]");
|
||||
}
|
||||
}
|
||||
return h;
|
||||
}
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
class m {
|
||||
/**
|
||||
* Creates a new validator.
|
||||
*
|
||||
* @param getCurrentState A callback that returns the current state of
|
||||
* constraint validation-related properties.
|
||||
*/
|
||||
constructor(e) {
|
||||
this.getCurrentState = e, this.currentValidity = {
|
||||
validity: {},
|
||||
validationMessage: ""
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Returns the current `ValidityStateFlags` and validation message for the
|
||||
* validator.
|
||||
*
|
||||
* If the constraint validation state has not changed, this will return a
|
||||
* cached result. This is important since `getValidity()` can be called
|
||||
* frequently in response to synchronous property changes.
|
||||
*
|
||||
* @return The current validity and validation message.
|
||||
*/
|
||||
getValidity() {
|
||||
const e = this.getCurrentState();
|
||||
if (!(!this.prevState || !this.equals(this.prevState, e)))
|
||||
return this.currentValidity;
|
||||
const { validity: t, validationMessage: i } = this.computeValidity(e);
|
||||
return this.prevState = this.copy(e), this.currentValidity = {
|
||||
validationMessage: i,
|
||||
validity: {
|
||||
// Change any `ValidityState` instances into `ValidityStateFlags` since
|
||||
// `ValidityState` cannot be easily `{...spread}`.
|
||||
badInput: t.badInput,
|
||||
customError: t.customError,
|
||||
patternMismatch: t.patternMismatch,
|
||||
rangeOverflow: t.rangeOverflow,
|
||||
rangeUnderflow: t.rangeUnderflow,
|
||||
stepMismatch: t.stepMismatch,
|
||||
tooLong: t.tooLong,
|
||||
tooShort: t.tooShort,
|
||||
typeMismatch: t.typeMismatch,
|
||||
valueMissing: t.valueMissing
|
||||
}
|
||||
}, this.currentValidity;
|
||||
}
|
||||
}
|
||||
export {
|
||||
m as V,
|
||||
c,
|
||||
u as g,
|
||||
g as m
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -2,8 +2,8 @@
|
|||
"name": "react-you-ui",
|
||||
"version": "1.0.0",
|
||||
"description": "Material You components for React, built on top of @material/web",
|
||||
"main": "dist/react-you-ui.esm.js",
|
||||
"module": "dist/react-you-ui.umd.js",
|
||||
"main": "dist/react-you-ui.js",
|
||||
"module": "dist/react-you-ui.mjs",
|
||||
"types": "dist/react-you-ui.d.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
|
|
@ -11,8 +11,7 @@
|
|||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/react-you-ui.d.ts",
|
||||
"import": "./dist/react-you-ui.es.js",
|
||||
"require": "./dist/react-you-ui.es.js"
|
||||
"default": "./dist/react-you-ui.js"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
|
|
@ -44,6 +43,7 @@
|
|||
"@material/material-color-utilities": "^0.3.0",
|
||||
"@material/web": "^2.2.0",
|
||||
"classnames": "^2.5.1",
|
||||
"glob": "^11.0.1",
|
||||
"uuid": "^11.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue