@decaf-ts/for-angular 0.0.80 → 0.0.82
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/assets/i18n/ew/en.json +17 -11
- package/fesm2022/decaf-ts-for-angular.mjs +505 -505
- package/fesm2022/decaf-ts-for-angular.mjs.map +1 -1
- package/index.d.ts +165 -283
- package/package.json +2 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { HTML5InputTypes, parseValueByType, HTML5CheckTypes, escapeHtml, parseToNumber, RenderingEngine, DecafComponent, UIKeys, RenderingError, UIMediaBreakPoints, DecafEventHandler } from '@decaf-ts/ui-decorators';
|
|
1
|
+
import { HTML5InputTypes, parseValueByType, HTML5CheckTypes, escapeHtml, parseToNumber, RenderingEngine, DecafComponent, ComponentEventNames, UIKeys, RenderingError, UIMediaBreakPoints, LayoutGridGaps, ElementSizes, DecafEventHandler } from '@decaf-ts/ui-decorators';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { InjectionToken, provideEnvironmentInitializer, isDevMode, reflectComponentType, Injector, createEnvironmentInjector, runInInjectionContext, createComponent, inject, NgZone, Injectable, Input, Directive, signal, ChangeDetectorRef, EnvironmentInjector, Renderer2, EventEmitter, ElementRef, Output, ViewChild, Inject, ViewContainerRef, TemplateRef, Component, ViewEncapsulation, HostListener, NgModule } from '@angular/core';
|
|
4
4
|
import * as i1$1 from '@angular/common';
|
|
5
5
|
import { Location, NgComponentOutlet, CommonModule } from '@angular/common';
|
|
6
|
-
import { VALIDATION_PARENT_KEY, ValidationKeys, DEFAULT_PATTERNS, Validation, Primitives, ComparisonValidationKeys, PathProxyEngine, Model, ModelKeys, isValidDate as isValidDate$1, parseDate, sf, ReservedModels } from '@decaf-ts/decorator-validation';
|
|
6
|
+
import { VALIDATION_PARENT_KEY, ValidationKeys, DEFAULT_PATTERNS, Validation, Primitives, ComparisonValidationKeys, PathProxyEngine, Model, ModelKeys, isValidDate as isValidDate$1, parseDate, sf as sf$1, ReservedModels } from '@decaf-ts/decorator-validation';
|
|
7
7
|
import { OperationKeys, InternalError, NotFoundError } from '@decaf-ts/db-decorators';
|
|
8
8
|
import * as i1 from '@angular/forms';
|
|
9
9
|
import { FormGroup, FormControl, FormArray, AbstractControl, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
10
10
|
import { InjectableRegistryImp } from '@decaf-ts/injectable-decorators';
|
|
11
|
-
import { Logging, LoggedClass } from '@decaf-ts/logging';
|
|
11
|
+
import { Logging, LoggedClass, sf } from '@decaf-ts/logging';
|
|
12
12
|
import { Repository, OrderDirection, Condition } from '@decaf-ts/core';
|
|
13
13
|
import { uses, Metadata, apply, metadata } from '@decaf-ts/decoration';
|
|
14
14
|
import { AnimationController, provideIonicAngular, LoadingController, IonIcon, IonButton, IonModal, IonSpinner, IonButtons, IonContent, IonHeader, IonTitle, IonToolbar, IonInput, IonItem, IonCheckbox, IonRadioGroup, IonRadio, IonSelect, IonSelectOption, IonLabel, IonBadge, IonText, IonTextarea, IonCard, IonCardHeader, IonCardContent, IonCardTitle, IonCardSubtitle, IonList, IonReorder, IonReorderGroup, IonSearchbar, IonChip, IonRefresher, IonThumbnail, IonSkeletonText, IonRefresherContent, IonInfiniteScroll, IonInfiniteScrollContent, IonListHeader, IonItemSliding, IonItemOptions, IonItemOption, IonPopover, NavController } from '@ionic/angular/standalone';
|
|
15
15
|
import { faker } from '@faker-js/faker';
|
|
16
|
-
import { forkJoin, Subject, BehaviorSubject, fromEvent, of, merge, Observable, timer,
|
|
17
|
-
import {
|
|
16
|
+
import { forkJoin, Subject, BehaviorSubject, fromEvent, of, merge, Observable, timer, shareReplay as shareReplay$1, takeUntil as takeUntil$1, firstValueFrom, debounceTime } from 'rxjs';
|
|
17
|
+
import { Title, DomSanitizer } from '@angular/platform-browser';
|
|
18
|
+
import { Router, NavigationStart, NavigationEnd, ActivatedRoute } from '@angular/router';
|
|
19
|
+
import { MenuController } from '@ionic/angular';
|
|
18
20
|
import { TranslateParser, provideTranslateService, TranslateLoader, provideTranslateParser, TranslateService, TranslatePipe, TranslateModule } from '@ngx-translate/core';
|
|
19
21
|
import { provideHttpClient, HttpClient } from '@angular/common/http';
|
|
20
22
|
import { map, distinctUntilChanged, takeUntil, shareReplay, tap, switchMap } from 'rxjs/operators';
|
|
21
|
-
import { Title, DomSanitizer } from '@angular/platform-browser';
|
|
22
|
-
import { MenuController } from '@ionic/angular';
|
|
23
23
|
import { __decorate, __metadata } from 'tslib';
|
|
24
24
|
import { addIcons } from 'ionicons';
|
|
25
25
|
import * as allIcons from 'ionicons/icons';
|
|
@@ -127,32 +127,6 @@ const WindowColorSchemes = {
|
|
|
127
127
|
dark: 'dark',
|
|
128
128
|
undefined: 'undefined',
|
|
129
129
|
};
|
|
130
|
-
const ElementSizes = {
|
|
131
|
-
xsmall: 'xsmall',
|
|
132
|
-
small: 'small',
|
|
133
|
-
medium: 'medium',
|
|
134
|
-
default: 'default',
|
|
135
|
-
large: 'large',
|
|
136
|
-
xLarge: 'xlarge',
|
|
137
|
-
'2xLarge': '2xlarge',
|
|
138
|
-
auto: 'auto',
|
|
139
|
-
expand: 'expand',
|
|
140
|
-
block: 'block',
|
|
141
|
-
};
|
|
142
|
-
const ElementPositions = {
|
|
143
|
-
left: 'left',
|
|
144
|
-
center: 'center',
|
|
145
|
-
right: 'right',
|
|
146
|
-
top: 'top',
|
|
147
|
-
bottom: 'bottom',
|
|
148
|
-
};
|
|
149
|
-
const LayoutGridGaps = {
|
|
150
|
-
small: 'small',
|
|
151
|
-
medium: 'medium',
|
|
152
|
-
large: 'large',
|
|
153
|
-
collapse: 'collapse',
|
|
154
|
-
none: '',
|
|
155
|
-
};
|
|
156
130
|
const ListItemPositions = {
|
|
157
131
|
uid: 'uid',
|
|
158
132
|
title: 'title',
|
|
@@ -202,84 +176,6 @@ const AngularEngineKeys = {
|
|
|
202
176
|
LOADED: 'engineLoaded',
|
|
203
177
|
DARK_PALETTE_CLASS: 'dcf-palette-dark',
|
|
204
178
|
};
|
|
205
|
-
/**
|
|
206
|
-
* @description Form validation state constants.
|
|
207
|
-
* @summary Contains constants representing the possible validation states of a form.
|
|
208
|
-
* These are used to check and handle form validation throughout the application.
|
|
209
|
-
* The VALID state indicates all form controls pass validation, while INVALID
|
|
210
|
-
* indicates one or more validation errors exist.
|
|
211
|
-
* @typedef {Object} FormConstants
|
|
212
|
-
* @property {string} VALID - Constant representing a valid form state
|
|
213
|
-
* @property {string} INVALID - Constant representing an invalid form state
|
|
214
|
-
* @const FormConstants
|
|
215
|
-
* @memberOf module:lib/engine/constants
|
|
216
|
-
*/
|
|
217
|
-
const FormConstants = {
|
|
218
|
-
VALID: 'VALID',
|
|
219
|
-
INVALID: 'INVALID',
|
|
220
|
-
};
|
|
221
|
-
/**
|
|
222
|
-
* @description Event name constants.
|
|
223
|
-
* @summary Contains constants for standardized event names used throughout the application.
|
|
224
|
-
* These constants ensure consistent event naming across components and make it easier to
|
|
225
|
-
* track and handle events. Each constant represents a specific application event type.
|
|
226
|
-
* @typedef {Object} ComponentEventNames
|
|
227
|
-
* @property {string} BackButtonClickEvent - Event fired when back button navigation ends
|
|
228
|
-
* @property {string} Render - Event after component initialize action occurs
|
|
229
|
-
* @property {string} Refresh - Event fired when a refresh action occurs
|
|
230
|
-
* @property {string} Click - Event fired when a click action occurs
|
|
231
|
-
* @property {string} Change - Event fired when a change action occurs
|
|
232
|
-
* @property {string} Submit - Event fired when a form submission occurs
|
|
233
|
-
* @property {string} ValidationError - Event fired when a validation error occurs
|
|
234
|
-
* @property {string} ThemeChange - Event fired when a theme change occurs
|
|
235
|
-
* @property {string} FormGroupLoaded - Event fired when a reactve form group is loaded
|
|
236
|
-
* @const ComponentEventNames
|
|
237
|
-
* @memberOf module:lib/engine/constants
|
|
238
|
-
*/
|
|
239
|
-
const ComponentEventNames = {
|
|
240
|
-
Render: 'render',
|
|
241
|
-
BackButtonClickEvent: 'backButtonNavigationEndEvent',
|
|
242
|
-
Refresh: 'RefreshEvent',
|
|
243
|
-
Click: 'ClickEvent',
|
|
244
|
-
Change: 'ChangeEvent',
|
|
245
|
-
Submit: 'SubmitEvent',
|
|
246
|
-
ValidationError: 'validationErrorEvent',
|
|
247
|
-
ThemeChange: 'themeChangeEvent',
|
|
248
|
-
FormGroupLoaded: 'formGroupLoadedEvent',
|
|
249
|
-
};
|
|
250
|
-
const TransactionHooks = {
|
|
251
|
-
BeforeCreate: 'beforeCreate',
|
|
252
|
-
AfterCreate: 'afterCreate',
|
|
253
|
-
BeforeUpdate: 'beforeUpdate',
|
|
254
|
-
AfterUpdate: 'afterUpdate',
|
|
255
|
-
BeforeDelete: 'beforeDelete',
|
|
256
|
-
AfterDelete: 'afterDelete',
|
|
257
|
-
};
|
|
258
|
-
/**
|
|
259
|
-
* @description Logger level constants.
|
|
260
|
-
* @summary Defines the logging levels used in the application's logging system.
|
|
261
|
-
* Lower numeric values represent more verbose logging, while higher values represent
|
|
262
|
-
* more critical logs. These levels control which log messages are output based on
|
|
263
|
-
* the configured logging threshold.
|
|
264
|
-
* @enum {number}
|
|
265
|
-
* @readonly
|
|
266
|
-
* @property {number} ALL - Log everything (most verbose)
|
|
267
|
-
* @property {number} DEBUG - Log debug information
|
|
268
|
-
* @property {number} INFO - Log informational messages
|
|
269
|
-
* @property {number} WARN - Log warnings
|
|
270
|
-
* @property {number} ERROR - Log errors
|
|
271
|
-
* @property {number} CRITICAL - Log critical errors (least verbose)
|
|
272
|
-
* @memberOf module:lib/engine/constants
|
|
273
|
-
*/
|
|
274
|
-
var LoggerLevels;
|
|
275
|
-
(function (LoggerLevels) {
|
|
276
|
-
LoggerLevels[LoggerLevels["ALL"] = 0] = "ALL";
|
|
277
|
-
LoggerLevels[LoggerLevels["DEBUG"] = 1] = "DEBUG";
|
|
278
|
-
LoggerLevels[LoggerLevels["INFO"] = 2] = "INFO";
|
|
279
|
-
LoggerLevels[LoggerLevels["WARN"] = 3] = "WARN";
|
|
280
|
-
LoggerLevels[LoggerLevels["ERROR"] = 4] = "ERROR";
|
|
281
|
-
LoggerLevels[LoggerLevels["CRITICAL"] = 5] = "CRITICAL";
|
|
282
|
-
})(LoggerLevels || (LoggerLevels = {}));
|
|
283
179
|
/**
|
|
284
180
|
* @description Route direction constants.
|
|
285
181
|
* @summary Defines the possible navigation directions in the application.
|
|
@@ -346,6 +242,8 @@ var ComponentsTagNames;
|
|
|
346
242
|
*/
|
|
347
243
|
var BaseComponentProps;
|
|
348
244
|
(function (BaseComponentProps) {
|
|
245
|
+
BaseComponentProps["MODEL_ID"] = "modelId";
|
|
246
|
+
BaseComponentProps["MODEL"] = "model";
|
|
349
247
|
BaseComponentProps["HANDLERS"] = "handlers";
|
|
350
248
|
BaseComponentProps["LOCALE"] = "locale";
|
|
351
249
|
BaseComponentProps["LOCALE_ROOT"] = "locale_root";
|
|
@@ -550,7 +448,6 @@ class ValidatorFactory {
|
|
|
550
448
|
function getDbAdapterFlavour() {
|
|
551
449
|
return (getOnWindow(DB_ADAPTER_FLAVOUR_TOKEN) || '');
|
|
552
450
|
}
|
|
553
|
-
;
|
|
554
451
|
/**
|
|
555
452
|
* @description Provides an array of component types for dynamic rendering.
|
|
556
453
|
* @summary Helper function to package component constructors for registration with the
|
|
@@ -589,9 +486,7 @@ function provideDecafDynamicComponents(...components) {
|
|
|
589
486
|
*/
|
|
590
487
|
function getModelAndRepository(model, clazz) {
|
|
591
488
|
try {
|
|
592
|
-
const modelName = (typeof model === Primitives.STRING
|
|
593
|
-
? model
|
|
594
|
-
: model.constructor.name);
|
|
489
|
+
const modelName = (typeof model === Primitives.STRING ? model : model.constructor.name);
|
|
595
490
|
const constructor = Model.get((modelName.charAt(0).toUpperCase() + modelName.slice(1)));
|
|
596
491
|
if (!constructor)
|
|
597
492
|
return undefined;
|
|
@@ -685,10 +580,9 @@ const decafPageTransition = (baseEl, opts) => {
|
|
|
685
580
|
};
|
|
686
581
|
function provideDecafPageTransition() {
|
|
687
582
|
return provideIonicAngular({
|
|
688
|
-
navAnimation: decafPageTransition
|
|
583
|
+
navAnimation: decafPageTransition,
|
|
689
584
|
});
|
|
690
585
|
}
|
|
691
|
-
;
|
|
692
586
|
function provideDecafDarkMode() {
|
|
693
587
|
return provideEnvironmentInitializer(() => {
|
|
694
588
|
const doc = getWindowDocument();
|
|
@@ -765,13 +659,13 @@ function getInjectablesRegistry() {
|
|
|
765
659
|
* @function isDevelopmentMode
|
|
766
660
|
* @memberOf module:for-angular
|
|
767
661
|
*/
|
|
768
|
-
function isDevelopmentMode(context =
|
|
662
|
+
function isDevelopmentMode(context = 'localhost') {
|
|
769
663
|
if (!context)
|
|
770
664
|
return isDevMode();
|
|
771
665
|
const win = getWindow();
|
|
772
666
|
return (isDevMode() ||
|
|
773
|
-
win?.[
|
|
774
|
-
win?.[
|
|
667
|
+
win?.['env']?.['CONTEXT'].toLowerCase() !== context.toLowerCase() ||
|
|
668
|
+
win?.['location']?.hostname?.includes(context));
|
|
775
669
|
}
|
|
776
670
|
/**
|
|
777
671
|
* @description Dispatches a custom event to the document window
|
|
@@ -811,9 +705,7 @@ function windowEventEmitter(name, detail, props) {
|
|
|
811
705
|
*/
|
|
812
706
|
function getOnWindowDocument(key) {
|
|
813
707
|
const doc = getWindowDocument();
|
|
814
|
-
return doc instanceof Document
|
|
815
|
-
? doc?.[key] || undefined
|
|
816
|
-
: undefined;
|
|
708
|
+
return doc instanceof Document ? doc?.[key] || undefined : undefined;
|
|
817
709
|
}
|
|
818
710
|
/**
|
|
819
711
|
* @description Retrieves the document object from the window
|
|
@@ -827,7 +719,7 @@ function getOnWindowDocument(key) {
|
|
|
827
719
|
* @memberOf module:for-angular
|
|
828
720
|
*/
|
|
829
721
|
function getWindowDocument() {
|
|
830
|
-
return getOnWindow(
|
|
722
|
+
return getOnWindow('document');
|
|
831
723
|
}
|
|
832
724
|
/**
|
|
833
725
|
* @description Retrieves a property from the window object
|
|
@@ -875,7 +767,7 @@ function setOnWindow(key, value) {
|
|
|
875
767
|
* @memberOf module:for-angular
|
|
876
768
|
*/
|
|
877
769
|
function getWindow() {
|
|
878
|
-
return globalThis?.[
|
|
770
|
+
return globalThis?.['window'];
|
|
879
771
|
}
|
|
880
772
|
/**
|
|
881
773
|
* @description Retrieves the width of the browser window
|
|
@@ -889,7 +781,7 @@ function getWindow() {
|
|
|
889
781
|
* @memberOf module:for-angular
|
|
890
782
|
*/
|
|
891
783
|
function getWindowWidth() {
|
|
892
|
-
return getOnWindow(
|
|
784
|
+
return getOnWindow('innerWidth') || 0;
|
|
893
785
|
}
|
|
894
786
|
/**
|
|
895
787
|
* @description Checks if a value is not undefined
|
|
@@ -924,25 +816,23 @@ function isNotUndefined(prop) {
|
|
|
924
816
|
*/
|
|
925
817
|
function getLocaleFromClassName(instance, suffix) {
|
|
926
818
|
if (typeof instance !== Primitives.STRING)
|
|
927
|
-
instance =
|
|
928
|
-
instance.name ||
|
|
929
|
-
instance?.constructor?.name;
|
|
819
|
+
instance = instance.name || instance?.constructor?.name;
|
|
930
820
|
let name = instance;
|
|
931
821
|
if (suffix)
|
|
932
822
|
name = `${instance}${suffix.charAt(0).toUpperCase() + suffix.slice(1)}`;
|
|
933
823
|
name = name
|
|
934
|
-
.replace(/_|-/g,
|
|
824
|
+
.replace(/_|-/g, '')
|
|
935
825
|
.replace(/(?:^\w|[A-Z]|\b\w)/g, (word, index) => {
|
|
936
826
|
if (index > 1)
|
|
937
|
-
word =
|
|
827
|
+
word = '.' + word;
|
|
938
828
|
return word.toLowerCase();
|
|
939
829
|
})
|
|
940
|
-
.split(
|
|
830
|
+
.split('.');
|
|
941
831
|
if (name.length < 3)
|
|
942
|
-
return name.reverse().join(
|
|
832
|
+
return name.reverse().join('.');
|
|
943
833
|
const preffix = name[name.length - 1];
|
|
944
834
|
name.pop();
|
|
945
|
-
name = name.join(
|
|
835
|
+
name = name.join('_');
|
|
946
836
|
return `${preffix}.${name}`;
|
|
947
837
|
}
|
|
948
838
|
/**
|
|
@@ -958,7 +848,7 @@ function getLocaleFromClassName(instance, suffix) {
|
|
|
958
848
|
*/
|
|
959
849
|
function getLocaleLanguage() {
|
|
960
850
|
const win = getWindow();
|
|
961
|
-
return win.navigator.language ||
|
|
851
|
+
return win.navigator.language || 'en';
|
|
962
852
|
// return win?.[WINDOW_KEYS.LANGUAGE_SELECTED] || (win.navigator.language || '').split('-')[0] || "en";
|
|
963
853
|
}
|
|
964
854
|
/**
|
|
@@ -977,9 +867,9 @@ function getLocaleLanguage() {
|
|
|
977
867
|
*/
|
|
978
868
|
function generateRandomValue(length = 8, onlyNumbers = false) {
|
|
979
869
|
const chars = onlyNumbers
|
|
980
|
-
?
|
|
981
|
-
:
|
|
982
|
-
let result =
|
|
870
|
+
? '0123456789'
|
|
871
|
+
: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
872
|
+
let result = '';
|
|
983
873
|
for (let i = 0; i < length; i++)
|
|
984
874
|
result += chars.charAt(Math.floor(Math.random() * chars.length));
|
|
985
875
|
return result;
|
|
@@ -998,8 +888,9 @@ function generateRandomValue(length = 8, onlyNumbers = false) {
|
|
|
998
888
|
* @memberOf module:lib/helpers/utils
|
|
999
889
|
*/
|
|
1000
890
|
function stringToBoolean(prop) {
|
|
1001
|
-
if (typeof prop ===
|
|
1002
|
-
prop = prop.toLowerCase() ===
|
|
891
|
+
if (typeof prop === Primitives.STRING) {
|
|
892
|
+
prop = String(prop).toLowerCase() === 'true' ? true : false;
|
|
893
|
+
}
|
|
1003
894
|
return prop;
|
|
1004
895
|
}
|
|
1005
896
|
/**
|
|
@@ -1021,10 +912,9 @@ function isValidDate(date) {
|
|
|
1021
912
|
return ((date instanceof Date && !isNaN(date)) ||
|
|
1022
913
|
(() => {
|
|
1023
914
|
const testRegex = new RegExp(/^\d{4}-\d{2}-\d{2}$/).test(date);
|
|
1024
|
-
if (typeof date !== Primitives.STRING ||
|
|
1025
|
-
(!date?.includes("T") && !testRegex))
|
|
915
|
+
if (typeof date !== Primitives.STRING || (!date?.includes('T') && !testRegex))
|
|
1026
916
|
return false;
|
|
1027
|
-
date = date.split(
|
|
917
|
+
date = date.split('T')[0];
|
|
1028
918
|
if (!new RegExp(/^\d{4}-\d{2}-\d{2}$/).test(date))
|
|
1029
919
|
return false;
|
|
1030
920
|
return !!new Date(date);
|
|
@@ -1055,51 +945,18 @@ function isValidDate(date) {
|
|
|
1055
945
|
function formatDate(date, locale) {
|
|
1056
946
|
if (!locale)
|
|
1057
947
|
locale = getLocaleLanguage();
|
|
1058
|
-
if (typeof date ===
|
|
1059
|
-
date = new Date(typeof date ===
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
948
|
+
if (typeof date === Primitives.STRING || typeof date === 'number') {
|
|
949
|
+
date = new Date(typeof date === Primitives.STRING ? `${date}`.replace(/\//g, '-') : date);
|
|
950
|
+
}
|
|
951
|
+
return !isValidDate(date)
|
|
952
|
+
? `${date}`
|
|
953
|
+
: date.toLocaleString(locale, {
|
|
954
|
+
year: 'numeric',
|
|
955
|
+
day: '2-digit',
|
|
956
|
+
month: '2-digit',
|
|
957
|
+
});
|
|
1068
958
|
}
|
|
1069
959
|
/**
|
|
1070
|
-
* @description Attempts to parse a date string, Date object, or number into a valid Date object.
|
|
1071
|
-
* @summary This function provides robust date parsing functionality that handles the specific
|
|
1072
|
-
* format "DD/MM/YYYY HH:MM:SS:MS". It first validates the input date, and if already valid,
|
|
1073
|
-
* returns it as-is. For string inputs, it parses the date and time components separately,
|
|
1074
|
-
* extracts numeric values, and constructs a new Date object. The function includes validation
|
|
1075
|
-
* to ensure the resulting Date object is valid and logs a warning if parsing fails.
|
|
1076
|
-
* Returns null for invalid or unsupported date formats.
|
|
1077
|
-
*
|
|
1078
|
-
* @param {string | Date | number} date - The date to parse. Can be a Date object, a timestamp number,
|
|
1079
|
-
* or a date string in the format "DD/MM/YYYY HH:MM:SS:MS"
|
|
1080
|
-
* @returns {Date | null} A valid Date object if parsing is successful, or null if the date is invalid
|
|
1081
|
-
* or doesn't match the expected format
|
|
1082
|
-
*
|
|
1083
|
-
* @function parseToValidDate
|
|
1084
|
-
* @memberOf module:lib/helpers/utils
|
|
1085
|
-
*/
|
|
1086
|
-
function parseToValidDate(date) {
|
|
1087
|
-
if (isValidDate(date))
|
|
1088
|
-
return date;
|
|
1089
|
-
if (!`${date}`.includes("/"))
|
|
1090
|
-
return null;
|
|
1091
|
-
const [dateString, timeString] = date.split(" ");
|
|
1092
|
-
const [day, month, year] = dateString.split("/").map(Number);
|
|
1093
|
-
const [hours, minutes, seconds, milliseconds] = timeString
|
|
1094
|
-
.split(":")
|
|
1095
|
-
.map(Number);
|
|
1096
|
-
date = new Date(year, month - 1, day, hours, minutes, seconds, milliseconds);
|
|
1097
|
-
if (!isValidDate(date)) {
|
|
1098
|
-
console.warn("parseToValidDate - Invalid date format", date);
|
|
1099
|
-
return null;
|
|
1100
|
-
}
|
|
1101
|
-
return date;
|
|
1102
|
-
}
|
|
1103
960
|
/**
|
|
1104
961
|
* @description Maps an item object using a provided mapper object and optional additional properties.
|
|
1105
962
|
* @summary This function transforms a source object into a new object based on mapping rules defined
|
|
@@ -1120,8 +977,8 @@ function parseToValidDate(date) {
|
|
|
1120
977
|
*/
|
|
1121
978
|
function itemMapper(item, mapper, props) {
|
|
1122
979
|
return Object.entries(mapper).reduce((accum, [key, prop]) => {
|
|
1123
|
-
const arrayValue = (prop ||
|
|
1124
|
-
let value = item?.[prop] ||
|
|
980
|
+
const arrayValue = (prop || '').split('.');
|
|
981
|
+
let value = item?.[prop] || '';
|
|
1125
982
|
if (!prop) {
|
|
1126
983
|
accum[key] = prop;
|
|
1127
984
|
}
|
|
@@ -1134,7 +991,7 @@ function itemMapper(item, mapper, props) {
|
|
|
1134
991
|
for (const propValue of arrayValue)
|
|
1135
992
|
value = !value
|
|
1136
993
|
? item[propValue]
|
|
1137
|
-
: (typeof value ===
|
|
994
|
+
: (typeof value === 'string' ? JSON.parse(value) : value)[propValue];
|
|
1138
995
|
if (isValidDate(new Date(value)))
|
|
1139
996
|
value = `${formatDate(value)}`;
|
|
1140
997
|
accum[key] = value === null || value === undefined ? prop : value;
|
|
@@ -1167,8 +1024,7 @@ function dataMapper(data, mapper, props) {
|
|
|
1167
1024
|
return [];
|
|
1168
1025
|
return data.reduce((accum, curr) => {
|
|
1169
1026
|
const item = itemMapper(curr, mapper, props);
|
|
1170
|
-
const hasValues = [...new Set(Object.values(item))].filter((value) => value).length >
|
|
1171
|
-
0;
|
|
1027
|
+
const hasValues = [...new Set(Object.values(item))].filter((value) => value).length > 0;
|
|
1172
1028
|
accum.push(hasValues ? item : curr);
|
|
1173
1029
|
return accum;
|
|
1174
1030
|
}, []);
|
|
@@ -1205,8 +1061,8 @@ function removeFocusTrap() {
|
|
|
1205
1061
|
* @function cleanSpaces
|
|
1206
1062
|
* @memberOf module:for-angular
|
|
1207
1063
|
*/
|
|
1208
|
-
function cleanSpaces(value =
|
|
1209
|
-
value = `${value}`.trim().replace(/\s+/g,
|
|
1064
|
+
function cleanSpaces(value = '', lowercase = false) {
|
|
1065
|
+
value = `${value}`.trim().replace(/\s+/g, ' ');
|
|
1210
1066
|
return lowercase ? value.toLowerCase() : value;
|
|
1211
1067
|
}
|
|
1212
1068
|
/**
|
|
@@ -1222,7 +1078,7 @@ function cleanSpaces(value = "", lowercase = false) {
|
|
|
1222
1078
|
* @memberOf module:for-angular
|
|
1223
1079
|
*/
|
|
1224
1080
|
async function isDarkMode() {
|
|
1225
|
-
const { matches } = getWindow().matchMedia(
|
|
1081
|
+
const { matches } = getWindow().matchMedia('(prefers-color-scheme: dark)');
|
|
1226
1082
|
return matches;
|
|
1227
1083
|
}
|
|
1228
1084
|
/**
|
|
@@ -1240,8 +1096,8 @@ async function isDarkMode() {
|
|
|
1240
1096
|
*/
|
|
1241
1097
|
function filterString(original, value, contain = true) {
|
|
1242
1098
|
if (typeof original === Primitives.STRING)
|
|
1243
|
-
original = original.split(
|
|
1244
|
-
return (original.filter((str) => contain ? str.includes(value) : !str.includes(value)) || []).join(
|
|
1099
|
+
original = original.split(' ');
|
|
1100
|
+
return (original.filter((str) => contain ? str.includes(value) : !str.includes(value)) || []).join(' ');
|
|
1245
1101
|
}
|
|
1246
1102
|
/**
|
|
1247
1103
|
* @summary Retrieves the icon associated with a menu item based on its label.
|
|
@@ -1252,11 +1108,8 @@ function filterString(original, value, contain = true) {
|
|
|
1252
1108
|
*/
|
|
1253
1109
|
function getMenuIcon(label, menu) {
|
|
1254
1110
|
const item = menu.find((m) => m.label?.toLowerCase() === label.toLowerCase());
|
|
1255
|
-
return item?.icon ||
|
|
1111
|
+
return item?.icon || '';
|
|
1256
1112
|
}
|
|
1257
|
-
const isClassConstructor = (value) => {
|
|
1258
|
-
return typeof value === "function" && /^class\s/.test(String(value));
|
|
1259
|
-
};
|
|
1260
1113
|
|
|
1261
1114
|
/**
|
|
1262
1115
|
* @module lib/engine/NgxFormService
|
|
@@ -1946,10 +1799,11 @@ class NgxFormService {
|
|
|
1946
1799
|
}
|
|
1947
1800
|
continue;
|
|
1948
1801
|
}
|
|
1949
|
-
data[key] =
|
|
1802
|
+
data[key] = NgxFormService.getFormData(control);
|
|
1950
1803
|
continue;
|
|
1951
1804
|
}
|
|
1952
1805
|
const props = NgxFormService.getPropsFromControl(control);
|
|
1806
|
+
// const { readonly } = (props as IFormComponentProperties) || false; TODO: dont send readonly fields?
|
|
1953
1807
|
let value = control.value;
|
|
1954
1808
|
if (!HTML5CheckTypes.includes(props['type'])) {
|
|
1955
1809
|
switch (props['type']) {
|
|
@@ -1958,7 +1812,7 @@ class NgxFormService {
|
|
|
1958
1812
|
break;
|
|
1959
1813
|
case HTML5InputTypes.DATE:
|
|
1960
1814
|
case HTML5InputTypes.DATETIME_LOCAL:
|
|
1961
|
-
value = typeof value === Primitives.STRING ? new Date(value) : value;
|
|
1815
|
+
value = typeof value === Primitives.STRING ? new Date(`${value}T00:00:00`) : value;
|
|
1962
1816
|
break;
|
|
1963
1817
|
default:
|
|
1964
1818
|
value = escapeHtml(value)?.trim();
|
|
@@ -2268,8 +2122,10 @@ class DecafFakerRepository extends LoggedClass {
|
|
|
2268
2122
|
}
|
|
2269
2123
|
get repository() {
|
|
2270
2124
|
if (!this._repository) {
|
|
2271
|
-
const modelName = typeof this.model ===
|
|
2272
|
-
|
|
2125
|
+
const modelName = typeof this.model === Primitives.STRING
|
|
2126
|
+
? this.model
|
|
2127
|
+
: this.model.constructor.name;
|
|
2128
|
+
const constructor = Model.get(String(modelName));
|
|
2273
2129
|
if (!constructor)
|
|
2274
2130
|
throw new InternalError(`Cannot find model ${modelName}. was it registered with @model?`);
|
|
2275
2131
|
try {
|
|
@@ -2307,7 +2163,7 @@ class DecafFakerRepository extends LoggedClass {
|
|
|
2307
2163
|
}
|
|
2308
2164
|
dataFunctions[prop] = this.getPropValueFn(prop, key);
|
|
2309
2165
|
}
|
|
2310
|
-
const data = getFakerData(limit, dataFunctions, typeof this.model ===
|
|
2166
|
+
const data = getFakerData(limit, dataFunctions, typeof this.model === Primitives.STRING ? String(this.model) : this.model?.constructor.name);
|
|
2311
2167
|
if (!values)
|
|
2312
2168
|
return data;
|
|
2313
2169
|
const _values = Object.values(values);
|
|
@@ -2539,8 +2395,10 @@ class NgxRenderingEngine extends RenderingEngine {
|
|
|
2539
2395
|
delete inputs[input];
|
|
2540
2396
|
return !isMapped;
|
|
2541
2397
|
});
|
|
2542
|
-
if (unmappedKeys.length > 0 && isDevelopmentMode())
|
|
2543
|
-
|
|
2398
|
+
// if (unmappedKeys.length > 0 && isDevelopmentMode())
|
|
2399
|
+
// getLogger(this).warn(
|
|
2400
|
+
// `Unmapped input properties for component ${fieldDef.tag}: ${unmappedKeys.join(', ')}`,
|
|
2401
|
+
// );
|
|
2544
2402
|
const operation = NgxRenderingEngine._operation;
|
|
2545
2403
|
const hiddenOn = inputs?.hidden || [];
|
|
2546
2404
|
if (hiddenOn.includes(operation))
|
|
@@ -2750,7 +2608,7 @@ class NgxRenderingEngine extends RenderingEngine {
|
|
|
2750
2608
|
NgxRenderingEngine._injector = injector;
|
|
2751
2609
|
try {
|
|
2752
2610
|
this._model = model;
|
|
2753
|
-
const formId = Date.now()
|
|
2611
|
+
const formId = `${Date.now()}`.toUpperCase();
|
|
2754
2612
|
const fieldDef = this.toFieldDefinition(model, globalProps);
|
|
2755
2613
|
const props = fieldDef.props;
|
|
2756
2614
|
if (!NgxRenderingEngine._operation)
|
|
@@ -3160,7 +3018,7 @@ class I18nLoader {
|
|
|
3160
3018
|
*/
|
|
3161
3019
|
getTranslation(lang) {
|
|
3162
3020
|
const libKeys = libLanguage[lang] || libLanguage['en'] || {};
|
|
3163
|
-
const httpRequests$ = forkJoin(this.resources.map(config => this.http.get(`${config.prefix}${lang}${this.getSuffix(config.suffix || '.json')}`)));
|
|
3021
|
+
const httpRequests$ = forkJoin(this.resources.map((config) => this.http.get(`${config.prefix}${lang}${this.getSuffix(config.suffix || '.json')}`)));
|
|
3164
3022
|
/**
|
|
3165
3023
|
* @description Recursively merges two translation objects.
|
|
3166
3024
|
* @summary Combines the properties of the source object into the target object.
|
|
@@ -3182,14 +3040,17 @@ class I18nLoader {
|
|
|
3182
3040
|
}
|
|
3183
3041
|
return target;
|
|
3184
3042
|
}
|
|
3185
|
-
return httpRequests$.pipe(map(res => {
|
|
3043
|
+
return httpRequests$.pipe(map((res) => {
|
|
3186
3044
|
const merged = {
|
|
3187
3045
|
...libKeys,
|
|
3188
3046
|
...res.reduce((acc, current) => {
|
|
3189
3047
|
for (const key in current) {
|
|
3190
3048
|
let value = current[key] || {};
|
|
3191
3049
|
if (libKeys[key]) {
|
|
3192
|
-
value = {
|
|
3050
|
+
value = {
|
|
3051
|
+
...libKeys[key],
|
|
3052
|
+
...recursiveMerge(libKeys[key], current[key]),
|
|
3053
|
+
};
|
|
3193
3054
|
}
|
|
3194
3055
|
acc[key] = value;
|
|
3195
3056
|
}
|
|
@@ -3214,10 +3075,7 @@ class I18nParser extends TranslateParser {
|
|
|
3214
3075
|
* @returns {string} - The interpolated translation string.
|
|
3215
3076
|
*/
|
|
3216
3077
|
interpolate(value, params = {}) {
|
|
3217
|
-
|
|
3218
|
-
params = { '0': params };
|
|
3219
|
-
}
|
|
3220
|
-
return sf(value, ...Object.values(params)).replace(/undefined/g, "");
|
|
3078
|
+
return sf(value, params === Primitives.STRING ? { '0': params } : params).replace(/undefined/g, '');
|
|
3221
3079
|
}
|
|
3222
3080
|
}
|
|
3223
3081
|
/**
|
|
@@ -3626,6 +3484,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
3626
3484
|
class NgxRepositoryDirective extends DecafComponent {
|
|
3627
3485
|
constructor() {
|
|
3628
3486
|
super(...arguments);
|
|
3487
|
+
/**
|
|
3488
|
+
* @description Store query results for the component.
|
|
3489
|
+
* @summary Holds an array of `Model` instances returned from repository queries.
|
|
3490
|
+
* This is used internally to cache query results that child components may bind to.
|
|
3491
|
+
* @type {M[]}
|
|
3492
|
+
*/
|
|
3493
|
+
this._query = [];
|
|
3494
|
+
/**
|
|
3495
|
+
* @description Backing model data supplied to the component.
|
|
3496
|
+
* @summary Holds the raw `Model` instance or a generic key-value payload that child
|
|
3497
|
+
* components may bind to. When provided, it represents the contextual data the
|
|
3498
|
+
* component should render or mutate.
|
|
3499
|
+
* @type {M | M[] | KeyValue | KeyValue[] | undefined}
|
|
3500
|
+
*/
|
|
3501
|
+
this._data = {};
|
|
3502
|
+
/**
|
|
3503
|
+
* @description Primary key value of the current model instance.
|
|
3504
|
+
* @summary Specifies the primary key value for the current model record being displayed or
|
|
3505
|
+
* manipulated by the component. This identifier is used for CRUD operations that target
|
|
3506
|
+
* specific records, such as read, update, and delete operations. The value corresponds to
|
|
3507
|
+
* the field designated as the primary key in the model definition.
|
|
3508
|
+
* @type {PrimaryKeyType}
|
|
3509
|
+
* @memberOf module:lib/engine/NgxRepositoryDirective
|
|
3510
|
+
*/
|
|
3511
|
+
this.modelId = '';
|
|
3629
3512
|
/**
|
|
3630
3513
|
* @description The starting index for data fetching.
|
|
3631
3514
|
* @summary Specifies the index from which to start fetching data. This is used
|
|
@@ -3664,16 +3547,19 @@ class NgxRepositoryDirective extends DecafComponent {
|
|
|
3664
3547
|
*/
|
|
3665
3548
|
this.indexes = [];
|
|
3666
3549
|
/**
|
|
3667
|
-
* @description
|
|
3668
|
-
* @summary
|
|
3669
|
-
*
|
|
3670
|
-
*
|
|
3671
|
-
*
|
|
3550
|
+
* @description Subject for debouncing repository observation events.
|
|
3551
|
+
* @summary RxJS Subject that collects repository change events and emits them after
|
|
3552
|
+
* a debounce period. This prevents multiple rapid repository changes from triggering
|
|
3553
|
+
* multiple list refresh operations, improving performance and user experience.
|
|
3554
|
+
*
|
|
3555
|
+
* @private
|
|
3556
|
+
* @type {Subject<any>}
|
|
3672
3557
|
*/
|
|
3673
|
-
|
|
3558
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3559
|
+
this.repositoryObserverSubject = new Subject();
|
|
3674
3560
|
}
|
|
3675
3561
|
async initialize() {
|
|
3676
|
-
if (this.repository
|
|
3562
|
+
if (this.repository) {
|
|
3677
3563
|
if (this.filter) {
|
|
3678
3564
|
this._data = await this.query(this.filter.eq(this.modelId));
|
|
3679
3565
|
if (this._data) {
|
|
@@ -3681,6 +3567,7 @@ class NgxRepositoryDirective extends DecafComponent {
|
|
|
3681
3567
|
}
|
|
3682
3568
|
}
|
|
3683
3569
|
else {
|
|
3570
|
+
// this._data = await this.read(this.modelId as PrimaryKeyType);
|
|
3684
3571
|
// if (String(this.modelName) === this.model?.constructor.name) {
|
|
3685
3572
|
// const model = await this.repository.read(this.modelId as PrimaryKeyType);
|
|
3686
3573
|
// if (model) {
|
|
@@ -3704,7 +3591,7 @@ class NgxRepositoryDirective extends DecafComponent {
|
|
|
3704
3591
|
return this._context;
|
|
3705
3592
|
}
|
|
3706
3593
|
async refresh(model) {
|
|
3707
|
-
if (model) {
|
|
3594
|
+
if (model && Model.isModel(model)) {
|
|
3708
3595
|
this.model = Model.build(model, this.modelName);
|
|
3709
3596
|
this._data = model;
|
|
3710
3597
|
}
|
|
@@ -3716,7 +3603,7 @@ class NgxRepositoryDirective extends DecafComponent {
|
|
|
3716
3603
|
const condtion = this.filter || Condition.attribute(attr);
|
|
3717
3604
|
const type = this.getModelPropertyType(this.repository.class, attr);
|
|
3718
3605
|
if (this.modelId) {
|
|
3719
|
-
return condtion.eq([Primitives.NUMBER, Primitives.BIGINT].includes(
|
|
3606
|
+
return condtion.eq([Primitives.NUMBER, Primitives.BIGINT].includes(type)
|
|
3720
3607
|
? Number(this.modelId)
|
|
3721
3608
|
: this.modelId);
|
|
3722
3609
|
}
|
|
@@ -3756,16 +3643,40 @@ class NgxRepositoryDirective extends DecafComponent {
|
|
|
3756
3643
|
.paginate(limit);
|
|
3757
3644
|
}
|
|
3758
3645
|
async transactionBegin(data, repository, operation) {
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3646
|
+
try {
|
|
3647
|
+
const hook = `before${operation.charAt(0).toUpperCase() + operation.slice(1)}`;
|
|
3648
|
+
const handler = this.handlers?.[hook] || undefined;
|
|
3649
|
+
const model = this.buildTransactionModel(data || {}, repository, operation);
|
|
3650
|
+
if (handler && typeof handler === 'function') {
|
|
3651
|
+
const result = (await handler.bind(this)(model, repository, this.modelId));
|
|
3652
|
+
if (result === false) {
|
|
3653
|
+
return undefined;
|
|
3654
|
+
}
|
|
3766
3655
|
}
|
|
3656
|
+
return model;
|
|
3657
|
+
}
|
|
3658
|
+
catch (error) {
|
|
3659
|
+
this.log.for(this).error(error?.message || String(error));
|
|
3660
|
+
return undefined;
|
|
3661
|
+
}
|
|
3662
|
+
}
|
|
3663
|
+
async transactionEnd(model, repository, operation) {
|
|
3664
|
+
try {
|
|
3665
|
+
const hook = `after${operation.charAt(0).toUpperCase() + operation.slice(1)}`;
|
|
3666
|
+
const handler = this.handlers?.[hook] || undefined;
|
|
3667
|
+
if (handler && typeof handler === 'function') {
|
|
3668
|
+
const result = (await handler.bind(this)(model, repository, this.modelId));
|
|
3669
|
+
if (result === false) {
|
|
3670
|
+
return undefined;
|
|
3671
|
+
}
|
|
3672
|
+
return result;
|
|
3673
|
+
}
|
|
3674
|
+
return model;
|
|
3675
|
+
}
|
|
3676
|
+
catch (error) {
|
|
3677
|
+
this.log.for(this).error(error?.message || String(error));
|
|
3678
|
+
return undefined;
|
|
3767
3679
|
}
|
|
3768
|
-
return model;
|
|
3769
3680
|
}
|
|
3770
3681
|
/**
|
|
3771
3682
|
* @description Parses and transforms form data for repository operations.
|
|
@@ -3790,8 +3701,9 @@ class NgxRepositoryDirective extends DecafComponent {
|
|
|
3790
3701
|
const pk = Model.pk(repository.class);
|
|
3791
3702
|
const pkType = Metadata.type(repository.class, pk).name;
|
|
3792
3703
|
const modelId = (this.modelId || data[pk]);
|
|
3793
|
-
if (!this.modelId)
|
|
3704
|
+
if (!this.modelId) {
|
|
3794
3705
|
this.modelId = modelId;
|
|
3706
|
+
}
|
|
3795
3707
|
const uid = this.parsePkValue(operation === OperationKeys.DELETE ? data[pk] : modelId, pkType);
|
|
3796
3708
|
if (operation !== OperationKeys.DELETE) {
|
|
3797
3709
|
const properties = Metadata.properties(repository.class);
|
|
@@ -3800,6 +3712,9 @@ class NgxRepositoryDirective extends DecafComponent {
|
|
|
3800
3712
|
: properties.includes(this.pk) && !data[this.pk]
|
|
3801
3713
|
? { [this.pk]: modelId }
|
|
3802
3714
|
: {};
|
|
3715
|
+
if (!String(data?.[pk] || '').trim().length) {
|
|
3716
|
+
data[pk] = undefined;
|
|
3717
|
+
}
|
|
3803
3718
|
return Model.build(Object.assign(data || {}, relation, modelId && !data[this.pk] ? { [this.pk]: modelId } : {}), repository.class.name);
|
|
3804
3719
|
}
|
|
3805
3720
|
return uid;
|
|
@@ -3825,12 +3740,38 @@ class NgxRepositoryDirective extends DecafComponent {
|
|
|
3825
3740
|
getModelPkType(clazz) {
|
|
3826
3741
|
return this.getModelPropertyType(clazz, Model.pk(clazz));
|
|
3827
3742
|
}
|
|
3743
|
+
/**
|
|
3744
|
+
* @description Handles repository observation events with debouncing.
|
|
3745
|
+
* @summary Processes repository change notifications and routes them appropriately.
|
|
3746
|
+
* For CREATE events with a UID, handles them immediately. For other events,
|
|
3747
|
+
* passes them to the debounced observer subject to prevent excessive updates.
|
|
3748
|
+
*
|
|
3749
|
+
* @param {...unknown[]} args - The repository event arguments including table, event type, and UID
|
|
3750
|
+
* @returns {Promise<void>}
|
|
3751
|
+
*/
|
|
3752
|
+
async handleRepositoryRefresh(...args) {
|
|
3753
|
+
const [modelInstance, event, uid] = args;
|
|
3754
|
+
if ([OperationKeys.CREATE, OperationKeys.DELETE].includes(event))
|
|
3755
|
+
return this.handleObserveEvent(modelInstance, event, uid);
|
|
3756
|
+
return this.repositoryObserverSubject.next(args);
|
|
3757
|
+
}
|
|
3758
|
+
async handleObserveEvent(...args) {
|
|
3759
|
+
this.log.for(this.handleObserveEvent).info(`Repository change observed with args: ${args}`);
|
|
3760
|
+
}
|
|
3828
3761
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NgxRepositoryDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3829
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.16", type: NgxRepositoryDirective, isStandalone: true, inputs: { modelName: "modelName", pk: "pk", filter: "filter", filterBy: "filterBy", start: "start", limit: "limit", sortDirection: "sortDirection", sortBy: "sortBy", indexes: "indexes"
|
|
3762
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.16", type: NgxRepositoryDirective, isStandalone: true, inputs: { _query: "_query", _data: "_data", model: "model", modelId: "modelId", modelName: "modelName", pk: "pk", filter: "filter", filterBy: "filterBy", start: "start", limit: "limit", sortDirection: "sortDirection", sortBy: "sortBy", indexes: "indexes" }, usesInheritance: true, ngImport: i0 }); }
|
|
3830
3763
|
}
|
|
3831
3764
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NgxRepositoryDirective, decorators: [{
|
|
3832
3765
|
type: Directive
|
|
3833
|
-
}], propDecorators: {
|
|
3766
|
+
}], propDecorators: { _query: [{
|
|
3767
|
+
type: Input
|
|
3768
|
+
}], _data: [{
|
|
3769
|
+
type: Input
|
|
3770
|
+
}], model: [{
|
|
3771
|
+
type: Input
|
|
3772
|
+
}], modelId: [{
|
|
3773
|
+
type: Input
|
|
3774
|
+
}], modelName: [{
|
|
3834
3775
|
type: Input
|
|
3835
3776
|
}], pk: [{
|
|
3836
3777
|
type: Input
|
|
@@ -3848,8 +3789,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
3848
3789
|
type: Input
|
|
3849
3790
|
}], indexes: [{
|
|
3850
3791
|
type: Input
|
|
3851
|
-
}], _data: [{
|
|
3852
|
-
type: Input
|
|
3853
3792
|
}] } });
|
|
3854
3793
|
|
|
3855
3794
|
/**
|
|
@@ -4217,19 +4156,8 @@ class NgxComponentDirective extends NgxRepositoryDirective {
|
|
|
4217
4156
|
*/
|
|
4218
4157
|
this.colorSchema = WindowColorSchemes.light;
|
|
4219
4158
|
this.destroySubscriptions$ = new Subject();
|
|
4220
|
-
/**
|
|
4221
|
-
* @description Subject for debouncing repository observation events.
|
|
4222
|
-
* @summary RxJS Subject that collects repository change events and emits them after
|
|
4223
|
-
* a debounce period. This prevents multiple rapid repository changes from triggering
|
|
4224
|
-
* multiple list refresh operations, improving performance and user experience.
|
|
4225
|
-
*
|
|
4226
|
-
* @private
|
|
4227
|
-
* @type {Subject<any>}
|
|
4228
|
-
*/
|
|
4229
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4230
|
-
this.repositoryObserverSubject = new Subject();
|
|
4231
4159
|
this.value = undefined;
|
|
4232
|
-
this.componentName = componentName || 'NgxComponentDirective';
|
|
4160
|
+
this.componentName = componentName || this.constructor.name || 'NgxComponentDirective';
|
|
4233
4161
|
this.localeRoot = localeRoot;
|
|
4234
4162
|
if (!this.localeRoot && this.componentName)
|
|
4235
4163
|
this.localeRoot = this.componentName;
|
|
@@ -4243,23 +4171,22 @@ class NgxComponentDirective extends NgxRepositoryDirective {
|
|
|
4243
4171
|
}
|
|
4244
4172
|
});
|
|
4245
4173
|
}
|
|
4246
|
-
/**
|
|
4247
|
-
* @description Cleanup lifecycle hook invoked when the directive is destroyed.
|
|
4248
|
-
* @summary Ensures any resources allocated by the directive's media service are
|
|
4249
|
-
* released (DOM listeners, timers, subscriptions, etc.). Implementations should
|
|
4250
|
-
* keep `mediaService.destroy()` idempotent; calling it here prevents leaks when
|
|
4251
|
-
* components are torn down.
|
|
4252
|
-
* @returns {Promise<void>}
|
|
4253
|
-
*/
|
|
4254
|
-
async ngOnDestroy() {
|
|
4255
|
-
this.mediaService.destroy();
|
|
4256
|
-
this.destroySubscriptions$.next();
|
|
4257
|
-
this.destroySubscriptions$.complete();
|
|
4258
|
-
}
|
|
4259
4174
|
async initialize() {
|
|
4260
4175
|
this.mediaService.darkModeEnabled();
|
|
4261
4176
|
// connect component to media service for color scheme toggling
|
|
4262
4177
|
this.mediaService.colorSchemeObserver(this.component);
|
|
4178
|
+
if (!this.initialized && Object.keys(this.props || {}).length) {
|
|
4179
|
+
this.parseProps(this);
|
|
4180
|
+
}
|
|
4181
|
+
this.router.events
|
|
4182
|
+
.pipe(shareReplay$1(1), takeUntil$1(this.destroySubscriptions$))
|
|
4183
|
+
.subscribe(async (event) => {
|
|
4184
|
+
if (event instanceof NavigationStart) {
|
|
4185
|
+
if (this.value) {
|
|
4186
|
+
await this.ngOnDestroy();
|
|
4187
|
+
}
|
|
4188
|
+
}
|
|
4189
|
+
});
|
|
4263
4190
|
this.route = this.router.url.replace('/', '');
|
|
4264
4191
|
const instance = this;
|
|
4265
4192
|
if (this.propsMapperFn) {
|
|
@@ -4272,12 +4199,12 @@ class NgxComponentDirective extends NgxRepositoryDirective {
|
|
|
4272
4199
|
if (!this.initialized) {
|
|
4273
4200
|
const handler = this.handlers?.[ComponentEventNames.Render] || undefined;
|
|
4274
4201
|
if (handler && typeof handler === 'function') {
|
|
4275
|
-
await handler.bind(
|
|
4202
|
+
await handler.bind(instance)(instance, this.name, this.value);
|
|
4276
4203
|
}
|
|
4277
4204
|
// search for event to render event
|
|
4278
4205
|
const event = this.events?.[ComponentEventNames.Render] || undefined;
|
|
4279
4206
|
if (event && typeof event === 'function') {
|
|
4280
|
-
await event.bind(
|
|
4207
|
+
await event.bind(instance)(instance, this.name, this.value);
|
|
4281
4208
|
}
|
|
4282
4209
|
}
|
|
4283
4210
|
await super.initialize();
|
|
@@ -4286,6 +4213,22 @@ class NgxComponentDirective extends NgxRepositoryDirective {
|
|
|
4286
4213
|
this.changeDetectorRef.detectChanges();
|
|
4287
4214
|
}
|
|
4288
4215
|
}
|
|
4216
|
+
/**
|
|
4217
|
+
* @description Cleanup lifecycle hook invoked when the directive is destroyed.
|
|
4218
|
+
* @summary Ensures any resources allocated by the directive's media service are
|
|
4219
|
+
* released (DOM listeners, timers, subscriptions, etc.). Implementations should
|
|
4220
|
+
* keep `mediaService.destroy()` idempotent; calling it here prevents leaks when
|
|
4221
|
+
* components are torn down.
|
|
4222
|
+
* @returns {Promise<void>}
|
|
4223
|
+
*/
|
|
4224
|
+
async ngOnDestroy() {
|
|
4225
|
+
this.value = undefined;
|
|
4226
|
+
this.mediaService.destroy();
|
|
4227
|
+
if (this.destroySubscriptions$) {
|
|
4228
|
+
this.destroySubscriptions$.next();
|
|
4229
|
+
this.destroySubscriptions$.complete();
|
|
4230
|
+
}
|
|
4231
|
+
}
|
|
4289
4232
|
/**
|
|
4290
4233
|
* @description Getter for the current locale context identifier.
|
|
4291
4234
|
* @summary Returns the current locale identifier by calling the getLocale method.
|
|
@@ -4342,8 +4285,9 @@ class NgxComponentDirective extends NgxRepositoryDirective {
|
|
|
4342
4285
|
async ngOnChanges(changes) {
|
|
4343
4286
|
if (changes[ModelKeys.MODEL]) {
|
|
4344
4287
|
const { currentValue } = changes[ModelKeys.MODEL];
|
|
4345
|
-
if (currentValue)
|
|
4288
|
+
if (currentValue) {
|
|
4346
4289
|
this.getModel(currentValue);
|
|
4290
|
+
}
|
|
4347
4291
|
this.locale = this.localeContext;
|
|
4348
4292
|
}
|
|
4349
4293
|
// if (changes[UIKeys.HANDLERS]) {
|
|
@@ -4362,7 +4306,7 @@ class NgxComponentDirective extends NgxRepositoryDirective {
|
|
|
4362
4306
|
if (changes[BaseComponentProps.HANDLERS]) {
|
|
4363
4307
|
const { currentValue, previousValue } = changes[BaseComponentProps.HANDLERS];
|
|
4364
4308
|
if (currentValue && currentValue !== previousValue)
|
|
4365
|
-
this.parseHandlers(currentValue);
|
|
4309
|
+
this.parseHandlers(currentValue, this);
|
|
4366
4310
|
}
|
|
4367
4311
|
if (changes[UIKeys.EVENTS]) {
|
|
4368
4312
|
const { currentValue, previousValue } = changes[UIKeys.EVENTS];
|
|
@@ -4370,7 +4314,7 @@ class NgxComponentDirective extends NgxRepositoryDirective {
|
|
|
4370
4314
|
if (!this._repository) {
|
|
4371
4315
|
this._repository = this.repository;
|
|
4372
4316
|
}
|
|
4373
|
-
this.parseEvents(currentValue);
|
|
4317
|
+
this.parseEvents(currentValue, this);
|
|
4374
4318
|
// for (const key in currentValue) {
|
|
4375
4319
|
// const event = currentValue[key]();
|
|
4376
4320
|
// if (event && typeof event === 'function') {
|
|
@@ -4422,42 +4366,19 @@ class NgxComponentDirective extends NgxRepositoryDirective {
|
|
|
4422
4366
|
this.mediaService.toggleClass([this.component], AngularEngineKeys.DARK_PALETTE_CLASS, this.isDarkMode);
|
|
4423
4367
|
});
|
|
4424
4368
|
}
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
return this.handleObserveEvent(modelInstance, event, uid);
|
|
4439
|
-
return this.repositoryObserverSubject.next(args);
|
|
4440
|
-
}
|
|
4441
|
-
async handleObserveEvent(...args) {
|
|
4442
|
-
this.log.for(this.handleObserveEvent).info(`Repository change observed with args: ${args}`);
|
|
4443
|
-
}
|
|
4444
|
-
parseHandlers(handlers) {
|
|
4445
|
-
// function isClass(value: UIFunctionLike | Constructor<NgxEventHandler>): boolean {
|
|
4446
|
-
// return typeof value === 'function' && /^class\s/.test(String(value));
|
|
4447
|
-
// }
|
|
4448
|
-
Object.entries(handlers).forEach(([key, fn]) => {
|
|
4449
|
-
if (isClassConstructor(fn)) {
|
|
4450
|
-
const clazz = new fn();
|
|
4451
|
-
this.handlers[key] = key in clazz ? clazz[key] : clazz.handle;
|
|
4452
|
-
// !(Object.values(TransactionHooks).includes(key as keyof typeof TransactionHooks))
|
|
4453
|
-
// ? clazz.handle
|
|
4454
|
-
// : clazz[key as keyof NgxEventHandler];
|
|
4455
|
-
}
|
|
4456
|
-
else {
|
|
4457
|
-
this.handlers[key] = fn;
|
|
4458
|
-
}
|
|
4459
|
-
});
|
|
4460
|
-
}
|
|
4369
|
+
// parseHandlers(handlers: Record<string, UIFunctionLike>): void {
|
|
4370
|
+
// // function isClass(value: UIFunctionLike | Constructor<NgxEventHandler>): boolean {
|
|
4371
|
+
// // return typeof value === 'function' && /^class\s/.test(String(value));
|
|
4372
|
+
// // }
|
|
4373
|
+
// Object.entries(handlers).forEach(([key, fn]) => {
|
|
4374
|
+
// if (isClassConstructor<NgxEventHandler>(fn)) {
|
|
4375
|
+
// const clazz = new fn() as NgxEventHandler;
|
|
4376
|
+
// this.handlers[key] = key in clazz ? clazz[key as keyof NgxEventHandler] : clazz.handle;
|
|
4377
|
+
// } else {
|
|
4378
|
+
// this.handlers[key] = fn as UIFunctionLike;
|
|
4379
|
+
// }
|
|
4380
|
+
// });
|
|
4381
|
+
// }
|
|
4461
4382
|
// for (const key in currentValue) {
|
|
4462
4383
|
// const event = currentValue[key]();
|
|
4463
4384
|
// if (event && typeof event === 'function') {
|
|
@@ -4478,17 +4399,25 @@ class NgxComponentDirective extends NgxRepositoryDirective {
|
|
|
4478
4399
|
// }
|
|
4479
4400
|
// }
|
|
4480
4401
|
// }
|
|
4481
|
-
parseEvents(
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4402
|
+
// parseEvents<T extends DecafComponent<Model>>(
|
|
4403
|
+
// events: Record<string, UIFunctionLike>,
|
|
4404
|
+
// ): UIEventProperty {
|
|
4405
|
+
// const result: UIEventProperty = {};
|
|
4406
|
+
// Object.entries(events).forEach(([key, fn]) => {
|
|
4407
|
+
// const event = (fn as UIFunctionLike)();
|
|
4408
|
+
// if (isClassConstructor<DecafComponent<Model>>(event)) {
|
|
4409
|
+
// const fn = new event()[key as keyof DecafComponent<Model>] || undefined;
|
|
4410
|
+
// if (fn) {
|
|
4411
|
+
// this.events[key] = fn;
|
|
4412
|
+
// result[key] = fn;
|
|
4413
|
+
// }
|
|
4414
|
+
// } else {
|
|
4415
|
+
// this.events[key] = fn as UIFunctionLike;
|
|
4416
|
+
// result[key] = fn;
|
|
4417
|
+
// }
|
|
4418
|
+
// });
|
|
4419
|
+
// return result;
|
|
4420
|
+
// }
|
|
4492
4421
|
/**
|
|
4493
4422
|
* @description Retrieves or sets the locale context for the component.
|
|
4494
4423
|
* @summary Gets the locale identifier from the locale context system. If a locale parameter
|
|
@@ -4605,11 +4534,17 @@ class NgxComponentDirective extends NgxRepositoryDirective {
|
|
|
4605
4534
|
* @protected
|
|
4606
4535
|
* @memberOf module:lib/engine/NgxComponentDirective
|
|
4607
4536
|
*/
|
|
4608
|
-
parseProps(instance, skip = []) {
|
|
4537
|
+
parseProps(instance, skip = [AngularEngineKeys.CHILDREN]) {
|
|
4609
4538
|
const props = this.props;
|
|
4610
4539
|
Object.keys(instance).forEach((key) => {
|
|
4611
4540
|
if (Object.keys(this.props).includes(key) && !skip.includes(key)) {
|
|
4612
4541
|
this[key] = props[key];
|
|
4542
|
+
if (key === BaseComponentProps.HANDLERS) {
|
|
4543
|
+
this.parseHandlers(props[key], this);
|
|
4544
|
+
}
|
|
4545
|
+
if (key === UIKeys.EVENTS) {
|
|
4546
|
+
this.parseEvents(props[key], this);
|
|
4547
|
+
}
|
|
4613
4548
|
delete props[key];
|
|
4614
4549
|
}
|
|
4615
4550
|
});
|
|
@@ -4774,7 +4709,7 @@ class NgxComponentDirective extends NgxRepositoryDirective {
|
|
|
4774
4709
|
await this.initialize();
|
|
4775
4710
|
}
|
|
4776
4711
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NgxComponentDirective, deps: [{ token: CPTKN }, { token: CPTKN }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4777
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.16", type: NgxComponentDirective, isStandalone: true, inputs: { enableDarkMode: "enableDarkMode", isDarkMode: "isDarkMode", name: "name", childOf: "childOf", uid: "uid",
|
|
4712
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.16", type: NgxComponentDirective, isStandalone: true, inputs: { enableDarkMode: "enableDarkMode", isDarkMode: "isDarkMode", name: "name", childOf: "childOf", uid: "uid", label: "label", formGroup: "formGroup", value: "value", mapper: "mapper", operations: "operations", operation: "operation", row: "row", col: "col", className: "className", translatable: "translatable", locale: "locale", item: "item", props: "props", route: "route", borders: "borders", isModalChild: "isModalChild", handlers: "handlers", events: "events", propsMapperFn: "propsMapperFn" }, outputs: { listenEvent: "listenEvent", refreshEvent: "refreshEvent" }, host: { properties: { "attr.id": "uid" } }, viewQueries: [{ propertyName: "component", first: true, predicate: ["component"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0 }); }
|
|
4778
4713
|
}
|
|
4779
4714
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NgxComponentDirective, decorators: [{
|
|
4780
4715
|
type: Directive,
|
|
@@ -4798,9 +4733,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
4798
4733
|
type: Input
|
|
4799
4734
|
}], uid: [{
|
|
4800
4735
|
type: Input
|
|
4801
|
-
}],
|
|
4802
|
-
type: Input
|
|
4803
|
-
}], modelId: [{
|
|
4736
|
+
}], label: [{
|
|
4804
4737
|
type: Input
|
|
4805
4738
|
}], formGroup: [{
|
|
4806
4739
|
type: Input
|
|
@@ -4871,7 +4804,11 @@ class NgxPageDirective extends NgxComponentDirective {
|
|
|
4871
4804
|
* @param {boolean} [hasMenu=true] - Whether this page should display the menu
|
|
4872
4805
|
* @memberOf module:lib/engine/NgxPageDirective
|
|
4873
4806
|
*/
|
|
4874
|
-
constructor(
|
|
4807
|
+
constructor(
|
|
4808
|
+
// eslint-disable-next-line @angular-eslint/prefer-inject
|
|
4809
|
+
localeRoot = 'NgxPageDirective',
|
|
4810
|
+
// eslint-disable-next-line @angular-eslint/prefer-inject
|
|
4811
|
+
hasMenu = true) {
|
|
4875
4812
|
super(localeRoot);
|
|
4876
4813
|
/**
|
|
4877
4814
|
* @description Page title text for the current view.
|
|
@@ -5085,8 +5022,7 @@ class NgxModelPageDirective extends NgxPageDirective {
|
|
|
5085
5022
|
async initialize() {
|
|
5086
5023
|
await super.initialize();
|
|
5087
5024
|
await this.refresh(this.modelId);
|
|
5088
|
-
|
|
5089
|
-
this.operations = this.operations.filter((o) => [OperationKeys.UPDATE, OperationKeys.DELETE].includes(o));
|
|
5025
|
+
this.changeDetectorRef.detectChanges();
|
|
5090
5026
|
this.getLocale(this.modelName);
|
|
5091
5027
|
}
|
|
5092
5028
|
// /**
|
|
@@ -5108,8 +5044,9 @@ class NgxModelPageDirective extends NgxPageDirective {
|
|
|
5108
5044
|
* @param {string} [uid] - The unique identifier of the model to load; defaults to modelId
|
|
5109
5045
|
*/
|
|
5110
5046
|
async refresh(uid) {
|
|
5111
|
-
if (!uid)
|
|
5047
|
+
if (!uid) {
|
|
5112
5048
|
uid = this.modelId;
|
|
5049
|
+
}
|
|
5113
5050
|
try {
|
|
5114
5051
|
this._repository = this.repository;
|
|
5115
5052
|
switch (this.operation) {
|
|
@@ -5265,7 +5202,7 @@ class NgxModelPageDirective extends NgxPageDirective {
|
|
|
5265
5202
|
* @param {string} uid - The unique identifier of the model instance to retrieve
|
|
5266
5203
|
* @return {Promise<Model | undefined>} Promise resolving to the model instance or undefined
|
|
5267
5204
|
*/
|
|
5268
|
-
async handleRead(uid, repository, modelName
|
|
5205
|
+
async handleRead(uid, repository, modelName) {
|
|
5269
5206
|
if (!uid) {
|
|
5270
5207
|
this.log.info('No key passed to model page read operation, backing to last page');
|
|
5271
5208
|
return undefined;
|
|
@@ -5275,7 +5212,7 @@ class NgxModelPageDirective extends NgxPageDirective {
|
|
|
5275
5212
|
if (!modelName && this.model?.constructor)
|
|
5276
5213
|
this.modelName = modelName = this.model.constructor.name;
|
|
5277
5214
|
}
|
|
5278
|
-
const getRepository = async (modelName,
|
|
5215
|
+
const getRepository = async (modelName, acc = {}, parent = '') => {
|
|
5279
5216
|
if (this._repository)
|
|
5280
5217
|
return this._repository;
|
|
5281
5218
|
const constructor = Model.get(modelName);
|
|
@@ -5285,10 +5222,10 @@ class NgxModelPageDirective extends NgxPageDirective {
|
|
|
5285
5222
|
const type = this.getModelPropertyType(constructor, prop);
|
|
5286
5223
|
const context = getModelAndRepository(type);
|
|
5287
5224
|
if (!context) {
|
|
5288
|
-
|
|
5289
|
-
return getRepository(type,
|
|
5225
|
+
acc[prop] = {};
|
|
5226
|
+
return getRepository(type, acc, prop);
|
|
5290
5227
|
}
|
|
5291
|
-
const { repository, pk, pkType } = context;
|
|
5228
|
+
const { repository, model, pk, pkType } = context;
|
|
5292
5229
|
if (!this.pk) {
|
|
5293
5230
|
this.pk = pk;
|
|
5294
5231
|
this.pkType = pkType;
|
|
@@ -5302,8 +5239,10 @@ class NgxModelPageDirective extends NgxPageDirective {
|
|
|
5302
5239
|
.execute();
|
|
5303
5240
|
if (modelName === this.modelName) {
|
|
5304
5241
|
const data = query?.length ? (query?.length === 1 ? query[0] : query) : undefined;
|
|
5305
|
-
|
|
5306
|
-
|
|
5242
|
+
acc[prop] = data;
|
|
5243
|
+
const model = await this.transactionEnd(data, repository, OperationKeys.READ);
|
|
5244
|
+
this.name = prop;
|
|
5245
|
+
this.model = Model.build({ [prop]: model ? model : data }, modelName);
|
|
5307
5246
|
}
|
|
5308
5247
|
else {
|
|
5309
5248
|
// model[parent] = {
|
|
@@ -5477,8 +5416,8 @@ class NgxModelPageDirective extends NgxPageDirective {
|
|
|
5477
5416
|
return { ...event, success, message, model: result, aborted: false };
|
|
5478
5417
|
}
|
|
5479
5418
|
async batchOperation(context, redirect = false) {
|
|
5480
|
-
const { data, repository, pk } = context.context;
|
|
5481
|
-
return data;
|
|
5419
|
+
// const { data, repository, pk } = context.context;
|
|
5420
|
+
// return data;
|
|
5482
5421
|
// return await this.submit({data}, false, repository, pk);
|
|
5483
5422
|
// const result: boolean[] = [];
|
|
5484
5423
|
// let resultMessage = '';
|
|
@@ -5496,13 +5435,11 @@ class NgxModelPageDirective extends NgxPageDirective {
|
|
|
5496
5435
|
// return {...{data: models}, success, message: resultMessage};
|
|
5497
5436
|
}
|
|
5498
5437
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NgxModelPageDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5499
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.16", type: NgxModelPageDirective, isStandalone: true, inputs: {
|
|
5438
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.16", type: NgxModelPageDirective, isStandalone: true, inputs: { operation: "operation" }, usesInheritance: true, ngImport: i0 }); }
|
|
5500
5439
|
}
|
|
5501
5440
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NgxModelPageDirective, decorators: [{
|
|
5502
5441
|
type: Directive
|
|
5503
|
-
}], propDecorators: {
|
|
5504
|
-
type: Input
|
|
5505
|
-
}], operation: [{
|
|
5442
|
+
}], propDecorators: { operation: [{
|
|
5506
5443
|
type: Input
|
|
5507
5444
|
}] } });
|
|
5508
5445
|
|
|
@@ -5718,6 +5655,7 @@ class ComponentRendererComponent extends NgxRenderableComponentDirective {
|
|
|
5718
5655
|
super(...arguments);
|
|
5719
5656
|
this.children = [];
|
|
5720
5657
|
this.projectable = true;
|
|
5658
|
+
this.pk = '';
|
|
5721
5659
|
this.parent = undefined;
|
|
5722
5660
|
}
|
|
5723
5661
|
/**
|
|
@@ -5781,8 +5719,7 @@ class ComponentRendererComponent extends NgxRenderableComponentDirective {
|
|
|
5781
5719
|
* @memberOf ComponentRendererComponent
|
|
5782
5720
|
*/
|
|
5783
5721
|
createComponent(tag, globals = {}) {
|
|
5784
|
-
const component = NgxRenderingEngine.components(tag)
|
|
5785
|
-
?.constructor;
|
|
5722
|
+
const component = NgxRenderingEngine.components(tag)?.constructor;
|
|
5786
5723
|
const metadata = reflectComponentType(component);
|
|
5787
5724
|
const componentInputs = metadata.inputs;
|
|
5788
5725
|
const props = globals?.['item'] || globals?.['props'] || {};
|
|
@@ -5811,23 +5748,26 @@ class ComponentRendererComponent extends NgxRenderableComponentDirective {
|
|
|
5811
5748
|
const hasRootForm = hasProperty(BaseComponentProps.PARENT_FORM);
|
|
5812
5749
|
if (hasRootForm && this.parentForm)
|
|
5813
5750
|
props[BaseComponentProps.PARENT_FORM] = this.parentForm;
|
|
5814
|
-
props['className'] =
|
|
5815
|
-
props['className'] + ' ' + this.className
|
|
5751
|
+
props['className'] = props['className']
|
|
5752
|
+
? props['className'] + ' ' + this.className
|
|
5753
|
+
: this.className || '';
|
|
5816
5754
|
this.vcr.clear();
|
|
5817
5755
|
// const projectable = (this.children?.length && this.projectable);
|
|
5818
5756
|
// const template = projectable ? this.vcr.createEmbeddedView(this.inner as TemplateRef<unknown>, this.injector).rootNodes : [];
|
|
5819
|
-
this.instance = NgxRenderingEngine.createComponent(component, props, this.injector, metadata, this.vcr, []);
|
|
5757
|
+
this.instance = NgxRenderingEngine.createComponent(component, { ...props, ...{ modelId: props?.modelId || this.modelId, pk: props?.pk || this.pk } }, this.injector, metadata, this.vcr, []);
|
|
5820
5758
|
this.subscribeEvents(component);
|
|
5821
5759
|
}
|
|
5822
5760
|
createParentComponent() {
|
|
5823
5761
|
const { component, inputs } = this.parent;
|
|
5824
5762
|
const metadata = reflectComponentType(component);
|
|
5825
|
-
const template = this.projectable
|
|
5763
|
+
const template = this.projectable
|
|
5764
|
+
? this.vcr.createEmbeddedView(this.inner, this.injector).rootNodes
|
|
5765
|
+
: [];
|
|
5826
5766
|
this.instance = NgxRenderingEngine.createComponent(component, inputs, this.injector, metadata, this.vcr, template);
|
|
5827
5767
|
this.subscribeEvents(component);
|
|
5828
5768
|
}
|
|
5829
5769
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ComponentRendererComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
5830
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: ComponentRendererComponent, isStandalone: true, selector: "ngx-decaf-component-renderer", inputs: { tag: "tag", children: "children", projectable: "projectable", parent: "parent" }, host: { properties: { "attr.id": "uid" } }, usesInheritance: true, ngImport: i0, template: "<!-- Keep to avoid id conflicts -->\n\n<ng-template #componentOuter></ng-template>\n\n<ng-template #componentInner>\n @if (parent?.children?.length) {\n @for(child of parent.children; track child) {\n @if (!child.children?.length) {\n <ng-container\n *ngComponentOutlet=\"\n child.component;\n injector: child.injector;\n inputs: child.inputs;\n content:child.content;\n \"\n />\n } @else {\n <ngx-decaf-component-renderer [parent]=\"child\"> </ngx-decaf-component-renderer>\n }\n }\n }\n @if (projectable) {\n @if (children?.length) {\n @for(child of children; track child) {\n @if (child.children?.length) {\n <ng-container\n *ngComponentOutlet=\"\n child.component;\n injector: child.injector;\n inputs: child.inputs;\n content:child.content;\n \"\n />\n } @else {\n <ng-container\n *ngComponentOutlet=\"\n child.component;\n injector: child.injector;\n inputs: child.inputs;\n content:child.content;\n \"\n />\n }\n }\n }\n }\n\n</ng-template>\n\n", styles: [""], dependencies: [{ kind: "component", type: ComponentRendererComponent, selector: "ngx-decaf-component-renderer", inputs: ["tag", "children", "projectable", "parent"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }] }); }
|
|
5770
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: ComponentRendererComponent, isStandalone: true, selector: "ngx-decaf-component-renderer", inputs: { tag: "tag", children: "children", projectable: "projectable", pk: "pk", parent: "parent" }, host: { properties: { "attr.id": "uid" } }, usesInheritance: true, ngImport: i0, template: "<!-- Keep to avoid id conflicts -->\n\n<ng-template #componentOuter></ng-template>\n\n<ng-template #componentInner>\n @if (parent?.children?.length) {\n @for(child of parent.children; track child) {\n @if (!child.children?.length) {\n <ng-container\n *ngComponentOutlet=\"\n child.component;\n injector: child.injector;\n inputs: child.inputs;\n content:child.content;\n \"\n />\n } @else {\n <ngx-decaf-component-renderer [parent]=\"child\"> </ngx-decaf-component-renderer>\n }\n }\n }\n @if (projectable) {\n @if (children?.length) {\n @for(child of children; track child) {\n @if (child.children?.length) {\n <ng-container\n *ngComponentOutlet=\"\n child.component;\n injector: child.injector;\n inputs: child.inputs;\n content:child.content;\n \"\n />\n } @else {\n <ng-container\n *ngComponentOutlet=\"\n child.component;\n injector: child.injector;\n inputs: child.inputs;\n content:child.content;\n \"\n />\n }\n }\n }\n }\n\n</ng-template>\n\n", styles: [""], dependencies: [{ kind: "component", type: ComponentRendererComponent, selector: "ngx-decaf-component-renderer", inputs: ["tag", "children", "projectable", "pk", "parent"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }] }); }
|
|
5831
5771
|
}
|
|
5832
5772
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ComponentRendererComponent, decorators: [{
|
|
5833
5773
|
type: Component,
|
|
@@ -5839,6 +5779,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
5839
5779
|
type: Input
|
|
5840
5780
|
}], projectable: [{
|
|
5841
5781
|
type: Input
|
|
5782
|
+
}], pk: [{
|
|
5783
|
+
type: Input
|
|
5842
5784
|
}], parent: [{
|
|
5843
5785
|
type: Input
|
|
5844
5786
|
}] } });
|
|
@@ -5907,7 +5849,7 @@ class NgxFormFieldDirective extends NgxComponentDirective {
|
|
|
5907
5849
|
this.checked = false;
|
|
5908
5850
|
/**
|
|
5909
5851
|
* @description Flag tracking if validation error event has been dispatched.
|
|
5910
|
-
* @summary
|
|
5852
|
+
* @summary Proverride duplicate validation error override from being dispatched.
|
|
5911
5853
|
* @type {boolean}
|
|
5912
5854
|
* @private
|
|
5913
5855
|
*/
|
|
@@ -5930,7 +5872,7 @@ class NgxFormFieldDirective extends NgxComponentDirective {
|
|
|
5930
5872
|
* @type {function(string, ...string): string}
|
|
5931
5873
|
* @public
|
|
5932
5874
|
*/
|
|
5933
|
-
this.sf = sf;
|
|
5875
|
+
this.sf = sf$1;
|
|
5934
5876
|
/**
|
|
5935
5877
|
* @description Callback function invoked when the field value changes.
|
|
5936
5878
|
* @summary Function registered by Angular's forms system through registerOnChange.
|
|
@@ -6058,8 +6000,9 @@ class NgxFormFieldDirective extends NgxComponentDirective {
|
|
|
6058
6000
|
* @public
|
|
6059
6001
|
*/
|
|
6060
6002
|
async ngOnChanges(changes) {
|
|
6061
|
-
if (!this.initialized)
|
|
6003
|
+
if (!this.initialized) {
|
|
6062
6004
|
await super.ngOnChanges(changes);
|
|
6005
|
+
}
|
|
6063
6006
|
if (changes['activeFormGroupIndex'] &&
|
|
6064
6007
|
this.multiple &&
|
|
6065
6008
|
!changes['activeFormGroupIndex'].isFirstChange() &&
|
|
@@ -6102,7 +6045,7 @@ class NgxFormFieldDirective extends NgxComponentDirective {
|
|
|
6102
6045
|
}
|
|
6103
6046
|
/**
|
|
6104
6047
|
* @description Clears the current form control value as a response to a UI interact
|
|
6105
|
-
* @summary Set field value as undefined and
|
|
6048
|
+
* @summary Set field value as undefined and proverride event propagation.
|
|
6106
6049
|
* @param {Event} event - The value to set
|
|
6107
6050
|
* @return {void}
|
|
6108
6051
|
* @public
|
|
@@ -6113,7 +6056,7 @@ class NgxFormFieldDirective extends NgxComponentDirective {
|
|
|
6113
6056
|
this.setValue(undefined);
|
|
6114
6057
|
}
|
|
6115
6058
|
/**
|
|
6116
|
-
* @description Handles IonSelect change
|
|
6059
|
+
* @description Handles IonSelect change override emitted from modal child components.
|
|
6117
6060
|
* @summary Forces change detection when rendered inside a modal and synchronizes the select value with the directive state.
|
|
6118
6061
|
* @param {SelectCustomEvent<SelectChangeEventDetail>} event - IonSelect change event containing the selected value.
|
|
6119
6062
|
* @return {void}
|
|
@@ -6300,17 +6243,18 @@ class ModelRendererComponent extends NgxRenderableComponentDirective {
|
|
|
6300
6243
|
* @param {string | M} model - The model to be rendered
|
|
6301
6244
|
*/
|
|
6302
6245
|
async render(model) {
|
|
6303
|
-
model = typeof model ===
|
|
6246
|
+
model = typeof model === Primitives.STRING ? Model.build({}, String(model)) : model;
|
|
6304
6247
|
if (model) {
|
|
6305
6248
|
this.output = model.render(this.globals || {}, this.vcr, this.injector, this.inner, this.projectable);
|
|
6306
6249
|
if (this.output?.inputs)
|
|
6307
|
-
this.rendererId = sf(AngularEngineKeys.RENDERED_ID, this.output.inputs[
|
|
6250
|
+
this.rendererId = sf$1(AngularEngineKeys.RENDERED_ID, this.output.inputs['rendererId']);
|
|
6308
6251
|
this.instance = this.output?.component;
|
|
6309
|
-
const { operation
|
|
6252
|
+
const { operation } = this.globals || {};
|
|
6310
6253
|
// const {inputs} = this.output;
|
|
6311
6254
|
// await this.initProps(inputs || {});
|
|
6312
|
-
if (operation)
|
|
6255
|
+
if (operation) {
|
|
6313
6256
|
this.operation = operation;
|
|
6257
|
+
}
|
|
6314
6258
|
this.subscribeEvents();
|
|
6315
6259
|
}
|
|
6316
6260
|
}
|
|
@@ -6319,7 +6263,7 @@ class ModelRendererComponent extends NgxRenderableComponentDirective {
|
|
|
6319
6263
|
}
|
|
6320
6264
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ModelRendererComponent, decorators: [{
|
|
6321
6265
|
type: Component,
|
|
6322
|
-
args: [{ standalone: true, imports: [], selector:
|
|
6266
|
+
args: [{ standalone: true, imports: [], selector: 'ngx-decaf-model-renderer', host: { '[attr.id]': 'uid' }, template: " <!-- Keep to avoid id conflicts -->\n <div class=\"dcf-hidden\" [id]=\"uid\"></div>\n\n <ng-template #componentOuter></ng-template>\n <!-- <ng-template #inner>\n <div class=\"dcf-grid dcf-grid-small dcf-model-renderer-component dcf-child-width-1-1\" [id]=\"rendererId || ''\">\n @for (child of output?.children; track child) {\n @if (child?.children?.length) {\n <ngx-decaf-component-renderer [parent]=\"child\" />\n } @else {\n <ng-container\n #childComponents\n *ngComponentOutlet=\"\n child.component;\n injector: child.injector;\n inputs: child.inputs;\n content:child.content;\n \"\n />\n }\n }\n </div>\n </ng-template> -->\n" }]
|
|
6323
6267
|
}], propDecorators: { projectable: [{
|
|
6324
6268
|
type: Input
|
|
6325
6269
|
}] } });
|
|
@@ -6464,10 +6408,12 @@ class NgxParentComponentDirective extends NgxComponentDirective {
|
|
|
6464
6408
|
}
|
|
6465
6409
|
async initialize(model) {
|
|
6466
6410
|
await super.initialize();
|
|
6467
|
-
if (model)
|
|
6411
|
+
if (model) {
|
|
6468
6412
|
this.model = model;
|
|
6469
|
-
|
|
6413
|
+
}
|
|
6414
|
+
if (this.model && !this.repository) {
|
|
6470
6415
|
this._repository = this.repository;
|
|
6416
|
+
}
|
|
6471
6417
|
}
|
|
6472
6418
|
async ngOnDestroy() {
|
|
6473
6419
|
await super.ngOnDestroy();
|
|
@@ -6724,9 +6670,8 @@ let ModalComponent = class ModalComponent extends NgxParentComponentDirective {
|
|
|
6724
6670
|
* @returns {Promise<void>} - A promise that resolves when initialization is complete.
|
|
6725
6671
|
*/
|
|
6726
6672
|
async ngOnInit() {
|
|
6727
|
-
if (this.inlineContent && typeof this.inlineContent === Primitives.STRING)
|
|
6728
|
-
this.inlineContent = this.domSanitizer.bypassSecurityTrustHtml(this.inlineContent);
|
|
6729
6673
|
await super.initialize();
|
|
6674
|
+
this.parseInlineContent();
|
|
6730
6675
|
}
|
|
6731
6676
|
/**
|
|
6732
6677
|
* @description Initializes the modal with the provided options.
|
|
@@ -6748,6 +6693,14 @@ let ModalComponent = class ModalComponent extends NgxParentComponentDirective {
|
|
|
6748
6693
|
if (['primary', 'secondary', 'tertiary', 'danger', 'medium', 'dark'].includes(this.headerBackground))
|
|
6749
6694
|
this.iconColor = 'light';
|
|
6750
6695
|
}
|
|
6696
|
+
parseInlineContent() {
|
|
6697
|
+
if (this.inlineContent) {
|
|
6698
|
+
if (this.inlineContent instanceof HTMLElement) {
|
|
6699
|
+
this.inlineContent = this.inlineContent.outerHTML;
|
|
6700
|
+
}
|
|
6701
|
+
this.inlineContent = this.domSanitizer.bypassSecurityTrustHtml(this.inlineContent);
|
|
6702
|
+
}
|
|
6703
|
+
}
|
|
6751
6704
|
/**
|
|
6752
6705
|
* @description Creates and presents the modal.
|
|
6753
6706
|
* @summary Initializes the modal with the provided properties and displays it.
|
|
@@ -6767,6 +6720,7 @@ let ModalComponent = class ModalComponent extends NgxParentComponentDirective {
|
|
|
6767
6720
|
* @returns {Promise<void>} - A promise that resolves when the modal is presented.
|
|
6768
6721
|
*/
|
|
6769
6722
|
async present() {
|
|
6723
|
+
this.parseInlineContent();
|
|
6770
6724
|
this.isOpen = true;
|
|
6771
6725
|
this.changeDetectorRef.detectChanges();
|
|
6772
6726
|
}
|
|
@@ -6827,7 +6781,7 @@ let ModalComponent = class ModalComponent extends NgxParentComponentDirective {
|
|
|
6827
6781
|
await modal.dismiss(event?.data || undefined, ActionRoles.confirm);
|
|
6828
6782
|
}
|
|
6829
6783
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6830
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: ModalComponent, isStandalone: true, selector: "ngx-decaf-modal", inputs: { title: "title", isOpen: "isOpen", tag: "tag", options: "options", globals: "globals", inlineContent: "inlineContent", inlineContentPosition: "inlineContentPosition", fullscreen: "fullscreen", expandable: "expandable", lightBox: "lightBox", headerTransparent: "headerTransparent", headerBackground: "headerBackground", showHeader: "showHeader", showCloseButton: "showCloseButton" }, outputs: { willDismissEvent: "willDismissEvent" }, host: { properties: { "attr.id": "uid" } }, viewQueries: [{ propertyName: "modal", first: true, predicate: ["component"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ion-modal\n [id]=\"uid\"\n [class]=\"'dcf-modal-component ' + className\"\n [isOpen]=\"isOpen\"\n (willDismiss)=\"handleWillDismiss($event)\"\n [backdropDismiss]=\"options?.backdropDismiss\"\n [showBackdrop]=\"options?.showBackdrop\"\n [animated]=\"options?.animated\"\n [canDismiss]=\"options?.canDismiss\"\n [class.dcf-fullscreen-modal]=\"fullscreen\"\n [class.dcf-fullscreen-expanded]=\"expanded\"\n [class.dcf-lightbox-modal]=\"lightBox\"\n [class.dcf-modal-no-header]=\"!showHeader\"\n [class.dcf-header-transparent]=\"headerTransparent\"\n [class.dcf-no-title]=\"!title?.length\"\n #component\n>\n <ng-template>\n <ion-header>\n <ion-toolbar [color]=\"headerBackground\">\n @if (title?.length) {\n <ion-title>{{ title | translate }}</ion-title>\n }\n <ion-buttons slot=\"end\">\n @if (expandable && !fullscreen) {\n <ion-button\n fill=\"clear\"\n size=\"small\"\n type=\"button\"\n class=\"dcf-button-expand\"\n (click)=\"handleExpandToggle()\"\n >\n <ngx-decaf-icon\n [color]=\"iconColor\"\n [name]=\"expanded ? 'ti-maximize-off' : 'ti-maximize'\"\n />\n </ion-button>\n }\n @if (showCloseButton) {\n <ion-button size=\"small\" type=\"button\" class=\"dcf-button-close\" (click)=\"cancel()\">\n <ngx-decaf-icon [color]=\"iconColor\" name=\"ti-x\" />\n </ion-button>\n }\n </ion-buttons>\n </ion-toolbar>\n </ion-header>\n\n <ion-content>\n <section class=\"dcf-modal-body\" [class.dcf-has-title]=\"title?.length\">\n @if (!tag && !model && !inlineContent) {\n <div class=\"dcf-loading-container\">\n <ion-spinner name=\"crescent\" color=\"primary\"></ion-spinner>\n </div>\n } @else {\n @if (inlineContent && inlineContentPosition === 'top') {\n <div class=\"dcf-modal-content\" id=\"dcf-modal-content\" [innerHTML]=\"inlineContent\"></div>\n }\n @if (!tag && model) {\n <ngx-decaf-model-renderer\n (onIonChange)=\"handleEvent($event)\"\n (listenEvent)=\"handleEvent($event)\"\n [model]=\"model\"\n [globals]=\"globals\"\n />\n } @else if (tag && globals) {\n <ngx-decaf-component-renderer\n [tag]=\"tag\"\n (onIonChange)=\"handleEvent($event)\"\n (listenEvent)=\"handleEvent($event)\"\n [model]=\"model\"\n [globals]=\"{ props: globals }\"\n />\n }\n @if (inlineContent && inlineContentPosition === 'bottom') {\n <div class=\"dcf-modal-content\" id=\"dcf-modal-content\" [innerHTML]=\"inlineContent\"></div>\n }\n }\n </section>\n </ion-content>\n </ng-template>\n</ion-modal>\n", styles: [".dcf-modal-component{--border-radius: var(--dcf-border-radius)}.dcf-modal-component.dcf-modal-confirm{top:-100px;--max-width: 320px;--max-height: 35vh}.dcf-modal-component.dcf-modal-confirm ::ng-deep .dcf-title{font-weight:500;font-size:1.125rem;line-height:1.75rem;color:var(--dcf-color-gray-8)}.dcf-modal-component.dcf-modal-confirm ::ng-deep .dcf-delete .dcf-title{color:var(--dcf-color-danger)}.dcf-modal-component.dcf-modal-confirm ::ng-deep .dcf-content{font-weight:400;font-size:.935rem;line-height:1.375rem;color:var(--dcf-color-gray-6);margin-top:1rem}.dcf-modal-component.dcf-modal-confirm ::ng-deep .dcf-buttons-grid{position:absolute;bottom:2rem;right:1rem}.dcf-modal-component ::ng-deep form .dcf-buttons-grid{align-content:center!important;justify-content:center;padding-top:1rem}.dcf-modal-component ion-header{box-shadow:none!important;border-bottom:1px solid var(--dcf-color-gray-2)}.dcf-modal-component ion-button.dcf-button-close{--background: var(--dcf-color-light) !important;--border-radius: var(--dcf-border-radius-small) !important}.dcf-modal-component.dcf-modal-no-header ion-header,.dcf-modal-component.dcf-no-title ion-header{box-shadow:none;border-color:transparent!important}@media (max-width: 768px){.dcf-modal-component .dcf-button-expand{display:none!important}}.dcf-modal-component.dcf-modal-select-interface{--min-width: 300px;--max-width: 500px;--max-height: 50%;--border-radius: var(--dcf-border-radius)}.dcf-modal-component.dcf-modal-select-interface .dcf-modal-body{--max-height: 60%;max-height:60%;padding:0px var(--dcf-padding-small)!important}.dcf-modal-component.dcf-modal-expand{--min-height: 50%;--min-width: 75%;--max-width: 100%}.dcf-modal-component.dcf-fullscreen-expanded,.dcf-modal-component.dcf-fullscreen-modal{--height: 100%;--width: 100%;--max-width: 100%;--border-radius: 0}.dcf-modal-component.dcf-fullscreen-expanded.dcf-header-transparent,.dcf-modal-component.dcf-fullscreen-modal.dcf-header-transparent{padding-left:2rem;padding-bottom:2rem;padding-right:1rem}.dcf-modal-component.dcf-fullscreen-expanded:not(.dcf-header-transparent).dcf-no-title ion-header ion-button,.dcf-modal-component.dcf-fullscreen-modal:not(.dcf-header-transparent).dcf-no-title ion-header ion-button{transform:translate(-5px,5px)}.dcf-modal-component.dcf-lightbox-modal ion-content{--background: transparent !important}.dcf-modal-component.dcf-lightbox-modal .dcf-modal-body{display:flex;height:auto;justify-content:center;align-items:center}.dcf-modal-component.dcf-lightbox-modal.dcf-fullscreen-modal{padding:var(--dcf-padding-small)}.dcf-modal-component.dcf-header-transparent ion-header{box-shadow:none!important;border-bottom:none!important}.dcf-modal-component.dcf-header-transparent ion-title{width:calc(100% + 10px);position:relative;top:1.25rem;background:#fff;height:50px!important}.dcf-modal-component.dcf-header-transparent ion-buttons ion-button:not(:last-of-type){position:relative;right:1px}.dcf-modal-component.dcf-header-transparent ion-content[part=background],.dcf-modal-component.dcf-header-transparent ion-content::part(background){border-radius:var(--dcf-border-radius)!important}.dcf-modal-component.dcf-header-transparent .dcf-modal-body.dcf-has-title{padding-top:2rem!important}.dcf-modal-component.dcf-header-transparent,.dcf-modal-component.dcf-lightbox-modal{--background: transparent;--box-shadow: none !important}@media (max-width: 767px){.dcf-modal-component.dcf-header-transparent,.dcf-modal-component.dcf-lightbox-modal{padding:var(--dcf-padding-xsmall)}}.dcf-modal-component.dcf-header-transparent ion-header,.dcf-modal-component.dcf-lightbox-modal ion-header{box-shadow:none!important;border-color:transparent!important;padding:unset!important;margin:unset!important;height:30px}.dcf-modal-component.dcf-header-transparent ion-header ion-buttons,.dcf-modal-component.dcf-lightbox-modal ion-header ion-buttons{background:var(--dcf-color-gray-2)!important;border-radius:var(--dcf-border-radius)!important;box-shadow:var(--dcf-box-shadow)!important}.dcf-modal-component.dcf-header-transparent ion-header ion-button,.dcf-modal-component.dcf-lightbox-modal ion-header ion-button{--background: transparent !important;margin:0!important;width:35px!important;height:25px!important}.dcf-modal-component.dcf-header-transparent ion-header ion-button *,.dcf-modal-component.dcf-lightbox-modal ion-header ion-button *{margin:-5px}.dcf-modal-component.dcf-header-transparent ion-header ion-button ngx-decaf-icon,.dcf-modal-component.dcf-lightbox-modal ion-header ion-button ngx-decaf-icon{transform:translate(-1px)!important}.dcf-modal-component.dcf-header-transparent ion-header ion-button ion-icon,.dcf-modal-component.dcf-lightbox-modal ion-header ion-button ion-icon{font-size:1.15rem!important;color:var(--dcf-color-gray-5)}.dcf-modal-component.dcf-header-transparent ion-header ion-toolbar,.dcf-modal-component.dcf-lightbox-modal ion-header ion-toolbar{--background: transparent !important;padding:unset!important;margin:unset!important}.dcf-modal-component.dcf-header-transparent ion-content,.dcf-modal-component.dcf-lightbox-modal ion-content{max-width:calc(100% - 10px)}.dcf-modal-component.dcf-header-transparent .dcf-modal-body,.dcf-modal-component.dcf-lightbox-modal .dcf-modal-body{background:#fff!important;padding:2px 0 0;border-radius:var(--dcf-border-radius)}.dcf-modal-component.dcf-header-transparent .dcf-modal-body>div,.dcf-modal-component.dcf-lightbox-modal .dcf-modal-body>div{border-radius:var(--dcf-border-radius)!important;max-width:calc(100% - 5px)}.dcf-modal-component:not(.dcf-lightbox-modal) .dcf-modal-body{padding:1.5rem 1rem}.dcf-modal-component .dcf-loading-container{height:50%;display:flex;justify-content:center;align-items:center}.dcf-modal-component .dcf-loading-container ion-spinner{width:60px;height:60px}\n"], dependencies: [{ kind: "component", type: IonModal, selector: "ion-modal" }, { kind: "component", type: ComponentRendererComponent, selector: "ngx-decaf-component-renderer", inputs: ["tag", "children", "projectable", "parent"] }, { kind: "component", type: ModelRendererComponent, selector: "ngx-decaf-model-renderer", inputs: ["projectable"] }, { kind: "component", type: IconComponent, selector: "ngx-decaf-icon", inputs: ["name", "color", "slot", "button", "buttonFill", "buttonShape", "width", "size", "inline"] }, { kind: "component", type: IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
6784
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: ModalComponent, isStandalone: true, selector: "ngx-decaf-modal", inputs: { title: "title", isOpen: "isOpen", tag: "tag", options: "options", globals: "globals", inlineContent: "inlineContent", inlineContentPosition: "inlineContentPosition", fullscreen: "fullscreen", expandable: "expandable", lightBox: "lightBox", headerTransparent: "headerTransparent", headerBackground: "headerBackground", showHeader: "showHeader", showCloseButton: "showCloseButton" }, outputs: { willDismissEvent: "willDismissEvent" }, host: { properties: { "attr.id": "uid" } }, viewQueries: [{ propertyName: "modal", first: true, predicate: ["component"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ion-modal\n [id]=\"uid\"\n [class]=\"'dcf-modal-component ' + className\"\n [isOpen]=\"isOpen\"\n (willDismiss)=\"handleWillDismiss($event)\"\n [backdropDismiss]=\"options?.backdropDismiss\"\n [showBackdrop]=\"options?.showBackdrop\"\n [animated]=\"options?.animated\"\n [canDismiss]=\"options?.canDismiss\"\n [class.dcf-fullscreen-modal]=\"fullscreen\"\n [class.dcf-fullscreen-expanded]=\"expanded\"\n [class.dcf-lightbox-modal]=\"lightBox\"\n [class.dcf-modal-no-header]=\"!showHeader\"\n [class.dcf-header-transparent]=\"headerTransparent\"\n [class.dcf-no-title]=\"!title?.length\"\n #component\n>\n <ng-template>\n <ion-header>\n <ion-toolbar [color]=\"headerBackground\">\n @if (title?.length) {\n <ion-title>{{ title | translate }}</ion-title>\n }\n <ion-buttons slot=\"end\">\n @if (expandable && !fullscreen) {\n <ion-button\n fill=\"clear\"\n size=\"small\"\n type=\"button\"\n class=\"dcf-button-expand\"\n (click)=\"handleExpandToggle()\"\n >\n <ngx-decaf-icon\n [color]=\"iconColor\"\n [name]=\"expanded ? 'ti-maximize-off' : 'ti-maximize'\"\n />\n </ion-button>\n }\n @if (showCloseButton) {\n <ion-button size=\"small\" type=\"button\" class=\"dcf-button-close\" (click)=\"cancel()\">\n <ngx-decaf-icon [color]=\"iconColor\" name=\"ti-x\" />\n </ion-button>\n }\n </ion-buttons>\n </ion-toolbar>\n </ion-header>\n\n <ion-content>\n <section class=\"dcf-modal-body\" [class.dcf-has-title]=\"title?.length\">\n @if (!tag && !model && !inlineContent) {\n <div class=\"dcf-loading-container\">\n <ion-spinner name=\"crescent\" color=\"primary\"></ion-spinner>\n </div>\n } @else {\n @if (inlineContent && inlineContentPosition === 'top') {\n <div class=\"dcf-modal-content\" id=\"dcf-modal-content\" [innerHTML]=\"inlineContent\"></div>\n }\n @if (!tag && model) {\n <ngx-decaf-model-renderer\n (onIonChange)=\"handleEvent($event)\"\n (listenEvent)=\"handleEvent($event)\"\n [model]=\"model\"\n [globals]=\"globals\"\n />\n } @else if (tag && globals) {\n <ngx-decaf-component-renderer\n [tag]=\"tag\"\n (onIonChange)=\"handleEvent($event)\"\n (listenEvent)=\"handleEvent($event)\"\n [model]=\"model\"\n [globals]=\"{ props: globals }\"\n />\n }\n @if (inlineContent && inlineContentPosition === 'bottom') {\n <div class=\"dcf-modal-content\" id=\"dcf-modal-content\" [innerHTML]=\"inlineContent\"></div>\n }\n }\n </section>\n </ion-content>\n </ng-template>\n</ion-modal>\n", styles: [".dcf-modal-component{--border-radius: var(--dcf-border-radius)}.dcf-modal-component.dcf-modal-confirm{top:-100px;--max-width: 320px;--max-height: 35vh}.dcf-modal-component.dcf-modal-confirm ::ng-deep .dcf-title{font-weight:500;font-size:1.125rem;line-height:1.75rem;color:var(--dcf-color-gray-8)}.dcf-modal-component.dcf-modal-confirm ::ng-deep .dcf-delete .dcf-title{color:var(--dcf-color-danger)}.dcf-modal-component.dcf-modal-confirm ::ng-deep .dcf-content{font-weight:400;font-size:.935rem;line-height:1.375rem;color:var(--dcf-color-gray-6);margin-top:1rem}.dcf-modal-component.dcf-modal-confirm ::ng-deep .dcf-buttons-grid{position:absolute;bottom:2rem;right:1rem}.dcf-modal-component ::ng-deep form .dcf-buttons-grid{align-content:center!important;justify-content:center;padding-top:1rem}.dcf-modal-component ion-header{box-shadow:none!important;border-bottom:1px solid var(--dcf-color-gray-2)}.dcf-modal-component ion-button.dcf-button-close{--background: var(--dcf-color-light) !important;--border-radius: var(--dcf-border-radius-small) !important}.dcf-modal-component.dcf-modal-no-header ion-header,.dcf-modal-component.dcf-no-title ion-header{box-shadow:none;border-color:transparent!important}.dcf-modal-component .dcf-modal-content ::ng-deep pre{border:1px solid var(--dcf-color-gray-2);white-space:pre-wrap;overflow-wrap:anywhere;background:rgba(var(--dcf-color-warning-rgb),.175)!important;padding:var(--dcf-padding);border-radius:var(--dcf-border-radius-small);font-size:.9rem!important;font-weight:500;margin-top:2rem}@media (max-width: 768px){.dcf-modal-component .dcf-button-expand{display:none!important}}.dcf-modal-component.dcf-modal-select-interface{--min-width: 300px;--max-width: 500px;--max-height: 50%;--border-radius: var(--dcf-border-radius)}.dcf-modal-component.dcf-modal-select-interface .dcf-modal-body{--max-height: 60%;max-height:60%;padding:0px var(--dcf-padding-small)!important}.dcf-modal-component.dcf-modal-expand{--min-height: 50%;--min-width: 75%;--max-width: 100%}.dcf-modal-component.dcf-fullscreen-expanded,.dcf-modal-component.dcf-fullscreen-modal{--height: 100%;--width: 100%;--max-width: 100%;--border-radius: 0}.dcf-modal-component.dcf-fullscreen-expanded.dcf-header-transparent,.dcf-modal-component.dcf-fullscreen-modal.dcf-header-transparent{padding-left:2rem;padding-bottom:2rem;padding-right:1rem}.dcf-modal-component.dcf-fullscreen-expanded:not(.dcf-header-transparent).dcf-no-title ion-header ion-button,.dcf-modal-component.dcf-fullscreen-modal:not(.dcf-header-transparent).dcf-no-title ion-header ion-button{transform:translate(-5px,5px)}.dcf-modal-component.dcf-lightbox-modal ion-content{--background: transparent !important}.dcf-modal-component.dcf-lightbox-modal .dcf-modal-body{display:flex;height:auto;justify-content:center;align-items:center}.dcf-modal-component.dcf-lightbox-modal.dcf-fullscreen-modal{padding:var(--dcf-padding-small)}.dcf-modal-component.dcf-header-transparent ion-header{box-shadow:none!important;border-bottom:none!important}.dcf-modal-component.dcf-header-transparent ion-title{width:calc(100% + 10px);position:relative;top:1.25rem;background:#fff;height:50px!important}.dcf-modal-component.dcf-header-transparent ion-buttons ion-button:not(:last-of-type){position:relative;right:1px}.dcf-modal-component.dcf-header-transparent ion-content[part=background],.dcf-modal-component.dcf-header-transparent ion-content::part(background){border-radius:var(--dcf-border-radius)!important}.dcf-modal-component.dcf-header-transparent .dcf-modal-body.dcf-has-title{padding-top:2rem!important}.dcf-modal-component.dcf-header-transparent,.dcf-modal-component.dcf-lightbox-modal{--background: transparent;--box-shadow: none !important}@media (max-width: 767px){.dcf-modal-component.dcf-header-transparent,.dcf-modal-component.dcf-lightbox-modal{padding:var(--dcf-padding-xsmall)}}.dcf-modal-component.dcf-header-transparent ion-header,.dcf-modal-component.dcf-lightbox-modal ion-header{box-shadow:none!important;border-color:transparent!important;padding:unset!important;margin:unset!important;height:30px}.dcf-modal-component.dcf-header-transparent ion-header ion-buttons,.dcf-modal-component.dcf-lightbox-modal ion-header ion-buttons{background:var(--dcf-color-gray-2)!important;border-radius:var(--dcf-border-radius)!important;box-shadow:var(--dcf-box-shadow)!important}.dcf-modal-component.dcf-header-transparent ion-header ion-button,.dcf-modal-component.dcf-lightbox-modal ion-header ion-button{--background: transparent !important;margin:0!important;width:35px!important;height:25px!important}.dcf-modal-component.dcf-header-transparent ion-header ion-button *,.dcf-modal-component.dcf-lightbox-modal ion-header ion-button *{margin:-5px}.dcf-modal-component.dcf-header-transparent ion-header ion-button ngx-decaf-icon,.dcf-modal-component.dcf-lightbox-modal ion-header ion-button ngx-decaf-icon{transform:translate(-1px)!important}.dcf-modal-component.dcf-header-transparent ion-header ion-button ion-icon,.dcf-modal-component.dcf-lightbox-modal ion-header ion-button ion-icon{font-size:1.15rem!important;color:var(--dcf-color-gray-5)}.dcf-modal-component.dcf-header-transparent ion-header ion-toolbar,.dcf-modal-component.dcf-lightbox-modal ion-header ion-toolbar{--background: transparent !important;padding:unset!important;margin:unset!important}.dcf-modal-component.dcf-header-transparent ion-content,.dcf-modal-component.dcf-lightbox-modal ion-content{max-width:calc(100% - 10px)}.dcf-modal-component.dcf-header-transparent .dcf-modal-body,.dcf-modal-component.dcf-lightbox-modal .dcf-modal-body{background:#fff!important;padding:2px 0 0;border-radius:var(--dcf-border-radius)}.dcf-modal-component.dcf-header-transparent .dcf-modal-body>div,.dcf-modal-component.dcf-lightbox-modal .dcf-modal-body>div{border-radius:var(--dcf-border-radius)!important;max-width:calc(100% - 5px)}.dcf-modal-component:not(.dcf-lightbox-modal) .dcf-modal-body{padding:1.5rem 1rem}.dcf-modal-component .dcf-loading-container{height:50%;display:flex;justify-content:center;align-items:center}.dcf-modal-component .dcf-loading-container ion-spinner{width:60px;height:60px}\n"], dependencies: [{ kind: "component", type: IonModal, selector: "ion-modal" }, { kind: "component", type: ComponentRendererComponent, selector: "ngx-decaf-component-renderer", inputs: ["tag", "children", "projectable", "pk", "parent"] }, { kind: "component", type: ModelRendererComponent, selector: "ngx-decaf-model-renderer", inputs: ["projectable"] }, { kind: "component", type: IconComponent, selector: "ngx-decaf-icon", inputs: ["name", "color", "slot", "button", "buttonFill", "buttonShape", "width", "size", "inline"] }, { kind: "component", type: IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
6831
6785
|
};
|
|
6832
6786
|
ModalComponent = __decorate([
|
|
6833
6787
|
Dynamic(),
|
|
@@ -6848,7 +6802,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
6848
6802
|
IonHeader,
|
|
6849
6803
|
IonTitle,
|
|
6850
6804
|
IonToolbar,
|
|
6851
|
-
], host: { '[attr.id]': 'uid' }, template: "<ion-modal\n [id]=\"uid\"\n [class]=\"'dcf-modal-component ' + className\"\n [isOpen]=\"isOpen\"\n (willDismiss)=\"handleWillDismiss($event)\"\n [backdropDismiss]=\"options?.backdropDismiss\"\n [showBackdrop]=\"options?.showBackdrop\"\n [animated]=\"options?.animated\"\n [canDismiss]=\"options?.canDismiss\"\n [class.dcf-fullscreen-modal]=\"fullscreen\"\n [class.dcf-fullscreen-expanded]=\"expanded\"\n [class.dcf-lightbox-modal]=\"lightBox\"\n [class.dcf-modal-no-header]=\"!showHeader\"\n [class.dcf-header-transparent]=\"headerTransparent\"\n [class.dcf-no-title]=\"!title?.length\"\n #component\n>\n <ng-template>\n <ion-header>\n <ion-toolbar [color]=\"headerBackground\">\n @if (title?.length) {\n <ion-title>{{ title | translate }}</ion-title>\n }\n <ion-buttons slot=\"end\">\n @if (expandable && !fullscreen) {\n <ion-button\n fill=\"clear\"\n size=\"small\"\n type=\"button\"\n class=\"dcf-button-expand\"\n (click)=\"handleExpandToggle()\"\n >\n <ngx-decaf-icon\n [color]=\"iconColor\"\n [name]=\"expanded ? 'ti-maximize-off' : 'ti-maximize'\"\n />\n </ion-button>\n }\n @if (showCloseButton) {\n <ion-button size=\"small\" type=\"button\" class=\"dcf-button-close\" (click)=\"cancel()\">\n <ngx-decaf-icon [color]=\"iconColor\" name=\"ti-x\" />\n </ion-button>\n }\n </ion-buttons>\n </ion-toolbar>\n </ion-header>\n\n <ion-content>\n <section class=\"dcf-modal-body\" [class.dcf-has-title]=\"title?.length\">\n @if (!tag && !model && !inlineContent) {\n <div class=\"dcf-loading-container\">\n <ion-spinner name=\"crescent\" color=\"primary\"></ion-spinner>\n </div>\n } @else {\n @if (inlineContent && inlineContentPosition === 'top') {\n <div class=\"dcf-modal-content\" id=\"dcf-modal-content\" [innerHTML]=\"inlineContent\"></div>\n }\n @if (!tag && model) {\n <ngx-decaf-model-renderer\n (onIonChange)=\"handleEvent($event)\"\n (listenEvent)=\"handleEvent($event)\"\n [model]=\"model\"\n [globals]=\"globals\"\n />\n } @else if (tag && globals) {\n <ngx-decaf-component-renderer\n [tag]=\"tag\"\n (onIonChange)=\"handleEvent($event)\"\n (listenEvent)=\"handleEvent($event)\"\n [model]=\"model\"\n [globals]=\"{ props: globals }\"\n />\n }\n @if (inlineContent && inlineContentPosition === 'bottom') {\n <div class=\"dcf-modal-content\" id=\"dcf-modal-content\" [innerHTML]=\"inlineContent\"></div>\n }\n }\n </section>\n </ion-content>\n </ng-template>\n</ion-modal>\n", styles: [".dcf-modal-component{--border-radius: var(--dcf-border-radius)}.dcf-modal-component.dcf-modal-confirm{top:-100px;--max-width: 320px;--max-height: 35vh}.dcf-modal-component.dcf-modal-confirm ::ng-deep .dcf-title{font-weight:500;font-size:1.125rem;line-height:1.75rem;color:var(--dcf-color-gray-8)}.dcf-modal-component.dcf-modal-confirm ::ng-deep .dcf-delete .dcf-title{color:var(--dcf-color-danger)}.dcf-modal-component.dcf-modal-confirm ::ng-deep .dcf-content{font-weight:400;font-size:.935rem;line-height:1.375rem;color:var(--dcf-color-gray-6);margin-top:1rem}.dcf-modal-component.dcf-modal-confirm ::ng-deep .dcf-buttons-grid{position:absolute;bottom:2rem;right:1rem}.dcf-modal-component ::ng-deep form .dcf-buttons-grid{align-content:center!important;justify-content:center;padding-top:1rem}.dcf-modal-component ion-header{box-shadow:none!important;border-bottom:1px solid var(--dcf-color-gray-2)}.dcf-modal-component ion-button.dcf-button-close{--background: var(--dcf-color-light) !important;--border-radius: var(--dcf-border-radius-small) !important}.dcf-modal-component.dcf-modal-no-header ion-header,.dcf-modal-component.dcf-no-title ion-header{box-shadow:none;border-color:transparent!important}@media (max-width: 768px){.dcf-modal-component .dcf-button-expand{display:none!important}}.dcf-modal-component.dcf-modal-select-interface{--min-width: 300px;--max-width: 500px;--max-height: 50%;--border-radius: var(--dcf-border-radius)}.dcf-modal-component.dcf-modal-select-interface .dcf-modal-body{--max-height: 60%;max-height:60%;padding:0px var(--dcf-padding-small)!important}.dcf-modal-component.dcf-modal-expand{--min-height: 50%;--min-width: 75%;--max-width: 100%}.dcf-modal-component.dcf-fullscreen-expanded,.dcf-modal-component.dcf-fullscreen-modal{--height: 100%;--width: 100%;--max-width: 100%;--border-radius: 0}.dcf-modal-component.dcf-fullscreen-expanded.dcf-header-transparent,.dcf-modal-component.dcf-fullscreen-modal.dcf-header-transparent{padding-left:2rem;padding-bottom:2rem;padding-right:1rem}.dcf-modal-component.dcf-fullscreen-expanded:not(.dcf-header-transparent).dcf-no-title ion-header ion-button,.dcf-modal-component.dcf-fullscreen-modal:not(.dcf-header-transparent).dcf-no-title ion-header ion-button{transform:translate(-5px,5px)}.dcf-modal-component.dcf-lightbox-modal ion-content{--background: transparent !important}.dcf-modal-component.dcf-lightbox-modal .dcf-modal-body{display:flex;height:auto;justify-content:center;align-items:center}.dcf-modal-component.dcf-lightbox-modal.dcf-fullscreen-modal{padding:var(--dcf-padding-small)}.dcf-modal-component.dcf-header-transparent ion-header{box-shadow:none!important;border-bottom:none!important}.dcf-modal-component.dcf-header-transparent ion-title{width:calc(100% + 10px);position:relative;top:1.25rem;background:#fff;height:50px!important}.dcf-modal-component.dcf-header-transparent ion-buttons ion-button:not(:last-of-type){position:relative;right:1px}.dcf-modal-component.dcf-header-transparent ion-content[part=background],.dcf-modal-component.dcf-header-transparent ion-content::part(background){border-radius:var(--dcf-border-radius)!important}.dcf-modal-component.dcf-header-transparent .dcf-modal-body.dcf-has-title{padding-top:2rem!important}.dcf-modal-component.dcf-header-transparent,.dcf-modal-component.dcf-lightbox-modal{--background: transparent;--box-shadow: none !important}@media (max-width: 767px){.dcf-modal-component.dcf-header-transparent,.dcf-modal-component.dcf-lightbox-modal{padding:var(--dcf-padding-xsmall)}}.dcf-modal-component.dcf-header-transparent ion-header,.dcf-modal-component.dcf-lightbox-modal ion-header{box-shadow:none!important;border-color:transparent!important;padding:unset!important;margin:unset!important;height:30px}.dcf-modal-component.dcf-header-transparent ion-header ion-buttons,.dcf-modal-component.dcf-lightbox-modal ion-header ion-buttons{background:var(--dcf-color-gray-2)!important;border-radius:var(--dcf-border-radius)!important;box-shadow:var(--dcf-box-shadow)!important}.dcf-modal-component.dcf-header-transparent ion-header ion-button,.dcf-modal-component.dcf-lightbox-modal ion-header ion-button{--background: transparent !important;margin:0!important;width:35px!important;height:25px!important}.dcf-modal-component.dcf-header-transparent ion-header ion-button *,.dcf-modal-component.dcf-lightbox-modal ion-header ion-button *{margin:-5px}.dcf-modal-component.dcf-header-transparent ion-header ion-button ngx-decaf-icon,.dcf-modal-component.dcf-lightbox-modal ion-header ion-button ngx-decaf-icon{transform:translate(-1px)!important}.dcf-modal-component.dcf-header-transparent ion-header ion-button ion-icon,.dcf-modal-component.dcf-lightbox-modal ion-header ion-button ion-icon{font-size:1.15rem!important;color:var(--dcf-color-gray-5)}.dcf-modal-component.dcf-header-transparent ion-header ion-toolbar,.dcf-modal-component.dcf-lightbox-modal ion-header ion-toolbar{--background: transparent !important;padding:unset!important;margin:unset!important}.dcf-modal-component.dcf-header-transparent ion-content,.dcf-modal-component.dcf-lightbox-modal ion-content{max-width:calc(100% - 10px)}.dcf-modal-component.dcf-header-transparent .dcf-modal-body,.dcf-modal-component.dcf-lightbox-modal .dcf-modal-body{background:#fff!important;padding:2px 0 0;border-radius:var(--dcf-border-radius)}.dcf-modal-component.dcf-header-transparent .dcf-modal-body>div,.dcf-modal-component.dcf-lightbox-modal .dcf-modal-body>div{border-radius:var(--dcf-border-radius)!important;max-width:calc(100% - 5px)}.dcf-modal-component:not(.dcf-lightbox-modal) .dcf-modal-body{padding:1.5rem 1rem}.dcf-modal-component .dcf-loading-container{height:50%;display:flex;justify-content:center;align-items:center}.dcf-modal-component .dcf-loading-container ion-spinner{width:60px;height:60px}\n"] }]
|
|
6805
|
+
], host: { '[attr.id]': 'uid' }, template: "<ion-modal\n [id]=\"uid\"\n [class]=\"'dcf-modal-component ' + className\"\n [isOpen]=\"isOpen\"\n (willDismiss)=\"handleWillDismiss($event)\"\n [backdropDismiss]=\"options?.backdropDismiss\"\n [showBackdrop]=\"options?.showBackdrop\"\n [animated]=\"options?.animated\"\n [canDismiss]=\"options?.canDismiss\"\n [class.dcf-fullscreen-modal]=\"fullscreen\"\n [class.dcf-fullscreen-expanded]=\"expanded\"\n [class.dcf-lightbox-modal]=\"lightBox\"\n [class.dcf-modal-no-header]=\"!showHeader\"\n [class.dcf-header-transparent]=\"headerTransparent\"\n [class.dcf-no-title]=\"!title?.length\"\n #component\n>\n <ng-template>\n <ion-header>\n <ion-toolbar [color]=\"headerBackground\">\n @if (title?.length) {\n <ion-title>{{ title | translate }}</ion-title>\n }\n <ion-buttons slot=\"end\">\n @if (expandable && !fullscreen) {\n <ion-button\n fill=\"clear\"\n size=\"small\"\n type=\"button\"\n class=\"dcf-button-expand\"\n (click)=\"handleExpandToggle()\"\n >\n <ngx-decaf-icon\n [color]=\"iconColor\"\n [name]=\"expanded ? 'ti-maximize-off' : 'ti-maximize'\"\n />\n </ion-button>\n }\n @if (showCloseButton) {\n <ion-button size=\"small\" type=\"button\" class=\"dcf-button-close\" (click)=\"cancel()\">\n <ngx-decaf-icon [color]=\"iconColor\" name=\"ti-x\" />\n </ion-button>\n }\n </ion-buttons>\n </ion-toolbar>\n </ion-header>\n\n <ion-content>\n <section class=\"dcf-modal-body\" [class.dcf-has-title]=\"title?.length\">\n @if (!tag && !model && !inlineContent) {\n <div class=\"dcf-loading-container\">\n <ion-spinner name=\"crescent\" color=\"primary\"></ion-spinner>\n </div>\n } @else {\n @if (inlineContent && inlineContentPosition === 'top') {\n <div class=\"dcf-modal-content\" id=\"dcf-modal-content\" [innerHTML]=\"inlineContent\"></div>\n }\n @if (!tag && model) {\n <ngx-decaf-model-renderer\n (onIonChange)=\"handleEvent($event)\"\n (listenEvent)=\"handleEvent($event)\"\n [model]=\"model\"\n [globals]=\"globals\"\n />\n } @else if (tag && globals) {\n <ngx-decaf-component-renderer\n [tag]=\"tag\"\n (onIonChange)=\"handleEvent($event)\"\n (listenEvent)=\"handleEvent($event)\"\n [model]=\"model\"\n [globals]=\"{ props: globals }\"\n />\n }\n @if (inlineContent && inlineContentPosition === 'bottom') {\n <div class=\"dcf-modal-content\" id=\"dcf-modal-content\" [innerHTML]=\"inlineContent\"></div>\n }\n }\n </section>\n </ion-content>\n </ng-template>\n</ion-modal>\n", styles: [".dcf-modal-component{--border-radius: var(--dcf-border-radius)}.dcf-modal-component.dcf-modal-confirm{top:-100px;--max-width: 320px;--max-height: 35vh}.dcf-modal-component.dcf-modal-confirm ::ng-deep .dcf-title{font-weight:500;font-size:1.125rem;line-height:1.75rem;color:var(--dcf-color-gray-8)}.dcf-modal-component.dcf-modal-confirm ::ng-deep .dcf-delete .dcf-title{color:var(--dcf-color-danger)}.dcf-modal-component.dcf-modal-confirm ::ng-deep .dcf-content{font-weight:400;font-size:.935rem;line-height:1.375rem;color:var(--dcf-color-gray-6);margin-top:1rem}.dcf-modal-component.dcf-modal-confirm ::ng-deep .dcf-buttons-grid{position:absolute;bottom:2rem;right:1rem}.dcf-modal-component ::ng-deep form .dcf-buttons-grid{align-content:center!important;justify-content:center;padding-top:1rem}.dcf-modal-component ion-header{box-shadow:none!important;border-bottom:1px solid var(--dcf-color-gray-2)}.dcf-modal-component ion-button.dcf-button-close{--background: var(--dcf-color-light) !important;--border-radius: var(--dcf-border-radius-small) !important}.dcf-modal-component.dcf-modal-no-header ion-header,.dcf-modal-component.dcf-no-title ion-header{box-shadow:none;border-color:transparent!important}.dcf-modal-component .dcf-modal-content ::ng-deep pre{border:1px solid var(--dcf-color-gray-2);white-space:pre-wrap;overflow-wrap:anywhere;background:rgba(var(--dcf-color-warning-rgb),.175)!important;padding:var(--dcf-padding);border-radius:var(--dcf-border-radius-small);font-size:.9rem!important;font-weight:500;margin-top:2rem}@media (max-width: 768px){.dcf-modal-component .dcf-button-expand{display:none!important}}.dcf-modal-component.dcf-modal-select-interface{--min-width: 300px;--max-width: 500px;--max-height: 50%;--border-radius: var(--dcf-border-radius)}.dcf-modal-component.dcf-modal-select-interface .dcf-modal-body{--max-height: 60%;max-height:60%;padding:0px var(--dcf-padding-small)!important}.dcf-modal-component.dcf-modal-expand{--min-height: 50%;--min-width: 75%;--max-width: 100%}.dcf-modal-component.dcf-fullscreen-expanded,.dcf-modal-component.dcf-fullscreen-modal{--height: 100%;--width: 100%;--max-width: 100%;--border-radius: 0}.dcf-modal-component.dcf-fullscreen-expanded.dcf-header-transparent,.dcf-modal-component.dcf-fullscreen-modal.dcf-header-transparent{padding-left:2rem;padding-bottom:2rem;padding-right:1rem}.dcf-modal-component.dcf-fullscreen-expanded:not(.dcf-header-transparent).dcf-no-title ion-header ion-button,.dcf-modal-component.dcf-fullscreen-modal:not(.dcf-header-transparent).dcf-no-title ion-header ion-button{transform:translate(-5px,5px)}.dcf-modal-component.dcf-lightbox-modal ion-content{--background: transparent !important}.dcf-modal-component.dcf-lightbox-modal .dcf-modal-body{display:flex;height:auto;justify-content:center;align-items:center}.dcf-modal-component.dcf-lightbox-modal.dcf-fullscreen-modal{padding:var(--dcf-padding-small)}.dcf-modal-component.dcf-header-transparent ion-header{box-shadow:none!important;border-bottom:none!important}.dcf-modal-component.dcf-header-transparent ion-title{width:calc(100% + 10px);position:relative;top:1.25rem;background:#fff;height:50px!important}.dcf-modal-component.dcf-header-transparent ion-buttons ion-button:not(:last-of-type){position:relative;right:1px}.dcf-modal-component.dcf-header-transparent ion-content[part=background],.dcf-modal-component.dcf-header-transparent ion-content::part(background){border-radius:var(--dcf-border-radius)!important}.dcf-modal-component.dcf-header-transparent .dcf-modal-body.dcf-has-title{padding-top:2rem!important}.dcf-modal-component.dcf-header-transparent,.dcf-modal-component.dcf-lightbox-modal{--background: transparent;--box-shadow: none !important}@media (max-width: 767px){.dcf-modal-component.dcf-header-transparent,.dcf-modal-component.dcf-lightbox-modal{padding:var(--dcf-padding-xsmall)}}.dcf-modal-component.dcf-header-transparent ion-header,.dcf-modal-component.dcf-lightbox-modal ion-header{box-shadow:none!important;border-color:transparent!important;padding:unset!important;margin:unset!important;height:30px}.dcf-modal-component.dcf-header-transparent ion-header ion-buttons,.dcf-modal-component.dcf-lightbox-modal ion-header ion-buttons{background:var(--dcf-color-gray-2)!important;border-radius:var(--dcf-border-radius)!important;box-shadow:var(--dcf-box-shadow)!important}.dcf-modal-component.dcf-header-transparent ion-header ion-button,.dcf-modal-component.dcf-lightbox-modal ion-header ion-button{--background: transparent !important;margin:0!important;width:35px!important;height:25px!important}.dcf-modal-component.dcf-header-transparent ion-header ion-button *,.dcf-modal-component.dcf-lightbox-modal ion-header ion-button *{margin:-5px}.dcf-modal-component.dcf-header-transparent ion-header ion-button ngx-decaf-icon,.dcf-modal-component.dcf-lightbox-modal ion-header ion-button ngx-decaf-icon{transform:translate(-1px)!important}.dcf-modal-component.dcf-header-transparent ion-header ion-button ion-icon,.dcf-modal-component.dcf-lightbox-modal ion-header ion-button ion-icon{font-size:1.15rem!important;color:var(--dcf-color-gray-5)}.dcf-modal-component.dcf-header-transparent ion-header ion-toolbar,.dcf-modal-component.dcf-lightbox-modal ion-header ion-toolbar{--background: transparent !important;padding:unset!important;margin:unset!important}.dcf-modal-component.dcf-header-transparent ion-content,.dcf-modal-component.dcf-lightbox-modal ion-content{max-width:calc(100% - 10px)}.dcf-modal-component.dcf-header-transparent .dcf-modal-body,.dcf-modal-component.dcf-lightbox-modal .dcf-modal-body{background:#fff!important;padding:2px 0 0;border-radius:var(--dcf-border-radius)}.dcf-modal-component.dcf-header-transparent .dcf-modal-body>div,.dcf-modal-component.dcf-lightbox-modal .dcf-modal-body>div{border-radius:var(--dcf-border-radius)!important;max-width:calc(100% - 5px)}.dcf-modal-component:not(.dcf-lightbox-modal) .dcf-modal-body{padding:1.5rem 1rem}.dcf-modal-component .dcf-loading-container{height:50%;display:flex;justify-content:center;align-items:center}.dcf-modal-component .dcf-loading-container ion-spinner{width:60px;height:60px}\n"] }]
|
|
6852
6806
|
}], ctorParameters: () => [], propDecorators: { modal: [{
|
|
6853
6807
|
type: ViewChild,
|
|
6854
6808
|
args: ['component']
|
|
@@ -6893,7 +6847,6 @@ let ModalConfirmComponent = class ModalConfirmComponent extends ModalComponent {
|
|
|
6893
6847
|
});
|
|
6894
6848
|
this.translatable = false;
|
|
6895
6849
|
}
|
|
6896
|
-
console.log(this.title);
|
|
6897
6850
|
if (!this.message) {
|
|
6898
6851
|
this.message = await this.translate(`${this.locale}.confirm.operations.${role}.message`, {
|
|
6899
6852
|
'0': uid,
|
|
@@ -7006,7 +6959,7 @@ async function getNgxInlineModal(inlineContent, props = {}, injector) {
|
|
|
7006
6959
|
props,
|
|
7007
6960
|
...{
|
|
7008
6961
|
inlineContent: inlineContent ?? '<div></div>',
|
|
7009
|
-
className: `${props?.className ?? ''} dcf-modal
|
|
6962
|
+
className: `${props?.className ?? ''} dcf-modal`,
|
|
7010
6963
|
},
|
|
7011
6964
|
}, {}, injector || undefined);
|
|
7012
6965
|
}
|
|
@@ -7287,6 +7240,19 @@ let CrudFieldComponent = class CrudFieldComponent extends NgxFormFieldDirective
|
|
|
7287
7240
|
}
|
|
7288
7241
|
await super.initialize();
|
|
7289
7242
|
}
|
|
7243
|
+
/**
|
|
7244
|
+
* @description Component after view initialization lifecycle method.
|
|
7245
|
+
* @summary Calls the parent afterViewInit method for READ and DELETE operations.
|
|
7246
|
+
* This ensures proper initialization of read-only fields that don't require
|
|
7247
|
+
* form functionality but still need view setup.
|
|
7248
|
+
*
|
|
7249
|
+
* @returns {Promise<void>}
|
|
7250
|
+
* @memberOf CrudFieldComponent
|
|
7251
|
+
*/
|
|
7252
|
+
async ngAfterViewInit() {
|
|
7253
|
+
if (this.type === HTML5InputTypes.RADIO && !this.value)
|
|
7254
|
+
this.setValue(this.options[0].value); // TODO: migrate to RenderingEngine
|
|
7255
|
+
}
|
|
7290
7256
|
/**
|
|
7291
7257
|
* Returns a list of options for select or radio inputs, with their `text` property
|
|
7292
7258
|
* localized if it does not already include the word 'options'. The localization key
|
|
@@ -7382,19 +7348,6 @@ let CrudFieldComponent = class CrudFieldComponent extends NgxFormFieldDirective
|
|
|
7382
7348
|
}
|
|
7383
7349
|
}
|
|
7384
7350
|
}
|
|
7385
|
-
/**
|
|
7386
|
-
* @description Component after view initialization lifecycle method.
|
|
7387
|
-
* @summary Calls the parent afterViewInit method for READ and DELETE operations.
|
|
7388
|
-
* This ensures proper initialization of read-only fields that don't require
|
|
7389
|
-
* form functionality but still need view setup.
|
|
7390
|
-
*
|
|
7391
|
-
* @returns {Promise<void>}
|
|
7392
|
-
* @memberOf CrudFieldComponent
|
|
7393
|
-
*/
|
|
7394
|
-
async ngAfterViewInit() {
|
|
7395
|
-
if (this.type === HTML5InputTypes.RADIO && !this.value)
|
|
7396
|
-
this.setValue(this.options[0].value); // TODO: migrate to RenderingEngine
|
|
7397
|
-
}
|
|
7398
7351
|
/**
|
|
7399
7352
|
* @description Component cleanup lifecycle method.
|
|
7400
7353
|
* @summary Performs cleanup operations for READ and DELETE operations by calling
|
|
@@ -7556,6 +7509,16 @@ class NgxFormDirective extends NgxParentComponentDirective {
|
|
|
7556
7509
|
constructor() {
|
|
7557
7510
|
super(...arguments);
|
|
7558
7511
|
this.deepMerge = false;
|
|
7512
|
+
this.path = '';
|
|
7513
|
+
/**
|
|
7514
|
+
* @description Enables multiple item management within the fieldset.
|
|
7515
|
+
* @summary Boolean flag that determines if the fieldset supports adding multiple values.
|
|
7516
|
+
* When true, displays a reorderable list of items with add/remove functionality.
|
|
7517
|
+
*
|
|
7518
|
+
* @type {boolean}
|
|
7519
|
+
* @default false
|
|
7520
|
+
*/
|
|
7521
|
+
this.multiple = false;
|
|
7559
7522
|
/**
|
|
7560
7523
|
* @description Field update trigger mode for form validation.
|
|
7561
7524
|
* @summary Determines when form field validation should be triggered. Options include
|
|
@@ -7676,6 +7639,15 @@ class NgxFormDirective extends NgxParentComponentDirective {
|
|
|
7676
7639
|
this.formGroup = undefined;
|
|
7677
7640
|
}
|
|
7678
7641
|
}
|
|
7642
|
+
async ngOnChanges(changes) {
|
|
7643
|
+
await super.ngOnChanges(changes);
|
|
7644
|
+
// if (changes[BaseComponentProps.MODEL_ID]) {
|
|
7645
|
+
// const { previousValue, currentValue } = changes[BaseComponentProps.MODEL_ID];
|
|
7646
|
+
// if (!previousValue && currentValue) {
|
|
7647
|
+
// await this.refresh(this.operation);
|
|
7648
|
+
// }
|
|
7649
|
+
// }
|
|
7650
|
+
}
|
|
7679
7651
|
async ngAfterViewInit() {
|
|
7680
7652
|
//TODO: ver se isso é necessário
|
|
7681
7653
|
// if (this.formGroup)
|
|
@@ -7812,7 +7784,7 @@ class NgxFormDirective extends NgxParentComponentDirective {
|
|
|
7812
7784
|
return undefined;
|
|
7813
7785
|
}
|
|
7814
7786
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NgxFormDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
7815
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.16", type: NgxFormDirective, isStandalone: true, inputs: { parentFormId: "parentFormId", deepMerge: "deepMerge", updateOn: "updateOn", target: "target", method: "method", options: "options", action: "action", operation: "operation", handlers: "handlers", rendererId: "rendererId", allowClear: "allowClear", match: "match" }, outputs: { submitEvent: "submitEvent", formGroupLoadedEvent: "formGroupLoadedEvent" }, viewQueries: [{ propertyName: "component", first: true, predicate: ["component"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0 }); }
|
|
7787
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.16", type: NgxFormDirective, isStandalone: true, inputs: { parentFormId: "parentFormId", deepMerge: "deepMerge", path: "path", multiple: "multiple", updateOn: "updateOn", target: "target", method: "method", options: "options", action: "action", operation: "operation", handlers: "handlers", rendererId: "rendererId", allowClear: "allowClear", match: "match" }, outputs: { submitEvent: "submitEvent", formGroupLoadedEvent: "formGroupLoadedEvent" }, viewQueries: [{ propertyName: "component", first: true, predicate: ["component"], descendants: true, read: ElementRef }], usesInheritance: true, usesOnChanges: true, ngImport: i0 }); }
|
|
7816
7788
|
}
|
|
7817
7789
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NgxFormDirective, decorators: [{
|
|
7818
7790
|
type: Directive
|
|
@@ -7820,6 +7792,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
7820
7792
|
type: Input
|
|
7821
7793
|
}], deepMerge: [{
|
|
7822
7794
|
type: Input
|
|
7795
|
+
}], path: [{
|
|
7796
|
+
type: Input
|
|
7797
|
+
}], multiple: [{
|
|
7798
|
+
type: Input
|
|
7823
7799
|
}], component: [{
|
|
7824
7800
|
type: ViewChild,
|
|
7825
7801
|
args: ['component', { static: false, read: ElementRef }]
|
|
@@ -8230,7 +8206,8 @@ let LayoutComponent = class LayoutComponent extends NgxParentComponentDirective
|
|
|
8230
8206
|
* @memberOf LayoutComponent
|
|
8231
8207
|
*/
|
|
8232
8208
|
async ngOnInit() {
|
|
8233
|
-
|
|
8209
|
+
// must always parse props first, parse children case of layout depends on it
|
|
8210
|
+
super.parseProps(this, !this.children.length ? [] : ['children']);
|
|
8234
8211
|
if (this.breakpoint)
|
|
8235
8212
|
this.breakpoint =
|
|
8236
8213
|
`${this.breakpoint.startsWith('x') ? this.breakpoint.substring(0, 2) : this.breakpoint.substring(0, 1)}`.toLowerCase();
|
|
@@ -8239,7 +8216,7 @@ let LayoutComponent = class LayoutComponent extends NgxParentComponentDirective
|
|
|
8239
8216
|
await super.initialize();
|
|
8240
8217
|
}
|
|
8241
8218
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8242
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: LayoutComponent, isStandalone: true, selector: "ngx-decaf-layout", inputs: { gap: "gap", grid: "grid", flexMode: "flexMode", rowCard: "rowCard", maxColsLength: "maxColsLength" }, usesInheritance: true, ngImport: i0, template: "<section class=\"dcf-layout-container\">\n @if (initialized) {\n @for (row of rows; track trackItemFn($index, row); let rowIndex = $index) {\n @if (row?.cols?.length) {\n <div\n [id]=\"uid\"\n [class]=\"\n (!grid ? 'dcf-layout-row ' : 'dcf-layout-row dcf-grid ' + 'dcf-grid-' + gap) +\n ' ' +\n (className || '')\n \"\n [class.dcf-grid-match]=\"match\"\n [class.dcf-grid-bordered]=\"borders\"\n >\n @if (row?.title?.length) {\n <div class=\"dcf-width-1-1 dcf-grid-title\">\n <h3 class=\"\">{{ row.title | translate }}</h3>\n </div>\n }\n @for (child of row.cols; track trackItemFn($index, child.col); let colIndex = $index) {\n <div\n [class]=\"'dcf-grid-col ' + child.colClass\"\n [class.dcf-first-column]=\"$index === 0\"\n [class.dcf-hidden]=\"child.props?.hidden?.includes(operation)\"\n >\n <div>\n @if (child.tag === 'ngx-decaf-crud-form') {\n <ngx-decaf-card\n [className]=\"(match ? 'dcf-height-1-1 dcf-card-layout' : '') + className\"\n [body]=\"cardBody\"\n [type]=\"cardType\"\n >\n <ngx-decaf-model-renderer\n [model]=\"child.props.name\"\n (listenEvent)=\"handleEvent($event)\"\n />\n </ngx-decaf-card>\n } @else {\n <ngx-decaf-component-renderer\n [tag]=\"child.tag\"\n [className]=\"(match ? 'dcf-height-1-1 dcf-card-layout' : '') + className\"\n [parentForm]=\"parentForm || child.parentForm || child?.formGroup\"\n [children]=\"child?.children || []\"\n (listenEvent)=\"handleEvent($event)\"\n [globals]=\"{ props: child.props }\"\n />\n }\n </div>\n </div>\n }\n </div>\n }\n }\n }\n</section>\n", styles: [".dcf-grid:first-of-type .dcf-grid .dcf-first-column{padding-top:.25rem!important}.dcf-grid:first-of-type .dcf-grid .dcf-first-column+div{padding-top:.5rem!important}.dcf-grid:first-of-type .dcf-grid .dcf-first-column+div~div{padding-top:.25rem!important}.dcf-grid.dcf-grid-collapse.read>div{margin:var(--dcf-margin-small) 0!important}.dcf-grid.dcf-grid-bordered>div>div{padding:var(--dcf-padding-small) var(--dcf-padding);border-radius:var(--dcf-border-radius-small);border:1px solid var(--dcf-color-gray-2);background:var(--dcf-card-background)!important}.dcf-grid .dcf-grid-title{padding:unset;margin:unset}.dcf-grid .dcf-grid-title>*{padding:unset;margin:unset;padding-left:var(--dcf-padding-small);font-size:1.05rem!important;font-weight:600;background:none;box-shadow:none;display:flex;align-items:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.dcf-grid.dcf-grid-match ::ng-deep ngx-decaf-component-renderer>*>*{height:100%!important}.dcf-grid.dcf-grid-small.dcf-grid-nested{padding:0 .5rem!important}.dcf-grid.dcf-grid-small>div{margin-bottom:1.75rem}.dcf-grid.dcf-grid-small>div:last-child{margin-bottom:0}.dcf-grid.dcf-grid-small>div.dcf-layout-separator{margin-bottom:1rem}.dcf-grid.dcf-grid-small>div.dcf-grid-bordered:last-child{margin-bottom:0}.dcf-grid.dcf-grid-small+.dcf-grid-small{margin-bottom:1.75rem}.dcf-grid.dcf-grid-small+.dcf-grid-small.dcf-layout-separator{margin-bottom:1rem}::ng-deep ngx-decaf-component-renderer>*>div{margin-bottom:0!important}\n"], dependencies: [{ kind: "component", type: CardComponent, selector: "ngx-decaf-card", inputs: ["type", "title", "body", "subtitle", "color", "separator", "borders", "inlineContent", "inlineContentPosition"] }, { kind: "component", type: ModelRendererComponent, selector: "ngx-decaf-model-renderer", inputs: ["projectable"] }, { kind: "component", type: ComponentRendererComponent, selector: "ngx-decaf-component-renderer", inputs: ["tag", "children", "projectable", "parent"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
8219
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: LayoutComponent, isStandalone: true, selector: "ngx-decaf-layout", inputs: { gap: "gap", grid: "grid", flexMode: "flexMode", rowCard: "rowCard", maxColsLength: "maxColsLength" }, usesInheritance: true, ngImport: i0, template: "<section class=\"dcf-layout-container\">\n @if (initialized) {\n @for (row of rows; track trackItemFn($index, row); let rowIndex = $index) {\n @if (row?.cols?.length) {\n <div\n [id]=\"uid\"\n [class]=\"\n (!grid ? 'dcf-layout-row ' : 'dcf-layout-row dcf-grid ' + 'dcf-grid-' + gap) +\n ' ' +\n (className || '')\n \"\n [class.dcf-grid-match]=\"match\"\n [class.dcf-grid-bordered]=\"borders\"\n >\n @if (row?.title?.length) {\n <div class=\"dcf-width-1-1 dcf-grid-title\">\n <h3 class=\"\">{{ row.title | translate }}</h3>\n </div>\n }\n @for (child of row.cols; track trackItemFn($index, child.col); let colIndex = $index) {\n <div\n [class]=\"'dcf-grid-col ' + child.colClass\"\n [class.dcf-first-column]=\"$index === 0\"\n [class.dcf-hidden]=\"child.props?.hidden?.includes(operation)\"\n >\n <div>\n @if (child.tag === 'ngx-decaf-crud-form') {\n <ngx-decaf-card\n [className]=\"(match ? 'dcf-height-1-1 dcf-card-layout' : '') + className\"\n [body]=\"cardBody\"\n [type]=\"cardType\"\n >\n <ngx-decaf-model-renderer\n [model]=\"child.props.name\"\n [pk]=\"pk\"\n (listenEvent)=\"handleEvent($event)\"\n />\n </ngx-decaf-card>\n } @else {\n <ngx-decaf-component-renderer\n [tag]=\"child.tag\"\n [pk]=\"pk\"\n [className]=\"(match ? 'dcf-height-1-1 dcf-card-layout' : '') + className\"\n [parentForm]=\"parentForm || child.parentForm || child?.formGroup\"\n [children]=\"child?.children || []\"\n (listenEvent)=\"handleEvent($event)\"\n [globals]=\"{ props: child.props }\"\n />\n }\n </div>\n </div>\n }\n </div>\n }\n }\n }\n</section>\n", styles: [".dcf-grid:first-of-type .dcf-grid .dcf-first-column{padding-top:.25rem!important}.dcf-grid:first-of-type .dcf-grid .dcf-first-column+div{padding-top:.5rem!important}.dcf-grid:first-of-type .dcf-grid .dcf-first-column+div~div{padding-top:.25rem!important}.dcf-grid.dcf-grid-collapse.read>div{margin:var(--dcf-margin-small) 0!important}.dcf-grid.dcf-grid-bordered>div>div{padding:var(--dcf-padding-small) var(--dcf-padding);border-radius:var(--dcf-border-radius-small);border:1px solid var(--dcf-color-gray-2);background:var(--dcf-card-background)!important}.dcf-grid .dcf-grid-title{padding:unset;margin:unset}.dcf-grid .dcf-grid-title>*{padding:unset;margin:unset;padding-left:var(--dcf-padding-small);font-size:1.05rem!important;font-weight:600;background:none;box-shadow:none;display:flex;align-items:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.dcf-grid.dcf-grid-match ::ng-deep ngx-decaf-component-renderer>*>*{height:100%!important}.dcf-grid.dcf-grid-small.dcf-grid-nested{padding:0 .5rem!important}.dcf-grid.dcf-grid-small>div{margin-bottom:1.75rem}.dcf-grid.dcf-grid-small>div:last-child{margin-bottom:0}.dcf-grid.dcf-grid-small>div.dcf-layout-separator{margin-bottom:1rem}.dcf-grid.dcf-grid-small>div.dcf-grid-bordered:last-child{margin-bottom:0}.dcf-grid.dcf-grid-small+.dcf-grid-small{margin-bottom:1.75rem}.dcf-grid.dcf-grid-small+.dcf-grid-small.dcf-layout-separator{margin-bottom:1rem}::ng-deep ngx-decaf-component-renderer>*>div{margin-bottom:0!important}\n"], dependencies: [{ kind: "component", type: CardComponent, selector: "ngx-decaf-card", inputs: ["type", "title", "body", "subtitle", "color", "separator", "borders", "inlineContent", "inlineContentPosition"] }, { kind: "component", type: ModelRendererComponent, selector: "ngx-decaf-model-renderer", inputs: ["projectable"] }, { kind: "component", type: ComponentRendererComponent, selector: "ngx-decaf-component-renderer", inputs: ["tag", "children", "projectable", "pk", "parent"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
8243
8220
|
};
|
|
8244
8221
|
LayoutComponent = __decorate([
|
|
8245
8222
|
Dynamic(),
|
|
@@ -8247,7 +8224,7 @@ LayoutComponent = __decorate([
|
|
|
8247
8224
|
], LayoutComponent);
|
|
8248
8225
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LayoutComponent, decorators: [{
|
|
8249
8226
|
type: Component,
|
|
8250
|
-
args: [{ selector: 'ngx-decaf-layout', imports: [TranslatePipe, CardComponent, ModelRendererComponent, ComponentRendererComponent], standalone: true, template: "<section class=\"dcf-layout-container\">\n @if (initialized) {\n @for (row of rows; track trackItemFn($index, row); let rowIndex = $index) {\n @if (row?.cols?.length) {\n <div\n [id]=\"uid\"\n [class]=\"\n (!grid ? 'dcf-layout-row ' : 'dcf-layout-row dcf-grid ' + 'dcf-grid-' + gap) +\n ' ' +\n (className || '')\n \"\n [class.dcf-grid-match]=\"match\"\n [class.dcf-grid-bordered]=\"borders\"\n >\n @if (row?.title?.length) {\n <div class=\"dcf-width-1-1 dcf-grid-title\">\n <h3 class=\"\">{{ row.title | translate }}</h3>\n </div>\n }\n @for (child of row.cols; track trackItemFn($index, child.col); let colIndex = $index) {\n <div\n [class]=\"'dcf-grid-col ' + child.colClass\"\n [class.dcf-first-column]=\"$index === 0\"\n [class.dcf-hidden]=\"child.props?.hidden?.includes(operation)\"\n >\n <div>\n @if (child.tag === 'ngx-decaf-crud-form') {\n <ngx-decaf-card\n [className]=\"(match ? 'dcf-height-1-1 dcf-card-layout' : '') + className\"\n [body]=\"cardBody\"\n [type]=\"cardType\"\n >\n <ngx-decaf-model-renderer\n [model]=\"child.props.name\"\n (listenEvent)=\"handleEvent($event)\"\n />\n </ngx-decaf-card>\n } @else {\n <ngx-decaf-component-renderer\n [tag]=\"child.tag\"\n [className]=\"(match ? 'dcf-height-1-1 dcf-card-layout' : '') + className\"\n [parentForm]=\"parentForm || child.parentForm || child?.formGroup\"\n [children]=\"child?.children || []\"\n (listenEvent)=\"handleEvent($event)\"\n [globals]=\"{ props: child.props }\"\n />\n }\n </div>\n </div>\n }\n </div>\n }\n }\n }\n</section>\n", styles: [".dcf-grid:first-of-type .dcf-grid .dcf-first-column{padding-top:.25rem!important}.dcf-grid:first-of-type .dcf-grid .dcf-first-column+div{padding-top:.5rem!important}.dcf-grid:first-of-type .dcf-grid .dcf-first-column+div~div{padding-top:.25rem!important}.dcf-grid.dcf-grid-collapse.read>div{margin:var(--dcf-margin-small) 0!important}.dcf-grid.dcf-grid-bordered>div>div{padding:var(--dcf-padding-small) var(--dcf-padding);border-radius:var(--dcf-border-radius-small);border:1px solid var(--dcf-color-gray-2);background:var(--dcf-card-background)!important}.dcf-grid .dcf-grid-title{padding:unset;margin:unset}.dcf-grid .dcf-grid-title>*{padding:unset;margin:unset;padding-left:var(--dcf-padding-small);font-size:1.05rem!important;font-weight:600;background:none;box-shadow:none;display:flex;align-items:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.dcf-grid.dcf-grid-match ::ng-deep ngx-decaf-component-renderer>*>*{height:100%!important}.dcf-grid.dcf-grid-small.dcf-grid-nested{padding:0 .5rem!important}.dcf-grid.dcf-grid-small>div{margin-bottom:1.75rem}.dcf-grid.dcf-grid-small>div:last-child{margin-bottom:0}.dcf-grid.dcf-grid-small>div.dcf-layout-separator{margin-bottom:1rem}.dcf-grid.dcf-grid-small>div.dcf-grid-bordered:last-child{margin-bottom:0}.dcf-grid.dcf-grid-small+.dcf-grid-small{margin-bottom:1.75rem}.dcf-grid.dcf-grid-small+.dcf-grid-small.dcf-layout-separator{margin-bottom:1rem}::ng-deep ngx-decaf-component-renderer>*>div{margin-bottom:0!important}\n"] }]
|
|
8227
|
+
args: [{ selector: 'ngx-decaf-layout', imports: [TranslatePipe, CardComponent, ModelRendererComponent, ComponentRendererComponent], standalone: true, template: "<section class=\"dcf-layout-container\">\n @if (initialized) {\n @for (row of rows; track trackItemFn($index, row); let rowIndex = $index) {\n @if (row?.cols?.length) {\n <div\n [id]=\"uid\"\n [class]=\"\n (!grid ? 'dcf-layout-row ' : 'dcf-layout-row dcf-grid ' + 'dcf-grid-' + gap) +\n ' ' +\n (className || '')\n \"\n [class.dcf-grid-match]=\"match\"\n [class.dcf-grid-bordered]=\"borders\"\n >\n @if (row?.title?.length) {\n <div class=\"dcf-width-1-1 dcf-grid-title\">\n <h3 class=\"\">{{ row.title | translate }}</h3>\n </div>\n }\n @for (child of row.cols; track trackItemFn($index, child.col); let colIndex = $index) {\n <div\n [class]=\"'dcf-grid-col ' + child.colClass\"\n [class.dcf-first-column]=\"$index === 0\"\n [class.dcf-hidden]=\"child.props?.hidden?.includes(operation)\"\n >\n <div>\n @if (child.tag === 'ngx-decaf-crud-form') {\n <ngx-decaf-card\n [className]=\"(match ? 'dcf-height-1-1 dcf-card-layout' : '') + className\"\n [body]=\"cardBody\"\n [type]=\"cardType\"\n >\n <ngx-decaf-model-renderer\n [model]=\"child.props.name\"\n [pk]=\"pk\"\n (listenEvent)=\"handleEvent($event)\"\n />\n </ngx-decaf-card>\n } @else {\n <ngx-decaf-component-renderer\n [tag]=\"child.tag\"\n [pk]=\"pk\"\n [className]=\"(match ? 'dcf-height-1-1 dcf-card-layout' : '') + className\"\n [parentForm]=\"parentForm || child.parentForm || child?.formGroup\"\n [children]=\"child?.children || []\"\n (listenEvent)=\"handleEvent($event)\"\n [globals]=\"{ props: child.props }\"\n />\n }\n </div>\n </div>\n }\n </div>\n }\n }\n }\n</section>\n", styles: [".dcf-grid:first-of-type .dcf-grid .dcf-first-column{padding-top:.25rem!important}.dcf-grid:first-of-type .dcf-grid .dcf-first-column+div{padding-top:.5rem!important}.dcf-grid:first-of-type .dcf-grid .dcf-first-column+div~div{padding-top:.25rem!important}.dcf-grid.dcf-grid-collapse.read>div{margin:var(--dcf-margin-small) 0!important}.dcf-grid.dcf-grid-bordered>div>div{padding:var(--dcf-padding-small) var(--dcf-padding);border-radius:var(--dcf-border-radius-small);border:1px solid var(--dcf-color-gray-2);background:var(--dcf-card-background)!important}.dcf-grid .dcf-grid-title{padding:unset;margin:unset}.dcf-grid .dcf-grid-title>*{padding:unset;margin:unset;padding-left:var(--dcf-padding-small);font-size:1.05rem!important;font-weight:600;background:none;box-shadow:none;display:flex;align-items:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.dcf-grid.dcf-grid-match ::ng-deep ngx-decaf-component-renderer>*>*{height:100%!important}.dcf-grid.dcf-grid-small.dcf-grid-nested{padding:0 .5rem!important}.dcf-grid.dcf-grid-small>div{margin-bottom:1.75rem}.dcf-grid.dcf-grid-small>div:last-child{margin-bottom:0}.dcf-grid.dcf-grid-small>div.dcf-layout-separator{margin-bottom:1rem}.dcf-grid.dcf-grid-small>div.dcf-grid-bordered:last-child{margin-bottom:0}.dcf-grid.dcf-grid-small+.dcf-grid-small{margin-bottom:1.75rem}.dcf-grid.dcf-grid-small+.dcf-grid-small.dcf-layout-separator{margin-bottom:1rem}::ng-deep ngx-decaf-component-renderer>*>div{margin-bottom:0!important}\n"] }]
|
|
8251
8228
|
}], ctorParameters: () => [], propDecorators: { gap: [{
|
|
8252
8229
|
type: Input
|
|
8253
8230
|
}], grid: [{
|
|
@@ -8276,13 +8253,13 @@ let CrudFormComponent = class CrudFormComponent extends NgxFormDirective {
|
|
|
8276
8253
|
*/
|
|
8277
8254
|
async ngOnInit() {
|
|
8278
8255
|
this.options = Object.assign({}, DefaultFormReactiveOptions, { buttons: { submit: { text: this.operation.toLowerCase() } } }, this.options || {});
|
|
8279
|
-
await super.initialize();
|
|
8280
8256
|
if (!this.pk && this.modelName) {
|
|
8281
8257
|
const repo = getModelAndRepository(this.modelName);
|
|
8282
8258
|
if (repo) {
|
|
8283
8259
|
this.pk = repo.pk;
|
|
8284
8260
|
}
|
|
8285
8261
|
}
|
|
8262
|
+
await super.initialize();
|
|
8286
8263
|
}
|
|
8287
8264
|
/**
|
|
8288
8265
|
* @description Handles delete operations by emitting delete events.
|
|
@@ -8298,7 +8275,7 @@ let CrudFormComponent = class CrudFormComponent extends NgxFormDirective {
|
|
|
8298
8275
|
super.submitEventEmit(this.model, 'CrudFormComponent', ComponentEventNames.Submit, this.handlers, OperationKeys.DELETE);
|
|
8299
8276
|
}
|
|
8300
8277
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CrudFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8301
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: CrudFormComponent, isStandalone: true, selector: "ngx-decaf-crud-form", host: { properties: { "attr.id": "uid" } }, usesInheritance: true, ngImport: i0, template: "@if (operation !== 'read' && operation !== 'delete') {\n <form\n [class]=\"'dcf-form-grid ' + operation\"
|
|
8278
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: CrudFormComponent, isStandalone: true, selector: "ngx-decaf-crud-form", host: { properties: { "attr.id": "uid" } }, usesInheritance: true, ngImport: i0, template: "@if (operation !== 'read' && operation !== 'delete') {\n <form\n [class]=\"'dcf-form-grid ' + operation\"\n #component\n [id]=\"rendererId\"\n [formGroup]=\"formGroup\"\n (ngSubmit)=\"submit($event)\"\n novalidate\n [target]=\"target\"\n >\n @if (!children?.length) {\n <ng-content #formContent></ng-content>\n } @else {\n <ngx-decaf-layout\n [className]=\"'dcf-crud-form-grid dcf-grid-nested '\"\n [children]=\"children || []\"\n [pk]=\"pk\"\n (listenEvent)=\"handleEvent($event)\"\n [parentForm]=\"formGroup || parentForm\"\n [operation]=\"operation\"\n [modelId]=\"modelId\"\n [cardType]=\"cardType ?? 'blank'\"\n [match]=\"match ?? false\"\n [gap]=\"'small'\"\n [flexMode]=\"props.flexMode || false\"\n [rows]=\"rows\"\n [borders]=\"borders ?? false\"\n [breakpoint]=\"breakpoint ?? 'large'\"\n [cols]=\"cols\"\n />\n }\n @if (initialized) {\n <div class=\"dcf-buttons-grid dcf-grid dcf-grid-small dcf-flex dcf-flex-right\">\n @if (!action) {\n <div>\n <ion-button fill=\"clear\" (click)=\"handleReset()\">\n @if (options.buttons.clear?.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.clear?.iconSlot\"\n [name]=\"options.buttons.clear?.icon\"\n ></ion-icon>\n }\n {{ locale + '.' + (allowClear ? options.buttons.clear?.text : 'back') | translate }}\n </ion-button>\n </div>\n }\n <div>\n <ion-button type=\"submit\" [expand]=\"action ? 'block' : 'default'\">\n @if (options.buttons.submit.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.submit.iconSlot\"\n [name]=\"options.buttons.submit.icon\"\n ></ion-icon>\n }\n {{ action ? action : (locale + '.' + options.buttons.submit.text | translate) }}\n </ion-button>\n </div>\n </div>\n }\n </form>\n} @else {\n <section #component [id]=\"uid\">\n <ngx-decaf-layout\n [className]=\"''\"\n [pk]=\"pk\"\n [modelId]=\"modelId\"\n [children]=\"children || []\"\n [operation]=\"operation\"\n [cardType]=\"cardType ?? 'blank'\"\n [modelId]=\"modelId\"\n [match]=\"match ?? false\"\n [gap]=\"'small'\"\n (listenEvent)=\"handleEvent($event)\"\n [flexMode]=\"props.flexMode || false\"\n [rows]=\"rows\"\n [borders]=\"borders ?? false\"\n [breakpoint]=\"breakpoint ?? 'large'\"\n [cols]=\"cols\"\n />\n </section>\n\n <section\n [class]=\"'dcf-buttons-grid dcf-grid dcf-grid-small dcf-flex dcf-flex-left ' + operation\"\n [id]=\"uid\"\n >\n @if ([OperationKeys.READ, OperationKeys.DELETE].includes(operation) && modelId) {\n <div>\n <ion-button (click)=\"handleDelete()\" color=\"danger\" type=\"button\">\n @if (options.buttons.submit.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.submit.iconSlot\"\n [name]=\"options.buttons.submit.icon\"\n ></ion-icon>\n }\n {{ locale + '.delete' | translate }}\n </ion-button>\n </div>\n }\n @if (operation === OperationKeys.CREATE || operation === OperationKeys.UPDATE) {\n <div>\n <ion-button type=\"submit\">\n @if (options.buttons.submit.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.submit.iconSlot\"\n [name]=\"options.buttons.submit.icon\"\n ></ion-icon>\n }\n {{ action ? action : (locale + '.' + options.buttons.submit.text | translate) }}\n </ion-button>\n </div>\n }\n <div>\n <ion-button fill=\"clear\" (click)=\"handleReset()\">\n @if (options.buttons.clear?.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.clear?.iconSlot\"\n [name]=\"options.buttons.clear?.icon\"\n ></ion-icon>\n }\n {{\n [OperationKeys.DELETE, OperationKeys.READ, OperationKeys.UPDATE].includes(operation)\n ? (locale + '.back' | translate)\n : options.buttons.clear?.text\n }}\n </ion-button>\n </div>\n </section>\n}\n", styles: [".dcf-buttons-grid{margin-top:var(--dcf-margin-medium);margin-bottom:var(--dcf-margin)}@media (min-width: 577px){.dcf-buttons-grid.dcf-flex.read,.dcf-buttons-grid.dcf-flex.delete{flex-direction:row-reverse}}@media (max-width: 576px){.dcf-buttons-grid.dcf-flex{flex-direction:column-reverse}.dcf-buttons-grid.dcf-flex>div{width:100%}.dcf-buttons-grid.dcf-flex>div+div{margin-top:1rem}.dcf-buttons-grid.dcf-flex ion-button{width:100%}}.dcf-form-grid.create,.dcf-form-grid.update{margin-top:var(--dcf-margin-small)}.dcf-form-grid .dcf-form-item{margin-top:0!important}.dcf-form-grid.read .dcf-form-item{margin-bottom:var(--dcf-margin-small)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: LayoutComponent, selector: "ngx-decaf-layout", inputs: ["gap", "grid", "flexMode", "rowCard", "maxColsLength"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
8302
8279
|
};
|
|
8303
8280
|
CrudFormComponent = __decorate([
|
|
8304
8281
|
Dynamic(),
|
|
@@ -8306,7 +8283,7 @@ CrudFormComponent = __decorate([
|
|
|
8306
8283
|
], CrudFormComponent);
|
|
8307
8284
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CrudFormComponent, decorators: [{
|
|
8308
8285
|
type: Component,
|
|
8309
|
-
args: [{ standalone: true, selector: 'ngx-decaf-crud-form', imports: [TranslatePipe, ReactiveFormsModule, LayoutComponent, IonButton, IonIcon], host: { '[attr.id]': 'uid' }, template: "@if (operation !== 'read' && operation !== 'delete') {\n <form\n [class]=\"'dcf-form-grid ' + operation\"
|
|
8286
|
+
args: [{ standalone: true, selector: 'ngx-decaf-crud-form', imports: [TranslatePipe, ReactiveFormsModule, LayoutComponent, IonButton, IonIcon], host: { '[attr.id]': 'uid' }, template: "@if (operation !== 'read' && operation !== 'delete') {\n <form\n [class]=\"'dcf-form-grid ' + operation\"\n #component\n [id]=\"rendererId\"\n [formGroup]=\"formGroup\"\n (ngSubmit)=\"submit($event)\"\n novalidate\n [target]=\"target\"\n >\n @if (!children?.length) {\n <ng-content #formContent></ng-content>\n } @else {\n <ngx-decaf-layout\n [className]=\"'dcf-crud-form-grid dcf-grid-nested '\"\n [children]=\"children || []\"\n [pk]=\"pk\"\n (listenEvent)=\"handleEvent($event)\"\n [parentForm]=\"formGroup || parentForm\"\n [operation]=\"operation\"\n [modelId]=\"modelId\"\n [cardType]=\"cardType ?? 'blank'\"\n [match]=\"match ?? false\"\n [gap]=\"'small'\"\n [flexMode]=\"props.flexMode || false\"\n [rows]=\"rows\"\n [borders]=\"borders ?? false\"\n [breakpoint]=\"breakpoint ?? 'large'\"\n [cols]=\"cols\"\n />\n }\n @if (initialized) {\n <div class=\"dcf-buttons-grid dcf-grid dcf-grid-small dcf-flex dcf-flex-right\">\n @if (!action) {\n <div>\n <ion-button fill=\"clear\" (click)=\"handleReset()\">\n @if (options.buttons.clear?.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.clear?.iconSlot\"\n [name]=\"options.buttons.clear?.icon\"\n ></ion-icon>\n }\n {{ locale + '.' + (allowClear ? options.buttons.clear?.text : 'back') | translate }}\n </ion-button>\n </div>\n }\n <div>\n <ion-button type=\"submit\" [expand]=\"action ? 'block' : 'default'\">\n @if (options.buttons.submit.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.submit.iconSlot\"\n [name]=\"options.buttons.submit.icon\"\n ></ion-icon>\n }\n {{ action ? action : (locale + '.' + options.buttons.submit.text | translate) }}\n </ion-button>\n </div>\n </div>\n }\n </form>\n} @else {\n <section #component [id]=\"uid\">\n <ngx-decaf-layout\n [className]=\"''\"\n [pk]=\"pk\"\n [modelId]=\"modelId\"\n [children]=\"children || []\"\n [operation]=\"operation\"\n [cardType]=\"cardType ?? 'blank'\"\n [modelId]=\"modelId\"\n [match]=\"match ?? false\"\n [gap]=\"'small'\"\n (listenEvent)=\"handleEvent($event)\"\n [flexMode]=\"props.flexMode || false\"\n [rows]=\"rows\"\n [borders]=\"borders ?? false\"\n [breakpoint]=\"breakpoint ?? 'large'\"\n [cols]=\"cols\"\n />\n </section>\n\n <section\n [class]=\"'dcf-buttons-grid dcf-grid dcf-grid-small dcf-flex dcf-flex-left ' + operation\"\n [id]=\"uid\"\n >\n @if ([OperationKeys.READ, OperationKeys.DELETE].includes(operation) && modelId) {\n <div>\n <ion-button (click)=\"handleDelete()\" color=\"danger\" type=\"button\">\n @if (options.buttons.submit.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.submit.iconSlot\"\n [name]=\"options.buttons.submit.icon\"\n ></ion-icon>\n }\n {{ locale + '.delete' | translate }}\n </ion-button>\n </div>\n }\n @if (operation === OperationKeys.CREATE || operation === OperationKeys.UPDATE) {\n <div>\n <ion-button type=\"submit\">\n @if (options.buttons.submit.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.submit.iconSlot\"\n [name]=\"options.buttons.submit.icon\"\n ></ion-icon>\n }\n {{ action ? action : (locale + '.' + options.buttons.submit.text | translate) }}\n </ion-button>\n </div>\n }\n <div>\n <ion-button fill=\"clear\" (click)=\"handleReset()\">\n @if (options.buttons.clear?.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.clear?.iconSlot\"\n [name]=\"options.buttons.clear?.icon\"\n ></ion-icon>\n }\n {{\n [OperationKeys.DELETE, OperationKeys.READ, OperationKeys.UPDATE].includes(operation)\n ? (locale + '.back' | translate)\n : options.buttons.clear?.text\n }}\n </ion-button>\n </div>\n </section>\n}\n", styles: [".dcf-buttons-grid{margin-top:var(--dcf-margin-medium);margin-bottom:var(--dcf-margin)}@media (min-width: 577px){.dcf-buttons-grid.dcf-flex.read,.dcf-buttons-grid.dcf-flex.delete{flex-direction:row-reverse}}@media (max-width: 576px){.dcf-buttons-grid.dcf-flex{flex-direction:column-reverse}.dcf-buttons-grid.dcf-flex>div{width:100%}.dcf-buttons-grid.dcf-flex>div+div{margin-top:1rem}.dcf-buttons-grid.dcf-flex ion-button{width:100%}}.dcf-form-grid.create,.dcf-form-grid.update{margin-top:var(--dcf-margin-small)}.dcf-form-grid .dcf-form-item{margin-top:0!important}.dcf-form-grid.read .dcf-form-item{margin-bottom:var(--dcf-margin-small)}\n"] }]
|
|
8310
8287
|
}], ctorParameters: () => [] });
|
|
8311
8288
|
|
|
8312
8289
|
/**
|
|
@@ -8883,7 +8860,12 @@ let FieldsetComponent = class FieldsetComponent extends NgxFormDirective {
|
|
|
8883
8860
|
else {
|
|
8884
8861
|
this.activePage = this.getActivePage();
|
|
8885
8862
|
}
|
|
8886
|
-
|
|
8863
|
+
if (this.pk) {
|
|
8864
|
+
this.mapper = Object.assign(this.mapper || {}, { [this.pk]: this.pk });
|
|
8865
|
+
}
|
|
8866
|
+
await this.initialize();
|
|
8867
|
+
}
|
|
8868
|
+
async initialize() {
|
|
8887
8869
|
await super.initialize();
|
|
8888
8870
|
await this.refresh();
|
|
8889
8871
|
}
|
|
@@ -8918,26 +8900,6 @@ let FieldsetComponent = class FieldsetComponent extends NgxFormDirective {
|
|
|
8918
8900
|
*/
|
|
8919
8901
|
async ngAfterViewInit() {
|
|
8920
8902
|
await super.ngAfterViewInit();
|
|
8921
|
-
// console.log(this);
|
|
8922
|
-
// if (!this.collapsable)
|
|
8923
|
-
// this.isOpen = true;
|
|
8924
|
-
// if (this.operation === OperationKeys.READ || this.operation === OperationKeys.DELETE) {
|
|
8925
|
-
// this.isOpen = true;
|
|
8926
|
-
// // hidden remove button
|
|
8927
|
-
// const accordionElement = this.component?.nativeElement.querySelector('ion-accordion-group');
|
|
8928
|
-
// if (accordionElement)
|
|
8929
|
-
// this.renderer.setAttribute(accordionElement, 'value', 'open');
|
|
8930
|
-
// } else {
|
|
8931
|
-
// const inputs = this.component?.nativeElement.querySelectorAll('.dcf-field-required');
|
|
8932
|
-
// this.isRequired = inputs?.length > 0;
|
|
8933
|
-
// if (this.isRequired) {
|
|
8934
|
-
// this.accordionComponent.value = 'open';
|
|
8935
|
-
// this.handleAccordionToggle();
|
|
8936
|
-
// }
|
|
8937
|
-
// }
|
|
8938
|
-
// if (!(this.formGroup instanceof FormArray))
|
|
8939
|
-
// this.formGroup = (this.formGroup as FormGroup)
|
|
8940
|
-
// this.changeDetectorRef.detectChanges();
|
|
8941
8903
|
}
|
|
8942
8904
|
async refresh(operation) {
|
|
8943
8905
|
if (operation) {
|
|
@@ -8977,29 +8939,30 @@ let FieldsetComponent = class FieldsetComponent extends NgxFormDirective {
|
|
|
8977
8939
|
];
|
|
8978
8940
|
}
|
|
8979
8941
|
else {
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
|
|
8996
|
-
|
|
8997
|
-
|
|
8998
|
-
|
|
8999
|
-
|
|
9000
|
-
|
|
9001
|
-
|
|
9002
|
-
|
|
8942
|
+
if (Array.isArray(data)) {
|
|
8943
|
+
this.value = [];
|
|
8944
|
+
data.map((v) => {
|
|
8945
|
+
const formGroup = this.activeFormGroup;
|
|
8946
|
+
if (data.length > formGroup.parent.length)
|
|
8947
|
+
NgxFormService.addGroupToParent(formGroup.parent);
|
|
8948
|
+
if (!Object.keys(this.mapper).length)
|
|
8949
|
+
this.mapper = this.getMapper(v);
|
|
8950
|
+
Object.entries(v).forEach(([key, value]) => {
|
|
8951
|
+
if (key === this.pk)
|
|
8952
|
+
formGroup.addControl(key, new FormControl({ value: value, disabled: false }));
|
|
8953
|
+
const control = formGroup.get(key);
|
|
8954
|
+
if (control instanceof FormControl) {
|
|
8955
|
+
control.setValue(value);
|
|
8956
|
+
control.updateValueAndValidity();
|
|
8957
|
+
formGroup.updateValueAndValidity();
|
|
8958
|
+
}
|
|
8959
|
+
});
|
|
8960
|
+
this.activeFormGroupIndex = formGroup.parent.length - 1;
|
|
8961
|
+
});
|
|
8962
|
+
this.setValue();
|
|
8963
|
+
// this.changeDetectorRef.detectChanges();
|
|
8964
|
+
}
|
|
8965
|
+
// this.getItems(data as []);
|
|
9003
8966
|
}
|
|
9004
8967
|
}
|
|
9005
8968
|
}
|
|
@@ -9347,11 +9310,11 @@ let FieldsetComponent = class FieldsetComponent extends NgxFormDirective {
|
|
|
9347
9310
|
if (formGroup?.length) {
|
|
9348
9311
|
const value = formGroup.controls.map(({ value }) => value).filter((v) => this.hasValue(v));
|
|
9349
9312
|
this.value = value;
|
|
9350
|
-
this.getItems(value
|
|
9313
|
+
this.getItems(value);
|
|
9351
9314
|
}
|
|
9352
9315
|
this.updatingItem = undefined;
|
|
9353
9316
|
}
|
|
9354
|
-
getItems(value
|
|
9317
|
+
getItems(value) {
|
|
9355
9318
|
if (value) {
|
|
9356
9319
|
if (!Array.isArray(value)) {
|
|
9357
9320
|
value = [value];
|
|
@@ -9376,7 +9339,6 @@ let FieldsetComponent = class FieldsetComponent extends NgxFormDirective {
|
|
|
9376
9339
|
index: v.index > 1 ? v.index : index + 1,
|
|
9377
9340
|
};
|
|
9378
9341
|
}),
|
|
9379
|
-
...(this.operation === OperationKeys.UPDATE ? items : []),
|
|
9380
9342
|
];
|
|
9381
9343
|
}
|
|
9382
9344
|
}
|
|
@@ -9411,7 +9373,7 @@ let FieldsetComponent = class FieldsetComponent extends NgxFormDirective {
|
|
|
9411
9373
|
return this.mapper;
|
|
9412
9374
|
}
|
|
9413
9375
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: FieldsetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
9414
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: FieldsetComponent, isStandalone: true, selector: "ngx-decaf-fieldset", inputs: { formControl: "formControl", customTypes: "customTypes", title: "title", description: "description", multiple: "multiple", value: "value", borders: "borders", max: "max", required: "required", ordenable: "ordenable", editable: "editable" }, usesInheritance: true, ngImport: i0, template: "@if (['create', 'update'].includes(operation) || !multiple) {\n <div\n [attr.role]=\"['create', 'update'].includes(operation) ? 'group' : 'region'\"\n [class]=\"'dcf-fieldset-component ' + operation\"\n [class.dcf-blank]=\"!borders\"\n [class.dcf-empty]=\"!items?.length\"\n [class.dcf-open]=\"isOpen\"\n #component\n >\n <div class=\"dcf-width-1-1\">\n <div>\n <div class=\"dcf-grid dcf-grid-collapse dcf-flex dcf-flex-middle dcf-width-1-1\">\n <div class=\"dcf-width-expand\">\n <legend>{{ (title ? title : name) | translate }}</legend>\n </div>\n @if (!isRequired && ['create'].includes(operation) && multiple) {\n <div class=\"dcf-width-auto dcf-delete\">\n <ion-button\n fill=\"clear\"\n size=\"small\"\n (click)=\"handleClear($event)\"\n [class.dcf-invisible]=\"!isOpen\"\n [attr.aria-label]=\"\n (items?.length ? locale + '.clear_items' : locale + '.hidden_form') | translate\n \"\n >\n <ngx-decaf-icon\n slot=\"icon-only\"\n [name]=\"'ti-' + (items?.length ? 'trash' : 'eye-off')\"\n />\n </ion-button>\n </div>\n }\n </div>\n </div>\n\n <div\n class=\"dcf-fieldset-content\"\n [class.dcf-empty]=\"!items?.length && !isOpen\"\n slot=\"content\"\n >\n @if (activePage) {\n <div\n class=\"dcf-animation dcf-animation-slide-top-small dcf-animation-fast\"\n [class.dcf-disabled]=\"!activePage\"\n >\n <ngx-decaf-layout\n [className]=\"''\"\n [flexMode]=\"props.flexMode ?? false\"\n [match]=\"false\"\n [gap]=\"'small'\"\n [children]=\"activePage || []\"\n [parentForm]=\"formGroup || parentForm\"\n [rows]=\"rows\"\n [cols]=\"cols\"\n [borders]=\"activePage?.borders ?? false\"\n [breakpoint]=\"breakpoint ?? 'large'\"\n [hidden]=\"items.length === max && !updatingItem\"\n />\n </div>\n }\n\n @if (multiple && ['create', 'update'].includes(operation)) {\n @if (multiple && items.length) {\n <ion-list class=\"dcf-fields-list\">\n <ion-reorder-group\n [formGroup]=\"formGroup.parent\"\n [disabled]=\"updatingItem\"\n (ionItemReorder)=\"handleReorderItems($any($event))\"\n #accordionComponent\n >\n @for (item of items; track item.index) {\n <ion-item\n [class.not-unique]=\"item.title === isUniqueError\"\n [class.updating]=\"updatingItem?.['index'] === item.index - 1\"\n lines=\"full\"\n [button]=\"false\"\n >\n @if (ordenable) {\n @if (items?.length > 1 && !updatingItem) {\n <ion-reorder slot=\"start\">\n <ion-icon aria-hidden=\"true\" name=\"swap-vertical-outline\"></ion-icon>\n </ion-reorder>\n } @else {\n <div slot=\"start\">\n <ion-icon\n aria-hidden=\"true\"\n class=\"dcf-reorder-disabled\"\n size=\"small\"\n name=\"swap-vertical-outline\"\n disabled\n ></ion-icon>\n </div>\n }\n }\n\n <ion-label\n [color]=\"\n item.title === isUniqueError && !updatingItem?.[pk] === item.title\n ? 'danger'\n : ''\n \"\n >\n @if (ordenable) {\n {{ item.index }}.{{ item.title }}\n } @else {\n @if (item[pk]) {\n {{ pk }}: {{ item[pk] }} -\n }\n {{ item.title }}\n }\n @if (item.description?.length > 0) {\n <br />\n <ion-text class=\"dcf-subtitle\">{{ item.description }}</ion-text>\n }\n </ion-label>\n @if (item.info?.length || item.subinfo?.length) {\n <ion-note slot=\"end\">\n @if (item.info?.length) {\n {{ item.info }}\n <br />\n }\n @if (item.subinfo) {\n {{ item.subinfo }}\n }\n </ion-note>\n }\n <div slot=\"end\">\n @if (editable) {\n @if (!updatingItem || updatingItem?.[pk] !== item.title) {\n <ion-button\n fill=\"clear\"\n size=\"small\"\n (click)=\"handleUpdateItem($index)\"\n [attr.aria-label]=\"locale + '.edit_item' | translate\"\n >\n <ngx-decaf-icon\n slot=\"icon-only\"\n size=\"small\"\n name=\"ti-cash-edit\"\n [color]=\"!isDarkMode ? 'dark' : 'light'\"\n ></ngx-decaf-icon>\n </ion-button>\n }\n }\n @if (!updatingItem) {\n <ion-button\n fill=\"clear\"\n size=\"small\"\n color=\"danger\"\n (click)=\"handleRemoveItem($index)\"\n [attr.aria-label]=\"locale + '.remove_item' | translate\"\n >\n <ngx-decaf-icon\n slot=\"icon-only\"\n size=\"small\"\n name=\"ti-row-remove\"\n [color]=\"!isDarkMode ? 'dark' : 'light'\"\n />\n </ion-button>\n }\n </div>\n </ion-item>\n }\n </ion-reorder-group>\n </ion-list>\n }\n\n @if (isUniqueError) {\n <div\n class=\"dcf-not-unique-container dcf-animation dcf-animation-bottom-small dcf-animation-fast\"\n >\n <div class=\"dcf-grid dcf-grid-collapse dcf-width-1-1\">\n <div class=\"dcf-auto\" [attr.style]=\"'max-width: 50px'\">\n <ion-icon aria-hidden=\"true\" name=\"alert-circle-outline\"></ion-icon>\n </div>\n <div class=\"dcf-width-expand\">\n <ion-text color=\"danger\" class=\"dcf-text-small\">\n {{ locale + '.not_unique' | translate: { value: isUniqueError } }}\n </ion-text>\n </div>\n </div>\n </div>\n }\n\n @if (max) {\n <div class=\"dcf-width-1-1 dcf-max-message-container\">\n <ion-text\n class=\"dcf-text-small\"\n [color]=\"items.length !== max ? (!isDarkMode ? 'medium' : '') : 'primary'\"\n >\n {{\n locale + (items.length !== max ? '.max_items' : '.max_items_reached')\n | translate: { '0': max }\n }}\n </ion-text>\n </div>\n }\n\n <div class=\"dcf-grid dcf-grid-small dcf-flex dcf-buttons-container\">\n @if (updatingItem) {\n <div>\n <ion-button\n size=\"small\"\n fill=\"clear\"\n color=\"danger\"\n (click)=\"handleCancelUpdateItem()\"\n [attr.aria-label]=\"locale + '.cancel_update' | translate\"\n >\n {{ locale + '.cancel' | translate }}\n </ion-button>\n </div>\n <div>\n <ion-button\n size=\"small\"\n fill=\"clear\"\n (click)=\"handleCreateItem()\"\n [attr.aria-label]=\"locale + '.update_item' | translate\"\n >\n <ion-icon aria-hidden=\"true\" name=\"refresh-outline\" slot=\"start\"></ion-icon>\n {{ locale + '.update_item' | translate }}\n </ion-button>\n </div>\n } @else {\n @if (items.length < max || !max) {\n <div>\n <ion-button\n size=\"small\"\n fill=\"clear\"\n class=\"dcf-button-add\"\n [color]=\"isDarkMode ? 'light' : 'dark'\"\n (click)=\"handleCreateItem()\"\n [attr.aria-label]=\"locale + '.create_item' | translate\"\n >\n <!-- <ion-icon aria-hidden=\"true\" name=\"add-outline\" slot=\"start\"></ion-icon> -->\n <ngx-decaf-icon slot=\"icon-only\" name=\"ti-code-plus\" slot=\"start\" />\n {{\n locale +\n (required\n ? items.length\n ? '.add'\n : '.add_first'\n : items.length\n ? '.add'\n : isOpen\n ? '.add_first'\n : '.show_form') | translate\n }}\n </ion-button>\n </div>\n }\n }\n </div>\n }\n </div>\n </div>\n </div>\n} @else {\n @if (refreshing) {\n <div class=\"dcf-loading-container\">\n <ion-spinner name=\"crescent\" color=\"primary\"></ion-spinner>\n </div>\n } @else {\n <legend>{{ (title ? title : name) | translate }}</legend>\n @if (!items.length) {\n <div class=\"dcf-padding-xsmall\">\n <ion-text>{{ locale + '.empty' | translate }}</ion-text>\n </div>\n } @else {\n @for (item of items; track trackItemFn($index, item)) {\n <div class=\"dcf-fieldset-read-item\">\n <div>\n <ngx-decaf-layout\n [className]=\"operation\"\n [operation]=\"operation\"\n [flexMode]=\"item?.props?.flexMode ?? false\"\n [match]=\"false\"\n [gap]=\"'collapse'\"\n [children]=\"item || []\"\n [rows]=\"rows\"\n [cols]=\"cols\"\n [borders]=\"item?.props?.borders ?? false\"\n [breakpoint]=\"breakpoint ?? 'large'\"\n />\n </div>\n </div>\n }\n }\n }\n}\n", styles: ["fieldset{margin:0;padding:0;min-inline-size:auto}.dcf-loading-container{height:50%;display:flex;justify-content:center;align-items:center}.dcf-loading-container ion-spinner{width:30px;height:30px}.dcf-fieldset-read-item{border:1px solid var(--dcf-color-gray-3);border-radius:var(--dcf-border-radius-small);padding:var(--dcf-padding-small) var(--dcf-padding-xsmall);padding-bottom:0;margin-bottom:var(--dcf-margin-small)!important}.dcf-fieldset-component{border-radius:var(--dcf-border-radius-small);border:1px solid var(--dcf-color-gray-3);padding:var(--dcf-padding-small)}.dcf-fieldset-component.create ::ng-deep .dcf-item-readonly{display:none!important}.dcf-fieldset-component.dcf-open.dcf-empty .dcf-button-add{margin-top:1rem!important;margin-bottom:.15rem!important}.dcf-fieldset-component.dcf-blank{border-color:transparent;padding:var(--dcf-padding-xsmall) .25rem}.dcf-fieldset-component:not(.dcf-blank):not(.read):not(.delete){padding:var(--dcf-padding)}.dcf-fieldset-component *{overflow-x:hidden!important}.dcf-max-message-container{padding:0 .125rem;margin-bottom:var(--dcf-margin-xsmall)}legend,.dcf-title{font-weight:500;font-size:1rem;line-height:1.5rem;font-weight:600;margin:0;color:var(--ion-color-text)!important}.dcf-fieldset-content{margin-top:.25rem}.dcf-fieldset-content:not(.dcf-empty){padding:var(--dcf-padding-small) .25rem!important;margin-top:var(--dcf-margin-xsmall)}.dcf-fields-list{margin-top:var(--dcf-margin-small);padding-bottom:var(--dcf-padding)!important;max-height:200px}.dcf-fields-list ion-item{--min-height: 30px;--padding-top: 0rem;--padding-bottom: 0rem;--padding-start: .75rem;--padding-end: .5rem;--inner-padding-start: 0px !important;--inner-padding-end: 0px !important;--border-color: transparent;--background: rgba(var(--dcf-color-primary-rgb), .025) !important;border:1px solid var(--dcf-color-gray-3);border-radius:var(--dcf-border-radius-small);box-sizing:border-box}.dcf-fields-list ion-item:not(:last-child){margin-bottom:var(--dcf-margin-small)}.dcf-fields-list ion-item ion-icon.dcf-reorder-disabled{width:var(--dcf-spacement);transform:translatey(2px);color:var(--dcf-color-gray-4)}.dcf-fields-list ion-item.updating{--background: rgba(var(--dcf-color-primary-rgb), .1) !important}.dcf-fields-list ion-item.not-unique{--background: rgba(var(--dcf-color-danger-rgb), .05) !important}.dcf-fields-list ion-item .dcf-subtitle{font-size:.925rem;color:var(--ion-color-gray-6)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: IonList, selector: "ion-list", inputs: ["inset", "lines", "mode"] }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: IonText, selector: "ion-text", inputs: ["color", "mode"] }, { kind: "component", type: IonReorder, selector: "ion-reorder" }, { kind: "component", type: IonReorderGroup, selector: "ion-reorder-group", inputs: ["disabled"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: LayoutComponent, selector: "ngx-decaf-layout", inputs: ["gap", "grid", "flexMode", "rowCard", "maxColsLength"] }, { kind: "component", type: IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }, { kind: "component", type: IconComponent, selector: "ngx-decaf-icon", inputs: ["name", "color", "slot", "button", "buttonFill", "buttonShape", "width", "size", "inline"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
9376
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: FieldsetComponent, isStandalone: true, selector: "ngx-decaf-fieldset", inputs: { formControl: "formControl", customTypes: "customTypes", title: "title", description: "description", multiple: "multiple", value: "value", borders: "borders", max: "max", required: "required", ordenable: "ordenable", editable: "editable" }, usesInheritance: true, ngImport: i0, template: "@if (['create', 'update'].includes(operation) || !multiple) {\n <div\n [attr.role]=\"['create', 'update'].includes(operation) ? 'group' : 'region'\"\n [class]=\"'dcf-fieldset-component ' + operation\"\n [class.dcf-blank]=\"!borders\"\n [class.dcf-empty]=\"!items?.length\"\n [class.dcf-open]=\"isOpen\"\n #component\n >\n <div class=\"dcf-width-1-1\">\n <div>\n <div class=\"dcf-grid dcf-grid-collapse dcf-flex dcf-flex-middle dcf-width-1-1\">\n <div class=\"dcf-width-expand\">\n <legend>{{ (title ? title : name) | translate }}</legend>\n </div>\n @if (!isRequired && ['create'].includes(operation) && multiple) {\n <div class=\"dcf-width-auto dcf-delete\">\n <ion-button\n fill=\"clear\"\n size=\"small\"\n (click)=\"handleClear($event)\"\n [class.dcf-invisible]=\"!isOpen\"\n [attr.aria-label]=\"\n (items?.length ? locale + '.clear_items' : locale + '.hidden_form') | translate\n \"\n >\n <ngx-decaf-icon\n slot=\"icon-only\"\n [name]=\"'ti-' + (items?.length ? 'trash' : 'eye-off')\"\n />\n </ion-button>\n </div>\n }\n </div>\n </div>\n <div\n class=\"dcf-fieldset-content\"\n [class.dcf-empty]=\"!items?.length && !isOpen\"\n slot=\"content\"\n >\n @if (activePage) {\n <div\n class=\"dcf-animation dcf-animation-slide-top-small dcf-animation-fast\"\n [class.dcf-disabled]=\"!activePage\"\n >\n <ngx-decaf-layout\n [className]=\"''\"\n [flexMode]=\"props.flexMode ?? false\"\n [match]=\"false\"\n [gap]=\"'small'\"\n [pk]=\"pk\"\n [modelId]=\"modelId\"\n [operation]=\"operation\"\n [children]=\"activePage || []\"\n [parentForm]=\"formGroup || parentForm\"\n [rows]=\"rows\"\n [cols]=\"cols\"\n [borders]=\"activePage?.borders ?? false\"\n [breakpoint]=\"breakpoint ?? 'large'\"\n [hidden]=\"items.length === max && !updatingItem\"\n />\n </div>\n }\n\n @if (multiple && ['create', 'update'].includes(operation)) {\n @if (multiple && items.length) {\n <ion-list class=\"dcf-fields-list\">\n <ion-reorder-group\n [formGroup]=\"formGroup.parent\"\n [disabled]=\"updatingItem\"\n (ionItemReorder)=\"handleReorderItems($any($event))\"\n #accordionComponent\n >\n @for (item of items; track item.index) {\n <ion-item\n [class.not-unique]=\"isUniqueError && item.title === isUniqueError\"\n [class.updating]=\"updatingItem?.['index'] === item.index - 1\"\n lines=\"full\"\n [button]=\"false\"\n >\n @if (ordenable) {\n @if (items?.length > 1 && !updatingItem) {\n <ion-reorder slot=\"start\">\n <ion-icon aria-hidden=\"true\" name=\"swap-vertical-outline\"></ion-icon>\n </ion-reorder>\n } @else {\n <div slot=\"start\">\n <ion-icon\n aria-hidden=\"true\"\n class=\"dcf-reorder-disabled\"\n size=\"small\"\n name=\"swap-vertical-outline\"\n disabled\n ></ion-icon>\n </div>\n }\n }\n\n <ion-label\n [color]=\"\n item.title === isUniqueError && !updatingItem?.[pk] === item.title\n ? 'danger'\n : ''\n \"\n >\n @if (ordenable) {\n {{ item.index }}.{{ item.title }}\n } @else {\n @if (item[pk]) {\n {{ pk }}: {{ item[pk] }} -\n }\n {{ item.title }}\n }\n @if (item.description?.length > 0) {\n <br />\n <ion-text class=\"dcf-subtitle\">{{ item.description }}</ion-text>\n }\n </ion-label>\n @if (item.info?.length || item.subinfo?.length) {\n <ion-note slot=\"end\">\n @if (item.info?.length) {\n {{ item.info }}\n <br />\n }\n @if (item.subinfo) {\n {{ item.subinfo }}\n }\n </ion-note>\n }\n <div slot=\"end\">\n @if (editable) {\n @if (!updatingItem || updatingItem?.[pk] !== item.title) {\n <ion-button\n fill=\"clear\"\n size=\"small\"\n (click)=\"handleUpdateItem($index)\"\n [attr.aria-label]=\"locale + '.edit_item' | translate\"\n >\n <ngx-decaf-icon\n slot=\"icon-only\"\n size=\"small\"\n name=\"ti-cash-edit\"\n [color]=\"!isDarkMode ? 'dark' : 'light'\"\n ></ngx-decaf-icon>\n </ion-button>\n }\n }\n @if (!updatingItem) {\n <ion-button\n fill=\"clear\"\n size=\"small\"\n color=\"danger\"\n (click)=\"handleRemoveItem($index)\"\n [attr.aria-label]=\"locale + '.remove_item' | translate\"\n >\n <ngx-decaf-icon\n slot=\"icon-only\"\n size=\"small\"\n name=\"ti-row-remove\"\n [color]=\"!isDarkMode ? 'dark' : 'light'\"\n />\n </ion-button>\n }\n </div>\n </ion-item>\n }\n </ion-reorder-group>\n </ion-list>\n }\n\n @if (isUniqueError) {\n <div\n class=\"dcf-not-unique-container dcf-animation dcf-animation-bottom-small dcf-animation-fast\"\n >\n <div class=\"dcf-grid dcf-grid-collapse dcf-width-1-1\">\n <div class=\"dcf-auto\" [attr.style]=\"'max-width: 50px'\">\n <ion-icon aria-hidden=\"true\" name=\"alert-circle-outline\"></ion-icon>\n </div>\n <div class=\"dcf-width-expand\">\n <ion-text color=\"danger\" class=\"dcf-text-small\">\n {{ locale + '.not_unique' | translate: { value: isUniqueError } }}\n </ion-text>\n </div>\n </div>\n </div>\n }\n\n @if (max) {\n <div class=\"dcf-width-1-1 dcf-max-message-container\">\n <ion-text\n class=\"dcf-text-small\"\n [color]=\"items.length !== max ? (!isDarkMode ? 'medium' : '') : 'primary'\"\n >\n {{\n locale + (items.length !== max ? '.max_items' : '.max_items_reached')\n | translate: { '0': max }\n }}\n </ion-text>\n </div>\n }\n\n <div class=\"dcf-grid dcf-grid-small dcf-flex dcf-buttons-container\">\n @if (updatingItem) {\n <div>\n <ion-button\n size=\"small\"\n fill=\"clear\"\n color=\"danger\"\n (click)=\"handleCancelUpdateItem()\"\n [attr.aria-label]=\"locale + '.cancel_update' | translate\"\n >\n {{ locale + '.cancel' | translate }}\n </ion-button>\n </div>\n <div>\n <ion-button\n size=\"small\"\n fill=\"clear\"\n (click)=\"handleCreateItem()\"\n [attr.aria-label]=\"locale + '.update_item' | translate\"\n >\n <ion-icon aria-hidden=\"true\" name=\"refresh-outline\" slot=\"start\"></ion-icon>\n {{ locale + '.update_item' | translate }}\n </ion-button>\n </div>\n } @else {\n @if (items.length < max || !max) {\n <div>\n <ion-button\n size=\"small\"\n fill=\"clear\"\n class=\"dcf-button-add\"\n [color]=\"isDarkMode ? 'light' : 'dark'\"\n (click)=\"handleCreateItem()\"\n [attr.aria-label]=\"locale + '.create_item' | translate\"\n >\n <!-- <ion-icon aria-hidden=\"true\" name=\"add-outline\" slot=\"start\"></ion-icon> -->\n <ngx-decaf-icon slot=\"icon-only\" name=\"ti-code-plus\" slot=\"start\" />\n {{\n locale +\n (required\n ? items.length\n ? '.add'\n : '.add_first'\n : items.length\n ? '.add'\n : isOpen\n ? '.add_first'\n : '.show_form') | translate\n }}\n </ion-button>\n </div>\n }\n }\n </div>\n }\n </div>\n </div>\n </div>\n} @else {\n @if (refreshing) {\n <div class=\"dcf-loading-container\">\n <ion-spinner name=\"crescent\" color=\"primary\"></ion-spinner>\n </div>\n } @else {\n <legend>{{ (title ? title : name) | translate }}</legend>\n @if (!items.length) {\n <div class=\"dcf-padding-xsmall\">\n <ion-text>{{ locale + '.empty' | translate }}</ion-text>\n </div>\n } @else {\n @for (item of items; track trackItemFn($index, item)) {\n <div class=\"dcf-fieldset-read-item\">\n <div>\n <ngx-decaf-layout\n [className]=\"operation\"\n [operation]=\"operation\"\n [pk]=\"pk\"\n [model]=\"model\"\n [modelId]=\"modelId\"\n [flexMode]=\"item?.props?.flexMode ?? false\"\n [match]=\"false\"\n [gap]=\"'collapse'\"\n [children]=\"item || []\"\n [rows]=\"rows\"\n [cols]=\"cols\"\n [borders]=\"item?.props?.borders ?? false\"\n [breakpoint]=\"breakpoint ?? 'large'\"\n />\n </div>\n </div>\n }\n }\n }\n}\n", styles: ["fieldset{margin:0;padding:0;min-inline-size:auto}.dcf-loading-container{height:50%;display:flex;justify-content:center;align-items:center}.dcf-loading-container ion-spinner{width:30px;height:30px}.dcf-fieldset-read-item{border:1px solid var(--dcf-color-gray-3);border-radius:var(--dcf-border-radius-small);padding:var(--dcf-padding-small) var(--dcf-padding-xsmall);padding-bottom:0;margin-bottom:var(--dcf-margin-small)!important}.dcf-fieldset-component{border-radius:var(--dcf-border-radius-small);border:1px solid var(--dcf-color-gray-3);padding:var(--dcf-padding-small)}.dcf-fieldset-component.create ::ng-deep .dcf-item-readonly{display:none!important}.dcf-fieldset-component.dcf-open.dcf-empty .dcf-button-add{margin-top:1rem!important;margin-bottom:.15rem!important}.dcf-fieldset-component.dcf-blank{border-color:transparent;padding:var(--dcf-padding-xsmall) .25rem}.dcf-fieldset-component:not(.dcf-blank):not(.read):not(.delete){padding:var(--dcf-padding)}.dcf-fieldset-component *{overflow-x:hidden!important}.dcf-max-message-container{padding:0 .125rem;margin-bottom:var(--dcf-margin-xsmall)}legend,.dcf-title{font-weight:500;font-size:1rem;line-height:1.5rem;font-weight:600;margin:0;color:var(--ion-color-text)!important}.dcf-fieldset-content{margin-top:.25rem}.dcf-fieldset-content:not(.dcf-empty){padding:var(--dcf-padding-small) .25rem!important;margin-top:var(--dcf-margin-xsmall)}.dcf-fields-list{margin-top:var(--dcf-margin-small);padding-bottom:var(--dcf-padding)!important;max-height:200px}.dcf-fields-list ion-item{--min-height: 30px;--padding-top: 0rem;--padding-bottom: 0rem;--padding-start: .75rem;--padding-end: .5rem;--inner-padding-start: 0px !important;--inner-padding-end: 0px !important;--border-color: transparent;--background: rgba(var(--dcf-color-primary-rgb), .025) !important;border:1px solid var(--dcf-color-gray-3);border-radius:var(--dcf-border-radius-small);box-sizing:border-box}.dcf-fields-list ion-item:not(:last-child){margin-bottom:var(--dcf-margin-small)}.dcf-fields-list ion-item ion-icon.dcf-reorder-disabled{width:var(--dcf-spacement);transform:translatey(2px);color:var(--dcf-color-gray-4)}.dcf-fields-list ion-item.updating{--background: rgba(var(--dcf-color-primary-rgb), .1) !important}.dcf-fields-list ion-item.not-unique{--background: rgba(var(--dcf-color-danger-rgb), .05) !important}.dcf-fields-list ion-item .dcf-subtitle{font-size:.925rem;color:var(--ion-color-gray-6)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: IonList, selector: "ion-list", inputs: ["inset", "lines", "mode"] }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: IonText, selector: "ion-text", inputs: ["color", "mode"] }, { kind: "component", type: IonReorder, selector: "ion-reorder" }, { kind: "component", type: IonReorderGroup, selector: "ion-reorder-group", inputs: ["disabled"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: LayoutComponent, selector: "ngx-decaf-layout", inputs: ["gap", "grid", "flexMode", "rowCard", "maxColsLength"] }, { kind: "component", type: IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }, { kind: "component", type: IconComponent, selector: "ngx-decaf-icon", inputs: ["name", "color", "slot", "button", "buttonFill", "buttonShape", "width", "size", "inline"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
9415
9377
|
};
|
|
9416
9378
|
FieldsetComponent = __decorate([
|
|
9417
9379
|
Dynamic(),
|
|
@@ -9433,7 +9395,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
9433
9395
|
LayoutComponent,
|
|
9434
9396
|
IonSpinner,
|
|
9435
9397
|
IconComponent,
|
|
9436
|
-
], template: "@if (['create', 'update'].includes(operation) || !multiple) {\n <div\n [attr.role]=\"['create', 'update'].includes(operation) ? 'group' : 'region'\"\n [class]=\"'dcf-fieldset-component ' + operation\"\n [class.dcf-blank]=\"!borders\"\n [class.dcf-empty]=\"!items?.length\"\n [class.dcf-open]=\"isOpen\"\n #component\n >\n <div class=\"dcf-width-1-1\">\n <div>\n <div class=\"dcf-grid dcf-grid-collapse dcf-flex dcf-flex-middle dcf-width-1-1\">\n <div class=\"dcf-width-expand\">\n <legend>{{ (title ? title : name) | translate }}</legend>\n </div>\n @if (!isRequired && ['create'].includes(operation) && multiple) {\n <div class=\"dcf-width-auto dcf-delete\">\n <ion-button\n fill=\"clear\"\n size=\"small\"\n (click)=\"handleClear($event)\"\n [class.dcf-invisible]=\"!isOpen\"\n [attr.aria-label]=\"\n (items?.length ? locale + '.clear_items' : locale + '.hidden_form') | translate\n \"\n >\n <ngx-decaf-icon\n slot=\"icon-only\"\n [name]=\"'ti-' + (items?.length ? 'trash' : 'eye-off')\"\n />\n </ion-button>\n </div>\n }\n </div>\n </div>\n\n <div\n class=\"dcf-fieldset-content\"\n [class.dcf-empty]=\"!items?.length && !isOpen\"\n slot=\"content\"\n >\n @if (activePage) {\n <div\n class=\"dcf-animation dcf-animation-slide-top-small dcf-animation-fast\"\n [class.dcf-disabled]=\"!activePage\"\n >\n <ngx-decaf-layout\n [className]=\"''\"\n [flexMode]=\"props.flexMode ?? false\"\n [match]=\"false\"\n [gap]=\"'small'\"\n [children]=\"activePage || []\"\n [parentForm]=\"formGroup || parentForm\"\n [rows]=\"rows\"\n [cols]=\"cols\"\n [borders]=\"activePage?.borders ?? false\"\n [breakpoint]=\"breakpoint ?? 'large'\"\n [hidden]=\"items.length === max && !updatingItem\"\n />\n </div>\n }\n\n @if (multiple && ['create', 'update'].includes(operation)) {\n @if (multiple && items.length) {\n <ion-list class=\"dcf-fields-list\">\n <ion-reorder-group\n [formGroup]=\"formGroup.parent\"\n [disabled]=\"updatingItem\"\n (ionItemReorder)=\"handleReorderItems($any($event))\"\n #accordionComponent\n >\n @for (item of items; track item.index) {\n <ion-item\n [class.not-unique]=\"item.title === isUniqueError\"\n [class.updating]=\"updatingItem?.['index'] === item.index - 1\"\n lines=\"full\"\n [button]=\"false\"\n >\n @if (ordenable) {\n @if (items?.length > 1 && !updatingItem) {\n <ion-reorder slot=\"start\">\n <ion-icon aria-hidden=\"true\" name=\"swap-vertical-outline\"></ion-icon>\n </ion-reorder>\n } @else {\n <div slot=\"start\">\n <ion-icon\n aria-hidden=\"true\"\n class=\"dcf-reorder-disabled\"\n size=\"small\"\n name=\"swap-vertical-outline\"\n disabled\n ></ion-icon>\n </div>\n }\n }\n\n <ion-label\n [color]=\"\n item.title === isUniqueError && !updatingItem?.[pk] === item.title\n ? 'danger'\n : ''\n \"\n >\n @if (ordenable) {\n {{ item.index }}.{{ item.title }}\n } @else {\n @if (item[pk]) {\n {{ pk }}: {{ item[pk] }} -\n }\n {{ item.title }}\n }\n @if (item.description?.length > 0) {\n <br />\n <ion-text class=\"dcf-subtitle\">{{ item.description }}</ion-text>\n }\n </ion-label>\n @if (item.info?.length || item.subinfo?.length) {\n <ion-note slot=\"end\">\n @if (item.info?.length) {\n {{ item.info }}\n <br />\n }\n @if (item.subinfo) {\n {{ item.subinfo }}\n }\n </ion-note>\n }\n <div slot=\"end\">\n @if (editable) {\n @if (!updatingItem || updatingItem?.[pk] !== item.title) {\n <ion-button\n fill=\"clear\"\n size=\"small\"\n (click)=\"handleUpdateItem($index)\"\n [attr.aria-label]=\"locale + '.edit_item' | translate\"\n >\n <ngx-decaf-icon\n slot=\"icon-only\"\n size=\"small\"\n name=\"ti-cash-edit\"\n [color]=\"!isDarkMode ? 'dark' : 'light'\"\n ></ngx-decaf-icon>\n </ion-button>\n }\n }\n @if (!updatingItem) {\n <ion-button\n fill=\"clear\"\n size=\"small\"\n color=\"danger\"\n (click)=\"handleRemoveItem($index)\"\n [attr.aria-label]=\"locale + '.remove_item' | translate\"\n >\n <ngx-decaf-icon\n slot=\"icon-only\"\n size=\"small\"\n name=\"ti-row-remove\"\n [color]=\"!isDarkMode ? 'dark' : 'light'\"\n />\n </ion-button>\n }\n </div>\n </ion-item>\n }\n </ion-reorder-group>\n </ion-list>\n }\n\n @if (isUniqueError) {\n <div\n class=\"dcf-not-unique-container dcf-animation dcf-animation-bottom-small dcf-animation-fast\"\n >\n <div class=\"dcf-grid dcf-grid-collapse dcf-width-1-1\">\n <div class=\"dcf-auto\" [attr.style]=\"'max-width: 50px'\">\n <ion-icon aria-hidden=\"true\" name=\"alert-circle-outline\"></ion-icon>\n </div>\n <div class=\"dcf-width-expand\">\n <ion-text color=\"danger\" class=\"dcf-text-small\">\n {{ locale + '.not_unique' | translate: { value: isUniqueError } }}\n </ion-text>\n </div>\n </div>\n </div>\n }\n\n @if (max) {\n <div class=\"dcf-width-1-1 dcf-max-message-container\">\n <ion-text\n class=\"dcf-text-small\"\n [color]=\"items.length !== max ? (!isDarkMode ? 'medium' : '') : 'primary'\"\n >\n {{\n locale + (items.length !== max ? '.max_items' : '.max_items_reached')\n | translate: { '0': max }\n }}\n </ion-text>\n </div>\n }\n\n <div class=\"dcf-grid dcf-grid-small dcf-flex dcf-buttons-container\">\n @if (updatingItem) {\n <div>\n <ion-button\n size=\"small\"\n fill=\"clear\"\n color=\"danger\"\n (click)=\"handleCancelUpdateItem()\"\n [attr.aria-label]=\"locale + '.cancel_update' | translate\"\n >\n {{ locale + '.cancel' | translate }}\n </ion-button>\n </div>\n <div>\n <ion-button\n size=\"small\"\n fill=\"clear\"\n (click)=\"handleCreateItem()\"\n [attr.aria-label]=\"locale + '.update_item' | translate\"\n >\n <ion-icon aria-hidden=\"true\" name=\"refresh-outline\" slot=\"start\"></ion-icon>\n {{ locale + '.update_item' | translate }}\n </ion-button>\n </div>\n } @else {\n @if (items.length < max || !max) {\n <div>\n <ion-button\n size=\"small\"\n fill=\"clear\"\n class=\"dcf-button-add\"\n [color]=\"isDarkMode ? 'light' : 'dark'\"\n (click)=\"handleCreateItem()\"\n [attr.aria-label]=\"locale + '.create_item' | translate\"\n >\n <!-- <ion-icon aria-hidden=\"true\" name=\"add-outline\" slot=\"start\"></ion-icon> -->\n <ngx-decaf-icon slot=\"icon-only\" name=\"ti-code-plus\" slot=\"start\" />\n {{\n locale +\n (required\n ? items.length\n ? '.add'\n : '.add_first'\n : items.length\n ? '.add'\n : isOpen\n ? '.add_first'\n : '.show_form') | translate\n }}\n </ion-button>\n </div>\n }\n }\n </div>\n }\n </div>\n </div>\n </div>\n} @else {\n @if (refreshing) {\n <div class=\"dcf-loading-container\">\n <ion-spinner name=\"crescent\" color=\"primary\"></ion-spinner>\n </div>\n } @else {\n <legend>{{ (title ? title : name) | translate }}</legend>\n @if (!items.length) {\n <div class=\"dcf-padding-xsmall\">\n <ion-text>{{ locale + '.empty' | translate }}</ion-text>\n </div>\n } @else {\n @for (item of items; track trackItemFn($index, item)) {\n <div class=\"dcf-fieldset-read-item\">\n <div>\n <ngx-decaf-layout\n [className]=\"operation\"\n [operation]=\"operation\"\n [flexMode]=\"item?.props?.flexMode ?? false\"\n [match]=\"false\"\n [gap]=\"'collapse'\"\n [children]=\"item || []\"\n [rows]=\"rows\"\n [cols]=\"cols\"\n [borders]=\"item?.props?.borders ?? false\"\n [breakpoint]=\"breakpoint ?? 'large'\"\n />\n </div>\n </div>\n }\n }\n }\n}\n", styles: ["fieldset{margin:0;padding:0;min-inline-size:auto}.dcf-loading-container{height:50%;display:flex;justify-content:center;align-items:center}.dcf-loading-container ion-spinner{width:30px;height:30px}.dcf-fieldset-read-item{border:1px solid var(--dcf-color-gray-3);border-radius:var(--dcf-border-radius-small);padding:var(--dcf-padding-small) var(--dcf-padding-xsmall);padding-bottom:0;margin-bottom:var(--dcf-margin-small)!important}.dcf-fieldset-component{border-radius:var(--dcf-border-radius-small);border:1px solid var(--dcf-color-gray-3);padding:var(--dcf-padding-small)}.dcf-fieldset-component.create ::ng-deep .dcf-item-readonly{display:none!important}.dcf-fieldset-component.dcf-open.dcf-empty .dcf-button-add{margin-top:1rem!important;margin-bottom:.15rem!important}.dcf-fieldset-component.dcf-blank{border-color:transparent;padding:var(--dcf-padding-xsmall) .25rem}.dcf-fieldset-component:not(.dcf-blank):not(.read):not(.delete){padding:var(--dcf-padding)}.dcf-fieldset-component *{overflow-x:hidden!important}.dcf-max-message-container{padding:0 .125rem;margin-bottom:var(--dcf-margin-xsmall)}legend,.dcf-title{font-weight:500;font-size:1rem;line-height:1.5rem;font-weight:600;margin:0;color:var(--ion-color-text)!important}.dcf-fieldset-content{margin-top:.25rem}.dcf-fieldset-content:not(.dcf-empty){padding:var(--dcf-padding-small) .25rem!important;margin-top:var(--dcf-margin-xsmall)}.dcf-fields-list{margin-top:var(--dcf-margin-small);padding-bottom:var(--dcf-padding)!important;max-height:200px}.dcf-fields-list ion-item{--min-height: 30px;--padding-top: 0rem;--padding-bottom: 0rem;--padding-start: .75rem;--padding-end: .5rem;--inner-padding-start: 0px !important;--inner-padding-end: 0px !important;--border-color: transparent;--background: rgba(var(--dcf-color-primary-rgb), .025) !important;border:1px solid var(--dcf-color-gray-3);border-radius:var(--dcf-border-radius-small);box-sizing:border-box}.dcf-fields-list ion-item:not(:last-child){margin-bottom:var(--dcf-margin-small)}.dcf-fields-list ion-item ion-icon.dcf-reorder-disabled{width:var(--dcf-spacement);transform:translatey(2px);color:var(--dcf-color-gray-4)}.dcf-fields-list ion-item.updating{--background: rgba(var(--dcf-color-primary-rgb), .1) !important}.dcf-fields-list ion-item.not-unique{--background: rgba(var(--dcf-color-danger-rgb), .05) !important}.dcf-fields-list ion-item .dcf-subtitle{font-size:.925rem;color:var(--ion-color-gray-6)}\n"] }]
|
|
9398
|
+
], template: "@if (['create', 'update'].includes(operation) || !multiple) {\n <div\n [attr.role]=\"['create', 'update'].includes(operation) ? 'group' : 'region'\"\n [class]=\"'dcf-fieldset-component ' + operation\"\n [class.dcf-blank]=\"!borders\"\n [class.dcf-empty]=\"!items?.length\"\n [class.dcf-open]=\"isOpen\"\n #component\n >\n <div class=\"dcf-width-1-1\">\n <div>\n <div class=\"dcf-grid dcf-grid-collapse dcf-flex dcf-flex-middle dcf-width-1-1\">\n <div class=\"dcf-width-expand\">\n <legend>{{ (title ? title : name) | translate }}</legend>\n </div>\n @if (!isRequired && ['create'].includes(operation) && multiple) {\n <div class=\"dcf-width-auto dcf-delete\">\n <ion-button\n fill=\"clear\"\n size=\"small\"\n (click)=\"handleClear($event)\"\n [class.dcf-invisible]=\"!isOpen\"\n [attr.aria-label]=\"\n (items?.length ? locale + '.clear_items' : locale + '.hidden_form') | translate\n \"\n >\n <ngx-decaf-icon\n slot=\"icon-only\"\n [name]=\"'ti-' + (items?.length ? 'trash' : 'eye-off')\"\n />\n </ion-button>\n </div>\n }\n </div>\n </div>\n <div\n class=\"dcf-fieldset-content\"\n [class.dcf-empty]=\"!items?.length && !isOpen\"\n slot=\"content\"\n >\n @if (activePage) {\n <div\n class=\"dcf-animation dcf-animation-slide-top-small dcf-animation-fast\"\n [class.dcf-disabled]=\"!activePage\"\n >\n <ngx-decaf-layout\n [className]=\"''\"\n [flexMode]=\"props.flexMode ?? false\"\n [match]=\"false\"\n [gap]=\"'small'\"\n [pk]=\"pk\"\n [modelId]=\"modelId\"\n [operation]=\"operation\"\n [children]=\"activePage || []\"\n [parentForm]=\"formGroup || parentForm\"\n [rows]=\"rows\"\n [cols]=\"cols\"\n [borders]=\"activePage?.borders ?? false\"\n [breakpoint]=\"breakpoint ?? 'large'\"\n [hidden]=\"items.length === max && !updatingItem\"\n />\n </div>\n }\n\n @if (multiple && ['create', 'update'].includes(operation)) {\n @if (multiple && items.length) {\n <ion-list class=\"dcf-fields-list\">\n <ion-reorder-group\n [formGroup]=\"formGroup.parent\"\n [disabled]=\"updatingItem\"\n (ionItemReorder)=\"handleReorderItems($any($event))\"\n #accordionComponent\n >\n @for (item of items; track item.index) {\n <ion-item\n [class.not-unique]=\"isUniqueError && item.title === isUniqueError\"\n [class.updating]=\"updatingItem?.['index'] === item.index - 1\"\n lines=\"full\"\n [button]=\"false\"\n >\n @if (ordenable) {\n @if (items?.length > 1 && !updatingItem) {\n <ion-reorder slot=\"start\">\n <ion-icon aria-hidden=\"true\" name=\"swap-vertical-outline\"></ion-icon>\n </ion-reorder>\n } @else {\n <div slot=\"start\">\n <ion-icon\n aria-hidden=\"true\"\n class=\"dcf-reorder-disabled\"\n size=\"small\"\n name=\"swap-vertical-outline\"\n disabled\n ></ion-icon>\n </div>\n }\n }\n\n <ion-label\n [color]=\"\n item.title === isUniqueError && !updatingItem?.[pk] === item.title\n ? 'danger'\n : ''\n \"\n >\n @if (ordenable) {\n {{ item.index }}.{{ item.title }}\n } @else {\n @if (item[pk]) {\n {{ pk }}: {{ item[pk] }} -\n }\n {{ item.title }}\n }\n @if (item.description?.length > 0) {\n <br />\n <ion-text class=\"dcf-subtitle\">{{ item.description }}</ion-text>\n }\n </ion-label>\n @if (item.info?.length || item.subinfo?.length) {\n <ion-note slot=\"end\">\n @if (item.info?.length) {\n {{ item.info }}\n <br />\n }\n @if (item.subinfo) {\n {{ item.subinfo }}\n }\n </ion-note>\n }\n <div slot=\"end\">\n @if (editable) {\n @if (!updatingItem || updatingItem?.[pk] !== item.title) {\n <ion-button\n fill=\"clear\"\n size=\"small\"\n (click)=\"handleUpdateItem($index)\"\n [attr.aria-label]=\"locale + '.edit_item' | translate\"\n >\n <ngx-decaf-icon\n slot=\"icon-only\"\n size=\"small\"\n name=\"ti-cash-edit\"\n [color]=\"!isDarkMode ? 'dark' : 'light'\"\n ></ngx-decaf-icon>\n </ion-button>\n }\n }\n @if (!updatingItem) {\n <ion-button\n fill=\"clear\"\n size=\"small\"\n color=\"danger\"\n (click)=\"handleRemoveItem($index)\"\n [attr.aria-label]=\"locale + '.remove_item' | translate\"\n >\n <ngx-decaf-icon\n slot=\"icon-only\"\n size=\"small\"\n name=\"ti-row-remove\"\n [color]=\"!isDarkMode ? 'dark' : 'light'\"\n />\n </ion-button>\n }\n </div>\n </ion-item>\n }\n </ion-reorder-group>\n </ion-list>\n }\n\n @if (isUniqueError) {\n <div\n class=\"dcf-not-unique-container dcf-animation dcf-animation-bottom-small dcf-animation-fast\"\n >\n <div class=\"dcf-grid dcf-grid-collapse dcf-width-1-1\">\n <div class=\"dcf-auto\" [attr.style]=\"'max-width: 50px'\">\n <ion-icon aria-hidden=\"true\" name=\"alert-circle-outline\"></ion-icon>\n </div>\n <div class=\"dcf-width-expand\">\n <ion-text color=\"danger\" class=\"dcf-text-small\">\n {{ locale + '.not_unique' | translate: { value: isUniqueError } }}\n </ion-text>\n </div>\n </div>\n </div>\n }\n\n @if (max) {\n <div class=\"dcf-width-1-1 dcf-max-message-container\">\n <ion-text\n class=\"dcf-text-small\"\n [color]=\"items.length !== max ? (!isDarkMode ? 'medium' : '') : 'primary'\"\n >\n {{\n locale + (items.length !== max ? '.max_items' : '.max_items_reached')\n | translate: { '0': max }\n }}\n </ion-text>\n </div>\n }\n\n <div class=\"dcf-grid dcf-grid-small dcf-flex dcf-buttons-container\">\n @if (updatingItem) {\n <div>\n <ion-button\n size=\"small\"\n fill=\"clear\"\n color=\"danger\"\n (click)=\"handleCancelUpdateItem()\"\n [attr.aria-label]=\"locale + '.cancel_update' | translate\"\n >\n {{ locale + '.cancel' | translate }}\n </ion-button>\n </div>\n <div>\n <ion-button\n size=\"small\"\n fill=\"clear\"\n (click)=\"handleCreateItem()\"\n [attr.aria-label]=\"locale + '.update_item' | translate\"\n >\n <ion-icon aria-hidden=\"true\" name=\"refresh-outline\" slot=\"start\"></ion-icon>\n {{ locale + '.update_item' | translate }}\n </ion-button>\n </div>\n } @else {\n @if (items.length < max || !max) {\n <div>\n <ion-button\n size=\"small\"\n fill=\"clear\"\n class=\"dcf-button-add\"\n [color]=\"isDarkMode ? 'light' : 'dark'\"\n (click)=\"handleCreateItem()\"\n [attr.aria-label]=\"locale + '.create_item' | translate\"\n >\n <!-- <ion-icon aria-hidden=\"true\" name=\"add-outline\" slot=\"start\"></ion-icon> -->\n <ngx-decaf-icon slot=\"icon-only\" name=\"ti-code-plus\" slot=\"start\" />\n {{\n locale +\n (required\n ? items.length\n ? '.add'\n : '.add_first'\n : items.length\n ? '.add'\n : isOpen\n ? '.add_first'\n : '.show_form') | translate\n }}\n </ion-button>\n </div>\n }\n }\n </div>\n }\n </div>\n </div>\n </div>\n} @else {\n @if (refreshing) {\n <div class=\"dcf-loading-container\">\n <ion-spinner name=\"crescent\" color=\"primary\"></ion-spinner>\n </div>\n } @else {\n <legend>{{ (title ? title : name) | translate }}</legend>\n @if (!items.length) {\n <div class=\"dcf-padding-xsmall\">\n <ion-text>{{ locale + '.empty' | translate }}</ion-text>\n </div>\n } @else {\n @for (item of items; track trackItemFn($index, item)) {\n <div class=\"dcf-fieldset-read-item\">\n <div>\n <ngx-decaf-layout\n [className]=\"operation\"\n [operation]=\"operation\"\n [pk]=\"pk\"\n [model]=\"model\"\n [modelId]=\"modelId\"\n [flexMode]=\"item?.props?.flexMode ?? false\"\n [match]=\"false\"\n [gap]=\"'collapse'\"\n [children]=\"item || []\"\n [rows]=\"rows\"\n [cols]=\"cols\"\n [borders]=\"item?.props?.borders ?? false\"\n [breakpoint]=\"breakpoint ?? 'large'\"\n />\n </div>\n </div>\n }\n }\n }\n}\n", styles: ["fieldset{margin:0;padding:0;min-inline-size:auto}.dcf-loading-container{height:50%;display:flex;justify-content:center;align-items:center}.dcf-loading-container ion-spinner{width:30px;height:30px}.dcf-fieldset-read-item{border:1px solid var(--dcf-color-gray-3);border-radius:var(--dcf-border-radius-small);padding:var(--dcf-padding-small) var(--dcf-padding-xsmall);padding-bottom:0;margin-bottom:var(--dcf-margin-small)!important}.dcf-fieldset-component{border-radius:var(--dcf-border-radius-small);border:1px solid var(--dcf-color-gray-3);padding:var(--dcf-padding-small)}.dcf-fieldset-component.create ::ng-deep .dcf-item-readonly{display:none!important}.dcf-fieldset-component.dcf-open.dcf-empty .dcf-button-add{margin-top:1rem!important;margin-bottom:.15rem!important}.dcf-fieldset-component.dcf-blank{border-color:transparent;padding:var(--dcf-padding-xsmall) .25rem}.dcf-fieldset-component:not(.dcf-blank):not(.read):not(.delete){padding:var(--dcf-padding)}.dcf-fieldset-component *{overflow-x:hidden!important}.dcf-max-message-container{padding:0 .125rem;margin-bottom:var(--dcf-margin-xsmall)}legend,.dcf-title{font-weight:500;font-size:1rem;line-height:1.5rem;font-weight:600;margin:0;color:var(--ion-color-text)!important}.dcf-fieldset-content{margin-top:.25rem}.dcf-fieldset-content:not(.dcf-empty){padding:var(--dcf-padding-small) .25rem!important;margin-top:var(--dcf-margin-xsmall)}.dcf-fields-list{margin-top:var(--dcf-margin-small);padding-bottom:var(--dcf-padding)!important;max-height:200px}.dcf-fields-list ion-item{--min-height: 30px;--padding-top: 0rem;--padding-bottom: 0rem;--padding-start: .75rem;--padding-end: .5rem;--inner-padding-start: 0px !important;--inner-padding-end: 0px !important;--border-color: transparent;--background: rgba(var(--dcf-color-primary-rgb), .025) !important;border:1px solid var(--dcf-color-gray-3);border-radius:var(--dcf-border-radius-small);box-sizing:border-box}.dcf-fields-list ion-item:not(:last-child){margin-bottom:var(--dcf-margin-small)}.dcf-fields-list ion-item ion-icon.dcf-reorder-disabled{width:var(--dcf-spacement);transform:translatey(2px);color:var(--dcf-color-gray-4)}.dcf-fields-list ion-item.updating{--background: rgba(var(--dcf-color-primary-rgb), .1) !important}.dcf-fields-list ion-item.not-unique{--background: rgba(var(--dcf-color-danger-rgb), .05) !important}.dcf-fields-list ion-item .dcf-subtitle{font-size:.925rem;color:var(--ion-color-gray-6)}\n"] }]
|
|
9437
9399
|
}], ctorParameters: () => [], propDecorators: { formControl: [{
|
|
9438
9400
|
type: Input
|
|
9439
9401
|
}], customTypes: [{
|
|
@@ -11273,7 +11235,7 @@ let ListComponent = class ListComponent extends NgxComponentDirective {
|
|
|
11273
11235
|
* period. This prevents multiple rapid clicks from triggering multiple events.
|
|
11274
11236
|
*
|
|
11275
11237
|
* @private
|
|
11276
|
-
* @type {Subject<CustomEvent |
|
|
11238
|
+
* @type {Subject<CustomEvent | IListItemCustomEvent | IBaseCustomEvent>}
|
|
11277
11239
|
* @memberOf ListComponent
|
|
11278
11240
|
*/
|
|
11279
11241
|
this.clickItemSubject = new Subject();
|
|
@@ -11402,7 +11364,7 @@ let ListComponent = class ListComponent extends NgxComponentDirective {
|
|
|
11402
11364
|
}
|
|
11403
11365
|
const mapperFn = value?.['valueParserFn'] || undefined;
|
|
11404
11366
|
if (typeof mapperFn === 'function') {
|
|
11405
|
-
const value = await mapperFn(
|
|
11367
|
+
const value = await mapperFn(this, key);
|
|
11406
11368
|
if (typeof value === Primitives.STRING) {
|
|
11407
11369
|
mapper[value] = key;
|
|
11408
11370
|
}
|
|
@@ -11473,8 +11435,7 @@ let ListComponent = class ListComponent extends NgxComponentDirective {
|
|
|
11473
11435
|
this.data = !this.model
|
|
11474
11436
|
? await this.getFromRequest(!!event, start, limit)
|
|
11475
11437
|
: (await this.getFromModel(!!event));
|
|
11476
|
-
|
|
11477
|
-
this.refreshEventEmit(this.data);
|
|
11438
|
+
this.refreshEventEmit(this.data);
|
|
11478
11439
|
if (this.type === ListComponentsTypes.INFINITE) {
|
|
11479
11440
|
if (this.page === this.pages) {
|
|
11480
11441
|
if (event?.target)
|
|
@@ -11611,12 +11572,12 @@ let ListComponent = class ListComponent extends NgxComponentDirective {
|
|
|
11611
11572
|
* debounced click subject. This allows the component to respond to clicks on
|
|
11612
11573
|
* list items regardless of where they originate from.
|
|
11613
11574
|
*
|
|
11614
|
-
* @param {
|
|
11615
|
-
* @returns {void}
|
|
11575
|
+
* @param {IListItemCustomEvent | IBaseCustomEvent} event - The click event
|
|
11576
|
+
* @returns {Promise<void>}
|
|
11616
11577
|
*
|
|
11617
11578
|
* @memberOf ListComponent
|
|
11618
11579
|
*/
|
|
11619
|
-
handleClick(event) {
|
|
11580
|
+
async handleClick(event) {
|
|
11620
11581
|
this.clickItemSubject.next(event);
|
|
11621
11582
|
}
|
|
11622
11583
|
/**
|
|
@@ -11717,7 +11678,7 @@ let ListComponent = class ListComponent extends NgxComponentDirective {
|
|
|
11717
11678
|
* This extracts the relevant data from the event and passes it to parent components.
|
|
11718
11679
|
*
|
|
11719
11680
|
* @private
|
|
11720
|
-
* @param {
|
|
11681
|
+
* @param {IListItemCustomEvent | IBaseCustomEvent} event - The click event
|
|
11721
11682
|
* @returns {void}
|
|
11722
11683
|
*
|
|
11723
11684
|
* @memberOf ListComponent
|
|
@@ -12093,7 +12054,9 @@ let ListComponent = class ListComponent extends NgxComponentDirective {
|
|
|
12093
12054
|
else {
|
|
12094
12055
|
let val;
|
|
12095
12056
|
for (const _value of arrayValue)
|
|
12096
|
-
val = !val
|
|
12057
|
+
val = !val
|
|
12058
|
+
? item[_value]
|
|
12059
|
+
: (typeof val === Primitives.STRING ? JSON.parse(val) : val)[_value];
|
|
12097
12060
|
if (isValidDate(new Date(val)))
|
|
12098
12061
|
val = `${formatDate(val)}`;
|
|
12099
12062
|
accum[key] = val === null || val === undefined ? value : val;
|
|
@@ -12149,7 +12112,7 @@ let ListComponent = class ListComponent extends NgxComponentDirective {
|
|
|
12149
12112
|
.join(', ');
|
|
12150
12113
|
}
|
|
12151
12114
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12152
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: ListComponent, isStandalone: true, selector: "ngx-decaf-list", inputs: { type: "type", showSearchbar: "showSearchbar", searchbarPlaceholder: "searchbarPlaceholder", data: "data", source: "source", loadMoreData: "loadMoreData", lines: "lines", inset: "inset", scrollThreshold: "scrollThreshold", scrollPosition: "scrollPosition", loadingText: "loadingText", showRefresher: "showRefresher", createButton: "createButton", loadingSpinner: "loadingSpinner", enableFilter: "enableFilter", disableSort: "disableSort", empty: "empty" }, outputs: { clickEvent: "clickEvent" }, host: { listeners: { "window:ListItemClickEvent": "handleClick($event)", "window:searchbarEvent": "handleSearch($event)" }, properties: { "attr.id": "uid" } }, usesInheritance: true, ngImport: i0, template: "@if (showRefresher) {\n <ion-refresher\n slot=\"fixed\"\n [pullFactor]=\"1\"\n [pullMin]=\"100\"\n [pullMax]=\"200\"\n (ionRefresh)=\"handleRefresh($event)\"\n >\n <ion-refresher-content />\n </ion-refresher>\n}\n\n@if (showSearchbar) {\n <div [hidden]=\"!data?.length && !searching\">\n <div class=\"dcf-grid dcf-grid-small dcf-grid-actions\">\n <div class=\"dcf-width-expand@m dcf-width-1-1\">\n @if (model && enableFilter) {\n @if (data?.length || searching) {\n <ngx-decaf-filter\n [model]=\"model\"\n [indexes]=\"indexes ?? []\"\n [sortDirection]=\"sortDirection\"\n [disableSort]=\"disableSort\"\n (filterEvent)=\"handleFilter($event)\"\n (searchEvent)=\"handleSearch($event)\"\n />\n }\n } @else {\n <ngx-decaf-searchbar\n [placeholder]=\"searchbarPlaceholder\"\n [emitEventToWindow]=\"false\"\n [debounce]=\"500\"\n (searchEvent)=\"handleSearch($event)\"\n />\n }\n </div>\n @if (createButton) {\n <div\n class=\"dcf-width-auto@m dcf-button-container dcf-width-1-1 dcf-flex-middle dcf-flex dcf-flex-center dcf-flex-right@m\"\n >\n <div>\n <ion-button expand=\"block\" (click)=\"changeOperation(OperationKeys.CREATE)\">\n Create\n </ion-button>\n </div>\n </div>\n }\n </div>\n </div>\n}\n@if (initialized && data?.length) {\n <ion-list [id]=\"uid\" [inset]=\"inset\" [lines]=\"lines\">\n @if (item?.tag) {\n @for (child of items; track trackItemFn($index, child)) {\n <ngx-decaf-component-renderer\n [tag]=\"item.tag\"\n (listenEvent)=\"handleEvent($event)\"\n [globals]=\"{\n item: child,\n mapper: mapper,\n route: isModalChild ? route : undefined,\n model: child,\n isModalChild: child.isModalChild,\n emitEvent: child.emitEvent,\n }\"\n ></ngx-decaf-component-renderer>\n }\n } @else {\n <ng-content></ng-content>\n }\n </ion-list>\n\n @if (loadMoreData) {\n @if (pages > 0 && type === 'paginated' && !searchValue?.length) {\n <ngx-decaf-pagination\n [totalPages]=\"pages\"\n [current]=\"page\"\n (clickEvent)=\"handlePaginate($event)\"\n />\n } @else {\n <ion-infinite-scroll\n [class]=\"searchValue?.length ? 'dcf-hidden' : ''\"\n [position]=\"scrollPosition\"\n [threshold]=\"scrollThreshold\"\n (ionInfinite)=\"handleRefresh($event)\"\n >\n <ion-infinite-scroll-content\n [loadingSpinner]=\"loadingSpinner\"\n [loadingText]=\"loadingText\"\n />\n </ion-infinite-scroll>\n }\n }\n} @else {\n @if (refreshing) {\n @for (skl of skeletonData; track $index) {\n <ion-item>\n <ion-thumbnail slot=\"start\">\n <ion-skeleton-text [animated]=\"true\"></ion-skeleton-text>\n </ion-thumbnail>\n <ion-label>\n <ion-skeleton-text [animated]=\"true\"></ion-skeleton-text>\n <ion-text class=\"date\" style=\"width: 20%\">\n <ion-skeleton-text [animated]=\"true\"></ion-skeleton-text>\n </ion-text>\n </ion-label>\n </ion-item>\n }\n } @else {\n @if (!searching) {\n <ngx-decaf-empty-state\n [title]=\"empty.title ? (locale + '.' + empty.title | translate) : ''\"\n [model]=\"empty?.showButton ? model : undefined\"\n [route]=\"route\"\n [modelId]=\"modelId\"\n [buttonLink]=\"empty?.link ?? undefined\"\n [borders]=\"borders\"\n [icon]=\"(item?.icon ?? 'folder-open-outline') || empty.icon\"\n className=\"dcf-empty-data\"\n [subtitle]=\"empty.subtitle ? (locale + '.' + empty.subtitle | translate) : ''\"\n />\n } @else {\n <ngx-decaf-empty-state\n icon=\"search-outline\"\n [model]=\"empty?.showButton ? model : undefined\"\n [route]=\"route\"\n [modelId]=\"modelId\"\n [borders]=\"borders\"\n [operations]=\"operations\"\n [body]=\"'small'\"\n [translatable]=\"true\"\n [title]=\"locale + '.search.title' | translate\"\n [subtitle]=\"locale + '.search.subtitle' | translate: { '0': parseSearchValue() }\"\n [searchValue]=\"searchValue\"\n />\n }\n }\n}\n", styles: ["ion-infinite-scroll{max-height:50px}ion-infinite-scroll:not(.infinite-scroll-loading) ::ng-deep{max-height:1.5rem}ion-infinite-scroll ::ng-deep ion-spinner{--color: var(--dcf-color-primary);padding-top:1rem}@media (max-width: 768px){#end,[slot=end]{display:none!important}}.dcf-grid-actions{padding:0px var(--dcf-padding-small);padding-bottom:0}.dcf-grid-actions .dcf-button-container{margin-top:var(--dcf-margin-small)}@media (max-width: 768px){.dcf-grid-actions .dcf-button-container{width:100%!important}.dcf-grid-actions .dcf-button-container *{width:calc(100% - 5px)!important;display:inline-block;margin-top:0!important;margin-bottom:var(--dcf-margin-xsmall)!important}}.dcf-grid-actions>div:only-child{width:100%}\n"], dependencies: [{ kind: "component", type: IonRefresher, selector: "ion-refresher", inputs: ["closeDuration", "disabled", "mode", "pullFactor", "pullMax", "pullMin", "snapbackDuration"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: PaginationComponent, selector: "ngx-decaf-pagination", inputs: ["totalPages", "current"], outputs: ["clickEvent"] }, { kind: "component", type: IonList, selector: "ion-list", inputs: ["inset", "lines", "mode"] }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonThumbnail, selector: "ion-thumbnail" }, { kind: "component", type: IonSkeletonText, selector: "ion-skeleton-text", inputs: ["animated"] }, { kind: "component", type: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: IonText, selector: "ion-text", inputs: ["color", "mode"] }, { kind: "component", type: IonRefresherContent, selector: "ion-refresher-content", inputs: ["pullingIcon", "pullingText", "refreshingSpinner", "refreshingText"] }, { kind: "component", type: IonInfiniteScroll, selector: "ion-infinite-scroll", inputs: ["disabled", "position", "threshold"] }, { kind: "component", type: IonInfiniteScrollContent, selector: "ion-infinite-scroll-content", inputs: ["loadingSpinner", "loadingText"] }, { kind: "component", type: SearchbarComponent, selector: "ngx-decaf-searchbar", inputs: ["autocomplete", "autocorrect", "animated", "buttonCancelText", "clearIcon", "color", "debounce", "disabled", "enterkeyhint", "inputmode", "placeholder", "searchIcon", "showCancelButton", "showClearButton", "spellcheck", "type", "value", "queryKeys", "isVisible", "wrapper", "wrapperColor", "emitEventToWindow"], outputs: ["searchEvent"] }, { kind: "component", type: EmptyStateComponent, selector: "ngx-decaf-empty-state", inputs: ["title", "titleColor", "subtitle", "subtitleColor", "showIcon", "icon", "iconSize", "iconColor", "buttonLink", "buttonText", "buttonFill", "buttonColor", "buttonSize", "searchValue"] }, { kind: "component", type: FilterComponent, selector: "ngx-decaf-filter", inputs: ["multiple", "conditions", "sortOptions", "disableSort"], outputs: ["filterEvent", "searchEvent"] }, { kind: "component", type: ComponentRendererComponent, selector: "ngx-decaf-component-renderer", inputs: ["tag", "children", "projectable", "parent"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
12115
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: ListComponent, isStandalone: true, selector: "ngx-decaf-list", inputs: { type: "type", showSearchbar: "showSearchbar", searchbarPlaceholder: "searchbarPlaceholder", data: "data", source: "source", loadMoreData: "loadMoreData", lines: "lines", inset: "inset", scrollThreshold: "scrollThreshold", scrollPosition: "scrollPosition", loadingText: "loadingText", showRefresher: "showRefresher", createButton: "createButton", loadingSpinner: "loadingSpinner", enableFilter: "enableFilter", disableSort: "disableSort", empty: "empty" }, outputs: { clickEvent: "clickEvent" }, host: { listeners: { "window:ListItemClickEvent": "handleClick($event)", "window:searchbarEvent": "handleSearch($event)" }, properties: { "attr.id": "uid" } }, usesInheritance: true, ngImport: i0, template: "@if (showRefresher) {\n <ion-refresher\n slot=\"fixed\"\n [pullFactor]=\"1\"\n [pullMin]=\"100\"\n [pullMax]=\"200\"\n (ionRefresh)=\"handleRefresh($event)\"\n >\n <ion-refresher-content />\n </ion-refresher>\n}\n\n@if (showSearchbar) {\n <div [hidden]=\"!data?.length && !searching\">\n <div class=\"dcf-grid dcf-grid-small dcf-grid-actions\">\n <div class=\"dcf-width-expand@m dcf-width-1-1\">\n @if (model && enableFilter) {\n @if (data?.length || searching) {\n <ngx-decaf-filter\n [model]=\"model\"\n [indexes]=\"indexes ?? []\"\n [sortDirection]=\"sortDirection\"\n [disableSort]=\"disableSort\"\n (filterEvent)=\"handleFilter($event)\"\n (searchEvent)=\"handleSearch($event)\"\n />\n }\n } @else {\n <ngx-decaf-searchbar\n [placeholder]=\"searchbarPlaceholder\"\n [emitEventToWindow]=\"false\"\n [debounce]=\"500\"\n (searchEvent)=\"handleSearch($event)\"\n />\n }\n </div>\n @if (createButton) {\n <div\n class=\"dcf-width-auto@m dcf-button-container dcf-width-1-1 dcf-flex-middle dcf-flex dcf-flex-center dcf-flex-right@m\"\n >\n <div>\n <ion-button expand=\"block\" (click)=\"changeOperation(OperationKeys.CREATE)\">\n Create\n </ion-button>\n </div>\n </div>\n }\n </div>\n </div>\n}\n@if (initialized && data?.length) {\n <ion-list [id]=\"uid\" [inset]=\"inset\" [lines]=\"lines\">\n @if (item?.tag) {\n @for (child of items; track trackItemFn($index, child)) {\n <ngx-decaf-component-renderer\n [tag]=\"item.tag\"\n (listenEvent)=\"handleEvent($event)\"\n [globals]=\"{\n item: child,\n mapper: mapper,\n route: isModalChild ? route : undefined,\n model: child,\n isModalChild: child.isModalChild,\n emitEvent: child.emitEvent,\n }\"\n ></ngx-decaf-component-renderer>\n }\n } @else {\n <ng-content></ng-content>\n }\n </ion-list>\n\n @if (loadMoreData) {\n @if (pages > 0 && type === 'paginated' && !searchValue?.length) {\n <ngx-decaf-pagination\n [totalPages]=\"pages\"\n [current]=\"page\"\n (clickEvent)=\"handlePaginate($event)\"\n />\n } @else {\n <ion-infinite-scroll\n [class]=\"searchValue?.length ? 'dcf-hidden' : ''\"\n [position]=\"scrollPosition\"\n [threshold]=\"scrollThreshold\"\n (ionInfinite)=\"handleRefresh($event)\"\n >\n <ion-infinite-scroll-content\n [loadingSpinner]=\"loadingSpinner\"\n [loadingText]=\"loadingText\"\n />\n </ion-infinite-scroll>\n }\n }\n} @else {\n @if (refreshing) {\n @for (skl of skeletonData; track $index) {\n <ion-item>\n <ion-thumbnail slot=\"start\">\n <ion-skeleton-text [animated]=\"true\"></ion-skeleton-text>\n </ion-thumbnail>\n <ion-label>\n <ion-skeleton-text [animated]=\"true\"></ion-skeleton-text>\n <ion-text class=\"date\" style=\"width: 20%\">\n <ion-skeleton-text [animated]=\"true\"></ion-skeleton-text>\n </ion-text>\n </ion-label>\n </ion-item>\n }\n } @else {\n @if (!searching) {\n <ngx-decaf-empty-state\n [title]=\"empty.title ? (locale + '.' + empty.title | translate) : ''\"\n [model]=\"empty?.showButton ? model : undefined\"\n [route]=\"route\"\n [modelId]=\"modelId\"\n [buttonLink]=\"empty?.link ?? undefined\"\n [borders]=\"borders\"\n [icon]=\"(item?.icon ?? 'folder-open-outline') || empty.icon\"\n className=\"dcf-empty-data\"\n [subtitle]=\"empty.subtitle ? (locale + '.' + empty.subtitle | translate) : ''\"\n />\n } @else {\n <ngx-decaf-empty-state\n icon=\"search-outline\"\n [model]=\"empty?.showButton ? model : undefined\"\n [route]=\"route\"\n [modelId]=\"modelId\"\n [borders]=\"borders\"\n [operations]=\"operations\"\n [body]=\"'small'\"\n [translatable]=\"true\"\n [title]=\"locale + '.search.title' | translate\"\n [subtitle]=\"locale + '.search.subtitle' | translate: { '0': parseSearchValue() }\"\n [searchValue]=\"searchValue\"\n />\n }\n }\n}\n", styles: ["ion-infinite-scroll{max-height:50px}ion-infinite-scroll:not(.infinite-scroll-loading) ::ng-deep{max-height:1.5rem}ion-infinite-scroll ::ng-deep ion-spinner{--color: var(--dcf-color-primary);padding-top:1rem}@media (max-width: 768px){#end,[slot=end]{display:none!important}}.dcf-grid-actions{padding:0px var(--dcf-padding-small);padding-bottom:0}.dcf-grid-actions .dcf-button-container{margin-top:var(--dcf-margin-small)}@media (max-width: 768px){.dcf-grid-actions .dcf-button-container{width:100%!important}.dcf-grid-actions .dcf-button-container *{width:calc(100% - 5px)!important;display:inline-block;margin-top:0!important;margin-bottom:var(--dcf-margin-xsmall)!important}}.dcf-grid-actions>div:only-child{width:100%}\n"], dependencies: [{ kind: "component", type: IonRefresher, selector: "ion-refresher", inputs: ["closeDuration", "disabled", "mode", "pullFactor", "pullMax", "pullMin", "snapbackDuration"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: PaginationComponent, selector: "ngx-decaf-pagination", inputs: ["totalPages", "current"], outputs: ["clickEvent"] }, { kind: "component", type: IonList, selector: "ion-list", inputs: ["inset", "lines", "mode"] }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonThumbnail, selector: "ion-thumbnail" }, { kind: "component", type: IonSkeletonText, selector: "ion-skeleton-text", inputs: ["animated"] }, { kind: "component", type: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: IonText, selector: "ion-text", inputs: ["color", "mode"] }, { kind: "component", type: IonRefresherContent, selector: "ion-refresher-content", inputs: ["pullingIcon", "pullingText", "refreshingSpinner", "refreshingText"] }, { kind: "component", type: IonInfiniteScroll, selector: "ion-infinite-scroll", inputs: ["disabled", "position", "threshold"] }, { kind: "component", type: IonInfiniteScrollContent, selector: "ion-infinite-scroll-content", inputs: ["loadingSpinner", "loadingText"] }, { kind: "component", type: SearchbarComponent, selector: "ngx-decaf-searchbar", inputs: ["autocomplete", "autocorrect", "animated", "buttonCancelText", "clearIcon", "color", "debounce", "disabled", "enterkeyhint", "inputmode", "placeholder", "searchIcon", "showCancelButton", "showClearButton", "spellcheck", "type", "value", "queryKeys", "isVisible", "wrapper", "wrapperColor", "emitEventToWindow"], outputs: ["searchEvent"] }, { kind: "component", type: EmptyStateComponent, selector: "ngx-decaf-empty-state", inputs: ["title", "titleColor", "subtitle", "subtitleColor", "showIcon", "icon", "iconSize", "iconColor", "buttonLink", "buttonText", "buttonFill", "buttonColor", "buttonSize", "searchValue"] }, { kind: "component", type: FilterComponent, selector: "ngx-decaf-filter", inputs: ["multiple", "conditions", "sortOptions", "disableSort"], outputs: ["filterEvent", "searchEvent"] }, { kind: "component", type: ComponentRendererComponent, selector: "ngx-decaf-component-renderer", inputs: ["tag", "children", "projectable", "pk", "parent"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
12153
12116
|
};
|
|
12154
12117
|
ListComponent = __decorate([
|
|
12155
12118
|
Dynamic(),
|
|
@@ -12311,7 +12274,7 @@ let ListItemComponent = class ListItemComponent extends NgxComponentDirective {
|
|
|
12311
12274
|
* are performed on it. The emitted event contains information about the action,
|
|
12312
12275
|
* the item data, and other relevant context for parent components to handle.
|
|
12313
12276
|
*
|
|
12314
|
-
* @type {EventEmitter<
|
|
12277
|
+
* @type {EventEmitter<IListItemCustomEvent>}
|
|
12315
12278
|
* @memberOf ListItemComponent
|
|
12316
12279
|
*/
|
|
12317
12280
|
this.clickEvent = new EventEmitter();
|
|
@@ -12425,7 +12388,7 @@ let ListItemComponent = class ListItemComponent extends NgxComponentDirective {
|
|
|
12425
12388
|
*
|
|
12426
12389
|
* @memberOf ListItemComponent
|
|
12427
12390
|
*/
|
|
12428
|
-
async handleAction(
|
|
12391
|
+
async handleAction(event, action, target) {
|
|
12429
12392
|
event.stopImmediatePropagation();
|
|
12430
12393
|
if (this.actionMenuOpen) {
|
|
12431
12394
|
await this.actionMenuComponent.dismiss();
|
|
@@ -12580,7 +12543,7 @@ let ListItemComponent = class ListItemComponent extends NgxComponentDirective {
|
|
|
12580
12543
|
this.actionMenuOpen = true;
|
|
12581
12544
|
}
|
|
12582
12545
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12583
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: ListItemComponent, isStandalone: true, selector: "ngx-decaf-list-item", inputs: { actionsType: "actionsType", lines: "lines", item: "item", icon: "icon", iconSlot: "iconSlot", button: "button", title: "title", description: "description", info: "info", subinfo: "subinfo", emitEvent: "emitEvent" }, outputs: { clickEvent: "clickEvent" }, host: { listeners: { "window:resize": "enableSlideItems($event)" }, properties: { "attr.id": "uid" } }, viewQueries: [{ propertyName: "component", first: true, predicate: ["component"], descendants: true, read: ElementRef }, { propertyName: "actionMenuComponent", first: true, predicate: ["actionMenuComponent"], descendants: true }], usesInheritance: true, ngImport: i0, template: "\n@if (title || description) {\n <ion-item-sliding>\n <ion-item\n [id]=\"uid\"\n [lines]=\"lines\"\n [button]=\"!operations?.length ? false : button\"\n [class]=\"className\"\n (click)=\"operations?.includes(OperationKeys.READ) ? handleAction(OperationKeys.READ, $event, component) : ''\"\n #component\n >\n @if (icon && lines !== 'inset') {\n <div class=\"dcf-icon-container dcf-width-auto\" [slot]=\"iconSlot\">\n <ngx-decaf-icon slot=\"icon-only\" [name]=\"icon\" />\n </div>\n }\n <div class=\"dcf-width-expand\">\n <div class=\"dcf-flex dcf-flex-middle dcf-grid-collapse\" dcf-grid>\n @if (icon && lines === 'inset') {\n <div class=\"dcf-icon\" [slot]=\"iconSlot\">\n <ion-avatar>\n <ion-icon aria-hidden=\"true\" name=\"reader-outline\" size=\"default\" />\n </ion-avatar>\n </div>\n }\n <div class=\"dcf-width-expand@s dcf-width-1-1 dcf-label\">\n @if (title) {\n <ion-label class=\"dcf-item-title\">\n {{ title | translate }}\n </ion-label>\n }\n @if (description) {\n <div class=\"dcf-description\" [innerHTML]=\"description\"></div>\n }\n </div>\n @if (info || subinfo) {\n <div class=\"dcf-width-auto@s dcf-width-expand dcf-info dcf-flex dcf-flex-right@s\">\n <div>\n @if (info) {\n <span [innerHTML]=\"info\"></span>\n }\n @if (subinfo) {\n <div class=\"dcf-subinfo dcf-text-truncate\" [innerHTML]=\"subinfo\" ></div>\n }\n </div>\n </div>\n }\n\n <div class=\"dcf-width-auto dcf-flex dcf-flex-middle dcf-flex-right\">\n @if ((operations?.includes(OperationKeys.DELETE) || operations?.includes(OperationKeys.UPDATE)) && uid) {\n <div class=\"dcf-visible@s\" id=\"dcf-actions\">\n @if(actionsType === 'popover') {\n <ion-button shape=\"round\" fill=\"clear\" color=\"primary\" (click)=\"presentActionsMenu($event)\" [attr.aria-label]=\"locale+'.actions' | translate\">\n <ion-icon slot=\"icon-only\" aria-hidden=\"true\" name=\"ellipsis-vertical-outline\" />\n </ion-button>\n <ion-popover\n #actionMenuComponent\n side=\"bottom\"\n alignment=\"left\"\n [isOpen]=\"actionMenuOpen\"\n (didDismiss)=\"actionMenuOpen = false\">\n <ng-template>\n <ion-content class=\"ion-padding\">\n <ion-list lines=\"none\">\n <ion-list-header>\n <h4 class=\"dcf-text-capitalize\" [innerHTML]=\"'actions' | translate\"></h4>\n </ion-list-header>\n @for (operation of [OperationKeys.UPDATE, OperationKeys.DELETE]; track operation) {\n @if (operations?.includes(operation)) {\n <ion-item [button]=\"true\" (click)=\"handleAction(operation, $event, component)\">\n <div slot=\"start\">\n @if (operation === OperationKeys.UPDATE) {\n <ngx-decaf-icon [button]=\"true\" slot=\"icon-only\" name=\"ti-edit\" />\n } @else {\n <ngx-decaf-icon [button]=\"true\" slot=\"icon-only\" color=\"danger\" name=\"ti-trash\" />\n }\n </div>\n <ion-label class=\"dcf-text-capitalize\">{{ operation | translate }}</ion-label>\n </ion-item>\n }\n }\n </ion-list>\n </ion-content>\n </ng-template>\n </ion-popover>\n } @else {\n <div class=\"dcf-grid-actions dcf-grid dcf-grid-small dcf-flex \">\n @for (operation of [OperationKeys.UPDATE, OperationKeys.DELETE]; track operation) {\n <div>\n @if (operations?.includes(operation)) {\n <ngx-decaf-icon\n (click)=\"handleAction(operation, $event, component)\"\n fill=\"clear\" shape=\"round\"\n [attr.aria-label]=\"(locale +'.operations.' + operation) | translate\"\n [button]=\"true\"\n slot=\"icon-only\"\n [color]=\"operation === OperationKeys.UPDATE ? 'dark' : 'danger'\"\n [name]=\"operation === OperationKeys.UPDATE ? 'ti-edit' : 'ti-trash'\"\n />\n\n }\n </div>\n }\n </div>\n }\n\n </div>\n }\n @if (windowWidth > 639) {\n <div id=\"end\">\n <ng-content select=\"[slot='end']\"></ng-content>\n </div>\n }\n </div>\n </div>\n </div>\n </ion-item>\n @if (showSlideItems && uid) {\n <ion-item-options side=\"end\" (ionSwipe)=\"operations.length === 1 ? handleAction(operations[0], $event, component) : ''\">\n @if (operations?.includes(OperationKeys.UPDATE)) {\n <ion-item-option class=\"dcf-update\" (click)=\"handleAction(OperationKeys.UPDATE, $event, component)\" [expandable]=\"operations.length === 1\">\n <ion-icon aria-hidden=\"true\" slot=\"icon-only\" name=\"create-outline\" />\n </ion-item-option>\n }\n @if (operations?.includes(OperationKeys.DELETE)) {\n <ion-item-option class=\"dcf-delete\" (click)=\"handleAction(OperationKeys.DELETE, $event, component)\" [expandable]=\"operations.length === 1\">\n <ion-icon aria-hidden=\"true\" slot=\"icon-only\" name=\"trash\" />\n </ion-item-option>\n }\n </ion-item-options>\n }\n </ion-item-sliding>\n}\n", styles: ["ion-item:not(.dcf-palette-dark){--background-hover-opacity: .1;--background-focused-opacity: .1;--border-color: var(--dcf-color-gray-2)}ion-item:not(.dcf-palette-dark) .dcf-info{color:var(--dcf-color-gray-6)}ion-item:not(.dcf-palette-dark) .dcf-item-title{color:var(--dcf-color-gray-8)}ion-item:not(.dcf-palette-dark) .dcf-description{color:var(--dcf-color-gray-6)}ion-item:not(.dcf-palette-dark)>ion-button{color:var(--dcf-color-gray-7);--background: var(--dcf-color-gray-1) !important}ion-item:not(.dcf-palette-dark) ion-avatar{color:var(--dcf-color-gray-7);background:var(--dcf-color-gray-1)!important}ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-delete),ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-update){background:rgba(var(--dcf-color-dark-rgb),.25)!important}ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-delete) .dcf-ti,ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-delete) ion-icon,ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-update) .dcf-ti,ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-update) ion-icon{color:var(--dcf-color-gray-7)!important}ion-item:not(.dcf-palette-dark) ion-item-option.dcf-delete{background:rgba(var(--dcf-color-danger-rgb),.05)!important}ion-item:not(.dcf-palette-dark) ion-item-option.dcf-delete .dcf-ti,ion-item:not(.dcf-palette-dark) ion-item-option.dcf-delete *,ion-item:not(.dcf-palette-dark) ion-item-option.dcf-delete ion-icon{color:var(--dcf-color-danger)!important}ion-item:not(.dcf-palette-dark) ion-item-option.dcf-update{background:rgba(var(--dcf-color-primary-rgb),.05)!important}ion-item:not(.dcf-palette-dark) ion-item-option.dcf-update .dcf-ti,ion-item:not(.dcf-palette-dark) ion-item-option.dcf-update ion-icon{color:var(--dcf-color-primary)!important}ion-item.dcf-palette-dark{--background-hover-opacity: .25;--background-focused-opacity: .25;--border-color: var(--dcf-color-gray-6)}ion-item.dcf-palette-dark .dcf-description{color:var(--dcf-color-gray-4)}ion-item.dcf-palette-dark ion-button{color:var(--dcf-color-gray-1)!important;--background: var(--dcf-color-gray-7) !important}ion-item.dcf-palette-dark ion-avatar{color:var(--dcf-color-gray-1)!important;background:var(--dcf-background-color)!important}ion-item.dcf-palette-dark ion-item-option:not(.dcf-delete),ion-item.dcf-palette-dark ion-item-option:not(.dcf-update){background:rgba(var(--dcf-color-dark-rgb),1)!important}ion-item.dcf-palette-dark ion-item-option:not(.dcf-delete) .dcf-ti,ion-item.dcf-palette-dark ion-item-option:not(.dcf-delete) ion-icon,ion-item.dcf-palette-dark ion-item-option:not(.dcf-update) .dcf-ti,ion-item.dcf-palette-dark ion-item-option:not(.dcf-update) ion-icon{color:var(--dcf-color-gray-2)!important}ion-item.dcf-palette-dark ion-item-option.dcf-delete{background:rgba(var(--dcf-color-danger-rgb),.05)!important}ion-item.dcf-palette-dark ion-item-option.dcf-delete .dcf-ti,ion-item.dcf-palette-dark ion-item-option.dcf-delete *,ion-item.dcf-palette-dark ion-item-option.dcf-delete ion-icon{color:var(--dcf-color-danger)!important}ion-item.dcf-palette-dark ion-item-option.dcf-update{background:rgba(var(--dcf-color-primary-rgb),.05)!important}ion-item.dcf-palette-dark ion-item-option.dcf-update .dcf-ti,ion-item.dcf-palette-dark ion-item-option.dcf-update ion-icon{color:var(--dcf-color-gray-2)!important}ion-item-sliding{box-sizing:border-box}ion-item-sliding[class*=active-slide]{border-color:var(--dcf-color-gray-3)}ion-item-sliding ion-item-option{color:var(--dcf-color-gray-5);box-shadow:inset 0 0 5px rgba(var(--dcf-color-dark-rgb),.15)!important;background:var(--dcf-color-gray-3)}ion-item{--min-height: 50px;--padding-top: .25rem;--padding-bottom: .25rem;--padding-start: .75rem;--padding-end: .75rem;--inner-padding-start: 0px !important;--inner-padding-end: 0px !important;--background-hover: var(--dcf-color-gray-8);--background-focused: var(--dcf-color-gray-8)}ion-item.item-lines-full{--padding-top: .5rem;--padding-bottom: .5rem;--padding-start: .25rem;-padding-end:.25rem;padding:0 .65rem}ion-item.item-lines-inset{--padding-top: 0rem !important;--padding-bottom: 0rem !important;--inner-padding-top: .5rem !important;--inner-padding-bottom: .65rem !important}ion-item .dcf-info{min-width:10vw;background:transparent!important}ion-item .dcf-grid{padding:0!important;margin:0!important;min-width:100%!important}ion-item .dcf-item-title{font-style:normal;font-weight:600;width:max-content!important}ion-item .dcf-description{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal;font-weight:400;font-size:.925rem}ion-item::part(native){min-width:100%}ion-item [slot=start]{margin-right:.5rem!important}ion-item [slot=end]{margin-left:.5rem!important}ion-item .dcf-info{font-size:.9rem}ion-item .dcf-info .dcf-subinfo.dcf-line{margin-left:.5rem}@media (min-width: var(--dcf-width-sm)){ion-item .dcf-info .dcf-subinfo.dcf-line{display:block;margin-left:0}}ion-item #dcf-actions{padding:5px}@media (max-width: var(--dcf-width-m)){ion-item #dcf-actions{display:none;pointer-events:none!important;cursor:text!important}ion-item #dcf-actions *{display:none;pointer-events:none!important;cursor:text!important}}@media (max-width: var(--dcf-width-m)){ion-item #dcf-end,ion-item [slot=end]{display:none!important}}ion-item #dcf-end{padding-top:5px;display:flex;align-items:flex-end}ion-item .dcf-icon{display:flex;justify-content:center;align-items:center;text-align:center;margin-right:.5rem!important}ion-item .dcf-icon.dcf-grid-icon{min-width:50px;text-align:left;display:flex;justify-content:flex-start}@media (max-width: var(--dcf-width-s)){ion-item .dcf-icon{align-items:flex-start!important}}.dcf-icon-container{background:var(--dcf-color-gray-1);border-radius:50%;width:45px;height:45px;display:flex;justify-content:center;align-items:center}.dcf-icon-container ::ng-deep ion-icon{font-size:20px;transform:translateY(3px)!important}.dcf-icon-container ::ng-deep .ti{top:1px;left:1px}\n"], dependencies: [{ kind: "component", type: IonList, selector: "ion-list", inputs: ["inset", "lines", "mode"] }, { kind: "component", type: IonListHeader, selector: "ion-list-header", inputs: ["color", "lines", "mode"] }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonItemSliding, selector: "ion-item-sliding", inputs: ["disabled"] }, { kind: "component", type: IonItemOptions, selector: "ion-item-options", inputs: ["side"] }, { kind: "component", type: IonItemOption, selector: "ion-item-option", inputs: ["color", "disabled", "download", "expandable", "href", "mode", "rel", "target", "type"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: IconComponent, selector: "ngx-decaf-icon", inputs: ["name", "color", "slot", "button", "buttonFill", "buttonShape", "width", "size", "inline"] }, { kind: "component", type: IonPopover, selector: "ion-popover" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
12546
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: ListItemComponent, isStandalone: true, selector: "ngx-decaf-list-item", inputs: { actionsType: "actionsType", lines: "lines", item: "item", icon: "icon", iconSlot: "iconSlot", button: "button", title: "title", description: "description", info: "info", subinfo: "subinfo", emitEvent: "emitEvent" }, outputs: { clickEvent: "clickEvent" }, host: { listeners: { "window:resize": "enableSlideItems($event)" }, properties: { "attr.id": "uid" } }, viewQueries: [{ propertyName: "component", first: true, predicate: ["component"], descendants: true, read: ElementRef }, { propertyName: "actionMenuComponent", first: true, predicate: ["actionMenuComponent"], descendants: true }], usesInheritance: true, ngImport: i0, template: "@if (title || description) {\n <ion-item-sliding>\n <ion-item\n [id]=\"uid\"\n [lines]=\"lines\"\n [button]=\"!operations?.length ? false : button\"\n [class]=\"className\"\n (click)=\"\n operations?.includes(OperationKeys.READ)\n ? handleAction($event, OperationKeys.READ, component)\n : ''\n \"\n #component\n >\n @if (icon && lines !== 'inset') {\n <div class=\"dcf-icon-container dcf-width-auto\" [slot]=\"iconSlot\">\n <ngx-decaf-icon slot=\"icon-only\" [name]=\"icon\" />\n </div>\n }\n <div class=\"dcf-width-expand\">\n <div class=\"dcf-flex dcf-flex-middle dcf-grid-collapse\" dcf-grid>\n @if (icon && lines === 'inset') {\n <div class=\"dcf-icon\" [slot]=\"iconSlot\">\n <ion-avatar>\n <ion-icon aria-hidden=\"true\" name=\"reader-outline\" size=\"default\" />\n </ion-avatar>\n </div>\n }\n <div class=\"dcf-width-expand@s dcf-width-1-1 dcf-label\">\n @if (title) {\n <ion-label class=\"dcf-item-title\">\n {{ title | translate }}\n </ion-label>\n }\n @if (description) {\n <div class=\"dcf-description\" [innerHTML]=\"description\"></div>\n }\n </div>\n @if (info || subinfo) {\n <div class=\"dcf-width-auto@s dcf-width-expand dcf-info dcf-flex dcf-flex-right@s\">\n <div>\n @if (info) {\n <span [innerHTML]=\"info\"></span>\n }\n @if (subinfo) {\n <div class=\"dcf-subinfo dcf-text-truncate\" [innerHTML]=\"subinfo\"></div>\n }\n </div>\n </div>\n }\n\n <div class=\"dcf-width-auto dcf-flex dcf-flex-middle dcf-flex-right\">\n @if (\n (operations?.includes(OperationKeys.DELETE) ||\n operations?.includes(OperationKeys.UPDATE)) &&\n uid\n ) {\n <div class=\"dcf-visible@s\" id=\"dcf-actions\">\n @if (actionsType === 'popover') {\n <ion-button\n shape=\"round\"\n fill=\"clear\"\n color=\"primary\"\n (click)=\"presentActionsMenu($event)\"\n [attr.aria-label]=\"locale + '.actions' | translate\"\n >\n <ion-icon\n slot=\"icon-only\"\n aria-hidden=\"true\"\n name=\"ellipsis-vertical-outline\"\n />\n </ion-button>\n <ion-popover\n #actionMenuComponent\n side=\"bottom\"\n alignment=\"left\"\n [isOpen]=\"actionMenuOpen\"\n (didDismiss)=\"actionMenuOpen = false\"\n >\n <ng-template>\n <ion-content class=\"ion-padding\">\n <ion-list lines=\"none\">\n <ion-list-header>\n <h4\n class=\"dcf-text-capitalize\"\n [innerHTML]=\"'actions' | translate\"\n ></h4>\n </ion-list-header>\n @for (\n operation of [OperationKeys.UPDATE, OperationKeys.DELETE];\n track operation\n ) {\n @if (operations?.includes(operation)) {\n <ion-item\n [button]=\"true\"\n (click)=\"handleAction($event, operation, component)\"\n >\n <div slot=\"start\">\n @if (operation === OperationKeys.UPDATE) {\n <ngx-decaf-icon\n [button]=\"true\"\n slot=\"icon-only\"\n name=\"ti-edit\"\n />\n } @else {\n <ngx-decaf-icon\n [button]=\"true\"\n slot=\"icon-only\"\n color=\"danger\"\n name=\"ti-trash\"\n />\n }\n </div>\n <ion-label class=\"dcf-text-capitalize\">\n {{ operation | translate }}\n </ion-label>\n </ion-item>\n }\n }\n </ion-list>\n </ion-content>\n </ng-template>\n </ion-popover>\n } @else {\n <div class=\"dcf-grid-actions dcf-grid dcf-grid-small dcf-flex\">\n @for (\n operation of [OperationKeys.UPDATE, OperationKeys.DELETE];\n track operation\n ) {\n <div>\n @if (operations?.includes(operation)) {\n <ngx-decaf-icon\n (click)=\"handleAction($event, operation, component)\"\n fill=\"clear\"\n shape=\"round\"\n [attr.aria-label]=\"locale + '.operations.' + operation | translate\"\n [button]=\"true\"\n slot=\"icon-only\"\n [color]=\"operation === OperationKeys.UPDATE ? 'dark' : 'danger'\"\n [name]=\"operation === OperationKeys.UPDATE ? 'ti-edit' : 'ti-trash'\"\n />\n }\n </div>\n }\n </div>\n }\n </div>\n }\n @if (windowWidth > 639) {\n <div id=\"end\">\n <ng-content select=\"[slot='end']\"></ng-content>\n </div>\n }\n </div>\n </div>\n </div>\n </ion-item>\n @if (showSlideItems && uid) {\n <ion-item-options\n side=\"end\"\n (ionSwipe)=\"operations.length === 1 ? handleAction($event, operations[0], component) : ''\"\n >\n @if (operations?.includes(OperationKeys.UPDATE)) {\n <ion-item-option\n class=\"dcf-update\"\n (click)=\"handleAction($event, OperationKeys.UPDATE, component)\"\n [expandable]=\"operations.length === 1\"\n >\n <ion-icon aria-hidden=\"true\" slot=\"icon-only\" name=\"create-outline\" />\n </ion-item-option>\n }\n @if (operations?.includes(OperationKeys.DELETE)) {\n <ion-item-option\n class=\"dcf-delete\"\n (click)=\"handleAction($event, OperationKeys.DELETE, component)\"\n [expandable]=\"operations.length === 1\"\n >\n <ion-icon aria-hidden=\"true\" slot=\"icon-only\" name=\"trash\" />\n </ion-item-option>\n }\n </ion-item-options>\n }\n </ion-item-sliding>\n}\n", styles: ["ion-item:not(.dcf-palette-dark){--background-hover-opacity: .1;--background-focused-opacity: .1;--border-color: var(--dcf-color-gray-2)}ion-item:not(.dcf-palette-dark) .dcf-info{color:var(--dcf-color-gray-6)}ion-item:not(.dcf-palette-dark) .dcf-item-title{color:var(--dcf-color-gray-8)}ion-item:not(.dcf-palette-dark) .dcf-description{color:var(--dcf-color-gray-6)}ion-item:not(.dcf-palette-dark)>ion-button{color:var(--dcf-color-gray-7);--background: var(--dcf-color-gray-1) !important}ion-item:not(.dcf-palette-dark) ion-avatar{color:var(--dcf-color-gray-7);background:var(--dcf-color-gray-1)!important}ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-delete),ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-update){background:rgba(var(--dcf-color-dark-rgb),.25)!important}ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-delete) .dcf-ti,ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-delete) ion-icon,ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-update) .dcf-ti,ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-update) ion-icon{color:var(--dcf-color-gray-7)!important}ion-item:not(.dcf-palette-dark) ion-item-option.dcf-delete{background:rgba(var(--dcf-color-danger-rgb),.05)!important}ion-item:not(.dcf-palette-dark) ion-item-option.dcf-delete .dcf-ti,ion-item:not(.dcf-palette-dark) ion-item-option.dcf-delete *,ion-item:not(.dcf-palette-dark) ion-item-option.dcf-delete ion-icon{color:var(--dcf-color-danger)!important}ion-item:not(.dcf-palette-dark) ion-item-option.dcf-update{background:rgba(var(--dcf-color-primary-rgb),.05)!important}ion-item:not(.dcf-palette-dark) ion-item-option.dcf-update .dcf-ti,ion-item:not(.dcf-palette-dark) ion-item-option.dcf-update ion-icon{color:var(--dcf-color-primary)!important}ion-item.dcf-palette-dark{--background-hover-opacity: .25;--background-focused-opacity: .25;--border-color: var(--dcf-color-gray-6)}ion-item.dcf-palette-dark .dcf-description{color:var(--dcf-color-gray-4)}ion-item.dcf-palette-dark ion-button{color:var(--dcf-color-gray-1)!important;--background: var(--dcf-color-gray-7) !important}ion-item.dcf-palette-dark ion-avatar{color:var(--dcf-color-gray-1)!important;background:var(--dcf-background-color)!important}ion-item.dcf-palette-dark ion-item-option:not(.dcf-delete),ion-item.dcf-palette-dark ion-item-option:not(.dcf-update){background:rgba(var(--dcf-color-dark-rgb),1)!important}ion-item.dcf-palette-dark ion-item-option:not(.dcf-delete) .dcf-ti,ion-item.dcf-palette-dark ion-item-option:not(.dcf-delete) ion-icon,ion-item.dcf-palette-dark ion-item-option:not(.dcf-update) .dcf-ti,ion-item.dcf-palette-dark ion-item-option:not(.dcf-update) ion-icon{color:var(--dcf-color-gray-2)!important}ion-item.dcf-palette-dark ion-item-option.dcf-delete{background:rgba(var(--dcf-color-danger-rgb),.05)!important}ion-item.dcf-palette-dark ion-item-option.dcf-delete .dcf-ti,ion-item.dcf-palette-dark ion-item-option.dcf-delete *,ion-item.dcf-palette-dark ion-item-option.dcf-delete ion-icon{color:var(--dcf-color-danger)!important}ion-item.dcf-palette-dark ion-item-option.dcf-update{background:rgba(var(--dcf-color-primary-rgb),.05)!important}ion-item.dcf-palette-dark ion-item-option.dcf-update .dcf-ti,ion-item.dcf-palette-dark ion-item-option.dcf-update ion-icon{color:var(--dcf-color-gray-2)!important}ion-item-sliding{box-sizing:border-box}ion-item-sliding[class*=active-slide]{border-color:var(--dcf-color-gray-3)}ion-item-sliding ion-item-option{color:var(--dcf-color-gray-5);box-shadow:inset 0 0 5px rgba(var(--dcf-color-dark-rgb),.15)!important;background:var(--dcf-color-gray-3)}ion-item{--min-height: 50px;--padding-top: .25rem;--padding-bottom: .25rem;--padding-start: .75rem;--padding-end: .75rem;--inner-padding-start: 0px !important;--inner-padding-end: 0px !important;--background-hover: var(--dcf-color-gray-8);--background-focused: var(--dcf-color-gray-8)}ion-item.item-lines-full{--padding-top: .5rem;--padding-bottom: .5rem;--padding-start: .25rem;-padding-end:.25rem;padding:0 .65rem}ion-item.item-lines-inset{--padding-top: 0rem !important;--padding-bottom: 0rem !important;--inner-padding-top: .5rem !important;--inner-padding-bottom: .65rem !important}ion-item .dcf-info{min-width:10vw;background:transparent!important}ion-item .dcf-grid{padding:0!important;margin:0!important;min-width:100%!important}ion-item .dcf-item-title{font-style:normal;font-weight:600;width:max-content!important}ion-item .dcf-description{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal;font-weight:400;font-size:.925rem}ion-item::part(native){min-width:100%}ion-item [slot=start]{margin-right:.5rem!important}ion-item [slot=end]{margin-left:.5rem!important}ion-item .dcf-info{font-size:.9rem}ion-item .dcf-info .dcf-subinfo.dcf-line{margin-left:.5rem}@media (min-width: var(--dcf-width-sm)){ion-item .dcf-info .dcf-subinfo.dcf-line{display:block;margin-left:0}}ion-item #dcf-actions{padding:5px}@media (max-width: var(--dcf-width-m)){ion-item #dcf-actions{display:none;pointer-events:none!important;cursor:text!important}ion-item #dcf-actions *{display:none;pointer-events:none!important;cursor:text!important}}@media (max-width: var(--dcf-width-m)){ion-item #dcf-end,ion-item [slot=end]{display:none!important}}ion-item #dcf-end{padding-top:5px;display:flex;align-items:flex-end}ion-item .dcf-icon{display:flex;justify-content:center;align-items:center;text-align:center;margin-right:.5rem!important}ion-item .dcf-icon.dcf-grid-icon{min-width:50px;text-align:left;display:flex;justify-content:flex-start}@media (max-width: var(--dcf-width-s)){ion-item .dcf-icon{align-items:flex-start!important}}.dcf-icon-container{background:var(--dcf-color-gray-1);border-radius:50%;width:45px;height:45px;display:flex;justify-content:center;align-items:center}.dcf-icon-container ::ng-deep ion-icon{font-size:20px;transform:translateY(3px)!important}.dcf-icon-container ::ng-deep .ti{top:1px;left:1px}\n"], dependencies: [{ kind: "component", type: IonList, selector: "ion-list", inputs: ["inset", "lines", "mode"] }, { kind: "component", type: IonListHeader, selector: "ion-list-header", inputs: ["color", "lines", "mode"] }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonItemSliding, selector: "ion-item-sliding", inputs: ["disabled"] }, { kind: "component", type: IonItemOptions, selector: "ion-item-options", inputs: ["side"] }, { kind: "component", type: IonItemOption, selector: "ion-item-option", inputs: ["color", "disabled", "download", "expandable", "href", "mode", "rel", "target", "type"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: IconComponent, selector: "ngx-decaf-icon", inputs: ["name", "color", "slot", "button", "buttonFill", "buttonShape", "width", "size", "inline"] }, { kind: "component", type: IonPopover, selector: "ion-popover" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
12584
12547
|
};
|
|
12585
12548
|
ListItemComponent = __decorate([
|
|
12586
12549
|
Dynamic(),
|
|
@@ -12602,7 +12565,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
12602
12565
|
IonContent,
|
|
12603
12566
|
IconComponent,
|
|
12604
12567
|
IonPopover,
|
|
12605
|
-
], host: { '[attr.id]': 'uid' }, template: "\n@if (title || description) {\n <ion-item-sliding>\n <ion-item\n [id]=\"uid\"\n [lines]=\"lines\"\n [button]=\"!operations?.length ? false : button\"\n [class]=\"className\"\n (click)=\"operations?.includes(OperationKeys.READ) ? handleAction(OperationKeys.READ, $event, component) : ''\"\n #component\n >\n @if (icon && lines !== 'inset') {\n <div class=\"dcf-icon-container dcf-width-auto\" [slot]=\"iconSlot\">\n <ngx-decaf-icon slot=\"icon-only\" [name]=\"icon\" />\n </div>\n }\n <div class=\"dcf-width-expand\">\n <div class=\"dcf-flex dcf-flex-middle dcf-grid-collapse\" dcf-grid>\n @if (icon && lines === 'inset') {\n <div class=\"dcf-icon\" [slot]=\"iconSlot\">\n <ion-avatar>\n <ion-icon aria-hidden=\"true\" name=\"reader-outline\" size=\"default\" />\n </ion-avatar>\n </div>\n }\n <div class=\"dcf-width-expand@s dcf-width-1-1 dcf-label\">\n @if (title) {\n <ion-label class=\"dcf-item-title\">\n {{ title | translate }}\n </ion-label>\n }\n @if (description) {\n <div class=\"dcf-description\" [innerHTML]=\"description\"></div>\n }\n </div>\n @if (info || subinfo) {\n <div class=\"dcf-width-auto@s dcf-width-expand dcf-info dcf-flex dcf-flex-right@s\">\n <div>\n @if (info) {\n <span [innerHTML]=\"info\"></span>\n }\n @if (subinfo) {\n <div class=\"dcf-subinfo dcf-text-truncate\" [innerHTML]=\"subinfo\" ></div>\n }\n </div>\n </div>\n }\n\n <div class=\"dcf-width-auto dcf-flex dcf-flex-middle dcf-flex-right\">\n @if ((operations?.includes(OperationKeys.DELETE) || operations?.includes(OperationKeys.UPDATE)) && uid) {\n <div class=\"dcf-visible@s\" id=\"dcf-actions\">\n @if(actionsType === 'popover') {\n <ion-button shape=\"round\" fill=\"clear\" color=\"primary\" (click)=\"presentActionsMenu($event)\" [attr.aria-label]=\"locale+'.actions' | translate\">\n <ion-icon slot=\"icon-only\" aria-hidden=\"true\" name=\"ellipsis-vertical-outline\" />\n </ion-button>\n <ion-popover\n #actionMenuComponent\n side=\"bottom\"\n alignment=\"left\"\n [isOpen]=\"actionMenuOpen\"\n (didDismiss)=\"actionMenuOpen = false\">\n <ng-template>\n <ion-content class=\"ion-padding\">\n <ion-list lines=\"none\">\n <ion-list-header>\n <h4 class=\"dcf-text-capitalize\" [innerHTML]=\"'actions' | translate\"></h4>\n </ion-list-header>\n @for (operation of [OperationKeys.UPDATE, OperationKeys.DELETE]; track operation) {\n @if (operations?.includes(operation)) {\n <ion-item [button]=\"true\" (click)=\"handleAction(operation, $event, component)\">\n <div slot=\"start\">\n @if (operation === OperationKeys.UPDATE) {\n <ngx-decaf-icon [button]=\"true\" slot=\"icon-only\" name=\"ti-edit\" />\n } @else {\n <ngx-decaf-icon [button]=\"true\" slot=\"icon-only\" color=\"danger\" name=\"ti-trash\" />\n }\n </div>\n <ion-label class=\"dcf-text-capitalize\">{{ operation | translate }}</ion-label>\n </ion-item>\n }\n }\n </ion-list>\n </ion-content>\n </ng-template>\n </ion-popover>\n } @else {\n <div class=\"dcf-grid-actions dcf-grid dcf-grid-small dcf-flex \">\n @for (operation of [OperationKeys.UPDATE, OperationKeys.DELETE]; track operation) {\n <div>\n @if (operations?.includes(operation)) {\n <ngx-decaf-icon\n (click)=\"handleAction(operation, $event, component)\"\n fill=\"clear\" shape=\"round\"\n [attr.aria-label]=\"(locale +'.operations.' + operation) | translate\"\n [button]=\"true\"\n slot=\"icon-only\"\n [color]=\"operation === OperationKeys.UPDATE ? 'dark' : 'danger'\"\n [name]=\"operation === OperationKeys.UPDATE ? 'ti-edit' : 'ti-trash'\"\n />\n\n }\n </div>\n }\n </div>\n }\n\n </div>\n }\n @if (windowWidth > 639) {\n <div id=\"end\">\n <ng-content select=\"[slot='end']\"></ng-content>\n </div>\n }\n </div>\n </div>\n </div>\n </ion-item>\n @if (showSlideItems && uid) {\n <ion-item-options side=\"end\" (ionSwipe)=\"operations.length === 1 ? handleAction(operations[0], $event, component) : ''\">\n @if (operations?.includes(OperationKeys.UPDATE)) {\n <ion-item-option class=\"dcf-update\" (click)=\"handleAction(OperationKeys.UPDATE, $event, component)\" [expandable]=\"operations.length === 1\">\n <ion-icon aria-hidden=\"true\" slot=\"icon-only\" name=\"create-outline\" />\n </ion-item-option>\n }\n @if (operations?.includes(OperationKeys.DELETE)) {\n <ion-item-option class=\"dcf-delete\" (click)=\"handleAction(OperationKeys.DELETE, $event, component)\" [expandable]=\"operations.length === 1\">\n <ion-icon aria-hidden=\"true\" slot=\"icon-only\" name=\"trash\" />\n </ion-item-option>\n }\n </ion-item-options>\n }\n </ion-item-sliding>\n}\n", styles: ["ion-item:not(.dcf-palette-dark){--background-hover-opacity: .1;--background-focused-opacity: .1;--border-color: var(--dcf-color-gray-2)}ion-item:not(.dcf-palette-dark) .dcf-info{color:var(--dcf-color-gray-6)}ion-item:not(.dcf-palette-dark) .dcf-item-title{color:var(--dcf-color-gray-8)}ion-item:not(.dcf-palette-dark) .dcf-description{color:var(--dcf-color-gray-6)}ion-item:not(.dcf-palette-dark)>ion-button{color:var(--dcf-color-gray-7);--background: var(--dcf-color-gray-1) !important}ion-item:not(.dcf-palette-dark) ion-avatar{color:var(--dcf-color-gray-7);background:var(--dcf-color-gray-1)!important}ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-delete),ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-update){background:rgba(var(--dcf-color-dark-rgb),.25)!important}ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-delete) .dcf-ti,ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-delete) ion-icon,ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-update) .dcf-ti,ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-update) ion-icon{color:var(--dcf-color-gray-7)!important}ion-item:not(.dcf-palette-dark) ion-item-option.dcf-delete{background:rgba(var(--dcf-color-danger-rgb),.05)!important}ion-item:not(.dcf-palette-dark) ion-item-option.dcf-delete .dcf-ti,ion-item:not(.dcf-palette-dark) ion-item-option.dcf-delete *,ion-item:not(.dcf-palette-dark) ion-item-option.dcf-delete ion-icon{color:var(--dcf-color-danger)!important}ion-item:not(.dcf-palette-dark) ion-item-option.dcf-update{background:rgba(var(--dcf-color-primary-rgb),.05)!important}ion-item:not(.dcf-palette-dark) ion-item-option.dcf-update .dcf-ti,ion-item:not(.dcf-palette-dark) ion-item-option.dcf-update ion-icon{color:var(--dcf-color-primary)!important}ion-item.dcf-palette-dark{--background-hover-opacity: .25;--background-focused-opacity: .25;--border-color: var(--dcf-color-gray-6)}ion-item.dcf-palette-dark .dcf-description{color:var(--dcf-color-gray-4)}ion-item.dcf-palette-dark ion-button{color:var(--dcf-color-gray-1)!important;--background: var(--dcf-color-gray-7) !important}ion-item.dcf-palette-dark ion-avatar{color:var(--dcf-color-gray-1)!important;background:var(--dcf-background-color)!important}ion-item.dcf-palette-dark ion-item-option:not(.dcf-delete),ion-item.dcf-palette-dark ion-item-option:not(.dcf-update){background:rgba(var(--dcf-color-dark-rgb),1)!important}ion-item.dcf-palette-dark ion-item-option:not(.dcf-delete) .dcf-ti,ion-item.dcf-palette-dark ion-item-option:not(.dcf-delete) ion-icon,ion-item.dcf-palette-dark ion-item-option:not(.dcf-update) .dcf-ti,ion-item.dcf-palette-dark ion-item-option:not(.dcf-update) ion-icon{color:var(--dcf-color-gray-2)!important}ion-item.dcf-palette-dark ion-item-option.dcf-delete{background:rgba(var(--dcf-color-danger-rgb),.05)!important}ion-item.dcf-palette-dark ion-item-option.dcf-delete .dcf-ti,ion-item.dcf-palette-dark ion-item-option.dcf-delete *,ion-item.dcf-palette-dark ion-item-option.dcf-delete ion-icon{color:var(--dcf-color-danger)!important}ion-item.dcf-palette-dark ion-item-option.dcf-update{background:rgba(var(--dcf-color-primary-rgb),.05)!important}ion-item.dcf-palette-dark ion-item-option.dcf-update .dcf-ti,ion-item.dcf-palette-dark ion-item-option.dcf-update ion-icon{color:var(--dcf-color-gray-2)!important}ion-item-sliding{box-sizing:border-box}ion-item-sliding[class*=active-slide]{border-color:var(--dcf-color-gray-3)}ion-item-sliding ion-item-option{color:var(--dcf-color-gray-5);box-shadow:inset 0 0 5px rgba(var(--dcf-color-dark-rgb),.15)!important;background:var(--dcf-color-gray-3)}ion-item{--min-height: 50px;--padding-top: .25rem;--padding-bottom: .25rem;--padding-start: .75rem;--padding-end: .75rem;--inner-padding-start: 0px !important;--inner-padding-end: 0px !important;--background-hover: var(--dcf-color-gray-8);--background-focused: var(--dcf-color-gray-8)}ion-item.item-lines-full{--padding-top: .5rem;--padding-bottom: .5rem;--padding-start: .25rem;-padding-end:.25rem;padding:0 .65rem}ion-item.item-lines-inset{--padding-top: 0rem !important;--padding-bottom: 0rem !important;--inner-padding-top: .5rem !important;--inner-padding-bottom: .65rem !important}ion-item .dcf-info{min-width:10vw;background:transparent!important}ion-item .dcf-grid{padding:0!important;margin:0!important;min-width:100%!important}ion-item .dcf-item-title{font-style:normal;font-weight:600;width:max-content!important}ion-item .dcf-description{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal;font-weight:400;font-size:.925rem}ion-item::part(native){min-width:100%}ion-item [slot=start]{margin-right:.5rem!important}ion-item [slot=end]{margin-left:.5rem!important}ion-item .dcf-info{font-size:.9rem}ion-item .dcf-info .dcf-subinfo.dcf-line{margin-left:.5rem}@media (min-width: var(--dcf-width-sm)){ion-item .dcf-info .dcf-subinfo.dcf-line{display:block;margin-left:0}}ion-item #dcf-actions{padding:5px}@media (max-width: var(--dcf-width-m)){ion-item #dcf-actions{display:none;pointer-events:none!important;cursor:text!important}ion-item #dcf-actions *{display:none;pointer-events:none!important;cursor:text!important}}@media (max-width: var(--dcf-width-m)){ion-item #dcf-end,ion-item [slot=end]{display:none!important}}ion-item #dcf-end{padding-top:5px;display:flex;align-items:flex-end}ion-item .dcf-icon{display:flex;justify-content:center;align-items:center;text-align:center;margin-right:.5rem!important}ion-item .dcf-icon.dcf-grid-icon{min-width:50px;text-align:left;display:flex;justify-content:flex-start}@media (max-width: var(--dcf-width-s)){ion-item .dcf-icon{align-items:flex-start!important}}.dcf-icon-container{background:var(--dcf-color-gray-1);border-radius:50%;width:45px;height:45px;display:flex;justify-content:center;align-items:center}.dcf-icon-container ::ng-deep ion-icon{font-size:20px;transform:translateY(3px)!important}.dcf-icon-container ::ng-deep .ti{top:1px;left:1px}\n"] }]
|
|
12568
|
+
], host: { '[attr.id]': 'uid' }, template: "@if (title || description) {\n <ion-item-sliding>\n <ion-item\n [id]=\"uid\"\n [lines]=\"lines\"\n [button]=\"!operations?.length ? false : button\"\n [class]=\"className\"\n (click)=\"\n operations?.includes(OperationKeys.READ)\n ? handleAction($event, OperationKeys.READ, component)\n : ''\n \"\n #component\n >\n @if (icon && lines !== 'inset') {\n <div class=\"dcf-icon-container dcf-width-auto\" [slot]=\"iconSlot\">\n <ngx-decaf-icon slot=\"icon-only\" [name]=\"icon\" />\n </div>\n }\n <div class=\"dcf-width-expand\">\n <div class=\"dcf-flex dcf-flex-middle dcf-grid-collapse\" dcf-grid>\n @if (icon && lines === 'inset') {\n <div class=\"dcf-icon\" [slot]=\"iconSlot\">\n <ion-avatar>\n <ion-icon aria-hidden=\"true\" name=\"reader-outline\" size=\"default\" />\n </ion-avatar>\n </div>\n }\n <div class=\"dcf-width-expand@s dcf-width-1-1 dcf-label\">\n @if (title) {\n <ion-label class=\"dcf-item-title\">\n {{ title | translate }}\n </ion-label>\n }\n @if (description) {\n <div class=\"dcf-description\" [innerHTML]=\"description\"></div>\n }\n </div>\n @if (info || subinfo) {\n <div class=\"dcf-width-auto@s dcf-width-expand dcf-info dcf-flex dcf-flex-right@s\">\n <div>\n @if (info) {\n <span [innerHTML]=\"info\"></span>\n }\n @if (subinfo) {\n <div class=\"dcf-subinfo dcf-text-truncate\" [innerHTML]=\"subinfo\"></div>\n }\n </div>\n </div>\n }\n\n <div class=\"dcf-width-auto dcf-flex dcf-flex-middle dcf-flex-right\">\n @if (\n (operations?.includes(OperationKeys.DELETE) ||\n operations?.includes(OperationKeys.UPDATE)) &&\n uid\n ) {\n <div class=\"dcf-visible@s\" id=\"dcf-actions\">\n @if (actionsType === 'popover') {\n <ion-button\n shape=\"round\"\n fill=\"clear\"\n color=\"primary\"\n (click)=\"presentActionsMenu($event)\"\n [attr.aria-label]=\"locale + '.actions' | translate\"\n >\n <ion-icon\n slot=\"icon-only\"\n aria-hidden=\"true\"\n name=\"ellipsis-vertical-outline\"\n />\n </ion-button>\n <ion-popover\n #actionMenuComponent\n side=\"bottom\"\n alignment=\"left\"\n [isOpen]=\"actionMenuOpen\"\n (didDismiss)=\"actionMenuOpen = false\"\n >\n <ng-template>\n <ion-content class=\"ion-padding\">\n <ion-list lines=\"none\">\n <ion-list-header>\n <h4\n class=\"dcf-text-capitalize\"\n [innerHTML]=\"'actions' | translate\"\n ></h4>\n </ion-list-header>\n @for (\n operation of [OperationKeys.UPDATE, OperationKeys.DELETE];\n track operation\n ) {\n @if (operations?.includes(operation)) {\n <ion-item\n [button]=\"true\"\n (click)=\"handleAction($event, operation, component)\"\n >\n <div slot=\"start\">\n @if (operation === OperationKeys.UPDATE) {\n <ngx-decaf-icon\n [button]=\"true\"\n slot=\"icon-only\"\n name=\"ti-edit\"\n />\n } @else {\n <ngx-decaf-icon\n [button]=\"true\"\n slot=\"icon-only\"\n color=\"danger\"\n name=\"ti-trash\"\n />\n }\n </div>\n <ion-label class=\"dcf-text-capitalize\">\n {{ operation | translate }}\n </ion-label>\n </ion-item>\n }\n }\n </ion-list>\n </ion-content>\n </ng-template>\n </ion-popover>\n } @else {\n <div class=\"dcf-grid-actions dcf-grid dcf-grid-small dcf-flex\">\n @for (\n operation of [OperationKeys.UPDATE, OperationKeys.DELETE];\n track operation\n ) {\n <div>\n @if (operations?.includes(operation)) {\n <ngx-decaf-icon\n (click)=\"handleAction($event, operation, component)\"\n fill=\"clear\"\n shape=\"round\"\n [attr.aria-label]=\"locale + '.operations.' + operation | translate\"\n [button]=\"true\"\n slot=\"icon-only\"\n [color]=\"operation === OperationKeys.UPDATE ? 'dark' : 'danger'\"\n [name]=\"operation === OperationKeys.UPDATE ? 'ti-edit' : 'ti-trash'\"\n />\n }\n </div>\n }\n </div>\n }\n </div>\n }\n @if (windowWidth > 639) {\n <div id=\"end\">\n <ng-content select=\"[slot='end']\"></ng-content>\n </div>\n }\n </div>\n </div>\n </div>\n </ion-item>\n @if (showSlideItems && uid) {\n <ion-item-options\n side=\"end\"\n (ionSwipe)=\"operations.length === 1 ? handleAction($event, operations[0], component) : ''\"\n >\n @if (operations?.includes(OperationKeys.UPDATE)) {\n <ion-item-option\n class=\"dcf-update\"\n (click)=\"handleAction($event, OperationKeys.UPDATE, component)\"\n [expandable]=\"operations.length === 1\"\n >\n <ion-icon aria-hidden=\"true\" slot=\"icon-only\" name=\"create-outline\" />\n </ion-item-option>\n }\n @if (operations?.includes(OperationKeys.DELETE)) {\n <ion-item-option\n class=\"dcf-delete\"\n (click)=\"handleAction($event, OperationKeys.DELETE, component)\"\n [expandable]=\"operations.length === 1\"\n >\n <ion-icon aria-hidden=\"true\" slot=\"icon-only\" name=\"trash\" />\n </ion-item-option>\n }\n </ion-item-options>\n }\n </ion-item-sliding>\n}\n", styles: ["ion-item:not(.dcf-palette-dark){--background-hover-opacity: .1;--background-focused-opacity: .1;--border-color: var(--dcf-color-gray-2)}ion-item:not(.dcf-palette-dark) .dcf-info{color:var(--dcf-color-gray-6)}ion-item:not(.dcf-palette-dark) .dcf-item-title{color:var(--dcf-color-gray-8)}ion-item:not(.dcf-palette-dark) .dcf-description{color:var(--dcf-color-gray-6)}ion-item:not(.dcf-palette-dark)>ion-button{color:var(--dcf-color-gray-7);--background: var(--dcf-color-gray-1) !important}ion-item:not(.dcf-palette-dark) ion-avatar{color:var(--dcf-color-gray-7);background:var(--dcf-color-gray-1)!important}ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-delete),ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-update){background:rgba(var(--dcf-color-dark-rgb),.25)!important}ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-delete) .dcf-ti,ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-delete) ion-icon,ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-update) .dcf-ti,ion-item:not(.dcf-palette-dark) ion-item-option:not(.dcf-update) ion-icon{color:var(--dcf-color-gray-7)!important}ion-item:not(.dcf-palette-dark) ion-item-option.dcf-delete{background:rgba(var(--dcf-color-danger-rgb),.05)!important}ion-item:not(.dcf-palette-dark) ion-item-option.dcf-delete .dcf-ti,ion-item:not(.dcf-palette-dark) ion-item-option.dcf-delete *,ion-item:not(.dcf-palette-dark) ion-item-option.dcf-delete ion-icon{color:var(--dcf-color-danger)!important}ion-item:not(.dcf-palette-dark) ion-item-option.dcf-update{background:rgba(var(--dcf-color-primary-rgb),.05)!important}ion-item:not(.dcf-palette-dark) ion-item-option.dcf-update .dcf-ti,ion-item:not(.dcf-palette-dark) ion-item-option.dcf-update ion-icon{color:var(--dcf-color-primary)!important}ion-item.dcf-palette-dark{--background-hover-opacity: .25;--background-focused-opacity: .25;--border-color: var(--dcf-color-gray-6)}ion-item.dcf-palette-dark .dcf-description{color:var(--dcf-color-gray-4)}ion-item.dcf-palette-dark ion-button{color:var(--dcf-color-gray-1)!important;--background: var(--dcf-color-gray-7) !important}ion-item.dcf-palette-dark ion-avatar{color:var(--dcf-color-gray-1)!important;background:var(--dcf-background-color)!important}ion-item.dcf-palette-dark ion-item-option:not(.dcf-delete),ion-item.dcf-palette-dark ion-item-option:not(.dcf-update){background:rgba(var(--dcf-color-dark-rgb),1)!important}ion-item.dcf-palette-dark ion-item-option:not(.dcf-delete) .dcf-ti,ion-item.dcf-palette-dark ion-item-option:not(.dcf-delete) ion-icon,ion-item.dcf-palette-dark ion-item-option:not(.dcf-update) .dcf-ti,ion-item.dcf-palette-dark ion-item-option:not(.dcf-update) ion-icon{color:var(--dcf-color-gray-2)!important}ion-item.dcf-palette-dark ion-item-option.dcf-delete{background:rgba(var(--dcf-color-danger-rgb),.05)!important}ion-item.dcf-palette-dark ion-item-option.dcf-delete .dcf-ti,ion-item.dcf-palette-dark ion-item-option.dcf-delete *,ion-item.dcf-palette-dark ion-item-option.dcf-delete ion-icon{color:var(--dcf-color-danger)!important}ion-item.dcf-palette-dark ion-item-option.dcf-update{background:rgba(var(--dcf-color-primary-rgb),.05)!important}ion-item.dcf-palette-dark ion-item-option.dcf-update .dcf-ti,ion-item.dcf-palette-dark ion-item-option.dcf-update ion-icon{color:var(--dcf-color-gray-2)!important}ion-item-sliding{box-sizing:border-box}ion-item-sliding[class*=active-slide]{border-color:var(--dcf-color-gray-3)}ion-item-sliding ion-item-option{color:var(--dcf-color-gray-5);box-shadow:inset 0 0 5px rgba(var(--dcf-color-dark-rgb),.15)!important;background:var(--dcf-color-gray-3)}ion-item{--min-height: 50px;--padding-top: .25rem;--padding-bottom: .25rem;--padding-start: .75rem;--padding-end: .75rem;--inner-padding-start: 0px !important;--inner-padding-end: 0px !important;--background-hover: var(--dcf-color-gray-8);--background-focused: var(--dcf-color-gray-8)}ion-item.item-lines-full{--padding-top: .5rem;--padding-bottom: .5rem;--padding-start: .25rem;-padding-end:.25rem;padding:0 .65rem}ion-item.item-lines-inset{--padding-top: 0rem !important;--padding-bottom: 0rem !important;--inner-padding-top: .5rem !important;--inner-padding-bottom: .65rem !important}ion-item .dcf-info{min-width:10vw;background:transparent!important}ion-item .dcf-grid{padding:0!important;margin:0!important;min-width:100%!important}ion-item .dcf-item-title{font-style:normal;font-weight:600;width:max-content!important}ion-item .dcf-description{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal;font-weight:400;font-size:.925rem}ion-item::part(native){min-width:100%}ion-item [slot=start]{margin-right:.5rem!important}ion-item [slot=end]{margin-left:.5rem!important}ion-item .dcf-info{font-size:.9rem}ion-item .dcf-info .dcf-subinfo.dcf-line{margin-left:.5rem}@media (min-width: var(--dcf-width-sm)){ion-item .dcf-info .dcf-subinfo.dcf-line{display:block;margin-left:0}}ion-item #dcf-actions{padding:5px}@media (max-width: var(--dcf-width-m)){ion-item #dcf-actions{display:none;pointer-events:none!important;cursor:text!important}ion-item #dcf-actions *{display:none;pointer-events:none!important;cursor:text!important}}@media (max-width: var(--dcf-width-m)){ion-item #dcf-end,ion-item [slot=end]{display:none!important}}ion-item #dcf-end{padding-top:5px;display:flex;align-items:flex-end}ion-item .dcf-icon{display:flex;justify-content:center;align-items:center;text-align:center;margin-right:.5rem!important}ion-item .dcf-icon.dcf-grid-icon{min-width:50px;text-align:left;display:flex;justify-content:flex-start}@media (max-width: var(--dcf-width-s)){ion-item .dcf-icon{align-items:flex-start!important}}.dcf-icon-container{background:var(--dcf-color-gray-1);border-radius:50%;width:45px;height:45px;display:flex;justify-content:center;align-items:center}.dcf-icon-container ::ng-deep ion-icon{font-size:20px;transform:translateY(3px)!important}.dcf-icon-container ::ng-deep .ti{top:1px;left:1px}\n"] }]
|
|
12606
12569
|
}], ctorParameters: () => [], propDecorators: { component: [{
|
|
12607
12570
|
type: ViewChild,
|
|
12608
12571
|
args: ['component', { read: ElementRef, static: false }]
|
|
@@ -12798,8 +12761,7 @@ let SteppedFormComponent = class SteppedFormComponent extends NgxFormDirective {
|
|
|
12798
12761
|
this.pages = this.pageTitles.length;
|
|
12799
12762
|
if (this.paginated) {
|
|
12800
12763
|
if (!this.parentForm)
|
|
12801
|
-
this.parentForm = (this.formGroup?.root ||
|
|
12802
|
-
this.formGroup);
|
|
12764
|
+
this.parentForm = (this.formGroup?.root || this.formGroup);
|
|
12803
12765
|
this.children = [
|
|
12804
12766
|
...this.children.map((c) => {
|
|
12805
12767
|
if (!c.props)
|
|
@@ -13496,7 +13458,7 @@ let FileUploadComponent = class FileUploadComponent extends NgxFormFieldDirectiv
|
|
|
13496
13458
|
})));
|
|
13497
13459
|
}
|
|
13498
13460
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: FileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
13499
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: FileUploadComponent, isStandalone: true, selector: "ngx-decaf-file-upload", inputs: { formGroup: "formGroup", name: "name", formControl: "formControl", required: "required", multiple: "multiple", type: "type", label: "label", buttonLabel: "buttonLabel", size: "size", position: "position", accept: "accept", showIcon: "showIcon", enableDirectoryMode: "enableDirectoryMode", previewHandler: "previewHandler", maxFileSize: "maxFileSize" }, outputs: { changeEvent: "changeEvent" }, viewQueries: [{ propertyName: "component", first: true, predicate: ["component"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"decaf-file-component\" #component>\n <input\n id=\"dcf-file-input\"\n type=\"file\"\n placeholder=\"Select files\"\n [attr.accept]=\"accept\"\n [attr.multiple]=\"multiple ? true : null\"\n (change)=\"handleSelection($event)\"\n [multiple]=\"multiple\"\n hidden\n [attr.webkitdirectory]=\"enableDirectoryMode ? true : null\"\n />\n\n <ngx-decaf-card [className]=\"className\" [body]=\"'blank'\">\n @if(['create', 'update'].includes(operation)) {\n <div>\n <div\n [class]=\"\n 'dcf-drop-area '\n + ' dcf-' + size\n + ' dcf-flex dcf-flex-' + position\n + ' dcf-text-' + position\n \"\n\n [class.dcf-dragging]=\"dragging\"\n [class.dcf-has-files]=\"files.length\"\n (drop)=\"!files?.length ? handleDrop($event) : dragging = false\"\n (dragover)=\"!files?.length ? handleDragOver($event) : dragging = false\"\n (dragleave)=\"!files?.length ? handleDragLeave($event) : dragging = false\"\n >\n <div>\n @if (!previewFile) {\n @if(showIcon) {\n <ngx-decaf-icon name=\"cloud-upload-outline\" size=\"large\" />\n }\n <p class=\"dcf-drag-description\">{{ label ? (label | translate) : (locale + \".drag_file\" | translate) }}</p>\n <ion-button class=\"dcf-button-select\" (click)=\"handleClickToSelect()\" size=\"small\">\n {{ buttonLabel ? (buttonLabel | translate) : (locale + (enableDirectoryMode ? \".buttons.select_directory\" : \".buttons.select\") | translate) }}\n </ion-button>\n <div #container>\n <span class=\"dcf-error\" [innerHTML]=\"getErrors(container)\"></span>\n </div>\n } @else {\n @if ((!directoryMode && !multiple) ) {\n <div class=\"dcf-preview dcf-grid dcf-grid-match dcf-grid-collapse\">\n <div class=\"dcf-width-1-4@m dcf-width-1-3@s dcf-flex dcf-flex-center dcf-flex-middle\">\n <div class=\"dcf-preview-image\">\n <ion-img\n [src]=\"previewFile\"\n [title]=\"locale + '.preview' | translate\"\n [alt]=\"locale + '.preview' | translate\"\n />\n <div class=\"dcf-overlay\">\n <ion-button (click)=\"preview(previewFile)\" fill=\"clear\" color=\"light\" size=\"small\">\n {{ locale + \".buttons.preview\" | translate }}\n </ion-button>\n </div>\n </div>\n </div>\n <div class=\"description dcf-flex dcf-flex-middle dcf-width-expand@s\">\n <div>\n <p class=\"dcf-title\">{{ locale + \".preview\" | translate }}</p>\n <p class=\"subtitle\">{{ files[0].name }}</p>\n <ion-button (click)=\"handleClear()\" fill=\"clear\" color=\"danger\" size=\"small\">{{ locale + \".buttons.clear\" | translate }} </ion-button>\n </div>\n </div>\n </div>\n } @else {\n <div class=\"dcf-margin-bottom\">\n {{ locale + \".selection\" | translate: { \"0\": files.length > 10 ? files.length : `0${files.length}` } }}\n @if(errors.length > 0) {\n <br /><span class=\"dcf-error-message\">{{ locale + \".selection_error\" | translate: { \"0\": errors.length > 10 ? errors.length : `0${errors.length}` } }}</span>\n }\n </div>\n <div class=\"dcf-preview-list-container\">\n <ion-list class=\"dcf-preview-list\">\n @for (file of errors; track $index) {\n <ion-item lines=\"full\" class=\"dcf-error-item\">\n <ion-label slot=\"start\">{{ file.name }}</ion-label>\n <div class=\"dcf-error-message\" slot=\"end\">\n {{ locale + \".errors.\" + file.error | translate: { \"0\": file.error === 'max_size' ? maxFileSize / 1024 / 1024 : file.name.split(\".\") } }}\n </div>\n <ion-note slot=\"end\">{{ file.size / 1024 / 1024 | number: \"1.1-1\" }} MB</ion-note>\n </ion-item>\n }\n\n @for (file of files; track $index) {\n <ion-item lines=\"full\">\n <ion-label slot=\"start\">{{ file.name }}</ion-label>\n <ion-note slot=\"end\">{{ file.size / 1024 / 1024 | number: \"1.1-1\" }} MB</ion-note>\n <div class=\"dcf-flex dcf-flex-middle\" slot=\"end\">\n <ngx-decaf-icon\n [button]=\"true\"\n [slot]=\"'icon-only'\"\n (click)=\"preview(file?.source || file, file.type)\"\n [name]=\"file.type.includes('image') ? 'image-outline' : 'document-text-outline'\"\n />\n <ngx-decaf-icon\n [button]=\"true\"\n [slot]=\"'icon-only'\"\n [name]=\"'trash-outline'\"\n (click)=\"removeFile($index)\"\n [color]=\"'danger'\"\n [size]=\"'small'\"\n />\n </div>\n </ion-item>\n }\n </ion-list>\n </div>\n }\n }\n </div>\n </div>\n </div>\n } @else {\n <div [class]=\"(files?.length > 1 ? 'dcf-preview-list-container' : '')\">\n @if(!files?.length) {\n <div class=\"dcf-padding-xsmall\">\n <ion-text>{{ locale + '.empty' | translate }}</ion-text>\n </div>\n } @else {\n @if(files?.length === 1 && isImageFile(files[0])) {\n <div class=\"dcf-preview dcf-grid dcf-grid-match dcf-grid-collapse read\">\n <div class=\"dcf-width-1-4@m dcf-width-1-3@s dcf-flex dcf-flex-center dcf-flex-middle\">\n <div class=\"dcf-preview-image\">\n <ion-img\n [src]=\"previewFile\"\n [title]=\"locale + '.preview' | translate\"\n [alt]=\"locale + '.preview' | translate\"\n />\n <div class=\"dcf-overlay\">\n <ion-button (click)=\"preview(previewFile)\" fill=\"clear\" color=\"light\" size=\"small\">\n {{ locale + \".buttons.preview\" | translate }}\n </ion-button>\n </div>\n </div>\n </div>\n <div class=\"description dcf-flex dcf-flex-middle dcf-width-expand@s\">\n <div>\n <p class=\"dcf-title\">{{ locale + \".preview\" | translate }}</p>\n <p class=\"subtitle\">{{ files[0].name }}</p>\n </div>\n </div>\n </div>\n } @else {\n <ion-list class=\"dcf-preview-list\">\n @for (file of files; track $index) {\n <ion-item lines=\"full\">\n @if(file?.name) {\n <ion-label slot=\"start\">{{ file.name }}</ion-label>\n }\n <div class=\"dcf-flex dcf-flex-middle\" slot=\"end\">\n <ngx-decaf-icon\n [button]=\"true\"\n [slot]=\"'icon-only'\"\n (click)=\"preview(file.source, file.type)\"\n [name]=\"file.type.includes('image') ? 'image-outline' : 'document-text-outline'\"\n />\n </div>\n </ion-item>\n }\n </ion-list>\n }\n }\n </div>\n }\n </ngx-decaf-card>\n</div>\n\n<!-- <ion-card-header>\n <ion-card-title>Upload de Imagem</ion-card-title>\n </ion-card-header>\n\n <ion-card-content>\n <div\n class=\"dcf-drop-area\"\n [class.dragging]=\"dragging\"\n (drop)=\"onDrop($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n >\n <div class=\"dcf-drop-content\">\n <ion-icon name=\"cloud-upload-outline\" size=\"large\"></ion-icon>\n <p>Arraste e solte aqui ou</p>\n <ion-button size=\"small\" fill=\"outline\" (click)=\"triggerFileSelect()\">Selecionar arquivo</ion-button>\n </div>\n </div>\n\n <input\n #fileInput\n type=\"file\"\n [attr.accept]=\"accept\"\n [attr.multiple]=\"multiple ? true : null\"\n (change)=\"onFileSelected($event)\"\n hidden\n />\n\n <div *ngIf=\"previewUrl\" class=\"dcf-preview\">\n <ion-item>\n <div slot=\"start\">\n <ion-img [src]=\"previewUrl\"></ion-img>\n </div>\n <ion-label>\n <h3>Pr\u00E9-visualiza\u00E7\u00E3o</h3>\n <p *ngIf=\"files.length\">{{ files[0].name }}</p>\n </ion-label>\n </ion-item>\n </div>\n\n <ion-list *ngIf=\"files.length\">\n <ion-list-header>\n <ion-label>Arquivos selecionados</ion-label>\n </ion-list-header>\n <ion-item *ngFor=\"let f of files; let i = index\">\n <ion-label>{{ f.name }}</ion-label>\n <ion-note slot=\"end\">{{ (f.size / 1024 / 1024) | number:'1.1-1' }} MB</ion-note>\n <ion-button fill=\"clear\" slot=\"end\" (click)=\"removeFile(i)\">\n <ion-icon slot=\"icon-only\" name=\"close-circle\"></ion-icon>\n </ion-button>\n </ion-item>\n </ion-list>\n\n <div *ngIf=\"errors.length\">\n <ion-list>\n <ion-item *ngFor=\"let err of errors\">\n <ion-icon name=\"alert-circle\" slot=\"start\" color=\"danger\"></ion-icon>\n <ion-label color=\"danger\">{{ err }}</ion-label>\n </ion-item>\n </ion-list>\n </div>\n\n <ion-row class=\"dcf-actions\">\n <ion-col>\n <ion-button expand=\"block\" (click)=\"triggerFileSelect()\">Selecionar</ion-button>\n </ion-col>\n <ion-col>\n <ion-button expand=\"block\" color=\"danger\" fill=\"outline\" (click)=\"clear()\">Limpar</ion-button>\n </ion-col>\n </ion-row>\n </ion-card-content> -->\n", styles: [".decaf-file-component.dcf-palette-dark .dcf-button-select{--background: rgb(var(--dcf-color-light-rgb), .1) !important;--background-hover: rgb(var(--dcf-color-light-rgb), .75) !important;--background-activated: rgb(var(--dcf-color-light-rgb), .4) !important;--background-focused: rgb(var(--dcf-color-light-rgb), .4) !important;--color: var(--dcf-color-light) !important}.decaf-file-component.dcf-palette-dark .dcf-has-files{border-style:solid;border-color:var(--dcf-color-gray-6)!important}.decaf-file-component .dcf-upload-icon{--box-shadow: none !important}.decaf-file-component .dcf-upload-icon ion-icon{width:1.5rem!important}.decaf-file-component ion-button.dcf-button-select{--background: rgb(var(--dcf-color-primary-rgb), .1);--background-hover: rgb(var(--dcf-color-primary-rgb), .75);--background-activated: rgb(var(--dcf-color-primary-rgb), .4);--background-focused: rgb(var(--dcf-color-primary-rgb), .4);--color: var(--dcf-color-primary-shade);--border-radius: var(--dcf-border-radius-small);--box-shadow: none;--padding-top: var(--dcf-padding-xsmall);--padding-bottom: var(--dcf-padding-xsmall);--padding-start: var(--dcf-padding-small);--padding-end: var(--dcf-padding-small);font-weight:500;text-transform:none;margin-top:var(--dcf-margin-small)!important}.decaf-file-component .dcf-error{color:var(--dcf-color-danger)!important;font-size:.8rem!important;font-weight:500!important;line-height:1.1rem;z-index:9999;animation-duration:.05s;animation-timing-function:ease-in;animation-fill-mode:both;animation-name:fadeBottomSmallAnimation}.decaf-file-component .dcf-error .ti,.decaf-file-component .dcf-error ion-icon{position:relative;top:2px!important;min-width:20px;font-size:1rem!important;text-align:left}.decaf-file-component ion-card-content{width:100%}.decaf-file-component .dcf-error-message{color:var(--dcf-color-danger);font-size:.875rem}.decaf-file-component .dcf-drag-description{font-size:1rem;line-height:1.5rem;font-weight:500;margin-bottom:var(--dcf-margin-small)}.decaf-file-component .dcf-drop-area{display:flex;align-items:center;border:1.5px dashed var(--dcf-color-gray-3);border-radius:var(--dcf-border-radius-small)!important;transition:border-style .15s ease,border-color .15s ease;background:transparent}.decaf-file-component .dcf-drop-area.dcf-large{min-height:180px}.decaf-file-component .dcf-drop-area>div{width:100%}.decaf-file-component .dcf-drop-area.dcf-has-files{border-style:solid;border-color:var(--dcf-color-primary-shade);transition:border-style .15s ease,border-color .15s ease;padding:var(--dcf-spacement) var(--dcf-spacement-small)!important}.decaf-file-component .dcf-drop-area:not(.dcf-has-files){border-style:dashed;padding:var(--dcf-spacement) var(--dcf-spacement-medium)}.decaf-file-component .dcf-drop-area.dcf-dragging{background:#00000008;border-color:var(--ion-color-primary);box-shadow:0 2px 8px #0000000f}.decaf-file-component .dcf-preview{padding:var(--dcf-padding-xsmall) var(--dcf-spacement-small)!important}.decaf-file-component .dcf-preview.read{padding:var(--dcf-spacement)!important}.decaf-file-component .dcf-preview .dcf-preview-image{border:1px solid var(--dcf-color-gray-3);border-radius:var(--dcf-border-radius-xsmall);max-width:320px;padding:.5rem;box-sizing:border-box;height:160px;position:relative;cursor:pointer;overflow:hidden}.decaf-file-component .dcf-preview .dcf-preview-image ion-img{height:140px!important;display:block;width:100%}.decaf-file-component .dcf-preview .dcf-preview-image:hover .dcf-overlay{opacity:1}.decaf-file-component .dcf-preview .dcf-preview-image .dcf-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background:#0009;display:flex;justify-content:center;align-items:center;opacity:0;transition:opacity .3s ease}.decaf-file-component .dcf-preview .description{text-align:left;padding:1rem;font-size:.75rem}.decaf-file-component .dcf-preview .description .dcf-title{font-size:1rem;font-weight:500}.decaf-file-component .dcf-preview .description ion-button{margin-top:var(--dcf-margin-small)!important}.decaf-file-component .dcf-preview-list-container{max-height:150px;overflow-y:auto}.decaf-file-component .dcf-preview-list-container ion-list{padding:0!important;margin:0!important}@media (max-width: 767px){.decaf-file-component .dcf-preview-list-container ion-list{width:100%;min-width:576px;overflow-x:auto}}.decaf-file-component .dcf-preview-list-container:not(:hover){scrollbar-color:rgba(var(--dcf-color-medium-rgb),.125) transparent!important}.decaf-file-component .dcf-preview-list-container ion-item{font-size:.875rem!important}.decaf-file-component .dcf-preview-list-container ion-item.dcf-error-item{--background: rgba(var(--dcf-color-danger-rgb), .02) !important;--border-color: rgba(var(--dcf-color-danger-rgb), .2) !important}.decaf-file-component .dcf-preview-list-container ion-item ion-item{--padding-top: .25rem;--padding-bottom: 0rem;--inner-padding-start: 0rem;--padding-start: var(--dcf-padding-xsmall) !important;--padding-end: 0rem;--inner-padding-end: var(--dcf-padding-xsmall) !important;--background-hover: var(--dcf-color-gray-8);--background-focused: var(--dcf-color-gray-8);--background-hover-opacity: .1;--background-focused-opacity: .1;--border-color: var(--dcf-color-gray-2)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: CardComponent, selector: "ngx-decaf-card", inputs: ["type", "title", "body", "subtitle", "color", "separator", "borders", "inlineContent", "inlineContentPosition"] }, { kind: "component", type: IonText, selector: "ion-text", inputs: ["color", "mode"] }, { kind: "component", type: IconComponent, selector: "ngx-decaf-icon", inputs: ["name", "color", "slot", "button", "buttonFill", "buttonShape", "width", "size", "inline"] }, { kind: "component", type: IonList, selector: "ion-list", inputs: ["inset", "lines", "mode"] }, { kind: "component", type: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "pipe", type: i1$1.DecimalPipe, name: "number" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
13461
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: FileUploadComponent, isStandalone: true, selector: "ngx-decaf-file-upload", inputs: { formGroup: "formGroup", name: "name", formControl: "formControl", required: "required", multiple: "multiple", type: "type", buttonLabel: "buttonLabel", size: "size", position: "position", accept: "accept", showIcon: "showIcon", enableDirectoryMode: "enableDirectoryMode", previewHandler: "previewHandler", maxFileSize: "maxFileSize" }, outputs: { changeEvent: "changeEvent" }, viewQueries: [{ propertyName: "component", first: true, predicate: ["component"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"decaf-file-component\" #component>\n <input\n id=\"dcf-file-input\"\n type=\"file\"\n placeholder=\"Select files\"\n [attr.accept]=\"accept\"\n [attr.multiple]=\"multiple ? true : null\"\n (change)=\"handleSelection($event)\"\n [multiple]=\"multiple\"\n hidden\n [attr.webkitdirectory]=\"enableDirectoryMode ? true : null\"\n />\n\n <ngx-decaf-card [className]=\"className\" [body]=\"'blank'\">\n @if(['create', 'update'].includes(operation)) {\n <div>\n <div\n [class]=\"\n 'dcf-drop-area '\n + ' dcf-' + size\n + ' dcf-flex dcf-flex-' + position\n + ' dcf-text-' + position\n \"\n\n [class.dcf-dragging]=\"dragging\"\n [class.dcf-has-files]=\"files.length\"\n (drop)=\"!files?.length ? handleDrop($event) : dragging = false\"\n (dragover)=\"!files?.length ? handleDragOver($event) : dragging = false\"\n (dragleave)=\"!files?.length ? handleDragLeave($event) : dragging = false\"\n >\n <div>\n @if (!previewFile) {\n @if(showIcon) {\n <ngx-decaf-icon name=\"cloud-upload-outline\" size=\"large\" />\n }\n <p class=\"dcf-drag-description\">{{ label ? (label | translate) : (locale + \".drag_file\" | translate) }}</p>\n <ion-button class=\"dcf-button-select\" (click)=\"handleClickToSelect()\" size=\"small\">\n {{ buttonLabel ? (buttonLabel | translate) : (locale + (enableDirectoryMode ? \".buttons.select_directory\" : \".buttons.select\") | translate) }}\n </ion-button>\n <div #container>\n <span class=\"dcf-error\" [innerHTML]=\"getErrors(container)\"></span>\n </div>\n } @else {\n @if ((!directoryMode && !multiple) ) {\n <div class=\"dcf-preview dcf-grid dcf-grid-match dcf-grid-collapse\">\n <div class=\"dcf-width-1-4@m dcf-width-1-3@s dcf-flex dcf-flex-center dcf-flex-middle\">\n <div class=\"dcf-preview-image\">\n <ion-img\n [src]=\"previewFile\"\n [title]=\"locale + '.preview' | translate\"\n [alt]=\"locale + '.preview' | translate\"\n />\n <div class=\"dcf-overlay\">\n <ion-button (click)=\"preview(previewFile)\" fill=\"clear\" color=\"light\" size=\"small\">\n {{ locale + \".buttons.preview\" | translate }}\n </ion-button>\n </div>\n </div>\n </div>\n <div class=\"description dcf-flex dcf-flex-middle dcf-width-expand@s\">\n <div>\n <p class=\"dcf-title\">{{ locale + \".preview\" | translate }}</p>\n <p class=\"subtitle\">{{ files[0].name }}</p>\n <ion-button (click)=\"handleClear()\" fill=\"clear\" color=\"danger\" size=\"small\">{{ locale + \".buttons.clear\" | translate }} </ion-button>\n </div>\n </div>\n </div>\n } @else {\n <div class=\"dcf-margin-bottom\">\n {{ locale + \".selection\" | translate: { \"0\": files.length > 10 ? files.length : `0${files.length}` } }}\n @if(errors.length > 0) {\n <br /><span class=\"dcf-error-message\">{{ locale + \".selection_error\" | translate: { \"0\": errors.length > 10 ? errors.length : `0${errors.length}` } }}</span>\n }\n </div>\n <div class=\"dcf-preview-list-container\">\n <ion-list class=\"dcf-preview-list\">\n @for (file of errors; track $index) {\n <ion-item lines=\"full\" class=\"dcf-error-item\">\n <ion-label slot=\"start\">{{ file.name }}</ion-label>\n <div class=\"dcf-error-message\" slot=\"end\">\n {{ locale + \".errors.\" + file.error | translate: { \"0\": file.error === 'max_size' ? maxFileSize / 1024 / 1024 : file.name.split(\".\") } }}\n </div>\n <ion-note slot=\"end\">{{ file.size / 1024 / 1024 | number: \"1.1-1\" }} MB</ion-note>\n </ion-item>\n }\n\n @for (file of files; track $index) {\n <ion-item lines=\"full\">\n <ion-label slot=\"start\">{{ file.name }}</ion-label>\n <ion-note slot=\"end\">{{ file.size / 1024 / 1024 | number: \"1.1-1\" }} MB</ion-note>\n <div class=\"dcf-flex dcf-flex-middle\" slot=\"end\">\n <ngx-decaf-icon\n [button]=\"true\"\n [slot]=\"'icon-only'\"\n (click)=\"preview(file?.source || file, file.type)\"\n [name]=\"file.type.includes('image') ? 'image-outline' : 'document-text-outline'\"\n />\n <ngx-decaf-icon\n [button]=\"true\"\n [slot]=\"'icon-only'\"\n [name]=\"'trash-outline'\"\n (click)=\"removeFile($index)\"\n [color]=\"'danger'\"\n [size]=\"'small'\"\n />\n </div>\n </ion-item>\n }\n </ion-list>\n </div>\n }\n }\n </div>\n </div>\n </div>\n } @else {\n <div [class]=\"(files?.length > 1 ? 'dcf-preview-list-container' : '')\">\n @if(!files?.length) {\n <div class=\"dcf-padding-xsmall\">\n <ion-text>{{ locale + '.empty' | translate }}</ion-text>\n </div>\n } @else {\n @if(files?.length === 1 && isImageFile(files[0])) {\n <div class=\"dcf-preview dcf-grid dcf-grid-match dcf-grid-collapse read\">\n <div class=\"dcf-width-1-4@m dcf-width-1-3@s dcf-flex dcf-flex-center dcf-flex-middle\">\n <div class=\"dcf-preview-image\">\n <ion-img\n [src]=\"previewFile\"\n [title]=\"locale + '.preview' | translate\"\n [alt]=\"locale + '.preview' | translate\"\n />\n <div class=\"dcf-overlay\">\n <ion-button (click)=\"preview(previewFile)\" fill=\"clear\" color=\"light\" size=\"small\">\n {{ locale + \".buttons.preview\" | translate }}\n </ion-button>\n </div>\n </div>\n </div>\n <div class=\"description dcf-flex dcf-flex-middle dcf-width-expand@s\">\n <div>\n <p class=\"dcf-title\">{{ locale + \".preview\" | translate }}</p>\n <p class=\"subtitle\">{{ files[0].name }}</p>\n </div>\n </div>\n </div>\n } @else {\n <ion-list class=\"dcf-preview-list\">\n @for (file of files; track $index) {\n <ion-item lines=\"full\">\n @if(file?.name) {\n <ion-label slot=\"start\">{{ file.name }}</ion-label>\n }\n <div class=\"dcf-flex dcf-flex-middle\" slot=\"end\">\n <ngx-decaf-icon\n [button]=\"true\"\n [slot]=\"'icon-only'\"\n (click)=\"preview(file.source, file.type)\"\n [name]=\"file.type.includes('image') ? 'image-outline' : 'document-text-outline'\"\n />\n </div>\n </ion-item>\n }\n </ion-list>\n }\n }\n </div>\n }\n </ngx-decaf-card>\n</div>\n\n<!-- <ion-card-header>\n <ion-card-title>Upload de Imagem</ion-card-title>\n </ion-card-header>\n\n <ion-card-content>\n <div\n class=\"dcf-drop-area\"\n [class.dragging]=\"dragging\"\n (drop)=\"onDrop($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n >\n <div class=\"dcf-drop-content\">\n <ion-icon name=\"cloud-upload-outline\" size=\"large\"></ion-icon>\n <p>Arraste e solte aqui ou</p>\n <ion-button size=\"small\" fill=\"outline\" (click)=\"triggerFileSelect()\">Selecionar arquivo</ion-button>\n </div>\n </div>\n\n <input\n #fileInput\n type=\"file\"\n [attr.accept]=\"accept\"\n [attr.multiple]=\"multiple ? true : null\"\n (change)=\"onFileSelected($event)\"\n hidden\n />\n\n <div *ngIf=\"previewUrl\" class=\"dcf-preview\">\n <ion-item>\n <div slot=\"start\">\n <ion-img [src]=\"previewUrl\"></ion-img>\n </div>\n <ion-label>\n <h3>Pr\u00E9-visualiza\u00E7\u00E3o</h3>\n <p *ngIf=\"files.length\">{{ files[0].name }}</p>\n </ion-label>\n </ion-item>\n </div>\n\n <ion-list *ngIf=\"files.length\">\n <ion-list-header>\n <ion-label>Arquivos selecionados</ion-label>\n </ion-list-header>\n <ion-item *ngFor=\"let f of files; let i = index\">\n <ion-label>{{ f.name }}</ion-label>\n <ion-note slot=\"end\">{{ (f.size / 1024 / 1024) | number:'1.1-1' }} MB</ion-note>\n <ion-button fill=\"clear\" slot=\"end\" (click)=\"removeFile(i)\">\n <ion-icon slot=\"icon-only\" name=\"close-circle\"></ion-icon>\n </ion-button>\n </ion-item>\n </ion-list>\n\n <div *ngIf=\"errors.length\">\n <ion-list>\n <ion-item *ngFor=\"let err of errors\">\n <ion-icon name=\"alert-circle\" slot=\"start\" color=\"danger\"></ion-icon>\n <ion-label color=\"danger\">{{ err }}</ion-label>\n </ion-item>\n </ion-list>\n </div>\n\n <ion-row class=\"dcf-actions\">\n <ion-col>\n <ion-button expand=\"block\" (click)=\"triggerFileSelect()\">Selecionar</ion-button>\n </ion-col>\n <ion-col>\n <ion-button expand=\"block\" color=\"danger\" fill=\"outline\" (click)=\"clear()\">Limpar</ion-button>\n </ion-col>\n </ion-row>\n </ion-card-content> -->\n", styles: [".decaf-file-component.dcf-palette-dark .dcf-button-select{--background: rgb(var(--dcf-color-light-rgb), .1) !important;--background-hover: rgb(var(--dcf-color-light-rgb), .75) !important;--background-activated: rgb(var(--dcf-color-light-rgb), .4) !important;--background-focused: rgb(var(--dcf-color-light-rgb), .4) !important;--color: var(--dcf-color-light) !important}.decaf-file-component.dcf-palette-dark .dcf-has-files{border-style:solid;border-color:var(--dcf-color-gray-6)!important}.decaf-file-component .dcf-upload-icon{--box-shadow: none !important}.decaf-file-component .dcf-upload-icon ion-icon{width:1.5rem!important}.decaf-file-component ion-button.dcf-button-select{--background: rgb(var(--dcf-color-primary-rgb), .1);--background-hover: rgb(var(--dcf-color-primary-rgb), .75);--background-activated: rgb(var(--dcf-color-primary-rgb), .4);--background-focused: rgb(var(--dcf-color-primary-rgb), .4);--color: var(--dcf-color-primary-shade);--border-radius: var(--dcf-border-radius-small);--box-shadow: none;--padding-top: var(--dcf-padding-xsmall);--padding-bottom: var(--dcf-padding-xsmall);--padding-start: var(--dcf-padding-small);--padding-end: var(--dcf-padding-small);font-weight:500;text-transform:none;margin-top:var(--dcf-margin-small)!important}.decaf-file-component .dcf-error{color:var(--dcf-color-danger)!important;font-size:.8rem!important;font-weight:500!important;line-height:1.1rem;z-index:9999;animation-duration:.05s;animation-timing-function:ease-in;animation-fill-mode:both;animation-name:fadeBottomSmallAnimation}.decaf-file-component .dcf-error .ti,.decaf-file-component .dcf-error ion-icon{position:relative;top:2px!important;min-width:20px;font-size:1rem!important;text-align:left}.decaf-file-component ion-card-content{width:100%}.decaf-file-component .dcf-error-message{color:var(--dcf-color-danger);font-size:.875rem}.decaf-file-component .dcf-drag-description{font-size:1rem;line-height:1.5rem;font-weight:500;margin-bottom:var(--dcf-margin-small)}.decaf-file-component .dcf-drop-area{display:flex;align-items:center;border:1.5px dashed var(--dcf-color-gray-3);border-radius:var(--dcf-border-radius-small)!important;transition:border-style .15s ease,border-color .15s ease;background:transparent}.decaf-file-component .dcf-drop-area.dcf-large{min-height:180px}.decaf-file-component .dcf-drop-area>div{width:100%}.decaf-file-component .dcf-drop-area.dcf-has-files{border-style:solid;border-color:var(--dcf-color-primary-shade);transition:border-style .15s ease,border-color .15s ease;padding:var(--dcf-spacement) var(--dcf-spacement-small)!important}.decaf-file-component .dcf-drop-area:not(.dcf-has-files){border-style:dashed;padding:var(--dcf-spacement) var(--dcf-spacement-medium)}.decaf-file-component .dcf-drop-area.dcf-dragging{background:#00000008;border-color:var(--ion-color-primary);box-shadow:0 2px 8px #0000000f}.decaf-file-component .dcf-preview{padding:var(--dcf-padding-xsmall) var(--dcf-spacement-small)!important}.decaf-file-component .dcf-preview.read{padding:var(--dcf-spacement)!important}.decaf-file-component .dcf-preview .dcf-preview-image{border:1px solid var(--dcf-color-gray-3);border-radius:var(--dcf-border-radius-xsmall);max-width:320px;padding:.5rem;box-sizing:border-box;height:160px;position:relative;cursor:pointer;overflow:hidden}.decaf-file-component .dcf-preview .dcf-preview-image ion-img{height:140px!important;display:block;width:100%}.decaf-file-component .dcf-preview .dcf-preview-image:hover .dcf-overlay{opacity:1}.decaf-file-component .dcf-preview .dcf-preview-image .dcf-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background:#0009;display:flex;justify-content:center;align-items:center;opacity:0;transition:opacity .3s ease}.decaf-file-component .dcf-preview .description{text-align:left;padding:1rem;font-size:.75rem}.decaf-file-component .dcf-preview .description .dcf-title{font-size:1rem;font-weight:500}.decaf-file-component .dcf-preview .description ion-button{margin-top:var(--dcf-margin-small)!important}.decaf-file-component .dcf-preview-list-container{max-height:150px;overflow-y:auto}.decaf-file-component .dcf-preview-list-container ion-list{padding:0!important;margin:0!important}@media (max-width: 767px){.decaf-file-component .dcf-preview-list-container ion-list{width:100%;min-width:576px;overflow-x:auto}}.decaf-file-component .dcf-preview-list-container:not(:hover){scrollbar-color:rgba(var(--dcf-color-medium-rgb),.125) transparent!important}.decaf-file-component .dcf-preview-list-container ion-item{font-size:.875rem!important}.decaf-file-component .dcf-preview-list-container ion-item.dcf-error-item{--background: rgba(var(--dcf-color-danger-rgb), .02) !important;--border-color: rgba(var(--dcf-color-danger-rgb), .2) !important}.decaf-file-component .dcf-preview-list-container ion-item ion-item{--padding-top: .25rem;--padding-bottom: 0rem;--inner-padding-start: 0rem;--padding-start: var(--dcf-padding-xsmall) !important;--padding-end: 0rem;--inner-padding-end: var(--dcf-padding-xsmall) !important;--background-hover: var(--dcf-color-gray-8);--background-focused: var(--dcf-color-gray-8);--background-hover-opacity: .1;--background-focused-opacity: .1;--border-color: var(--dcf-color-gray-2)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: CardComponent, selector: "ngx-decaf-card", inputs: ["type", "title", "body", "subtitle", "color", "separator", "borders", "inlineContent", "inlineContentPosition"] }, { kind: "component", type: IonText, selector: "ion-text", inputs: ["color", "mode"] }, { kind: "component", type: IconComponent, selector: "ngx-decaf-icon", inputs: ["name", "color", "slot", "button", "buttonFill", "buttonShape", "width", "size", "inline"] }, { kind: "component", type: IonList, selector: "ion-list", inputs: ["inset", "lines", "mode"] }, { kind: "component", type: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "pipe", type: i1$1.DecimalPipe, name: "number" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
13500
13462
|
};
|
|
13501
13463
|
FileUploadComponent = __decorate([
|
|
13502
13464
|
Dynamic(),
|
|
@@ -13531,8 +13493,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
13531
13493
|
type: Input
|
|
13532
13494
|
}], type: [{
|
|
13533
13495
|
type: Input
|
|
13534
|
-
}], label: [{
|
|
13535
|
-
type: Input
|
|
13536
13496
|
}], buttonLabel: [{
|
|
13537
13497
|
type: Input
|
|
13538
13498
|
}], size: [{
|
|
@@ -13731,7 +13691,7 @@ class NgxRouterService {
|
|
|
13731
13691
|
* @memberOf RouterService
|
|
13732
13692
|
*/
|
|
13733
13693
|
getQueryParamValue(param) {
|
|
13734
|
-
return
|
|
13694
|
+
return this.parseAllQueryParams(param)?.[0]?.[param] || undefined;
|
|
13735
13695
|
}
|
|
13736
13696
|
/**
|
|
13737
13697
|
* @description Retrieves the last segment of the current URL.
|
|
@@ -13760,9 +13720,7 @@ class NgxRouterService {
|
|
|
13760
13720
|
* @memberOf RouterService
|
|
13761
13721
|
*/
|
|
13762
13722
|
getLastUrlSegment() {
|
|
13763
|
-
return (this.router.url || globalThis.window.location.href)
|
|
13764
|
-
.split('/')
|
|
13765
|
-
.pop();
|
|
13723
|
+
return (this.router.url || globalThis.window.location.href).split('/').pop();
|
|
13766
13724
|
}
|
|
13767
13725
|
/**
|
|
13768
13726
|
* @description Retrieves the current URL of the application.
|
|
@@ -13825,8 +13783,7 @@ class NgxRouterService {
|
|
|
13825
13783
|
const currentNavigation = this.router.getCurrentNavigation();
|
|
13826
13784
|
if (!!currentNavigation &&
|
|
13827
13785
|
currentNavigation.previousNavigation?.finalUrl?.toString() !== undefined)
|
|
13828
|
-
this.previousUrl =
|
|
13829
|
-
currentNavigation.previousNavigation?.finalUrl?.toString();
|
|
13786
|
+
this.previousUrl = currentNavigation.previousNavigation?.finalUrl?.toString();
|
|
13830
13787
|
return this.previousUrl;
|
|
13831
13788
|
}
|
|
13832
13789
|
/**
|
|
@@ -13929,24 +13886,16 @@ let TableComponent = class TableComponent extends ListComponent {
|
|
|
13929
13886
|
}, {});
|
|
13930
13887
|
}
|
|
13931
13888
|
async ngOnInit() {
|
|
13932
|
-
this.
|
|
13889
|
+
// this.parseProps(this);
|
|
13890
|
+
await super.initialize();
|
|
13933
13891
|
this.type = ListComponentsTypes.PAGINATED;
|
|
13934
13892
|
this.empty = Object.assign({}, DefaultListEmptyOptions, this.empty);
|
|
13935
|
-
if (!this.initialized) {
|
|
13936
|
-
this.parseProps(this);
|
|
13937
|
-
}
|
|
13938
13893
|
this.repositoryObserverSubject
|
|
13939
13894
|
.pipe(debounceTime(100), shareReplay$1(1), takeUntil$1(this.destroySubscriptions$))
|
|
13940
13895
|
.subscribe(([modelInstance, event, uid]) => this.handleObserveEvent(modelInstance, event, uid));
|
|
13941
13896
|
this.cols = this._cols;
|
|
13942
|
-
|
|
13943
|
-
this.allowOperations =
|
|
13944
|
-
this.isAllowed(OperationKeys.UPDATE) || this.isAllowed(OperationKeys.DELETE);
|
|
13897
|
+
this.getOperations();
|
|
13945
13898
|
this.searchValue = undefined;
|
|
13946
|
-
if (this.operations) {
|
|
13947
|
-
this.cols.push('actions');
|
|
13948
|
-
}
|
|
13949
|
-
this.headers = this._headers;
|
|
13950
13899
|
const filter = this.routerService.getQueryParamValue('filter');
|
|
13951
13900
|
if (filter) {
|
|
13952
13901
|
const value = this.routerService.getQueryParamValue('value');
|
|
@@ -13967,9 +13916,21 @@ let TableComponent = class TableComponent extends ListComponent {
|
|
|
13967
13916
|
if (this.filterModel) {
|
|
13968
13917
|
await this.getFilterOptions();
|
|
13969
13918
|
}
|
|
13970
|
-
await super.initialize();
|
|
13971
13919
|
await this.refresh();
|
|
13972
13920
|
}
|
|
13921
|
+
getOperations() {
|
|
13922
|
+
if (this.allowOperations) {
|
|
13923
|
+
this.allowOperations =
|
|
13924
|
+
this.isAllowed(OperationKeys.UPDATE) || this.isAllowed(OperationKeys.DELETE);
|
|
13925
|
+
}
|
|
13926
|
+
else {
|
|
13927
|
+
this.operations = [];
|
|
13928
|
+
}
|
|
13929
|
+
if (this.operations?.length) {
|
|
13930
|
+
this.cols.push('actions');
|
|
13931
|
+
}
|
|
13932
|
+
this.headers = this._headers;
|
|
13933
|
+
}
|
|
13973
13934
|
async getFilterOptions() {
|
|
13974
13935
|
const repo = getModelAndRepository(this.filterModel);
|
|
13975
13936
|
if (repo) {
|
|
@@ -13989,54 +13950,93 @@ let TableComponent = class TableComponent extends ListComponent {
|
|
|
13989
13950
|
this.filterOptions = query.map((item) => this.filterOptionsMapper(item));
|
|
13990
13951
|
}
|
|
13991
13952
|
}
|
|
13992
|
-
itemMapper(item, mapper, props = {}) {
|
|
13953
|
+
async itemMapper(item, mapper, props = {}) {
|
|
13993
13954
|
this.model = item;
|
|
13994
13955
|
const mapped = super.itemMapper(item, this.cols.filter((c) => c !== 'actions'), props);
|
|
13995
13956
|
const { children } = this.props || [];
|
|
13996
|
-
|
|
13997
|
-
|
|
13998
|
-
|
|
13999
|
-
|
|
14000
|
-
|
|
14001
|
-
|
|
14002
|
-
|
|
14003
|
-
|
|
14004
|
-
|
|
14005
|
-
|
|
14006
|
-
|
|
14007
|
-
|
|
14008
|
-
|
|
14009
|
-
|
|
13957
|
+
const entries = Object.entries(mapped);
|
|
13958
|
+
for (const [curr, value] of entries) {
|
|
13959
|
+
const getEvents = async (index, name) => {
|
|
13960
|
+
try {
|
|
13961
|
+
const child = children.find((c) => c?.['props']?.name === name);
|
|
13962
|
+
if (child) {
|
|
13963
|
+
const { events, name } = child?.['props'] || {};
|
|
13964
|
+
if (events) {
|
|
13965
|
+
const sequence = String(index);
|
|
13966
|
+
const evts = this.parseEvents(events, this);
|
|
13967
|
+
for (const [key, evt] of Object.entries(evts)) {
|
|
13968
|
+
const handler = evt;
|
|
13969
|
+
if (key === ComponentEventNames.Render) {
|
|
13970
|
+
if (handler?.name === ComponentEventNames.Render) {
|
|
13971
|
+
mapped[sequence] = {
|
|
13972
|
+
...mapped[sequence],
|
|
13973
|
+
value: await handler.bind(this)(this, name, value),
|
|
13974
|
+
};
|
|
13975
|
+
}
|
|
13976
|
+
else {
|
|
13977
|
+
const handlerFn = await handler(this, name, value);
|
|
13978
|
+
mapped[sequence] = {
|
|
13979
|
+
...mapped[sequence],
|
|
13980
|
+
value: name + ' ' + typeof handlerFn === 'function' || handlerFn instanceof Promise
|
|
13981
|
+
? await handlerFn.bind(this)(this, name, value)
|
|
13982
|
+
: handlerFn,
|
|
13983
|
+
};
|
|
13984
|
+
}
|
|
13985
|
+
}
|
|
13986
|
+
if (key === 'handleClick' || key === 'handleAction') {
|
|
13987
|
+
mapped[sequence] = {
|
|
13988
|
+
...mapped[sequence],
|
|
13989
|
+
handler: {
|
|
13990
|
+
index: Number(sequence),
|
|
13991
|
+
handle: handler.bind(this),
|
|
13992
|
+
},
|
|
13993
|
+
};
|
|
13994
|
+
}
|
|
13995
|
+
}
|
|
14010
13996
|
}
|
|
14011
13997
|
}
|
|
13998
|
+
return value;
|
|
13999
|
+
}
|
|
14000
|
+
catch (error) {
|
|
14001
|
+
this.log
|
|
14002
|
+
.for(this.itemMapper)
|
|
14003
|
+
.error(`Error mapping child events. ${error?.message || error}`);
|
|
14012
14004
|
}
|
|
14013
|
-
}
|
|
14014
|
-
const parserFn = mapper[this.cols[index]]?.valueParserFn || undefined;
|
|
14015
|
-
return {
|
|
14016
|
-
...accum,
|
|
14017
|
-
[curr]: parserFn ? parserFn(mapped[curr], this) : mapped[curr],
|
|
14018
14005
|
};
|
|
14019
|
-
|
|
14006
|
+
const name = this.cols[Number(curr)];
|
|
14007
|
+
const index = Number(curr);
|
|
14008
|
+
const parserFn = mapper[name]?.valueParserFn || undefined;
|
|
14009
|
+
const resolvedValue = parserFn ? await parserFn(this, name, value) : value;
|
|
14010
|
+
mapped[curr] = {
|
|
14011
|
+
prop: name ?? this.pk,
|
|
14012
|
+
value: resolvedValue,
|
|
14013
|
+
index: index || 0,
|
|
14014
|
+
};
|
|
14015
|
+
await getEvents(index, name);
|
|
14016
|
+
}
|
|
14017
|
+
return mapped;
|
|
14020
14018
|
}
|
|
14021
14019
|
async mapResults(data) {
|
|
14020
|
+
this._data = [...data];
|
|
14022
14021
|
if (!data || !data.length)
|
|
14023
14022
|
return [];
|
|
14024
|
-
return data.
|
|
14025
|
-
...accum,
|
|
14026
|
-
this.itemMapper(curr, this.mapper, { uid: curr[this.pk] }),
|
|
14027
|
-
], []);
|
|
14023
|
+
return await Promise.all(data.map(async (curr) => await this.itemMapper(curr, this.mapper, { uid: curr[this.pk] })));
|
|
14028
14024
|
}
|
|
14029
|
-
async handleAction(event,
|
|
14030
|
-
if (
|
|
14031
|
-
|
|
14025
|
+
async handleAction(event, handler, uid, action) {
|
|
14026
|
+
if (handler) {
|
|
14027
|
+
const handlerFn = await handler(this, event, uid);
|
|
14028
|
+
return typeof handlerFn === 'function' ? handlerFn() : handlerFn;
|
|
14032
14029
|
}
|
|
14033
|
-
|
|
14030
|
+
await this.handleRedirect(event, uid, action);
|
|
14031
|
+
}
|
|
14032
|
+
async handleRedirect(event, uid, action) {
|
|
14033
|
+
if (event instanceof Event) {
|
|
14034
|
+
event.preventDefault();
|
|
14035
|
+
event.stopImmediatePropagation();
|
|
14036
|
+
}
|
|
14037
|
+
if (this.operations.includes(action)) {
|
|
14034
14038
|
await this.router.navigate([`/${this.route}/${action}/${uid}`]);
|
|
14035
14039
|
}
|
|
14036
|
-
event.stopImmediatePropagation();
|
|
14037
|
-
const data = this.items.find((item) => item['uid'] === uid);
|
|
14038
|
-
if (data)
|
|
14039
|
-
this.listenEvent.emit({ name: ComponentEventNames.Click, data });
|
|
14040
14040
|
}
|
|
14041
14041
|
async openFilterSelectOptions(event) {
|
|
14042
14042
|
const type = this.filterOptions.length > 10 ? SelectFieldInterfaces.MODAL : SelectFieldInterfaces.POPOVER;
|
|
@@ -14070,7 +14070,7 @@ let TableComponent = class TableComponent extends ListComponent {
|
|
|
14070
14070
|
}
|
|
14071
14071
|
}
|
|
14072
14072
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
14073
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: TableComponent, isStandalone: true, selector: "ngx-decaf-table", inputs: { filterModel: "filterModel", filterOptions: "filterOptions", filterLabel: "filterLabel", filterOptionsMapper: "filterOptionsMapper", allowOperations: "allowOperations" }, usesInheritance: true, ngImport: i0, template: "@if (showSearchbar && (data?.length || searching)) {\n <div class=\"dcf-grid-actions\">\n <div class=\"dcf-grid dcf-grid-small\">\n <div class=\"dcf-width-expand@s\">\n <ngx-decaf-searchbar\n [emitEventToWindow]=\"false\"\n [debounce]=\"500\"\n (searchEvent)=\"handleSearch($event)\"\n />\n </div>\n @if (filterOptions?.length) {\n <div\n class=\"dcf-width-1-3@s dcf-width-1-4@m dcf-select-filter-container dcf-flex dcf-flex-middle\"\n >\n <ion-select\n [id]=\"name\"\n toggleIcon=\"chevron-down-outline\"\n expandedIcon=\"chevron-up-outline\"\n [mode]=\"'md'\"\n fill=\"outline\"\n [value]=\"filterValue ?? ''\"\n [labelPlacement]=\"'floating'\"\n [label]=\"locale + '.filter.label' | translate\"\n (click)=\"openFilterSelectOptions($event)\"\n [placeholder]=\"locale + '.filter.label' | translate\"\n interface=\"popover\"\n >\n <ion-select-option value=\"\">{{ locale + '.filter.all' | translate }}</ion-select-option>\n @for (option of filterOptions; track $index) {\n <ion-select-option value=\"{{ option.value }}\">{{ option.text }}</ion-select-option>\n }\n <ion-button\n fill=\"clear\"\n (click)=\"handleFilterSelectClear($event)\"\n slot=\"end\"\n size=\"small\"\n [disabled]=\"!filterValue\"\n >\n <ngx-decaf-icon fill=\"clear\" slot=\"icon-only\" [name]=\"'ti-input-x'\" />\n </ion-button>\n </ion-select>\n </div>\n }\n </div>\n </div>\n}\n<div class=\"dcf-table-container\" [class.dcf-empty]=\"!data?.length\">\n @if (initialized && data?.length) {\n <table class=\"dcf-table\">\n <thead>\n <tr>\n @for (header of headers; track $index) {\n <th>{{ locale + '.' + header + '.label' | translate }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (item of items; track trackItemFn($index, item)) {\n <tr
|
|
14073
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: TableComponent, isStandalone: true, selector: "ngx-decaf-table", inputs: { filterModel: "filterModel", filterOptions: "filterOptions", filterLabel: "filterLabel", filterOptionsMapper: "filterOptionsMapper", allowOperations: "allowOperations" }, usesInheritance: true, ngImport: i0, template: "@if (showSearchbar && (data?.length || searching)) {\n <div class=\"dcf-grid-actions\">\n <div class=\"dcf-grid dcf-grid-small\">\n <div class=\"dcf-width-expand@s\">\n <ngx-decaf-searchbar\n [emitEventToWindow]=\"false\"\n [debounce]=\"500\"\n (searchEvent)=\"handleSearch($event)\"\n />\n </div>\n @if (filterOptions?.length) {\n <div\n class=\"dcf-width-1-3@s dcf-width-1-4@m dcf-select-filter-container dcf-flex dcf-flex-middle\"\n >\n <ion-select\n [id]=\"name\"\n toggleIcon=\"chevron-down-outline\"\n expandedIcon=\"chevron-up-outline\"\n [mode]=\"'md'\"\n fill=\"outline\"\n [value]=\"filterValue ?? ''\"\n [labelPlacement]=\"'floating'\"\n [label]=\"locale + '.filter.label' | translate\"\n (click)=\"openFilterSelectOptions($event)\"\n [placeholder]=\"locale + '.filter.label' | translate\"\n interface=\"popover\"\n >\n <ion-select-option value=\"\">{{ locale + '.filter.all' | translate }}</ion-select-option>\n @for (option of filterOptions; track $index) {\n <ion-select-option value=\"{{ option.value }}\">{{ option.text }}</ion-select-option>\n }\n <ion-button\n fill=\"clear\"\n (click)=\"handleFilterSelectClear($event)\"\n slot=\"end\"\n size=\"small\"\n [disabled]=\"!filterValue\"\n >\n <ngx-decaf-icon fill=\"clear\" slot=\"icon-only\" [name]=\"'ti-input-x'\" />\n </ion-button>\n </ion-select>\n </div>\n }\n </div>\n </div>\n}\n<div class=\"dcf-table-container\" [class.dcf-empty]=\"!data?.length\">\n @if (initialized && data?.length) {\n <table class=\"dcf-table\">\n <thead>\n <tr>\n @for (header of headers; track $index) {\n <th>{{ locale + '.' + header + '.label' | translate }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (item of items; track trackItemFn($index, item)) {\n <tr>\n @for (col of item | keyvalue; track $index) {\n @if (!['handler', 'actions', 'uid'].includes(col.key)) {\n <td\n (click)=\"\n handleAction(\n $event,\n col?.value.handler ? col.value.handler.handle : undefined,\n item.uid.value,\n OperationKeys.READ\n )\n \"\n [innerHTML]=\"col.value.value\"\n ></td>\n } @else {\n @if (allowOperations && col.key !== 'handler') {\n <td class=\"dcf-col-actions\">\n <div class=\"\">\n @if (operations?.includes(OperationKeys.UPDATE)) {\n <ngx-decaf-icon\n [button]=\"true\"\n (click)=\"\n handleRedirect($event, item.uid.value, OperationKeys.UPDATE, true)\n \"\n fill=\"clear\"\n slot=\"icon-only\"\n color=\"primary\"\n name=\"ti-edit\"\n />\n }\n @if (operations?.includes(OperationKeys.DELETE)) {\n <ngx-decaf-icon\n [button]=\"true\"\n (click)=\"\n handleRedirect($event, item.uid.value, OperationKeys.DELETE, true)\n \"\n fill=\"clear\"\n slot=\"icon-only\"\n color=\"danger\"\n name=\"ti-trash\"\n />\n }\n </div>\n </td>\n }\n }\n }\n </tr>\n }\n </tbody>\n </table>\n } @else {\n @if (!searching) {\n <ngx-decaf-empty-state\n [title]=\"'component.list.empty.title' | translate\"\n [subtitle]=\"'component.list.empty.subtitle' | translate\"\n [model]=\"empty?.showButton ? model : undefined\"\n [route]=\"route\"\n [modelId]=\"modelId\"\n [buttonLink]=\"empty?.link ?? undefined\"\n [borders]=\"borders\"\n [icon]=\"(item?.icon ?? 'folder-open-outline') || empty.icon\"\n className=\"dcf-empty-data\"\n />\n } @else {\n <ngx-decaf-empty-state\n icon=\"search-outline\"\n [model]=\"empty?.showButton ? model : undefined\"\n [route]=\"route\"\n [modelId]=\"modelId\"\n [borders]=\"borders\"\n [operations]=\"operations\"\n [body]=\"'small'\"\n [translatable]=\"true\"\n [title]=\"'component.list.search.title' | translate\"\n [subtitle]=\"'component.list.search.subtitle' | translate: { '0': parseSearchValue() }\"\n [searchValue]=\"searchValue\"\n />\n }\n }\n</div>\n@if (loadMoreData) {\n <div class=\"dcf-table-pagination\">\n @if (pages > 0 && !searchValue?.length) {\n <ngx-decaf-pagination\n [totalPages]=\"pages\"\n [current]=\"page\"\n (clickEvent)=\"handlePaginate($event)\"\n />\n }\n </div>\n}\n", styles: [".dcf-table-container{display:block;overflow-x:auto!important;box-sizing:border-box;overflow-y:hidden;scrollbar-width:thin;border-radius:var(--dcf-border-radius-small);box-shadow:var(--dcf-box-shadow-small)!important;background-color:var(--dcf-card-background);border:1px solid var(--dcf-color-gray-2)}.dcf-table-container::-webkit-scrollbar{width:5px}.dcf-table-container table{min-width:680px}.dcf-table{width:100%;border-collapse:collapse;border-radius:var(--dcf-border-radius-xsmall);overflow:hidden;background:var(--dcf-card-background);color:var(--dcf-text-color);font-size:.8rem}.dcf-table thead{background:rgba(var(--dcf-color-primary-rgb),.075);text-transform:uppercase;color:var(--dcf-color-dark);letter-spacing:.06em;font-size:.825rem;white-space:nowrap;width:auto}.dcf-table thead th{text-align:left;padding:.875rem 1rem;font-weight:600;max-width:max-content}.dcf-table tbody tr{transition:background .12s ease,box-shadow .12s ease}.dcf-table tbody tr:hover{background:rgba(var(--dcf-color-primary-rgb),.05);cursor:pointer}.dcf-table tbody tr:not(:last-child){border-bottom:1px solid var(--dcf-color-gray-2)}.dcf-table tbody td{padding:1rem 1.125rem;font-size:.875rem}.dcf-table tbody td:first-child{font-weight:600}.dcf-table tbody td.dcf-col-actions{padding-top:0!important;padding-bottom:0!important}.dcf-table tfoot{font-size:.85rem}.dcf-table tfoot td{padding:.875rem 1.125rem;border-top:1px solid 1px solid var(--dcf-color-gray-2)}.dcf-select-filter-container{min-width:200px}.dcf-buttons-grid{margin-top:var(--dcf-margin-medium);margin-bottom:var(--dcf-margin)}@media (max-width: 480px){.dcf-buttons-grid{flex-direction:row-reverse!important}.dcf-buttons-grid>div{width:100%}.dcf-buttons-grid>div+div{margin-top:1rem}.dcf-buttons-grid ion-button{width:100%}}ion-select{margin-top:.5rem;max-height:40px!important}ion-select ion-button{transform:scale(.75)!important;margin:0!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IonSelect, selector: "ion-select", inputs: ["cancelText", "color", "compareWith", "disabled", "errorText", "expandedIcon", "fill", "helperText", "interface", "interfaceOptions", "justify", "label", "labelPlacement", "mode", "multiple", "name", "okText", "placeholder", "selectedText", "shape", "toggleIcon", "value"] }, { kind: "component", type: IonSelectOption, selector: "ion-select-option", inputs: ["disabled", "value"] }, { kind: "component", type: SearchbarComponent, selector: "ngx-decaf-searchbar", inputs: ["autocomplete", "autocorrect", "animated", "buttonCancelText", "clearIcon", "color", "debounce", "disabled", "enterkeyhint", "inputmode", "placeholder", "searchIcon", "showCancelButton", "showClearButton", "spellcheck", "type", "value", "queryKeys", "isVisible", "wrapper", "wrapperColor", "emitEventToWindow"], outputs: ["searchEvent"] }, { kind: "component", type: EmptyStateComponent, selector: "ngx-decaf-empty-state", inputs: ["title", "titleColor", "subtitle", "subtitleColor", "showIcon", "icon", "iconSize", "iconColor", "buttonLink", "buttonText", "buttonFill", "buttonColor", "buttonSize", "searchValue"] }, { kind: "component", type: IconComponent, selector: "ngx-decaf-icon", inputs: ["name", "color", "slot", "button", "buttonFill", "buttonShape", "width", "size", "inline"] }, { kind: "component", type: PaginationComponent, selector: "ngx-decaf-pagination", inputs: ["totalPages", "current"], outputs: ["clickEvent"] }, { kind: "pipe", type: i1$1.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
14074
14074
|
};
|
|
14075
14075
|
TableComponent = __decorate([
|
|
14076
14076
|
Dynamic()
|
|
@@ -14086,7 +14086,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
14086
14086
|
EmptyStateComponent,
|
|
14087
14087
|
IconComponent,
|
|
14088
14088
|
PaginationComponent,
|
|
14089
|
-
], template: "@if (showSearchbar && (data?.length || searching)) {\n <div class=\"dcf-grid-actions\">\n <div class=\"dcf-grid dcf-grid-small\">\n <div class=\"dcf-width-expand@s\">\n <ngx-decaf-searchbar\n [emitEventToWindow]=\"false\"\n [debounce]=\"500\"\n (searchEvent)=\"handleSearch($event)\"\n />\n </div>\n @if (filterOptions?.length) {\n <div\n class=\"dcf-width-1-3@s dcf-width-1-4@m dcf-select-filter-container dcf-flex dcf-flex-middle\"\n >\n <ion-select\n [id]=\"name\"\n toggleIcon=\"chevron-down-outline\"\n expandedIcon=\"chevron-up-outline\"\n [mode]=\"'md'\"\n fill=\"outline\"\n [value]=\"filterValue ?? ''\"\n [labelPlacement]=\"'floating'\"\n [label]=\"locale + '.filter.label' | translate\"\n (click)=\"openFilterSelectOptions($event)\"\n [placeholder]=\"locale + '.filter.label' | translate\"\n interface=\"popover\"\n >\n <ion-select-option value=\"\">{{ locale + '.filter.all' | translate }}</ion-select-option>\n @for (option of filterOptions; track $index) {\n <ion-select-option value=\"{{ option.value }}\">{{ option.text }}</ion-select-option>\n }\n <ion-button\n fill=\"clear\"\n (click)=\"handleFilterSelectClear($event)\"\n slot=\"end\"\n size=\"small\"\n [disabled]=\"!filterValue\"\n >\n <ngx-decaf-icon fill=\"clear\" slot=\"icon-only\" [name]=\"'ti-input-x'\" />\n </ion-button>\n </ion-select>\n </div>\n }\n </div>\n </div>\n}\n<div class=\"dcf-table-container\" [class.dcf-empty]=\"!data?.length\">\n @if (initialized && data?.length) {\n <table class=\"dcf-table\">\n <thead>\n <tr>\n @for (header of headers; track $index) {\n <th>{{ locale + '.' + header + '.label' | translate }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (item of items; track trackItemFn($index, item)) {\n <tr
|
|
14089
|
+
], template: "@if (showSearchbar && (data?.length || searching)) {\n <div class=\"dcf-grid-actions\">\n <div class=\"dcf-grid dcf-grid-small\">\n <div class=\"dcf-width-expand@s\">\n <ngx-decaf-searchbar\n [emitEventToWindow]=\"false\"\n [debounce]=\"500\"\n (searchEvent)=\"handleSearch($event)\"\n />\n </div>\n @if (filterOptions?.length) {\n <div\n class=\"dcf-width-1-3@s dcf-width-1-4@m dcf-select-filter-container dcf-flex dcf-flex-middle\"\n >\n <ion-select\n [id]=\"name\"\n toggleIcon=\"chevron-down-outline\"\n expandedIcon=\"chevron-up-outline\"\n [mode]=\"'md'\"\n fill=\"outline\"\n [value]=\"filterValue ?? ''\"\n [labelPlacement]=\"'floating'\"\n [label]=\"locale + '.filter.label' | translate\"\n (click)=\"openFilterSelectOptions($event)\"\n [placeholder]=\"locale + '.filter.label' | translate\"\n interface=\"popover\"\n >\n <ion-select-option value=\"\">{{ locale + '.filter.all' | translate }}</ion-select-option>\n @for (option of filterOptions; track $index) {\n <ion-select-option value=\"{{ option.value }}\">{{ option.text }}</ion-select-option>\n }\n <ion-button\n fill=\"clear\"\n (click)=\"handleFilterSelectClear($event)\"\n slot=\"end\"\n size=\"small\"\n [disabled]=\"!filterValue\"\n >\n <ngx-decaf-icon fill=\"clear\" slot=\"icon-only\" [name]=\"'ti-input-x'\" />\n </ion-button>\n </ion-select>\n </div>\n }\n </div>\n </div>\n}\n<div class=\"dcf-table-container\" [class.dcf-empty]=\"!data?.length\">\n @if (initialized && data?.length) {\n <table class=\"dcf-table\">\n <thead>\n <tr>\n @for (header of headers; track $index) {\n <th>{{ locale + '.' + header + '.label' | translate }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (item of items; track trackItemFn($index, item)) {\n <tr>\n @for (col of item | keyvalue; track $index) {\n @if (!['handler', 'actions', 'uid'].includes(col.key)) {\n <td\n (click)=\"\n handleAction(\n $event,\n col?.value.handler ? col.value.handler.handle : undefined,\n item.uid.value,\n OperationKeys.READ\n )\n \"\n [innerHTML]=\"col.value.value\"\n ></td>\n } @else {\n @if (allowOperations && col.key !== 'handler') {\n <td class=\"dcf-col-actions\">\n <div class=\"\">\n @if (operations?.includes(OperationKeys.UPDATE)) {\n <ngx-decaf-icon\n [button]=\"true\"\n (click)=\"\n handleRedirect($event, item.uid.value, OperationKeys.UPDATE, true)\n \"\n fill=\"clear\"\n slot=\"icon-only\"\n color=\"primary\"\n name=\"ti-edit\"\n />\n }\n @if (operations?.includes(OperationKeys.DELETE)) {\n <ngx-decaf-icon\n [button]=\"true\"\n (click)=\"\n handleRedirect($event, item.uid.value, OperationKeys.DELETE, true)\n \"\n fill=\"clear\"\n slot=\"icon-only\"\n color=\"danger\"\n name=\"ti-trash\"\n />\n }\n </div>\n </td>\n }\n }\n }\n </tr>\n }\n </tbody>\n </table>\n } @else {\n @if (!searching) {\n <ngx-decaf-empty-state\n [title]=\"'component.list.empty.title' | translate\"\n [subtitle]=\"'component.list.empty.subtitle' | translate\"\n [model]=\"empty?.showButton ? model : undefined\"\n [route]=\"route\"\n [modelId]=\"modelId\"\n [buttonLink]=\"empty?.link ?? undefined\"\n [borders]=\"borders\"\n [icon]=\"(item?.icon ?? 'folder-open-outline') || empty.icon\"\n className=\"dcf-empty-data\"\n />\n } @else {\n <ngx-decaf-empty-state\n icon=\"search-outline\"\n [model]=\"empty?.showButton ? model : undefined\"\n [route]=\"route\"\n [modelId]=\"modelId\"\n [borders]=\"borders\"\n [operations]=\"operations\"\n [body]=\"'small'\"\n [translatable]=\"true\"\n [title]=\"'component.list.search.title' | translate\"\n [subtitle]=\"'component.list.search.subtitle' | translate: { '0': parseSearchValue() }\"\n [searchValue]=\"searchValue\"\n />\n }\n }\n</div>\n@if (loadMoreData) {\n <div class=\"dcf-table-pagination\">\n @if (pages > 0 && !searchValue?.length) {\n <ngx-decaf-pagination\n [totalPages]=\"pages\"\n [current]=\"page\"\n (clickEvent)=\"handlePaginate($event)\"\n />\n }\n </div>\n}\n", styles: [".dcf-table-container{display:block;overflow-x:auto!important;box-sizing:border-box;overflow-y:hidden;scrollbar-width:thin;border-radius:var(--dcf-border-radius-small);box-shadow:var(--dcf-box-shadow-small)!important;background-color:var(--dcf-card-background);border:1px solid var(--dcf-color-gray-2)}.dcf-table-container::-webkit-scrollbar{width:5px}.dcf-table-container table{min-width:680px}.dcf-table{width:100%;border-collapse:collapse;border-radius:var(--dcf-border-radius-xsmall);overflow:hidden;background:var(--dcf-card-background);color:var(--dcf-text-color);font-size:.8rem}.dcf-table thead{background:rgba(var(--dcf-color-primary-rgb),.075);text-transform:uppercase;color:var(--dcf-color-dark);letter-spacing:.06em;font-size:.825rem;white-space:nowrap;width:auto}.dcf-table thead th{text-align:left;padding:.875rem 1rem;font-weight:600;max-width:max-content}.dcf-table tbody tr{transition:background .12s ease,box-shadow .12s ease}.dcf-table tbody tr:hover{background:rgba(var(--dcf-color-primary-rgb),.05);cursor:pointer}.dcf-table tbody tr:not(:last-child){border-bottom:1px solid var(--dcf-color-gray-2)}.dcf-table tbody td{padding:1rem 1.125rem;font-size:.875rem}.dcf-table tbody td:first-child{font-weight:600}.dcf-table tbody td.dcf-col-actions{padding-top:0!important;padding-bottom:0!important}.dcf-table tfoot{font-size:.85rem}.dcf-table tfoot td{padding:.875rem 1.125rem;border-top:1px solid 1px solid var(--dcf-color-gray-2)}.dcf-select-filter-container{min-width:200px}.dcf-buttons-grid{margin-top:var(--dcf-margin-medium);margin-bottom:var(--dcf-margin)}@media (max-width: 480px){.dcf-buttons-grid{flex-direction:row-reverse!important}.dcf-buttons-grid>div{width:100%}.dcf-buttons-grid>div+div{margin-top:1rem}.dcf-buttons-grid ion-button{width:100%}}ion-select{margin-top:.5rem;max-height:40px!important}ion-select ion-button{transform:scale(.75)!important;margin:0!important}\n"] }]
|
|
14090
14090
|
}], propDecorators: { filterModel: [{
|
|
14091
14091
|
type: Input
|
|
14092
14092
|
}], filterOptions: [{
|
|
@@ -14227,13 +14227,13 @@ class NgxEventHandler extends DecafEventHandler {
|
|
|
14227
14227
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
14228
14228
|
constructor() {
|
|
14229
14229
|
super();
|
|
14230
|
-
|
|
14231
|
-
this.readonly = false;
|
|
14230
|
+
this._data = null;
|
|
14232
14231
|
}
|
|
14233
14232
|
async handle(event, data, instance, ...args) {
|
|
14234
14233
|
this.log.for(this.handle).info(`Handle called with args: ${event}, ${data}, ${instance}`);
|
|
14235
14234
|
}
|
|
14236
14235
|
from(...args) {
|
|
14236
|
+
this.log.for(this.process).info(`Process called with args: ${args}`);
|
|
14237
14237
|
return this;
|
|
14238
14238
|
}
|
|
14239
14239
|
async process(...args) {
|
|
@@ -14377,5 +14377,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
14377
14377
|
* Generated bundle index. Do not edit.
|
|
14378
14378
|
*/
|
|
14379
14379
|
|
|
14380
|
-
export { ActionRoles, AngularEngineKeys, BaseComponentProps, CPTKN, CardComponent,
|
|
14380
|
+
export { ActionRoles, AngularEngineKeys, BaseComponentProps, CPTKN, CardComponent, ComponentRendererComponent, ComponentsTagNames, CrudFieldComponent, CrudFormComponent, CssClasses, DB_ADAPTER_FLAVOUR_TOKEN, DB_ADAPTER_PROVIDER_TOKEN, DecafFakerRepository, DefaultFormReactiveOptions, DefaultListEmptyOptions, DefaultModalOptions, Dynamic, DynamicModule, EmptyStateComponent, FieldsetComponent, FileUploadComponent, FilterComponent, ForAngularCommonModule, ForAngularComponentsModule, I18N_CONFIG_TOKEN, I18nLoader, I18nLoaderFactory, I18nParser, IconComponent, LOCALE_ROOT_TOKEN, LayoutComponent, ListComponent, ListComponentsTypes, ListItemComponent, ListItemPositions, ModalComponent, ModalConfirmComponent, ModelRendererComponent, NgxComponentDirective, NgxEventHandler, NgxFormDirective, NgxFormFieldDirective, NgxFormService, NgxMediaService, NgxModelPageDirective, NgxPageDirective, NgxParentComponentDirective, NgxRenderingEngine, NgxRouterService, NgxSvgDirective, PaginationComponent, RouteDirections, SearchbarComponent, SelectFieldInterfaces, SteppedFormComponent, TableComponent, WindowColorSchemes, cleanSpaces, dataMapper, decafPageTransition, filterString, formatDate, generateRandomValue, getDbAdapterFlavour, getFakerData, getInjectablesRegistry, getLocaleContext, getLocaleContextByKey, getLocaleFromClassName, getLocaleLanguage, getLogger, getMenuIcon, getModelAndRepository, getNgxInlineModal, getNgxModalComponent, getNgxModalCrudComponent, getNgxSelectOptionsModal, getOnWindow, getOnWindowDocument, getWindow, getWindowDocument, getWindowWidth, isDarkMode, isDevelopmentMode, isNotUndefined, isValidDate, itemMapper, presentModalConfirm, presentNgxInlineModal, presentNgxLightBoxModal, provideDecafDarkMode, provideDecafDbAdapter, provideDecafDynamicComponents, provideDecafI18nConfig, provideDecafI18nLoader, provideDecafPageTransition, removeFocusTrap, setOnWindow, stringToBoolean, windowEventEmitter };
|
|
14381
14381
|
//# sourceMappingURL=decaf-ts-for-angular.mjs.map
|