@simpleangularcontrols/sac-common 16.0.0-rc.3 → 16.0.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, Directive, Input, Output, InjectionToken, Injectable, Host, ViewChild, HostListener, ViewChildren, TemplateRef, ContentChild, Inject } from '@angular/core';
2
+ import { EventEmitter, Directive, Input, Output, Injectable, InjectionToken, Host, ViewChild, HostListener, ViewChildren, TemplateRef, ContentChild, Inject } from '@angular/core';
3
3
  import * as i1 from '@angular/forms';
4
4
  import { NgControl, FormControlName, FormGroupDirective, Validators, UntypedFormGroup } from '@angular/forms';
5
5
  import { Observable, of } from 'rxjs';
@@ -151,6 +151,73 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
151
151
  type: Output
152
152
  }] } });
153
153
 
154
+ // #region Classes
155
+ /**
156
+ * abstract class for configuration settings providing in components
157
+ */
158
+ class SacAbstractConfigurationService {
159
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacAbstractConfigurationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
160
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacAbstractConfigurationService, providedIn: 'root' }); }
161
+ }
162
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacAbstractConfigurationService, decorators: [{
163
+ type: Injectable,
164
+ args: [{ providedIn: 'root' }]
165
+ }] });
166
+ /**
167
+ * default configuration service for components
168
+ * */
169
+ class SacDefaultConfigurationService extends SacAbstractConfigurationService {
170
+ // #region Public Getters And Setters
171
+ /**
172
+ * @inheritdoc
173
+ */
174
+ get LabelSizeLg() {
175
+ return null;
176
+ }
177
+ /**
178
+ * @inheritdoc
179
+ */
180
+ get LabelSizeMd() {
181
+ return null;
182
+ }
183
+ /**
184
+ * @inheritdoc
185
+ */
186
+ get LabelSizeSm() {
187
+ return 4;
188
+ }
189
+ /**
190
+ * @inheritdoc
191
+ */
192
+ get LabelSizeXl() {
193
+ return null;
194
+ }
195
+ /**
196
+ * @inheritdoc
197
+ */
198
+ get LabelSizeXs() {
199
+ return 12;
200
+ }
201
+ /**
202
+ * @inheritdoc
203
+ */
204
+ get LabelSizeXxl() {
205
+ return null;
206
+ }
207
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDefaultConfigurationService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
208
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDefaultConfigurationService, providedIn: 'root' }); }
209
+ }
210
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDefaultConfigurationService, decorators: [{
211
+ type: Injectable,
212
+ args: [{ providedIn: 'root' }]
213
+ }] });
214
+ // #endregion Classes
215
+ // #region Variables
216
+ /**
217
+ * injection token for component configuration service
218
+ */
219
+ const SACCONFIGURATION_SERVICE = new InjectionToken('SacConfigurationService');
220
+
154
221
  /**
155
222
  * Prüft ob ein Objekt Defined ist
156
223
  * @param value Objekt
@@ -670,6 +737,22 @@ function mapToObject(map) {
670
737
  return obj;
671
738
  }
672
739
 
740
+ /**
741
+ * create a guid with crypto library if availabe and a fallback to Math.Random implementation
742
+ */
743
+ function createGuid() {
744
+ if (typeof crypto !== undefined) {
745
+ // return guid without hyphen
746
+ return crypto.randomUUID().replace(/\-/gi, '');
747
+ }
748
+ else {
749
+ return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
750
+ var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
751
+ return v.toString(16);
752
+ });
753
+ }
754
+ }
755
+
673
756
  /***
674
757
  * base component for form options
675
758
  */
