igniteui-webcomponents 6.0.0 → 6.0.1
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/CHANGELOG.md +16 -0
- package/README.md +6 -1
- package/components/avatar/themes/dark/avatar.bootstrap.css.js +1 -1
- package/components/avatar/themes/dark/avatar.bootstrap.css.js.map +1 -1
- package/components/avatar/themes/dark/avatar.fluent.css.js +1 -1
- package/components/avatar/themes/dark/avatar.fluent.css.js.map +1 -1
- package/components/avatar/themes/dark/avatar.material.css.js +1 -1
- package/components/avatar/themes/dark/avatar.material.css.js.map +1 -1
- package/components/calendar/themes/dark/calendar.fluent.css.js +1 -1
- package/components/calendar/themes/dark/calendar.fluent.css.js.map +1 -1
- package/components/calendar/themes/light/calendar.fluent.css.js +1 -1
- package/components/calendar/themes/light/calendar.fluent.css.js.map +1 -1
- package/components/calendar/themes/light/calendar.shared.css.js +1 -1
- package/components/calendar/themes/light/calendar.shared.css.js.map +1 -1
- package/components/chip/chip.d.ts +4 -0
- package/components/chip/chip.js +26 -3
- package/components/chip/chip.js.map +1 -1
- package/components/chip/themes/shared/chip.common.css.js +1 -1
- package/components/chip/themes/shared/chip.common.css.js.map +1 -1
- package/components/chip/themes/shared/chip.indigo.css.js +1 -1
- package/components/chip/themes/shared/chip.indigo.css.js.map +1 -1
- package/components/common/controllers/gestures.d.ts +1 -0
- package/components/common/controllers/gestures.js.map +1 -1
- package/components/common/controllers/resize-observer.d.ts +11 -8
- package/components/common/controllers/resize-observer.js +3 -3
- package/components/common/controllers/resize-observer.js.map +1 -1
- package/components/date-picker/date-picker.d.ts +35 -35
- package/components/date-picker/date-picker.js +131 -128
- package/components/date-picker/date-picker.js.map +1 -1
- package/components/date-picker/themes/dark/date-picker.fluent.css.js +1 -1
- package/components/date-picker/themes/dark/date-picker.fluent.css.js.map +1 -1
- package/components/date-picker/themes/light/date-picker.fluent.css.js +1 -1
- package/components/date-picker/themes/light/date-picker.fluent.css.js.map +1 -1
- package/components/date-picker/themes/light/date-picker.shared.css.js +1 -1
- package/components/date-picker/themes/light/date-picker.shared.css.js.map +1 -1
- package/components/date-time-input/date-time-input.js +1 -1
- package/components/date-time-input/date-time-input.js.map +1 -1
- package/components/file-input/file-input.d.ts +1 -1
- package/components/file-input/file-input.js.map +1 -1
- package/components/input/themes/input.base.css.js +1 -1
- package/components/input/themes/input.base.css.js.map +1 -1
- package/components/progress/themes/circular/dark/circular.progress.shared.css.js +1 -1
- package/components/progress/themes/circular/dark/circular.progress.shared.css.js.map +1 -1
- package/components/progress/themes/linear/dark/linear.progress.bootstrap.css.js +1 -1
- package/components/progress/themes/linear/dark/linear.progress.bootstrap.css.js.map +1 -1
- package/components/progress/themes/linear/dark/linear.progress.shared.css.js +1 -1
- package/components/progress/themes/linear/dark/linear.progress.shared.css.js.map +1 -1
- package/components/radio-group/radio-group.d.ts +2 -1
- package/components/radio-group/radio-group.js +23 -10
- package/components/radio-group/radio-group.js.map +1 -1
- package/components/radio-group/themes/dark/radio-group.bootstrap.css.js +3 -0
- package/components/radio-group/themes/dark/radio-group.bootstrap.css.js.map +1 -0
- package/components/radio-group/themes/dark/radio-group.fluent.css.js +3 -0
- package/components/radio-group/themes/dark/radio-group.fluent.css.js.map +1 -0
- package/components/radio-group/themes/dark/radio-group.indigo.css.js +3 -0
- package/components/radio-group/themes/dark/radio-group.indigo.css.js.map +1 -0
- package/components/radio-group/themes/dark/radio-group.material.css.js +3 -0
- package/components/radio-group/themes/dark/radio-group.material.css.js.map +1 -0
- package/components/radio-group/themes/light/radio-group.bootstrap.css.d.ts +1 -0
- package/components/radio-group/themes/light/radio-group.bootstrap.css.js +3 -0
- package/components/radio-group/themes/light/radio-group.bootstrap.css.js.map +1 -0
- package/components/radio-group/themes/light/radio-group.fluent.css.d.ts +1 -0
- package/components/radio-group/themes/light/radio-group.fluent.css.js +3 -0
- package/components/radio-group/themes/light/radio-group.fluent.css.js.map +1 -0
- package/components/radio-group/themes/light/radio-group.indigo.css.d.ts +1 -0
- package/components/radio-group/themes/light/radio-group.indigo.css.js +3 -0
- package/components/radio-group/themes/light/radio-group.indigo.css.js.map +1 -0
- package/components/radio-group/themes/light/radio-group.material.css.d.ts +1 -0
- package/components/radio-group/themes/light/radio-group.material.css.js +3 -0
- package/components/radio-group/themes/light/radio-group.material.css.js.map +1 -0
- package/components/radio-group/themes/light/radio-group.shared.css.d.ts +1 -0
- package/components/radio-group/themes/light/radio-group.shared.css.js +3 -0
- package/components/radio-group/themes/light/radio-group.shared.css.js.map +1 -0
- package/components/radio-group/themes/radio-group.base.css.d.ts +1 -0
- package/components/radio-group/{radio-group.base.css.js → themes/radio-group.base.css.js} +1 -1
- package/components/radio-group/themes/radio-group.base.css.js.map +1 -0
- package/components/radio-group/themes/shared/radio-group.bootstrap.css.d.ts +1 -0
- package/components/radio-group/themes/shared/radio-group.bootstrap.css.js +3 -0
- package/components/radio-group/themes/shared/radio-group.bootstrap.css.js.map +1 -0
- package/components/radio-group/themes/shared/radio-group.common.css.d.ts +1 -0
- package/components/radio-group/themes/shared/radio-group.common.css.js +3 -0
- package/components/radio-group/themes/shared/radio-group.common.css.js.map +1 -0
- package/components/radio-group/themes/shared/radio-group.fluent.css.d.ts +1 -0
- package/components/radio-group/themes/shared/radio-group.fluent.css.js +3 -0
- package/components/radio-group/themes/shared/radio-group.fluent.css.js.map +1 -0
- package/components/radio-group/themes/shared/radio-group.indigo.css.d.ts +1 -0
- package/components/radio-group/themes/shared/radio-group.indigo.css.js +3 -0
- package/components/radio-group/themes/shared/radio-group.indigo.css.js.map +1 -0
- package/components/radio-group/themes/shared/radio-group.material.css.d.ts +1 -0
- package/components/radio-group/themes/shared/radio-group.material.css.js +3 -0
- package/components/radio-group/themes/shared/radio-group.material.css.js.map +1 -0
- package/components/radio-group/themes/themes.d.ts +2 -0
- package/components/radio-group/themes/themes.js +50 -0
- package/components/radio-group/themes/themes.js.map +1 -0
- package/components/stepper/themes/step/dark/step.indigo.css.js +1 -1
- package/components/stepper/themes/step/dark/step.indigo.css.js.map +1 -1
- package/components/stepper/themes/step/light/step.bootstrap.css.js +1 -1
- package/components/stepper/themes/step/light/step.bootstrap.css.js.map +1 -1
- package/components/stepper/themes/step/light/step.fluent.css.js +1 -1
- package/components/stepper/themes/step/light/step.fluent.css.js.map +1 -1
- package/components/stepper/themes/step/light/step.indigo.css.js +1 -1
- package/components/stepper/themes/step/light/step.indigo.css.js.map +1 -1
- package/components/stepper/themes/step/light/step.material.css.js +1 -1
- package/components/stepper/themes/step/light/step.material.css.js.map +1 -1
- package/components/stepper/themes/step/light/step.shared.css.js +1 -1
- package/components/stepper/themes/step/light/step.shared.css.js.map +1 -1
- package/components/tabs/tab-dom.d.ts +2 -2
- package/components/tabs/tab-dom.js +15 -2
- package/components/tabs/tab-dom.js.map +1 -1
- package/components/tabs/tabs.d.ts +2 -1
- package/components/tabs/tabs.js +2 -2
- package/components/tabs/tabs.js.map +1 -1
- package/components/tabs/themes/dark/tab.indigo.css.js +1 -1
- package/components/tabs/themes/dark/tab.indigo.css.js.map +1 -1
- package/components/tabs/themes/light/tab.indigo.css.js +1 -1
- package/components/tabs/themes/light/tab.indigo.css.js.map +1 -1
- package/components/tabs/themes/tab.base.css.js +1 -1
- package/components/tabs/themes/tab.base.css.js.map +1 -1
- package/components/textarea/textarea.d.ts +29 -32
- package/components/textarea/textarea.js +89 -91
- package/components/textarea/textarea.js.map +1 -1
- package/components/tooltip/tooltip.js.map +1 -1
- package/components/types.d.ts +1 -1
- package/components/types.js.map +1 -1
- package/components/validation-container/themes/dark/validator.indigo.css.js +1 -1
- package/components/validation-container/themes/dark/validator.indigo.css.js.map +1 -1
- package/custom-elements.json +497 -270
- package/package.json +1 -1
- package/themes/dark/bootstrap.css +1 -1
- package/themes/dark/fluent.css +1 -1
- package/themes/dark/indigo.css +1 -1
- package/themes/dark/material.css +1 -1
- package/themes/light/bootstrap.css +1 -1
- package/themes/light/fluent.css +1 -1
- package/themes/light/indigo.css +1 -1
- package/themes/light/material.css +1 -1
- package/web-types.json +1 -1
- package/components/radio-group/radio-group.base.css.js.map +0 -1
- package/components/radio-group/radio-group.fluent.css.js +0 -3
- package/components/radio-group/radio-group.fluent.css.js.map +0 -1
- package/components/radio-group/radio-group.indigo.css.js +0 -3
- package/components/radio-group/radio-group.indigo.css.js.map +0 -1
- package/components/radio-group/radio-group.material.css.js +0 -3
- package/components/radio-group/radio-group.material.css.js.map +0 -1
- /package/components/radio-group/{radio-group.base.css.d.ts → themes/dark/radio-group.bootstrap.css.d.ts} +0 -0
- /package/components/radio-group/{radio-group.fluent.css.d.ts → themes/dark/radio-group.fluent.css.d.ts} +0 -0
- /package/components/radio-group/{radio-group.indigo.css.d.ts → themes/dark/radio-group.indigo.css.d.ts} +0 -0
- /package/components/radio-group/{radio-group.material.css.d.ts → themes/dark/radio-group.material.css.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../../src/components/textarea/textarea.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAuB,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrE,OAAO,EACL,QAAQ,EACR,KAAK,EACL,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAkB,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,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AAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;0DAC3C;AAGZ;IADf,KAAK,CAAC,OAAO,CAAC;wDAId;AAIS;IAFT,KAAK,CAAC,MAAM,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;IAC7C,KAAK,CAAC,QAAQ,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;yDAQ/C;AA3NkB,oBAAoB;IADxC,MAAM,CAAC,GAAG,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC;GACnB,oBAAoB,CAqaxC;eAraoB,oBAAoB","sourcesContent":["import { LitElement, type TemplateResult, html, nothing } from 'lit';\nimport {\n property,\n query,\n queryAssignedElements,\n queryAssignedNodes,\n} from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { type StyleInfo, styleMap } from 'lit/directives/style-map.js';\n\nimport { getThemeController, themes } from '../../theming/theming-decorator.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport type { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { FormAssociatedRequiredMixin } from '../common/mixins/forms/associated-required.js';\nimport {\n type FormValue,\n createFormValueState,\n} from '../common/mixins/forms/form-value.js';\nimport {\n asNumber,\n createCounter,\n isEmpty,\n partNameMap,\n} from '../common/util.js';\nimport type {\n RangeTextSelectMode,\n SelectionRangeDirection,\n TextareaResize,\n} from '../types.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\nimport { styles as shared } from './themes/shared/textarea.common.css.js';\nimport { styles } from './themes/textarea.base.css.js';\nimport { all } from './themes/themes.js';\nimport { textAreaValidators } from './validators.js';\n\nexport interface IgcTextareaComponentEventMap {\n igcInput: CustomEvent<string>;\n igcChange: CustomEvent<string>;\n // For analyzer meta only:\n /* skipWCPrefix */\n focus: FocusEvent;\n /* skipWCPrefix */\n blur: FocusEvent;\n}\n\n/**\n * This element represents a multi-line plain-text editing control,\n * useful when you want to allow users to enter a sizeable amount of free-form text,\n * for example a comment on a review or feedback form.\n *\n * @element igc-textarea\n *\n * @slot - Text content from the default slot will be used as the value of the component.\n * @slot prefix - Renders content before the input.\n * @slot suffix - Renders content after input.\n * @slot helper-text - Renders content below the input.\n * @slot value-missing - Renders content when the required validation fails.\n * @slot too-long - Renders content when the maxlength validation fails.\n * @slot too-short - Renders content when the minlength validation fails.\n * @slot custom-error - Renders content when setCustomValidity(message) is set.\n * @slot invalid - Renders content when the component is in invalid state (validity.valid = false).\n *\n * @fires igcInput - Emitted when the control receives user input.\n * @fires igcChange - Emitted when the a change to the control value is committed by the user.\n *\n * @csspart container - The main wrapper that holds all main input elements of the textarea.\n * @csspart input - The native input element of the igc-textarea.\n * @csspart label - The native label element of the igc-textarea.\n * @csspart prefix - The prefix wrapper of the igc-textarea.\n * @csspart suffix - The suffix wrapper of the igc-textarea.\n * @csspart helper-text - The helper text wrapper of the igc-textarea.\n */\n@themes(all, { exposeController: true })\nexport default class IgcTextareaComponent extends FormAssociatedRequiredMixin(\n EventEmitterMixin<IgcTextareaComponentEventMap, Constructor<LitElement>>(\n LitElement\n )\n) {\n public static readonly tagName = 'igc-textarea';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register() {\n registerComponent(IgcTextareaComponent, IgcValidationContainerComponent);\n }\n\n protected static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n private static readonly increment = createCounter();\n\n protected override get __validators() {\n return textAreaValidators;\n }\n\n protected override _formValue: FormValue<string>;\n\n protected inputId = `textarea-${IgcTextareaComponent.increment()}`;\n\n private observer!: ResizeObserver;\n\n @queryAssignedNodes({ flatten: true })\n private projected!: Array<Node>;\n\n @queryAssignedElements({\n slot: 'prefix',\n selector: '[slot=\"prefix\"]:not([hidden])',\n })\n protected prefixes!: Array<HTMLElement>;\n\n @queryAssignedElements({\n slot: 'suffix',\n selector: '[slot=\"suffix\"]:not([hidden])',\n })\n protected suffixes!: Array<HTMLElement>;\n\n @query('textarea', true)\n private input!: HTMLTextAreaElement;\n\n private get resizeStyles(): StyleInfo {\n return {\n resize: this.resize === 'auto' ? 'none' : this.resize,\n };\n }\n\n protected get _isMaterial() {\n return getThemeController(this)?.theme === 'material';\n }\n\n /**\n * Specifies what if any permission the browser has to provide for automated assistance in filling out form field values,\n * as well as guidance to the browser as to the type of information expected in the field.\n * Refer to [this page](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for additional information.\n *\n * @attr\n */\n @property()\n public autocomplete!: string;\n\n /**\n * Controls whether and how text input is automatically capitalized as it is entered/edited by the user.\n *\n * [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize).\n *\n * @attr\n */\n @property()\n public override autocapitalize!: string;\n\n /**\n * Hints at the type of data that might be entered by the user while editing the element or its contents.\n * This allows a browser to display an appropriate virtual keyboard.\n *\n * [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode)\n *\n * @attr inputmode\n */\n @property({ attribute: 'inputmode' })\n public override inputMode!: string;\n\n /**\n * The label for the control.\n *\n * @attr\n */\n @property()\n public label!: string;\n\n /**\n * The maximum number of characters (UTF-16 code units) that the user can enter.\n * If this value isn't specified, the user can enter an unlimited number of characters.\n *\n * @attr maxlength\n */\n @property({ type: Number, attribute: 'maxlength' })\n public maxLength!: number;\n\n /**\n * The minimum number of characters (UTF-16 code units) required that the user should enter.\n *\n * @attr minlength\n */\n @property({ type: Number, attribute: 'minlength' })\n public minLength!: number;\n\n /**\n * Whether the control will have outlined appearance.\n * @attr\n */\n @property({ reflect: true, type: Boolean })\n public outlined = false;\n\n /**\n * The placeholder attribute of the control.\n *\n * @attr\n */\n @property()\n public placeholder!: string;\n\n /**\n * Makes the control a readonly field.\n *\n * @attr readonly\n */\n @property({ type: Boolean, reflect: true, attribute: 'readonly' })\n public readOnly = false;\n\n /**\n * Controls whether the control can be resized.\n * When `auto` is set, the control will try to expand and fit its content.\n *\n * @attr\n */\n @property()\n public resize: TextareaResize = 'vertical';\n\n /**\n * The number of visible text lines for the control. If it is specified, it must be a positive integer.\n * If it is not specified, the default value is 2.\n *\n * @attr\n */\n @property({ type: Number })\n public rows = 2;\n\n /* @tsTwoWayProperty(true, \"igcChange\", \"detail\", false) */\n /**\n * The value of the component\n *\n * @attr\n */\n @property()\n public set value(value: string) {\n this._formValue.setValueAndFormState(value);\n this._validate();\n }\n\n public get value(): string {\n return this._formValue.value;\n }\n\n /**\n * Controls whether the element may be checked for spelling errors.\n *\n * @attr\n */\n @property({\n type: Boolean,\n converter: {\n fromAttribute: (value) => !(!value || value === 'false'),\n toAttribute: (value) => (value ? 'true' : 'false'),\n },\n })\n public override spellcheck = true;\n\n /**\n * Indicates how the control should wrap the value for form submission.\n * Refer to [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attributes)\n * for explanation of the available values.\n *\n * @attr\n */\n @property()\n public wrap: 'hard' | 'soft' | 'off' = 'soft';\n\n /**\n * Enables validation rules to be evaluated without restricting user input. This applies to the `maxLength` property\n * when it is defined.\n *\n * @attr validate-only\n */\n @property({ type: Boolean, reflect: true, attribute: 'validate-only' })\n public validateOnly = false;\n\n @watch('value')\n protected async valueChanged() {\n await this.updateComplete;\n this.setAreaHeight();\n }\n\n @watch('rows', { waitUntilFirstUpdate: true })\n @watch('resize', { waitUntilFirstUpdate: true })\n protected setAreaHeight() {\n if (this.resize === 'auto') {\n this.input.style.height = 'auto';\n this.input.style.height = `${this.setAutoHeight()}px`;\n } else {\n Object.assign(this.input.style, { height: undefined });\n }\n }\n\n constructor() {\n super();\n\n this._formValue = createFormValueState(this, { initialValue: '' });\n\n this.addEventListener('focus', this.handleFocus);\n this.addEventListener('blur', this.handleBlur);\n }\n\n public override async connectedCallback() {\n super.connectedCallback();\n\n await this.updateComplete;\n\n this.setAreaHeight();\n this.observer = new ResizeObserver(() => this.setAreaHeight());\n this.observer.observe(this.input);\n }\n\n public override disconnectedCallback(): void {\n this.observer.disconnect();\n super.disconnectedCallback();\n }\n\n /** Selects all text within the control. */\n public select() {\n this.input.select();\n }\n\n /** Sets the text selection range of the control */\n public setSelectionRange(\n start: number,\n end: number,\n direction: SelectionRangeDirection = 'none'\n ) {\n this.input.setSelectionRange(start, end, direction);\n }\n\n /** Replaces the selected text in the control. */\n public setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectMode: RangeTextSelectMode = 'preserve'\n ) {\n this.input.setRangeText(replacement, start, end, selectMode);\n this.value = this.input.value;\n }\n\n /* blazorSuppress */\n public override scrollTo(options?: ScrollToOptions | undefined): void;\n /* blazorSuppress */\n public override scrollTo(x: number, y: number): void;\n public override scrollTo(x?: unknown, y?: unknown): void {\n x !== undefined && y !== undefined\n ? this.input.scrollTo(x as number, y as number)\n : this.input.scrollTo(x as ScrollToOptions);\n }\n\n protected resolvePartNames() {\n return {\n container: true,\n prefixed: this.prefixes.length > 0,\n suffixed: this.suffixes.length > 0,\n filled: !!this.value,\n };\n }\n\n private setAutoHeight() {\n const { borderTopWidth, borderBottomWidth } = getComputedStyle(this.input);\n return (\n this.input.scrollHeight +\n asNumber(borderTopWidth) +\n asNumber(borderBottomWidth)\n );\n }\n\n protected handleInput() {\n this.value = this.input.value;\n this.emitEvent('igcInput', { detail: this.value });\n }\n\n protected handleChange() {\n this.value = this.input.value;\n this.emitEvent('igcChange', { detail: this.value });\n }\n\n protected handleFocus() {\n this._dirty = true;\n }\n\n protected handleBlur() {\n this._validate();\n }\n\n protected valueSlotChange() {\n const value = this.projected\n .map((node) => node.textContent?.trim())\n .filter((node) => Boolean(node));\n\n if (value.length) {\n this.value = value.join('\\r\\n');\n }\n }\n\n protected renderValueSlot() {\n return html`\n <slot style=\"display: none\" @slotchange=${this.valueSlotChange}></slot>\n `;\n }\n\n protected renderValidationContainer(): TemplateResult {\n return IgcValidationContainerComponent.create(this);\n }\n\n protected renderPrefix() {\n return html`\n <div part=\"prefix\" .hidden=${isEmpty(this.prefixes)}>\n <slot name=\"prefix\"></slot>\n </div>\n `;\n }\n\n protected renderSuffix() {\n return html`\n <div part=\"suffix\" .hidden=${isEmpty(this.suffixes)}>\n <slot name=\"suffix\"></slot>\n </div>\n `;\n }\n\n protected renderLabel() {\n return this.label\n ? html`\n <label part=\"label\" for=${this.id || this.inputId}>\n ${this.label}\n </label>\n `\n : nothing;\n }\n\n protected renderStandard() {\n return html`\n ${this.renderLabel()}\n <div part=${partNameMap(this.resolvePartNames())}>\n ${this.renderPrefix()} ${this.renderInput()} ${this.renderSuffix()}\n </div>\n ${this.renderValidationContainer()}\n `;\n }\n\n protected renderMaterial() {\n return html`\n <div\n part=${partNameMap({\n ...this.resolvePartNames(),\n labelled: this.label,\n placeholder: this.placeholder,\n })}\n >\n <div part=\"start\">${this.renderPrefix()}</div>\n ${this.renderInput()}\n <div part=\"notch\">${this.renderLabel()}</div>\n <div part=\"filler\"></div>\n <div part=\"end\">${this.renderSuffix()}</div>\n </div>\n ${this.renderValidationContainer()}\n `;\n }\n\n protected renderInput() {\n return html`\n ${this.renderValueSlot()}\n <textarea\n id=${this.id || this.inputId}\n part=\"input\"\n style=${styleMap(this.resizeStyles)}\n @input=${this.handleInput}\n @change=${this.handleChange}\n placeholder=${ifDefined(this.placeholder)}\n .rows=${this.rows}\n .value=${live(this.value)}\n .wrap=${this.wrap}\n autocomplete=${ifDefined(this.autocomplete as any)}\n autocapitalize=${ifDefined(this.autocapitalize as any)}\n inputmode=${ifDefined(this.inputMode)}\n spellcheck=${ifDefined(this.spellcheck)}\n minlength=${ifDefined(this.minLength)}\n maxlength=${ifDefined(this.validateOnly ? undefined : this.maxLength)}\n ?disabled=${this.disabled}\n ?required=${this.required}\n ?readonly=${this.readOnly}\n aria-invalid=${this.invalid ? 'true' : 'false'}\n ></textarea>\n `;\n }\n\n protected override render() {\n return this._isMaterial ? this.renderMaterial() : this.renderStandard();\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-textarea': IgcTextareaComponent;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../../src/components/textarea/textarea.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAuB,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrE,OAAO,EACL,QAAQ,EACR,KAAK,EACL,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAkB,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAEL,oBAAoB,GACrB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,QAAQ,EACR,aAAa,EACb,OAAO,EACP,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAM3B,OAAO,+BAA+B,MAAM,iDAAiD,CAAC;AAC9F,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAwCtC,IAAM,oBAAoB,4BA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N,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;sDACnB;AAQjB;IADN,QAAQ,EAAE;yDACiB;AAQrB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;sDAC1C;AASjB;IADN,QAAQ,EAAE;oDACgC;AASpC;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDACX;AAShB;IADC,QAAQ,EAAE;iDAIV;AAkBe;IAPf,QAAQ,CAAC;QACR,IAAI,EAAE,OAAO;QACb,SAAS,EAAE;YACT,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,OAAO,CAAC;YACxD,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;SACnD;KACF,CAAC;wDACgC;AAU3B;IADN,QAAQ,EAAE;kDACmC;AASvC;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;0DAC3C;AAOZ;IADf,KAAK,CAAC,OAAO,CAAC;yDAId;AAIS;IAFT,KAAK,CAAC,MAAM,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;IAC7C,KAAK,CAAC,QAAQ,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;0DAQ/C;AAnOkB,oBAAoB;IADxC,MAAM,CAAC,GAAG,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC;GACnB,oBAAoB,CAkcxC;eAlcoB,oBAAoB","sourcesContent":["import { LitElement, type TemplateResult, html, nothing } from 'lit';\nimport {\n property,\n query,\n queryAssignedElements,\n queryAssignedNodes,\n} from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { type StyleInfo, styleMap } from 'lit/directives/style-map.js';\n\nimport { getThemeController, themes } from '../../theming/theming-decorator.js';\nimport { createResizeObserverController } from '../common/controllers/resize-observer.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport type { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { FormAssociatedRequiredMixin } from '../common/mixins/forms/associated-required.js';\nimport {\n type FormValue,\n createFormValueState,\n} from '../common/mixins/forms/form-value.js';\nimport {\n asNumber,\n createCounter,\n isEmpty,\n partNameMap,\n} from '../common/util.js';\nimport type {\n RangeTextSelectMode,\n SelectionRangeDirection,\n TextareaResize,\n} from '../types.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\nimport { styles as shared } from './themes/shared/textarea.common.css.js';\nimport { styles } from './themes/textarea.base.css.js';\nimport { all } from './themes/themes.js';\nimport { textAreaValidators } from './validators.js';\n\nexport interface IgcTextareaComponentEventMap {\n igcInput: CustomEvent<string>;\n igcChange: CustomEvent<string>;\n // For analyzer meta only:\n /* skipWCPrefix */\n focus: FocusEvent;\n /* skipWCPrefix */\n blur: FocusEvent;\n}\n\n/**\n * This element represents a multi-line plain-text editing control,\n * useful when you want to allow users to enter a sizeable amount of free-form text,\n * for example a comment on a review or feedback form.\n *\n * @element igc-textarea\n *\n * @slot - Text content from the default slot will be used as the value of the component.\n * @slot prefix - Renders content before the input.\n * @slot suffix - Renders content after input.\n * @slot helper-text - Renders content below the input.\n * @slot value-missing - Renders content when the required validation fails.\n * @slot too-long - Renders content when the maxlength validation fails.\n * @slot too-short - Renders content when the minlength validation fails.\n * @slot custom-error - Renders content when setCustomValidity(message) is set.\n * @slot invalid - Renders content when the component is in invalid state (validity.valid = false).\n *\n * @fires igcInput - Emitted when the control receives user input.\n * @fires igcChange - Emitted when the a change to the control value is committed by the user.\n *\n * @csspart container - The main wrapper that holds all main input elements of the textarea.\n * @csspart input - The native input element of the igc-textarea.\n * @csspart label - The native label element of the igc-textarea.\n * @csspart prefix - The prefix wrapper of the igc-textarea.\n * @csspart suffix - The suffix wrapper of the igc-textarea.\n * @csspart helper-text - The helper text wrapper of the igc-textarea.\n */\n@themes(all, { exposeController: true })\nexport default class IgcTextareaComponent extends FormAssociatedRequiredMixin(\n EventEmitterMixin<IgcTextareaComponentEventMap, Constructor<LitElement>>(\n LitElement\n )\n) {\n public static readonly tagName = 'igc-textarea';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(IgcTextareaComponent, IgcValidationContainerComponent);\n }\n\n protected static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n //#region Private properties and state\n\n private static readonly increment = createCounter();\n\n protected override get __validators() {\n return textAreaValidators;\n }\n\n protected override readonly _formValue: FormValue<string>;\n\n protected readonly _inputId = `textarea-${IgcTextareaComponent.increment()}`;\n\n @queryAssignedNodes({ flatten: true })\n private readonly _projected!: Node[];\n\n @queryAssignedElements({\n slot: 'prefix',\n selector: '[slot=\"prefix\"]:not([hidden])',\n })\n protected readonly _prefixes!: HTMLElement[];\n\n @queryAssignedElements({\n slot: 'suffix',\n selector: '[slot=\"suffix\"]:not([hidden])',\n })\n protected readonly _suffixes!: HTMLElement[];\n\n @query('textarea', true)\n private readonly _input!: HTMLTextAreaElement;\n\n private get _resizeStyles(): StyleInfo {\n return {\n resize: this.resize === 'auto' ? 'none' : this.resize,\n };\n }\n\n protected get _isMaterial(): boolean {\n return getThemeController(this)?.theme === 'material';\n }\n\n //#endregion\n\n //#region Public properties and attributes\n\n /**\n * Specifies what if any permission the browser has to provide for automated assistance in filling out form field values,\n * as well as guidance to the browser as to the type of information expected in the field.\n * Refer to [this page](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for additional information.\n *\n * @attr\n */\n @property()\n public autocomplete!: string;\n\n /**\n * Controls whether and how text input is automatically capitalized as it is entered/edited by the user.\n *\n * [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize).\n *\n * @attr\n */\n @property()\n public override autocapitalize!: string;\n\n /**\n * Hints at the type of data that might be entered by the user while editing the element or its contents.\n * This allows a browser to display an appropriate virtual keyboard.\n *\n * [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode)\n *\n * @attr inputmode\n */\n @property({ attribute: 'inputmode' })\n public override inputMode!: string;\n\n /**\n * The label for the control.\n *\n * @attr\n */\n @property()\n public label!: string;\n\n /**\n * The maximum number of characters (UTF-16 code units) that the user can enter.\n * If this value isn't specified, the user can enter an unlimited number of characters.\n *\n * @attr maxlength\n */\n @property({ type: Number, attribute: 'maxlength' })\n public maxLength!: number;\n\n /**\n * The minimum number of characters (UTF-16 code units) required that the user should enter.\n *\n * @attr minlength\n */\n @property({ type: Number, attribute: 'minlength' })\n public minLength!: number;\n\n /**\n * Whether the control will have outlined appearance.\n * @attr\n */\n @property({ reflect: true, type: Boolean })\n public outlined = false;\n\n /**\n * The placeholder attribute of the control.\n *\n * @attr\n */\n @property()\n public placeholder!: string;\n\n /**\n * Makes the control a readonly field.\n *\n * @attr readonly\n */\n @property({ type: Boolean, reflect: true, attribute: 'readonly' })\n public readOnly = false;\n\n /**\n * Controls whether the control can be resized.\n * When `auto` is set, the control will try to expand and fit its content.\n *\n * @attr\n */\n @property()\n public resize: TextareaResize = 'vertical';\n\n /**\n * The number of visible text lines for the control. If it is specified, it must be a positive integer.\n * If it is not specified, the default value is 2.\n *\n * @attr\n */\n @property({ type: Number })\n public rows = 2;\n\n /* @tsTwoWayProperty(true, \"igcChange\", \"detail\", false) */\n /**\n * The value of the component\n *\n * @attr\n */\n @property()\n public set value(value: string) {\n this._formValue.setValueAndFormState(value);\n this._validate();\n }\n\n public get value(): string {\n return this._formValue.value;\n }\n\n /**\n * Controls whether the element may be checked for spelling errors.\n *\n * @attr\n */\n @property({\n type: Boolean,\n converter: {\n fromAttribute: (value) => !(!value || value === 'false'),\n toAttribute: (value) => (value ? 'true' : 'false'),\n },\n })\n public override spellcheck = true;\n\n /**\n * Indicates how the control should wrap the value for form submission.\n * Refer to [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attributes)\n * for explanation of the available values.\n *\n * @attr\n */\n @property()\n public wrap: 'hard' | 'soft' | 'off' = 'soft';\n\n /**\n * Enables validation rules to be evaluated without restricting user input. This applies to the `maxLength` property\n * when it is defined.\n *\n * @attr validate-only\n */\n @property({ type: Boolean, reflect: true, attribute: 'validate-only' })\n public validateOnly = false;\n\n //#endregion\n\n //#region Watchers\n\n @watch('value')\n protected async _valueChanged(): Promise<void> {\n await this.updateComplete;\n this._setAreaHeight();\n }\n\n @watch('rows', { waitUntilFirstUpdate: true })\n @watch('resize', { waitUntilFirstUpdate: true })\n protected _setAreaHeight(): void {\n if (this.resize === 'auto') {\n this._input.style.height = 'auto';\n this._input.style.height = `${this._setAutoHeight()}px`;\n } else {\n Object.assign(this._input.style, { height: undefined });\n }\n }\n\n //#endregion\n\n //#region Life-cycle hooks\n\n constructor() {\n super();\n\n createResizeObserverController(this, {\n callback: this._setAreaHeight,\n });\n\n this._formValue = createFormValueState(this, { initialValue: '' });\n\n this.addEventListener('focus', this._handleFocus);\n this.addEventListener('blur', this._handleBlur);\n }\n\n protected override createRenderRoot(): HTMLElement | DocumentFragment {\n const root = super.createRenderRoot();\n root.addEventListener('slotchange', (event) =>\n this._handleSlotChange(event)\n );\n return root;\n }\n\n //#endregion\n\n //#region Internal methods\n\n protected _resolvePartNames() {\n return {\n container: true,\n prefixed: this._prefixes.length > 0,\n suffixed: this._suffixes.length > 0,\n filled: !!this.value,\n };\n }\n\n private _setAutoHeight(): number {\n const { borderTopWidth, borderBottomWidth } = getComputedStyle(this._input);\n return (\n this._input.scrollHeight +\n asNumber(borderTopWidth) +\n asNumber(borderBottomWidth)\n );\n }\n\n //#endregion\n\n //#region Event handlers\n\n protected _handleSlotChange({ target }: Event): void {\n const slot = target as HTMLSlotElement;\n\n // Default slot used for declarative value projection\n if (!slot.name) {\n const value = this._projected\n .map((node) => node.textContent?.trim())\n .filter((node) => Boolean(node))\n .join('\\r\\n');\n\n if (value !== this.value) {\n this.value = value;\n }\n }\n\n this.requestUpdate();\n }\n\n protected _handleInput(): void {\n this.value = this._input.value;\n this.emitEvent('igcInput', { detail: this.value });\n }\n\n protected _handleChange(): void {\n this.value = this._input.value;\n this.emitEvent('igcChange', { detail: this.value });\n }\n\n protected _handleFocus(): void {\n this._dirty = true;\n }\n\n protected _handleBlur(): void {\n this._validate();\n }\n\n //#endregion\n\n //#region Public methods\n\n /** Selects all text within the control. */\n public select(): void {\n this._input.select();\n }\n\n /** Sets the text selection range of the control */\n public setSelectionRange(\n start: number,\n end: number,\n direction: SelectionRangeDirection = 'none'\n ): void {\n this._input.setSelectionRange(start, end, direction);\n }\n\n /** Replaces the selected text in the control. */\n public setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectMode: RangeTextSelectMode = 'preserve'\n ): void {\n this._input.setRangeText(replacement, start, end, selectMode);\n this.value = this._input.value;\n }\n\n /* blazorSuppress */\n public override scrollTo(options?: ScrollToOptions | undefined): void;\n /* blazorSuppress */\n public override scrollTo(x: number, y: number): void;\n public override scrollTo(x?: unknown, y?: unknown): void {\n x != null && y != null\n ? this._input.scrollTo(x as number, y as number)\n : this._input.scrollTo(x as ScrollToOptions);\n }\n\n //#endregion\n\n //#region Renderers\n\n protected _renderPrefix() {\n return html`\n <div part=\"prefix\" .hidden=${isEmpty(this._prefixes)}>\n <slot name=\"prefix\"></slot>\n </div>\n `;\n }\n\n protected _renderSuffix() {\n return html`\n <div part=\"suffix\" .hidden=${isEmpty(this._suffixes)}>\n <slot name=\"suffix\"></slot>\n </div>\n `;\n }\n\n protected _renderLabel() {\n return this.label\n ? html`\n <label part=\"label\" for=${this.id || this._inputId}>\n ${this.label}\n </label>\n `\n : nothing;\n }\n\n protected _renderStandard() {\n return html`\n ${this._renderLabel()}\n <div part=${partNameMap(this._resolvePartNames())}>\n ${this._renderPrefix()} ${this._renderInput()} ${this._renderSuffix()}\n </div>\n ${this._renderValidationContainer()}\n `;\n }\n\n protected _renderMaterial() {\n return html`\n <div\n part=${partNameMap({\n ...this._resolvePartNames(),\n labelled: this.label,\n placeholder: this.placeholder,\n })}\n >\n <div part=\"start\">${this._renderPrefix()}</div>\n ${this._renderInput()}\n <div part=\"notch\">${this._renderLabel()}</div>\n <div part=\"filler\"></div>\n <div part=\"end\">${this._renderSuffix()}</div>\n </div>\n ${this._renderValidationContainer()}\n `;\n }\n\n protected _renderInput() {\n return html`\n <slot style=\"display: none\"></slot>\n <textarea\n id=${this.id || this._inputId}\n part=\"input\"\n style=${styleMap(this._resizeStyles)}\n @input=${this._handleInput}\n @change=${this._handleChange}\n placeholder=${ifDefined(this.placeholder)}\n .rows=${this.rows}\n .value=${live(this.value)}\n .wrap=${this.wrap}\n autocomplete=${ifDefined(this.autocomplete as any)}\n autocapitalize=${ifDefined(this.autocapitalize as any)}\n inputmode=${ifDefined(this.inputMode)}\n spellcheck=${ifDefined(this.spellcheck)}\n minlength=${ifDefined(this.minLength)}\n maxlength=${ifDefined(this.validateOnly ? undefined : this.maxLength)}\n ?disabled=${this.disabled}\n ?required=${this.required}\n ?readonly=${this.readOnly}\n aria-invalid=${this.invalid ? 'true' : 'false'}\n ></textarea>\n `;\n }\n\n protected _renderValidationContainer(): TemplateResult {\n return IgcValidationContainerComponent.create(this);\n }\n\n protected override render() {\n return this._isMaterial ? this._renderMaterial() : this._renderStandard();\n }\n\n //#endregion\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-textarea': IgcTextareaComponent;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.ts"],"names":[],"mappings":";;;;;;;AAAA,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AAE;mDACsB;AAUjC;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;uDAGxC;AAcD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;uDAGxC;AAaD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDAGnD;AAaD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDAGnD;AAYM;IADN,QAAQ,EAAE;oDACS;AASb;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDACrB;AAqBZ;IADT,KAAK,CAAC,QAAQ,CAAC;0DAGf;AAGS;IADT,KAAK,CAAC,QAAQ,CAAC;0DAGf;AAlOkB,mBAAmB;IADvC,MAAM,CAAC,GAAG,CAAC;GACS,mBAAmB,CAmYvC;eAnYoB,mBAAmB","sourcesContent":["import { LitElement, html, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { createRef, ref } from 'lit/directives/ref.js';\nimport { EaseOut } from '../../animations/easings.js';\nimport { addAnimationController } from '../../animations/player.js';\nimport { fadeOut } from '../../animations/presets/fade/index.js';\nimport { scaleInCenter } from '../../animations/presets/scale/index.js';\nimport { themes } from '../../theming/theming-decorator.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport type { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { asNumber, isLTR } from '../common/util.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport IgcPopoverComponent, {\n type PopoverPlacement,\n} from '../popover/popover.js';\nimport { TooltipRegexes, addTooltipController } from './controller.js';\nimport { styles as shared } from './themes/shared/tooltip.common.css.js';\nimport { all } from './themes/themes.js';\nimport { styles } from './themes/tooltip.base.css.js';\n\nexport interface IgcTooltipComponentEventMap {\n igcOpening: CustomEvent<Element | null>;\n igcOpened: CustomEvent<Element | null>;\n igcClosing: CustomEvent<Element | null>;\n igcClosed: CustomEvent<Element | null>;\n}\n\ntype TooltipStateOptions = {\n show: boolean;\n withDelay?: boolean;\n withEvents?: boolean;\n};\n\n/**\n * Provides a way to display supplementary information related to an element when a user interacts with it (e.g., hover, focus).\n * It offers features such as placement customization, delays, sticky mode, and animations.\n *\n * @element igc-tooltip\n *\n * @slot - Default slot of the tooltip component.\n * @slot close-button - Slot for custom sticky-mode close action (e.g., an icon/button).\n *\n * @csspart base - The wrapping container of the tooltip content.\n *\n * @fires igcOpening - Emitted before the tooltip begins to open. Can be canceled to prevent opening.\n * @fires igcOpened - Emitted after the tooltip has successfully opened and is visible.\n * @fires igcClosing - Emitted before the tooltip begins to close. Can be canceled to prevent closing.\n * @fires igcClosed - Emitted after the tooltip has been fully removed from view.\n */\n@themes(all)\nexport default class IgcTooltipComponent extends EventEmitterMixin<\n IgcTooltipComponentEventMap,\n Constructor<LitElement>\n>(LitElement) {\n public static readonly tagName = 'igc-tooltip';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(\n IgcTooltipComponent,\n IgcPopoverComponent,\n IgcIconComponent\n );\n }\n\n private readonly _internals: ElementInternals;\n\n private readonly _controller = addTooltipController(this, {\n onShow: this._showOnInteraction,\n onHide: this._hideOnInteraction,\n onEscape: this._hideOnEscape,\n });\n\n private readonly _containerRef = createRef<HTMLElement>();\n private readonly _player = addAnimationController(this, this._containerRef);\n\n private readonly _showAnimation = scaleInCenter({\n duration: 150,\n easing: EaseOut.Quad,\n });\n\n private readonly _hideAnimation = fadeOut({\n duration: 75,\n easing: EaseOut.Sine,\n });\n\n private _timeoutId?: number;\n private _autoHideDelay = 180;\n private _showDelay = 200;\n private _hideDelay = 300;\n\n @query('#arrow')\n private _arrowElement!: HTMLElement;\n\n private get _arrowOffset() {\n if (this.placement.includes('-')) {\n // Horizontal start | end placement\n\n if (TooltipRegexes.horizontalStart.test(this.placement)) {\n return -8;\n }\n\n if (TooltipRegexes.horizontalEnd.test(this.placement)) {\n return 8;\n }\n\n // Vertical start | end placement\n\n if (TooltipRegexes.start.test(this.placement)) {\n return isLTR(this) ? -8 : 8;\n }\n\n if (TooltipRegexes.end.test(this.placement)) {\n return isLTR(this) ? 8 : -8;\n }\n }\n\n return 0;\n }\n\n /**\n * Whether the tooltip is showing.\n *\n * @attr open\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public set open(value: boolean) {\n this._controller.open = value;\n }\n\n public get open(): boolean {\n return this._controller.open;\n }\n\n /**\n * Whether to disable the rendering of the arrow indicator for the tooltip.\n *\n * @attr disable-arrow\n * @default false\n */\n @property({ attribute: 'disable-arrow', type: Boolean, reflect: true })\n public disableArrow = false;\n\n /**\n * The offset of the tooltip from the anchor in pixels.\n *\n * @attr offset\n * @default 6\n */\n @property({ type: Number })\n public offset = 6;\n\n /**\n * Where to place the floating element relative to the parent anchor element.\n *\n * @attr placement\n * @default top\n */\n @property()\n public placement: PopoverPlacement = 'top';\n\n /**\n * An element instance or an IDREF to use as the anchor for the tooltip.\n *\n * @attr anchor\n */\n @property()\n public anchor?: Element | string;\n\n /**\n * Which event triggers will show the tooltip.\n * Expects a comma separate string of different event triggers.\n *\n * @attr show-triggers\n * @default pointerenter\n */\n @property({ attribute: 'show-triggers' })\n public set showTriggers(value: string) {\n this._controller.showTriggers = value;\n }\n\n public get showTriggers(): string {\n return this._controller.showTriggers;\n }\n\n /**\n * Which event triggers will hide the tooltip.\n * Expects a comma separate string of different event triggers.\n *\n * @attr hide-triggers\n * @default pointerleave, click\n */\n @property({ attribute: 'hide-triggers' })\n public set hideTriggers(value: string) {\n this._controller.hideTriggers = value;\n }\n\n public get hideTriggers(): string {\n return this._controller.hideTriggers;\n }\n\n /**\n * Specifies the number of milliseconds that should pass before showing the tooltip.\n *\n * @attr show-delay\n * @default 200\n */\n @property({ attribute: 'show-delay', type: Number })\n public set showDelay(value: number) {\n this._showDelay = Math.max(0, asNumber(value));\n }\n\n public get showDelay(): number {\n return this._showDelay;\n }\n\n /**\n * Specifies the number of milliseconds that should pass before hiding the tooltip.\n *\n * @attr hide-delay\n * @default 300\n */\n @property({ attribute: 'hide-delay', type: Number })\n public set hideDelay(value: number) {\n this._hideDelay = Math.max(0, asNumber(value));\n }\n\n public get hideDelay(): number {\n return this._hideDelay;\n }\n\n /**\n * Specifies a plain text as tooltip content.\n *\n * @attr message\n */\n @property()\n public message = '';\n\n /**\n * Specifies if the tooltip remains visible until the user closes it via the close button or Esc key.\n *\n * @attr sticky\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public sticky = false;\n\n constructor() {\n super();\n\n this._internals = this.attachInternals();\n this._internals.role = 'tooltip';\n this._internals.ariaAtomic = 'true';\n this._internals.ariaLive = 'polite';\n }\n\n protected override firstUpdated(): void {\n if (this.open) {\n this.updateComplete.then(() => {\n this._player.playExclusive(this._showAnimation);\n this.requestUpdate();\n });\n }\n }\n\n @watch('anchor')\n protected _onAnchorChange(): void {\n this._controller.resolveAnchor(this.anchor);\n }\n\n @watch('sticky')\n protected _onStickyChange(): void {\n this._internals.role = this.sticky ? 'status' : 'tooltip';\n }\n\n private _emitEvent(name: keyof IgcTooltipComponentEventMap): boolean {\n return this.emitEvent(name, {\n cancelable: name === 'igcOpening' || name === 'igcClosing',\n detail: this._controller.anchor,\n });\n }\n\n private async _applyTooltipState({\n show,\n withDelay = false,\n withEvents = false,\n }: TooltipStateOptions): Promise<boolean> {\n if (show === this.open) {\n return false;\n }\n\n if (withEvents && !this._emitEvent(show ? 'igcOpening' : 'igcClosing')) {\n return false;\n }\n\n const commitStateChange = async () => {\n if (show) {\n this.open = true;\n }\n\n // Make the tooltip ignore most interactions while the animation\n // is running. In the rare case when the popover overlaps its anchor\n // this will prevent looping between the anchor and tooltip handlers.\n this.inert = true;\n\n const animationComplete = await this._player.playExclusive(\n show ? this._showAnimation : this._hideAnimation\n );\n\n this.inert = false;\n this.open = show;\n\n if (animationComplete && withEvents) {\n this._emitEvent(show ? 'igcOpened' : 'igcClosed');\n }\n\n return animationComplete;\n };\n\n if (withDelay) {\n clearTimeout(this._timeoutId);\n\n return new Promise(() => {\n this._timeoutId = setTimeout(\n async () => await commitStateChange(),\n show ? this.showDelay : this.hideDelay\n );\n });\n }\n\n return commitStateChange();\n }\n\n /**\n * Shows the tooltip if not already showing.\n * If a target is provided, sets it as a transient anchor.\n */\n public async show(target?: Element | string): Promise<boolean> {\n if (target) {\n this._stopTimeoutAndAnimation();\n this._controller.setAnchor(target, true);\n }\n\n return await this._applyTooltipState({ show: true });\n }\n\n /** Hides the tooltip if not already hidden. */\n public async hide(): Promise<boolean> {\n return await this._applyTooltipState({ show: false });\n }\n\n /** Toggles the tooltip between shown/hidden state */\n public async toggle(): Promise<boolean> {\n return await (this.open ? this.hide() : this.show());\n }\n\n protected _showWithEvent(): Promise<boolean> {\n return this._applyTooltipState({\n show: true,\n withDelay: true,\n withEvents: true,\n });\n }\n\n protected _hideWithEvent(): Promise<boolean> {\n return this._applyTooltipState({\n show: false,\n withDelay: true,\n withEvents: true,\n });\n }\n\n private _showOnInteraction(): void {\n this._stopTimeoutAndAnimation();\n this._showWithEvent();\n }\n\n private _stopTimeoutAndAnimation(): void {\n clearTimeout(this._timeoutId);\n this._player.stopAll();\n }\n\n private _setAutoHide(): void {\n this._stopTimeoutAndAnimation();\n\n this._timeoutId = setTimeout(\n this._hideWithEvent.bind(this),\n this._autoHideDelay\n );\n }\n\n private _hideOnInteraction(): void {\n if (!this.sticky) {\n this._setAutoHide();\n }\n }\n\n private async _hideOnEscape(): Promise<void> {\n await this.hide();\n this._emitEvent('igcClosed');\n }\n\n protected override render() {\n return html`\n <igc-popover\n .inert=${!this.open}\n .placement=${this.placement}\n .offset=${this.offset}\n .anchor=${this._controller.anchor ?? undefined}\n .arrow=${this.disableArrow ? null : this._arrowElement}\n .arrowOffset=${this._arrowOffset}\n .shiftPadding=${8}\n ?open=${this.open}\n flip\n shift\n >\n <div ${ref(this._containerRef)} part=\"base\">\n <slot>${this.message}</slot>\n ${this.sticky\n ? html`\n <slot name=\"close-button\" @click=${this._setAutoHide}>\n <igc-icon\n name=\"input_clear\"\n collection=\"default\"\n aria-hidden=\"true\"\n ></igc-icon>\n </slot>\n `\n : nothing}\n ${this.disableArrow ? nothing : html`<div id=\"arrow\"></div>`}\n </div>\n </igc-popover>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-tooltip': IgcTooltipComponent;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,gBAAgB,MAAM,iBAAiB,CAAC;AAC/C,OAAO,mBAEN,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,E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a,AAAhB,CAAiB;AACjC,0BAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,AAAnB,CAAoB;AAsChC;IADP,KAAK,CAAC,QAAQ,CAAC;0DACoB;AAmCpC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAG1C;AAaM;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yDAC3C;AASrB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDACT;AASX;IADN,QAAQ,EAAE;sDACgC;AAQpC;IADN,QAAQ,EAAE;mDACsB;AAUjC;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;uDAGxC;AAcD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;uDAGxC;AAaD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDAGnD;AAaD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDAGnD;AAYM;IADN,QAAQ,EAAE;oDACS;AASb;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDACrB;AAqBZ;IADT,KAAK,CAAC,QAAQ,CAAC;0DAGf;AAGS;IADT,KAAK,CAAC,QAAQ,CAAC;0DAGf;AAlOkB,mBAAmB;IADvC,MAAM,CAAC,GAAG,CAAC;GACS,mBAAmB,CAmYvC;eAnYoB,mBAAmB","sourcesContent":["import { LitElement, html, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { createRef, ref } from 'lit/directives/ref.js';\nimport { EaseOut } from '../../animations/easings.js';\nimport { addAnimationController } from '../../animations/player.js';\nimport { fadeOut } from '../../animations/presets/fade/index.js';\nimport { scaleInCenter } from '../../animations/presets/scale/index.js';\nimport { themes } from '../../theming/theming-decorator.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport type { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { asNumber, isLTR } from '../common/util.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport IgcPopoverComponent, {\n type PopoverPlacement,\n} from '../popover/popover.js';\nimport { TooltipRegexes, addTooltipController } from './controller.js';\nimport { styles as shared } from './themes/shared/tooltip.common.css.js';\nimport { all } from './themes/themes.js';\nimport { styles } from './themes/tooltip.base.css.js';\n\nexport interface IgcTooltipComponentEventMap {\n /* blazorAlternateType: CustomEvent<void> */\n igcOpening: CustomEvent<Element | null>;\n /* blazorAlternateType: CustomEvent<void> */\n igcOpened: CustomEvent<Element | null>;\n /* blazorAlternateType: CustomEvent<void> */\n igcClosing: CustomEvent<Element | null>;\n /* blazorAlternateType: CustomEvent<void> */\n igcClosed: CustomEvent<Element | null>;\n}\n\ntype TooltipStateOptions = {\n show: boolean;\n withDelay?: boolean;\n withEvents?: boolean;\n};\n\n/**\n * Provides a way to display supplementary information related to an element when a user interacts with it (e.g., hover, focus).\n * It offers features such as placement customization, delays, sticky mode, and animations.\n *\n * @element igc-tooltip\n *\n * @slot - Default slot of the tooltip component.\n * @slot close-button - Slot for custom sticky-mode close action (e.g., an icon/button).\n *\n * @csspart base - The wrapping container of the tooltip content.\n *\n * @fires igcOpening - Emitted before the tooltip begins to open. Can be canceled to prevent opening.\n * @fires igcOpened - Emitted after the tooltip has successfully opened and is visible.\n * @fires igcClosing - Emitted before the tooltip begins to close. Can be canceled to prevent closing.\n * @fires igcClosed - Emitted after the tooltip has been fully removed from view.\n */\n@themes(all)\nexport default class IgcTooltipComponent extends EventEmitterMixin<\n IgcTooltipComponentEventMap,\n Constructor<LitElement>\n>(LitElement) {\n public static readonly tagName = 'igc-tooltip';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(\n IgcTooltipComponent,\n IgcPopoverComponent,\n IgcIconComponent\n );\n }\n\n private readonly _internals: ElementInternals;\n\n private readonly _controller = addTooltipController(this, {\n onShow: this._showOnInteraction,\n onHide: this._hideOnInteraction,\n onEscape: this._hideOnEscape,\n });\n\n private readonly _containerRef = createRef<HTMLElement>();\n private readonly _player = addAnimationController(this, this._containerRef);\n\n private readonly _showAnimation = scaleInCenter({\n duration: 150,\n easing: EaseOut.Quad,\n });\n\n private readonly _hideAnimation = fadeOut({\n duration: 75,\n easing: EaseOut.Sine,\n });\n\n private _timeoutId?: number;\n private _autoHideDelay = 180;\n private _showDelay = 200;\n private _hideDelay = 300;\n\n @query('#arrow')\n private _arrowElement!: HTMLElement;\n\n private get _arrowOffset() {\n if (this.placement.includes('-')) {\n // Horizontal start | end placement\n\n if (TooltipRegexes.horizontalStart.test(this.placement)) {\n return -8;\n }\n\n if (TooltipRegexes.horizontalEnd.test(this.placement)) {\n return 8;\n }\n\n // Vertical start | end placement\n\n if (TooltipRegexes.start.test(this.placement)) {\n return isLTR(this) ? -8 : 8;\n }\n\n if (TooltipRegexes.end.test(this.placement)) {\n return isLTR(this) ? 8 : -8;\n }\n }\n\n return 0;\n }\n\n /**\n * Whether the tooltip is showing.\n *\n * @attr open\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public set open(value: boolean) {\n this._controller.open = value;\n }\n\n public get open(): boolean {\n return this._controller.open;\n }\n\n /**\n * Whether to disable the rendering of the arrow indicator for the tooltip.\n *\n * @attr disable-arrow\n * @default false\n */\n @property({ attribute: 'disable-arrow', type: Boolean, reflect: true })\n public disableArrow = false;\n\n /**\n * The offset of the tooltip from the anchor in pixels.\n *\n * @attr offset\n * @default 6\n */\n @property({ type: Number })\n public offset = 6;\n\n /**\n * Where to place the floating element relative to the parent anchor element.\n *\n * @attr placement\n * @default top\n */\n @property()\n public placement: PopoverPlacement = 'top';\n\n /**\n * An element instance or an IDREF to use as the anchor for the tooltip.\n *\n * @attr anchor\n */\n @property()\n public anchor?: Element | string;\n\n /**\n * Which event triggers will show the tooltip.\n * Expects a comma separate string of different event triggers.\n *\n * @attr show-triggers\n * @default pointerenter\n */\n @property({ attribute: 'show-triggers' })\n public set showTriggers(value: string) {\n this._controller.showTriggers = value;\n }\n\n public get showTriggers(): string {\n return this._controller.showTriggers;\n }\n\n /**\n * Which event triggers will hide the tooltip.\n * Expects a comma separate string of different event triggers.\n *\n * @attr hide-triggers\n * @default pointerleave, click\n */\n @property({ attribute: 'hide-triggers' })\n public set hideTriggers(value: string) {\n this._controller.hideTriggers = value;\n }\n\n public get hideTriggers(): string {\n return this._controller.hideTriggers;\n }\n\n /**\n * Specifies the number of milliseconds that should pass before showing the tooltip.\n *\n * @attr show-delay\n * @default 200\n */\n @property({ attribute: 'show-delay', type: Number })\n public set showDelay(value: number) {\n this._showDelay = Math.max(0, asNumber(value));\n }\n\n public get showDelay(): number {\n return this._showDelay;\n }\n\n /**\n * Specifies the number of milliseconds that should pass before hiding the tooltip.\n *\n * @attr hide-delay\n * @default 300\n */\n @property({ attribute: 'hide-delay', type: Number })\n public set hideDelay(value: number) {\n this._hideDelay = Math.max(0, asNumber(value));\n }\n\n public get hideDelay(): number {\n return this._hideDelay;\n }\n\n /**\n * Specifies a plain text as tooltip content.\n *\n * @attr message\n */\n @property()\n public message = '';\n\n /**\n * Specifies if the tooltip remains visible until the user closes it via the close button or Esc key.\n *\n * @attr sticky\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public sticky = false;\n\n constructor() {\n super();\n\n this._internals = this.attachInternals();\n this._internals.role = 'tooltip';\n this._internals.ariaAtomic = 'true';\n this._internals.ariaLive = 'polite';\n }\n\n protected override firstUpdated(): void {\n if (this.open) {\n this.updateComplete.then(() => {\n this._player.playExclusive(this._showAnimation);\n this.requestUpdate();\n });\n }\n }\n\n @watch('anchor')\n protected _onAnchorChange(): void {\n this._controller.resolveAnchor(this.anchor);\n }\n\n @watch('sticky')\n protected _onStickyChange(): void {\n this._internals.role = this.sticky ? 'status' : 'tooltip';\n }\n\n private _emitEvent(name: keyof IgcTooltipComponentEventMap): boolean {\n return this.emitEvent(name, {\n cancelable: name === 'igcOpening' || name === 'igcClosing',\n detail: this._controller.anchor,\n });\n }\n\n private async _applyTooltipState({\n show,\n withDelay = false,\n withEvents = false,\n }: TooltipStateOptions): Promise<boolean> {\n if (show === this.open) {\n return false;\n }\n\n if (withEvents && !this._emitEvent(show ? 'igcOpening' : 'igcClosing')) {\n return false;\n }\n\n const commitStateChange = async () => {\n if (show) {\n this.open = true;\n }\n\n // Make the tooltip ignore most interactions while the animation\n // is running. In the rare case when the popover overlaps its anchor\n // this will prevent looping between the anchor and tooltip handlers.\n this.inert = true;\n\n const animationComplete = await this._player.playExclusive(\n show ? this._showAnimation : this._hideAnimation\n );\n\n this.inert = false;\n this.open = show;\n\n if (animationComplete && withEvents) {\n this._emitEvent(show ? 'igcOpened' : 'igcClosed');\n }\n\n return animationComplete;\n };\n\n if (withDelay) {\n clearTimeout(this._timeoutId);\n\n return new Promise(() => {\n this._timeoutId = setTimeout(\n async () => await commitStateChange(),\n show ? this.showDelay : this.hideDelay\n );\n });\n }\n\n return commitStateChange();\n }\n\n /**\n * Shows the tooltip if not already showing.\n * If a target is provided, sets it as a transient anchor.\n */\n public async show(target?: Element | string): Promise<boolean> {\n if (target) {\n this._stopTimeoutAndAnimation();\n this._controller.setAnchor(target, true);\n }\n\n return await this._applyTooltipState({ show: true });\n }\n\n /** Hides the tooltip if not already hidden. */\n public async hide(): Promise<boolean> {\n return await this._applyTooltipState({ show: false });\n }\n\n /** Toggles the tooltip between shown/hidden state */\n public async toggle(): Promise<boolean> {\n return await (this.open ? this.hide() : this.show());\n }\n\n protected _showWithEvent(): Promise<boolean> {\n return this._applyTooltipState({\n show: true,\n withDelay: true,\n withEvents: true,\n });\n }\n\n protected _hideWithEvent(): Promise<boolean> {\n return this._applyTooltipState({\n show: false,\n withDelay: true,\n withEvents: true,\n });\n }\n\n private _showOnInteraction(): void {\n this._stopTimeoutAndAnimation();\n this._showWithEvent();\n }\n\n private _stopTimeoutAndAnimation(): void {\n clearTimeout(this._timeoutId);\n this._player.stopAll();\n }\n\n private _setAutoHide(): void {\n this._stopTimeoutAndAnimation();\n\n this._timeoutId = setTimeout(\n this._hideWithEvent.bind(this),\n this._autoHideDelay\n );\n }\n\n private _hideOnInteraction(): void {\n if (!this.sticky) {\n this._setAutoHide();\n }\n }\n\n private async _hideOnEscape(): Promise<void> {\n await this.hide();\n this._emitEvent('igcClosed');\n }\n\n protected override render() {\n return html`\n <igc-popover\n .inert=${!this.open}\n .placement=${this.placement}\n .offset=${this.offset}\n .anchor=${this._controller.anchor ?? undefined}\n .arrow=${this.disableArrow ? null : this._arrowElement}\n .arrowOffset=${this._arrowOffset}\n .shiftPadding=${8}\n ?open=${this.open}\n flip\n shift\n >\n <div ${ref(this._containerRef)} part=\"base\">\n <slot>${this.message}</slot>\n ${this.sticky\n ? html`\n <slot name=\"close-button\" @click=${this._setAutoHide}>\n <igc-icon\n name=\"input_clear\"\n collection=\"default\"\n aria-hidden=\"true\"\n ></igc-icon>\n </slot>\n `\n : nothing}\n ${this.disableArrow ? nothing : html`<div id=\"arrow\"></div>`}\n </div>\n </igc-popover>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-tooltip': IgcTooltipComponent;\n }\n}\n"]}
|
package/components/types.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type CarouselIndicatorsOrientation = 'end' | 'start';
|
|
|
16
16
|
export type DividerType = 'solid' | 'dashed';
|
|
17
17
|
export type ExpansionPanelIndicatorPosition = 'start' | 'end' | 'none';
|
|
18
18
|
export type IconButtonVariant = 'contained' | 'flat' | 'outlined';
|
|
19
|
-
export type InputType = 'email' | 'number' | 'password' | 'search' | 'tel' | '
|
|
19
|
+
export type InputType = 'text' | 'email' | 'number' | 'password' | 'search' | 'tel' | 'url';
|
|
20
20
|
export type LinearProgressLabelAlign = 'top-start' | 'top' | 'top-end' | 'bottom-start' | 'bottom' | 'bottom-end';
|
|
21
21
|
export type MaskInputValueMode = 'raw' | 'withFormatting';
|
|
22
22
|
export type NavDrawerPosition = 'start' | 'end' | 'top' | 'bottom' | 'relative';
|
package/components/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"","sourcesContent":["// Public API types\n// NOTE: use default value as first in order where possible for union types\n\n//#region shared types\nexport type AbsolutePosition = 'bottom' | 'middle' | 'top';\nexport type ContentOrientation = 'horizontal' | 'vertical';\nexport type HorizontalTransitionAnimation = 'slide' | 'fade' | 'none';\nexport type PickerMode = 'dropdown' | 'dialog';\nexport type PopoverScrollStrategy = 'scroll' | 'block' | 'close';\nexport type RangeTextSelectMode = 'preserve' | 'select' | 'start' | 'end';\nexport type SelectionRangeDirection = 'none' | 'backward' | 'forward';\nexport type StyleVariant =\n | 'primary'\n | 'info'\n | 'success'\n | 'warning'\n | 'danger';\nexport type ToggleLabelPosition = 'after' | 'before';\nexport type TreeSelection = 'none' | 'multiple' | 'cascade';\n//#endregion\n\n//#region component-specific\nexport type AvatarShape = 'square' | 'circle' | 'rounded';\nexport type BadgeShape = 'rounded' | 'square';\nexport type ButtonGroupSelection = 'single' | 'single-required' | 'multiple';\nexport type ButtonVariant = 'contained' | 'flat' | 'outlined' | 'fab';\nexport type CarouselIndicatorsOrientation = 'end' | 'start';\nexport type DividerType = 'solid' | 'dashed';\nexport type ExpansionPanelIndicatorPosition = 'start' | 'end' | 'none';\nexport type IconButtonVariant = 'contained' | 'flat' | 'outlined';\nexport type InputType =\n | '
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"","sourcesContent":["// Public API types\n// NOTE: use default value as first in order where possible for union types\n\n//#region shared types\nexport type AbsolutePosition = 'bottom' | 'middle' | 'top';\nexport type ContentOrientation = 'horizontal' | 'vertical';\nexport type HorizontalTransitionAnimation = 'slide' | 'fade' | 'none';\nexport type PickerMode = 'dropdown' | 'dialog';\nexport type PopoverScrollStrategy = 'scroll' | 'block' | 'close';\nexport type RangeTextSelectMode = 'preserve' | 'select' | 'start' | 'end';\nexport type SelectionRangeDirection = 'none' | 'backward' | 'forward';\nexport type StyleVariant =\n | 'primary'\n | 'info'\n | 'success'\n | 'warning'\n | 'danger';\nexport type ToggleLabelPosition = 'after' | 'before';\nexport type TreeSelection = 'none' | 'multiple' | 'cascade';\n//#endregion\n\n//#region component-specific\nexport type AvatarShape = 'square' | 'circle' | 'rounded';\nexport type BadgeShape = 'rounded' | 'square';\nexport type ButtonGroupSelection = 'single' | 'single-required' | 'multiple';\nexport type ButtonVariant = 'contained' | 'flat' | 'outlined' | 'fab';\nexport type CarouselIndicatorsOrientation = 'end' | 'start';\nexport type DividerType = 'solid' | 'dashed';\nexport type ExpansionPanelIndicatorPosition = 'start' | 'end' | 'none';\nexport type IconButtonVariant = 'contained' | 'flat' | 'outlined';\nexport type InputType =\n | 'text'\n | 'email'\n | 'number'\n | 'password'\n | 'search'\n | 'tel'\n | 'url';\nexport type LinearProgressLabelAlign =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'bottom-start'\n | 'bottom'\n | 'bottom-end';\nexport type MaskInputValueMode = 'raw' | 'withFormatting';\nexport type NavDrawerPosition = 'start' | 'end' | 'top' | 'bottom' | 'relative';\nexport type SliderTickLabelRotation = 0 | 90 | -90;\nexport type SliderTickOrientation = 'end' | 'mirror' | 'start';\nexport type StepperOrientation = 'horizontal' | 'vertical';\nexport type StepperStepType = 'full' | 'indicator' | 'title';\nexport type StepperTitlePosition = 'auto' | 'bottom' | 'top' | 'end' | 'start';\nexport type StepperVerticalAnimation = 'grow' | 'fade' | 'none';\nexport type TabsActivation = 'auto' | 'manual';\nexport type TabsAlignment = 'start' | 'end' | 'center' | 'justify';\nexport type TextareaResize = 'vertical' | 'auto' | 'none';\nexport type TileManagerDragMode = 'none' | 'tile-header' | 'tile';\nexport type TileManagerResizeMode = 'none' | 'hover' | 'always';\n//#endregion\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `:host{--text-error-color: var(--ig-validator-text-error-color, hsl(from var(--ig-gray-50-contrast) h s l/0.8));--ig-theme: indigo}`;
|
|
2
|
+
export const styles = css `:host{--helper-text-color: var(--ig-validator-helper-text-color, hsl(from var(--ig-gray-50-contrast) h s l/0.8));--text-error-color: var(--ig-validator-text-error-color, hsl(from var(--ig-gray-50-contrast) h s l/0.8));--ig-theme: indigo}`;
|
|
3
3
|
//# sourceMappingURL=validator.indigo.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.indigo.css.js","sourceRoot":"","sources":["../../../../../src/components/validation-container/themes/dark/validator.indigo.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,
|
|
1
|
+
{"version":3,"file":"validator.indigo.css.js","sourceRoot":"","sources":["../../../../../src/components/validation-container/themes/dark/validator.indigo.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,+OAA+O,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{--helper-text-color: var(--ig-validator-helper-text-color, hsl(from var(--ig-gray-50-contrast) h s l/0.8));--text-error-color: var(--ig-validator-text-error-color, hsl(from var(--ig-gray-50-contrast) h s l/0.8));--ig-theme: indigo}`;\n"]}
|