@coreui/angular-pro 5.0.0-alpha.7 → 5.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/grid/row.directive.mjs +4 -4
- package/esm2022/lib/progress/progress-bar.component.mjs +54 -47
- package/esm2022/lib/progress/progress.component.mjs +27 -9
- package/esm2022/lib/progress/progress.type.mjs +2 -0
- package/esm2022/lib/progress/public_api.mjs +1 -1
- package/esm2022/lib/services/color-mode.service.mjs +79 -0
- package/esm2022/lib/services/in-memory-storage.service.mjs +33 -0
- package/esm2022/lib/services/local-storage.service.mjs +47 -0
- package/esm2022/lib/services/public_api.mjs +4 -1
- package/esm2022/lib/utilities/shadow-on-scroll.directive.mjs +2 -2
- package/fesm2022/coreui-angular-pro.mjs +273 -105
- package/fesm2022/coreui-angular-pro.mjs.map +1 -1
- package/lib/progress/progress-bar.component.d.ts +24 -19
- package/lib/progress/progress.component.d.ts +21 -5
- package/lib/progress/progress.type.d.ts +19 -0
- package/lib/progress/public_api.d.ts +1 -1
- package/lib/services/color-mode.service.d.ts +17 -0
- package/lib/services/in-memory-storage.service.d.ts +13 -0
- package/lib/services/local-storage.service.d.ts +18 -0
- package/lib/services/public_api.d.ts +3 -0
- package/lib/smart-table/smart-table.utils.d.ts +1 -1
- package/package.json +3 -3
- package/esm2022/lib/progress/progress-bar.mjs +0 -2
- package/lib/progress/progress-bar.d.ts +0 -10
|
@@ -2,13 +2,13 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Directive, Input, ElementRef, inject, Renderer2, booleanAttribute, NgModule, HostBinding, Injectable, Component, EventEmitter, Output, ContentChildren, HostListener, DestroyRef, signal, effect, RendererFactory2, Pipe, computed, numberAttribute, ViewChildren, PLATFORM_ID, Inject, ViewChild, forwardRef, Optional, ContentChild, ChangeDetectionStrategy, NgZone, TemplateRef, ViewContainerRef } from '@angular/core';
|
|
3
3
|
import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
|
|
4
4
|
import * as i3 from '@angular/common';
|
|
5
|
-
import { NgTemplateOutlet, NgIf, DOCUMENT, NgClass, NgForOf, AsyncPipe, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, isPlatformServer, CommonModule, formatDate, I18nPluralPipe,
|
|
5
|
+
import { NgTemplateOutlet, NgIf, DOCUMENT, NgClass, NgForOf, AsyncPipe, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, isPlatformServer, isPlatformBrowser, CommonModule, formatDate, I18nPluralPipe, JsonPipe } from '@angular/common';
|
|
6
6
|
import * as i1 from '@angular/animations';
|
|
7
7
|
import { animate, animation, style, useAnimation, state, transition, trigger, query, group } from '@angular/animations';
|
|
8
|
-
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
|
|
8
|
+
import { takeUntilDestroyed, toObservable, toSignal } from '@angular/core/rxjs-interop';
|
|
9
9
|
import { fromEvent, Subject, BehaviorSubject, Observable, skip, distinctUntilChanged as distinctUntilChanged$1, map as map$1, debounceTime as debounceTime$1 } from 'rxjs';
|
|
10
10
|
import * as i1$1 from '@angular/router';
|
|
11
|
-
import { RouterModule, NavigationEnd, RouterLink } from '@angular/router';
|
|
11
|
+
import { RouterModule, NavigationEnd, ActivatedRoute, RouterLink } from '@angular/router';
|
|
12
12
|
import { filter, tap, distinctUntilChanged, take, finalize, withLatestFrom, zipWith, debounceTime, map, delay, combineLatestWith } from 'rxjs/operators';
|
|
13
13
|
import * as i1$2 from '@angular/cdk/a11y';
|
|
14
14
|
import { FocusMonitor, A11yModule, FocusKeyManager } from '@angular/cdk/a11y';
|
|
@@ -1167,7 +1167,7 @@ class ShadowOnScrollDirective {
|
|
|
1167
1167
|
#destroyRef = inject(DestroyRef);
|
|
1168
1168
|
#document = inject(DOCUMENT);
|
|
1169
1169
|
#elementRef = inject(ElementRef);
|
|
1170
|
-
#scrolled = signal(
|
|
1170
|
+
#scrolled = signal(false);
|
|
1171
1171
|
#scrollEffect = effect(() => {
|
|
1172
1172
|
this.#elementRef.nativeElement.classList.toggle(this.#shadowClass, this.#scrolled());
|
|
1173
1173
|
});
|
|
@@ -4090,6 +4090,151 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
|
|
|
4090
4090
|
args: [DOCUMENT]
|
|
4091
4091
|
}] }, { type: i0.RendererFactory2 }] });
|
|
4092
4092
|
|
|
4093
|
+
class InMemoryStorageService {
|
|
4094
|
+
#storage = new Map();
|
|
4095
|
+
constructor() { }
|
|
4096
|
+
setItem(key, data) {
|
|
4097
|
+
this.#storage.set(key, JSON.stringify(data));
|
|
4098
|
+
}
|
|
4099
|
+
getItem(key) {
|
|
4100
|
+
return this.#storage.has(key) ? JSON.parse(this.#storage.get(key) ?? 'null') : undefined;
|
|
4101
|
+
}
|
|
4102
|
+
removeItem(key) {
|
|
4103
|
+
this.#storage.delete(key);
|
|
4104
|
+
}
|
|
4105
|
+
clear() {
|
|
4106
|
+
this.#storage.clear();
|
|
4107
|
+
}
|
|
4108
|
+
get length() {
|
|
4109
|
+
return this.#storage.size;
|
|
4110
|
+
}
|
|
4111
|
+
key(index) {
|
|
4112
|
+
return Array.from(this.#storage.keys())[index];
|
|
4113
|
+
}
|
|
4114
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: InMemoryStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4115
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: InMemoryStorageService, providedIn: 'root' }); }
|
|
4116
|
+
}
|
|
4117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: InMemoryStorageService, decorators: [{
|
|
4118
|
+
type: Injectable,
|
|
4119
|
+
args: [{
|
|
4120
|
+
providedIn: 'root'
|
|
4121
|
+
}]
|
|
4122
|
+
}], ctorParameters: () => [] });
|
|
4123
|
+
|
|
4124
|
+
class LocalStorageService {
|
|
4125
|
+
constructor(platformId, document) {
|
|
4126
|
+
this.platformId = platformId;
|
|
4127
|
+
this.document = document;
|
|
4128
|
+
this.#data$ = new BehaviorSubject(null);
|
|
4129
|
+
this.data$ = this.#data$.asObservable();
|
|
4130
|
+
this.localStorage = isPlatformBrowser(this.platformId) && this.document.defaultView ? this.document.defaultView?.localStorage : new InMemoryStorageService();
|
|
4131
|
+
}
|
|
4132
|
+
#data$;
|
|
4133
|
+
setItem(key, data) {
|
|
4134
|
+
this.localStorage.setItem(key, JSON.stringify(data));
|
|
4135
|
+
this.#data$.next({ key, data });
|
|
4136
|
+
}
|
|
4137
|
+
getItem(key) {
|
|
4138
|
+
const data = JSON.parse(this.localStorage.getItem(key) ?? 'null');
|
|
4139
|
+
this.#data$.next({ key, data });
|
|
4140
|
+
return data;
|
|
4141
|
+
}
|
|
4142
|
+
removeItem(key) {
|
|
4143
|
+
this.localStorage.removeItem(key);
|
|
4144
|
+
this.#data$.next({ key, data: null });
|
|
4145
|
+
}
|
|
4146
|
+
clear() {
|
|
4147
|
+
this.localStorage.clear();
|
|
4148
|
+
this.#data$.next(null);
|
|
4149
|
+
}
|
|
4150
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: LocalStorageService, deps: [{ token: PLATFORM_ID }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4151
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: LocalStorageService, providedIn: 'root' }); }
|
|
4152
|
+
}
|
|
4153
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: LocalStorageService, decorators: [{
|
|
4154
|
+
type: Injectable,
|
|
4155
|
+
args: [{
|
|
4156
|
+
providedIn: 'root'
|
|
4157
|
+
}]
|
|
4158
|
+
}], ctorParameters: () => [{ type: Object, decorators: [{
|
|
4159
|
+
type: Inject,
|
|
4160
|
+
args: [PLATFORM_ID]
|
|
4161
|
+
}] }, { type: Document, decorators: [{
|
|
4162
|
+
type: Inject,
|
|
4163
|
+
args: [DOCUMENT]
|
|
4164
|
+
}] }] });
|
|
4165
|
+
|
|
4166
|
+
class ColorModeService {
|
|
4167
|
+
#destroyRef;
|
|
4168
|
+
#document;
|
|
4169
|
+
#window;
|
|
4170
|
+
#activatedRoute;
|
|
4171
|
+
#localStorage;
|
|
4172
|
+
constructor() {
|
|
4173
|
+
this.#destroyRef = inject(DestroyRef);
|
|
4174
|
+
this.#document = inject(DOCUMENT);
|
|
4175
|
+
this.#window = this.#document.defaultView;
|
|
4176
|
+
this.#activatedRoute = inject(ActivatedRoute);
|
|
4177
|
+
this.#localStorage = inject(LocalStorageService);
|
|
4178
|
+
this.eventName = signal('ColorSchemeChange');
|
|
4179
|
+
this.localStorageItemName = signal('coreui-angular-color-scheme');
|
|
4180
|
+
this.localStorageItemName$ = toObservable(this.localStorageItemName);
|
|
4181
|
+
this.colorMode = signal('light');
|
|
4182
|
+
this.colorModeEffect = effect(() => {
|
|
4183
|
+
if (this.colorMode()) {
|
|
4184
|
+
this.setStoredTheme(this.localStorageItemName(), this.colorMode());
|
|
4185
|
+
this.setTheme(this.colorMode());
|
|
4186
|
+
}
|
|
4187
|
+
});
|
|
4188
|
+
this.#activatedRoute.queryParams
|
|
4189
|
+
.pipe(takeUntilDestroyed(this.#destroyRef), tap(params => {
|
|
4190
|
+
const theme = params['theme']?.match(/^[A-Za-z0-9\s]+/)[0];
|
|
4191
|
+
if (theme) {
|
|
4192
|
+
this.colorMode.set(theme);
|
|
4193
|
+
}
|
|
4194
|
+
}))
|
|
4195
|
+
.subscribe();
|
|
4196
|
+
this.localStorageItemName$
|
|
4197
|
+
.pipe(takeUntilDestroyed(this.#destroyRef), tap(params => {
|
|
4198
|
+
this.colorMode.set(this.getPreferredColorScheme(params));
|
|
4199
|
+
}))
|
|
4200
|
+
.subscribe();
|
|
4201
|
+
}
|
|
4202
|
+
getStoredTheme(localStorageItemName) {
|
|
4203
|
+
return this.#localStorage.getItem(localStorageItemName);
|
|
4204
|
+
}
|
|
4205
|
+
setStoredTheme(localStorageItemName, colorMode) {
|
|
4206
|
+
return this.#localStorage.setItem(localStorageItemName, colorMode);
|
|
4207
|
+
}
|
|
4208
|
+
getPreferredColorScheme(localStorageItemName) {
|
|
4209
|
+
if (this.#window === undefined) {
|
|
4210
|
+
return 'light';
|
|
4211
|
+
}
|
|
4212
|
+
const storedTheme = this.getStoredTheme(localStorageItemName);
|
|
4213
|
+
if (storedTheme) {
|
|
4214
|
+
return storedTheme;
|
|
4215
|
+
}
|
|
4216
|
+
return this.#window?.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
4217
|
+
}
|
|
4218
|
+
;
|
|
4219
|
+
setTheme(colorMode) {
|
|
4220
|
+
this.#document.documentElement.dataset['coreuiTheme'] =
|
|
4221
|
+
colorMode === 'auto' && this.#document.defaultView?.matchMedia('(prefers-color-scheme: dark)').matches
|
|
4222
|
+
? 'dark'
|
|
4223
|
+
: colorMode;
|
|
4224
|
+
const event = new Event(this.eventName());
|
|
4225
|
+
this.#document.documentElement.dispatchEvent(event);
|
|
4226
|
+
}
|
|
4227
|
+
;
|
|
4228
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ColorModeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4229
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ColorModeService, providedIn: 'root' }); }
|
|
4230
|
+
}
|
|
4231
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ColorModeService, decorators: [{
|
|
4232
|
+
type: Injectable,
|
|
4233
|
+
args: [{
|
|
4234
|
+
providedIn: 'root'
|
|
4235
|
+
}]
|
|
4236
|
+
}], ctorParameters: () => [] });
|
|
4237
|
+
|
|
4093
4238
|
class CarouselService {
|
|
4094
4239
|
constructor() {
|
|
4095
4240
|
this.carouselIndex = new BehaviorSubject({});
|
|
@@ -8614,14 +8759,14 @@ class RowDirective {
|
|
|
8614
8759
|
const cols = this.xs;
|
|
8615
8760
|
const classes = {
|
|
8616
8761
|
row: true,
|
|
8617
|
-
[`row-cols-${cols}`]: !!cols
|
|
8762
|
+
[`row-cols-${cols}`]: !!cols
|
|
8618
8763
|
};
|
|
8619
8764
|
Object.keys(BreakpointInfix).forEach(breakpoint => {
|
|
8620
8765
|
// @ts-ignore
|
|
8621
8766
|
const value = this[breakpoint];
|
|
8622
8767
|
if ((typeof value === 'number') || (typeof value === 'string')) {
|
|
8623
|
-
const infix = breakpoint === 'xs' ? '' : breakpoint
|
|
8624
|
-
classes[`row-cols
|
|
8768
|
+
const infix = breakpoint === 'xs' ? '' : `-${breakpoint}`;
|
|
8769
|
+
classes[`row-cols${infix}-${value}`] = !!value;
|
|
8625
8770
|
}
|
|
8626
8771
|
});
|
|
8627
8772
|
return classes;
|
|
@@ -13014,65 +13159,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
|
|
|
13014
13159
|
}]
|
|
13015
13160
|
}] });
|
|
13016
13161
|
|
|
13017
|
-
class ProgressComponent {
|
|
13018
|
-
constructor() {
|
|
13019
|
-
/**
|
|
13020
|
-
* Sets the height of the component. If you set that value the inner `<CProgressBar>` will automatically resize accordingly.
|
|
13021
|
-
* @type number
|
|
13022
|
-
*/
|
|
13023
|
-
this.height = 0;
|
|
13024
|
-
/**
|
|
13025
|
-
* Displays thin progress.
|
|
13026
|
-
* @type boolean
|
|
13027
|
-
*/
|
|
13028
|
-
this.thin = false;
|
|
13029
|
-
/**
|
|
13030
|
-
* Change the default color to white.
|
|
13031
|
-
* @type boolean
|
|
13032
|
-
*/
|
|
13033
|
-
this.white = false;
|
|
13034
|
-
}
|
|
13035
|
-
get hostClasses() {
|
|
13036
|
-
return {
|
|
13037
|
-
progress: true,
|
|
13038
|
-
'progress-thin': this.thin,
|
|
13039
|
-
'progress-white': this.white
|
|
13040
|
-
};
|
|
13041
|
-
}
|
|
13042
|
-
get hostStyle() {
|
|
13043
|
-
return !!this.height ? `${this.height}px` : '';
|
|
13044
|
-
}
|
|
13045
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ProgressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
13046
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "17.0.8", type: ProgressComponent, isStandalone: true, selector: "c-progress", inputs: { height: ["height", "height", numberAttribute], thin: ["thin", "thin", booleanAttribute], white: ["white", "white", booleanAttribute] }, host: { properties: { "class": "this.hostClasses", "style.height": "this.hostStyle" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true }); }
|
|
13047
|
-
}
|
|
13048
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ProgressComponent, decorators: [{
|
|
13049
|
-
type: Component,
|
|
13050
|
-
args: [{
|
|
13051
|
-
selector: 'c-progress',
|
|
13052
|
-
template: '<ng-content></ng-content>',
|
|
13053
|
-
standalone: true
|
|
13054
|
-
}]
|
|
13055
|
-
}], propDecorators: { height: [{
|
|
13056
|
-
type: Input,
|
|
13057
|
-
args: [{ transform: numberAttribute }]
|
|
13058
|
-
}], thin: [{
|
|
13059
|
-
type: Input,
|
|
13060
|
-
args: [{ transform: booleanAttribute }]
|
|
13061
|
-
}], white: [{
|
|
13062
|
-
type: Input,
|
|
13063
|
-
args: [{ transform: booleanAttribute }]
|
|
13064
|
-
}], hostClasses: [{
|
|
13065
|
-
type: HostBinding,
|
|
13066
|
-
args: ['class']
|
|
13067
|
-
}], hostStyle: [{
|
|
13068
|
-
type: HostBinding,
|
|
13069
|
-
args: ['style.height']
|
|
13070
|
-
}] } });
|
|
13071
|
-
|
|
13072
13162
|
class ProgressBarComponent {
|
|
13073
|
-
constructor(
|
|
13074
|
-
this
|
|
13075
|
-
this
|
|
13163
|
+
constructor() {
|
|
13164
|
+
this.#renderer = inject(Renderer2);
|
|
13165
|
+
this.#hostElement = inject(ElementRef);
|
|
13166
|
+
this.#max = signal(100);
|
|
13167
|
+
this.#min = signal(0);
|
|
13168
|
+
this.#value = signal(0);
|
|
13169
|
+
this.#percent = computed(() => {
|
|
13170
|
+
return +((this.#value() / (this.#max() - this.#min())) * 100).toFixed(this.precision);
|
|
13171
|
+
});
|
|
13172
|
+
this.#valuesEffect = effect(() => {
|
|
13173
|
+
const host = this.#hostElement.nativeElement;
|
|
13174
|
+
this.#renderer.setStyle(host, 'width', `${this.#percent()}%`);
|
|
13175
|
+
this.#renderer.setAttribute(host, 'aria-valuenow', String(this.#value()));
|
|
13176
|
+
this.#renderer.setAttribute(host, 'aria-valuemin', String(this.#min()));
|
|
13177
|
+
this.#renderer.setAttribute(host, 'aria-valuemax', String(this.#max()));
|
|
13178
|
+
});
|
|
13076
13179
|
/**
|
|
13077
13180
|
* Use to animate the stripes right to left via CSS3 animations.
|
|
13078
13181
|
* @type boolean
|
|
@@ -13080,33 +13183,42 @@ class ProgressBarComponent {
|
|
|
13080
13183
|
this.animated = false;
|
|
13081
13184
|
// TODO: check if this is necessary.
|
|
13082
13185
|
this.precision = 0;
|
|
13083
|
-
/**
|
|
13084
|
-
* The percent to progress the ProgressBar.
|
|
13085
|
-
* @type number
|
|
13086
|
-
*/
|
|
13087
|
-
this.value = 0;
|
|
13088
13186
|
/**
|
|
13089
13187
|
* Set default html role attribute.
|
|
13090
13188
|
* @type string
|
|
13091
13189
|
*/
|
|
13092
13190
|
this.role = 'progressbar';
|
|
13093
|
-
this.state = {
|
|
13094
|
-
percent: 0,
|
|
13095
|
-
min: 0,
|
|
13096
|
-
max: 100
|
|
13097
|
-
};
|
|
13098
13191
|
}
|
|
13099
|
-
|
|
13100
|
-
|
|
13192
|
+
#renderer;
|
|
13193
|
+
#hostElement;
|
|
13194
|
+
#max;
|
|
13195
|
+
#min;
|
|
13196
|
+
#value;
|
|
13197
|
+
#percent;
|
|
13198
|
+
#valuesEffect;
|
|
13199
|
+
/**
|
|
13200
|
+
* The percent value the ProgressBar.
|
|
13201
|
+
* @type number
|
|
13202
|
+
* @default 0
|
|
13203
|
+
*/
|
|
13204
|
+
set value(value) {
|
|
13205
|
+
this.#value.set(value);
|
|
13101
13206
|
}
|
|
13207
|
+
/**
|
|
13208
|
+
* The min value of the ProgressBar.
|
|
13209
|
+
* @type number
|
|
13210
|
+
* @default 0
|
|
13211
|
+
*/
|
|
13102
13212
|
set min(value) {
|
|
13103
|
-
this.
|
|
13104
|
-
}
|
|
13105
|
-
get max() {
|
|
13106
|
-
return this.state.max;
|
|
13213
|
+
this.#min.set(isNaN(value) || value >= this.#max() ? 0 : value);
|
|
13107
13214
|
}
|
|
13215
|
+
/**
|
|
13216
|
+
* The max value of the ProgressBar.
|
|
13217
|
+
* @type number
|
|
13218
|
+
* @default 100
|
|
13219
|
+
*/
|
|
13108
13220
|
set max(value) {
|
|
13109
|
-
this.
|
|
13221
|
+
this.#max.set(isNaN(value) || value <= 0 || value <= this.#min() ? 100 : value);
|
|
13110
13222
|
}
|
|
13111
13223
|
get hostClasses() {
|
|
13112
13224
|
return {
|
|
@@ -13116,34 +13228,17 @@ class ProgressBarComponent {
|
|
|
13116
13228
|
[`bg-${this.color}`]: !!this.color
|
|
13117
13229
|
};
|
|
13118
13230
|
}
|
|
13119
|
-
|
|
13120
|
-
|
|
13121
|
-
}
|
|
13122
|
-
setPercent() {
|
|
13123
|
-
this.state.percent = +((this.value / (this.max - this.min)) * 100).toFixed(this.precision);
|
|
13124
|
-
}
|
|
13125
|
-
setValues() {
|
|
13126
|
-
this.setPercent();
|
|
13127
|
-
const host = this.hostElement.nativeElement;
|
|
13128
|
-
this.renderer.setStyle(host, 'width', `${this.state.percent}%`);
|
|
13129
|
-
this.renderer.setAttribute(host, 'aria-valuenow', String(this.value));
|
|
13130
|
-
this.renderer.setAttribute(host, 'aria-valuemin', String(this.min));
|
|
13131
|
-
this.renderer.setAttribute(host, 'aria-valuemax', String(this.max));
|
|
13132
|
-
}
|
|
13133
|
-
ngOnChanges(changes) {
|
|
13134
|
-
this.setValues();
|
|
13135
|
-
}
|
|
13136
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ProgressBarComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
13137
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "17.0.8", type: ProgressBarComponent, isStandalone: true, selector: "c-progress-bar", inputs: { animated: ["animated", "animated", booleanAttribute], color: "color", precision: ["precision", "precision", numberAttribute], value: ["value", "value", numberAttribute], variant: "variant", role: "role", min: "min", max: "max" }, host: { properties: { "attr.role": "this.role", "class": "this.hostClasses" } }, usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true }); }
|
|
13231
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
13232
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "17.0.8", type: ProgressBarComponent, isStandalone: true, selector: "c-progress-bar", inputs: { animated: ["animated", "animated", booleanAttribute], color: "color", precision: ["precision", "precision", numberAttribute], value: ["value", "value", numberAttribute], variant: "variant", min: ["min", "min", numberAttribute], max: ["max", "max", numberAttribute], role: "role" }, host: { properties: { "attr.role": "this.role", "class": "this.hostClasses" } }, ngImport: i0, template: '<ng-content />', isInline: true }); }
|
|
13138
13233
|
}
|
|
13139
13234
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ProgressBarComponent, decorators: [{
|
|
13140
13235
|
type: Component,
|
|
13141
13236
|
args: [{
|
|
13142
13237
|
selector: 'c-progress-bar',
|
|
13143
|
-
template: '<ng-content
|
|
13238
|
+
template: '<ng-content />',
|
|
13144
13239
|
standalone: true
|
|
13145
13240
|
}]
|
|
13146
|
-
}],
|
|
13241
|
+
}], propDecorators: { animated: [{
|
|
13147
13242
|
type: Input,
|
|
13148
13243
|
args: [{ transform: booleanAttribute }]
|
|
13149
13244
|
}], color: [{
|
|
@@ -13156,18 +13251,91 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
|
|
|
13156
13251
|
args: [{ transform: numberAttribute }]
|
|
13157
13252
|
}], variant: [{
|
|
13158
13253
|
type: Input
|
|
13254
|
+
}], min: [{
|
|
13255
|
+
type: Input,
|
|
13256
|
+
args: [{ transform: numberAttribute }]
|
|
13257
|
+
}], max: [{
|
|
13258
|
+
type: Input,
|
|
13259
|
+
args: [{ transform: numberAttribute }]
|
|
13159
13260
|
}], role: [{
|
|
13160
13261
|
type: Input
|
|
13161
13262
|
}, {
|
|
13162
13263
|
type: HostBinding,
|
|
13163
13264
|
args: ['attr.role']
|
|
13265
|
+
}], hostClasses: [{
|
|
13266
|
+
type: HostBinding,
|
|
13267
|
+
args: ['class']
|
|
13268
|
+
}] } });
|
|
13269
|
+
|
|
13270
|
+
class ProgressComponent {
|
|
13271
|
+
constructor() {
|
|
13272
|
+
this.#elementRef = inject(ElementRef);
|
|
13273
|
+
/**
|
|
13274
|
+
* Sets the height of the component. If you set that value the inner `<CProgressBar>` will automatically resize accordingly.
|
|
13275
|
+
* @type number
|
|
13276
|
+
*/
|
|
13277
|
+
this.height = 0;
|
|
13278
|
+
/**
|
|
13279
|
+
* Displays thin progress.
|
|
13280
|
+
* @type boolean
|
|
13281
|
+
*/
|
|
13282
|
+
this.thin = false;
|
|
13283
|
+
/**
|
|
13284
|
+
* Change the default color to white.
|
|
13285
|
+
* @type boolean
|
|
13286
|
+
*/
|
|
13287
|
+
this.white = false;
|
|
13288
|
+
this.max = 100;
|
|
13289
|
+
this.min = 0;
|
|
13290
|
+
}
|
|
13291
|
+
#elementRef;
|
|
13292
|
+
get hostClasses() {
|
|
13293
|
+
return {
|
|
13294
|
+
progress: true,
|
|
13295
|
+
'progress-thin': this.thin,
|
|
13296
|
+
'progress-white': this.white
|
|
13297
|
+
};
|
|
13298
|
+
}
|
|
13299
|
+
get hostStyle() {
|
|
13300
|
+
return !!this.height ? `${this.height}px` : this.#elementRef?.nativeElement?.style?.height ?? '';
|
|
13301
|
+
}
|
|
13302
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ProgressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
13303
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.0.8", type: ProgressComponent, isStandalone: true, selector: "c-progress", inputs: { height: ["height", "height", numberAttribute], thin: ["thin", "thin", booleanAttribute], white: ["white", "white", booleanAttribute], value: ["value", "value", numberAttribute], max: ["max", "max", numberAttribute], min: ["min", "min", numberAttribute], animated: ["animated", "animated", booleanAttribute], color: "color", variant: "variant" }, host: { properties: { "class": "this.hostClasses", "style.height": "this.hostStyle" } }, ngImport: i0, template: "@if (value !== undefined) {\n <c-progress-bar [value]=\"value\" [min]=\"min\" [max]=\"max\" [animated]=\"animated\" [variant]=\"variant\" [color]=\"color\">\n <ng-container *ngTemplateOutlet=\"defaultContent\" />\n </c-progress-bar>\n} @else {\n <ng-container *ngTemplateOutlet=\"defaultContent\" />\n}\n\n<ng-template #defaultContent>\n <ng-content />\n</ng-template>\n\n", dependencies: [{ kind: "component", type: ProgressBarComponent, selector: "c-progress-bar", inputs: ["animated", "color", "precision", "value", "variant", "min", "max", "role"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
13304
|
+
}
|
|
13305
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ProgressComponent, decorators: [{
|
|
13306
|
+
type: Component,
|
|
13307
|
+
args: [{ selector: 'c-progress', imports: [ProgressBarComponent, NgTemplateOutlet], standalone: true, template: "@if (value !== undefined) {\n <c-progress-bar [value]=\"value\" [min]=\"min\" [max]=\"max\" [animated]=\"animated\" [variant]=\"variant\" [color]=\"color\">\n <ng-container *ngTemplateOutlet=\"defaultContent\" />\n </c-progress-bar>\n} @else {\n <ng-container *ngTemplateOutlet=\"defaultContent\" />\n}\n\n<ng-template #defaultContent>\n <ng-content />\n</ng-template>\n\n" }]
|
|
13308
|
+
}], propDecorators: { height: [{
|
|
13309
|
+
type: Input,
|
|
13310
|
+
args: [{ transform: numberAttribute }]
|
|
13311
|
+
}], thin: [{
|
|
13312
|
+
type: Input,
|
|
13313
|
+
args: [{ transform: booleanAttribute }]
|
|
13314
|
+
}], white: [{
|
|
13315
|
+
type: Input,
|
|
13316
|
+
args: [{ transform: booleanAttribute }]
|
|
13317
|
+
}], value: [{
|
|
13318
|
+
type: Input,
|
|
13319
|
+
args: [{ transform: numberAttribute }]
|
|
13320
|
+
}], max: [{
|
|
13321
|
+
type: Input,
|
|
13322
|
+
args: [{ transform: numberAttribute }]
|
|
13164
13323
|
}], min: [{
|
|
13324
|
+
type: Input,
|
|
13325
|
+
args: [{ transform: numberAttribute }]
|
|
13326
|
+
}], animated: [{
|
|
13327
|
+
type: Input,
|
|
13328
|
+
args: [{ transform: booleanAttribute }]
|
|
13329
|
+
}], color: [{
|
|
13165
13330
|
type: Input
|
|
13166
|
-
}],
|
|
13331
|
+
}], variant: [{
|
|
13167
13332
|
type: Input
|
|
13168
13333
|
}], hostClasses: [{
|
|
13169
13334
|
type: HostBinding,
|
|
13170
13335
|
args: ['class']
|
|
13336
|
+
}], hostStyle: [{
|
|
13337
|
+
type: HostBinding,
|
|
13338
|
+
args: ['style.height']
|
|
13171
13339
|
}] } });
|
|
13172
13340
|
|
|
13173
13341
|
class ProgressModule {
|
|
@@ -17244,5 +17412,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
|
|
|
17244
17412
|
* Generated bundle index. Do not edit.
|
|
17245
17413
|
*/
|
|
17246
17414
|
|
|
17247
|
-
export { AccordionButtonDirective, AccordionComponent, AccordionItemComponent, AccordionModule, AlertComponent, AlertHeadingDirective, AlertLinkDirective, AlertModule, AlignDirective, AvatarComponent, AvatarModule, BackdropService, BadgeComponent, BadgeModule, BgColorDirective, BorderDirective, BreadcrumbComponent, BreadcrumbItemComponent, BreadcrumbModule, BreadcrumbRouterComponent, BreadcrumbRouterService, BreakpointInfix, ButtonCloseDirective, ButtonDirective, ButtonGroupComponent, ButtonGroupModule, ButtonModule, ButtonToolbarComponent, CalendarComponent, CalendarModule, CalendarMonthComponent, CalendarNavigationComponent, CalloutComponent, CalloutModule, CardBodyComponent, CardComponent, CardFooterComponent, CardGroupComponent, CardHeaderActionsComponent, CardHeaderComponent, CardImgDirective, CardImgOverlayComponent, CardLinkDirective, CardModule, CardSubtitleDirective, CardTextDirective, CardTitleDirective, CarouselCaptionComponent, CarouselComponent, CarouselConfig, CarouselControlComponent, CarouselIndicatorsComponent, CarouselInnerComponent, CarouselItemComponent, CarouselModule, ClassToggleService, ColComponent, ColDirective, CollapseDirective, CollapseModule, ContainerComponent, DatePickerComponent, DatePickerModule, DateRangePickerComponent, DateRangePickerModule, DropdownCloseDirective, DropdownComponent, DropdownDividerDirective, DropdownHeaderDirective, DropdownItemDirective, DropdownItemPlainDirective, DropdownMenuDirective, DropdownModule, DropdownService, DropdownToggleDirective, ElementCoverComponent, ElementCoverModule, FooterComponent, FooterModule, FormCheckComponent, FormCheckInputDirective, FormCheckLabelDirective, FormControlDirective, FormDirective, FormFeedbackComponent, FormFloatingDirective, FormLabelDirective, FormModule, FormSelectDirective, FormTextDirective, GridModule, GutterDirective, HeaderBrandComponent, HeaderComponent, HeaderDividerComponent, HeaderModule, HeaderNavComponent, HeaderTextComponent, HeaderTogglerDirective, HtmlAttributesDirective, ImgDirective, ImgModule, InputGroupComponent, InputGroupTextDirective, IntersectionService, ListGroupDirective, ListGroupItemDirective, ListGroupModule, ListenersService, LoadingButtonComponent, LoadingButtonModule, ModalBodyComponent, ModalComponent, ModalContentComponent, ModalDialogComponent, ModalFooterComponent, ModalHeaderComponent, ModalModule, ModalService, ModalTitleDirective, ModalToggleDirective, MultiSelectComponent, MultiSelectModule, MultiSelectOptgroupComponent, MultiSelectOptgroupLabelComponent, MultiSelectOptionComponent, NavComponent, NavItemComponent, NavLinkDirective, NavModule, NavbarBrandDirective, NavbarComponent, NavbarModule, NavbarNavComponent, NavbarTextComponent, NavbarTogglerDirective, OffcanvasBodyComponent, OffcanvasComponent, OffcanvasHeaderComponent, OffcanvasModule, OffcanvasService, OffcanvasTitleDirective, OffcanvasToggleDirective, PageItemComponent, PageItemDirective, PageLinkDirective, PaginationComponent, PaginationModule, PlaceholderAnimationDirective, PlaceholderDirective, PlaceholderModule, PopoverComponent, PopoverDirective, PopoverModule, ProgressBarComponent, ProgressComponent, ProgressModule, RoundedDirective, RowComponent, RowDirective, ShadowOnScrollDirective, SharedModule, SidebarBrandComponent, SidebarComponent, SidebarFooterComponent, SidebarHeaderComponent, SidebarModule, SidebarNavComponent, SidebarNavHelper, SidebarService, SidebarToggleDirective, SidebarTogglerDirective, SmartPaginationComponent, SmartPaginationModule, SmartTableComponent, SmartTableFilterComponent, SmartTableModule, SpinnerComponent, SpinnerModule, TabContentComponent, TabContentRefDirective, TabPaneComponent, TabService, TableActiveDirective, TableColorDirective, TableDirective, TableModule, TabsModule, TemplateIdDirective, TextColorDirective, ThemeDirective, TimePickerComponent, TimePickerModule, ToastBodyComponent, ToastCloseDirective, ToastComponent, ToastHeaderComponent, ToastModule, ToasterComponent, ToasterHostDirective, ToasterPlacement, ToasterService, TooltipComponent, TooltipDirective, TooltipModule, UtilitiesModule, WidgetModule, WidgetStatAComponent, WidgetStatBComponent, WidgetStatCComponent, WidgetStatDComponent, WidgetStatEComponent, WidgetStatFComponent };
|
|
17415
|
+
export { AccordionButtonDirective, AccordionComponent, AccordionItemComponent, AccordionModule, AlertComponent, AlertHeadingDirective, AlertLinkDirective, AlertModule, AlignDirective, AvatarComponent, AvatarModule, BackdropService, BadgeComponent, BadgeModule, BgColorDirective, BorderDirective, BreadcrumbComponent, BreadcrumbItemComponent, BreadcrumbModule, BreadcrumbRouterComponent, BreadcrumbRouterService, BreakpointInfix, ButtonCloseDirective, ButtonDirective, ButtonGroupComponent, ButtonGroupModule, ButtonModule, ButtonToolbarComponent, CalendarComponent, CalendarModule, CalendarMonthComponent, CalendarNavigationComponent, CalloutComponent, CalloutModule, CardBodyComponent, CardComponent, CardFooterComponent, CardGroupComponent, CardHeaderActionsComponent, CardHeaderComponent, CardImgDirective, CardImgOverlayComponent, CardLinkDirective, CardModule, CardSubtitleDirective, CardTextDirective, CardTitleDirective, CarouselCaptionComponent, CarouselComponent, CarouselConfig, CarouselControlComponent, CarouselIndicatorsComponent, CarouselInnerComponent, CarouselItemComponent, CarouselModule, ClassToggleService, ColComponent, ColDirective, CollapseDirective, CollapseModule, ColorModeService, ContainerComponent, DatePickerComponent, DatePickerModule, DateRangePickerComponent, DateRangePickerModule, DropdownCloseDirective, DropdownComponent, DropdownDividerDirective, DropdownHeaderDirective, DropdownItemDirective, DropdownItemPlainDirective, DropdownMenuDirective, DropdownModule, DropdownService, DropdownToggleDirective, ElementCoverComponent, ElementCoverModule, FooterComponent, FooterModule, FormCheckComponent, FormCheckInputDirective, FormCheckLabelDirective, FormControlDirective, FormDirective, FormFeedbackComponent, FormFloatingDirective, FormLabelDirective, FormModule, FormSelectDirective, FormTextDirective, GridModule, GutterDirective, HeaderBrandComponent, HeaderComponent, HeaderDividerComponent, HeaderModule, HeaderNavComponent, HeaderTextComponent, HeaderTogglerDirective, HtmlAttributesDirective, ImgDirective, ImgModule, InMemoryStorageService, InputGroupComponent, InputGroupTextDirective, IntersectionService, ListGroupDirective, ListGroupItemDirective, ListGroupModule, ListenersService, LoadingButtonComponent, LoadingButtonModule, LocalStorageService, ModalBodyComponent, ModalComponent, ModalContentComponent, ModalDialogComponent, ModalFooterComponent, ModalHeaderComponent, ModalModule, ModalService, ModalTitleDirective, ModalToggleDirective, MultiSelectComponent, MultiSelectModule, MultiSelectOptgroupComponent, MultiSelectOptgroupLabelComponent, MultiSelectOptionComponent, NavComponent, NavItemComponent, NavLinkDirective, NavModule, NavbarBrandDirective, NavbarComponent, NavbarModule, NavbarNavComponent, NavbarTextComponent, NavbarTogglerDirective, OffcanvasBodyComponent, OffcanvasComponent, OffcanvasHeaderComponent, OffcanvasModule, OffcanvasService, OffcanvasTitleDirective, OffcanvasToggleDirective, PageItemComponent, PageItemDirective, PageLinkDirective, PaginationComponent, PaginationModule, PlaceholderAnimationDirective, PlaceholderDirective, PlaceholderModule, PopoverComponent, PopoverDirective, PopoverModule, ProgressBarComponent, ProgressComponent, ProgressModule, RoundedDirective, RowComponent, RowDirective, ShadowOnScrollDirective, SharedModule, SidebarBrandComponent, SidebarComponent, SidebarFooterComponent, SidebarHeaderComponent, SidebarModule, SidebarNavComponent, SidebarNavHelper, SidebarService, SidebarToggleDirective, SidebarTogglerDirective, SmartPaginationComponent, SmartPaginationModule, SmartTableComponent, SmartTableFilterComponent, SmartTableModule, SpinnerComponent, SpinnerModule, TabContentComponent, TabContentRefDirective, TabPaneComponent, TabService, TableActiveDirective, TableColorDirective, TableDirective, TableModule, TabsModule, TemplateIdDirective, TextColorDirective, ThemeDirective, TimePickerComponent, TimePickerModule, ToastBodyComponent, ToastCloseDirective, ToastComponent, ToastHeaderComponent, ToastModule, ToasterComponent, ToasterHostDirective, ToasterPlacement, ToasterService, TooltipComponent, TooltipDirective, TooltipModule, UtilitiesModule, WidgetModule, WidgetStatAComponent, WidgetStatBComponent, WidgetStatCComponent, WidgetStatDComponent, WidgetStatEComponent, WidgetStatFComponent };
|
|
17248
17416
|
//# sourceMappingURL=coreui-angular-pro.mjs.map
|