@material/web 1.1.1 → 1.1.2-nightly.422f105.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/README.md +1 -0
- package/button/internal/button.js +1 -1
- package/button/internal/button.js.map +1 -1
- package/checkbox/internal/checkbox.js +1 -1
- package/checkbox/internal/checkbox.js.map +1 -1
- package/chips/internal/filter-chip.js +1 -1
- package/chips/internal/filter-chip.js.map +1 -1
- package/dialog/internal/dialog.js +1 -1
- package/dialog/internal/dialog.js.map +1 -1
- package/labs/card/internal/_outlined-card.scss +3 -2
- package/labs/card/internal/_shared.scss +17 -4
- package/labs/card/internal/card.js +2 -1
- package/labs/card/internal/card.js.map +1 -1
- package/labs/card/internal/outlined-styles.css.js +1 -1
- package/labs/card/internal/outlined-styles.css.js.map +1 -1
- package/labs/card/internal/shared-styles.css.js +1 -1
- package/labs/card/internal/shared-styles.css.js.map +1 -1
- package/menu/internal/_menu.scss +1 -0
- package/menu/internal/menu-styles.css.js +1 -1
- package/menu/internal/menu-styles.css.js.map +1 -1
- package/package.json +21 -9
- package/radio/internal/radio.js +1 -1
- package/radio/internal/radio.js.map +1 -1
- package/ripple/internal/ripple.js +11 -0
- package/ripple/internal/ripple.js.map +1 -1
- package/select/internal/select.d.ts +1 -1
- package/select/internal/select.js +1 -1
- package/select/internal/select.js.map +1 -1
- package/select/internal/selectoption/select-option.d.ts +26 -1
- package/select/internal/selectoption/select-option.js.map +1 -1
- package/select/internal/selectoption/selectOptionController.d.ts +2 -26
- package/select/internal/selectoption/selectOptionController.js.map +1 -1
- package/select/internal/shared.d.ts +1 -1
- package/select/internal/shared.js.map +1 -1
- package/select/select-option.d.ts +1 -0
- package/select/select-option.js.map +1 -1
- package/slider/internal/slider.js +1 -1
- package/slider/internal/slider.js.map +1 -1
- package/switch/internal/switch.js +1 -1
- package/switch/internal/switch.js.map +1 -1
- package/tabs/internal/_tab.scss +7 -5
- package/tabs/internal/tab-styles.css.js +1 -1
- package/tabs/internal/tab-styles.css.js.map +1 -1
- package/textfield/internal/_input.scss +1 -1
- package/textfield/internal/shared-styles.css.js +1 -1
- package/textfield/internal/shared-styles.css.js.map +1 -1
- package/textfield/internal/text-field.d.ts +26 -0
- package/textfield/internal/text-field.js +27 -1
- package/textfield/internal/text-field.js.map +1 -1
- /package/internal/{controller → events}/events.d.ts +0 -0
- /package/internal/{controller → events}/events.js +0 -0
- /package/internal/{controller → events}/events.js.map +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.js","sourceRoot":"","sources":["slider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AACxE,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAG5C,OAAO,EAAC,yBAAyB,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,GAChB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAC,qBAAqB,EAAC,MAAM,2CAA2C,CAAC;AAChF,OAAO,EACL,YAAY,EACZ,mBAAmB,GACpB,MAAM,yCAAyC,CAAC;AAGjD,kDAAkD;AAClD,mDAAmD;AAEnD,wCAAwC;AACxC,MAAM,eAAe,GAAG,mBAAmB,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,CAAC;AAE/E;;;;;;;;;;GAUG;AACH,MAAM,OAAO,MAAO,SAAQ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,EAAC,CAAC,EAAE,CAAC,EAAe,EAAE,OAA4B;IAClE,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,KAAK,CAAC;KACd;IACD,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAC,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IACnE,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,MAAM,CAAC;AAC5D,CAAC;AAED,SAAS,aAAa,CACpB,GAA+B,EAC/B,GAA+B;IAE/B,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE;QACjB,OAAO,KAAK,CAAC;KACd;IACD,MAAM,CAAC,GAAG,GAAG,CAAC,qBAAqB,EAAE,CAAC;IACtC,MAAM,CAAC,GAAG,GAAG,CAAC,qBAAqB,EAAE,CAAC;IACtC,OAAO,CAAC,CACN,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM;QAChB,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI;QAChB,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG;QAChB,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,CACjB,CAAC;AACJ,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../elevation/elevation.js';\nimport '../../focus/md-focus-ring.js';\nimport '../../ripple/ripple.js';\n\nimport {html, isServer, LitElement, nothing, PropertyValues} from 'lit';\nimport {property, query, queryAsync, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {styleMap} from 'lit/directives/style-map.js';\nimport {when} from 'lit/directives/when.js';\n\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n redispatchEvent,\n} from '../../internal/controller/events.js';\nimport {mixinElementInternals} from '../../labs/behaviors/element-internals.js';\nimport {\n getFormValue,\n mixinFormAssociated,\n} from '../../labs/behaviors/form-associated.js';\nimport {MdRipple} from '../../ripple/ripple.js';\n\n// Disable warning for classMap with destructuring\n// tslint:disable:no-implicit-dictionary-conversion\n\n// Separate variable needed for closure.\nconst sliderBaseClass = mixinFormAssociated(mixinElementInternals(LitElement));\n\n/**\n * Slider component.\n *\n *\n * @fires change {Event} The native `change` event on\n * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event)\n * --bubbles\n * @fires input {InputEvent} The native `input` event on\n * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event)\n * --bubbles --composed\n */\nexport class Slider extends sliderBaseClass {\n static {\n requestUpdateOnAriaChange(Slider);\n }\n\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * The slider minimum value\n */\n @property({type: Number}) min = 0;\n\n /**\n * The slider maximum value\n */\n @property({type: Number}) max = 100;\n\n /**\n * The slider value displayed when range is false.\n */\n @property({type: Number}) value?: number;\n\n /**\n * The slider start value displayed when range is true.\n */\n @property({type: Number, attribute: 'value-start'}) valueStart?: number;\n\n /**\n * The slider end value displayed when range is true.\n */\n @property({type: Number, attribute: 'value-end'}) valueEnd?: number;\n\n /**\n * An optional label for the slider's value displayed when range is\n * false; if not set, the label is the value itself.\n */\n @property({attribute: 'value-label'}) valueLabel = '';\n\n /**\n * An optional label for the slider's start value displayed when\n * range is true; if not set, the label is the valueStart itself.\n */\n @property({attribute: 'value-label-start'}) valueLabelStart = '';\n\n /**\n * An optional label for the slider's end value displayed when\n * range is true; if not set, the label is the valueEnd itself.\n */\n @property({attribute: 'value-label-end'}) valueLabelEnd = '';\n\n /**\n * Aria label for the slider's start handle displayed when\n * range is true.\n */\n @property({attribute: 'aria-label-start'}) ariaLabelStart = '';\n\n /**\n * Aria value text for the slider's start value displayed when\n * range is true.\n */\n @property({attribute: 'aria-valuetext-start'}) ariaValueTextStart = '';\n\n /**\n * Aria label for the slider's end handle displayed when\n * range is true.\n */\n @property({attribute: 'aria-label-end'}) ariaLabelEnd = '';\n\n /**\n * Aria value text for the slider's end value displayed when\n * range is true.\n */\n @property({attribute: 'aria-valuetext-end'}) ariaValueTextEnd = '';\n\n /**\n * The step between values.\n */\n @property({type: Number}) step = 1;\n\n /**\n * Whether or not to show tick marks.\n */\n @property({type: Boolean}) ticks = false;\n\n /**\n * Whether or not to show a value label when activated.\n */\n @property({type: Boolean}) labeled = false;\n\n /**\n * Whether or not to show a value range. When false, the slider displays\n * a slideable handle for the value property; when true, it displays\n * slideable handles for the valueStart and valueEnd properties.\n */\n @property({type: Boolean}) range = false;\n\n /**\n * The HTML name to use in form submission for a range slider's starting\n * value. Use `name` instead if both the start and end values should use the\n * same name.\n */\n get nameStart() {\n return this.getAttribute('name-start') ?? this.name;\n }\n set nameStart(name: string) {\n this.setAttribute('name-start', name);\n }\n\n /**\n * The HTML name to use in form submission for a range slider's ending value.\n * Use `name` instead if both the start and end values should use the same\n * name.\n */\n get nameEnd() {\n return this.getAttribute('name-end') ?? this.nameStart;\n }\n set nameEnd(name: string) {\n this.setAttribute('name-end', name);\n }\n\n @query('input.start') private readonly inputStart!: HTMLInputElement | null;\n @query('.handle.start') private readonly handleStart!: HTMLDivElement | null;\n @queryAsync('md-ripple.start')\n private readonly rippleStart!: Promise<MdRipple | null>;\n\n @query('input.end') private readonly inputEnd!: HTMLInputElement | null;\n @query('.handle.end') private readonly handleEnd!: HTMLDivElement | null;\n @queryAsync('md-ripple.end')\n private readonly rippleEnd!: Promise<MdRipple | null>;\n\n // handle hover/pressed states are set manually since the handle\n // does not receive pointer events so that the native inputs are\n // interaction targets.\n @state() private handleStartHover = false;\n @state() private handleEndHover = false;\n\n @state() private startOnTop = false;\n @state() private handlesOverlapping = false;\n\n @state() private renderValueStart?: number;\n @state() private renderValueEnd?: number;\n\n // Note: start aria-* properties are only applied when range=true, which is\n // why they do not need to handle both cases.\n private get renderAriaLabelStart() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return (\n this.ariaLabelStart ||\n (ariaLabel && `${ariaLabel} start`) ||\n this.valueLabelStart ||\n String(this.valueStart)\n );\n }\n\n private get renderAriaValueTextStart() {\n return (\n this.ariaValueTextStart || this.valueLabelStart || String(this.valueStart)\n );\n }\n\n // Note: end aria-* properties are applied for single and range sliders, which\n // is why it needs to handle `this.range` (while start aria-* properties do\n // not).\n private get renderAriaLabelEnd() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n if (this.range) {\n return (\n this.ariaLabelEnd ||\n (ariaLabel && `${ariaLabel} end`) ||\n this.valueLabelEnd ||\n String(this.valueEnd)\n );\n }\n\n return ariaLabel || this.valueLabel || String(this.value);\n }\n\n private get renderAriaValueTextEnd() {\n if (this.range) {\n return (\n this.ariaValueTextEnd || this.valueLabelEnd || String(this.valueEnd)\n );\n }\n\n // Needed for conformance\n const {ariaValueText} = this as ARIAMixinStrict;\n return ariaValueText || this.valueLabel || String(this.value);\n }\n\n // used in synthetic events generated to control ripple hover state.\n private ripplePointerId = 1;\n\n // flag to prevent processing of re-dispatched input event.\n private isRedispatchingEvent = false;\n\n private action?: Action;\n\n constructor() {\n super();\n if (!isServer) {\n this.addEventListener('click', (event: MouseEvent) => {\n if (!isActivationClick(event) || !this.inputEnd) {\n return;\n }\n this.focus();\n dispatchActivationClick(this.inputEnd);\n });\n }\n }\n\n override focus() {\n this.inputEnd?.focus();\n }\n\n protected override willUpdate(changed: PropertyValues) {\n this.renderValueStart = changed.has('valueStart')\n ? this.valueStart\n : this.inputStart?.valueAsNumber;\n const endValueChanged =\n (changed.has('valueEnd') && this.range) || changed.has('value');\n this.renderValueEnd = endValueChanged\n ? this.range\n ? this.valueEnd\n : this.value\n : this.inputEnd?.valueAsNumber;\n // manually handle ripple hover state since the handle is pointer events\n // none.\n if (changed.get('handleStartHover') !== undefined) {\n this.toggleRippleHover(this.rippleStart, this.handleStartHover);\n } else if (changed.get('handleEndHover') !== undefined) {\n this.toggleRippleHover(this.rippleEnd, this.handleEndHover);\n }\n }\n\n protected override updated(changed: PropertyValues) {\n // Validate input rendered value and re-render if necessary. This ensures\n // the rendred handle stays in sync with the input thumb which is used for\n // interaction. These can get out of sync if a supplied value does not\n // map to an exactly stepped value between min and max.\n if (this.range) {\n this.renderValueStart = this.inputStart!.valueAsNumber;\n }\n this.renderValueEnd = this.inputEnd!.valueAsNumber;\n // update values if they are unset\n // when using a range, default to equi-distant between\n // min - valueStart - valueEnd - max\n if (this.range) {\n const segment = (this.max - this.min) / 3;\n if (this.valueStart === undefined) {\n this.inputStart!.valueAsNumber = this.min + segment;\n // read actual value from input\n const v = this.inputStart!.valueAsNumber;\n this.valueStart = this.renderValueStart = v;\n }\n if (this.valueEnd === undefined) {\n this.inputEnd!.valueAsNumber = this.min + 2 * segment;\n // read actual value from input\n const v = this.inputEnd!.valueAsNumber;\n this.valueEnd = this.renderValueEnd = v;\n }\n } else {\n this.value ??= this.renderValueEnd;\n }\n if (\n changed.has('range') ||\n changed.has('renderValueStart') ||\n changed.has('renderValueEnd') ||\n this.isUpdatePending\n ) {\n // Only check if the handle nubs are overlapping, as the ripple touch\n // target extends subtantially beyond the boundary of the handle nub.\n const startNub = this.handleStart?.querySelector('.handleNub');\n const endNub = this.handleEnd?.querySelector('.handleNub');\n this.handlesOverlapping = isOverlapping(startNub, endNub);\n }\n // called to finish the update imediately;\n // note, this is a no-op unless an update is scheduled\n this.performUpdate();\n }\n\n protected override render() {\n const step = this.step === 0 ? 1 : this.step;\n const range = Math.max(this.max - this.min, step);\n const startFraction = this.range\n ? ((this.renderValueStart ?? this.min) - this.min) / range\n : 0;\n const endFraction = ((this.renderValueEnd ?? this.min) - this.min) / range;\n const containerStyles = {\n // for clipping inputs and active track.\n '--_start-fraction': String(startFraction),\n '--_end-fraction': String(endFraction),\n // for generating tick marks\n '--_tick-count': String(range / step),\n };\n const containerClasses = {ranged: this.range};\n\n // optional label values to show in place of the value.\n const labelStart = this.valueLabelStart || String(this.renderValueStart);\n const labelEnd =\n (this.range ? this.valueLabelEnd : this.valueLabel) ||\n String(this.renderValueEnd);\n\n const inputStartProps = {\n start: true,\n value: this.renderValueStart,\n ariaLabel: this.renderAriaLabelStart,\n ariaValueText: this.renderAriaValueTextStart,\n ariaMin: this.min,\n ariaMax: this.valueEnd ?? this.max,\n };\n\n const inputEndProps = {\n start: false,\n value: this.renderValueEnd,\n ariaLabel: this.renderAriaLabelEnd,\n ariaValueText: this.renderAriaValueTextEnd,\n ariaMin: this.range ? this.valueStart ?? this.min : this.min,\n ariaMax: this.max,\n };\n\n const handleStartProps = {\n start: true,\n hover: this.handleStartHover,\n label: labelStart,\n };\n\n const handleEndProps = {\n start: false,\n hover: this.handleEndHover,\n label: labelEnd,\n };\n\n const handleContainerClasses = {\n hover: this.handleStartHover || this.handleEndHover,\n };\n\n return html` <div\n class=\"container ${classMap(containerClasses)}\"\n style=${styleMap(containerStyles)}>\n ${when(this.range, () => this.renderInput(inputStartProps))}\n ${this.renderInput(inputEndProps)} ${this.renderTrack()}\n <div class=\"handleContainerPadded\">\n <div class=\"handleContainerBlock\">\n <div class=\"handleContainer ${classMap(handleContainerClasses)}\">\n ${when(this.range, () => this.renderHandle(handleStartProps))}\n ${this.renderHandle(handleEndProps)}\n </div>\n </div>\n </div>\n </div>`;\n }\n\n private renderTrack() {\n return html`\n <div class=\"track\"></div>\n ${this.ticks ? html`<div class=\"tickmarks\"></div>` : nothing}\n `;\n }\n\n private renderLabel(value: string) {\n return html`<div class=\"label\" aria-hidden=\"true\">\n <span class=\"labelContent\" part=\"label\">${value}</span>\n </div>`;\n }\n\n private renderHandle({\n start,\n hover,\n label,\n }: {\n start: boolean;\n hover: boolean;\n label: string;\n }) {\n const onTop = !this.disabled && start === this.startOnTop;\n const isOverlapping = !this.disabled && this.handlesOverlapping;\n const name = start ? 'start' : 'end';\n return html`<div\n class=\"handle ${classMap({\n [name]: true,\n hover,\n onTop,\n isOverlapping,\n })}\">\n <div class=\"handleNub\"><md-elevation></md-elevation></div>\n ${when(this.labeled, () => this.renderLabel(label))}\n <md-focus-ring part=\"focus-ring\" for=${name}></md-focus-ring>\n <md-ripple\n for=${name}\n class=${name}\n ?disabled=${this.disabled}></md-ripple>\n </div>`;\n }\n\n private renderInput({\n start,\n value,\n ariaLabel,\n ariaValueText,\n ariaMin,\n ariaMax,\n }: {\n start: boolean;\n value?: number;\n ariaLabel: string;\n ariaValueText: string;\n ariaMin: number;\n ariaMax: number;\n }) {\n // Slider requires min/max set to the overall min/max for both inputs.\n // This is reported to screen readers, which is why we need aria-valuemin\n // and aria-valuemax.\n const name = start ? `start` : `end`;\n return html`<input\n type=\"range\"\n class=\"${classMap({\n start,\n end: !start,\n })}\"\n @focus=${this.handleFocus}\n @pointerdown=${this.handleDown}\n @pointerup=${this.handleUp}\n @pointerenter=${this.handleEnter}\n @pointermove=${this.handleMove}\n @pointerleave=${this.handleLeave}\n @keydown=${this.handleKeydown}\n @keyup=${this.handleKeyup}\n @input=${this.handleInput}\n @change=${this.handleChange}\n id=${name}\n .disabled=${this.disabled}\n .min=${String(this.min)}\n aria-valuemin=${ariaMin}\n .max=${String(this.max)}\n aria-valuemax=${ariaMax}\n .step=${String(this.step)}\n .value=${String(value)}\n .tabIndex=${start ? 1 : 0}\n aria-label=${ariaLabel || nothing}\n aria-valuetext=${ariaValueText} />`;\n }\n\n private async toggleRippleHover(\n ripple: Promise<MdRipple | null>,\n hovering: boolean,\n ) {\n const rippleEl = await ripple;\n if (!rippleEl) {\n return;\n }\n // TODO(b/269799771): improve slider ripple connection\n if (hovering) {\n rippleEl.handlePointerenter(\n new PointerEvent('pointerenter', {\n isPrimary: true,\n pointerId: this.ripplePointerId,\n }),\n );\n } else {\n rippleEl.handlePointerleave(\n new PointerEvent('pointerleave', {\n isPrimary: true,\n pointerId: this.ripplePointerId,\n }),\n );\n }\n }\n\n private handleFocus(event: Event) {\n this.updateOnTop(event.target as HTMLInputElement);\n }\n\n private startAction(event: Event) {\n const target = event.target as HTMLInputElement;\n const fixed =\n target === this.inputStart ? this.inputEnd! : this.inputStart!;\n this.action = {\n canFlip: event.type === 'pointerdown',\n flipped: false,\n target,\n fixed,\n values: new Map([\n [target, target.valueAsNumber],\n [fixed, fixed?.valueAsNumber],\n ]),\n };\n }\n\n private finishAction(event: Event) {\n this.action = undefined;\n }\n\n private handleKeydown(event: KeyboardEvent) {\n this.startAction(event);\n }\n\n private handleKeyup(event: KeyboardEvent) {\n this.finishAction(event);\n }\n\n private handleDown(event: PointerEvent) {\n this.startAction(event);\n this.ripplePointerId = event.pointerId;\n const isStart = (event.target as HTMLInputElement) === this.inputStart;\n // Since handle moves to pointer on down and there may not be a move,\n // it needs to be considered hovered..\n this.handleStartHover =\n !this.disabled && isStart && Boolean(this.handleStart);\n this.handleEndHover = !this.disabled && !isStart && Boolean(this.handleEnd);\n }\n\n private async handleUp(event: PointerEvent) {\n if (!this.action) {\n return;\n }\n\n const {target, values, flipped} = this.action;\n // Async here for Firefox because input can be after pointerup\n // when value is calmped.\n await new Promise(requestAnimationFrame);\n if (target !== undefined) {\n // Ensure Safari focuses input so label renders.\n // Ensure any flipped input is focused so the tab order is right.\n target.focus();\n // When action is flipped, change must be fired manually since the\n // real event target did not change.\n if (flipped && target.valueAsNumber !== values.get(target)!) {\n target.dispatchEvent(new Event('change', {bubbles: true}));\n }\n }\n this.finishAction(event);\n }\n\n /**\n * The move handler tracks handle hovering to facilitate proper ripple\n * behavior on the slider handle. This is needed because user interaction with\n * the native input is leveraged to position the handle. Because the separate\n * displayed handle element has pointer events disabled (to allow interaction\n * with the input) and the input's handle is a pseudo-element, neither can be\n * the ripple's interactive element. Therefore the input is the ripple's\n * interactive element and has a `ripple` directive; however the ripple\n * is gated on the handle being hovered. In addition, because the ripple\n * hover state is being specially handled, it must be triggered independent\n * of the directive. This is done based on the hover state when the\n * slider is updated.\n */\n private handleMove(event: PointerEvent) {\n this.handleStartHover = !this.disabled && inBounds(event, this.handleStart);\n this.handleEndHover = !this.disabled && inBounds(event, this.handleEnd);\n }\n\n private handleEnter(event: PointerEvent) {\n this.handleMove(event);\n }\n\n private handleLeave() {\n this.handleStartHover = false;\n this.handleEndHover = false;\n }\n\n private updateOnTop(input: HTMLInputElement) {\n this.startOnTop = input.classList.contains('start');\n }\n\n private needsClamping() {\n if (!this.action) {\n return false;\n }\n\n const {target, fixed} = this.action;\n const isStart = target === this.inputStart;\n return isStart\n ? target.valueAsNumber > fixed.valueAsNumber\n : target.valueAsNumber < fixed.valueAsNumber;\n }\n\n // if start/end start coincident and the first drag input would e.g. move\n // start > end, avoid clamping and \"flip\" to use the other input\n // as the action target.\n private isActionFlipped() {\n const {action} = this;\n if (!action) {\n return false;\n }\n\n const {target, fixed, values} = action;\n if (action.canFlip) {\n const coincident = values.get(target) === values.get(fixed);\n if (coincident && this.needsClamping()) {\n action.canFlip = false;\n action.flipped = true;\n action.target = fixed;\n action.fixed = target;\n }\n }\n return action.flipped;\n }\n\n // when flipped, apply the drag input to the flipped target and reset\n // the actual target.\n private flipAction() {\n if (!this.action) {\n return false;\n }\n\n const {target, fixed, values} = this.action;\n const changed = target.valueAsNumber !== fixed.valueAsNumber;\n target.valueAsNumber = fixed.valueAsNumber;\n fixed.valueAsNumber = values.get(fixed)!;\n return changed;\n }\n\n // clamp such that start does not move beyond end and visa versa.\n private clampAction() {\n if (!this.needsClamping() || !this.action) {\n return false;\n }\n const {target, fixed} = this.action;\n target.valueAsNumber = fixed.valueAsNumber;\n return true;\n }\n\n private handleInput(event: InputEvent) {\n // avoid processing a re-dispatched event\n if (this.isRedispatchingEvent) {\n return;\n }\n let stopPropagation = false;\n let redispatch = false;\n if (this.range) {\n if (this.isActionFlipped()) {\n stopPropagation = true;\n redispatch = this.flipAction();\n }\n if (this.clampAction()) {\n stopPropagation = true;\n redispatch = false;\n }\n }\n const target = event.target as HTMLInputElement;\n this.updateOnTop(target);\n // update value only on interaction\n if (this.range) {\n this.valueStart = this.inputStart!.valueAsNumber;\n this.valueEnd = this.inputEnd!.valueAsNumber;\n } else {\n this.value = this.inputEnd!.valueAsNumber;\n }\n // control external visibility of input event\n if (stopPropagation) {\n event.stopPropagation();\n }\n // ensure event path is correct when flipped.\n if (redispatch) {\n this.isRedispatchingEvent = true;\n redispatchEvent(target, event);\n this.isRedispatchingEvent = false;\n }\n }\n\n private handleChange(event: Event) {\n // prevent keyboard triggered changes from dispatching for\n // clamped values; note, this only occurs for keyboard\n const changeTarget = event.target as HTMLInputElement;\n const {target, values} = this.action ?? {};\n const squelch =\n target && target.valueAsNumber === values!.get(changeTarget)!;\n if (!squelch) {\n redispatchEvent(this, event);\n }\n // ensure keyboard triggered change clears action.\n this.finishAction(event);\n }\n\n // Writable mixin properties for lit-html binding, needed for lit-analyzer\n declare disabled: boolean;\n declare name: string;\n\n override [getFormValue]() {\n if (this.range) {\n const data = new FormData();\n data.append(this.nameStart, String(this.valueStart));\n data.append(this.nameEnd, String(this.valueEnd));\n return data;\n }\n\n return String(this.value);\n }\n\n override formResetCallback() {\n if (this.range) {\n const valueStart = this.getAttribute('value-start');\n this.valueStart = valueStart !== null ? Number(valueStart) : undefined;\n const valueEnd = this.getAttribute('value-end');\n this.valueEnd = valueEnd !== null ? Number(valueEnd) : undefined;\n return;\n }\n const value = this.getAttribute('value');\n this.value = value !== null ? Number(value) : undefined;\n }\n\n override formStateRestoreCallback(\n state: string | Array<[string, string]> | null,\n ) {\n if (Array.isArray(state)) {\n const [[, valueStart], [, valueEnd]] = state;\n this.valueStart = Number(valueStart);\n this.valueEnd = Number(valueEnd);\n this.range = true;\n return;\n }\n\n this.value = Number(state);\n this.range = false;\n }\n}\n\nfunction inBounds({x, y}: PointerEvent, element?: HTMLElement | null) {\n if (!element) {\n return false;\n }\n const {top, left, bottom, right} = element.getBoundingClientRect();\n return x >= left && x <= right && y >= top && y <= bottom;\n}\n\nfunction isOverlapping(\n elA: Element | null | undefined,\n elB: Element | null | undefined,\n) {\n if (!(elA && elB)) {\n return false;\n }\n const a = elA.getBoundingClientRect();\n const b = elB.getBoundingClientRect();\n return !(\n a.top > b.bottom ||\n a.right < b.left ||\n a.bottom < b.top ||\n a.left > b.right\n );\n}\n\ninterface Action {\n canFlip: boolean;\n flipped: boolean;\n target: HTMLInputElement;\n fixed: HTMLInputElement;\n values: Map<HTMLInputElement | undefined, number | undefined>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"slider.js","sourceRoot":"","sources":["slider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AACxE,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAG5C,OAAO,EAAC,yBAAyB,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,GAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAC,qBAAqB,EAAC,MAAM,2CAA2C,CAAC;AAChF,OAAO,EACL,YAAY,EACZ,mBAAmB,GACpB,MAAM,yCAAyC,CAAC;AAGjD,kDAAkD;AAClD,mDAAmD;AAEnD,wCAAwC;AACxC,MAAM,eAAe,GAAG,mBAAmB,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,CAAC;AAE/E;;;;;;;;;;GAUG;AACH,MAAM,OAAO,MAAO,SAAQ,eAAe;IA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AC,EAAE,CAAC,EAAe,EAAE,OAA4B;IAClE,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,KAAK,CAAC;KACd;IACD,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAC,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IACnE,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,MAAM,CAAC;AAC5D,CAAC;AAED,SAAS,aAAa,CACpB,GAA+B,EAC/B,GAA+B;IAE/B,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE;QACjB,OAAO,KAAK,CAAC;KACd;IACD,MAAM,CAAC,GAAG,GAAG,CAAC,qBAAqB,EAAE,CAAC;IACtC,MAAM,CAAC,GAAG,GAAG,CAAC,qBAAqB,EAAE,CAAC;IACtC,OAAO,CAAC,CACN,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM;QAChB,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI;QAChB,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG;QAChB,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,CACjB,CAAC;AACJ,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../elevation/elevation.js';\nimport '../../focus/md-focus-ring.js';\nimport '../../ripple/ripple.js';\n\nimport {html, isServer, LitElement, nothing, PropertyValues} from 'lit';\nimport {property, query, queryAsync, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {styleMap} from 'lit/directives/style-map.js';\nimport {when} from 'lit/directives/when.js';\n\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n redispatchEvent,\n} from '../../internal/events/events.js';\nimport {mixinElementInternals} from '../../labs/behaviors/element-internals.js';\nimport {\n getFormValue,\n mixinFormAssociated,\n} from '../../labs/behaviors/form-associated.js';\nimport {MdRipple} from '../../ripple/ripple.js';\n\n// Disable warning for classMap with destructuring\n// tslint:disable:no-implicit-dictionary-conversion\n\n// Separate variable needed for closure.\nconst sliderBaseClass = mixinFormAssociated(mixinElementInternals(LitElement));\n\n/**\n * Slider component.\n *\n *\n * @fires change {Event} The native `change` event on\n * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event)\n * --bubbles\n * @fires input {InputEvent} The native `input` event on\n * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event)\n * --bubbles --composed\n */\nexport class Slider extends sliderBaseClass {\n static {\n requestUpdateOnAriaChange(Slider);\n }\n\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * The slider minimum value\n */\n @property({type: Number}) min = 0;\n\n /**\n * The slider maximum value\n */\n @property({type: Number}) max = 100;\n\n /**\n * The slider value displayed when range is false.\n */\n @property({type: Number}) value?: number;\n\n /**\n * The slider start value displayed when range is true.\n */\n @property({type: Number, attribute: 'value-start'}) valueStart?: number;\n\n /**\n * The slider end value displayed when range is true.\n */\n @property({type: Number, attribute: 'value-end'}) valueEnd?: number;\n\n /**\n * An optional label for the slider's value displayed when range is\n * false; if not set, the label is the value itself.\n */\n @property({attribute: 'value-label'}) valueLabel = '';\n\n /**\n * An optional label for the slider's start value displayed when\n * range is true; if not set, the label is the valueStart itself.\n */\n @property({attribute: 'value-label-start'}) valueLabelStart = '';\n\n /**\n * An optional label for the slider's end value displayed when\n * range is true; if not set, the label is the valueEnd itself.\n */\n @property({attribute: 'value-label-end'}) valueLabelEnd = '';\n\n /**\n * Aria label for the slider's start handle displayed when\n * range is true.\n */\n @property({attribute: 'aria-label-start'}) ariaLabelStart = '';\n\n /**\n * Aria value text for the slider's start value displayed when\n * range is true.\n */\n @property({attribute: 'aria-valuetext-start'}) ariaValueTextStart = '';\n\n /**\n * Aria label for the slider's end handle displayed when\n * range is true.\n */\n @property({attribute: 'aria-label-end'}) ariaLabelEnd = '';\n\n /**\n * Aria value text for the slider's end value displayed when\n * range is true.\n */\n @property({attribute: 'aria-valuetext-end'}) ariaValueTextEnd = '';\n\n /**\n * The step between values.\n */\n @property({type: Number}) step = 1;\n\n /**\n * Whether or not to show tick marks.\n */\n @property({type: Boolean}) ticks = false;\n\n /**\n * Whether or not to show a value label when activated.\n */\n @property({type: Boolean}) labeled = false;\n\n /**\n * Whether or not to show a value range. When false, the slider displays\n * a slideable handle for the value property; when true, it displays\n * slideable handles for the valueStart and valueEnd properties.\n */\n @property({type: Boolean}) range = false;\n\n /**\n * The HTML name to use in form submission for a range slider's starting\n * value. Use `name` instead if both the start and end values should use the\n * same name.\n */\n get nameStart() {\n return this.getAttribute('name-start') ?? this.name;\n }\n set nameStart(name: string) {\n this.setAttribute('name-start', name);\n }\n\n /**\n * The HTML name to use in form submission for a range slider's ending value.\n * Use `name` instead if both the start and end values should use the same\n * name.\n */\n get nameEnd() {\n return this.getAttribute('name-end') ?? this.nameStart;\n }\n set nameEnd(name: string) {\n this.setAttribute('name-end', name);\n }\n\n @query('input.start') private readonly inputStart!: HTMLInputElement | null;\n @query('.handle.start') private readonly handleStart!: HTMLDivElement | null;\n @queryAsync('md-ripple.start')\n private readonly rippleStart!: Promise<MdRipple | null>;\n\n @query('input.end') private readonly inputEnd!: HTMLInputElement | null;\n @query('.handle.end') private readonly handleEnd!: HTMLDivElement | null;\n @queryAsync('md-ripple.end')\n private readonly rippleEnd!: Promise<MdRipple | null>;\n\n // handle hover/pressed states are set manually since the handle\n // does not receive pointer events so that the native inputs are\n // interaction targets.\n @state() private handleStartHover = false;\n @state() private handleEndHover = false;\n\n @state() private startOnTop = false;\n @state() private handlesOverlapping = false;\n\n @state() private renderValueStart?: number;\n @state() private renderValueEnd?: number;\n\n // Note: start aria-* properties are only applied when range=true, which is\n // why they do not need to handle both cases.\n private get renderAriaLabelStart() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return (\n this.ariaLabelStart ||\n (ariaLabel && `${ariaLabel} start`) ||\n this.valueLabelStart ||\n String(this.valueStart)\n );\n }\n\n private get renderAriaValueTextStart() {\n return (\n this.ariaValueTextStart || this.valueLabelStart || String(this.valueStart)\n );\n }\n\n // Note: end aria-* properties are applied for single and range sliders, which\n // is why it needs to handle `this.range` (while start aria-* properties do\n // not).\n private get renderAriaLabelEnd() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n if (this.range) {\n return (\n this.ariaLabelEnd ||\n (ariaLabel && `${ariaLabel} end`) ||\n this.valueLabelEnd ||\n String(this.valueEnd)\n );\n }\n\n return ariaLabel || this.valueLabel || String(this.value);\n }\n\n private get renderAriaValueTextEnd() {\n if (this.range) {\n return (\n this.ariaValueTextEnd || this.valueLabelEnd || String(this.valueEnd)\n );\n }\n\n // Needed for conformance\n const {ariaValueText} = this as ARIAMixinStrict;\n return ariaValueText || this.valueLabel || String(this.value);\n }\n\n // used in synthetic events generated to control ripple hover state.\n private ripplePointerId = 1;\n\n // flag to prevent processing of re-dispatched input event.\n private isRedispatchingEvent = false;\n\n private action?: Action;\n\n constructor() {\n super();\n if (!isServer) {\n this.addEventListener('click', (event: MouseEvent) => {\n if (!isActivationClick(event) || !this.inputEnd) {\n return;\n }\n this.focus();\n dispatchActivationClick(this.inputEnd);\n });\n }\n }\n\n override focus() {\n this.inputEnd?.focus();\n }\n\n protected override willUpdate(changed: PropertyValues) {\n this.renderValueStart = changed.has('valueStart')\n ? this.valueStart\n : this.inputStart?.valueAsNumber;\n const endValueChanged =\n (changed.has('valueEnd') && this.range) || changed.has('value');\n this.renderValueEnd = endValueChanged\n ? this.range\n ? this.valueEnd\n : this.value\n : this.inputEnd?.valueAsNumber;\n // manually handle ripple hover state since the handle is pointer events\n // none.\n if (changed.get('handleStartHover') !== undefined) {\n this.toggleRippleHover(this.rippleStart, this.handleStartHover);\n } else if (changed.get('handleEndHover') !== undefined) {\n this.toggleRippleHover(this.rippleEnd, this.handleEndHover);\n }\n }\n\n protected override updated(changed: PropertyValues) {\n // Validate input rendered value and re-render if necessary. This ensures\n // the rendred handle stays in sync with the input thumb which is used for\n // interaction. These can get out of sync if a supplied value does not\n // map to an exactly stepped value between min and max.\n if (this.range) {\n this.renderValueStart = this.inputStart!.valueAsNumber;\n }\n this.renderValueEnd = this.inputEnd!.valueAsNumber;\n // update values if they are unset\n // when using a range, default to equi-distant between\n // min - valueStart - valueEnd - max\n if (this.range) {\n const segment = (this.max - this.min) / 3;\n if (this.valueStart === undefined) {\n this.inputStart!.valueAsNumber = this.min + segment;\n // read actual value from input\n const v = this.inputStart!.valueAsNumber;\n this.valueStart = this.renderValueStart = v;\n }\n if (this.valueEnd === undefined) {\n this.inputEnd!.valueAsNumber = this.min + 2 * segment;\n // read actual value from input\n const v = this.inputEnd!.valueAsNumber;\n this.valueEnd = this.renderValueEnd = v;\n }\n } else {\n this.value ??= this.renderValueEnd;\n }\n if (\n changed.has('range') ||\n changed.has('renderValueStart') ||\n changed.has('renderValueEnd') ||\n this.isUpdatePending\n ) {\n // Only check if the handle nubs are overlapping, as the ripple touch\n // target extends subtantially beyond the boundary of the handle nub.\n const startNub = this.handleStart?.querySelector('.handleNub');\n const endNub = this.handleEnd?.querySelector('.handleNub');\n this.handlesOverlapping = isOverlapping(startNub, endNub);\n }\n // called to finish the update imediately;\n // note, this is a no-op unless an update is scheduled\n this.performUpdate();\n }\n\n protected override render() {\n const step = this.step === 0 ? 1 : this.step;\n const range = Math.max(this.max - this.min, step);\n const startFraction = this.range\n ? ((this.renderValueStart ?? this.min) - this.min) / range\n : 0;\n const endFraction = ((this.renderValueEnd ?? this.min) - this.min) / range;\n const containerStyles = {\n // for clipping inputs and active track.\n '--_start-fraction': String(startFraction),\n '--_end-fraction': String(endFraction),\n // for generating tick marks\n '--_tick-count': String(range / step),\n };\n const containerClasses = {ranged: this.range};\n\n // optional label values to show in place of the value.\n const labelStart = this.valueLabelStart || String(this.renderValueStart);\n const labelEnd =\n (this.range ? this.valueLabelEnd : this.valueLabel) ||\n String(this.renderValueEnd);\n\n const inputStartProps = {\n start: true,\n value: this.renderValueStart,\n ariaLabel: this.renderAriaLabelStart,\n ariaValueText: this.renderAriaValueTextStart,\n ariaMin: this.min,\n ariaMax: this.valueEnd ?? this.max,\n };\n\n const inputEndProps = {\n start: false,\n value: this.renderValueEnd,\n ariaLabel: this.renderAriaLabelEnd,\n ariaValueText: this.renderAriaValueTextEnd,\n ariaMin: this.range ? this.valueStart ?? this.min : this.min,\n ariaMax: this.max,\n };\n\n const handleStartProps = {\n start: true,\n hover: this.handleStartHover,\n label: labelStart,\n };\n\n const handleEndProps = {\n start: false,\n hover: this.handleEndHover,\n label: labelEnd,\n };\n\n const handleContainerClasses = {\n hover: this.handleStartHover || this.handleEndHover,\n };\n\n return html` <div\n class=\"container ${classMap(containerClasses)}\"\n style=${styleMap(containerStyles)}>\n ${when(this.range, () => this.renderInput(inputStartProps))}\n ${this.renderInput(inputEndProps)} ${this.renderTrack()}\n <div class=\"handleContainerPadded\">\n <div class=\"handleContainerBlock\">\n <div class=\"handleContainer ${classMap(handleContainerClasses)}\">\n ${when(this.range, () => this.renderHandle(handleStartProps))}\n ${this.renderHandle(handleEndProps)}\n </div>\n </div>\n </div>\n </div>`;\n }\n\n private renderTrack() {\n return html`\n <div class=\"track\"></div>\n ${this.ticks ? html`<div class=\"tickmarks\"></div>` : nothing}\n `;\n }\n\n private renderLabel(value: string) {\n return html`<div class=\"label\" aria-hidden=\"true\">\n <span class=\"labelContent\" part=\"label\">${value}</span>\n </div>`;\n }\n\n private renderHandle({\n start,\n hover,\n label,\n }: {\n start: boolean;\n hover: boolean;\n label: string;\n }) {\n const onTop = !this.disabled && start === this.startOnTop;\n const isOverlapping = !this.disabled && this.handlesOverlapping;\n const name = start ? 'start' : 'end';\n return html`<div\n class=\"handle ${classMap({\n [name]: true,\n hover,\n onTop,\n isOverlapping,\n })}\">\n <div class=\"handleNub\"><md-elevation></md-elevation></div>\n ${when(this.labeled, () => this.renderLabel(label))}\n <md-focus-ring part=\"focus-ring\" for=${name}></md-focus-ring>\n <md-ripple\n for=${name}\n class=${name}\n ?disabled=${this.disabled}></md-ripple>\n </div>`;\n }\n\n private renderInput({\n start,\n value,\n ariaLabel,\n ariaValueText,\n ariaMin,\n ariaMax,\n }: {\n start: boolean;\n value?: number;\n ariaLabel: string;\n ariaValueText: string;\n ariaMin: number;\n ariaMax: number;\n }) {\n // Slider requires min/max set to the overall min/max for both inputs.\n // This is reported to screen readers, which is why we need aria-valuemin\n // and aria-valuemax.\n const name = start ? `start` : `end`;\n return html`<input\n type=\"range\"\n class=\"${classMap({\n start,\n end: !start,\n })}\"\n @focus=${this.handleFocus}\n @pointerdown=${this.handleDown}\n @pointerup=${this.handleUp}\n @pointerenter=${this.handleEnter}\n @pointermove=${this.handleMove}\n @pointerleave=${this.handleLeave}\n @keydown=${this.handleKeydown}\n @keyup=${this.handleKeyup}\n @input=${this.handleInput}\n @change=${this.handleChange}\n id=${name}\n .disabled=${this.disabled}\n .min=${String(this.min)}\n aria-valuemin=${ariaMin}\n .max=${String(this.max)}\n aria-valuemax=${ariaMax}\n .step=${String(this.step)}\n .value=${String(value)}\n .tabIndex=${start ? 1 : 0}\n aria-label=${ariaLabel || nothing}\n aria-valuetext=${ariaValueText} />`;\n }\n\n private async toggleRippleHover(\n ripple: Promise<MdRipple | null>,\n hovering: boolean,\n ) {\n const rippleEl = await ripple;\n if (!rippleEl) {\n return;\n }\n // TODO(b/269799771): improve slider ripple connection\n if (hovering) {\n rippleEl.handlePointerenter(\n new PointerEvent('pointerenter', {\n isPrimary: true,\n pointerId: this.ripplePointerId,\n }),\n );\n } else {\n rippleEl.handlePointerleave(\n new PointerEvent('pointerleave', {\n isPrimary: true,\n pointerId: this.ripplePointerId,\n }),\n );\n }\n }\n\n private handleFocus(event: Event) {\n this.updateOnTop(event.target as HTMLInputElement);\n }\n\n private startAction(event: Event) {\n const target = event.target as HTMLInputElement;\n const fixed =\n target === this.inputStart ? this.inputEnd! : this.inputStart!;\n this.action = {\n canFlip: event.type === 'pointerdown',\n flipped: false,\n target,\n fixed,\n values: new Map([\n [target, target.valueAsNumber],\n [fixed, fixed?.valueAsNumber],\n ]),\n };\n }\n\n private finishAction(event: Event) {\n this.action = undefined;\n }\n\n private handleKeydown(event: KeyboardEvent) {\n this.startAction(event);\n }\n\n private handleKeyup(event: KeyboardEvent) {\n this.finishAction(event);\n }\n\n private handleDown(event: PointerEvent) {\n this.startAction(event);\n this.ripplePointerId = event.pointerId;\n const isStart = (event.target as HTMLInputElement) === this.inputStart;\n // Since handle moves to pointer on down and there may not be a move,\n // it needs to be considered hovered..\n this.handleStartHover =\n !this.disabled && isStart && Boolean(this.handleStart);\n this.handleEndHover = !this.disabled && !isStart && Boolean(this.handleEnd);\n }\n\n private async handleUp(event: PointerEvent) {\n if (!this.action) {\n return;\n }\n\n const {target, values, flipped} = this.action;\n // Async here for Firefox because input can be after pointerup\n // when value is calmped.\n await new Promise(requestAnimationFrame);\n if (target !== undefined) {\n // Ensure Safari focuses input so label renders.\n // Ensure any flipped input is focused so the tab order is right.\n target.focus();\n // When action is flipped, change must be fired manually since the\n // real event target did not change.\n if (flipped && target.valueAsNumber !== values.get(target)!) {\n target.dispatchEvent(new Event('change', {bubbles: true}));\n }\n }\n this.finishAction(event);\n }\n\n /**\n * The move handler tracks handle hovering to facilitate proper ripple\n * behavior on the slider handle. This is needed because user interaction with\n * the native input is leveraged to position the handle. Because the separate\n * displayed handle element has pointer events disabled (to allow interaction\n * with the input) and the input's handle is a pseudo-element, neither can be\n * the ripple's interactive element. Therefore the input is the ripple's\n * interactive element and has a `ripple` directive; however the ripple\n * is gated on the handle being hovered. In addition, because the ripple\n * hover state is being specially handled, it must be triggered independent\n * of the directive. This is done based on the hover state when the\n * slider is updated.\n */\n private handleMove(event: PointerEvent) {\n this.handleStartHover = !this.disabled && inBounds(event, this.handleStart);\n this.handleEndHover = !this.disabled && inBounds(event, this.handleEnd);\n }\n\n private handleEnter(event: PointerEvent) {\n this.handleMove(event);\n }\n\n private handleLeave() {\n this.handleStartHover = false;\n this.handleEndHover = false;\n }\n\n private updateOnTop(input: HTMLInputElement) {\n this.startOnTop = input.classList.contains('start');\n }\n\n private needsClamping() {\n if (!this.action) {\n return false;\n }\n\n const {target, fixed} = this.action;\n const isStart = target === this.inputStart;\n return isStart\n ? target.valueAsNumber > fixed.valueAsNumber\n : target.valueAsNumber < fixed.valueAsNumber;\n }\n\n // if start/end start coincident and the first drag input would e.g. move\n // start > end, avoid clamping and \"flip\" to use the other input\n // as the action target.\n private isActionFlipped() {\n const {action} = this;\n if (!action) {\n return false;\n }\n\n const {target, fixed, values} = action;\n if (action.canFlip) {\n const coincident = values.get(target) === values.get(fixed);\n if (coincident && this.needsClamping()) {\n action.canFlip = false;\n action.flipped = true;\n action.target = fixed;\n action.fixed = target;\n }\n }\n return action.flipped;\n }\n\n // when flipped, apply the drag input to the flipped target and reset\n // the actual target.\n private flipAction() {\n if (!this.action) {\n return false;\n }\n\n const {target, fixed, values} = this.action;\n const changed = target.valueAsNumber !== fixed.valueAsNumber;\n target.valueAsNumber = fixed.valueAsNumber;\n fixed.valueAsNumber = values.get(fixed)!;\n return changed;\n }\n\n // clamp such that start does not move beyond end and visa versa.\n private clampAction() {\n if (!this.needsClamping() || !this.action) {\n return false;\n }\n const {target, fixed} = this.action;\n target.valueAsNumber = fixed.valueAsNumber;\n return true;\n }\n\n private handleInput(event: InputEvent) {\n // avoid processing a re-dispatched event\n if (this.isRedispatchingEvent) {\n return;\n }\n let stopPropagation = false;\n let redispatch = false;\n if (this.range) {\n if (this.isActionFlipped()) {\n stopPropagation = true;\n redispatch = this.flipAction();\n }\n if (this.clampAction()) {\n stopPropagation = true;\n redispatch = false;\n }\n }\n const target = event.target as HTMLInputElement;\n this.updateOnTop(target);\n // update value only on interaction\n if (this.range) {\n this.valueStart = this.inputStart!.valueAsNumber;\n this.valueEnd = this.inputEnd!.valueAsNumber;\n } else {\n this.value = this.inputEnd!.valueAsNumber;\n }\n // control external visibility of input event\n if (stopPropagation) {\n event.stopPropagation();\n }\n // ensure event path is correct when flipped.\n if (redispatch) {\n this.isRedispatchingEvent = true;\n redispatchEvent(target, event);\n this.isRedispatchingEvent = false;\n }\n }\n\n private handleChange(event: Event) {\n // prevent keyboard triggered changes from dispatching for\n // clamped values; note, this only occurs for keyboard\n const changeTarget = event.target as HTMLInputElement;\n const {target, values} = this.action ?? {};\n const squelch =\n target && target.valueAsNumber === values!.get(changeTarget)!;\n if (!squelch) {\n redispatchEvent(this, event);\n }\n // ensure keyboard triggered change clears action.\n this.finishAction(event);\n }\n\n // Writable mixin properties for lit-html binding, needed for lit-analyzer\n declare disabled: boolean;\n declare name: string;\n\n override [getFormValue]() {\n if (this.range) {\n const data = new FormData();\n data.append(this.nameStart, String(this.valueStart));\n data.append(this.nameEnd, String(this.valueEnd));\n return data;\n }\n\n return String(this.value);\n }\n\n override formResetCallback() {\n if (this.range) {\n const valueStart = this.getAttribute('value-start');\n this.valueStart = valueStart !== null ? Number(valueStart) : undefined;\n const valueEnd = this.getAttribute('value-end');\n this.valueEnd = valueEnd !== null ? Number(valueEnd) : undefined;\n return;\n }\n const value = this.getAttribute('value');\n this.value = value !== null ? Number(value) : undefined;\n }\n\n override formStateRestoreCallback(\n state: string | Array<[string, string]> | null,\n ) {\n if (Array.isArray(state)) {\n const [[, valueStart], [, valueEnd]] = state;\n this.valueStart = Number(valueStart);\n this.valueEnd = Number(valueEnd);\n this.range = true;\n return;\n }\n\n this.value = Number(state);\n this.range = false;\n }\n}\n\nfunction inBounds({x, y}: PointerEvent, element?: HTMLElement | null) {\n if (!element) {\n return false;\n }\n const {top, left, bottom, right} = element.getBoundingClientRect();\n return x >= left && x <= right && y >= top && y <= bottom;\n}\n\nfunction isOverlapping(\n elA: Element | null | undefined,\n elB: Element | null | undefined,\n) {\n if (!(elA && elB)) {\n return false;\n }\n const a = elA.getBoundingClientRect();\n const b = elB.getBoundingClientRect();\n return !(\n a.top > b.bottom ||\n a.right < b.left ||\n a.bottom < b.top ||\n a.left > b.right\n );\n}\n\ninterface Action {\n canFlip: boolean;\n flipped: boolean;\n target: HTMLInputElement;\n fixed: HTMLInputElement;\n values: Map<HTMLInputElement | undefined, number | undefined>;\n}\n"]}
|
|
@@ -10,7 +10,7 @@ import { html, isServer, LitElement, nothing } from 'lit';
|
|
|
10
10
|
import { property, query } from 'lit/decorators.js';
|
|
11
11
|
import { classMap } from 'lit/directives/class-map.js';
|
|
12
12
|
import { requestUpdateOnAriaChange } from '../../internal/aria/delegate.js';
|
|
13
|
-
import { dispatchActivationClick, isActivationClick, redispatchEvent, } from '../../internal/
|
|
13
|
+
import { dispatchActivationClick, isActivationClick, redispatchEvent, } from '../../internal/events/events.js';
|
|
14
14
|
import { createValidator, getValidityAnchor, mixinConstraintValidation, } from '../../labs/behaviors/constraint-validation.js';
|
|
15
15
|
import { mixinElementInternals } from '../../labs/behaviors/element-internals.js';
|
|
16
16
|
import { getFormState, getFormValue, mixinFormAssociated, } from '../../labs/behaviors/form-associated.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","sourceRoot":"","sources":["switch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AACxE,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAC,yBAAyB,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EACL,uBAAuB,EACvB,iBAAi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,OAAO,EAAC,CAAC;qCAAe;AAOzC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAC,CAAC;oDACnC;AAQF;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;wCAAkB;AAMhC;IAAX,QAAQ,EAAE;qCAAc;AAEQ;IAAhC,KAAK,CAAC,OAAO,CAAC;qCAAkD","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../focus/md-focus-ring.js';\nimport '../../ripple/ripple.js';\n\nimport {html, isServer, LitElement, nothing, TemplateResult} from 'lit';\nimport {property, query} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\n\nimport {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n redispatchEvent,\n} from '../../internal/controller/events.js';\nimport {\n createValidator,\n getValidityAnchor,\n mixinConstraintValidation,\n} from '../../labs/behaviors/constraint-validation.js';\nimport {mixinElementInternals} from '../../labs/behaviors/element-internals.js';\nimport {\n getFormState,\n getFormValue,\n mixinFormAssociated,\n} from '../../labs/behaviors/form-associated.js';\nimport {CheckboxValidator} from '../../labs/behaviors/validators/checkbox-validator.js';\n\n// Separate variable needed for closure.\nconst switchBaseClass = mixinConstraintValidation(\n mixinFormAssociated(mixinElementInternals(LitElement)),\n);\n\n/**\n * @fires input {InputEvent} Fired whenever `selected` changes due to user\n * interaction (bubbles and composed).\n * @fires change {Event} Fired whenever `selected` changes due to user\n * interaction (bubbles).\n */\nexport class Switch extends switchBaseClass {\n static {\n requestUpdateOnAriaChange(Switch);\n }\n\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n /**\n * Puts the switch in the selected state and sets the form submission value to\n * the `value` property.\n */\n @property({type: Boolean}) selected = false;\n\n /**\n * Shows both the selected and deselected icons.\n */\n @property({type: Boolean}) icons = false;\n\n /**\n * Shows only the selected icon, and not the deselected icon. If `true`,\n * overrides the behavior of the `icons` property.\n */\n @property({type: Boolean, attribute: 'show-only-selected-icon'})\n showOnlySelectedIcon = false;\n\n /**\n * When true, require the switch to be selected when participating in\n * form submission.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#validation\n */\n @property({type: Boolean}) required = false;\n\n /**\n * The value associated with this switch on form submission. `null` is\n * submitted when `selected` is `false`.\n */\n @property() value = 'on';\n\n @query('input') private readonly input!: HTMLInputElement | null;\n\n constructor() {\n super();\n if (!isServer) {\n this.addEventListener('click', (event: MouseEvent) => {\n if (!isActivationClick(event) || !this.input) {\n return;\n }\n this.focus();\n dispatchActivationClick(this.input);\n });\n }\n }\n\n protected override render(): TemplateResult {\n // NOTE: buttons must use only [phrasing\n // content](https://html.spec.whatwg.org/multipage/dom.html#phrasing-content)\n // children, which includes custom elements, but not `div`s\n return html`\n <div class=\"switch ${classMap(this.getRenderClasses())}\">\n <input\n id=\"switch\"\n class=\"touch\"\n type=\"checkbox\"\n role=\"switch\"\n aria-label=${(this as ARIAMixin).ariaLabel || nothing}\n ?checked=${this.selected}\n ?disabled=${this.disabled}\n ?required=${this.required}\n @change=${this.handleChange} />\n\n <md-focus-ring part=\"focus-ring\" for=\"switch\"></md-focus-ring>\n <span class=\"track\"> ${this.renderHandle()} </span>\n </div>\n `;\n }\n\n private getRenderClasses(): ClassInfo {\n return {\n 'selected': this.selected,\n 'unselected': !this.selected,\n 'disabled': this.disabled,\n };\n }\n\n private renderHandle() {\n const classes = {\n 'with-icon': this.showOnlySelectedIcon ? this.selected : this.icons,\n };\n return html`\n ${this.renderTouchTarget()}\n <span class=\"handle-container\">\n <md-ripple for=\"switch\" ?disabled=\"${this.disabled}\"></md-ripple>\n <span class=\"handle ${classMap(classes)}\">\n ${this.shouldShowIcons() ? this.renderIcons() : html``}\n </span>\n </span>\n `;\n }\n\n private renderIcons() {\n return html`\n <div class=\"icons\">\n ${this.renderOnIcon()}\n ${this.showOnlySelectedIcon ? html`` : this.renderOffIcon()}\n </div>\n `;\n }\n\n /**\n * https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck%3AFILL%400%3Bwght%40500%3BGRAD%400%3Bopsz%4024\n */\n private renderOnIcon() {\n return html`\n <slot class=\"icon icon--on\" name=\"on-icon\">\n <svg viewBox=\"0 0 24 24\">\n <path\n d=\"M9.55 18.2 3.65 12.3 5.275 10.675 9.55 14.95 18.725 5.775 20.35 7.4Z\" />\n </svg>\n </slot>\n `;\n }\n\n /**\n * https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Aclose%3AFILL%400%3Bwght%40500%3BGRAD%400%3Bopsz%4024\n */\n private renderOffIcon() {\n return html`\n <slot class=\"icon icon--off\" name=\"off-icon\">\n <svg viewBox=\"0 0 24 24\">\n <path\n d=\"M6.4 19.2 4.8 17.6 10.4 12 4.8 6.4 6.4 4.8 12 10.4 17.6 4.8 19.2 6.4 13.6 12 19.2 17.6 17.6 19.2 12 13.6Z\" />\n </svg>\n </slot>\n `;\n }\n\n private renderTouchTarget() {\n return html`<span class=\"touch\"></span>`;\n }\n\n private shouldShowIcons(): boolean {\n return this.icons || this.showOnlySelectedIcon;\n }\n\n private handleChange(event: Event) {\n const target = event.target as HTMLInputElement;\n this.selected = target.checked;\n redispatchEvent(this, event);\n }\n\n // Writable mixin properties for lit-html binding, needed for lit-analyzer\n declare disabled: boolean;\n declare name: string;\n\n override [getFormValue]() {\n return this.selected ? this.value : null;\n }\n\n override [getFormState]() {\n return String(this.selected);\n }\n\n override formResetCallback() {\n // The selected property does not reflect, so the original attribute set by\n // the user is used to determine the default value.\n this.selected = this.hasAttribute('selected');\n }\n\n override formStateRestoreCallback(state: string) {\n this.selected = state === 'true';\n }\n\n [createValidator]() {\n return new CheckboxValidator(() => ({\n checked: this.selected,\n required: this.required,\n }));\n }\n\n [getValidityAnchor]() {\n return this.input;\n }\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AAQ;YACtB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC,CAAC;IACN,CAAC;IAED,CAAC,iBAAiB,CAAC;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;;AAzLD;IACE,yBAAyB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,GAAA,CAAA;AAED,kBAAkB;AACF,wBAAiB,GAAmB;IAClD,IAAI,EAAE,MAAM;IACZ,cAAc,EAAE,IAAI;CACrB,AAHgC,CAG/B;AAMyB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;wCAAkB;AAKjB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;qCAAe;AAOzC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAC,CAAC;oDACnC;AAQF;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;wCAAkB;AAMhC;IAAX,QAAQ,EAAE;qCAAc;AAEQ;IAAhC,KAAK,CAAC,OAAO,CAAC;qCAAkD","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../focus/md-focus-ring.js';\nimport '../../ripple/ripple.js';\n\nimport {html, isServer, LitElement, nothing, TemplateResult} from 'lit';\nimport {property, query} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\n\nimport {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n redispatchEvent,\n} from '../../internal/events/events.js';\nimport {\n createValidator,\n getValidityAnchor,\n mixinConstraintValidation,\n} from '../../labs/behaviors/constraint-validation.js';\nimport {mixinElementInternals} from '../../labs/behaviors/element-internals.js';\nimport {\n getFormState,\n getFormValue,\n mixinFormAssociated,\n} from '../../labs/behaviors/form-associated.js';\nimport {CheckboxValidator} from '../../labs/behaviors/validators/checkbox-validator.js';\n\n// Separate variable needed for closure.\nconst switchBaseClass = mixinConstraintValidation(\n mixinFormAssociated(mixinElementInternals(LitElement)),\n);\n\n/**\n * @fires input {InputEvent} Fired whenever `selected` changes due to user\n * interaction (bubbles and composed).\n * @fires change {Event} Fired whenever `selected` changes due to user\n * interaction (bubbles).\n */\nexport class Switch extends switchBaseClass {\n static {\n requestUpdateOnAriaChange(Switch);\n }\n\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n /**\n * Puts the switch in the selected state and sets the form submission value to\n * the `value` property.\n */\n @property({type: Boolean}) selected = false;\n\n /**\n * Shows both the selected and deselected icons.\n */\n @property({type: Boolean}) icons = false;\n\n /**\n * Shows only the selected icon, and not the deselected icon. If `true`,\n * overrides the behavior of the `icons` property.\n */\n @property({type: Boolean, attribute: 'show-only-selected-icon'})\n showOnlySelectedIcon = false;\n\n /**\n * When true, require the switch to be selected when participating in\n * form submission.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#validation\n */\n @property({type: Boolean}) required = false;\n\n /**\n * The value associated with this switch on form submission. `null` is\n * submitted when `selected` is `false`.\n */\n @property() value = 'on';\n\n @query('input') private readonly input!: HTMLInputElement | null;\n\n constructor() {\n super();\n if (!isServer) {\n this.addEventListener('click', (event: MouseEvent) => {\n if (!isActivationClick(event) || !this.input) {\n return;\n }\n this.focus();\n dispatchActivationClick(this.input);\n });\n }\n }\n\n protected override render(): TemplateResult {\n // NOTE: buttons must use only [phrasing\n // content](https://html.spec.whatwg.org/multipage/dom.html#phrasing-content)\n // children, which includes custom elements, but not `div`s\n return html`\n <div class=\"switch ${classMap(this.getRenderClasses())}\">\n <input\n id=\"switch\"\n class=\"touch\"\n type=\"checkbox\"\n role=\"switch\"\n aria-label=${(this as ARIAMixin).ariaLabel || nothing}\n ?checked=${this.selected}\n ?disabled=${this.disabled}\n ?required=${this.required}\n @change=${this.handleChange} />\n\n <md-focus-ring part=\"focus-ring\" for=\"switch\"></md-focus-ring>\n <span class=\"track\"> ${this.renderHandle()} </span>\n </div>\n `;\n }\n\n private getRenderClasses(): ClassInfo {\n return {\n 'selected': this.selected,\n 'unselected': !this.selected,\n 'disabled': this.disabled,\n };\n }\n\n private renderHandle() {\n const classes = {\n 'with-icon': this.showOnlySelectedIcon ? this.selected : this.icons,\n };\n return html`\n ${this.renderTouchTarget()}\n <span class=\"handle-container\">\n <md-ripple for=\"switch\" ?disabled=\"${this.disabled}\"></md-ripple>\n <span class=\"handle ${classMap(classes)}\">\n ${this.shouldShowIcons() ? this.renderIcons() : html``}\n </span>\n </span>\n `;\n }\n\n private renderIcons() {\n return html`\n <div class=\"icons\">\n ${this.renderOnIcon()}\n ${this.showOnlySelectedIcon ? html`` : this.renderOffIcon()}\n </div>\n `;\n }\n\n /**\n * https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck%3AFILL%400%3Bwght%40500%3BGRAD%400%3Bopsz%4024\n */\n private renderOnIcon() {\n return html`\n <slot class=\"icon icon--on\" name=\"on-icon\">\n <svg viewBox=\"0 0 24 24\">\n <path\n d=\"M9.55 18.2 3.65 12.3 5.275 10.675 9.55 14.95 18.725 5.775 20.35 7.4Z\" />\n </svg>\n </slot>\n `;\n }\n\n /**\n * https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Aclose%3AFILL%400%3Bwght%40500%3BGRAD%400%3Bopsz%4024\n */\n private renderOffIcon() {\n return html`\n <slot class=\"icon icon--off\" name=\"off-icon\">\n <svg viewBox=\"0 0 24 24\">\n <path\n d=\"M6.4 19.2 4.8 17.6 10.4 12 4.8 6.4 6.4 4.8 12 10.4 17.6 4.8 19.2 6.4 13.6 12 19.2 17.6 17.6 19.2 12 13.6Z\" />\n </svg>\n </slot>\n `;\n }\n\n private renderTouchTarget() {\n return html`<span class=\"touch\"></span>`;\n }\n\n private shouldShowIcons(): boolean {\n return this.icons || this.showOnlySelectedIcon;\n }\n\n private handleChange(event: Event) {\n const target = event.target as HTMLInputElement;\n this.selected = target.checked;\n redispatchEvent(this, event);\n }\n\n // Writable mixin properties for lit-html binding, needed for lit-analyzer\n declare disabled: boolean;\n declare name: string;\n\n override [getFormValue]() {\n return this.selected ? this.value : null;\n }\n\n override [getFormState]() {\n return String(this.selected);\n }\n\n override formResetCallback() {\n // The selected property does not reflect, so the original attribute set by\n // the user is used to determine the default value.\n this.selected = this.hasAttribute('selected');\n }\n\n override formStateRestoreCallback(state: string) {\n this.selected = state === 'true';\n }\n\n [createValidator]() {\n return new CheckboxValidator(() => ({\n checked: this.selected,\n required: this.required,\n }));\n }\n\n [getValidityAnchor]() {\n return this.input;\n }\n}\n"]}
|
package/tabs/internal/_tab.scss
CHANGED
|
@@ -41,6 +41,13 @@
|
|
|
41
41
|
pressed-opacity: var(--_pressed-state-layer-opacity),
|
|
42
42
|
)
|
|
43
43
|
);
|
|
44
|
+
|
|
45
|
+
// b/316459034 - elevation should be removed
|
|
46
|
+
@include elevation.theme(
|
|
47
|
+
(
|
|
48
|
+
level: var(--_container-elevation),
|
|
49
|
+
)
|
|
50
|
+
);
|
|
44
51
|
}
|
|
45
52
|
|
|
46
53
|
md-focus-ring {
|
|
@@ -139,11 +146,6 @@
|
|
|
139
146
|
}
|
|
140
147
|
:host([active]) {
|
|
141
148
|
color: var(--_active-label-text-color);
|
|
142
|
-
@include elevation.theme(
|
|
143
|
-
(
|
|
144
|
-
level: var(--_container-elevation),
|
|
145
|
-
)
|
|
146
|
-
);
|
|
147
149
|
|
|
148
150
|
@include ripple.theme(
|
|
149
151
|
(
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { css } from 'lit';
|
|
7
|
-
export const styles = css `: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-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-
|
|
7
|
+
export const styles = css `: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}}/*# sourceMappingURL=tab-styles.css.map */
|
|
8
8
|
`;
|
|
9
9
|
//# sourceMappingURL=tab-styles.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-styles.css.js","sourceRoot":"","sources":["tab-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`: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-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-
|
|
1
|
+
{"version":3,"file":"tab-styles.css.js","sourceRoot":"","sources":["tab-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`: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}}/*# sourceMappingURL=tab-styles.css.map */\n`;\n "]}
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { css } from 'lit';
|
|
7
|
-
export const styles = css `:host{display:inline-flex;outline:none;resize:both;-webkit-tap-highlight-color:rgba(0,0,0,0)}.text-field,.field{width:100%}.text-field{display:inline-flex}.field{cursor:text}.disabled .field{cursor:default}.text-field,.textarea .field{resize:inherit}.icon{color:currentColor;display:flex;fill:currentColor}.icon ::slotted(*){display:flex}[hasstart] .icon.leading{font-size:var(--_leading-icon-size);height:var(--_leading-icon-size);width:var(--_leading-icon-size)}[hasend] .icon.trailing{font-size:var(--_trailing-icon-size);height:var(--_trailing-icon-size);width:var(--_trailing-icon-size)}.input-wrapper{display:flex}.input-wrapper>*{all:inherit;padding:0}.input{caret-color:var(--_caret-color);overflow-x:hidden;text-align:inherit}.input::placeholder{color:currentColor;opacity:1}.input::-webkit-calendar-picker-indicator{display:none}.input::-webkit-search-decoration,.input::-webkit-search-cancel-button{display:none}@media(forced-colors: active){.input{background
|
|
7
|
+
export const styles = css `:host{display:inline-flex;outline:none;resize:both;-webkit-tap-highlight-color:rgba(0,0,0,0)}.text-field,.field{width:100%}.text-field{display:inline-flex}.field{cursor:text}.disabled .field{cursor:default}.text-field,.textarea .field{resize:inherit}.icon{color:currentColor;display:flex;fill:currentColor}.icon ::slotted(*){display:flex}[hasstart] .icon.leading{font-size:var(--_leading-icon-size);height:var(--_leading-icon-size);width:var(--_leading-icon-size)}[hasend] .icon.trailing{font-size:var(--_trailing-icon-size);height:var(--_trailing-icon-size);width:var(--_trailing-icon-size)}.input-wrapper{display:flex}.input-wrapper>*{all:inherit;padding:0}.input{caret-color:var(--_caret-color);overflow-x:hidden;text-align:inherit}.input::placeholder{color:currentColor;opacity:1}.input::-webkit-calendar-picker-indicator{display:none}.input::-webkit-search-decoration,.input::-webkit-search-cancel-button{display:none}@media(forced-colors: active){.input{background:none}}:focus-within .input{caret-color:var(--_focus-caret-color)}.error:focus-within .input{caret-color:var(--_error-focus-caret-color)}.text-field:not(.disabled) .prefix{color:var(--_input-text-prefix-color)}.text-field:not(.disabled) .suffix{color:var(--_input-text-suffix-color)}.text-field:not(.disabled) .input::placeholder{color:var(--_input-text-placeholder-color)}.prefix,.suffix{text-wrap:nowrap;width:min-content}.prefix{padding-inline-end:var(--_input-text-prefix-trailing-space)}.suffix{padding-inline-start:var(--_input-text-suffix-leading-space)}/*# sourceMappingURL=shared-styles.css.map */
|
|
8
8
|
`;
|
|
9
9
|
//# sourceMappingURL=shared-styles.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-styles.css.js","sourceRoot":"","sources":["shared-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{display:inline-flex;outline:none;resize:both;-webkit-tap-highlight-color:rgba(0,0,0,0)}.text-field,.field{width:100%}.text-field{display:inline-flex}.field{cursor:text}.disabled .field{cursor:default}.text-field,.textarea .field{resize:inherit}.icon{color:currentColor;display:flex;fill:currentColor}.icon ::slotted(*){display:flex}[hasstart] .icon.leading{font-size:var(--_leading-icon-size);height:var(--_leading-icon-size);width:var(--_leading-icon-size)}[hasend] .icon.trailing{font-size:var(--_trailing-icon-size);height:var(--_trailing-icon-size);width:var(--_trailing-icon-size)}.input-wrapper{display:flex}.input-wrapper>*{all:inherit;padding:0}.input{caret-color:var(--_caret-color);overflow-x:hidden;text-align:inherit}.input::placeholder{color:currentColor;opacity:1}.input::-webkit-calendar-picker-indicator{display:none}.input::-webkit-search-decoration,.input::-webkit-search-cancel-button{display:none}@media(forced-colors: active){.input{background
|
|
1
|
+
{"version":3,"file":"shared-styles.css.js","sourceRoot":"","sources":["shared-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{display:inline-flex;outline:none;resize:both;-webkit-tap-highlight-color:rgba(0,0,0,0)}.text-field,.field{width:100%}.text-field{display:inline-flex}.field{cursor:text}.disabled .field{cursor:default}.text-field,.textarea .field{resize:inherit}.icon{color:currentColor;display:flex;fill:currentColor}.icon ::slotted(*){display:flex}[hasstart] .icon.leading{font-size:var(--_leading-icon-size);height:var(--_leading-icon-size);width:var(--_leading-icon-size)}[hasend] .icon.trailing{font-size:var(--_trailing-icon-size);height:var(--_trailing-icon-size);width:var(--_trailing-icon-size)}.input-wrapper{display:flex}.input-wrapper>*{all:inherit;padding:0}.input{caret-color:var(--_caret-color);overflow-x:hidden;text-align:inherit}.input::placeholder{color:currentColor;opacity:1}.input::-webkit-calendar-picker-indicator{display:none}.input::-webkit-search-decoration,.input::-webkit-search-cancel-button{display:none}@media(forced-colors: active){.input{background:none}}:focus-within .input{caret-color:var(--_focus-caret-color)}.error:focus-within .input{caret-color:var(--_error-focus-caret-color)}.text-field:not(.disabled) .prefix{color:var(--_input-text-prefix-color)}.text-field:not(.disabled) .suffix{color:var(--_input-text-suffix-color)}.text-field:not(.disabled) .input::placeholder{color:var(--_input-text-placeholder-color)}.prefix,.suffix{text-wrap:nowrap;width:min-content}.prefix{padding-inline-end:var(--_input-text-prefix-trailing-space)}.suffix{padding-inline-start:var(--_input-text-suffix-leading-space)}/*# sourceMappingURL=shared-styles.css.map */\n`;\n "]}
|
|
@@ -54,7 +54,25 @@ export declare abstract class TextField extends textFieldBaseClass {
|
|
|
54
54
|
* `reportValidity()`.
|
|
55
55
|
*/
|
|
56
56
|
errorText: string;
|
|
57
|
+
/**
|
|
58
|
+
* The floating Material label of the textfield component. It informs the user
|
|
59
|
+
* about what information is requested for a text field. It is aligned with
|
|
60
|
+
* the input text, is always visible, and it floats when focused or when text
|
|
61
|
+
* is entered into the textfield. This label also sets accessibilty labels,
|
|
62
|
+
* but the accessible label is overriden by `aria-label`.
|
|
63
|
+
*
|
|
64
|
+
* Learn more about floating labels from the Material Design guidelines:
|
|
65
|
+
* https://m3.material.io/components/text-fields/guidelines
|
|
66
|
+
*/
|
|
57
67
|
label: string;
|
|
68
|
+
/**
|
|
69
|
+
* Indicates that the user must specify a value for the input before the
|
|
70
|
+
* owning form can be submitted and will render an error state when
|
|
71
|
+
* `reportValidity()` is invoked when value is empty. Additionally the
|
|
72
|
+
* floating label will render an asterisk `"*"` when true.
|
|
73
|
+
*
|
|
74
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required
|
|
75
|
+
*/
|
|
58
76
|
required: boolean;
|
|
59
77
|
/**
|
|
60
78
|
* The current value of the text field. It is always a string.
|
|
@@ -130,6 +148,14 @@ export declare abstract class TextField extends textFieldBaseClass {
|
|
|
130
148
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern
|
|
131
149
|
*/
|
|
132
150
|
pattern: string;
|
|
151
|
+
/**
|
|
152
|
+
* Defines the text displayed in the textfield when it has no value. Provides
|
|
153
|
+
* a brief hint to the user as to the expected type of data that should be
|
|
154
|
+
* entered into the control. Unlike `label`, the placeholder is not visible
|
|
155
|
+
* and does not float when the textfield has a value.
|
|
156
|
+
*
|
|
157
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/placeholder
|
|
158
|
+
*/
|
|
133
159
|
placeholder: string;
|
|
134
160
|
/**
|
|
135
161
|
* Indicates whether or not a user should be able to edit the text field's
|
|
@@ -11,8 +11,8 @@ import { live } from 'lit/directives/live.js';
|
|
|
11
11
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
12
12
|
import { html as staticHtml } from 'lit/static-html.js';
|
|
13
13
|
import { requestUpdateOnAriaChange } from '../../internal/aria/delegate.js';
|
|
14
|
-
import { redispatchEvent } from '../../internal/controller/events.js';
|
|
15
14
|
import { stringConverter } from '../../internal/controller/string-converter.js';
|
|
15
|
+
import { redispatchEvent } from '../../internal/events/events.js';
|
|
16
16
|
import { createValidator, getValidityAnchor, mixinConstraintValidation, } from '../../labs/behaviors/constraint-validation.js';
|
|
17
17
|
import { mixinElementInternals } from '../../labs/behaviors/element-internals.js';
|
|
18
18
|
import { getFormValue, mixinFormAssociated, } from '../../labs/behaviors/form-associated.js';
|
|
@@ -52,7 +52,25 @@ export class TextField extends textFieldBaseClass {
|
|
|
52
52
|
* `reportValidity()`.
|
|
53
53
|
*/
|
|
54
54
|
this.errorText = '';
|
|
55
|
+
/**
|
|
56
|
+
* The floating Material label of the textfield component. It informs the user
|
|
57
|
+
* about what information is requested for a text field. It is aligned with
|
|
58
|
+
* the input text, is always visible, and it floats when focused or when text
|
|
59
|
+
* is entered into the textfield. This label also sets accessibilty labels,
|
|
60
|
+
* but the accessible label is overriden by `aria-label`.
|
|
61
|
+
*
|
|
62
|
+
* Learn more about floating labels from the Material Design guidelines:
|
|
63
|
+
* https://m3.material.io/components/text-fields/guidelines
|
|
64
|
+
*/
|
|
55
65
|
this.label = '';
|
|
66
|
+
/**
|
|
67
|
+
* Indicates that the user must specify a value for the input before the
|
|
68
|
+
* owning form can be submitted and will render an error state when
|
|
69
|
+
* `reportValidity()` is invoked when value is empty. Additionally the
|
|
70
|
+
* floating label will render an asterisk `"*"` when true.
|
|
71
|
+
*
|
|
72
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required
|
|
73
|
+
*/
|
|
56
74
|
this.required = false;
|
|
57
75
|
/**
|
|
58
76
|
* The current value of the text field. It is always a string.
|
|
@@ -129,6 +147,14 @@ export class TextField extends textFieldBaseClass {
|
|
|
129
147
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern
|
|
130
148
|
*/
|
|
131
149
|
this.pattern = '';
|
|
150
|
+
/**
|
|
151
|
+
* Defines the text displayed in the textfield when it has no value. Provides
|
|
152
|
+
* a brief hint to the user as to the expected type of data that should be
|
|
153
|
+
* entered into the control. Unlike `label`, the placeholder is not visible
|
|
154
|
+
* and does not float when the textfield has a value.
|
|
155
|
+
*
|
|
156
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/placeholder
|
|
157
|
+
*/
|
|
132
158
|
this.placeholder = '';
|
|
133
159
|
/**
|
|
134
160
|
* Indicates whether or not a user should be able to edit the text field's
|