spiderly 19.8.0 → 19.8.2
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/fesm2022/spiderly.mjs +494 -387
- package/fesm2022/spiderly.mjs.map +1 -1
- package/lib/controls/spiderly-calendar/spiderly-calendar.component.d.ts +17 -3
- package/lib/controls/spiderly-editor/spiderly-editor.component.d.ts +2 -1
- package/lib/entities/editor-image-upload-result.d.ts +5 -0
- package/lib/services/helper-functions.d.ts +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
package/fesm2022/spiderly.mjs
CHANGED
|
@@ -14,6 +14,10 @@ import * as i4$1 from 'primeng/datepicker';
|
|
|
14
14
|
import { DatePickerModule } from 'primeng/datepicker';
|
|
15
15
|
import * as i5 from 'primeng/tooltip';
|
|
16
16
|
import { TooltipModule } from 'primeng/tooltip';
|
|
17
|
+
import * as FileSaver from 'file-saver';
|
|
18
|
+
import mime from 'mime';
|
|
19
|
+
import 'reflect-metadata';
|
|
20
|
+
import { map, Subject, throttleTime, BehaviorSubject, of, filter as filter$1, firstValueFrom, finalize as finalize$1, tap as tap$1 } from 'rxjs';
|
|
17
21
|
import * as i4$2 from 'primeng/checkbox';
|
|
18
22
|
import { CheckboxModule } from 'primeng/checkbox';
|
|
19
23
|
import * as i4$3 from 'primeng/colorpicker';
|
|
@@ -38,12 +42,8 @@ import * as i12 from 'primeng/button';
|
|
|
38
42
|
import { ButtonModule } from 'primeng/button';
|
|
39
43
|
import * as i1$4 from 'primeng/splitbutton';
|
|
40
44
|
import { SplitButtonModule } from 'primeng/splitbutton';
|
|
41
|
-
import { Subject, throttleTime, map, BehaviorSubject, of, filter as filter$1, firstValueFrom, finalize as finalize$1, tap as tap$1 } from 'rxjs';
|
|
42
45
|
import * as i3$2 from '@angular/router';
|
|
43
46
|
import { NavigationEnd, RouterModule } from '@angular/router';
|
|
44
|
-
import * as FileSaver from 'file-saver';
|
|
45
|
-
import mime from 'mime';
|
|
46
|
-
import 'reflect-metadata';
|
|
47
47
|
import * as i1$1 from 'primeng/api';
|
|
48
48
|
import { ConfirmationService } from 'primeng/api';
|
|
49
49
|
import * as i1$2 from '@angular/common/http';
|
|
@@ -452,142 +452,500 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
452
452
|
type: Input
|
|
453
453
|
}] } });
|
|
454
454
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
455
|
+
// Helper function for PrecisionScale validation (to be added in the TypeScript output):
|
|
456
|
+
function validatePrecisionScale(value, precision, scale, ignoreTrailingZeros) {
|
|
457
|
+
if (typeof value !== 'number')
|
|
458
|
+
return false;
|
|
459
|
+
const [integerPart, decimalPart] = value.toString().split('.');
|
|
460
|
+
if (integerPart.length > precision - scale)
|
|
461
|
+
return false;
|
|
462
|
+
if (decimalPart && decimalPart.length > scale)
|
|
463
|
+
return false;
|
|
464
|
+
if (!ignoreTrailingZeros &&
|
|
465
|
+
decimalPart &&
|
|
466
|
+
decimalPart.replace(/0+$/, '').length > scale)
|
|
467
|
+
return false;
|
|
468
|
+
return true;
|
|
467
469
|
}
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
DatePickerModule,
|
|
475
|
-
TooltipModule,
|
|
476
|
-
RequiredComponent,
|
|
477
|
-
], template: "<div style=\"display: flex; flex-direction: column; gap: 0.5rem\">\n <div\n *ngIf=\"getTranslatedLabel() != '' && getTranslatedLabel() != null\"\n style=\"display: flex; align-items: center\"\n >\n <div>\n <label>{{ getTranslatedLabel() }}</label>\n <required *ngIf=\"control?.required && showRequired\"></required>\n </div>\n <!-- tabindex=\"-1\": Makes the element focusable, but removes it from the tab order. -->\n <i\n *ngIf=\"showTooltip\"\n class=\"{{ tooltipIcon }}\"\n style=\"margin-left: 8px; cursor: pointer\"\n [pTooltip]=\"tooltipText\"\n tabindex=\"-1\"\n tooltipEvent=\"focus\"\n ></i>\n </div>\n <p-datepicker\n *ngIf=\"control\"\n [formControl]=\"control\"\n (onBlur)=\"control.markAsDirty()\"\n dateFormat=\"dd.mm.yy.\"\n iconDisplay=\"input\"\n [showIcon]=\"true\"\n [showTime]=\"showTime\"\n (onSelect)=\"setDate($event)\"\n appendTo=\"body\"\n [fluid]=\"true\"\n />\n <small *ngIf=\"control?.errors && control?.dirty\" class=\"spiderly-error-message\">\n {{ getValidationErrrorMessages() }}\n </small>\n</div>\n" }]
|
|
478
|
-
}], ctorParameters: () => [{ type: i1.TranslocoService }], propDecorators: { showTime: [{
|
|
479
|
-
type: Input
|
|
480
|
-
}] } });
|
|
481
|
-
|
|
482
|
-
class SpiderlyCheckboxComponent extends BaseControl {
|
|
483
|
-
constructor(translocoService) {
|
|
484
|
-
super(translocoService);
|
|
485
|
-
this.translocoService = translocoService;
|
|
486
|
-
this.fakeLabel = true;
|
|
487
|
-
this.initializeToFalse = false;
|
|
488
|
-
this.inlineLabel = false;
|
|
489
|
-
this.onChange = new EventEmitter();
|
|
490
|
-
this.change = (event) => {
|
|
491
|
-
this.onChange.next(event);
|
|
492
|
-
};
|
|
470
|
+
function getMimeTypeForFileName(fileName) {
|
|
471
|
+
return mime.getType(fileName) ?? 'application/octet-stream';
|
|
472
|
+
}
|
|
473
|
+
function adjustColor(color, percent) {
|
|
474
|
+
if (!/^#([0-9A-F]{3}){1,2}$/i.test(color)) {
|
|
475
|
+
console.error('Invalid hex color format');
|
|
493
476
|
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
477
|
+
let r, g, b;
|
|
478
|
+
if (color.length === 7) {
|
|
479
|
+
r = parseInt(color.slice(1, 3), 16);
|
|
480
|
+
g = parseInt(color.slice(3, 5), 16);
|
|
481
|
+
b = parseInt(color.slice(5, 7), 16);
|
|
498
482
|
}
|
|
499
|
-
|
|
500
|
-
|
|
483
|
+
else {
|
|
484
|
+
r = parseInt(color[1] + color[1], 16);
|
|
485
|
+
g = parseInt(color[2] + color[2], 16);
|
|
486
|
+
b = parseInt(color[3] + color[3], 16);
|
|
487
|
+
}
|
|
488
|
+
const adjust = (value, percent) => {
|
|
489
|
+
const amount = (percent / 100) * 255;
|
|
490
|
+
const newValue = Math.min(Math.max(value + amount, 0), 255);
|
|
491
|
+
return Math.round(newValue);
|
|
492
|
+
};
|
|
493
|
+
r = adjust(r, percent);
|
|
494
|
+
g = adjust(g, percent);
|
|
495
|
+
b = adjust(b, percent);
|
|
496
|
+
const toHex = (value) => {
|
|
497
|
+
const hex = value.toString(16).padStart(2, '0');
|
|
498
|
+
return hex;
|
|
499
|
+
};
|
|
500
|
+
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
501
501
|
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
502
|
+
// new Date('yyyy-MM-dd') is parsed as UTC midnight per the JS spec, which shifts to the previous day
|
|
503
|
+
// in negative-UTC locales. Construct via numeric components to anchor at local midnight instead.
|
|
504
|
+
function parseDateOnlyLocal(s) {
|
|
505
|
+
const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(s);
|
|
506
|
+
if (!m)
|
|
507
|
+
return null;
|
|
508
|
+
return new Date(+m[1], +m[2] - 1, +m[3]);
|
|
509
|
+
}
|
|
510
|
+
function getHtmlImgDisplayString64(base64String) {
|
|
511
|
+
if (base64String == null)
|
|
512
|
+
return null;
|
|
513
|
+
const [header, base64Content] = base64String.split(';base64,');
|
|
514
|
+
const fileName = header.split('=')[1];
|
|
515
|
+
const mimeType = getMimeTypeForFileName(fileName);
|
|
516
|
+
return `data:${mimeType};base64, ${base64Content}`;
|
|
517
|
+
}
|
|
518
|
+
function nameof(key1, key2) {
|
|
519
|
+
return key2 ?? key1;
|
|
520
|
+
}
|
|
521
|
+
function nameOf(funcOrClass) {
|
|
522
|
+
return funcOrClass.name;
|
|
523
|
+
}
|
|
524
|
+
function getParentUrl(currentUrl) {
|
|
525
|
+
const urlSegments = currentUrl.split('/');
|
|
526
|
+
urlSegments.pop();
|
|
527
|
+
const parentUrl = urlSegments.join('/');
|
|
528
|
+
return parentUrl;
|
|
529
|
+
}
|
|
530
|
+
// export function getMonth(number: number): string {
|
|
531
|
+
// const months: string[] = [
|
|
532
|
+
// "January", "February", "March", "April", "May", "June",
|
|
533
|
+
// "July", "August", "September", "October", "November", "December"
|
|
534
|
+
// ];
|
|
535
|
+
// if (number < 1 || number > 12) {
|
|
536
|
+
// throw new Error("Invalid month number. It should be between 1 and 12.");
|
|
537
|
+
// }
|
|
538
|
+
// return months[number - 1];
|
|
539
|
+
// }
|
|
540
|
+
function getMonth(numberOfTheMonth) {
|
|
541
|
+
const meseci = [
|
|
542
|
+
'Januar',
|
|
543
|
+
'Februar',
|
|
544
|
+
'Mart',
|
|
545
|
+
'April',
|
|
546
|
+
'Maj',
|
|
547
|
+
'Jun',
|
|
548
|
+
'Jul',
|
|
549
|
+
'Avgust',
|
|
550
|
+
'Septembar',
|
|
551
|
+
'Oktobar',
|
|
552
|
+
'Novembar',
|
|
553
|
+
'Decembar',
|
|
554
|
+
];
|
|
555
|
+
if (numberOfTheMonth < 1 || numberOfTheMonth > 12) {
|
|
556
|
+
console.error('Nevažeći broj meseca. Broj treba biti između 1 i 12.');
|
|
526
557
|
}
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
super.ngOnInit();
|
|
558
|
+
return meseci[numberOfTheMonth - 1];
|
|
559
|
+
}
|
|
560
|
+
function singleOrDefault(array, predicate) {
|
|
561
|
+
const filtered = array.filter(predicate);
|
|
562
|
+
if (filtered.length > 1) {
|
|
563
|
+
throw new Error('Sequence contains more than one matching element.');
|
|
534
564
|
}
|
|
535
|
-
|
|
536
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: SpiderlyColorPickerComponent, isStandalone: true, selector: "spiderly-colorpicker", inputs: { showInputTextField: "showInputTextField" }, usesInheritance: true, ngImport: i0, template: "<!-- Can't put (onBlur) in this control -->\n\n<div style=\"display: flex; flex-direction: column; gap: 0.5rem\">\n <div *ngIf=\"getTranslatedLabel() != '' && getTranslatedLabel() != null\">\n <label>{{ getTranslatedLabel() }}</label>\n <required *ngIf=\"control?.required && showRequired\"></required>\n </div>\n <div style=\"display: flex; gap: 10px\">\n <input\n *ngIf=\"control && showInputTextField\"\n pInputText\n [placeholder]=\"placeholder\"\n [formControl]=\"control\"\n [id]=\"control.label\"\n (blur)=\"control.markAsDirty()\"\n [fluid]=\"true\"\n />\n <p-colorpicker\n *ngIf=\"control\"\n [formControl]=\"control\"\n [id]=\"control.label\"\n (blur)=\"control.markAsDirty()\"\n appendTo=\"body\"\n ></p-colorpicker>\n </div>\n <small *ngIf=\"control?.errors && control?.dirty\" class=\"spiderly-error-message\">\n {{ getValidationErrrorMessages() }}\n </small>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ColorPickerModule }, { kind: "component", type: i4$3.ColorPicker, selector: "p-colorPicker, p-colorpicker, p-color-picker", inputs: ["style", "styleClass", "inline", "format", "appendTo", "disabled", "tabindex", "inputId", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "autofocus"], outputs: ["onChange", "onShow", "onHide"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i5$1.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "component", type: RequiredComponent, selector: "required" }] }); }
|
|
565
|
+
return filtered[0];
|
|
537
566
|
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
ReactiveFormsModule,
|
|
543
|
-
FormsModule,
|
|
544
|
-
ColorPickerModule,
|
|
545
|
-
InputTextModule,
|
|
546
|
-
RequiredComponent,
|
|
547
|
-
], template: "<!-- Can't put (onBlur) in this control -->\n\n<div style=\"display: flex; flex-direction: column; gap: 0.5rem\">\n <div *ngIf=\"getTranslatedLabel() != '' && getTranslatedLabel() != null\">\n <label>{{ getTranslatedLabel() }}</label>\n <required *ngIf=\"control?.required && showRequired\"></required>\n </div>\n <div style=\"display: flex; gap: 10px\">\n <input\n *ngIf=\"control && showInputTextField\"\n pInputText\n [placeholder]=\"placeholder\"\n [formControl]=\"control\"\n [id]=\"control.label\"\n (blur)=\"control.markAsDirty()\"\n [fluid]=\"true\"\n />\n <p-colorpicker\n *ngIf=\"control\"\n [formControl]=\"control\"\n [id]=\"control.label\"\n (blur)=\"control.markAsDirty()\"\n appendTo=\"body\"\n ></p-colorpicker>\n </div>\n <small *ngIf=\"control?.errors && control?.dirty\" class=\"spiderly-error-message\">\n {{ getValidationErrrorMessages() }}\n </small>\n</div>\n" }]
|
|
548
|
-
}], ctorParameters: () => [{ type: i1.TranslocoService }], propDecorators: { showInputTextField: [{
|
|
549
|
-
type: Input
|
|
550
|
-
}] } });
|
|
551
|
-
|
|
552
|
-
class SpiderlyMultiAutocompleteComponent extends BaseAutocompleteControl {
|
|
553
|
-
constructor(translocoService) {
|
|
554
|
-
super(translocoService);
|
|
555
|
-
this.translocoService = translocoService;
|
|
567
|
+
function pushAction(cols, action) {
|
|
568
|
+
const actionsColumn = singleOrDefault(cols, (x) => x.actions != null);
|
|
569
|
+
if (actionsColumn) {
|
|
570
|
+
actionsColumn.actions = [...actionsColumn.actions, action];
|
|
556
571
|
}
|
|
557
|
-
|
|
558
|
-
|
|
572
|
+
}
|
|
573
|
+
function deleteAction(cols, actionField) {
|
|
574
|
+
const actionsColumn = singleOrDefault(cols, (x) => x.actions != null);
|
|
575
|
+
if (actionsColumn && actionsColumn.actions) {
|
|
576
|
+
const index = actionsColumn.actions.findIndex((a) => a.field === actionField);
|
|
577
|
+
if (index !== -1) {
|
|
578
|
+
actionsColumn.actions.splice(index, 1);
|
|
579
|
+
}
|
|
559
580
|
}
|
|
560
|
-
|
|
561
|
-
|
|
581
|
+
}
|
|
582
|
+
function getFileNameFromContentDisposition(resp, defaultName) {
|
|
583
|
+
let fileName;
|
|
584
|
+
if (resp && resp.headers && resp.headers.get('Content-Disposition')) {
|
|
585
|
+
let val = resp.headers.get('Content-Disposition');
|
|
586
|
+
let start = val.indexOf('filename=');
|
|
587
|
+
if (start != -1) {
|
|
588
|
+
let end = val.indexOf(';', start);
|
|
589
|
+
fileName =
|
|
590
|
+
end != -1 ? val.substring(start + 9, end) : val.substring(start + 9);
|
|
591
|
+
fileName = fileName.split('"').join('');
|
|
592
|
+
}
|
|
562
593
|
}
|
|
563
|
-
|
|
564
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: SpiderlyMultiAutocompleteComponent, isStandalone: true, selector: "spiderly-multiautocomplete", usesInheritance: true, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <div style=\"display: flex; flex-direction: column; gap: 0.5rem\">\n <div>\n <label>{{ getTranslatedLabel() }}</label>\n <required *ngIf=\"control?.required && showRequired\"></required>\n </div>\n\n <!-- Don't support p-inputgroup -->\n <!-- Showing label fix: https://github.com/primefaces/primeng/issues/17332#issuecomment-2922861294 -->\n <p-autocomplete\n *ngIf=\"control\"\n [id]=\"label\"\n [formControl]=\"control\"\n [placeholder]=\"placeholder\"\n [suggestions]=\"options\"\n (completeMethod)=\"search($event)\"\n [forceSelection]=\"true\"\n [multiple]=\"true\"\n [dropdown]=\"false\"\n [showClear]=\"true\"\n (onHide)=\"dropdownMarkAsDirty()\"\n [completeOnFocus]=\"true\"\n dropdownIcon=\"pi pi-plus\"\n [fluid]=\"true\"\n [style]=\"{ width: '100%' }\"\n appendTo=\"body\"\n optionLabel=\"displayName\"\n dataKey=\"id\"\n >\n </p-autocomplete>\n <small *ngIf=\"control?.errors && control?.dirty\" class=\"spiderly-error-message\">\n {{ getValidationErrrorMessages() }}\n </small>\n </div>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: AutoCompleteModule }, { kind: "component", type: i4.AutoComplete, selector: "p-autoComplete, p-autocomplete, p-auto-complete", inputs: ["minLength", "delay", "style", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "disabled", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "maxlength", "name", "required", "size", "appendTo", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "field", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "overlayOptions", "suggestions", "itemSize", "optionLabel", "optionValue", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "selectOnFocus", "searchLocale", "optionDisabled", "focusOnHover", "typeahead", "variant", "fluid"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: RequiredComponent, selector: "required" }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }] }); }
|
|
594
|
+
return fileName ?? defaultName;
|
|
565
595
|
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
FormsModule,
|
|
571
|
-
AutoCompleteModule,
|
|
572
|
-
CommonModule,
|
|
573
|
-
RequiredComponent,
|
|
574
|
-
TranslocoDirective,
|
|
575
|
-
], template: "<ng-container *transloco=\"let t\">\n <div style=\"display: flex; flex-direction: column; gap: 0.5rem\">\n <div>\n <label>{{ getTranslatedLabel() }}</label>\n <required *ngIf=\"control?.required && showRequired\"></required>\n </div>\n\n <!-- Don't support p-inputgroup -->\n <!-- Showing label fix: https://github.com/primefaces/primeng/issues/17332#issuecomment-2922861294 -->\n <p-autocomplete\n *ngIf=\"control\"\n [id]=\"label\"\n [formControl]=\"control\"\n [placeholder]=\"placeholder\"\n [suggestions]=\"options\"\n (completeMethod)=\"search($event)\"\n [forceSelection]=\"true\"\n [multiple]=\"true\"\n [dropdown]=\"false\"\n [showClear]=\"true\"\n (onHide)=\"dropdownMarkAsDirty()\"\n [completeOnFocus]=\"true\"\n dropdownIcon=\"pi pi-plus\"\n [fluid]=\"true\"\n [style]=\"{ width: '100%' }\"\n appendTo=\"body\"\n optionLabel=\"displayName\"\n dataKey=\"id\"\n >\n </p-autocomplete>\n <small *ngIf=\"control?.errors && control?.dirty\" class=\"spiderly-error-message\">\n {{ getValidationErrrorMessages() }}\n </small>\n </div>\n</ng-container>\n" }]
|
|
576
|
-
}], ctorParameters: () => [{ type: i1.TranslocoService }] });
|
|
577
|
-
|
|
578
|
-
class SpiderlyPasswordComponent extends BaseControl {
|
|
579
|
-
constructor(translocoService) {
|
|
580
|
-
super(translocoService);
|
|
581
|
-
this.translocoService = translocoService;
|
|
582
|
-
this.showPasswordStrength = false;
|
|
596
|
+
function toCommaSeparatedString(input) {
|
|
597
|
+
const stringList = input.map((item) => item?.toString() ?? '');
|
|
598
|
+
if (stringList.length > 1) {
|
|
599
|
+
return `${stringList.slice(0, -1).join(', ')} and ${stringList[stringList.length - 1]}`;
|
|
583
600
|
}
|
|
584
|
-
|
|
585
|
-
|
|
601
|
+
else {
|
|
602
|
+
return stringList[0] ?? '';
|
|
586
603
|
}
|
|
587
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyPasswordComponent, deps: [{ token: i1.TranslocoService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
588
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: SpiderlyPasswordComponent, isStandalone: true, selector: "spiderly-password", inputs: { showPasswordStrength: "showPasswordStrength" }, usesInheritance: true, ngImport: i0, template: "<div style=\"display: flex; flex-direction: column; gap: 0.5rem\">\n <div>\n <label>{{ getTranslatedLabel() }}</label>\n <required *ngIf=\"control?.required && showRequired\"></required>\n </div>\n <p-password\n *ngIf=\"control\"\n [formControl]=\"control\"\n [id]=\"control?.label\"\n [toggleMask]=\"true\"\n [feedback]=\"showPasswordStrength\"\n (onBlur)=\"control?.markAsDirty()\"\n [style]=\"{ width: '100%' }\"\n [inputStyle]=\"{ width: '100%' }\"\n />\n <small *ngIf=\"control?.errors && control?.dirty\" class=\"spiderly-error-message\">\n {{ getValidationErrrorMessages() }}\n </small>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: PasswordModule }, { kind: "component", type: i4$4.Password, selector: "p-password", inputs: ["ariaLabel", "fluid", "ariaLabelledBy", "label", "disabled", "promptLabel", "mediumRegex", "strongRegex", "weakLabel", "mediumLabel", "maxLength", "strongLabel", "inputId", "feedback", "appendTo", "toggleMask", "size", "inputStyleClass", "styleClass", "style", "inputStyle", "showTransitionOptions", "hideTransitionOptions", "autocomplete", "placeholder", "showClear", "autofocus", "variant", "tabindex"], outputs: ["onFocus", "onBlur", "onClear"] }, { kind: "component", type: RequiredComponent, selector: "required" }] }); }
|
|
589
604
|
}
|
|
590
|
-
|
|
605
|
+
function isFileImageType(mimeType) {
|
|
606
|
+
if (mimeType.startsWith('image/')) {
|
|
607
|
+
return true;
|
|
608
|
+
}
|
|
609
|
+
return false;
|
|
610
|
+
}
|
|
611
|
+
function isExcelFileType(mimeType) {
|
|
612
|
+
if (mimeType ===
|
|
613
|
+
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ||
|
|
614
|
+
mimeType === 'application/vnd.ms-excel') {
|
|
615
|
+
return true;
|
|
616
|
+
}
|
|
617
|
+
return false;
|
|
618
|
+
}
|
|
619
|
+
function exportListToExcel(exportListToExcelObservableMethod, filter) {
|
|
620
|
+
exportListToExcelObservableMethod(filter).subscribe((res) => {
|
|
621
|
+
let fileName = getFileNameFromContentDisposition(res, 'ExcelExport.xlsx');
|
|
622
|
+
FileSaver.saveAs(res.body, decodeURIComponent(fileName));
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
function getPrimengDropdownNamebookOptions(getDropdownListObservable, parentEntityId) {
|
|
626
|
+
return getDropdownListObservable(parentEntityId ?? 0).pipe(map((res) => {
|
|
627
|
+
return res.map((x) => ({ label: x.displayName, code: x.id }));
|
|
628
|
+
}));
|
|
629
|
+
}
|
|
630
|
+
function getPrimengDropdownCodebookOptions(getDropdownListObservable) {
|
|
631
|
+
return getDropdownListObservable().pipe(map((res) => {
|
|
632
|
+
return res.map((x) => ({ label: x.displayName, code: x.code }));
|
|
633
|
+
}));
|
|
634
|
+
}
|
|
635
|
+
function getPrimengAutocompleteNamebookOptions(getAutocompleteListObservable, limit, query, parentEntityId) {
|
|
636
|
+
return getAutocompleteListObservable(limit, query, parentEntityId ?? 0).pipe(map((res) => {
|
|
637
|
+
return res.map((x) => ({ label: x.displayName, code: x.id }));
|
|
638
|
+
}));
|
|
639
|
+
}
|
|
640
|
+
function getPrimengAutocompleteCodebookOptions(getAutocompleteListObservable, limit, query) {
|
|
641
|
+
return getAutocompleteListObservable(limit, query).pipe(map((res) => {
|
|
642
|
+
return res.map((x) => ({ label: x.displayName, code: x.code }));
|
|
643
|
+
}));
|
|
644
|
+
}
|
|
645
|
+
const isNullOrEmpty = (input) => {
|
|
646
|
+
if (input == null || input === '') {
|
|
647
|
+
return true;
|
|
648
|
+
}
|
|
649
|
+
return false;
|
|
650
|
+
};
|
|
651
|
+
const selectedTab = (tabs) => {
|
|
652
|
+
const tab = singleOrDefault(tabs, (x) => x.isSelected);
|
|
653
|
+
if (tab) {
|
|
654
|
+
return tab.id;
|
|
655
|
+
}
|
|
656
|
+
else {
|
|
657
|
+
return null;
|
|
658
|
+
}
|
|
659
|
+
};
|
|
660
|
+
function firstCharToUpper(input) {
|
|
661
|
+
return input.charAt(0).toUpperCase() + input.slice(1);
|
|
662
|
+
}
|
|
663
|
+
function splitPascalCase(input) {
|
|
664
|
+
const regex = /($[a-z])|[A-Z][^A-Z]+/g;
|
|
665
|
+
return input.match(regex).join(' ');
|
|
666
|
+
}
|
|
667
|
+
function capitalizeFirstChar(str) {
|
|
668
|
+
if (!str)
|
|
669
|
+
return str;
|
|
670
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
671
|
+
}
|
|
672
|
+
function kebabToTitleCase(input) {
|
|
673
|
+
return input
|
|
674
|
+
.split('-')
|
|
675
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
676
|
+
.join(' ');
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* Custom styling of the google button - https://medium.com/simform-engineering/implement-custom-google-sign-in-using-angular-16-9c93aeff6252
|
|
680
|
+
*/
|
|
681
|
+
function createFakeGoogleWrapper() {
|
|
682
|
+
const googleLoginWrapper = document.createElement('div');
|
|
683
|
+
googleLoginWrapper.style.display = 'none';
|
|
684
|
+
googleLoginWrapper.classList.add('custom-google-button');
|
|
685
|
+
document.body.appendChild(googleLoginWrapper);
|
|
686
|
+
window.google.accounts.id.renderButton(googleLoginWrapper, {
|
|
687
|
+
type: 'icon',
|
|
688
|
+
width: '200',
|
|
689
|
+
});
|
|
690
|
+
const googleLoginWrapperButton = googleLoginWrapper.querySelector('div[role=button]');
|
|
691
|
+
return {
|
|
692
|
+
click: () => {
|
|
693
|
+
googleLoginWrapperButton?.click();
|
|
694
|
+
},
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
const PROPS_KEY = Symbol('props');
|
|
698
|
+
function ReflectProp(target, propertyKey) {
|
|
699
|
+
const props = Reflect.getMetadata(PROPS_KEY, target) || [];
|
|
700
|
+
Reflect.defineMetadata(PROPS_KEY, [...props, propertyKey], target);
|
|
701
|
+
}
|
|
702
|
+
const primitiveArrayTypes = [
|
|
703
|
+
'Namebook[]',
|
|
704
|
+
'number[]',
|
|
705
|
+
'Date[]',
|
|
706
|
+
'string[]',
|
|
707
|
+
];
|
|
708
|
+
function getImageDimensions(file) {
|
|
709
|
+
return new Promise((resolve) => {
|
|
710
|
+
const img = new Image();
|
|
711
|
+
img.onload = () => {
|
|
712
|
+
resolve({ width: img.width, height: img.height });
|
|
713
|
+
URL.revokeObjectURL(img.src);
|
|
714
|
+
};
|
|
715
|
+
img.src = URL.createObjectURL(file);
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
class SpiderlyCalendarComponent extends BaseControl {
|
|
720
|
+
constructor(translocoService) {
|
|
721
|
+
super(translocoService);
|
|
722
|
+
this.translocoService = translocoService;
|
|
723
|
+
this.showTime = false;
|
|
724
|
+
this.dateOnly = false;
|
|
725
|
+
this.timeOnly = false;
|
|
726
|
+
this.internalControl = new FormControl(null);
|
|
727
|
+
this.syncing = false;
|
|
728
|
+
this.subscriptions = [];
|
|
729
|
+
}
|
|
730
|
+
ngOnInit() {
|
|
731
|
+
super.ngOnInit();
|
|
732
|
+
if (!this.usesStringProxy() || !this.control)
|
|
733
|
+
return;
|
|
734
|
+
this.applyFromOuter(this.control.value);
|
|
735
|
+
if (this.control.disabled)
|
|
736
|
+
this.internalControl.disable({ emitEvent: false });
|
|
737
|
+
this.subscriptions.push(this.control.valueChanges.subscribe((v) => {
|
|
738
|
+
if (!this.syncing)
|
|
739
|
+
this.applyFromOuter(v);
|
|
740
|
+
}));
|
|
741
|
+
this.subscriptions.push(this.control.statusChanges.subscribe((status) => {
|
|
742
|
+
if (status === 'DISABLED' && this.internalControl.enabled)
|
|
743
|
+
this.internalControl.disable({ emitEvent: false });
|
|
744
|
+
else if (status !== 'DISABLED' && this.internalControl.disabled)
|
|
745
|
+
this.internalControl.enable({ emitEvent: false });
|
|
746
|
+
}));
|
|
747
|
+
this.subscriptions.push(this.internalControl.valueChanges.subscribe((d) => {
|
|
748
|
+
if (!this.syncing)
|
|
749
|
+
this.applyToOuter(d);
|
|
750
|
+
}));
|
|
751
|
+
}
|
|
752
|
+
ngOnDestroy() {
|
|
753
|
+
this.subscriptions.forEach((s) => s.unsubscribe());
|
|
754
|
+
}
|
|
755
|
+
setDate(event) { }
|
|
756
|
+
usesStringProxy() {
|
|
757
|
+
return this.dateOnly || this.timeOnly;
|
|
758
|
+
}
|
|
759
|
+
applyFromOuter(v) {
|
|
760
|
+
this.syncing = true;
|
|
761
|
+
try {
|
|
762
|
+
if (v == null) {
|
|
763
|
+
this.internalControl.setValue(null);
|
|
764
|
+
}
|
|
765
|
+
else if (this.dateOnly && typeof v === 'string') {
|
|
766
|
+
this.internalControl.setValue(parseDateOnlyLocal(v));
|
|
767
|
+
}
|
|
768
|
+
else if (this.timeOnly && typeof v === 'string') {
|
|
769
|
+
this.internalControl.setValue(this.parseTimeOnly(v));
|
|
770
|
+
}
|
|
771
|
+
else if (v instanceof Date) {
|
|
772
|
+
this.internalControl.setValue(v);
|
|
773
|
+
}
|
|
774
|
+
else {
|
|
775
|
+
this.internalControl.setValue(null);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
finally {
|
|
779
|
+
this.syncing = false;
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
applyToOuter(d) {
|
|
783
|
+
this.syncing = true;
|
|
784
|
+
try {
|
|
785
|
+
if (d == null) {
|
|
786
|
+
this.control.setValue(null);
|
|
787
|
+
}
|
|
788
|
+
else if (this.dateOnly) {
|
|
789
|
+
this.control.setValue(this.formatDateOnly(d));
|
|
790
|
+
}
|
|
791
|
+
else if (this.timeOnly) {
|
|
792
|
+
this.control.setValue(this.formatTimeOnly(d));
|
|
793
|
+
}
|
|
794
|
+
else {
|
|
795
|
+
this.control.setValue(d);
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
finally {
|
|
799
|
+
this.syncing = false;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
parseTimeOnly(s) {
|
|
803
|
+
const m = /^(\d{2}):(\d{2})(?::(\d{2}))?/.exec(s);
|
|
804
|
+
if (!m)
|
|
805
|
+
return null;
|
|
806
|
+
const d = new Date();
|
|
807
|
+
d.setHours(+m[1], +m[2], +(m[3] ?? 0), 0);
|
|
808
|
+
return d;
|
|
809
|
+
}
|
|
810
|
+
formatDateOnly(d) {
|
|
811
|
+
return `${d.getFullYear()}-${this.pad(d.getMonth() + 1)}-${this.pad(d.getDate())}`;
|
|
812
|
+
}
|
|
813
|
+
formatTimeOnly(d) {
|
|
814
|
+
return `${this.pad(d.getHours())}:${this.pad(d.getMinutes())}:${this.pad(d.getSeconds())}`;
|
|
815
|
+
}
|
|
816
|
+
pad(n) {
|
|
817
|
+
return String(n).padStart(2, '0');
|
|
818
|
+
}
|
|
819
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyCalendarComponent, deps: [{ token: i1.TranslocoService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
820
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: SpiderlyCalendarComponent, isStandalone: true, selector: "spiderly-calendar", inputs: { showTime: "showTime", dateOnly: "dateOnly", timeOnly: "timeOnly" }, usesInheritance: true, ngImport: i0, template: "<div style=\"display: flex; flex-direction: column; gap: 0.5rem\">\n <div\n *ngIf=\"getTranslatedLabel() != '' && getTranslatedLabel() != null\"\n style=\"display: flex; align-items: center\"\n >\n <div>\n <label>{{ getTranslatedLabel() }}</label>\n <required *ngIf=\"control?.required && showRequired\"></required>\n </div>\n <!-- tabindex=\"-1\": Makes the element focusable, but removes it from the tab order. -->\n <i\n *ngIf=\"showTooltip\"\n class=\"{{ tooltipIcon }}\"\n style=\"margin-left: 8px; cursor: pointer\"\n [pTooltip]=\"tooltipText\"\n tabindex=\"-1\"\n tooltipEvent=\"focus\"\n ></i>\n </div>\n <p-datepicker\n *ngIf=\"control\"\n [formControl]=\"usesStringProxy() ? internalControl : control\"\n (onBlur)=\"control.markAsDirty()\"\n [dateFormat]=\"timeOnly ? '' : 'dd.mm.yy.'\"\n iconDisplay=\"input\"\n [showIcon]=\"true\"\n [showTime]=\"!usesStringProxy() && showTime\"\n [timeOnly]=\"timeOnly\"\n (onSelect)=\"setDate($event)\"\n appendTo=\"body\"\n [fluid]=\"true\"\n />\n <small *ngIf=\"control?.errors && control?.dirty\" class=\"spiderly-error-message\">\n {{ getValidationErrrorMessages() }}\n </small>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: DatePickerModule }, { kind: "component", type: i4$1.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "fluid", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "size", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i5.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: RequiredComponent, selector: "required" }] }); }
|
|
821
|
+
}
|
|
822
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyCalendarComponent, decorators: [{
|
|
823
|
+
type: Component,
|
|
824
|
+
args: [{ selector: 'spiderly-calendar', imports: [
|
|
825
|
+
CommonModule,
|
|
826
|
+
ReactiveFormsModule,
|
|
827
|
+
FormsModule,
|
|
828
|
+
DatePickerModule,
|
|
829
|
+
TooltipModule,
|
|
830
|
+
RequiredComponent,
|
|
831
|
+
], template: "<div style=\"display: flex; flex-direction: column; gap: 0.5rem\">\n <div\n *ngIf=\"getTranslatedLabel() != '' && getTranslatedLabel() != null\"\n style=\"display: flex; align-items: center\"\n >\n <div>\n <label>{{ getTranslatedLabel() }}</label>\n <required *ngIf=\"control?.required && showRequired\"></required>\n </div>\n <!-- tabindex=\"-1\": Makes the element focusable, but removes it from the tab order. -->\n <i\n *ngIf=\"showTooltip\"\n class=\"{{ tooltipIcon }}\"\n style=\"margin-left: 8px; cursor: pointer\"\n [pTooltip]=\"tooltipText\"\n tabindex=\"-1\"\n tooltipEvent=\"focus\"\n ></i>\n </div>\n <p-datepicker\n *ngIf=\"control\"\n [formControl]=\"usesStringProxy() ? internalControl : control\"\n (onBlur)=\"control.markAsDirty()\"\n [dateFormat]=\"timeOnly ? '' : 'dd.mm.yy.'\"\n iconDisplay=\"input\"\n [showIcon]=\"true\"\n [showTime]=\"!usesStringProxy() && showTime\"\n [timeOnly]=\"timeOnly\"\n (onSelect)=\"setDate($event)\"\n appendTo=\"body\"\n [fluid]=\"true\"\n />\n <small *ngIf=\"control?.errors && control?.dirty\" class=\"spiderly-error-message\">\n {{ getValidationErrrorMessages() }}\n </small>\n</div>\n" }]
|
|
832
|
+
}], ctorParameters: () => [{ type: i1.TranslocoService }], propDecorators: { showTime: [{
|
|
833
|
+
type: Input
|
|
834
|
+
}], dateOnly: [{
|
|
835
|
+
type: Input
|
|
836
|
+
}], timeOnly: [{
|
|
837
|
+
type: Input
|
|
838
|
+
}] } });
|
|
839
|
+
|
|
840
|
+
class SpiderlyCheckboxComponent extends BaseControl {
|
|
841
|
+
constructor(translocoService) {
|
|
842
|
+
super(translocoService);
|
|
843
|
+
this.translocoService = translocoService;
|
|
844
|
+
this.fakeLabel = true;
|
|
845
|
+
this.initializeToFalse = false;
|
|
846
|
+
this.inlineLabel = false;
|
|
847
|
+
this.onChange = new EventEmitter();
|
|
848
|
+
this.change = (event) => {
|
|
849
|
+
this.onChange.next(event);
|
|
850
|
+
};
|
|
851
|
+
}
|
|
852
|
+
ngOnInit() {
|
|
853
|
+
if (this.initializeToFalse == true)
|
|
854
|
+
this.control.setValue(false);
|
|
855
|
+
super.ngOnInit();
|
|
856
|
+
}
|
|
857
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyCheckboxComponent, deps: [{ token: i1.TranslocoService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
858
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: SpiderlyCheckboxComponent, isStandalone: true, selector: "spiderly-checkbox", inputs: { fakeLabel: "fakeLabel", initializeToFalse: "initializeToFalse", inlineLabel: "inlineLabel" }, outputs: { onChange: "onChange" }, usesInheritance: true, ngImport: i0, template: "<div style=\"display: flex; flex-direction: column; gap: 0.5rem\">\n <div\n *ngIf=\"\n inlineLabel === false &&\n getTranslatedLabel() != '' &&\n getTranslatedLabel() != null\n \"\n >\n <label>{{ getTranslatedLabel() }}</label>\n <required *ngIf=\"control?.required && showRequired\"></required>\n </div>\n <div style=\"margin-top: 0.5rem; position: relative\">\n <!-- The margin-top is intentional: it vertically aligns the checkbox with other input controls that have greater height. -->\n <p-checkbox\n *ngIf=\"control\"\n [formControl]=\"control\"\n [value]=\"inlineLabel ? label : null\"\n [id]=\"label\"\n [binary]=\"true\"\n (onChange)=\"change($event)\"\n />\n </div>\n <small *ngIf=\"control?.errors && control?.dirty\" class=\"spiderly-error-message\">\n {{ getValidationErrrorMessages() }}\n </small>\n</div>\n", styles: ["::ng-deep .p-checkbox-false .p-checkbox-box{border-color:var(--p-checkbox-checked-border-color);background:var(--p-checkbox-checked-background)}::ng-deep .p-checkbox-false .p-checkbox:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-box{border-color:var(--p-checkbox-checked-hover-border-color);background:var(--p-checkbox-checked-hover-background)}::ng-deep .p-checkbox-false .p-checkbox-false:has(.p-checkbox.p-disabled) .p-checkbox-false-icon{color:var(--p-checkbox-icon-disabled-color)}.p-checkbox-false-icon{position:absolute;top:3px;left:2.7px;font-size:12.25px;color:var(--p-checkbox-icon-checked-color)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i4$2.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "component", type: RequiredComponent, selector: "required" }] }); }
|
|
859
|
+
}
|
|
860
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyCheckboxComponent, decorators: [{
|
|
861
|
+
type: Component,
|
|
862
|
+
args: [{ selector: 'spiderly-checkbox', imports: [
|
|
863
|
+
CommonModule,
|
|
864
|
+
ReactiveFormsModule,
|
|
865
|
+
FormsModule,
|
|
866
|
+
CheckboxModule,
|
|
867
|
+
RequiredComponent,
|
|
868
|
+
], template: "<div style=\"display: flex; flex-direction: column; gap: 0.5rem\">\n <div\n *ngIf=\"\n inlineLabel === false &&\n getTranslatedLabel() != '' &&\n getTranslatedLabel() != null\n \"\n >\n <label>{{ getTranslatedLabel() }}</label>\n <required *ngIf=\"control?.required && showRequired\"></required>\n </div>\n <div style=\"margin-top: 0.5rem; position: relative\">\n <!-- The margin-top is intentional: it vertically aligns the checkbox with other input controls that have greater height. -->\n <p-checkbox\n *ngIf=\"control\"\n [formControl]=\"control\"\n [value]=\"inlineLabel ? label : null\"\n [id]=\"label\"\n [binary]=\"true\"\n (onChange)=\"change($event)\"\n />\n </div>\n <small *ngIf=\"control?.errors && control?.dirty\" class=\"spiderly-error-message\">\n {{ getValidationErrrorMessages() }}\n </small>\n</div>\n", styles: ["::ng-deep .p-checkbox-false .p-checkbox-box{border-color:var(--p-checkbox-checked-border-color);background:var(--p-checkbox-checked-background)}::ng-deep .p-checkbox-false .p-checkbox:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-box{border-color:var(--p-checkbox-checked-hover-border-color);background:var(--p-checkbox-checked-hover-background)}::ng-deep .p-checkbox-false .p-checkbox-false:has(.p-checkbox.p-disabled) .p-checkbox-false-icon{color:var(--p-checkbox-icon-disabled-color)}.p-checkbox-false-icon{position:absolute;top:3px;left:2.7px;font-size:12.25px;color:var(--p-checkbox-icon-checked-color)}\n"] }]
|
|
869
|
+
}], ctorParameters: () => [{ type: i1.TranslocoService }], propDecorators: { fakeLabel: [{
|
|
870
|
+
type: Input
|
|
871
|
+
}], initializeToFalse: [{
|
|
872
|
+
type: Input
|
|
873
|
+
}], inlineLabel: [{
|
|
874
|
+
type: Input
|
|
875
|
+
}], onChange: [{
|
|
876
|
+
type: Output
|
|
877
|
+
}] } });
|
|
878
|
+
|
|
879
|
+
class SpiderlyColorPickerComponent extends BaseControl {
|
|
880
|
+
constructor(translocoService) {
|
|
881
|
+
super(translocoService);
|
|
882
|
+
this.translocoService = translocoService;
|
|
883
|
+
this.showInputTextField = true;
|
|
884
|
+
}
|
|
885
|
+
ngOnInit() {
|
|
886
|
+
this.control.valueChanges.subscribe((value) => {
|
|
887
|
+
this.control.setValue(value, { emitEvent: false }); // Preventing infinite loop
|
|
888
|
+
});
|
|
889
|
+
if (this.control.value == null)
|
|
890
|
+
this.placeholder = this.translocoService.translate('ColorPickerPlaceholder');
|
|
891
|
+
super.ngOnInit();
|
|
892
|
+
}
|
|
893
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyColorPickerComponent, deps: [{ token: i1.TranslocoService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
894
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: SpiderlyColorPickerComponent, isStandalone: true, selector: "spiderly-colorpicker", inputs: { showInputTextField: "showInputTextField" }, usesInheritance: true, ngImport: i0, template: "<!-- Can't put (onBlur) in this control -->\n\n<div style=\"display: flex; flex-direction: column; gap: 0.5rem\">\n <div *ngIf=\"getTranslatedLabel() != '' && getTranslatedLabel() != null\">\n <label>{{ getTranslatedLabel() }}</label>\n <required *ngIf=\"control?.required && showRequired\"></required>\n </div>\n <div style=\"display: flex; gap: 10px\">\n <input\n *ngIf=\"control && showInputTextField\"\n pInputText\n [placeholder]=\"placeholder\"\n [formControl]=\"control\"\n [id]=\"control.label\"\n (blur)=\"control.markAsDirty()\"\n [fluid]=\"true\"\n />\n <p-colorpicker\n *ngIf=\"control\"\n [formControl]=\"control\"\n [id]=\"control.label\"\n (blur)=\"control.markAsDirty()\"\n appendTo=\"body\"\n ></p-colorpicker>\n </div>\n <small *ngIf=\"control?.errors && control?.dirty\" class=\"spiderly-error-message\">\n {{ getValidationErrrorMessages() }}\n </small>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ColorPickerModule }, { kind: "component", type: i4$3.ColorPicker, selector: "p-colorPicker, p-colorpicker, p-color-picker", inputs: ["style", "styleClass", "inline", "format", "appendTo", "disabled", "tabindex", "inputId", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "autofocus"], outputs: ["onChange", "onShow", "onHide"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i5$1.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "component", type: RequiredComponent, selector: "required" }] }); }
|
|
895
|
+
}
|
|
896
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyColorPickerComponent, decorators: [{
|
|
897
|
+
type: Component,
|
|
898
|
+
args: [{ selector: 'spiderly-colorpicker', imports: [
|
|
899
|
+
CommonModule,
|
|
900
|
+
ReactiveFormsModule,
|
|
901
|
+
FormsModule,
|
|
902
|
+
ColorPickerModule,
|
|
903
|
+
InputTextModule,
|
|
904
|
+
RequiredComponent,
|
|
905
|
+
], template: "<!-- Can't put (onBlur) in this control -->\n\n<div style=\"display: flex; flex-direction: column; gap: 0.5rem\">\n <div *ngIf=\"getTranslatedLabel() != '' && getTranslatedLabel() != null\">\n <label>{{ getTranslatedLabel() }}</label>\n <required *ngIf=\"control?.required && showRequired\"></required>\n </div>\n <div style=\"display: flex; gap: 10px\">\n <input\n *ngIf=\"control && showInputTextField\"\n pInputText\n [placeholder]=\"placeholder\"\n [formControl]=\"control\"\n [id]=\"control.label\"\n (blur)=\"control.markAsDirty()\"\n [fluid]=\"true\"\n />\n <p-colorpicker\n *ngIf=\"control\"\n [formControl]=\"control\"\n [id]=\"control.label\"\n (blur)=\"control.markAsDirty()\"\n appendTo=\"body\"\n ></p-colorpicker>\n </div>\n <small *ngIf=\"control?.errors && control?.dirty\" class=\"spiderly-error-message\">\n {{ getValidationErrrorMessages() }}\n </small>\n</div>\n" }]
|
|
906
|
+
}], ctorParameters: () => [{ type: i1.TranslocoService }], propDecorators: { showInputTextField: [{
|
|
907
|
+
type: Input
|
|
908
|
+
}] } });
|
|
909
|
+
|
|
910
|
+
class SpiderlyMultiAutocompleteComponent extends BaseAutocompleteControl {
|
|
911
|
+
constructor(translocoService) {
|
|
912
|
+
super(translocoService);
|
|
913
|
+
this.translocoService = translocoService;
|
|
914
|
+
}
|
|
915
|
+
ngOnInit() {
|
|
916
|
+
super.ngOnInit();
|
|
917
|
+
}
|
|
918
|
+
search(event) {
|
|
919
|
+
this.onTextInput.next(event);
|
|
920
|
+
}
|
|
921
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyMultiAutocompleteComponent, deps: [{ token: i1.TranslocoService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
922
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: SpiderlyMultiAutocompleteComponent, isStandalone: true, selector: "spiderly-multiautocomplete", usesInheritance: true, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <div style=\"display: flex; flex-direction: column; gap: 0.5rem\">\n <div>\n <label>{{ getTranslatedLabel() }}</label>\n <required *ngIf=\"control?.required && showRequired\"></required>\n </div>\n\n <!-- Don't support p-inputgroup -->\n <!-- Showing label fix: https://github.com/primefaces/primeng/issues/17332#issuecomment-2922861294 -->\n <p-autocomplete\n *ngIf=\"control\"\n [id]=\"label\"\n [formControl]=\"control\"\n [placeholder]=\"placeholder\"\n [suggestions]=\"options\"\n (completeMethod)=\"search($event)\"\n [forceSelection]=\"true\"\n [multiple]=\"true\"\n [dropdown]=\"false\"\n [showClear]=\"true\"\n (onHide)=\"dropdownMarkAsDirty()\"\n [completeOnFocus]=\"true\"\n dropdownIcon=\"pi pi-plus\"\n [fluid]=\"true\"\n [style]=\"{ width: '100%' }\"\n appendTo=\"body\"\n optionLabel=\"displayName\"\n dataKey=\"id\"\n >\n </p-autocomplete>\n <small *ngIf=\"control?.errors && control?.dirty\" class=\"spiderly-error-message\">\n {{ getValidationErrrorMessages() }}\n </small>\n </div>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: AutoCompleteModule }, { kind: "component", type: i4.AutoComplete, selector: "p-autoComplete, p-autocomplete, p-auto-complete", inputs: ["minLength", "delay", "style", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "disabled", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "maxlength", "name", "required", "size", "appendTo", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "field", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "overlayOptions", "suggestions", "itemSize", "optionLabel", "optionValue", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "selectOnFocus", "searchLocale", "optionDisabled", "focusOnHover", "typeahead", "variant", "fluid"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: RequiredComponent, selector: "required" }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }] }); }
|
|
923
|
+
}
|
|
924
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyMultiAutocompleteComponent, decorators: [{
|
|
925
|
+
type: Component,
|
|
926
|
+
args: [{ selector: 'spiderly-multiautocomplete', imports: [
|
|
927
|
+
ReactiveFormsModule,
|
|
928
|
+
FormsModule,
|
|
929
|
+
AutoCompleteModule,
|
|
930
|
+
CommonModule,
|
|
931
|
+
RequiredComponent,
|
|
932
|
+
TranslocoDirective,
|
|
933
|
+
], template: "<ng-container *transloco=\"let t\">\n <div style=\"display: flex; flex-direction: column; gap: 0.5rem\">\n <div>\n <label>{{ getTranslatedLabel() }}</label>\n <required *ngIf=\"control?.required && showRequired\"></required>\n </div>\n\n <!-- Don't support p-inputgroup -->\n <!-- Showing label fix: https://github.com/primefaces/primeng/issues/17332#issuecomment-2922861294 -->\n <p-autocomplete\n *ngIf=\"control\"\n [id]=\"label\"\n [formControl]=\"control\"\n [placeholder]=\"placeholder\"\n [suggestions]=\"options\"\n (completeMethod)=\"search($event)\"\n [forceSelection]=\"true\"\n [multiple]=\"true\"\n [dropdown]=\"false\"\n [showClear]=\"true\"\n (onHide)=\"dropdownMarkAsDirty()\"\n [completeOnFocus]=\"true\"\n dropdownIcon=\"pi pi-plus\"\n [fluid]=\"true\"\n [style]=\"{ width: '100%' }\"\n appendTo=\"body\"\n optionLabel=\"displayName\"\n dataKey=\"id\"\n >\n </p-autocomplete>\n <small *ngIf=\"control?.errors && control?.dirty\" class=\"spiderly-error-message\">\n {{ getValidationErrrorMessages() }}\n </small>\n </div>\n</ng-container>\n" }]
|
|
934
|
+
}], ctorParameters: () => [{ type: i1.TranslocoService }] });
|
|
935
|
+
|
|
936
|
+
class SpiderlyPasswordComponent extends BaseControl {
|
|
937
|
+
constructor(translocoService) {
|
|
938
|
+
super(translocoService);
|
|
939
|
+
this.translocoService = translocoService;
|
|
940
|
+
this.showPasswordStrength = false;
|
|
941
|
+
}
|
|
942
|
+
ngOnInit() {
|
|
943
|
+
super.ngOnInit();
|
|
944
|
+
}
|
|
945
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyPasswordComponent, deps: [{ token: i1.TranslocoService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
946
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: SpiderlyPasswordComponent, isStandalone: true, selector: "spiderly-password", inputs: { showPasswordStrength: "showPasswordStrength" }, usesInheritance: true, ngImport: i0, template: "<div style=\"display: flex; flex-direction: column; gap: 0.5rem\">\n <div>\n <label>{{ getTranslatedLabel() }}</label>\n <required *ngIf=\"control?.required && showRequired\"></required>\n </div>\n <p-password\n *ngIf=\"control\"\n [formControl]=\"control\"\n [id]=\"control?.label\"\n [toggleMask]=\"true\"\n [feedback]=\"showPasswordStrength\"\n (onBlur)=\"control?.markAsDirty()\"\n [style]=\"{ width: '100%' }\"\n [inputStyle]=\"{ width: '100%' }\"\n />\n <small *ngIf=\"control?.errors && control?.dirty\" class=\"spiderly-error-message\">\n {{ getValidationErrrorMessages() }}\n </small>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: PasswordModule }, { kind: "component", type: i4$4.Password, selector: "p-password", inputs: ["ariaLabel", "fluid", "ariaLabelledBy", "label", "disabled", "promptLabel", "mediumRegex", "strongRegex", "weakLabel", "mediumLabel", "maxLength", "strongLabel", "inputId", "feedback", "appendTo", "toggleMask", "size", "inputStyleClass", "styleClass", "style", "inputStyle", "showTransitionOptions", "hideTransitionOptions", "autocomplete", "placeholder", "showClear", "autofocus", "variant", "tabindex"], outputs: ["onFocus", "onBlur", "onClear"] }, { kind: "component", type: RequiredComponent, selector: "required" }] }); }
|
|
947
|
+
}
|
|
948
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyPasswordComponent, decorators: [{
|
|
591
949
|
type: Component,
|
|
592
950
|
args: [{ selector: 'spiderly-password', imports: [
|
|
593
951
|
CommonModule,
|
|
@@ -774,9 +1132,13 @@ class SpiderlyEditorComponent extends BaseControl {
|
|
|
774
1132
|
if (file) {
|
|
775
1133
|
const formData = new FormData();
|
|
776
1134
|
formData.append('file', file, `${this.objectId}-${file.name}`);
|
|
777
|
-
this.uploadImageMethod(formData).subscribe((
|
|
1135
|
+
this.uploadImageMethod(formData).subscribe((result) => {
|
|
778
1136
|
const range = quill.getSelection(true);
|
|
779
|
-
quill.insertEmbed(range.index, 'image',
|
|
1137
|
+
quill.insertEmbed(range.index, 'image', result.url);
|
|
1138
|
+
// Quill 2's built-in Image blot recognizes width/height as native attributes,
|
|
1139
|
+
// so formatText writes them directly onto the rendered <img>. Storefront uses
|
|
1140
|
+
// these to size the image up-front and prevent CLS.
|
|
1141
|
+
quill.formatText(range.index, 1, { width: result.width, height: result.height });
|
|
780
1142
|
quill.setSelection(range.index + 1);
|
|
781
1143
|
});
|
|
782
1144
|
}
|
|
@@ -889,262 +1251,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
889
1251
|
class BaseEntity {
|
|
890
1252
|
}
|
|
891
1253
|
|
|
892
|
-
// Helper function for PrecisionScale validation (to be added in the TypeScript output):
|
|
893
|
-
function validatePrecisionScale(value, precision, scale, ignoreTrailingZeros) {
|
|
894
|
-
if (typeof value !== 'number')
|
|
895
|
-
return false;
|
|
896
|
-
const [integerPart, decimalPart] = value.toString().split('.');
|
|
897
|
-
if (integerPart.length > precision - scale)
|
|
898
|
-
return false;
|
|
899
|
-
if (decimalPart && decimalPart.length > scale)
|
|
900
|
-
return false;
|
|
901
|
-
if (!ignoreTrailingZeros &&
|
|
902
|
-
decimalPart &&
|
|
903
|
-
decimalPart.replace(/0+$/, '').length > scale)
|
|
904
|
-
return false;
|
|
905
|
-
return true;
|
|
906
|
-
}
|
|
907
|
-
function getMimeTypeForFileName(fileName) {
|
|
908
|
-
return mime.getType(fileName) ?? 'application/octet-stream';
|
|
909
|
-
}
|
|
910
|
-
function adjustColor(color, percent) {
|
|
911
|
-
if (!/^#([0-9A-F]{3}){1,2}$/i.test(color)) {
|
|
912
|
-
console.error('Invalid hex color format');
|
|
913
|
-
}
|
|
914
|
-
let r, g, b;
|
|
915
|
-
if (color.length === 7) {
|
|
916
|
-
r = parseInt(color.slice(1, 3), 16);
|
|
917
|
-
g = parseInt(color.slice(3, 5), 16);
|
|
918
|
-
b = parseInt(color.slice(5, 7), 16);
|
|
919
|
-
}
|
|
920
|
-
else {
|
|
921
|
-
r = parseInt(color[1] + color[1], 16);
|
|
922
|
-
g = parseInt(color[2] + color[2], 16);
|
|
923
|
-
b = parseInt(color[3] + color[3], 16);
|
|
924
|
-
}
|
|
925
|
-
const adjust = (value, percent) => {
|
|
926
|
-
const amount = (percent / 100) * 255;
|
|
927
|
-
const newValue = Math.min(Math.max(value + amount, 0), 255);
|
|
928
|
-
return Math.round(newValue);
|
|
929
|
-
};
|
|
930
|
-
r = adjust(r, percent);
|
|
931
|
-
g = adjust(g, percent);
|
|
932
|
-
b = adjust(b, percent);
|
|
933
|
-
const toHex = (value) => {
|
|
934
|
-
const hex = value.toString(16).padStart(2, '0');
|
|
935
|
-
return hex;
|
|
936
|
-
};
|
|
937
|
-
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
938
|
-
}
|
|
939
|
-
function getHtmlImgDisplayString64(base64String) {
|
|
940
|
-
if (base64String == null)
|
|
941
|
-
return null;
|
|
942
|
-
const [header, base64Content] = base64String.split(';base64,');
|
|
943
|
-
const fileName = header.split('=')[1];
|
|
944
|
-
const mimeType = getMimeTypeForFileName(fileName);
|
|
945
|
-
return `data:${mimeType};base64, ${base64Content}`;
|
|
946
|
-
}
|
|
947
|
-
function nameof(key1, key2) {
|
|
948
|
-
return key2 ?? key1;
|
|
949
|
-
}
|
|
950
|
-
function nameOf(funcOrClass) {
|
|
951
|
-
return funcOrClass.name;
|
|
952
|
-
}
|
|
953
|
-
function getParentUrl(currentUrl) {
|
|
954
|
-
const urlSegments = currentUrl.split('/');
|
|
955
|
-
urlSegments.pop();
|
|
956
|
-
const parentUrl = urlSegments.join('/');
|
|
957
|
-
return parentUrl;
|
|
958
|
-
}
|
|
959
|
-
// export function getMonth(number: number): string {
|
|
960
|
-
// const months: string[] = [
|
|
961
|
-
// "January", "February", "March", "April", "May", "June",
|
|
962
|
-
// "July", "August", "September", "October", "November", "December"
|
|
963
|
-
// ];
|
|
964
|
-
// if (number < 1 || number > 12) {
|
|
965
|
-
// throw new Error("Invalid month number. It should be between 1 and 12.");
|
|
966
|
-
// }
|
|
967
|
-
// return months[number - 1];
|
|
968
|
-
// }
|
|
969
|
-
function getMonth(numberOfTheMonth) {
|
|
970
|
-
const meseci = [
|
|
971
|
-
'Januar',
|
|
972
|
-
'Februar',
|
|
973
|
-
'Mart',
|
|
974
|
-
'April',
|
|
975
|
-
'Maj',
|
|
976
|
-
'Jun',
|
|
977
|
-
'Jul',
|
|
978
|
-
'Avgust',
|
|
979
|
-
'Septembar',
|
|
980
|
-
'Oktobar',
|
|
981
|
-
'Novembar',
|
|
982
|
-
'Decembar',
|
|
983
|
-
];
|
|
984
|
-
if (numberOfTheMonth < 1 || numberOfTheMonth > 12) {
|
|
985
|
-
console.error('Nevažeći broj meseca. Broj treba biti između 1 i 12.');
|
|
986
|
-
}
|
|
987
|
-
return meseci[numberOfTheMonth - 1];
|
|
988
|
-
}
|
|
989
|
-
function singleOrDefault(array, predicate) {
|
|
990
|
-
const filtered = array.filter(predicate);
|
|
991
|
-
if (filtered.length > 1) {
|
|
992
|
-
throw new Error('Sequence contains more than one matching element.');
|
|
993
|
-
}
|
|
994
|
-
return filtered[0];
|
|
995
|
-
}
|
|
996
|
-
function pushAction(cols, action) {
|
|
997
|
-
const actionsColumn = singleOrDefault(cols, (x) => x.actions != null);
|
|
998
|
-
if (actionsColumn) {
|
|
999
|
-
actionsColumn.actions = [...actionsColumn.actions, action];
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
function deleteAction(cols, actionField) {
|
|
1003
|
-
const actionsColumn = singleOrDefault(cols, (x) => x.actions != null);
|
|
1004
|
-
if (actionsColumn && actionsColumn.actions) {
|
|
1005
|
-
const index = actionsColumn.actions.findIndex((a) => a.field === actionField);
|
|
1006
|
-
if (index !== -1) {
|
|
1007
|
-
actionsColumn.actions.splice(index, 1);
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
}
|
|
1011
|
-
function getFileNameFromContentDisposition(resp, defaultName) {
|
|
1012
|
-
let fileName;
|
|
1013
|
-
if (resp && resp.headers && resp.headers.get('Content-Disposition')) {
|
|
1014
|
-
let val = resp.headers.get('Content-Disposition');
|
|
1015
|
-
let start = val.indexOf('filename=');
|
|
1016
|
-
if (start != -1) {
|
|
1017
|
-
let end = val.indexOf(';', start);
|
|
1018
|
-
fileName =
|
|
1019
|
-
end != -1 ? val.substring(start + 9, end) : val.substring(start + 9);
|
|
1020
|
-
fileName = fileName.split('"').join('');
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
return fileName ?? defaultName;
|
|
1024
|
-
}
|
|
1025
|
-
function toCommaSeparatedString(input) {
|
|
1026
|
-
const stringList = input.map((item) => item?.toString() ?? '');
|
|
1027
|
-
if (stringList.length > 1) {
|
|
1028
|
-
return `${stringList.slice(0, -1).join(', ')} and ${stringList[stringList.length - 1]}`;
|
|
1029
|
-
}
|
|
1030
|
-
else {
|
|
1031
|
-
return stringList[0] ?? '';
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
function isFileImageType(mimeType) {
|
|
1035
|
-
if (mimeType.startsWith('image/')) {
|
|
1036
|
-
return true;
|
|
1037
|
-
}
|
|
1038
|
-
return false;
|
|
1039
|
-
}
|
|
1040
|
-
function isExcelFileType(mimeType) {
|
|
1041
|
-
if (mimeType ===
|
|
1042
|
-
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ||
|
|
1043
|
-
mimeType === 'application/vnd.ms-excel') {
|
|
1044
|
-
return true;
|
|
1045
|
-
}
|
|
1046
|
-
return false;
|
|
1047
|
-
}
|
|
1048
|
-
function exportListToExcel(exportListToExcelObservableMethod, filter) {
|
|
1049
|
-
exportListToExcelObservableMethod(filter).subscribe((res) => {
|
|
1050
|
-
let fileName = getFileNameFromContentDisposition(res, 'ExcelExport.xlsx');
|
|
1051
|
-
FileSaver.saveAs(res.body, decodeURIComponent(fileName));
|
|
1052
|
-
});
|
|
1053
|
-
}
|
|
1054
|
-
function getPrimengDropdownNamebookOptions(getDropdownListObservable, parentEntityId) {
|
|
1055
|
-
return getDropdownListObservable(parentEntityId ?? 0).pipe(map((res) => {
|
|
1056
|
-
return res.map((x) => ({ label: x.displayName, code: x.id }));
|
|
1057
|
-
}));
|
|
1058
|
-
}
|
|
1059
|
-
function getPrimengDropdownCodebookOptions(getDropdownListObservable) {
|
|
1060
|
-
return getDropdownListObservable().pipe(map((res) => {
|
|
1061
|
-
return res.map((x) => ({ label: x.displayName, code: x.code }));
|
|
1062
|
-
}));
|
|
1063
|
-
}
|
|
1064
|
-
function getPrimengAutocompleteNamebookOptions(getAutocompleteListObservable, limit, query, parentEntityId) {
|
|
1065
|
-
return getAutocompleteListObservable(limit, query, parentEntityId ?? 0).pipe(map((res) => {
|
|
1066
|
-
return res.map((x) => ({ label: x.displayName, code: x.id }));
|
|
1067
|
-
}));
|
|
1068
|
-
}
|
|
1069
|
-
function getPrimengAutocompleteCodebookOptions(getAutocompleteListObservable, limit, query) {
|
|
1070
|
-
return getAutocompleteListObservable(limit, query).pipe(map((res) => {
|
|
1071
|
-
return res.map((x) => ({ label: x.displayName, code: x.code }));
|
|
1072
|
-
}));
|
|
1073
|
-
}
|
|
1074
|
-
const isNullOrEmpty = (input) => {
|
|
1075
|
-
if (input == null || input === '') {
|
|
1076
|
-
return true;
|
|
1077
|
-
}
|
|
1078
|
-
return false;
|
|
1079
|
-
};
|
|
1080
|
-
const selectedTab = (tabs) => {
|
|
1081
|
-
const tab = singleOrDefault(tabs, (x) => x.isSelected);
|
|
1082
|
-
if (tab) {
|
|
1083
|
-
return tab.id;
|
|
1084
|
-
}
|
|
1085
|
-
else {
|
|
1086
|
-
return null;
|
|
1087
|
-
}
|
|
1088
|
-
};
|
|
1089
|
-
function firstCharToUpper(input) {
|
|
1090
|
-
return input.charAt(0).toUpperCase() + input.slice(1);
|
|
1091
|
-
}
|
|
1092
|
-
function splitPascalCase(input) {
|
|
1093
|
-
const regex = /($[a-z])|[A-Z][^A-Z]+/g;
|
|
1094
|
-
return input.match(regex).join(' ');
|
|
1095
|
-
}
|
|
1096
|
-
function capitalizeFirstChar(str) {
|
|
1097
|
-
if (!str)
|
|
1098
|
-
return str;
|
|
1099
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
1100
|
-
}
|
|
1101
|
-
function kebabToTitleCase(input) {
|
|
1102
|
-
return input
|
|
1103
|
-
.split('-')
|
|
1104
|
-
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
1105
|
-
.join(' ');
|
|
1106
|
-
}
|
|
1107
|
-
/**
|
|
1108
|
-
* Custom styling of the google button - https://medium.com/simform-engineering/implement-custom-google-sign-in-using-angular-16-9c93aeff6252
|
|
1109
|
-
*/
|
|
1110
|
-
function createFakeGoogleWrapper() {
|
|
1111
|
-
const googleLoginWrapper = document.createElement('div');
|
|
1112
|
-
googleLoginWrapper.style.display = 'none';
|
|
1113
|
-
googleLoginWrapper.classList.add('custom-google-button');
|
|
1114
|
-
document.body.appendChild(googleLoginWrapper);
|
|
1115
|
-
window.google.accounts.id.renderButton(googleLoginWrapper, {
|
|
1116
|
-
type: 'icon',
|
|
1117
|
-
width: '200',
|
|
1118
|
-
});
|
|
1119
|
-
const googleLoginWrapperButton = googleLoginWrapper.querySelector('div[role=button]');
|
|
1120
|
-
return {
|
|
1121
|
-
click: () => {
|
|
1122
|
-
googleLoginWrapperButton?.click();
|
|
1123
|
-
},
|
|
1124
|
-
};
|
|
1125
|
-
}
|
|
1126
|
-
const PROPS_KEY = Symbol('props');
|
|
1127
|
-
function ReflectProp(target, propertyKey) {
|
|
1128
|
-
const props = Reflect.getMetadata(PROPS_KEY, target) || [];
|
|
1129
|
-
Reflect.defineMetadata(PROPS_KEY, [...props, propertyKey], target);
|
|
1130
|
-
}
|
|
1131
|
-
const primitiveArrayTypes = [
|
|
1132
|
-
'Namebook[]',
|
|
1133
|
-
'number[]',
|
|
1134
|
-
'Date[]',
|
|
1135
|
-
'string[]',
|
|
1136
|
-
];
|
|
1137
|
-
function getImageDimensions(file) {
|
|
1138
|
-
return new Promise((resolve) => {
|
|
1139
|
-
const img = new Image();
|
|
1140
|
-
img.onload = () => {
|
|
1141
|
-
resolve({ width: img.width, height: img.height });
|
|
1142
|
-
URL.revokeObjectURL(img.src);
|
|
1143
|
-
};
|
|
1144
|
-
img.src = URL.createObjectURL(file);
|
|
1145
|
-
});
|
|
1146
|
-
}
|
|
1147
|
-
|
|
1148
1254
|
class SpiderlyMessageService {
|
|
1149
1255
|
// TODO FT: nece da prikaze poruku ako je neki angular error koji se dogodi tek nakon api poziva
|
|
1150
1256
|
constructor(messageService, translocoService, ngZone) {
|
|
@@ -3994,8 +4100,9 @@ class SpiderlyDataTableComponent {
|
|
|
3994
4100
|
return null;
|
|
3995
4101
|
if (col.showTime)
|
|
3996
4102
|
return formatDate(rowData[col.field], 'short', this.locale);
|
|
3997
|
-
|
|
3998
|
-
|
|
4103
|
+
const raw = rowData[col.field];
|
|
4104
|
+
const local = typeof raw === 'string' ? parseDateOnlyLocal(raw) : null;
|
|
4105
|
+
return formatDate(local ?? raw, 'shortDate', this.locale);
|
|
3999
4106
|
case 'multiselect':
|
|
4000
4107
|
return rowData[col.field];
|
|
4001
4108
|
case 'boolean':
|
|
@@ -4921,5 +5028,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
4921
5028
|
* Generated bundle index. Do not edit.
|
|
4922
5029
|
*/
|
|
4923
5030
|
|
|
4924
|
-
export { Action, AllClickEvent, ApiErrorCodes, ApiSecurityService, AppSidebarComponent, AuthGuard, AuthResult, AuthResultWithCookies, AuthServiceBase, BaseAutocompleteControl, BaseControl, BaseDropdownControl, BaseEntity, BaseFormComponent, BaseFormService, CardSkeletonComponent, Codebook, Column, ConfigServiceBase, ExternalProvider, Filter, FilterRule, FilterSortMeta, FooterComponent, GoogleButtonComponent, IndexCardComponent, InfoCardComponent, InitCompanyAuthDialogDetails, InitTopBarData, IsAuthorizedForSaveEvent, LastMenuIconIndexClicked, LayoutServiceBase, LazyLoadSelectedIdsResult, Login, LoginComponent, LoginVerificationComponent, LoginVerificationToken, MatchModeCodes, MenuChangeEvent, MenuitemComponent, Namebook, NotAuthGuard, NotFoundComponent, PROPS_KEY, PaginatedResult, PanelBodyComponent, PanelFooterComponent, PanelHeaderComponent, PrimengOption, ProfileAvatarComponent, ReflectProp, RefreshTokenRequest, RequiredComponent, RowClickEvent, SecurityPermissionCodes, SendLoginVerificationEmailResult, SideMenuTopBarComponent, SidebarMenuComponent, SimpleSaveResult, SpiderlyAutocompleteComponent, SpiderlyButtonBaseComponent, SpiderlyButtonComponent, SpiderlyCalendarComponent, SpiderlyCardComponent, SpiderlyCheckboxComponent, SpiderlyColorPickerComponent, SpiderlyControlsModule, SpiderlyDataTableComponent, SpiderlyDataViewComponent, SpiderlyDeleteConfirmationComponent, SpiderlyDropdownComponent, SpiderlyEditorComponent, SpiderlyErrorHandler, SpiderlyFileComponent, SpiderlyFileSelectEvent, SpiderlyFormArray, SpiderlyFormControl, SpiderlyFormGroup, SpiderlyLayoutComponent, SpiderlyMessageService, SpiderlyMultiAutocompleteComponent, SpiderlyMultiSelectComponent, SpiderlyNumberComponent, SpiderlyPanelComponent, SpiderlyPanelsModule, SpiderlyPasswordComponent, SpiderlyReturnButtonComponent, SpiderlySplitButtonComponent, SpiderlyTab, SpiderlyTemplateTypeDirective, SpiderlyTextareaComponent, SpiderlyTextboxComponent, SpiderlyTranslocoLoader, TopBarComponent, UserBase, UserRole, ValidatorAbstractService, VerificationTokenRequest, VerificationTypeCodes, VerificationWrapperComponent, adjustColor, authInitializer, capitalizeFirstChar, createFakeGoogleWrapper, deleteAction, exportListToExcel, firstCharToUpper, getFileNameFromContentDisposition, getHtmlImgDisplayString64, getImageDimensions, getMimeTypeForFileName, getMonth, getParentUrl, getPrimengAutocompleteCodebookOptions, getPrimengAutocompleteNamebookOptions, getPrimengDropdownCodebookOptions, getPrimengDropdownNamebookOptions, httpLoadingInterceptor, isExcelFileType, isFileImageType, isNullOrEmpty, jsonHttpInterceptor, jwtInterceptor, kebabToTitleCase, nameOf, nameof, primitiveArrayTypes, pushAction, selectedTab, singleOrDefault, splitPascalCase, toCommaSeparatedString, unauthorizedInterceptor, validatePrecisionScale };
|
|
5031
|
+
export { Action, AllClickEvent, ApiErrorCodes, ApiSecurityService, AppSidebarComponent, AuthGuard, AuthResult, AuthResultWithCookies, AuthServiceBase, BaseAutocompleteControl, BaseControl, BaseDropdownControl, BaseEntity, BaseFormComponent, BaseFormService, CardSkeletonComponent, Codebook, Column, ConfigServiceBase, ExternalProvider, Filter, FilterRule, FilterSortMeta, FooterComponent, GoogleButtonComponent, IndexCardComponent, InfoCardComponent, InitCompanyAuthDialogDetails, InitTopBarData, IsAuthorizedForSaveEvent, LastMenuIconIndexClicked, LayoutServiceBase, LazyLoadSelectedIdsResult, Login, LoginComponent, LoginVerificationComponent, LoginVerificationToken, MatchModeCodes, MenuChangeEvent, MenuitemComponent, Namebook, NotAuthGuard, NotFoundComponent, PROPS_KEY, PaginatedResult, PanelBodyComponent, PanelFooterComponent, PanelHeaderComponent, PrimengOption, ProfileAvatarComponent, ReflectProp, RefreshTokenRequest, RequiredComponent, RowClickEvent, SecurityPermissionCodes, SendLoginVerificationEmailResult, SideMenuTopBarComponent, SidebarMenuComponent, SimpleSaveResult, SpiderlyAutocompleteComponent, SpiderlyButtonBaseComponent, SpiderlyButtonComponent, SpiderlyCalendarComponent, SpiderlyCardComponent, SpiderlyCheckboxComponent, SpiderlyColorPickerComponent, SpiderlyControlsModule, SpiderlyDataTableComponent, SpiderlyDataViewComponent, SpiderlyDeleteConfirmationComponent, SpiderlyDropdownComponent, SpiderlyEditorComponent, SpiderlyErrorHandler, SpiderlyFileComponent, SpiderlyFileSelectEvent, SpiderlyFormArray, SpiderlyFormControl, SpiderlyFormGroup, SpiderlyLayoutComponent, SpiderlyMessageService, SpiderlyMultiAutocompleteComponent, SpiderlyMultiSelectComponent, SpiderlyNumberComponent, SpiderlyPanelComponent, SpiderlyPanelsModule, SpiderlyPasswordComponent, SpiderlyReturnButtonComponent, SpiderlySplitButtonComponent, SpiderlyTab, SpiderlyTemplateTypeDirective, SpiderlyTextareaComponent, SpiderlyTextboxComponent, SpiderlyTranslocoLoader, TopBarComponent, UserBase, UserRole, ValidatorAbstractService, VerificationTokenRequest, VerificationTypeCodes, VerificationWrapperComponent, adjustColor, authInitializer, capitalizeFirstChar, createFakeGoogleWrapper, deleteAction, exportListToExcel, firstCharToUpper, getFileNameFromContentDisposition, getHtmlImgDisplayString64, getImageDimensions, getMimeTypeForFileName, getMonth, getParentUrl, getPrimengAutocompleteCodebookOptions, getPrimengAutocompleteNamebookOptions, getPrimengDropdownCodebookOptions, getPrimengDropdownNamebookOptions, httpLoadingInterceptor, isExcelFileType, isFileImageType, isNullOrEmpty, jsonHttpInterceptor, jwtInterceptor, kebabToTitleCase, nameOf, nameof, parseDateOnlyLocal, primitiveArrayTypes, pushAction, selectedTab, singleOrDefault, splitPascalCase, toCommaSeparatedString, unauthorizedInterceptor, validatePrecisionScale };
|
|
4925
5032
|
//# sourceMappingURL=spiderly.mjs.map
|