@acorex/components 20.2.0-next.9 → 20.2.1
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/accordion/index.d.ts +6 -5
- package/action-sheet/index.d.ts +1 -10
- package/alert/index.d.ts +1 -3
- package/aspect-ratio/README.md +3 -0
- package/aspect-ratio/index.d.ts +11 -0
- package/autocomplete/index.d.ts +6 -2
- package/avatar/index.d.ts +1 -2
- package/badge/index.d.ts +1 -2
- package/bottom-navigation/index.d.ts +10 -2
- package/breadcrumbs/index.d.ts +2 -3
- package/button/index.d.ts +56 -17
- package/button-group/index.d.ts +10 -6
- package/calendar/index.d.ts +9 -9
- package/check-box/index.d.ts +1 -4
- package/chips/index.d.ts +1 -2
- package/circular-progress/index.d.ts +23 -18
- package/code-editor/README.md +3 -0
- package/code-editor/index.d.ts +103 -0
- package/collapse/index.d.ts +7 -6
- package/color-box/index.d.ts +5 -8
- package/color-palette/index.d.ts +19 -24
- package/command/README.md +3 -0
- package/command/index.d.ts +60 -0
- package/comment/index.d.ts +15 -10
- package/conversation/index.d.ts +106 -78
- package/data-list/README.md +356 -0
- package/data-list/index.d.ts +102 -0
- package/data-pager/index.d.ts +22 -17
- package/data-table/index.d.ts +59 -3
- package/datetime-box/index.d.ts +11 -15
- package/datetime-input/index.d.ts +1 -4
- package/datetime-picker/index.d.ts +4 -11
- package/decorators/index.d.ts +2 -2
- package/dialog/index.d.ts +29 -4
- package/drawer-2/index.d.ts +22 -8
- package/dropdown/index.d.ts +44 -3
- package/dropdown-button/index.d.ts +7 -2
- package/fesm2022/acorex-components-accordion.mjs +74 -72
- package/fesm2022/acorex-components-accordion.mjs.map +1 -1
- package/fesm2022/acorex-components-action-sheet.mjs +22 -48
- package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2022/acorex-components-alert.mjs +12 -16
- package/fesm2022/acorex-components-alert.mjs.map +1 -1
- package/fesm2022/acorex-components-aspect-ratio.mjs +36 -0
- package/fesm2022/acorex-components-aspect-ratio.mjs.map +1 -0
- package/fesm2022/acorex-components-audio-wave.mjs +7 -7
- package/fesm2022/acorex-components-audio-wave.mjs.map +1 -1
- package/fesm2022/acorex-components-autocomplete.mjs +25 -10
- package/fesm2022/acorex-components-autocomplete.mjs.map +1 -1
- package/fesm2022/acorex-components-avatar.mjs +13 -17
- package/fesm2022/acorex-components-avatar.mjs.map +1 -1
- package/fesm2022/acorex-components-badge.mjs +9 -11
- package/fesm2022/acorex-components-badge.mjs.map +1 -1
- package/fesm2022/acorex-components-bottom-navigation.mjs +18 -16
- package/fesm2022/acorex-components-bottom-navigation.mjs.map +1 -1
- package/fesm2022/acorex-components-breadcrumbs.mjs +21 -20
- package/fesm2022/acorex-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/acorex-components-button-group.mjs +35 -26
- package/fesm2022/acorex-components-button-group.mjs.map +1 -1
- package/fesm2022/acorex-components-button.mjs +78 -38
- package/fesm2022/acorex-components-button.mjs.map +1 -1
- package/fesm2022/acorex-components-calendar.mjs +52 -41
- package/fesm2022/acorex-components-calendar.mjs.map +1 -1
- package/fesm2022/acorex-components-check-box.mjs +10 -13
- package/fesm2022/acorex-components-check-box.mjs.map +1 -1
- package/fesm2022/acorex-components-chips.mjs +9 -11
- package/fesm2022/acorex-components-chips.mjs.map +1 -1
- package/fesm2022/acorex-components-circular-progress.mjs +31 -26
- package/fesm2022/acorex-components-circular-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-code-editor.mjs +591 -0
- package/fesm2022/acorex-components-code-editor.mjs.map +1 -0
- package/fesm2022/acorex-components-collapse.mjs +21 -21
- package/fesm2022/acorex-components-collapse.mjs.map +1 -1
- package/fesm2022/acorex-components-color-box.mjs +32 -32
- package/fesm2022/acorex-components-color-box.mjs.map +1 -1
- package/fesm2022/acorex-components-color-palette.mjs +68 -84
- package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
- package/fesm2022/acorex-components-command.mjs +144 -0
- package/fesm2022/acorex-components-command.mjs.map +1 -0
- package/fesm2022/acorex-components-comment.mjs +47 -41
- package/fesm2022/acorex-components-comment.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation.mjs +121 -89
- package/fesm2022/acorex-components-conversation.mjs.map +1 -1
- package/fesm2022/acorex-components-cron-job.mjs +46 -46
- package/fesm2022/acorex-components-cron-job.mjs.map +1 -1
- package/fesm2022/acorex-components-data-list.mjs +386 -0
- package/fesm2022/acorex-components-data-list.mjs.map +1 -0
- package/fesm2022/acorex-components-data-pager.mjs +41 -36
- package/fesm2022/acorex-components-data-pager.mjs.map +1 -1
- package/fesm2022/acorex-components-data-table.mjs +97 -41
- package/fesm2022/acorex-components-data-table.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-box.mjs +21 -35
- package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-input.mjs +13 -17
- package/fesm2022/acorex-components-datetime-input.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-picker.mjs +44 -46
- package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-decorators.mjs +27 -27
- package/fesm2022/acorex-components-decorators.mjs.map +1 -1
- package/fesm2022/acorex-components-dialog.mjs +44 -19
- package/fesm2022/acorex-components-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-drawer-2.mjs +28 -14
- package/fesm2022/acorex-components-drawer-2.mjs.map +1 -1
- package/fesm2022/acorex-components-drawer.mjs +13 -13
- package/fesm2022/acorex-components-drawer.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown-button.mjs +16 -11
- package/fesm2022/acorex-components-dropdown-button.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown.mjs +57 -13
- package/fesm2022/acorex-components-dropdown.mjs.map +1 -1
- package/fesm2022/acorex-components-file-explorer.mjs +25 -25
- package/fesm2022/acorex-components-file-explorer.mjs.map +1 -1
- package/fesm2022/acorex-components-flow-chart.mjs +40 -16
- package/fesm2022/acorex-components-flow-chart.mjs.map +1 -1
- package/fesm2022/acorex-components-form.mjs +36 -17
- package/fesm2022/acorex-components-form.mjs.map +1 -1
- package/fesm2022/acorex-components-grid-layout-builder.mjs +125 -15
- package/fesm2022/acorex-components-grid-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-image-editor.mjs +115 -92
- package/fesm2022/acorex-components-image-editor.mjs.map +1 -1
- package/fesm2022/acorex-components-image.mjs +7 -7
- package/fesm2022/acorex-components-image.mjs.map +1 -1
- package/fesm2022/acorex-components-json-viewer.mjs +8 -8
- package/fesm2022/acorex-components-json-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-kanban.mjs +11 -7
- package/fesm2022/acorex-components-kanban.mjs.map +1 -1
- package/fesm2022/acorex-components-kbd.mjs +21 -29
- package/fesm2022/acorex-components-kbd.mjs.map +1 -1
- package/fesm2022/acorex-components-label.mjs +11 -15
- package/fesm2022/acorex-components-label.mjs.map +1 -1
- package/fesm2022/acorex-components-list.mjs +17 -28
- package/fesm2022/acorex-components-list.mjs.map +1 -1
- package/fesm2022/acorex-components-loading-dialog.mjs +58 -59
- package/fesm2022/acorex-components-loading-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-loading.mjs +84 -28
- package/fesm2022/acorex-components-loading.mjs.map +1 -1
- package/fesm2022/acorex-components-map.mjs +484 -112
- package/fesm2022/acorex-components-map.mjs.map +1 -1
- package/fesm2022/acorex-components-media-viewer.mjs +47 -37
- package/fesm2022/acorex-components-media-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-menu.mjs +67 -37
- package/fesm2022/acorex-components-menu.mjs.map +1 -1
- package/fesm2022/{acorex-components-modal-acorex-components-modal-C4zx7OP6.mjs → acorex-components-modal-acorex-components-modal-h5Y-qcbh.mjs} +117 -40
- package/fesm2022/acorex-components-modal-acorex-components-modal-h5Y-qcbh.mjs.map +1 -0
- package/fesm2022/acorex-components-modal-modal-content.component-B6tyMLdU.mjs +235 -0
- package/fesm2022/acorex-components-modal-modal-content.component-B6tyMLdU.mjs.map +1 -0
- package/fesm2022/acorex-components-modal.mjs +1 -1
- package/fesm2022/acorex-components-navbar.mjs +14 -10
- package/fesm2022/acorex-components-navbar.mjs.map +1 -1
- package/fesm2022/acorex-components-notification.mjs +31 -45
- package/fesm2022/acorex-components-notification.mjs.map +1 -1
- package/fesm2022/acorex-components-number-box-2.mjs +18 -5
- package/fesm2022/acorex-components-number-box-2.mjs.map +1 -1
- package/fesm2022/acorex-components-number-box.mjs +7 -7
- package/fesm2022/acorex-components-number-box.mjs.map +1 -1
- package/fesm2022/acorex-components-otp.mjs +14 -15
- package/fesm2022/acorex-components-otp.mjs.map +1 -1
- package/fesm2022/acorex-components-page.mjs +10 -10
- package/fesm2022/acorex-components-page.mjs.map +1 -1
- package/fesm2022/acorex-components-paint.mjs +68 -33
- package/fesm2022/acorex-components-paint.mjs.map +1 -1
- package/fesm2022/acorex-components-password-box.mjs +15 -18
- package/fesm2022/acorex-components-password-box.mjs.map +1 -1
- package/fesm2022/acorex-components-pdf-reader.mjs +7 -7
- package/fesm2022/acorex-components-pdf-reader.mjs.map +1 -1
- package/fesm2022/acorex-components-phone-box.mjs +44 -14
- package/fesm2022/acorex-components-phone-box.mjs.map +1 -1
- package/fesm2022/acorex-components-picker.mjs +13 -13
- package/fesm2022/acorex-components-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-popover.mjs +13 -18
- package/fesm2022/acorex-components-popover.mjs.map +1 -1
- package/fesm2022/acorex-components-popup.mjs +10 -10
- package/fesm2022/acorex-components-popup.mjs.map +1 -1
- package/fesm2022/acorex-components-progress-bar.mjs +8 -8
- package/fesm2022/acorex-components-progress-bar.mjs.map +1 -1
- package/fesm2022/acorex-components-qrcode.mjs +7 -7
- package/fesm2022/acorex-components-qrcode.mjs.map +1 -1
- package/fesm2022/acorex-components-query-builder.mjs +7 -7
- package/fesm2022/acorex-components-query-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-radio.mjs +7 -7
- package/fesm2022/acorex-components-radio.mjs.map +1 -1
- package/fesm2022/acorex-components-rail-navigation.mjs +26 -16
- package/fesm2022/acorex-components-rail-navigation.mjs.map +1 -1
- package/fesm2022/acorex-components-range-slider.mjs +13 -9
- package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-rate-picker.mjs +7 -7
- package/fesm2022/acorex-components-rate-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-rest-api-generator.mjs +23 -23
- package/fesm2022/acorex-components-rest-api-generator.mjs.map +1 -1
- package/fesm2022/acorex-components-result.mjs +7 -7
- package/fesm2022/acorex-components-result.mjs.map +1 -1
- package/fesm2022/acorex-components-routing-progress.mjs +7 -7
- package/fesm2022/acorex-components-routing-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-rrule.mjs +222 -102
- package/fesm2022/acorex-components-rrule.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler.mjs +1581 -167
- package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
- package/fesm2022/acorex-components-scss.mjs +4 -4
- package/fesm2022/acorex-components-scss.mjs.map +1 -1
- package/fesm2022/acorex-components-search-box.mjs +7 -7
- package/fesm2022/acorex-components-search-box.mjs.map +1 -1
- package/fesm2022/acorex-components-select-box.mjs +70 -28
- package/fesm2022/acorex-components-select-box.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list-2.mjs +12 -9
- package/fesm2022/acorex-components-selection-list-2.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list.mjs +14 -11
- package/fesm2022/acorex-components-selection-list.mjs.map +1 -1
- package/fesm2022/acorex-components-side-menu.mjs +98 -43
- package/fesm2022/acorex-components-side-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-skeleton.mjs +7 -7
- package/fesm2022/acorex-components-skeleton.mjs.map +1 -1
- package/fesm2022/acorex-components-slider.mjs +9 -9
- package/fesm2022/acorex-components-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-sliding-item.mjs +16 -16
- package/fesm2022/acorex-components-sliding-item.mjs.map +1 -1
- package/fesm2022/acorex-components-step-wizard.mjs +31 -32
- package/fesm2022/acorex-components-step-wizard.mjs.map +1 -1
- package/fesm2022/acorex-components-switch.mjs +12 -12
- package/fesm2022/acorex-components-switch.mjs.map +1 -1
- package/fesm2022/acorex-components-tabs.mjs +20 -15
- package/fesm2022/acorex-components-tabs.mjs.map +1 -1
- package/fesm2022/acorex-components-tag-box.mjs +47 -19
- package/fesm2022/acorex-components-tag-box.mjs.map +1 -1
- package/fesm2022/acorex-components-tag.mjs +8 -8
- package/fesm2022/acorex-components-tag.mjs.map +1 -1
- package/fesm2022/acorex-components-text-area.mjs +8 -9
- package/fesm2022/acorex-components-text-area.mjs.map +1 -1
- package/fesm2022/acorex-components-text-box.mjs +22 -12
- package/fesm2022/acorex-components-text-box.mjs.map +1 -1
- package/fesm2022/acorex-components-time-duration.mjs +7 -7
- package/fesm2022/acorex-components-time-duration.mjs.map +1 -1
- package/fesm2022/acorex-components-time-line.mjs +13 -10
- package/fesm2022/acorex-components-time-line.mjs.map +1 -1
- package/fesm2022/acorex-components-toast.mjs +59 -14
- package/fesm2022/acorex-components-toast.mjs.map +1 -1
- package/fesm2022/acorex-components-toolbar.mjs +7 -7
- package/fesm2022/acorex-components-toolbar.mjs.map +1 -1
- package/fesm2022/acorex-components-tooltip.mjs +12 -11
- package/fesm2022/acorex-components-tooltip.mjs.map +1 -1
- package/fesm2022/acorex-components-tree-view.mjs +12 -12
- package/fesm2022/acorex-components-tree-view.mjs.map +1 -1
- package/fesm2022/acorex-components-uploader.mjs +252 -56
- package/fesm2022/acorex-components-uploader.mjs.map +1 -1
- package/fesm2022/acorex-components-video-player.mjs +7 -7
- package/fesm2022/acorex-components-video-player.mjs.map +1 -1
- package/fesm2022/acorex-components-wysiwyg.mjs +96 -60
- package/fesm2022/acorex-components-wysiwyg.mjs.map +1 -1
- package/flow-chart/index.d.ts +24 -0
- package/form/index.d.ts +27 -13
- package/grid-layout-builder/index.d.ts +115 -4
- package/image/index.d.ts +4 -4
- package/image-editor/index.d.ts +16 -14
- package/json-viewer/index.d.ts +3 -3
- package/kanban/index.d.ts +7 -3
- package/kbd/index.d.ts +11 -11
- package/label/index.d.ts +1 -2
- package/list/index.d.ts +4 -14
- package/loading/index.d.ts +59 -6
- package/loading-dialog/index.d.ts +30 -19
- package/map/index.d.ts +95 -2
- package/menu/index.d.ts +38 -13
- package/modal/index.d.ts +47 -2
- package/navbar/index.d.ts +7 -3
- package/notification/index.d.ts +1 -8
- package/number-box-2/index.d.ts +1 -1
- package/otp/index.d.ts +1 -3
- package/package.json +43 -4
- package/paint/index.d.ts +42 -7
- package/password-box/index.d.ts +7 -10
- package/phone-box/index.d.ts +17 -16
- package/popover/index.d.ts +2 -2
- package/popup/index.d.ts +2 -2
- package/qrcode/index.d.ts +7 -7
- package/query-builder/index.d.ts +1 -1
- package/rail-navigation/index.d.ts +12 -3
- package/range-slider/index.d.ts +13 -13
- package/rate-picker/index.d.ts +5 -5
- package/rest-api-generator/index.d.ts +1 -1
- package/rrule/index.d.ts +40 -17
- package/scheduler/index.d.ts +541 -191
- package/search-box/index.d.ts +2 -2
- package/select-box/index.d.ts +13 -4
- package/selection-list-2/index.d.ts +3 -3
- package/side-menu/index.d.ts +24 -15
- package/sliding-item/index.d.ts +4 -5
- package/step-wizard/index.d.ts +10 -13
- package/switch/index.d.ts +0 -1
- package/tabs/index.d.ts +6 -1
- package/tag-box/index.d.ts +18 -2
- package/text-area/index.d.ts +1 -2
- package/text-box/index.d.ts +2 -0
- package/time-line/index.d.ts +3 -0
- package/toast/index.d.ts +45 -1
- package/tooltip/index.d.ts +2 -1
- package/uploader/index.d.ts +215 -5
- package/wysiwyg/index.d.ts +26 -5
- package/fesm2022/acorex-components-modal-acorex-components-modal-C4zx7OP6.mjs.map +0 -1
- package/fesm2022/acorex-components-modal-modal-content.component-DfhgA_WL.mjs +0 -218
- package/fesm2022/acorex-components-modal-modal-content.component-DfhgA_WL.mjs.map +0 -1
@@ -0,0 +1,591 @@
|
|
1
|
+
import { MXValueComponent, AXValuableComponent, AXComponent } from '@acorex/cdk/common';
|
2
|
+
import { AXPlatform } from '@acorex/core/platform';
|
3
|
+
import { isPlatformBrowser, CommonModule } from '@angular/common';
|
4
|
+
import * as i0 from '@angular/core';
|
5
|
+
import { input, output, viewChild, inject, PLATFORM_ID, DestroyRef, signal, computed, afterNextRender, effect, forwardRef, Component, NgModule } from '@angular/core';
|
6
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
7
|
+
|
8
|
+
class AXCodeEditorComponent extends MXValueComponent {
|
9
|
+
constructor() {
|
10
|
+
super();
|
11
|
+
// Inputs (signals)
|
12
|
+
// value = input<string>('');
|
13
|
+
/** Active language mode. Default: 'javascript'. */
|
14
|
+
this.language = input('javascript', ...(ngDevMode ? [{ debugName: "language" }] : []));
|
15
|
+
/** When true, the editor becomes readonly (non-editable). */
|
16
|
+
this.readOnly = input(false, ...(ngDevMode ? [{ debugName: "readOnly" }] : []));
|
17
|
+
/** Placeholder text shown when the document is empty. */
|
18
|
+
this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
19
|
+
/** Toggle rendering of line numbers in the gutter. */
|
20
|
+
this.lineNumbers = input(true, ...(ngDevMode ? [{ debugName: "lineNumbers" }] : []));
|
21
|
+
/** Soft-wrap long lines when true. */
|
22
|
+
this.lineWrapping = input(false, ...(ngDevMode ? [{ debugName: "lineWrapping" }] : []));
|
23
|
+
/** Tab size (spaces per indent level). */
|
24
|
+
this.tabSize = input(2, ...(ngDevMode ? [{ debugName: "tabSize" }] : []));
|
25
|
+
/** When true, the Tab key indents instead of moving focus. */
|
26
|
+
this.indentWithTab = input(true, ...(ngDevMode ? [{ debugName: "indentWithTab" }] : []));
|
27
|
+
/** Fixed height for the editor (e.g., '320px'). */
|
28
|
+
this.height = input(null, ...(ngDevMode ? [{ debugName: "height" }] : []));
|
29
|
+
/** Minimum height for the editor. */
|
30
|
+
this.minHeight = input(null, ...(ngDevMode ? [{ debugName: "minHeight" }] : []));
|
31
|
+
/** Maximum height for the editor. */
|
32
|
+
this.maxHeight = input(null, ...(ngDevMode ? [{ debugName: "maxHeight" }] : []));
|
33
|
+
// Theme follows platform theme mode; no input
|
34
|
+
/** Additional CodeMirror extensions to apply. Reconfigures at runtime. */
|
35
|
+
this.extensions = input([], ...(ngDevMode ? [{ debugName: "extensions" }] : []));
|
36
|
+
/** ARIA label for accessibility. */
|
37
|
+
this.ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
38
|
+
/** Focus the editor after first render. */
|
39
|
+
this.focusOnReady = input(false, ...(ngDevMode ? [{ debugName: "focusOnReady" }] : []));
|
40
|
+
/** If true, format the document via Prettier before emitting save. */
|
41
|
+
this.formatOnSave = input(false, ...(ngDevMode ? [{ debugName: "formatOnSave" }] : []));
|
42
|
+
/**
|
43
|
+
* Custom autocompletion options: either a static array of Completion items
|
44
|
+
* or a CodeMirror CompletionSource function.
|
45
|
+
*/
|
46
|
+
this.customCompletions = input(null, ...(ngDevMode ? [{ debugName: "customCompletions" }] : []));
|
47
|
+
// Outputs (signals)
|
48
|
+
// valueChange = output<string>();
|
49
|
+
/** Emits when the editor is fully initialized and ready. */
|
50
|
+
this.ready = output();
|
51
|
+
/** Emits when the user triggers save (Ctrl/Cmd+S). Payload is the current text. */
|
52
|
+
this.save = output();
|
53
|
+
// View container
|
54
|
+
this.host = viewChild('host', ...(ngDevMode ? [{ debugName: "host" }] : []));
|
55
|
+
// Runtime state
|
56
|
+
this.platformId = inject(PLATFORM_ID);
|
57
|
+
this.destroyRef = inject(DestroyRef);
|
58
|
+
this.platformService = inject(AXPlatform);
|
59
|
+
this.editorViewSig = signal(null, ...(ngDevMode ? [{ debugName: "editorViewSig" }] : []));
|
60
|
+
// Compartments to reconfigure editor without recreating it
|
61
|
+
this.languageCompartment = null;
|
62
|
+
this.readOnlyCompartment = null;
|
63
|
+
this.themeCompartment = null;
|
64
|
+
this.placeholderCompartment = null;
|
65
|
+
this.wrappingCompartment = null;
|
66
|
+
this.keymapExtrasCompartment = null;
|
67
|
+
this.tabSizeCompartment = null;
|
68
|
+
this.lineNumbersCompartment = null;
|
69
|
+
// Cached CodeMirror modules after initialization
|
70
|
+
this.cm = { view: null, state: null, language: null, autocomplete: null, commands: null, search: null, lint: null };
|
71
|
+
this.isBrowser = computed(() => isPlatformBrowser(this.platformId), ...(ngDevMode ? [{ debugName: "isBrowser" }] : []));
|
72
|
+
afterNextRender(() => {
|
73
|
+
if (!this.isBrowser())
|
74
|
+
return;
|
75
|
+
this.initializeEditor();
|
76
|
+
});
|
77
|
+
// Keep model in sync when external value changes
|
78
|
+
effect(() => {
|
79
|
+
const view = this.editorViewSig();
|
80
|
+
if (!view)
|
81
|
+
return;
|
82
|
+
const newDoc = this.value ?? '';
|
83
|
+
const current = view.state.doc.toString();
|
84
|
+
if (newDoc !== current) {
|
85
|
+
view.dispatch({
|
86
|
+
changes: { from: 0, to: view.state.doc.length, insert: newDoc },
|
87
|
+
});
|
88
|
+
}
|
89
|
+
});
|
90
|
+
// React to dynamic configuration changes
|
91
|
+
effect(() => {
|
92
|
+
const view = this.editorViewSig();
|
93
|
+
if (!view || !this.languageCompartment)
|
94
|
+
return;
|
95
|
+
const lang = this.language();
|
96
|
+
this.resolveLanguageExtension(lang).then((ext) => {
|
97
|
+
if (!view || !this.languageCompartment)
|
98
|
+
return;
|
99
|
+
view.dispatch({ effects: this.languageCompartment.reconfigure(ext) });
|
100
|
+
});
|
101
|
+
});
|
102
|
+
effect(() => {
|
103
|
+
const view = this.editorViewSig();
|
104
|
+
if (!view || !this.readOnlyCompartment)
|
105
|
+
return;
|
106
|
+
const editable = !this.readOnly();
|
107
|
+
import('@codemirror/view').then(({ EditorView }) => {
|
108
|
+
if (!view || !this.readOnlyCompartment)
|
109
|
+
return;
|
110
|
+
view.dispatch({ effects: this.readOnlyCompartment.reconfigure(EditorView.editable.of(editable)) });
|
111
|
+
});
|
112
|
+
});
|
113
|
+
effect(() => {
|
114
|
+
const view = this.editorViewSig();
|
115
|
+
// Establish reactive dependency on platform theme
|
116
|
+
// Create a reactive dependency to platform theme
|
117
|
+
void this.platformService.themeMode();
|
118
|
+
if (!view || !this.themeCompartment)
|
119
|
+
return;
|
120
|
+
this.resolveThemeExtension().then((themeExt) => {
|
121
|
+
if (!view || !this.themeCompartment)
|
122
|
+
return;
|
123
|
+
view.dispatch({ effects: this.themeCompartment.reconfigure(themeExt) });
|
124
|
+
});
|
125
|
+
});
|
126
|
+
effect(() => {
|
127
|
+
this.placeholder();
|
128
|
+
const view = this.editorViewSig();
|
129
|
+
if (!view || !this.placeholderCompartment)
|
130
|
+
return;
|
131
|
+
import('@codemirror/view').then(({ placeholder }) => {
|
132
|
+
if (!view || !this.placeholderCompartment)
|
133
|
+
return;
|
134
|
+
view.dispatch({ effects: this.placeholderCompartment.reconfigure(placeholder(this.placeholder() ?? '')) });
|
135
|
+
});
|
136
|
+
});
|
137
|
+
effect(() => {
|
138
|
+
const view = this.editorViewSig();
|
139
|
+
if (!view || !this.wrappingCompartment)
|
140
|
+
return;
|
141
|
+
const EditorView = this.cm.view?.EditorView;
|
142
|
+
if (!EditorView)
|
143
|
+
return;
|
144
|
+
const nextExt = this.lineWrapping() ? EditorView.lineWrapping : [];
|
145
|
+
this.reconfigure(this.wrappingCompartment, nextExt);
|
146
|
+
});
|
147
|
+
effect(() => {
|
148
|
+
const view = this.editorViewSig();
|
149
|
+
if (!view || !this.tabSizeCompartment)
|
150
|
+
return;
|
151
|
+
const EditorState = this.cm.state?.EditorState;
|
152
|
+
if (!EditorState)
|
153
|
+
return;
|
154
|
+
this.reconfigure(this.tabSizeCompartment, EditorState.tabSize.of(this.tabSize() ?? 2));
|
155
|
+
});
|
156
|
+
effect(() => {
|
157
|
+
const view = this.editorViewSig();
|
158
|
+
if (!view || !this.keymapExtrasCompartment)
|
159
|
+
return;
|
160
|
+
const keymap = this.cm.view?.keymap;
|
161
|
+
const commands = this.cm.commands;
|
162
|
+
if (!keymap || !commands)
|
163
|
+
return;
|
164
|
+
this.reconfigure(this.keymapExtrasCompartment, keymap.of(this.indentWithTab() ? [commands.indentWithTab] : []));
|
165
|
+
});
|
166
|
+
effect(() => {
|
167
|
+
const view = this.editorViewSig();
|
168
|
+
if (!view || !this.lineNumbersCompartment)
|
169
|
+
return;
|
170
|
+
const lineNumbers = this.cm.view?.lineNumbers;
|
171
|
+
if (!lineNumbers)
|
172
|
+
return;
|
173
|
+
this.reconfigure(this.lineNumbersCompartment, this.lineNumbers() ? lineNumbers() : []);
|
174
|
+
});
|
175
|
+
}
|
176
|
+
async initializeEditor() {
|
177
|
+
const hostEl = this.host()?.nativeElement;
|
178
|
+
if (!hostEl)
|
179
|
+
return;
|
180
|
+
await this.loadCodeMirrorModules();
|
181
|
+
this.createCompartments();
|
182
|
+
const keymaps = this.buildKeymaps();
|
183
|
+
const viewMod = this.cm.view;
|
184
|
+
const stateMod = this.cm.state;
|
185
|
+
const languageMod = this.cm.language;
|
186
|
+
const autoMod = this.cm.autocomplete;
|
187
|
+
const commandsMod = this.cm.commands;
|
188
|
+
const searchMod = this.cm.search;
|
189
|
+
const lintMod = this.cm.lint;
|
190
|
+
if (!viewMod || !stateMod || !languageMod || !autoMod || !commandsMod || !searchMod || !lintMod)
|
191
|
+
return;
|
192
|
+
const languageExt = await this.resolveLanguageExtension(this.language());
|
193
|
+
const themeExt = await this.resolveThemeExtension();
|
194
|
+
const placeholderExt = viewMod.placeholder(this.placeholder() ?? '');
|
195
|
+
const editableExt = viewMod.EditorView.editable.of(!this.readOnly());
|
196
|
+
const wrappingExt = this.lineWrapping() ? viewMod.EditorView.lineWrapping : [];
|
197
|
+
const tabSizeExt = stateMod.EditorState.tabSize.of(this.tabSize() ?? 2);
|
198
|
+
const lineNumbersExt = this.lineNumbers() ? viewMod.lineNumbers() : [];
|
199
|
+
const autoCompleteExt = autoMod.autocompletion({
|
200
|
+
override: this.buildCustomCompletionSources(),
|
201
|
+
});
|
202
|
+
const baseExtensions = [
|
203
|
+
this.lineNumbersCompartment.of(lineNumbersExt),
|
204
|
+
viewMod.highlightActiveLine(),
|
205
|
+
viewMod.highlightActiveLineGutter(),
|
206
|
+
viewMod.drawSelection(),
|
207
|
+
viewMod.dropCursor(),
|
208
|
+
viewMod.rectangularSelection(),
|
209
|
+
viewMod.crosshairCursor(),
|
210
|
+
viewMod.highlightSpecialChars(),
|
211
|
+
languageMod.syntaxHighlighting(languageMod.defaultHighlightStyle, { fallback: true }),
|
212
|
+
languageMod.bracketMatching(),
|
213
|
+
languageMod.foldGutter(),
|
214
|
+
commandsMod.history(),
|
215
|
+
searchMod.highlightSelectionMatches(),
|
216
|
+
viewMod.keymap.of(keymaps),
|
217
|
+
autoCompleteExt,
|
218
|
+
this.languageCompartment.of(languageExt),
|
219
|
+
this.readOnlyCompartment.of(editableExt),
|
220
|
+
this.themeCompartment.of(themeExt),
|
221
|
+
this.placeholderCompartment.of(placeholderExt),
|
222
|
+
this.wrappingCompartment.of(wrappingExt),
|
223
|
+
this.tabSizeCompartment.of(tabSizeExt),
|
224
|
+
this.keymapExtrasCompartment.of(viewMod.keymap.of(this.indentWithTab() ? [commandsMod.indentWithTab] : [])),
|
225
|
+
...this.extensions(),
|
226
|
+
];
|
227
|
+
const updateListener = viewMod.EditorView.updateListener.of((vu) => {
|
228
|
+
if (vu.docChanged) {
|
229
|
+
const text = vu.state.doc.toString();
|
230
|
+
// this.writeValue(text);
|
231
|
+
this.value = text;
|
232
|
+
}
|
233
|
+
});
|
234
|
+
const state = stateMod.EditorState.create({
|
235
|
+
doc: this.value ?? '',
|
236
|
+
extensions: [...baseExtensions, updateListener],
|
237
|
+
});
|
238
|
+
const view = new viewMod.EditorView({ state, parent: hostEl });
|
239
|
+
// Update listener for external changes (selection, viewport, etc.) if needed later
|
240
|
+
view.dispatch({ effects: [] });
|
241
|
+
this.editorViewSig.set(view);
|
242
|
+
this.destroyRef.onDestroy(() => {
|
243
|
+
view.destroy();
|
244
|
+
this.editorViewSig.set(null);
|
245
|
+
});
|
246
|
+
if (this.focusOnReady()) {
|
247
|
+
view.focus();
|
248
|
+
}
|
249
|
+
this.ready.emit();
|
250
|
+
}
|
251
|
+
reconfigure(comp, ext) {
|
252
|
+
const view = this.editorViewSig();
|
253
|
+
if (!view || !comp)
|
254
|
+
return;
|
255
|
+
view.dispatch({ effects: comp.reconfigure(ext) });
|
256
|
+
}
|
257
|
+
/**
|
258
|
+
* Handles Ctrl/Cmd+S on the host. If formatOnSave is enabled, attempts
|
259
|
+
* to format the document first, then emits the saved text.
|
260
|
+
*/
|
261
|
+
async onSaveShortcut(event) {
|
262
|
+
event.preventDefault();
|
263
|
+
const view = this.editorViewSig();
|
264
|
+
const current = view?.state.doc.toString() ?? this.value ?? '';
|
265
|
+
const payload = current;
|
266
|
+
if (this.formatOnSave()) {
|
267
|
+
await this.format(true);
|
268
|
+
}
|
269
|
+
this.save.emit(payload);
|
270
|
+
}
|
271
|
+
async loadCodeMirrorModules() {
|
272
|
+
const [viewMod, stateMod, langMod, autoMod, cmdMod, searchMod, lintMod] = await Promise.all([
|
273
|
+
import('@codemirror/view'),
|
274
|
+
import('@codemirror/state'),
|
275
|
+
import('@codemirror/language'),
|
276
|
+
import('@codemirror/autocomplete'),
|
277
|
+
import('@codemirror/commands'),
|
278
|
+
import('@codemirror/search'),
|
279
|
+
import('@codemirror/lint'),
|
280
|
+
]);
|
281
|
+
this.cm.view = viewMod;
|
282
|
+
this.cm.state = stateMod;
|
283
|
+
this.cm.language = langMod;
|
284
|
+
this.cm.autocomplete = autoMod;
|
285
|
+
this.cm.commands = cmdMod;
|
286
|
+
this.cm.search = searchMod;
|
287
|
+
this.cm.lint = lintMod;
|
288
|
+
}
|
289
|
+
createCompartments() {
|
290
|
+
const stateMod = this.cm.state;
|
291
|
+
if (!stateMod)
|
292
|
+
return;
|
293
|
+
this.languageCompartment = new stateMod.Compartment();
|
294
|
+
this.readOnlyCompartment = new stateMod.Compartment();
|
295
|
+
this.themeCompartment = new stateMod.Compartment();
|
296
|
+
this.placeholderCompartment = new stateMod.Compartment();
|
297
|
+
this.wrappingCompartment = new stateMod.Compartment();
|
298
|
+
this.tabSizeCompartment = new stateMod.Compartment();
|
299
|
+
this.keymapExtrasCompartment = new stateMod.Compartment();
|
300
|
+
this.lineNumbersCompartment = new stateMod.Compartment();
|
301
|
+
}
|
302
|
+
buildKeymaps() {
|
303
|
+
const cmdMod = this.cm.commands;
|
304
|
+
const searchMod = this.cm.search;
|
305
|
+
const autoMod = this.cm.autocomplete;
|
306
|
+
const lintMod = this.cm.lint;
|
307
|
+
if (!cmdMod || !searchMod || !autoMod || !lintMod)
|
308
|
+
return [];
|
309
|
+
return [
|
310
|
+
...cmdMod.defaultKeymap,
|
311
|
+
...cmdMod.historyKeymap,
|
312
|
+
...searchMod.searchKeymap,
|
313
|
+
...autoMod.completionKeymap,
|
314
|
+
...lintMod.lintKeymap,
|
315
|
+
];
|
316
|
+
}
|
317
|
+
// Attempts to format code using Prettier (browser-only). Returns formatted text or null on failure/unsupported.
|
318
|
+
async tryFormatWithPrettier(text, lang) {
|
319
|
+
if (!this.isBrowser())
|
320
|
+
return null;
|
321
|
+
try {
|
322
|
+
const prettier = await import('prettier/standalone');
|
323
|
+
let parser = null;
|
324
|
+
const plugins = [];
|
325
|
+
switch (lang) {
|
326
|
+
case 'javascript':
|
327
|
+
case 'js': {
|
328
|
+
const [babel, estree] = await Promise.all([
|
329
|
+
import('prettier/plugins/babel'),
|
330
|
+
import('prettier/plugins/estree'),
|
331
|
+
]);
|
332
|
+
plugins.push(babel, estree);
|
333
|
+
parser = 'babel';
|
334
|
+
break;
|
335
|
+
}
|
336
|
+
case 'typescript':
|
337
|
+
case 'ts': {
|
338
|
+
const [typescript, estree] = await Promise.all([
|
339
|
+
import('prettier/plugins/typescript'),
|
340
|
+
import('prettier/plugins/estree'),
|
341
|
+
]);
|
342
|
+
plugins.push(typescript, estree);
|
343
|
+
parser = 'typescript';
|
344
|
+
break;
|
345
|
+
}
|
346
|
+
case 'json': {
|
347
|
+
const [babel, estree] = await Promise.all([
|
348
|
+
import('prettier/plugins/babel'),
|
349
|
+
import('prettier/plugins/estree'),
|
350
|
+
]);
|
351
|
+
plugins.push(babel, estree);
|
352
|
+
parser = 'json';
|
353
|
+
break;
|
354
|
+
}
|
355
|
+
case 'html': {
|
356
|
+
const html = await import('prettier/plugins/html');
|
357
|
+
plugins.push(html);
|
358
|
+
parser = 'html';
|
359
|
+
break;
|
360
|
+
}
|
361
|
+
case 'css': {
|
362
|
+
const postcss = await import('prettier/plugins/postcss');
|
363
|
+
plugins.push(postcss);
|
364
|
+
parser = 'css';
|
365
|
+
break;
|
366
|
+
}
|
367
|
+
case 'markdown': {
|
368
|
+
const markdown = await import('prettier/plugins/markdown');
|
369
|
+
plugins.push(markdown);
|
370
|
+
parser = 'markdown';
|
371
|
+
break;
|
372
|
+
}
|
373
|
+
default:
|
374
|
+
return null;
|
375
|
+
}
|
376
|
+
if (!parser)
|
377
|
+
return null;
|
378
|
+
const formatted = await prettier.format(text, {
|
379
|
+
parser,
|
380
|
+
plugins,
|
381
|
+
});
|
382
|
+
return formatted;
|
383
|
+
}
|
384
|
+
catch {
|
385
|
+
return null;
|
386
|
+
}
|
387
|
+
}
|
388
|
+
async resolveLanguageExtension(lang) {
|
389
|
+
switch (lang) {
|
390
|
+
case 'javascript':
|
391
|
+
case 'js': {
|
392
|
+
const m = await import('@codemirror/lang-javascript');
|
393
|
+
return m.javascript();
|
394
|
+
}
|
395
|
+
case 'typescript':
|
396
|
+
case 'ts': {
|
397
|
+
const m = await import('@codemirror/lang-javascript');
|
398
|
+
return m.javascript({ typescript: true });
|
399
|
+
}
|
400
|
+
case 'json': {
|
401
|
+
const m = await import('@codemirror/lang-json');
|
402
|
+
return m.json();
|
403
|
+
}
|
404
|
+
case 'html': {
|
405
|
+
const m = await import('@codemirror/lang-html');
|
406
|
+
return m.html();
|
407
|
+
}
|
408
|
+
case 'css': {
|
409
|
+
const m = await import('@codemirror/lang-css');
|
410
|
+
return m.css();
|
411
|
+
}
|
412
|
+
case 'scss':
|
413
|
+
case 'sass': {
|
414
|
+
const m = await import('@codemirror/lang-sass');
|
415
|
+
return m.sass();
|
416
|
+
}
|
417
|
+
case 'sql': {
|
418
|
+
const m = await import('@codemirror/lang-sql');
|
419
|
+
return m.sql();
|
420
|
+
}
|
421
|
+
case 'xml': {
|
422
|
+
const m = await import('@codemirror/lang-xml');
|
423
|
+
return m.xml();
|
424
|
+
}
|
425
|
+
case 'markdown': {
|
426
|
+
const m = await import('@codemirror/lang-markdown');
|
427
|
+
return m.markdown();
|
428
|
+
}
|
429
|
+
default:
|
430
|
+
return [];
|
431
|
+
}
|
432
|
+
}
|
433
|
+
async resolveThemeExtension() {
|
434
|
+
const { EditorView } = await import('@codemirror/view');
|
435
|
+
const darkMode = this.platformService.themeMode() === 'dark';
|
436
|
+
// const surfaceVar = 'rgb(var(--ax-sys-color-surface)) !important';
|
437
|
+
if (darkMode) {
|
438
|
+
try {
|
439
|
+
const { oneDark } = await import('@codemirror/theme-one-dark');
|
440
|
+
return [
|
441
|
+
oneDark,
|
442
|
+
EditorView.theme({
|
443
|
+
'&': { backgroundColor: 'transparent !important' },
|
444
|
+
'.cm-gutters': {},
|
445
|
+
}, { dark: true }),
|
446
|
+
];
|
447
|
+
}
|
448
|
+
catch {
|
449
|
+
return EditorView.theme({
|
450
|
+
'&': { backgroundColor: 'transparent !important' },
|
451
|
+
'.cm-gutters': {},
|
452
|
+
}, { dark: true });
|
453
|
+
}
|
454
|
+
}
|
455
|
+
return EditorView.theme({
|
456
|
+
'&': { backgroundColor: 'transparent !important' },
|
457
|
+
'.cm-gutters': {},
|
458
|
+
}, { dark: false });
|
459
|
+
}
|
460
|
+
buildCustomCompletionSources() {
|
461
|
+
const provided = this.customCompletions();
|
462
|
+
if (!provided)
|
463
|
+
return undefined;
|
464
|
+
if (typeof provided === 'function') {
|
465
|
+
return [provided];
|
466
|
+
}
|
467
|
+
// Treat array as a static completion list
|
468
|
+
const staticSource = (context) => {
|
469
|
+
const from = context.pos;
|
470
|
+
return { from, options: provided };
|
471
|
+
};
|
472
|
+
return [staticSource];
|
473
|
+
}
|
474
|
+
// Public API
|
475
|
+
/** Programmatically focus the editor. */
|
476
|
+
focus() {
|
477
|
+
const view = this.editorViewSig();
|
478
|
+
if (view)
|
479
|
+
view.focus();
|
480
|
+
}
|
481
|
+
/** Select all text in the current document. */
|
482
|
+
selectAll() {
|
483
|
+
const view = this.editorViewSig();
|
484
|
+
if (!view)
|
485
|
+
return;
|
486
|
+
const length = view.state.doc.length;
|
487
|
+
view.dispatch({ selection: { anchor: 0, head: length } });
|
488
|
+
}
|
489
|
+
// Formats the current document with Prettier (if available for the active language).
|
490
|
+
// Returns the formatted text or null if unchanged/unsupported.
|
491
|
+
async format(affect = true) {
|
492
|
+
const view = this.editorViewSig();
|
493
|
+
if (!view)
|
494
|
+
return null;
|
495
|
+
const source = view.state.doc.toString();
|
496
|
+
if (!source)
|
497
|
+
return null;
|
498
|
+
const formatted = await this.tryFormatWithPrettier(source, this.language());
|
499
|
+
if (!formatted || formatted === source)
|
500
|
+
return null;
|
501
|
+
if (affect) {
|
502
|
+
view.dispatch({ changes: { from: 0, to: view.state.doc.length, insert: formatted } });
|
503
|
+
}
|
504
|
+
return formatted;
|
505
|
+
}
|
506
|
+
/** Returns the total number of characters in the current document. */
|
507
|
+
getTotalCharacters() {
|
508
|
+
const view = this.editorViewSig();
|
509
|
+
if (view)
|
510
|
+
return view.state.doc.length ?? 0;
|
511
|
+
const text = this.value ?? '';
|
512
|
+
return text.length;
|
513
|
+
}
|
514
|
+
/** Returns the total number of lines in the current document. */
|
515
|
+
getTotalLines() {
|
516
|
+
const view = this.editorViewSig();
|
517
|
+
if (view) {
|
518
|
+
const doc = view.state.doc;
|
519
|
+
return typeof doc?.lines === 'number' ? doc.lines : doc.toString().split(/\r?\n/).length;
|
520
|
+
}
|
521
|
+
const text = this.value ?? '';
|
522
|
+
return text ? text.split(/\r?\n/).length : 1;
|
523
|
+
}
|
524
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCodeEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
525
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.3", type: AXCodeEditorComponent, isStandalone: true, selector: "ax-code-editor", inputs: { language: { classPropertyName: "language", publicName: "language", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, lineNumbers: { classPropertyName: "lineNumbers", publicName: "lineNumbers", isSignal: true, isRequired: false, transformFunction: null }, lineWrapping: { classPropertyName: "lineWrapping", publicName: "lineWrapping", isSignal: true, isRequired: false, transformFunction: null }, tabSize: { classPropertyName: "tabSize", publicName: "tabSize", isSignal: true, isRequired: false, transformFunction: null }, indentWithTab: { classPropertyName: "indentWithTab", publicName: "indentWithTab", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, extensions: { classPropertyName: "extensions", publicName: "extensions", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, focusOnReady: { classPropertyName: "focusOnReady", publicName: "focusOnReady", isSignal: true, isRequired: false, transformFunction: null }, formatOnSave: { classPropertyName: "formatOnSave", publicName: "formatOnSave", isSignal: true, isRequired: false, transformFunction: null }, customCompletions: { classPropertyName: "customCompletions", publicName: "customCompletions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ready: "ready", save: "save" }, host: { listeners: { "keydown.control.s": "onSaveShortcut($event)" }, classAttribute: "ax-code-editor block" }, providers: [
|
526
|
+
{ provide: AXValuableComponent, useExisting: AXCodeEditorComponent },
|
527
|
+
{
|
528
|
+
provide: NG_VALUE_ACCESSOR,
|
529
|
+
useExisting: forwardRef(() => AXCodeEditorComponent),
|
530
|
+
multi: true,
|
531
|
+
},
|
532
|
+
{ provide: AXComponent, useExisting: AXCodeEditorComponent },
|
533
|
+
], viewQueries: [{ propertyName: "host", first: true, predicate: ["host"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
534
|
+
<div
|
535
|
+
#host
|
536
|
+
class="cm-editor"
|
537
|
+
[attr.aria-label]="ariaLabel() ?? null"
|
538
|
+
[attr.aria-readonly]="readOnly() ? 'true' : 'false'"
|
539
|
+
[attr.data-placeholder]="placeholder() ?? null"
|
540
|
+
[style.height]="height() ?? null"
|
541
|
+
[style.minHeight]="minHeight() ?? null"
|
542
|
+
[style.maxHeight]="maxHeight() ?? null"
|
543
|
+
></div>
|
544
|
+
`, isInline: true, styles: [":host{display:block;width:100%;transition:none}.cm-editor{width:100%;max-width:100%;box-sizing:border-box}.cm-editor.cm-focused{outline:none}\n"] }); }
|
545
|
+
}
|
546
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCodeEditorComponent, decorators: [{
|
547
|
+
type: Component,
|
548
|
+
args: [{ selector: 'ax-code-editor', host: {
|
549
|
+
'(keydown.control.s)': 'onSaveShortcut($event)',
|
550
|
+
class: 'ax-code-editor block',
|
551
|
+
}, providers: [
|
552
|
+
{ provide: AXValuableComponent, useExisting: AXCodeEditorComponent },
|
553
|
+
{
|
554
|
+
provide: NG_VALUE_ACCESSOR,
|
555
|
+
useExisting: forwardRef(() => AXCodeEditorComponent),
|
556
|
+
multi: true,
|
557
|
+
},
|
558
|
+
{ provide: AXComponent, useExisting: AXCodeEditorComponent },
|
559
|
+
], template: `
|
560
|
+
<div
|
561
|
+
#host
|
562
|
+
class="cm-editor"
|
563
|
+
[attr.aria-label]="ariaLabel() ?? null"
|
564
|
+
[attr.aria-readonly]="readOnly() ? 'true' : 'false'"
|
565
|
+
[attr.data-placeholder]="placeholder() ?? null"
|
566
|
+
[style.height]="height() ?? null"
|
567
|
+
[style.minHeight]="minHeight() ?? null"
|
568
|
+
[style.maxHeight]="maxHeight() ?? null"
|
569
|
+
></div>
|
570
|
+
`, styles: [":host{display:block;width:100%;transition:none}.cm-editor{width:100%;max-width:100%;box-sizing:border-box}.cm-editor.cm-focused{outline:none}\n"] }]
|
571
|
+
}], ctorParameters: () => [] });
|
572
|
+
|
573
|
+
class AXCodeEditorModule {
|
574
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCodeEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
575
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.3", ngImport: i0, type: AXCodeEditorModule, imports: [CommonModule, AXCodeEditorComponent], exports: [AXCodeEditorComponent] }); }
|
576
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCodeEditorModule, imports: [CommonModule] }); }
|
577
|
+
}
|
578
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCodeEditorModule, decorators: [{
|
579
|
+
type: NgModule,
|
580
|
+
args: [{
|
581
|
+
imports: [CommonModule, AXCodeEditorComponent],
|
582
|
+
exports: [AXCodeEditorComponent],
|
583
|
+
}]
|
584
|
+
}] });
|
585
|
+
|
586
|
+
/**
|
587
|
+
* Generated bundle index. Do not edit.
|
588
|
+
*/
|
589
|
+
|
590
|
+
export { AXCodeEditorComponent, AXCodeEditorModule };
|
591
|
+
//# sourceMappingURL=acorex-components-code-editor.mjs.map
|