igniteui-webcomponents 2.2.0 → 3.0.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 +10 -5
- package/components/button/themes/button/light/button.indigo.css.js +1 -1
- package/components/button/themes/button/light/button.indigo.css.js.map +1 -1
- package/components/button/themes/icon-button/light/icon-button.base.css.js +1 -1
- package/components/button/themes/icon-button/light/icon-button.base.css.js.map +1 -1
- package/components/button/themes/icon-button/light/icon-button.bootstrap.css.js +1 -1
- package/components/button/themes/icon-button/light/icon-button.bootstrap.css.js.map +1 -1
- package/components/button/themes/icon-button/light/icon-button.fluent.css.js +1 -1
- package/components/button/themes/icon-button/light/icon-button.fluent.css.js.map +1 -1
- package/components/button/themes/icon-button/light/icon-button.indigo.css.js +1 -1
- package/components/button/themes/icon-button/light/icon-button.indigo.css.js.map +1 -1
- package/components/common/definitions/defineAllComponents.js +8 -8
- package/components/common/definitions/defineAllComponents.js.map +1 -1
- package/components/dropdown/dropdown-group.d.ts +4 -4
- package/components/dropdown/dropdown-group.js +8 -8
- package/components/dropdown/dropdown-group.js.map +1 -1
- package/components/dropdown/dropdown-header.d.ts +2 -2
- package/components/dropdown/dropdown-header.js +6 -6
- package/components/dropdown/dropdown-header.js.map +1 -1
- package/components/dropdown/dropdown-item.d.ts +2 -2
- package/components/dropdown/dropdown-item.js +12 -12
- package/components/dropdown/dropdown-item.js.map +1 -1
- package/components/dropdown/dropdown.d.ts +14 -14
- package/components/dropdown/dropdown.js +41 -47
- package/components/dropdown/dropdown.js.map +1 -1
- package/components/input/input-base.d.ts +1 -0
- package/components/input/input-base.js +1 -0
- package/components/input/input-base.js.map +1 -1
- package/components/input/input.js +1 -2
- package/components/input/input.js.map +1 -1
- package/components/input/themes/light/input.material.css.js +1 -1
- package/components/input/themes/light/input.material.css.js.map +1 -1
- package/components/nav-drawer/nav-drawer.d.ts +1 -1
- package/components/nav-drawer/nav-drawer.js +10 -7
- package/components/nav-drawer/nav-drawer.js.map +1 -1
- package/components/nav-drawer/styles/nav-drawer.base.css.js +1 -1
- package/components/nav-drawer/styles/nav-drawer.base.css.js.map +1 -1
- package/custom-elements.json +3 -3
- package/index.d.ts +4 -4
- package/index.js +4 -4
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/vscode-html-custom-data.json +8 -5
|
@@ -13,16 +13,16 @@ import { styles as bootstrap } from './themes/light/dropdown.bootstrap.css';
|
|
|
13
13
|
import { styles as fluent } from './themes/light/dropdown.fluent.css';
|
|
14
14
|
import { styles as indigo } from './themes/light/dropdown.indigo.css';
|
|
15
15
|
import { blazorSuppress, watch } from '../common/decorators';
|
|
16
|
-
import
|
|
16
|
+
import IgcDropdownItemComponent from './dropdown-item';
|
|
17
17
|
import { IgcToggleController } from '../toggle/toggle.controller';
|
|
18
18
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
19
19
|
import { SizableMixin } from '../common/mixins/sizable';
|
|
20
|
-
export var
|
|
21
|
-
(function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})(
|
|
25
|
-
let
|
|
20
|
+
export var DropdownActionKey;
|
|
21
|
+
(function (DropdownActionKey) {
|
|
22
|
+
DropdownActionKey["ESCAPE"] = "escape";
|
|
23
|
+
DropdownActionKey["ENTER"] = "enter";
|
|
24
|
+
})(DropdownActionKey || (DropdownActionKey = {}));
|
|
25
|
+
let IgcDropdownComponent = class IgcDropdownComponent extends SizableMixin(EventEmitterMixin(LitElement)) {
|
|
26
26
|
constructor() {
|
|
27
27
|
super();
|
|
28
28
|
this.keepOpenOnSelect = false;
|
|
@@ -57,10 +57,10 @@ let IgcDropDownComponent = class IgcDropDownComponent extends SizableMixin(Event
|
|
|
57
57
|
switch (key) {
|
|
58
58
|
case 'esc':
|
|
59
59
|
case 'escape':
|
|
60
|
-
this.handleItemActionKey(
|
|
60
|
+
this.handleItemActionKey(DropdownActionKey.ESCAPE);
|
|
61
61
|
break;
|
|
62
62
|
case 'enter':
|
|
63
|
-
this.handleItemActionKey(
|
|
63
|
+
this.handleItemActionKey(DropdownActionKey.ENTER);
|
|
64
64
|
break;
|
|
65
65
|
case 'arrowup':
|
|
66
66
|
case 'up':
|
|
@@ -129,11 +129,11 @@ let IgcDropDownComponent = class IgcDropDownComponent extends SizableMixin(Event
|
|
|
129
129
|
}
|
|
130
130
|
handleItemActionKey(key) {
|
|
131
131
|
switch (key) {
|
|
132
|
-
case
|
|
132
|
+
case DropdownActionKey.ENTER:
|
|
133
133
|
this.selectItem(this.activeItem);
|
|
134
134
|
this.handleChange(this.activeItem);
|
|
135
135
|
break;
|
|
136
|
-
case
|
|
136
|
+
case DropdownActionKey.ESCAPE:
|
|
137
137
|
break;
|
|
138
138
|
}
|
|
139
139
|
if (!this.keepOpenOnSelect)
|
|
@@ -142,7 +142,7 @@ let IgcDropDownComponent = class IgcDropDownComponent extends SizableMixin(Event
|
|
|
142
142
|
handleClick(event) {
|
|
143
143
|
const newSelectedItem = event
|
|
144
144
|
.composedPath()
|
|
145
|
-
.find((e) => e instanceof
|
|
145
|
+
.find((e) => e instanceof IgcDropdownItemComponent);
|
|
146
146
|
if (!newSelectedItem || newSelectedItem.disabled)
|
|
147
147
|
return;
|
|
148
148
|
this.selectItem(newSelectedItem);
|
|
@@ -317,71 +317,65 @@ let IgcDropDownComponent = class IgcDropDownComponent extends SizableMixin(Event
|
|
|
317
317
|
>
|
|
318
318
|
</slot>
|
|
319
319
|
<div
|
|
320
|
-
id="igcDDLContent"
|
|
321
320
|
part="base"
|
|
322
321
|
style=${styleMap({ position: this.positionStrategy })}
|
|
323
322
|
@click=${this.handleClick}
|
|
324
323
|
${this.toggleController.toggleDirective}
|
|
325
324
|
>
|
|
326
|
-
<div
|
|
327
|
-
id="igcScrollContainer"
|
|
328
|
-
role="listbox"
|
|
329
|
-
part="list"
|
|
330
|
-
aria-labelledby="igcDDLTarget"
|
|
331
|
-
>
|
|
325
|
+
<div role="listbox" part="list" aria-labelledby="igcDDLTarget">
|
|
332
326
|
<slot></slot>
|
|
333
327
|
</div>
|
|
334
328
|
</div>
|
|
335
329
|
`;
|
|
336
330
|
}
|
|
337
331
|
};
|
|
338
|
-
|
|
339
|
-
|
|
332
|
+
IgcDropdownComponent.tagName = 'igc-dropdown';
|
|
333
|
+
IgcDropdownComponent.styles = styles;
|
|
340
334
|
__decorate([
|
|
341
335
|
queryAssignedElements({ slot: 'target' })
|
|
342
|
-
],
|
|
336
|
+
], IgcDropdownComponent.prototype, "targetNodes", void 0);
|
|
343
337
|
__decorate([
|
|
344
|
-
query('
|
|
345
|
-
],
|
|
338
|
+
query('[part="base"]')
|
|
339
|
+
], IgcDropdownComponent.prototype, "content", void 0);
|
|
346
340
|
__decorate([
|
|
347
|
-
query('
|
|
348
|
-
],
|
|
341
|
+
query('[part="list"]')
|
|
342
|
+
], IgcDropdownComponent.prototype, "scrollContainer", void 0);
|
|
349
343
|
__decorate([
|
|
350
344
|
queryAssignedElements({ flatten: true, selector: 'igc-dropdown-item' })
|
|
351
|
-
],
|
|
345
|
+
], IgcDropdownComponent.prototype, "items", void 0);
|
|
352
346
|
__decorate([
|
|
353
347
|
queryAssignedElements({ flatten: true, selector: 'igc-dropdown-group' })
|
|
354
|
-
],
|
|
348
|
+
], IgcDropdownComponent.prototype, "groups", void 0);
|
|
355
349
|
__decorate([
|
|
356
350
|
property({ type: Boolean, attribute: 'keep-open-on-select' })
|
|
357
|
-
],
|
|
351
|
+
], IgcDropdownComponent.prototype, "keepOpenOnSelect", void 0);
|
|
358
352
|
__decorate([
|
|
359
353
|
property({ type: Boolean })
|
|
360
|
-
],
|
|
354
|
+
], IgcDropdownComponent.prototype, "open", void 0);
|
|
361
355
|
__decorate([
|
|
362
356
|
property()
|
|
363
|
-
],
|
|
357
|
+
], IgcDropdownComponent.prototype, "placement", void 0);
|
|
364
358
|
__decorate([
|
|
365
359
|
property({ attribute: 'position-strategy' })
|
|
366
|
-
],
|
|
360
|
+
], IgcDropdownComponent.prototype, "positionStrategy", void 0);
|
|
367
361
|
__decorate([
|
|
368
362
|
property({ attribute: 'scroll-strategy' })
|
|
369
|
-
],
|
|
363
|
+
], IgcDropdownComponent.prototype, "scrollStrategy", void 0);
|
|
370
364
|
__decorate([
|
|
371
365
|
property({ type: Boolean })
|
|
372
|
-
],
|
|
366
|
+
], IgcDropdownComponent.prototype, "flip", void 0);
|
|
373
367
|
__decorate([
|
|
374
368
|
property({ type: Number })
|
|
375
|
-
],
|
|
369
|
+
], IgcDropdownComponent.prototype, "distance", void 0);
|
|
376
370
|
__decorate([
|
|
377
371
|
property({ type: Boolean, attribute: 'keep-open-on-outside-click' })
|
|
378
|
-
],
|
|
372
|
+
], IgcDropdownComponent.prototype, "keepOpenOnOutsideClick", void 0);
|
|
379
373
|
__decorate([
|
|
380
374
|
property({ type: Boolean, attribute: 'same-width' })
|
|
381
|
-
],
|
|
375
|
+
], IgcDropdownComponent.prototype, "sameWidth", void 0);
|
|
382
376
|
__decorate([
|
|
383
377
|
watch('open')
|
|
384
|
-
],
|
|
378
|
+
], IgcDropdownComponent.prototype, "toggleDirectiveChange", null);
|
|
385
379
|
__decorate([
|
|
386
380
|
watch('placement'),
|
|
387
381
|
watch('flip'),
|
|
@@ -389,24 +383,24 @@ __decorate([
|
|
|
389
383
|
watch('closeOnOutsideClick'),
|
|
390
384
|
watch('distance'),
|
|
391
385
|
watch('sameWidth')
|
|
392
|
-
],
|
|
386
|
+
], IgcDropdownComponent.prototype, "updateOptions", null);
|
|
393
387
|
__decorate([
|
|
394
388
|
watch('size')
|
|
395
|
-
],
|
|
389
|
+
], IgcDropdownComponent.prototype, "sizeChange", null);
|
|
396
390
|
__decorate([
|
|
397
391
|
blazorSuppress()
|
|
398
|
-
],
|
|
392
|
+
], IgcDropdownComponent.prototype, "show", null);
|
|
399
393
|
__decorate([
|
|
400
394
|
blazorSuppress()
|
|
401
|
-
],
|
|
395
|
+
], IgcDropdownComponent.prototype, "toggle", null);
|
|
402
396
|
__decorate([
|
|
403
397
|
blazorSuppress()
|
|
404
|
-
],
|
|
398
|
+
], IgcDropdownComponent.prototype, "navigateTo", null);
|
|
405
399
|
__decorate([
|
|
406
400
|
blazorSuppress()
|
|
407
|
-
],
|
|
408
|
-
|
|
401
|
+
], IgcDropdownComponent.prototype, "select", null);
|
|
402
|
+
IgcDropdownComponent = __decorate([
|
|
409
403
|
themes({ bootstrap, fluent, indigo })
|
|
410
|
-
],
|
|
411
|
-
export default
|
|
404
|
+
], IgcDropdownComponent);
|
|
405
|
+
export default IgcDropdownComponent;
|
|
412
406
|
//# sourceMappingURL=dropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../../src/components/dropdown/dropdown.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAM7D,OAAO,wBAAwB,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,CAAN,IAAY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S,EAAE,iBAAiB,EAAE,CAAC;4DACoB;AAO/D;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDACR;AAIpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDACP;AAIpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAE,CAAC;oEAC/B;AAItC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;uDAC5B;AAGzB;IADC,KAAK,CAAC,MAAM,CAAC;iEAuBb;AAQD;IANC,KAAK,CAAC,WAAW,CAAC;IAClB,KAAK,CAAC,MAAM,CAAC;IACb,KAAK,CAAC,kBAAkB,CAAC;IACzB,KAAK,CAAC,qBAAqB,CAAC;IAC5B,KAAK,CAAC,UAAU,CAAC;IACjB,KAAK,CAAC,WAAW,CAAC;yDAKlB;AAGD;IADC,KAAK,CAAC,MAAM,CAAC;sDAGb;AA+QD;IADC,cAAc,EAAE;gDAOhB;AASD;IADC,cAAc,EAAE;kDAOhB;AAQD;IADC,cAAc,EAAE;sDAMhB;AAQD;IADC,cAAc,EAAE;kDAQhB;AAtbkB,oBAAoB;IADxC,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;GACjB,oBAAoB,CA2dxC;eA3doB,oBAAoB","sourcesContent":["import { html, LitElement } from 'lit';\nimport { property, query, queryAssignedElements } from 'lit/decorators.js';\nimport { Constructor } from '../common/mixins/constructor';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter';\nimport { themes } from '../../theming';\nimport { styles } from './themes/light/dropdown.base.css';\nimport { styles as bootstrap } from './themes/light/dropdown.bootstrap.css';\nimport { styles as fluent } from './themes/light/dropdown.fluent.css';\nimport { styles as indigo } from './themes/light/dropdown.indigo.css';\nimport { blazorSuppress, watch } from '../common/decorators';\nimport {\n IgcPlacement,\n IgcToggleComponent,\n IgcToggleEventMap,\n} from '../toggle/utilities';\nimport IgcDropDownItemComponent from './dropdown-item';\nimport { IgcToggleController } from '../toggle/toggle.controller';\nimport IgcDropDownGroupComponent from './dropdown-group';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { SizableMixin } from '../common/mixins/sizable';\n\nexport enum DropDownActionKey {\n ESCAPE = 'escape',\n ENTER = 'enter',\n}\n\nexport interface IgcDropDownEventMap extends IgcToggleEventMap {\n igcChange: CustomEvent<IgcDropDownItemComponent>;\n}\n\n/**\n * Represents a DropDown component.\n *\n * @element igc-dropdown\n *\n * @fires igcChange - Emitted when the selected item changes.\n * @fires igcOpening - Emitted just before the dropdown is open.\n * @fires igcOpened - Emitted after the dropdown is open.\n * @fires igcClosing - Emitter just before the dropdown is closed.\n * @fires igcClosed - Emitted after closing the dropdown.\n *\n * @slot target - Renders the dropdown's target element.\n * @slot - Renders the dropdown list items.\n *\n * @csspart base - The dropdown list wrapper.\n * @csspart list - The dropdown list.\n */\n@themes({ bootstrap, fluent, indigo })\nexport default class IgcDropDownComponent\n extends SizableMixin(\n EventEmitterMixin<IgcDropDownEventMap, Constructor<LitElement>>(LitElement)\n )\n implements IgcToggleComponent\n{\n public static readonly tagName = 'igc-dropdown';\n\n public static styles = styles;\n\n private toggleController!: IgcToggleController;\n private selectedItem!: IgcDropDownItemComponent | null;\n private activeItem!: IgcDropDownItemComponent;\n private target!: HTMLElement;\n\n private get allItems(): IgcDropDownItemComponent[] {\n const groupItems: IgcDropDownItemComponent[] = this.groups.flatMap(\n (group) => group.items\n );\n return [...this.items, ...groupItems];\n }\n\n @queryAssignedElements({ slot: 'target' })\n private targetNodes!: Array<HTMLElement>;\n\n @query('#igcDDLContent')\n protected content!: HTMLElement;\n\n @query('#igcScrollContainer')\n protected scrollContainer!: HTMLElement;\n\n @queryAssignedElements({ flatten: true, selector: 'igc-dropdown-item' })\n protected items!: Array<IgcDropDownItemComponent>;\n\n @queryAssignedElements({ flatten: true, selector: 'igc-dropdown-group' })\n protected groups!: Array<IgcDropDownGroupComponent>;\n\n /** Whether the dropdown should be kept open on selection. */\n @property({ type: Boolean, attribute: 'keep-open-on-select' })\n public keepOpenOnSelect = false;\n\n /** Sets the open state of the component. */\n @property({ type: Boolean })\n public open = false;\n\n /** The preferred placement of the component around the target element.\n * @type {\"top\" | \"top-start\" | \"top-end\" | \"bottom\" | \"bottom-start\" | \"bottom-end\" | \"right\" | \"right-start\" | \"right-end\" | \"left\" | \"left-start\" | \"left-end\"}\n */\n @property()\n public placement: IgcPlacement = 'bottom-start';\n\n /** Sets the component's positioning strategy. */\n @property({ attribute: 'position-strategy' })\n public positionStrategy: 'absolute' | 'fixed' = 'absolute';\n\n /** Determines the behavior of the component during scrolling the container. */\n @property({ attribute: 'scroll-strategy' })\n public scrollStrategy: 'scroll' | 'block' | 'close' = 'scroll';\n\n /**\n * Whether the component should be flipped to the opposite side of the target once it's about to overflow the visible area.\n * When true, once enough space is detected on its preferred side, it will flip back.\n */\n @property({ type: Boolean })\n public flip = false;\n\n /** The distance from the target element. */\n @property({ type: Number })\n public distance = 0;\n\n /** Whether the component should be kept open on clicking outside of it. */\n @property({ type: Boolean, attribute: 'keep-open-on-outside-click' })\n public keepOpenOnOutsideClick = false;\n\n /** Whether the dropdown's width should be the same as the target's one. */\n @property({ type: Boolean, attribute: 'same-width' })\n public sameWidth = false;\n\n @watch('open')\n protected toggleDirectiveChange() {\n if (!this.target) return;\n this.toggleController.target = this.target;\n\n if (this.open) {\n document.addEventListener('keydown', this.handleKeyDown);\n this.target.addEventListener('focusout', this.handleFocusout);\n this.selectedItem = this.allItems.find((i) => i.selected) ?? null;\n } else {\n document.removeEventListener('keydown', this.handleKeyDown);\n this.target.removeEventListener('focusout', this.handleFocusout);\n }\n\n this.target.setAttribute('aria-expanded', this.open ? 'true' : 'false');\n // this.content.setAttribute(\n // 'aria-activedescendant',\n // (this.open\n // ? this.activeItem\n // ? this.activeItem.value\n // : this.items[0]?.value\n // : '') as string\n // );\n }\n\n @watch('placement')\n @watch('flip')\n @watch('positionStrategy')\n @watch('closeOnOutsideClick')\n @watch('distance')\n @watch('sameWidth')\n protected updateOptions() {\n if (!this.toggleController) return;\n\n this.toggleController.updateToggleDir();\n }\n\n @watch('size')\n protected sizeChange() {\n this.groups.forEach((g) => (g.size = this.size));\n }\n\n constructor() {\n super();\n\n this.toggleController = new IgcToggleController(this, this.target);\n }\n\n public override firstUpdated() {\n if (this.targetNodes.length) {\n this.target = this.targetNodes[0];\n // this.target.setAttribute('aria-owns', 'igcScrollContainer');\n this.target.setAttribute('aria-haspopup', 'listbox');\n }\n }\n\n protected override async getUpdateComplete() {\n const result = await super.getUpdateComplete();\n await this.toggleController.rendered;\n return result;\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (\n this.open &&\n event &&\n (event.composedPath().includes(this.target) ||\n event.composedPath().includes(this.content))\n ) {\n const key = event.key.toLowerCase();\n const navKeys = [\n 'esc',\n 'escape',\n 'enter',\n 'arrowup',\n 'up',\n 'arrowdown',\n 'down',\n ];\n if (navKeys.indexOf(key) === -1) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n switch (key) {\n case 'esc':\n case 'escape':\n this.handleItemActionKey(DropDownActionKey.ESCAPE);\n break;\n case 'enter':\n this.handleItemActionKey(DropDownActionKey.ENTER);\n break;\n case 'arrowup':\n case 'up':\n this.onArrowUpKeyDown();\n break;\n case 'arrowdown':\n case 'down':\n this.onArrowDownKeyDown();\n break;\n default:\n return;\n }\n }\n };\n\n private handleItemActionKey(key: DropDownActionKey) {\n switch (key) {\n case DropDownActionKey.ENTER:\n this.selectItem(this.activeItem);\n this.handleChange(this.activeItem);\n break;\n case DropDownActionKey.ESCAPE:\n break;\n }\n\n if (!this.keepOpenOnSelect) this._hide();\n }\n\n private handleClick(event: MouseEvent) {\n const newSelectedItem = event\n .composedPath()\n .find(\n (e) => e instanceof IgcDropDownItemComponent\n ) as IgcDropDownItemComponent;\n\n if (!newSelectedItem || newSelectedItem.disabled) return;\n\n this.selectItem(newSelectedItem);\n this.handleChange(newSelectedItem);\n if (!this.keepOpenOnSelect) this._hide();\n }\n\n private handleTargetClick = () => {\n if (!this.open) {\n if (!this.handleOpening()) return;\n this.show();\n this.emitEvent('igcOpened');\n } else {\n this._hide();\n }\n };\n\n private handleOpening() {\n const args = { cancelable: true };\n return this.emitEvent('igcOpening', args);\n }\n\n private handleClosing(): boolean {\n const args = { cancelable: true };\n return this.emitEvent('igcClosing', args);\n }\n\n private handleChange(item: IgcDropDownItemComponent) {\n const args = { detail: item };\n this.emitEvent('igcChange', args);\n }\n\n private handleSlotChange() {\n if (!this.target) return;\n this.target.setAttribute('aria-expanded', this.open ? 'true' : 'false');\n // this.target.setAttribute(\n // 'aria-activedescendant',\n // (this.activeItem\n // ? this.activeItem.value\n // : this.items[0]?.value) as string\n // );\n }\n\n private handleFocusout(event: Event) {\n event.preventDefault();\n (event.target as HTMLElement).focus();\n }\n\n private getItem(value: string) {\n let itemIndex = -1;\n let item!: IgcDropDownItemComponent;\n this.allItems.find((i, index) => {\n if (i.value === value) {\n item = i;\n itemIndex = index;\n }\n });\n return { item: item, index: itemIndex };\n }\n\n private activateItem(value: IgcDropDownItemComponent) {\n if (!value) return;\n\n if (this.activeItem && this.activeItem !== value) {\n this.activeItem.active = false;\n }\n\n this.activeItem = value;\n this.activeItem.active = true;\n }\n\n private selectItem(\n item: IgcDropDownItemComponent,\n emit = true\n ): IgcDropDownItemComponent | null {\n const oldItem = this.selectedItem;\n\n if (!item) {\n return null;\n }\n\n if (oldItem && oldItem !== item) {\n oldItem.selected = false;\n }\n\n this.activateItem(item);\n this.selectedItem = item;\n this.selectedItem.selected = true;\n if (emit) this.handleChange(this.selectedItem);\n\n return this.selectedItem;\n }\n\n private navigate(direction: -1 | 1, currentIndex?: number) {\n let index = -1;\n if (this.activeItem) {\n index = currentIndex\n ? currentIndex\n : [...this.allItems].indexOf(this.activeItem) ?? index;\n }\n\n const newIndex = this.getNearestSiblingFocusableItemIndex(index, direction);\n this.navigateItem(newIndex);\n }\n\n private navigateItem(newIndex: number): IgcDropDownItemComponent | null {\n if (!this.allItems) {\n return null;\n }\n\n if (newIndex < 0 || newIndex >= this.allItems.length) {\n return null;\n }\n\n const newItem = this.allItems[newIndex];\n\n this.activateItem(newItem);\n this.scrollToHiddenItem(newItem);\n\n return newItem;\n }\n\n private scrollToHiddenItem(newItem: IgcDropDownItemComponent) {\n const elementRect = newItem.getBoundingClientRect();\n const parentRect = this.content.getBoundingClientRect();\n if (parentRect.top > elementRect.top) {\n this.content.scrollTop -= parentRect.top - elementRect.top;\n }\n\n if (parentRect.bottom < elementRect.bottom) {\n this.content.scrollTop += elementRect.bottom - parentRect.bottom;\n }\n }\n\n private getNearestSiblingFocusableItemIndex(\n startIndex: number,\n direction: -1 | 1\n ): number {\n let index = startIndex;\n const items = this.allItems;\n if (!items) {\n return -1;\n }\n\n while (items[index + direction] && items[index + direction].disabled) {\n index += direction;\n }\n\n index += direction;\n\n return index > -1 && index < items.length ? index : -1;\n }\n\n private navigateNext() {\n this.navigate(1);\n }\n\n private navigatePrev() {\n this.navigate(-1);\n }\n\n private onArrowDownKeyDown() {\n this.navigateNext();\n }\n\n private onArrowUpKeyDown() {\n this.navigatePrev();\n }\n\n private _hide(emit = true) {\n if (emit && !this.handleClosing()) return;\n\n if (!this.open) return;\n\n this.open = false;\n\n if (emit) {\n this.emitEvent('igcClosed');\n }\n }\n\n /** Shows the dropdown. */\n @blazorSuppress()\n public show(target?: HTMLElement) {\n if (this.open && !target) return;\n\n if (target) this.target = target;\n\n this.open = true;\n }\n\n /** Hides the dropdown. */\n public hide(): void {\n this._hide(false);\n }\n\n /** Toggles the open state of the dropdown. */\n @blazorSuppress()\n public toggle(target?: HTMLElement): void {\n if (!this.open) {\n this.show(target);\n } else {\n this.hide();\n }\n }\n\n /** Navigates to the item with the specified value. If it exists, returns the found item, otherwise - null. */\n public navigateTo(value: string): IgcDropDownItemComponent | null;\n /** Navigates to the item at the specified index. If it exists, returns the found item, otherwise - null. */\n public navigateTo(index: number): IgcDropDownItemComponent | null;\n /** Navigates to the specified item. If it exists, returns the found item, otherwise - null. */\n @blazorSuppress()\n public navigateTo(value: string | number): IgcDropDownItemComponent | null {\n const index =\n typeof value === 'string' ? this.getItem(value).index : (value as number);\n\n return this.navigateItem(index);\n }\n\n /** Selects the item with the specified value. If it exists, returns the found item, otherwise - null. */\n public select(value: string): IgcDropDownItemComponent | null;\n /** Selects the item at the specified index. If it exists, returns the found item, otherwise - null. */\n public select(index: number): IgcDropDownItemComponent | null;\n /** Selects the specified item. If it exists, returns the found item, otherwise - null. */\n @blazorSuppress()\n public select(value: string | number): IgcDropDownItemComponent | null {\n const item =\n typeof value === 'string'\n ? this.getItem(value).item\n : this.allItems[value as number];\n\n return this.selectItem(item, false);\n }\n\n /** Clears the current selection of the dropdown. */\n public clearSelection() {\n if (this.selectedItem) {\n this.selectedItem.selected = false;\n }\n this.selectedItem = null;\n }\n\n protected override render() {\n return html`\n <slot\n id=\"igcDDLTarget\"\n name=\"target\"\n @click=${this.handleTargetClick}\n @slotchange=${this.handleSlotChange}\n >\n </slot>\n <div\n id=\"igcDDLContent\"\n part=\"base\"\n style=${styleMap({ position: this.positionStrategy })}\n @click=${this.handleClick}\n ${this.toggleController.toggleDirective}\n >\n <div\n id=\"igcScrollContainer\"\n role=\"listbox\"\n part=\"list\"\n aria-labelledby=\"igcDDLTarget\"\n >\n <slot></slot>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-dropdown': IgcDropDownComponent;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../../src/components/dropdown/dropdown.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CA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AK,CAAC,MAAM,CAAC;sDAGb;AAwQD;IADC,cAAc,EAAE;gDAOhB;AASD;IADC,cAAc,EAAE;kDAOhB;AAQD;IADC,cAAc,EAAE;sDAMhB;AAQD;IADC,cAAc,EAAE;kDAQhB;AAvakB,oBAAoB;IADxC,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;GACjB,oBAAoB,CAscxC;eAtcoB,oBAAoB","sourcesContent":["import { html, LitElement } from 'lit';\nimport { property, query, queryAssignedElements } from 'lit/decorators.js';\nimport { Constructor } from '../common/mixins/constructor';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter';\nimport { themes } from '../../theming';\nimport { styles } from './themes/light/dropdown.base.css';\nimport { styles as bootstrap } from './themes/light/dropdown.bootstrap.css';\nimport { styles as fluent } from './themes/light/dropdown.fluent.css';\nimport { styles as indigo } from './themes/light/dropdown.indigo.css';\nimport { blazorSuppress, watch } from '../common/decorators';\nimport {\n IgcPlacement,\n IgcToggleComponent,\n IgcToggleEventMap,\n} from '../toggle/utilities';\nimport IgcDropdownItemComponent from './dropdown-item';\nimport { IgcToggleController } from '../toggle/toggle.controller';\nimport IgcDropdownGroupComponent from './dropdown-group';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { SizableMixin } from '../common/mixins/sizable';\n\nexport enum DropdownActionKey {\n ESCAPE = 'escape',\n ENTER = 'enter',\n}\n\nexport interface IgcDropdownEventMap extends IgcToggleEventMap {\n igcChange: CustomEvent<IgcDropdownItemComponent>;\n}\n\n/**\n * Represents a DropDown component.\n *\n * @element igc-dropdown\n *\n * @fires igcChange - Emitted when the selected item changes.\n * @fires igcOpening - Emitted just before the dropdown is open.\n * @fires igcOpened - Emitted after the dropdown is open.\n * @fires igcClosing - Emitter just before the dropdown is closed.\n * @fires igcClosed - Emitted after closing the dropdown.\n *\n * @slot target - Renders the dropdown's target element.\n * @slot - Renders the dropdown list items.\n *\n * @csspart base - The dropdown list wrapper.\n * @csspart list - The dropdown list.\n */\n@themes({ bootstrap, fluent, indigo })\nexport default class IgcDropdownComponent\n extends SizableMixin(\n EventEmitterMixin<IgcDropdownEventMap, Constructor<LitElement>>(LitElement)\n )\n implements IgcToggleComponent\n{\n public static readonly tagName = 'igc-dropdown';\n\n public static styles = styles;\n\n private toggleController!: IgcToggleController;\n private selectedItem!: IgcDropdownItemComponent | null;\n private activeItem!: IgcDropdownItemComponent;\n private target!: HTMLElement;\n\n private get allItems(): IgcDropdownItemComponent[] {\n const groupItems: IgcDropdownItemComponent[] = this.groups.flatMap(\n (group) => group.items\n );\n return [...this.items, ...groupItems];\n }\n\n @queryAssignedElements({ slot: 'target' })\n private targetNodes!: Array<HTMLElement>;\n\n @query('[part=\"base\"]')\n protected content!: HTMLElement;\n\n @query('[part=\"list\"]')\n protected scrollContainer!: HTMLElement;\n\n @queryAssignedElements({ flatten: true, selector: 'igc-dropdown-item' })\n protected items!: Array<IgcDropdownItemComponent>;\n\n @queryAssignedElements({ flatten: true, selector: 'igc-dropdown-group' })\n protected groups!: Array<IgcDropdownGroupComponent>;\n\n /** Whether the dropdown should be kept open on selection. */\n @property({ type: Boolean, attribute: 'keep-open-on-select' })\n public keepOpenOnSelect = false;\n\n /** Sets the open state of the component. */\n @property({ type: Boolean })\n public open = false;\n\n /** The preferred placement of the component around the target element.\n * @type {\"top\" | \"top-start\" | \"top-end\" | \"bottom\" | \"bottom-start\" | \"bottom-end\" | \"right\" | \"right-start\" | \"right-end\" | \"left\" | \"left-start\" | \"left-end\"}\n */\n @property()\n public placement: IgcPlacement = 'bottom-start';\n\n /** Sets the component's positioning strategy. */\n @property({ attribute: 'position-strategy' })\n public positionStrategy: 'absolute' | 'fixed' = 'absolute';\n\n /** Determines the behavior of the component during scrolling the container. */\n @property({ attribute: 'scroll-strategy' })\n public scrollStrategy: 'scroll' | 'block' | 'close' = 'scroll';\n\n /**\n * Whether the component should be flipped to the opposite side of the target once it's about to overflow the visible area.\n * When true, once enough space is detected on its preferred side, it will flip back.\n */\n @property({ type: Boolean })\n public flip = false;\n\n /** The distance from the target element. */\n @property({ type: Number })\n public distance = 0;\n\n /** Whether the component should be kept open on clicking outside of it. */\n @property({ type: Boolean, attribute: 'keep-open-on-outside-click' })\n public keepOpenOnOutsideClick = false;\n\n /** Whether the dropdown's width should be the same as the target's one. */\n @property({ type: Boolean, attribute: 'same-width' })\n public sameWidth = false;\n\n @watch('open')\n protected toggleDirectiveChange() {\n if (!this.target) return;\n this.toggleController.target = this.target;\n\n if (this.open) {\n document.addEventListener('keydown', this.handleKeyDown);\n this.target.addEventListener('focusout', this.handleFocusout);\n this.selectedItem = this.allItems.find((i) => i.selected) ?? null;\n } else {\n document.removeEventListener('keydown', this.handleKeyDown);\n this.target.removeEventListener('focusout', this.handleFocusout);\n }\n\n this.target.setAttribute('aria-expanded', this.open ? 'true' : 'false');\n }\n\n @watch('placement')\n @watch('flip')\n @watch('positionStrategy')\n @watch('closeOnOutsideClick')\n @watch('distance')\n @watch('sameWidth')\n protected updateOptions() {\n if (!this.toggleController) return;\n\n this.toggleController.updateToggleDir();\n }\n\n @watch('size')\n protected sizeChange() {\n this.groups.forEach((g) => (g.size = this.size));\n }\n\n constructor() {\n super();\n\n this.toggleController = new IgcToggleController(this, this.target);\n }\n\n public override firstUpdated() {\n if (this.targetNodes.length) {\n this.target = this.targetNodes[0];\n this.target.setAttribute('aria-haspopup', 'listbox');\n }\n }\n\n protected override async getUpdateComplete() {\n const result = await super.getUpdateComplete();\n await this.toggleController.rendered;\n return result;\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (\n this.open &&\n event &&\n (event.composedPath().includes(this.target) ||\n event.composedPath().includes(this.content))\n ) {\n const key = event.key.toLowerCase();\n const navKeys = [\n 'esc',\n 'escape',\n 'enter',\n 'arrowup',\n 'up',\n 'arrowdown',\n 'down',\n ];\n if (navKeys.indexOf(key) === -1) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n switch (key) {\n case 'esc':\n case 'escape':\n this.handleItemActionKey(DropdownActionKey.ESCAPE);\n break;\n case 'enter':\n this.handleItemActionKey(DropdownActionKey.ENTER);\n break;\n case 'arrowup':\n case 'up':\n this.onArrowUpKeyDown();\n break;\n case 'arrowdown':\n case 'down':\n this.onArrowDownKeyDown();\n break;\n default:\n return;\n }\n }\n };\n\n private handleItemActionKey(key: DropdownActionKey) {\n switch (key) {\n case DropdownActionKey.ENTER:\n this.selectItem(this.activeItem);\n this.handleChange(this.activeItem);\n break;\n case DropdownActionKey.ESCAPE:\n break;\n }\n\n if (!this.keepOpenOnSelect) this._hide();\n }\n\n private handleClick(event: MouseEvent) {\n const newSelectedItem = event\n .composedPath()\n .find(\n (e) => e instanceof IgcDropdownItemComponent\n ) as IgcDropdownItemComponent;\n\n if (!newSelectedItem || newSelectedItem.disabled) return;\n\n this.selectItem(newSelectedItem);\n this.handleChange(newSelectedItem);\n if (!this.keepOpenOnSelect) this._hide();\n }\n\n private handleTargetClick = () => {\n if (!this.open) {\n if (!this.handleOpening()) return;\n this.show();\n this.emitEvent('igcOpened');\n } else {\n this._hide();\n }\n };\n\n private handleOpening() {\n const args = { cancelable: true };\n return this.emitEvent('igcOpening', args);\n }\n\n private handleClosing(): boolean {\n const args = { cancelable: true };\n return this.emitEvent('igcClosing', args);\n }\n\n private handleChange(item: IgcDropdownItemComponent) {\n const args = { detail: item };\n this.emitEvent('igcChange', args);\n }\n\n private handleSlotChange() {\n if (!this.target) return;\n this.target.setAttribute('aria-expanded', this.open ? 'true' : 'false');\n }\n\n private handleFocusout(event: Event) {\n event.preventDefault();\n (event.target as HTMLElement).focus();\n }\n\n private getItem(value: string) {\n let itemIndex = -1;\n let item!: IgcDropdownItemComponent;\n this.allItems.find((i, index) => {\n if (i.value === value) {\n item = i;\n itemIndex = index;\n }\n });\n return { item: item, index: itemIndex };\n }\n\n private activateItem(value: IgcDropdownItemComponent) {\n if (!value) return;\n\n if (this.activeItem && this.activeItem !== value) {\n this.activeItem.active = false;\n }\n\n this.activeItem = value;\n this.activeItem.active = true;\n }\n\n private selectItem(\n item: IgcDropdownItemComponent,\n emit = true\n ): IgcDropdownItemComponent | null {\n const oldItem = this.selectedItem;\n\n if (!item) {\n return null;\n }\n\n if (oldItem && oldItem !== item) {\n oldItem.selected = false;\n }\n\n this.activateItem(item);\n this.selectedItem = item;\n this.selectedItem.selected = true;\n if (emit) this.handleChange(this.selectedItem);\n\n return this.selectedItem;\n }\n\n private navigate(direction: -1 | 1, currentIndex?: number) {\n let index = -1;\n if (this.activeItem) {\n index = currentIndex\n ? currentIndex\n : [...this.allItems].indexOf(this.activeItem) ?? index;\n }\n\n const newIndex = this.getNearestSiblingFocusableItemIndex(index, direction);\n this.navigateItem(newIndex);\n }\n\n private navigateItem(newIndex: number): IgcDropdownItemComponent | null {\n if (!this.allItems) {\n return null;\n }\n\n if (newIndex < 0 || newIndex >= this.allItems.length) {\n return null;\n }\n\n const newItem = this.allItems[newIndex];\n\n this.activateItem(newItem);\n this.scrollToHiddenItem(newItem);\n\n return newItem;\n }\n\n private scrollToHiddenItem(newItem: IgcDropdownItemComponent) {\n const elementRect = newItem.getBoundingClientRect();\n const parentRect = this.content.getBoundingClientRect();\n if (parentRect.top > elementRect.top) {\n this.content.scrollTop -= parentRect.top - elementRect.top;\n }\n\n if (parentRect.bottom < elementRect.bottom) {\n this.content.scrollTop += elementRect.bottom - parentRect.bottom;\n }\n }\n\n private getNearestSiblingFocusableItemIndex(\n startIndex: number,\n direction: -1 | 1\n ): number {\n let index = startIndex;\n const items = this.allItems;\n if (!items) {\n return -1;\n }\n\n while (items[index + direction] && items[index + direction].disabled) {\n index += direction;\n }\n\n index += direction;\n\n return index > -1 && index < items.length ? index : -1;\n }\n\n private navigateNext() {\n this.navigate(1);\n }\n\n private navigatePrev() {\n this.navigate(-1);\n }\n\n private onArrowDownKeyDown() {\n this.navigateNext();\n }\n\n private onArrowUpKeyDown() {\n this.navigatePrev();\n }\n\n private _hide(emit = true) {\n if (emit && !this.handleClosing()) return;\n\n if (!this.open) return;\n\n this.open = false;\n\n if (emit) {\n this.emitEvent('igcClosed');\n }\n }\n\n /** Shows the dropdown. */\n @blazorSuppress()\n public show(target?: HTMLElement) {\n if (this.open && !target) return;\n\n if (target) this.target = target;\n\n this.open = true;\n }\n\n /** Hides the dropdown. */\n public hide(): void {\n this._hide(false);\n }\n\n /** Toggles the open state of the dropdown. */\n @blazorSuppress()\n public toggle(target?: HTMLElement): void {\n if (!this.open) {\n this.show(target);\n } else {\n this.hide();\n }\n }\n\n /** Navigates to the item with the specified value. If it exists, returns the found item, otherwise - null. */\n public navigateTo(value: string): IgcDropdownItemComponent | null;\n /** Navigates to the item at the specified index. If it exists, returns the found item, otherwise - null. */\n public navigateTo(index: number): IgcDropdownItemComponent | null;\n /** Navigates to the specified item. If it exists, returns the found item, otherwise - null. */\n @blazorSuppress()\n public navigateTo(value: string | number): IgcDropdownItemComponent | null {\n const index =\n typeof value === 'string' ? this.getItem(value).index : (value as number);\n\n return this.navigateItem(index);\n }\n\n /** Selects the item with the specified value. If it exists, returns the found item, otherwise - null. */\n public select(value: string): IgcDropdownItemComponent | null;\n /** Selects the item at the specified index. If it exists, returns the found item, otherwise - null. */\n public select(index: number): IgcDropdownItemComponent | null;\n /** Selects the specified item. If it exists, returns the found item, otherwise - null. */\n @blazorSuppress()\n public select(value: string | number): IgcDropdownItemComponent | null {\n const item =\n typeof value === 'string'\n ? this.getItem(value).item\n : this.allItems[value as number];\n\n return this.selectItem(item, false);\n }\n\n /** Clears the current selection of the dropdown. */\n public clearSelection() {\n if (this.selectedItem) {\n this.selectedItem.selected = false;\n }\n this.selectedItem = null;\n }\n\n protected override render() {\n return html`\n <slot\n id=\"igcDDLTarget\"\n name=\"target\"\n @click=${this.handleTargetClick}\n @slotchange=${this.handleSlotChange}\n >\n </slot>\n <div\n part=\"base\"\n style=${styleMap({ position: this.positionStrategy })}\n @click=${this.handleClick}\n ${this.toggleController.toggleDirective}\n >\n <div role=\"listbox\" part=\"list\" aria-labelledby=\"igcDDLTarget\">\n <slot></slot>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-dropdown': IgcDropdownComponent;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-base.js","sourceRoot":"","sources":["../../../src/components/input/input-base.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAkC,MAAM,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAEvE,IAAI,MAAM,GAAG,CAAC,CAAC;AAYf,IAAsB,qBAAqB,GAA3C,MAAsB,qBACpB,SAAQ,YAAY,CAClB,iBAAiB,CAA4C,UAAU,CAAC,CACzE;IAoDD;QACE,KAAK,EAAE,CAAC;QA5CA,YAAO,GAAG,SAAS,MAAM,EAAE,EAAE,CAAC;QAqBjC,aAAQ,GAAG,KAAK,CAAC;QAIjB,aAAQ,GAAG,KAAK,CAAC;QAIjB,aAAQ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,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uDACnB;AAIxB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uDACnB;AAIxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0DACC;AAI5B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDACL;AAkBtB;IADC,aAAa,CAAC,gBAAgB,CAAC;kDAG/B;AAID;IADC,aAAa,CAAC,eAAe,CAAC;iDAG9B;AA/EmB,qBAAqB;IAD1C,MAAM,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;GAC1B,qBAAqB,CAiL1C;SAjLqB,qBAAqB","sourcesContent":["import { html, LitElement, nothing, TemplateResult } from 'lit';\nimport { property, query, queryAssignedElements } from 'lit/decorators.js';\nimport { ReactiveTheme, ThemeController, themes } from '../../theming';\nimport { alternateName } from '../common/decorators/alternateName.js';\nimport { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { SizableMixin } from '../common/mixins/sizable.js';\nimport { partNameMap } from '../common/util.js';\nimport { styles } from './themes/light/input.base.css';\nimport { styles as bootstrap } from './themes/light/input.bootstrap.css';\nimport { styles as fluent } from './themes/light/input.fluent.css';\nimport { styles as indigo } from './themes/light/input.indigo.css';\nimport { styles as material } from './themes/light/input.material.css';\n\nlet nextId = 0;\n\nexport interface IgcInputEventMap {\n /* alternateName: inputOcurred */\n igcInput: CustomEvent<string>;\n /* blazorSuppress */\n igcChange: CustomEvent<string>;\n igcFocus: CustomEvent<void>;\n igcBlur: CustomEvent<void>;\n}\n\n@themes({ bootstrap, material, fluent, indigo })\nexport abstract class IgcInputBaseComponent\n extends SizableMixin(\n EventEmitterMixin<IgcInputEventMap, Constructor<LitElement>>(LitElement)\n )\n implements ReactiveTheme\n{\n protected static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n public static styles = styles;\n\n protected inputId = `input-${nextId++}`;\n\n /** The value attribute of the control. */\n public abstract value: string;\n\n @query('input', true)\n protected input!: HTMLInputElement;\n\n @queryAssignedElements({ slot: 'prefix' })\n protected prefixes!: Array<HTMLElement>;\n\n @queryAssignedElements({ slot: 'suffix' })\n protected suffixes!: Array<HTMLElement>;\n\n protected themeController!: ThemeController;\n\n /** The name attribute of the control. */\n @property()\n public name!: string;\n\n @property({ reflect: true, type: Boolean })\n public outlined = false;\n\n /** Makes the control a required field. */\n @property({ reflect: true, type: Boolean })\n public required = false;\n\n /** Makes the control a disabled field. */\n @property({ reflect: true, type: Boolean })\n public disabled = false;\n\n /** Makes the control a readonly field. */\n @property({ reflect: true, type: Boolean })\n public readonly = false;\n\n /** The placeholder attribute of the control. */\n @property({ type: String })\n public placeholder!: string;\n\n /** The label for the control. */\n @property({ type: String })\n public label!: string;\n\n constructor() {\n super();\n this.size = 'medium';\n }\n\n public override connectedCallback() {\n super.connectedCallback();\n this.shadowRoot!.addEventListener('slotchange', () => this.requestUpdate());\n }\n\n public themeAdopted(controller: ThemeController): void {\n this.themeController = controller;\n }\n\n /** Sets focus on the control. */\n @alternateName('focusComponent')\n public override focus(options?: FocusOptions) {\n this.input.focus(options);\n }\n\n /** Removes focus from the control. */\n @alternateName('blurComponent')\n public override blur() {\n this.input.blur();\n }\n\n protected abstract renderInput(): TemplateResult;\n\n protected resolvePartNames(base: string) {\n return {\n [base]: true,\n prefixed: this.prefixes.length > 0,\n suffixed: this.suffixes.length > 0,\n filled: !!this.value,\n };\n }\n\n protected handleFocus() {\n this.emitEvent('igcFocus');\n }\n\n protected handleBlur() {\n this.emitEvent('igcBlur');\n }\n\n protected handleChange() {\n this.value = this.input.value;\n this.emitEvent('igcChange', { detail: this.value });\n }\n\n /** Sets the text selection range of the control */\n public setSelectionRange(\n start: number,\n end: number,\n direction: 'backward' | 'forward' | 'none' = 'none'\n ) {\n this.input.setSelectionRange(start, end, direction);\n }\n\n /** Replaces the selected text in the input. */\n public setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve'\n ) {\n this.input.setRangeText(replacement, start, end, selectMode);\n }\n\n private renderPrefix() {\n return html`<div part=\"prefix\">\n <slot name=\"prefix\"></slot>\n </div>`;\n }\n\n private renderSuffix() {\n return html`<div part=\"suffix\">\n <slot name=\"suffix\"></slot>\n </div>`;\n }\n\n private renderLabel() {\n return this.label\n ? html`<label part=\"label\" for=\"${this.inputId}\"> ${this.label} </label>`\n : nothing;\n }\n\n private renderMaterial() {\n return html`\n <div\n part=\"${partNameMap({\n ...this.resolvePartNames('container'),\n labelled: this.label,\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 <div part=\"helper-text\">\n <slot name=\"helper-text\"></slot>\n </div>\n `;\n }\n\n private renderStandard() {\n return html`${this.renderLabel()}\n <div part=\"${partNameMap(this.resolvePartNames('container'))}\">\n ${this.renderPrefix()} ${this.renderInput()} ${this.renderSuffix()}\n </div>\n <div part=\"helper-text\">\n <slot name=\"helper-text\"></slot>\n </div>`;\n }\n\n protected override render() {\n return html`${this.themeController.theme === 'material'\n ? this.renderMaterial()\n : this.renderStandard()}`;\n }\n}\n"]}
|
|
@@ -52,7 +52,6 @@ export default class IgcInputComponent extends IgcInputBaseComponent {
|
|
|
52
52
|
this.updateComplete.then(() => (this.invalid = !this.input.checkValidity()));
|
|
53
53
|
}
|
|
54
54
|
renderInput() {
|
|
55
|
-
var _a;
|
|
56
55
|
return html `
|
|
57
56
|
<input
|
|
58
57
|
id="${this.inputId}"
|
|
@@ -60,7 +59,7 @@ export default class IgcInputComponent extends IgcInputBaseComponent {
|
|
|
60
59
|
name="${ifDefined(this.name)}"
|
|
61
60
|
type="${ifDefined(this.type)}"
|
|
62
61
|
pattern="${ifDefined(this.pattern)}"
|
|
63
|
-
placeholder="${(
|
|
62
|
+
placeholder="${ifDefined(this.placeholder)}"
|
|
64
63
|
.value="${live(this.value)}"
|
|
65
64
|
?readonly="${this.readonly}"
|
|
66
65
|
?disabled="${this.disabled}"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/input/input.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAuBrD,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,qBAAqB;IAApE;;QAKS,UAAK,GAAG,EAAE,CAAC;QAIF,QAAG,GAAc,MAAM,CAAC;QAKjC,SAAI,GAOC,MAAM,CAAC;QAoBZ,YAAO,GAAG,KAAK,CAAC;IAsHzB,CAAC;IAvFQ,cAAc;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;IACrC,CAAC;IAGe,YAAY,CAC1B,WAAmB,EACnB,KAAa,EACb,GAAW,EACX,aAAsD,UAAU;QAEhE,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;QACxD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;IAChC,CAAC;IAMM,iBAAiB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CAAC,OAAO;oBACnC,IAAI,CAAC,aAAa;mBACnB,IAAI,CAAC,YAAY;kBAClB,IAAI,CAAC,WAAW;kBAChB,IAAI,CAAC,WAAW;iBACjB,IAAI,CAAC,UAAU;;KAE3B,CAAC;IACJ,CAAC;;AA7JsB,yBAAO,GAAG,WAAW,CAAC;AAI7C;IAFC,QAAQ,EAAE;IACV,gBAAgB,CAAC,WAAW,EAAE,QAAQ,CAAC;gDACtB;AAIlB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CACY;AAKxC;IAFC,aAAa,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAQT;AAInB;IADC,QAAQ,EAAE;oDASD;AAIV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDACH;AAIxB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDACpB;AAIvB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDACD;AAI1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDACD;AAI1B;IADC,QAAQ,EAAE;8CACkB;AAI7B;IADC,QAAQ,EAAE;8CACkB;AAI7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CACN;AAIrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACQ;AAIpC;IADC,QAAQ,EAAE;uDACkB;AAsD7B;IADC,KAAK,CAAC,OAAO,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;0DAK9C","sourcesContent":["import { html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { alternateName, blazorTwoWayBind, watch } from '../common/decorators';\nimport { partNameMap } from '../common/util';\nimport { IgcInputBaseComponent } from './input-base';\n\ntype Direction = 'ltr' | 'rtl' | 'auto';\n\n/**\n * @element igc-input\n *\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 *\n * @fires igcInput - Emitted when the control input receives user input.\n * @fires igcChange - Emitted when the control's checked state changes.\n * @fires igcFocus - Emitted when the control gains focus.\n * @fires igcBlur - Emitted when the control loses focus.\n *\n * @csspart container - The main wrapper that holds all main input elements.\n * @csspart input - The native input element.\n * @csspart label - The native label element.\n * @csspart prefix - The prefix wrapper.\n * @csspart suffix - The suffix wrapper.\n * @csspart helper-text - The helper text wrapper.\n */\nexport default class IgcInputComponent extends IgcInputBaseComponent {\n public static readonly tagName = 'igc-input';\n\n @property()\n @blazorTwoWayBind('igcChange', 'detail')\n public value = '';\n\n /** The direction attribute of the control. */\n @property({ reflect: true })\n public override dir: Direction = 'auto';\n\n /** The type attribute of the control. */\n @alternateName('displayType')\n @property({ reflect: true })\n public type:\n | 'email'\n | 'number'\n | 'password'\n | 'search'\n | 'tel'\n | 'text'\n | 'url' = 'text';\n\n /** The input mode attribute of the control. */\n @property()\n public inputmode!:\n | 'none'\n | 'txt'\n | 'decimal'\n | 'numeric'\n | 'tel'\n | 'search'\n | 'email'\n | 'url';\n\n /** The pattern attribute of the control. */\n @property({ type: String })\n public pattern!: string;\n\n /** Controls the validity of the control. */\n @property({ reflect: true, type: Boolean })\n public invalid = false;\n\n /** The minlength attribute of the control. */\n @property({ type: Number })\n public minlength!: number;\n\n /** The maxlength attribute of the control. */\n @property({ type: Number })\n public maxlength!: number;\n\n /** The min attribute of the control. */\n @property()\n public min!: number | string;\n\n /** The max attribute of the control. */\n @property()\n public max!: number | string;\n\n /** The step attribute of the control. */\n @property({ type: Number })\n public step!: number;\n\n /** The autofocus attribute of the control. */\n @property({ type: Boolean })\n public override autofocus!: boolean;\n\n /** The autocomplete attribute of the control. */\n @property()\n public autocomplete!: string;\n\n /** Checks for validity of the control and shows the browser message if it's invalid. */\n public reportValidity() {\n return this.input.reportValidity();\n }\n\n /** Replaces the selected text in the input. */\n public override setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve'\n ) {\n super.setRangeText(replacement, start, end, selectMode);\n this.value = this.input.value;\n }\n\n /**\n * Sets a custom validation message for the control.\n * As long as `message` is not empty, the control is considered invalid.\n */\n public setCustomValidity(message: string) {\n this.input.setCustomValidity(message);\n this.invalid = !this.input.checkValidity();\n }\n\n /** Selects all text within the input. */\n public select() {\n return this.input.select();\n }\n\n /** Increments the numeric value of the input by one or more steps. */\n public stepUp(n?: number) {\n this.input.stepUp(n);\n this.handleChange();\n }\n\n /** Decrements the numeric value of the input by one or more steps. */\n public stepDown(n?: number) {\n this.input.stepDown(n);\n this.handleChange();\n }\n\n private handleInvalid() {\n this.invalid = true;\n }\n\n private handleInput() {\n this.value = this.input.value;\n this.emitEvent('igcInput', { detail: this.value });\n }\n\n @watch('value', { waitUntilFirstUpdate: true })\n protected handleValueChange() {\n this.updateComplete.then(\n () => (this.invalid = !this.input.checkValidity())\n );\n }\n\n protected renderInput() {\n return html`\n <input\n id=\"${this.inputId}\"\n part=\"${partNameMap(this.resolvePartNames('input'))}\"\n name=\"${ifDefined(this.name)}\"\n type=\"${ifDefined(this.type)}\"\n pattern=\"${ifDefined(this.pattern)}\"\n placeholder=\"${ifDefined(this.placeholder)}\"\n .value=\"${live(this.value)}\"\n ?readonly=\"${this.readonly}\"\n ?disabled=\"${this.disabled}\"\n ?required=\"${this.required}\"\n ?autofocus=\"${this.autofocus}\"\n autocomplete=\"${ifDefined(this.autocomplete as any)}\"\n inputmode=\"${ifDefined(this.inputmode)}\"\n min=\"${ifDefined(this.min)}\"\n max=\"${ifDefined(this.max)}\"\n minlength=\"${ifDefined(this.minlength)}\"\n maxlength=\"${ifDefined(this.maxlength)}\"\n step=\"${ifDefined(this.step)}\"\n aria-invalid=\"${this.invalid ? 'true' : 'false'}\"\n @invalid=\"${this.handleInvalid}\"\n @change=\"${this.handleChange}\"\n @input=\"${this.handleInput}\"\n @focus=\"${this.handleFocus}\"\n @blur=\"${this.handleBlur}\"\n />\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-input': IgcInputComponent;\n }\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `:host([size=large]) input:not(:-moz-placeholder-shown)+[part=notch] [part=label]{transform:translateY(-26px);font-size:.75rem}:host([size=large]) input:not(:-ms-input-placeholder)+[part=notch] [part=label]{-ms-transform:translateY(-26px);transform:translateY(-26px);font-size:.75rem}:host([placeholder][size=large]) [part=notch] [part=label],:host([size=large]:focus-within) [part=label],:host([size=large]) input:not(:placeholder-shown)+[part=notch] [part=label]{-webkit-transform:translateY(-26px);-ms-transform:translateY(-26px);transform:translateY(-26px);font-size:.75rem}:host([size=medium]) input:not(:-moz-placeholder-shown)+[part=notch] [part=label]{transform:translateY(-22px);font-size:.75rem}:host([size=medium]) input:not(:-ms-input-placeholder)+[part=notch] [part=label]{-ms-transform:translateY(-22px);transform:translateY(-22px);font-size:.75rem}:host([placeholder][size=medium]) [part=notch] [part=label],:host([size=medium]:focus-within) [part=label],:host([size=medium]) input:not(:placeholder-shown)+[part=notch] [part=label]{-webkit-transform:translateY(-22px);-ms-transform:translateY(-22px);transform:translateY(-22px);font-size:.75rem}:host([size=small]) input:not(:-moz-placeholder-shown)+[part=notch] [part=label]{transform:translateY(-18px);font-size:.75rem}:host([size=small]) input:not(:-ms-input-placeholder)+[part=notch] [part=label]{-ms-transform:translateY(-18px);transform:translateY(-18px);font-size:.75rem}:host([placeholder][size=small]) [part=notch] [part=label],:host([size=small]:focus-within) [part=label],:host([size=small]) input:not(:placeholder-shown)+[part=notch] [part=label]{-webkit-transform:translateY(-18px);-ms-transform:translateY(-18px);transform:translateY(-18px);font-size:.75rem}:host([disabled]) input:not(:-moz-placeholder-shown)+[part=notch], :host([invalid]) input:not(:-moz-placeholder-shown)+[part=notch], :host([invalid]:focus-within) input:not(:-moz-placeholder-shown)+[part=notch], :host input:not(:-moz-placeholder-shown)+[part=notch]{border-top:.0625rem solid rgba(0,0,0,0)}:host([disabled]) input:not(:-ms-input-placeholder)+[part=notch], :host([invalid]) input:not(:-ms-input-placeholder)+[part=notch], :host([invalid]:focus-within) input:not(:-ms-input-placeholder)+[part=notch], :host input:not(:-ms-input-placeholder)+[part=notch]{border-top:.0625rem solid rgba(0,0,0,0)}:host([disabled]) input:not(:placeholder-shown)+[part=notch],:host([invalid]) input:not(:placeholder-shown)+[part=notch],:host([invalid]:focus-within) input:not(:placeholder-shown)+[part=notch],:host([placeholder][size=small]) [part=notch],:host([placeholder][size=medium]) [part=notch],:host([placeholder][size=large]) [part=notch],:host input:not(:placeholder-shown)+[part=notch]{border-top:.0625rem solid rgba(0,0,0,0)}[part~=input]{background:rgba(0,0,0,0);padding:0 .25rem;font-size:1rem;grid-area:1/2/span 1/span 2}[part=label]{color:hsla(var(--igc-gray-600), var(--igc-gray-a));-webkit-transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);-o-transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);line-height:1;will-change:font-size,color,transform}:host(:focus-within) [part=start]{border-color:hsla(var(--igc-primary-500), var(--igc-primary-a));border-inline-start-width:.125rem;border-block-start-width:.125rem;border-block-end-width:.125rem}:host(:focus-within) [part=notch]{border-width:.125rem;border-color:hsla(var(--igc-primary-500), var(--igc-primary-a));border-top:.0625rem solid rgba(0,0,0,0)}:host(:focus-within) [part=filler]{border-width:.125rem;border-color:hsla(var(--igc-primary-500), var(--igc-primary-a))}:host(:focus-within) [part=end]{border-color:hsla(var(--igc-primary-500), var(--igc-primary-a));border-inline-end-width:.125rem;border-block-start-width:.125rem;border-block-end-width:.125rem}:host(:focus-within) [part=prefix]{-webkit-padding-start:.25rem;padding-inline-start:.25rem}:host(:focus-within) [part=suffix]{-webkit-padding-end:.25rem;padding-inline-end:.25rem}:host(:focus-within) [part=label]{color:hsla(var(--igc-primary-500), var(--igc-primary-a))}[part^=container]{grid-template-columns:auto auto 1fr auto}[part=start]{width:auto;min-width:.75rem;-ms-flex-negative:0;flex-shrink:0;grid-area:1/1;border-style:solid;border-color:hsla(var(--igc-gray-600), var(--igc-gray-a));border-inline-start-width:.0625rem;border-inline-end-width:0;border-block-start-width:.0625rem;border-block-end-width:.0625rem;border-start-start-radius:.25rem;border-end-start-radius:.25rem}[part=start]>[part=prefix]{-webkit-padding-start:.3125rem;padding-inline-start:.3125rem;-webkit-padding-end:.25rem;padding-inline-end:.25rem}[part=notch]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:auto;height:100%;grid-area:1/2;padding:0 .25rem;border-width:.0625rem;border-style:solid;border-color:hsla(var(--igc-gray-600), var(--igc-gray-a));border-left:none;border-right:none;overflow:visible}[part=notch]:empty{display:none}[part=filler]{grid-area:1/3;border-width:.0625rem;border-style:solid;border-color:hsla(var(--igc-gray-600), var(--igc-gray-a));border-left:none;border-right:none}[part=end]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;height:100%;grid-area:1/4;min-width:.75rem;border-style:solid;border-color:hsla(var(--igc-gray-600), var(--igc-gray-a));border-inline-start-width:0;border-inline-end-width:.0625rem;border-block-start-width:.0625rem;border-block-end-width:.0625rem;border-start-end-radius:.25rem;border-end-end-radius:.25rem}[part=end]>[part=suffix]{-webkit-padding-start:.25rem;padding-inline-start:.25rem;-webkit-padding-end:.3125rem;padding-inline-end:.3125rem}[part=helper-text]{font-family:var(--igc-caption-font-family);font-weight:var(--igc-caption-font-weight);font-size:var(--igc-caption-font-size);font-style:var(--igc-caption-font-style);letter-spacing:var(--igc-caption-letter-spacing);text-transform:var(--igc-caption-text-transform);line-height:var(--igc-caption-line-height);margin-top:var(--igc-caption-margin-top);margin-bottom:var(--igc-caption-margin-bottom);padding:0 .5rem;margin-top:.25rem;color:hsla(var(--igc-gray-600), var(--igc-gray-a))}:host([invalid]) [part=start],:host([invalid]) [part=notch],:host([invalid]) [part=filler],:host([invalid]) [part=end],:host([invalid]:focus-within) [part=start],:host([invalid]:focus-within) [part=notch],:host([invalid]:focus-within) [part=filler],:host([invalid]:focus-within) [part=end]{border-color:hsla(var(--igc-error-500), var(--igc-error-a))}:host([invalid]) [part=label],:host([invalid]) [part=helper-text],:host([invalid]:focus-within) [part=label],:host([invalid]:focus-within) [part=helper-text]{color:hsla(var(--igc-error-500), var(--igc-error-a))}:host([invalid]:focus-within) [part=notch]{border-top:.0625rem solid rgba(0,0,0,0)}:host([disabled]){pointer-events:none}:host([disabled]) [part~=input],:host([disabled]) [part=label],:host([disabled]) [part=prefix],:host([disabled]) [part=suffix],:host([disabled]) [part=helper-text]{color:hsla(var(--igc-gray-400), var(--igc-gray-a))}:host([disabled]) [part=start],:host([disabled]) [part=filler],:host([disabled]) [part=notch],:host([disabled]) [part=end]{color:hsla(var(--igc-gray-400), var(--igc-gray-a));border-color:hsla(var(--igc-gray-400), var(--igc-gray-a))}:host([disabled]) input::-webkit-input-placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host([disabled]) input::-moz-placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host([disabled]) input:-ms-input-placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host([disabled]) input::-ms-input-placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host([disabled]) input::placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host(:not([outlined])) [part=start],:host(:not([outlined])) [part=end]{border-color:rgba(0,0,0,0);border-top-width:.0625rem}:host(:not([outlined])) [part=notch],:host(:not([outlined])) [part=filler]{border-top:1px solid rgba(0,0,0,0);border-bottom:rgba(0,0,0,0);border-bottom-width:.0625rem}:host(:not([outlined])) [part=label]{inset-inline-start:.125rem}:host(:not([outlined])) [part~=container]{background:hsla(var(--igc-gray-100), var(--igc-gray-a));border-bottom:1px solid hsla(var(--igc-gray-600), var(--igc-gray-a));border-start-end-radius:.25rem;border-start-start-radius:.25rem;-webkit-transition:border-bottom-width 150ms cubic-bezier(0.4, 0, 0.2, 1);-o-transition:border-bottom-width 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:border-bottom-width 150ms cubic-bezier(0.4, 0, 0.2, 1)}:host(:not([outlined])) [part~=container]::after{position:absolute;content:"";width:100%;height:.125rem;left:0;right:0;bottom:-1px;background:hsla(var(--igc-primary-500), var(--igc-primary-a));-webkit-transform:scaleX(0);-ms-transform:scaleX(0);transform:scaleX(0);-webkit-transition:opacity 180ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 180ms cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 180ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 180ms cubic-bezier(0.4, 0, 0.2, 1);-o-transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 180ms cubic-bezier(0.4, 0, 0.2, 1)}:host(:not([outlined])) [part~=labelled] [part~=input]{padding-top:1.25rem;padding-bottom:.375rem}:host(:not([outlined])) input:not(:-moz-placeholder-shown)+[part=notch] [part=label]{transform:translateY(-106%)}:host(:not([outlined])) input:not(:-ms-input-placeholder)+[part=notch] [part=label]{-ms-transform:translateY(-106%);transform:translateY(-106%)}:host(:not([outlined])) input:not(:placeholder-shown)+[part=notch] [part=label]{-webkit-transform:translateY(-106%);-ms-transform:translateY(-106%);transform:translateY(-106%)}:host(:not([outlined]):hover) [part~=container]{background:hsla(var(--igc-gray-200), var(--igc-gray-a));border-bottom:1px solid hsla(var(--igc-gray-800), var(--igc-gray-a))}:host(:not([outlined]):focus-within) [part~=container]{background:var(--focus-background, hsla(var(--igc-gray-300), var(--igc-gray-a)));border-bottom:1px solid hsla(var(--igc-primary-500), var(--igc-primary-a))}:host(:not([outlined]):focus-within) [part~=container]::after{-webkit-transform:scaleX(1);-ms-transform:scaleX(1);transform:scaleX(1);opacity:1}:host(:not([outlined]):focus-within) [part=notch] [part=label],:host(:not([outlined])[placeholder]) [part=notch] [part=label]{-webkit-transform:translateY(-106%);-ms-transform:translateY(-106%);transform:translateY(-106%)}:host(:not([outlined])[invalid]) [part=start],:host(:not([outlined])[invalid]) [part=notch],:host(:not([outlined])[invalid]) [part=filler],:host(:not([outlined])[invalid]) [part=end],:host(:not([outlined])[invalid]:focus-within) [part=start],:host(:not([outlined])[invalid]:focus-within) [part=notch],:host(:not([outlined])[invalid]:focus-within) [part=filler],:host(:not([outlined])[invalid]:focus-within) [part=end]{border-color:rgba(0,0,0,0)}:host(:not([outlined])[invalid]) [part~=container],:host(:not([outlined])[invalid]:focus-within) [part~=container]{border-color:hsla(var(--igc-error-500), var(--igc-error-a))}:host(:not([outlined])[invalid]) [part~=container]::after,:host(:not([outlined])[invalid]:focus-within) [part~=container]::after{background:hsla(var(--igc-error-500), var(--igc-error-a))}:host(:not([outlined])[disabled]) [part~=input],:host(:not([outlined])[disabled]) [part=label],:host(:not([outlined])[disabled]) [part=prefix],:host(:not([outlined])[disabled]) [part=suffix],:host(:not([outlined])[disabled]) [part=helper-text]{color:hsla(var(--igc-gray-400), var(--igc-gray-a))}:host(:not([outlined])[disabled]) [part~=container]{border-color:hsla(var(--igc-gray-400), var(--igc-gray-a))}`;
|
|
2
|
+
export const styles = css `:host([size=large]) input:-moz-placeholder-shown+[part=notch] [part=label]{transform:translateY(-26px);font-size:.75rem}:host([size=large]) input:-ms-input-placeholder+[part=notch] [part=label]{-ms-transform:translateY(-26px);transform:translateY(-26px);font-size:.75rem}:host([size=large]:focus-within) [part=label],:host([size=large]) input:placeholder-shown+[part=notch] [part=label],:host([size=large]) [part~=filled]+[part=notch] [part=label]{-webkit-transform:translateY(-26px);-ms-transform:translateY(-26px);transform:translateY(-26px);font-size:.75rem}:host([size=medium]) input:-moz-placeholder-shown+[part=notch] [part=label]{transform:translateY(-22px);font-size:.75rem}:host([size=medium]) input:-ms-input-placeholder+[part=notch] [part=label]{-ms-transform:translateY(-22px);transform:translateY(-22px);font-size:.75rem}:host([size=medium]:focus-within) [part=label],:host([size=medium]) input:placeholder-shown+[part=notch] [part=label],:host([size=medium]) [part~=filled]+[part=notch] [part=label]{-webkit-transform:translateY(-22px);-ms-transform:translateY(-22px);transform:translateY(-22px);font-size:.75rem}:host([size=small]) input:-moz-placeholder-shown+[part=notch] [part=label]{transform:translateY(-18px);font-size:.75rem}:host([size=small]) input:-ms-input-placeholder+[part=notch] [part=label]{-ms-transform:translateY(-18px);transform:translateY(-18px);font-size:.75rem}:host([size=small]:focus-within) [part=label],:host([size=small]) input:placeholder-shown+[part=notch] [part=label],:host([size=small]) [part~=filled]+[part=notch] [part=label]{-webkit-transform:translateY(-18px);-ms-transform:translateY(-18px);transform:translateY(-18px);font-size:.75rem}:host input:-moz-placeholder-shown+[part=notch]{border-top:.0625rem solid rgba(0,0,0,0)}:host input:-ms-input-placeholder+[part=notch]{border-top:.0625rem solid rgba(0,0,0,0)}:host([disabled]) [part~=filled]+[part=notch],:host([invalid]) [part~=filled]+[part=notch],:host([invalid]:focus-within) [part~=filled]+[part=notch],:host input:placeholder-shown+[part=notch],:host [part~=filled]+[part=notch]{border-top:.0625rem solid rgba(0,0,0,0)}[part~=input]{background:rgba(0,0,0,0);padding:0 .25rem;font-size:1rem;grid-area:1/2/span 1/span 2}[part=label]{color:hsla(var(--igc-gray-600), var(--igc-gray-a));-webkit-transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);-o-transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);line-height:1;will-change:font-size,color,transform}:host(:focus-within) [part=start]{border-color:hsla(var(--igc-primary-500), var(--igc-primary-a));border-inline-start-width:.125rem;border-block-start-width:.125rem;border-block-end-width:.125rem}:host(:focus-within) [part=notch]{border-width:.125rem;border-color:hsla(var(--igc-primary-500), var(--igc-primary-a));border-top:.0625rem solid rgba(0,0,0,0)}:host(:focus-within) [part=filler]{border-width:.125rem;border-color:hsla(var(--igc-primary-500), var(--igc-primary-a))}:host(:focus-within) [part=end]{border-color:hsla(var(--igc-primary-500), var(--igc-primary-a));border-inline-end-width:.125rem;border-block-start-width:.125rem;border-block-end-width:.125rem}:host(:focus-within) [part=prefix]{-webkit-padding-start:.25rem;padding-inline-start:.25rem}:host(:focus-within) [part=suffix]{-webkit-padding-end:.25rem;padding-inline-end:.25rem}:host(:focus-within) [part=label]{color:hsla(var(--igc-primary-500), var(--igc-primary-a))}[part^=container]{grid-template-columns:auto auto 1fr auto}[part=start]{width:auto;min-width:.75rem;-ms-flex-negative:0;flex-shrink:0;grid-area:1/1;border-style:solid;border-color:hsla(var(--igc-gray-600), var(--igc-gray-a));border-inline-start-width:.0625rem;border-inline-end-width:0;border-block-start-width:.0625rem;border-block-end-width:.0625rem;border-start-start-radius:.25rem;border-end-start-radius:.25rem}[part=start]>[part=prefix]{-webkit-padding-start:.3125rem;padding-inline-start:.3125rem;-webkit-padding-end:.25rem;padding-inline-end:.25rem}[part=notch]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:auto;height:100%;grid-area:1/2;padding:0 .25rem;border-width:.0625rem;border-style:solid;border-color:hsla(var(--igc-gray-600), var(--igc-gray-a));border-left:none;border-right:none;overflow:visible}[part=notch]:empty{display:none}[part=filler]{grid-area:1/3;border-width:.0625rem;border-style:solid;border-color:hsla(var(--igc-gray-600), var(--igc-gray-a));border-left:none;border-right:none}[part=end]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;height:100%;grid-area:1/4;min-width:.75rem;border-style:solid;border-color:hsla(var(--igc-gray-600), var(--igc-gray-a));border-inline-start-width:0;border-inline-end-width:.0625rem;border-block-start-width:.0625rem;border-block-end-width:.0625rem;border-start-end-radius:.25rem;border-end-end-radius:.25rem}[part=end]>[part=suffix]{-webkit-padding-start:.25rem;padding-inline-start:.25rem;-webkit-padding-end:.3125rem;padding-inline-end:.3125rem}[part=helper-text]{font-family:var(--igc-caption-font-family);font-weight:var(--igc-caption-font-weight);font-size:var(--igc-caption-font-size);font-style:var(--igc-caption-font-style);letter-spacing:var(--igc-caption-letter-spacing);text-transform:var(--igc-caption-text-transform);line-height:var(--igc-caption-line-height);margin-top:var(--igc-caption-margin-top);margin-bottom:var(--igc-caption-margin-bottom);padding:0 .5rem;margin-top:.25rem;color:hsla(var(--igc-gray-600), var(--igc-gray-a))}:host([invalid]) [part=start],:host([invalid]) [part=notch],:host([invalid]) [part=filler],:host([invalid]) [part=end],:host([invalid]:focus-within) [part=start],:host([invalid]:focus-within) [part=notch],:host([invalid]:focus-within) [part=filler],:host([invalid]:focus-within) [part=end]{border-color:hsla(var(--igc-error-500), var(--igc-error-a))}:host([invalid]) [part=label],:host([invalid]) [part=helper-text],:host([invalid]:focus-within) [part=label],:host([invalid]:focus-within) [part=helper-text]{color:hsla(var(--igc-error-500), var(--igc-error-a))}:host([invalid]:focus-within) [part=notch]{border-top:.0625rem solid rgba(0,0,0,0)}:host([disabled]){pointer-events:none}:host([disabled]) [part~=input],:host([disabled]) [part=label],:host([disabled]) [part=prefix],:host([disabled]) [part=suffix],:host([disabled]) [part=helper-text]{color:hsla(var(--igc-gray-400), var(--igc-gray-a))}:host([disabled]) [part=start],:host([disabled]) [part=filler],:host([disabled]) [part=notch],:host([disabled]) [part=end]{color:hsla(var(--igc-gray-400), var(--igc-gray-a));border-color:hsla(var(--igc-gray-400), var(--igc-gray-a))}:host([disabled]) input::-webkit-input-placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host([disabled]) input::-moz-placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host([disabled]) input:-ms-input-placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host([disabled]) input::-ms-input-placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host([disabled]) input::placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host(:not([outlined])) [part=start],:host(:not([outlined])) [part=end]{border-color:rgba(0,0,0,0);border-top-width:.0625rem}:host(:not([outlined])) [part=notch],:host(:not([outlined])) [part=filler]{border-top:1px solid rgba(0,0,0,0);border-bottom:rgba(0,0,0,0);border-bottom-width:.0625rem}:host(:not([outlined])) [part=label]{inset-inline-start:.125rem}:host(:not([outlined])) [part~=container]{background:hsla(var(--igc-gray-100), var(--igc-gray-a));border-bottom:1px solid hsla(var(--igc-gray-600), var(--igc-gray-a));border-start-end-radius:.25rem;border-start-start-radius:.25rem;-webkit-transition:border-bottom-width 150ms cubic-bezier(0.4, 0, 0.2, 1);-o-transition:border-bottom-width 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:border-bottom-width 150ms cubic-bezier(0.4, 0, 0.2, 1)}:host(:not([outlined])) [part~=container]::after{position:absolute;content:"";width:100%;height:.125rem;left:0;right:0;bottom:-1px;background:hsla(var(--igc-primary-500), var(--igc-primary-a));-webkit-transform:scaleX(0);-ms-transform:scaleX(0);transform:scaleX(0);-webkit-transition:opacity 180ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 180ms cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 180ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 180ms cubic-bezier(0.4, 0, 0.2, 1);-o-transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 180ms cubic-bezier(0.4, 0, 0.2, 1)}:host(:not([outlined])) [part~=labelled] [part~=input]{padding-top:1.25rem;padding-bottom:.375rem}:host(:not([outlined])) input:-moz-placeholder-shown+[part=notch] [part=label]{transform:translateY(-106%)}:host(:not([outlined])) input:-ms-input-placeholder+[part=notch] [part=label]{-ms-transform:translateY(-106%);transform:translateY(-106%)}:host(:not([outlined])) input:placeholder-shown+[part=notch] [part=label],:host(:not([outlined])) [part~=filled]+[part=notch] [part=label]{-webkit-transform:translateY(-106%);-ms-transform:translateY(-106%);transform:translateY(-106%)}:host(:not([outlined]):hover) [part~=container]{background:hsla(var(--igc-gray-200), var(--igc-gray-a));border-bottom:1px solid hsla(var(--igc-gray-800), var(--igc-gray-a))}:host(:not([outlined]):focus-within) [part~=container]{background:var(--focus-background, hsla(var(--igc-gray-300), var(--igc-gray-a)));border-bottom:1px solid hsla(var(--igc-primary-500), var(--igc-primary-a))}:host(:not([outlined]):focus-within) [part~=container]::after{-webkit-transform:scaleX(1);-ms-transform:scaleX(1);transform:scaleX(1);opacity:1}:host(:not([outlined]):focus-within) [part=notch] [part=label]{-webkit-transform:translateY(-106%);-ms-transform:translateY(-106%);transform:translateY(-106%)}:host(:not([outlined])[invalid]) [part=start],:host(:not([outlined])[invalid]) [part=notch],:host(:not([outlined])[invalid]) [part=filler],:host(:not([outlined])[invalid]) [part=end],:host(:not([outlined])[invalid]:focus-within) [part=start],:host(:not([outlined])[invalid]:focus-within) [part=notch],:host(:not([outlined])[invalid]:focus-within) [part=filler],:host(:not([outlined])[invalid]:focus-within) [part=end]{border-color:rgba(0,0,0,0)}:host(:not([outlined])[invalid]) [part~=container],:host(:not([outlined])[invalid]:focus-within) [part~=container]{border-color:hsla(var(--igc-error-500), var(--igc-error-a))}:host(:not([outlined])[invalid]) [part~=container]::after,:host(:not([outlined])[invalid]:focus-within) [part~=container]::after{background:hsla(var(--igc-error-500), var(--igc-error-a))}:host(:not([outlined])[disabled]) [part~=input],:host(:not([outlined])[disabled]) [part=label],:host(:not([outlined])[disabled]) [part=prefix],:host(:not([outlined])[disabled]) [part=suffix],:host(:not([outlined])[disabled]) [part=helper-text]{color:hsla(var(--igc-gray-400), var(--igc-gray-a))}:host(:not([outlined])[disabled]) [part~=container]{border-color:hsla(var(--igc-gray-400), var(--igc-gray-a))}`;
|
|
3
3
|
//# sourceMappingURL=input.material.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.material.css.js","sourceRoot":"","sources":["../../../../../src/components/input/themes/light/input.material.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,m3YAAm3Y,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host([size=large]) input:not(:-moz-placeholder-shown)+[part=notch] [part=label]{transform:translateY(-26px);font-size:.75rem}:host([size=large]) input:not(:-ms-input-placeholder)+[part=notch] [part=label]{-ms-transform:translateY(-26px);transform:translateY(-26px);font-size:.75rem}:host([placeholder][size=large]) [part=notch] [part=label],:host([size=large]:focus-within) [part=label],:host([size=large]) input:not(:placeholder-shown)+[part=notch] [part=label]{-webkit-transform:translateY(-26px);-ms-transform:translateY(-26px);transform:translateY(-26px);font-size:.75rem}:host([size=medium]) input:not(:-moz-placeholder-shown)+[part=notch] [part=label]{transform:translateY(-22px);font-size:.75rem}:host([size=medium]) input:not(:-ms-input-placeholder)+[part=notch] [part=label]{-ms-transform:translateY(-22px);transform:translateY(-22px);font-size:.75rem}:host([placeholder][size=medium]) [part=notch] [part=label],:host([size=medium]:focus-within) [part=label],:host([size=medium]) input:not(:placeholder-shown)+[part=notch] [part=label]{-webkit-transform:translateY(-22px);-ms-transform:translateY(-22px);transform:translateY(-22px);font-size:.75rem}:host([size=small]) input:not(:-moz-placeholder-shown)+[part=notch] [part=label]{transform:translateY(-18px);font-size:.75rem}:host([size=small]) input:not(:-ms-input-placeholder)+[part=notch] [part=label]{-ms-transform:translateY(-18px);transform:translateY(-18px);font-size:.75rem}:host([placeholder][size=small]) [part=notch] [part=label],:host([size=small]:focus-within) [part=label],:host([size=small]) input:not(:placeholder-shown)+[part=notch] [part=label]{-webkit-transform:translateY(-18px);-ms-transform:translateY(-18px);transform:translateY(-18px);font-size:.75rem}:host([disabled]) input:not(:-moz-placeholder-shown)+[part=notch], :host([invalid]) input:not(:-moz-placeholder-shown)+[part=notch], :host([invalid]:focus-within) input:not(:-moz-placeholder-shown)+[part=notch], :host input:not(:-moz-placeholder-shown)+[part=notch]{border-top:.0625rem solid rgba(0,0,0,0)}:host([disabled]) input:not(:-ms-input-placeholder)+[part=notch], :host([invalid]) input:not(:-ms-input-placeholder)+[part=notch], :host([invalid]:focus-within) input:not(:-ms-input-placeholder)+[part=notch], :host input:not(:-ms-input-placeholder)+[part=notch]{border-top:.0625rem solid rgba(0,0,0,0)}:host([disabled]) input:not(:placeholder-shown)+[part=notch],:host([invalid]) input:not(:placeholder-shown)+[part=notch],:host([invalid]:focus-within) input:not(:placeholder-shown)+[part=notch],:host([placeholder][size=small]) [part=notch],:host([placeholder][size=medium]) [part=notch],:host([placeholder][size=large]) [part=notch],:host input:not(:placeholder-shown)+[part=notch]{border-top:.0625rem solid rgba(0,0,0,0)}[part~=input]{background:rgba(0,0,0,0);padding:0 .25rem;font-size:1rem;grid-area:1/2/span 1/span 2}[part=label]{color:hsla(var(--igc-gray-600), var(--igc-gray-a));-webkit-transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);-o-transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);line-height:1;will-change:font-size,color,transform}:host(:focus-within) [part=start]{border-color:hsla(var(--igc-primary-500), var(--igc-primary-a));border-inline-start-width:.125rem;border-block-start-width:.125rem;border-block-end-width:.125rem}:host(:focus-within) [part=notch]{border-width:.125rem;border-color:hsla(var(--igc-primary-500), var(--igc-primary-a));border-top:.0625rem solid rgba(0,0,0,0)}:host(:focus-within) [part=filler]{border-width:.125rem;border-color:hsla(var(--igc-primary-500), var(--igc-primary-a))}:host(:focus-within) [part=end]{border-color:hsla(var(--igc-primary-500), var(--igc-primary-a));border-inline-end-width:.125rem;border-block-start-width:.125rem;border-block-end-width:.125rem}:host(:focus-within) [part=prefix]{-webkit-padding-start:.25rem;padding-inline-start:.25rem}:host(:focus-within) [part=suffix]{-webkit-padding-end:.25rem;padding-inline-end:.25rem}:host(:focus-within) [part=label]{color:hsla(var(--igc-primary-500), var(--igc-primary-a))}[part^=container]{grid-template-columns:auto auto 1fr auto}[part=start]{width:auto;min-width:.75rem;-ms-flex-negative:0;flex-shrink:0;grid-area:1/1;border-style:solid;border-color:hsla(var(--igc-gray-600), var(--igc-gray-a));border-inline-start-width:.0625rem;border-inline-end-width:0;border-block-start-width:.0625rem;border-block-end-width:.0625rem;border-start-start-radius:.25rem;border-end-start-radius:.25rem}[part=start]>[part=prefix]{-webkit-padding-start:.3125rem;padding-inline-start:.3125rem;-webkit-padding-end:.25rem;padding-inline-end:.25rem}[part=notch]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:auto;height:100%;grid-area:1/2;padding:0 .25rem;border-width:.0625rem;border-style:solid;border-color:hsla(var(--igc-gray-600), var(--igc-gray-a));border-left:none;border-right:none;overflow:visible}[part=notch]:empty{display:none}[part=filler]{grid-area:1/3;border-width:.0625rem;border-style:solid;border-color:hsla(var(--igc-gray-600), var(--igc-gray-a));border-left:none;border-right:none}[part=end]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;height:100%;grid-area:1/4;min-width:.75rem;border-style:solid;border-color:hsla(var(--igc-gray-600), var(--igc-gray-a));border-inline-start-width:0;border-inline-end-width:.0625rem;border-block-start-width:.0625rem;border-block-end-width:.0625rem;border-start-end-radius:.25rem;border-end-end-radius:.25rem}[part=end]>[part=suffix]{-webkit-padding-start:.25rem;padding-inline-start:.25rem;-webkit-padding-end:.3125rem;padding-inline-end:.3125rem}[part=helper-text]{font-family:var(--igc-caption-font-family);font-weight:var(--igc-caption-font-weight);font-size:var(--igc-caption-font-size);font-style:var(--igc-caption-font-style);letter-spacing:var(--igc-caption-letter-spacing);text-transform:var(--igc-caption-text-transform);line-height:var(--igc-caption-line-height);margin-top:var(--igc-caption-margin-top);margin-bottom:var(--igc-caption-margin-bottom);padding:0 .5rem;margin-top:.25rem;color:hsla(var(--igc-gray-600), var(--igc-gray-a))}:host([invalid]) [part=start],:host([invalid]) [part=notch],:host([invalid]) [part=filler],:host([invalid]) [part=end],:host([invalid]:focus-within) [part=start],:host([invalid]:focus-within) [part=notch],:host([invalid]:focus-within) [part=filler],:host([invalid]:focus-within) [part=end]{border-color:hsla(var(--igc-error-500), var(--igc-error-a))}:host([invalid]) [part=label],:host([invalid]) [part=helper-text],:host([invalid]:focus-within) [part=label],:host([invalid]:focus-within) [part=helper-text]{color:hsla(var(--igc-error-500), var(--igc-error-a))}:host([invalid]:focus-within) [part=notch]{border-top:.0625rem solid rgba(0,0,0,0)}:host([disabled]){pointer-events:none}:host([disabled]) [part~=input],:host([disabled]) [part=label],:host([disabled]) [part=prefix],:host([disabled]) [part=suffix],:host([disabled]) [part=helper-text]{color:hsla(var(--igc-gray-400), var(--igc-gray-a))}:host([disabled]) [part=start],:host([disabled]) [part=filler],:host([disabled]) [part=notch],:host([disabled]) [part=end]{color:hsla(var(--igc-gray-400), var(--igc-gray-a));border-color:hsla(var(--igc-gray-400), var(--igc-gray-a))}:host([disabled]) input::-webkit-input-placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host([disabled]) input::-moz-placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host([disabled]) input:-ms-input-placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host([disabled]) input::-ms-input-placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host([disabled]) input::placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host(:not([outlined])) [part=start],:host(:not([outlined])) [part=end]{border-color:rgba(0,0,0,0);border-top-width:.0625rem}:host(:not([outlined])) [part=notch],:host(:not([outlined])) [part=filler]{border-top:1px solid rgba(0,0,0,0);border-bottom:rgba(0,0,0,0);border-bottom-width:.0625rem}:host(:not([outlined])) [part=label]{inset-inline-start:.125rem}:host(:not([outlined])) [part~=container]{background:hsla(var(--igc-gray-100), var(--igc-gray-a));border-bottom:1px solid hsla(var(--igc-gray-600), var(--igc-gray-a));border-start-end-radius:.25rem;border-start-start-radius:.25rem;-webkit-transition:border-bottom-width 150ms cubic-bezier(0.4, 0, 0.2, 1);-o-transition:border-bottom-width 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:border-bottom-width 150ms cubic-bezier(0.4, 0, 0.2, 1)}:host(:not([outlined])) [part~=container]::after{position:absolute;content:\"\";width:100%;height:.125rem;left:0;right:0;bottom:-1px;background:hsla(var(--igc-primary-500), var(--igc-primary-a));-webkit-transform:scaleX(0);-ms-transform:scaleX(0);transform:scaleX(0);-webkit-transition:opacity 180ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 180ms cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 180ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 180ms cubic-bezier(0.4, 0, 0.2, 1);-o-transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 180ms cubic-bezier(0.4, 0, 0.2, 1)}:host(:not([outlined])) [part~=labelled] [part~=input]{padding-top:1.25rem;padding-bottom:.375rem}:host(:not([outlined])) input:not(:-moz-placeholder-shown)+[part=notch] [part=label]{transform:translateY(-106%)}:host(:not([outlined])) input:not(:-ms-input-placeholder)+[part=notch] [part=label]{-ms-transform:translateY(-106%);transform:translateY(-106%)}:host(:not([outlined])) input:not(:placeholder-shown)+[part=notch] [part=label]{-webkit-transform:translateY(-106%);-ms-transform:translateY(-106%);transform:translateY(-106%)}:host(:not([outlined]):hover) [part~=container]{background:hsla(var(--igc-gray-200), var(--igc-gray-a));border-bottom:1px solid hsla(var(--igc-gray-800), var(--igc-gray-a))}:host(:not([outlined]):focus-within) [part~=container]{background:var(--focus-background, hsla(var(--igc-gray-300), var(--igc-gray-a)));border-bottom:1px solid hsla(var(--igc-primary-500), var(--igc-primary-a))}:host(:not([outlined]):focus-within) [part~=container]::after{-webkit-transform:scaleX(1);-ms-transform:scaleX(1);transform:scaleX(1);opacity:1}:host(:not([outlined]):focus-within) [part=notch] [part=label],:host(:not([outlined])[placeholder]) [part=notch] [part=label]{-webkit-transform:translateY(-106%);-ms-transform:translateY(-106%);transform:translateY(-106%)}:host(:not([outlined])[invalid]) [part=start],:host(:not([outlined])[invalid]) [part=notch],:host(:not([outlined])[invalid]) [part=filler],:host(:not([outlined])[invalid]) [part=end],:host(:not([outlined])[invalid]:focus-within) [part=start],:host(:not([outlined])[invalid]:focus-within) [part=notch],:host(:not([outlined])[invalid]:focus-within) [part=filler],:host(:not([outlined])[invalid]:focus-within) [part=end]{border-color:rgba(0,0,0,0)}:host(:not([outlined])[invalid]) [part~=container],:host(:not([outlined])[invalid]:focus-within) [part~=container]{border-color:hsla(var(--igc-error-500), var(--igc-error-a))}:host(:not([outlined])[invalid]) [part~=container]::after,:host(:not([outlined])[invalid]:focus-within) [part~=container]::after{background:hsla(var(--igc-error-500), var(--igc-error-a))}:host(:not([outlined])[disabled]) [part~=input],:host(:not([outlined])[disabled]) [part=label],:host(:not([outlined])[disabled]) [part=prefix],:host(:not([outlined])[disabled]) [part=suffix],:host(:not([outlined])[disabled]) [part=helper-text]{color:hsla(var(--igc-gray-400), var(--igc-gray-a))}:host(:not([outlined])[disabled]) [part~=container]{border-color:hsla(var(--igc-gray-400), var(--igc-gray-a))}`;\n"]}
|
|
1
|
+
{"version":3,"file":"input.material.css.js","sourceRoot":"","sources":["../../../../../src/components/input/themes/light/input.material.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,suXAAsuX,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host([size=large]) input:-moz-placeholder-shown+[part=notch] [part=label]{transform:translateY(-26px);font-size:.75rem}:host([size=large]) input:-ms-input-placeholder+[part=notch] [part=label]{-ms-transform:translateY(-26px);transform:translateY(-26px);font-size:.75rem}:host([size=large]:focus-within) [part=label],:host([size=large]) input:placeholder-shown+[part=notch] [part=label],:host([size=large]) [part~=filled]+[part=notch] [part=label]{-webkit-transform:translateY(-26px);-ms-transform:translateY(-26px);transform:translateY(-26px);font-size:.75rem}:host([size=medium]) input:-moz-placeholder-shown+[part=notch] [part=label]{transform:translateY(-22px);font-size:.75rem}:host([size=medium]) input:-ms-input-placeholder+[part=notch] [part=label]{-ms-transform:translateY(-22px);transform:translateY(-22px);font-size:.75rem}:host([size=medium]:focus-within) [part=label],:host([size=medium]) input:placeholder-shown+[part=notch] [part=label],:host([size=medium]) [part~=filled]+[part=notch] [part=label]{-webkit-transform:translateY(-22px);-ms-transform:translateY(-22px);transform:translateY(-22px);font-size:.75rem}:host([size=small]) input:-moz-placeholder-shown+[part=notch] [part=label]{transform:translateY(-18px);font-size:.75rem}:host([size=small]) input:-ms-input-placeholder+[part=notch] [part=label]{-ms-transform:translateY(-18px);transform:translateY(-18px);font-size:.75rem}:host([size=small]:focus-within) [part=label],:host([size=small]) input:placeholder-shown+[part=notch] [part=label],:host([size=small]) [part~=filled]+[part=notch] [part=label]{-webkit-transform:translateY(-18px);-ms-transform:translateY(-18px);transform:translateY(-18px);font-size:.75rem}:host input:-moz-placeholder-shown+[part=notch]{border-top:.0625rem solid rgba(0,0,0,0)}:host input:-ms-input-placeholder+[part=notch]{border-top:.0625rem solid rgba(0,0,0,0)}:host([disabled]) [part~=filled]+[part=notch],:host([invalid]) [part~=filled]+[part=notch],:host([invalid]:focus-within) [part~=filled]+[part=notch],:host input:placeholder-shown+[part=notch],:host [part~=filled]+[part=notch]{border-top:.0625rem solid rgba(0,0,0,0)}[part~=input]{background:rgba(0,0,0,0);padding:0 .25rem;font-size:1rem;grid-area:1/2/span 1/span 2}[part=label]{color:hsla(var(--igc-gray-600), var(--igc-gray-a));-webkit-transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);-o-transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);line-height:1;will-change:font-size,color,transform}:host(:focus-within) [part=start]{border-color:hsla(var(--igc-primary-500), var(--igc-primary-a));border-inline-start-width:.125rem;border-block-start-width:.125rem;border-block-end-width:.125rem}:host(:focus-within) [part=notch]{border-width:.125rem;border-color:hsla(var(--igc-primary-500), var(--igc-primary-a));border-top:.0625rem solid rgba(0,0,0,0)}:host(:focus-within) [part=filler]{border-width:.125rem;border-color:hsla(var(--igc-primary-500), var(--igc-primary-a))}:host(:focus-within) [part=end]{border-color:hsla(var(--igc-primary-500), var(--igc-primary-a));border-inline-end-width:.125rem;border-block-start-width:.125rem;border-block-end-width:.125rem}:host(:focus-within) [part=prefix]{-webkit-padding-start:.25rem;padding-inline-start:.25rem}:host(:focus-within) [part=suffix]{-webkit-padding-end:.25rem;padding-inline-end:.25rem}:host(:focus-within) [part=label]{color:hsla(var(--igc-primary-500), var(--igc-primary-a))}[part^=container]{grid-template-columns:auto auto 1fr auto}[part=start]{width:auto;min-width:.75rem;-ms-flex-negative:0;flex-shrink:0;grid-area:1/1;border-style:solid;border-color:hsla(var(--igc-gray-600), var(--igc-gray-a));border-inline-start-width:.0625rem;border-inline-end-width:0;border-block-start-width:.0625rem;border-block-end-width:.0625rem;border-start-start-radius:.25rem;border-end-start-radius:.25rem}[part=start]>[part=prefix]{-webkit-padding-start:.3125rem;padding-inline-start:.3125rem;-webkit-padding-end:.25rem;padding-inline-end:.25rem}[part=notch]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:auto;height:100%;grid-area:1/2;padding:0 .25rem;border-width:.0625rem;border-style:solid;border-color:hsla(var(--igc-gray-600), var(--igc-gray-a));border-left:none;border-right:none;overflow:visible}[part=notch]:empty{display:none}[part=filler]{grid-area:1/3;border-width:.0625rem;border-style:solid;border-color:hsla(var(--igc-gray-600), var(--igc-gray-a));border-left:none;border-right:none}[part=end]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;height:100%;grid-area:1/4;min-width:.75rem;border-style:solid;border-color:hsla(var(--igc-gray-600), var(--igc-gray-a));border-inline-start-width:0;border-inline-end-width:.0625rem;border-block-start-width:.0625rem;border-block-end-width:.0625rem;border-start-end-radius:.25rem;border-end-end-radius:.25rem}[part=end]>[part=suffix]{-webkit-padding-start:.25rem;padding-inline-start:.25rem;-webkit-padding-end:.3125rem;padding-inline-end:.3125rem}[part=helper-text]{font-family:var(--igc-caption-font-family);font-weight:var(--igc-caption-font-weight);font-size:var(--igc-caption-font-size);font-style:var(--igc-caption-font-style);letter-spacing:var(--igc-caption-letter-spacing);text-transform:var(--igc-caption-text-transform);line-height:var(--igc-caption-line-height);margin-top:var(--igc-caption-margin-top);margin-bottom:var(--igc-caption-margin-bottom);padding:0 .5rem;margin-top:.25rem;color:hsla(var(--igc-gray-600), var(--igc-gray-a))}:host([invalid]) [part=start],:host([invalid]) [part=notch],:host([invalid]) [part=filler],:host([invalid]) [part=end],:host([invalid]:focus-within) [part=start],:host([invalid]:focus-within) [part=notch],:host([invalid]:focus-within) [part=filler],:host([invalid]:focus-within) [part=end]{border-color:hsla(var(--igc-error-500), var(--igc-error-a))}:host([invalid]) [part=label],:host([invalid]) [part=helper-text],:host([invalid]:focus-within) [part=label],:host([invalid]:focus-within) [part=helper-text]{color:hsla(var(--igc-error-500), var(--igc-error-a))}:host([invalid]:focus-within) [part=notch]{border-top:.0625rem solid rgba(0,0,0,0)}:host([disabled]){pointer-events:none}:host([disabled]) [part~=input],:host([disabled]) [part=label],:host([disabled]) [part=prefix],:host([disabled]) [part=suffix],:host([disabled]) [part=helper-text]{color:hsla(var(--igc-gray-400), var(--igc-gray-a))}:host([disabled]) [part=start],:host([disabled]) [part=filler],:host([disabled]) [part=notch],:host([disabled]) [part=end]{color:hsla(var(--igc-gray-400), var(--igc-gray-a));border-color:hsla(var(--igc-gray-400), var(--igc-gray-a))}:host([disabled]) input::-webkit-input-placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host([disabled]) input::-moz-placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host([disabled]) input:-ms-input-placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host([disabled]) input::-ms-input-placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host([disabled]) input::placeholder{color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host(:not([outlined])) [part=start],:host(:not([outlined])) [part=end]{border-color:rgba(0,0,0,0);border-top-width:.0625rem}:host(:not([outlined])) [part=notch],:host(:not([outlined])) [part=filler]{border-top:1px solid rgba(0,0,0,0);border-bottom:rgba(0,0,0,0);border-bottom-width:.0625rem}:host(:not([outlined])) [part=label]{inset-inline-start:.125rem}:host(:not([outlined])) [part~=container]{background:hsla(var(--igc-gray-100), var(--igc-gray-a));border-bottom:1px solid hsla(var(--igc-gray-600), var(--igc-gray-a));border-start-end-radius:.25rem;border-start-start-radius:.25rem;-webkit-transition:border-bottom-width 150ms cubic-bezier(0.4, 0, 0.2, 1);-o-transition:border-bottom-width 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:border-bottom-width 150ms cubic-bezier(0.4, 0, 0.2, 1)}:host(:not([outlined])) [part~=container]::after{position:absolute;content:\"\";width:100%;height:.125rem;left:0;right:0;bottom:-1px;background:hsla(var(--igc-primary-500), var(--igc-primary-a));-webkit-transform:scaleX(0);-ms-transform:scaleX(0);transform:scaleX(0);-webkit-transition:opacity 180ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 180ms cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 180ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 180ms cubic-bezier(0.4, 0, 0.2, 1);-o-transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 180ms cubic-bezier(0.4, 0, 0.2, 1)}:host(:not([outlined])) [part~=labelled] [part~=input]{padding-top:1.25rem;padding-bottom:.375rem}:host(:not([outlined])) input:-moz-placeholder-shown+[part=notch] [part=label]{transform:translateY(-106%)}:host(:not([outlined])) input:-ms-input-placeholder+[part=notch] [part=label]{-ms-transform:translateY(-106%);transform:translateY(-106%)}:host(:not([outlined])) input:placeholder-shown+[part=notch] [part=label],:host(:not([outlined])) [part~=filled]+[part=notch] [part=label]{-webkit-transform:translateY(-106%);-ms-transform:translateY(-106%);transform:translateY(-106%)}:host(:not([outlined]):hover) [part~=container]{background:hsla(var(--igc-gray-200), var(--igc-gray-a));border-bottom:1px solid hsla(var(--igc-gray-800), var(--igc-gray-a))}:host(:not([outlined]):focus-within) [part~=container]{background:var(--focus-background, hsla(var(--igc-gray-300), var(--igc-gray-a)));border-bottom:1px solid hsla(var(--igc-primary-500), var(--igc-primary-a))}:host(:not([outlined]):focus-within) [part~=container]::after{-webkit-transform:scaleX(1);-ms-transform:scaleX(1);transform:scaleX(1);opacity:1}:host(:not([outlined]):focus-within) [part=notch] [part=label]{-webkit-transform:translateY(-106%);-ms-transform:translateY(-106%);transform:translateY(-106%)}:host(:not([outlined])[invalid]) [part=start],:host(:not([outlined])[invalid]) [part=notch],:host(:not([outlined])[invalid]) [part=filler],:host(:not([outlined])[invalid]) [part=end],:host(:not([outlined])[invalid]:focus-within) [part=start],:host(:not([outlined])[invalid]:focus-within) [part=notch],:host(:not([outlined])[invalid]:focus-within) [part=filler],:host(:not([outlined])[invalid]:focus-within) [part=end]{border-color:rgba(0,0,0,0)}:host(:not([outlined])[invalid]) [part~=container],:host(:not([outlined])[invalid]:focus-within) [part~=container]{border-color:hsla(var(--igc-error-500), var(--igc-error-a))}:host(:not([outlined])[invalid]) [part~=container]::after,:host(:not([outlined])[invalid]:focus-within) [part~=container]::after{background:hsla(var(--igc-error-500), var(--igc-error-a))}:host(:not([outlined])[disabled]) [part~=input],:host(:not([outlined])[disabled]) [part=label],:host(:not([outlined])[disabled]) [part=prefix],:host(:not([outlined])[disabled]) [part=suffix],:host(:not([outlined])[disabled]) [part=helper-text]{color:hsla(var(--igc-gray-400), var(--igc-gray-a))}:host(:not([outlined])[disabled]) [part~=container]{border-color:hsla(var(--igc-gray-400), var(--igc-gray-a))}`;\n"]}
|
|
@@ -16,7 +16,7 @@ export default class IgcNavDrawerComponent extends LitElement {
|
|
|
16
16
|
static readonly tagName = "igc-nav-drawer";
|
|
17
17
|
static styles: import("lit").CSSResult;
|
|
18
18
|
/** The position of the drawer. */
|
|
19
|
-
position: 'start' | 'end' | 'top' | 'bottom';
|
|
19
|
+
position: 'start' | 'end' | 'top' | 'bottom' | 'relative';
|
|
20
20
|
/** Determines whether the drawer is opened. */
|
|
21
21
|
open: boolean;
|
|
22
22
|
/** Opens the drawer. */
|