@vality/matez 19.0.1-pr-423-667df70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/fesm2022/vality-matez.mjs +3741 -0
- package/fesm2022/vality-matez.mjs.map +1 -0
- package/index.d.ts +1 -0
- package/lib/components/actions/actions.component.d.ts +5 -0
- package/lib/components/actions/actions.module.d.ts +7 -0
- package/lib/components/actions/index.d.ts +2 -0
- package/lib/components/confirm-dialog/confirm-dialog.component.d.ts +16 -0
- package/lib/components/confirm-dialog/confirm-dialog.module.d.ts +14 -0
- package/lib/components/confirm-dialog/index.d.ts +2 -0
- package/lib/components/content-loading/content-loading.component.d.ts +8 -0
- package/lib/components/content-loading/index.d.ts +1 -0
- package/lib/components/date-range-field/date-range-field.component.d.ts +16 -0
- package/lib/components/date-range-field/date-range-field.module.d.ts +13 -0
- package/lib/components/date-range-field/index.d.ts +5 -0
- package/lib/components/date-range-field/types/date-range.d.ts +4 -0
- package/lib/components/date-range-field/utils/create-date-range-to-today.d.ts +2 -0
- package/lib/components/date-range-field/utils/is-equal-date-range.d.ts +2 -0
- package/lib/components/datetime-field/datetime-field.component.d.ts +19 -0
- package/lib/components/datetime-field/datetime-field.module.d.ts +11 -0
- package/lib/components/datetime-field/index.d.ts +2 -0
- package/lib/components/dialog/components/dialog-actions/dialog-actions.component.d.ts +5 -0
- package/lib/components/dialog/dialog.component.d.ts +28 -0
- package/lib/components/dialog/dialog.module.d.ts +16 -0
- package/lib/components/dialog/index.d.ts +8 -0
- package/lib/components/dialog/services/dialog.service.d.ts +23 -0
- package/lib/components/dialog/tokens.d.ts +8 -0
- package/lib/components/dialog/types/dialog-response-status.d.ts +5 -0
- package/lib/components/dialog/types/dialog-response.d.ts +6 -0
- package/lib/components/dialog/utils/dialog-superclass.d.ts +13 -0
- package/lib/components/error-page/error-page-routing.module.d.ts +7 -0
- package/lib/components/error-page/error-page.component.d.ts +5 -0
- package/lib/components/error-page/error-page.module.d.ts +9 -0
- package/lib/components/error-page/index.d.ts +2 -0
- package/lib/components/file-upload/file-upload.component.d.ts +14 -0
- package/lib/components/file-upload/file-upload.module.d.ts +9 -0
- package/lib/components/file-upload/index.d.ts +3 -0
- package/lib/components/file-upload/utils/load-file-content.d.ts +3 -0
- package/lib/components/filters/components/filters-dialog/filters-dialog.component.d.ts +10 -0
- package/lib/components/filters/components/main-filters/main-filters.directive.d.ts +8 -0
- package/lib/components/filters/components/more-filters-button/more-filters-button.component.d.ts +7 -0
- package/lib/components/filters/components/other-filters/other-filters.directive.d.ts +8 -0
- package/lib/components/filters/filters.component.d.ts +29 -0
- package/lib/components/filters/filters.module.d.ts +19 -0
- package/lib/components/filters/index.d.ts +5 -0
- package/lib/components/index.d.ts +18 -0
- package/lib/components/input-field/index.d.ts +2 -0
- package/lib/components/input-field/input-field.component.d.ts +14 -0
- package/lib/components/input-field/input-field.module.d.ts +12 -0
- package/lib/components/list-field/index.d.ts +2 -0
- package/lib/components/list-field/list-field.component.d.ts +12 -0
- package/lib/components/list-field/list-field.module.d.ts +10 -0
- package/lib/components/nav/index.d.ts +1 -0
- package/lib/components/nav/nav.component.d.ts +16 -0
- package/lib/components/number-range-field/index.d.ts +2 -0
- package/lib/components/number-range-field/number-range-field.component.d.ts +18 -0
- package/lib/components/number-range-field/number-range-field.module.d.ts +9 -0
- package/lib/components/progress/index.d.ts +3 -0
- package/lib/components/progress/progress.component.d.ts +9 -0
- package/lib/components/progress/progress.module.d.ts +9 -0
- package/lib/components/progress/utils/get-progress-by-count.d.ts +1 -0
- package/lib/components/select-autocomplete/autocomplete-field/autocomplete-field.component.d.ts +23 -0
- package/lib/components/select-autocomplete/autocomplete-field/autocomplete-field.module.d.ts +13 -0
- package/lib/components/select-autocomplete/autocomplete-field/index.d.ts +2 -0
- package/lib/components/select-autocomplete/index.d.ts +3 -0
- package/lib/components/select-autocomplete/select-field/index.d.ts +2 -0
- package/lib/components/select-autocomplete/select-field/select-field.component.d.ts +26 -0
- package/lib/components/select-autocomplete/select-field/select-field.module.d.ts +12 -0
- package/lib/components/select-autocomplete/types/index.d.ts +1 -0
- package/lib/components/select-autocomplete/types/option.d.ts +6 -0
- package/lib/components/select-autocomplete/utils/find-option-by-value.d.ts +2 -0
- package/lib/components/select-autocomplete/utils/get-hint-text.d.ts +5 -0
- package/lib/components/select-autocomplete/utils/index.d.ts +2 -0
- package/lib/components/select-autocomplete/utils/search-options.d.ts +3 -0
- package/lib/components/switch-button/index.d.ts +2 -0
- package/lib/components/switch-button/switch-button.component.d.ts +24 -0
- package/lib/components/switch-button/switch-button.module.d.ts +11 -0
- package/lib/components/table/components/base-column.component.d.ts +17 -0
- package/lib/components/table/components/customize/customize.component.d.ts +17 -0
- package/lib/components/table/components/dnd-column.component.d.ts +7 -0
- package/lib/components/table/components/infinity-scroll.directive.d.ts +12 -0
- package/lib/components/table/components/no-records.component.d.ts +7 -0
- package/lib/components/table/components/select-column.component.d.ts +21 -0
- package/lib/components/table/components/table-actions.component.d.ts +5 -0
- package/lib/components/table/components/table-info-bar/table-info-bar.component.d.ts +33 -0
- package/lib/components/table/components/table-inputs.component.d.ts +5 -0
- package/lib/components/table/components/table-progress-bar.component.d.ts +6 -0
- package/lib/components/table/consts.d.ts +8 -0
- package/lib/components/table/index.d.ts +10 -0
- package/lib/components/table/presets/create-menu-column.d.ts +6 -0
- package/lib/components/table/presets/index.d.ts +1 -0
- package/lib/components/table/table.component.d.ts +81 -0
- package/lib/components/table/table.module.d.ts +34 -0
- package/lib/components/table/tree-data/index.d.ts +2 -0
- package/lib/components/table/tree-data/tree-data-item-to-inline-data-item.d.ts +10 -0
- package/lib/components/table/tree-data/tree-data.d.ts +10 -0
- package/lib/components/table/types/column2.d.ts +34 -0
- package/lib/components/table/types/drag-drop.d.ts +10 -0
- package/lib/components/table/types/index.d.ts +3 -0
- package/lib/components/table/types/update-options.d.ts +3 -0
- package/lib/components/table/utils/cached-head-map.d.ts +2 -0
- package/lib/components/table/utils/correct-priorities.d.ts +5 -0
- package/lib/components/table/utils/create-column.d.ts +6 -0
- package/lib/components/table/utils/create-intersection-observer.d.ts +2 -0
- package/lib/components/table/utils/create-unique-column-def.d.ts +1 -0
- package/lib/components/table/utils/filter-sort.d.ts +14 -0
- package/lib/components/table/utils/normalize-string.d.ts +2 -0
- package/lib/components/table/utils/table-data-source.d.ts +31 -0
- package/lib/components/table/utils/table-to-csv-object.d.ts +3 -0
- package/lib/components/table/utils/to-columns-data.d.ts +26 -0
- package/lib/components/tag/index.d.ts +2 -0
- package/lib/components/tag/tag.component.d.ts +10 -0
- package/lib/components/tag/tag.module.d.ts +10 -0
- package/lib/components/value/components/menu-value.component.d.ts +15 -0
- package/lib/components/value/components/value-list.component.d.ts +7 -0
- package/lib/components/value/index.d.ts +3 -0
- package/lib/components/value/types/base-type.d.ts +19 -0
- package/lib/components/value/types/value.d.ts +9 -0
- package/lib/components/value/utils/currency-amount-value-to-string.d.ts +8 -0
- package/lib/components/value/utils/datetime-value-to-string.d.ts +4 -0
- package/lib/components/value/utils/unknown-to-string.d.ts +1 -0
- package/lib/components/value/utils/value-to-string.d.ts +2 -0
- package/lib/components/value/value.component.d.ts +27 -0
- package/lib/directives/highlight.directive.d.ts +15 -0
- package/lib/directives/index.d.ts +2 -0
- package/lib/directives/tooltip.directive.d.ts +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/pipes/amount-currency.pipe.d.ts +10 -0
- package/lib/pipes/enum-key-values.pipe.d.ts +10 -0
- package/lib/pipes/enum-key.pipe.d.ts +8 -0
- package/lib/pipes/enum-keys.pipe.d.ts +7 -0
- package/lib/pipes/humanized-duration.pipe.d.ts +13 -0
- package/lib/pipes/index.d.ts +8 -0
- package/lib/pipes/inline-json.pipe.d.ts +7 -0
- package/lib/pipes/pipes.module.d.ts +14 -0
- package/lib/pipes/select.pipe.d.ts +12 -0
- package/lib/services/config/config.service.d.ts +12 -0
- package/lib/services/config/index.d.ts +1 -0
- package/lib/services/fetch-superclass/fetch-superclass.d.ts +39 -0
- package/lib/services/fetch-superclass/index.d.ts +1 -0
- package/lib/services/index.d.ts +5 -0
- package/lib/services/log/index.d.ts +2 -0
- package/lib/services/log/log-error.d.ts +12 -0
- package/lib/services/log/log.module.d.ts +7 -0
- package/lib/services/log/notify-log.service.d.ts +17 -0
- package/lib/services/log/types/operation.d.ts +1 -0
- package/lib/services/query-params/index.d.ts +4 -0
- package/lib/services/query-params/query-params.module.d.ts +6 -0
- package/lib/services/query-params/query-params.service.d.ts +37 -0
- package/lib/services/query-params/types/serializer.d.ts +6 -0
- package/lib/services/query-params/utils/date-query-params-serializers.d.ts +2 -0
- package/lib/services/query-params/utils/deserialize-query-param.d.ts +2 -0
- package/lib/services/query-params/utils/index.d.ts +2 -0
- package/lib/services/query-params/utils/query-params-serializers.d.ts +3 -0
- package/lib/services/query-params/utils/serialize-query-param.d.ts +2 -0
- package/lib/services/url.service.d.ts +12 -0
- package/lib/styles/index.d.ts +1 -0
- package/lib/styles/types/color.d.ts +4 -0
- package/lib/types/progressable.d.ts +3 -0
- package/lib/utils/async/async-transform.d.ts +20 -0
- package/lib/utils/async/get-possibly-async-observable.d.ts +3 -0
- package/lib/utils/async/index.d.ts +3 -0
- package/lib/utils/async/is-async.d.ts +4 -0
- package/lib/utils/clean/clean.d.ts +2 -0
- package/lib/utils/clean/index.d.ts +1 -0
- package/lib/utils/compare/compare-different-types.d.ts +4 -0
- package/lib/utils/compare/index.d.ts +1 -0
- package/lib/utils/component/component-changes.d.ts +8 -0
- package/lib/utils/component/index.d.ts +1 -0
- package/lib/utils/csv/create-csv.d.ts +1 -0
- package/lib/utils/csv/index.d.ts +1 -0
- package/lib/utils/currency/format-currency.d.ts +1 -0
- package/lib/utils/currency/get-currency-exponent.d.ts +1 -0
- package/lib/utils/currency/index.d.ts +4 -0
- package/lib/utils/currency/to-major.d.ts +2 -0
- package/lib/utils/currency/to-minor.d.ts +2 -0
- package/lib/utils/date/get-no-time-zone-iso-string.d.ts +2 -0
- package/lib/utils/date/index.d.ts +1 -0
- package/lib/utils/decorators/debounce-time.d.ts +1 -0
- package/lib/utils/decorators/index.d.ts +1 -0
- package/lib/utils/empty/index.d.ts +3 -0
- package/lib/utils/empty/is-empty-primitive.d.ts +1 -0
- package/lib/utils/empty/is-empty.d.ts +1 -0
- package/lib/utils/empty/types/nil.d.ts +1 -0
- package/lib/utils/enum/get-enum-keys.d.ts +10 -0
- package/lib/utils/enum/index.d.ts +2 -0
- package/lib/utils/enum/types/enum.d.ts +2 -0
- package/lib/utils/enum/types/union-enum.d.ts +2 -0
- package/lib/utils/file/download-file.d.ts +8 -0
- package/lib/utils/file/index.d.ts +1 -0
- package/lib/utils/form/create-controls.d.ts +4 -0
- package/lib/utils/form/form-wrappers/abstract-control-superclass.d.ts +17 -0
- package/lib/utils/form/form-wrappers/form-component-superclass.directive.d.ts +14 -0
- package/lib/utils/form/form-wrappers/form-control-superclass.directive.d.ts +8 -0
- package/lib/utils/form/form-wrappers/form-group-superclass.directive.d.ts +11 -0
- package/lib/utils/form/form-wrappers/index.d.ts +5 -0
- package/lib/utils/form/form-wrappers/utils/create-control-providers.d.ts +2 -0
- package/lib/utils/form/form-wrappers/utils/get-errors-tree.d.ts +6 -0
- package/lib/utils/form/form-wrappers/utils/provide-validators.d.ts +2 -0
- package/lib/utils/form/form-wrappers/utils/provide-value-accessor.d.ts +2 -0
- package/lib/utils/form/get-valid-value-changes.d.ts +3 -0
- package/lib/utils/form/get-value-changes.d.ts +3 -0
- package/lib/utils/form/get-value.d.ts +2 -0
- package/lib/utils/form/has-controls.d.ts +2 -0
- package/lib/utils/form/index.d.ts +8 -0
- package/lib/utils/form/set-disabled.d.ts +2 -0
- package/lib/utils/form/types/form-group-by-value.d.ts +4 -0
- package/lib/utils/import/get-import-value.d.ts +2 -0
- package/lib/utils/import/index.d.ts +1 -0
- package/lib/utils/index.d.ts +18 -0
- package/lib/utils/json/index.d.ts +1 -0
- package/lib/utils/json/inline-json.d.ts +1 -0
- package/lib/utils/object/count-changed.d.ts +3 -0
- package/lib/utils/object/count-props.d.ts +1 -0
- package/lib/utils/object/index.d.ts +3 -0
- package/lib/utils/object/select.d.ts +3 -0
- package/lib/utils/operators/async-start-with.d.ts +2 -0
- package/lib/utils/operators/debounce-time-with-first.d.ts +2 -0
- package/lib/utils/operators/fork-join-to-result.d.ts +20 -0
- package/lib/utils/operators/get-observable.d.ts +3 -0
- package/lib/utils/operators/handle-error.d.ts +3 -0
- package/lib/utils/operators/in-progress-from.d.ts +2 -0
- package/lib/utils/operators/index.d.ts +8 -0
- package/lib/utils/operators/pass-error.d.ts +2 -0
- package/lib/utils/operators/progress-to.d.ts +2 -0
- package/lib/utils/operators/switch-combine-with.d.ts +6 -0
- package/lib/utils/string/index.d.ts +1 -0
- package/lib/utils/string/split-by-separators.d.ts +1 -0
- package/lib/utils/transform-attribute/array-attribute.d.ts +3 -0
- package/lib/utils/transform-attribute/index.d.ts +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,3741 @@
|
|
|
1
|
+
import * as i1$1 from '@angular/common';
|
|
2
|
+
import { CommonModule, AsyncPipe, formatCurrency as formatCurrency$1, getCurrencySymbol, formatDate, NgClass } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Component, ChangeDetectionStrategy, NgModule, Input, EventEmitter, booleanAttribute, HostBinding, Output, InjectionToken, Injectable, Optional, Inject, inject, Directive, input, numberAttribute, ChangeDetectorRef, DestroyRef, forwardRef, LOCALE_ID, model, runInInjectionContext, Injector, output, viewChild, computed, signal, ElementRef, ViewChild, ContentChild, TemplateRef, ViewEncapsulation, DEFAULT_CURRENCY_CODE, Pipe } from '@angular/core';
|
|
5
|
+
import * as i1$4 from '@angular/material/button';
|
|
6
|
+
import { MatButtonModule, MatIconButton, MatButton } from '@angular/material/button';
|
|
7
|
+
import * as i1$2 from '@angular/material/dialog';
|
|
8
|
+
import { MatDialogModule, MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
|
9
|
+
import * as i2 from '@angular/material/divider';
|
|
10
|
+
import { MatDividerModule, MatDivider } from '@angular/material/divider';
|
|
11
|
+
import * as i2$1 from '@angular/material/icon';
|
|
12
|
+
import { MatIconModule, MatIcon } from '@angular/material/icon';
|
|
13
|
+
import * as i1 from '@angular/material/progress-bar';
|
|
14
|
+
import { MatProgressBarModule, MatProgressBar } from '@angular/material/progress-bar';
|
|
15
|
+
import * as i10 from '@angular/cdk/drag-drop';
|
|
16
|
+
import { CdkDrag, CdkDropList } from '@angular/cdk/drag-drop';
|
|
17
|
+
import * as i1$3 from '@angular/forms';
|
|
18
|
+
import { NG_VALIDATORS, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
19
|
+
import * as i6 from '@angular/material/badge';
|
|
20
|
+
import { MatBadgeModule } from '@angular/material/badge';
|
|
21
|
+
import * as i4 from '@angular/material/card';
|
|
22
|
+
import { MatCardModule } from '@angular/material/card';
|
|
23
|
+
import * as i9 from '@angular/material/sort';
|
|
24
|
+
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
25
|
+
import * as i2$4 from '@angular/material/table';
|
|
26
|
+
import { MatTableDataSource, MatTable, MatColumnDef, MatCellDef, MatHeaderCellDef, MatFooterCellDef, MatTableModule, MatRow } from '@angular/material/table';
|
|
27
|
+
import * as i2$5 from '@angular/material/tooltip';
|
|
28
|
+
import { MatTooltip, MatTooltipModule } from '@angular/material/tooltip';
|
|
29
|
+
import { random, get, difference, isEqual as isEqual$1, capitalize, lowerFirst, isArray } from 'lodash-es';
|
|
30
|
+
import * as i2$2 from '@angular/material/input';
|
|
31
|
+
import { MatInputModule } from '@angular/material/input';
|
|
32
|
+
import startCase from 'lodash-es/startCase';
|
|
33
|
+
import { isPrimitive } from 'utility-types';
|
|
34
|
+
import { isObservable, defer, merge, combineLatest, mergeMap, EMPTY, catchError, of, scan, takeLast, from, switchMap, ReplaySubject, debounce, interval, concat, timer, take, BehaviorSubject, Observable, debounceTime as debounceTime$1, Subject, tap, first as first$1, forkJoin, lastValueFrom, timeout, map as map$1, skipWhile, race, skip, mergeScan, takeUntil, throttleTime } from 'rxjs';
|
|
35
|
+
import { finalize, map, delay, startWith, distinctUntilChanged, shareReplay, catchError as catchError$1, filter, first, debounceTime, share } from 'rxjs/operators';
|
|
36
|
+
import { isPromise } from 'rxjs/internal/util/isPromise';
|
|
37
|
+
import { takeUntilDestroyed, toObservable, outputFromObservable } from '@angular/core/rxjs-interop';
|
|
38
|
+
import { WrappedControlSuperclass, FormComponentSuperclass as FormComponentSuperclass$1 } from '@s-libs/ng-core';
|
|
39
|
+
import omitBy from 'lodash-es/omitBy';
|
|
40
|
+
import isNil from 'lodash-es/isNil';
|
|
41
|
+
import * as currencies from '@dinero.js/currencies';
|
|
42
|
+
import round from 'lodash-es/round';
|
|
43
|
+
import isEqual from 'lodash-es/isEqual';
|
|
44
|
+
import lodashIsEmpty from 'lodash-es/isEmpty';
|
|
45
|
+
import isObject$1 from 'lodash-es/isObject';
|
|
46
|
+
import * as papaparse from 'papaparse';
|
|
47
|
+
import * as i3 from '@angular/material/form-field';
|
|
48
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
49
|
+
import * as i2$3 from '@angular/material/chips';
|
|
50
|
+
import { MatChipsModule } from '@angular/material/chips';
|
|
51
|
+
import * as i1$5 from '@angular/router';
|
|
52
|
+
import { RouterModule, RouterLink } from '@angular/router';
|
|
53
|
+
export { MtxTooltip as Tooltip } from '@ng-matero/extensions/tooltip';
|
|
54
|
+
import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu';
|
|
55
|
+
import { SelectionModel } from '@angular/cdk/collections';
|
|
56
|
+
import * as i3$1 from '@angular/material/checkbox';
|
|
57
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
58
|
+
import * as i2$6 from '@angular/cdk/layout';
|
|
59
|
+
import { Breakpoints, LayoutModule } from '@angular/cdk/layout';
|
|
60
|
+
import * as i2$7 from '@angular/material/datepicker';
|
|
61
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
62
|
+
import * as i6$1 from '@angular/material/core';
|
|
63
|
+
import { MAT_DATE_LOCALE, DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
|
|
64
|
+
import { DateFnsAdapter, MAT_DATE_FNS_FORMATS } from '@angular/material-date-fns-adapter';
|
|
65
|
+
import { enGB } from 'date-fns/locale';
|
|
66
|
+
import { isEqual as isEqual$2, subDays, startOfDay, endOfDay, format, isValid, formatDistanceToNow } from 'date-fns';
|
|
67
|
+
import * as i3$2 from '@ng-matero/extensions/select';
|
|
68
|
+
import { MtxSelectModule } from '@ng-matero/extensions/select';
|
|
69
|
+
import * as i5 from '@angular/material/autocomplete';
|
|
70
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
71
|
+
import * as i1$6 from '@angular/common/http';
|
|
72
|
+
import * as i1$7 from '@angular/material/snack-bar';
|
|
73
|
+
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
74
|
+
import negate from 'lodash-es/negate';
|
|
75
|
+
|
|
76
|
+
class ActionsComponent {
|
|
77
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
78
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.6", type: ActionsComponent, isStandalone: false, selector: "v-actions", ngImport: i0, template: "<div class=\"v-actions\">\n <ng-content></ng-content>\n</div>\n", styles: ["::ng-deep .v-actions{box-sizing:border-box;display:flex;flex-wrap:wrap;gap:16px}::ng-deep .v-actions>*:first-child:not(:last-child){margin-right:auto}::ng-deep .v-actions>*:first-child:last-child{margin-left:auto}@media screen and (max-width: 600px){::ng-deep .v-actions>*{margin-left:auto!important;margin-right:auto!important}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
79
|
+
}
|
|
80
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ActionsComponent, decorators: [{
|
|
81
|
+
type: Component,
|
|
82
|
+
args: [{ selector: 'v-actions', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"v-actions\">\n <ng-content></ng-content>\n</div>\n", styles: ["::ng-deep .v-actions{box-sizing:border-box;display:flex;flex-wrap:wrap;gap:16px}::ng-deep .v-actions>*:first-child:not(:last-child){margin-right:auto}::ng-deep .v-actions>*:first-child:last-child{margin-left:auto}@media screen and (max-width: 600px){::ng-deep .v-actions>*{margin-left:auto!important;margin-right:auto!important}}\n"] }]
|
|
83
|
+
}] });
|
|
84
|
+
|
|
85
|
+
class ActionsModule {
|
|
86
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ActionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
87
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: ActionsModule, declarations: [ActionsComponent], exports: [ActionsComponent] }); }
|
|
88
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ActionsModule }); }
|
|
89
|
+
}
|
|
90
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ActionsModule, decorators: [{
|
|
91
|
+
type: NgModule,
|
|
92
|
+
args: [{
|
|
93
|
+
imports: [],
|
|
94
|
+
declarations: [ActionsComponent],
|
|
95
|
+
exports: [ActionsComponent],
|
|
96
|
+
}]
|
|
97
|
+
}] });
|
|
98
|
+
|
|
99
|
+
class ProgressComponent {
|
|
100
|
+
get mode() {
|
|
101
|
+
return typeof this.progress === 'number' && this.progress <= 1 && this.progress > 0
|
|
102
|
+
? 'determinate'
|
|
103
|
+
: !!this.progress || this.progress === ''
|
|
104
|
+
? 'indeterminate'
|
|
105
|
+
: undefined;
|
|
106
|
+
}
|
|
107
|
+
get value() {
|
|
108
|
+
return this.mode === 'determinate'
|
|
109
|
+
? Math.max(Math.min((1 - this.progress) * 100, 100), 0)
|
|
110
|
+
: undefined;
|
|
111
|
+
}
|
|
112
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ProgressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
113
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: ProgressComponent, isStandalone: false, selector: "v-progress", inputs: { progress: "progress" }, ngImport: i0, template: "@if (!!mode) {\n <mat-progress-bar [mode]=\"mode\" [value]=\"value\"></mat-progress-bar>\n}\n", dependencies: [{ kind: "component", type: i1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }] }); }
|
|
114
|
+
}
|
|
115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ProgressComponent, decorators: [{
|
|
116
|
+
type: Component,
|
|
117
|
+
args: [{ selector: 'v-progress', standalone: false, template: "@if (!!mode) {\n <mat-progress-bar [mode]=\"mode\" [value]=\"value\"></mat-progress-bar>\n}\n" }]
|
|
118
|
+
}], propDecorators: { progress: [{
|
|
119
|
+
type: Input
|
|
120
|
+
}] } });
|
|
121
|
+
|
|
122
|
+
class ProgressModule {
|
|
123
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ProgressModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
124
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: ProgressModule, declarations: [ProgressComponent], imports: [CommonModule, MatProgressBarModule], exports: [ProgressComponent] }); }
|
|
125
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ProgressModule, imports: [CommonModule, MatProgressBarModule] }); }
|
|
126
|
+
}
|
|
127
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ProgressModule, decorators: [{
|
|
128
|
+
type: NgModule,
|
|
129
|
+
args: [{
|
|
130
|
+
declarations: [ProgressComponent],
|
|
131
|
+
imports: [CommonModule, MatProgressBarModule],
|
|
132
|
+
exports: [ProgressComponent],
|
|
133
|
+
}]
|
|
134
|
+
}] });
|
|
135
|
+
|
|
136
|
+
class DialogActionsComponent {
|
|
137
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DialogActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
138
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.6", type: DialogActionsComponent, isStandalone: false, selector: "v-dialog-actions", ngImport: i0, template: "<v-actions><ng-content></ng-content></v-actions>\n", dependencies: [{ kind: "component", type: ActionsComponent, selector: "v-actions" }] }); }
|
|
139
|
+
}
|
|
140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DialogActionsComponent, decorators: [{
|
|
141
|
+
type: Component,
|
|
142
|
+
args: [{ selector: 'v-dialog-actions', standalone: false, template: "<v-actions><ng-content></ng-content></v-actions>\n" }]
|
|
143
|
+
}] });
|
|
144
|
+
|
|
145
|
+
var DialogResponseStatus;
|
|
146
|
+
(function (DialogResponseStatus) {
|
|
147
|
+
DialogResponseStatus["Success"] = "success";
|
|
148
|
+
DialogResponseStatus["Error"] = "error";
|
|
149
|
+
DialogResponseStatus["Cancelled"] = "canceled";
|
|
150
|
+
})(DialogResponseStatus || (DialogResponseStatus = {}));
|
|
151
|
+
|
|
152
|
+
class DialogComponent {
|
|
153
|
+
constructor() {
|
|
154
|
+
this.hostClass = true;
|
|
155
|
+
this.disabled = false;
|
|
156
|
+
this.hasDivider = true;
|
|
157
|
+
this.noContent = false;
|
|
158
|
+
this.noActions = false;
|
|
159
|
+
this.noCloseButton = false;
|
|
160
|
+
this.fullSize = false;
|
|
161
|
+
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
162
|
+
this.cancel = new EventEmitter();
|
|
163
|
+
this.cancelData = {
|
|
164
|
+
status: DialogResponseStatus.Cancelled,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
cancelDialog() {
|
|
168
|
+
this.cancel.emit();
|
|
169
|
+
}
|
|
170
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
171
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: DialogComponent, isStandalone: false, selector: "v-dialog", inputs: { title: "title", disabled: ["disabled", "disabled", booleanAttribute], progress: "progress", hasDivider: ["hasDivider", "hasDivider", booleanAttribute], noContent: ["noContent", "noContent", booleanAttribute], noActions: ["noActions", "noActions", booleanAttribute], noCloseButton: ["noCloseButton", "noCloseButton", booleanAttribute], fullSize: ["fullSize", "fullSize", booleanAttribute] }, outputs: { cancel: "cancel" }, host: { properties: { "class.v-dialog": "this.hostClass" } }, ngImport: i0, template: "<div [ngClass]=\"{ 'full-size': fullSize }\" class=\"dialog\">\n <div class=\"dialog-title\">\n <div>\n <h2 class=\"title\">{{ title }}</h2>\n </div>\n @if (!noCloseButton) {\n <mat-icon\n [matDialogClose]=\"cancelData\"\n class=\"dialog-title-close\"\n inline\n (click)=\"cancelDialog()\"\n >clear</mat-icon\n >\n }\n </div>\n\n @if (!noContent) {\n @if (hasDivider) {\n <mat-divider></mat-divider>\n }\n <div class=\"dialog-content\">\n <ng-content></ng-content>\n </div>\n }\n @if (!noActions) {\n @if (hasDivider) {\n <mat-divider></mat-divider>\n }\n <div class=\"dialog-actions\">\n <ng-content select=\"v-dialog-actions\"></ng-content>\n </div>\n }\n\n <v-progress [progress]=\"progress\"></v-progress>\n</div>\n", styles: [":host{display:flex;flex-direction:column;flex-grow:1;height:100%}.dialog{flex-direction:column;box-sizing:border-box;display:flex;flex:1 1 100%;max-height:calc(90vh - 48px)!important}@media screen and (max-width: 959px){.dialog{max-height:calc(100vh - 48px)!important}}.dialog.full-size{min-height:calc(90vh - 48px)!important}@media screen and (max-width: 959px){.dialog.full-size{min-height:calc(100vh - 48px)!important}}.dialog-title{flex-direction:row;box-sizing:border-box;display:flex;place-content:center space-between;align-items:center;padding:24px}.dialog-title h1,.dialog-title h2,.dialog-title h3,.dialog-title h4,.dialog-title h5,.dialog-title h6{margin:0}.dialog-title-close.dialog-title-close{cursor:pointer;font-size:24px}.dialog-title-close.dialog-title-close:hover{opacity:.5}.dialog-content{flex:1 1 100%;box-sizing:border-box;padding:24px;overflow:auto;display:grid}.dialog-actions{padding:24px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i2.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i1$2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: ProgressComponent, selector: "v-progress", inputs: ["progress"] }] }); }
|
|
172
|
+
}
|
|
173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DialogComponent, decorators: [{
|
|
174
|
+
type: Component,
|
|
175
|
+
args: [{ selector: 'v-dialog', standalone: false, template: "<div [ngClass]=\"{ 'full-size': fullSize }\" class=\"dialog\">\n <div class=\"dialog-title\">\n <div>\n <h2 class=\"title\">{{ title }}</h2>\n </div>\n @if (!noCloseButton) {\n <mat-icon\n [matDialogClose]=\"cancelData\"\n class=\"dialog-title-close\"\n inline\n (click)=\"cancelDialog()\"\n >clear</mat-icon\n >\n }\n </div>\n\n @if (!noContent) {\n @if (hasDivider) {\n <mat-divider></mat-divider>\n }\n <div class=\"dialog-content\">\n <ng-content></ng-content>\n </div>\n }\n @if (!noActions) {\n @if (hasDivider) {\n <mat-divider></mat-divider>\n }\n <div class=\"dialog-actions\">\n <ng-content select=\"v-dialog-actions\"></ng-content>\n </div>\n }\n\n <v-progress [progress]=\"progress\"></v-progress>\n</div>\n", styles: [":host{display:flex;flex-direction:column;flex-grow:1;height:100%}.dialog{flex-direction:column;box-sizing:border-box;display:flex;flex:1 1 100%;max-height:calc(90vh - 48px)!important}@media screen and (max-width: 959px){.dialog{max-height:calc(100vh - 48px)!important}}.dialog.full-size{min-height:calc(90vh - 48px)!important}@media screen and (max-width: 959px){.dialog.full-size{min-height:calc(100vh - 48px)!important}}.dialog-title{flex-direction:row;box-sizing:border-box;display:flex;place-content:center space-between;align-items:center;padding:24px}.dialog-title h1,.dialog-title h2,.dialog-title h3,.dialog-title h4,.dialog-title h5,.dialog-title h6{margin:0}.dialog-title-close.dialog-title-close{cursor:pointer;font-size:24px}.dialog-title-close.dialog-title-close:hover{opacity:.5}.dialog-content{flex:1 1 100%;box-sizing:border-box;padding:24px;overflow:auto;display:grid}.dialog-actions{padding:24px}\n"] }]
|
|
176
|
+
}], propDecorators: { hostClass: [{
|
|
177
|
+
type: HostBinding,
|
|
178
|
+
args: ['class.v-dialog']
|
|
179
|
+
}], title: [{
|
|
180
|
+
type: Input
|
|
181
|
+
}], disabled: [{
|
|
182
|
+
type: Input,
|
|
183
|
+
args: [{ transform: booleanAttribute }]
|
|
184
|
+
}], progress: [{
|
|
185
|
+
type: Input
|
|
186
|
+
}], hasDivider: [{
|
|
187
|
+
type: Input,
|
|
188
|
+
args: [{ transform: booleanAttribute }]
|
|
189
|
+
}], noContent: [{
|
|
190
|
+
type: Input,
|
|
191
|
+
args: [{ transform: booleanAttribute }]
|
|
192
|
+
}], noActions: [{
|
|
193
|
+
type: Input,
|
|
194
|
+
args: [{ transform: booleanAttribute }]
|
|
195
|
+
}], noCloseButton: [{
|
|
196
|
+
type: Input,
|
|
197
|
+
args: [{ transform: booleanAttribute }]
|
|
198
|
+
}], fullSize: [{
|
|
199
|
+
type: Input,
|
|
200
|
+
args: [{ transform: booleanAttribute }]
|
|
201
|
+
}], cancel: [{
|
|
202
|
+
type: Output
|
|
203
|
+
}] } });
|
|
204
|
+
|
|
205
|
+
const DIALOG_CONFIG = new InjectionToken('dialogConfig');
|
|
206
|
+
const BASE_CONFIG = {
|
|
207
|
+
maxHeight: '100vh',
|
|
208
|
+
disableClose: true,
|
|
209
|
+
autoFocus: false,
|
|
210
|
+
minWidth: '0',
|
|
211
|
+
maxWidth: 'calc(100vw - 16px)',
|
|
212
|
+
width: '552px',
|
|
213
|
+
};
|
|
214
|
+
const DEFAULT_DIALOG_CONFIG = {
|
|
215
|
+
small: {
|
|
216
|
+
...BASE_CONFIG,
|
|
217
|
+
width: '360px',
|
|
218
|
+
},
|
|
219
|
+
medium: BASE_CONFIG,
|
|
220
|
+
large: {
|
|
221
|
+
...BASE_CONFIG,
|
|
222
|
+
width: '1000px',
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
const DEFAULT_DIALOG_CONFIG_FULL_HEIGHT = 'calc(90vh - 48px)';
|
|
226
|
+
|
|
227
|
+
class DialogService {
|
|
228
|
+
constructor(dialog, dialogConfig) {
|
|
229
|
+
this.dialog = dialog;
|
|
230
|
+
this.dialogConfig = dialogConfig;
|
|
231
|
+
if (!dialogConfig) {
|
|
232
|
+
this.dialogConfig = DEFAULT_DIALOG_CONFIG;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
open(dialogComponent,
|
|
236
|
+
/**
|
|
237
|
+
* Workaround when both conditions for the 'data' argument must be true:
|
|
238
|
+
* - typing did not require passing when it is optional (for example: {param: number} | void)
|
|
239
|
+
* - typing required to pass when it is required (for example: {param: number})
|
|
240
|
+
*/
|
|
241
|
+
...[data, configOrConfigName]) {
|
|
242
|
+
let config;
|
|
243
|
+
if (!configOrConfigName) {
|
|
244
|
+
config = {};
|
|
245
|
+
}
|
|
246
|
+
else if (typeof configOrConfigName === 'string') {
|
|
247
|
+
config = this.dialogConfig[configOrConfigName];
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
config = configOrConfigName;
|
|
251
|
+
}
|
|
252
|
+
return this.dialog.open(dialogComponent, {
|
|
253
|
+
data,
|
|
254
|
+
...dialogComponent.defaultDialogConfig,
|
|
255
|
+
...config,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DialogService, deps: [{ token: i1$2.MatDialog }, { token: DIALOG_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
259
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DialogService, providedIn: 'root' }); }
|
|
260
|
+
}
|
|
261
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DialogService, decorators: [{
|
|
262
|
+
type: Injectable,
|
|
263
|
+
args: [{
|
|
264
|
+
providedIn: 'root',
|
|
265
|
+
}]
|
|
266
|
+
}], ctorParameters: () => [{ type: i1$2.MatDialog }, { type: undefined, decorators: [{
|
|
267
|
+
type: Optional
|
|
268
|
+
}, {
|
|
269
|
+
type: Inject,
|
|
270
|
+
args: [DIALOG_CONFIG]
|
|
271
|
+
}] }] });
|
|
272
|
+
|
|
273
|
+
class DialogModule {
|
|
274
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
275
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: DialogModule, declarations: [DialogComponent, DialogActionsComponent], imports: [CommonModule,
|
|
276
|
+
MatDividerModule,
|
|
277
|
+
MatButtonModule,
|
|
278
|
+
ActionsModule,
|
|
279
|
+
MatIconModule,
|
|
280
|
+
MatProgressBarModule,
|
|
281
|
+
MatDialogModule,
|
|
282
|
+
ProgressModule], exports: [DialogComponent, DialogActionsComponent] }); }
|
|
283
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DialogModule, providers: [DialogService], imports: [CommonModule,
|
|
284
|
+
MatDividerModule,
|
|
285
|
+
MatButtonModule,
|
|
286
|
+
ActionsModule,
|
|
287
|
+
MatIconModule,
|
|
288
|
+
MatProgressBarModule,
|
|
289
|
+
MatDialogModule,
|
|
290
|
+
ProgressModule] }); }
|
|
291
|
+
}
|
|
292
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DialogModule, decorators: [{
|
|
293
|
+
type: NgModule,
|
|
294
|
+
args: [{
|
|
295
|
+
imports: [
|
|
296
|
+
CommonModule,
|
|
297
|
+
MatDividerModule,
|
|
298
|
+
MatButtonModule,
|
|
299
|
+
ActionsModule,
|
|
300
|
+
MatIconModule,
|
|
301
|
+
MatProgressBarModule,
|
|
302
|
+
MatDialogModule,
|
|
303
|
+
ProgressModule,
|
|
304
|
+
],
|
|
305
|
+
providers: [DialogService],
|
|
306
|
+
declarations: [DialogComponent, DialogActionsComponent],
|
|
307
|
+
exports: [DialogComponent, DialogActionsComponent],
|
|
308
|
+
}]
|
|
309
|
+
}] });
|
|
310
|
+
|
|
311
|
+
class DialogSuperclass {
|
|
312
|
+
constructor() {
|
|
313
|
+
this.dialogData = inject(MAT_DIALOG_DATA);
|
|
314
|
+
this.dialogRef = inject(MatDialogRef);
|
|
315
|
+
}
|
|
316
|
+
static { this.defaultDialogConfig = DEFAULT_DIALOG_CONFIG.medium; }
|
|
317
|
+
closeWithCancellation(data) {
|
|
318
|
+
this.dialogRef.close({
|
|
319
|
+
status: DialogResponseStatus.Cancelled,
|
|
320
|
+
data,
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
closeWithSuccess(data) {
|
|
324
|
+
this.dialogRef.close({
|
|
325
|
+
status: DialogResponseStatus.Success,
|
|
326
|
+
data,
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
closeWithError(data) {
|
|
330
|
+
this.dialogRef.close({
|
|
331
|
+
status: DialogResponseStatus.Error,
|
|
332
|
+
data,
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DialogSuperclass, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
336
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: DialogSuperclass, isStandalone: true, ngImport: i0 }); }
|
|
337
|
+
}
|
|
338
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DialogSuperclass, decorators: [{
|
|
339
|
+
type: Directive
|
|
340
|
+
}] });
|
|
341
|
+
|
|
342
|
+
class ContentLoadingComponent {
|
|
343
|
+
constructor() {
|
|
344
|
+
this.width = input(random(35, 80) + '%');
|
|
345
|
+
this.textSize = input(0, { transform: numberAttribute });
|
|
346
|
+
this.hiddenText = input();
|
|
347
|
+
}
|
|
348
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ContentLoadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
349
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: ContentLoadingComponent, isStandalone: true, selector: "v-content-loading", inputs: { width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, textSize: { classPropertyName: "textSize", publicName: "textSize", isSignal: true, isRequired: false, transformFunction: null }, hiddenText: { classPropertyName: "hiddenText", publicName: "hiddenText", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<span\n [ngClass]=\"{ 'content-loading__text': !!hiddenText() }\"\n [style.width]=\"hiddenText() || textSize() ? undefined : width()\"\n class=\"content-loading\"\n >{{ hiddenText() || ' '.repeat(textSize() || 1) }}</span\n>\n", styles: ["@keyframes content-loading-animation{0%{opacity:1}50%{opacity:.4}to{opacity:1}}.content-loading{color:transparent;display:inline-block;line-height:100%;background-color:#00000014;animation:content-loading-animation 1.5s ease-in-out infinite}.content-loading__text{color:inherit;background-color:transparent}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
350
|
+
}
|
|
351
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ContentLoadingComponent, decorators: [{
|
|
352
|
+
type: Component,
|
|
353
|
+
args: [{ selector: 'v-content-loading', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule], template: "<span\n [ngClass]=\"{ 'content-loading__text': !!hiddenText() }\"\n [style.width]=\"hiddenText() || textSize() ? undefined : width()\"\n class=\"content-loading\"\n >{{ hiddenText() || ' '.repeat(textSize() || 1) }}</span\n>\n", styles: ["@keyframes content-loading-animation{0%{opacity:1}50%{opacity:.4}to{opacity:1}}.content-loading{color:transparent;display:inline-block;line-height:100%;background-color:#00000014;animation:content-loading-animation 1.5s ease-in-out infinite}.content-loading__text{color:inherit;background-color:transparent}\n"] }]
|
|
354
|
+
}] });
|
|
355
|
+
|
|
356
|
+
function renderList(list, renderItem, isMore) {
|
|
357
|
+
return list.length ? (isMore ? '…' : list.map(renderItem).join(', ')) : '';
|
|
358
|
+
}
|
|
359
|
+
function isObject(v) {
|
|
360
|
+
return (typeof v === 'object' &&
|
|
361
|
+
!Array.isArray(v) &&
|
|
362
|
+
!(v instanceof Map) &&
|
|
363
|
+
!(v instanceof Set) &&
|
|
364
|
+
v !== null);
|
|
365
|
+
}
|
|
366
|
+
function inlineJson(value, maxReadableLever = 1, readableKeys = false, level = 0) {
|
|
367
|
+
const isRoot = (level = 0);
|
|
368
|
+
if (isPrimitive(value)) {
|
|
369
|
+
return String(value);
|
|
370
|
+
}
|
|
371
|
+
if (Array.isArray(value) || value instanceof Map || value instanceof Set) {
|
|
372
|
+
const content = renderList(Array.from(value), (v) => inlineJson(v, maxReadableLever, readableKeys, level + 1), level > maxReadableLever);
|
|
373
|
+
if (value instanceof Set) {
|
|
374
|
+
return `Set(${content})`;
|
|
375
|
+
}
|
|
376
|
+
if (value instanceof Map) {
|
|
377
|
+
return `Map(${content})`;
|
|
378
|
+
}
|
|
379
|
+
return isRoot && content ? content : `[${content}]`;
|
|
380
|
+
}
|
|
381
|
+
const entries = Array.from(Object.entries(value));
|
|
382
|
+
if (!entries.length) {
|
|
383
|
+
return '{}';
|
|
384
|
+
}
|
|
385
|
+
const content = renderList(entries, ([k, v]) => (readableKeys ? startCase(k) : k) +
|
|
386
|
+
(isObject(v) && Object.keys(v).length <= 1 ? '/' : ': ') +
|
|
387
|
+
inlineJson(v, maxReadableLever, readableKeys, level + 1), level > maxReadableLever);
|
|
388
|
+
if (isRoot || entries.length === 1) {
|
|
389
|
+
return content;
|
|
390
|
+
}
|
|
391
|
+
return `{${content}}`;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
const SEPARATORS = ',;';
|
|
395
|
+
function splitBySeparators(ids, separators = SEPARATORS) {
|
|
396
|
+
if (!ids) {
|
|
397
|
+
return [];
|
|
398
|
+
}
|
|
399
|
+
return ids
|
|
400
|
+
.split(new RegExp(`[${separators}\\s]`))
|
|
401
|
+
.map((id) => id.trim())
|
|
402
|
+
.filter(Boolean);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
function progressTo(subject$) {
|
|
406
|
+
const getSub = () => (isObservable(subject$) ? subject$ : subject$());
|
|
407
|
+
return (src$) => defer(() => {
|
|
408
|
+
getSub().next(getSub().getValue() + 1);
|
|
409
|
+
return src$.pipe(finalize(() => getSub().next(getSub().getValue() - 1)));
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
function getObservable(obsOrFn) {
|
|
414
|
+
return typeof obsOrFn === 'function' ? defer(obsOrFn) : obsOrFn;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
function inProgressFrom(progress, main, init = true) {
|
|
418
|
+
const progresses = (Array.isArray(progress) ? progress : [progress]).map((p) => getObservable(p));
|
|
419
|
+
return merge(combineLatest(progresses), main ? getObservable(main).pipe(mergeMap(() => EMPTY)) : EMPTY).pipe(map((ps) => ps.some((p) => !!p)),
|
|
420
|
+
// make async to bypass angular detect changes
|
|
421
|
+
delay(0), startWith(init), distinctUntilChanged(), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
function passError(handler, value) {
|
|
425
|
+
return (source) => source.pipe(catchError((err) => {
|
|
426
|
+
handler(err);
|
|
427
|
+
if (arguments.length >= 2) {
|
|
428
|
+
return of(value);
|
|
429
|
+
}
|
|
430
|
+
return EMPTY;
|
|
431
|
+
}));
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
function getProgressByCount(count, completedCount = Number.MIN_VALUE) {
|
|
435
|
+
return 1 - completedCount / count;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
function forkJoinToResult(sources, progress$, dataItems = [], concurrency = 4) {
|
|
439
|
+
let completed = 0;
|
|
440
|
+
if (progress$) {
|
|
441
|
+
progress$.next(getProgressByCount(sources.length));
|
|
442
|
+
}
|
|
443
|
+
return merge(...sources.map((source, index) => source.pipe(map((result) => ({
|
|
444
|
+
result,
|
|
445
|
+
hasError: false,
|
|
446
|
+
index,
|
|
447
|
+
data: dataItems[index],
|
|
448
|
+
})), catchError((error) => {
|
|
449
|
+
return of({
|
|
450
|
+
error,
|
|
451
|
+
hasError: true,
|
|
452
|
+
index,
|
|
453
|
+
data: dataItems[index],
|
|
454
|
+
});
|
|
455
|
+
}), finalize(() => {
|
|
456
|
+
completed += 1;
|
|
457
|
+
if (progress$) {
|
|
458
|
+
progress$.next(getProgressByCount(sources.length, completed));
|
|
459
|
+
}
|
|
460
|
+
}))), concurrency).pipe(scan((acc, value) => {
|
|
461
|
+
acc.push(value);
|
|
462
|
+
return acc;
|
|
463
|
+
}, []), takeLast(1), map((r) => r.sort((a, b) => a.index - b.index)));
|
|
464
|
+
}
|
|
465
|
+
function isResultsHasError(res) {
|
|
466
|
+
return res.some((r) => r.hasError);
|
|
467
|
+
}
|
|
468
|
+
function splitResultsErrors(res) {
|
|
469
|
+
return res.reduce((acc, r) => {
|
|
470
|
+
acc[r.hasError ? 1 : 0].push(r);
|
|
471
|
+
return acc;
|
|
472
|
+
}, [[], []]);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
function isAsync(value) {
|
|
476
|
+
return isObservable(value) || isPromise(value);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
function getPossiblyAsyncObservable(possiblyAsync) {
|
|
480
|
+
return isAsync(possiblyAsync) ? from(possiblyAsync) : of(possiblyAsync);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
class AsyncTransform {
|
|
484
|
+
constructor() {
|
|
485
|
+
this.params$ = defer(() => this.args$).pipe(switchMap((args) => combineLatest([
|
|
486
|
+
getPossiblyAsyncObservable(args[0]),
|
|
487
|
+
of(args.slice(1)),
|
|
488
|
+
])), map(([value, params]) => [value, ...params]));
|
|
489
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
490
|
+
this.args$ = new ReplaySubject(1);
|
|
491
|
+
this.asyncPipe = new AsyncPipe(this.cdr);
|
|
492
|
+
}
|
|
493
|
+
ngOnDestroy() {
|
|
494
|
+
this.asyncPipe.ngOnDestroy();
|
|
495
|
+
}
|
|
496
|
+
asyncTransform(args) {
|
|
497
|
+
this.args$.next(args);
|
|
498
|
+
return this.asyncPipe.transform(this.result$);
|
|
499
|
+
}
|
|
500
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: AsyncTransform, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
501
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: AsyncTransform }); }
|
|
502
|
+
}
|
|
503
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: AsyncTransform, decorators: [{
|
|
504
|
+
type: Injectable
|
|
505
|
+
}], ctorParameters: () => [] });
|
|
506
|
+
|
|
507
|
+
function switchCombineWith(project) {
|
|
508
|
+
return (src$) => src$.pipe(switchMap((value, index) => {
|
|
509
|
+
const res = project(value, index);
|
|
510
|
+
return combineLatest([
|
|
511
|
+
of(value),
|
|
512
|
+
...(Array.isArray(res) ? res : [res]).map((r) => getPossiblyAsyncObservable(r)),
|
|
513
|
+
]);
|
|
514
|
+
}));
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
function debounceTimeWithFirst(duration) {
|
|
518
|
+
return (source) => {
|
|
519
|
+
let isFirst = true;
|
|
520
|
+
return source.pipe(debounce(() => {
|
|
521
|
+
if (isFirst) {
|
|
522
|
+
isFirst = false;
|
|
523
|
+
return interval(0);
|
|
524
|
+
}
|
|
525
|
+
return interval(duration);
|
|
526
|
+
}));
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
function handleError(handler, result = EMPTY) {
|
|
531
|
+
return (source) => source.pipe(catchError$1((err, _caught) => {
|
|
532
|
+
handler(err);
|
|
533
|
+
return getPossiblyAsyncObservable(result);
|
|
534
|
+
}));
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
function asyncStartWith(value, timerMs = 0) {
|
|
538
|
+
return (src$) => concat(...(value ? [of(value)] : []), timer(timerMs).pipe(switchMap(() => src$)));
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
function hasControls(control) {
|
|
542
|
+
return 'controls' in control;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
function getValue$1(control) {
|
|
546
|
+
if (!hasControls(control)) {
|
|
547
|
+
return control.value;
|
|
548
|
+
}
|
|
549
|
+
if (Array.isArray(control.controls)) {
|
|
550
|
+
const result = [];
|
|
551
|
+
for (const v of control.controls) {
|
|
552
|
+
result.push(getValue$1(v));
|
|
553
|
+
}
|
|
554
|
+
return result;
|
|
555
|
+
}
|
|
556
|
+
const result = {};
|
|
557
|
+
for (const [k, v] of Object.entries(control.controls)) {
|
|
558
|
+
result[k] = getValue$1(v);
|
|
559
|
+
}
|
|
560
|
+
return result;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
function getValueChanges(form) {
|
|
564
|
+
return form.valueChanges.pipe(startWith(form.value), map(() => getValue$1(form)));
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* FormGroup/FormArray don't return internal control errors,
|
|
569
|
+
* so you need to get internal errors manually
|
|
570
|
+
*/
|
|
571
|
+
function getErrorsTree(control) {
|
|
572
|
+
if (control.valid) {
|
|
573
|
+
return null;
|
|
574
|
+
}
|
|
575
|
+
const errors = Object.assign({}, control.errors);
|
|
576
|
+
if (hasControls(control)) {
|
|
577
|
+
if (Array.isArray(control.controls)) {
|
|
578
|
+
errors['formArrayErrors'] = control.controls
|
|
579
|
+
.map((c) => getErrorsTree(c))
|
|
580
|
+
.filter(Boolean);
|
|
581
|
+
}
|
|
582
|
+
else {
|
|
583
|
+
errors['formGroupErrors'] = Object.fromEntries(Array.from(Object.entries(control.controls))
|
|
584
|
+
.map(([k, c]) => [k, getErrorsTree(c)])
|
|
585
|
+
.filter(([, v]) => !!v));
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
return errors;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
class AbstractControlSuperclass extends WrappedControlSuperclass {
|
|
592
|
+
constructor() {
|
|
593
|
+
super(...arguments);
|
|
594
|
+
this._cdr = inject(ChangeDetectorRef);
|
|
595
|
+
this._destroyRef = inject(DestroyRef);
|
|
596
|
+
this.onValidatorChange = () => undefined;
|
|
597
|
+
}
|
|
598
|
+
ngOnInit() {
|
|
599
|
+
super.ngOnInit();
|
|
600
|
+
concat(timer(0), timer(100))
|
|
601
|
+
.pipe(filter(() => this.control.invalid), take(1), takeUntilDestroyed(this._destroyRef))
|
|
602
|
+
.subscribe(() => {
|
|
603
|
+
this.onValidatorChange();
|
|
604
|
+
this._cdr.markForCheck();
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
validate(_control) {
|
|
608
|
+
return getErrorsTree(this.control); //|| getErrorsTree(_control);
|
|
609
|
+
}
|
|
610
|
+
registerOnValidatorChange(fn) {
|
|
611
|
+
this.onValidatorChange = fn;
|
|
612
|
+
}
|
|
613
|
+
setUpInnerToOuterErrors$() {
|
|
614
|
+
return EMPTY;
|
|
615
|
+
}
|
|
616
|
+
setUpOuterToInnerErrors$() {
|
|
617
|
+
return EMPTY;
|
|
618
|
+
}
|
|
619
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: AbstractControlSuperclass, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
620
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: AbstractControlSuperclass, isStandalone: true, usesInheritance: true, ngImport: i0 }); }
|
|
621
|
+
}
|
|
622
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: AbstractControlSuperclass, decorators: [{
|
|
623
|
+
type: Directive
|
|
624
|
+
}] });
|
|
625
|
+
|
|
626
|
+
class FormGroupSuperclass extends AbstractControlSuperclass {
|
|
627
|
+
setDisabledState(_isDisabled) {
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
ngOnInit() {
|
|
631
|
+
this.emptyValue = getValue$1(this.control);
|
|
632
|
+
super.ngOnInit();
|
|
633
|
+
}
|
|
634
|
+
outerToInnerValue(outer) {
|
|
635
|
+
if (hasControls(this.control)) {
|
|
636
|
+
if (!outer) {
|
|
637
|
+
return this.emptyValue;
|
|
638
|
+
}
|
|
639
|
+
if (Object.keys(outer).length < Object.keys(this.control.controls).length) {
|
|
640
|
+
return Object.assign({}, this.emptyValue, outer);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
return outer;
|
|
644
|
+
}
|
|
645
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FormGroupSuperclass, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
646
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: FormGroupSuperclass, isStandalone: true, usesInheritance: true, ngImport: i0 }); }
|
|
647
|
+
}
|
|
648
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FormGroupSuperclass, decorators: [{
|
|
649
|
+
type: Directive
|
|
650
|
+
}] });
|
|
651
|
+
|
|
652
|
+
const provideValidators = (component) => ({
|
|
653
|
+
provide: NG_VALIDATORS,
|
|
654
|
+
useExisting: forwardRef(component),
|
|
655
|
+
multi: true,
|
|
656
|
+
});
|
|
657
|
+
|
|
658
|
+
const provideValueAccessor = (component) => ({
|
|
659
|
+
provide: NG_VALUE_ACCESSOR,
|
|
660
|
+
useExisting: forwardRef(component),
|
|
661
|
+
multi: true,
|
|
662
|
+
});
|
|
663
|
+
|
|
664
|
+
const createControlProviders = (component) => [
|
|
665
|
+
provideValueAccessor(component),
|
|
666
|
+
provideValidators(component),
|
|
667
|
+
];
|
|
668
|
+
|
|
669
|
+
class FormControlSuperclass extends AbstractControlSuperclass {
|
|
670
|
+
constructor() {
|
|
671
|
+
super(...arguments);
|
|
672
|
+
this.control = new FormControl();
|
|
673
|
+
}
|
|
674
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FormControlSuperclass, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
675
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: FormControlSuperclass, isStandalone: true, usesInheritance: true, ngImport: i0 }); }
|
|
676
|
+
}
|
|
677
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FormControlSuperclass, decorators: [{
|
|
678
|
+
type: Directive
|
|
679
|
+
}] });
|
|
680
|
+
|
|
681
|
+
class FormComponentSuperclass extends FormComponentSuperclass$1 {
|
|
682
|
+
constructor() {
|
|
683
|
+
super(...arguments);
|
|
684
|
+
this._cdr = inject(ChangeDetectorRef);
|
|
685
|
+
this._destroyRef = inject(DestroyRef);
|
|
686
|
+
this.onValidatorChange = () => undefined;
|
|
687
|
+
}
|
|
688
|
+
validate(_control) {
|
|
689
|
+
return null;
|
|
690
|
+
}
|
|
691
|
+
ngOnInit() {
|
|
692
|
+
concat(timer(0), timer(100))
|
|
693
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
694
|
+
.subscribe(() => {
|
|
695
|
+
this.onValidatorChange();
|
|
696
|
+
this._cdr.markForCheck();
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
registerOnValidatorChange(fn) {
|
|
700
|
+
this.onValidatorChange = fn;
|
|
701
|
+
}
|
|
702
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FormComponentSuperclass, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
703
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: FormComponentSuperclass, isStandalone: true, usesInheritance: true, ngImport: i0 }); }
|
|
704
|
+
}
|
|
705
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FormComponentSuperclass, decorators: [{
|
|
706
|
+
type: Directive
|
|
707
|
+
}] });
|
|
708
|
+
|
|
709
|
+
function isEmptyPrimitive(value) {
|
|
710
|
+
return isNil(value) || value === '';
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
function getValidValueChanges(control, predicate = isEmptyPrimitive) {
|
|
714
|
+
return getValueChanges(control).pipe(filter(() => control.valid), map((value) => omitBy(value, predicate)));
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
function setDisabled(control, disabled = true, options = {}) {
|
|
718
|
+
if (!control || control.disabled === disabled) {
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
if (disabled) {
|
|
722
|
+
control.disable(options);
|
|
723
|
+
}
|
|
724
|
+
else {
|
|
725
|
+
control.enable(options);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
function createControls(values) {
|
|
730
|
+
return Object.fromEntries(Object.entries(values).map(([k, v]) => [k, new FormControl(v, { nonNullable: true })]));
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
function getTimeZoneOffset(date) {
|
|
734
|
+
return date.getTimezoneOffset() * 60_000;
|
|
735
|
+
}
|
|
736
|
+
function getNoTimeZoneIsoString(date) {
|
|
737
|
+
return date ? new Date(date.valueOf() - getTimeZoneOffset(date)).toISOString() : '';
|
|
738
|
+
}
|
|
739
|
+
function createDateFromNoTimeZoneString(dateStr) {
|
|
740
|
+
const date = new Date(dateStr);
|
|
741
|
+
return new Date(date.valueOf() + getTimeZoneOffset(date));
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
const getCurrencyExponent = (currencyCode) => currencies[currencyCode]?.exponent;
|
|
745
|
+
|
|
746
|
+
const toMajorByExponent = (amount, exponent) => round(amount / 10 ** exponent, exponent);
|
|
747
|
+
const toMajor = (amount, currencyCode) => toMajorByExponent(amount, getCurrencyExponent(currencyCode));
|
|
748
|
+
|
|
749
|
+
const toMinorByExponent = (amount, exponent) => Math.round(amount * 10 ** exponent);
|
|
750
|
+
const toMinor = (amount, currencyCode) => toMinorByExponent(amount, getCurrencyExponent(currencyCode));
|
|
751
|
+
|
|
752
|
+
function formatCurrency(amount, currencyCode = 'USD', format = 'long', locale = 'en-GB', exponent, isMajor = false) {
|
|
753
|
+
if (typeof exponent !== 'number') {
|
|
754
|
+
exponent = getCurrencyExponent(currencyCode) || 0;
|
|
755
|
+
}
|
|
756
|
+
return formatCurrency$1(isMajor ? amount : toMajorByExponent(amount, exponent), locale, getCurrencySymbol(currencyCode, 'narrow', locale), currencyCode, format === 'short' ? `1.0-${exponent}` : `1.${exponent}-${exponent}`);
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
function select(obj, selectFn, defaultValue, restParams = []) {
|
|
760
|
+
if (typeof selectFn === 'string') {
|
|
761
|
+
return get(obj, selectFn, defaultValue);
|
|
762
|
+
}
|
|
763
|
+
return selectFn(obj, ...restParams);
|
|
764
|
+
}
|
|
765
|
+
// export function selectAsObservable<TObject extends object, TResult, TParams extends Array<unknown> = []>(
|
|
766
|
+
// obj: TObject,
|
|
767
|
+
// selectFn: SelectFn<TObject, TResult, TParams>,
|
|
768
|
+
// defaultValue?: TResult,
|
|
769
|
+
// restParams: TParams[] = [],
|
|
770
|
+
// ): TResult | Observable<TResult> {
|
|
771
|
+
// const res = select(obj, selectFn, defaultValue, restParams);
|
|
772
|
+
// return isObservable(res) ? res : of(res);
|
|
773
|
+
// }
|
|
774
|
+
|
|
775
|
+
function countProps(...objects) {
|
|
776
|
+
return objects.reduce((acc, obj) => acc + (obj ? Object.keys(obj).length : 0), 0);
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
function isEmpty(value) {
|
|
780
|
+
return isObject$1(value)
|
|
781
|
+
? value.constructor === Object ||
|
|
782
|
+
Array.isArray(value) ||
|
|
783
|
+
value instanceof Set ||
|
|
784
|
+
value instanceof Map
|
|
785
|
+
? lodashIsEmpty(value)
|
|
786
|
+
: false
|
|
787
|
+
: isEmptyPrimitive(value);
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
function countChanged(a, b,
|
|
791
|
+
// is equal boolean or count number
|
|
792
|
+
predicates = {}) {
|
|
793
|
+
const aKeys = Object.keys(a);
|
|
794
|
+
const bKeys = Object.keys(b);
|
|
795
|
+
const diffKeys = difference(aKeys, bKeys);
|
|
796
|
+
const sameKeys = difference(aKeys, diffKeys);
|
|
797
|
+
return sameKeys
|
|
798
|
+
.map((k) => {
|
|
799
|
+
if (k in predicates) {
|
|
800
|
+
const res = predicates[k]?.(a[k], b[k]);
|
|
801
|
+
return typeof res === 'boolean' ? +!res : Number(res);
|
|
802
|
+
}
|
|
803
|
+
return (isEmpty(a[k]) && isEmpty(b[k])) || isEqual(a[k], b[k]) ? 0 : 1;
|
|
804
|
+
})
|
|
805
|
+
.reduce((sum, v) => sum + v, diffKeys.length);
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
function getEnumEntries(srcEnum) {
|
|
809
|
+
if (!srcEnum) {
|
|
810
|
+
return [];
|
|
811
|
+
}
|
|
812
|
+
const entries = Object.entries(srcEnum);
|
|
813
|
+
if (!entries.length) {
|
|
814
|
+
return [];
|
|
815
|
+
}
|
|
816
|
+
const isValueNumberEnum = entries.some(([, v]) => typeof v === 'number');
|
|
817
|
+
if (isValueNumberEnum) {
|
|
818
|
+
return entries.filter(([, v]) => typeof v === 'number');
|
|
819
|
+
}
|
|
820
|
+
return entries;
|
|
821
|
+
}
|
|
822
|
+
function getEnumKeyValues(srcEnum) {
|
|
823
|
+
return getEnumEntries(srcEnum).map(([key, value]) => ({ key, value }));
|
|
824
|
+
}
|
|
825
|
+
function getEnumKeys(srcEnum) {
|
|
826
|
+
return getEnumEntries(srcEnum).map(([k]) => k);
|
|
827
|
+
}
|
|
828
|
+
function getEnumValues(srcEnum) {
|
|
829
|
+
return getEnumEntries(srcEnum).map(([, v]) => v);
|
|
830
|
+
}
|
|
831
|
+
function getEnumKey(srcEnum, value) {
|
|
832
|
+
return getEnumKeyValues(srcEnum).find((e) => String(e.value) === String(value))?.key;
|
|
833
|
+
}
|
|
834
|
+
function enumHasValue(srcEnum, value) {
|
|
835
|
+
return getEnumValues(srcEnum).includes(value);
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
function clean(obj, allowRootRemoval = false, isNotDeep = false, filterPredicate = (v) => !isEmpty(v)) {
|
|
839
|
+
if (allowRootRemoval && !filterPredicate(obj)) {
|
|
840
|
+
return null;
|
|
841
|
+
}
|
|
842
|
+
const cleanChild = (v) => isNotDeep ? v : clean(v, true, isNotDeep, filterPredicate);
|
|
843
|
+
if (Array.isArray(obj)) {
|
|
844
|
+
return obj
|
|
845
|
+
.map((v) => cleanChild(v))
|
|
846
|
+
.filter((v, idx) => filterPredicate(v, idx));
|
|
847
|
+
}
|
|
848
|
+
if (obj?.constructor === Object) {
|
|
849
|
+
return Object.fromEntries(Object.entries(obj)
|
|
850
|
+
.map(([k, v]) => [k, cleanChild(v)])
|
|
851
|
+
.filter(([k, v]) => filterPredicate(v, k)));
|
|
852
|
+
}
|
|
853
|
+
return obj;
|
|
854
|
+
}
|
|
855
|
+
function cleanPrimitiveProps(obj, allowRootRemoval = false, isNotDeep = false) {
|
|
856
|
+
return clean(obj, allowRootRemoval, isNotDeep, (v) => !isEmptyPrimitive(v));
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
function isNumber(v) {
|
|
860
|
+
return !!v && (typeof v === 'number' || /^-?\d+.*$/.test(String(v).trim()));
|
|
861
|
+
}
|
|
862
|
+
function toNumber(v) {
|
|
863
|
+
return typeof v === 'string'
|
|
864
|
+
? parseFloat(v.replace(',', '.').replace(/[^0-9.-]+/g, ''))
|
|
865
|
+
: Number(v);
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* Use with sorting (arr.sort(fn))
|
|
869
|
+
*/
|
|
870
|
+
function compareDifferentTypes(a, b) {
|
|
871
|
+
const aIsNum = isNumber(a);
|
|
872
|
+
const bIsNum = isNumber(b);
|
|
873
|
+
if (aIsNum || bIsNum) {
|
|
874
|
+
if (aIsNum && bIsNum) {
|
|
875
|
+
return toNumber(a) - toNumber(b);
|
|
876
|
+
}
|
|
877
|
+
else if (aIsNum) {
|
|
878
|
+
return -1;
|
|
879
|
+
}
|
|
880
|
+
else {
|
|
881
|
+
return 1;
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
return String(a).localeCompare(String(b));
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
function getImportValue(imp, prop = 'default') {
|
|
888
|
+
return from(imp).pipe(map((module) => {
|
|
889
|
+
if (!prop) {
|
|
890
|
+
return module;
|
|
891
|
+
}
|
|
892
|
+
return get(module, prop, null);
|
|
893
|
+
}));
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
const FILE_TYPES = {
|
|
897
|
+
csv: {
|
|
898
|
+
type: 'text/csv',
|
|
899
|
+
format: 'csv',
|
|
900
|
+
},
|
|
901
|
+
};
|
|
902
|
+
function downloadFile(data, type, filename = 'data') {
|
|
903
|
+
const blob = new Blob([data], { type: FILE_TYPES[type].type });
|
|
904
|
+
const url = window.URL.createObjectURL(blob);
|
|
905
|
+
const a = document.createElement('a');
|
|
906
|
+
a.href = url;
|
|
907
|
+
a.download = `${filename}.${FILE_TYPES[type].format}`;
|
|
908
|
+
document.body.appendChild(a);
|
|
909
|
+
a.click();
|
|
910
|
+
document.body.removeChild(a);
|
|
911
|
+
window.URL.revokeObjectURL(url);
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
function createCsv(data) {
|
|
915
|
+
return papaparse.unparse(data);
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
function arrayAttribute(value) {
|
|
919
|
+
if (!Array.isArray(value)) {
|
|
920
|
+
return [];
|
|
921
|
+
}
|
|
922
|
+
return value;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
function DebounceTime(ms = 500) {
|
|
926
|
+
return function (target, propertyKey, descriptor) {
|
|
927
|
+
let timer = null;
|
|
928
|
+
const method = descriptor.value;
|
|
929
|
+
descriptor.value = function () {
|
|
930
|
+
if (timer !== null) {
|
|
931
|
+
window.clearTimeout(timer);
|
|
932
|
+
}
|
|
933
|
+
timer = window.setTimeout(() => {
|
|
934
|
+
// eslint-disable-next-line prefer-rest-params
|
|
935
|
+
method.apply(this, arguments);
|
|
936
|
+
timer = null;
|
|
937
|
+
}, ms);
|
|
938
|
+
};
|
|
939
|
+
};
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
class InputFieldComponent extends FormControlSuperclass {
|
|
943
|
+
constructor() {
|
|
944
|
+
super(...arguments);
|
|
945
|
+
this.placeholder = '';
|
|
946
|
+
this.type = 'string';
|
|
947
|
+
this.appearance = 'fill';
|
|
948
|
+
this.cleanButton = input(false, { transform: booleanAttribute });
|
|
949
|
+
this.icon = input();
|
|
950
|
+
}
|
|
951
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: InputFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
952
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: InputFieldComponent, isStandalone: false, selector: "v-input-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: false, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: false, isRequired: false, transformFunction: null }, cleanButton: { classPropertyName: "cleanButton", publicName: "cleanButton", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null } }, providers: createControlProviders(() => InputFieldComponent), usesInheritance: true, ngImport: i0, template: "<mat-form-field\n [appearance]=\"appearance\"\n [ngClass]=\"{\n 'v-input-field__small': size === 'small',\n 'v-input-field__outline': appearance === 'outline',\n }\"\n class=\"v-input-field\"\n>\n @if (icon()) {\n <div class=\"prefix\" matPrefix>\n <mat-icon>{{ icon() }}</mat-icon>\n </div>\n }\n <mat-label>{{ label }}</mat-label>\n <input\n [formControl]=\"control\"\n [placeholder]=\"placeholder\"\n [type]=\"type\"\n autocomplete=\"false\"\n matInput\n />\n <div class=\"postfix\" matSuffix>\n @if (cleanButton()) {\n <button\n [disabled]=\"!control.value\"\n [style.visibility]=\"control.value ? '' : 'hidden'\"\n mat-icon-button\n (click)=\"control.reset()\"\n >\n <mat-icon>clear</mat-icon>\n </button>\n }\n </div>\n</mat-form-field>\n", styles: [".v-input-field .postfix{white-space:nowrap}.v-input-field__small ::ng-deep .mat-icon{transform:scale(.75)!important}.v-input-field__outline .postfix{padding-right:4px}.v-input-field__outline .prefix{padding-left:4px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i1$4.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }] }); }
|
|
953
|
+
}
|
|
954
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: InputFieldComponent, decorators: [{
|
|
955
|
+
type: Component,
|
|
956
|
+
args: [{ selector: 'v-input-field', providers: createControlProviders(() => InputFieldComponent), standalone: false, template: "<mat-form-field\n [appearance]=\"appearance\"\n [ngClass]=\"{\n 'v-input-field__small': size === 'small',\n 'v-input-field__outline': appearance === 'outline',\n }\"\n class=\"v-input-field\"\n>\n @if (icon()) {\n <div class=\"prefix\" matPrefix>\n <mat-icon>{{ icon() }}</mat-icon>\n </div>\n }\n <mat-label>{{ label }}</mat-label>\n <input\n [formControl]=\"control\"\n [placeholder]=\"placeholder\"\n [type]=\"type\"\n autocomplete=\"false\"\n matInput\n />\n <div class=\"postfix\" matSuffix>\n @if (cleanButton()) {\n <button\n [disabled]=\"!control.value\"\n [style.visibility]=\"control.value ? '' : 'hidden'\"\n mat-icon-button\n (click)=\"control.reset()\"\n >\n <mat-icon>clear</mat-icon>\n </button>\n }\n </div>\n</mat-form-field>\n", styles: [".v-input-field .postfix{white-space:nowrap}.v-input-field__small ::ng-deep .mat-icon{transform:scale(.75)!important}.v-input-field__outline .postfix{padding-right:4px}.v-input-field__outline .prefix{padding-left:4px}\n"] }]
|
|
957
|
+
}], propDecorators: { label: [{
|
|
958
|
+
type: Input
|
|
959
|
+
}], placeholder: [{
|
|
960
|
+
type: Input
|
|
961
|
+
}], type: [{
|
|
962
|
+
type: Input
|
|
963
|
+
}], appearance: [{
|
|
964
|
+
type: Input
|
|
965
|
+
}], size: [{
|
|
966
|
+
type: Input
|
|
967
|
+
}] } });
|
|
968
|
+
|
|
969
|
+
class InputFieldModule {
|
|
970
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: InputFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
971
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: InputFieldModule, declarations: [InputFieldComponent], imports: [CommonModule, MatInputModule, ReactiveFormsModule, MatIcon, MatIconButton], exports: [InputFieldComponent] }); }
|
|
972
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: InputFieldModule, imports: [CommonModule, MatInputModule, ReactiveFormsModule, MatIcon, MatIconButton] }); }
|
|
973
|
+
}
|
|
974
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: InputFieldModule, decorators: [{
|
|
975
|
+
type: NgModule,
|
|
976
|
+
args: [{
|
|
977
|
+
declarations: [InputFieldComponent],
|
|
978
|
+
exports: [InputFieldComponent],
|
|
979
|
+
imports: [CommonModule, MatInputModule, ReactiveFormsModule, MatIcon, MatIconButton],
|
|
980
|
+
}]
|
|
981
|
+
}] });
|
|
982
|
+
|
|
983
|
+
class TagComponent {
|
|
984
|
+
constructor() {
|
|
985
|
+
this.hostClass = true;
|
|
986
|
+
this.icon = input();
|
|
987
|
+
this.progress = input(false, { transform: booleanAttribute });
|
|
988
|
+
}
|
|
989
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
990
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: TagComponent, isStandalone: false, selector: "v-tag", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: false, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.v-tag": "this.hostClass" } }, ngImport: i0, template: "<mat-chip-row\n [disabled]=\"progress()\"\n [ngClass]=\"{ loading: progress(), action: !!icon() }\"\n class=\"tag {{ 'color-' + color }}\"\n disableRipple\n>\n @if (icon()) {\n <button matChipRemove>\n <mat-icon>{{ progress() ? 'autorenew' : icon() }}</mat-icon>\n </button>\n }\n <ng-content></ng-content>\n</mat-chip-row>\n", styles: [":host ::ng-deep{pointer-events:none}:host .action ::ng-deep{pointer-events:auto;cursor:pointer}:host .action ::ng-deep button{pointer-events:none}:host ::ng-deep *:before{border:none!important}@keyframes content-loading-animation{0%{opacity:1}50%{opacity:.5}to{opacity:1}}.tag{transition:all .3s ease-in-out}.loading{animation:content-loading-animation 1.5s ease-in-out infinite}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$3.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i2$3.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
991
|
+
}
|
|
992
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TagComponent, decorators: [{
|
|
993
|
+
type: Component,
|
|
994
|
+
args: [{ selector: 'v-tag', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<mat-chip-row\n [disabled]=\"progress()\"\n [ngClass]=\"{ loading: progress(), action: !!icon() }\"\n class=\"tag {{ 'color-' + color }}\"\n disableRipple\n>\n @if (icon()) {\n <button matChipRemove>\n <mat-icon>{{ progress() ? 'autorenew' : icon() }}</mat-icon>\n </button>\n }\n <ng-content></ng-content>\n</mat-chip-row>\n", styles: [":host ::ng-deep{pointer-events:none}:host .action ::ng-deep{pointer-events:auto;cursor:pointer}:host .action ::ng-deep button{pointer-events:none}:host ::ng-deep *:before{border:none!important}@keyframes content-loading-animation{0%{opacity:1}50%{opacity:.5}to{opacity:1}}.tag{transition:all .3s ease-in-out}.loading{animation:content-loading-animation 1.5s ease-in-out infinite}\n"] }]
|
|
995
|
+
}], propDecorators: { hostClass: [{
|
|
996
|
+
type: HostBinding,
|
|
997
|
+
args: ['class.v-tag']
|
|
998
|
+
}], color: [{
|
|
999
|
+
type: Input
|
|
1000
|
+
}] } });
|
|
1001
|
+
|
|
1002
|
+
class TagModule {
|
|
1003
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TagModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1004
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: TagModule, declarations: [TagComponent], imports: [CommonModule, MatChipsModule, MatIconModule], exports: [TagComponent] }); }
|
|
1005
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TagModule, imports: [CommonModule, MatChipsModule, MatIconModule] }); }
|
|
1006
|
+
}
|
|
1007
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TagModule, decorators: [{
|
|
1008
|
+
type: NgModule,
|
|
1009
|
+
args: [{
|
|
1010
|
+
declarations: [TagComponent],
|
|
1011
|
+
imports: [CommonModule, MatChipsModule, MatIconModule],
|
|
1012
|
+
exports: [TagComponent],
|
|
1013
|
+
}]
|
|
1014
|
+
}] });
|
|
1015
|
+
|
|
1016
|
+
const SPACES = /[\s\u00A0]/g;
|
|
1017
|
+
function normalizeString(str) {
|
|
1018
|
+
return (str || '').replace(SPACES, ' ');
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
class HighlightDirective {
|
|
1022
|
+
constructor(el, renderer, dr, injector) {
|
|
1023
|
+
this.el = el;
|
|
1024
|
+
this.renderer = renderer;
|
|
1025
|
+
this.dr = dr;
|
|
1026
|
+
this.injector = injector;
|
|
1027
|
+
this.vHighlightText = input('', { transform: (v) => String(v || '') });
|
|
1028
|
+
this.vHighlightSearch = input('', { transform: (v) => String(v || '') });
|
|
1029
|
+
}
|
|
1030
|
+
ngOnInit() {
|
|
1031
|
+
combineLatest([
|
|
1032
|
+
toObservable(this.vHighlightText, { injector: this.injector }).pipe(distinctUntilChanged(), map((text) => this.escapeHtml(text))),
|
|
1033
|
+
toObservable(this.vHighlightSearch, { injector: this.injector }).pipe(distinctUntilChanged(), map((text) => this.escapeHtml(text))),
|
|
1034
|
+
])
|
|
1035
|
+
.pipe(map(([text, search]) => {
|
|
1036
|
+
if (!search) {
|
|
1037
|
+
return text;
|
|
1038
|
+
}
|
|
1039
|
+
const re = new RegExp(`(${search.replace(SPACES, '\\s')})`, 'gi');
|
|
1040
|
+
return text.replace(re, `<mark>$1</mark>`);
|
|
1041
|
+
}), distinctUntilChanged(), takeUntilDestroyed(this.dr))
|
|
1042
|
+
.subscribe((text) => {
|
|
1043
|
+
this.renderer.setProperty(this.el.nativeElement, 'innerHTML', text);
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
escapeHtml(html) {
|
|
1047
|
+
return html
|
|
1048
|
+
.replace(/&/g, '&')
|
|
1049
|
+
.replace(/</g, '<')
|
|
1050
|
+
.replace(/>/g, '>')
|
|
1051
|
+
.replace(/"/g, '"')
|
|
1052
|
+
.replace(/'/g, ''');
|
|
1053
|
+
}
|
|
1054
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: HighlightDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.DestroyRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1055
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.6", type: HighlightDirective, isStandalone: true, selector: "[vHighlight]", inputs: { vHighlightText: { classPropertyName: "vHighlightText", publicName: "vHighlightText", isSignal: true, isRequired: false, transformFunction: null }, vHighlightSearch: { classPropertyName: "vHighlightSearch", publicName: "vHighlightSearch", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
1056
|
+
}
|
|
1057
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: HighlightDirective, decorators: [{
|
|
1058
|
+
type: Directive,
|
|
1059
|
+
args: [{
|
|
1060
|
+
standalone: true,
|
|
1061
|
+
selector: '[vHighlight]',
|
|
1062
|
+
}]
|
|
1063
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.DestroyRef }, { type: i0.Injector }] });
|
|
1064
|
+
|
|
1065
|
+
class MenuValueComponent {
|
|
1066
|
+
constructor() {
|
|
1067
|
+
this.value = input.required();
|
|
1068
|
+
}
|
|
1069
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: MenuValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1070
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: MenuValueComponent, isStandalone: true, selector: "v-menu-value", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: ` @if (value(); as v) {
|
|
1071
|
+
<button [matMenuTriggerFor]="menu" class="button" mat-icon-button>
|
|
1072
|
+
<mat-icon>more_vert</mat-icon>
|
|
1073
|
+
</button>
|
|
1074
|
+
<mat-menu #menu="matMenu">
|
|
1075
|
+
@for (item of v.params.items; track item; let index = $index) {
|
|
1076
|
+
<button [disabled]="!!item?.disabled" mat-menu-item (click)="item?.click?.($event)">
|
|
1077
|
+
{{ item.label }}
|
|
1078
|
+
</button>
|
|
1079
|
+
}
|
|
1080
|
+
</mat-menu>
|
|
1081
|
+
}`, isInline: true, styles: [""], dependencies: [{ kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }] }); }
|
|
1082
|
+
}
|
|
1083
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: MenuValueComponent, decorators: [{
|
|
1084
|
+
type: Component,
|
|
1085
|
+
args: [{ selector: 'v-menu-value', imports: [MatIcon, MatIconButton, MatMenu, MatMenuItem, MatMenuTrigger], template: ` @if (value(); as v) {
|
|
1086
|
+
<button [matMenuTriggerFor]="menu" class="button" mat-icon-button>
|
|
1087
|
+
<mat-icon>more_vert</mat-icon>
|
|
1088
|
+
</button>
|
|
1089
|
+
<mat-menu #menu="matMenu">
|
|
1090
|
+
@for (item of v.params.items; track item; let index = $index) {
|
|
1091
|
+
<button [disabled]="!!item?.disabled" mat-menu-item (click)="item?.click?.($event)">
|
|
1092
|
+
{{ item.label }}
|
|
1093
|
+
</button>
|
|
1094
|
+
}
|
|
1095
|
+
</mat-menu>
|
|
1096
|
+
}` }]
|
|
1097
|
+
}] });
|
|
1098
|
+
|
|
1099
|
+
function currencyAmountValueToString(value) {
|
|
1100
|
+
if (typeof value?.value !== 'number') {
|
|
1101
|
+
return '';
|
|
1102
|
+
}
|
|
1103
|
+
const locale = inject(LOCALE_ID);
|
|
1104
|
+
return formatCurrency(value.value, value.params.code, 'long', locale, value.params.exponent, !!value.params.major);
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
function datetimeValueToString(value) {
|
|
1108
|
+
if (!value?.value) {
|
|
1109
|
+
return '';
|
|
1110
|
+
}
|
|
1111
|
+
const locale = inject(LOCALE_ID);
|
|
1112
|
+
return formatDate(value.value, 'dd.MM.yyyy HH:mm:ss', locale, '+0000');
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
function unknownToString(value) {
|
|
1116
|
+
if (isNil(value)) {
|
|
1117
|
+
return '';
|
|
1118
|
+
}
|
|
1119
|
+
return String(value);
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
function valueToString(value) {
|
|
1123
|
+
switch (value?.type) {
|
|
1124
|
+
case 'currency':
|
|
1125
|
+
return currencyAmountValueToString(value);
|
|
1126
|
+
case 'datetime':
|
|
1127
|
+
return datetimeValueToString(value);
|
|
1128
|
+
}
|
|
1129
|
+
return unknownToString(value?.value)?.trim?.();
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
class ValueComponent {
|
|
1133
|
+
constructor(injector, router) {
|
|
1134
|
+
this.injector = injector;
|
|
1135
|
+
this.router = router;
|
|
1136
|
+
this.value = input();
|
|
1137
|
+
this.lazyValue = input();
|
|
1138
|
+
this.lazyVisible = model(false);
|
|
1139
|
+
this.progress = input(false, { transform: booleanAttribute });
|
|
1140
|
+
this.inline = false;
|
|
1141
|
+
this.emptySymbol = '―';
|
|
1142
|
+
this.value$ = combineLatest([toObservable(this.value), toObservable(this.lazyValue)]).pipe(switchMap(([value, lazyValue]) => (isObservable(lazyValue) ? lazyValue : of(value))), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
1143
|
+
this.valueText$ = this.value$.pipe(map((value) => runInInjectionContext(this.injector, () => valueToString(value))), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
1144
|
+
this.inProgress$ = combineLatest([
|
|
1145
|
+
toObservable(this.progress),
|
|
1146
|
+
this.value$.pipe(map((v) => v?.inProgress ?? false)),
|
|
1147
|
+
]).pipe(map(([compProgress, valueProgress]) => compProgress || valueProgress), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
1148
|
+
}
|
|
1149
|
+
makeLazyVisible() {
|
|
1150
|
+
this.lazyVisible.set(true);
|
|
1151
|
+
}
|
|
1152
|
+
click(event) {
|
|
1153
|
+
this.value$.pipe(first(), filter(Boolean)).subscribe((value) => {
|
|
1154
|
+
runInInjectionContext(this.injector, () => {
|
|
1155
|
+
if (value?.click) {
|
|
1156
|
+
value.click(event);
|
|
1157
|
+
}
|
|
1158
|
+
else if (typeof value?.link === 'function') {
|
|
1159
|
+
const linkArgs = value.link(event);
|
|
1160
|
+
if (typeof linkArgs === 'string') {
|
|
1161
|
+
this.router.navigateByUrl(linkArgs);
|
|
1162
|
+
return;
|
|
1163
|
+
}
|
|
1164
|
+
this.router.navigate(...linkArgs);
|
|
1165
|
+
}
|
|
1166
|
+
});
|
|
1167
|
+
});
|
|
1168
|
+
}
|
|
1169
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ValueComponent, deps: [{ token: i0.Injector }, { token: i1$5.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1170
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: ValueComponent, isStandalone: true, selector: "v-value", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, lazyValue: { classPropertyName: "lazyValue", publicName: "lazyValue", isSignal: true, isRequired: false, transformFunction: null }, lazyVisible: { classPropertyName: "lazyVisible", publicName: "lazyVisible", isSignal: true, isRequired: false, transformFunction: null }, progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, emptySymbol: { classPropertyName: "emptySymbol", publicName: "emptySymbol", isSignal: false, isRequired: false, transformFunction: (v) => (v === false ? '' : typeof v === 'string' ? v : '―') }, highlight: { classPropertyName: "highlight", publicName: "highlight", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { lazyVisible: "lazyVisibleChange" }, host: { properties: { "class.inline": "inline" } }, ngImport: i0, template: "@if (!value() && lazyValue() && !lazyVisible()) {\n <button class=\"button\" mat-icon-button (click)=\"lazyVisible.set(true)\">\n <mat-icon>sync</mat-icon>\n </button>\n} @else {\n @if (value$ | async; as v) {\n @if (v.template) {\n <ng-container *ngTemplateOutlet=\"v.template; context: {}\"></ng-container>\n } @else {\n @if (v.color) {\n <v-tag [color]=\"v.color\">\n <ng-container *ngTemplateOutlet=\"tooltipTemplate\"></ng-container>\n </v-tag>\n } @else {\n <ng-container *ngTemplateOutlet=\"tooltipTemplate\"></ng-container>\n }\n\n <ng-template #tooltipTemplate>\n @if (v.tooltip) {\n <span [matTooltip]=\"v.tooltip\" class=\"tooltip\">\n <ng-container *ngTemplateOutlet=\"valueTemplate\"></ng-container>\n </span>\n } @else {\n <span [title]=\"v.value\">\n <ng-container *ngTemplateOutlet=\"valueTemplate\"></ng-container>\n </span>\n }\n </ng-template>\n\n <ng-template #valueTemplate>\n @switch (v.type) {\n @case ('menu') {\n <v-menu-value [value]=\"v\"></v-menu-value>\n }\n @default {\n @let valueText = valueText$ | async;\n @if (inProgress$ | async) {\n <v-content-loading [hiddenText]=\"valueText\"></v-content-loading>\n } @else if (valueText) {\n <span\n [ngClass]=\"{ value__click: v.click, value__link: v.link }\"\n [vHighlightSearch]=\"highlight\"\n [vHighlightText]=\"valueText\"\n vHighlight\n (click)=\"click($event)\"\n ></span>\n } @else if (emptySymbol) {\n <span style=\"color: #ccc\">{{ emptySymbol }}</span>\n }\n }\n }\n </ng-template>\n }\n\n @if (v.description) {\n <div\n [title]=\"v.description\"\n [vHighlightSearch]=\"highlight\"\n [vHighlightText]=\"v.description\"\n class=\"description mat-label-medium mat-secondary-text\"\n vHighlight\n ></div>\n }\n } @else {\n <v-content-loading></v-content-loading>\n }\n}\n", styles: [":host{cursor:default;text-align:left}::ng-deep .inline,::ng-deep .inline *{white-space:nowrap}.tooltip{text-decoration:underline;text-decoration-style:dotted}.value__click{cursor:pointer}.value__click:hover{text-decoration:underline;text-decoration-style:dashed}.value__link{cursor:pointer}.value__link:hover{text-decoration:underline}.description{overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: TagComponent, selector: "v-tag", inputs: ["color", "icon", "progress"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: MenuValueComponent, selector: "v-menu-value", inputs: ["value"] }, { kind: "component", type: ContentLoadingComponent, selector: "v-content-loading", inputs: ["width", "textSize", "hiddenText"] }, { kind: "directive", type: HighlightDirective, selector: "[vHighlight]", inputs: ["vHighlightText", "vHighlightSearch"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1171
|
+
}
|
|
1172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ValueComponent, decorators: [{
|
|
1173
|
+
type: Component,
|
|
1174
|
+
args: [{ selector: 'v-value', imports: [
|
|
1175
|
+
CommonModule,
|
|
1176
|
+
MatIcon,
|
|
1177
|
+
MatIconButton,
|
|
1178
|
+
TagModule,
|
|
1179
|
+
MatTooltip,
|
|
1180
|
+
MenuValueComponent,
|
|
1181
|
+
ContentLoadingComponent,
|
|
1182
|
+
HighlightDirective,
|
|
1183
|
+
], host: {
|
|
1184
|
+
'[class.inline]': 'inline',
|
|
1185
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (!value() && lazyValue() && !lazyVisible()) {\n <button class=\"button\" mat-icon-button (click)=\"lazyVisible.set(true)\">\n <mat-icon>sync</mat-icon>\n </button>\n} @else {\n @if (value$ | async; as v) {\n @if (v.template) {\n <ng-container *ngTemplateOutlet=\"v.template; context: {}\"></ng-container>\n } @else {\n @if (v.color) {\n <v-tag [color]=\"v.color\">\n <ng-container *ngTemplateOutlet=\"tooltipTemplate\"></ng-container>\n </v-tag>\n } @else {\n <ng-container *ngTemplateOutlet=\"tooltipTemplate\"></ng-container>\n }\n\n <ng-template #tooltipTemplate>\n @if (v.tooltip) {\n <span [matTooltip]=\"v.tooltip\" class=\"tooltip\">\n <ng-container *ngTemplateOutlet=\"valueTemplate\"></ng-container>\n </span>\n } @else {\n <span [title]=\"v.value\">\n <ng-container *ngTemplateOutlet=\"valueTemplate\"></ng-container>\n </span>\n }\n </ng-template>\n\n <ng-template #valueTemplate>\n @switch (v.type) {\n @case ('menu') {\n <v-menu-value [value]=\"v\"></v-menu-value>\n }\n @default {\n @let valueText = valueText$ | async;\n @if (inProgress$ | async) {\n <v-content-loading [hiddenText]=\"valueText\"></v-content-loading>\n } @else if (valueText) {\n <span\n [ngClass]=\"{ value__click: v.click, value__link: v.link }\"\n [vHighlightSearch]=\"highlight\"\n [vHighlightText]=\"valueText\"\n vHighlight\n (click)=\"click($event)\"\n ></span>\n } @else if (emptySymbol) {\n <span style=\"color: #ccc\">{{ emptySymbol }}</span>\n }\n }\n }\n </ng-template>\n }\n\n @if (v.description) {\n <div\n [title]=\"v.description\"\n [vHighlightSearch]=\"highlight\"\n [vHighlightText]=\"v.description\"\n class=\"description mat-label-medium mat-secondary-text\"\n vHighlight\n ></div>\n }\n } @else {\n <v-content-loading></v-content-loading>\n }\n}\n", styles: [":host{cursor:default;text-align:left}::ng-deep .inline,::ng-deep .inline *{white-space:nowrap}.tooltip{text-decoration:underline;text-decoration-style:dotted}.value__click{cursor:pointer}.value__click:hover{text-decoration:underline;text-decoration-style:dashed}.value__link{cursor:pointer}.value__link:hover{text-decoration:underline}.description{overflow:hidden;text-overflow:ellipsis}\n"] }]
|
|
1186
|
+
}], ctorParameters: () => [{ type: i0.Injector }, { type: i1$5.Router }], propDecorators: { inline: [{
|
|
1187
|
+
type: Input,
|
|
1188
|
+
args: [{ transform: booleanAttribute }]
|
|
1189
|
+
}], emptySymbol: [{
|
|
1190
|
+
type: Input,
|
|
1191
|
+
args: [{
|
|
1192
|
+
transform: (v) => (v === false ? '' : typeof v === 'string' ? v : '―'),
|
|
1193
|
+
}]
|
|
1194
|
+
}], highlight: [{
|
|
1195
|
+
type: Input
|
|
1196
|
+
}] } });
|
|
1197
|
+
|
|
1198
|
+
class ValueListComponent {
|
|
1199
|
+
constructor() {
|
|
1200
|
+
this.list = input();
|
|
1201
|
+
}
|
|
1202
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ValueListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1203
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: ValueListComponent, isStandalone: true, selector: "v-value-list", inputs: { list: { classPropertyName: "list", publicName: "list", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1204
|
+
@if (list(); as items) {
|
|
1205
|
+
@if (items.length > 1) {
|
|
1206
|
+
<div class="list">
|
|
1207
|
+
@for (item of items; track item) {
|
|
1208
|
+
<v-value [value]="item" inline></v-value>
|
|
1209
|
+
}
|
|
1210
|
+
</div>
|
|
1211
|
+
} @else {
|
|
1212
|
+
<v-value [value]="items[0]" inline></v-value>
|
|
1213
|
+
}
|
|
1214
|
+
} @else {
|
|
1215
|
+
<v-value [progress]="true" inline></v-value>
|
|
1216
|
+
}
|
|
1217
|
+
`, isInline: true, styles: [".list{display:flex;flex-direction:column}.list>*{overflow:hidden;text-overflow:ellipsis;min-height:20px}\n"], dependencies: [{ kind: "component", type: ValueComponent, selector: "v-value", inputs: ["value", "lazyValue", "lazyVisible", "progress", "inline", "emptySymbol", "highlight"], outputs: ["lazyVisibleChange"] }] }); }
|
|
1218
|
+
}
|
|
1219
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ValueListComponent, decorators: [{
|
|
1220
|
+
type: Component,
|
|
1221
|
+
args: [{ selector: 'v-value-list', imports: [ValueComponent], template: `
|
|
1222
|
+
@if (list(); as items) {
|
|
1223
|
+
@if (items.length > 1) {
|
|
1224
|
+
<div class="list">
|
|
1225
|
+
@for (item of items; track item) {
|
|
1226
|
+
<v-value [value]="item" inline></v-value>
|
|
1227
|
+
}
|
|
1228
|
+
</div>
|
|
1229
|
+
} @else {
|
|
1230
|
+
<v-value [value]="items[0]" inline></v-value>
|
|
1231
|
+
}
|
|
1232
|
+
} @else {
|
|
1233
|
+
<v-value [progress]="true" inline></v-value>
|
|
1234
|
+
}
|
|
1235
|
+
`, styles: [".list{display:flex;flex-direction:column}.list>*{overflow:hidden;text-overflow:ellipsis;min-height:20px}\n"] }]
|
|
1236
|
+
}] });
|
|
1237
|
+
|
|
1238
|
+
class TableInputsComponent {
|
|
1239
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TableInputsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1240
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.6", type: TableInputsComponent, isStandalone: false, selector: "v-table-inputs", ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, styles: [":host{display:block}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1241
|
+
}
|
|
1242
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TableInputsComponent, decorators: [{
|
|
1243
|
+
type: Component,
|
|
1244
|
+
args: [{ selector: 'v-table-inputs', template: `<ng-content></ng-content>`, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, styles: [":host{display:block}\n"] }]
|
|
1245
|
+
}] });
|
|
1246
|
+
|
|
1247
|
+
function createUniqueColumnDef(name) {
|
|
1248
|
+
return `___$$${typeof name === 'object' || isNil(name) ? 'column' : String(name)}_${Math.random().toString()}`;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
const DEFAULT_SORT = { active: '', direction: '' };
|
|
1252
|
+
const DEBOUNCE_TIME_MS = 500;
|
|
1253
|
+
const DEFAULT_LOADED_LAZY_ROWS_COUNT = 3;
|
|
1254
|
+
const COLUMN_DEFS = {
|
|
1255
|
+
select: createUniqueColumnDef('select'),
|
|
1256
|
+
drag: createUniqueColumnDef('drag'),
|
|
1257
|
+
};
|
|
1258
|
+
|
|
1259
|
+
function normalizePossiblyFn(fn) {
|
|
1260
|
+
return typeof fn === 'function' ? fn : () => fn;
|
|
1261
|
+
}
|
|
1262
|
+
function normalizeCell(field, cell, hasChild = false) {
|
|
1263
|
+
const cellFn = normalizePossiblyFn(cell);
|
|
1264
|
+
return (...args) => getPossiblyAsyncObservable(cellFn(...args)).pipe(map((value) => {
|
|
1265
|
+
const defaultValue = hasChild ? { value: '' } : { value: get(args[0], field) };
|
|
1266
|
+
if (isNil(value)) {
|
|
1267
|
+
return defaultValue;
|
|
1268
|
+
}
|
|
1269
|
+
return typeof value === 'object' ? { ...defaultValue, ...value } : { value };
|
|
1270
|
+
}));
|
|
1271
|
+
}
|
|
1272
|
+
class NormColumn {
|
|
1273
|
+
constructor({ field, header, cell, child, hidden, sort, lazyCell, ...params }, commonParams = {}) {
|
|
1274
|
+
this.field = field ?? (typeof header === 'string' ? header : String(Math.random()));
|
|
1275
|
+
const defaultHeaderValue = startCase((field || '').split('.').at(-1));
|
|
1276
|
+
this.header = getPossiblyAsyncObservable(header).pipe(map((value) => typeof value === 'object'
|
|
1277
|
+
? { value: defaultHeaderValue, ...value }
|
|
1278
|
+
: { value: value ?? defaultHeaderValue }));
|
|
1279
|
+
if (cell || !lazyCell) {
|
|
1280
|
+
this.cell = normalizeCell(this.field, cell, !!child);
|
|
1281
|
+
}
|
|
1282
|
+
if (lazyCell) {
|
|
1283
|
+
this.lazyCell = normalizeCell(this.field, lazyCell, !!child);
|
|
1284
|
+
}
|
|
1285
|
+
if (child) {
|
|
1286
|
+
this.child = normalizeCell(this.field, child);
|
|
1287
|
+
}
|
|
1288
|
+
this.params = {
|
|
1289
|
+
...commonParams,
|
|
1290
|
+
...params,
|
|
1291
|
+
style: Object.assign({}, commonParams?.style, params?.style),
|
|
1292
|
+
};
|
|
1293
|
+
this.hidden = isNil(hidden) ? of(false) : getPossiblyAsyncObservable(hidden);
|
|
1294
|
+
this.sort = isNil(sort) ? of(null) : getPossiblyAsyncObservable(sort);
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
function columnsDataToFilterSearchData(src$) {
|
|
1299
|
+
const injector = inject(Injector);
|
|
1300
|
+
return src$.pipe(map((data) => new Map(Array.from(data.entries()).map(([item, value]) => [
|
|
1301
|
+
item,
|
|
1302
|
+
{
|
|
1303
|
+
byColumns: value.map((el) => [
|
|
1304
|
+
runInInjectionContext(injector, () => normalizeString(valueToString(el?.value))),
|
|
1305
|
+
normalizeString(String(el?.value?.description ?? '')),
|
|
1306
|
+
]),
|
|
1307
|
+
byRow: JSON.stringify(item),
|
|
1308
|
+
},
|
|
1309
|
+
]))));
|
|
1310
|
+
}
|
|
1311
|
+
function getWeight(searchValue, search, lowerCaseSearch, unimportance = 0) {
|
|
1312
|
+
if (searchValue === search) {
|
|
1313
|
+
return 1000000 - unimportance;
|
|
1314
|
+
}
|
|
1315
|
+
else if (searchValue.includes(search)) {
|
|
1316
|
+
return 10000 - unimportance;
|
|
1317
|
+
}
|
|
1318
|
+
else if (searchValue.toLowerCase().includes(lowerCaseSearch)) {
|
|
1319
|
+
return 100 - unimportance;
|
|
1320
|
+
}
|
|
1321
|
+
return 0;
|
|
1322
|
+
}
|
|
1323
|
+
function filterData(data, search) {
|
|
1324
|
+
const lowerCaseSearch = search.toLowerCase();
|
|
1325
|
+
return Array.from(data.entries())
|
|
1326
|
+
.map(([value, searchValuesCols]) => ({
|
|
1327
|
+
value,
|
|
1328
|
+
priority: searchValuesCols.byColumns.reduce((priority, searchValues) => searchValues.reduce((colPriority, searchValue, idx) => colPriority + getWeight(searchValue, search, lowerCaseSearch, idx), priority), 0) + getWeight(searchValuesCols.byRow, search, lowerCaseSearch, 1),
|
|
1329
|
+
}))
|
|
1330
|
+
.filter((v) => v.priority)
|
|
1331
|
+
.sort((a, b) => b.priority - a.priority)
|
|
1332
|
+
.map((v) => v.value);
|
|
1333
|
+
}
|
|
1334
|
+
function sortData(source, data, columns, sort) {
|
|
1335
|
+
if (!sort?.active || !sort?.direction) {
|
|
1336
|
+
return source;
|
|
1337
|
+
}
|
|
1338
|
+
const colIdx = columns.findIndex((c) => c.field === sort.active);
|
|
1339
|
+
const sortedData = source
|
|
1340
|
+
.slice()
|
|
1341
|
+
.sort((a, b) => compareDifferentTypes((data.get(a)?.byColumns ?? [])[colIdx]?.[0], (data.get(b)?.byColumns ?? [])[colIdx]?.[0]));
|
|
1342
|
+
return sort.direction === 'desc' ? sortedData.reverse() : sortedData;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
function treeDataItemToInlineDataItem(item) {
|
|
1346
|
+
const children = item.children ?? [];
|
|
1347
|
+
return [
|
|
1348
|
+
children.length ? { value: item.value, child: children[0] } : { value: item.value },
|
|
1349
|
+
...children.slice(1).map((child) => ({ child })),
|
|
1350
|
+
];
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
function cachedHeadMap(fn) {
|
|
1354
|
+
return (src$) => {
|
|
1355
|
+
return src$.pipe(scan((acc, v) => {
|
|
1356
|
+
return {
|
|
1357
|
+
prev: v ?? [],
|
|
1358
|
+
res: (v ?? []).map((el, idx) => acc.prev[idx] === el ? acc.res[idx] : fn(el, idx)),
|
|
1359
|
+
};
|
|
1360
|
+
}, { prev: [], res: [] }), map(({ res }) => res));
|
|
1361
|
+
};
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
class TableDataSource extends MatTableDataSource {
|
|
1365
|
+
get paginator() {
|
|
1366
|
+
return this.__paginator;
|
|
1367
|
+
}
|
|
1368
|
+
constructor() {
|
|
1369
|
+
super();
|
|
1370
|
+
this.isTreeData$ = new BehaviorSubject(false);
|
|
1371
|
+
this.sourceData$ = new BehaviorSubject([]);
|
|
1372
|
+
this.data$ = this.isTreeData$.pipe(switchMap((isTreeData) => isTreeData
|
|
1373
|
+
? this.sourceData$.pipe(cachedHeadMap(treeDataItemToInlineDataItem), map((v) => v.flat()))
|
|
1374
|
+
: this.sourceData$), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
1375
|
+
this.__paginator = new OnePageTableDataSourcePaginator();
|
|
1376
|
+
this.data$.pipe(takeUntilDestroyed(inject(DestroyRef))).subscribe((data) => {
|
|
1377
|
+
this.data = data;
|
|
1378
|
+
});
|
|
1379
|
+
}
|
|
1380
|
+
setData(data) {
|
|
1381
|
+
this.sourceData$.next(data);
|
|
1382
|
+
if (this.isTreeData$.value) {
|
|
1383
|
+
this.isTreeData$.next(false);
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
setTreeData(data) {
|
|
1387
|
+
this.sourceData$.next(data);
|
|
1388
|
+
if (!this.isTreeData$.value) {
|
|
1389
|
+
this.isTreeData$.next(true);
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
class OnePageTableDataSourcePaginator {
|
|
1394
|
+
get length() {
|
|
1395
|
+
return this.pageSize;
|
|
1396
|
+
}
|
|
1397
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1398
|
+
set length(_length) { }
|
|
1399
|
+
get displayedPages() {
|
|
1400
|
+
return this.pageSize / this.partSize;
|
|
1401
|
+
}
|
|
1402
|
+
constructor(partSize) {
|
|
1403
|
+
this.pageIndex = 0;
|
|
1404
|
+
this.pageSize = 0;
|
|
1405
|
+
this.page = new EventEmitter();
|
|
1406
|
+
this.initialized = new BehaviorSubject(undefined);
|
|
1407
|
+
this.setSize(partSize);
|
|
1408
|
+
}
|
|
1409
|
+
setSize(partSize = 25) {
|
|
1410
|
+
if (partSize !== this.partSize) {
|
|
1411
|
+
this.pageSize = this.partSize = partSize;
|
|
1412
|
+
this.reload();
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
reload() {
|
|
1416
|
+
this.pageSize = this.partSize;
|
|
1417
|
+
this.update();
|
|
1418
|
+
}
|
|
1419
|
+
more() {
|
|
1420
|
+
this.pageSize += this.partSize;
|
|
1421
|
+
this.update();
|
|
1422
|
+
}
|
|
1423
|
+
update() {
|
|
1424
|
+
this.page.next({
|
|
1425
|
+
pageIndex: this.pageIndex,
|
|
1426
|
+
pageSize: this.pageSize,
|
|
1427
|
+
length: this.length,
|
|
1428
|
+
});
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
function tableToCsvObject(cols, displayedData) {
|
|
1433
|
+
const data = Array.from(displayedData.values()).map((columnData) => columnData.map((v) => v.value));
|
|
1434
|
+
const res = [
|
|
1435
|
+
cols
|
|
1436
|
+
.map((v) => {
|
|
1437
|
+
const res = valueToString(v);
|
|
1438
|
+
return [res, `${res} (description)`];
|
|
1439
|
+
})
|
|
1440
|
+
.flat(),
|
|
1441
|
+
...data.map((r) => r.map((c) => [valueToString(c), unknownToString(c?.description)]).flat()),
|
|
1442
|
+
];
|
|
1443
|
+
// Removing empty description columns (every second column)
|
|
1444
|
+
let emptyCols = [];
|
|
1445
|
+
for (let i = 1; i < res[0].length; i += 2 // description - every second column
|
|
1446
|
+
) {
|
|
1447
|
+
let isEmpty = true;
|
|
1448
|
+
for (let j = 1; // ignore header row
|
|
1449
|
+
j < res.length; ++j) {
|
|
1450
|
+
if (res[j][i]) {
|
|
1451
|
+
isEmpty = false;
|
|
1452
|
+
break;
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
if (isEmpty) {
|
|
1456
|
+
emptyCols.push(i);
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
emptyCols = emptyCols.reverse();
|
|
1460
|
+
for (const i of emptyCols) {
|
|
1461
|
+
for (let j = 0; j < res.length; ++j) {
|
|
1462
|
+
res[j].splice(i, 1);
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
return res;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
function getValue(cellFn, ...[value, idx]) {
|
|
1469
|
+
return cellFn ? cellFn(value, idx).pipe(toScannedValue) : of(null);
|
|
1470
|
+
}
|
|
1471
|
+
function toScannedValue(src$) {
|
|
1472
|
+
return src$.pipe(shareReplay({
|
|
1473
|
+
bufferSize: 1,
|
|
1474
|
+
refCount: true,
|
|
1475
|
+
}));
|
|
1476
|
+
}
|
|
1477
|
+
function toObservableColumnsData(src$) {
|
|
1478
|
+
return src$.pipe(scan((acc, { isTree, data, cols }) => {
|
|
1479
|
+
const isColsNotChanged = acc.cols === cols;
|
|
1480
|
+
return {
|
|
1481
|
+
res: new Map(isTree
|
|
1482
|
+
? data.map((d, idx) => [
|
|
1483
|
+
d,
|
|
1484
|
+
isColsNotChanged &&
|
|
1485
|
+
d === acc.data[idx] &&
|
|
1486
|
+
// This is not the last value, because we need to calculate isNextChild
|
|
1487
|
+
idx !== acc.data.length - 1
|
|
1488
|
+
? acc.res.get(d)
|
|
1489
|
+
: new Map(cols.map((c) => [
|
|
1490
|
+
c,
|
|
1491
|
+
{
|
|
1492
|
+
value: d.child && c.child
|
|
1493
|
+
? getValue(c.child, d.child, idx)
|
|
1494
|
+
: d.value
|
|
1495
|
+
? getValue(c.cell, d.value, idx)
|
|
1496
|
+
: of({ value: '' }),
|
|
1497
|
+
// TODO add support of lazyValue
|
|
1498
|
+
isChild: !d.value,
|
|
1499
|
+
isNextChild: !data[idx + 1]?.value,
|
|
1500
|
+
},
|
|
1501
|
+
])),
|
|
1502
|
+
])
|
|
1503
|
+
: data.map((d, idx) => [
|
|
1504
|
+
d,
|
|
1505
|
+
isColsNotChanged && d === acc.data[idx]
|
|
1506
|
+
? acc.res.get(d)
|
|
1507
|
+
: new Map(cols.map((c) => [
|
|
1508
|
+
c,
|
|
1509
|
+
{
|
|
1510
|
+
value: getValue(c.cell, d, idx),
|
|
1511
|
+
lazyValue: c.lazyCell
|
|
1512
|
+
? c.lazyCell(d, idx).pipe(toScannedValue)
|
|
1513
|
+
: undefined,
|
|
1514
|
+
},
|
|
1515
|
+
])),
|
|
1516
|
+
])),
|
|
1517
|
+
data,
|
|
1518
|
+
cols,
|
|
1519
|
+
};
|
|
1520
|
+
}, { data: [], cols: [], res: new Map() }), map(({ res }) => res));
|
|
1521
|
+
}
|
|
1522
|
+
function toColumnsData(src$) {
|
|
1523
|
+
return src$.pipe(switchMap((columnsData) => {
|
|
1524
|
+
if (!columnsData.size) {
|
|
1525
|
+
return of(new Map());
|
|
1526
|
+
}
|
|
1527
|
+
return combineLatest(Array.from(columnsData.values()).map((v) => combineLatest(Array.from(v.values()).map((cell) => timer(0).pipe(switchMap(() => cell.value), distinctUntilChanged(isEqual$1)))).pipe(debounceTime(0)))).pipe(debounceTime(0), map((res) => new Map(Array.from(columnsData.entries()).map(([k, v], idx) => [
|
|
1528
|
+
k,
|
|
1529
|
+
Array.from(v.values()).map((cell, colIdx) => ({
|
|
1530
|
+
...cell,
|
|
1531
|
+
value: res[idx][colIdx],
|
|
1532
|
+
})),
|
|
1533
|
+
]))));
|
|
1534
|
+
}));
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
class NoRecordsComponent {
|
|
1538
|
+
constructor() {
|
|
1539
|
+
this.noRecords = input(false, { transform: booleanAttribute });
|
|
1540
|
+
this.progress = input(false, { transform: booleanAttribute });
|
|
1541
|
+
}
|
|
1542
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NoRecordsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1543
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: NoRecordsComponent, isStandalone: true, selector: "v-no-records", inputs: { noRecords: { classPropertyName: "noRecords", publicName: "noRecords", isSignal: true, isRequired: false, transformFunction: null }, progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1544
|
+
@if (noRecords()) {
|
|
1545
|
+
<div class="no-records mat-body-large">
|
|
1546
|
+
{{ progress() ? 'Loading...' : 'No records' }}
|
|
1547
|
+
</div>
|
|
1548
|
+
}
|
|
1549
|
+
`, isInline: true, styles: [".no-records{position:absolute;z-index:999;top:calc(50% + 28px);left:50%;transform:translate(-50%) translateY(-50%)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1550
|
+
}
|
|
1551
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NoRecordsComponent, decorators: [{
|
|
1552
|
+
type: Component,
|
|
1553
|
+
args: [{ selector: 'v-no-records', template: `
|
|
1554
|
+
@if (noRecords()) {
|
|
1555
|
+
<div class="no-records mat-body-large">
|
|
1556
|
+
{{ progress() ? 'Loading...' : 'No records' }}
|
|
1557
|
+
</div>
|
|
1558
|
+
}
|
|
1559
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [], styles: [".no-records{position:absolute;z-index:999;top:calc(50% + 28px);left:50%;transform:translate(-50%) translateY(-50%)}\n"] }]
|
|
1560
|
+
}] });
|
|
1561
|
+
|
|
1562
|
+
function createIntersectionObserver(el) {
|
|
1563
|
+
return new Observable((subscriber) => {
|
|
1564
|
+
const observer = new IntersectionObserver((entries) => {
|
|
1565
|
+
for (const entry of entries) {
|
|
1566
|
+
if (entry.isIntersecting) {
|
|
1567
|
+
subscriber.next(entry);
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
});
|
|
1571
|
+
observer.observe(el);
|
|
1572
|
+
return {
|
|
1573
|
+
unsubscribe() {
|
|
1574
|
+
observer.disconnect();
|
|
1575
|
+
},
|
|
1576
|
+
};
|
|
1577
|
+
});
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
class InfinityScrollDirective {
|
|
1581
|
+
constructor(elementRef, dr) {
|
|
1582
|
+
this.elementRef = elementRef;
|
|
1583
|
+
this.dr = dr;
|
|
1584
|
+
this.vInfinityScroll = input(false, { transform: booleanAttribute });
|
|
1585
|
+
this.vInfinityScrollMore = output();
|
|
1586
|
+
}
|
|
1587
|
+
ngOnInit() {
|
|
1588
|
+
createIntersectionObserver(this.elementRef.nativeElement)
|
|
1589
|
+
.pipe(filter(() => this.vInfinityScroll()), takeUntilDestroyed(this.dr))
|
|
1590
|
+
.subscribe(() => {
|
|
1591
|
+
this.vInfinityScrollMore.emit();
|
|
1592
|
+
});
|
|
1593
|
+
}
|
|
1594
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: InfinityScrollDirective, deps: [{ token: i0.ElementRef }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1595
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.6", type: InfinityScrollDirective, isStandalone: true, selector: "[vInfinityScroll]", inputs: { vInfinityScroll: { classPropertyName: "vInfinityScroll", publicName: "vInfinityScroll", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { vInfinityScrollMore: "vInfinityScrollMore" }, ngImport: i0 }); }
|
|
1596
|
+
}
|
|
1597
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: InfinityScrollDirective, decorators: [{
|
|
1598
|
+
type: Directive,
|
|
1599
|
+
args: [{
|
|
1600
|
+
selector: '[vInfinityScroll]',
|
|
1601
|
+
standalone: true,
|
|
1602
|
+
}]
|
|
1603
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.DestroyRef }] });
|
|
1604
|
+
|
|
1605
|
+
class BaseColumnComponent {
|
|
1606
|
+
constructor() {
|
|
1607
|
+
this.name = input.required();
|
|
1608
|
+
this.table = inject(MatTable);
|
|
1609
|
+
this.columnDef = viewChild(MatColumnDef);
|
|
1610
|
+
this.cellDef = viewChild(MatCellDef);
|
|
1611
|
+
this.headerCellDef = viewChild(MatHeaderCellDef);
|
|
1612
|
+
this.footerCellDef = viewChild(MatFooterCellDef);
|
|
1613
|
+
}
|
|
1614
|
+
ngOnInit() {
|
|
1615
|
+
const columnDef = this.columnDef();
|
|
1616
|
+
if (columnDef) {
|
|
1617
|
+
columnDef.name = this.name();
|
|
1618
|
+
columnDef.cell = this.cellDef();
|
|
1619
|
+
columnDef.headerCell = this.headerCellDef();
|
|
1620
|
+
columnDef.footerCell = this.footerCellDef();
|
|
1621
|
+
this.removeColumnDef();
|
|
1622
|
+
this.table.addColumnDef(columnDef);
|
|
1623
|
+
this.addedColumnDef = columnDef;
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
ngOnDestroy() {
|
|
1627
|
+
this.removeColumnDef();
|
|
1628
|
+
}
|
|
1629
|
+
removeColumnDef() {
|
|
1630
|
+
if (this.table && this.addedColumnDef) {
|
|
1631
|
+
this.table.removeColumnDef(this.addedColumnDef);
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: BaseColumnComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1635
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.6", type: BaseColumnComponent, isStandalone: true, inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "columnDef", first: true, predicate: MatColumnDef, descendants: true, isSignal: true }, { propertyName: "cellDef", first: true, predicate: MatCellDef, descendants: true, isSignal: true }, { propertyName: "headerCellDef", first: true, predicate: MatHeaderCellDef, descendants: true, isSignal: true }, { propertyName: "footerCellDef", first: true, predicate: MatFooterCellDef, descendants: true, isSignal: true }], ngImport: i0 }); }
|
|
1636
|
+
}
|
|
1637
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: BaseColumnComponent, decorators: [{
|
|
1638
|
+
type: Directive
|
|
1639
|
+
}] });
|
|
1640
|
+
|
|
1641
|
+
class SelectColumnComponent extends BaseColumnComponent {
|
|
1642
|
+
constructor(dr) {
|
|
1643
|
+
super();
|
|
1644
|
+
this.dr = dr;
|
|
1645
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1646
|
+
this.selected = model([]);
|
|
1647
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1648
|
+
this.data = input([], { transform: arrayAttribute });
|
|
1649
|
+
this.progress = input(false);
|
|
1650
|
+
this.selection = new SelectionModel(true, []);
|
|
1651
|
+
this.isAllSelected$ = combineLatest([
|
|
1652
|
+
this.selection.changed.pipe(startWith(null)),
|
|
1653
|
+
toObservable(this.data),
|
|
1654
|
+
]).pipe(map(() => this.getIsAllSelected()), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
1655
|
+
}
|
|
1656
|
+
ngOnInit() {
|
|
1657
|
+
super.ngOnInit();
|
|
1658
|
+
this.selection.changed.pipe(takeUntilDestroyed(this.dr)).subscribe(() => {
|
|
1659
|
+
this.selected.set(this.selection.selected);
|
|
1660
|
+
});
|
|
1661
|
+
}
|
|
1662
|
+
ngOnChanges(changes) {
|
|
1663
|
+
if (changes.data || changes.selected) {
|
|
1664
|
+
this.updateSelection();
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
toggleAllRows() {
|
|
1668
|
+
if (this.getIsAllSelected()) {
|
|
1669
|
+
this.selection.clear(true);
|
|
1670
|
+
return;
|
|
1671
|
+
}
|
|
1672
|
+
this.selection.select(...this.data());
|
|
1673
|
+
}
|
|
1674
|
+
getIsAllSelected() {
|
|
1675
|
+
const numSelected = this.selection.selected.length;
|
|
1676
|
+
const numRows = this.data().length;
|
|
1677
|
+
return numSelected === numRows;
|
|
1678
|
+
}
|
|
1679
|
+
updateSelection() {
|
|
1680
|
+
const newSelected = (this.selected() || []).filter((d) => !!this.data()?.includes?.(d));
|
|
1681
|
+
this.selection.deselect(...this.selection.selected.filter((s) => !newSelected.includes(s)));
|
|
1682
|
+
this.selection.select(...newSelected);
|
|
1683
|
+
}
|
|
1684
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SelectColumnComponent, deps: [{ token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1685
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: SelectColumnComponent, isStandalone: true, selector: "v-select-column", inputs: { selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selectedChange" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
|
|
1686
|
+
<ng-container [matColumnDef]="name()" [sticky]="true">
|
|
1687
|
+
@let columnClasses = 'column';
|
|
1688
|
+
<th *matHeaderCellDef [class]="columnClasses" mat-header-cell>
|
|
1689
|
+
<mat-checkbox
|
|
1690
|
+
[checked]="selection.hasValue() && (isAllSelected$ | async)"
|
|
1691
|
+
[disabled]="!!progress() || !data()?.length"
|
|
1692
|
+
[indeterminate]="selection.hasValue() && !(isAllSelected$ | async)"
|
|
1693
|
+
(change)="$event ? toggleAllRows() : null"
|
|
1694
|
+
>
|
|
1695
|
+
</mat-checkbox>
|
|
1696
|
+
</th>
|
|
1697
|
+
<td *matCellDef="let row" [class]="columnClasses" mat-cell>
|
|
1698
|
+
<mat-checkbox
|
|
1699
|
+
[checked]="selection.isSelected(row)"
|
|
1700
|
+
[disabled]="!!progress()"
|
|
1701
|
+
(change)="$event ? selection.toggle(row) : null"
|
|
1702
|
+
(click)="$event.stopPropagation()"
|
|
1703
|
+
>
|
|
1704
|
+
</mat-checkbox>
|
|
1705
|
+
</td>
|
|
1706
|
+
<td *matFooterCellDef [class]="columnClasses" mat-footer-cell>
|
|
1707
|
+
<mat-checkbox disabled></mat-checkbox>
|
|
1708
|
+
</td>
|
|
1709
|
+
</ng-container>
|
|
1710
|
+
`, isInline: true, styles: [".column{padding-left:4px;padding-right:4px;width:48px;border-right:1px solid;text-overflow:clip}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatTableModule }, { kind: "directive", type: i2$4.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2$4.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2$4.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2$4.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2$4.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2$4.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i2$4.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i3$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1711
|
+
}
|
|
1712
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SelectColumnComponent, decorators: [{
|
|
1713
|
+
type: Component,
|
|
1714
|
+
args: [{ selector: 'v-select-column', template: `
|
|
1715
|
+
<ng-container [matColumnDef]="name()" [sticky]="true">
|
|
1716
|
+
@let columnClasses = 'column';
|
|
1717
|
+
<th *matHeaderCellDef [class]="columnClasses" mat-header-cell>
|
|
1718
|
+
<mat-checkbox
|
|
1719
|
+
[checked]="selection.hasValue() && (isAllSelected$ | async)"
|
|
1720
|
+
[disabled]="!!progress() || !data()?.length"
|
|
1721
|
+
[indeterminate]="selection.hasValue() && !(isAllSelected$ | async)"
|
|
1722
|
+
(change)="$event ? toggleAllRows() : null"
|
|
1723
|
+
>
|
|
1724
|
+
</mat-checkbox>
|
|
1725
|
+
</th>
|
|
1726
|
+
<td *matCellDef="let row" [class]="columnClasses" mat-cell>
|
|
1727
|
+
<mat-checkbox
|
|
1728
|
+
[checked]="selection.isSelected(row)"
|
|
1729
|
+
[disabled]="!!progress()"
|
|
1730
|
+
(change)="$event ? selection.toggle(row) : null"
|
|
1731
|
+
(click)="$event.stopPropagation()"
|
|
1732
|
+
>
|
|
1733
|
+
</mat-checkbox>
|
|
1734
|
+
</td>
|
|
1735
|
+
<td *matFooterCellDef [class]="columnClasses" mat-footer-cell>
|
|
1736
|
+
<mat-checkbox disabled></mat-checkbox>
|
|
1737
|
+
</td>
|
|
1738
|
+
</ng-container>
|
|
1739
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, MatTableModule, MatCheckboxModule], styles: [".column{padding-left:4px;padding-right:4px;width:48px;border-right:1px solid;text-overflow:clip}\n"] }]
|
|
1740
|
+
}], ctorParameters: () => [{ type: i0.DestroyRef }] });
|
|
1741
|
+
|
|
1742
|
+
class DndColumnComponent extends BaseColumnComponent {
|
|
1743
|
+
constructor() {
|
|
1744
|
+
super(...arguments);
|
|
1745
|
+
this.dragged = output();
|
|
1746
|
+
}
|
|
1747
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DndColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1748
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.6", type: DndColumnComponent, isStandalone: true, selector: "v-dnd-column", outputs: { dragged: "dragged" }, usesInheritance: true, ngImport: i0, template: `
|
|
1749
|
+
<ng-container [matColumnDef]="name()" [sticky]="true">
|
|
1750
|
+
@let columnClasses = 'column';
|
|
1751
|
+
<th *matHeaderCellDef [class]="columnClasses" mat-header-cell></th>
|
|
1752
|
+
<td *matCellDef="let row" [class]="columnClasses" mat-cell>
|
|
1753
|
+
<div class="position">
|
|
1754
|
+
<mat-icon class="dragCursor" (mousedown)="dragged.emit()">reorder</mat-icon>
|
|
1755
|
+
<!-- <span>{{ index + 1 }}</span>-->
|
|
1756
|
+
</div>
|
|
1757
|
+
</td>
|
|
1758
|
+
<td *matFooterCellDef [class]="columnClasses" mat-footer-cell>
|
|
1759
|
+
<div class="position">
|
|
1760
|
+
<mat-icon class="dragCursor">reorder</mat-icon>
|
|
1761
|
+
</div>
|
|
1762
|
+
</td>
|
|
1763
|
+
</ng-container>
|
|
1764
|
+
`, isInline: true, styles: [".column .position{display:flex;align-items:center;gap:8px}.column .position .dragCursor{cursor:move}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatTableModule }, { kind: "directive", type: i2$4.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2$4.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2$4.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2$4.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2$4.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2$4.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i2$4.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1765
|
+
}
|
|
1766
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DndColumnComponent, decorators: [{
|
|
1767
|
+
type: Component,
|
|
1768
|
+
args: [{ selector: 'v-dnd-column', template: `
|
|
1769
|
+
<ng-container [matColumnDef]="name()" [sticky]="true">
|
|
1770
|
+
@let columnClasses = 'column';
|
|
1771
|
+
<th *matHeaderCellDef [class]="columnClasses" mat-header-cell></th>
|
|
1772
|
+
<td *matCellDef="let row" [class]="columnClasses" mat-cell>
|
|
1773
|
+
<div class="position">
|
|
1774
|
+
<mat-icon class="dragCursor" (mousedown)="dragged.emit()">reorder</mat-icon>
|
|
1775
|
+
<!-- <span>{{ index + 1 }}</span>-->
|
|
1776
|
+
</div>
|
|
1777
|
+
</td>
|
|
1778
|
+
<td *matFooterCellDef [class]="columnClasses" mat-footer-cell>
|
|
1779
|
+
<div class="position">
|
|
1780
|
+
<mat-icon class="dragCursor">reorder</mat-icon>
|
|
1781
|
+
</div>
|
|
1782
|
+
</td>
|
|
1783
|
+
</ng-container>
|
|
1784
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, MatTableModule, MatIconModule], styles: [".column .position{display:flex;align-items:center;gap:8px}.column .position .dragCursor{cursor:move}\n"] }]
|
|
1785
|
+
}] });
|
|
1786
|
+
|
|
1787
|
+
class TableInfoBarComponent {
|
|
1788
|
+
constructor(dr) {
|
|
1789
|
+
this.dr = dr;
|
|
1790
|
+
this.progress = input(false, { transform: booleanAttribute });
|
|
1791
|
+
this.hasMore = input(false, { transform: booleanAttribute });
|
|
1792
|
+
this.hasLoad = input(false, { transform: booleanAttribute });
|
|
1793
|
+
this.isPreload = input(false, { transform: booleanAttribute });
|
|
1794
|
+
this.noDownload = input(false, { transform: booleanAttribute });
|
|
1795
|
+
this.noToolbar = input(false, { transform: booleanAttribute });
|
|
1796
|
+
this.dataProgress = input(false, { transform: booleanAttribute });
|
|
1797
|
+
this.columns = input([]);
|
|
1798
|
+
this.size = input(0, { transform: numberAttribute });
|
|
1799
|
+
this.preloadSize = input(0, { transform: numberAttribute });
|
|
1800
|
+
this.count = input(undefined);
|
|
1801
|
+
this.filteredCount = input(0);
|
|
1802
|
+
this.selectedCount = input(0);
|
|
1803
|
+
this.filter = input('');
|
|
1804
|
+
this.standaloneFilter = input(false, { transform: booleanAttribute });
|
|
1805
|
+
this.hasInputs = input(false, { transform: booleanAttribute });
|
|
1806
|
+
this.filterChange = output();
|
|
1807
|
+
this.filterControl = new FormControl('', { nonNullable: true });
|
|
1808
|
+
this.downloadCsv = output();
|
|
1809
|
+
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
1810
|
+
this.load = output();
|
|
1811
|
+
this.preload = output();
|
|
1812
|
+
this.countText = computed(() => this.count()
|
|
1813
|
+
? (this.filter() && this.filteredCount() !== this.count()
|
|
1814
|
+
? this.filteredCount() + '/'
|
|
1815
|
+
: '') +
|
|
1816
|
+
(this.hasMore() ? '>' : '') +
|
|
1817
|
+
this.count()
|
|
1818
|
+
: this.progress() || this.count() !== 0
|
|
1819
|
+
? '...'
|
|
1820
|
+
: '0');
|
|
1821
|
+
}
|
|
1822
|
+
ngOnInit() {
|
|
1823
|
+
this.filterControl.valueChanges.pipe(takeUntilDestroyed(this.dr)).subscribe((v) => {
|
|
1824
|
+
this.filterChange.emit(v);
|
|
1825
|
+
});
|
|
1826
|
+
}
|
|
1827
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TableInfoBarComponent, deps: [{ token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1828
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: TableInfoBarComponent, isStandalone: false, selector: "v-table-info-bar", inputs: { progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null }, hasMore: { classPropertyName: "hasMore", publicName: "hasMore", isSignal: true, isRequired: false, transformFunction: null }, hasLoad: { classPropertyName: "hasLoad", publicName: "hasLoad", isSignal: true, isRequired: false, transformFunction: null }, isPreload: { classPropertyName: "isPreload", publicName: "isPreload", isSignal: true, isRequired: false, transformFunction: null }, noDownload: { classPropertyName: "noDownload", publicName: "noDownload", isSignal: true, isRequired: false, transformFunction: null }, noToolbar: { classPropertyName: "noToolbar", publicName: "noToolbar", isSignal: true, isRequired: false, transformFunction: null }, dataProgress: { classPropertyName: "dataProgress", publicName: "dataProgress", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, preloadSize: { classPropertyName: "preloadSize", publicName: "preloadSize", isSignal: true, isRequired: false, transformFunction: null }, count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, filteredCount: { classPropertyName: "filteredCount", publicName: "filteredCount", isSignal: true, isRequired: false, transformFunction: null }, selectedCount: { classPropertyName: "selectedCount", publicName: "selectedCount", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, standaloneFilter: { classPropertyName: "standaloneFilter", publicName: "standaloneFilter", isSignal: true, isRequired: false, transformFunction: null }, hasInputs: { classPropertyName: "hasInputs", publicName: "hasInputs", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterChange: "filterChange", downloadCsv: "downloadCsv", load: "load", preload: "preload" }, ngImport: i0, template: "<div class=\"wrapper\">\n @if (standaloneFilter()) {\n <div class=\"header-wrapper\">\n @if (hasInputs()) {\n <ng-content select=\"v-table-inputs\"></ng-content>\n }\n <v-input-field\n [formControl]=\"filterControl\"\n class=\"filter__standalone filter\"\n cleanButton\n label=\"Search\"\n ></v-input-field>\n </div>\n }\n <v-actions>\n <v-actions>\n @if (!noToolbar()) {\n @if (!standaloneFilter()) {\n <div>\n <v-input-field\n [formControl]=\"filterControl\"\n appearance=\"outline\"\n class=\"filter filter__extended\"\n cleanButton\n icon=\"manage_search\"\n label=\"Search\"\n size=\"small\"\n ></v-input-field>\n </div>\n }\n <div class=\"details\">\n @if (hasLoad() || hasMore()) {\n <button\n [disabled]=\"progress() || !hasMore()\"\n mat-icon-button\n matTooltip=\"Preload {{ preloadSize() }}{{\n isPreload() && hasMore() ? ' more' : ''\n }} elements\"\n (click)=\"preload.emit()\"\n >\n <mat-icon>\n {{\n hasMore()\n ? isPreload()\n ? 'downloading'\n : 'download'\n : 'download_done'\n }}\n </mat-icon>\n </button>\n }\n @if (!noDownload()) {\n <button\n [disabled]=\"progress() || !count()\"\n mat-icon-button\n matTooltip=\"Download CSV\"\n (click)=\"downloadCsv.emit()\"\n >\n <mat-icon>file_save</mat-icon>\n </button>\n }\n <!-- <button mat-icon-button matTooltip=\"Customize table\" (click)=\"tune()\">\n <mat-icon>tune</mat-icon>\n </button> -->\n </div>\n }\n <div\n [matBadge]=\"selectedCount() || ''\"\n [matBadgeDisabled]=\"progress() || dataProgress()\"\n [matTooltip]=\"\n dataProgress()\n ? 'Preparing data for sorting, filtering and downloading...'\n : progress()\n ? 'Loading...'\n : 'Reload ' + size() + ' elements'\n \"\n class=\"count\"\n (click)=\"hasLoad() ? load.emit() : undefined\"\n >\n <v-tag\n [icon]=\"hasLoad() ? 'refresh' : undefined\"\n [progress]=\"progress() || dataProgress()\"\n >\n {{ countText() }}\n </v-tag>\n </div>\n </v-actions>\n <v-actions>\n <ng-content></ng-content>\n </v-actions>\n </v-actions>\n</div>\n", styles: [".wrapper{display:flex;flex-direction:column;gap:8px}.inputs{display:none}.inputs:not(:empty){display:block}.header-wrapper{display:flex;gap:16px}::ng-deep .header-wrapper>*{flex:1}.details{display:flex;align-items:center}.details ::ng-deep button{margin:-6px 0}.count{align-self:anchor-center}.filter__extended{max-width:200px}.filter ::ng-deep .mat-mdc-form-field-subscript-wrapper{height:0}\n"], dependencies: [{ kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i2$5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: i1$4.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: InputFieldComponent, selector: "v-input-field", inputs: ["label", "placeholder", "type", "appearance", "size", "cleanButton", "icon"] }, { kind: "component", type: ActionsComponent, selector: "v-actions" }, { kind: "directive", type: i6.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: TagComponent, selector: "v-tag", inputs: ["color", "icon", "progress"] }] }); }
|
|
1829
|
+
}
|
|
1830
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TableInfoBarComponent, decorators: [{
|
|
1831
|
+
type: Component,
|
|
1832
|
+
args: [{ selector: 'v-table-info-bar', standalone: false, template: "<div class=\"wrapper\">\n @if (standaloneFilter()) {\n <div class=\"header-wrapper\">\n @if (hasInputs()) {\n <ng-content select=\"v-table-inputs\"></ng-content>\n }\n <v-input-field\n [formControl]=\"filterControl\"\n class=\"filter__standalone filter\"\n cleanButton\n label=\"Search\"\n ></v-input-field>\n </div>\n }\n <v-actions>\n <v-actions>\n @if (!noToolbar()) {\n @if (!standaloneFilter()) {\n <div>\n <v-input-field\n [formControl]=\"filterControl\"\n appearance=\"outline\"\n class=\"filter filter__extended\"\n cleanButton\n icon=\"manage_search\"\n label=\"Search\"\n size=\"small\"\n ></v-input-field>\n </div>\n }\n <div class=\"details\">\n @if (hasLoad() || hasMore()) {\n <button\n [disabled]=\"progress() || !hasMore()\"\n mat-icon-button\n matTooltip=\"Preload {{ preloadSize() }}{{\n isPreload() && hasMore() ? ' more' : ''\n }} elements\"\n (click)=\"preload.emit()\"\n >\n <mat-icon>\n {{\n hasMore()\n ? isPreload()\n ? 'downloading'\n : 'download'\n : 'download_done'\n }}\n </mat-icon>\n </button>\n }\n @if (!noDownload()) {\n <button\n [disabled]=\"progress() || !count()\"\n mat-icon-button\n matTooltip=\"Download CSV\"\n (click)=\"downloadCsv.emit()\"\n >\n <mat-icon>file_save</mat-icon>\n </button>\n }\n <!-- <button mat-icon-button matTooltip=\"Customize table\" (click)=\"tune()\">\n <mat-icon>tune</mat-icon>\n </button> -->\n </div>\n }\n <div\n [matBadge]=\"selectedCount() || ''\"\n [matBadgeDisabled]=\"progress() || dataProgress()\"\n [matTooltip]=\"\n dataProgress()\n ? 'Preparing data for sorting, filtering and downloading...'\n : progress()\n ? 'Loading...'\n : 'Reload ' + size() + ' elements'\n \"\n class=\"count\"\n (click)=\"hasLoad() ? load.emit() : undefined\"\n >\n <v-tag\n [icon]=\"hasLoad() ? 'refresh' : undefined\"\n [progress]=\"progress() || dataProgress()\"\n >\n {{ countText() }}\n </v-tag>\n </div>\n </v-actions>\n <v-actions>\n <ng-content></ng-content>\n </v-actions>\n </v-actions>\n</div>\n", styles: [".wrapper{display:flex;flex-direction:column;gap:8px}.inputs{display:none}.inputs:not(:empty){display:block}.header-wrapper{display:flex;gap:16px}::ng-deep .header-wrapper>*{flex:1}.details{display:flex;align-items:center}.details ::ng-deep button{margin:-6px 0}.count{align-self:anchor-center}.filter__extended{max-width:200px}.filter ::ng-deep .mat-mdc-form-field-subscript-wrapper{height:0}\n"] }]
|
|
1833
|
+
}], ctorParameters: () => [{ type: i0.DestroyRef }] });
|
|
1834
|
+
|
|
1835
|
+
class TableComponent {
|
|
1836
|
+
constructor(dr, injector, cdr) {
|
|
1837
|
+
this.dr = dr;
|
|
1838
|
+
this.injector = injector;
|
|
1839
|
+
this.cdr = cdr;
|
|
1840
|
+
this.data = input([], { transform: arrayAttribute });
|
|
1841
|
+
this.treeData = input();
|
|
1842
|
+
this.columns = input([], {
|
|
1843
|
+
transform: arrayAttribute,
|
|
1844
|
+
});
|
|
1845
|
+
this.progress = input(false, { transform: Boolean });
|
|
1846
|
+
this.hasMore = input(false, { transform: booleanAttribute });
|
|
1847
|
+
this.size = input(25, { transform: numberAttribute });
|
|
1848
|
+
this.maxSize = input(1000, { transform: numberAttribute });
|
|
1849
|
+
this.noDownload = input(false, { transform: booleanAttribute });
|
|
1850
|
+
this.noToolbar = input(false, { transform: booleanAttribute });
|
|
1851
|
+
// Filter
|
|
1852
|
+
this.filter = model('');
|
|
1853
|
+
this.filter$ = toObservable(this.filter).pipe(map((v) => (v || '').trim()), distinctUntilChanged(), debounceTime$1(DEBOUNCE_TIME_MS), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
1854
|
+
this.standaloneFilter = input(false, { transform: booleanAttribute });
|
|
1855
|
+
this.externalFilter = input(false, { transform: booleanAttribute });
|
|
1856
|
+
this.filteredSortData$ = new BehaviorSubject(null);
|
|
1857
|
+
this.displayedData$ = combineLatest([
|
|
1858
|
+
defer(() => this.dataSource.data$),
|
|
1859
|
+
this.filteredSortData$.pipe(distinctUntilChanged()),
|
|
1860
|
+
defer(() => this.columnsDataProgress$),
|
|
1861
|
+
]).pipe(map(([data, filteredSortData, columnsDataProgress]) => (filteredSortData && !columnsDataProgress ? filteredSortData : data) || []), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
1862
|
+
this.displayedCount$ = this.displayedData$.pipe(map((data) => data.length), distinctUntilChanged(), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
1863
|
+
// Select
|
|
1864
|
+
this.rowSelectable = input(false, { transform: booleanAttribute });
|
|
1865
|
+
this.rowSelected = model([]);
|
|
1866
|
+
// Sort
|
|
1867
|
+
this.sort = model(DEFAULT_SORT);
|
|
1868
|
+
// Drag & drop
|
|
1869
|
+
this.rowDragDrop = input(false, {
|
|
1870
|
+
transform: (v) => {
|
|
1871
|
+
if (Array.isArray(v)) {
|
|
1872
|
+
return v;
|
|
1873
|
+
}
|
|
1874
|
+
return booleanAttribute(v);
|
|
1875
|
+
},
|
|
1876
|
+
});
|
|
1877
|
+
this.rowDropped = output();
|
|
1878
|
+
this.dragDisabled = true;
|
|
1879
|
+
this.update$ = new Subject();
|
|
1880
|
+
this.update = outputFromObservable(this.update$);
|
|
1881
|
+
this.more = output();
|
|
1882
|
+
this.loadedLazyItems = new WeakMap();
|
|
1883
|
+
this.dataSource = new TableDataSource();
|
|
1884
|
+
this.normColumns = computed(() => this.columns().map((c) => new NormColumn(c)));
|
|
1885
|
+
this.displayedNormColumns$ = toObservable(this.normColumns).pipe(switchMap((cols) => combineLatest(cols.map((c) => c.hidden)).pipe(map((c) => cols.filter((_, idx) => !c[idx])))), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
1886
|
+
this.columnsData$$ = combineLatest({
|
|
1887
|
+
isTree: this.dataSource.isTreeData$,
|
|
1888
|
+
data: this.dataSource.data$,
|
|
1889
|
+
cols: toObservable(this.normColumns),
|
|
1890
|
+
}).pipe(toObservableColumnsData, shareReplay({ refCount: true, bufferSize: 1 }));
|
|
1891
|
+
this.columnsDataProgress$ = new BehaviorSubject(false);
|
|
1892
|
+
this.columnsData$ = this.columnsData$$.pipe(tap(() => {
|
|
1893
|
+
this.columnsDataProgress$.next(true);
|
|
1894
|
+
}), toColumnsData, tap(() => {
|
|
1895
|
+
this.columnsDataProgress$.next(false);
|
|
1896
|
+
}), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
1897
|
+
this.isPreload = signal(false);
|
|
1898
|
+
this.loadSize = computed(() => (this.isPreload() ? this.maxSize() : this.size()));
|
|
1899
|
+
this.hasAutoShowMore$ = combineLatest([
|
|
1900
|
+
toObservable(this.hasMore),
|
|
1901
|
+
this.dataSource.data$.pipe(map((d) => d?.length)),
|
|
1902
|
+
this.displayedCount$,
|
|
1903
|
+
this.dataSource.paginator.page.pipe(startWith(null), map(() => this.dataSource.paginator.pageSize)),
|
|
1904
|
+
]).pipe(map(([hasMore, dataCount, displayedDataCount, size]) => (hasMore && displayedDataCount !== 0 && displayedDataCount >= dataCount) ||
|
|
1905
|
+
displayedDataCount > size), distinctUntilChanged(), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
1906
|
+
this.displayedColumns$ = combineLatest([
|
|
1907
|
+
this.displayedNormColumns$,
|
|
1908
|
+
toObservable(this.rowSelectable),
|
|
1909
|
+
toObservable(this.sort),
|
|
1910
|
+
toObservable(this.rowDragDrop),
|
|
1911
|
+
]).pipe(map(([normColumns, rowSelectable, sort, rowDragDrop]) => [
|
|
1912
|
+
...((Array.isArray(rowDragDrop)
|
|
1913
|
+
? sort?.direction && rowDragDrop.includes(sort?.active)
|
|
1914
|
+
: rowDragDrop)
|
|
1915
|
+
? [this.columnDefs.drag]
|
|
1916
|
+
: []),
|
|
1917
|
+
...(rowSelectable ? [this.columnDefs.select] : []),
|
|
1918
|
+
...normColumns.map((c) => c.field),
|
|
1919
|
+
]), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
1920
|
+
this.columnDefs = COLUMN_DEFS;
|
|
1921
|
+
}
|
|
1922
|
+
ngOnInit() {
|
|
1923
|
+
const sort$ = toObservable(this.sort, { injector: this.injector }).pipe(distinctUntilChanged(), share());
|
|
1924
|
+
toObservable(this.data, { injector: this.injector })
|
|
1925
|
+
.pipe(filter(Boolean), takeUntilDestroyed(this.dr))
|
|
1926
|
+
.subscribe((data) => {
|
|
1927
|
+
this.dataSource.setData(data);
|
|
1928
|
+
});
|
|
1929
|
+
toObservable(this.treeData, { injector: this.injector })
|
|
1930
|
+
.pipe(filter(Boolean), takeUntilDestroyed(this.dr))
|
|
1931
|
+
.subscribe((data) => {
|
|
1932
|
+
this.dataSource.setTreeData(data);
|
|
1933
|
+
});
|
|
1934
|
+
combineLatest([
|
|
1935
|
+
this.filter$,
|
|
1936
|
+
sort$,
|
|
1937
|
+
this.dataSource.data$,
|
|
1938
|
+
runInInjectionContext(this.injector, () => this.columnsData$.pipe(columnsDataToFilterSearchData)),
|
|
1939
|
+
this.dataSource.isTreeData$,
|
|
1940
|
+
toObservable(this.normColumns, { injector: this.injector }),
|
|
1941
|
+
toObservable(this.externalFilter, { injector: this.injector }),
|
|
1942
|
+
])
|
|
1943
|
+
.pipe(map(([search, sort, source, data, isTreeData, columns, isExternalFilter]) => {
|
|
1944
|
+
if (isTreeData) {
|
|
1945
|
+
return source;
|
|
1946
|
+
}
|
|
1947
|
+
const filteredData = !isExternalFilter && search ? filterData(data, search) : source;
|
|
1948
|
+
return sortData(filteredData, data, columns, sort);
|
|
1949
|
+
}), takeUntilDestroyed(this.dr))
|
|
1950
|
+
.subscribe((filtered) => {
|
|
1951
|
+
this.updateSortFilter(filtered);
|
|
1952
|
+
this.updateLoadedLazyItems(filtered);
|
|
1953
|
+
this.cdr.markForCheck();
|
|
1954
|
+
});
|
|
1955
|
+
merge(this.filter$.pipe(filter(Boolean)), toObservable(this.hasMore, { injector: this.injector }).pipe(filter(Boolean)))
|
|
1956
|
+
.pipe(takeUntilDestroyed(this.dr))
|
|
1957
|
+
.subscribe(() => {
|
|
1958
|
+
this.sort.set(DEFAULT_SORT);
|
|
1959
|
+
});
|
|
1960
|
+
merge(this.filter$, sort$)
|
|
1961
|
+
.pipe(takeUntilDestroyed(this.dr))
|
|
1962
|
+
.subscribe(() => {
|
|
1963
|
+
this.reset();
|
|
1964
|
+
});
|
|
1965
|
+
// TODO: 2, 3 column is torn away from the previous one, fixed by calling update
|
|
1966
|
+
this.dataSource.data$
|
|
1967
|
+
.pipe(filter((v) => !!v?.length), first$1(), delay(100), takeUntilDestroyed(this.dr))
|
|
1968
|
+
.subscribe(() => {
|
|
1969
|
+
this.table.updateStickyColumnStyles();
|
|
1970
|
+
});
|
|
1971
|
+
}
|
|
1972
|
+
load() {
|
|
1973
|
+
if (this.isPreload()) {
|
|
1974
|
+
this.isPreload.set(false);
|
|
1975
|
+
}
|
|
1976
|
+
this.reload();
|
|
1977
|
+
}
|
|
1978
|
+
preload() {
|
|
1979
|
+
if (!this.isPreload()) {
|
|
1980
|
+
this.isPreload.set(true);
|
|
1981
|
+
this.reload();
|
|
1982
|
+
}
|
|
1983
|
+
else if (this.hasMore()) {
|
|
1984
|
+
this.more.emit({ size: this.loadSize() });
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
showMore() {
|
|
1988
|
+
this.dataSource.paginator.more();
|
|
1989
|
+
if (this.hasMore() && this.dataSource.paginator.pageSize > this.dataSource.data.length) {
|
|
1990
|
+
this.more.emit({ size: this.loadSize() });
|
|
1991
|
+
}
|
|
1992
|
+
this.refreshTable();
|
|
1993
|
+
}
|
|
1994
|
+
downloadCsv() {
|
|
1995
|
+
this.generateCsvData()
|
|
1996
|
+
.pipe(takeUntilDestroyed(this.dr))
|
|
1997
|
+
.subscribe((csvData) => {
|
|
1998
|
+
downloadFile(csvData, 'csv');
|
|
1999
|
+
});
|
|
2000
|
+
}
|
|
2001
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2002
|
+
drop(event) {
|
|
2003
|
+
this.dragDisabled = true;
|
|
2004
|
+
this.filteredSortData$.pipe(filter(Boolean), first$1()).subscribe((data) => {
|
|
2005
|
+
const item = event.item.data;
|
|
2006
|
+
const { previousIndex, currentIndex } = event;
|
|
2007
|
+
const previousData = data;
|
|
2008
|
+
const currentData = previousData.slice();
|
|
2009
|
+
let currentDataIndex = 0;
|
|
2010
|
+
if (previousIndex > currentIndex) {
|
|
2011
|
+
currentData.splice(previousIndex, 1);
|
|
2012
|
+
currentData.splice(currentIndex, 0, event.item.data);
|
|
2013
|
+
currentDataIndex = currentIndex;
|
|
2014
|
+
}
|
|
2015
|
+
else {
|
|
2016
|
+
currentData.splice(currentIndex, 0, event.item.data);
|
|
2017
|
+
currentData.splice(previousIndex, 1);
|
|
2018
|
+
currentDataIndex = currentIndex - 1;
|
|
2019
|
+
}
|
|
2020
|
+
this.rowDropped.emit({
|
|
2021
|
+
previousIndex,
|
|
2022
|
+
currentIndex,
|
|
2023
|
+
item,
|
|
2024
|
+
previousData,
|
|
2025
|
+
currentData,
|
|
2026
|
+
currentDataIndex,
|
|
2027
|
+
sort: this?.sortComponent,
|
|
2028
|
+
});
|
|
2029
|
+
});
|
|
2030
|
+
}
|
|
2031
|
+
generateCsvData() {
|
|
2032
|
+
return combineLatest([
|
|
2033
|
+
this.displayedNormColumns$.pipe(switchMap((cols) => forkJoin(cols.map((c) => c.header.pipe(take(1)))))),
|
|
2034
|
+
this.columnsData$.pipe(take(1)),
|
|
2035
|
+
]).pipe(map(([cols, data]) => createCsv(runInInjectionContext(this.injector, () => tableToCsvObject(cols, data)))));
|
|
2036
|
+
}
|
|
2037
|
+
reload() {
|
|
2038
|
+
this.update$.next({ size: this.loadSize() });
|
|
2039
|
+
this.reset();
|
|
2040
|
+
}
|
|
2041
|
+
updateSortFilter(filtered) {
|
|
2042
|
+
this.filteredSortData$.next(filtered);
|
|
2043
|
+
this.dataSource.sortData = () => filtered;
|
|
2044
|
+
this.dataSource.sort = this.sortComponent;
|
|
2045
|
+
}
|
|
2046
|
+
reset() {
|
|
2047
|
+
this.scrollViewport?.nativeElement?.scrollTo?.({ top: 0 });
|
|
2048
|
+
this.dataSource.paginator.reload();
|
|
2049
|
+
this.refreshTable();
|
|
2050
|
+
}
|
|
2051
|
+
// TODO: Refresh table when pagination is updated
|
|
2052
|
+
refreshTable() {
|
|
2053
|
+
// eslint-disable-next-line no-self-assign
|
|
2054
|
+
this.dataSource.data = this.dataSource.data;
|
|
2055
|
+
}
|
|
2056
|
+
updateLoadedLazyItems(items) {
|
|
2057
|
+
const lazyLoadedItems = items.slice(0, DEFAULT_LOADED_LAZY_ROWS_COUNT);
|
|
2058
|
+
for (const item of lazyLoadedItems) {
|
|
2059
|
+
this.loadedLazyItems.set(item, true);
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TableComponent, deps: [{ token: i0.DestroyRef }, { token: i0.Injector }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2063
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: TableComponent, isStandalone: false, selector: "v-table", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, treeData: { classPropertyName: "treeData", publicName: "treeData", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null }, hasMore: { classPropertyName: "hasMore", publicName: "hasMore", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null }, noDownload: { classPropertyName: "noDownload", publicName: "noDownload", isSignal: true, isRequired: false, transformFunction: null }, noToolbar: { classPropertyName: "noToolbar", publicName: "noToolbar", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, standaloneFilter: { classPropertyName: "standaloneFilter", publicName: "standaloneFilter", isSignal: true, isRequired: false, transformFunction: null }, externalFilter: { classPropertyName: "externalFilter", publicName: "externalFilter", isSignal: true, isRequired: false, transformFunction: null }, rowSelectable: { classPropertyName: "rowSelectable", publicName: "rowSelectable", isSignal: true, isRequired: false, transformFunction: null }, rowSelected: { classPropertyName: "rowSelected", publicName: "rowSelected", isSignal: true, isRequired: false, transformFunction: null }, sort: { classPropertyName: "sort", publicName: "sort", isSignal: true, isRequired: false, transformFunction: null }, rowDragDrop: { classPropertyName: "rowDragDrop", publicName: "rowDragDrop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filter: "filterChange", rowSelected: "rowSelectedChange", sort: "sortChange", rowDropped: "rowDropped", update: "update", more: "more" }, queries: [{ propertyName: "tableInputsContent", first: true, predicate: TableInputsComponent, descendants: true, read: ElementRef }], viewQueries: [{ propertyName: "sortComponent", first: true, predicate: MatSort, descendants: true }, { propertyName: "scrollViewport", first: true, predicate: ["scrollViewport"], descendants: true, read: ElementRef }, { propertyName: "table", first: true, predicate: ["matTable"], descendants: true }, { propertyName: "tableRow", first: true, predicate: MatRow, descendants: true }], ngImport: i0, template: "@let columnsData = columnsData$$ | async;\n\n<div class=\"wrapper\">\n <v-table-info-bar\n [(filter)]=\"filter\"\n [columns]=\"normColumns()\"\n [count]=\"(dataSource.data$ | async)?.length\"\n [dataProgress]=\"!!(columnsDataProgress$ | async) && !hasMore()\"\n [filteredCount]=\"displayedCount$ | async\"\n [hasInputs]=\"!!tableInputsContent?.nativeElement\"\n [hasLoad]=\"update$.observed\"\n [hasMore]=\"hasMore()\"\n [isPreload]=\"isPreload()\"\n [noDownload]=\"noDownload()\"\n [noToolbar]=\"noToolbar()\"\n [preloadSize]=\"maxSize()\"\n [progress]=\"progress()\"\n [selectedCount]=\"rowSelected()?.length\"\n [size]=\"size()\"\n [standaloneFilter]=\"standaloneFilter()\"\n (downloadCsv)=\"downloadCsv()\"\n (load)=\"load()\"\n (preload)=\"preload()\"\n >\n <ng-content select=\"v-table-actions\"></ng-content>\n <v-table-inputs><ng-content select=\"v-table-inputs\"></ng-content></v-table-inputs>\n </v-table-info-bar>\n <mat-card #scrollViewport class=\"card\">\n <v-no-records\n [noRecords]=\"!(displayedCount$ | async)\"\n [progress]=\"progress()\"\n ></v-no-records>\n <table\n #matTable\n [cdkDropListDisabled]=\"dragDisabled\"\n [dataSource]=\"dataSource\"\n [matSortActive]=\"(columnsDataProgress$ | async) || progress() ? '' : sort().active\"\n [matSortDirection]=\"sort().direction\"\n cdkDropList\n cdkDropListData=\"dataSource\"\n mat-table\n matSort\n (cdkDropListDropped)=\"drop($event)\"\n (matSortChange)=\"sort.set($event)\"\n >\n @let displayedColumns = (displayedColumns$ | async) || [];\n\n @if (displayedColumns.includes(columnDefs.drag)) {\n <v-dnd-column\n [name]=\"columnDefs.drag\"\n (dragged)=\"dragDisabled = false\"\n ></v-dnd-column>\n }\n @if (displayedColumns.includes(columnDefs.select)) {\n <v-select-column\n [(selected)]=\"rowSelected\"\n [data]=\"displayedData$ | async\"\n [name]=\"columnDefs.select\"\n [progress]=\"progress()\"\n ></v-select-column>\n }\n @for (col of displayedNormColumns$ | async; track col; let colIndex = $index) {\n @let stickyStart = col.params.sticky === 'start';\n @let stickyEnd = col.params.sticky === 'end';\n @let columnClasses =\n {\n column: true,\n 'column__sticky-start': stickyStart,\n 'column__sticky-end': stickyEnd,\n };\n <ng-container\n [matColumnDef]=\"col.field\"\n [sticky]=\"stickyStart\"\n [stickyEnd]=\"stickyEnd\"\n >\n <th\n *matHeaderCellDef\n [disabled]=\"(col.sort | async) === false || hasMore() || progress()\"\n [mat-sort-header]=\"col.field\"\n [ngClass]=\"columnClasses\"\n mat-header-cell\n >\n <v-value [value]=\"col?.header | async\" emptySymbol=\"\" inline></v-value>\n </th>\n\n <ng-template let-element let-rowIndex=\"index\" matCellDef>\n @let cell = columnsData?.get?.(element)?.get(col);\n <td\n [ngClass]=\"columnClasses\"\n [ngStyle]=\"col?.params?.style\"\n [style.border-bottom]=\"cell?.isNextChild && !col.child ? 'none' : ''\"\n mat-cell\n >\n <v-value\n [emptySymbol]=\"!(cell?.isChild && !col?.child)\"\n [highlight]=\"filter$ | async\"\n [lazyValue]=\"cell?.lazyValue\"\n [lazyVisible]=\"loadedLazyItems.has(element)\"\n [value]=\"cell?.value | async\"\n inline\n (lazyVisibleChange)=\"loadedLazyItems.set(element, true)\"\n ></v-value>\n </td>\n </ng-template>\n <td *matFooterCellDef [ngClass]=\"columnClasses\" mat-footer-cell>\n <v-content-loading></v-content-loading>\n </td>\n </ng-container>\n }\n\n <tr *matHeaderRowDef=\"displayedColumns$ | async; sticky: true\" mat-header-row></tr>\n <tr\n *matRowDef=\"let row; columns: displayedColumns$ | async\"\n [cdkDragData]=\"row\"\n cdkDrag\n mat-row\n ></tr>\n <tr\n *matFooterRowDef=\"displayedColumns$ | async\"\n [ngClass]=\"{ row__hidden: !(hasAutoShowMore$ | async) || !tableRow }\"\n [vInfinityScroll]=\"!progress()\"\n mat-footer-row\n (vInfinityScrollMore)=\"showMore()\"\n ></tr>\n </table>\n </mat-card>\n</div>\n", styles: [":host{min-height:0}.wrapper{display:grid;grid-template-columns:1fr;grid-template-rows:max-content;gap:24px;height:100%}.wrapper .card{width:100%;height:100%;min-height:300px;overflow:auto;transform:translateZ(0)}.wrapper .card ::ng-deep .mdc-data-table__row:last-child .mat-mdc-cell{border-bottom-color:var(--mat-table-row-item-outline-color, rgba(0, 0, 0, .12))!important;border-bottom-width:var(--mat-table-row-item-outline-width, 1px)!important;border-bottom-style:solid!important}table ::ng-deep .cdk-drag-placeholder,::ng-deep .cdk-drag-preview ::ng-deep .cdk-drag-placeholder{background:#eee}table .column,::ng-deep .cdk-drag-preview .column{max-width:max(20px,30vw)}table .column__sticky-start,table .column__sticky-end,::ng-deep .cdk-drag-preview .column__sticky-start,::ng-deep .cdk-drag-preview .column__sticky-end{width:0}table .column__sticky-start,::ng-deep .cdk-drag-preview .column__sticky-start{border-right:1px solid}table .column__sticky-end,::ng-deep .cdk-drag-preview .column__sticky-end{border-left:1px solid}table .row__hidden,::ng-deep .cdk-drag-preview .row__hidden{display:none}::ng-deep .cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;background:#fff!important;display:flex!important;align-items:center}::ng-deep .cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}::ng-deep .cdk-drop-list-dragging ::ng-deep .mat-mdc-row:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}::ng-deep .cdk-drag-preview ::ng-deep td{border:none!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i2$4.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i2$4.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2$4.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i2$4.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2$4.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2$4.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i2$4.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2$4.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i2$4.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2$4.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i2$4.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i2$4.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i2$4.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i2$4.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "component", type: i4.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: ValueComponent, selector: "v-value", inputs: ["value", "lazyValue", "lazyVisible", "progress", "inline", "emptySymbol", "highlight"], outputs: ["lazyVisibleChange"] }, { kind: "component", type: NoRecordsComponent, selector: "v-no-records", inputs: ["noRecords", "progress"] }, { kind: "component", type: ContentLoadingComponent, selector: "v-content-loading", inputs: ["width", "textSize", "hiddenText"] }, { kind: "directive", type: InfinityScrollDirective, selector: "[vInfinityScroll]", inputs: ["vInfinityScroll"], outputs: ["vInfinityScrollMore"] }, { kind: "component", type: SelectColumnComponent, selector: "v-select-column", inputs: ["selected", "data", "progress"], outputs: ["selectedChange"] }, { kind: "directive", type: i9.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i9.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i10.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i10.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "component", type: DndColumnComponent, selector: "v-dnd-column", outputs: ["dragged"] }, { kind: "component", type: TableInfoBarComponent, selector: "v-table-info-bar", inputs: ["progress", "hasMore", "hasLoad", "isPreload", "noDownload", "noToolbar", "dataProgress", "columns", "size", "preloadSize", "count", "filteredCount", "selectedCount", "filter", "standaloneFilter", "hasInputs"], outputs: ["filterChange", "downloadCsv", "load", "preload"] }, { kind: "component", type: TableInputsComponent, selector: "v-table-inputs" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2064
|
+
}
|
|
2065
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TableComponent, decorators: [{
|
|
2066
|
+
type: Component,
|
|
2067
|
+
args: [{ selector: 'v-table', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "@let columnsData = columnsData$$ | async;\n\n<div class=\"wrapper\">\n <v-table-info-bar\n [(filter)]=\"filter\"\n [columns]=\"normColumns()\"\n [count]=\"(dataSource.data$ | async)?.length\"\n [dataProgress]=\"!!(columnsDataProgress$ | async) && !hasMore()\"\n [filteredCount]=\"displayedCount$ | async\"\n [hasInputs]=\"!!tableInputsContent?.nativeElement\"\n [hasLoad]=\"update$.observed\"\n [hasMore]=\"hasMore()\"\n [isPreload]=\"isPreload()\"\n [noDownload]=\"noDownload()\"\n [noToolbar]=\"noToolbar()\"\n [preloadSize]=\"maxSize()\"\n [progress]=\"progress()\"\n [selectedCount]=\"rowSelected()?.length\"\n [size]=\"size()\"\n [standaloneFilter]=\"standaloneFilter()\"\n (downloadCsv)=\"downloadCsv()\"\n (load)=\"load()\"\n (preload)=\"preload()\"\n >\n <ng-content select=\"v-table-actions\"></ng-content>\n <v-table-inputs><ng-content select=\"v-table-inputs\"></ng-content></v-table-inputs>\n </v-table-info-bar>\n <mat-card #scrollViewport class=\"card\">\n <v-no-records\n [noRecords]=\"!(displayedCount$ | async)\"\n [progress]=\"progress()\"\n ></v-no-records>\n <table\n #matTable\n [cdkDropListDisabled]=\"dragDisabled\"\n [dataSource]=\"dataSource\"\n [matSortActive]=\"(columnsDataProgress$ | async) || progress() ? '' : sort().active\"\n [matSortDirection]=\"sort().direction\"\n cdkDropList\n cdkDropListData=\"dataSource\"\n mat-table\n matSort\n (cdkDropListDropped)=\"drop($event)\"\n (matSortChange)=\"sort.set($event)\"\n >\n @let displayedColumns = (displayedColumns$ | async) || [];\n\n @if (displayedColumns.includes(columnDefs.drag)) {\n <v-dnd-column\n [name]=\"columnDefs.drag\"\n (dragged)=\"dragDisabled = false\"\n ></v-dnd-column>\n }\n @if (displayedColumns.includes(columnDefs.select)) {\n <v-select-column\n [(selected)]=\"rowSelected\"\n [data]=\"displayedData$ | async\"\n [name]=\"columnDefs.select\"\n [progress]=\"progress()\"\n ></v-select-column>\n }\n @for (col of displayedNormColumns$ | async; track col; let colIndex = $index) {\n @let stickyStart = col.params.sticky === 'start';\n @let stickyEnd = col.params.sticky === 'end';\n @let columnClasses =\n {\n column: true,\n 'column__sticky-start': stickyStart,\n 'column__sticky-end': stickyEnd,\n };\n <ng-container\n [matColumnDef]=\"col.field\"\n [sticky]=\"stickyStart\"\n [stickyEnd]=\"stickyEnd\"\n >\n <th\n *matHeaderCellDef\n [disabled]=\"(col.sort | async) === false || hasMore() || progress()\"\n [mat-sort-header]=\"col.field\"\n [ngClass]=\"columnClasses\"\n mat-header-cell\n >\n <v-value [value]=\"col?.header | async\" emptySymbol=\"\" inline></v-value>\n </th>\n\n <ng-template let-element let-rowIndex=\"index\" matCellDef>\n @let cell = columnsData?.get?.(element)?.get(col);\n <td\n [ngClass]=\"columnClasses\"\n [ngStyle]=\"col?.params?.style\"\n [style.border-bottom]=\"cell?.isNextChild && !col.child ? 'none' : ''\"\n mat-cell\n >\n <v-value\n [emptySymbol]=\"!(cell?.isChild && !col?.child)\"\n [highlight]=\"filter$ | async\"\n [lazyValue]=\"cell?.lazyValue\"\n [lazyVisible]=\"loadedLazyItems.has(element)\"\n [value]=\"cell?.value | async\"\n inline\n (lazyVisibleChange)=\"loadedLazyItems.set(element, true)\"\n ></v-value>\n </td>\n </ng-template>\n <td *matFooterCellDef [ngClass]=\"columnClasses\" mat-footer-cell>\n <v-content-loading></v-content-loading>\n </td>\n </ng-container>\n }\n\n <tr *matHeaderRowDef=\"displayedColumns$ | async; sticky: true\" mat-header-row></tr>\n <tr\n *matRowDef=\"let row; columns: displayedColumns$ | async\"\n [cdkDragData]=\"row\"\n cdkDrag\n mat-row\n ></tr>\n <tr\n *matFooterRowDef=\"displayedColumns$ | async\"\n [ngClass]=\"{ row__hidden: !(hasAutoShowMore$ | async) || !tableRow }\"\n [vInfinityScroll]=\"!progress()\"\n mat-footer-row\n (vInfinityScrollMore)=\"showMore()\"\n ></tr>\n </table>\n </mat-card>\n</div>\n", styles: [":host{min-height:0}.wrapper{display:grid;grid-template-columns:1fr;grid-template-rows:max-content;gap:24px;height:100%}.wrapper .card{width:100%;height:100%;min-height:300px;overflow:auto;transform:translateZ(0)}.wrapper .card ::ng-deep .mdc-data-table__row:last-child .mat-mdc-cell{border-bottom-color:var(--mat-table-row-item-outline-color, rgba(0, 0, 0, .12))!important;border-bottom-width:var(--mat-table-row-item-outline-width, 1px)!important;border-bottom-style:solid!important}table ::ng-deep .cdk-drag-placeholder,::ng-deep .cdk-drag-preview ::ng-deep .cdk-drag-placeholder{background:#eee}table .column,::ng-deep .cdk-drag-preview .column{max-width:max(20px,30vw)}table .column__sticky-start,table .column__sticky-end,::ng-deep .cdk-drag-preview .column__sticky-start,::ng-deep .cdk-drag-preview .column__sticky-end{width:0}table .column__sticky-start,::ng-deep .cdk-drag-preview .column__sticky-start{border-right:1px solid}table .column__sticky-end,::ng-deep .cdk-drag-preview .column__sticky-end{border-left:1px solid}table .row__hidden,::ng-deep .cdk-drag-preview .row__hidden{display:none}::ng-deep .cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;background:#fff!important;display:flex!important;align-items:center}::ng-deep .cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}::ng-deep .cdk-drop-list-dragging ::ng-deep .mat-mdc-row:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}::ng-deep .cdk-drag-preview ::ng-deep td{border:none!important}\n"] }]
|
|
2068
|
+
}], ctorParameters: () => [{ type: i0.DestroyRef }, { type: i0.Injector }, { type: i0.ChangeDetectorRef }], propDecorators: { sortComponent: [{
|
|
2069
|
+
type: ViewChild,
|
|
2070
|
+
args: [MatSort]
|
|
2071
|
+
}], scrollViewport: [{
|
|
2072
|
+
type: ViewChild,
|
|
2073
|
+
args: ['scrollViewport', { read: ElementRef }]
|
|
2074
|
+
}], table: [{
|
|
2075
|
+
type: ViewChild,
|
|
2076
|
+
args: ['matTable', { static: false }]
|
|
2077
|
+
}], tableInputsContent: [{
|
|
2078
|
+
type: ContentChild,
|
|
2079
|
+
args: [TableInputsComponent, { read: ElementRef }]
|
|
2080
|
+
}], tableRow: [{
|
|
2081
|
+
type: ViewChild,
|
|
2082
|
+
args: [MatRow, { static: false }]
|
|
2083
|
+
}] } });
|
|
2084
|
+
|
|
2085
|
+
class CustomizeComponent extends DialogSuperclass {
|
|
2086
|
+
constructor() {
|
|
2087
|
+
super(...arguments);
|
|
2088
|
+
this.columns = [
|
|
2089
|
+
{ field: 'priority', header: 'Number' },
|
|
2090
|
+
{ field: 'name' },
|
|
2091
|
+
{ field: 'hidden' },
|
|
2092
|
+
];
|
|
2093
|
+
this.data = this.dialogData.columns.map((c, idx) => ({
|
|
2094
|
+
priority: idx + 1,
|
|
2095
|
+
name: c.field,
|
|
2096
|
+
hidden: false,
|
|
2097
|
+
}));
|
|
2098
|
+
}
|
|
2099
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: CustomizeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2100
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.6", type: CustomizeComponent, isStandalone: false, selector: "v-customize", usesInheritance: true, ngImport: i0, template: "<v-dialog title=\"Customize table\">\n <v-table [columns]=\"columns\" [data]=\"data\" [rowDragDrop]=\"['priority']\" noToolbar></v-table>\n <v-dialog-actions>\n <button mat-button>Save</button>\n </v-dialog-actions>\n</v-dialog>\n", dependencies: [{ kind: "component", type: i1$4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: DialogComponent, selector: "v-dialog", inputs: ["title", "disabled", "progress", "hasDivider", "noContent", "noActions", "noCloseButton", "fullSize"], outputs: ["cancel"] }, { kind: "component", type: DialogActionsComponent, selector: "v-dialog-actions" }, { kind: "component", type: TableComponent, selector: "v-table", inputs: ["data", "treeData", "columns", "progress", "hasMore", "size", "maxSize", "noDownload", "noToolbar", "filter", "standaloneFilter", "externalFilter", "rowSelectable", "rowSelected", "sort", "rowDragDrop"], outputs: ["filterChange", "rowSelectedChange", "sortChange", "rowDropped", "update", "more"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2101
|
+
}
|
|
2102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: CustomizeComponent, decorators: [{
|
|
2103
|
+
type: Component,
|
|
2104
|
+
args: [{ selector: 'v-customize', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<v-dialog title=\"Customize table\">\n <v-table [columns]=\"columns\" [data]=\"data\" [rowDragDrop]=\"['priority']\" noToolbar></v-table>\n <v-dialog-actions>\n <button mat-button>Save</button>\n </v-dialog-actions>\n</v-dialog>\n" }]
|
|
2105
|
+
}] });
|
|
2106
|
+
|
|
2107
|
+
class TableActionsComponent {
|
|
2108
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TableActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2109
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.6", type: TableActionsComponent, isStandalone: false, selector: "v-table-actions", ngImport: i0, template: `
|
|
2110
|
+
<v-actions>
|
|
2111
|
+
<ng-content></ng-content>
|
|
2112
|
+
</v-actions>
|
|
2113
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ActionsComponent, selector: "v-actions" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2114
|
+
}
|
|
2115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TableActionsComponent, decorators: [{
|
|
2116
|
+
type: Component,
|
|
2117
|
+
args: [{
|
|
2118
|
+
selector: 'v-table-actions',
|
|
2119
|
+
template: `
|
|
2120
|
+
<v-actions>
|
|
2121
|
+
<ng-content></ng-content>
|
|
2122
|
+
</v-actions>
|
|
2123
|
+
`,
|
|
2124
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2125
|
+
standalone: false,
|
|
2126
|
+
}]
|
|
2127
|
+
}] });
|
|
2128
|
+
|
|
2129
|
+
class TableProgressBarComponent {
|
|
2130
|
+
constructor() {
|
|
2131
|
+
this.progress = input(false, { transform: booleanAttribute });
|
|
2132
|
+
}
|
|
2133
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TableProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2134
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: TableProgressBarComponent, isStandalone: true, selector: "v-table-progress-bar", inputs: { progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
2135
|
+
@if (progress()) {
|
|
2136
|
+
<mat-progress-bar class="progress-bar" mode="indeterminate"></mat-progress-bar>
|
|
2137
|
+
}
|
|
2138
|
+
`, isInline: true, styles: [".progress-bar{position:absolute;z-index:999}\n"], dependencies: [{ kind: "component", type: MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }] }); }
|
|
2139
|
+
}
|
|
2140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TableProgressBarComponent, decorators: [{
|
|
2141
|
+
type: Component,
|
|
2142
|
+
args: [{ selector: 'v-table-progress-bar', imports: [MatProgressBar], template: `
|
|
2143
|
+
@if (progress()) {
|
|
2144
|
+
<mat-progress-bar class="progress-bar" mode="indeterminate"></mat-progress-bar>
|
|
2145
|
+
}
|
|
2146
|
+
`, styles: [".progress-bar{position:absolute;z-index:999}\n"] }]
|
|
2147
|
+
}] });
|
|
2148
|
+
|
|
2149
|
+
class TableModule {
|
|
2150
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2151
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: TableModule, declarations: [CustomizeComponent,
|
|
2152
|
+
TableComponent,
|
|
2153
|
+
TableInfoBarComponent,
|
|
2154
|
+
TableInputsComponent,
|
|
2155
|
+
TableActionsComponent], imports: [CommonModule,
|
|
2156
|
+
MatTableModule,
|
|
2157
|
+
MatCardModule,
|
|
2158
|
+
ValueComponent,
|
|
2159
|
+
TableProgressBarComponent,
|
|
2160
|
+
NoRecordsComponent,
|
|
2161
|
+
ContentLoadingComponent,
|
|
2162
|
+
MatIcon,
|
|
2163
|
+
MatTooltip,
|
|
2164
|
+
MatIconButton,
|
|
2165
|
+
InfinityScrollDirective,
|
|
2166
|
+
ValueListComponent,
|
|
2167
|
+
SelectColumnComponent,
|
|
2168
|
+
ProgressModule,
|
|
2169
|
+
MatSortModule,
|
|
2170
|
+
MatButton,
|
|
2171
|
+
CdkDrag,
|
|
2172
|
+
CdkDropList,
|
|
2173
|
+
DialogModule,
|
|
2174
|
+
MatButtonModule,
|
|
2175
|
+
InputFieldModule,
|
|
2176
|
+
ActionsModule,
|
|
2177
|
+
MatBadgeModule,
|
|
2178
|
+
ReactiveFormsModule,
|
|
2179
|
+
TagModule,
|
|
2180
|
+
DndColumnComponent], exports: [TableComponent, TableInputsComponent, TableActionsComponent] }); }
|
|
2181
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TableModule, imports: [CommonModule,
|
|
2182
|
+
MatTableModule,
|
|
2183
|
+
MatCardModule,
|
|
2184
|
+
ValueComponent,
|
|
2185
|
+
TableProgressBarComponent,
|
|
2186
|
+
ContentLoadingComponent,
|
|
2187
|
+
MatIcon,
|
|
2188
|
+
MatIconButton,
|
|
2189
|
+
ValueListComponent,
|
|
2190
|
+
SelectColumnComponent,
|
|
2191
|
+
ProgressModule,
|
|
2192
|
+
MatSortModule,
|
|
2193
|
+
MatButton,
|
|
2194
|
+
DialogModule,
|
|
2195
|
+
MatButtonModule,
|
|
2196
|
+
InputFieldModule,
|
|
2197
|
+
ActionsModule,
|
|
2198
|
+
MatBadgeModule,
|
|
2199
|
+
ReactiveFormsModule,
|
|
2200
|
+
TagModule,
|
|
2201
|
+
DndColumnComponent] }); }
|
|
2202
|
+
}
|
|
2203
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: TableModule, decorators: [{
|
|
2204
|
+
type: NgModule,
|
|
2205
|
+
args: [{
|
|
2206
|
+
imports: [
|
|
2207
|
+
CommonModule,
|
|
2208
|
+
MatTableModule,
|
|
2209
|
+
MatCardModule,
|
|
2210
|
+
ValueComponent,
|
|
2211
|
+
TableProgressBarComponent,
|
|
2212
|
+
NoRecordsComponent,
|
|
2213
|
+
ContentLoadingComponent,
|
|
2214
|
+
MatIcon,
|
|
2215
|
+
MatTooltip,
|
|
2216
|
+
MatIconButton,
|
|
2217
|
+
InfinityScrollDirective,
|
|
2218
|
+
ValueListComponent,
|
|
2219
|
+
SelectColumnComponent,
|
|
2220
|
+
ProgressModule,
|
|
2221
|
+
MatSortModule,
|
|
2222
|
+
MatButton,
|
|
2223
|
+
CdkDrag,
|
|
2224
|
+
CdkDropList,
|
|
2225
|
+
DialogModule,
|
|
2226
|
+
MatButtonModule,
|
|
2227
|
+
InputFieldModule,
|
|
2228
|
+
ActionsModule,
|
|
2229
|
+
MatBadgeModule,
|
|
2230
|
+
ReactiveFormsModule,
|
|
2231
|
+
TagModule,
|
|
2232
|
+
DndColumnComponent,
|
|
2233
|
+
],
|
|
2234
|
+
declarations: [
|
|
2235
|
+
CustomizeComponent,
|
|
2236
|
+
TableComponent,
|
|
2237
|
+
TableInfoBarComponent,
|
|
2238
|
+
TableInputsComponent,
|
|
2239
|
+
TableActionsComponent,
|
|
2240
|
+
],
|
|
2241
|
+
exports: [TableComponent, TableInputsComponent, TableActionsComponent],
|
|
2242
|
+
}]
|
|
2243
|
+
}] });
|
|
2244
|
+
|
|
2245
|
+
function correctPriorities(priorities, opts = {
|
|
2246
|
+
step: 1000,
|
|
2247
|
+
maxStep: 1000,
|
|
2248
|
+
start: 0,
|
|
2249
|
+
}) {
|
|
2250
|
+
if (!priorities.length) {
|
|
2251
|
+
return [];
|
|
2252
|
+
}
|
|
2253
|
+
const res = [opts.start];
|
|
2254
|
+
for (let i = 1; i < priorities.length; ++i) {
|
|
2255
|
+
const last = res.at(-1) ?? opts.start;
|
|
2256
|
+
if (priorities[i] === priorities[i - 1]) {
|
|
2257
|
+
res.push(last);
|
|
2258
|
+
}
|
|
2259
|
+
else if (priorities[i] <= last || priorities[i] > last + opts.maxStep) {
|
|
2260
|
+
res.push(last + opts.step);
|
|
2261
|
+
}
|
|
2262
|
+
else {
|
|
2263
|
+
res.push(priorities[i]);
|
|
2264
|
+
}
|
|
2265
|
+
}
|
|
2266
|
+
return res;
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
function createColumn(createCell, columnObject = {}) {
|
|
2270
|
+
return (getCellParams, { isLazyCell, ...column } = {}) => {
|
|
2271
|
+
const injector = inject(Injector);
|
|
2272
|
+
const field = column?.field ?? createUniqueColumnDef(column?.header);
|
|
2273
|
+
const cellKey = isLazyCell ? 'lazyCell' : 'cell';
|
|
2274
|
+
return {
|
|
2275
|
+
field,
|
|
2276
|
+
...columnObject,
|
|
2277
|
+
...column,
|
|
2278
|
+
[cellKey]: (...cellArgs) => {
|
|
2279
|
+
const cellValue$ = getPossiblyAsyncObservable(getCellParams(...cellArgs)).pipe(switchMap((cellParams) => getPossiblyAsyncObservable(runInInjectionContext(injector, () => createCell(cellParams, ...cellArgs)))));
|
|
2280
|
+
if (column[cellKey]) {
|
|
2281
|
+
const columnCellValue$ = normalizeCell(field, column[cellKey], !!column?.child)(...cellArgs);
|
|
2282
|
+
return combineLatest([cellValue$, columnCellValue$]).pipe(map(([a, b]) => Object.assign({}, a, b, { value: b?.value || a?.value })));
|
|
2283
|
+
}
|
|
2284
|
+
return cellValue$;
|
|
2285
|
+
},
|
|
2286
|
+
};
|
|
2287
|
+
};
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
const createMenuColumn = createColumn((params) => {
|
|
2291
|
+
return {
|
|
2292
|
+
type: 'menu',
|
|
2293
|
+
params,
|
|
2294
|
+
};
|
|
2295
|
+
}, {
|
|
2296
|
+
field: 'menu',
|
|
2297
|
+
header: '',
|
|
2298
|
+
sticky: 'end',
|
|
2299
|
+
style: {
|
|
2300
|
+
padding: 0,
|
|
2301
|
+
width: '0',
|
|
2302
|
+
},
|
|
2303
|
+
});
|
|
2304
|
+
|
|
2305
|
+
class ConfirmDialogComponent extends DialogSuperclass {
|
|
2306
|
+
constructor() {
|
|
2307
|
+
super(...arguments);
|
|
2308
|
+
this.control = new FormControl('', { nonNullable: true });
|
|
2309
|
+
}
|
|
2310
|
+
confirm() {
|
|
2311
|
+
this.closeWithSuccess(this.dialogData && this.dialogData?.hasReason
|
|
2312
|
+
? { reason: this.control.value }
|
|
2313
|
+
: undefined);
|
|
2314
|
+
}
|
|
2315
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ConfirmDialogComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2316
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: ConfirmDialogComponent, isStandalone: false, selector: "v-action-dialog", usesInheritance: true, ngImport: i0, template: "<v-dialog\n [noContent]=\"!(dialogData && (dialogData.hasReason || dialogData.description))\"\n [title]=\"dialogData?.['title'] ?? 'Confirm this action?'\"\n noCloseButton\n>\n @if (dialogData && dialogData.description) {\n <div class=\"mat-body-large\">\n {{ dialogData.description }}\n </div>\n }\n @if (dialogData && dialogData.hasReason) {\n <mat-form-field style=\"width: 100%\">\n <mat-label>Reason</mat-label>\n <input [formControl]=\"control\" matInput />\n </mat-form-field>\n }\n <v-dialog-actions>\n <button mat-button (click)=\"closeWithCancellation()\">Cancel</button>\n <button mat-flat-button (click)=\"confirm()\">\n {{ dialogData?.['confirmLabel'] || 'Confirm' }}\n </button>\n </v-dialog-actions>\n</v-dialog>\n", dependencies: [{ kind: "component", type: i1$4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: DialogComponent, selector: "v-dialog", inputs: ["title", "disabled", "progress", "hasDivider", "noContent", "noActions", "noCloseButton", "fullSize"], outputs: ["cancel"] }, { kind: "component", type: DialogActionsComponent, selector: "v-dialog-actions" }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2317
|
+
}
|
|
2318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
|
|
2319
|
+
type: Component,
|
|
2320
|
+
args: [{ selector: 'v-action-dialog', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<v-dialog\n [noContent]=\"!(dialogData && (dialogData.hasReason || dialogData.description))\"\n [title]=\"dialogData?.['title'] ?? 'Confirm this action?'\"\n noCloseButton\n>\n @if (dialogData && dialogData.description) {\n <div class=\"mat-body-large\">\n {{ dialogData.description }}\n </div>\n }\n @if (dialogData && dialogData.hasReason) {\n <mat-form-field style=\"width: 100%\">\n <mat-label>Reason</mat-label>\n <input [formControl]=\"control\" matInput />\n </mat-form-field>\n }\n <v-dialog-actions>\n <button mat-button (click)=\"closeWithCancellation()\">Cancel</button>\n <button mat-flat-button (click)=\"confirm()\">\n {{ dialogData?.['confirmLabel'] || 'Confirm' }}\n </button>\n </v-dialog-actions>\n</v-dialog>\n" }]
|
|
2321
|
+
}] });
|
|
2322
|
+
|
|
2323
|
+
class ConfirmDialogModule {
|
|
2324
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ConfirmDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2325
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: ConfirmDialogModule, declarations: [ConfirmDialogComponent], imports: [MatDialogModule,
|
|
2326
|
+
MatButtonModule,
|
|
2327
|
+
DialogModule,
|
|
2328
|
+
MatFormFieldModule,
|
|
2329
|
+
CommonModule,
|
|
2330
|
+
MatInputModule,
|
|
2331
|
+
ReactiveFormsModule], exports: [ConfirmDialogComponent] }); }
|
|
2332
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ConfirmDialogModule, imports: [MatDialogModule,
|
|
2333
|
+
MatButtonModule,
|
|
2334
|
+
DialogModule,
|
|
2335
|
+
MatFormFieldModule,
|
|
2336
|
+
CommonModule,
|
|
2337
|
+
MatInputModule,
|
|
2338
|
+
ReactiveFormsModule] }); }
|
|
2339
|
+
}
|
|
2340
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ConfirmDialogModule, decorators: [{
|
|
2341
|
+
type: NgModule,
|
|
2342
|
+
args: [{
|
|
2343
|
+
imports: [
|
|
2344
|
+
MatDialogModule,
|
|
2345
|
+
MatButtonModule,
|
|
2346
|
+
DialogModule,
|
|
2347
|
+
MatFormFieldModule,
|
|
2348
|
+
CommonModule,
|
|
2349
|
+
MatInputModule,
|
|
2350
|
+
ReactiveFormsModule,
|
|
2351
|
+
],
|
|
2352
|
+
declarations: [ConfirmDialogComponent],
|
|
2353
|
+
exports: [ConfirmDialogComponent],
|
|
2354
|
+
}]
|
|
2355
|
+
}] });
|
|
2356
|
+
|
|
2357
|
+
class FiltersDialogComponent extends DialogSuperclass {
|
|
2358
|
+
get isShowMainFilters() {
|
|
2359
|
+
return (!this.dialogData.filters.otherFiltersDirective?.templateRef ||
|
|
2360
|
+
this.dialogData.filters.merge);
|
|
2361
|
+
}
|
|
2362
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FiltersDialogComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2363
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: FiltersDialogComponent, isStandalone: false, selector: "v-filters-dialog", usesInheritance: true, ngImport: i0, template: "<v-dialog noActions title=\"Filters\">\n <div\n [ngClass]=\"[\n 'v-filters-dialog-cols-' +\n (isShowMainFilters ? (dialogData.filters.repeat$ | async) : 1),\n 'filters',\n ]\"\n >\n @if (isShowMainFilters) {\n <ng-container *ngTemplateOutlet=\"dialogData.filters.mainFiltersTemplate\"></ng-container>\n }\n @if (dialogData.filters.otherFiltersTemplate) {\n <div class=\"other-filters\">\n <ng-container\n *ngTemplateOutlet=\"dialogData.filters.otherFiltersTemplate\"\n ></ng-container>\n </div>\n }\n </div>\n</v-dialog>\n", styles: [".filters{display:grid;grid-template-columns:1fr}.filters .other-filters{display:block!important}::ng-deep .v-filters-dialog-cols-1>*:nth-child(-n+1){display:none}::ng-deep .v-filters-dialog-cols-2>*:nth-child(-n+2){display:none}::ng-deep .v-filters-dialog-cols-3>*:nth-child(-n+3){display:none}::ng-deep .v-filters-dialog-cols-4>*:nth-child(-n+4){display:none}::ng-deep .v-filters-dialog-cols-5>*:nth-child(-n+5){display:none}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: DialogComponent, selector: "v-dialog", inputs: ["title", "disabled", "progress", "hasDivider", "noContent", "noActions", "noCloseButton", "fullSize"], outputs: ["cancel"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] }); }
|
|
2364
|
+
}
|
|
2365
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FiltersDialogComponent, decorators: [{
|
|
2366
|
+
type: Component,
|
|
2367
|
+
args: [{ selector: 'v-filters-dialog', standalone: false, template: "<v-dialog noActions title=\"Filters\">\n <div\n [ngClass]=\"[\n 'v-filters-dialog-cols-' +\n (isShowMainFilters ? (dialogData.filters.repeat$ | async) : 1),\n 'filters',\n ]\"\n >\n @if (isShowMainFilters) {\n <ng-container *ngTemplateOutlet=\"dialogData.filters.mainFiltersTemplate\"></ng-container>\n }\n @if (dialogData.filters.otherFiltersTemplate) {\n <div class=\"other-filters\">\n <ng-container\n *ngTemplateOutlet=\"dialogData.filters.otherFiltersTemplate\"\n ></ng-container>\n </div>\n }\n </div>\n</v-dialog>\n", styles: [".filters{display:grid;grid-template-columns:1fr}.filters .other-filters{display:block!important}::ng-deep .v-filters-dialog-cols-1>*:nth-child(-n+1){display:none}::ng-deep .v-filters-dialog-cols-2>*:nth-child(-n+2){display:none}::ng-deep .v-filters-dialog-cols-3>*:nth-child(-n+3){display:none}::ng-deep .v-filters-dialog-cols-4>*:nth-child(-n+4){display:none}::ng-deep .v-filters-dialog-cols-5>*:nth-child(-n+5){display:none}\n"] }]
|
|
2368
|
+
}] });
|
|
2369
|
+
|
|
2370
|
+
class MainFiltersDirective {
|
|
2371
|
+
constructor(templateRef) {
|
|
2372
|
+
this.templateRef = templateRef;
|
|
2373
|
+
}
|
|
2374
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: MainFiltersDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2375
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: MainFiltersDirective, isStandalone: false, selector: "[vMainFilters]", ngImport: i0 }); }
|
|
2376
|
+
}
|
|
2377
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: MainFiltersDirective, decorators: [{
|
|
2378
|
+
type: Directive,
|
|
2379
|
+
args: [{
|
|
2380
|
+
selector: '[vMainFilters]',
|
|
2381
|
+
standalone: false,
|
|
2382
|
+
}]
|
|
2383
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
2384
|
+
|
|
2385
|
+
class OtherFiltersDirective {
|
|
2386
|
+
constructor(templateRef) {
|
|
2387
|
+
this.templateRef = templateRef;
|
|
2388
|
+
}
|
|
2389
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: OtherFiltersDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2390
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: OtherFiltersDirective, isStandalone: false, selector: "[vOtherFilters]", ngImport: i0 }); }
|
|
2391
|
+
}
|
|
2392
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: OtherFiltersDirective, decorators: [{
|
|
2393
|
+
type: Directive,
|
|
2394
|
+
args: [{
|
|
2395
|
+
selector: '[vOtherFilters]',
|
|
2396
|
+
standalone: false,
|
|
2397
|
+
}]
|
|
2398
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
2399
|
+
|
|
2400
|
+
class FiltersComponent {
|
|
2401
|
+
set content(content) {
|
|
2402
|
+
this.filtersCount$.next(content?.nativeElement?.children?.length ?? 0);
|
|
2403
|
+
}
|
|
2404
|
+
get mainFiltersTemplate() {
|
|
2405
|
+
return this.mainFiltersDirective?.templateRef ?? this.filtersTemplate;
|
|
2406
|
+
}
|
|
2407
|
+
get otherFiltersTemplate() {
|
|
2408
|
+
return this.otherFiltersDirective?.templateRef;
|
|
2409
|
+
}
|
|
2410
|
+
constructor(dialog, breakpointObserver) {
|
|
2411
|
+
this.dialog = dialog;
|
|
2412
|
+
this.breakpointObserver = breakpointObserver;
|
|
2413
|
+
this.active = 0;
|
|
2414
|
+
this.merge = false;
|
|
2415
|
+
// TODO: to change from outside you need to change the logic and set $rows in two SCSS
|
|
2416
|
+
this.rows = signal(1);
|
|
2417
|
+
this.clear = new EventEmitter();
|
|
2418
|
+
this.repeat$ = this.breakpointObserver.observe(Object.values(Breakpoints)).pipe(map((b) => {
|
|
2419
|
+
if (b.breakpoints[Breakpoints.XLarge]) {
|
|
2420
|
+
return 5;
|
|
2421
|
+
}
|
|
2422
|
+
if (b.breakpoints[Breakpoints.Large]) {
|
|
2423
|
+
return 4;
|
|
2424
|
+
}
|
|
2425
|
+
if (b.breakpoints[Breakpoints.Medium]) {
|
|
2426
|
+
return 3;
|
|
2427
|
+
}
|
|
2428
|
+
if (b.breakpoints[Breakpoints.Small]) {
|
|
2429
|
+
return 2;
|
|
2430
|
+
}
|
|
2431
|
+
return 1;
|
|
2432
|
+
}));
|
|
2433
|
+
this.displayedFiltersCount$ = combineLatest([this.repeat$, toObservable(this.rows)]).pipe(map(([repeat, rows]) => repeat * rows));
|
|
2434
|
+
this.filtersCount$ = new BehaviorSubject(0);
|
|
2435
|
+
}
|
|
2436
|
+
open() {
|
|
2437
|
+
this.dialog.open(FiltersDialogComponent, { filters: this });
|
|
2438
|
+
}
|
|
2439
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FiltersComponent, deps: [{ token: DialogService }, { token: i2$6.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2440
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.0.6", type: FiltersComponent, isStandalone: false, selector: "v-filters", inputs: { active: "active", merge: ["merge", "merge", booleanAttribute] }, outputs: { clear: "clear" }, queries: [{ propertyName: "filtersTemplate", first: true, predicate: TemplateRef, descendants: true, static: true }, { propertyName: "otherFiltersDirective", first: true, predicate: OtherFiltersDirective, descendants: true, static: true }, { propertyName: "mainFiltersDirective", first: true, predicate: MainFiltersDirective, descendants: true, static: true }], viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true }], ngImport: i0, template: "<mat-card>\n <mat-card-content #content [ngClass]=\"['v-filters-cols-' + (repeat$ | async), 'filters']\">\n <ng-container *ngTemplateOutlet=\"mainFiltersTemplate\"></ng-container>\n </mat-card-content>\n</mat-card>\n", styles: [".filters{display:grid;grid-column-gap:8px;margin-bottom:-22px;padding:22px!important}::ng-deep .filters>*{min-width:0}::ng-deep .v-filters-cols-1{grid-template-columns:repeat(1,1fr)}::ng-deep .v-filters-cols-1>*:nth-child(n+2){display:none}::ng-deep .v-filters-cols-2{grid-template-columns:repeat(2,1fr)}::ng-deep .v-filters-cols-2>*:nth-child(n+3){display:none}::ng-deep .v-filters-cols-3{grid-template-columns:repeat(3,1fr)}::ng-deep .v-filters-cols-3>*:nth-child(n+4){display:none}::ng-deep .v-filters-cols-4{grid-template-columns:repeat(4,1fr)}::ng-deep .v-filters-cols-4>*:nth-child(n+5){display:none}::ng-deep .v-filters-cols-5{grid-template-columns:repeat(5,1fr)}::ng-deep .v-filters-cols-5>*:nth-child(n+6){display:none}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i4.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i4.MatCardContent, selector: "mat-card-content" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] }); }
|
|
2441
|
+
}
|
|
2442
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FiltersComponent, decorators: [{
|
|
2443
|
+
type: Component,
|
|
2444
|
+
args: [{ selector: 'v-filters', standalone: false, template: "<mat-card>\n <mat-card-content #content [ngClass]=\"['v-filters-cols-' + (repeat$ | async), 'filters']\">\n <ng-container *ngTemplateOutlet=\"mainFiltersTemplate\"></ng-container>\n </mat-card-content>\n</mat-card>\n", styles: [".filters{display:grid;grid-column-gap:8px;margin-bottom:-22px;padding:22px!important}::ng-deep .filters>*{min-width:0}::ng-deep .v-filters-cols-1{grid-template-columns:repeat(1,1fr)}::ng-deep .v-filters-cols-1>*:nth-child(n+2){display:none}::ng-deep .v-filters-cols-2{grid-template-columns:repeat(2,1fr)}::ng-deep .v-filters-cols-2>*:nth-child(n+3){display:none}::ng-deep .v-filters-cols-3{grid-template-columns:repeat(3,1fr)}::ng-deep .v-filters-cols-3>*:nth-child(n+4){display:none}::ng-deep .v-filters-cols-4{grid-template-columns:repeat(4,1fr)}::ng-deep .v-filters-cols-4>*:nth-child(n+5){display:none}::ng-deep .v-filters-cols-5{grid-template-columns:repeat(5,1fr)}::ng-deep .v-filters-cols-5>*:nth-child(n+6){display:none}\n"] }]
|
|
2445
|
+
}], ctorParameters: () => [{ type: DialogService }, { type: i2$6.BreakpointObserver }], propDecorators: { active: [{
|
|
2446
|
+
type: Input
|
|
2447
|
+
}], merge: [{
|
|
2448
|
+
type: Input,
|
|
2449
|
+
args: [{ transform: booleanAttribute }]
|
|
2450
|
+
}], clear: [{
|
|
2451
|
+
type: Output
|
|
2452
|
+
}], filtersTemplate: [{
|
|
2453
|
+
type: ContentChild,
|
|
2454
|
+
args: [TemplateRef, { static: true }]
|
|
2455
|
+
}], otherFiltersDirective: [{
|
|
2456
|
+
type: ContentChild,
|
|
2457
|
+
args: [OtherFiltersDirective, { static: true }]
|
|
2458
|
+
}], mainFiltersDirective: [{
|
|
2459
|
+
type: ContentChild,
|
|
2460
|
+
args: [MainFiltersDirective, { static: true }]
|
|
2461
|
+
}], content: [{
|
|
2462
|
+
type: ViewChild,
|
|
2463
|
+
args: ['content']
|
|
2464
|
+
}] } });
|
|
2465
|
+
|
|
2466
|
+
class MoreFiltersButtonComponent {
|
|
2467
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: MoreFiltersButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2468
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: MoreFiltersButtonComponent, isStandalone: false, selector: "v-more-filters-button", inputs: { filters: "filters" }, ngImport: i0, template: "<v-actions>\n @if (filters.active && filters.clear.observed) {\n <button mat-icon-button (click)=\"filters.clear.emit()\">\n <mat-icon [matBadge]=\"filters.active || undefined\" matBadgeColor=\"accent\"\n >restart_alt</mat-icon\n >\n </button>\n }\n @if (\n filters.otherFiltersDirective ||\n ((filters.filtersCount$ | async) ?? 0) - ((filters.displayedFiltersCount$ | async) ?? 0) > 0\n ) {\n <button mat-icon-button (click)=\"filters.open()\">\n <mat-icon>filter_alt</mat-icon>\n </button>\n }\n</v-actions>\n", styles: [""], dependencies: [{ kind: "component", type: i1$4.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: ActionsComponent, selector: "v-actions" }, { kind: "directive", type: i6.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] }); }
|
|
2469
|
+
}
|
|
2470
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: MoreFiltersButtonComponent, decorators: [{
|
|
2471
|
+
type: Component,
|
|
2472
|
+
args: [{ selector: 'v-more-filters-button', standalone: false, template: "<v-actions>\n @if (filters.active && filters.clear.observed) {\n <button mat-icon-button (click)=\"filters.clear.emit()\">\n <mat-icon [matBadge]=\"filters.active || undefined\" matBadgeColor=\"accent\"\n >restart_alt</mat-icon\n >\n </button>\n }\n @if (\n filters.otherFiltersDirective ||\n ((filters.filtersCount$ | async) ?? 0) - ((filters.displayedFiltersCount$ | async) ?? 0) > 0\n ) {\n <button mat-icon-button (click)=\"filters.open()\">\n <mat-icon>filter_alt</mat-icon>\n </button>\n }\n</v-actions>\n" }]
|
|
2473
|
+
}], propDecorators: { filters: [{
|
|
2474
|
+
type: Input
|
|
2475
|
+
}] } });
|
|
2476
|
+
|
|
2477
|
+
class FiltersModule {
|
|
2478
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FiltersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2479
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: FiltersModule, declarations: [FiltersComponent,
|
|
2480
|
+
MoreFiltersButtonComponent,
|
|
2481
|
+
FiltersDialogComponent,
|
|
2482
|
+
OtherFiltersDirective,
|
|
2483
|
+
MainFiltersDirective], imports: [CommonModule,
|
|
2484
|
+
MatCardModule,
|
|
2485
|
+
MatButtonModule,
|
|
2486
|
+
MatIconModule,
|
|
2487
|
+
DialogModule,
|
|
2488
|
+
LayoutModule,
|
|
2489
|
+
ActionsModule,
|
|
2490
|
+
MatBadgeModule], exports: [FiltersComponent,
|
|
2491
|
+
MoreFiltersButtonComponent,
|
|
2492
|
+
OtherFiltersDirective,
|
|
2493
|
+
MainFiltersDirective] }); }
|
|
2494
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FiltersModule, imports: [CommonModule,
|
|
2495
|
+
MatCardModule,
|
|
2496
|
+
MatButtonModule,
|
|
2497
|
+
MatIconModule,
|
|
2498
|
+
DialogModule,
|
|
2499
|
+
LayoutModule,
|
|
2500
|
+
ActionsModule,
|
|
2501
|
+
MatBadgeModule] }); }
|
|
2502
|
+
}
|
|
2503
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FiltersModule, decorators: [{
|
|
2504
|
+
type: NgModule,
|
|
2505
|
+
args: [{
|
|
2506
|
+
declarations: [
|
|
2507
|
+
FiltersComponent,
|
|
2508
|
+
MoreFiltersButtonComponent,
|
|
2509
|
+
FiltersDialogComponent,
|
|
2510
|
+
OtherFiltersDirective,
|
|
2511
|
+
MainFiltersDirective,
|
|
2512
|
+
],
|
|
2513
|
+
exports: [
|
|
2514
|
+
FiltersComponent,
|
|
2515
|
+
MoreFiltersButtonComponent,
|
|
2516
|
+
OtherFiltersDirective,
|
|
2517
|
+
MainFiltersDirective,
|
|
2518
|
+
],
|
|
2519
|
+
imports: [
|
|
2520
|
+
CommonModule,
|
|
2521
|
+
MatCardModule,
|
|
2522
|
+
MatButtonModule,
|
|
2523
|
+
MatIconModule,
|
|
2524
|
+
DialogModule,
|
|
2525
|
+
LayoutModule,
|
|
2526
|
+
ActionsModule,
|
|
2527
|
+
MatBadgeModule,
|
|
2528
|
+
],
|
|
2529
|
+
}]
|
|
2530
|
+
}] });
|
|
2531
|
+
|
|
2532
|
+
class DateRangeFieldComponent extends FormGroupSuperclass {
|
|
2533
|
+
constructor(fb) {
|
|
2534
|
+
super();
|
|
2535
|
+
this.fb = fb;
|
|
2536
|
+
this.required = false;
|
|
2537
|
+
this.control = this.fb.group({
|
|
2538
|
+
start: undefined,
|
|
2539
|
+
end: undefined,
|
|
2540
|
+
});
|
|
2541
|
+
}
|
|
2542
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DateRangeFieldComponent, deps: [{ token: i1$3.NonNullableFormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2543
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: DateRangeFieldComponent, isStandalone: false, selector: "v-date-range-field", inputs: { required: ["required", "required", booleanAttribute] }, providers: [
|
|
2544
|
+
...createControlProviders(() => DateRangeFieldComponent),
|
|
2545
|
+
{ provide: MAT_DATE_LOCALE, useValue: enGB },
|
|
2546
|
+
{ provide: DateAdapter, useClass: DateFnsAdapter, deps: [MAT_DATE_LOCALE] },
|
|
2547
|
+
{ provide: MAT_DATE_FORMATS, useValue: MAT_DATE_FNS_FORMATS },
|
|
2548
|
+
], usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>Date range</mat-label>\n <mat-date-range-input\n [formGroup]=\"control\"\n [rangePicker]=\"picker\"\n [required]=\"required || false\"\n >\n <input formControlName=\"start\" matStartDate placeholder=\"Start date\" />\n <input formControlName=\"end\" matEndDate placeholder=\"End date\" />\n </mat-date-range-input>\n <mat-datepicker-toggle [for]=\"picker\" matIconSuffix></mat-datepicker-toggle>\n <mat-date-range-picker #picker>\n <mat-date-range-picker-actions>\n <v-actions class=\"actions\">\n @if (!required) {\n <button\n [disabled]=\"!control.value?.start && !control.value?.end\"\n mat-button\n (click)=\"control.reset(); picker.close()\"\n >\n Reset\n </button>\n }\n <button mat-flat-button matDateRangePickerApply>Apply</button>\n </v-actions>\n </mat-date-range-picker-actions>\n </mat-date-range-picker>\n</mat-form-field>\n", styles: [":host{overflow:hidden}mat-form-field{width:100%}::ng-deep .mat-mdc-form-field-infix{width:auto!important}input{text-overflow:ellipsis}.actions{width:100%}\n"], dependencies: [{ kind: "component", type: i2$7.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i2$7.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i2$7.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i2$7.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i2$7.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "component", type: i2$7.MatDatepickerActions, selector: "mat-datepicker-actions, mat-date-range-picker-actions" }, { kind: "directive", type: i2$7.MatDatepickerApply, selector: "[matDatepickerApply], [matDateRangePickerApply]" }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i1$4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: ActionsComponent, selector: "v-actions" }] }); }
|
|
2549
|
+
}
|
|
2550
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DateRangeFieldComponent, decorators: [{
|
|
2551
|
+
type: Component,
|
|
2552
|
+
args: [{ selector: 'v-date-range-field', providers: [
|
|
2553
|
+
...createControlProviders(() => DateRangeFieldComponent),
|
|
2554
|
+
{ provide: MAT_DATE_LOCALE, useValue: enGB },
|
|
2555
|
+
{ provide: DateAdapter, useClass: DateFnsAdapter, deps: [MAT_DATE_LOCALE] },
|
|
2556
|
+
{ provide: MAT_DATE_FORMATS, useValue: MAT_DATE_FNS_FORMATS },
|
|
2557
|
+
], standalone: false, template: "<mat-form-field>\n <mat-label>Date range</mat-label>\n <mat-date-range-input\n [formGroup]=\"control\"\n [rangePicker]=\"picker\"\n [required]=\"required || false\"\n >\n <input formControlName=\"start\" matStartDate placeholder=\"Start date\" />\n <input formControlName=\"end\" matEndDate placeholder=\"End date\" />\n </mat-date-range-input>\n <mat-datepicker-toggle [for]=\"picker\" matIconSuffix></mat-datepicker-toggle>\n <mat-date-range-picker #picker>\n <mat-date-range-picker-actions>\n <v-actions class=\"actions\">\n @if (!required) {\n <button\n [disabled]=\"!control.value?.start && !control.value?.end\"\n mat-button\n (click)=\"control.reset(); picker.close()\"\n >\n Reset\n </button>\n }\n <button mat-flat-button matDateRangePickerApply>Apply</button>\n </v-actions>\n </mat-date-range-picker-actions>\n </mat-date-range-picker>\n</mat-form-field>\n", styles: [":host{overflow:hidden}mat-form-field{width:100%}::ng-deep .mat-mdc-form-field-infix{width:auto!important}input{text-overflow:ellipsis}.actions{width:100%}\n"] }]
|
|
2558
|
+
}], ctorParameters: () => [{ type: i1$3.NonNullableFormBuilder }], propDecorators: { required: [{
|
|
2559
|
+
type: Input,
|
|
2560
|
+
args: [{ transform: booleanAttribute }]
|
|
2561
|
+
}] } });
|
|
2562
|
+
|
|
2563
|
+
class DateRangeFieldModule {
|
|
2564
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DateRangeFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2565
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: DateRangeFieldModule, declarations: [DateRangeFieldComponent], imports: [CommonModule,
|
|
2566
|
+
MatDatepickerModule,
|
|
2567
|
+
MatInputModule,
|
|
2568
|
+
ReactiveFormsModule,
|
|
2569
|
+
MatButtonModule,
|
|
2570
|
+
ActionsModule], exports: [DateRangeFieldComponent] }); }
|
|
2571
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DateRangeFieldModule, imports: [CommonModule,
|
|
2572
|
+
MatDatepickerModule,
|
|
2573
|
+
MatInputModule,
|
|
2574
|
+
ReactiveFormsModule,
|
|
2575
|
+
MatButtonModule,
|
|
2576
|
+
ActionsModule] }); }
|
|
2577
|
+
}
|
|
2578
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DateRangeFieldModule, decorators: [{
|
|
2579
|
+
type: NgModule,
|
|
2580
|
+
args: [{
|
|
2581
|
+
declarations: [DateRangeFieldComponent],
|
|
2582
|
+
imports: [
|
|
2583
|
+
CommonModule,
|
|
2584
|
+
MatDatepickerModule,
|
|
2585
|
+
MatInputModule,
|
|
2586
|
+
ReactiveFormsModule,
|
|
2587
|
+
MatButtonModule,
|
|
2588
|
+
ActionsModule,
|
|
2589
|
+
],
|
|
2590
|
+
exports: [DateRangeFieldComponent],
|
|
2591
|
+
}]
|
|
2592
|
+
}] });
|
|
2593
|
+
|
|
2594
|
+
function isEqualDateRange(a, b) {
|
|
2595
|
+
if (!a || !b) {
|
|
2596
|
+
return a === b;
|
|
2597
|
+
}
|
|
2598
|
+
return isEqual$2(a.start, b.start) && isEqual$2(a.end, b.end);
|
|
2599
|
+
}
|
|
2600
|
+
|
|
2601
|
+
function createDateRangeToToday(minDays = 1) {
|
|
2602
|
+
return {
|
|
2603
|
+
/**
|
|
2604
|
+
* If we take the beginning of the previous day to the end of the current one,
|
|
2605
|
+
* then it is guaranteed that there will be an interval of one day,
|
|
2606
|
+
* as a maximum of two days
|
|
2607
|
+
*/
|
|
2608
|
+
start: subDays(startOfDay(new Date()), minDays),
|
|
2609
|
+
end: endOfDay(new Date()),
|
|
2610
|
+
};
|
|
2611
|
+
}
|
|
2612
|
+
|
|
2613
|
+
class NumberRangeFieldComponent extends FormGroupSuperclass {
|
|
2614
|
+
constructor(fb) {
|
|
2615
|
+
super();
|
|
2616
|
+
this.fb = fb;
|
|
2617
|
+
this.control = this.fb.group({
|
|
2618
|
+
start: undefined,
|
|
2619
|
+
end: undefined,
|
|
2620
|
+
});
|
|
2621
|
+
}
|
|
2622
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NumberRangeFieldComponent, deps: [{ token: i1$3.NonNullableFormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2623
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.6", type: NumberRangeFieldComponent, isStandalone: false, selector: "v-number-range-field", inputs: { label: "label" }, providers: createControlProviders(() => NumberRangeFieldComponent), usesInheritance: true, ngImport: i0, template: "<div [formGroup]=\"control\" class=\"wrapper\">\n <mat-form-field>\n <mat-label>{{ label }} from</mat-label>\n <input formControlName=\"start\" matInput type=\"number\" />\n </mat-form-field>\n <mat-form-field>\n <mat-label>{{ label }} to</mat-label>\n <input formControlName=\"end\" matInput type=\"number\" />\n </mat-form-field>\n</div>\n", styles: [".wrapper{display:grid;grid-template-columns:1fr 1fr;grid-gap:8px}\n"], dependencies: [{ kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }] }); }
|
|
2624
|
+
}
|
|
2625
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NumberRangeFieldComponent, decorators: [{
|
|
2626
|
+
type: Component,
|
|
2627
|
+
args: [{ selector: 'v-number-range-field', providers: createControlProviders(() => NumberRangeFieldComponent), standalone: false, template: "<div [formGroup]=\"control\" class=\"wrapper\">\n <mat-form-field>\n <mat-label>{{ label }} from</mat-label>\n <input formControlName=\"start\" matInput type=\"number\" />\n </mat-form-field>\n <mat-form-field>\n <mat-label>{{ label }} to</mat-label>\n <input formControlName=\"end\" matInput type=\"number\" />\n </mat-form-field>\n</div>\n", styles: [".wrapper{display:grid;grid-template-columns:1fr 1fr;grid-gap:8px}\n"] }]
|
|
2628
|
+
}], ctorParameters: () => [{ type: i1$3.NonNullableFormBuilder }], propDecorators: { label: [{
|
|
2629
|
+
type: Input
|
|
2630
|
+
}] } });
|
|
2631
|
+
|
|
2632
|
+
class NumberRangeFieldModule {
|
|
2633
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NumberRangeFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2634
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: NumberRangeFieldModule, declarations: [NumberRangeFieldComponent], imports: [ReactiveFormsModule, MatInputModule], exports: [NumberRangeFieldComponent] }); }
|
|
2635
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NumberRangeFieldModule, imports: [ReactiveFormsModule, MatInputModule] }); }
|
|
2636
|
+
}
|
|
2637
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NumberRangeFieldModule, decorators: [{
|
|
2638
|
+
type: NgModule,
|
|
2639
|
+
args: [{
|
|
2640
|
+
declarations: [NumberRangeFieldComponent],
|
|
2641
|
+
imports: [ReactiveFormsModule, MatInputModule],
|
|
2642
|
+
exports: [NumberRangeFieldComponent],
|
|
2643
|
+
}]
|
|
2644
|
+
}] });
|
|
2645
|
+
|
|
2646
|
+
class ListFieldComponent extends FormControlSuperclass {
|
|
2647
|
+
constructor() {
|
|
2648
|
+
super(...arguments);
|
|
2649
|
+
this.items$ = getValueChanges(this.control).pipe(map((v) => this.getValue(v)), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
2650
|
+
}
|
|
2651
|
+
innerToOuterValue(inner) {
|
|
2652
|
+
return this.getValue(inner);
|
|
2653
|
+
}
|
|
2654
|
+
outerToInnerValue(outer) {
|
|
2655
|
+
return (outer || []).join(', ');
|
|
2656
|
+
}
|
|
2657
|
+
getValue(inner = this.control.value) {
|
|
2658
|
+
return splitBySeparators(inner || '');
|
|
2659
|
+
}
|
|
2660
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ListFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2661
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.6", type: ListFieldComponent, isStandalone: false, selector: "v-list-field", inputs: { label: "label", focusedHint: "focusedHint" }, providers: createControlProviders(() => ListFieldComponent), usesInheritance: true, ngImport: i0, template: "<mat-form-field style=\"width: 100%\">\n <mat-label>{{ label }}</mat-label>\n <input #input=\"matInput\" [formControl]=\"control\" autocomplete=\"false\" matInput type=\"string\" />\n <mat-hint class=\"mat-secondary-text\">{{\n (items$ | async)?.length\n ? (items$ | async)?.length === 1\n ? '1 item'\n : (items$ | async)?.length + ' items'\n : input.focused\n ? focusedHint || 'item_1, item_2'\n : ''\n }}</mat-hint>\n</mat-form-field>\n", dependencies: [{ kind: "directive", type: i2$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] }); }
|
|
2662
|
+
}
|
|
2663
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ListFieldComponent, decorators: [{
|
|
2664
|
+
type: Component,
|
|
2665
|
+
args: [{ selector: 'v-list-field', providers: createControlProviders(() => ListFieldComponent), standalone: false, template: "<mat-form-field style=\"width: 100%\">\n <mat-label>{{ label }}</mat-label>\n <input #input=\"matInput\" [formControl]=\"control\" autocomplete=\"false\" matInput type=\"string\" />\n <mat-hint class=\"mat-secondary-text\">{{\n (items$ | async)?.length\n ? (items$ | async)?.length === 1\n ? '1 item'\n : (items$ | async)?.length + ' items'\n : input.focused\n ? focusedHint || 'item_1, item_2'\n : ''\n }}</mat-hint>\n</mat-form-field>\n" }]
|
|
2666
|
+
}], propDecorators: { label: [{
|
|
2667
|
+
type: Input
|
|
2668
|
+
}], focusedHint: [{
|
|
2669
|
+
type: Input
|
|
2670
|
+
}] } });
|
|
2671
|
+
|
|
2672
|
+
class ListFieldModule {
|
|
2673
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ListFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2674
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: ListFieldModule, declarations: [ListFieldComponent], imports: [CommonModule, MatInputModule, ReactiveFormsModule], exports: [ListFieldComponent] }); }
|
|
2675
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ListFieldModule, imports: [CommonModule, MatInputModule, ReactiveFormsModule] }); }
|
|
2676
|
+
}
|
|
2677
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ListFieldModule, decorators: [{
|
|
2678
|
+
type: NgModule,
|
|
2679
|
+
args: [{
|
|
2680
|
+
declarations: [ListFieldComponent],
|
|
2681
|
+
exports: [ListFieldComponent],
|
|
2682
|
+
imports: [CommonModule, MatInputModule, ReactiveFormsModule],
|
|
2683
|
+
}]
|
|
2684
|
+
}] });
|
|
2685
|
+
|
|
2686
|
+
class ErrorPageComponent {
|
|
2687
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ErrorPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2688
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.6", type: ErrorPageComponent, isStandalone: false, selector: "ng-component", ngImport: i0, template: "<div class=\"error\">\n <div class=\"mat-display-small title\">\n <mat-icon>error</mat-icon>\n <div>Page not found</div>\n </div>\n <h2 class=\"mat-headline-small mat-secondary-text\">\n This page doesn't exist<br />or no permission to access this page\n </h2>\n</div>\n", styles: [".error{margin:0 auto;padding:96px 24px;text-align:center}.error .title{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:16px}.error .title mat-icon{font-size:40px;width:auto;height:auto}\n"], dependencies: [{ kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
|
|
2689
|
+
}
|
|
2690
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ErrorPageComponent, decorators: [{
|
|
2691
|
+
type: Component,
|
|
2692
|
+
args: [{ standalone: false, template: "<div class=\"error\">\n <div class=\"mat-display-small title\">\n <mat-icon>error</mat-icon>\n <div>Page not found</div>\n </div>\n <h2 class=\"mat-headline-small mat-secondary-text\">\n This page doesn't exist<br />or no permission to access this page\n </h2>\n</div>\n", styles: [".error{margin:0 auto;padding:96px 24px;text-align:center}.error .title{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:16px}.error .title mat-icon{font-size:40px;width:auto;height:auto}\n"] }]
|
|
2693
|
+
}] });
|
|
2694
|
+
|
|
2695
|
+
const ROUTES = [{ path: '', component: ErrorPageComponent }];
|
|
2696
|
+
class ErrorPageRoutingModule {
|
|
2697
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ErrorPageRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2698
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: ErrorPageRoutingModule, imports: [i1$5.RouterModule], exports: [RouterModule] }); }
|
|
2699
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ErrorPageRoutingModule, imports: [RouterModule.forChild(ROUTES), RouterModule] }); }
|
|
2700
|
+
}
|
|
2701
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ErrorPageRoutingModule, decorators: [{
|
|
2702
|
+
type: NgModule,
|
|
2703
|
+
args: [{
|
|
2704
|
+
imports: [RouterModule.forChild(ROUTES)],
|
|
2705
|
+
exports: [RouterModule],
|
|
2706
|
+
}]
|
|
2707
|
+
}] });
|
|
2708
|
+
|
|
2709
|
+
class ErrorPageModule {
|
|
2710
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ErrorPageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2711
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: ErrorPageModule, declarations: [ErrorPageComponent], imports: [ErrorPageRoutingModule, MatIconModule] }); }
|
|
2712
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ErrorPageModule, imports: [ErrorPageRoutingModule, MatIconModule] }); }
|
|
2713
|
+
}
|
|
2714
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ErrorPageModule, decorators: [{
|
|
2715
|
+
type: NgModule,
|
|
2716
|
+
args: [{
|
|
2717
|
+
imports: [ErrorPageRoutingModule, MatIconModule],
|
|
2718
|
+
declarations: [ErrorPageComponent],
|
|
2719
|
+
}]
|
|
2720
|
+
}] });
|
|
2721
|
+
|
|
2722
|
+
function isSearchOption(option, termLowerCase) {
|
|
2723
|
+
return (!!String(option.value)?.toLowerCase().includes?.(termLowerCase) ||
|
|
2724
|
+
!!option.label?.toLowerCase()?.includes(termLowerCase) ||
|
|
2725
|
+
!!option.description?.toLowerCase().includes?.(termLowerCase));
|
|
2726
|
+
}
|
|
2727
|
+
function searchOptions(options, term) {
|
|
2728
|
+
const termLowerCase = term.toLowerCase();
|
|
2729
|
+
return options?.filter?.((option) => isSearchOption(option, termLowerCase));
|
|
2730
|
+
}
|
|
2731
|
+
|
|
2732
|
+
function findOptionByValue(options, value) {
|
|
2733
|
+
return options?.find?.((o) => o.value === value);
|
|
2734
|
+
}
|
|
2735
|
+
|
|
2736
|
+
function getHintText(options, selected, hint, opts = {}) {
|
|
2737
|
+
if (!isNil(hint)) {
|
|
2738
|
+
return hint;
|
|
2739
|
+
}
|
|
2740
|
+
if (opts.multiple && options?.length > 1) {
|
|
2741
|
+
return (selected?.length || 0) + '/' + options.length;
|
|
2742
|
+
}
|
|
2743
|
+
if (!selected?.length) {
|
|
2744
|
+
return '';
|
|
2745
|
+
}
|
|
2746
|
+
const option = findOptionByValue(options, selected[0]);
|
|
2747
|
+
return opts.showLabel ? option?.label : option?.description;
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
class SelectFieldComponent extends FormControlSuperclass {
|
|
2751
|
+
constructor() {
|
|
2752
|
+
super(...arguments);
|
|
2753
|
+
this.options = [];
|
|
2754
|
+
this.searchChange = new EventEmitter();
|
|
2755
|
+
this.appearance = 'fill';
|
|
2756
|
+
this.progress = false;
|
|
2757
|
+
this.externalSearch = false;
|
|
2758
|
+
this.multiple = false;
|
|
2759
|
+
this.required = false;
|
|
2760
|
+
this.searchStr = '';
|
|
2761
|
+
this.search = (term, item) => {
|
|
2762
|
+
return this.externalSearch || isSearchOption(item, term.toLowerCase());
|
|
2763
|
+
};
|
|
2764
|
+
}
|
|
2765
|
+
get hintText() {
|
|
2766
|
+
return getHintText(this.options, this.multiple ? this.control.value : [this.control.value], this.hint, {
|
|
2767
|
+
multiple: this.multiple,
|
|
2768
|
+
});
|
|
2769
|
+
}
|
|
2770
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SelectFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2771
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.0.6", type: SelectFieldComponent, isStandalone: false, selector: "v-select-field", inputs: { options: "options", appearance: "appearance", label: "label", hint: "hint", error: "error", progress: "progress", externalSearch: ["externalSearch", "externalSearch", booleanAttribute], multiple: ["multiple", "multiple", booleanAttribute], required: ["required", "required", booleanAttribute], size: "size" }, outputs: { searchChange: "searchChange" }, providers: createControlProviders(() => SelectFieldComponent), usesInheritance: true, ngImport: i0, template: "<mat-form-field [appearance]=\"appearance\" [ngClass]=\"{ 'v-input-field__small': size === 'small' }\">\n <mat-label>{{ label }}</mat-label>\n\n <mtx-select\n [closeOnSelect]=\"!multiple\"\n [formControl]=\"control\"\n [items]=\"options\"\n [loading]=\"progress\"\n [markFirst]=\"true\"\n [multiple]=\"multiple\"\n [notFoundText]=\"externalSearch && !searchStr ? 'Enter your search term' : 'No items found'\"\n [required]=\"required\"\n [searchable]=\"true\"\n [searchFn]=\"search\"\n [selectableGroup]=\"true\"\n [selectableGroupAsModel]=\"false\"\n bindLabel=\"label\"\n bindValue=\"value\"\n groupBy=\"type\"\n (clear)=\"searchChange.emit(''); searchStr = ''\"\n (search)=\"searchChange.emit($event.term); searchStr = $event.term\"\n >\n <ng-template let-index=\"index\" let-item=\"item\" let-item$=\"item$\" ng-optgroup-tmp>\n <mat-checkbox\n *ngIf=\"multiple; else text\"\n [ngModel]=\"item$.selected\"\n class=\"checkbox-option\"\n id=\"item-{{ index }}\"\n >\n {{ item.type | uppercase }}\n </mat-checkbox>\n <ng-template #text>\n {{ item.type | uppercase }}\n </ng-template>\n </ng-template>\n <ng-template let-index=\"index\" let-item=\"item\" let-item$=\"item$\" ng-option-tmp>\n <mat-checkbox\n *ngIf=\"multiple; else text\"\n [ngModel]=\"item$.selected\"\n class=\"checkbox-option\"\n id=\"item-{{ index }}\"\n >\n <ng-container *ngTemplateOutlet=\"text\"></ng-container>\n </mat-checkbox>\n <ng-template #text>\n <div class=\"label\">{{ item.label }}</div>\n <div\n *ngIf=\"item.description\"\n class=\"description mat-label-medium mat-secondary-text\"\n >\n {{ item.description }}\n </div>\n </ng-template>\n </ng-template>\n </mtx-select>\n\n <mat-hint>{{ hintText }}</mat-hint>\n <mat-error>{{ error }}</mat-error>\n</mat-form-field>\n", styles: ["::ng-deep .mat-mdc-form-field{width:100%}::ng-deep .mat-mdc-form-field>*{max-height:56px}::ng-deep .mat-mdc-form-field .ng-value-container{flex-wrap:nowrap!important;overflow-x:hidden}::ng-deep .ng-dropdown-panel.ng-select-bottom{margin-top:-4px}.checkbox-option{margin:-12px 0 -12px -8px}.label,.description{overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: i3$2.MtxSelect, selector: "mtx-select", inputs: ["addTag", "addTagText", "appearance", "appendTo", "bindLabel", "bindValue", "closeOnSelect", "clearAllText", "clearable", "clearOnBackspace", "compareWith", "dropdownPosition", "groupBy", "groupValue", "bufferAmount", "selectableGroup", "selectableGroupAsModel", "hideSelected", "loading", "loadingText", "labelForId", "markFirst", "maxSelectedItems", "multiple", "notFoundText", "searchable", "readonly", "searchFn", "searchWhileComposing", "selectOnTab", "trackByFn", "inputAttrs", "tabIndex", "openOnEnter", "minTermLength", "editableSearchTerm", "keyDownFn", "virtualScroll", "typeToSearchText", "typeahead", "isOpen", "fixedPlaceholder", "deselectOnClick", "clearSearchOnAdd", "items", "value", "id", "placeholder", "disabled", "required", "errorStateMatcher", "aria-label", "aria-labelledby"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"], exportAs: ["mtxSelect"] }, { kind: "directive", type: i3$2.MtxSelectOptgroupTemplate, selector: "[ng-optgroup-tmp]" }, { kind: "directive", type: i3$2.MtxSelectOptionTemplate, selector: "[ng-option-tmp]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "pipe", type: i1$1.UpperCasePipe, name: "uppercase" }] }); }
|
|
2772
|
+
}
|
|
2773
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SelectFieldComponent, decorators: [{
|
|
2774
|
+
type: Component,
|
|
2775
|
+
args: [{ selector: 'v-select-field', providers: createControlProviders(() => SelectFieldComponent), standalone: false, template: "<mat-form-field [appearance]=\"appearance\" [ngClass]=\"{ 'v-input-field__small': size === 'small' }\">\n <mat-label>{{ label }}</mat-label>\n\n <mtx-select\n [closeOnSelect]=\"!multiple\"\n [formControl]=\"control\"\n [items]=\"options\"\n [loading]=\"progress\"\n [markFirst]=\"true\"\n [multiple]=\"multiple\"\n [notFoundText]=\"externalSearch && !searchStr ? 'Enter your search term' : 'No items found'\"\n [required]=\"required\"\n [searchable]=\"true\"\n [searchFn]=\"search\"\n [selectableGroup]=\"true\"\n [selectableGroupAsModel]=\"false\"\n bindLabel=\"label\"\n bindValue=\"value\"\n groupBy=\"type\"\n (clear)=\"searchChange.emit(''); searchStr = ''\"\n (search)=\"searchChange.emit($event.term); searchStr = $event.term\"\n >\n <ng-template let-index=\"index\" let-item=\"item\" let-item$=\"item$\" ng-optgroup-tmp>\n <mat-checkbox\n *ngIf=\"multiple; else text\"\n [ngModel]=\"item$.selected\"\n class=\"checkbox-option\"\n id=\"item-{{ index }}\"\n >\n {{ item.type | uppercase }}\n </mat-checkbox>\n <ng-template #text>\n {{ item.type | uppercase }}\n </ng-template>\n </ng-template>\n <ng-template let-index=\"index\" let-item=\"item\" let-item$=\"item$\" ng-option-tmp>\n <mat-checkbox\n *ngIf=\"multiple; else text\"\n [ngModel]=\"item$.selected\"\n class=\"checkbox-option\"\n id=\"item-{{ index }}\"\n >\n <ng-container *ngTemplateOutlet=\"text\"></ng-container>\n </mat-checkbox>\n <ng-template #text>\n <div class=\"label\">{{ item.label }}</div>\n <div\n *ngIf=\"item.description\"\n class=\"description mat-label-medium mat-secondary-text\"\n >\n {{ item.description }}\n </div>\n </ng-template>\n </ng-template>\n </mtx-select>\n\n <mat-hint>{{ hintText }}</mat-hint>\n <mat-error>{{ error }}</mat-error>\n</mat-form-field>\n", styles: ["::ng-deep .mat-mdc-form-field{width:100%}::ng-deep .mat-mdc-form-field>*{max-height:56px}::ng-deep .mat-mdc-form-field .ng-value-container{flex-wrap:nowrap!important;overflow-x:hidden}::ng-deep .ng-dropdown-panel.ng-select-bottom{margin-top:-4px}.checkbox-option{margin:-12px 0 -12px -8px}.label,.description{overflow:hidden;text-overflow:ellipsis}\n"] }]
|
|
2776
|
+
}], propDecorators: { options: [{
|
|
2777
|
+
type: Input
|
|
2778
|
+
}], searchChange: [{
|
|
2779
|
+
type: Output
|
|
2780
|
+
}], appearance: [{
|
|
2781
|
+
type: Input
|
|
2782
|
+
}], label: [{
|
|
2783
|
+
type: Input
|
|
2784
|
+
}], hint: [{
|
|
2785
|
+
type: Input
|
|
2786
|
+
}], error: [{
|
|
2787
|
+
type: Input
|
|
2788
|
+
}], progress: [{
|
|
2789
|
+
type: Input
|
|
2790
|
+
}], externalSearch: [{
|
|
2791
|
+
type: Input,
|
|
2792
|
+
args: [{ transform: booleanAttribute }]
|
|
2793
|
+
}], multiple: [{
|
|
2794
|
+
type: Input,
|
|
2795
|
+
args: [{ transform: booleanAttribute }]
|
|
2796
|
+
}], required: [{
|
|
2797
|
+
type: Input,
|
|
2798
|
+
args: [{ transform: booleanAttribute }]
|
|
2799
|
+
}], size: [{
|
|
2800
|
+
type: Input
|
|
2801
|
+
}] } });
|
|
2802
|
+
|
|
2803
|
+
class SelectFieldModule {
|
|
2804
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SelectFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2805
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: SelectFieldModule, declarations: [SelectFieldComponent], imports: [CommonModule,
|
|
2806
|
+
MatInputModule,
|
|
2807
|
+
MtxSelectModule,
|
|
2808
|
+
FormsModule,
|
|
2809
|
+
ReactiveFormsModule,
|
|
2810
|
+
MatCheckboxModule], exports: [SelectFieldComponent] }); }
|
|
2811
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SelectFieldModule, imports: [CommonModule,
|
|
2812
|
+
MatInputModule,
|
|
2813
|
+
MtxSelectModule,
|
|
2814
|
+
FormsModule,
|
|
2815
|
+
ReactiveFormsModule,
|
|
2816
|
+
MatCheckboxModule] }); }
|
|
2817
|
+
}
|
|
2818
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SelectFieldModule, decorators: [{
|
|
2819
|
+
type: NgModule,
|
|
2820
|
+
args: [{
|
|
2821
|
+
declarations: [SelectFieldComponent],
|
|
2822
|
+
exports: [SelectFieldComponent],
|
|
2823
|
+
imports: [
|
|
2824
|
+
CommonModule,
|
|
2825
|
+
MatInputModule,
|
|
2826
|
+
MtxSelectModule,
|
|
2827
|
+
FormsModule,
|
|
2828
|
+
ReactiveFormsModule,
|
|
2829
|
+
MatCheckboxModule,
|
|
2830
|
+
],
|
|
2831
|
+
}]
|
|
2832
|
+
}] });
|
|
2833
|
+
|
|
2834
|
+
class AutocompleteFieldComponent extends FormControlSuperclass {
|
|
2835
|
+
constructor() {
|
|
2836
|
+
super(...arguments);
|
|
2837
|
+
this.options = [];
|
|
2838
|
+
this.type = 'text';
|
|
2839
|
+
this.mono = false;
|
|
2840
|
+
this.required = false;
|
|
2841
|
+
this.options$ = new BehaviorSubject([]);
|
|
2842
|
+
this.selected$ = merge(this.control.valueChanges, this.options$).pipe(map(() => (this.options || []).find((o) => o.value === this.control.value)), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
2843
|
+
this.filteredOptions$ = merge(this.control.valueChanges, this.options$).pipe(map(() => String(this.control.value ?? '').toLowerCase()), map((filter) => searchOptions(this.options, filter)), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
2844
|
+
}
|
|
2845
|
+
get hintText() {
|
|
2846
|
+
return getHintText(this.options, [this.control.value], this.hint, { showLabel: true });
|
|
2847
|
+
}
|
|
2848
|
+
ngOnChanges(changes) {
|
|
2849
|
+
super.ngOnChanges(changes);
|
|
2850
|
+
if (changes.options) {
|
|
2851
|
+
this.options$.next(this.options || []);
|
|
2852
|
+
}
|
|
2853
|
+
}
|
|
2854
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: AutocompleteFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2855
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: AutocompleteFieldComponent, isStandalone: false, selector: "v-autocomplete-field", inputs: { options: "options", label: "label", hint: "hint", error: "error", type: "type", mono: ["mono", "mono", booleanAttribute], required: ["required", "required", booleanAttribute] }, providers: createControlProviders(() => AutocompleteFieldComponent), usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<mat-form-field style=\"width: 100%\">\n <mat-label>{{ label }}</mat-label>\n\n <input\n #trigger=\"matAutocompleteTrigger\"\n [formControl]=\"control\"\n [matAutocomplete]=\"auto\"\n [ngClass]=\"{ 'mat-mono': mono }\"\n [required]=\"required\"\n [type]=\"options?.length ? 'text' : type\"\n matInput\n />\n\n <mat-autocomplete #auto=\"matAutocomplete\" autoActiveFirstOption>\n @for (option of filteredOptions$ | async; track option) {\n <mat-option [value]=\"option.value\">\n <div [ngClass]=\"{ 'mat-mono': mono }\" class=\"label\">{{ option.label }}</div>\n @if (option.description) {\n <div\n [ngClass]=\"{ 'mat-mono': mono }\"\n class=\"description mat-label-medium mat-secondary-text\"\n >\n {{ option.description }}\n </div>\n }\n </mat-option>\n }\n </mat-autocomplete>\n\n <div matSuffix style=\"display: flex; gap: 4px\">\n @if (control.value) {\n <button mat-icon-button (click)=\"control.reset(); $event.stopPropagation()\">\n <mat-icon>clear</mat-icon>\n </button>\n }\n @if (options?.length) {\n <button\n mat-icon-button\n (click)=\"\n auto.isOpen ? trigger.closePanel() : trigger.openPanel();\n $event.stopPropagation()\n \"\n >\n <mat-icon>{{ auto.isOpen ? 'expand_less' : 'expand_more' }}</mat-icon>\n </button>\n }\n </div>\n <mat-hint>{{ hintText }}</mat-hint>\n <mat-error>{{\n error ??\n ((selected$ | async) ? (selected$ | async)?.label + (hint ? ' | ' + hint : '') : hint)\n }}</mat-error>\n</mat-form-field>\n", styles: [".label,.description{overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i5.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i6$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i5.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i1$4.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] }); }
|
|
2856
|
+
}
|
|
2857
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: AutocompleteFieldComponent, decorators: [{
|
|
2858
|
+
type: Component,
|
|
2859
|
+
args: [{ selector: 'v-autocomplete-field', providers: createControlProviders(() => AutocompleteFieldComponent), standalone: false, template: "<mat-form-field style=\"width: 100%\">\n <mat-label>{{ label }}</mat-label>\n\n <input\n #trigger=\"matAutocompleteTrigger\"\n [formControl]=\"control\"\n [matAutocomplete]=\"auto\"\n [ngClass]=\"{ 'mat-mono': mono }\"\n [required]=\"required\"\n [type]=\"options?.length ? 'text' : type\"\n matInput\n />\n\n <mat-autocomplete #auto=\"matAutocomplete\" autoActiveFirstOption>\n @for (option of filteredOptions$ | async; track option) {\n <mat-option [value]=\"option.value\">\n <div [ngClass]=\"{ 'mat-mono': mono }\" class=\"label\">{{ option.label }}</div>\n @if (option.description) {\n <div\n [ngClass]=\"{ 'mat-mono': mono }\"\n class=\"description mat-label-medium mat-secondary-text\"\n >\n {{ option.description }}\n </div>\n }\n </mat-option>\n }\n </mat-autocomplete>\n\n <div matSuffix style=\"display: flex; gap: 4px\">\n @if (control.value) {\n <button mat-icon-button (click)=\"control.reset(); $event.stopPropagation()\">\n <mat-icon>clear</mat-icon>\n </button>\n }\n @if (options?.length) {\n <button\n mat-icon-button\n (click)=\"\n auto.isOpen ? trigger.closePanel() : trigger.openPanel();\n $event.stopPropagation()\n \"\n >\n <mat-icon>{{ auto.isOpen ? 'expand_less' : 'expand_more' }}</mat-icon>\n </button>\n }\n </div>\n <mat-hint>{{ hintText }}</mat-hint>\n <mat-error>{{\n error ??\n ((selected$ | async) ? (selected$ | async)?.label + (hint ? ' | ' + hint : '') : hint)\n }}</mat-error>\n</mat-form-field>\n", styles: [".label,.description{overflow:hidden;text-overflow:ellipsis}\n"] }]
|
|
2860
|
+
}], propDecorators: { options: [{
|
|
2861
|
+
type: Input
|
|
2862
|
+
}], label: [{
|
|
2863
|
+
type: Input
|
|
2864
|
+
}], hint: [{
|
|
2865
|
+
type: Input
|
|
2866
|
+
}], error: [{
|
|
2867
|
+
type: Input
|
|
2868
|
+
}], type: [{
|
|
2869
|
+
type: Input
|
|
2870
|
+
}], mono: [{
|
|
2871
|
+
type: Input,
|
|
2872
|
+
args: [{ transform: booleanAttribute }]
|
|
2873
|
+
}], required: [{
|
|
2874
|
+
type: Input,
|
|
2875
|
+
args: [{ transform: booleanAttribute }]
|
|
2876
|
+
}] } });
|
|
2877
|
+
|
|
2878
|
+
class AutocompleteFieldModule {
|
|
2879
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: AutocompleteFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2880
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: AutocompleteFieldModule, declarations: [AutocompleteFieldComponent], imports: [CommonModule,
|
|
2881
|
+
MatInputModule,
|
|
2882
|
+
FormsModule,
|
|
2883
|
+
ReactiveFormsModule,
|
|
2884
|
+
MatAutocompleteModule,
|
|
2885
|
+
MatButtonModule,
|
|
2886
|
+
MatIconModule], exports: [AutocompleteFieldComponent] }); }
|
|
2887
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: AutocompleteFieldModule, imports: [CommonModule,
|
|
2888
|
+
MatInputModule,
|
|
2889
|
+
FormsModule,
|
|
2890
|
+
ReactiveFormsModule,
|
|
2891
|
+
MatAutocompleteModule,
|
|
2892
|
+
MatButtonModule,
|
|
2893
|
+
MatIconModule] }); }
|
|
2894
|
+
}
|
|
2895
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: AutocompleteFieldModule, decorators: [{
|
|
2896
|
+
type: NgModule,
|
|
2897
|
+
args: [{
|
|
2898
|
+
declarations: [AutocompleteFieldComponent],
|
|
2899
|
+
exports: [AutocompleteFieldComponent],
|
|
2900
|
+
imports: [
|
|
2901
|
+
CommonModule,
|
|
2902
|
+
MatInputModule,
|
|
2903
|
+
FormsModule,
|
|
2904
|
+
ReactiveFormsModule,
|
|
2905
|
+
MatAutocompleteModule,
|
|
2906
|
+
MatButtonModule,
|
|
2907
|
+
MatIconModule,
|
|
2908
|
+
],
|
|
2909
|
+
}]
|
|
2910
|
+
}] });
|
|
2911
|
+
|
|
2912
|
+
class ConfigServiceSuperclass {
|
|
2913
|
+
constructor(http) {
|
|
2914
|
+
this.http = http;
|
|
2915
|
+
}
|
|
2916
|
+
async init({ configUrl }) {
|
|
2917
|
+
this.config = await lastValueFrom(this.http.get(configUrl));
|
|
2918
|
+
}
|
|
2919
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ConfigServiceSuperclass, deps: [{ token: i1$6.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2920
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ConfigServiceSuperclass }); }
|
|
2921
|
+
}
|
|
2922
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ConfigServiceSuperclass, decorators: [{
|
|
2923
|
+
type: Injectable
|
|
2924
|
+
}], ctorParameters: () => [{ type: i1$6.HttpClient }] });
|
|
2925
|
+
|
|
2926
|
+
const DEFAULT_ERROR_NAME = 'Unknown error';
|
|
2927
|
+
class LogError {
|
|
2928
|
+
get name() {
|
|
2929
|
+
return String(this.source?.['name'] || DEFAULT_ERROR_NAME);
|
|
2930
|
+
}
|
|
2931
|
+
get message() {
|
|
2932
|
+
return String(this.source?.['message'] || this.name);
|
|
2933
|
+
}
|
|
2934
|
+
get cause() {
|
|
2935
|
+
return this.source?.['cause'];
|
|
2936
|
+
}
|
|
2937
|
+
get details() {
|
|
2938
|
+
return Object.fromEntries(Object.entries(this.source).filter(([k, v]) => k !== 'name' && k !== 'message' && v));
|
|
2939
|
+
}
|
|
2940
|
+
constructor(error) {
|
|
2941
|
+
this.source = (isObject$1(error)
|
|
2942
|
+
? error
|
|
2943
|
+
: new Error(error ? String(error) : DEFAULT_ERROR_NAME));
|
|
2944
|
+
}
|
|
2945
|
+
getLogMessage(message) {
|
|
2946
|
+
return [
|
|
2947
|
+
message && `Caught error: ${message}`,
|
|
2948
|
+
this.name && `Name: ${this.name}`,
|
|
2949
|
+
this.message && `Message: ${this.message}`,
|
|
2950
|
+
Object.keys(this.details).length && JSON.stringify(this.details, null, 2),
|
|
2951
|
+
]
|
|
2952
|
+
.filter(Boolean)
|
|
2953
|
+
.join('\n');
|
|
2954
|
+
}
|
|
2955
|
+
}
|
|
2956
|
+
|
|
2957
|
+
const DEFAULT_DURATION_MS = 3_000;
|
|
2958
|
+
const DEFAULT_ERROR_DURATION_MS = 10_000;
|
|
2959
|
+
const DEFAULT_TIMEOUT_MS = 10_000;
|
|
2960
|
+
class NotifyLogService {
|
|
2961
|
+
constructor(snackBar) {
|
|
2962
|
+
this.snackBar = snackBar;
|
|
2963
|
+
this.success = (message = 'Completed successfully') => {
|
|
2964
|
+
this.notify(message);
|
|
2965
|
+
};
|
|
2966
|
+
this.error = (errors, message) => {
|
|
2967
|
+
const logErrors = (Array.isArray(errors) ? errors : [errors]).map((e) => new LogError(e));
|
|
2968
|
+
message = message || (logErrors.length === 1 ? logErrors[0].message : DEFAULT_ERROR_NAME);
|
|
2969
|
+
this.subscribeWithTimeout(message, (msg) => {
|
|
2970
|
+
console.warn([`Caught error: ${msg}.`, ...logErrors.map((e) => e.getLogMessage())].join('\n'));
|
|
2971
|
+
});
|
|
2972
|
+
this.notify(message, DEFAULT_ERROR_DURATION_MS);
|
|
2973
|
+
};
|
|
2974
|
+
}
|
|
2975
|
+
createErrorOperation(operation, objectName) {
|
|
2976
|
+
return (err) => this.errorOperation(err, operation, objectName);
|
|
2977
|
+
}
|
|
2978
|
+
successOperation(operation, objectName) {
|
|
2979
|
+
let message;
|
|
2980
|
+
switch (operation) {
|
|
2981
|
+
case 'create':
|
|
2982
|
+
message = `${capitalize(objectName)} created successfully`;
|
|
2983
|
+
break;
|
|
2984
|
+
case 'receive':
|
|
2985
|
+
message = `${capitalize(objectName)} received successfully`;
|
|
2986
|
+
break;
|
|
2987
|
+
case 'update':
|
|
2988
|
+
message = `${capitalize(objectName)} updated successfully`;
|
|
2989
|
+
break;
|
|
2990
|
+
case 'delete':
|
|
2991
|
+
message = `${capitalize(objectName)} deleted successfully`;
|
|
2992
|
+
break;
|
|
2993
|
+
}
|
|
2994
|
+
this.success(message);
|
|
2995
|
+
}
|
|
2996
|
+
errorOperation(errors, operation, objectName) {
|
|
2997
|
+
let message;
|
|
2998
|
+
switch (operation) {
|
|
2999
|
+
case 'create':
|
|
3000
|
+
message = `Error creating ${objectName}`;
|
|
3001
|
+
break;
|
|
3002
|
+
case 'receive':
|
|
3003
|
+
message = `Error retrieving ${objectName}`;
|
|
3004
|
+
break;
|
|
3005
|
+
case 'update':
|
|
3006
|
+
message = `Error updating ${objectName}`;
|
|
3007
|
+
break;
|
|
3008
|
+
case 'delete':
|
|
3009
|
+
message = `Error deleting ${objectName}`;
|
|
3010
|
+
break;
|
|
3011
|
+
}
|
|
3012
|
+
this.error(errors, message);
|
|
3013
|
+
}
|
|
3014
|
+
notify(message, duration = DEFAULT_DURATION_MS) {
|
|
3015
|
+
this.subscribeWithTimeout(message, {
|
|
3016
|
+
next: (msg) => {
|
|
3017
|
+
this.snackBar.open(msg, 'OK', {
|
|
3018
|
+
duration,
|
|
3019
|
+
});
|
|
3020
|
+
},
|
|
3021
|
+
error: () => {
|
|
3022
|
+
// TODO: Default message
|
|
3023
|
+
},
|
|
3024
|
+
});
|
|
3025
|
+
}
|
|
3026
|
+
subscribeWithTimeout(possiblyAsync, subscribe) {
|
|
3027
|
+
getPossiblyAsyncObservable(possiblyAsync)
|
|
3028
|
+
.pipe(first$1(), timeout(DEFAULT_TIMEOUT_MS))
|
|
3029
|
+
.subscribe(subscribe);
|
|
3030
|
+
}
|
|
3031
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NotifyLogService, deps: [{ token: i1$7.MatSnackBar }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3032
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NotifyLogService, providedIn: 'root' }); }
|
|
3033
|
+
}
|
|
3034
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NotifyLogService, decorators: [{
|
|
3035
|
+
type: Injectable,
|
|
3036
|
+
args: [{ providedIn: 'root' }]
|
|
3037
|
+
}], ctorParameters: () => [{ type: i1$7.MatSnackBar }] });
|
|
3038
|
+
|
|
3039
|
+
class LogModule {
|
|
3040
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: LogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3041
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: LogModule, imports: [MatSnackBarModule] }); }
|
|
3042
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: LogModule, providers: [NotifyLogService], imports: [MatSnackBarModule] }); }
|
|
3043
|
+
}
|
|
3044
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: LogModule, decorators: [{
|
|
3045
|
+
type: NgModule,
|
|
3046
|
+
args: [{
|
|
3047
|
+
imports: [MatSnackBarModule],
|
|
3048
|
+
providers: [NotifyLogService],
|
|
3049
|
+
}]
|
|
3050
|
+
}] });
|
|
3051
|
+
|
|
3052
|
+
const DEFAULT_SIZE = 25;
|
|
3053
|
+
class FetchSuperclass {
|
|
3054
|
+
constructor() {
|
|
3055
|
+
this.result$ = defer(() => this.state$).pipe(map$1(({ result }) => result));
|
|
3056
|
+
this.hasMore$ = defer(() => this.state$).pipe(map$1(({ continuationToken }) => !!continuationToken));
|
|
3057
|
+
this.isLoading$ = inProgressFrom(() => this.progress$, () => this.state$);
|
|
3058
|
+
this.fetch$ = new BehaviorSubject({ type: 'init' });
|
|
3059
|
+
this.progress$ = new BehaviorSubject(0);
|
|
3060
|
+
this.state$ = defer(() => {
|
|
3061
|
+
const resAction$ = this.fetch$.pipe(skipWhile((action) => action.type !== 'load'));
|
|
3062
|
+
return race(concat(resAction$.pipe(take(1), delay(1000)), resAction$), resAction$.pipe(skip(1)));
|
|
3063
|
+
}).pipe(tap((action) => {
|
|
3064
|
+
if (action.type === 'load') {
|
|
3065
|
+
this.skipPrevious$.next(true);
|
|
3066
|
+
}
|
|
3067
|
+
}), mergeScan((acc, action) => {
|
|
3068
|
+
const params = (action.type === 'load' ? action.params : acc.params);
|
|
3069
|
+
const size = action.size ?? acc.size;
|
|
3070
|
+
const continuationToken = action.type === 'more' ? acc.continuationToken : undefined;
|
|
3071
|
+
return this.fetch(params, { size, continuationToken }).pipe(...(action.type === 'load'
|
|
3072
|
+
? [
|
|
3073
|
+
startWith({
|
|
3074
|
+
params,
|
|
3075
|
+
result: [],
|
|
3076
|
+
size,
|
|
3077
|
+
continuationToken: undefined,
|
|
3078
|
+
}),
|
|
3079
|
+
]
|
|
3080
|
+
: []), map$1(({ result, continuationToken }) => ({
|
|
3081
|
+
params,
|
|
3082
|
+
result: action.type === 'load' || action.type === 'reload'
|
|
3083
|
+
? result
|
|
3084
|
+
: [...(acc.result ?? []), ...result],
|
|
3085
|
+
size,
|
|
3086
|
+
continuationToken,
|
|
3087
|
+
})), progressTo(this.progress$), takeUntil(this.skipPrevious$));
|
|
3088
|
+
}, {
|
|
3089
|
+
size: DEFAULT_SIZE,
|
|
3090
|
+
result: [],
|
|
3091
|
+
}, 1), shareReplay({ bufferSize: 1, refCount: true }));
|
|
3092
|
+
this.skipPrevious$ = new Subject();
|
|
3093
|
+
}
|
|
3094
|
+
load(params, options = {}) {
|
|
3095
|
+
this.fetch$.next({ type: 'load', params, size: options.size });
|
|
3096
|
+
}
|
|
3097
|
+
reload(options = {}) {
|
|
3098
|
+
this.fetch$.next({ type: 'reload', size: options.size });
|
|
3099
|
+
}
|
|
3100
|
+
more() {
|
|
3101
|
+
this.fetch$.next({ type: 'more' });
|
|
3102
|
+
}
|
|
3103
|
+
}
|
|
3104
|
+
class SingleFetchSuperclass extends FetchSuperclass {
|
|
3105
|
+
constructor() {
|
|
3106
|
+
super(...arguments);
|
|
3107
|
+
this.more = () => undefined;
|
|
3108
|
+
}
|
|
3109
|
+
}
|
|
3110
|
+
|
|
3111
|
+
const DATE_QUERY_PARAMS_SERIALIZERS = [
|
|
3112
|
+
{
|
|
3113
|
+
id: 'date',
|
|
3114
|
+
serialize: (date) => date?.toISOString(),
|
|
3115
|
+
deserialize: (value) => new Date(value),
|
|
3116
|
+
recognize: (value) => value instanceof Date,
|
|
3117
|
+
},
|
|
3118
|
+
{
|
|
3119
|
+
id: 'dateRange',
|
|
3120
|
+
serialize: ({ start, end }) => `${start?.toISOString()}|${end?.toISOString()}`,
|
|
3121
|
+
deserialize: (value) => {
|
|
3122
|
+
const [start, end] = value.split('|').map((p) => (p ? new Date(p) : null));
|
|
3123
|
+
return { start, end };
|
|
3124
|
+
},
|
|
3125
|
+
recognize: (value) => {
|
|
3126
|
+
if (typeof value !== 'object') {
|
|
3127
|
+
return false;
|
|
3128
|
+
}
|
|
3129
|
+
const { start, end, ...other } = value;
|
|
3130
|
+
if (Object.keys(other).length) {
|
|
3131
|
+
return false;
|
|
3132
|
+
}
|
|
3133
|
+
return start instanceof Date || end instanceof Date;
|
|
3134
|
+
},
|
|
3135
|
+
},
|
|
3136
|
+
];
|
|
3137
|
+
|
|
3138
|
+
const QUERY_PARAMS_SERIALIZERS = new InjectionToken('query params serializers');
|
|
3139
|
+
|
|
3140
|
+
function deserializeQueryParam(value, serializers = []) {
|
|
3141
|
+
const serializer = serializers
|
|
3142
|
+
.sort((a, b) => b.id.length - a.id.length)
|
|
3143
|
+
.find((s) => value.startsWith(s.id));
|
|
3144
|
+
return (serializer
|
|
3145
|
+
? serializer.deserialize(value.slice(serializer.id.length))
|
|
3146
|
+
: JSON.parse(value || ''));
|
|
3147
|
+
}
|
|
3148
|
+
|
|
3149
|
+
function serializeQueryParam(value, serializers = []) {
|
|
3150
|
+
const serializer = serializers
|
|
3151
|
+
.sort((a, b) => b.id.length - a.id.length)
|
|
3152
|
+
.find((s) => s.recognize(value));
|
|
3153
|
+
return serializer ? serializer.id + serializer.serialize(value) : JSON.stringify(value);
|
|
3154
|
+
}
|
|
3155
|
+
|
|
3156
|
+
const NS_PARAM_PREFIX = '__';
|
|
3157
|
+
class QueryParamsService {
|
|
3158
|
+
get params() {
|
|
3159
|
+
return this.deserialize(this.getSourceParams().main);
|
|
3160
|
+
}
|
|
3161
|
+
constructor(router, route, serializers) {
|
|
3162
|
+
this.router = router;
|
|
3163
|
+
this.route = route;
|
|
3164
|
+
this.serializers = serializers;
|
|
3165
|
+
this.params$ = defer(() => this.sourceParams$).pipe(map(({ main }) => main), distinctUntilChanged(isEqual), map((params) => this.deserialize(params)), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
3166
|
+
this.sourceParams$ = concat(this.router.events.pipe(startWith(null), skipWhile(() => !this.router.navigated), map(() => this.route.snapshot.queryParams), take(1)), this.route.queryParams).pipe(distinctUntilChanged(isEqual), map((p) => this.getSourceParams(p)), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
3167
|
+
if (!this.serializers) {
|
|
3168
|
+
this.serializers = [];
|
|
3169
|
+
}
|
|
3170
|
+
}
|
|
3171
|
+
async set(params, options = {}) {
|
|
3172
|
+
return await this.setParams(params, undefined, options);
|
|
3173
|
+
}
|
|
3174
|
+
async patch(params, options = {}) {
|
|
3175
|
+
return await this.setParams(params, undefined, { ...options, isPatch: true });
|
|
3176
|
+
}
|
|
3177
|
+
createNamespace(ns) {
|
|
3178
|
+
const getNamespaceSourceParams = (sourceParams = this.getSourceParams()) => sourceParams.namespaces[NS_PARAM_PREFIX + ns];
|
|
3179
|
+
const getNamespaceParams = () => this.deserializeNamespace(getNamespaceSourceParams());
|
|
3180
|
+
return {
|
|
3181
|
+
params$: this.sourceParams$.pipe(map((sourceParams) => getNamespaceSourceParams(sourceParams)), distinctUntilChanged(isEqual), map((params) => this.deserializeNamespace(params)), shareReplay({ refCount: true, bufferSize: 1 })),
|
|
3182
|
+
get params() {
|
|
3183
|
+
return getNamespaceParams();
|
|
3184
|
+
},
|
|
3185
|
+
set: async (params, options = {}) => {
|
|
3186
|
+
return await this.setParams(params, ns, options);
|
|
3187
|
+
},
|
|
3188
|
+
patch: async (params, options = {}) => {
|
|
3189
|
+
return await this.setParams(params, ns, { ...options, isPatch: true });
|
|
3190
|
+
},
|
|
3191
|
+
destroy: async () => {
|
|
3192
|
+
await this.setParams({}, ns);
|
|
3193
|
+
},
|
|
3194
|
+
};
|
|
3195
|
+
}
|
|
3196
|
+
async setParams(params, ns, options = {}) {
|
|
3197
|
+
const sourceParams = this.getSourceParams();
|
|
3198
|
+
let queryParams;
|
|
3199
|
+
if (ns) {
|
|
3200
|
+
const nsKey = NS_PARAM_PREFIX + ns;
|
|
3201
|
+
const serializedNamespace = this.serializeNamespace(Object.assign({}, options.isPatch && this.deserializeNamespace(sourceParams.namespaces[nsKey]), params));
|
|
3202
|
+
const otherNamespaces = sourceParams.namespaces;
|
|
3203
|
+
delete otherNamespaces[nsKey];
|
|
3204
|
+
queryParams = Object.assign({}, sourceParams.main, otherNamespaces, !!serializedNamespace && { [nsKey]: serializedNamespace });
|
|
3205
|
+
}
|
|
3206
|
+
else {
|
|
3207
|
+
queryParams = Object.assign({}, options.isPatch && sourceParams.main, this.serialize(params), sourceParams.namespaces);
|
|
3208
|
+
}
|
|
3209
|
+
return await this.router.navigate([], { queryParams });
|
|
3210
|
+
}
|
|
3211
|
+
getSourceParams(source = this.route.snapshot.queryParams) {
|
|
3212
|
+
return Object.entries(source).reduce((acc, [k, v]) => {
|
|
3213
|
+
if (k.startsWith(NS_PARAM_PREFIX)) {
|
|
3214
|
+
acc.namespaces[k] = v;
|
|
3215
|
+
}
|
|
3216
|
+
else {
|
|
3217
|
+
acc.main[k] = v;
|
|
3218
|
+
}
|
|
3219
|
+
return acc;
|
|
3220
|
+
}, { main: {}, namespaces: {} });
|
|
3221
|
+
}
|
|
3222
|
+
serialize(params, options = {}) {
|
|
3223
|
+
const filter = options.filter ?? negate(isEmpty);
|
|
3224
|
+
return Object.entries(params).reduce((acc, [k, v]) => {
|
|
3225
|
+
if (filter(v, k)) {
|
|
3226
|
+
acc[k] = serializeQueryParam(v, this.serializers);
|
|
3227
|
+
}
|
|
3228
|
+
return acc;
|
|
3229
|
+
}, {});
|
|
3230
|
+
}
|
|
3231
|
+
deserialize(params) {
|
|
3232
|
+
if (!params) {
|
|
3233
|
+
return {};
|
|
3234
|
+
}
|
|
3235
|
+
return Object.entries(params).reduce((acc, [k, v]) => {
|
|
3236
|
+
try {
|
|
3237
|
+
acc[k] = deserializeQueryParam(v, this.serializers);
|
|
3238
|
+
}
|
|
3239
|
+
catch (err) {
|
|
3240
|
+
console.error(err);
|
|
3241
|
+
}
|
|
3242
|
+
return acc;
|
|
3243
|
+
}, {});
|
|
3244
|
+
}
|
|
3245
|
+
serializeNamespace(params) {
|
|
3246
|
+
return params && Object.keys(params).length ? JSON.stringify(params) : '';
|
|
3247
|
+
}
|
|
3248
|
+
deserializeNamespace(strParams) {
|
|
3249
|
+
return strParams ? JSON.parse(strParams) : {};
|
|
3250
|
+
}
|
|
3251
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: QueryParamsService, deps: [{ token: i1$5.Router }, { token: i1$5.ActivatedRoute }, { token: QUERY_PARAMS_SERIALIZERS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3252
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: QueryParamsService, providedIn: 'root' }); }
|
|
3253
|
+
}
|
|
3254
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: QueryParamsService, decorators: [{
|
|
3255
|
+
type: Injectable,
|
|
3256
|
+
args: [{ providedIn: 'root' }]
|
|
3257
|
+
}], ctorParameters: () => [{ type: i1$5.Router }, { type: i1$5.ActivatedRoute }, { type: undefined, decorators: [{
|
|
3258
|
+
type: Optional
|
|
3259
|
+
}, {
|
|
3260
|
+
type: Inject,
|
|
3261
|
+
args: [QUERY_PARAMS_SERIALIZERS]
|
|
3262
|
+
}] }] });
|
|
3263
|
+
|
|
3264
|
+
class QueryParamsModule {
|
|
3265
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: QueryParamsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3266
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: QueryParamsModule }); }
|
|
3267
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: QueryParamsModule, providers: [
|
|
3268
|
+
{ provide: QUERY_PARAMS_SERIALIZERS, useValue: DATE_QUERY_PARAMS_SERIALIZERS },
|
|
3269
|
+
QueryParamsService,
|
|
3270
|
+
] }); }
|
|
3271
|
+
}
|
|
3272
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: QueryParamsModule, decorators: [{
|
|
3273
|
+
type: NgModule,
|
|
3274
|
+
args: [{
|
|
3275
|
+
providers: [
|
|
3276
|
+
{ provide: QUERY_PARAMS_SERIALIZERS, useValue: DATE_QUERY_PARAMS_SERIALIZERS },
|
|
3277
|
+
QueryParamsService,
|
|
3278
|
+
],
|
|
3279
|
+
}]
|
|
3280
|
+
}] });
|
|
3281
|
+
|
|
3282
|
+
class UrlService {
|
|
3283
|
+
get url() {
|
|
3284
|
+
return this.router.url && this.router.url !== '/'
|
|
3285
|
+
? this.router.url.split('?', 1)[0].split('#', 1)[0]
|
|
3286
|
+
: window.location.pathname;
|
|
3287
|
+
}
|
|
3288
|
+
get path() {
|
|
3289
|
+
return this.url?.split('/')?.slice(1) ?? [];
|
|
3290
|
+
}
|
|
3291
|
+
constructor(router) {
|
|
3292
|
+
this.router = router;
|
|
3293
|
+
this.url$ = this.router.events.pipe(startWith(null), map(() => this.url), filter((url) => this.router.navigated || (!!url && url !== '/')), distinctUntilChanged(), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
3294
|
+
this.path$ = this.url$.pipe(map(() => this.path), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
3295
|
+
}
|
|
3296
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: UrlService, deps: [{ token: i1$5.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3297
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: UrlService, providedIn: 'root' }); }
|
|
3298
|
+
}
|
|
3299
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: UrlService, decorators: [{
|
|
3300
|
+
type: Injectable,
|
|
3301
|
+
args: [{
|
|
3302
|
+
providedIn: 'root',
|
|
3303
|
+
}]
|
|
3304
|
+
}], ctorParameters: () => [{ type: i1$5.Router }] });
|
|
3305
|
+
|
|
3306
|
+
function hasExtension(fileName, extensions) {
|
|
3307
|
+
return (!extensions?.length ||
|
|
3308
|
+
new RegExp('(' + extensions.join('|').replace(/\./g, '\\.') + ')$').test(fileName));
|
|
3309
|
+
}
|
|
3310
|
+
class FileUploadComponent {
|
|
3311
|
+
constructor(log) {
|
|
3312
|
+
this.log = log;
|
|
3313
|
+
this.extensions = [];
|
|
3314
|
+
this.upload = new EventEmitter();
|
|
3315
|
+
}
|
|
3316
|
+
loadFile(event) {
|
|
3317
|
+
const file = event.target?.files?.[0] ?? null;
|
|
3318
|
+
if (!file) {
|
|
3319
|
+
this.log.error(new Error('File upload error'));
|
|
3320
|
+
return;
|
|
3321
|
+
}
|
|
3322
|
+
if (!hasExtension(file.name, this.extensions)) {
|
|
3323
|
+
this.log.error(new Error(`Supported file types: ${this.extensions.join(', ')}`));
|
|
3324
|
+
return;
|
|
3325
|
+
}
|
|
3326
|
+
this.file = file;
|
|
3327
|
+
this.upload.emit(this.file);
|
|
3328
|
+
}
|
|
3329
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FileUploadComponent, deps: [{ token: NotifyLogService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3330
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.6", type: FileUploadComponent, isStandalone: false, selector: "v-file-upload", inputs: { label: "label", extensions: "extensions" }, outputs: { upload: "upload" }, ngImport: i0, template: "<div class=\"wrapper\">\n <button mat-button type=\"button\" (click)=\"fileInput.click()\">\n {{ label ?? 'Choose File' }}\n </button>\n\n <div class=\"mat-body-medium mat-secondary-text mat-no-margin\">\n {{ file?.name }}\n </div>\n</div>\n\n<input #fileInput hidden type=\"file\" (change)=\"loadFile($event)\" />\n", styles: [".wrapper{display:grid;grid-template-columns:min-content auto;align-items:center;grid-gap:16px}.wrapper>*{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}\n"], dependencies: [{ kind: "component", type: i1$4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] }); }
|
|
3331
|
+
}
|
|
3332
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FileUploadComponent, decorators: [{
|
|
3333
|
+
type: Component,
|
|
3334
|
+
args: [{ selector: 'v-file-upload', standalone: false, template: "<div class=\"wrapper\">\n <button mat-button type=\"button\" (click)=\"fileInput.click()\">\n {{ label ?? 'Choose File' }}\n </button>\n\n <div class=\"mat-body-medium mat-secondary-text mat-no-margin\">\n {{ file?.name }}\n </div>\n</div>\n\n<input #fileInput hidden type=\"file\" (change)=\"loadFile($event)\" />\n", styles: [".wrapper{display:grid;grid-template-columns:min-content auto;align-items:center;grid-gap:16px}.wrapper>*{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}\n"] }]
|
|
3335
|
+
}], ctorParameters: () => [{ type: NotifyLogService }], propDecorators: { label: [{
|
|
3336
|
+
type: Input
|
|
3337
|
+
}], extensions: [{
|
|
3338
|
+
type: Input
|
|
3339
|
+
}], upload: [{
|
|
3340
|
+
type: Output
|
|
3341
|
+
}] } });
|
|
3342
|
+
|
|
3343
|
+
class FileUploadModule {
|
|
3344
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FileUploadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3345
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: FileUploadModule, declarations: [FileUploadComponent], imports: [CommonModule, MatButtonModule], exports: [FileUploadComponent] }); }
|
|
3346
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FileUploadModule, imports: [CommonModule, MatButtonModule] }); }
|
|
3347
|
+
}
|
|
3348
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: FileUploadModule, decorators: [{
|
|
3349
|
+
type: NgModule,
|
|
3350
|
+
args: [{
|
|
3351
|
+
declarations: [FileUploadComponent],
|
|
3352
|
+
exports: [FileUploadComponent],
|
|
3353
|
+
imports: [CommonModule, MatButtonModule],
|
|
3354
|
+
}]
|
|
3355
|
+
}] });
|
|
3356
|
+
|
|
3357
|
+
function loadFileContent(file, encoding = 'utf-8') {
|
|
3358
|
+
return new Observable((subscriber) => {
|
|
3359
|
+
if (!file) {
|
|
3360
|
+
return undefined;
|
|
3361
|
+
}
|
|
3362
|
+
const read = new FileReader();
|
|
3363
|
+
read.readAsText(file, encoding);
|
|
3364
|
+
read.onloadend = function () {
|
|
3365
|
+
if (read.error) {
|
|
3366
|
+
return subscriber.error(read.error);
|
|
3367
|
+
}
|
|
3368
|
+
else {
|
|
3369
|
+
subscriber.next(read.result || '');
|
|
3370
|
+
}
|
|
3371
|
+
subscriber.complete();
|
|
3372
|
+
};
|
|
3373
|
+
});
|
|
3374
|
+
}
|
|
3375
|
+
|
|
3376
|
+
class DatetimeFieldComponent extends FormComponentSuperclass$1 {
|
|
3377
|
+
constructor() {
|
|
3378
|
+
super(...arguments);
|
|
3379
|
+
this.required = false;
|
|
3380
|
+
}
|
|
3381
|
+
get time() {
|
|
3382
|
+
return this.datetime ? format(this.datetime, 'HH:mm') : '';
|
|
3383
|
+
}
|
|
3384
|
+
handleIncomingValue(value) {
|
|
3385
|
+
this.datetime = value ? createDateFromNoTimeZoneString(value) : null;
|
|
3386
|
+
}
|
|
3387
|
+
timeChanged(event) {
|
|
3388
|
+
const [hours, minutes] = event.target.value.split(':');
|
|
3389
|
+
if (!this.datetime) {
|
|
3390
|
+
this.datetime = new Date();
|
|
3391
|
+
}
|
|
3392
|
+
this.datetime.setHours(Number(hours));
|
|
3393
|
+
this.datetime.setMinutes(Number(minutes));
|
|
3394
|
+
this.datetime.setSeconds(0);
|
|
3395
|
+
this.datetime.setMilliseconds(0);
|
|
3396
|
+
this.emitValue();
|
|
3397
|
+
}
|
|
3398
|
+
dateChanged(date) {
|
|
3399
|
+
const v = date.target.value || new Date();
|
|
3400
|
+
if (this.datetime) {
|
|
3401
|
+
this.datetime.setDate(v.getDate());
|
|
3402
|
+
this.datetime.setMonth(v.getMonth());
|
|
3403
|
+
this.datetime.setFullYear(v.getFullYear());
|
|
3404
|
+
}
|
|
3405
|
+
else {
|
|
3406
|
+
this.datetime = v;
|
|
3407
|
+
}
|
|
3408
|
+
this.emitValue();
|
|
3409
|
+
}
|
|
3410
|
+
validate() {
|
|
3411
|
+
return !this.datetime || isValid(this.datetime) ? null : { invalidDatetime: true };
|
|
3412
|
+
}
|
|
3413
|
+
emitValue() {
|
|
3414
|
+
return this.emitOutgoingValue(getNoTimeZoneIsoString(this.datetime));
|
|
3415
|
+
}
|
|
3416
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DatetimeFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
3417
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: DatetimeFieldComponent, isStandalone: false, selector: "v-datetime-field", inputs: { label: "label", required: ["required", "required", booleanAttribute], hint: "hint" }, providers: [
|
|
3418
|
+
...createControlProviders(() => DatetimeFieldComponent),
|
|
3419
|
+
{ provide: MAT_DATE_LOCALE, useValue: enGB },
|
|
3420
|
+
{ provide: DateAdapter, useClass: DateFnsAdapter, deps: [MAT_DATE_LOCALE] },
|
|
3421
|
+
{ provide: MAT_DATE_FORMATS, useValue: MAT_DATE_FNS_FORMATS },
|
|
3422
|
+
], usesInheritance: true, ngImport: i0, template: "<div class=\"wrapper\">\n <mat-form-field class=\"date\">\n <mat-label>\n {{ label }}\n </mat-label>\n <mat-hint>{{ hint }}</mat-hint>\n <input\n [matDatepicker]=\"picker\"\n [required]=\"required\"\n [value]=\"datetime\"\n matInput\n (dateInput)=\"dateChanged($event)\"\n />\n <mat-datepicker-toggle [for]=\"picker\" matSuffix></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n @if (datetime) {\n <mat-form-field class=\"time\">\n <input [value]=\"time\" matInput type=\"time\" (input)=\"timeChanged($event)\" />\n </mat-form-field>\n }\n</div>\n", styles: [".wrapper{display:flex;gap:8px}.wrapper .date{flex:1}.wrapper .time{width:100px}\n"], dependencies: [{ kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i2$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2$7.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i2$7.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i2$7.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }] }); }
|
|
3423
|
+
}
|
|
3424
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DatetimeFieldComponent, decorators: [{
|
|
3425
|
+
type: Component,
|
|
3426
|
+
args: [{ selector: 'v-datetime-field', providers: [
|
|
3427
|
+
...createControlProviders(() => DatetimeFieldComponent),
|
|
3428
|
+
{ provide: MAT_DATE_LOCALE, useValue: enGB },
|
|
3429
|
+
{ provide: DateAdapter, useClass: DateFnsAdapter, deps: [MAT_DATE_LOCALE] },
|
|
3430
|
+
{ provide: MAT_DATE_FORMATS, useValue: MAT_DATE_FNS_FORMATS },
|
|
3431
|
+
], standalone: false, template: "<div class=\"wrapper\">\n <mat-form-field class=\"date\">\n <mat-label>\n {{ label }}\n </mat-label>\n <mat-hint>{{ hint }}</mat-hint>\n <input\n [matDatepicker]=\"picker\"\n [required]=\"required\"\n [value]=\"datetime\"\n matInput\n (dateInput)=\"dateChanged($event)\"\n />\n <mat-datepicker-toggle [for]=\"picker\" matSuffix></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n @if (datetime) {\n <mat-form-field class=\"time\">\n <input [value]=\"time\" matInput type=\"time\" (input)=\"timeChanged($event)\" />\n </mat-form-field>\n }\n</div>\n", styles: [".wrapper{display:flex;gap:8px}.wrapper .date{flex:1}.wrapper .time{width:100px}\n"] }]
|
|
3432
|
+
}], propDecorators: { label: [{
|
|
3433
|
+
type: Input
|
|
3434
|
+
}], required: [{
|
|
3435
|
+
type: Input,
|
|
3436
|
+
args: [{ transform: booleanAttribute }]
|
|
3437
|
+
}], hint: [{
|
|
3438
|
+
type: Input
|
|
3439
|
+
}] } });
|
|
3440
|
+
|
|
3441
|
+
class DatetimeFieldModule {
|
|
3442
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DatetimeFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3443
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: DatetimeFieldModule, declarations: [DatetimeFieldComponent], imports: [CommonModule, MatFormFieldModule, MatInputModule, MatDatepickerModule], exports: [DatetimeFieldComponent] }); }
|
|
3444
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DatetimeFieldModule, imports: [CommonModule, MatFormFieldModule, MatInputModule, MatDatepickerModule] }); }
|
|
3445
|
+
}
|
|
3446
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: DatetimeFieldModule, decorators: [{
|
|
3447
|
+
type: NgModule,
|
|
3448
|
+
args: [{
|
|
3449
|
+
declarations: [DatetimeFieldComponent],
|
|
3450
|
+
exports: [DatetimeFieldComponent],
|
|
3451
|
+
imports: [CommonModule, MatFormFieldModule, MatInputModule, MatDatepickerModule],
|
|
3452
|
+
}]
|
|
3453
|
+
}] });
|
|
3454
|
+
|
|
3455
|
+
class SwitchButtonComponent extends FormControlSuperclass {
|
|
3456
|
+
constructor() {
|
|
3457
|
+
super(...arguments);
|
|
3458
|
+
this.states = [];
|
|
3459
|
+
this.hasChangeValue = false;
|
|
3460
|
+
}
|
|
3461
|
+
get index() {
|
|
3462
|
+
return this.getIndex(this.control.value);
|
|
3463
|
+
}
|
|
3464
|
+
get nextIndex() {
|
|
3465
|
+
const nextIdx = this.index + 1;
|
|
3466
|
+
return nextIdx === this.states.length ? 0 : nextIdx;
|
|
3467
|
+
}
|
|
3468
|
+
get value() {
|
|
3469
|
+
return this.getValue(this.getIndex(this.control.value));
|
|
3470
|
+
}
|
|
3471
|
+
get state() {
|
|
3472
|
+
return this.states[this.index];
|
|
3473
|
+
}
|
|
3474
|
+
get nextState() {
|
|
3475
|
+
return this.states[this.nextIndex];
|
|
3476
|
+
}
|
|
3477
|
+
get tooltip() {
|
|
3478
|
+
const nextState = this.states[this.nextIndex];
|
|
3479
|
+
return nextState.label ? `Switch to ${lowerFirst(nextState.label)}` : '';
|
|
3480
|
+
}
|
|
3481
|
+
change() {
|
|
3482
|
+
this.control.setValue(this.getValue(this.nextIndex));
|
|
3483
|
+
}
|
|
3484
|
+
ngOnChanges(changes) {
|
|
3485
|
+
super.ngOnChanges(changes);
|
|
3486
|
+
if (changes.states && this.states.length) {
|
|
3487
|
+
if (!isNil(this.states?.[0]?.value)) {
|
|
3488
|
+
this.hasChangeValue = true;
|
|
3489
|
+
}
|
|
3490
|
+
if (isNil(this.control.value)) {
|
|
3491
|
+
this.control.setValue(this.value);
|
|
3492
|
+
}
|
|
3493
|
+
}
|
|
3494
|
+
}
|
|
3495
|
+
getIndex(value) {
|
|
3496
|
+
return ((this.hasChangeValue
|
|
3497
|
+
? this.states.findIndex((s) => s.value === value)
|
|
3498
|
+
: value) ?? 0);
|
|
3499
|
+
}
|
|
3500
|
+
getValue(index) {
|
|
3501
|
+
return this.hasChangeValue ? this.states[index]?.value : index;
|
|
3502
|
+
}
|
|
3503
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SwitchButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
3504
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.6", type: SwitchButtonComponent, isStandalone: false, selector: "v-switch-button", inputs: { states: "states" }, providers: createControlProviders(() => SwitchButtonComponent), usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<button [matTooltip]=\"tooltip\" class=\"button\" mat-icon-button (click)=\"change()\">\n <mat-icon class=\"icon\">{{ state?.icon }}</mat-icon>\n</button>\n", dependencies: [{ kind: "component", type: i1$4.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i2$5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
|
|
3505
|
+
}
|
|
3506
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SwitchButtonComponent, decorators: [{
|
|
3507
|
+
type: Component,
|
|
3508
|
+
args: [{ selector: 'v-switch-button', providers: createControlProviders(() => SwitchButtonComponent), standalone: false, template: "<button [matTooltip]=\"tooltip\" class=\"button\" mat-icon-button (click)=\"change()\">\n <mat-icon class=\"icon\">{{ state?.icon }}</mat-icon>\n</button>\n" }]
|
|
3509
|
+
}], propDecorators: { states: [{
|
|
3510
|
+
type: Input
|
|
3511
|
+
}] } });
|
|
3512
|
+
|
|
3513
|
+
class SwitchButtonModule {
|
|
3514
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SwitchButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3515
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: SwitchButtonModule, declarations: [SwitchButtonComponent], imports: [CommonModule, MatButtonModule, MatIconModule, MatTooltipModule], exports: [SwitchButtonComponent] }); }
|
|
3516
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SwitchButtonModule, imports: [CommonModule, MatButtonModule, MatIconModule, MatTooltipModule] }); }
|
|
3517
|
+
}
|
|
3518
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SwitchButtonModule, decorators: [{
|
|
3519
|
+
type: NgModule,
|
|
3520
|
+
args: [{
|
|
3521
|
+
declarations: [SwitchButtonComponent],
|
|
3522
|
+
imports: [CommonModule, MatButtonModule, MatIconModule, MatTooltipModule],
|
|
3523
|
+
exports: [SwitchButtonComponent],
|
|
3524
|
+
}]
|
|
3525
|
+
}] });
|
|
3526
|
+
|
|
3527
|
+
class NavComponent {
|
|
3528
|
+
constructor(urlService) {
|
|
3529
|
+
this.urlService = urlService;
|
|
3530
|
+
this.type = input();
|
|
3531
|
+
this.links = input([], {
|
|
3532
|
+
transform: (v) => (isArray(v[0]) ? v : [v]),
|
|
3533
|
+
});
|
|
3534
|
+
this.exact = input(false, { transform: booleanAttribute });
|
|
3535
|
+
this.activeLink$ = combineLatest([
|
|
3536
|
+
this.urlService.url$,
|
|
3537
|
+
toObservable(this.links),
|
|
3538
|
+
toObservable(this.exact),
|
|
3539
|
+
]).pipe(map(([url, links, exact]) => links.flat().reduce((res, link) => {
|
|
3540
|
+
const index = url.indexOf(link.url);
|
|
3541
|
+
if (index !== -1 && (exact ? index === 0 : index < res.index)) {
|
|
3542
|
+
return { index, link };
|
|
3543
|
+
}
|
|
3544
|
+
return res;
|
|
3545
|
+
}, { index: Infinity, link: null })?.link), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
3546
|
+
}
|
|
3547
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NavComponent, deps: [{ token: UrlService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3548
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: NavComponent, isStandalone: true, selector: "v-nav", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, links: { classPropertyName: "links", publicName: "links", isSignal: true, isRequired: false, transformFunction: null }, exact: { classPropertyName: "exact", publicName: "exact", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div [ngClass]=\"{ 'v-nav__secondary': type() === 'secondary' }\" class=\"v-nav\">\n @for (linksGroup of links(); track linksGroup; let index = $index) {\n @if (index !== 0) {\n <mat-divider></mat-divider>\n }\n @for (link of linksGroup; track link) {\n <div\n [ngClass]=\"{ item__active: (activeLink$ | async) === link }\"\n [routerLink]=\"link.url\"\n [title]=\"link.label\"\n class=\"mat-body-large item mat-no-margin\"\n >\n {{ link.label }}\n </div>\n }\n }\n</div>\n", styles: [".v-nav{display:flex;flex-direction:column}.v-nav .item{cursor:pointer;padding:12px 24px 12px 12px}.v-nav .item__active{font-weight:500}.v-nav .item:after{display:block;content:attr(title);font-weight:500;height:0;color:transparent;overflow:hidden;visibility:hidden}.v-nav__secondary .item{border-left:solid 4px}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
3549
|
+
}
|
|
3550
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NavComponent, decorators: [{
|
|
3551
|
+
type: Component,
|
|
3552
|
+
args: [{ selector: 'v-nav', imports: [RouterLink, NgClass, AsyncPipe, MatDivider], encapsulation: ViewEncapsulation.None, template: "<div [ngClass]=\"{ 'v-nav__secondary': type() === 'secondary' }\" class=\"v-nav\">\n @for (linksGroup of links(); track linksGroup; let index = $index) {\n @if (index !== 0) {\n <mat-divider></mat-divider>\n }\n @for (link of linksGroup; track link) {\n <div\n [ngClass]=\"{ item__active: (activeLink$ | async) === link }\"\n [routerLink]=\"link.url\"\n [title]=\"link.label\"\n class=\"mat-body-large item mat-no-margin\"\n >\n {{ link.label }}\n </div>\n }\n }\n</div>\n", styles: [".v-nav{display:flex;flex-direction:column}.v-nav .item{cursor:pointer;padding:12px 24px 12px 12px}.v-nav .item__active{font-weight:500}.v-nav .item:after{display:block;content:attr(title);font-weight:500;height:0;color:transparent;overflow:hidden;visibility:hidden}.v-nav__secondary .item{border-left:solid 4px}\n"] }]
|
|
3553
|
+
}], ctorParameters: () => [{ type: UrlService }] });
|
|
3554
|
+
|
|
3555
|
+
class AmountCurrencyPipe {
|
|
3556
|
+
constructor(_locale, _defaultCurrencyCode = 'USD') {
|
|
3557
|
+
this._locale = _locale;
|
|
3558
|
+
this._defaultCurrencyCode = _defaultCurrencyCode;
|
|
3559
|
+
}
|
|
3560
|
+
transform(amount, currencyCode = this._defaultCurrencyCode, format = 'long', exponent, isMajor = false) {
|
|
3561
|
+
if (typeof amount === 'number') {
|
|
3562
|
+
return formatCurrency(amount, currencyCode, format, this._locale, exponent, isMajor);
|
|
3563
|
+
}
|
|
3564
|
+
return amount;
|
|
3565
|
+
}
|
|
3566
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: AmountCurrencyPipe, deps: [{ token: LOCALE_ID }, { token: DEFAULT_CURRENCY_CODE }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3567
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: AmountCurrencyPipe, isStandalone: true, name: "amountCurrency" }); }
|
|
3568
|
+
}
|
|
3569
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: AmountCurrencyPipe, decorators: [{
|
|
3570
|
+
type: Pipe,
|
|
3571
|
+
args: [{
|
|
3572
|
+
standalone: true,
|
|
3573
|
+
name: 'amountCurrency',
|
|
3574
|
+
}]
|
|
3575
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
3576
|
+
type: Inject,
|
|
3577
|
+
args: [LOCALE_ID]
|
|
3578
|
+
}] }, { type: undefined, decorators: [{
|
|
3579
|
+
type: Inject,
|
|
3580
|
+
args: [DEFAULT_CURRENCY_CODE]
|
|
3581
|
+
}] }] });
|
|
3582
|
+
|
|
3583
|
+
class EnumKeyValuesPipe {
|
|
3584
|
+
transform(value) {
|
|
3585
|
+
return getEnumKeyValues(value);
|
|
3586
|
+
}
|
|
3587
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: EnumKeyValuesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3588
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: EnumKeyValuesPipe, isStandalone: true, name: "enumKeyValues" }); }
|
|
3589
|
+
}
|
|
3590
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: EnumKeyValuesPipe, decorators: [{
|
|
3591
|
+
type: Pipe,
|
|
3592
|
+
args: [{
|
|
3593
|
+
standalone: true,
|
|
3594
|
+
name: 'enumKeyValues',
|
|
3595
|
+
}]
|
|
3596
|
+
}] });
|
|
3597
|
+
|
|
3598
|
+
class EnumKeyPipe {
|
|
3599
|
+
transform(value, enumObj) {
|
|
3600
|
+
return !isNil(value) && enumObj ? getEnumKey(enumObj, value) : '';
|
|
3601
|
+
}
|
|
3602
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: EnumKeyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3603
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: EnumKeyPipe, isStandalone: true, name: "enumKey" }); }
|
|
3604
|
+
}
|
|
3605
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: EnumKeyPipe, decorators: [{
|
|
3606
|
+
type: Pipe,
|
|
3607
|
+
args: [{
|
|
3608
|
+
standalone: true,
|
|
3609
|
+
name: 'enumKey',
|
|
3610
|
+
}]
|
|
3611
|
+
}] });
|
|
3612
|
+
|
|
3613
|
+
class EnumKeysPipe {
|
|
3614
|
+
transform(value) {
|
|
3615
|
+
return getEnumKeys(value);
|
|
3616
|
+
}
|
|
3617
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: EnumKeysPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3618
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: EnumKeysPipe, isStandalone: true, name: "enumKeys" }); }
|
|
3619
|
+
}
|
|
3620
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: EnumKeysPipe, decorators: [{
|
|
3621
|
+
type: Pipe,
|
|
3622
|
+
args: [{
|
|
3623
|
+
standalone: true,
|
|
3624
|
+
name: 'enumKeys',
|
|
3625
|
+
}]
|
|
3626
|
+
}] });
|
|
3627
|
+
|
|
3628
|
+
const DEFAULT_TIMER = 7500;
|
|
3629
|
+
class HumanizedDurationPipe extends AsyncTransform {
|
|
3630
|
+
constructor() {
|
|
3631
|
+
super(...arguments);
|
|
3632
|
+
this.result$ = combineLatest([this.params$, timer(0, DEFAULT_TIMER)]).pipe(throttleTime(DEFAULT_TIMER), map(([[value, config]]) => formatDistanceToNow(new Date(value), { includeSeconds: true }) +
|
|
3633
|
+
(config.hasAgoEnding ? ' ago' : '')), distinctUntilChanged());
|
|
3634
|
+
}
|
|
3635
|
+
transform(...params) {
|
|
3636
|
+
return super.asyncTransform(params);
|
|
3637
|
+
}
|
|
3638
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: HumanizedDurationPipe, deps: null, target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3639
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: HumanizedDurationPipe, isStandalone: true, name: "humanizedDuration", pure: false }); }
|
|
3640
|
+
}
|
|
3641
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: HumanizedDurationPipe, decorators: [{
|
|
3642
|
+
type: Pipe,
|
|
3643
|
+
args: [{
|
|
3644
|
+
standalone: true,
|
|
3645
|
+
name: 'humanizedDuration',
|
|
3646
|
+
pure: false,
|
|
3647
|
+
}]
|
|
3648
|
+
}] });
|
|
3649
|
+
|
|
3650
|
+
class InlineJsonPipe {
|
|
3651
|
+
transform(value, maxReadableLever = 1) {
|
|
3652
|
+
return inlineJson(value, maxReadableLever === false ? Infinity : maxReadableLever);
|
|
3653
|
+
}
|
|
3654
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: InlineJsonPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3655
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: InlineJsonPipe, isStandalone: false, name: "inlineJson" }); }
|
|
3656
|
+
}
|
|
3657
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: InlineJsonPipe, decorators: [{
|
|
3658
|
+
type: Pipe,
|
|
3659
|
+
args: [{
|
|
3660
|
+
name: 'inlineJson',
|
|
3661
|
+
standalone: false,
|
|
3662
|
+
}]
|
|
3663
|
+
}] });
|
|
3664
|
+
|
|
3665
|
+
class VSelectPipe {
|
|
3666
|
+
constructor(ref) {
|
|
3667
|
+
this.ref = ref;
|
|
3668
|
+
}
|
|
3669
|
+
transform(obj, selectFn, defaultValue, rest = []) {
|
|
3670
|
+
const res = obj && selectFn ? select(obj, selectFn, defaultValue, rest) : null;
|
|
3671
|
+
if (isObservable(res) && !this.asyncPipe) {
|
|
3672
|
+
this.asyncPipe = new AsyncPipe(this.ref);
|
|
3673
|
+
}
|
|
3674
|
+
if (this.asyncPipe) {
|
|
3675
|
+
return this.asyncPipe.transform(res);
|
|
3676
|
+
}
|
|
3677
|
+
return res;
|
|
3678
|
+
}
|
|
3679
|
+
ngOnDestroy() {
|
|
3680
|
+
this.asyncPipe?.ngOnDestroy?.();
|
|
3681
|
+
}
|
|
3682
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: VSelectPipe, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3683
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: VSelectPipe, isStandalone: true, name: "vSelect", pure: false }); }
|
|
3684
|
+
}
|
|
3685
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: VSelectPipe, decorators: [{
|
|
3686
|
+
type: Pipe,
|
|
3687
|
+
args: [{
|
|
3688
|
+
standalone: true,
|
|
3689
|
+
name: 'vSelect',
|
|
3690
|
+
pure: false,
|
|
3691
|
+
}]
|
|
3692
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
|
|
3693
|
+
|
|
3694
|
+
class PipesModule {
|
|
3695
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: PipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3696
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: PipesModule, declarations: [InlineJsonPipe], imports: [CommonModule,
|
|
3697
|
+
EnumKeyPipe,
|
|
3698
|
+
EnumKeysPipe,
|
|
3699
|
+
EnumKeyValuesPipe,
|
|
3700
|
+
AmountCurrencyPipe,
|
|
3701
|
+
VSelectPipe,
|
|
3702
|
+
HumanizedDurationPipe], exports: [InlineJsonPipe,
|
|
3703
|
+
EnumKeyPipe,
|
|
3704
|
+
EnumKeysPipe,
|
|
3705
|
+
EnumKeyValuesPipe,
|
|
3706
|
+
AmountCurrencyPipe,
|
|
3707
|
+
VSelectPipe,
|
|
3708
|
+
HumanizedDurationPipe] }); }
|
|
3709
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: PipesModule, imports: [CommonModule] }); }
|
|
3710
|
+
}
|
|
3711
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: PipesModule, decorators: [{
|
|
3712
|
+
type: NgModule,
|
|
3713
|
+
args: [{
|
|
3714
|
+
declarations: [InlineJsonPipe],
|
|
3715
|
+
exports: [
|
|
3716
|
+
InlineJsonPipe,
|
|
3717
|
+
EnumKeyPipe,
|
|
3718
|
+
EnumKeysPipe,
|
|
3719
|
+
EnumKeyValuesPipe,
|
|
3720
|
+
AmountCurrencyPipe,
|
|
3721
|
+
VSelectPipe,
|
|
3722
|
+
HumanizedDurationPipe,
|
|
3723
|
+
],
|
|
3724
|
+
imports: [
|
|
3725
|
+
CommonModule,
|
|
3726
|
+
EnumKeyPipe,
|
|
3727
|
+
EnumKeysPipe,
|
|
3728
|
+
EnumKeyValuesPipe,
|
|
3729
|
+
AmountCurrencyPipe,
|
|
3730
|
+
VSelectPipe,
|
|
3731
|
+
HumanizedDurationPipe,
|
|
3732
|
+
],
|
|
3733
|
+
}]
|
|
3734
|
+
}] });
|
|
3735
|
+
|
|
3736
|
+
/**
|
|
3737
|
+
* Generated bundle index. Do not edit.
|
|
3738
|
+
*/
|
|
3739
|
+
|
|
3740
|
+
export { ActionsComponent, ActionsModule, AmountCurrencyPipe, AsyncTransform, AutocompleteFieldComponent, AutocompleteFieldModule, BASE_CONFIG, ConfigServiceSuperclass, ConfirmDialogComponent, ConfirmDialogModule, ContentLoadingComponent, DATE_QUERY_PARAMS_SERIALIZERS, DEFAULT_DIALOG_CONFIG, DEFAULT_DIALOG_CONFIG_FULL_HEIGHT, DIALOG_CONFIG, DateRangeFieldComponent, DateRangeFieldModule, DatetimeFieldComponent, DatetimeFieldModule, DebounceTime, DialogActionsComponent, DialogComponent, DialogModule, DialogResponseStatus, DialogService, DialogSuperclass, EnumKeyPipe, EnumKeyValuesPipe, EnumKeysPipe, ErrorPageComponent, ErrorPageModule, FetchSuperclass, FileUploadComponent, FileUploadModule, FiltersComponent, FiltersModule, FormComponentSuperclass, FormControlSuperclass, FormGroupSuperclass, HighlightDirective, HumanizedDurationPipe, InlineJsonPipe, InputFieldComponent, InputFieldModule, ListFieldComponent, ListFieldModule, LogModule, MainFiltersDirective, MoreFiltersButtonComponent, NavComponent, NormColumn, NotifyLogService, NumberRangeFieldComponent, NumberRangeFieldModule, OtherFiltersDirective, PipesModule, QUERY_PARAMS_SERIALIZERS, QueryParamsModule, QueryParamsService, SelectFieldComponent, SelectFieldModule, SingleFetchSuperclass, SwitchButtonComponent, SwitchButtonModule, TableActionsComponent, TableComponent, TableInputsComponent, TableModule, TagComponent, TagModule, UrlService, VSelectPipe, ValueComponent, ValueListComponent, arrayAttribute, asyncStartWith, cachedHeadMap, clean, cleanPrimitiveProps, compareDifferentTypes, correctPriorities, countChanged, countProps, createColumn, createControlProviders, createControls, createCsv, createDateFromNoTimeZoneString, createDateRangeToToday, createMenuColumn, debounceTimeWithFirst, downloadFile, enumHasValue, forkJoinToResult, formatCurrency, getCurrencyExponent, getEnumEntries, getEnumKey, getEnumKeyValues, getEnumKeys, getEnumValues, getErrorsTree, getImportValue, getNoTimeZoneIsoString, getPossiblyAsyncObservable, getValidValueChanges, getValue$1 as getValue, getValueChanges, handleError, hasControls, inProgressFrom, inlineJson, isAsync, isEmpty, isEmptyPrimitive, isEqualDateRange, isResultsHasError, loadFileContent, normalizeCell, normalizePossiblyFn, passError, progressTo, select, setDisabled, splitBySeparators, splitResultsErrors, switchCombineWith, toMajor, toMajorByExponent, toMinor, toMinorByExponent, treeDataItemToInlineDataItem };
|
|
3741
|
+
//# sourceMappingURL=vality-matez.mjs.map
|