@sd-angular/core 1.1.28 → 1.1.31
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/bundles/sd-angular-core-grid-material.umd.js +32 -29
- package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js +2 -2
- package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-json-editor.umd.js +10 -2
- package/bundles/sd-angular-core-json-editor.umd.js.map +1 -1
- package/bundles/sd-angular-core-json-editor.umd.min.js +1 -1
- package/bundles/sd-angular-core-json-editor.umd.min.js.map +1 -1
- package/esm2015/grid-material/sd-angular-core-grid-material.js +4 -5
- package/esm2015/grid-material/src/lib/components/desktop-cell/desktop-cell.component.js +2 -2
- package/esm2015/grid-material/src/lib/grid-material.module.js +1 -4
- package/esm2015/grid-material/src/lib/pipes/editor-handler-column.pipe.js +27 -4
- package/esm2015/grid-material/src/lib/pipes/editor-handler-row.pipe.js +3 -2
- package/esm2015/json-editor/src/lib/json-editor.component.js +11 -3
- package/fesm2015/sd-angular-core-grid-material.js +30 -23
- package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
- package/fesm2015/sd-angular-core-json-editor.js +10 -2
- package/fesm2015/sd-angular-core-json-editor.js.map +1 -1
- package/grid-material/sd-angular-core-grid-material.d.ts +3 -4
- package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
- package/package.json +1 -1
- package/{sd-angular-core-1.1.28.tgz → sd-angular-core-1.1.31.tgz} +0 -0
- package/esm2015/grid-material/src/lib/pipes/sd-id.pipe.js +0 -18
- package/grid-material/src/lib/pipes/sd-id.pipe.d.ts +0 -6
|
@@ -36,8 +36,16 @@ class SdJsonEditor {
|
|
|
36
36
|
mode: this.formControl.disabled ? 'view' : 'tree',
|
|
37
37
|
modes: ['tree', 'form', 'text', 'view'],
|
|
38
38
|
onChange: () => {
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
const text = this.editor.getText();
|
|
40
|
+
if (!text) {
|
|
41
|
+
this.editor.set(null);
|
|
42
|
+
__classPrivateFieldSet(this, _model, null);
|
|
43
|
+
this.formControl.setValue(__classPrivateFieldGet(this, _model));
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
__classPrivateFieldSet(this, _model, this.editor.get());
|
|
47
|
+
this.formControl.setValue(__classPrivateFieldGet(this, _model));
|
|
48
|
+
}
|
|
41
49
|
},
|
|
42
50
|
};
|
|
43
51
|
this.editor = new JSONEditor(container, option);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-angular-core-json-editor.js","sources":["../../../../projects/sd-core/json-editor/src/lib/json-editor.component.ts","../../../../projects/sd-core/json-editor/src/lib/json-editor.module.ts","../../../../projects/sd-core/json-editor/src/public-api.ts","../../../../projects/sd-core/json-editor/sd-angular-core-json-editor.ts"],"sourcesContent":["import {\r\n Component,\r\n Input,\r\n ViewChild,\r\n Output,\r\n EventEmitter,\r\n ChangeDetectorRef,\r\n OnDestroy,\r\n AfterViewInit,\r\n ElementRef,\r\n OnInit,\r\n ContentChild,\r\n ChangeDetectionStrategy,\r\n HostListener\r\n} from '@angular/core';\r\nimport { NgForm, FormGroup } from '@angular/forms';\r\nimport * as uuid from 'uuid';\r\nimport { debounceTime } from 'rxjs/operators';\r\nimport { Subscription } from 'rxjs';\r\nimport { SdFormControl } from '@sd-angular/core/common';\r\nimport 'jsoneditor';\r\nimport JSONEditor, { JSONEditorOptions } from 'jsoneditor';\r\n@Component({\r\n selector: 'sd-json-editor',\r\n templateUrl: './json-editor.component.html',\r\n styleUrls: ['./json-editor.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdJsonEditor implements OnDestroy, OnInit, AfterViewInit {\r\n id = `I${uuid.v4()}`;\r\n editor: JSONEditor;\r\n #name = uuid.v4();\r\n @Input() set name(val: string) {\r\n if (val) {\r\n this.#name = val;\r\n }\r\n }\r\n @Input() height = '400px';\r\n #form: FormGroup;\r\n @Input() set form(val: NgForm | FormGroup) {\r\n if (val) {\r\n if (val instanceof NgForm) {\r\n this.#form = val.form;\r\n } else {\r\n this.#form = val;\r\n }\r\n }\r\n }\r\n @Input() label: string;\r\n #model: any;\r\n @Input() set model(value: any) {\r\n if (this.#model !== value) {\r\n this.#model = value;\r\n this.formControl.setValue(this.#model, {\r\n emitEvent: false\r\n });\r\n this.#updateJson();\r\n }\r\n }\r\n @Output() modelChange = new EventEmitter();\r\n\r\n // Validator\r\n isRequired = false;\r\n @Input() set required(val: boolean | '') {\r\n this.isRequired = (val === '') || val;\r\n // this.#updateValidator();\r\n }\r\n // Optional\r\n @Input() set disabled(val: boolean | '') {\r\n val = (val === '') || val;\r\n if (val) {\r\n this.formControl.disable();\r\n } else {\r\n this.formControl.enable();\r\n }\r\n }\r\n @Input() tooltip: string | ((inputValue: string) => string);\r\n @Output() sdChange = new EventEmitter<any>();\r\n\r\n formControl = new SdFormControl();\r\n #subscription = new Subscription();\r\n constructor(\r\n public ref: ChangeDetectorRef) {\r\n }\r\n\r\n ngOnInit() {\r\n this.#subscription.add(this.formControl.sdChanges.subscribe(() => {\r\n this.ref.markForCheck();\r\n }));\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.#reload();\r\n }\r\n\r\n #reload = () => {\r\n const container = document.getElementById(this.id);\r\n const option: JSONEditorOptions = {\r\n mode: this.formControl.disabled ? 'view' : 'tree',\r\n modes: ['tree', 'form', 'text', 'view'],\r\n onChange: () => {\r\n this.#model = this.editor.get();\r\n
|
|
1
|
+
{"version":3,"file":"sd-angular-core-json-editor.js","sources":["../../../../projects/sd-core/json-editor/src/lib/json-editor.component.ts","../../../../projects/sd-core/json-editor/src/lib/json-editor.module.ts","../../../../projects/sd-core/json-editor/src/public-api.ts","../../../../projects/sd-core/json-editor/sd-angular-core-json-editor.ts"],"sourcesContent":["import {\r\n Component,\r\n Input,\r\n ViewChild,\r\n Output,\r\n EventEmitter,\r\n ChangeDetectorRef,\r\n OnDestroy,\r\n AfterViewInit,\r\n ElementRef,\r\n OnInit,\r\n ContentChild,\r\n ChangeDetectionStrategy,\r\n HostListener\r\n} from '@angular/core';\r\nimport { NgForm, FormGroup } from '@angular/forms';\r\nimport * as uuid from 'uuid';\r\nimport { debounceTime } from 'rxjs/operators';\r\nimport { Subscription } from 'rxjs';\r\nimport { SdFormControl } from '@sd-angular/core/common';\r\nimport 'jsoneditor';\r\nimport JSONEditor, { JSONEditorOptions } from 'jsoneditor';\r\n@Component({\r\n selector: 'sd-json-editor',\r\n templateUrl: './json-editor.component.html',\r\n styleUrls: ['./json-editor.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdJsonEditor implements OnDestroy, OnInit, AfterViewInit {\r\n id = `I${uuid.v4()}`;\r\n editor: JSONEditor;\r\n #name = uuid.v4();\r\n @Input() set name(val: string) {\r\n if (val) {\r\n this.#name = val;\r\n }\r\n }\r\n @Input() height = '400px';\r\n #form: FormGroup;\r\n @Input() set form(val: NgForm | FormGroup) {\r\n if (val) {\r\n if (val instanceof NgForm) {\r\n this.#form = val.form;\r\n } else {\r\n this.#form = val;\r\n }\r\n }\r\n }\r\n @Input() label: string;\r\n #model: any;\r\n @Input() set model(value: any) {\r\n if (this.#model !== value) {\r\n this.#model = value;\r\n this.formControl.setValue(this.#model, {\r\n emitEvent: false\r\n });\r\n this.#updateJson();\r\n }\r\n }\r\n @Output() modelChange = new EventEmitter();\r\n\r\n // Validator\r\n isRequired = false;\r\n @Input() set required(val: boolean | '') {\r\n this.isRequired = (val === '') || val;\r\n // this.#updateValidator();\r\n }\r\n // Optional\r\n @Input() set disabled(val: boolean | '') {\r\n val = (val === '') || val;\r\n if (val) {\r\n this.formControl.disable();\r\n } else {\r\n this.formControl.enable();\r\n }\r\n }\r\n @Input() tooltip: string | ((inputValue: string) => string);\r\n @Output() sdChange = new EventEmitter<any>();\r\n\r\n formControl = new SdFormControl();\r\n #subscription = new Subscription();\r\n constructor(\r\n public ref: ChangeDetectorRef) {\r\n }\r\n\r\n ngOnInit() {\r\n this.#subscription.add(this.formControl.sdChanges.subscribe(() => {\r\n this.ref.markForCheck();\r\n }));\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.#reload();\r\n }\r\n\r\n #reload = () => {\r\n const container = document.getElementById(this.id);\r\n const option: JSONEditorOptions = {\r\n mode: this.formControl.disabled ? 'view' : 'tree',\r\n modes: ['tree', 'form', 'text', 'view'],\r\n onChange: () => {\r\n const text = this.editor.getText();\r\n if (!text) {\r\n this.editor.set(null);\r\n this.#model = null;\r\n this.formControl.setValue(this.#model);\r\n } else {\r\n this.#model = this.editor.get();\r\n this.formControl.setValue(this.#model);\r\n }\r\n },\r\n };\r\n this.editor = new JSONEditor(container, option);\r\n this.#updateJson();\r\n this.#subscription.add(this.formControl.valueChanges.pipe(debounceTime(100)).subscribe(this.#onChange));\r\n this.#form?.addControl(this.#name, this.formControl);\r\n }\r\n\r\n ngOnDestroy() {\r\n this.#form?.removeControl(this.#name);\r\n this.#subscription.unsubscribe();\r\n }\r\n\r\n reValidate = () => {\r\n this.formControl.updateValueAndValidity();\r\n }\r\n\r\n #onChange = (value: any) => {\r\n this.modelChange.emit(value);\r\n this.sdChange.emit(value);\r\n }\r\n\r\n #updateJson = () => {\r\n this.editor?.set?.(this.formControl.value);\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { SdTranslateModule } from '@sd-angular/core/translate';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { SdCommonModule } from '@sd-angular/core/common';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { SdJsonEditor } from './json-editor.component';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatFormFieldModule,\r\n MatInputModule,\r\n MatIconModule,\r\n MatTooltipModule,\r\n SdTranslateModule,\r\n SdCommonModule,\r\n MatButtonModule\r\n ],\r\n declarations: [\r\n SdJsonEditor,\r\n ],\r\n exports: [\r\n SdJsonEditor\r\n ]\r\n})\r\nexport class SdJsonEditorModule { }\r\n","/*\r\n * Public API Surface of superdev-angular-core\r\n */\r\n\r\nexport * from './lib/json-editor.module';\r\nexport * from './lib/json-editor.component';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["uuid.v4"],"mappings":";;;;;;;;;;;;;;;;;MA4Ba,YAAY;IAqDvB,YACS,GAAsB;QAAtB,QAAG,GAAH,GAAG,CAAmB;QArD/B,OAAE,GAAG,IAAIA,EAAO,EAAE,EAAE,CAAC;QAErB,gBAAQA,EAAO,EAAE,EAAC;QAMT,WAAM,GAAG,OAAO,CAAC;QAC1B,wBAAiB;QAWjB,yBAAY;QAUF,gBAAW,GAAG,IAAI,YAAY,EAAE,CAAC;;QAG3C,eAAU,GAAG,KAAK,CAAC;QAeT,aAAQ,GAAG,IAAI,YAAY,EAAO,CAAC;QAE7C,gBAAW,GAAG,IAAI,aAAa,EAAE,CAAC;QAClC,wBAAgB,IAAI,YAAY,EAAE,EAAC;QAenC,kBAAU;;YACR,MAAM,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACnD,MAAM,MAAM,GAAsB;gBAChC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ,GAAG,MAAM,GAAG,MAAM;gBACjD,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;gBACvC,QAAQ,EAAE;oBACR,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;oBACnC,IAAI,CAAC,IAAI,EAAE;wBACT,IAAI,CAAC,M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BACP,YAAY;oBACZ,WAAW;oBACX,mBAAmB;oBACnB,kBAAkB;oBAClB,cAAc;oBACd,aAAa;oBACb,gBAAgB;oBAChB,iBAAiB;oBACjB,cAAc;oBACd,eAAe;iBAChB;gBACD,YAAY,EAAE;oBACZ,YAAY;iBACb;gBACD,OAAO,EAAE;oBACP,YAAY;iBACb;aACF;;;AC/BD;;;;ACAA;;;;;;"}
|
|
@@ -17,7 +17,7 @@ export { SdPopupGridConfiguration as ɵr } from './src/lib/components/popup-grid
|
|
|
17
17
|
export { SdGridQuickAction as ɵj } from './src/lib/components/quick-action/quick-action.component';
|
|
18
18
|
export { MatPaginatorIntlCro as ɵa } from './src/lib/grid-material.module';
|
|
19
19
|
export { GRID_MATERIAL_CONFIG as ɵg, ISdGridMaterialConfiguration as ɵf } from './src/lib/models/grid-configuration.model';
|
|
20
|
-
export { SdCellViewPipe as
|
|
20
|
+
export { SdCellViewPipe as ɵbp } from './src/lib/pipes/cell-view.pipe';
|
|
21
21
|
export { SdColumnBadgePipe as ɵbe } from './src/lib/pipes/column-badge.pipe';
|
|
22
22
|
export { SdColumnChildrenFilterPipe as ɵv } from './src/lib/pipes/column-children-filter.pipe';
|
|
23
23
|
export { SdColumnHtmlTemplatePipe as ɵbb } from './src/lib/pipes/column-html-template.pipe';
|
|
@@ -35,13 +35,12 @@ export { SdEditorValidatePipe as ɵbn } from './src/lib/pipes/editor-validate.pi
|
|
|
35
35
|
export { SdFilterColumnPipe as ɵbf } from './src/lib/pipes/filter-column.pipe';
|
|
36
36
|
export { SdFilterExternalPipe as ɵbg } from './src/lib/pipes/filter-external.pipe';
|
|
37
37
|
export { SdGridConfigurationResultPipe as ɵu } from './src/lib/pipes/grid-configuration-result.pipe';
|
|
38
|
-
export { SdGroupPipe as
|
|
39
|
-
export { SdIdPipe as ɵbo } from './src/lib/pipes/sd-id.pipe';
|
|
38
|
+
export { SdGroupPipe as ɵbq } from './src/lib/pipes/sd-group.pipe';
|
|
40
39
|
export { SdSelectionActionFilterPipe as ɵbh } from './src/lib/pipes/selection-action-filter.pipe';
|
|
41
40
|
export { SdSelectionDisablePipe as ɵbj } from './src/lib/pipes/selection-disable.pipe';
|
|
42
41
|
export { SdSelectionVisibleSelectAllPipe as ɵbk } from './src/lib/pipes/selection-visible-select-all.pipe';
|
|
43
42
|
export { SdSelectionVisiblePipe as ɵbi } from './src/lib/pipes/selection-visible.pipe';
|
|
44
|
-
export { SdStyleRowCss as
|
|
43
|
+
export { SdStyleRowCss as ɵbo } from './src/lib/pipes/style-row-css.pipe';
|
|
45
44
|
export { SdGeneratedColumnService as ɵt } from './src/lib/services/generated-column/generated-column.service';
|
|
46
45
|
export { SdGridConfigurationService as ɵh } from './src/lib/services/grid-configuration.service';
|
|
47
46
|
export { SdGridFilterService as ɵd } from './src/lib/services/grid-filter.service';
|