ngx-bsl 0.0.3 → 0.0.5
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/README.md +63 -63
- package/fesm2022/ngx-bsl.mjs +1317 -16
- package/fesm2022/ngx-bsl.mjs.map +1 -1
- package/package.json +11 -5
- package/styles/_colors.scss +13 -13
- package/styles/_fonts.scss +21 -21
- package/styles/_mixins.scss +15 -0
- package/styles/components/_overlay.scss +3 -0
- package/styles/components/button.scss +53 -53
- package/styles/components/input.scss +62 -62
- package/styles/index.scss +10 -8
- package/styles/themes/_dark-theme.scss +40 -30
- package/styles/themes/_light-theme.scss +35 -30
- package/types/ngx-bsl.d.ts +306 -0
- package/index.d.ts +0 -10
package/fesm2022/ngx-bsl.mjs
CHANGED
|
@@ -1,29 +1,1330 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component } from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, input, inject, computed, output, contentChildren, ElementRef, signal, forwardRef, HostListener, Pipe, viewChild, afterNextRender, model, Renderer2, DOCUMENT, Directive } from '@angular/core';
|
|
3
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
import { CdkOverlayOrigin, CdkConnectedOverlay, Overlay } from '@angular/cdk/overlay';
|
|
5
|
+
import { CdkTrapFocus } from '@angular/cdk/a11y';
|
|
6
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
3
7
|
|
|
4
|
-
class
|
|
8
|
+
class IdGenerator {
|
|
9
|
+
id = 0;
|
|
10
|
+
nextId() {
|
|
11
|
+
return this.id++;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/*
|
|
16
|
+
eslint-disable max-len,
|
|
17
|
+
@typescript-eslint/no-extraneous-class
|
|
18
|
+
*/
|
|
19
|
+
class IconCheckComponent {
|
|
20
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconCheckComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
21
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0", type: IconCheckComponent, isStandalone: true, selector: "ngx-bsl-icon-check", ngImport: i0, template: `
|
|
22
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
23
|
+
<path d="M4 12.6111L8.92308 17.5L20 6.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
24
|
+
</svg>
|
|
25
|
+
`, isInline: true, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
26
|
+
}
|
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconCheckComponent, decorators: [{
|
|
28
|
+
type: Component,
|
|
29
|
+
args: [{ selector: 'ngx-bsl-icon-check', imports: [], template: `
|
|
30
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
31
|
+
<path d="M4 12.6111L8.92308 17.5L20 6.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
32
|
+
</svg>
|
|
33
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"] }]
|
|
34
|
+
}] });
|
|
35
|
+
|
|
36
|
+
class ListBoxOptionComponent {
|
|
37
|
+
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
38
|
+
id = input.required(...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
39
|
+
optionIdGenerator = inject(IdGenerator);
|
|
40
|
+
listBoxOptionId = computed(() => {
|
|
41
|
+
const id = this.optionIdGenerator.nextId();
|
|
42
|
+
return `${this.id()}-${id}`;
|
|
43
|
+
}, ...(ngDevMode ? [{ debugName: "listBoxOptionId" }] : []));
|
|
44
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: ListBoxOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
45
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.0", type: ListBoxOptionComponent, isStandalone: true, selector: "ngx-bsl-list-box-option", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "option" }, properties: { "attr.id": "listBoxOptionId()" } }, ngImport: i0, template: `
|
|
46
|
+
<ng-content></ng-content>
|
|
47
|
+
<ngx-bsl-icon-check></ngx-bsl-icon-check>
|
|
48
|
+
`, isInline: true, styles: [":host{position:relative;padding:.375rem 1.25rem .375rem .5rem;border-radius:4px;font:var(--bsl-font-sm);color:var(--bsl-textColor);cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host:hover,:host.visual-focus{background-color:var(--bsl-list-box-backgroundColor-hover)}:host[aria-selected=true] ngx-bsl-icon-check{display:inline;visibility:visible}:host ngx-bsl-icon-check{display:none;visibility:hidden;position:absolute;right:0;color:var(--bsl-textColor)}\n"], dependencies: [{ kind: "component", type: IconCheckComponent, selector: "ngx-bsl-icon-check" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
49
|
+
}
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: ListBoxOptionComponent, decorators: [{
|
|
51
|
+
type: Component,
|
|
52
|
+
args: [{ selector: 'ngx-bsl-list-box-option', imports: [
|
|
53
|
+
IconCheckComponent,
|
|
54
|
+
], template: `
|
|
55
|
+
<ng-content></ng-content>
|
|
56
|
+
<ngx-bsl-icon-check></ngx-bsl-icon-check>
|
|
57
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
58
|
+
'role': 'option',
|
|
59
|
+
'[attr.id]': 'listBoxOptionId()',
|
|
60
|
+
}, styles: [":host{position:relative;padding:.375rem 1.25rem .375rem .5rem;border-radius:4px;font:var(--bsl-font-sm);color:var(--bsl-textColor);cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host:hover,:host.visual-focus{background-color:var(--bsl-list-box-backgroundColor-hover)}:host[aria-selected=true] ngx-bsl-icon-check{display:inline;visibility:visible}:host ngx-bsl-icon-check{display:none;visibility:hidden;position:absolute;right:0;color:var(--bsl-textColor)}\n"] }]
|
|
61
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }] } });
|
|
62
|
+
|
|
63
|
+
class ListBoxComponent {
|
|
64
|
+
id = input.required(...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
65
|
+
ariaLabel = input(...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : []));
|
|
66
|
+
ariaLabelledby = input(...(ngDevMode ? [undefined, { debugName: "ariaLabelledby" }] : []));
|
|
67
|
+
exposeAriaActiveDescendant = input(false, ...(ngDevMode ? [{ debugName: "exposeAriaActiveDescendant" }] : []));
|
|
68
|
+
comparisonField = input(...(ngDevMode ? [undefined, { debugName: "comparisonField" }] : []));
|
|
69
|
+
initialValue = input(...(ngDevMode ? [undefined, { debugName: "initialValue" }] : []));
|
|
70
|
+
initialFocusedOptionIndex = input(null, ...(ngDevMode ? [{ debugName: "initialFocusedOptionIndex" }] : []));
|
|
71
|
+
selectOption = output();
|
|
72
|
+
listBoxOptions = contentChildren((ListBoxOptionComponent), ...(ngDevMode ? [{ debugName: "listBoxOptions" }] : []));
|
|
73
|
+
listBoxOptionRefs = contentChildren(ListBoxOptionComponent, ...(ngDevMode ? [{ debugName: "listBoxOptionRefs", descendants: true, read: (ElementRef) }] : [{ descendants: true, read: (ElementRef) }]));
|
|
74
|
+
ariaActiveDescendant = signal(null, ...(ngDevMode ? [{ debugName: "ariaActiveDescendant" }] : []));
|
|
75
|
+
onChange = (_value) => { };
|
|
76
|
+
onTouch = () => { };
|
|
77
|
+
value = null;
|
|
5
78
|
ngOnInit() {
|
|
6
|
-
|
|
79
|
+
const initialValue = this.initialValue();
|
|
80
|
+
if (initialValue) {
|
|
81
|
+
this.value = initialValue;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
ngAfterContentInit() {
|
|
85
|
+
this.initSelectedOption();
|
|
86
|
+
}
|
|
87
|
+
onClick(event) {
|
|
88
|
+
const element = event.target;
|
|
89
|
+
const isOption = element.matches('[role="option"]');
|
|
90
|
+
if (isOption) {
|
|
91
|
+
this.removeSelectedAttribute();
|
|
92
|
+
this.clearVisualFocus();
|
|
93
|
+
const optionIndex = this.listBoxOptionRefs().findIndex(o => o.nativeElement.id === element.id);
|
|
94
|
+
this.setSelectedAttribute(optionIndex);
|
|
95
|
+
this.setVisualFocus(optionIndex);
|
|
96
|
+
this.value = this.listBoxOptions()[optionIndex].value();
|
|
97
|
+
this.onChange(this.value);
|
|
98
|
+
this.selectOption.emit(this.value);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
onKeydown(event) {
|
|
102
|
+
if (event.code === 'Enter' || event.code === 'Space') {
|
|
103
|
+
event.preventDefault();
|
|
104
|
+
this.handleSelectionKeys();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (event.code === 'ArrowDown' || event.code === 'ArrowUp') {
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
this.handleArrowKeys(event);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
initSelectedOption() {
|
|
114
|
+
const optionIndex = this.listBoxOptions().findIndex(o => this.equalsToCurrentValue(o.value()));
|
|
115
|
+
if (optionIndex !== -1) {
|
|
116
|
+
this.setSelectedAttribute(optionIndex);
|
|
117
|
+
this.setVisualFocus(optionIndex);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (this.initialFocusedOptionIndex() !== null) {
|
|
121
|
+
this.setVisualFocus(this.initialFocusedOptionIndex());
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
equalsToCurrentValue(value) {
|
|
125
|
+
const comparisonField = this.comparisonField();
|
|
126
|
+
return comparisonField && this.value && typeof this.value === 'object' && comparisonField in this.value
|
|
127
|
+
? this.value[comparisonField] === value[comparisonField]
|
|
128
|
+
: this.value === value;
|
|
129
|
+
}
|
|
130
|
+
handleSelectionKeys() {
|
|
131
|
+
const optionIndex = this.getVisuallyFocusedListBoxOptionRefIndex();
|
|
132
|
+
if (optionIndex !== -1) {
|
|
133
|
+
this.removeSelectedAttribute();
|
|
134
|
+
this.setSelectedAttribute(optionIndex);
|
|
135
|
+
this.value = this.listBoxOptions()[optionIndex].value();
|
|
136
|
+
this.onChange(this.value);
|
|
137
|
+
this.selectOption.emit(this.value);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
handleArrowKeys(event) {
|
|
141
|
+
const optionIndex = this.getVisuallyFocusedListBoxOptionRefIndex();
|
|
142
|
+
const firstOption = 0;
|
|
143
|
+
const lastOption = this.listBoxOptionRefs().length - 1;
|
|
144
|
+
if (optionIndex === -1) {
|
|
145
|
+
if (event.code === 'ArrowDown') {
|
|
146
|
+
this.setVisualFocus(firstOption);
|
|
147
|
+
}
|
|
148
|
+
else if (event.code === 'ArrowUp') {
|
|
149
|
+
this.setVisualFocus(lastOption);
|
|
150
|
+
}
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
this.removeVisualFocus(optionIndex);
|
|
154
|
+
if (event.code === 'ArrowDown') {
|
|
155
|
+
if (optionIndex === lastOption) {
|
|
156
|
+
this.setVisualFocus(firstOption);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
this.setVisualFocus(optionIndex + 1);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
else if (event.code === 'ArrowUp') {
|
|
163
|
+
if (optionIndex === 0) {
|
|
164
|
+
this.setVisualFocus(lastOption);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
this.setVisualFocus(optionIndex - 1);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
getVisuallyFocusedListBoxOptionRefIndex() {
|
|
172
|
+
return this.listBoxOptionRefs().findIndex(r => r.nativeElement.classList.contains('visual-focus'));
|
|
173
|
+
}
|
|
174
|
+
setVisualFocus(optionIndex) {
|
|
175
|
+
const option = this.listBoxOptionRefs()[optionIndex];
|
|
176
|
+
option.nativeElement.classList.add('visual-focus');
|
|
177
|
+
this.ariaActiveDescendant.set(option.nativeElement.id);
|
|
178
|
+
}
|
|
179
|
+
removeVisualFocus(optionIndex) {
|
|
180
|
+
this.listBoxOptionRefs()[optionIndex].nativeElement.classList.remove('visual-focus');
|
|
181
|
+
this.ariaActiveDescendant.set(null);
|
|
182
|
+
}
|
|
183
|
+
clearVisualFocus() {
|
|
184
|
+
const optionIndex = this.getVisuallyFocusedListBoxOptionRefIndex();
|
|
185
|
+
if (optionIndex !== -1) {
|
|
186
|
+
this.removeVisualFocus(optionIndex);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
setSelectedAttribute(optionIndex) {
|
|
190
|
+
this.listBoxOptionRefs()[optionIndex].nativeElement.setAttribute('aria-selected', 'true');
|
|
191
|
+
}
|
|
192
|
+
removeSelectedAttribute() {
|
|
193
|
+
this.listBoxOptionRefs()
|
|
194
|
+
.find(o => o.nativeElement.hasAttribute('aria-selected'))
|
|
195
|
+
?.nativeElement.removeAttribute('aria-selected');
|
|
196
|
+
}
|
|
197
|
+
registerOnChange(onChange) {
|
|
198
|
+
this.onChange = onChange;
|
|
199
|
+
}
|
|
200
|
+
registerOnTouched(onTouch) {
|
|
201
|
+
this.onTouch = onTouch;
|
|
202
|
+
}
|
|
203
|
+
writeValue(value) {
|
|
204
|
+
this.value = value;
|
|
205
|
+
}
|
|
206
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: ListBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
207
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.0", type: ListBoxComponent, isStandalone: true, selector: "ngx-bsl-list-box", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null }, exposeAriaActiveDescendant: { classPropertyName: "exposeAriaActiveDescendant", publicName: "exposeAriaActiveDescendant", isSignal: true, isRequired: false, transformFunction: null }, comparisonField: { classPropertyName: "comparisonField", publicName: "comparisonField", isSignal: true, isRequired: false, transformFunction: null }, initialValue: { classPropertyName: "initialValue", publicName: "initialValue", isSignal: true, isRequired: false, transformFunction: null }, initialFocusedOptionIndex: { classPropertyName: "initialFocusedOptionIndex", publicName: "initialFocusedOptionIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectOption: "selectOption" }, host: { attributes: { "role": "listbox" }, listeners: { "click": "onClick($event)", "keydown": "onKeydown($event)" }, properties: { "attr.id": "id()", "attr.aria-label": "ariaLabel()", "attr.aria-labelledby": "ariaLabelledby()", "attr.aria-activedescendant": "exposeAriaActiveDescendant() ? null : ariaActiveDescendant()" } }, providers: [
|
|
208
|
+
IdGenerator,
|
|
209
|
+
{
|
|
210
|
+
provide: NG_VALUE_ACCESSOR,
|
|
211
|
+
useExisting: forwardRef(() => ListBoxComponent),
|
|
212
|
+
multi: true,
|
|
213
|
+
},
|
|
214
|
+
], queries: [{ propertyName: "listBoxOptions", predicate: (ListBoxOptionComponent), isSignal: true }, { propertyName: "listBoxOptionRefs", predicate: ListBoxOptionComponent, descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{width:100%;display:flex;flex-direction:column;padding:4px;border:1px solid var(--bsl-list-box-borderColor);border-radius:6px;background-color:var(--bsl-list-box-backgroundColor);overflow:hidden}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
215
|
+
}
|
|
216
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: ListBoxComponent, decorators: [{
|
|
217
|
+
type: Component,
|
|
218
|
+
args: [{ selector: 'ngx-bsl-list-box', imports: [], template: '<ng-content></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
219
|
+
IdGenerator,
|
|
220
|
+
{
|
|
221
|
+
provide: NG_VALUE_ACCESSOR,
|
|
222
|
+
useExisting: forwardRef(() => ListBoxComponent),
|
|
223
|
+
multi: true,
|
|
224
|
+
},
|
|
225
|
+
], host: {
|
|
226
|
+
'role': 'listbox',
|
|
227
|
+
'[attr.id]': 'id()',
|
|
228
|
+
'[attr.aria-label]': 'ariaLabel()',
|
|
229
|
+
'[attr.aria-labelledby]': 'ariaLabelledby()',
|
|
230
|
+
'[attr.aria-activedescendant]': 'exposeAriaActiveDescendant() ? null : ariaActiveDescendant()',
|
|
231
|
+
}, styles: [":host{width:100%;display:flex;flex-direction:column;padding:4px;border:1px solid var(--bsl-list-box-borderColor);border-radius:6px;background-color:var(--bsl-list-box-backgroundColor);overflow:hidden}\n"] }]
|
|
232
|
+
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], exposeAriaActiveDescendant: [{ type: i0.Input, args: [{ isSignal: true, alias: "exposeAriaActiveDescendant", required: false }] }], comparisonField: [{ type: i0.Input, args: [{ isSignal: true, alias: "comparisonField", required: false }] }], initialValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialValue", required: false }] }], initialFocusedOptionIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialFocusedOptionIndex", required: false }] }], selectOption: [{ type: i0.Output, args: ["selectOption"] }], listBoxOptions: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => ListBoxOptionComponent), { isSignal: true }] }], listBoxOptionRefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => ListBoxOptionComponent), { ...{ descendants: true, read: (ElementRef) }, isSignal: true }] }], onClick: [{
|
|
233
|
+
type: HostListener,
|
|
234
|
+
args: ['click', ['$event']]
|
|
235
|
+
}], onKeydown: [{
|
|
236
|
+
type: HostListener,
|
|
237
|
+
args: ['keydown', ['$event']]
|
|
238
|
+
}] } });
|
|
239
|
+
|
|
240
|
+
class ListBoxOptionValueConverterPipe {
|
|
241
|
+
transform(value, bindLabel) {
|
|
242
|
+
if (!value) {
|
|
243
|
+
return '';
|
|
244
|
+
}
|
|
245
|
+
if (typeof value === 'string') {
|
|
246
|
+
return value;
|
|
247
|
+
}
|
|
248
|
+
if (typeof value === 'number') {
|
|
249
|
+
return value.toString();
|
|
250
|
+
}
|
|
251
|
+
if (typeof value === 'object' && bindLabel) {
|
|
252
|
+
if (bindLabel in value) {
|
|
253
|
+
return value[bindLabel];
|
|
254
|
+
}
|
|
255
|
+
throw new Error('Provided label is incorrect');
|
|
256
|
+
}
|
|
257
|
+
throw new Error('Cannot parse the value');
|
|
258
|
+
}
|
|
259
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: ListBoxOptionValueConverterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
260
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.0", ngImport: i0, type: ListBoxOptionValueConverterPipe, isStandalone: true, name: "listBoxOptionValueConverter" });
|
|
261
|
+
}
|
|
262
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: ListBoxOptionValueConverterPipe, decorators: [{
|
|
263
|
+
type: Pipe,
|
|
264
|
+
args: [{ name: 'listBoxOptionValueConverter' }]
|
|
265
|
+
}] });
|
|
266
|
+
|
|
267
|
+
class ComboboxComponent {
|
|
268
|
+
id = input.required(...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
269
|
+
options = input.required(...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
270
|
+
bindLabel = input(...(ngDevMode ? [undefined, { debugName: "bindLabel" }] : []));
|
|
271
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
272
|
+
ariaLabel = input(...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : []));
|
|
273
|
+
ariaLabelledBy = input(...(ngDevMode ? [undefined, { debugName: "ariaLabelledBy" }] : []));
|
|
274
|
+
comparisonField = input(...(ngDevMode ? [undefined, { debugName: "comparisonField" }] : []));
|
|
275
|
+
confirmSelection = output();
|
|
276
|
+
listBox = viewChild(ListBoxComponent, ...(ngDevMode ? [{ debugName: "listBox" }] : []));
|
|
277
|
+
onChange = (_value) => { };
|
|
278
|
+
onTouch = () => { };
|
|
279
|
+
value = null;
|
|
280
|
+
open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
281
|
+
ariaActiveDescendant = computed(() => this.listBox()?.ariaActiveDescendant() ?? null, ...(ngDevMode ? [{ debugName: "ariaActiveDescendant" }] : []));
|
|
282
|
+
initialFocusedOptionIndex = signal(null, ...(ngDevMode ? [{ debugName: "initialFocusedOptionIndex" }] : []));
|
|
283
|
+
showListBox() {
|
|
284
|
+
this.open.set(true);
|
|
285
|
+
}
|
|
286
|
+
hideListBox() {
|
|
287
|
+
this.initialFocusedOptionIndex.set(null);
|
|
288
|
+
this.open.set(false);
|
|
289
|
+
}
|
|
290
|
+
onClick() {
|
|
291
|
+
if (this.open()) {
|
|
292
|
+
this.hideListBox();
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
this.showListBox();
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
onSelectOption(value) {
|
|
299
|
+
this.value = value;
|
|
300
|
+
this.onChange(this.value);
|
|
301
|
+
this.hideListBox();
|
|
302
|
+
}
|
|
303
|
+
onInputChange(event) {
|
|
304
|
+
const value = event.target.value;
|
|
305
|
+
if (!this.open()) {
|
|
306
|
+
this.showListBox();
|
|
307
|
+
}
|
|
308
|
+
this.value = value;
|
|
309
|
+
this.onChange(this.value);
|
|
310
|
+
}
|
|
311
|
+
onKeydown(event) {
|
|
312
|
+
event.preventDefault();
|
|
313
|
+
if (!this.open()) {
|
|
314
|
+
if (event.code === 'ArrowUp') {
|
|
315
|
+
this.initialFocusedOptionIndex.set(this.options().length - 1);
|
|
316
|
+
this.showListBox();
|
|
317
|
+
}
|
|
318
|
+
else if (event.code === 'ArrowDown') {
|
|
319
|
+
this.initialFocusedOptionIndex.set(0);
|
|
320
|
+
this.showListBox();
|
|
321
|
+
}
|
|
322
|
+
else if (event.code === 'Enter') {
|
|
323
|
+
this.confirmSelection.emit();
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
this.listBox()?.onKeydown(event);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
registerOnChange(onChange) {
|
|
331
|
+
this.onChange = onChange;
|
|
332
|
+
}
|
|
333
|
+
registerOnTouched(onTouch) {
|
|
334
|
+
this.onTouch = onTouch;
|
|
335
|
+
}
|
|
336
|
+
writeValue(value) {
|
|
337
|
+
this.value = value;
|
|
338
|
+
}
|
|
339
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: ComboboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
340
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", type: ComboboxComponent, isStandalone: true, selector: "ngx-bsl-combobox", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, bindLabel: { classPropertyName: "bindLabel", publicName: "bindLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, comparisonField: { classPropertyName: "comparisonField", publicName: "comparisonField", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { confirmSelection: "confirmSelection" }, providers: [
|
|
341
|
+
{
|
|
342
|
+
provide: NG_VALUE_ACCESSOR,
|
|
343
|
+
useExisting: forwardRef(() => ComboboxComponent),
|
|
344
|
+
multi: true,
|
|
345
|
+
},
|
|
346
|
+
], viewQueries: [{ propertyName: "listBox", first: true, predicate: ListBoxComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<input\n type=\"text\"\n role=\"combobox\"\n #comboboxInput\n cdkOverlayOrigin\n [value]=\"value | listBoxOptionValueConverter : bindLabel()\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"'list-box-' + id()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-activedescendant]=\"ariaActiveDescendant()\"\n (input)=\"onInputChange($any($event))\"\n (click)=\"onClick()\"\n (keydown.enter)=\"onKeydown($any($event))\"\n (keydown.arrowUp)=\"onKeydown($any($event))\"\n (keydown.arrowDown)=\"onKeydown($any($event))\"\n (keydown.escape)=\"hideListBox()\"\n>\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"comboboxInput\"\n [cdkConnectedOverlayOpen]=\"open()\"\n [cdkConnectedOverlayWidth]=\"comboboxInput.offsetWidth\"\n (overlayOutsideClick)=\"hideListBox()\">\n <ngx-bsl-list-box\n [initialValue]=\"value\"\n [initialFocusedOptionIndex]=\"initialFocusedOptionIndex()\"\n [comparisonField]=\"comparisonField()\"\n [id]=\"'list-box-' + id()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledby]=\"ariaLabelledBy()\"\n [exposeAriaActiveDescendant]=\"true\"\n (selectOption)=\"onSelectOption($event)\">\n @for (option of options(); track option; let index = $index) {\n <ngx-bsl-list-box-option\n [id]=\"'list-box-option-' + id()\"\n [value]=\"option\">\n <ng-container>{{ option | listBoxOptionValueConverter : bindLabel() }}</ng-container>\n </ngx-bsl-list-box-option>\n }\n </ngx-bsl-list-box>\n</ng-template>\n", dependencies: [{ kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "component", type: ListBoxComponent, selector: "ngx-bsl-list-box", inputs: ["id", "ariaLabel", "ariaLabelledby", "exposeAriaActiveDescendant", "comparisonField", "initialValue", "initialFocusedOptionIndex"], outputs: ["selectOption"] }, { kind: "component", type: ListBoxOptionComponent, selector: "ngx-bsl-list-box-option", inputs: ["value", "id"] }, { kind: "pipe", type: ListBoxOptionValueConverterPipe, name: "listBoxOptionValueConverter" }] });
|
|
347
|
+
}
|
|
348
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: ComboboxComponent, decorators: [{
|
|
349
|
+
type: Component,
|
|
350
|
+
args: [{ selector: 'ngx-bsl-combobox', imports: [
|
|
351
|
+
CdkOverlayOrigin,
|
|
352
|
+
CdkConnectedOverlay,
|
|
353
|
+
ListBoxComponent,
|
|
354
|
+
ListBoxOptionComponent,
|
|
355
|
+
ListBoxOptionValueConverterPipe,
|
|
356
|
+
], providers: [
|
|
357
|
+
{
|
|
358
|
+
provide: NG_VALUE_ACCESSOR,
|
|
359
|
+
useExisting: forwardRef(() => ComboboxComponent),
|
|
360
|
+
multi: true,
|
|
361
|
+
},
|
|
362
|
+
], template: "<input\n type=\"text\"\n role=\"combobox\"\n #comboboxInput\n cdkOverlayOrigin\n [value]=\"value | listBoxOptionValueConverter : bindLabel()\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"'list-box-' + id()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-activedescendant]=\"ariaActiveDescendant()\"\n (input)=\"onInputChange($any($event))\"\n (click)=\"onClick()\"\n (keydown.enter)=\"onKeydown($any($event))\"\n (keydown.arrowUp)=\"onKeydown($any($event))\"\n (keydown.arrowDown)=\"onKeydown($any($event))\"\n (keydown.escape)=\"hideListBox()\"\n>\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"comboboxInput\"\n [cdkConnectedOverlayOpen]=\"open()\"\n [cdkConnectedOverlayWidth]=\"comboboxInput.offsetWidth\"\n (overlayOutsideClick)=\"hideListBox()\">\n <ngx-bsl-list-box\n [initialValue]=\"value\"\n [initialFocusedOptionIndex]=\"initialFocusedOptionIndex()\"\n [comparisonField]=\"comparisonField()\"\n [id]=\"'list-box-' + id()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledby]=\"ariaLabelledBy()\"\n [exposeAriaActiveDescendant]=\"true\"\n (selectOption)=\"onSelectOption($event)\">\n @for (option of options(); track option; let index = $index) {\n <ngx-bsl-list-box-option\n [id]=\"'list-box-option-' + id()\"\n [value]=\"option\">\n <ng-container>{{ option | listBoxOptionValueConverter : bindLabel() }}</ng-container>\n </ngx-bsl-list-box-option>\n }\n </ngx-bsl-list-box>\n</ng-template>\n" }]
|
|
363
|
+
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], bindLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledBy", required: false }] }], comparisonField: [{ type: i0.Input, args: [{ isSignal: true, alias: "comparisonField", required: false }] }], confirmSelection: [{ type: i0.Output, args: ["confirmSelection"] }], listBox: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ListBoxComponent), { isSignal: true }] }] } });
|
|
364
|
+
|
|
365
|
+
class CheckboxComponent {
|
|
366
|
+
id = input.required(...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
367
|
+
checked = signal(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
368
|
+
disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
369
|
+
onChange = (_value) => { };
|
|
370
|
+
onTouch = () => { };
|
|
371
|
+
registerOnChange(onChange) {
|
|
372
|
+
this.onChange = onChange;
|
|
373
|
+
}
|
|
374
|
+
registerOnTouched(onTouch) {
|
|
375
|
+
this.onTouch = onTouch;
|
|
376
|
+
}
|
|
377
|
+
writeValue(value) {
|
|
378
|
+
this.checked.set(value);
|
|
379
|
+
}
|
|
380
|
+
setDisabledState(disabled) {
|
|
381
|
+
this.disabled.set(disabled);
|
|
382
|
+
}
|
|
383
|
+
onKeydown(event) {
|
|
384
|
+
event.preventDefault();
|
|
385
|
+
}
|
|
386
|
+
onSelect() {
|
|
387
|
+
if (this.disabled()) {
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
this.checked.set(!this.checked());
|
|
391
|
+
this.onChange(this.checked());
|
|
7
392
|
}
|
|
8
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
9
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
393
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
394
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", type: CheckboxComponent, isStandalone: true, selector: "ngx-bsl-checkbox", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "keydown.enter": "onKeydown($event)", "keydown.space": "onKeydown($event)", "click": "onSelect()", "keyup.enter": "onSelect()", "keyup.space": "onSelect()" } }, providers: [
|
|
395
|
+
{
|
|
396
|
+
provide: NG_VALUE_ACCESSOR,
|
|
397
|
+
multi: true,
|
|
398
|
+
useExisting: CheckboxComponent,
|
|
399
|
+
},
|
|
400
|
+
], ngImport: i0, template: "<span role=\"checkbox\"\n [attr.aria-checked]=\"checked()\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-labelledby]=\"id() + '-label'\"\n [id]=\"id()\"\n [tabindex]=\"disabled() ? -1 : 0\"\n class=\"checkbox\">\n @if (checked()) {\n <ngx-bsl-icon-check></ngx-bsl-icon-check>\n }\n</span>\n\n<span [id]=\"id() + '-label'\">\n <ng-content></ng-content>\n</span>\n", styles: [":host{width:fit-content;display:flex;align-items:center;gap:.5rem;font:var(--bsl-font-sm)}.checkbox{width:1rem;height:1rem;display:flex;justify-content:center;align-items:center;background-color:var(--bsl-checkbox-backgroundColor);border:1px solid var(--bsl-checkbox-borderColor);border-radius:4px;color:var(--bsl-checkbox-textColor)}.checkbox:focus-visible{outline-offset:2px}.checkbox:hover{border-color:var(--bsl-checkbox-borderColor-hover)}.checkbox.disabled{opacity:.65;cursor:not-allowed;pointer-events:none}\n"], dependencies: [{ kind: "component", type: IconCheckComponent, selector: "ngx-bsl-icon-check" }] });
|
|
14
401
|
}
|
|
15
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
402
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
16
403
|
type: Component,
|
|
17
|
-
args: [{ selector: 'ngx-bsl-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
404
|
+
args: [{ selector: 'ngx-bsl-checkbox', imports: [
|
|
405
|
+
IconCheckComponent,
|
|
406
|
+
], providers: [
|
|
407
|
+
{
|
|
408
|
+
provide: NG_VALUE_ACCESSOR,
|
|
409
|
+
multi: true,
|
|
410
|
+
useExisting: CheckboxComponent,
|
|
411
|
+
},
|
|
412
|
+
], template: "<span role=\"checkbox\"\n [attr.aria-checked]=\"checked()\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-labelledby]=\"id() + '-label'\"\n [id]=\"id()\"\n [tabindex]=\"disabled() ? -1 : 0\"\n class=\"checkbox\">\n @if (checked()) {\n <ngx-bsl-icon-check></ngx-bsl-icon-check>\n }\n</span>\n\n<span [id]=\"id() + '-label'\">\n <ng-content></ng-content>\n</span>\n", styles: [":host{width:fit-content;display:flex;align-items:center;gap:.5rem;font:var(--bsl-font-sm)}.checkbox{width:1rem;height:1rem;display:flex;justify-content:center;align-items:center;background-color:var(--bsl-checkbox-backgroundColor);border:1px solid var(--bsl-checkbox-borderColor);border-radius:4px;color:var(--bsl-checkbox-textColor)}.checkbox:focus-visible{outline-offset:2px}.checkbox:hover{border-color:var(--bsl-checkbox-borderColor-hover)}.checkbox.disabled{opacity:.65;cursor:not-allowed;pointer-events:none}\n"] }]
|
|
413
|
+
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], onKeydown: [{
|
|
414
|
+
type: HostListener,
|
|
415
|
+
args: ['keydown.enter', ['$event']]
|
|
416
|
+
}, {
|
|
417
|
+
type: HostListener,
|
|
418
|
+
args: ['keydown.space', ['$event']]
|
|
419
|
+
}], onSelect: [{
|
|
420
|
+
type: HostListener,
|
|
421
|
+
args: ['click']
|
|
422
|
+
}, {
|
|
423
|
+
type: HostListener,
|
|
424
|
+
args: ['keyup.enter']
|
|
425
|
+
}, {
|
|
426
|
+
type: HostListener,
|
|
427
|
+
args: ['keyup.space']
|
|
428
|
+
}] } });
|
|
429
|
+
|
|
430
|
+
/*
|
|
431
|
+
eslint-disable max-len,
|
|
432
|
+
@typescript-eslint/no-extraneous-class
|
|
433
|
+
*/
|
|
434
|
+
class IconXMarkComponent {
|
|
435
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconXMarkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
436
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0", type: IconXMarkComponent, isStandalone: true, selector: "ngx-bsl-icon-x-mark", ngImport: i0, template: `
|
|
437
|
+
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
438
|
+
<g clip-path="url(#clip0_20_20)" id="object-0" transform="matrix(0.5, 0, 0, 0.5, 0, 0)">
|
|
439
|
+
<path fill="currentColor" stroke="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M0.490426 0.490426C1.14433 -0.163475 2.20451 -0.163475 2.85841 0.490426L24 21.632L45.1416 0.490426C45.7955 -0.163475 46.8557 -0.163475 47.5096 0.490426C48.1635 1.14433 48.1635 2.20451 47.5096 2.85841L26.368 24L47.5096 45.1416C48.1635 45.7955 48.1635 46.8557 47.5096 47.5096C46.8557 48.1635 45.7955 48.1635 45.1416 47.5096L24 26.368L2.85841 47.5096C2.20451 48.1635 1.14433 48.1635 0.490426 47.5096C-0.163475 46.8557 -0.163475 45.7955 0.490426 45.1416L21.632 24L0.490426 2.85841C-0.163475 2.20451 -0.163475 1.14433 0.490426 0.490426Z"></path>
|
|
440
|
+
</g>
|
|
441
|
+
</svg>
|
|
442
|
+
`, isInline: true, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
443
|
+
}
|
|
444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconXMarkComponent, decorators: [{
|
|
445
|
+
type: Component,
|
|
446
|
+
args: [{ selector: 'ngx-bsl-icon-x-mark', imports: [], template: `
|
|
447
|
+
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
448
|
+
<g clip-path="url(#clip0_20_20)" id="object-0" transform="matrix(0.5, 0, 0, 0.5, 0, 0)">
|
|
449
|
+
<path fill="currentColor" stroke="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M0.490426 0.490426C1.14433 -0.163475 2.20451 -0.163475 2.85841 0.490426L24 21.632L45.1416 0.490426C45.7955 -0.163475 46.8557 -0.163475 47.5096 0.490426C48.1635 1.14433 48.1635 2.20451 47.5096 2.85841L26.368 24L47.5096 45.1416C48.1635 45.7955 48.1635 46.8557 47.5096 47.5096C46.8557 48.1635 45.7955 48.1635 45.1416 47.5096L24 26.368L2.85841 47.5096C2.20451 48.1635 1.14433 48.1635 0.490426 47.5096C-0.163475 46.8557 -0.163475 45.7955 0.490426 45.1416L21.632 24L0.490426 2.85841C-0.163475 2.20451 -0.163475 1.14433 0.490426 0.490426Z"></path>
|
|
450
|
+
</g>
|
|
451
|
+
</svg>
|
|
452
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"] }]
|
|
22
453
|
}] });
|
|
23
454
|
|
|
455
|
+
class DrawerComponent {
|
|
456
|
+
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
457
|
+
closed = output();
|
|
458
|
+
isClosed = signal(true, ...(ngDevMode ? [{ debugName: "isClosed" }] : []));
|
|
459
|
+
elementRef = inject(ElementRef);
|
|
460
|
+
constructor() {
|
|
461
|
+
afterNextRender(() => {
|
|
462
|
+
this.isClosed.set(false);
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
close() {
|
|
466
|
+
this.isClosed.set(true);
|
|
467
|
+
}
|
|
468
|
+
onTransitionEnd(event) {
|
|
469
|
+
if (this.elementRef.nativeElement === event.target) {
|
|
470
|
+
if (this.isClosed()) {
|
|
471
|
+
this.closed.emit();
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: DrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
476
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", type: DrawerComponent, isStandalone: true, selector: "ngx-bsl-drawer", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { closed: "closed" }, host: { attributes: { "role": "dialog", "aria-modal": "true" }, listeners: { "transitionend": "onTransitionEnd($event)" }, properties: { "attr.aria-label": "title()", "class.closed": "isClosed()" } }, ngImport: i0, template: "<div cdkTrapFocus\n cdkTrapFocusAutoCapture=\"true\"\n class=\"drawer-container\">\n <header>\n <button class=\"button-icon\"\n (click)=\"close()\">\n <ngx-bsl-icon-x-mark></ngx-bsl-icon-x-mark>\n </button>\n @if (title()) {\n <h2 class=\"text-ellipsis\">{{ title() }}</h2>\n }\n </header>\n <div class=\"drawer-content\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host{position:fixed;left:0;right:0;bottom:0;max-height:95vh;height:100%;transform:translateY(0);transition:transform .15s cubic-bezier(0,0,.2,1)}:host.closed{transform:translateY(100%)}.drawer-container{height:100%;padding:24px;display:flex;flex-direction:column;background-color:var(--bsl-backgroundColor);border:1px solid var(--bsl-borderColor-emphasis);border-top-left-radius:1rem;border-top-right-radius:1rem}header{margin-bottom:1rem;display:flex;justify-content:space-between;flex-direction:row-reverse}.drawer-content{overflow-y:auto;height:100%}\n"], dependencies: [{ kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: IconXMarkComponent, selector: "ngx-bsl-icon-x-mark" }] });
|
|
477
|
+
}
|
|
478
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: DrawerComponent, decorators: [{
|
|
479
|
+
type: Component,
|
|
480
|
+
args: [{ selector: 'ngx-bsl-drawer', imports: [
|
|
481
|
+
CdkTrapFocus,
|
|
482
|
+
IconXMarkComponent,
|
|
483
|
+
], host: {
|
|
484
|
+
'role': 'dialog',
|
|
485
|
+
'aria-modal': 'true',
|
|
486
|
+
'[attr.aria-label]': 'title()',
|
|
487
|
+
'[class.closed]': 'isClosed()',
|
|
488
|
+
'(transitionend)': 'onTransitionEnd($event)',
|
|
489
|
+
}, template: "<div cdkTrapFocus\n cdkTrapFocusAutoCapture=\"true\"\n class=\"drawer-container\">\n <header>\n <button class=\"button-icon\"\n (click)=\"close()\">\n <ngx-bsl-icon-x-mark></ngx-bsl-icon-x-mark>\n </button>\n @if (title()) {\n <h2 class=\"text-ellipsis\">{{ title() }}</h2>\n }\n </header>\n <div class=\"drawer-content\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host{position:fixed;left:0;right:0;bottom:0;max-height:95vh;height:100%;transform:translateY(0);transition:transform .15s cubic-bezier(0,0,.2,1)}:host.closed{transform:translateY(100%)}.drawer-container{height:100%;padding:24px;display:flex;flex-direction:column;background-color:var(--bsl-backgroundColor);border:1px solid var(--bsl-borderColor-emphasis);border-top-left-radius:1rem;border-top-right-radius:1rem}header{margin-bottom:1rem;display:flex;justify-content:space-between;flex-direction:row-reverse}.drawer-content{overflow-y:auto;height:100%}\n"] }]
|
|
490
|
+
}], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
491
|
+
|
|
492
|
+
class ListBoxGroupComponent {
|
|
493
|
+
title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
|
|
494
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: ListBoxGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
495
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", type: ListBoxGroupComponent, isStandalone: true, selector: "ngx-bsl-list-box-group", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
496
|
+
@if (title()) {
|
|
497
|
+
<div class="group-title">{{ title() }}</div>
|
|
498
|
+
}
|
|
499
|
+
<ng-content></ng-content>
|
|
500
|
+
`, isInline: true, styles: [".group-title{padding:.375rem .5rem;font:var(--bsl-font-xs);color:var(--bsl-textColor-muted);font-weight:500}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
501
|
+
}
|
|
502
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: ListBoxGroupComponent, decorators: [{
|
|
503
|
+
type: Component,
|
|
504
|
+
args: [{ selector: 'ngx-bsl-list-box-group', imports: [], template: `
|
|
505
|
+
@if (title()) {
|
|
506
|
+
<div class="group-title">{{ title() }}</div>
|
|
507
|
+
}
|
|
508
|
+
<ng-content></ng-content>
|
|
509
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".group-title{padding:.375rem .5rem;font:var(--bsl-font-xs);color:var(--bsl-textColor-muted);font-weight:500}\n"] }]
|
|
510
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }] } });
|
|
511
|
+
|
|
512
|
+
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
513
|
+
class ListBoxSeparatorComponent {
|
|
514
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: ListBoxSeparatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
515
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0", type: ListBoxSeparatorComponent, isStandalone: true, selector: "ngx-bsl-list-box-separator", ngImport: i0, template: '', isInline: true, styles: [":host{display:block;height:1px;background-color:var(--bsl-list-box-borderColor)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
516
|
+
}
|
|
517
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: ListBoxSeparatorComponent, decorators: [{
|
|
518
|
+
type: Component,
|
|
519
|
+
args: [{ selector: 'ngx-bsl-list-box-separator', imports: [], template: '', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;height:1px;background-color:var(--bsl-list-box-borderColor)}\n"] }]
|
|
520
|
+
}] });
|
|
521
|
+
|
|
522
|
+
/*
|
|
523
|
+
eslint-disable max-len,
|
|
524
|
+
@typescript-eslint/no-extraneous-class
|
|
525
|
+
*/
|
|
526
|
+
class IconChevronDownComponent {
|
|
527
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconChevronDownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
528
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0", type: IconChevronDownComponent, isStandalone: true, selector: "ngx-bsl-icon-chevron-down", ngImport: i0, template: `
|
|
529
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
530
|
+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 8 L12 16 L20 8"/>
|
|
531
|
+
</svg>
|
|
532
|
+
`, isInline: true, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
533
|
+
}
|
|
534
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconChevronDownComponent, decorators: [{
|
|
535
|
+
type: Component,
|
|
536
|
+
args: [{ selector: 'ngx-bsl-icon-chevron-down', imports: [], template: `
|
|
537
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
538
|
+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 8 L12 16 L20 8"/>
|
|
539
|
+
</svg>
|
|
540
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"] }]
|
|
541
|
+
}] });
|
|
542
|
+
|
|
543
|
+
/*
|
|
544
|
+
eslint-disable max-len,
|
|
545
|
+
@typescript-eslint/no-extraneous-class
|
|
546
|
+
*/
|
|
547
|
+
class IconCompanyComponent {
|
|
548
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconCompanyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
549
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0", type: IconCompanyComponent, isStandalone: true, selector: "ngx-bsl-icon-company", ngImport: i0, template: `
|
|
550
|
+
<svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
551
|
+
<rect width="32" height="32" stroke="none" fill="#000000" opacity="0" transform="matrix(1, 0, 0, 1, 4.440892098500626e-16, 4.440892098500626e-16)"/>
|
|
552
|
+
<g transform="matrix(2.6666669845581055, 0, 0, 2.6666669845581055, 16, 16)">
|
|
553
|
+
<path style="stroke: none; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: currentColor; fill-rule: nonzero; opacity: 1; stroke-width: 0px;" transform=" translate(-8, -8)" d="M 7.5 2 C 7.223869061895771 2.0000276089526747 7.000027608952674 2.223869061895771 7 2.5000000000000004 L 7 4 L 3.5 4 C 3.2238690618957704 4.000027608952675 3.0000276089526743 4.223869061895771 3 4.5 L 3 8 L 2.5 8 C 2.2238690618957704 8.000027608952674 2.0000276089526743 8.22386906189577 2 8.5 L 2 14 L 3 14 L 3 9 L 7 9 L 7 14 L 8 14 L 8 3 L 13 3 L 13 14 L 14 14 L 14 2.5 C 13.999972391047326 2.2238690618957704 13.77613093810423 2.0000276089526747 13.5 2 L 7.5 2 z M 9 4 L 9 5 L 10 5 L 10 4 L 9 4 z M 11 4 L 11 5 L 12 5 L 12 4 L 11 4 z M 4 5 L 7 5 L 7 8 L 4 8 L 4 5 z M 5 6 L 5 7 L 6 7 L 6 6 L 5 6 z M 9 6 L 9 7 L 10 7 L 10 6 L 9 6 z M 11 6 L 11 7 L 12 7 L 12 6 L 11 6 z M 9 8 L 9 9 L 10 9 L 10 8 L 9 8 z M 11 8 L 11 9 L 12 9 L 12 8 L 11 8 z M 4 10 L 4 11 L 6 11 L 6 10 L 4 10 z M 9 10 L 9 11 L 10 11 L 10 10 L 9 10 z M 11 10 L 11 11 L 12 11 L 12 10 L 11 10 z M 4 12 L 4 13 L 6 13 L 6 12 L 4 12 z M 9 12 L 9 13 L 10 13 L 10 12 L 9 12 z M 11 12 L 11 13 L 12 13 L 12 12 L 11 12 z" stroke-linecap="round"/>
|
|
554
|
+
</g>
|
|
555
|
+
</svg>
|
|
556
|
+
`, isInline: true, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
557
|
+
}
|
|
558
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconCompanyComponent, decorators: [{
|
|
559
|
+
type: Component,
|
|
560
|
+
args: [{ selector: 'ngx-bsl-icon-company', imports: [], template: `
|
|
561
|
+
<svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
562
|
+
<rect width="32" height="32" stroke="none" fill="#000000" opacity="0" transform="matrix(1, 0, 0, 1, 4.440892098500626e-16, 4.440892098500626e-16)"/>
|
|
563
|
+
<g transform="matrix(2.6666669845581055, 0, 0, 2.6666669845581055, 16, 16)">
|
|
564
|
+
<path style="stroke: none; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: currentColor; fill-rule: nonzero; opacity: 1; stroke-width: 0px;" transform=" translate(-8, -8)" d="M 7.5 2 C 7.223869061895771 2.0000276089526747 7.000027608952674 2.223869061895771 7 2.5000000000000004 L 7 4 L 3.5 4 C 3.2238690618957704 4.000027608952675 3.0000276089526743 4.223869061895771 3 4.5 L 3 8 L 2.5 8 C 2.2238690618957704 8.000027608952674 2.0000276089526743 8.22386906189577 2 8.5 L 2 14 L 3 14 L 3 9 L 7 9 L 7 14 L 8 14 L 8 3 L 13 3 L 13 14 L 14 14 L 14 2.5 C 13.999972391047326 2.2238690618957704 13.77613093810423 2.0000276089526747 13.5 2 L 7.5 2 z M 9 4 L 9 5 L 10 5 L 10 4 L 9 4 z M 11 4 L 11 5 L 12 5 L 12 4 L 11 4 z M 4 5 L 7 5 L 7 8 L 4 8 L 4 5 z M 5 6 L 5 7 L 6 7 L 6 6 L 5 6 z M 9 6 L 9 7 L 10 7 L 10 6 L 9 6 z M 11 6 L 11 7 L 12 7 L 12 6 L 11 6 z M 9 8 L 9 9 L 10 9 L 10 8 L 9 8 z M 11 8 L 11 9 L 12 9 L 12 8 L 11 8 z M 4 10 L 4 11 L 6 11 L 6 10 L 4 10 z M 9 10 L 9 11 L 10 11 L 10 10 L 9 10 z M 11 10 L 11 11 L 12 11 L 12 10 L 11 10 z M 4 12 L 4 13 L 6 13 L 6 12 L 4 12 z M 9 12 L 9 13 L 10 13 L 10 12 L 9 12 z M 11 12 L 11 13 L 12 13 L 12 12 L 11 12 z" stroke-linecap="round"/>
|
|
565
|
+
</g>
|
|
566
|
+
</svg>
|
|
567
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"] }]
|
|
568
|
+
}] });
|
|
569
|
+
|
|
570
|
+
/*
|
|
571
|
+
eslint-disable max-len,
|
|
572
|
+
@typescript-eslint/no-extraneous-class
|
|
573
|
+
*/
|
|
574
|
+
class IconLanguageComponent {
|
|
575
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconLanguageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
576
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0", type: IconLanguageComponent, isStandalone: true, selector: "ngx-bsl-icon-language", ngImport: i0, template: `
|
|
577
|
+
<svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
578
|
+
<ellipse style="stroke: currentColor; fill: none; stroke-width: 1.5;" cx="16" cy="16" rx="12" ry="12"/>
|
|
579
|
+
<ellipse style="stroke: currentColor; fill: none; stroke-width: 1.5;" cx="16" cy="16" rx="4.854" ry="11.903"/>
|
|
580
|
+
<path style="stroke: currentColor; stroke-width: 1.5; transform-origin: 16px 12px;" d="M 5.16 11.977 L 26.844 11.977"/>
|
|
581
|
+
<path style="stroke: currentColor; stroke-width: 1.5; transform-origin: 16px 20px;" d="M 5.16 20 L 26.844 20"/>
|
|
582
|
+
</svg>
|
|
583
|
+
`, isInline: true, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
584
|
+
}
|
|
585
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconLanguageComponent, decorators: [{
|
|
586
|
+
type: Component,
|
|
587
|
+
args: [{ selector: 'ngx-bsl-icon-language', imports: [], template: `
|
|
588
|
+
<svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
589
|
+
<ellipse style="stroke: currentColor; fill: none; stroke-width: 1.5;" cx="16" cy="16" rx="12" ry="12"/>
|
|
590
|
+
<ellipse style="stroke: currentColor; fill: none; stroke-width: 1.5;" cx="16" cy="16" rx="4.854" ry="11.903"/>
|
|
591
|
+
<path style="stroke: currentColor; stroke-width: 1.5; transform-origin: 16px 12px;" d="M 5.16 11.977 L 26.844 11.977"/>
|
|
592
|
+
<path style="stroke: currentColor; stroke-width: 1.5; transform-origin: 16px 20px;" d="M 5.16 20 L 26.844 20"/>
|
|
593
|
+
</svg>
|
|
594
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"] }]
|
|
595
|
+
}] });
|
|
596
|
+
|
|
597
|
+
/*
|
|
598
|
+
eslint-disable max-len,
|
|
599
|
+
@typescript-eslint/no-extraneous-class
|
|
600
|
+
*/
|
|
601
|
+
class IconLocationComponent {
|
|
602
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconLocationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
603
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0", type: IconLocationComponent, isStandalone: true, selector: "ngx-bsl-icon-location", ngImport: i0, template: `
|
|
604
|
+
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
605
|
+
<path fill="currentColor" d="M 12 0 C 7.583 0 4 3.583 4 8 C 4 12.418 8.666 18.668 12 24 C 15.332 18.668 20 12.418 20 8 C 20 3.583 16.418 0 12 0 Z M 12 12.668 C 10.159 12.668 8.666 11.174 8.666 9.334 C 8.666 7.491 10.159 6 12 6 C 13.841 6 15.332 7.491 15.332 9.334 C 15.332 11.174 13.841 12.668 12 12.668 Z" style="stroke-width: 0px;"/>
|
|
606
|
+
</svg>
|
|
607
|
+
`, isInline: true, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
608
|
+
}
|
|
609
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconLocationComponent, decorators: [{
|
|
610
|
+
type: Component,
|
|
611
|
+
args: [{ selector: 'ngx-bsl-icon-location', imports: [], template: `
|
|
612
|
+
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
613
|
+
<path fill="currentColor" d="M 12 0 C 7.583 0 4 3.583 4 8 C 4 12.418 8.666 18.668 12 24 C 15.332 18.668 20 12.418 20 8 C 20 3.583 16.418 0 12 0 Z M 12 12.668 C 10.159 12.668 8.666 11.174 8.666 9.334 C 8.666 7.491 10.159 6 12 6 C 13.841 6 15.332 7.491 15.332 9.334 C 15.332 11.174 13.841 12.668 12 12.668 Z" style="stroke-width: 0px;"/>
|
|
614
|
+
</svg>
|
|
615
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"] }]
|
|
616
|
+
}] });
|
|
617
|
+
|
|
618
|
+
/*
|
|
619
|
+
eslint-disable max-len,
|
|
620
|
+
@typescript-eslint/no-extraneous-class
|
|
621
|
+
*/
|
|
622
|
+
class IconMoonComponent {
|
|
623
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconMoonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
624
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0", type: IconMoonComponent, isStandalone: true, selector: "ngx-bsl-icon-moon", ngImport: i0, template: `
|
|
625
|
+
<svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
626
|
+
<path style="stroke: currentColor; stroke-width: 1.5; fill: none;" stroke-linecap="round" stroke-linejoin="round" transform="matrix(-0.7071068286895752, 0.7071068286895752, -0.7071068286895752, -0.7071068286895752, 934.2892456054688, -207.70388793945312)" d="M 801.408 479.913 A 12 12 0 1 1 801.408 502.087 A 11.598 11.598 0 0 0 801.408 479.913 Z"/>
|
|
627
|
+
</svg>
|
|
628
|
+
`, isInline: true, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
629
|
+
}
|
|
630
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconMoonComponent, decorators: [{
|
|
631
|
+
type: Component,
|
|
632
|
+
args: [{ selector: 'ngx-bsl-icon-moon', imports: [], template: `
|
|
633
|
+
<svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
634
|
+
<path style="stroke: currentColor; stroke-width: 1.5; fill: none;" stroke-linecap="round" stroke-linejoin="round" transform="matrix(-0.7071068286895752, 0.7071068286895752, -0.7071068286895752, -0.7071068286895752, 934.2892456054688, -207.70388793945312)" d="M 801.408 479.913 A 12 12 0 1 1 801.408 502.087 A 11.598 11.598 0 0 0 801.408 479.913 Z"/>
|
|
635
|
+
</svg>
|
|
636
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"] }]
|
|
637
|
+
}] });
|
|
638
|
+
|
|
639
|
+
/*
|
|
640
|
+
eslint-disable max-len,
|
|
641
|
+
@typescript-eslint/no-extraneous-class
|
|
642
|
+
*/
|
|
643
|
+
class IconSunComponent {
|
|
644
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconSunComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
645
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0", type: IconSunComponent, isStandalone: true, selector: "ngx-bsl-icon-sun", ngImport: i0, template: `
|
|
646
|
+
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
647
|
+
<path d="M16 22.6667C19.6819 22.6667 22.6667 19.6819 22.6667 16C22.6667 12.3181 19.6819 9.33334 16 9.33334C12.3181 9.33334 9.33333 12.3181 9.33333 16C9.33333 19.6819 12.3181 22.6667 16 22.6667Z" stroke="currentColor" stroke-width="2"/>
|
|
648
|
+
<path d="M16 2.66666V5.33332" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
649
|
+
<path d="M16 26.6667V29.3333" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
650
|
+
<path d="M5.33333 16H2.66667" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
651
|
+
<path d="M29.3333 16H26.6667" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
652
|
+
<path d="M26.3704 5.63022L23.4077 8.33899" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
653
|
+
<path d="M5.62956 5.63022L8.59224 8.33899" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
654
|
+
<path d="M8.59245 23.4076L5.62948 26.3705" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
655
|
+
<path d="M26.3704 26.3697L23.4077 23.4068" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
656
|
+
</svg>
|
|
657
|
+
`, isInline: true, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
658
|
+
}
|
|
659
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconSunComponent, decorators: [{
|
|
660
|
+
type: Component,
|
|
661
|
+
args: [{ selector: 'ngx-bsl-icon-sun', imports: [], template: `
|
|
662
|
+
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
663
|
+
<path d="M16 22.6667C19.6819 22.6667 22.6667 19.6819 22.6667 16C22.6667 12.3181 19.6819 9.33334 16 9.33334C12.3181 9.33334 9.33333 12.3181 9.33333 16C9.33333 19.6819 12.3181 22.6667 16 22.6667Z" stroke="currentColor" stroke-width="2"/>
|
|
664
|
+
<path d="M16 2.66666V5.33332" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
665
|
+
<path d="M16 26.6667V29.3333" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
666
|
+
<path d="M5.33333 16H2.66667" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
667
|
+
<path d="M29.3333 16H26.6667" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
668
|
+
<path d="M26.3704 5.63022L23.4077 8.33899" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
669
|
+
<path d="M5.62956 5.63022L8.59224 8.33899" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
670
|
+
<path d="M8.59245 23.4076L5.62948 26.3705" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
671
|
+
<path d="M26.3704 26.3697L23.4077 23.4068" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
672
|
+
</svg>
|
|
673
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"] }]
|
|
674
|
+
}] });
|
|
675
|
+
|
|
676
|
+
/*
|
|
677
|
+
eslint-disable max-len,
|
|
678
|
+
@typescript-eslint/no-extraneous-class
|
|
679
|
+
*/
|
|
680
|
+
class IconArrowLeftComponent {
|
|
681
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconArrowLeftComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
682
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0", type: IconArrowLeftComponent, isStandalone: true, selector: "ngx-bsl-icon-arrow-left", ngImport: i0, template: `
|
|
683
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" >
|
|
684
|
+
<path fill="currentColor" d="M 16.453 0.282 C 16.536 0.195 16.636 0.124 16.744 0.075 C 16.853 0.025 16.971 0 17.091 0 C 17.211 0 17.331 0.025 17.439 0.075 C 17.547 0.124 17.647 0.195 17.731 0.282 C 17.902 0.469 17.997 0.714 17.997 0.975 C 17.997 1.23 17.902 1.48 17.731 1.662 L 8.166 11.995 L 17.731 22.333 C 17.817 22.425 17.883 22.536 17.931 22.657 C 17.979 22.777 18.003 22.905 18 23.032 C 17.997 23.161 17.971 23.293 17.922 23.413 C 17.874 23.532 17.803 23.641 17.715 23.728 C 17.631 23.815 17.535 23.883 17.425 23.928 C 17.314 23.976 17.199 24 17.079 24 C 16.962 23.995 16.849 23.968 16.741 23.92 C 16.633 23.871 16.533 23.8 16.453 23.713 L 6.279 12.718 C 6.102 12.525 6 12.267 6 11.995 C 6 11.727 6.102 11.467 6.279 11.274 L 16.453 0.282 Z"></path>
|
|
685
|
+
</svg>
|
|
686
|
+
`, isInline: true, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
687
|
+
}
|
|
688
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconArrowLeftComponent, decorators: [{
|
|
689
|
+
type: Component,
|
|
690
|
+
args: [{ selector: 'ngx-bsl-icon-arrow-left', imports: [], template: `
|
|
691
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" >
|
|
692
|
+
<path fill="currentColor" d="M 16.453 0.282 C 16.536 0.195 16.636 0.124 16.744 0.075 C 16.853 0.025 16.971 0 17.091 0 C 17.211 0 17.331 0.025 17.439 0.075 C 17.547 0.124 17.647 0.195 17.731 0.282 C 17.902 0.469 17.997 0.714 17.997 0.975 C 17.997 1.23 17.902 1.48 17.731 1.662 L 8.166 11.995 L 17.731 22.333 C 17.817 22.425 17.883 22.536 17.931 22.657 C 17.979 22.777 18.003 22.905 18 23.032 C 17.997 23.161 17.971 23.293 17.922 23.413 C 17.874 23.532 17.803 23.641 17.715 23.728 C 17.631 23.815 17.535 23.883 17.425 23.928 C 17.314 23.976 17.199 24 17.079 24 C 16.962 23.995 16.849 23.968 16.741 23.92 C 16.633 23.871 16.533 23.8 16.453 23.713 L 6.279 12.718 C 6.102 12.525 6 12.267 6 11.995 C 6 11.727 6.102 11.467 6.279 11.274 L 16.453 0.282 Z"></path>
|
|
693
|
+
</svg>
|
|
694
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"] }]
|
|
695
|
+
}] });
|
|
696
|
+
|
|
697
|
+
/*
|
|
698
|
+
eslint-disable max-len,
|
|
699
|
+
@typescript-eslint/no-extraneous-class
|
|
700
|
+
*/
|
|
701
|
+
class IconArrowRightComponent {
|
|
702
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconArrowRightComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
703
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0", type: IconArrowRightComponent, isStandalone: true, selector: "ngx-bsl-icon-arrow-right", ngImport: i0, template: `
|
|
704
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
705
|
+
<path fill="currentColor" d="M 7.547 0.284 C 7.464 0.194 7.364 0.123 7.255 0.074 C 7.145 0.025 7.026 0 6.907 0 C 6.788 0 6.67 0.025 6.56 0.074 C 6.45 0.123 6.35 0.194 6.267 0.284 C 6.096 0.469 6.001 0.716 6.001 0.974 C 6.001 1.231 6.096 1.479 6.267 1.663 L 15.834 11.998 L 6.267 22.334 C 6.181 22.427 6.113 22.537 6.067 22.657 C 6.021 22.778 5.999 22.907 6 23.036 C 6.001 23.166 6.027 23.294 6.076 23.414 C 6.124 23.533 6.195 23.641 6.283 23.732 C 6.367 23.818 6.466 23.886 6.575 23.932 C 6.684 23.978 6.801 24.001 6.918 24 C 7.036 23.998 7.152 23.972 7.26 23.923 C 7.368 23.875 7.465 23.804 7.547 23.715 L 17.721 12.719 C 17.9 12.526 18 12.267 18 11.998 C 18 11.728 17.9 11.469 17.721 11.276 L 7.547 0.284 Z"></path>
|
|
706
|
+
</svg>
|
|
707
|
+
`, isInline: true, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
708
|
+
}
|
|
709
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconArrowRightComponent, decorators: [{
|
|
710
|
+
type: Component,
|
|
711
|
+
args: [{ selector: 'ngx-bsl-icon-arrow-right', imports: [], template: `
|
|
712
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
713
|
+
<path fill="currentColor" d="M 7.547 0.284 C 7.464 0.194 7.364 0.123 7.255 0.074 C 7.145 0.025 7.026 0 6.907 0 C 6.788 0 6.67 0.025 6.56 0.074 C 6.45 0.123 6.35 0.194 6.267 0.284 C 6.096 0.469 6.001 0.716 6.001 0.974 C 6.001 1.231 6.096 1.479 6.267 1.663 L 15.834 11.998 L 6.267 22.334 C 6.181 22.427 6.113 22.537 6.067 22.657 C 6.021 22.778 5.999 22.907 6 23.036 C 6.001 23.166 6.027 23.294 6.076 23.414 C 6.124 23.533 6.195 23.641 6.283 23.732 C 6.367 23.818 6.466 23.886 6.575 23.932 C 6.684 23.978 6.801 24.001 6.918 24 C 7.036 23.998 7.152 23.972 7.26 23.923 C 7.368 23.875 7.465 23.804 7.547 23.715 L 17.721 12.719 C 17.9 12.526 18 12.267 18 11.998 C 18 11.728 17.9 11.469 17.721 11.276 L 7.547 0.284 Z"></path>
|
|
714
|
+
</svg>
|
|
715
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"] }]
|
|
716
|
+
}] });
|
|
717
|
+
|
|
718
|
+
/*
|
|
719
|
+
eslint-disable max-len,
|
|
720
|
+
@typescript-eslint/no-extraneous-class
|
|
721
|
+
*/
|
|
722
|
+
class IconArrowLeftDoubleComponent {
|
|
723
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconArrowLeftDoubleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
724
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0", type: IconArrowLeftDoubleComponent, isStandalone: true, selector: "ngx-bsl-icon-arrow-left-double", ngImport: i0, template: `
|
|
725
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
726
|
+
<path fill="currentColor" d="M 12.529 0.284 C 12.614 0.194 12.714 0.123 12.825 0.074 C 12.936 0.025 13.055 0 13.175 0 C 13.295 0 13.414 0.025 13.524 0.074 C 13.636 0.123 13.736 0.194 13.82 0.284 C 13.992 0.469 14.087 0.716 14.087 0.974 C 14.087 1.232 13.992 1.479 13.82 1.664 L 4.181 11.998 L 13.82 22.334 C 13.906 22.427 13.975 22.537 14.021 22.657 C 14.067 22.778 14.089 22.907 14.088 23.037 C 14.087 23.166 14.061 23.295 14.013 23.414 C 13.963 23.533 13.893 23.641 13.803 23.732 C 13.719 23.818 13.619 23.887 13.509 23.933 C 13.399 23.979 13.282 24.001 13.163 24 C 13.045 23.998 12.928 23.972 12.82 23.924 C 12.711 23.875 12.613 23.804 12.529 23.715 L 2.281 12.72 C 2.101 12.526 2 12.268 2 11.998 C 2 11.728 2.101 11.469 2.281 11.276 L 12.529 0.284 Z M 20.441 0.284 C 20.525 0.194 20.625 0.123 20.736 0.074 C 20.847 0.025 20.966 0 21.086 0 C 21.206 0 21.325 0.025 21.436 0.074 C 21.546 0.123 21.647 0.194 21.729 0.284 C 21.903 0.469 21.999 0.716 21.999 0.974 C 21.999 1.232 21.903 1.479 21.729 1.664 L 12.093 11.998 L 21.729 22.334 C 21.818 22.427 21.886 22.537 21.933 22.657 C 21.978 22.778 22.001 22.907 22 23.037 C 21.999 23.166 21.973 23.295 21.923 23.414 C 21.875 23.533 21.804 23.641 21.715 23.732 C 21.629 23.818 21.529 23.887 21.42 23.933 C 21.309 23.979 21.194 24.001 21.075 24 C 20.957 23.998 20.84 23.972 20.729 23.924 C 20.622 23.875 20.524 23.804 20.441 23.715 L 10.193 12.72 C 10.013 12.526 9.912 12.268 9.912 11.998 C 9.912 11.728 10.013 11.469 10.193 11.276 L 20.441 0.284 Z"></path>
|
|
727
|
+
</svg>
|
|
728
|
+
`, isInline: true, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
729
|
+
}
|
|
730
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconArrowLeftDoubleComponent, decorators: [{
|
|
731
|
+
type: Component,
|
|
732
|
+
args: [{ selector: 'ngx-bsl-icon-arrow-left-double', imports: [], template: `
|
|
733
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
734
|
+
<path fill="currentColor" d="M 12.529 0.284 C 12.614 0.194 12.714 0.123 12.825 0.074 C 12.936 0.025 13.055 0 13.175 0 C 13.295 0 13.414 0.025 13.524 0.074 C 13.636 0.123 13.736 0.194 13.82 0.284 C 13.992 0.469 14.087 0.716 14.087 0.974 C 14.087 1.232 13.992 1.479 13.82 1.664 L 4.181 11.998 L 13.82 22.334 C 13.906 22.427 13.975 22.537 14.021 22.657 C 14.067 22.778 14.089 22.907 14.088 23.037 C 14.087 23.166 14.061 23.295 14.013 23.414 C 13.963 23.533 13.893 23.641 13.803 23.732 C 13.719 23.818 13.619 23.887 13.509 23.933 C 13.399 23.979 13.282 24.001 13.163 24 C 13.045 23.998 12.928 23.972 12.82 23.924 C 12.711 23.875 12.613 23.804 12.529 23.715 L 2.281 12.72 C 2.101 12.526 2 12.268 2 11.998 C 2 11.728 2.101 11.469 2.281 11.276 L 12.529 0.284 Z M 20.441 0.284 C 20.525 0.194 20.625 0.123 20.736 0.074 C 20.847 0.025 20.966 0 21.086 0 C 21.206 0 21.325 0.025 21.436 0.074 C 21.546 0.123 21.647 0.194 21.729 0.284 C 21.903 0.469 21.999 0.716 21.999 0.974 C 21.999 1.232 21.903 1.479 21.729 1.664 L 12.093 11.998 L 21.729 22.334 C 21.818 22.427 21.886 22.537 21.933 22.657 C 21.978 22.778 22.001 22.907 22 23.037 C 21.999 23.166 21.973 23.295 21.923 23.414 C 21.875 23.533 21.804 23.641 21.715 23.732 C 21.629 23.818 21.529 23.887 21.42 23.933 C 21.309 23.979 21.194 24.001 21.075 24 C 20.957 23.998 20.84 23.972 20.729 23.924 C 20.622 23.875 20.524 23.804 20.441 23.715 L 10.193 12.72 C 10.013 12.526 9.912 12.268 9.912 11.998 C 9.912 11.728 10.013 11.469 10.193 11.276 L 20.441 0.284 Z"></path>
|
|
735
|
+
</svg>
|
|
736
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"] }]
|
|
737
|
+
}] });
|
|
738
|
+
|
|
739
|
+
/*
|
|
740
|
+
eslint-disable max-len,
|
|
741
|
+
@typescript-eslint/no-extraneous-class
|
|
742
|
+
*/
|
|
743
|
+
class IconArrowRightDoubleComponent {
|
|
744
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconArrowRightDoubleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
745
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0", type: IconArrowRightDoubleComponent, isStandalone: true, selector: "ngx-bsl-icon-arrow-right-double", ngImport: i0, template: `
|
|
746
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
747
|
+
<path fill="currentColor" d="M 12.523 0.284 C 12.448 0.194 12.358 0.123 12.257 0.074 C 12.158 0.025 12.051 0 11.943 0 C 11.835 0 11.728 0.025 11.628 0.074 C 11.528 0.123 11.438 0.194 11.362 0.284 C 11.208 0.469 11.121 0.716 11.121 0.974 C 11.121 1.232 11.208 1.479 11.362 1.664 L 20.037 11.998 L 11.362 22.334 C 11.284 22.427 11.223 22.537 11.181 22.657 C 11.139 22.778 11.119 22.907 11.12 23.037 C 11.121 23.166 11.145 23.295 11.189 23.414 C 11.233 23.533 11.297 23.641 11.376 23.732 C 11.453 23.818 11.543 23.887 11.641 23.933 C 11.741 23.979 11.846 24.001 11.953 24 C 12.059 23.998 12.164 23.972 12.262 23.924 C 12.361 23.875 12.449 23.804 12.523 23.715 L 21.747 12.72 C 21.909 12.526 22 12.268 22 11.998 C 22 11.728 21.909 11.469 21.747 11.276 L 12.523 0.284 Z M 5.403 0.284 C 5.327 0.194 5.237 0.123 5.138 0.074 C 5.037 0.025 4.93 0 4.822 0 C 4.714 0 4.607 0.025 4.508 0.074 C 4.408 0.123 4.317 0.194 4.243 0.284 C 4.087 0.469 4.001 0.716 4.001 0.974 C 4.001 1.232 4.087 1.479 4.243 1.664 L 12.917 11.998 L 4.243 22.334 C 4.164 22.427 4.102 22.537 4.061 22.657 C 4.02 22.778 3.999 22.907 4 23.037 C 4.001 23.166 4.025 23.295 4.069 23.414 C 4.113 23.533 4.176 23.641 4.257 23.732 C 4.333 23.818 4.423 23.887 4.522 23.933 C 4.621 23.979 4.726 24.001 4.833 24 C 4.939 23.998 5.044 23.972 5.143 23.924 C 5.24 23.875 5.328 23.804 5.403 23.715 L 14.627 12.72 C 14.789 12.526 14.88 12.268 14.88 11.998 C 14.88 11.728 14.789 11.469 14.627 11.276 L 5.403 0.284 Z"></path>
|
|
748
|
+
</svg>
|
|
749
|
+
`, isInline: true, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
750
|
+
}
|
|
751
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: IconArrowRightDoubleComponent, decorators: [{
|
|
752
|
+
type: Component,
|
|
753
|
+
args: [{ selector: 'ngx-bsl-icon-arrow-right-double', imports: [], template: `
|
|
754
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
755
|
+
<path fill="currentColor" d="M 12.523 0.284 C 12.448 0.194 12.358 0.123 12.257 0.074 C 12.158 0.025 12.051 0 11.943 0 C 11.835 0 11.728 0.025 11.628 0.074 C 11.528 0.123 11.438 0.194 11.362 0.284 C 11.208 0.469 11.121 0.716 11.121 0.974 C 11.121 1.232 11.208 1.479 11.362 1.664 L 20.037 11.998 L 11.362 22.334 C 11.284 22.427 11.223 22.537 11.181 22.657 C 11.139 22.778 11.119 22.907 11.12 23.037 C 11.121 23.166 11.145 23.295 11.189 23.414 C 11.233 23.533 11.297 23.641 11.376 23.732 C 11.453 23.818 11.543 23.887 11.641 23.933 C 11.741 23.979 11.846 24.001 11.953 24 C 12.059 23.998 12.164 23.972 12.262 23.924 C 12.361 23.875 12.449 23.804 12.523 23.715 L 21.747 12.72 C 21.909 12.526 22 12.268 22 11.998 C 22 11.728 21.909 11.469 21.747 11.276 L 12.523 0.284 Z M 5.403 0.284 C 5.327 0.194 5.237 0.123 5.138 0.074 C 5.037 0.025 4.93 0 4.822 0 C 4.714 0 4.607 0.025 4.508 0.074 C 4.408 0.123 4.317 0.194 4.243 0.284 C 4.087 0.469 4.001 0.716 4.001 0.974 C 4.001 1.232 4.087 1.479 4.243 1.664 L 12.917 11.998 L 4.243 22.334 C 4.164 22.427 4.102 22.537 4.061 22.657 C 4.02 22.778 3.999 22.907 4 23.037 C 4.001 23.166 4.025 23.295 4.069 23.414 C 4.113 23.533 4.176 23.641 4.257 23.732 C 4.333 23.818 4.423 23.887 4.522 23.933 C 4.621 23.979 4.726 24.001 4.833 24 C 4.939 23.998 5.044 23.972 5.143 23.924 C 5.24 23.875 5.328 23.804 5.403 23.715 L 14.627 12.72 C 14.789 12.526 14.88 12.268 14.88 11.998 C 14.88 11.728 14.789 11.469 14.627 11.276 L 5.403 0.284 Z"></path>
|
|
756
|
+
</svg>
|
|
757
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-flex;justify-content:center;align-items:center}:host svg{width:1rem;height:1rem}\n"] }]
|
|
758
|
+
}] });
|
|
759
|
+
|
|
760
|
+
class PaginationComponent {
|
|
761
|
+
page = model(1, ...(ngDevMode ? [{ debugName: "page" }] : []));
|
|
762
|
+
total = input(1, ...(ngDevMode ? [{ debugName: "total" }] : []));
|
|
763
|
+
size = input(10, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
764
|
+
nextPageAriaLabel = input('Next page', ...(ngDevMode ? [{ debugName: "nextPageAriaLabel" }] : []));
|
|
765
|
+
previousPageAriaLabel = input('Previous page', ...(ngDevMode ? [{ debugName: "previousPageAriaLabel" }] : []));
|
|
766
|
+
firstPageAriaLabel = input('First page', ...(ngDevMode ? [{ debugName: "firstPageAriaLabel" }] : []));
|
|
767
|
+
lastPageAriaLabel = input('Last page', ...(ngDevMode ? [{ debugName: "lastPageAriaLabel" }] : []));
|
|
768
|
+
selectPageAriaLabel = input('Select page', ...(ngDevMode ? [{ debugName: "selectPageAriaLabel" }] : []));
|
|
769
|
+
selectPageAriaLabelledBy = input(null, ...(ngDevMode ? [{ debugName: "selectPageAriaLabelledBy" }] : []));
|
|
770
|
+
pageChanged = output();
|
|
771
|
+
inputRef = viewChild.required('inputRef');
|
|
772
|
+
pages = computed(() => Math.ceil(this.total() / this.size()), ...(ngDevMode ? [{ debugName: "pages" }] : []));
|
|
773
|
+
disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
774
|
+
onInputBlur(value) {
|
|
775
|
+
if (isNaN(value) || value < -1) {
|
|
776
|
+
this.page.set(1);
|
|
777
|
+
this.inputRef().nativeElement.value = this.page().toString();
|
|
778
|
+
}
|
|
779
|
+
else if (value > this.pages()) {
|
|
780
|
+
this.page.set(this.pages());
|
|
781
|
+
this.inputRef().nativeElement.value = this.page().toString();
|
|
782
|
+
}
|
|
783
|
+
else {
|
|
784
|
+
this.page.set(value);
|
|
785
|
+
}
|
|
786
|
+
this.pageChanged.emit(this.page());
|
|
787
|
+
}
|
|
788
|
+
onInputEnter() {
|
|
789
|
+
this.pageChanged.emit(this.page());
|
|
790
|
+
}
|
|
791
|
+
onNextPage(event) {
|
|
792
|
+
if (this.page() < this.pages()) {
|
|
793
|
+
this.page.update(value => value + 1);
|
|
794
|
+
}
|
|
795
|
+
if (event.pointerType === '' && this.page() === this.pages()) {
|
|
796
|
+
this.inputRef().nativeElement.focus();
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
onPreviousPage(event) {
|
|
800
|
+
if (this.page() > 1) {
|
|
801
|
+
this.page.update(value => value - 1);
|
|
802
|
+
}
|
|
803
|
+
if (event.pointerType === '' && this.page() === 1) {
|
|
804
|
+
this.inputRef().nativeElement.focus();
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
onFirstPage(event) {
|
|
808
|
+
this.page.set(1);
|
|
809
|
+
if (event.pointerType === '') {
|
|
810
|
+
this.inputRef().nativeElement.focus();
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
onLastPage(event) {
|
|
814
|
+
this.page.set(this.pages());
|
|
815
|
+
if (event.pointerType === '') {
|
|
816
|
+
this.inputRef().nativeElement.focus();
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
820
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.0", type: PaginationComponent, isStandalone: true, selector: "ngx-bsl-pagination", inputs: { page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, nextPageAriaLabel: { classPropertyName: "nextPageAriaLabel", publicName: "nextPageAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, previousPageAriaLabel: { classPropertyName: "previousPageAriaLabel", publicName: "previousPageAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, firstPageAriaLabel: { classPropertyName: "firstPageAriaLabel", publicName: "firstPageAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, lastPageAriaLabel: { classPropertyName: "lastPageAriaLabel", publicName: "lastPageAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, selectPageAriaLabel: { classPropertyName: "selectPageAriaLabel", publicName: "selectPageAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, selectPageAriaLabelledBy: { classPropertyName: "selectPageAriaLabelledBy", publicName: "selectPageAriaLabelledBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { page: "pageChange", pageChanged: "pageChanged" }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<button\n type=\"button\"\n class=\"button-icon\"\n [attr.aria-label]=\"firstPageAriaLabel()\"\n [disabled]=\"disabled() || page() === 1\"\n (click)=\"onFirstPage($any($event))\">\n <ngx-bsl-icon-arrow-left-double></ngx-bsl-icon-arrow-left-double>\n</button>\n\n<button\n type=\"button\"\n class=\"button-icon\"\n [attr.aria-label]=\"previousPageAriaLabel()\"\n [disabled]=\"disabled() || page() === 1\"\n (click)=\"onPreviousPage($any($event))\">\n <ngx-bsl-icon-arrow-left></ngx-bsl-icon-arrow-left>\n</button>\n\n<input\n type=\"number\"\n [attr.aria-label]=\"selectPageAriaLabel()\"\n [attr.aria-labelledby]=\"selectPageAriaLabelledBy()\"\n [disabled]=\"disabled()\"\n [min]=\"1\"\n [max]=\"pages()\"\n [value]=\"page()\"\n (blur)=\"onInputBlur($any($event.target).valueAsNumber)\"\n (keydown.enter)=\"onInputEnter()\">\n\n<button\n type=\"button\"\n class=\"button-icon\"\n [attr.aria-label]=\"nextPageAriaLabel()\"\n [disabled]=\"disabled() || page() === pages()\"\n (click)=\"onNextPage($any($event))\">\n <ngx-bsl-icon-arrow-right></ngx-bsl-icon-arrow-right>\n</button>\n\n<button\n type=\"button\"\n class=\"button-icon\"\n [attr.aria-label]=\"lastPageAriaLabel()\"\n [disabled]=\"disabled() || page() === pages()\"\n (click)=\"onLastPage($any($event))\">\n <ngx-bsl-icon-arrow-right-double></ngx-bsl-icon-arrow-right-double>\n</button>\n", styles: [":host{display:flex;justify-content:center;align-items:center;gap:12px}:host input{width:3.5rem;height:2.25rem;padding:.5rem;text-align:center}\n"], dependencies: [{ kind: "component", type: IconArrowLeftComponent, selector: "ngx-bsl-icon-arrow-left" }, { kind: "component", type: IconArrowRightComponent, selector: "ngx-bsl-icon-arrow-right" }, { kind: "component", type: IconArrowLeftDoubleComponent, selector: "ngx-bsl-icon-arrow-left-double" }, { kind: "component", type: IconArrowRightDoubleComponent, selector: "ngx-bsl-icon-arrow-right-double" }] });
|
|
821
|
+
}
|
|
822
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: PaginationComponent, decorators: [{
|
|
823
|
+
type: Component,
|
|
824
|
+
args: [{ selector: 'ngx-bsl-pagination', imports: [
|
|
825
|
+
IconArrowLeftComponent,
|
|
826
|
+
IconArrowRightComponent,
|
|
827
|
+
IconArrowLeftDoubleComponent,
|
|
828
|
+
IconArrowRightDoubleComponent,
|
|
829
|
+
], template: "<button\n type=\"button\"\n class=\"button-icon\"\n [attr.aria-label]=\"firstPageAriaLabel()\"\n [disabled]=\"disabled() || page() === 1\"\n (click)=\"onFirstPage($any($event))\">\n <ngx-bsl-icon-arrow-left-double></ngx-bsl-icon-arrow-left-double>\n</button>\n\n<button\n type=\"button\"\n class=\"button-icon\"\n [attr.aria-label]=\"previousPageAriaLabel()\"\n [disabled]=\"disabled() || page() === 1\"\n (click)=\"onPreviousPage($any($event))\">\n <ngx-bsl-icon-arrow-left></ngx-bsl-icon-arrow-left>\n</button>\n\n<input\n type=\"number\"\n [attr.aria-label]=\"selectPageAriaLabel()\"\n [attr.aria-labelledby]=\"selectPageAriaLabelledBy()\"\n [disabled]=\"disabled()\"\n [min]=\"1\"\n [max]=\"pages()\"\n [value]=\"page()\"\n (blur)=\"onInputBlur($any($event.target).valueAsNumber)\"\n (keydown.enter)=\"onInputEnter()\">\n\n<button\n type=\"button\"\n class=\"button-icon\"\n [attr.aria-label]=\"nextPageAriaLabel()\"\n [disabled]=\"disabled() || page() === pages()\"\n (click)=\"onNextPage($any($event))\">\n <ngx-bsl-icon-arrow-right></ngx-bsl-icon-arrow-right>\n</button>\n\n<button\n type=\"button\"\n class=\"button-icon\"\n [attr.aria-label]=\"lastPageAriaLabel()\"\n [disabled]=\"disabled() || page() === pages()\"\n (click)=\"onLastPage($any($event))\">\n <ngx-bsl-icon-arrow-right-double></ngx-bsl-icon-arrow-right-double>\n</button>\n", styles: [":host{display:flex;justify-content:center;align-items:center;gap:12px}:host input{width:3.5rem;height:2.25rem;padding:.5rem;text-align:center}\n"] }]
|
|
830
|
+
}], propDecorators: { page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: false }] }, { type: i0.Output, args: ["pageChange"] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], nextPageAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextPageAriaLabel", required: false }] }], previousPageAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousPageAriaLabel", required: false }] }], firstPageAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstPageAriaLabel", required: false }] }], lastPageAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "lastPageAriaLabel", required: false }] }], selectPageAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectPageAriaLabel", required: false }] }], selectPageAriaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectPageAriaLabelledBy", required: false }] }], pageChanged: [{ type: i0.Output, args: ["pageChanged"] }], inputRef: [{ type: i0.ViewChild, args: ['inputRef', { isSignal: true }] }] } });
|
|
831
|
+
|
|
832
|
+
var RangeMoveDirection;
|
|
833
|
+
(function (RangeMoveDirection) {
|
|
834
|
+
RangeMoveDirection["FORWARD"] = "forward";
|
|
835
|
+
RangeMoveDirection["BACKWARD"] = "backward";
|
|
836
|
+
})(RangeMoveDirection || (RangeMoveDirection = {}));
|
|
837
|
+
|
|
838
|
+
class RangeThumbComponent {
|
|
839
|
+
renderer = inject(Renderer2);
|
|
840
|
+
document = inject(DOCUMENT);
|
|
841
|
+
elementRef = inject((ElementRef));
|
|
842
|
+
ratio = input(0, ...(ngDevMode ? [{ debugName: "ratio" }] : []));
|
|
843
|
+
value = input(0, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
844
|
+
showLabel = input(false, ...(ngDevMode ? [{ debugName: "showLabel" }] : []));
|
|
845
|
+
positionChanged = output();
|
|
846
|
+
RangeMoveDirection = RangeMoveDirection;
|
|
847
|
+
pointerUpListener = null;
|
|
848
|
+
pointerMoveListener = null;
|
|
849
|
+
onPointerDown(event) {
|
|
850
|
+
this.elementRef.nativeElement.setPointerCapture(event.pointerId);
|
|
851
|
+
this.pointerUpListener = this.renderer.listen(this.document, 'pointerup', this.onPointerUp.bind(this));
|
|
852
|
+
this.pointerMoveListener = this.renderer.listen(this.document, 'pointermove', this.onPointerMove.bind(this));
|
|
853
|
+
}
|
|
854
|
+
onPointerUp(event) {
|
|
855
|
+
this.elementRef.nativeElement.releasePointerCapture(event.pointerId);
|
|
856
|
+
this.disposePointerUpListener();
|
|
857
|
+
this.disposePointerMoveListener();
|
|
858
|
+
}
|
|
859
|
+
onPointerMove(event) {
|
|
860
|
+
const thumbPositionLeft = this.elementRef.nativeElement.getBoundingClientRect().left;
|
|
861
|
+
const thumbWidth = this.elementRef.nativeElement.offsetWidth;
|
|
862
|
+
const thumbPositionCenter = thumbPositionLeft + thumbWidth / 2;
|
|
863
|
+
const pointerPosition = event.pageX;
|
|
864
|
+
if (pointerPosition > thumbPositionCenter + this.ratio() / 2) {
|
|
865
|
+
this.positionChanged.emit(RangeMoveDirection.FORWARD);
|
|
866
|
+
}
|
|
867
|
+
else if (pointerPosition <= thumbPositionCenter - this.ratio() / 2) {
|
|
868
|
+
this.positionChanged.emit(RangeMoveDirection.BACKWARD);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
disposePointerUpListener() {
|
|
872
|
+
if (this.pointerUpListener) {
|
|
873
|
+
this.pointerUpListener();
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
disposePointerMoveListener() {
|
|
877
|
+
if (this.pointerMoveListener) {
|
|
878
|
+
this.pointerMoveListener();
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
ngOnDestroy() {
|
|
882
|
+
this.disposePointerUpListener();
|
|
883
|
+
this.disposePointerMoveListener();
|
|
884
|
+
}
|
|
885
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: RangeThumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
886
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", type: RangeThumbComponent, isStandalone: true, selector: "ngx-bsl-range-thumb", inputs: { ratio: { classPropertyName: "ratio", publicName: "ratio", 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 } }, outputs: { positionChanged: "positionChanged" }, host: { listeners: { "keydown.arrowLeft": "positionChanged.emit(RangeMoveDirection.BACKWARD)", "keydown.arrowRight": "positionChanged.emit(RangeMoveDirection.FORWARD)", "pointerdown": "onPointerDown($event)" } }, ngImport: i0, template: `
|
|
887
|
+
@if (showLabel()) {
|
|
888
|
+
<span class="thumb-label">{{value()}}</span>
|
|
889
|
+
}
|
|
890
|
+
`, isInline: true, styles: [":host{position:absolute;width:.75rem;height:.75rem;border-radius:.375rem;background-color:var(--bsl-range-thumb-backgroundColor);cursor:pointer;touch-action:none}:host .thumb-label{position:absolute;bottom:100%;left:50%;transform:translate(-50%);font:var(--bsl-font-sm)}:host.disabled{opacity:.65;cursor:not-allowed;pointer-events:none}\n"] });
|
|
891
|
+
}
|
|
892
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: RangeThumbComponent, decorators: [{
|
|
893
|
+
type: Component,
|
|
894
|
+
args: [{ selector: 'ngx-bsl-range-thumb', imports: [], template: `
|
|
895
|
+
@if (showLabel()) {
|
|
896
|
+
<span class="thumb-label">{{value()}}</span>
|
|
897
|
+
}
|
|
898
|
+
`, host: {
|
|
899
|
+
'(keydown.arrowLeft)': 'positionChanged.emit(RangeMoveDirection.BACKWARD)',
|
|
900
|
+
'(keydown.arrowRight)': 'positionChanged.emit(RangeMoveDirection.FORWARD)',
|
|
901
|
+
'(pointerdown)': 'onPointerDown($event)',
|
|
902
|
+
}, styles: [":host{position:absolute;width:.75rem;height:.75rem;border-radius:.375rem;background-color:var(--bsl-range-thumb-backgroundColor);cursor:pointer;touch-action:none}:host .thumb-label{position:absolute;bottom:100%;left:50%;transform:translate(-50%);font:var(--bsl-font-sm)}:host.disabled{opacity:.65;cursor:not-allowed;pointer-events:none}\n"] }]
|
|
903
|
+
}], propDecorators: { ratio: [{ type: i0.Input, args: [{ isSignal: true, alias: "ratio", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], positionChanged: [{ type: i0.Output, args: ["positionChanged"] }] } });
|
|
904
|
+
|
|
905
|
+
function round(value, digits = 0) {
|
|
906
|
+
return parseFloat(value.toFixed(digits));
|
|
907
|
+
}
|
|
908
|
+
function getDigitsNumber(value) {
|
|
909
|
+
return String(value).split('.')[1]?.length || 0;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
class Range {
|
|
913
|
+
from;
|
|
914
|
+
to;
|
|
915
|
+
constructor(from = 0, to = 10) {
|
|
916
|
+
this.from = from;
|
|
917
|
+
this.to = to;
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
var Thumb;
|
|
921
|
+
(function (Thumb) {
|
|
922
|
+
Thumb["FROM"] = "from";
|
|
923
|
+
Thumb["TO"] = "to";
|
|
924
|
+
})(Thumb || (Thumb = {}));
|
|
925
|
+
class RangeComponent {
|
|
926
|
+
elementRef = inject((ElementRef));
|
|
927
|
+
min = input(0, ...(ngDevMode ? [{ debugName: "min" }] : []));
|
|
928
|
+
max = input(5, ...(ngDevMode ? [{ debugName: "max" }] : []));
|
|
929
|
+
step = input(1, ...(ngDevMode ? [{ debugName: "step" }] : []));
|
|
930
|
+
value = model(new Range(0, 5), ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
931
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel", alias: 'aria-label' }] : [{ alias: 'aria-label' }]));
|
|
932
|
+
ariaLabelledBy = input(null, ...(ngDevMode ? [{ debugName: "ariaLabelledBy", alias: 'aria-labelledby' }] : [{ alias: 'aria-labelledby' }]));
|
|
933
|
+
showThumbLabels = input(false, ...(ngDevMode ? [{ debugName: "showThumbLabels" }] : []));
|
|
934
|
+
thumbFromRef = viewChild.required('thumbFrom', { read: (ElementRef) });
|
|
935
|
+
thumbToRef = viewChild.required('thumbTo', { read: (ElementRef) });
|
|
936
|
+
_step = signal(1, ...(ngDevMode ? [{ debugName: "_step" }] : []));
|
|
937
|
+
disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
938
|
+
ratio = signal(0, ...(ngDevMode ? [{ debugName: "ratio" }] : []));
|
|
939
|
+
thumbFromPosition = signal(0, ...(ngDevMode ? [{ debugName: "thumbFromPosition" }] : []));
|
|
940
|
+
thumbToPosition = signal(0, ...(ngDevMode ? [{ debugName: "thumbToPosition" }] : []));
|
|
941
|
+
overlappingThumb = signal(Thumb.FROM, ...(ngDevMode ? [{ debugName: "overlappingThumb" }] : []));
|
|
942
|
+
stepDigits = computed(() => getDigitsNumber(this._step()), ...(ngDevMode ? [{ debugName: "stepDigits" }] : []));
|
|
943
|
+
thumbWidth = computed(() => this.thumbFromRef().nativeElement.offsetWidth || 0, ...(ngDevMode ? [{ debugName: "thumbWidth" }] : []));
|
|
944
|
+
trackerLeft = computed(() => `${this.thumbFromPosition() + this.thumbWidth() / 2}px`, ...(ngDevMode ? [{ debugName: "trackerLeft" }] : []));
|
|
945
|
+
trackerRight = computed(() => {
|
|
946
|
+
const railWidth = this.elementRef.nativeElement.getBoundingClientRect().width || 0;
|
|
947
|
+
return `${railWidth - this.thumbToPosition() - this.thumbWidth() / 2}px`;
|
|
948
|
+
}, ...(ngDevMode ? [{ debugName: "trackerRight" }] : []));
|
|
949
|
+
Thumb = Thumb;
|
|
950
|
+
resizeObserver;
|
|
951
|
+
onChange = (_value) => {
|
|
952
|
+
};
|
|
953
|
+
onTouch = () => {
|
|
954
|
+
};
|
|
955
|
+
ngOnInit() {
|
|
956
|
+
this.validateRange();
|
|
957
|
+
this.validateStep();
|
|
958
|
+
this.initResizeObserver();
|
|
959
|
+
}
|
|
960
|
+
validateRange() {
|
|
961
|
+
let range = null;
|
|
962
|
+
if (Number.isNaN(this.value().from) || !this.valueInRange(this.value().from)) {
|
|
963
|
+
range = new Range(this.min(), this.value().to);
|
|
964
|
+
}
|
|
965
|
+
if (Number.isNaN(this.value().to) || !this.valueInRange(this.value().to)) {
|
|
966
|
+
if (range) {
|
|
967
|
+
range.to = this.max();
|
|
968
|
+
}
|
|
969
|
+
else {
|
|
970
|
+
range = new Range(this.value().from, this.max());
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
if (this.value().from > this.value().to) {
|
|
974
|
+
if (range) {
|
|
975
|
+
range.from = this.min();
|
|
976
|
+
range.to = this.max();
|
|
977
|
+
}
|
|
978
|
+
else {
|
|
979
|
+
range = new Range(this.min(), this.max());
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
if (range) {
|
|
983
|
+
this.value.update(() => range);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
valueInRange(value) {
|
|
987
|
+
return this.min() <= value && value <= this.max();
|
|
988
|
+
}
|
|
989
|
+
validateStep() {
|
|
990
|
+
const isStepDividerOfRange = (this.max() - this.min()) % this.step() === 0;
|
|
991
|
+
this._step.set(isStepDividerOfRange ? this.step() : parseFloat(((this.max() - this.min()) / 10).toFixed(0)));
|
|
992
|
+
}
|
|
993
|
+
initResizeObserver() {
|
|
994
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
995
|
+
this.computeRatio();
|
|
996
|
+
this.computeFromThumbPosition();
|
|
997
|
+
this.computeToThumbPosition();
|
|
998
|
+
});
|
|
999
|
+
this.resizeObserver.observe(this.elementRef.nativeElement);
|
|
1000
|
+
}
|
|
1001
|
+
computeRatio() {
|
|
1002
|
+
const graduation = (this.max() - this.min()) / this._step();
|
|
1003
|
+
const hostWidth = this.elementRef.nativeElement.offsetWidth - this.thumbWidth();
|
|
1004
|
+
this.ratio.set(parseFloat((hostWidth / graduation).toFixed(3)));
|
|
1005
|
+
}
|
|
1006
|
+
computeFromThumbPosition() {
|
|
1007
|
+
this.thumbFromPosition.set((this.value().from / this._step()) * this.ratio());
|
|
1008
|
+
}
|
|
1009
|
+
computeToThumbPosition() {
|
|
1010
|
+
this.thumbToPosition.set(this.value().to / this._step() * this.ratio());
|
|
1011
|
+
}
|
|
1012
|
+
onPositionChangedThumbFrom(direction) {
|
|
1013
|
+
if (this.disabled()) {
|
|
1014
|
+
return;
|
|
1015
|
+
}
|
|
1016
|
+
if (this.minReached(direction) || this.toReached(direction)) {
|
|
1017
|
+
return;
|
|
1018
|
+
}
|
|
1019
|
+
const diff = direction === RangeMoveDirection.BACKWARD ? -this._step() : this._step();
|
|
1020
|
+
const newFrom = this.value().from + diff;
|
|
1021
|
+
this.value.update((value) => new Range(round(newFrom, this.stepDigits()), value.to));
|
|
1022
|
+
this.computeFromThumbPosition();
|
|
1023
|
+
this.overlappingThumb.set(Thumb.FROM);
|
|
1024
|
+
}
|
|
1025
|
+
onPositionChangedThumbTo(direction) {
|
|
1026
|
+
if (this.disabled()) {
|
|
1027
|
+
return;
|
|
1028
|
+
}
|
|
1029
|
+
if (this.maxReached(direction) || this.fromReached(direction)) {
|
|
1030
|
+
return;
|
|
1031
|
+
}
|
|
1032
|
+
const diff = direction === RangeMoveDirection.BACKWARD ? -this._step() : this._step();
|
|
1033
|
+
const newTo = this.value().to + diff;
|
|
1034
|
+
this.value.update((value) => new Range(value.from, round(newTo, this.stepDigits())));
|
|
1035
|
+
this.computeToThumbPosition();
|
|
1036
|
+
this.overlappingThumb.set(Thumb.TO);
|
|
1037
|
+
}
|
|
1038
|
+
minReached(direction) {
|
|
1039
|
+
return direction === RangeMoveDirection.BACKWARD && this.value().from === this.min();
|
|
1040
|
+
}
|
|
1041
|
+
maxReached(direction) {
|
|
1042
|
+
return direction === RangeMoveDirection.FORWARD && this.value().to === this.max();
|
|
1043
|
+
}
|
|
1044
|
+
fromReached(direction) {
|
|
1045
|
+
return direction === RangeMoveDirection.BACKWARD && this.value().from === this.value().to;
|
|
1046
|
+
}
|
|
1047
|
+
toReached(direction) {
|
|
1048
|
+
return direction === RangeMoveDirection.FORWARD && this.value().from === this.value().to;
|
|
1049
|
+
}
|
|
1050
|
+
onRailClick(event) {
|
|
1051
|
+
if (this.disabled()) {
|
|
1052
|
+
return;
|
|
1053
|
+
}
|
|
1054
|
+
const pointerPosition = event.pageX;
|
|
1055
|
+
const newValue = this.computeNewValueOnClick(pointerPosition);
|
|
1056
|
+
const thumb = this.selectThumbToMove(pointerPosition);
|
|
1057
|
+
if (thumb === Thumb.FROM) {
|
|
1058
|
+
this.value.update((value) => new Range(newValue, value.to));
|
|
1059
|
+
this.computeFromThumbPosition();
|
|
1060
|
+
}
|
|
1061
|
+
else {
|
|
1062
|
+
this.value.update((value) => new Range(value.from, newValue));
|
|
1063
|
+
this.computeToThumbPosition();
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
computeNewValueOnClick(pointerPosition) {
|
|
1067
|
+
const hostPositionLeft = this.elementRef.nativeElement.getBoundingClientRect().left;
|
|
1068
|
+
const pointerOffsetFromHostEdge = pointerPosition - hostPositionLeft;
|
|
1069
|
+
const stepIndex = round((pointerOffsetFromHostEdge - this.thumbWidth() / 2) / this.ratio());
|
|
1070
|
+
return round(stepIndex * this._step(), this.stepDigits());
|
|
1071
|
+
}
|
|
1072
|
+
selectThumbToMove(pointerPosition) {
|
|
1073
|
+
const fromThumbPosition = this.thumbFromRef().nativeElement.getBoundingClientRect().left;
|
|
1074
|
+
const toThumbPosition = this.thumbToRef().nativeElement.getBoundingClientRect().left;
|
|
1075
|
+
const pointerFromThumbDiff = Math.abs(pointerPosition - fromThumbPosition);
|
|
1076
|
+
const pointerToThumbDiff = Math.abs(pointerPosition - toThumbPosition);
|
|
1077
|
+
if (pointerFromThumbDiff < pointerToThumbDiff) {
|
|
1078
|
+
return Thumb.FROM;
|
|
1079
|
+
}
|
|
1080
|
+
if (pointerFromThumbDiff > pointerToThumbDiff) {
|
|
1081
|
+
return Thumb.TO;
|
|
1082
|
+
}
|
|
1083
|
+
// Pointer in the middle
|
|
1084
|
+
if (pointerPosition < pointerFromThumbDiff) {
|
|
1085
|
+
return Thumb.FROM;
|
|
1086
|
+
}
|
|
1087
|
+
return Thumb.TO;
|
|
1088
|
+
}
|
|
1089
|
+
registerOnChange(onChange) {
|
|
1090
|
+
this.onChange = onChange;
|
|
1091
|
+
}
|
|
1092
|
+
registerOnTouched(onTouch) {
|
|
1093
|
+
this.onTouch = onTouch;
|
|
1094
|
+
}
|
|
1095
|
+
writeValue(value) {
|
|
1096
|
+
this.value.set(value);
|
|
1097
|
+
}
|
|
1098
|
+
setDisabledState(disabled) {
|
|
1099
|
+
this.disabled.set(disabled);
|
|
1100
|
+
}
|
|
1101
|
+
ngOnDestroy() {
|
|
1102
|
+
this.resizeObserver.disconnect();
|
|
1103
|
+
}
|
|
1104
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: RangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1105
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.0", type: RangeComponent, isStandalone: true, selector: "ngx-bsl-range", inputs: { 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 }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, showThumbLabels: { classPropertyName: "showThumbLabels", publicName: "showThumbLabels", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "attr.aria-label": "null", "attr.aria-labelledby": "null" } }, providers: [
|
|
1106
|
+
{
|
|
1107
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1108
|
+
multi: true,
|
|
1109
|
+
useExisting: RangeComponent,
|
|
1110
|
+
},
|
|
1111
|
+
], viewQueries: [{ propertyName: "thumbFromRef", first: true, predicate: ["thumbFrom"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "thumbToRef", first: true, predicate: ["thumbTo"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<div class=\"range\">\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus, @angular-eslint/template/click-events-have-key-events -->\n <div class=\"rail\"\n [class.disabled]=\"disabled()\"\n (click)=\"onRailClick($event)\">\n </div>\n\n <div class=\"tracker\"\n [class.disabled]=\"disabled()\"\n [style.left]=\"trackerLeft()\"\n [style.right]=\"trackerRight()\">\n </div>\n\n <ngx-bsl-range-thumb\n #thumbFrom\n role=\"slider\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"value().to\"\n [attr.aria-valuenow]=\"value().from\"\n [attr.aria-valuetext]=\"value().from + ' - ' + value().to\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [tabindex]=\"disabled() ? -1 : 0\"\n [class.disabled]=\"disabled()\"\n [style.left]=\"thumbFromPosition() + 'px'\"\n [style.z-index]=\"overlappingThumb() === 'from' ? 1 : 0\"\n [value]=\"value().from\"\n [ratio]=\"this.ratio()\"\n [showLabel]=\"showThumbLabels()\"\n (focus)=\"overlappingThumb.set(Thumb.FROM)\"\n (positionChanged)=\"onPositionChangedThumbFrom($event)\">\n </ngx-bsl-range-thumb>\n\n <ngx-bsl-range-thumb\n #thumbTo\n role=\"slider\"\n [attr.aria-valuemin]=\"value().from\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"value().to\"\n [attr.aria-valuetext]=\"value().from + ' - ' + value().to\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [tabindex]=\"disabled() ? -1 : 0\"\n [class.disabled]=\"disabled()\"\n [style.left]=\"thumbToPosition() + 'px'\"\n [style.z-index]=\"overlappingThumb() === 'to' ? 1 : 0\"\n [value]=\"value().to\"\n [ratio]=\"this.ratio()\"\n [showLabel]=\"showThumbLabels()\"\n (focus)=\"overlappingThumb.set(Thumb.TO)\"\n (positionChanged)=\"onPositionChangedThumbTo($event)\">\n </ngx-bsl-range-thumb>\n</div>\n\n<div class=\"limits\">\n <span>{{ min() }}</span>\n <span>{{ max() }}</span>\n</div>\n", styles: [":host{display:flex;align-items:center;flex-direction:column}:host .range{position:relative;height:.75rem;width:100%;display:flex;align-items:center}:host .range .rail{height:.25rem;width:100%;border-radius:.125rem;background-color:var(--bsl-range-rail-backgroundColor);cursor:pointer}:host .range .rail.disabled{opacity:.65;cursor:not-allowed;pointer-events:none}:host .range .tracker{position:absolute;height:.25rem;background-color:var(--bsl-range-tracker-backgroundColor);pointer-events:none}:host .range .tracker.disabled{opacity:.65;cursor:not-allowed;pointer-events:none}:host .limits{width:100%;display:flex;justify-content:space-between;font:var(--bsl-font-sm)}\n"], dependencies: [{ kind: "component", type: RangeThumbComponent, selector: "ngx-bsl-range-thumb", inputs: ["ratio", "value", "showLabel"], outputs: ["positionChanged"] }] });
|
|
1112
|
+
}
|
|
1113
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: RangeComponent, decorators: [{
|
|
1114
|
+
type: Component,
|
|
1115
|
+
args: [{ selector: 'ngx-bsl-range', imports: [
|
|
1116
|
+
RangeThumbComponent,
|
|
1117
|
+
], providers: [
|
|
1118
|
+
{
|
|
1119
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1120
|
+
multi: true,
|
|
1121
|
+
useExisting: RangeComponent,
|
|
1122
|
+
},
|
|
1123
|
+
], host: {
|
|
1124
|
+
'[attr.aria-label]': 'null',
|
|
1125
|
+
'[attr.aria-labelledby]': 'null',
|
|
1126
|
+
}, template: "<div class=\"range\">\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus, @angular-eslint/template/click-events-have-key-events -->\n <div class=\"rail\"\n [class.disabled]=\"disabled()\"\n (click)=\"onRailClick($event)\">\n </div>\n\n <div class=\"tracker\"\n [class.disabled]=\"disabled()\"\n [style.left]=\"trackerLeft()\"\n [style.right]=\"trackerRight()\">\n </div>\n\n <ngx-bsl-range-thumb\n #thumbFrom\n role=\"slider\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"value().to\"\n [attr.aria-valuenow]=\"value().from\"\n [attr.aria-valuetext]=\"value().from + ' - ' + value().to\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [tabindex]=\"disabled() ? -1 : 0\"\n [class.disabled]=\"disabled()\"\n [style.left]=\"thumbFromPosition() + 'px'\"\n [style.z-index]=\"overlappingThumb() === 'from' ? 1 : 0\"\n [value]=\"value().from\"\n [ratio]=\"this.ratio()\"\n [showLabel]=\"showThumbLabels()\"\n (focus)=\"overlappingThumb.set(Thumb.FROM)\"\n (positionChanged)=\"onPositionChangedThumbFrom($event)\">\n </ngx-bsl-range-thumb>\n\n <ngx-bsl-range-thumb\n #thumbTo\n role=\"slider\"\n [attr.aria-valuemin]=\"value().from\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"value().to\"\n [attr.aria-valuetext]=\"value().from + ' - ' + value().to\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [tabindex]=\"disabled() ? -1 : 0\"\n [class.disabled]=\"disabled()\"\n [style.left]=\"thumbToPosition() + 'px'\"\n [style.z-index]=\"overlappingThumb() === 'to' ? 1 : 0\"\n [value]=\"value().to\"\n [ratio]=\"this.ratio()\"\n [showLabel]=\"showThumbLabels()\"\n (focus)=\"overlappingThumb.set(Thumb.TO)\"\n (positionChanged)=\"onPositionChangedThumbTo($event)\">\n </ngx-bsl-range-thumb>\n</div>\n\n<div class=\"limits\">\n <span>{{ min() }}</span>\n <span>{{ max() }}</span>\n</div>\n", styles: [":host{display:flex;align-items:center;flex-direction:column}:host .range{position:relative;height:.75rem;width:100%;display:flex;align-items:center}:host .range .rail{height:.25rem;width:100%;border-radius:.125rem;background-color:var(--bsl-range-rail-backgroundColor);cursor:pointer}:host .range .rail.disabled{opacity:.65;cursor:not-allowed;pointer-events:none}:host .range .tracker{position:absolute;height:.25rem;background-color:var(--bsl-range-tracker-backgroundColor);pointer-events:none}:host .range .tracker.disabled{opacity:.65;cursor:not-allowed;pointer-events:none}:host .limits{width:100%;display:flex;justify-content:space-between;font:var(--bsl-font-sm)}\n"] }]
|
|
1127
|
+
}], propDecorators: { 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 }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], showThumbLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "showThumbLabels", required: false }] }], thumbFromRef: [{ type: i0.ViewChild, args: ['thumbFrom', { ...{ read: (ElementRef) }, isSignal: true }] }], thumbToRef: [{ type: i0.ViewChild, args: ['thumbTo', { ...{ read: (ElementRef) }, isSignal: true }] }] } });
|
|
1128
|
+
|
|
1129
|
+
class SelectComponent {
|
|
1130
|
+
id = input.required(...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
1131
|
+
options = input.required(...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
1132
|
+
bindLabel = input(...(ngDevMode ? [undefined, { debugName: "bindLabel" }] : []));
|
|
1133
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
1134
|
+
ariaLabel = input(...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : []));
|
|
1135
|
+
ariaLabelledBy = input(...(ngDevMode ? [undefined, { debugName: "ariaLabelledBy" }] : []));
|
|
1136
|
+
comparisonField = input(...(ngDevMode ? [undefined, { debugName: "comparisonField" }] : []));
|
|
1137
|
+
iconMode = input(false, ...(ngDevMode ? [{ debugName: "iconMode" }] : []));
|
|
1138
|
+
customIcon = input(false, ...(ngDevMode ? [{ debugName: "customIcon" }] : []));
|
|
1139
|
+
dropdownWidth = input(...(ngDevMode ? [undefined, { debugName: "dropdownWidth" }] : []));
|
|
1140
|
+
listBox = viewChild(ListBoxComponent, ...(ngDevMode ? [{ debugName: "listBox" }] : []));
|
|
1141
|
+
onChange = (_value) => { };
|
|
1142
|
+
onTouch = () => { };
|
|
1143
|
+
value = null;
|
|
1144
|
+
open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
1145
|
+
ariaActiveDescendant = computed(() => this.listBox()?.ariaActiveDescendant() ?? null, ...(ngDevMode ? [{ debugName: "ariaActiveDescendant" }] : []));
|
|
1146
|
+
initialFocusedOptionIndex = signal(null, ...(ngDevMode ? [{ debugName: "initialFocusedOptionIndex" }] : []));
|
|
1147
|
+
showListBox() {
|
|
1148
|
+
this.open.set(true);
|
|
1149
|
+
}
|
|
1150
|
+
hideListBox() {
|
|
1151
|
+
this.initialFocusedOptionIndex.set(null);
|
|
1152
|
+
this.open.set(false);
|
|
1153
|
+
}
|
|
1154
|
+
onClick() {
|
|
1155
|
+
if (this.open()) {
|
|
1156
|
+
this.hideListBox();
|
|
1157
|
+
}
|
|
1158
|
+
else {
|
|
1159
|
+
this.showListBox();
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
onSelectOption(value) {
|
|
1163
|
+
this.value = value;
|
|
1164
|
+
this.onChange(this.value);
|
|
1165
|
+
this.hideListBox();
|
|
1166
|
+
}
|
|
1167
|
+
onKeydown(event) {
|
|
1168
|
+
event.preventDefault();
|
|
1169
|
+
if (!this.open()) {
|
|
1170
|
+
this.showListBox();
|
|
1171
|
+
if (event.code === 'ArrowUp') {
|
|
1172
|
+
this.initialFocusedOptionIndex.set(this.options().length - 1);
|
|
1173
|
+
}
|
|
1174
|
+
else if (event.code === 'ArrowDown') {
|
|
1175
|
+
this.initialFocusedOptionIndex.set(0);
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
else {
|
|
1179
|
+
this.listBox()?.onKeydown(event);
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
registerOnChange(onChange) {
|
|
1183
|
+
this.onChange = onChange;
|
|
1184
|
+
}
|
|
1185
|
+
registerOnTouched(onTouch) {
|
|
1186
|
+
this.onTouch = onTouch;
|
|
1187
|
+
}
|
|
1188
|
+
writeValue(value) {
|
|
1189
|
+
this.value = value;
|
|
1190
|
+
}
|
|
1191
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1192
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", type: SelectComponent, isStandalone: true, selector: "ngx-bsl-select", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, bindLabel: { classPropertyName: "bindLabel", publicName: "bindLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, comparisonField: { classPropertyName: "comparisonField", publicName: "comparisonField", isSignal: true, isRequired: false, transformFunction: null }, iconMode: { classPropertyName: "iconMode", publicName: "iconMode", isSignal: true, isRequired: false, transformFunction: null }, customIcon: { classPropertyName: "customIcon", publicName: "customIcon", isSignal: true, isRequired: false, transformFunction: null }, dropdownWidth: { classPropertyName: "dropdownWidth", publicName: "dropdownWidth", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
1193
|
+
{
|
|
1194
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1195
|
+
useExisting: forwardRef(() => SelectComponent),
|
|
1196
|
+
multi: true,
|
|
1197
|
+
},
|
|
1198
|
+
], viewQueries: [{ propertyName: "listBox", first: true, predicate: ListBoxComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<button\n type=\"button\"\n role=\"combobox\"\n #selectButton\n cdkOverlayOrigin\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"'list-box-' + id()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-activedescendant]=\"ariaActiveDescendant()\"\n (click)=\"onClick()\"\n (keydown.enter)=\"onKeydown($any($event))\"\n (keydown.space)=\"onKeydown($any($event))\"\n (keydown.arrowUp)=\"onKeydown($any($event))\"\n (keydown.arrowDown)=\"onKeydown($any($event))\"\n (keydown.escape)=\"hideListBox()\">\n @if (iconMode()) {\n <ng-content select=\"[data-custom-icon]\"></ng-content>\n } @else {\n <span>{{ value ? (value | listBoxOptionValueConverter : bindLabel()) : placeholder() }}</span>\n\n @if (customIcon()) {\n <ng-content select=\"[data-custom-icon]\"></ng-content>\n } @else {\n <ngx-bsl-icon-chevron-down></ngx-bsl-icon-chevron-down>\n }\n }\n</button>\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"selectButton\"\n [cdkConnectedOverlayOpen]=\"open()\"\n [cdkConnectedOverlayWidth]=\"dropdownWidth() || selectButton.offsetWidth\"\n (overlayOutsideClick)=\"hideListBox()\">\n <ngx-bsl-list-box\n [initialValue]=\"value\"\n [initialFocusedOptionIndex]=\"initialFocusedOptionIndex()\"\n [comparisonField]=\"comparisonField()\"\n [id]=\"'list-box-' + id()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledby]=\"ariaLabelledBy()\"\n [exposeAriaActiveDescendant]=\"true\"\n (selectOption)=\"onSelectOption($event)\">\n @for (option of options(); track option) {\n <ngx-bsl-list-box-option\n [id]=\"'list-box-option-' + id()\"\n [value]=\"option\">\n <ng-container>{{ option | listBoxOptionValueConverter : bindLabel() }}</ng-container>\n </ngx-bsl-list-box-option>\n }\n </ngx-bsl-list-box>\n</ng-template>\n", styles: ["button{width:100%;min-height:2.25rem;justify-content:space-between;gap:.5rem}button span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n"], dependencies: [{ kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "component", type: IconChevronDownComponent, selector: "ngx-bsl-icon-chevron-down" }, { kind: "component", type: ListBoxComponent, selector: "ngx-bsl-list-box", inputs: ["id", "ariaLabel", "ariaLabelledby", "exposeAriaActiveDescendant", "comparisonField", "initialValue", "initialFocusedOptionIndex"], outputs: ["selectOption"] }, { kind: "component", type: ListBoxOptionComponent, selector: "ngx-bsl-list-box-option", inputs: ["value", "id"] }, { kind: "pipe", type: ListBoxOptionValueConverterPipe, name: "listBoxOptionValueConverter" }] });
|
|
1199
|
+
}
|
|
1200
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: SelectComponent, decorators: [{
|
|
1201
|
+
type: Component,
|
|
1202
|
+
args: [{ selector: 'ngx-bsl-select', imports: [
|
|
1203
|
+
CdkOverlayOrigin,
|
|
1204
|
+
CdkConnectedOverlay,
|
|
1205
|
+
IconChevronDownComponent,
|
|
1206
|
+
ListBoxComponent,
|
|
1207
|
+
ListBoxOptionComponent,
|
|
1208
|
+
ListBoxOptionValueConverterPipe,
|
|
1209
|
+
], providers: [
|
|
1210
|
+
{
|
|
1211
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1212
|
+
useExisting: forwardRef(() => SelectComponent),
|
|
1213
|
+
multi: true,
|
|
1214
|
+
},
|
|
1215
|
+
], template: "<button\n type=\"button\"\n role=\"combobox\"\n #selectButton\n cdkOverlayOrigin\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"'list-box-' + id()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-activedescendant]=\"ariaActiveDescendant()\"\n (click)=\"onClick()\"\n (keydown.enter)=\"onKeydown($any($event))\"\n (keydown.space)=\"onKeydown($any($event))\"\n (keydown.arrowUp)=\"onKeydown($any($event))\"\n (keydown.arrowDown)=\"onKeydown($any($event))\"\n (keydown.escape)=\"hideListBox()\">\n @if (iconMode()) {\n <ng-content select=\"[data-custom-icon]\"></ng-content>\n } @else {\n <span>{{ value ? (value | listBoxOptionValueConverter : bindLabel()) : placeholder() }}</span>\n\n @if (customIcon()) {\n <ng-content select=\"[data-custom-icon]\"></ng-content>\n } @else {\n <ngx-bsl-icon-chevron-down></ngx-bsl-icon-chevron-down>\n }\n }\n</button>\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"selectButton\"\n [cdkConnectedOverlayOpen]=\"open()\"\n [cdkConnectedOverlayWidth]=\"dropdownWidth() || selectButton.offsetWidth\"\n (overlayOutsideClick)=\"hideListBox()\">\n <ngx-bsl-list-box\n [initialValue]=\"value\"\n [initialFocusedOptionIndex]=\"initialFocusedOptionIndex()\"\n [comparisonField]=\"comparisonField()\"\n [id]=\"'list-box-' + id()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledby]=\"ariaLabelledBy()\"\n [exposeAriaActiveDescendant]=\"true\"\n (selectOption)=\"onSelectOption($event)\">\n @for (option of options(); track option) {\n <ngx-bsl-list-box-option\n [id]=\"'list-box-option-' + id()\"\n [value]=\"option\">\n <ng-container>{{ option | listBoxOptionValueConverter : bindLabel() }}</ng-container>\n </ngx-bsl-list-box-option>\n }\n </ngx-bsl-list-box>\n</ng-template>\n", styles: ["button{width:100%;min-height:2.25rem;justify-content:space-between;gap:.5rem}button span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n"] }]
|
|
1216
|
+
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], bindLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledBy", required: false }] }], comparisonField: [{ type: i0.Input, args: [{ isSignal: true, alias: "comparisonField", required: false }] }], iconMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconMode", required: false }] }], customIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "customIcon", required: false }] }], dropdownWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdownWidth", required: false }] }], listBox: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ListBoxComponent), { isSignal: true }] }] } });
|
|
1217
|
+
|
|
1218
|
+
class TooltipComponent {
|
|
1219
|
+
message = '';
|
|
1220
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1221
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0", type: TooltipComponent, isStandalone: true, selector: "ngx-bsl-tooltip", host: { attributes: { "role": "tooltip" } }, ngImport: i0, template: '{{message}}', isInline: true, styles: [":host{padding:4px 8px;border-radius:4px;background-color:var(--bsl-tooltip-backgroundColor);font:var(--bsl-font-xs);color:var(--bsl-tooltip-textColor)}\n"] });
|
|
1222
|
+
}
|
|
1223
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
1224
|
+
type: Component,
|
|
1225
|
+
args: [{ selector: 'ngx-bsl-tooltip', imports: [], template: '{{message}}', host: { 'role': 'tooltip' }, styles: [":host{padding:4px 8px;border-radius:4px;background-color:var(--bsl-tooltip-backgroundColor);font:var(--bsl-font-xs);color:var(--bsl-tooltip-textColor)}\n"] }]
|
|
1226
|
+
}] });
|
|
1227
|
+
|
|
1228
|
+
const TOOLTIP_OVERLAY_POSITION = {
|
|
1229
|
+
TOP: {
|
|
1230
|
+
originX: 'center',
|
|
1231
|
+
originY: 'top',
|
|
1232
|
+
overlayX: 'center',
|
|
1233
|
+
overlayY: 'bottom',
|
|
1234
|
+
},
|
|
1235
|
+
BOTTOM: {
|
|
1236
|
+
originX: 'center',
|
|
1237
|
+
originY: 'bottom',
|
|
1238
|
+
overlayX: 'center',
|
|
1239
|
+
overlayY: 'top',
|
|
1240
|
+
},
|
|
1241
|
+
LEFT: {
|
|
1242
|
+
originX: 'start',
|
|
1243
|
+
originY: 'center',
|
|
1244
|
+
overlayX: 'end',
|
|
1245
|
+
overlayY: 'center',
|
|
1246
|
+
},
|
|
1247
|
+
RIGHT: {
|
|
1248
|
+
originX: 'end',
|
|
1249
|
+
originY: 'center',
|
|
1250
|
+
overlayX: 'start',
|
|
1251
|
+
overlayY: 'center',
|
|
1252
|
+
},
|
|
1253
|
+
};
|
|
1254
|
+
|
|
1255
|
+
var TooltipPosition;
|
|
1256
|
+
(function (TooltipPosition) {
|
|
1257
|
+
TooltipPosition["TOP"] = "TOP";
|
|
1258
|
+
TooltipPosition["BOTTOM"] = "BOTTOM";
|
|
1259
|
+
TooltipPosition["LEFT"] = "LEFT";
|
|
1260
|
+
TooltipPosition["RIGHT"] = "RIGHT";
|
|
1261
|
+
})(TooltipPosition || (TooltipPosition = {}));
|
|
1262
|
+
|
|
1263
|
+
class TooltipDirective {
|
|
1264
|
+
message = input.required(...(ngDevMode ? [{ debugName: "message", alias: 'ngxBslTooltip' }] : [{ alias: 'ngxBslTooltip' }]));
|
|
1265
|
+
position = input(TooltipPosition.TOP, ...(ngDevMode ? [{ debugName: "position" }] : []));
|
|
1266
|
+
overlay = inject(Overlay);
|
|
1267
|
+
elementRef = inject(ElementRef);
|
|
1268
|
+
overlayRef = null;
|
|
1269
|
+
show() {
|
|
1270
|
+
this.hide();
|
|
1271
|
+
if (this.message()) {
|
|
1272
|
+
const positionStrategy = this.createPositionStrategy();
|
|
1273
|
+
this.overlayRef = this.overlay.create({ positionStrategy });
|
|
1274
|
+
const componentPortal = new ComponentPortal(TooltipComponent);
|
|
1275
|
+
const componentInstance = this.overlayRef.attach(componentPortal);
|
|
1276
|
+
componentInstance.instance.message = this.message();
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
hide() {
|
|
1280
|
+
if (this.overlayRef?.hasAttached()) {
|
|
1281
|
+
this.overlayRef.detach();
|
|
1282
|
+
this.overlayRef = null;
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
createPositionStrategy() {
|
|
1286
|
+
const positionStrategy = this.overlay
|
|
1287
|
+
.position()
|
|
1288
|
+
.flexibleConnectedTo(this.elementRef.nativeElement)
|
|
1289
|
+
.withPositions([TOOLTIP_OVERLAY_POSITION[this.position()]]);
|
|
1290
|
+
const tooltipOffset = 8;
|
|
1291
|
+
switch (this.position()) {
|
|
1292
|
+
case TooltipPosition.TOP:
|
|
1293
|
+
positionStrategy.withDefaultOffsetY(-tooltipOffset);
|
|
1294
|
+
break;
|
|
1295
|
+
case TooltipPosition.BOTTOM:
|
|
1296
|
+
positionStrategy.withDefaultOffsetY(tooltipOffset);
|
|
1297
|
+
break;
|
|
1298
|
+
case TooltipPosition.LEFT:
|
|
1299
|
+
positionStrategy.withDefaultOffsetX(-tooltipOffset);
|
|
1300
|
+
break;
|
|
1301
|
+
case TooltipPosition.RIGHT:
|
|
1302
|
+
positionStrategy.withDefaultOffsetX(tooltipOffset);
|
|
1303
|
+
break;
|
|
1304
|
+
default:
|
|
1305
|
+
break;
|
|
1306
|
+
}
|
|
1307
|
+
return positionStrategy;
|
|
1308
|
+
}
|
|
1309
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1310
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.0", type: TooltipDirective, isStandalone: true, selector: "[ngxBslTooltip]", inputs: { message: { classPropertyName: "message", publicName: "ngxBslTooltip", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "show()", "mouseleave": "hide()", "focus": "show()", "blur": "hide()" } }, ngImport: i0 });
|
|
1311
|
+
}
|
|
1312
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TooltipDirective, decorators: [{
|
|
1313
|
+
type: Directive,
|
|
1314
|
+
args: [{
|
|
1315
|
+
selector: '[ngxBslTooltip]',
|
|
1316
|
+
host: {
|
|
1317
|
+
'(mouseenter)': 'show()',
|
|
1318
|
+
'(mouseleave)': 'hide()',
|
|
1319
|
+
'(focus)': 'show()',
|
|
1320
|
+
'(blur)': 'hide()',
|
|
1321
|
+
},
|
|
1322
|
+
}]
|
|
1323
|
+
}], propDecorators: { message: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngxBslTooltip", required: true }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }] } });
|
|
1324
|
+
|
|
24
1325
|
/**
|
|
25
1326
|
* Generated bundle index. Do not edit.
|
|
26
1327
|
*/
|
|
27
1328
|
|
|
28
|
-
export {
|
|
1329
|
+
export { CheckboxComponent, ComboboxComponent, DrawerComponent, IconCheckComponent, IconChevronDownComponent, IconCompanyComponent, IconLanguageComponent, IconLocationComponent, IconMoonComponent, IconSunComponent, IconXMarkComponent, ListBoxComponent, ListBoxGroupComponent, ListBoxOptionComponent, ListBoxOptionValueConverterPipe, ListBoxSeparatorComponent, PaginationComponent, RangeComponent, SelectComponent, TooltipDirective };
|
|
29
1330
|
//# sourceMappingURL=ngx-bsl.mjs.map
|