@@ -822,7 +905,7 @@ class SacBaseModelControl {
822
905
  /**
823
906
  * Name des Controls
824
907
  */
825
- this.name = '';
908
+ this.name = createGuid();
826
909
  /**
827
910
  * Leere Implementation von "propagateChange". Muss gemacht werden, damit kein Fehler entsteht
828
911
  */
@@ -833,6 +916,7 @@ class SacBaseModelControl {
833
916
  this.propagateTouch = () => { };
834
917
  this.formlayout = formlayout;
835
918
  this.lngResourceService = injector.get(SACLOCALISATION_SERVICE, new SacDefaultLocalisationService());
919
+ this.configurationService = injector.get(SACCONFIGURATION_SERVICE, new SacDefaultConfigurationService());
836
920
  }
837
921
  // #endregion Constructors
838
922
  // #region Public Getters And Setters
@@ -1105,7 +1189,7 @@ class SacBaseModelControl {
1105
1189
  this.labelSizeXs = this.formlayout.labelSizeXs;
1106
1190
  }
1107
1191
  else {
1108
- this.labelSizeXs = 12;
1192
+ this.labelSizeXs = this.configurationService.LabelSizeXs;
1109
1193
  }
1110
1194
  }
1111
1195
  // set size small
@@ -1114,7 +1198,7 @@ class SacBaseModelControl {
1114
1198
  this.labelSizeSm = this.formlayout.labelSizeSm;
1115
1199
  }
1116
1200
  else {
1117
- this.labelSizeSm = 4;
1201
+ this.labelSizeSm = this.configurationService.LabelSizeSm;
1118
1202
  }
1119
1203
  }
1120
1204
  // set size medium
@@ -1122,24 +1206,36 @@ class SacBaseModelControl {
1122
1206
  if (this.formlayout?.labelSizeMd) {
1123
1207
  this.labelSizeMd = this.formlayout.labelSizeMd;
1124
1208
  }
1209
+ else {
1210
+ this.labelSizeMd = this.configurationService.LabelSizeMd;
1211
+ }
1125
1212
  }
1126
1213
  // set size large
1127
1214
  if (!this.labelSizeLg) {
1128
1215
  if (this.formlayout?.labelSizeLg) {
1129
1216
  this.labelSizeLg = this.formlayout.labelSizeLg;
1130
1217
  }
1218
+ else {
1219
+ this.labelSizeLg = this.configurationService.LabelSizeLg;
1220
+ }
1131
1221
  }
1132
1222
  // set size extra large
1133
1223
  if (!this.labelSizeXl) {
1134
1224
  if (this.formlayout?.labelSizeXl) {
1135
1225
  this.labelSizeXl = this.formlayout.labelSizeXl;
1136
1226
  }
1227
+ else {
1228
+ this.labelSizeXl = this.configurationService.LabelSizeXl;
1229
+ }
1137
1230
  }
1138
1231
  // set size extra extra large
1139
1232
  if (!this.labelSizeXxl) {
1140
1233
  if (this.formlayout?.labelSizeXxl) {
1141
1234
  this.labelSizeXxl = this.formlayout.labelSizeXxl;
1142
1235
  }
1236
+ else {
1237
+ this.labelSizeXxl = this.configurationService.LabelSizeXxl;
1238
+ }
1143
1239
  }
1144
1240
  }
1145
1241
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacBaseModelControl, deps: [{ token: SacFormLayoutCommon, host: true }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive }); }
@@ -3855,58 +3951,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
3855
3951
  type: Output
3856
3952
  }] } });
3857
3953
 
