@heartlandone/vega 2.73.0 → 2.74.0
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/dist/cjs/{app-globals-cc162173.js → app-globals-e9f2edcf.js} +5 -5
- package/dist/cjs/{code-block-823cd481.js → code-block-c8ae7e0a.js} +1 -1
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-e2e0c6f3.js → component-value-history-controller-slimmer.abstract-13968181.js} +2 -2
- package/dist/cjs/{design-token-11656685.js → design-token-4e23c50a.js} +1 -1
- package/dist/cjs/{dto-renderer-manager-bd2bd447.js → dto-renderer-manager-ca753971.js} +19 -3
- package/dist/cjs/{element-appender-slimmer-12f40b8b.js → element-appender-slimmer-dc769946.js} +2 -2
- package/dist/cjs/{function-extension-78ec27e0.js → function-extension-5972c73c.js} +2 -2
- package/dist/cjs/{image-annotation-action-7408a4b3.js → image-annotation-action-92df8979.js} +2 -2
- package/dist/cjs/index.cjs.js +8 -8
- package/dist/cjs/{language-extension-716015a5.js → language-extension-d78389f9.js} +2 -2
- package/dist/cjs/loader.cjs.js +6 -6
- package/dist/cjs/{public-rules-2950f1fc.js → public-rules-23a86d33.js} +3 -3
- package/dist/cjs/{range-c3c48132.js → range-80f19554.js} +1 -1
- package/dist/cjs/{responsive-format-facade-96c5f598.js → responsive-format-facade-8d195366.js} +3 -3
- package/dist/cjs/{rich-text-editor-required-rule-4aab05a3.js → rich-text-editor-required-rule-80304585.js} +1 -1
- package/dist/cjs/{style-formatter-9c42d41b.js → style-formatter-dbda894b.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +5 -5
- package/dist/cjs/vega-app-header-button.cjs.entry.js +5 -5
- package/dist/cjs/vega-box.cjs.entry.js +6 -6
- package/dist/cjs/vega-button-circle.cjs.entry.js +5 -5
- package/dist/cjs/vega-button.cjs.entry.js +4 -4
- package/dist/cjs/vega-card.cjs.entry.js +5 -5
- package/dist/cjs/vega-carousel.cjs.entry.js +4 -4
- package/dist/cjs/vega-chip.cjs.entry.js +5 -5
- package/dist/cjs/vega-code-block.cjs.entry.js +3 -3
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +5 -5
- package/dist/cjs/vega-dialog_2.cjs.entry.js +5 -5
- package/dist/cjs/vega-divider.cjs.entry.js +5 -5
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +18 -8
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-flag-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-flex.cjs.entry.js +6 -6
- package/dist/cjs/vega-font.cjs.entry.js +5 -5
- package/dist/cjs/vega-grid.cjs.entry.js +5 -5
- package/dist/cjs/vega-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-image-uploader.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-select.cjs.entry.js +175 -47
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +5 -5
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-pagination.cjs.entry.js +4 -4
- package/dist/cjs/vega-popover_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +3 -3
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +19 -9
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +4 -4
- package/dist/cjs/vega-signature-capture.cjs.entry.js +5 -5
- package/dist/cjs/vega-table_11.cjs.entry.js +4 -4
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +5 -5
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +5 -5
- package/dist/cjs/vega.cjs.js +6 -6
- package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.js +6 -3
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +31 -0
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-item-controller.js +89 -0
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-source-controller.js +4 -0
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-value-controller.js +4 -0
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +33 -13
- package/dist/collection/components/vega-input-select/vega-input-select.js +27 -7
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/plain-text-annotation.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +18 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/extension-controller.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +6 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +5 -0
- package/dist/esm/{app-globals-949d2e18.js → app-globals-9203a3e5.js} +5 -5
- package/dist/esm/{code-block-666674d7.js → code-block-4e0d321d.js} +1 -1
- package/dist/esm/{component-value-history-controller-slimmer.abstract-171dda08.js → component-value-history-controller-slimmer.abstract-0ab0d9f0.js} +2 -2
- package/dist/esm/{design-token-9b510e59.js → design-token-175c4c0c.js} +1 -1
- package/dist/esm/{dto-renderer-manager-49ae5d56.js → dto-renderer-manager-402e89d0.js} +19 -3
- package/dist/esm/{element-appender-slimmer-b9890dcb.js → element-appender-slimmer-7e7aa230.js} +2 -2
- package/dist/esm/{function-extension-8b06c6f8.js → function-extension-45e413ff.js} +2 -2
- package/dist/esm/{image-annotation-action-b3eea6a2.js → image-annotation-action-2cdbbd57.js} +2 -2
- package/dist/esm/index.js +8 -8
- package/dist/esm/{language-extension-b3f836d4.js → language-extension-4bed2436.js} +2 -2
- package/dist/esm/loader.js +6 -6
- package/dist/esm/{public-rules-b164e40e.js → public-rules-05e83e40.js} +3 -3
- package/dist/esm/{range-9cc1422b.js → range-5086f250.js} +1 -1
- package/dist/esm/{responsive-format-facade-94897ae8.js → responsive-format-facade-f995d6de.js} +3 -3
- package/dist/esm/{rich-text-editor-required-rule-2131f21c.js → rich-text-editor-required-rule-0d1147a8.js} +1 -1
- package/dist/esm/{style-formatter-bb5aec96.js → style-formatter-f4067407.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +5 -5
- package/dist/esm/vega-app-header-button.entry.js +5 -5
- package/dist/esm/vega-box.entry.js +6 -6
- package/dist/esm/vega-button-circle.entry.js +5 -5
- package/dist/esm/vega-button.entry.js +4 -4
- package/dist/esm/vega-card.entry.js +5 -5
- package/dist/esm/vega-carousel.entry.js +4 -4
- package/dist/esm/vega-chip.entry.js +5 -5
- package/dist/esm/vega-code-block.entry.js +3 -3
- package/dist/esm/vega-date-picker_2.entry.js +5 -5
- package/dist/esm/vega-dialog_2.entry.js +5 -5
- package/dist/esm/vega-divider.entry.js +5 -5
- package/dist/esm/vega-dropdown_5.entry.js +18 -8
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-flag-icon.entry.js +5 -5
- package/dist/esm/vega-flex.entry.js +6 -6
- package/dist/esm/vega-font.entry.js +5 -5
- package/dist/esm/vega-grid.entry.js +5 -5
- package/dist/esm/vega-icon.entry.js +5 -5
- package/dist/esm/vega-image-uploader.entry.js +4 -4
- package/dist/esm/vega-input-phone-number.entry.js +3 -3
- package/dist/esm/vega-input-select.entry.js +175 -47
- package/dist/esm/vega-left-nav_5.entry.js +5 -5
- package/dist/esm/vega-loader-wrapper_2.entry.js +4 -4
- package/dist/esm/vega-pagination.entry.js +4 -4
- package/dist/esm/vega-popover_2.entry.js +6 -6
- package/dist/esm/vega-progress-tracker_2.entry.js +4 -4
- package/dist/esm/vega-rich-text-content.entry.js +3 -3
- package/dist/esm/vega-rich-text-editor_4.entry.js +19 -9
- package/dist/esm/vega-selection-chip_2.entry.js +4 -4
- package/dist/esm/vega-sidenav_3.entry.js +4 -4
- package/dist/esm/vega-signature-capture.entry.js +5 -5
- package/dist/esm/vega-table_11.entry.js +4 -4
- package/dist/esm/vega-time-picker_2.entry.js +5 -5
- package/dist/esm/vega-tooltip_2.entry.js +5 -5
- package/dist/esm/vega.js +6 -6
- package/dist/sri/vega-sri-manifest.json +179 -179
- package/dist/types/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.d.ts +1 -0
- package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +7 -0
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-item-controller.d.ts +29 -0
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-source-controller.d.ts +1 -0
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-value-controller.d.ts +1 -0
- package/dist/types/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.d.ts +1 -1
- package/dist/types/components/vega-input-select/types.d.ts +5 -0
- package/dist/types/components/vega-input-select/vega-input-select.d.ts +12 -4
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +8 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/value-controller.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.d.ts +1 -0
- package/dist/types/components.d.ts +17 -5
- package/dist/types/types/components.type.d.ts +1 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-38ed3d59.entry.js → p-05feab84.entry.js} +1 -1
- package/dist/vega/{p-adc615a4.entry.js → p-071f9d00.entry.js} +1 -1
- package/dist/vega/{p-f3831dc9.entry.js → p-0f601e59.entry.js} +1 -1
- package/dist/vega/{p-40561fa0.entry.js → p-1a7e97d2.entry.js} +1 -1
- package/dist/vega/{p-76e6c13a.js → p-29618be2.js} +1 -1
- package/dist/vega/{p-c0036e71.js → p-301096ee.js} +1 -1
- package/dist/vega/{p-d01fe83d.entry.js → p-310a6294.entry.js} +1 -1
- package/dist/vega/{p-8fba7f9a.js → p-3226c208.js} +1 -1
- package/dist/vega/{p-03e16a05.entry.js → p-3398f553.entry.js} +1 -1
- package/dist/vega/{p-42a283b5.entry.js → p-370ee9e3.entry.js} +1 -1
- package/dist/vega/{p-70b2906a.entry.js → p-38b8efe5.entry.js} +1 -1
- package/dist/vega/{p-2e0deef6.js → p-3a279b71.js} +1 -1
- package/dist/vega/{p-623c3911.entry.js → p-3b32e75d.entry.js} +1 -1
- package/dist/vega/{p-0ba0f83d.entry.js → p-3ebc8b5b.entry.js} +1 -1
- package/dist/vega/{p-21e7808a.entry.js → p-3f56d184.entry.js} +1 -1
- package/dist/vega/{p-1e019406.js → p-42b7b5df.js} +1 -1
- package/dist/vega/p-451ddd84.js +1 -0
- package/dist/vega/{p-c2ac6b47.entry.js → p-5a0c92db.entry.js} +1 -1
- package/dist/vega/{p-0ad59141.entry.js → p-5c492358.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-e88f2dc3.js → p-674fe99e.js} +1 -1
- package/dist/vega/{p-dd72ad9e.js → p-73383099.js} +1 -1
- package/dist/vega/{p-9dfe2bbc.js → p-748eb5a2.js} +1 -1
- package/dist/vega/p-779cd090.entry.js +1 -0
- package/dist/vega/{p-3938880f.entry.js → p-7c238c19.entry.js} +1 -1
- package/dist/vega/{p-a3c4fa30.entry.js → p-950bf9a9.entry.js} +1 -1
- package/dist/vega/{p-5f09868d.entry.js → p-95b11cdd.entry.js} +1 -1
- package/dist/vega/{p-7be3aefc.entry.js → p-99676172.entry.js} +1 -1
- package/dist/vega/{p-a125cfec.entry.js → p-9b7daab0.entry.js} +1 -1
- package/dist/vega/{p-74a77cad.js → p-9ea8eb49.js} +1 -1
- package/dist/vega/{p-2971b17a.js → p-a2d1c2f3.js} +1 -1
- package/dist/vega/p-a6dfef41.entry.js +1 -0
- package/dist/vega/{p-6e701542.entry.js → p-a7f151fe.entry.js} +1 -1
- package/dist/vega/p-b0ed81e2.js +1 -0
- package/dist/vega/{p-75d91ee9.entry.js → p-b18c12cb.entry.js} +1 -1
- package/dist/vega/{p-e39aa2ea.entry.js → p-b19d4e26.entry.js} +1 -1
- package/dist/vega/{p-524ffc12.entry.js → p-b4be03bb.entry.js} +1 -1
- package/dist/vega/{p-721b2981.entry.js → p-ba223773.entry.js} +1 -1
- package/dist/vega/{p-db62b038.entry.js → p-bb9db84a.entry.js} +1 -1
- package/dist/vega/{p-1faef917.entry.js → p-c34feecd.entry.js} +1 -1
- package/dist/vega/{p-7b337fd4.entry.js → p-c796307d.entry.js} +1 -1
- package/dist/vega/p-ca9b4af9.entry.js +1 -0
- package/dist/vega/{p-f427d88c.entry.js → p-cadd84ec.entry.js} +1 -1
- package/dist/vega/{p-bf61d136.js → p-e3fa091a.js} +1 -1
- package/dist/vega/{p-114c6df8.entry.js → p-edbecf19.entry.js} +1 -1
- package/dist/vega/{p-7f86b3c8.js → p-f0bde406.js} +1 -1
- package/dist/vega/{p-2b20a215.entry.js → p-f844f3f1.entry.js} +1 -1
- package/dist/vega/{p-2bc4f7d9.entry.js → p-f92752d2.entry.js} +1 -1
- package/dist/vega/{p-bd60c72e.entry.js → p-fbda4a20.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-21cba83b.entry.js +0 -1
- package/dist/vega/p-2f592078.entry.js +0 -1
- package/dist/vega/p-79a544d6.js +0 -1
- package/dist/vega/p-aab0deab.js +0 -1
- package/dist/vega/p-b406a846.entry.js +0 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { MapToComponentField, MapToComponentMethod, VegaSlimmer } from 'vega-slimmer/core';
|
|
8
|
+
/** The `VegaInputSelectItemController` class is a TypeScript React component that controls the state of selected item. */
|
|
9
|
+
export class VegaInputSelectItemController extends VegaSlimmer {
|
|
10
|
+
/**
|
|
11
|
+
* Set initial the value of selected item
|
|
12
|
+
*/
|
|
13
|
+
componentWillLoad() {
|
|
14
|
+
this.setSelectedItem();
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Reset the value of selected item based on select type
|
|
18
|
+
*/
|
|
19
|
+
watchSelectType() {
|
|
20
|
+
if (this.selectType === 'multiple') {
|
|
21
|
+
this.selectedItem = [];
|
|
22
|
+
this.vegaInputSelectValueController.setValue([]);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
this.selectedItem = null;
|
|
26
|
+
this.vegaInputSelectValueController.setValue('');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Synchronizes the controller's selectedItem with the current value and the source data.
|
|
31
|
+
*/
|
|
32
|
+
setSelectedItem() {
|
|
33
|
+
var _a;
|
|
34
|
+
if (this.selectType === 'multiple') {
|
|
35
|
+
const updatedItem = this.value.map((itemValue) => this.sourceController.getItem(itemValue));
|
|
36
|
+
const originalItem = this.selectedItem
|
|
37
|
+
? this.selectedItem.filter((item) => this.value.includes(item === null || item === void 0 ? void 0 : item.id))
|
|
38
|
+
: [];
|
|
39
|
+
this.selectedItem = this.updateSelectedItemUnderMultiple(originalItem, updatedItem);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
const updatedItem = this.sourceController.getItem(this.value);
|
|
43
|
+
if (!this.value || this.value !== ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
44
|
+
this.selectedItem = null;
|
|
45
|
+
}
|
|
46
|
+
if (updatedItem) {
|
|
47
|
+
this.selectedItem = updatedItem;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Updates the selected items array under multiple selection mode.
|
|
53
|
+
*
|
|
54
|
+
* @param {SelectSourceItem[]} originalItem - the original selected items array.
|
|
55
|
+
* @param {SelectSourceItem[]} updatedItem - the updated selected items array.
|
|
56
|
+
* @returns {SelectSourceItem[]} The updated selected items array.
|
|
57
|
+
*/
|
|
58
|
+
updateSelectedItemUnderMultiple(originalItem, updatedItem) {
|
|
59
|
+
const map = new Map(originalItem.map((obj) => [obj.id, obj]));
|
|
60
|
+
// Iterate through array2 and update the Map
|
|
61
|
+
updatedItem.forEach((item) => {
|
|
62
|
+
// If id exists, it replaces the old object; if not, it adds it
|
|
63
|
+
map.set(item === null || item === void 0 ? void 0 : item.id, item);
|
|
64
|
+
});
|
|
65
|
+
// Convert the Map values back into a standard array
|
|
66
|
+
return Array.from(map.values());
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
__decorate([
|
|
70
|
+
MapToComponentField()
|
|
71
|
+
], VegaInputSelectItemController.prototype, "value", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
MapToComponentField()
|
|
74
|
+
], VegaInputSelectItemController.prototype, "selectType", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
MapToComponentField({ writable: true })
|
|
77
|
+
], VegaInputSelectItemController.prototype, "selectedItem", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
MapToComponentField()
|
|
80
|
+
], VegaInputSelectItemController.prototype, "sourceController", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
MapToComponentField()
|
|
83
|
+
], VegaInputSelectItemController.prototype, "vegaInputSelectValueController", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
MapToComponentMethod('componentWillLoad')
|
|
86
|
+
], VegaInputSelectItemController.prototype, "componentWillLoad", null);
|
|
87
|
+
__decorate([
|
|
88
|
+
MapToComponentMethod('watchSelectType')
|
|
89
|
+
], VegaInputSelectItemController.prototype, "watchSelectType", null);
|
|
@@ -19,6 +19,7 @@ export class VegaInputSelectSourceController extends VegaSlimmer {
|
|
|
19
19
|
this.handleSourceChange = () => {
|
|
20
20
|
this.host.dataset.source = JSON.stringify(this.source);
|
|
21
21
|
this.source = isArrayOfType(this.source, isSelectSourceItemType) ? this.source : [];
|
|
22
|
+
this.vegaInputSelectItemController.setSelectedItem();
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
@@ -47,6 +48,9 @@ __decorate([
|
|
|
47
48
|
__decorate([
|
|
48
49
|
MapToComponentField({ writable: true })
|
|
49
50
|
], VegaInputSelectSourceController.prototype, "source", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
MapToComponentField()
|
|
53
|
+
], VegaInputSelectSourceController.prototype, "vegaInputSelectItemController", void 0);
|
|
50
54
|
__decorate([
|
|
51
55
|
MapToComponentMethod('watchSource')
|
|
52
56
|
], VegaInputSelectSourceController.prototype, "handleSourceChange", void 0);
|
|
@@ -71,6 +71,7 @@ export class VegaInputSelectValueController extends VegaSlimmer {
|
|
|
71
71
|
setValue(value) {
|
|
72
72
|
if (this.valueGuard(value)) {
|
|
73
73
|
this.value = value;
|
|
74
|
+
this.vegaInputSelectItemController.setSelectedItem();
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
/**
|
|
@@ -106,6 +107,9 @@ __decorate([
|
|
|
106
107
|
__decorate([
|
|
107
108
|
MapToComponentField()
|
|
108
109
|
], VegaInputSelectValueController.prototype, "sourceController", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
MapToComponentField()
|
|
112
|
+
], VegaInputSelectValueController.prototype, "vegaInputSelectItemController", void 0);
|
|
109
113
|
__decorate([
|
|
110
114
|
MapToComponentField()
|
|
111
115
|
], VegaInputSelectValueController.prototype, "vegaDropdownProps", void 0);
|
|
@@ -27,7 +27,17 @@ export class VegaInputSelectDropdownRenderer extends VegaSlimmer {
|
|
|
27
27
|
return (h("div", { class: "vega-input-select-toggle-icon", part: "toggle-icon-container" },
|
|
28
28
|
h("vega-icon", { part: "toggle-icon", icon: VegaInternalIconManager.getIconKey(this.isDropdownShow ? 'chevron-up' : 'chevron-down') })));
|
|
29
29
|
};
|
|
30
|
+
/* istanbul ignore next */
|
|
30
31
|
this.renderSelectContainer = () => {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
if (typeof this.selectedLabel !== 'function') {
|
|
34
|
+
if (!((_a = this.selectedLabel) === null || _a === void 0 ? void 0 : _a.single)) {
|
|
35
|
+
this.selectedLabel.single = (_value, selectedItem) => selectedItem.displayName;
|
|
36
|
+
}
|
|
37
|
+
if (!((_b = this.selectedLabel) === null || _b === void 0 ? void 0 : _b.multiple)) {
|
|
38
|
+
this.selectedLabel.multiple = (value) => `${value.length} Selected`;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
31
41
|
return (h("div", { class: "vega-input-select-select-container" },
|
|
32
42
|
h("div", { class: "vega-input-select-selected-box" }, this.selectType === 'multiple'
|
|
33
43
|
? this.renderMultipleSelected()
|
|
@@ -35,7 +45,10 @@ export class VegaInputSelectDropdownRenderer extends VegaSlimmer {
|
|
|
35
45
|
};
|
|
36
46
|
this.renderMultipleSelected = () => {
|
|
37
47
|
if (this.value.length > 0) {
|
|
38
|
-
const selectedLabelStr = this.selectedLabel
|
|
48
|
+
const selectedLabelStr = typeof this.selectedLabel == 'function'
|
|
49
|
+
? this.selectedLabel(this.value)
|
|
50
|
+
: // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
51
|
+
this.selectedLabel.multiple(this.value, this.selectedItem);
|
|
39
52
|
return (h("span", { class: "vega-input-select-selected" },
|
|
40
53
|
h("vega-text", { overflow: "ellipsis", tooltip: { placement: 'bottom' }, key: selectedLabelStr }, selectedLabelStr)));
|
|
41
54
|
}
|
|
@@ -44,15 +57,22 @@ export class VegaInputSelectDropdownRenderer extends VegaSlimmer {
|
|
|
44
57
|
}
|
|
45
58
|
};
|
|
46
59
|
this.renderSingleSelected = () => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
60
|
+
var _a, _b;
|
|
61
|
+
const selectedLabelStr = (_b = (_a = this.selectedLabel).single) === null || _b === void 0 ? void 0 : _b.call(_a, this.value, this.selectedItem);
|
|
62
|
+
if ((typeof this.selectedLabel == 'function' && this.selectedItem) ||
|
|
63
|
+
(typeof this.selectedLabel != 'function' && selectedLabelStr)) {
|
|
64
|
+
if (typeof this.selectedLabel == 'function') {
|
|
65
|
+
return (h("span", { class: "vega-input-select-selected", part: "selected-box" },
|
|
66
|
+
h("vega-text", { overflow: "ellipsis", tooltip: { placement: 'bottom' }, key:
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
68
|
+
this.selectedItem.displayName },
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
70
|
+
this.selectedItem.displayName)));
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
return (h("span", { class: "vega-input-select-selected", part: "selected-box" },
|
|
74
|
+
h("vega-text", { overflow: "ellipsis", tooltip: { placement: 'bottom' }, key: selectedLabelStr }, selectedLabelStr)));
|
|
75
|
+
}
|
|
56
76
|
}
|
|
57
77
|
else {
|
|
58
78
|
return (h("div", { class: "vega-input-select-placeholder", part: "placeholder" }, this.translationSlimmer.t(this.placeholder)));
|
|
@@ -150,15 +170,15 @@ __decorate([
|
|
|
150
170
|
__decorate([
|
|
151
171
|
MapToComponentField()
|
|
152
172
|
], VegaInputSelectDropdownRenderer.prototype, "vegaInputSelectPrefixIconRenderer", void 0);
|
|
153
|
-
__decorate([
|
|
154
|
-
MapToComponentField()
|
|
155
|
-
], VegaInputSelectDropdownRenderer.prototype, "sourceController", void 0);
|
|
156
173
|
__decorate([
|
|
157
174
|
MapToComponentField()
|
|
158
175
|
], VegaInputSelectDropdownRenderer.prototype, "translationSlimmer", void 0);
|
|
159
176
|
__decorate([
|
|
160
177
|
MapToComponentField()
|
|
161
178
|
], VegaInputSelectDropdownRenderer.prototype, "disabled", void 0);
|
|
179
|
+
__decorate([
|
|
180
|
+
MapToComponentField()
|
|
181
|
+
], VegaInputSelectDropdownRenderer.prototype, "selectedItem", void 0);
|
|
162
182
|
__decorate([
|
|
163
183
|
MapToComponentMethod('watchVegaDropdownProps')
|
|
164
184
|
], VegaInputSelectDropdownRenderer.prototype, "watchVegaDropdownProps", null);
|
|
@@ -12,6 +12,7 @@ import { VegaInputSelectRenderer } from './slimmers/renderers/vega-input-select-
|
|
|
12
12
|
import { InjectVegaGlobalSlimmer, InjectVegaSlimmer, methodPlaceholder, } from 'vega-slimmer/core';
|
|
13
13
|
import { VegaInputSelectDropdownController } from './slimmers/controllers/vega-input-select-dropdown-controller';
|
|
14
14
|
import { VegaInputSelectValueController } from './slimmers/controllers/vega-input-select-value-controller';
|
|
15
|
+
import { VegaInputSelectItemController } from './slimmers/controllers/vega-input-select-item-controller';
|
|
15
16
|
import { VegaInputSelectDropdownRenderer } from './slimmers/renderers/vega-input-select-dropdown-renderer';
|
|
16
17
|
import { FormFieldControllerSlimmer } from '../../helpers/slimmers/form-field-controller-slimmer';
|
|
17
18
|
import { PageResizeObserverSlimmer } from '../../helpers/slimmers/page-resize-observer-slimmer';
|
|
@@ -40,6 +41,7 @@ export class VegaInputSelect {
|
|
|
40
41
|
this.vegaInputSelectValueController = new VegaInputSelectValueController();
|
|
41
42
|
this.vegaInputSelectDropdownRenderer = new VegaInputSelectDropdownRenderer();
|
|
42
43
|
this.vegaInputSelectItemsSlotController = new VegaInputSelectItemsSlotController();
|
|
44
|
+
this.vegaInputSelectItemController = new VegaInputSelectItemController();
|
|
43
45
|
this.formFieldControllerSlimmer = new FormFieldControllerSlimmer({
|
|
44
46
|
propertyRules: [
|
|
45
47
|
{
|
|
@@ -98,9 +100,13 @@ export class VegaInputSelect {
|
|
|
98
100
|
this.required = false;
|
|
99
101
|
/**
|
|
100
102
|
* Allows customization of the text displayed within the
|
|
101
|
-
* select field when multiple items are selected.
|
|
103
|
+
* select field when single or multiple items are selected.
|
|
102
104
|
* The default format for the selected label is
|
|
103
|
-
* `${number of selected items} Selected
|
|
105
|
+
* `${number of selected items} Selected` for multiple mode only.
|
|
106
|
+
*
|
|
107
|
+
* To enable all modes, use the `SelectedLabelTypeForAllModes` type.
|
|
108
|
+
* For single mode, the default format is the `displayName` of the selected item if not set
|
|
109
|
+
* For multiple mode, the default format is `${number of selected items} Selected` if not set
|
|
104
110
|
*
|
|
105
111
|
* @vegaVersion 1.35.0
|
|
106
112
|
*/
|
|
@@ -187,6 +193,9 @@ export class VegaInputSelect {
|
|
|
187
193
|
*/
|
|
188
194
|
this.size = 'default';
|
|
189
195
|
}
|
|
196
|
+
watchSelectType() {
|
|
197
|
+
methodPlaceholder();
|
|
198
|
+
}
|
|
190
199
|
watchSource() {
|
|
191
200
|
methodPlaceholder();
|
|
192
201
|
}
|
|
@@ -313,12 +322,16 @@ export class VegaInputSelect {
|
|
|
313
322
|
"type": "unknown",
|
|
314
323
|
"mutable": false,
|
|
315
324
|
"complexType": {
|
|
316
|
-
"original": "SelectedLabelType",
|
|
317
|
-
"resolved": "(value: string[]) => string",
|
|
325
|
+
"original": "SelectedLabelType | SelectedLabelTypeForAllModes",
|
|
326
|
+
"resolved": "((value: string[]) => string) | ({ single?: (value: string, selectedItem?: SelectSourceItem) => string; multiple?: (value: string[], selectedItem?: SelectSourceItem[]) => string; })",
|
|
318
327
|
"references": {
|
|
319
328
|
"SelectedLabelType": {
|
|
320
329
|
"location": "import",
|
|
321
330
|
"path": "./types"
|
|
331
|
+
},
|
|
332
|
+
"SelectedLabelTypeForAllModes": {
|
|
333
|
+
"location": "import",
|
|
334
|
+
"path": "./types"
|
|
322
335
|
}
|
|
323
336
|
}
|
|
324
337
|
},
|
|
@@ -329,9 +342,9 @@ export class VegaInputSelect {
|
|
|
329
342
|
"name": "vegaVersion",
|
|
330
343
|
"text": "1.35.0"
|
|
331
344
|
}],
|
|
332
|
-
"text": "Allows customization of the text displayed within the\n select field when multiple items are selected.\n The default format for the selected label is\n `${number of selected items} Selected
|
|
345
|
+
"text": "Allows customization of the text displayed within the\n select field when single or multiple items are selected.\n The default format for the selected label is\n `${number of selected items} Selected` for multiple mode only.\n\nTo enable all modes, use the `SelectedLabelTypeForAllModes` type.\n\t\tFor single mode, the default format is the `displayName` of the selected item if not set\n\t\tFor multiple mode, the default format is `${number of selected items} Selected` if not set"
|
|
333
346
|
},
|
|
334
|
-
"defaultValue": "(value: string[])
|
|
347
|
+
"defaultValue": "(value: string[]) =>\n\t\t`${value.length} Selected`"
|
|
335
348
|
},
|
|
336
349
|
"selectType": {
|
|
337
350
|
"type": "string",
|
|
@@ -642,7 +655,8 @@ export class VegaInputSelect {
|
|
|
642
655
|
static get states() { return {
|
|
643
656
|
"isDropdownShow": {},
|
|
644
657
|
"currentBreakpoint": {},
|
|
645
|
-
"isLazyLoading": {}
|
|
658
|
+
"isLazyLoading": {},
|
|
659
|
+
"selectedItem": {}
|
|
646
660
|
}; }
|
|
647
661
|
static get events() { return [{
|
|
648
662
|
"method": "vegaChange",
|
|
@@ -937,6 +951,9 @@ export class VegaInputSelect {
|
|
|
937
951
|
}; }
|
|
938
952
|
static get elementRef() { return "host"; }
|
|
939
953
|
static get watchers() { return [{
|
|
954
|
+
"propName": "selectType",
|
|
955
|
+
"methodName": "watchSelectType"
|
|
956
|
+
}, {
|
|
940
957
|
"propName": "source",
|
|
941
958
|
"methodName": "watchSource"
|
|
942
959
|
}, {
|
|
@@ -977,6 +994,9 @@ __decorate([
|
|
|
977
994
|
__decorate([
|
|
978
995
|
InjectVegaSlimmer()
|
|
979
996
|
], VegaInputSelect.prototype, "vegaInputSelectItemsSlotController", void 0);
|
|
997
|
+
__decorate([
|
|
998
|
+
InjectVegaSlimmer()
|
|
999
|
+
], VegaInputSelect.prototype, "vegaInputSelectItemController", void 0);
|
|
980
1000
|
__decorate([
|
|
981
1001
|
InjectVegaSlimmer()
|
|
982
1002
|
], VegaInputSelect.prototype, "formFieldControllerSlimmer", void 0);
|
|
@@ -53,22 +53,27 @@ export class VegaRTEContent {
|
|
|
53
53
|
/**
|
|
54
54
|
* Create an empty content state
|
|
55
55
|
*
|
|
56
|
+
* @param {VegaRTETransformOptions} options - Optional transformation options.
|
|
56
57
|
* @returns {VegaRTEContent} An empty content state
|
|
57
58
|
*/
|
|
58
|
-
static createEmptyContent() {
|
|
59
|
+
static createEmptyContent(options = { autoMatchFormat: true }) {
|
|
59
60
|
return VegaRTEContent.fromJSON([
|
|
60
61
|
{
|
|
61
62
|
id: generateUUID(),
|
|
62
63
|
type: 'paragraph',
|
|
64
|
+
annotations: {
|
|
65
|
+
internalWrapper: !options.autoMatchFormat,
|
|
66
|
+
},
|
|
63
67
|
nodes: [
|
|
64
68
|
{
|
|
65
69
|
id: generateUUID(),
|
|
70
|
+
annotations: { plainText: !options.autoMatchFormat },
|
|
66
71
|
type: 'text',
|
|
67
72
|
text: '',
|
|
68
73
|
},
|
|
69
74
|
],
|
|
70
75
|
},
|
|
71
|
-
]);
|
|
76
|
+
], options);
|
|
72
77
|
}
|
|
73
78
|
/**
|
|
74
79
|
* Converts HTML content to a VegaRTEContent instance.
|
|
@@ -141,8 +146,19 @@ export class VegaRTEContent {
|
|
|
141
146
|
if (options) {
|
|
142
147
|
LogUtility.warn(`The 'options' parameter in toHtml method is deprecated and will be removed in the future.`);
|
|
143
148
|
}
|
|
149
|
+
if (this.isEmpty()) {
|
|
150
|
+
return '';
|
|
151
|
+
}
|
|
144
152
|
return this.children.map((block) => block.toHtml()).join('');
|
|
145
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* Checks if the content state is empty.
|
|
156
|
+
*
|
|
157
|
+
* @returns {boolean} True if the content state is empty, false otherwise.
|
|
158
|
+
*/
|
|
159
|
+
isEmpty() {
|
|
160
|
+
return this.children.length === 0 || (this.children.length === 1 && !this.children[0].isNotEmpty());
|
|
161
|
+
}
|
|
146
162
|
/**
|
|
147
163
|
* Internal method to add the block item, remove the block item
|
|
148
164
|
*
|
|
@@ -90,7 +90,7 @@ __decorate([
|
|
|
90
90
|
MapToComponentField()
|
|
91
91
|
], RTEExtensionController.prototype, "selectionController", void 0);
|
|
92
92
|
__decorate([
|
|
93
|
-
MapToComponentMethod('
|
|
93
|
+
MapToComponentMethod('componentDidLoad')
|
|
94
94
|
], RTEExtensionController.prototype, "initialExtensionContext", null);
|
|
95
95
|
__decorate([
|
|
96
96
|
MapToComponentMethod('watchExtensions')
|
package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js
CHANGED
|
@@ -50,11 +50,12 @@ export class ValueController extends VegaSlimmer {
|
|
|
50
50
|
* Watches the value of the editor and updates the internal value.
|
|
51
51
|
*/
|
|
52
52
|
watchValueUpdate() {
|
|
53
|
+
const autoMatchFormat = this.sourceEditConfig.autoMatchFormat;
|
|
53
54
|
if (this.value && !(this.value instanceof VegaRTEContent)) {
|
|
54
|
-
this.value = VegaRTEContent.fromJSON(this.value);
|
|
55
|
+
this.value = VegaRTEContent.fromJSON(this.value, { autoMatchFormat });
|
|
55
56
|
}
|
|
56
57
|
else if (!this.value || this.value.children.length === 0) {
|
|
57
|
-
this.value = VegaRTEContent.createEmptyContent();
|
|
58
|
+
this.value = VegaRTEContent.createEmptyContent({ autoMatchFormat });
|
|
58
59
|
}
|
|
59
60
|
else {
|
|
60
61
|
this.changeEventEmitter.emit(this.value);
|
|
@@ -114,6 +115,9 @@ __decorate([
|
|
|
114
115
|
__decorate([
|
|
115
116
|
MapToComponentField()
|
|
116
117
|
], ValueController.prototype, "selectionController", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
MapToComponentField()
|
|
120
|
+
], ValueController.prototype, "sourceEditConfig", void 0);
|
|
117
121
|
__decorate([
|
|
118
122
|
MapToComponentMethod('connectedCallback')
|
|
119
123
|
], ValueController.prototype, "connectedCallback", null);
|
|
@@ -37,6 +37,9 @@ export class SourceEditToolbarButtonSlimmer extends ToolbarButtonSlimmer {
|
|
|
37
37
|
}
|
|
38
38
|
async saveSourceCode() {
|
|
39
39
|
const sourceViewValue = this.vegaRichTextEditorRenderer.getSourceCode();
|
|
40
|
+
if (!sourceViewValue && this.value.isEmpty()) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
40
43
|
if (typeof sourceViewValue === 'string') {
|
|
41
44
|
await this.valueController.flushChanges(VegaRTEContent.fromHtml(sourceViewValue, {
|
|
42
45
|
autoMatchFormat: this.sourceEditConfig.autoMatchFormat,
|
|
@@ -62,3 +65,6 @@ __decorate([
|
|
|
62
65
|
__decorate([
|
|
63
66
|
MapToComponentField()
|
|
64
67
|
], SourceEditToolbarButtonSlimmer.prototype, "sourceEditConfig", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
MapToComponentField()
|
|
70
|
+
], SourceEditToolbarButtonSlimmer.prototype, "value", void 0);
|
|
@@ -2797,6 +2797,11 @@ Line 1
|
|
|
2797
2797
|
const paragraph = content.children[0];
|
|
2798
2798
|
expect(paragraph.children[1].text).toEqual(' ');
|
|
2799
2799
|
});
|
|
2800
|
+
it('should convert empty value as expect', async () => {
|
|
2801
|
+
const emptyContent = VegaRTEContent.fromHtml('', { autoMatchFormat: false });
|
|
2802
|
+
expect(emptyContent.toHtml()).toEqual('');
|
|
2803
|
+
expect(emptyContent.toJSON()).toEqual([]);
|
|
2804
|
+
});
|
|
2800
2805
|
});
|
|
2801
2806
|
describe('fromJSON', () => {
|
|
2802
2807
|
it('should translate the paragraph as expect JSON', () => {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { F as FeatureFlag } from './feature-flag-controller-51659753.js';
|
|
2
|
-
import { V as VegaLoader, a as VegaNotify, b as VegaThemeManager, c as VegaDialog, d as VegaEventManager, e as VegaZIndexManager, f as VegaSkeletonLoader, g as VegaRTETokenExtension, h as VegaRTEFunctionExtension } from './function-extension-
|
|
2
|
+
import { V as VegaLoader, a as VegaNotify, b as VegaThemeManager, c as VegaDialog, d as VegaEventManager, e as VegaZIndexManager, f as VegaSkeletonLoader, g as VegaRTETokenExtension, h as VegaRTEFunctionExtension } from './function-extension-45e413ff.js';
|
|
3
3
|
import { M as MapToComponentMethod, V as VegaSlimmer, s as setVegaLogLevel, G as GlobalSlimmersRegistry } from './global-slimmer-registry-17c4efd4.js';
|
|
4
4
|
import { v as vegaEnvManager } from './vega-env-manager-8f8dc473.js';
|
|
5
5
|
import { V as VegaIconManager } from './internal-icon-manager-f0486245.js';
|
|
6
6
|
import './wait-for-vega-handler-c2c07ac3.js';
|
|
7
7
|
import './ui-bb99c0c2.js';
|
|
8
8
|
import { V as VegaInternalTranslation, a as VegaTranslation, s as staticTranslations } from './translation-96e5debd.js';
|
|
9
|
-
import { V as VegaRTEContent } from './dto-renderer-manager-
|
|
9
|
+
import { V as VegaRTEContent } from './dto-renderer-manager-402e89d0.js';
|
|
10
10
|
import { v as vegaNonceManager, s as setVegaNonce } from './vega-nonce-manager-497e5eb5.js';
|
|
11
|
-
import { V as VegaRTEPresetToolbarItems } from './code-block-
|
|
11
|
+
import { V as VegaRTEPresetToolbarItems } from './code-block-4e0d321d.js';
|
|
12
12
|
import './type-guard-b48aec98.js';
|
|
13
13
|
import { T as TypographyUrls } from './typography-396de03f.js';
|
|
14
14
|
import { V as ValidCreditCardNumberRule } from './valid-credit-card-number-rule-96eaf9b1.js';
|
|
15
15
|
import { w as waitForVega } from './index-0d487fae.js';
|
|
16
|
-
import { V as VegaRTELanguageExtension } from './language-extension-
|
|
16
|
+
import { V as VegaRTELanguageExtension } from './language-extension-4bed2436.js';
|
|
17
17
|
import { U as UPDATE_TRANSLATION } from './static-subject-title-52f93124.js';
|
|
18
18
|
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
19
19
|
import { O as Observer } from './observer-3959f9dd.js';
|
|
@@ -398,7 +398,7 @@ function injectVegaRichTextEditorClassIntoGlobal() {
|
|
|
398
398
|
* Inject VegaPublicValidationRules to global as a public api
|
|
399
399
|
*/
|
|
400
400
|
function injectVegaPublicValidationRules() {
|
|
401
|
-
void import('./public-rules-
|
|
401
|
+
void import('./public-rules-05e83e40.js').then((module) => {
|
|
402
402
|
Object.entries(module).forEach(([name, value]) => {
|
|
403
403
|
globalThis[name] = value;
|
|
404
404
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { M as MapToComponentMethod, V as VegaSlimmer, L as LogUtility, c as MapToComponentField } from './global-slimmer-registry-17c4efd4.js';
|
|
2
|
-
import { a0 as RTECodeBlockNode, b as RTETextNode, Z as ZERO_WIDTH_SPACE, _ as SelectionChangeAction, k as InternalAnnotationTypeEnum, s as stateEntityRenderingRegistry, f as RTEBlock, i as RTENode, z as RTEDecoratorNode, x as RTECodeBlock } from './code-block-
|
|
2
|
+
import { a0 as RTECodeBlockNode, b as RTETextNode, Z as ZERO_WIDTH_SPACE, _ as SelectionChangeAction, k as InternalAnnotationTypeEnum, s as stateEntityRenderingRegistry, f as RTEBlock, i as RTENode, z as RTEDecoratorNode, x as RTECodeBlock } from './code-block-4e0d321d.js';
|
|
3
3
|
import { d as debounce } from './timer-9321173b.js';
|
|
4
4
|
import { g as getActiveElement } from './component-7d906393.js';
|
|
5
5
|
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
6
6
|
import { d as domNodeSubjectFactory, D as DomNodeSubjectObserverFactory } from './dom-node-subject-observer-factory-1aaa1159.js';
|
|
7
7
|
import { c as VegaInternalRichTextEditorSelectionRangeChange, a as VegaInternalUpdateRTECursorPosition } from './vega-internal-event-id-4a06d705.js';
|
|
8
8
|
import { O as Observer } from './observer-3959f9dd.js';
|
|
9
|
-
import { R as RTERange } from './range-
|
|
9
|
+
import { R as RTERange } from './range-5086f250.js';
|
|
10
10
|
import { S as SynchronizeTaskQueue } from './synchronize-task-queue-ac8acc3b.js';
|
|
11
11
|
import { i as isHTMLElement } from './ui-bb99c0c2.js';
|
|
12
12
|
import { K as KeyboardManagerSlimmer } from './keyboard-manager-slimmer-e303cb7d.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as StateVariantFormatter, k as isBorderColorTokenType, b as BorderColors, e as BorderColorMap, l as isShadowsTokenType, f as Shadows, g as ShadowMap, m as isBorderTokenType, n as Borders, o as BorderMap, p as StateBackgroundColorFormatter, q as isSpacingTokenType, r as isBorderRadiusTokenType, s as isBackgroundColorTokenType, t as isTextColorTokenType, u as isBreakpointsTokenType, h as Spacing, v as isBorderStyleType, B as BorderRadius, C as Colors, w as isTypographyTokenType } from './type-guard-b48aec98.js';
|
|
2
2
|
import { B as Breakpoints } from './breakpoints-d9faf11c.js';
|
|
3
3
|
import { L as LogUtility } from './global-slimmer-registry-17c4efd4.js';
|
|
4
|
-
import { R as ResponsiveFormatFacade } from './responsive-format-facade-
|
|
4
|
+
import { R as ResponsiveFormatFacade } from './responsive-format-facade-f995d6de.js';
|
|
5
5
|
import { a as TypographyKeys } from './typography-396de03f.js';
|
|
6
6
|
import { B as BorderStyle } from './ui-28fd4193.js';
|
|
7
7
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as ActionHandleStrategy, e as RTETextBlock, b as RTETextNode, h as AppendChildrenAction, A as ActionHandleStrategyRegistry, T as TextStyleAnnotationAction, B as BlockUpdateTextStyleStrategy, H as HorizontalAlignmentAnnotationAction, l as BlockUpdateHorizontalAlignmentStrategy, c as ModifyContentActionType, m as BlockInsertLineBreakStrategy, n as BlockInsertLineBreakWithBlocksStrategy, o as BlockSplitWithTextNodeStrategy, p as BlockReplaceNodesStrategy, q as BlockMergeNodesStrategy, I as InsertChildrenAfterAction, r as RemoveChildrenAction, S as SyncUpSelectionAction, j as InsertChildrenBeforeAction, t as BlockAnnotation, u as BlockAnnotationTypeEnum, f as RTEBlock, v as CustomStyleAnnotation, w as CustomClassAnnotation, C as CustomAttributeAnnotation, x as RTECodeBlock, s as stateEntityRenderingRegistry, N as NodeAnnotation, y as NodeAnnotationTypeEnum, z as RTEDecoratorNode, D as NodeTypeEnum, E as CommonAnnotation, F as AnnotationAction, G as ReplaceChildNodesAction, M as ModifyContentAction, J as SplitBlockWithNodeAction, K as BlockDeleteNodeContentStrategy, U as UpdateTextAction, L as RemoveChildrenStrategy, O as RTE_TEXT_COLORS, P as RTE_DEFAULT_TEXT_COLOR, R as RTEDTOClassManager } from './code-block-
|
|
1
|
+
import { d as ActionHandleStrategy, e as RTETextBlock, b as RTETextNode, h as AppendChildrenAction, A as ActionHandleStrategyRegistry, T as TextStyleAnnotationAction, B as BlockUpdateTextStyleStrategy, H as HorizontalAlignmentAnnotationAction, l as BlockUpdateHorizontalAlignmentStrategy, c as ModifyContentActionType, m as BlockInsertLineBreakStrategy, n as BlockInsertLineBreakWithBlocksStrategy, o as BlockSplitWithTextNodeStrategy, p as BlockReplaceNodesStrategy, q as BlockMergeNodesStrategy, I as InsertChildrenAfterAction, r as RemoveChildrenAction, S as SyncUpSelectionAction, j as InsertChildrenBeforeAction, t as BlockAnnotation, u as BlockAnnotationTypeEnum, f as RTEBlock, v as CustomStyleAnnotation, w as CustomClassAnnotation, C as CustomAttributeAnnotation, x as RTECodeBlock, s as stateEntityRenderingRegistry, N as NodeAnnotation, y as NodeAnnotationTypeEnum, z as RTEDecoratorNode, D as NodeTypeEnum, E as CommonAnnotation, F as AnnotationAction, G as ReplaceChildNodesAction, M as ModifyContentAction, J as SplitBlockWithNodeAction, K as BlockDeleteNodeContentStrategy, U as UpdateTextAction, L as RemoveChildrenStrategy, O as RTE_TEXT_COLORS, P as RTE_DEFAULT_TEXT_COLOR, R as RTEDTOClassManager } from './code-block-4e0d321d.js';
|
|
2
2
|
import { g as generateUUID } from './create-public-api-runtime-metrics-slimmer-bedf3a1e.js';
|
|
3
3
|
import { i as isNonNullable } from './type-guard-b48aec98.js';
|
|
4
4
|
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
@@ -3661,22 +3661,27 @@ class VegaRTEContent {
|
|
|
3661
3661
|
/**
|
|
3662
3662
|
* Create an empty content state
|
|
3663
3663
|
*
|
|
3664
|
+
* @param {VegaRTETransformOptions} options - Optional transformation options.
|
|
3664
3665
|
* @returns {VegaRTEContent} An empty content state
|
|
3665
3666
|
*/
|
|
3666
|
-
static createEmptyContent() {
|
|
3667
|
+
static createEmptyContent(options = { autoMatchFormat: true }) {
|
|
3667
3668
|
return VegaRTEContent.fromJSON([
|
|
3668
3669
|
{
|
|
3669
3670
|
id: generateUUID(),
|
|
3670
3671
|
type: 'paragraph',
|
|
3672
|
+
annotations: {
|
|
3673
|
+
internalWrapper: !options.autoMatchFormat,
|
|
3674
|
+
},
|
|
3671
3675
|
nodes: [
|
|
3672
3676
|
{
|
|
3673
3677
|
id: generateUUID(),
|
|
3678
|
+
annotations: { plainText: !options.autoMatchFormat },
|
|
3674
3679
|
type: 'text',
|
|
3675
3680
|
text: '',
|
|
3676
3681
|
},
|
|
3677
3682
|
],
|
|
3678
3683
|
},
|
|
3679
|
-
]);
|
|
3684
|
+
], options);
|
|
3680
3685
|
}
|
|
3681
3686
|
/**
|
|
3682
3687
|
* Converts HTML content to a VegaRTEContent instance.
|
|
@@ -3749,8 +3754,19 @@ class VegaRTEContent {
|
|
|
3749
3754
|
if (options) {
|
|
3750
3755
|
LogUtility.warn(`The 'options' parameter in toHtml method is deprecated and will be removed in the future.`);
|
|
3751
3756
|
}
|
|
3757
|
+
if (this.isEmpty()) {
|
|
3758
|
+
return '';
|
|
3759
|
+
}
|
|
3752
3760
|
return this.children.map((block) => block.toHtml()).join('');
|
|
3753
3761
|
}
|
|
3762
|
+
/**
|
|
3763
|
+
* Checks if the content state is empty.
|
|
3764
|
+
*
|
|
3765
|
+
* @returns {boolean} True if the content state is empty, false otherwise.
|
|
3766
|
+
*/
|
|
3767
|
+
isEmpty() {
|
|
3768
|
+
return this.children.length === 0 || (this.children.length === 1 && !this.children[0].isNotEmpty());
|
|
3769
|
+
}
|
|
3754
3770
|
/**
|
|
3755
3771
|
* Internal method to add the block item, remove the block item
|
|
3756
3772
|
*
|
package/dist/esm/{element-appender-slimmer-b9890dcb.js → element-appender-slimmer-7e7aa230.js}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { c as MapToComponentField, I as InjectVegaSlimmer, V as VegaSlimmer, L as LogUtility, M as MapToComponentMethod } from './global-slimmer-registry-17c4efd4.js';
|
|
2
2
|
import { f as findParent, d as isElementVisible, b as isParent } from './ui-bb99c0c2.js';
|
|
3
|
-
import { n as InternalVegaZIndexManager } from './function-extension-
|
|
3
|
+
import { n as InternalVegaZIndexManager } from './function-extension-45e413ff.js';
|
|
4
4
|
import { c as createDynamicSlimmer } from './dynamic-slimmer-90b8af32.js';
|
|
5
5
|
import { P as PageResizeObserverSlimmer } from './page-resize-observer-slimmer-8744cb44.js';
|
|
6
6
|
import { P as Placements, A as Alignments } from './ui-28fd4193.js';
|
|
7
7
|
import { H as isTranslocationType } from './type-guard-b48aec98.js';
|
|
8
|
-
import { R as ResponsiveFormatFacade } from './responsive-format-facade-
|
|
8
|
+
import { R as ResponsiveFormatFacade } from './responsive-format-facade-f995d6de.js';
|
|
9
9
|
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
10
10
|
import { S as SHADOW_ROOT_ELEMENT_SCROLLING } from './static-subject-title-52f93124.js';
|
|
11
11
|
import { O as Observer } from './observer-3959f9dd.js';
|
|
@@ -6,8 +6,8 @@ import { P as PageResizeObserverSlimmer } from './page-resize-observer-slimmer-8
|
|
|
6
6
|
import { V as VegaInternalThemeManager } from './dark-mode-style-controller-de88a117.js';
|
|
7
7
|
import { i as internalVegaEventManager } from './internal-vega-event-manager-fdee2a0a.js';
|
|
8
8
|
import { c as convertToNumber } from './number-4398f2e1.js';
|
|
9
|
-
import { R as RTEDTORendererManager, a as RTEDTOActionStrategyManager, E as ElementToDTOClassStrategyManager, U as UpdateCursorPositionAction, b as ElementToDTOStrategy, h as htmlElementToAnnotationGenerator, c as RTEListItemBlock, V as VegaRTEContent, B as BlockToRTEBlockStrategyAbstract, I as InsertNewParagraphAction, d as RTEImageBlock } from './dto-renderer-manager-
|
|
10
|
-
import { s as stateEntityRenderingRegistry, A as ActionHandleStrategyRegistry, a as ActionHandlerInterceptorRegistry, R as RTEDTOClassManager, M as ModifyContentAction, b as RTETextNode, c as ModifyContentActionType, d as ActionHandleStrategy, C as CustomAttributeAnnotation, e as RTETextBlock, f as RTEBlock, g as RTEAnnotationStyle, I as InsertChildrenAfterAction, h as AppendChildrenAction, i as RTENode, j as InsertChildrenBeforeAction, k as InternalAnnotationTypeEnum } from './code-block-
|
|
9
|
+
import { R as RTEDTORendererManager, a as RTEDTOActionStrategyManager, E as ElementToDTOClassStrategyManager, U as UpdateCursorPositionAction, b as ElementToDTOStrategy, h as htmlElementToAnnotationGenerator, c as RTEListItemBlock, V as VegaRTEContent, B as BlockToRTEBlockStrategyAbstract, I as InsertNewParagraphAction, d as RTEImageBlock } from './dto-renderer-manager-402e89d0.js';
|
|
10
|
+
import { s as stateEntityRenderingRegistry, A as ActionHandleStrategyRegistry, a as ActionHandlerInterceptorRegistry, R as RTEDTOClassManager, M as ModifyContentAction, b as RTETextNode, c as ModifyContentActionType, d as ActionHandleStrategy, C as CustomAttributeAnnotation, e as RTETextBlock, f as RTEBlock, g as RTEAnnotationStyle, I as InsertChildrenAfterAction, h as AppendChildrenAction, i as RTENode, j as InsertChildrenBeforeAction, k as InternalAnnotationTypeEnum } from './code-block-4e0d321d.js';
|
|
11
11
|
import { i as isNonNullable } from './type-guard-b48aec98.js';
|
|
12
12
|
import './translation-96e5debd.js';
|
|
13
13
|
import { a as VegaInternalIconManager } from './internal-icon-manager-f0486245.js';
|
package/dist/esm/{image-annotation-action-b3eea6a2.js → image-annotation-action-2cdbbd57.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { h } from './index-090d31ca.js';
|
|
2
2
|
import { a as VegaInternalIconManager } from './internal-icon-manager-f0486245.js';
|
|
3
3
|
import { c as MapToComponentField, V as VegaSlimmer } from './global-slimmer-registry-17c4efd4.js';
|
|
4
|
-
import { A as ActionHandleStrategyRegistry, O as RTE_TEXT_COLORS, b as RTETextNode, $ as TextColorAnnotationAction, y as NodeAnnotationTypeEnum, F as AnnotationAction } from './code-block-
|
|
4
|
+
import { A as ActionHandleStrategyRegistry, O as RTE_TEXT_COLORS, b as RTETextNode, $ as TextColorAnnotationAction, y as NodeAnnotationTypeEnum, F as AnnotationAction } from './code-block-4e0d321d.js';
|
|
5
5
|
import { D as DomNodeSubjectObserverFactory, a as VegaClick, T as VegaPopoverShow, U as VegaPopoverHide, g as VegaChange } from './dom-node-subject-observer-factory-1aaa1159.js';
|
|
6
6
|
import { a as VegaDarkModeStyleController } from './dark-mode-style-controller-de88a117.js';
|
|
7
|
-
import { g as ImageAnnotation } from './dto-renderer-manager-
|
|
7
|
+
import { g as ImageAnnotation } from './dto-renderer-manager-402e89d0.js';
|
|
8
8
|
|
|
9
9
|
const text = {
|
|
10
10
|
icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path fill="currentColor" d="M64 96v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V80C0 53.5 21.5 32 48 32H224 400c26.5 0 48 21.5 48 48v48c0 17.7-14.3 32-32 32s-32-14.3-32-32V96H256l0 320h48c17.7 0 32 14.3 32 32s-14.3 32-32 32H144c-17.7 0-32-14.3-32-32s14.3-32 32-32h48l0-320H64z"/></svg>`,
|