@n-isi-platform/design-system 1.0.31 → 1.0.32
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.
|
@@ -1003,6 +1003,62 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImpor
|
|
|
1003
1003
|
type: Output
|
|
1004
1004
|
}] } });
|
|
1005
1005
|
|
|
1006
|
+
class KameraComponent {
|
|
1007
|
+
sanitizer;
|
|
1008
|
+
video;
|
|
1009
|
+
photoCaptured = new EventEmitter();
|
|
1010
|
+
safeImageUrl;
|
|
1011
|
+
constructor(sanitizer) {
|
|
1012
|
+
this.sanitizer = sanitizer;
|
|
1013
|
+
}
|
|
1014
|
+
async ngAfterViewInit() {
|
|
1015
|
+
try {
|
|
1016
|
+
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
1017
|
+
const videoDevices = devices.filter(device => device.kind === 'videoinput');
|
|
1018
|
+
let constraints;
|
|
1019
|
+
if (videoDevices.length > 1) {
|
|
1020
|
+
const backCameraId = videoDevices[videoDevices.length - 1].deviceId;
|
|
1021
|
+
constraints = { video: { deviceId: { exact: backCameraId } } };
|
|
1022
|
+
}
|
|
1023
|
+
else {
|
|
1024
|
+
constraints = { video: true };
|
|
1025
|
+
}
|
|
1026
|
+
const stream = await navigator.mediaDevices.getUserMedia(constraints);
|
|
1027
|
+
this.video.nativeElement.srcObject = stream;
|
|
1028
|
+
}
|
|
1029
|
+
catch (err) {
|
|
1030
|
+
console.warn('Zunanja kamera ni na voljo. Uporabljam privzeto.', err);
|
|
1031
|
+
const fallbackStream = await navigator.mediaDevices.getUserMedia({ video: true });
|
|
1032
|
+
this.video.nativeElement.srcObject = fallbackStream;
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
ngOnDestroy() {
|
|
1036
|
+
const stream = this.video?.nativeElement?.srcObject;
|
|
1037
|
+
stream?.getTracks().forEach(track => track.stop());
|
|
1038
|
+
}
|
|
1039
|
+
async captureAndEmitPhoto() {
|
|
1040
|
+
const canvas = document.createElement('canvas');
|
|
1041
|
+
canvas.width = this.video.nativeElement.videoWidth;
|
|
1042
|
+
canvas.height = this.video.nativeElement.videoHeight;
|
|
1043
|
+
const ctx = canvas.getContext('2d');
|
|
1044
|
+
ctx?.drawImage(this.video.nativeElement, 0, 0);
|
|
1045
|
+
const base64 = canvas.toDataURL('image/jpeg', 0.9);
|
|
1046
|
+
this.safeImageUrl = this.sanitizer.bypassSecurityTrustUrl(base64);
|
|
1047
|
+
this.photoCaptured.emit(base64);
|
|
1048
|
+
}
|
|
1049
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: KameraComponent, deps: [{ token: i1$5.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
|
|
1050
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: KameraComponent, isStandalone: true, selector: "app-kamera", outputs: { photoCaptured: "photoCaptured" }, viewQueries: [{ propertyName: "video", first: true, predicate: ["video"], descendants: true }], ngImport: i0, template: "<div class=\"camera-container\">\r\n <video #video autoplay playsinline></video>\r\n\r\n <lib-button [label]=\"'Zajemi sliko'\"(click)=\"captureAndEmitPhoto()\">Zajemi fotografijo</lib-button>\r\n</div>\r\n", styles: [".camera-container{display:flex;flex-direction:column;align-items:center}.camera-container video{width:100%;min-height:220px;background:#222}button{margin-top:.5rem}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "lib-button", inputs: ["hasIcon", "label", "color", "icon", "iconPos", "disabled", "isLoading", "styleClass", "size", "accessibilityText", "buttonType", "isAccessible", "isSelected", "ariaControlsId", "isExpanded", "link", "isTextareaClear"], outputs: ["clickEvent"] }] });
|
|
1051
|
+
}
|
|
1052
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: KameraComponent, decorators: [{
|
|
1053
|
+
type: Component,
|
|
1054
|
+
args: [{ selector: 'app-kamera', standalone: true, imports: [ButtonComponent], template: "<div class=\"camera-container\">\r\n <video #video autoplay playsinline></video>\r\n\r\n <lib-button [label]=\"'Zajemi sliko'\"(click)=\"captureAndEmitPhoto()\">Zajemi fotografijo</lib-button>\r\n</div>\r\n", styles: [".camera-container{display:flex;flex-direction:column;align-items:center}.camera-container video{width:100%;min-height:220px;background:#222}button{margin-top:.5rem}\n"] }]
|
|
1055
|
+
}], ctorParameters: () => [{ type: i1$5.DomSanitizer }], propDecorators: { video: [{
|
|
1056
|
+
type: ViewChild,
|
|
1057
|
+
args: ['video']
|
|
1058
|
+
}], photoCaptured: [{
|
|
1059
|
+
type: Output
|
|
1060
|
+
}] } });
|
|
1061
|
+
|
|
1006
1062
|
class BreadcrumbsComponent {
|
|
1007
1063
|
itemList = [];
|
|
1008
1064
|
homeItem = {};
|
|
@@ -2718,62 +2774,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImpor
|
|
|
2718
2774
|
type: Input
|
|
2719
2775
|
}] } });
|
|
2720
2776
|
|
|
2721
|
-
class KameraComponent {
|
|
2722
|
-
sanitizer;
|
|
2723
|
-
video;
|
|
2724
|
-
photoCaptured = new EventEmitter();
|
|
2725
|
-
safeImageUrl;
|
|
2726
|
-
constructor(sanitizer) {
|
|
2727
|
-
this.sanitizer = sanitizer;
|
|
2728
|
-
}
|
|
2729
|
-
async ngAfterViewInit() {
|
|
2730
|
-
try {
|
|
2731
|
-
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
2732
|
-
const videoDevices = devices.filter(device => device.kind === 'videoinput');
|
|
2733
|
-
let constraints;
|
|
2734
|
-
if (videoDevices.length > 1) {
|
|
2735
|
-
const backCameraId = videoDevices[videoDevices.length - 1].deviceId;
|
|
2736
|
-
constraints = { video: { deviceId: { exact: backCameraId } } };
|
|
2737
|
-
}
|
|
2738
|
-
else {
|
|
2739
|
-
constraints = { video: true };
|
|
2740
|
-
}
|
|
2741
|
-
const stream = await navigator.mediaDevices.getUserMedia(constraints);
|
|
2742
|
-
this.video.nativeElement.srcObject = stream;
|
|
2743
|
-
}
|
|
2744
|
-
catch (err) {
|
|
2745
|
-
console.warn('Zunanja kamera ni na voljo. Uporabljam privzeto.', err);
|
|
2746
|
-
const fallbackStream = await navigator.mediaDevices.getUserMedia({ video: true });
|
|
2747
|
-
this.video.nativeElement.srcObject = fallbackStream;
|
|
2748
|
-
}
|
|
2749
|
-
}
|
|
2750
|
-
ngOnDestroy() {
|
|
2751
|
-
const stream = this.video?.nativeElement?.srcObject;
|
|
2752
|
-
stream?.getTracks().forEach(track => track.stop());
|
|
2753
|
-
}
|
|
2754
|
-
async captureAndEmitPhoto() {
|
|
2755
|
-
const canvas = document.createElement('canvas');
|
|
2756
|
-
canvas.width = this.video.nativeElement.videoWidth;
|
|
2757
|
-
canvas.height = this.video.nativeElement.videoHeight;
|
|
2758
|
-
const ctx = canvas.getContext('2d');
|
|
2759
|
-
ctx?.drawImage(this.video.nativeElement, 0, 0);
|
|
2760
|
-
const base64 = canvas.toDataURL('image/jpeg', 0.9);
|
|
2761
|
-
this.safeImageUrl = this.sanitizer.bypassSecurityTrustUrl(base64);
|
|
2762
|
-
this.photoCaptured.emit(base64);
|
|
2763
|
-
}
|
|
2764
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: KameraComponent, deps: [{ token: i1$5.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
|
|
2765
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: KameraComponent, isStandalone: true, selector: "app-kamera", outputs: { photoCaptured: "photoCaptured" }, viewQueries: [{ propertyName: "video", first: true, predicate: ["video"], descendants: true }], ngImport: i0, template: "<div class=\"camera-container\">\r\n <video #video autoplay playsinline></video>\r\n\r\n <lib-button [label]=\"'Zajemi sliko'\"(click)=\"captureAndEmitPhoto()\">Zajemi fotografijo</lib-button>\r\n</div>\r\n", styles: [".camera-container{display:flex;flex-direction:column;align-items:center}.camera-container video{width:100%;min-height:220px;background:#222}button{margin-top:.5rem}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "lib-button", inputs: ["hasIcon", "label", "color", "icon", "iconPos", "disabled", "isLoading", "styleClass", "size", "accessibilityText", "buttonType", "isAccessible", "isSelected", "ariaControlsId", "isExpanded", "link", "isTextareaClear"], outputs: ["clickEvent"] }] });
|
|
2766
|
-
}
|
|
2767
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: KameraComponent, decorators: [{
|
|
2768
|
-
type: Component,
|
|
2769
|
-
args: [{ selector: 'app-kamera', standalone: true, imports: [ButtonComponent], template: "<div class=\"camera-container\">\r\n <video #video autoplay playsinline></video>\r\n\r\n <lib-button [label]=\"'Zajemi sliko'\"(click)=\"captureAndEmitPhoto()\">Zajemi fotografijo</lib-button>\r\n</div>\r\n", styles: [".camera-container{display:flex;flex-direction:column;align-items:center}.camera-container video{width:100%;min-height:220px;background:#222}button{margin-top:.5rem}\n"] }]
|
|
2770
|
-
}], ctorParameters: () => [{ type: i1$5.DomSanitizer }], propDecorators: { video: [{
|
|
2771
|
-
type: ViewChild,
|
|
2772
|
-
args: ['video']
|
|
2773
|
-
}], photoCaptured: [{
|
|
2774
|
-
type: Output
|
|
2775
|
-
}] } });
|
|
2776
|
-
|
|
2777
2777
|
class FileUploadComponent {
|
|
2778
2778
|
config;
|
|
2779
2779
|
sharedMessageService;
|
|
@@ -4271,5 +4271,5 @@ function emailListValidator() {
|
|
|
4271
4271
|
* Generated bundle index. Do not edit.
|
|
4272
4272
|
*/
|
|
4273
4273
|
|
|
4274
|
-
export { AccordionComponent, AppConfigService, AutocompleteComponent, BreadcrumbsComponent, ButtonColor, ButtonComponent, ButtonIconPosition, ButtonLinkComponent, ButtonSize, CacheService, CaptionColor, CardComponent, CheckboxComponent, ConfirmModalComponent, ConfirmModalService, CustomTableComponent, DateInputComponent, DateService, DialogColor, DividerComponent, DropdownComponent, DynamicRouteService, ErrorComponent, ErrorInterceptor, ExpandedTable, ExpandedTableComponent, ExportService, FileUploadComponent, FilterHeaderComponent, FilterHeaderService, FooterComponent, GenericTableComponent, GlobalErrorHandler, IconButtonComponent, InputComponent, InputMaskComponent, InputType, IsNotBlank, IsNotDecimal, LoaderComponent, LocalStorageService, MainMenuComponent, ModalComponent, NoDataFoundComponent, NoInternetService, PicklistComponent, PositionKey, ProgressBarComponent, SelectionMode, SharedAuthService, SharedMessageService, TableColumnSelectComponent, TableColumnsService, TagColor, TagComponent, TextareaComponent, TinymceEditorComponent, ToastSeverity, ToggleSwitchComponent, TooltipComponent, TooltipHoverEventEnum, TooltipPosition, TranslateSanitizerService, TranslationService, TreeSelectComponent, atLeastOneFieldPresentValidator, cleanMobilePhoneNumber, coordinateValidator, dateAndTimeMismatchValidator, dateMismatchValidator, emailListValidator, findUnavailableDates, formatDate, formatDateTime, formatDateToLocalISOString, getTomorrowDate, isEmpty, isFormInvalid, isMultipleOfFiveValidator, isOnePhoneNumberValidator, localFormatDate, mobilePhoneAreaCodeValidator, transformDateTime };
|
|
4274
|
+
export { AccordionComponent, AppConfigService, AutocompleteComponent, BreadcrumbsComponent, ButtonColor, ButtonComponent, ButtonIconPosition, ButtonLinkComponent, ButtonSize, CacheService, CaptionColor, CardComponent, CheckboxComponent, ConfirmModalComponent, ConfirmModalService, CustomTableComponent, DateInputComponent, DateService, DialogColor, DividerComponent, DropdownComponent, DynamicRouteService, ErrorComponent, ErrorInterceptor, ExpandedTable, ExpandedTableComponent, ExportService, FileUploadComponent, FilterHeaderComponent, FilterHeaderService, FooterComponent, GenericTableComponent, GlobalErrorHandler, IconButtonComponent, InputComponent, InputMaskComponent, InputType, IsNotBlank, IsNotDecimal, KameraComponent, LoaderComponent, LocalStorageService, MainMenuComponent, ModalComponent, NoDataFoundComponent, NoInternetService, PicklistComponent, PositionKey, ProgressBarComponent, SelectionMode, SharedAuthService, SharedMessageService, TableColumnSelectComponent, TableColumnsService, TagColor, TagComponent, TextareaComponent, TinymceEditorComponent, ToastSeverity, ToggleSwitchComponent, TooltipComponent, TooltipHoverEventEnum, TooltipPosition, TranslateSanitizerService, TranslationService, TreeSelectComponent, atLeastOneFieldPresentValidator, cleanMobilePhoneNumber, coordinateValidator, dateAndTimeMismatchValidator, dateMismatchValidator, emailListValidator, findUnavailableDates, formatDate, formatDateTime, formatDateToLocalISOString, getTomorrowDate, isEmpty, isFormInvalid, isMultipleOfFiveValidator, isOnePhoneNumberValidator, localFormatDate, mobilePhoneAreaCodeValidator, transformDateTime };
|
|
4275
4275
|
//# sourceMappingURL=n-isi-platform-design-system.mjs.map
|