@lumston/ds-angular 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/lumston-ds-angular.mjs +3219 -0
- package/fesm2022/lumston-ds-angular.mjs.map +1 -0
- package/package.json +34 -0
- package/src/styles/_base.css +10 -0
- package/src/styles/_tokens.css +72 -0
- package/src/styles/index.css +25 -0
- package/types/lumston-ds-angular.d.ts +595 -0
- package/types/lumston-ds-angular.d.ts.map +1 -0
|
@@ -0,0 +1,3219 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, input, computed, ChangeDetectionStrategy, Component, HostListener, ViewChild, Input, TemplateRef, Directive, output, signal, effect, forwardRef, Renderer2, DestroyRef, ElementRef, model, viewChild, ViewEncapsulation, Injectable, contentChild, untracked } from '@angular/core';
|
|
3
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
4
|
+
import * as i1 from '@angular/common';
|
|
5
|
+
import { CommonModule, NgTemplateOutlet, DOCUMENT } from '@angular/common';
|
|
6
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* SVG icon registry.
|
|
10
|
+
* Maps icon names to raw SVG strings.
|
|
11
|
+
*/
|
|
12
|
+
const ICON_REGISTRY = {
|
|
13
|
+
// UI Icons
|
|
14
|
+
'caret-down': `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
15
|
+
<path d="M19 9L12 15L5 9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
16
|
+
</svg>`,
|
|
17
|
+
'carets-down': `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
18
|
+
<path d="M19 11L12 17L5 11" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
19
|
+
<path opacity="0.5" d="M19 7L12 13L5 7" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
20
|
+
</svg>`,
|
|
21
|
+
'laptop': `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
22
|
+
<path d="M3 9C3 6.17157 3 4.75736 3.87868 3.87868C4.75736 3 6.17157 3 9 3H15C17.8284 3 19.2426 3 20.1213 3.87868C21 4.75736 21 6.17157 21 9V14C21 15.8856 21 16.8284 20.4142 17.4142C19.8284 18 18.8856 18 17 18H7C5.11438 18 4.17157 18 3.58579 17.4142C3 16.8284 3 15.8856 3 14V9Z" stroke="currentColor" stroke-width="1.5" />
|
|
23
|
+
<path opacity="0.5" d="M22 21H2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
24
|
+
<path opacity="0.5" d="M15 15H9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
25
|
+
</svg>`,
|
|
26
|
+
'menu': `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
27
|
+
<path d="M20 7L4 7" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
28
|
+
<path opacity="0.5" d="M20 12L4 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
29
|
+
<path d="M20 17L4 17" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
30
|
+
</svg>`,
|
|
31
|
+
'minus': `<svg width="16" height="20" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
32
|
+
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
33
|
+
</svg>`,
|
|
34
|
+
'moon': `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
35
|
+
<path d="M21.0672 11.8568L20.4253 11.469L21.0672 11.8568ZM12.1432 2.93276L11.7553 2.29085V2.29085L12.1432 2.93276ZM21.25 12C21.25 17.1086 17.1086 21.25 12 21.25V22.75C17.9371 22.75 22.75 17.9371 22.75 12H21.25ZM12 21.25C6.89137 21.25 2.75 17.1086 2.75 12H1.25C1.25 17.9371 6.06294 22.75 12 22.75V21.25ZM2.75 12C2.75 6.89137 6.89137 2.75 12 2.75V1.25C6.06294 1.25 1.25 6.06294 1.25 12H2.75ZM15.5 14.25C12.3244 14.25 9.75 11.6756 9.75 8.5H8.25C8.25 12.5041 11.4959 15.75 15.5 15.75V14.25ZM20.4253 11.469C19.4172 13.1373 17.5882 14.25 15.5 14.25V15.75C18.1349 15.75 20.4407 14.3439 21.7092 12.2447L20.4253 11.469ZM9.75 8.5C9.75 6.41182 10.8627 4.5828 12.531 3.57467L11.7553 2.29085C9.65609 3.5593 8.25 5.86509 8.25 8.5H9.75ZM12 2.75C11.9115 2.75 11.8077 2.71008 11.7324 2.63168C11.6686 2.56527 11.6538 2.50244 11.6503 2.47703C11.6461 2.44587 11.6482 2.35557 11.7553 2.29085L12.531 3.57467C13.0342 3.27065 13.196 2.71398 13.1368 2.27627C13.0754 1.82126 12.7166 1.25 12 1.25V2.75ZM21.7092 12.2447C21.6444 12.3518 21.5541 12.3539 21.523 12.3497C21.4976 12.3462 21.4347 12.3314 21.3683 12.2676C21.2899 12.1923 21.25 12.0885 21.25 12H22.75C22.75 11.2834 22.1787 10.9246 21.7237 10.8632C21.286 10.804 20.7293 10.9658 20.4253 11.469L21.7092 12.2447Z" fill="currentColor" />
|
|
36
|
+
</svg>`,
|
|
37
|
+
'search': `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
38
|
+
<circle cx="11.5" cy="11.5" r="9.5" stroke="currentColor" stroke-width="1.5" opacity="0.5" />
|
|
39
|
+
<path d="M18.5 18.5L22 22" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
40
|
+
</svg>`,
|
|
41
|
+
'settings': `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
42
|
+
<circle cx="12" cy="12" r="3" stroke="currentColor" stroke-width="1.5" />
|
|
43
|
+
<path opacity="0.5" d="M13.7654 2.15224C13.3978 2 12.9319 2 12 2C11.0681 2 10.6022 2 10.2346 2.15224C9.74457 2.35523 9.35522 2.74458 9.15223 3.23463C9.05957 3.45834 9.0233 3.7185 9.00911 4.09799C8.98826 4.65568 8.70226 5.17189 8.21894 5.45093C7.73564 5.72996 7.14559 5.71954 6.65219 5.45876C6.31645 5.2813 6.07301 5.18262 5.83294 5.15102C5.30704 5.08178 4.77518 5.22429 4.35436 5.5472C4.03874 5.78938 3.80577 6.1929 3.33983 6.99993C2.87389 7.80697 2.64092 8.21048 2.58899 8.60491C2.51976 9.1308 2.66227 9.66266 2.98518 10.0835C3.13256 10.2756 3.3397 10.437 3.66119 10.639C4.1338 10.936 4.43789 11.4419 4.43786 12C4.43783 12.5581 4.13375 13.0639 3.66118 13.3608C3.33965 13.5629 3.13248 13.7244 2.98508 13.9165C2.66217 14.3373 2.51966 14.8691 2.5889 15.395C2.64082 15.7894 2.87379 16.193 3.33973 17C3.80568 17.807 4.03865 18.2106 4.35426 18.4527C4.77508 18.7756 5.30694 18.9181 5.83284 18.8489C6.07289 18.8173 6.31632 18.7186 6.65204 18.5412C7.14547 18.2804 7.73556 18.27 8.2189 18.549C8.70224 18.8281 8.98826 19.3443 9.00911 19.9021C9.02331 20.2815 9.05957 20.5417 9.15223 20.7654C9.35522 21.2554 9.74457 21.6448 10.2346 21.8478C10.6022 22 11.0681 22 12 22C12.9319 22 13.3978 22 13.7654 21.8478C14.2554 21.6448 14.6448 21.2554 14.8477 20.7654C14.9404 20.5417 14.9767 20.2815 14.9909 19.902C15.0117 19.3443 15.2977 18.8281 15.781 18.549C16.2643 18.2699 16.8544 18.2804 17.3479 18.5412C17.6836 18.7186 17.927 18.8172 18.167 18.8488C18.6929 18.9181 19.2248 18.7756 19.6456 18.4527C19.9612 18.2105 20.1942 17.807 20.6601 16.9999C21.1261 16.1929 21.3591 15.7894 21.411 15.395C21.4802 14.8691 21.3377 14.3372 21.0148 13.9164C20.8674 13.7243 20.6602 13.5628 20.3387 13.3608C19.8662 13.0639 19.5621 12.558 19.5621 11.9999C19.5621 11.4418 19.8662 10.9361 20.3387 10.6392C20.6603 10.4371 20.8675 10.2757 21.0149 10.0835C21.3378 9.66273 21.4803 9.13087 21.4111 8.60497C21.3592 8.21055 21.1262 7.80703 20.6602 7C20.1943 6.19297 19.9613 5.78945 19.6457 5.54727C19.2249 5.22436 18.693 5.08185 18.1671 5.15109C17.9271 5.18269 17.6837 5.28136 17.3479 5.4588C16.8545 5.71959 16.2644 5.73002 15.7811 5.45096C15.2977 5.17191 15.0117 4.65566 14.9909 4.09794C14.9767 3.71848 14.9404 3.45833 14.8477 3.23463C14.6448 2.74458 14.2554 2.35523 13.7654 2.15224Z" stroke="currentColor" stroke-width="1.5" />
|
|
44
|
+
</svg>`,
|
|
45
|
+
'sun': `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
46
|
+
<circle cx="12" cy="12" r="5" stroke="currentColor" stroke-width="1.5" />
|
|
47
|
+
<path d="M12 2V4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
48
|
+
<path d="M12 20V22" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
49
|
+
<path d="M4 12L2 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
50
|
+
<path d="M22 12L20 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
51
|
+
<path opacity="0.5" d="M19.7778 4.22266L17.5558 6.25424" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
52
|
+
<path opacity="0.5" d="M4.22217 4.22266L6.44418 6.25424" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
53
|
+
<path opacity="0.5" d="M6.44434 17.5557L4.22211 19.7779" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
54
|
+
<path opacity="0.5" d="M19.7778 19.7773L17.5558 17.5551" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
55
|
+
</svg>`,
|
|
56
|
+
'x': `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
57
|
+
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
58
|
+
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
59
|
+
</svg>`,
|
|
60
|
+
'x-circle': `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
61
|
+
<circle opacity="0.5" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="1.5" />
|
|
62
|
+
<path d="M14.5 9.50002L9.5 14.5M9.49998 9.5L14.5 14.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
63
|
+
</svg>`,
|
|
64
|
+
// Menu Icons
|
|
65
|
+
'menu-apps': `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
66
|
+
<g opacity="0.5">
|
|
67
|
+
<path d="M14 2.75C15.9068 2.75 17.2615 2.75159 18.2892 2.88976C19.2952 3.02503 19.8749 3.27869 20.2981 3.7019C20.7213 4.12511 20.975 4.70476 21.1102 5.71085C21.2484 6.73851 21.25 8.09318 21.25 10C21.25 10.4142 21.5858 10.75 22 10.75C22.4142 10.75 22.75 10.4142 22.75 10V9.94359C22.75 8.10583 22.75 6.65019 22.5969 5.51098C22.4392 4.33856 22.1071 3.38961 21.3588 2.64124C20.6104 1.89288 19.6614 1.56076 18.489 1.40314C17.3498 1.24997 15.8942 1.24998 14.0564 1.25H14C13.5858 1.25 13.25 1.58579 13.25 2C13.25 2.41421 13.5858 2.75 14 2.75Z" fill="currentColor" />
|
|
68
|
+
<path d="M9.94358 1.25H10C10.4142 1.25 10.75 1.58579 10.75 2C10.75 2.41421 10.4142 2.75 10 2.75C8.09318 2.75 6.73851 2.75159 5.71085 2.88976C4.70476 3.02503 4.12511 3.27869 3.7019 3.7019C3.27869 4.12511 3.02503 4.70476 2.88976 5.71085C2.75159 6.73851 2.75 8.09318 2.75 10C2.75 10.4142 2.41421 10.75 2 10.75C1.58579 10.75 1.25 10.4142 1.25 10V9.94358C1.24998 8.10583 1.24997 6.65019 1.40314 5.51098C1.56076 4.33856 1.89288 3.38961 2.64124 2.64124C3.38961 1.89288 4.33856 1.56076 5.51098 1.40314C6.65019 1.24997 8.10583 1.24998 9.94358 1.25Z" fill="currentColor" />
|
|
69
|
+
<path d="M22 13.25C22.4142 13.25 22.75 13.5858 22.75 14V14.0564C22.75 15.8942 22.75 17.3498 22.5969 18.489C22.4392 19.6614 22.1071 20.6104 21.3588 21.3588C20.6104 22.1071 19.6614 22.4392 18.489 22.5969C17.3498 22.75 15.8942 22.75 14.0564 22.75H14C13.5858 22.75 13.25 22.4142 13.25 22C13.25 21.5858 13.5858 21.25 14 21.25C15.9068 21.25 17.2615 21.2484 18.2892 21.1102C19.2952 20.975 19.8749 20.7213 20.2981 20.2981C20.7213 19.8749 20.975 19.2952 21.1102 18.2892C21.2484 17.2615 21.25 15.9068 21.25 14C21.25 13.5858 21.5858 13.25 22 13.25Z" fill="currentColor" />
|
|
70
|
+
<path d="M2.75 14C2.75 13.5858 2.41421 13.25 2 13.25C1.58579 13.25 1.25 13.5858 1.25 14V14.0564C1.24998 15.8942 1.24997 17.3498 1.40314 18.489C1.56076 19.6614 1.89288 20.6104 2.64124 21.3588C3.38961 22.1071 4.33856 22.4392 5.51098 22.5969C6.65019 22.75 8.10583 22.75 9.94359 22.75H10C10.4142 22.75 10.75 22.4142 10.75 22C10.75 21.5858 10.4142 21.25 10 21.25C8.09318 21.25 6.73851 21.2484 5.71085 21.1102C4.70476 20.975 4.12511 20.7213 3.7019 20.2981C3.27869 19.8749 3.02503 19.2952 2.88976 18.2892C2.75159 17.2615 2.75 15.9068 2.75 14Z" fill="currentColor" />
|
|
71
|
+
</g>
|
|
72
|
+
<path d="M5.52721 5.52721C5 6.05442 5 6.90294 5 8.6C5 9.73137 5 10.2971 5.35147 10.6485C5.70294 11 6.26863 11 7.4 11H8.6C9.73137 11 10.2971 11 10.6485 10.6485C11 10.2971 11 9.73137 11 8.6V7.4C11 6.26863 11 5.70294 10.6485 5.35147C10.2971 5 9.73137 5 8.6 5C6.90294 5 6.05442 5 5.52721 5.52721Z" fill="currentColor" />
|
|
73
|
+
<path d="M5.52721 18.4728C5 17.9456 5 17.0971 5 15.4C5 14.2686 5 13.7029 5.35147 13.3515C5.70294 13 6.26863 13 7.4 13H8.6C9.73137 13 10.2971 13 10.6485 13.3515C11 13.7029 11 14.2686 11 15.4V16.6C11 17.7314 11 18.2971 10.6485 18.6485C10.2971 19 9.73138 19 8.60002 19C6.90298 19 6.05441 19 5.52721 18.4728Z" fill="currentColor" />
|
|
74
|
+
<path d="M13 7.4C13 6.26863 13 5.70294 13.3515 5.35147C13.7029 5 14.2686 5 15.4 5C17.0971 5 17.9456 5 18.4728 5.52721C19 6.05442 19 6.90294 19 8.6C19 9.73137 19 10.2971 18.6485 10.6485C18.2971 11 17.7314 11 16.6 11H15.4C14.2686 11 13.7029 11 13.3515 10.6485C13 10.2971 13 9.73137 13 8.6V7.4Z" fill="currentColor" />
|
|
75
|
+
<path d="M13.3515 18.6485C13 18.2971 13 17.7314 13 16.6V15.4C13 14.2686 13 13.7029 13.3515 13.3515C13.7029 13 14.2686 13 15.4 13H16.6C17.7314 13 18.2971 13 18.6485 13.3515C19 13.7029 19 14.2686 19 15.4C19 17.097 19 17.9456 18.4728 18.4728C17.9456 19 17.0971 19 15.4 19C14.2687 19 13.7029 19 13.3515 18.6485Z" fill="currentColor" />
|
|
76
|
+
</svg>`,
|
|
77
|
+
'menu-components': `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
78
|
+
<path d="M8.42229 20.6181C10.1779 21.5395 11.0557 22.0001 12 22.0001V12.0001L2.63802 7.07275C2.62423 7.09491 2.6107 7.11727 2.5974 7.13986C2 8.15436 2 9.41678 2 11.9416V12.0586C2 14.5834 2 15.8459 2.5974 16.8604C3.19479 17.8749 4.27063 18.4395 6.42229 19.5686L8.42229 20.6181Z" fill="currentColor" />
|
|
79
|
+
<path opacity="0.7" d="M17.5774 4.43152L15.5774 3.38197C13.8218 2.46066 12.944 2 11.9997 2C11.0554 2 10.1776 2.46066 8.42197 3.38197L6.42197 4.43152C4.31821 5.53552 3.24291 6.09982 2.6377 7.07264L11.9997 12L21.3617 7.07264C20.7564 6.09982 19.6811 5.53552 17.5774 4.43152Z" fill="currentColor" />
|
|
80
|
+
<path opacity="0.5" d="M21.4026 7.13986C21.3893 7.11727 21.3758 7.09491 21.362 7.07275L12 12.0001V22.0001C12.9443 22.0001 13.8221 21.5395 15.5777 20.6181L17.5777 19.5686C19.7294 18.4395 20.8052 17.8749 21.4026 16.8604C22 15.8459 22 14.5834 22 12.0586V11.9416C22 9.41678 22 8.15436 21.4026 7.13986Z" fill="currentColor" />
|
|
81
|
+
</svg>`,
|
|
82
|
+
'menu-dashboard': `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
83
|
+
<path opacity="0.5" d="M2 12.2039C2 9.91549 2 8.77128 2.5192 7.82274C3.0384 6.87421 3.98695 6.28551 5.88403 5.10813L7.88403 3.86687C9.88939 2.62229 10.8921 2 12 2C13.1079 2 14.1106 2.62229 16.116 3.86687L18.116 5.10812C20.0131 6.28551 20.9616 6.87421 21.4808 7.82274C22 8.77128 22 9.91549 22 12.2039V13.725C22 17.6258 22 19.5763 20.8284 20.7881C19.6569 22 17.7712 22 14 22H10C6.22876 22 4.34315 22 3.17157 20.7881C2 19.5763 2 17.6258 2 13.725V12.2039Z" fill="currentColor" />
|
|
84
|
+
<path d="M9 17.25C8.58579 17.25 8.25 17.5858 8.25 18C8.25 18.4142 8.58579 18.75 9 18.75H15C15.4142 18.75 15.75 18.4142 15.75 18C15.75 17.5858 15.4142 17.25 15 17.25H9Z" fill="currentColor" />
|
|
85
|
+
</svg>`,
|
|
86
|
+
'menu-datatables': `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
87
|
+
<path d="M4.97883 9.68508C2.99294 8.89073 2 8.49355 2 8C2 7.50645 2.99294 7.10927 4.97883 6.31492L7.7873 5.19153C9.77318 4.39718 10.7661 4 12 4C13.2339 4 14.2268 4.39718 16.2127 5.19153L19.0212 6.31492C21.0071 7.10927 22 7.50645 22 8C22 8.49355 21.0071 8.89073 19.0212 9.68508L16.2127 10.8085C14.2268 11.6028 13.2339 12 12 12C10.7661 12 9.77318 11.6028 7.7873 10.8085L4.97883 9.68508Z" fill="currentColor" />
|
|
88
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 8C2 8.49355 2.99294 8.89073 4.97883 9.68508L7.7873 10.8085C9.77318 11.6028 10.7661 12 12 12C13.2339 12 14.2268 11.6028 16.2127 10.8085L19.0212 9.68508C21.0071 8.89073 22 8.49355 22 8C22 7.50645 21.0071 7.10927 19.0212 6.31492L16.2127 5.19153C14.2268 4.39718 13.2339 4 12 4C10.7661 4 9.77318 4.39718 7.7873 5.19153L4.97883 6.31492C2.99294 7.10927 2 7.50645 2 8Z" fill="currentColor" />
|
|
89
|
+
<path opacity="0.7" d="M5.76613 10L4.97883 10.3149C2.99294 11.1093 2 11.5065 2 12C2 12.4935 2.99294 12.8907 4.97883 13.6851L7.7873 14.8085C9.77318 15.6028 10.7661 16 12 16C13.2339 16 14.2268 15.6028 16.2127 14.8085L19.0212 13.6851C21.0071 12.8907 22 12.4935 22 12C22 11.5065 21.0071 11.1093 19.0212 10.3149L18.2339 10L16.2127 10.8085C14.2268 11.6028 13.2339 12 12 12C10.7661 12 9.77318 11.6028 7.7873 10.8085L5.76613 10Z" fill="currentColor" />
|
|
90
|
+
<path opacity="0.4" d="M5.76613 14L4.97883 14.3149C2.99294 15.1093 2 15.5065 2 16C2 16.4935 2.99294 16.8907 4.97883 17.6851L7.7873 18.8085C9.77318 19.6028 10.7661 20 12 20C13.2339 20 14.2268 19.6028 16.2127 18.8085L19.0212 17.6851C21.0071 16.8907 22 16.4935 22 16C22 15.5065 21.0071 15.1093 19.0212 14.3149L18.2339 14L16.2127 14.8085C14.2268 15.6028 13.2339 16 12 16C10.7661 16 9.77318 15.6028 7.7873 14.8085L5.76613 14Z" fill="currentColor" />
|
|
91
|
+
</svg>`,
|
|
92
|
+
'menu-documentation': `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
93
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 4.69434V18.6943C4 20.3512 5.34315 21.6943 7 21.6943H17C18.6569 21.6943 20 20.3512 20 18.6943V8.69434C20 7.03748 18.6569 5.69434 17 5.69434H5C4.44772 5.69434 4 5.24662 4 4.69434ZM7.25 11.6943C7.25 11.2801 7.58579 10.9443 8 10.9443H16C16.4142 10.9443 16.75 11.2801 16.75 11.6943C16.75 12.1085 16.4142 12.4443 16 12.4443H8C7.58579 12.4443 7.25 12.1085 7.25 11.6943ZM7.25 15.1943C7.25 14.7801 7.58579 14.4443 8 14.4443H13.5C13.9142 14.4443 14.25 14.7801 14.25 15.1943C14.25 15.6085 13.9142 15.9443 13.5 15.9443H8C7.58579 15.9443 7.25 15.6085 7.25 15.1943Z" fill="currentColor" />
|
|
94
|
+
<path opacity="0.5" d="M18 4.00038V5.86504C17.6872 5.75449 17.3506 5.69434 17 5.69434H5C4.44772 5.69434 4 5.24662 4 4.69434V4.62329C4 4.09027 4.39193 3.63837 4.91959 3.56299L15.7172 2.02048C16.922 1.84835 18 2.78328 18 4.00038Z" fill="currentColor" />
|
|
95
|
+
</svg>`,
|
|
96
|
+
'menu-elements': `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
97
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.73167 5.77133L5.66953 9.91436C4.3848 11.6526 3.74244 12.5217 4.09639 13.205C4.10225 13.2164 4.10829 13.2276 4.1145 13.2387C4.48945 13.9117 5.59888 13.9117 7.81775 13.9117C9.05079 13.9117 9.6673 13.9117 10.054 14.2754L10.074 14.2946L13.946 9.72466L13.926 9.70541C13.5474 9.33386 13.5474 8.74151 13.5474 7.55682V7.24712C13.5474 3.96249 13.5474 2.32018 12.6241 2.03721C11.7007 1.75425 10.711 3.09327 8.73167 5.77133Z" fill="currentColor" />
|
|
98
|
+
<path opacity="0.5" d="M10.4527 16.4432L10.4527 16.7528C10.4527 20.0374 10.4527 21.6798 11.376 21.9627C12.2994 22.2457 13.2891 20.9067 15.2685 18.2286L18.3306 14.0856C19.6154 12.3474 20.2577 11.4783 19.9038 10.7949C19.8979 10.7836 19.8919 10.7724 19.8857 10.7613C19.5107 10.0883 18.4013 10.0883 16.1824 10.0883C14.9494 10.0883 14.3329 10.0883 13.9462 9.72461L10.0742 14.2946C10.4528 14.6661 10.4527 15.2585 10.4527 16.4432Z" fill="currentColor" />
|
|
99
|
+
</svg>`,
|
|
100
|
+
'menu-forms': `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
101
|
+
<path opacity="0.5" d="M3 10C3 6.22876 3 4.34315 4.17157 3.17157C5.34315 2 7.22876 2 11 2H13C16.7712 2 18.6569 2 19.8284 3.17157C21 4.34315 21 6.22876 21 10V14C21 17.7712 21 19.6569 19.8284 20.8284C18.6569 22 16.7712 22 13 22H11C7.22876 22 5.34315 22 4.17157 20.8284C3 19.6569 3 17.7712 3 14V10Z" fill="currentColor" />
|
|
102
|
+
<path d="M16.5189 16.5013C16.6939 16.3648 16.8526 16.2061 17.1701 15.8886L21.1275 11.9312C21.2231 11.8356 21.1793 11.6708 21.0515 11.6264C20.5844 11.4644 19.9767 11.1601 19.4083 10.5917C18.8399 10.0233 18.5356 9.41561 18.3736 8.94849C18.3292 8.82066 18.1644 8.77687 18.0688 8.87254L14.1114 12.8299C13.7939 13.1474 13.6352 13.3061 13.4987 13.4811C13.3377 13.6876 13.1996 13.9109 13.087 14.1473C12.9915 14.3476 12.9205 14.5606 12.7786 14.9865L12.5951 15.5368L12.3034 16.4118L12.0299 17.2323C11.9601 17.4419 12.0146 17.6729 12.1708 17.8292C12.3271 17.9854 12.5581 18.0399 12.7677 17.9701L13.5882 17.6966L14.4632 17.4049L15.0135 17.2214L15.0136 17.2214C15.4394 17.0795 15.6524 17.0085 15.8527 16.913C16.0891 16.8004 16.3124 16.6623 16.5189 16.5013Z" fill="currentColor" />
|
|
103
|
+
<path d="M22.3665 10.6922C23.2112 9.84754 23.2112 8.47812 22.3665 7.63348C21.5219 6.78884 20.1525 6.78884 19.3078 7.63348L19.1806 7.76071C19.0578 7.88348 19.0022 8.05496 19.0329 8.22586C19.0522 8.33336 19.0879 8.49053 19.153 8.67807C19.2831 9.05314 19.5288 9.54549 19.9917 10.0083C20.4545 10.4712 20.9469 10.7169 21.3219 10.847C21.5095 10.9121 21.6666 10.9478 21.7741 10.9671C21.945 10.9978 22.1165 10.9422 22.2393 10.8194L22.3665 10.6922Z" fill="currentColor" />
|
|
104
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.25 9C7.25 8.58579 7.58579 8.25 8 8.25H14.5C14.9142 8.25 15.25 8.58579 15.25 9C15.25 9.41421 14.9142 9.75 14.5 9.75H8C7.58579 9.75 7.25 9.41421 7.25 9ZM7.25 13C7.25 12.5858 7.58579 12.25 8 12.25H11C11.4142 12.25 11.75 12.5858 11.75 13C11.75 13.4142 11.4142 13.75 11 13.75H8C7.58579 13.75 7.25 13.4142 7.25 13ZM7.25 17C7.25 16.5858 7.58579 16.25 8 16.25H9.5C9.91421 16.25 10.25 16.5858 10.25 17C10.25 17.4142 9.91421 17.75 9.5 17.75H8C7.58579 17.75 7.25 17.4142 7.25 17Z" fill="currentColor" />
|
|
105
|
+
</svg>`,
|
|
106
|
+
'menu-more': `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
107
|
+
<path opacity="0.5" d="M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z" fill="currentColor" />
|
|
108
|
+
<path d="M12.75 9C12.75 8.58579 12.4142 8.25 12 8.25C11.5858 8.25 11.25 8.58579 11.25 9L11.25 11.25H9C8.58579 11.25 8.25 11.5858 8.25 12C8.25 12.4142 8.58579 12.75 9 12.75H11.25V15C11.25 15.4142 11.5858 15.75 12 15.75C12.4142 15.75 12.75 15.4142 12.75 15L12.75 12.75H15C15.4142 12.75 15.75 12.4142 15.75 12C15.75 11.5858 15.4142 11.25 15 11.25H12.75V9Z" fill="currentColor" />
|
|
109
|
+
</svg>`,
|
|
110
|
+
'menu-pages': `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
111
|
+
<path opacity="0.5" fill-rule="evenodd" clip-rule="evenodd" d="M14 22H10C6.22876 22 4.34315 22 3.17157 20.8284C2 19.6569 2 17.7712 2 14V10C2 6.22876 2 4.34315 3.17157 3.17157C4.34315 2 6.23869 2 10.0298 2C10.6358 2 11.1214 2 11.53 2.01666C11.5166 2.09659 11.5095 2.17813 11.5092 2.26057L11.5 5.09497C11.4999 6.19207 11.4998 7.16164 11.6049 7.94316C11.7188 8.79028 11.9803 9.63726 12.6716 10.3285C13.3628 11.0198 14.2098 11.2813 15.0569 11.3952C15.8385 11.5003 16.808 11.5002 17.9051 11.5001L18 11.5001H21.9574C22 12.0344 22 12.6901 22 13.5629V14C22 17.7712 22 19.6569 20.8284 20.8284C19.6569 22 17.7712 22 14 22Z" fill="currentColor" />
|
|
112
|
+
<path d="M6 13.75C5.58579 13.75 5.25 14.0858 5.25 14.5C5.25 14.9142 5.58579 15.25 6 15.25H14C14.4142 15.25 14.75 14.9142 14.75 14.5C14.75 14.0858 14.4142 13.75 14 13.75H6Z" fill="currentColor" />
|
|
113
|
+
<path d="M6 17.25C5.58579 17.25 5.25 17.5858 5.25 18C5.25 18.4142 5.58579 18.75 6 18.75H11.5C11.9142 18.75 12.25 18.4142 12.25 18C12.25 17.5858 11.9142 17.25 11.5 17.25H6Z" fill="currentColor" />
|
|
114
|
+
<path d="M11.5092 2.2601L11.5 5.0945C11.4999 6.1916 11.4998 7.16117 11.6049 7.94269C11.7188 8.78981 11.9803 9.6368 12.6716 10.3281C13.3629 11.0193 14.2098 11.2808 15.057 11.3947C15.8385 11.4998 16.808 11.4997 17.9051 11.4996L21.9574 11.4996C21.9698 11.6552 21.9786 11.821 21.9848 11.9995H22C22 11.732 22 11.5983 21.9901 11.4408C21.9335 10.5463 21.5617 9.52125 21.0315 8.79853C20.9382 8.6713 20.8743 8.59493 20.7467 8.44218C19.9542 7.49359 18.911 6.31193 18 5.49953C17.1892 4.77645 16.0787 3.98536 15.1101 3.3385C14.2781 2.78275 13.862 2.50487 13.2915 2.29834C13.1403 2.24359 12.9408 2.18311 12.7846 2.14466C12.4006 2.05013 12.0268 2.01725 11.5 2.00586L11.5092 2.2601Z" fill="currentColor" />
|
|
115
|
+
</svg>`,
|
|
116
|
+
'menu-scrumboard': `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
117
|
+
<path opacity="0.5" d="M21 15.9983V9.99826C21 7.16983 21 5.75562 20.1213 4.87694C19.3529 4.10856 18.175 4.01211 16 4H8C5.82497 4.01211 4.64706 4.10856 3.87868 4.87694C3 5.75562 3 7.16983 3 9.99826V15.9983C3 18.8267 3 20.2409 3.87868 21.1196C4.75736 21.9983 6.17157 21.9983 9 21.9983H15C17.8284 21.9983 19.2426 21.9983 20.1213 21.1196C21 20.2409 21 18.8267 21 15.9983Z" fill="currentColor" />
|
|
118
|
+
<path d="M8 3.5C8 2.67157 8.67157 2 9.5 2H14.5C15.3284 2 16 2.67157 16 3.5V4.5C16 5.32843 15.3284 6 14.5 6H9.5C8.67157 6 8 5.32843 8 4.5V3.5Z" fill="currentColor" />
|
|
119
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 9.25C12.4142 9.25 12.75 9.58579 12.75 10V12.25L15 12.25C15.4142 12.25 15.75 12.5858 15.75 13C15.75 13.4142 15.4142 13.75 15 13.75L12.75 13.75L12.75 16C12.75 16.4142 12.4142 16.75 12 16.75C11.5858 16.75 11.25 16.4142 11.25 16L11.25 13.75H9C8.58579 13.75 8.25 13.4142 8.25 13C8.25 12.5858 8.58579 12.25 9 12.25L11.25 12.25L11.25 10C11.25 9.58579 11.5858 9.25 12 9.25Z" fill="currentColor" />
|
|
120
|
+
</svg>`,
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
class IconComponent {
|
|
124
|
+
constructor() {
|
|
125
|
+
this.sanitizer = inject(DomSanitizer);
|
|
126
|
+
this.name = input.required(...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
127
|
+
this.iconClass = input('', ...(ngDevMode ? [{ debugName: "iconClass" }] : []));
|
|
128
|
+
this.svgHtml = computed(() => {
|
|
129
|
+
const iconName = this.name();
|
|
130
|
+
const svg = ICON_REGISTRY[iconName];
|
|
131
|
+
if (!svg) {
|
|
132
|
+
console.warn(`Icon "${iconName}" not found in registry`);
|
|
133
|
+
return '';
|
|
134
|
+
}
|
|
135
|
+
return this.sanitizer.bypassSecurityTrustHtml(svg);
|
|
136
|
+
}, ...(ngDevMode ? [{ debugName: "svgHtml" }] : []));
|
|
137
|
+
}
|
|
138
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
139
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.2", type: IconComponent, isStandalone: true, selector: "ls-icon", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, iconClass: { classPropertyName: "iconClass", publicName: "iconClass", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `<span [innerHTML]="svgHtml()" [class]="iconClass()"></span>`, isInline: true, styles: [":host{display:inline-flex;align-items:center;justify-content:center}span{display:contents}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
140
|
+
}
|
|
141
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: IconComponent, decorators: [{
|
|
142
|
+
type: Component,
|
|
143
|
+
args: [{ selector: 'ls-icon', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `<span [innerHTML]="svgHtml()" [class]="iconClass()"></span>`, styles: [":host{display:inline-flex;align-items:center;justify-content:center}span{display:contents}\n"] }]
|
|
144
|
+
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], iconClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconClass", required: false }] }] } });
|
|
145
|
+
|
|
146
|
+
class DropdownComponent {
|
|
147
|
+
constructor() {
|
|
148
|
+
this.contentClass = '';
|
|
149
|
+
this.isOpen = false;
|
|
150
|
+
this.isAnimating = false;
|
|
151
|
+
}
|
|
152
|
+
toggle() {
|
|
153
|
+
if (this.isOpen) {
|
|
154
|
+
this.isAnimating = true;
|
|
155
|
+
this.isOpen = false;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
this.isOpen = true;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
close() {
|
|
162
|
+
if (this.isOpen) {
|
|
163
|
+
this.isAnimating = true;
|
|
164
|
+
this.isOpen = false;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
onAnimationEnd() {
|
|
168
|
+
this.isAnimating = false;
|
|
169
|
+
}
|
|
170
|
+
onDocumentClick(event) {
|
|
171
|
+
if (this.dropdown && !this.dropdown.nativeElement.contains(event.target)) {
|
|
172
|
+
this.close();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: DropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
176
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: DropdownComponent, isStandalone: true, selector: "ls-dropdown", inputs: { contentClass: "contentClass" }, host: { listeners: { "document:click": "onDocumentClick($event)" } }, viewQueries: [{ propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true }], ngImport: i0, template: `
|
|
177
|
+
<div class="dropdown" #dropdown>
|
|
178
|
+
<div (click)="toggle()">
|
|
179
|
+
<ng-content select="[dropdownButton]"></ng-content>
|
|
180
|
+
</div>
|
|
181
|
+
@if (isOpen || isAnimating) {
|
|
182
|
+
<div class="dropdown-content"
|
|
183
|
+
[ngClass]="[contentClass, isOpen ? 'toggle-enter' : 'toggle-leave']"
|
|
184
|
+
(animationend)="onAnimationEnd()">
|
|
185
|
+
<ng-content select="[dropdownContent]"></ng-content>
|
|
186
|
+
</div>
|
|
187
|
+
}
|
|
188
|
+
</div>
|
|
189
|
+
`, isInline: true, styles: [":host{display:block}.dropdown{position:relative}.dropdown-content{position:absolute;z-index:50}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
|
|
190
|
+
}
|
|
191
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: DropdownComponent, decorators: [{
|
|
192
|
+
type: Component,
|
|
193
|
+
args: [{ standalone: true, imports: [CommonModule], selector: 'ls-dropdown', template: `
|
|
194
|
+
<div class="dropdown" #dropdown>
|
|
195
|
+
<div (click)="toggle()">
|
|
196
|
+
<ng-content select="[dropdownButton]"></ng-content>
|
|
197
|
+
</div>
|
|
198
|
+
@if (isOpen || isAnimating) {
|
|
199
|
+
<div class="dropdown-content"
|
|
200
|
+
[ngClass]="[contentClass, isOpen ? 'toggle-enter' : 'toggle-leave']"
|
|
201
|
+
(animationend)="onAnimationEnd()">
|
|
202
|
+
<ng-content select="[dropdownContent]"></ng-content>
|
|
203
|
+
</div>
|
|
204
|
+
}
|
|
205
|
+
</div>
|
|
206
|
+
`, styles: [":host{display:block}.dropdown{position:relative}.dropdown-content{position:absolute;z-index:50}\n"] }]
|
|
207
|
+
}], propDecorators: { contentClass: [{
|
|
208
|
+
type: Input
|
|
209
|
+
}], dropdown: [{
|
|
210
|
+
type: ViewChild,
|
|
211
|
+
args: ['dropdown']
|
|
212
|
+
}], onDocumentClick: [{
|
|
213
|
+
type: HostListener,
|
|
214
|
+
args: ['document:click', ['$event']]
|
|
215
|
+
}] } });
|
|
216
|
+
|
|
217
|
+
class LsDropdownContentDirective {
|
|
218
|
+
constructor() {
|
|
219
|
+
this.templateRef = inject(TemplateRef);
|
|
220
|
+
}
|
|
221
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: LsDropdownContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
222
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.2", type: LsDropdownContentDirective, isStandalone: true, selector: "[lsDropdownContent]", ngImport: i0 }); }
|
|
223
|
+
}
|
|
224
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: LsDropdownContentDirective, decorators: [{
|
|
225
|
+
type: Directive,
|
|
226
|
+
args: [{ selector: '[lsDropdownContent]', standalone: true }]
|
|
227
|
+
}] });
|
|
228
|
+
|
|
229
|
+
class ButtonComponent {
|
|
230
|
+
constructor() {
|
|
231
|
+
this.sanitizer = inject(DomSanitizer);
|
|
232
|
+
this.variant = input('contained', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
233
|
+
this.color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
234
|
+
this.size = input('medium', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
235
|
+
this.type = input('button', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
236
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
237
|
+
this.fullWidth = input(false, ...(ngDevMode ? [{ debugName: "fullWidth" }] : []));
|
|
238
|
+
this.startIcon = input(...(ngDevMode ? [undefined, { debugName: "startIcon" }] : []));
|
|
239
|
+
this.endIcon = input(...(ngDevMode ? [undefined, { debugName: "endIcon" }] : []));
|
|
240
|
+
this.loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
241
|
+
this.loadingIndicator = input('spinner', ...(ngDevMode ? [{ debugName: "loadingIndicator" }] : []));
|
|
242
|
+
this.loadingPosition = input('center', ...(ngDevMode ? [{ debugName: "loadingPosition" }] : []));
|
|
243
|
+
this.rounded = input(false, ...(ngDevMode ? [{ debugName: "rounded" }] : []));
|
|
244
|
+
this.clicked = output();
|
|
245
|
+
}
|
|
246
|
+
get isCustomText() {
|
|
247
|
+
return this.loadingIndicator() !== 'spinner';
|
|
248
|
+
}
|
|
249
|
+
get iconSizeClass() {
|
|
250
|
+
switch (this.size()) {
|
|
251
|
+
case 'small':
|
|
252
|
+
return 'btn-icon--sm';
|
|
253
|
+
case 'large':
|
|
254
|
+
return 'btn-icon--lg';
|
|
255
|
+
default:
|
|
256
|
+
return 'btn-icon--md';
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
get showStartIcon() {
|
|
260
|
+
if (!this.startIcon())
|
|
261
|
+
return false;
|
|
262
|
+
if (!this.loading())
|
|
263
|
+
return true;
|
|
264
|
+
return this.loadingPosition() === 'end' && !this.isCustomText;
|
|
265
|
+
}
|
|
266
|
+
get showEndIcon() {
|
|
267
|
+
if (!this.endIcon())
|
|
268
|
+
return false;
|
|
269
|
+
if (!this.loading())
|
|
270
|
+
return true;
|
|
271
|
+
return this.loadingPosition() === 'start' && !this.isCustomText;
|
|
272
|
+
}
|
|
273
|
+
get sanitizedStartIcon() {
|
|
274
|
+
return this.sanitizer.bypassSecurityTrustHtml(this.startIcon() ?? '');
|
|
275
|
+
}
|
|
276
|
+
get sanitizedEndIcon() {
|
|
277
|
+
return this.sanitizer.bypassSecurityTrustHtml(this.endIcon() ?? '');
|
|
278
|
+
}
|
|
279
|
+
get buttonClasses() {
|
|
280
|
+
const classes = ['btn'];
|
|
281
|
+
const variant = this.variant();
|
|
282
|
+
const color = this.color();
|
|
283
|
+
// Variant + color mapping
|
|
284
|
+
if (variant === 'contained') {
|
|
285
|
+
classes.push(`btn-${color}`);
|
|
286
|
+
}
|
|
287
|
+
if (variant === 'outline') {
|
|
288
|
+
classes.push(`btn-outline-${color}`);
|
|
289
|
+
}
|
|
290
|
+
if (variant === 'text') {
|
|
291
|
+
classes.push(`btn-text-${color}`);
|
|
292
|
+
}
|
|
293
|
+
// Size
|
|
294
|
+
switch (this.size()) {
|
|
295
|
+
case 'small':
|
|
296
|
+
classes.push('btn-sm');
|
|
297
|
+
break;
|
|
298
|
+
case 'large':
|
|
299
|
+
classes.push('btn-lg');
|
|
300
|
+
break;
|
|
301
|
+
default:
|
|
302
|
+
classes.push('btn-md');
|
|
303
|
+
}
|
|
304
|
+
if (this.fullWidth()) {
|
|
305
|
+
classes.push('btn-full-width');
|
|
306
|
+
}
|
|
307
|
+
if (this.rounded()) {
|
|
308
|
+
classes.push('btn-rounded');
|
|
309
|
+
}
|
|
310
|
+
return classes.join(' ');
|
|
311
|
+
}
|
|
312
|
+
onClick(event) {
|
|
313
|
+
if (!this.disabled() && !this.loading()) {
|
|
314
|
+
this.clicked.emit(event);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
318
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: ButtonComponent, isStandalone: true, selector: "ls-button", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, startIcon: { classPropertyName: "startIcon", publicName: "startIcon", isSignal: true, isRequired: false, transformFunction: null }, endIcon: { classPropertyName: "endIcon", publicName: "endIcon", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, loadingIndicator: { classPropertyName: "loadingIndicator", publicName: "loadingIndicator", isSignal: true, isRequired: false, transformFunction: null }, loadingPosition: { classPropertyName: "loadingPosition", publicName: "loadingPosition", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: `
|
|
319
|
+
<button
|
|
320
|
+
[type]="type()"
|
|
321
|
+
[disabled]="disabled() || loading()"
|
|
322
|
+
[class]="buttonClasses"
|
|
323
|
+
(click)="onClick($event)">
|
|
324
|
+
<ng-template #spinner>
|
|
325
|
+
<svg class="btn-spinner" viewBox="0 0 24 24" fill="none">
|
|
326
|
+
<circle
|
|
327
|
+
class="btn-spinner-circle"
|
|
328
|
+
cx="12"
|
|
329
|
+
cy="12"
|
|
330
|
+
r="10"
|
|
331
|
+
stroke="currentColor"
|
|
332
|
+
stroke-width="4" />
|
|
333
|
+
<path
|
|
334
|
+
class="btn-spinner-path"
|
|
335
|
+
fill="currentColor"
|
|
336
|
+
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" />
|
|
337
|
+
</svg>
|
|
338
|
+
</ng-template>
|
|
339
|
+
|
|
340
|
+
@if (showStartIcon) {
|
|
341
|
+
<span
|
|
342
|
+
class="btn-icon btn-icon--start"
|
|
343
|
+
[class]="iconSizeClass"
|
|
344
|
+
[innerHTML]="sanitizedStartIcon"></span>
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
@if (loading() && isCustomText) {
|
|
348
|
+
<span class="btn-loading-overlay">
|
|
349
|
+
{{ loadingIndicator() }}
|
|
350
|
+
</span>
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
@if (loading() && !isCustomText && loadingPosition() === 'start') {
|
|
354
|
+
<span class="btn-loading-inline btn-loading-inline--start">
|
|
355
|
+
<ng-container *ngTemplateOutlet="spinner" />
|
|
356
|
+
</span>
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
@if (loading() && !isCustomText && loadingPosition() === 'center') {
|
|
360
|
+
<span class="btn-loading-overlay">
|
|
361
|
+
<ng-container *ngTemplateOutlet="spinner" />
|
|
362
|
+
</span>
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
<span
|
|
366
|
+
[class]="
|
|
367
|
+
loading() && (isCustomText || loadingPosition() === 'center')
|
|
368
|
+
? 'btn-content--hidden'
|
|
369
|
+
: ''
|
|
370
|
+
">
|
|
371
|
+
<ng-content />
|
|
372
|
+
</span>
|
|
373
|
+
|
|
374
|
+
@if (loading() && !isCustomText && loadingPosition() === 'end') {
|
|
375
|
+
<span class="btn-loading-inline btn-loading-inline--end">
|
|
376
|
+
<ng-container *ngTemplateOutlet="spinner" />
|
|
377
|
+
</span>
|
|
378
|
+
}
|
|
379
|
+
@if (showEndIcon) {
|
|
380
|
+
<span
|
|
381
|
+
class="btn-icon btn-icon--end"
|
|
382
|
+
[class]="iconSizeClass"
|
|
383
|
+
[innerHTML]="sanitizedEndIcon"></span>
|
|
384
|
+
}
|
|
385
|
+
</button>
|
|
386
|
+
`, isInline: true, styles: [":host{display:contents}.btn{position:relative;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--ls-border-radius-md);border:1px solid;padding:.5rem 1.25rem;font-size:.875rem;line-height:1.25rem;font-weight:600;box-shadow:0 10px 20px -10px;outline:none;transition:all var(--ls-transition-duration) ease;cursor:pointer}.btn-lg{padding:.625rem 1.75rem;font-size:1rem;line-height:1.5rem}.btn-sm{padding:.375rem .625rem;font-size:.75rem;line-height:1rem}.btn[disabled]{cursor:not-allowed;opacity:.6}.btn-primary{border-color:var(--ls-color-primary);background-color:var(--ls-color-primary);color:var(--ls-color-white);box-shadow:0 10px 20px -10px #4361ee99}.btn-primary:hover{filter:brightness(.9)}.btn-secondary{border-color:var(--ls-color-secondary);background-color:var(--ls-color-secondary);color:var(--ls-color-white);box-shadow:0 10px 20px -10px #805dca99}.btn-secondary:hover{filter:brightness(.9)}.btn-success{border-color:var(--ls-color-success);background-color:var(--ls-color-success);color:var(--ls-color-white);box-shadow:0 10px 20px -10px #00ab5599}.btn-success:hover{filter:brightness(.9)}.btn-error{border-color:var(--ls-color-danger);background-color:var(--ls-color-danger);color:var(--ls-color-white);box-shadow:0 10px 20px -10px #e7515a99}.btn-error:hover{filter:brightness(.9)}.btn-warning{border-color:var(--ls-color-warning);background-color:var(--ls-color-warning);color:var(--ls-color-white);box-shadow:0 10px 20px -10px #e2a03f99}.btn-warning:hover{filter:brightness(.9)}.btn-info{border-color:var(--ls-color-info);background-color:var(--ls-color-info);color:var(--ls-color-white);box-shadow:0 10px 20px -10px #2196f399}.btn-info:hover{filter:brightness(.9)}.btn-dark{border-color:var(--ls-color-dark);background-color:var(--ls-color-dark);color:var(--ls-color-white);box-shadow:0 10px 20px -10px #3b3f5c99}.btn-dark:hover{filter:brightness(.9)}.btn-outline-primary{border-color:var(--ls-color-primary);color:var(--ls-color-primary);background-color:transparent;box-shadow:none}.btn-outline-primary:hover{background-color:var(--ls-color-primary);color:var(--ls-color-white)}.btn-outline-secondary{border-color:var(--ls-color-secondary);color:var(--ls-color-secondary);background-color:transparent;box-shadow:none}.btn-outline-secondary:hover{background-color:var(--ls-color-secondary);color:var(--ls-color-white)}.btn-outline-success{border-color:var(--ls-color-success);color:var(--ls-color-success);background-color:transparent;box-shadow:none}.btn-outline-success:hover{background-color:var(--ls-color-success);color:var(--ls-color-white)}.btn-outline-error{border-color:var(--ls-color-danger);color:var(--ls-color-danger);background-color:transparent;box-shadow:none}.btn-outline-error:hover{background-color:var(--ls-color-danger);color:var(--ls-color-white)}.btn-outline-warning{border-color:var(--ls-color-warning);color:var(--ls-color-warning);background-color:transparent;box-shadow:none}.btn-outline-warning:hover{background-color:var(--ls-color-warning);color:var(--ls-color-white)}.btn-outline-info{border-color:var(--ls-color-info);color:var(--ls-color-info);background-color:transparent;box-shadow:none}.btn-outline-info:hover{background-color:var(--ls-color-info);color:var(--ls-color-white)}.btn-outline-dark{border-color:var(--ls-color-dark);color:var(--ls-color-dark);background-color:transparent;box-shadow:none}.btn-outline-dark:hover{background-color:var(--ls-color-dark);color:var(--ls-color-white)}.btn-text-primary{border-color:transparent;background-color:transparent;color:var(--ls-color-primary);box-shadow:none}.btn-text-primary:hover{background-color:#4361ee1a}.btn-text-secondary{border-color:transparent;background-color:transparent;color:var(--ls-color-secondary);box-shadow:none}.btn-text-secondary:hover{background-color:#805dca1a}.btn-text-success{border-color:transparent;background-color:transparent;color:var(--ls-color-success);box-shadow:none}.btn-text-success:hover{background-color:#00ab551a}.btn-text-error{border-color:transparent;background-color:transparent;color:var(--ls-color-danger);box-shadow:none}.btn-text-error:hover{background-color:#e7515a1a}.btn-text-warning{border-color:transparent;background-color:transparent;color:var(--ls-color-warning);box-shadow:none}.btn-text-warning:hover{background-color:#e2a03f1a}.btn-text-info{border-color:transparent;background-color:transparent;color:var(--ls-color-info);box-shadow:none}.btn-text-info:hover{background-color:#2196f31a}.btn-text-dark{border-color:transparent;background-color:transparent;color:var(--ls-color-dark);box-shadow:none}.btn-text-dark:hover{background-color:#3b3f5c1a}.btn-gradient{background:linear-gradient(to right,var(--ls-gradient-start),var(--ls-gradient-end));color:var(--ls-color-white);border-color:transparent}.btn-gradient:hover{background:linear-gradient(to right,var(--ls-gradient-end),var(--ls-gradient-start))}.btn-full-width{width:100%}.btn-rounded{border-radius:var(--ls-border-radius-full)}.btn-spinner{animation:ls-spin 1s linear infinite;height:1rem;width:1rem}.btn-spinner-circle{opacity:.25}.btn-spinner-path{opacity:.75}.btn-icon{flex-shrink:0;display:inline-flex}.btn-icon>svg{height:100%;width:100%}.btn-icon--start{margin-inline-end:.375rem}.btn-icon--end{margin-inline-start:.375rem}.btn-icon--sm{height:.875rem;width:.875rem}.btn-icon--md{height:1rem;width:1rem}.btn-icon--lg{height:1.25rem;width:1.25rem}.btn-loading-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.btn-loading-inline{display:inline-flex;align-items:center}.btn-loading-inline--start{margin-inline-end:.5rem}.btn-loading-inline--end{margin-inline-start:.5rem}.btn-content--hidden{visibility:hidden}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
387
|
+
}
|
|
388
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
389
|
+
type: Component,
|
|
390
|
+
args: [{ selector: 'ls-button', standalone: true, imports: [NgTemplateOutlet], template: `
|
|
391
|
+
<button
|
|
392
|
+
[type]="type()"
|
|
393
|
+
[disabled]="disabled() || loading()"
|
|
394
|
+
[class]="buttonClasses"
|
|
395
|
+
(click)="onClick($event)">
|
|
396
|
+
<ng-template #spinner>
|
|
397
|
+
<svg class="btn-spinner" viewBox="0 0 24 24" fill="none">
|
|
398
|
+
<circle
|
|
399
|
+
class="btn-spinner-circle"
|
|
400
|
+
cx="12"
|
|
401
|
+
cy="12"
|
|
402
|
+
r="10"
|
|
403
|
+
stroke="currentColor"
|
|
404
|
+
stroke-width="4" />
|
|
405
|
+
<path
|
|
406
|
+
class="btn-spinner-path"
|
|
407
|
+
fill="currentColor"
|
|
408
|
+
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" />
|
|
409
|
+
</svg>
|
|
410
|
+
</ng-template>
|
|
411
|
+
|
|
412
|
+
@if (showStartIcon) {
|
|
413
|
+
<span
|
|
414
|
+
class="btn-icon btn-icon--start"
|
|
415
|
+
[class]="iconSizeClass"
|
|
416
|
+
[innerHTML]="sanitizedStartIcon"></span>
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
@if (loading() && isCustomText) {
|
|
420
|
+
<span class="btn-loading-overlay">
|
|
421
|
+
{{ loadingIndicator() }}
|
|
422
|
+
</span>
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
@if (loading() && !isCustomText && loadingPosition() === 'start') {
|
|
426
|
+
<span class="btn-loading-inline btn-loading-inline--start">
|
|
427
|
+
<ng-container *ngTemplateOutlet="spinner" />
|
|
428
|
+
</span>
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
@if (loading() && !isCustomText && loadingPosition() === 'center') {
|
|
432
|
+
<span class="btn-loading-overlay">
|
|
433
|
+
<ng-container *ngTemplateOutlet="spinner" />
|
|
434
|
+
</span>
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
<span
|
|
438
|
+
[class]="
|
|
439
|
+
loading() && (isCustomText || loadingPosition() === 'center')
|
|
440
|
+
? 'btn-content--hidden'
|
|
441
|
+
: ''
|
|
442
|
+
">
|
|
443
|
+
<ng-content />
|
|
444
|
+
</span>
|
|
445
|
+
|
|
446
|
+
@if (loading() && !isCustomText && loadingPosition() === 'end') {
|
|
447
|
+
<span class="btn-loading-inline btn-loading-inline--end">
|
|
448
|
+
<ng-container *ngTemplateOutlet="spinner" />
|
|
449
|
+
</span>
|
|
450
|
+
}
|
|
451
|
+
@if (showEndIcon) {
|
|
452
|
+
<span
|
|
453
|
+
class="btn-icon btn-icon--end"
|
|
454
|
+
[class]="iconSizeClass"
|
|
455
|
+
[innerHTML]="sanitizedEndIcon"></span>
|
|
456
|
+
}
|
|
457
|
+
</button>
|
|
458
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:contents}.btn{position:relative;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--ls-border-radius-md);border:1px solid;padding:.5rem 1.25rem;font-size:.875rem;line-height:1.25rem;font-weight:600;box-shadow:0 10px 20px -10px;outline:none;transition:all var(--ls-transition-duration) ease;cursor:pointer}.btn-lg{padding:.625rem 1.75rem;font-size:1rem;line-height:1.5rem}.btn-sm{padding:.375rem .625rem;font-size:.75rem;line-height:1rem}.btn[disabled]{cursor:not-allowed;opacity:.6}.btn-primary{border-color:var(--ls-color-primary);background-color:var(--ls-color-primary);color:var(--ls-color-white);box-shadow:0 10px 20px -10px #4361ee99}.btn-primary:hover{filter:brightness(.9)}.btn-secondary{border-color:var(--ls-color-secondary);background-color:var(--ls-color-secondary);color:var(--ls-color-white);box-shadow:0 10px 20px -10px #805dca99}.btn-secondary:hover{filter:brightness(.9)}.btn-success{border-color:var(--ls-color-success);background-color:var(--ls-color-success);color:var(--ls-color-white);box-shadow:0 10px 20px -10px #00ab5599}.btn-success:hover{filter:brightness(.9)}.btn-error{border-color:var(--ls-color-danger);background-color:var(--ls-color-danger);color:var(--ls-color-white);box-shadow:0 10px 20px -10px #e7515a99}.btn-error:hover{filter:brightness(.9)}.btn-warning{border-color:var(--ls-color-warning);background-color:var(--ls-color-warning);color:var(--ls-color-white);box-shadow:0 10px 20px -10px #e2a03f99}.btn-warning:hover{filter:brightness(.9)}.btn-info{border-color:var(--ls-color-info);background-color:var(--ls-color-info);color:var(--ls-color-white);box-shadow:0 10px 20px -10px #2196f399}.btn-info:hover{filter:brightness(.9)}.btn-dark{border-color:var(--ls-color-dark);background-color:var(--ls-color-dark);color:var(--ls-color-white);box-shadow:0 10px 20px -10px #3b3f5c99}.btn-dark:hover{filter:brightness(.9)}.btn-outline-primary{border-color:var(--ls-color-primary);color:var(--ls-color-primary);background-color:transparent;box-shadow:none}.btn-outline-primary:hover{background-color:var(--ls-color-primary);color:var(--ls-color-white)}.btn-outline-secondary{border-color:var(--ls-color-secondary);color:var(--ls-color-secondary);background-color:transparent;box-shadow:none}.btn-outline-secondary:hover{background-color:var(--ls-color-secondary);color:var(--ls-color-white)}.btn-outline-success{border-color:var(--ls-color-success);color:var(--ls-color-success);background-color:transparent;box-shadow:none}.btn-outline-success:hover{background-color:var(--ls-color-success);color:var(--ls-color-white)}.btn-outline-error{border-color:var(--ls-color-danger);color:var(--ls-color-danger);background-color:transparent;box-shadow:none}.btn-outline-error:hover{background-color:var(--ls-color-danger);color:var(--ls-color-white)}.btn-outline-warning{border-color:var(--ls-color-warning);color:var(--ls-color-warning);background-color:transparent;box-shadow:none}.btn-outline-warning:hover{background-color:var(--ls-color-warning);color:var(--ls-color-white)}.btn-outline-info{border-color:var(--ls-color-info);color:var(--ls-color-info);background-color:transparent;box-shadow:none}.btn-outline-info:hover{background-color:var(--ls-color-info);color:var(--ls-color-white)}.btn-outline-dark{border-color:var(--ls-color-dark);color:var(--ls-color-dark);background-color:transparent;box-shadow:none}.btn-outline-dark:hover{background-color:var(--ls-color-dark);color:var(--ls-color-white)}.btn-text-primary{border-color:transparent;background-color:transparent;color:var(--ls-color-primary);box-shadow:none}.btn-text-primary:hover{background-color:#4361ee1a}.btn-text-secondary{border-color:transparent;background-color:transparent;color:var(--ls-color-secondary);box-shadow:none}.btn-text-secondary:hover{background-color:#805dca1a}.btn-text-success{border-color:transparent;background-color:transparent;color:var(--ls-color-success);box-shadow:none}.btn-text-success:hover{background-color:#00ab551a}.btn-text-error{border-color:transparent;background-color:transparent;color:var(--ls-color-danger);box-shadow:none}.btn-text-error:hover{background-color:#e7515a1a}.btn-text-warning{border-color:transparent;background-color:transparent;color:var(--ls-color-warning);box-shadow:none}.btn-text-warning:hover{background-color:#e2a03f1a}.btn-text-info{border-color:transparent;background-color:transparent;color:var(--ls-color-info);box-shadow:none}.btn-text-info:hover{background-color:#2196f31a}.btn-text-dark{border-color:transparent;background-color:transparent;color:var(--ls-color-dark);box-shadow:none}.btn-text-dark:hover{background-color:#3b3f5c1a}.btn-gradient{background:linear-gradient(to right,var(--ls-gradient-start),var(--ls-gradient-end));color:var(--ls-color-white);border-color:transparent}.btn-gradient:hover{background:linear-gradient(to right,var(--ls-gradient-end),var(--ls-gradient-start))}.btn-full-width{width:100%}.btn-rounded{border-radius:var(--ls-border-radius-full)}.btn-spinner{animation:ls-spin 1s linear infinite;height:1rem;width:1rem}.btn-spinner-circle{opacity:.25}.btn-spinner-path{opacity:.75}.btn-icon{flex-shrink:0;display:inline-flex}.btn-icon>svg{height:100%;width:100%}.btn-icon--start{margin-inline-end:.375rem}.btn-icon--end{margin-inline-start:.375rem}.btn-icon--sm{height:.875rem;width:.875rem}.btn-icon--md{height:1rem;width:1rem}.btn-icon--lg{height:1.25rem;width:1.25rem}.btn-loading-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.btn-loading-inline{display:inline-flex;align-items:center}.btn-loading-inline--start{margin-inline-end:.5rem}.btn-loading-inline--end{margin-inline-start:.5rem}.btn-content--hidden{visibility:hidden}\n"] }]
|
|
459
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], startIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "startIcon", required: false }] }], endIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "endIcon", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], loadingIndicator: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingIndicator", required: false }] }], loadingPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingPosition", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
460
|
+
|
|
461
|
+
const INDETERMINATE_SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">' +
|
|
462
|
+
'<path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm-2 10H7v-2h10v2z"/>' +
|
|
463
|
+
'</svg>';
|
|
464
|
+
class CheckboxComponent {
|
|
465
|
+
constructor() {
|
|
466
|
+
this._sanitizer = inject(DomSanitizer);
|
|
467
|
+
this.icon = input.required(...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
468
|
+
this.checkedIcon = input.required(...(ngDevMode ? [{ debugName: "checkedIcon" }] : []));
|
|
469
|
+
this.checked = input(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
470
|
+
this.defaultChecked = input(false, ...(ngDevMode ? [{ debugName: "defaultChecked" }] : []));
|
|
471
|
+
this.color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
472
|
+
this.size = input('medium', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
473
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
474
|
+
this.indeterminate = input(false, ...(ngDevMode ? [{ debugName: "indeterminate" }] : []));
|
|
475
|
+
this.labelPlacement = input('end', ...(ngDevMode ? [{ debugName: "labelPlacement" }] : []));
|
|
476
|
+
this.changed = output();
|
|
477
|
+
this._isChecked = signal(false, ...(ngDevMode ? [{ debugName: "_isChecked" }] : []));
|
|
478
|
+
this._isFirstSync = true;
|
|
479
|
+
this._syncChecked = effect(() => {
|
|
480
|
+
const checked = this.checked();
|
|
481
|
+
if (this._isFirstSync) {
|
|
482
|
+
this._isFirstSync = false;
|
|
483
|
+
this._isChecked.set(checked || this.defaultChecked());
|
|
484
|
+
}
|
|
485
|
+
else {
|
|
486
|
+
this._isChecked.set(checked);
|
|
487
|
+
}
|
|
488
|
+
}, ...(ngDevMode ? [{ debugName: "_syncChecked" }] : []));
|
|
489
|
+
this.checkboxClasses = computed(() => {
|
|
490
|
+
const s = this.size() === 'small' ? 'sm' : 'md';
|
|
491
|
+
const parts = [
|
|
492
|
+
'checkbox',
|
|
493
|
+
`checkbox-${s}`,
|
|
494
|
+
`checkbox-color-${this.color()}`,
|
|
495
|
+
`checkbox-label-${this.labelPlacement()}`,
|
|
496
|
+
];
|
|
497
|
+
if (this._isChecked()) {
|
|
498
|
+
parts.push('checkbox-checked');
|
|
499
|
+
}
|
|
500
|
+
if (this.disabled()) {
|
|
501
|
+
parts.push('checkbox-disabled');
|
|
502
|
+
}
|
|
503
|
+
if (this.indeterminate()) {
|
|
504
|
+
parts.push('checkbox-indeterminate');
|
|
505
|
+
}
|
|
506
|
+
return parts.join(' ');
|
|
507
|
+
}, ...(ngDevMode ? [{ debugName: "checkboxClasses" }] : []));
|
|
508
|
+
this.currentIcon = computed(() => {
|
|
509
|
+
let svg;
|
|
510
|
+
if (this.indeterminate()) {
|
|
511
|
+
svg = INDETERMINATE_SVG;
|
|
512
|
+
}
|
|
513
|
+
else if (this._isChecked()) {
|
|
514
|
+
svg = this.checkedIcon();
|
|
515
|
+
}
|
|
516
|
+
else {
|
|
517
|
+
svg = this.icon();
|
|
518
|
+
}
|
|
519
|
+
return this._sanitizer.bypassSecurityTrustHtml(svg);
|
|
520
|
+
}, ...(ngDevMode ? [{ debugName: "currentIcon" }] : []));
|
|
521
|
+
}
|
|
522
|
+
onToggle() {
|
|
523
|
+
if (this.disabled()) {
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
const next = !this._isChecked();
|
|
527
|
+
this._isChecked.set(next);
|
|
528
|
+
this.changed.emit(next);
|
|
529
|
+
}
|
|
530
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
531
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.2", type: CheckboxComponent, isStandalone: true, selector: "ls-checkbox", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, checkedIcon: { classPropertyName: "checkedIcon", publicName: "checkedIcon", isSignal: true, isRequired: true, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, defaultChecked: { classPropertyName: "defaultChecked", publicName: "defaultChecked", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, labelPlacement: { classPropertyName: "labelPlacement", publicName: "labelPlacement", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed" }, ngImport: i0, template: `
|
|
532
|
+
<label [class]="checkboxClasses()">
|
|
533
|
+
<input
|
|
534
|
+
type="checkbox"
|
|
535
|
+
class="checkbox-input"
|
|
536
|
+
[checked]="_isChecked()"
|
|
537
|
+
[disabled]="disabled()"
|
|
538
|
+
[indeterminate]="indeterminate()"
|
|
539
|
+
(change)="onToggle()"
|
|
540
|
+
/>
|
|
541
|
+
<span
|
|
542
|
+
class="checkbox-icon"
|
|
543
|
+
[innerHTML]="currentIcon()"
|
|
544
|
+
></span>
|
|
545
|
+
<span class="checkbox-label">
|
|
546
|
+
<ng-content />
|
|
547
|
+
</span>
|
|
548
|
+
</label>
|
|
549
|
+
`, isInline: true, styles: [":host{display:inline-flex}.checkbox{display:inline-flex;align-items:center;gap:8px;cursor:pointer;position:relative;transition:opacity var(--ls-transition-duration)}.checkbox-input{position:absolute;opacity:0;width:0;height:0;margin:0;padding:0;pointer-events:none}.checkbox-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;line-height:0}.checkbox-icon svg{width:100%;height:100%}.checkbox-label{-webkit-user-select:none;user-select:none;cursor:pointer}.checkbox-sm .checkbox-icon{width:18px;height:18px}.checkbox-sm .checkbox-label{font-size:.875rem}.checkbox-md .checkbox-icon{width:1.25rem;height:1.25rem}.checkbox-md .checkbox-label{font-size:.875rem}.checkbox-label-end{flex-direction:row}.checkbox-label-start{flex-direction:row-reverse}.checkbox-label-top{flex-direction:column-reverse;align-items:center}.checkbox-label-bottom{flex-direction:column;align-items:center}.checkbox-color-inherit.checkbox-checked .checkbox-icon,.checkbox-color-inherit.checkbox-indeterminate .checkbox-icon{color:inherit}.checkbox-color-primary.checkbox-checked .checkbox-icon,.checkbox-color-primary.checkbox-indeterminate .checkbox-icon{color:var(--ls-color-primary)}.checkbox-color-secondary.checkbox-checked .checkbox-icon,.checkbox-color-secondary.checkbox-indeterminate .checkbox-icon{color:var(--ls-color-secondary)}.checkbox-color-success.checkbox-checked .checkbox-icon,.checkbox-color-success.checkbox-indeterminate .checkbox-icon{color:var(--ls-color-success)}.checkbox-color-error.checkbox-checked .checkbox-icon,.checkbox-color-error.checkbox-indeterminate .checkbox-icon{color:var(--ls-color-danger)}.checkbox-color-info.checkbox-checked .checkbox-icon,.checkbox-color-info.checkbox-indeterminate .checkbox-icon{color:var(--ls-color-info)}.checkbox-color-warning.checkbox-checked .checkbox-icon,.checkbox-color-warning.checkbox-indeterminate .checkbox-icon{color:var(--ls-color-warning)}.checkbox:not(.checkbox-checked):not(.checkbox-indeterminate) .checkbox-icon{color:var(--ls-color-dark)}.checkbox-disabled{cursor:not-allowed;opacity:.5}.checkbox-disabled .checkbox-label{cursor:not-allowed}.checkbox-input:focus-visible+.checkbox-icon{outline:2px solid currentColor;outline-offset:2px;border-radius:2px}body.dark .checkbox:not(.checkbox-checked):not(.checkbox-indeterminate) .checkbox-icon{color:#e0e6ed}body.dark .checkbox-label{color:#e0e6ed}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
550
|
+
}
|
|
551
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
552
|
+
type: Component,
|
|
553
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ls-checkbox', standalone: true, template: `
|
|
554
|
+
<label [class]="checkboxClasses()">
|
|
555
|
+
<input
|
|
556
|
+
type="checkbox"
|
|
557
|
+
class="checkbox-input"
|
|
558
|
+
[checked]="_isChecked()"
|
|
559
|
+
[disabled]="disabled()"
|
|
560
|
+
[indeterminate]="indeterminate()"
|
|
561
|
+
(change)="onToggle()"
|
|
562
|
+
/>
|
|
563
|
+
<span
|
|
564
|
+
class="checkbox-icon"
|
|
565
|
+
[innerHTML]="currentIcon()"
|
|
566
|
+
></span>
|
|
567
|
+
<span class="checkbox-label">
|
|
568
|
+
<ng-content />
|
|
569
|
+
</span>
|
|
570
|
+
</label>
|
|
571
|
+
`, styles: [":host{display:inline-flex}.checkbox{display:inline-flex;align-items:center;gap:8px;cursor:pointer;position:relative;transition:opacity var(--ls-transition-duration)}.checkbox-input{position:absolute;opacity:0;width:0;height:0;margin:0;padding:0;pointer-events:none}.checkbox-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;line-height:0}.checkbox-icon svg{width:100%;height:100%}.checkbox-label{-webkit-user-select:none;user-select:none;cursor:pointer}.checkbox-sm .checkbox-icon{width:18px;height:18px}.checkbox-sm .checkbox-label{font-size:.875rem}.checkbox-md .checkbox-icon{width:1.25rem;height:1.25rem}.checkbox-md .checkbox-label{font-size:.875rem}.checkbox-label-end{flex-direction:row}.checkbox-label-start{flex-direction:row-reverse}.checkbox-label-top{flex-direction:column-reverse;align-items:center}.checkbox-label-bottom{flex-direction:column;align-items:center}.checkbox-color-inherit.checkbox-checked .checkbox-icon,.checkbox-color-inherit.checkbox-indeterminate .checkbox-icon{color:inherit}.checkbox-color-primary.checkbox-checked .checkbox-icon,.checkbox-color-primary.checkbox-indeterminate .checkbox-icon{color:var(--ls-color-primary)}.checkbox-color-secondary.checkbox-checked .checkbox-icon,.checkbox-color-secondary.checkbox-indeterminate .checkbox-icon{color:var(--ls-color-secondary)}.checkbox-color-success.checkbox-checked .checkbox-icon,.checkbox-color-success.checkbox-indeterminate .checkbox-icon{color:var(--ls-color-success)}.checkbox-color-error.checkbox-checked .checkbox-icon,.checkbox-color-error.checkbox-indeterminate .checkbox-icon{color:var(--ls-color-danger)}.checkbox-color-info.checkbox-checked .checkbox-icon,.checkbox-color-info.checkbox-indeterminate .checkbox-icon{color:var(--ls-color-info)}.checkbox-color-warning.checkbox-checked .checkbox-icon,.checkbox-color-warning.checkbox-indeterminate .checkbox-icon{color:var(--ls-color-warning)}.checkbox:not(.checkbox-checked):not(.checkbox-indeterminate) .checkbox-icon{color:var(--ls-color-dark)}.checkbox-disabled{cursor:not-allowed;opacity:.5}.checkbox-disabled .checkbox-label{cursor:not-allowed}.checkbox-input:focus-visible+.checkbox-icon{outline:2px solid currentColor;outline-offset:2px;border-radius:2px}body.dark .checkbox:not(.checkbox-checked):not(.checkbox-indeterminate) .checkbox-icon{color:#e0e6ed}body.dark .checkbox-label{color:#e0e6ed}\n"] }]
|
|
572
|
+
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], checkedIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkedIcon", required: true }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], defaultChecked: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultChecked", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], labelPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPlacement", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }] } });
|
|
573
|
+
|
|
574
|
+
class IconButtonComponent {
|
|
575
|
+
constructor() {
|
|
576
|
+
this.sanitizer = inject(DomSanitizer);
|
|
577
|
+
this.icon = input.required(...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
578
|
+
this.ariaLabel = input.required(...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
579
|
+
this.color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
580
|
+
this.size = input('medium', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
581
|
+
this.type = input('button', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
582
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
583
|
+
this.loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
584
|
+
this.clicked = output();
|
|
585
|
+
}
|
|
586
|
+
get sanitizedIcon() {
|
|
587
|
+
return this.sanitizer.bypassSecurityTrustHtml(this.icon());
|
|
588
|
+
}
|
|
589
|
+
get buttonClasses() {
|
|
590
|
+
const classes = ['icon-btn'];
|
|
591
|
+
classes.push(`icon-btn-${this.color()}`);
|
|
592
|
+
switch (this.size()) {
|
|
593
|
+
case 'small':
|
|
594
|
+
classes.push('icon-btn-sm');
|
|
595
|
+
break;
|
|
596
|
+
case 'large':
|
|
597
|
+
classes.push('icon-btn-lg');
|
|
598
|
+
break;
|
|
599
|
+
default:
|
|
600
|
+
classes.push('icon-btn-md');
|
|
601
|
+
}
|
|
602
|
+
return classes.join(' ');
|
|
603
|
+
}
|
|
604
|
+
onClick(event) {
|
|
605
|
+
if (!this.disabled() && !this.loading()) {
|
|
606
|
+
this.clicked.emit(event);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: IconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
610
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: IconButtonComponent, isStandalone: true, selector: "ls-icon-button", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: true, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: `
|
|
611
|
+
<button
|
|
612
|
+
[type]="type()"
|
|
613
|
+
[disabled]="disabled() || loading()"
|
|
614
|
+
[class]="buttonClasses"
|
|
615
|
+
[attr.aria-label]="ariaLabel()"
|
|
616
|
+
[attr.aria-busy]="loading() || null"
|
|
617
|
+
(click)="onClick($event)">
|
|
618
|
+
@if (loading()) {
|
|
619
|
+
<svg class="icon-btn-spinner" viewBox="0 0 24 24" fill="none">
|
|
620
|
+
<circle
|
|
621
|
+
class="icon-btn-spinner-circle"
|
|
622
|
+
cx="12"
|
|
623
|
+
cy="12"
|
|
624
|
+
r="10"
|
|
625
|
+
stroke="currentColor"
|
|
626
|
+
stroke-width="4" />
|
|
627
|
+
<path
|
|
628
|
+
class="icon-btn-spinner-path"
|
|
629
|
+
fill="currentColor"
|
|
630
|
+
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" />
|
|
631
|
+
</svg>
|
|
632
|
+
} @else {
|
|
633
|
+
<span class="icon-btn-icon" [innerHTML]="sanitizedIcon"></span>
|
|
634
|
+
}
|
|
635
|
+
</button>
|
|
636
|
+
`, isInline: true, styles: [":host{display:inline-flex}.icon-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:var(--ls-border-radius-full);background-color:transparent;padding:0;outline:none;cursor:pointer;transition:all var(--ls-transition-duration) ease;box-shadow:none}.icon-btn-sm{width:32px;height:32px}.icon-btn-md{width:40px;height:40px}.icon-btn-lg{width:48px;height:48px}.icon-btn-sm .icon-btn-icon,.icon-btn-sm .icon-btn-spinner{width:18px;height:18px}.icon-btn-md .icon-btn-icon,.icon-btn-md .icon-btn-spinner{width:24px;height:24px}.icon-btn-lg .icon-btn-icon,.icon-btn-lg .icon-btn-spinner{width:28px;height:28px}.icon-btn-primary{color:var(--ls-color-primary)}.icon-btn-primary:hover{background-color:#4361ee1a}.icon-btn-secondary{color:var(--ls-color-secondary)}.icon-btn-secondary:hover{background-color:#805dca1a}.icon-btn-success{color:var(--ls-color-success)}.icon-btn-success:hover{background-color:#00ab551a}.icon-btn-error{color:var(--ls-color-danger)}.icon-btn-error:hover{background-color:#e7515a1a}.icon-btn-warning{color:var(--ls-color-warning)}.icon-btn-warning:hover{background-color:#e2a03f1a}.icon-btn-info{color:var(--ls-color-info)}.icon-btn-info:hover{background-color:#2196f31a}.icon-btn-dark{color:var(--ls-color-dark)}.icon-btn-dark:hover{background-color:#3b3f5c1a}.icon-btn:focus-visible{outline:2px solid currentColor;outline-offset:2px}.icon-btn[disabled]{cursor:not-allowed;opacity:.6}.icon-btn[disabled]:hover{background-color:transparent}.icon-btn-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.icon-btn-icon>svg,.icon-btn-icon svg{width:100%;height:100%}.icon-btn-spinner{animation:ls-spin 1s linear infinite}.icon-btn-spinner-circle{opacity:.25}.icon-btn-spinner-path{opacity:.75}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
637
|
+
}
|
|
638
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: IconButtonComponent, decorators: [{
|
|
639
|
+
type: Component,
|
|
640
|
+
args: [{ selector: 'ls-icon-button', standalone: true, template: `
|
|
641
|
+
<button
|
|
642
|
+
[type]="type()"
|
|
643
|
+
[disabled]="disabled() || loading()"
|
|
644
|
+
[class]="buttonClasses"
|
|
645
|
+
[attr.aria-label]="ariaLabel()"
|
|
646
|
+
[attr.aria-busy]="loading() || null"
|
|
647
|
+
(click)="onClick($event)">
|
|
648
|
+
@if (loading()) {
|
|
649
|
+
<svg class="icon-btn-spinner" viewBox="0 0 24 24" fill="none">
|
|
650
|
+
<circle
|
|
651
|
+
class="icon-btn-spinner-circle"
|
|
652
|
+
cx="12"
|
|
653
|
+
cy="12"
|
|
654
|
+
r="10"
|
|
655
|
+
stroke="currentColor"
|
|
656
|
+
stroke-width="4" />
|
|
657
|
+
<path
|
|
658
|
+
class="icon-btn-spinner-path"
|
|
659
|
+
fill="currentColor"
|
|
660
|
+
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" />
|
|
661
|
+
</svg>
|
|
662
|
+
} @else {
|
|
663
|
+
<span class="icon-btn-icon" [innerHTML]="sanitizedIcon"></span>
|
|
664
|
+
}
|
|
665
|
+
</button>
|
|
666
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-flex}.icon-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:var(--ls-border-radius-full);background-color:transparent;padding:0;outline:none;cursor:pointer;transition:all var(--ls-transition-duration) ease;box-shadow:none}.icon-btn-sm{width:32px;height:32px}.icon-btn-md{width:40px;height:40px}.icon-btn-lg{width:48px;height:48px}.icon-btn-sm .icon-btn-icon,.icon-btn-sm .icon-btn-spinner{width:18px;height:18px}.icon-btn-md .icon-btn-icon,.icon-btn-md .icon-btn-spinner{width:24px;height:24px}.icon-btn-lg .icon-btn-icon,.icon-btn-lg .icon-btn-spinner{width:28px;height:28px}.icon-btn-primary{color:var(--ls-color-primary)}.icon-btn-primary:hover{background-color:#4361ee1a}.icon-btn-secondary{color:var(--ls-color-secondary)}.icon-btn-secondary:hover{background-color:#805dca1a}.icon-btn-success{color:var(--ls-color-success)}.icon-btn-success:hover{background-color:#00ab551a}.icon-btn-error{color:var(--ls-color-danger)}.icon-btn-error:hover{background-color:#e7515a1a}.icon-btn-warning{color:var(--ls-color-warning)}.icon-btn-warning:hover{background-color:#e2a03f1a}.icon-btn-info{color:var(--ls-color-info)}.icon-btn-info:hover{background-color:#2196f31a}.icon-btn-dark{color:var(--ls-color-dark)}.icon-btn-dark:hover{background-color:#3b3f5c1a}.icon-btn:focus-visible{outline:2px solid currentColor;outline-offset:2px}.icon-btn[disabled]{cursor:not-allowed;opacity:.6}.icon-btn[disabled]:hover{background-color:transparent}.icon-btn-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.icon-btn-icon>svg,.icon-btn-icon svg{width:100%;height:100%}.icon-btn-spinner{animation:ls-spin 1s linear infinite}.icon-btn-spinner-circle{opacity:.25}.icon-btn-spinner-path{opacity:.75}\n"] }]
|
|
667
|
+
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: true }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
668
|
+
|
|
669
|
+
class RadioButtonComponent {
|
|
670
|
+
constructor() {
|
|
671
|
+
this.checked = input(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
672
|
+
this.color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
673
|
+
this.size = input('medium', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
674
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
675
|
+
this.labelPlacement = input('end', ...(ngDevMode ? [{ debugName: "labelPlacement" }] : []));
|
|
676
|
+
this.changed = output();
|
|
677
|
+
this._isChecked = signal(false, ...(ngDevMode ? [{ debugName: "_isChecked" }] : []));
|
|
678
|
+
this._isDisabledByCva = signal(false, ...(ngDevMode ? [{ debugName: "_isDisabledByCva" }] : []));
|
|
679
|
+
this._onChange = () => { };
|
|
680
|
+
this._onTouched = () => { };
|
|
681
|
+
this._syncChecked = effect(() => {
|
|
682
|
+
this._isChecked.set(this.checked());
|
|
683
|
+
}, ...(ngDevMode ? [{ debugName: "_syncChecked" }] : []));
|
|
684
|
+
this.radioClasses = computed(() => {
|
|
685
|
+
const s = this.size() === 'small' ? 'sm' : 'md';
|
|
686
|
+
const parts = [
|
|
687
|
+
'radio',
|
|
688
|
+
`radio-${s}`,
|
|
689
|
+
`radio-color-${this.color()}`,
|
|
690
|
+
`radio-label-${this.labelPlacement()}`,
|
|
691
|
+
];
|
|
692
|
+
if (this._isChecked()) {
|
|
693
|
+
parts.push('radio-checked');
|
|
694
|
+
}
|
|
695
|
+
if (this.isEffectivelyDisabled()) {
|
|
696
|
+
parts.push('radio-disabled');
|
|
697
|
+
}
|
|
698
|
+
return parts.join(' ');
|
|
699
|
+
}, ...(ngDevMode ? [{ debugName: "radioClasses" }] : []));
|
|
700
|
+
this.isEffectivelyDisabled = computed(() => this.disabled() || this._isDisabledByCva(), ...(ngDevMode ? [{ debugName: "isEffectivelyDisabled" }] : []));
|
|
701
|
+
}
|
|
702
|
+
onToggle() {
|
|
703
|
+
if (this.isEffectivelyDisabled()) {
|
|
704
|
+
return;
|
|
705
|
+
}
|
|
706
|
+
const isNext = !this._isChecked();
|
|
707
|
+
this._isChecked.set(isNext);
|
|
708
|
+
this.changed.emit(isNext);
|
|
709
|
+
this._onChange(isNext);
|
|
710
|
+
this._onTouched();
|
|
711
|
+
}
|
|
712
|
+
writeValue(value) {
|
|
713
|
+
this._isChecked.set(!!value);
|
|
714
|
+
}
|
|
715
|
+
registerOnChange(fn) {
|
|
716
|
+
this._onChange = fn;
|
|
717
|
+
}
|
|
718
|
+
registerOnTouched(fn) {
|
|
719
|
+
this._onTouched = fn;
|
|
720
|
+
}
|
|
721
|
+
setDisabledState(isDisabled) {
|
|
722
|
+
this._isDisabledByCva.set(isDisabled);
|
|
723
|
+
}
|
|
724
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: RadioButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
725
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.2", type: RadioButtonComponent, isStandalone: true, selector: "ls-radio-button", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, labelPlacement: { classPropertyName: "labelPlacement", publicName: "labelPlacement", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed" }, providers: [
|
|
726
|
+
{
|
|
727
|
+
provide: NG_VALUE_ACCESSOR,
|
|
728
|
+
useExisting: forwardRef(() => RadioButtonComponent),
|
|
729
|
+
multi: true,
|
|
730
|
+
},
|
|
731
|
+
], ngImport: i0, template: `
|
|
732
|
+
<label [class]="radioClasses()">
|
|
733
|
+
<button
|
|
734
|
+
type="button"
|
|
735
|
+
role="radio"
|
|
736
|
+
class="radio-indicator"
|
|
737
|
+
[attr.aria-checked]="_isChecked()"
|
|
738
|
+
[disabled]="isEffectivelyDisabled()"
|
|
739
|
+
(click)="onToggle()"
|
|
740
|
+
(keydown.space)="onToggle(); $event.preventDefault()"
|
|
741
|
+
(keydown.enter)="onToggle(); $event.preventDefault()">
|
|
742
|
+
</button>
|
|
743
|
+
<span class="radio-label">
|
|
744
|
+
<ng-content />
|
|
745
|
+
</span>
|
|
746
|
+
</label>
|
|
747
|
+
`, isInline: true, styles: [":host{display:inline-flex}.radio{display:inline-flex;align-items:center;gap:8px;cursor:pointer;position:relative}.radio-indicator{position:relative;display:inline-flex;align-items:center;justify-content:center;border:2px solid #c4c4c4;border-radius:50%;background-color:transparent;padding:0;cursor:pointer;transition:border-color var(--ls-transition-duration),background-color var(--ls-transition-duration);outline:none;flex-shrink:0}.radio-indicator:after{content:\"\";position:absolute;border-radius:50%;transform:scale(0);transition:transform var(--ls-transition-duration)}.radio-checked .radio-indicator:after{transform:scale(1)}.radio-label{-webkit-user-select:none;user-select:none;cursor:pointer;font-size:.875rem}.radio-sm .radio-indicator{width:16px;height:16px}.radio-sm .radio-indicator:after{width:8px;height:8px}.radio-md .radio-indicator{width:20px;height:20px}.radio-md .radio-indicator:after{width:10px;height:10px}.radio-checked.radio-color-inherit .radio-indicator{border-color:inherit}.radio-checked.radio-color-inherit .radio-indicator:after{background-color:inherit}.radio-checked.radio-color-primary .radio-indicator{border-color:var(--ls-color-primary)}.radio-checked.radio-color-primary .radio-indicator:after{background-color:var(--ls-color-primary)}.radio-checked.radio-color-secondary .radio-indicator{border-color:var(--ls-color-secondary)}.radio-checked.radio-color-secondary .radio-indicator:after{background-color:var(--ls-color-secondary)}.radio-checked.radio-color-success .radio-indicator{border-color:var(--ls-color-success)}.radio-checked.radio-color-success .radio-indicator:after{background-color:var(--ls-color-success)}.radio-checked.radio-color-error .radio-indicator{border-color:var(--ls-color-error)}.radio-checked.radio-color-error .radio-indicator:after{background-color:var(--ls-color-error)}.radio-checked.radio-color-info .radio-indicator{border-color:var(--ls-color-info)}.radio-checked.radio-color-info .radio-indicator:after{background-color:var(--ls-color-info)}.radio-checked.radio-color-warning .radio-indicator{border-color:var(--ls-color-warning)}.radio-checked.radio-color-warning .radio-indicator:after{background-color:var(--ls-color-warning)}.radio-label-end{flex-direction:row}.radio-label-start{flex-direction:row-reverse}.radio-label-top{flex-direction:column-reverse;align-items:center}.radio-label-bottom{flex-direction:column;align-items:center}.radio-disabled{cursor:not-allowed;opacity:.5;pointer-events:none}.radio-disabled .radio-label,.radio-disabled .radio-indicator{cursor:not-allowed}.radio-indicator:focus-visible{outline:2px solid currentColor;outline-offset:2px;border-radius:50%}body.dark .radio-indicator{border-color:#555}body.dark .radio-label{color:#e0e6ed}body.dark .radio-checked.radio-color-primary .radio-indicator{border-color:var(--ls-color-primary)}body.dark .radio-checked.radio-color-primary .radio-indicator:after{background-color:var(--ls-color-primary)}body.dark .radio-checked.radio-color-secondary .radio-indicator{border-color:var(--ls-color-secondary)}body.dark .radio-checked.radio-color-secondary .radio-indicator:after{background-color:var(--ls-color-secondary)}body.dark .radio-checked.radio-color-success .radio-indicator{border-color:var(--ls-color-success)}body.dark .radio-checked.radio-color-success .radio-indicator:after{background-color:var(--ls-color-success)}body.dark .radio-checked.radio-color-error .radio-indicator{border-color:var(--ls-color-error)}body.dark .radio-checked.radio-color-error .radio-indicator:after{background-color:var(--ls-color-error)}body.dark .radio-checked.radio-color-info .radio-indicator{border-color:var(--ls-color-info)}body.dark .radio-checked.radio-color-info .radio-indicator:after{background-color:var(--ls-color-info)}body.dark .radio-checked.radio-color-warning .radio-indicator{border-color:var(--ls-color-warning)}body.dark .radio-checked.radio-color-warning .radio-indicator:after{background-color:var(--ls-color-warning)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
748
|
+
}
|
|
749
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: RadioButtonComponent, decorators: [{
|
|
750
|
+
type: Component,
|
|
751
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
752
|
+
{
|
|
753
|
+
provide: NG_VALUE_ACCESSOR,
|
|
754
|
+
useExisting: forwardRef(() => RadioButtonComponent),
|
|
755
|
+
multi: true,
|
|
756
|
+
},
|
|
757
|
+
], selector: 'ls-radio-button', standalone: true, template: `
|
|
758
|
+
<label [class]="radioClasses()">
|
|
759
|
+
<button
|
|
760
|
+
type="button"
|
|
761
|
+
role="radio"
|
|
762
|
+
class="radio-indicator"
|
|
763
|
+
[attr.aria-checked]="_isChecked()"
|
|
764
|
+
[disabled]="isEffectivelyDisabled()"
|
|
765
|
+
(click)="onToggle()"
|
|
766
|
+
(keydown.space)="onToggle(); $event.preventDefault()"
|
|
767
|
+
(keydown.enter)="onToggle(); $event.preventDefault()">
|
|
768
|
+
</button>
|
|
769
|
+
<span class="radio-label">
|
|
770
|
+
<ng-content />
|
|
771
|
+
</span>
|
|
772
|
+
</label>
|
|
773
|
+
`, styles: [":host{display:inline-flex}.radio{display:inline-flex;align-items:center;gap:8px;cursor:pointer;position:relative}.radio-indicator{position:relative;display:inline-flex;align-items:center;justify-content:center;border:2px solid #c4c4c4;border-radius:50%;background-color:transparent;padding:0;cursor:pointer;transition:border-color var(--ls-transition-duration),background-color var(--ls-transition-duration);outline:none;flex-shrink:0}.radio-indicator:after{content:\"\";position:absolute;border-radius:50%;transform:scale(0);transition:transform var(--ls-transition-duration)}.radio-checked .radio-indicator:after{transform:scale(1)}.radio-label{-webkit-user-select:none;user-select:none;cursor:pointer;font-size:.875rem}.radio-sm .radio-indicator{width:16px;height:16px}.radio-sm .radio-indicator:after{width:8px;height:8px}.radio-md .radio-indicator{width:20px;height:20px}.radio-md .radio-indicator:after{width:10px;height:10px}.radio-checked.radio-color-inherit .radio-indicator{border-color:inherit}.radio-checked.radio-color-inherit .radio-indicator:after{background-color:inherit}.radio-checked.radio-color-primary .radio-indicator{border-color:var(--ls-color-primary)}.radio-checked.radio-color-primary .radio-indicator:after{background-color:var(--ls-color-primary)}.radio-checked.radio-color-secondary .radio-indicator{border-color:var(--ls-color-secondary)}.radio-checked.radio-color-secondary .radio-indicator:after{background-color:var(--ls-color-secondary)}.radio-checked.radio-color-success .radio-indicator{border-color:var(--ls-color-success)}.radio-checked.radio-color-success .radio-indicator:after{background-color:var(--ls-color-success)}.radio-checked.radio-color-error .radio-indicator{border-color:var(--ls-color-error)}.radio-checked.radio-color-error .radio-indicator:after{background-color:var(--ls-color-error)}.radio-checked.radio-color-info .radio-indicator{border-color:var(--ls-color-info)}.radio-checked.radio-color-info .radio-indicator:after{background-color:var(--ls-color-info)}.radio-checked.radio-color-warning .radio-indicator{border-color:var(--ls-color-warning)}.radio-checked.radio-color-warning .radio-indicator:after{background-color:var(--ls-color-warning)}.radio-label-end{flex-direction:row}.radio-label-start{flex-direction:row-reverse}.radio-label-top{flex-direction:column-reverse;align-items:center}.radio-label-bottom{flex-direction:column;align-items:center}.radio-disabled{cursor:not-allowed;opacity:.5;pointer-events:none}.radio-disabled .radio-label,.radio-disabled .radio-indicator{cursor:not-allowed}.radio-indicator:focus-visible{outline:2px solid currentColor;outline-offset:2px;border-radius:50%}body.dark .radio-indicator{border-color:#555}body.dark .radio-label{color:#e0e6ed}body.dark .radio-checked.radio-color-primary .radio-indicator{border-color:var(--ls-color-primary)}body.dark .radio-checked.radio-color-primary .radio-indicator:after{background-color:var(--ls-color-primary)}body.dark .radio-checked.radio-color-secondary .radio-indicator{border-color:var(--ls-color-secondary)}body.dark .radio-checked.radio-color-secondary .radio-indicator:after{background-color:var(--ls-color-secondary)}body.dark .radio-checked.radio-color-success .radio-indicator{border-color:var(--ls-color-success)}body.dark .radio-checked.radio-color-success .radio-indicator:after{background-color:var(--ls-color-success)}body.dark .radio-checked.radio-color-error .radio-indicator{border-color:var(--ls-color-error)}body.dark .radio-checked.radio-color-error .radio-indicator:after{background-color:var(--ls-color-error)}body.dark .radio-checked.radio-color-info .radio-indicator{border-color:var(--ls-color-info)}body.dark .radio-checked.radio-color-info .radio-indicator:after{background-color:var(--ls-color-info)}body.dark .radio-checked.radio-color-warning .radio-indicator{border-color:var(--ls-color-warning)}body.dark .radio-checked.radio-color-warning .radio-indicator:after{background-color:var(--ls-color-warning)}\n"] }]
|
|
774
|
+
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], labelPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPlacement", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }] } });
|
|
775
|
+
|
|
776
|
+
class SliderComponent {
|
|
777
|
+
constructor() {
|
|
778
|
+
this._renderer = inject(Renderer2);
|
|
779
|
+
this._destroyRef = inject(DestroyRef);
|
|
780
|
+
this._elementRef = inject(ElementRef);
|
|
781
|
+
this.value = model(0, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
782
|
+
this.defaultValue = input(...(ngDevMode ? [undefined, { debugName: "defaultValue" }] : []));
|
|
783
|
+
this.min = input(0, ...(ngDevMode ? [{ debugName: "min" }] : []));
|
|
784
|
+
this.max = input(100, ...(ngDevMode ? [{ debugName: "max" }] : []));
|
|
785
|
+
this.step = input(1, ...(ngDevMode ? [{ debugName: "step" }] : []));
|
|
786
|
+
this.marks = input(false, ...(ngDevMode ? [{ debugName: "marks" }] : []));
|
|
787
|
+
this.color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
788
|
+
this.size = input('medium', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
789
|
+
this.orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
|
|
790
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
791
|
+
this.valueLabelDisplay = input('auto', ...(ngDevMode ? [{ debugName: "valueLabelDisplay" }] : []));
|
|
792
|
+
this.onChange = output();
|
|
793
|
+
this._railRef = viewChild('railRef', ...(ngDevMode ? [{ debugName: "_railRef" }] : []));
|
|
794
|
+
this._activeThumbIndex = signal(0, ...(ngDevMode ? [{ debugName: "_activeThumbIndex" }] : []));
|
|
795
|
+
this._isDragging = signal(false, ...(ngDevMode ? [{ debugName: "_isDragging" }] : []));
|
|
796
|
+
this._cleanupMouseMove = null;
|
|
797
|
+
this._cleanupMouseUp = null;
|
|
798
|
+
this._cleanupTouchMove = null;
|
|
799
|
+
this._cleanupTouchEnd = null;
|
|
800
|
+
this._cachedRect = null;
|
|
801
|
+
this._isRange = computed(() => Array.isArray(this.value()), ...(ngDevMode ? [{ debugName: "_isRange" }] : []));
|
|
802
|
+
this._values = computed(() => {
|
|
803
|
+
const v = this.value();
|
|
804
|
+
if (Array.isArray(v))
|
|
805
|
+
return [v[0], v[1]];
|
|
806
|
+
return [this.min(), v];
|
|
807
|
+
}, ...(ngDevMode ? [{ debugName: "_values" }] : []));
|
|
808
|
+
this._normalizedMarks = computed(() => {
|
|
809
|
+
const m = this.marks();
|
|
810
|
+
if (m === false)
|
|
811
|
+
return [];
|
|
812
|
+
if (Array.isArray(m))
|
|
813
|
+
return m;
|
|
814
|
+
const marks = [];
|
|
815
|
+
const s = this.step() ?? 1;
|
|
816
|
+
for (let v = this.min(); v <= this.max(); v += s) {
|
|
817
|
+
marks.push({ value: v });
|
|
818
|
+
}
|
|
819
|
+
return marks;
|
|
820
|
+
}, ...(ngDevMode ? [{ debugName: "_normalizedMarks" }] : []));
|
|
821
|
+
this._trackFillStyle = computed(() => {
|
|
822
|
+
const [v0, v1] = this._values();
|
|
823
|
+
const range = this.max() - this.min();
|
|
824
|
+
if (range <= 0)
|
|
825
|
+
return { left: '0%', width: '0%' };
|
|
826
|
+
const left = ((v0 - this.min()) / range) * 100;
|
|
827
|
+
const width = ((v1 - v0) / range) * 100;
|
|
828
|
+
if (this._isRange()) {
|
|
829
|
+
return {
|
|
830
|
+
left: `${left}%`,
|
|
831
|
+
width: `${width}%`,
|
|
832
|
+
};
|
|
833
|
+
}
|
|
834
|
+
return {
|
|
835
|
+
left: '0%',
|
|
836
|
+
width: `${left + width}%`,
|
|
837
|
+
};
|
|
838
|
+
}, ...(ngDevMode ? [{ debugName: "_trackFillStyle" }] : []));
|
|
839
|
+
this._thumbPositions = computed(() => {
|
|
840
|
+
const [v0, v1] = this._values();
|
|
841
|
+
const range = this.max() - this.min();
|
|
842
|
+
if (range <= 0)
|
|
843
|
+
return this._isRange() ? [0, 0] : [0];
|
|
844
|
+
if (this._isRange()) {
|
|
845
|
+
return [
|
|
846
|
+
((v0 - this.min()) / range) * 100,
|
|
847
|
+
((v1 - this.min()) / range) * 100,
|
|
848
|
+
];
|
|
849
|
+
}
|
|
850
|
+
return [((v1 - this.min()) / range) * 100];
|
|
851
|
+
}, ...(ngDevMode ? [{ debugName: "_thumbPositions" }] : []));
|
|
852
|
+
this._containerClasses = computed(() => {
|
|
853
|
+
const classes = ['ls-slider'];
|
|
854
|
+
classes.push(`ls-slider--${this.color()}`);
|
|
855
|
+
classes.push(`ls-slider--${this.size()}`);
|
|
856
|
+
if (this.disabled())
|
|
857
|
+
classes.push('ls-slider--disabled');
|
|
858
|
+
if (this._isDragging())
|
|
859
|
+
classes.push('ls-slider--active');
|
|
860
|
+
return classes.join(' ');
|
|
861
|
+
}, ...(ngDevMode ? [{ debugName: "_containerClasses" }] : []));
|
|
862
|
+
effect(() => {
|
|
863
|
+
const dv = this.defaultValue();
|
|
864
|
+
if (dv !== undefined && this.value() === 0) {
|
|
865
|
+
this.value.set(dv);
|
|
866
|
+
}
|
|
867
|
+
}, { allowSignalWrites: true });
|
|
868
|
+
this._destroyRef.onDestroy(() => {
|
|
869
|
+
this._removeGlobalListeners();
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
_isMarkActive(markValue) {
|
|
873
|
+
const [v0, v1] = this._values();
|
|
874
|
+
if (this._isRange()) {
|
|
875
|
+
return markValue >= v0 && markValue <= v1;
|
|
876
|
+
}
|
|
877
|
+
return markValue <= v1;
|
|
878
|
+
}
|
|
879
|
+
_getMarkPosition(markValue) {
|
|
880
|
+
const range = this.max() - this.min();
|
|
881
|
+
if (range <= 0)
|
|
882
|
+
return 0;
|
|
883
|
+
return (((markValue - this.min()) / range) * 100);
|
|
884
|
+
}
|
|
885
|
+
_getThumbValue(thumbIndex) {
|
|
886
|
+
const v = this.value();
|
|
887
|
+
if (Array.isArray(v)) {
|
|
888
|
+
return v[thumbIndex];
|
|
889
|
+
}
|
|
890
|
+
return v;
|
|
891
|
+
}
|
|
892
|
+
_onRailMouseDown(event) {
|
|
893
|
+
if (this.disabled())
|
|
894
|
+
return;
|
|
895
|
+
event.preventDefault();
|
|
896
|
+
this._startDrag(event.clientX);
|
|
897
|
+
}
|
|
898
|
+
_onThumbMouseDown(event, thumbIndex) {
|
|
899
|
+
if (this.disabled())
|
|
900
|
+
return;
|
|
901
|
+
event.preventDefault();
|
|
902
|
+
event.stopPropagation();
|
|
903
|
+
this._activeThumbIndex.set(thumbIndex);
|
|
904
|
+
this._startMouseDrag(event.clientX);
|
|
905
|
+
}
|
|
906
|
+
_onRailTouchStart(event) {
|
|
907
|
+
if (this.disabled())
|
|
908
|
+
return;
|
|
909
|
+
if (event.touches.length === 0)
|
|
910
|
+
return;
|
|
911
|
+
event.preventDefault();
|
|
912
|
+
this._startTouchDrag(event.touches[0].clientX);
|
|
913
|
+
}
|
|
914
|
+
_onThumbTouchStart(event, thumbIndex) {
|
|
915
|
+
if (this.disabled())
|
|
916
|
+
return;
|
|
917
|
+
if (event.touches.length === 0)
|
|
918
|
+
return;
|
|
919
|
+
event.preventDefault();
|
|
920
|
+
event.stopPropagation();
|
|
921
|
+
this._activeThumbIndex.set(thumbIndex);
|
|
922
|
+
this._startTouchDrag(event.touches[0].clientX);
|
|
923
|
+
}
|
|
924
|
+
_onKeyDown(event, thumbIndex) {
|
|
925
|
+
if (this.disabled())
|
|
926
|
+
return;
|
|
927
|
+
const s = this.step() ?? 1;
|
|
928
|
+
let handled = false;
|
|
929
|
+
switch (event.key) {
|
|
930
|
+
case 'ArrowRight':
|
|
931
|
+
case 'ArrowUp':
|
|
932
|
+
this._adjustThumbValue(thumbIndex, s);
|
|
933
|
+
handled = true;
|
|
934
|
+
break;
|
|
935
|
+
case 'ArrowLeft':
|
|
936
|
+
case 'ArrowDown':
|
|
937
|
+
this._adjustThumbValue(thumbIndex, -s);
|
|
938
|
+
handled = true;
|
|
939
|
+
break;
|
|
940
|
+
case 'Home':
|
|
941
|
+
this._setThumbValue(thumbIndex, this.min());
|
|
942
|
+
handled = true;
|
|
943
|
+
break;
|
|
944
|
+
case 'End':
|
|
945
|
+
this._setThumbValue(thumbIndex, this.max());
|
|
946
|
+
handled = true;
|
|
947
|
+
break;
|
|
948
|
+
}
|
|
949
|
+
if (handled) {
|
|
950
|
+
event.preventDefault();
|
|
951
|
+
this.onChange.emit(this.value());
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
_startDrag(clientX) {
|
|
955
|
+
this._cacheRect();
|
|
956
|
+
if (this._isRange() && this._cachedRect) {
|
|
957
|
+
const clickValue = this._positionToValue(clientX, this._cachedRect);
|
|
958
|
+
const [v0, v1] = this._values();
|
|
959
|
+
const dist0 = Math.abs(clickValue - v0);
|
|
960
|
+
const dist1 = Math.abs(clickValue - v1);
|
|
961
|
+
this._activeThumbIndex.set(dist0 <= dist1 ? 0 : 1);
|
|
962
|
+
}
|
|
963
|
+
this._startMouseDrag(clientX);
|
|
964
|
+
}
|
|
965
|
+
_startMouseDrag(clientX) {
|
|
966
|
+
this._cacheRect();
|
|
967
|
+
this._isDragging.set(true);
|
|
968
|
+
this._updateValueFromPosition(clientX);
|
|
969
|
+
this._cleanupMouseMove =
|
|
970
|
+
this._renderer.listen('window', 'mousemove', (e) => {
|
|
971
|
+
this._updateValueFromPosition(e.clientX);
|
|
972
|
+
});
|
|
973
|
+
this._cleanupMouseUp = this._renderer.listen('window', 'mouseup', () => {
|
|
974
|
+
this._endDrag();
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
_startTouchDrag(clientX) {
|
|
978
|
+
this._cacheRect();
|
|
979
|
+
if (this._isRange() && this._cachedRect) {
|
|
980
|
+
const clickValue = this._positionToValue(clientX, this._cachedRect);
|
|
981
|
+
const [v0, v1] = this._values();
|
|
982
|
+
const dist0 = Math.abs(clickValue - v0);
|
|
983
|
+
const dist1 = Math.abs(clickValue - v1);
|
|
984
|
+
this._activeThumbIndex.set(dist0 <= dist1 ? 0 : 1);
|
|
985
|
+
}
|
|
986
|
+
this._isDragging.set(true);
|
|
987
|
+
this._updateValueFromPosition(clientX);
|
|
988
|
+
this._cleanupTouchMove =
|
|
989
|
+
this._renderer.listen('window', 'touchmove', (e) => {
|
|
990
|
+
if (e.touches.length > 0) {
|
|
991
|
+
this._updateValueFromPosition(e.touches[0].clientX);
|
|
992
|
+
}
|
|
993
|
+
});
|
|
994
|
+
this._cleanupTouchEnd =
|
|
995
|
+
this._renderer.listen('window', 'touchend', () => {
|
|
996
|
+
this._endDrag();
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
_endDrag() {
|
|
1000
|
+
this._isDragging.set(false);
|
|
1001
|
+
this._removeGlobalListeners();
|
|
1002
|
+
this._cachedRect = null;
|
|
1003
|
+
this.onChange.emit(this.value());
|
|
1004
|
+
}
|
|
1005
|
+
_updateValueFromPosition(clientX) {
|
|
1006
|
+
if (!this._cachedRect)
|
|
1007
|
+
return;
|
|
1008
|
+
const newValue = this._positionToValue(clientX, this._cachedRect);
|
|
1009
|
+
const idx = this._activeThumbIndex();
|
|
1010
|
+
if (this._isRange()) {
|
|
1011
|
+
const current = this.value();
|
|
1012
|
+
const updated = [...current];
|
|
1013
|
+
updated[idx] = newValue;
|
|
1014
|
+
if (idx === 0 && updated[0] > updated[1]) {
|
|
1015
|
+
updated[0] = updated[1];
|
|
1016
|
+
}
|
|
1017
|
+
if (idx === 1 && updated[1] < updated[0]) {
|
|
1018
|
+
updated[1] = updated[0];
|
|
1019
|
+
}
|
|
1020
|
+
this.value.set(updated);
|
|
1021
|
+
}
|
|
1022
|
+
else {
|
|
1023
|
+
this.value.set(newValue);
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
_adjustThumbValue(thumbIndex, delta) {
|
|
1027
|
+
if (this._isRange()) {
|
|
1028
|
+
const current = this.value();
|
|
1029
|
+
const updated = [...current];
|
|
1030
|
+
updated[thumbIndex] = this._quantize(updated[thumbIndex] + delta);
|
|
1031
|
+
if (thumbIndex === 0 &&
|
|
1032
|
+
updated[0] > updated[1]) {
|
|
1033
|
+
updated[0] = updated[1];
|
|
1034
|
+
}
|
|
1035
|
+
if (thumbIndex === 1 &&
|
|
1036
|
+
updated[1] < updated[0]) {
|
|
1037
|
+
updated[1] = updated[0];
|
|
1038
|
+
}
|
|
1039
|
+
this.value.set(updated);
|
|
1040
|
+
}
|
|
1041
|
+
else {
|
|
1042
|
+
this.value.set(this._quantize(this.value() + delta));
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
_setThumbValue(thumbIndex, newValue) {
|
|
1046
|
+
if (this._isRange()) {
|
|
1047
|
+
const current = this.value();
|
|
1048
|
+
const updated = [...current];
|
|
1049
|
+
updated[thumbIndex] =
|
|
1050
|
+
this._quantize(newValue);
|
|
1051
|
+
if (thumbIndex === 0 &&
|
|
1052
|
+
updated[0] > updated[1]) {
|
|
1053
|
+
updated[0] = updated[1];
|
|
1054
|
+
}
|
|
1055
|
+
if (thumbIndex === 1 &&
|
|
1056
|
+
updated[1] < updated[0]) {
|
|
1057
|
+
updated[1] = updated[0];
|
|
1058
|
+
}
|
|
1059
|
+
this.value.set(updated);
|
|
1060
|
+
}
|
|
1061
|
+
else {
|
|
1062
|
+
this.value.set(this._quantize(newValue));
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
_positionToValue(clientX, rect) {
|
|
1066
|
+
const percent = Math.max(0, Math.min(1, (clientX - rect.left) / rect.width));
|
|
1067
|
+
return this._quantize(this.min() +
|
|
1068
|
+
percent * (this.max() - this.min()));
|
|
1069
|
+
}
|
|
1070
|
+
_quantize(raw) {
|
|
1071
|
+
const s = this.step();
|
|
1072
|
+
if (s === null)
|
|
1073
|
+
return Math.min(this.max(), Math.max(this.min(), raw));
|
|
1074
|
+
return Math.min(this.max(), Math.max(this.min(), this.min() +
|
|
1075
|
+
Math.round((raw - this.min()) / s) * s));
|
|
1076
|
+
}
|
|
1077
|
+
_cacheRect() {
|
|
1078
|
+
const railEl = this._railRef();
|
|
1079
|
+
if (railEl) {
|
|
1080
|
+
this._cachedRect =
|
|
1081
|
+
railEl.nativeElement.getBoundingClientRect();
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
_removeGlobalListeners() {
|
|
1085
|
+
this._cleanupMouseMove?.();
|
|
1086
|
+
this._cleanupMouseMove = null;
|
|
1087
|
+
this._cleanupMouseUp?.();
|
|
1088
|
+
this._cleanupMouseUp = null;
|
|
1089
|
+
this._cleanupTouchMove?.();
|
|
1090
|
+
this._cleanupTouchMove = null;
|
|
1091
|
+
this._cleanupTouchEnd?.();
|
|
1092
|
+
this._cleanupTouchEnd = null;
|
|
1093
|
+
}
|
|
1094
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SliderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1095
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: SliderComponent, isStandalone: true, selector: "ls-slider", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, marks: { classPropertyName: "marks", publicName: "marks", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, valueLabelDisplay: { classPropertyName: "valueLabelDisplay", publicName: "valueLabelDisplay", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", onChange: "onChange" }, viewQueries: [{ propertyName: "_railRef", first: true, predicate: ["railRef"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
1096
|
+
<div
|
|
1097
|
+
[class]="_containerClasses()"
|
|
1098
|
+
(mousedown)="_onRailMouseDown($event)"
|
|
1099
|
+
(touchstart)="_onRailTouchStart($event)"
|
|
1100
|
+
#railRef>
|
|
1101
|
+
<div class="ls-slider__rail"></div>
|
|
1102
|
+
|
|
1103
|
+
<div
|
|
1104
|
+
class="ls-slider__track"
|
|
1105
|
+
[style.left]="_trackFillStyle().left"
|
|
1106
|
+
[style.width]="_trackFillStyle().width">
|
|
1107
|
+
</div>
|
|
1108
|
+
|
|
1109
|
+
@for (mark of _normalizedMarks(); track mark.value) {
|
|
1110
|
+
<span
|
|
1111
|
+
class="ls-slider__mark"
|
|
1112
|
+
[class.ls-slider__mark--active]="
|
|
1113
|
+
_isMarkActive(mark.value)
|
|
1114
|
+
"
|
|
1115
|
+
[style.left]="_getMarkPosition(mark.value) + '%'">
|
|
1116
|
+
</span>
|
|
1117
|
+
@if (mark.label) {
|
|
1118
|
+
<span
|
|
1119
|
+
class="ls-slider__mark-label"
|
|
1120
|
+
[style.left]="
|
|
1121
|
+
_getMarkPosition(mark.value) + '%'
|
|
1122
|
+
">
|
|
1123
|
+
{{ mark.label }}
|
|
1124
|
+
</span>
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
@for (pos of _thumbPositions(); track $index) {
|
|
1129
|
+
<span
|
|
1130
|
+
class="ls-slider__thumb"
|
|
1131
|
+
[class.ls-slider__thumb--active]="
|
|
1132
|
+
_isDragging() && _activeThumbIndex() === $index
|
|
1133
|
+
"
|
|
1134
|
+
[style.left]="pos + '%'"
|
|
1135
|
+
[attr.role]="'slider'"
|
|
1136
|
+
[attr.aria-valuenow]="_getThumbValue($index)"
|
|
1137
|
+
[attr.aria-valuemin]="min()"
|
|
1138
|
+
[attr.aria-valuemax]="max()"
|
|
1139
|
+
[attr.aria-disabled]="disabled()"
|
|
1140
|
+
[attr.tabindex]="disabled() ? -1 : 0"
|
|
1141
|
+
(mousedown)="_onThumbMouseDown($event, $index)"
|
|
1142
|
+
(touchstart)="_onThumbTouchStart($event, $index)"
|
|
1143
|
+
(keydown)="_onKeyDown($event, $index)">
|
|
1144
|
+
@if (
|
|
1145
|
+
valueLabelDisplay() === 'on' ||
|
|
1146
|
+
(valueLabelDisplay() === 'auto' &&
|
|
1147
|
+
_isDragging() &&
|
|
1148
|
+
_activeThumbIndex() === $index)
|
|
1149
|
+
) {
|
|
1150
|
+
<span class="ls-slider__value-label">
|
|
1151
|
+
{{ _getThumbValue($index) }}
|
|
1152
|
+
</span>
|
|
1153
|
+
}
|
|
1154
|
+
</span>
|
|
1155
|
+
}
|
|
1156
|
+
</div>
|
|
1157
|
+
`, isInline: true, styles: [":host{display:block}.ls-slider{position:relative;height:38px;cursor:pointer;padding:15px 0;touch-action:none;-webkit-user-select:none;user-select:none}.ls-slider__rail{position:absolute;top:50%;left:0;width:100%;border-radius:9999px;background:#e0e6ed;transform:translateY(-50%)}.ls-slider__track{position:absolute;top:50%;border-radius:9999px;background:var(--ls-slider-main-color);transform:translateY(-50%)}.ls-slider__thumb{position:absolute;top:50%;z-index:1;display:flex;align-items:center;justify-content:center;border-radius:50%;background:var(--ls-slider-main-color);box-shadow:0 1px 3px #0003,0 0 0 0 transparent;cursor:grab;transform:translate(-50%,-50%);transition:box-shadow .15s ease,width .15s ease,height .15s ease}.ls-slider__thumb:hover{box-shadow:0 1px 3px #0003,0 0 0 8px color-mix(in srgb,var(--ls-slider-main-color) 16%,transparent)}.ls-slider__thumb:focus-visible{outline:2px solid var(--ls-slider-main-color);outline-offset:2px}.ls-slider__thumb--active{cursor:grabbing;box-shadow:0 1px 3px #0003,0 0 0 12px color-mix(in srgb,var(--ls-slider-main-color) 24%,transparent)}.ls-slider__value-label{position:absolute;bottom:calc(100% + 6px);left:50%;padding:2px 8px;border-radius:4px;background:var(--ls-color-dark, #3b3f5c);color:#fff;font-size:12px;font-weight:600;line-height:1.4;white-space:nowrap;transform:translate(-50%);pointer-events:none}.ls-slider__mark{position:absolute;top:50%;border-radius:50%;background:#bfc9d4;transform:translate(-50%,-50%)}.ls-slider__mark--active{background:var(--ls-slider-main-color)}.ls-slider__mark-label{position:absolute;top:calc(50% + 14px);color:#888ea8;font-size:11px;white-space:nowrap;transform:translate(-50%)}.ls-slider--medium .ls-slider__rail,.ls-slider--medium .ls-slider__track{height:4px}.ls-slider--medium .ls-slider__thumb{width:20px;height:20px}.ls-slider--medium .ls-slider__mark{width:4px;height:4px}.ls-slider--medium .ls-slider__value-label{font-size:12px}.ls-slider--small .ls-slider__rail,.ls-slider--small .ls-slider__track{height:2px}.ls-slider--small .ls-slider__thumb{width:12px;height:12px}.ls-slider--small .ls-slider__mark{width:3px;height:3px}.ls-slider--small .ls-slider__value-label{font-size:10px}.ls-slider--primary{--ls-slider-main-color: var(--ls-color-primary)}.ls-slider--secondary{--ls-slider-main-color: var(--ls-color-secondary)}.ls-slider--success{--ls-slider-main-color: var(--ls-color-success)}.ls-slider--error{--ls-slider-main-color: var(--ls-color-error)}.ls-slider--info{--ls-slider-main-color: var(--ls-color-info)}.ls-slider--warning{--ls-slider-main-color: var(--ls-color-warning)}.ls-slider--disabled{opacity:.5;cursor:default;pointer-events:none}.ls-slider--active{cursor:grabbing}body.dark .ls-slider__rail{background:#ffffff26}body.dark .ls-slider__mark{background:#ffffff4d}body.dark .ls-slider__mark--active{background:var(--ls-slider-main-color)}body.dark .ls-slider__mark-label{color:#888ea8}body.dark .ls-slider__value-label{background:#1b2e4b;color:#e0e6ed}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1158
|
+
}
|
|
1159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SliderComponent, decorators: [{
|
|
1160
|
+
type: Component,
|
|
1161
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ls-slider', standalone: true, template: `
|
|
1162
|
+
<div
|
|
1163
|
+
[class]="_containerClasses()"
|
|
1164
|
+
(mousedown)="_onRailMouseDown($event)"
|
|
1165
|
+
(touchstart)="_onRailTouchStart($event)"
|
|
1166
|
+
#railRef>
|
|
1167
|
+
<div class="ls-slider__rail"></div>
|
|
1168
|
+
|
|
1169
|
+
<div
|
|
1170
|
+
class="ls-slider__track"
|
|
1171
|
+
[style.left]="_trackFillStyle().left"
|
|
1172
|
+
[style.width]="_trackFillStyle().width">
|
|
1173
|
+
</div>
|
|
1174
|
+
|
|
1175
|
+
@for (mark of _normalizedMarks(); track mark.value) {
|
|
1176
|
+
<span
|
|
1177
|
+
class="ls-slider__mark"
|
|
1178
|
+
[class.ls-slider__mark--active]="
|
|
1179
|
+
_isMarkActive(mark.value)
|
|
1180
|
+
"
|
|
1181
|
+
[style.left]="_getMarkPosition(mark.value) + '%'">
|
|
1182
|
+
</span>
|
|
1183
|
+
@if (mark.label) {
|
|
1184
|
+
<span
|
|
1185
|
+
class="ls-slider__mark-label"
|
|
1186
|
+
[style.left]="
|
|
1187
|
+
_getMarkPosition(mark.value) + '%'
|
|
1188
|
+
">
|
|
1189
|
+
{{ mark.label }}
|
|
1190
|
+
</span>
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
@for (pos of _thumbPositions(); track $index) {
|
|
1195
|
+
<span
|
|
1196
|
+
class="ls-slider__thumb"
|
|
1197
|
+
[class.ls-slider__thumb--active]="
|
|
1198
|
+
_isDragging() && _activeThumbIndex() === $index
|
|
1199
|
+
"
|
|
1200
|
+
[style.left]="pos + '%'"
|
|
1201
|
+
[attr.role]="'slider'"
|
|
1202
|
+
[attr.aria-valuenow]="_getThumbValue($index)"
|
|
1203
|
+
[attr.aria-valuemin]="min()"
|
|
1204
|
+
[attr.aria-valuemax]="max()"
|
|
1205
|
+
[attr.aria-disabled]="disabled()"
|
|
1206
|
+
[attr.tabindex]="disabled() ? -1 : 0"
|
|
1207
|
+
(mousedown)="_onThumbMouseDown($event, $index)"
|
|
1208
|
+
(touchstart)="_onThumbTouchStart($event, $index)"
|
|
1209
|
+
(keydown)="_onKeyDown($event, $index)">
|
|
1210
|
+
@if (
|
|
1211
|
+
valueLabelDisplay() === 'on' ||
|
|
1212
|
+
(valueLabelDisplay() === 'auto' &&
|
|
1213
|
+
_isDragging() &&
|
|
1214
|
+
_activeThumbIndex() === $index)
|
|
1215
|
+
) {
|
|
1216
|
+
<span class="ls-slider__value-label">
|
|
1217
|
+
{{ _getThumbValue($index) }}
|
|
1218
|
+
</span>
|
|
1219
|
+
}
|
|
1220
|
+
</span>
|
|
1221
|
+
}
|
|
1222
|
+
</div>
|
|
1223
|
+
`, styles: [":host{display:block}.ls-slider{position:relative;height:38px;cursor:pointer;padding:15px 0;touch-action:none;-webkit-user-select:none;user-select:none}.ls-slider__rail{position:absolute;top:50%;left:0;width:100%;border-radius:9999px;background:#e0e6ed;transform:translateY(-50%)}.ls-slider__track{position:absolute;top:50%;border-radius:9999px;background:var(--ls-slider-main-color);transform:translateY(-50%)}.ls-slider__thumb{position:absolute;top:50%;z-index:1;display:flex;align-items:center;justify-content:center;border-radius:50%;background:var(--ls-slider-main-color);box-shadow:0 1px 3px #0003,0 0 0 0 transparent;cursor:grab;transform:translate(-50%,-50%);transition:box-shadow .15s ease,width .15s ease,height .15s ease}.ls-slider__thumb:hover{box-shadow:0 1px 3px #0003,0 0 0 8px color-mix(in srgb,var(--ls-slider-main-color) 16%,transparent)}.ls-slider__thumb:focus-visible{outline:2px solid var(--ls-slider-main-color);outline-offset:2px}.ls-slider__thumb--active{cursor:grabbing;box-shadow:0 1px 3px #0003,0 0 0 12px color-mix(in srgb,var(--ls-slider-main-color) 24%,transparent)}.ls-slider__value-label{position:absolute;bottom:calc(100% + 6px);left:50%;padding:2px 8px;border-radius:4px;background:var(--ls-color-dark, #3b3f5c);color:#fff;font-size:12px;font-weight:600;line-height:1.4;white-space:nowrap;transform:translate(-50%);pointer-events:none}.ls-slider__mark{position:absolute;top:50%;border-radius:50%;background:#bfc9d4;transform:translate(-50%,-50%)}.ls-slider__mark--active{background:var(--ls-slider-main-color)}.ls-slider__mark-label{position:absolute;top:calc(50% + 14px);color:#888ea8;font-size:11px;white-space:nowrap;transform:translate(-50%)}.ls-slider--medium .ls-slider__rail,.ls-slider--medium .ls-slider__track{height:4px}.ls-slider--medium .ls-slider__thumb{width:20px;height:20px}.ls-slider--medium .ls-slider__mark{width:4px;height:4px}.ls-slider--medium .ls-slider__value-label{font-size:12px}.ls-slider--small .ls-slider__rail,.ls-slider--small .ls-slider__track{height:2px}.ls-slider--small .ls-slider__thumb{width:12px;height:12px}.ls-slider--small .ls-slider__mark{width:3px;height:3px}.ls-slider--small .ls-slider__value-label{font-size:10px}.ls-slider--primary{--ls-slider-main-color: var(--ls-color-primary)}.ls-slider--secondary{--ls-slider-main-color: var(--ls-color-secondary)}.ls-slider--success{--ls-slider-main-color: var(--ls-color-success)}.ls-slider--error{--ls-slider-main-color: var(--ls-color-error)}.ls-slider--info{--ls-slider-main-color: var(--ls-color-info)}.ls-slider--warning{--ls-slider-main-color: var(--ls-color-warning)}.ls-slider--disabled{opacity:.5;cursor:default;pointer-events:none}.ls-slider--active{cursor:grabbing}body.dark .ls-slider__rail{background:#ffffff26}body.dark .ls-slider__mark{background:#ffffff4d}body.dark .ls-slider__mark--active{background:var(--ls-slider-main-color)}body.dark .ls-slider__mark-label{color:#888ea8}body.dark .ls-slider__value-label{background:#1b2e4b;color:#e0e6ed}\n"] }]
|
|
1224
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], defaultValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValue", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], marks: [{ type: i0.Input, args: [{ isSignal: true, alias: "marks", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], valueLabelDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueLabelDisplay", required: false }] }], onChange: [{ type: i0.Output, args: ["onChange"] }], _railRef: [{ type: i0.ViewChild, args: ['railRef', { isSignal: true }] }] } });
|
|
1225
|
+
|
|
1226
|
+
const CHECK_SVG = '<svg viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">' +
|
|
1227
|
+
'<path d="M3.5 6L5.5 8L8.5 4" stroke="currentColor" ' +
|
|
1228
|
+
'stroke-width="2" stroke-linecap="round" ' +
|
|
1229
|
+
'stroke-linejoin="round"/></svg>';
|
|
1230
|
+
const CLOSE_SVG = '<svg viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">' +
|
|
1231
|
+
'<path d="M3.5 3.5L8.5 8.5M8.5 3.5L3.5 8.5" ' +
|
|
1232
|
+
'stroke="currentColor" stroke-width="2" ' +
|
|
1233
|
+
'stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
1234
|
+
class SwitchComponent {
|
|
1235
|
+
constructor() {
|
|
1236
|
+
this._sanitizer = inject(DomSanitizer);
|
|
1237
|
+
this.checked = input(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
1238
|
+
this.defaultChecked = input(false, ...(ngDevMode ? [{ debugName: "defaultChecked" }] : []));
|
|
1239
|
+
this.color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
1240
|
+
this.size = input('medium', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1241
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
1242
|
+
this.icon = input(false, ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
1243
|
+
this.variant = input('solid', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
1244
|
+
this.labelPlacement = input('end', ...(ngDevMode ? [{ debugName: "labelPlacement" }] : []));
|
|
1245
|
+
this.changed = output();
|
|
1246
|
+
this._isChecked = signal(false, ...(ngDevMode ? [{ debugName: "_isChecked" }] : []));
|
|
1247
|
+
this._isFirstSync = true;
|
|
1248
|
+
this._syncChecked = effect(() => {
|
|
1249
|
+
const isChecked = this.checked();
|
|
1250
|
+
if (this._isFirstSync) {
|
|
1251
|
+
this._isFirstSync = false;
|
|
1252
|
+
this._isChecked.set(isChecked || this.defaultChecked());
|
|
1253
|
+
}
|
|
1254
|
+
else {
|
|
1255
|
+
this._isChecked.set(isChecked);
|
|
1256
|
+
}
|
|
1257
|
+
}, ...(ngDevMode ? [{ debugName: "_syncChecked" }] : []));
|
|
1258
|
+
this.switchClasses = computed(() => {
|
|
1259
|
+
const s = this.size() === 'small' ? 'sm' : 'md';
|
|
1260
|
+
const parts = [
|
|
1261
|
+
'switch',
|
|
1262
|
+
`switch-${s}`,
|
|
1263
|
+
`switch-color-${this.color()}`,
|
|
1264
|
+
`switch-${this.variant()}`,
|
|
1265
|
+
`switch-label-${this.labelPlacement()}`,
|
|
1266
|
+
];
|
|
1267
|
+
if (this._isChecked()) {
|
|
1268
|
+
parts.push('switch-checked');
|
|
1269
|
+
}
|
|
1270
|
+
if (this.disabled()) {
|
|
1271
|
+
parts.push('switch-disabled');
|
|
1272
|
+
}
|
|
1273
|
+
return parts.join(' ');
|
|
1274
|
+
}, ...(ngDevMode ? [{ debugName: "switchClasses" }] : []));
|
|
1275
|
+
this.currentIcon = computed(() => {
|
|
1276
|
+
const svg = this._isChecked()
|
|
1277
|
+
? CHECK_SVG
|
|
1278
|
+
: CLOSE_SVG;
|
|
1279
|
+
return this._sanitizer.bypassSecurityTrustHtml(svg);
|
|
1280
|
+
}, ...(ngDevMode ? [{ debugName: "currentIcon" }] : []));
|
|
1281
|
+
}
|
|
1282
|
+
onToggle() {
|
|
1283
|
+
if (this.disabled()) {
|
|
1284
|
+
return;
|
|
1285
|
+
}
|
|
1286
|
+
const isNext = !this._isChecked();
|
|
1287
|
+
this._isChecked.set(isNext);
|
|
1288
|
+
this.changed.emit(isNext);
|
|
1289
|
+
}
|
|
1290
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1291
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: SwitchComponent, isStandalone: true, selector: "ls-switch", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, defaultChecked: { classPropertyName: "defaultChecked", publicName: "defaultChecked", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, labelPlacement: { classPropertyName: "labelPlacement", publicName: "labelPlacement", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed" }, ngImport: i0, template: `
|
|
1292
|
+
<label [class]="switchClasses()">
|
|
1293
|
+
<button
|
|
1294
|
+
type="button"
|
|
1295
|
+
role="switch"
|
|
1296
|
+
class="switch-track"
|
|
1297
|
+
[attr.aria-checked]="_isChecked()"
|
|
1298
|
+
[disabled]="disabled()"
|
|
1299
|
+
(click)="onToggle()"
|
|
1300
|
+
(keydown.space)="onToggle(); $event.preventDefault()"
|
|
1301
|
+
(keydown.enter)="onToggle(); $event.preventDefault()">
|
|
1302
|
+
<span class="switch-thumb">
|
|
1303
|
+
@if (icon()) {
|
|
1304
|
+
<span
|
|
1305
|
+
class="switch-icon"
|
|
1306
|
+
[innerHTML]="currentIcon()"
|
|
1307
|
+
></span>
|
|
1308
|
+
}
|
|
1309
|
+
</span>
|
|
1310
|
+
</button>
|
|
1311
|
+
<span class="switch-label">
|
|
1312
|
+
<ng-content />
|
|
1313
|
+
</span>
|
|
1314
|
+
</label>
|
|
1315
|
+
`, isInline: true, styles: [":host{display:inline-flex}.switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;position:relative}.switch-track{position:relative;display:inline-flex;align-items:center;border:none;border-radius:999px;padding:2px;cursor:pointer;transition:background-color var(--ls-transition-duration),border-color var(--ls-transition-duration);outline:none;flex-shrink:0}.switch-thumb{display:flex;align-items:center;justify-content:center;border-radius:50%;background-color:#fff;transition:transform var(--ls-transition-duration);box-shadow:0 1px 3px #0003}.switch-icon{display:flex;align-items:center;justify-content:center;line-height:0;color:#999}.switch-icon svg{width:100%;height:100%}.switch-label{-webkit-user-select:none;user-select:none;cursor:pointer;font-size:.875rem}.switch-sm .switch-track{width:34px;height:20px}.switch-sm .switch-thumb{width:16px;height:16px}.switch-sm .switch-icon{width:10px;height:10px}.switch-sm.switch-checked .switch-thumb{transform:translate(14px)}.switch-md .switch-track{width:42px;height:24px}.switch-md .switch-thumb{width:20px;height:20px}.switch-md .switch-icon{width:12px;height:12px}.switch-md.switch-checked .switch-thumb{transform:translate(18px)}.switch-solid .switch-track{background-color:#c4c4c4}.switch-outlined .switch-track{background-color:transparent;border:2px solid #999}.switch-outlined .switch-track{padding:0}.switch-outlined .switch-thumb{background-color:#999}.switch-outlined .switch-icon{color:#fff}.switch-checked.switch-solid.switch-color-inherit .switch-track{background-color:inherit}.switch-checked.switch-solid.switch-color-primary .switch-track{background-color:var(--ls-color-primary)}.switch-checked.switch-solid.switch-color-secondary .switch-track{background-color:var(--ls-color-secondary)}.switch-checked.switch-solid.switch-color-success .switch-track{background-color:var(--ls-color-success)}.switch-checked.switch-solid.switch-color-error .switch-track{background-color:var(--ls-color-danger)}.switch-checked.switch-solid.switch-color-info .switch-track{background-color:var(--ls-color-info)}.switch-checked.switch-solid.switch-color-warning .switch-track{background-color:var(--ls-color-warning)}.switch-checked.switch-outlined.switch-color-inherit .switch-track{border-color:inherit}.switch-checked.switch-outlined.switch-color-primary .switch-track{border-color:var(--ls-color-primary)}.switch-checked.switch-outlined.switch-color-secondary .switch-track{border-color:var(--ls-color-secondary)}.switch-checked.switch-outlined.switch-color-success .switch-track{border-color:var(--ls-color-success)}.switch-checked.switch-outlined.switch-color-error .switch-track{border-color:var(--ls-color-danger)}.switch-checked.switch-outlined.switch-color-info .switch-track{border-color:var(--ls-color-info)}.switch-checked.switch-outlined.switch-color-warning .switch-track{border-color:var(--ls-color-warning)}.switch-checked.switch-outlined.switch-color-inherit .switch-thumb{background-color:inherit}.switch-checked.switch-outlined.switch-color-primary .switch-thumb{background-color:var(--ls-color-primary)}.switch-checked.switch-outlined.switch-color-secondary .switch-thumb{background-color:var(--ls-color-secondary)}.switch-checked.switch-outlined.switch-color-success .switch-thumb{background-color:var(--ls-color-success)}.switch-checked.switch-outlined.switch-color-error .switch-thumb{background-color:var(--ls-color-danger)}.switch-checked.switch-outlined.switch-color-info .switch-thumb{background-color:var(--ls-color-info)}.switch-checked.switch-outlined.switch-color-warning .switch-thumb{background-color:var(--ls-color-warning)}.switch-checked.switch-outlined .switch-icon{color:#fff}.switch-checked.switch-solid .switch-icon{color:var(--ls-color-primary)}.switch-checked.switch-solid.switch-color-secondary .switch-icon{color:var(--ls-color-secondary)}.switch-checked.switch-solid.switch-color-success .switch-icon{color:var(--ls-color-success)}.switch-checked.switch-solid.switch-color-error .switch-icon{color:var(--ls-color-danger)}.switch-checked.switch-solid.switch-color-info .switch-icon{color:var(--ls-color-info)}.switch-checked.switch-solid.switch-color-warning .switch-icon{color:var(--ls-color-warning)}.switch-checked.switch-solid.switch-color-inherit .switch-icon{color:inherit}.switch-label-end{flex-direction:row}.switch-label-start{flex-direction:row-reverse}.switch-label-top{flex-direction:column-reverse;align-items:center}.switch-label-bottom{flex-direction:column;align-items:center}.switch-disabled{cursor:not-allowed;opacity:.5;pointer-events:none}.switch-disabled .switch-label,.switch-disabled .switch-track{cursor:not-allowed}.switch-track:focus-visible{outline:2px solid currentColor;outline-offset:2px;border-radius:999px}body.dark .switch-solid .switch-track{background-color:#3b3f5c}body.dark .switch-outlined .switch-track{border-color:#555}body.dark .switch-outlined .switch-thumb{background-color:#888}body.dark .switch-label{color:#e0e6ed}body.dark .switch-icon{color:#bbb}body.dark .switch-checked.switch-solid.switch-color-primary .switch-track{background-color:var(--ls-color-primary)}body.dark .switch-checked.switch-solid.switch-color-secondary .switch-track{background-color:var(--ls-color-secondary)}body.dark .switch-checked.switch-solid.switch-color-success .switch-track{background-color:var(--ls-color-success)}body.dark .switch-checked.switch-solid.switch-color-error .switch-track{background-color:var(--ls-color-danger)}body.dark .switch-checked.switch-solid.switch-color-info .switch-track{background-color:var(--ls-color-info)}body.dark .switch-checked.switch-solid.switch-color-warning .switch-track{background-color:var(--ls-color-warning)}body.dark .switch-checked.switch-outlined.switch-color-primary .switch-track{border-color:var(--ls-color-primary)}body.dark .switch-checked.switch-outlined.switch-color-secondary .switch-track{border-color:var(--ls-color-secondary)}body.dark .switch-checked.switch-outlined.switch-color-success .switch-track{border-color:var(--ls-color-success)}body.dark .switch-checked.switch-outlined.switch-color-error .switch-track{border-color:var(--ls-color-danger)}body.dark .switch-checked.switch-outlined.switch-color-info .switch-track{border-color:var(--ls-color-info)}body.dark .switch-checked.switch-outlined.switch-color-warning .switch-track{border-color:var(--ls-color-warning)}body.dark .switch-checked.switch-outlined.switch-color-primary .switch-thumb{background-color:var(--ls-color-primary)}body.dark .switch-checked.switch-outlined.switch-color-secondary .switch-thumb{background-color:var(--ls-color-secondary)}body.dark .switch-checked.switch-outlined.switch-color-success .switch-thumb{background-color:var(--ls-color-success)}body.dark .switch-checked.switch-outlined.switch-color-error .switch-thumb{background-color:var(--ls-color-danger)}body.dark .switch-checked.switch-outlined.switch-color-info .switch-thumb{background-color:var(--ls-color-info)}body.dark .switch-checked.switch-outlined.switch-color-warning .switch-thumb{background-color:var(--ls-color-warning)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1316
|
+
}
|
|
1317
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SwitchComponent, decorators: [{
|
|
1318
|
+
type: Component,
|
|
1319
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ls-switch', standalone: true, template: `
|
|
1320
|
+
<label [class]="switchClasses()">
|
|
1321
|
+
<button
|
|
1322
|
+
type="button"
|
|
1323
|
+
role="switch"
|
|
1324
|
+
class="switch-track"
|
|
1325
|
+
[attr.aria-checked]="_isChecked()"
|
|
1326
|
+
[disabled]="disabled()"
|
|
1327
|
+
(click)="onToggle()"
|
|
1328
|
+
(keydown.space)="onToggle(); $event.preventDefault()"
|
|
1329
|
+
(keydown.enter)="onToggle(); $event.preventDefault()">
|
|
1330
|
+
<span class="switch-thumb">
|
|
1331
|
+
@if (icon()) {
|
|
1332
|
+
<span
|
|
1333
|
+
class="switch-icon"
|
|
1334
|
+
[innerHTML]="currentIcon()"
|
|
1335
|
+
></span>
|
|
1336
|
+
}
|
|
1337
|
+
</span>
|
|
1338
|
+
</button>
|
|
1339
|
+
<span class="switch-label">
|
|
1340
|
+
<ng-content />
|
|
1341
|
+
</span>
|
|
1342
|
+
</label>
|
|
1343
|
+
`, styles: [":host{display:inline-flex}.switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;position:relative}.switch-track{position:relative;display:inline-flex;align-items:center;border:none;border-radius:999px;padding:2px;cursor:pointer;transition:background-color var(--ls-transition-duration),border-color var(--ls-transition-duration);outline:none;flex-shrink:0}.switch-thumb{display:flex;align-items:center;justify-content:center;border-radius:50%;background-color:#fff;transition:transform var(--ls-transition-duration);box-shadow:0 1px 3px #0003}.switch-icon{display:flex;align-items:center;justify-content:center;line-height:0;color:#999}.switch-icon svg{width:100%;height:100%}.switch-label{-webkit-user-select:none;user-select:none;cursor:pointer;font-size:.875rem}.switch-sm .switch-track{width:34px;height:20px}.switch-sm .switch-thumb{width:16px;height:16px}.switch-sm .switch-icon{width:10px;height:10px}.switch-sm.switch-checked .switch-thumb{transform:translate(14px)}.switch-md .switch-track{width:42px;height:24px}.switch-md .switch-thumb{width:20px;height:20px}.switch-md .switch-icon{width:12px;height:12px}.switch-md.switch-checked .switch-thumb{transform:translate(18px)}.switch-solid .switch-track{background-color:#c4c4c4}.switch-outlined .switch-track{background-color:transparent;border:2px solid #999}.switch-outlined .switch-track{padding:0}.switch-outlined .switch-thumb{background-color:#999}.switch-outlined .switch-icon{color:#fff}.switch-checked.switch-solid.switch-color-inherit .switch-track{background-color:inherit}.switch-checked.switch-solid.switch-color-primary .switch-track{background-color:var(--ls-color-primary)}.switch-checked.switch-solid.switch-color-secondary .switch-track{background-color:var(--ls-color-secondary)}.switch-checked.switch-solid.switch-color-success .switch-track{background-color:var(--ls-color-success)}.switch-checked.switch-solid.switch-color-error .switch-track{background-color:var(--ls-color-danger)}.switch-checked.switch-solid.switch-color-info .switch-track{background-color:var(--ls-color-info)}.switch-checked.switch-solid.switch-color-warning .switch-track{background-color:var(--ls-color-warning)}.switch-checked.switch-outlined.switch-color-inherit .switch-track{border-color:inherit}.switch-checked.switch-outlined.switch-color-primary .switch-track{border-color:var(--ls-color-primary)}.switch-checked.switch-outlined.switch-color-secondary .switch-track{border-color:var(--ls-color-secondary)}.switch-checked.switch-outlined.switch-color-success .switch-track{border-color:var(--ls-color-success)}.switch-checked.switch-outlined.switch-color-error .switch-track{border-color:var(--ls-color-danger)}.switch-checked.switch-outlined.switch-color-info .switch-track{border-color:var(--ls-color-info)}.switch-checked.switch-outlined.switch-color-warning .switch-track{border-color:var(--ls-color-warning)}.switch-checked.switch-outlined.switch-color-inherit .switch-thumb{background-color:inherit}.switch-checked.switch-outlined.switch-color-primary .switch-thumb{background-color:var(--ls-color-primary)}.switch-checked.switch-outlined.switch-color-secondary .switch-thumb{background-color:var(--ls-color-secondary)}.switch-checked.switch-outlined.switch-color-success .switch-thumb{background-color:var(--ls-color-success)}.switch-checked.switch-outlined.switch-color-error .switch-thumb{background-color:var(--ls-color-danger)}.switch-checked.switch-outlined.switch-color-info .switch-thumb{background-color:var(--ls-color-info)}.switch-checked.switch-outlined.switch-color-warning .switch-thumb{background-color:var(--ls-color-warning)}.switch-checked.switch-outlined .switch-icon{color:#fff}.switch-checked.switch-solid .switch-icon{color:var(--ls-color-primary)}.switch-checked.switch-solid.switch-color-secondary .switch-icon{color:var(--ls-color-secondary)}.switch-checked.switch-solid.switch-color-success .switch-icon{color:var(--ls-color-success)}.switch-checked.switch-solid.switch-color-error .switch-icon{color:var(--ls-color-danger)}.switch-checked.switch-solid.switch-color-info .switch-icon{color:var(--ls-color-info)}.switch-checked.switch-solid.switch-color-warning .switch-icon{color:var(--ls-color-warning)}.switch-checked.switch-solid.switch-color-inherit .switch-icon{color:inherit}.switch-label-end{flex-direction:row}.switch-label-start{flex-direction:row-reverse}.switch-label-top{flex-direction:column-reverse;align-items:center}.switch-label-bottom{flex-direction:column;align-items:center}.switch-disabled{cursor:not-allowed;opacity:.5;pointer-events:none}.switch-disabled .switch-label,.switch-disabled .switch-track{cursor:not-allowed}.switch-track:focus-visible{outline:2px solid currentColor;outline-offset:2px;border-radius:999px}body.dark .switch-solid .switch-track{background-color:#3b3f5c}body.dark .switch-outlined .switch-track{border-color:#555}body.dark .switch-outlined .switch-thumb{background-color:#888}body.dark .switch-label{color:#e0e6ed}body.dark .switch-icon{color:#bbb}body.dark .switch-checked.switch-solid.switch-color-primary .switch-track{background-color:var(--ls-color-primary)}body.dark .switch-checked.switch-solid.switch-color-secondary .switch-track{background-color:var(--ls-color-secondary)}body.dark .switch-checked.switch-solid.switch-color-success .switch-track{background-color:var(--ls-color-success)}body.dark .switch-checked.switch-solid.switch-color-error .switch-track{background-color:var(--ls-color-danger)}body.dark .switch-checked.switch-solid.switch-color-info .switch-track{background-color:var(--ls-color-info)}body.dark .switch-checked.switch-solid.switch-color-warning .switch-track{background-color:var(--ls-color-warning)}body.dark .switch-checked.switch-outlined.switch-color-primary .switch-track{border-color:var(--ls-color-primary)}body.dark .switch-checked.switch-outlined.switch-color-secondary .switch-track{border-color:var(--ls-color-secondary)}body.dark .switch-checked.switch-outlined.switch-color-success .switch-track{border-color:var(--ls-color-success)}body.dark .switch-checked.switch-outlined.switch-color-error .switch-track{border-color:var(--ls-color-danger)}body.dark .switch-checked.switch-outlined.switch-color-info .switch-track{border-color:var(--ls-color-info)}body.dark .switch-checked.switch-outlined.switch-color-warning .switch-track{border-color:var(--ls-color-warning)}body.dark .switch-checked.switch-outlined.switch-color-primary .switch-thumb{background-color:var(--ls-color-primary)}body.dark .switch-checked.switch-outlined.switch-color-secondary .switch-thumb{background-color:var(--ls-color-secondary)}body.dark .switch-checked.switch-outlined.switch-color-success .switch-thumb{background-color:var(--ls-color-success)}body.dark .switch-checked.switch-outlined.switch-color-error .switch-thumb{background-color:var(--ls-color-danger)}body.dark .switch-checked.switch-outlined.switch-color-info .switch-thumb{background-color:var(--ls-color-info)}body.dark .switch-checked.switch-outlined.switch-color-warning .switch-thumb{background-color:var(--ls-color-warning)}\n"] }]
|
|
1344
|
+
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], defaultChecked: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultChecked", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], labelPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPlacement", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }] } });
|
|
1345
|
+
|
|
1346
|
+
class LinkComponent {
|
|
1347
|
+
constructor() {
|
|
1348
|
+
this.variant = input('inherit', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
1349
|
+
this.align = input('inherit', ...(ngDevMode ? [{ debugName: "align" }] : []));
|
|
1350
|
+
this.color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
1351
|
+
this.href = input('', ...(ngDevMode ? [{ debugName: "href" }] : []));
|
|
1352
|
+
this.underline = input('always', ...(ngDevMode ? [{ debugName: "underline" }] : []));
|
|
1353
|
+
this.target = input('', ...(ngDevMode ? [{ debugName: "target" }] : []));
|
|
1354
|
+
this.rel = input('', ...(ngDevMode ? [{ debugName: "rel" }] : []));
|
|
1355
|
+
this.linkClasses = computed(() => {
|
|
1356
|
+
const v = this.variant();
|
|
1357
|
+
const c = this.color();
|
|
1358
|
+
const a = this.align();
|
|
1359
|
+
const u = this.underline();
|
|
1360
|
+
return `link text text-${v} link-color-${c} text-align-${a} link-underline-${u}`;
|
|
1361
|
+
}, ...(ngDevMode ? [{ debugName: "linkClasses" }] : []));
|
|
1362
|
+
this.safeRel = computed(() => {
|
|
1363
|
+
const t = this.target();
|
|
1364
|
+
const r = this.rel();
|
|
1365
|
+
if (t !== '_blank') {
|
|
1366
|
+
return r;
|
|
1367
|
+
}
|
|
1368
|
+
if (!r) {
|
|
1369
|
+
return 'noopener';
|
|
1370
|
+
}
|
|
1371
|
+
const lower = r.toLowerCase();
|
|
1372
|
+
if (lower.includes('noopener') || lower.includes('noreferrer')) {
|
|
1373
|
+
return r;
|
|
1374
|
+
}
|
|
1375
|
+
return `${r} noopener`;
|
|
1376
|
+
}, ...(ngDevMode ? [{ debugName: "safeRel" }] : []));
|
|
1377
|
+
}
|
|
1378
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: LinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1379
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.2", type: LinkComponent, isStandalone: true, selector: "ls-link", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, underline: { classPropertyName: "underline", publicName: "underline", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null }, rel: { classPropertyName: "rel", publicName: "rel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1380
|
+
<a
|
|
1381
|
+
[attr.href]="href() || null"
|
|
1382
|
+
[attr.rel]="safeRel() || null"
|
|
1383
|
+
[attr.target]="target() || null"
|
|
1384
|
+
[class]="linkClasses()"
|
|
1385
|
+
>
|
|
1386
|
+
<ng-content />
|
|
1387
|
+
</a>
|
|
1388
|
+
`, isInline: true, styles: [":host{display:contents}.link.text{display:inline;margin:0;cursor:pointer;transition:color var(--ls-transition-duration),text-decoration var(--ls-transition-duration)}.link-color-inherit{color:inherit}.link-color-primary{color:var(--ls-color-primary)}.link-color-secondary{color:var(--ls-color-secondary)}.link-color-success{color:var(--ls-color-success)}.link-color-error{color:var(--ls-color-danger)}.link-color-info{color:var(--ls-color-info)}.link-color-warning{color:var(--ls-color-warning)}.link-color-primary:hover,.link-color-secondary:hover,.link-color-success:hover,.link-color-error:hover,.link-color-info:hover,.link-color-warning:hover{opacity:.8}.link-underline-always{text-decoration:underline}.link-underline-hover{text-decoration:none}.link-underline-hover:hover{text-decoration:underline}.link-underline-none{text-decoration:none}body.dark .link-color-inherit{color:#e0e6ed}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1389
|
+
}
|
|
1390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: LinkComponent, decorators: [{
|
|
1391
|
+
type: Component,
|
|
1392
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ls-link', standalone: true, template: `
|
|
1393
|
+
<a
|
|
1394
|
+
[attr.href]="href() || null"
|
|
1395
|
+
[attr.rel]="safeRel() || null"
|
|
1396
|
+
[attr.target]="target() || null"
|
|
1397
|
+
[class]="linkClasses()"
|
|
1398
|
+
>
|
|
1399
|
+
<ng-content />
|
|
1400
|
+
</a>
|
|
1401
|
+
`, styles: [":host{display:contents}.link.text{display:inline;margin:0;cursor:pointer;transition:color var(--ls-transition-duration),text-decoration var(--ls-transition-duration)}.link-color-inherit{color:inherit}.link-color-primary{color:var(--ls-color-primary)}.link-color-secondary{color:var(--ls-color-secondary)}.link-color-success{color:var(--ls-color-success)}.link-color-error{color:var(--ls-color-danger)}.link-color-info{color:var(--ls-color-info)}.link-color-warning{color:var(--ls-color-warning)}.link-color-primary:hover,.link-color-secondary:hover,.link-color-success:hover,.link-color-error:hover,.link-color-info:hover,.link-color-warning:hover{opacity:.8}.link-underline-always{text-decoration:underline}.link-underline-hover{text-decoration:none}.link-underline-hover:hover{text-decoration:underline}.link-underline-none{text-decoration:none}body.dark .link-color-inherit{color:#e0e6ed}\n"] }]
|
|
1402
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: false }] }], underline: [{ type: i0.Input, args: [{ isSignal: true, alias: "underline", required: false }] }], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: false }] }], rel: [{ type: i0.Input, args: [{ isSignal: true, alias: "rel", required: false }] }] } });
|
|
1403
|
+
|
|
1404
|
+
class TextComponent {
|
|
1405
|
+
constructor() {
|
|
1406
|
+
this.variant = input('h1', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
1407
|
+
this.color = input('inherit', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
1408
|
+
this.align = input('inherit', ...(ngDevMode ? [{ debugName: "align" }] : []));
|
|
1409
|
+
this.textClasses = computed(() => {
|
|
1410
|
+
return `text text-${this.variant()} text-color-${this.color()} text-align-${this.align()}`;
|
|
1411
|
+
}, ...(ngDevMode ? [{ debugName: "textClasses" }] : []));
|
|
1412
|
+
}
|
|
1413
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: TextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1414
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: TextComponent, isStandalone: true, selector: "ls-text", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1415
|
+
<ng-template #content>
|
|
1416
|
+
<ng-content></ng-content>
|
|
1417
|
+
</ng-template>
|
|
1418
|
+
|
|
1419
|
+
@switch (variant()) {
|
|
1420
|
+
@case ('h1') {
|
|
1421
|
+
<h1 [class]="textClasses()">
|
|
1422
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1423
|
+
</h1>
|
|
1424
|
+
}
|
|
1425
|
+
@case ('h2') {
|
|
1426
|
+
<h2 [class]="textClasses()">
|
|
1427
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1428
|
+
</h2>
|
|
1429
|
+
}
|
|
1430
|
+
@case ('h3') {
|
|
1431
|
+
<h3 [class]="textClasses()">
|
|
1432
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1433
|
+
</h3>
|
|
1434
|
+
}
|
|
1435
|
+
@case ('h4') {
|
|
1436
|
+
<h4 [class]="textClasses()">
|
|
1437
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1438
|
+
</h4>
|
|
1439
|
+
}
|
|
1440
|
+
@case ('h5') {
|
|
1441
|
+
<h5 [class]="textClasses()">
|
|
1442
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1443
|
+
</h5>
|
|
1444
|
+
}
|
|
1445
|
+
@case ('h6') {
|
|
1446
|
+
<h6 [class]="textClasses()">
|
|
1447
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1448
|
+
</h6>
|
|
1449
|
+
}
|
|
1450
|
+
@case ('body1') {
|
|
1451
|
+
<p [class]="textClasses()">
|
|
1452
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1453
|
+
</p>
|
|
1454
|
+
}
|
|
1455
|
+
@case ('body2') {
|
|
1456
|
+
<p [class]="textClasses()">
|
|
1457
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1458
|
+
</p>
|
|
1459
|
+
}
|
|
1460
|
+
@case ('subtitle1') {
|
|
1461
|
+
<h6 [class]="textClasses()">
|
|
1462
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1463
|
+
</h6>
|
|
1464
|
+
}
|
|
1465
|
+
@case ('subtitle2') {
|
|
1466
|
+
<h6 [class]="textClasses()">
|
|
1467
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1468
|
+
</h6>
|
|
1469
|
+
}
|
|
1470
|
+
@case ('caption') {
|
|
1471
|
+
<span [class]="textClasses()">
|
|
1472
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1473
|
+
</span>
|
|
1474
|
+
}
|
|
1475
|
+
@case ('overline') {
|
|
1476
|
+
<span [class]="textClasses()">
|
|
1477
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1478
|
+
</span>
|
|
1479
|
+
}
|
|
1480
|
+
@case ('button') {
|
|
1481
|
+
<span [class]="textClasses()">
|
|
1482
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1483
|
+
</span>
|
|
1484
|
+
}
|
|
1485
|
+
@case ('inherit') {
|
|
1486
|
+
<span [class]="textClasses()">
|
|
1487
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1488
|
+
</span>
|
|
1489
|
+
}
|
|
1490
|
+
@default {
|
|
1491
|
+
<span [class]="textClasses()">
|
|
1492
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1493
|
+
</span>
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
`, isInline: true, styles: [".text{margin-bottom:.5rem;margin-top:0}.text-h1{font-size:40px;font-weight:600;line-height:1}.text-h2{font-size:32px;font-weight:600;line-height:1}.text-h3{font-size:28px;font-weight:600;line-height:1}.text-h4{font-size:24px;font-weight:600;line-height:1}.text-h5{font-size:20px;font-weight:600;line-height:1}.text-h6{font-size:16px;font-weight:600;line-height:1}.text-body1{font-size:1rem;font-weight:400;line-height:1.5;letter-spacing:.00938em}.text-body2{font-size:.875rem;font-weight:400;line-height:1.43;letter-spacing:.01071em}.text-subtitle1{font-size:1rem;font-weight:400;line-height:1.75;letter-spacing:.00938em}.text-subtitle2{font-size:.875rem;font-weight:500;line-height:1.57;letter-spacing:.00714em}.text-caption{font-size:.75rem;font-weight:400;line-height:1.66;letter-spacing:.03333em}.text-overline{font-size:.75rem;font-weight:400;line-height:2.66;letter-spacing:.08333em;text-transform:uppercase}.text-button{font-size:.875rem;font-weight:500;line-height:1.75;letter-spacing:.02857em;text-transform:uppercase}.text-inherit{font-size:inherit;font-weight:inherit;line-height:inherit;letter-spacing:inherit}.text-color-default{color:var(--ls-color-dark)}.text-color-primary{color:var(--ls-color-primary)}.text-color-secondary{color:var(--ls-color-secondary)}.text-color-success{color:var(--ls-color-success)}.text-color-error{color:var(--ls-color-danger)}.text-color-warning{color:var(--ls-color-warning)}.text-color-info{color:var(--ls-color-info)}.text-color-dark{color:var(--ls-color-dark)}.text-align-left{text-align:left}.text-align-center{text-align:center}.text-align-right{text-align:right}.text-align-justify{text-align:justify}.text-align-inherit{text-align:inherit}body.dark .text-color-default,body.dark .text-color-dark{color:#e0e6ed}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1497
|
+
}
|
|
1498
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: TextComponent, decorators: [{
|
|
1499
|
+
type: Component,
|
|
1500
|
+
args: [{ selector: 'ls-text', standalone: true, imports: [NgTemplateOutlet], template: `
|
|
1501
|
+
<ng-template #content>
|
|
1502
|
+
<ng-content></ng-content>
|
|
1503
|
+
</ng-template>
|
|
1504
|
+
|
|
1505
|
+
@switch (variant()) {
|
|
1506
|
+
@case ('h1') {
|
|
1507
|
+
<h1 [class]="textClasses()">
|
|
1508
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1509
|
+
</h1>
|
|
1510
|
+
}
|
|
1511
|
+
@case ('h2') {
|
|
1512
|
+
<h2 [class]="textClasses()">
|
|
1513
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1514
|
+
</h2>
|
|
1515
|
+
}
|
|
1516
|
+
@case ('h3') {
|
|
1517
|
+
<h3 [class]="textClasses()">
|
|
1518
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1519
|
+
</h3>
|
|
1520
|
+
}
|
|
1521
|
+
@case ('h4') {
|
|
1522
|
+
<h4 [class]="textClasses()">
|
|
1523
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1524
|
+
</h4>
|
|
1525
|
+
}
|
|
1526
|
+
@case ('h5') {
|
|
1527
|
+
<h5 [class]="textClasses()">
|
|
1528
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1529
|
+
</h5>
|
|
1530
|
+
}
|
|
1531
|
+
@case ('h6') {
|
|
1532
|
+
<h6 [class]="textClasses()">
|
|
1533
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1534
|
+
</h6>
|
|
1535
|
+
}
|
|
1536
|
+
@case ('body1') {
|
|
1537
|
+
<p [class]="textClasses()">
|
|
1538
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1539
|
+
</p>
|
|
1540
|
+
}
|
|
1541
|
+
@case ('body2') {
|
|
1542
|
+
<p [class]="textClasses()">
|
|
1543
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1544
|
+
</p>
|
|
1545
|
+
}
|
|
1546
|
+
@case ('subtitle1') {
|
|
1547
|
+
<h6 [class]="textClasses()">
|
|
1548
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1549
|
+
</h6>
|
|
1550
|
+
}
|
|
1551
|
+
@case ('subtitle2') {
|
|
1552
|
+
<h6 [class]="textClasses()">
|
|
1553
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1554
|
+
</h6>
|
|
1555
|
+
}
|
|
1556
|
+
@case ('caption') {
|
|
1557
|
+
<span [class]="textClasses()">
|
|
1558
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1559
|
+
</span>
|
|
1560
|
+
}
|
|
1561
|
+
@case ('overline') {
|
|
1562
|
+
<span [class]="textClasses()">
|
|
1563
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1564
|
+
</span>
|
|
1565
|
+
}
|
|
1566
|
+
@case ('button') {
|
|
1567
|
+
<span [class]="textClasses()">
|
|
1568
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1569
|
+
</span>
|
|
1570
|
+
}
|
|
1571
|
+
@case ('inherit') {
|
|
1572
|
+
<span [class]="textClasses()">
|
|
1573
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1574
|
+
</span>
|
|
1575
|
+
}
|
|
1576
|
+
@default {
|
|
1577
|
+
<span [class]="textClasses()">
|
|
1578
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
1579
|
+
</span>
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".text{margin-bottom:.5rem;margin-top:0}.text-h1{font-size:40px;font-weight:600;line-height:1}.text-h2{font-size:32px;font-weight:600;line-height:1}.text-h3{font-size:28px;font-weight:600;line-height:1}.text-h4{font-size:24px;font-weight:600;line-height:1}.text-h5{font-size:20px;font-weight:600;line-height:1}.text-h6{font-size:16px;font-weight:600;line-height:1}.text-body1{font-size:1rem;font-weight:400;line-height:1.5;letter-spacing:.00938em}.text-body2{font-size:.875rem;font-weight:400;line-height:1.43;letter-spacing:.01071em}.text-subtitle1{font-size:1rem;font-weight:400;line-height:1.75;letter-spacing:.00938em}.text-subtitle2{font-size:.875rem;font-weight:500;line-height:1.57;letter-spacing:.00714em}.text-caption{font-size:.75rem;font-weight:400;line-height:1.66;letter-spacing:.03333em}.text-overline{font-size:.75rem;font-weight:400;line-height:2.66;letter-spacing:.08333em;text-transform:uppercase}.text-button{font-size:.875rem;font-weight:500;line-height:1.75;letter-spacing:.02857em;text-transform:uppercase}.text-inherit{font-size:inherit;font-weight:inherit;line-height:inherit;letter-spacing:inherit}.text-color-default{color:var(--ls-color-dark)}.text-color-primary{color:var(--ls-color-primary)}.text-color-secondary{color:var(--ls-color-secondary)}.text-color-success{color:var(--ls-color-success)}.text-color-error{color:var(--ls-color-danger)}.text-color-warning{color:var(--ls-color-warning)}.text-color-info{color:var(--ls-color-info)}.text-color-dark{color:var(--ls-color-dark)}.text-align-left{text-align:left}.text-align-center{text-align:center}.text-align-right{text-align:right}.text-align-justify{text-align:justify}.text-align-inherit{text-align:inherit}body.dark .text-color-default,body.dark .text-color-dark{color:#e0e6ed}\n"] }]
|
|
1583
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }] } });
|
|
1584
|
+
|
|
1585
|
+
class TagComponent {
|
|
1586
|
+
constructor() {
|
|
1587
|
+
this._sanitizer = inject(DomSanitizer);
|
|
1588
|
+
this.variant = input('filled', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
1589
|
+
this.color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
1590
|
+
this.startIcon = input(...(ngDevMode ? [undefined, { debugName: "startIcon" }] : []));
|
|
1591
|
+
this.endIcon = input(...(ngDevMode ? [undefined, { debugName: "endIcon" }] : []));
|
|
1592
|
+
}
|
|
1593
|
+
get sanitizedStartIcon() {
|
|
1594
|
+
return this._sanitizer.bypassSecurityTrustHtml(this.startIcon() ?? '');
|
|
1595
|
+
}
|
|
1596
|
+
get sanitizedEndIcon() {
|
|
1597
|
+
return this._sanitizer.bypassSecurityTrustHtml(this.endIcon() ?? '');
|
|
1598
|
+
}
|
|
1599
|
+
get tagClasses() {
|
|
1600
|
+
return `tag tag-${this.variant()}-${this.color()}`;
|
|
1601
|
+
}
|
|
1602
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: TagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1603
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: TagComponent, isStandalone: true, selector: "ls-tag", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, startIcon: { classPropertyName: "startIcon", publicName: "startIcon", isSignal: true, isRequired: false, transformFunction: null }, endIcon: { classPropertyName: "endIcon", publicName: "endIcon", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1604
|
+
<span [class]="tagClasses">
|
|
1605
|
+
@if (startIcon()) {
|
|
1606
|
+
<span
|
|
1607
|
+
class="tag-icon tag-icon--start"
|
|
1608
|
+
[innerHTML]="sanitizedStartIcon"></span>
|
|
1609
|
+
}
|
|
1610
|
+
<ng-content />
|
|
1611
|
+
@if (endIcon()) {
|
|
1612
|
+
<span
|
|
1613
|
+
class="tag-icon tag-icon--end"
|
|
1614
|
+
[innerHTML]="sanitizedEndIcon"></span>
|
|
1615
|
+
}
|
|
1616
|
+
</span>
|
|
1617
|
+
`, isInline: true, styles: [":host{display:contents}.tag{display:inline-flex;align-items:center;justify-content:center;gap:6px;font-size:.75rem;font-weight:600;line-height:1;height:24px;padding:0 8px;border-radius:6px;white-space:nowrap;cursor:default;-webkit-user-select:none;user-select:none;transition:all .15s ease-in-out}.tag-icon{display:inline-flex;align-items:center;flex-shrink:0;width:16px;height:16px}.tag-icon svg{width:100%;height:100%}.tag-filled-primary{border:none;color:#fff;background-color:var(--ls-color-primary)}.tag-filled-secondary{border:none;color:#fff;background-color:var(--ls-color-secondary)}.tag-filled-success{border:none;color:#fff;background-color:var(--ls-color-success)}.tag-filled-error{border:none;color:#fff;background-color:var(--ls-color-error)}.tag-filled-info{border:none;color:#fff;background-color:var(--ls-color-info)}.tag-filled-warning{border:none;color:#fff;background-color:var(--ls-color-warning)}.tag-filled-inherit{border:none;color:#fff;background-color:var(--ls-color-dark)}.tag-outlined-primary{background-color:transparent;border:1px solid var(--ls-color-primary);color:var(--ls-color-primary)}.tag-outlined-secondary{background-color:transparent;border:1px solid var(--ls-color-secondary);color:var(--ls-color-secondary)}.tag-outlined-success{background-color:transparent;border:1px solid var(--ls-color-success);color:var(--ls-color-success)}.tag-outlined-error{background-color:transparent;border:1px solid var(--ls-color-error);color:var(--ls-color-error)}.tag-outlined-info{background-color:transparent;border:1px solid var(--ls-color-info);color:var(--ls-color-info)}.tag-outlined-warning{background-color:transparent;border:1px solid var(--ls-color-warning);color:var(--ls-color-warning)}.tag-outlined-inherit{background-color:transparent;border:1px solid var(--ls-color-dark);color:var(--ls-color-dark)}.tag-soft-primary{border:none;color:var(--ls-color-primary);background-color:var(--ls-color-primary-dark-light)}.tag-soft-secondary{border:none;color:var(--ls-color-secondary);background-color:var(--ls-color-secondary-dark-light)}.tag-soft-success{border:none;color:var(--ls-color-success);background-color:var(--ls-color-success-dark-light)}.tag-soft-error{border:none;color:var(--ls-color-error);background-color:var(--ls-color-error-dark-light)}.tag-soft-info{border:none;color:var(--ls-color-info);background-color:var(--ls-color-info-dark-light)}.tag-soft-warning{border:none;color:var(--ls-color-warning);background-color:var(--ls-color-warning-dark-light)}.tag-soft-inherit{border:none;color:var(--ls-color-dark);background-color:var(--ls-color-dark-dark-light)}.tag-inverted-primary{border:none;background-color:#fff;color:var(--ls-color-primary)}.tag-inverted-secondary{border:none;background-color:#fff;color:var(--ls-color-secondary)}.tag-inverted-success{border:none;background-color:#fff;color:var(--ls-color-success)}.tag-inverted-error{border:none;background-color:#fff;color:var(--ls-color-error)}.tag-inverted-info{border:none;background-color:#fff;color:var(--ls-color-info)}.tag-inverted-warning{border:none;background-color:#fff;color:var(--ls-color-warning)}.tag-inverted-inherit{border:none;background-color:#fff;color:var(--ls-color-dark)}body.dark .tag-filled-inherit{color:var(--ls-color-dark);background-color:#e0e6ed}body.dark .tag-outlined-inherit{border-color:#e0e6ed;color:#e0e6ed}body.dark .tag-soft-inherit{color:#e0e6ed;background-color:#e0e6ed26}body.dark .tag-inverted-primary,body.dark .tag-inverted-secondary,body.dark .tag-inverted-success,body.dark .tag-inverted-error,body.dark .tag-inverted-info,body.dark .tag-inverted-warning{background-color:var(--ls-color-dark)}body.dark .tag-inverted-inherit{color:#e0e6ed;background-color:var(--ls-color-dark)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1618
|
+
}
|
|
1619
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: TagComponent, decorators: [{
|
|
1620
|
+
type: Component,
|
|
1621
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ls-tag', standalone: true, template: `
|
|
1622
|
+
<span [class]="tagClasses">
|
|
1623
|
+
@if (startIcon()) {
|
|
1624
|
+
<span
|
|
1625
|
+
class="tag-icon tag-icon--start"
|
|
1626
|
+
[innerHTML]="sanitizedStartIcon"></span>
|
|
1627
|
+
}
|
|
1628
|
+
<ng-content />
|
|
1629
|
+
@if (endIcon()) {
|
|
1630
|
+
<span
|
|
1631
|
+
class="tag-icon tag-icon--end"
|
|
1632
|
+
[innerHTML]="sanitizedEndIcon"></span>
|
|
1633
|
+
}
|
|
1634
|
+
</span>
|
|
1635
|
+
`, styles: [":host{display:contents}.tag{display:inline-flex;align-items:center;justify-content:center;gap:6px;font-size:.75rem;font-weight:600;line-height:1;height:24px;padding:0 8px;border-radius:6px;white-space:nowrap;cursor:default;-webkit-user-select:none;user-select:none;transition:all .15s ease-in-out}.tag-icon{display:inline-flex;align-items:center;flex-shrink:0;width:16px;height:16px}.tag-icon svg{width:100%;height:100%}.tag-filled-primary{border:none;color:#fff;background-color:var(--ls-color-primary)}.tag-filled-secondary{border:none;color:#fff;background-color:var(--ls-color-secondary)}.tag-filled-success{border:none;color:#fff;background-color:var(--ls-color-success)}.tag-filled-error{border:none;color:#fff;background-color:var(--ls-color-error)}.tag-filled-info{border:none;color:#fff;background-color:var(--ls-color-info)}.tag-filled-warning{border:none;color:#fff;background-color:var(--ls-color-warning)}.tag-filled-inherit{border:none;color:#fff;background-color:var(--ls-color-dark)}.tag-outlined-primary{background-color:transparent;border:1px solid var(--ls-color-primary);color:var(--ls-color-primary)}.tag-outlined-secondary{background-color:transparent;border:1px solid var(--ls-color-secondary);color:var(--ls-color-secondary)}.tag-outlined-success{background-color:transparent;border:1px solid var(--ls-color-success);color:var(--ls-color-success)}.tag-outlined-error{background-color:transparent;border:1px solid var(--ls-color-error);color:var(--ls-color-error)}.tag-outlined-info{background-color:transparent;border:1px solid var(--ls-color-info);color:var(--ls-color-info)}.tag-outlined-warning{background-color:transparent;border:1px solid var(--ls-color-warning);color:var(--ls-color-warning)}.tag-outlined-inherit{background-color:transparent;border:1px solid var(--ls-color-dark);color:var(--ls-color-dark)}.tag-soft-primary{border:none;color:var(--ls-color-primary);background-color:var(--ls-color-primary-dark-light)}.tag-soft-secondary{border:none;color:var(--ls-color-secondary);background-color:var(--ls-color-secondary-dark-light)}.tag-soft-success{border:none;color:var(--ls-color-success);background-color:var(--ls-color-success-dark-light)}.tag-soft-error{border:none;color:var(--ls-color-error);background-color:var(--ls-color-error-dark-light)}.tag-soft-info{border:none;color:var(--ls-color-info);background-color:var(--ls-color-info-dark-light)}.tag-soft-warning{border:none;color:var(--ls-color-warning);background-color:var(--ls-color-warning-dark-light)}.tag-soft-inherit{border:none;color:var(--ls-color-dark);background-color:var(--ls-color-dark-dark-light)}.tag-inverted-primary{border:none;background-color:#fff;color:var(--ls-color-primary)}.tag-inverted-secondary{border:none;background-color:#fff;color:var(--ls-color-secondary)}.tag-inverted-success{border:none;background-color:#fff;color:var(--ls-color-success)}.tag-inverted-error{border:none;background-color:#fff;color:var(--ls-color-error)}.tag-inverted-info{border:none;background-color:#fff;color:var(--ls-color-info)}.tag-inverted-warning{border:none;background-color:#fff;color:var(--ls-color-warning)}.tag-inverted-inherit{border:none;background-color:#fff;color:var(--ls-color-dark)}body.dark .tag-filled-inherit{color:var(--ls-color-dark);background-color:#e0e6ed}body.dark .tag-outlined-inherit{border-color:#e0e6ed;color:#e0e6ed}body.dark .tag-soft-inherit{color:#e0e6ed;background-color:#e0e6ed26}body.dark .tag-inverted-primary,body.dark .tag-inverted-secondary,body.dark .tag-inverted-success,body.dark .tag-inverted-error,body.dark .tag-inverted-info,body.dark .tag-inverted-warning{background-color:var(--ls-color-dark)}body.dark .tag-inverted-inherit{color:#e0e6ed;background-color:var(--ls-color-dark)}\n"] }]
|
|
1636
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], startIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "startIcon", required: false }] }], endIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "endIcon", required: false }] }] } });
|
|
1637
|
+
|
|
1638
|
+
class BadgeComponent {
|
|
1639
|
+
constructor() {
|
|
1640
|
+
this.badgeContent = input(undefined, ...(ngDevMode ? [{ debugName: "badgeContent" }] : []));
|
|
1641
|
+
this.max = input(99, ...(ngDevMode ? [{ debugName: "max" }] : []));
|
|
1642
|
+
this.severity = input('error', ...(ngDevMode ? [{ debugName: "severity" }] : []));
|
|
1643
|
+
this.variant = input('solid', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
1644
|
+
this.badgePosition = input('top-right', ...(ngDevMode ? [{ debugName: "badgePosition" }] : []));
|
|
1645
|
+
this.overlap = input('rectangular', ...(ngDevMode ? [{ debugName: "overlap" }] : []));
|
|
1646
|
+
this.isHidden = input(false, ...(ngDevMode ? [{ debugName: "isHidden" }] : []));
|
|
1647
|
+
this.formattedContent = computed(() => {
|
|
1648
|
+
const raw = this.badgeContent();
|
|
1649
|
+
if (raw === undefined || raw === null)
|
|
1650
|
+
return '';
|
|
1651
|
+
if (typeof raw === 'number') {
|
|
1652
|
+
return raw > this.max()
|
|
1653
|
+
? `${this.max()}+`
|
|
1654
|
+
: String(raw);
|
|
1655
|
+
}
|
|
1656
|
+
return String(raw);
|
|
1657
|
+
}, ...(ngDevMode ? [{ debugName: "formattedContent" }] : []));
|
|
1658
|
+
this.badgeClasses = computed(() => {
|
|
1659
|
+
const classes = ['badge'];
|
|
1660
|
+
classes.push(`badge-${this.severity()}`);
|
|
1661
|
+
classes.push(`badge-${this.variant()}`);
|
|
1662
|
+
classes.push(`badge-${this.badgePosition()}`);
|
|
1663
|
+
classes.push(`badge-overlap-${this.overlap()}`);
|
|
1664
|
+
return classes.join(' ');
|
|
1665
|
+
}, ...(ngDevMode ? [{ debugName: "badgeClasses" }] : []));
|
|
1666
|
+
this.ariaLabelText = computed(() => {
|
|
1667
|
+
if (this.variant() === 'dot') {
|
|
1668
|
+
return 'status indicator';
|
|
1669
|
+
}
|
|
1670
|
+
const formatted = this.formattedContent();
|
|
1671
|
+
return formatted || 'badge';
|
|
1672
|
+
}, ...(ngDevMode ? [{ debugName: "ariaLabelText" }] : []));
|
|
1673
|
+
}
|
|
1674
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: BadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1675
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: BadgeComponent, isStandalone: true, selector: "ls-badge", inputs: { badgeContent: { classPropertyName: "badgeContent", publicName: "badgeContent", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, severity: { classPropertyName: "severity", publicName: "severity", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, badgePosition: { classPropertyName: "badgePosition", publicName: "badgePosition", isSignal: true, isRequired: false, transformFunction: null }, overlap: { classPropertyName: "overlap", publicName: "overlap", isSignal: true, isRequired: false, transformFunction: null }, isHidden: { classPropertyName: "isHidden", publicName: "isHidden", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1676
|
+
<div class="badge-wrapper">
|
|
1677
|
+
<ng-content />
|
|
1678
|
+
@if (!isHidden()) {
|
|
1679
|
+
<span
|
|
1680
|
+
[class]="badgeClasses()"
|
|
1681
|
+
role="status"
|
|
1682
|
+
[attr.aria-label]="ariaLabelText()">
|
|
1683
|
+
@if (variant() !== 'dot') {
|
|
1684
|
+
{{ formattedContent() }}
|
|
1685
|
+
}
|
|
1686
|
+
</span>
|
|
1687
|
+
}
|
|
1688
|
+
</div>
|
|
1689
|
+
`, isInline: true, styles: [":host{display:contents}.badge-wrapper{position:relative;display:inline-flex;vertical-align:middle}.badge{position:absolute;display:inline-flex;align-items:center;justify-content:center;font-size:.625rem;font-weight:600;line-height:1;min-width:20px;height:20px;padding:0 6px;border-radius:var(--ls-border-radius-full);white-space:nowrap;z-index:1;pointer-events:none;transition:transform var(--ls-transition-duration) ease;box-shadow:0 2px 5px #00000026}.badge-solid{color:#fff}.badge-outlined{background-color:transparent;border-width:2px;border-style:solid}.badge-dot{min-width:10px;width:10px;height:10px;padding:0;border-radius:50%}.badge-top-right{top:0;right:0;transform:translate(50%,-50%)}.badge-top-left{top:0;left:0;transform:translate(-50%,-50%)}.badge-bottom-right{bottom:0;right:0;transform:translate(50%,50%)}.badge-bottom-left{bottom:0;left:0;transform:translate(-50%,50%)}.badge-overlap-circular.badge-top-right{top:8%;right:8%}.badge-overlap-circular.badge-top-left{top:8%;left:8%}.badge-overlap-circular.badge-bottom-right{bottom:8%;right:8%}.badge-overlap-circular.badge-bottom-left{bottom:8%;left:8%}.badge-solid.badge-primary{background-color:var(--ls-color-primary)}.badge-solid.badge-secondary{background-color:var(--ls-color-secondary)}.badge-solid.badge-success{background-color:var(--ls-color-success)}.badge-solid.badge-warning{background-color:var(--ls-color-warning)}.badge-solid.badge-error{background-color:var(--ls-color-danger)}.badge-solid.badge-info{background-color:var(--ls-color-info)}.badge-outlined.badge-primary{border-color:var(--ls-color-primary);color:var(--ls-color-primary)}.badge-outlined.badge-secondary{border-color:var(--ls-color-secondary);color:var(--ls-color-secondary)}.badge-outlined.badge-success{border-color:var(--ls-color-success);color:var(--ls-color-success)}.badge-outlined.badge-warning{border-color:var(--ls-color-warning);color:var(--ls-color-warning)}.badge-outlined.badge-error{border-color:var(--ls-color-danger);color:var(--ls-color-danger)}.badge-outlined.badge-info{border-color:var(--ls-color-info);color:var(--ls-color-info)}.badge-dot.badge-primary{background-color:var(--ls-color-primary)}.badge-dot.badge-secondary{background-color:var(--ls-color-secondary)}.badge-dot.badge-success{background-color:var(--ls-color-success)}.badge-dot.badge-warning{background-color:var(--ls-color-warning)}.badge-dot.badge-error{background-color:var(--ls-color-danger)}.badge-dot.badge-info{background-color:var(--ls-color-info)}body.dark .badge-solid{color:#fff}body.dark .badge-outlined.badge-primary{border-color:var(--ls-color-primary);color:var(--ls-color-primary)}body.dark .badge-outlined.badge-secondary{border-color:#9ca3af;color:#9ca3af}body.dark .badge-outlined.badge-success{border-color:var(--ls-color-success);color:var(--ls-color-success)}body.dark .badge-outlined.badge-warning{border-color:var(--ls-color-warning);color:var(--ls-color-warning)}body.dark .badge-outlined.badge-error{border-color:var(--ls-color-danger);color:var(--ls-color-danger)}body.dark .badge-outlined.badge-info{border-color:var(--ls-color-info);color:var(--ls-color-info)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1690
|
+
}
|
|
1691
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: BadgeComponent, decorators: [{
|
|
1692
|
+
type: Component,
|
|
1693
|
+
args: [{ selector: 'ls-badge', standalone: true, template: `
|
|
1694
|
+
<div class="badge-wrapper">
|
|
1695
|
+
<ng-content />
|
|
1696
|
+
@if (!isHidden()) {
|
|
1697
|
+
<span
|
|
1698
|
+
[class]="badgeClasses()"
|
|
1699
|
+
role="status"
|
|
1700
|
+
[attr.aria-label]="ariaLabelText()">
|
|
1701
|
+
@if (variant() !== 'dot') {
|
|
1702
|
+
{{ formattedContent() }}
|
|
1703
|
+
}
|
|
1704
|
+
</span>
|
|
1705
|
+
}
|
|
1706
|
+
</div>
|
|
1707
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:contents}.badge-wrapper{position:relative;display:inline-flex;vertical-align:middle}.badge{position:absolute;display:inline-flex;align-items:center;justify-content:center;font-size:.625rem;font-weight:600;line-height:1;min-width:20px;height:20px;padding:0 6px;border-radius:var(--ls-border-radius-full);white-space:nowrap;z-index:1;pointer-events:none;transition:transform var(--ls-transition-duration) ease;box-shadow:0 2px 5px #00000026}.badge-solid{color:#fff}.badge-outlined{background-color:transparent;border-width:2px;border-style:solid}.badge-dot{min-width:10px;width:10px;height:10px;padding:0;border-radius:50%}.badge-top-right{top:0;right:0;transform:translate(50%,-50%)}.badge-top-left{top:0;left:0;transform:translate(-50%,-50%)}.badge-bottom-right{bottom:0;right:0;transform:translate(50%,50%)}.badge-bottom-left{bottom:0;left:0;transform:translate(-50%,50%)}.badge-overlap-circular.badge-top-right{top:8%;right:8%}.badge-overlap-circular.badge-top-left{top:8%;left:8%}.badge-overlap-circular.badge-bottom-right{bottom:8%;right:8%}.badge-overlap-circular.badge-bottom-left{bottom:8%;left:8%}.badge-solid.badge-primary{background-color:var(--ls-color-primary)}.badge-solid.badge-secondary{background-color:var(--ls-color-secondary)}.badge-solid.badge-success{background-color:var(--ls-color-success)}.badge-solid.badge-warning{background-color:var(--ls-color-warning)}.badge-solid.badge-error{background-color:var(--ls-color-danger)}.badge-solid.badge-info{background-color:var(--ls-color-info)}.badge-outlined.badge-primary{border-color:var(--ls-color-primary);color:var(--ls-color-primary)}.badge-outlined.badge-secondary{border-color:var(--ls-color-secondary);color:var(--ls-color-secondary)}.badge-outlined.badge-success{border-color:var(--ls-color-success);color:var(--ls-color-success)}.badge-outlined.badge-warning{border-color:var(--ls-color-warning);color:var(--ls-color-warning)}.badge-outlined.badge-error{border-color:var(--ls-color-danger);color:var(--ls-color-danger)}.badge-outlined.badge-info{border-color:var(--ls-color-info);color:var(--ls-color-info)}.badge-dot.badge-primary{background-color:var(--ls-color-primary)}.badge-dot.badge-secondary{background-color:var(--ls-color-secondary)}.badge-dot.badge-success{background-color:var(--ls-color-success)}.badge-dot.badge-warning{background-color:var(--ls-color-warning)}.badge-dot.badge-error{background-color:var(--ls-color-danger)}.badge-dot.badge-info{background-color:var(--ls-color-info)}body.dark .badge-solid{color:#fff}body.dark .badge-outlined.badge-primary{border-color:var(--ls-color-primary);color:var(--ls-color-primary)}body.dark .badge-outlined.badge-secondary{border-color:#9ca3af;color:#9ca3af}body.dark .badge-outlined.badge-success{border-color:var(--ls-color-success);color:var(--ls-color-success)}body.dark .badge-outlined.badge-warning{border-color:var(--ls-color-warning);color:var(--ls-color-warning)}body.dark .badge-outlined.badge-error{border-color:var(--ls-color-danger);color:var(--ls-color-danger)}body.dark .badge-outlined.badge-info{border-color:var(--ls-color-info);color:var(--ls-color-info)}\n"] }]
|
|
1708
|
+
}], propDecorators: { badgeContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "badgeContent", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], severity: [{ type: i0.Input, args: [{ isSignal: true, alias: "severity", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], badgePosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "badgePosition", required: false }] }], overlap: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlap", required: false }] }], isHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "isHidden", required: false }] }] } });
|
|
1709
|
+
|
|
1710
|
+
class ChipComponent {
|
|
1711
|
+
constructor() {
|
|
1712
|
+
this._sanitizer = inject(DomSanitizer);
|
|
1713
|
+
this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1714
|
+
this.variant = input('filled', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
1715
|
+
this.color = input('default', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
1716
|
+
this.size = input('medium', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1717
|
+
this.icon = input(undefined, ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
1718
|
+
this.avatar = input(undefined, ...(ngDevMode ? [{ debugName: "avatar" }] : []));
|
|
1719
|
+
this.deleteIcon = input(false, ...(ngDevMode ? [{ debugName: "deleteIcon" }] : []));
|
|
1720
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
1721
|
+
this.clickable = input(false, ...(ngDevMode ? [{ debugName: "clickable" }] : []));
|
|
1722
|
+
this.onClick = output();
|
|
1723
|
+
this.onDelete = output();
|
|
1724
|
+
this.sanitizedIcon = computed(() => this._sanitizer.bypassSecurityTrustHtml(this.icon() ?? ''), ...(ngDevMode ? [{ debugName: "sanitizedIcon" }] : []));
|
|
1725
|
+
this.chipClasses = computed(() => {
|
|
1726
|
+
const classes = ['chip'];
|
|
1727
|
+
classes.push(`chip-${this.variant()}`);
|
|
1728
|
+
classes.push(`chip-${this.color()}`);
|
|
1729
|
+
classes.push(`chip-${this.size()}`);
|
|
1730
|
+
if (this.clickable())
|
|
1731
|
+
classes.push('chip-clickable');
|
|
1732
|
+
if (this.disabled())
|
|
1733
|
+
classes.push('chip-disabled');
|
|
1734
|
+
return classes.join(' ');
|
|
1735
|
+
}, ...(ngDevMode ? [{ debugName: "chipClasses" }] : []));
|
|
1736
|
+
}
|
|
1737
|
+
handleClick(event) {
|
|
1738
|
+
if (this.clickable() && !this.disabled()) {
|
|
1739
|
+
this.onClick.emit();
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
handleDelete(event) {
|
|
1743
|
+
event.stopPropagation();
|
|
1744
|
+
this.onDelete.emit();
|
|
1745
|
+
}
|
|
1746
|
+
handleKeydown(event) {
|
|
1747
|
+
if (event.key === 'Enter') {
|
|
1748
|
+
this.handleClick(event);
|
|
1749
|
+
}
|
|
1750
|
+
if ((event.key === 'Delete' || event.key === 'Backspace') &&
|
|
1751
|
+
this.deleteIcon()) {
|
|
1752
|
+
this.handleDelete(event);
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1756
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: ChipComponent, isStandalone: true, selector: "ls-chip", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, avatar: { classPropertyName: "avatar", publicName: "avatar", isSignal: true, isRequired: false, transformFunction: null }, deleteIcon: { classPropertyName: "deleteIcon", publicName: "deleteIcon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onClick: "onClick", onDelete: "onDelete" }, ngImport: i0, template: `
|
|
1757
|
+
<span
|
|
1758
|
+
[class]="chipClasses()"
|
|
1759
|
+
[attr.role]="clickable() ? 'button' : null"
|
|
1760
|
+
[attr.tabindex]="clickable() && !disabled() ? 0 : null"
|
|
1761
|
+
[attr.aria-disabled]="disabled() ? 'true' : null"
|
|
1762
|
+
(click)="handleClick($event)"
|
|
1763
|
+
(keydown)="handleKeydown($event)">
|
|
1764
|
+
|
|
1765
|
+
@if (avatar()) {
|
|
1766
|
+
<img
|
|
1767
|
+
class="chip-avatar"
|
|
1768
|
+
[src]="avatar()"
|
|
1769
|
+
[alt]="label()"
|
|
1770
|
+
aria-hidden="true" />
|
|
1771
|
+
} @else if (icon()) {
|
|
1772
|
+
<span
|
|
1773
|
+
class="chip-icon"
|
|
1774
|
+
[innerHTML]="sanitizedIcon()"
|
|
1775
|
+
aria-hidden="true"></span>
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
<span class="chip-label">{{ label() }}</span>
|
|
1779
|
+
|
|
1780
|
+
@if (deleteIcon() && !disabled()) {
|
|
1781
|
+
<button
|
|
1782
|
+
class="chip-delete"
|
|
1783
|
+
aria-label="Remove"
|
|
1784
|
+
tabindex="-1"
|
|
1785
|
+
(click)="handleDelete($event)">
|
|
1786
|
+
<svg
|
|
1787
|
+
viewBox="0 0 24 24"
|
|
1788
|
+
fill="currentColor"
|
|
1789
|
+
class="chip-delete-svg">
|
|
1790
|
+
<path
|
|
1791
|
+
d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />
|
|
1792
|
+
</svg>
|
|
1793
|
+
</button>
|
|
1794
|
+
}
|
|
1795
|
+
</span>
|
|
1796
|
+
`, isInline: true, styles: [":host{display:contents}.chip{display:inline-flex;align-items:center;border-radius:var(--ls-border-radius-full);font-weight:500;white-space:nowrap;vertical-align:middle;outline:none;transition:background-color .15s ease,box-shadow .15s ease;-webkit-user-select:none;user-select:none}.chip-medium{height:32px;padding:0 12px;font-size:.8125rem;line-height:32px;gap:6px}.chip-small{height:24px;padding:0 8px;font-size:.75rem;line-height:24px;gap:4px}.chip-filled.chip-default{background-color:#e0e0e0;color:#000000de}.chip-filled.chip-primary{background-color:var(--ls-color-primary);color:#fff}.chip-filled.chip-secondary{background-color:var(--ls-color-secondary);color:#fff}.chip-filled.chip-success{background-color:var(--ls-color-success);color:#fff}.chip-filled.chip-warning{background-color:var(--ls-color-warning);color:#fff}.chip-filled.chip-error{background-color:var(--ls-color-danger);color:#fff}.chip-filled.chip-info{background-color:var(--ls-color-info);color:#fff}.chip-outlined.chip-default{background-color:transparent;border:1px solid #bdbdbd;color:#000000de}.chip-outlined.chip-primary{background-color:transparent;border:1px solid var(--ls-color-primary);color:var(--ls-color-primary)}.chip-outlined.chip-secondary{background-color:transparent;border:1px solid var(--ls-color-secondary);color:var(--ls-color-secondary)}.chip-outlined.chip-success{background-color:transparent;border:1px solid var(--ls-color-success);color:var(--ls-color-success)}.chip-outlined.chip-warning{background-color:transparent;border:1px solid var(--ls-color-warning);color:var(--ls-color-warning)}.chip-outlined.chip-error{background-color:transparent;border:1px solid var(--ls-color-danger);color:var(--ls-color-danger)}.chip-outlined.chip-info{background-color:transparent;border:1px solid var(--ls-color-info);color:var(--ls-color-info)}.chip-clickable{cursor:pointer}.chip-clickable:hover{box-shadow:0 2px 4px #0000001a}.chip-clickable.chip-filled.chip-default:hover{background-color:#d5d5d5}.chip-clickable.chip-filled.chip-primary:hover,.chip-clickable.chip-filled.chip-secondary:hover,.chip-clickable.chip-filled.chip-success:hover,.chip-clickable.chip-filled.chip-warning:hover,.chip-clickable.chip-filled.chip-error:hover,.chip-clickable.chip-filled.chip-info:hover{filter:brightness(.9)}.chip-clickable.chip-outlined:hover{background-color:#0000000a}.chip-disabled{opacity:.6;pointer-events:none;cursor:default}.chip-avatar{width:24px;height:24px;border-radius:50%;object-fit:cover;margin-left:-4px}.chip-small .chip-avatar{width:18px;height:18px;margin-left:-2px}.chip-icon{display:inline-flex;align-items:center;flex-shrink:0}.chip-icon>svg{width:18px;height:18px}.chip-small .chip-icon>svg{width:16px;height:16px}.chip-delete{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;cursor:pointer;border:none;background:transparent;color:inherit;opacity:.7;padding:0;margin-right:-4px;transition:opacity .15s ease}.chip-delete:hover{opacity:1}.chip-delete-svg{width:18px;height:18px}.chip-small .chip-delete-svg{width:16px;height:16px}body.dark .chip-filled.chip-default{background-color:#4a4a4a;color:#e0e0e0}body.dark .chip-clickable.chip-filled.chip-default:hover{background-color:#5a5a5a}body.dark .chip-outlined.chip-default{border-color:#616161;color:#e0e0e0}body.dark .chip-clickable.chip-outlined:hover{background-color:#ffffff14}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1797
|
+
}
|
|
1798
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ChipComponent, decorators: [{
|
|
1799
|
+
type: Component,
|
|
1800
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ls-chip', standalone: true, template: `
|
|
1801
|
+
<span
|
|
1802
|
+
[class]="chipClasses()"
|
|
1803
|
+
[attr.role]="clickable() ? 'button' : null"
|
|
1804
|
+
[attr.tabindex]="clickable() && !disabled() ? 0 : null"
|
|
1805
|
+
[attr.aria-disabled]="disabled() ? 'true' : null"
|
|
1806
|
+
(click)="handleClick($event)"
|
|
1807
|
+
(keydown)="handleKeydown($event)">
|
|
1808
|
+
|
|
1809
|
+
@if (avatar()) {
|
|
1810
|
+
<img
|
|
1811
|
+
class="chip-avatar"
|
|
1812
|
+
[src]="avatar()"
|
|
1813
|
+
[alt]="label()"
|
|
1814
|
+
aria-hidden="true" />
|
|
1815
|
+
} @else if (icon()) {
|
|
1816
|
+
<span
|
|
1817
|
+
class="chip-icon"
|
|
1818
|
+
[innerHTML]="sanitizedIcon()"
|
|
1819
|
+
aria-hidden="true"></span>
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
<span class="chip-label">{{ label() }}</span>
|
|
1823
|
+
|
|
1824
|
+
@if (deleteIcon() && !disabled()) {
|
|
1825
|
+
<button
|
|
1826
|
+
class="chip-delete"
|
|
1827
|
+
aria-label="Remove"
|
|
1828
|
+
tabindex="-1"
|
|
1829
|
+
(click)="handleDelete($event)">
|
|
1830
|
+
<svg
|
|
1831
|
+
viewBox="0 0 24 24"
|
|
1832
|
+
fill="currentColor"
|
|
1833
|
+
class="chip-delete-svg">
|
|
1834
|
+
<path
|
|
1835
|
+
d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />
|
|
1836
|
+
</svg>
|
|
1837
|
+
</button>
|
|
1838
|
+
}
|
|
1839
|
+
</span>
|
|
1840
|
+
`, styles: [":host{display:contents}.chip{display:inline-flex;align-items:center;border-radius:var(--ls-border-radius-full);font-weight:500;white-space:nowrap;vertical-align:middle;outline:none;transition:background-color .15s ease,box-shadow .15s ease;-webkit-user-select:none;user-select:none}.chip-medium{height:32px;padding:0 12px;font-size:.8125rem;line-height:32px;gap:6px}.chip-small{height:24px;padding:0 8px;font-size:.75rem;line-height:24px;gap:4px}.chip-filled.chip-default{background-color:#e0e0e0;color:#000000de}.chip-filled.chip-primary{background-color:var(--ls-color-primary);color:#fff}.chip-filled.chip-secondary{background-color:var(--ls-color-secondary);color:#fff}.chip-filled.chip-success{background-color:var(--ls-color-success);color:#fff}.chip-filled.chip-warning{background-color:var(--ls-color-warning);color:#fff}.chip-filled.chip-error{background-color:var(--ls-color-danger);color:#fff}.chip-filled.chip-info{background-color:var(--ls-color-info);color:#fff}.chip-outlined.chip-default{background-color:transparent;border:1px solid #bdbdbd;color:#000000de}.chip-outlined.chip-primary{background-color:transparent;border:1px solid var(--ls-color-primary);color:var(--ls-color-primary)}.chip-outlined.chip-secondary{background-color:transparent;border:1px solid var(--ls-color-secondary);color:var(--ls-color-secondary)}.chip-outlined.chip-success{background-color:transparent;border:1px solid var(--ls-color-success);color:var(--ls-color-success)}.chip-outlined.chip-warning{background-color:transparent;border:1px solid var(--ls-color-warning);color:var(--ls-color-warning)}.chip-outlined.chip-error{background-color:transparent;border:1px solid var(--ls-color-danger);color:var(--ls-color-danger)}.chip-outlined.chip-info{background-color:transparent;border:1px solid var(--ls-color-info);color:var(--ls-color-info)}.chip-clickable{cursor:pointer}.chip-clickable:hover{box-shadow:0 2px 4px #0000001a}.chip-clickable.chip-filled.chip-default:hover{background-color:#d5d5d5}.chip-clickable.chip-filled.chip-primary:hover,.chip-clickable.chip-filled.chip-secondary:hover,.chip-clickable.chip-filled.chip-success:hover,.chip-clickable.chip-filled.chip-warning:hover,.chip-clickable.chip-filled.chip-error:hover,.chip-clickable.chip-filled.chip-info:hover{filter:brightness(.9)}.chip-clickable.chip-outlined:hover{background-color:#0000000a}.chip-disabled{opacity:.6;pointer-events:none;cursor:default}.chip-avatar{width:24px;height:24px;border-radius:50%;object-fit:cover;margin-left:-4px}.chip-small .chip-avatar{width:18px;height:18px;margin-left:-2px}.chip-icon{display:inline-flex;align-items:center;flex-shrink:0}.chip-icon>svg{width:18px;height:18px}.chip-small .chip-icon>svg{width:16px;height:16px}.chip-delete{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;cursor:pointer;border:none;background:transparent;color:inherit;opacity:.7;padding:0;margin-right:-4px;transition:opacity .15s ease}.chip-delete:hover{opacity:1}.chip-delete-svg{width:18px;height:18px}.chip-small .chip-delete-svg{width:16px;height:16px}body.dark .chip-filled.chip-default{background-color:#4a4a4a;color:#e0e0e0}body.dark .chip-clickable.chip-filled.chip-default:hover{background-color:#5a5a5a}body.dark .chip-outlined.chip-default{border-color:#616161;color:#e0e0e0}body.dark .chip-clickable.chip-outlined:hover{background-color:#ffffff14}\n"] }]
|
|
1841
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], avatar: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatar", required: false }] }], deleteIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "deleteIcon", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickable", required: false }] }], onClick: [{ type: i0.Output, args: ["onClick"] }], onDelete: [{ type: i0.Output, args: ["onDelete"] }] } });
|
|
1842
|
+
|
|
1843
|
+
let nextId = 0;
|
|
1844
|
+
class TooltipComponent {
|
|
1845
|
+
constructor() {
|
|
1846
|
+
this.content = input.required(...(ngDevMode ? [{ debugName: "content" }] : []));
|
|
1847
|
+
this.placement = input('top', ...(ngDevMode ? [{ debugName: "placement" }] : []));
|
|
1848
|
+
this.backgroundClass = input('dark', ...(ngDevMode ? [{ debugName: "backgroundClass" }] : []));
|
|
1849
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
1850
|
+
this._isVisible = signal(false, ...(ngDevMode ? [{ debugName: "_isVisible" }] : []));
|
|
1851
|
+
this._tooltipId = `ls-tooltip-${nextId++}`;
|
|
1852
|
+
}
|
|
1853
|
+
get tooltipClasses() {
|
|
1854
|
+
return [
|
|
1855
|
+
'tooltip-box',
|
|
1856
|
+
`tooltip-${this.placement()}`,
|
|
1857
|
+
`tooltip-bg-${this.backgroundClass()}`,
|
|
1858
|
+
].join(' ');
|
|
1859
|
+
}
|
|
1860
|
+
show() {
|
|
1861
|
+
this._isVisible.set(true);
|
|
1862
|
+
}
|
|
1863
|
+
hide() {
|
|
1864
|
+
this._isVisible.set(false);
|
|
1865
|
+
}
|
|
1866
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: TooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1867
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: TooltipComponent, isStandalone: true, selector: "ls-tooltip", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, backgroundClass: { classPropertyName: "backgroundClass", publicName: "backgroundClass", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1868
|
+
<span
|
|
1869
|
+
class="ls-tooltip-trigger"
|
|
1870
|
+
[class.ls-tooltip-disabled]="disabled()"
|
|
1871
|
+
[attr.aria-describedby]="disabled() ? null : _tooltipId"
|
|
1872
|
+
(mouseenter)="show()"
|
|
1873
|
+
(mouseleave)="hide()"
|
|
1874
|
+
(focus)="show()"
|
|
1875
|
+
(blur)="hide()">
|
|
1876
|
+
<ng-content />
|
|
1877
|
+
@if (_isVisible() && !disabled()) {
|
|
1878
|
+
<span
|
|
1879
|
+
[id]="_tooltipId"
|
|
1880
|
+
role="tooltip"
|
|
1881
|
+
[attr.aria-hidden]="!_isVisible()"
|
|
1882
|
+
[class]="tooltipClasses">
|
|
1883
|
+
{{ content() }}
|
|
1884
|
+
<span class="tooltip-arrow"></span>
|
|
1885
|
+
</span>
|
|
1886
|
+
}
|
|
1887
|
+
</span>
|
|
1888
|
+
`, isInline: true, styles: [":host{display:contents}.ls-tooltip-trigger{position:relative;display:inline-flex}.ls-tooltip-disabled{pointer-events:none}.tooltip-box{position:absolute;z-index:10;padding:2px 8px;border-radius:6px;font-family:var(--ls-font-family);font-size:.8rem;font-weight:500;white-space:nowrap;box-shadow:0 2px 8px #00000026;pointer-events:none;animation:tooltip-fade-in var(--ls-transition-duration) ease forwards}@keyframes tooltip-fade-in{0%{opacity:0}to{opacity:1}}.tooltip-top{bottom:calc(100% + 8px);left:50%;transform:translate(-50%)}.tooltip-bottom{top:calc(100% + 8px);left:50%;transform:translate(-50%)}.tooltip-left{right:calc(100% + 8px);top:50%;transform:translateY(-50%)}.tooltip-right{left:calc(100% + 8px);top:50%;transform:translateY(-50%)}.tooltip-arrow{position:absolute;width:0;height:0;border:6px solid transparent}.tooltip-top .tooltip-arrow{bottom:-6px;left:50%;transform:translate(-50%);border-bottom:none;border-top-color:inherit}.tooltip-bottom .tooltip-arrow{top:-6px;left:50%;transform:translate(-50%);border-top:none;border-bottom-color:inherit}.tooltip-left .tooltip-arrow{right:-6px;top:50%;transform:translateY(-50%);border-right:none;border-left-color:inherit}.tooltip-right .tooltip-arrow{left:-6px;top:50%;transform:translateY(-50%);border-left:none;border-right-color:inherit}.tooltip-bg-primary{background-color:var(--ls-color-primary);color:#fff;border-color:var(--ls-color-primary)}.tooltip-bg-success{background-color:var(--ls-color-success);color:#fff;border-color:var(--ls-color-success)}.tooltip-bg-info{background-color:var(--ls-color-info);color:#fff;border-color:var(--ls-color-info)}.tooltip-bg-danger{background-color:var(--ls-color-danger);color:#fff;border-color:var(--ls-color-danger)}.tooltip-bg-warning{background-color:var(--ls-color-warning);color:#fff;border-color:var(--ls-color-warning)}.tooltip-bg-secondary{background-color:var(--ls-color-secondary);color:#fff;border-color:var(--ls-color-secondary)}.tooltip-bg-dark{background-color:var(--ls-color-dark);color:#fff;border-color:var(--ls-color-dark)}body.dark .tooltip-bg-dark{background-color:#e0e6ed;color:var(--ls-color-dark);border-color:#e0e6ed}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1889
|
+
}
|
|
1890
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
1891
|
+
type: Component,
|
|
1892
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ls-tooltip', standalone: true, template: `
|
|
1893
|
+
<span
|
|
1894
|
+
class="ls-tooltip-trigger"
|
|
1895
|
+
[class.ls-tooltip-disabled]="disabled()"
|
|
1896
|
+
[attr.aria-describedby]="disabled() ? null : _tooltipId"
|
|
1897
|
+
(mouseenter)="show()"
|
|
1898
|
+
(mouseleave)="hide()"
|
|
1899
|
+
(focus)="show()"
|
|
1900
|
+
(blur)="hide()">
|
|
1901
|
+
<ng-content />
|
|
1902
|
+
@if (_isVisible() && !disabled()) {
|
|
1903
|
+
<span
|
|
1904
|
+
[id]="_tooltipId"
|
|
1905
|
+
role="tooltip"
|
|
1906
|
+
[attr.aria-hidden]="!_isVisible()"
|
|
1907
|
+
[class]="tooltipClasses">
|
|
1908
|
+
{{ content() }}
|
|
1909
|
+
<span class="tooltip-arrow"></span>
|
|
1910
|
+
</span>
|
|
1911
|
+
}
|
|
1912
|
+
</span>
|
|
1913
|
+
`, styles: [":host{display:contents}.ls-tooltip-trigger{position:relative;display:inline-flex}.ls-tooltip-disabled{pointer-events:none}.tooltip-box{position:absolute;z-index:10;padding:2px 8px;border-radius:6px;font-family:var(--ls-font-family);font-size:.8rem;font-weight:500;white-space:nowrap;box-shadow:0 2px 8px #00000026;pointer-events:none;animation:tooltip-fade-in var(--ls-transition-duration) ease forwards}@keyframes tooltip-fade-in{0%{opacity:0}to{opacity:1}}.tooltip-top{bottom:calc(100% + 8px);left:50%;transform:translate(-50%)}.tooltip-bottom{top:calc(100% + 8px);left:50%;transform:translate(-50%)}.tooltip-left{right:calc(100% + 8px);top:50%;transform:translateY(-50%)}.tooltip-right{left:calc(100% + 8px);top:50%;transform:translateY(-50%)}.tooltip-arrow{position:absolute;width:0;height:0;border:6px solid transparent}.tooltip-top .tooltip-arrow{bottom:-6px;left:50%;transform:translate(-50%);border-bottom:none;border-top-color:inherit}.tooltip-bottom .tooltip-arrow{top:-6px;left:50%;transform:translate(-50%);border-top:none;border-bottom-color:inherit}.tooltip-left .tooltip-arrow{right:-6px;top:50%;transform:translateY(-50%);border-right:none;border-left-color:inherit}.tooltip-right .tooltip-arrow{left:-6px;top:50%;transform:translateY(-50%);border-left:none;border-right-color:inherit}.tooltip-bg-primary{background-color:var(--ls-color-primary);color:#fff;border-color:var(--ls-color-primary)}.tooltip-bg-success{background-color:var(--ls-color-success);color:#fff;border-color:var(--ls-color-success)}.tooltip-bg-info{background-color:var(--ls-color-info);color:#fff;border-color:var(--ls-color-info)}.tooltip-bg-danger{background-color:var(--ls-color-danger);color:#fff;border-color:var(--ls-color-danger)}.tooltip-bg-warning{background-color:var(--ls-color-warning);color:#fff;border-color:var(--ls-color-warning)}.tooltip-bg-secondary{background-color:var(--ls-color-secondary);color:#fff;border-color:var(--ls-color-secondary)}.tooltip-bg-dark{background-color:var(--ls-color-dark);color:#fff;border-color:var(--ls-color-dark)}body.dark .tooltip-bg-dark{background-color:#e0e6ed;color:var(--ls-color-dark);border-color:#e0e6ed}\n"] }]
|
|
1914
|
+
}], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], backgroundClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "backgroundClass", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
1915
|
+
|
|
1916
|
+
class AvatarComponent {
|
|
1917
|
+
constructor() {
|
|
1918
|
+
this.alt = input('', ...(ngDevMode ? [{ debugName: "alt" }] : []));
|
|
1919
|
+
this.color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
1920
|
+
this.size = input('medium', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1921
|
+
this.src = input('', ...(ngDevMode ? [{ debugName: "src" }] : []));
|
|
1922
|
+
this.text = input('', ...(ngDevMode ? [{ debugName: "text" }] : []));
|
|
1923
|
+
this.tooltip = input('', ...(ngDevMode ? [{ debugName: "tooltip" }] : []));
|
|
1924
|
+
this.variant = input('circular', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
1925
|
+
this.containerClasses = computed(() => `avatar avatar-${this.size()} avatar-${this.variant()}`, ...(ngDevMode ? [{ debugName: "containerClasses" }] : []));
|
|
1926
|
+
this.fallbackClasses = computed(() => `avatar avatar-${this.size()} avatar-${this.variant()} avatar-fallback`, ...(ngDevMode ? [{ debugName: "fallbackClasses" }] : []));
|
|
1927
|
+
this.hasTooltip = computed(() => !!this.tooltip(), ...(ngDevMode ? [{ debugName: "hasTooltip" }] : []));
|
|
1928
|
+
this.isImageMode = computed(() => !!this.src(), ...(ngDevMode ? [{ debugName: "isImageMode" }] : []));
|
|
1929
|
+
this.isTextMode = computed(() => !this.src() && !!this.text(), ...(ngDevMode ? [{ debugName: "isTextMode" }] : []));
|
|
1930
|
+
this.textClasses = computed(() => `avatar avatar-${this.size()} avatar-${this.variant()} avatar-color-${this.color()}`, ...(ngDevMode ? [{ debugName: "textClasses" }] : []));
|
|
1931
|
+
}
|
|
1932
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1933
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: AvatarComponent, isStandalone: true, selector: "ls-avatar", inputs: { alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1934
|
+
@if (hasTooltip()) {
|
|
1935
|
+
<ls-tooltip [content]="tooltip()">
|
|
1936
|
+
<ng-container *ngTemplateOutlet="avatarTpl" />
|
|
1937
|
+
</ls-tooltip>
|
|
1938
|
+
} @else {
|
|
1939
|
+
<ng-container *ngTemplateOutlet="avatarTpl" />
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
<ng-template #avatarTpl>
|
|
1943
|
+
@if (isImageMode()) {
|
|
1944
|
+
<img
|
|
1945
|
+
[src]="src()"
|
|
1946
|
+
[alt]="alt()"
|
|
1947
|
+
[class]="containerClasses()" />
|
|
1948
|
+
} @else if (isTextMode()) {
|
|
1949
|
+
<span
|
|
1950
|
+
role="img"
|
|
1951
|
+
[attr.aria-label]="text()"
|
|
1952
|
+
[class]="textClasses()">
|
|
1953
|
+
{{ text() }}
|
|
1954
|
+
</span>
|
|
1955
|
+
} @else {
|
|
1956
|
+
<span
|
|
1957
|
+
role="img"
|
|
1958
|
+
aria-label="avatar"
|
|
1959
|
+
[class]="fallbackClasses()">
|
|
1960
|
+
<svg
|
|
1961
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1962
|
+
viewBox="0 0 24 24"
|
|
1963
|
+
fill="currentColor"
|
|
1964
|
+
class="avatar-icon">
|
|
1965
|
+
<path
|
|
1966
|
+
d="M12 12c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5
|
|
1967
|
+
5 2.24 5 5 5zm0 2c-3.33 0-10 1.67-10
|
|
1968
|
+
5v2h20v-2c0-3.33-6.67-5-10-5z" />
|
|
1969
|
+
</svg>
|
|
1970
|
+
</span>
|
|
1971
|
+
}
|
|
1972
|
+
</ng-template>
|
|
1973
|
+
`, isInline: true, styles: [":host{display:contents}.avatar{display:inline-flex;align-items:center;justify-content:center;overflow:hidden;font-family:var(--ls-font-family);font-weight:600;color:#fff;-webkit-user-select:none;user-select:none;vertical-align:middle}img.avatar{object-fit:cover}.avatar-small{width:2.25rem;height:2.25rem;font-size:.75rem}.avatar-medium{width:2.75rem;height:2.75rem;font-size:.875rem}.avatar-large{width:3.5rem;height:3.5rem;font-size:1.125rem}.avatar-circular{border-radius:var(--ls-border-radius-full)}.avatar-rounded{border-radius:var(--ls-border-radius-md)}.avatar-square{border-radius:0}.avatar-color-primary{background-color:var(--ls-color-primary)}.avatar-color-secondary{background-color:var(--ls-color-secondary)}.avatar-color-error{background-color:var(--ls-color-error)}.avatar-color-info{background-color:var(--ls-color-info)}.avatar-color-success{background-color:var(--ls-color-success)}.avatar-color-warning{background-color:var(--ls-color-warning)}.avatar-fallback{background-color:var(--ls-color-dark)}.avatar-icon{width:60%;height:60%;fill:currentColor}body.dark .avatar-fallback{background-color:#3b3f5c;color:#e0e6ed}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TooltipComponent, selector: "ls-tooltip", inputs: ["content", "placement", "backgroundClass", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1974
|
+
}
|
|
1975
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: AvatarComponent, decorators: [{
|
|
1976
|
+
type: Component,
|
|
1977
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, TooltipComponent], selector: 'ls-avatar', standalone: true, template: `
|
|
1978
|
+
@if (hasTooltip()) {
|
|
1979
|
+
<ls-tooltip [content]="tooltip()">
|
|
1980
|
+
<ng-container *ngTemplateOutlet="avatarTpl" />
|
|
1981
|
+
</ls-tooltip>
|
|
1982
|
+
} @else {
|
|
1983
|
+
<ng-container *ngTemplateOutlet="avatarTpl" />
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1986
|
+
<ng-template #avatarTpl>
|
|
1987
|
+
@if (isImageMode()) {
|
|
1988
|
+
<img
|
|
1989
|
+
[src]="src()"
|
|
1990
|
+
[alt]="alt()"
|
|
1991
|
+
[class]="containerClasses()" />
|
|
1992
|
+
} @else if (isTextMode()) {
|
|
1993
|
+
<span
|
|
1994
|
+
role="img"
|
|
1995
|
+
[attr.aria-label]="text()"
|
|
1996
|
+
[class]="textClasses()">
|
|
1997
|
+
{{ text() }}
|
|
1998
|
+
</span>
|
|
1999
|
+
} @else {
|
|
2000
|
+
<span
|
|
2001
|
+
role="img"
|
|
2002
|
+
aria-label="avatar"
|
|
2003
|
+
[class]="fallbackClasses()">
|
|
2004
|
+
<svg
|
|
2005
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
2006
|
+
viewBox="0 0 24 24"
|
|
2007
|
+
fill="currentColor"
|
|
2008
|
+
class="avatar-icon">
|
|
2009
|
+
<path
|
|
2010
|
+
d="M12 12c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5
|
|
2011
|
+
5 2.24 5 5 5zm0 2c-3.33 0-10 1.67-10
|
|
2012
|
+
5v2h20v-2c0-3.33-6.67-5-10-5z" />
|
|
2013
|
+
</svg>
|
|
2014
|
+
</span>
|
|
2015
|
+
}
|
|
2016
|
+
</ng-template>
|
|
2017
|
+
`, styles: [":host{display:contents}.avatar{display:inline-flex;align-items:center;justify-content:center;overflow:hidden;font-family:var(--ls-font-family);font-weight:600;color:#fff;-webkit-user-select:none;user-select:none;vertical-align:middle}img.avatar{object-fit:cover}.avatar-small{width:2.25rem;height:2.25rem;font-size:.75rem}.avatar-medium{width:2.75rem;height:2.75rem;font-size:.875rem}.avatar-large{width:3.5rem;height:3.5rem;font-size:1.125rem}.avatar-circular{border-radius:var(--ls-border-radius-full)}.avatar-rounded{border-radius:var(--ls-border-radius-md)}.avatar-square{border-radius:0}.avatar-color-primary{background-color:var(--ls-color-primary)}.avatar-color-secondary{background-color:var(--ls-color-secondary)}.avatar-color-error{background-color:var(--ls-color-error)}.avatar-color-info{background-color:var(--ls-color-info)}.avatar-color-success{background-color:var(--ls-color-success)}.avatar-color-warning{background-color:var(--ls-color-warning)}.avatar-fallback{background-color:var(--ls-color-dark)}.avatar-icon{width:60%;height:60%;fill:currentColor}body.dark .avatar-fallback{background-color:#3b3f5c;color:#e0e6ed}\n"] }]
|
|
2018
|
+
}], propDecorators: { alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
|
|
2019
|
+
|
|
2020
|
+
class AvatarGroupComponent {
|
|
2021
|
+
constructor() {
|
|
2022
|
+
this.avatars = input([], ...(ngDevMode ? [{ debugName: "avatars" }] : []));
|
|
2023
|
+
this.maxAvatarGroup = input(0, ...(ngDevMode ? [{ debugName: "maxAvatarGroup" }] : []));
|
|
2024
|
+
this.groupSize = computed(() => this.avatars()[0]?.size ?? 'medium', ...(ngDevMode ? [{ debugName: "groupSize" }] : []));
|
|
2025
|
+
this.groupVariant = computed(() => this.avatars()[0]?.variant ?? 'circular', ...(ngDevMode ? [{ debugName: "groupVariant" }] : []));
|
|
2026
|
+
this.visibleAvatars = computed(() => {
|
|
2027
|
+
const max = this.maxAvatarGroup();
|
|
2028
|
+
const all = this.avatars();
|
|
2029
|
+
if (max > 0 && all.length > max) {
|
|
2030
|
+
return all.slice(0, max);
|
|
2031
|
+
}
|
|
2032
|
+
return all;
|
|
2033
|
+
}, ...(ngDevMode ? [{ debugName: "visibleAvatars" }] : []));
|
|
2034
|
+
this.overflowCount = computed(() => {
|
|
2035
|
+
const max = this.maxAvatarGroup();
|
|
2036
|
+
const all = this.avatars();
|
|
2037
|
+
if (max > 0 && all.length > max) {
|
|
2038
|
+
return all.length - max;
|
|
2039
|
+
}
|
|
2040
|
+
return 0;
|
|
2041
|
+
}, ...(ngDevMode ? [{ debugName: "overflowCount" }] : []));
|
|
2042
|
+
this.hasOverflow = computed(() => this.overflowCount() > 0, ...(ngDevMode ? [{ debugName: "hasOverflow" }] : []));
|
|
2043
|
+
this.overflowText = computed(() => '+' + this.overflowCount(), ...(ngDevMode ? [{ debugName: "overflowText" }] : []));
|
|
2044
|
+
}
|
|
2045
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: AvatarGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2046
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: AvatarGroupComponent, isStandalone: true, selector: "ls-avatar-group", inputs: { avatars: { classPropertyName: "avatars", publicName: "avatars", isSignal: true, isRequired: false, transformFunction: null }, maxAvatarGroup: { classPropertyName: "maxAvatarGroup", publicName: "maxAvatarGroup", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
2047
|
+
<div class="avatar-group" role="group" aria-label="Avatar group">
|
|
2048
|
+
@for (avatar of visibleAvatars(); track $index) {
|
|
2049
|
+
<div
|
|
2050
|
+
class="avatar-group-item"
|
|
2051
|
+
[style.z-index]="visibleAvatars().length - $index">
|
|
2052
|
+
<ls-avatar
|
|
2053
|
+
[src]="avatar.src ?? ''"
|
|
2054
|
+
[alt]="avatar.alt ?? ''"
|
|
2055
|
+
[variant]="avatar.variant ?? groupVariant()"
|
|
2056
|
+
[text]="avatar.text ?? ''"
|
|
2057
|
+
[color]="avatar.color ?? 'primary'"
|
|
2058
|
+
[tooltip]="avatar.tooltip ?? ''"
|
|
2059
|
+
[size]="avatar.size ?? groupSize()" />
|
|
2060
|
+
</div>
|
|
2061
|
+
}
|
|
2062
|
+
@if (hasOverflow()) {
|
|
2063
|
+
<div class="avatar-group-item" [style.z-index]="0">
|
|
2064
|
+
<ls-avatar
|
|
2065
|
+
[text]="overflowText()"
|
|
2066
|
+
[variant]="groupVariant()"
|
|
2067
|
+
[size]="groupSize()"
|
|
2068
|
+
color="secondary" />
|
|
2069
|
+
</div>
|
|
2070
|
+
}
|
|
2071
|
+
</div>
|
|
2072
|
+
`, isInline: true, styles: [":host{display:contents}.avatar-group{display:inline-flex;align-items:center}.avatar-group-item{position:relative;display:flex;align-items:center;margin-left:-.5rem}.avatar-group-item:first-child{margin-left:0}.avatar-group-item .avatar{border:2px solid #fff}body.dark .avatar-group-item .avatar{border-color:#1b2e4b}\n"], dependencies: [{ kind: "component", type: AvatarComponent, selector: "ls-avatar", inputs: ["alt", "color", "size", "src", "text", "tooltip", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2073
|
+
}
|
|
2074
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: AvatarGroupComponent, decorators: [{
|
|
2075
|
+
type: Component,
|
|
2076
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [AvatarComponent], selector: 'ls-avatar-group', standalone: true, template: `
|
|
2077
|
+
<div class="avatar-group" role="group" aria-label="Avatar group">
|
|
2078
|
+
@for (avatar of visibleAvatars(); track $index) {
|
|
2079
|
+
<div
|
|
2080
|
+
class="avatar-group-item"
|
|
2081
|
+
[style.z-index]="visibleAvatars().length - $index">
|
|
2082
|
+
<ls-avatar
|
|
2083
|
+
[src]="avatar.src ?? ''"
|
|
2084
|
+
[alt]="avatar.alt ?? ''"
|
|
2085
|
+
[variant]="avatar.variant ?? groupVariant()"
|
|
2086
|
+
[text]="avatar.text ?? ''"
|
|
2087
|
+
[color]="avatar.color ?? 'primary'"
|
|
2088
|
+
[tooltip]="avatar.tooltip ?? ''"
|
|
2089
|
+
[size]="avatar.size ?? groupSize()" />
|
|
2090
|
+
</div>
|
|
2091
|
+
}
|
|
2092
|
+
@if (hasOverflow()) {
|
|
2093
|
+
<div class="avatar-group-item" [style.z-index]="0">
|
|
2094
|
+
<ls-avatar
|
|
2095
|
+
[text]="overflowText()"
|
|
2096
|
+
[variant]="groupVariant()"
|
|
2097
|
+
[size]="groupSize()"
|
|
2098
|
+
color="secondary" />
|
|
2099
|
+
</div>
|
|
2100
|
+
}
|
|
2101
|
+
</div>
|
|
2102
|
+
`, styles: [":host{display:contents}.avatar-group{display:inline-flex;align-items:center}.avatar-group-item{position:relative;display:flex;align-items:center;margin-left:-.5rem}.avatar-group-item:first-child{margin-left:0}.avatar-group-item .avatar{border:2px solid #fff}body.dark .avatar-group-item .avatar{border-color:#1b2e4b}\n"] }]
|
|
2103
|
+
}], propDecorators: { avatars: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatars", required: false }] }], maxAvatarGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxAvatarGroup", required: false }] }] } });
|
|
2104
|
+
|
|
2105
|
+
class LogoComponent {
|
|
2106
|
+
constructor() {
|
|
2107
|
+
this.href = input('', ...(ngDevMode ? [{ debugName: "href" }] : []));
|
|
2108
|
+
this.size = input('medium', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
2109
|
+
this.src = input('', ...(ngDevMode ? [{ debugName: "src" }] : []));
|
|
2110
|
+
this.hasHref = computed(() => !!this.href(), ...(ngDevMode ? [{ debugName: "hasHref" }] : []));
|
|
2111
|
+
this.imgClasses = computed(() => `logo logo-${this.size()}`, ...(ngDevMode ? [{ debugName: "imgClasses" }] : []));
|
|
2112
|
+
}
|
|
2113
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: LogoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2114
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: LogoComponent, isStandalone: true, selector: "ls-logo", inputs: { href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
2115
|
+
@if (hasHref()) {
|
|
2116
|
+
<a [attr.href]="href()" class="logo-link">
|
|
2117
|
+
<img [src]="src()" [class]="imgClasses()" alt="Logo" />
|
|
2118
|
+
</a>
|
|
2119
|
+
} @else {
|
|
2120
|
+
<img [src]="src()" [class]="imgClasses()" alt="Logo" />
|
|
2121
|
+
}
|
|
2122
|
+
`, isInline: true, styles: [":host{display:contents}.logo{display:block;height:auto;max-width:100%;object-fit:contain}.logo-small{height:1.5rem}.logo-medium{height:2rem}.logo-large{height:2.5rem}.logo-link{display:inline-flex;line-height:0;text-decoration:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2123
|
+
}
|
|
2124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: LogoComponent, decorators: [{
|
|
2125
|
+
type: Component,
|
|
2126
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, imports: [], selector: 'ls-logo', standalone: true, template: `
|
|
2127
|
+
@if (hasHref()) {
|
|
2128
|
+
<a [attr.href]="href()" class="logo-link">
|
|
2129
|
+
<img [src]="src()" [class]="imgClasses()" alt="Logo" />
|
|
2130
|
+
</a>
|
|
2131
|
+
} @else {
|
|
2132
|
+
<img [src]="src()" [class]="imgClasses()" alt="Logo" />
|
|
2133
|
+
}
|
|
2134
|
+
`, styles: [":host{display:contents}.logo{display:block;height:auto;max-width:100%;object-fit:contain}.logo-small{height:1.5rem}.logo-medium{height:2rem}.logo-large{height:2.5rem}.logo-link{display:inline-flex;line-height:0;text-decoration:none}\n"] }]
|
|
2135
|
+
}], propDecorators: { href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }] } });
|
|
2136
|
+
|
|
2137
|
+
class ProgressBarComponent {
|
|
2138
|
+
constructor() {
|
|
2139
|
+
this.variant = input('indeterminate', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
2140
|
+
this.color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
2141
|
+
this.value = input(0, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
2142
|
+
this.showLabel = input(false, ...(ngDevMode ? [{ debugName: "showLabel" }] : []));
|
|
2143
|
+
this.labelPosition = input('inside', ...(ngDevMode ? [{ debugName: "labelPosition" }] : []));
|
|
2144
|
+
this.size = input('medium', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
2145
|
+
this.onFinished = output();
|
|
2146
|
+
this._sizeClassMap = {
|
|
2147
|
+
small: 'progress-bar-sm',
|
|
2148
|
+
medium: 'progress-bar-md',
|
|
2149
|
+
large: 'progress-bar-lg',
|
|
2150
|
+
'extra-large': 'progress-bar-xl',
|
|
2151
|
+
};
|
|
2152
|
+
this.clampedValue = computed(() => Math.min(100, Math.max(0, this.value())), ...(ngDevMode ? [{ debugName: "clampedValue" }] : []));
|
|
2153
|
+
this.trackClasses = computed(() => {
|
|
2154
|
+
const classes = ['progress-bar-track'];
|
|
2155
|
+
classes.push(this._sizeClassMap[this.size()]);
|
|
2156
|
+
return classes.join(' ');
|
|
2157
|
+
}, ...(ngDevMode ? [{ debugName: "trackClasses" }] : []));
|
|
2158
|
+
this.indicatorClasses = computed(() => {
|
|
2159
|
+
const classes = ['progress-bar-indicator'];
|
|
2160
|
+
classes.push(`progress-bar-${this.color()}`);
|
|
2161
|
+
const v = this.variant();
|
|
2162
|
+
if (v === 'stripe') {
|
|
2163
|
+
classes.push('progress-bar-stripe');
|
|
2164
|
+
}
|
|
2165
|
+
else if (v === 'animated') {
|
|
2166
|
+
classes.push('progress-bar-animated');
|
|
2167
|
+
}
|
|
2168
|
+
else if (v === 'indeterminate') {
|
|
2169
|
+
classes.push('progress-bar-indeterminate');
|
|
2170
|
+
}
|
|
2171
|
+
return classes.join(' ');
|
|
2172
|
+
}, ...(ngDevMode ? [{ debugName: "indicatorClasses" }] : []));
|
|
2173
|
+
this.indicatorWidth = computed(() => {
|
|
2174
|
+
if (this.variant() === 'indeterminate') {
|
|
2175
|
+
return '100%';
|
|
2176
|
+
}
|
|
2177
|
+
return `${this.clampedValue()}%`;
|
|
2178
|
+
}, ...(ngDevMode ? [{ debugName: "indicatorWidth" }] : []));
|
|
2179
|
+
this.labelText = computed(() => `${this.clampedValue()}%`, ...(ngDevMode ? [{ debugName: "labelText" }] : []));
|
|
2180
|
+
this.labelClasses = computed(() => {
|
|
2181
|
+
const classes = ['progress-bar-label'];
|
|
2182
|
+
if (this.labelPosition() === 'inside') {
|
|
2183
|
+
classes.push('progress-bar-label-inside');
|
|
2184
|
+
if (this.clampedValue() < 15) {
|
|
2185
|
+
classes.push('progress-bar-label-dark');
|
|
2186
|
+
}
|
|
2187
|
+
else {
|
|
2188
|
+
classes.push('progress-bar-label-light');
|
|
2189
|
+
}
|
|
2190
|
+
}
|
|
2191
|
+
else {
|
|
2192
|
+
classes.push('progress-bar-label-right');
|
|
2193
|
+
}
|
|
2194
|
+
return classes.join(' ');
|
|
2195
|
+
}, ...(ngDevMode ? [{ debugName: "labelClasses" }] : []));
|
|
2196
|
+
effect(() => {
|
|
2197
|
+
if (this.variant() !== 'indeterminate' &&
|
|
2198
|
+
this.value() >= 100) {
|
|
2199
|
+
this.onFinished.emit();
|
|
2200
|
+
}
|
|
2201
|
+
});
|
|
2202
|
+
}
|
|
2203
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2204
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: ProgressBarComponent, isStandalone: true, selector: "ls-progress-bar", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onFinished: "onFinished" }, ngImport: i0, template: `
|
|
2205
|
+
<div class="progress-bar-wrapper">
|
|
2206
|
+
<div
|
|
2207
|
+
[class]="trackClasses()"
|
|
2208
|
+
role="progressbar"
|
|
2209
|
+
[attr.aria-valuenow]="variant() === 'indeterminate' ? null : clampedValue()"
|
|
2210
|
+
aria-valuemin="0"
|
|
2211
|
+
aria-valuemax="100"
|
|
2212
|
+
[attr.aria-label]="labelText()">
|
|
2213
|
+
|
|
2214
|
+
<div
|
|
2215
|
+
[class]="indicatorClasses()"
|
|
2216
|
+
[style.width]="indicatorWidth()">
|
|
2217
|
+
</div>
|
|
2218
|
+
|
|
2219
|
+
@if (showLabel() && labelPosition() === 'inside' && variant() !== 'indeterminate') {
|
|
2220
|
+
<span
|
|
2221
|
+
[class]="labelClasses()"
|
|
2222
|
+
[style.left.%]="clampedValue()">
|
|
2223
|
+
{{ labelText() }}
|
|
2224
|
+
</span>
|
|
2225
|
+
}
|
|
2226
|
+
</div>
|
|
2227
|
+
|
|
2228
|
+
@if (showLabel() && labelPosition() === 'right' && variant() !== 'indeterminate') {
|
|
2229
|
+
<span [class]="labelClasses()">
|
|
2230
|
+
{{ labelText() }}
|
|
2231
|
+
</span>
|
|
2232
|
+
}
|
|
2233
|
+
</div>
|
|
2234
|
+
`, isInline: true, styles: [":host{display:contents}.progress-bar-wrapper{display:flex;align-items:center;width:100%;gap:8px}.progress-bar-track{position:relative;width:100%;background-color:#e5e7eb;border-radius:var(--ls-border-radius-full);overflow:hidden}.progress-bar-sm{height:4px}.progress-bar-md{height:8px}.progress-bar-lg{height:16px}.progress-bar-xl{height:24px}.progress-bar-indicator{height:100%;border-radius:var(--ls-border-radius-full);transition:width var(--ls-transition-duration) ease;position:relative}.progress-bar-stripe{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}.progress-bar-animated{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem;animation:ls-progress-bar-stripes 1s linear infinite}.progress-bar-indeterminate{animation:ls-progress-bar-indeterminate 1.5s cubic-bezier(.65,.815,.735,.395) infinite;width:35%!important;position:absolute}@keyframes ls-progress-bar-stripes{0%{background-position:1rem 0}to{background-position:0 0}}@keyframes ls-progress-bar-indeterminate{0%{transform:translate(-100%)}to{transform:translate(300%)}}.progress-bar-label{font-size:.625rem;font-weight:600;white-space:nowrap;line-height:1}.progress-bar-label-inside{position:absolute;top:50%;transform:translate(-100%,-50%);margin-left:-4px;z-index:2;transition:left var(--ls-transition-duration) ease;pointer-events:none}.progress-bar-label-dark.progress-bar-label-inside{transform:translate(4px,-50%)}.progress-bar-label-right{flex-shrink:0;font-size:.75rem;color:#1f2937}.progress-bar-label-dark{color:#1f2937}.progress-bar-label-light{color:#fff}.progress-bar-primary{background-color:var(--ls-color-primary)}.progress-bar-secondary{background-color:var(--ls-color-secondary)}.progress-bar-error{background-color:var(--ls-color-danger)}.progress-bar-info{background-color:var(--ls-color-info)}.progress-bar-success{background-color:var(--ls-color-success)}.progress-bar-warning{background-color:var(--ls-color-warning)}.progress-bar-inherit{background-color:currentColor}body.dark .progress-bar-track{background-color:#374151}body.dark .progress-bar-label-right{color:#e5e7eb}body.dark .progress-bar-label-dark{color:#f3f4f6}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2235
|
+
}
|
|
2236
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ProgressBarComponent, decorators: [{
|
|
2237
|
+
type: Component,
|
|
2238
|
+
args: [{ selector: 'ls-progress-bar', standalone: true, template: `
|
|
2239
|
+
<div class="progress-bar-wrapper">
|
|
2240
|
+
<div
|
|
2241
|
+
[class]="trackClasses()"
|
|
2242
|
+
role="progressbar"
|
|
2243
|
+
[attr.aria-valuenow]="variant() === 'indeterminate' ? null : clampedValue()"
|
|
2244
|
+
aria-valuemin="0"
|
|
2245
|
+
aria-valuemax="100"
|
|
2246
|
+
[attr.aria-label]="labelText()">
|
|
2247
|
+
|
|
2248
|
+
<div
|
|
2249
|
+
[class]="indicatorClasses()"
|
|
2250
|
+
[style.width]="indicatorWidth()">
|
|
2251
|
+
</div>
|
|
2252
|
+
|
|
2253
|
+
@if (showLabel() && labelPosition() === 'inside' && variant() !== 'indeterminate') {
|
|
2254
|
+
<span
|
|
2255
|
+
[class]="labelClasses()"
|
|
2256
|
+
[style.left.%]="clampedValue()">
|
|
2257
|
+
{{ labelText() }}
|
|
2258
|
+
</span>
|
|
2259
|
+
}
|
|
2260
|
+
</div>
|
|
2261
|
+
|
|
2262
|
+
@if (showLabel() && labelPosition() === 'right' && variant() !== 'indeterminate') {
|
|
2263
|
+
<span [class]="labelClasses()">
|
|
2264
|
+
{{ labelText() }}
|
|
2265
|
+
</span>
|
|
2266
|
+
}
|
|
2267
|
+
</div>
|
|
2268
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:contents}.progress-bar-wrapper{display:flex;align-items:center;width:100%;gap:8px}.progress-bar-track{position:relative;width:100%;background-color:#e5e7eb;border-radius:var(--ls-border-radius-full);overflow:hidden}.progress-bar-sm{height:4px}.progress-bar-md{height:8px}.progress-bar-lg{height:16px}.progress-bar-xl{height:24px}.progress-bar-indicator{height:100%;border-radius:var(--ls-border-radius-full);transition:width var(--ls-transition-duration) ease;position:relative}.progress-bar-stripe{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}.progress-bar-animated{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem;animation:ls-progress-bar-stripes 1s linear infinite}.progress-bar-indeterminate{animation:ls-progress-bar-indeterminate 1.5s cubic-bezier(.65,.815,.735,.395) infinite;width:35%!important;position:absolute}@keyframes ls-progress-bar-stripes{0%{background-position:1rem 0}to{background-position:0 0}}@keyframes ls-progress-bar-indeterminate{0%{transform:translate(-100%)}to{transform:translate(300%)}}.progress-bar-label{font-size:.625rem;font-weight:600;white-space:nowrap;line-height:1}.progress-bar-label-inside{position:absolute;top:50%;transform:translate(-100%,-50%);margin-left:-4px;z-index:2;transition:left var(--ls-transition-duration) ease;pointer-events:none}.progress-bar-label-dark.progress-bar-label-inside{transform:translate(4px,-50%)}.progress-bar-label-right{flex-shrink:0;font-size:.75rem;color:#1f2937}.progress-bar-label-dark{color:#1f2937}.progress-bar-label-light{color:#fff}.progress-bar-primary{background-color:var(--ls-color-primary)}.progress-bar-secondary{background-color:var(--ls-color-secondary)}.progress-bar-error{background-color:var(--ls-color-danger)}.progress-bar-info{background-color:var(--ls-color-info)}.progress-bar-success{background-color:var(--ls-color-success)}.progress-bar-warning{background-color:var(--ls-color-warning)}.progress-bar-inherit{background-color:currentColor}body.dark .progress-bar-track{background-color:#374151}body.dark .progress-bar-label-right{color:#e5e7eb}body.dark .progress-bar-label-dark{color:#f3f4f6}\n"] }]
|
|
2269
|
+
}], ctorParameters: () => [], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], onFinished: [{ type: i0.Output, args: ["onFinished"] }] } });
|
|
2270
|
+
|
|
2271
|
+
const RADIUS = 20;
|
|
2272
|
+
const CIRCUMFERENCE = 2 * Math.PI * RADIUS;
|
|
2273
|
+
class LoaderComponent {
|
|
2274
|
+
constructor() {
|
|
2275
|
+
this.variant = input('indeterminate', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
2276
|
+
this.color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
2277
|
+
this.value = input(0, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
2278
|
+
this.size = input('medium', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
2279
|
+
this.onFinished = output();
|
|
2280
|
+
this.circumference = CIRCUMFERENCE;
|
|
2281
|
+
this._diameterMap = {
|
|
2282
|
+
small: 16,
|
|
2283
|
+
medium: 32,
|
|
2284
|
+
large: 48,
|
|
2285
|
+
};
|
|
2286
|
+
this._sizeClassMap = {
|
|
2287
|
+
small: 'loader-sm',
|
|
2288
|
+
medium: 'loader-md',
|
|
2289
|
+
large: 'loader-lg',
|
|
2290
|
+
};
|
|
2291
|
+
this.svgDiameter = computed(() => this._diameterMap[this.size()], ...(ngDevMode ? [{ debugName: "svgDiameter" }] : []));
|
|
2292
|
+
this.svgClasses = computed(() => {
|
|
2293
|
+
const classes = ['loader-svg'];
|
|
2294
|
+
classes.push(this._sizeClassMap[this.size()]);
|
|
2295
|
+
if (this.variant() === 'indeterminate') {
|
|
2296
|
+
classes.push('loader-indeterminate');
|
|
2297
|
+
}
|
|
2298
|
+
return classes.join(' ');
|
|
2299
|
+
}, ...(ngDevMode ? [{ debugName: "svgClasses" }] : []));
|
|
2300
|
+
this.indicatorClasses = computed(() => {
|
|
2301
|
+
const classes = ['loader-indicator'];
|
|
2302
|
+
classes.push(`loader-${this.variant()}`);
|
|
2303
|
+
classes.push(`loader-${this.color()}`);
|
|
2304
|
+
return classes.join(' ');
|
|
2305
|
+
}, ...(ngDevMode ? [{ debugName: "indicatorClasses" }] : []));
|
|
2306
|
+
this.bufferClasses = computed(() => `loader-buffer loader-${this.color()}`, ...(ngDevMode ? [{ debugName: "bufferClasses" }] : []));
|
|
2307
|
+
this.indicatorDashOffset = computed(() => {
|
|
2308
|
+
const v = this.variant();
|
|
2309
|
+
if (v === 'determinate' || v === 'buffer') {
|
|
2310
|
+
const clamped = Math.min(100, Math.max(0, this.value()));
|
|
2311
|
+
return CIRCUMFERENCE - (CIRCUMFERENCE * clamped) / 100;
|
|
2312
|
+
}
|
|
2313
|
+
return 0;
|
|
2314
|
+
}, ...(ngDevMode ? [{ debugName: "indicatorDashOffset" }] : []));
|
|
2315
|
+
this.bufferDashOffset = computed(() => {
|
|
2316
|
+
if (this.variant() === 'buffer') {
|
|
2317
|
+
const clamped = Math.min(100, Math.max(0, this.value()) + 20);
|
|
2318
|
+
return CIRCUMFERENCE - (CIRCUMFERENCE * clamped) / 100;
|
|
2319
|
+
}
|
|
2320
|
+
return CIRCUMFERENCE;
|
|
2321
|
+
}, ...(ngDevMode ? [{ debugName: "bufferDashOffset" }] : []));
|
|
2322
|
+
effect(() => {
|
|
2323
|
+
if (this.variant() === 'determinate' &&
|
|
2324
|
+
this.value() >= 100) {
|
|
2325
|
+
this.onFinished.emit();
|
|
2326
|
+
}
|
|
2327
|
+
});
|
|
2328
|
+
}
|
|
2329
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2330
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: LoaderComponent, isStandalone: true, selector: "ls-loader", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onFinished: "onFinished" }, ngImport: i0, template: `
|
|
2331
|
+
<svg
|
|
2332
|
+
[class]="svgClasses()"
|
|
2333
|
+
[attr.width]="svgDiameter()"
|
|
2334
|
+
[attr.height]="svgDiameter()"
|
|
2335
|
+
viewBox="0 0 50 50"
|
|
2336
|
+
role="progressbar"
|
|
2337
|
+
[attr.aria-valuenow]="
|
|
2338
|
+
variant() === 'determinate' ? value() : null
|
|
2339
|
+
"
|
|
2340
|
+
[attr.aria-valuemin]="
|
|
2341
|
+
variant() === 'determinate' ? 0 : null
|
|
2342
|
+
"
|
|
2343
|
+
[attr.aria-valuemax]="
|
|
2344
|
+
variant() === 'determinate' ? 100 : null
|
|
2345
|
+
">
|
|
2346
|
+
<circle
|
|
2347
|
+
class="loader-track"
|
|
2348
|
+
cx="25"
|
|
2349
|
+
cy="25"
|
|
2350
|
+
r="20"
|
|
2351
|
+
fill="none"
|
|
2352
|
+
stroke-width="5" />
|
|
2353
|
+
@if (variant() === 'buffer') {
|
|
2354
|
+
<circle
|
|
2355
|
+
[class]="bufferClasses()"
|
|
2356
|
+
cx="25"
|
|
2357
|
+
cy="25"
|
|
2358
|
+
r="20"
|
|
2359
|
+
fill="none"
|
|
2360
|
+
stroke-width="5"
|
|
2361
|
+
[attr.stroke-dasharray]="circumference"
|
|
2362
|
+
[attr.stroke-dashoffset]="bufferDashOffset()" />
|
|
2363
|
+
}
|
|
2364
|
+
<circle
|
|
2365
|
+
[class]="indicatorClasses()"
|
|
2366
|
+
cx="25"
|
|
2367
|
+
cy="25"
|
|
2368
|
+
r="20"
|
|
2369
|
+
fill="none"
|
|
2370
|
+
stroke-width="5"
|
|
2371
|
+
[attr.stroke-dasharray]="circumference"
|
|
2372
|
+
[attr.stroke-dashoffset]="indicatorDashOffset()" />
|
|
2373
|
+
</svg>
|
|
2374
|
+
`, isInline: true, styles: [":host{display:contents}.loader-svg{display:inline-block;vertical-align:middle;transform-origin:center}.loader-sm{width:16px;height:16px}.loader-md{width:32px;height:32px}.loader-lg{width:48px;height:48px}.loader-track{stroke:#e0e0e0}.loader-indicator{stroke-linecap:round;transform-origin:center;transform:rotate(-90deg);transition:stroke-dashoffset var(--ls-transition-duration) ease}.loader-determinate{transition:stroke-dashoffset var(--ls-transition-duration) ease}.loader-svg.loader-indeterminate{animation:ls-loader-rotate 1.4s linear infinite}.loader-indicator.loader-indeterminate{animation:ls-loader-dash 1.4s ease-in-out infinite;stroke-linecap:round}.loader-buffer{stroke-linecap:round;transform-origin:center;transform:rotate(-90deg);opacity:.3;transition:stroke-dashoffset var(--ls-transition-duration) ease}@keyframes ls-loader-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes ls-loader-dash{0%{stroke-dasharray:1,125.66;stroke-dashoffset:0}50%{stroke-dasharray:89,125.66;stroke-dashoffset:-35}to{stroke-dasharray:89,125.66;stroke-dashoffset:-124}}.loader-primary{stroke:var(--ls-color-primary)}.loader-secondary{stroke:var(--ls-color-secondary)}.loader-error{stroke:var(--ls-color-danger)}.loader-info{stroke:var(--ls-color-info)}.loader-success{stroke:var(--ls-color-success)}.loader-warning{stroke:var(--ls-color-warning)}.loader-inherit{stroke:currentColor}body.dark .loader-track{stroke:#374151}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2375
|
+
}
|
|
2376
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: LoaderComponent, decorators: [{
|
|
2377
|
+
type: Component,
|
|
2378
|
+
args: [{ selector: 'ls-loader', standalone: true, template: `
|
|
2379
|
+
<svg
|
|
2380
|
+
[class]="svgClasses()"
|
|
2381
|
+
[attr.width]="svgDiameter()"
|
|
2382
|
+
[attr.height]="svgDiameter()"
|
|
2383
|
+
viewBox="0 0 50 50"
|
|
2384
|
+
role="progressbar"
|
|
2385
|
+
[attr.aria-valuenow]="
|
|
2386
|
+
variant() === 'determinate' ? value() : null
|
|
2387
|
+
"
|
|
2388
|
+
[attr.aria-valuemin]="
|
|
2389
|
+
variant() === 'determinate' ? 0 : null
|
|
2390
|
+
"
|
|
2391
|
+
[attr.aria-valuemax]="
|
|
2392
|
+
variant() === 'determinate' ? 100 : null
|
|
2393
|
+
">
|
|
2394
|
+
<circle
|
|
2395
|
+
class="loader-track"
|
|
2396
|
+
cx="25"
|
|
2397
|
+
cy="25"
|
|
2398
|
+
r="20"
|
|
2399
|
+
fill="none"
|
|
2400
|
+
stroke-width="5" />
|
|
2401
|
+
@if (variant() === 'buffer') {
|
|
2402
|
+
<circle
|
|
2403
|
+
[class]="bufferClasses()"
|
|
2404
|
+
cx="25"
|
|
2405
|
+
cy="25"
|
|
2406
|
+
r="20"
|
|
2407
|
+
fill="none"
|
|
2408
|
+
stroke-width="5"
|
|
2409
|
+
[attr.stroke-dasharray]="circumference"
|
|
2410
|
+
[attr.stroke-dashoffset]="bufferDashOffset()" />
|
|
2411
|
+
}
|
|
2412
|
+
<circle
|
|
2413
|
+
[class]="indicatorClasses()"
|
|
2414
|
+
cx="25"
|
|
2415
|
+
cy="25"
|
|
2416
|
+
r="20"
|
|
2417
|
+
fill="none"
|
|
2418
|
+
stroke-width="5"
|
|
2419
|
+
[attr.stroke-dasharray]="circumference"
|
|
2420
|
+
[attr.stroke-dashoffset]="indicatorDashOffset()" />
|
|
2421
|
+
</svg>
|
|
2422
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:contents}.loader-svg{display:inline-block;vertical-align:middle;transform-origin:center}.loader-sm{width:16px;height:16px}.loader-md{width:32px;height:32px}.loader-lg{width:48px;height:48px}.loader-track{stroke:#e0e0e0}.loader-indicator{stroke-linecap:round;transform-origin:center;transform:rotate(-90deg);transition:stroke-dashoffset var(--ls-transition-duration) ease}.loader-determinate{transition:stroke-dashoffset var(--ls-transition-duration) ease}.loader-svg.loader-indeterminate{animation:ls-loader-rotate 1.4s linear infinite}.loader-indicator.loader-indeterminate{animation:ls-loader-dash 1.4s ease-in-out infinite;stroke-linecap:round}.loader-buffer{stroke-linecap:round;transform-origin:center;transform:rotate(-90deg);opacity:.3;transition:stroke-dashoffset var(--ls-transition-duration) ease}@keyframes ls-loader-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes ls-loader-dash{0%{stroke-dasharray:1,125.66;stroke-dashoffset:0}50%{stroke-dasharray:89,125.66;stroke-dashoffset:-35}to{stroke-dasharray:89,125.66;stroke-dashoffset:-124}}.loader-primary{stroke:var(--ls-color-primary)}.loader-secondary{stroke:var(--ls-color-secondary)}.loader-error{stroke:var(--ls-color-danger)}.loader-info{stroke:var(--ls-color-info)}.loader-success{stroke:var(--ls-color-success)}.loader-warning{stroke:var(--ls-color-warning)}.loader-inherit{stroke:currentColor}body.dark .loader-track{stroke:#374151}\n"] }]
|
|
2423
|
+
}], ctorParameters: () => [], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], onFinished: [{ type: i0.Output, args: ["onFinished"] }] } });
|
|
2424
|
+
|
|
2425
|
+
const SEVERITY_ICON_MAP = {
|
|
2426
|
+
success: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>`,
|
|
2427
|
+
error: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>`,
|
|
2428
|
+
warning: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>`,
|
|
2429
|
+
info: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>`,
|
|
2430
|
+
primary: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>`,
|
|
2431
|
+
secondary: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>`,
|
|
2432
|
+
};
|
|
2433
|
+
const CLOSE_ICON = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="18" height="18"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>`;
|
|
2434
|
+
class AlertComponent {
|
|
2435
|
+
constructor() {
|
|
2436
|
+
this._sanitizer = inject(DomSanitizer);
|
|
2437
|
+
this.severity = input('info', ...(ngDevMode ? [{ debugName: "severity" }] : []));
|
|
2438
|
+
this.variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
2439
|
+
this.closable = input(false, ...(ngDevMode ? [{ debugName: "closable" }] : []));
|
|
2440
|
+
this.icon = input(true, ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
2441
|
+
this.iconMapping = input(...(ngDevMode ? [undefined, { debugName: "iconMapping" }] : []));
|
|
2442
|
+
this.color = input(...(ngDevMode ? [undefined, { debugName: "color" }] : []));
|
|
2443
|
+
this.alertTitle = input(...(ngDevMode ? [undefined, { debugName: "alertTitle" }] : []));
|
|
2444
|
+
this.message = input(...(ngDevMode ? [undefined, { debugName: "message" }] : []));
|
|
2445
|
+
this.onClose = output();
|
|
2446
|
+
this.alertClasses = computed(() => {
|
|
2447
|
+
const classes = ['alert', `alert-${this.variant()}-${this.severity()}`];
|
|
2448
|
+
if (this.closable()) {
|
|
2449
|
+
classes.push('alert-closable');
|
|
2450
|
+
}
|
|
2451
|
+
return classes.join(' ');
|
|
2452
|
+
}, ...(ngDevMode ? [{ debugName: "alertClasses" }] : []));
|
|
2453
|
+
this.ariaLive = computed(() => {
|
|
2454
|
+
const s = this.severity();
|
|
2455
|
+
return s === 'error' || s === 'warning' ? 'assertive' : 'polite';
|
|
2456
|
+
}, ...(ngDevMode ? [{ debugName: "ariaLive" }] : []));
|
|
2457
|
+
this.sanitizedIcon = computed(() => {
|
|
2458
|
+
const svg = this.iconMapping() || SEVERITY_ICON_MAP[this.severity()];
|
|
2459
|
+
return this._sanitizer.bypassSecurityTrustHtml(svg);
|
|
2460
|
+
}, ...(ngDevMode ? [{ debugName: "sanitizedIcon" }] : []));
|
|
2461
|
+
this.sanitizedCloseIcon = this._sanitizer.bypassSecurityTrustHtml(CLOSE_ICON);
|
|
2462
|
+
this.colorStyle = computed(() => {
|
|
2463
|
+
const c = this.color();
|
|
2464
|
+
if (!c)
|
|
2465
|
+
return '';
|
|
2466
|
+
return `--alert-custom-color: ${c};`;
|
|
2467
|
+
}, ...(ngDevMode ? [{ debugName: "colorStyle" }] : []));
|
|
2468
|
+
}
|
|
2469
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2470
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: AlertComponent, isStandalone: true, selector: "ls-alert", inputs: { severity: { classPropertyName: "severity", publicName: "severity", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconMapping: { classPropertyName: "iconMapping", publicName: "iconMapping", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, alertTitle: { classPropertyName: "alertTitle", publicName: "alertTitle", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onClose: "onClose" }, ngImport: i0, template: `
|
|
2471
|
+
<div
|
|
2472
|
+
[class]="alertClasses()"
|
|
2473
|
+
[style]="colorStyle()"
|
|
2474
|
+
role="alert"
|
|
2475
|
+
[attr.aria-live]="ariaLive()">
|
|
2476
|
+
@if (icon()) {
|
|
2477
|
+
<span class="alert-icon" [innerHTML]="sanitizedIcon()"></span>
|
|
2478
|
+
}
|
|
2479
|
+
<div class="alert-content">
|
|
2480
|
+
@if (alertTitle()) {
|
|
2481
|
+
<div class="alert-title">{{ alertTitle() }}</div>
|
|
2482
|
+
}
|
|
2483
|
+
@if (message()) {
|
|
2484
|
+
<div class="alert-message">{{ message() }}</div>
|
|
2485
|
+
}
|
|
2486
|
+
</div>
|
|
2487
|
+
@if (closable()) {
|
|
2488
|
+
<button
|
|
2489
|
+
class="alert-close"
|
|
2490
|
+
(click)="onClose.emit()"
|
|
2491
|
+
[innerHTML]="sanitizedCloseIcon"
|
|
2492
|
+
aria-label="Close"></button>
|
|
2493
|
+
}
|
|
2494
|
+
</div>
|
|
2495
|
+
`, isInline: true, styles: [":host{display:contents}.alert{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-radius:var(--ls-border-radius-md, 6px);font-family:var(--ls-font-family, \"Nunito\", sans-serif);font-size:14px;line-height:1.5;position:relative;width:100%;box-sizing:border-box}.alert-icon{flex-shrink:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center}.alert-icon svg{width:100%;height:100%}.alert-content{flex:1;min-width:0}.alert-title{font-weight:600;margin-bottom:4px}.alert-message{padding-top:2px;font-weight:400}.alert-close{flex-shrink:0;background:none;border:none;cursor:pointer;padding:4px;border-radius:4px;color:inherit;opacity:.7;transition:opacity var(--ls-transition-duration, .3s);display:flex;align-items:center;justify-content:center}.alert-close:hover{opacity:1}.alert-default-success{background-color:var(--ls-color-success-light);border-left:4px solid var(--ls-color-success);color:var(--ls-color-success)}.alert-default-error{background-color:var(--ls-color-danger-light);border-left:4px solid var(--ls-color-danger);color:var(--ls-color-danger)}.alert-default-warning{background-color:var(--ls-color-warning-light);border-left:4px solid var(--ls-color-warning);color:var(--ls-color-warning)}.alert-default-info{background-color:var(--ls-color-info-light);border-left:4px solid var(--ls-color-info);color:var(--ls-color-info)}.alert-default-primary{background-color:var(--ls-color-primary-light);border-left:4px solid var(--ls-color-primary);color:var(--ls-color-primary)}.alert-default-secondary{background-color:var(--ls-color-secondary-light);border-left:4px solid var(--ls-color-secondary);color:var(--ls-color-secondary)}.alert-filled-success{background-color:var(--ls-color-success);color:#fff}.alert-filled-error{background-color:var(--ls-color-danger);color:#fff}.alert-filled-warning{background-color:var(--ls-color-warning);color:#fff}.alert-filled-info{background-color:var(--ls-color-info);color:#fff}.alert-filled-primary{background-color:var(--ls-color-primary);color:#fff}.alert-filled-secondary{background-color:var(--ls-color-secondary);color:#fff}.alert-outlined-success{background-color:transparent;border:1px solid var(--ls-color-success);color:var(--ls-color-success)}.alert-outlined-error{background-color:transparent;border:1px solid var(--ls-color-danger);color:var(--ls-color-danger)}.alert-outlined-warning{background-color:transparent;border:1px solid var(--ls-color-warning);color:var(--ls-color-warning)}.alert-outlined-info{background-color:transparent;border:1px solid var(--ls-color-info);color:var(--ls-color-info)}.alert-outlined-primary{background-color:transparent;border:1px solid var(--ls-color-primary);color:var(--ls-color-primary)}.alert-outlined-secondary{background-color:transparent;border:1px solid var(--ls-color-secondary);color:var(--ls-color-secondary)}.alert[style*=--alert-custom-color]{border-color:var(--alert-custom-color)}.alert-default-success[style*=--alert-custom-color],.alert-default-error[style*=--alert-custom-color],.alert-default-warning[style*=--alert-custom-color],.alert-default-info[style*=--alert-custom-color],.alert-default-primary[style*=--alert-custom-color],.alert-default-secondary[style*=--alert-custom-color]{border-left-color:var(--alert-custom-color);color:var(--alert-custom-color)}.alert-filled-success[style*=--alert-custom-color],.alert-filled-error[style*=--alert-custom-color],.alert-filled-warning[style*=--alert-custom-color],.alert-filled-info[style*=--alert-custom-color],.alert-filled-primary[style*=--alert-custom-color],.alert-filled-secondary[style*=--alert-custom-color]{background-color:var(--alert-custom-color)}.alert-outlined-success[style*=--alert-custom-color],.alert-outlined-error[style*=--alert-custom-color],.alert-outlined-warning[style*=--alert-custom-color],.alert-outlined-info[style*=--alert-custom-color],.alert-outlined-primary[style*=--alert-custom-color],.alert-outlined-secondary[style*=--alert-custom-color]{border-color:var(--alert-custom-color);color:var(--alert-custom-color)}body.dark .alert-default-success{background-color:var(--ls-color-success-dark-light);border-left-color:var(--ls-color-success);color:var(--ls-color-success)}body.dark .alert-default-error{background-color:var(--ls-color-danger-dark-light);border-left-color:var(--ls-color-danger);color:var(--ls-color-danger)}body.dark .alert-default-warning{background-color:var(--ls-color-warning-dark-light);border-left-color:var(--ls-color-warning);color:var(--ls-color-warning)}body.dark .alert-default-info{background-color:var(--ls-color-info-dark-light);border-left-color:var(--ls-color-info);color:var(--ls-color-info)}body.dark .alert-default-primary{background-color:var(--ls-color-primary-dark-light);border-left-color:var(--ls-color-primary);color:var(--ls-color-primary)}body.dark .alert-default-secondary{background-color:var(--ls-color-secondary-dark-light);border-left-color:var(--ls-color-secondary);color:var(--ls-color-secondary)}body.dark .alert-outlined-success{border-color:var(--ls-color-success);color:var(--ls-color-success)}body.dark .alert-outlined-error{border-color:var(--ls-color-danger);color:var(--ls-color-danger)}body.dark .alert-outlined-warning{border-color:var(--ls-color-warning);color:var(--ls-color-warning)}body.dark .alert-outlined-info{border-color:var(--ls-color-info);color:var(--ls-color-info)}body.dark .alert-outlined-primary{border-color:var(--ls-color-primary);color:var(--ls-color-primary)}body.dark .alert-outlined-secondary{border-color:var(--ls-color-secondary);color:var(--ls-color-secondary)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2496
|
+
}
|
|
2497
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: AlertComponent, decorators: [{
|
|
2498
|
+
type: Component,
|
|
2499
|
+
args: [{ selector: 'ls-alert', standalone: true, template: `
|
|
2500
|
+
<div
|
|
2501
|
+
[class]="alertClasses()"
|
|
2502
|
+
[style]="colorStyle()"
|
|
2503
|
+
role="alert"
|
|
2504
|
+
[attr.aria-live]="ariaLive()">
|
|
2505
|
+
@if (icon()) {
|
|
2506
|
+
<span class="alert-icon" [innerHTML]="sanitizedIcon()"></span>
|
|
2507
|
+
}
|
|
2508
|
+
<div class="alert-content">
|
|
2509
|
+
@if (alertTitle()) {
|
|
2510
|
+
<div class="alert-title">{{ alertTitle() }}</div>
|
|
2511
|
+
}
|
|
2512
|
+
@if (message()) {
|
|
2513
|
+
<div class="alert-message">{{ message() }}</div>
|
|
2514
|
+
}
|
|
2515
|
+
</div>
|
|
2516
|
+
@if (closable()) {
|
|
2517
|
+
<button
|
|
2518
|
+
class="alert-close"
|
|
2519
|
+
(click)="onClose.emit()"
|
|
2520
|
+
[innerHTML]="sanitizedCloseIcon"
|
|
2521
|
+
aria-label="Close"></button>
|
|
2522
|
+
}
|
|
2523
|
+
</div>
|
|
2524
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:contents}.alert{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-radius:var(--ls-border-radius-md, 6px);font-family:var(--ls-font-family, \"Nunito\", sans-serif);font-size:14px;line-height:1.5;position:relative;width:100%;box-sizing:border-box}.alert-icon{flex-shrink:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center}.alert-icon svg{width:100%;height:100%}.alert-content{flex:1;min-width:0}.alert-title{font-weight:600;margin-bottom:4px}.alert-message{padding-top:2px;font-weight:400}.alert-close{flex-shrink:0;background:none;border:none;cursor:pointer;padding:4px;border-radius:4px;color:inherit;opacity:.7;transition:opacity var(--ls-transition-duration, .3s);display:flex;align-items:center;justify-content:center}.alert-close:hover{opacity:1}.alert-default-success{background-color:var(--ls-color-success-light);border-left:4px solid var(--ls-color-success);color:var(--ls-color-success)}.alert-default-error{background-color:var(--ls-color-danger-light);border-left:4px solid var(--ls-color-danger);color:var(--ls-color-danger)}.alert-default-warning{background-color:var(--ls-color-warning-light);border-left:4px solid var(--ls-color-warning);color:var(--ls-color-warning)}.alert-default-info{background-color:var(--ls-color-info-light);border-left:4px solid var(--ls-color-info);color:var(--ls-color-info)}.alert-default-primary{background-color:var(--ls-color-primary-light);border-left:4px solid var(--ls-color-primary);color:var(--ls-color-primary)}.alert-default-secondary{background-color:var(--ls-color-secondary-light);border-left:4px solid var(--ls-color-secondary);color:var(--ls-color-secondary)}.alert-filled-success{background-color:var(--ls-color-success);color:#fff}.alert-filled-error{background-color:var(--ls-color-danger);color:#fff}.alert-filled-warning{background-color:var(--ls-color-warning);color:#fff}.alert-filled-info{background-color:var(--ls-color-info);color:#fff}.alert-filled-primary{background-color:var(--ls-color-primary);color:#fff}.alert-filled-secondary{background-color:var(--ls-color-secondary);color:#fff}.alert-outlined-success{background-color:transparent;border:1px solid var(--ls-color-success);color:var(--ls-color-success)}.alert-outlined-error{background-color:transparent;border:1px solid var(--ls-color-danger);color:var(--ls-color-danger)}.alert-outlined-warning{background-color:transparent;border:1px solid var(--ls-color-warning);color:var(--ls-color-warning)}.alert-outlined-info{background-color:transparent;border:1px solid var(--ls-color-info);color:var(--ls-color-info)}.alert-outlined-primary{background-color:transparent;border:1px solid var(--ls-color-primary);color:var(--ls-color-primary)}.alert-outlined-secondary{background-color:transparent;border:1px solid var(--ls-color-secondary);color:var(--ls-color-secondary)}.alert[style*=--alert-custom-color]{border-color:var(--alert-custom-color)}.alert-default-success[style*=--alert-custom-color],.alert-default-error[style*=--alert-custom-color],.alert-default-warning[style*=--alert-custom-color],.alert-default-info[style*=--alert-custom-color],.alert-default-primary[style*=--alert-custom-color],.alert-default-secondary[style*=--alert-custom-color]{border-left-color:var(--alert-custom-color);color:var(--alert-custom-color)}.alert-filled-success[style*=--alert-custom-color],.alert-filled-error[style*=--alert-custom-color],.alert-filled-warning[style*=--alert-custom-color],.alert-filled-info[style*=--alert-custom-color],.alert-filled-primary[style*=--alert-custom-color],.alert-filled-secondary[style*=--alert-custom-color]{background-color:var(--alert-custom-color)}.alert-outlined-success[style*=--alert-custom-color],.alert-outlined-error[style*=--alert-custom-color],.alert-outlined-warning[style*=--alert-custom-color],.alert-outlined-info[style*=--alert-custom-color],.alert-outlined-primary[style*=--alert-custom-color],.alert-outlined-secondary[style*=--alert-custom-color]{border-color:var(--alert-custom-color);color:var(--alert-custom-color)}body.dark .alert-default-success{background-color:var(--ls-color-success-dark-light);border-left-color:var(--ls-color-success);color:var(--ls-color-success)}body.dark .alert-default-error{background-color:var(--ls-color-danger-dark-light);border-left-color:var(--ls-color-danger);color:var(--ls-color-danger)}body.dark .alert-default-warning{background-color:var(--ls-color-warning-dark-light);border-left-color:var(--ls-color-warning);color:var(--ls-color-warning)}body.dark .alert-default-info{background-color:var(--ls-color-info-dark-light);border-left-color:var(--ls-color-info);color:var(--ls-color-info)}body.dark .alert-default-primary{background-color:var(--ls-color-primary-dark-light);border-left-color:var(--ls-color-primary);color:var(--ls-color-primary)}body.dark .alert-default-secondary{background-color:var(--ls-color-secondary-dark-light);border-left-color:var(--ls-color-secondary);color:var(--ls-color-secondary)}body.dark .alert-outlined-success{border-color:var(--ls-color-success);color:var(--ls-color-success)}body.dark .alert-outlined-error{border-color:var(--ls-color-danger);color:var(--ls-color-danger)}body.dark .alert-outlined-warning{border-color:var(--ls-color-warning);color:var(--ls-color-warning)}body.dark .alert-outlined-info{border-color:var(--ls-color-info);color:var(--ls-color-info)}body.dark .alert-outlined-primary{border-color:var(--ls-color-primary);color:var(--ls-color-primary)}body.dark .alert-outlined-secondary{border-color:var(--ls-color-secondary);color:var(--ls-color-secondary)}\n"] }]
|
|
2525
|
+
}], propDecorators: { severity: [{ type: i0.Input, args: [{ isSignal: true, alias: "severity", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconMapping: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconMapping", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], alertTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "alertTitle", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], onClose: [{ type: i0.Output, args: ["onClose"] }] } });
|
|
2526
|
+
|
|
2527
|
+
class ModalActionsComponent {
|
|
2528
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ModalActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2529
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.2", type: ModalActionsComponent, isStandalone: true, selector: "ls-modal-actions", host: { classAttribute: "modal-actions" }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2530
|
+
}
|
|
2531
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ModalActionsComponent, decorators: [{
|
|
2532
|
+
type: Component,
|
|
2533
|
+
args: [{
|
|
2534
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2535
|
+
host: { class: 'modal-actions' },
|
|
2536
|
+
imports: [],
|
|
2537
|
+
selector: 'ls-modal-actions',
|
|
2538
|
+
standalone: true,
|
|
2539
|
+
template: `<ng-content />`,
|
|
2540
|
+
}]
|
|
2541
|
+
}] });
|
|
2542
|
+
|
|
2543
|
+
let _titleIdCounter = 0;
|
|
2544
|
+
class ModalTitleComponent {
|
|
2545
|
+
constructor() {
|
|
2546
|
+
this.id = `ls-modal-title-${++_titleIdCounter}`;
|
|
2547
|
+
}
|
|
2548
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ModalTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2549
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.2", type: ModalTitleComponent, isStandalone: true, selector: "ls-modal-title", host: { properties: { "id": "id" }, classAttribute: "modal-title" }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2550
|
+
}
|
|
2551
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ModalTitleComponent, decorators: [{
|
|
2552
|
+
type: Component,
|
|
2553
|
+
args: [{
|
|
2554
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2555
|
+
host: { class: 'modal-title', '[id]': 'id' },
|
|
2556
|
+
imports: [],
|
|
2557
|
+
selector: 'ls-modal-title',
|
|
2558
|
+
standalone: true,
|
|
2559
|
+
template: `<ng-content />`,
|
|
2560
|
+
}]
|
|
2561
|
+
}] });
|
|
2562
|
+
|
|
2563
|
+
class ModalStackService {
|
|
2564
|
+
constructor() {
|
|
2565
|
+
this._stack = signal([], ...(ngDevMode ? [{ debugName: "_stack" }] : []));
|
|
2566
|
+
}
|
|
2567
|
+
push(id) {
|
|
2568
|
+
this._stack.update(stack => [...stack, id]);
|
|
2569
|
+
}
|
|
2570
|
+
pop(id) {
|
|
2571
|
+
this._stack.update(stack => stack.filter(s => s !== id));
|
|
2572
|
+
}
|
|
2573
|
+
isTop(id) {
|
|
2574
|
+
const stack = this._stack();
|
|
2575
|
+
return stack.length > 0 && stack[stack.length - 1] === id;
|
|
2576
|
+
}
|
|
2577
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ModalStackService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2578
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ModalStackService, providedIn: 'root' }); }
|
|
2579
|
+
}
|
|
2580
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ModalStackService, decorators: [{
|
|
2581
|
+
type: Injectable,
|
|
2582
|
+
args: [{ providedIn: 'root' }]
|
|
2583
|
+
}] });
|
|
2584
|
+
|
|
2585
|
+
let _modalIdCounter = 0;
|
|
2586
|
+
class ModalComponent {
|
|
2587
|
+
constructor() {
|
|
2588
|
+
this.open = input(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
2589
|
+
this.disableBackdropClose = input(false, ...(ngDevMode ? [{ debugName: "disableBackdropClose" }] : []));
|
|
2590
|
+
this.fullScreen = input(false, ...(ngDevMode ? [{ debugName: "fullScreen" }] : []));
|
|
2591
|
+
this.fullWidth = input(false, ...(ngDevMode ? [{ debugName: "fullWidth" }] : []));
|
|
2592
|
+
this.maxWidth = input('md', ...(ngDevMode ? [{ debugName: "maxWidth" }] : []));
|
|
2593
|
+
this.scroll = input('dialog', ...(ngDevMode ? [{ debugName: "scroll" }] : []));
|
|
2594
|
+
this.showCloseButton = input(true, ...(ngDevMode ? [{ debugName: "showCloseButton" }] : []));
|
|
2595
|
+
this.closed = output();
|
|
2596
|
+
this._modalStackService = inject(ModalStackService);
|
|
2597
|
+
this._titleComponent = contentChild(ModalTitleComponent, ...(ngDevMode ? [{ debugName: "_titleComponent" }] : []));
|
|
2598
|
+
this._panel = viewChild('panel', ...(ngDevMode ? [{ debugName: "_panel" }] : []));
|
|
2599
|
+
this._id = `ls-modal-${++_modalIdCounter}`;
|
|
2600
|
+
this._previouslyFocused = null;
|
|
2601
|
+
this.labelledById = computed(() => {
|
|
2602
|
+
const title = this._titleComponent();
|
|
2603
|
+
return title ? title.id : null;
|
|
2604
|
+
}, ...(ngDevMode ? [{ debugName: "labelledById" }] : []));
|
|
2605
|
+
this.overlayClasses = computed(() => {
|
|
2606
|
+
const classes = ['modal-overlay'];
|
|
2607
|
+
if (this.scroll() === 'body')
|
|
2608
|
+
classes.push('modal-overlay-body');
|
|
2609
|
+
return classes.join(' ');
|
|
2610
|
+
}, ...(ngDevMode ? [{ debugName: "overlayClasses" }] : []));
|
|
2611
|
+
this.panelClasses = computed(() => {
|
|
2612
|
+
const classes = [
|
|
2613
|
+
'modal-panel',
|
|
2614
|
+
`modal-max-${this.maxWidth()}`,
|
|
2615
|
+
`modal-scroll-${this.scroll()}`,
|
|
2616
|
+
];
|
|
2617
|
+
if (this.fullScreen())
|
|
2618
|
+
classes.push('modal-full-screen');
|
|
2619
|
+
if (this.fullWidth())
|
|
2620
|
+
classes.push('modal-full-width');
|
|
2621
|
+
if (this.showCloseButton())
|
|
2622
|
+
classes.push('modal-has-close-btn');
|
|
2623
|
+
return classes.join(' ');
|
|
2624
|
+
}, ...(ngDevMode ? [{ debugName: "panelClasses" }] : []));
|
|
2625
|
+
effect(() => {
|
|
2626
|
+
if (this.open()) {
|
|
2627
|
+
this._previouslyFocused = document.activeElement;
|
|
2628
|
+
this._modalStackService.push(this._id);
|
|
2629
|
+
setTimeout(() => {
|
|
2630
|
+
untracked(() => this._panel()?.nativeElement.focus());
|
|
2631
|
+
}, 0);
|
|
2632
|
+
}
|
|
2633
|
+
else {
|
|
2634
|
+
this._modalStackService.pop(this._id);
|
|
2635
|
+
this._previouslyFocused?.focus?.();
|
|
2636
|
+
this._previouslyFocused = null;
|
|
2637
|
+
}
|
|
2638
|
+
});
|
|
2639
|
+
}
|
|
2640
|
+
ngOnDestroy() {
|
|
2641
|
+
if (this.open()) {
|
|
2642
|
+
this._modalStackService.pop(this._id);
|
|
2643
|
+
}
|
|
2644
|
+
}
|
|
2645
|
+
onEscape() {
|
|
2646
|
+
if (this.open() && this._modalStackService.isTop(this._id)) {
|
|
2647
|
+
this.closed.emit();
|
|
2648
|
+
}
|
|
2649
|
+
}
|
|
2650
|
+
onBackdropClick() {
|
|
2651
|
+
if (!this.disableBackdropClose()) {
|
|
2652
|
+
this.closed.emit();
|
|
2653
|
+
}
|
|
2654
|
+
}
|
|
2655
|
+
onCloseButtonClick() {
|
|
2656
|
+
this.closed.emit();
|
|
2657
|
+
}
|
|
2658
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2659
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: ModalComponent, isStandalone: true, selector: "ls-modal", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, disableBackdropClose: { classPropertyName: "disableBackdropClose", publicName: "disableBackdropClose", isSignal: true, isRequired: false, transformFunction: null }, fullScreen: { classPropertyName: "fullScreen", publicName: "fullScreen", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, scroll: { classPropertyName: "scroll", publicName: "scroll", isSignal: true, isRequired: false, transformFunction: null }, showCloseButton: { classPropertyName: "showCloseButton", publicName: "showCloseButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, host: { listeners: { "document:keydown.escape": "onEscape()" } }, queries: [{ propertyName: "_titleComponent", first: true, predicate: ModalTitleComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
2660
|
+
@if (open()) {
|
|
2661
|
+
<div [class]="overlayClasses()" (click)="onBackdropClick()">
|
|
2662
|
+
<div
|
|
2663
|
+
#panel
|
|
2664
|
+
[attr.aria-labelledby]="labelledById()"
|
|
2665
|
+
[attr.aria-modal]="true"
|
|
2666
|
+
[class]="panelClasses()"
|
|
2667
|
+
role="dialog"
|
|
2668
|
+
tabindex="-1"
|
|
2669
|
+
(click)="$event.stopPropagation()">
|
|
2670
|
+
@if (showCloseButton()) {
|
|
2671
|
+
<button
|
|
2672
|
+
aria-label="Close"
|
|
2673
|
+
class="modal-close-btn"
|
|
2674
|
+
type="button"
|
|
2675
|
+
(click)="onCloseButtonClick()">
|
|
2676
|
+
<ls-icon name="x" />
|
|
2677
|
+
</button>
|
|
2678
|
+
}
|
|
2679
|
+
<ng-content />
|
|
2680
|
+
</div>
|
|
2681
|
+
</div>
|
|
2682
|
+
}
|
|
2683
|
+
`, isInline: true, styles: [":host{display:contents}.modal-overlay{align-items:center;background-color:var(--ls-modal-backdrop-bg);display:flex;inset:0;justify-content:center;padding:1rem;position:fixed;z-index:var(--ls-modal-z-index)}.modal-overlay-body{align-items:flex-start;overflow-y:auto}.modal-panel{background-color:var(--ls-color-white);border-radius:var(--ls-border-radius-lg);box-shadow:0 20px 60px #0000004d;display:flex;flex-direction:column;max-height:calc(100vh - 2rem);outline:none;position:relative;width:100%}.modal-max-sm{max-width:24rem}.modal-max-md{max-width:32rem}.modal-max-lg{max-width:48rem}.modal-max-xl{max-width:64rem}.modal-max-full{max-width:100%}.modal-full-screen{border-radius:0;height:100vh;max-height:100vh;max-width:100vw;width:100vw}.modal-full-width{max-width:100%}.modal-scroll-dialog{max-height:calc(100vh - 2rem);overflow:hidden}.modal-scroll-body{max-height:none}.modal-close-btn{align-items:center;background:transparent;border:none;border-radius:.25rem;color:inherit;cursor:pointer;display:flex;justify-content:center;padding:.25rem;position:absolute;right:.75rem;top:.75rem;transition:background-color .15s}.modal-close-btn:hover{background-color:var(--ls-color-dark-light)}.modal-has-close-btn .modal-title{padding-right:3rem}.modal-title{border-bottom:1px solid var(--ls-color-dark-light);font-family:var(--ls-font-family);font-size:1.125rem;font-weight:700;padding:1.25rem 1.5rem}.modal-content{flex:1;overflow-y:auto;padding:1.5rem}.modal-actions{border-top:1px solid var(--ls-color-dark-light);display:flex;gap:.75rem;justify-content:flex-end;padding:1rem 1.5rem}body.dark .modal-panel{background-color:#1b2e4b;box-shadow:0 20px 60px #0009}body.dark .modal-title{border-bottom-color:#253958}body.dark .modal-actions{border-top-color:#253958}body.dark .modal-close-btn:hover{background-color:#253958}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ls-icon", inputs: ["name", "iconClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2684
|
+
}
|
|
2685
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ModalComponent, decorators: [{
|
|
2686
|
+
type: Component,
|
|
2687
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, imports: [IconComponent], selector: 'ls-modal', standalone: true, template: `
|
|
2688
|
+
@if (open()) {
|
|
2689
|
+
<div [class]="overlayClasses()" (click)="onBackdropClick()">
|
|
2690
|
+
<div
|
|
2691
|
+
#panel
|
|
2692
|
+
[attr.aria-labelledby]="labelledById()"
|
|
2693
|
+
[attr.aria-modal]="true"
|
|
2694
|
+
[class]="panelClasses()"
|
|
2695
|
+
role="dialog"
|
|
2696
|
+
tabindex="-1"
|
|
2697
|
+
(click)="$event.stopPropagation()">
|
|
2698
|
+
@if (showCloseButton()) {
|
|
2699
|
+
<button
|
|
2700
|
+
aria-label="Close"
|
|
2701
|
+
class="modal-close-btn"
|
|
2702
|
+
type="button"
|
|
2703
|
+
(click)="onCloseButtonClick()">
|
|
2704
|
+
<ls-icon name="x" />
|
|
2705
|
+
</button>
|
|
2706
|
+
}
|
|
2707
|
+
<ng-content />
|
|
2708
|
+
</div>
|
|
2709
|
+
</div>
|
|
2710
|
+
}
|
|
2711
|
+
`, styles: [":host{display:contents}.modal-overlay{align-items:center;background-color:var(--ls-modal-backdrop-bg);display:flex;inset:0;justify-content:center;padding:1rem;position:fixed;z-index:var(--ls-modal-z-index)}.modal-overlay-body{align-items:flex-start;overflow-y:auto}.modal-panel{background-color:var(--ls-color-white);border-radius:var(--ls-border-radius-lg);box-shadow:0 20px 60px #0000004d;display:flex;flex-direction:column;max-height:calc(100vh - 2rem);outline:none;position:relative;width:100%}.modal-max-sm{max-width:24rem}.modal-max-md{max-width:32rem}.modal-max-lg{max-width:48rem}.modal-max-xl{max-width:64rem}.modal-max-full{max-width:100%}.modal-full-screen{border-radius:0;height:100vh;max-height:100vh;max-width:100vw;width:100vw}.modal-full-width{max-width:100%}.modal-scroll-dialog{max-height:calc(100vh - 2rem);overflow:hidden}.modal-scroll-body{max-height:none}.modal-close-btn{align-items:center;background:transparent;border:none;border-radius:.25rem;color:inherit;cursor:pointer;display:flex;justify-content:center;padding:.25rem;position:absolute;right:.75rem;top:.75rem;transition:background-color .15s}.modal-close-btn:hover{background-color:var(--ls-color-dark-light)}.modal-has-close-btn .modal-title{padding-right:3rem}.modal-title{border-bottom:1px solid var(--ls-color-dark-light);font-family:var(--ls-font-family);font-size:1.125rem;font-weight:700;padding:1.25rem 1.5rem}.modal-content{flex:1;overflow-y:auto;padding:1.5rem}.modal-actions{border-top:1px solid var(--ls-color-dark-light);display:flex;gap:.75rem;justify-content:flex-end;padding:1rem 1.5rem}body.dark .modal-panel{background-color:#1b2e4b;box-shadow:0 20px 60px #0009}body.dark .modal-title{border-bottom-color:#253958}body.dark .modal-actions{border-top-color:#253958}body.dark .modal-close-btn:hover{background-color:#253958}\n"] }]
|
|
2712
|
+
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }], disableBackdropClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableBackdropClose", required: false }] }], fullScreen: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullScreen", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], maxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxWidth", required: false }] }], scroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "scroll", required: false }] }], showCloseButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCloseButton", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], _titleComponent: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ModalTitleComponent), { isSignal: true }] }], _panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], onEscape: [{
|
|
2713
|
+
type: HostListener,
|
|
2714
|
+
args: ['document:keydown.escape']
|
|
2715
|
+
}] } });
|
|
2716
|
+
|
|
2717
|
+
class ModalContentComponent {
|
|
2718
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ModalContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2719
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.2", type: ModalContentComponent, isStandalone: true, selector: "ls-modal-content", host: { classAttribute: "modal-content" }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2720
|
+
}
|
|
2721
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ModalContentComponent, decorators: [{
|
|
2722
|
+
type: Component,
|
|
2723
|
+
args: [{
|
|
2724
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2725
|
+
host: { class: 'modal-content' },
|
|
2726
|
+
imports: [],
|
|
2727
|
+
selector: 'ls-modal-content',
|
|
2728
|
+
standalone: true,
|
|
2729
|
+
template: `<ng-content />`,
|
|
2730
|
+
}]
|
|
2731
|
+
}] });
|
|
2732
|
+
|
|
2733
|
+
class PopoverComponent {
|
|
2734
|
+
constructor() {
|
|
2735
|
+
this._renderer = inject(Renderer2);
|
|
2736
|
+
this._destroyRef = inject(DestroyRef);
|
|
2737
|
+
this._document = inject(DOCUMENT);
|
|
2738
|
+
this._elementRef = inject(ElementRef);
|
|
2739
|
+
this._cleanupScroll = null;
|
|
2740
|
+
this.placement = input('bottom', ...(ngDevMode ? [{ debugName: "placement" }] : []));
|
|
2741
|
+
this.showArrow = input(true, ...(ngDevMode ? [{ debugName: "showArrow" }] : []));
|
|
2742
|
+
this.offset = input(8, ...(ngDevMode ? [{ debugName: "offset" }] : []));
|
|
2743
|
+
this.autoFlip = input(true, ...(ngDevMode ? [{ debugName: "autoFlip" }] : []));
|
|
2744
|
+
this.trigger = input(undefined, ...(ngDevMode ? [{ debugName: "trigger" }] : []));
|
|
2745
|
+
this.isOpen = model(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
2746
|
+
this.onOpened = output();
|
|
2747
|
+
this.onHidden = output();
|
|
2748
|
+
this._panelRef = viewChild('panelRef', ...(ngDevMode ? [{ debugName: "_panelRef" }] : []));
|
|
2749
|
+
this._currentPlacement = signal('bottom', ...(ngDevMode ? [{ debugName: "_currentPlacement" }] : []));
|
|
2750
|
+
this._isAnimating = signal(false, ...(ngDevMode ? [{ debugName: "_isAnimating" }] : []));
|
|
2751
|
+
this._cleanupClickOutside = null;
|
|
2752
|
+
this._cleanupEscape = null;
|
|
2753
|
+
this._hoverBridgeTimeout = null;
|
|
2754
|
+
this._wasOpen = false;
|
|
2755
|
+
this._panelClasses = computed(() => ['popover-panel', `popover-${this._currentPlacement()}`].join(' '), ...(ngDevMode ? [{ debugName: "_panelClasses" }] : []));
|
|
2756
|
+
this._arrowClasses = computed(() => `popover-arrow popover-arrow-${this._currentPlacement()}`, ...(ngDevMode ? [{ debugName: "_arrowClasses" }] : []));
|
|
2757
|
+
effect(() => {
|
|
2758
|
+
const isOpen = this.isOpen();
|
|
2759
|
+
untracked(() => {
|
|
2760
|
+
if (isOpen) {
|
|
2761
|
+
this._currentPlacement.set(this.placement());
|
|
2762
|
+
this._isAnimating.set(true);
|
|
2763
|
+
this._setupListeners();
|
|
2764
|
+
setTimeout(() => {
|
|
2765
|
+
if (this.isOpen()) {
|
|
2766
|
+
this._computePosition();
|
|
2767
|
+
}
|
|
2768
|
+
}, 0);
|
|
2769
|
+
this._wasOpen = true;
|
|
2770
|
+
}
|
|
2771
|
+
else if (this._wasOpen) {
|
|
2772
|
+
this._isAnimating.set(true);
|
|
2773
|
+
this._wasOpen = false;
|
|
2774
|
+
}
|
|
2775
|
+
else {
|
|
2776
|
+
this._removeListeners();
|
|
2777
|
+
}
|
|
2778
|
+
});
|
|
2779
|
+
});
|
|
2780
|
+
this._destroyRef.onDestroy(() => {
|
|
2781
|
+
this._removeListeners();
|
|
2782
|
+
if (this._hoverBridgeTimeout) {
|
|
2783
|
+
clearTimeout(this._hoverBridgeTimeout);
|
|
2784
|
+
}
|
|
2785
|
+
});
|
|
2786
|
+
}
|
|
2787
|
+
open() {
|
|
2788
|
+
this.isOpen.set(true);
|
|
2789
|
+
}
|
|
2790
|
+
close() {
|
|
2791
|
+
this.isOpen.set(false);
|
|
2792
|
+
}
|
|
2793
|
+
toggle() {
|
|
2794
|
+
if (this.isOpen()) {
|
|
2795
|
+
this.close();
|
|
2796
|
+
}
|
|
2797
|
+
else {
|
|
2798
|
+
this.open();
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
_onAnimationEnd() {
|
|
2802
|
+
this._isAnimating.set(false);
|
|
2803
|
+
if (this.isOpen()) {
|
|
2804
|
+
this.onOpened.emit();
|
|
2805
|
+
}
|
|
2806
|
+
else {
|
|
2807
|
+
this._removeListeners();
|
|
2808
|
+
this.onHidden.emit();
|
|
2809
|
+
}
|
|
2810
|
+
}
|
|
2811
|
+
_onPanelMouseEnter() {
|
|
2812
|
+
if (this._hoverBridgeTimeout) {
|
|
2813
|
+
clearTimeout(this._hoverBridgeTimeout);
|
|
2814
|
+
this._hoverBridgeTimeout = null;
|
|
2815
|
+
}
|
|
2816
|
+
}
|
|
2817
|
+
_onPanelMouseLeave() {
|
|
2818
|
+
this._hoverBridgeTimeout = setTimeout(() => this.close(), 100);
|
|
2819
|
+
}
|
|
2820
|
+
_computePosition() {
|
|
2821
|
+
const anchor = this.trigger() ??
|
|
2822
|
+
this._elementRef.nativeElement.parentElement;
|
|
2823
|
+
const panel = this._panelRef()?.nativeElement;
|
|
2824
|
+
if (!anchor || !panel)
|
|
2825
|
+
return;
|
|
2826
|
+
const anchorRect = anchor.getBoundingClientRect();
|
|
2827
|
+
const panelRect = panel.getBoundingClientRect();
|
|
2828
|
+
const offset = this.offset();
|
|
2829
|
+
let placement = this._currentPlacement();
|
|
2830
|
+
if (this.autoFlip()) {
|
|
2831
|
+
placement = this._getFlippedPlacement(placement, anchorRect, panelRect, offset);
|
|
2832
|
+
this._currentPlacement.set(placement);
|
|
2833
|
+
}
|
|
2834
|
+
let top = 0;
|
|
2835
|
+
let left = 0;
|
|
2836
|
+
switch (placement) {
|
|
2837
|
+
case 'top':
|
|
2838
|
+
top = anchorRect.top - panelRect.height - offset;
|
|
2839
|
+
left =
|
|
2840
|
+
anchorRect.left +
|
|
2841
|
+
(anchorRect.width - panelRect.width) / 2;
|
|
2842
|
+
break;
|
|
2843
|
+
case 'bottom':
|
|
2844
|
+
top = anchorRect.bottom + offset;
|
|
2845
|
+
left =
|
|
2846
|
+
anchorRect.left +
|
|
2847
|
+
(anchorRect.width - panelRect.width) / 2;
|
|
2848
|
+
break;
|
|
2849
|
+
case 'left':
|
|
2850
|
+
top =
|
|
2851
|
+
anchorRect.top +
|
|
2852
|
+
(anchorRect.height - panelRect.height) / 2;
|
|
2853
|
+
left = anchorRect.left - panelRect.width - offset;
|
|
2854
|
+
break;
|
|
2855
|
+
case 'right':
|
|
2856
|
+
top =
|
|
2857
|
+
anchorRect.top +
|
|
2858
|
+
(anchorRect.height - panelRect.height) / 2;
|
|
2859
|
+
left = anchorRect.right + offset;
|
|
2860
|
+
break;
|
|
2861
|
+
}
|
|
2862
|
+
panel.style.setProperty('--popover-top', `${top}px`);
|
|
2863
|
+
panel.style.setProperty('--popover-left', `${left}px`);
|
|
2864
|
+
}
|
|
2865
|
+
_getFlippedPlacement(placement, anchorRect, panelRect, offset) {
|
|
2866
|
+
const viewportWidth = this._document.defaultView?.innerWidth ?? 0;
|
|
2867
|
+
const viewportHeight = this._document.defaultView?.innerHeight ?? 0;
|
|
2868
|
+
const opposites = {
|
|
2869
|
+
top: 'bottom',
|
|
2870
|
+
bottom: 'top',
|
|
2871
|
+
left: 'right',
|
|
2872
|
+
right: 'left',
|
|
2873
|
+
};
|
|
2874
|
+
switch (placement) {
|
|
2875
|
+
case 'top':
|
|
2876
|
+
if (anchorRect.top - panelRect.height - offset < 0) {
|
|
2877
|
+
return opposites[placement];
|
|
2878
|
+
}
|
|
2879
|
+
break;
|
|
2880
|
+
case 'bottom':
|
|
2881
|
+
if (anchorRect.bottom + panelRect.height + offset >
|
|
2882
|
+
viewportHeight) {
|
|
2883
|
+
return opposites[placement];
|
|
2884
|
+
}
|
|
2885
|
+
break;
|
|
2886
|
+
case 'left':
|
|
2887
|
+
if (anchorRect.left - panelRect.width - offset < 0) {
|
|
2888
|
+
return opposites[placement];
|
|
2889
|
+
}
|
|
2890
|
+
break;
|
|
2891
|
+
case 'right':
|
|
2892
|
+
if (anchorRect.right + panelRect.width + offset >
|
|
2893
|
+
viewportWidth) {
|
|
2894
|
+
return opposites[placement];
|
|
2895
|
+
}
|
|
2896
|
+
break;
|
|
2897
|
+
}
|
|
2898
|
+
return placement;
|
|
2899
|
+
}
|
|
2900
|
+
_setupListeners() {
|
|
2901
|
+
this._removeListeners();
|
|
2902
|
+
this._cleanupClickOutside = this._renderer.listen(this._document, 'click', (event) => {
|
|
2903
|
+
const anchor = this.trigger() ??
|
|
2904
|
+
this._elementRef.nativeElement.parentElement;
|
|
2905
|
+
const panel = this._panelRef()?.nativeElement;
|
|
2906
|
+
const target = event.target;
|
|
2907
|
+
if (panel &&
|
|
2908
|
+
!panel.contains(target) &&
|
|
2909
|
+
anchor &&
|
|
2910
|
+
!anchor.contains(target)) {
|
|
2911
|
+
this.close();
|
|
2912
|
+
}
|
|
2913
|
+
});
|
|
2914
|
+
this._cleanupEscape = this._renderer.listen(this._document, 'keydown', (event) => {
|
|
2915
|
+
if (event.key === 'Escape') {
|
|
2916
|
+
this.close();
|
|
2917
|
+
}
|
|
2918
|
+
});
|
|
2919
|
+
this._cleanupScroll = this._renderer.listen('window', 'scroll', () => {
|
|
2920
|
+
if (this.isOpen()) {
|
|
2921
|
+
this.close();
|
|
2922
|
+
}
|
|
2923
|
+
}, { capture: true });
|
|
2924
|
+
}
|
|
2925
|
+
_removeListeners() {
|
|
2926
|
+
if (this._cleanupClickOutside) {
|
|
2927
|
+
this._cleanupClickOutside();
|
|
2928
|
+
this._cleanupClickOutside = null;
|
|
2929
|
+
}
|
|
2930
|
+
if (this._cleanupEscape) {
|
|
2931
|
+
this._cleanupEscape();
|
|
2932
|
+
this._cleanupEscape = null;
|
|
2933
|
+
}
|
|
2934
|
+
if (this._cleanupScroll) {
|
|
2935
|
+
this._cleanupScroll();
|
|
2936
|
+
this._cleanupScroll = null;
|
|
2937
|
+
}
|
|
2938
|
+
}
|
|
2939
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: PopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2940
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: PopoverComponent, isStandalone: true, selector: "ls-popover", inputs: { placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, showArrow: { classPropertyName: "showArrow", publicName: "showArrow", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "offset", isSignal: true, isRequired: false, transformFunction: null }, autoFlip: { classPropertyName: "autoFlip", publicName: "autoFlip", isSignal: true, isRequired: false, transformFunction: null }, trigger: { classPropertyName: "trigger", publicName: "trigger", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange", onOpened: "onOpened", onHidden: "onHidden" }, viewQueries: [{ propertyName: "_panelRef", first: true, predicate: ["panelRef"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
2941
|
+
@if (isOpen() || _isAnimating()) {
|
|
2942
|
+
<div
|
|
2943
|
+
[class]="_panelClasses()"
|
|
2944
|
+
[class.popover-enter]="isOpen() && _isAnimating()"
|
|
2945
|
+
[class.popover-exit]="!isOpen() && _isAnimating()"
|
|
2946
|
+
(animationend)="_onAnimationEnd()"
|
|
2947
|
+
(mouseenter)="_onPanelMouseEnter()"
|
|
2948
|
+
(mouseleave)="_onPanelMouseLeave()"
|
|
2949
|
+
role="dialog"
|
|
2950
|
+
aria-modal="false"
|
|
2951
|
+
#panelRef>
|
|
2952
|
+
@if (showArrow()) {
|
|
2953
|
+
<span [class]="_arrowClasses()"></span>
|
|
2954
|
+
}
|
|
2955
|
+
<ng-content />
|
|
2956
|
+
</div>
|
|
2957
|
+
}
|
|
2958
|
+
`, isInline: true, styles: [":host{display:contents}.popover-panel{position:fixed;top:var(--popover-top, 0);left:var(--popover-left, 0);z-index:1050;background:var(--ls-color-white, #fff);border:1px solid var(--ls-color-border, #e0e6ed);border-radius:8px;box-shadow:0 4px 16px #0000001f;padding:12px 16px;animation-duration:.15s;animation-fill-mode:both;animation-timing-function:ease-out}.popover-enter{animation-name:popoverFadeIn}.popover-exit{animation-name:popoverFadeOut}@keyframes popoverFadeIn{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes popoverFadeOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}.popover-arrow{position:absolute;width:10px;height:10px;background:inherit;border:inherit;transform:rotate(45deg);z-index:-1}.popover-arrow-top{bottom:-6px;left:50%;margin-left:-5px;border-top:0;border-left:0}.popover-arrow-bottom{top:-6px;left:50%;margin-left:-5px;border-bottom:0;border-right:0}.popover-arrow-left{right:-6px;top:50%;margin-top:-5px;border-bottom:0;border-left:0}.popover-arrow-right{left:-6px;top:50%;margin-top:-5px;border-top:0;border-right:0}:host-context(body.dark) .popover-panel{background:#1b2e4b!important;border-color:#253b5c!important;color:#e0e6ed!important;box-shadow:0 4px 16px #00000080!important}:host-context(.dark) .popover-panel{background:#1b2e4b!important;border-color:#253b5c!important;color:#e0e6ed!important}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2959
|
+
}
|
|
2960
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: PopoverComponent, decorators: [{
|
|
2961
|
+
type: Component,
|
|
2962
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ls-popover', standalone: true, template: `
|
|
2963
|
+
@if (isOpen() || _isAnimating()) {
|
|
2964
|
+
<div
|
|
2965
|
+
[class]="_panelClasses()"
|
|
2966
|
+
[class.popover-enter]="isOpen() && _isAnimating()"
|
|
2967
|
+
[class.popover-exit]="!isOpen() && _isAnimating()"
|
|
2968
|
+
(animationend)="_onAnimationEnd()"
|
|
2969
|
+
(mouseenter)="_onPanelMouseEnter()"
|
|
2970
|
+
(mouseleave)="_onPanelMouseLeave()"
|
|
2971
|
+
role="dialog"
|
|
2972
|
+
aria-modal="false"
|
|
2973
|
+
#panelRef>
|
|
2974
|
+
@if (showArrow()) {
|
|
2975
|
+
<span [class]="_arrowClasses()"></span>
|
|
2976
|
+
}
|
|
2977
|
+
<ng-content />
|
|
2978
|
+
</div>
|
|
2979
|
+
}
|
|
2980
|
+
`, styles: [":host{display:contents}.popover-panel{position:fixed;top:var(--popover-top, 0);left:var(--popover-left, 0);z-index:1050;background:var(--ls-color-white, #fff);border:1px solid var(--ls-color-border, #e0e6ed);border-radius:8px;box-shadow:0 4px 16px #0000001f;padding:12px 16px;animation-duration:.15s;animation-fill-mode:both;animation-timing-function:ease-out}.popover-enter{animation-name:popoverFadeIn}.popover-exit{animation-name:popoverFadeOut}@keyframes popoverFadeIn{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes popoverFadeOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}.popover-arrow{position:absolute;width:10px;height:10px;background:inherit;border:inherit;transform:rotate(45deg);z-index:-1}.popover-arrow-top{bottom:-6px;left:50%;margin-left:-5px;border-top:0;border-left:0}.popover-arrow-bottom{top:-6px;left:50%;margin-left:-5px;border-bottom:0;border-right:0}.popover-arrow-left{right:-6px;top:50%;margin-top:-5px;border-bottom:0;border-left:0}.popover-arrow-right{left:-6px;top:50%;margin-top:-5px;border-top:0;border-right:0}:host-context(body.dark) .popover-panel{background:#1b2e4b!important;border-color:#253b5c!important;color:#e0e6ed!important;box-shadow:0 4px 16px #00000080!important}:host-context(.dark) .popover-panel{background:#1b2e4b!important;border-color:#253b5c!important;color:#e0e6ed!important}\n"] }]
|
|
2981
|
+
}], ctorParameters: () => [], propDecorators: { placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], showArrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "showArrow", required: false }] }], offset: [{ type: i0.Input, args: [{ isSignal: true, alias: "offset", required: false }] }], autoFlip: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoFlip", required: false }] }], trigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "trigger", required: false }] }], isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: false }] }, { type: i0.Output, args: ["isOpenChange"] }], onOpened: [{ type: i0.Output, args: ["onOpened"] }], onHidden: [{ type: i0.Output, args: ["onHidden"] }], _panelRef: [{ type: i0.ViewChild, args: ['panelRef', { isSignal: true }] }] } });
|
|
2982
|
+
|
|
2983
|
+
class PaginationComponent {
|
|
2984
|
+
constructor() {
|
|
2985
|
+
this.count = input(1, ...(ngDevMode ? [{ debugName: "count" }] : []));
|
|
2986
|
+
this.page = input(undefined, ...(ngDevMode ? [{ debugName: "page" }] : []));
|
|
2987
|
+
this.defaultPage = input(1, ...(ngDevMode ? [{ debugName: "defaultPage" }] : []));
|
|
2988
|
+
this.color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
2989
|
+
this.variant = input('outlined', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
2990
|
+
this.shape = input('rounded', ...(ngDevMode ? [{ debugName: "shape" }] : []));
|
|
2991
|
+
this.size = input('medium', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
2992
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
2993
|
+
this.showFirstButton = input(false, ...(ngDevMode ? [{ debugName: "showFirstButton" }] : []));
|
|
2994
|
+
this.showLastButton = input(false, ...(ngDevMode ? [{ debugName: "showLastButton" }] : []));
|
|
2995
|
+
this.hidePrevButton = input(false, ...(ngDevMode ? [{ debugName: "hidePrevButton" }] : []));
|
|
2996
|
+
this.hideNextButton = input(false, ...(ngDevMode ? [{ debugName: "hideNextButton" }] : []));
|
|
2997
|
+
this.pageChange = output();
|
|
2998
|
+
this._internalPage = signal(1, ...(ngDevMode ? [{ debugName: "_internalPage" }] : []));
|
|
2999
|
+
this.activePage = computed(() => this.page() ?? this._internalPage(), ...(ngDevMode ? [{ debugName: "activePage" }] : []));
|
|
3000
|
+
this.pages = computed(() => {
|
|
3001
|
+
const total = this.count();
|
|
3002
|
+
const current = this.activePage();
|
|
3003
|
+
if (total <= 5) {
|
|
3004
|
+
return Array.from({ length: total }, (_, i) => i + 1);
|
|
3005
|
+
}
|
|
3006
|
+
const start = Math.max(1, Math.min(current - 2, total - 4));
|
|
3007
|
+
return Array.from({ length: 5 }, (_, i) => start + i);
|
|
3008
|
+
}, ...(ngDevMode ? [{ debugName: "pages" }] : []));
|
|
3009
|
+
this.isFirstPage = computed(() => this.activePage() === 1, ...(ngDevMode ? [{ debugName: "isFirstPage" }] : []));
|
|
3010
|
+
this.isLastPage = computed(() => this.activePage() === this.count(), ...(ngDevMode ? [{ debugName: "isLastPage" }] : []));
|
|
3011
|
+
this._baseClasses = computed(() => {
|
|
3012
|
+
const size = this.size();
|
|
3013
|
+
const sizeClass = size === 'small'
|
|
3014
|
+
? 'pg-item-sm'
|
|
3015
|
+
: size === 'large'
|
|
3016
|
+
? 'pg-item-lg'
|
|
3017
|
+
: 'pg-item-md';
|
|
3018
|
+
const shapeClass = this.shape() === 'circular' ? 'pg-item-circular' : 'pg-item-rounded';
|
|
3019
|
+
return [
|
|
3020
|
+
'pg-item',
|
|
3021
|
+
`pg-item-${this.variant()}-${this.color()}`,
|
|
3022
|
+
sizeClass,
|
|
3023
|
+
shapeClass,
|
|
3024
|
+
].join(' ');
|
|
3025
|
+
}, ...(ngDevMode ? [{ debugName: "_baseClasses" }] : []));
|
|
3026
|
+
}
|
|
3027
|
+
ngOnInit() {
|
|
3028
|
+
this._internalPage.set(this.defaultPage());
|
|
3029
|
+
}
|
|
3030
|
+
pageItemClasses(n) {
|
|
3031
|
+
const base = this._baseClasses();
|
|
3032
|
+
return n === this.activePage() ? `${base} pg-item-active` : base;
|
|
3033
|
+
}
|
|
3034
|
+
navClasses(isAtBoundary) {
|
|
3035
|
+
const classes = `${this._baseClasses()} pg-nav-btn`;
|
|
3036
|
+
return isAtBoundary || this.disabled()
|
|
3037
|
+
? `${classes} pg-item-disabled`
|
|
3038
|
+
: classes;
|
|
3039
|
+
}
|
|
3040
|
+
goToPage(n) {
|
|
3041
|
+
if (this.disabled() || n < 1 || n > this.count())
|
|
3042
|
+
return;
|
|
3043
|
+
if (this.page() === undefined) {
|
|
3044
|
+
this._internalPage.set(n);
|
|
3045
|
+
}
|
|
3046
|
+
this.pageChange.emit(n);
|
|
3047
|
+
}
|
|
3048
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3049
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: PaginationComponent, isStandalone: true, selector: "ls-pagination", inputs: { count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, defaultPage: { classPropertyName: "defaultPage", publicName: "defaultPage", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, showFirstButton: { classPropertyName: "showFirstButton", publicName: "showFirstButton", isSignal: true, isRequired: false, transformFunction: null }, showLastButton: { classPropertyName: "showLastButton", publicName: "showLastButton", isSignal: true, isRequired: false, transformFunction: null }, hidePrevButton: { classPropertyName: "hidePrevButton", publicName: "hidePrevButton", isSignal: true, isRequired: false, transformFunction: null }, hideNextButton: { classPropertyName: "hideNextButton", publicName: "hideNextButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageChange: "pageChange" }, ngImport: i0, template: `
|
|
3050
|
+
<nav aria-label="pagination">
|
|
3051
|
+
<ul class="pg-list">
|
|
3052
|
+
@if (showFirstButton()) {
|
|
3053
|
+
<li>
|
|
3054
|
+
<button
|
|
3055
|
+
type="button"
|
|
3056
|
+
aria-label="first"
|
|
3057
|
+
[class]="navClasses(isFirstPage())"
|
|
3058
|
+
[disabled]="isFirstPage() || disabled()"
|
|
3059
|
+
[attr.aria-disabled]="
|
|
3060
|
+
isFirstPage() || disabled() ? 'true' : null
|
|
3061
|
+
"
|
|
3062
|
+
(click)="goToPage(1)">
|
|
3063
|
+
<ls-icon class="pg-icon-left" name="carets-down" />
|
|
3064
|
+
</button>
|
|
3065
|
+
</li>
|
|
3066
|
+
}
|
|
3067
|
+
@if (!hidePrevButton()) {
|
|
3068
|
+
<li>
|
|
3069
|
+
<button
|
|
3070
|
+
type="button"
|
|
3071
|
+
aria-label="prev"
|
|
3072
|
+
[class]="navClasses(isFirstPage())"
|
|
3073
|
+
[disabled]="isFirstPage() || disabled()"
|
|
3074
|
+
[attr.aria-disabled]="
|
|
3075
|
+
isFirstPage() || disabled() ? 'true' : null
|
|
3076
|
+
"
|
|
3077
|
+
(click)="goToPage(activePage() - 1)">
|
|
3078
|
+
<ls-icon class="pg-icon-left" name="caret-down" />
|
|
3079
|
+
</button>
|
|
3080
|
+
</li>
|
|
3081
|
+
}
|
|
3082
|
+
@for (n of pages(); track $index) {
|
|
3083
|
+
<li>
|
|
3084
|
+
<button
|
|
3085
|
+
type="button"
|
|
3086
|
+
[class]="pageItemClasses(n)"
|
|
3087
|
+
[attr.aria-current]="n === activePage() ? 'page' : null"
|
|
3088
|
+
[disabled]="disabled()"
|
|
3089
|
+
[attr.aria-disabled]="disabled() ? 'true' : null"
|
|
3090
|
+
(click)="goToPage(n)">
|
|
3091
|
+
{{ n }}
|
|
3092
|
+
</button>
|
|
3093
|
+
</li>
|
|
3094
|
+
}
|
|
3095
|
+
@if (!hideNextButton()) {
|
|
3096
|
+
<li>
|
|
3097
|
+
<button
|
|
3098
|
+
type="button"
|
|
3099
|
+
aria-label="next"
|
|
3100
|
+
[class]="navClasses(isLastPage())"
|
|
3101
|
+
[disabled]="isLastPage() || disabled()"
|
|
3102
|
+
[attr.aria-disabled]="
|
|
3103
|
+
isLastPage() || disabled() ? 'true' : null
|
|
3104
|
+
"
|
|
3105
|
+
(click)="goToPage(activePage() + 1)">
|
|
3106
|
+
<ls-icon class="pg-icon-right" name="caret-down" />
|
|
3107
|
+
</button>
|
|
3108
|
+
</li>
|
|
3109
|
+
}
|
|
3110
|
+
@if (showLastButton()) {
|
|
3111
|
+
<li>
|
|
3112
|
+
<button
|
|
3113
|
+
type="button"
|
|
3114
|
+
aria-label="last"
|
|
3115
|
+
[class]="navClasses(isLastPage())"
|
|
3116
|
+
[disabled]="isLastPage() || disabled()"
|
|
3117
|
+
[attr.aria-disabled]="
|
|
3118
|
+
isLastPage() || disabled() ? 'true' : null
|
|
3119
|
+
"
|
|
3120
|
+
(click)="goToPage(count())">
|
|
3121
|
+
<ls-icon class="pg-icon-right" name="carets-down" />
|
|
3122
|
+
</button>
|
|
3123
|
+
</li>
|
|
3124
|
+
}
|
|
3125
|
+
</ul>
|
|
3126
|
+
</nav>
|
|
3127
|
+
`, isInline: true, styles: [":host{display:contents}.pg-icon-left{transform:rotate(90deg)}.pg-icon-right{transform:rotate(-90deg)}.pg-list{display:inline-flex;align-items:center;gap:.25rem;list-style:none;margin:0;padding:0}.pg-item{display:inline-flex;align-items:center;justify-content:center;font-weight:600;cursor:pointer;transition:all var(--ls-transition-duration) ease;border:2px solid transparent;background:none;outline:none;font-family:var(--ls-font-family);line-height:1;-webkit-user-select:none;user-select:none}.pg-item-sm{padding:.375rem .625rem;font-size:.75rem;min-width:1.75rem;height:1.75rem}.pg-item-md{padding:.5rem .875rem;font-size:.875rem;min-width:2.25rem;height:2.25rem}.pg-item-lg{padding:.625rem 1.25rem;font-size:1rem;min-width:2.75rem;height:2.75rem}.pg-item-rounded{border-radius:var(--ls-border-radius-md)}.pg-item-circular{border-radius:var(--ls-border-radius-full);padding-inline:0}.pg-item-circular.pg-item-sm{width:1.75rem}.pg-item-circular.pg-item-md{width:2.25rem}.pg-item-circular.pg-item-lg{width:2.75rem}.pg-item-disabled,.pg-item[disabled]{cursor:not-allowed;opacity:.6}.pg-item-solid-primary{background-color:var(--ls-color-white-light);color:var(--ls-color-dark)}.pg-item-solid-primary:not([disabled]):hover{background-color:var(--ls-color-primary);color:var(--ls-color-white)}.pg-item-solid-primary.pg-item-active{background-color:var(--ls-color-primary);color:var(--ls-color-white)}.pg-item-solid-secondary{background-color:var(--ls-color-white-light);color:var(--ls-color-dark)}.pg-item-solid-secondary:not([disabled]):hover{background-color:var(--ls-color-secondary);color:var(--ls-color-white)}.pg-item-solid-secondary.pg-item-active{background-color:var(--ls-color-secondary);color:var(--ls-color-white)}.pg-item-solid-default{background-color:var(--ls-color-white-light);color:var(--ls-color-dark)}.pg-item-solid-default:not([disabled]):hover{background-color:var(--ls-color-dark);color:var(--ls-color-white)}.pg-item-solid-default.pg-item-active{background-color:var(--ls-color-dark);color:var(--ls-color-white)}.pg-item-outlined-primary{background-color:transparent;border-color:var(--ls-color-white-light);color:var(--ls-color-dark)}.pg-item-outlined-primary:not([disabled]):hover{border-color:var(--ls-color-primary);color:var(--ls-color-primary)}.pg-item-outlined-primary.pg-item-active{border-color:var(--ls-color-primary);color:var(--ls-color-primary)}.pg-item-outlined-secondary{background-color:transparent;border-color:var(--ls-color-white-light);color:var(--ls-color-dark)}.pg-item-outlined-secondary:not([disabled]):hover{border-color:var(--ls-color-secondary);color:var(--ls-color-secondary)}.pg-item-outlined-secondary.pg-item-active{border-color:var(--ls-color-secondary);color:var(--ls-color-secondary)}.pg-item-outlined-default{background-color:transparent;border-color:var(--ls-color-white-light);color:var(--ls-color-dark)}.pg-item-outlined-default:not([disabled]):hover{border-color:var(--ls-color-dark);color:var(--ls-color-dark)}.pg-item-outlined-default.pg-item-active{border-color:var(--ls-color-dark);color:var(--ls-color-dark)}.pg-item-text-primary{background-color:transparent;border-color:transparent;color:var(--ls-color-white-dark)}.pg-item-text-primary:not([disabled]):hover{background-color:#4361ee1a;color:var(--ls-color-primary)}.pg-item-text-primary.pg-item-active{color:var(--ls-color-primary)}.pg-item-text-secondary{background-color:transparent;border-color:transparent;color:var(--ls-color-white-dark)}.pg-item-text-secondary:not([disabled]):hover{background-color:#805dca1a;color:var(--ls-color-secondary)}.pg-item-text-secondary.pg-item-active{color:var(--ls-color-secondary)}.pg-item-text-default{background-color:transparent;border-color:transparent;color:var(--ls-color-white-dark)}.pg-item-text-default:not([disabled]):hover{background-color:#3b3f5c1a;color:var(--ls-color-dark)}.pg-item-text-default.pg-item-active{color:var(--ls-color-dark)}body.dark .pg-item-solid-primary,body.dark .pg-item-solid-secondary,body.dark .pg-item-solid-default{background-color:#191e3a;color:var(--ls-color-white-light)}body.dark .pg-item-solid-primary:not([disabled]):hover,body.dark .pg-item-solid-primary.pg-item-active{background-color:var(--ls-color-primary);color:var(--ls-color-white-light)}body.dark .pg-item-solid-secondary:not([disabled]):hover,body.dark .pg-item-solid-secondary.pg-item-active{background-color:var(--ls-color-secondary);color:var(--ls-color-white-light)}body.dark .pg-item-solid-default:not([disabled]):hover,body.dark .pg-item-solid-default.pg-item-active{background-color:var(--ls-color-dark);color:var(--ls-color-white-light)}body.dark .pg-item-outlined-primary,body.dark .pg-item-outlined-secondary,body.dark .pg-item-outlined-default{border-color:#191e3a;color:var(--ls-color-white-light)}body.dark .pg-item-outlined-primary:not([disabled]):hover,body.dark .pg-item-outlined-primary.pg-item-active{border-color:var(--ls-color-primary);color:var(--ls-color-white-light)}body.dark .pg-item-outlined-secondary:not([disabled]):hover,body.dark .pg-item-outlined-secondary.pg-item-active{border-color:var(--ls-color-secondary);color:var(--ls-color-white-light)}body.dark .pg-item-outlined-default:not([disabled]):hover,body.dark .pg-item-outlined-default.pg-item-active{border-color:var(--ls-color-dark);color:var(--ls-color-white-light)}body.dark .pg-item-text-primary,body.dark .pg-item-text-secondary,body.dark .pg-item-text-default{color:var(--ls-color-white-dark)}body.dark .pg-item-text-primary:not([disabled]):hover,body.dark .pg-item-text-primary.pg-item-active{color:var(--ls-color-primary)}body.dark .pg-item-text-secondary:not([disabled]):hover,body.dark .pg-item-text-secondary.pg-item-active{color:var(--ls-color-secondary)}body.dark .pg-item-text-default:not([disabled]):hover,body.dark .pg-item-text-default.pg-item-active{color:var(--ls-color-white-light)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ls-icon", inputs: ["name", "iconClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3128
|
+
}
|
|
3129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: PaginationComponent, decorators: [{
|
|
3130
|
+
type: Component,
|
|
3131
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, imports: [IconComponent], selector: 'ls-pagination', standalone: true, template: `
|
|
3132
|
+
<nav aria-label="pagination">
|
|
3133
|
+
<ul class="pg-list">
|
|
3134
|
+
@if (showFirstButton()) {
|
|
3135
|
+
<li>
|
|
3136
|
+
<button
|
|
3137
|
+
type="button"
|
|
3138
|
+
aria-label="first"
|
|
3139
|
+
[class]="navClasses(isFirstPage())"
|
|
3140
|
+
[disabled]="isFirstPage() || disabled()"
|
|
3141
|
+
[attr.aria-disabled]="
|
|
3142
|
+
isFirstPage() || disabled() ? 'true' : null
|
|
3143
|
+
"
|
|
3144
|
+
(click)="goToPage(1)">
|
|
3145
|
+
<ls-icon class="pg-icon-left" name="carets-down" />
|
|
3146
|
+
</button>
|
|
3147
|
+
</li>
|
|
3148
|
+
}
|
|
3149
|
+
@if (!hidePrevButton()) {
|
|
3150
|
+
<li>
|
|
3151
|
+
<button
|
|
3152
|
+
type="button"
|
|
3153
|
+
aria-label="prev"
|
|
3154
|
+
[class]="navClasses(isFirstPage())"
|
|
3155
|
+
[disabled]="isFirstPage() || disabled()"
|
|
3156
|
+
[attr.aria-disabled]="
|
|
3157
|
+
isFirstPage() || disabled() ? 'true' : null
|
|
3158
|
+
"
|
|
3159
|
+
(click)="goToPage(activePage() - 1)">
|
|
3160
|
+
<ls-icon class="pg-icon-left" name="caret-down" />
|
|
3161
|
+
</button>
|
|
3162
|
+
</li>
|
|
3163
|
+
}
|
|
3164
|
+
@for (n of pages(); track $index) {
|
|
3165
|
+
<li>
|
|
3166
|
+
<button
|
|
3167
|
+
type="button"
|
|
3168
|
+
[class]="pageItemClasses(n)"
|
|
3169
|
+
[attr.aria-current]="n === activePage() ? 'page' : null"
|
|
3170
|
+
[disabled]="disabled()"
|
|
3171
|
+
[attr.aria-disabled]="disabled() ? 'true' : null"
|
|
3172
|
+
(click)="goToPage(n)">
|
|
3173
|
+
{{ n }}
|
|
3174
|
+
</button>
|
|
3175
|
+
</li>
|
|
3176
|
+
}
|
|
3177
|
+
@if (!hideNextButton()) {
|
|
3178
|
+
<li>
|
|
3179
|
+
<button
|
|
3180
|
+
type="button"
|
|
3181
|
+
aria-label="next"
|
|
3182
|
+
[class]="navClasses(isLastPage())"
|
|
3183
|
+
[disabled]="isLastPage() || disabled()"
|
|
3184
|
+
[attr.aria-disabled]="
|
|
3185
|
+
isLastPage() || disabled() ? 'true' : null
|
|
3186
|
+
"
|
|
3187
|
+
(click)="goToPage(activePage() + 1)">
|
|
3188
|
+
<ls-icon class="pg-icon-right" name="caret-down" />
|
|
3189
|
+
</button>
|
|
3190
|
+
</li>
|
|
3191
|
+
}
|
|
3192
|
+
@if (showLastButton()) {
|
|
3193
|
+
<li>
|
|
3194
|
+
<button
|
|
3195
|
+
type="button"
|
|
3196
|
+
aria-label="last"
|
|
3197
|
+
[class]="navClasses(isLastPage())"
|
|
3198
|
+
[disabled]="isLastPage() || disabled()"
|
|
3199
|
+
[attr.aria-disabled]="
|
|
3200
|
+
isLastPage() || disabled() ? 'true' : null
|
|
3201
|
+
"
|
|
3202
|
+
(click)="goToPage(count())">
|
|
3203
|
+
<ls-icon class="pg-icon-right" name="carets-down" />
|
|
3204
|
+
</button>
|
|
3205
|
+
</li>
|
|
3206
|
+
}
|
|
3207
|
+
</ul>
|
|
3208
|
+
</nav>
|
|
3209
|
+
`, styles: [":host{display:contents}.pg-icon-left{transform:rotate(90deg)}.pg-icon-right{transform:rotate(-90deg)}.pg-list{display:inline-flex;align-items:center;gap:.25rem;list-style:none;margin:0;padding:0}.pg-item{display:inline-flex;align-items:center;justify-content:center;font-weight:600;cursor:pointer;transition:all var(--ls-transition-duration) ease;border:2px solid transparent;background:none;outline:none;font-family:var(--ls-font-family);line-height:1;-webkit-user-select:none;user-select:none}.pg-item-sm{padding:.375rem .625rem;font-size:.75rem;min-width:1.75rem;height:1.75rem}.pg-item-md{padding:.5rem .875rem;font-size:.875rem;min-width:2.25rem;height:2.25rem}.pg-item-lg{padding:.625rem 1.25rem;font-size:1rem;min-width:2.75rem;height:2.75rem}.pg-item-rounded{border-radius:var(--ls-border-radius-md)}.pg-item-circular{border-radius:var(--ls-border-radius-full);padding-inline:0}.pg-item-circular.pg-item-sm{width:1.75rem}.pg-item-circular.pg-item-md{width:2.25rem}.pg-item-circular.pg-item-lg{width:2.75rem}.pg-item-disabled,.pg-item[disabled]{cursor:not-allowed;opacity:.6}.pg-item-solid-primary{background-color:var(--ls-color-white-light);color:var(--ls-color-dark)}.pg-item-solid-primary:not([disabled]):hover{background-color:var(--ls-color-primary);color:var(--ls-color-white)}.pg-item-solid-primary.pg-item-active{background-color:var(--ls-color-primary);color:var(--ls-color-white)}.pg-item-solid-secondary{background-color:var(--ls-color-white-light);color:var(--ls-color-dark)}.pg-item-solid-secondary:not([disabled]):hover{background-color:var(--ls-color-secondary);color:var(--ls-color-white)}.pg-item-solid-secondary.pg-item-active{background-color:var(--ls-color-secondary);color:var(--ls-color-white)}.pg-item-solid-default{background-color:var(--ls-color-white-light);color:var(--ls-color-dark)}.pg-item-solid-default:not([disabled]):hover{background-color:var(--ls-color-dark);color:var(--ls-color-white)}.pg-item-solid-default.pg-item-active{background-color:var(--ls-color-dark);color:var(--ls-color-white)}.pg-item-outlined-primary{background-color:transparent;border-color:var(--ls-color-white-light);color:var(--ls-color-dark)}.pg-item-outlined-primary:not([disabled]):hover{border-color:var(--ls-color-primary);color:var(--ls-color-primary)}.pg-item-outlined-primary.pg-item-active{border-color:var(--ls-color-primary);color:var(--ls-color-primary)}.pg-item-outlined-secondary{background-color:transparent;border-color:var(--ls-color-white-light);color:var(--ls-color-dark)}.pg-item-outlined-secondary:not([disabled]):hover{border-color:var(--ls-color-secondary);color:var(--ls-color-secondary)}.pg-item-outlined-secondary.pg-item-active{border-color:var(--ls-color-secondary);color:var(--ls-color-secondary)}.pg-item-outlined-default{background-color:transparent;border-color:var(--ls-color-white-light);color:var(--ls-color-dark)}.pg-item-outlined-default:not([disabled]):hover{border-color:var(--ls-color-dark);color:var(--ls-color-dark)}.pg-item-outlined-default.pg-item-active{border-color:var(--ls-color-dark);color:var(--ls-color-dark)}.pg-item-text-primary{background-color:transparent;border-color:transparent;color:var(--ls-color-white-dark)}.pg-item-text-primary:not([disabled]):hover{background-color:#4361ee1a;color:var(--ls-color-primary)}.pg-item-text-primary.pg-item-active{color:var(--ls-color-primary)}.pg-item-text-secondary{background-color:transparent;border-color:transparent;color:var(--ls-color-white-dark)}.pg-item-text-secondary:not([disabled]):hover{background-color:#805dca1a;color:var(--ls-color-secondary)}.pg-item-text-secondary.pg-item-active{color:var(--ls-color-secondary)}.pg-item-text-default{background-color:transparent;border-color:transparent;color:var(--ls-color-white-dark)}.pg-item-text-default:not([disabled]):hover{background-color:#3b3f5c1a;color:var(--ls-color-dark)}.pg-item-text-default.pg-item-active{color:var(--ls-color-dark)}body.dark .pg-item-solid-primary,body.dark .pg-item-solid-secondary,body.dark .pg-item-solid-default{background-color:#191e3a;color:var(--ls-color-white-light)}body.dark .pg-item-solid-primary:not([disabled]):hover,body.dark .pg-item-solid-primary.pg-item-active{background-color:var(--ls-color-primary);color:var(--ls-color-white-light)}body.dark .pg-item-solid-secondary:not([disabled]):hover,body.dark .pg-item-solid-secondary.pg-item-active{background-color:var(--ls-color-secondary);color:var(--ls-color-white-light)}body.dark .pg-item-solid-default:not([disabled]):hover,body.dark .pg-item-solid-default.pg-item-active{background-color:var(--ls-color-dark);color:var(--ls-color-white-light)}body.dark .pg-item-outlined-primary,body.dark .pg-item-outlined-secondary,body.dark .pg-item-outlined-default{border-color:#191e3a;color:var(--ls-color-white-light)}body.dark .pg-item-outlined-primary:not([disabled]):hover,body.dark .pg-item-outlined-primary.pg-item-active{border-color:var(--ls-color-primary);color:var(--ls-color-white-light)}body.dark .pg-item-outlined-secondary:not([disabled]):hover,body.dark .pg-item-outlined-secondary.pg-item-active{border-color:var(--ls-color-secondary);color:var(--ls-color-white-light)}body.dark .pg-item-outlined-default:not([disabled]):hover,body.dark .pg-item-outlined-default.pg-item-active{border-color:var(--ls-color-dark);color:var(--ls-color-white-light)}body.dark .pg-item-text-primary,body.dark .pg-item-text-secondary,body.dark .pg-item-text-default{color:var(--ls-color-white-dark)}body.dark .pg-item-text-primary:not([disabled]):hover,body.dark .pg-item-text-primary.pg-item-active{color:var(--ls-color-primary)}body.dark .pg-item-text-secondary:not([disabled]):hover,body.dark .pg-item-text-secondary.pg-item-active{color:var(--ls-color-secondary)}body.dark .pg-item-text-default:not([disabled]):hover,body.dark .pg-item-text-default.pg-item-active{color:var(--ls-color-white-light)}\n"] }]
|
|
3210
|
+
}], propDecorators: { count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: false }] }], page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: false }] }], defaultPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultPage", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], showFirstButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFirstButton", required: false }] }], showLastButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLastButton", required: false }] }], hidePrevButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidePrevButton", required: false }] }], hideNextButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideNextButton", required: false }] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }] } });
|
|
3211
|
+
|
|
3212
|
+
// @lumston/ds-angular — public API surface
|
|
3213
|
+
|
|
3214
|
+
/**
|
|
3215
|
+
* Generated bundle index. Do not edit.
|
|
3216
|
+
*/
|
|
3217
|
+
|
|
3218
|
+
export { AlertComponent, AvatarComponent, AvatarGroupComponent, BadgeComponent, ButtonComponent, CheckboxComponent, ChipComponent, DropdownComponent, ICON_REGISTRY, IconButtonComponent, IconComponent, LinkComponent, LoaderComponent, LogoComponent, LsDropdownContentDirective, ModalActionsComponent, ModalComponent, ModalContentComponent, ModalStackService, ModalTitleComponent, PaginationComponent, PopoverComponent, ProgressBarComponent, RadioButtonComponent, SliderComponent, SwitchComponent, TagComponent, TextComponent, TooltipComponent };
|
|
3219
|
+
//# sourceMappingURL=lumston-ds-angular.mjs.map
|