igniteui-webcomponents 3.3.0-beta.0 → 3.4.0-beta.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 +45 -20
- package/README.md +7 -2
- package/components/accordion/accordion.d.ts +36 -0
- package/components/accordion/accordion.js +129 -0
- package/components/accordion/accordion.js.map +1 -0
- package/components/accordion/themes/accordion.base.css.d.ts +1 -0
- package/components/accordion/themes/accordion.base.css.js +3 -0
- package/components/accordion/themes/accordion.base.css.js.map +1 -0
- package/components/button/button-base.js +7 -2
- package/components/button/button-base.js.map +1 -1
- package/components/button/icon-button.d.ts +0 -1
- package/components/button/icon-button.js +3 -1
- package/components/button/icon-button.js.map +1 -1
- package/components/button/themes/button/light/button.base.css.js +1 -1
- package/components/button/themes/button/light/button.base.css.js.map +1 -1
- package/components/button/themes/button/light/button.material.css.js +1 -1
- package/components/button/themes/button/light/button.material.css.js.map +1 -1
- package/components/calendar/calendar.d.ts +0 -4
- package/components/calendar/calendar.js +6 -4
- package/components/calendar/calendar.js.map +1 -1
- package/components/calendar/common/calendar-base.js +3 -1
- package/components/calendar/common/calendar-base.js.map +1 -1
- package/components/calendar/common/calendar.model.js.map +1 -1
- package/components/calendar/days-view/days-view.d.ts +3 -0
- package/components/calendar/days-view/days-view.js +19 -7
- package/components/calendar/days-view/days-view.js.map +1 -1
- package/components/calendar/months-view/months-view.d.ts +1 -0
- package/components/calendar/months-view/months-view.js +2 -2
- package/components/calendar/months-view/months-view.js.map +1 -1
- package/components/calendar/years-view/years-view.d.ts +1 -0
- package/components/calendar/years-view/years-view.js +2 -2
- package/components/calendar/years-view/years-view.js.map +1 -1
- package/components/card/card.js +6 -0
- package/components/card/card.js.map +1 -1
- package/components/checkbox/checkbox-base.js +7 -2
- package/components/checkbox/checkbox-base.js.map +1 -1
- package/components/checkbox/checkbox.d.ts +1 -0
- package/components/checkbox/checkbox.js +6 -5
- package/components/checkbox/checkbox.js.map +1 -1
- package/components/checkbox/switch.d.ts +1 -0
- package/components/checkbox/switch.js +6 -5
- package/components/checkbox/switch.js.map +1 -1
- package/components/chip/chip.d.ts +1 -1
- package/components/chip/chip.js +12 -1
- package/components/chip/chip.js.map +1 -1
- package/components/common/decorators/blazorAdditionalDependencies.d.ts +5 -0
- package/components/common/decorators/blazorAdditionalDependencies.js +6 -0
- package/components/common/decorators/blazorAdditionalDependencies.js.map +1 -0
- package/components/common/decorators/blazorDeepImport.d.ts +4 -0
- package/components/common/decorators/blazorDeepImport.js +2 -0
- package/components/common/decorators/blazorDeepImport.js.map +1 -0
- package/components/common/decorators/index.d.ts +1 -0
- package/components/common/decorators/index.js +1 -0
- package/components/common/decorators/index.js.map +1 -1
- package/components/common/definitions/defineAllComponents.js +2 -0
- package/components/common/definitions/defineAllComponents.js.map +1 -1
- package/components/common/i18n/calendar.resources.js.map +1 -1
- package/components/common/types.d.ts +1 -0
- package/components/common/types.js +2 -0
- package/components/common/types.js.map +1 -0
- package/components/common/util.d.ts +2 -1
- package/components/common/util.js +5 -2
- package/components/common/util.js.map +1 -1
- package/components/date-time-input/date-time-input.d.ts +2 -0
- package/components/date-time-input/date-time-input.js +12 -2
- package/components/date-time-input/date-time-input.js.map +1 -1
- package/components/dialog/dialog.d.ts +69 -0
- package/components/dialog/dialog.js +168 -0
- package/components/dialog/dialog.js.map +1 -0
- package/components/dialog/themes/light/dialog.base.css.d.ts +1 -0
- package/components/dialog/themes/light/dialog.base.css.js +3 -0
- package/components/dialog/themes/light/dialog.base.css.js.map +1 -0
- package/components/dialog/themes/light/dialog.bootstrap.css.d.ts +1 -0
- package/components/dialog/themes/light/dialog.bootstrap.css.js +3 -0
- package/components/dialog/themes/light/dialog.bootstrap.css.js.map +1 -0
- package/components/dialog/themes/light/dialog.fluent.css.d.ts +1 -0
- package/components/dialog/themes/light/dialog.fluent.css.js +3 -0
- package/components/dialog/themes/light/dialog.fluent.css.js.map +1 -0
- package/components/dialog/themes/light/dialog.indigo.css.d.ts +1 -0
- package/components/dialog/themes/light/dialog.indigo.css.js +3 -0
- package/components/dialog/themes/light/dialog.indigo.css.js.map +1 -0
- package/components/dialog/themes/light/dialog.material.css.d.ts +1 -0
- package/components/dialog/themes/light/dialog.material.css.js +3 -0
- package/components/dialog/themes/light/dialog.material.css.js.map +1 -0
- package/components/dropdown/dropdown-group.d.ts +4 -3
- package/components/dropdown/dropdown-group.js +8 -11
- package/components/dropdown/dropdown-group.js.map +1 -1
- package/components/dropdown/dropdown-header.d.ts +1 -1
- package/components/dropdown/dropdown-header.js.map +1 -1
- package/components/dropdown/dropdown-item.d.ts +1 -1
- package/components/dropdown/dropdown-item.js.map +1 -1
- package/components/dropdown/dropdown.d.ts +34 -28
- package/components/dropdown/dropdown.js +76 -87
- package/components/dropdown/dropdown.js.map +1 -1
- package/components/dropdown/themes/light/dropdown-group.base.css.js +1 -1
- package/components/dropdown/themes/light/dropdown-group.base.css.js.map +1 -1
- package/components/dropdown/themes/light/dropdown-group.fluent.css.js +1 -1
- package/components/dropdown/themes/light/dropdown-group.fluent.css.js.map +1 -1
- package/components/dropdown/themes/light/dropdown-item.base.css.js +1 -1
- package/components/dropdown/themes/light/dropdown-item.base.css.js.map +1 -1
- package/components/dropdown/themes/light/dropdown.base.css.js +1 -1
- package/components/dropdown/themes/light/dropdown.base.css.js.map +1 -1
- package/components/dropdown/themes/light/dropdown.fluent.css.js +1 -1
- package/components/dropdown/themes/light/dropdown.fluent.css.js.map +1 -1
- package/components/expansion-panel/expansion-panel.d.ts +1 -1
- package/components/expansion-panel/expansion-panel.js +11 -6
- package/components/expansion-panel/expansion-panel.js.map +1 -1
- package/components/expansion-panel/themes/light/expansion-panel.base.css.js +1 -1
- package/components/expansion-panel/themes/light/expansion-panel.base.css.js.map +1 -1
- package/components/form/form.js +4 -3
- package/components/form/form.js.map +1 -1
- package/components/icon/icon.js +6 -8
- package/components/icon/icon.js.map +1 -1
- package/components/icon/icon.registry.js +2 -0
- package/components/icon/icon.registry.js.map +1 -1
- package/components/input/input-base.d.ts +2 -1
- package/components/input/input-base.js +9 -6
- package/components/input/input-base.js.map +1 -1
- package/components/input/input.d.ts +1 -0
- package/components/input/input.js +5 -0
- package/components/input/input.js.map +1 -1
- package/components/input/themes/light/input.base.css.js +1 -1
- package/components/input/themes/light/input.base.css.js.map +1 -1
- package/components/input/themes/light/input.bootstrap.css.js +1 -1
- package/components/input/themes/light/input.bootstrap.css.js.map +1 -1
- package/components/input/themes/light/input.fluent.css.js +1 -1
- package/components/input/themes/light/input.fluent.css.js.map +1 -1
- package/components/input/themes/light/input.indigo.css.js +1 -1
- package/components/input/themes/light/input.indigo.css.js.map +1 -1
- package/components/list/list.js +4 -0
- package/components/list/list.js.map +1 -1
- package/components/mask-input/mask-input-base.js +7 -2
- package/components/mask-input/mask-input-base.js.map +1 -1
- package/components/nav-drawer/nav-drawer.js +4 -0
- package/components/nav-drawer/nav-drawer.js.map +1 -1
- package/components/progress/circular-progress.d.ts +1 -1
- package/components/progress/circular-progress.js +3 -0
- package/components/progress/circular-progress.js.map +1 -1
- package/components/progress/linear-progress.js +1 -0
- package/components/progress/linear-progress.js.map +1 -1
- package/components/progress/themes/circular/circular.progress.base.css.js +1 -1
- package/components/progress/themes/circular/circular.progress.base.css.js.map +1 -1
- package/components/progress/themes/linear/linear.progress.base.css.js +1 -1
- package/components/progress/themes/linear/linear.progress.base.css.js.map +1 -1
- package/components/progress/themes/linear/linear.progress.bootstrap.css.js +1 -1
- package/components/progress/themes/linear/linear.progress.bootstrap.css.js.map +1 -1
- package/components/progress/themes/linear/linear.progress.fluent.css.js +1 -1
- package/components/progress/themes/linear/linear.progress.fluent.css.js.map +1 -1
- package/components/progress/themes/linear/linear.progress.indigo.css.js +1 -1
- package/components/progress/themes/linear/linear.progress.indigo.css.js.map +1 -1
- package/components/radio/radio.d.ts +1 -0
- package/components/radio/radio.js +6 -5
- package/components/radio/radio.js.map +1 -1
- package/components/radio-group/radio-group.d.ts +0 -1
- package/components/radio-group/radio-group.js +7 -6
- package/components/radio-group/radio-group.js.map +1 -1
- package/components/rating/rating-symbol.base.css.d.ts +1 -0
- package/components/rating/rating-symbol.base.css.js +3 -0
- package/components/rating/rating-symbol.base.css.js.map +1 -0
- package/components/rating/rating-symbol.d.ts +8 -2
- package/components/rating/rating-symbol.js +12 -3
- package/components/rating/rating-symbol.js.map +1 -1
- package/components/rating/rating.base.css.js +1 -1
- package/components/rating/rating.base.css.js.map +1 -1
- package/components/rating/rating.bootstrap.css.js +1 -1
- package/components/rating/rating.bootstrap.css.js.map +1 -1
- package/components/rating/rating.d.ts +38 -21
- package/components/rating/rating.fluent.css.js +1 -1
- package/components/rating/rating.fluent.css.js.map +1 -1
- package/components/rating/rating.indigo.css.js +1 -1
- package/components/rating/rating.indigo.css.js.map +1 -1
- package/components/rating/rating.js +116 -57
- package/components/rating/rating.js.map +1 -1
- package/components/select/select-group.d.ts +31 -0
- package/components/select/select-group.js +69 -0
- package/components/select/select-group.js.map +1 -0
- package/components/select/select-header.d.ts +15 -0
- package/components/select/select-header.js +5 -0
- package/components/select/select-header.js.map +1 -0
- package/components/select/select-item.d.ts +30 -0
- package/components/select/select-item.js +39 -0
- package/components/select/select-item.js.map +1 -0
- package/components/select/select.d.ts +112 -0
- package/components/select/select.js +343 -0
- package/components/select/select.js.map +1 -0
- package/components/select/themes/dark/select.bootstrap.css.d.ts +1 -0
- package/components/select/themes/dark/select.bootstrap.css.js +3 -0
- package/components/select/themes/dark/select.bootstrap.css.js.map +1 -0
- package/components/select/themes/dark/select.fluent.css.d.ts +1 -0
- package/components/select/themes/dark/select.fluent.css.js +3 -0
- package/components/select/themes/dark/select.fluent.css.js.map +1 -0
- package/components/select/themes/dark/select.indigo.css.d.ts +1 -0
- package/components/select/themes/dark/select.indigo.css.js +3 -0
- package/components/select/themes/dark/select.indigo.css.js.map +1 -0
- package/components/select/themes/dark/select.material.css.d.ts +1 -0
- package/components/select/themes/dark/select.material.css.js +3 -0
- package/components/select/themes/dark/select.material.css.js.map +1 -0
- package/components/select/themes/light/select.base.css.d.ts +1 -0
- package/components/select/themes/light/select.base.css.js +3 -0
- package/components/select/themes/light/select.base.css.js.map +1 -0
- package/components/select/themes/light/select.bootstrap.css.d.ts +1 -0
- package/components/select/themes/light/select.bootstrap.css.js +3 -0
- package/components/select/themes/light/select.bootstrap.css.js.map +1 -0
- package/components/select/themes/light/select.fluent.css.d.ts +1 -0
- package/components/select/themes/light/select.fluent.css.js +3 -0
- package/components/select/themes/light/select.fluent.css.js.map +1 -0
- package/components/select/themes/light/select.indigo.css.d.ts +1 -0
- package/components/select/themes/light/select.indigo.css.js +3 -0
- package/components/select/themes/light/select.indigo.css.js.map +1 -0
- package/components/select/themes/light/select.material.css.d.ts +1 -0
- package/components/select/themes/light/select.material.css.js +3 -0
- package/components/select/themes/light/select.material.css.js.map +1 -0
- package/components/slider/range-slider.js.map +1 -1
- package/components/slider/slider-base.d.ts +0 -1
- package/components/slider/slider-base.js +12 -9
- package/components/slider/slider-base.js.map +1 -1
- package/components/slider/themes/light/slider.base.css.js +1 -1
- package/components/slider/themes/light/slider.base.css.js.map +1 -1
- package/components/slider/themes/light/slider.bootstrap.css.js +1 -1
- package/components/slider/themes/light/slider.bootstrap.css.js.map +1 -1
- package/components/slider/themes/light/slider.fluent.css.js +1 -1
- package/components/slider/themes/light/slider.fluent.css.js.map +1 -1
- package/components/slider/themes/light/slider.indigo.css.js +1 -1
- package/components/slider/themes/light/slider.indigo.css.js.map +1 -1
- package/components/slider/themes/light/slider.material.css.js +1 -1
- package/components/slider/themes/light/slider.material.css.js.map +1 -1
- package/components/snackbar/snackbar.js +3 -0
- package/components/snackbar/snackbar.js.map +1 -1
- package/components/tabs/tab-panel.js +2 -3
- package/components/tabs/tab-panel.js.map +1 -1
- package/components/tabs/tab.js +1 -1
- package/components/tabs/tab.js.map +1 -1
- package/components/tabs/tabs.d.ts +2 -4
- package/components/tabs/tabs.js +17 -11
- package/components/tabs/tabs.js.map +1 -1
- package/components/tabs/themes/light/tab.base.css.js +1 -1
- package/components/tabs/themes/light/tab.base.css.js.map +1 -1
- package/components/toast/toast.d.ts +1 -0
- package/components/toast/toast.js +9 -0
- package/components/toast/toast.js.map +1 -1
- package/components/toggle/toggle.controller.d.ts +24 -4
- package/components/toggle/toggle.controller.js +36 -30
- package/components/toggle/toggle.controller.js.map +1 -1
- package/components/toggle/toggle.directive.d.ts +1 -1
- package/components/toggle/toggle.directive.js +1 -0
- package/components/toggle/toggle.directive.js.map +1 -1
- package/components/tree/themes/light/tree.base.css.js +1 -1
- package/components/tree/themes/light/tree.base.css.js.map +1 -1
- package/components/tree/tree-item.d.ts +0 -1
- package/components/tree/tree-item.js +8 -1
- package/components/tree/tree-item.js.map +1 -1
- package/components/tree/tree.common.js.map +1 -1
- package/components/tree/tree.d.ts +2 -2
- package/components/tree/tree.js +22 -2
- package/components/tree/tree.js.map +1 -1
- package/custom-elements.json +738 -42
- package/index.d.ts +12 -12
- package/index.js +9 -11
- package/index.js.map +1 -1
- package/package.json +10 -8
- package/themes/dark/bootstrap.css +1 -1
- package/themes/dark/fluent.css +1 -1
- package/themes/dark/indigo.css +1 -1
- package/themes/dark/material.css +1 -1
- package/vscode-html-custom-data.json +305 -41
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expansion-panel.js","sourceRoot":"","sources":["../../../src/components/expansion-panel/expansion-panel.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,4CAA4C,CAAC;AACpE,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,MA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,CAoL9C;eApLoB,0BAA0B","sourcesContent":["import { LitElement, html } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { themes } from '../../theming/theming-decorator.js';\nimport { styles } from './themes/light/expansion-panel.base.css.js';\nimport { styles as bootstrap } from './themes/light/expansion-panel.bootstrap.css.js';\nimport { styles as fluent } from './themes/light/expansion-panel.fluent.css.js';\nimport { styles as indigo } from './themes/light/expansion-panel.indigo.css.js';\nimport '../icon/icon.js';\n\nlet NEXT_ID = 0;\nexport interface IgcExpansionPanelComponentEventMap {\n igcOpening: CustomEvent<IgcExpansionPanelComponent>;\n igcOpened: CustomEvent<IgcExpansionPanelComponent>;\n igcClosing: CustomEvent<IgcExpansionPanelComponent>;\n igcClosed: CustomEvent<IgcExpansionPanelComponent>;\n}\n\n/**\n * The Expansion Panel Component provides a way to display information in a toggleable way -\n * compact summary view containing title and description and expanded detail view containing\n * additional content to the summary header.\n *\n * @element igc-expansion-panel\n *\n * @slot title - renders the title of the panel's header\n * @slot subtitle - renders the subtitle of the panel's header\n * @slot indicator - renders the expand/collapsed indicator\n *\n * @fires igcOpening - Emitted before opening the expansion panel.\n * @fires igcOpened - Emitted after the expansion panel is opened.\n * @fires igcClosing - Emitted before closing the expansion panel.\n * @fires igcClosed - Emitted after the expansion panel is closed.\n *\n * @csspart header - The container of the expansion indicator, title and subtitle.\n * @csspart title - The title container.\n * @csspart subtitle - The subtitle container.\n * @csspart indicator - The indicator container.\n * @csspart content - The expansion panel's content wrapper.\n */\n@themes({ bootstrap, fluent, indigo })\nexport default class IgcExpansionPanelComponent extends EventEmitterMixin<\n IgcExpansionPanelComponentEventMap,\n Constructor<LitElement>\n>(LitElement) {\n public static readonly tagName = 'igc-expansion-panel';\n public static styles = styles;\n\n /** Indicates whether the contents of the control should be visible. */\n @property({ reflect: true, type: Boolean })\n public open = false;\n\n /** Get/Set whether the expansion panel is disabled. Disabled panels are ignored for user interactions. */\n @property({ reflect: true, type: Boolean })\n public disabled = false;\n\n /** The indicator position of the expansion panel. */\n @property({ reflect: true, attribute: 'indicator-position' })\n public indicatorPosition: 'start' | 'end' | 'none' = 'start';\n\n @query('[part~=\"header\"]', true)\n protected panelHeader!: HTMLElement;\n\n private panelId!: string;\n\n public override connectedCallback() {\n super.connectedCallback();\n const id = this.getAttribute('id');\n this.panelId! = id ? id : 'igc-expansion-panel-' + ++NEXT_ID;\n }\n\n private handleClicked() {\n this.panelHeader!.focus();\n\n if (this.open) {\n this.closeWithEvent();\n } else {\n this.openWithEvent();\n }\n }\n\n private handleKeydown(event: KeyboardEvent) {\n if (this.disabled) {\n return;\n }\n\n switch (event.key.toLowerCase()) {\n case 'arrowdown':\n case 'down':\n if (event.altKey) {\n this.openWithEvent();\n }\n break;\n case 'arrowup':\n case 'up':\n if (event.altKey) {\n this.closeWithEvent();\n }\n break;\n case 'enter':\n case ' ':\n this.open ? this.closeWithEvent() : this.openWithEvent();\n break;\n }\n }\n\n /**\n * @private\n * Opens the panel.\n */\n private openWithEvent() {\n if (this.open) {\n return;\n }\n\n const args = {\n cancelable: true,\n detail: this,\n };\n\n const allowed = this.emitEvent('igcOpening', args);\n\n if (!allowed) {\n return;\n }\n\n this.open = true;\n this.emitEvent('igcOpened', { detail: this });\n }\n\n /**\n * @private\n * Closes the panel.\n */\n private closeWithEvent() {\n if (!this.open) {\n return;\n }\n\n const args = {\n cancelable: true,\n detail: this,\n };\n\n const allowed = this.emitEvent('igcClosing', args);\n\n if (!allowed) {\n return;\n }\n\n this.open = false;\n this.emitEvent('igcClosed', { detail: this });\n }\n\n /** Toggles panel open state. */\n public toggle(): void {\n this.open = !this.open;\n }\n\n /** Hides the panel content. */\n public hide(): void {\n this.open = false;\n }\n\n /** Shows the panel content. */\n public show(): void {\n this.open = true;\n }\n\n private indicatorTemplate() {\n return html`\n <div part=\"indicator\" aria-hidden=\"true\">\n <slot name=\"indicator\">\n <igc-icon\n name=${this.open ? 'keyboard_arrow_up' : 'keyboard_arrow_down'}\n collection=\"internal\"\n >\n </igc-icon>\n </slot>\n </div>\n `;\n }\n\n private headerTemplate() {\n return html`\n <div\n part=\"header\"\n id=\"${this.panelId!}-header\"\n role=\"button\"\n aria-expanded=\"${this.open}\"\n aria-disabled=\"${this.disabled}\"\n aria-controls=\"${this.panelId!}-content\"\n tabindex=${this.disabled ? '-1' : '0'}\n @click=${this.handleClicked}\n @keydown=${this.handleKeydown}\n >\n ${this.indicatorTemplate()}\n <div>\n <slot name=\"title\" part=\"title\"></slot>\n <slot name=\"subtitle\" part=\"subtitle\"></slot>\n </div>\n </div>\n `;\n }\n\n private contentTemplate() {\n return html`\n <div\n part=\"content\"\n role=\"region\"\n id=\"${this.panelId!}-content\"\n aria-labelledby=\"${this.panelId!}-header\"\n >\n <slot ?hidden=${!this.open}></slot>\n </div>\n `;\n }\n\n protected override render() {\n return html` ${this.headerTemplate()} ${this.contentTemplate()}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-expansion-panel': IgcExpansionPanelComponent;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"expansion-panel.js","sourceRoot":"","sources":["../../../src/components/expansion-panel/expansion-panel.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,4CAA4C,CAAC;AACpE,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,MAAM,IAAI,MA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M,EAAE,CAAC;GACjB,0BAA0B,CAsL9C;eAtLoB,0BAA0B","sourcesContent":["import { LitElement, html } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { themes } from '../../theming/theming-decorator.js';\nimport { styles } from './themes/light/expansion-panel.base.css.js';\nimport { styles as bootstrap } from './themes/light/expansion-panel.bootstrap.css.js';\nimport { styles as fluent } from './themes/light/expansion-panel.fluent.css.js';\nimport { styles as indigo } from './themes/light/expansion-panel.indigo.css.js';\nimport { createCounter } from '../common/util.js';\n\nimport { defineComponents } from '../common/definitions/defineComponents.js';\nimport IgcIconComponent from '../icon/icon.js';\n\ndefineComponents(IgcIconComponent);\n\nexport interface IgcExpansionPanelComponentEventMap {\n igcOpening: CustomEvent<IgcExpansionPanelComponent>;\n igcOpened: CustomEvent<IgcExpansionPanelComponent>;\n igcClosing: CustomEvent<IgcExpansionPanelComponent>;\n igcClosed: CustomEvent<IgcExpansionPanelComponent>;\n}\n\n/**\n * The Expansion Panel Component provides a way to display information in a toggleable way -\n * compact summary view containing title and description and expanded detail view containing\n * additional content to the summary header.\n *\n * @element igc-expansion-panel\n *\n * @slot title - renders the title of the panel's header\n * @slot subtitle - renders the subtitle of the panel's header\n * @slot indicator - renders the expand/collapsed indicator\n *\n * @fires igcOpening - Emitted before opening the expansion panel.\n * @fires igcOpened - Emitted after the expansion panel is opened.\n * @fires igcClosing - Emitted before closing the expansion panel.\n * @fires igcClosed - Emitted after the expansion panel is closed.\n *\n * @csspart header - The container of the expansion indicator, title and subtitle.\n * @csspart title - The title container.\n * @csspart subtitle - The subtitle container.\n * @csspart indicator - The indicator container.\n * @csspart content - The expansion panel's content wrapper.\n */\n@themes({ bootstrap, fluent, indigo })\nexport default class IgcExpansionPanelComponent extends EventEmitterMixin<\n IgcExpansionPanelComponentEventMap,\n Constructor<LitElement>\n>(LitElement) {\n public static readonly tagName = 'igc-expansion-panel';\n public static styles = styles;\n private static readonly increment = createCounter();\n\n /** Indicates whether the contents of the control should be visible. */\n @property({ reflect: true, type: Boolean })\n public open = false;\n\n /** Get/Set whether the expansion panel is disabled. Disabled panels are ignored for user interactions. */\n @property({ reflect: true, type: Boolean })\n public disabled = false;\n\n /** The indicator position of the expansion panel. */\n @property({ reflect: true, attribute: 'indicator-position' })\n public indicatorPosition: 'start' | 'end' | 'none' = 'start';\n\n @query('[part~=\"header\"]', true)\n protected panelHeader!: HTMLElement;\n\n private panelId!: string;\n\n public override connectedCallback() {\n super.connectedCallback();\n this.panelId =\n this.getAttribute('id') ||\n `igc-expansion-panel-${IgcExpansionPanelComponent.increment()}`;\n }\n\n private handleClicked() {\n this.panelHeader!.focus();\n\n if (this.open) {\n this.closeWithEvent();\n } else {\n this.openWithEvent();\n }\n }\n\n private handleKeydown(event: KeyboardEvent) {\n if (this.disabled) {\n return;\n }\n\n switch (event.key.toLowerCase()) {\n case 'arrowdown':\n case 'down':\n if (event.altKey) {\n this.openWithEvent();\n }\n break;\n case 'arrowup':\n case 'up':\n if (event.altKey) {\n this.closeWithEvent();\n }\n break;\n case 'enter':\n case ' ':\n this.open ? this.closeWithEvent() : this.openWithEvent();\n break;\n }\n }\n\n /**\n * @private\n * Opens the panel.\n */\n private openWithEvent() {\n if (this.open) {\n return;\n }\n\n const args = {\n cancelable: true,\n detail: this,\n };\n\n const allowed = this.emitEvent('igcOpening', args);\n\n if (!allowed) {\n return;\n }\n\n this.open = true;\n this.emitEvent('igcOpened', { detail: this });\n }\n\n /**\n * @private\n * Closes the panel.\n */\n private closeWithEvent() {\n if (!this.open) {\n return;\n }\n\n const args = {\n cancelable: true,\n detail: this,\n };\n\n const allowed = this.emitEvent('igcClosing', args);\n\n if (!allowed) {\n return;\n }\n\n this.open = false;\n this.emitEvent('igcClosed', { detail: this });\n }\n\n /** Toggles panel open state. */\n public toggle(): void {\n this.open = !this.open;\n }\n\n /** Hides the panel content. */\n public hide(): void {\n this.open = false;\n }\n\n /** Shows the panel content. */\n public show(): void {\n this.open = true;\n }\n\n private indicatorTemplate() {\n return html`\n <div part=\"indicator\" aria-hidden=\"true\">\n <slot name=\"indicator\">\n <igc-icon\n name=${this.open ? 'keyboard_arrow_up' : 'keyboard_arrow_down'}\n collection=\"internal\"\n >\n </igc-icon>\n </slot>\n </div>\n `;\n }\n\n private headerTemplate() {\n return html`\n <div\n part=\"header\"\n id=\"${this.panelId!}-header\"\n role=\"button\"\n aria-expanded=\"${this.open}\"\n aria-disabled=\"${this.disabled}\"\n aria-controls=\"${this.panelId!}-content\"\n tabindex=${this.disabled ? '-1' : '0'}\n @click=${this.handleClicked}\n @keydown=${this.handleKeydown}\n >\n ${this.indicatorTemplate()}\n <div>\n <slot name=\"title\" part=\"title\"></slot>\n <slot name=\"subtitle\" part=\"subtitle\"></slot>\n </div>\n </div>\n `;\n }\n\n private contentTemplate() {\n return html`\n <div\n part=\"content\"\n role=\"region\"\n id=\"${this.panelId!}-content\"\n aria-labelledby=\"${this.panelId!}-header\"\n >\n <slot ?hidden=${!this.open}></slot>\n </div>\n `;\n }\n\n protected override render() {\n return html` ${this.headerTemplate()} ${this.contentTemplate()}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-expansion-panel': IgcExpansionPanelComponent;\n }\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `:host{color:hsla(var(--igc-gray-900), var(--igc-gray-a));width:auto;overflow:hidden;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}[part=header]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;padding:calc(var(--igc-spacing-large)*2) calc(var(--igc-spacing-large)*3)}[part=header]:focus,[part=header]:active{outline:rgba(0,0,0,0);background:hsla(var(--igc-gray-100), var(--igc-gray-a))}[part=header] *:not([part~=indicator]){display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}[part=title]::slotted(*){font-family:var(--igc-h5-font-family);font-weight:var(--igc-h5-font-weight);font-size:var(--igc-h5-font-size);font-style:var(--igc-h5-font-style);letter-spacing:var(--igc-h5-letter-spacing);text-transform:var(--igc-h5-text-transform);line-height:var(--igc-h5-line-height);margin-top:var(--igc-h5-margin-top);margin-bottom:var(--igc-h5-margin-bottom);
|
|
2
|
+
export const styles = css `:host{--lines-clamped: 1;color:hsla(var(--igc-gray-900), var(--igc-gray-a));background:hsla(var(--igc-surface-500), var(--igc-surface-a));width:auto;overflow:hidden;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}[part=header]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;padding:calc(var(--igc-spacing-large)*2) calc(var(--igc-spacing-large)*3)}[part=header]:focus,[part=header]:active{outline:rgba(0,0,0,0);background:hsla(var(--igc-gray-100), var(--igc-gray-a))}[part=header] *:not([part~=indicator]){display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}[part=title]::slotted(*){font-family:var(--igc-h5-font-family);font-weight:var(--igc-h5-font-weight);font-size:var(--igc-h5-font-size);font-style:var(--igc-h5-font-style);letter-spacing:var(--igc-h5-letter-spacing);text-transform:var(--igc-h5-text-transform);line-height:var(--igc-h5-line-height);margin-top:var(--igc-h5-margin-top);margin-bottom:var(--igc-h5-margin-bottom);display:-webkit-inline-box;-webkit-line-clamp:var(--lines-clamped);-webkit-box-orient:vertical;overflow:hidden;margin:0}[part=subtitle]{color:hsla(var(--igc-gray-700), var(--igc-gray-a))}[part=subtitle]::slotted(*){font-family:var(--igc-subtitle-2-font-family);font-weight:var(--igc-subtitle-2-font-weight);font-size:var(--igc-subtitle-2-font-size);font-style:var(--igc-subtitle-2-font-style);letter-spacing:var(--igc-subtitle-2-letter-spacing);text-transform:var(--igc-subtitle-2-text-transform);line-height:var(--igc-subtitle-2-line-height);margin-top:var(--igc-subtitle-2-margin-top);margin-bottom:var(--igc-subtitle-2-margin-bottom);white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow:hidden}:host([open]) [part~=content]{font-family:var(--igc-body-2-font-family);font-weight:var(--igc-body-2-font-weight);font-size:var(--igc-body-2-font-size);font-style:var(--igc-body-2-font-style);letter-spacing:var(--igc-body-2-letter-spacing);text-transform:var(--igc-body-2-text-transform);line-height:var(--igc-body-2-line-height);margin-top:var(--igc-body-2-margin-top);margin-bottom:var(--igc-body-2-margin-bottom);overflow:hidden;padding:calc(var(--igc-spacing-large)*2) calc(var(--igc-spacing-large)*3)}[part~=indicator]{color:hsla(var(--igc-gray-800), var(--igc-gray-a))}[part~=indicator] igc-icon{--size: 1.5rem}:host([indicator-position=start]) [part~=indicator]{-webkit-margin-end:calc(var(--igc-spacing-large)*2);margin-inline-end:calc(var(--igc-spacing-large)*2)}:host([indicator-position=end]) [part~=indicator]{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2;-webkit-margin-start:calc(var(--igc-spacing-large)*2);margin-inline-start:calc(var(--igc-spacing-large)*2)}:host([indicator-position=none]) [part~=indicator]{display:none}:host([disabled]){pointer-events:none}:host([disabled]) [part=title],:host([disabled]) [part=subtitle],:host([disabled]) [part~=indicator]{color:var(--disabled-color, hsla(var(--igc-gray-500), var(--igc-gray-a)))}`;
|
|
3
3
|
//# sourceMappingURL=expansion-panel.base.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expansion-panel.base.css.js","sourceRoot":"","sources":["../../../../../src/components/expansion-panel/themes/light/expansion-panel.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,
|
|
1
|
+
{"version":3,"file":"expansion-panel.base.css.js","sourceRoot":"","sources":["../../../../../src/components/expansion-panel/themes/light/expansion-panel.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,02GAA02G,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{--lines-clamped: 1;color:hsla(var(--igc-gray-900), var(--igc-gray-a));background:hsla(var(--igc-surface-500), var(--igc-surface-a));width:auto;overflow:hidden;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}[part=header]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;padding:calc(var(--igc-spacing-large)*2) calc(var(--igc-spacing-large)*3)}[part=header]:focus,[part=header]:active{outline:rgba(0,0,0,0);background:hsla(var(--igc-gray-100), var(--igc-gray-a))}[part=header] *:not([part~=indicator]){display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}[part=title]::slotted(*){font-family:var(--igc-h5-font-family);font-weight:var(--igc-h5-font-weight);font-size:var(--igc-h5-font-size);font-style:var(--igc-h5-font-style);letter-spacing:var(--igc-h5-letter-spacing);text-transform:var(--igc-h5-text-transform);line-height:var(--igc-h5-line-height);margin-top:var(--igc-h5-margin-top);margin-bottom:var(--igc-h5-margin-bottom);display:-webkit-inline-box;-webkit-line-clamp:var(--lines-clamped);-webkit-box-orient:vertical;overflow:hidden;margin:0}[part=subtitle]{color:hsla(var(--igc-gray-700), var(--igc-gray-a))}[part=subtitle]::slotted(*){font-family:var(--igc-subtitle-2-font-family);font-weight:var(--igc-subtitle-2-font-weight);font-size:var(--igc-subtitle-2-font-size);font-style:var(--igc-subtitle-2-font-style);letter-spacing:var(--igc-subtitle-2-letter-spacing);text-transform:var(--igc-subtitle-2-text-transform);line-height:var(--igc-subtitle-2-line-height);margin-top:var(--igc-subtitle-2-margin-top);margin-bottom:var(--igc-subtitle-2-margin-bottom);white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow:hidden}:host([open]) [part~=content]{font-family:var(--igc-body-2-font-family);font-weight:var(--igc-body-2-font-weight);font-size:var(--igc-body-2-font-size);font-style:var(--igc-body-2-font-style);letter-spacing:var(--igc-body-2-letter-spacing);text-transform:var(--igc-body-2-text-transform);line-height:var(--igc-body-2-line-height);margin-top:var(--igc-body-2-margin-top);margin-bottom:var(--igc-body-2-margin-bottom);overflow:hidden;padding:calc(var(--igc-spacing-large)*2) calc(var(--igc-spacing-large)*3)}[part~=indicator]{color:hsla(var(--igc-gray-800), var(--igc-gray-a))}[part~=indicator] igc-icon{--size: 1.5rem}:host([indicator-position=start]) [part~=indicator]{-webkit-margin-end:calc(var(--igc-spacing-large)*2);margin-inline-end:calc(var(--igc-spacing-large)*2)}:host([indicator-position=end]) [part~=indicator]{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2;-webkit-margin-start:calc(var(--igc-spacing-large)*2);margin-inline-start:calc(var(--igc-spacing-large)*2)}:host([indicator-position=none]) [part~=indicator]{display:none}:host([disabled]){pointer-events:none}:host([disabled]) [part=title],:host([disabled]) [part=subtitle],:host([disabled]) [part~=indicator]{color:var(--disabled-color, hsla(var(--igc-gray-500), var(--igc-gray-a)))}`;\n"]}
|
package/components/form/form.js
CHANGED
|
@@ -25,6 +25,7 @@ export default class IgcFormComponent extends EventEmitterMixin(LitElement) {
|
|
|
25
25
|
'igc-mask-input',
|
|
26
26
|
'textarea',
|
|
27
27
|
'igc-rating',
|
|
28
|
+
'igc-select',
|
|
28
29
|
'igc-date-time-input',
|
|
29
30
|
];
|
|
30
31
|
this._controlsThatSubmit = [
|
|
@@ -117,13 +118,13 @@ export default class IgcFormComponent extends EventEmitterMixin(LitElement) {
|
|
|
117
118
|
element.reportValidity() === false);
|
|
118
119
|
}
|
|
119
120
|
handleClick(event) {
|
|
120
|
-
var _a;
|
|
121
|
+
var _a, _b;
|
|
121
122
|
const targetElement = event.target;
|
|
122
123
|
if (this._controlsThatSubmit.includes(targetElement.tagName.toLowerCase()) &&
|
|
123
|
-
targetElement.type.toLowerCase() === 'submit') {
|
|
124
|
+
((_a = targetElement.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'submit') {
|
|
124
125
|
this.submit();
|
|
125
126
|
}
|
|
126
|
-
else if (((
|
|
127
|
+
else if (((_b = targetElement.type) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'reset') {
|
|
127
128
|
this.reset();
|
|
128
129
|
}
|
|
129
130
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../../src/components/form/form.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAA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AAC;6CA6B7B;AAsBD;IADC,cAAc,EAAE;mDA8BhB","sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { Constructor } from '../common/mixins/constructor.js';\nimport { alternateName } from '../common/decorators/alternateName.js';\nimport { blazorSuppress } from '../common/decorators/blazorSuppress.js';\n\nexport interface IgcFormEventMap {\n igcSubmit: CustomEvent<FormData>;\n igcReset: CustomEvent;\n}\n\n/**\n * The form is a component used to collect user input from\n * interactive controls.\n *\n * @element igc-form\n *\n * @slot - Default slot for the form.\n *\n * @fires igcSubmit - Emitted when the form is submitted.\n * @fires igcReset - Emitted when the form is reset.\n */\nexport default class IgcFormComponent extends EventEmitterMixin<\n IgcFormEventMap,\n Constructor<LitElement>\n>(LitElement) {\n public static readonly tagName = 'igc-form';\n\n public static styles = css`\n :host {\n display: block;\n }\n `;\n\n private _controlsWithChecked = [\n 'input',\n 'radio',\n 'igc-radio',\n 'igc-switch',\n 'igc-checkbox',\n ];\n private _controlsWithValue = [\n 'input',\n 'igc-input',\n 'igc-mask-input',\n 'textarea',\n 'igc-rating',\n 'igc-date-time-input',\n ];\n private _controlsThatSubmit = [\n 'input',\n 'button',\n 'igc-button',\n 'igc-icon-button',\n ];\n\n /** Specifies if form data validation should be skipped on submit. */\n @property({ type: Boolean, reflect: true }) public novalidate = false;\n\n constructor() {\n super();\n\n this.addEventListener('click', this.handleClick);\n }\n\n /** Submits the form. */\n @alternateName('performSubmit')\n public submit(): boolean {\n const formData = this.getFormData();\n if (!this.novalidate && !this.reportValidity()) {\n return false;\n }\n\n this.emitEvent('igcSubmit', { detail: formData });\n return true;\n }\n\n /** Resets the form. */\n @alternateName('performReset')\n public reset() {\n const formElements = this.getFormElements();\n formElements.forEach((element) => {\n const tagName = element.tagName.toLowerCase();\n if (tagName === 'select') {\n for (let i = 0; i < element.options.length; i++) {\n const option = element.options[i];\n option.selected = option.defaultSelected;\n }\n } else if (\n (tagName === 'input' &&\n (element.type === 'checkbox' || element.type == 'radio')) ||\n (tagName !== 'input' && this._controlsWithChecked.includes(tagName))\n ) {\n element.checked = element.hasAttribute('checked');\n } else if (\n tagName === 'igc-input' ||\n tagName === 'igc-rating' ||\n tagName === 'igc-mask-input' ||\n tagName === 'igc-date-time-input'\n ) {\n element.value = element.getAttribute('value');\n } else if (this._controlsWithValue.includes(tagName)) {\n element.value = element.defaultValue;\n }\n });\n\n this.emitEvent('igcReset');\n }\n\n private getFormElements(): any[] {\n const slot = this.shadowRoot?.querySelector('slot');\n const assignedElements = slot?.assignedElements({ flatten: true });\n const formElements: any[] = [];\n assignedElements?.forEach((element: any) => {\n if (!element.disabled) {\n formElements.push(element);\n }\n const children = Array.from(element.getElementsByTagName('*')).filter(\n (element: any) => !element.disabled\n );\n formElements.push(...children);\n });\n\n return formElements;\n }\n\n //suppressing in blazor for now due to an issue, bringing it back later\n /** Retrieves the data from the form in the format of a FormData object. */\n @blazorSuppress()\n public getFormData() {\n const formData = new FormData();\n\n const formElements = this.getFormElements();\n formElements.forEach((element) => {\n const tagName = element.tagName.toLowerCase();\n if (tagName === 'select') {\n for (let i = 0; i < element.options.length; i++) {\n const option = element.options[i];\n if (option.selected) {\n formData.append(element.name, option.value);\n }\n }\n } else if (\n this._controlsWithChecked.includes(tagName) &&\n element.checked\n ) {\n formData.append(element.name, element.value || 'on');\n } else if (\n this._controlsWithValue.includes(tagName) &&\n element.type !== 'checkbox' &&\n element.type !== 'radio' &&\n element.type !== 'submit'\n ) {\n formData.append(element.name, element.value);\n }\n });\n\n return formData;\n }\n\n /** Checks for validity of the form. */\n public reportValidity(): boolean {\n const formElements = this.getFormElements();\n return !formElements.some(\n (element) =>\n typeof element.reportValidity === 'function' &&\n element.reportValidity() === false\n );\n }\n\n private handleClick(event: MouseEvent) {\n const targetElement: any = event.target as HTMLElement;\n if (\n this._controlsThatSubmit.includes(targetElement.tagName.toLowerCase()) &&\n targetElement.type.toLowerCase() === 'submit'\n ) {\n this.submit();\n } else if (targetElement.type?.toLowerCase() === 'reset') {\n this.reset();\n }\n\n return true;\n }\n\n protected override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-form': IgcFormComponent;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../../src/components/form/form.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAkBxE,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,iBAAiB,CAG7D,UAAU,CAAC;IAmCX;QACE,KAAK,EAAE,CAAC;QA3BF,yBAAoB,GAAG;YAC7B,OAAO;YACP,OAAO;YACP,WAAW;YACX,YAAY;YACZ,cAAc;SACf,CAAC;QACM,uBAAkB,GAAG;YAC3B,OAAO;YACP,WAAW;YACX,gBAAgB;YAChB,UAAU;YACV,YAAY;YACZ,YAAY;YACZ,qBAAqB;SACtB,CAAC;QACM,wBAAmB,GAAG;YAC5B,OAAO;YACP,QAAQ;YACR,YAAY;YACZ,iBAAiB;SAClB,CAAC;QAGiD,eAAU,GAAG,KAAK,CAAC;QAKpE,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACnD,CAAC;IAIM,MAAM;QACX,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE;YAC9C,OAAO,KAAK,CAAC;SACd;Q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AAM,EAAE,CAAC;SACf;aAAM,IAAI,CAAA,MAAA,aAAa,CAAC,IAAI,0CAAE,WAAW,EAAE,MAAK,OAAO,EAAE;YACxD,IAAI,CAAC,KAAK,EAAE,CAAC;SACd;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;;AAjKsB,wBAAO,GAAG,UAAU,CAAC;AAE9B,uBAAM,GAAG,GAAG,CAAA;;;;GAIzB,CAAC;AA0B0C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAA2B;AAUtE;IADC,aAAa,CAAC,eAAe,CAAC;8CAS9B;AAID;IADC,aAAa,CAAC,cAAc,CAAC;6CA6B7B;AAsBD;IADC,cAAc,EAAE;mDA8BhB","sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { Constructor } from '../common/mixins/constructor.js';\nimport { alternateName } from '../common/decorators/alternateName.js';\nimport { blazorSuppress } from '../common/decorators/blazorSuppress.js';\n\nexport interface IgcFormEventMap {\n igcSubmit: CustomEvent<FormData>;\n igcReset: CustomEvent;\n}\n\n/**\n * The form is a component used to collect user input from\n * interactive controls.\n *\n * @element igc-form\n *\n * @slot - Default slot for the form.\n *\n * @fires igcSubmit - Emitted when the form is submitted.\n * @fires igcReset - Emitted when the form is reset.\n */\nexport default class IgcFormComponent extends EventEmitterMixin<\n IgcFormEventMap,\n Constructor<LitElement>\n>(LitElement) {\n public static readonly tagName = 'igc-form';\n\n public static styles = css`\n :host {\n display: block;\n }\n `;\n\n private _controlsWithChecked = [\n 'input',\n 'radio',\n 'igc-radio',\n 'igc-switch',\n 'igc-checkbox',\n ];\n private _controlsWithValue = [\n 'input',\n 'igc-input',\n 'igc-mask-input',\n 'textarea',\n 'igc-rating',\n 'igc-select',\n 'igc-date-time-input',\n ];\n private _controlsThatSubmit = [\n 'input',\n 'button',\n 'igc-button',\n 'igc-icon-button',\n ];\n\n /** Specifies if form data validation should be skipped on submit. */\n @property({ type: Boolean, reflect: true }) public novalidate = false;\n\n constructor() {\n super();\n\n this.addEventListener('click', this.handleClick);\n }\n\n /** Submits the form. */\n @alternateName('performSubmit')\n public submit(): boolean {\n const formData = this.getFormData();\n if (!this.novalidate && !this.reportValidity()) {\n return false;\n }\n\n this.emitEvent('igcSubmit', { detail: formData });\n return true;\n }\n\n /** Resets the form. */\n @alternateName('performReset')\n public reset() {\n const formElements = this.getFormElements();\n formElements.forEach((element) => {\n const tagName = element.tagName.toLowerCase();\n if (tagName === 'select') {\n for (let i = 0; i < element.options.length; i++) {\n const option = element.options[i];\n option.selected = option.defaultSelected;\n }\n } else if (\n (tagName === 'input' &&\n (element.type === 'checkbox' || element.type == 'radio')) ||\n (tagName !== 'input' && this._controlsWithChecked.includes(tagName))\n ) {\n element.checked = element.hasAttribute('checked');\n } else if (\n tagName === 'igc-input' ||\n tagName === 'igc-rating' ||\n tagName === 'igc-mask-input' ||\n tagName === 'igc-date-time-input'\n ) {\n element.value = element.getAttribute('value');\n } else if (this._controlsWithValue.includes(tagName)) {\n element.value = element.defaultValue;\n }\n });\n\n this.emitEvent('igcReset');\n }\n\n private getFormElements(): any[] {\n const slot = this.shadowRoot?.querySelector('slot');\n const assignedElements = slot?.assignedElements({ flatten: true });\n const formElements: any[] = [];\n assignedElements?.forEach((element: any) => {\n if (!element.disabled) {\n formElements.push(element);\n }\n const children = Array.from(element.getElementsByTagName('*')).filter(\n (element: any) => !element.disabled\n );\n formElements.push(...children);\n });\n\n return formElements;\n }\n\n //suppressing in blazor for now due to an issue, bringing it back later\n /** Retrieves the data from the form in the format of a FormData object. */\n @blazorSuppress()\n public getFormData() {\n const formData = new FormData();\n\n const formElements = this.getFormElements();\n formElements.forEach((element) => {\n const tagName = element.tagName.toLowerCase();\n if (tagName === 'select') {\n for (let i = 0; i < element.options.length; i++) {\n const option = element.options[i];\n if (option.selected) {\n formData.append(element.name, option.value);\n }\n }\n } else if (\n this._controlsWithChecked.includes(tagName) &&\n element.checked\n ) {\n formData.append(element.name, element.value || 'on');\n } else if (\n this._controlsWithValue.includes(tagName) &&\n element.type !== 'checkbox' &&\n element.type !== 'radio' &&\n element.type !== 'submit'\n ) {\n formData.append(element.name, element.value);\n }\n });\n\n return formData;\n }\n\n /** Checks for validity of the form. */\n public reportValidity(): boolean {\n const formElements = this.getFormElements();\n return !formElements.some(\n (element) =>\n typeof element.reportValidity === 'function' &&\n element.reportValidity() === false\n );\n }\n\n private handleClick(event: MouseEvent) {\n const targetElement: any = event.target as HTMLElement;\n if (\n this._controlsThatSubmit.includes(targetElement.tagName.toLowerCase()) &&\n targetElement.type?.toLowerCase() === 'submit'\n ) {\n this.submit();\n } else if (targetElement.type?.toLowerCase() === 'reset') {\n this.reset();\n }\n\n return true;\n }\n\n protected override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-form': IgcFormComponent;\n }\n}\n"]}
|
package/components/icon/icon.js
CHANGED
|
@@ -5,14 +5,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { html, LitElement } from 'lit';
|
|
8
|
-
import {
|
|
8
|
+
import { property, state } from 'lit/decorators.js';
|
|
9
9
|
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
10
10
|
import { alternateName } from '../common/decorators/alternateName.js';
|
|
11
11
|
import { blazorInclude } from '../common/decorators/blazorInclude.js';
|
|
12
12
|
import { SizableMixin } from '../common/mixins/sizable.js';
|
|
13
13
|
import { styles } from './icon.material.css.js';
|
|
14
14
|
import { IconsRegistry, registerIcon as registerIcon_impl, registerIconFromText as registerIconFromText_impl, } from './icon.registry.js';
|
|
15
|
-
|
|
15
|
+
export default class IgcIconComponent extends SizableMixin(LitElement) {
|
|
16
16
|
constructor() {
|
|
17
17
|
super();
|
|
18
18
|
this.svg = '';
|
|
@@ -46,7 +46,9 @@ let IgcIconComponent = class IgcIconComponent extends SizableMixin(LitElement) {
|
|
|
46
46
|
}
|
|
47
47
|
connectedCallback() {
|
|
48
48
|
super.connectedCallback();
|
|
49
|
-
this.
|
|
49
|
+
if (!this.hasAttribute('role')) {
|
|
50
|
+
this.setAttribute('role', 'img');
|
|
51
|
+
}
|
|
50
52
|
IconsRegistry.instance().subscribe(this.iconLoaded);
|
|
51
53
|
}
|
|
52
54
|
disconnectedCallback() {
|
|
@@ -68,7 +70,7 @@ let IgcIconComponent = class IgcIconComponent extends SizableMixin(LitElement) {
|
|
|
68
70
|
registerIconFromText(name, iconText, collection = 'default') {
|
|
69
71
|
registerIconFromText_impl(name, iconText, collection);
|
|
70
72
|
}
|
|
71
|
-
}
|
|
73
|
+
}
|
|
72
74
|
IgcIconComponent.tagName = 'igc-icon';
|
|
73
75
|
IgcIconComponent.styles = styles;
|
|
74
76
|
__decorate([
|
|
@@ -90,8 +92,4 @@ __decorate([
|
|
|
90
92
|
__decorate([
|
|
91
93
|
blazorInclude()
|
|
92
94
|
], IgcIconComponent.prototype, "registerIconFromText", null);
|
|
93
|
-
IgcIconComponent = __decorate([
|
|
94
|
-
customElement('igc-icon')
|
|
95
|
-
], IgcIconComponent);
|
|
96
|
-
export default IgcIconComponent;
|
|
97
95
|
//# sourceMappingURL=icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/components/icon/icon.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/components/icon/icon.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,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B,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IACxD,CAAC;;AAxGsB,wBAAO,GAAG,UAAU,CAAC;AAErB,uBAAM,GAAG,MAAM,CAAC;AAE9B;IAAR,KAAK,EAAE;6CAAkB;AAQ1B;IAFC,QAAQ,EAAE;IACV,aAAa,CAAC,UAAU,CAAC;4CAMzB;AAyBD;IADC,QAAQ,EAAE;kDAGV;AAMD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDACnB;AAuCxB;IADC,aAAa,EAAE;oDAOf;AAGD;IADC,aAAa,EAAE;4DAOf","sourcesContent":["import { html, LitElement } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js';\nimport { alternateName } from '../common/decorators/alternateName.js';\nimport { blazorInclude } from '../common/decorators/blazorInclude.js';\nimport { SizableMixin } from '../common/mixins/sizable.js';\nimport { styles } from './icon.material.css.js';\nimport {\n IconsRegistry,\n registerIcon as registerIcon_impl,\n registerIconFromText as registerIconFromText_impl,\n} from './icon.registry.js';\n\n/**\n * Icon component\n *\n * @element igc-icon\n *\n *\n */\nexport default class IgcIconComponent extends SizableMixin(LitElement) {\n public static readonly tagName = 'igc-icon';\n\n public static override styles = styles;\n\n @state() private svg = '';\n\n private _name = '';\n\n private _collection = 'default';\n\n @property()\n @alternateName('iconName')\n public set name(value: string) {\n if (this._name !== value) {\n this._name = value;\n this.getIcon();\n }\n }\n\n /**\n * The name of the icon glyph to draw.\n *\n * @attr [name=\"\"]\n */\n public get name(): string {\n return this._name;\n }\n\n public set collection(value: string) {\n if (this._collection !== value) {\n this._collection = value;\n this.getIcon();\n }\n }\n\n /**\n * The name of the registered collection for look up of icons.\n * Defaults to `default`.\n *\n * @attr [collection=default]\n */\n @property()\n public get collection(): string {\n return this._collection;\n }\n\n /**\n * Whether to flip the icon. Useful for RTL layouts.\n */\n @property({ type: Boolean, reflect: true })\n public mirrored = false;\n\n constructor() {\n super();\n this.size = 'medium';\n }\n\n public override connectedCallback() {\n super.connectedCallback();\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'img');\n }\n IconsRegistry.instance().subscribe(this.iconLoaded);\n }\n\n public override disconnectedCallback() {\n super.disconnectedCallback();\n IconsRegistry.instance().unsubscribe(this.iconLoaded);\n }\n\n private iconLoaded = (name: string, collection: string) => {\n if (this.name === name && this.collection === collection) {\n this.getIcon();\n }\n };\n\n private getIcon() {\n const svg =\n this._name && this._collection\n ? IconsRegistry.instance().getIcon(this._name, this._collection)\n : '';\n this.svg = svg ?? '';\n }\n\n protected override render() {\n return html` ${unsafeSVG(this.svg)} `;\n }\n\n @blazorInclude()\n protected async registerIcon(\n name: string,\n url: string,\n collection = 'default'\n ) {\n await registerIcon_impl(name, url, collection);\n }\n\n @blazorInclude()\n protected registerIconFromText(\n name: string,\n iconText: string,\n collection = 'default'\n ) {\n registerIconFromText_impl(name, iconText, collection);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-icon': IgcIconComponent;\n }\n}\n"]}
|
|
@@ -71,5 +71,7 @@ const internalIcons = {
|
|
|
71
71
|
keyboard_arrow_right: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"/></svg>`,
|
|
72
72
|
chip_cancel: `<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>`,
|
|
73
73
|
chip_select: `<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>`,
|
|
74
|
+
star: `<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M0 0h24v24H0z" fill="none"/><path d="M0 0h24v24H0z" fill="none"/><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>`,
|
|
75
|
+
star_border: `<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M0 0h24v24H0z" fill="none"/><path d="M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"/></svg>`,
|
|
74
76
|
};
|
|
75
77
|
//# sourceMappingURL=icon.registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.registry.js","sourceRoot":"","sources":["../../../src/components/icon/icon.registry.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,aAAa;IAcxB;QAHQ,kBAAa,GAAG,IAAI,GAAG,EAA0B,CAAC;QAClD,cAAS,GAAG,IAAI,GAAG,EAA8C,CAAC;QAGxE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IACpD,CAAC;IAbM,MAAM,CAAC,QAAQ;QACpB,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE;YAC5B,aAAa,CAAC,SAAS,GAAG,IAAI,aAAa,EAAE,CAAC;SAC/C;QAED,OAAO,aAAa,CAAC,SAAS,CAAC;IACjC,CAAC;IASM,SAAS,CAAC,QAAoD;QACnE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ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AS,EACtB,EAAE;IACF,aAAa,CAAC,QAAQ,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;AACpE,CAAC,CAAC;AAEF,MAAM,aAAa,GAAmB;IACpC,eAAe,EAAE,gLAAgL;IACjM,aAAa,EAAE,+KAA+K;IAC9L,iBAAiB,EAAE,mKAAmK;IACtL,mBAAmB,EAAE,8KAA8K;IACnM,oBAAoB,EAAE,6KAA6K;IACnM,WAAW,EAAE,2TAA2T;IACxU,WAAW,EAAE,6LAA6L;IAC1M,IAAI,EAAE,6QAA6Q;IACnR,WAAW,EAAE,gVAAgV;CAC9V,CAAC","sourcesContent":["interface IconCollection {\n [name: string]: string;\n}\n\nexport class IconsRegistry {\n private static _instance: IconsRegistry;\n\n public static instance() {\n if (!IconsRegistry._instance) {\n IconsRegistry._instance = new IconsRegistry();\n }\n\n return IconsRegistry._instance;\n }\n\n private iconsRegistry = new Map<string, IconCollection>();\n private callbacks = new Set<(name: string, collection: string) => void>();\n\n constructor() {\n this.iconsRegistry.set('internal', internalIcons);\n }\n\n public subscribe(callback: (name: string, collection: string) => void) {\n this.callbacks.add(callback);\n }\n\n public unsubscribe(callback: (name: string, collection: string) => void) {\n this.callbacks.delete(callback);\n }\n\n public registerIcon(name: string, iconText: string, collection = 'default') {\n const div = document.createElement('div');\n div.innerHTML = iconText;\n const svg = div.querySelector('svg') as SVGElement;\n\n if (svg) {\n svg.setAttribute('fit', '');\n svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');\n const svgText = svg.outerHTML;\n\n const collectionRegistry = this.getOrCreateIconCollection(collection);\n collectionRegistry[name] = svgText;\n this.callbacks.forEach((c) => c(name, collection));\n } else {\n throw new Error('SVG element not found.');\n }\n }\n\n public getIcon(name: string, collection = 'default') {\n if (this.iconsRegistry.has(collection)) {\n return this.iconsRegistry.get(collection)![name];\n }\n\n return undefined;\n }\n\n private getOrCreateIconCollection(name: string) {\n let collection: IconCollection;\n\n if (this.iconsRegistry.has(name)) {\n collection = this.iconsRegistry.get(name)!;\n } else {\n collection = {};\n this.iconsRegistry.set(name, collection);\n }\n\n return collection;\n }\n}\n\nexport const registerIcon = async (\n name: string,\n url: string,\n collection = 'default'\n) => {\n const response = await fetch(url);\n\n if (response.ok) {\n const value = await response.text();\n IconsRegistry.instance().registerIcon(name, value, collection);\n } else {\n throw new Error(`Icon request failed. Status: ${response.status}.`);\n }\n};\n\nexport const registerIconFromText = (\n name: string,\n iconText: string,\n collection = 'default'\n) => {\n IconsRegistry.instance().registerIcon(name, iconText, collection);\n};\n\nconst internalIcons: IconCollection = {\n navigate_before: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M15.61 7.41L14.2 6l-6 6 6 6 1.41-1.41L11.03 12l4.58-4.59z\"/></svg>`,\n navigate_next: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M10.02 6L8.61 7.41 13.19 12l-4.58 4.59L10.02 18l6-6-6-6z\"/></svg>`,\n keyboard_arrow_up: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z\"/></svg>`,\n keyboard_arrow_down: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z\"/></svg>`,\n keyboard_arrow_right: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z\"/></svg>`,\n chip_cancel: `<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z\"/></svg>`,\n chip_select: `<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\"/></svg>`,\n star: `<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z\"/></svg>`,\n star_border: `<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z\"/></svg>`,\n};\n"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { LitElement, TemplateResult } from 'lit';
|
|
2
2
|
import type { ReactiveTheme, ThemeController } from '../../theming/types.js';
|
|
3
3
|
import { Constructor } from '../common/mixins/constructor.js';
|
|
4
|
+
import { Direction } from '../common/types.js';
|
|
4
5
|
export interface IgcInputEventMap {
|
|
5
6
|
igcInput: CustomEvent<string>;
|
|
6
7
|
igcChange: CustomEvent<string>;
|
|
7
8
|
igcFocus: CustomEvent<void>;
|
|
8
9
|
igcBlur: CustomEvent<void>;
|
|
9
10
|
}
|
|
10
|
-
declare type Direction = 'ltr' | 'rtl' | 'auto';
|
|
11
11
|
declare const IgcInputBaseComponent_base: Constructor<import("../common/mixins/sizable.js").SizableInterface> & import("../common/mixins/constructor.js").AbstractConstructor<import("../common/mixins/event-emitter.js").EventEmitterInterface<IgcInputEventMap>> & Constructor<LitElement>;
|
|
12
12
|
export declare abstract class IgcInputBaseComponent extends IgcInputBaseComponent_base implements ReactiveTheme {
|
|
13
13
|
protected static shadowRootOptions: {
|
|
@@ -16,6 +16,7 @@ export declare abstract class IgcInputBaseComponent extends IgcInputBaseComponen
|
|
|
16
16
|
slotAssignment?: SlotAssignmentMode | undefined;
|
|
17
17
|
};
|
|
18
18
|
static styles: import("lit").CSSResult;
|
|
19
|
+
private static readonly increment;
|
|
19
20
|
protected inputId: string;
|
|
20
21
|
/** The value attribute of the control. */
|
|
21
22
|
abstract value: string | Date | null;
|
|
@@ -4,24 +4,25 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
var IgcInputBaseComponent_1;
|
|
7
8
|
import { html, LitElement, nothing } from 'lit';
|
|
8
9
|
import { property, query, queryAssignedElements } from 'lit/decorators.js';
|
|
9
10
|
import { themes } from '../../theming/theming-decorator.js';
|
|
10
11
|
import { alternateName } from '../common/decorators/alternateName.js';
|
|
12
|
+
import { blazorDeepImport } from '../common/decorators/blazorDeepImport.js';
|
|
11
13
|
import { blazorSuppress } from '../common/decorators/blazorSuppress.js';
|
|
12
14
|
import { EventEmitterMixin } from '../common/mixins/event-emitter.js';
|
|
13
15
|
import { SizableMixin } from '../common/mixins/sizable.js';
|
|
14
|
-
import { partNameMap } from '../common/util.js';
|
|
16
|
+
import { createCounter, partNameMap } from '../common/util.js';
|
|
15
17
|
import { styles } from './themes/light/input.base.css.js';
|
|
16
18
|
import { styles as bootstrap } from './themes/light/input.bootstrap.css.js';
|
|
17
19
|
import { styles as fluent } from './themes/light/input.fluent.css.js';
|
|
18
20
|
import { styles as indigo } from './themes/light/input.indigo.css.js';
|
|
19
21
|
import { styles as material } from './themes/light/input.material.css.js';
|
|
20
|
-
let
|
|
21
|
-
let IgcInputBaseComponent = class IgcInputBaseComponent extends SizableMixin(EventEmitterMixin(LitElement)) {
|
|
22
|
+
let IgcInputBaseComponent = IgcInputBaseComponent_1 = class IgcInputBaseComponent extends SizableMixin(EventEmitterMixin(LitElement)) {
|
|
22
23
|
constructor() {
|
|
23
24
|
super();
|
|
24
|
-
this.inputId = `input-${
|
|
25
|
+
this.inputId = `input-${IgcInputBaseComponent_1.increment()}`;
|
|
25
26
|
this.dir = 'auto';
|
|
26
27
|
this.outlined = false;
|
|
27
28
|
this.required = false;
|
|
@@ -116,6 +117,7 @@ IgcInputBaseComponent.shadowRootOptions = {
|
|
|
116
117
|
delegatesFocus: true,
|
|
117
118
|
};
|
|
118
119
|
IgcInputBaseComponent.styles = styles;
|
|
120
|
+
IgcInputBaseComponent.increment = createCounter();
|
|
119
121
|
__decorate([
|
|
120
122
|
blazorSuppress()
|
|
121
123
|
], IgcInputBaseComponent.prototype, "value", void 0);
|
|
@@ -162,8 +164,9 @@ __decorate([
|
|
|
162
164
|
__decorate([
|
|
163
165
|
alternateName('blurComponent')
|
|
164
166
|
], IgcInputBaseComponent.prototype, "blur", null);
|
|
165
|
-
IgcInputBaseComponent = __decorate([
|
|
166
|
-
themes({ bootstrap, material, fluent, indigo })
|
|
167
|
+
IgcInputBaseComponent = IgcInputBaseComponent_1 = __decorate([
|
|
168
|
+
themes({ bootstrap, material, fluent, indigo }),
|
|
169
|
+
blazorDeepImport
|
|
167
170
|
], IgcInputBaseComponent);
|
|
168
171
|
export { IgcInputBaseComponent };
|
|
169
172
|
//# sourceMappingURL=input-base.js.map
|
|
@@ -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,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAExE,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,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,MAAM,IAAI,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAE1E,IAAI,MAAM,GAAG,CAAC,CAAC;AAcf,IAAsB,qBAAqB,GAA3C,MAAsB,qBACpB,SAAQ,YAAY,CAClB,iBAAiB,CAA4C,UAAU,CAAC,CACzE;IA6DD;QACE,KAAK,EAAE,CAAC;QArDA,YAAO,GAAG,SAAS,MAAM,EAAE,EAAE,CAAC;QAuBxB,QAA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D1C,MAAM,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;GAC1B,qBAAqB,CA0L1C;SA1LqB,qBAAqB","sourcesContent":["import { html, LitElement, nothing, TemplateResult } from 'lit';\nimport { property, query, queryAssignedElements } from 'lit/decorators.js';\nimport { themes } from '../../theming/theming-decorator.js';\nimport type { ReactiveTheme, ThemeController } from '../../theming/types.js';\nimport { alternateName } from '../common/decorators/alternateName.js';\nimport { blazorSuppress } from '../common/decorators/blazorSuppress.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.js';\nimport { styles as bootstrap } from './themes/light/input.bootstrap.css.js';\nimport { styles as fluent } from './themes/light/input.fluent.css.js';\nimport { styles as indigo } from './themes/light/input.indigo.css.js';\nimport { styles as material } from './themes/light/input.material.css.js';\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\ntype Direction = 'ltr' | 'rtl' | 'auto';\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 @blazorSuppress()\n public abstract value: string | Date | null;\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 @queryAssignedElements({ slot: 'helper-text' })\n protected helperText!: Array<HTMLElement>;\n\n protected themeController!: ThemeController;\n\n /** The direction attribute of the control. */\n @property({ reflect: true })\n @blazorSuppress()\n public override dir: Direction = 'auto';\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\" .hidden=\"${this.helperText.length == 0}\">\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\" .hidden=\"${this.helperText.length == 0}\">\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"]}
|
|
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,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,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AAI,EAAE,aAAa,EAAE,CAAC;yDACL;AAO1C;IAFC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,cAAc,EAAE;kDACuB;AAIxC;IADC,QAAQ,EAAE;mDACU;AAGrB;IADC,QAAQ,CAAC,EAAE,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,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;AAzFmB,qBAAqB;IAF1C,MAAM,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC/C,gBAAgB;GACK,qBAAqB,CA2L1C;SA3LqB,qBAAqB","sourcesContent":["import { html, LitElement, nothing, TemplateResult } from 'lit';\nimport { property, query, queryAssignedElements } from 'lit/decorators.js';\nimport { themes } from '../../theming/theming-decorator.js';\nimport type { ReactiveTheme, ThemeController } from '../../theming/types.js';\nimport { alternateName } from '../common/decorators/alternateName.js';\nimport { blazorDeepImport } from '../common/decorators/blazorDeepImport.js';\nimport { blazorSuppress } from '../common/decorators/blazorSuppress.js';\nimport { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { SizableMixin } from '../common/mixins/sizable.js';\nimport { Direction } from '../common/types.js';\nimport { createCounter, partNameMap } from '../common/util.js';\nimport { styles } from './themes/light/input.base.css.js';\nimport { styles as bootstrap } from './themes/light/input.bootstrap.css.js';\nimport { styles as fluent } from './themes/light/input.fluent.css.js';\nimport { styles as indigo } from './themes/light/input.indigo.css.js';\nimport { styles as material } from './themes/light/input.material.css.js';\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 })\n@blazorDeepImport\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 private static readonly increment = createCounter();\n\n protected inputId = `input-${IgcInputBaseComponent.increment()}`;\n\n /** The value attribute of the control. */\n @blazorSuppress()\n public abstract value: string | Date | null;\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 @queryAssignedElements({ slot: 'helper-text' })\n protected helperText!: Array<HTMLElement>;\n\n protected themeController!: ThemeController;\n\n /** The direction attribute of the control. */\n @property({ reflect: true })\n @blazorSuppress()\n public override dir: Direction = 'auto';\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\" .hidden=\"${this.helperText.length == 0}\">\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\" .hidden=\"${this.helperText.length == 0}\">\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"]}
|
|
@@ -43,6 +43,7 @@ export default class IgcInputComponent extends IgcInputBaseComponent {
|
|
|
43
43
|
autofocus: boolean;
|
|
44
44
|
/** The autocomplete attribute of the control. */
|
|
45
45
|
autocomplete: string;
|
|
46
|
+
tabIndex: number;
|
|
46
47
|
/** Checks for validity of the control and shows the browser message if it's invalid. */
|
|
47
48
|
reportValidity(): boolean;
|
|
48
49
|
/** Replaces the selected text in the input. */
|
|
@@ -20,6 +20,7 @@ export default class IgcInputComponent extends IgcInputBaseComponent {
|
|
|
20
20
|
this.value = '';
|
|
21
21
|
this.type = 'text';
|
|
22
22
|
this.invalid = false;
|
|
23
|
+
this.tabIndex = 0;
|
|
23
24
|
}
|
|
24
25
|
reportValidity() {
|
|
25
26
|
return this.input.reportValidity();
|
|
@@ -71,6 +72,7 @@ export default class IgcInputComponent extends IgcInputBaseComponent {
|
|
|
71
72
|
?disabled="${this.disabled}"
|
|
72
73
|
?required="${this.required}"
|
|
73
74
|
?autofocus="${this.autofocus}"
|
|
75
|
+
tabindex=${this.tabIndex}
|
|
74
76
|
autocomplete="${ifDefined(this.autocomplete)}"
|
|
75
77
|
inputmode="${ifDefined(this.inputmode)}"
|
|
76
78
|
min="${ifDefined(this.min)}"
|
|
@@ -127,6 +129,9 @@ __decorate([
|
|
|
127
129
|
__decorate([
|
|
128
130
|
property()
|
|
129
131
|
], IgcInputComponent.prototype, "autocomplete", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
property({ type: Number })
|
|
134
|
+
], IgcInputComponent.prototype, "tabIndex", void 0);
|
|
130
135
|
__decorate([
|
|
131
136
|
blazorSuppress()
|
|
132
137
|
], IgcInputComponent.prototype, "setRangeText", null);
|
|
@@ -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,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAqBxD,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,qBAAqB;IAApE;;QAKS,UAAK,GAAG,EAAE,CAAC;QAKX,SAAI,GAOC,MAAM,CAAC;QAoBZ,YAAO,GAAG,KAAK,CAAC;
|
|
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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AAE,MAAM,EAAE,CAAC;+CACN;AAIrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACQ;AAIpC;IADC,QAAQ,EAAE;uDACkB;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDACE;AAS7B;IADC,cAAc,EAAE;qDAShB;AA2CD;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 } from '../common/decorators/alternateName.js';\nimport { blazorSuppress } from '../common/decorators/blazorSuppress.js';\nimport { blazorTwoWayBind } from '../common/decorators/blazorTwoWayBind.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { partNameMap } from '../common/util.js';\nimport { IgcInputBaseComponent } from './input-base.js';\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 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 @property({ type: Number })\n public override tabIndex = 0;\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 @blazorSuppress()\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 private handleChange() {\n this.value = this.input.value;\n this.emitEvent('igcChange', { 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 tabindex=${this.tabIndex}\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{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;scrollbar-width:var(--scrolbar-size, 0.875rem);scrollbar-color:var(--igc-scrollbar-thumb-color, hsla(var(--igc-gray-400), var(--igc-gray-a))) var(--igc-scrollbar-track-color, hsla(var(--igc-gray-200), var(--igc-gray-a)))}:host *,:host *::before,:host *::after{-webkit-box-sizing:border-box;box-sizing:border-box}:host ::-webkit-scrollbar{width:var(--scrolbar-size, 0.875rem);height:var(--scrolbar-size, 0.875rem);background:var(--igc-scrollbar-track-color, hsla(var(--igc-gray-200), var(--igc-gray-a)))}:host ::-webkit-scrollbar-thumb{background:var(--igc-scrollbar-thumb-color, hsla(var(--igc-gray-400), var(--igc-gray-a)))}[hidden]{display:none !important}[part~=suffixed] [part=suffix],[part~=prefixed] [part=prefix]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;color:hsla(var(--igc-gray-700), var(--igc-gray-a))}:host{position:relative;display:block;font-family:var(--igc-font-family);outline-style:none}[part=label]{display:inline-block;white-space:nowrap}[part~=input]{width:100%;height:100%;border:none;outline-style:none;color:
|
|
2
|
+
export const styles = css `:host{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;scrollbar-width:var(--scrolbar-size, 0.875rem);scrollbar-color:var(--igc-scrollbar-thumb-color, hsla(var(--igc-gray-400), var(--igc-gray-a))) var(--igc-scrollbar-track-color, hsla(var(--igc-gray-200), var(--igc-gray-a)))}:host *,:host *::before,:host *::after{-webkit-box-sizing:border-box;box-sizing:border-box}:host ::-webkit-scrollbar{width:var(--scrolbar-size, 0.875rem);height:var(--scrolbar-size, 0.875rem);background:var(--igc-scrollbar-track-color, hsla(var(--igc-gray-200), var(--igc-gray-a)))}:host ::-webkit-scrollbar-thumb{background:var(--igc-scrollbar-thumb-color, hsla(var(--igc-gray-400), var(--igc-gray-a)))}[hidden]{display:none !important}[part~=suffixed] [part=suffix],[part~=prefixed] [part=prefix]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;color:hsla(var(--igc-gray-700), var(--igc-gray-a))}:host{position:relative;display:block;font-family:var(--igc-font-family);outline-style:none}[part=label]{display:inline-block;white-space:nowrap}[part~=input]{width:100%;height:100%;border:none;outline-style:none;color:inherit;font-family:var(--igc-font-family);z-index:1}[part^=container]{position:relative;display:grid;color:hsla(var(--igc-gray-900), var(--igc-gray-a))}[part=prefix],[part=suffix]{display:none;overflow:hidden}:host([required]) [part=label]::after{content:"*"}[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)}:host([size=large]) [part~=input],:host([size=large]) [part~=container]{height:3.5rem}:host([size=medium]) [part~=input],:host([size=medium]) [part~=container]{height:3rem}:host([size=small]) [part~=input],:host([size=small]) [part~=container]{height:2.5rem}`;
|
|
3
3
|
//# sourceMappingURL=input.base.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.base.css.js","sourceRoot":"","sources":["../../../../../src/components/input/themes/light/input.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,
|
|
1
|
+
{"version":3,"file":"input.base.css.js","sourceRoot":"","sources":["../../../../../src/components/input/themes/light/input.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,mlEAAmlE,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;scrollbar-width:var(--scrolbar-size, 0.875rem);scrollbar-color:var(--igc-scrollbar-thumb-color, hsla(var(--igc-gray-400), var(--igc-gray-a))) var(--igc-scrollbar-track-color, hsla(var(--igc-gray-200), var(--igc-gray-a)))}:host *,:host *::before,:host *::after{-webkit-box-sizing:border-box;box-sizing:border-box}:host ::-webkit-scrollbar{width:var(--scrolbar-size, 0.875rem);height:var(--scrolbar-size, 0.875rem);background:var(--igc-scrollbar-track-color, hsla(var(--igc-gray-200), var(--igc-gray-a)))}:host ::-webkit-scrollbar-thumb{background:var(--igc-scrollbar-thumb-color, hsla(var(--igc-gray-400), var(--igc-gray-a)))}[hidden]{display:none !important}[part~=suffixed] [part=suffix],[part~=prefixed] [part=prefix]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;color:hsla(var(--igc-gray-700), var(--igc-gray-a))}:host{position:relative;display:block;font-family:var(--igc-font-family);outline-style:none}[part=label]{display:inline-block;white-space:nowrap}[part~=input]{width:100%;height:100%;border:none;outline-style:none;color:inherit;font-family:var(--igc-font-family);z-index:1}[part^=container]{position:relative;display:grid;color:hsla(var(--igc-gray-900), var(--igc-gray-a))}[part=prefix],[part=suffix]{display:none;overflow:hidden}:host([required]) [part=label]::after{content:\"*\"}[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)}:host([size=large]) [part~=input],:host([size=large]) [part~=container]{height:3.5rem}:host([size=medium]) [part~=input],:host([size=medium]) [part~=container]{height:3rem}:host([size=small]) [part~=input],:host([size=small]) [part~=container]{height:2.5rem}`;\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `:host::after{background:none}:host [part~=
|
|
2
|
+
export const styles = css `:host::after{background:none}:host [part~=container]{border-radius:clamp(0rem,var(--igc-radius-factor)*.25rem,.25rem);border-style:none;grid-template-columns:auto 1fr auto;background:var(--input-background, #fff)}:host [part~=container]::after{display:none}:host [part~=input]{border-radius:clamp(0rem,var(--igc-radius-factor)*.25rem,.25rem);padding:initial;background:inherit;-webkit-box-shadow:0 0 0 0 rgba(0,0,0,0);box-shadow:0 0 0 0 rgba(0,0,0,0);z-index:1;border:1px solid hsla(var(--igc-gray-400), var(--igc-gray-a));-webkit-transition:border .15s ease-out,-webkit-box-shadow .15s ease-out;transition:border .15s ease-out,-webkit-box-shadow .15s ease-out;-o-transition:box-shadow .15s ease-out,border .15s ease-out;transition:box-shadow .15s ease-out,border .15s ease-out;transition:box-shadow .15s ease-out,border .15s ease-out,-webkit-box-shadow .15s ease-out;grid-area:1/2}:host [part*="input prefixed"]{border-start-start-radius:0;border-end-start-radius:0}:host [part*="input suffixed"]{border-start-end-radius:0;border-end-end-radius:0}:host [part*="input prefixed suffixed"]{border-radius:0}:host label{line-height:1.5rem;margin-bottom:.25rem;color:hsla(var(--igc-gray-700), var(--igc-gray-a))}:host label:empty{display:none}:host [part=prefix],:host [part=suffix]{position:relative;padding:rem(16px);border-radius:none;min-width:auto;color:hsla(var(--igc-gray-800), var(--igc-gray-a));background:hsla(var(--igc-gray-300), var(--igc-gray-a));-webkit-transition:border .15s ease-out,-webkit-box-shadow .15s ease-out;transition:border .15s ease-out,-webkit-box-shadow .15s ease-out;-o-transition:box-shadow .15s ease-out,border .15s ease-out;transition:box-shadow .15s ease-out,border .15s ease-out;transition:box-shadow .15s ease-out,border .15s ease-out,-webkit-box-shadow .15s ease-out}:host [part=prefix]:focus-within,:host [part=suffix]:focus-within{-webkit-box-shadow:0 0 0 .25rem hsla(var(--igc-gray-300), 0.38);box-shadow:0 0 0 .25rem hsla(var(--igc-gray-300), 0.38)}:host [part=prefix]{grid-area:1/1;border-style:solid;border-color:hsla(var(--igc-gray-400), var(--igc-gray-a));border-inline-start-width:1px;border-inline-end-width:0;border-block-start-width:1px;border-block-end-width:1px;border-start-start-radius:.25rem;border-end-start-radius:.25rem}:host [part=suffix]{grid-area:1/3;border-style:solid;border-color:hsla(var(--igc-gray-400), var(--igc-gray-a));border-inline-start-width:0;border-inline-end-width:1px;border-block-start-width:1px;border-block-end-width:1px;border-start-end-radius:.25rem;border-end-end-radius:.25rem}:host [part=helper-text]{font-family:var(--igc-body-2-font-family);font-weight:var(--igc-body-2-font-weight);font-size:var(--igc-body-2-font-size);font-style:var(--igc-body-2-font-style);letter-spacing:var(--igc-body-2-letter-spacing);text-transform:var(--igc-body-2-text-transform);line-height:var(--igc-body-2-line-height);margin-top:var(--igc-body-2-margin-top);margin-bottom:var(--igc-body-2-margin-bottom);margin-top:rem(4px);color:hsla(var(--igc-gray-700), var(--igc-gray-a))}:host([size=large]) [part~=container],:host([size=large]) [part~=input]{height:3rem}:host([size=large]) [part~=input]{font-size:1.25rem;padding:.5rem 1rem}:host([size=large]) [part=prefix],:host([size=large]) [part=suffix]{font-size:rem(20px);padding:.5rem 1rem}:host([size=medium]) [part~=container],:host([size=medium]) [part~=input]{height:2.375rem}:host([size=medium]) [part~=input]{font-size:1rem;padding:.375rem .75rem}:host([size=medium]) [part=prefix],:host([size=medium]) [part=suffix]{font-size:1rem;padding:.375rem .75rem}:host([size=small]) [part~=container],:host([size=small]) [part~=input]{height:1.9375rem}:host([size=small]) [part~=input]{font-size:1rem;padding:.25rem .5rem}:host([size=small]) [part=prefix],:host([size=small]) [part=suffix]{font-size:.875rem;padding:.25rem .5rem}:host(:focus-within) [part~=input]{-webkit-box-shadow:0 0 0 .25rem hsla(var(--igc-primary-500), 0.38);box-shadow:0 0 0 .25rem hsla(var(--igc-primary-500), 0.38);border-color:hsla(var(--igc-primary-500), var(--igc-primary-a))}:host([invalid]:focus-within) [part~=input]{-webkit-box-shadow:0 0 0 .25rem hsla(var(--igc-error-500), 0.38);box-shadow:0 0 0 .25rem hsla(var(--igc-error-500), 0.38);border-color:hsla(var(--igc-error-500), var(--igc-error-a))}:host([disabled]) [part=prefix],:host([disabled]) [part=suffix],:host([disabled]) [part~=container],:host([readonly]) [part=prefix],:host([readonly]) [part=suffix],:host([readonly]) [part~=container]{background:hsla(var(--igc-gray-100), var(--igc-gray-a));color:hsla(var(--igc-gray-400), var(--igc-gray-a))}:host([disabled]) [part~=input],:host([readonly]) [part~=input]{border-color:hsla(var(--igc-gray-300), var(--igc-gray-a))}:host([readonly]) [part=prefix],:host([readonly]) [part=suffix],:host([readonly]) [part~=container]{color:hsla(var(--igc-gray-800), var(--igc-gray-a))}:host(:focus-within[readonly]) [part~=input]{-webkit-box-shadow:0 0 0 .25rem hsla(var(--igc-gray-400), 0.38);box-shadow:0 0 0 .25rem hsla(var(--igc-gray-400), 0.38);border-color:hsla(var(--igc-gray-400), var(--igc-gray-a))}`;
|
|
3
3
|
//# sourceMappingURL=input.bootstrap.css.js.map
|