@francofantomius/material-components 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +192 -0
- package/custom-elements.json +5448 -0
- package/dist/chunks/base-component-DQTjlEVL.js +34 -0
- package/dist/chunks/base-component-DQTjlEVL.js.map +1 -0
- package/dist/chunks/focus-ring-Dl-XoEKK.js +71 -0
- package/dist/chunks/focus-ring-Dl-XoEKK.js.map +1 -0
- package/dist/chunks/form-associated-fKbeX_2P.js +74 -0
- package/dist/chunks/form-associated-fKbeX_2P.js.map +1 -0
- package/dist/chunks/theme.css-DV3DRha-.js +263 -0
- package/dist/chunks/theme.css-DV3DRha-.js.map +1 -0
- package/dist/components/badge/badge.css.d.ts +2 -0
- package/dist/components/badge/badge.css.d.ts.map +1 -0
- package/dist/components/badge/badge.d.ts +16 -0
- package/dist/components/badge/badge.d.ts.map +1 -0
- package/dist/components/badge/badge.js +93 -0
- package/dist/components/badge/badge.js.map +1 -0
- package/dist/components/button/button.css.d.ts +2 -0
- package/dist/components/button/button.css.d.ts.map +1 -0
- package/dist/components/button/button.d.ts +25 -0
- package/dist/components/button/button.d.ts.map +1 -0
- package/dist/components/button/button.js +263 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/card/card.css.d.ts +2 -0
- package/dist/components/card/card.css.d.ts.map +1 -0
- package/dist/components/card/card.d.ts +18 -0
- package/dist/components/card/card.d.ts.map +1 -0
- package/dist/components/card/card.js +169 -0
- package/dist/components/card/card.js.map +1 -0
- package/dist/components/checkbox/checkbox.css.d.ts +2 -0
- package/dist/components/checkbox/checkbox.css.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts +24 -0
- package/dist/components/checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.js +188 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/chip/chip.css.d.ts +3 -0
- package/dist/components/chip/chip.css.d.ts.map +1 -0
- package/dist/components/chip/chip.d.ts +27 -0
- package/dist/components/chip/chip.d.ts.map +1 -0
- package/dist/components/chip/chip.js +174 -0
- package/dist/components/chip/chip.js.map +1 -0
- package/dist/components/dialog/dialog.css.d.ts +2 -0
- package/dist/components/dialog/dialog.css.d.ts.map +1 -0
- package/dist/components/dialog/dialog.d.ts +22 -0
- package/dist/components/dialog/dialog.d.ts.map +1 -0
- package/dist/components/dialog/dialog.js +167 -0
- package/dist/components/dialog/dialog.js.map +1 -0
- package/dist/components/divider/divider.css.d.ts +2 -0
- package/dist/components/divider/divider.css.d.ts.map +1 -0
- package/dist/components/divider/divider.d.ts +16 -0
- package/dist/components/divider/divider.d.ts.map +1 -0
- package/dist/components/divider/divider.js +81 -0
- package/dist/components/divider/divider.js.map +1 -0
- package/dist/components/fab/fab.css.d.ts +2 -0
- package/dist/components/fab/fab.css.d.ts.map +1 -0
- package/dist/components/fab/fab.d.ts +19 -0
- package/dist/components/fab/fab.d.ts.map +1 -0
- package/dist/components/fab/fab.js +155 -0
- package/dist/components/fab/fab.js.map +1 -0
- package/dist/components/icon/icon.css.d.ts +2 -0
- package/dist/components/icon/icon.css.d.ts.map +1 -0
- package/dist/components/icon/icon.d.ts +15 -0
- package/dist/components/icon/icon.d.ts.map +1 -0
- package/dist/components/icon/icon.js +70 -0
- package/dist/components/icon/icon.js.map +1 -0
- package/dist/components/icon-button/icon-button.css.d.ts +2 -0
- package/dist/components/icon-button/icon-button.css.d.ts.map +1 -0
- package/dist/components/icon-button/icon-button.d.ts +22 -0
- package/dist/components/icon-button/icon-button.d.ts.map +1 -0
- package/dist/components/icon-button/icon-button.js +192 -0
- package/dist/components/icon-button/icon-button.js.map +1 -0
- package/dist/components/list/list.css.d.ts +3 -0
- package/dist/components/list/list.css.d.ts.map +1 -0
- package/dist/components/list/list.d.ts +25 -0
- package/dist/components/list/list.d.ts.map +1 -0
- package/dist/components/list/list.js +190 -0
- package/dist/components/list/list.js.map +1 -0
- package/dist/components/progress/progress.css.d.ts +2 -0
- package/dist/components/progress/progress.css.d.ts.map +1 -0
- package/dist/components/progress/progress.d.ts +19 -0
- package/dist/components/progress/progress.d.ts.map +1 -0
- package/dist/components/progress/progress.js +183 -0
- package/dist/components/progress/progress.js.map +1 -0
- package/dist/components/radio/radio.css.d.ts +3 -0
- package/dist/components/radio/radio.css.d.ts.map +1 -0
- package/dist/components/radio/radio.d.ts +38 -0
- package/dist/components/radio/radio.d.ts.map +1 -0
- package/dist/components/radio/radio.js +205 -0
- package/dist/components/radio/radio.js.map +1 -0
- package/dist/components/snackbar/snackbar.css.d.ts +2 -0
- package/dist/components/snackbar/snackbar.css.d.ts.map +1 -0
- package/dist/components/snackbar/snackbar.d.ts +24 -0
- package/dist/components/snackbar/snackbar.d.ts.map +1 -0
- package/dist/components/snackbar/snackbar.js +164 -0
- package/dist/components/snackbar/snackbar.js.map +1 -0
- package/dist/components/switch/switch.css.d.ts +2 -0
- package/dist/components/switch/switch.css.d.ts.map +1 -0
- package/dist/components/switch/switch.d.ts +22 -0
- package/dist/components/switch/switch.d.ts.map +1 -0
- package/dist/components/switch/switch.js +171 -0
- package/dist/components/switch/switch.js.map +1 -0
- package/dist/components/tabs/tabs.css.d.ts +3 -0
- package/dist/components/tabs/tabs.css.d.ts.map +1 -0
- package/dist/components/tabs/tabs.d.ts +33 -0
- package/dist/components/tabs/tabs.d.ts.map +1 -0
- package/dist/components/tabs/tabs.js +200 -0
- package/dist/components/tabs/tabs.js.map +1 -0
- package/dist/components/text-field/text-field.css.d.ts +2 -0
- package/dist/components/text-field/text-field.css.d.ts.map +1 -0
- package/dist/components/text-field/text-field.d.ts +40 -0
- package/dist/components/text-field/text-field.d.ts.map +1 -0
- package/dist/components/text-field/text-field.js +327 -0
- package/dist/components/text-field/text-field.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/base-component.d.ts +13 -0
- package/dist/internal/base-component.d.ts.map +1 -0
- package/dist/internal/focus-ring/focus-ring.css.d.ts +2 -0
- package/dist/internal/focus-ring/focus-ring.css.d.ts.map +1 -0
- package/dist/internal/focus-ring/focus-ring.d.ts +18 -0
- package/dist/internal/focus-ring/focus-ring.d.ts.map +1 -0
- package/dist/internal/form-associated.d.ts +26 -0
- package/dist/internal/form-associated.d.ts.map +1 -0
- package/dist/internal/ripple/ripple.css.d.ts +2 -0
- package/dist/internal/ripple/ripple.css.d.ts.map +1 -0
- package/dist/internal/ripple/ripple.d.ts +26 -0
- package/dist/internal/ripple/ripple.d.ts.map +1 -0
- package/dist/internal/ripple/ripple.js +144 -0
- package/dist/internal/ripple/ripple.js.map +1 -0
- package/dist/tokens/colors.d.ts +42 -0
- package/dist/tokens/colors.d.ts.map +1 -0
- package/dist/tokens/elevation.d.ts +9 -0
- package/dist/tokens/elevation.d.ts.map +1 -0
- package/dist/tokens/index.d.ts +7 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.js +13 -0
- package/dist/tokens/index.js.map +1 -0
- package/dist/tokens/motion.d.ts +21 -0
- package/dist/tokens/motion.d.ts.map +1 -0
- package/dist/tokens/shape.d.ts +10 -0
- package/dist/tokens/shape.d.ts.map +1 -0
- package/dist/tokens/theme.css.d.ts +4 -0
- package/dist/tokens/theme.css.d.ts.map +1 -0
- package/dist/tokens/typography.d.ts +101 -0
- package/dist/tokens/typography.d.ts.map +1 -0
- package/package.json +133 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.js","sources":["../../../src/components/switch/switch.css.ts","../../../src/components/switch/switch.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const switchStyles = css`\n :host {\n display: inline-flex;\n align-items: center;\n vertical-align: middle;\n cursor: pointer;\n outline: none;\n -webkit-tap-highlight-color: transparent;\n user-select: none;\n gap: 12px;\n font-family: var(--md-sys-typescale-font-family, inherit);\n font-size: var(--md-sys-typescale-body-large-size, 16px);\n color: var(--md-sys-color-on-surface, #1D1B20);\n }\n\n :host([disabled]) {\n cursor: not-allowed;\n color: rgba(29, 27, 32, 0.38);\n pointer-events: none;\n }\n\n .switch {\n position: relative;\n display: inline-flex;\n align-items: center;\n width: 52px;\n height: 32px;\n box-sizing: border-box;\n border-radius: var(--md-sys-shape-corner-full, 9999px);\n border: 2px solid var(--md-sys-color-outline, #79747E);\n background-color: var(--md-sys-color-surface-container-highest, #E6E0E9);\n transition: background-color 200ms cubic-bezier(0.2, 0, 0, 1),\n border-color 200ms cubic-bezier(0.2, 0, 0, 1);\n }\n\n :host([selected]) .switch {\n background-color: var(--md-sys-color-primary, #6750A4);\n border-color: var(--md-sys-color-primary, #6750A4);\n }\n\n :host([disabled]) .switch {\n background-color: rgba(29, 27, 32, 0.12);\n border-color: rgba(29, 27, 32, 0.12);\n }\n\n .thumb-container {\n position: absolute;\n left: 4px;\n width: 20px;\n height: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: transform 200ms cubic-bezier(0.2, 0, 0, 1);\n }\n\n :host([selected]) .thumb-container {\n transform: translateX(20px);\n }\n\n .thumb {\n width: 16px;\n height: 16px;\n border-radius: 50%;\n background-color: var(--md-sys-color-outline, #79747E);\n display: flex;\n align-items: center;\n justify-content: center;\n transition: width 200ms cubic-bezier(0.2, 0, 0, 1),\n height 200ms cubic-bezier(0.2, 0, 0, 1),\n background-color 200ms cubic-bezier(0.2, 0, 0, 1);\n }\n\n :host([selected]) .thumb {\n width: 24px;\n height: 24px;\n background-color: var(--md-sys-color-on-primary, #FFFFFF);\n }\n\n :host([disabled]) .thumb {\n background-color: rgba(29, 27, 32, 0.38);\n }\n\n .icon {\n font-size: 16px;\n color: var(--md-sys-color-on-primary-container, #21005D);\n opacity: 0;\n transition: opacity 150ms ease;\n }\n\n :host([selected]) .icon.check {\n opacity: 1;\n }\n\n :host([icons]:not([selected])) .icon.cross {\n opacity: 1;\n color: var(--md-sys-color-surface-container-highest, #E6E0E9);\n }\n`;\n\n","import { html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { MdBaseElement } from '../../internal/base-component.js';\nimport { MdFormAssociatedElement } from '../../internal/form-associated.js';\nimport '../../internal/ripple/ripple.js';\nimport '../../internal/focus-ring/focus-ring.js';\nimport '../icon/icon.js';\nimport { switchStyles } from './switch.css.js';\n\n@customElement('md-switch')\nexport class MdSwitch extends MdFormAssociatedElement {\n static override styles = [MdFormAssociatedElement.styles, switchStyles];\n\n @property({ type: Boolean, reflect: true })\n selected = false;\n\n @property({ type: Boolean, reflect: true })\n icons = false;\n\n @property({ type: String })\n value = 'on';\n\n override connectedCallback() {\n super.connectedCallback();\n this.tabIndex = this.disabled ? -1 : 0;\n this.addEventListener('click', this.handleClick);\n this.addEventListener('keydown', this.handleKeyDown);\n this.updateFormValue();\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.handleClick);\n this.removeEventListener('keydown', this.handleKeyDown);\n }\n\n override updated(changedProperties: Map<string, unknown>) {\n super.updated(changedProperties);\n if (changedProperties.has('selected') || changedProperties.has('value')) {\n this.updateFormValue();\n }\n }\n\n override formResetCallback() {\n this.selected = false;\n this.updateFormValue();\n }\n\n private updateFormValue() {\n this.setFormValue(this.selected ? this.value : null);\n if (this.required && !this.selected) {\n this.setValidity({ valueMissing: true }, 'Please toggle this switch');\n } else {\n this.setValidity({});\n }\n }\n\n private handleClick = (event: MouseEvent) => {\n if (this.disabled) return;\n event.preventDefault();\n this.toggle();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (this.disabled) return;\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.toggle();\n }\n };\n\n private toggle() {\n this.selected = !this.selected;\n this.updateFormValue();\n this.emitEvent('change', { selected: this.selected });\n this.emitEvent('input', { selected: this.selected });\n }\n\n override render() {\n return html`\n <div class=\"switch\">\n <div class=\"thumb-container\">\n <md-ripple ?disabled=${this.disabled} unbounded></md-ripple>\n <md-focus-ring></md-focus-ring>\n <div class=\"thumb\">\n ${this.icons\n ? html`\n <md-icon class=\"icon check\" size=\"14\">check</md-icon>\n <md-icon class=\"icon cross\" size=\"14\">close</md-icon>\n `\n : html`<slot name=\"icon\"></slot>`}\n </div>\n </div>\n </div>\n <slot></slot>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-switch': MdSwitch;\n }\n}\n"],"names":["switchStyles","css","MdSwitch","MdFormAssociatedElement","event","changedProperties","html","__decorateClass","property","customElement"],"mappings":";;;;;;AAEO,MAAMA,IAAeC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;ACQrB,IAAMC,IAAN,cAAuBC,EAAwB;AAAA,EAA/C,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAA,WAAW,IAGX,KAAA,QAAQ,IAGR,KAAA,QAAQ,MAqCR,KAAQ,cAAc,CAACC,MAAsB;AAC3C,MAAI,KAAK,aACTA,EAAM,eAAA,GACN,KAAK,OAAA;AAAA,IACP,GAEA,KAAQ,gBAAgB,CAACA,MAAyB;AAChD,MAAI,KAAK,aACLA,EAAM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ADCC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAH/BN,EAIX,WAAA,YAAA,CAAA;AAGAK,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAN/BN,EAOX,WAAA,SAAA,CAAA;AAGAK,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GATfN,EAUX,WAAA,SAAA,CAAA;AAVWA,IAANK,EAAA;AAAA,EADNE,EAAc,WAAW;AAAA,GACbP,CAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.css.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs.css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,yBA8BtB,CAAC;AAEF,eAAO,MAAM,SAAS,yBA+CrB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MdBaseElement } from '../../internal/base-component.js';
|
|
2
|
+
export declare class MdTab extends MdBaseElement {
|
|
3
|
+
static styles: import('lit').CSSResultGroup[];
|
|
4
|
+
active: boolean;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
icon: string;
|
|
7
|
+
label: string;
|
|
8
|
+
connectedCallback(): void;
|
|
9
|
+
updated(changedProperties: Map<string, unknown>): void;
|
|
10
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
11
|
+
}
|
|
12
|
+
export declare class MdTabs extends MdBaseElement {
|
|
13
|
+
static styles: import('lit').CSSResultGroup[];
|
|
14
|
+
activeIndex: number;
|
|
15
|
+
private tabs;
|
|
16
|
+
private indicatorElement?;
|
|
17
|
+
connectedCallback(): void;
|
|
18
|
+
disconnectedCallback(): void;
|
|
19
|
+
updated(changedProperties: Map<string, unknown>): void;
|
|
20
|
+
private handleSlotChange;
|
|
21
|
+
private syncActiveTab;
|
|
22
|
+
private updateIndicator;
|
|
23
|
+
private handleClick;
|
|
24
|
+
private handleKeyDown;
|
|
25
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
26
|
+
}
|
|
27
|
+
declare global {
|
|
28
|
+
interface HTMLElementTagNameMap {
|
|
29
|
+
'md-tab': MdTab;
|
|
30
|
+
'md-tabs': MdTabs;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,iCAAiC,CAAC;AACzC,OAAO,yCAAyC,CAAC;AACjD,OAAO,iBAAiB,CAAC;AAGzB,qBACa,KAAM,SAAQ,aAAa;IACtC,OAAgB,MAAM,iCAAqC;IAG3D,MAAM,UAAS;IAGf,QAAQ,UAAS;IAGjB,IAAI,SAAM;IAGV,KAAK,SAAM;IAEF,iBAAiB;IAOjB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAQ/C,MAAM;CAchB;AAED,qBACa,MAAO,SAAQ,aAAa;IACvC,OAAgB,MAAM,iCAAsC;IAG5D,WAAW,SAAK;IAGhB,OAAO,CAAC,IAAI,CAAW;IAGvB,OAAO,CAAC,gBAAgB,CAAC,CAAc;IAE9B,iBAAiB;IAOjB,oBAAoB;IAMpB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAOxD,OAAO,CAAC,gBAAgB,CAEtB;IAEF,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,eAAe;IAevB,OAAO,CAAC,WAAW,CAUjB;IAEF,OAAO,CAAC,aAAa,CA6BnB;IAEO,MAAM;CAQhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,QAAQ,EAAE,KAAK,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { css as b, nothing as u, html as p } from "lit";
|
|
2
|
+
import { property as c, customElement as f, queryAssignedElements as v, query as m } from "lit/decorators.js";
|
|
3
|
+
import { M as d } from "../../chunks/base-component-DQTjlEVL.js";
|
|
4
|
+
import "../../internal/ripple/ripple.js";
|
|
5
|
+
import "../../chunks/focus-ring-Dl-XoEKK.js";
|
|
6
|
+
import "../icon/icon.js";
|
|
7
|
+
const y = b`
|
|
8
|
+
:host {
|
|
9
|
+
display: flex;
|
|
10
|
+
position: relative;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
border-bottom: 1px solid var(--md-sys-color-surface-variant, #E7E0EC);
|
|
13
|
+
overflow-x: auto;
|
|
14
|
+
scrollbar-width: none; /* Firefox */
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:host::-webkit-scrollbar {
|
|
18
|
+
display: none; /* Safari and Chrome */
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.tabs-container {
|
|
22
|
+
display: flex;
|
|
23
|
+
position: relative;
|
|
24
|
+
width: 100%;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.indicator {
|
|
28
|
+
position: absolute;
|
|
29
|
+
bottom: 0;
|
|
30
|
+
height: 3px;
|
|
31
|
+
background-color: var(--md-sys-color-primary, #6750A4);
|
|
32
|
+
border-radius: 3px 3px 0 0;
|
|
33
|
+
transition: transform 250ms cubic-bezier(0.2, 0, 0, 1),
|
|
34
|
+
width 250ms cubic-bezier(0.2, 0, 0, 1);
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
}
|
|
37
|
+
`, x = b`
|
|
38
|
+
:host {
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
flex: 1;
|
|
41
|
+
min-width: 90px;
|
|
42
|
+
height: 48px;
|
|
43
|
+
outline: none;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
user-select: none;
|
|
46
|
+
-webkit-tap-highlight-color: transparent;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:host([disabled]) {
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
opacity: 0.38;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.tab {
|
|
55
|
+
position: relative;
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
flex-direction: row;
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: 100%;
|
|
62
|
+
padding: 0 16px;
|
|
63
|
+
gap: 8px;
|
|
64
|
+
font-family: var(--md-sys-typescale-font-family, inherit);
|
|
65
|
+
font-size: var(--md-sys-typescale-title-small-size, 14px);
|
|
66
|
+
font-weight: 500;
|
|
67
|
+
line-height: 20px;
|
|
68
|
+
letter-spacing: 0.1px;
|
|
69
|
+
color: var(--md-sys-color-on-surface-variant, #49454F);
|
|
70
|
+
transition: color 150ms cubic-bezier(0.2, 0, 0, 1);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:host([active]) .tab {
|
|
74
|
+
color: var(--md-sys-color-primary, #6750A4);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.content {
|
|
78
|
+
display: inline-flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
gap: 8px;
|
|
81
|
+
position: relative;
|
|
82
|
+
z-index: 1;
|
|
83
|
+
}
|
|
84
|
+
`;
|
|
85
|
+
var g = Object.defineProperty, w = Object.getOwnPropertyDescriptor, a = (t, e, s, n) => {
|
|
86
|
+
for (var i = n > 1 ? void 0 : n ? w(e, s) : e, r = t.length - 1, h; r >= 0; r--)
|
|
87
|
+
(h = t[r]) && (i = (n ? h(e, s, i) : h(i)) || i);
|
|
88
|
+
return n && i && g(e, s, i), i;
|
|
89
|
+
};
|
|
90
|
+
let o = class extends d {
|
|
91
|
+
constructor() {
|
|
92
|
+
super(...arguments), this.active = !1, this.disabled = !1, this.icon = "", this.label = "";
|
|
93
|
+
}
|
|
94
|
+
connectedCallback() {
|
|
95
|
+
super.connectedCallback(), this.setAttribute("role", "tab"), this.setAttribute("aria-selected", this.active ? "true" : "false"), this.tabIndex = this.active ? 0 : -1;
|
|
96
|
+
}
|
|
97
|
+
updated(t) {
|
|
98
|
+
super.updated(t), t.has("active") && (this.setAttribute("aria-selected", this.active ? "true" : "false"), this.tabIndex = this.active ? 0 : -1);
|
|
99
|
+
}
|
|
100
|
+
render() {
|
|
101
|
+
return p`
|
|
102
|
+
<div class="tab">
|
|
103
|
+
<md-ripple ?disabled=${this.disabled}></md-ripple>
|
|
104
|
+
<md-focus-ring></md-focus-ring>
|
|
105
|
+
<span class="content">
|
|
106
|
+
<slot name="icon">
|
|
107
|
+
${this.icon ? p`<md-icon name=${this.icon}></md-icon>` : u}
|
|
108
|
+
</slot>
|
|
109
|
+
<slot>${this.label}</slot>
|
|
110
|
+
</span>
|
|
111
|
+
</div>
|
|
112
|
+
`;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
o.styles = [d.styles, x];
|
|
116
|
+
a([
|
|
117
|
+
c({ type: Boolean, reflect: !0 })
|
|
118
|
+
], o.prototype, "active", 2);
|
|
119
|
+
a([
|
|
120
|
+
c({ type: Boolean, reflect: !0 })
|
|
121
|
+
], o.prototype, "disabled", 2);
|
|
122
|
+
a([
|
|
123
|
+
c({ type: String })
|
|
124
|
+
], o.prototype, "icon", 2);
|
|
125
|
+
a([
|
|
126
|
+
c({ type: String })
|
|
127
|
+
], o.prototype, "label", 2);
|
|
128
|
+
o = a([
|
|
129
|
+
f("md-tab")
|
|
130
|
+
], o);
|
|
131
|
+
let l = class extends d {
|
|
132
|
+
constructor() {
|
|
133
|
+
super(...arguments), this.activeIndex = 0, this.handleSlotChange = () => {
|
|
134
|
+
this.syncActiveTab();
|
|
135
|
+
}, this.handleClick = (t) => {
|
|
136
|
+
const e = t.target.closest("md-tab");
|
|
137
|
+
if (e && !e.disabled) {
|
|
138
|
+
const s = this.tabs.indexOf(e);
|
|
139
|
+
s !== -1 && s !== this.activeIndex && (this.activeIndex = s, this.syncActiveTab(), this.emitEvent("change", { activeIndex: this.activeIndex }));
|
|
140
|
+
}
|
|
141
|
+
}, this.handleKeyDown = (t) => {
|
|
142
|
+
const e = this.tabs.filter((r) => !r.disabled);
|
|
143
|
+
if (e.length === 0) return;
|
|
144
|
+
const s = this.tabs[this.activeIndex], n = e.indexOf(s);
|
|
145
|
+
let i = -1;
|
|
146
|
+
if (t.key === "ArrowRight" ? (t.preventDefault(), i = n < e.length - 1 ? n + 1 : 0) : t.key === "ArrowLeft" ? (t.preventDefault(), i = n > 0 ? n - 1 : e.length - 1) : t.key === "Home" ? (t.preventDefault(), i = 0) : t.key === "End" && (t.preventDefault(), i = e.length - 1), i !== -1 && e[i]) {
|
|
147
|
+
const r = e[i];
|
|
148
|
+
this.activeIndex = this.tabs.indexOf(r), this.syncActiveTab(), r.focus(), this.emitEvent("change", { activeIndex: this.activeIndex });
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
connectedCallback() {
|
|
153
|
+
super.connectedCallback(), this.setAttribute("role", "tablist"), this.addEventListener("click", this.handleClick), this.addEventListener("keydown", this.handleKeyDown);
|
|
154
|
+
}
|
|
155
|
+
disconnectedCallback() {
|
|
156
|
+
super.disconnectedCallback(), this.removeEventListener("click", this.handleClick), this.removeEventListener("keydown", this.handleKeyDown);
|
|
157
|
+
}
|
|
158
|
+
updated(t) {
|
|
159
|
+
super.updated(t), t.has("activeIndex") && this.syncActiveTab();
|
|
160
|
+
}
|
|
161
|
+
syncActiveTab() {
|
|
162
|
+
!this.tabs || this.tabs.length === 0 || (this.tabs.forEach((t, e) => {
|
|
163
|
+
t.active = e === this.activeIndex;
|
|
164
|
+
}), this.updateIndicator());
|
|
165
|
+
}
|
|
166
|
+
updateIndicator() {
|
|
167
|
+
if (!this.indicatorElement || !this.tabs || this.tabs.length === 0) return;
|
|
168
|
+
const t = this.tabs[this.activeIndex];
|
|
169
|
+
if (t) {
|
|
170
|
+
const e = this.getBoundingClientRect(), s = t.getBoundingClientRect(), n = s.left - e.left, i = s.width;
|
|
171
|
+
this.indicatorElement.style.transform = `translateX(${n}px)`, this.indicatorElement.style.width = `${i}px`;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
render() {
|
|
175
|
+
return p`
|
|
176
|
+
<div class="tabs-container">
|
|
177
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
178
|
+
<div class="indicator"></div>
|
|
179
|
+
</div>
|
|
180
|
+
`;
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
l.styles = [d.styles, y];
|
|
184
|
+
a([
|
|
185
|
+
c({ type: Number, reflect: !0, attribute: "active-index" })
|
|
186
|
+
], l.prototype, "activeIndex", 2);
|
|
187
|
+
a([
|
|
188
|
+
v({ selector: "md-tab" })
|
|
189
|
+
], l.prototype, "tabs", 2);
|
|
190
|
+
a([
|
|
191
|
+
m(".indicator")
|
|
192
|
+
], l.prototype, "indicatorElement", 2);
|
|
193
|
+
l = a([
|
|
194
|
+
f("md-tabs")
|
|
195
|
+
], l);
|
|
196
|
+
export {
|
|
197
|
+
o as MdTab,
|
|
198
|
+
l as MdTabs
|
|
199
|
+
};
|
|
200
|
+
//# sourceMappingURL=tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.js","sources":["../../../src/components/tabs/tabs.css.ts","../../../src/components/tabs/tabs.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const tabsStyles = css`\n :host {\n display: flex;\n position: relative;\n box-sizing: border-box;\n border-bottom: 1px solid var(--md-sys-color-surface-variant, #E7E0EC);\n overflow-x: auto;\n scrollbar-width: none; /* Firefox */\n }\n\n :host::-webkit-scrollbar {\n display: none; /* Safari and Chrome */\n }\n\n .tabs-container {\n display: flex;\n position: relative;\n width: 100%;\n }\n\n .indicator {\n position: absolute;\n bottom: 0;\n height: 3px;\n background-color: var(--md-sys-color-primary, #6750A4);\n border-radius: 3px 3px 0 0;\n transition: transform 250ms cubic-bezier(0.2, 0, 0, 1),\n width 250ms cubic-bezier(0.2, 0, 0, 1);\n pointer-events: none;\n }\n`;\n\nexport const tabStyles = css`\n :host {\n display: inline-flex;\n flex: 1;\n min-width: 90px;\n height: 48px;\n outline: none;\n cursor: pointer;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n }\n\n :host([disabled]) {\n pointer-events: none;\n opacity: 0.38;\n }\n\n .tab {\n position: relative;\n display: inline-flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n padding: 0 16px;\n gap: 8px;\n font-family: var(--md-sys-typescale-font-family, inherit);\n font-size: var(--md-sys-typescale-title-small-size, 14px);\n font-weight: 500;\n line-height: 20px;\n letter-spacing: 0.1px;\n color: var(--md-sys-color-on-surface-variant, #49454F);\n transition: color 150ms cubic-bezier(0.2, 0, 0, 1);\n }\n\n :host([active]) .tab {\n color: var(--md-sys-color-primary, #6750A4);\n }\n\n .content {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n position: relative;\n z-index: 1;\n }\n`;\n\n","import { html, nothing } from 'lit';\nimport { customElement, property, query, queryAssignedElements } from 'lit/decorators.js';\nimport { MdBaseElement } from '../../internal/base-component.js';\nimport '../../internal/ripple/ripple.js';\nimport '../../internal/focus-ring/focus-ring.js';\nimport '../icon/icon.js';\nimport { tabsStyles, tabStyles } from './tabs.css.js';\n\n@customElement('md-tab')\nexport class MdTab extends MdBaseElement {\n static override styles = [MdBaseElement.styles, tabStyles];\n\n @property({ type: Boolean, reflect: true })\n active = false;\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n @property({ type: String })\n icon = '';\n\n @property({ type: String })\n label = '';\n\n override connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'tab');\n this.setAttribute('aria-selected', this.active ? 'true' : 'false');\n this.tabIndex = this.active ? 0 : -1;\n }\n\n override updated(changedProperties: Map<string, unknown>) {\n super.updated(changedProperties);\n if (changedProperties.has('active')) {\n this.setAttribute('aria-selected', this.active ? 'true' : 'false');\n this.tabIndex = this.active ? 0 : -1;\n }\n }\n\n override render() {\n return html`\n <div class=\"tab\">\n <md-ripple ?disabled=${this.disabled}></md-ripple>\n <md-focus-ring></md-focus-ring>\n <span class=\"content\">\n <slot name=\"icon\">\n ${this.icon ? html`<md-icon name=${this.icon}></md-icon>` : nothing}\n </slot>\n <slot>${this.label}</slot>\n </span>\n </div>\n `;\n }\n}\n\n@customElement('md-tabs')\nexport class MdTabs extends MdBaseElement {\n static override styles = [MdBaseElement.styles, tabsStyles];\n\n @property({ type: Number, reflect: true, attribute: 'active-index' })\n activeIndex = 0;\n\n @queryAssignedElements({ selector: 'md-tab' })\n private tabs!: MdTab[];\n\n @query('.indicator')\n private indicatorElement?: HTMLElement;\n\n override connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'tablist');\n this.addEventListener('click', this.handleClick);\n this.addEventListener('keydown', this.handleKeyDown);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.handleClick);\n this.removeEventListener('keydown', this.handleKeyDown);\n }\n\n override updated(changedProperties: Map<string, unknown>) {\n super.updated(changedProperties);\n if (changedProperties.has('activeIndex')) {\n this.syncActiveTab();\n }\n }\n\n private handleSlotChange = () => {\n this.syncActiveTab();\n };\n\n private syncActiveTab() {\n if (!this.tabs || this.tabs.length === 0) return;\n\n this.tabs.forEach((tab, index) => {\n tab.active = index === this.activeIndex;\n });\n\n this.updateIndicator();\n }\n\n private updateIndicator() {\n if (!this.indicatorElement || !this.tabs || this.tabs.length === 0) return;\n\n const activeTab = this.tabs[this.activeIndex];\n if (activeTab) {\n const parentRect = this.getBoundingClientRect();\n const tabRect = activeTab.getBoundingClientRect();\n const left = tabRect.left - parentRect.left;\n const width = tabRect.width;\n\n this.indicatorElement.style.transform = `translateX(${left}px)`;\n this.indicatorElement.style.width = `${width}px`;\n }\n }\n\n private handleClick = (event: MouseEvent) => {\n const target = (event.target as HTMLElement).closest('md-tab') as MdTab | null;\n if (target && !target.disabled) {\n const index = this.tabs.indexOf(target);\n if (index !== -1 && index !== this.activeIndex) {\n this.activeIndex = index;\n this.syncActiveTab();\n this.emitEvent('change', { activeIndex: this.activeIndex });\n }\n }\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n const enabledTabs = this.tabs.filter((t) => !t.disabled);\n if (enabledTabs.length === 0) return;\n\n const currentTab = this.tabs[this.activeIndex];\n const currentIndex = enabledTabs.indexOf(currentTab!);\n\n let nextIndex = -1;\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n nextIndex = currentIndex < enabledTabs.length - 1 ? currentIndex + 1 : 0;\n } else if (event.key === 'ArrowLeft') {\n event.preventDefault();\n nextIndex = currentIndex > 0 ? currentIndex - 1 : enabledTabs.length - 1;\n } else if (event.key === 'Home') {\n event.preventDefault();\n nextIndex = 0;\n } else if (event.key === 'End') {\n event.preventDefault();\n nextIndex = enabledTabs.length - 1;\n }\n\n if (nextIndex !== -1 && enabledTabs[nextIndex]) {\n const targetTab = enabledTabs[nextIndex]!;\n this.activeIndex = this.tabs.indexOf(targetTab);\n this.syncActiveTab();\n targetTab.focus();\n this.emitEvent('change', { activeIndex: this.activeIndex });\n }\n };\n\n override render() {\n return html`\n <div class=\"tabs-container\">\n <slot @slotchange=${this.handleSlotChange}></slot>\n <div class=\"indicator\"></div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-tab': MdTab;\n 'md-tabs': MdTabs;\n }\n}\n\n"],"names":["tabsStyles","css","tabStyles","MdTab","MdBaseElement","changedProperties","html","nothing","__decorateClass","property","customElement","MdTabs","event","target","index","enabledTabs","t","currentTab","currentIndex","nextIndex","targetTab","tab","activeTab","parentRect","tabRect","left","width","queryAssignedElements","query"],"mappings":";;;;;;AAEO,MAAMA,IAAaC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AOD,EAAW,MACjCG,IAAQF,EAAQ;AAEtB,WAAK,iBAAiB,MAAM,YAAY,cAAcC,CAAI,OAC1D,KAAK,iBAAiB,MAAM,QAAQ,GAAGC,CAAK;AAAA,IAC9C;AAAA,EACF;AAAA,EA6CS,SAAS;AAChB,WAAOpB;AAAA;AAAA,4BAEiB,KAAK,gBAAgB;AAAA;AAAA;AAAA;AAAA,EAI/C;AACF;AAhHaK,EACK,SAAS,CAACP,EAAc,QAAQJ,CAAU;AAG1DQ,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM,WAAW,gBAAgB;AAAA,GAHzDE,EAIX,WAAA,eAAA,CAAA;AAGQH,EAAA;AAAA,EADPmB,EAAsB,EAAE,UAAU,SAAA,CAAU;AAAA,GANlChB,EAOH,WAAA,QAAA,CAAA;AAGAH,EAAA;AAAA,EADPoB,EAAM,YAAY;AAAA,GATRjB,EAUH,WAAA,oBAAA,CAAA;AAVGA,IAANH,EAAA;AAAA,EADNE,EAAc,SAAS;AAAA,GACXC,CAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-field.css.d.ts","sourceRoot":"","sources":["../../../src/components/text-field/text-field.css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,yBA+K3B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { MdFormAssociatedElement } from '../../internal/form-associated.js';
|
|
2
|
+
export type TextFieldVariant = 'filled' | 'outlined';
|
|
3
|
+
export declare class MdTextField extends MdFormAssociatedElement {
|
|
4
|
+
static styles: import('lit').CSSResultGroup[];
|
|
5
|
+
variant: TextFieldVariant;
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
placeholder: string;
|
|
9
|
+
type: string;
|
|
10
|
+
readonly: boolean;
|
|
11
|
+
error: boolean;
|
|
12
|
+
errorText: string;
|
|
13
|
+
supportingText: string;
|
|
14
|
+
prefixText: string;
|
|
15
|
+
suffixText: string;
|
|
16
|
+
maxLength: number;
|
|
17
|
+
pattern: string;
|
|
18
|
+
leadingIcon: string;
|
|
19
|
+
trailingIcon: string;
|
|
20
|
+
private focused;
|
|
21
|
+
private inputElement?;
|
|
22
|
+
private assignedLeadingIcons;
|
|
23
|
+
connectedCallback(): void;
|
|
24
|
+
willUpdate(changedProperties: Map<string, unknown>): void;
|
|
25
|
+
updated(changedProperties: Map<string, unknown>): void;
|
|
26
|
+
formResetCallback(): void;
|
|
27
|
+
private handleFocus;
|
|
28
|
+
private handleBlur;
|
|
29
|
+
private handleInput;
|
|
30
|
+
private handleChange;
|
|
31
|
+
private validateInput;
|
|
32
|
+
private handleSlotChange;
|
|
33
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
34
|
+
}
|
|
35
|
+
declare global {
|
|
36
|
+
interface HTMLElementTagNameMap {
|
|
37
|
+
'md-text-field': MdTextField;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=text-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../../src/components/text-field/text-field.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,iCAAiC,CAAC;AACzC,OAAO,iBAAiB,CAAC;AAGzB,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAErD,qBACa,WAAY,SAAQ,uBAAuB;IACtD,OAAgB,MAAM,iCAAqD;IAG3E,OAAO,EAAE,gBAAgB,CAAY;IAGrC,KAAK,SAAM;IAGX,KAAK,SAAM;IAGX,WAAW,SAAM;IAGjB,IAAI,SAAU;IAGd,QAAQ,UAAS;IAGjB,KAAK,UAAS;IAGd,SAAS,SAAM;IAGf,cAAc,SAAM;IAGpB,UAAU,SAAM;IAGhB,UAAU,SAAM;IAGhB,SAAS,SAAM;IAGf,OAAO,SAAM;IAGb,WAAW,SAAM;IAGjB,YAAY,SAAM;IAGlB,OAAO,CAAC,OAAO,CAAS;IAGxB,OAAO,CAAC,YAAY,CAAC,CAAmB;IAGxC,OAAO,CAAC,oBAAoB,CAAiB;IAEpC,iBAAiB;IAKjB,UAAU,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IASlD,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAO/C,iBAAiB;IAM1B,OAAO,CAAC,WAAW,CAGjB;IAEF,OAAO,CAAC,UAAU,CAIhB;IAEF,OAAO,CAAC,WAAW,CAKjB;IAEF,OAAO,CAAC,YAAY,CAElB;IAEF,OAAO,CAAC,aAAa;IAiBrB,OAAO,CAAC,gBAAgB;IAKf,MAAM;CAiDhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,WAAW,CAAC;KAC9B;CACF"}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { css as u, nothing as a, html as o } from "lit";
|
|
2
|
+
import { property as i, state as f, query as g, queryAssignedElements as m, customElement as x } from "lit/decorators.js";
|
|
3
|
+
import { M as c } from "../../chunks/form-associated-fKbeX_2P.js";
|
|
4
|
+
import "../../internal/ripple/ripple.js";
|
|
5
|
+
import "../icon/icon.js";
|
|
6
|
+
const v = u`
|
|
7
|
+
:host {
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
min-width: 240px;
|
|
11
|
+
vertical-align: top;
|
|
12
|
+
font-family: var(--md-sys-typescale-font-family, inherit);
|
|
13
|
+
-webkit-tap-highlight-color: transparent;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([disabled]) {
|
|
17
|
+
pointer-events: none;
|
|
18
|
+
opacity: 0.38;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.container {
|
|
22
|
+
position: relative;
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
min-height: 56px;
|
|
26
|
+
padding: 0 16px;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
transition: background-color 150ms cubic-bezier(0.2, 0, 0, 1),
|
|
29
|
+
border-color 150ms cubic-bezier(0.2, 0, 0, 1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* --- Filled Variant (Default) --- */
|
|
33
|
+
:host(:not([variant])) .container,
|
|
34
|
+
:host([variant="filled"]) .container {
|
|
35
|
+
background-color: var(--md-sys-color-surface-container-highest, #E6E0E9);
|
|
36
|
+
border-radius: var(--md-sys-shape-corner-extra-small, 4px) var(--md-sys-shape-corner-extra-small, 4px) 0 0;
|
|
37
|
+
border-bottom: 1px solid var(--md-sys-color-on-surface-variant, #49454F);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:host(:not([variant])[focused]) .container,
|
|
41
|
+
:host([variant="filled"][focused]) .container {
|
|
42
|
+
border-bottom: 2px solid var(--md-sys-color-primary, #6750A4);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host(:not([variant])[error]) .container,
|
|
46
|
+
:host([variant="filled"][error]) .container {
|
|
47
|
+
border-bottom-color: var(--md-sys-color-error, #B3261E);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* --- Outlined Variant --- */
|
|
51
|
+
:host([variant="outlined"]) .container {
|
|
52
|
+
background-color: transparent;
|
|
53
|
+
border: 1px solid var(--md-sys-color-outline, #79747E);
|
|
54
|
+
border-radius: var(--md-sys-shape-corner-extra-small, 4px);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host([variant="outlined"][focused]) .container {
|
|
58
|
+
border: 2px solid var(--md-sys-color-primary, #6750A4);
|
|
59
|
+
padding: 0 15px; /* Offset for 2px border */
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host([variant="outlined"][error]) .container {
|
|
63
|
+
border-color: var(--md-sys-color-error, #B3261E);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Floating Label */
|
|
67
|
+
.label {
|
|
68
|
+
position: absolute;
|
|
69
|
+
left: 16px;
|
|
70
|
+
top: 50%;
|
|
71
|
+
transform: translateY(-50%);
|
|
72
|
+
font-size: 16px;
|
|
73
|
+
color: var(--md-sys-color-on-surface-variant, #49454F);
|
|
74
|
+
pointer-events: none;
|
|
75
|
+
transition: transform 150ms cubic-bezier(0.2, 0, 0, 1),
|
|
76
|
+
font-size 150ms cubic-bezier(0.2, 0, 0, 1),
|
|
77
|
+
color 150ms cubic-bezier(0.2, 0, 0, 1);
|
|
78
|
+
transform-origin: top left;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:host([has-leading-icon]) .label {
|
|
82
|
+
left: 48px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:host([focused]) .label,
|
|
86
|
+
:host([has-value]) .label,
|
|
87
|
+
:host([has-placeholder]) .label {
|
|
88
|
+
transform: translateY(-110%) scale(0.75);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:host([variant="filled"][focused]) .label,
|
|
92
|
+
:host([variant="filled"][has-value]) .label,
|
|
93
|
+
:host([variant="filled"][has-placeholder]) .label {
|
|
94
|
+
top: 35%;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:host([variant="outlined"][focused]) .label,
|
|
98
|
+
:host([variant="outlined"][has-value]) .label,
|
|
99
|
+
:host([variant="outlined"][has-placeholder]) .label {
|
|
100
|
+
top: 0;
|
|
101
|
+
left: 12px;
|
|
102
|
+
background-color: var(--md-sys-color-surface, #FEF7FF);
|
|
103
|
+
padding: 0 4px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
:host([focused]) .label {
|
|
107
|
+
color: var(--md-sys-color-primary, #6750A4);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:host([error]) .label {
|
|
111
|
+
color: var(--md-sys-color-error, #B3261E);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.input-wrapper {
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
flex: 1;
|
|
118
|
+
height: 100%;
|
|
119
|
+
min-width: 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:host(:not([variant])) .input-wrapper,
|
|
123
|
+
:host([variant="filled"]) .input-wrapper {
|
|
124
|
+
padding-top: 18px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
input {
|
|
128
|
+
flex: 1;
|
|
129
|
+
width: 100%;
|
|
130
|
+
border: none;
|
|
131
|
+
outline: none;
|
|
132
|
+
background: transparent;
|
|
133
|
+
font-family: inherit;
|
|
134
|
+
font-size: 16px;
|
|
135
|
+
line-height: 24px;
|
|
136
|
+
color: var(--md-sys-color-on-surface, #1D1B20);
|
|
137
|
+
padding: 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
input::placeholder {
|
|
141
|
+
color: var(--md-sys-color-on-surface-variant, #49454F);
|
|
142
|
+
opacity: 0.6;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.affix {
|
|
146
|
+
font-size: 16px;
|
|
147
|
+
color: var(--md-sys-color-on-surface-variant, #49454F);
|
|
148
|
+
user-select: none;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.prefix { margin-right: 4px; }
|
|
152
|
+
.suffix { margin-left: 4px; }
|
|
153
|
+
|
|
154
|
+
.icon-slot {
|
|
155
|
+
display: inline-flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
justify-content: center;
|
|
158
|
+
color: var(--md-sys-color-on-surface-variant, #49454F);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.leading-icon { margin-right: 12px; }
|
|
162
|
+
.trailing-icon { margin-left: 12px; }
|
|
163
|
+
|
|
164
|
+
:host([error]) .trailing-icon {
|
|
165
|
+
color: var(--md-sys-color-error, #B3261E);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* Supporting / Error text */
|
|
169
|
+
.supporting-text {
|
|
170
|
+
display: flex;
|
|
171
|
+
justify-content: space-between;
|
|
172
|
+
padding: 4px 16px 0;
|
|
173
|
+
font-size: 12px;
|
|
174
|
+
line-height: 16px;
|
|
175
|
+
color: var(--md-sys-color-on-surface-variant, #49454F);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
:host([error]) .supporting-text {
|
|
179
|
+
color: var(--md-sys-color-error, #B3261E);
|
|
180
|
+
}
|
|
181
|
+
`;
|
|
182
|
+
var y = Object.defineProperty, b = Object.getOwnPropertyDescriptor, e = (r, n, p, l) => {
|
|
183
|
+
for (var s = l > 1 ? void 0 : l ? b(n, p) : n, h = r.length - 1, d; h >= 0; h--)
|
|
184
|
+
(d = r[h]) && (s = (l ? d(n, p, s) : d(s)) || s);
|
|
185
|
+
return l && s && y(n, p, s), s;
|
|
186
|
+
};
|
|
187
|
+
let t = class extends c {
|
|
188
|
+
constructor() {
|
|
189
|
+
super(...arguments), this.variant = "filled", this.label = "", this.value = "", this.placeholder = "", this.type = "text", this.readonly = !1, this.error = !1, this.errorText = "", this.supportingText = "", this.prefixText = "", this.suffixText = "", this.maxLength = -1, this.pattern = "", this.leadingIcon = "", this.trailingIcon = "", this.focused = !1, this.handleFocus = () => {
|
|
190
|
+
this.focused = !0, this.toggleAttribute("focused", !0);
|
|
191
|
+
}, this.handleBlur = () => {
|
|
192
|
+
this.focused = !1, this.toggleAttribute("focused", !1), this.validateInput();
|
|
193
|
+
}, this.handleInput = (r) => {
|
|
194
|
+
const n = r.target;
|
|
195
|
+
this.value = n.value, this.setFormValue(this.value), this.emitEvent("input", { value: this.value });
|
|
196
|
+
}, this.handleChange = () => {
|
|
197
|
+
this.emitEvent("change", { value: this.value });
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
connectedCallback() {
|
|
201
|
+
super.connectedCallback(), this.setFormValue(this.value);
|
|
202
|
+
}
|
|
203
|
+
willUpdate(r) {
|
|
204
|
+
super.willUpdate(r), r.has("value") && (this.setFormValue(this.value), this.toggleAttribute("has-value", !!this.value), this.validateInput());
|
|
205
|
+
}
|
|
206
|
+
updated(r) {
|
|
207
|
+
super.updated(r), r.has("placeholder") && this.toggleAttribute("has-placeholder", !!this.placeholder);
|
|
208
|
+
}
|
|
209
|
+
formResetCallback() {
|
|
210
|
+
this.value = "", this.error = !1, this.setFormValue(null);
|
|
211
|
+
}
|
|
212
|
+
validateInput() {
|
|
213
|
+
this.inputElement && (this.required && !this.value ? (this.setValidity({ valueMissing: !0 }, this.errorText || "This field is required"), this.error = !0) : this.pattern && !new RegExp(this.pattern).test(this.value) ? (this.setValidity({ patternMismatch: !0 }, this.errorText || "Invalid format"), this.error = !0) : (this.setValidity({}), this.errorText || (this.error = !1)));
|
|
214
|
+
}
|
|
215
|
+
handleSlotChange() {
|
|
216
|
+
const r = !!(this.leadingIcon || this.assignedLeadingIcons && this.assignedLeadingIcons.length > 0);
|
|
217
|
+
this.toggleAttribute("has-leading-icon", r);
|
|
218
|
+
}
|
|
219
|
+
render() {
|
|
220
|
+
const r = this.error ? this.errorText || this.supportingText : this.supportingText;
|
|
221
|
+
return o`
|
|
222
|
+
<div class="container" @click=${() => this.inputElement?.focus()}>
|
|
223
|
+
${this.variant === "filled" ? o`<md-ripple ?disabled=${this.disabled}></md-ripple>` : a}
|
|
224
|
+
|
|
225
|
+
<span class="icon-slot leading-icon">
|
|
226
|
+
<slot name="leading-icon" @slotchange=${this.handleSlotChange}>
|
|
227
|
+
${this.leadingIcon ? o`<md-icon name=${this.leadingIcon}></md-icon>` : a}
|
|
228
|
+
</slot>
|
|
229
|
+
</span>
|
|
230
|
+
|
|
231
|
+
<div class="input-wrapper">
|
|
232
|
+
${this.label ? o`<label class="label">${this.label}</label>` : a}
|
|
233
|
+
${this.prefixText ? o`<span class="affix prefix">${this.prefixText}</span>` : a}
|
|
234
|
+
<input
|
|
235
|
+
type=${this.type}
|
|
236
|
+
.value=${this.value}
|
|
237
|
+
placeholder=${this.focused || !this.label ? this.placeholder : ""}
|
|
238
|
+
?disabled=${this.disabled}
|
|
239
|
+
?readonly=${this.readonly}
|
|
240
|
+
?required=${this.required}
|
|
241
|
+
maxlength=${this.maxLength > 0 ? this.maxLength : a}
|
|
242
|
+
@focus=${this.handleFocus}
|
|
243
|
+
@blur=${this.handleBlur}
|
|
244
|
+
@input=${this.handleInput}
|
|
245
|
+
@change=${this.handleChange}
|
|
246
|
+
/>
|
|
247
|
+
${this.suffixText ? o`<span class="affix suffix">${this.suffixText}</span>` : a}
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
<span class="icon-slot trailing-icon">
|
|
251
|
+
<slot name="trailing-icon">
|
|
252
|
+
${this.error ? o`<md-icon name="error" filled></md-icon>` : this.trailingIcon ? o`<md-icon name=${this.trailingIcon}></md-icon>` : a}
|
|
253
|
+
</slot>
|
|
254
|
+
</span>
|
|
255
|
+
</div>
|
|
256
|
+
|
|
257
|
+
${r || this.maxLength > 0 ? o`
|
|
258
|
+
<div class="supporting-text">
|
|
259
|
+
<span>${r}</span>
|
|
260
|
+
${this.maxLength > 0 ? o`<span>${this.value.length} / ${this.maxLength}</span>` : a}
|
|
261
|
+
</div>
|
|
262
|
+
` : a}
|
|
263
|
+
`;
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
t.styles = [c.styles, v];
|
|
267
|
+
e([
|
|
268
|
+
i({ type: String, reflect: !0 })
|
|
269
|
+
], t.prototype, "variant", 2);
|
|
270
|
+
e([
|
|
271
|
+
i({ type: String })
|
|
272
|
+
], t.prototype, "label", 2);
|
|
273
|
+
e([
|
|
274
|
+
i({ type: String })
|
|
275
|
+
], t.prototype, "value", 2);
|
|
276
|
+
e([
|
|
277
|
+
i({ type: String })
|
|
278
|
+
], t.prototype, "placeholder", 2);
|
|
279
|
+
e([
|
|
280
|
+
i({ type: String })
|
|
281
|
+
], t.prototype, "type", 2);
|
|
282
|
+
e([
|
|
283
|
+
i({ type: Boolean, reflect: !0 })
|
|
284
|
+
], t.prototype, "readonly", 2);
|
|
285
|
+
e([
|
|
286
|
+
i({ type: Boolean, reflect: !0 })
|
|
287
|
+
], t.prototype, "error", 2);
|
|
288
|
+
e([
|
|
289
|
+
i({ type: String, attribute: "error-text" })
|
|
290
|
+
], t.prototype, "errorText", 2);
|
|
291
|
+
e([
|
|
292
|
+
i({ type: String, attribute: "supporting-text" })
|
|
293
|
+
], t.prototype, "supportingText", 2);
|
|
294
|
+
e([
|
|
295
|
+
i({ type: String, attribute: "prefix-text" })
|
|
296
|
+
], t.prototype, "prefixText", 2);
|
|
297
|
+
e([
|
|
298
|
+
i({ type: String, attribute: "suffix-text" })
|
|
299
|
+
], t.prototype, "suffixText", 2);
|
|
300
|
+
e([
|
|
301
|
+
i({ type: Number, attribute: "maxlength" })
|
|
302
|
+
], t.prototype, "maxLength", 2);
|
|
303
|
+
e([
|
|
304
|
+
i({ type: String })
|
|
305
|
+
], t.prototype, "pattern", 2);
|
|
306
|
+
e([
|
|
307
|
+
i({ type: String, attribute: "leading-icon" })
|
|
308
|
+
], t.prototype, "leadingIcon", 2);
|
|
309
|
+
e([
|
|
310
|
+
i({ type: String, attribute: "trailing-icon" })
|
|
311
|
+
], t.prototype, "trailingIcon", 2);
|
|
312
|
+
e([
|
|
313
|
+
f()
|
|
314
|
+
], t.prototype, "focused", 2);
|
|
315
|
+
e([
|
|
316
|
+
g("input")
|
|
317
|
+
], t.prototype, "inputElement", 2);
|
|
318
|
+
e([
|
|
319
|
+
m({ slot: "leading-icon" })
|
|
320
|
+
], t.prototype, "assignedLeadingIcons", 2);
|
|
321
|
+
t = e([
|
|
322
|
+
x("md-text-field")
|
|
323
|
+
], t);
|
|
324
|
+
export {
|
|
325
|
+
t as MdTextField
|
|
326
|
+
};
|
|
327
|
+
//# sourceMappingURL=text-field.js.map
|