@apipass/inputs 0.2.1-alpha.4 → 0.2.1-alpha.7
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/ace-editor/component.d.ts +52 -0
- package/ace-editor/directive.d.ts +39 -0
- package/assets/css/buttons.scss +6 -0
- package/bundles/apipass-inputs.umd.js +461 -9
- package/bundles/apipass-inputs.umd.js.map +1 -1
- package/bundles/apipass-inputs.umd.min.js +2 -2
- package/bundles/apipass-inputs.umd.min.js.map +1 -1
- package/esm2015/ace-editor/component.js +204 -0
- package/esm2015/ace-editor/directive.js +150 -0
- package/esm2015/inputs.module.js +15 -5
- package/esm2015/public-api.js +3 -1
- package/esm2015/select-box/select-box.component.js +23 -2
- package/fesm2015/apipass-inputs.js +383 -7
- package/fesm2015/apipass-inputs.js.map +1 -1
- package/inputs.module.d.ts +18 -16
- package/package.json +3 -1
- package/public-api.d.ts +2 -0
- package/select-box/select-box.component.d.ts +6 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ɵɵgetCurrentView, ɵɵelementStart, ɵɵlistener, ɵɵrestoreView, ɵɵnextContext, ɵɵelementEnd, ɵɵadvance, ɵɵproperty, ɵɵtext, ɵɵpipe, ɵɵtextInterpolate, ɵɵpipeBind1, ɵɵdefineComponent, ɵɵProvidersFeature, forwardRef, ɵɵInheritDefinitionFeature, ɵɵtemplate, ɵɵpipeBind2, ɵɵgetInheritedFactory, ɵsetClassMetadata, Component, ViewEncapsulation, Input, ɵɵreference, ɵɵtextInterpolate2, ɵɵelement, EventEmitter, ɵɵpureFunction1, ChangeDetectionStrategy, Output, ɵɵpureFunction3, ɵɵpureFunction2, ɵɵsanitizeUrl, ɵɵprojectionDef, ɵɵprojection, ɵɵviewQuery, ɵɵqueryRefresh, ɵɵloadQuery, ViewChild, ɵɵdirectiveInject, NgZone, ɵɵdefineDirective, Directive, ɵɵtextInterpolate1, ɵɵpipeBind3, ɵɵstaticViewQuery, ɵɵattribute, ɵɵpureFunction0, HostBinding, HostListener, ɵɵdefineNgModule, ɵɵdefineInjector, ɵɵsetNgModuleScope, NgModule } from '@angular/core';
|
|
1
|
+
import { ɵɵgetCurrentView, ɵɵelementStart, ɵɵlistener, ɵɵrestoreView, ɵɵnextContext, ɵɵelementEnd, ɵɵadvance, ɵɵproperty, ɵɵtext, ɵɵpipe, ɵɵtextInterpolate, ɵɵpipeBind1, ɵɵdefineComponent, ɵɵProvidersFeature, forwardRef, ɵɵInheritDefinitionFeature, ɵɵtemplate, ɵɵpipeBind2, ɵɵgetInheritedFactory, ɵsetClassMetadata, Component, ViewEncapsulation, Input, ɵɵreference, ɵɵtextInterpolate2, ɵɵelement, EventEmitter, ɵɵpureFunction1, ChangeDetectionStrategy, Output, ɵɵpureFunction3, ɵɵpureFunction2, ɵɵsanitizeUrl, ɵɵprojectionDef, ɵɵprojection, ɵɵviewQuery, ɵɵqueryRefresh, ɵɵloadQuery, ViewChild, ɵɵdirectiveInject, NgZone, ɵɵdefineDirective, Directive, ɵɵtextInterpolate1, ɵɵpipeBind3, ɵɵstaticViewQuery, ɵɵattribute, ɵɵpureFunction0, HostBinding, HostListener, ElementRef, ɵɵdefineNgModule, ɵɵdefineInjector, ɵɵsetNgModuleScope, NgModule } from '@angular/core';
|
|
2
2
|
import { NG_VALUE_ACCESSOR, NgControlStatus, NgModel, DefaultValueAccessor, RequiredValidator, MinLengthValidator, FormsModule } from '@angular/forms';
|
|
3
3
|
import { NgIf, NgForOf, NgClass, NgStyle, CommonModule } from '@angular/common';
|
|
4
4
|
import { MatFormField, MatSuffix, MatLabel, MatHint, MatFormFieldModule } from '@angular/material/form-field';
|
|
@@ -18,6 +18,8 @@ import { NgSelectComponent, ɵh, ɵj, ɵf, NgSelectModule } from '@ng-select/ng-
|
|
|
18
18
|
import { MatSelectFilterModule } from 'mat-select-filter';
|
|
19
19
|
import { DndDropzoneDirective, DndModule } from 'ngx-drag-drop';
|
|
20
20
|
import { RouterModule } from '@angular/router';
|
|
21
|
+
import 'brace';
|
|
22
|
+
import 'brace/theme/monokai';
|
|
21
23
|
|
|
22
24
|
class ValueAccessorBase {
|
|
23
25
|
constructor() {
|
|
@@ -744,6 +746,7 @@ class SelectBoxComponent extends ValueAccessorBase {
|
|
|
744
746
|
this.addNewItemText = '';
|
|
745
747
|
this.addNewItemIcon = '';
|
|
746
748
|
this.addNewItemClickCloseSelect = false;
|
|
749
|
+
this.closeOnBodyScroll = false;
|
|
747
750
|
this.onOpenSelectBox = new EventEmitter();
|
|
748
751
|
this.onCloseSelectBox = new EventEmitter();
|
|
749
752
|
this.onSelectChange = new EventEmitter();
|
|
@@ -753,9 +756,27 @@ class SelectBoxComponent extends ValueAccessorBase {
|
|
|
753
756
|
this.loading = false;
|
|
754
757
|
this.inputFilter = new Subject();
|
|
755
758
|
this.lastSearchTerm = '';
|
|
759
|
+
this.onBodyScroll = (event) => {
|
|
760
|
+
var _a, _b;
|
|
761
|
+
if (this.closeOnBodyScroll && ((_a = this.ngSelectComponent) === null || _a === void 0 ? void 0 : _a.isOpen)) {
|
|
762
|
+
const isScrollingInScrollHost = ((_b = event.target.className) === null || _b === void 0 ? void 0 : _b.indexOf('ng-dropdown-panel-items')) > -1;
|
|
763
|
+
if (isScrollingInScrollHost) {
|
|
764
|
+
return;
|
|
765
|
+
}
|
|
766
|
+
this.ngSelectComponent.close();
|
|
767
|
+
}
|
|
768
|
+
};
|
|
756
769
|
}
|
|
757
770
|
ngOnInit() {
|
|
758
771
|
this.onSearch();
|
|
772
|
+
if (this.closeOnBodyScroll) {
|
|
773
|
+
window.addEventListener('scroll', this.onBodyScroll, true);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
ngOnDestroy() {
|
|
777
|
+
if (this.closeOnBodyScroll) {
|
|
778
|
+
window.removeEventListener('scroll', this.onBodyScroll, true);
|
|
779
|
+
}
|
|
759
780
|
}
|
|
760
781
|
onSearch() {
|
|
761
782
|
this.inputFilter.pipe(debounceTime(200), distinctUntilChanged()).subscribe(searchString => {
|
|
@@ -838,7 +859,7 @@ SelectBoxComponent.ɵcmp = ɵɵdefineComponent({ type: SelectBoxComponent, selec
|
|
|
838
859
|
} if (rf & 2) {
|
|
839
860
|
var _t;
|
|
840
861
|
ɵɵqueryRefresh(_t = ɵɵloadQuery()) && (ctx.ngSelectComponent = _t.first);
|
|
841
|
-
} }, inputs: { placeholder: "placeholder", searchPlaceHolder: "searchPlaceHolder", clearText: "clearText", notFoundText: "notFoundText", enabledSearch: "enabledSearch", data: "data", disabled: "disabled", selectedItem: "selectedItem", bindImageUrl: "bindImageUrl", bindKey: "bindKey", bindValue: "bindValue", limitItens: "limitItens", showAddNewItem: "showAddNewItem", addNewItemText: "addNewItemText", addNewItemIcon: "addNewItemIcon", addNewItemClickCloseSelect: "addNewItemClickCloseSelect" }, outputs: { onOpenSelectBox: "onOpenSelectBox", onCloseSelectBox: "onCloseSelectBox", onSelectChange: "onSelectChange", onSelectClear: "onSelectClear", onAddNewItemClick: "onAddNewItemClick" }, features: [ɵɵProvidersFeature([{
|
|
862
|
+
} }, inputs: { placeholder: "placeholder", searchPlaceHolder: "searchPlaceHolder", clearText: "clearText", notFoundText: "notFoundText", enabledSearch: "enabledSearch", data: "data", disabled: "disabled", selectedItem: "selectedItem", bindImageUrl: "bindImageUrl", bindKey: "bindKey", bindValue: "bindValue", limitItens: "limitItens", showAddNewItem: "showAddNewItem", addNewItemText: "addNewItemText", addNewItemIcon: "addNewItemIcon", addNewItemClickCloseSelect: "addNewItemClickCloseSelect", closeOnBodyScroll: "closeOnBodyScroll" }, outputs: { onOpenSelectBox: "onOpenSelectBox", onCloseSelectBox: "onCloseSelectBox", onSelectChange: "onSelectChange", onSelectClear: "onSelectClear", onAddNewItemClick: "onAddNewItemClick" }, features: [ɵɵProvidersFeature([{
|
|
842
863
|
provide: NG_VALUE_ACCESSOR,
|
|
843
864
|
useExisting: forwardRef(() => SelectBoxComponent),
|
|
844
865
|
multi: true
|
|
@@ -902,6 +923,8 @@ const ɵSelectBoxComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(S
|
|
|
902
923
|
type: Input
|
|
903
924
|
}], addNewItemClickCloseSelect: [{
|
|
904
925
|
type: Input
|
|
926
|
+
}], closeOnBodyScroll: [{
|
|
927
|
+
type: Input
|
|
905
928
|
}], onOpenSelectBox: [{
|
|
906
929
|
type: Output
|
|
907
930
|
}], onCloseSelectBox: [{
|
|
@@ -1377,6 +1400,351 @@ InputFileComponent.ɵcmp = ɵɵdefineComponent({ type: InputFileComponent, selec
|
|
|
1377
1400
|
type: Output
|
|
1378
1401
|
}] }); })();
|
|
1379
1402
|
|
|
1403
|
+
/* tslint:disable */
|
|
1404
|
+
class AceEditorComponent {
|
|
1405
|
+
constructor(elementRef, zone) {
|
|
1406
|
+
this.zone = zone;
|
|
1407
|
+
this.textChanged = new EventEmitter();
|
|
1408
|
+
this.textChange = new EventEmitter();
|
|
1409
|
+
this.style = {};
|
|
1410
|
+
// @ts-ignore
|
|
1411
|
+
this._options = {};
|
|
1412
|
+
// @ts-ignore
|
|
1413
|
+
this._theme = 'monokai';
|
|
1414
|
+
// @ts-ignore
|
|
1415
|
+
this._mode = 'html';
|
|
1416
|
+
// @ts-ignore
|
|
1417
|
+
this._autoUpdateContent = true;
|
|
1418
|
+
// @ts-ignore
|
|
1419
|
+
this._durationBeforeCallback = 0;
|
|
1420
|
+
// @ts-ignore
|
|
1421
|
+
this._text = '';
|
|
1422
|
+
this._onChange = (_) => {
|
|
1423
|
+
};
|
|
1424
|
+
this._onTouched = () => {
|
|
1425
|
+
};
|
|
1426
|
+
const el = elementRef.nativeElement;
|
|
1427
|
+
this.zone.runOutsideAngular(() => {
|
|
1428
|
+
this._editor = ace['edit'](el);
|
|
1429
|
+
});
|
|
1430
|
+
this._editor.$blockScrolling = Infinity;
|
|
1431
|
+
}
|
|
1432
|
+
ngOnInit() {
|
|
1433
|
+
this.init();
|
|
1434
|
+
this.initEvents();
|
|
1435
|
+
}
|
|
1436
|
+
ngOnDestroy() {
|
|
1437
|
+
this._editor.destroy();
|
|
1438
|
+
}
|
|
1439
|
+
init() {
|
|
1440
|
+
this.setOptions(this._options || {});
|
|
1441
|
+
this.setTheme(this._theme);
|
|
1442
|
+
this.setMode(this._mode);
|
|
1443
|
+
this.setReadOnly(this._readOnly);
|
|
1444
|
+
}
|
|
1445
|
+
initEvents() {
|
|
1446
|
+
this._editor.on('change', () => this.updateText());
|
|
1447
|
+
this._editor.on('paste', () => this.updateText());
|
|
1448
|
+
}
|
|
1449
|
+
updateText() {
|
|
1450
|
+
const newVal = this._editor.getValue();
|
|
1451
|
+
if (newVal === this.oldText) {
|
|
1452
|
+
return;
|
|
1453
|
+
}
|
|
1454
|
+
if (!this._durationBeforeCallback) {
|
|
1455
|
+
this._text = newVal;
|
|
1456
|
+
this.zone.run(() => {
|
|
1457
|
+
this.textChange.emit(newVal);
|
|
1458
|
+
this.textChanged.emit(newVal);
|
|
1459
|
+
});
|
|
1460
|
+
this._onChange(newVal);
|
|
1461
|
+
}
|
|
1462
|
+
else {
|
|
1463
|
+
if (this.timeoutSaving) {
|
|
1464
|
+
clearTimeout(this.timeoutSaving);
|
|
1465
|
+
}
|
|
1466
|
+
this.timeoutSaving = setTimeout(() => {
|
|
1467
|
+
this._text = newVal;
|
|
1468
|
+
this.zone.run(() => {
|
|
1469
|
+
this.textChange.emit(newVal);
|
|
1470
|
+
this.textChanged.emit(newVal);
|
|
1471
|
+
});
|
|
1472
|
+
this.timeoutSaving = null;
|
|
1473
|
+
}, this._durationBeforeCallback);
|
|
1474
|
+
}
|
|
1475
|
+
this.oldText = newVal;
|
|
1476
|
+
}
|
|
1477
|
+
set options(options) {
|
|
1478
|
+
this.setOptions(options);
|
|
1479
|
+
}
|
|
1480
|
+
setOptions(options) {
|
|
1481
|
+
this._options = options;
|
|
1482
|
+
this._editor.setOptions(options || {});
|
|
1483
|
+
}
|
|
1484
|
+
set readOnly(readOnly) {
|
|
1485
|
+
this.setReadOnly(readOnly);
|
|
1486
|
+
}
|
|
1487
|
+
setReadOnly(readOnly) {
|
|
1488
|
+
this._readOnly = readOnly;
|
|
1489
|
+
this._editor.setReadOnly(readOnly);
|
|
1490
|
+
}
|
|
1491
|
+
set theme(theme) {
|
|
1492
|
+
this.setTheme(theme);
|
|
1493
|
+
}
|
|
1494
|
+
setTheme(theme) {
|
|
1495
|
+
this._theme = theme;
|
|
1496
|
+
this._editor.setTheme(`ace/theme/${theme}`);
|
|
1497
|
+
}
|
|
1498
|
+
set mode(mode) {
|
|
1499
|
+
this.setMode(mode);
|
|
1500
|
+
}
|
|
1501
|
+
setMode(mode) {
|
|
1502
|
+
this._mode = mode;
|
|
1503
|
+
if (typeof this._mode === 'object') {
|
|
1504
|
+
this._editor.getSession().setMode(this._mode);
|
|
1505
|
+
}
|
|
1506
|
+
else {
|
|
1507
|
+
this._editor.getSession().setMode(`ace/mode/${this._mode}`);
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
// @ts-ignore
|
|
1511
|
+
get value() {
|
|
1512
|
+
return this.text;
|
|
1513
|
+
}
|
|
1514
|
+
// @ts-ignore
|
|
1515
|
+
set value(value) {
|
|
1516
|
+
this.setText(value);
|
|
1517
|
+
}
|
|
1518
|
+
writeValue(value) {
|
|
1519
|
+
this.setText(value);
|
|
1520
|
+
}
|
|
1521
|
+
registerOnChange(fn) {
|
|
1522
|
+
this._onChange = fn;
|
|
1523
|
+
}
|
|
1524
|
+
registerOnTouched(fn) {
|
|
1525
|
+
this._onTouched = fn;
|
|
1526
|
+
}
|
|
1527
|
+
get text() {
|
|
1528
|
+
return this._text;
|
|
1529
|
+
}
|
|
1530
|
+
set text(text) {
|
|
1531
|
+
this.setText(text);
|
|
1532
|
+
}
|
|
1533
|
+
setText(text) {
|
|
1534
|
+
if (text === null || text === undefined) {
|
|
1535
|
+
text = '';
|
|
1536
|
+
}
|
|
1537
|
+
if (this._text !== text && this._autoUpdateContent) {
|
|
1538
|
+
this._text = text;
|
|
1539
|
+
this._editor.setValue(text);
|
|
1540
|
+
this._onChange(text);
|
|
1541
|
+
this._editor.clearSelection();
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
set autoUpdateContent(status) {
|
|
1545
|
+
this.setAutoUpdateContent(status);
|
|
1546
|
+
}
|
|
1547
|
+
setAutoUpdateContent(status) {
|
|
1548
|
+
this._autoUpdateContent = status;
|
|
1549
|
+
}
|
|
1550
|
+
set durationBeforeCallback(num) {
|
|
1551
|
+
this.setDurationBeforeCallback(num);
|
|
1552
|
+
}
|
|
1553
|
+
setDurationBeforeCallback(num) {
|
|
1554
|
+
this._durationBeforeCallback = num;
|
|
1555
|
+
}
|
|
1556
|
+
getEditor() {
|
|
1557
|
+
return this._editor;
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
AceEditorComponent.ɵfac = function AceEditorComponent_Factory(t) { return new (t || AceEditorComponent)(ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(NgZone)); };
|
|
1561
|
+
AceEditorComponent.ɵcmp = ɵɵdefineComponent({ type: AceEditorComponent, selectors: [["ace-editor"]], inputs: { style: "style", options: "options", readOnly: "readOnly", theme: "theme", mode: "mode", value: "value", text: "text", autoUpdateContent: "autoUpdateContent", durationBeforeCallback: "durationBeforeCallback" }, outputs: { textChanged: "textChanged", textChange: "textChange" }, features: [ɵɵProvidersFeature([{
|
|
1562
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1563
|
+
useExisting: forwardRef(() => AceEditorComponent),
|
|
1564
|
+
multi: true
|
|
1565
|
+
}])], decls: 0, vars: 0, template: function AceEditorComponent_Template(rf, ctx) { }, styles: ["[_nghost-%COMP%] { display:block;width:100%; }"] });
|
|
1566
|
+
/*@__PURE__*/ (function () { ɵsetClassMetadata(AceEditorComponent, [{
|
|
1567
|
+
type: Component,
|
|
1568
|
+
args: [{
|
|
1569
|
+
selector: 'ace-editor',
|
|
1570
|
+
template: '',
|
|
1571
|
+
styles: [':host { display:block;width:100%; }'],
|
|
1572
|
+
providers: [{
|
|
1573
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1574
|
+
useExisting: forwardRef(() => AceEditorComponent),
|
|
1575
|
+
multi: true
|
|
1576
|
+
}]
|
|
1577
|
+
}]
|
|
1578
|
+
}], function () { return [{ type: ElementRef }, { type: NgZone }]; }, { textChanged: [{
|
|
1579
|
+
type: Output
|
|
1580
|
+
}], textChange: [{
|
|
1581
|
+
type: Output
|
|
1582
|
+
}], style: [{
|
|
1583
|
+
type: Input
|
|
1584
|
+
}], options: [{
|
|
1585
|
+
type: Input
|
|
1586
|
+
}], readOnly: [{
|
|
1587
|
+
type: Input
|
|
1588
|
+
}], theme: [{
|
|
1589
|
+
type: Input
|
|
1590
|
+
}], mode: [{
|
|
1591
|
+
type: Input
|
|
1592
|
+
}], value: [{
|
|
1593
|
+
type: Input
|
|
1594
|
+
}], text: [{
|
|
1595
|
+
type: Input
|
|
1596
|
+
}], autoUpdateContent: [{
|
|
1597
|
+
type: Input
|
|
1598
|
+
}], durationBeforeCallback: [{
|
|
1599
|
+
type: Input
|
|
1600
|
+
}] }); })();
|
|
1601
|
+
|
|
1602
|
+
/* tslint:disable */
|
|
1603
|
+
class AceEditorDirective {
|
|
1604
|
+
constructor(elementRef, zone) {
|
|
1605
|
+
this.zone = zone;
|
|
1606
|
+
this.textChanged = new EventEmitter();
|
|
1607
|
+
this.textChange = new EventEmitter();
|
|
1608
|
+
this._options = {};
|
|
1609
|
+
this._readOnly = false;
|
|
1610
|
+
this._theme = 'monokai';
|
|
1611
|
+
this._mode = 'html';
|
|
1612
|
+
this._autoUpdateContent = true;
|
|
1613
|
+
this._durationBeforeCallback = 0;
|
|
1614
|
+
this._text = '';
|
|
1615
|
+
const el = elementRef.nativeElement;
|
|
1616
|
+
this.zone.runOutsideAngular(() => {
|
|
1617
|
+
this.editor = ace['edit'](el);
|
|
1618
|
+
});
|
|
1619
|
+
this.editor.$blockScrolling = Infinity;
|
|
1620
|
+
}
|
|
1621
|
+
ngOnInit() {
|
|
1622
|
+
this.init();
|
|
1623
|
+
this.initEvents();
|
|
1624
|
+
}
|
|
1625
|
+
ngOnDestroy() {
|
|
1626
|
+
this.editor.destroy();
|
|
1627
|
+
}
|
|
1628
|
+
init() {
|
|
1629
|
+
this.editor.setOptions(this._options || {});
|
|
1630
|
+
this.editor.setTheme(`ace/theme/${this._theme}`);
|
|
1631
|
+
this.setMode(this._mode);
|
|
1632
|
+
this.editor.setReadOnly(this._readOnly);
|
|
1633
|
+
}
|
|
1634
|
+
initEvents() {
|
|
1635
|
+
this.editor.on('change', () => this.updateText());
|
|
1636
|
+
this.editor.on('paste', () => this.updateText());
|
|
1637
|
+
}
|
|
1638
|
+
updateText() {
|
|
1639
|
+
const newVal = this.editor.getValue();
|
|
1640
|
+
if (newVal === this.oldText) {
|
|
1641
|
+
return;
|
|
1642
|
+
}
|
|
1643
|
+
if (!this._durationBeforeCallback) {
|
|
1644
|
+
this._text = newVal;
|
|
1645
|
+
this.zone.run(() => {
|
|
1646
|
+
this.textChange.emit(newVal);
|
|
1647
|
+
this.textChanged.emit(newVal);
|
|
1648
|
+
});
|
|
1649
|
+
}
|
|
1650
|
+
else {
|
|
1651
|
+
if (this.timeoutSaving != null) {
|
|
1652
|
+
clearTimeout(this.timeoutSaving);
|
|
1653
|
+
}
|
|
1654
|
+
this.timeoutSaving = setTimeout(() => {
|
|
1655
|
+
this._text = newVal;
|
|
1656
|
+
this.zone.run(() => {
|
|
1657
|
+
this.textChange.emit(newVal);
|
|
1658
|
+
this.textChanged.emit(newVal);
|
|
1659
|
+
});
|
|
1660
|
+
this.timeoutSaving = null;
|
|
1661
|
+
}, this._durationBeforeCallback);
|
|
1662
|
+
}
|
|
1663
|
+
this.oldText = newVal;
|
|
1664
|
+
}
|
|
1665
|
+
set options(options) {
|
|
1666
|
+
this._options = options;
|
|
1667
|
+
this.editor.setOptions(options || {});
|
|
1668
|
+
}
|
|
1669
|
+
set readOnly(readOnly) {
|
|
1670
|
+
this._readOnly = readOnly;
|
|
1671
|
+
this.editor.setReadOnly(readOnly);
|
|
1672
|
+
}
|
|
1673
|
+
set theme(theme) {
|
|
1674
|
+
this._theme = theme;
|
|
1675
|
+
this.editor.setTheme(`ace/theme/${theme}`);
|
|
1676
|
+
}
|
|
1677
|
+
set mode(mode) {
|
|
1678
|
+
this.setMode(mode);
|
|
1679
|
+
}
|
|
1680
|
+
setMode(mode) {
|
|
1681
|
+
this._mode = mode;
|
|
1682
|
+
if (typeof this._mode === 'object') {
|
|
1683
|
+
this.editor.getSession().setMode(this._mode);
|
|
1684
|
+
}
|
|
1685
|
+
else {
|
|
1686
|
+
this.editor.getSession().setMode(`ace/mode/${this._mode}`);
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
// @ts-ignore
|
|
1690
|
+
get text() {
|
|
1691
|
+
return this._text;
|
|
1692
|
+
}
|
|
1693
|
+
set text(text) {
|
|
1694
|
+
this.setText(text);
|
|
1695
|
+
}
|
|
1696
|
+
setText(text) {
|
|
1697
|
+
if (this._text !== text) {
|
|
1698
|
+
if (text === null || text === undefined) {
|
|
1699
|
+
text = '';
|
|
1700
|
+
}
|
|
1701
|
+
if (this._autoUpdateContent) {
|
|
1702
|
+
this._text = text;
|
|
1703
|
+
this.editor.setValue(text);
|
|
1704
|
+
this.editor.clearSelection();
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
set autoUpdateContent(status) {
|
|
1709
|
+
this._autoUpdateContent = status;
|
|
1710
|
+
}
|
|
1711
|
+
set durationBeforeCallback(num) {
|
|
1712
|
+
this.setDurationBeforeCallback(num);
|
|
1713
|
+
}
|
|
1714
|
+
setDurationBeforeCallback(num) {
|
|
1715
|
+
this._durationBeforeCallback = num;
|
|
1716
|
+
}
|
|
1717
|
+
get aceEditor() {
|
|
1718
|
+
return this.editor;
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
AceEditorDirective.ɵfac = function AceEditorDirective_Factory(t) { return new (t || AceEditorDirective)(ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(NgZone)); };
|
|
1722
|
+
AceEditorDirective.ɵdir = ɵɵdefineDirective({ type: AceEditorDirective, selectors: [["", "ace-editor", ""]], inputs: { options: "options", readOnly: "readOnly", theme: "theme", mode: "mode", text: "text", autoUpdateContent: "autoUpdateContent", durationBeforeCallback: "durationBeforeCallback" }, outputs: { textChanged: "textChanged", textChange: "textChange" } });
|
|
1723
|
+
/*@__PURE__*/ (function () { ɵsetClassMetadata(AceEditorDirective, [{
|
|
1724
|
+
type: Directive,
|
|
1725
|
+
args: [{
|
|
1726
|
+
selector: '[ace-editor]'
|
|
1727
|
+
}]
|
|
1728
|
+
}], function () { return [{ type: ElementRef }, { type: NgZone }]; }, { textChanged: [{
|
|
1729
|
+
type: Output
|
|
1730
|
+
}], textChange: [{
|
|
1731
|
+
type: Output
|
|
1732
|
+
}], options: [{
|
|
1733
|
+
type: Input
|
|
1734
|
+
}], readOnly: [{
|
|
1735
|
+
type: Input
|
|
1736
|
+
}], theme: [{
|
|
1737
|
+
type: Input
|
|
1738
|
+
}], mode: [{
|
|
1739
|
+
type: Input
|
|
1740
|
+
}], text: [{
|
|
1741
|
+
type: Input
|
|
1742
|
+
}], autoUpdateContent: [{
|
|
1743
|
+
type: Input
|
|
1744
|
+
}], durationBeforeCallback: [{
|
|
1745
|
+
type: Input
|
|
1746
|
+
}] }); })();
|
|
1747
|
+
|
|
1380
1748
|
class InputsModule {
|
|
1381
1749
|
}
|
|
1382
1750
|
InputsModule.ɵmod = ɵɵdefineNgModule({ type: InputsModule });
|
|
@@ -1405,7 +1773,9 @@ InputsModule.ɵinj = ɵɵdefineInjector({ factory: function InputsModule_Factory
|
|
|
1405
1773
|
InputAvatarComponent,
|
|
1406
1774
|
InputFileComponent,
|
|
1407
1775
|
CustomSelectComponent,
|
|
1408
|
-
FieldComponent
|
|
1776
|
+
FieldComponent,
|
|
1777
|
+
AceEditorComponent,
|
|
1778
|
+
AceEditorDirective], imports: [RouterModule, CommonModule,
|
|
1409
1779
|
FormsModule,
|
|
1410
1780
|
MatFormFieldModule,
|
|
1411
1781
|
MatInputModule,
|
|
@@ -1425,7 +1795,9 @@ InputsModule.ɵinj = ɵɵdefineInjector({ factory: function InputsModule_Factory
|
|
|
1425
1795
|
InputAvatarComponent,
|
|
1426
1796
|
InputFileComponent,
|
|
1427
1797
|
CustomSelectComponent,
|
|
1428
|
-
FieldComponent
|
|
1798
|
+
FieldComponent,
|
|
1799
|
+
AceEditorComponent,
|
|
1800
|
+
AceEditorDirective] }); })();
|
|
1429
1801
|
/*@__PURE__*/ (function () { ɵsetClassMetadata(InputsModule, [{
|
|
1430
1802
|
type: NgModule,
|
|
1431
1803
|
args: [{
|
|
@@ -1455,7 +1827,9 @@ InputsModule.ɵinj = ɵɵdefineInjector({ factory: function InputsModule_Factory
|
|
|
1455
1827
|
InputAvatarComponent,
|
|
1456
1828
|
InputFileComponent,
|
|
1457
1829
|
CustomSelectComponent,
|
|
1458
|
-
FieldComponent
|
|
1830
|
+
FieldComponent,
|
|
1831
|
+
AceEditorComponent,
|
|
1832
|
+
AceEditorDirective
|
|
1459
1833
|
],
|
|
1460
1834
|
exports: [
|
|
1461
1835
|
SelectBoxComponent,
|
|
@@ -1465,7 +1839,9 @@ InputsModule.ɵinj = ɵɵdefineInjector({ factory: function InputsModule_Factory
|
|
|
1465
1839
|
InputAvatarComponent,
|
|
1466
1840
|
InputFileComponent,
|
|
1467
1841
|
CustomSelectComponent,
|
|
1468
|
-
FieldComponent
|
|
1842
|
+
FieldComponent,
|
|
1843
|
+
AceEditorComponent,
|
|
1844
|
+
AceEditorDirective
|
|
1469
1845
|
],
|
|
1470
1846
|
providers: [],
|
|
1471
1847
|
}]
|
|
@@ -1475,5 +1851,5 @@ InputsModule.ɵinj = ɵɵdefineInjector({ factory: function InputsModule_Factory
|
|
|
1475
1851
|
* Generated bundle index. Do not edit.
|
|
1476
1852
|
*/
|
|
1477
1853
|
|
|
1478
|
-
export { CustomSelectComponent, CustomSelectItem, FieldComponent, InputAvatarComponent, InputFileComponent, InputPasswordComponent, InputTextComponent, InputsModule, SelectBoxComponent, SelectEnumComponent };
|
|
1854
|
+
export { AceEditorComponent, AceEditorDirective, CustomSelectComponent, CustomSelectItem, FieldComponent, InputAvatarComponent, InputFileComponent, InputPasswordComponent, InputTextComponent, InputsModule, SelectBoxComponent, SelectEnumComponent };
|
|
1479
1855
|
//# sourceMappingURL=apipass-inputs.js.map
|