ud-components 0.3.21 → 0.3.22

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,6 @@
1
+ export declare enum LoadingStatus {
2
+ INIT = "INIT",
3
+ LOADING = "LOADING",
4
+ LOADED = "LOADED",
5
+ ERROR = "ERROR"
6
+ }
@@ -1,7 +1,7 @@
1
1
  import * as i1$3 from '@angular/common';
2
2
  import { CommonModule, formatDate, NgClass, AsyncPipe, NgStyle, DatePipe, NgTemplateOutlet } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { ViewChild, Input, CUSTOM_ELEMENTS_SCHEMA, Component, Inject, Pipe, Injectable, inject, DestroyRef, EventEmitter, TemplateRef, ContentChild, Output, ViewContainerRef, Directive, ContentChildren, HostBinding, input, effect, ViewChildren, forwardRef } from '@angular/core';
4
+ import { ViewChild, Input, CUSTOM_ELEMENTS_SCHEMA, Component, Inject, Pipe, Injectable, inject, DestroyRef, EventEmitter, TemplateRef, ContentChild, Output, ViewContainerRef, Directive, ContentChildren, HostBinding, input, effect, ViewChildren, forwardRef, computed } from '@angular/core';
5
5
  import * as i1 from '@angular/forms';
6
6
  import { FormsModule, FormGroup, FormControl, ReactiveFormsModule, ControlContainer, FormGroupDirective, NG_VALUE_ACCESSOR } from '@angular/forms';
7
7
  import * as i1$1 from '@angular/material/snack-bar';
@@ -48,6 +48,7 @@ import * as i2$4 from '@angular/material/timepicker';
48
48
  import { MatTimepickerModule } from '@angular/material/timepicker';
49
49
  import * as i1$4 from '@angular/platform-browser';
50
50
  import { MatFormField as MatFormField$1 } from '@angular/material/form-field';
51
+ import { signalStoreFeature, withState, withComputed, withMethods, patchState } from '@ngrx/signals';
51
52
 
52
53
  class CarouselComponent {
53
54
  pictures = [];
@@ -3017,6 +3018,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImpo
3017
3018
  type: Output
3018
3019
  }] } });
3019
3020
 
3021
+ var LoadingStatus;
3022
+ (function (LoadingStatus) {
3023
+ LoadingStatus["INIT"] = "INIT";
3024
+ LoadingStatus["LOADING"] = "LOADING";
3025
+ LoadingStatus["LOADED"] = "LOADED";
3026
+ LoadingStatus["ERROR"] = "ERROR";
3027
+ })(LoadingStatus || (LoadingStatus = {}));
3028
+
3029
+ /**
3030
+ * Reusable loading state feature for signal stores
3031
+ */
3032
+ function withLoadingState() {
3033
+ return signalStoreFeature(withState({
3034
+ loadingState: { status: LoadingStatus.INIT },
3035
+ }), withComputed(({ loadingState }) => ({
3036
+ isLoading: computed(() => loadingState().status === LoadingStatus.LOADING),
3037
+ isLoaded: computed(() => loadingState().status === LoadingStatus.LOADED),
3038
+ hasError: computed(() => loadingState().status === LoadingStatus.ERROR),
3039
+ error: computed(() => {
3040
+ const state = loadingState();
3041
+ return state.status === LoadingStatus.ERROR ? state.error : null;
3042
+ }),
3043
+ })), withMethods(store => ({
3044
+ /**
3045
+ * Sets loading state (non-error statuses)
3046
+ */
3047
+ setLoadingStatus(status) {
3048
+ patchState(store, {
3049
+ loadingState: { status },
3050
+ });
3051
+ },
3052
+ /**
3053
+ * Sets error loading state
3054
+ */
3055
+ setLoadingError(error) {
3056
+ patchState(store, {
3057
+ loadingState: { status: LoadingStatus.ERROR, error },
3058
+ });
3059
+ },
3060
+ })));
3061
+ }
3062
+
3020
3063
  const generateTimeOptions = (start, end, intervalMinutes = 5) => {
3021
3064
  const options = [];
3022
3065
  const cursor = new Date(start);
@@ -3040,5 +3083,5 @@ const generateTimeOptions = (start, end, intervalMinutes = 5) => {
3040
3083
  * Generated bundle index. Do not edit.
3041
3084
  */
3042
3085
 
3043
- export { ActionType, ApplicationStatus, AutocompleteComponent, CapitalizePipe, CarouselComponent, CustomInputComponent, CustomSnackbarComponent, CustomTableComponent, DateInputComponent, DateOperator, DateRangeInputComponent, DynamicComponentComponent, EditViewComponent, EditViewSectionDirective, FileInputComponent, FilterType, IconColor, KpiComponent, KpiDataType, KpiPillType, KpiProgressBarType, KpiVariant, ModalComponent, ModalInputType, MultiSelectComponent, NumberOperator, PhoneInputComponent, PillComponent, PillToggleComponent, PluralizePipe, ProgressBarComponent, SafePipe, SingularPipe, SnackbarType, StringOperator, SummaryViewComponent, TableDisplayColumnType, TabsComponent, TelInputComponent, TextInputComponent, TextareaComponent, TimePickerComponent, ToObservablePipe, ToggleComponent, TranslateWrapperService, UdButtonComponent, capitalize, formatLocalDate, formatLocalDateTime, formatLocalDateTimeLongForm, formatLocalTime, formatLocalTimeWithMinutes, formatLocalTimeWithMinutesAmPm, formatMonthYear, formatPhoneNumber, formatStringDate, formatStringDateTime, generateTimeOptions, inListValidator, parseLocalDate, pluralize, spaceCase, updateArray };
3086
+ export { ActionType, ApplicationStatus, AutocompleteComponent, CapitalizePipe, CarouselComponent, CustomInputComponent, CustomSnackbarComponent, CustomTableComponent, DateInputComponent, DateOperator, DateRangeInputComponent, DynamicComponentComponent, EditViewComponent, EditViewSectionDirective, FileInputComponent, FilterType, IconColor, KpiComponent, KpiDataType, KpiPillType, KpiProgressBarType, KpiVariant, LoadingStatus, ModalComponent, ModalInputType, MultiSelectComponent, NumberOperator, PhoneInputComponent, PillComponent, PillToggleComponent, PluralizePipe, ProgressBarComponent, SafePipe, SingularPipe, SnackbarType, StringOperator, SummaryViewComponent, TableDisplayColumnType, TabsComponent, TelInputComponent, TextInputComponent, TextareaComponent, TimePickerComponent, ToObservablePipe, ToggleComponent, TranslateWrapperService, UdButtonComponent, capitalize, formatLocalDate, formatLocalDateTime, formatLocalDateTimeLongForm, formatLocalTime, formatLocalTimeWithMinutes, formatLocalTimeWithMinutesAmPm, formatMonthYear, formatPhoneNumber, formatStringDate, formatStringDateTime, generateTimeOptions, inListValidator, parseLocalDate, pluralize, spaceCase, updateArray, withLoadingState };
3044
3087
  //# sourceMappingURL=ud-components.mjs.map