3858
- /**
3859
- * Enum für Icon Types in Componenten
3860
- */
3861
- var IconType;
3862
- (function (IconType) {
3863
- IconType[IconType["Image"] = 1] = "Image";
3864
- IconType[IconType["CssSprite"] = 2] = "CssSprite";
3865
- })(IconType || (IconType = {}));
3866
-
3867
- /**
3868
- * injection token for language service
3869
- */
3870
- const SACLANGUAGE_SERVICE = new InjectionToken('SacLanguageService');
3871
- /**
3872
- * abstract class for languages provides in components
3873
- */
3874
- class SacAbstractLanguageService {
3875
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacAbstractLanguageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3876
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacAbstractLanguageService, providedIn: 'root' }); }
3877
- }
3878
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacAbstractLanguageService, decorators: [{
3879
- type: Injectable,
3880
- args: [{ providedIn: 'root' }]
3881
- }] });
3882
- /**
3883
- * default service for languages
3884
- * */
3885
- class SacDefaultLanguageService extends SacAbstractLanguageService {
3886
- /**
3887
- * @inheritdoc
3888
- */
3889
- GetLanguages() {
3890
- return new Observable((observer) => {
3891
- const result = [];
3892
- result.push({
3893
- Icon: '/icons/en.png',
3894
- IconType: IconType.Image,
3895
- IsoCode: 'en',
3896
- Text: 'English',
3897
- });
3898
- observer.next(result);
3899
- observer.complete();
3900
- });
3901
- }
3902
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDefaultLanguageService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
3903
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDefaultLanguageService, providedIn: 'root' }); }
3904
- }
3905
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDefaultLanguageService, decorators: [{
3906
- type: Injectable,
3907
- args: [{ providedIn: 'root' }]
3908
- }] });
3909
-
3910
3954
  /**
3911
3955
  * Klasse für API Request zum löschen eines Files
3912
3956
  */
@@ -4348,6 +4392,58 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
4348
4392
  */
4349
4393
  const SACICON_SERVICE = new InjectionToken('SacIconService');
4350
4394
 
4395
+ /**
4396
+ * Enum für Icon Types in Componenten
4397
+ */
4398
+ var IconType;
4399
+ (function (IconType) {
4400
+ IconType[IconType["Image"] = 1] = "Image";
4401
+ IconType[IconType["CssSprite"] = 2] = "CssSprite";
4402
+ })(IconType || (IconType = {}));
4403
+
4404
+ /**
4405
+ * injection token for language service
4406
+ */
4407
+ const SACLANGUAGE_SERVICE = new InjectionToken('SacLanguageService');
4408
+ /**
4409
+ * abstract class for languages provides in components
4410
+ */
4411
+ class SacAbstractLanguageService {
4412
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacAbstractLanguageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4413
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacAbstractLanguageService, providedIn: 'root' }); }
4414
+ }
4415
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacAbstractLanguageService, decorators: [{
4416
+ type: Injectable,
4417
+ args: [{ providedIn: 'root' }]
4418
+ }] });
4419
+ /**
4420
+ * default service for languages
4421
+ * */
4422
+ class SacDefaultLanguageService extends SacAbstractLanguageService {
4423
+ /**
4424
+ * @inheritdoc
4425
+ */
4426
+ GetLanguages() {
4427
+ return new Observable((observer) => {
4428
+ const result = [];
4429
+ result.push({
4430
+ Icon: '/icons/en.png',
4431
+ IconType: IconType.Image,
4432
+ IsoCode: 'en',
4433
+ Text: 'English',
4434
+ });
4435
+ observer.next(result);
4436
+ observer.complete();
4437
+ });
4438
+ }
4439
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDefaultLanguageService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
4440
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDefaultLanguageService, providedIn: 'root' }); }
4441
+ }
4442
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDefaultLanguageService, decorators: [{
4443
+ type: Injectable,
4444
+ args: [{ providedIn: 'root' }]
4445
+ }] });
4446
+
4351
4447
  /**
4352
4448
  * Base Komponente für GridColumn
4353
4449
  */
