@abp/ng.theme.shared 10.0.0-rc.3 → 10.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.
@@ -1,11 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Input, Component, inject, ChangeDetectorRef, ChangeDetectionStrategy, Renderer2, EventEmitter, ViewChild, Output, InjectionToken, DestroyRef, createComponent, ViewEncapsulation, HostListener, RendererFactory2, Injector, EnvironmentInjector, ApplicationRef, model, input, viewChild, contentChild, output, effect, Directive, forwardRef, HostBinding, NgModule, ElementRef, ComponentFactoryResolver, PLATFORM_ID, ViewContainerRef, TemplateRef, provideAppInitializer, LOCALE_ID, makeEnvironmentProviders } from '@angular/core';
2
+ import { Injectable, inject, LOCALE_ID, Input, Component, ChangeDetectorRef, ChangeDetectionStrategy, Renderer2, EventEmitter, ViewChild, Output, InjectionToken, DestroyRef, createComponent, ViewEncapsulation, HostListener, RendererFactory2, Injector, EnvironmentInjector, ApplicationRef, model, input, viewChild, contentChild, output, effect, Directive, forwardRef, HostBinding, NgModule, ElementRef, ComponentFactoryResolver, PLATFORM_ID, ViewContainerRef, TemplateRef, provideAppInitializer, makeEnvironmentProviders } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { formatDate, NgTemplateOutlet, CommonModule, NgClass, AsyncPipe, DOCUMENT, NgStyle, isPlatformBrowser } from '@angular/common';
5
- import { NgbDateAdapter, NgbTimeAdapter, NgbModal, NgbTooltip, NgbInputDatepickerConfig, NgbTypeaheadConfig, NgbDateParserFormatter } from '@ng-bootstrap/ng-bootstrap';
5
+ import { NgbDateAdapter, NgbDatepickerI18n, NgbTimeAdapter, NgbTimepickerI18n, NgbModal, NgbTooltip, NgbInputDatepickerConfig, NgbTypeaheadConfig, NgbDateParserFormatter } from '@ng-bootstrap/ng-bootstrap';
6
+ import { ConfigStateService, LocalizationPipe, RoutesService, SubscriptionService, RouterEvents, getRoutePath, StopPropagationDirective, HttpWaitService, RouterWaitService, ContentProjectionService, PROJECTION_STRATEGY, SORT_COMPARE_FUNC, InternalStore, AuthService, SessionStateService, DomInsertionService, CONTENT_STRATEGY, uuid, AbstractNgModelComponent, InternetConnectionService, LocalizationService, getLocaleDirection, HttpErrorReporterService, TENANT_NOT_FOUND_BY_NAME } from '@abp/ng.core';
6
7
  import { animation, style, animate, keyframes, trigger, state, transition, useAnimation, query } from '@angular/animations';
7
8
  import { RouterLink, Router, ResolveEnd } from '@angular/router';
8
- import { LocalizationPipe, RoutesService, SubscriptionService, RouterEvents, getRoutePath, StopPropagationDirective, HttpWaitService, RouterWaitService, ContentProjectionService, PROJECTION_STRATEGY, SORT_COMPARE_FUNC, InternalStore, AuthService, SessionStateService, DomInsertionService, CONTENT_STRATEGY, ConfigStateService, uuid, AbstractNgModelComponent, InternetConnectionService, LocalizationService, getLocaleDirection, HttpErrorReporterService, TENANT_NOT_FOUND_BY_NAME } from '@abp/ng.core';
9
9
  import { startWith, map, debounceTime, filter, takeUntil, take, switchMap } from 'rxjs/operators';
10
10
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
11
11
  import { fromEvent, Subscription, combineLatest, timer, ReplaySubject, Subject, BehaviorSubject, distinctUntilChanged, of, from, Observable, EMPTY } from 'rxjs';
@@ -97,6 +97,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImpor
97
97
  type: Injectable
98
98
  }] });
99
99
 
