@lucca-front/ng 21.3.0 → 21.3.1-rc.2
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/fesm2022/lucca-front-ng-box.mjs +41 -4
- package/fesm2022/lucca-front-ng-box.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-color.mjs +2 -2
- package/fesm2022/lucca-front-ng-color.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-department.mjs +18 -11
- package/fesm2022/lucca-front-ng-core-select-department.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-data-table.mjs +2 -2
- package/fesm2022/lucca-front-ng-data-table.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form-header.mjs +2 -2
- package/fesm2022/lucca-front-ng-form-header.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs +15 -5
- package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms.mjs +2 -2
- package/fesm2022/lucca-front-ng-forms.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-skeleton.mjs +2 -2
- package/fesm2022/lucca-front-ng-skeleton.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-software-icon.mjs +1 -0
- package/fesm2022/lucca-front-ng-software-icon.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-time.mjs +6 -4
- package/fesm2022/lucca-front-ng-time.mjs.map +1 -1
- package/package.json +4 -4
- package/schematics/lib/deprecated-mapper.js +1 -1
- package/schematics/lu-grid/migration.js +31 -58
- package/schematics/lu-grid/migration.utils.js +60 -0
- package/types/lucca-front-ng-box.d.ts +6 -1
- package/types/lucca-front-ng-core-select-department.d.ts +10 -9
- package/types/lucca-front-ng-form-header.d.ts +1 -1
- package/types/lucca-front-ng-software-icon.d.ts +2 -2
- package/types/lucca-front-ng-time.d.ts +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, inject, input, booleanAttribute, viewChild, ElementRef, contentChildren, signal, computed, effect, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component, DestroyRef, ViewContainerRef, TemplateRef, viewChildren } from '@angular/core';
|
|
3
3
|
import { ButtonComponent } from '@lucca-front/ng/button';
|
|
4
|
-
import { intlInputOptions } from '@lucca-front/ng/core';
|
|
4
|
+
import { isNil, intlInputOptions } from '@lucca-front/ng/core';
|
|
5
5
|
import { IconComponent } from '@lucca-front/ng/icon';
|
|
6
6
|
import { LuTooltipTriggerDirective } from '@lucca-front/ng/tooltip';
|
|
7
7
|
import { CommonModule } from '@angular/common';
|
|
@@ -58,6 +58,7 @@ class RichTextInputComponent {
|
|
|
58
58
|
#focusedPlugin;
|
|
59
59
|
#editor;
|
|
60
60
|
#isRootElementInitialized;
|
|
61
|
+
#pendingValue;
|
|
61
62
|
constructor() {
|
|
62
63
|
this.#richTextFormatter = inject(RICH_TEXT_FORMATTER);
|
|
63
64
|
this.#formField = inject(FormFieldComponent, { optional: true });
|
|
@@ -80,6 +81,7 @@ class RichTextInputComponent {
|
|
|
80
81
|
this.#isTouched = signal(false, ...(ngDevMode ? [{ debugName: "#isTouched" }] : /* istanbul ignore next */ []));
|
|
81
82
|
this.#focusedPlugin = 0;
|
|
82
83
|
this.#isRootElementInitialized = false;
|
|
84
|
+
this.#pendingValue = null;
|
|
83
85
|
effect(() => {
|
|
84
86
|
if (this.#formField?.presentation() && this.contentPresentation()) {
|
|
85
87
|
this.#editor?.setRootElement(this.contentPresentation()?.nativeElement ?? null);
|
|
@@ -109,19 +111,27 @@ class RichTextInputComponent {
|
|
|
109
111
|
if (this.#allPlugins().length > 0) {
|
|
110
112
|
this.#allPlugins()[this.#focusedPlugin].tabindex?.set(0);
|
|
111
113
|
}
|
|
114
|
+
if (this.#pendingValue) {
|
|
115
|
+
this.writeValue(this.#pendingValue);
|
|
116
|
+
}
|
|
112
117
|
}
|
|
113
118
|
ngOnDestroy() {
|
|
114
119
|
this.#cleanup?.();
|
|
115
120
|
}
|
|
116
121
|
writeValue(value) {
|
|
122
|
+
const editorRef = this.#editor;
|
|
123
|
+
if (isNil(editorRef)) {
|
|
124
|
+
this.#pendingValue = value;
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
117
127
|
const updateTags = [SKIP_DOM_SELECTION_TAG, INITIAL_UPDATE_TAG];
|
|
118
128
|
if (value) {
|
|
119
|
-
|
|
120
|
-
this.#richTextFormatter.parse(
|
|
129
|
+
editorRef.update(() => {
|
|
130
|
+
this.#richTextFormatter.parse(editorRef, value);
|
|
121
131
|
}, { tag: updateTags });
|
|
122
132
|
}
|
|
123
|
-
else if (!
|
|
124
|
-
|
|
133
|
+
else if (!editorRef.getEditorState().isEmpty()) {
|
|
134
|
+
editorRef.update(() => {
|
|
125
135
|
const root = $getRoot();
|
|
126
136
|
root.clear();
|
|
127
137
|
}, { tag: updateTags });
|