@@ -10099,5 +10195,5 @@ class LanguageModel {
10099
10195
  * Generated bundle index. Do not edit.
10100
10196
  */
10101
10197
 
10102
- export { GridResponse, IconType, Interpolation, LanguageModel, PagerData, PagerRequest, Positioning, SACFILEBROWSER_SERVICE, SACICON_SERVICE, SACLANGUAGE_SERVICE, SACLOCALISATION_SERVICE, SacAbstractFileBrowserService, SacAbstractIconService, SacAbstractLanguageService, SacAbstractLocalisationService, SacButtonCommon, SacCheckboxCommon, SacConfirmButton, SacConfirmCommon, SacContextMenuContrainerCommon, SacContextmenuAnchorCommon, SacContextmenuCommon, SacContextmenuItemButtonCommon, SacContextmenuItemCommon, SacDateCommon, SacDateSelectorCommon, SacDateTimeCommon, SacDialogCommon, SacDropdownCommon, SacDropdownOptionCommon, SacDropzoneMultipleCommon, SacDropzoneSingleCommon, SacFileBrowserCommon, SacFormCommon, SacFormLayoutCommon, SacGridButtonCommon, SacGridColumnActionCommon, SacGridColumnBaseCommon, SacGridColumnCommon, SacGridCommon, SacGridImageCommon, SacInputAreaCommon, SacInputCommon, SacInputCurrencyCommon, SacInputDecimalCommon, SacInputEmailCommon, SacInputIntegerCommon, SacInputPasswordCommon, SacInputSearchCommon, SacListboxCommon, SacListboxOptionCommon, SacMultilanguageInputAreaCommon, SacMultilanguageInputCommon, SacPagingCommon, SacRadiobuttonCommon, SacRadiobuttonsCommon, SacStaticFormContainerCommon, SacStaticLabelCommon, SacTabCommon, SacTabItemCommon, SacTimeCommon, SacTinyMceCommon, SacTooltipCommon, SacTreeItemActionCommon, SacTreeViewChildCommon, SacTreeViewCommon, SacUploadFile, SacUploadMultipleCommon, SacUploadSingleCommon, SacValidationSummaryCommon, SacWizardCommon, SacWizardItemCommon, ServiceConfirmCommon, SortDescriptor, SortOrder, TooltipPosition, Validation, ValidationErrorItem, convertToBoolean, convertToNumber, isDefined, mapToObject, positionElements, positionService };
10198
+ export { GridResponse, IconType, Interpolation, LanguageModel, PagerData, PagerRequest, Positioning, SACCONFIGURATION_SERVICE, SACFILEBROWSER_SERVICE, SACICON_SERVICE, SACLANGUAGE_SERVICE, SACLOCALISATION_SERVICE, SacAbstractConfigurationService, SacAbstractFileBrowserService, SacAbstractIconService, SacAbstractLanguageService, SacAbstractLocalisationService, SacButtonCommon, SacCheckboxCommon, SacConfirmButton, SacConfirmCommon, SacContextMenuContrainerCommon, SacContextmenuAnchorCommon, SacContextmenuCommon, SacContextmenuItemButtonCommon, SacContextmenuItemCommon, SacDateCommon, SacDateSelectorCommon, SacDateTimeCommon, SacDialogCommon, SacDropdownCommon, SacDropdownOptionCommon, SacDropzoneMultipleCommon, SacDropzoneSingleCommon, SacFileBrowserCommon, SacFormCommon, SacFormLayoutCommon, SacGridButtonCommon, SacGridColumnActionCommon, SacGridColumnBaseCommon, SacGridColumnCommon, SacGridCommon, SacGridImageCommon, SacInputAreaCommon, SacInputCommon, SacInputCurrencyCommon, SacInputDecimalCommon, SacInputEmailCommon, SacInputIntegerCommon, SacInputPasswordCommon, SacInputSearchCommon, SacListboxCommon, SacListboxOptionCommon, SacMultilanguageInputAreaCommon, SacMultilanguageInputCommon, SacPagingCommon, SacRadiobuttonCommon, SacRadiobuttonsCommon, SacStaticFormContainerCommon, SacStaticLabelCommon, SacTabCommon, SacTabItemCommon, SacTimeCommon, SacTinyMceCommon, SacTooltipCommon, SacTreeItemActionCommon, SacTreeViewChildCommon, SacTreeViewCommon, SacUploadFile, SacUploadMultipleCommon, SacUploadSingleCommon, SacValidationSummaryCommon, SacWizardCommon, SacWizardItemCommon, ServiceConfirmCommon, SortDescriptor, SortOrder, TooltipPosition, Validation, ValidationErrorItem, convertToBoolean, convertToNumber, isDefined, mapToObject, positionElements, positionService };
10103
10199
  //# sourceMappingURL=simpleangularcontrols-sac-common.mjs.map