barsa-sap-ui 1.0.346 → 1.0.348
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/esm2020/lib/barsa-tinyemce/barsa-tinyemce.component.mjs +43 -10
- package/esm2020/lib/layout-control/layout-control.component.mjs +3 -1
- package/esm2020/lib/ui-radio-group/ui-radio-group.component.mjs +7 -2
- package/fesm2015/barsa-sap-ui.mjs +47 -13
- package/fesm2015/barsa-sap-ui.mjs.map +1 -1
- package/fesm2020/barsa-sap-ui.mjs +50 -13
- package/fesm2020/barsa-sap-ui.mjs.map +1 -1
- package/lib/barsa-tinyemce/barsa-tinyemce.component.d.ts +8 -2
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Component, ChangeDetectionStrategy, Input, ElementRef, ViewChild, HostBinding, EventEmitter, Output, ViewEncapsulation, ViewChildren, Inject, Optional, Self, TemplateRef, HostListener, Pipe, Directive, ViewContainerRef, SkipSelf, NgModule, Injectable, APP_INITIALIZER, NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
3
3
|
import * as i2 from 'barsa-novin-ray-core';
|
|
4
|
-
import { BaseComponent, ReportViewBaseComponent, getUniqueId, BarsaApi, LayoutItemBaseComponent, getDeviceIsMobile, LayoutService, BaseUlvSettingComponent, FormComponent, createFormPanelMetaConditions, ReportBaseComponent, GetAllColumnsSorted, measureText, getParentHeight, getControlSizeMode, getGridSettings, FieldBaseComponent, DateService, getDateService as getDateService$1, DateMiladiService, DateHijriService, DateShamsiService, BaseDirective, EllipsifyDirective, createGridEditorFormPanel, FormPanelService, BaseViewItemPropsComponent, isImage, getIcon, LayoutPanelBaseComponent, BaseViewContentPropsComponent, enumValueToStringSize, PreventDefaulEvent, BaseColumnPropsComponent, ColumnService, DateRanges, LogService, UlvMainService, isFunction, FilesValidationHelper, getValidExtension, getImagePath,
|
|
4
|
+
import { BaseComponent, ReportViewBaseComponent, getUniqueId, BarsaApi, LayoutItemBaseComponent, getDeviceIsMobile, LayoutService, BaseUlvSettingComponent, FormComponent, createFormPanelMetaConditions, ReportBaseComponent, GetAllColumnsSorted, measureText, getParentHeight, getControlSizeMode, getGridSettings, FieldBaseComponent, DateService, getDateService as getDateService$1, DateMiladiService, DateHijriService, DateShamsiService, BaseDirective, EllipsifyDirective, createGridEditorFormPanel, FormPanelService, BaseViewItemPropsComponent, isImage, getIcon, LayoutPanelBaseComponent, BaseViewContentPropsComponent, enumValueToStringSize, PreventDefaulEvent, BaseColumnPropsComponent, ColumnService, DateRanges, LogService, UlvMainService, isFunction, UploadService, FilesValidationHelper, getValidExtension, getImagePath, LinearListHelper, FormToolbarBaseComponent, isFirefox, FormBaseComponent, PageWithFormHandlerBaseComponent, getHeaderValue, getFieldValue, ContainerComponent, FORM_DIALOG_COMPONENT, ContainerService, FormPropsBaseComponent, NumberBaseComponent, ImageMimeType, BaseFormToolbaritemPropsComponent, executeUlvCommandHandler, getDeviceIsPhone, getDeviceIsTablet, PortalService, NOTIFICATAION_POPUP_SERVER, TOAST_SERVICE, BaseModule, BarsaNovinRayCoreModule, DIALOG_SERVICE } from 'barsa-novin-ray-core';
|
|
5
5
|
import moment from 'moment';
|
|
6
6
|
import jmoment from 'moment-jalaali';
|
|
7
|
-
import { merge, of, BehaviorSubject, Subject, combineLatest, takeUntil as takeUntil$1, fromEvent, filter as filter$1 } from 'rxjs';
|
|
8
|
-
import { tap, filter, map, debounceTime, distinctUntilChanged, withLatestFrom, takeUntil, exhaustMap, finalize, switchMap, delay, concatMap, catchError } from 'rxjs/operators';
|
|
7
|
+
import { merge, of, BehaviorSubject, Subject, combineLatest, takeUntil as takeUntil$1, concatMap, tap as tap$1, fromEvent, filter as filter$1 } from 'rxjs';
|
|
8
|
+
import { tap, filter, map, debounceTime, distinctUntilChanged, withLatestFrom, takeUntil, exhaustMap, finalize, switchMap, delay, concatMap as concatMap$1, catchError } from 'rxjs/operators';
|
|
9
9
|
import * as i1$1 from '@fundamental-ngx/core';
|
|
10
10
|
import { TableComponent, ToolbarComponent, RadioButtonComponent, DynamicPageComponent, FileUploaderComponent, MultiInputComponent, TabPanelComponent, WizardComponent, WizardStepComponent, ComboboxComponent, InlineHelpDirective, ContentDensityMode, GlobalContentDensityService, ThemesService, NotificationRef, RtlService, MessageToastService, FundamentalNgxCoreModule, FacetModule, WizardModule, PipeModule, DialogService, ContentDensityModule } from '@fundamental-ngx/core';
|
|
11
11
|
import { SortDirection, TableDataProvider, SelectionMode, FundamentalNgxPlatformModule, PlatformDynamicPageModule, PlatformTextAreaModule, PlatformSearchFieldModule } from '@fundamental-ngx/platform';
|
|
@@ -345,7 +345,9 @@ class LayoutControlComponent extends LayoutItemBaseComponent {
|
|
|
345
345
|
/* eslint-disable */
|
|
346
346
|
this.SetVisible = (visible, refresh) => {
|
|
347
347
|
this._ngZone.run(() => {
|
|
348
|
+
this.config.FieldUi.Setting.IsVisible = visible;
|
|
348
349
|
this._setHide(!visible);
|
|
350
|
+
// this.config.FieldUi.Setting.$BRuleHide = !visible;
|
|
349
351
|
this._cdr.detectChanges();
|
|
350
352
|
});
|
|
351
353
|
};
|
|
@@ -6607,8 +6609,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
|
|
|
6607
6609
|
}] });
|
|
6608
6610
|
|
|
6609
6611
|
class BarsaTinyemceComponent extends BaseComponent {
|
|
6610
|
-
constructor(_el) {
|
|
6612
|
+
constructor(_uploadService, _el) {
|
|
6611
6613
|
super();
|
|
6614
|
+
this._uploadService = _uploadService;
|
|
6612
6615
|
this._el = _el;
|
|
6613
6616
|
this.valueChange = new EventEmitter();
|
|
6614
6617
|
this.tinyInit = new EventEmitter();
|
|
@@ -6645,6 +6648,9 @@ class BarsaTinyemceComponent extends BaseComponent {
|
|
|
6645
6648
|
super.ngOnDestroy();
|
|
6646
6649
|
this.destroyTinymce();
|
|
6647
6650
|
}
|
|
6651
|
+
onFileSelection(files) {
|
|
6652
|
+
this.uploadFile(files).pipe(takeUntil$1(this._onDestroy$)).subscribe();
|
|
6653
|
+
}
|
|
6648
6654
|
loadTinyMce() {
|
|
6649
6655
|
if (!this.Setting.IsHtmlViewer) {
|
|
6650
6656
|
head.load(['Lib/tinymce/tinymce.min.js'], () => {
|
|
@@ -6837,7 +6843,9 @@ class BarsaTinyemceComponent extends BaseComponent {
|
|
|
6837
6843
|
}
|
|
6838
6844
|
};
|
|
6839
6845
|
}
|
|
6840
|
-
ShowUploadWindow() {
|
|
6846
|
+
ShowUploadWindow() {
|
|
6847
|
+
this._uploader.open();
|
|
6848
|
+
}
|
|
6841
6849
|
ShowOpenFileDialog(doReturn) {
|
|
6842
6850
|
const input = document.createElement('input');
|
|
6843
6851
|
input.setAttribute('type', 'file');
|
|
@@ -6855,7 +6863,7 @@ class BarsaTinyemceComponent extends BaseComponent {
|
|
|
6855
6863
|
input.click();
|
|
6856
6864
|
}
|
|
6857
6865
|
InsertBase64(base64, doReturn) {
|
|
6858
|
-
this.editor.execCommand('
|
|
6866
|
+
this.editor.execCommand('mceInsertContent', false, '<img src=data:image/png;base64,' + base64 + ' />');
|
|
6859
6867
|
doReturn();
|
|
6860
6868
|
}
|
|
6861
6869
|
getValue() {
|
|
@@ -6926,6 +6934,27 @@ class BarsaTinyemceComponent extends BaseComponent {
|
|
|
6926
6934
|
ed.destroy(false);
|
|
6927
6935
|
}
|
|
6928
6936
|
}
|
|
6937
|
+
uploadFile(files) {
|
|
6938
|
+
return this._uploadService.compressFiles$(files).pipe(concatMap((formData) => this._uploadService.upload(formData, this.Setting.StorageFileFieldId).pipe(tap$1((res) => {
|
|
6939
|
+
if (Array.isArray(res)) {
|
|
6940
|
+
const picture = res[0];
|
|
6941
|
+
if (picture.ErrorMsg) {
|
|
6942
|
+
BarsaApi.Bw.Msg.Error(picture.ErrorMsg);
|
|
6943
|
+
return;
|
|
6944
|
+
}
|
|
6945
|
+
const value = {
|
|
6946
|
+
...picture,
|
|
6947
|
+
FileId: picture.FileId
|
|
6948
|
+
};
|
|
6949
|
+
this._addImages(value);
|
|
6950
|
+
}
|
|
6951
|
+
}))));
|
|
6952
|
+
}
|
|
6953
|
+
_addImages(file) {
|
|
6954
|
+
const url = '/IH.ashx?ty=StorageFile&key=' + file.FileId;
|
|
6955
|
+
const html = '<img src=' + url + ' />';
|
|
6956
|
+
this.editor.execCommand('mceInsertContent', false, html);
|
|
6957
|
+
}
|
|
6929
6958
|
prepare() {
|
|
6930
6959
|
this.initilize();
|
|
6931
6960
|
tinymce.init(this.tinyMCEConfig);
|
|
@@ -6946,12 +6975,15 @@ class BarsaTinyemceComponent extends BaseComponent {
|
|
|
6946
6975
|
}
|
|
6947
6976
|
}
|
|
6948
6977
|
}
|
|
6949
|
-
BarsaTinyemceComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: BarsaTinyemceComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
6950
|
-
BarsaTinyemceComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: BarsaTinyemceComponent, selector: "bsu-barsa-tinyemce", inputs: { Setting: "Setting", isReadonly: "isReadonly", value: "value", defaultVerbs: "defaultVerbs" }, outputs: { valueChange: "valueChange", tinyInit: "tinyInit" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"fd-input tinywrapper\" [style.min-height.px]=\"height\" [id]=\"tinyHostId\"></div>\
|
|
6978
|
+
BarsaTinyemceComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: BarsaTinyemceComponent, deps: [{ token: i2.UploadService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
6979
|
+
BarsaTinyemceComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: BarsaTinyemceComponent, selector: "bsu-barsa-tinyemce", inputs: { Setting: "Setting", isReadonly: "isReadonly", value: "value", defaultVerbs: "defaultVerbs" }, outputs: { valueChange: "valueChange", tinyInit: "tinyInit" }, providers: [UploadService], viewQueries: [{ propertyName: "_uploader", first: true, predicate: ["uploader"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"fd-input tinywrapper\" [style.min-height.px]=\"height\" [id]=\"tinyHostId\"></div>\n<fd-file-uploader\n #uploader\n [style.display]=\"'none'\"\n [accept]=\"''\"\n [multiple]=\"false\"\n (selectedFilesChanged)=\"onFileSelection($event)\"\n></fd-file-uploader>\n<!-- <textarea [id]=\"tinyHostId\" style=\"height: 100%; visibility: hidden\"></textarea> -->\n", styles: [":host{display:block;width:100%;height:100%}.tinywrapper{overflow:auto}\n"], dependencies: [{ kind: "component", type: i6$4.FileUploaderComponent, selector: "fd-file-uploader", inputs: ["disabled", "required", "multiple", "accept", "dragndrop", "maxFileSize", "minFileSize", "id", "ariaLabel", "ariaLabelledBy", "placeholder", "buttonLabel", "buttonAriaLabel", "state", "fileLimit", "inputHidden", "width"], outputs: ["selectedFilesChanged", "selectedInvalidFiles", "onDragEnter", "onDragLeave"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6951
6980
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: BarsaTinyemceComponent, decorators: [{
|
|
6952
6981
|
type: Component,
|
|
6953
|
-
args: [{ selector: 'bsu-barsa-tinyemce', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"fd-input tinywrapper\" [style.min-height.px]=\"height\" [id]=\"tinyHostId\"></div>\
|
|
6954
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: {
|
|
6982
|
+
args: [{ selector: 'bsu-barsa-tinyemce', changeDetection: ChangeDetectionStrategy.OnPush, providers: [UploadService], template: "<div class=\"fd-input tinywrapper\" [style.min-height.px]=\"height\" [id]=\"tinyHostId\"></div>\n<fd-file-uploader\n #uploader\n [style.display]=\"'none'\"\n [accept]=\"''\"\n [multiple]=\"false\"\n (selectedFilesChanged)=\"onFileSelection($event)\"\n></fd-file-uploader>\n<!-- <textarea [id]=\"tinyHostId\" style=\"height: 100%; visibility: hidden\"></textarea> -->\n", styles: [":host{display:block;width:100%;height:100%}.tinywrapper{overflow:auto}\n"] }]
|
|
6983
|
+
}], ctorParameters: function () { return [{ type: i2.UploadService }, { type: i0.ElementRef }]; }, propDecorators: { _uploader: [{
|
|
6984
|
+
type: ViewChild,
|
|
6985
|
+
args: ['uploader']
|
|
6986
|
+
}], Setting: [{
|
|
6955
6987
|
type: Input
|
|
6956
6988
|
}], isReadonly: [{
|
|
6957
6989
|
type: Input
|
|
@@ -9111,7 +9143,7 @@ class UiPicturesInfoComponent extends DeviceInfoFieldBaseComponent {
|
|
|
9111
9143
|
this.mediaDataSource.next(data);
|
|
9112
9144
|
}
|
|
9113
9145
|
uploadToServer(files) {
|
|
9114
|
-
return this._uploadService.compressFiles$(files).pipe(concatMap((formData) => this._uploadService.upload(formData, this.Setting.ControlFieldDefId).pipe(tap((res) => {
|
|
9146
|
+
return this._uploadService.compressFiles$(files).pipe(concatMap$1((formData) => this._uploadService.upload(formData, this.Setting.ControlFieldDefId).pipe(tap((res) => {
|
|
9115
9147
|
if (Array.isArray(res)) {
|
|
9116
9148
|
this.updateValue(res);
|
|
9117
9149
|
}
|
|
@@ -10965,7 +10997,7 @@ class UiPictureFileComponent extends FieldBaseComponent {
|
|
|
10965
10997
|
.subscribe();
|
|
10966
10998
|
}
|
|
10967
10999
|
uploadFile(files) {
|
|
10968
|
-
return this._uploadService.compressFiles$(files).pipe(concatMap((formData) => this._uploadService.upload(formData, this.Setting.ControlFieldDefId).pipe(tap((res) => {
|
|
11000
|
+
return this._uploadService.compressFiles$(files).pipe(concatMap$1((formData) => this._uploadService.upload(formData, this.Setting.ControlFieldDefId).pipe(tap((res) => {
|
|
10969
11001
|
if (Array.isArray(res)) {
|
|
10970
11002
|
const picture = res[0];
|
|
10971
11003
|
if (picture.ErrorMsg) {
|
|
@@ -11140,7 +11172,12 @@ class UiRadioGroupComponent extends DeviceInfoFieldBaseComponent {
|
|
|
11140
11172
|
ngOnInit() {
|
|
11141
11173
|
super.ngOnInit();
|
|
11142
11174
|
const parameters = this.parameters;
|
|
11143
|
-
this.value
|
|
11175
|
+
if (typeof this.value == 'object') {
|
|
11176
|
+
this.value = this.items.find((c) => c.inputValue === this.value.inputValue);
|
|
11177
|
+
}
|
|
11178
|
+
else {
|
|
11179
|
+
this.value = this.items.find((c) => c.inputValue === this.value);
|
|
11180
|
+
}
|
|
11144
11181
|
this.onlyInMobileVertically = parameters?.OnlyInMobileVertically;
|
|
11145
11182
|
this.isVertically = parameters?.IsVertically;
|
|
11146
11183
|
}
|