@blank-software/core-components 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,862 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, model, inject, forwardRef, computed, Component, contentChildren, output, HostListener, signal, ElementRef, Injectable } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
class AccordionItem {
|
|
5
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
6
|
+
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
7
|
+
open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
8
|
+
parent = inject(forwardRef(() => Accordion), { optional: true });
|
|
9
|
+
itemClasses = computed(() => {
|
|
10
|
+
const classes = ['accordion-item'];
|
|
11
|
+
if (this.disabled())
|
|
12
|
+
classes.push('accordion-item-disabled');
|
|
13
|
+
return classes.join(' ');
|
|
14
|
+
}, ...(ngDevMode ? [{ debugName: "itemClasses" }] : []));
|
|
15
|
+
toggle() {
|
|
16
|
+
if (this.disabled())
|
|
17
|
+
return;
|
|
18
|
+
this.open.set(!this.open());
|
|
19
|
+
if (this.open() && this.parent) {
|
|
20
|
+
this.parent.onItemToggle(this);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AccordionItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
24
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: AccordionItem, isStandalone: true, selector: "bsc-accordion-item", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, ngImport: i0, template: `
|
|
25
|
+
<div [class]="itemClasses()">
|
|
26
|
+
<button class="accordion-header" [disabled]="disabled()" (click)="toggle()">
|
|
27
|
+
<span class="accordion-title">{{ title() }}</span>
|
|
28
|
+
<svg
|
|
29
|
+
class="accordion-chevron"
|
|
30
|
+
[class.accordion-chevron-open]="open()"
|
|
31
|
+
width="20"
|
|
32
|
+
height="20"
|
|
33
|
+
viewBox="0 0 24 24"
|
|
34
|
+
fill="none"
|
|
35
|
+
stroke="currentColor"
|
|
36
|
+
stroke-width="2"
|
|
37
|
+
stroke-linecap="round"
|
|
38
|
+
stroke-linejoin="round"
|
|
39
|
+
>
|
|
40
|
+
<path d="M6 9l6 6 6-6" />
|
|
41
|
+
</svg>
|
|
42
|
+
</button>
|
|
43
|
+
@if (open()) {
|
|
44
|
+
<div class="accordion-body">
|
|
45
|
+
<ng-content />
|
|
46
|
+
</div>
|
|
47
|
+
}
|
|
48
|
+
</div>
|
|
49
|
+
`, isInline: true, styles: [":host{display:block}.accordion-item{border-bottom:1px solid var(--color-ink-200)}.accordion-item:last-child{border-bottom:none}.accordion-header{display:flex;align-items:center;justify-content:space-between;width:100%;padding:1rem 1.5rem;background:transparent;border:none;cursor:pointer;font-weight:500;font-size:.875rem;line-height:1.25rem;color:var(--color-ink-900);transition:background-color .15s}.accordion-header:hover:not(:disabled){background-color:var(--color-ink-50)}.accordion-header:disabled{opacity:.5;cursor:not-allowed}.accordion-chevron{flex-shrink:0;color:var(--color-ink-400);transition:transform .2s ease}.accordion-chevron-open{transform:rotate(180deg)}.accordion-body{padding:0 1.5rem 1rem;font-size:.875rem;line-height:1.5;color:var(--color-ink-600)}.accordion-item-disabled{opacity:.5}\n"] });
|
|
50
|
+
}
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AccordionItem, decorators: [{
|
|
52
|
+
type: Component,
|
|
53
|
+
args: [{ selector: 'bsc-accordion-item', imports: [], template: `
|
|
54
|
+
<div [class]="itemClasses()">
|
|
55
|
+
<button class="accordion-header" [disabled]="disabled()" (click)="toggle()">
|
|
56
|
+
<span class="accordion-title">{{ title() }}</span>
|
|
57
|
+
<svg
|
|
58
|
+
class="accordion-chevron"
|
|
59
|
+
[class.accordion-chevron-open]="open()"
|
|
60
|
+
width="20"
|
|
61
|
+
height="20"
|
|
62
|
+
viewBox="0 0 24 24"
|
|
63
|
+
fill="none"
|
|
64
|
+
stroke="currentColor"
|
|
65
|
+
stroke-width="2"
|
|
66
|
+
stroke-linecap="round"
|
|
67
|
+
stroke-linejoin="round"
|
|
68
|
+
>
|
|
69
|
+
<path d="M6 9l6 6 6-6" />
|
|
70
|
+
</svg>
|
|
71
|
+
</button>
|
|
72
|
+
@if (open()) {
|
|
73
|
+
<div class="accordion-body">
|
|
74
|
+
<ng-content />
|
|
75
|
+
</div>
|
|
76
|
+
}
|
|
77
|
+
</div>
|
|
78
|
+
`, styles: [":host{display:block}.accordion-item{border-bottom:1px solid var(--color-ink-200)}.accordion-item:last-child{border-bottom:none}.accordion-header{display:flex;align-items:center;justify-content:space-between;width:100%;padding:1rem 1.5rem;background:transparent;border:none;cursor:pointer;font-weight:500;font-size:.875rem;line-height:1.25rem;color:var(--color-ink-900);transition:background-color .15s}.accordion-header:hover:not(:disabled){background-color:var(--color-ink-50)}.accordion-header:disabled{opacity:.5;cursor:not-allowed}.accordion-chevron{flex-shrink:0;color:var(--color-ink-400);transition:transform .2s ease}.accordion-chevron-open{transform:rotate(180deg)}.accordion-body{padding:0 1.5rem 1rem;font-size:.875rem;line-height:1.5;color:var(--color-ink-600)}.accordion-item-disabled{opacity:.5}\n"] }]
|
|
79
|
+
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }] } });
|
|
80
|
+
class Accordion {
|
|
81
|
+
multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : {}), transform: booleanAttribute });
|
|
82
|
+
items = contentChildren(AccordionItem, ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
83
|
+
onItemToggle(openedItem) {
|
|
84
|
+
if (this.multiple())
|
|
85
|
+
return;
|
|
86
|
+
for (const item of this.items()) {
|
|
87
|
+
if (item !== openedItem) {
|
|
88
|
+
item.open.set(false);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Accordion, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
93
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.0", type: Accordion, isStandalone: true, selector: "bsc-accordion", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "items", predicate: AccordionItem, isSignal: true }], ngImport: i0, template: "<div class=\"accordion\">\n <ng-content />\n</div>\n", styles: ["@reference \"tailwindcss\";.accordion{@apply bg-surface rounded-2xl border border-ink-200 overflow-hidden;}\n"] });
|
|
94
|
+
}
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Accordion, decorators: [{
|
|
96
|
+
type: Component,
|
|
97
|
+
args: [{ selector: 'bsc-accordion', imports: [], template: "<div class=\"accordion\">\n <ng-content />\n</div>\n", styles: ["@reference \"tailwindcss\";.accordion{@apply bg-surface rounded-2xl border border-ink-200 overflow-hidden;}\n"] }]
|
|
98
|
+
}], propDecorators: { multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], items: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => AccordionItem), { isSignal: true }] }] } });
|
|
99
|
+
|
|
100
|
+
class Alert {
|
|
101
|
+
variant = input('info', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
102
|
+
alertClasses = computed(() => {
|
|
103
|
+
return `alert alert-${this.variant()}`;
|
|
104
|
+
}, ...(ngDevMode ? [{ debugName: "alertClasses" }] : []));
|
|
105
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Alert, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
106
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: Alert, isStandalone: true, selector: "bsc-alert", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div [class]=\"alertClasses()\" role=\"alert\">\n <ng-content />\n</div>\n" });
|
|
107
|
+
}
|
|
108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Alert, decorators: [{
|
|
109
|
+
type: Component,
|
|
110
|
+
args: [{ selector: 'bsc-alert', imports: [], template: "<div [class]=\"alertClasses()\" role=\"alert\">\n <ng-content />\n</div>\n" }]
|
|
111
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
|
|
112
|
+
|
|
113
|
+
class Avatar {
|
|
114
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Avatar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
115
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: Avatar, isStandalone: true, selector: "bsc-avatar", ngImport: i0, template: "<p>avatar works!</p>\n", styles: [""] });
|
|
116
|
+
}
|
|
117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Avatar, decorators: [{
|
|
118
|
+
type: Component,
|
|
119
|
+
args: [{ selector: 'bsc-avatar', imports: [], template: "<p>avatar works!</p>\n" }]
|
|
120
|
+
}] });
|
|
121
|
+
|
|
122
|
+
class Badge {
|
|
123
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Badge, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
124
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: Badge, isStandalone: true, selector: "bsc-badge", ngImport: i0, template: "<p>badge works!</p>\n", styles: [""] });
|
|
125
|
+
}
|
|
126
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Badge, decorators: [{
|
|
127
|
+
type: Component,
|
|
128
|
+
args: [{ selector: 'bsc-badge', imports: [], template: "<p>badge works!</p>\n" }]
|
|
129
|
+
}] });
|
|
130
|
+
|
|
131
|
+
class Breadcrumb {
|
|
132
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Breadcrumb, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
133
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: Breadcrumb, isStandalone: true, selector: "bsc-breadcrumb", ngImport: i0, template: "<p>breadcrumb works!</p>\n", styles: [""] });
|
|
134
|
+
}
|
|
135
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Breadcrumb, decorators: [{
|
|
136
|
+
type: Component,
|
|
137
|
+
args: [{ selector: 'bsc-breadcrumb', imports: [], template: "<p>breadcrumb works!</p>\n" }]
|
|
138
|
+
}] });
|
|
139
|
+
|
|
140
|
+
function luminance(hex) {
|
|
141
|
+
const raw = hex.replace('#', '');
|
|
142
|
+
const r = parseInt(raw.substring(0, 2), 16) / 255;
|
|
143
|
+
const g = parseInt(raw.substring(2, 4), 16) / 255;
|
|
144
|
+
const b = parseInt(raw.substring(4, 6), 16) / 255;
|
|
145
|
+
const toLinear = (c) => (c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4));
|
|
146
|
+
return 0.2126 * toLinear(r) + 0.7152 * toLinear(g) + 0.0722 * toLinear(b);
|
|
147
|
+
}
|
|
148
|
+
class Button {
|
|
149
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
150
|
+
iconOnly = input(false, { ...(ngDevMode ? { debugName: "iconOnly" } : {}), transform: booleanAttribute });
|
|
151
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : {}), transform: booleanAttribute });
|
|
152
|
+
color = input(undefined, ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
153
|
+
shape = input('rounded', ...(ngDevMode ? [{ debugName: "shape" }] : []));
|
|
154
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
155
|
+
type = input('button', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
156
|
+
variant = input('primary', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
157
|
+
buttonClasses = computed(() => {
|
|
158
|
+
const io = this.iconOnly();
|
|
159
|
+
const sizePrefix = io ? 'btn-icon-' : 'btn-';
|
|
160
|
+
const classes = ['btn', `btn-${this.shape()}`, `${sizePrefix}${this.size()}`];
|
|
161
|
+
if (this.color()) {
|
|
162
|
+
classes.push('btn-custom-color');
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
classes.push(`btn-${this.variant()}`);
|
|
166
|
+
}
|
|
167
|
+
return classes.join(' ');
|
|
168
|
+
}, ...(ngDevMode ? [{ debugName: "buttonClasses" }] : []));
|
|
169
|
+
buttonStyles = computed(() => {
|
|
170
|
+
const c = this.color();
|
|
171
|
+
if (!c)
|
|
172
|
+
return {};
|
|
173
|
+
const textColor = luminance(c) > 0.4 ? '#0F172A' : '#FFFFFF';
|
|
174
|
+
return {
|
|
175
|
+
'--btn-bg': c,
|
|
176
|
+
'--btn-text': textColor,
|
|
177
|
+
};
|
|
178
|
+
}, ...(ngDevMode ? [{ debugName: "buttonStyles" }] : []));
|
|
179
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Button, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
180
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: Button, isStandalone: true, selector: "bsc-button", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, iconOnly: { classPropertyName: "iconOnly", publicName: "iconOnly", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<button\n [type]=\"type()\"\n [disabled]=\"disabled() || loading()\"\n [class]=\"buttonClasses()\"\n [style]=\"buttonStyles()\"\n>\n @if (loading()) {\n <svg\n class=\"animate-spin shrink-0\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\" />\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n }\n <ng-content select=\"[leftIcon]\" />\n <ng-content />\n <ng-content select=\"[rightIcon]\" />\n</button>\n" });
|
|
181
|
+
}
|
|
182
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Button, decorators: [{
|
|
183
|
+
type: Component,
|
|
184
|
+
args: [{ selector: 'bsc-button', imports: [], template: "<button\n [type]=\"type()\"\n [disabled]=\"disabled() || loading()\"\n [class]=\"buttonClasses()\"\n [style]=\"buttonStyles()\"\n>\n @if (loading()) {\n <svg\n class=\"animate-spin shrink-0\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\" />\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n }\n <ng-content select=\"[leftIcon]\" />\n <ng-content />\n <ng-content select=\"[rightIcon]\" />\n</button>\n" }]
|
|
185
|
+
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], iconOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconOnly", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
|
|
186
|
+
|
|
187
|
+
class Card {
|
|
188
|
+
padded = input(true, { ...(ngDevMode ? { debugName: "padded" } : {}), transform: booleanAttribute });
|
|
189
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
190
|
+
cardClasses = computed(() => {
|
|
191
|
+
const classes = ['card', `card-${this.variant()}`];
|
|
192
|
+
if (this.padded())
|
|
193
|
+
classes.push('card-padded');
|
|
194
|
+
return classes.join(' ');
|
|
195
|
+
}, ...(ngDevMode ? [{ debugName: "cardClasses" }] : []));
|
|
196
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Card, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
197
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: Card, isStandalone: true, selector: "bsc-card", inputs: { padded: { classPropertyName: "padded", publicName: "padded", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div [class]=\"cardClasses()\">\n <ng-content select=\"[cardHeader]\" />\n <div class=\"card-body\">\n <ng-content />\n </div>\n <ng-content select=\"[cardFooter]\" />\n</div>\n", styles: ["@reference \"tailwindcss\";.card{@apply rounded-2xl overflow-hidden;}.card-default{@apply bg-surface shadow-sm;}.card-outlined{@apply bg-surface border border-ink-200;}.card-padded>.card-body,.card-padded>[cardHeader],.card-padded>[cardFooter]{@apply px-6;}.card-padded>.card-body{@apply py-6;}.card-padded>[cardHeader]{@apply pt-6 pb-4 border-b border-ink-100;}.card-padded>[cardFooter]{@apply pb-6 pt-4 border-t border-ink-100;}\n"] });
|
|
198
|
+
}
|
|
199
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Card, decorators: [{
|
|
200
|
+
type: Component,
|
|
201
|
+
args: [{ selector: 'bsc-card', imports: [], template: "<div [class]=\"cardClasses()\">\n <ng-content select=\"[cardHeader]\" />\n <div class=\"card-body\">\n <ng-content />\n </div>\n <ng-content select=\"[cardFooter]\" />\n</div>\n", styles: ["@reference \"tailwindcss\";.card{@apply rounded-2xl overflow-hidden;}.card-default{@apply bg-surface shadow-sm;}.card-outlined{@apply bg-surface border border-ink-200;}.card-padded>.card-body,.card-padded>[cardHeader],.card-padded>[cardFooter]{@apply px-6;}.card-padded>.card-body{@apply py-6;}.card-padded>[cardHeader]{@apply pt-6 pb-4 border-b border-ink-100;}.card-padded>[cardFooter]{@apply pb-6 pt-4 border-t border-ink-100;}\n"] }]
|
|
202
|
+
}], propDecorators: { padded: [{ type: i0.Input, args: [{ isSignal: true, alias: "padded", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
|
|
203
|
+
|
|
204
|
+
class Checkbox {
|
|
205
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
206
|
+
indeterminate = input(false, { ...(ngDevMode ? { debugName: "indeterminate" } : {}), transform: booleanAttribute });
|
|
207
|
+
checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
208
|
+
toggle() {
|
|
209
|
+
if (!this.disabled()) {
|
|
210
|
+
this.checked.set(!this.checked());
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Checkbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
214
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: Checkbox, isStandalone: true, selector: "bsc-checkbox", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, ngImport: i0, template: "<label class=\"checkbox\">\n <input\n type=\"checkbox\"\n class=\"checkbox-input\"\n [checked]=\"checked()\"\n [disabled]=\"disabled()\"\n (change)=\"toggle()\"\n />\n <span class=\"checkbox-box\" [class.checkbox-indeterminate]=\"indeterminate() && !checked()\">\n @if (indeterminate() && !checked()) {\n <svg\n class=\"checkbox-check\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path d=\"M2 6h8\" />\n </svg>\n } @else {\n <svg\n class=\"checkbox-check\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path d=\"M2 6l3 3 5-6\" />\n </svg>\n }\n </span>\n <span class=\"checkbox-label\">\n <ng-content />\n </span>\n</label>\n" });
|
|
215
|
+
}
|
|
216
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Checkbox, decorators: [{
|
|
217
|
+
type: Component,
|
|
218
|
+
args: [{ selector: 'bsc-checkbox', imports: [], template: "<label class=\"checkbox\">\n <input\n type=\"checkbox\"\n class=\"checkbox-input\"\n [checked]=\"checked()\"\n [disabled]=\"disabled()\"\n (change)=\"toggle()\"\n />\n <span class=\"checkbox-box\" [class.checkbox-indeterminate]=\"indeterminate() && !checked()\">\n @if (indeterminate() && !checked()) {\n <svg\n class=\"checkbox-check\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path d=\"M2 6h8\" />\n </svg>\n } @else {\n <svg\n class=\"checkbox-check\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path d=\"M2 6l3 3 5-6\" />\n </svg>\n }\n </span>\n <span class=\"checkbox-label\">\n <ng-content />\n </span>\n</label>\n" }]
|
|
219
|
+
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }] } });
|
|
220
|
+
|
|
221
|
+
class DatePicker {
|
|
222
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DatePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
223
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: DatePicker, isStandalone: true, selector: "bsc-date-picker", ngImport: i0, template: "<p>date-picker works!</p>\n", styles: [""] });
|
|
224
|
+
}
|
|
225
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DatePicker, decorators: [{
|
|
226
|
+
type: Component,
|
|
227
|
+
args: [{ selector: 'bsc-date-picker', imports: [], template: "<p>date-picker works!</p>\n" }]
|
|
228
|
+
}] });
|
|
229
|
+
|
|
230
|
+
class Dropdown {
|
|
231
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Dropdown, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
232
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: Dropdown, isStandalone: true, selector: "bsc-dropdown", ngImport: i0, template: "<p>dropdown works!</p>\n", styles: [""] });
|
|
233
|
+
}
|
|
234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Dropdown, decorators: [{
|
|
235
|
+
type: Component,
|
|
236
|
+
args: [{ selector: 'bsc-dropdown', imports: [], template: "<p>dropdown works!</p>\n" }]
|
|
237
|
+
}] });
|
|
238
|
+
|
|
239
|
+
class FileUpload {
|
|
240
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: FileUpload, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
241
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: FileUpload, isStandalone: true, selector: "bsc-file-upload", ngImport: i0, template: "<p>file-upload works!</p>\n", styles: [""] });
|
|
242
|
+
}
|
|
243
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: FileUpload, decorators: [{
|
|
244
|
+
type: Component,
|
|
245
|
+
args: [{ selector: 'bsc-file-upload', imports: [], template: "<p>file-upload works!</p>\n" }]
|
|
246
|
+
}] });
|
|
247
|
+
|
|
248
|
+
class Footer {
|
|
249
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Footer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
250
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: Footer, isStandalone: true, selector: "bsc-footer", ngImport: i0, template: "<p>footer works!</p>\n", styles: [""] });
|
|
251
|
+
}
|
|
252
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Footer, decorators: [{
|
|
253
|
+
type: Component,
|
|
254
|
+
args: [{ selector: 'bsc-footer', imports: [], template: "<p>footer works!</p>\n" }]
|
|
255
|
+
}] });
|
|
256
|
+
|
|
257
|
+
class FormField {
|
|
258
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: FormField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
259
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: FormField, isStandalone: true, selector: "bsc-form-field", ngImport: i0, template: "<p>form-field works!</p>\n", styles: [""] });
|
|
260
|
+
}
|
|
261
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: FormField, decorators: [{
|
|
262
|
+
type: Component,
|
|
263
|
+
args: [{ selector: 'bsc-form-field', imports: [], template: "<p>form-field works!</p>\n" }]
|
|
264
|
+
}] });
|
|
265
|
+
|
|
266
|
+
class Header {
|
|
267
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Header, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
268
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: Header, isStandalone: true, selector: "bsc-header", ngImport: i0, template: "<nav class=\"header\" aria-label=\"Top navigation\">\n <div class=\"header-inner\">\n <div class=\"header-left\">\n <ng-content select=\"[headerLeft]\" />\n </div>\n <div class=\"header-right\">\n <ng-content select=\"[headerRight]\" />\n </div>\n </div>\n</nav>\n" });
|
|
269
|
+
}
|
|
270
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Header, decorators: [{
|
|
271
|
+
type: Component,
|
|
272
|
+
args: [{ selector: 'bsc-header', imports: [], template: "<nav class=\"header\" aria-label=\"Top navigation\">\n <div class=\"header-inner\">\n <div class=\"header-left\">\n <ng-content select=\"[headerLeft]\" />\n </div>\n <div class=\"header-right\">\n <ng-content select=\"[headerRight]\" />\n </div>\n </div>\n</nav>\n" }]
|
|
273
|
+
}] });
|
|
274
|
+
|
|
275
|
+
class Icon {
|
|
276
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Icon, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
277
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: Icon, isStandalone: true, selector: "bsc-icon", ngImport: i0, template: "<p>icon works!</p>\n", styles: [""] });
|
|
278
|
+
}
|
|
279
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Icon, decorators: [{
|
|
280
|
+
type: Component,
|
|
281
|
+
args: [{ selector: 'bsc-icon', imports: [], template: "<p>icon works!</p>\n" }]
|
|
282
|
+
}] });
|
|
283
|
+
|
|
284
|
+
class Input {
|
|
285
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
286
|
+
readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : {}), transform: booleanAttribute });
|
|
287
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
288
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
289
|
+
state = input('default', ...(ngDevMode ? [{ debugName: "state" }] : []));
|
|
290
|
+
type = input('text', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
291
|
+
inputClasses = computed(() => {
|
|
292
|
+
const classes = ['input', `input-${this.size()}`];
|
|
293
|
+
const s = this.state();
|
|
294
|
+
if (s !== 'default')
|
|
295
|
+
classes.push(`input-${s}`);
|
|
296
|
+
return classes.join(' ');
|
|
297
|
+
}, ...(ngDevMode ? [{ debugName: "inputClasses" }] : []));
|
|
298
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Input, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
299
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: Input, isStandalone: true, selector: "bsc-input", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<input\n [type]=\"type()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n [class]=\"inputClasses()\"\n/>\n" });
|
|
300
|
+
}
|
|
301
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Input, decorators: [{
|
|
302
|
+
type: Component,
|
|
303
|
+
args: [{ selector: 'bsc-input', imports: [], template: "<input\n [type]=\"type()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n [class]=\"inputClasses()\"\n/>\n" }]
|
|
304
|
+
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }] } });
|
|
305
|
+
|
|
306
|
+
class Label {
|
|
307
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
308
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : {}), transform: booleanAttribute });
|
|
309
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
310
|
+
labelClasses = computed(() => {
|
|
311
|
+
const classes = ['label', `label-${this.size()}`];
|
|
312
|
+
if (this.disabled())
|
|
313
|
+
classes.push('label-disabled');
|
|
314
|
+
return classes.join(' ');
|
|
315
|
+
}, ...(ngDevMode ? [{ debugName: "labelClasses" }] : []));
|
|
316
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Label, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
317
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: Label, isStandalone: true, selector: "bsc-label", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -->\n<label [class]=\"labelClasses()\">\n <ng-content />\n @if (required()) {\n <span class=\"label-required\">*</span>\n }\n</label>\n" });
|
|
318
|
+
}
|
|
319
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Label, decorators: [{
|
|
320
|
+
type: Component,
|
|
321
|
+
args: [{ selector: 'bsc-label', imports: [], template: "<!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -->\n<label [class]=\"labelClasses()\">\n <ng-content />\n @if (required()) {\n <span class=\"label-required\">*</span>\n }\n</label>\n" }]
|
|
322
|
+
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
323
|
+
|
|
324
|
+
class Modal {
|
|
325
|
+
closeOnBackdrop = input(true, { ...(ngDevMode ? { debugName: "closeOnBackdrop" } : {}), transform: booleanAttribute });
|
|
326
|
+
closeOnEsc = input(true, { ...(ngDevMode ? { debugName: "closeOnEsc" } : {}), transform: booleanAttribute });
|
|
327
|
+
confirmDisabled = input(false, { ...(ngDevMode ? { debugName: "confirmDisabled" } : {}), transform: booleanAttribute });
|
|
328
|
+
closed = output();
|
|
329
|
+
confirmed = output();
|
|
330
|
+
confirmText = input('Conferma', ...(ngDevMode ? [{ debugName: "confirmText" }] : []));
|
|
331
|
+
open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
332
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
333
|
+
title = input('', ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
334
|
+
panelClasses = computed(() => {
|
|
335
|
+
return `bsc-modal-panel bsc-modal-${this.size()}`;
|
|
336
|
+
}, ...(ngDevMode ? [{ debugName: "panelClasses" }] : []));
|
|
337
|
+
close() {
|
|
338
|
+
this.open.set(false);
|
|
339
|
+
this.closed.emit();
|
|
340
|
+
}
|
|
341
|
+
onBackdropClick() {
|
|
342
|
+
if (this.closeOnBackdrop()) {
|
|
343
|
+
this.close();
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
onConfirm() {
|
|
347
|
+
this.confirmed.emit();
|
|
348
|
+
}
|
|
349
|
+
onEscKey() {
|
|
350
|
+
if (this.open() && this.closeOnEsc()) {
|
|
351
|
+
this.close();
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Modal, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
355
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: Modal, isStandalone: true, selector: "bsc-modal", inputs: { closeOnBackdrop: { classPropertyName: "closeOnBackdrop", publicName: "closeOnBackdrop", isSignal: true, isRequired: false, transformFunction: null }, closeOnEsc: { classPropertyName: "closeOnEsc", publicName: "closeOnEsc", isSignal: true, isRequired: false, transformFunction: null }, confirmDisabled: { classPropertyName: "confirmDisabled", publicName: "confirmDisabled", isSignal: true, isRequired: false, transformFunction: null }, confirmText: { classPropertyName: "confirmText", publicName: "confirmText", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed", confirmed: "confirmed", open: "openChange" }, host: { listeners: { "document:keydown.escape": "onEscKey()" } }, ngImport: i0, template: "@if (open()) {\n <!-- Backdrop -->\n <div\n class=\"bsc-modal-backdrop\"\n (click)=\"onBackdropClick()\"\n (keydown.escape)=\"close()\"\n tabindex=\"-1\"\n role=\"button\"\n aria-label=\"Close modal\"\n ></div>\n\n <!-- Modal -->\n <div class=\"bsc-modal-overlay\">\n <div [class]=\"panelClasses()\">\n <!-- Modal content -->\n <div class=\"bsc-modal-content\" role=\"dialog\" aria-modal=\"true\">\n <!-- Header -->\n <div class=\"bsc-modal-header\">\n <h3 class=\"bsc-modal-title\">{{ title() }}</h3>\n <button type=\"button\" class=\"bsc-modal-close\" (click)=\"close()\">\n <svg\n class=\"w-5 h-5\"\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <path\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M6 18 17.94 6M18 18 6.06 6\"\n />\n </svg>\n <span class=\"sr-only\">Close modal</span>\n </button>\n </div>\n\n <!-- Body (content projection) -->\n <div class=\"bsc-modal-body\">\n <ng-content />\n </div>\n\n <!-- Footer -->\n <div class=\"bsc-modal-footer\">\n <button\n type=\"button\"\n class=\"bsc-modal-confirm-btn\"\n [disabled]=\"confirmDisabled()\"\n (click)=\"onConfirm()\"\n >\n {{ confirmText() }}\n </button>\n <ng-content select=\"[modalFooter]\" />\n </div>\n </div>\n </div>\n </div>\n}\n" });
|
|
356
|
+
}
|
|
357
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Modal, decorators: [{
|
|
358
|
+
type: Component,
|
|
359
|
+
args: [{ selector: 'bsc-modal', imports: [], template: "@if (open()) {\n <!-- Backdrop -->\n <div\n class=\"bsc-modal-backdrop\"\n (click)=\"onBackdropClick()\"\n (keydown.escape)=\"close()\"\n tabindex=\"-1\"\n role=\"button\"\n aria-label=\"Close modal\"\n ></div>\n\n <!-- Modal -->\n <div class=\"bsc-modal-overlay\">\n <div [class]=\"panelClasses()\">\n <!-- Modal content -->\n <div class=\"bsc-modal-content\" role=\"dialog\" aria-modal=\"true\">\n <!-- Header -->\n <div class=\"bsc-modal-header\">\n <h3 class=\"bsc-modal-title\">{{ title() }}</h3>\n <button type=\"button\" class=\"bsc-modal-close\" (click)=\"close()\">\n <svg\n class=\"w-5 h-5\"\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <path\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M6 18 17.94 6M18 18 6.06 6\"\n />\n </svg>\n <span class=\"sr-only\">Close modal</span>\n </button>\n </div>\n\n <!-- Body (content projection) -->\n <div class=\"bsc-modal-body\">\n <ng-content />\n </div>\n\n <!-- Footer -->\n <div class=\"bsc-modal-footer\">\n <button\n type=\"button\"\n class=\"bsc-modal-confirm-btn\"\n [disabled]=\"confirmDisabled()\"\n (click)=\"onConfirm()\"\n >\n {{ confirmText() }}\n </button>\n <ng-content select=\"[modalFooter]\" />\n </div>\n </div>\n </div>\n </div>\n}\n" }]
|
|
360
|
+
}], propDecorators: { closeOnBackdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnBackdrop", required: false }] }], closeOnEsc: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEsc", required: false }] }], confirmDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmDisabled", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], confirmed: [{ type: i0.Output, args: ["confirmed"] }], confirmText: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmText", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], onEscKey: [{
|
|
361
|
+
type: HostListener,
|
|
362
|
+
args: ['document:keydown.escape']
|
|
363
|
+
}] } });
|
|
364
|
+
|
|
365
|
+
class Navigation {
|
|
366
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Navigation, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
367
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: Navigation, isStandalone: true, selector: "bsc-navigation", ngImport: i0, template: "<p>navigation works!</p>\n", styles: [""] });
|
|
368
|
+
}
|
|
369
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Navigation, decorators: [{
|
|
370
|
+
type: Component,
|
|
371
|
+
args: [{ selector: 'bsc-navigation', imports: [], template: "<p>navigation works!</p>\n" }]
|
|
372
|
+
}] });
|
|
373
|
+
|
|
374
|
+
class Select {
|
|
375
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
376
|
+
multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : {}), transform: booleanAttribute });
|
|
377
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
378
|
+
isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
379
|
+
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
380
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
381
|
+
state = input('default', ...(ngDevMode ? [{ debugName: "state" }] : []));
|
|
382
|
+
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
383
|
+
el = inject(ElementRef);
|
|
384
|
+
displayText = computed(() => {
|
|
385
|
+
const val = this.value();
|
|
386
|
+
const opts = this.options();
|
|
387
|
+
if (val === null || val === undefined)
|
|
388
|
+
return this.placeholder();
|
|
389
|
+
if (Array.isArray(val)) {
|
|
390
|
+
if (val.length === 0)
|
|
391
|
+
return this.placeholder();
|
|
392
|
+
const labels = val.map((v) => opts.find((o) => o.value === v)?.label ?? v).join(', ');
|
|
393
|
+
return labels;
|
|
394
|
+
}
|
|
395
|
+
return (opts.find((o) => o.value === val)?.label ?? val) || this.placeholder();
|
|
396
|
+
}, ...(ngDevMode ? [{ debugName: "displayText" }] : []));
|
|
397
|
+
triggerClasses = computed(() => {
|
|
398
|
+
const classes = ['select-trigger', `select-${this.size()}`];
|
|
399
|
+
const s = this.state();
|
|
400
|
+
if (s !== 'default')
|
|
401
|
+
classes.push(`select-${s}`);
|
|
402
|
+
if (this.disabled())
|
|
403
|
+
classes.push('select-disabled');
|
|
404
|
+
return classes.join(' ');
|
|
405
|
+
}, ...(ngDevMode ? [{ debugName: "triggerClasses" }] : []));
|
|
406
|
+
isSelected(option) {
|
|
407
|
+
const val = this.value();
|
|
408
|
+
if (Array.isArray(val))
|
|
409
|
+
return val.includes(option.value);
|
|
410
|
+
return val === option.value;
|
|
411
|
+
}
|
|
412
|
+
onDocumentClick(event) {
|
|
413
|
+
if (!this.el.nativeElement.contains(event.target)) {
|
|
414
|
+
this.isOpen.set(false);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
selectOption(option) {
|
|
418
|
+
if (this.multiple()) {
|
|
419
|
+
const current = this.value() ?? [];
|
|
420
|
+
const idx = current.indexOf(option.value);
|
|
421
|
+
if (idx === -1) {
|
|
422
|
+
this.value.set([...current, option.value]);
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
this.value.set(current.filter((v) => v !== option.value));
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
else {
|
|
429
|
+
this.value.set(option.value);
|
|
430
|
+
this.isOpen.set(false);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
toggle() {
|
|
434
|
+
if (this.disabled())
|
|
435
|
+
return;
|
|
436
|
+
this.isOpen.update((v) => !v);
|
|
437
|
+
}
|
|
438
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Select, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
439
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: Select, isStandalone: true, selector: "bsc-select", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { listeners: { "document:click": "onDocumentClick($event)" } }, ngImport: i0, template: "<div class=\"select-wrapper\">\n <button type=\"button\" [class]=\"triggerClasses()\" [disabled]=\"disabled()\" (click)=\"toggle()\">\n <span [class.select-placeholder]=\"displayText() === placeholder()\">\n {{ displayText() }}\n </span>\n <svg\n class=\"select-icon\"\n [class.select-chevron-open]=\"isOpen()\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M6 9l6 6 6-6\" />\n </svg>\n </button>\n\n @if (isOpen()) {\n <ul class=\"select-panel\" role=\"listbox\">\n @for (option of options(); track option.value) {\n <li\n class=\"select-option\"\n [class.select-option-selected]=\"isSelected(option)\"\n role=\"option\"\n [attr.aria-selected]=\"isSelected(option)\"\n tabindex=\"0\"\n (click)=\"selectOption(option)\"\n (keydown.enter)=\"selectOption(option)\"\n (keydown.space)=\"selectOption(option)\"\n >\n @if (multiple()) {\n <span class=\"select-checkbox\" [class.select-checkbox-checked]=\"isSelected(option)\">\n @if (isSelected(option)) {\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M20 6L9 17l-5-5\" />\n </svg>\n }\n </span>\n }\n {{ option.label }}\n </li>\n }\n </ul>\n }\n</div>\n", styles: ["@reference \"tailwindcss\";.select-wrapper{@apply relative inline-block w-full;}.select-trigger{@apply w-full appearance-none border border-ink-300 rounded-base bg-surface text-ink-900 pr-10 cursor-pointer text-left relative transition-colors duration-200 focus:outline-none focus:ring-4 focus:ring-primary-200 focus:border-primary;}.select-disabled{@apply opacity-50 cursor-not-allowed bg-surface-muted;}.select-placeholder{@apply text-ink-400;}.select-sm{@apply text-sm px-3 py-2;}.select-md{@apply text-sm px-4 py-2.5;}.select-lg{@apply text-base px-5 py-3;}.select-error{@apply border-error-500 focus:ring-error-200 focus:border-error-500;}.select-success{@apply border-success-500 focus:ring-success-200 focus:border-success-500;}.select-icon{@apply absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-ink-400 transition-transform duration-200;}.select-chevron-open{@apply rotate-180;}.select-panel{@apply absolute z-50 mt-1 w-full bg-surface border border-ink-200 rounded-base shadow-lg max-h-60 overflow-y-auto py-1 list-none m-0 p-0;}.select-option{@apply px-4 py-2.5 text-sm text-ink-900 cursor-pointer flex items-center gap-2 transition-colors duration-100 hover:bg-ink-50;}.select-option-selected{@apply bg-primary-50 text-primary-700;}.select-checkbox{@apply inline-flex items-center justify-center w-4 h-4 border border-ink-300 rounded-sm bg-surface flex-shrink-0;}.select-checkbox-checked{@apply bg-primary border-primary text-white;}\n"] });
|
|
440
|
+
}
|
|
441
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Select, decorators: [{
|
|
442
|
+
type: Component,
|
|
443
|
+
args: [{ selector: 'bsc-select', imports: [], template: "<div class=\"select-wrapper\">\n <button type=\"button\" [class]=\"triggerClasses()\" [disabled]=\"disabled()\" (click)=\"toggle()\">\n <span [class.select-placeholder]=\"displayText() === placeholder()\">\n {{ displayText() }}\n </span>\n <svg\n class=\"select-icon\"\n [class.select-chevron-open]=\"isOpen()\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M6 9l6 6 6-6\" />\n </svg>\n </button>\n\n @if (isOpen()) {\n <ul class=\"select-panel\" role=\"listbox\">\n @for (option of options(); track option.value) {\n <li\n class=\"select-option\"\n [class.select-option-selected]=\"isSelected(option)\"\n role=\"option\"\n [attr.aria-selected]=\"isSelected(option)\"\n tabindex=\"0\"\n (click)=\"selectOption(option)\"\n (keydown.enter)=\"selectOption(option)\"\n (keydown.space)=\"selectOption(option)\"\n >\n @if (multiple()) {\n <span class=\"select-checkbox\" [class.select-checkbox-checked]=\"isSelected(option)\">\n @if (isSelected(option)) {\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M20 6L9 17l-5-5\" />\n </svg>\n }\n </span>\n }\n {{ option.label }}\n </li>\n }\n </ul>\n }\n</div>\n", styles: ["@reference \"tailwindcss\";.select-wrapper{@apply relative inline-block w-full;}.select-trigger{@apply w-full appearance-none border border-ink-300 rounded-base bg-surface text-ink-900 pr-10 cursor-pointer text-left relative transition-colors duration-200 focus:outline-none focus:ring-4 focus:ring-primary-200 focus:border-primary;}.select-disabled{@apply opacity-50 cursor-not-allowed bg-surface-muted;}.select-placeholder{@apply text-ink-400;}.select-sm{@apply text-sm px-3 py-2;}.select-md{@apply text-sm px-4 py-2.5;}.select-lg{@apply text-base px-5 py-3;}.select-error{@apply border-error-500 focus:ring-error-200 focus:border-error-500;}.select-success{@apply border-success-500 focus:ring-success-200 focus:border-success-500;}.select-icon{@apply absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-ink-400 transition-transform duration-200;}.select-chevron-open{@apply rotate-180;}.select-panel{@apply absolute z-50 mt-1 w-full bg-surface border border-ink-200 rounded-base shadow-lg max-h-60 overflow-y-auto py-1 list-none m-0 p-0;}.select-option{@apply px-4 py-2.5 text-sm text-ink-900 cursor-pointer flex items-center gap-2 transition-colors duration-100 hover:bg-ink-50;}.select-option-selected{@apply bg-primary-50 text-primary-700;}.select-checkbox{@apply inline-flex items-center justify-center w-4 h-4 border border-ink-300 rounded-sm bg-surface flex-shrink-0;}.select-checkbox-checked{@apply bg-primary border-primary text-white;}\n"] }]
|
|
444
|
+
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], onDocumentClick: [{
|
|
445
|
+
type: HostListener,
|
|
446
|
+
args: ['document:click', ['$event']]
|
|
447
|
+
}] } });
|
|
448
|
+
|
|
449
|
+
class Pagination {
|
|
450
|
+
pageSizeOptions = input([10, 25, 50, 100], ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : []));
|
|
451
|
+
showPageSize = input(false, { ...(ngDevMode ? { debugName: "showPageSize" } : {}), transform: booleanAttribute });
|
|
452
|
+
totalItems = input(0, ...(ngDevMode ? [{ debugName: "totalItems" }] : []));
|
|
453
|
+
currentPage = model(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
|
|
454
|
+
pageSize = model(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
455
|
+
pageSizeSelectOptions = computed(() => {
|
|
456
|
+
return this.pageSizeOptions().map((n) => ({ value: String(n), label: `${n} / page` }));
|
|
457
|
+
}, ...(ngDevMode ? [{ debugName: "pageSizeSelectOptions" }] : []));
|
|
458
|
+
pageSizeValue = computed(() => String(this.pageSize()), ...(ngDevMode ? [{ debugName: "pageSizeValue" }] : []));
|
|
459
|
+
totalPages = computed(() => {
|
|
460
|
+
return Math.max(1, Math.ceil(this.totalItems() / this.pageSize()));
|
|
461
|
+
}, ...(ngDevMode ? [{ debugName: "totalPages" }] : []));
|
|
462
|
+
visiblePages = computed(() => {
|
|
463
|
+
const total = this.totalPages();
|
|
464
|
+
const current = this.currentPage();
|
|
465
|
+
if (total <= 7) {
|
|
466
|
+
return Array.from({ length: total }, (_, i) => i + 1);
|
|
467
|
+
}
|
|
468
|
+
// Always 7 slots: 5 numbers + up to 2 ellipsis
|
|
469
|
+
if (current <= 4) {
|
|
470
|
+
return [1, 2, 3, 4, 5, '...', total];
|
|
471
|
+
}
|
|
472
|
+
if (current >= total - 3) {
|
|
473
|
+
return [1, '...', total - 4, total - 3, total - 2, total - 1, total];
|
|
474
|
+
}
|
|
475
|
+
return [1, '...', current - 1, current, current + 1, '...', total];
|
|
476
|
+
}, ...(ngDevMode ? [{ debugName: "visiblePages" }] : []));
|
|
477
|
+
first() {
|
|
478
|
+
this.goToPage(1);
|
|
479
|
+
}
|
|
480
|
+
goToPage(page) {
|
|
481
|
+
this.currentPage.set(Math.max(1, Math.min(page, this.totalPages())));
|
|
482
|
+
}
|
|
483
|
+
last() {
|
|
484
|
+
this.goToPage(this.totalPages());
|
|
485
|
+
}
|
|
486
|
+
next() {
|
|
487
|
+
this.goToPage(this.currentPage() + 1);
|
|
488
|
+
}
|
|
489
|
+
onPageSizeChange(value) {
|
|
490
|
+
if (value && !Array.isArray(value)) {
|
|
491
|
+
this.pageSize.set(Number(value));
|
|
492
|
+
this.currentPage.set(1);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
previous() {
|
|
496
|
+
this.goToPage(this.currentPage() - 1);
|
|
497
|
+
}
|
|
498
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Pagination, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
499
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: Pagination, isStandalone: true, selector: "bsc-pagination", inputs: { pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showPageSize: { classPropertyName: "showPageSize", publicName: "showPageSize", isSignal: true, isRequired: false, transformFunction: null }, totalItems: { classPropertyName: "totalItems", publicName: "totalItems", isSignal: true, isRequired: false, transformFunction: null }, currentPage: { classPropertyName: "currentPage", publicName: "currentPage", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { currentPage: "currentPageChange", pageSize: "pageSizeChange" }, ngImport: i0, template: "<nav class=\"pagination\">\n <ul class=\"pagination-list\">\n <li>\n <button\n class=\"pagination-btn pagination-btn-first\"\n [class.pagination-btn-disabled]=\"currentPage() === 1\"\n [disabled]=\"currentPage() === 1\"\n (click)=\"previous()\"\n >\n \u2039\n </button>\n </li>\n @for (page of visiblePages(); track $index) {\n @if (page === '...') {\n <li>\n <span class=\"pagination-btn pagination-btn-page pagination-ellipsis\">\u2026</span>\n </li>\n } @else {\n <li>\n <button\n class=\"pagination-btn pagination-btn-page\"\n [class.pagination-btn-active]=\"page === currentPage()\"\n (click)=\"goToPage(+page)\"\n >\n {{ page }}\n </button>\n </li>\n }\n }\n <li>\n <button\n class=\"pagination-btn pagination-btn-last\"\n [class.pagination-btn-disabled]=\"currentPage() === totalPages()\"\n [disabled]=\"currentPage() === totalPages()\"\n (click)=\"next()\"\n >\n \u203A\n </button>\n </li>\n </ul>\n\n @if (showPageSize()) {\n <bsc-select\n size=\"sm\"\n [options]=\"pageSizeSelectOptions()\"\n [value]=\"pageSizeValue()\"\n (valueChange)=\"onPageSizeChange($event)\"\n />\n }\n</nav>\n", styles: [".pagination{display:flex;align-items:center;gap:1rem}.pagination-list{display:flex;list-style:none;margin:0;padding:0;font-size:var(--text-sm)}.pagination-list>li+li>.pagination-btn{margin-left:-1px}.pagination-btn{display:flex;align-items:center;justify-content:center;background:var(--color-surface);border:1px solid var(--color-ink-200);color:var(--color-ink-700);font-weight:500;font-size:var(--text-sm);height:2.25rem;cursor:pointer;box-shadow:var(--shadow-xs);transition:background .15s,color .15s}.pagination-btn:hover:not(:disabled):not(.pagination-ellipsis){background:var(--color-ink-100);color:var(--color-ink-900)}.pagination-btn-first{border-radius:var(--radius-base) 0 0 var(--radius-base);padding:0 .5rem}.pagination-btn-prev,.pagination-btn-next{padding:0 .5rem}.pagination-btn-last{border-radius:0 var(--radius-base) var(--radius-base) 0;padding:0 .5rem}.pagination-btn-page{width:2.25rem}.pagination-btn-active{color:var(--color-primary);background:var(--color-ink-100)}.pagination-btn-disabled{opacity:.5;pointer-events:none}.pagination-ellipsis{cursor:default;pointer-events:none}\n"], dependencies: [{ kind: "component", type: Select, selector: "bsc-select", inputs: ["disabled", "multiple", "placeholder", "options", "size", "state", "value"], outputs: ["valueChange"] }] });
|
|
500
|
+
}
|
|
501
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Pagination, decorators: [{
|
|
502
|
+
type: Component,
|
|
503
|
+
args: [{ selector: 'bsc-pagination', imports: [Select], template: "<nav class=\"pagination\">\n <ul class=\"pagination-list\">\n <li>\n <button\n class=\"pagination-btn pagination-btn-first\"\n [class.pagination-btn-disabled]=\"currentPage() === 1\"\n [disabled]=\"currentPage() === 1\"\n (click)=\"previous()\"\n >\n \u2039\n </button>\n </li>\n @for (page of visiblePages(); track $index) {\n @if (page === '...') {\n <li>\n <span class=\"pagination-btn pagination-btn-page pagination-ellipsis\">\u2026</span>\n </li>\n } @else {\n <li>\n <button\n class=\"pagination-btn pagination-btn-page\"\n [class.pagination-btn-active]=\"page === currentPage()\"\n (click)=\"goToPage(+page)\"\n >\n {{ page }}\n </button>\n </li>\n }\n }\n <li>\n <button\n class=\"pagination-btn pagination-btn-last\"\n [class.pagination-btn-disabled]=\"currentPage() === totalPages()\"\n [disabled]=\"currentPage() === totalPages()\"\n (click)=\"next()\"\n >\n \u203A\n </button>\n </li>\n </ul>\n\n @if (showPageSize()) {\n <bsc-select\n size=\"sm\"\n [options]=\"pageSizeSelectOptions()\"\n [value]=\"pageSizeValue()\"\n (valueChange)=\"onPageSizeChange($event)\"\n />\n }\n</nav>\n", styles: [".pagination{display:flex;align-items:center;gap:1rem}.pagination-list{display:flex;list-style:none;margin:0;padding:0;font-size:var(--text-sm)}.pagination-list>li+li>.pagination-btn{margin-left:-1px}.pagination-btn{display:flex;align-items:center;justify-content:center;background:var(--color-surface);border:1px solid var(--color-ink-200);color:var(--color-ink-700);font-weight:500;font-size:var(--text-sm);height:2.25rem;cursor:pointer;box-shadow:var(--shadow-xs);transition:background .15s,color .15s}.pagination-btn:hover:not(:disabled):not(.pagination-ellipsis){background:var(--color-ink-100);color:var(--color-ink-900)}.pagination-btn-first{border-radius:var(--radius-base) 0 0 var(--radius-base);padding:0 .5rem}.pagination-btn-prev,.pagination-btn-next{padding:0 .5rem}.pagination-btn-last{border-radius:0 var(--radius-base) var(--radius-base) 0;padding:0 .5rem}.pagination-btn-page{width:2.25rem}.pagination-btn-active{color:var(--color-primary);background:var(--color-ink-100)}.pagination-btn-disabled{opacity:.5;pointer-events:none}.pagination-ellipsis{cursor:default;pointer-events:none}\n"] }]
|
|
504
|
+
}], propDecorators: { pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], showPageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageSize", required: false }] }], totalItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalItems", required: false }] }], currentPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentPage", required: false }] }, { type: i0.Output, args: ["currentPageChange"] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }] } });
|
|
505
|
+
|
|
506
|
+
class ProgressBar {
|
|
507
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
508
|
+
labelPosition = input('none', ...(ngDevMode ? [{ debugName: "labelPosition" }] : []));
|
|
509
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
510
|
+
value = input(0, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
511
|
+
variant = input('brand', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
512
|
+
barClasses = computed(() => {
|
|
513
|
+
const pos = this.labelPosition();
|
|
514
|
+
const classes = ['progress-bar', `progress-bar-${this.variant()}`];
|
|
515
|
+
if (pos === 'inside') {
|
|
516
|
+
classes.push('progress-bar-inside');
|
|
517
|
+
}
|
|
518
|
+
else {
|
|
519
|
+
classes.push(`progress-bar-${this.size()}`);
|
|
520
|
+
}
|
|
521
|
+
return classes.join(' ');
|
|
522
|
+
}, ...(ngDevMode ? [{ debugName: "barClasses" }] : []));
|
|
523
|
+
clampedValue = computed(() => {
|
|
524
|
+
return Math.max(0, Math.min(100, this.value()));
|
|
525
|
+
}, ...(ngDevMode ? [{ debugName: "clampedValue" }] : []));
|
|
526
|
+
barWidth = computed(() => {
|
|
527
|
+
return `${this.clampedValue()}%`;
|
|
528
|
+
}, ...(ngDevMode ? [{ debugName: "barWidth" }] : []));
|
|
529
|
+
labelClasses = computed(() => {
|
|
530
|
+
return `progress-label progress-label-${this.variant()}`;
|
|
531
|
+
}, ...(ngDevMode ? [{ debugName: "labelClasses" }] : []));
|
|
532
|
+
trackClasses = computed(() => {
|
|
533
|
+
return `progress-track progress-track-${this.size()}`;
|
|
534
|
+
}, ...(ngDevMode ? [{ debugName: "trackClasses" }] : []));
|
|
535
|
+
valueText = computed(() => {
|
|
536
|
+
return `${this.clampedValue()}%`;
|
|
537
|
+
}, ...(ngDevMode ? [{ debugName: "valueText" }] : []));
|
|
538
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ProgressBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
539
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ProgressBar, isStandalone: true, selector: "bsc-progress-bar", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@switch (labelPosition()) {\n @case ('outside') {\n <!-- Outside: label + percentage on top -->\n <div class=\"progress-outside-header\">\n <span [class]=\"labelClasses()\">{{ label() }}</span>\n <span class=\"progress-outside-value\">{{ valueText() }}</span>\n </div>\n <div [class]=\"trackClasses()\">\n <div [class]=\"barClasses()\" [style.width]=\"barWidth()\"></div>\n </div>\n }\n @case ('inside') {\n <!-- Inside: percentage inside the bar -->\n <div class=\"progress-track progress-track-inside\">\n <div [class]=\"barClasses()\" [style.width]=\"barWidth()\">{{ valueText() }}</div>\n </div>\n }\n @default {\n <!-- None: optional label on top, no percentage -->\n @if (label()) {\n <div [class]=\"labelClasses()\">{{ label() }}</div>\n }\n <div [class]=\"trackClasses()\">\n <div [class]=\"barClasses()\" [style.width]=\"barWidth()\"></div>\n </div>\n }\n}\n" });
|
|
540
|
+
}
|
|
541
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ProgressBar, decorators: [{
|
|
542
|
+
type: Component,
|
|
543
|
+
args: [{ selector: 'bsc-progress-bar', imports: [], template: "@switch (labelPosition()) {\n @case ('outside') {\n <!-- Outside: label + percentage on top -->\n <div class=\"progress-outside-header\">\n <span [class]=\"labelClasses()\">{{ label() }}</span>\n <span class=\"progress-outside-value\">{{ valueText() }}</span>\n </div>\n <div [class]=\"trackClasses()\">\n <div [class]=\"barClasses()\" [style.width]=\"barWidth()\"></div>\n </div>\n }\n @case ('inside') {\n <!-- Inside: percentage inside the bar -->\n <div class=\"progress-track progress-track-inside\">\n <div [class]=\"barClasses()\" [style.width]=\"barWidth()\">{{ valueText() }}</div>\n </div>\n }\n @default {\n <!-- None: optional label on top, no percentage -->\n @if (label()) {\n <div [class]=\"labelClasses()\">{{ label() }}</div>\n }\n <div [class]=\"trackClasses()\">\n <div [class]=\"barClasses()\" [style.width]=\"barWidth()\"></div>\n </div>\n }\n}\n" }]
|
|
544
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
|
|
545
|
+
|
|
546
|
+
class Radio {
|
|
547
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
548
|
+
checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
549
|
+
name = input('', ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
550
|
+
value = input('', ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
551
|
+
onSelect() {
|
|
552
|
+
if (!this.disabled()) {
|
|
553
|
+
this.checked.set(true);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Radio, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
557
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: Radio, isStandalone: true, selector: "bsc-radio", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, ngImport: i0, template: "<label class=\"radio\">\n <input\n type=\"radio\"\n class=\"radio-input\"\n [name]=\"name()\"\n [value]=\"value()\"\n [checked]=\"checked()\"\n [disabled]=\"disabled()\"\n (change)=\"onSelect()\"\n />\n <span class=\"radio-circle\"></span>\n <span class=\"radio-label\">\n <ng-content />\n </span>\n</label>\n" });
|
|
558
|
+
}
|
|
559
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Radio, decorators: [{
|
|
560
|
+
type: Component,
|
|
561
|
+
args: [{ selector: 'bsc-radio', imports: [], template: "<label class=\"radio\">\n <input\n type=\"radio\"\n class=\"radio-input\"\n [name]=\"name()\"\n [value]=\"value()\"\n [checked]=\"checked()\"\n [disabled]=\"disabled()\"\n (change)=\"onSelect()\"\n />\n <span class=\"radio-circle\"></span>\n <span class=\"radio-label\">\n <ng-content />\n </span>\n</label>\n" }]
|
|
562
|
+
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
|
|
563
|
+
|
|
564
|
+
class SearchBar {
|
|
565
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SearchBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
566
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: SearchBar, isStandalone: true, selector: "bsc-search-bar", ngImport: i0, template: "<p>search-bar works!</p>\n", styles: [""] });
|
|
567
|
+
}
|
|
568
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SearchBar, decorators: [{
|
|
569
|
+
type: Component,
|
|
570
|
+
args: [{ selector: 'bsc-search-bar', imports: [], template: "<p>search-bar works!</p>\n" }]
|
|
571
|
+
}] });
|
|
572
|
+
|
|
573
|
+
class SidebarService {
|
|
574
|
+
isPinned = signal(this.loadPinned(), ...(ngDevMode ? [{ debugName: "isPinned" }] : []));
|
|
575
|
+
isVisible = signal(this.loadPinned(), ...(ngDevMode ? [{ debugName: "isVisible" }] : []));
|
|
576
|
+
blockShow = false;
|
|
577
|
+
hideTimeout = null;
|
|
578
|
+
STORAGE_KEY = 'sidebar-pinned';
|
|
579
|
+
hide() {
|
|
580
|
+
if (this.isPinned())
|
|
581
|
+
return;
|
|
582
|
+
this.clearHideTimeout();
|
|
583
|
+
this.hideTimeout = setTimeout(() => {
|
|
584
|
+
this.isVisible.set(false);
|
|
585
|
+
this.hideTimeout = null;
|
|
586
|
+
}, 150);
|
|
587
|
+
}
|
|
588
|
+
show() {
|
|
589
|
+
if (this.blockShow)
|
|
590
|
+
return;
|
|
591
|
+
this.clearHideTimeout();
|
|
592
|
+
if (!this.isPinned()) {
|
|
593
|
+
this.isVisible.set(true);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
toggle() {
|
|
597
|
+
this.clearHideTimeout();
|
|
598
|
+
this.isVisible.update((v) => !v);
|
|
599
|
+
}
|
|
600
|
+
togglePin() {
|
|
601
|
+
const wasPinned = this.isPinned();
|
|
602
|
+
const pinned = !wasPinned;
|
|
603
|
+
this.isPinned.set(pinned);
|
|
604
|
+
this.savePinned(pinned);
|
|
605
|
+
if (pinned) {
|
|
606
|
+
this.isVisible.set(true);
|
|
607
|
+
this.clearHideTimeout();
|
|
608
|
+
}
|
|
609
|
+
else {
|
|
610
|
+
this.isVisible.set(false);
|
|
611
|
+
this.clearHideTimeout();
|
|
612
|
+
this.blockShow = true;
|
|
613
|
+
setTimeout(() => (this.blockShow = false), 300);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
clearHideTimeout() {
|
|
617
|
+
if (this.hideTimeout) {
|
|
618
|
+
clearTimeout(this.hideTimeout);
|
|
619
|
+
this.hideTimeout = null;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
loadPinned() {
|
|
623
|
+
try {
|
|
624
|
+
return localStorage.getItem(this.STORAGE_KEY) === 'true';
|
|
625
|
+
}
|
|
626
|
+
catch {
|
|
627
|
+
return false;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
savePinned(pinned) {
|
|
631
|
+
try {
|
|
632
|
+
localStorage.setItem(this.STORAGE_KEY, String(pinned));
|
|
633
|
+
}
|
|
634
|
+
catch {
|
|
635
|
+
// ignore (e.g. incognito)
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SidebarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
639
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SidebarService, providedIn: 'root' });
|
|
640
|
+
}
|
|
641
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SidebarService, decorators: [{
|
|
642
|
+
type: Injectable,
|
|
643
|
+
args: [{
|
|
644
|
+
providedIn: 'root',
|
|
645
|
+
}]
|
|
646
|
+
}] });
|
|
647
|
+
|
|
648
|
+
class Sidebar {
|
|
649
|
+
hasHeader = input(false, { ...(ngDevMode ? { debugName: "hasHeader" } : {}), transform: booleanAttribute });
|
|
650
|
+
sidebar = inject(SidebarService);
|
|
651
|
+
sidebarClasses = computed(() => {
|
|
652
|
+
const visible = this.sidebar.isVisible();
|
|
653
|
+
const classes = ['sidebar', visible ? 'sidebar-visible' : 'sidebar-hidden'];
|
|
654
|
+
if (this.hasHeader())
|
|
655
|
+
classes.push('sidebar-with-header');
|
|
656
|
+
return classes.join(' ');
|
|
657
|
+
}, ...(ngDevMode ? [{ debugName: "sidebarClasses" }] : []));
|
|
658
|
+
onMouseEnter() {
|
|
659
|
+
this.sidebar.show();
|
|
660
|
+
}
|
|
661
|
+
onMouseLeave() {
|
|
662
|
+
this.sidebar.hide();
|
|
663
|
+
}
|
|
664
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Sidebar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
665
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: Sidebar, isStandalone: true, selector: "bsc-sidebar", inputs: { hasHeader: { classPropertyName: "hasHeader", publicName: "hasHeader", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<!-- Invisible hover trigger at left edge (shows sidebar on hover when unpinned) -->\n@if (!sidebar.isVisible()) {\n <div class=\"sidebar-trigger\" (mouseenter)=\"onMouseEnter()\"></div>\n}\n\n<aside\n [class]=\"sidebarClasses()\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n aria-label=\"Sidebar\"\n>\n <!-- Header -->\n <div class=\"sidebar-header\">\n <ng-content select=\"[sidebarHeader]\" />\n </div>\n\n <!-- Body (scrollable) -->\n <div class=\"sidebar-body\">\n <ng-content />\n </div>\n\n <!-- Footer (optional) -->\n <ng-content select=\"[sidebarFooter]\" />\n</aside>\n" });
|
|
666
|
+
}
|
|
667
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Sidebar, decorators: [{
|
|
668
|
+
type: Component,
|
|
669
|
+
args: [{ selector: 'bsc-sidebar', imports: [], template: "<!-- Invisible hover trigger at left edge (shows sidebar on hover when unpinned) -->\n@if (!sidebar.isVisible()) {\n <div class=\"sidebar-trigger\" (mouseenter)=\"onMouseEnter()\"></div>\n}\n\n<aside\n [class]=\"sidebarClasses()\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n aria-label=\"Sidebar\"\n>\n <!-- Header -->\n <div class=\"sidebar-header\">\n <ng-content select=\"[sidebarHeader]\" />\n </div>\n\n <!-- Body (scrollable) -->\n <div class=\"sidebar-body\">\n <ng-content />\n </div>\n\n <!-- Footer (optional) -->\n <ng-content select=\"[sidebarFooter]\" />\n</aside>\n" }]
|
|
670
|
+
}], propDecorators: { hasHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasHeader", required: false }] }] } });
|
|
671
|
+
|
|
672
|
+
class Skeleton {
|
|
673
|
+
animated = input(true, ...(ngDevMode ? [{ debugName: "animated" }] : []));
|
|
674
|
+
columns = input(3, ...(ngDevMode ? [{ debugName: "columns" }] : []));
|
|
675
|
+
height = input('', ...(ngDevMode ? [{ debugName: "height" }] : []));
|
|
676
|
+
lines = input(1, ...(ngDevMode ? [{ debugName: "lines" }] : []));
|
|
677
|
+
variant = input('text', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
678
|
+
width = input('100%', ...(ngDevMode ? [{ debugName: "width" }] : []));
|
|
679
|
+
animClass = computed(() => {
|
|
680
|
+
return this.animated() ? 'skeleton-animated' : '';
|
|
681
|
+
}, ...(ngDevMode ? [{ debugName: "animClass" }] : []));
|
|
682
|
+
columnsArray = computed(() => {
|
|
683
|
+
return Array.from({ length: this.columns() });
|
|
684
|
+
}, ...(ngDevMode ? [{ debugName: "columnsArray" }] : []));
|
|
685
|
+
linesArray = computed(() => {
|
|
686
|
+
return Array.from({ length: this.lines() });
|
|
687
|
+
}, ...(ngDevMode ? [{ debugName: "linesArray" }] : []));
|
|
688
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Skeleton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
689
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: Skeleton, isStandalone: true, selector: "bsc-skeleton", inputs: { animated: { classPropertyName: "animated", publicName: "animated", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, lines: { classPropertyName: "lines", publicName: "lines", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@switch (variant()) {\n @case ('text') {\n <div class=\"skeleton-text-container\" [style.width]=\"width()\">\n @for (line of linesArray(); track $index; let last = $last) {\n <div\n class=\"skeleton-base skeleton-text\"\n [class]=\"animClass()\"\n [style.width]=\"last && linesArray().length > 1 ? '75%' : '100%'\"\n [style.height]=\"height() || null\"\n ></div>\n }\n </div>\n }\n @case ('circular') {\n <div\n class=\"skeleton-base skeleton-circular\"\n [class]=\"animClass()\"\n [style.width]=\"width() === '100%' ? '3rem' : width()\"\n [style.height]=\"height() || (width() === '100%' ? '3rem' : width())\"\n ></div>\n }\n @case ('rectangular') {\n <div\n class=\"skeleton-base skeleton-rectangular\"\n [class]=\"animClass()\"\n [style.width]=\"width()\"\n [style.height]=\"height() || '8rem'\"\n ></div>\n }\n @case ('table') {\n <div class=\"skeleton-table\" [style.width]=\"width()\">\n <!-- Header row -->\n <div class=\"skeleton-table-row\">\n @for (col of columnsArray(); track $index) {\n <div class=\"skeleton-base skeleton-table-header-cell\" [class]=\"animClass()\"></div>\n }\n </div>\n <!-- Body rows -->\n @for (row of linesArray(); track $index) {\n <div class=\"skeleton-table-row\">\n @for (col of columnsArray(); track $index) {\n <div class=\"skeleton-base skeleton-table-cell\" [class]=\"animClass()\"></div>\n }\n </div>\n }\n </div>\n }\n}\n" });
|
|
690
|
+
}
|
|
691
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Skeleton, decorators: [{
|
|
692
|
+
type: Component,
|
|
693
|
+
args: [{ selector: 'bsc-skeleton', imports: [], template: "@switch (variant()) {\n @case ('text') {\n <div class=\"skeleton-text-container\" [style.width]=\"width()\">\n @for (line of linesArray(); track $index; let last = $last) {\n <div\n class=\"skeleton-base skeleton-text\"\n [class]=\"animClass()\"\n [style.width]=\"last && linesArray().length > 1 ? '75%' : '100%'\"\n [style.height]=\"height() || null\"\n ></div>\n }\n </div>\n }\n @case ('circular') {\n <div\n class=\"skeleton-base skeleton-circular\"\n [class]=\"animClass()\"\n [style.width]=\"width() === '100%' ? '3rem' : width()\"\n [style.height]=\"height() || (width() === '100%' ? '3rem' : width())\"\n ></div>\n }\n @case ('rectangular') {\n <div\n class=\"skeleton-base skeleton-rectangular\"\n [class]=\"animClass()\"\n [style.width]=\"width()\"\n [style.height]=\"height() || '8rem'\"\n ></div>\n }\n @case ('table') {\n <div class=\"skeleton-table\" [style.width]=\"width()\">\n <!-- Header row -->\n <div class=\"skeleton-table-row\">\n @for (col of columnsArray(); track $index) {\n <div class=\"skeleton-base skeleton-table-header-cell\" [class]=\"animClass()\"></div>\n }\n </div>\n <!-- Body rows -->\n @for (row of linesArray(); track $index) {\n <div class=\"skeleton-table-row\">\n @for (col of columnsArray(); track $index) {\n <div class=\"skeleton-base skeleton-table-cell\" [class]=\"animClass()\"></div>\n }\n </div>\n }\n </div>\n }\n}\n" }]
|
|
694
|
+
}], propDecorators: { animated: [{ type: i0.Input, args: [{ isSignal: true, alias: "animated", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], lines: [{ type: i0.Input, args: [{ isSignal: true, alias: "lines", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }] } });
|
|
695
|
+
|
|
696
|
+
class Spinner {
|
|
697
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Spinner, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
698
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: Spinner, isStandalone: true, selector: "bsc-spinner", ngImport: i0, template: "<p>spinner works!</p>\n", styles: [""] });
|
|
699
|
+
}
|
|
700
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Spinner, decorators: [{
|
|
701
|
+
type: Component,
|
|
702
|
+
args: [{ selector: 'bsc-spinner', imports: [], template: "<p>spinner works!</p>\n" }]
|
|
703
|
+
}] });
|
|
704
|
+
|
|
705
|
+
class Stepper {
|
|
706
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Stepper, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
707
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: Stepper, isStandalone: true, selector: "bsc-stepper", ngImport: i0, template: "<p>stepper works!</p>\n", styles: [""] });
|
|
708
|
+
}
|
|
709
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Stepper, decorators: [{
|
|
710
|
+
type: Component,
|
|
711
|
+
args: [{ selector: 'bsc-stepper', imports: [], template: "<p>stepper works!</p>\n" }]
|
|
712
|
+
}] });
|
|
713
|
+
|
|
714
|
+
class Table {
|
|
715
|
+
hover = input(true, { ...(ngDevMode ? { debugName: "hover" } : {}), transform: booleanAttribute });
|
|
716
|
+
pageSizeOptions = input([10, 25, 50, 100], ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : []));
|
|
717
|
+
paginate = input(false, { ...(ngDevMode ? { debugName: "paginate" } : {}), transform: booleanAttribute });
|
|
718
|
+
showPageSize = input(false, { ...(ngDevMode ? { debugName: "showPageSize" } : {}), transform: booleanAttribute });
|
|
719
|
+
sortable = input(false, { ...(ngDevMode ? { debugName: "sortable" } : {}), transform: booleanAttribute });
|
|
720
|
+
tableSearch = input(false, { ...(ngDevMode ? { debugName: "tableSearch" } : {}), transform: booleanAttribute });
|
|
721
|
+
columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
|
|
722
|
+
currentPage = signal(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
|
|
723
|
+
data = input([], ...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
724
|
+
pageSize = signal(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
725
|
+
searchTerm = signal('', ...(ngDevMode ? [{ debugName: "searchTerm" }] : []));
|
|
726
|
+
sortState = signal({ column: '', direction: 'none' }, ...(ngDevMode ? [{ debugName: "sortState" }] : []));
|
|
727
|
+
stripedDirection = input('none', ...(ngDevMode ? [{ debugName: "stripedDirection" }] : []));
|
|
728
|
+
filteredData = computed(() => {
|
|
729
|
+
const term = this.searchTerm().toLowerCase();
|
|
730
|
+
const rows = this.data();
|
|
731
|
+
if (!term)
|
|
732
|
+
return rows;
|
|
733
|
+
return rows.filter((row) => this.columns().some((col) => {
|
|
734
|
+
const val = row[col.key];
|
|
735
|
+
return val != null && String(val).toLowerCase().includes(term);
|
|
736
|
+
}));
|
|
737
|
+
}, ...(ngDevMode ? [{ debugName: "filteredData" }] : []));
|
|
738
|
+
displayData = computed(() => {
|
|
739
|
+
const rows = this.filteredData();
|
|
740
|
+
const sort = this.sortState();
|
|
741
|
+
if (sort.direction === 'none' || !sort.column)
|
|
742
|
+
return rows;
|
|
743
|
+
return [...rows].sort((a, b) => {
|
|
744
|
+
const aVal = String(a[sort.column] ?? '');
|
|
745
|
+
const bVal = String(b[sort.column] ?? '');
|
|
746
|
+
const cmp = aVal.localeCompare(bVal, undefined, { numeric: true });
|
|
747
|
+
return sort.direction === 'asc' ? cmp : -cmp;
|
|
748
|
+
});
|
|
749
|
+
}, ...(ngDevMode ? [{ debugName: "displayData" }] : []));
|
|
750
|
+
paginatedData = computed(() => {
|
|
751
|
+
const rows = this.displayData();
|
|
752
|
+
if (!this.paginate())
|
|
753
|
+
return rows;
|
|
754
|
+
const page = this.currentPage();
|
|
755
|
+
const size = this.pageSize();
|
|
756
|
+
const start = (page - 1) * size;
|
|
757
|
+
return rows.slice(start, start + size);
|
|
758
|
+
}, ...(ngDevMode ? [{ debugName: "paginatedData" }] : []));
|
|
759
|
+
tableClasses = computed(() => {
|
|
760
|
+
const classes = ['table'];
|
|
761
|
+
const dir = this.stripedDirection();
|
|
762
|
+
if (dir !== 'none')
|
|
763
|
+
classes.push(`table-striped-${dir}`);
|
|
764
|
+
if (this.hover())
|
|
765
|
+
classes.push('table-hover');
|
|
766
|
+
return classes.join(' ');
|
|
767
|
+
}, ...(ngDevMode ? [{ debugName: "tableClasses" }] : []));
|
|
768
|
+
totalItems = computed(() => this.displayData().length, ...(ngDevMode ? [{ debugName: "totalItems" }] : []));
|
|
769
|
+
getSortDirection(col) {
|
|
770
|
+
const sort = this.sortState();
|
|
771
|
+
return sort.column === col.key ? sort.direction : 'none';
|
|
772
|
+
}
|
|
773
|
+
isColumnSortable(col) {
|
|
774
|
+
if (col.sortable !== undefined)
|
|
775
|
+
return col.sortable;
|
|
776
|
+
return this.sortable();
|
|
777
|
+
}
|
|
778
|
+
onSearchInput(event) {
|
|
779
|
+
const target = event.target;
|
|
780
|
+
this.searchTerm.set(target.value);
|
|
781
|
+
this.currentPage.set(1);
|
|
782
|
+
}
|
|
783
|
+
toggleSort(col) {
|
|
784
|
+
if (!this.isColumnSortable(col))
|
|
785
|
+
return;
|
|
786
|
+
const current = this.sortState();
|
|
787
|
+
if (current.column !== col.key) {
|
|
788
|
+
this.sortState.set({ column: col.key, direction: 'asc' });
|
|
789
|
+
}
|
|
790
|
+
else {
|
|
791
|
+
const next = current.direction === 'asc' ? 'desc' : current.direction === 'desc' ? 'none' : 'asc';
|
|
792
|
+
this.sortState.set({ column: col.key, direction: next });
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Table, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
796
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: Table, isStandalone: true, selector: "bsc-table", inputs: { hover: { classPropertyName: "hover", publicName: "hover", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, paginate: { classPropertyName: "paginate", publicName: "paginate", isSignal: true, isRequired: false, transformFunction: null }, showPageSize: { classPropertyName: "showPageSize", publicName: "showPageSize", isSignal: true, isRequired: false, transformFunction: null }, sortable: { classPropertyName: "sortable", publicName: "sortable", isSignal: true, isRequired: false, transformFunction: null }, tableSearch: { classPropertyName: "tableSearch", publicName: "tableSearch", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, stripedDirection: { classPropertyName: "stripedDirection", publicName: "stripedDirection", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"table-wrapper\">\n @if (tableSearch()) {\n <div class=\"table-search\">\n <svg\n class=\"table-search-icon\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"M21 21l-4.35-4.35\" />\n </svg>\n <input\n class=\"table-search-input\"\n type=\"text\"\n placeholder=\"Search...\"\n [value]=\"searchTerm()\"\n (input)=\"onSearchInput($event)\"\n />\n </div>\n }\n\n <div class=\"table-scroll\">\n <table [class]=\"tableClasses()\">\n <thead>\n <tr>\n @for (col of columns(); track col.key) {\n <th\n class=\"table-th\"\n [class.table-th-sortable]=\"isColumnSortable(col)\"\n (click)=\"toggleSort(col)\"\n >\n <span class=\"table-th-content\">\n {{ col.label }}\n @if (isColumnSortable(col)) {\n <svg\n class=\"table-sort-icon\"\n [class.table-sort-asc]=\"getSortDirection(col) === 'asc'\"\n [class.table-sort-desc]=\"getSortDirection(col) === 'desc'\"\n [class.table-sort-none]=\"getSortDirection(col) === 'none'\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M6 9l6-6 6 6\" />\n <path d=\"M6 15l6 6 6-6\" />\n </svg>\n }\n </span>\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of paginatedData(); track $index) {\n <tr>\n @for (col of columns(); track col.key) {\n <td class=\"table-td\">{{ row[col.key] }}</td>\n }\n </tr>\n } @empty {\n <tr>\n <td class=\"table-empty\" [attr.colspan]=\"columns().length\">No data available.</td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n @if (paginate()) {\n <div class=\"table-pagination\">\n <bsc-pagination\n [totalItems]=\"totalItems()\"\n [(currentPage)]=\"currentPage\"\n [(pageSize)]=\"pageSize\"\n [showPageSize]=\"showPageSize()\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n />\n </div>\n }\n</div>\n", styles: ["@reference \"tailwindcss\";.table-wrapper{@apply w-full;}.table-search{@apply relative mb-4;}.table-search-icon{@apply absolute left-3 top-1/2 -translate-y-1/2 text-ink-400 pointer-events-none;}.table-search-input{@apply w-full pl-10 pr-4 py-2.5 text-sm border border-ink-300 rounded-base bg-surface text-ink-900 placeholder:text-ink-400 transition-colors duration-200 focus:outline-none focus:ring-4 focus:ring-primary-200 focus:border-primary;}.table-scroll{@apply overflow-x-auto border border-ink-200 rounded-base;}.table{@apply w-full text-sm;}.table-th{@apply px-4 py-3 text-left text-xs font-semibold uppercase tracking-wider text-ink-500 bg-surface-muted;}.table-th-content{@apply inline-flex items-center gap-1.5;}.table-th-sortable{@apply cursor-pointer select-none transition-colors duration-150 hover:text-ink-700 hover:bg-ink-100;}.table-sort-icon{@apply transition-opacity duration-150;}.table-sort-none{@apply opacity-30;}.table-sort-asc,.table-sort-desc{@apply opacity-100;}.table-td{@apply px-4 py-3 text-ink-900 border-b border-ink-100;}.table-striped-row tbody tr:nth-child(2n){@apply bg-ink-50;}.table-striped-column td:nth-child(2n),.table-striped-column th:nth-child(2n){@apply bg-ink-50;}.table-hover tbody tr{@apply transition-colors duration-150;}.table-hover tbody tr:hover{@apply bg-primary-50;}.table-empty{@apply px-4 py-12 text-center text-ink-400;}.table-pagination{@apply flex justify-end mt-4;}\n"], dependencies: [{ kind: "component", type: Pagination, selector: "bsc-pagination", inputs: ["pageSizeOptions", "showPageSize", "totalItems", "currentPage", "pageSize"], outputs: ["currentPageChange", "pageSizeChange"] }] });
|
|
797
|
+
}
|
|
798
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Table, decorators: [{
|
|
799
|
+
type: Component,
|
|
800
|
+
args: [{ selector: 'bsc-table', imports: [Pagination], template: "<div class=\"table-wrapper\">\n @if (tableSearch()) {\n <div class=\"table-search\">\n <svg\n class=\"table-search-icon\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"M21 21l-4.35-4.35\" />\n </svg>\n <input\n class=\"table-search-input\"\n type=\"text\"\n placeholder=\"Search...\"\n [value]=\"searchTerm()\"\n (input)=\"onSearchInput($event)\"\n />\n </div>\n }\n\n <div class=\"table-scroll\">\n <table [class]=\"tableClasses()\">\n <thead>\n <tr>\n @for (col of columns(); track col.key) {\n <th\n class=\"table-th\"\n [class.table-th-sortable]=\"isColumnSortable(col)\"\n (click)=\"toggleSort(col)\"\n >\n <span class=\"table-th-content\">\n {{ col.label }}\n @if (isColumnSortable(col)) {\n <svg\n class=\"table-sort-icon\"\n [class.table-sort-asc]=\"getSortDirection(col) === 'asc'\"\n [class.table-sort-desc]=\"getSortDirection(col) === 'desc'\"\n [class.table-sort-none]=\"getSortDirection(col) === 'none'\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M6 9l6-6 6 6\" />\n <path d=\"M6 15l6 6 6-6\" />\n </svg>\n }\n </span>\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of paginatedData(); track $index) {\n <tr>\n @for (col of columns(); track col.key) {\n <td class=\"table-td\">{{ row[col.key] }}</td>\n }\n </tr>\n } @empty {\n <tr>\n <td class=\"table-empty\" [attr.colspan]=\"columns().length\">No data available.</td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n @if (paginate()) {\n <div class=\"table-pagination\">\n <bsc-pagination\n [totalItems]=\"totalItems()\"\n [(currentPage)]=\"currentPage\"\n [(pageSize)]=\"pageSize\"\n [showPageSize]=\"showPageSize()\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n />\n </div>\n }\n</div>\n", styles: ["@reference \"tailwindcss\";.table-wrapper{@apply w-full;}.table-search{@apply relative mb-4;}.table-search-icon{@apply absolute left-3 top-1/2 -translate-y-1/2 text-ink-400 pointer-events-none;}.table-search-input{@apply w-full pl-10 pr-4 py-2.5 text-sm border border-ink-300 rounded-base bg-surface text-ink-900 placeholder:text-ink-400 transition-colors duration-200 focus:outline-none focus:ring-4 focus:ring-primary-200 focus:border-primary;}.table-scroll{@apply overflow-x-auto border border-ink-200 rounded-base;}.table{@apply w-full text-sm;}.table-th{@apply px-4 py-3 text-left text-xs font-semibold uppercase tracking-wider text-ink-500 bg-surface-muted;}.table-th-content{@apply inline-flex items-center gap-1.5;}.table-th-sortable{@apply cursor-pointer select-none transition-colors duration-150 hover:text-ink-700 hover:bg-ink-100;}.table-sort-icon{@apply transition-opacity duration-150;}.table-sort-none{@apply opacity-30;}.table-sort-asc,.table-sort-desc{@apply opacity-100;}.table-td{@apply px-4 py-3 text-ink-900 border-b border-ink-100;}.table-striped-row tbody tr:nth-child(2n){@apply bg-ink-50;}.table-striped-column td:nth-child(2n),.table-striped-column th:nth-child(2n){@apply bg-ink-50;}.table-hover tbody tr{@apply transition-colors duration-150;}.table-hover tbody tr:hover{@apply bg-primary-50;}.table-empty{@apply px-4 py-12 text-center text-ink-400;}.table-pagination{@apply flex justify-end mt-4;}\n"] }]
|
|
801
|
+
}], propDecorators: { hover: [{ type: i0.Input, args: [{ isSignal: true, alias: "hover", required: false }] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], paginate: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginate", required: false }] }], showPageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageSize", required: false }] }], sortable: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortable", required: false }] }], tableSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableSearch", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], stripedDirection: [{ type: i0.Input, args: [{ isSignal: true, alias: "stripedDirection", required: false }] }] } });
|
|
802
|
+
|
|
803
|
+
class Tabs {
|
|
804
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Tabs, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
805
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: Tabs, isStandalone: true, selector: "bsc-tabs", ngImport: i0, template: "<p>tabs works!</p>\n", styles: [""] });
|
|
806
|
+
}
|
|
807
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Tabs, decorators: [{
|
|
808
|
+
type: Component,
|
|
809
|
+
args: [{ selector: 'bsc-tabs', imports: [], template: "<p>tabs works!</p>\n" }]
|
|
810
|
+
}] });
|
|
811
|
+
|
|
812
|
+
class Toggle {
|
|
813
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
814
|
+
checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
815
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
816
|
+
thumbClasses = computed(() => {
|
|
817
|
+
const classes = ['toggle-thumb'];
|
|
818
|
+
if (this.checked())
|
|
819
|
+
classes.push('toggle-thumb-checked');
|
|
820
|
+
return classes.join(' ');
|
|
821
|
+
}, ...(ngDevMode ? [{ debugName: "thumbClasses" }] : []));
|
|
822
|
+
trackClasses = computed(() => {
|
|
823
|
+
const classes = ['toggle-track'];
|
|
824
|
+
if (this.checked())
|
|
825
|
+
classes.push('toggle-track-checked');
|
|
826
|
+
return classes.join(' ');
|
|
827
|
+
}, ...(ngDevMode ? [{ debugName: "trackClasses" }] : []));
|
|
828
|
+
wrapperClasses = computed(() => {
|
|
829
|
+
return `toggle toggle-${this.size()}`;
|
|
830
|
+
}, ...(ngDevMode ? [{ debugName: "wrapperClasses" }] : []));
|
|
831
|
+
toggle() {
|
|
832
|
+
if (!this.disabled()) {
|
|
833
|
+
this.checked.set(!this.checked());
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Toggle, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
837
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: Toggle, isStandalone: true, selector: "bsc-toggle", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, ngImport: i0, template: "<button\n type=\"button\"\n role=\"switch\"\n [attr.aria-checked]=\"checked()\"\n [disabled]=\"disabled()\"\n [class]=\"wrapperClasses()\"\n (click)=\"toggle()\"\n>\n <span [class]=\"trackClasses()\">\n <span [class]=\"thumbClasses()\"></span>\n </span>\n</button>\n" });
|
|
838
|
+
}
|
|
839
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Toggle, decorators: [{
|
|
840
|
+
type: Component,
|
|
841
|
+
args: [{ selector: 'bsc-toggle', imports: [], template: "<button\n type=\"button\"\n role=\"switch\"\n [attr.aria-checked]=\"checked()\"\n [disabled]=\"disabled()\"\n [class]=\"wrapperClasses()\"\n (click)=\"toggle()\"\n>\n <span [class]=\"trackClasses()\">\n <span [class]=\"thumbClasses()\"></span>\n </span>\n</button>\n" }]
|
|
842
|
+
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
843
|
+
|
|
844
|
+
class Tooltip {
|
|
845
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Tooltip, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
846
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: Tooltip, isStandalone: true, selector: "bsc-tooltip", ngImport: i0, template: "<p>tooltip works!</p>\n", styles: [""] });
|
|
847
|
+
}
|
|
848
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Tooltip, decorators: [{
|
|
849
|
+
type: Component,
|
|
850
|
+
args: [{ selector: 'bsc-tooltip', imports: [], template: "<p>tooltip works!</p>\n" }]
|
|
851
|
+
}] });
|
|
852
|
+
|
|
853
|
+
/*
|
|
854
|
+
* Public API Surface of core-components
|
|
855
|
+
*/
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* Generated bundle index. Do not edit.
|
|
859
|
+
*/
|
|
860
|
+
|
|
861
|
+
export { Accordion, AccordionItem, Alert, Avatar, Badge, Breadcrumb, Button, Card, Checkbox, DatePicker, Dropdown, FileUpload, Footer, FormField, Header, Icon, Input, Label, Modal, Navigation, Pagination, ProgressBar, Radio, SearchBar, Select, Sidebar, SidebarService, Skeleton, Spinner, Stepper, Table, Tabs, Toggle, Tooltip };
|
|
862
|
+
//# sourceMappingURL=blank-software-core-components.mjs.map
|