igniteui-webcomponents 5.4.0-rc.0 → 5.4.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/CHANGELOG.md +94 -13
- package/animations/player.d.ts +1 -0
- package/animations/player.js +7 -0
- package/animations/player.js.map +1 -1
- package/animations/presets/scale/index.d.ts +2 -0
- package/animations/presets/scale/index.js +12 -0
- package/animations/presets/scale/index.js.map +1 -0
- package/components/calendar/days-view/days-view.js +5 -1
- package/components/calendar/days-view/days-view.js.map +1 -1
- package/components/carousel/themes/shared/carousel.bootstrap.css.js +1 -1
- package/components/carousel/themes/shared/carousel.bootstrap.css.js.map +1 -1
- package/components/carousel/themes/shared/carousel.common.css.js +1 -1
- package/components/carousel/themes/shared/carousel.common.css.js.map +1 -1
- package/components/carousel/themes/shared/carousel.fluent.css.js +1 -1
- package/components/carousel/themes/shared/carousel.fluent.css.js.map +1 -1
- package/components/carousel/themes/shared/carousel.indigo.css.js +1 -1
- package/components/carousel/themes/shared/carousel.indigo.css.js.map +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.bootstrap.css.js +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.bootstrap.css.js.map +1 -1
- package/components/combo/combo.d.ts +2 -2
- package/components/combo/combo.js +23 -12
- package/components/combo/combo.js.map +1 -1
- package/components/common/definitions/defineAllComponents.js +2 -0
- package/components/common/definitions/defineAllComponents.js.map +1 -1
- package/components/common/util.d.ts +7 -3
- package/components/common/util.js +110 -3
- package/components/common/util.js.map +1 -1
- package/components/date-picker/themes/shared/date-picker.fluent.css.js +1 -1
- package/components/date-picker/themes/shared/date-picker.fluent.css.js.map +1 -1
- package/components/icon/icon.registry.js +2 -2
- package/components/icon/icon.registry.js.map +1 -1
- package/components/input/themes/shared/input.fluent.css.js +1 -1
- package/components/input/themes/shared/input.fluent.css.js.map +1 -1
- package/components/popover/popover.d.ts +17 -1
- package/components/popover/popover.js +58 -9
- package/components/popover/popover.js.map +1 -1
- package/components/radio/themes/shared/radio.bootstrap.css.js +1 -1
- package/components/radio/themes/shared/radio.bootstrap.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.common.css.js +1 -1
- package/components/textarea/themes/shared/textarea.common.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.fluent.css.js +1 -1
- package/components/textarea/themes/shared/textarea.fluent.css.js.map +1 -1
- package/components/tooltip/controller.d.ts +87 -0
- package/components/tooltip/controller.js +172 -0
- package/components/tooltip/controller.js.map +1 -0
- package/components/tooltip/service.d.ts +12 -0
- package/components/tooltip/service.js +42 -0
- package/components/tooltip/service.js.map +1 -0
- package/components/tooltip/themes/dark/tooltip.bootstrap.css.d.ts +1 -0
- package/components/tooltip/themes/dark/tooltip.bootstrap.css.js +3 -0
- package/components/tooltip/themes/dark/tooltip.bootstrap.css.js.map +1 -0
- package/components/tooltip/themes/dark/tooltip.fluent.css.d.ts +1 -0
- package/components/tooltip/themes/dark/tooltip.fluent.css.js +3 -0
- package/components/tooltip/themes/dark/tooltip.fluent.css.js.map +1 -0
- package/components/tooltip/themes/dark/tooltip.indigo.css.d.ts +1 -0
- package/components/tooltip/themes/dark/tooltip.indigo.css.js +3 -0
- package/components/tooltip/themes/dark/tooltip.indigo.css.js.map +1 -0
- package/components/tooltip/themes/dark/tooltip.material.css.d.ts +1 -0
- package/components/tooltip/themes/dark/tooltip.material.css.js +3 -0
- package/components/tooltip/themes/dark/tooltip.material.css.js.map +1 -0
- package/components/tooltip/themes/light/tooltip.bootstrap.css.d.ts +1 -0
- package/components/tooltip/themes/light/tooltip.bootstrap.css.js +3 -0
- package/components/tooltip/themes/light/tooltip.bootstrap.css.js.map +1 -0
- package/components/tooltip/themes/light/tooltip.fluent.css.d.ts +1 -0
- package/components/tooltip/themes/light/tooltip.fluent.css.js +3 -0
- package/components/tooltip/themes/light/tooltip.fluent.css.js.map +1 -0
- package/components/tooltip/themes/light/tooltip.indigo.css.d.ts +1 -0
- package/components/tooltip/themes/light/tooltip.indigo.css.js +3 -0
- package/components/tooltip/themes/light/tooltip.indigo.css.js.map +1 -0
- package/components/tooltip/themes/light/tooltip.material.css.d.ts +1 -0
- package/components/tooltip/themes/light/tooltip.material.css.js +3 -0
- package/components/tooltip/themes/light/tooltip.material.css.js.map +1 -0
- package/components/tooltip/themes/light/tooltip.shared.css.d.ts +1 -0
- package/components/tooltip/themes/light/tooltip.shared.css.js +3 -0
- package/components/tooltip/themes/light/tooltip.shared.css.js.map +1 -0
- package/components/tooltip/themes/shared/tooltip.common.css.d.ts +1 -0
- package/components/tooltip/themes/shared/tooltip.common.css.js +3 -0
- package/components/tooltip/themes/shared/tooltip.common.css.js.map +1 -0
- package/components/tooltip/themes/shared/tooltip.indigo.css.d.ts +1 -0
- package/components/tooltip/themes/shared/tooltip.indigo.css.js +3 -0
- package/components/tooltip/themes/shared/tooltip.indigo.css.js.map +1 -0
- package/components/tooltip/themes/themes.d.ts +2 -0
- package/components/tooltip/themes/themes.js +47 -0
- package/components/tooltip/themes/themes.js.map +1 -0
- package/components/tooltip/themes/tooltip.base.css.d.ts +1 -0
- package/components/tooltip/themes/tooltip.base.css.js +3 -0
- package/components/tooltip/themes/tooltip.base.css.js.map +1 -0
- package/components/tooltip/tooltip.d.ts +154 -0
- package/components/tooltip/tooltip.js +284 -0
- package/components/tooltip/tooltip.js.map +1 -0
- package/custom-elements.json +1080 -29
- package/igniteui-webcomponents.css-data.json +1 -1
- package/igniteui-webcomponents.html-data.json +1 -1
- package/index.d.ts +2 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/web-types.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.registry.js","sourceRoot":"","sources":["../../../src/components/icon/icon.registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"icon.registry.js","sourceRoot":"","sources":["../../../src/components/icon/icon.registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAA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CAAC;QAC3B,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;QAC3B,MAAM,EAAE;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,QAAQ,EAAE,IAAI;SACf;QACD,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Theme } from '../../theming/types.js';\nimport { equal } from '../common/util.js';\nimport { iconReferences } from './icon-references.js';\nimport { IconsStateBroadcast } from './icon-state.broadcast.js';\nimport { internalIcons } from './internal-icons-lib.js';\nimport { createIconDefaultMap } from './registry/default-map.js';\nimport { SvgIconParser } from './registry/parser.js';\nimport type {\n IconCallback,\n IconMeta,\n IconReferencePair,\n SvgIcon,\n} from './registry/types.js';\nimport { ActionType } from './registry/types.js';\n\nclass IconsRegistry {\n private parser: SvgIconParser;\n private collections = createIconDefaultMap<string, SvgIcon>();\n private references = createIconDefaultMap<string, IconMeta>();\n private listeners = new Set<IconCallback>();\n private theme!: Theme;\n private broadcast: IconsStateBroadcast;\n\n constructor() {\n this.parser = new SvgIconParser();\n this.broadcast = new IconsStateBroadcast(this.collections, this.references);\n\n this.collections.set('internal', internalIcons);\n }\n\n public register(name: string, iconText: string, collection = 'default') {\n const svgIcon = this.parser.parse(iconText);\n this.collections.getOrCreate(collection).set(name, svgIcon);\n\n const icons = createIconDefaultMap<string, SvgIcon>();\n icons.getOrCreate(collection).set(name, svgIcon);\n\n this.broadcast.send({\n actionType: ActionType.RegisterIcon,\n collections: icons.toMap(),\n });\n\n this.notifyAll(name, collection);\n }\n\n public subscribe(callback: IconCallback) {\n this.listeners.add(callback);\n }\n\n public unsubscribe(callback: IconCallback) {\n this.listeners.delete(callback);\n }\n\n public setRefsByTheme(theme: Theme) {\n if (this.theme !== theme) {\n this.theme = theme;\n\n for (const { alias, target } of iconReferences) {\n const external = this.references\n .get(alias.collection)\n ?.get(alias.name)?.external;\n\n const _ref = this.references.get('default')?.get(alias.name) ?? {};\n const _target = target.get(this.theme) ?? target.get('default')!;\n\n this.setIconRef({\n alias,\n target: _target,\n overwrite: !(external || equal(_ref, _target)),\n });\n }\n }\n }\n\n public setIconRef(options: IconReferencePair) {\n const { alias, target, overwrite } = options;\n const reference = this.references.getOrCreate(alias.collection);\n\n if (overwrite) {\n reference.set(alias.name, {\n name: target.name,\n collection: target.collection,\n external: target.external,\n });\n this.notifyAll(alias.name, alias.collection);\n }\n if (target.external) {\n const refs = createIconDefaultMap<string, IconMeta>();\n refs.getOrCreate(alias.collection).set(alias.name, {\n name: target.name,\n collection: target.collection,\n });\n\n this.broadcast.send({\n actionType: ActionType.UpdateIconReference,\n references: refs.toMap(),\n });\n }\n }\n\n public getIconRef(name: string, collection: string): IconMeta {\n const icon = this.references.get(collection)?.get(name);\n\n return {\n name: icon?.name ?? name,\n collection: icon?.collection ?? collection,\n };\n }\n\n public get(name: string, collection = 'default') {\n return this.collections.get(collection)?.get(name);\n }\n\n private notifyAll(name: string, collection: string) {\n for (const listener of this.listeners) {\n listener(name, collection);\n }\n }\n}\n\nconst registry = Symbol.for('igc.icons-registry.instance');\n\ntype IgcIconRegistry = typeof globalThis & {\n [registry]?: IconsRegistry;\n};\n\nexport function getIconRegistry() {\n const _global = globalThis as IgcIconRegistry;\n if (!_global[registry]) {\n _global[registry] = new IconsRegistry();\n }\n return _global[registry];\n}\n\nexport async function registerIcon(\n name: string,\n url: string,\n collection = 'default'\n) {\n const response = await fetch(url);\n\n if (response.ok) {\n const value = await response.text();\n getIconRegistry().register(name, value, collection);\n } else {\n throw new Error(`Icon request failed. Status: ${response.status}.`);\n }\n}\n\nexport function registerIconFromText(\n name: string,\n iconText: string,\n collection = 'default'\n) {\n getIconRegistry().register(name, iconText, collection);\n}\n\nexport function setIconRef(name: string, collection: string, icon: IconMeta) {\n getIconRegistry().setIconRef({\n alias: { name, collection },\n target: {\n name: icon.name,\n collection: icon.collection,\n external: true,\n },\n overwrite: true,\n });\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `:host{--component-size: var(--ig-size, var(--default-size));--input-size: var(--component-size);--helper-text-top-spacer: rem(5px)}:host [part=prefix],:host [part=suffix]{font-size:.875rem;cursor:default}:host [part=prefix] ::slotted(*),:host [part=suffix] ::slotted(*){color:inherit}:host ::part(helper-text){font-family:var(--ig-caption-font-family, var(--ig-font-family));font-size:var(--ig-caption-font-size);font-weight:var(--ig-caption-font-weight);font-style:var(--ig-caption-font-style);line-height:var(--ig-caption-line-height);letter-spacing:var(--ig-caption-letter-spacing);text-transform:var(--ig-caption-text-transform);margin-top:var(--ig-caption-margin-top);margin-bottom:var(--ig-caption-margin-bottom);color:var(--helper-text-color);margin-block-start:.3125rem;grid-auto-rows:minmax(1.125rem, auto)}:host [name=prefix]::slotted(*),:host [name=suffix]::slotted(*){display:inline-flex;align-items:center;width:-moz-max-content;width:max-content;height:100%;padding-inline:max(var(--is-large, 1)*max(16px, -1 * 16px)*var(--ig-spacing-inline-large, var(--ig-spacing-inline, --ig-spacing)),var(--is-medium, 1)*max(12px, -1 * 12px)*var(--ig-spacing-inline-medium, var(--ig-spacing-inline, --ig-spacing)),var(--is-small, 1)*max(8px, -1 * 8px)*var(--ig-spacing-inline-small, var(--ig-spacing-inline, --ig-spacing)))}:host [part=prefix]{grid-area:1/1}:host [part=suffix]{grid-area:1/3}:host [part=label]{font-family:var(--ig-subtitle-2-font-family, var(--ig-font-family));font-size:var(--ig-subtitle-2-font-size);font-weight:var(--ig-subtitle-2-font-weight);font-style:var(--ig-subtitle-2-font-style);line-height:var(--ig-subtitle-2-line-height);letter-spacing:var(--ig-subtitle-2-letter-spacing);text-transform:var(--ig-subtitle-2-text-transform);margin-top:var(--ig-subtitle-2-margin-top);margin-bottom:var(--ig-subtitle-2-margin-bottom);color:var(--idle-secondary-color);margin-block-end:.3125rem}:host [part^=container]{height:var(--size);border-radius:var(--border-border-radius);border:0.0625rem solid var(--border-color);transition:none;cursor:text;grid-template-columns:auto 1fr auto;overflow:hidden}:host [part~=input]{color:var(--idle-text-color);height:calc(var(--size) - 0.125rem);background:initial;font-size:.875rem;padding-inline:.5rem;max-height:100%;border:none;grid-area:1/2}:host(:hover) [part^=container]{border-color:var(--hover-border-color)}:host(:focus-within) [part
|
|
2
|
+
export const styles = css `:host{--component-size: var(--ig-size, var(--default-size));--input-size: var(--component-size);--helper-text-top-spacer: rem(5px)}:host [part=prefix],:host [part=suffix]{font-size:.875rem;cursor:default}:host [part=prefix] ::slotted(*),:host [part=suffix] ::slotted(*){color:inherit}:host ::part(helper-text){font-family:var(--ig-caption-font-family, var(--ig-font-family));font-size:var(--ig-caption-font-size);font-weight:var(--ig-caption-font-weight);font-style:var(--ig-caption-font-style);line-height:var(--ig-caption-line-height);letter-spacing:var(--ig-caption-letter-spacing);text-transform:var(--ig-caption-text-transform);margin-top:var(--ig-caption-margin-top);margin-bottom:var(--ig-caption-margin-bottom);color:var(--helper-text-color);margin-block-start:.3125rem;grid-auto-rows:minmax(1.125rem, auto)}:host [name=prefix]::slotted(*),:host [name=suffix]::slotted(*){display:inline-flex;align-items:center;width:-moz-max-content;width:max-content;height:100%;padding-inline:max(var(--is-large, 1)*max(16px, -1 * 16px)*var(--ig-spacing-inline-large, var(--ig-spacing-inline, --ig-spacing)),var(--is-medium, 1)*max(12px, -1 * 12px)*var(--ig-spacing-inline-medium, var(--ig-spacing-inline, --ig-spacing)),var(--is-small, 1)*max(8px, -1 * 8px)*var(--ig-spacing-inline-small, var(--ig-spacing-inline, --ig-spacing)))}:host [part=prefix]{grid-area:1/1}:host [part=suffix]{grid-area:1/3}:host [part=label]{font-family:var(--ig-subtitle-2-font-family, var(--ig-font-family));font-size:var(--ig-subtitle-2-font-size);font-weight:var(--ig-subtitle-2-font-weight);font-style:var(--ig-subtitle-2-font-style);line-height:var(--ig-subtitle-2-line-height);letter-spacing:var(--ig-subtitle-2-letter-spacing);text-transform:var(--ig-subtitle-2-text-transform);margin-top:var(--ig-subtitle-2-margin-top);margin-bottom:var(--ig-subtitle-2-margin-bottom);color:var(--idle-secondary-color);margin-block-end:.3125rem}:host [part^=container]{height:var(--size);border-radius:var(--border-border-radius);border:0.0625rem solid var(--border-color);transition:none;cursor:text;grid-template-columns:auto 1fr auto;overflow:hidden}:host [part~=input]{color:var(--idle-text-color);height:calc(var(--size) - 0.125rem);background:initial;font-size:.875rem;padding-inline:.5rem;max-height:100%;border:none;grid-area:1/2}:host(:hover) [part^=container]{border-color:var(--hover-border-color)}:host(:focus-within) [part^=container]{border-color:var(--focused-border-color);border-width:0.125rem}:host(:focus-within) [part~=input]{height:calc(var(--size) - 0.25rem)}:host(:focus-within) [part=prefix]{margin-inline-start:-0.0625rem}:host(:focus-within) [part=suffix]{margin-inline-end:-0.0625rem}:host(:focus-within) [name=prefix]::slotted(*),:host(:focus-within) [name=suffix]::slotted(*){padding-block:max(var(--is-large, 1)*max(10px, -1 * 10px)*var(--ig-spacing-block-large, var(--ig-spacing-block, --ig-spacing)),var(--is-medium, 1)*max(8px, -1 * 8px)*var(--ig-spacing-block-medium, var(--ig-spacing-block, --ig-spacing)),var(--is-small, 1)*max(6px, -1 * 6px)*var(--ig-spacing-block-small, var(--ig-spacing-block, --ig-spacing)))}:host([type=search]) [part=prefix]{background:var(--ig-input-group-input-prefix-background, transparent);color:var(--ig-input-group-input-prefix-color, var(--ig-primary-500))}:host([type=search]) [part=suffix]{background:var(--ig-input-group-input-suffix-background, transparent);color:var(--ig-input-group-input-suffix-color, var(--ig-primary-500))}:host([type=search]:focus-within) [part=prefix]{display:none}:host([type=search]:focus-within) [part=suffix]{color:var(--ig-input-group-input-suffix-color--focused, var(--ig-gray-900))}:host([required]) [part=label]::after{color:var(--error-secondary-color)}:host([invalid]) [part^=container]{border-color:var(--error-secondary-color)}:host(:disabled) [part^=container],:host([disabled]) [part^=container]{border-color:var(--disabled-border-color)}:host(:disabled) [part^=container],:host(:disabled) [part=prefix],:host(:disabled) [part=suffix],:host([disabled]) [part^=container],:host([disabled]) [part=prefix],:host([disabled]) [part=suffix]{background:var(--border-disabled-background)}:host(:disabled) [part=prefix],:host(:disabled) [part=suffix],:host(:disabled) [part=label],:host(:disabled) [part=label]::after,:host(:disabled) [part~=input],:host(:disabled) ::part(helper-text),:host([disabled]) [part=prefix],:host([disabled]) [part=suffix],:host([disabled]) [part=label],:host([disabled]) [part=label]::after,:host([disabled]) [part~=input],:host([disabled]) ::part(helper-text){color:var(--disabled-text-color)}`;
|
|
3
3
|
//# sourceMappingURL=input.fluent.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.fluent.css.js","sourceRoot":"","sources":["../../../../../src/components/input/themes/shared/input.fluent.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,
|
|
1
|
+
{"version":3,"file":"input.fluent.css.js","sourceRoot":"","sources":["../../../../../src/components/input/themes/shared/input.fluent.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,2+IAA2+I,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{--component-size: var(--ig-size, var(--default-size));--input-size: var(--component-size);--helper-text-top-spacer: rem(5px)}:host [part=prefix],:host [part=suffix]{font-size:.875rem;cursor:default}:host [part=prefix] ::slotted(*),:host [part=suffix] ::slotted(*){color:inherit}:host ::part(helper-text){font-family:var(--ig-caption-font-family, var(--ig-font-family));font-size:var(--ig-caption-font-size);font-weight:var(--ig-caption-font-weight);font-style:var(--ig-caption-font-style);line-height:var(--ig-caption-line-height);letter-spacing:var(--ig-caption-letter-spacing);text-transform:var(--ig-caption-text-transform);margin-top:var(--ig-caption-margin-top);margin-bottom:var(--ig-caption-margin-bottom);color:var(--helper-text-color);margin-block-start:.3125rem;grid-auto-rows:minmax(1.125rem, auto)}:host [name=prefix]::slotted(*),:host [name=suffix]::slotted(*){display:inline-flex;align-items:center;width:-moz-max-content;width:max-content;height:100%;padding-inline:max(var(--is-large, 1)*max(16px, -1 * 16px)*var(--ig-spacing-inline-large, var(--ig-spacing-inline, --ig-spacing)),var(--is-medium, 1)*max(12px, -1 * 12px)*var(--ig-spacing-inline-medium, var(--ig-spacing-inline, --ig-spacing)),var(--is-small, 1)*max(8px, -1 * 8px)*var(--ig-spacing-inline-small, var(--ig-spacing-inline, --ig-spacing)))}:host [part=prefix]{grid-area:1/1}:host [part=suffix]{grid-area:1/3}:host [part=label]{font-family:var(--ig-subtitle-2-font-family, var(--ig-font-family));font-size:var(--ig-subtitle-2-font-size);font-weight:var(--ig-subtitle-2-font-weight);font-style:var(--ig-subtitle-2-font-style);line-height:var(--ig-subtitle-2-line-height);letter-spacing:var(--ig-subtitle-2-letter-spacing);text-transform:var(--ig-subtitle-2-text-transform);margin-top:var(--ig-subtitle-2-margin-top);margin-bottom:var(--ig-subtitle-2-margin-bottom);color:var(--idle-secondary-color);margin-block-end:.3125rem}:host [part^=container]{height:var(--size);border-radius:var(--border-border-radius);border:0.0625rem solid var(--border-color);transition:none;cursor:text;grid-template-columns:auto 1fr auto;overflow:hidden}:host [part~=input]{color:var(--idle-text-color);height:calc(var(--size) - 0.125rem);background:initial;font-size:.875rem;padding-inline:.5rem;max-height:100%;border:none;grid-area:1/2}:host(:hover) [part^=container]{border-color:var(--hover-border-color)}:host(:focus-within) [part^=container]{border-color:var(--focused-border-color);border-width:0.125rem}:host(:focus-within) [part~=input]{height:calc(var(--size) - 0.25rem)}:host(:focus-within) [part=prefix]{margin-inline-start:-0.0625rem}:host(:focus-within) [part=suffix]{margin-inline-end:-0.0625rem}:host(:focus-within) [name=prefix]::slotted(*),:host(:focus-within) [name=suffix]::slotted(*){padding-block:max(var(--is-large, 1)*max(10px, -1 * 10px)*var(--ig-spacing-block-large, var(--ig-spacing-block, --ig-spacing)),var(--is-medium, 1)*max(8px, -1 * 8px)*var(--ig-spacing-block-medium, var(--ig-spacing-block, --ig-spacing)),var(--is-small, 1)*max(6px, -1 * 6px)*var(--ig-spacing-block-small, var(--ig-spacing-block, --ig-spacing)))}:host([type=search]) [part=prefix]{background:var(--ig-input-group-input-prefix-background, transparent);color:var(--ig-input-group-input-prefix-color, var(--ig-primary-500))}:host([type=search]) [part=suffix]{background:var(--ig-input-group-input-suffix-background, transparent);color:var(--ig-input-group-input-suffix-color, var(--ig-primary-500))}:host([type=search]:focus-within) [part=prefix]{display:none}:host([type=search]:focus-within) [part=suffix]{color:var(--ig-input-group-input-suffix-color--focused, var(--ig-gray-900))}:host([required]) [part=label]::after{color:var(--error-secondary-color)}:host([invalid]) [part^=container]{border-color:var(--error-secondary-color)}:host(:disabled) [part^=container],:host([disabled]) [part^=container]{border-color:var(--disabled-border-color)}:host(:disabled) [part^=container],:host(:disabled) [part=prefix],:host(:disabled) [part=suffix],:host([disabled]) [part^=container],:host([disabled]) [part=prefix],:host([disabled]) [part=suffix]{background:var(--border-disabled-background)}:host(:disabled) [part=prefix],:host(:disabled) [part=suffix],:host(:disabled) [part=label],:host(:disabled) [part=label]::after,:host(:disabled) [part~=input],:host(:disabled) ::part(helper-text),:host([disabled]) [part=prefix],:host([disabled]) [part=suffix],:host([disabled]) [part=label],:host([disabled]) [part=label]::after,:host([disabled]) [part~=input],:host([disabled]) ::part(helper-text){color:var(--disabled-text-color)}`;\n"]}
|
|
@@ -24,6 +24,17 @@ export default class IgcPopoverComponent extends LitElement {
|
|
|
24
24
|
* anchor target for the floating element.
|
|
25
25
|
*/
|
|
26
26
|
anchor?: Element | string;
|
|
27
|
+
/**
|
|
28
|
+
* Element to render as an "arrow" element for the current popover.
|
|
29
|
+
*/
|
|
30
|
+
arrow: HTMLElement | null;
|
|
31
|
+
/** Additional offset to apply to the arrow element if enabled. */
|
|
32
|
+
arrowOffset: number;
|
|
33
|
+
/**
|
|
34
|
+
* Improves positioning for inline reference elements that span over multiple lines.
|
|
35
|
+
* Useful for tooltips or similar components.
|
|
36
|
+
*/
|
|
37
|
+
inline: boolean;
|
|
27
38
|
/**
|
|
28
39
|
* When enabled this changes the placement of the floating element in order to keep it
|
|
29
40
|
* in view along the main axis.
|
|
@@ -50,7 +61,11 @@ export default class IgcPopoverComponent extends LitElement {
|
|
|
50
61
|
* keeping it in view, preventing overflow while maintaining the desired placement.
|
|
51
62
|
*/
|
|
52
63
|
shift: boolean;
|
|
53
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Virtual padding for the resolved overflow detection offsets in pixels.
|
|
66
|
+
*/
|
|
67
|
+
shiftPadding: number;
|
|
68
|
+
protected anchorChange(): void;
|
|
54
69
|
protected openChange(): void;
|
|
55
70
|
protected floatingPropChange(): void;
|
|
56
71
|
connectedCallback(): Promise<void>;
|
|
@@ -62,6 +77,7 @@ export default class IgcPopoverComponent extends LitElement {
|
|
|
62
77
|
private _createMiddleware;
|
|
63
78
|
private _updateState;
|
|
64
79
|
private _updatePosition;
|
|
80
|
+
private _positionArrow;
|
|
65
81
|
private _anchorSlotChange;
|
|
66
82
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
67
83
|
}
|
|
@@ -4,27 +4,31 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { autoUpdate, computePosition, flip, limitShift, offset, shift, size, } from '@floating-ui/dom';
|
|
7
|
+
import { arrow, autoUpdate, computePosition, flip, inline, limitShift, offset, shift, size, } from '@floating-ui/dom';
|
|
8
8
|
import { LitElement, html } from 'lit';
|
|
9
9
|
import { property, query, queryAssignedElements } from 'lit/decorators.js';
|
|
10
10
|
import { watch } from '../common/decorators/watch.js';
|
|
11
11
|
import { registerComponent } from '../common/definitions/register.js';
|
|
12
|
-
import { getElementByIdFromRoot, isEmpty, isString, roundByDPR, } from '../common/util.js';
|
|
12
|
+
import { first, getElementByIdFromRoot, isEmpty, isString, roundByDPR, } from '../common/util.js';
|
|
13
13
|
import { styles } from './themes/light/popover.base.css.js';
|
|
14
14
|
class IgcPopoverComponent extends LitElement {
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
|
+
this.arrow = null;
|
|
18
|
+
this.arrowOffset = 0;
|
|
19
|
+
this.inline = false;
|
|
17
20
|
this.flip = false;
|
|
18
21
|
this.offset = 0;
|
|
19
22
|
this.open = false;
|
|
20
23
|
this.placement = 'bottom-start';
|
|
21
24
|
this.sameWidth = false;
|
|
22
25
|
this.shift = false;
|
|
26
|
+
this.shiftPadding = 0;
|
|
23
27
|
}
|
|
24
28
|
static register() {
|
|
25
29
|
registerComponent(IgcPopoverComponent);
|
|
26
30
|
}
|
|
27
|
-
|
|
31
|
+
anchorChange() {
|
|
28
32
|
const newTarget = isString(this.anchor)
|
|
29
33
|
? getElementByIdFromRoot(this, this.anchor)
|
|
30
34
|
: this.anchor;
|
|
@@ -51,8 +55,9 @@ class IgcPopoverComponent extends LitElement {
|
|
|
51
55
|
super.disconnectedCallback();
|
|
52
56
|
}
|
|
53
57
|
show() {
|
|
54
|
-
if (!this.target)
|
|
58
|
+
if (!this.target) {
|
|
55
59
|
return;
|
|
60
|
+
}
|
|
56
61
|
this._showPopover();
|
|
57
62
|
this.dispose = autoUpdate(this.target, this._container, this._updatePosition.bind(this));
|
|
58
63
|
}
|
|
@@ -76,11 +81,18 @@ class IgcPopoverComponent extends LitElement {
|
|
|
76
81
|
if (this.offset) {
|
|
77
82
|
middleware.push(offset(this.offset));
|
|
78
83
|
}
|
|
84
|
+
if (this.inline) {
|
|
85
|
+
middleware.push(inline());
|
|
86
|
+
}
|
|
79
87
|
if (this.shift) {
|
|
80
88
|
middleware.push(shift({
|
|
89
|
+
padding: this.shiftPadding,
|
|
81
90
|
limiter: limitShift(),
|
|
82
91
|
}));
|
|
83
92
|
}
|
|
93
|
+
if (this.arrow) {
|
|
94
|
+
middleware.push(arrow({ element: this.arrow }));
|
|
95
|
+
}
|
|
84
96
|
if (this.flip) {
|
|
85
97
|
middleware.push(flip());
|
|
86
98
|
}
|
|
@@ -103,10 +115,10 @@ class IgcPopoverComponent extends LitElement {
|
|
|
103
115
|
}
|
|
104
116
|
}
|
|
105
117
|
async _updatePosition() {
|
|
106
|
-
if (!this.open
|
|
118
|
+
if (!(this.open && this.target)) {
|
|
107
119
|
return;
|
|
108
120
|
}
|
|
109
|
-
const { x, y } = await computePosition(this.target, this._container, {
|
|
121
|
+
const { x, y, middlewareData, placement } = await computePosition(this.target, this._container, {
|
|
110
122
|
placement: this.placement ?? 'bottom-start',
|
|
111
123
|
middleware: this._createMiddleware(),
|
|
112
124
|
strategy: 'fixed',
|
|
@@ -116,10 +128,31 @@ class IgcPopoverComponent extends LitElement {
|
|
|
116
128
|
top: 0,
|
|
117
129
|
transform: `translate(${roundByDPR(x)}px,${roundByDPR(y)}px)`,
|
|
118
130
|
});
|
|
131
|
+
this._positionArrow(placement, middlewareData);
|
|
132
|
+
}
|
|
133
|
+
_positionArrow(placement, data) {
|
|
134
|
+
if (!(data.arrow && this.arrow)) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const { x, y } = data.arrow;
|
|
138
|
+
const currentPlacement = first(placement.split('-'));
|
|
139
|
+
const staticSide = {
|
|
140
|
+
top: 'bottom',
|
|
141
|
+
right: 'left',
|
|
142
|
+
bottom: 'top',
|
|
143
|
+
left: 'right',
|
|
144
|
+
}[currentPlacement];
|
|
145
|
+
this.arrow.part = currentPlacement;
|
|
146
|
+
Object.assign(this.arrow.style, {
|
|
147
|
+
left: x != null ? `${roundByDPR(x + this.arrowOffset)}px` : '',
|
|
148
|
+
top: y != null ? `${roundByDPR(y + this.arrowOffset)}px` : '',
|
|
149
|
+
[staticSide]: '-4px',
|
|
150
|
+
});
|
|
119
151
|
}
|
|
120
152
|
_anchorSlotChange() {
|
|
121
|
-
if (this.anchor || isEmpty(this._anchors))
|
|
153
|
+
if (this.anchor || isEmpty(this._anchors)) {
|
|
122
154
|
return;
|
|
155
|
+
}
|
|
123
156
|
this.target = this._anchors[0];
|
|
124
157
|
this._updateState();
|
|
125
158
|
}
|
|
@@ -136,7 +169,7 @@ IgcPopoverComponent.tagName = 'igc-popover';
|
|
|
136
169
|
IgcPopoverComponent.styles = styles;
|
|
137
170
|
export default IgcPopoverComponent;
|
|
138
171
|
__decorate([
|
|
139
|
-
query('#container'
|
|
172
|
+
query('#container')
|
|
140
173
|
], IgcPopoverComponent.prototype, "_container", void 0);
|
|
141
174
|
__decorate([
|
|
142
175
|
queryAssignedElements({ slot: 'anchor', flatten: true })
|
|
@@ -144,6 +177,15 @@ __decorate([
|
|
|
144
177
|
__decorate([
|
|
145
178
|
property()
|
|
146
179
|
], IgcPopoverComponent.prototype, "anchor", void 0);
|
|
180
|
+
__decorate([
|
|
181
|
+
property({ attribute: false })
|
|
182
|
+
], IgcPopoverComponent.prototype, "arrow", void 0);
|
|
183
|
+
__decorate([
|
|
184
|
+
property({ type: Number, attribute: 'arrow-offset' })
|
|
185
|
+
], IgcPopoverComponent.prototype, "arrowOffset", void 0);
|
|
186
|
+
__decorate([
|
|
187
|
+
property({ type: Boolean, reflect: true })
|
|
188
|
+
], IgcPopoverComponent.prototype, "inline", void 0);
|
|
147
189
|
__decorate([
|
|
148
190
|
property({ type: Boolean, reflect: true })
|
|
149
191
|
], IgcPopoverComponent.prototype, "flip", void 0);
|
|
@@ -162,6 +204,9 @@ __decorate([
|
|
|
162
204
|
__decorate([
|
|
163
205
|
property({ type: Boolean, reflect: true })
|
|
164
206
|
], IgcPopoverComponent.prototype, "shift", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
property({ type: Number, attribute: 'shift-padding' })
|
|
209
|
+
], IgcPopoverComponent.prototype, "shiftPadding", void 0);
|
|
165
210
|
__decorate([
|
|
166
211
|
watch('anchor')
|
|
167
212
|
], IgcPopoverComponent.prototype, "anchorChange", null);
|
|
@@ -169,10 +214,14 @@ __decorate([
|
|
|
169
214
|
watch('open', { waitUntilFirstUpdate: true })
|
|
170
215
|
], IgcPopoverComponent.prototype, "openChange", null);
|
|
171
216
|
__decorate([
|
|
217
|
+
watch('arrow', { waitUntilFirstUpdate: true }),
|
|
218
|
+
watch('arrowOffset', { waitUntilFirstUpdate: true }),
|
|
172
219
|
watch('flip', { waitUntilFirstUpdate: true }),
|
|
220
|
+
watch('inline', { waitUntilFirstUpdate: true }),
|
|
173
221
|
watch('offset', { waitUntilFirstUpdate: true }),
|
|
174
222
|
watch('placement', { waitUntilFirstUpdate: true }),
|
|
175
223
|
watch('sameWidth', { waitUntilFirstUpdate: true }),
|
|
176
|
-
watch('shift', { waitUntilFirstUpdate: true })
|
|
224
|
+
watch('shift', { waitUntilFirstUpdate: true }),
|
|
225
|
+
watch('shiftPadding', { waitUntilFirstUpdate: true })
|
|
177
226
|
], IgcPopoverComponent.prototype, "floatingPropChange", null);
|
|
178
227
|
//# sourceMappingURL=popover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","sourceRoot":"","sources":["../../../src/components/popover/popover.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAEL,UAAU,EACV,eAAe,EACf,IAAI,EACJ,UAAU,EACV,MAAM,EACN,KAAK,EACL,IAAI,GACL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE3E,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EACL,sBAAsB,EACtB,OAAO,EACP,QAAQ,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CAAC,QAAQ,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;IAC/C,KAAK,CAAC,WAAW,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;IAClD,KAAK,CAAC,WAAW,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;IAClD,KAAK,CAAC,OAAO,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;6DAG9C","sourcesContent":["import {\n type Middleware,\n autoUpdate,\n computePosition,\n flip,\n limitShift,\n offset,\n shift,\n size,\n} from '@floating-ui/dom';\nimport { LitElement, html } from 'lit';\nimport { property, query, queryAssignedElements } from 'lit/decorators.js';\n\nimport { watch } from '../common/decorators/watch.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport {\n getElementByIdFromRoot,\n isEmpty,\n isString,\n roundByDPR,\n} from '../common/util.js';\nimport { styles } from './themes/light/popover.base.css.js';\n\n/**\n * Describes the preferred placement of a toggle component.\n */\nexport type PopoverPlacement =\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'left'\n | 'left-start'\n | 'left-end';\n\n/* blazorSuppress */\n/**\n * @element igc-popover\n *\n * @slot - Content of the popover.\n * @slot anchor - The element the popover will be anchored to.\n *\n * @csspart container - The container wrapping the slotted content in the popover.\n */\nexport default class IgcPopoverComponent extends LitElement {\n public static readonly tagName = 'igc-popover';\n public static override styles = styles;\n\n /* blazorSuppress */\n public static register() {\n registerComponent(IgcPopoverComponent);\n }\n\n private dispose?: ReturnType<typeof autoUpdate>;\n private target?: Element;\n\n @query('#container', true)\n private _container!: HTMLElement;\n\n @queryAssignedElements({ slot: 'anchor', flatten: true })\n private _anchors!: HTMLElement[];\n\n /**\n * Pass an IDREF or an DOM element reference to use as the\n * anchor target for the floating element.\n */\n @property()\n public anchor?: Element | string;\n\n /**\n * When enabled this changes the placement of the floating element in order to keep it\n * in view along the main axis.\n */\n @property({ type: Boolean, reflect: true })\n public flip = false;\n\n /**\n * Placement modifier which translates the floating element along the main axis.\n */\n @property({ type: Number })\n public offset = 0;\n\n /**\n * The visibility state of the popover component.\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * Where to place the floating element relative to the parent anchor element.\n */\n @property()\n public placement: PopoverPlacement = 'bottom-start';\n\n /**\n * When enabled the floating element will match the width of its parent anchor element.\n */\n @property({ type: Boolean, reflect: true, attribute: 'same-width' })\n public sameWidth = false;\n\n /**\n * When enabled this tries to shift the floating element along the main axis\n * keeping it in view, preventing overflow while maintaining the desired placement.\n */\n @property({ type: Boolean, reflect: true })\n public shift = false;\n\n @watch('anchor')\n protected async anchorChange() {\n const newTarget = isString(this.anchor)\n ? getElementByIdFromRoot(this, this.anchor)\n : this.anchor;\n\n if (newTarget) {\n this.target = newTarget;\n this._updateState();\n }\n }\n\n @watch('open', { waitUntilFirstUpdate: true })\n protected openChange() {\n this.open ? this.show() : this.hide();\n }\n\n @watch('flip', { waitUntilFirstUpdate: true })\n @watch('offset', { waitUntilFirstUpdate: true })\n @watch('placement', { waitUntilFirstUpdate: true })\n @watch('sameWidth', { waitUntilFirstUpdate: true })\n @watch('shift', { waitUntilFirstUpdate: true })\n protected floatingPropChange() {\n this._updateState();\n }\n\n public override async connectedCallback() {\n super.connectedCallback();\n\n await this.updateComplete;\n if (this.open) {\n this.show();\n }\n }\n\n public override disconnectedCallback() {\n this.hide();\n super.disconnectedCallback();\n }\n\n protected show() {\n if (!this.target) return;\n this._showPopover();\n\n this.dispose = autoUpdate(\n this.target,\n this._container,\n this._updatePosition.bind(this)\n );\n }\n\n protected async hide(): Promise<void> {\n this._hidePopover();\n\n return new Promise((resolve) => {\n this.dispose?.();\n this.dispose = undefined;\n resolve();\n });\n }\n\n private _showPopover() {\n this._container?.showPopover();\n }\n\n private _hidePopover() {\n this._container?.hidePopover();\n }\n\n private _createMiddleware(): Middleware[] {\n const middleware: Middleware[] = [];\n const styles = this._container.style;\n\n if (this.offset) {\n middleware.push(offset(this.offset));\n }\n\n if (this.shift) {\n middleware.push(\n shift({\n limiter: limitShift(),\n })\n );\n }\n\n if (this.flip) {\n middleware.push(flip());\n }\n\n if (this.sameWidth) {\n middleware.push(\n size({\n apply: ({ rects }) => {\n Object.assign(styles, { width: `${rects.reference.width}px` });\n },\n })\n );\n } else {\n Object.assign(styles, { width: '' });\n }\n\n return middleware;\n }\n\n private async _updateState() {\n if (this.open) {\n await this.hide();\n this.show();\n }\n }\n\n private async _updatePosition() {\n if (!this.open || !this.target) {\n return;\n }\n\n const { x, y } = await computePosition(this.target, this._container, {\n placement: this.placement ?? 'bottom-start',\n middleware: this._createMiddleware(),\n strategy: 'fixed',\n });\n\n Object.assign(this._container.style, {\n left: 0,\n top: 0,\n transform: `translate(${roundByDPR(x)}px,${roundByDPR(y)}px)`,\n });\n }\n\n private _anchorSlotChange() {\n if (this.anchor || isEmpty(this._anchors)) return;\n\n this.target = this._anchors[0];\n this._updateState();\n }\n\n protected override render() {\n return html`\n <slot name=\"anchor\" @slotchange=${this._anchorSlotChange}></slot>\n <div id=\"container\" part=\"container\" popover=\"manual\">\n <slot></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-popover': IgcPopoverComponent;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"popover.js","sourceRoot":"","sources":["../../../src/components/popover/popover.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAIL,KAAK,EACL,UAAU,EACV,eAAe,EACf,IAAI,EACJ,MAAM,EACN,UAAU,EACV,MAAM,EACN,KAAK,EACL,IAAI,GACL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE3E,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B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GrD","sourcesContent":["import {\n type Middleware,\n type MiddlewareData,\n type Placement,\n arrow,\n autoUpdate,\n computePosition,\n flip,\n inline,\n limitShift,\n offset,\n shift,\n size,\n} from '@floating-ui/dom';\nimport { LitElement, html } from 'lit';\nimport { property, query, queryAssignedElements } from 'lit/decorators.js';\n\nimport { watch } from '../common/decorators/watch.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport {\n first,\n getElementByIdFromRoot,\n isEmpty,\n isString,\n roundByDPR,\n} from '../common/util.js';\nimport { styles } from './themes/light/popover.base.css.js';\n\n/**\n * Describes the preferred placement of a toggle component.\n */\nexport type PopoverPlacement =\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'left'\n | 'left-start'\n | 'left-end';\n\n/* blazorSuppress */\n/**\n * @element igc-popover\n *\n * @slot - Content of the popover.\n * @slot anchor - The element the popover will be anchored to.\n *\n * @csspart container - The container wrapping the slotted content in the popover.\n */\nexport default class IgcPopoverComponent extends LitElement {\n public static readonly tagName = 'igc-popover';\n public static override styles = styles;\n\n /* blazorSuppress */\n public static register() {\n registerComponent(IgcPopoverComponent);\n }\n\n private dispose?: ReturnType<typeof autoUpdate>;\n private target?: Element;\n\n @query('#container')\n private _container!: HTMLElement;\n\n @queryAssignedElements({ slot: 'anchor', flatten: true })\n private _anchors!: HTMLElement[];\n\n /**\n * Pass an IDREF or an DOM element reference to use as the\n * anchor target for the floating element.\n */\n @property()\n public anchor?: Element | string;\n\n /**\n * Element to render as an \"arrow\" element for the current popover.\n */\n @property({ attribute: false })\n public arrow: HTMLElement | null = null;\n\n /** Additional offset to apply to the arrow element if enabled. */\n @property({ type: Number, attribute: 'arrow-offset' })\n public arrowOffset = 0;\n\n /**\n * Improves positioning for inline reference elements that span over multiple lines.\n * Useful for tooltips or similar components.\n */\n @property({ type: Boolean, reflect: true })\n public inline = false;\n\n /**\n * When enabled this changes the placement of the floating element in order to keep it\n * in view along the main axis.\n */\n @property({ type: Boolean, reflect: true })\n public flip = false;\n\n /**\n * Placement modifier which translates the floating element along the main axis.\n */\n @property({ type: Number })\n public offset = 0;\n\n /**\n * The visibility state of the popover component.\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * Where to place the floating element relative to the parent anchor element.\n */\n @property()\n public placement: PopoverPlacement = 'bottom-start';\n\n /**\n * When enabled the floating element will match the width of its parent anchor element.\n */\n @property({ type: Boolean, reflect: true, attribute: 'same-width' })\n public sameWidth = false;\n\n /**\n * When enabled this tries to shift the floating element along the main axis\n * keeping it in view, preventing overflow while maintaining the desired placement.\n */\n @property({ type: Boolean, reflect: true })\n public shift = false;\n\n /**\n * Virtual padding for the resolved overflow detection offsets in pixels.\n */\n @property({ type: Number, attribute: 'shift-padding' })\n public shiftPadding = 0;\n\n @watch('anchor')\n protected anchorChange() {\n const newTarget = isString(this.anchor)\n ? getElementByIdFromRoot(this, this.anchor)\n : this.anchor;\n\n if (newTarget) {\n this.target = newTarget;\n this._updateState();\n }\n }\n\n @watch('open', { waitUntilFirstUpdate: true })\n protected openChange() {\n this.open ? this.show() : this.hide();\n }\n\n @watch('arrow', { waitUntilFirstUpdate: true })\n @watch('arrowOffset', { waitUntilFirstUpdate: true })\n @watch('flip', { waitUntilFirstUpdate: true })\n @watch('inline', { waitUntilFirstUpdate: true })\n @watch('offset', { waitUntilFirstUpdate: true })\n @watch('placement', { waitUntilFirstUpdate: true })\n @watch('sameWidth', { waitUntilFirstUpdate: true })\n @watch('shift', { waitUntilFirstUpdate: true })\n @watch('shiftPadding', { waitUntilFirstUpdate: true })\n protected floatingPropChange() {\n this._updateState();\n }\n\n public override async connectedCallback() {\n super.connectedCallback();\n\n await this.updateComplete;\n if (this.open) {\n this.show();\n }\n }\n\n public override disconnectedCallback() {\n this.hide();\n super.disconnectedCallback();\n }\n\n protected show() {\n if (!this.target) {\n return;\n }\n\n this._showPopover();\n\n this.dispose = autoUpdate(\n this.target,\n this._container,\n this._updatePosition.bind(this)\n );\n }\n\n protected async hide(): Promise<void> {\n this._hidePopover();\n\n return new Promise((resolve) => {\n this.dispose?.();\n this.dispose = undefined;\n resolve();\n });\n }\n\n private _showPopover() {\n this._container?.showPopover();\n }\n\n private _hidePopover() {\n this._container?.hidePopover();\n }\n\n private _createMiddleware(): Middleware[] {\n const middleware: Middleware[] = [];\n const styles = this._container.style;\n\n if (this.offset) {\n middleware.push(offset(this.offset));\n }\n\n if (this.inline) {\n middleware.push(inline());\n }\n\n if (this.shift) {\n middleware.push(\n shift({\n padding: this.shiftPadding,\n limiter: limitShift(),\n })\n );\n }\n\n if (this.arrow) {\n middleware.push(arrow({ element: this.arrow }));\n }\n\n if (this.flip) {\n middleware.push(flip());\n }\n\n if (this.sameWidth) {\n middleware.push(\n size({\n apply: ({ rects }) => {\n Object.assign(styles, { width: `${rects.reference.width}px` });\n },\n })\n );\n } else {\n Object.assign(styles, { width: '' });\n }\n\n return middleware;\n }\n\n private async _updateState() {\n if (this.open) {\n await this.hide();\n this.show();\n }\n }\n\n private async _updatePosition() {\n if (!(this.open && this.target)) {\n return;\n }\n\n const { x, y, middlewareData, placement } = await computePosition(\n this.target,\n this._container,\n {\n placement: this.placement ?? 'bottom-start',\n middleware: this._createMiddleware(),\n strategy: 'fixed',\n }\n );\n\n Object.assign(this._container.style, {\n left: 0,\n top: 0,\n transform: `translate(${roundByDPR(x)}px,${roundByDPR(y)}px)`,\n });\n\n this._positionArrow(placement, middlewareData);\n }\n\n private _positionArrow(placement: Placement, data: MiddlewareData) {\n if (!(data.arrow && this.arrow)) {\n return;\n }\n\n const { x, y } = data.arrow;\n\n // The current placement of the popover along the x/y axis\n const currentPlacement = first(placement.split('-'));\n\n // The opposite side where the arrow element should render based on the `currentPlacement`\n const staticSide = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }[currentPlacement]!;\n\n this.arrow.part = currentPlacement;\n\n Object.assign(this.arrow.style, {\n left: x != null ? `${roundByDPR(x + this.arrowOffset)}px` : '',\n top: y != null ? `${roundByDPR(y + this.arrowOffset)}px` : '',\n [staticSide]: '-4px',\n });\n }\n\n private _anchorSlotChange() {\n if (this.anchor || isEmpty(this._anchors)) {\n return;\n }\n\n this.target = this._anchors[0];\n this._updateState();\n }\n\n protected override render() {\n return html`\n <slot name=\"anchor\" @slotchange=${this._anchorSlotChange}></slot>\n <div id=\"container\" part=\"container\" popover=\"manual\">\n <slot></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-popover': IgcPopoverComponent;\n }\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `:host::part(base){transition:none}:host ::part(helper-text){font-family:var(--ig-body-2-font-family, var(--ig-font-family));font-size:var(--ig-body-2-font-size);font-weight:var(--ig-body-2-font-weight);font-style:var(--ig-body-2-font-style);line-height:var(--ig-body-2-line-height);letter-spacing:var(--ig-body-2-letter-spacing);text-transform:var(--ig-body-2-text-transform);margin-top:var(--ig-body-2-margin-top);margin-bottom:var(--ig-body-2-margin-bottom);margin-block-start:1rem;grid-auto-rows:minmax(1.25rem, auto)}[part~=label]{font-family:var(--ig-body-1-font-family, var(--ig-font-family));font-size:var(--ig-body-1-font-size);font-weight:var(--ig-body-1-font-weight);font-style:var(--ig-body-1-font-style);line-height:var(--ig-body-1-line-height);letter-spacing:var(--ig-body-1-letter-spacing);text-transform:var(--ig-body-1-text-transform);margin-top:var(--ig-body-1-margin-top);margin-bottom:var(--ig-body-1-margin-bottom)}[part~=base]{gap:.5rem}[part~=control]{--size: 1rem;border-radius:var(--size);width:var(--size);height:var(--size);min-width:var(--size);background:var(--empty-fill-color);transition:rgba(0,0,0,0)}[part~=control]::before,[part~=control]::after{transition:none;border-radius:calc(var(--size)/2)}[part~=control]::before{transform:translate(-50%, -50%) scale(0.4375)}[part~=control]::after{width:inherit;height:inherit;min-width:inherit;border:.0625rem solid var(--empty-color)}[part~=focused] [part~=control]{box-shadow:0 0 0 .25rem var(--focus-outline-color)}[part~=focused] [part=control]::after{border-color:var(--
|
|
2
|
+
export const styles = css `:host::part(base){transition:none}:host ::part(helper-text){font-family:var(--ig-body-2-font-family, var(--ig-font-family));font-size:var(--ig-body-2-font-size);font-weight:var(--ig-body-2-font-weight);font-style:var(--ig-body-2-font-style);line-height:var(--ig-body-2-line-height);letter-spacing:var(--ig-body-2-letter-spacing);text-transform:var(--ig-body-2-text-transform);margin-top:var(--ig-body-2-margin-top);margin-bottom:var(--ig-body-2-margin-bottom);margin-block-start:1rem;grid-auto-rows:minmax(1.25rem, auto)}[part~=label]{font-family:var(--ig-body-1-font-family, var(--ig-font-family));font-size:var(--ig-body-1-font-size);font-weight:var(--ig-body-1-font-weight);font-style:var(--ig-body-1-font-style);line-height:var(--ig-body-1-line-height);letter-spacing:var(--ig-body-1-letter-spacing);text-transform:var(--ig-body-1-text-transform);margin-top:var(--ig-body-1-margin-top);margin-bottom:var(--ig-body-1-margin-bottom)}[part~=base]{gap:.5rem}[part~=control]{--size: 1rem;border-radius:var(--size);width:var(--size);height:var(--size);min-width:var(--size);background:var(--empty-fill-color);transition:rgba(0,0,0,0)}[part~=control]::before,[part~=control]::after{transition:none;border-radius:calc(var(--size)/2)}[part~=control]::before{transform:translate(-50%, -50%) scale(0.4375)}[part~=control]::after{width:inherit;height:inherit;min-width:inherit;border:.0625rem solid var(--empty-color)}[part~=focused] [part~=control]{box-shadow:0 0 0 .25rem var(--focus-outline-color)}[part~=focused] [part=control]::after{border-color:var(--focus-border-color)}[part="control checked"]::after{background:var(--fill-color);border-color:var(--fill-color)}[part="control checked"]::before{border-color:var(--fill-hover-border-color);background:var(--fill-hover-border-color)}:host(:hover) [part=control]::after{border-color:var(--hover-color)}:host(:hover) [part="control checked"]::after{background:var(--fill-color-hover);border-color:var(--fill-color-hover)}:host(:hover) [part~=focused] [part=control]::after{border-color:hsl(from var(--focus-border-color) h calc(s * 1.12) calc(l * 0.82))}:host(:not([disabled])[invalid]) [part~=control]::after,:host(:not(:disabled)[invalid]) [part~=control]::after{border-color:var(--error-color)}:host(:not([disabled])[invalid]) [part="control checked"]::after,:host(:not(:disabled)[invalid]) [part="control checked"]::after{background:var(--error-color)}:host(:not([disabled])[invalid]) [part~=focused] [part~=control],:host(:not(:disabled)[invalid]) [part~=focused] [part~=control]{box-shadow:0 0 0 .25rem var(--focus-outline-color-error)}:host(:not([disabled])[invalid]:hover) [part~=control]::after{border-color:var(--error-color-hover)}:host(:not([disabled])[invalid]:hover) [part="control checked"]::after{background:var(--error-color-hover)}:host([disabled]) [part=control]::after,:host(:disabled) [part=control]::after{border-color:var(--disabled-color)}:host([disabled]) [part="control checked"]::after,:host(:disabled) [part="control checked"]::after{background:var(--disabled-fill-color);border-color:var(--disabled-fill-color)}`;
|
|
3
3
|
//# sourceMappingURL=radio.bootstrap.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.bootstrap.css.js","sourceRoot":"","sources":["../../../../../src/components/radio/themes/shared/radio.bootstrap.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,
|
|
1
|
+
{"version":3,"file":"radio.bootstrap.css.js","sourceRoot":"","sources":["../../../../../src/components/radio/themes/shared/radio.bootstrap.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,ghGAAghG,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host::part(base){transition:none}:host ::part(helper-text){font-family:var(--ig-body-2-font-family, var(--ig-font-family));font-size:var(--ig-body-2-font-size);font-weight:var(--ig-body-2-font-weight);font-style:var(--ig-body-2-font-style);line-height:var(--ig-body-2-line-height);letter-spacing:var(--ig-body-2-letter-spacing);text-transform:var(--ig-body-2-text-transform);margin-top:var(--ig-body-2-margin-top);margin-bottom:var(--ig-body-2-margin-bottom);margin-block-start:1rem;grid-auto-rows:minmax(1.25rem, auto)}[part~=label]{font-family:var(--ig-body-1-font-family, var(--ig-font-family));font-size:var(--ig-body-1-font-size);font-weight:var(--ig-body-1-font-weight);font-style:var(--ig-body-1-font-style);line-height:var(--ig-body-1-line-height);letter-spacing:var(--ig-body-1-letter-spacing);text-transform:var(--ig-body-1-text-transform);margin-top:var(--ig-body-1-margin-top);margin-bottom:var(--ig-body-1-margin-bottom)}[part~=base]{gap:.5rem}[part~=control]{--size: 1rem;border-radius:var(--size);width:var(--size);height:var(--size);min-width:var(--size);background:var(--empty-fill-color);transition:rgba(0,0,0,0)}[part~=control]::before,[part~=control]::after{transition:none;border-radius:calc(var(--size)/2)}[part~=control]::before{transform:translate(-50%, -50%) scale(0.4375)}[part~=control]::after{width:inherit;height:inherit;min-width:inherit;border:.0625rem solid var(--empty-color)}[part~=focused] [part~=control]{box-shadow:0 0 0 .25rem var(--focus-outline-color)}[part~=focused] [part=control]::after{border-color:var(--focus-border-color)}[part=\"control checked\"]::after{background:var(--fill-color);border-color:var(--fill-color)}[part=\"control checked\"]::before{border-color:var(--fill-hover-border-color);background:var(--fill-hover-border-color)}:host(:hover) [part=control]::after{border-color:var(--hover-color)}:host(:hover) [part=\"control checked\"]::after{background:var(--fill-color-hover);border-color:var(--fill-color-hover)}:host(:hover) [part~=focused] [part=control]::after{border-color:hsl(from var(--focus-border-color) h calc(s * 1.12) calc(l * 0.82))}:host(:not([disabled])[invalid]) [part~=control]::after,:host(:not(:disabled)[invalid]) [part~=control]::after{border-color:var(--error-color)}:host(:not([disabled])[invalid]) [part=\"control checked\"]::after,:host(:not(:disabled)[invalid]) [part=\"control checked\"]::after{background:var(--error-color)}:host(:not([disabled])[invalid]) [part~=focused] [part~=control],:host(:not(:disabled)[invalid]) [part~=focused] [part~=control]{box-shadow:0 0 0 .25rem var(--focus-outline-color-error)}:host(:not([disabled])[invalid]:hover) [part~=control]::after{border-color:var(--error-color-hover)}:host(:not([disabled])[invalid]:hover) [part=\"control checked\"]::after{background:var(--error-color-hover)}:host([disabled]) [part=control]::after,:host(:disabled) [part=control]::after{border-color:var(--disabled-color)}:host([disabled]) [part=\"control checked\"]::after,:host(:disabled) [part=\"control checked\"]::after{background:var(--disabled-fill-color);border-color:var(--disabled-fill-color)}`;\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `[part~=prefixed] [part~=prefix]{color:var(--input-prefix-color);background:var(--input-prefix-background)}[part~=suffixed] [part~=suffix]{color:var(--input-suffix-color);background:var(--input-suffix-background)}[part~=filled] [part~=input]{color:var(--
|
|
2
|
+
export const styles = css `[part~=prefixed] [part~=prefix]{color:var(--input-prefix-color);background:var(--input-prefix-background)}[part~=suffixed] [part~=suffix]{color:var(--input-suffix-color);background:var(--input-suffix-background)}[part~=filled] [part~=input]{color:var(--filled-text-color)}[part~=filled] [part~=prefix]{color:var(--input-prefix-color--filled);background:var(--input-prefix-background--filled)}[part~=filled] [part~=suffix]{color:var(--input-suffix-color--filled);background:var(--input-suffix-background--filled)}[part~=label]{color:var(--idle-secondary-color)}textarea{background:rgba(0,0,0,0);color:var(--filled-text-color)}textarea::-moz-placeholder{color:var(--placeholder-color)}textarea::placeholder{color:var(--placeholder-color)}:host(:hover) textarea::-moz-placeholder, :host(:focus) textarea::-moz-placeholder{color:var(--hover-placeholder-color)}:host(:hover) textarea::placeholder,:host(:focus) textarea::placeholder{color:var(--hover-placeholder-color)}:host(:disabled),:host([disabled]){color:var(--disabled-text-color)}:host(:disabled) [part=prefix],:host(:disabled) [part=suffix],:host([disabled]) [part=prefix],:host([disabled]) [part=suffix]{color:var(--disabled-text-color);background:inherit}:host(:disabled) ::part(helper-text),:host([disabled]) ::part(helper-text){color:var(--disabled-text-color)}:host(:disabled) textarea,:host([disabled]) textarea{color:var(--disabled-text-color)}:host(:disabled) textarea::-moz-placeholder, :host([disabled]) textarea::-moz-placeholder{color:var(--disabled-placeholder-color)}:host(:disabled) textarea::placeholder,:host([disabled]) textarea::placeholder{color:var(--disabled-placeholder-color)}:host(:disabled) [part~=label],:host([disabled]) [part~=label]{color:var(--disabled-text-color)}`;
|
|
3
3
|
//# sourceMappingURL=textarea.common.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.common.css.js","sourceRoot":"","sources":["../../../../../src/components/textarea/themes/shared/textarea.common.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,
|
|
1
|
+
{"version":3,"file":"textarea.common.css.js","sourceRoot":"","sources":["../../../../../src/components/textarea/themes/shared/textarea.common.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,wtDAAwtD,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`[part~=prefixed] [part~=prefix]{color:var(--input-prefix-color);background:var(--input-prefix-background)}[part~=suffixed] [part~=suffix]{color:var(--input-suffix-color);background:var(--input-suffix-background)}[part~=filled] [part~=input]{color:var(--filled-text-color)}[part~=filled] [part~=prefix]{color:var(--input-prefix-color--filled);background:var(--input-prefix-background--filled)}[part~=filled] [part~=suffix]{color:var(--input-suffix-color--filled);background:var(--input-suffix-background--filled)}[part~=label]{color:var(--idle-secondary-color)}textarea{background:rgba(0,0,0,0);color:var(--filled-text-color)}textarea::-moz-placeholder{color:var(--placeholder-color)}textarea::placeholder{color:var(--placeholder-color)}:host(:hover) textarea::-moz-placeholder, :host(:focus) textarea::-moz-placeholder{color:var(--hover-placeholder-color)}:host(:hover) textarea::placeholder,:host(:focus) textarea::placeholder{color:var(--hover-placeholder-color)}:host(:disabled),:host([disabled]){color:var(--disabled-text-color)}:host(:disabled) [part=prefix],:host(:disabled) [part=suffix],:host([disabled]) [part=prefix],:host([disabled]) [part=suffix]{color:var(--disabled-text-color);background:inherit}:host(:disabled) ::part(helper-text),:host([disabled]) ::part(helper-text){color:var(--disabled-text-color)}:host(:disabled) textarea,:host([disabled]) textarea{color:var(--disabled-text-color)}:host(:disabled) textarea::-moz-placeholder, :host([disabled]) textarea::-moz-placeholder{color:var(--disabled-placeholder-color)}:host(:disabled) textarea::placeholder,:host([disabled]) textarea::placeholder{color:var(--disabled-placeholder-color)}:host(:disabled) [part~=label],:host([disabled]) [part~=label]{color:var(--disabled-text-color)}`;\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `:host{font-family:var(--ig-body-2-font-family, var(--ig-font-family));font-size:var(--ig-body-2-font-size);font-weight:var(--ig-body-2-font-weight);font-style:var(--ig-body-2-font-style);line-height:var(--ig-body-2-line-height);letter-spacing:var(--ig-body-2-letter-spacing);text-transform:var(--ig-body-2-text-transform);margin-top:var(--ig-body-2-margin-top);margin-bottom:var(--ig-body-2-margin-bottom);--component-size: var(--ig-size, var(--default-size))}:host ::part(helper-text){font-family:var(--ig-caption-font-family, var(--ig-font-family));font-size:var(--ig-caption-font-size);font-weight:var(--ig-caption-font-weight);font-style:var(--ig-caption-font-style);line-height:var(--ig-caption-line-height);letter-spacing:var(--ig-caption-letter-spacing);text-transform:var(--ig-caption-text-transform);margin-top:var(--ig-caption-margin-top);margin-bottom:var(--ig-caption-margin-bottom);color:var(--helper-text-color);grid-auto-rows:minmax(1.125rem, auto);margin-block-start:.3125rem}:host(:hover) [part~=container]{border-color:var(--hover-border-color)}:host(:focus-within) [part~=container]{border-color:var(--focused-border-color);border-width:.125rem}:host(:focus-within) [part~=prefix]:not([hidden]){margin-inline-start:-0.0625rem}:host(:focus-within) [part~=suffix]:not([hidden]){margin-inline-end:-0.0625rem}:host(:focus-within) textarea{margin-block:-0.0625rem;margin-inline-start:-0.0625rem}:host(:focus-within) [part~=prefix]:not([hidden])~textarea{margin-inline:initial}[part~=container]{border:.0625rem solid var(--border-color);background:var(--border-background);align-items:stretch;overflow:hidden;border-radius:var(--border-border-radius)}[part~=label]{display:block;font-size:.875rem;font-weight:600;position:static;transform:translateY(0);transform-origin:top left;margin-top:0;height:auto;margin-block-end:.
|
|
2
|
+
export const styles = css `:host{font-family:var(--ig-body-2-font-family, var(--ig-font-family));font-size:var(--ig-body-2-font-size);font-weight:var(--ig-body-2-font-weight);font-style:var(--ig-body-2-font-style);line-height:var(--ig-body-2-line-height);letter-spacing:var(--ig-body-2-letter-spacing);text-transform:var(--ig-body-2-text-transform);margin-top:var(--ig-body-2-margin-top);margin-bottom:var(--ig-body-2-margin-bottom);--component-size: var(--ig-size, var(--default-size))}:host ::part(helper-text){font-family:var(--ig-caption-font-family, var(--ig-font-family));font-size:var(--ig-caption-font-size);font-weight:var(--ig-caption-font-weight);font-style:var(--ig-caption-font-style);line-height:var(--ig-caption-line-height);letter-spacing:var(--ig-caption-letter-spacing);text-transform:var(--ig-caption-text-transform);margin-top:var(--ig-caption-margin-top);margin-bottom:var(--ig-caption-margin-bottom);color:var(--helper-text-color);grid-auto-rows:minmax(1.125rem, auto);margin-block-start:.3125rem}:host(:hover) [part~=container]{border-color:var(--hover-border-color)}:host(:focus-within) [part~=container]{border-color:var(--focused-border-color);border-width:.125rem}:host(:focus-within) [part~=prefix]:not([hidden]){margin-inline-start:-0.0625rem}:host(:focus-within) [part~=suffix]:not([hidden]){margin-inline-end:-0.0625rem}:host(:focus-within) textarea{margin-block:-0.0625rem;margin-inline-start:-0.0625rem}:host(:focus-within) [part~=prefix]:not([hidden])~textarea{margin-inline:initial}[part~=container]{border:.0625rem solid var(--border-color);background:var(--border-background);align-items:stretch;overflow:hidden;border-radius:var(--border-border-radius)}[part~=label]{display:block;font-size:.875rem;font-weight:600;position:static;transform:translateY(0);transform-origin:top left;margin-top:0;height:auto;margin-block-end:.3125rem}:host([invalid]) [part~=label]{color:var(--idle-text-color)}textarea{font-family:var(--ig-body-2-font-family, var(--ig-font-family));font-size:var(--ig-body-2-font-size);font-weight:var(--ig-body-2-font-weight);font-style:var(--ig-body-2-font-style);line-height:var(--ig-body-2-line-height);letter-spacing:var(--ig-body-2-letter-spacing);text-transform:var(--ig-body-2-text-transform);margin-top:var(--ig-body-2-margin-top);margin-bottom:var(--ig-body-2-margin-bottom);padding:.5rem}:host([required]:not(:disabled)) [part~=label]::after,:host([required]:not([disabled])) [part~=label]::after{color:var(--error-secondary-color)}:host([invalid]:not(:disabled)) ::part(helper-text),:host([invalid]:not([disabled])) ::part(helper-text){color:var(--error-secondary-color)}:host([invalid]:not(:disabled)) [part~=container],:host([invalid]:not([disabled])) [part~=container]{border-color:var(--error-secondary-color)}:host(:disabled) [part~=container],:host([disabled]) [part~=container]{border-color:var(--disabled-border-color);background:var(--border-disabled-background)}`;
|
|
3
3
|
//# sourceMappingURL=textarea.fluent.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.fluent.css.js","sourceRoot":"","sources":["../../../../../src/components/textarea/themes/shared/textarea.fluent.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"textarea.fluent.css.js","sourceRoot":"","sources":["../../../../../src/components/textarea/themes/shared/textarea.fluent.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,i2FAAi2F,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{font-family:var(--ig-body-2-font-family, var(--ig-font-family));font-size:var(--ig-body-2-font-size);font-weight:var(--ig-body-2-font-weight);font-style:var(--ig-body-2-font-style);line-height:var(--ig-body-2-line-height);letter-spacing:var(--ig-body-2-letter-spacing);text-transform:var(--ig-body-2-text-transform);margin-top:var(--ig-body-2-margin-top);margin-bottom:var(--ig-body-2-margin-bottom);--component-size: var(--ig-size, var(--default-size))}:host ::part(helper-text){font-family:var(--ig-caption-font-family, var(--ig-font-family));font-size:var(--ig-caption-font-size);font-weight:var(--ig-caption-font-weight);font-style:var(--ig-caption-font-style);line-height:var(--ig-caption-line-height);letter-spacing:var(--ig-caption-letter-spacing);text-transform:var(--ig-caption-text-transform);margin-top:var(--ig-caption-margin-top);margin-bottom:var(--ig-caption-margin-bottom);color:var(--helper-text-color);grid-auto-rows:minmax(1.125rem, auto);margin-block-start:.3125rem}:host(:hover) [part~=container]{border-color:var(--hover-border-color)}:host(:focus-within) [part~=container]{border-color:var(--focused-border-color);border-width:.125rem}:host(:focus-within) [part~=prefix]:not([hidden]){margin-inline-start:-0.0625rem}:host(:focus-within) [part~=suffix]:not([hidden]){margin-inline-end:-0.0625rem}:host(:focus-within) textarea{margin-block:-0.0625rem;margin-inline-start:-0.0625rem}:host(:focus-within) [part~=prefix]:not([hidden])~textarea{margin-inline:initial}[part~=container]{border:.0625rem solid var(--border-color);background:var(--border-background);align-items:stretch;overflow:hidden;border-radius:var(--border-border-radius)}[part~=label]{display:block;font-size:.875rem;font-weight:600;position:static;transform:translateY(0);transform-origin:top left;margin-top:0;height:auto;margin-block-end:.3125rem}:host([invalid]) [part~=label]{color:var(--idle-text-color)}textarea{font-family:var(--ig-body-2-font-family, var(--ig-font-family));font-size:var(--ig-body-2-font-size);font-weight:var(--ig-body-2-font-weight);font-style:var(--ig-body-2-font-style);line-height:var(--ig-body-2-line-height);letter-spacing:var(--ig-body-2-letter-spacing);text-transform:var(--ig-body-2-text-transform);margin-top:var(--ig-body-2-margin-top);margin-bottom:var(--ig-body-2-margin-bottom);padding:.5rem}:host([required]:not(:disabled)) [part~=label]::after,:host([required]:not([disabled])) [part~=label]::after{color:var(--error-secondary-color)}:host([invalid]:not(:disabled)) ::part(helper-text),:host([invalid]:not([disabled])) ::part(helper-text){color:var(--error-secondary-color)}:host([invalid]:not(:disabled)) [part~=container],:host([invalid]:not([disabled])) [part~=container]{border-color:var(--error-secondary-color)}:host(:disabled) [part~=container],:host([disabled]) [part~=container]{border-color:var(--disabled-border-color);background:var(--border-disabled-background)}`;\n"]}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { ReactiveController } from 'lit';
|
|
2
|
+
import type IgcTooltipComponent from './tooltip.js';
|
|
3
|
+
declare class TooltipController implements ReactiveController {
|
|
4
|
+
private static readonly _listeners;
|
|
5
|
+
private readonly _host;
|
|
6
|
+
private readonly _options;
|
|
7
|
+
private _hostAbortController;
|
|
8
|
+
private _anchorAbortController;
|
|
9
|
+
private _showTriggers;
|
|
10
|
+
private _hideTriggers;
|
|
11
|
+
private _anchor;
|
|
12
|
+
private _initialAnchor;
|
|
13
|
+
private _isTransient;
|
|
14
|
+
private _open;
|
|
15
|
+
/** Whether the tooltip is in shown state. */
|
|
16
|
+
get open(): boolean;
|
|
17
|
+
/** Sets the shown state of the current tooltip. */
|
|
18
|
+
set open(value: boolean);
|
|
19
|
+
/**
|
|
20
|
+
* Returns the current tooltip anchor target if any.
|
|
21
|
+
*/
|
|
22
|
+
get anchor(): TooltipAnchor;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the current set of hide triggers as a comma-separated string.
|
|
25
|
+
*/
|
|
26
|
+
get hideTriggers(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Sets a new set of hide triggers from a comma-separated string.
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* If the tooltip already has an `anchor` bound it will remove the old
|
|
32
|
+
* set of triggers from it and rebind it with the new one.
|
|
33
|
+
*/
|
|
34
|
+
set hideTriggers(value: string);
|
|
35
|
+
/**
|
|
36
|
+
* Returns the current set of show triggers as a comma-separated string.
|
|
37
|
+
*/
|
|
38
|
+
get showTriggers(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Sets a new set of show triggers from a comma-separated string.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* If the tooltip already has an `anchor` bound it will remove the old
|
|
44
|
+
* set of triggers from it and rebind it with the new one.
|
|
45
|
+
*/
|
|
46
|
+
set showTriggers(value: string);
|
|
47
|
+
constructor(tooltip: IgcTooltipComponent, options: TooltipCallbacks);
|
|
48
|
+
private _addAnchorListeners;
|
|
49
|
+
private _removeAnchorListeners;
|
|
50
|
+
private _addTooltipListeners;
|
|
51
|
+
private _removeTooltipListeners;
|
|
52
|
+
private _handleTooltipEvent;
|
|
53
|
+
private _handleAnchorEvent;
|
|
54
|
+
/** @internal */
|
|
55
|
+
handleEvent(event: Event): void;
|
|
56
|
+
private _dispose;
|
|
57
|
+
/**
|
|
58
|
+
* Removes all triggers from the previous `anchor` target and rebinds the current
|
|
59
|
+
* sets back to the new value if it exists.
|
|
60
|
+
*/
|
|
61
|
+
setAnchor(value: TooltipAnchor | string, transient?: boolean): void;
|
|
62
|
+
resolveAnchor(value: TooltipAnchor | string): void;
|
|
63
|
+
/** @internal */
|
|
64
|
+
hostConnected(): void;
|
|
65
|
+
/** @internal */
|
|
66
|
+
hostDisconnected(): void;
|
|
67
|
+
}
|
|
68
|
+
export declare const TooltipRegexes: Readonly<{
|
|
69
|
+
/** Used for parsing the strings passed in the tooltip `show/hide-trigger` properties. */
|
|
70
|
+
triggers: RegExp;
|
|
71
|
+
/** Matches horizontal `PopoverPlacement` start positions. */
|
|
72
|
+
horizontalStart: RegExp;
|
|
73
|
+
/** Matches horizontal `PopoverPlacement` end positions. */
|
|
74
|
+
horizontalEnd: RegExp;
|
|
75
|
+
/** Matches vertical `PopoverPlacement` start positions. */
|
|
76
|
+
start: RegExp;
|
|
77
|
+
/** Matches vertical `PopoverPlacement` end positions. */
|
|
78
|
+
end: RegExp;
|
|
79
|
+
}>;
|
|
80
|
+
export declare function addTooltipController(host: IgcTooltipComponent, options: TooltipCallbacks): TooltipController;
|
|
81
|
+
type TooltipAnchor = Element | null | undefined;
|
|
82
|
+
type TooltipCallbacks = {
|
|
83
|
+
onShow: (event?: Event) => unknown;
|
|
84
|
+
onHide: (event?: Event) => unknown;
|
|
85
|
+
onEscape: (event?: Event) => unknown;
|
|
86
|
+
};
|
|
87
|
+
export {};
|