100
+ class DatepickerI18nAdapter extends NgbDatepickerI18n {
101
+ constructor() {
102
+ super(...arguments);
103
+ this.configState = inject(ConfigStateService, { optional: true });
104
+ this.defaultLocale = inject(LOCALE_ID);
105
+ }
106
+ get locale() {
107
+ return this.configState?.getDeep('localization.currentCulture.cultureName') || this.defaultLocale;
108
+ }
109
+ getWeekdayLabel(weekday) {
110
+ const date = new Date(2017, 0, weekday + 1); // Monday = 1
111
+ return formatDate(date, 'EEEEE', this.locale);
112
+ }
113
+ getWeekLabel() {
114
+ return '';
115
+ }
116
+ getMonthShortName(month) {
117
+ const date = new Date(2017, month - 1, 1);
118
+ return formatDate(date, 'MMM', this.locale);
119
+ }
120
+ getMonthFullName(month) {
121
+ const date = new Date(2017, month - 1, 1);
122
+ return formatDate(date, 'MMMM', this.locale);
123
+ }
124
+ getDayAriaLabel(date) {
125
+ const d = new Date(date.year, date.month - 1, date.day);
126
+ return formatDate(d, 'fullDate', this.locale);
127
+ }
128
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: DatepickerI18nAdapter, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
129
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: DatepickerI18nAdapter }); }
130
+ }
131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: DatepickerI18nAdapter, decorators: [{
132
+ type: Injectable
133
+ }] });
134
+
100
135
  class TimeAdapter extends NgbTimeAdapter {
101
136
  fromModel(value) {
102
137
  if (!value)
@@ -130,6 +165,30 @@ function isTimeStr(value) {
130
165
  return /^((2[123])|[01][0-9])(:[0-5][0-9]){1,2}$/.test(String(value));
131
166
  }
132
167
 
168
+ class TimepickerI18nAdapter extends NgbTimepickerI18n {
169
+ constructor() {
170
+ super(...arguments);
171
+ this.configState = inject(ConfigStateService, { optional: true });
172
+ this.defaultLocale = inject(LOCALE_ID);
173
+ }
174
+ get locale() {
175
+ return this.configState?.getDeep('localization.currentCulture.cultureName') || this.defaultLocale;
176
+ }
177
+ getMorningPeriod() {
178
+ const date = new Date(2000, 0, 1, 10, 0, 0);
179
+ return formatDate(date, 'a', this.locale);
180
+ }
181
+ getAfternoonPeriod() {
182
+ const date = new Date(2000, 0, 1, 22, 0, 0);
183
+ return formatDate(date, 'a', this.locale);
184
+ }
185
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: TimepickerI18nAdapter, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
186
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: TimepickerI18nAdapter }); }
187
+ }
188
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: TimepickerI18nAdapter, decorators: [{
189
+ type: Injectable
190
+ }] });
191
+
133
192
  const bounceIn = animation([
134
193
  style({ opacity: '0', display: '{{ display }}' }),
135
194
  animate('{{ time}} {{ easing }}', keyframes([
@@ -2829,6 +2888,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImpor
2829
2888
  }], ctorParameters: () => [] });
2830
2889
 
2831
2890
  const NG_BOOTSTRAP_CONFIG_PROVIDERS = [
2891
+ {
2892
+ provide: NgbDatepickerI18n,
2893
+ useClass: DatepickerI18nAdapter,
2894
+ },
2895
+ {
2896
+ provide: NgbTimepickerI18n,
2897
+ useClass: TimepickerI18nAdapter,
2898
+ },
2832
2899
  provideAppInitializer(() => {
2833
2900
  configureNgBootstrap();
2834
2901
  }),
@@ -3278,5 +3345,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImpor
3278
3345
  * Generated bundle index. Do not edit.
3279
3346
  */
3280
3347
 
3281
- export { AbpAuthenticationErrorHandler, AbpFormatErrorHandlerService, AbpVisibleDirective, BaseThemeSharedModule, BreadcrumbComponent, BreadcrumbItemsComponent, ButtonComponent, CARD_COMPONENTS, CARD_DIRECTIVES, CONFIRMATION_ICONS, CUSTOM_ERROR_HANDLERS, CUSTOM_HTTP_ERROR_HANDLER_PRIORITY, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CardHeaderDirective, CardImgTopDirective, CardModule, CardSubtitleDirective, CardTitleDirective, Confirmation, ConfirmationComponent, ConfirmationService, CreateErrorComponentService, DEFAULT_CONFIRMATION_ICONS, DEFAULT_ERROR_LOCALIZATIONS, DEFAULT_ERROR_MESSAGES, DEFAULT_HANDLERS_PROVIDERS, DEFAULT_VALIDATION_BLUEPRINTS, DateAdapter, DateParserFormatter, DateTimeAdapter, DisabledDirective, DocumentDirHandlerService, EllipsisDirective, ErrorHandler, FormCheckboxComponent, FormInputComponent, HTTP_ERROR_CONFIG, HTTP_ERROR_DETAIL, HTTP_ERROR_HANDLER, HTTP_ERROR_STATUS, HttpErrorWrapperComponent, InternetConnectionStatusComponent, LOGO_APP_NAME_TOKEN, LOGO_URL_TOKEN, LoaderBarComponent, LoadingComponent, LoadingDirective, LogoFeatureKind, ModalCloseDirective, ModalComponent, ModalRefService, NGX_DATATABLE_MESSAGES, NG_BOOTSTRAP_CONFIG_PROVIDERS, NavItem, NavItemsService, NgxDatatableDefaultDirective, NgxDatatableListDirective, PageAlertService, PasswordComponent, RouterErrorHandlerService, SUPPRESS_UNSAVED_CHANGES_WARNING, SpinnerComponent, StatusCodeErrorHandlerService, THEME_SHARED_APPEND_CONTENT, THEME_SHARED_EXPORTS, THEME_SHARED_ROUTE_PROVIDERS, TenantResolveErrorHandlerService, ThemeSharedFeatureKind, ThemeSharedModule, TimeAdapter, ToastComponent, ToastContainerComponent, ToasterService, UnknownStatusCodeErrorHandlerService, UserMenu, UserMenuService, bounceIn, collapse, collapseLinearWithMargin, collapseWithMargin, collapseX, collapseY, collapseYWithMargin, configureNgBootstrap, configureRoutes, defaultNgxDatatableMessages, dialogAnimation, eFormComponets, expandX, expandY, expandYWithMargin, fadeAnimation, fadeIn, fadeInDown, fadeInLeft, fadeInRight, fadeInUp, fadeOut, fadeOutDown, fadeOutLeft, fadeOutRight, fadeOutUp, getErrorFromRequestBody, getPasswordValidators, provideAbpThemeShared, provideLogo, slideFromBottom, tenantNotFoundProvider, toastInOut, validatePassword, withConfirmationIcon, withEnvironmentOptions, withHttpErrorConfig, withValidateOnSubmit, withValidationBluePrint, withValidationMapErrorsFn };
3348
+ export { AbpAuthenticationErrorHandler, AbpFormatErrorHandlerService, AbpVisibleDirective, BaseThemeSharedModule, BreadcrumbComponent, BreadcrumbItemsComponent, ButtonComponent, CARD_COMPONENTS, CARD_DIRECTIVES, CONFIRMATION_ICONS, CUSTOM_ERROR_HANDLERS, CUSTOM_HTTP_ERROR_HANDLER_PRIORITY, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CardHeaderDirective, CardImgTopDirective, CardModule, CardSubtitleDirective, CardTitleDirective, Confirmation, ConfirmationComponent, ConfirmationService, CreateErrorComponentService, DEFAULT_CONFIRMATION_ICONS, DEFAULT_ERROR_LOCALIZATIONS, DEFAULT_ERROR_MESSAGES, DEFAULT_HANDLERS_PROVIDERS, DEFAULT_VALIDATION_BLUEPRINTS, DateAdapter, DateParserFormatter, DateTimeAdapter, DatepickerI18nAdapter, DisabledDirective, DocumentDirHandlerService, EllipsisDirective, ErrorHandler, FormCheckboxComponent, FormInputComponent, HTTP_ERROR_CONFIG, HTTP_ERROR_DETAIL, HTTP_ERROR_HANDLER, HTTP_ERROR_STATUS, HttpErrorWrapperComponent, InternetConnectionStatusComponent, LOGO_APP_NAME_TOKEN, LOGO_URL_TOKEN, LoaderBarComponent, LoadingComponent, LoadingDirective, LogoFeatureKind, ModalCloseDirective, ModalComponent, ModalRefService, NGX_DATATABLE_MESSAGES, NG_BOOTSTRAP_CONFIG_PROVIDERS, NavItem, NavItemsService, NgxDatatableDefaultDirective, NgxDatatableListDirective, PageAlertService, PasswordComponent, RouterErrorHandlerService, SUPPRESS_UNSAVED_CHANGES_WARNING, SpinnerComponent, StatusCodeErrorHandlerService, THEME_SHARED_APPEND_CONTENT, THEME_SHARED_EXPORTS, THEME_SHARED_ROUTE_PROVIDERS, TenantResolveErrorHandlerService, ThemeSharedFeatureKind, ThemeSharedModule, TimeAdapter, TimepickerI18nAdapter, ToastComponent, ToastContainerComponent, ToasterService, UnknownStatusCodeErrorHandlerService, UserMenu, UserMenuService, bounceIn, collapse, collapseLinearWithMargin, collapseWithMargin, collapseX, collapseY, collapseYWithMargin, configureNgBootstrap, configureRoutes, defaultNgxDatatableMessages, dialogAnimation, eFormComponets, expandX, expandY, expandYWithMargin, fadeAnimation, fadeIn, fadeInDown, fadeInLeft, fadeInRight, fadeInUp, fadeOut, fadeOutDown, fadeOutLeft, fadeOutRight, fadeOutUp, getErrorFromRequestBody, getPasswordValidators, provideAbpThemeShared, provideLogo, slideFromBottom, tenantNotFoundProvider, toastInOut, validatePassword, withConfirmationIcon, withEnvironmentOptions, withHttpErrorConfig, withValidateOnSubmit, withValidationBluePrint, withValidationMapErrorsFn };
3282
3349
  //# sourceMappingURL=abp-ng.theme.shared.mjs.map