{ "version": 3, "sources": ["src/app/shared/ui/icon/icon.component.ts", "src/app/shared/ui/icon/icon.component.html", "src/app/shared/ui/button/button.component.ts", "src/app/shared/ui/button/button.component.html"], "sourcesContent": ["import { DOCUMENT } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Inject,\n Input,\n Optional,\n ViewChild,\n} from '@angular/core';\nimport { getIconSize, neverError } from '@lis-helpers';\nimport { IconsRegistry } from '@lis-services';\nimport { LIS_ICON_SIZE_DEFAULT, LisIcon, LisIconSize } from '@lis-types';\n\n@Component({\n selector: 'lis-icon',\n templateUrl: './icon.component.html',\n styleUrls: ['./icon.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class IconComponent {\n private svgIcon?: SVGElement;\n // @Input() size?: LisIconSize;\n @ViewChild('iconContainer', { static: true })\n iconContainer?: ElementRef;\n\n private _size: LisIconSize = LIS_ICON_SIZE_DEFAULT;\n\n @Input({ required: true })\n set name(iconName: LisIcon) {\n if (this.svgIcon) {\n this.element.nativeElement.removeChild(this.svgIcon);\n }\n\n const svgData = this.iconRegistry.getIcon(iconName);\n\n if (!svgData) {\n console.warn(`no svg for \"${iconName}\"`);\n return;\n }\n\n this._size = this.getIconSize(iconName);\n this.svgIcon = this.svgElementFromString(svgData);\n\n if (this.iconContainer) {\n this.iconContainer.nativeElement.appendChild(this.svgIcon);\n } else {\n // this.iconContainer is not available yet\n // but after timeout it should be available\n setTimeout(() => {\n if (this.iconContainer && this.svgIcon) {\n this.iconContainer.nativeElement.appendChild(this.svgIcon);\n this.cdRef.markForCheck();\n }\n });\n }\n }\n\n constructor(\n private element: ElementRef,\n private iconRegistry: IconsRegistry,\n private cdRef: ChangeDetectorRef,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Optional() @Inject(DOCUMENT) private document: any\n ) {}\n\n private svgElementFromString(svgContent: string): SVGElement {\n const div = this.document.createElement('DIV');\n div.innerHTML = svgContent;\n return (\n div.querySelector('svg') ||\n this.document.createElementNS('http://www.w3.org/2000/svg', 'path')\n );\n }\n public getIconSizeClasses(): string[] {\n const classes = [];\n switch (this._size) {\n case 18:\n classes.push('w-4.5', 'h-4.5');\n break;\n case 20:\n classes.push('w-5', 'h-5');\n break;\n case 24:\n classes.push('w-6', 'h-6');\n break;\n case 40:\n classes.push('w-10', 'h-10');\n break;\n default:\n throw neverError(this._size);\n }\n\n return classes;\n }\n\n private getIconSize(name: LisIcon): LisIconSize {\n return getIconSize(name);\n }\n}\n", "
\n", "import { Component, HostBinding, Input } from '@angular/core';\nimport {\n LisButtonSize,\n LisButtonVariant,\n LisIcon,\n LisIconSize,\n} from '@lis-types';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'button[lis-button], a[lis-button]',\n templateUrl: './button.component.html',\n styleUrls: ['./button.component.scss'],\n})\nexport class ButtonComponent {\n @Input() variant: LisButtonVariant = 'flat';\n @Input() isRound = false;\n @Input() icon?: LisIcon;\n @Input() iconRight?: LisIcon;\n @Input() iconSize: LisIconSize = 24;\n @Input() size: LisButtonSize = 'M';\n @Input() loading = false;\n\n @HostBinding() @Input() isDisabled = false;\n @HostBinding('class.is-elastic') @Input() elastic = false;\n @HostBinding('class.is-full') @Input() full = false;\n @HostBinding('attr.disabled') get disabled(): boolean | null {\n return this.isDisabled || this.loading || null;\n }\n\n @HostBinding('class.lis-button') get lisButton(): boolean {\n return true;\n }\n\n public getWrapperClasses(): string[] {\n const classes = [];\n\n if (this.disabled) {\n classes.push('cursor-not-allowed');\n }\n\n if (this.elastic) {\n classes.push('flex', 'sm:inline-flex');\n } else if (this.full) {\n classes.push('w-full');\n } else {\n classes.push('flex');\n }\n\n return classes;\n }\n\n public getButtonClasses(): string[] {\n const classes = ['transition-all', 'duration-200', 'ease-in-out'];\n\n if (this.elastic) {\n classes.push('flex', 'w-full', 'sm:inline-flex');\n } else if (this.full) {\n classes.push('flex');\n } else {\n classes.push('inline-flex');\n }\n\n classes.push('leading-none', 'border');\n if (this.isRound) {\n classes.push('rounded-full');\n } else {\n classes.push('rounded');\n }\n if (!this.isRound) {\n if (this.size === 'M') {\n classes.push('h-8.5');\n } else {\n classes.push('h-11');\n }\n }\n\n if (this.isRound) {\n if (this.size === 'M') {\n classes.push('p-1');\n } else {\n classes.push('p-2');\n }\n } else {\n if (this.variant !== 'ghost') {\n if (this.size === 'M') {\n classes.push('px-2.5');\n } else {\n classes.push('px-3');\n }\n }\n }\n\n switch (this.variant) {\n case 'flat':\n if (this.disabled) {\n classes.push(\n 'bg-button-flat-background-disabled',\n 'text-button-flat-foreground-disabled',\n 'border-button-flat-background-disabled'\n );\n } else {\n classes.push(\n 'text-button-flat-foreground',\n 'bg-button-flat-background',\n 'border-button-flat-background',\n 'group-hover:bg-button-flat-background-hover',\n 'group-hover:border-button-flat-background-hover'\n );\n }\n break;\n\n case 'outline':\n if (this.disabled) {\n classes.push(\n 'text-button-outline-border-disabled',\n 'border-button-outline-border-disabled'\n );\n } else {\n classes.push(\n 'text-button-outline-foreground',\n 'bg-button-outline-background',\n 'border-button-outline-foreground',\n 'group-hover:text-button-outline-foreground-hover',\n 'group-hover:bg-button-outline-background-hover',\n 'group-hover:border-button-outline-foreground-hover'\n );\n }\n break;\n\n case 'ghost':\n if (this.disabled) {\n classes.push(\n 'text-button-ghost-foreground-disabled',\n 'bg-button-ghost-background-disabled'\n );\n } else {\n classes.push(\n 'text-button-ghost-foreground',\n 'bg-transparent',\n 'border-transparent',\n 'group-hover:text-button-ghost-foreground-hover'\n );\n }\n break;\n }\n\n return classes;\n }\n\n public getContentClasses(): string[] {\n const classes = [];\n\n if (this.size === 'L') {\n classes.push('typo-button-l');\n } else {\n classes.push('typo-button');\n }\n\n return classes;\n }\n\n public isIconContainerVisible(): boolean {\n return !!this.icon || this.loading;\n }\n}\n", "
\n
\n
\n
\n \n \n \n
\n \n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n"], "mappings": "kTAqBaA,GAAa,IAAA,CAAp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istry", "getIcon", "console", "warn", "_size", "getIconSize", "svgElementFromString", "iconContainer", "appendChild", "setTimeout", "cdRef", "markForCheck", "constructor", "document", "LIS_ICON_SIZE_DEFAULT", "svgContent", "div", "createElement", "innerHTML", "querySelector", "createElementNS", "getIconSizeClasses", "classes", "push", "neverError", "\u0275\u0275directiveInject", "ElementRef", "IconsRegistry", "ChangeDetectorRef", "DOCUMENT", "selectors", "viewQuery", "rf", "ctx", "\u0275\u0275element", "\u0275\u0275property", "\u0275\u0275element", "\u0275\u0275property", "ctx_r0", "icon", "\u0275\u0275elementContainerStart", "\u0275\u0275template", "ButtonComponent_div_3_ng_container_1_lis_icon_1_Template", "\u0275\u0275advance", "\u0275\u0275elementStart", "\u0275\u0275elementEnd", "ButtonComponent_div_3_ng_container_1_Template", "ButtonComponent_div_3_div_2_Template", "\u0275\u0275pureFunction1", "_c2", "isRound", "loading", "iconRight", "ButtonComponent", "constructor", "variant", "iconSize", "size", "isDisabled", "elastic", "full", "disabled", "lisButton", "getWrapperClasses", "classes", "push", "getButtonClasses", "getContentClasses", "isIconContainerVisible", "selectors", "hostVars", "hostBindings", "rf", "ctx", "\u0275\u0275hostProperty", "\u0275\u0275classProp", "ButtonComponent_div_3_Template", "\u0275\u0275projection", "ButtonComponent_div_6_Template"] }